Added common DataType field for NTEs and internal objects

date	99.09.03.17.44.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 19:50:35 +00:00
parent 4cea8fec8c
commit 52b90ed08c
2 changed files with 99 additions and 29 deletions

View File

@ -136,15 +136,13 @@
/* /*
* An ACPI_HANDLE (which is actually an NAME_TABLE_ENTRY *) can appear in some contexts, * An ACPI_HANDLE (which is actually an NAME_TABLE_ENTRY *) can appear in some contexts,
* such as on apObjStack, where a pointer to an ACPI_OBJECT can also * such as on apObjStack, where a pointer to an ACPI_OBJECT can also
* appear. This macro is used to distinguish them. * appear. These macros are used to distinguish them.
* *
* The first byte of an NAME_TABLE_ENTRY is a character of the name segment, which will * The DataType field is the first field in both structures.
* be accepted by NcOK(). The first byte of an ACPI_OBJECT is the
* ValTyp field, whose (UINT8) value comes from the ACPI_OBJECT_TYPE enumeration.
* Valid ACPI_OBJECT_TYPE values must not include any character acceptable in a name.
*/ */
#define IS_NS_HANDLE(h) (AmlGoodChar((INT32) * (char *) (h))) #define IS_NS_HANDLE(h) (((NAME_TABLE_ENTRY *)h)->DataType == DESC_TYPE_NTE)
#define IS_ACPI_OBJECT(o) (((NAME_TABLE_ENTRY *)o)->DataType == DESC_TYPE_ACPI_OBJ)
/* To search the entire name space, pass this as SearchBase */ /* To search the entire name space, pass this as SearchBase */
@ -418,7 +416,7 @@ NsFindAttachedObject (
ACPI_STATUS ACPI_STATUS
NsSearchAndEnter ( NsSearchAndEnter (
char *EntryName, UINT32 EntryName,
NAME_TABLE_ENTRY *NameTable, NAME_TABLE_ENTRY *NameTable,
OPERATING_MODE LoadMode, OPERATING_MODE LoadMode,
ACPI_OBJECT_TYPE Type, ACPI_OBJECT_TYPE Type,

View File

@ -150,14 +150,21 @@
*****************************************************************************/ *****************************************************************************/
/* /*
* Common area for all objects * Common area for all objects.
*
* DataType is used to differentiate between internal descriptors, and MUST
* be the first byte in this structure.
*/ */
#define ACPI_OBJECT_COMMON \ #define ACPI_OBJECT_COMMON \
UINT8 DataType; /* To differentiate various internal objs */\
UINT8 Type; /* See definition of NsType for values */ \ UINT8 Type; /* See definition of NsType for values */ \
UINT8 Flags;\ UINT8 Flags;\
UINT16 ReferenceCount; /* For object deletion management */ UINT8 CmFill1; \
UINT16 ReferenceCount; /* For object deletion management */\
UINT16 CmFill2;\
char Name[8]; /* TBD: Temporary only, for debug */
/* Defines for flag byte above */ /* Defines for flag byte above */
@ -186,8 +193,6 @@
typedef union AcpiObjInternal typedef union AcpiObjInternal
{ {
UINT8 Type; /* See definition of NsType for values */
/* /*
* Fields that are common across all objects * Fields that are common across all objects
@ -214,6 +219,8 @@ typedef union AcpiObjInternal
void *Reserved_p1; void *Reserved_p1;
void *Reserved_p2; void *Reserved_p2;
void *Reserved_p3; void *Reserved_p3;
void *Reserved_p4;
void *Reserved_p5;
} Number; } Number;
@ -229,6 +236,8 @@ typedef union AcpiObjInternal
UINT8 *Pointer; /* String value in AML stream or in allocated space */ UINT8 *Pointer; /* String value in AML stream or in allocated space */
void *Reserved_p2; void *Reserved_p2;
void *Reserved_p3; void *Reserved_p3;
void *Reserved_p4;
void *Reserved_p5;
} String; } String;
@ -244,6 +253,8 @@ typedef union AcpiObjInternal
UINT8 *Pointer; /* points to the buffer in allocated space */ UINT8 *Pointer; /* points to the buffer in allocated space */
void *Reserved_p2; void *Reserved_p2;
void *Reserved_p3; void *Reserved_p3;
void *Reserved_p4;
void *Reserved_p5;
} Buffer; } Buffer;
@ -259,6 +270,8 @@ typedef union AcpiObjInternal
union AcpiObjInternal **Elements; /* Array of pointers to AcpiObjects */ union AcpiObjInternal **Elements; /* Array of pointers to AcpiObjects */
union AcpiObjInternal **NextElement; /* used only while initializing */ union AcpiObjInternal **NextElement; /* used only while initializing */
void *Reserved_p3; void *Reserved_p3;
void *Reserved_p4;
void *Reserved_p5;
} Package; } Package;
@ -274,21 +287,24 @@ typedef union AcpiObjInternal
union AcpiObjInternal *Container; /* Containing object (Buffer) */ union AcpiObjInternal *Container; /* Containing object (Buffer) */
void *Reserved_p2; void *Reserved_p2;
void *Reserved_p3; void *Reserved_p3;
void *Reserved_p4;
void *Reserved_p5;
} FieldUnit; } FieldUnit;
struct /* DEVICE - has handle and notification handler/context */ struct /* DEVICE - has handle and notification handler/context */
{ {
ACPI_OBJECT_COMMON ACPI_OBJECT_COMMON
UINT32 Reserved1; UINT32 Reserved1;
UINT32 Reserved2; UINT32 Reserved2;
UINT32 Reserved3; union AcpiObjInternal *AddrHandler; /* Handler for Address space */
ACPI_HANDLE Handle; ACPI_HANDLE Handle;
NOTIFY_HANDLER Handler; union AcpiObjInternal *SysHandler; /* Handler for system notifies */
void *Context; union AcpiObjInternal *DrvHandler; /* Handler for driver notifies */
void *Reserved_p4;
void *Reserved_p5;
} Device; } Device;
@ -306,6 +322,8 @@ typedef union AcpiObjInternal
void *Reserved_p1; void *Reserved_p1;
void *Reserved_p2; void *Reserved_p2;
void *Reserved_p3; void *Reserved_p3;
void *Reserved_p4;
void *Reserved_p5;
} Event; } Event;
@ -322,6 +340,8 @@ typedef union AcpiObjInternal
UINT8 *Pcode; UINT8 *Pcode;
UINT8 *AcpiTable; UINT8 *AcpiTable;
void *Reserved_p3; void *Reserved_p3;
void *Reserved_p4;
void *Reserved_p5;
} Method; } Method;
@ -339,6 +359,8 @@ typedef union AcpiObjInternal
void *Reserved_p1; void *Reserved_p1;
void *Reserved_p2; void *Reserved_p2;
void *Reserved_p3; void *Reserved_p3;
void *Reserved_p4;
void *Reserved_p5;
} Mutex; } Mutex;
@ -352,14 +374,50 @@ typedef union AcpiObjInternal
UINT32 Address; UINT32 Address;
UINT32 Length; UINT32 Length;
union AcpiObjInternal *AddressLocation; /* Loc of 1st (address) OpCode in AML stream */ union AcpiObjInternal *AddressLocation; /* Loc of 1st (address) OpCode in AML stream */
void *Reserved_p2; union AcpiObjInternal *AddrHandler; /* Handler for system notifies */
void *Reserved_p3; union AcpiObjInternal *Link; /* Link in list of regions */
/* list is owned by AddrHandler */
union AcpiObjInternal *REGList; /* List of _REG methods for this region */
NAME_TABLE_ENTRY *Parent; /* containing object */
} Region; } Region;
struct /* ADDRESS HANDLER */
{
ACPI_OBJECT_COMMON
struct /* POWER RESOURCE - has Handle */ UINT16 SpaceId;
UINT16 Reserved;
union AcpiObjInternal *Link; /* Link to next handler on device */
union AcpiObjInternal *RegionList; /* regions using this handler */
NAME_TABLE_ENTRY *Nte; /* device handler was installed for */
ADDRESS_SPACE_HANDLER Handler;
void *Context;
void *Reserved_p4;
void *Reserved_p5;
} AddrHandler;
struct /* NOTIFY HANDLER */
{
ACPI_OBJECT_COMMON
UINT32 Reserved1;
UINT32 Reserved2;
UINT32 Reserved3;
NAME_TABLE_ENTRY *Nte; /* device handler was installed for */
NOTIFY_HANDLER Handler;
void *Context;
void *Reserved_p4;
void *Reserved_p5;
} NotifyHandler;
struct /* POWER RESOURCE - has Handle and notification handler/context*/
{ {
ACPI_OBJECT_COMMON ACPI_OBJECT_COMMON
@ -368,23 +426,27 @@ typedef union AcpiObjInternal
UINT32 Reserved3; UINT32 Reserved3;
ACPI_HANDLE Handle; ACPI_HANDLE Handle;
void *Reserved_p2; union AcpiObjInternal *SysHandler; /* Handler for system notifies */
void *Reserved_p3; union AcpiObjInternal *DrvHandler; /* Handler for driver notifies */
void *Reserved_p4;
void *Reserved_p5;
} PowerResource; } PowerResource;
struct /* PROCESSOR - has Handle */ struct /* PROCESSOR - has Handle and notification handler/context*/
{ {
ACPI_OBJECT_COMMON ACPI_OBJECT_COMMON
UINT32 Reserved1; UINT32 Reserved1;
UINT32 Reserved2; UINT32 Reserved2;
UINT32 Reserved3; union AcpiObjInternal *AddrHandler; /* Handler for Address space */
ACPI_HANDLE Handle; ACPI_HANDLE Handle;
void *Reserved_p2; union AcpiObjInternal *SysHandler; /* Handler for system notifies */
void *Reserved_p3; union AcpiObjInternal *DrvHandler; /* Handler for driver notifies */
void *Reserved_p4;
void *Reserved_p5;
} Processor; } Processor;
@ -395,11 +457,13 @@ typedef union AcpiObjInternal
UINT32 Reserved1; UINT32 Reserved1;
UINT32 Reserved2; UINT32 Reserved2;
UINT32 Reserved3; union AcpiObjInternal *AddrHandler; /* Handler for Address space */
ACPI_HANDLE Handle; ACPI_HANDLE Handle;
NOTIFY_HANDLER Handler; union AcpiObjInternal *SysHandler; /* Handler for system notifies */
void *Context; union AcpiObjInternal *DrvHandler; /* Handler for driver notifies */
void *Reserved_p4;
void *Reserved_p5;
} ThermalZone; } ThermalZone;
@ -415,6 +479,8 @@ typedef union AcpiObjInternal
union AcpiObjInternal *Container; /* Containing object */ union AcpiObjInternal *Container; /* Containing object */
void *Reserved_p2; void *Reserved_p2;
void *Reserved_p3; void *Reserved_p3;
void *Reserved_p4;
void *Reserved_p5;
} Field; } Field;
@ -430,6 +496,8 @@ typedef union AcpiObjInternal
ACPI_HANDLE BankSelect; /* Bank select register */ ACPI_HANDLE BankSelect; /* Bank select register */
union AcpiObjInternal *Container; /* Containing object */ union AcpiObjInternal *Container; /* Containing object */
void *Reserved_p3; void *Reserved_p3;
void *Reserved_p4;
void *Reserved_p5;
} BankField; } BankField;
@ -449,6 +517,8 @@ typedef union AcpiObjInternal
ACPI_HANDLE Index; /* Index register */ ACPI_HANDLE Index; /* Index register */
ACPI_HANDLE Data; /* Data register */ ACPI_HANDLE Data; /* Data register */
void *Reserved_p3; void *Reserved_p3;
void *Reserved_p4;
void *Reserved_p5;
} IndexField; } IndexField;
@ -470,6 +540,8 @@ typedef union AcpiObjInternal
*/ */
void *Reserved_p2; void *Reserved_p2;
void *Reserved_p3; void *Reserved_p3;
void *Reserved_p4;
void *Reserved_p5;
} Lvalue; } Lvalue;