summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/aclocal.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/aclocal.h')
-rw-r--r--sys/contrib/dev/acpica/aclocal.h647
1 files changed, 292 insertions, 355 deletions
diff --git a/sys/contrib/dev/acpica/aclocal.h b/sys/contrib/dev/acpica/aclocal.h
index e021acc..86e28bc 100644
--- a/sys/contrib/dev/acpica/aclocal.h
+++ b/sys/contrib/dev/acpica/aclocal.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: aclocal.h - Internal data types used across the ACPI subsystem
- * $Revision: 104 $
+ * $Revision: 121 $
*
*****************************************************************************/
@@ -118,20 +118,20 @@
#define __ACLOCAL_H__
-#define WAIT_FOREVER ((UINT32) -1)
+#define WAIT_FOREVER ((UINT32) -1)
-typedef void* ACPI_MUTEX;
-typedef UINT32 ACPI_MUTEX_HANDLE;
+typedef void* ACPI_MUTEX;
+typedef UINT32 ACPI_MUTEX_HANDLE;
/* Object descriptor types */
-#define ACPI_CACHED_OBJECT 0x11 /* ORed in when object is cached */
-#define ACPI_DESC_TYPE_STATE 0x22
-#define ACPI_DESC_TYPE_WALK 0x44
-#define ACPI_DESC_TYPE_PARSER 0x66
-#define ACPI_DESC_TYPE_INTERNAL 0x88
-#define ACPI_DESC_TYPE_NAMED 0xAA
+#define ACPI_CACHED_OBJECT 0x11 /* ORed in when object is cached */
+#define ACPI_DESC_TYPE_STATE 0x22
+#define ACPI_DESC_TYPE_WALK 0x44
+#define ACPI_DESC_TYPE_PARSER 0x66
+#define ACPI_DESC_TYPE_INTERNAL 0x88
+#define ACPI_DESC_TYPE_NAMED 0xAA
/*****************************************************************************
@@ -143,26 +143,30 @@ typedef UINT32 ACPI_MUTEX_HANDLE;
/*
* Predefined handles for the mutex objects used within the subsystem
- * All mutex objects are automatically created by AcpiCmMutexInitialize.
+ * All mutex objects are automatically created by AcpiUtMutexInitialize.
+ *
+ * The acquire/release ordering protocol is implied via this list. Mutexes
+ * with a lower value must be acquired before mutexes with a higher value.
+ *
* NOTE: any changes here must be reflected in the AcpiGbl_MutexNames table also!
*/
-#define ACPI_MTX_HARDWARE 0
-#define ACPI_MTX_MEMORY 1
-#define ACPI_MTX_CACHES 2
-#define ACPI_MTX_TABLES 3
-#define ACPI_MTX_PARSER 4
-#define ACPI_MTX_DISPATCHER 5
-#define ACPI_MTX_INTERPRETER 6
-#define ACPI_MTX_EXECUTE 7
-#define ACPI_MTX_NAMESPACE 8
-#define ACPI_MTX_EVENTS 9
-#define ACPI_MTX_OP_REGIONS 10
-#define ACPI_MTX_DEBUG_CMD_READY 11
-#define ACPI_MTX_DEBUG_CMD_COMPLETE 12
+#define ACPI_MTX_EXECUTE 0
+#define ACPI_MTX_INTERPRETER 1
+#define ACPI_MTX_PARSER 2
+#define ACPI_MTX_DISPATCHER 3
+#define ACPI_MTX_TABLES 4
+#define ACPI_MTX_OP_REGIONS 5
+#define ACPI_MTX_NAMESPACE 6
+#define ACPI_MTX_EVENTS 7
+#define ACPI_MTX_HARDWARE 8
+#define ACPI_MTX_CACHES 9
+#define ACPI_MTX_MEMORY 10
+#define ACPI_MTX_DEBUG_CMD_COMPLETE 11
+#define ACPI_MTX_DEBUG_CMD_READY 12
-#define MAX_MTX 12
-#define NUM_MTX MAX_MTX+1
+#define MAX_MTX 12
+#define NUM_MTX MAX_MTX+1
#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER)
@@ -172,19 +176,19 @@ typedef UINT32 ACPI_MUTEX_HANDLE;
static NATIVE_CHAR *AcpiGbl_MutexNames[] =
{
- "ACPI_MTX_Hardware",
- "ACPI_MTX_Memory",
- "ACPI_MTX_Caches",
- "ACPI_MTX_Tables",
+ "ACPI_MTX_Execute",
+ "ACPI_MTX_Interpreter",
"ACPI_MTX_Parser",
"ACPI_MTX_Dispatcher",
- "ACPI_MTX_Interpreter",
- "ACPI_MTX_Execute",
+ "ACPI_MTX_Tables",
+ "ACPI_MTX_OpRegions",
"ACPI_MTX_Namespace",
"ACPI_MTX_Events",
- "ACPI_MTX_OpRegions",
+ "ACPI_MTX_Hardware",
+ "ACPI_MTX_Caches",
+ "ACPI_MTX_Memory",
+ "ACPI_MTX_DebugCmdComplete",
"ACPI_MTX_DebugCmdReady",
- "ACPI_MTX_DebugCmdComplete"
};
#endif
@@ -197,26 +201,38 @@ typedef struct AcpiMutexInfo
{
ACPI_MUTEX Mutex;
UINT32 UseCount;
- BOOLEAN Locked;
+ UINT32 OwnerId;
} ACPI_MUTEX_INFO;
+/* This owner ID means that the mutex is not in use (unlocked) */
+
+#define ACPI_MUTEX_NOT_ACQUIRED (UINT32) (-1)
+
/* Lock flag parameter for various interfaces */
-#define ACPI_MTX_DO_NOT_LOCK 0
-#define ACPI_MTX_LOCK 1
+#define ACPI_MTX_DO_NOT_LOCK 0
+#define ACPI_MTX_LOCK 1
-typedef UINT16 ACPI_OWNER_ID;
-#define OWNER_TYPE_TABLE 0x0
-#define OWNER_TYPE_METHOD 0x1
-#define FIRST_METHOD_ID 0x0000
-#define FIRST_TABLE_ID 0x8000
+typedef UINT16 ACPI_OWNER_ID;
+#define OWNER_TYPE_TABLE 0x0
+#define OWNER_TYPE_METHOD 0x1
+#define FIRST_METHOD_ID 0x0000
+#define FIRST_TABLE_ID 0x8000
/* TBD: [Restructure] get rid of the need for this! */
-#define TABLE_ID_DSDT (ACPI_OWNER_ID) 0x8000
+#define TABLE_ID_DSDT (ACPI_OWNER_ID) 0x8000
+
+
+/* Field access granularities */
+
+#define ACPI_FIELD_BYTE_GRANULARITY 1
+#define ACPI_FIELD_WORD_GRANULARITY 2
+#define ACPI_FIELD_DWORD_GRANULARITY 4
+#define ACPI_FIELD_QWORD_GRANULARITY 8
/*****************************************************************************
*
@@ -266,13 +282,13 @@ typedef struct acpi_node
/* Node flags */
-#define ANOBJ_AML_ATTACHMENT 0x01
-#define ANOBJ_END_OF_PEER_LIST 0x02
-#define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */
-#define ANOBJ_METHOD_ARG 0x08
-#define ANOBJ_METHOD_LOCAL 0x10
-#define ANOBJ_METHOD_NO_RETVAL 0x20
-#define ANOBJ_METHOD_SOME_NO_RETVAL 0x40
+#define ANOBJ_AML_ATTACHMENT 0x01
+#define ANOBJ_END_OF_PEER_LIST 0x02
+#define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */
+#define ANOBJ_METHOD_ARG 0x08
+#define ANOBJ_METHOD_LOCAL 0x10
+#define ANOBJ_METHOD_NO_RETVAL 0x20
+#define ANOBJ_METHOD_SOME_NO_RETVAL 0x40
/*
@@ -316,19 +332,36 @@ typedef struct
/*
* Predefined Namespace items
*/
-#define ACPI_MAX_ADDRESS_SPACE 255
-#define ACPI_NUM_ADDRESS_SPACES 256
-
-
typedef struct
{
NATIVE_CHAR *Name;
- ACPI_OBJECT_TYPE Type;
+ ACPI_OBJECT_TYPE8 Type;
NATIVE_CHAR *Val;
} PREDEFINED_NAMES;
+/* Object types used during package copies */
+
+
+#define ACPI_COPY_TYPE_SIMPLE 0
+#define ACPI_COPY_TYPE_PACKAGE 1
+
+/* Info structure used to convert external<->internal namestrings */
+
+typedef struct acpi_namestring_info
+{
+ NATIVE_CHAR *ExternalName;
+ NATIVE_CHAR *NextExternalChar;
+ NATIVE_CHAR *InternalName;
+ UINT32 Length;
+ UINT32 NumSegments;
+ UINT32 NumCarats;
+ BOOLEAN FullyQualified;
+
+} ACPI_NAMESTRING_INFO;
+
+
/*****************************************************************************
*
* Event typedefs and structs
@@ -338,19 +371,19 @@ typedef struct
/* Status bits. */
-#define ACPI_STATUS_PMTIMER 0x0001
-#define ACPI_STATUS_GLOBAL 0x0020
-#define ACPI_STATUS_POWER_BUTTON 0x0100
-#define ACPI_STATUS_SLEEP_BUTTON 0x0200
-#define ACPI_STATUS_RTC_ALARM 0x0400
+#define ACPI_STATUS_PMTIMER 0x0001
+#define ACPI_STATUS_GLOBAL 0x0020
+#define ACPI_STATUS_POWER_BUTTON 0x0100
+#define ACPI_STATUS_SLEEP_BUTTON 0x0200
+#define ACPI_STATUS_RTC_ALARM 0x0400
/* Enable bits. */
-#define ACPI_ENABLE_PMTIMER 0x0001
-#define ACPI_ENABLE_GLOBAL 0x0020
-#define ACPI_ENABLE_POWER_BUTTON 0x0100
-#define ACPI_ENABLE_SLEEP_BUTTON 0x0200
-#define ACPI_ENABLE_RTC_ALARM 0x0400
+#define ACPI_ENABLE_PMTIMER 0x0001
+#define ACPI_ENABLE_GLOBAL 0x0020
+#define ACPI_ENABLE_POWER_BUTTON 0x0100
+#define ACPI_ENABLE_SLEEP_BUTTON 0x0200
+#define ACPI_ENABLE_RTC_ALARM 0x0400
/*
@@ -359,10 +392,10 @@ typedef struct
typedef struct
{
- ADDRESS_SPACE_HANDLER Handler;
+ ACPI_ADR_SPACE_HANDLER Handler;
void *Context;
-} ACPI_ADDRESS_SPACE_INFO;
+} ACPI_ADR_SPACE_INFO;
/* Values and addresses of the GPE registers (both banks) */
@@ -378,8 +411,8 @@ typedef struct
} ACPI_GPE_REGISTERS;
-#define ACPI_GPE_LEVEL_TRIGGERED 1
-#define ACPI_GPE_EDGE_TRIGGERED 2
+#define ACPI_GPE_LEVEL_TRIGGERED 1
+#define ACPI_GPE_EDGE_TRIGGERED 2
/* Information about each particular GPE level */
@@ -389,7 +422,7 @@ typedef struct
UINT8 Type; /* Level or Edge */
ACPI_HANDLE MethodHandle; /* Method handle for direct (fast) execution */
- GPE_HANDLER Handler; /* Address of handler, if any */
+ ACPI_GPE_HANDLER Handler; /* Address of handler, if any */
void *Context; /* Context to be passed to handler */
} ACPI_GPE_LEVEL_INFO;
@@ -399,7 +432,7 @@ typedef struct
typedef struct
{
- FIXED_EVENT_HANDLER Handler; /* Address of handler. */
+ ACPI_EVENT_HANDLER Handler; /* Address of handler. */
void *Context; /* Context to be passed to handler */
} ACPI_FIXED_EVENT_INFO;
@@ -423,16 +456,18 @@ typedef struct
****************************************************************************/
-#define CONTROL_NORMAL 0xC0
-#define CONTROL_CONDITIONAL_EXECUTING 0xC1
-#define CONTROL_PREDICATE_EXECUTING 0xC2
-#define CONTROL_PREDICATE_FALSE 0xC3
-#define CONTROL_PREDICATE_TRUE 0xC4
+#define CONTROL_NORMAL 0xC0
+#define CONTROL_CONDITIONAL_EXECUTING 0xC1
+#define CONTROL_PREDICATE_EXECUTING 0xC2
+#define CONTROL_PREDICATE_FALSE 0xC3
+#define CONTROL_PREDICATE_TRUE 0xC4
-/* Forward declaration */
+/* Forward declarations */
struct acpi_walk_state;
-struct acpi_parse_obj ;
+struct acpi_walk_list;
+struct acpi_parse_obj;
+struct acpi_obj_mutex;
#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\
@@ -492,7 +527,6 @@ typedef struct acpi_control_state
/*
* Scope state - current scope during namespace lookups
*/
-
typedef struct acpi_scope_state
{
ACPI_STATE_COMMON
@@ -527,6 +561,19 @@ typedef struct acpi_result_values
} ACPI_RESULT_VALUES;
+/*
+ * Notify info - used to pass info to the deferred notify
+ * handler/dispatcher.
+ */
+typedef struct acpi_notify_info
+{
+ ACPI_STATE_COMMON
+ ACPI_NAMESPACE_NODE *Node;
+ union acpi_operand_obj *HandlerObj;
+
+} ACPI_NOTIFY_INFO;
+
+
/* Generic state is union of structs above */
typedef union acpi_gen_state
@@ -538,6 +585,7 @@ typedef union acpi_gen_state
ACPI_PSCOPE_STATE ParseScope;
ACPI_PKG_STATE Pkg;
ACPI_RESULT_VALUES Results;
+ ACPI_NOTIFY_INFO Notify;
} ACPI_GENERIC_STATE;
@@ -561,19 +609,18 @@ ACPI_STATUS (*ACPI_PARSE_UPWARDS) (
*
****************************************************************************/
+#define ACPI_OP_CLASS_MASK 0x1F
+#define ACPI_OP_ARGS_MASK 0x20
+#define ACPI_OP_TYPE_MASK 0xC0
-#define ACPI_OP_CLASS_MASK 0x1F
-#define ACPI_OP_ARGS_MASK 0x20
-#define ACPI_OP_TYPE_MASK 0xC0
-
-#define ACPI_OP_TYPE_OPCODE 0x00
-#define ACPI_OP_TYPE_ASCII 0x40
-#define ACPI_OP_TYPE_PREFIX 0x80
-#define ACPI_OP_TYPE_UNKNOWN 0xC0
+#define ACPI_OP_TYPE_OPCODE 0x00
+#define ACPI_OP_TYPE_ASCII 0x40
+#define ACPI_OP_TYPE_PREFIX 0x80
+#define ACPI_OP_TYPE_UNKNOWN 0xC0
-#define ACPI_GET_OP_CLASS(a) ((a)->Flags & ACPI_OP_CLASS_MASK)
-#define ACPI_GET_OP_ARGS(a) ((a)->Flags & ACPI_OP_ARGS_MASK)
-#define ACPI_GET_OP_TYPE(a) ((a)->Flags & ACPI_OP_TYPE_MASK)
+#define ACPI_GET_OP_CLASS(a) ((a)->Flags & ACPI_OP_CLASS_MASK)
+#define ACPI_GET_OP_ARGS(a) ((a)->Flags & ACPI_OP_ARGS_MASK)
+#define ACPI_GET_OP_TYPE(a) ((a)->Flags & ACPI_OP_TYPE_MASK)
/*
@@ -663,130 +710,6 @@ typedef struct acpi_parse_state
/*****************************************************************************
*
- * Tree walking typedefs and structs
- *
- ****************************************************************************/
-
-
-/*
- * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through
- * the tree (for whatever reason), and for control method execution.
- */
-
-#define NEXT_OP_DOWNWARD 1
-#define NEXT_OP_UPWARD 2
-
-#define WALK_NON_METHOD 0
-#define WALK_METHOD 1
-#define WALK_METHOD_RESTART 2
-
-typedef struct acpi_walk_state
-{
- UINT8 DataType; /* To differentiate various internal objs */\
- ACPI_OWNER_ID OwnerId; /* Owner of objects created during the walk */
- BOOLEAN LastPredicate; /* Result of last predicate */
- UINT8 NextOpInfo; /* Info about NextOp */
- UINT8 NumOperands; /* Stack pointer for Operands[] array */
- UINT8 CurrentResult; /* */
-
- struct acpi_walk_state *Next; /* Next WalkState in list */
- ACPI_PARSE_OBJECT *Origin; /* Start of walk [Obsolete] */
-
-/* TBD: Obsolete with removal of WALK procedure ? */
- ACPI_PARSE_OBJECT *PrevOp; /* Last op that was processed */
- ACPI_PARSE_OBJECT *NextOp; /* next op to be processed */
-
-
- ACPI_GENERIC_STATE *Results; /* Stack of accumulated results */
- ACPI_GENERIC_STATE *ControlState; /* List of control states (nested IFs) */
- ACPI_GENERIC_STATE *ScopeInfo; /* Stack of nested scopes */
- ACPI_PARSE_STATE *ParserState; /* Current state of parser */
- UINT8 *AmlLastWhile;
- ACPI_OPCODE_INFO *OpInfo; /* Info on current opcode */
- ACPI_PARSE_DOWNWARDS DescendingCallback;
- ACPI_PARSE_UPWARDS AscendingCallback;
-
- union acpi_operand_obj *ReturnDesc; /* Return object, if any */
- union acpi_operand_obj *MethodDesc; /* Method descriptor if running a method */
- struct acpi_node *MethodNode; /* Method Node if running a method */
- ACPI_PARSE_OBJECT *MethodCallOp; /* MethodCall Op if running a method */
- struct acpi_node *MethodCallNode; /* Called method Node*/
- union acpi_operand_obj *Operands[OBJ_NUM_OPERANDS]; /* Operands passed to the interpreter */
- struct acpi_node Arguments[MTH_NUM_ARGS]; /* Control method arguments */
- struct acpi_node LocalVariables[MTH_NUM_LOCALS]; /* Control method locals */
- UINT32 ParseFlags;
- UINT8 WalkType;
- UINT8 ReturnUsed;
- UINT16 Opcode; /* Current AML opcode */
- UINT32 PrevArgTypes;
-
- /* Debug support */
-
- UINT32 MethodBreakpoint;
-
-
-} ACPI_WALK_STATE;
-
-
-/*
- * Walk list - head of a tree of walk states. Multiple walk states are created when there
- * are nested control methods executing.
- */
-typedef struct acpi_walk_list
-{
-
- ACPI_WALK_STATE *WalkState;
-
-} ACPI_WALK_LIST;
-
-
-/* Info used by AcpiPsInitObjects */
-
-typedef struct acpi_init_walk_info
-{
- UINT16 MethodCount;
- UINT16 OpRegionCount;
- UINT16 FieldCount;
- UINT16 OpRegionInit;
- UINT16 FieldInit;
- UINT16 ObjectCount;
- ACPI_TABLE_DESC *TableDesc;
-
-} ACPI_INIT_WALK_INFO;
-
-
-/* Info used by TBD */
-
-typedef struct acpi_device_walk_info
-{
- UINT16 DeviceCount;
- UINT16 Num_STA;
- UINT16 Num_INI;
- ACPI_TABLE_DESC *TableDesc;
-
-} ACPI_DEVICE_WALK_INFO;
-
-
-/* TBD: [Restructure] Merge with struct above */
-
-typedef struct acpi_walk_info
-{
- UINT32 DebugLevel;
- UINT32 OwnerId;
-
-} ACPI_WALK_INFO;
-
-typedef struct acpi_get_devices_info
-{
- WALK_CALLBACK UserFunction;
- void *Context;
- NATIVE_CHAR *Hid;
-
-} ACPI_GET_DEVICES_INFO;
-
-
-/*****************************************************************************
- *
* Hardware and PNP
*
****************************************************************************/
@@ -794,20 +717,20 @@ typedef struct acpi_get_devices_info
/* PCI */
-#define PCI_ROOT_HID_STRING "PNP0A03"
-#define PCI_ROOT_HID_VALUE 0x030AD041 /* EISAID("PNP0A03") */
+#define PCI_ROOT_HID_STRING "PNP0A03"
+#define PCI_ROOT_HID_VALUE 0x030AD041 /* EISAID("PNP0A03") */
/* Sleep states */
-#define SLWA_DEBUG_LEVEL 4
-#define GTS_CALL 0
-#define GTS_WAKE 1
+#define SLWA_DEBUG_LEVEL 4
+#define GTS_CALL 0
+#define GTS_WAKE 1
/* Cx States */
-#define MAX_CX_STATE_LATENCY 0xFFFFFFFF
-#define MAX_CX_STATES 4
+#define MAX_CX_STATE_LATENCY 0xFFFFFFFF
+#define MAX_CX_STATES 4
/*
@@ -816,13 +739,13 @@ typedef struct acpi_get_devices_info
* values as they are used in switch statements and offset calculations.
*/
-#define REGISTER_BLOCK_MASK 0xFF00 /* Register Block Id */
-#define BIT_IN_REGISTER_MASK 0x00FF /* Bit Id in the Register Block Id */
-#define BYTE_IN_REGISTER_MASK 0x00FF /* Register Offset in the Register Block */
+#define REGISTER_BLOCK_MASK 0xFF00 /* Register Block Id */
+#define BIT_IN_REGISTER_MASK 0x00FF /* Bit Id in the Register Block Id */
+#define BYTE_IN_REGISTER_MASK 0x00FF /* Register Offset in the Register Block */
-#define REGISTER_BLOCK_ID(RegId) (RegId & REGISTER_BLOCK_MASK)
-#define REGISTER_BIT_ID(RegId) (RegId & BIT_IN_REGISTER_MASK)
-#define REGISTER_OFFSET(RegId) (RegId & BYTE_IN_REGISTER_MASK)
+#define REGISTER_BLOCK_ID(RegId) (RegId & REGISTER_BLOCK_MASK)
+#define REGISTER_BIT_ID(RegId) (RegId & BIT_IN_REGISTER_MASK)
+#define REGISTER_OFFSET(RegId) (RegId & BYTE_IN_REGISTER_MASK)
/*
* Access Rule
@@ -837,94 +760,94 @@ typedef struct acpi_get_devices_info
/*
* Register Block Id
*/
-#define PM1_STS 0x0100
-#define PM1_EN 0x0200
-#define PM1_CONTROL 0x0300
-#define PM1A_CONTROL 0x0400
-#define PM1B_CONTROL 0x0500
-#define PM2_CONTROL 0x0600
-#define PM_TIMER 0x0700
-#define PROCESSOR_BLOCK 0x0800
-#define GPE0_STS_BLOCK 0x0900
-#define GPE0_EN_BLOCK 0x0A00
-#define GPE1_STS_BLOCK 0x0B00
-#define GPE1_EN_BLOCK 0x0C00
-#define SMI_CMD_BLOCK 0x0D00
+#define PM1_STS 0x0100
+#define PM1_EN 0x0200
+#define PM1_CONTROL 0x0300
+#define PM1A_CONTROL 0x0400
+#define PM1B_CONTROL 0x0500
+#define PM2_CONTROL 0x0600
+#define PM_TIMER 0x0700
+#define PROCESSOR_BLOCK 0x0800
+#define GPE0_STS_BLOCK 0x0900
+#define GPE0_EN_BLOCK 0x0A00
+#define GPE1_STS_BLOCK 0x0B00
+#define GPE1_EN_BLOCK 0x0C00
+#define SMI_CMD_BLOCK 0x0D00
/*
* Address space bitmasks for mmio or io spaces
*/
-#define SMI_CMD_ADDRESS_SPACE 0x01
-#define PM1_BLK_ADDRESS_SPACE 0x02
-#define PM2_CNT_BLK_ADDRESS_SPACE 0x04
-#define PM_TMR_BLK_ADDRESS_SPACE 0x08
-#define GPE0_BLK_ADDRESS_SPACE 0x10
-#define GPE1_BLK_ADDRESS_SPACE 0x20
+#define SMI_CMD_ADDRESS_SPACE 0x01
+#define PM1_BLK_ADDRESS_SPACE 0x02
+#define PM2_CNT_BLK_ADDRESS_SPACE 0x04
+#define PM_TMR_BLK_ADDRESS_SPACE 0x08
+#define GPE0_BLK_ADDRESS_SPACE 0x10
+#define GPE1_BLK_ADDRESS_SPACE 0x20
/*
* Control bit definitions
*/
-#define TMR_STS (PM1_STS | 0x01)
-#define BM_STS (PM1_STS | 0x02)
-#define GBL_STS (PM1_STS | 0x03)
-#define PWRBTN_STS (PM1_STS | 0x04)
-#define SLPBTN_STS (PM1_STS | 0x05)
-#define RTC_STS (PM1_STS | 0x06)
-#define WAK_STS (PM1_STS | 0x07)
-
-#define TMR_EN (PM1_EN | 0x01)
- /* no BM_EN */
-#define GBL_EN (PM1_EN | 0x03)
-#define PWRBTN_EN (PM1_EN | 0x04)
-#define SLPBTN_EN (PM1_EN | 0x05)
-#define RTC_EN (PM1_EN | 0x06)
-#define WAK_EN (PM1_EN | 0x07)
-
-#define SCI_EN (PM1_CONTROL | 0x01)
-#define BM_RLD (PM1_CONTROL | 0x02)
-#define GBL_RLS (PM1_CONTROL | 0x03)
-#define SLP_TYPE_A (PM1_CONTROL | 0x04)
-#define SLP_TYPE_B (PM1_CONTROL | 0x05)
-#define SLP_EN (PM1_CONTROL | 0x06)
-
-#define ARB_DIS (PM2_CONTROL | 0x01)
-
-#define TMR_VAL (PM_TIMER | 0x01)
-
-#define GPE0_STS (GPE0_STS_BLOCK | 0x01)
-#define GPE0_EN (GPE0_EN_BLOCK | 0x01)
-
-#define GPE1_STS (GPE1_STS_BLOCK | 0x01)
-#define GPE1_EN (GPE1_EN_BLOCK | 0x01)
-
-
-#define TMR_STS_MASK 0x0001
-#define BM_STS_MASK 0x0010
-#define GBL_STS_MASK 0x0020
-#define PWRBTN_STS_MASK 0x0100
-#define SLPBTN_STS_MASK 0x0200
-#define RTC_STS_MASK 0x0400
-#define WAK_STS_MASK 0x8000
-
-#define ALL_FIXED_STS_BITS (TMR_STS_MASK | BM_STS_MASK | GBL_STS_MASK \
- | PWRBTN_STS_MASK | SLPBTN_STS_MASK \
- | RTC_STS_MASK | WAK_STS_MASK)
-
-#define TMR_EN_MASK 0x0001
-#define GBL_EN_MASK 0x0020
-#define PWRBTN_EN_MASK 0x0100
-#define SLPBTN_EN_MASK 0x0200
-#define RTC_EN_MASK 0x0400
-
-#define SCI_EN_MASK 0x0001
-#define BM_RLD_MASK 0x0002
-#define GBL_RLS_MASK 0x0004
-#define SLP_TYPE_X_MASK 0x1C00
-#define SLP_EN_MASK 0x2000
-
-#define ARB_DIS_MASK 0x0001
-#define TMR_VAL_MASK 0xFFFFFFFF
+#define TMR_STS (PM1_STS | 0x01)
+#define BM_STS (PM1_STS | 0x02)
+#define GBL_STS (PM1_STS | 0x03)
+#define PWRBTN_STS (PM1_STS | 0x04)
+#define SLPBTN_STS (PM1_STS | 0x05)
+#define RTC_STS (PM1_STS | 0x06)
+#define WAK_STS (PM1_STS | 0x07)
+
+#define TMR_EN (PM1_EN | 0x01)
+ /* no BM_EN */
+#define GBL_EN (PM1_EN | 0x03)
+#define PWRBTN_EN (PM1_EN | 0x04)
+#define SLPBTN_EN (PM1_EN | 0x05)
+#define RTC_EN (PM1_EN | 0x06)
+#define WAK_EN (PM1_EN | 0x07)
+
+#define SCI_EN (PM1_CONTROL | 0x01)
+#define BM_RLD (PM1_CONTROL | 0x02)
+#define GBL_RLS (PM1_CONTROL | 0x03)
+#define SLP_TYPE_A (PM1_CONTROL | 0x04)
+#define SLP_TYPE_B (PM1_CONTROL | 0x05)
+#define SLP_EN (PM1_CONTROL | 0x06)
+
+#define ARB_DIS (PM2_CONTROL | 0x01)
+
+#define TMR_VAL (PM_TIMER | 0x01)
+
+#define GPE0_STS (GPE0_STS_BLOCK | 0x01)
+#define GPE0_EN (GPE0_EN_BLOCK | 0x01)
+
+#define GPE1_STS (GPE1_STS_BLOCK | 0x01)
+#define GPE1_EN (GPE1_EN_BLOCK | 0x01)
+
+
+#define TMR_STS_MASK 0x0001
+#define BM_STS_MASK 0x0010
+#define GBL_STS_MASK 0x0020
+#define PWRBTN_STS_MASK 0x0100
+#define SLPBTN_STS_MASK 0x0200
+#define RTC_STS_MASK 0x0400
+#define WAK_STS_MASK 0x8000
+
+#define ALL_FIXED_STS_BITS (TMR_STS_MASK | BM_STS_MASK | GBL_STS_MASK \
+ | PWRBTN_STS_MASK | SLPBTN_STS_MASK \
+ | RTC_STS_MASK | WAK_STS_MASK)
+
+#define TMR_EN_MASK 0x0001
+#define GBL_EN_MASK 0x0020
+#define PWRBTN_EN_MASK 0x0100
+#define SLPBTN_EN_MASK 0x0200
+#define RTC_EN_MASK 0x0400
+
+#define SCI_EN_MASK 0x0001
+#define BM_RLD_MASK 0x0002
+#define GBL_RLS_MASK 0x0004
+#define SLP_TYPE_X_MASK 0x1C00
+#define SLP_EN_MASK 0x2000
+
+#define ARB_DIS_MASK 0x0001
+#define TMR_VAL_MASK 0xFFFFFFFF
#define GPE0_STS_MASK
#define GPE0_EN_MASK
@@ -933,55 +856,69 @@ typedef struct acpi_get_devices_info
#define GPE1_EN_MASK
-#define ACPI_READ 1
-#define ACPI_WRITE 2
+#define ACPI_READ 1
+#define ACPI_WRITE 2
+
+/*****************************************************************************
+ *
+ * Resource descriptors
+ *
+ ****************************************************************************/
-/* Plug and play */
-/* Pnp and ACPI data */
+/* ResourceType values */
-#define VERSION_NO 0x01
-#define LOGICAL_DEVICE_ID 0x02
-#define COMPATIBLE_DEVICE_ID 0x03
-#define IRQ_FORMAT 0x04
-#define DMA_FORMAT 0x05
-#define START_DEPENDENT_TAG 0x06
-#define END_DEPENDENT_TAG 0x07
-#define IO_PORT_DESCRIPTOR 0x08
-#define FIXED_LOCATION_IO_DESCRIPTOR 0x09
-#define RESERVED_TYPE0 0x0A
-#define RESERVED_TYPE1 0x0B
-#define RESERVED_TYPE2 0x0C
-#define RESERVED_TYPE3 0x0D
-#define SMALL_VENDOR_DEFINED 0x0E
-#define END_TAG 0x0F
+#define RESOURCE_TYPE_MEMORY_RANGE 0
+#define RESOURCE_TYPE_IO_RANGE 1
+#define RESOURCE_TYPE_BUS_NUMBER_RANGE 2
-/* Pnp and ACPI data */
+/* Resource descriptor types and masks */
-#define MEMORY_RANGE_24 0x81
-#define ISA_MEMORY_RANGE 0x81
-#define LARGE_VENDOR_DEFINED 0x84
-#define EISA_MEMORY_RANGE 0x85
-#define MEMORY_RANGE_32 0x85
-#define FIXED_EISA_MEMORY_RANGE 0x86
-#define FIXED_MEMORY_RANGE_32 0x86
+#define RESOURCE_DESC_TYPE_LARGE 0x80
+#define RESOURCE_DESC_TYPE_SMALL 0x00
-/* ACPI only data */
+#define RESOURCE_DESC_TYPE_MASK 0x80
+#define RESOURCE_DESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */
-#define DWORD_ADDRESS_SPACE 0x87
-#define WORD_ADDRESS_SPACE 0x88
-#define EXTENDED_IRQ 0x89
-/* MUST HAVES */
+/*
+ * Small resource descriptor types
+ * Note: The 3 length bits (2:0) must be zero
+ */
+#define RESOURCE_DESC_IRQ_FORMAT 0x20
+#define RESOURCE_DESC_DMA_FORMAT 0x28
+#define RESOURCE_DESC_START_DEPENDENT 0x30
+#define RESOURCE_DESC_END_DEPENDENT 0x38
+#define RESOURCE_DESC_IO_PORT 0x40
+#define RESOURCE_DESC_FIXED_IO_PORT 0x48
+#define RESOURCE_DESC_SMALL_VENDOR 0x70
+#define RESOURCE_DESC_END_TAG 0x78
+
+/*
+ * Large resource descriptor types
+ */
+
+#define RESOURCE_DESC_MEMORY_24 0x81
+#define RESOURCE_DESC_GENERAL_REGISTER 0x82
+#define RESOURCE_DESC_LARGE_VENDOR 0x84
+#define RESOURCE_DESC_MEMORY_32 0x85
+#define RESOURCE_DESC_FIXED_MEMORY_32 0x86
+#define RESOURCE_DESC_DWORD_ADDRESS_SPACE 0x87
+#define RESOURCE_DESC_WORD_ADDRESS_SPACE 0x88
+#define RESOURCE_DESC_EXTENDED_XRUPT 0x89
+#define RESOURCE_DESC_QWORD_ADDRESS_SPACE 0x8A
-#define DEVICE_ID_LENGTH 0x09
+
+/* String version of device HIDs and UIDs */
+
+#define ACPI_DEVICE_ID_LENGTH 0x09
typedef struct
{
- NATIVE_CHAR Buffer[DEVICE_ID_LENGTH];
+ NATIVE_CHAR Buffer[ACPI_DEVICE_ID_LENGTH];
-} DEVICE_ID;
+} ACPI_DEVICE_ID;
/*****************************************************************************
@@ -995,22 +932,22 @@ typedef struct
#ifdef ACPI_DEBUG
-#define MEM_MALLOC 0
-#define MEM_CALLOC 1
-#define MAX_MODULE_NAME 16
+#define MEM_MALLOC 0
+#define MEM_CALLOC 1
+#define MAX_MODULE_NAME 16
-typedef struct AllocationInfo
+typedef struct AcpiAllocationInfo
{
- struct AllocationInfo *Previous;
- struct AllocationInfo *Next;
- void *Address;
- UINT32 Size;
- UINT32 Component;
- UINT32 Line;
- NATIVE_CHAR Module[MAX_MODULE_NAME];
- UINT8 AllocType;
-
-} ALLOCATION_INFO;
+ struct AcpiAllocationInfo *Previous;
+ struct AcpiAllocationInfo *Next;
+ void *Address;
+ UINT32 Size;
+ UINT32 Component;
+ UINT32 Line;
+ NATIVE_CHAR Module[MAX_MODULE_NAME];
+ UINT8 AllocType;
+
+} ACPI_ALLOCATION_INFO;
#endif
OpenPOWER on IntegriCloud