Index: contrib/dev/acpica/acconfig.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acconfig.h,v retrieving revision 1.14 diff -u -r1.14 acconfig.h --- contrib/dev/acpica/acconfig.h 31 Oct 2001 02:34:45 -0000 1.14 +++ contrib/dev/acpica/acconfig.h 7 Nov 2001 09:42:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acconfig.h - Global configuration constants - * $Revision: 74 $ + * $Revision: 76 $ * *****************************************************************************/ @@ -125,12 +125,13 @@ *****************************************************************************/ /* - * ACPI_DEBUG - This switch enables all the debug facilities of the ACPI - * subsystem. This includes the DEBUG_PRINT output statements - * When disabled, all DEBUG_PRINT statements are compiled out. + * ACPI_DEBUG - This switch enables all the debug facilities of the + * ACPI subsystem. This includes the DEBUG_PRINT output + * statements. When disabled, all DEBUG_PRINT + * statements are compiled out. * * ACPI_APPLICATION - Use this switch if the subsystem is going to be run - * at the application level. + * at the application level. * */ @@ -144,7 +145,7 @@ /* Version string */ -#define ACPI_CA_VERSION 0x20011018 +#define ACPI_CA_VERSION 0x20011102 /* Version of ACPI supported */ @@ -153,17 +154,17 @@ /* Maximum objects in the various object caches */ -#define MAX_STATE_CACHE_DEPTH 64 /* State objects for stacks */ +#define MAX_STATE_CACHE_DEPTH 64 /* State objects for stacks */ #define MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ #define MAX_EXTPARSE_CACHE_DEPTH 64 /* Parse tree objects */ #define MAX_OBJECT_CACHE_DEPTH 64 /* Interpreter operand objects */ -#define MAX_WALK_CACHE_DEPTH 4 /* Objects for parse tree walks (method execution) */ +#define MAX_WALK_CACHE_DEPTH 4 /* Objects for parse tree walks */ /* String size constants */ #define MAX_STRING_LENGTH 512 -#define PATHNAME_MAX 256 /* A full namespace pathname */ +#define PATHNAME_MAX 256 /* A full namespace pathname */ /* Maximum count for a semaphore object */ @@ -232,7 +233,7 @@ /* Names within the namespace are 4 bytes long */ #define ACPI_NAME_SIZE 4 -#define PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 INT8 for separator */ +#define PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ #define PATH_SEPARATOR '.' @@ -244,10 +245,15 @@ #define HI_RSDP_WINDOW_SIZE 0x20000 #define RSDP_SCAN_STEP 16 + +/* Operation regions */ + +#define ACPI_NUM_PREDEFINED_REGIONS 7 +#define ACPI_USER_REGION_BEGIN 0x80 + /* Maximum SpaceIds for Operation Regions */ #define ACPI_MAX_ADDRESS_SPACE 255 -#define ACPI_NUM_ADDRESS_SPACES 256 #endif /* _ACCONFIG_H */ Index: contrib/dev/acpica/acdispat.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acdispat.h,v retrieving revision 1.1.1.8 diff -u -r1.1.1.8 acdispat.h --- contrib/dev/acpica/acdispat.h 31 Oct 2001 02:32:27 -0000 1.1.1.8 +++ contrib/dev/acpica/acdispat.h 7 Nov 2001 09:37:37 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acdispat.h - dispatcher (parser to interpreter interface) - * $Revision: 45 $ + * $Revision: 47 $ * *****************************************************************************/ @@ -214,6 +214,11 @@ ACPI_PARSE_OBJECT *Op, ACPI_WALK_STATE *WalkState); +ACPI_STATUS +AcpiDsInitFieldObjects ( + ACPI_PARSE_OBJECT *Op, + ACPI_WALK_STATE *WalkState); + /* dsload - Parser/Interpreter interface, namespace load callbacks */ @@ -291,18 +296,19 @@ UINT32 MaxParamCount, ACPI_WALK_STATE *WalkState); -ACPI_NAMESPACE_NODE * +ACPI_STATUS AcpiDsMethodDataGetNode ( UINT16 Opcode, UINT32 Index, - ACPI_WALK_STATE *WalkState); + ACPI_WALK_STATE *WalkState, + ACPI_NAMESPACE_NODE **Node); ACPI_STATUS AcpiDsMethodDataInit ( ACPI_WALK_STATE *WalkState); ACPI_STATUS -AcpiDsMethodDataSetEntry ( +AcpiDsMethodDataSetValue ( UINT16 Opcode, UINT32 Index, ACPI_OPERAND_OBJECT *Object, @@ -421,15 +427,6 @@ ACPI_STATUS AcpiDsResolveOperands ( ACPI_WALK_STATE *WalkState); - -ACPI_OBJECT_TYPE8 -AcpiDsMapOpcodeToDataType ( - UINT16 Opcode, - UINT32 *OutFlags); - -ACPI_OBJECT_TYPE8 -AcpiDsMapNamedOpcodeToDataType ( - UINT16 Opcode); /* Index: contrib/dev/acpica/acevents.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acevents.h,v retrieving revision 1.1.1.6 diff -u -r1.1.1.6 acevents.h --- contrib/dev/acpica/acevents.h 4 Oct 2001 23:12:11 -0000 1.1.1.6 +++ contrib/dev/acpica/acevents.h 7 Nov 2001 09:37:37 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acevents.h - Event subcomponent prototypes and defines - * $Revision: 66 $ + * $Revision: 67 $ * *****************************************************************************/ @@ -205,8 +205,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - UINT32 *Value); - + ACPI_INTEGER *Value); ACPI_STATUS AcpiEvAddrHandlerHelper ( @@ -219,7 +218,6 @@ AcpiEvDisassociateRegionFromHandler( ACPI_OPERAND_OBJECT *RegionObj, BOOLEAN AcpiNsIsLocked); - ACPI_STATUS AcpiEvAssociateRegionAndHandler ( Index: contrib/dev/acpica/acexcep.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acexcep.h,v retrieving revision 1.1.1.7 diff -u -r1.1.1.7 acexcep.h --- contrib/dev/acpica/acexcep.h 7 Sep 2001 01:22:23 -0000 1.1.1.7 +++ contrib/dev/acpica/acexcep.h 7 Nov 2001 09:37:37 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acexcep.h - Exception codes returned by the ACPI subsystem - * $Revision: 50 $ + * $Revision: 53 $ * *****************************************************************************/ @@ -145,7 +145,7 @@ #define AE_NO_MEMORY (ACPI_STATUS) (0x0004 | AE_CODE_ENVIRONMENTAL) #define AE_NOT_FOUND (ACPI_STATUS) (0x0005 | AE_CODE_ENVIRONMENTAL) #define AE_NOT_EXIST (ACPI_STATUS) (0x0006 | AE_CODE_ENVIRONMENTAL) -#define AE_EXIST (ACPI_STATUS) (0x0007 | AE_CODE_ENVIRONMENTAL) +#define AE_ALREADY_EXISTS (ACPI_STATUS) (0x0007 | AE_CODE_ENVIRONMENTAL) #define AE_TYPE (ACPI_STATUS) (0x0008 | AE_CODE_ENVIRONMENTAL) #define AE_NULL_OBJECT (ACPI_STATUS) (0x0009 | AE_CODE_ENVIRONMENTAL) #define AE_NULL_ENTRY (ACPI_STATUS) (0x000A | AE_CODE_ENVIRONMENTAL) @@ -220,8 +220,10 @@ #define AE_AML_MUTEX_ORDER (ACPI_STATUS) (0x0017 | AE_CODE_AML) #define AE_AML_MUTEX_NOT_ACQUIRED (ACPI_STATUS) (0x0018 | AE_CODE_AML) #define AE_AML_INVALID_RESOURCE_TYPE (ACPI_STATUS) (0x0019 | AE_CODE_AML) +#define AE_AML_INVALID_INDEX (ACPI_STATUS) (0x001A | AE_CODE_AML) +#define AE_AML_REGISTER_LIMIT (ACPI_STATUS) (0x001B | AE_CODE_AML) -#define AE_CODE_AML_MAX 0x0019 +#define AE_CODE_AML_MAX 0x001B /* * Internal exceptions used for control @@ -253,7 +255,7 @@ "AE_NO_MEMORY", "AE_NOT_FOUND", "AE_NOT_EXIST", - "AE_EXIST", + "AE_ALREADY_EXISTS", "AE_TYPE", "AE_NULL_OBJECT", "AE_NULL_ENTRY", @@ -319,6 +321,8 @@ "AE_AML_MUTEX_ORDER", "AE_AML_MUTEX_NOT_ACQUIRED", "AE_AML_INVALID_RESOURCE_TYPE", + "AE_AML_INVALID_INDEX", + "AE_AML_REGISTER_LIMIT", }; NATIVE_CHAR const *AcpiGbl_ExceptionNames_Ctrl[] = Index: contrib/dev/acpica/acgcc.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acgcc.h,v retrieving revision 1.11 diff -u -r1.11 acgcc.h --- contrib/dev/acpica/acgcc.h 31 Oct 2001 02:34:45 -0000 1.11 +++ contrib/dev/acpica/acgcc.h 7 Nov 2001 09:37:37 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acgcc.h - GCC specific defines, etc. - * $Revision: 14 $ + * $Revision: 15 $ * *****************************************************************************/ @@ -235,17 +235,17 @@ * Math helper asm macros */ #define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \ - asm("divl %2;" \ - :"=a"(q32), "=d"(r32) \ - :"r"(d32), \ - "0"(n_lo), "1"(n_hi)) + asm("divl %2;" \ + :"=a"(q32), "=d"(r32) \ + :"r"(d32), \ + "0"(n_lo), "1"(n_hi)) #define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \ - asm("shrl $1,%2;" \ - "rcrl $1,%3;" \ - :"=r"(n_hi), "=r"(n_lo) \ - :"0"(n_hi), "1"(n_lo)) + asm("shrl $1,%2;" \ + "rcrl $1,%3;" \ + :"=r"(n_hi), "=r"(n_lo) \ + :"0"(n_hi), "1"(n_lo)) /*! [End] no source code translation !*/ Index: contrib/dev/acpica/acglobal.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acglobal.h,v retrieving revision 1.1.1.8 diff -u -r1.1.1.8 acglobal.h --- contrib/dev/acpica/acglobal.h 7 Sep 2001 01:22:23 -0000 1.1.1.8 +++ contrib/dev/acpica/acglobal.h 7 Nov 2001 09:37:37 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acglobal.h - Declarations for global variables - * $Revision: 106 $ + * $Revision: 107 $ * *****************************************************************************/ @@ -260,10 +260,6 @@ ACPI_EXTERN ACPI_WALK_LIST *AcpiGbl_CurrentWalkList; - -/* Address Space handlers */ - -ACPI_EXTERN ACPI_ADR_SPACE_INFO AcpiGbl_AddressSpaces[ACPI_NUM_ADDRESS_SPACES]; /* Control method single step flag */ Index: contrib/dev/acpica/acinterp.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acinterp.h,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 acinterp.h --- contrib/dev/acpica/acinterp.h 31 Oct 2001 02:32:27 -0000 1.1.1.11 +++ contrib/dev/acpica/acinterp.h 7 Nov 2001 09:37:37 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acinterp.h - Interpreter subcomponent prototypes and defines - * $Revision: 116 $ + * $Revision: 118 $ * *****************************************************************************/ @@ -208,52 +208,49 @@ UINT32 BufferLength); ACPI_STATUS -AcpiExSetupField ( +AcpiExSetupRegion ( ACPI_OPERAND_OBJECT *ObjDesc, - UINT32 FieldByteOffset); + UINT32 FieldDatumByteOffset); ACPI_STATUS -AcpiExReadFieldDatum ( +AcpiExAccessRegion ( ACPI_OPERAND_OBJECT *ObjDesc, - UINT32 FieldByteOffset, - UINT32 *Value); + UINT32 FieldDatumByteOffset, + ACPI_INTEGER *Value, + UINT32 ReadWrite); -ACPI_STATUS -AcpiExCommonAccessField ( - UINT32 Mode, +BOOLEAN +AcpiExRegisterOverflow ( ACPI_OPERAND_OBJECT *ObjDesc, - void *Buffer, - UINT32 BufferLength); - + ACPI_INTEGER Value); ACPI_STATUS -AcpiExAccessIndexField ( - UINT32 Mode, +AcpiExFieldDatumIo ( ACPI_OPERAND_OBJECT *ObjDesc, - void *Buffer, - UINT32 BufferLength); + UINT32 FieldDatumByteOffset, + ACPI_INTEGER *Value, + UINT32 ReadWrite); ACPI_STATUS -AcpiExAccessBankField ( - UINT32 Mode, +AcpiExWriteWithUpdateRule ( ACPI_OPERAND_OBJECT *ObjDesc, - void *Buffer, - UINT32 BufferLength); + ACPI_INTEGER Mask, + ACPI_INTEGER FieldValue, + UINT32 FieldDatumByteOffset); -ACPI_STATUS -AcpiExAccessRegionField ( - UINT32 Mode, - ACPI_OPERAND_OBJECT *ObjDesc, +void +AcpiExGetBufferDatum( + ACPI_INTEGER *Datum, void *Buffer, - UINT32 BufferLength); - + UINT32 ByteGranularity, + UINT32 Offset); -ACPI_STATUS -AcpiExAccessBufferField ( - UINT32 Mode, - ACPI_OPERAND_OBJECT *ObjDesc, +void +AcpiExSetBufferDatum ( + ACPI_INTEGER MergedDatum, void *Buffer, - UINT32 BufferLength); + UINT32 ByteGranularity, + UINT32 Offset); ACPI_STATUS AcpiExReadDataFromField ( @@ -733,7 +730,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - UINT32 *Value, + ACPI_INTEGER *Value, void *HandlerContext, void *RegionContext); @@ -742,7 +739,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - UINT32 *Value, + ACPI_INTEGER *Value, void *HandlerContext, void *RegionContext); @@ -751,7 +748,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - UINT32 *Value, + ACPI_INTEGER *Value, void *HandlerContext, void *RegionContext); @@ -760,7 +757,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - UINT32 *Value, + ACPI_INTEGER *Value, void *HandlerContext, void *RegionContext); @@ -769,7 +766,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - UINT32 *Value, + ACPI_INTEGER *Value, void *HandlerContext, void *RegionContext); @@ -778,7 +775,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - UINT32 *Value, + ACPI_INTEGER *Value, void *HandlerContext, void *RegionContext); @@ -787,7 +784,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - UINT32 *Value, + ACPI_INTEGER *Value, void *HandlerContext, void *RegionContext); Index: contrib/dev/acpica/aclocal.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/aclocal.h,v retrieving revision 1.1.1.13 diff -u -r1.1.1.13 aclocal.h --- contrib/dev/acpica/aclocal.h 31 Oct 2001 02:32:27 -0000 1.1.1.13 +++ contrib/dev/acpica/aclocal.h 7 Nov 2001 09:37:37 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: aclocal.h - Internal data types used across the ACPI subsystem - * $Revision: 138 $ + * $Revision: 143 $ * *****************************************************************************/ @@ -294,7 +294,7 @@ /* Node flags */ -#define ANOBJ_AML_ATTACHMENT 0x01 +#define ANOBJ_RESERVED 0x01 #define ANOBJ_END_OF_PEER_LIST 0x02 #define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */ #define ANOBJ_METHOD_ARG 0x08 @@ -428,18 +428,6 @@ #define ACPI_ENABLE_RTC_ALARM 0x0400 -/* - * Entry in the AddressSpace (AKA Operation Region) table - */ - -typedef struct -{ - ACPI_ADR_SPACE_HANDLER Handler; - void *Context; - -} ACPI_ADR_SPACE_INFO; - - /* Values and addresses of the GPE registers (both banks) */ typedef struct @@ -643,7 +631,6 @@ } ACPI_GENERIC_STATE; - /***************************************************************************** * * Interpreter typedefs and structs @@ -666,15 +653,16 @@ */ typedef struct acpi_opcode_info { +#ifdef _OPCODE_NAMES + NATIVE_CHAR *Name; /* Opcode name (debug only) */ +#endif UINT32 ParseArgs; /* Grammar/Parse time arguments */ UINT32 RuntimeArgs; /* Interpret time arguments */ - UINT16 Flags; /* Misc flags */ + UINT32 Flags; /* Misc flags */ + UINT8 ObjectType; /* Corresponding internal object type */ UINT8 Class; /* Opcode class */ UINT8 Type; /* Opcode type */ -#ifdef _OPCODE_NAMES - NATIVE_CHAR *Name; /* op name (debug only) */ -#endif } ACPI_OPCODE_INFO; @@ -753,8 +741,6 @@ struct acpi_parse_obj *StartScope; - - } ACPI_PARSE_STATE; @@ -889,10 +875,6 @@ #define GPE1_STS_MASK #define GPE1_EN_MASK - - -#define ACPI_READ 1 -#define ACPI_WRITE 2 /***************************************************************************** Index: contrib/dev/acpica/acmacros.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acmacros.h,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 acmacros.h --- contrib/dev/acpica/acmacros.h 31 Oct 2001 02:32:27 -0000 1.1.1.10 +++ contrib/dev/acpica/acmacros.h 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acmacros.h - C macros for the entire subsystem. - * $Revision: 97 $ + * $Revision: 100 $ * *****************************************************************************/ @@ -321,8 +321,8 @@ * MASK_BITS_ABOVE creates a mask starting AT the position and above * MASK_BITS_BELOW creates a mask starting one bit BELOW the position */ -#define MASK_BITS_ABOVE(position) (~(((UINT32)(-1)) << ((UINT32) (position)))) -#define MASK_BITS_BELOW(position) (((UINT32)(-1)) << ((UINT32) (position))) +#define MASK_BITS_ABOVE(position) (~(((ACPI_INTEGER)(-1)) << ((UINT32) (position)))) +#define MASK_BITS_BELOW(position) (((ACPI_INTEGER)(-1)) << ((UINT32) (position))) /* Macros for GAS addressing */ @@ -348,8 +348,8 @@ #endif /* - * An ACPI_HANDLE (which is actually an ACPI_NAMESPACE_NODE *) can appear in some contexts, - * such as on apObjStack, where a pointer to an ACPI_OPERAND_OBJECT can also + * An ACPI_NAMESPACE_NODE * can appear in some contexts, + * where a pointer to an ACPI_OPERAND_OBJECT can also * appear. This macro is used to distinguish them. * * The DataType field is the first field in both structures. @@ -385,9 +385,9 @@ * Macros for the master AML opcode table */ #ifdef ACPI_DEBUG -#define ACPI_OP(Name,PArgs,IArgs,Class,Type,Flags) {PArgs,IArgs,Flags,Class,Type,Name} +#define ACPI_OP(Name,PArgs,IArgs,ObjType,Class,Type,Flags) {Name,PArgs,IArgs,Flags,ObjType,Class,Type} #else -#define ACPI_OP(Name,PArgs,IArgs,Class,Type,Flags) {PArgs,IArgs,Flags,Class,Type} +#define ACPI_OP(Name,PArgs,IArgs,ObjType,Class,Type,Flags) {PArgs,IArgs,Flags,ObjType,Class,Type} #endif #define ARG_TYPE_WIDTH 5 Index: contrib/dev/acpica/acnamesp.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acnamesp.h,v retrieving revision 1.1.1.8 diff -u -r1.1.1.8 acnamesp.h --- contrib/dev/acpica/acnamesp.h 31 Oct 2001 02:32:27 -0000 1.1.1.8 +++ contrib/dev/acpica/acnamesp.h 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acnamesp.h - Namespace subcomponent prototypes and defines - * $Revision: 110 $ + * $Revision: 111 $ * *****************************************************************************/ @@ -137,7 +137,7 @@ #define ACPI_ROOT_NAME (UINT32) 0x2F202020 /* Root name is "/ " */ #define ACPI_SYS_BUS_NAME (UINT32) 0x5F53425F /* Sys bus name is "_SB_" */ -#define NS_ROOT_PATH "/" +#define NS_ROOT_PATH "\\" #define NS_SYSTEM_BUS "_SB_" Index: contrib/dev/acpica/acobject.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acobject.h,v retrieving revision 1.1.1.8 diff -u -r1.1.1.8 acobject.h --- contrib/dev/acpica/acobject.h 31 Oct 2001 02:32:27 -0000 1.1.1.8 +++ contrib/dev/acpica/acobject.h 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Name: acobject.h - Definition of ACPI_OPERAND_OBJECT (Internal object only) - * $Revision: 93 $ + * $Revision: 97 $ * *****************************************************************************/ @@ -157,11 +157,11 @@ /* Defines for flag byte above */ -#define AOPOBJ_STATIC_ALLOCATION 0x1 -#define AOPOBJ_STATIC_POINTER 0x2 -#define AOPOBJ_DATA_VALID 0x4 -#define AOPOBJ_ZERO_CONST 0x4 -#define AOPOBJ_INITIALIZED 0x8 +#define AOPOBJ_STATIC_ALLOCATION 0x01 +#define AOPOBJ_STATIC_POINTER 0x02 +#define AOPOBJ_DATA_VALID 0x04 +#define AOPOBJ_OBJECT_INITIALIZED 0x08 +#define AOPOBJ_SETUP_COMPLETE 0x10 /* @@ -181,7 +181,8 @@ UINT8 DatumValidBits; /* Valid bit in first "Field datum" */\ UINT8 EndFieldValidBits; /* Valid bits in the last "field datum" */\ UINT8 EndBufferValidBits; /* Valid bits in the last "buffer datum" */\ - UINT32 Value; /* Value to store into the Bank or Index register */ + UINT32 Value; /* Value to store into the Bank or Index register */\ + ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */ /* Access flag bits */ @@ -196,7 +197,6 @@ UINT32 Length; - /****************************************************************************** * * Individual Object Descriptors @@ -242,6 +242,7 @@ ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO UINT8 *Pointer; /* Buffer value in AML stream or in allocated space */ + ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */ } ACPI_OBJECT_BUFFER; @@ -393,7 +394,7 @@ ACPI_COMMON_FIELD_INFO union acpi_operand_obj *RegionObj; /* Containing OpRegion object */ - union acpi_operand_obj *BankRegisterObj; /* BankSelect Register object */ + union acpi_operand_obj *BankObj; /* BankSelect Register object */ } ACPI_OBJECT_BANK_FIELD; @@ -422,7 +423,6 @@ ACPI_COMMON_FIELD_INFO union acpi_operand_obj *Extra; /* Pointer to executable AML (in field definition) */ - ACPI_NAMESPACE_NODE *Node; /* Parent (containing) object node */ union acpi_operand_obj *BufferObj; /* Containing Buffer object */ } ACPI_OBJECT_BUFFER_FIELD; Index: contrib/dev/acpica/acparser.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acparser.h,v retrieving revision 1.1.1.5 diff -u -r1.1.1.5 acparser.h --- contrib/dev/acpica/acparser.h 4 Oct 2001 23:12:11 -0000 1.1.1.5 +++ contrib/dev/acpica/acparser.h 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: acparser.h - AML Parser subcomponent prototypes and defines - * $Revision: 54 $ + * $Revision: 55 $ * *****************************************************************************/ @@ -119,15 +119,15 @@ #define __ACPARSER_H__ -#define OP_HAS_RETURN_VALUE 1 +#define OP_HAS_RETURN_VALUE 1 /* variable # arguments */ -#define ACPI_VAR_ARGS ACPI_UINT32_MAX +#define ACPI_VAR_ARGS ACPI_UINT32_MAX /* maximum virtual address */ -#define ACPI_MAX_AML ((UINT8 *)(~0UL)) +#define ACPI_MAX_AML ((UINT8 *)(~0UL)) #define ACPI_PARSE_DELETE_TREE 0x0001 @@ -139,7 +139,8 @@ #define ACPI_PARSE_EXECUTE 0x0030 #define ACPI_PARSE_MODE_MASK 0x0030 -/* psapi - Parser external interfaces */ + +/* Parser external interfaces */ ACPI_STATUS AcpiPsxLoadTable ( @@ -152,6 +153,7 @@ ACPI_OPERAND_OBJECT **Params, ACPI_OPERAND_OBJECT **ReturnObjDesc); + /****************************************************************************** * * Parser interfaces @@ -176,8 +178,8 @@ void AcpiPsGetNextSimpleArg ( ACPI_PARSE_STATE *ParserState, - UINT32 ArgType, /* type of argument */ - ACPI_PARSE_OBJECT *Arg); /* (OUT) argument data */ + UINT32 ArgType, + ACPI_PARSE_OBJECT *Arg); void AcpiPsGetNextNamepath ( @@ -197,6 +199,19 @@ UINT32 *ArgCount); +/* psfind */ + +ACPI_PARSE_OBJECT * +AcpiPsFindName ( + ACPI_PARSE_OBJECT *Scope, + UINT32 Name, + UINT32 Opcode); + +ACPI_PARSE_OBJECT* +AcpiPsGetParent ( + ACPI_PARSE_OBJECT *Op); + + /* psopcode - AML Opcode information */ const ACPI_OPCODE_INFO * @@ -210,6 +225,21 @@ /* psparse - top level parsing routines */ +UINT32 +AcpiPsGetOpcodeSize ( + UINT32 Opcode); + +BOOLEAN +AcpiPsCompleteThisOp ( + ACPI_WALK_STATE *WalkState, + ACPI_PARSE_OBJECT *Op); + +ACPI_STATUS +AcpiPsNextParseState ( + ACPI_WALK_STATE *WalkState, + ACPI_PARSE_OBJECT *Op, + ACPI_STATUS CallbackStatus); + ACPI_STATUS AcpiPsFindObject ( ACPI_WALK_STATE *WalkState, @@ -323,6 +353,10 @@ ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op, ACPI_PARSE_UPWARDS AscendingCallback); + +ACPI_STATUS +AcpiPsDeleteCompletedOp ( + ACPI_WALK_STATE *WalkState); /* psutils - parser utilities */ Index: contrib/dev/acpica/acpiosxf.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acpiosxf.h,v retrieving revision 1.5 diff -u -r1.5 acpiosxf.h --- contrib/dev/acpica/acpiosxf.h 31 Oct 2001 02:34:45 -0000 1.5 +++ contrib/dev/acpica/acpiosxf.h 7 Nov 2001 09:42:49 -0000 @@ -294,7 +294,7 @@ ACPI_STATUS AcpiOsWritePort ( ACPI_IO_ADDRESS Address, - NATIVE_UINT Value, + ACPI_INTEGER Value, UINT32 Width); @@ -312,7 +312,7 @@ ACPI_STATUS AcpiOsWriteMemory ( ACPI_PHYSICAL_ADDRESS Address, - NATIVE_UINT Value, + ACPI_INTEGER Value, UINT32 Width); @@ -332,7 +332,7 @@ AcpiOsWritePciConfiguration ( ACPI_PCI_ID *PciId, UINT32 Register, - NATIVE_UINT Value, + ACPI_INTEGER Value, UINT32 Width); Index: contrib/dev/acpica/acstruct.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acstruct.h,v retrieving revision 1.1.1.4 diff -u -r1.1.1.4 acstruct.h --- contrib/dev/acpica/acstruct.h 31 Oct 2001 02:32:27 -0000 1.1.1.4 +++ contrib/dev/acpica/acstruct.h 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acstruct.h - Internal structs - * $Revision: 10 $ + * $Revision: 11 $ * *****************************************************************************/ @@ -188,7 +188,6 @@ struct acpi_walk_state *Next; /* Next WalkState in list */ - } ACPI_WALK_STATE; @@ -256,8 +255,6 @@ } ACPI_GET_DEVICES_INFO; - - typedef union acpi_aml_operands { ACPI_OPERAND_OBJECT *Operands[7]; @@ -288,7 +285,6 @@ } Mid; } ACPI_AML_OPERANDS; - #endif Index: contrib/dev/acpica/actypes.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/actypes.h,v retrieving revision 1.1.1.13 diff -u -r1.1.1.13 actypes.h --- contrib/dev/acpica/actypes.h 31 Oct 2001 02:32:27 -0000 1.1.1.13 +++ contrib/dev/acpica/actypes.h 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: actypes.h - Common data types for the entire ACPI subsystem - * $Revision: 193 $ + * $Revision: 197 $ * *****************************************************************************/ @@ -427,25 +427,25 @@ typedef UINT8 ACPI_OBJECT_TYPE8; -#define ACPI_TYPE_ANY 0 /* 0x00 */ -#define ACPI_TYPE_INTEGER 1 /* 0x01 Byte/Word/Dword/Zero/One/Ones */ -#define ACPI_TYPE_STRING 2 /* 0x02 */ -#define ACPI_TYPE_BUFFER 3 /* 0x03 */ -#define ACPI_TYPE_PACKAGE 4 /* 0x04 ByteConst, multiple DataTerm/Constant/SuperName */ -#define ACPI_TYPE_FIELD_UNIT 5 /* 0x05 */ -#define ACPI_TYPE_DEVICE 6 /* 0x06 Name, multiple Node */ -#define ACPI_TYPE_EVENT 7 /* 0x07 */ -#define ACPI_TYPE_METHOD 8 /* 0x08 Name, ByteConst, multiple Code */ -#define ACPI_TYPE_MUTEX 9 /* 0x09 */ -#define ACPI_TYPE_REGION 10 /* 0x0A */ -#define ACPI_TYPE_POWER 11 /* 0x0B Name,ByteConst,WordConst,multi Node */ -#define ACPI_TYPE_PROCESSOR 12 /* 0x0C Name,ByteConst,DWordConst,ByteConst,multi NmO */ -#define ACPI_TYPE_THERMAL 13 /* 0x0D Name, multiple Node */ -#define ACPI_TYPE_BUFFER_FIELD 14 /* 0x0E */ -#define ACPI_TYPE_DDB_HANDLE 15 /* 0x0F */ -#define ACPI_TYPE_DEBUG_OBJECT 16 /* 0x10 */ +#define ACPI_TYPE_ANY 0x00 +#define ACPI_TYPE_INTEGER 0x01 /* Byte/Word/Dword/Zero/One/Ones */ +#define ACPI_TYPE_STRING 0x02 +#define ACPI_TYPE_BUFFER 0x03 +#define ACPI_TYPE_PACKAGE 0x04 /* ByteConst, multiple DataTerm/Constant/SuperName */ +#define ACPI_TYPE_FIELD_UNIT 0x05 +#define ACPI_TYPE_DEVICE 0x06 /* Name, multiple Node */ +#define ACPI_TYPE_EVENT 0x07 +#define ACPI_TYPE_METHOD 0x08 /* Name, ByteConst, multiple Code */ +#define ACPI_TYPE_MUTEX 0x09 +#define ACPI_TYPE_REGION 0x0A +#define ACPI_TYPE_POWER 0x0B /* Name,ByteConst,WordConst,multi Node */ +#define ACPI_TYPE_PROCESSOR 0x0C /* Name,ByteConst,DWordConst,ByteConst,multi NmO */ +#define ACPI_TYPE_THERMAL 0x0D /* Name, multiple Node */ +#define ACPI_TYPE_BUFFER_FIELD 0x0E +#define ACPI_TYPE_DDB_HANDLE 0x0F +#define ACPI_TYPE_DEBUG_OBJECT 0x10 -#define ACPI_TYPE_MAX 16 +#define ACPI_TYPE_MAX 0x10 /* * This section contains object types that do not relate to the ACPI ObjectType operator. @@ -454,36 +454,36 @@ * Also, values exceeding the largest official ACPI ObjectType must not overlap with * defined AML opcodes. */ -#define INTERNAL_TYPE_BEGIN 17 +#define INTERNAL_TYPE_BEGIN 0x11 -#define INTERNAL_TYPE_REGION_FIELD 17 /* 0x11 */ -#define INTERNAL_TYPE_BANK_FIELD 18 /* 0x12 */ -#define INTERNAL_TYPE_INDEX_FIELD 19 /* 0x13 */ -#define INTERNAL_TYPE_REFERENCE 20 /* 0x14 Arg#, Local#, Name, Debug; used only in descriptors */ -#define INTERNAL_TYPE_ALIAS 21 /* 0x15 */ -#define INTERNAL_TYPE_NOTIFY 22 /* 0x16 */ -#define INTERNAL_TYPE_ADDRESS_HANDLER 23 /* 0x17 */ -#define INTERNAL_TYPE_RESOURCE 24 /* 0x18 */ -#define INTERNAL_TYPE_RESOURCE_FIELD 25 /* 0x19 */ +#define INTERNAL_TYPE_REGION_FIELD 0x11 +#define INTERNAL_TYPE_BANK_FIELD 0x12 +#define INTERNAL_TYPE_INDEX_FIELD 0x13 +#define INTERNAL_TYPE_REFERENCE 0x14 /* Arg#, Local#, Name, Debug; used only in descriptors */ +#define INTERNAL_TYPE_ALIAS 0x15 +#define INTERNAL_TYPE_NOTIFY 0x16 +#define INTERNAL_TYPE_ADDRESS_HANDLER 0x17 +#define INTERNAL_TYPE_RESOURCE 0x18 +#define INTERNAL_TYPE_RESOURCE_FIELD 0x19 -#define INTERNAL_TYPE_NODE_MAX 25 +#define INTERNAL_TYPE_NODE_MAX 0x19 /* These are pseudo-types because there are never any namespace nodes with these types */ -#define INTERNAL_TYPE_FIELD_DEFN 26 /* 0x1A Name, ByteConst, multiple FieldElement */ -#define INTERNAL_TYPE_BANK_FIELD_DEFN 27 /* 0x1B 2 Name,DWordConst,ByteConst,multi FieldElement */ -#define INTERNAL_TYPE_INDEX_FIELD_DEFN 28 /* 0x1C 2 Name, ByteConst, multiple FieldElement */ -#define INTERNAL_TYPE_IF 29 /* 0x1D */ -#define INTERNAL_TYPE_ELSE 30 /* 0x1E */ -#define INTERNAL_TYPE_WHILE 31 /* 0x1F */ -#define INTERNAL_TYPE_SCOPE 32 /* 0x20 Name, multiple Node */ -#define INTERNAL_TYPE_DEF_ANY 33 /* 0x21 type is Any, suppress search of enclosing scopes */ -#define INTERNAL_TYPE_EXTRA 34 /* 0x22 */ +#define INTERNAL_TYPE_FIELD_DEFN 0x1A /* Name, ByteConst, multiple FieldElement */ +#define INTERNAL_TYPE_BANK_FIELD_DEFN 0x1B /* 2 Name,DWordConst,ByteConst,multi FieldElement */ +#define INTERNAL_TYPE_INDEX_FIELD_DEFN 0x1C /* 2 Name, ByteConst, multiple FieldElement */ +#define INTERNAL_TYPE_IF 0x1D +#define INTERNAL_TYPE_ELSE 0x1E +#define INTERNAL_TYPE_WHILE 0x1F +#define INTERNAL_TYPE_SCOPE 0x20 /* Name, multiple Node */ +#define INTERNAL_TYPE_DEF_ANY 0x21 /* type is Any, suppress search of enclosing scopes */ +#define INTERNAL_TYPE_EXTRA 0x22 -#define INTERNAL_TYPE_MAX 34 +#define INTERNAL_TYPE_MAX 0x22 -#define INTERNAL_TYPE_INVALID 35 +#define INTERNAL_TYPE_INVALID 0x23 #define ACPI_TYPE_NOT_FOUND 0xFF @@ -519,6 +519,12 @@ #define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF +/* + * All I/O + */ +#define ACPI_READ 0 +#define ACPI_WRITE 1 + /* * AcpiEvent Types: @@ -560,7 +566,7 @@ * GPEs */ #define ACPI_EVENT_ENABLE 0x1 -#define ACPI_EVENT_WAKE_ENABLE 0x2 +#define ACPI_EVENT_WAKE_ENABLE 0x2 #define ACPI_EVENT_DISABLE 0x1 #define ACPI_EVENT_WAKE_DISABLE 0x2 @@ -763,15 +769,12 @@ /* Address Spaces (Operation Regions */ -#define ACPI_READ_ADR_SPACE 1 -#define ACPI_WRITE_ADR_SPACE 2 - typedef ACPI_STATUS (*ACPI_ADR_SPACE_HANDLER) ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - UINT32 *Value, + ACPI_INTEGER *Value, void *HandlerContext, void *RegionContext); Index: contrib/dev/acpica/acutils.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acutils.h,v retrieving revision 1.1.1.12 diff -u -r1.1.1.12 acutils.h --- contrib/dev/acpica/acutils.h 31 Oct 2001 02:32:27 -0000 1.1.1.12 +++ contrib/dev/acpica/acutils.h 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures - * $Revision: 117 $ + * $Revision: 118 $ * *****************************************************************************/ @@ -474,6 +474,7 @@ /* Method name strings */ #define METHOD_NAME__HID "_HID" +#define METHOD_NAME__CID "_CID" #define METHOD_NAME__UID "_UID" #define METHOD_NAME__ADR "_ADR" #define METHOD_NAME__STA "_STA" @@ -493,6 +494,11 @@ AcpiUtExecute_HID ( ACPI_NAMESPACE_NODE *DeviceNode, ACPI_DEVICE_ID *Hid); + +ACPI_STATUS +AcpiUtExecute_CID ( + ACPI_NAMESPACE_NODE *DeviceNode, + ACPI_DEVICE_ID *Cid); ACPI_STATUS AcpiUtExecute_STA ( Index: contrib/dev/acpica/amlcode.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/amlcode.h,v retrieving revision 1.1.1.7 diff -u -r1.1.1.7 amlcode.h --- contrib/dev/acpica/amlcode.h 31 Oct 2001 02:32:27 -0000 1.1.1.7 +++ contrib/dev/acpica/amlcode.h 7 Nov 2001 09:37:36 -0000 @@ -3,7 +3,7 @@ * Name: amlcode.h - Definitions for AML, as included in "definition blocks" * Declarations and definitions contained herein are derived * directly from the ACPI specification. - * $Revision: 58 $ + * $Revision: 60 $ * *****************************************************************************/ @@ -358,8 +358,8 @@ #define OPGRP_BYTELIST 0x04 -/* - * Opcode information +/* + * Opcode information */ /* Opcode flags */ @@ -433,8 +433,8 @@ #define AML_TYPE_BOGUS 0x19 -/* - * Opcode classes +/* + * Opcode classes */ #define AML_CLASS_EXECUTE 0x00 #define AML_CLASS_CREATE 0x01 @@ -493,9 +493,7 @@ ACCESS_WORD_ACC = 2, ACCESS_DWORD_ACC = 3, ACCESS_QWORD_ACC = 4, /* ACPI 2.0 */ - ACCESS_BLOCK_ACC = 4, - ACCESS_SMBSEND_RECV_ACC = 5, - ACCESS_SMBQUICK_ACC = 6 + ACCESS_BUFFER_ACC = 5, /* ACPI 2.0 */ } AML_ACCESS_TYPE; @@ -536,15 +534,11 @@ /* Array sizes. Used for range checking also */ -#define NUM_REGION_TYPES 7 -#define NUM_ACCESS_TYPES 7 +#define NUM_ACCESS_TYPES 6 #define NUM_UPDATE_RULES 3 #define NUM_MATCH_OPS 7 #define NUM_OPCODES 256 #define NUM_FIELD_NAMES 2 - - -#define USER_REGION_BEGIN 0x80 #endif /* __AMLCODE_H__ */ Index: contrib/dev/acpica/dbdisasm.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/dbdisasm.c,v retrieving revision 1.1.1.8 diff -u -r1.1.1.8 dbdisasm.c --- contrib/dev/acpica/dbdisasm.c 31 Oct 2001 02:32:27 -0000 1.1.1.8 +++ contrib/dev/acpica/dbdisasm.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbdisasm - parser op tree display routines - * $Revision: 50 $ + * $Revision: 52 $ * ******************************************************************************/ @@ -208,7 +208,6 @@ */ AcpiOsPrintf (" **** Path not found in parse tree"); } - else { /* The target was found, print the name and complete path */ @@ -316,139 +315,135 @@ UINT32 j; - if (Op) + if (!Op) + { + AcpiDbDisplayOpcode (WalkState, Op); + return; + } + + + while (Op) { - while (Op) + /* Indentation */ + + DepthCount = 0; + if (!AcpiGbl_DbOpt_verbose) { - /* indentation */ + DepthCount++; + } + + /* Determine the nesting depth of this argument */ - DepthCount = 0; - if (!AcpiGbl_DbOpt_verbose) + for (depth = Op->Parent; depth; depth = depth->Parent) + { + arg = AcpiPsGetArg (depth, 0); + while (arg && arg != Origin) { - DepthCount++; + arg = arg->Next; } - /* Determine the nesting depth of this argument */ - - for (depth = Op->Parent; depth; depth = depth->Parent) + if (arg) { - arg = AcpiPsGetArg (depth, 0); - while (arg && arg != Origin) - { - arg = arg->Next; - } + break; + } - if (arg) - { - break; - } + DepthCount++; + } + + /* Open a new block if we are nested further than last time */ - DepthCount++; + if (DepthCount > LastDepth) + { + VERBOSE_PRINT ((DB_NO_OP_INFO, LastDepth)); + for (i = 0; i < LastDepth; i++) + { + AcpiOsPrintf ("%s", AcpiGbl_DbDisasmIndent); } + if (AcpiDbBlockType (Op) == BLOCK_PAREN) + { + AcpiOsPrintf ("(\n"); + } + else + { + AcpiOsPrintf ("{\n"); + } + } - /* Open a new block if we are nested further than last time */ + /* Close a block if we are nested less than last time */ - if (DepthCount > LastDepth) + else if (DepthCount < LastDepth) + { + for (j = 0; j < (LastDepth - DepthCount); j++) { - VERBOSE_PRINT ((DB_NO_OP_INFO, LastDepth)); - for (i = 0; i < LastDepth; i++) + VERBOSE_PRINT ((DB_NO_OP_INFO, LastDepth - j)); + for (i = 0; i < (LastDepth - j - 1); i++) { AcpiOsPrintf ("%s", AcpiGbl_DbDisasmIndent); } if (AcpiDbBlockType (Op) == BLOCK_PAREN) { - AcpiOsPrintf ("(\n"); + AcpiOsPrintf (")\n"); } else { - AcpiOsPrintf ("{\n"); - } - } - - /* Close a block if we are nested less than last time */ - - else if (DepthCount < LastDepth) - { - for (j = 0; j < (LastDepth - DepthCount); j++) - { - VERBOSE_PRINT ((DB_NO_OP_INFO, LastDepth - j)); - for (i = 0; i < (LastDepth - j - 1); i++) - { - AcpiOsPrintf ("%s", AcpiGbl_DbDisasmIndent); - } - - if (AcpiDbBlockType (Op) == BLOCK_PAREN) - { - AcpiOsPrintf (")\n"); - } - else - { - AcpiOsPrintf ("}\n"); - } + AcpiOsPrintf ("}\n"); } } + } - /* In verbose mode, print the AML offset, opcode and depth count */ - - VERBOSE_PRINT ((DB_FULL_OP_INFO, (unsigned) Op->AmlOffset, Op->Opcode, DepthCount)); - - - /* Indent the output according to the depth count */ + /* In verbose mode, print the AML offset, opcode and depth count */ - for (i = 0; i < DepthCount; i++) - { - AcpiOsPrintf ("%s", AcpiGbl_DbDisasmIndent); - } + VERBOSE_PRINT ((DB_FULL_OP_INFO, (unsigned) Op->AmlOffset, Op->Opcode, DepthCount)); - /* Now print the opcode */ + /* Indent the output according to the depth count */ - AcpiDbDisplayOpcode (WalkState, Op); + for (i = 0; i < DepthCount; i++) + { + AcpiOsPrintf ("%s", AcpiGbl_DbDisasmIndent); + } - /* Resolve a name reference */ + /* Now print the opcode */ - if ((Op->Opcode == AML_INT_NAMEPATH_OP && Op->Value.Name) && - (Op->Parent) && - (AcpiGbl_DbOpt_verbose)) - { - AcpiPsDisplayObjectPathname (WalkState, Op); - } + AcpiDbDisplayOpcode (WalkState, Op); - AcpiOsPrintf ("\n"); + /* Resolve a name reference */ - /* Get the next node in the tree */ + if ((Op->Opcode == AML_INT_NAMEPATH_OP && Op->Value.Name) && + (Op->Parent) && + (AcpiGbl_DbOpt_verbose)) + { + AcpiPsDisplayObjectPathname (WalkState, Op); + } - Op = AcpiPsGetDepthNext (Origin, Op); - LastDepth = DepthCount; + AcpiOsPrintf ("\n"); - NumOpcodes--; - if (!NumOpcodes) - { - Op = NULL; - } - } + /* Get the next node in the tree */ - /* Close the last block(s) */ + Op = AcpiPsGetDepthNext (Origin, Op); + LastDepth = DepthCount; - DepthCount = LastDepth -1; - for (i = 0; i < LastDepth; i++) + NumOpcodes--; + if (!NumOpcodes) { - VERBOSE_PRINT ((DB_NO_OP_INFO, LastDepth - i)); - for (j = 0; j < DepthCount; j++) - { - AcpiOsPrintf ("%s", AcpiGbl_DbDisasmIndent); - } - AcpiOsPrintf ("}\n"); - DepthCount--; + Op = NULL; } - } - else + /* Close the last block(s) */ + + DepthCount = LastDepth -1; + for (i = 0; i < LastDepth; i++) { - AcpiDbDisplayOpcode (WalkState, Op); + VERBOSE_PRINT ((DB_NO_OP_INFO, LastDepth - i)); + for (j = 0; j < DepthCount; j++) + { + AcpiOsPrintf ("%s", AcpiGbl_DbDisasmIndent); + } + AcpiOsPrintf ("}\n"); + DepthCount--; } } @@ -557,7 +552,6 @@ return; } - if (OpInfo->Flags & AML_CREATE) { /* Field creation - check for a fully qualified namepath */ @@ -630,7 +624,6 @@ AcpiOsPrintf ("%4.4s", NamePath->Value.String); } } - else { Name = AcpiPsGetName (Search); @@ -678,24 +671,20 @@ AcpiOsPrintf (""); } - /* op and arguments */ switch (Op->Opcode) { - case AML_BYTE_OP: if (AcpiGbl_DbOpt_verbose) { AcpiOsPrintf ("(UINT8) 0x%2.2X", Op->Value.Integer8); } - else { AcpiOsPrintf ("0x%2.2X", Op->Value.Integer8); } - break; @@ -705,12 +694,10 @@ { AcpiOsPrintf ("(UINT16) 0x%4.4X", Op->Value.Integer16); } - else { AcpiOsPrintf ("0x%4.4X", Op->Value.Integer16); } - break; @@ -720,12 +707,10 @@ { AcpiOsPrintf ("(UINT32) 0x%8.8X", Op->Value.Integer32); } - else { AcpiOsPrintf ("0x%8.8X", Op->Value.Integer32); } - break; @@ -736,13 +721,11 @@ AcpiOsPrintf ("(UINT64) 0x%8.8X%8.8X", Op->Value.Integer64.Hi, Op->Value.Integer64.Lo); } - else { AcpiOsPrintf ("0x%8.8X%8.8X", Op->Value.Integer64.Hi, Op->Value.Integer64.Lo); } - break; @@ -752,12 +735,10 @@ { AcpiOsPrintf ("\"%s\"", Op->Value.String); } - else { AcpiOsPrintf ("<\"NULL STRING PTR\">"); } - break; @@ -767,12 +748,10 @@ { AcpiOsPrintf ("\"%s\"", Op->Value.String); } - else { AcpiOsPrintf ("\"\""); } - break; @@ -806,7 +785,6 @@ { AcpiOsPrintf ("ByteList (Length 0x%8.8X) ", Op->Value.Integer32); } - else { AcpiOsPrintf ("0x%2.2X", Op->Value.Integer32); @@ -819,7 +797,6 @@ AcpiOsPrintf (", 0x%2.2X", ByteData[i]); } } - break; @@ -839,7 +816,6 @@ AcpiDbDecodeInternalObject (WalkState->Results->Results.ObjDesc [WalkState->Results->Results.NumResults-1]); } #endif - break; } @@ -864,13 +840,10 @@ if (AcpiGbl_DbOpt_verbose) { - AcpiOsPrintf (" (Path \\"); - AcpiDbDisplayPath (Op); - AcpiOsPrintf (")"); + AcpiPsDisplayObjectPathname (WalkState, Op); } } } - #endif /* ENABLE_DEBUGGER */ Index: contrib/dev/acpica/dbdisply.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/dbdisply.c,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 dbdisply.c --- contrib/dev/acpica/dbdisply.c 31 Oct 2001 02:32:27 -0000 1.1.1.11 +++ contrib/dev/acpica/dbdisply.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbdisply - debug display commands - * $Revision: 57 $ + * $Revision: 59 $ * ******************************************************************************/ @@ -168,7 +168,6 @@ /* Simple flat pointer */ ObjPtr = (void *) STRTOUL (Target, NULL, 16); - #endif return (ObjPtr); @@ -259,7 +258,6 @@ } } - RetBuf.Length = sizeof (Buffer); RetBuf.Pointer = Buffer; @@ -314,7 +312,6 @@ return; } - AcpiUtDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), Display, ACPI_UINT32_MAX); AcpiDbDumpParserDescriptor ((ACPI_PARSE_OBJECT *) ObjPtr); } @@ -475,7 +472,6 @@ return; } - /* Decode the object type */ else if (VALID_DESCRIPTOR_TYPE (ObjDesc, ACPI_DESC_TYPE_PARSER)) @@ -488,6 +484,7 @@ AcpiOsPrintf (" Name %4.4s Type-%s", &((ACPI_NAMESPACE_NODE *)ObjDesc)->Name, AcpiUtGetTypeName (((ACPI_NAMESPACE_NODE *) ObjDesc)->Type)); + if (((ACPI_NAMESPACE_NODE *) ObjDesc)->Flags & ANOBJ_METHOD_ARG) { AcpiOsPrintf (" [Method Arg]"); @@ -623,9 +620,9 @@ } ObjDesc = WalkState->MethodDesc; - Node = WalkState->MethodNode; + Node = WalkState->MethodNode; - NumArgs = ObjDesc->Method.ParamCount; + NumArgs = ObjDesc->Method.ParamCount; Concurrency = ObjDesc->Method.Concurrency; AcpiOsPrintf ("Currently executing control method is [%4.4s]\n", &Node->Name); @@ -682,7 +679,6 @@ break; } - Op = AcpiPsGetDepthNext (StartOp, Op); } @@ -724,8 +720,6 @@ ObjDesc = WalkState->MethodDesc; Node = WalkState->MethodNode; - - AcpiOsPrintf ("Local Variables for method [%4.4s]:\n", &Node->Name); for (i = 0; i < MTH_NUM_LOCALS; i++) @@ -768,12 +762,13 @@ } ObjDesc = WalkState->MethodDesc; - Node = WalkState->MethodNode; + Node = WalkState->MethodNode; - NumArgs = ObjDesc->Method.ParamCount; + NumArgs = ObjDesc->Method.ParamCount; Concurrency = ObjDesc->Method.Concurrency; - AcpiOsPrintf ("Method [%4.4s] has %X arguments, max concurrency = %X\n", &Node->Name, NumArgs, Concurrency); + AcpiOsPrintf ("Method [%4.4s] has %X arguments, max concurrency = %X\n", + &Node->Name, NumArgs, Concurrency); for (i = 0; i < NumArgs; i++) { @@ -821,7 +816,8 @@ NumResults = WalkState->Results->Results.NumResults; } - AcpiOsPrintf ("Method [%4.4s] has %X stacked result objects\n", &Node->Name, NumResults); + AcpiOsPrintf ("Method [%4.4s] has %X stacked result objects\n", + &Node->Name, NumResults); for (i = 0; i < NumResults; i++) { @@ -860,7 +856,6 @@ } Node = WalkState->MethodNode; - AcpiOsPrintf ("Current Control Method Call Tree\n"); for (i = 0; WalkState; i++) @@ -926,7 +921,6 @@ ACPI_OPERAND_OBJECT *ObjDesc, ACPI_WALK_STATE *WalkState) { - if (!AcpiGbl_CmSingleStep) { Index: contrib/dev/acpica/dbfileio.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/dbfileio.c,v retrieving revision 1.1.1.12 diff -u -r1.1.1.12 dbfileio.c --- contrib/dev/acpica/dbfileio.c 31 Oct 2001 02:32:27 -0000 1.1.1.12 +++ contrib/dev/acpica/dbfileio.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ * * Module Name: dbfileio - Debugger file I/O commands. These can't usually * be used when running the debugger in Ring 0 (Kernel mode) - * $Revision: 53 $ + * $Revision: 54 $ * ******************************************************************************/ @@ -463,7 +463,7 @@ Status = AeLocalLoadTable (AcpiGbl_DbTablePtr); if (ACPI_FAILURE (Status)) { - if (Status == AE_EXIST) + if (Status == AE_ALREADY_EXISTS) { AcpiOsPrintf ("Table %4.4s is already installed\n", &AcpiGbl_DbTablePtr->Signature); Index: contrib/dev/acpica/dbxface.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/dbxface.c,v retrieving revision 1.1.1.9 diff -u -r1.1.1.9 dbxface.c --- contrib/dev/acpica/dbxface.c 31 Oct 2001 02:32:27 -0000 1.1.1.9 +++ contrib/dev/acpica/dbxface.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbxface - AML Debugger external interfaces - * $Revision: 45 $ + * $Revision: 46 $ * ******************************************************************************/ @@ -432,7 +432,6 @@ AcpiOsFree (AcpiGbl_DbBuffer); } } - #endif /* ENABLE_DEBUGGER */ Index: contrib/dev/acpica/dsfield.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/dsfield.c,v retrieving revision 1.1.1.7 diff -u -r1.1.1.7 dsfield.c --- contrib/dev/acpica/dsfield.c 31 Oct 2001 02:32:27 -0000 1.1.1.7 +++ contrib/dev/acpica/dsfield.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: dsfield - Dispatcher field routines - * $Revision: 46 $ + * $Revision: 51 $ * *****************************************************************************/ @@ -127,7 +127,6 @@ #define _COMPONENT ACPI_DISPATCHER MODULE_NAME ("dsfield") - /******************************************************************************* * @@ -139,10 +138,10 @@ * * RETURN: Status * - * DESCRIPTION: Execute the CreateField operators: + * DESCRIPTION: Execute the CreateField operators: * CreateBitFieldOp, - * CreateByteFieldOp, - * CreateWordFieldOp, + * CreateByteFieldOp, + * CreateWordFieldOp, * CreateDWordFieldOp, * CreateQWordFieldOp, * CreateFieldOp (all of which define fields in buffers) @@ -158,6 +157,7 @@ ACPI_NAMESPACE_NODE *Node; ACPI_STATUS Status; ACPI_OPERAND_OBJECT *ObjDesc; + UINT32 Flags; FUNCTION_TRACE ("DsCreateBufferField"); @@ -182,11 +182,25 @@ } /* + * During the load phase, we want to enter the name of the field into + * the namespace. During the execute phase (when we evaluate the size + * operand), we want to lookup the name + */ + if (WalkState->ParseFlags & ACPI_PARSE_EXECUTE) + { + Flags = NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE; + } + else + { + Flags = NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE | NS_ERROR_IF_FOUND; + } + + /* * Enter the NameString into the namespace */ Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Value.String, INTERNAL_TYPE_DEF_ANY, IMODE_LOAD_PASS1, - NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE, + Flags, WalkState, &(Node)); if (ACPI_FAILURE (Status)) { @@ -206,6 +220,10 @@ */ if (Node->Object) { + /* No longer need the Extra field */ + + AcpiUtRemoveReference ((Node->Object)->BufferField.Extra); + (Node->Object)->BufferField.Extra = NULL; return_ACPI_STATUS (AE_OK); } @@ -257,7 +275,6 @@ } - /******************************************************************************* * * FUNCTION: AcpiDsGetFieldNames @@ -320,26 +337,35 @@ case AML_INT_NAMEDFIELD_OP: - /* Enter a new field name into the namespace */ + /* Lookup the name */ Status = AcpiNsLookup (WalkState->ScopeInfo, (NATIVE_CHAR *) &((ACPI_PARSE2_OBJECT *)Arg)->Name, - Info->FieldType, IMODE_LOAD_PASS1, - NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE, + Info->FieldType, IMODE_EXECUTE, + NS_DONT_OPEN_SCOPE, NULL, &Info->FieldNode); if (ACPI_FAILURE (Status)) { - return_ACPI_STATUS (Status); - } + if (Status != AE_ALREADY_EXISTS) + { + return_ACPI_STATUS (Status); + } - /* Create and initialize an object for the new Field Node */ + REPORT_ERROR (("Field name [%4.4s] already exists in current scope\n", + &((ACPI_PARSE2_OBJECT *)Arg)->Name)); + } + else + { + Arg->Node = Info->FieldNode; + Info->FieldBitLength = Arg->Value.Size; - Info->FieldBitLength = Arg->Value.Size; + /* Create and initialize an object for the new Field Node */ - Status = AcpiExPrepFieldValue (Info); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); + Status = AcpiExPrepFieldValue (Info); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } } /* Keep track of bit position for the next field */ @@ -416,6 +442,90 @@ Info.RegionNode = RegionNode; Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Next); + + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDsInitFieldObjects + * + * PARAMETERS: Op - Op containing the Field definition and args + * ` WalkState - Current method state + * + * RETURN: Status + * + * DESCRIPTION: For each "Field Unit" name in the argument list that is + * part of the field declaration, enter the name into the + * namespace. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiDsInitFieldObjects ( + ACPI_PARSE_OBJECT *Op, + ACPI_WALK_STATE *WalkState) +{ + ACPI_STATUS Status = AE_AML_ERROR; + ACPI_PARSE_OBJECT *Arg = NULL; + ACPI_NAMESPACE_NODE *Node; + UINT8 Type = 0; + + + FUNCTION_TRACE_PTR ("DsInitFieldObjects", Op); + + + switch (WalkState->Opcode) + { + case AML_FIELD_OP: + Arg = AcpiPsGetArg (Op, 2); + Type = INTERNAL_TYPE_REGION_FIELD; + break; + + case AML_BANK_FIELD_OP: + Arg = AcpiPsGetArg (Op, 4); + Type = INTERNAL_TYPE_BANK_FIELD; + break; + + case AML_INDEX_FIELD_OP: + Arg = AcpiPsGetArg (Op, 3); + Type = INTERNAL_TYPE_INDEX_FIELD; + break; + } + + /* + * Walk the list of entries in the FieldList + */ + while (Arg) + { + /* Ignore OFFSET and ACCESSAS terms here */ + + if (Arg->Opcode == AML_INT_NAMEDFIELD_OP) + { + Status = AcpiNsLookup (WalkState->ScopeInfo, + (NATIVE_CHAR *) &((ACPI_PARSE2_OBJECT *)Arg)->Name, + Type, IMODE_LOAD_PASS1, + NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE | NS_ERROR_IF_FOUND, + NULL, &Node); + if (ACPI_FAILURE (Status)) + { + if (Status != AE_ALREADY_EXISTS) + { + return_ACPI_STATUS (Status); + } + + REPORT_ERROR (("Field name [%4.4s] already exists in current scope\n", + &((ACPI_PARSE2_OBJECT *)Arg)->Name)); + } + + Arg->Node = Node; + } + + /* Move on to next field in the list */ + + Arg = Arg->Next; + } return_ACPI_STATUS (Status); } Index: contrib/dev/acpica/dsmethod.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/dsmethod.c,v retrieving revision 1.1.1.9 diff -u -r1.1.1.9 dsmethod.c --- contrib/dev/acpica/dsmethod.c 31 Oct 2001 02:32:27 -0000 1.1.1.9 +++ contrib/dev/acpica/dsmethod.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: dsmethod - Parser/Interpreter interface - control method parsing - * $Revision: 69 $ + * $Revision: 70 $ * *****************************************************************************/ @@ -221,7 +221,7 @@ return_ACPI_STATUS (AE_NO_MEMORY); } - Status = AcpiDsInitAmlWalk (WalkState, Op, Node, ObjDesc->Method.AmlStart, + Status = AcpiDsInitAmlWalk (WalkState, Op, Node, ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength, NULL, NULL, 1); if (ACPI_FAILURE (Status)) { @@ -411,8 +411,8 @@ goto Cleanup; } - Status = AcpiDsInitAmlWalk (NextWalkState, Op, MethodNode, - ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength, + Status = AcpiDsInitAmlWalk (NextWalkState, Op, MethodNode, + ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength, NULL, NULL, 1); if (ACPI_FAILURE (Status)) { @@ -440,12 +440,12 @@ * The resolved arguments were put on the previous walk state's operand * stack. Operands on the previous walk state stack always * start at index 0. - * Null terminate the list of arguments + * Null terminate the list of arguments */ ThisWalkState->Operands [ThisWalkState->NumOperands] = NULL; - Status = AcpiDsInitAmlWalk (NextWalkState, NULL, MethodNode, - ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength, + Status = AcpiDsInitAmlWalk (NextWalkState, NULL, MethodNode, + ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength, &ThisWalkState->Operands[0], NULL, 3); if (ACPI_FAILURE (Status)) { Index: contrib/dev/acpica/dsmthdat.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/dsmthdat.c,v retrieving revision 1.1.1.8 diff -u -r1.1.1.8 dsmthdat.c --- contrib/dev/acpica/dsmthdat.c 7 Sep 2001 01:22:24 -0000 1.1.1.8 +++ contrib/dev/acpica/dsmthdat.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dsmthdat - control method arguments and local variables - * $Revision: 49 $ + * $Revision: 51 $ * ******************************************************************************/ @@ -141,6 +141,12 @@ * This allows RefOf and DeRefOf to work properly for these * special data types. * + * NOTES: WalkState fields are initialized to zero by the + * ACPI_MEM_CALLOCATE(). + * + * A pseudo-Namespace Node is assigned to each argument and local + * so that RefOf() can return a pointer to the Node. + * ******************************************************************************/ ACPI_STATUS @@ -152,13 +158,6 @@ FUNCTION_TRACE ("DsMethodDataInit"); - /* - * WalkState fields are initialized to zero by the - * ACPI_MEM_CALLOCATE(). - * - * An Node is assigned to each argument and local so - * that RefOf() can return a pointer to the Node. - */ /* Init the method arguments */ @@ -207,52 +206,38 @@ ACPI_WALK_STATE *WalkState) { UINT32 Index; - ACPI_OPERAND_OBJECT *Object; FUNCTION_TRACE ("DsMethodDataDeleteAll"); - /* Delete the locals */ - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting local variables in %p\n", WalkState)); + /* Detach the locals */ for (Index = 0; Index < MTH_NUM_LOCALS; Index++) { - Object = WalkState->LocalVariables[Index].Object; - if (Object) + if (WalkState->LocalVariables[Index].Object) { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Local%d=%p\n", Index, Object)); - - /* Remove first */ + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Local%d=%p\n", + Index, WalkState->LocalVariables[Index].Object)); - WalkState->LocalVariables[Index].Object = NULL; + /* Detach object (if present) and remove a reference */ - /* Was given a ref when stored */ - - AcpiUtRemoveReference (Object); + AcpiNsDetachObject (&WalkState->LocalVariables[Index]); } } - - /* Delete the arguments */ - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting arguments in %p\n", WalkState)); + /* Detach the arguments */ for (Index = 0; Index < MTH_NUM_ARGS; Index++) { - Object = WalkState->Arguments[Index].Object; - if (Object) + if (WalkState->Arguments[Index].Object) { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Arg%d=%p\n", Index, Object)); - - /* Remove first */ + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Arg%d=%p\n", + Index, WalkState->Arguments[Index].Object)); - WalkState->Arguments[Index].Object = NULL; + /* Detach object (if present) and remove a reference */ - /* Was given a ref when stored */ - - AcpiUtRemoveReference (Object); + AcpiNsDetachObject (&WalkState->Arguments[Index]); } } @@ -270,7 +255,9 @@ * * RETURN: Status * - * DESCRIPTION: Initialize arguments for a method + * DESCRIPTION: Initialize arguments for a method. The parameter list is a list + * of ACPI operand objects, either null terminated or whose length + * is defined by MaxParamCount. * ******************************************************************************/ @@ -281,8 +268,7 @@ ACPI_WALK_STATE *WalkState) { ACPI_STATUS Status; - UINT32 Mindex; - UINT32 Pindex; + UINT32 Index = 0; FUNCTION_TRACE_PTR ("DsMethodDataInitArgs", Params); @@ -296,85 +282,68 @@ /* Copy passed parameters into the new method stack frame */ - for (Pindex = Mindex = 0; - (Mindex < MTH_NUM_ARGS) && (Pindex < MaxParamCount); - Mindex++) + while ((Index < MTH_NUM_ARGS) && (Index < MaxParamCount) && Params[Index]) { - if (Params[Pindex]) + /* + * A valid parameter. + * Store the argument in the method/walk descriptor + */ + Status = AcpiDsStoreObjectToLocal (AML_ARG_OP, Index, Params[Index], + WalkState); + if (ACPI_FAILURE (Status)) { - /* - * A valid parameter. - * Set the current method argument to the - * Params[Pindex++] argument object descriptor - */ - Status = AcpiDsStoreObjectToLocal (AML_ARG_OP, Mindex, - Params[Pindex], WalkState); - if (ACPI_FAILURE (Status)) - { - break; - } - - Pindex++; + return_ACPI_STATUS (Status); } - else - { - break; - } + Index++; } - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%d args passed to method\n", Pindex)); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%d args passed to method\n", Index)); return_ACPI_STATUS (AE_OK); } /******************************************************************************* * - * FUNCTION: AcpiDsMethodDataGetEntry + * FUNCTION: AcpiDsMethodDataGetNode * * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP - * Index - Which localVar or argument to get - * Entry - Pointer to where a pointer to the stack - * entry is returned. + * Index - Which localVar or argument whose type + * to get * WalkState - Current walk state object * - * RETURN: Status - * - * DESCRIPTION: Get the address of the object entry given by Opcode:Index + * RETURN: Get the Node associated with a local or arg. * ******************************************************************************/ ACPI_STATUS -AcpiDsMethodDataGetEntry ( +AcpiDsMethodDataGetNode ( UINT16 Opcode, UINT32 Index, ACPI_WALK_STATE *WalkState, - ACPI_OPERAND_OBJECT ***Entry) + ACPI_NAMESPACE_NODE **Node) { - - FUNCTION_TRACE_U32 ("DsMethodDataGetEntry", Index); + FUNCTION_TRACE ("DsMethodDataGetNode"); /* - * Get the requested object. - * The stack "Opcode" is either a LocalVariable or an Argument + * Method Locals and Arguments are supported */ switch (Opcode) { - case AML_LOCAL_OP: if (Index > MTH_MAX_LOCAL) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "LocalVar index %d is invalid (max %d)\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Local index %d is invalid (max %d)\n", Index, MTH_MAX_LOCAL)); - return_ACPI_STATUS (AE_BAD_PARAMETER); + return_ACPI_STATUS (AE_AML_INVALID_INDEX); } - *Entry = (ACPI_OPERAND_OBJECT **) - &WalkState->LocalVariables[Index].Object; - break; + /* Return a pointer to the pseudo-node */ + *Node = &WalkState->LocalVariables[Index]; + break; case AML_ARG_OP: @@ -382,27 +351,27 @@ { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Arg index %d is invalid (max %d)\n", Index, MTH_MAX_ARG)); - return_ACPI_STATUS (AE_BAD_PARAMETER); + return_ACPI_STATUS (AE_AML_INVALID_INDEX); } - *Entry = (ACPI_OPERAND_OBJECT **) - &WalkState->Arguments[Index].Object; - break; + /* Return a pointer to the pseudo-node */ + *Node = &WalkState->Arguments[Index]; + break; default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Opcode %d is invalid\n", Opcode)); - return_ACPI_STATUS (AE_BAD_PARAMETER); + return_ACPI_STATUS (AE_AML_BAD_OPCODE); + break; } - return_ACPI_STATUS (AE_OK); } /******************************************************************************* * - * FUNCTION: AcpiDsMethodDataSetEntry + * FUNCTION: AcpiDsMethodDataSetValue * * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP * Index - Which localVar or argument to get @@ -416,22 +385,22 @@ ******************************************************************************/ ACPI_STATUS -AcpiDsMethodDataSetEntry ( +AcpiDsMethodDataSetValue ( UINT16 Opcode, UINT32 Index, ACPI_OPERAND_OBJECT *Object, ACPI_WALK_STATE *WalkState) { ACPI_STATUS Status; - ACPI_OPERAND_OBJECT **Entry; + ACPI_NAMESPACE_NODE *Node; - FUNCTION_TRACE ("DsMethodDataSetEntry"); + FUNCTION_TRACE ("DsMethodDataSetValue"); - /* Get a pointer to the stack entry to set */ + /* Get the namespace node for the arg/local */ - Status = AcpiDsMethodDataGetEntry (Opcode, Index, WalkState, &Entry); + Status = AcpiDsMethodDataGetNode (Opcode, Index, WalkState, &Node); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -443,8 +412,7 @@ /* Install the object into the stack entry */ - *Entry = Object; - + Node->Object = Object; return_ACPI_STATUS (AE_OK); } @@ -458,8 +426,7 @@ * to get * WalkState - Current walk state object * - * RETURN: Data type of selected Arg or Local - * Used only in ExecMonadic2()/TypeOp. + * RETURN: Data type of current value of the selected Arg or Local * ******************************************************************************/ @@ -470,98 +437,34 @@ ACPI_WALK_STATE *WalkState) { ACPI_STATUS Status; - ACPI_OPERAND_OBJECT **Entry; + ACPI_NAMESPACE_NODE *Node; ACPI_OPERAND_OBJECT *Object; FUNCTION_TRACE ("DsMethodDataGetType"); - /* Get a pointer to the requested stack entry */ + /* Get the namespace node for the arg/local */ - Status = AcpiDsMethodDataGetEntry (Opcode, Index, WalkState, &Entry); + Status = AcpiDsMethodDataGetNode (Opcode, Index, WalkState, &Node); if (ACPI_FAILURE (Status)) { return_VALUE ((ACPI_TYPE_NOT_FOUND)); } - /* Get the object from the method stack */ - - Object = *Entry; - - /* Get the object type */ + /* Get the object */ + Object = Node->Object; if (!Object) { - /* Any == 0 => "uninitialized" -- see spec 15.2.3.5.2.28 */ - return_VALUE (ACPI_TYPE_ANY); - } - - return_VALUE (Object->Common.Type); -} + /* Uninitialized local/arg, return TYPE_ANY */ - -/******************************************************************************* - * - * FUNCTION: AcpiDsMethodDataGetNode - * - * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP - * Index - Which localVar or argument whose type - * to get - * WalkState - Current walk state object - * - * RETURN: Get the Node associated with a local or arg. - * - ******************************************************************************/ - -ACPI_NAMESPACE_NODE * -AcpiDsMethodDataGetNode ( - UINT16 Opcode, - UINT32 Index, - ACPI_WALK_STATE *WalkState) -{ - ACPI_NAMESPACE_NODE *Node = NULL; - - - FUNCTION_TRACE ("DsMethodDataGetNode"); - - - switch (Opcode) - { - - case AML_LOCAL_OP: - - if (Index > MTH_MAX_LOCAL) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Local index %d is invalid (max %d)\n", - Index, MTH_MAX_LOCAL)); - return_PTR (Node); - } - - Node = &WalkState->LocalVariables[Index]; - break; - - - case AML_ARG_OP: - - if (Index > MTH_MAX_ARG) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Arg index %d is invalid (max %d)\n", - Index, MTH_MAX_ARG)); - return_PTR (Node); - } - - Node = &WalkState->Arguments[Index]; - break; - - - default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Opcode %d is invalid\n", Opcode)); - break; + return_VALUE (ACPI_TYPE_ANY); } + /* Get the object type */ - return_PTR (Node); + return_VALUE (Object->Common.Type); } @@ -591,7 +494,7 @@ ACPI_OPERAND_OBJECT **DestDesc) { ACPI_STATUS Status; - ACPI_OPERAND_OBJECT **Entry; + ACPI_NAMESPACE_NODE *Node; ACPI_OPERAND_OBJECT *Object; @@ -606,26 +509,24 @@ return_ACPI_STATUS (AE_BAD_PARAMETER); } + /* Get the namespace node for the arg/local */ - /* Get a pointer to the requested method stack entry */ - - Status = AcpiDsMethodDataGetEntry (Opcode, Index, WalkState, &Entry); + Status = AcpiDsMethodDataGetNode (Opcode, Index, WalkState, &Node); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } - /* Get the object from the method stack */ - - Object = *Entry; + /* Get the object from the node */ + Object = Node->Object; /* Examine the returned object, it must be valid. */ if (!Object) { /* - * Index points to uninitialized object stack value. + * Index points to uninitialized object. * This means that either 1) The expected argument was * not passed to the method, or 2) A local variable * was referenced by the method (via the ASL) @@ -635,25 +536,24 @@ { case AML_ARG_OP: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Uninitialized Arg[%d] at entry %p\n", - Index, Entry)); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Uninitialized Arg[%d] at node %p\n", + Index, Node)); return_ACPI_STATUS (AE_AML_UNINITIALIZED_ARG); break; case AML_LOCAL_OP: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Uninitialized Local[%d] at entry %p\n", - Index, Entry)); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Uninitialized Local[%d] at node %p\n", + Index, Node)); return_ACPI_STATUS (AE_AML_UNINITIALIZED_LOCAL); break; } } - /* - * Index points to initialized and valid object stack value. + * The Index points to an initialized and valid object. * Return an additional reference to the object */ *DestDesc = Object; @@ -685,39 +585,39 @@ ACPI_WALK_STATE *WalkState) { ACPI_STATUS Status; - ACPI_OPERAND_OBJECT **Entry; + ACPI_NAMESPACE_NODE *Node; ACPI_OPERAND_OBJECT *Object; FUNCTION_TRACE ("DsMethodDataDeleteValue"); - /* Get a pointer to the requested entry */ + /* Get the namespace node for the arg/local */ - Status = AcpiDsMethodDataGetEntry (Opcode, Index, WalkState, &Entry); + Status = AcpiDsMethodDataGetNode (Opcode, Index, WalkState, &Node); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } - /* Get the current entry in this slot k */ + /* Get the associated object */ - Object = *Entry; + Object = Node->Object; /* * Undefine the Arg or Local by setting its descriptor * pointer to NULL. Locals/Args can contain both * ACPI_OPERAND_OBJECTS and ACPI_NAMESPACE_NODEs */ - *Entry = NULL; + Node->Object = NULL; if ((Object) && (VALID_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_INTERNAL))) { /* - * There is a valid object in this slot + * There is a valid object. * Decrement the reference count by one to balance the - * increment when the object was stored in the slot. + * increment when the object was stored. */ AcpiUtRemoveReference (Object); } @@ -732,14 +632,14 @@ * * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP * Index - Which localVar or argument to set - * SrcDesc - Value to be stored + * ObjDesc - Value to be stored * WalkState - Current walk state * * RETURN: Status * - * DESCRIPTION: Store a value in an Arg or Local. The SrcDesc is installed + * DESCRIPTION: Store a value in an Arg or Local. The ObjDesc is installed * as the new value for the Arg or Local and the reference count - * for SrcDesc is incremented. + * for ObjDesc is incremented. * ******************************************************************************/ @@ -747,48 +647,46 @@ AcpiDsStoreObjectToLocal ( UINT16 Opcode, UINT32 Index, - ACPI_OPERAND_OBJECT *SrcDesc, + ACPI_OPERAND_OBJECT *ObjDesc, ACPI_WALK_STATE *WalkState) { ACPI_STATUS Status; - ACPI_OPERAND_OBJECT **Entry; + ACPI_NAMESPACE_NODE *Node; - FUNCTION_TRACE ("DsMethodDataSetValue"); + FUNCTION_TRACE ("DsStoreObjectToLocal"); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode=%d Idx=%d Obj=%p\n", - Opcode, Index, SrcDesc)); + Opcode, Index, ObjDesc)); /* Parameter validation */ - if (!SrcDesc) + if (!ObjDesc) { return_ACPI_STATUS (AE_BAD_PARAMETER); } + /* Get the namespace node for the arg/local */ - /* Get a pointer to the requested method stack entry */ - - Status = AcpiDsMethodDataGetEntry (Opcode, Index, WalkState, &Entry); + Status = AcpiDsMethodDataGetNode (Opcode, Index, WalkState, &Node); if (ACPI_FAILURE (Status)) { - goto Cleanup; + return_ACPI_STATUS (Status); } - if (*Entry == SrcDesc) + if (Node->Object == ObjDesc) { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p already installed!\n", SrcDesc)); - goto Cleanup; + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p already installed!\n", ObjDesc)); + return_ACPI_STATUS (Status); } - /* * If there is an object already in this slot, we either * have to delete it, or if this is an argument and there * is an object reference stored there, we have to do * an indirect store! */ - if (*Entry) + if (Node->Object) { /* * Check for an indirect store if an argument @@ -807,38 +705,24 @@ * Weird, but true. */ if ((Opcode == AML_ARG_OP) && - (VALID_DESCRIPTOR_TYPE (*Entry, ACPI_DESC_TYPE_NAMED))) + (VALID_DESCRIPTOR_TYPE (Node->Object, ACPI_DESC_TYPE_NAMED))) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Arg (%p) is an ObjRef(Node), storing in %p\n", - SrcDesc, *Entry)); + ObjDesc, Node->Object)); /* Detach an existing object from the Node */ - AcpiNsDetachObject ((ACPI_NAMESPACE_NODE *) *Entry); + AcpiNsDetachObject (Node); /* * Store this object into the Node - * (do the indirect store) + * (perform the indirect store) */ - Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) *Entry, SrcDesc, - SrcDesc->Common.Type); + Status = AcpiNsAttachObject (Node, ObjDesc, ObjDesc->Common.Type); return_ACPI_STATUS (Status); } - -#ifdef ACPI_ENABLE_IMPLICIT_CONVERSION - /* - * Perform "Implicit conversion" of the new object to the type of the - * existing object - */ - Status = AcpiExConvertToTargetType ((*Entry)->Common.Type, &SrcDesc, WalkState); - if (ACPI_FAILURE (Status)) - { - goto Cleanup; - } -#endif - /* * Delete the existing object * before storing the new one @@ -846,28 +730,14 @@ AcpiDsMethodDataDeleteValue (Opcode, Index, WalkState); } - /* - * Install the ObjStack descriptor (*SrcDesc) into + * Install the ObjStack descriptor (*ObjDesc) into * the descriptor for the Arg or Local. * Install the new object in the stack entry * (increments the object reference count by one) */ - Status = AcpiDsMethodDataSetEntry (Opcode, Index, SrcDesc, WalkState); - if (ACPI_FAILURE (Status)) - { - goto Cleanup; - } - - /* Normal exit */ - - return_ACPI_STATUS (AE_OK); - - - /* Error exit */ - -Cleanup: - + Status = AcpiDsMethodDataSetValue (Opcode, Index, ObjDesc, WalkState); return_ACPI_STATUS (Status); } + Index: contrib/dev/acpica/dsobject.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/dsobject.c,v retrieving revision 1.1.1.12 diff -u -r1.1.1.12 dsobject.c --- contrib/dev/acpica/dsobject.c 31 Oct 2001 02:32:27 -0000 1.1.1.12 +++ contrib/dev/acpica/dsobject.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: dsobject - Dispatcher object management routines - * $Revision: 81 $ + * $Revision: 84 $ * *****************************************************************************/ @@ -352,6 +352,8 @@ { case ACPI_TYPE_BUFFER: + ObjDesc->Buffer.Node = (ACPI_NAMESPACE_NODE *) WalkState->Operands[0]; + /* First arg is a number */ AcpiDsCreateOperand (WalkState, Op->Value.Arg, 0); @@ -448,11 +450,11 @@ ObjDesc->String.Pointer = Op->Value.String; ObjDesc->String.Length = STRLEN (Op->Value.String); - /* + /* * The string is contained in the ACPI table, don't ever try * to delete it */ - ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER; + ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER; break; @@ -531,7 +533,6 @@ ACPI_OPERAND_OBJECT **ObjDescPtr) { ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_OBJECT_TYPE8 Type; ACPI_STATUS Status; UINT32 Length; char *Name; @@ -543,17 +544,15 @@ if (Op->Opcode == AML_INT_NAMEPATH_OP) { /* - * This is an object reference. If The name was - * previously looked up in the NS, it is stored in this op. + * This is an object reference. If this name was + * previously looked up in the namespace, it was stored in this op. * Otherwise, go ahead and look it up now */ if (!Op->Node) { - Status = AcpiNsLookup (WalkState->ScopeInfo, - Op->Value.String, ACPI_TYPE_ANY, - IMODE_EXECUTE, - NS_SEARCH_PARENT | NS_DONT_OPEN_SCOPE, - NULL, + Status = AcpiNsLookup (WalkState->ScopeInfo, Op->Value.String, + ACPI_TYPE_ANY, IMODE_EXECUTE, + NS_SEARCH_PARENT | NS_DONT_OPEN_SCOPE, NULL, (ACPI_NAMESPACE_NODE **)&(Op->Node)); if (ACPI_FAILURE (Status)) @@ -585,24 +584,11 @@ } } } - - /* - * The reference will be a Reference - * TBD: [Restructure] unless we really need a separate - * type of INTERNAL_TYPE_REFERENCE change - * AcpiDsMapOpcodeToDataType to handle this case - */ - Type = INTERNAL_TYPE_REFERENCE; - } - else - { - Type = AcpiDsMapOpcodeToDataType (Op->Opcode, NULL); } - /* Create and init the internal ACPI object */ - ObjDesc = AcpiUtCreateInternalObject (Type); + ObjDesc = AcpiUtCreateInternalObject ((AcpiPsGetOpcodeInfo (Op->Opcode))->ObjectType); if (!ObjDesc) { return_ACPI_STATUS (AE_NO_MEMORY); Index: contrib/dev/acpica/dsopcode.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/dsopcode.c,v retrieving revision 1.1.1.12 diff -u -r1.1.1.12 dsopcode.c --- contrib/dev/acpica/dsopcode.c 31 Oct 2001 02:32:27 -0000 1.1.1.12 +++ contrib/dev/acpica/dsopcode.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ * * Module Name: dsopcode - Dispatcher Op Region support and handling of * "control" opcodes - * $Revision: 56 $ + * $Revision: 61 $ * *****************************************************************************/ @@ -177,12 +177,12 @@ /* * Allocate a new parser op to be the root of the parsed - * OpRegion tree + * BufferField tree */ Op = AcpiPsAllocOp (AML_SCOPE_OP); if (!Op) { - return (AE_NO_MEMORY); + return_ACPI_STATUS (AE_NO_MEMORY); } /* Save the Node for use in AcpiPsParseAml */ @@ -206,7 +206,7 @@ return_ACPI_STATUS (AE_NO_MEMORY); } - Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, ExtraDesc->Extra.AmlStart, + Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, ExtraDesc->Extra.AmlStart, ExtraDesc->Extra.AmlLength, NULL, NULL, 1); if (ACPI_FAILURE (Status)) { @@ -237,12 +237,12 @@ FieldOp->Node = Node; AcpiPsDeleteParseTree (Op); - /* Evaluate the address and length arguments for the OpRegion */ + /* Evaluate the address and length arguments for the Buffer Field */ Op = AcpiPsAllocOp (AML_SCOPE_OP); if (!Op) { - return (AE_NO_MEMORY); + return_ACPI_STATUS (AE_NO_MEMORY); } Op->Node = AcpiNsGetParentObject (Node); @@ -330,7 +330,7 @@ Op = AcpiPsAllocOp (AML_SCOPE_OP); if (!Op) { - return (AE_NO_MEMORY); + return_ACPI_STATUS (AE_NO_MEMORY); } /* Save the Node for use in AcpiPsParseAml */ @@ -354,7 +354,7 @@ return_ACPI_STATUS (AE_NO_MEMORY); } - Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, ExtraDesc->Extra.AmlStart, + Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, ExtraDesc->Extra.AmlStart, ExtraDesc->Extra.AmlLength, NULL, NULL, 1); if (ACPI_FAILURE (Status)) { @@ -380,7 +380,6 @@ RegionOp = Op->Value.Arg; Op->Node = Node; - RegionOp = Op->Value.Arg; RegionOp->Node = Node; AcpiPsDeleteParseTree (Op); @@ -390,7 +389,7 @@ Op = AcpiPsAllocOp (AML_SCOPE_OP); if (!Op) { - return (AE_NO_MEMORY); + return_ACPI_STATUS (AE_NO_MEMORY); } Op->Node = AcpiNsGetParentObject (Node); @@ -415,6 +414,7 @@ Status = AcpiPsParseAml (WalkState); AcpiPsDeleteParseTree (Op); + return_ACPI_STATUS (Status); } @@ -460,21 +460,6 @@ * DESCRIPTION: Get BufferField Buffer and Index * Called from AcpiDsExecEndOp during BufferField parse tree walk * - * ACPI SPECIFICATION REFERENCES: - * Each of the Buffer Field opcodes is defined as specified in in-line - * comments below. For each one, use the following definitions. - * - * DefBitField := BitFieldOp SrcBuf BitIdx Destination - * DefByteField := ByteFieldOp SrcBuf ByteIdx Destination - * DefCreateField := CreateFieldOp SrcBuf BitIdx NumBits NameString - * DefDWordField := DWordFieldOp SrcBuf ByteIdx Destination - * DefWordField := WordFieldOp SrcBuf ByteIdx Destination - * BitIndex := TermArg=>Integer - * ByteIndex := TermArg=>Integer - * Destination := NameString - * NumBits := TermArg=>Integer - * SourceBuf := TermArg=>Buffer - * ****************************************************************************/ ACPI_STATUS @@ -523,7 +508,6 @@ return_ACPI_STATUS (AE_NOT_EXIST); } - /* Resolve the operands */ Status = AcpiExResolveOperands (Op->Opcode, WALK_OPERANDS, WalkState); @@ -552,10 +536,7 @@ OffDesc = WalkState->Operands[1]; SrcDesc = WalkState->Operands[0]; - - - - Offset = (UINT32) OffDesc->Integer.Value; + Offset = (UINT32) OffDesc->Integer.Value; /* * If ResDesc is a Name, it will be a direct name pointer after @@ -576,8 +557,6 @@ switch (Op->Opcode) { - /* DefCreateField */ - case AML_CREATE_FIELD_OP: /* Offset is in bits, count is in bits */ @@ -587,9 +566,6 @@ FieldFlags = ACCESS_BYTE_ACC; break; - - /* DefCreateBitField */ - case AML_CREATE_BIT_FIELD_OP: /* Offset is in bits, Field is one bit */ @@ -599,9 +575,6 @@ FieldFlags = ACCESS_BYTE_ACC; break; - - /* DefCreateByteField */ - case AML_CREATE_BYTE_FIELD_OP: /* Offset is in bytes, field is one byte */ @@ -611,9 +584,6 @@ FieldFlags = ACCESS_BYTE_ACC; break; - - /* DefCreateWordField */ - case AML_CREATE_WORD_FIELD_OP: /* Offset is in bytes, field is one word */ @@ -623,9 +593,6 @@ FieldFlags = ACCESS_WORD_ACC; break; - - /* DefCreateDWordField */ - case AML_CREATE_DWORD_FIELD_OP: /* Offset is in bytes, field is one dword */ @@ -635,9 +602,6 @@ FieldFlags = ACCESS_DWORD_ACC; break; - - /* DefCreateQWordField */ - case AML_CREATE_QWORD_FIELD_OP: /* Offset is in bytes, field is one qword */ @@ -647,7 +611,6 @@ FieldFlags = ACCESS_QWORD_ACC; break; - default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, @@ -657,7 +620,6 @@ goto Cleanup; } - /* * Setup field according to the object type */ @@ -678,7 +640,6 @@ goto Cleanup; } - /* * Initialize areas of the field object that are common to all fields * For FieldFlags, use LOCK_RULE = 0 (NO_LOCK), UPDATE_RULE = 0 (UPDATE_PRESERVE) @@ -696,7 +657,6 @@ SrcDesc->Common.ReferenceCount = (UINT16) (SrcDesc->Common.ReferenceCount + ObjDesc->Common.ReferenceCount); - break; @@ -919,7 +879,6 @@ /*AcpiPsPkgLengthEncodingSize (GET8 (WalkState->ParserState->Aml));*/ break; - case AML_ELSE_OP: /* Predicate is in the state object */ @@ -932,12 +891,10 @@ break; - case AML_RETURN_OP: break; - default: break; } @@ -958,7 +915,6 @@ * DESCRIPTION: Handles all control ops encountered during control method * execution. * - * ******************************************************************************/ ACPI_STATUS @@ -1077,11 +1033,11 @@ ((WalkState->Results->Results.ObjDesc [0])->Common.Type == INTERNAL_TYPE_REFERENCE) && ((WalkState->Results->Results.ObjDesc [0])->Reference.Opcode != AML_INDEX_OP)) { - Status = AcpiExResolveToValue (&WalkState->Results->Results.ObjDesc [0], WalkState); - if (ACPI_FAILURE (Status)) - { - return (Status); - } + Status = AcpiExResolveToValue (&WalkState->Results->Results.ObjDesc [0], WalkState); + if (ACPI_FAILURE (Status)) + { + return (Status); + } } WalkState->ReturnDesc = WalkState->Results->Results.ObjDesc [0]; @@ -1165,7 +1121,6 @@ Status = AE_AML_BAD_OPCODE; break; } - return (Status); } Index: contrib/dev/acpica/dsutils.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/dsutils.c,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 dsutils.c --- contrib/dev/acpica/dsutils.c 31 Oct 2001 02:32:27 -0000 1.1.1.11 +++ contrib/dev/acpica/dsutils.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dsutils - Dispatcher utilities - * $Revision: 80 $ + * $Revision: 83 $ * ******************************************************************************/ @@ -161,7 +161,6 @@ return_VALUE (TRUE); } - /* * If there is no parent, the result can't possibly be used! * (An executing method typically has no parent, since each @@ -173,11 +172,9 @@ return_VALUE (FALSE); } - /* * Get info on the parent. The root Op is AML_SCOPE */ - ParentInfo = AcpiPsGetOpcodeInfo (Op->Parent->Opcode); if (ParentInfo->Class == AML_CLASS_UNKNOWN) { @@ -185,7 +182,6 @@ return_VALUE (FALSE); } - /* * Decide what to do with the result based on the parent. If * the parent opcode will not use the result, delete the object. @@ -194,10 +190,7 @@ */ switch (ParentInfo->Class) { - /* - * In these cases, the parent will never use the return object - */ - case AML_CLASS_CONTROL: /* IF, ELSE, WHILE only */ + case AML_CLASS_CONTROL: switch (Op->Parent->Opcode) { @@ -205,9 +198,7 @@ /* Never delete the return value associated with a return opcode */ - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "Result used, [RETURN] opcode=%X Op=%p\n", Op->Opcode, Op)); - return_VALUE (TRUE); + goto ResultUsed; break; case AML_IF_OP: @@ -215,60 +206,72 @@ /* * If we are executing the predicate AND this is the predicate op, - * we will use the return value! + * we will use the return value */ if ((WalkState->ControlState->Common.State == CONTROL_PREDICATE_EXECUTING) && (WalkState->ControlState->Control.PredicateOp == Op)) { - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "Result used as a predicate, [IF/WHILE] opcode=%X Op=%p\n", - Op->Opcode, Op)); - return_VALUE (TRUE); + goto ResultUsed; } - - break; } + /* The general control opcode returns no result */ - /* Fall through to not used case below */ + goto ResultNotUsed; + break; - case AML_CLASS_NAMED_OBJECT: /* Scope, method, etc. */ case AML_CLASS_CREATE: /* * These opcodes allow TermArg(s) as operands and therefore - * method calls. The result is used. + * the operands can be method calls. The result is used. */ - if ((Op->Parent->Opcode == AML_REGION_OP) || - (Op->Parent->Opcode == AML_CREATE_FIELD_OP) || - (Op->Parent->Opcode == AML_CREATE_BIT_FIELD_OP) || - (Op->Parent->Opcode == AML_CREATE_BYTE_FIELD_OP) || - (Op->Parent->Opcode == AML_CREATE_WORD_FIELD_OP) || - (Op->Parent->Opcode == AML_CREATE_DWORD_FIELD_OP) || - (Op->Parent->Opcode == AML_CREATE_QWORD_FIELD_OP)) + goto ResultUsed; + break; + + + case AML_CLASS_NAMED_OBJECT: + + if ((Op->Parent->Opcode == AML_REGION_OP) || + (Op->Parent->Opcode == AML_DATA_REGION_OP)) { - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "Result used, [Region or CreateField] opcode=%X Op=%p\n", - Op->Opcode, Op)); - return_VALUE (TRUE); + /* + * These opcodes allow TermArg(s) as operands and therefore + * the operands can be method calls. The result is used. + */ + goto ResultUsed; } - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "Result not used, Parent opcode=%X Op=%p\n", Op->Opcode, Op)); - - return_VALUE (FALSE); + goto ResultNotUsed; break; + /* * In all other cases. the parent will actually use the return * object, so keep it. */ default: + goto ResultUsed; break; } + +ResultUsed: + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Result of [%s] used by Parent [%s] Op=%p\n", + AcpiPsGetOpcodeName (Op->Opcode), + AcpiPsGetOpcodeName (Op->Parent->Opcode), Op)); + return_VALUE (TRUE); + + +ResultNotUsed: + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Result of [%s] not used by Parent [%s] Op=%p\n", + AcpiPsGetOpcodeName (Op->Opcode), + AcpiPsGetOpcodeName (Op->Parent->Opcode), Op)); + + return_VALUE (FALSE); + } @@ -355,11 +358,9 @@ ACPI_STATUS Status = AE_OK; NATIVE_CHAR *NameString; UINT32 NameLength; - ACPI_OBJECT_TYPE8 DataType; ACPI_OPERAND_OBJECT *ObjDesc; ACPI_PARSE_OBJECT *ParentOp; UINT16 Opcode; - UINT32 Flags; OPERATING_MODE InterpreterMode; const ACPI_OPCODE_INFO *OpInfo; @@ -452,7 +453,7 @@ /* TBD: Externalize NameString and print */ - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Object name was not found in namespace\n")); } } @@ -490,7 +491,6 @@ Opcode = AML_ZERO_OP; /* Has no arguments! */ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Null namepath: Arg=%p\n", Arg)); - /* * TBD: [Investigate] anything else needed for the * zero op lvalue? @@ -502,16 +502,15 @@ Opcode = Arg->Opcode; } + /* Get the object type of the argument */ - /* Get the data type of the argument */ - - DataType = AcpiDsMapOpcodeToDataType (Opcode, &Flags); - if (DataType == INTERNAL_TYPE_INVALID) + OpInfo = AcpiPsGetOpcodeInfo (Opcode); + if (OpInfo->ObjectType == INTERNAL_TYPE_INVALID) { return_ACPI_STATUS (AE_NOT_IMPLEMENTED); } - if (Flags & OP_HAS_RETURN_VALUE) + if (OpInfo->Flags & AML_HAS_RETVAL) { ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Argument previously created, already stacked \n")); @@ -533,14 +532,13 @@ AcpiFormatException (Status))); return_ACPI_STATUS (Status); } - } else { /* Create an ACPI_INTERNAL_OBJECT for the argument */ - ObjDesc = AcpiUtCreateInternalObject (DataType); + ObjDesc = AcpiUtCreateInternalObject (OpInfo->ObjectType); if (!ObjDesc) { return_ACPI_STATUS (AE_NO_MEMORY); @@ -681,270 +679,4 @@ return_ACPI_STATUS (Status); } - - -/******************************************************************************* - * - * FUNCTION: AcpiDsMapOpcodeToDataType - * - * PARAMETERS: Opcode - AML opcode to map - * OutFlags - Additional info about the opcode - * - * RETURN: The ACPI type associated with the opcode - * - * DESCRIPTION: Convert a raw AML opcode to the associated ACPI data type, - * if any. If the opcode returns a value as part of the - * intepreter execution, a flag is returned in OutFlags. - * - ******************************************************************************/ - -ACPI_OBJECT_TYPE8 -AcpiDsMapOpcodeToDataType ( - UINT16 Opcode, - UINT32 *OutFlags) -{ - ACPI_OBJECT_TYPE8 DataType = INTERNAL_TYPE_INVALID; - const ACPI_OPCODE_INFO *OpInfo; - UINT32 Flags = 0; - - - PROC_NAME ("DsMapOpcodeToDataType"); - - - OpInfo = AcpiPsGetOpcodeInfo (Opcode); - if (OpInfo->Class == AML_CLASS_UNKNOWN) - { - /* Unknown opcode */ - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown AML opcode: %x\n", Opcode)); - return (DataType); - } - - -/* - * TBD: Use op class - */ - - switch (OpInfo->Type) - { - - case AML_TYPE_LITERAL: - - switch (Opcode) - { - case AML_BYTE_OP: - case AML_WORD_OP: - case AML_DWORD_OP: - case AML_QWORD_OP: - - DataType = ACPI_TYPE_INTEGER; - break; - - - case AML_STRING_OP: - - DataType = ACPI_TYPE_STRING; - break; - - case AML_INT_NAMEPATH_OP: - DataType = INTERNAL_TYPE_REFERENCE; - break; - - default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Unknown (type LITERAL) AML opcode: %x\n", Opcode)); - break; - } - break; - - - case AML_TYPE_DATA_TERM: - - switch (Opcode) - { - case AML_BUFFER_OP: - - DataType = ACPI_TYPE_BUFFER; - break; - - case AML_PACKAGE_OP: - case AML_VAR_PACKAGE_OP: - - DataType = ACPI_TYPE_PACKAGE; - break; - - default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Unknown (type DATA_TERM) AML opcode: %x\n", Opcode)); - break; - } - break; - - - case AML_TYPE_CONSTANT: - case AML_TYPE_METHOD_ARGUMENT: - case AML_TYPE_LOCAL_VARIABLE: - - DataType = INTERNAL_TYPE_REFERENCE; - break; - - - case AML_TYPE_EXEC_1A_0T_1R: - case AML_TYPE_EXEC_1A_1T_1R: - case AML_TYPE_EXEC_2A_0T_1R: - case AML_TYPE_EXEC_2A_1T_1R: - case AML_TYPE_EXEC_2A_2T_1R: - case AML_TYPE_EXEC_3A_1T_1R: - case AML_TYPE_EXEC_6A_0T_1R: - case AML_TYPE_RETURN: - - Flags = OP_HAS_RETURN_VALUE; - DataType = ACPI_TYPE_ANY; - break; - - - case AML_TYPE_METHOD_CALL: - - Flags = OP_HAS_RETURN_VALUE; - DataType = ACPI_TYPE_METHOD; - break; - - - case AML_TYPE_NAMED_FIELD: - case AML_TYPE_NAMED_SIMPLE: - case AML_TYPE_NAMED_COMPLEX: - case AML_TYPE_NAMED_NO_OBJ: - - DataType = AcpiDsMapNamedOpcodeToDataType (Opcode); - break; - - - case AML_TYPE_EXEC_1A_0T_0R: - case AML_TYPE_EXEC_2A_0T_0R: - case AML_TYPE_EXEC_3A_0T_0R: - case AML_TYPE_EXEC_1A_1T_0R: - case AML_TYPE_CONTROL: - - /* No mapping needed at this time */ - - break; - - - default: - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Unimplemented data type opcode: %x\n", Opcode)); - break; - } - - /* Return flags to caller if requested */ - - if (OutFlags) - { - *OutFlags = Flags; - } - - return (DataType); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDsMapNamedOpcodeToDataType - * - * PARAMETERS: Opcode - The Named AML opcode to map - * - * RETURN: The ACPI type associated with the named opcode - * - * DESCRIPTION: Convert a raw Named AML opcode to the associated data type. - * Named opcodes are a subsystem of the AML opcodes. - * - ******************************************************************************/ - -ACPI_OBJECT_TYPE8 -AcpiDsMapNamedOpcodeToDataType ( - UINT16 Opcode) -{ - ACPI_OBJECT_TYPE8 DataType; - - - FUNCTION_ENTRY (); - - - /* Decode Opcode */ - - switch (Opcode) - { - case AML_SCOPE_OP: - DataType = INTERNAL_TYPE_SCOPE; - break; - - case AML_DEVICE_OP: - DataType = ACPI_TYPE_DEVICE; - break; - - case AML_THERMAL_ZONE_OP: - DataType = ACPI_TYPE_THERMAL; - break; - - case AML_METHOD_OP: - DataType = ACPI_TYPE_METHOD; - break; - - case AML_POWER_RES_OP: - DataType = ACPI_TYPE_POWER; - break; - - case AML_PROCESSOR_OP: - DataType = ACPI_TYPE_PROCESSOR; - break; - - case AML_FIELD_OP: /* FieldOp */ - DataType = INTERNAL_TYPE_FIELD_DEFN; - break; - - case AML_INDEX_FIELD_OP: /* IndexFieldOp */ - DataType = INTERNAL_TYPE_INDEX_FIELD_DEFN; - break; - - case AML_BANK_FIELD_OP: /* BankFieldOp */ - DataType = INTERNAL_TYPE_BANK_FIELD_DEFN; - break; - - case AML_INT_NAMEDFIELD_OP: /* NO CASE IN ORIGINAL */ - DataType = ACPI_TYPE_ANY; - break; - - case AML_NAME_OP: /* NameOp - special code in original */ - case AML_INT_NAMEPATH_OP: - DataType = ACPI_TYPE_ANY; - break; - - case AML_ALIAS_OP: - DataType = INTERNAL_TYPE_ALIAS; - break; - - case AML_MUTEX_OP: - DataType = ACPI_TYPE_MUTEX; - break; - - case AML_EVENT_OP: - DataType = ACPI_TYPE_EVENT; - break; - - case AML_DATA_REGION_OP: - case AML_REGION_OP: - DataType = ACPI_TYPE_REGION; - break; - - - default: - DataType = ACPI_TYPE_ANY; - break; - - } - - return (DataType); -} - Index: contrib/dev/acpica/dswexec.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/dswexec.c,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 dswexec.c --- contrib/dev/acpica/dswexec.c 31 Oct 2001 02:32:27 -0000 1.1.1.11 +++ contrib/dev/acpica/dswexec.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ * * Module Name: dswexec - Dispatcher method execution callbacks; * dispatch to interpreter. - * $Revision: 79 $ + * $Revision: 81 $ * *****************************************************************************/ @@ -130,7 +130,7 @@ MODULE_NAME ("dswexec") /* - * Dispatch tables for opcode classes + * Dispatch tables for opcode classes */ ACPI_EXECUTE_OP AcpiGbl_OpTypeDispatch [] = { AcpiExOpcode_1A_0T_0R, @@ -251,7 +251,7 @@ Cleanup: - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%pn", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%p\n", WalkState->ControlState->Common.Value, WalkState->Op)); /* Break to debugger to display result */ @@ -498,8 +498,8 @@ /* Resolve all operands */ - Status = AcpiExResolveOperands (WalkState->Opcode, - &(WalkState->Operands [WalkState->NumOperands -1]), + Status = AcpiExResolveOperands (WalkState->Opcode, + &(WalkState->Operands [WalkState->NumOperands -1]), WalkState); if (ACPI_FAILURE (Status)) { @@ -509,7 +509,7 @@ AcpiPsGetOpcodeName (WalkState->Opcode), AcpiFormatException (Status))); /* - * On error, we must delete all the operands and clear the + * On error, we must delete all the operands and clear the * operand stack */ for (i = 0; i < WalkState->NumOperands; i++) @@ -538,7 +538,7 @@ for (i = 0; i < WalkState->NumOperands; i++) { /* - * Remove a reference to all operands, including both + * Remove a reference to all operands, including both * "Arguments" and "Targets". */ AcpiUtRemoveReference (WalkState->Operands[i]); Index: contrib/dev/acpica/dswload.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/dswload.c,v retrieving revision 1.1.1.9 diff -u -r1.1.1.9 dswload.c --- contrib/dev/acpica/dswload.c 31 Oct 2001 02:32:27 -0000 1.1.1.9 +++ contrib/dev/acpica/dswload.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: dswload - Dispatcher namespace load callbacks - * $Revision: 50 $ + * $Revision: 52 $ * *****************************************************************************/ @@ -177,7 +177,6 @@ } - /******************************************************************************* * * FUNCTION: AcpiDsLoad1BeginOp @@ -200,7 +199,7 @@ ACPI_PARSE_OBJECT *Op; ACPI_NAMESPACE_NODE *Node; ACPI_STATUS Status; - ACPI_OBJECT_TYPE8 DataType; + ACPI_OBJECT_TYPE8 ObjectType; NATIVE_CHAR *Path; @@ -210,6 +209,11 @@ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState)); + if (Op && (Op->Opcode == AML_INT_NAMEDFIELD_OP)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState)); + } + /* We are only interested in opcodes that have an associated name */ if (WalkState->Op) @@ -233,25 +237,17 @@ /* Map the raw opcode into an internal object type */ - DataType = AcpiDsMapNamedOpcodeToDataType (WalkState->Opcode); - + ObjectType = WalkState->OpInfo->ObjectType; ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "State=%p Op=%p Type=%x\n", WalkState, Op, DataType)); - - - if (WalkState->Opcode == AML_SCOPE_OP) - { - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "State=%p Op=%p Type=%x\n", WalkState, Op, DataType)); - } + "State=%p Op=%p Type=%x\n", WalkState, Op, ObjectType)); /* * Enter the named type into the internal namespace. We enter the name * as we go downward in the parse tree. Any necessary subobjects that involve * arguments to the opcode must be created as we go back up the parse tree later. */ - Status = AcpiNsLookup (WalkState->ScopeInfo, Path, DataType, + Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType, IMODE_LOAD_PASS1, NS_NO_UPSEARCH, WalkState, &(Node)); if (ACPI_FAILURE (Status)) @@ -306,7 +302,7 @@ ACPI_WALK_STATE *WalkState) { ACPI_PARSE_OBJECT *Op; - ACPI_OBJECT_TYPE8 DataType; + ACPI_OBJECT_TYPE8 ObjectType; PROC_NAME ("DsLoad1EndOp"); @@ -317,34 +313,51 @@ /* We are only interested in opcodes that have an associated name */ - if (!(WalkState->OpInfo->Flags & AML_NAMED)) + if (!(WalkState->OpInfo->Flags & (AML_NAMED | AML_FIELD))) { return (AE_OK); } - /* Get the type to determine if we should pop the scope */ + /* Get the object type to determine if we should pop the scope */ + + ObjectType = WalkState->OpInfo->ObjectType; + + if (WalkState->OpInfo->Flags & AML_FIELD) + { + if (WalkState->Opcode == AML_FIELD_OP || + WalkState->Opcode == AML_BANK_FIELD_OP || + WalkState->Opcode == AML_INDEX_FIELD_OP) + { + AcpiDsInitFieldObjects (Op, WalkState); + } + return (AE_OK); + } - DataType = AcpiDsMapNamedOpcodeToDataType (Op->Opcode); + + if (Op->Opcode == AML_REGION_OP) + { + /*Status = */AcpiExCreateRegion (((ACPI_PARSE2_OBJECT *) Op)->Data, + ((ACPI_PARSE2_OBJECT *) Op)->Length, + (ACPI_ADR_SPACE_TYPE) ((Op->Value.Arg)->Value.Integer), WalkState); + } if (Op->Opcode == AML_NAME_OP) { - /* For Name opcode, check the argument */ + /* For Name opcode, get the object type from the argument */ if (Op->Value.Arg) { - DataType = AcpiDsMapOpcodeToDataType ( - (Op->Value.Arg)->Opcode, NULL); - ((ACPI_NAMESPACE_NODE *)Op->Node)->Type = - (UINT8) DataType; + ObjectType = (AcpiPsGetOpcodeInfo ((Op->Value.Arg)->Opcode))->ObjectType; + Op->Node->Type = (UINT8) ObjectType; } } /* Pop the scope stack */ - if (AcpiNsOpensScope (DataType)) + if (AcpiNsOpensScope (ObjectType)) { ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s): Popping scope for Op %p\n", - AcpiUtGetTypeName (DataType), Op)); + AcpiUtGetTypeName (ObjectType), Op)); AcpiDsScopeStackPop (WalkState); } @@ -375,7 +388,7 @@ ACPI_PARSE_OBJECT *Op; ACPI_NAMESPACE_NODE *Node; ACPI_STATUS Status; - ACPI_OBJECT_TYPE8 DataType; + ACPI_OBJECT_TYPE8 ObjectType; NATIVE_CHAR *BufferPtr; void *Original = NULL; @@ -433,10 +446,10 @@ /* Map the raw opcode into an internal object type */ - DataType = AcpiDsMapNamedOpcodeToDataType (WalkState->Opcode); + ObjectType = WalkState->OpInfo->ObjectType; ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "State=%p Op=%p Type=%x\n", WalkState, Op, DataType)); + "State=%p Op=%p Type=%x\n", WalkState, Op, ObjectType)); if (WalkState->Opcode == AML_FIELD_OP || @@ -453,7 +466,7 @@ * The NamePath is an object reference to an existing object. Don't enter the * name into the namespace, but look it up for use later */ - Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, DataType, + Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType, IMODE_EXECUTE, NS_SEARCH_PARENT, WalkState, &(Node)); } @@ -464,9 +477,9 @@ Original = Op->Node; Node = Op->Node; - if (AcpiNsOpensScope (DataType)) + if (AcpiNsOpensScope (ObjectType)) { - Status = AcpiDsScopeStackPush (Node, DataType, WalkState); + Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState); if (ACPI_FAILURE (Status)) { return (Status); @@ -481,7 +494,7 @@ * as we go downward in the parse tree. Any necessary subobjects that involve * arguments to the opcode must be created as we go back up the parse tree later. */ - Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, DataType, + Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType, IMODE_EXECUTE, NS_NO_UPSEARCH, WalkState, &(Node)); } @@ -546,7 +559,7 @@ { ACPI_PARSE_OBJECT *Op; ACPI_STATUS Status = AE_OK; - ACPI_OBJECT_TYPE8 DataType; + ACPI_OBJECT_TYPE8 ObjectType; ACPI_NAMESPACE_NODE *Node; ACPI_PARSE_OBJECT *Arg; ACPI_NAMESPACE_NODE *NewNode; @@ -580,7 +593,7 @@ } - DataType = AcpiDsMapNamedOpcodeToDataType (Op->Opcode); + ObjectType = WalkState->OpInfo->ObjectType; /* * Get the Node/name from the earlier lookup @@ -597,11 +610,10 @@ /* Pop the scope stack */ - if (AcpiNsOpensScope (DataType)) + if (AcpiNsOpensScope (ObjectType)) { - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n", - AcpiUtGetTypeName (DataType), Op)); + AcpiUtGetTypeName (ObjectType), Op)); AcpiDsScopeStackPop (WalkState); } @@ -655,7 +667,6 @@ case AML_TYPE_NAMED_FIELD: - Arg = Op->Value.Arg; switch (Op->Opcode) { case AML_INDEX_FIELD_OP: @@ -664,13 +675,11 @@ WalkState); break; - case AML_BANK_FIELD_OP: Status = AcpiDsCreateBankField (Op, Arg->Node, WalkState); break; - case AML_FIELD_OP: Status = AcpiDsCreateField (Op, Arg->Node, WalkState); @@ -694,25 +703,21 @@ Status = AcpiExCreateProcessor (WalkState); break; - case AML_POWER_RES_OP: Status = AcpiExCreatePowerResource (WalkState); break; - case AML_MUTEX_OP: Status = AcpiExCreateMutex (WalkState); break; - case AML_EVENT_OP: Status = AcpiExCreateEvent (WalkState); break; - case AML_DATA_REGION_OP: Status = AcpiExCreateTableRegion (WalkState); @@ -748,7 +753,7 @@ { case AML_METHOD_OP: /* - * MethodOp PkgLength NamesString MethodFlags TermList + * MethodOp PkgLength NameString MethodFlags TermList */ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "LOADING-Method: State=%p Op=%p NamedObj=%p\n", @@ -774,9 +779,23 @@ * The OpRegion is not fully parsed at this time. Only valid argument is the SpaceId. * (We must save the address of the AML of the address and length operands) */ - Status = AcpiExCreateRegion (((ACPI_PARSE2_OBJECT *) Op)->Data, - ((ACPI_PARSE2_OBJECT *) Op)->Length, - (ACPI_ADR_SPACE_TYPE) Arg->Value.Integer, WalkState); + /* + * If we have a valid region, initialize it + * Namespace is NOT locked at this point. + */ + Status = AcpiEvInitializeRegion (Node->Object, FALSE); + if (ACPI_FAILURE (Status)) + { + /* + * If AE_NOT_EXIST is returned, it is not fatal + * because many regions get created before a handler + * is installed for said region. + */ + if (AE_NOT_EXIST == Status) + { + Status = AE_OK; + } + } break; Index: contrib/dev/acpica/dswstate.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/dswstate.c,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 dswstate.c --- contrib/dev/acpica/dswstate.c 4 Oct 2001 23:12:12 -0000 1.1.1.10 +++ contrib/dev/acpica/dswstate.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: dswstate - Dispatcher parse tree walk management routines - * $Revision: 54 $ + * $Revision: 55 $ * *****************************************************************************/ @@ -1062,7 +1062,7 @@ AcpiDsMethodDataInitArgs (Params, MTH_NUM_ARGS, WalkState); } - + else { /* Setup the current scope */ @@ -1086,7 +1086,6 @@ return_ACPI_STATUS (AE_OK); } #endif - /******************************************************************************* Index: contrib/dev/acpica/evevent.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/evevent.c,v retrieving revision 1.1.1.12 diff -u -r1.1.1.12 evevent.c --- contrib/dev/acpica/evevent.c 31 Oct 2001 02:32:26 -0000 1.1.1.12 +++ contrib/dev/acpica/evevent.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ * * Module Name: evevent - Fixed and General Purpose AcpiEvent * handling and dispatch - * $Revision: 51 $ + * $Revision: 53 $ * *****************************************************************************/ @@ -156,7 +156,6 @@ return_ACPI_STATUS (AE_NO_ACPI_TABLES); } - /* Make sure the BIOS supports ACPI mode */ if (SYS_MODE_LEGACY == AcpiHwGetModeCapabilities()) @@ -165,7 +164,6 @@ return_ACPI_STATUS (AE_ERROR); } - AcpiGbl_OriginalMode = AcpiHwGetMode(); /* @@ -196,7 +194,6 @@ return_ACPI_STATUS (Status); } - /* Install handlers for control method GPE handlers (_Lxx, _Exx) */ Status = AcpiEvInitGpeControlMethods (); @@ -215,7 +212,6 @@ return_ACPI_STATUS (Status); } - return_ACPI_STATUS (Status); } @@ -235,7 +231,8 @@ ACPI_STATUS AcpiEvFixedEventInitialize(void) { - int i = 0; + NATIVE_UINT i; + /* Initialize the structure that keeps track of fixed event handlers */ @@ -289,8 +286,7 @@ "Fixed AcpiEvent Block: Enable %08X Status %08X\n", EnableRegister, StatusRegister)); - - /* power management timer roll over */ + /* Power management timer roll over */ if ((StatusRegister & ACPI_STATUS_PMTIMER) && (EnableRegister & ACPI_ENABLE_PMTIMER)) @@ -298,7 +294,7 @@ IntStatus |= AcpiEvFixedEventDispatch (ACPI_EVENT_PMTIMER); } - /* global event (BIOS wants the global lock) */ + /* Global event (BIOS wants the global lock) */ if ((StatusRegister & ACPI_STATUS_GLOBAL) && (EnableRegister & ACPI_ENABLE_GLOBAL)) @@ -306,7 +302,7 @@ IntStatus |= AcpiEvFixedEventDispatch (ACPI_EVENT_GLOBAL); } - /* power button event */ + /* Power button event */ if ((StatusRegister & ACPI_STATUS_POWER_BUTTON) && (EnableRegister & ACPI_ENABLE_POWER_BUTTON)) @@ -314,7 +310,7 @@ IntStatus |= AcpiEvFixedEventDispatch (ACPI_EVENT_POWER_BUTTON); } - /* sleep button event */ + /* Sleep button event */ if ((StatusRegister & ACPI_STATUS_SLEEP_BUTTON) && (EnableRegister & ACPI_ENABLE_SLEEP_BUTTON)) @@ -654,7 +650,6 @@ AcpiGbl_GpeInfo [GpeNumber].Type = Type; AcpiGbl_GpeInfo [GpeNumber].MethodHandle = ObjHandle; - /* * Enable the GPE (SCIs should be disabled at this point) */ @@ -810,6 +805,7 @@ FUNCTION_TRACE ("EvAsynchExecuteGpeMethod"); + /* * Take a snapshot of the GPE info for this level Index: contrib/dev/acpica/evmisc.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/evmisc.c,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 evmisc.c --- contrib/dev/acpica/evmisc.c 31 Oct 2001 02:32:26 -0000 1.1.1.10 +++ contrib/dev/acpica/evmisc.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ * * Module Name: evmisc - ACPI device notification handler dispatch * and ACPI Global Lock support - * $Revision: 35 $ + * $Revision: 36 $ * *****************************************************************************/ @@ -220,7 +220,6 @@ } } - /* If there is any handler to run, schedule the dispatcher */ if ((AcpiGbl_SysNotify.Handler && (NotifyValue <= MAX_SYS_NOTIFY)) || @@ -298,7 +297,6 @@ GlobalContext = AcpiGbl_SysNotify.Context; } } - else { /* Global driver notification handler */ @@ -310,7 +308,6 @@ } } - /* Invoke the system handler first, if present */ if (GlobalHandler) @@ -476,7 +473,6 @@ AcpiGbl_GlobalLockThreadCount++; - /* If we (OS side) have the hardware lock already, we are done */ if (AcpiGbl_GlobalLockAcquired) @@ -491,7 +487,6 @@ return_ACPI_STATUS (AE_OK); } - /* We must acquire the actual hardware lock */ GlobalLock = AcpiGbl_FACS->GlobalLock; @@ -505,7 +500,6 @@ AcpiGbl_GlobalLockAcquired = TRUE; return_ACPI_STATUS (AE_OK); } - /* * Did not get the lock. The pending bit was set above, and we must now Index: contrib/dev/acpica/evregion.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/evregion.c,v retrieving revision 1.1.1.12 diff -u -r1.1.1.12 evregion.c --- contrib/dev/acpica/evregion.c 31 Oct 2001 02:32:26 -0000 1.1.1.12 +++ contrib/dev/acpica/evregion.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evregion - ACPI AddressSpace (OpRegion) handler dispatch - * $Revision: 113 $ + * $Revision: 118 $ * *****************************************************************************/ @@ -161,14 +161,14 @@ * space must be always available -- even though we are nowhere * near ready to find the PCI root buses at this point. * - * NOTE: We ignore AE_EXIST because this means that a handler has - * already been installed (via AcpiInstallAddressSpaceHandler) + * NOTE: We ignore AE_ALREADY_EXISTS because this means that a handler + * has already been installed (via AcpiInstallAddressSpaceHandler) */ Status = AcpiInstallAddressSpaceHandler (AcpiGbl_RootNode, ACPI_ADR_SPACE_SYSTEM_MEMORY, ACPI_DEFAULT_HANDLER, NULL, NULL); if ((ACPI_FAILURE (Status)) && - (Status != AE_EXIST)) + (Status != AE_ALREADY_EXISTS)) { return_ACPI_STATUS (Status); } @@ -177,7 +177,7 @@ ACPI_ADR_SPACE_SYSTEM_IO, ACPI_DEFAULT_HANDLER, NULL, NULL); if ((ACPI_FAILURE (Status)) && - (Status != AE_EXIST)) + (Status != AE_ALREADY_EXISTS)) { return_ACPI_STATUS (Status); } @@ -186,7 +186,7 @@ ACPI_ADR_SPACE_PCI_CONFIG, ACPI_DEFAULT_HANDLER, NULL, NULL); if ((ACPI_FAILURE (Status)) && - (Status != AE_EXIST)) + (Status != AE_ALREADY_EXISTS)) { return_ACPI_STATUS (Status); } @@ -280,7 +280,7 @@ * SpaceId - ID of the address space (0-255) * Function - Read or Write operation * Address - Where in the space to read or write - * BitWidth - Field width in bits (8, 16, or 32) + * BitWidth - Field width in bits (8, 16, 32, or 64) * Value - Pointer to in or out value * * RETURN: Status @@ -296,7 +296,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - UINT32 *Value) + ACPI_INTEGER *Value) { ACPI_STATUS Status; ACPI_ADR_SPACE_HANDLER Handler; @@ -317,14 +317,14 @@ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "no handler for region(%p) [%s]\n", RegionObj, AcpiUtGetRegionName (RegionObj->Region.SpaceId))); - return_ACPI_STATUS(AE_NOT_EXIST); + return_ACPI_STATUS (AE_NOT_EXIST); } /* * It may be the case that the region has never been initialized * Some types of regions require special init code */ - if (!(RegionObj->Region.Flags & AOPOBJ_INITIALIZED)) + if (!(RegionObj->Region.Flags & AOPOBJ_SETUP_COMPLETE)) { /* * This region has not been initialized yet, do it @@ -361,10 +361,10 @@ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region Init: %s [%s]\n", AcpiFormatException (Status), AcpiUtGetRegionName (RegionObj->Region.SpaceId))); - return_ACPI_STATUS(Status); + return_ACPI_STATUS (Status); } - RegionObj->Region.Flags |= AOPOBJ_INITIALIZED; + RegionObj->Region.Flags |= AOPOBJ_SETUP_COMPLETE; /* * Save the returned context for use in all accesses to @@ -518,7 +518,7 @@ AcpiUtGetRegionName (RegionObj->Region.SpaceId))); } - RegionObj->Region.Flags &= ~(AOPOBJ_INITIALIZED); + RegionObj->Region.Flags &= ~(AOPOBJ_SETUP_COMPLETE); /* * Remove handler reference in the region @@ -587,18 +587,19 @@ /* - * Link this region to the front of the handler's list + * Link this region to the front of the handler's list */ RegionObj->Region.Next = HandlerObj->AddrHandler.RegionList; HandlerObj->AddrHandler.RegionList = RegionObj; /* - * set the region's handler + * Set the region's handler */ RegionObj->Region.AddrHandler = HandlerObj; /* - * Last thing, tell all users that this region is usable + * Tell all users that this region is usable by running the _REG + * method */ if (AcpiNsIsLocked) { @@ -624,8 +625,8 @@ * Level - Nesting level of the handle * Context - Passed into AcpiNsWalkNamespace * - * DESCRIPTION: This routine checks to see if the object is a Region if it - * is then the address handler is installed in it. + * DESCRIPTION: This routine installs an address handler into objects that are + * of type Region. * * If the Object is a Device, and the device has a handler of * the same type then the search is terminated in that branch. Index: contrib/dev/acpica/evrgnini.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/evrgnini.c,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 evrgnini.c --- contrib/dev/acpica/evrgnini.c 31 Oct 2001 02:32:26 -0000 1.1.1.11 +++ contrib/dev/acpica/evrgnini.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evrgnini- ACPI AddressSpace (OpRegion) init - * $Revision: 48 $ + * $Revision: 50 $ * *****************************************************************************/ @@ -371,7 +371,6 @@ } - /******************************************************************************* * * FUNCTION: AcpiEvPciBarRegionSetup @@ -517,12 +516,20 @@ return_ACPI_STATUS (AE_BAD_PARAMETER); } + if (RegionObj->Common.Flags & AOPOBJ_OBJECT_INITIALIZED) + { + return_ACPI_STATUS (AE_OK); + } + Node = AcpiNsGetParentObject (RegionObj->Region.Node); + + SpaceId = RegionObj->Region.SpaceId; RegionObj->Region.AddrHandler = NULL; RegionObj->Region.Extra->Extra.Method_REG = NULL; - RegionObj->Region.Flags &= ~(AOPOBJ_INITIALIZED); + RegionObj->Common.Flags &= ~(AOPOBJ_SETUP_COMPLETE); + RegionObj->Common.Flags |= AOPOBJ_OBJECT_INITIALIZED; /* * Find any "_REG" associated with this region definition @@ -590,6 +597,7 @@ */ AcpiEvAssociateRegionAndHandler (HandlerObj, RegionObj, AcpiNsLocked); + return_ACPI_STATUS (AE_OK); } Index: contrib/dev/acpica/evxface.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/evxface.c,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 evxface.c --- contrib/dev/acpica/evxface.c 31 Oct 2001 02:32:26 -0000 1.1.1.10 +++ contrib/dev/acpica/evxface.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evxface - External interfaces for ACPI events - * $Revision: 116 $ + * $Revision: 118 $ * *****************************************************************************/ @@ -169,7 +169,7 @@ if (NULL != AcpiGbl_FixedEventHandlers[Event].Handler) { - Status = AE_EXIST; + Status = AE_ALREADY_EXISTS; goto Cleanup; } @@ -327,7 +327,7 @@ ((HandlerType == ACPI_DEVICE_NOTIFY) && AcpiGbl_DrvNotify.Handler)) { - Status = AE_EXIST; + Status = AE_ALREADY_EXISTS; goto UnlockAndExit; } @@ -352,7 +352,7 @@ * Caller will only receive notifications specific to the target object. * Note that only certain object types can receive notifications. */ - else + else { /* * These are the ONLY objects that can receive ACPI notifications @@ -379,7 +379,7 @@ ((HandlerType == ACPI_DEVICE_NOTIFY) && ObjDesc->Device.DrvHandler)) { - Status = AE_EXIST; + Status = AE_ALREADY_EXISTS; goto UnlockAndExit; } } @@ -488,7 +488,7 @@ /* * Root Object */ - if (Device == ACPI_ROOT_OBJECT) + if (Device == ACPI_ROOT_OBJECT) { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing notify handler for ROOT object.\n")); @@ -501,13 +501,13 @@ goto UnlockAndExit; } - if (HandlerType == ACPI_SYSTEM_NOTIFY) + if (HandlerType == ACPI_SYSTEM_NOTIFY) { AcpiGbl_SysNotify.Node = NULL; AcpiGbl_SysNotify.Handler = NULL; AcpiGbl_SysNotify.Context = NULL; } - else + else { AcpiGbl_DrvNotify.Node = NULL; AcpiGbl_DrvNotify.Handler = NULL; @@ -518,7 +518,7 @@ /* * All Other Objects */ - else + else { /* * These are the ONLY objects that can receive ACPI notifications @@ -630,7 +630,7 @@ if (AcpiGbl_GpeInfo[GpeNumber].Handler) { - Status = AE_EXIST; + Status = AE_ALREADY_EXISTS; goto Cleanup; } Index: contrib/dev/acpica/evxfregn.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/evxfregn.c,v retrieving revision 1.1.1.9 diff -u -r1.1.1.9 evxfregn.c --- contrib/dev/acpica/evxfregn.c 31 Oct 2001 02:32:26 -0000 1.1.1.9 +++ contrib/dev/acpica/evxfregn.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ * * Module Name: evxfregn - External Interfaces, ACPI Operation Regions and * Address Spaces. - * $Revision: 40 $ + * $Revision: 41 $ * *****************************************************************************/ @@ -265,7 +265,7 @@ */ if(HandlerObj->AddrHandler.SpaceId == SpaceId) { - Status = AE_EXIST; + Status = AE_ALREADY_EXISTS; goto UnlockAndExit; } Index: contrib/dev/acpica/exconfig.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/exconfig.c,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 exconfig.c --- contrib/dev/acpica/exconfig.c 31 Oct 2001 02:32:27 -0000 1.1.1.11 +++ contrib/dev/acpica/exconfig.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes) - * $Revision: 44 $ + * $Revision: 46 $ * *****************************************************************************/ @@ -168,9 +168,9 @@ TableHeader.Length = 0; for (i = 0; i < sizeof (ACPI_TABLE_HEADER); i++) { - Status = AcpiEvAddressSpaceDispatch (RgnDesc, ACPI_READ_ADR_SPACE, + Status = AcpiEvAddressSpaceDispatch (RgnDesc, ACPI_READ, (ACPI_PHYSICAL_ADDRESS) i, 8, - (UINT32 *) ((UINT8 *) &TableHeader + i)); + (ACPI_INTEGER *) ((UINT8 *) &TableHeader + i)); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -195,9 +195,9 @@ for (i = 0; i < TableHeader.Length; i++) { - Status = AcpiEvAddressSpaceDispatch (RgnDesc, ACPI_READ_ADR_SPACE, + Status = AcpiEvAddressSpaceDispatch (RgnDesc, ACPI_READ, (ACPI_PHYSICAL_ADDRESS) i, 8, - (UINT32 *) (TableDataPtr + i)); + (ACPI_INTEGER *) (TableDataPtr + i)); if (ACPI_FAILURE (Status)) { goto Cleanup; Index: contrib/dev/acpica/excreate.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/excreate.c,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 excreate.c --- contrib/dev/acpica/excreate.c 31 Oct 2001 02:32:27 -0000 1.1.1.10 +++ contrib/dev/acpica/excreate.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: excreate - Named object creation - * $Revision: 71 $ + * $Revision: 74 $ * *****************************************************************************/ @@ -130,7 +130,6 @@ MODULE_NAME ("excreate") - /***************************************************************************** * * FUNCTION: AcpiExCreateAlias @@ -162,7 +161,7 @@ /* Attach the original source object to the new Alias Node */ - Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) WalkState->Operands[0], + Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) WalkState->Operands[0], SourceNode->Object, SourceNode->Type); @@ -226,7 +225,7 @@ ObjDesc, (UINT8) ACPI_TYPE_EVENT); Cleanup: - /* + /* * Remove local reference to the object (on error, will cause deletion * of both object and semaphore if present.) */ @@ -286,7 +285,7 @@ Cleanup: - /* + /* * Remove local reference to the object (on error, will cause deletion * of both object and semaphore if present.) */ @@ -327,7 +326,7 @@ /* Get the Node from the object stack */ - Node = (ACPI_NAMESPACE_NODE *) WalkState->Operands[0]; + Node = WalkState->Op->Node; /* * If the region object is already attached to this node, @@ -342,8 +341,8 @@ * Space ID must be one of the predefined IDs, or in the user-defined * range */ - if ((RegionSpace >= NUM_REGION_TYPES) && - (RegionSpace < USER_REGION_BEGIN)) + if ((RegionSpace >= ACPI_NUM_PREDEFINED_REGIONS) && + (RegionSpace < ACPI_USER_REGION_BEGIN)) { REPORT_ERROR (("Invalid AddressSpace type %X\n", RegionSpace)); return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID); @@ -395,23 +394,6 @@ goto Cleanup; } - /* - * If we have a valid region, initialize it - * Namespace is NOT locked at this point. - */ - Status = AcpiEvInitializeRegion (ObjDesc, FALSE); - if (ACPI_FAILURE (Status)) - { - /* - * If AE_NOT_EXIST is returned, it is not fatal - * because many regions get created before a handler - * is installed for said region. - */ - if (AE_NOT_EXIST == Status) - { - Status = AE_OK; - } - } Cleanup: @@ -506,7 +488,7 @@ /* Install the processor object in the parent Node */ - Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) Operand[0], + Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) Operand[0], ObjDesc, (UINT8) ACPI_TYPE_PROCESSOR); @@ -560,7 +542,7 @@ /* Install the power resource object in the parent Node */ - Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) Operand[0], + Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) Operand[0], ObjDesc, (UINT8) ACPI_TYPE_POWER); @@ -642,7 +624,7 @@ /* Attach the new object to the method Node */ - Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) Operand[0], + Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) Operand[0], ObjDesc, (UINT8) ACPI_TYPE_METHOD); /* Remove local reference to the object */ Index: contrib/dev/acpica/exdump.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/exdump.c,v retrieving revision 1.1.1.9 diff -u -r1.1.1.9 exdump.c --- contrib/dev/acpica/exdump.c 31 Oct 2001 02:32:27 -0000 1.1.1.9 +++ contrib/dev/acpica/exdump.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: exdump - Interpreter debug output routines - * $Revision: 126 $ + * $Revision: 133 $ * *****************************************************************************/ @@ -164,9 +164,15 @@ FUNCTION_TRACE ("ExShowHexValue"); + if (!((ACPI_LV_LOAD & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer))) + { + return; + } + if (!AmlStart) { REPORT_ERROR (("ExShowHexValue: null pointer\n")); + return; } /* @@ -194,30 +200,29 @@ for (Length = LeadSpace; Length; --Length ) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " ")); + AcpiOsPrintf (" "); } while (ByteCount--) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, "%02x", *AmlStart++)); - + AcpiOsPrintf ("%02x", *AmlStart++); if (ByteCount) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " ")); + AcpiOsPrintf (" "); } } if (ShowDecimalValue) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " [%d]", Value)); + AcpiOsPrintf (" [%d]", Value); } if (0 == LeadSpace) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " ")); + AcpiOsPrintf (" "); } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, "\n")); + AcpiOsPrintf ("\n"); return_VOID; } @@ -245,6 +250,12 @@ PROC_NAME ("ExDumpOperand") + if (!((ACPI_LV_INFO & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer))) + { + return (AE_OK); + } + + /* TBD: change all dbg prints to osprintf */ if (!EntryDesc) { @@ -283,31 +294,31 @@ { case AML_ZERO_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Zero\n")); + AcpiOsPrintf ("Reference: Zero\n"); break; case AML_ONE_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: One\n")); + AcpiOsPrintf ("Reference: One\n"); break; case AML_ONES_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Ones\n")); + AcpiOsPrintf ("Reference: Ones\n"); break; case AML_REVISION_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Revision\n")); + AcpiOsPrintf ("Reference: Revision\n"); break; case AML_DEBUG_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Debug\n")); + AcpiOsPrintf ("Reference: Debug\n"); break; @@ -321,59 +332,59 @@ case AML_INDEX_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Index %p\n", - EntryDesc->Reference.Object)); + AcpiOsPrintf ("Reference: Index %p\n", + EntryDesc->Reference.Object); break; case AML_ARG_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Arg%d", - EntryDesc->Reference.Offset)); + AcpiOsPrintf ("Reference: Arg%d", + EntryDesc->Reference.Offset); if (ACPI_TYPE_INTEGER == EntryDesc->Common.Type) { /* Value is a Number */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%8.8X%8.8x]", + AcpiOsPrintf (" value is [%8.8X%8.8x]", HIDWORD(EntryDesc->Integer.Value), - LODWORD(EntryDesc->Integer.Value))); + LODWORD(EntryDesc->Integer.Value)); } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n")); + AcpiOsPrintf ("\n"); break; case AML_LOCAL_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference: Local%d", - EntryDesc->Reference.Offset)); + AcpiOsPrintf ("Reference: Local%d", + EntryDesc->Reference.Offset); if (ACPI_TYPE_INTEGER == EntryDesc->Common.Type) { /* Value is a Number */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%8.8X%8.8x]", + AcpiOsPrintf (" value is [%8.8X%8.8x]", HIDWORD(EntryDesc->Integer.Value), - LODWORD(EntryDesc->Integer.Value))); + LODWORD(EntryDesc->Integer.Value)); } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n")); + AcpiOsPrintf ("\n"); break; case AML_INT_NAMEPATH_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference.Node->Name %X\n", - EntryDesc->Reference.Node->Name)); + AcpiOsPrintf ("Reference.Node->Name %X\n", + EntryDesc->Reference.Node->Name); break; default: /* unknown opcode */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Unknown opcode=%X\n", - EntryDesc->Reference.Opcode)); + AcpiOsPrintf ("Unknown opcode=%X\n", + EntryDesc->Reference.Opcode); break; } @@ -383,9 +394,9 @@ case ACPI_TYPE_BUFFER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Buffer len %X @ %p \n", + AcpiOsPrintf ("Buffer len %X @ %p \n", EntryDesc->Buffer.Length, - EntryDesc->Buffer.Pointer)); + EntryDesc->Buffer.Pointer); Length = EntryDesc->Buffer.Length; @@ -398,13 +409,13 @@ if (EntryDesc->Buffer.Pointer) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Buffer Contents: ")); + AcpiOsPrintf ("Buffer Contents: "); for (Buf = EntryDesc->Buffer.Pointer; Length--; ++Buf) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " %02x", *Buf)); + AcpiOsPrintf (" %02x", *Buf); } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,"\n")); + AcpiOsPrintf ("\n"); } break; @@ -412,32 +423,32 @@ case ACPI_TYPE_INTEGER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Integer %8.8X%8.8X\n", + AcpiOsPrintf ("Integer %8.8X%8.8X\n", HIDWORD (EntryDesc->Integer.Value), - LODWORD (EntryDesc->Integer.Value))); + LODWORD (EntryDesc->Integer.Value)); break; case INTERNAL_TYPE_IF: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "If [Integer] %8.8X%8.8X\n", + AcpiOsPrintf ("If [Integer] %8.8X%8.8X\n", HIDWORD (EntryDesc->Integer.Value), - LODWORD (EntryDesc->Integer.Value))); + LODWORD (EntryDesc->Integer.Value)); break; case INTERNAL_TYPE_WHILE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "While [Integer] %8.8X%8.8X\n", + AcpiOsPrintf ("While [Integer] %8.8X%8.8X\n", HIDWORD (EntryDesc->Integer.Value), - LODWORD (EntryDesc->Integer.Value))); + LODWORD (EntryDesc->Integer.Value)); break; case ACPI_TYPE_PACKAGE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Package count %X @ %p\n", - EntryDesc->Package.Count, EntryDesc->Package.Elements)); + AcpiOsPrintf ("Package count %X @ %p\n", + EntryDesc->Package.Count, EntryDesc->Package.Elements); /* * If elements exist, package vector pointer is valid, @@ -458,16 +469,16 @@ } } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n")); + AcpiOsPrintf ("\n"); break; case ACPI_TYPE_REGION: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Region %s (%X)", + AcpiOsPrintf ("Region %s (%X)", AcpiUtGetRegionName (EntryDesc->Region.SpaceId), - EntryDesc->Region.SpaceId)); + EntryDesc->Region.SpaceId); /* * If the address and length have not been evaluated, @@ -475,62 +486,62 @@ */ if (!(EntryDesc->Region.Flags & AOPOBJ_DATA_VALID)) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n")); + AcpiOsPrintf ("\n"); } else { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " base %8.8X%8.8X Length %X\n", + AcpiOsPrintf (" base %8.8X%8.8X Length %X\n", HIDWORD(EntryDesc->Region.Address), LODWORD(EntryDesc->Region.Address), - EntryDesc->Region.Length)); + EntryDesc->Region.Length); } break; case ACPI_TYPE_STRING: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "String length %X @ %p \"", - EntryDesc->String.Length, EntryDesc->String.Pointer)); + AcpiOsPrintf ("String length %X @ %p \"", + EntryDesc->String.Length, EntryDesc->String.Pointer); for (i = 0; i < EntryDesc->String.Length; i++) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "%c", - EntryDesc->String.Pointer[i])); + AcpiOsPrintf ("%c", + EntryDesc->String.Pointer[i]); } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\"\n")); + AcpiOsPrintf ("\"\n"); break; case INTERNAL_TYPE_BANK_FIELD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "BankField\n")); + AcpiOsPrintf ("BankField\n"); break; case INTERNAL_TYPE_REGION_FIELD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, + AcpiOsPrintf ( "RegionField: bits=%X bitaccwidth=%X lock=%X update=%X at byte=%X bit=%X of below:\n", EntryDesc->Field.BitLength, EntryDesc->Field.AccessBitWidth, EntryDesc->Field.LockRule, EntryDesc->Field.UpdateRule, - EntryDesc->Field.BaseByteOffset, EntryDesc->Field.StartFieldBitOffset)); + EntryDesc->Field.BaseByteOffset, EntryDesc->Field.StartFieldBitOffset); DUMP_STACK_ENTRY (EntryDesc->Field.RegionObj); break; case INTERNAL_TYPE_INDEX_FIELD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "IndexField\n")); + AcpiOsPrintf ("IndexField\n"); break; case ACPI_TYPE_BUFFER_FIELD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, + AcpiOsPrintf ( "BufferField: %X bits at byte %X bit %X of \n", EntryDesc->BufferField.BitLength, EntryDesc->BufferField.BaseByteOffset, - EntryDesc->BufferField.StartFieldBitOffset)); + EntryDesc->BufferField.StartFieldBitOffset); if (!EntryDesc->BufferField.BufferObj) { @@ -540,7 +551,7 @@ else if (ACPI_TYPE_BUFFER != EntryDesc->BufferField.BufferObj->Common.Type) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "*not a Buffer* \n")); + AcpiOsPrintf ("*not a Buffer* \n"); } else @@ -553,54 +564,54 @@ case ACPI_TYPE_EVENT: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Event\n")); + AcpiOsPrintf ("Event\n"); break; case ACPI_TYPE_METHOD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, + AcpiOsPrintf ( "Method(%X) @ %p:%X\n", EntryDesc->Method.ParamCount, - EntryDesc->Method.AmlStart, EntryDesc->Method.AmlLength)); + EntryDesc->Method.AmlStart, EntryDesc->Method.AmlLength); break; case ACPI_TYPE_MUTEX: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Mutex\n")); + AcpiOsPrintf ("Mutex\n"); break; case ACPI_TYPE_DEVICE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Device\n")); + AcpiOsPrintf ("Device\n"); break; case ACPI_TYPE_POWER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Power\n")); + AcpiOsPrintf ("Power\n"); break; case ACPI_TYPE_PROCESSOR: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Processor\n")); + AcpiOsPrintf ("Processor\n"); break; case ACPI_TYPE_THERMAL: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Thermal\n")); + AcpiOsPrintf ("Thermal\n"); break; default: /* unknown EntryDesc->Common.Type value */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Unknown Type %X\n", - EntryDesc->Common.Type)); + AcpiOsPrintf ("Unknown Type %X\n", + EntryDesc->Common.Type); /* Back up to previous entry */ @@ -692,6 +703,57 @@ /***************************************************************************** * + * FUNCTION: AcpiExOut* + * + * PARAMETERS: Title - Descriptive text + * Value - Value to be displayed + * + * DESCRIPTION: Object dump output formatting functions. These functions + * reduce the number of format strings required and keeps them + * all in one place for easy modification. + * + ****************************************************************************/ + +void +AcpiExOutString ( + char *Title, + char *Value) +{ + AcpiOsPrintf ("%20s : %s\n", Title, Value); +} + +void +AcpiExOutPointer ( + char *Title, + void *Value) +{ + AcpiOsPrintf ("%20s : %p\n", Title, Value); +} + +void +AcpiExOutInteger ( + char *Title, + UINT32 Value) +{ + AcpiOsPrintf ("%20s : %X\n", Title, Value); +} + +void +AcpiExOutAddress ( + char *Title, + ACPI_PHYSICAL_ADDRESS Value) +{ +#ifdef _IA16 + AcpiOsPrintf ("%20s : %p\n", Title, Value); +#else + AcpiOsPrintf ("%20s : %8.8X%8.8X\n", Title, + HIDWORD (Value), LODWORD (Value)); +#endif +} + + +/***************************************************************************** + * * FUNCTION: AcpiExDumpNode * * PARAMETERS: *Node - Descriptor to dump @@ -720,14 +782,14 @@ AcpiOsPrintf ("%20s : %4.4s\n", "Name", (char*)&Node->Name); - AcpiOsPrintf ("%20s : %s\n", "Type", AcpiUtGetTypeName (Node->Type)); - AcpiOsPrintf ("%20s : %X\n", "Flags", Node->Flags); - AcpiOsPrintf ("%20s : %X\n", "Owner Id", Node->OwnerId); - AcpiOsPrintf ("%20s : %X\n", "Reference Count", Node->ReferenceCount); - AcpiOsPrintf ("%20s : %p\n", "Attached Object", Node->Object); - AcpiOsPrintf ("%20s : %p\n", "ChildList", Node->Child); - AcpiOsPrintf ("%20s : %p\n", "NextPeer", Node->Peer); - AcpiOsPrintf ("%20s : %p\n", "Parent", AcpiNsGetParentObject (Node)); + AcpiExOutString ("Type", AcpiUtGetTypeName (Node->Type)); + AcpiExOutInteger ("Flags", Node->Flags); + AcpiExOutInteger ("Owner Id", Node->OwnerId); + AcpiExOutInteger ("Reference Count", Node->ReferenceCount); + AcpiExOutPointer ("Attached Object", Node->Object); + AcpiExOutPointer ("ChildList", Node->Child); + AcpiExOutPointer ("NextPeer", Node->Peer); + AcpiExOutPointer ("Parent", AcpiNsGetParentObject (Node)); } @@ -747,7 +809,7 @@ ACPI_OPERAND_OBJECT *ObjDesc, UINT32 Flags) { - const ACPI_OPCODE_INFO *OpInfo; + UINT32 i; FUNCTION_TRACE ("ExDumpObjectDescriptor"); @@ -769,8 +831,9 @@ /* Common Fields */ - AcpiOsPrintf ("%20s : %X\n", "Reference Count", ObjDesc->Common.ReferenceCount); - AcpiOsPrintf ("%20s : %X\n", "Flags", ObjDesc->Common.Flags); + AcpiExOutString ("Type", AcpiUtGetTypeName (ObjDesc->Common.Type)); + AcpiExOutInteger ("Reference Count", ObjDesc->Common.ReferenceCount); + AcpiExOutInteger ("Flags", ObjDesc->Common.Flags); /* Object-specific Fields */ @@ -778,7 +841,6 @@ { case ACPI_TYPE_INTEGER: - AcpiOsPrintf ("%20s : %s\n", "Type", "Integer"); AcpiOsPrintf ("%20s : %X%8.8X\n", "Value", HIDWORD (ObjDesc->Integer.Value), LODWORD (ObjDesc->Integer.Value)); break; @@ -786,190 +848,186 @@ case ACPI_TYPE_STRING: - AcpiOsPrintf ("%20s : %s\n", "Type", "String"); - AcpiOsPrintf ("%20s : %X\n", "Length", ObjDesc->String.Length); - AcpiOsPrintf ("%20s : %p\n", "Pointer", ObjDesc->String.Pointer); + AcpiExOutInteger ("Length", ObjDesc->String.Length); + AcpiExOutPointer ("Pointer", ObjDesc->String.Pointer); break; case ACPI_TYPE_BUFFER: - AcpiOsPrintf ("%20s : %s\n", "Type", "Buffer"); - AcpiOsPrintf ("%20s : %X\n", "Length", ObjDesc->Buffer.Length); - AcpiOsPrintf ("%20s : %p\n", "Pointer", ObjDesc->Buffer.Pointer); + AcpiExOutInteger ("Length", ObjDesc->Buffer.Length); + AcpiExOutPointer ("Pointer", ObjDesc->Buffer.Pointer); break; case ACPI_TYPE_PACKAGE: - AcpiOsPrintf ("%20s : %s\n", "Type", "Package"); - AcpiOsPrintf ("%20s : %X\n", "Flags", ObjDesc->Package.Flags); - AcpiOsPrintf ("%20s : %X\n", "Count", ObjDesc->Package.Count); - AcpiOsPrintf ("%20s : %p\n", "Elements", ObjDesc->Package.Elements); - AcpiOsPrintf ("%20s : %p\n", "NextElement", ObjDesc->Package.NextElement); + AcpiExOutInteger ("Flags", ObjDesc->Package.Flags); + AcpiExOutInteger ("Count", ObjDesc->Package.Count); + AcpiExOutPointer ("Elements", ObjDesc->Package.Elements); + AcpiExOutPointer ("NextElement", ObjDesc->Package.NextElement); + + /* Dump the package contents */ + + if (ObjDesc->Package.Count > 0) + { + AcpiOsPrintf ("\nPackage Contents:\n"); + for (i = 0; i < ObjDesc->Package.Count; i++) + { + AcpiOsPrintf ("[%.3d] %p", i, ObjDesc->Package.Elements[i]); + if (ObjDesc->Package.Elements[i]) + { + AcpiOsPrintf (" %s", AcpiUtGetTypeName ((ObjDesc->Package.Elements[i])->Common.Type)); + } + AcpiOsPrintf ("\n"); + } + } break; case ACPI_TYPE_BUFFER_FIELD: - AcpiOsPrintf ("%20s : %s\n", "Type", "BufferField"); - AcpiOsPrintf ("%20s : %X\n", "BitLength", ObjDesc->BufferField.BitLength); - AcpiOsPrintf ("%20s : %X\n", "BitOffset", ObjDesc->BufferField.StartFieldBitOffset); - AcpiOsPrintf ("%20s : %X\n", "BaseByteOffset",ObjDesc->BufferField.BaseByteOffset); - AcpiOsPrintf ("%20s : %p\n", "BufferObj", ObjDesc->BufferField.BufferObj); + AcpiExOutInteger ("BitLength", ObjDesc->BufferField.BitLength); + AcpiExOutInteger ("BitOffset", ObjDesc->BufferField.StartFieldBitOffset); + AcpiExOutInteger ("BaseByteOffset", ObjDesc->BufferField.BaseByteOffset); + AcpiExOutPointer ("BufferObj", ObjDesc->BufferField.BufferObj); break; case ACPI_TYPE_DEVICE: - AcpiOsPrintf ("%20s : %s\n", "Type", "Device"); - AcpiOsPrintf ("%20s : %p\n", "AddrHandler", ObjDesc->Device.AddrHandler); - AcpiOsPrintf ("%20s : %p\n", "SysHandler", ObjDesc->Device.SysHandler); - AcpiOsPrintf ("%20s : %p\n", "DrvHandler", ObjDesc->Device.DrvHandler); + AcpiExOutPointer ("AddrHandler", ObjDesc->Device.AddrHandler); + AcpiExOutPointer ("SysHandler", ObjDesc->Device.SysHandler); + AcpiExOutPointer ("DrvHandler", ObjDesc->Device.DrvHandler); break; case ACPI_TYPE_EVENT: - AcpiOsPrintf ("%20s : %s\n", "Type", "Event"); - AcpiOsPrintf ("%20s : %X\n", "Semaphore", ObjDesc->Event.Semaphore); + AcpiExOutPointer ("Semaphore", ObjDesc->Event.Semaphore); break; case ACPI_TYPE_METHOD: - AcpiOsPrintf ("%20s : %s\n", "Type", "Method"); - AcpiOsPrintf ("%20s : %X\n", "ParamCount", ObjDesc->Method.ParamCount); - AcpiOsPrintf ("%20s : %X\n", "Concurrency", ObjDesc->Method.Concurrency); - AcpiOsPrintf ("%20s : %p\n", "Semaphore", ObjDesc->Method.Semaphore); - AcpiOsPrintf ("%20s : %X\n", "AmlLength", ObjDesc->Method.AmlLength); - AcpiOsPrintf ("%20s : %X\n", "AmlStart", ObjDesc->Method.AmlStart); + AcpiExOutInteger ("ParamCount", ObjDesc->Method.ParamCount); + AcpiExOutInteger ("Concurrency", ObjDesc->Method.Concurrency); + AcpiExOutPointer ("Semaphore", ObjDesc->Method.Semaphore); + AcpiExOutInteger ("AmlLength", ObjDesc->Method.AmlLength); + AcpiExOutPointer ("AmlStart", ObjDesc->Method.AmlStart); break; case ACPI_TYPE_MUTEX: - AcpiOsPrintf ("%20s : %s\n", "Type", "Mutex"); - AcpiOsPrintf ("%20s : %X\n", "SyncLevel", ObjDesc->Mutex.SyncLevel); - AcpiOsPrintf ("%20s : %p\n", "Owner", ObjDesc->Mutex.Owner); - AcpiOsPrintf ("%20s : %X\n", "AcquisitionDepth", ObjDesc->Mutex.AcquisitionDepth); - AcpiOsPrintf ("%20s : %p\n", "Semaphore", ObjDesc->Mutex.Semaphore); + AcpiExOutInteger ("SyncLevel", ObjDesc->Mutex.SyncLevel); + AcpiExOutPointer ("Owner", ObjDesc->Mutex.Owner); + AcpiExOutInteger ("AcquisitionDepth",ObjDesc->Mutex.AcquisitionDepth); + AcpiExOutPointer ("Semaphore", ObjDesc->Mutex.Semaphore); break; case ACPI_TYPE_REGION: - AcpiOsPrintf ("%20s : %s\n", "Type", "Region"); - AcpiOsPrintf ("%20s : %X\n", "SpaceId", ObjDesc->Region.SpaceId); - AcpiOsPrintf ("%20s : %X\n", "Flags", ObjDesc->Region.Flags); - AcpiOsPrintf ("%20s : %X\n", "Address", ObjDesc->Region.Address); - AcpiOsPrintf ("%20s : %X\n", "Length", ObjDesc->Region.Length); - AcpiOsPrintf ("%20s : %p\n", "AddrHandler", ObjDesc->Region.AddrHandler); - AcpiOsPrintf ("%20s : %p\n", "Next", ObjDesc->Region.Next); + AcpiExOutInteger ("SpaceId", ObjDesc->Region.SpaceId); + AcpiExOutInteger ("Flags", ObjDesc->Region.Flags); + AcpiExOutAddress ("Address", ObjDesc->Region.Address); + AcpiExOutInteger ("Length", ObjDesc->Region.Length); + AcpiExOutPointer ("AddrHandler", ObjDesc->Region.AddrHandler); + AcpiExOutPointer ("Next", ObjDesc->Region.Next); break; case ACPI_TYPE_POWER: - AcpiOsPrintf ("%20s : %s\n", "Type", "PowerResource"); - AcpiOsPrintf ("%20s : %X\n", "SystemLevel", ObjDesc->PowerResource.SystemLevel); - AcpiOsPrintf ("%20s : %X\n", "ResourceOrder", ObjDesc->PowerResource.ResourceOrder); - AcpiOsPrintf ("%20s : %p\n", "SysHandler", ObjDesc->PowerResource.SysHandler); - AcpiOsPrintf ("%20s : %p\n", "DrvHandler", ObjDesc->PowerResource.DrvHandler); + AcpiExOutInteger ("SystemLevel", ObjDesc->PowerResource.SystemLevel); + AcpiExOutInteger ("ResourceOrder", ObjDesc->PowerResource.ResourceOrder); + AcpiExOutPointer ("SysHandler", ObjDesc->PowerResource.SysHandler); + AcpiExOutPointer ("DrvHandler", ObjDesc->PowerResource.DrvHandler); break; case ACPI_TYPE_PROCESSOR: - AcpiOsPrintf ("%20s : %s\n", "Type", "Processor"); - AcpiOsPrintf ("%20s : %X\n", "Processor ID", ObjDesc->Processor.ProcId); - AcpiOsPrintf ("%20s : %X\n", "Length", ObjDesc->Processor.Length); - AcpiOsPrintf ("%20s : %X\n", "Address", ObjDesc->Processor.Address); - AcpiOsPrintf ("%20s : %p\n", "SysHandler", ObjDesc->Processor.SysHandler); - AcpiOsPrintf ("%20s : %p\n", "DrvHandler", ObjDesc->Processor.DrvHandler); - AcpiOsPrintf ("%20s : %p\n", "AddrHandler", ObjDesc->Processor.AddrHandler); + AcpiExOutInteger ("Processor ID", ObjDesc->Processor.ProcId); + AcpiExOutInteger ("Length", ObjDesc->Processor.Length); + AcpiExOutInteger ("Address", ObjDesc->Processor.Address); + AcpiExOutPointer ("SysHandler", ObjDesc->Processor.SysHandler); + AcpiExOutPointer ("DrvHandler", ObjDesc->Processor.DrvHandler); + AcpiExOutPointer ("AddrHandler", ObjDesc->Processor.AddrHandler); break; case ACPI_TYPE_THERMAL: - AcpiOsPrintf ("%20s : %s\n", "Type", "ThermalZone"); - AcpiOsPrintf ("%20s : %p\n", "SysHandler", ObjDesc->ThermalZone.SysHandler); - AcpiOsPrintf ("%20s : %p\n", "DrvHandler", ObjDesc->ThermalZone.DrvHandler); - AcpiOsPrintf ("%20s : %p\n", "AddrHandler", ObjDesc->ThermalZone.AddrHandler); + AcpiExOutPointer ("SysHandler", ObjDesc->ThermalZone.SysHandler); + AcpiExOutPointer ("DrvHandler", ObjDesc->ThermalZone.DrvHandler); + AcpiExOutPointer ("AddrHandler", ObjDesc->ThermalZone.AddrHandler); break; case INTERNAL_TYPE_REGION_FIELD: - - AcpiOsPrintf ("%20s : %p\n", "AccessBitWidth", ObjDesc->Field.AccessBitWidth); - AcpiOsPrintf ("%20s : %p\n", "BitLength", ObjDesc->Field.BitLength); - AcpiOsPrintf ("%20s : %p\n", "BaseByteOffset",ObjDesc->Field.BaseByteOffset); - AcpiOsPrintf ("%20s : %p\n", "BitOffset", ObjDesc->Field.StartFieldBitOffset); - AcpiOsPrintf ("%20s : %p\n", "RegionObj", ObjDesc->Field.RegionObj); - break; - - case INTERNAL_TYPE_BANK_FIELD: + case INTERNAL_TYPE_INDEX_FIELD: - AcpiOsPrintf ("%20s : %s\n", "Type", "BankField"); - AcpiOsPrintf ("%20s : %X\n", "AccessBitWidth", ObjDesc->BankField.AccessBitWidth); - AcpiOsPrintf ("%20s : %X\n", "LockRule", ObjDesc->BankField.LockRule); - AcpiOsPrintf ("%20s : %X\n", "UpdateRule", ObjDesc->BankField.UpdateRule); - AcpiOsPrintf ("%20s : %X\n", "BitLength", ObjDesc->BankField.BitLength); - AcpiOsPrintf ("%20s : %X\n", "BitOffset", ObjDesc->BankField.StartFieldBitOffset); - AcpiOsPrintf ("%20s : %X\n", "BaseByteOffset", ObjDesc->BankField.BaseByteOffset); - AcpiOsPrintf ("%20s : %X\n", "Value", ObjDesc->BankField.Value); - AcpiOsPrintf ("%20s : %p\n", "RegionObj", ObjDesc->BankField.RegionObj); - AcpiOsPrintf ("%20s : %X\n", "BankRegisterObj", ObjDesc->BankField.BankRegisterObj); - break; + AcpiExOutInteger ("AccessFlags", ObjDesc->CommonField.AccessFlags); + AcpiExOutInteger ("AccessBitWidth", ObjDesc->CommonField.AccessBitWidth); + AcpiExOutInteger ("AccessByteWidth", ObjDesc->CommonField.AccessByteWidth); + AcpiExOutInteger ("LockRule", ObjDesc->CommonField.LockRule); + AcpiExOutInteger ("UpdateRule", ObjDesc->CommonField.UpdateRule); + AcpiExOutInteger ("BitLength", ObjDesc->CommonField.BitLength); + AcpiExOutInteger ("BitOffset", ObjDesc->CommonField.StartFieldBitOffset); + AcpiExOutInteger ("BaseByteOffset", ObjDesc->CommonField.BaseByteOffset); + AcpiExOutInteger ("DatumValidBits", ObjDesc->CommonField.DatumValidBits); + AcpiExOutInteger ("EndFldValidBits", ObjDesc->CommonField.EndFieldValidBits); + AcpiExOutInteger ("EndBufValidBits", ObjDesc->CommonField.EndBufferValidBits); + AcpiExOutPointer ("ParentNode", ObjDesc->CommonField.Node); + switch (ObjDesc->Common.Type) + { + case INTERNAL_TYPE_REGION_FIELD: + AcpiExOutPointer ("RegionObj", ObjDesc->Field.RegionObj); + break; - case INTERNAL_TYPE_INDEX_FIELD: + case INTERNAL_TYPE_BANK_FIELD: + AcpiExOutInteger ("Value", ObjDesc->BankField.Value); + AcpiExOutPointer ("RegionObj", ObjDesc->BankField.RegionObj); + AcpiExOutPointer ("BankObj", ObjDesc->BankField.BankObj); + break; - AcpiOsPrintf ("%20s : %s\n", "Type", "IndexField"); - AcpiOsPrintf ("%20s : %X\n", "AccessBitWidth", ObjDesc->IndexField.AccessBitWidth); - AcpiOsPrintf ("%20s : %X\n", "LockRule", ObjDesc->IndexField.LockRule); - AcpiOsPrintf ("%20s : %X\n", "UpdateRule", ObjDesc->IndexField.UpdateRule); - AcpiOsPrintf ("%20s : %X\n", "BitLength", ObjDesc->IndexField.BitLength); - AcpiOsPrintf ("%20s : %X\n", "BitOffset", ObjDesc->IndexField.StartFieldBitOffset); - AcpiOsPrintf ("%20s : %X\n", "Value", ObjDesc->IndexField.Value); - AcpiOsPrintf ("%20s : %X\n", "Index", ObjDesc->IndexField.IndexObj); - AcpiOsPrintf ("%20s : %X\n", "Data", ObjDesc->IndexField.DataObj); + case INTERNAL_TYPE_INDEX_FIELD: + AcpiExOutInteger ("Value", ObjDesc->IndexField.Value); + AcpiExOutPointer ("Index", ObjDesc->IndexField.IndexObj); + AcpiExOutPointer ("Data", ObjDesc->IndexField.DataObj); + break; + } break; case INTERNAL_TYPE_REFERENCE: - OpInfo = AcpiPsGetOpcodeInfo (ObjDesc->Reference.Opcode); - - AcpiOsPrintf ("%20s : %s\n", "Type", "Reference"); - AcpiOsPrintf ("%20s : %X\n", "TargetType", ObjDesc->Reference.TargetType); - AcpiOsPrintf ("%20s : %s\n", "Opcode", OpInfo->Name); - AcpiOsPrintf ("%20s : %X\n", "Offset", ObjDesc->Reference.Offset); - AcpiOsPrintf ("%20s : %p\n", "ObjDesc", ObjDesc->Reference.Object); - AcpiOsPrintf ("%20s : %p\n", "Node", ObjDesc->Reference.Node); - AcpiOsPrintf ("%20s : %p\n", "Where", ObjDesc->Reference.Where); + AcpiExOutInteger ("TargetType", ObjDesc->Reference.TargetType); + AcpiExOutString ("Opcode", (AcpiPsGetOpcodeInfo (ObjDesc->Reference.Opcode))->Name); + AcpiExOutInteger ("Offset", ObjDesc->Reference.Offset); + AcpiExOutPointer ("ObjDesc", ObjDesc->Reference.Object); + AcpiExOutPointer ("Node", ObjDesc->Reference.Node); + AcpiExOutPointer ("Where", ObjDesc->Reference.Where); break; case INTERNAL_TYPE_ADDRESS_HANDLER: - AcpiOsPrintf ("%20s : %s\n", "Type", "Address Handler"); - AcpiOsPrintf ("%20s : %X\n", "SpaceId", ObjDesc->AddrHandler.SpaceId); - AcpiOsPrintf ("%20s : %p\n", "Next", ObjDesc->AddrHandler.Next); - AcpiOsPrintf ("%20s : %p\n", "RegionList", ObjDesc->AddrHandler.RegionList); - AcpiOsPrintf ("%20s : %p\n", "Node", ObjDesc->AddrHandler.Node); - AcpiOsPrintf ("%20s : %p\n", "Handler", ObjDesc->AddrHandler.Handler); - AcpiOsPrintf ("%20s : %p\n", "Context", ObjDesc->AddrHandler.Context); + AcpiExOutInteger ("SpaceId", ObjDesc->AddrHandler.SpaceId); + AcpiExOutPointer ("Next", ObjDesc->AddrHandler.Next); + AcpiExOutPointer ("RegionList", ObjDesc->AddrHandler.RegionList); + AcpiExOutPointer ("Node", ObjDesc->AddrHandler.Node); + AcpiExOutPointer ("Context", ObjDesc->AddrHandler.Context); break; case INTERNAL_TYPE_NOTIFY: - AcpiOsPrintf ("%20s : %s\n", "Type", "Notify Handler"); - AcpiOsPrintf ("%20s : %p\n", "Node", ObjDesc->NotifyHandler.Node); - AcpiOsPrintf ("%20s : %p\n", "Handler", ObjDesc->NotifyHandler.Handler); - AcpiOsPrintf ("%20s : %p\n", "Context", ObjDesc->NotifyHandler.Context); + AcpiExOutPointer ("Node", ObjDesc->NotifyHandler.Node); + AcpiExOutPointer ("Context", ObjDesc->NotifyHandler.Context); break; Index: contrib/dev/acpica/exfield.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/exfield.c,v retrieving revision 1.1.1.8 diff -u -r1.1.1.8 exfield.c --- contrib/dev/acpica/exfield.c 7 Sep 2001 01:22:24 -0000 1.1.1.8 +++ contrib/dev/acpica/exfield.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: exfield - ACPI AML (p-code) execution - field manipulation - * $Revision: 95 $ + * $Revision: 98 $ * *****************************************************************************/ @@ -154,6 +154,7 @@ ACPI_OPERAND_OBJECT *BufferDesc; UINT32 Length; void *Buffer; + BOOLEAN Locked; FUNCTION_TRACE_PTR ("ExReadDataFromField", ObjDesc); @@ -166,6 +167,22 @@ return_ACPI_STATUS (AE_AML_NO_OPERAND); } + if (ObjDesc->Common.Type == ACPI_TYPE_BUFFER_FIELD) + { + /* + * If the BufferField arguments have not been previously evaluated, + * evaluate them now and save the results. + */ + if (!(ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)) + { + Status = AcpiDsGetBufferFieldArguments (ObjDesc); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } + } + /* * Allocate a buffer for the contents of the field. * @@ -215,30 +232,25 @@ Buffer = &BufferDesc->Integer.Value; } + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "Obj=%p Type=%X Buf=%p Len=%X\n", + ObjDesc, ObjDesc->Common.Type, Buffer, Length)); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "FieldWrite: BitLen=%X BitOff=%X ByteOff=%X\n", + ObjDesc->CommonField.BitLength, + ObjDesc->CommonField.StartFieldBitOffset, + ObjDesc->CommonField.BaseByteOffset)); - /* Read from the appropriate field */ - - switch (ObjDesc->Common.Type) - { - case ACPI_TYPE_BUFFER_FIELD: - Status = AcpiExAccessBufferField (ACPI_READ, ObjDesc, Buffer, Length); - break; - - case INTERNAL_TYPE_REGION_FIELD: - Status = AcpiExAccessRegionField (ACPI_READ, ObjDesc, Buffer, Length); - break; + Locked = AcpiExAcquireGlobalLock (ObjDesc->CommonField.LockRule); - case INTERNAL_TYPE_BANK_FIELD: - Status = AcpiExAccessBankField (ACPI_READ, ObjDesc, Buffer, Length); - break; + /* Read from the field */ - case INTERNAL_TYPE_INDEX_FIELD: - Status = AcpiExAccessIndexField (ACPI_READ, ObjDesc, Buffer, Length); - break; + Status = AcpiExExtractFromField (ObjDesc, Buffer, Length); - default: - Status = AE_AML_INTERNAL; - } + /* + * Release global lock if we acquired it earlier + */ + AcpiExReleaseGlobalLock (Locked); if (ACPI_FAILURE (Status)) @@ -270,7 +282,6 @@ * ******************************************************************************/ - ACPI_STATUS AcpiExWriteDataToField ( ACPI_OPERAND_OBJECT *SourceDesc, @@ -279,6 +290,7 @@ ACPI_STATUS Status; UINT32 Length; void *Buffer; + BOOLEAN Locked; FUNCTION_TRACE_PTR ("ExWriteDataToField", ObjDesc); @@ -291,6 +303,22 @@ return_ACPI_STATUS (AE_AML_NO_OPERAND); } + if (ObjDesc->Common.Type == ACPI_TYPE_BUFFER_FIELD) + { + /* + * If the BufferField arguments have not been previously evaluated, + * evaluate them now and save the results. + */ + if (!(ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)) + { + Status = AcpiDsGetBufferFieldArguments (ObjDesc); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } + } + /* * Get a pointer to the data to be written @@ -317,250 +345,22 @@ } - /* - * Decode the type of field to be written - */ - switch (ObjDesc->Common.Type) - { - case ACPI_TYPE_BUFFER_FIELD: - Status = AcpiExAccessBufferField (ACPI_WRITE, ObjDesc, Buffer, Length); - break; - - case INTERNAL_TYPE_REGION_FIELD: - Status = AcpiExAccessRegionField (ACPI_WRITE, ObjDesc, Buffer, Length); - break; - - case INTERNAL_TYPE_BANK_FIELD: - Status = AcpiExAccessBankField (ACPI_WRITE, ObjDesc, Buffer, Length); - break; - - case INTERNAL_TYPE_INDEX_FIELD: - Status = AcpiExAccessIndexField (ACPI_WRITE, ObjDesc, Buffer, Length); - break; - - default: - return_ACPI_STATUS (AE_AML_INTERNAL); - } - - - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiExAccessBufferField - * - * PARAMETERS: Mode - ACPI_READ or ACPI_WRITE - * *FieldNode - Parent node for field to be accessed - * *Buffer - Value(s) to be read or written - * BufferLength - Number of bytes to transfer - * - * RETURN: Status - * - * DESCRIPTION: Read or write a named field - * - ******************************************************************************/ - -ACPI_STATUS -AcpiExAccessBufferField ( - UINT32 Mode, - ACPI_OPERAND_OBJECT *ObjDesc, - void *Buffer, - UINT32 BufferLength) -{ - ACPI_STATUS Status; - - - FUNCTION_TRACE_PTR ("ExAccessBufferField", ObjDesc); - - - /* - * If the BufferField arguments have not been previously evaluated, - * evaluate them now and save the results. - */ - if (!(ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)) - { - Status = AcpiDsGetBufferFieldArguments (ObjDesc); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - } - - - Status = AcpiExCommonAccessField (Mode, ObjDesc, Buffer, BufferLength); - - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiExAccessRegionField - * - * PARAMETERS: Mode - ACPI_READ or ACPI_WRITE - * *FieldNode - Parent node for field to be accessed - * *Buffer - Value(s) to be read or written - * BufferLength - Number of bytes to transfer - * - * RETURN: Status - * - * DESCRIPTION: Read or write a named field - * - ******************************************************************************/ - -ACPI_STATUS -AcpiExAccessRegionField ( - UINT32 Mode, - ACPI_OPERAND_OBJECT *ObjDesc, - void *Buffer, - UINT32 BufferLength) -{ - ACPI_STATUS Status; - BOOLEAN Locked; - - - FUNCTION_TRACE_PTR ("ExAccessRegionField", ObjDesc); - - - /* - * Get the global lock if needed - */ - Locked = AcpiExAcquireGlobalLock (ObjDesc->Field.LockRule); - - Status = AcpiExCommonAccessField (Mode, ObjDesc, Buffer, BufferLength); - - - /* - * Release global lock if we acquired it earlier - */ - AcpiExReleaseGlobalLock (Locked); - - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiExAccessBankField - * - * PARAMETERS: Mode - ACPI_READ or ACPI_WRITE - * *FieldNode - Parent node for field to be accessed - * *Buffer - Value(s) to be read or written - * BufferLength - Number of bytes to transfer - * - * RETURN: Status - * - * DESCRIPTION: Read or write a Bank Field - * - ******************************************************************************/ - -ACPI_STATUS -AcpiExAccessBankField ( - UINT32 Mode, - ACPI_OPERAND_OBJECT *ObjDesc, - void *Buffer, - UINT32 BufferLength) -{ - ACPI_STATUS Status; - BOOLEAN Locked; - - - FUNCTION_TRACE_PTR ("ExAccessBankField", ObjDesc); - - - /* - * Get the global lock if needed - */ - Locked = AcpiExAcquireGlobalLock (ObjDesc->BankField.LockRule); - - - /* - * Write the BankValue to the BankRegister to select the bank. - * The BankValue for this BankField is specified in the - * BankField ASL declaration. The BankRegister is always a Field in - * an operation region. - */ - Status = AcpiExCommonAccessField (ACPI_WRITE, - ObjDesc->BankField.BankRegisterObj, - &ObjDesc->BankField.Value, - sizeof (ObjDesc->BankField.Value)); - if (ACPI_FAILURE (Status)) - { - goto Cleanup; - } - - /* - * The bank was successfully selected, now read or write the actual - * data. - */ - Status = AcpiExCommonAccessField (Mode, ObjDesc, Buffer, BufferLength); - - -Cleanup: - /* - * Release global lock if we acquired it earlier - */ - AcpiExReleaseGlobalLock (Locked); - - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiExAccessIndexField - * - * PARAMETERS: Mode - ACPI_READ or ACPI_WRITE - * *FieldNode - Parent node for field to be accessed - * *Buffer - Value(s) to be read or written - * BufferLength - Number of bytes to transfer - * - * RETURN: Status - * - * DESCRIPTION: Read or write a Index Field - * - ******************************************************************************/ - -ACPI_STATUS -AcpiExAccessIndexField ( - UINT32 Mode, - ACPI_OPERAND_OBJECT *ObjDesc, - void *Buffer, - UINT32 BufferLength) -{ - ACPI_STATUS Status; - BOOLEAN Locked; - - - FUNCTION_TRACE_PTR ("ExAccessIndexField", ObjDesc); - - - /* - * Get the global lock if needed - */ - Locked = AcpiExAcquireGlobalLock (ObjDesc->IndexField.LockRule); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "Obj=%p Type=%X Buf=%p Len=%X\n", + ObjDesc, ObjDesc->Common.Type, Buffer, Length)); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "FieldRead: BitLen=%X BitOff=%X ByteOff=%X\n", + ObjDesc->CommonField.BitLength, + ObjDesc->CommonField.StartFieldBitOffset, + ObjDesc->CommonField.BaseByteOffset)); + Locked = AcpiExAcquireGlobalLock (ObjDesc->CommonField.LockRule); /* - * Set Index value to select proper Data register + * Write to the field */ - Status = AcpiExCommonAccessField (ACPI_WRITE, - ObjDesc->IndexField.IndexObj, - &ObjDesc->IndexField.Value, - sizeof (ObjDesc->IndexField.Value)); - if (ACPI_FAILURE (Status)) - { - goto Cleanup; - } - - /* Now read/write the data register */ - - Status = AcpiExCommonAccessField (Mode, ObjDesc->IndexField.DataObj, - Buffer, BufferLength); + Status = AcpiExInsertIntoField (ObjDesc, Buffer, Length); -Cleanup: /* * Release global lock if we acquired it earlier */ @@ -569,68 +369,4 @@ return_ACPI_STATUS (Status); } - -/******************************************************************************* - * - * FUNCTION: AcpiExCommonAccessField - * - * PARAMETERS: Mode - ACPI_READ or ACPI_WRITE - * *FieldNode - Parent node for field to be accessed - * *Buffer - Value(s) to be read or written - * BufferLength - Size of buffer, in bytes. Must be large - * enough for all bits of the field. - * - * RETURN: Status - * - * DESCRIPTION: Read or write a named field - * - ******************************************************************************/ - -ACPI_STATUS -AcpiExCommonAccessField ( - UINT32 Mode, - ACPI_OPERAND_OBJECT *ObjDesc, - void *Buffer, - UINT32 BufferLength) -{ - ACPI_STATUS Status; - - - FUNCTION_TRACE_PTR ("ExCommonAccessField", ObjDesc); - - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Obj=%p Type=%X Buf=%p Len=%X\n", - ObjDesc, ObjDesc->Common.Type, Buffer, BufferLength)); - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Mode=%d BitLen=%X BitOff=%X ByteOff=%X\n", - Mode, ObjDesc->CommonField.BitLength, - ObjDesc->CommonField.StartFieldBitOffset, - ObjDesc->CommonField.BaseByteOffset)); - - - /* Perform the actual read or write of the field */ - - switch (Mode) - { - case ACPI_READ: - - Status = AcpiExExtractFromField (ObjDesc, Buffer, BufferLength); - break; - - - case ACPI_WRITE: - - Status = AcpiExInsertIntoField (ObjDesc, Buffer, BufferLength); - break; - - - default: - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown I/O Mode: %X\n", Mode)); - Status = AE_BAD_PARAMETER; - break; - } - - - return_ACPI_STATUS (Status); -} Index: contrib/dev/acpica/exfldio.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/exfldio.c,v retrieving revision 1.8 diff -u -r1.8 exfldio.c --- contrib/dev/acpica/exfldio.c 31 Oct 2001 02:34:45 -0000 1.8 +++ contrib/dev/acpica/exfldio.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: exfldio - Aml Field I/O - * $Revision: 66 $ + * $Revision: 72 $ * *****************************************************************************/ @@ -132,20 +132,21 @@ /******************************************************************************* * - * FUNCTION: AcpiExSetupField + * FUNCTION: AcpiExSetupRegion * - * PARAMETERS: *ObjDesc - Field to be read or written - * FieldDatumByteOffset - Current offset into the field + * PARAMETERS: *ObjDesc - Field to be read or written + * FieldDatumByteOffset - Byte offset of this datum within the + * parent field * * RETURN: Status * * DESCRIPTION: Common processing for AcpiExExtractFromField and - * AcpiExInsertIntoField + * AcpiExInsertIntoField. Initialize the * ******************************************************************************/ ACPI_STATUS -AcpiExSetupField ( +AcpiExSetupRegion ( ACPI_OPERAND_OBJECT *ObjDesc, UINT32 FieldDatumByteOffset) { @@ -153,7 +154,7 @@ ACPI_OPERAND_OBJECT *RgnDesc; - FUNCTION_TRACE_U32 ("ExSetupField", FieldDatumByteOffset); + FUNCTION_TRACE_U32 ("ExSetupRegion", FieldDatumByteOffset); RgnDesc = ObjDesc->CommonField.RegionObj; @@ -184,9 +185,9 @@ * length of one field datum (access width) must fit within the region. * (Region length is specified in bytes) */ - if (RgnDesc->Region.Length < (ObjDesc->CommonField.BaseByteOffset + - FieldDatumByteOffset + - ObjDesc->CommonField.AccessByteWidth)) + if (RgnDesc->Region.Length < (ObjDesc->CommonField.BaseByteOffset + + FieldDatumByteOffset + + ObjDesc->CommonField.AccessByteWidth)) { if (RgnDesc->Region.Length < ObjDesc->CommonField.AccessByteWidth) { @@ -205,7 +206,7 @@ * exceeds region length, indicate an error */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Field base+offset+width %X+%X+%X exceeds region size (%X bytes) field=%p region=%p\n", + "Field Base+Offset+Width %X+%X+%X exceeds region size (%X bytes) field=%p region=%p\n", ObjDesc->CommonField.BaseByteOffset, FieldDatumByteOffset, ObjDesc->CommonField.AccessByteWidth, RgnDesc->Region.Length, ObjDesc, RgnDesc)); @@ -219,121 +220,427 @@ /******************************************************************************* * - * FUNCTION: AcpiExReadFieldDatum + * FUNCTION: AcpiExAccessRegion * - * PARAMETERS: *ObjDesc - Field to be read - * *Value - Where to store value (must be 32 bits) + * PARAMETERS: *ObjDesc - Field to be read + * FieldDatumByteOffset - Byte offset of this datum within the + * parent field + * *Value - Where to store value (must be 32 bits) + * ReadWrite - Read or Write flag * * RETURN: Status * - * DESCRIPTION: Retrieve the value of the given field + * DESCRIPTION: Read or Write a single field datum to an Operation Region. * ******************************************************************************/ ACPI_STATUS -AcpiExReadFieldDatum ( +AcpiExAccessRegion ( ACPI_OPERAND_OBJECT *ObjDesc, UINT32 FieldDatumByteOffset, - UINT32 *Value) + ACPI_INTEGER *Value, + UINT32 ReadWrite) { ACPI_STATUS Status; ACPI_OPERAND_OBJECT *RgnDesc; ACPI_PHYSICAL_ADDRESS Address; - UINT32 LocalValue; - FUNCTION_TRACE_U32 ("ExReadFieldDatum", FieldDatumByteOffset); + FUNCTION_TRACE ("AcpiExAccessRegion"); + + + /* + * The physical address of this field datum is: + * + * 1) The base of the region, plus + * 2) The base offset of the field, plus + * 3) The current offset into the field + */ + RgnDesc = ObjDesc->CommonField.RegionObj; + Address = RgnDesc->Region.Address + + ObjDesc->CommonField.BaseByteOffset + + FieldDatumByteOffset; + + if (ReadWrite == ACPI_READ) + { + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "[READ]")); + } + else + { + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "[WRITE]")); + } + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_BFIELD, + " Region[%s-%X] Width %X Base:Off %X:%X at %8.8X%8.8X\n", + AcpiUtGetRegionName (RgnDesc->Region.SpaceId), + RgnDesc->Region.SpaceId, + ObjDesc->CommonField.AccessBitWidth, + ObjDesc->CommonField.BaseByteOffset, + FieldDatumByteOffset, + HIDWORD (Address), LODWORD (Address))); - if (!Value) + /* Invoke the appropriate AddressSpace/OpRegion handler */ + + Status = AcpiEvAddressSpaceDispatch (RgnDesc, ReadWrite, + Address, ObjDesc->CommonField.AccessBitWidth, Value); + + if (ACPI_FAILURE (Status)) + { + if (Status == AE_NOT_IMPLEMENTED) + { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Region %s(%X) not implemented\n", + AcpiUtGetRegionName (RgnDesc->Region.SpaceId), + RgnDesc->Region.SpaceId)); + } + + else if (Status == AE_NOT_EXIST) + { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Region %s(%X) has no handler\n", + AcpiUtGetRegionName (RgnDesc->Region.SpaceId), + RgnDesc->Region.SpaceId)); + } + } + + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiExRegisterOverflow + * + * PARAMETERS: *ObjDesc - Register(Field) to be written + * Value - Value to be stored + * + * RETURN: TRUE if value overflows the field, FALSE otherwise + * + * DESCRIPTION: Check if a value is out of range of the field being written. + * Used to check if the values written to Index and Bank registers + * are out of range. Normally, the value is simply truncated + * to fit the field, but this case is most likely a serious + * coding error in the ASL. + * + ******************************************************************************/ + +BOOLEAN +AcpiExRegisterOverflow ( + ACPI_OPERAND_OBJECT *ObjDesc, + ACPI_INTEGER Value) +{ + + /* + * Is the Value larger than the maximum value that can fit into + * the field? + */ + if (Value >= (ACPI_INTEGER) (1 << ObjDesc->CommonField.BitLength)) { - LocalValue = 0; - Value = &LocalValue; /* support reads without saving value */ + return (TRUE); } - /* Clear the entire return buffer first, [Very Important!] */ + return (FALSE); +} - *Value = 0; + +/******************************************************************************* + * + * FUNCTION: AcpiExFieldDatumIo + * + * PARAMETERS: *ObjDesc - Field to be read + * FieldDatumByteOffset - Byte offset of this datum within the + * parent field + * *Value - Where to store value (must be 64 bits) + * ReadWrite - Read or Write flag + * + * RETURN: Status + * + * DESCRIPTION: Read or Write a single datum of a field. The FieldType is + * demultiplexed here to handle the different types of fields + * (BufferField, RegionField, IndexField, BankField) + * + ******************************************************************************/ + +ACPI_STATUS +AcpiExFieldDatumIo ( + ACPI_OPERAND_OBJECT *ObjDesc, + UINT32 FieldDatumByteOffset, + ACPI_INTEGER *Value, + UINT32 ReadWrite) +{ + ACPI_STATUS Status; + ACPI_INTEGER LocalValue; + + + FUNCTION_TRACE_U32 ("ExFieldDatumIo", FieldDatumByteOffset); + + + if (ReadWrite == ACPI_READ) + { + if (!Value) + { + LocalValue = 0; + Value = &LocalValue; /* To support reads without saving return value */ + } + + /* Clear the entire return buffer first, [Very Important!] */ + + *Value = 0; + } /* - * BufferFields - Read from a Buffer - * Other Fields - Read from a Operation Region. + * The four types of fields are: + * + * BufferFields - Read/write from/to a Buffer + * RegionFields - Read/write from/to a Operation Region. + * BankFields - Write to a Bank Register, then read/write from/to an OpRegion + * IndexFields - Write to an Index Register, then read/write from/to a Data Register */ switch (ObjDesc->Common.Type) { case ACPI_TYPE_BUFFER_FIELD: - /* - * For BufferFields, we only need to copy the data from the - * source buffer. Length is the field width in bytes. + * If the BufferField arguments have not been previously evaluated, + * evaluate them now and save the results. */ - MEMCPY (Value, (ObjDesc->BufferField.BufferObj)->Buffer.Pointer - + ObjDesc->BufferField.BaseByteOffset + FieldDatumByteOffset, - ObjDesc->CommonField.AccessByteWidth); + if (!(ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)) + { + Status = AcpiDsGetBufferFieldArguments (ObjDesc); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } + + if (ReadWrite == ACPI_READ) + { + /* + * Copy the data from the source buffer. + * Length is the field width in bytes. + */ + MEMCPY (Value, (ObjDesc->BufferField.BufferObj)->Buffer.Pointer + + ObjDesc->BufferField.BaseByteOffset + + FieldDatumByteOffset, + ObjDesc->CommonField.AccessByteWidth); + } + else + { + /* + * Copy the data to the target buffer. + * Length is the field width in bytes. + */ + MEMCPY ((ObjDesc->BufferField.BufferObj)->Buffer.Pointer + + ObjDesc->BufferField.BaseByteOffset + + FieldDatumByteOffset, + Value, ObjDesc->CommonField.AccessByteWidth); + } + Status = AE_OK; break; - case INTERNAL_TYPE_REGION_FIELD: case INTERNAL_TYPE_BANK_FIELD: + /* Ensure that the BankValue is not beyond the capacity of the register */ + + if (AcpiExRegisterOverflow (ObjDesc->BankField.BankObj, + ObjDesc->BankField.Value)) + { + return_ACPI_STATUS (AE_AML_REGISTER_LIMIT); + } + /* - * For other fields, we need to go through an Operation Region - * (Only types that will get here are RegionFields and BankFields) + * For BankFields, we must write the BankValue to the BankRegister + * (itself a RegionField) before we can access the data. */ - Status = AcpiExSetupField (ObjDesc, FieldDatumByteOffset); + Status = AcpiExInsertIntoField (ObjDesc->BankField.BankObj, + &ObjDesc->BankField.Value, + sizeof (ObjDesc->BankField.Value)); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* - * The physical address of this field datum is: - * - * 1) The base of the region, plus - * 2) The base offset of the field, plus - * 3) The current offset into the field + * Now that the Bank has been selected, fall through to the + * RegionField case and write the datum to the Operation Region */ - RgnDesc = ObjDesc->CommonField.RegionObj; - Address = RgnDesc->Region.Address + ObjDesc->CommonField.BaseByteOffset + - FieldDatumByteOffset; - - ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Region %s(%X) width %X base:off %X:%X at %8.8X%8.8X\n", - AcpiUtGetRegionName (RgnDesc->Region.SpaceId), - RgnDesc->Region.SpaceId, ObjDesc->CommonField.AccessBitWidth, - ObjDesc->CommonField.BaseByteOffset, FieldDatumByteOffset, - HIDWORD(Address), LODWORD(Address))); - /* Invoke the appropriate AddressSpace/OpRegion handler */ + /* No break; ! */ - Status = AcpiEvAddressSpaceDispatch (RgnDesc, ACPI_READ_ADR_SPACE, - Address, ObjDesc->CommonField.AccessBitWidth, Value); - if (Status == AE_NOT_IMPLEMENTED) + + case INTERNAL_TYPE_REGION_FIELD: + /* + * For simple RegionFields, we just directly access the owning + * Operation Region. + */ + Status = AcpiExSetupRegion (ObjDesc, FieldDatumByteOffset); + if (ACPI_FAILURE (Status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region %s(%X) not implemented\n", - AcpiUtGetRegionName (RgnDesc->Region.SpaceId), - RgnDesc->Region.SpaceId)); + return_ACPI_STATUS (Status); } - else if (Status == AE_NOT_EXIST) + Status = AcpiExAccessRegion (ObjDesc, FieldDatumByteOffset, Value, + ReadWrite); + break; + + + case INTERNAL_TYPE_INDEX_FIELD: + + + /* Ensure that the IndexValue is not beyond the capacity of the register */ + + if (AcpiExRegisterOverflow (ObjDesc->IndexField.IndexObj, + ObjDesc->IndexField.Value)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region %s(%X) has no handler\n", - AcpiUtGetRegionName (RgnDesc->Region.SpaceId), - RgnDesc->Region.SpaceId)); + return_ACPI_STATUS (AE_AML_REGISTER_LIMIT); + } + + /* Write the index value to the IndexRegister (itself a RegionField) */ + + Status = AcpiExInsertIntoField (ObjDesc->IndexField.IndexObj, + &ObjDesc->IndexField.Value, + sizeof (ObjDesc->IndexField.Value)); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + if (ReadWrite == ACPI_READ) + { + /* Read the datum from the DataRegister */ + + Status = AcpiExExtractFromField (ObjDesc->IndexField.DataObj, + Value, ObjDesc->CommonField.AccessByteWidth); + } + else + { + /* Write the datum to the Data register */ + + Status = AcpiExInsertIntoField (ObjDesc->IndexField.DataObj, + Value, ObjDesc->CommonField.AccessByteWidth); } break; default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p, wrong source type - %s\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p, Wrong object type - %s\n", ObjDesc, AcpiUtGetTypeName (ObjDesc->Common.Type))); Status = AE_AML_INTERNAL; break; } + if (ACPI_SUCCESS (Status)) + { + if (ReadWrite == ACPI_READ) + { + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value Read=%8.8X%8.8X\n", + HIDWORD(*Value), LODWORD(*Value))); + } + else + { + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value Written=%8.8X%8.8X\n", + HIDWORD(*Value), LODWORD(*Value))); + } + } + + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiExWriteWithUpdateRule + * + * PARAMETERS: *ObjDesc - Field to be set + * Value - Value to store + * + * RETURN: Status + * + * DESCRIPTION: Apply the field update rule to a field write + * + ******************************************************************************/ + +ACPI_STATUS +AcpiExWriteWithUpdateRule ( + ACPI_OPERAND_OBJECT *ObjDesc, + ACPI_INTEGER Mask, + ACPI_INTEGER FieldValue, + UINT32 FieldDatumByteOffset) +{ + ACPI_STATUS Status = AE_OK; + ACPI_INTEGER MergedValue; + ACPI_INTEGER CurrentValue; + + + FUNCTION_TRACE_U32 ("ExWriteWithUpdateRule", Mask); + + + /* Start with the new bits */ + + MergedValue = FieldValue; + + /* If the mask is all ones, we don't need to worry about the update rule */ + + if (Mask != ACPI_UINT32_MAX) + { + /* Decode the update rule */ + + switch (ObjDesc->CommonField.UpdateRule) + { + case UPDATE_PRESERVE: + /* + * Check if update rule needs to be applied (not if mask is all + * ones) The left shift drops the bits we want to ignore. + */ + if ((~Mask << (sizeof (Mask) * 8 - + ObjDesc->CommonField.AccessBitWidth)) != 0) + { + /* + * Read the current contents of the byte/word/dword containing + * the field, and merge with the new field value. + */ + Status = AcpiExFieldDatumIo (ObjDesc, FieldDatumByteOffset, + &CurrentValue, ACPI_READ); + MergedValue |= (CurrentValue & ~Mask); + } + break; + + case UPDATE_WRITE_AS_ONES: + + /* Set positions outside the field to all ones */ + + MergedValue |= ~Mask; + break; + + case UPDATE_WRITE_AS_ZEROS: + + /* Set positions outside the field to all zeros */ + + MergedValue &= Mask; + break; + + default: + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "WriteWithUpdateRule: Unknown UpdateRule setting: %x\n", + ObjDesc->CommonField.UpdateRule)); + return_ACPI_STATUS (AE_AML_OPERAND_VALUE); + break; + } + } + + /* Write the merged value */ + + Status = AcpiExFieldDatumIo (ObjDesc, FieldDatumByteOffset, + &MergedValue, ACPI_WRITE); - ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Returned value=%08X \n", *Value)); + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, + "Mask %8.8X%8.8X DatumOffset %X Value %8.8X%8.8X, MergedValue %8.8X%8.8X\n", + HIDWORD(Mask), LODWORD(Mask), + FieldDatumByteOffset, + HIDWORD(FieldValue), LODWORD(FieldValue), + HIDWORD(MergedValue),LODWORD(MergedValue))); return_ACPI_STATUS (Status); } @@ -343,22 +650,22 @@ * * FUNCTION: AcpiExGetBufferDatum * - * PARAMETERS: MergedDatum - Value to store - * Buffer - Receiving buffer - * ByteGranularity - 1/2/4 Granularity of the field + * PARAMETERS: Datum - Where the Datum is returned + * Buffer - Raw field buffer + * ByteGranularity - 1/2/4/8 Granularity of the field * (aka Datum Size) * Offset - Datum offset into the buffer * * RETURN: none * - * DESCRIPTION: Store the merged datum to the buffer according to the + * DESCRIPTION: Get a datum from the buffer according to the buffer field * byte granularity * ******************************************************************************/ -static void +void AcpiExGetBufferDatum( - UINT32 *Datum, + ACPI_INTEGER *Datum, void *Buffer, UINT32 ByteGranularity, UINT32 Offset) @@ -380,6 +687,10 @@ case ACPI_FIELD_DWORD_GRANULARITY: MOVE_UNALIGNED32_TO_32 (Datum, &(((UINT32 *) Buffer) [Offset])); break; + + case ACPI_FIELD_QWORD_GRANULARITY: + MOVE_UNALIGNED64_TO_64 (Datum, &(((UINT64 *) Buffer) [Offset])); + break; } } @@ -390,7 +701,7 @@ * * PARAMETERS: MergedDatum - Value to store * Buffer - Receiving buffer - * ByteGranularity - 1/2/4 Granularity of the field + * ByteGranularity - 1/2/4/8 Granularity of the field * (aka Datum Size) * Offset - Datum offset into the buffer * @@ -401,9 +712,9 @@ * ******************************************************************************/ -static void +void AcpiExSetBufferDatum ( - UINT32 MergedDatum, + ACPI_INTEGER MergedDatum, void *Buffer, UINT32 ByteGranularity, UINT32 Offset) @@ -425,6 +736,10 @@ case ACPI_FIELD_DWORD_GRANULARITY: MOVE_UNALIGNED32_TO_32 (&(((UINT32 *) Buffer)[Offset]), &MergedDatum); break; + + case ACPI_FIELD_QWORD_GRANULARITY: + MOVE_UNALIGNED64_TO_64 (&(((UINT64 *) Buffer)[Offset]), &MergedDatum); + break; } } @@ -451,9 +766,9 @@ ACPI_STATUS Status; UINT32 FieldDatumByteOffset; UINT32 DatumOffset; - UINT32 PreviousRawDatum; - UINT32 ThisRawDatum = 0; - UINT32 MergedDatum = 0; + ACPI_INTEGER PreviousRawDatum; + ACPI_INTEGER ThisRawDatum = 0; + ACPI_INTEGER MergedDatum = 0; UINT32 ByteFieldLength; UINT32 DatumCount; @@ -494,7 +809,8 @@ FieldDatumByteOffset = 0; DatumOffset= 0; - Status = AcpiExReadFieldDatum (ObjDesc, FieldDatumByteOffset, &PreviousRawDatum); + Status = AcpiExFieldDatumIo (ObjDesc, FieldDatumByteOffset, + &PreviousRawDatum, ACPI_READ); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -548,7 +864,8 @@ * Get the next raw datum, it contains some or all bits * of the current field datum */ - Status = AcpiExReadFieldDatum (ObjDesc, FieldDatumByteOffset, &ThisRawDatum); + Status = AcpiExFieldDatumIo (ObjDesc, FieldDatumByteOffset, + &ThisRawDatum, ACPI_READ); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -564,7 +881,6 @@ MergedDatum = PreviousRawDatum; } - else { /* @@ -616,218 +932,6 @@ /******************************************************************************* * - * FUNCTION: AcpiExWriteFieldDatum - * - * PARAMETERS: *ObjDesc - Field to be set - * Value - Value to store - * - * RETURN: Status - * - * DESCRIPTION: Store the value into the given field - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiExWriteFieldDatum ( - ACPI_OPERAND_OBJECT *ObjDesc, - UINT32 FieldDatumByteOffset, - UINT32 Value) -{ - ACPI_STATUS Status = AE_OK; - ACPI_OPERAND_OBJECT *RgnDesc = NULL; - ACPI_PHYSICAL_ADDRESS Address; - - - FUNCTION_TRACE_U32 ("ExWriteFieldDatum", FieldDatumByteOffset); - - - /* - * BufferFields - Read from a Buffer - * Other Fields - Read from a Operation Region. - */ - switch (ObjDesc->Common.Type) - { - case ACPI_TYPE_BUFFER_FIELD: - - /* - * For BufferFields, we only need to copy the data to the - * target buffer. Length is the field width in bytes. - */ - MEMCPY ((ObjDesc->BufferField.BufferObj)->Buffer.Pointer - + ObjDesc->BufferField.BaseByteOffset + FieldDatumByteOffset, - &Value, ObjDesc->CommonField.AccessByteWidth); - Status = AE_OK; - break; - - - case INTERNAL_TYPE_REGION_FIELD: - case INTERNAL_TYPE_BANK_FIELD: - - /* - * For other fields, we need to go through an Operation Region - * (Only types that will get here are RegionFields and BankFields) - */ - Status = AcpiExSetupField (ObjDesc, FieldDatumByteOffset); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* - * The physical address of this field datum is: - * - * 1) The base of the region, plus - * 2) The base offset of the field, plus - * 3) The current offset into the field - */ - RgnDesc = ObjDesc->CommonField.RegionObj; - Address = RgnDesc->Region.Address + - ObjDesc->CommonField.BaseByteOffset + - FieldDatumByteOffset; - - ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, - "Store %X in Region %s(%X) at %8.8X%8.8X width %X\n", - Value, AcpiUtGetRegionName (RgnDesc->Region.SpaceId), - RgnDesc->Region.SpaceId, HIDWORD(Address), LODWORD(Address), - ObjDesc->CommonField.AccessBitWidth)); - - /* Invoke the appropriate AddressSpace/OpRegion handler */ - - Status = AcpiEvAddressSpaceDispatch (RgnDesc, ACPI_WRITE_ADR_SPACE, - Address, ObjDesc->CommonField.AccessBitWidth, &Value); - - if (Status == AE_NOT_IMPLEMENTED) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "**** Region type %s(%X) not implemented\n", - AcpiUtGetRegionName (RgnDesc->Region.SpaceId), - RgnDesc->Region.SpaceId)); - } - - else if (Status == AE_NOT_EXIST) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "**** Region type %s(%X) does not have a handler\n", - AcpiUtGetRegionName (RgnDesc->Region.SpaceId), - RgnDesc->Region.SpaceId)); - } - - break; - - - default: - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p, wrong source type - %s\n", - ObjDesc, AcpiUtGetTypeName (ObjDesc->Common.Type))); - Status = AE_AML_INTERNAL; - break; - } - - - ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value written=%08X \n", Value)); - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiExWriteFieldDatumWithUpdateRule - * - * PARAMETERS: *ObjDesc - Field to be set - * Value - Value to store - * - * RETURN: Status - * - * DESCRIPTION: Apply the field update rule to a field write - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiExWriteFieldDatumWithUpdateRule ( - ACPI_OPERAND_OBJECT *ObjDesc, - UINT32 Mask, - UINT32 FieldValue, - UINT32 FieldDatumByteOffset) -{ - ACPI_STATUS Status = AE_OK; - UINT32 MergedValue; - UINT32 CurrentValue; - - - FUNCTION_TRACE ("ExWriteFieldDatumWithUpdateRule"); - - - /* Start with the new bits */ - - MergedValue = FieldValue; - - /* If the mask is all ones, we don't need to worry about the update rule */ - - if (Mask != ACPI_UINT32_MAX) - { - /* Decode the update rule */ - - switch (ObjDesc->CommonField.UpdateRule) - { - case UPDATE_PRESERVE: - /* - * Check if update rule needs to be applied (not if mask is all - * ones) The left shift drops the bits we want to ignore. - */ - if ((~Mask << (sizeof (Mask) * 8 - - ObjDesc->CommonField.AccessBitWidth)) != 0) - { - /* - * Read the current contents of the byte/word/dword containing - * the field, and merge with the new field value. - */ - Status = AcpiExReadFieldDatum (ObjDesc, FieldDatumByteOffset, - &CurrentValue); - MergedValue |= (CurrentValue & ~Mask); - } - break; - - - case UPDATE_WRITE_AS_ONES: - - /* Set positions outside the field to all ones */ - - MergedValue |= ~Mask; - break; - - - case UPDATE_WRITE_AS_ZEROS: - - /* Set positions outside the field to all zeros */ - - MergedValue &= Mask; - break; - - - default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "WriteWithUpdateRule: Unknown UpdateRule setting: %x\n", - ObjDesc->CommonField.UpdateRule)); - return_ACPI_STATUS (AE_AML_OPERAND_VALUE); - break; - } - } - - - /* Write the merged value */ - - Status = AcpiExWriteFieldDatum (ObjDesc, FieldDatumByteOffset, - MergedValue); - - ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Mask %X DatumOffset %X Value %X, MergedValue %X\n", - Mask, FieldDatumByteOffset, FieldValue, MergedValue)); - - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * * FUNCTION: AcpiExInsertIntoField * * PARAMETERS: *ObjDesc - Field to be set @@ -848,10 +952,10 @@ ACPI_STATUS Status; UINT32 FieldDatumByteOffset; UINT32 DatumOffset; - UINT32 Mask; - UINT32 MergedDatum; - UINT32 PreviousRawDatum; - UINT32 ThisRawDatum; + ACPI_INTEGER Mask; + ACPI_INTEGER MergedDatum; + ACPI_INTEGER PreviousRawDatum; + ACPI_INTEGER ThisRawDatum; UINT32 ByteFieldLength; UINT32 DatumCount; @@ -928,7 +1032,7 @@ /* Apply the update rule (if necessary) and write the datum to the field */ - Status = AcpiExWriteFieldDatumWithUpdateRule (ObjDesc, Mask, MergedDatum, + Status = AcpiExWriteWithUpdateRule (ObjDesc, Mask, MergedDatum, FieldDatumByteOffset); if (ACPI_FAILURE (Status)) { @@ -978,7 +1082,6 @@ (PreviousRawDatum >> ObjDesc->CommonField.DatumValidBits) | (ThisRawDatum << ObjDesc->CommonField.StartFieldBitOffset); } - else { /* Field began aligned on datum boundary */ @@ -1011,21 +1114,20 @@ /* Write the last datum with the update rule */ - Status = AcpiExWriteFieldDatumWithUpdateRule (ObjDesc, Mask, - MergedDatum, FieldDatumByteOffset); + Status = AcpiExWriteWithUpdateRule (ObjDesc, Mask, MergedDatum, + FieldDatumByteOffset); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } } } - else { /* Normal case -- write the completed datum */ - Status = AcpiExWriteFieldDatum (ObjDesc, - FieldDatumByteOffset, MergedDatum); + Status = AcpiExFieldDatumIo (ObjDesc, FieldDatumByteOffset, + &MergedDatum, ACPI_WRITE); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); Index: contrib/dev/acpica/exmisc.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/exmisc.c,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 exmisc.c --- contrib/dev/acpica/exmisc.c 31 Oct 2001 02:32:28 -0000 1.1.1.10 +++ contrib/dev/acpica/exmisc.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes - * $Revision: 92 $ + * $Revision: 94 $ * *****************************************************************************/ @@ -129,7 +129,6 @@ MODULE_NAME ("exmisc") - /******************************************************************************* * * FUNCTION: AcpiExGetObjectReference @@ -174,8 +173,9 @@ case AML_LOCAL_OP: case AML_ARG_OP: - *ReturnDesc = (void *) AcpiDsMethodDataGetNode (ObjDesc->Reference.Opcode, - ObjDesc->Reference.Offset, WalkState); + Status = AcpiDsMethodDataGetNode (ObjDesc->Reference.Opcode, + ObjDesc->Reference.Offset, WalkState, + (ACPI_NAMESPACE_NODE **) ReturnDesc); break; default: @@ -473,7 +473,6 @@ } - /******************************************************************************* * * FUNCTION: AcpiExDoLogicalOp @@ -553,7 +552,5 @@ return (FALSE); } - - Index: contrib/dev/acpica/exoparg1.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/exoparg1.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 exoparg1.c --- contrib/dev/acpica/exoparg1.c 31 Oct 2001 02:32:28 -0000 1.1.1.1 +++ contrib/dev/acpica/exoparg1.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exoparg1 - AML execution - opcodes with 1 argument - * $Revision: 120 $ + * $Revision: 121 $ * *****************************************************************************/ @@ -138,21 +138,20 @@ * * AcpiExOpcode_xA_yT_zR * - * Where: + * Where: * - * xA - ARGUMENTS: The number of arguments (input operands) that are + * xA - ARGUMENTS: The number of arguments (input operands) that are * required for this opcode type (1 through 6 args). - * yT - TARGETS: The number of targets (output operands) that are required + * yT - TARGETS: The number of targets (output operands) that are required * for this opcode type (0, 1, or 2 targets). - * zR - RETURN VALUE: Indicates whether this opcode type returns a value + * zR - RETURN VALUE: Indicates whether this opcode type returns a value * as the function return (0 or 1). * - * The AcpiExOpcode* functions are called via the Dispatcher component with + * The AcpiExOpcode* functions are called via the Dispatcher component with * fully resolved operands. !*/ - /******************************************************************************* * * FUNCTION: AcpiExOpcode_1A_0T_0R @@ -179,7 +178,7 @@ /* Examine the opcode */ - switch (WalkState->Opcode) + switch (WalkState->Opcode) { case AML_RELEASE_OP: /* Release (MutexObject) */ @@ -567,7 +566,7 @@ /* - * Store the return value computed above into the target object + * Store the return value computed above into the target object */ Status = AcpiExStore (ReturnDesc, Operand[1], WalkState); @@ -614,7 +613,6 @@ FUNCTION_TRACE_STR ("ExOpcode_1A_0T_0R", AcpiPsGetOpcodeName (WalkState->Opcode)); - /* Get the operand and decode the opcode */ switch (WalkState->Opcode) @@ -661,9 +659,9 @@ goto Cleanup; } - /* + /* * ReturnDesc is now guaranteed to be an Integer object - * Do the actual increment or decrement + * Do the actual increment or decrement */ if (AML_INCREMENT_OP == WalkState->Opcode) { Index: contrib/dev/acpica/exoparg2.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/exoparg2.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 exoparg2.c --- contrib/dev/acpica/exoparg2.c 31 Oct 2001 02:32:28 -0000 1.1.1.1 +++ contrib/dev/acpica/exoparg2.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: exoparg2 - AML execution - opcodes with 2 arguments - * $Revision: 97 $ + * $Revision: 98 $ * *****************************************************************************/ @@ -139,21 +139,20 @@ * * AcpiExOpcode_xA_yT_zR * - * Where: + * Where: * - * xA - ARGUMENTS: The number of arguments (input operands) that are + * xA - ARGUMENTS: The number of arguments (input operands) that are * required for this opcode type (1 through 6 args). - * yT - TARGETS: The number of targets (output operands) that are required + * yT - TARGETS: The number of targets (output operands) that are required * for this opcode type (0, 1, or 2 targets). - * zR - RETURN VALUE: Indicates whether this opcode type returns a value + * zR - RETURN VALUE: Indicates whether this opcode type returns a value * as the function return (0 or 1). * - * The AcpiExOpcode* functions are called via the Dispatcher component with + * The AcpiExOpcode* functions are called via the Dispatcher component with * fully resolved operands. !*/ - /******************************************************************************* * * FUNCTION: AcpiExOpcode_2A_0T_0R @@ -378,8 +377,8 @@ goto Cleanup; } - ReturnDesc->Integer.Value = AcpiExDoMathOp (WalkState->Opcode, - Operand[0]->Integer.Value, + ReturnDesc->Integer.Value = AcpiExDoMathOp (WalkState->Opcode, + Operand[0]->Integer.Value, Operand[1]->Integer.Value); goto StoreResultToTarget; } @@ -623,7 +622,7 @@ */ if (WalkState->OpInfo->Flags & AML_LOGICAL) /* LogicalOp (Operand0, Operand1) */ { - LogicalResult = AcpiExDoLogicalOp (WalkState->Opcode, + LogicalResult = AcpiExDoLogicalOp (WalkState->Opcode, Operand[0]->Integer.Value, Operand[1]->Integer.Value); goto StoreLogicalResult; @@ -664,9 +663,9 @@ StoreLogicalResult: - /* + /* * Set return value to according to LogicalResult. logical TRUE (all ones) - * Default is FALSE (zero) + * Default is FALSE (zero) */ if (LogicalResult) { Index: contrib/dev/acpica/exoparg3.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/exoparg3.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 exoparg3.c --- contrib/dev/acpica/exoparg3.c 31 Oct 2001 02:32:28 -0000 1.1.1.1 +++ contrib/dev/acpica/exoparg3.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exoparg3 - AML execution - opcodes with 3 arguments - * $Revision: 3 $ + * $Revision: 5 $ * *****************************************************************************/ @@ -137,21 +137,20 @@ * * AcpiExOpcode_xA_yT_zR * - * Where: + * Where: * - * xA - ARGUMENTS: The number of arguments (input operands) that are + * xA - ARGUMENTS: The number of arguments (input operands) that are * required for this opcode type (1 through 6 args). - * yT - TARGETS: The number of targets (output operands) that are required + * yT - TARGETS: The number of targets (output operands) that are required * for this opcode type (0, 1, or 2 targets). - * zR - RETURN VALUE: Indicates whether this opcode type returns a value + * zR - RETURN VALUE: Indicates whether this opcode type returns a value * as the function return (0 or 1). * - * The AcpiExOpcode* functions are called via the Dispatcher component with + * The AcpiExOpcode* functions are called via the Dispatcher component with * fully resolved operands. !*/ - /******************************************************************************* * * FUNCTION: AcpiExOpcode_3A_0T_0R @@ -216,7 +215,6 @@ } - Cleanup: return_ACPI_STATUS (Status); @@ -250,12 +248,11 @@ FUNCTION_TRACE_STR ("ExOpcode_3A_1T_1R", AcpiPsGetOpcodeName (WalkState->Opcode)); - switch (WalkState->Opcode) { case AML_MID_OP: /* Mid (Source[0], Index[1], Length[2], Result[3]) */ - /* + /* * Create the return object. The Source operand is guaranteed to be * either a String or a Buffer, so just use its type. */ @@ -291,7 +288,8 @@ Buffer = ACPI_MEM_CALLOCATE (Length + 1); if (!Buffer) { - return (AE_NO_MEMORY); + Status = AE_NO_MEMORY; + goto Cleanup; } /* Copy the portion requested */ @@ -304,7 +302,7 @@ ReturnDesc->String.Pointer = Buffer; ReturnDesc->String.Length = Length; } - + break; @@ -335,7 +333,5 @@ WalkState->ResultObj = ReturnDesc; return_ACPI_STATUS (Status); } - - Index: contrib/dev/acpica/exoparg6.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/exoparg6.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 exoparg6.c --- contrib/dev/acpica/exoparg6.c 31 Oct 2001 02:32:28 -0000 1.1.1.1 +++ contrib/dev/acpica/exoparg6.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exoparg6 - AML execution - opcodes with 6 arguments - * $Revision: 4 $ + * $Revision: 5 $ * *****************************************************************************/ @@ -128,7 +128,6 @@ MODULE_NAME ("exoparg6") - /*! * Naming convention for AML interpreter execution routines. * @@ -138,21 +137,20 @@ * * AcpiExOpcode_xA_yT_zR * - * Where: + * Where: * - * xA - ARGUMENTS: The number of arguments (input operands) that are + * xA - ARGUMENTS: The number of arguments (input operands) that are * required for this opcode type (1 through 6 args). - * yT - TARGETS: The number of targets (output operands) that are required + * yT - TARGETS: The number of targets (output operands) that are required * for this opcode type (0, 1, or 2 targets). - * zR - RETURN VALUE: Indicates whether this opcode type returns a value + * zR - RETURN VALUE: Indicates whether this opcode type returns a value * as the function return (0 or 1). * - * The AcpiExOpcode* functions are called via the Dispatcher component with + * The AcpiExOpcode* functions are called via the Dispatcher component with * fully resolved operands. !*/ - /******************************************************************************* * * FUNCTION: AcpiExDoMatch @@ -264,9 +262,9 @@ switch (WalkState->Opcode) { - case AML_MATCH_OP: - /* - * Match (SearchPackage[0], MatchOp1[1], MatchObject1[2], + case AML_MATCH_OP: + /* + * Match (SearchPackage[0], MatchOp1[1], MatchObject1[2], * MatchOp2[3], MatchObject2[4], StartIndex[5]) */ @@ -331,14 +329,14 @@ * "continue" (proceed to next iteration of enclosing * "for" loop) signifies a non-match. */ - if (!AcpiExDoMatch ((UINT32) Operand[1]->Integer.Value, + if (!AcpiExDoMatch ((UINT32) Operand[1]->Integer.Value, ThisElement->Integer.Value, Operand[2]->Integer.Value)) { continue; } - if (!AcpiExDoMatch ((UINT32) Operand[3]->Integer.Value, + if (!AcpiExDoMatch ((UINT32) Operand[3]->Integer.Value, ThisElement->Integer.Value, Operand[4]->Integer.Value)) { continue; Index: contrib/dev/acpica/exprep.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/exprep.c,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 exprep.c --- contrib/dev/acpica/exprep.c 31 Oct 2001 02:32:28 -0000 1.1.1.11 +++ contrib/dev/acpica/exprep.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities - * $Revision: 99 $ + * $Revision: 104 $ * *****************************************************************************/ @@ -292,7 +292,6 @@ Alignment = 8; } - /* * BaseByteOffset is the address of the start of the field within the region. It is * the byte address of the first *datum* (field-width data unit) of the field. @@ -304,39 +303,34 @@ /* * StartFieldBitOffset is the offset of the first bit of the field within a field datum. - * This is calculated as the number of bits from the BaseByteOffset. In other words, - * the start of the field is relative to a byte address, regardless of the access type - * of the field. */ - ObjDesc->CommonField.StartFieldBitOffset = (UINT8) (MOD_8 (FieldBitPosition)); - - /* - * DatumValidBits is the number of valid field bits in the first field datum. - */ - ObjDesc->CommonField.DatumValidBits = (UINT8) (AccessBitWidth - - ObjDesc->CommonField.StartFieldBitOffset); + ObjDesc->CommonField.StartFieldBitOffset = (UINT8) (FieldBitPosition % AccessBitWidth); /* * Valid bits -- the number of bits that compose a partial datum, * 1) At the end of the field within the region (arbitrary starting bit offset) * 2) At the end of a buffer used to contain the field (starting offset always zero) */ - ObjDesc->CommonField.EndFieldValidBits = (UINT8) ((ObjDesc->CommonField.StartFieldBitOffset + - FieldBitLength) % AccessBitWidth); + ObjDesc->CommonField.EndFieldValidBits = (UINT8) ((ObjDesc->CommonField.StartFieldBitOffset + FieldBitLength) % + AccessBitWidth); ObjDesc->CommonField.EndBufferValidBits = (UINT8) (FieldBitLength % AccessBitWidth); /* StartBufferBitOffset always = 0 */ + /* + * DatumValidBits is the number of valid field bits in the first field datum. + */ + ObjDesc->CommonField.DatumValidBits = (UINT8) (AccessBitWidth - + ObjDesc->CommonField.StartFieldBitOffset); /* - * Does the entire field fit within a single field access element - * (datum)? (without crossing a datum boundary) + * Does the entire field fit within a single field access element? (datum) + * (i.e., without crossing a datum boundary) */ - if ((ObjDesc->CommonField.StartFieldBitOffset + ObjDesc->CommonField.BitLength) <= - (UINT16) ObjDesc->CommonField.AccessBitWidth) + if ((ObjDesc->CommonField.StartFieldBitOffset + FieldBitLength) <= + (UINT16) AccessBitWidth) { ObjDesc->CommonField.AccessFlags |= AFIELD_SINGLE_DATUM; } - return_ACPI_STATUS (AE_OK); } @@ -390,7 +384,7 @@ } } - /* Allocate a new region object */ + /* Allocate a new field object */ ObjDesc = AcpiUtCreateInternalObject (Info->FieldType); if (!ObjDesc) @@ -400,8 +394,9 @@ /* Initialize areas of the object that are common to all fields */ + ObjDesc->CommonField.Node = Info->FieldNode; Status = AcpiExPrepCommonFieldObject (ObjDesc, Info->FieldFlags, - Info->FieldBitPosition, Info->FieldBitLength); + Info->FieldBitPosition, Info->FieldBitLength); if (ACPI_FAILURE (Status)) { AcpiUtDeleteObjectDesc (ObjDesc); @@ -428,19 +423,19 @@ case INTERNAL_TYPE_BANK_FIELD: - ObjDesc->BankField.Value = Info->BankValue; - ObjDesc->BankField.RegionObj = AcpiNsGetAttachedObject (Info->RegionNode); - ObjDesc->BankField.BankRegisterObj = AcpiNsGetAttachedObject (Info->RegisterNode); + ObjDesc->BankField.Value = Info->BankValue; + ObjDesc->BankField.RegionObj = AcpiNsGetAttachedObject (Info->RegionNode); + ObjDesc->BankField.BankObj = AcpiNsGetAttachedObject (Info->RegisterNode); /* An additional reference for the attached objects */ AcpiUtAddReference (ObjDesc->BankField.RegionObj); - AcpiUtAddReference (ObjDesc->BankField.BankRegisterObj); + AcpiUtAddReference (ObjDesc->BankField.BankObj); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Bank Field: BitOff=%X Off=%X Gran=%X Region %p BankReg %p\n", ObjDesc->BankField.StartFieldBitOffset, ObjDesc->BankField.BaseByteOffset, ObjDesc->Field.AccessBitWidth, ObjDesc->BankField.RegionObj, - ObjDesc->BankField.BankRegisterObj)); + ObjDesc->BankField.BankObj)); break; @@ -473,11 +468,11 @@ * Store the constructed descriptor (ObjDesc) into the parent Node, * preserving the current type of that NamedObj. */ - Status = AcpiNsAttachObject (Info->FieldNode, ObjDesc, + Status = AcpiNsAttachObject (Info->FieldNode, ObjDesc, (UINT8) AcpiNsGetType (Info->FieldNode)); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "set NamedObj %p (%4.4s) val = %p\n", - Info->FieldNode, (char*)&(Info->FieldNode->Name), ObjDesc)); + Info->FieldNode, (char*)&(Info->FieldNode->Name), ObjDesc)); /* Remove local reference to the object */ Index: contrib/dev/acpica/exregion.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/exregion.c,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 exregion.c --- contrib/dev/acpica/exregion.c 31 Oct 2001 02:32:28 -0000 1.1.1.11 +++ contrib/dev/acpica/exregion.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exregion - ACPI default OpRegion (address space) handlers - * $Revision: 61 $ + * $Revision: 63 $ * *****************************************************************************/ @@ -153,7 +153,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - UINT32 *Value, + ACPI_INTEGER *Value, void *HandlerContext, void *RegionContext) { @@ -182,6 +182,10 @@ Length = 4; break; + case 64: + Length = 8; + break; + default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid SystemMemory width %d\n", BitWidth)); @@ -247,8 +251,7 @@ switch (Function) { - - case ACPI_READ_ADR_SPACE: + case ACPI_READ: switch (BitWidth) { @@ -263,12 +266,14 @@ case 32: MOVE_UNALIGNED32_TO_32 (Value, LogicalAddrPtr); break; - } + case 64: + MOVE_UNALIGNED64_TO_64 (Value, LogicalAddrPtr); + break; + } break; - - case ACPI_WRITE_ADR_SPACE: + case ACPI_WRITE: switch (BitWidth) { @@ -283,11 +288,13 @@ case 32: MOVE_UNALIGNED32_TO_32 (LogicalAddrPtr, Value); break; - } + case 64: + MOVE_UNALIGNED64_TO_64 (LogicalAddrPtr, Value); + break; + } break; - default: Status = AE_BAD_PARAMETER; break; @@ -320,7 +327,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - UINT32 *Value, + ACPI_INTEGER *Value, void *HandlerContext, void *RegionContext) { @@ -338,20 +345,17 @@ switch (Function) { - - case ACPI_READ_ADR_SPACE: + case ACPI_READ: *Value = 0; Status = AcpiOsReadPort ((ACPI_IO_ADDRESS) Address, Value, BitWidth); break; - - case ACPI_WRITE_ADR_SPACE: + case ACPI_WRITE: Status = AcpiOsWritePort ((ACPI_IO_ADDRESS) Address, *Value, BitWidth); break; - default: Status = AE_BAD_PARAMETER; break; @@ -384,7 +388,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - UINT32 *Value, + ACPI_INTEGER *Value, void *HandlerContext, void *RegionContext) { @@ -397,7 +401,7 @@ /* - * The arguments to AcpiOs(Read|Write)PciCfg(Byte|Word|Dword) are: + * The arguments to AcpiOs(Read|Write)PciConfiguration are: * * PciSegment is the PCI bus segment range 0-31 * PciBus is the PCI bus number range 0-255 @@ -418,20 +422,17 @@ switch (Function) { - - case ACPI_READ_ADR_SPACE: + case ACPI_READ: *Value = 0; Status = AcpiOsReadPciConfiguration (PciId, PciRegister, Value, BitWidth); break; - - case ACPI_WRITE_ADR_SPACE: + case ACPI_WRITE: Status = AcpiOsWritePciConfiguration (PciId, PciRegister, *Value, BitWidth); break; - default: Status = AE_BAD_PARAMETER; @@ -465,7 +466,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - UINT32 *Value, + ACPI_INTEGER *Value, void *HandlerContext, void *RegionContext) { @@ -502,7 +503,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - UINT32 *Value, + ACPI_INTEGER *Value, void *HandlerContext, void *RegionContext) { Index: contrib/dev/acpica/exresnte.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/exresnte.c,v retrieving revision 1.1.1.9 diff -u -r1.1.1.9 exresnte.c --- contrib/dev/acpica/exresnte.c 31 Oct 2001 02:32:28 -0000 1.1.1.9 +++ contrib/dev/acpica/exresnte.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exresnte - AML Interpreter object resolution - * $Revision: 43 $ + * $Revision: 45 $ * *****************************************************************************/ @@ -178,14 +178,13 @@ * The stack pointer points to a ACPI_NAMESPACE_NODE (Node). Get the * object that is attached to the Node. */ - Node = *ObjectPtr; - SourceDesc = AcpiNsGetAttachedObject (Node); - EntryType = AcpiNsGetType ((ACPI_HANDLE) Node); + Node = *ObjectPtr; + SourceDesc = AcpiNsGetAttachedObject (Node); + EntryType = AcpiNsGetType ((ACPI_HANDLE) Node); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p SourceDesc=%p Type=%X\n", Node, SourceDesc, EntryType)); - /* * Several object types require no further processing: * 1) Devices rarely have an attached object, return the Node @@ -210,7 +209,6 @@ */ switch (EntryType) { - case ACPI_TYPE_PACKAGE: if (ACPI_TYPE_PACKAGE != SourceDesc->Common.Type) @@ -286,7 +284,6 @@ Status = AcpiExReadDataFromField (SourceDesc, &ObjDesc); break; - /* * For these objects, just return the object attached to the Node */ @@ -363,7 +360,7 @@ ObjDesc->Integer.Value = TempVal; - /* + /* * Truncate value if we are executing from a 32-bit ACPI table * AND actually executing AML code. If we are resolving * an object in the namespace via an external call to the Index: contrib/dev/acpica/exresolv.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/exresolv.c,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 exresolv.c --- contrib/dev/acpica/exresolv.c 31 Oct 2001 02:32:28 -0000 1.1.1.10 +++ contrib/dev/acpica/exresolv.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exresolv - AML Interpreter object resolution - * $Revision: 101 $ + * $Revision: 102 $ * *****************************************************************************/ @@ -439,7 +439,7 @@ break; } - /* + /* * Remove a reference from the original reference object * and put the new object in its place */ Index: contrib/dev/acpica/exstore.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/exstore.c,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 exstore.c --- contrib/dev/acpica/exstore.c 31 Oct 2001 02:32:28 -0000 1.1.1.11 +++ contrib/dev/acpica/exstore.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exstore - AML Interpreter object store support - * $Revision: 150 $ + * $Revision: 151 $ * *****************************************************************************/ @@ -137,7 +137,7 @@ * PARAMETERS: *SourceDesc - Value to be stored * *DestDesc - Where to store it. Must be an NS node * or an ACPI_OPERAND_OBJECT of type - * Reference; + * Reference; * * RETURN: Status * Index: contrib/dev/acpica/exutils.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/exutils.c,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 exutils.c --- contrib/dev/acpica/exutils.c 4 Oct 2001 23:12:12 -0000 1.1.1.11 +++ contrib/dev/acpica/exutils.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exutils - interpreter/scanner utilities - * $Revision: 85 $ + * $Revision: 86 $ * *****************************************************************************/ @@ -392,8 +392,8 @@ /* * ACPI_INTEGER is unsigned, which is why we don't worry about a '-' */ - for (NumDigits = 1; - (AcpiUtShortDivide (&Value, Base, &Value, NULL)); + for (NumDigits = 1; + (AcpiUtShortDivide (&Value, Base, &Value, NULL)); ++NumDigits) { ; } } Index: contrib/dev/acpica/hwsleep.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/hwsleep.c,v retrieving revision 1.1.1.9 diff -u -r1.1.1.9 hwsleep.c --- contrib/dev/acpica/hwsleep.c 4 Oct 2001 23:12:11 -0000 1.1.1.9 +++ contrib/dev/acpica/hwsleep.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface - * $Revision: 22 $ + * $Revision: 24 $ * *****************************************************************************/ @@ -318,11 +318,8 @@ /* wait until we enter sleep state */ - do - { - AcpiOsStall(10000); - } - while (!AcpiHwRegisterBitAccess (ACPI_READ, ACPI_MTX_LOCK, WAK_STS)); + while (!AcpiHwRegisterBitAccess (ACPI_READ, ACPI_MTX_LOCK, WAK_STS)) + { /* spin until we wake */ } AcpiHwEnableNonWakeupGpes(); Index: contrib/dev/acpica/nsaccess.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/nsaccess.c,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 nsaccess.c --- contrib/dev/acpica/nsaccess.c 31 Oct 2001 02:32:28 -0000 1.1.1.10 +++ contrib/dev/acpica/nsaccess.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: nsaccess - Top-level functions for accessing ACPI namespace - * $Revision: 135 $ + * $Revision: 136 $ * ******************************************************************************/ @@ -365,7 +365,7 @@ if (!AcpiGbl_RootNode) { - return (AE_NO_NAMESPACE); + return_ACPI_STATUS (AE_NO_NAMESPACE); } /* @@ -636,7 +636,7 @@ REPORT_WARNING ( ("NsLookup: %4.4s, type %X, checking for type %X\n", - (char*)&SimpleName, ThisNode->Type, TypeToCheckFor)); + (char *) &SimpleName, ThisNode->Type, TypeToCheckFor)); } /* Index: contrib/dev/acpica/nsdump.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/nsdump.c,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 nsdump.c --- contrib/dev/acpica/nsdump.c 31 Oct 2001 02:32:28 -0000 1.1.1.11 +++ contrib/dev/acpica/nsdump.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: nsdump - table dumping routines for debug - * $Revision: 105 $ + * $Revision: 112 $ * *****************************************************************************/ @@ -127,7 +127,6 @@ #define _COMPONENT ACPI_NAMESPACE MODULE_NAME ("nsdump") - #if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER) /******************************************************************************* @@ -232,6 +231,11 @@ return (AE_OK); } + if (!((ACPI_LV_TABLES & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer))) + { + return (AE_OK); + } + if (!ObjHandle) { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Null object handle\n")); @@ -246,66 +250,58 @@ return (AE_OK); } - /* Indent the object according to the level */ while (LevelTmp--) { - /* Print appropriate characters to form tree structure */ if (LevelTmp) { if (DownstreamSiblingMask & WhichBit) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "|")); + AcpiOsPrintf ("|"); } - else { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " ")); + AcpiOsPrintf (" "); } WhichBit <<= 1; } - else { if (AcpiNsExistDownstreamSibling (ThisNode + 1)) { DownstreamSiblingMask |= (1 << (Level - 1)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "+")); + AcpiOsPrintf ("+"); } - else { DownstreamSiblingMask &= ACPI_UINT32_MAX ^ (1 << (Level - 1)); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "+")); + AcpiOsPrintf ("+"); } if (ThisNode->Child == NULL) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "-")); + AcpiOsPrintf ("-"); } - else if (AcpiNsExistDownstreamSibling (ThisNode->Child)) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "+")); + AcpiOsPrintf ("+"); } - else { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "-")); + AcpiOsPrintf ("-"); } } } - /* Check the integrity of our data */ if (Type > INTERNAL_TYPE_MAX) { - Type = INTERNAL_TYPE_DEF_ANY; /* prints as *ERROR* */ + Type = INTERNAL_TYPE_DEF_ANY; /* prints as *ERROR* */ } if (!AcpiUtValidAcpiName (ThisNode->Name)) @@ -316,8 +312,8 @@ /* * Now we can print out the pertinent information */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " %4.4s %-12s %p", - (char*)&ThisNode->Name, AcpiUtGetTypeName (Type), ThisNode)); + AcpiOsPrintf (" %4.4s %-12s %p", + (char *) &ThisNode->Name, AcpiUtGetTypeName (Type), ThisNode); ObjDesc = ThisNode->Object; @@ -329,116 +325,115 @@ { /* No attached object, we are done */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); + AcpiOsPrintf ("\n"); return (AE_OK); } - switch (Type) { case ACPI_TYPE_PROCESSOR: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " ID %d Addr %.4X Len %.4X\n", + AcpiOsPrintf (" ID %d Addr %.4X Len %.4X\n", ObjDesc->Processor.ProcId, ObjDesc->Processor.Address, - ObjDesc->Processor.Length)); + ObjDesc->Processor.Length); break; case ACPI_TYPE_DEVICE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Notification object: %p", ObjDesc)); + AcpiOsPrintf (" Notification object: %p", ObjDesc); break; case ACPI_TYPE_METHOD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Args %d Len %.4X Aml %p \n", + AcpiOsPrintf (" Args %d Len %.4X Aml %p \n", ObjDesc->Method.ParamCount, ObjDesc->Method.AmlLength, - ObjDesc->Method.AmlStart)); + ObjDesc->Method.AmlStart); break; case ACPI_TYPE_INTEGER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " = %8.8X%8.8X\n", + AcpiOsPrintf (" = %8.8X%8.8X\n", HIDWORD (ObjDesc->Integer.Value), - LODWORD (ObjDesc->Integer.Value))); + LODWORD (ObjDesc->Integer.Value)); break; case ACPI_TYPE_PACKAGE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Elements %.2X\n", - ObjDesc->Package.Count)); + AcpiOsPrintf (" Elements %.2X\n", + ObjDesc->Package.Count); break; case ACPI_TYPE_BUFFER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Len %.2X", - ObjDesc->Buffer.Length)); + AcpiOsPrintf (" Len %.2X", + ObjDesc->Buffer.Length); /* Dump some of the buffer */ if (ObjDesc->Buffer.Length > 0) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " =")); + AcpiOsPrintf (" ="); for (i = 0; (i < ObjDesc->Buffer.Length && i < 12); i++) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " %.2X", - ObjDesc->Buffer.Pointer[i])); + AcpiOsPrintf (" %.2X", ObjDesc->Buffer.Pointer[i]); } } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); + AcpiOsPrintf ("\n"); break; case ACPI_TYPE_STRING: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Len %.2X", - ObjDesc->String.Length)); - + AcpiOsPrintf (" Len %.2X", ObjDesc->String.Length); + if (ObjDesc->String.Length > 0) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " = \"%.32s\"...", - ObjDesc->String.Pointer)); + AcpiOsPrintf (" = \"%.32s\"...", ObjDesc->String.Pointer); } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); + AcpiOsPrintf ("\n"); break; case ACPI_TYPE_REGION: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " [%s]", - AcpiUtGetRegionName (ObjDesc->Region.SpaceId))); + AcpiOsPrintf (" [%s]", AcpiUtGetRegionName (ObjDesc->Region.SpaceId)); if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Addr %8.8X%8.8X Len %.4X\n", + AcpiOsPrintf (" Addr %8.8X%8.8X Len %.4X\n", HIDWORD(ObjDesc->Region.Address), LODWORD(ObjDesc->Region.Address), - ObjDesc->Region.Length)); + ObjDesc->Region.Length); } else { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " [Address/Length not evaluated]\n")); + AcpiOsPrintf (" [Address/Length not evaluated]\n"); } break; case INTERNAL_TYPE_REFERENCE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " [%s]\n", - AcpiPsGetOpcodeName (ObjDesc->Reference.Opcode))); + AcpiOsPrintf (" [%s]\n", + AcpiPsGetOpcodeName (ObjDesc->Reference.Opcode)); break; case ACPI_TYPE_BUFFER_FIELD: - - /* TBD: print Buffer name when we can easily get it */ + if (ObjDesc->BufferField.BufferObj) + { + AcpiOsPrintf (" Buf [%4.4s]", + (char *) &ObjDesc->BufferField.BufferObj->Buffer.Node->Name); + } break; case INTERNAL_TYPE_REGION_FIELD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Rgn [%4.4s]", - (char *) &ObjDesc->CommonField.RegionObj->Region.Node->Name)); + AcpiOsPrintf (" Rgn [%4.4s]", + (char *) &ObjDesc->CommonField.RegionObj->Region.Node->Name); break; case INTERNAL_TYPE_BANK_FIELD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Rgn [%4.4s]", - (char *) &ObjDesc->CommonField.RegionObj->Region.Node->Name)); + AcpiOsPrintf (" Rgn [%4.4s] Bnk [%4.4s]", + (char *) &ObjDesc->CommonField.RegionObj->Region.Node->Name, + (char *) &ObjDesc->BankField.BankObj->CommonField.Node->Name); break; case INTERNAL_TYPE_INDEX_FIELD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Rgn [%4.4s]", - (char *) &ObjDesc->IndexField.IndexObj->CommonField.RegionObj->Region.Node->Name)); + AcpiOsPrintf (" Idx [%4.4s] Dat [%4.4s]", + (char *) &ObjDesc->IndexField.IndexObj->CommonField.Node->Name, + (char *) &ObjDesc->IndexField.DataObj->CommonField.Node->Name); break; default: - - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Object %p\n", ObjDesc)); + AcpiOsPrintf (" Object %p\n", ObjDesc); break; } @@ -450,10 +445,11 @@ case INTERNAL_TYPE_REGION_FIELD: case INTERNAL_TYPE_BANK_FIELD: case INTERNAL_TYPE_INDEX_FIELD: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Off %.2X Len %.2X Acc %.2d\n", - (ObjDesc->CommonField.BaseByteOffset * 8) + ObjDesc->CommonField.StartFieldBitOffset, - ObjDesc->CommonField.BitLength, - ObjDesc->CommonField.AccessBitWidth)); + AcpiOsPrintf (" Off %.2X Len %.2X Acc %.2d\n", + (ObjDesc->CommonField.BaseByteOffset * 8) + + ObjDesc->CommonField.StartFieldBitOffset, + ObjDesc->CommonField.BitLength, + ObjDesc->CommonField.AccessBitWidth); break; } @@ -462,64 +458,59 @@ case ACPI_DISPLAY_OBJECTS: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "%p O:%p", - ThisNode, ObjDesc)); + AcpiOsPrintf ("%p O:%p", + ThisNode, ObjDesc); if (!ObjDesc) { /* No attached object, we are done */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); + AcpiOsPrintf ("\n"); return (AE_OK); } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(R%d)", - ObjDesc->Common.ReferenceCount)); + AcpiOsPrintf ("(R%d)", + ObjDesc->Common.ReferenceCount); switch (Type) { - case ACPI_TYPE_METHOD: /* Name is a Method and its AML offset/length are set */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " M:%p-%X\n", - ObjDesc->Method.AmlStart, - ObjDesc->Method.AmlLength)); - + AcpiOsPrintf (" M:%p-%X\n", ObjDesc->Method.AmlStart, + ObjDesc->Method.AmlLength); break; - case ACPI_TYPE_INTEGER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " N:%X%X\n", - HIDWORD(ObjDesc->Integer.Value), - LODWORD(ObjDesc->Integer.Value))); + AcpiOsPrintf (" N:%X%X\n", HIDWORD(ObjDesc->Integer.Value), + LODWORD(ObjDesc->Integer.Value)); break; - case ACPI_TYPE_STRING: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " S:%p-%X\n", - ObjDesc->String.Pointer, - ObjDesc->String.Length)); + AcpiOsPrintf (" S:%p-%X\n", ObjDesc->String.Pointer, + ObjDesc->String.Length); break; - case ACPI_TYPE_BUFFER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " B:%p-%X\n", - ObjDesc->Buffer.Pointer, - ObjDesc->Buffer.Length)); + AcpiOsPrintf (" B:%p-%X\n", ObjDesc->Buffer.Pointer, + ObjDesc->Buffer.Length); break; - default: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); + AcpiOsPrintf ("\n"); break; } break; + + + default: + AcpiOsPrintf ("\n"); + break; } /* If debug turned off, done */ @@ -542,36 +533,33 @@ /* Decode the type of attached object and dump the contents */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Attached Object %p: ", ObjDesc)); + AcpiOsPrintf (" Attached Object %p: ", ObjDesc); if (VALID_DESCRIPTOR_TYPE (ObjDesc, ACPI_DESC_TYPE_NAMED)) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to Node)\n")); + AcpiOsPrintf ("(Ptr to Node)\n"); BytesToDump = sizeof (ACPI_NAMESPACE_NODE); } - else if (VALID_DESCRIPTOR_TYPE (ObjDesc, ACPI_DESC_TYPE_INTERNAL)) { ObjType = ObjDesc->Common.Type; if (ObjType > INTERNAL_TYPE_MAX) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to ACPI Object type %X [UNKNOWN])\n", ObjType)); + AcpiOsPrintf ("(Ptr to ACPI Object type %X [UNKNOWN])\n", ObjType); BytesToDump = 32; } - else { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to ACPI Object type %2.2X [%s])\n", - ObjType, AcpiUtGetTypeName (ObjType))); + AcpiOsPrintf ("(Ptr to ACPI Object type %2.2X [%s])\n", + ObjType, AcpiUtGetTypeName (ObjType)); BytesToDump = sizeof (ACPI_OPERAND_OBJECT); } } - else { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(String or Buffer - not descriptor)\n")); + AcpiOsPrintf ("(String or Buffer - not descriptor)\n"); BytesToDump = 16; } @@ -625,11 +613,11 @@ goto Cleanup; } - ObjType = INTERNAL_TYPE_INVALID; /* Terminate loop after next pass */ + ObjType = INTERNAL_TYPE_INVALID; /* Terminate loop after next pass */ } Cleanup: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); + AcpiOsPrintf ("\n"); return (AE_OK); } @@ -799,7 +787,7 @@ } - AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, MaxDepth, + AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, MaxDepth, ACPI_UINT32_MAX, SearchHandle); return_VOID; } @@ -829,6 +817,7 @@ Info.DebugLevel = DebugLevel; Info.OwnerId = ACPI_UINT32_MAX; + Info.DisplayType = ACPI_DISPLAY_SUMMARY; AcpiNsDumpOneObject (Handle, 1, &Info, NULL); } Index: contrib/dev/acpica/nseval.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/nseval.c,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 nseval.c --- contrib/dev/acpica/nseval.c 31 Oct 2001 02:32:28 -0000 1.1.1.10 +++ contrib/dev/acpica/nseval.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ * * Module Name: nseval - Object evaluation interfaces -- includes control * method lookup and execution. - * $Revision: 102 $ + * $Revision: 103 $ * ******************************************************************************/ @@ -498,7 +498,7 @@ DUMP_PATHNAME (MethodNode, "NsExecuteControlMethod: Executing", ACPI_LV_NAMES, _COMPONENT); - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "At offset %p\n", + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "At offset %p\n", ObjDesc->Method.AmlStart + 1)); Index: contrib/dev/acpica/nsinit.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/nsinit.c,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 nsinit.c --- contrib/dev/acpica/nsinit.c 31 Oct 2001 02:32:28 -0000 1.1.1.11 +++ contrib/dev/acpica/nsinit.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: nsinit - namespace initialization - * $Revision: 33 $ + * $Revision: 34 $ * *****************************************************************************/ @@ -412,7 +412,7 @@ if (!Node) { AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); - return (AE_BAD_PARAMETER); + return_ACPI_STATUS (AE_BAD_PARAMETER); } AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); Index: contrib/dev/acpica/nsload.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/nsload.c,v retrieving revision 1.1.1.9 diff -u -r1.1.1.9 nsload.c --- contrib/dev/acpica/nsload.c 4 Oct 2001 23:12:13 -0000 1.1.1.9 +++ contrib/dev/acpica/nsload.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: nsload - namespace loading/expanding/contracting procedures - * $Revision: 47 $ + * $Revision: 48 $ * *****************************************************************************/ @@ -232,7 +232,7 @@ return_ACPI_STATUS (AE_NO_MEMORY); } - Status = AcpiDsInitAmlWalk (WalkState, ParseRoot, NULL, TableDesc->AmlStart, + Status = AcpiDsInitAmlWalk (WalkState, ParseRoot, NULL, TableDesc->AmlStart, TableDesc->AmlLength, NULL, NULL, PassNumber); if (ACPI_FAILURE (Status)) { @@ -315,7 +315,7 @@ * FUNCTION: AcpiNsLoadTable * * PARAMETERS: TableDesc - Descriptor for table to be loaded - * Node - Owning NS node + * Node - Owning NS node * * RETURN: Status * Index: contrib/dev/acpica/nsnames.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/nsnames.c,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 nsnames.c --- contrib/dev/acpica/nsnames.c 31 Oct 2001 02:32:28 -0000 1.1.1.10 +++ contrib/dev/acpica/nsnames.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: nsnames - Name manipulation and search - * $Revision: 64 $ + * $Revision: 65 $ * ******************************************************************************/ @@ -250,13 +250,6 @@ Size += PATH_SEGMENT_LENGTH; } - /* Special case for size still 0 - no parent for "special" nodes */ - - if (!Size) - { - Size = PATH_SEGMENT_LENGTH; - } - return (Size + 1); } @@ -324,6 +317,13 @@ if (PathLength > UserBufSize) { Status = AE_BUFFER_OVERFLOW; + goto Exit; + } + + if (Size < ACPI_NAME_SIZE) + { + UserBuffer[0] = '\\'; + UserBuffer[1] = 0; goto Exit; } Index: contrib/dev/acpica/nsobject.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/nsobject.c,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 nsobject.c --- contrib/dev/acpica/nsobject.c 31 Oct 2001 02:32:28 -0000 1.1.1.10 +++ contrib/dev/acpica/nsobject.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ * * Module Name: nsobject - Utilities for objects attached to namespace * table entries - * $Revision: 67 $ + * $Revision: 69 $ * ******************************************************************************/ @@ -141,6 +141,8 @@ * DESCRIPTION: Record the given object as the value associated with the * name whose ACPI_HANDLE is passed. If Object is NULL * and Type is ACPI_TYPE_ANY, set the name as having no value. + * Note: Future may require that the Node->Flags field be passed + * as a parameter. * * MUTEX: Assumes namespace is locked * @@ -153,9 +155,7 @@ ACPI_OBJECT_TYPE8 Type) { ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_OPERAND_OBJECT *PreviousObjDesc; - ACPI_OBJECT_TYPE8 ObjType = ACPI_TYPE_ANY; - UINT8 Flags; + ACPI_OBJECT_TYPE8 ObjectType = ACPI_TYPE_ANY; FUNCTION_TRACE ("NsAttachObject"); @@ -164,14 +164,6 @@ /* * Parameter validation */ - if (!AcpiGbl_RootNode) - { - /* Name space not initialized */ - - REPORT_ERROR (("NsAttachObject: Namespace not initialized\n")); - return_ACPI_STATUS (AE_NO_NAMESPACE); - } - if (!Node) { /* Invalid handle */ @@ -206,19 +198,12 @@ return_ACPI_STATUS (AE_OK); } - - /* Get the current flags field of the Node */ - - Flags = Node->Flags; - Flags &= ~ANOBJ_AML_ATTACHMENT; - - /* If null object, we will just install it */ if (!Object) { - ObjDesc = NULL; - ObjType = ACPI_TYPE_ANY; + ObjDesc = NULL; + ObjectType = ACPI_TYPE_ANY; } /* @@ -232,19 +217,10 @@ * Value passed is a name handle and that name has a * non-null value. Use that name's value and type. */ - ObjDesc = ((ACPI_NAMESPACE_NODE *) Object)->Object; - ObjType = ((ACPI_NAMESPACE_NODE *) Object)->Type; - - /* - * Copy appropriate flags - */ - if (((ACPI_NAMESPACE_NODE *) Object)->Flags & ANOBJ_AML_ATTACHMENT) - { - Flags |= ANOBJ_AML_ATTACHMENT; - } + ObjDesc = ((ACPI_NAMESPACE_NODE *) Object)->Object; + ObjectType = ((ACPI_NAMESPACE_NODE *) Object)->Type; } - /* * Otherwise, we will use the parameter object, but we must type * it first @@ -257,72 +233,31 @@ if (ACPI_TYPE_ANY != Type) { - ObjType = Type; + ObjectType = Type; } - else { - /* - * Cannot figure out the type -- set to DefAny which - * will print as an error in the name table dump - */ - if (AcpiDbgLevel > 0) - { - DUMP_PATHNAME (Node, - "NsAttachObject confused: setting bogus type for ", - ACPI_LV_INFO, _COMPONENT); - - if (VALID_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_NAMED)) - { - DUMP_PATHNAME (Object, "name ", ACPI_LV_INFO, _COMPONENT); - } - - else - { - DUMP_PATHNAME (Object, "object ", ACPI_LV_INFO, _COMPONENT); - DUMP_STACK_ENTRY (Object); - } - } - - ObjType = INTERNAL_TYPE_DEF_ANY; + ObjectType = INTERNAL_TYPE_DEF_ANY; } } - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Installing %p into Node %p [%4.4s]\n", ObjDesc, Node, (char*)&Node->Name)); - /* * Must increment the new value's reference count * (if it is an internal object) */ AcpiUtAddReference (ObjDesc); - /* Save the existing object (if any) for deletion later */ + /* Detach an existing attached object if present */ - PreviousObjDesc = Node->Object; + AcpiUtRemoveReference (Node->Object); /* Install the object and set the type, flags */ Node->Object = ObjDesc; - Node->Type = (UINT8) ObjType; - Node->Flags |= Flags; - - - /* - * Delete an existing attached object. - */ - if (PreviousObjDesc) - { - /* One for the attach to the Node */ - - AcpiUtRemoveReference (PreviousObjDesc); - - /* Now delete */ - - AcpiUtRemoveReference (PreviousObjDesc); - } + Node->Type = (UINT8) ObjectType; return_ACPI_STATUS (AE_OK); } @@ -361,9 +296,10 @@ /* Clear the entry in all cases */ Node->Object = NULL; + Node->Type = ACPI_TYPE_ANY; ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object=%p Value=%p Name %4.4s\n", - Node, ObjDesc, (char*)&Node->Name)); + Node, ObjDesc, (char *) &Node->Name)); /* Remove one reference on the object (and all subobjects) */ Index: contrib/dev/acpica/nssearch.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/nssearch.c,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 nssearch.c --- contrib/dev/acpica/nssearch.c 31 Oct 2001 02:32:28 -0000 1.1.1.10 +++ contrib/dev/acpica/nssearch.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: nssearch - Namespace search - * $Revision: 75 $ + * $Revision: 76 $ * ******************************************************************************/ @@ -181,7 +181,6 @@ } #endif - /* * Search for name in this table, which is to say that we must search * for the name among the children of this object @@ -228,7 +227,6 @@ return_ACPI_STATUS (AE_OK); } - /* * The last entry in the list points back to the parent, * so a flag is used to indicate the end-of-list @@ -245,7 +243,6 @@ NextNode = NextNode->Peer; } - /* Searched entire table, not found */ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Name %4.4s (type %X) not found at %p\n", @@ -318,7 +315,6 @@ return_ACPI_STATUS (AE_NOT_FOUND); } - /* Search the parent tree */ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching parent for %4.4s\n", (char*)&TargetName)); @@ -347,7 +343,6 @@ ParentNode = AcpiNsGetParentObject (ParentNode); } - /* Not found in parent tree */ return_ACPI_STATUS (AE_NOT_FOUND); @@ -407,7 +402,6 @@ return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* Name must consist of printable characters */ if (!AcpiUtValidAcpiName (TargetName)) @@ -419,7 +413,6 @@ return_ACPI_STATUS (AE_BAD_CHARACTER); } - /* Try to find the name in the table specified by the caller */ *ReturnNode = ENTRY_NOT_FOUND; @@ -433,7 +426,7 @@ if ((Status == AE_OK) && (Flags & NS_ERROR_IF_FOUND)) { - Status = AE_EXIST; + Status = AE_ALREADY_EXISTS; } /* @@ -443,7 +436,6 @@ return_ACPI_STATUS (Status); } - /* * Not found in the table. If we are NOT performing the * first pass (name entry) of loading the namespace, search @@ -468,7 +460,6 @@ } } - /* * In execute mode, just search, never add names. Exit now. */ @@ -479,7 +470,6 @@ return_ACPI_STATUS (AE_NOT_FOUND); } - /* Create the new named object */ Index: contrib/dev/acpica/nsxfobj.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/nsxfobj.c,v retrieving revision 1.1.1.12 diff -u -r1.1.1.12 nsxfobj.c --- contrib/dev/acpica/nsxfobj.c 31 Oct 2001 02:32:28 -0000 1.1.1.12 +++ contrib/dev/acpica/nsxfobj.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ * * Module Name: nsxfobj - Public interfaces to the ACPI subsystem * ACPI Object oriented interfaces - * $Revision: 95 $ + * $Revision: 97 $ * ******************************************************************************/ @@ -134,7 +134,7 @@ * * PARAMETERS: Handle - Object handle (optional) * *Pathname - Object pathname (optional) - * **ExternalParams - List of parameters to pass to method, + * **ExternalParams - List of parameters to pass to method, * terminated by NULL. May be NULL * if no parameters are being passed. * *ReturnBuffer - Where to put method's return value (if @@ -641,8 +641,8 @@ * must be allowed to make Acpi calls itself. */ AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); - Status = AcpiNsWalkNamespace ((ACPI_OBJECT_TYPE8) Type, StartObject, - MaxDepth, NS_WALK_UNLOCK, UserFunction, Context, + Status = AcpiNsWalkNamespace ((ACPI_OBJECT_TYPE8) Type, StartObject, + MaxDepth, NS_WALK_UNLOCK, UserFunction, Context, ReturnValue); AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); @@ -675,7 +675,8 @@ ACPI_STATUS Status; ACPI_NAMESPACE_NODE *Node; UINT32 Flags; - ACPI_DEVICE_ID DeviceId; + ACPI_DEVICE_ID Hid; + ACPI_DEVICE_ID Cid; ACPI_GET_DEVICES_INFO *Info; @@ -701,16 +702,16 @@ if (!(Flags & 0x01)) { - /* don't return at the device or children of the device if not there */ + /* Don't return at the device or children of the device if not there */ return (AE_CTRL_DEPTH); } /* - * Filter based on device HID + * Filter based on device HID & CID */ if (Info->Hid != NULL) { - Status = AcpiUtExecute_HID (Node, &DeviceId); + Status = AcpiUtExecute_HID (Node, &Hid); if (Status == AE_NOT_FOUND) { return (AE_OK); @@ -721,9 +722,25 @@ return (AE_CTRL_DEPTH); } - if (STRNCMP (DeviceId.Buffer, Info->Hid, sizeof (DeviceId.Buffer)) != 0) + if (STRNCMP (Hid.Buffer, Info->Hid, sizeof (Hid.Buffer)) != 0) { - return (AE_OK); + Status = AcpiUtExecute_CID (Node, &Cid); + if (Status == AE_NOT_FOUND) + { + return (AE_OK); + } + + else if (ACPI_FAILURE (Status)) + { + return (AE_CTRL_DEPTH); + } + + /* TBD: Handle CID packages */ + + if (STRNCMP (Cid.Buffer, Info->Hid, sizeof (Cid.Buffer)) != 0) + { + return (AE_OK); + } } } Index: contrib/dev/acpica/psfind.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/psfind.c,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 psfind.c --- contrib/dev/acpica/psfind.c 31 Oct 2001 02:32:28 -0000 1.1.1.10 +++ contrib/dev/acpica/psfind.c 7 Nov 2001 09:37:36 -0000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: psfind - Parse tree search routine - * $Revision: 30 $ + * $Revision: 31 $ * *****************************************************************************/ @@ -138,7 +138,7 @@ * ******************************************************************************/ -static ACPI_PARSE_OBJECT* +ACPI_PARSE_OBJECT* AcpiPsGetParent ( ACPI_PARSE_OBJECT *Op) { @@ -183,7 +183,7 @@ * ******************************************************************************/ -static ACPI_PARSE_OBJECT * +ACPI_PARSE_OBJECT * AcpiPsFindName ( ACPI_PARSE_OBJECT *Scope, UINT32 Name, @@ -220,14 +220,12 @@ Field = Field->Next; } } - else if (OpInfo->Flags & AML_CREATE) { if (Op->Opcode == AML_CREATE_FIELD_OP) { Field = AcpiPsGetArg (Op, 3); } - else { /* CreateXXXField, check name */ @@ -242,7 +240,6 @@ return (Op); } } - else if ((OpInfo->Flags & AML_NAMED) && (AcpiPsGetName (Op) == Name) && (!Opcode || Op->Opcode == Opcode || Opcode == AML_SCOPE_OP)) @@ -296,17 +293,14 @@ return_PTR (NULL); } - AcpiGbl_PsFindCount++; - /* Handle all prefixes in the name path */ while (AcpiPsIsPrefixChar (GET8 (Path))) { switch (GET8 (Path)) { - case '\\': /* Could just use a global for "root scope" here */ @@ -440,14 +434,12 @@ { ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "[%4.4s] Found in parent tree! Op=%p Opcode=%4.4X\n", (char*)&Name, Op, Op->Opcode)); } - else { ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "[%4.4s] Not found in parent=%p\n", (char*)&Name, Scope)); } } } - else { ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Segment [%4.4s] Not Found in scope %p!\n", (char*)&Name, Scope)); Index: contrib/dev/acpica/psopcode.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/psopcode.c,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 psopcode.c --- contrib/dev/acpica/psopcode.c 31 Oct 2001 02:32:28 -0000 1.1.1.10 +++ contrib/dev/acpica/psopcode.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: psopcode - Parser/Interpreter opcode information table - * $Revision: 49 $ + * $Revision: 53 $ * *****************************************************************************/ @@ -419,7 +419,7 @@ /****************************************************************************** - Opcodes that have associated namespace objects + Opcodes that have associated namespace objects (AML_NSOBJECT flag) AML_SCOPE_OP AML_DEVICE_OP @@ -445,7 +445,7 @@ AML_INT_METHODCALL_OP AML_INT_NAMEPATH_OP - Opcodes that are "namespace" opcodes + Opcodes that are "namespace" opcodes (AML_NSOPCODE flag) AML_SCOPE_OP AML_DEVICE_OP @@ -463,7 +463,7 @@ AML_REGION_OP AML_INT_NAMEDFIELD_OP - Opcodes that have an associated namespace node + Opcodes that have an associated namespace node (AML_NSNODE flag) AML_SCOPE_OP AML_DEVICE_OP @@ -486,7 +486,7 @@ AML_INT_METHODCALL_OP AML_INT_NAMEPATH_OP - Opcodes that define named ACPI objects + Opcodes that define named ACPI objects (AML_NAMED flag) AML_SCOPE_OP AML_DEVICE_OP @@ -501,8 +501,8 @@ AML_REGION_OP AML_INT_NAMEDFIELD_OP - Opcodes that contain executable AML as part of the definition that - must be deferred until needed + Opcodes that contain executable AML as part of the definition that + must be deferred until needed AML_METHOD_OP AML_VAR_PACKAGE_OP @@ -538,145 +538,145 @@ */ -static const ACPI_OPCODE_INFO AmlOpInfo[] = +static const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[] = { /* Index Name Parser Args Interpreter Args Class Type Flags */ -/* 00 */ ACPI_OP ("Zero", ARGP_ZERO_OP, ARGI_ZERO_OP, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), -/* 01 */ ACPI_OP ("One", ARGP_ONE_OP, ARGI_ONE_OP, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), -/* 02 */ ACPI_OP ("Alias", ARGP_ALIAS_OP, ARGI_ALIAS_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), -/* 03 */ ACPI_OP ("Name", ARGP_NAME_OP, ARGI_NAME_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), -/* 04 */ ACPI_OP ("ByteConst", ARGP_BYTE_OP, ARGI_BYTE_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), -/* 05 */ ACPI_OP ("WordConst", ARGP_WORD_OP, ARGI_WORD_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), -/* 06 */ ACPI_OP ("DwordConst", ARGP_DWORD_OP, ARGI_DWORD_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), -/* 07 */ ACPI_OP ("String", ARGP_STRING_OP, ARGI_STRING_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), -/* 08 */ ACPI_OP ("Scope", ARGP_SCOPE_OP, ARGI_SCOPE_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), -/* 09 */ ACPI_OP ("Buffer", ARGP_BUFFER_OP, ARGI_BUFFER_OP, AML_CLASS_ARGUMENT, AML_TYPE_DATA_TERM, AML_HAS_ARGS), -/* 0A */ ACPI_OP ("Package", ARGP_PACKAGE_OP, ARGI_PACKAGE_OP, AML_CLASS_ARGUMENT, AML_TYPE_DATA_TERM, AML_HAS_ARGS), -/* 0B */ ACPI_OP ("Method", ARGP_METHOD_OP, ARGI_METHOD_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER), -/* 0C */ ACPI_OP ("Local0", ARGP_LOCAL0, ARGI_LOCAL0, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), -/* 0D */ ACPI_OP ("Local1", ARGP_LOCAL1, ARGI_LOCAL1, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), -/* 0E */ ACPI_OP ("Local2", ARGP_LOCAL2, ARGI_LOCAL2, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), -/* 0F */ ACPI_OP ("Local3", ARGP_LOCAL3, ARGI_LOCAL3, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), -/* 10 */ ACPI_OP ("Local4", ARGP_LOCAL4, ARGI_LOCAL4, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), -/* 11 */ ACPI_OP ("Local5", ARGP_LOCAL5, ARGI_LOCAL5, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), -/* 12 */ ACPI_OP ("Local6", ARGP_LOCAL6, ARGI_LOCAL6, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), -/* 13 */ ACPI_OP ("Local7", ARGP_LOCAL7, ARGI_LOCAL7, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), -/* 14 */ ACPI_OP ("Arg0", ARGP_ARG0, ARGI_ARG0, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), -/* 15 */ ACPI_OP ("Arg1", ARGP_ARG1, ARGI_ARG1, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), -/* 16 */ ACPI_OP ("Arg2", ARGP_ARG2, ARGI_ARG2, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), -/* 17 */ ACPI_OP ("Arg3", ARGP_ARG3, ARGI_ARG3, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), -/* 18 */ ACPI_OP ("Arg4", ARGP_ARG4, ARGI_ARG4, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), -/* 19 */ ACPI_OP ("Arg5", ARGP_ARG5, ARGI_ARG5, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), -/* 1A */ ACPI_OP ("Arg6", ARGP_ARG6, ARGI_ARG6, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), -/* 1B */ ACPI_OP ("Store", ARGP_STORE_OP, ARGI_STORE_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 1C */ ACPI_OP ("RefOf", ARGP_REF_OF_OP, ARGI_REF_OF_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), -/* 1D */ ACPI_OP ("Add", ARGP_ADD_OP, ARGI_ADD_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 1E */ ACPI_OP ("Concatenate", ARGP_CONCAT_OP, ARGI_CONCAT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R), -/* 1F */ ACPI_OP ("Subtract", ARGP_SUBTRACT_OP, ARGI_SUBTRACT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 20 */ ACPI_OP ("Increment", ARGP_INCREMENT_OP, ARGI_INCREMENT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), -/* 21 */ ACPI_OP ("Decrement", ARGP_DECREMENT_OP, ARGI_DECREMENT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), -/* 22 */ ACPI_OP ("Multiply", ARGP_MULTIPLY_OP, ARGI_MULTIPLY_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 23 */ ACPI_OP ("Divide", ARGP_DIVIDE_OP, ARGI_DIVIDE_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_2T_1R, AML_FLAGS_EXEC_2A_2T_1R), -/* 24 */ ACPI_OP ("ShiftLeft", ARGP_SHIFT_LEFT_OP, ARGI_SHIFT_LEFT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 25 */ ACPI_OP ("ShiftRight", ARGP_SHIFT_RIGHT_OP, ARGI_SHIFT_RIGHT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 26 */ ACPI_OP ("And", ARGP_BIT_AND_OP, ARGI_BIT_AND_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 27 */ ACPI_OP ("NAnd", ARGP_BIT_NAND_OP, ARGI_BIT_NAND_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 28 */ ACPI_OP ("Or", ARGP_BIT_OR_OP, ARGI_BIT_OR_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 29 */ ACPI_OP ("NOr", ARGP_BIT_NOR_OP, ARGI_BIT_NOR_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 2A */ ACPI_OP ("XOr", ARGP_BIT_XOR_OP, ARGI_BIT_XOR_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), -/* 2B */ ACPI_OP ("Not", ARGP_BIT_NOT_OP, ARGI_BIT_NOT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 2C */ ACPI_OP ("FindSetLeftBit", ARGP_FIND_SET_LEFT_BIT_OP, ARGI_FIND_SET_LEFT_BIT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 2D */ ACPI_OP ("FindSetRightBit", ARGP_FIND_SET_RIGHT_BIT_OP,ARGI_FIND_SET_RIGHT_BIT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 2E */ ACPI_OP ("DerefOf", ARGP_DEREF_OF_OP, ARGI_DEREF_OF_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), -/* 2F */ ACPI_OP ("Notify", ARGP_NOTIFY_OP, ARGI_NOTIFY_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_0R, AML_FLAGS_EXEC_2A_0T_0R), -/* 30 */ ACPI_OP ("SizeOf", ARGP_SIZE_OF_OP, ARGI_SIZE_OF_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), -/* 31 */ ACPI_OP ("Index", ARGP_INDEX_OP, ARGI_INDEX_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R), -/* 32 */ ACPI_OP ("Match", ARGP_MATCH_OP, ARGI_MATCH_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R), -/* 33 */ ACPI_OP ("CreateDWordField", ARGP_CREATE_DWORD_FIELD_OP,ARGI_CREATE_DWORD_FIELD_OP, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), -/* 34 */ ACPI_OP ("CreateWordField", ARGP_CREATE_WORD_FIELD_OP, ARGI_CREATE_WORD_FIELD_OP, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), -/* 35 */ ACPI_OP ("CreateByteField", ARGP_CREATE_BYTE_FIELD_OP, ARGI_CREATE_BYTE_FIELD_OP, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), -/* 36 */ ACPI_OP ("CreateBitField", ARGP_CREATE_BIT_FIELD_OP, ARGI_CREATE_BIT_FIELD_OP, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), -/* 37 */ ACPI_OP ("ObjectType", ARGP_TYPE_OP, ARGI_TYPE_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), -/* 38 */ ACPI_OP ("LAnd", ARGP_LAND_OP, ARGI_LAND_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL), -/* 39 */ ACPI_OP ("LOr", ARGP_LOR_OP, ARGI_LOR_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL), -/* 3A */ ACPI_OP ("LNot", ARGP_LNOT_OP, ARGI_LNOT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), -/* 3B */ ACPI_OP ("LEqual", ARGP_LEQUAL_OP, ARGI_LEQUAL_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL), -/* 3C */ ACPI_OP ("LGreater", ARGP_LGREATER_OP, ARGI_LGREATER_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL), -/* 3D */ ACPI_OP ("LLess", ARGP_LLESS_OP, ARGI_LLESS_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL), -/* 3E */ ACPI_OP ("If", ARGP_IF_OP, ARGI_IF_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS), -/* 3F */ ACPI_OP ("Else", ARGP_ELSE_OP, ARGI_ELSE_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS), -/* 40 */ ACPI_OP ("While", ARGP_WHILE_OP, ARGI_WHILE_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS), -/* 41 */ ACPI_OP ("Noop", ARGP_NOOP_OP, ARGI_NOOP_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), -/* 42 */ ACPI_OP ("Return", ARGP_RETURN_OP, ARGI_RETURN_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS), -/* 43 */ ACPI_OP ("Break", ARGP_BREAK_OP, ARGI_BREAK_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), -/* 44 */ ACPI_OP ("BreakPoint", ARGP_BREAK_POINT_OP, ARGI_BREAK_POINT_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), -/* 45 */ ACPI_OP ("Ones", ARGP_ONES_OP, ARGI_ONES_OP, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), +/* 00 */ ACPI_OP ("Zero", ARGP_ZERO_OP, ARGI_ZERO_OP, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), +/* 01 */ ACPI_OP ("One", ARGP_ONE_OP, ARGI_ONE_OP, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), +/* 02 */ ACPI_OP ("Alias", ARGP_ALIAS_OP, ARGI_ALIAS_OP, INTERNAL_TYPE_ALIAS, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), +/* 03 */ ACPI_OP ("Name", ARGP_NAME_OP, ARGI_NAME_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), +/* 04 */ ACPI_OP ("ByteConst", ARGP_BYTE_OP, ARGI_BYTE_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), +/* 05 */ ACPI_OP ("WordConst", ARGP_WORD_OP, ARGI_WORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), +/* 06 */ ACPI_OP ("DwordConst", ARGP_DWORD_OP, ARGI_DWORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), +/* 07 */ ACPI_OP ("String", ARGP_STRING_OP, ARGI_STRING_OP, ACPI_TYPE_STRING, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), +/* 08 */ ACPI_OP ("Scope", ARGP_SCOPE_OP, ARGI_SCOPE_OP, INTERNAL_TYPE_SCOPE, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), +/* 09 */ ACPI_OP ("Buffer", ARGP_BUFFER_OP, ARGI_BUFFER_OP, ACPI_TYPE_BUFFER, AML_CLASS_ARGUMENT, AML_TYPE_DATA_TERM, AML_HAS_ARGS), +/* 0A */ ACPI_OP ("Package", ARGP_PACKAGE_OP, ARGI_PACKAGE_OP, ACPI_TYPE_PACKAGE, AML_CLASS_ARGUMENT, AML_TYPE_DATA_TERM, AML_HAS_ARGS), +/* 0B */ ACPI_OP ("Method", ARGP_METHOD_OP, ARGI_METHOD_OP, ACPI_TYPE_METHOD, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER), +/* 0C */ ACPI_OP ("Local0", ARGP_LOCAL0, ARGI_LOCAL0, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), +/* 0D */ ACPI_OP ("Local1", ARGP_LOCAL1, ARGI_LOCAL1, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), +/* 0E */ ACPI_OP ("Local2", ARGP_LOCAL2, ARGI_LOCAL2, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), +/* 0F */ ACPI_OP ("Local3", ARGP_LOCAL3, ARGI_LOCAL3, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), +/* 10 */ ACPI_OP ("Local4", ARGP_LOCAL4, ARGI_LOCAL4, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), +/* 11 */ ACPI_OP ("Local5", ARGP_LOCAL5, ARGI_LOCAL5, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), +/* 12 */ ACPI_OP ("Local6", ARGP_LOCAL6, ARGI_LOCAL6, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), +/* 13 */ ACPI_OP ("Local7", ARGP_LOCAL7, ARGI_LOCAL7, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LOCAL_VARIABLE, 0), +/* 14 */ ACPI_OP ("Arg0", ARGP_ARG0, ARGI_ARG0, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), +/* 15 */ ACPI_OP ("Arg1", ARGP_ARG1, ARGI_ARG1, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), +/* 16 */ ACPI_OP ("Arg2", ARGP_ARG2, ARGI_ARG2, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), +/* 17 */ ACPI_OP ("Arg3", ARGP_ARG3, ARGI_ARG3, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), +/* 18 */ ACPI_OP ("Arg4", ARGP_ARG4, ARGI_ARG4, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), +/* 19 */ ACPI_OP ("Arg5", ARGP_ARG5, ARGI_ARG5, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), +/* 1A */ ACPI_OP ("Arg6", ARGP_ARG6, ARGI_ARG6, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_METHOD_ARGUMENT, 0), +/* 1B */ ACPI_OP ("Store", ARGP_STORE_OP, ARGI_STORE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), +/* 1C */ ACPI_OP ("RefOf", ARGP_REF_OF_OP, ARGI_REF_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), +/* 1D */ ACPI_OP ("Add", ARGP_ADD_OP, ARGI_ADD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), +/* 1E */ ACPI_OP ("Concatenate", ARGP_CONCAT_OP, ARGI_CONCAT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R), +/* 1F */ ACPI_OP ("Subtract", ARGP_SUBTRACT_OP, ARGI_SUBTRACT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), +/* 20 */ ACPI_OP ("Increment", ARGP_INCREMENT_OP, ARGI_INCREMENT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), +/* 21 */ ACPI_OP ("Decrement", ARGP_DECREMENT_OP, ARGI_DECREMENT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), +/* 22 */ ACPI_OP ("Multiply", ARGP_MULTIPLY_OP, ARGI_MULTIPLY_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), +/* 23 */ ACPI_OP ("Divide", ARGP_DIVIDE_OP, ARGI_DIVIDE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_2T_1R, AML_FLAGS_EXEC_2A_2T_1R), +/* 24 */ ACPI_OP ("ShiftLeft", ARGP_SHIFT_LEFT_OP, ARGI_SHIFT_LEFT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), +/* 25 */ ACPI_OP ("ShiftRight", ARGP_SHIFT_RIGHT_OP, ARGI_SHIFT_RIGHT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), +/* 26 */ ACPI_OP ("And", ARGP_BIT_AND_OP, ARGI_BIT_AND_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), +/* 27 */ ACPI_OP ("NAnd", ARGP_BIT_NAND_OP, ARGI_BIT_NAND_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), +/* 28 */ ACPI_OP ("Or", ARGP_BIT_OR_OP, ARGI_BIT_OR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), +/* 29 */ ACPI_OP ("NOr", ARGP_BIT_NOR_OP, ARGI_BIT_NOR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), +/* 2A */ ACPI_OP ("XOr", ARGP_BIT_XOR_OP, ARGI_BIT_XOR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R | AML_MATH), +/* 2B */ ACPI_OP ("Not", ARGP_BIT_NOT_OP, ARGI_BIT_NOT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), +/* 2C */ ACPI_OP ("FindSetLeftBit", ARGP_FIND_SET_LEFT_BIT_OP, ARGI_FIND_SET_LEFT_BIT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), +/* 2D */ ACPI_OP ("FindSetRightBit", ARGP_FIND_SET_RIGHT_BIT_OP,ARGI_FIND_SET_RIGHT_BIT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), +/* 2E */ ACPI_OP ("DerefOf", ARGP_DEREF_OF_OP, ARGI_DEREF_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), +/* 2F */ ACPI_OP ("Notify", ARGP_NOTIFY_OP, ARGI_NOTIFY_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_0R, AML_FLAGS_EXEC_2A_0T_0R), +/* 30 */ ACPI_OP ("SizeOf", ARGP_SIZE_OF_OP, ARGI_SIZE_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), +/* 31 */ ACPI_OP ("Index", ARGP_INDEX_OP, ARGI_INDEX_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R), +/* 32 */ ACPI_OP ("Match", ARGP_MATCH_OP, ARGI_MATCH_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R), +/* 33 */ ACPI_OP ("CreateDWordField", ARGP_CREATE_DWORD_FIELD_OP,ARGI_CREATE_DWORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), +/* 34 */ ACPI_OP ("CreateWordField", ARGP_CREATE_WORD_FIELD_OP, ARGI_CREATE_WORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), +/* 35 */ ACPI_OP ("CreateByteField", ARGP_CREATE_BYTE_FIELD_OP, ARGI_CREATE_BYTE_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), +/* 36 */ ACPI_OP ("CreateBitField", ARGP_CREATE_BIT_FIELD_OP, ARGI_CREATE_BIT_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), +/* 37 */ ACPI_OP ("ObjectType", ARGP_TYPE_OP, ARGI_TYPE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), +/* 38 */ ACPI_OP ("LAnd", ARGP_LAND_OP, ARGI_LAND_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL), +/* 39 */ ACPI_OP ("LOr", ARGP_LOR_OP, ARGI_LOR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL), +/* 3A */ ACPI_OP ("LNot", ARGP_LNOT_OP, ARGI_LNOT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R), +/* 3B */ ACPI_OP ("LEqual", ARGP_LEQUAL_OP, ARGI_LEQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL), +/* 3C */ ACPI_OP ("LGreater", ARGP_LGREATER_OP, ARGI_LGREATER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL), +/* 3D */ ACPI_OP ("LLess", ARGP_LLESS_OP, ARGI_LLESS_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL), +/* 3E */ ACPI_OP ("If", ARGP_IF_OP, ARGI_IF_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS), +/* 3F */ ACPI_OP ("Else", ARGP_ELSE_OP, ARGI_ELSE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS), +/* 40 */ ACPI_OP ("While", ARGP_WHILE_OP, ARGI_WHILE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS), +/* 41 */ ACPI_OP ("Noop", ARGP_NOOP_OP, ARGI_NOOP_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), +/* 42 */ ACPI_OP ("Return", ARGP_RETURN_OP, ARGI_RETURN_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS), +/* 43 */ ACPI_OP ("Break", ARGP_BREAK_OP, ARGI_BREAK_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), +/* 44 */ ACPI_OP ("BreakPoint", ARGP_BREAK_POINT_OP, ARGI_BREAK_POINT_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), +/* 45 */ ACPI_OP ("Ones", ARGP_ONES_OP, ARGI_ONES_OP, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), /* Prefixed opcodes (Two-byte opcodes with a prefix op) */ -/* 46 */ ACPI_OP ("Mutex", ARGP_MUTEX_OP, ARGI_MUTEX_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), -/* 47 */ ACPI_OP ("Event", ARGP_EVENT_OP, ARGI_EVENT_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED ), -/* 48 */ ACPI_OP ("CondRefOf", ARGP_COND_REF_OF_OP, ARGI_COND_REF_OF_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 49 */ ACPI_OP ("CreateField", ARGP_CREATE_FIELD_OP, ARGI_CREATE_FIELD_OP, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_FIELD | AML_CREATE), -/* 4A */ ACPI_OP ("Load", ARGP_LOAD_OP, ARGI_LOAD_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_0R, AML_FLAGS_EXEC_1A_1T_0R), -/* 4B */ ACPI_OP ("Stall", ARGP_STALL_OP, ARGI_STALL_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), -/* 4C */ ACPI_OP ("Sleep", ARGP_SLEEP_OP, ARGI_SLEEP_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), -/* 4D */ ACPI_OP ("Acquire", ARGP_ACQUIRE_OP, ARGI_ACQUIRE_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R), -/* 4E */ ACPI_OP ("Signal", ARGP_SIGNAL_OP, ARGI_SIGNAL_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), -/* 4F */ ACPI_OP ("Wait", ARGP_WAIT_OP, ARGI_WAIT_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R), -/* 50 */ ACPI_OP ("Reset", ARGP_RESET_OP, ARGI_RESET_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), -/* 51 */ ACPI_OP ("Release", ARGP_RELEASE_OP, ARGI_RELEASE_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), -/* 52 */ ACPI_OP ("FromBCD", ARGP_FROM_BCD_OP, ARGI_FROM_BCD_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 53 */ ACPI_OP ("ToBCD", ARGP_TO_BCD_OP, ARGI_TO_BCD_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 54 */ ACPI_OP ("Unload", ARGP_UNLOAD_OP, ARGI_UNLOAD_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), -/* 55 */ ACPI_OP ("Revision", ARGP_REVISION_OP, ARGI_REVISION_OP, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), -/* 56 */ ACPI_OP ("Debug", ARGP_DEBUG_OP, ARGI_DEBUG_OP, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), -/* 57 */ ACPI_OP ("Fatal", ARGP_FATAL_OP, ARGI_FATAL_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R), -/* 58 */ ACPI_OP ("OpRegion", ARGP_REGION_OP, ARGI_REGION_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER), -/* 59 */ ACPI_OP ("Field", ARGP_FIELD_OP, ARGI_FIELD_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), -/* 5A */ ACPI_OP ("Device", ARGP_DEVICE_OP, ARGI_DEVICE_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), -/* 5B */ ACPI_OP ("Processor", ARGP_PROCESSOR_OP, ARGI_PROCESSOR_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), -/* 5C */ ACPI_OP ("PowerResource", ARGP_POWER_RES_OP, ARGI_POWER_RES_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), -/* 5D */ ACPI_OP ("ThermalZone", ARGP_THERMAL_ZONE_OP, ARGI_THERMAL_ZONE_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), -/* 5E */ ACPI_OP ("IndexField", ARGP_INDEX_FIELD_OP, ARGI_INDEX_FIELD_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), -/* 5F */ ACPI_OP ("BankField", ARGP_BANK_FIELD_OP, ARGI_BANK_FIELD_OP, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), +/* 46 */ ACPI_OP ("Mutex", ARGP_MUTEX_OP, ARGI_MUTEX_OP, ACPI_TYPE_MUTEX, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), +/* 47 */ ACPI_OP ("Event", ARGP_EVENT_OP, ARGI_EVENT_OP, ACPI_TYPE_EVENT, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED ), +/* 48 */ ACPI_OP ("CondRefOf", ARGP_COND_REF_OF_OP, ARGI_COND_REF_OF_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), +/* 49 */ ACPI_OP ("CreateField", ARGP_CREATE_FIELD_OP, ARGI_CREATE_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_FIELD | AML_CREATE), +/* 4A */ ACPI_OP ("Load", ARGP_LOAD_OP, ARGI_LOAD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_0R, AML_FLAGS_EXEC_1A_1T_0R), +/* 4B */ ACPI_OP ("Stall", ARGP_STALL_OP, ARGI_STALL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), +/* 4C */ ACPI_OP ("Sleep", ARGP_SLEEP_OP, ARGI_SLEEP_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), +/* 4D */ ACPI_OP ("Acquire", ARGP_ACQUIRE_OP, ARGI_ACQUIRE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R), +/* 4E */ ACPI_OP ("Signal", ARGP_SIGNAL_OP, ARGI_SIGNAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), +/* 4F */ ACPI_OP ("Wait", ARGP_WAIT_OP, ARGI_WAIT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R), +/* 50 */ ACPI_OP ("Reset", ARGP_RESET_OP, ARGI_RESET_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), +/* 51 */ ACPI_OP ("Release", ARGP_RELEASE_OP, ARGI_RELEASE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), +/* 52 */ ACPI_OP ("FromBCD", ARGP_FROM_BCD_OP, ARGI_FROM_BCD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), +/* 53 */ ACPI_OP ("ToBCD", ARGP_TO_BCD_OP, ARGI_TO_BCD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), +/* 54 */ ACPI_OP ("Unload", ARGP_UNLOAD_OP, ARGI_UNLOAD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R), +/* 55 */ ACPI_OP ("Revision", ARGP_REVISION_OP, ARGI_REVISION_OP, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), +/* 56 */ ACPI_OP ("Debug", ARGP_DEBUG_OP, ARGI_DEBUG_OP, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, 0), +/* 57 */ ACPI_OP ("Fatal", ARGP_FATAL_OP, ARGI_FATAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R), +/* 58 */ ACPI_OP ("OpRegion", ARGP_REGION_OP, ARGI_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER), +/* 59 */ ACPI_OP ("Field", ARGP_FIELD_OP, ARGI_FIELD_OP, INTERNAL_TYPE_FIELD_DEFN,AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), +/* 5A */ ACPI_OP ("Device", ARGP_DEVICE_OP, ARGI_DEVICE_OP, ACPI_TYPE_DEVICE, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), +/* 5B */ ACPI_OP ("Processor", ARGP_PROCESSOR_OP, ARGI_PROCESSOR_OP, ACPI_TYPE_PROCESSOR, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), +/* 5C */ ACPI_OP ("PowerResource", ARGP_POWER_RES_OP, ARGI_POWER_RES_OP, ACPI_TYPE_POWER, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), +/* 5D */ ACPI_OP ("ThermalZone", ARGP_THERMAL_ZONE_OP, ARGI_THERMAL_ZONE_OP, ACPI_TYPE_THERMAL, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED), +/* 5E */ ACPI_OP ("IndexField", ARGP_INDEX_FIELD_OP, ARGI_INDEX_FIELD_OP, INTERNAL_TYPE_INDEX_FIELD_DEFN,AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), +/* 5F */ ACPI_OP ("BankField", ARGP_BANK_FIELD_OP, ARGI_BANK_FIELD_OP, INTERNAL_TYPE_BANK_FIELD_DEFN,AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD), /* Internal opcodes that map to invalid AML opcodes */ -/* 60 */ ACPI_OP ("LNotEqual", ARGP_LNOTEQUAL_OP, ARGI_LNOTEQUAL_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS), -/* 61 */ ACPI_OP ("LLessEqual", ARGP_LLESSEQUAL_OP, ARGI_LLESSEQUAL_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS), -/* 62 */ ACPI_OP ("LGreaterEqual", ARGP_LGREATEREQUAL_OP, ARGI_LGREATEREQUAL_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS), -/* 63 */ ACPI_OP ("[NamePath]", ARGP_NAMEPATH_OP, ARGI_NAMEPATH_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_NSOBJECT | AML_NSNODE ), -/* 64 */ ACPI_OP ("[MethodCall]", ARGP_METHODCALL_OP, ARGI_METHODCALL_OP, AML_CLASS_METHOD_CALL, AML_TYPE_METHOD_CALL, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE), -/* 65 */ ACPI_OP ("[ByteList]", ARGP_BYTELIST_OP, ARGI_BYTELIST_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), -/* 66 */ ACPI_OP ("[ReservedField]", ARGP_RESERVEDFIELD_OP, ARGI_RESERVEDFIELD_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0), -/* 67 */ ACPI_OP ("[NamedField]", ARGP_NAMEDFIELD_OP, ARGI_NAMEDFIELD_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED ), -/* 68 */ ACPI_OP ("[AccessField]", ARGP_ACCESSFIELD_OP, ARGI_ACCESSFIELD_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0), -/* 69 */ ACPI_OP ("[StaticString", ARGP_STATICSTRING_OP, ARGI_STATICSTRING_OP, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0), -/* 6A */ ACPI_OP ("[Return Value]", ARG_NONE, ARG_NONE, AML_CLASS_RETURN_VALUE, AML_TYPE_RETURN, AML_HAS_ARGS | AML_HAS_RETVAL), -/* 6B */ ACPI_OP ("UNKNOWN_OP!", ARG_NONE, ARG_NONE, AML_CLASS_UNKNOWN, AML_TYPE_BOGUS, AML_HAS_ARGS), -/* 6C */ ACPI_OP ("ASCII_ONLY!", ARG_NONE, ARG_NONE, AML_CLASS_ASCII, AML_TYPE_BOGUS, AML_HAS_ARGS), -/* 6D */ ACPI_OP ("PREFIX_ONLY!", ARG_NONE, ARG_NONE, AML_CLASS_PREFIX, AML_TYPE_BOGUS, AML_HAS_ARGS), +/* 60 */ ACPI_OP ("LNotEqual", ARGP_LNOTEQUAL_OP, ARGI_LNOTEQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS), +/* 61 */ ACPI_OP ("LLessEqual", ARGP_LLESSEQUAL_OP, ARGI_LLESSEQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS), +/* 62 */ ACPI_OP ("LGreaterEqual", ARGP_LGREATEREQUAL_OP, ARGI_LGREATEREQUAL_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS), +/* 63 */ ACPI_OP ("[NamePath]", ARGP_NAMEPATH_OP, ARGI_NAMEPATH_OP, INTERNAL_TYPE_REFERENCE, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_NSOBJECT | AML_NSNODE ), +/* 64 */ ACPI_OP ("[MethodCall]", ARGP_METHODCALL_OP, ARGI_METHODCALL_OP, ACPI_TYPE_METHOD, AML_CLASS_METHOD_CALL, AML_TYPE_METHOD_CALL, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE), +/* 65 */ ACPI_OP ("[ByteList]", ARGP_BYTELIST_OP, ARGI_BYTELIST_OP, ACPI_TYPE_ANY, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), +/* 66 */ ACPI_OP ("[ReservedField]", ARGP_RESERVEDFIELD_OP, ARGI_RESERVEDFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0), +/* 67 */ ACPI_OP ("[NamedField]", ARGP_NAMEDFIELD_OP, ARGI_NAMEDFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED ), +/* 68 */ ACPI_OP ("[AccessField]", ARGP_ACCESSFIELD_OP, ARGI_ACCESSFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0), +/* 69 */ ACPI_OP ("[StaticString", ARGP_STATICSTRING_OP, ARGI_STATICSTRING_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0), +/* 6A */ ACPI_OP ("[Return Value]", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_RETURN_VALUE, AML_TYPE_RETURN, AML_HAS_ARGS | AML_HAS_RETVAL), +/* 6B */ ACPI_OP ("UNKNOWN_OP!", ARG_NONE, ARG_NONE, INTERNAL_TYPE_INVALID, AML_CLASS_UNKNOWN, AML_TYPE_BOGUS, AML_HAS_ARGS), +/* 6C */ ACPI_OP ("ASCII_ONLY!", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_ASCII, AML_TYPE_BOGUS, AML_HAS_ARGS), +/* 6D */ ACPI_OP ("PREFIX_ONLY!", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY, AML_CLASS_PREFIX, AML_TYPE_BOGUS, AML_HAS_ARGS), /* ACPI 2.0 opcodes */ -/* 6E */ ACPI_OP ("QwordConst", ARGP_QWORD_OP, ARGI_QWORD_OP, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), -/* 6F */ ACPI_OP ("VarPackage", ARGP_VAR_PACKAGE_OP, ARGI_VAR_PACKAGE_OP, AML_CLASS_ARGUMENT, AML_TYPE_DATA_TERM, AML_HAS_ARGS | AML_DEFER), -/* 70 */ ACPI_OP ("ConcatRes", ARGP_CONCAT_RES_OP, ARGI_CONCAT_RES_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R), -/* 71 */ ACPI_OP ("Mod", ARGP_MOD_OP, ARGI_MOD_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R), -/* 72 */ ACPI_OP ("CreateQWordField", ARGP_CREATE_QWORD_FIELD_OP,ARGI_CREATE_QWORD_FIELD_OP, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), -/* 73 */ ACPI_OP ("ToBuffer", ARGP_TO_BUFFER_OP, ARGI_TO_BUFFER_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 74 */ ACPI_OP ("ToDecimalString", ARGP_TO_DEC_STR_OP, ARGI_TO_DEC_STR_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 75 */ ACPI_OP ("ToHexString", ARGP_TO_HEX_STR_OP, ARGI_TO_HEX_STR_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 76 */ ACPI_OP ("ToInteger", ARGP_TO_INTEGER_OP, ARGI_TO_INTEGER_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 77 */ ACPI_OP ("ToString", ARGP_TO_STRING_OP, ARGI_TO_STRING_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R), -/* 78 */ ACPI_OP ("CopyObject", ARGP_COPY_OP, ARGI_COPY_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), -/* 79 */ ACPI_OP ("Mid", ARGP_MID_OP, ARGI_MID_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_1T_1R, AML_FLAGS_EXEC_3A_1T_1R), -/* 7A */ ACPI_OP ("Continue", ARGP_CONTINUE_OP, ARGI_CONTINUE_OP, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), -/* 7B */ ACPI_OP ("LoadTable", ARGP_LOAD_TABLE_OP, ARGI_LOAD_TABLE_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R), -/* 7C */ ACPI_OP ("DataOpRegion", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), +/* 6E */ ACPI_OP ("QwordConst", ARGP_QWORD_OP, ARGI_QWORD_OP, ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, 0), +/* 6F */ ACPI_OP ("VarPackage", ARGP_VAR_PACKAGE_OP, ARGI_VAR_PACKAGE_OP, ACPI_TYPE_PACKAGE, AML_CLASS_ARGUMENT, AML_TYPE_DATA_TERM, AML_HAS_ARGS | AML_DEFER), +/* 70 */ ACPI_OP ("ConcatRes", ARGP_CONCAT_RES_OP, ARGI_CONCAT_RES_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R), +/* 71 */ ACPI_OP ("Mod", ARGP_MOD_OP, ARGI_MOD_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R), +/* 72 */ ACPI_OP ("CreateQWordField", ARGP_CREATE_QWORD_FIELD_OP,ARGI_CREATE_QWORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE), +/* 73 */ ACPI_OP ("ToBuffer", ARGP_TO_BUFFER_OP, ARGI_TO_BUFFER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), +/* 74 */ ACPI_OP ("ToDecimalString", ARGP_TO_DEC_STR_OP, ARGI_TO_DEC_STR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), +/* 75 */ ACPI_OP ("ToHexString", ARGP_TO_HEX_STR_OP, ARGI_TO_HEX_STR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), +/* 76 */ ACPI_OP ("ToInteger", ARGP_TO_INTEGER_OP, ARGI_TO_INTEGER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), +/* 77 */ ACPI_OP ("ToString", ARGP_TO_STRING_OP, ARGI_TO_STRING_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R, AML_FLAGS_EXEC_2A_1T_1R), +/* 78 */ ACPI_OP ("CopyObject", ARGP_COPY_OP, ARGI_COPY_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), +/* 79 */ ACPI_OP ("Mid", ARGP_MID_OP, ARGI_MID_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_1T_1R, AML_FLAGS_EXEC_3A_1T_1R), +/* 7A */ ACPI_OP ("Continue", ARGP_CONTINUE_OP, ARGI_CONTINUE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), +/* 7B */ ACPI_OP ("LoadTable", ARGP_LOAD_TABLE_OP, ARGI_LOAD_TABLE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R), +/* 7C */ ACPI_OP ("DataOpRegion", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R), }; @@ -685,7 +685,7 @@ * index into the table above */ -static const UINT8 AmlShortOpInfoIndex[256] = +static const UINT8 AcpiGbl_ShortOpIndex[256] = { /* 0 1 2 3 4 5 6 7 */ /* 8 9 A B C D E F */ @@ -724,7 +724,7 @@ }; -static const UINT8 AmlLongOpInfoIndex[NUM_EXTENDED_OPCODE] = +static const UINT8 AcpiGbl_LongOpIndex[NUM_EXTENDED_OPCODE] = { /* 0 1 2 3 4 5 6 7 */ /* 8 9 A B C D E F */ @@ -767,35 +767,19 @@ AcpiPsGetOpcodeInfo ( UINT16 Opcode) { - const ACPI_OPCODE_INFO *OpInfo; - UINT8 UpperOpcode; - UINT8 LowerOpcode; - - PROC_NAME ("PsGetOpcodeInfo"); - /* Split the 16-bit opcode into separate bytes */ - - UpperOpcode = (UINT8) (Opcode >> 8); - LowerOpcode = (UINT8) Opcode; - - /* Default is "unknown opcode" */ - - OpInfo = &AmlOpInfo [_UNK]; - - /* * Detect normal 8-bit opcode or extended 16-bit opcode */ - - switch (UpperOpcode) + switch ((UINT8) (Opcode >> 8)) { case 0: /* Simple (8-bit) opcode: 0-255, can't index beyond table */ - OpInfo = &AmlOpInfo [AmlShortOpInfoIndex [LowerOpcode]]; + return (&AcpiGbl_AmlOpInfo [AcpiGbl_ShortOpIndex [(UINT8) Opcode]]); break; @@ -803,23 +787,22 @@ /* Extended (16-bit, prefix+opcode) opcode */ - if (LowerOpcode <= MAX_EXTENDED_OPCODE) + if (((UINT8) Opcode) <= MAX_EXTENDED_OPCODE) { - OpInfo = &AmlOpInfo [AmlLongOpInfoIndex [LowerOpcode]]; + return (&AcpiGbl_AmlOpInfo [AcpiGbl_LongOpIndex [(UINT8) Opcode]]); + break; } - break; - default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown extended opcode=%X\n", Opcode)); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown extended opcode [%X]\n", Opcode)); break; } - /* Get the Op info pointer for this opcode */ + /* Default is "unknown opcode" */ - return (OpInfo); + return (&AcpiGbl_AmlOpInfo [_UNK]); } Index: contrib/dev/acpica/psparse.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/psparse.c,v retrieving revision 1.12 diff -u -r1.12 psparse.c --- contrib/dev/acpica/psparse.c 31 Oct 2001 02:34:45 -0000 1.12 +++ contrib/dev/acpica/psparse.c 7 Nov 2001 09:42:49 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: psparse - Parser top level AML parse routines - * $Revision: 104 $ + * $Revision: 107 $ * *****************************************************************************/ @@ -152,7 +152,7 @@ * ******************************************************************************/ -static UINT32 +UINT32 AcpiPsGetOpcodeSize ( UINT32 Opcode) { @@ -193,31 +193,15 @@ Aml = ParserState->Aml; Opcode = (UINT16) GET8 (Aml); - Aml++; - - /* - * Original code special cased LNOTEQUAL, LLESSEQUAL, LGREATEREQUAL. - * These opcodes are no longer recognized. Instead, they are broken into - * two opcodes. - * - * - * if (Opcode == AML_EXTOP - * || (Opcode == AML_LNOT - * && (GET8 (Aml) == AML_LEQUAL - * || GET8 (Aml) == AML_LGREATER - * || GET8 (Aml) == AML_LLESS))) - * - * extended Opcode, !=, <=, or >= - */ if (Opcode == AML_EXTOP) { /* Extended opcode */ + Aml++; Opcode = (UINT16) ((Opcode << 8) | GET8 (Aml)); } - return (Opcode); } @@ -289,7 +273,7 @@ * ******************************************************************************/ -static BOOLEAN +BOOLEAN AcpiPsCompleteThisOp ( ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op) @@ -304,8 +288,6 @@ FUNCTION_TRACE_PTR ("PsCompleteThisOp", Op); - - /* Delete this op and the subtree below it if asked to */ if (((WalkState->ParseFlags & ACPI_PARSE_TREE_MASK) == ACPI_PARSE_DELETE_TREE) && @@ -323,23 +305,30 @@ switch (ParentInfo->Class) { - case AML_CLASS_CONTROL: /* IF, ELSE, WHILE only */ + case AML_CLASS_CONTROL: break; - case AML_CLASS_NAMED_OBJECT: /* Scope, method, etc. */ case AML_CLASS_CREATE: /* * These opcodes contain TermArg operands. The current * op must be replace by a placeholder return op */ + ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP); + if (!ReplacementOp) + { + return_VALUE (FALSE); + } + break; + + case AML_CLASS_NAMED_OBJECT: + + /* + * These opcodes contain TermArg operands. The current + * op must be replace by a placeholder return op + */ if ((Op->Parent->Opcode == AML_REGION_OP) || - (Op->Parent->Opcode == AML_CREATE_FIELD_OP) || - (Op->Parent->Opcode == AML_CREATE_BIT_FIELD_OP) || - (Op->Parent->Opcode == AML_CREATE_BYTE_FIELD_OP) || - (Op->Parent->Opcode == AML_CREATE_WORD_FIELD_OP) || - (Op->Parent->Opcode == AML_CREATE_DWORD_FIELD_OP) || - (Op->Parent->Opcode == AML_CREATE_QWORD_FIELD_OP)) + (Op->Parent->Opcode == AML_DATA_REGION_OP)) { ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP); if (!ReplacementOp) @@ -347,7 +336,6 @@ return_VALUE (FALSE); } } - break; default: @@ -404,7 +392,6 @@ Prev = Next; } - } /* Now we can actually delete the subtree rooted at op */ @@ -434,7 +421,7 @@ * ******************************************************************************/ -static ACPI_STATUS +ACPI_STATUS AcpiPsNextParseState ( ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op, @@ -478,6 +465,7 @@ case AE_CTRL_TRUE: + /* * Predicate of an IF was true, and we are at the matching ELSE. * Just close out this package @@ -728,6 +716,7 @@ { continue; } + Status = AcpiPsNextParseState (WalkState, Op, Status); if (Status == AE_CTRL_PENDING) { @@ -744,7 +733,6 @@ AcpiPsAppendArg (Op, PreOp.Value.Arg); AcpiGbl_Depth++; - if (Op->Opcode == AML_REGION_OP) { /* @@ -764,7 +752,6 @@ } } - else { /* Not a named opcode, just allocate Op and append to parent */ @@ -776,7 +763,6 @@ return_ACPI_STATUS (AE_NO_MEMORY); } - if (WalkState->OpInfo->Flags & AML_CREATE) { /* @@ -795,7 +781,7 @@ * Find the object. This will either insert the object into * the namespace or simply look it up */ - WalkState->Op = Op; + WalkState->Op = Op; Status = WalkState->DescendingCallback (WalkState, &Op); Status = AcpiPsNextParseState (WalkState, Op, Status); @@ -827,7 +813,6 @@ WalkState->ArgCount = 0; - if (WalkState->ArgTypes) /* Are there any arguments that must be processed? */ { /* get arguments */ @@ -872,7 +857,6 @@ INCREMENT_ARG_LIST (WalkState->ArgTypes); } - /* For a method, save the length and address of the body */ if (Op->Opcode == AML_METHOD_OP) @@ -960,7 +944,6 @@ CloseThisOp: - /* * Finished one argument of the containing scope */ @@ -973,7 +956,6 @@ Op = NULL; } - switch (Status) { case AE_OK: @@ -1019,8 +1001,8 @@ { AcpiPsCompleteThisOp (WalkState, Op); } - AcpiPsPopScope (ParserState, &Op, &WalkState->ArgTypes, &WalkState->ArgCount); + } while (Op); return_ACPI_STATUS (Status); @@ -1037,9 +1019,8 @@ WalkState->PrevArgTypes = WalkState->ArgTypes; /* - * TEMP: + * TBD: TEMP: */ - return_ACPI_STATUS (Status); break; } @@ -1051,19 +1032,14 @@ AcpiPsPopScope (ParserState, &Op, &WalkState->ArgTypes, &WalkState->ArgCount); ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Popped scope, Op=%p\n", Op)); } - else { Op = NULL; } - } - - - /* ArgCount is non-zero */ - else { + /* ArgCount is non-zero */ /* complex argument, push Op and prepare for argument */ AcpiPsPushScope (ParserState, Op, WalkState->ArgTypes, WalkState->ArgCount); @@ -1308,7 +1284,6 @@ AcpiDsDeleteWalkState (PreviousWalkState); } - /* Normal exit */ Index: contrib/dev/acpica/psscope.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/psscope.c,v retrieving revision 1.1.1.8 diff -u -r1.1.1.8 psscope.c --- contrib/dev/acpica/psscope.c 4 Oct 2001 23:12:12 -0000 1.1.1.8 +++ contrib/dev/acpica/psscope.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: psscope - Parser scope stack management routines - * $Revision: 30 $ + * $Revision: 31 $ * *****************************************************************************/ @@ -239,7 +239,7 @@ Scope = AcpiUtCreateGenericState (); if (!Scope) { - return (AE_NO_MEMORY); + return_ACPI_STATUS (AE_NO_MEMORY); } Index: contrib/dev/acpica/pswalk.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/pswalk.c,v retrieving revision 1.1.1.7 diff -u -r1.1.1.7 pswalk.c --- contrib/dev/acpica/pswalk.c 4 Oct 2001 23:12:12 -0000 1.1.1.7 +++ contrib/dev/acpica/pswalk.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: pswalk - Parser routines to walk parsed op tree(s) - * $Revision: 58 $ + * $Revision: 60 $ * *****************************************************************************/ @@ -173,7 +173,6 @@ return_ACPI_STATUS (AE_OK); } - /* * No more children, this Op is complete. Save Next and Parent * in case the Op object gets deleted by the callback routine @@ -222,7 +221,6 @@ * the tree */ } - else { /* @@ -232,7 +230,6 @@ Parent = Op; } - /* * Look for a sibling of the current Op's parent * Continue moving up the tree until we find a node that has not been @@ -287,9 +284,10 @@ } - /* Got all the way to the top of the tree, we must be done! */ - /* However, the code should have terminated in the loop above */ - + /* + * Got all the way to the top of the tree, we must be done! + * However, the code should have terminated in the loop above + */ WalkState->NextOp = NULL; return_ACPI_STATUS (AE_OK); @@ -311,7 +309,7 @@ * ******************************************************************************/ -static ACPI_STATUS +ACPI_STATUS AcpiPsDeleteCompletedOp ( ACPI_WALK_STATE *WalkState) { @@ -365,10 +363,8 @@ WalkState->DescendingCallback = NULL; WalkState->AscendingCallback = NULL; - WalkState->Origin = SubtreeRoot; WalkState->NextOp = SubtreeRoot; - /* Head downward in the tree */ Index: contrib/dev/acpica/psxface.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/psxface.c,v retrieving revision 1.1.1.9 diff -u -r1.1.1.9 psxface.c --- contrib/dev/acpica/psxface.c 31 Oct 2001 02:32:28 -0000 1.1.1.9 +++ contrib/dev/acpica/psxface.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: psxface - Parser external interfaces - * $Revision: 52 $ + * $Revision: 53 $ * *****************************************************************************/ @@ -220,7 +220,7 @@ return_ACPI_STATUS (AE_NO_MEMORY); } - Status = AcpiDsInitAmlWalk (WalkState, Op, MethodNode, ObjDesc->Method.AmlStart, + Status = AcpiDsInitAmlWalk (WalkState, Op, MethodNode, ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength, NULL, NULL, 1); if (ACPI_FAILURE (Status)) { @@ -263,7 +263,7 @@ return_ACPI_STATUS (AE_NO_MEMORY); } - Status = AcpiDsInitAmlWalk (WalkState, Op, MethodNode, ObjDesc->Method.AmlStart, + Status = AcpiDsInitAmlWalk (WalkState, Op, MethodNode, ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength, Params, ReturnObjDesc, 3); if (ACPI_FAILURE (Status)) { Index: contrib/dev/acpica/tbinstal.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/tbinstal.c,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 tbinstal.c --- contrib/dev/acpica/tbinstal.c 31 Oct 2001 02:32:29 -0000 1.1.1.11 +++ contrib/dev/acpica/tbinstal.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: tbinstal - ACPI table installation and removal - * $Revision: 45 $ + * $Revision: 47 $ * *****************************************************************************/ @@ -321,7 +321,7 @@ */ if (ListHead->Pointer) { - return_ACPI_STATUS (AE_EXIST); + return_ACPI_STATUS (AE_ALREADY_EXISTS); } TableDesc->Count = 1; @@ -657,7 +657,6 @@ NextDesc = TableDesc->Next; ACPI_MEM_FREE (TableDesc); } - return_PTR (NextDesc); Index: contrib/dev/acpica/tbutils.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/tbutils.c,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 tbutils.c --- contrib/dev/acpica/tbutils.c 31 Oct 2001 02:32:29 -0000 1.1.1.10 +++ contrib/dev/acpica/tbutils.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: tbutils - Table manipulation utilities - * $Revision: 42 $ + * $Revision: 43 $ * *****************************************************************************/ @@ -169,87 +169,6 @@ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "TableId=%X does not exist\n", TableId)); return (AE_BAD_PARAMETER); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiTbSystemTablePointer - * - * PARAMETERS: *Where - Pointer to be examined - * - * RETURN: TRUE if Where is within the AML stream (in one of the ACPI - * system tables such as the DSDT or an SSDT.) - * FALSE otherwise - * - ******************************************************************************/ - -BOOLEAN -AcpiTbSystemTablePointer ( - void *Where) -{ - UINT32 i; - ACPI_TABLE_DESC *TableDesc; - ACPI_TABLE_HEADER *Table; - - - /* No function trace, called too often! */ - - - /* Ignore null pointer */ - - if (!Where) - { - return (FALSE); - } - - - /* Check for a pointer within the DSDT */ - - if ((AcpiGbl_DSDT) && - (IS_IN_ACPI_TABLE (Where, AcpiGbl_DSDT))) - { - return (TRUE); - } - - - /* Check each of the loaded SSDTs (if any)*/ - - TableDesc = &AcpiGbl_AcpiTables[ACPI_TABLE_SSDT]; - - for (i = 0; i < AcpiGbl_AcpiTables[ACPI_TABLE_SSDT].Count; i++) - { - Table = TableDesc->Pointer; - - if (IS_IN_ACPI_TABLE (Where, Table)) - { - return (TRUE); - } - - TableDesc = TableDesc->Next; - } - - - /* Check each of the loaded PSDTs (if any)*/ - - TableDesc = &AcpiGbl_AcpiTables[ACPI_TABLE_PSDT]; - - for (i = 0; i < AcpiGbl_AcpiTables[ACPI_TABLE_PSDT].Count; i++) - { - Table = TableDesc->Pointer; - - if (IS_IN_ACPI_TABLE (Where, Table)) - { - return (TRUE); - } - - TableDesc = TableDesc->Next; - } - - - /* Pointer does not point into any system table */ - - return (FALSE); } Index: contrib/dev/acpica/utalloc.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/utalloc.c,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 utalloc.c --- contrib/dev/acpica/utalloc.c 31 Oct 2001 02:32:29 -0000 1.1.1.11 +++ contrib/dev/acpica/utalloc.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: utalloc - local cache and memory allocation routines - * $Revision: 106 $ + * $Revision: 108 $ * *****************************************************************************/ @@ -590,40 +590,30 @@ NATIVE_CHAR *Module) { ACPI_DEBUG_MEM_BLOCK *Element; - UINT32 i; + UINT32 NumOutstanding = 0; FUNCTION_TRACE ("UtDumpAllocations"); - Element = AcpiGbl_MemoryLists[0].ListHead; - if (Element == NULL) - { - ACPI_DEBUG_PRINT ((ACPI_DB_OK, - "No outstanding allocations.\n")); - return_VOID; - } - - /* * Walk the allocation list. */ AcpiUtAcquireMutex (ACPI_MTX_MEMORY); - ACPI_DEBUG_PRINT ((ACPI_DB_OK, - "Outstanding allocations:\n")); - - for (i = 1; ; i++) /* Just a counter */ + Element = AcpiGbl_MemoryLists[0].ListHead; + while (Element) { if ((Element->Component & Component) && ((Module == NULL) || (0 == STRCMP (Module, Element->Module)))) { + /* Ignore allocated objects that are in a cache */ + if (((ACPI_OPERAND_OBJECT *)(&Element->UserSpace))->Common.Type != ACPI_CACHED_OBJECT) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - "%p Len %04X %9.9s-%d", + AcpiOsPrintf ("%p Len %04X %9.9s-%d ", &Element->UserSpace, Element->Size, Element->Module, - Element->Line)); + Element->Line); /* Most of the elements will be internal objects. */ @@ -631,90 +621,82 @@ (&Element->UserSpace))->Common.DataType) { case ACPI_DESC_TYPE_INTERNAL: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " ObjType %12.12s R%d", + AcpiOsPrintf ("ObjType %12.12s R%d", AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT *)(&Element->UserSpace))->Common.Type), - ((ACPI_OPERAND_OBJECT *)(&Element->UserSpace))->Common.ReferenceCount)); + ((ACPI_OPERAND_OBJECT *)(&Element->UserSpace))->Common.ReferenceCount); break; case ACPI_DESC_TYPE_PARSER: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " ParseObj Opcode %04X", - ((ACPI_PARSE_OBJECT *)(&Element->UserSpace))->Opcode)); + AcpiOsPrintf ("ParseObj Opcode %04X", + ((ACPI_PARSE_OBJECT *)(&Element->UserSpace))->Opcode); break; case ACPI_DESC_TYPE_NAMED: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " Node %4.4s", - (char*)&((ACPI_NAMESPACE_NODE *)(&Element->UserSpace))->Name)); + AcpiOsPrintf ("Node %4.4s", + (char *) &((ACPI_NAMESPACE_NODE *)(&Element->UserSpace))->Name); break; case ACPI_DESC_TYPE_STATE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " Untyped StateObj")); + AcpiOsPrintf ("Untyped StateObj"); break; case ACPI_DESC_TYPE_STATE_UPDATE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " UPDATE StateObj")); + AcpiOsPrintf ("UPDATE StateObj"); break; case ACPI_DESC_TYPE_STATE_PACKAGE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " PACKAGE StateObj")); + AcpiOsPrintf ("PACKAGE StateObj"); break; case ACPI_DESC_TYPE_STATE_CONTROL: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " CONTROL StateObj")); + AcpiOsPrintf ("CONTROL StateObj"); break; case ACPI_DESC_TYPE_STATE_RPSCOPE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " ROOT-PARSE-SCOPE StateObj")); + AcpiOsPrintf ("ROOT-PARSE-SCOPE StateObj"); break; case ACPI_DESC_TYPE_STATE_PSCOPE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " PARSE-SCOPE StateObj")); + AcpiOsPrintf ("PARSE-SCOPE StateObj"); break; case ACPI_DESC_TYPE_STATE_WSCOPE: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " WALK-SCOPE StateObj")); + AcpiOsPrintf ("WALK-SCOPE StateObj"); break; case ACPI_DESC_TYPE_STATE_RESULT: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " RESULT StateObj")); + AcpiOsPrintf ("RESULT StateObj"); break; case ACPI_DESC_TYPE_STATE_NOTIFY: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " NOTIFY StateObj")); + AcpiOsPrintf ("NOTIFY StateObj"); break; } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "\n")); + AcpiOsPrintf ( "\n"); + NumOutstanding++; } } - - if (Element->Next == NULL) - { - break; - } - Element = Element->Next; } AcpiUtReleaseMutex (ACPI_MTX_MEMORY); - ACPI_DEBUG_PRINT ((ACPI_DB_OK, - "Total number of unfreed allocations = %d(%X)\n", i,i)); + /* Print summary */ + if (!NumOutstanding) + { + ACPI_DEBUG_PRINT ((ACPI_DB_OK, + "No outstanding allocations.\n")); + } + else + { + ACPI_DEBUG_PRINT ((ACPI_DB_OK, + "%d(%X) Outstanding allocations\n", + NumOutstanding, NumOutstanding)); + } return_VOID; - } Index: contrib/dev/acpica/utcopy.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/utcopy.c,v retrieving revision 1.1.1.12 diff -u -r1.1.1.12 utcopy.c --- contrib/dev/acpica/utcopy.c 31 Oct 2001 02:32:29 -0000 1.1.1.12 +++ contrib/dev/acpica/utcopy.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: utcopy - Internal to external object translation utilities - * $Revision: 83 $ + * $Revision: 84 $ * *****************************************************************************/ @@ -529,7 +529,6 @@ FUNCTION_TRACE ("UtCopyEsimpleToIsimple"); - /* * Simple types supported are: String, Buffer, Integer */ @@ -568,8 +567,8 @@ return_ACPI_STATUS (AE_NO_MEMORY); } - MEMCPY (InternalObject->String.Pointer, - ExternalObject->String.Pointer, + MEMCPY (InternalObject->String.Pointer, + ExternalObject->String.Pointer, ExternalObject->String.Length); InternalObject->String.Length = ExternalObject->String.Length; @@ -584,8 +583,8 @@ return_ACPI_STATUS (AE_NO_MEMORY); } - MEMCPY (InternalObject->Buffer.Pointer, - ExternalObject->Buffer.Pointer, + MEMCPY (InternalObject->Buffer.Pointer, + ExternalObject->Buffer.Pointer, ExternalObject->Buffer.Length); InternalObject->Buffer.Length = ExternalObject->Buffer.Length; Index: contrib/dev/acpica/utdebug.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/utdebug.c,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 utdebug.c --- contrib/dev/acpica/utdebug.c 31 Oct 2001 02:32:29 -0000 1.1.1.10 +++ contrib/dev/acpica/utdebug.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: utdebug - Debug print routines - * $Revision: 90 $ + * $Revision: 91 $ * *****************************************************************************/ @@ -127,7 +127,6 @@ char *AcpiGbl_FnExitStr = "----Exit-"; - #ifdef ACPI_DEBUG @@ -571,8 +570,6 @@ } #endif - - /***************************************************************************** Index: contrib/dev/acpica/utdelete.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/utdelete.c,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 utdelete.c --- contrib/dev/acpica/utdelete.c 31 Oct 2001 02:32:29 -0000 1.1.1.11 +++ contrib/dev/acpica/utdelete.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: utdelete - object deletion and reference count utilities - * $Revision: 81 $ + * $Revision: 82 $ * ******************************************************************************/ @@ -610,7 +610,7 @@ case INTERNAL_TYPE_BANK_FIELD: Status = AcpiUtCreateUpdateStateAndPush ( - Object->BankField.BankRegisterObj, Action, &StateList); + Object->BankField.BankObj, Action, &StateList); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); Index: contrib/dev/acpica/uteval.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/uteval.c,v retrieving revision 1.1.1.9 diff -u -r1.1.1.9 uteval.c --- contrib/dev/acpica/uteval.c 31 Oct 2001 02:32:29 -0000 1.1.1.9 +++ contrib/dev/acpica/uteval.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: uteval - Object evaluation - * $Revision: 31 $ + * $Revision: 34 $ * *****************************************************************************/ @@ -250,7 +250,6 @@ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "_HID on %4.4s was not found\n", (char*)&DeviceNode->Name)); } - else { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "_HID on %4.4s failed %s\n", @@ -280,7 +279,6 @@ "Type returned from _HID not a number or string: %s(%X) \n", AcpiUtGetTypeName (ObjDesc->Common.Type), ObjDesc->Common.Type)); } - else { if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER) @@ -289,7 +287,6 @@ AcpiExEisaIdToString ((UINT32) ObjDesc->Integer.Value, Hid->Buffer); } - else { /* Copy the String HID from the returned object */ @@ -298,6 +295,103 @@ } } + /* On exit, we must delete the return object */ + + AcpiUtRemoveReference (ObjDesc); + + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtExecute_CID + * + * PARAMETERS: DeviceNode - Node for the device + * *Cid - Where the CID is returned + * + * RETURN: Status + * + * DESCRIPTION: Executes the _CID control method that returns one or more + * compatible hardware IDs for the device. + * + * NOTE: Internal function, no parameter validation + * + ******************************************************************************/ + +ACPI_STATUS +AcpiUtExecute_CID ( + ACPI_NAMESPACE_NODE *DeviceNode, + ACPI_DEVICE_ID *Cid) +{ + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_STATUS Status; + + + FUNCTION_TRACE ("UtExecute_CID"); + + /* Execute the method */ + + Status = AcpiNsEvaluateRelative (DeviceNode, + METHOD_NAME__CID, NULL, &ObjDesc); + if (ACPI_FAILURE (Status)) + { + if (Status == AE_NOT_FOUND) + { + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "_CID on %4.4s was not found\n", + (char *)&DeviceNode->Name)); + } + else + { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "_CID on %4.4s failed %s\n", + (char *)&DeviceNode->Name, AcpiFormatException (Status))); + } + + return_ACPI_STATUS (Status); + } + + /* Did we get a return object? */ + + if (!ObjDesc) + { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No object was returned from _CID\n")); + return_ACPI_STATUS (AE_TYPE); + } + + /* + * A _CID can return either a single compatible ID or a package of compatible + * IDs. Each compatible ID can be a Number (32 bit compressed EISA ID) or + * string (PCI ID format, e.g. "PCI\VEN_vvvv&DEV_dddd&SUBSYS_ssssssss"). + */ + switch (ObjDesc->Common.Type) + { + case ACPI_TYPE_INTEGER: + + /* Convert the Numeric CID to string */ + + AcpiExEisaIdToString ((UINT32) ObjDesc->Integer.Value, Cid->Buffer); + break; + + case ACPI_TYPE_STRING: + + /* Copy the String CID from the returned object */ + + STRNCPY(Cid->Buffer, ObjDesc->String.Pointer, sizeof(Cid->Buffer)); + break; + + case ACPI_TYPE_PACKAGE: + + /* TBD: Parse package elements; need different return struct, etc. */ + break; + + default: + + Status = AE_TYPE; + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Type returned from _CID not a number, string, or package: %s(%X) \n", + AcpiUtGetTypeName (ObjDesc->Common.Type), ObjDesc->Common.Type)); + break; + } /* On exit, we must delete the return object */ @@ -346,7 +440,6 @@ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "_UID on %4.4s was not found\n", (char*)&DeviceNode->Name)); } - else { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, @@ -377,7 +470,6 @@ "Type returned from _UID was not a number or string: %X \n", ObjDesc->Common.Type)); } - else { if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER) @@ -386,7 +478,6 @@ AcpiExUnsignedIntegerToString (ObjDesc->Integer.Value, Uid->Buffer); } - else { /* Copy the String UID from the returned object */ @@ -472,7 +563,6 @@ "Type returned from _STA was not a number: %X \n", ObjDesc->Common.Type)); } - else { /* Extract the status flags */ Index: contrib/dev/acpica/utglobal.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/utglobal.c,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 utglobal.c --- contrib/dev/acpica/utglobal.c 31 Oct 2001 02:32:29 -0000 1.1.1.11 +++ contrib/dev/acpica/utglobal.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: utglobal - Global variables for the ACPI subsystem - * $Revision: 133 $ + * $Revision: 134 $ * *****************************************************************************/ @@ -501,7 +501,7 @@ /* Region type decoding */ -const NATIVE_CHAR *AcpiGbl_RegionTypes[NUM_REGION_TYPES] = +const NATIVE_CHAR *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] = { "SystemMemory", "SystemIO", @@ -530,12 +530,12 @@ UINT8 SpaceId) { - if (SpaceId >= USER_REGION_BEGIN) + if (SpaceId >= ACPI_USER_REGION_BEGIN) { return ("UserDefinedRegion"); } - else if (SpaceId >= NUM_REGION_TYPES) + else if (SpaceId >= ACPI_NUM_PREDEFINED_REGIONS) { return ("InvalidSpaceID"); } @@ -573,9 +573,8 @@ "ByteAcc", "WordAcc", "DWordAcc", - "BlockAcc", - "SMBSendRecvAcc", - "SMBQuickAcc" + "QWordAcc", + "BufferAcc", }; @@ -737,15 +736,6 @@ AcpiGbl_AcpiTables[i].Length = 0; AcpiGbl_AcpiTables[i].Allocation = ACPI_MEM_NOT_ALLOCATED; AcpiGbl_AcpiTables[i].Count = 0; - } - - - /* Address Space handler array */ - - for (i = 0; i < ACPI_NUM_ADDRESS_SPACES; i++) - { - AcpiGbl_AddressSpaces[i].Handler = NULL; - AcpiGbl_AddressSpaces[i].Context = NULL; } /* Mutex locked flags */ Index: contrib/dev/acpica/utmath.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/utmath.c,v retrieving revision 1.1.1.2 diff -u -r1.1.1.2 utmath.c --- contrib/dev/acpica/utmath.c 31 Oct 2001 02:32:29 -0000 1.1.1.2 +++ contrib/dev/acpica/utmath.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: utmath - Integer math support routines - * $Revision: 7 $ + * $Revision: 8 $ * ******************************************************************************/ @@ -129,7 +129,7 @@ * library is not available. */ -#ifndef ACPI_USE_NATIVE_DIVIDE +#ifndef ACPI_USE_NATIVE_DIVIDE /******************************************************************************* * * FUNCTION: AcpiUtShortDivide @@ -175,9 +175,9 @@ * The quotient is 64 bits, the remainder is always 32 bits, * and is generated by the second divide. */ - ACPI_DIV_64_BY_32 (0, Dividend.Part.Hi, Divisor, + ACPI_DIV_64_BY_32 (0, Dividend.Part.Hi, Divisor, Quotient.Part.Hi, Remainder32); - ACPI_DIV_64_BY_32 (Remainder32, Dividend.Part.Lo, Divisor, + ACPI_DIV_64_BY_32 (Remainder32, Dividend.Part.Lo, Divisor, Quotient.Part.Lo, Remainder32); /* Return only what was requested */ @@ -253,9 +253,9 @@ * The quotient is 64 bits, the remainder is always 32 bits, * and is generated by the second divide. */ - ACPI_DIV_64_BY_32 (0, Dividend.Part.Hi, Divisor.Part.Lo, + ACPI_DIV_64_BY_32 (0, Dividend.Part.Hi, Divisor.Part.Lo, Quotient.Part.Hi, Partial1); - ACPI_DIV_64_BY_32 (Partial1, Dividend.Part.Lo, Divisor.Part.Lo, + ACPI_DIV_64_BY_32 (Partial1, Dividend.Part.Lo, Divisor.Part.Lo, Quotient.Part.Lo, Remainder.Part.Lo); } @@ -273,18 +273,18 @@ do { - ACPI_SHIFT_RIGHT_64 (NormalizedDivisor.Part.Hi, + ACPI_SHIFT_RIGHT_64 (NormalizedDivisor.Part.Hi, NormalizedDivisor.Part.Lo); - ACPI_SHIFT_RIGHT_64 (NormalizedDividend.Part.Hi, + ACPI_SHIFT_RIGHT_64 (NormalizedDividend.Part.Hi, NormalizedDividend.Part.Lo); } while (NormalizedDivisor.Part.Hi != 0); /* Partial divide */ - ACPI_DIV_64_BY_32 (NormalizedDividend.Part.Hi, - NormalizedDividend.Part.Lo, - NormalizedDivisor.Part.Lo, + ACPI_DIV_64_BY_32 (NormalizedDividend.Part.Hi, + NormalizedDividend.Part.Lo, + NormalizedDivisor.Part.Lo, Quotient.Part.Lo, Partial1); /* @@ -351,8 +351,8 @@ * DESCRIPTION: Native versions of the UtDivide functions. Use these if either * 1) The target is a 64-bit platform and therefore 64-bit * integer math is supported directly by the machine. - * 2) The target is a 32-bit or 16-bit platform, and the - * double-precision integer math library is available to + * 2) The target is a 32-bit or 16-bit platform, and the + * double-precision integer math library is available to * perform the divide. * ******************************************************************************/ Index: contrib/dev/acpica/utmisc.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/utmisc.c,v retrieving revision 1.1.1.9 diff -u -r1.1.1.9 utmisc.c --- contrib/dev/acpica/utmisc.c 4 Oct 2001 23:12:13 -0000 1.1.1.9 +++ contrib/dev/acpica/utmisc.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: utmisc - common utility procedures - * $Revision: 52 $ + * $Revision: 54 $ * ******************************************************************************/ @@ -130,7 +130,6 @@ MODULE_NAME ("utmisc") - /******************************************************************************* * * FUNCTION: AcpiUtValidAcpiName @@ -779,7 +778,7 @@ State = AcpiUtCreateGenericState (); if (!State) { - return (NULL); + return_PTR (NULL); } /* Init fields specific to the update struct */ @@ -823,7 +822,7 @@ State = AcpiUtCreateGenericState (); if (!State) { - return (NULL); + return_PTR (NULL); } /* Init fields specific to the update struct */ @@ -866,7 +865,7 @@ State = AcpiUtCreateGenericState (); if (!State) { - return (NULL); + return_PTR (NULL); } @@ -1169,7 +1168,7 @@ /* We should never get here */ - return (AE_AML_INTERNAL); + return_ACPI_STATUS (AE_AML_INTERNAL); } Index: contrib/dev/acpica/utobject.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/utobject.c,v retrieving revision 1.1.1.12 diff -u -r1.1.1.12 utobject.c --- contrib/dev/acpica/utobject.c 31 Oct 2001 02:32:29 -0000 1.1.1.12 +++ contrib/dev/acpica/utobject.c 7 Nov 2001 09:37:36 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: utobject - ACPI object create/delete/size/cache routines - * $Revision: 57 $ + * $Revision: 58 $ * *****************************************************************************/ @@ -353,7 +353,6 @@ AcpiUtDeleteGenericCache (ACPI_MEM_LIST_OPERAND); return_VOID; } - /******************************************************************************* Index: dev/acpica/acpi_ec.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi_ec.c,v retrieving revision 1.18 diff -u -r1.18 acpi_ec.c --- dev/acpica/acpi_ec.c 4 Oct 2001 23:21:09 -0000 1.18 +++ dev/acpica/acpi_ec.c 7 Nov 2001 09:50:07 -0000 @@ -278,7 +278,7 @@ static void EcGpeHandler(void *Context); static ACPI_STATUS EcSpaceSetup(ACPI_HANDLE Region, UINT32 Function, void *Context, void **return_Context); -static ACPI_STATUS EcSpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 width, UINT32 *Value, +static ACPI_STATUS EcSpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 width, ACPI_INTEGER *Value, void *Context, void *RegionContext); static ACPI_STATUS EcWaitEvent(struct acpi_ec_softc *sc, EC_EVENT Event); @@ -536,8 +536,8 @@ } static ACPI_STATUS -EcSpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 width, UINT32 *Value, - void *Context, void *RegionContext) +EcSpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 width, + ACPI_INTEGER *Value, void *Context, void *RegionContext) { struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; ACPI_STATUS Status = AE_OK; @@ -550,13 +550,13 @@ return_ACPI_STATUS(AE_BAD_PARAMETER); switch (Function) { - case ACPI_READ_ADR_SPACE: + case ACPI_READ: EcRequest.Command = EC_COMMAND_READ; EcRequest.Address = Address; (*Value) = 0; break; - case ACPI_WRITE_ADR_SPACE: + case ACPI_WRITE: EcRequest.Command = EC_COMMAND_WRITE; EcRequest.Address = Address; break; @@ -570,7 +570,7 @@ * Perform the transaction. */ for (i = 0; i < width; i += 8) { - if (Function == ACPI_READ_ADR_SPACE) + if (Function == ACPI_READ) EcRequest.Data = 0; else EcRequest.Data = (UINT8)((*Value) >> i); Index: dev/acpica/acpica_support.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpica_support.c,v retrieving revision 1.1 diff -u -r1.1 acpica_support.c --- dev/acpica/acpica_support.c 6 Nov 2001 15:00:18 -0000 1.1 +++ dev/acpica/acpica_support.c 7 Nov 2001 09:48:19 -0000 @@ -132,7 +132,7 @@ if (AcpiGbl_AcpiTables[ACPI_TABLE_DSDT].LoadedIntoNamespace) { - return_ACPI_STATUS (AE_EXIST); + return_ACPI_STATUS (AE_ALREADY_EXISTS); } AcpiGbl_DSDT = TablePtr; Index: dev/acpica/Osd/OsdHardware.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/Osd/OsdHardware.c,v retrieving revision 1.3 diff -u -r1.3 OsdHardware.c --- dev/acpica/Osd/OsdHardware.c 4 Oct 2001 08:33:16 -0000 1.3 +++ dev/acpica/Osd/OsdHardware.c 7 Nov 2001 09:51:26 -0000 @@ -83,7 +83,7 @@ ACPI_STATUS AcpiOsWritePort ( ACPI_IO_ADDRESS OutPort, - NATIVE_UINT Value, + ACPI_INTEGER Value, UINT32 Width) { switch (Width) { @@ -140,7 +140,7 @@ AcpiOsWritePciConfiguration ( ACPI_PCI_ID *PciId, UINT32 Register, - NATIVE_UINT Value, + ACPI_INTEGER Value, UINT32 Width) { u_int32_t byte_width = Width / 8; Index: dev/acpica/Osd/OsdInterrupt.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/Osd/OsdInterrupt.c,v retrieving revision 1.6 diff -u -r1.6 OsdInterrupt.c --- dev/acpica/Osd/OsdInterrupt.c 25 Jul 2001 16:13:30 -0000 1.6 +++ dev/acpica/Osd/OsdInterrupt.c 7 Nov 2001 09:52:18 -0000 @@ -78,19 +78,19 @@ */ if (sc->acpi_irq != NULL) { device_printf(sc->acpi_dev, "attempt to register more than one interrupt handler\n"); - return_ACPI_STATUS(AE_EXIST); + return_ACPI_STATUS(AE_ALREADY_EXISTS); } sc->acpi_irq_rid = 0; bus_set_resource(sc->acpi_dev, SYS_RES_IRQ, 0, InterruptNumber, 1); if ((sc->acpi_irq = bus_alloc_resource(sc->acpi_dev, SYS_RES_IRQ, &sc->acpi_irq_rid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE)) == NULL) { device_printf(sc->acpi_dev, "could not allocate SCI interrupt\n"); - return_ACPI_STATUS(AE_EXIST); + return_ACPI_STATUS(AE_ALREADY_EXISTS); } if (bus_setup_intr(sc->acpi_dev, sc->acpi_irq, INTR_TYPE_MISC, (driver_intr_t *)InterruptWrapper, Context, &sc->acpi_irq_handle)) { device_printf(sc->acpi_dev, "could not set up SCI interrupt\n"); - return_ACPI_STATUS(AE_EXIST); + return_ACPI_STATUS(AE_ALREADY_EXISTS); } return_ACPI_STATUS(AE_OK); Index: dev/acpica/Osd/OsdMemory.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/Osd/OsdMemory.c,v retrieving revision 1.4 diff -u -r1.4 OsdMemory.c --- dev/acpica/Osd/OsdMemory.c 21 Jul 2001 04:10:01 -0000 1.4 +++ dev/acpica/Osd/OsdMemory.c 7 Nov 2001 09:52:44 -0000 @@ -139,7 +139,7 @@ ACPI_STATUS AcpiOsWriteMemory ( ACPI_PHYSICAL_ADDRESS Address, - NATIVE_UINT Value, + ACPI_INTEGER Value, UINT32 Width) { void *LogicalAddress;