summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-12-22 14:24:35 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-12-22 14:24:35 +0000
commitb6847336acbf2225826dc47f9d5f3c3f41f952dc (patch)
tree1af8eb4a0f45f009154145b42380596dc2244c12 /sys/dev/acpi
parent79576a2c04e9808df26b2dcf6a98437645be1349 (diff)
spacing
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r--sys/dev/acpi/amltypes.h436
1 files changed, 218 insertions, 218 deletions
diff --git a/sys/dev/acpi/amltypes.h b/sys/dev/acpi/amltypes.h
index 9084d6ef85c..b5e3d8ad13b 100644
--- a/sys/dev/acpi/amltypes.h
+++ b/sys/dev/acpi/amltypes.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: amltypes.h,v 1.22 2006/12/21 11:33:21 deraadt Exp $ */
+/* $OpenBSD: amltypes.h,v 1.23 2006/12/22 14:24:34 deraadt Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
*
@@ -19,145 +19,145 @@
#define __DEV_ACPI_AMLTYPES_H__
/* AML Opcodes */
-#define AMLOP_ZERO 0x00
-#define AMLOP_ONE 0x01
-#define AMLOP_ALIAS 0x06
-#define AMLOP_NAME 0x08
-#define AMLOP_BYTEPREFIX 0x0A
-#define AMLOP_WORDPREFIX 0x0B
-#define AMLOP_DWORDPREFIX 0x0C
-#define AMLOP_STRINGPREFIX 0x0D
-#define AMLOP_QWORDPREFIX 0x0E
-#define AMLOP_SCOPE 0x10
-#define AMLOP_BUFFER 0x11
-#define AMLOP_PACKAGE 0x12
-#define AMLOP_VARPACKAGE 0x13
-#define AMLOP_METHOD 0x14
-#define AMLOP_DUALNAMEPREFIX 0x2E
-#define AMLOP_MULTINAMEPREFIX 0x2F
-#define AMLOP_EXTPREFIX 0x5B
-#define AMLOP_MUTEX 0x5B01
-#define AMLOP_EVENT 0x5B02
-#define AMLOP_CONDREFOF 0x5B12
-#define AMLOP_CREATEFIELD 0x5B13
-#define AMLOP_LOADTABLE 0x5B1F
-#define AMLOP_LOAD 0x5B20
-#define AMLOP_STALL 0x5B21
-#define AMLOP_SLEEP 0x5B22
-#define AMLOP_ACQUIRE 0x5B23
-#define AMLOP_SIGNAL 0x5B24
-#define AMLOP_WAIT 0x5B25
-#define AMLOP_RESET 0x5B26
-#define AMLOP_RELEASE 0x5B27
-#define AMLOP_FROMBCD 0x5B28
-#define AMLOP_TOBCD 0x5B29
-#define AMLOP_UNLOAD 0x5B2A
-#define AMLOP_REVISION 0x5B30
-#define AMLOP_DEBUG 0x5B31
-#define AMLOP_FATAL 0x5B32
-#define AMLOP_TIMER 0x5B33
-#define AMLOP_OPREGION 0x5B80
-#define AMLOP_FIELD 0x5B81
-#define AMLOP_DEVICE 0x5B82
-#define AMLOP_PROCESSOR 0x5B83
-#define AMLOP_POWERRSRC 0x5B84
-#define AMLOP_THERMALZONE 0x5B85
-#define AMLOP_INDEXFIELD 0x5B86
-#define AMLOP_BANKFIELD 0x5B87
-#define AMLOP_DATAREGION 0x5B88
-#define AMLOP_ROOTCHAR 0x5C
-#define AMLOP_PARENTPREFIX 0x5E
-#define AMLOP_NAMECHAR 0x5F
-#define AMLOP_LOCAL0 0x60
-#define AMLOP_LOCAL1 0x61
-#define AMLOP_LOCAL2 0x62
-#define AMLOP_LOCAL3 0x63
-#define AMLOP_LOCAL4 0x64
-#define AMLOP_LOCAL5 0x65
-#define AMLOP_LOCAL6 0x66
-#define AMLOP_LOCAL7 0x67
-#define AMLOP_ARG0 0x68
-#define AMLOP_ARG1 0x69
-#define AMLOP_ARG2 0x6A
-#define AMLOP_ARG3 0x6B
-#define AMLOP_ARG4 0x6C
-#define AMLOP_ARG5 0x6D
-#define AMLOP_ARG6 0x6E
-#define AMLOP_STORE 0x70
-#define AMLOP_REFOF 0x71
-#define AMLOP_ADD 0x72
-#define AMLOP_CONCAT 0x73
-#define AMLOP_SUBTRACT 0x74
-#define AMLOP_INCREMENT 0x75
-#define AMLOP_DECREMENT 0x76
-#define AMLOP_MULTIPLY 0x77
-#define AMLOP_DIVIDE 0x78
-#define AMLOP_SHL 0x79
-#define AMLOP_SHR 0x7A
-#define AMLOP_AND 0x7B
-#define AMLOP_NAND 0x7C
-#define AMLOP_OR 0x7D
-#define AMLOP_NOR 0x7E
-#define AMLOP_XOR 0x7F
-#define AMLOP_NOT 0x80
-#define AMLOP_FINDSETLEFTBIT 0x81
-#define AMLOP_FINDSETRIGHTBIT 0x82
-#define AMLOP_DEREFOF 0x83
-#define AMLOP_CONCATRES 0x84
-#define AMLOP_MOD 0x85
-#define AMLOP_NOTIFY 0x86
-#define AMLOP_SIZEOF 0x87
-#define AMLOP_INDEX 0x88
-#define AMLOP_DEREFOF 0x83
-#define AMLOP_MATCH 0x89
-#define AMLOP_CREATEDWORDFIELD 0x8A
-#define AMLOP_CREATEWORDFIELD 0x8B
-#define AMLOP_CREATEBYTEFIELD 0x8C
-#define AMLOP_CREATEBITFIELD 0x8D
-#define AMLOP_OBJECTTYPE 0x8E
-#define AMLOP_CREATEQWORDFIELD 0x8F
-#define AMLOP_LAND 0x90
-#define AMLOP_LOR 0x91
-#define AMLOP_LNOT 0x92
-#define AMLOP_LNOTEQUAL 0x9293
-#define AMLOP_LLESSEQUAL 0x9294
-#define AMLOP_LGREATEREQUAL 0x9295
-#define AMLOP_LEQUAL 0x93
-#define AMLOP_LGREATER 0x94
-#define AMLOP_LLESS 0x95
-#define AMLOP_TOBUFFER 0x96
-#define AMLOP_TODECSTRING 0x97
-#define AMLOP_TOHEXSTRING 0x98
-#define AMLOP_TOINTEGER 0x99
-#define AMLOP_TOSTRING 0x9C
-#define AMLOP_COPYOBJECT 0x9D
-#define AMLOP_MID 0x9E
-#define AMLOP_CONTINUE 0x9F
-#define AMLOP_IF 0xA0
-#define AMLOP_ELSE 0xA1
-#define AMLOP_WHILE 0xA2
-#define AMLOP_NOP 0xA3
-#define AMLOP_RETURN 0xA4
-#define AMLOP_BREAK 0xA5
-#define AMLOP_BREAKPOINT 0xCC
-#define AMLOP_ONES 0xFF
+#define AMLOP_ZERO 0x00
+#define AMLOP_ONE 0x01
+#define AMLOP_ALIAS 0x06
+#define AMLOP_NAME 0x08
+#define AMLOP_BYTEPREFIX 0x0A
+#define AMLOP_WORDPREFIX 0x0B
+#define AMLOP_DWORDPREFIX 0x0C
+#define AMLOP_STRINGPREFIX 0x0D
+#define AMLOP_QWORDPREFIX 0x0E
+#define AMLOP_SCOPE 0x10
+#define AMLOP_BUFFER 0x11
+#define AMLOP_PACKAGE 0x12
+#define AMLOP_VARPACKAGE 0x13
+#define AMLOP_METHOD 0x14
+#define AMLOP_DUALNAMEPREFIX 0x2E
+#define AMLOP_MULTINAMEPREFIX 0x2F
+#define AMLOP_EXTPREFIX 0x5B
+#define AMLOP_MUTEX 0x5B01
+#define AMLOP_EVENT 0x5B02
+#define AMLOP_CONDREFOF 0x5B12
+#define AMLOP_CREATEFIELD 0x5B13
+#define AMLOP_LOADTABLE 0x5B1F
+#define AMLOP_LOAD 0x5B20
+#define AMLOP_STALL 0x5B21
+#define AMLOP_SLEEP 0x5B22
+#define AMLOP_ACQUIRE 0x5B23
+#define AMLOP_SIGNAL 0x5B24
+#define AMLOP_WAIT 0x5B25
+#define AMLOP_RESET 0x5B26
+#define AMLOP_RELEASE 0x5B27
+#define AMLOP_FROMBCD 0x5B28
+#define AMLOP_TOBCD 0x5B29
+#define AMLOP_UNLOAD 0x5B2A
+#define AMLOP_REVISION 0x5B30
+#define AMLOP_DEBUG 0x5B31
+#define AMLOP_FATAL 0x5B32
+#define AMLOP_TIMER 0x5B33
+#define AMLOP_OPREGION 0x5B80
+#define AMLOP_FIELD 0x5B81
+#define AMLOP_DEVICE 0x5B82
+#define AMLOP_PROCESSOR 0x5B83
+#define AMLOP_POWERRSRC 0x5B84
+#define AMLOP_THERMALZONE 0x5B85
+#define AMLOP_INDEXFIELD 0x5B86
+#define AMLOP_BANKFIELD 0x5B87
+#define AMLOP_DATAREGION 0x5B88
+#define AMLOP_ROOTCHAR 0x5C
+#define AMLOP_PARENTPREFIX 0x5E
+#define AMLOP_NAMECHAR 0x5F
+#define AMLOP_LOCAL0 0x60
+#define AMLOP_LOCAL1 0x61
+#define AMLOP_LOCAL2 0x62
+#define AMLOP_LOCAL3 0x63
+#define AMLOP_LOCAL4 0x64
+#define AMLOP_LOCAL5 0x65
+#define AMLOP_LOCAL6 0x66
+#define AMLOP_LOCAL7 0x67
+#define AMLOP_ARG0 0x68
+#define AMLOP_ARG1 0x69
+#define AMLOP_ARG2 0x6A
+#define AMLOP_ARG3 0x6B
+#define AMLOP_ARG4 0x6C
+#define AMLOP_ARG5 0x6D
+#define AMLOP_ARG6 0x6E
+#define AMLOP_STORE 0x70
+#define AMLOP_REFOF 0x71
+#define AMLOP_ADD 0x72
+#define AMLOP_CONCAT 0x73
+#define AMLOP_SUBTRACT 0x74
+#define AMLOP_INCREMENT 0x75
+#define AMLOP_DECREMENT 0x76
+#define AMLOP_MULTIPLY 0x77
+#define AMLOP_DIVIDE 0x78
+#define AMLOP_SHL 0x79
+#define AMLOP_SHR 0x7A
+#define AMLOP_AND 0x7B
+#define AMLOP_NAND 0x7C
+#define AMLOP_OR 0x7D
+#define AMLOP_NOR 0x7E
+#define AMLOP_XOR 0x7F
+#define AMLOP_NOT 0x80
+#define AMLOP_FINDSETLEFTBIT 0x81
+#define AMLOP_FINDSETRIGHTBIT 0x82
+#define AMLOP_DEREFOF 0x83
+#define AMLOP_CONCATRES 0x84
+#define AMLOP_MOD 0x85
+#define AMLOP_NOTIFY 0x86
+#define AMLOP_SIZEOF 0x87
+#define AMLOP_INDEX 0x88
+#define AMLOP_DEREFOF 0x83
+#define AMLOP_MATCH 0x89
+#define AMLOP_CREATEDWORDFIELD 0x8A
+#define AMLOP_CREATEWORDFIELD 0x8B
+#define AMLOP_CREATEBYTEFIELD 0x8C
+#define AMLOP_CREATEBITFIELD 0x8D
+#define AMLOP_OBJECTTYPE 0x8E
+#define AMLOP_CREATEQWORDFIELD 0x8F
+#define AMLOP_LAND 0x90
+#define AMLOP_LOR 0x91
+#define AMLOP_LNOT 0x92
+#define AMLOP_LNOTEQUAL 0x9293
+#define AMLOP_LLESSEQUAL 0x9294
+#define AMLOP_LGREATEREQUAL 0x9295
+#define AMLOP_LEQUAL 0x93
+#define AMLOP_LGREATER 0x94
+#define AMLOP_LLESS 0x95
+#define AMLOP_TOBUFFER 0x96
+#define AMLOP_TODECSTRING 0x97
+#define AMLOP_TOHEXSTRING 0x98
+#define AMLOP_TOINTEGER 0x99
+#define AMLOP_TOSTRING 0x9C
+#define AMLOP_COPYOBJECT 0x9D
+#define AMLOP_MID 0x9E
+#define AMLOP_CONTINUE 0x9F
+#define AMLOP_IF 0xA0
+#define AMLOP_ELSE 0xA1
+#define AMLOP_WHILE 0xA2
+#define AMLOP_NOP 0xA3
+#define AMLOP_RETURN 0xA4
+#define AMLOP_BREAK 0xA5
+#define AMLOP_BREAKPOINT 0xCC
+#define AMLOP_ONES 0xFF
-#define AMLOP_FIELDUNIT 0xFE00
-#define AML_ANYINT 0xFF00
+#define AMLOP_FIELDUNIT 0xFE00
+#define AML_ANYINT 0xFF00
/*
* Comparison types for Match()
*
* true,==,<=,<,>=,>
*/
-#define AML_MATCH_TR 0
-#define AML_MATCH_EQ 1
-#define AML_MATCH_LE 2
-#define AML_MATCH_LT 3
-#define AML_MATCH_GE 4
-#define AML_MATCH_GT 5
+#define AML_MATCH_TR 0
+#define AML_MATCH_EQ 1
+#define AML_MATCH_LE 2
+#define AML_MATCH_LT 3
+#define AML_MATCH_GE 4
+#define AML_MATCH_GT 5
-#define AML_STATIC 0x8000
+#define AML_STATIC 0x8000
/* Defined types for ObjectType() */
enum aml_objecttype {
@@ -184,56 +184,56 @@ enum aml_objecttype {
};
/* AML Opcode Arguments */
-#define AML_ARG_INTEGER 'i'
-#define AML_ARG_BYTE 'b'
-#define AML_ARG_WORD 'w'
-#define AML_ARG_DWORD 'd'
-#define AML_ARG_QWORD 'q'
-#define AML_ARG_IMPBYTE '!'
-#define AML_ARG_OBJLEN 'p'
-#define AML_ARG_STRING 'a'
-#define AML_ARG_BYTELIST 'B'
-#define AML_ARG_REVISION 'R'
+#define AML_ARG_INTEGER 'i'
+#define AML_ARG_BYTE 'b'
+#define AML_ARG_WORD 'w'
+#define AML_ARG_DWORD 'd'
+#define AML_ARG_QWORD 'q'
+#define AML_ARG_IMPBYTE '!'
+#define AML_ARG_OBJLEN 'p'
+#define AML_ARG_STRING 'a'
+#define AML_ARG_BYTELIST 'B'
+#define AML_ARG_REVISION 'R'
-#define AML_ARG_METHOD 'M'
-#define AML_ARG_NAMESTRING 'N'
-#define AML_ARG_NAMEREF 'n'
-#define AML_ARG_FIELDLIST 'F'
-#define AML_ARG_FLAG 'f'
+#define AML_ARG_METHOD 'M'
+#define AML_ARG_NAMESTRING 'N'
+#define AML_ARG_NAMEREF 'n'
+#define AML_ARG_FIELDLIST 'F'
+#define AML_ARG_FLAG 'f'
-#define AML_ARG_DATAOBJLIST 'O'
-#define AML_ARG_DATAOBJ 'o'
+#define AML_ARG_DATAOBJLIST 'O'
+#define AML_ARG_DATAOBJ 'o'
-#define AML_ARG_SIMPLENAME 's'
-#define AML_ARG_SUPERNAME 'S'
+#define AML_ARG_SIMPLENAME 's'
+#define AML_ARG_SUPERNAME 'S'
-#define AML_ARG_TERMOBJLIST 'T'
-#define AML_ARG_TERMOBJ 't'
+#define AML_ARG_TERMOBJLIST 'T'
+#define AML_ARG_TERMOBJ 't'
-#define AML_METHOD_ARGCOUNT(v) (((v) >> 0) & 0x7)
-#define AML_METHOD_SERIALIZED(v) (((v) >> 3) & 0x1)
-#define AML_METHOD_SYNCLEVEL(v) (((v) >> 4) & 0xF)
+#define AML_METHOD_ARGCOUNT(v) (((v) >> 0) & 0x7)
+#define AML_METHOD_SERIALIZED(v) (((v) >> 3) & 0x1)
+#define AML_METHOD_SYNCLEVEL(v) (((v) >> 4) & 0xF)
-#define AML_FIELD_ACCESSMASK 0x0F
-#define AML_FIELD_SETATTR(f,t,a) (((f) & 0xF0) | ((t) & 0xF) | ((a)<<8))
-#define AML_FIELD_ACCESS(v) (((v) >> 0) & 0xF)
-# define AML_FIELD_ANYACC 0x0
-# define AML_FIELD_BYTEACC 0x1
-# define AML_FIELD_WORDACC 0x2
-# define AML_FIELD_DWORDACC 0x3
-# define AML_FIELD_QWORDACC 0x4
-# define AML_FIELD_BUFFERACC 0x5
-#define AML_FIELD_LOCK(v) (((v) >> 4) & 0x1)
-# define AML_FIELD_LOCK_OFF 0x0
-# define AML_FIELD_LOCK_ON 0x1
-#define AML_FIELD_UPDATE(v) (((v) >> 5) & 0x3)
-# define AML_FIELD_PRESERVE 0x0
-# define AML_FIELD_WRITEASONES 0x1
-# define AML_FIELD_WRITEASZEROES 0x2
-#define AML_FIELD_ATTR(v) ((v) >> 8)
-#define AML_FIELD_RESERVED 0x00
+#define AML_FIELD_ACCESSMASK 0x0F
+#define AML_FIELD_SETATTR(f,t,a) (((f) & 0xF0) | ((t) & 0xF) | ((a)<<8))
+#define AML_FIELD_ACCESS(v) (((v) >> 0) & 0xF)
+# define AML_FIELD_ANYACC 0x0
+# define AML_FIELD_BYTEACC 0x1
+# define AML_FIELD_WORDACC 0x2
+# define AML_FIELD_DWORDACC 0x3
+# define AML_FIELD_QWORDACC 0x4
+# define AML_FIELD_BUFFERACC 0x5
+#define AML_FIELD_LOCK(v) (((v) >> 4) & 0x1)
+# define AML_FIELD_LOCK_OFF 0x0
+# define AML_FIELD_LOCK_ON 0x1
+#define AML_FIELD_UPDATE(v) (((v) >> 5) & 0x3)
+# define AML_FIELD_PRESERVE 0x0
+# define AML_FIELD_WRITEASONES 0x1
+# define AML_FIELD_WRITEASZEROES 0x2
+#define AML_FIELD_ATTR(v) ((v) >> 8)
+#define AML_FIELD_RESERVED 0x00
/* XXX fix this name */
-#define AML_FIELD_ATTR__ 0x01
+#define AML_FIELD_ATTR__ 0x01
struct aml_node;
@@ -241,13 +241,13 @@ struct aml_node;
struct aml_value {
int type;
int length;
- int refcnt;
- int stack;
+ int refcnt;
+ int stack;
struct aml_node *node;
union {
- int64_t vinteger;
- char *vstring;
- u_int8_t *vbuffer;
+ int64_t vinteger;
+ char *vstring;
+ u_int8_t *vbuffer;
struct aml_value **vpackage;
struct {
u_int8_t iospace;
@@ -255,9 +255,9 @@ struct aml_value {
u_int32_t iolen;
} vopregion;
struct {
- int flags;
- u_int8_t *start;
- u_int8_t *end;
+ int flags;
+ u_int8_t *start;
+ u_int8_t *end;
} vmethod;
struct {
u_int16_t type;
@@ -266,7 +266,7 @@ struct aml_value {
u_int32_t bitlen;
struct aml_value *ref1;
struct aml_value *ref2;
- int ref3;
+ int ref3;
} vfield;
struct {
u_int8_t proc_id;
@@ -274,7 +274,7 @@ struct aml_value {
u_int8_t proc_len;
} vprocessor;
struct {
- int index;
+ int index;
struct aml_value *ref;
} vobjref;
struct {
@@ -285,51 +285,51 @@ struct aml_value {
} _;
};
-#define v_nameref _.vbuffer
-#define v_objref _.vobjref
-#define v_integer _.vinteger
-#define v_string _.vstring
-#define v_buffer _.vbuffer
-#define v_package _.vpackage
-#define v_field _.vfield
-#define v_opregion _.vopregion
-#define v_method _.vmethod
-#define v_processor _.vprocessor
-#define v_powerrsrc _.vpowerrsrc
-#define v_mutex _.vmutex
+#define v_nameref _.vbuffer
+#define v_objref _.vobjref
+#define v_integer _.vinteger
+#define v_string _.vstring
+#define v_buffer _.vbuffer
+#define v_package _.vpackage
+#define v_field _.vfield
+#define v_opregion _.vopregion
+#define v_method _.vmethod
+#define v_processor _.vprocessor
+#define v_powerrsrc _.vpowerrsrc
+#define v_mutex _.vmutex
-#define xaml_intval(v) ((v)->v_integer)
-#define aml_strlen(v) ((v)->length)
-#define aml_strval(v) ((v)->v_string ? (v)->v_string : "bad string")
-#define aml_buflen(v) ((v)->length)
-#define aml_bufval(v) ((v)->v_buffer)
-#define aml_pkglen(v) ((v)->length)
-#define aml_pkgval(v,i) (&(v)->v_package[(i)])
+#define xaml_intval(v) ((v)->v_integer)
+#define aml_strlen(v) ((v)->length)
+#define aml_strval(v) ((v)->v_string ? (v)->v_string : "bad string")
+#define aml_buflen(v) ((v)->length)
+#define aml_bufval(v) ((v)->v_buffer)
+#define aml_pkglen(v) ((v)->length)
+#define aml_pkgval(v,i) (&(v)->v_package[(i)])
struct aml_node {
struct aml_node *parent;
struct aml_node *child;
struct aml_node *sibling;
- char name[5];
- u_int16_t opcode;
- u_int8_t *start;
- u_int8_t *end;
- // const char *name;
- // const char *mnem;
+ char name[5];
+ u_int16_t opcode;
+ u_int8_t *start;
+ u_int8_t *end;
+ // const char *name;
+ // const char *mnem;
struct aml_value *value;
- int depth;
+ int depth;
};
-#define AML_FALSE (0)
-#define AML_TRUE (1)
+#define AML_FALSE (0)
+#define AML_TRUE (1)
-#define aml_bitmask(n) (1L << ((n) & 0x7))
-#define aml_bitpos(n) ((n)&0x7)
-#define aml_bytepos(n) ((n)>>3)
-#define aml_bytelen(n) (((n)+7)>>3)
-#define aml_bytealigned(x) !((x)&0x7)
+#define aml_bitmask(n) (1L << ((n) & 0x7))
+#define aml_bitpos(n) ((n)&0x7)
+#define aml_bytepos(n) ((n)>>3)
+#define aml_bytelen(n) (((n)+7)>>3)
+#define aml_bytealigned(x) !((x)&0x7)
#endif /* __DEV_ACPI_AMLTYPES_H__ */