diff options
Diffstat (limited to 'sys/contrib/dev')
77 files changed, 2132 insertions, 2680 deletions
diff --git a/sys/contrib/dev/acpica/acdebug.h b/sys/contrib/dev/acpica/acdebug.h index 0d5e69b..f2b105d 100644 --- a/sys/contrib/dev/acpica/acdebug.h +++ b/sys/contrib/dev/acpica/acdebug.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acdebug.h - ACPI/AML debugger - * $Revision: 49 $ + * $Revision: 50 $ * *****************************************************************************/ @@ -219,7 +219,7 @@ ACPI_STATUS AcpiDbSingleStep ( ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op, - UINT8 OpType); + UINT32 OpType); /* diff --git a/sys/contrib/dev/acpica/acdispat.h b/sys/contrib/dev/acpica/acdispat.h index 6e09b08..cb357d6 100644 --- a/sys/contrib/dev/acpica/acdispat.h +++ b/sys/contrib/dev/acpica/acdispat.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acdispat.h - dispatcher (parser to interpreter interface) - * $Revision: 44 $ + * $Revision: 45 $ * *****************************************************************************/ @@ -191,7 +191,6 @@ AcpiDsExecEndOp ( /* dsfield - Parser/Interpreter interface for AML fields */ - ACPI_STATUS AcpiDsCreateField ( ACPI_PARSE_OBJECT *Op, @@ -210,6 +209,11 @@ AcpiDsCreateIndexField ( ACPI_NAMESPACE_NODE *RegionNode, ACPI_WALK_STATE *WalkState); +ACPI_STATUS +AcpiDsCreateBufferField ( + ACPI_PARSE_OBJECT *Op, + ACPI_WALK_STATE *WalkState); + /* dsload - Parser/Interpreter interface, namespace load callbacks */ diff --git a/sys/contrib/dev/acpica/acenv.h b/sys/contrib/dev/acpica/acenv.h index 364d6d9..2060d54 100644 --- a/sys/contrib/dev/acpica/acenv.h +++ b/sys/contrib/dev/acpica/acenv.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acenv.h - Generation environment specific items - * $Revision: 76 $ + * $Revision: 77 $ * *****************************************************************************/ @@ -218,6 +218,12 @@ #define ACPI_OS_NAME "Intel ACPI/CA Core Subsystem" +/* This macro is used to tag functions as "printf-like" because + * some compilers can catch printf format string problems. MSVC + * doesn't, so this is proprocessed away. + */ +#define ACPI_PRINTF_LIKE_FUNC + #endif diff --git a/sys/contrib/dev/acpica/acinterp.h b/sys/contrib/dev/acpica/acinterp.h index 295bf80..373136d 100644 --- a/sys/contrib/dev/acpica/acinterp.h +++ b/sys/contrib/dev/acpica/acinterp.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acinterp.h - Interpreter subcomponent prototypes and defines - * $Revision: 110 $ + * $Revision: 116 $ * *****************************************************************************/ @@ -270,37 +270,62 @@ AcpiExWriteDataToField ( */ ACPI_STATUS -AcpiExTriadic ( +AcpiExOpcode_3A_0T_0R ( ACPI_WALK_STATE *WalkState); ACPI_STATUS -AcpiExHexadic ( +AcpiExOpcode_3A_1T_1R ( ACPI_WALK_STATE *WalkState); ACPI_STATUS -AcpiExCreateBufferField ( - UINT8 *AmlStart, - UINT32 AmlLength, - ACPI_NAMESPACE_NODE *Node, +AcpiExOpcode_6A_0T_1R ( ACPI_WALK_STATE *WalkState); ACPI_STATUS -AcpiExReconfiguration ( +AcpiExGetObjectReference ( + ACPI_OPERAND_OBJECT *ObjDesc, + ACPI_OPERAND_OBJECT **ReturnDesc, ACPI_WALK_STATE *WalkState); ACPI_STATUS +AcpiExDoConcatenate ( + ACPI_OPERAND_OBJECT *ObjDesc, + ACPI_OPERAND_OBJECT *ObjDesc2, + ACPI_OPERAND_OBJECT **ActualReturnDesc, + ACPI_WALK_STATE *WalkState); + +BOOLEAN +AcpiExDoLogicalOp ( + UINT16 Opcode, + ACPI_INTEGER Operand0, + ACPI_INTEGER Operand1); + +ACPI_INTEGER +AcpiExDoMathOp ( + UINT16 Opcode, + ACPI_INTEGER Operand0, + ACPI_INTEGER Operand1); + +ACPI_STATUS +AcpiExLoadOp ( + ACPI_OPERAND_OBJECT *RgnDesc, + ACPI_OPERAND_OBJECT *DdbHandle); + +ACPI_STATUS +AcpiExUnloadTable ( + ACPI_OPERAND_OBJECT *DdbHandle); + +ACPI_STATUS AcpiExCreateMutex ( ACPI_WALK_STATE *WalkState); ACPI_STATUS AcpiExCreateProcessor ( - ACPI_PARSE_OBJECT *Op, - ACPI_NAMESPACE_NODE *ProcessorNode); + ACPI_WALK_STATE *WalkState); ACPI_STATUS AcpiExCreatePowerResource ( - ACPI_PARSE_OBJECT *Op, - ACPI_NAMESPACE_NODE *PowerNode); + ACPI_WALK_STATE *WalkState); ACPI_STATUS AcpiExCreateRegion ( @@ -325,8 +350,7 @@ ACPI_STATUS AcpiExCreateMethod ( UINT8 *AmlStart, UINT32 AmlLength, - UINT32 MethodFlags, - ACPI_NAMESPACE_NODE *Method); + ACPI_WALK_STATE *WalkState); /* @@ -391,6 +415,9 @@ AcpiExPrepIndexFieldValue ( UINT32 FieldPosition, UINT32 FieldLength); +ACPI_STATUS +AcpiExPrepFieldValue ( + ACPI_CREATE_FIELD_INFO *Info); /* * amsystem - Interface to OS services @@ -442,36 +469,39 @@ AcpiExSystemWaitSemaphore ( */ ACPI_STATUS -AcpiExMonadic1 ( +AcpiExOpcode_1A_0T_0R ( ACPI_WALK_STATE *WalkState); ACPI_STATUS -AcpiExMonadic2 ( +AcpiExOpcode_1A_0T_1R ( ACPI_WALK_STATE *WalkState); ACPI_STATUS -AcpiExMonadic2R ( +AcpiExOpcode_1A_1T_1R ( ACPI_WALK_STATE *WalkState); +ACPI_STATUS +AcpiExOpcode_1A_1T_0R ( + ACPI_WALK_STATE *WalkState); /* * amdyadic - ACPI AML (p-code) execution, dyadic operators */ ACPI_STATUS -AcpiExDyadic1 ( +AcpiExOpcode_2A_0T_0R ( ACPI_WALK_STATE *WalkState); ACPI_STATUS -AcpiExDyadic2 ( +AcpiExOpcode_2A_0T_1R ( ACPI_WALK_STATE *WalkState); ACPI_STATUS -AcpiExDyadic2R ( +AcpiExOpcode_2A_1T_1R ( ACPI_WALK_STATE *WalkState); ACPI_STATUS -AcpiExDyadic2S ( +AcpiExOpcode_2A_2T_1R ( ACPI_WALK_STATE *WalkState); diff --git a/sys/contrib/dev/acpica/aclocal.h b/sys/contrib/dev/acpica/aclocal.h index 5088c17..bf99fd1 100644 --- a/sys/contrib/dev/acpica/aclocal.h +++ b/sys/contrib/dev/acpica/aclocal.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: aclocal.h - Internal data types used across the ACPI subsystem - * $Revision: 134 $ + * $Revision: 138 $ * *****************************************************************************/ @@ -280,7 +280,7 @@ typedef struct acpi_node UINT32 Name; /* ACPI Name, always 4 chars per ACPI spec */ - void *Object; /* Pointer to attached ACPI object (optional) */ + union acpi_operand_obj *Object; /* Pointer to attached ACPI object (optional) */ struct acpi_node *Child; /* first child */ struct acpi_node *Peer; /* Next peer*/ UINT16 ReferenceCount; /* Current count of references and children */ @@ -376,6 +376,33 @@ typedef struct acpi_namestring_info } ACPI_NAMESTRING_INFO; +/* Field creation info */ + +typedef struct +{ + ACPI_NAMESPACE_NODE *RegionNode; + ACPI_NAMESPACE_NODE *FieldNode; + ACPI_NAMESPACE_NODE *RegisterNode; + ACPI_NAMESPACE_NODE *DataRegisterNode; + UINT32 BankValue; + UINT32 FieldBitPosition; + UINT32 FieldBitLength; + UINT8 FieldFlags; + UINT8 FieldType; + +} ACPI_CREATE_FIELD_INFO; + +/* + * Field flags: Bits 00 - 03 : AccessType (AnyAcc, ByteAcc, etc.) + * 04 : LockRule (1 == Lock) + * 05 - 06 : UpdateRule + */ + +#define FIELD_ACCESS_TYPE_MASK 0x0F +#define FIELD_LOCK_RULE_MASK 0x10 +#define FIELD_UPDATE_RULE_MASK 0x60 + + /***************************************************************************** * * Event typedefs and structs @@ -616,40 +643,23 @@ typedef union acpi_gen_state } ACPI_GENERIC_STATE; + /***************************************************************************** * - * Parser typedefs and structs + * Interpreter typedefs and structs * ****************************************************************************/ -#define ACPI_OP_CLASS_MASK 0x1F -#define ACPI_OP_ARGS_MASK 0x20 -#define ACPI_OP_TYPE_MASK 0xC0 - -#define ACPI_OP_TYPE_OPCODE 0x00 -#define ACPI_OP_TYPE_ASCII 0x40 -#define ACPI_OP_TYPE_PREFIX 0x80 -#define ACPI_OP_TYPE_UNKNOWN 0xC0 - -#define ACPI_GET_OP_CLASS(a) ((a)->Flags & ACPI_OP_CLASS_MASK) -#define ACPI_GET_OP_ARGS(a) ((a)->Flags & ACPI_OP_ARGS_MASK) -#define ACPI_GET_OP_TYPE(a) ((a)->Flags & ACPI_OP_TYPE_MASK) +typedef +ACPI_STATUS (*ACPI_EXECUTE_OP) ( + struct acpi_walk_state *WalkState); -/* - * Flags byte: 0-4 (5 bits) = Opcode Class (0x001F - * 5 (1 bit) = Has arguments flag - * 6-7 (2 bits) = Reserved - */ -#define AML_NO_ARGS 0 -#define AML_HAS_ARGS 0x0020 -#define AML_NSOBJECT 0x0100 -#define AML_NSOPCODE 0x0200 -#define AML_NSNODE 0x0400 -#define AML_NAMED 0x0800 -#define AML_DEFER 0x1000 -#define AML_FIELD 0x2000 -#define AML_CREATE 0x4000 +/***************************************************************************** + * + * Parser typedefs and structs + * + ****************************************************************************/ /* * AML opcode, name, and argument layout @@ -658,7 +668,9 @@ typedef struct acpi_opcode_info { UINT32 ParseArgs; /* Grammar/Parse time arguments */ UINT32 RuntimeArgs; /* Interpret time arguments */ - UINT16 Flags; /* Opcode type, HasArgs flag */ + UINT16 Flags; /* Misc flags */ + UINT8 Class; /* Opcode class */ + UINT8 Type; /* Opcode type */ #ifdef _OPCODE_NAMES NATIVE_CHAR *Name; /* op name (debug only) */ diff --git a/sys/contrib/dev/acpica/acmacros.h b/sys/contrib/dev/acpica/acmacros.h index d798656..d024dbf 100644 --- a/sys/contrib/dev/acpica/acmacros.h +++ b/sys/contrib/dev/acpica/acmacros.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acmacros.h - C macros for the entire subsystem. - * $Revision: 96 $ + * $Revision: 97 $ * *****************************************************************************/ @@ -385,9 +385,9 @@ * Macros for the master AML opcode table */ #ifdef ACPI_DEBUG -#define ACPI_OP(Name,PArgs,IArgs,Flags) {PArgs,IArgs,Flags,Name} +#define ACPI_OP(Name,PArgs,IArgs,Class,Type,Flags) {PArgs,IArgs,Flags,Class,Type,Name} #else -#define ACPI_OP(Name,PArgs,IArgs,Flags) {PArgs,IArgs,Flags} +#define ACPI_OP(Name,PArgs,IArgs,Class,Type,Flags) {PArgs,IArgs,Flags,Class,Type} #endif #define ARG_TYPE_WIDTH 5 diff --git a/sys/contrib/dev/acpica/acnamesp.h b/sys/contrib/dev/acpica/acnamesp.h index 5de866e..3c8f6cc 100644 --- a/sys/contrib/dev/acpica/acnamesp.h +++ b/sys/contrib/dev/acpica/acnamesp.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acnamesp.h - Namespace subcomponent prototypes and defines - * $Revision: 107 $ + * $Revision: 110 $ * *****************************************************************************/ @@ -193,14 +193,12 @@ AcpiNsWalkNamespace ( void *Context, void **ReturnValue); - ACPI_NAMESPACE_NODE * -AcpiNsGetNextObject ( +AcpiNsGetNextNode ( ACPI_OBJECT_TYPE8 Type, ACPI_NAMESPACE_NODE *Parent, ACPI_NAMESPACE_NODE *Child); - ACPI_STATUS AcpiNsDeleteNamespaceByOwner ( UINT16 TableId); @@ -315,6 +313,7 @@ AcpiNsDumpRootDevices ( void AcpiNsDumpObjects ( ACPI_OBJECT_TYPE8 Type, + UINT8 DisplayType, UINT32 MaxDepth, UINT32 OwnderId, ACPI_HANDLE StartHandle); @@ -395,7 +394,6 @@ AcpiNsPatternMatch ( ACPI_NAMESPACE_NODE *ObjNode, NATIVE_CHAR *SearchFor); - ACPI_STATUS AcpiNsGetNode ( NATIVE_CHAR *Pathname, @@ -492,7 +490,7 @@ AcpiNsExternalizeName ( NATIVE_CHAR **ConvertedName); ACPI_NAMESPACE_NODE * -AcpiNsConvertHandleToEntry ( +AcpiNsMapHandleToNode ( ACPI_HANDLE Handle); ACPI_HANDLE @@ -509,7 +507,7 @@ AcpiNsGetParentObject ( ACPI_NAMESPACE_NODE * -AcpiNsGetNextValidObject ( +AcpiNsGetNextValidNode ( ACPI_NAMESPACE_NODE *Node); diff --git a/sys/contrib/dev/acpica/acobject.h b/sys/contrib/dev/acpica/acobject.h index ce86fa2..f8a2e38 100644 --- a/sys/contrib/dev/acpica/acobject.h +++ b/sys/contrib/dev/acpica/acobject.h @@ -2,7 +2,7 @@ /****************************************************************************** * * Name: acobject.h - Definition of ACPI_OPERAND_OBJECT (Internal object only) - * $Revision: 92 $ + * $Revision: 93 $ * *****************************************************************************/ @@ -193,8 +193,7 @@ * Fields common to both Strings and Buffers */ #define ACPI_COMMON_BUFFER_INFO \ - UINT32 Length; \ - NATIVE_CHAR *Pointer; /* String value in AML stream or in allocated space */ + UINT32 Length; @@ -233,6 +232,7 @@ typedef struct /* STRING - has length and pointer - Null terminated, ASCII chara { ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO + NATIVE_CHAR *Pointer; /* String value in AML stream or in allocated space */ } ACPI_OBJECT_STRING; @@ -241,6 +241,7 @@ typedef struct /* BUFFER - has length and pointer - not null terminated */ { ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO + UINT8 *Pointer; /* Buffer value in AML stream or in allocated space */ } ACPI_OBJECT_BUFFER; diff --git a/sys/contrib/dev/acpica/acstruct.h b/sys/contrib/dev/acpica/acstruct.h index f380465..bfd62ef 100644 --- a/sys/contrib/dev/acpica/acstruct.h +++ b/sys/contrib/dev/acpica/acstruct.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acstruct.h - Internal structs - * $Revision: 8 $ + * $Revision: 10 $ * *****************************************************************************/ @@ -238,9 +238,15 @@ typedef struct acpi_walk_info { UINT32 DebugLevel; UINT32 OwnerId; + UINT8 DisplayType; } ACPI_WALK_INFO; +/* Display Types */ + +#define ACPI_DISPLAY_SUMMARY 0 +#define ACPI_DISPLAY_OBJECTS 1 + typedef struct acpi_get_devices_info { ACPI_WALK_CALLBACK UserFunction; @@ -250,4 +256,39 @@ typedef struct acpi_get_devices_info } ACPI_GET_DEVICES_INFO; + + +typedef union acpi_aml_operands +{ + ACPI_OPERAND_OBJECT *Operands[7]; + + struct + { + ACPI_OBJECT_INTEGER *Type; + ACPI_OBJECT_INTEGER *Code; + ACPI_OBJECT_INTEGER *Argument; + + } Fatal; + + struct + { + ACPI_OPERAND_OBJECT *Source; + ACPI_OBJECT_INTEGER *Index; + ACPI_OPERAND_OBJECT *Target; + + } Index; + + struct + { + ACPI_OPERAND_OBJECT *Source; + ACPI_OBJECT_INTEGER *Index; + ACPI_OBJECT_INTEGER *Length; + ACPI_OPERAND_OBJECT *Target; + + } Mid; + +} ACPI_AML_OPERANDS; + + + #endif diff --git a/sys/contrib/dev/acpica/actables.h b/sys/contrib/dev/acpica/actables.h index 01b8380..a9695a2 100644 --- a/sys/contrib/dev/acpica/actables.h +++ b/sys/contrib/dev/acpica/actables.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: actables.h - ACPI table management - * $Revision: 31 $ + * $Revision: 32 $ * *****************************************************************************/ @@ -268,10 +268,6 @@ AcpiTbFindRsdp ( * tbutils - common table utilities */ -BOOLEAN -AcpiTbSystemTablePointer ( - void *Where); - ACPI_STATUS AcpiTbMapAcpiTable ( ACPI_PHYSICAL_ADDRESS PhysicalAddress, diff --git a/sys/contrib/dev/acpica/actypes.h b/sys/contrib/dev/acpica/actypes.h index a97464c..4c825ec 100644 --- a/sys/contrib/dev/acpica/actypes.h +++ b/sys/contrib/dev/acpica/actypes.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: actypes.h - Common data types for the entire ACPI subsystem - * $Revision: 192 $ + * $Revision: 193 $ * *****************************************************************************/ @@ -874,7 +874,7 @@ typedef struct /* * IO Attributes - * The ISA IO ranges are: n000-n0FFh, n400-n4FFh, n800-n8FFh, nC00-nCFFh. + * The ISA IO ranges are: n000-n0FFh, n400-n4FFh, n800-n8FFh, nC00-nCFFh. * The non-ISA IO ranges are: n100-n3FFh, n500-n7FFh, n900-nBFFh, nCD0-nFFFh. */ #define NON_ISA_ONLY_RANGES (UINT8) 0x01 diff --git a/sys/contrib/dev/acpica/acutils.h b/sys/contrib/dev/acpica/acutils.h index 71844e2..e583185 100644 --- a/sys/contrib/dev/acpica/acutils.h +++ b/sys/contrib/dev/acpica/acutils.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures - * $Revision: 115 $ + * $Revision: 117 $ * *****************************************************************************/ @@ -435,7 +435,7 @@ AcpiUtDebugPrint ( UINT32 LineNumber, ACPI_DEBUG_PRINT_INFO *DbgInfo, char *Format, - ...); + ...) ACPI_PRINTF_LIKE_FUNC; void AcpiUtDebugPrintRaw ( @@ -443,7 +443,7 @@ AcpiUtDebugPrintRaw ( UINT32 LineNumber, ACPI_DEBUG_PRINT_INFO *DbgInfo, char *Format, - ...); + ...) ACPI_PRINTF_LIKE_FUNC; /* @@ -480,6 +480,7 @@ AcpiUtDeleteInternalObjectList ( #define METHOD_NAME__REG "_REG" #define METHOD_NAME__SEG "_SEG" #define METHOD_NAME__BBN "_BBN" +#define METHOD_NAME__PRT "_PRT" ACPI_STATUS diff --git a/sys/contrib/dev/acpica/amlcode.h b/sys/contrib/dev/acpica/amlcode.h index 0cba99b..763f160 100644 --- a/sys/contrib/dev/acpica/amlcode.h +++ b/sys/contrib/dev/acpica/amlcode.h @@ -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: 53 $ + * $Revision: 58 $ * *****************************************************************************/ @@ -357,47 +357,96 @@ #define OPGRP_FIELD 0x02 #define OPGRP_BYTELIST 0x04 -#define OPTYPE_UNDEFINED 0 +/* + * Opcode information + */ -#define OPTYPE_LITERAL 1 -#define OPTYPE_CONSTANT 2 -#define OPTYPE_METHOD_ARGUMENT 3 -#define OPTYPE_LOCAL_VARIABLE 4 -#define OPTYPE_DATA_TERM 5 - -/* Type 1 opcodes */ - -#define OPTYPE_MONADIC1 6 -#define OPTYPE_DYADIC1 7 - -/* Type 2 opcodes */ - -#define OPTYPE_MONADIC2 8 -#define OPTYPE_MONADIC2R 9 -#define OPTYPE_DYADIC2 10 -#define OPTYPE_DYADIC2R 11 -#define OPTYPE_DYADIC2S 12 +/* Opcode flags */ + +#define AML_HAS_ARGS 0x0800 +#define AML_HAS_TARGET 0x0400 +#define AML_HAS_RETVAL 0x0200 +#define AML_NSOBJECT 0x0100 +#define AML_NSOPCODE 0x0080 +#define AML_NSNODE 0x0040 +#define AML_NAMED 0x0020 +#define AML_DEFER 0x0010 +#define AML_FIELD 0x0008 +#define AML_CREATE 0x0004 +#define AML_MATH 0x0002 +#define AML_LOGICAL 0x0001 + +/* Convenient flag groupings */ + +#define AML_FLAGS_EXEC_1A_0T_0R AML_HAS_ARGS /* Monadic1 */ +#define AML_FLAGS_EXEC_1A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Monadic2 */ +#define AML_FLAGS_EXEC_1A_1T_0R AML_HAS_ARGS | AML_HAS_TARGET +#define AML_FLAGS_EXEC_1A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* Monadic2R */ +#define AML_FLAGS_EXEC_2A_0T_0R AML_HAS_ARGS /* Dyadic1 */ +#define AML_FLAGS_EXEC_2A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Dyadic2 */ +#define AML_FLAGS_EXEC_2A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* Dyadic2R */ +#define AML_FLAGS_EXEC_2A_2T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL +#define AML_FLAGS_EXEC_3A_0T_0R AML_HAS_ARGS +#define AML_FLAGS_EXEC_3A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL +#define AML_FLAGS_EXEC_6A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL -/* Multi-operand (>=3) opcodes */ -#define OPTYPE_TRIADIC 13 -#define OPTYPE_QUADRADIC 14 -#define OPTYPE_HEXADIC 15 +/* + * The opcode Type is used in a dispatch table, do not change + * without updating the table. + */ +#define AML_TYPE_EXEC_1A_0T_0R 0x00 /* Monadic1 */ +#define AML_TYPE_EXEC_1A_0T_1R 0x01 /* Monadic2 */ +#define AML_TYPE_EXEC_1A_1T_0R 0x02 +#define AML_TYPE_EXEC_1A_1T_1R 0x03 /* Monadic2R */ +#define AML_TYPE_EXEC_2A_0T_0R 0x04 /* Dyadic1 */ +#define AML_TYPE_EXEC_2A_0T_1R 0x05 /* Dyadic2 */ +#define AML_TYPE_EXEC_2A_1T_1R 0x06 /* Dyadic2R */ +#define AML_TYPE_EXEC_2A_2T_1R 0x07 +#define AML_TYPE_EXEC_3A_0T_0R 0x08 +#define AML_TYPE_EXEC_3A_1T_1R 0x09 +#define AML_TYPE_EXEC_6A_0T_1R 0x0A +/* End of types used in dispatch table */ + +#define AML_TYPE_LITERAL 0x0B +#define AML_TYPE_CONSTANT 0x0C +#define AML_TYPE_METHOD_ARGUMENT 0x0D +#define AML_TYPE_LOCAL_VARIABLE 0x0E +#define AML_TYPE_DATA_TERM 0x0F /* Generic for an op that returns a value */ -#define OPTYPE_METHOD_CALL 16 +#define AML_TYPE_METHOD_CALL 0x10 /* Misc */ -#define OPTYPE_CREATE_FIELD 17 -#define OPTYPE_CONTROL 18 -#define OPTYPE_RECONFIGURATION 19 -#define OPTYPE_NAMED_OBJECT 20 -#define OPTYPE_RETURN 21 +#define AML_TYPE_CREATE_FIELD 0x11 +#define AML_TYPE_CONTROL 0x12 +#define AML_TYPE_NAMED_NO_OBJ 0x13 +#define AML_TYPE_NAMED_FIELD 0x14 +#define AML_TYPE_NAMED_SIMPLE 0x15 +#define AML_TYPE_NAMED_COMPLEX 0x16 +#define AML_TYPE_RETURN 0x17 -#define OPTYPE_BOGUS 22 +#define AML_TYPE_UNDEFINED 0x18 +#define AML_TYPE_BOGUS 0x19 + + +/* + * Opcode classes + */ +#define AML_CLASS_EXECUTE 0x00 +#define AML_CLASS_CREATE 0x01 +#define AML_CLASS_ARGUMENT 0x02 +#define AML_CLASS_NAMED_OBJECT 0x03 +#define AML_CLASS_CONTROL 0x04 +#define AML_CLASS_ASCII 0x05 +#define AML_CLASS_PREFIX 0x06 +#define AML_CLASS_INTERNAL 0x07 +#define AML_CLASS_RETURN_VALUE 0x08 +#define AML_CLASS_METHOD_CALL 0x09 +#define AML_CLASS_UNKNOWN 0x0A /* Predefined Operation Region SpaceIDs */ @@ -497,18 +546,5 @@ typedef enum #define USER_REGION_BEGIN 0x80 -/* - * AML tables - */ - -#ifdef DEFINE_AML_GLOBALS - -/* External declarations for the AML tables */ - -extern UINT8 AcpiGbl_Aml [NUM_OPCODES]; -extern UINT16 AcpiGbl_Pfx [NUM_OPCODES]; - - -#endif /* DEFINE_AML_GLOBALS */ #endif /* __AMLCODE_H__ */ diff --git a/sys/contrib/dev/acpica/dbcmds.c b/sys/contrib/dev/acpica/dbcmds.c index fa77b56..1ba6a4d 100644 --- a/sys/contrib/dev/acpica/dbcmds.c +++ b/sys/contrib/dev/acpica/dbcmds.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbcmds - debug commands and output routines - * $Revision: 65 $ + * $Revision: 66 $ * ******************************************************************************/ @@ -536,7 +536,7 @@ AcpiDbDumpNamespace ( /* Display the subtree */ AcpiDbSetOutputDestination (DB_REDIRECTABLE_OUTPUT); - AcpiNsDumpObjects (ACPI_TYPE_ANY, MaxDepth, ACPI_UINT32_MAX, SubtreeEntry); + AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth, ACPI_UINT32_MAX, SubtreeEntry); AcpiDbSetOutputDestination (DB_CONSOLE_OUTPUT); } @@ -581,7 +581,7 @@ AcpiDbDumpNamespaceByOwner ( /* Display the subtree */ AcpiDbSetOutputDestination (DB_REDIRECTABLE_OUTPUT); - AcpiNsDumpObjects (ACPI_TYPE_ANY, MaxDepth, OwnerId, SubtreeEntry); + AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth, OwnerId, SubtreeEntry); AcpiDbSetOutputDestination (DB_CONSOLE_OUTPUT); } diff --git a/sys/contrib/dev/acpica/dbdisasm.c b/sys/contrib/dev/acpica/dbdisasm.c index 0e07f53..2ada95d 100644 --- a/sys/contrib/dev/acpica/dbdisasm.c +++ b/sys/contrib/dev/acpica/dbdisasm.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbdisasm - parser op tree display routines - * $Revision: 48 $ + * $Revision: 50 $ * ******************************************************************************/ @@ -189,6 +189,7 @@ AcpiDbBlockType ( ACPI_STATUS AcpiPsDisplayObjectPathname ( + ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op) { ACPI_PARSE_OBJECT *TargetOp; @@ -224,27 +225,45 @@ AcpiPsDisplayObjectPathname ( ACPI_STATUS AcpiPsDisplayObjectPathname ( + ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op) { ACPI_STATUS Status; ACPI_NAMESPACE_NODE *Node; NATIVE_CHAR Buffer[MAX_SHOW_ENTRY]; UINT32 BufferSize = MAX_SHOW_ENTRY; + UINT32 DebugLevel; - AcpiOsPrintf (" (Path "); + /* Save current debug level so we don't get extraneous debug output */ + + DebugLevel = AcpiDbgLevel; + AcpiDbgLevel = 0; /* Just get the Node out of the Op object */ Node = Op->Node; if (!Node) { - /* - * No Named obj, so we can't get the pathname since the object - * is not in the namespace. This can happen during single - * stepping where a dynamic named object is *about* to be created. - */ - return (AE_OK); + /* Node not defined in this scope, look it up */ + + Status = AcpiNsLookup (WalkState->ScopeInfo, Op->Value.String, ACPI_TYPE_ANY, + IMODE_EXECUTE, NS_SEARCH_PARENT, WalkState, &(Node)); + + if (ACPI_FAILURE (Status)) + { + /* + * We can't get the pathname since the object + * is not in the namespace. This can happen during single + * stepping where a dynamic named object is *about* to be created. + */ + AcpiOsPrintf (" [Path not found]"); + goto Exit; + } + + /* Save it for next time. */ + + Op->Node = Node; } /* Convert NamedDesc/handle to a full pathname */ @@ -253,11 +272,17 @@ AcpiPsDisplayObjectPathname ( if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("****Could not get pathname****)"); - return (Status); + goto Exit; } - AcpiOsPrintf ("%s)", Buffer); - return (AE_OK); + AcpiOsPrintf (" (Path %s)", Buffer); + + +Exit: + /* Restore the debug level */ + + AcpiDbgLevel = DebugLevel; + return (Status); } #endif @@ -388,7 +413,7 @@ AcpiDbDisplayOp ( (Op->Parent) && (AcpiGbl_DbOpt_verbose)) { - AcpiPsDisplayObjectPathname (Op); + AcpiPsDisplayObjectPathname (WalkState, Op); } AcpiOsPrintf ("\n"); diff --git a/sys/contrib/dev/acpica/dbdisply.c b/sys/contrib/dev/acpica/dbdisply.c index 1d6d3ba..01489d8 100644 --- a/sys/contrib/dev/acpica/dbdisply.c +++ b/sys/contrib/dev/acpica/dbdisply.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbdisply - debug display commands - * $Revision: 52 $ + * $Revision: 57 $ * ******************************************************************************/ @@ -356,7 +356,7 @@ DumpNte: else { - AcpiOsPrintf ("Object Pathname: %s\n", RetBuf.Pointer); + AcpiOsPrintf ("Object (%p) Pathname: %s\n", Node, RetBuf.Pointer); } if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE))) @@ -377,7 +377,7 @@ DumpNte: return; } - AcpiUtDumpBuffer (Node->Object, sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX); + AcpiUtDumpBuffer ((void *) Node->Object, sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX); AcpiExDumpObjectDescriptor (Node->Object, 1); } } @@ -527,7 +527,7 @@ AcpiDbDisplayInternalObject ( break; case AML_REVISION_OP: - AcpiOsPrintf ("[Const] Revision (%X)", ACPI_CA_VERSION); + AcpiOsPrintf ("[Const] Revision (%X)", ACPI_CA_SUPPORT_LEVEL); break; case AML_LOCAL_OP: @@ -653,24 +653,12 @@ AcpiDbDisplayMethodInfo ( NumRemainingOps++; } - OpInfo = AcpiPsGetOpcodeInfo (Op->Opcode); - if (ACPI_GET_OP_TYPE (OpInfo) != ACPI_OP_TYPE_OPCODE) - { - /* Bad opcode or ASCII character */ - - continue; - } - - /* Decode the opcode */ - switch (ACPI_GET_OP_CLASS (OpInfo)) + OpInfo = AcpiPsGetOpcodeInfo (Op->Opcode); + switch (OpInfo->Class) { - case OPTYPE_CONSTANT: /* argument type only */ - case OPTYPE_LITERAL: /* argument type only */ - case OPTYPE_DATA_TERM: /* argument type only */ - case OPTYPE_LOCAL_VARIABLE: /* argument type only */ - case OPTYPE_METHOD_ARGUMENT: /* argument type only */ + case AML_CLASS_ARGUMENT: if (CountRemaining) { NumRemainingOperands++; @@ -679,6 +667,11 @@ AcpiDbDisplayMethodInfo ( NumOperands++; break; + case AML_CLASS_UNKNOWN: + /* Bad opcode or ASCII character */ + + continue; + default: if (CountRemaining) { diff --git a/sys/contrib/dev/acpica/dbfileio.c b/sys/contrib/dev/acpica/dbfileio.c index 80fb487..cfc366f 100644 --- a/sys/contrib/dev/acpica/dbfileio.c +++ b/sys/contrib/dev/acpica/dbfileio.c @@ -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: 52 $ + * $Revision: 53 $ * ******************************************************************************/ @@ -474,7 +474,7 @@ AcpiDbLoadAcpiTable ( AcpiFormatException (Status)); } - ACPI_MEM_FREE (AcpiGbl_DbTablePtr); + AcpiOsFree (AcpiGbl_DbTablePtr); return (Status); } diff --git a/sys/contrib/dev/acpica/dbutils.c b/sys/contrib/dev/acpica/dbutils.c index eced01b..75dbac5 100644 --- a/sys/contrib/dev/acpica/dbutils.c +++ b/sys/contrib/dev/acpica/dbutils.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbutils - AML debugger utilities - * $Revision: 44 $ + * $Revision: 45 $ * ******************************************************************************/ @@ -232,7 +232,7 @@ AcpiDbDumpObject ( case ACPI_TYPE_INTEGER: - AcpiOsPrintf ("[Integer] = %X%8.8X\n", HIDWORD (ObjDesc->Integer.Value), + AcpiOsPrintf ("[Integer] = %8.8X%8.8X\n", HIDWORD (ObjDesc->Integer.Value), LODWORD (ObjDesc->Integer.Value)); break; diff --git a/sys/contrib/dev/acpica/dbxface.c b/sys/contrib/dev/acpica/dbxface.c index b94a89d..5dbd8dc 100644 --- a/sys/contrib/dev/acpica/dbxface.c +++ b/sys/contrib/dev/acpica/dbxface.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbxface - AML Debugger external interfaces - * $Revision: 43 $ + * $Revision: 45 $ * ******************************************************************************/ @@ -137,7 +137,7 @@ * * PARAMETERS: WalkState - Current walk * Op - Current executing op - * OpType - Type of the current AML Opcode + * OpcodeClass - Class of the current AML Opcode * * RETURN: Status * @@ -149,7 +149,7 @@ ACPI_STATUS AcpiDbSingleStep ( ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op, - UINT8 OpType) + UINT32 OpcodeClass) { ACPI_PARSE_OBJECT *Next; ACPI_STATUS Status = AE_OK; @@ -185,24 +185,12 @@ AcpiDbSingleStep ( return (AE_OK); } - switch (OpType) + switch (OpcodeClass) { - case OPTYPE_UNDEFINED: - case OPTYPE_CONSTANT: /* argument type only */ - case OPTYPE_LITERAL: /* argument type only */ - case OPTYPE_DATA_TERM: /* argument type only */ - case OPTYPE_LOCAL_VARIABLE: /* argument type only */ - case OPTYPE_METHOD_ARGUMENT: /* argument type only */ + case AML_CLASS_UNKNOWN: + case AML_CLASS_ARGUMENT: /* constants, literals, etc. do nothing */ return (AE_OK); break; - - case OPTYPE_NAMED_OBJECT: - switch (Op->Opcode) - { - case AML_INT_NAMEPATH_OP: - return (AE_OK); - break; - } } /* diff --git a/sys/contrib/dev/acpica/dsfield.c b/sys/contrib/dev/acpica/dsfield.c index 8027453d..b0955e1 100644 --- a/sys/contrib/dev/acpica/dsfield.c +++ b/sys/contrib/dev/acpica/dsfield.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: dsfield - Dispatcher field routines - * $Revision: 44 $ + * $Revision: 46 $ * *****************************************************************************/ @@ -121,82 +121,189 @@ #include "acdispat.h" #include "acinterp.h" #include "acnamesp.h" +#include "acparser.h" #define _COMPONENT ACPI_DISPATCHER MODULE_NAME ("dsfield") - -/* - * Field flags: Bits 00 - 03 : AccessType (AnyAcc, ByteAcc, etc.) - * 04 : LockRule (1 == Lock) - * 05 - 06 : UpdateRule - */ - -#define FIELD_ACCESS_TYPE_MASK 0x0F -#define FIELD_LOCK_RULE_MASK 0x10 -#define FIELD_UPDATE_RULE_MASK 0x60 - + /******************************************************************************* * - * FUNCTION: AcpiDsCreateField + * FUNCTION: AcpiDsCreateBufferField * - * PARAMETERS: Op - Op containing the Field definition and args - * RegionNode - Object for the containing Operation Region - * ` WalkState - Current method state + * PARAMETERS: Opcode - The opcode to be executed + * Operands - List of operands for the opcode + * WalkState - Current state * * RETURN: Status * - * DESCRIPTION: Create a new field in the specified operation region + * DESCRIPTION: Execute the CreateField operators: + * CreateBitFieldOp, + * CreateByteFieldOp, + * CreateWordFieldOp, + * CreateDWordFieldOp, + * CreateQWordFieldOp, + * CreateFieldOp (all of which define fields in buffers) * ******************************************************************************/ ACPI_STATUS -AcpiDsCreateField ( +AcpiDsCreateBufferField ( ACPI_PARSE_OBJECT *Op, - ACPI_NAMESPACE_NODE *RegionNode, ACPI_WALK_STATE *WalkState) { - ACPI_STATUS Status = AE_AML_ERROR; ACPI_PARSE_OBJECT *Arg; ACPI_NAMESPACE_NODE *Node; - UINT8 FieldFlags; - UINT32 FieldBitPosition = 0; + ACPI_STATUS Status; + ACPI_OPERAND_OBJECT *ObjDesc; - FUNCTION_TRACE_PTR ("DsCreateField", Op); + FUNCTION_TRACE ("DsCreateBufferField"); - /* First arg is the name of the parent OpRegion */ + /* Get the NameString argument */ - Arg = Op->Value.Arg; - if (!RegionNode) + if (Op->Opcode == AML_CREATE_FIELD_OP) { - Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Value.Name, - ACPI_TYPE_REGION, IMODE_EXECUTE, - NS_SEARCH_PARENT, WalkState, &RegionNode); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } + Arg = AcpiPsGetArg (Op, 3); } + else + { + /* Create Bit/Byte/Word/Dword field */ - /* Second arg is the field flags */ + Arg = AcpiPsGetArg (Op, 2); + } - Arg = Arg->Next; - FieldFlags = (UINT8) Arg->Value.Integer; + if (!Arg) + { + return_ACPI_STATUS (AE_AML_NO_OPERAND); + } - /* Each remaining arg is a Named Field */ + /* + * 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, + WalkState, &(Node)); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* We could put the returned object (Node) on the object stack for later, but + * for now, we will put it in the "op" object that the parser uses, so we + * can get it again at the end of this scope + */ + Op->Node = Node; + + /* + * If there is no object attached to the node, this node was just created and + * we need to create the field object. Otherwise, this was a lookup of an + * existing node and we don't want to create the field object again. + */ + if (Node->Object) + { + return_ACPI_STATUS (AE_OK); + } + + /* + * The Field definition is not fully parsed at this time. + * (We must save the address of the AML for the buffer and index operands) + */ + + /* Create the buffer field object */ + + ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_BUFFER_FIELD); + if (!ObjDesc) + { + Status = AE_NO_MEMORY; + goto Cleanup; + } + + /* + * Allocate a method object for this field unit + */ + ObjDesc->BufferField.Extra = AcpiUtCreateInternalObject ( + INTERNAL_TYPE_EXTRA); + if (!ObjDesc->BufferField.Extra) + { + Status = AE_NO_MEMORY; + goto Cleanup; + } + + /* + * Remember location in AML stream of the field unit + * opcode and operands -- since the buffer and index + * operands must be evaluated. + */ + ObjDesc->BufferField.Extra->Extra.AmlStart = ((ACPI_PARSE2_OBJECT *) Op)->Data; + ObjDesc->BufferField.Extra->Extra.AmlLength = ((ACPI_PARSE2_OBJECT *) Op)->Length; + ObjDesc->BufferField.Node = Node; + + /* Attach constructed field descriptor to parent node */ + + Status = AcpiNsAttachObject (Node, ObjDesc, ACPI_TYPE_BUFFER_FIELD); + + +Cleanup: + + /* Remove local reference to the object */ + + AcpiUtRemoveReference (ObjDesc); + return_ACPI_STATUS (Status); +} + + + +/******************************************************************************* + * + * FUNCTION: AcpiDsGetFieldNames + * + * PARAMETERS: Info - CreateField info structure + * ` WalkState - Current method state + * Arg - First parser arg for the field name list + * + * RETURN: Status + * + * DESCRIPTION: Process all named fields in a field declaration. Names are + * entered into the namespace. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiDsGetFieldNames ( + ACPI_CREATE_FIELD_INFO *Info, + ACPI_WALK_STATE *WalkState, + ACPI_PARSE_OBJECT *Arg) +{ + ACPI_STATUS Status; + + + FUNCTION_TRACE_U32 ("DsGetFieldNames", Info); + + + /* First field starts at bit zero */ + + Info->FieldBitPosition = 0; + + /* Process all elements in the field list (of parse nodes) */ - Arg = Arg->Next; while (Arg) { + /* + * Three types of field elements are handled: + * 1) Offset - specifies a bit offset + * 2) AccessAs - changes the access mode + * 3) Name - Enters a new named field into the namespace + */ switch (Arg->Opcode) { case AML_INT_RESERVEDFIELD_OP: - FieldBitPosition += Arg->Value.Size; + Info->FieldBitPosition += Arg->Value.Size; break; @@ -206,43 +313,110 @@ AcpiDsCreateField ( * Get a new AccessType and AccessAttribute for all * entries (until end or another AccessAs keyword) */ - FieldFlags = (UINT8) ((FieldFlags & FIELD_ACCESS_TYPE_MASK) || - ((UINT8) (Arg->Value.Integer >> 8))); + Info->FieldFlags = (UINT8) ((Info->FieldFlags & FIELD_ACCESS_TYPE_MASK) || + ((UINT8) (Arg->Value.Integer >> 8))); break; case AML_INT_NAMEDFIELD_OP: + /* Enter a new field name into the namespace */ + Status = AcpiNsLookup (WalkState->ScopeInfo, (NATIVE_CHAR *) &((ACPI_PARSE2_OBJECT *)Arg)->Name, - INTERNAL_TYPE_REGION_FIELD, IMODE_LOAD_PASS1, + Info->FieldType, IMODE_LOAD_PASS1, NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE, - NULL, &Node); + NULL, &Info->FieldNode); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } - /* - * Initialize an object for the new Node that is on - * the object stack - */ - Status = AcpiExPrepRegionFieldValue (Node, RegionNode, FieldFlags, - FieldBitPosition, Arg->Value.Size); + /* Create and initialize an object for the new Field Node */ + + Info->FieldBitLength = Arg->Value.Size; + + Status = AcpiExPrepFieldValue (Info); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } - /* Keep track of bit position for *next* field */ + /* Keep track of bit position for the next field */ - FieldBitPosition += Arg->Value.Size; + Info->FieldBitPosition += Info->FieldBitLength; + break; + + + default: + + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid opcode in field list: %X\n", + Arg->Opcode)); + return_ACPI_STATUS (AE_AML_ERROR); break; } Arg = Arg->Next; } + return_ACPI_STATUS (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDsCreateField + * + * PARAMETERS: Op - Op containing the Field definition and args + * RegionNode - Object for the containing Operation Region + * ` WalkState - Current method state + * + * RETURN: Status + * + * DESCRIPTION: Create a new field in the specified operation region + * + ******************************************************************************/ + +ACPI_STATUS +AcpiDsCreateField ( + ACPI_PARSE_OBJECT *Op, + ACPI_NAMESPACE_NODE *RegionNode, + ACPI_WALK_STATE *WalkState) +{ + ACPI_STATUS Status = AE_AML_ERROR; + ACPI_PARSE_OBJECT *Arg; + ACPI_CREATE_FIELD_INFO Info; + + + FUNCTION_TRACE_PTR ("DsCreateField", Op); + + + /* First arg is the name of the parent OpRegion (must already exist) */ + + Arg = Op->Value.Arg; + if (!RegionNode) + { + Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Value.Name, + ACPI_TYPE_REGION, IMODE_EXECUTE, + NS_SEARCH_PARENT, WalkState, &RegionNode); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } + + /* Second arg is the field flags */ + + Arg = Arg->Next; + Info.FieldFlags = Arg->Value.Integer8; + + /* Each remaining arg is a Named Field */ + + Info.FieldType = INTERNAL_TYPE_REGION_FIELD; + Info.RegionNode = RegionNode; + + Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Next); + return_ACPI_STATUS (Status); } @@ -269,17 +443,13 @@ AcpiDsCreateBankField ( { ACPI_STATUS Status = AE_AML_ERROR; ACPI_PARSE_OBJECT *Arg; - ACPI_NAMESPACE_NODE *RegisterNode; - ACPI_NAMESPACE_NODE *Node; - UINT32 BankValue; - UINT8 FieldFlags; - UINT32 FieldBitPosition = 0; + ACPI_CREATE_FIELD_INFO Info; FUNCTION_TRACE_PTR ("DsCreateBankField", Op); - /* First arg is the name of the parent OpRegion */ + /* First arg is the name of the parent OpRegion (must already exist) */ Arg = Op->Value.Arg; if (!RegionNode) @@ -293,14 +463,12 @@ AcpiDsCreateBankField ( } } - /* Second arg is the Bank Register */ + /* Second arg is the Bank Register (must already exist) */ Arg = Arg->Next; - Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Value.String, - INTERNAL_TYPE_BANK_FIELD_DEFN, IMODE_LOAD_PASS1, - NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE, - NULL, &RegisterNode); + INTERNAL_TYPE_BANK_FIELD_DEFN, IMODE_EXECUTE, + NS_SEARCH_PARENT, WalkState, &Info.RegisterNode); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -309,71 +477,19 @@ AcpiDsCreateBankField ( /* Third arg is the BankValue */ Arg = Arg->Next; - BankValue = Arg->Value.Integer32; + Info.BankValue = Arg->Value.Integer32; - - /* Next arg is the field flags */ + /* Fourth arg is the field flags */ Arg = Arg->Next; - FieldFlags = Arg->Value.Integer8; + Info.FieldFlags = Arg->Value.Integer8; /* Each remaining arg is a Named Field */ - Arg = Arg->Next; - while (Arg) - { - switch (Arg->Opcode) - { - case AML_INT_RESERVEDFIELD_OP: - - FieldBitPosition += Arg->Value.Size; - break; - - - case AML_INT_ACCESSFIELD_OP: - - /* - * Get a new AccessType and AccessAttribute for - * all entries (until end or another AccessAs keyword) - */ - FieldFlags = (UINT8) ((FieldFlags & FIELD_ACCESS_TYPE_MASK) || - ((UINT8) (Arg->Value.Integer >> 8))); - break; - - - case AML_INT_NAMEDFIELD_OP: - - Status = AcpiNsLookup (WalkState->ScopeInfo, - (NATIVE_CHAR *) &((ACPI_PARSE2_OBJECT *)Arg)->Name, - INTERNAL_TYPE_REGION_FIELD, IMODE_LOAD_PASS1, - NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE, - NULL, &Node); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* - * Initialize an object for the new Node that is on - * the object stack - */ - Status = AcpiExPrepBankFieldValue (Node, RegionNode, RegisterNode, - BankValue, FieldFlags, FieldBitPosition, - Arg->Value.Size); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* Keep track of bit position for the *next* field */ + Info.FieldType = INTERNAL_TYPE_BANK_FIELD; + Info.RegionNode = RegionNode; - FieldBitPosition += Arg->Value.Size; - break; - - } - - Arg = Arg->Next; - } + Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Next); return_ACPI_STATUS (Status); } @@ -401,113 +517,46 @@ AcpiDsCreateIndexField ( { ACPI_STATUS Status; ACPI_PARSE_OBJECT *Arg; - ACPI_NAMESPACE_NODE *Node; - ACPI_NAMESPACE_NODE *IndexRegisterNode; - ACPI_NAMESPACE_NODE *DataRegisterNode; - UINT8 FieldFlags; - UINT32 FieldBitPosition = 0; + ACPI_CREATE_FIELD_INFO Info; FUNCTION_TRACE_PTR ("DsCreateIndexField", Op); - Arg = Op->Value.Arg; - - /* First arg is the name of the Index register */ + /* First arg is the name of the Index register (must already exist) */ + Arg = Op->Value.Arg; Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Value.String, - ACPI_TYPE_ANY, IMODE_LOAD_PASS1, - NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE, - NULL, &IndexRegisterNode); + ACPI_TYPE_ANY, IMODE_EXECUTE, + NS_SEARCH_PARENT, WalkState, &Info.RegisterNode); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } - /* Second arg is the data register */ + /* Second arg is the data register (must already exist) */ Arg = Arg->Next; - Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Value.String, - INTERNAL_TYPE_INDEX_FIELD_DEFN, IMODE_LOAD_PASS1, - NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE, - NULL, &DataRegisterNode); + INTERNAL_TYPE_INDEX_FIELD_DEFN, IMODE_EXECUTE, + NS_SEARCH_PARENT, WalkState, &Info.DataRegisterNode); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } - /* Next arg is the field flags */ Arg = Arg->Next; - FieldFlags = (UINT8) Arg->Value.Integer; + Info.FieldFlags = Arg->Value.Integer8; /* Each remaining arg is a Named Field */ - Arg = Arg->Next; - while (Arg) - { - switch (Arg->Opcode) - { - case AML_INT_RESERVEDFIELD_OP: - - FieldBitPosition += Arg->Value.Size; - break; - - - case AML_INT_ACCESSFIELD_OP: + Info.FieldType = INTERNAL_TYPE_INDEX_FIELD; + Info.RegionNode = RegionNode; - /* - * Get a new AccessType and AccessAttribute for all - * entries (until end or another AccessAs keyword) - */ - FieldFlags = (UINT8) ((FieldFlags & FIELD_ACCESS_TYPE_MASK) || - ((UINT8) (Arg->Value.Integer >> 8))); - break; - - - case AML_INT_NAMEDFIELD_OP: - - Status = AcpiNsLookup (WalkState->ScopeInfo, - (NATIVE_CHAR *) &((ACPI_PARSE2_OBJECT *)Arg)->Name, - INTERNAL_TYPE_INDEX_FIELD, IMODE_LOAD_PASS1, - NS_NO_UPSEARCH | NS_DONT_OPEN_SCOPE, - NULL, &Node); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* - * Initialize an object for the new Node that is on - * the object stack - */ - Status = AcpiExPrepIndexFieldValue (Node, IndexRegisterNode, - DataRegisterNode, FieldFlags, - FieldBitPosition, Arg->Value.Size); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* Keep track of bit position for the *next* field */ - - FieldBitPosition += Arg->Value.Size; - break; - - - default: - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid opcode in field list: %X\n", - Arg->Opcode)); - Status = AE_AML_ERROR; - break; - } - - Arg = Arg->Next; - } + Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Next); return_ACPI_STATUS (Status); } diff --git a/sys/contrib/dev/acpica/dsmethod.c b/sys/contrib/dev/acpica/dsmethod.c index fc5e065..decc393 100644 --- a/sys/contrib/dev/acpica/dsmethod.c +++ b/sys/contrib/dev/acpica/dsmethod.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: dsmethod - Parser/Interpreter interface - control method parsing - * $Revision: 68 $ + * $Revision: 69 $ * *****************************************************************************/ @@ -171,7 +171,7 @@ AcpiDsParseMethod ( } ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Parsing [%4.4s] **** NamedObj=%p\n", - &((ACPI_NAMESPACE_NODE *)ObjHandle)->Name, ObjHandle)); + (char*)&((ACPI_NAMESPACE_NODE *)ObjHandle)->Name, ObjHandle)); /* Extract the method object from the method Node */ @@ -251,7 +251,7 @@ AcpiDsParseMethod ( ObjDesc->Method.OwningId = OwnerId; ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** [%4.4s] Parsed **** NamedObj=%p Op=%p\n", - &((ACPI_NAMESPACE_NODE *)ObjHandle)->Name, ObjHandle, Op)); + (char*)&((ACPI_NAMESPACE_NODE *)ObjHandle)->Name, ObjHandle, Op)); AcpiPsDeleteParseTree (Op); diff --git a/sys/contrib/dev/acpica/dsobject.c b/sys/contrib/dev/acpica/dsobject.c index 558154c..a997831 100644 --- a/sys/contrib/dev/acpica/dsobject.c +++ b/sys/contrib/dev/acpica/dsobject.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: dsobject - Dispatcher object management routines - * $Revision: 76 $ + * $Revision: 81 $ * *****************************************************************************/ @@ -218,7 +218,7 @@ AcpiDsInitOneObject ( if (ACPI_FAILURE (Status)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Method %p [%4.4s] - parse failure, %s\n", - ObjHandle, &((ACPI_NAMESPACE_NODE *)ObjHandle)->Name, + ObjHandle, (char*)&((ACPI_NAMESPACE_NODE *)ObjHandle)->Name, AcpiFormatException (Status))); /* This parse failed, but we will continue parsing more methods */ @@ -338,7 +338,7 @@ AcpiDsInitObjectFromOp ( ObjDesc = *RetObjDesc; OpInfo = AcpiPsGetOpcodeInfo (Opcode); - if (ACPI_GET_OP_TYPE (OpInfo) != ACPI_OP_TYPE_OPCODE) + if (OpInfo->Class == AML_CLASS_UNKNOWN) { /* Unknown opcode */ @@ -414,7 +414,7 @@ AcpiDsInitObjectFromOp ( { if (ByteList->Opcode != AML_INT_BYTELIST_OP) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Expecting bytelist, got: %x\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Expecting bytelist, got: %p\n", ByteList)); return (AE_TYPE); } @@ -462,9 +462,9 @@ AcpiDsInitObjectFromOp ( case INTERNAL_TYPE_REFERENCE: - switch (ACPI_GET_OP_CLASS (OpInfo)) + switch (OpInfo->Type) { - case OPTYPE_LOCAL_VARIABLE: + case AML_TYPE_LOCAL_VARIABLE: /* Split the opcode into a base opcode + offset */ @@ -473,7 +473,7 @@ AcpiDsInitObjectFromOp ( break; - case OPTYPE_METHOD_ARGUMENT: + case AML_TYPE_METHOD_ARGUMENT: /* Split the opcode into a base opcode + offset */ @@ -780,6 +780,16 @@ AcpiDsCreateNode ( FUNCTION_TRACE_PTR ("DsCreateNode", Op); + /* + * Because of the execution pass through the non-control-method + * parts of the table, we can arrive here twice. Only init + * the named object node the first time through + */ + if (Node->Object) + { + return_ACPI_STATUS (AE_OK); + } + if (!Op->Value.Arg) { /* No arguments, there is nothing to do */ @@ -802,15 +812,8 @@ AcpiDsCreateNode ( /* Init obj */ Status = AcpiNsAttachObject (Node, ObjDesc, (UINT8) Node->Type); - if (ACPI_FAILURE (Status)) - { - goto Cleanup; - } - - return_ACPI_STATUS (Status); - -Cleanup: + /* Remove local reference to the object */ AcpiUtRemoveReference (ObjDesc); return_ACPI_STATUS (Status); diff --git a/sys/contrib/dev/acpica/dsopcode.c b/sys/contrib/dev/acpica/dsopcode.c index 623c456..52dec60 100644 --- a/sys/contrib/dev/acpica/dsopcode.c +++ b/sys/contrib/dev/acpica/dsopcode.c @@ -2,7 +2,7 @@ * * Module Name: dsopcode - Dispatcher Op Region support and handling of * "control" opcodes - * $Revision: 55 $ + * $Revision: 56 $ * *****************************************************************************/ @@ -172,7 +172,7 @@ AcpiDsGetBufferFieldArguments ( DEBUG_EXEC(AcpiUtDisplayInitPathname (Node, " [Field]")); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BufferField JIT Init\n", - &Node->Name)); + (char*)&Node->Name)); /* @@ -320,9 +320,8 @@ AcpiDsGetRegionArguments ( DEBUG_EXEC(AcpiUtDisplayInitPathname (Node, " [Operation Region]")); - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] OpRegion Init at AML %p[%x]\n", - &Node->Name, ExtraDesc->Extra.AmlStart, - *(UINT32*) ExtraDesc->Extra.AmlStart)); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] OpRegion Init at AML %p\n", + (char*)&Node->Name, ExtraDesc->Extra.AmlStart)); /* * Allocate a new parser op to be the root of the parsed @@ -850,7 +849,7 @@ AcpiDsEvalRegionOperands ( AcpiUtRemoveReference (OperandDesc); - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8lX%8.8lX Len %X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n", ObjDesc, HIDWORD(ObjDesc->Region.Address), LODWORD(ObjDesc->Region.Address), ObjDesc->Region.Length)); diff --git a/sys/contrib/dev/acpica/dsutils.c b/sys/contrib/dev/acpica/dsutils.c index 55b6663..011db55 100644 --- a/sys/contrib/dev/acpica/dsutils.c +++ b/sys/contrib/dev/acpica/dsutils.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dsutils - Dispatcher utilities - * $Revision: 73 $ + * $Revision: 80 $ * ******************************************************************************/ @@ -179,9 +179,9 @@ AcpiDsIsResultUsed ( */ ParentInfo = AcpiPsGetOpcodeInfo (Op->Parent->Opcode); - if (ACPI_GET_OP_TYPE (ParentInfo) != ACPI_OP_TYPE_OPCODE) + if (ParentInfo->Class == AML_CLASS_UNKNOWN) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown parent opcode. Op=%X\n", Op)); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown parent opcode. Op=%p\n", Op)); return_VALUE (FALSE); } @@ -192,12 +192,12 @@ AcpiDsIsResultUsed ( * Otherwise leave it as is, it will be deleted when it is used * as an operand later. */ - switch (ACPI_GET_OP_CLASS (ParentInfo)) + switch (ParentInfo->Class) { /* * In these cases, the parent will never use the return object */ - case OPTYPE_CONTROL: /* IF, ELSE, WHILE only */ + case AML_CLASS_CONTROL: /* IF, ELSE, WHILE only */ switch (Op->Parent->Opcode) { @@ -206,7 +206,7 @@ AcpiDsIsResultUsed ( /* Never delete the return value associated with a return opcode */ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "Result used, [RETURN] opcode=%X Op=%X\n", Op->Opcode, Op)); + "Result used, [RETURN] opcode=%X Op=%p\n", Op->Opcode, Op)); return_VALUE (TRUE); break; @@ -221,7 +221,7 @@ AcpiDsIsResultUsed ( (WalkState->ControlState->Control.PredicateOp == Op)) { ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "Result used as a predicate, [IF/WHILE] opcode=%X Op=%X\n", + "Result used as a predicate, [IF/WHILE] opcode=%X Op=%p\n", Op->Opcode, Op)); return_VALUE (TRUE); } @@ -233,7 +233,8 @@ AcpiDsIsResultUsed ( /* Fall through to not used case below */ - case OPTYPE_NAMED_OBJECT: /* Scope, method, etc. */ + case AML_CLASS_NAMED_OBJECT: /* Scope, method, etc. */ + case AML_CLASS_CREATE: /* * These opcodes allow TermArg(s) as operands and therefore @@ -248,13 +249,13 @@ AcpiDsIsResultUsed ( (Op->Parent->Opcode == AML_CREATE_QWORD_FIELD_OP)) { ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "Result used, [Region or CreateField] opcode=%X Op=%X\n", + "Result used, [Region or CreateField] opcode=%X Op=%p\n", Op->Opcode, Op)); return_VALUE (TRUE); } ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "Result not used, Parent opcode=%X Op=%X\n", Op->Opcode, Op)); + "Result not used, Parent opcode=%X Op=%p\n", Op->Opcode, Op)); return_VALUE (FALSE); break; @@ -448,6 +449,11 @@ AcpiDsCreateOperand ( * very serious error at this point */ Status = AE_AML_NAME_NOT_FOUND; + + /* TBD: Externalize NameString and print */ + + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Object name was not found in namespace\n")); } } @@ -706,7 +712,7 @@ AcpiDsMapOpcodeToDataType ( OpInfo = AcpiPsGetOpcodeInfo (Opcode); - if (ACPI_GET_OP_TYPE (OpInfo) != ACPI_OP_TYPE_OPCODE) + if (OpInfo->Class == AML_CLASS_UNKNOWN) { /* Unknown opcode */ @@ -714,10 +720,15 @@ AcpiDsMapOpcodeToDataType ( return (DataType); } - switch (ACPI_GET_OP_CLASS (OpInfo)) + +/* + * TBD: Use op class + */ + + switch (OpInfo->Type) { - case OPTYPE_LITERAL: + case AML_TYPE_LITERAL: switch (Opcode) { @@ -747,7 +758,7 @@ AcpiDsMapOpcodeToDataType ( break; - case OPTYPE_DATA_TERM: + case AML_TYPE_DATA_TERM: switch (Opcode) { @@ -770,44 +781,49 @@ AcpiDsMapOpcodeToDataType ( break; - case OPTYPE_CONSTANT: - case OPTYPE_METHOD_ARGUMENT: - case OPTYPE_LOCAL_VARIABLE: + case AML_TYPE_CONSTANT: + case AML_TYPE_METHOD_ARGUMENT: + case AML_TYPE_LOCAL_VARIABLE: DataType = INTERNAL_TYPE_REFERENCE; break; - case OPTYPE_MONADIC2: - case OPTYPE_MONADIC2R: - case OPTYPE_DYADIC2: - case OPTYPE_DYADIC2R: - case OPTYPE_DYADIC2S: - case OPTYPE_TRIADIC: - case OPTYPE_QUADRADIC: - case OPTYPE_HEXADIC: - case OPTYPE_RETURN: + 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 OPTYPE_METHOD_CALL: + case AML_TYPE_METHOD_CALL: Flags = OP_HAS_RETURN_VALUE; DataType = ACPI_TYPE_METHOD; break; - case OPTYPE_NAMED_OBJECT: + 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 OPTYPE_DYADIC1: - case OPTYPE_CONTROL: + 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 */ diff --git a/sys/contrib/dev/acpica/dswexec.c b/sys/contrib/dev/acpica/dswexec.c index 3560087..95c5a3e 100644 --- a/sys/contrib/dev/acpica/dswexec.c +++ b/sys/contrib/dev/acpica/dswexec.c @@ -2,7 +2,7 @@ * * Module Name: dswexec - Dispatcher method execution callbacks; * dispatch to interpreter. - * $Revision: 71 $ + * $Revision: 79 $ * *****************************************************************************/ @@ -129,6 +129,21 @@ #define _COMPONENT ACPI_DISPATCHER MODULE_NAME ("dswexec") +/* + * Dispatch tables for opcode classes + */ +ACPI_EXECUTE_OP AcpiGbl_OpTypeDispatch [] = { + AcpiExOpcode_1A_0T_0R, + AcpiExOpcode_1A_0T_1R, + AcpiExOpcode_1A_1T_0R, + AcpiExOpcode_1A_1T_1R, + AcpiExOpcode_2A_0T_0R, + AcpiExOpcode_2A_0T_1R, + AcpiExOpcode_2A_1T_1R, + AcpiExOpcode_2A_2T_1R, + AcpiExOpcode_3A_0T_0R, + AcpiExOpcode_3A_1T_1R, + AcpiExOpcode_6A_0T_1R}; /***************************************************************************** * @@ -188,7 +203,7 @@ AcpiDsGetPredicateValue ( if (!ObjDesc) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No predicate ObjDesc=%X State=%X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No predicate ObjDesc=%p State=%p\n", ObjDesc, WalkState)); return_ACPI_STATUS (AE_AML_NO_OPERAND); @@ -202,7 +217,7 @@ AcpiDsGetPredicateValue ( if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Bad predicate (not a number) ObjDesc=%X State=%X Type=%X\n", + "Bad predicate (not a number) ObjDesc=%p State=%p Type=%X\n", ObjDesc, WalkState, ObjDesc->Common.Type)); Status = AE_AML_OPERAND_TYPE; @@ -236,7 +251,7 @@ AcpiDsGetPredicateValue ( Cleanup: - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%pn", WalkState->ControlState->Common.Value, WalkState->Op)); /* Break to debugger to display result */ @@ -276,7 +291,7 @@ AcpiDsExecBeginOp ( { ACPI_PARSE_OBJECT *Op; ACPI_STATUS Status = AE_OK; - UINT8 OpcodeClass; + UINT32 OpcodeClass; FUNCTION_TRACE_PTR ("DsExecBeginOp", WalkState); @@ -316,7 +331,7 @@ AcpiDsExecBeginOp ( (WalkState->ControlState->Common.State == CONTROL_CONDITIONAL_EXECUTING)) { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Exec predicate Op=%X State=%X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Exec predicate Op=%p State=%p\n", Op, WalkState)); WalkState->ControlState->Common.State = CONTROL_PREDICATE_EXECUTING; @@ -327,13 +342,13 @@ AcpiDsExecBeginOp ( } - OpcodeClass = (UINT8) ACPI_GET_OP_CLASS (WalkState->OpInfo); + OpcodeClass = WalkState->OpInfo->Class; /* We want to send namepaths to the load code */ if (Op->Opcode == AML_INT_NAMEPATH_OP) { - OpcodeClass = OPTYPE_NAMED_OBJECT; + OpcodeClass = AML_CLASS_NAMED_OBJECT; } /* @@ -341,7 +356,7 @@ AcpiDsExecBeginOp ( */ switch (OpcodeClass) { - case OPTYPE_CONTROL: + case AML_CLASS_CONTROL: Status = AcpiDsResultStackPush (WalkState); if (ACPI_FAILURE (Status)) @@ -353,7 +368,7 @@ AcpiDsExecBeginOp ( break; - case OPTYPE_NAMED_OBJECT: + case AML_CLASS_NAMED_OBJECT: if (WalkState->WalkType == WALK_METHOD) { @@ -378,18 +393,8 @@ AcpiDsExecBeginOp ( /* most operators with arguments */ - case OPTYPE_MONADIC1: - case OPTYPE_DYADIC1: - case OPTYPE_MONADIC2: - case OPTYPE_MONADIC2R: - case OPTYPE_DYADIC2: - case OPTYPE_DYADIC2R: - case OPTYPE_DYADIC2S: - case OPTYPE_RECONFIGURATION: - case OPTYPE_TRIADIC: - case OPTYPE_QUADRADIC: - case OPTYPE_HEXADIC: - case OPTYPE_CREATE_FIELD: + case AML_CLASS_EXECUTE: + case AML_CLASS_CREATE: /* Start a new result/operand state */ @@ -429,7 +434,8 @@ AcpiDsExecEndOp ( { ACPI_PARSE_OBJECT *Op; ACPI_STATUS Status = AE_OK; - UINT8 Optype; + UINT32 OpType; + UINT32 OpClass; ACPI_PARSE_OBJECT *NextOp; ACPI_PARSE_OBJECT *FirstArg; UINT32 i; @@ -438,16 +444,16 @@ AcpiDsExecEndOp ( FUNCTION_TRACE_PTR ("DsExecEndOp", WalkState); - Op = WalkState->Op; - + Op = WalkState->Op; + OpType = WalkState->OpInfo->Type; + OpClass = WalkState->OpInfo->Class; - if (ACPI_GET_OP_TYPE (WalkState->OpInfo) != ACPI_OP_TYPE_OPCODE) + if (OpClass == AML_CLASS_UNKNOWN) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown opcode %X\n", Op->Opcode)); return_ACPI_STATUS (AE_NOT_IMPLEMENTED); } - Optype = (UINT8) ACPI_GET_OP_CLASS (WalkState->OpInfo); FirstArg = Op->Value.Arg; /* Init the walk state */ @@ -459,48 +465,20 @@ AcpiDsExecEndOp ( /* Call debugger for single step support (DEBUG build only) */ - DEBUGGER_EXEC (Status = AcpiDbSingleStep (WalkState, Op, Optype)); + DEBUGGER_EXEC (Status = AcpiDbSingleStep (WalkState, Op, OpClass)); DEBUGGER_EXEC (if (ACPI_FAILURE (Status)) {return_ACPI_STATUS (Status);}); - /* Decode the opcode */ - - switch (Optype) + switch (OpClass) { - case OPTYPE_UNDEFINED: - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Undefined opcode type Op=%X\n", Op)); - return_ACPI_STATUS (AE_NOT_IMPLEMENTED); - break; - + /* Decode the Opcode Class */ - case OPTYPE_BOGUS: - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Internal opcode=%X type Op=%X\n", - WalkState->Opcode, Op)); + case AML_CLASS_ARGUMENT: /* constants, literals, etc. do nothing */ break; - case OPTYPE_CONSTANT: /* argument type only */ - case OPTYPE_LITERAL: /* argument type only */ - case OPTYPE_DATA_TERM: /* argument type only */ - case OPTYPE_LOCAL_VARIABLE: /* argument type only */ - case OPTYPE_METHOD_ARGUMENT: /* argument type only */ - break; - - /* most operators with arguments */ - case OPTYPE_MONADIC1: - case OPTYPE_DYADIC1: - case OPTYPE_MONADIC2: - case OPTYPE_MONADIC2R: - case OPTYPE_DYADIC2: - case OPTYPE_DYADIC2R: - case OPTYPE_DYADIC2S: - case OPTYPE_RECONFIGURATION: - case OPTYPE_TRIADIC: - case OPTYPE_QUADRADIC: - case OPTYPE_HEXADIC: - + case AML_CLASS_EXECUTE: /* Build resolved operand stack */ @@ -547,98 +525,26 @@ AcpiDsExecEndOp ( DUMP_OPERANDS (WALK_OPERANDS, IMODE_EXECUTE, AcpiPsGetOpcodeName (WalkState->Opcode), WalkState->NumOperands, "after ExResolveOperands"); - switch (Optype) - { - case OPTYPE_MONADIC1: - - /* 1 Operand, 0 ExternalResult, 0 InternalResult */ - - Status = AcpiExMonadic1 (WalkState); - break; - - - case OPTYPE_MONADIC2: - - /* 1 Operand, 0 ExternalResult, 1 InternalResult */ - - Status = AcpiExMonadic2 (WalkState); - break; - - - case OPTYPE_MONADIC2R: - - /* 1 Operand, 1 ExternalResult, 1 InternalResult */ - - Status = AcpiExMonadic2R (WalkState); - break; - - - case OPTYPE_DYADIC1: - - /* 2 Operands, 0 ExternalResult, 0 InternalResult */ - - Status = AcpiExDyadic1 (WalkState); - break; - - - case OPTYPE_DYADIC2: - - /* 2 Operands, 0 ExternalResult, 1 InternalResult */ - - Status = AcpiExDyadic2 (WalkState); - break; - - - case OPTYPE_DYADIC2R: - - /* 2 Operands, 1 or 2 ExternalResults, 1 InternalResult */ - - Status = AcpiExDyadic2R (WalkState); - break; - - - case OPTYPE_DYADIC2S: /* Synchronization Operator */ - - /* 2 Operands, 0 ExternalResult, 1 InternalResult */ - - Status = AcpiExDyadic2S (WalkState); - break; - - - case OPTYPE_TRIADIC: /* WalkState->Opcode with 3 operands */ - - /* 3 Operands, 1 ExternalResult, 1 InternalResult */ - - Status = AcpiExTriadic (WalkState); - break; - - - case OPTYPE_QUADRADIC: /* Opcode with 4 operands */ - break; - - - case OPTYPE_HEXADIC: /* Opcode with 6 operands */ - - /* 6 Operands, 0 ExternalResult, 1 InternalResult */ - - Status = AcpiExHexadic (WalkState); - break; - - - case OPTYPE_RECONFIGURATION: - - /* 1 or 2 operands, 0 Internal Result */ + /* + * Dispatch the request to the appropriate interpreter handler + * routine. There is one routine per opcode "type" based upon the + * number of opcode arguments and return type. + */ + Status = AcpiGbl_OpTypeDispatch [OpType] (WalkState); - Status = AcpiExReconfiguration (WalkState); - break; - } - /* Clear the operand stack */ + /* Delete argument objects and clear the operand stack */ for (i = 0; i < WalkState->NumOperands; i++) { + /* + * Remove a reference to all operands, including both + * "Arguments" and "Targets". + */ + AcpiUtRemoveReference (WalkState->Operands[i]); WalkState->Operands[i] = NULL; } + WalkState->NumOperands = 0; /* @@ -654,138 +560,135 @@ AcpiDsExecEndOp ( break; - case OPTYPE_CONTROL: /* Type 1 opcode, IF/ELSE/WHILE/NOOP */ - - /* 1 Operand, 0 ExternalResult, 0 InternalResult */ - - Status = AcpiDsExecEndControlOp (WalkState, Op); - - AcpiDsResultStackPop (WalkState); - break; + default: + switch (OpType) + { + case AML_TYPE_CONTROL: /* Type 1 opcode, IF/ELSE/WHILE/NOOP */ - case OPTYPE_METHOD_CALL: + /* 1 Operand, 0 ExternalResult, 0 InternalResult */ - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%X\n", Op)); + Status = AcpiDsExecEndControlOp (WalkState, Op); - /* - * (AML_METHODCALL) Op->Value->Arg->Node contains - * the method Node pointer - */ - /* NextOp points to the op that holds the method name */ + AcpiDsResultStackPop (WalkState); + break; - NextOp = FirstArg; - /* NextOp points to first argument op */ + case AML_TYPE_METHOD_CALL: - NextOp = NextOp->Next; + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%p\n", Op)); - /* - * Get the method's arguments and put them on the operand stack - */ - Status = AcpiDsCreateOperands (WalkState, NextOp); - if (ACPI_FAILURE (Status)) - { - break; - } + /* + * (AML_METHODCALL) Op->Value->Arg->Node contains + * the method Node pointer + */ + /* NextOp points to the op that holds the method name */ - /* - * Since the operands will be passed to another - * control method, we must resolve all local - * references here (Local variables, arguments - * to *this* method, etc.) - */ - Status = AcpiDsResolveOperands (WalkState); - if (ACPI_FAILURE (Status)) - { - break; - } + NextOp = FirstArg; - /* - * Tell the walk loop to preempt this running method and - * execute the new method - */ - Status = AE_CTRL_TRANSFER; + /* NextOp points to first argument op */ - /* - * Return now; we don't want to disturb anything, - * especially the operand count! - */ - return_ACPI_STATUS (Status); - break; + NextOp = NextOp->Next; + /* + * Get the method's arguments and put them on the operand stack + */ + Status = AcpiDsCreateOperands (WalkState, NextOp); + if (ACPI_FAILURE (Status)) + { + break; + } - case OPTYPE_CREATE_FIELD: + /* + * Since the operands will be passed to another + * control method, we must resolve all local + * references here (Local variables, arguments + * to *this* method, etc.) + */ + Status = AcpiDsResolveOperands (WalkState); + if (ACPI_FAILURE (Status)) + { + break; + } - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "Executing CreateField Buffer/Index Op=%X\n", Op)); + /* + * Tell the walk loop to preempt this running method and + * execute the new method + */ + Status = AE_CTRL_TRANSFER; - Status = AcpiDsLoad2EndOp (WalkState); - if (ACPI_FAILURE (Status)) - { + /* + * Return now; we don't want to disturb anything, + * especially the operand count! + */ + return_ACPI_STATUS (Status); break; - } - Status = AcpiDsEvalBufferFieldOperands (WalkState, Op); - break; + case AML_TYPE_CREATE_FIELD: - case OPTYPE_NAMED_OBJECT: + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "Executing CreateField Buffer/Index Op=%p\n", Op)); - Status = AcpiDsLoad2EndOp (WalkState); - if (ACPI_FAILURE (Status)) - { + Status = AcpiDsLoad2EndOp (WalkState); + if (ACPI_FAILURE (Status)) + { + break; + } + + Status = AcpiDsEvalBufferFieldOperands (WalkState, Op); break; - } - switch (Op->Opcode) - { - case AML_REGION_OP: - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "Executing OpRegion Address/Length Op=%X\n", Op)); + case AML_TYPE_NAMED_FIELD: + case AML_TYPE_NAMED_COMPLEX: + case AML_TYPE_NAMED_SIMPLE: - Status = AcpiDsEvalRegionOperands (WalkState, Op); + Status = AcpiDsLoad2EndOp (WalkState); if (ACPI_FAILURE (Status)) { break; } - Status = AcpiDsResultStackPop (WalkState); - break; + if (Op->Opcode == AML_REGION_OP) + { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "Executing OpRegion Address/Length Op=%p\n", Op)); + Status = AcpiDsEvalRegionOperands (WalkState, Op); + if (ACPI_FAILURE (Status)) + { + break; + } - case AML_METHOD_OP: - break; + Status = AcpiDsResultStackPop (WalkState); + } + break; - case AML_ALIAS_OP: + case AML_TYPE_UNDEFINED: - /* Alias creation was already handled by call - to psxload above */ + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Undefined opcode type Op=%p\n", Op)); + return_ACPI_STATUS (AE_NOT_IMPLEMENTED); break; - default: - /* Nothing needs to be done */ - - Status = AE_OK; + case AML_TYPE_BOGUS: + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Internal opcode=%X type Op=%p\n", + WalkState->Opcode, Op)); break; - } - - break; - default: + default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Unimplemented opcode, type=%X Opcode=%X Op=%X\n", - Optype, Op->Opcode, Op)); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Unimplemented opcode, class=%X type=%X Opcode=%X Op=%p\n", + OpClass, OpType, Op->Opcode, Op)); - Status = AE_NOT_IMPLEMENTED; - break; + Status = AE_NOT_IMPLEMENTED; + break; + } } - /* * ACPI 2.0 support for 64-bit integers: * Truncate numeric result value if we are executing from a 32-bit ACPI table diff --git a/sys/contrib/dev/acpica/dswload.c b/sys/contrib/dev/acpica/dswload.c index e4434e9..844aa01 100644 --- a/sys/contrib/dev/acpica/dswload.c +++ b/sys/contrib/dev/acpica/dswload.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: dswload - Dispatcher namespace load callbacks - * $Revision: 48 $ + * $Revision: 50 $ * *****************************************************************************/ @@ -129,6 +129,19 @@ MODULE_NAME ("dswload") +/******************************************************************************* + * + * FUNCTION: AcpiDsInitCallbacks + * + * PARAMETERS: WalkState - Current state of the parse tree walk + * PassNumber - 1, 2, or 3 + * + * RETURN: Status + * + * DESCRIPTION: Init walk state callbacks + * + ******************************************************************************/ + ACPI_STATUS AcpiDsInitCallbacks ( ACPI_WALK_STATE *WalkState, @@ -405,7 +418,6 @@ AcpiDsLoad2BeginOp ( return (AE_OK); } } - else { /* Get name from the op */ @@ -413,7 +425,6 @@ AcpiDsLoad2BeginOp ( BufferPtr = (NATIVE_CHAR *) &((ACPI_PARSE2_OBJECT *)Op)->Name; } } - else { BufferPtr = AcpiPsGetNextNamestring (&WalkState->ParserState); @@ -539,6 +550,7 @@ AcpiDsLoad2EndOp ( ACPI_NAMESPACE_NODE *Node; ACPI_PARSE_OBJECT *Arg; ACPI_NAMESPACE_NODE *NewNode; + UINT32 i; PROC_NAME ("DsLoad2EndOp"); @@ -621,330 +633,194 @@ AcpiDsLoad2EndOp ( * AML_THERMALZONE */ + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, + "Create-Load [%s] State=%p Op=%p NamedObj=%p\n", + AcpiPsGetOpcodeName (Op->Opcode), WalkState, Op, Node)); /* Decode the opcode */ Arg = Op->Value.Arg; - switch (Op->Opcode) + switch (WalkState->OpInfo->Type) { - - case AML_CREATE_FIELD_OP: - case AML_CREATE_BIT_FIELD_OP: - case AML_CREATE_BYTE_FIELD_OP: - case AML_CREATE_WORD_FIELD_OP: - case AML_CREATE_DWORD_FIELD_OP: - case AML_CREATE_QWORD_FIELD_OP: + case AML_TYPE_CREATE_FIELD: /* * Create the field object, but the field buffer and index must * be evaluated later during the execution phase */ - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "CreateXxxField: State=%p Op=%p NamedObj=%p\n", - WalkState, Op, Node)); - - /* Get the NameString argument */ - - if (Op->Opcode == AML_CREATE_FIELD_OP) - { - Arg = AcpiPsGetArg (Op, 3); - } - else - { - /* Create Bit/Byte/Word/Dword field */ - - Arg = AcpiPsGetArg (Op, 2); - } - - if (!Arg) - { - Status = AE_AML_NO_OPERAND; - goto Cleanup; - } - - /* - * 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, - WalkState, &(NewNode)); - if (ACPI_FAILURE (Status)) - { - goto Cleanup; - } - - /* We could put the returned object (Node) on the object stack for later, but - * for now, we will put it in the "op" object that the parser uses, so we - * can get it again at the end of this scope - */ - Op->Node = NewNode; - - /* - * If there is no object attached to the node, this node was just created and - * we need to create the field object. Otherwise, this was a lookup of an - * existing node and we don't want to create the field object again. - */ - if (!NewNode->Object) - { - /* - * The Field definition is not fully parsed at this time. - * (We must save the address of the AML for the buffer and index operands) - */ - Status = AcpiExCreateBufferField (((ACPI_PARSE2_OBJECT *) Op)->Data, - ((ACPI_PARSE2_OBJECT *) Op)->Length, - NewNode, WalkState); - } + Status = AcpiDsCreateBufferField (Op, WalkState); break; - case AML_INT_METHODCALL_OP: - - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "RESOLVING-MethodCall: State=%p Op=%p NamedObj=%p\n", - WalkState, Op, Node)); + case AML_TYPE_NAMED_FIELD: - /* - * Lookup the method name and save the Node - */ - Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Value.String, - ACPI_TYPE_ANY, IMODE_LOAD_PASS2, - NS_SEARCH_PARENT | NS_DONT_OPEN_SCOPE, - WalkState, &(NewNode)); - if (ACPI_SUCCESS (Status)) + Arg = Op->Value.Arg; + switch (Op->Opcode) { - /* TBD: has name already been resolved by here ??*/ - - /* TBD: [Restructure] Make sure that what we found is indeed a method! */ - /* We didn't search for a method on purpose, to see if the name would resolve! */ - - /* We could put the returned object (Node) on the object stack for later, but - * for now, we will put it in the "op" object that the parser uses, so we - * can get it again at the end of this scope - */ - Op->Node = NewNode; - } + case AML_INDEX_FIELD_OP: + Status = AcpiDsCreateIndexField (Op, (ACPI_HANDLE) Arg->Node, + WalkState); + break; - break; + case AML_BANK_FIELD_OP: - case AML_PROCESSOR_OP: + Status = AcpiDsCreateBankField (Op, Arg->Node, WalkState); + break; - /* Nothing to do other than enter object into namespace */ - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "LOADING-Processor: State=%p Op=%p NamedObj=%p\n", - WalkState, Op, Node)); + case AML_FIELD_OP: - Status = AcpiExCreateProcessor (Op, Node); - if (ACPI_FAILURE (Status)) - { - goto Cleanup; + Status = AcpiDsCreateField (Op, Arg->Node, WalkState); + break; } - - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "Completed Processor Init, Op=%p State=%p entry=%p\n", - Op, WalkState, Node)); break; - case AML_POWER_RES_OP: - - /* Nothing to do other than enter object into namespace */ + case AML_TYPE_NAMED_SIMPLE: - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "LOADING-PowerResource: State=%p Op=%p NamedObj=%p\n", - WalkState, Op, Node)); - - Status = AcpiExCreatePowerResource (Op, Node); + Status = AcpiDsCreateOperands (WalkState, Arg); if (ACPI_FAILURE (Status)) { goto Cleanup; } - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "Completed PowerResource Init, Op=%p State=%p entry=%p\n", - Op, WalkState, Node)); - break; - - - case AML_THERMAL_ZONE_OP: - - /* Nothing to do other than enter object into namespace */ - - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "LOADING-ThermalZone: State=%p Op=%p NamedObj=%p\n", - WalkState, Op, Node)); - break; - - - case AML_FIELD_OP: - - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "LOADING-Field: State=%p Op=%p NamedObj=%p\n", - WalkState, Op, Node)); - - Arg = Op->Value.Arg; + switch (Op->Opcode) + { + case AML_PROCESSOR_OP: - Status = AcpiDsCreateField (Op, Arg->Node, WalkState); - break; + Status = AcpiExCreateProcessor (WalkState); + break; - case AML_INDEX_FIELD_OP: + case AML_POWER_RES_OP: - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "LOADING-IndexField: State=%p Op=%p NamedObj=%p\n", - WalkState, Op, Node)); + Status = AcpiExCreatePowerResource (WalkState); + break; - Arg = Op->Value.Arg; - Status = AcpiDsCreateIndexField (Op, (ACPI_HANDLE) Arg->Node, - WalkState); - break; + case AML_MUTEX_OP: + Status = AcpiExCreateMutex (WalkState); + break; - case AML_BANK_FIELD_OP: - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "LOADING-BankField: State=%p Op=%p NamedObj=%p\n", - WalkState, Op, Node)); - - Arg = Op->Value.Arg; - Status = AcpiDsCreateBankField (Op, Arg->Node, WalkState); - break; + case AML_EVENT_OP: + Status = AcpiExCreateEvent (WalkState); + break; - /* - * MethodOp PkgLength NamesString MethodFlags TermList - */ - case AML_METHOD_OP: - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "LOADING-Method: State=%p Op=%p NamedObj=%p\n", - WalkState, Op, Node)); + case AML_DATA_REGION_OP: - if (!Node->Object) - { - Status = AcpiExCreateMethod (((ACPI_PARSE2_OBJECT *) Op)->Data, - ((ACPI_PARSE2_OBJECT *) Op)->Length, - Arg->Value.Integer32, Node); - } - break; + Status = AcpiExCreateTableRegion (WalkState); + break; + case AML_ALIAS_OP: - case AML_MUTEX_OP: + Status = AcpiExCreateAlias (WalkState); + break; - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "LOADING-Mutex: Op=%p State=%p\n", Op, WalkState)); + default: + /* Unknown opcode */ - Status = AcpiDsCreateOperands (WalkState, Arg); - if (ACPI_FAILURE (Status)) - { + Status = AE_OK; goto Cleanup; + break; } - Status = AcpiExCreateMutex (WalkState); - break; - - - case AML_EVENT_OP: + /* Delete operands */ - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "LOADING-Event: Op=%p State=%p\n", Op, WalkState)); - - Status = AcpiDsCreateOperands (WalkState, Arg); - if (ACPI_FAILURE (Status)) + for (i = 1; i < WalkState->NumOperands; i++) { - goto Cleanup; + AcpiUtRemoveReference (WalkState->Operands[i]); + WalkState->Operands[i] = NULL; } - Status = AcpiExCreateEvent (WalkState); break; - case AML_REGION_OP: + case AML_TYPE_NAMED_COMPLEX: - if (Node->Object) + switch (Op->Opcode) { - break; - } + case AML_METHOD_OP: + /* + * MethodOp PkgLength NamesString MethodFlags TermList + */ + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, + "LOADING-Method: State=%p Op=%p NamedObj=%p\n", + WalkState, Op, Node)); - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "LOADING-OpRegion: Op=%p State=%p NamedObj=%p\n", - Op, WalkState, Node)); + if (!Node->Object) + { + Status = AcpiDsCreateOperands (WalkState, Arg); + if (ACPI_FAILURE (Status)) + { + goto Cleanup; + } - /* - * 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); + Status = AcpiExCreateMethod (((ACPI_PARSE2_OBJECT *) Op)->Data, + ((ACPI_PARSE2_OBJECT *) Op)->Length, + WalkState); + } + break; - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "Completed OpRegion Init, Op=%p State=%p entry=%p\n", - Op, WalkState, Node)); - break; + case AML_REGION_OP: + /* + * 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); + break; - case AML_DATA_REGION_OP: - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "LOADING-DataRegion: Op=%p State=%p NamedObj=%p\n", - Op, WalkState, Node)); + case AML_NAME_OP: - Status = AcpiDsCreateOperands (WalkState, Arg); - if (ACPI_FAILURE (Status)) - { - goto Cleanup; + Status = AcpiDsCreateNode (WalkState, Node, Op); + break; } - - Status = AcpiExCreateTableRegion (WalkState); break; - /* Namespace Modifier Opcodes */ - - case AML_ALIAS_OP: - - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "LOADING-Alias: Op=%p State=%p\n", Op, WalkState)); + case AML_CLASS_INTERNAL: - Status = AcpiDsCreateOperands (WalkState, Arg); - if (ACPI_FAILURE (Status)) - { - goto Cleanup; - } - - Status = AcpiExCreateAlias (WalkState); + /* case AML_INT_NAMEPATH_OP: */ break; - case AML_NAME_OP: + case AML_CLASS_METHOD_CALL: ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "LOADING-Name: Op=%p State=%p\n", Op, WalkState)); + "RESOLVING-MethodCall: State=%p Op=%p NamedObj=%p\n", + WalkState, Op, Node)); /* - * Because of the execution pass through the non-control-method - * parts of the table, we can arrive here twice. Only init - * the named object node the first time through + * Lookup the method name and save the Node */ - if (!Node->Object) + Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Value.String, + ACPI_TYPE_ANY, IMODE_LOAD_PASS2, + NS_SEARCH_PARENT | NS_DONT_OPEN_SCOPE, + WalkState, &(NewNode)); + if (ACPI_SUCCESS (Status)) { - Status = AcpiDsCreateNode (WalkState, Node, Op); - } - - break; + /* TBD: has name already been resolved by here ??*/ + /* TBD: [Restructure] Make sure that what we found is indeed a method! */ + /* We didn't search for a method on purpose, to see if the name would resolve! */ - case AML_INT_NAMEPATH_OP: + /* We could put the returned object (Node) on the object stack for later, but + * for now, we will put it in the "op" object that the parser uses, so we + * can get it again at the end of this scope + */ + Op->Node = NewNode; + } - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "LOADING-NamePath object: State=%p Op=%p NamedObj=%p\n", - WalkState, Op, Node)); break; @@ -957,7 +833,8 @@ Cleanup: /* Remove the Node pushed at the very beginning */ - AcpiDsObjStackPop (1, WalkState); + WalkState->Operands[0] = NULL; + WalkState->NumOperands = 0; return (Status); } diff --git a/sys/contrib/dev/acpica/evevent.c b/sys/contrib/dev/acpica/evevent.c index 92b51e6..fc52268 100644 --- a/sys/contrib/dev/acpica/evevent.c +++ b/sys/contrib/dev/acpica/evevent.c @@ -2,7 +2,7 @@ * * Module Name: evevent - Fixed and General Purpose AcpiEvent * handling and dispatch - * $Revision: 50 $ + * $Revision: 51 $ * *****************************************************************************/ @@ -554,9 +554,9 @@ AcpiEvGpeInitialize (void) RegisterIndex++; } - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "GPE registers: %X@%p (Blk0) %X@%p (Blk1)\n", - Gpe0RegisterCount, AcpiGbl_FADT->XGpe0Blk.Address, Gpe1RegisterCount, - AcpiGbl_FADT->XGpe1Blk.Address)); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "GPE registers: %X@%8.8X%8.8X (Blk0) %X@%8.8X%8.8X (Blk1)\n", + Gpe0RegisterCount, HIDWORD(AcpiGbl_FADT->XGpe0Blk.Address), LODWORD(AcpiGbl_FADT->XGpe0Blk.Address), + Gpe1RegisterCount, HIDWORD(AcpiGbl_FADT->XGpe1Blk.Address), LODWORD(AcpiGbl_FADT->XGpe1Blk.Address))); return_ACPI_STATUS (AE_OK); } diff --git a/sys/contrib/dev/acpica/evmisc.c b/sys/contrib/dev/acpica/evmisc.c index 2db9a94..b1010f3 100644 --- a/sys/contrib/dev/acpica/evmisc.c +++ b/sys/contrib/dev/acpica/evmisc.c @@ -2,7 +2,7 @@ * * Module Name: evmisc - ACPI device notification handler dispatch * and ACPI Global Lock support - * $Revision: 34 $ + * $Revision: 35 $ * *****************************************************************************/ @@ -180,7 +180,7 @@ AcpiEvQueueNotifyRequest ( break; default: - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Unknown Notify Value: %lx \n", NotifyValue)); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Unknown Notify Value: %X \n", NotifyValue)); break; } diff --git a/sys/contrib/dev/acpica/evregion.c b/sys/contrib/dev/acpica/evregion.c index 882af34..f0e35b2 100644 --- a/sys/contrib/dev/acpica/evregion.c +++ b/sys/contrib/dev/acpica/evregion.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evregion - ACPI AddressSpace (OpRegion) handler dispatch - * $Revision: 110 $ + * $Revision: 113 $ * *****************************************************************************/ @@ -246,17 +246,16 @@ AcpiEvExecuteRegMethod ( Params[1] = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); if (!Params[1]) { - AcpiUtRemoveReference (Params[0]); - return_ACPI_STATUS (AE_NO_MEMORY); + Status = AE_NO_MEMORY; + goto Cleanup; } - Params[2] = NULL; - /* * Set up the parameter objects */ Params[0]->Integer.Value = RegionObj->Region.SpaceId; Params[1]->Integer.Value = Function; + Params[2] = NULL; /* * Execute the method, no return value @@ -264,9 +263,10 @@ AcpiEvExecuteRegMethod ( DEBUG_EXEC(AcpiUtDisplayInitPathname (RegionObj->Region.Extra->Extra.Method_REG, " [Method]")); Status = AcpiNsEvaluateByHandle (RegionObj->Region.Extra->Extra.Method_REG, Params, NULL); + AcpiUtRemoveReference (Params[1]); +Cleanup: AcpiUtRemoveReference (Params[0]); - AcpiUtRemoveReference (Params[1]); return_ACPI_STATUS (Status); } @@ -379,7 +379,7 @@ AcpiEvAddressSpaceDispatch ( Handler = HandlerDesc->AddrHandler.Handler; ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, - "Addrhandler %p (%p), Address %8.8lX%8.8lX\n", + "Addrhandler %p (%p), Address %8.8X%8.8X\n", &RegionObj->Region.AddrHandler->AddrHandler, Handler, HIDWORD(Address), LODWORD(Address))); @@ -663,7 +663,7 @@ AcpiEvAddrHandlerHelper ( /* Convert and validate the device handle */ - Node = AcpiNsConvertHandleToEntry (ObjHandle); + Node = AcpiNsMapHandleToNode (ObjHandle); if (!Node) { return (AE_BAD_PARAMETER); diff --git a/sys/contrib/dev/acpica/evrgnini.c b/sys/contrib/dev/acpica/evrgnini.c index 5df0cb0..17adfdd 100644 --- a/sys/contrib/dev/acpica/evrgnini.c +++ b/sys/contrib/dev/acpica/evrgnini.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evrgnini- ACPI AddressSpace (OpRegion) init - * $Revision: 47 $ + * $Revision: 48 $ * *****************************************************************************/ @@ -257,7 +257,7 @@ AcpiEvPciConfigRegionSetup ( * routine checks before we get here, but we check again just in case. */ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, - "Attempting to init a region %X, with no handler\n", RegionObj)); + "Attempting to init a region %p, with no handler\n", RegionObj)); return_ACPI_STATUS (AE_NOT_EXIST); } diff --git a/sys/contrib/dev/acpica/evxface.c b/sys/contrib/dev/acpica/evxface.c index 085bbdc..1fa9432 100644 --- a/sys/contrib/dev/acpica/evxface.c +++ b/sys/contrib/dev/acpica/evxface.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evxface - External interfaces for ACPI events - * $Revision: 114 $ + * $Revision: 116 $ * *****************************************************************************/ @@ -174,7 +174,7 @@ AcpiInstallFixedEventHandler ( } - /* Install the handler before enabling the event - just in case... */ + /* Install the handler before enabling the event */ AcpiGbl_FixedEventHandlers[Event].Handler = Handler; AcpiGbl_FixedEventHandlers[Event].Context = Context; @@ -236,7 +236,7 @@ AcpiRemoveFixedEventHandler ( AcpiUtAcquireMutex (ACPI_MTX_EVENTS); - /* Disable the event before removing the handler - just in case... */ + /* Disable the event before removing the handler */ Status = AcpiDisableEvent(Event, ACPI_EVENT_FIXED, 0); @@ -245,13 +245,11 @@ AcpiRemoveFixedEventHandler ( AcpiGbl_FixedEventHandlers[Event].Handler = NULL; AcpiGbl_FixedEventHandlers[Event].Context = NULL; - - if (!ACPI_SUCCESS(Status)) + if (!ACPI_SUCCESS (Status)) { ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Could not write to fixed event enable register.\n")); } - else { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Disabled fixed event %X.\n", Event)); @@ -307,7 +305,7 @@ AcpiInstallNotifyHandler ( /* Convert and validate the device handle */ - DeviceNode = AcpiNsConvertHandleToEntry (Device); + DeviceNode = AcpiNsMapHandleToNode (Device); if (!DeviceNode) { Status = AE_BAD_PARAMETER; @@ -316,7 +314,6 @@ AcpiInstallNotifyHandler ( /* * Root Object: - * ------------ * Registering a notify handler on the root object indicates that the * caller wishes to receive notifications for all objects. Note that * only one <external> global handler can be regsitered (per notify type). @@ -351,12 +348,12 @@ AcpiInstallNotifyHandler ( } /* - * Other Objects: - * -------------- + * All Other Objects: * 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 */ @@ -432,6 +429,7 @@ AcpiInstallNotifyHandler ( } } + UnlockAndExit: AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (Status); @@ -480,7 +478,7 @@ AcpiRemoveNotifyHandler ( /* Convert and validate the device handle */ - DeviceNode = AcpiNsConvertHandleToEntry (Device); + DeviceNode = AcpiNsMapHandleToNode (Device); if (!DeviceNode) { Status = AE_BAD_PARAMETER; @@ -488,11 +486,10 @@ AcpiRemoveNotifyHandler ( } /* - * Root Object: - * ------------ + * 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")); if (((HandlerType == ACPI_SYSTEM_NOTIFY) && @@ -504,23 +501,25 @@ AcpiRemoveNotifyHandler ( goto UnlockAndExit; } - if (HandlerType == ACPI_SYSTEM_NOTIFY) { - AcpiGbl_SysNotify.Node = NULL; + if (HandlerType == ACPI_SYSTEM_NOTIFY) + { + AcpiGbl_SysNotify.Node = NULL; AcpiGbl_SysNotify.Handler = NULL; AcpiGbl_SysNotify.Context = NULL; } - else { - AcpiGbl_DrvNotify.Node = NULL; + else + { + AcpiGbl_DrvNotify.Node = NULL; AcpiGbl_DrvNotify.Handler = NULL; AcpiGbl_DrvNotify.Context = NULL; } } /* - * Other Objects: - * -------------- + * All Other Objects */ - else { + else + { /* * These are the ONLY objects that can receive ACPI notifications */ @@ -646,6 +645,7 @@ AcpiInstallGpeHandler ( AcpiHwClearGpe (GpeNumber); AcpiHwEnableGpe (GpeNumber); + Cleanup: AcpiUtReleaseMutex (ACPI_MTX_EVENTS); return_ACPI_STATUS (Status); @@ -710,6 +710,7 @@ AcpiRemoveGpeHandler ( AcpiGbl_GpeInfo[GpeNumber].Handler = NULL; AcpiGbl_GpeInfo[GpeNumber].Context = NULL; + Cleanup: AcpiUtReleaseMutex (ACPI_MTX_EVENTS); return_ACPI_STATUS (Status); @@ -728,6 +729,7 @@ Cleanup: * DESCRIPTION: Acquire the ACPI Global Lock * ******************************************************************************/ + ACPI_STATUS AcpiAcquireGlobalLock ( void) @@ -768,6 +770,7 @@ ACPI_STATUS AcpiReleaseGlobalLock ( void) { + AcpiEvReleaseGlobalLock (); return (AE_OK); } diff --git a/sys/contrib/dev/acpica/evxfregn.c b/sys/contrib/dev/acpica/evxfregn.c index 0286c78..6e93229 100644 --- a/sys/contrib/dev/acpica/evxfregn.c +++ b/sys/contrib/dev/acpica/evxfregn.c @@ -2,7 +2,7 @@ * * Module Name: evxfregn - External Interfaces, ACPI Operation Regions and * Address Spaces. - * $Revision: 38 $ + * $Revision: 40 $ * *****************************************************************************/ @@ -176,7 +176,7 @@ AcpiInstallAddressSpaceHandler ( /* Convert and validate the device handle */ - Node = AcpiNsConvertHandleToEntry (Device); + Node = AcpiNsMapHandleToNode (Device); if (!Node) { Status = AE_BAD_PARAMETER; @@ -184,9 +184,9 @@ AcpiInstallAddressSpaceHandler ( } /* - * This registration is valid for only the types below - * and the root. This is where the default handlers - * get placed. + * This registration is valid for only the types below + * and the root. This is where the default handlers + * get placed. */ if ((Node->Type != ACPI_TYPE_DEVICE) && (Node->Type != ACPI_TYPE_PROCESSOR) && @@ -236,7 +236,7 @@ AcpiInstallAddressSpaceHandler ( } /* - * If the caller hasn't specified a setup routine, use the default + * If the caller hasn't specified a setup routine, use the default */ if (!Setup) { @@ -244,14 +244,14 @@ AcpiInstallAddressSpaceHandler ( } /* - * Check for an existing internal object + * Check for an existing internal object */ ObjDesc = AcpiNsGetAttachedObject (Node); if (ObjDesc) { /* - * The object exists. - * Make sure the handler is not already installed. + * The object exists. + * Make sure the handler is not already installed. */ /* check the address handler the user requested */ @@ -260,8 +260,8 @@ AcpiInstallAddressSpaceHandler ( while (HandlerObj) { /* - * We have an Address handler, see if user requested this - * address space. + * We have an Address handler, see if user requested this + * address space. */ if(HandlerObj->AddrHandler.SpaceId == SpaceId) { @@ -270,7 +270,7 @@ AcpiInstallAddressSpaceHandler ( } /* - * Move through the linked list of handlers + * Move through the linked list of handlers */ HandlerObj = HandlerObj->AddrHandler.Next; } @@ -287,7 +287,6 @@ AcpiInstallAddressSpaceHandler ( { Type = ACPI_TYPE_DEVICE; } - else { Type = Node->Type; @@ -319,11 +318,11 @@ AcpiInstallAddressSpaceHandler ( AcpiUtGetRegionName (SpaceId), SpaceId, Node, ObjDesc)); /* - * Now we can install the handler + * Now we can install the handler * - * At this point we know that there is no existing handler. - * So, we just allocate the object for the handler and link it - * into the list. + * At this point we know that there is no existing handler. + * So, we just allocate the object for the handler and link it + * into the list. */ HandlerObj = AcpiUtCreateInternalObject (INTERNAL_TYPE_ADDRESS_HANDLER); if (!HandlerObj) @@ -342,16 +341,16 @@ AcpiInstallAddressSpaceHandler ( HandlerObj->AddrHandler.Setup = Setup; /* - * Now walk the namespace finding all of the regions this - * handler will manage. + * Now walk the namespace finding all of the regions this + * handler will manage. * - * We start at the device and search the branch toward - * the leaf nodes until either the leaf is encountered or - * a device is detected that has an address handler of the - * same type. + * We start at the device and search the branch toward + * the leaf nodes until either the leaf is encountered or + * a device is detected that has an address handler of the + * same type. * - * In either case we back up and search down the remainder - * of the branch + * In either case we back up and search down the remainder + * of the branch */ Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Device, ACPI_UINT32_MAX, NS_WALK_UNLOCK, @@ -359,7 +358,7 @@ AcpiInstallAddressSpaceHandler ( HandlerObj, NULL); /* - * Place this handler 1st on the list + * Place this handler 1st on the list */ HandlerObj->Common.ReferenceCount = (UINT16) (HandlerObj->Common.ReferenceCount + @@ -416,7 +415,7 @@ AcpiRemoveAddressSpaceHandler ( /* Convert and validate the device handle */ - Node = AcpiNsConvertHandleToEntry (Device); + Node = AcpiNsMapHandleToNode (Device); if (!Node) { Status = AE_BAD_PARAMETER; @@ -429,27 +428,24 @@ AcpiRemoveAddressSpaceHandler ( ObjDesc = AcpiNsGetAttachedObject (Node); if (!ObjDesc) { - /* - * The object DNE. - */ Status = AE_NOT_EXIST; goto UnlockAndExit; } /* - * find the address handler the user requested + * find the address handler the user requested */ HandlerObj = ObjDesc->Device.AddrHandler; LastObjPtr = &ObjDesc->Device.AddrHandler; while (HandlerObj) { /* - * We have a handler, see if user requested this one + * We have a handler, see if user requested this one */ - if(HandlerObj->AddrHandler.SpaceId == SpaceId) + if (HandlerObj->AddrHandler.SpaceId == SpaceId) { /* - * Got it, first dereference this in the Regions + * Got it, first dereference this in the Regions */ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Removing address handler %p(%p) for region %s on Device %p(%p)\n", @@ -463,30 +459,30 @@ AcpiRemoveAddressSpaceHandler ( while (RegionObj) { /* - * First disassociate the handler from the region. + * First disassociate the handler from the region. * - * NOTE: this doesn't mean that the region goes away - * The region is just inaccessible as indicated to - * the _REG method + * NOTE: this doesn't mean that the region goes away + * The region is just inaccessible as indicated to + * the _REG method */ AcpiEvDisassociateRegionFromHandler(RegionObj, TRUE); /* - * Walk the list, since we took the first region and it - * was removed from the list by the dissassociate call - * we just get the first item on the list again + * Walk the list, since we took the first region and it + * was removed from the list by the dissassociate call + * we just get the first item on the list again */ RegionObj = HandlerObj->AddrHandler.RegionList; } /* - * Remove this Handler object from the list + * Remove this Handler object from the list */ *LastObjPtr = HandlerObj->AddrHandler.Next; /* - * Now we can delete the handler object + * Now we can delete the handler object */ AcpiUtRemoveReference (HandlerObj); AcpiUtRemoveReference (HandlerObj); @@ -495,7 +491,7 @@ AcpiRemoveAddressSpaceHandler ( } /* - * Move through the linked list of handlers + * Move through the linked list of handlers */ LastObjPtr = &HandlerObj->AddrHandler.Next; HandlerObj = HandlerObj->AddrHandler.Next; @@ -503,7 +499,7 @@ AcpiRemoveAddressSpaceHandler ( /* - * The handler does not exist + * The handler does not exist */ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Unable to remove address handler %p for %s(%X), DevNode %p, obj %p\n", diff --git a/sys/contrib/dev/acpica/exconfig.c b/sys/contrib/dev/acpica/exconfig.c index 1cbf7f7..ec9b923 100644 --- a/sys/contrib/dev/acpica/exconfig.c +++ b/sys/contrib/dev/acpica/exconfig.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: exconfig - Namespace reconfiguration (Load/Unload opcodes) - * $Revision: 42 $ + * $Revision: 44 $ * *****************************************************************************/ @@ -144,10 +144,10 @@ * ****************************************************************************/ -static ACPI_STATUS -AcpiExLoadTableOp ( +ACPI_STATUS +AcpiExLoadOp ( ACPI_OPERAND_OBJECT *RgnDesc, - ACPI_OPERAND_OBJECT **DdbHandle) + ACPI_OPERAND_OBJECT *DdbHandle) { ACPI_STATUS Status; ACPI_OPERAND_OBJECT *TableDesc = NULL; @@ -158,7 +158,7 @@ AcpiExLoadTableOp ( UINT32 i; - FUNCTION_TRACE ("ExLoadTable"); + FUNCTION_TRACE ("ExLoadOp"); /* TBD: [Unhandled] Object can be either a field or an opregion */ @@ -216,7 +216,7 @@ AcpiExLoadTableOp ( { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Table has invalid signature [%4.4s], must be SSDT or PSDT\n", - TableHeader.Signature)); + (char*)TableHeader.Signature)); Status = AE_BAD_SIGNATURE; goto Cleanup; } @@ -266,7 +266,8 @@ AcpiExLoadTableOp ( TableDesc->Reference.Opcode = AML_LOAD_OP; TableDesc->Reference.Object = TableInfo.InstalledDesc; - *DdbHandle = TableDesc; + /* TBD: store the tabledesc into the DdbHandle target */ + /* DdbHandle = TableDesc; */ return_ACPI_STATUS (Status); @@ -276,7 +277,6 @@ Cleanup: ACPI_MEM_FREE (TableDesc); ACPI_MEM_FREE (TablePtr); return_ACPI_STATUS (Status); - } @@ -292,7 +292,7 @@ Cleanup: * ****************************************************************************/ -static ACPI_STATUS +ACPI_STATUS AcpiExUnloadTable ( ACPI_OPERAND_OBJECT *DdbHandle) { @@ -343,57 +343,3 @@ AcpiExUnloadTable ( return_ACPI_STATUS (Status); } - -/***************************************************************************** - * - * FUNCTION: AcpiExReconfiguration - * - * PARAMETERS: WalkState - Current state of the parse tree walk - * - * RETURN: Status - * - * DESCRIPTION: Reconfiguration opcodes such as LOAD and UNLOAD - * - ****************************************************************************/ - -ACPI_STATUS -AcpiExReconfiguration ( - ACPI_WALK_STATE *WalkState) -{ - ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; - ACPI_STATUS Status; - - - FUNCTION_TRACE ("ExReconfiguration"); - -#define DdbHandle Operand[0] -#define RegionDesc Operand[1] - - - - switch (WalkState->Opcode) - { - - case AML_LOAD_OP: - - Status = AcpiExLoadTableOp (RegionDesc, &DdbHandle); - break; - - - case AML_UNLOAD_OP: - - Status = AcpiExUnloadTable (DdbHandle); - break; - - - default: - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "bad opcode=%X\n", WalkState->Opcode)); - Status = AE_AML_BAD_OPCODE; - break; - } - - - return_ACPI_STATUS (Status); -} - diff --git a/sys/contrib/dev/acpica/exconvrt.c b/sys/contrib/dev/acpica/exconvrt.c index d3e66e2..46159ce 100644 --- a/sys/contrib/dev/acpica/exconvrt.c +++ b/sys/contrib/dev/acpica/exconvrt.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: exconvrt - Object conversion routines - * $Revision: 23 $ + * $Revision: 24 $ * *****************************************************************************/ @@ -335,7 +335,7 @@ AcpiExConvertToBuffer ( if (!NewBuf) { REPORT_ERROR - (("ExDyadic2R/ConcatOp: Buffer allocation failure\n")); + (("ExConvertToBuffer: Buffer allocation failure\n")); AcpiUtRemoveReference (RetDesc); return (AE_NO_MEMORY); } diff --git a/sys/contrib/dev/acpica/excreate.c b/sys/contrib/dev/acpica/excreate.c index 0491888..0a86f6d 100644 --- a/sys/contrib/dev/acpica/excreate.c +++ b/sys/contrib/dev/acpica/excreate.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: excreate - Named object creation - * $Revision: 68 $ + * $Revision: 71 $ * *****************************************************************************/ @@ -130,166 +130,6 @@ MODULE_NAME ("excreate") -/******************************************************************************* - * - * FUNCTION: AcpiExCreateBufferField - * - * PARAMETERS: Opcode - The opcode to be executed - * Operands - List of operands for the opcode - * WalkState - Current state - * - * RETURN: Status - * - * DESCRIPTION: Execute CreateField operators: CreateBitFieldOp, - * CreateByteFieldOp, CreateWordFieldOp, CreateDWordFieldOp, - * CreateFieldOp (which define fields in buffers) - * - * ALLOCATION: Deletes CreateFieldOp's count operand descriptor - * - * - * ACPI SPECIFICATION REFERENCES: - * DefCreateBitField := CreateBitFieldOp SrcBuf BitIdx NameString - * DefCreateByteField := CreateByteFieldOp SrcBuf ByteIdx NameString - * DefCreateDWordField := CreateDWordFieldOp SrcBuf ByteIdx NameString - * DefCreateField := CreateFieldOp SrcBuf BitIdx NumBits NameString - * DefCreateWordField := CreateWordFieldOp SrcBuf ByteIdx NameString - * BitIndex := TermArg=>Integer - * ByteIndex := TermArg=>Integer - * NumBits := TermArg=>Integer - * SourceBuff := TermArg=>Buffer - * - ******************************************************************************/ - -ACPI_STATUS -AcpiExCreateBufferField ( - UINT8 *AmlStart, - UINT32 AmlLength, - ACPI_NAMESPACE_NODE *Node, - ACPI_WALK_STATE *WalkState) -{ - ACPI_STATUS Status; - ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_OPERAND_OBJECT *TmpDesc; - - - FUNCTION_TRACE ("ExCreateBufferField"); - - - /* Create the descriptor */ - - ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_BUFFER_FIELD); - if (!ObjDesc) - { - Status = AE_NO_MEMORY; - goto Cleanup; - } - - - /* - * Allocate a method object for this field unit - */ - ObjDesc->BufferField.Extra = AcpiUtCreateInternalObject ( - INTERNAL_TYPE_EXTRA); - if (!ObjDesc->BufferField.Extra) - { - Status = AE_NO_MEMORY; - goto Cleanup; - } - - /* - * Remember location in AML stream of the field unit - * opcode and operands -- since the buffer and index - * operands must be evaluated. - */ - ObjDesc->BufferField.Extra->Extra.AmlStart = AmlStart; - ObjDesc->BufferField.Extra->Extra.AmlLength = AmlLength; - ObjDesc->BufferField.Node = Node; - - - /* - * This operation is supposed to cause the destination Name to refer - * to the defined BufferField -- it must not store the constructed - * BufferField object (or its current value) in some location that the - * Name may already be pointing to. So, if the Name currently contains - * a reference which would cause AcpiExStore() to perform an indirect - * store rather than setting the value of the Name itself, clobber that - * reference before calling AcpiExStore(). - */ - - /* Type of Name's existing value */ - - switch (AcpiNsGetType (Node)) - { - - case ACPI_TYPE_BUFFER_FIELD: - case INTERNAL_TYPE_ALIAS: - case INTERNAL_TYPE_REGION_FIELD: - case INTERNAL_TYPE_BANK_FIELD: - case INTERNAL_TYPE_INDEX_FIELD: - - TmpDesc = AcpiNsGetAttachedObject (Node); - if (TmpDesc) - { - /* - * There is an existing object here; delete it and zero out the - * object field within the Node - */ - DUMP_PATHNAME (Node, - "ExCreateBufferField: Removing Current Reference", - ACPI_LV_BFIELD, _COMPONENT); - - DUMP_ENTRY (Node, ACPI_LV_BFIELD); - DUMP_STACK_ENTRY (TmpDesc); - - AcpiUtRemoveReference (TmpDesc); - AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) Node, NULL, - ACPI_TYPE_ANY); - } - - /* Set the type to ANY (or the store below will fail) */ - - ((ACPI_NAMESPACE_NODE *) Node)->Type = ACPI_TYPE_ANY; - - break; - - - default: - - break; - } - - /* Store constructed field descriptor in result location */ - - Status = AcpiExStore (ObjDesc, (ACPI_OPERAND_OBJECT *) Node, - WalkState); - - /* - * If the field descriptor was not physically stored (or if a failure - * above), we must delete it - */ - if (ObjDesc->Common.ReferenceCount <= 1) - { - AcpiUtRemoveReference (ObjDesc); - } - - return_ACPI_STATUS (AE_OK); - - -Cleanup: - - /* Delete region object and method subobject */ - - if (ObjDesc) - { - /* Remove deletes both objects! */ - - AcpiUtRemoveReference (ObjDesc); - ObjDesc = NULL; - } - - return_ACPI_STATUS (Status); -} - /***************************************************************************** * @@ -309,7 +149,6 @@ AcpiExCreateAlias ( ACPI_WALK_STATE *WalkState) { ACPI_NAMESPACE_NODE *SourceNode; - ACPI_NAMESPACE_NODE *AliasNode; ACPI_STATUS Status; @@ -318,29 +157,19 @@ AcpiExCreateAlias ( /* Get the source/alias operands (both namespace nodes) */ - SourceNode = (ACPI_NAMESPACE_NODE *) WalkState->Operands[WalkState->NumOperands -1]; - WalkState->NumOperands--; + SourceNode = (ACPI_NAMESPACE_NODE *) WalkState->Operands[1]; - /* - * Don't pop it, it gets removed in the calling routine - */ - AliasNode = AcpiDsObjStackGetValue (0, WalkState); - - /* Add an additional reference to the object */ - AcpiUtAddReference (SourceNode->Object); + /* Attach the original source object to the new Alias Node */ - /* - * Attach the original source Node to the new Alias Node. - */ - Status = AcpiNsAttachObject (AliasNode, SourceNode->Object, + Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) WalkState->Operands[0], + SourceNode->Object, SourceNode->Type); - /* * The new alias assumes the type of the source, but it points - * to the same object. The reference count of the object has two - * additional references to prevent deletion out from under either the + * to the same object. The reference count of the object has an + * additional reference to prevent deletion out from under either the * source or the alias Node */ @@ -388,24 +217,20 @@ AcpiExCreateEvent ( &ObjDesc->Event.Semaphore); if (ACPI_FAILURE (Status)) { - AcpiUtRemoveReference (ObjDesc); goto Cleanup; } /* Attach object to the Node */ - Status = AcpiNsAttachObject (AcpiDsObjStackGetValue (0, WalkState), + Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) WalkState->Operands[0], ObjDesc, (UINT8) ACPI_TYPE_EVENT); - if (ACPI_FAILURE (Status)) - { - AcpiOsDeleteSemaphore (ObjDesc->Event.Semaphore); - AcpiUtRemoveReference (ObjDesc); - goto Cleanup; - } - Cleanup: - + /* + * Remove local reference to the object (on error, will cause deletion + * of both object and semaphore if present.) + */ + AcpiUtRemoveReference (ObjDesc); return_ACPI_STATUS (Status); } @@ -420,6 +245,8 @@ Cleanup: * * DESCRIPTION: Create a new mutex object * + * Mutex (Name[0], SyncLevel[1]) + * ****************************************************************************/ ACPI_STATUS @@ -427,19 +254,13 @@ AcpiExCreateMutex ( ACPI_WALK_STATE *WalkState) { ACPI_STATUS Status = AE_OK; - ACPI_OPERAND_OBJECT *SyncDesc; ACPI_OPERAND_OBJECT *ObjDesc; FUNCTION_TRACE_PTR ("ExCreateMutex", WALK_OPERANDS); - /* Get the operand */ - - SyncDesc = WalkState->Operands[WalkState->NumOperands -1]; - WalkState->NumOperands--; - - /* Attempt to allocate a new object */ + /* Create the new mutex object */ ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_MUTEX); if (!ObjDesc) @@ -453,30 +274,23 @@ AcpiExCreateMutex ( Status = AcpiOsCreateSemaphore (1, 1, &ObjDesc->Mutex.Semaphore); if (ACPI_FAILURE (Status)) { - AcpiUtRemoveReference (ObjDesc); goto Cleanup; } - ObjDesc->Mutex.SyncLevel = (UINT8) SyncDesc->Integer.Value; + /* Init object and attach to NS node */ - /* ObjDesc was on the stack top, and the name is below it */ + ObjDesc->Mutex.SyncLevel = (UINT8) WalkState->Operands[1]->Integer.Value; - Status = AcpiNsAttachObject (AcpiDsObjStackGetValue (0, WalkState), + Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) WalkState->Operands[0], ObjDesc, (UINT8) ACPI_TYPE_MUTEX); - if (ACPI_FAILURE (Status)) - { - AcpiOsDeleteSemaphore (ObjDesc->Mutex.Semaphore); - AcpiUtRemoveReference (ObjDesc); - goto Cleanup; - } Cleanup: - - /* Always delete the operand */ - - AcpiUtRemoveReference (SyncDesc); - + /* + * Remove local reference to the object (on error, will cause deletion + * of both object and semaphore if present.) + */ + AcpiUtRemoveReference (ObjDesc); return_ACPI_STATUS (Status); } @@ -511,6 +325,19 @@ AcpiExCreateRegion ( FUNCTION_TRACE ("ExCreateRegion"); + /* Get the Node from the object stack */ + + Node = (ACPI_NAMESPACE_NODE *) WalkState->Operands[0]; + + /* + * If the region object is already attached to this node, + * just return + */ + if (Node->Object) + { + return_ACPI_STATUS (AE_OK); + } + /* * Space ID must be one of the predefined IDs, or in the user-defined * range @@ -526,10 +353,6 @@ AcpiExCreateRegion ( AcpiUtGetRegionName (RegionSpace), RegionSpace)); - /* Get the Node from the object stack */ - - Node = (ACPI_NAMESPACE_NODE *) AcpiDsObjStackGetValue (0, WalkState); - /* Create the region descriptor */ ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION); @@ -539,9 +362,8 @@ AcpiExCreateRegion ( goto Cleanup; } - /* - * Allocate a method object for this region. - */ + /* Allocate a method object for this region */ + ObjDesc->Region.Extra = AcpiUtCreateInternalObject ( INTERNAL_TYPE_EXTRA); if (!ObjDesc->Region.Extra) @@ -559,18 +381,15 @@ AcpiExCreateRegion ( /* Init the region from the operands */ - ObjDesc->Region.SpaceId = RegionSpace; - ObjDesc->Region.Address = 0; - ObjDesc->Region.Length = 0; - + ObjDesc->Region.SpaceId = RegionSpace; + ObjDesc->Region.Address = 0; + ObjDesc->Region.Length = 0; + ObjDesc->Region.Node = Node; /* Install the new region object in the parent Node */ - ObjDesc->Region.Node = Node; - Status = AcpiNsAttachObject (Node, ObjDesc, (UINT8) ACPI_TYPE_REGION); - if (ACPI_FAILURE (Status)) { goto Cleanup; @@ -581,7 +400,6 @@ AcpiExCreateRegion ( * Namespace is NOT locked at this point. */ Status = AcpiEvInitializeRegion (ObjDesc, FALSE); - if (ACPI_FAILURE (Status)) { /* @@ -597,18 +415,9 @@ AcpiExCreateRegion ( Cleanup: - if (ACPI_FAILURE (Status)) - { - /* Delete region object and method subobject */ - - if (ObjDesc) - { - /* Remove deletes both objects! */ + /* Remove local reference to the object */ - AcpiUtRemoveReference (ObjDesc); - ObjDesc = NULL; - } - } + AcpiUtRemoveReference (ObjDesc); return_ACPI_STATUS (Status); } @@ -664,20 +473,23 @@ Cleanup: * * DESCRIPTION: Create a new processor object and populate the fields * + * Processor (Name[0], CpuID[1], PblockAddr[2], PblockLength[3]) + * ****************************************************************************/ ACPI_STATUS AcpiExCreateProcessor ( - ACPI_PARSE_OBJECT *Op, - ACPI_NAMESPACE_NODE *ProcessorNode) + ACPI_WALK_STATE *WalkState) { - ACPI_STATUS Status; - ACPI_PARSE_OBJECT *Arg; + ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_STATUS Status; + + FUNCTION_TRACE_PTR ("ExCreateProcessor", WalkState); - FUNCTION_TRACE_PTR ("ExCreateProcessor", Op); + /* Create the processor object */ ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_PROCESSOR); if (!ObjDesc) @@ -685,52 +497,23 @@ AcpiExCreateProcessor ( return_ACPI_STATUS (AE_NO_MEMORY); } - /* Install the new processor object in the parent Node */ - - Status = AcpiNsAttachObject (ProcessorNode, ObjDesc, - (UINT8) ACPI_TYPE_PROCESSOR); - if (ACPI_FAILURE (Status)) - { - AcpiUtDeleteObjectDesc (ObjDesc); - return_ACPI_STATUS (Status); - } - - /* Get first arg and verify existence */ - - Arg = Op->Value.Arg; - if (!Arg) - { - return_ACPI_STATUS (AE_AML_NO_OPERAND); - } - - /* First arg is the Processor ID */ - - ObjDesc->Processor.ProcId = (UINT8) Arg->Value.Integer; - - /* Get second arg and verify existence */ - - Arg = Arg->Next; - if (!Arg) - { - return_ACPI_STATUS (AE_AML_NO_OPERAND); - } - - /* Second arg is the PBlock Address */ + /* + * Initialize the processor object from the operands + */ + ObjDesc->Processor.ProcId = (UINT8) Operand[1]->Integer.Value; + ObjDesc->Processor.Address = (ACPI_IO_ADDRESS) Operand[2]->Integer.Value; + ObjDesc->Processor.Length = (UINT8) Operand[3]->Integer.Value; - ObjDesc->Processor.Address = (ACPI_IO_ADDRESS) Arg->Value.Integer; + /* Install the processor object in the parent Node */ - /* Get third arg and verify existence */ + Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) Operand[0], + ObjDesc, (UINT8) ACPI_TYPE_PROCESSOR); - Arg = Arg->Next; - if (!Arg) - { - return_ACPI_STATUS (AE_AML_NO_OPERAND); - } - /* Third arg is the PBlock Length */ + /* Remove local reference to the object */ - ObjDesc->Processor.Length = (UINT8) Arg->Value.Integer; - return_ACPI_STATUS (AE_OK); + AcpiUtRemoveReference (ObjDesc); + return_ACPI_STATUS (Status); } @@ -746,20 +529,23 @@ AcpiExCreateProcessor ( * * DESCRIPTION: Create a new PowerResource object and populate the fields * + * PowerResource (Name[0], SystemLevel[1], ResourceOrder[2]) + * ****************************************************************************/ ACPI_STATUS AcpiExCreatePowerResource ( - ACPI_PARSE_OBJECT *Op, - ACPI_NAMESPACE_NODE *PowerNode) + ACPI_WALK_STATE *WalkState) { + ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; ACPI_STATUS Status; - ACPI_PARSE_OBJECT *Arg; ACPI_OPERAND_OBJECT *ObjDesc; - FUNCTION_TRACE_PTR ("ExCreatePowerResource", Op); + FUNCTION_TRACE_PTR ("ExCreatePowerResource", WalkState); + + /* Create the power resource object */ ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_POWER); if (!ObjDesc) @@ -767,41 +553,21 @@ AcpiExCreatePowerResource ( return_ACPI_STATUS (AE_NO_MEMORY); } - /* Install the new power resource object in the parent Node */ - - Status = AcpiNsAttachObject (PowerNode, ObjDesc, - (UINT8) ACPI_TYPE_POWER); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS(Status); - } - + /* Initialize the power object from the operands */ - /* Get first arg and verify existence */ + ObjDesc->PowerResource.SystemLevel = (UINT8) Operand[1]->Integer.Value; + ObjDesc->PowerResource.ResourceOrder = (UINT16) Operand[2]->Integer.Value; - Arg = Op->Value.Arg; - if (!Arg) - { - return_ACPI_STATUS (AE_AML_NO_OPERAND); - } + /* Install the power resource object in the parent Node */ - /* First arg is the SystemLevel */ + Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) Operand[0], + ObjDesc, (UINT8) ACPI_TYPE_POWER); - ObjDesc->PowerResource.SystemLevel = (UINT8) Arg->Value.Integer; - /* Get second arg and check existence */ + /* Remove local reference to the object */ - Arg = Arg->Next; - if (!Arg) - { - return_ACPI_STATUS (AE_AML_NO_OPERAND); - } - - /* Second arg is the PBlock Address */ - - ObjDesc->PowerResource.ResourceOrder = (UINT16) Arg->Value.Integer; - - return_ACPI_STATUS (AE_OK); + AcpiUtRemoveReference (ObjDesc); + return_ACPI_STATUS (Status); } @@ -824,14 +590,15 @@ ACPI_STATUS AcpiExCreateMethod ( UINT8 *AmlStart, UINT32 AmlLength, - UINT32 MethodFlags, - ACPI_NAMESPACE_NODE *Method) + ACPI_WALK_STATE *WalkState) { + ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; ACPI_OPERAND_OBJECT *ObjDesc; ACPI_STATUS Status; + UINT8 MethodFlags; - FUNCTION_TRACE_PTR ("ExCreateMethod", Method); + FUNCTION_TRACE_PTR ("ExCreateMethod", WalkState); /* Create a new method object */ @@ -842,18 +609,17 @@ AcpiExCreateMethod ( return_ACPI_STATUS (AE_NO_MEMORY); } - /* Get the method's AML pointer/length from the Op */ + /* Save the method's AML pointer and length */ ObjDesc->Method.AmlStart = AmlStart; ObjDesc->Method.AmlLength = AmlLength; - /* - * First argument is the Method Flags (contains parameter count for the - * method) - */ - ObjDesc->Method.MethodFlags = (UINT8) MethodFlags; - ObjDesc->Method.ParamCount = (UINT8) (MethodFlags & - METHOD_FLAGS_ARG_COUNT); + /* disassemble the method flags */ + + MethodFlags = (UINT8) Operand[1]->Integer.Value; + + ObjDesc->Method.MethodFlags = MethodFlags; + ObjDesc->Method.ParamCount = (UINT8) (MethodFlags & METHOD_FLAGS_ARG_COUNT); /* * Get the concurrency count. If required, a semaphore will be @@ -876,12 +642,16 @@ AcpiExCreateMethod ( /* Attach the new object to the method Node */ - Status = AcpiNsAttachObject (Method, ObjDesc, (UINT8) ACPI_TYPE_METHOD); - if (ACPI_FAILURE (Status)) - { - AcpiUtDeleteObjectDesc (ObjDesc); - } + Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) Operand[0], + ObjDesc, (UINT8) ACPI_TYPE_METHOD); + + /* Remove local reference to the object */ + + AcpiUtRemoveReference (ObjDesc); + + /* Remove a reference to the operand */ + AcpiUtRemoveReference (Operand[1]); return_ACPI_STATUS (Status); } diff --git a/sys/contrib/dev/acpica/exdump.c b/sys/contrib/dev/acpica/exdump.c index 507922b..63ea268 100644 --- a/sys/contrib/dev/acpica/exdump.c +++ b/sys/contrib/dev/acpica/exdump.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: exdump - Interpreter debug output routines - * $Revision: 124 $ + * $Revision: 126 $ * *****************************************************************************/ @@ -192,8 +192,6 @@ AcpiExShowHexValue ( Length += 3 + AcpiExDigitsNeeded (Value, 10); } - ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "")); - for (Length = LeadSpace; Length; --Length ) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " ")); @@ -211,7 +209,7 @@ AcpiExShowHexValue ( if (ShowDecimalValue) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " [%ld]", Value)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_LOAD, " [%d]", Value)); } if (0 == LeadSpace) @@ -266,13 +264,6 @@ AcpiExDumpOperand ( return (AE_OK); } - if (AcpiTbSystemTablePointer (EntryDesc)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p is an AML pointer\n", - EntryDesc)); - return (AE_OK); - } - if (!VALID_DESCRIPTOR_TYPE (EntryDesc, ACPI_DESC_TYPE_INTERNAL)) { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%p Is not a local object \n", EntryDesc)); @@ -344,8 +335,9 @@ AcpiExDumpOperand ( { /* Value is a Number */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%ld]", - EntryDesc->Integer.Value)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%8.8X%8.8x]", + HIDWORD(EntryDesc->Integer.Value), + LODWORD(EntryDesc->Integer.Value))); } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n")); @@ -362,8 +354,9 @@ AcpiExDumpOperand ( /* Value is a Number */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%ld]", - EntryDesc->Integer.Value)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " value is [%8.8X%8.8x]", + HIDWORD(EntryDesc->Integer.Value), + LODWORD(EntryDesc->Integer.Value))); } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "\n")); @@ -371,7 +364,7 @@ AcpiExDumpOperand ( case AML_INT_NAMEPATH_OP: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference.Node->Name %x\n", + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, "Reference.Node->Name %X\n", EntryDesc->Reference.Node->Name)); break; @@ -409,8 +402,7 @@ AcpiExDumpOperand ( for (Buf = EntryDesc->Buffer.Pointer; Length--; ++Buf) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, - Length ? " %02x" : " %02x", *Buf)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " %02x", *Buf)); } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,"\n")); } @@ -487,8 +479,10 @@ AcpiExDumpOperand ( } else { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " base %p Length %X\n", - EntryDesc->Region.Address, EntryDesc->Region.Length)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, " base %8.8X%8.8X Length %X\n", + HIDWORD(EntryDesc->Region.Address), + LODWORD(EntryDesc->Region.Address), + EntryDesc->Region.Length)); } break; @@ -517,7 +511,7 @@ AcpiExDumpOperand ( case INTERNAL_TYPE_REGION_FIELD: ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, - "RegionField: bits=%X bitaccwidth=%X lock=%X update=%X at byte=%lX bit=%X of below:\n", + "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)); @@ -534,7 +528,7 @@ AcpiExDumpOperand ( case ACPI_TYPE_BUFFER_FIELD: ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, - "BufferField: %X bits at byte %lX bit %X of \n", + "BufferField: %X bits at byte %X bit %X of \n", EntryDesc->BufferField.BitLength, EntryDesc->BufferField.BaseByteOffset, EntryDesc->BufferField.StartFieldBitOffset)); @@ -566,7 +560,7 @@ AcpiExDumpOperand ( case ACPI_TYPE_METHOD: ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO, - "Method(%X) @ %p:%lX\n", + "Method(%X) @ %p:%X\n", EntryDesc->Method.ParamCount, EntryDesc->Method.AmlStart, EntryDesc->Method.AmlLength)); break; @@ -725,7 +719,7 @@ AcpiExDumpNode ( } - AcpiOsPrintf ("%20s : %4.4s\n", "Name", &Node->Name); + 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); diff --git a/sys/contrib/dev/acpica/exmisc.c b/sys/contrib/dev/acpica/exmisc.c index e2d84a1..bb79e81 100644 --- a/sys/contrib/dev/acpica/exmisc.c +++ b/sys/contrib/dev/acpica/exmisc.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes - * $Revision: 87 $ + * $Revision: 92 $ * *****************************************************************************/ @@ -132,496 +132,428 @@ /******************************************************************************* * - * FUNCTION: AcpiExTriadic + * FUNCTION: AcpiExGetObjectReference * - * PARAMETERS: WalkState - Current walk state + * PARAMETERS: ObjDesc - Create a reference to this object + * ReturnDesc - Where to store the reference * * RETURN: Status * - * DESCRIPTION: Execute Triadic operator (3 operands) - * - * ALLOCATION: Deletes one operand descriptor -- other remains on stack + * DESCRIPTION: Obtain and return a "reference" to the target object + * Common code for the RefOfOp and the CondRefOfOp. * ******************************************************************************/ ACPI_STATUS -AcpiExTriadic ( +AcpiExGetObjectReference ( + ACPI_OPERAND_OBJECT *ObjDesc, + ACPI_OPERAND_OBJECT **ReturnDesc, ACPI_WALK_STATE *WalkState) { - ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; - ACPI_OPERAND_OBJECT *RetDesc = NULL; - ACPI_OPERAND_OBJECT *TmpDesc; - ACPI_SIGNAL_FATAL_INFO *Fatal; - UINT32 Temp; ACPI_STATUS Status = AE_OK; - FUNCTION_TRACE ("ExTriadic"); + FUNCTION_TRACE_PTR ("ExGetObjectReference", ObjDesc); + + + if (VALID_DESCRIPTOR_TYPE (ObjDesc, ACPI_DESC_TYPE_INTERNAL)) + { + if (ObjDesc->Common.Type != INTERNAL_TYPE_REFERENCE) + { + *ReturnDesc = NULL; + Status = AE_TYPE; + goto Cleanup; + } + + /* + * Not a Name -- an indirect name pointer would have + * been converted to a direct name pointer in AcpiExResolveOperands + */ + switch (ObjDesc->Reference.Opcode) + { + case AML_LOCAL_OP: + case AML_ARG_OP: + + *ReturnDesc = (void *) AcpiDsMethodDataGetNode (ObjDesc->Reference.Opcode, + ObjDesc->Reference.Offset, WalkState); + break; + default: -#define ObjDesc1 Operand[0] -#define ObjDesc2 Operand[1] -#define ResDesc Operand[2] + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(Internal) Unknown Ref subtype %02x\n", + ObjDesc->Reference.Opcode)); + *ReturnDesc = NULL; + Status = AE_AML_INTERNAL; + goto Cleanup; + } + } - switch (WalkState->Opcode) + else if (VALID_DESCRIPTOR_TYPE (ObjDesc, ACPI_DESC_TYPE_NAMED)) { + /* Must be a named object; Just return the Node */ - case AML_FATAL_OP: + *ReturnDesc = ObjDesc; + } - /* DefFatal := FatalOp FatalType FatalCode FatalArg */ + else + { + *ReturnDesc = NULL; + Status = AE_TYPE; + } - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "FatalOp: Type %x Code %x Arg %x <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n", - (UINT32) ObjDesc1->Integer.Value, (UINT32) ObjDesc2->Integer.Value, - (UINT32) ResDesc->Integer.Value)); +Cleanup: - Fatal = ACPI_MEM_ALLOCATE (sizeof (ACPI_SIGNAL_FATAL_INFO)); - if (Fatal) - { - Fatal->Type = (UINT32) ObjDesc1->Integer.Value; - Fatal->Code = (UINT32) ObjDesc2->Integer.Value; - Fatal->Argument = (UINT32) ResDesc->Integer.Value; - } + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p Ref=%p\n", ObjDesc, *ReturnDesc)); + return_ACPI_STATUS (Status); +} - /* - * Signal the OS - */ - AcpiOsSignal (ACPI_SIGNAL_FATAL, Fatal); - /* Might return while OS is shutting down */ +/******************************************************************************* + * + * FUNCTION: AcpiExDoConcatenate + * + * PARAMETERS: *ObjDesc - Object to be converted. Must be an + * Integer, Buffer, or String + * WalkState - Current walk state + * + * RETURN: Status + * + * DESCRIPTION: Concatenate two objects OF THE SAME TYPE. + * + ******************************************************************************/ - ACPI_MEM_FREE (Fatal); - AcpiUtRemoveReference (Operand[2]); - break; +ACPI_STATUS +AcpiExDoConcatenate ( + ACPI_OPERAND_OBJECT *ObjDesc, + ACPI_OPERAND_OBJECT *ObjDesc2, + ACPI_OPERAND_OBJECT **ActualReturnDesc, + ACPI_WALK_STATE *WalkState) +{ + ACPI_STATUS Status; + UINT32 i; + ACPI_INTEGER ThisInteger; + ACPI_OPERAND_OBJECT *ReturnDesc; + NATIVE_CHAR *NewBuf; + UINT32 IntegerSize = sizeof (ACPI_INTEGER); - case AML_MID_OP: + FUNCTION_ENTRY (); - /* DefMid := MidOp (0)Source (1)Index (2)Length (3)Result */ - /* - * Create the return object. The Source operand is guaranteed to be - * either a String or a Buffer, so just use its type. - */ - RetDesc = AcpiUtCreateInternalObject (ObjDesc1->Common.Type); - if (!RetDesc) + /* + * There are three cases to handle: + * 1) Two Integers concatenated to produce a buffer + * 2) Two Strings concatenated to produce a string + * 3) Two Buffers concatenated to produce a buffer + */ + switch (ObjDesc->Common.Type) + { + case ACPI_TYPE_INTEGER: + + /* Handle both ACPI 1.0 and ACPI 2.0 Integer widths */ + + if (WalkState->MethodNode->Flags & ANOBJ_DATA_WIDTH_32) { - Status = AE_NO_MEMORY; - goto Cleanup; + /* + * We are running a method that exists in a 32-bit ACPI table. + * Truncate the value to 32 bits by zeroing out the upper + * 32-bit field + */ + IntegerSize = sizeof (UINT32); } - /* - * If the index is beyond the length of the String/Buffer, or if the - * requested length is zero, return a zero-length String/Buffer - */ - if ((Operand[1]->Integer.Value < ObjDesc1->String.Length) && - (Operand[2]->Integer.Value > 0)) + /* Result of two integers is a buffer */ + + ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_BUFFER); + if (!ReturnDesc) { - /* Truncate request if larger than the actual String/Buffer */ + return (AE_NO_MEMORY); + } - if (((UINT32) Operand[1]->Integer.Value + (UINT32) Operand[2]->Integer.Value) > - ObjDesc1->String.Length) - { - Temp = ObjDesc1->String.Length - (UINT32) Operand[1]->Integer.Value; - } - else - { - Temp = (UINT32) Operand[2]->Integer.Value; - } + /* Need enough space for two integers */ - /* Allocate a new buffer for the String/Buffer */ + ReturnDesc->Buffer.Length = IntegerSize * 2; + NewBuf = ACPI_MEM_CALLOCATE (ReturnDesc->Buffer.Length); + if (!NewBuf) + { + REPORT_ERROR + (("ExDoConcatenate: Buffer allocation failure\n")); + Status = AE_NO_MEMORY; + goto Cleanup; + } - RetDesc->String.Pointer = ACPI_MEM_CALLOCATE (Temp + 1); - if (!RetDesc->String.Pointer) - { - Status = AE_NO_MEMORY; - goto Cleanup; - } + ReturnDesc->Buffer.Pointer = (UINT8 *) NewBuf; - /* Copy the portion requested */ + /* Convert the first integer */ - MEMCPY (RetDesc->String.Pointer, - ObjDesc1->String.Pointer + (UINT32) Operand[1]->Integer.Value, - Temp); + ThisInteger = ObjDesc->Integer.Value; + for (i = 0; i < IntegerSize; i++) + { + NewBuf[i] = (UINT8) ThisInteger; + ThisInteger >>= 8; + } - /* Set the length of the new String/Buffer */ + /* Convert the second integer */ - RetDesc->String.Length = Temp; + ThisInteger = ObjDesc2->Integer.Value; + for (; i < (IntegerSize * 2); i++) + { + NewBuf[i] = (UINT8) ThisInteger; + ThisInteger >>= 8; } - Status = AcpiExStore (RetDesc, Operand[3], WalkState); break; - case AML_INDEX_OP: + case ACPI_TYPE_STRING: - /* DefIndex := IndexOp Source Index Destination */ + ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_STRING); + if (!ReturnDesc) + { + return (AE_NO_MEMORY); + } - /* Create the internal return object */ + /* Operand0 is string */ - RetDesc = AcpiUtCreateInternalObject (INTERNAL_TYPE_REFERENCE); - if (!RetDesc) + NewBuf = ACPI_MEM_ALLOCATE (ObjDesc->String.Length + + ObjDesc2->String.Length + 1); + if (!NewBuf) { + REPORT_ERROR + (("ExDoConcatenate: String allocation failure\n")); Status = AE_NO_MEMORY; goto Cleanup; } - /* - * At this point, the ObjDesc1 operand is either a Package or a Buffer - */ - if (ObjDesc1->Common.Type == ACPI_TYPE_PACKAGE) - { - /* Object to be indexed is a Package */ - - if (ObjDesc2->Integer.Value >= ObjDesc1->Package.Count) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value beyond package end\n")); - Status = AE_AML_PACKAGE_LIMIT; - goto Cleanup; - } - - if ((ResDesc->Common.Type == INTERNAL_TYPE_REFERENCE) && - (ResDesc->Reference.Opcode == AML_ZERO_OP)) - { - /* - * There is no actual result descriptor (the ZeroOp Result - * descriptor is a placeholder), so just delete the placeholder and - * return a reference to the package element - */ - AcpiUtRemoveReference (ResDesc); - } - - else - { - /* - * Each element of the package is an internal object. Get the one - * we are after. - */ - TmpDesc = ObjDesc1->Package.Elements[ObjDesc2->Integer.Value]; - RetDesc->Reference.Opcode = AML_INDEX_OP; - RetDesc->Reference.TargetType = TmpDesc->Common.Type; - RetDesc->Reference.Object = TmpDesc; - - Status = AcpiExStore (RetDesc, ResDesc, WalkState); - RetDesc->Reference.Object = NULL; - } + STRCPY (NewBuf, ObjDesc->String.Pointer); + STRCPY (NewBuf + ObjDesc->String.Length, + ObjDesc2->String.Pointer); - /* - * The local return object must always be a reference to the package element, - * not the element itself. - */ - RetDesc->Reference.Opcode = AML_INDEX_OP; - RetDesc->Reference.TargetType = ACPI_TYPE_PACKAGE; - RetDesc->Reference.Where = &ObjDesc1->Package.Elements[ObjDesc2->Integer.Value]; - } + /* Point the return object to the new string */ - else - { - /* Object to be indexed is a Buffer */ + ReturnDesc->String.Pointer = NewBuf; + ReturnDesc->String.Length = ObjDesc->String.Length += + ObjDesc2->String.Length; + break; - if (ObjDesc2->Integer.Value >= ObjDesc1->Buffer.Length) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value beyond end of buffer\n")); - Status = AE_AML_BUFFER_LIMIT; - goto Cleanup; - } - RetDesc->Reference.Opcode = AML_INDEX_OP; - RetDesc->Reference.TargetType = ACPI_TYPE_BUFFER_FIELD; - RetDesc->Reference.Object = ObjDesc1; - RetDesc->Reference.Offset = (UINT32) ObjDesc2->Integer.Value; + case ACPI_TYPE_BUFFER: - Status = AcpiExStore (RetDesc, ResDesc, WalkState); - } - break; - } + /* Operand0 is a buffer */ + ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_BUFFER); + if (!ReturnDesc) + { + return (AE_NO_MEMORY); + } -Cleanup: + NewBuf = ACPI_MEM_ALLOCATE (ObjDesc->Buffer.Length + + ObjDesc2->Buffer.Length); + if (!NewBuf) + { + REPORT_ERROR + (("ExDoConcatenate: Buffer allocation failure\n")); + Status = AE_NO_MEMORY; + goto Cleanup; + } - /* Always delete operands */ + MEMCPY (NewBuf, ObjDesc->Buffer.Pointer, + ObjDesc->Buffer.Length); + MEMCPY (NewBuf + ObjDesc->Buffer.Length, ObjDesc2->Buffer.Pointer, + ObjDesc2->Buffer.Length); - AcpiUtRemoveReference (ObjDesc1); - AcpiUtRemoveReference (ObjDesc2); + /* + * Point the return object to the new buffer + */ - /* Delete return object on error */ + ReturnDesc->Buffer.Pointer = (UINT8 *) NewBuf; + ReturnDesc->Buffer.Length = ObjDesc->Buffer.Length + + ObjDesc2->Buffer.Length; + break; - if (ACPI_FAILURE (Status)) - { - AcpiUtRemoveReference (ResDesc); - if (RetDesc) - { - AcpiUtRemoveReference (RetDesc); - RetDesc = NULL; - } + default: + Status = AE_AML_INTERNAL; + ReturnDesc = NULL; } - /* Set the return object and exit */ - WalkState->ResultObj = RetDesc; - return_ACPI_STATUS (Status); + *ActualReturnDesc = ReturnDesc; + return (AE_OK); + + +Cleanup: + + AcpiUtRemoveReference (ReturnDesc); + return (Status); } /******************************************************************************* * - * FUNCTION: AcpiExHexadic + * FUNCTION: AcpiExDoMathOp * - * PARAMETERS: WalkState - Current walk state + * PARAMETERS: Opcode - AML opcode + * Operand0 - Integer operand #0 + * Operand0 - Integer operand #1 * - * RETURN: Status + * RETURN: Integer result of the operation * - * DESCRIPTION: Execute Match operator + * DESCRIPTION: Execute a math AML opcode. The purpose of having all of the + * math functions here is to prevent a lot of pointer dereferencing + * to obtain the operands. * ******************************************************************************/ -ACPI_STATUS -AcpiExHexadic ( - ACPI_WALK_STATE *WalkState) +ACPI_INTEGER +AcpiExDoMathOp ( + UINT16 Opcode, + ACPI_INTEGER Operand0, + ACPI_INTEGER Operand1) { - ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; - ACPI_OPERAND_OBJECT *RetDesc = NULL; - ACPI_STATUS Status = AE_OK; - UINT32 Index; - UINT32 MatchValue = (UINT32) -1; - - - FUNCTION_TRACE ("ExHexadic"); - -#define PkgDesc Operand[0] -#define Op1Desc Operand[1] -#define V1Desc Operand[2] -#define Op2Desc Operand[3] -#define V2Desc Operand[4] -#define StartDesc Operand[5] - - switch (WalkState->Opcode) + switch (Opcode) { + case AML_ADD_OP: /* Add (Operand0, Operand1, Result) */ - case AML_MATCH_OP: + return (Operand0 + Operand1); - /* Validate match comparison sub-opcodes */ - if ((Op1Desc->Integer.Value > MAX_MATCH_OPERATOR) || - (Op2Desc->Integer.Value > MAX_MATCH_OPERATOR)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "operation encoding out of range\n")); - Status = AE_AML_OPERAND_VALUE; - goto Cleanup; - } + case AML_BIT_AND_OP: /* And (Operand0, Operand1, Result) */ - Index = (UINT32) StartDesc->Integer.Value; - if (Index >= (UINT32) PkgDesc->Package.Count) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Start position value out of range\n")); - Status = AE_AML_PACKAGE_LIMIT; - goto Cleanup; - } + return (Operand0 & Operand1); - RetDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); - if (!RetDesc) - { - Status = AE_NO_MEMORY; - goto Cleanup; - } + case AML_BIT_NAND_OP: /* NAnd (Operand0, Operand1, Result) */ - /* - * Examine each element until a match is found. Within the loop, - * "continue" signifies that the current element does not match - * and the next should be examined. - * Upon finding a match, the loop will terminate via "break" at - * the bottom. If it terminates "normally", MatchValue will be -1 - * (its initial value) indicating that no match was found. When - * returned as a Number, this will produce the Ones value as specified. - */ - for ( ; Index < PkgDesc->Package.Count; ++Index) - { - /* - * Treat any NULL or non-numeric elements as non-matching. - * TBD [Unhandled] - if an element is a Name, - * should we examine its value? - */ - if (!PkgDesc->Package.Elements[Index] || - ACPI_TYPE_INTEGER != PkgDesc->Package.Elements[Index]->Common.Type) - { - continue; - } + return (~(Operand0 & Operand1)); - /* - * Within these switch statements: - * "break" (exit from the switch) signifies a match; - * "continue" (proceed to next iteration of enclosing - * "for" loop) signifies a non-match. - */ - switch ((NATIVE_UINT) Op1Desc->Integer.Value) - { - case MATCH_MTR: /* always true */ - break; + case AML_BIT_OR_OP: /* Or (Operand0, Operand1, Result) */ + return (Operand0 | Operand1); - case MATCH_MEQ: /* true if equal */ - if (PkgDesc->Package.Elements[Index]->Integer.Value - != V1Desc->Integer.Value) - { - continue; - } - break; + case AML_BIT_NOR_OP: /* NOr (Operand0, Operand1, Result) */ + return (~(Operand0 | Operand1)); - case MATCH_MLE: /* true if less than or equal */ - if (PkgDesc->Package.Elements[Index]->Integer.Value - > V1Desc->Integer.Value) - { - continue; - } - break; + case AML_BIT_XOR_OP: /* XOr (Operand0, Operand1, Result) */ + return (Operand0 ^ Operand1); - case MATCH_MLT: /* true if less than */ - if (PkgDesc->Package.Elements[Index]->Integer.Value - >= V1Desc->Integer.Value) - { - continue; - } - break; + case AML_MULTIPLY_OP: /* Multiply (Operand0, Operand1, Result) */ + return (Operand0 * Operand1); - case MATCH_MGE: /* true if greater than or equal */ - if (PkgDesc->Package.Elements[Index]->Integer.Value - < V1Desc->Integer.Value) - { - continue; - } - break; + case AML_SHIFT_LEFT_OP: /* ShiftLeft (Operand, ShiftCount, Result) */ + return (Operand0 << Operand1); - case MATCH_MGT: /* true if greater than */ - if (PkgDesc->Package.Elements[Index]->Integer.Value - <= V1Desc->Integer.Value) - { - continue; - } - break; + case AML_SHIFT_RIGHT_OP: /* ShiftRight (Operand, ShiftCount, Result) */ + return (Operand0 >> Operand1); - default: /* undefined */ - continue; - } + case AML_SUBTRACT_OP: /* Subtract (Operand0, Operand1, Result) */ + return (Operand0 - Operand1); - switch ((NATIVE_UINT) Op2Desc->Integer.Value) - { - case MATCH_MTR: + default: - break; + return (0); + } +} - case MATCH_MEQ: - if (PkgDesc->Package.Elements[Index]->Integer.Value - != V2Desc->Integer.Value) - { - continue; - } - break; +/******************************************************************************* + * + * FUNCTION: AcpiExDoLogicalOp + * + * PARAMETERS: Opcode - AML opcode + * Operand0 - Integer operand #0 + * Operand0 - Integer operand #1 + * + * RETURN: TRUE/FALSE result of the operation + * + * DESCRIPTION: Execute a logical AML opcode. The purpose of having all of the + * functions here is to prevent a lot of pointer dereferencing + * to obtain the operands and to simplify the generation of the + * logical value. + * + * Note: cleanest machine code seems to be produced by the code + * below, rather than using statements of the form: + * Result = (Operand0 == Operand1); + * + ******************************************************************************/ +BOOLEAN +AcpiExDoLogicalOp ( + UINT16 Opcode, + ACPI_INTEGER Operand0, + ACPI_INTEGER Operand1) +{ - case MATCH_MLE: - if (PkgDesc->Package.Elements[Index]->Integer.Value - > V2Desc->Integer.Value) - { - continue; - } - break; + switch (Opcode) + { + case AML_LAND_OP: /* LAnd (Operand0, Operand1) */ - case MATCH_MLT: + if (Operand0 && Operand1) + { + return (TRUE); + } + break; - if (PkgDesc->Package.Elements[Index]->Integer.Value - >= V2Desc->Integer.Value) - { - continue; - } - break; + case AML_LEQUAL_OP: /* LEqual (Operand0, Operand1) */ - case MATCH_MGE: + if (Operand0 == Operand1) + { + return (TRUE); + } + break; - if (PkgDesc->Package.Elements[Index]->Integer.Value - < V2Desc->Integer.Value) - { - continue; - } - break; + case AML_LGREATER_OP: /* LGreater (Operand0, Operand1) */ - case MATCH_MGT: + if (Operand0 > Operand1) + { + return (TRUE); + } + break; - if (PkgDesc->Package.Elements[Index]->Integer.Value - <= V2Desc->Integer.Value) - { - continue; - } - break; + case AML_LLESS_OP: /* LLess (Operand0, Operand1) */ - default: + if (Operand0 < Operand1) + { + return (TRUE); + } + break; - continue; - } - /* Match found: exit from loop */ + case AML_LOR_OP: /* LOr (Operand0, Operand1) */ - MatchValue = Index; - break; + if (Operand0 || Operand1) + { + return (TRUE); } - - /* MatchValue is the return value */ - - RetDesc->Integer.Value = MatchValue; break; - } - -Cleanup: - - /* Free the operands */ - - AcpiUtRemoveReference (StartDesc); - AcpiUtRemoveReference (V2Desc); - AcpiUtRemoveReference (Op2Desc); - AcpiUtRemoveReference (V1Desc); - AcpiUtRemoveReference (Op1Desc); - AcpiUtRemoveReference (PkgDesc); + return (FALSE); +} - /* Delete return object on error */ - if (ACPI_FAILURE (Status) && - (RetDesc)) - { - AcpiUtRemoveReference (RetDesc); - RetDesc = NULL; - } - - /* Set the return object and exit */ - - WalkState->ResultObj = RetDesc; - return_ACPI_STATUS (Status); -} diff --git a/sys/contrib/dev/acpica/exprep.c b/sys/contrib/dev/acpica/exprep.c index 8dfe99c..1089492 100644 --- a/sys/contrib/dev/acpica/exprep.c +++ b/sys/contrib/dev/acpica/exprep.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities - * $Revision: 95 $ + * $Revision: 99 $ * *****************************************************************************/ @@ -343,7 +343,7 @@ AcpiExPrepCommonFieldObject ( /******************************************************************************* * - * FUNCTION: AcpiExPrepRegionFieldValue + * FUNCTION: AcpiExPrepFieldValue * * PARAMETERS: Node - Owning Node * RegionNode - Region in which field is being defined @@ -353,291 +353,135 @@ AcpiExPrepCommonFieldObject ( * * RETURN: Status * - * DESCRIPTION: Construct an ACPI_OPERAND_OBJECT of type DefField and + * DESCRIPTION: Construct an ACPI_OPERAND_OBJECT of type DefField and * connect it to the parent Node. * ******************************************************************************/ ACPI_STATUS -AcpiExPrepRegionFieldValue ( - ACPI_NAMESPACE_NODE *Node, - ACPI_HANDLE RegionNode, - UINT8 FieldFlags, - UINT32 FieldBitPosition, - UINT32 FieldBitLength) +AcpiExPrepFieldValue ( + ACPI_CREATE_FIELD_INFO *Info) { ACPI_OPERAND_OBJECT *ObjDesc; UINT32 Type; ACPI_STATUS Status; - FUNCTION_TRACE ("ExPrepRegionFieldValue"); + FUNCTION_TRACE ("ExPrepFieldValue"); /* Parameter validation */ - if (!RegionNode) + if (Info->FieldType != INTERNAL_TYPE_INDEX_FIELD) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null RegionNode\n")); - return_ACPI_STATUS (AE_AML_NO_OPERAND); - } + if (!Info->RegionNode) + { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null RegionNode\n")); + return_ACPI_STATUS (AE_AML_NO_OPERAND); + } - Type = AcpiNsGetType (RegionNode); - if (Type != ACPI_TYPE_REGION) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed Region, found type %X %s\n", - Type, AcpiUtGetTypeName (Type))); - return_ACPI_STATUS (AE_AML_OPERAND_TYPE); + Type = AcpiNsGetType (Info->RegionNode); + if (Type != ACPI_TYPE_REGION) + { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed Region, found type %X %s\n", + Type, AcpiUtGetTypeName (Type))); + + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); + } } - /* Allocate a new object */ + /* Allocate a new region object */ - ObjDesc = AcpiUtCreateInternalObject (INTERNAL_TYPE_REGION_FIELD); + ObjDesc = AcpiUtCreateInternalObject (Info->FieldType); if (!ObjDesc) { return_ACPI_STATUS (AE_NO_MEMORY); } - - /* ObjDesc and Region valid */ - - DUMP_OPERANDS ((ACPI_OPERAND_OBJECT **) &Node, IMODE_EXECUTE, - "ExPrepRegionFieldValue", 1, "case RegionField"); - DUMP_OPERANDS ((ACPI_OPERAND_OBJECT **) &RegionNode, IMODE_EXECUTE, - "ExPrepRegionFieldValue", 1, "case RegionField"); - /* Initialize areas of the object that are common to all fields */ - Status = AcpiExPrepCommonFieldObject (ObjDesc, FieldFlags, - FieldBitPosition, FieldBitLength); + Status = AcpiExPrepCommonFieldObject (ObjDesc, Info->FieldFlags, + Info->FieldBitPosition, Info->FieldBitLength); if (ACPI_FAILURE (Status)) { + AcpiUtDeleteObjectDesc (ObjDesc); return_ACPI_STATUS (Status); } - /* Initialize areas of the object that are specific to this field type */ - - ObjDesc->Field.RegionObj = AcpiNsGetAttachedObject (RegionNode); - - /* An additional reference for the container */ - - AcpiUtAddReference (ObjDesc->Field.RegionObj); + /* Initialize areas of the object that are specific to the field type */ + switch (Info->FieldType) + { + case INTERNAL_TYPE_REGION_FIELD: - /* Debug info */ - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Bitoff=%X Off=%X Gran=%X Region %p\n", - ObjDesc->Field.StartFieldBitOffset, ObjDesc->Field.BaseByteOffset, - ObjDesc->Field.AccessBitWidth, ObjDesc->Field.RegionObj)); - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "set NamedObj %p (%4.4s) val = %p\n", - Node, &(Node->Name), ObjDesc)); - + ObjDesc->Field.RegionObj = AcpiNsGetAttachedObject (Info->RegionNode); - /* - * Store the constructed descriptor (ObjDesc) into the parent Node, - * preserving the current type of that NamedObj. - */ - Status = AcpiNsAttachObject (Node, ObjDesc, (UINT8) AcpiNsGetType (Node)); - return_ACPI_STATUS (Status); -} + /* An additional reference for the container */ + AcpiUtAddReference (ObjDesc->Field.RegionObj); -/******************************************************************************* - * - * FUNCTION: AcpiExPrepBankFieldValue - * - * PARAMETERS: Node - Owning Node - * RegionNode - Region in which field is being defined - * BankRegisterNode - Bank selection register node - * BankVal - Value to store in selection register - * FieldFlags - Access, LockRule, and UpdateRule - * FieldBitPosition - Field start position - * FieldBitLength - Field length in number of bits - * - * RETURN: Status - * - * DESCRIPTION: Construct an object of type BankField and attach it to the - * parent Node. - * - ******************************************************************************/ + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "RegionField: Bitoff=%X Off=%X Gran=%X Region %p\n", + ObjDesc->Field.StartFieldBitOffset, ObjDesc->Field.BaseByteOffset, + ObjDesc->Field.AccessBitWidth, ObjDesc->Field.RegionObj)); + break; -ACPI_STATUS -AcpiExPrepBankFieldValue ( - ACPI_NAMESPACE_NODE *Node, - ACPI_NAMESPACE_NODE *RegionNode, - ACPI_NAMESPACE_NODE *BankRegisterNode, - UINT32 BankVal, - UINT8 FieldFlags, - UINT32 FieldBitPosition, - UINT32 FieldBitLength) -{ - ACPI_OPERAND_OBJECT *ObjDesc; - UINT32 Type; - ACPI_STATUS Status; + case INTERNAL_TYPE_BANK_FIELD: - FUNCTION_TRACE ("ExPrepBankFieldValue"); + ObjDesc->BankField.Value = Info->BankValue; + ObjDesc->BankField.RegionObj = AcpiNsGetAttachedObject (Info->RegionNode); + ObjDesc->BankField.BankRegisterObj = AcpiNsGetAttachedObject (Info->RegisterNode); + /* An additional reference for the attached objects */ - /* Parameter validation */ + AcpiUtAddReference (ObjDesc->BankField.RegionObj); + AcpiUtAddReference (ObjDesc->BankField.BankRegisterObj); - if (!RegionNode) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null RegionNode\n")); - return_ACPI_STATUS (AE_AML_NO_OPERAND); - } + 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)); + break; - Type = AcpiNsGetType (RegionNode); - if (Type != ACPI_TYPE_REGION) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Needed Region, found type %X %s\n", - Type, AcpiUtGetTypeName (Type))); - return_ACPI_STATUS (AE_AML_OPERAND_TYPE); - } - /* Allocate a new object */ + case INTERNAL_TYPE_INDEX_FIELD: - ObjDesc = AcpiUtCreateInternalObject (INTERNAL_TYPE_BANK_FIELD); - if (!ObjDesc) - { - return_ACPI_STATUS (AE_NO_MEMORY); - } + ObjDesc->IndexField.IndexObj = AcpiNsGetAttachedObject (Info->RegisterNode); + ObjDesc->IndexField.DataObj = AcpiNsGetAttachedObject (Info->DataRegisterNode); + ObjDesc->IndexField.Value = (UINT32) (Info->FieldBitPosition / + ObjDesc->Field.AccessBitWidth); - /* ObjDesc and Region valid */ + if (!ObjDesc->IndexField.DataObj || !ObjDesc->IndexField.IndexObj) + { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null Index Object\n")); + return_ACPI_STATUS (AE_AML_INTERNAL); + } - DUMP_OPERANDS ((ACPI_OPERAND_OBJECT **) &Node, IMODE_EXECUTE, - "ExPrepBankFieldValue", 1, "case BankField"); - DUMP_OPERANDS ((ACPI_OPERAND_OBJECT **) &RegionNode, IMODE_EXECUTE, - "ExPrepBankFieldValue", 1, "case BankField"); + /* An additional reference for the attached objects */ - /* Initialize areas of the object that are common to all fields */ + AcpiUtAddReference (ObjDesc->IndexField.DataObj); + AcpiUtAddReference (ObjDesc->IndexField.IndexObj); - Status = AcpiExPrepCommonFieldObject (ObjDesc, FieldFlags, - FieldBitPosition, FieldBitLength); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "IndexField: bitoff=%X off=%X gran=%X Index %p Data %p\n", + ObjDesc->IndexField.StartFieldBitOffset, ObjDesc->IndexField.BaseByteOffset, + ObjDesc->Field.AccessBitWidth, ObjDesc->IndexField.IndexObj, + ObjDesc->IndexField.DataObj)); + break; } - /* Initialize areas of the object that are specific to this field type */ - - ObjDesc->BankField.Value = BankVal; - ObjDesc->BankField.RegionObj = AcpiNsGetAttachedObject (RegionNode); - ObjDesc->BankField.BankRegisterObj = AcpiNsGetAttachedObject (BankRegisterNode); - - /* An additional reference for the attached objects */ - - AcpiUtAddReference (ObjDesc->BankField.RegionObj); - AcpiUtAddReference (ObjDesc->BankField.BankRegisterObj); - - /* Debug info */ - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "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)); - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Set NamedObj %p (%4.4s) val=%p\n", - Node, &(Node->Name), ObjDesc)); - - /* * Store the constructed descriptor (ObjDesc) into the parent Node, * preserving the current type of that NamedObj. */ - Status = AcpiNsAttachObject (Node, ObjDesc, (UINT8) AcpiNsGetType (Node)); - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiExPrepIndexFieldValue - * - * PARAMETERS: Node - Owning Node - * IndexReg - Index register - * DataReg - Data register - * FieldFlags - Access, LockRule, and UpdateRule - * FieldBitPosition - Field start position - * FieldBitLength - Field length in number of bits - * - * RETURN: Status - * - * DESCRIPTION: Construct an ACPI_OPERAND_OBJECT of type IndexField and - * connect it to the parent Node. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiExPrepIndexFieldValue ( - ACPI_NAMESPACE_NODE *Node, - ACPI_NAMESPACE_NODE *IndexReg, - ACPI_NAMESPACE_NODE *DataReg, - UINT8 FieldFlags, - UINT32 FieldBitPosition, - UINT32 FieldBitLength) -{ - ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_STATUS Status; - - - FUNCTION_TRACE ("ExPrepIndexFieldValue"); - - - /* Parameter validation */ - - if (!IndexReg || !DataReg) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null handle\n")); - return_ACPI_STATUS (AE_AML_NO_OPERAND); - } - - /* Allocate a new object descriptor */ - - ObjDesc = AcpiUtCreateInternalObject (INTERNAL_TYPE_INDEX_FIELD); - if (!ObjDesc) - { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - /* Initialize areas of the object that are common to all fields */ - - Status = AcpiExPrepCommonFieldObject (ObjDesc, FieldFlags, - FieldBitPosition, FieldBitLength); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* Initialize areas of the object that are specific to this field type */ - - ObjDesc->IndexField.DataObj = AcpiNsGetAttachedObject (DataReg); - ObjDesc->IndexField.IndexObj = AcpiNsGetAttachedObject (IndexReg); - ObjDesc->IndexField.Value = (UINT32) (FieldBitPosition / - ObjDesc->Field.AccessBitWidth); - - /* An additional reference for the attached objects */ - - AcpiUtAddReference (ObjDesc->IndexField.DataObj); - AcpiUtAddReference (ObjDesc->IndexField.IndexObj); - - /* Debug info */ - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "bitoff=%X off=%X gran=%X Index %p Data %p\n", - ObjDesc->IndexField.StartFieldBitOffset, ObjDesc->IndexField.BaseByteOffset, - ObjDesc->Field.AccessBitWidth, ObjDesc->IndexField.IndexObj, - ObjDesc->IndexField.DataObj)); + Status = AcpiNsAttachObject (Info->FieldNode, ObjDesc, + (UINT8) AcpiNsGetType (Info->FieldNode)); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "set NamedObj %p (%4.4s) val = %p\n", - Node, &(Node->Name), ObjDesc)); + Info->FieldNode, (char*)&(Info->FieldNode->Name), ObjDesc)); + /* Remove local reference to the object */ - /* - * Store the constructed descriptor (ObjDesc) into the parent Node, - * preserving the current type of that NamedObj. - */ - Status = AcpiNsAttachObject (Node, ObjDesc, (UINT8) AcpiNsGetType (Node)); + AcpiUtRemoveReference (ObjDesc); return_ACPI_STATUS (Status); } diff --git a/sys/contrib/dev/acpica/exregion.c b/sys/contrib/dev/acpica/exregion.c index fe4ee06..2f3a769 100644 --- a/sys/contrib/dev/acpica/exregion.c +++ b/sys/contrib/dev/acpica/exregion.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exregion - ACPI default OpRegion (address space) handlers - * $Revision: 59 $ + * $Revision: 61 $ * *****************************************************************************/ @@ -240,7 +240,7 @@ AcpiExSystemMemorySpaceHandler ( ((ACPI_INTEGER) Address - (ACPI_INTEGER) MemInfo->MappedPhysicalAddress); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "IO %d (%d width) Address=%8.8lX%8.8lX\n", Function, BitWidth, + "SystemMemory %d (%d width) Address=%8.8X%8.8X\n", Function, BitWidth, HIDWORD (Address), LODWORD (Address))); /* Perform the memory read or write */ @@ -331,7 +331,7 @@ AcpiExSystemIoSpaceHandler ( ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "IO %d (%d width) Address=%8.8lX%8.8lX\n", Function, BitWidth, + "SystemIO %d (%d width) Address=%8.8X%8.8X\n", Function, BitWidth, HIDWORD (Address), LODWORD (Address))); /* Decode the function parameter */ @@ -412,7 +412,7 @@ AcpiExPciConfigSpaceHandler ( PciRegister = (UINT16) Address; ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "IO %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n", + "PciConfig %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n", Function, BitWidth, PciId->Segment, PciId->Bus, PciId->Device, PciId->Function, PciRegister)); diff --git a/sys/contrib/dev/acpica/exresnte.c b/sys/contrib/dev/acpica/exresnte.c index 39d7871..df8122c 100644 --- a/sys/contrib/dev/acpica/exresnte.c +++ b/sys/contrib/dev/acpica/exresnte.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exresnte - AML Interpreter object resolution - * $Revision: 41 $ + * $Revision: 43 $ * *****************************************************************************/ @@ -135,14 +135,15 @@ * * FUNCTION: AcpiExResolveNodeToValue * - * PARAMETERS: StackPtr - Pointer to a location on a stack that contains - * a pointer to a Node - * WalkState - Current state + * PARAMETERS: ObjectPtr - Pointer to a location that contains + * a pointer to a NS node, and will recieve a + * pointer to the resolved object. + * WalkState - Current state. Valid only if executing AML + * code. NULL if simply resolving an object * * RETURN: Status * - * DESCRIPTION: Resolve a Namespace node (AKA a "direct name pointer") to - * a valued object + * DESCRIPTION: Resolve a Namespace node to a valued object * * Note: for some of the data types, the pointer attached to the Node * can be either a pointer to an actual internal object or a pointer into the @@ -158,12 +159,12 @@ ACPI_STATUS AcpiExResolveNodeToValue ( - ACPI_NAMESPACE_NODE **StackPtr, + ACPI_NAMESPACE_NODE **ObjectPtr, ACPI_WALK_STATE *WalkState) { ACPI_STATUS Status = AE_OK; - ACPI_OPERAND_OBJECT *ValDesc; + ACPI_OPERAND_OBJECT *SourceDesc; ACPI_OPERAND_OBJECT *ObjDesc = NULL; ACPI_NAMESPACE_NODE *Node; ACPI_OBJECT_TYPE8 EntryType; @@ -177,12 +178,12 @@ AcpiExResolveNodeToValue ( * The stack pointer points to a ACPI_NAMESPACE_NODE (Node). Get the * object that is attached to the Node. */ - Node = *StackPtr; - ValDesc = AcpiNsGetAttachedObject (Node); + Node = *ObjectPtr; + SourceDesc = AcpiNsGetAttachedObject (Node); EntryType = AcpiNsGetType ((ACPI_HANDLE) Node); - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p ValDesc=%p Type=%X\n", - Node, ValDesc, EntryType)); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p SourceDesc=%p Type=%X\n", + Node, SourceDesc, EntryType)); /* @@ -196,7 +197,7 @@ AcpiExResolveNodeToValue ( return_ACPI_STATUS (AE_OK); } - if (!ValDesc) + if (!SourceDesc) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No object attached to node %p\n", Node)); @@ -212,64 +213,64 @@ AcpiExResolveNodeToValue ( case ACPI_TYPE_PACKAGE: - if (ACPI_TYPE_PACKAGE != ValDesc->Common.Type) + if (ACPI_TYPE_PACKAGE != SourceDesc->Common.Type) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Object not a Package, type %s\n", - AcpiUtGetTypeName (ValDesc->Common.Type))); + AcpiUtGetTypeName (SourceDesc->Common.Type))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } /* Return an additional reference to the object */ - ObjDesc = ValDesc; + ObjDesc = SourceDesc; AcpiUtAddReference (ObjDesc); break; case ACPI_TYPE_BUFFER: - if (ACPI_TYPE_BUFFER != ValDesc->Common.Type) + if (ACPI_TYPE_BUFFER != SourceDesc->Common.Type) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Object not a Buffer, type %s\n", - AcpiUtGetTypeName (ValDesc->Common.Type))); + AcpiUtGetTypeName (SourceDesc->Common.Type))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } /* Return an additional reference to the object */ - ObjDesc = ValDesc; + ObjDesc = SourceDesc; AcpiUtAddReference (ObjDesc); break; case ACPI_TYPE_STRING: - if (ACPI_TYPE_STRING != ValDesc->Common.Type) + if (ACPI_TYPE_STRING != SourceDesc->Common.Type) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Object not a String, type %s\n", - AcpiUtGetTypeName (ValDesc->Common.Type))); + AcpiUtGetTypeName (SourceDesc->Common.Type))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } /* Return an additional reference to the object */ - ObjDesc = ValDesc; + ObjDesc = SourceDesc; AcpiUtAddReference (ObjDesc); break; case ACPI_TYPE_INTEGER: - if (ACPI_TYPE_INTEGER != ValDesc->Common.Type) + if (ACPI_TYPE_INTEGER != SourceDesc->Common.Type) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Object not a Integer, type %s\n", - AcpiUtGetTypeName (ValDesc->Common.Type))); + AcpiUtGetTypeName (SourceDesc->Common.Type))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } /* Return an additional reference to the object */ - ObjDesc = ValDesc; + ObjDesc = SourceDesc; AcpiUtAddReference (ObjDesc); break; @@ -279,10 +280,10 @@ AcpiExResolveNodeToValue ( case INTERNAL_TYPE_BANK_FIELD: case INTERNAL_TYPE_INDEX_FIELD: - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "FieldRead Node=%p ValDesc=%p Type=%X\n", - Node, ValDesc, EntryType)); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "FieldRead Node=%p SourceDesc=%p Type=%X\n", + Node, SourceDesc, EntryType)); - Status = AcpiExReadDataFromField (ValDesc, &ObjDesc); + Status = AcpiExReadDataFromField (SourceDesc, &ObjDesc); break; @@ -299,7 +300,7 @@ AcpiExResolveNodeToValue ( /* Return an additional reference to the object */ - ObjDesc = ValDesc; + ObjDesc = SourceDesc; AcpiUtAddReference (ObjDesc); break; @@ -321,7 +322,7 @@ AcpiExResolveNodeToValue ( */ case INTERNAL_TYPE_REFERENCE: - switch (ValDesc->Reference.Opcode) + switch (SourceDesc->Reference.Opcode) { case AML_ZERO_OP: @@ -341,13 +342,13 @@ AcpiExResolveNodeToValue ( case AML_REVISION_OP: - TempVal = ACPI_CA_VERSION; + TempVal = ACPI_CA_SUPPORT_LEVEL; break; default: ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unsupported reference opcode %X\n", - ValDesc->Reference.Opcode)); + SourceDesc->Reference.Opcode)); return_ACPI_STATUS (AE_AML_BAD_OPCODE); } @@ -362,9 +363,16 @@ AcpiExResolveNodeToValue ( ObjDesc->Integer.Value = TempVal; - /* Truncate value if we are executing from a 32-bit ACPI table */ - - AcpiExTruncateFor32bitTable (ObjDesc, WalkState); + /* + * 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 + * subsystem, we will have a null WalkState + */ + if (WalkState) + { + AcpiExTruncateFor32bitTable (ObjDesc, WalkState); + } break; @@ -382,7 +390,7 @@ AcpiExResolveNodeToValue ( /* Put the object descriptor on the stack */ - *StackPtr = (void *) ObjDesc; + *ObjectPtr = (void *) ObjDesc; return_ACPI_STATUS (Status); } diff --git a/sys/contrib/dev/acpica/exresolv.c b/sys/contrib/dev/acpica/exresolv.c index f22c0c9..48b753e 100644 --- a/sys/contrib/dev/acpica/exresolv.c +++ b/sys/contrib/dev/acpica/exresolv.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exresolv - AML Interpreter object resolution - * $Revision: 99 $ + * $Revision: 101 $ * *****************************************************************************/ @@ -231,12 +231,14 @@ AcpiExGetBufferFieldValue ( (ResultDesc->Integer.Value >> ObjDesc->BufferField.StartFieldBitOffset) & Mask; ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "** Read from buffer %p byte %ld bit %d width %d addr %p mask %08lx val %08lx\n", + "** Read from buffer %p byte %d bit %d width %d addr %p mask %08X val %8.8X%8.8X\n", ObjDesc->BufferField.BufferObj->Buffer.Pointer, ObjDesc->BufferField.BaseByteOffset, ObjDesc->BufferField.StartFieldBitOffset, ObjDesc->BufferField.BitLength, - Location, Mask, ResultDesc->Integer.Value)); + Location, Mask, + HIDWORD(ResultDesc->Integer.Value), + LODWORD(ResultDesc->Integer.Value))); return_ACPI_STATUS (AE_OK); } @@ -433,7 +435,7 @@ AcpiExResolveObjectToValue ( break; case AML_REVISION_OP: - ObjDesc->Integer.Value = ACPI_CA_VERSION; + ObjDesc->Integer.Value = ACPI_CA_SUPPORT_LEVEL; break; } diff --git a/sys/contrib/dev/acpica/exresop.c b/sys/contrib/dev/acpica/exresop.c index ccaf6ef..a9283f2 100644 --- a/sys/contrib/dev/acpica/exresop.c +++ b/sys/contrib/dev/acpica/exresop.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exresop - AML Interpreter operand/object resolution - * $Revision: 38 $ + * $Revision: 41 $ * *****************************************************************************/ @@ -214,7 +214,7 @@ AcpiExResolveOperands ( OpInfo = AcpiPsGetOpcodeInfo (Opcode); - if (ACPI_GET_OP_TYPE (OpInfo) != ACPI_OP_TYPE_OPCODE) + if (OpInfo->Class == AML_CLASS_UNKNOWN) { return_ACPI_STATUS (AE_AML_BAD_OPCODE); } @@ -244,7 +244,7 @@ AcpiExResolveOperands ( { if (!StackPtr || !*StackPtr) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null stack entry at %X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null stack entry at %p\n", StackPtr)); return_ACPI_STATUS (AE_AML_INTERNAL); @@ -285,7 +285,7 @@ AcpiExResolveOperands ( * Decode the Reference */ OpInfo = AcpiPsGetOpcodeInfo (Opcode); - if (ACPI_GET_OP_TYPE (OpInfo) != ACPI_OP_TYPE_OPCODE) + if (OpInfo->Class == AML_CLASS_UNKNOWN) { return_ACPI_STATUS (AE_AML_BAD_OPCODE); } diff --git a/sys/contrib/dev/acpica/exstore.c b/sys/contrib/dev/acpica/exstore.c index 728aa6a..4392b7a 100644 --- a/sys/contrib/dev/acpica/exstore.c +++ b/sys/contrib/dev/acpica/exstore.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exstore - AML Interpreter object store support - * $Revision: 148 $ + * $Revision: 150 $ * *****************************************************************************/ @@ -134,15 +134,14 @@ * * FUNCTION: AcpiExStore * - * PARAMETERS: *ValDesc - Value to be stored + * PARAMETERS: *SourceDesc - Value to be stored * *DestDesc - Where to store it. Must be an NS node * or an ACPI_OPERAND_OBJECT of type - * Reference; if the latter the descriptor - * will be either reused or deleted. + * Reference; * * RETURN: Status * - * DESCRIPTION: Store the value described by ValDesc into the location + * DESCRIPTION: Store the value described by SourceDesc into the location * described by DestDesc. Called by various interpreter * functions to store the result of an operation into * the destination operand. @@ -151,7 +150,7 @@ ACPI_STATUS AcpiExStore ( - ACPI_OPERAND_OBJECT *ValDesc, + ACPI_OPERAND_OBJECT *SourceDesc, ACPI_OPERAND_OBJECT *DestDesc, ACPI_WALK_STATE *WalkState) { @@ -164,7 +163,7 @@ AcpiExStore ( /* Validate parameters */ - if (!ValDesc || !DestDesc) + if (!SourceDesc || !DestDesc) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Internal - null pointer\n")); return_ACPI_STATUS (AE_AML_NO_OPERAND); @@ -178,7 +177,7 @@ AcpiExStore ( * Dest is a namespace node, * Storing an object into a Name "container" */ - Status = AcpiExStoreObjectToNode (ValDesc, + Status = AcpiExStoreObjectToNode (SourceDesc, (ACPI_NAMESPACE_NODE *) DestDesc, WalkState); /* All done, that's it */ @@ -196,7 +195,7 @@ AcpiExStore ( ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Destination is not a ReferenceObj [%p]\n", DestDesc)); - DUMP_STACK_ENTRY (ValDesc); + DUMP_STACK_ENTRY (SourceDesc); DUMP_STACK_ENTRY (DestDesc); DUMP_OPERANDS (&DestDesc, IMODE_EXECUTE, "ExStore", 2, "Target is not a ReferenceObj"); @@ -221,7 +220,7 @@ AcpiExStore ( /* Storing an object into a Name "container" */ - Status = AcpiExStoreObjectToNode (ValDesc, RefDesc->Reference.Object, + Status = AcpiExStoreObjectToNode (SourceDesc, RefDesc->Reference.Object, WalkState); break; @@ -230,7 +229,7 @@ AcpiExStore ( /* Storing to an Index (pointer into a packager or buffer) */ - Status = AcpiExStoreObjectToIndex (ValDesc, RefDesc, WalkState); + Status = AcpiExStoreObjectToIndex (SourceDesc, RefDesc, WalkState); break; @@ -240,7 +239,7 @@ AcpiExStore ( /* Store to a method local/arg */ Status = AcpiDsStoreObjectToLocal (RefDesc->Reference.Opcode, - RefDesc->Reference.Offset, ValDesc, WalkState); + RefDesc->Reference.Offset, SourceDesc, WalkState); break; @@ -253,40 +252,40 @@ AcpiExStore ( ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "**** Write to Debug Object: ****:\n\n")); ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[ACPI Debug] %s: ", - AcpiUtGetTypeName (ValDesc->Common.Type))); + AcpiUtGetTypeName (SourceDesc->Common.Type))); - switch (ValDesc->Common.Type) + switch (SourceDesc->Common.Type) { case ACPI_TYPE_INTEGER: ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "0x%X (%d)\n", - (UINT32) ValDesc->Integer.Value, (UINT32) ValDesc->Integer.Value)); + (UINT32) SourceDesc->Integer.Value, (UINT32) SourceDesc->Integer.Value)); break; case ACPI_TYPE_BUFFER: ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Length 0x%X\n", - (UINT32) ValDesc->Buffer.Length)); + (UINT32) SourceDesc->Buffer.Length)); break; case ACPI_TYPE_STRING: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%s\n", ValDesc->String.Pointer)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%s\n", SourceDesc->String.Pointer)); break; case ACPI_TYPE_PACKAGE: ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "Elements - 0x%X\n", - (UINT32) ValDesc->Package.Elements)); + (UINT32) SourceDesc->Package.Elements)); break; default: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "@0x%p\n", ValDesc)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "@0x%p\n", SourceDesc)); break; } @@ -321,13 +320,6 @@ AcpiExStore ( } /* switch (RefDesc->Reference.Opcode) */ - /* Always delete the reference descriptor object */ - - if (RefDesc) - { - AcpiUtRemoveReference (RefDesc); - } - return_ACPI_STATUS (Status); } @@ -336,7 +328,7 @@ AcpiExStore ( * * FUNCTION: AcpiExStoreObjectToIndex * - * PARAMETERS: *ValDesc - Value to be stored + * PARAMETERS: *SourceDesc - Value to be stored * *Node - Named object to receive the value * * RETURN: Status @@ -347,7 +339,7 @@ AcpiExStore ( ACPI_STATUS AcpiExStoreObjectToIndex ( - ACPI_OPERAND_OBJECT *ValDesc, + ACPI_OPERAND_OBJECT *SourceDesc, ACPI_OPERAND_OBJECT *DestDesc, ACPI_WALK_STATE *WalkState) { @@ -378,7 +370,7 @@ AcpiExStoreObjectToIndex ( { /* * The object at *(DestDesc->Reference.Where) is the - * element within the package that is to be modified. + * element within the package that is to be modified. */ ObjDesc = *(DestDesc->Reference.Where); if (ObjDesc) @@ -389,17 +381,13 @@ AcpiExStoreObjectToIndex ( * * TBD: [Investigate] Should both the src and dest be required * to be packages? - * && (ValDesc->Common.Type == ACPI_TYPE_PACKAGE) + * && (SourceDesc->Common.Type == ACPI_TYPE_PACKAGE) */ if (ObjDesc->Common.Type == ACPI_TYPE_PACKAGE) { - /* - * Take away the reference for being part of a package and - * delete - */ - AcpiUtRemoveReference (ObjDesc); - AcpiUtRemoveReference (ObjDesc); + /* Take away the reference for being part of a package */ + AcpiUtRemoveReference (ObjDesc); ObjDesc = NULL; } } @@ -410,9 +398,9 @@ AcpiExStoreObjectToIndex ( * If the ObjDesc is NULL, it means that an uninitialized package * element has been used as a destination (this is OK), therefore, * we must create the destination element to match the type of the - * source element NOTE: ValDesc can be of any type. + * source element NOTE: SourceDesccan be of any type. */ - ObjDesc = AcpiUtCreateInternalObject (ValDesc->Common.Type); + ObjDesc = AcpiUtCreateInternalObject (SourceDesc->Common.Type); if (!ObjDesc) { return_ACPI_STATUS (AE_NO_MEMORY); @@ -423,7 +411,7 @@ AcpiExStoreObjectToIndex ( */ if (ACPI_TYPE_PACKAGE == ObjDesc->Common.Type) { - Status = AcpiUtCopyIpackageToIpackage (ValDesc, ObjDesc, WalkState); + Status = AcpiUtCopyIpackageToIpackage (SourceDesc, ObjDesc, WalkState); if (ACPI_FAILURE (Status)) { AcpiUtRemoveReference (ObjDesc); @@ -431,23 +419,19 @@ AcpiExStoreObjectToIndex ( } } - /* - * Install the new descriptor into the package and add a - * reference to the newly created descriptor for now being - * part of the parent package - */ + /* Install the new descriptor into the package */ + *(DestDesc->Reference.Where) = ObjDesc; - AcpiUtAddReference (ObjDesc); } if (ACPI_TYPE_PACKAGE != ObjDesc->Common.Type) { /* * The destination element is not a package, so we need to - * convert the contents of the source (ValDesc) and copy into + * convert the contents of the source (SourceDesc) and copy into * the destination (ObjDesc) */ - Status = AcpiExStoreObjectToObject (ValDesc, ObjDesc, + Status = AcpiExStoreObjectToObject (SourceDesc, ObjDesc, WalkState); if (ACPI_FAILURE (Status)) { @@ -489,7 +473,7 @@ AcpiExStoreObjectToIndex ( * The assignment of the individual elements will be slightly * different for each source type. */ - switch (ValDesc->Common.Type) + switch (SourceDesc->Common.Type) { case ACPI_TYPE_INTEGER: /* @@ -500,7 +484,7 @@ AcpiExStoreObjectToIndex ( Length = sizeof (ACPI_INTEGER); for (i = Length; i != 0; i--) { - Value = (UINT8)(ValDesc->Integer.Value >> (MUL_8 (i - 1))); + Value = (UINT8)(SourceDesc->Integer.Value >> (MUL_8 (i - 1))); ObjDesc->Buffer.Pointer[DestDesc->Reference.Offset] = Value; } break; @@ -511,10 +495,10 @@ AcpiExStoreObjectToIndex ( * Type is Buffer, the Length is in the structure. * Just loop through the elements and assign each one in turn. */ - Length = ValDesc->Buffer.Length; + Length = SourceDesc->Buffer.Length; for (i = 0; i < Length; i++) { - Value = ValDesc->Buffer.Pointer[i]; + Value = SourceDesc->Buffer.Pointer[i]; ObjDesc->Buffer.Pointer[DestDesc->Reference.Offset] = Value; } break; @@ -525,10 +509,10 @@ AcpiExStoreObjectToIndex ( * Type is String, the Length is in the structure. * Just loop through the elements and assign each one in turn. */ - Length = ValDesc->String.Length; + Length = SourceDesc->String.Length; for (i = 0; i < Length; i++) { - Value = ValDesc->String.Pointer[i]; + Value = SourceDesc->String.Pointer[i]; ObjDesc->Buffer.Pointer[DestDesc->Reference.Offset] = Value; } break; @@ -540,7 +524,7 @@ AcpiExStoreObjectToIndex ( ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Source must be Number/Buffer/String type, not %X\n", - ValDesc->Common.Type)); + SourceDesc->Common.Type)); Status = AE_AML_OPERAND_TYPE; break; } @@ -664,6 +648,7 @@ AcpiExStoreObjectToNode ( * SourceDesc reference count is incremented by AttachObject. */ Status = AcpiNsAttachObject (Node, TargetDesc, TargetType); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Store %s into %s via Convert/Attach\n", AcpiUtGetTypeName (TargetDesc->Common.Type), @@ -680,7 +665,6 @@ AcpiExStoreObjectToNode ( /* No conversions for all other types. Just attach the source object */ Status = AcpiNsAttachObject (Node, SourceDesc, SourceDesc->Common.Type); - break; } diff --git a/sys/contrib/dev/acpica/hwacpi.c b/sys/contrib/dev/acpica/hwacpi.c index df690a6..6f8e0b9 100644 --- a/sys/contrib/dev/acpica/hwacpi.c +++ b/sys/contrib/dev/acpica/hwacpi.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface - * $Revision: 45 $ + * $Revision: 46 $ * *****************************************************************************/ @@ -327,7 +327,7 @@ AcpiHwSetMode ( /* Give the platform some time to react */ - AcpiOsStall (5000); + AcpiOsStall (20000); if (AcpiHwGetMode () == Mode) { diff --git a/sys/contrib/dev/acpica/hwgpe.c b/sys/contrib/dev/acpica/hwgpe.c index 27e343a..adcf65f 100644 --- a/sys/contrib/dev/acpica/hwgpe.c +++ b/sys/contrib/dev/acpica/hwgpe.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: hwgpe - Low level GPE enable/disable/clear functions - * $Revision: 34 $ + * $Revision: 35 $ * *****************************************************************************/ @@ -442,7 +442,7 @@ AcpiHwDisableNonWakeupGpes ( /* * Disable all GPEs but wakeup GPEs. */ - AcpiOsWritePort(AcpiGbl_GpeRegisters[i].EnableAddr, + AcpiOsWritePort(AcpiGbl_GpeRegisters[i].EnableAddr, AcpiGbl_GpeRegisters[i].WakeEnable, 8); } } @@ -473,7 +473,7 @@ AcpiHwEnableNonWakeupGpes ( * We previously stored the enabled status of all GPEs. * Blast them back in. */ - AcpiOsWritePort(AcpiGbl_GpeRegisters[i].EnableAddr, + AcpiOsWritePort(AcpiGbl_GpeRegisters[i].EnableAddr, AcpiGbl_GpeRegisters[i].Enable, 8); } } diff --git a/sys/contrib/dev/acpica/hwregs.c b/sys/contrib/dev/acpica/hwregs.c index 8bcda9d..bc74fbe 100644 --- a/sys/contrib/dev/acpica/hwregs.c +++ b/sys/contrib/dev/acpica/hwregs.c @@ -3,7 +3,7 @@ * * Module Name: hwregs - Read/write access functions for the various ACPI * control and status registers. - * $Revision: 109 $ + * $Revision: 110 $ * ******************************************************************************/ @@ -569,8 +569,9 @@ AcpiHwRegisterBitAccess ( RegisterValue = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, PM2_CONTROL); - ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM2 control: Read %X from %p\n", - RegisterValue, ACPI_GET_ADDRESS (AcpiGbl_FADT->XPm2CntBlk.Address))); + ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM2 control: Read %X from %8.8X%8.8X\n", + RegisterValue, HIDWORD(AcpiGbl_FADT->XPm2CntBlk.Address), + LODWORD(AcpiGbl_FADT->XPm2CntBlk.Address))); if (ReadWrite == ACPI_WRITE) { @@ -579,8 +580,10 @@ AcpiHwRegisterBitAccess ( Value &= Mask; RegisterValue |= Value; - ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %04X to %p\n", RegisterValue, - AcpiGbl_FADT->XPm2CntBlk.Address)); + ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %04X to %8.8X%8.8X\n", + RegisterValue, + HIDWORD(AcpiGbl_FADT->XPm2CntBlk.Address), + LODWORD(AcpiGbl_FADT->XPm2CntBlk.Address))); AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, PM2_CONTROL, (UINT8) (RegisterValue)); @@ -593,8 +596,10 @@ AcpiHwRegisterBitAccess ( Mask = TMR_VAL_MASK; RegisterValue = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, PM_TIMER); - ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM_TIMER: Read %X from %p\n", - RegisterValue, ACPI_GET_ADDRESS (AcpiGbl_FADT->XPmTmrBlk.Address))); + ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM_TIMER: Read %X from %8.8X%8.8X\n", + RegisterValue, + HIDWORD(AcpiGbl_FADT->XPmTmrBlk.Address), + LODWORD(AcpiGbl_FADT->XPmTmrBlk.Address))); break; diff --git a/sys/contrib/dev/acpica/nsaccess.c b/sys/contrib/dev/acpica/nsaccess.c index 6e42625..4afb4b7 100644 --- a/sys/contrib/dev/acpica/nsaccess.c +++ b/sys/contrib/dev/acpica/nsaccess.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: nsaccess - Top-level functions for accessing ACPI namespace - * $Revision: 133 $ + * $Revision: 135 $ * ******************************************************************************/ @@ -287,6 +287,10 @@ AcpiNsRootInitialize (void) /* Store pointer to value descriptor in the Node */ AcpiNsAttachObject (NewNode, ObjDesc, ObjDesc->Common.Type); + + /* Remove local reference to the object */ + + AcpiUtRemoveReference (ObjDesc); } } @@ -554,7 +558,7 @@ AcpiNsLookup ( for (i = 0; i < NumSegments; i++) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, "%4.4s/", &Pathname[i * 4])); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, "%4.4s/", (char*)&Pathname[i * 4])); } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, "]\n")); #endif @@ -598,8 +602,8 @@ AcpiNsLookup ( /* Name not found in ACPI namespace */ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, - "Name [%4.4s] not found in scope %X\n", - &SimpleName, CurrentNode)); + "Name [%4.4s] not found in scope %p\n", + (char*)&SimpleName, CurrentNode)); } return_ACPI_STATUS (Status); @@ -632,7 +636,7 @@ AcpiNsLookup ( REPORT_WARNING ( ("NsLookup: %4.4s, type %X, checking for type %X\n", - &SimpleName, ThisNode->Type, TypeToCheckFor)); + (char*)&SimpleName, ThisNode->Type, TypeToCheckFor)); } /* @@ -652,7 +656,7 @@ AcpiNsLookup ( * More segments or the type implies enclosed scope, * and the next scope has not been allocated. */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Load mode=%X ThisNode=%X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Load mode=%X ThisNode=%p\n", InterpreterMode, ThisNode)); } diff --git a/sys/contrib/dev/acpica/nsalloc.c b/sys/contrib/dev/acpica/nsalloc.c index d58eca7..0958bcc 100644 --- a/sys/contrib/dev/acpica/nsalloc.c +++ b/sys/contrib/dev/acpica/nsalloc.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: nsalloc - Namespace allocation and deletion utilities - * $Revision: 57 $ + * $Revision: 60 $ * ******************************************************************************/ @@ -314,7 +314,7 @@ AcpiNsInstallNode ( * real definition is found later. */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "[%4.4s] is a forward reference\n", - &Node->Name)); + (char*)&Node->Name)); } /* @@ -341,7 +341,7 @@ AcpiNsInstallNode ( } ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%4.4s added to %p at %p\n", - &Node->Name, ParentNode, Node)); + (char*)&Node->Name, ParentNode, Node)); /* * Increment the reference count(s) of all parents up to @@ -408,7 +408,7 @@ AcpiNsDeleteChildren ( if (ChildNode->Child) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Found a grandchild! P=%X C=%X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Found a grandchild! P=%p C=%p\n", ParentNode, ChildNode)); } @@ -420,13 +420,9 @@ AcpiNsDeleteChildren ( ChildNode, AcpiGbl_CurrentNodeCount)); /* - * Detach an object if there is one + * Detach an object if there is one, then free the child node */ - if (ChildNode->Object) - { - AcpiNsDetachObject (ChildNode); - } - + AcpiNsDetachObject (ChildNode); ACPI_MEM_FREE (ChildNode); /* And move on to the next child in the list */ @@ -461,7 +457,6 @@ ACPI_STATUS AcpiNsDeleteNamespaceSubtree ( ACPI_NAMESPACE_NODE *ParentNode) { - ACPI_OPERAND_OBJECT *ObjDesc; ACPI_NAMESPACE_NODE *ChildNode = NULL; UINT32 Level = 1; @@ -480,33 +475,23 @@ AcpiNsDeleteNamespaceSubtree ( */ while (Level > 0) { - /* - * Get the next typed object in this scope. - * Null returned if not found - */ - ChildNode = AcpiNsGetNextObject (ACPI_TYPE_ANY, ParentNode, + /* Get the next node in this scope (NULL if none) */ + + ChildNode = AcpiNsGetNextNode (ACPI_TYPE_ANY, ParentNode, ChildNode); if (ChildNode) { - /* - * Found an object - detach and delete any attached - * object. - */ - ObjDesc = AcpiNsGetAttachedObject (ChildNode); - if (ObjDesc) - { - AcpiNsDetachObject (ChildNode); - AcpiUtRemoveReference (ObjDesc); - } + /* Found a child node - detach any attached object */ + AcpiNsDetachObject (ChildNode); - /* Check if this object has any children */ + /* Check if this node has any children */ - if (AcpiNsGetNextObject (ACPI_TYPE_ANY, ChildNode, 0)) + if (AcpiNsGetNextNode (ACPI_TYPE_ANY, ChildNode, 0)) { /* - * There is at least one child of this object, - * visit the object + * There is at least one child of this node, + * visit the node */ Level++; ParentNode = ChildNode; @@ -517,8 +502,8 @@ AcpiNsDeleteNamespaceSubtree ( else { /* - * No more children in this object. - * We will move up to the grandparent. + * No more children of this parent node. + * Move up to the grandparent. */ Level--; @@ -528,17 +513,16 @@ AcpiNsDeleteNamespaceSubtree ( */ AcpiNsDeleteChildren (ParentNode); - /* New "last child" is this parent object */ + /* New "last child" is this parent node */ ChildNode = ParentNode; - /* Now we can move up the tree to the grandparent */ + /* Move up the tree to the grandparent */ ParentNode = AcpiNsGetParentObject (ParentNode); } } - return_ACPI_STATUS (AE_OK); } @@ -547,13 +531,13 @@ AcpiNsDeleteNamespaceSubtree ( * * FUNCTION: AcpiNsRemoveReference * - * PARAMETERS: Node - Named object whose reference count is to be + * PARAMETERS: Node - Named node whose reference count is to be * decremented * * RETURN: None. * * DESCRIPTION: Remove a Node reference. Decrements the reference count - * of all parent Nodes up to the root. Any object along + * of all parent Nodes up to the root. Any node along * the way that reaches zero references is freed. * ******************************************************************************/ @@ -569,21 +553,21 @@ AcpiNsRemoveReference ( /* - * Decrement the reference count(s) of this object and all - * objects up to the root, Delete anything with zero remaining references. + * Decrement the reference count(s) of this node and all + * nodes up to the root, Delete anything with zero remaining references. */ NextNode = Node; while (NextNode) { - /* Decrement the reference count on this object*/ + /* Decrement the reference count on this node*/ NextNode->ReferenceCount--; - /* Delete the object if no more references */ + /* Delete the node if no more references */ if (!NextNode->ReferenceCount) { - /* Delete all children and delete the object */ + /* Delete all children and delete the node */ AcpiNsDeleteChildren (NextNode); AcpiNsDeleteNode (NextNode); @@ -616,7 +600,6 @@ AcpiNsDeleteNamespaceByOwner ( { ACPI_NAMESPACE_NODE *ChildNode; UINT32 Level; - ACPI_OPERAND_OBJECT *ObjDesc; ACPI_NAMESPACE_NODE *ParentNode; @@ -628,43 +611,32 @@ AcpiNsDeleteNamespaceByOwner ( Level = 1; /* - * Traverse the tree of objects until we bubble back up + * Traverse the tree of nodes until we bubble back up * to where we started. */ while (Level > 0) { - /* - * Get the next typed object in this scope. - * Null returned if not found - */ - ChildNode = AcpiNsGetNextObject (ACPI_TYPE_ANY, ParentNode, - ChildNode); + /* Get the next node in this scope (NULL if none) */ + ChildNode = AcpiNsGetNextNode (ACPI_TYPE_ANY, ParentNode, + ChildNode); if (ChildNode) { if (ChildNode->OwnerId == OwnerId) { - /* - * Found an object - delete the object within - * the Value field - */ - ObjDesc = AcpiNsGetAttachedObject (ChildNode); - if (ObjDesc) - { - AcpiNsDetachObject (ChildNode); - AcpiUtRemoveReference (ObjDesc); - } + /* Found a child node - detach any attached object */ + + AcpiNsDetachObject (ChildNode); } - /* Check if this object has any children */ + /* Check if this node has any children */ - if (AcpiNsGetNextObject (ACPI_TYPE_ANY, ChildNode, 0)) + if (AcpiNsGetNextNode (ACPI_TYPE_ANY, ChildNode, 0)) { /* - * There is at least one child of this object, - * visit the object + * There is at least one child of this node, + * visit the node */ - Level++; ParentNode = ChildNode; ChildNode = 0; @@ -679,7 +651,8 @@ AcpiNsDeleteNamespaceByOwner ( else { /* - * No more children in this object. Move up to grandparent. + * No more children of this parent node. + * Move up to the grandparent. */ Level--; @@ -691,17 +664,16 @@ AcpiNsDeleteNamespaceByOwner ( } } - /* New "last child" is this parent object */ + /* New "last child" is this parent node */ ChildNode = ParentNode; - /* Now we can move up the tree to the grandparent */ + /* Move up the tree to the grandparent */ ParentNode = AcpiNsGetParentObject (ParentNode); } } - return_ACPI_STATUS (AE_OK); } diff --git a/sys/contrib/dev/acpica/nsdump.c b/sys/contrib/dev/acpica/nsdump.c index 1ce7710..f8888c4 100644 --- a/sys/contrib/dev/acpica/nsdump.c +++ b/sys/contrib/dev/acpica/nsdump.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: nsdump - table dumping routines for debug - * $Revision: 100 $ + * $Revision: 105 $ * *****************************************************************************/ @@ -121,6 +121,7 @@ #include "acinterp.h" #include "acnamesp.h" #include "actables.h" +#include "acparser.h" #define _COMPONENT ACPI_NAMESPACE @@ -206,7 +207,6 @@ AcpiNsDumpOneObject ( { ACPI_WALK_INFO *Info = (ACPI_WALK_INFO *) Context; ACPI_NAMESPACE_NODE *ThisNode; - UINT8 *Value; ACPI_OPERAND_OBJECT *ObjDesc = NULL; ACPI_OBJECT_TYPE8 ObjType; ACPI_OBJECT_TYPE8 Type; @@ -214,12 +214,13 @@ AcpiNsDumpOneObject ( UINT32 DownstreamSiblingMask = 0; UINT32 LevelTmp; UINT32 WhichBit; + UINT32 i; PROC_NAME ("NsDumpOneObject"); - ThisNode = AcpiNsConvertHandleToEntry (ObjHandle); + ThisNode = AcpiNsMapHandleToNode (ObjHandle); LevelTmp = Level; Type = ThisNode->Type; @@ -315,58 +316,209 @@ AcpiNsDumpOneObject ( /* * Now we can print out the pertinent information */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " %4.4s %-9s ", &ThisNode->Name, AcpiUtGetTypeName (Type))); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "%p S:%p O:%p", ThisNode, ThisNode->Child, ThisNode->Object)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " %4.4s %-12s %p", + (char*)&ThisNode->Name, AcpiUtGetTypeName (Type), ThisNode)); + ObjDesc = ThisNode->Object; - if (!ThisNode->Object) + switch (Info->DisplayType) { - /* No attached object, we are done */ + case ACPI_DISPLAY_SUMMARY: - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); - return (AE_OK); - } + if (!ObjDesc) + { + /* No attached object, we are done */ - switch (Type) - { + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); + return (AE_OK); + } - case ACPI_TYPE_METHOD: - /* Name is a Method and its AML offset/length are set */ + switch (Type) + { + case ACPI_TYPE_PROCESSOR: + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " ID %d Addr %.4X Len %.4X\n", + ObjDesc->Processor.ProcId, + ObjDesc->Processor.Address, + ObjDesc->Processor.Length)); + break; - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " M:%p-%X\n", - ((ACPI_OPERAND_OBJECT *) ThisNode->Object)->Method.AmlStart, - ((ACPI_OPERAND_OBJECT *) ThisNode->Object)->Method.AmlLength)); + case ACPI_TYPE_DEVICE: + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Notification object: %p", ObjDesc)); + break; - break; + case ACPI_TYPE_METHOD: + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Args %d Len %.4X Aml %p \n", + ObjDesc->Method.ParamCount, + ObjDesc->Method.AmlLength, + ObjDesc->Method.AmlStart)); + break; + case ACPI_TYPE_INTEGER: + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " = %8.8X%8.8X\n", + HIDWORD (ObjDesc->Integer.Value), + LODWORD (ObjDesc->Integer.Value))); + break; - case ACPI_TYPE_INTEGER: + case ACPI_TYPE_PACKAGE: + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Elements %.2X\n", + ObjDesc->Package.Count)); + break; - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " N:%X\n", - ((ACPI_OPERAND_OBJECT *) ThisNode->Object)->Integer.Value)); - break; + case ACPI_TYPE_BUFFER: + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Len %.2X", + ObjDesc->Buffer.Length)); + /* Dump some of the buffer */ - case ACPI_TYPE_STRING: + if (ObjDesc->Buffer.Length > 0) + { + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " =")); + for (i = 0; (i < ObjDesc->Buffer.Length && i < 12); i++) + { + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " %.2X", + ObjDesc->Buffer.Pointer[i])); + } + } + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); + break; - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " S:%p-%X\n", - ((ACPI_OPERAND_OBJECT *) ThisNode->Object)->String.Pointer, - ((ACPI_OPERAND_OBJECT *) ThisNode->Object)->String.Length)); - break; + case ACPI_TYPE_STRING: + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Len %.2X", + ObjDesc->String.Length)); + + if (ObjDesc->String.Length > 0) + { + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " = \"%.32s\"...", + ObjDesc->String.Pointer)); + } + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); + break; + + case ACPI_TYPE_REGION: + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " [%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", + HIDWORD(ObjDesc->Region.Address), + LODWORD(ObjDesc->Region.Address), + ObjDesc->Region.Length)); + } + else + { + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " [Address/Length not evaluated]\n")); + } + break; + + case INTERNAL_TYPE_REFERENCE: + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " [%s]\n", + AcpiPsGetOpcodeName (ObjDesc->Reference.Opcode))); + break; + + case ACPI_TYPE_BUFFER_FIELD: + /* TBD: print Buffer name when we can easily get it */ + break; + + case INTERNAL_TYPE_REGION_FIELD: + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " 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)); + 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)); + break; - case ACPI_TYPE_BUFFER: + default: + + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Object %p\n", ObjDesc)); + break; + } + + /* Common field handling */ + + switch (Type) + { + case ACPI_TYPE_BUFFER_FIELD: + 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)); + break; + } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " B:%p-%X\n", - ((ACPI_OPERAND_OBJECT *) ThisNode->Object)->Buffer.Pointer, - ((ACPI_OPERAND_OBJECT *) ThisNode->Object)->Buffer.Length)); break; - default: + case ACPI_DISPLAY_OBJECTS: + + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "%p O:%p", + ThisNode, ObjDesc)); + + if (!ObjDesc) + { + /* No attached object, we are done */ + + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); + return (AE_OK); + } + + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(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)); + + break; - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); + + case ACPI_TYPE_INTEGER: + + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " 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)); + break; + + + case ACPI_TYPE_BUFFER: + + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " B:%p-%X\n", + ObjDesc->Buffer.Pointer, + ObjDesc->Buffer.Length)); + break; + + + default: + + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "\n")); + break; + } break; } @@ -380,34 +532,27 @@ AcpiNsDumpOneObject ( /* If there is an attached object, display it */ - Value = ThisNode->Object; + ObjDesc = ThisNode->Object; /* Dump attached objects */ - while (Value) + while (ObjDesc) { ObjType = INTERNAL_TYPE_INVALID; /* Decode the type of attached object and dump the contents */ - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Attached Object %p: ", Value)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " Attached Object %p: ", ObjDesc)); - if (AcpiTbSystemTablePointer (Value)) - { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to AML Code)\n")); - BytesToDump = 16; - } - - else if (VALID_DESCRIPTOR_TYPE (Value, ACPI_DESC_TYPE_NAMED)) + if (VALID_DESCRIPTOR_TYPE (ObjDesc, ACPI_DESC_TYPE_NAMED)) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to Node)\n")); BytesToDump = sizeof (ACPI_NAMESPACE_NODE); } - else if (VALID_DESCRIPTOR_TYPE (Value, ACPI_DESC_TYPE_INTERNAL)) + else if (VALID_DESCRIPTOR_TYPE (ObjDesc, ACPI_DESC_TYPE_INTERNAL)) { - ObjDesc = (ACPI_OPERAND_OBJECT *) Value; ObjType = ObjDesc->Common.Type; if (ObjType > INTERNAL_TYPE_MAX) @@ -418,7 +563,7 @@ AcpiNsDumpOneObject ( else { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to ACPI Object type %X [%s])\n", + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(Ptr to ACPI Object type %2.2X [%s])\n", ObjType, AcpiUtGetTypeName (ObjType))); BytesToDump = sizeof (ACPI_OPERAND_OBJECT); } @@ -426,16 +571,15 @@ AcpiNsDumpOneObject ( else { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(String or Buffer - not descriptor)\n", Value)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, "(String or Buffer - not descriptor)\n")); BytesToDump = 16; } - DUMP_BUFFER (Value, BytesToDump); + DUMP_BUFFER (ObjDesc, BytesToDump); /* If value is NOT an internal object, we are done */ - if ((AcpiTbSystemTablePointer (Value)) || - (VALID_DESCRIPTOR_TYPE (Value, ACPI_DESC_TYPE_NAMED))) + if (VALID_DESCRIPTOR_TYPE (ObjDesc, ACPI_DESC_TYPE_NAMED)) { goto Cleanup; } @@ -446,35 +590,35 @@ AcpiNsDumpOneObject ( switch (ObjType) { case ACPI_TYPE_STRING: - Value = (UINT8 *) ObjDesc->String.Pointer; + ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->String.Pointer; break; case ACPI_TYPE_BUFFER: - Value = (UINT8 *) ObjDesc->Buffer.Pointer; + ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->Buffer.Pointer; break; case ACPI_TYPE_BUFFER_FIELD: - Value = (UINT8 *) ObjDesc->BufferField.BufferObj; + ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->BufferField.BufferObj; break; case ACPI_TYPE_PACKAGE: - Value = (UINT8 *) ObjDesc->Package.Elements; + ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->Package.Elements; break; case ACPI_TYPE_METHOD: - Value = (UINT8 *) ObjDesc->Method.AmlStart; + ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->Method.AmlStart; break; case INTERNAL_TYPE_REGION_FIELD: - Value = (UINT8 *) ObjDesc->Field.RegionObj; + ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->Field.RegionObj; break; case INTERNAL_TYPE_BANK_FIELD: - Value = (UINT8 *) ObjDesc->BankField.RegionObj; + ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->BankField.RegionObj; break; case INTERNAL_TYPE_INDEX_FIELD: - Value = (UINT8 *) ObjDesc->IndexField.IndexObj; + ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->IndexField.IndexObj; break; default: @@ -509,6 +653,7 @@ Cleanup: void AcpiNsDumpObjects ( ACPI_OBJECT_TYPE8 Type, + UINT8 DisplayType, UINT32 MaxDepth, UINT32 OwnerId, ACPI_HANDLE StartHandle) @@ -521,6 +666,8 @@ AcpiNsDumpObjects ( Info.DebugLevel = ACPI_LV_TABLES; Info.OwnerId = OwnerId; + Info.DisplayType = DisplayType; + AcpiNsWalkNamespace (Type, StartHandle, MaxDepth, NS_WALK_NO_UNLOCK, AcpiNsDumpOneObject, (void *) &Info, NULL); @@ -566,8 +713,8 @@ AcpiNsDumpOneDevice ( ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " ")); } - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " HID: %.8X, ADR: %.8X, Status: %x\n", - Info.HardwareId, Info.Address, Info.CurrentStatus)); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " HID: %s, ADR: %8.8X%8.8X, Status: %x\n", + Info.HardwareId, HIDWORD(Info.Address), LODWORD(Info.Address), Info.CurrentStatus)); } return (Status); @@ -652,7 +799,8 @@ AcpiNsDumpTables ( } - AcpiNsDumpObjects (ACPI_TYPE_ANY, MaxDepth, ACPI_UINT32_MAX, SearchHandle); + AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, MaxDepth, + ACPI_UINT32_MAX, SearchHandle); return_VOID; } diff --git a/sys/contrib/dev/acpica/nseval.c b/sys/contrib/dev/acpica/nseval.c index 263ef97..2cf9149 100644 --- a/sys/contrib/dev/acpica/nseval.c +++ b/sys/contrib/dev/acpica/nseval.c @@ -2,7 +2,7 @@ * * Module Name: nseval - Object evaluation interfaces -- includes control * method lookup and execution. - * $Revision: 99 $ + * $Revision: 102 $ * ******************************************************************************/ @@ -188,7 +188,7 @@ AcpiNsEvaluateRelative ( AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); - PrefixNode = AcpiNsConvertHandleToEntry (Handle); + PrefixNode = AcpiNsMapHandleToNode (Handle); if (!PrefixNode) { AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); @@ -374,7 +374,7 @@ AcpiNsEvaluateByHandle ( AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); - Node = AcpiNsConvertHandleToEntry (Handle); + Node = AcpiNsMapHandleToNode (Handle); if (!Node) { AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); @@ -492,13 +492,13 @@ AcpiNsExecuteControlMethod ( } - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Control method at Offset %x Length %lx]\n", + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Control method at Offset %p Length %x]\n", ObjDesc->Method.AmlStart + 1, ObjDesc->Method.AmlLength - 1)); DUMP_PATHNAME (MethodNode, "NsExecuteControlMethod: Executing", ACPI_LV_NAMES, _COMPONENT); - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "At offset %8XH\n", + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "At offset %p\n", ObjDesc->Method.AmlStart + 1)); @@ -549,7 +549,7 @@ AcpiNsGetObjectValue ( { ACPI_STATUS Status = AE_OK; ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_OPERAND_OBJECT *ValDesc; + ACPI_OPERAND_OBJECT *SourceDesc; FUNCTION_TRACE ("NsGetObjectValue"); @@ -574,8 +574,8 @@ AcpiNsGetObjectValue ( /* * Get the attached object */ - ValDesc = AcpiNsGetAttachedObject (Node); - if (!ValDesc) + SourceDesc = AcpiNsGetAttachedObject (Node); + if (!SourceDesc) { Status = AE_NULL_OBJECT; goto UnlockAndExit; @@ -587,7 +587,7 @@ AcpiNsGetObjectValue ( * TBD: [Future] - need a low-level object copy that handles * the reference count automatically. (Don't want to copy it) */ - MEMCPY (ObjDesc, ValDesc, sizeof (ACPI_OPERAND_OBJECT)); + MEMCPY (ObjDesc, SourceDesc, sizeof (ACPI_OPERAND_OBJECT)); ObjDesc->Common.ReferenceCount = 1; AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); } diff --git a/sys/contrib/dev/acpica/nsinit.c b/sys/contrib/dev/acpica/nsinit.c index 919992a..2456efc 100644 --- a/sys/contrib/dev/acpica/nsinit.c +++ b/sys/contrib/dev/acpica/nsinit.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: nsinit - namespace initialization - * $Revision: 31 $ + * $Revision: 33 $ * *****************************************************************************/ @@ -319,7 +319,7 @@ AcpiNsInitOneObject ( ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n")); ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s while getting region arguments [%4.4s]\n", - AcpiFormatException (Status), &Node->Name)); + AcpiFormatException (Status), (char*)&Node->Name)); } if (!(AcpiDbgLevel & ACPI_LV_INIT)) @@ -345,7 +345,7 @@ AcpiNsInitOneObject ( ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n")); ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s while getting buffer field arguments [%4.4s]\n", - AcpiFormatException (Status), &Node->Name)); + AcpiFormatException (Status), (char*)&Node->Name)); } if (!(AcpiDbgLevel & ACPI_LV_INIT)) { @@ -408,7 +408,7 @@ AcpiNsInitOneDevice ( AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); - Node = AcpiNsConvertHandleToEntry (ObjHandle); + Node = AcpiNsMapHandleToNode (ObjHandle); if (!Node) { AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); diff --git a/sys/contrib/dev/acpica/nsnames.c b/sys/contrib/dev/acpica/nsnames.c index aeced55..44731d2 100644 --- a/sys/contrib/dev/acpica/nsnames.c +++ b/sys/contrib/dev/acpica/nsnames.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: nsnames - Name manipulation and search - * $Revision: 63 $ + * $Revision: 64 $ * ******************************************************************************/ @@ -304,7 +304,7 @@ AcpiNsHandleToPathname ( return_ACPI_STATUS (AE_NO_NAMESPACE); } - Node = AcpiNsConvertHandleToEntry (TargetHandle); + Node = AcpiNsMapHandleToNode (TargetHandle); if (!Node) { return_ACPI_STATUS (AE_BAD_PARAMETER); diff --git a/sys/contrib/dev/acpica/nsobject.c b/sys/contrib/dev/acpica/nsobject.c index 38de511..05bfd79 100644 --- a/sys/contrib/dev/acpica/nsobject.c +++ b/sys/contrib/dev/acpica/nsobject.c @@ -2,7 +2,7 @@ * * Module Name: nsobject - Utilities for objects attached to namespace * table entries - * $Revision: 65 $ + * $Revision: 67 $ * ******************************************************************************/ @@ -156,7 +156,6 @@ AcpiNsAttachObject ( ACPI_OPERAND_OBJECT *PreviousObjDesc; ACPI_OBJECT_TYPE8 ObjType = ACPI_TYPE_ANY; UINT8 Flags; - UINT16 Opcode; FUNCTION_TRACE ("NsAttachObject"); @@ -261,90 +260,6 @@ AcpiNsAttachObject ( ObjType = Type; } - /* - * Type is TYPE_Any, we must try to determinte the - * actual type of the object. - * Check if value points into the AML code - */ - else if (AcpiTbSystemTablePointer (Object)) - { - /* - * Object points into the AML stream. - * Set a flag bit in the Node to indicate this - */ - Flags |= ANOBJ_AML_ATTACHMENT; - - /* - * The next byte (perhaps the next two bytes) - * will be the AML opcode - */ - MOVE_UNALIGNED16_TO_16 (&Opcode, Object); - - /* Check for a recognized Opcode */ - - switch ((UINT8) Opcode) - { - - case AML_OP_PREFIX: - - if (Opcode != AML_REVISION_OP) - { - /* - * OpPrefix is unrecognized unless part - * of RevisionOp - */ - break; - } - - /* case AML_REVISION_OP: fall through and set the type to Integer */ - - case AML_ZERO_OP: - case AML_ONES_OP: - case AML_ONE_OP: - case AML_BYTE_OP: - case AML_WORD_OP: - case AML_DWORD_OP: - case AML_QWORD_OP: - - ObjType = ACPI_TYPE_INTEGER; - break; - - - case AML_STRING_OP: - - ObjType = ACPI_TYPE_STRING; - break; - - - case AML_BUFFER_OP: - - ObjType = ACPI_TYPE_BUFFER; - break; - - - case AML_MUTEX_OP: - - ObjType = ACPI_TYPE_MUTEX; - break; - - - case AML_PACKAGE_OP: - - ObjType = ACPI_TYPE_PACKAGE; - break; - - - default: - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "AML Opcode/Type [%x] not supported in attach\n", - (UINT8) Opcode)); - - return_ACPI_STATUS (AE_TYPE); - break; - } - } - else { /* @@ -357,13 +272,7 @@ AcpiNsAttachObject ( "NsAttachObject confused: setting bogus type for ", ACPI_LV_INFO, _COMPONENT); - if (AcpiTbSystemTablePointer (Object)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "AML-stream code %02x\n", *(UINT8 *) Object)); - } - - else if (VALID_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_NAMED)) + if (VALID_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_NAMED)) { DUMP_PATHNAME (Object, "name ", ACPI_LV_INFO, _COMPONENT); } @@ -381,7 +290,7 @@ AcpiNsAttachObject ( ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Installing %p into Node %p [%4.4s]\n", - ObjDesc, Node, &Node->Name)); + ObjDesc, Node, (char*)&Node->Name)); /* @@ -453,22 +362,12 @@ AcpiNsDetachObject ( Node->Object = NULL; - /* Found a valid value */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Object=%p Value=%p Name %4.4s\n", - Node, ObjDesc, &Node->Name)); + Node, ObjDesc, (char*)&Node->Name)); - /* - * Not every value is an object allocated via ACPI_MEM_CALLOCATE, - * - must check - */ - if (!AcpiTbSystemTablePointer (ObjDesc)) - { - /* Attempt to delete the object (and all subobjects) */ - - AcpiUtRemoveReference (ObjDesc); - } + /* Remove one reference on the object (and all subobjects) */ + AcpiUtRemoveReference (ObjDesc); return_VOID; } diff --git a/sys/contrib/dev/acpica/nssearch.c b/sys/contrib/dev/acpica/nssearch.c index a0e0ed7..2992f86 100644 --- a/sys/contrib/dev/acpica/nssearch.c +++ b/sys/contrib/dev/acpica/nssearch.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: nssearch - Namespace search - * $Revision: 74 $ + * $Revision: 75 $ * ******************************************************************************/ @@ -174,7 +174,7 @@ AcpiNsSearchNode ( if (ScopeName) { ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching %s [%p] For %4.4s (type %X)\n", - ScopeName, Node, &TargetName, Type)); + ScopeName, Node, (char*)&TargetName, Type)); ACPI_MEM_FREE (ScopeName); } @@ -222,7 +222,7 @@ AcpiNsSearchNode ( ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Name %4.4s (actual type %X) found at %p\n", - &TargetName, NextNode->Type, NextNode)); + (char*)&TargetName, NextNode->Type, NextNode)); *ReturnNode = NextNode; return_ACPI_STATUS (AE_OK); @@ -249,7 +249,7 @@ AcpiNsSearchNode ( /* Searched entire table, not found */ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Name %4.4s (type %X) not found at %p\n", - &TargetName, Type, NextNode)); + (char*)&TargetName, Type, NextNode)); return_ACPI_STATUS (AE_NOT_FOUND); } @@ -306,13 +306,13 @@ AcpiNsSearchParentTree ( if (!ParentNode) { ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] has no parent\n", - &TargetName)); + (char*)&TargetName)); } if (AcpiNsLocal (Type)) { ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[%4.4s] type %X is local(no search)\n", - &TargetName, Type)); + (char*)&TargetName, Type)); } return_ACPI_STATUS (AE_NOT_FOUND); @@ -321,7 +321,7 @@ AcpiNsSearchParentTree ( /* Search the parent tree */ - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching parent for %4.4s\n", &TargetName)); + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching parent for %4.4s\n", (char*)&TargetName)); /* * Search parents until found the target or we have backed up to @@ -400,7 +400,7 @@ AcpiNsSearchAndEnter ( if (!Node || !TargetName || !ReturnNode) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null param- Table %p Name %p Return %p\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Null param- Table %p Name %X Return %p\n", Node, TargetName, ReturnNode)); REPORT_ERROR (("NsSearchAndEnter: bad (null) parameter\n")); @@ -412,7 +412,7 @@ AcpiNsSearchAndEnter ( if (!AcpiUtValidAcpiName (TargetName)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "*** Bad character in name: %08lx *** \n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "*** Bad character in name: %08x *** \n", TargetName)); REPORT_ERROR (("NsSearchAndEnter: Bad character in ACPI Name\n")); @@ -475,7 +475,7 @@ AcpiNsSearchAndEnter ( if (InterpreterMode == IMODE_EXECUTE) { ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%4.4s Not found in %p [Not adding]\n", - &TargetName, Node)); + (char*)&TargetName, Node)); return_ACPI_STATUS (AE_NOT_FOUND); } diff --git a/sys/contrib/dev/acpica/nsutils.c b/sys/contrib/dev/acpica/nsutils.c index c917ebe..1a8363e 100644 --- a/sys/contrib/dev/acpica/nsutils.c +++ b/sys/contrib/dev/acpica/nsutils.c @@ -2,7 +2,7 @@ * * Module Name: nsutils - Utilities for accessing ACPI namespace, accessing * parents and siblings and Scope manipulation - * $Revision: 89 $ + * $Revision: 92 $ * *****************************************************************************/ @@ -682,7 +682,7 @@ AcpiNsExternalizeName ( /******************************************************************************* * - * FUNCTION: AcpiNsConvertHandleToEntry + * FUNCTION: AcpiNsMapHandleToNode * * PARAMETERS: Handle - Handle to be converted to an Node * @@ -693,7 +693,7 @@ AcpiNsExternalizeName ( ******************************************************************************/ ACPI_NAMESPACE_NODE * -AcpiNsConvertHandleToEntry ( +AcpiNsMapHandleToNode ( ACPI_HANDLE Handle) { @@ -973,7 +973,7 @@ AcpiNsFindParentName ( if (ParentNode) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Parent of %p [%4.4s] is %p [%4.4s]\n", - ChildNode, &ChildNode->Name, ParentNode, &ParentNode->Name)); + ChildNode, (char*)&ChildNode->Name, ParentNode, (char*)&ParentNode->Name)); if (ParentNode->Name) { @@ -982,7 +982,7 @@ AcpiNsFindParentName ( } ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "unable to find parent of %p (%4.4s)\n", - ChildNode, &ChildNode->Name)); + ChildNode, (char*)&ChildNode->Name)); } return_VALUE (ACPI_UNKNOWN_NAME); @@ -1074,21 +1074,21 @@ AcpiNsGetParentObject ( /******************************************************************************* * - * FUNCTION: AcpiNsGetNextValidObject + * FUNCTION: AcpiNsGetNextValidNode * * PARAMETERS: Node - Current table entry * - * RETURN: Next valid object in the table. NULL if no more valid - * objects + * RETURN: Next valid Node in the linked node list. NULL if no more valid + * nodess * - * DESCRIPTION: Find the next valid object within a name table. + * DESCRIPTION: Find the next valid node within a name table. * Useful for implementing NULL-end-of-list loops. * ******************************************************************************/ ACPI_NAMESPACE_NODE * -AcpiNsGetNextValidObject ( +AcpiNsGetNextValidNode ( ACPI_NAMESPACE_NODE *Node) { diff --git a/sys/contrib/dev/acpica/nswalk.c b/sys/contrib/dev/acpica/nswalk.c index 1cd54ce..c39e7a3 100644 --- a/sys/contrib/dev/acpica/nswalk.c +++ b/sys/contrib/dev/acpica/nswalk.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: nswalk - Functions for walking the ACPI namespace - * $Revision: 24 $ + * $Revision: 26 $ * *****************************************************************************/ @@ -126,27 +126,27 @@ MODULE_NAME ("nswalk") -/**************************************************************************** +/******************************************************************************* * - * FUNCTION: AcpiGetNextObject + * FUNCTION: AcpiNsGetNextNode * - * PARAMETERS: Type - Type of object to be searched for - * Parent - Parent object whose children we are - * getting - * LastChild - Previous child that was found. + * PARAMETERS: Type - Type of node to be searched for + * ParentNode - Parent node whose children we are + * getting + * ChildNode - Previous child that was found. * The NEXT child will be returned * * RETURN: ACPI_NAMESPACE_NODE - Pointer to the NEXT child or NULL if - * none is found. + * none is found. * - * DESCRIPTION: Return the next peer object within the namespace. If Handle - * is valid, Scope is ignored. Otherwise, the first object + * DESCRIPTION: Return the next peer node within the namespace. If Handle + * is valid, Scope is ignored. Otherwise, the first node * within Scope is returned. * - ****************************************************************************/ + ******************************************************************************/ ACPI_NAMESPACE_NODE * -AcpiNsGetNextObject ( +AcpiNsGetNextNode ( ACPI_OBJECT_TYPE8 Type, ACPI_NAMESPACE_NODE *ParentNode, ACPI_NAMESPACE_NODE *ChildNode) @@ -169,12 +169,11 @@ AcpiNsGetNextObject ( else { - /* Start search at the NEXT object */ + /* Start search at the NEXT node */ - NextNode = AcpiNsGetNextValidObject (ChildNode); + NextNode = AcpiNsGetNextValidNode (ChildNode); } - /* If any type is OK, we are done */ if (Type == ACPI_TYPE_ANY) @@ -184,8 +183,7 @@ AcpiNsGetNextObject ( return (NextNode); } - - /* Must search for the object -- but within this scope only */ + /* Must search for the node -- but within this scope only */ while (NextNode) { @@ -196,19 +194,18 @@ AcpiNsGetNextObject ( return (NextNode); } - /* Otherwise, move on to the next object */ + /* Otherwise, move on to the next node */ - NextNode = AcpiNsGetNextValidObject (NextNode); + NextNode = AcpiNsGetNextValidNode (NextNode); } - /* Not found */ return (NULL); } -/****************************************************************************** +/******************************************************************************* * * FUNCTION: AcpiNsWalkNamespace * @@ -219,13 +216,13 @@ AcpiNsGetNextObject ( * the callback routine * UserFunction - Called when an object of "Type" is found * Context - Passed to user function - * - * RETURNS Return value from the UserFunction if terminated early. - * Otherwise, returns NULL. + * ReturnValue - from the UserFunction if terminated early. + * Otherwise, returns NULL. + * RETURNS: Status * * DESCRIPTION: Performs a modified depth-first walk of the namespace tree, - * starting (and ending) at the object specified by StartHandle. - * The UserFunction is called whenever an object that matches + * starting (and ending) at the node specified by StartHandle. + * The UserFunction is called whenever a node that matches * the type parameter is found. If the user function returns * a non-zero value, the search is terminated immediately and this * value is returned to the caller. @@ -265,34 +262,28 @@ AcpiNsWalkNamespace ( StartNode = AcpiGbl_RootNode; } + /* Null child means "get first node" */ - /* Null child means "get first object" */ - - ParentNode = StartNode; - ChildNode = 0; + ParentNode = StartNode; + ChildNode = 0; ChildType = ACPI_TYPE_ANY; Level = 1; /* - * Traverse the tree of objects until we bubble back up to where we + * Traverse the tree of nodes until we bubble back up to where we * started. When Level is zero, the loop is done because we have * bubbled up to (and passed) the original parent handle (StartEntry) */ while (Level > 0) { - /* - * Get the next typed object in this scope. Null returned - * if not found - */ - Status = AE_OK; - ChildNode = AcpiNsGetNextObject (ACPI_TYPE_ANY, - ParentNode, - ChildNode); + /* Get the next node in this scope. Null if not found */ + Status = AE_OK; + ChildNode = AcpiNsGetNextNode (ACPI_TYPE_ANY, ParentNode, ChildNode); if (ChildNode) { /* - * Found an object, Get the type if we are not + * Found node, Get the type if we are not * searching for ANY */ if (Type != ACPI_TYPE_ANY) @@ -303,7 +294,7 @@ AcpiNsWalkNamespace ( if (ChildType == Type) { /* - * Found a matching object, invoke the user + * Found a matching node, invoke the user * callback function */ if (UnlockBeforeCallback) @@ -353,12 +344,11 @@ AcpiNsWalkNamespace ( */ if ((Level < MaxDepth) && (Status != AE_CTRL_DEPTH)) { - if (AcpiNsGetNextObject (ACPI_TYPE_ANY, - ChildNode, 0)) + if (AcpiNsGetNextNode (ACPI_TYPE_ANY, ChildNode, 0)) { /* * There is at least one child of this - * object, visit the object + * node, visit the onde */ Level++; ParentNode = ChildNode; @@ -370,9 +360,9 @@ AcpiNsWalkNamespace ( else { /* - * No more children in this object (AcpiNsGetNextObject + * No more children of this node (AcpiNsGetNextNode * failed), go back upwards in the namespace tree to - * the object's parent. + * the node's parent. */ Level--; ChildNode = ParentNode; diff --git a/sys/contrib/dev/acpica/nsxfname.c b/sys/contrib/dev/acpica/nsxfname.c index 0c0f1ef..3b2f194 100644 --- a/sys/contrib/dev/acpica/nsxfname.c +++ b/sys/contrib/dev/acpica/nsxfname.c @@ -2,7 +2,7 @@ * * Module Name: nsxfname - Public interfaces to the ACPI subsystem * ACPI Namespace oriented interfaces - * $Revision: 81 $ + * $Revision: 82 $ * *****************************************************************************/ @@ -175,7 +175,7 @@ AcpiGetHandle ( { AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); - PrefixNode = AcpiNsConvertHandleToEntry (Parent); + PrefixNode = AcpiNsMapHandleToNode (Parent); if (!PrefixNode) { AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); @@ -263,7 +263,7 @@ AcpiGetName ( * Validate handle and convert to an Node */ AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); - Node = AcpiNsConvertHandleToEntry (Handle); + Node = AcpiNsMapHandleToNode (Handle); if (!Node) { Status = AE_BAD_PARAMETER; @@ -331,7 +331,7 @@ AcpiGetObjectInfo ( AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); - Node = AcpiNsConvertHandleToEntry (Handle); + Node = AcpiNsMapHandleToNode (Handle); if (!Node) { AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); diff --git a/sys/contrib/dev/acpica/nsxfobj.c b/sys/contrib/dev/acpica/nsxfobj.c index efb18d7..6012593 100644 --- a/sys/contrib/dev/acpica/nsxfobj.c +++ b/sys/contrib/dev/acpica/nsxfobj.c @@ -2,7 +2,7 @@ * * Module Name: nsxfobj - Public interfaces to the ACPI subsystem * ACPI Object oriented interfaces - * $Revision: 93 $ + * $Revision: 95 $ * ******************************************************************************/ @@ -409,7 +409,7 @@ AcpiGetNextObject ( { /* Start search at the beginning of the specified scope */ - ParentNode = AcpiNsConvertHandleToEntry (Parent); + ParentNode = AcpiNsMapHandleToNode (Parent); if (!ParentNode) { Status = AE_BAD_PARAMETER; @@ -423,7 +423,7 @@ AcpiGetNextObject ( { /* Convert and validate the handle */ - ChildNode = AcpiNsConvertHandleToEntry (Child); + ChildNode = AcpiNsMapHandleToNode (Child); if (!ChildNode) { Status = AE_BAD_PARAMETER; @@ -434,7 +434,7 @@ AcpiGetNextObject ( /* Internal function does the real work */ - Node = AcpiNsGetNextObject ((ACPI_OBJECT_TYPE8) Type, + Node = AcpiNsGetNextNode ((ACPI_OBJECT_TYPE8) Type, ParentNode, ChildNode); if (!Node) { @@ -497,7 +497,7 @@ AcpiGetType ( /* Convert and validate the handle */ - Node = AcpiNsConvertHandleToEntry (Handle); + Node = AcpiNsMapHandleToNode (Handle); if (!Node) { AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); @@ -552,7 +552,7 @@ AcpiGetParent ( /* Convert and validate the handle */ - Node = AcpiNsConvertHandleToEntry (Handle); + Node = AcpiNsMapHandleToNode (Handle); if (!Node) { Status = AE_BAD_PARAMETER; @@ -682,7 +682,7 @@ AcpiNsGetDeviceCallback ( Info = Context; AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); - Node = AcpiNsConvertHandleToEntry (ObjHandle); + Node = AcpiNsMapHandleToNode (ObjHandle); AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); if (!Node) diff --git a/sys/contrib/dev/acpica/psargs.c b/sys/contrib/dev/acpica/psargs.c index 03d207e..44b1848 100644 --- a/sys/contrib/dev/acpica/psargs.c +++ b/sys/contrib/dev/acpica/psargs.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: psargs - Parse AML opcode arguments - * $Revision: 51 $ + * $Revision: 52 $ * *****************************************************************************/ @@ -500,12 +500,12 @@ AcpiPsGetNextNamepath ( NameOp->Node = MethodNode; AcpiPsAppendArg (Arg, NameOp); - if (!(ACPI_OPERAND_OBJECT *) MethodNode->Object) + if (!MethodNode->Object) { return_VOID; } - *ArgCount = ((ACPI_OPERAND_OBJECT *) MethodNode->Object)->Method.ParamCount; + *ArgCount = (MethodNode->Object)->Method.ParamCount; } return_VOID; diff --git a/sys/contrib/dev/acpica/psfind.c b/sys/contrib/dev/acpica/psfind.c index 6a135fc..6c2ff13 100644 --- a/sys/contrib/dev/acpica/psfind.c +++ b/sys/contrib/dev/acpica/psfind.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: psfind - Parse tree search routine - * $Revision: 29 $ + * $Revision: 30 $ * *****************************************************************************/ @@ -401,7 +401,7 @@ AcpiPsFind ( Op = AcpiPsFindName (Scope, Name, NameOp); if (Op) { - ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "[%4.4s] Found! Op=%p Opcode=%4.4X\n", &Name, Op, Op->Opcode)); + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "[%4.4s] Found! Op=%p Opcode=%4.4X\n", (char*)&Name, Op, Op->Opcode)); } if (!Op) @@ -424,7 +424,7 @@ AcpiPsFind ( AcpiPsSetName (Op, Name); AcpiPsAppendArg (Scope, Op); - ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "[%4.4s] Not found, created Op=%p Opcode=%4.4X\n", &Name, Op, Opcode)); + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "[%4.4s] Not found, created Op=%p Opcode=%4.4X\n", (char*)&Name, Op, Opcode)); } } @@ -438,19 +438,19 @@ AcpiPsFind ( Op = AcpiPsFindName (Scope, Name, Opcode); if (Op) { - ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "[%4.4s] Found in parent tree! Op=%p Opcode=%4.4X\n", &Name, Op, Op->Opcode)); + 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", &Name, Scope)); + 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", &Name, Scope)); + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Segment [%4.4s] Not Found in scope %p!\n", (char*)&Name, Scope)); } } diff --git a/sys/contrib/dev/acpica/psopcode.c b/sys/contrib/dev/acpica/psopcode.c index 4177f12..a9fc46a 100644 --- a/sys/contrib/dev/acpica/psopcode.c +++ b/sys/contrib/dev/acpica/psopcode.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: psopcode - Parser/Interpreter opcode information table - * $Revision: 43 $ + * $Revision: 49 $ * *****************************************************************************/ @@ -540,143 +540,143 @@ static const ACPI_OPCODE_INFO AmlOpInfo[] = { -/* Index Name Parser Args Interpreter Args Flags */ - -/* 00 */ ACPI_OP ("Zero", ARGP_ZERO_OP, ARGI_ZERO_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONSTANT| AML_NO_ARGS ), -/* 01 */ ACPI_OP ("One", ARGP_ONE_OP, ARGI_ONE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONSTANT| AML_NO_ARGS ), -/* 02 */ ACPI_OP ("Alias", ARGP_ALIAS_OP, ARGI_ALIAS_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED), -/* 03 */ ACPI_OP ("Name", ARGP_NAME_OP, ARGI_NAME_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED), -/* 04 */ ACPI_OP ("ByteConst", ARGP_BYTE_OP, ARGI_BYTE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_LITERAL| AML_NO_ARGS ), -/* 05 */ ACPI_OP ("WordConst", ARGP_WORD_OP, ARGI_WORD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_LITERAL| AML_NO_ARGS ), -/* 06 */ ACPI_OP ("DwordConst", ARGP_DWORD_OP, ARGI_DWORD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_LITERAL| AML_NO_ARGS ), -/* 07 */ ACPI_OP ("String", ARGP_STRING_OP, ARGI_STRING_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_LITERAL| AML_NO_ARGS ), -/* 08 */ ACPI_OP ("Scope", ARGP_SCOPE_OP, ARGI_SCOPE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED), -/* 09 */ ACPI_OP ("Buffer", ARGP_BUFFER_OP, ARGI_BUFFER_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DATA_TERM| AML_HAS_ARGS), -/* 0A */ ACPI_OP ("Package", ARGP_PACKAGE_OP, ARGI_PACKAGE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DATA_TERM| AML_HAS_ARGS), -/* 0B */ ACPI_OP ("Method", ARGP_METHOD_OP, ARGI_METHOD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED|AML_DEFER), -/* 0C */ ACPI_OP ("Local0", ARGP_LOCAL0, ARGI_LOCAL0, ACPI_OP_TYPE_OPCODE | OPTYPE_LOCAL_VARIABLE| AML_NO_ARGS ), -/* 0D */ ACPI_OP ("Local1", ARGP_LOCAL1, ARGI_LOCAL1, ACPI_OP_TYPE_OPCODE | OPTYPE_LOCAL_VARIABLE| AML_NO_ARGS ), -/* 0E */ ACPI_OP ("Local2", ARGP_LOCAL2, ARGI_LOCAL2, ACPI_OP_TYPE_OPCODE | OPTYPE_LOCAL_VARIABLE| AML_NO_ARGS ), -/* 0F */ ACPI_OP ("Local3", ARGP_LOCAL3, ARGI_LOCAL3, ACPI_OP_TYPE_OPCODE | OPTYPE_LOCAL_VARIABLE| AML_NO_ARGS ), -/* 10 */ ACPI_OP ("Local4", ARGP_LOCAL4, ARGI_LOCAL4, ACPI_OP_TYPE_OPCODE | OPTYPE_LOCAL_VARIABLE| AML_NO_ARGS ), -/* 11 */ ACPI_OP ("Local5", ARGP_LOCAL5, ARGI_LOCAL5, ACPI_OP_TYPE_OPCODE | OPTYPE_LOCAL_VARIABLE| AML_NO_ARGS ), -/* 12 */ ACPI_OP ("Local6", ARGP_LOCAL6, ARGI_LOCAL6, ACPI_OP_TYPE_OPCODE | OPTYPE_LOCAL_VARIABLE| AML_NO_ARGS ), -/* 13 */ ACPI_OP ("Local7", ARGP_LOCAL7, ARGI_LOCAL7, ACPI_OP_TYPE_OPCODE | OPTYPE_LOCAL_VARIABLE| AML_NO_ARGS ), -/* 14 */ ACPI_OP ("Arg0", ARGP_ARG0, ARGI_ARG0, ACPI_OP_TYPE_OPCODE | OPTYPE_METHOD_ARGUMENT| AML_NO_ARGS ), -/* 15 */ ACPI_OP ("Arg1", ARGP_ARG1, ARGI_ARG1, ACPI_OP_TYPE_OPCODE | OPTYPE_METHOD_ARGUMENT| AML_NO_ARGS ), -/* 16 */ ACPI_OP ("Arg2", ARGP_ARG2, ARGI_ARG2, ACPI_OP_TYPE_OPCODE | OPTYPE_METHOD_ARGUMENT| AML_NO_ARGS ), -/* 17 */ ACPI_OP ("Arg3", ARGP_ARG3, ARGI_ARG3, ACPI_OP_TYPE_OPCODE | OPTYPE_METHOD_ARGUMENT| AML_NO_ARGS ), -/* 18 */ ACPI_OP ("Arg4", ARGP_ARG4, ARGI_ARG4, ACPI_OP_TYPE_OPCODE | OPTYPE_METHOD_ARGUMENT| AML_NO_ARGS ), -/* 19 */ ACPI_OP ("Arg5", ARGP_ARG5, ARGI_ARG5, ACPI_OP_TYPE_OPCODE | OPTYPE_METHOD_ARGUMENT| AML_NO_ARGS ), -/* 1A */ ACPI_OP ("Arg6", ARGP_ARG6, ARGI_ARG6, ACPI_OP_TYPE_OPCODE | OPTYPE_METHOD_ARGUMENT| AML_NO_ARGS ), -/* 1B */ ACPI_OP ("Store", ARGP_STORE_OP, ARGI_STORE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS), -/* 1C */ ACPI_OP ("RefOf", ARGP_REF_OF_OP, ARGI_REF_OF_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2| AML_HAS_ARGS), -/* 1D */ ACPI_OP ("Add", ARGP_ADD_OP, ARGI_ADD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2R| AML_HAS_ARGS), -/* 1E */ ACPI_OP ("Concatenate", ARGP_CONCAT_OP, ARGI_CONCAT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2R| AML_HAS_ARGS), -/* 1F */ ACPI_OP ("Subtract", ARGP_SUBTRACT_OP, ARGI_SUBTRACT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2R| AML_HAS_ARGS), -/* 20 */ ACPI_OP ("Increment", ARGP_INCREMENT_OP, ARGI_INCREMENT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2| AML_HAS_ARGS), -/* 21 */ ACPI_OP ("Decrement", ARGP_DECREMENT_OP, ARGI_DECREMENT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2| AML_HAS_ARGS), -/* 22 */ ACPI_OP ("Multiply", ARGP_MULTIPLY_OP, ARGI_MULTIPLY_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2R| AML_HAS_ARGS), -/* 23 */ ACPI_OP ("Divide", ARGP_DIVIDE_OP, ARGI_DIVIDE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2R| AML_HAS_ARGS), -/* 24 */ ACPI_OP ("ShiftLeft", ARGP_SHIFT_LEFT_OP, ARGI_SHIFT_LEFT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2R| AML_HAS_ARGS), -/* 25 */ ACPI_OP ("ShiftRight", ARGP_SHIFT_RIGHT_OP, ARGI_SHIFT_RIGHT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2R| AML_HAS_ARGS), -/* 26 */ ACPI_OP ("And", ARGP_BIT_AND_OP, ARGI_BIT_AND_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2R| AML_HAS_ARGS), -/* 27 */ ACPI_OP ("NAnd", ARGP_BIT_NAND_OP, ARGI_BIT_NAND_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2R| AML_HAS_ARGS), -/* 28 */ ACPI_OP ("Or", ARGP_BIT_OR_OP, ARGI_BIT_OR_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2R| AML_HAS_ARGS), -/* 29 */ ACPI_OP ("NOr", ARGP_BIT_NOR_OP, ARGI_BIT_NOR_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2R| AML_HAS_ARGS), -/* 2A */ ACPI_OP ("XOr", ARGP_BIT_XOR_OP, ARGI_BIT_XOR_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2R| AML_HAS_ARGS), -/* 2B */ ACPI_OP ("Not", ARGP_BIT_NOT_OP, ARGI_BIT_NOT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS), -/* 2C */ ACPI_OP ("FindSetLeftBit", ARGP_FIND_SET_LEFT_BIT_OP, ARGI_FIND_SET_LEFT_BIT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS), -/* 2D */ ACPI_OP ("FindSetRightBit", ARGP_FIND_SET_RIGHT_BIT_OP,ARGI_FIND_SET_RIGHT_BIT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS), -/* 2E */ ACPI_OP ("DerefOf", ARGP_DEREF_OF_OP, ARGI_DEREF_OF_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2| AML_HAS_ARGS), -/* 2F */ ACPI_OP ("Notify", ARGP_NOTIFY_OP, ARGI_NOTIFY_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC1| AML_HAS_ARGS), -/* 30 */ ACPI_OP ("SizeOf", ARGP_SIZE_OF_OP, ARGI_SIZE_OF_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2| AML_HAS_ARGS), -/* 31 */ ACPI_OP ("Index", ARGP_INDEX_OP, ARGI_INDEX_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_TRIADIC| AML_HAS_ARGS), -/* 32 */ ACPI_OP ("Match", ARGP_MATCH_OP, ARGI_MATCH_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_HEXADIC| AML_HAS_ARGS), -/* 33 */ ACPI_OP ("CreateDWordField", ARGP_CREATE_DWORD_FIELD_OP,ARGI_CREATE_DWORD_FIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_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_OP_TYPE_OPCODE | OPTYPE_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_OP_TYPE_OPCODE | OPTYPE_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_OP_TYPE_OPCODE | OPTYPE_CREATE_FIELD| AML_HAS_ARGS|AML_NSOBJECT|AML_NSNODE|AML_DEFER|AML_CREATE), -/* 37 */ ACPI_OP ("ObjectType", ARGP_TYPE_OP, ARGI_TYPE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2| AML_HAS_ARGS), -/* 38 */ ACPI_OP ("LAnd", ARGP_LAND_OP, ARGI_LAND_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2| AML_HAS_ARGS), -/* 39 */ ACPI_OP ("LOr", ARGP_LOR_OP, ARGI_LOR_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2| AML_HAS_ARGS), -/* 3A */ ACPI_OP ("LNot", ARGP_LNOT_OP, ARGI_LNOT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2| AML_HAS_ARGS), -/* 3B */ ACPI_OP ("LEqual", ARGP_LEQUAL_OP, ARGI_LEQUAL_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2| AML_HAS_ARGS), -/* 3C */ ACPI_OP ("LGreater", ARGP_LGREATER_OP, ARGI_LGREATER_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2| AML_HAS_ARGS), -/* 3D */ ACPI_OP ("LLess", ARGP_LLESS_OP, ARGI_LLESS_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2| AML_HAS_ARGS), -/* 3E */ ACPI_OP ("If", ARGP_IF_OP, ARGI_IF_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONTROL| AML_HAS_ARGS), -/* 3F */ ACPI_OP ("Else", ARGP_ELSE_OP, ARGI_ELSE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONTROL| AML_HAS_ARGS), -/* 40 */ ACPI_OP ("While", ARGP_WHILE_OP, ARGI_WHILE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONTROL| AML_HAS_ARGS), -/* 41 */ ACPI_OP ("Noop", ARGP_NOOP_OP, ARGI_NOOP_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONTROL| AML_NO_ARGS ), -/* 42 */ ACPI_OP ("Return", ARGP_RETURN_OP, ARGI_RETURN_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONTROL| AML_HAS_ARGS), -/* 43 */ ACPI_OP ("Break", ARGP_BREAK_OP, ARGI_BREAK_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONTROL| AML_NO_ARGS ), -/* 44 */ ACPI_OP ("BreakPoint", ARGP_BREAK_POINT_OP, ARGI_BREAK_POINT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONTROL| AML_NO_ARGS ), -/* 45 */ ACPI_OP ("Ones", ARGP_ONES_OP, ARGI_ONES_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONSTANT| AML_NO_ARGS ), +/* 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), /* Prefixed opcodes (Two-byte opcodes with a prefix op) */ -/* 46 */ ACPI_OP ("Mutex", ARGP_MUTEX_OP, ARGI_MUTEX_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED), -/* 47 */ ACPI_OP ("Event", ARGP_EVENT_OP, ARGI_EVENT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_NO_ARGS |AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED ), -/* 48 */ ACPI_OP ("CondRefOf", ARGP_COND_REF_OF_OP, ARGI_COND_REF_OF_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS), -/* 49 */ ACPI_OP ("CreateField", ARGP_CREATE_FIELD_OP, ARGI_CREATE_FIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_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_OP_TYPE_OPCODE | OPTYPE_RECONFIGURATION| AML_HAS_ARGS), -/* 4B */ ACPI_OP ("Stall", ARGP_STALL_OP, ARGI_STALL_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC1| AML_HAS_ARGS), -/* 4C */ ACPI_OP ("Sleep", ARGP_SLEEP_OP, ARGI_SLEEP_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC1| AML_HAS_ARGS), -/* 4D */ ACPI_OP ("Acquire", ARGP_ACQUIRE_OP, ARGI_ACQUIRE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2S| AML_HAS_ARGS), -/* 4E */ ACPI_OP ("Signal", ARGP_SIGNAL_OP, ARGI_SIGNAL_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC1| AML_HAS_ARGS), -/* 4F */ ACPI_OP ("Wait", ARGP_WAIT_OP, ARGI_WAIT_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2S| AML_HAS_ARGS), -/* 50 */ ACPI_OP ("Reset", ARGP_RESET_OP, ARGI_RESET_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC1| AML_HAS_ARGS), -/* 51 */ ACPI_OP ("Release", ARGP_RELEASE_OP, ARGI_RELEASE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC1| AML_HAS_ARGS), -/* 52 */ ACPI_OP ("FromBCD", ARGP_FROM_BCD_OP, ARGI_FROM_BCD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS), -/* 53 */ ACPI_OP ("ToBCD", ARGP_TO_BCD_OP, ARGI_TO_BCD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS), -/* 54 */ ACPI_OP ("Unload", ARGP_UNLOAD_OP, ARGI_UNLOAD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_RECONFIGURATION| AML_HAS_ARGS), -/* 55 */ ACPI_OP ("Revision", ARGP_REVISION_OP, ARGI_REVISION_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONSTANT| AML_NO_ARGS ), -/* 56 */ ACPI_OP ("Debug", ARGP_DEBUG_OP, ARGI_DEBUG_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONSTANT| AML_NO_ARGS ), -/* 57 */ ACPI_OP ("Fatal", ARGP_FATAL_OP, ARGI_FATAL_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_TRIADIC| AML_HAS_ARGS), -/* 58 */ ACPI_OP ("OpRegion", ARGP_REGION_OP, ARGI_REGION_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED|AML_DEFER), -/* 59 */ ACPI_OP ("Field", ARGP_FIELD_OP, ARGI_FIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_FIELD), -/* 5A */ ACPI_OP ("Device", ARGP_DEVICE_OP, ARGI_DEVICE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED), -/* 5B */ ACPI_OP ("Processor", ARGP_PROCESSOR_OP, ARGI_PROCESSOR_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED), -/* 5C */ ACPI_OP ("PowerResource", ARGP_POWER_RES_OP, ARGI_POWER_RES_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED), -/* 5D */ ACPI_OP ("ThermalZone", ARGP_THERMAL_ZONE_OP, ARGI_THERMAL_ZONE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED), -/* 5E */ ACPI_OP ("IndexField", ARGP_INDEX_FIELD_OP, ARGI_INDEX_FIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_FIELD), -/* 5F */ ACPI_OP ("BankField", ARGP_BANK_FIELD_OP, ARGI_BANK_FIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_NAMED_OBJECT| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_FIELD), +/* 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), /* Internal opcodes that map to invalid AML opcodes */ -/* 60 */ ACPI_OP ("LNotEqual", ARGP_LNOTEQUAL_OP, ARGI_LNOTEQUAL_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_BOGUS| AML_HAS_ARGS), -/* 61 */ ACPI_OP ("LLessEqual", ARGP_LLESSEQUAL_OP, ARGI_LLESSEQUAL_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_BOGUS| AML_HAS_ARGS), -/* 62 */ ACPI_OP ("LGreaterEqual", ARGP_LGREATEREQUAL_OP, ARGI_LGREATEREQUAL_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_BOGUS| AML_HAS_ARGS), -/* 63 */ ACPI_OP ("[NamePath]", ARGP_NAMEPATH_OP, ARGI_NAMEPATH_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_LITERAL| AML_NO_ARGS|AML_NSOBJECT|AML_NSNODE ), -/* 64 */ ACPI_OP ("[MethodCall]", ARGP_METHODCALL_OP, ARGI_METHODCALL_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_METHOD_CALL| AML_HAS_ARGS|AML_NSOBJECT|AML_NSNODE), -/* 65 */ ACPI_OP ("[ByteList]", ARGP_BYTELIST_OP, ARGI_BYTELIST_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_LITERAL| AML_NO_ARGS ), -/* 66 */ ACPI_OP ("[ReservedField]", ARGP_RESERVEDFIELD_OP, ARGI_RESERVEDFIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_BOGUS| AML_NO_ARGS ), -/* 67 */ ACPI_OP ("[NamedField]", ARGP_NAMEDFIELD_OP, ARGI_NAMEDFIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_BOGUS| AML_NO_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED ), -/* 68 */ ACPI_OP ("[AccessField]", ARGP_ACCESSFIELD_OP, ARGI_ACCESSFIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_BOGUS| AML_NO_ARGS ), -/* 69 */ ACPI_OP ("[StaticString", ARGP_STATICSTRING_OP, ARGI_STATICSTRING_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_BOGUS| AML_NO_ARGS ), -/* 6A */ ACPI_OP ("[Return Value]", ARG_NONE, ARG_NONE, ACPI_OP_TYPE_OPCODE | OPTYPE_RETURN| AML_HAS_ARGS), -/* 6B */ ACPI_OP ("UNKNOWN_OP!", ARG_NONE, ARG_NONE, ACPI_OP_TYPE_UNKNOWN | OPTYPE_BOGUS| AML_HAS_ARGS), -/* 6C */ ACPI_OP ("ASCII_ONLY!", ARG_NONE, ARG_NONE, ACPI_OP_TYPE_ASCII | OPTYPE_BOGUS| AML_HAS_ARGS), -/* 6D */ ACPI_OP ("PREFIX_ONLY!", ARG_NONE, ARG_NONE, ACPI_OP_TYPE_PREFIX | OPTYPE_BOGUS| AML_HAS_ARGS), - - -/* ACPI 2.0 (new) opcodes */ - -/* 6E */ ACPI_OP ("QwordConst", ARGP_QWORD_OP, ARGI_QWORD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_LITERAL| AML_NO_ARGS ), -/* 6F */ ACPI_OP ("VarPackage", ARGP_VAR_PACKAGE_OP, ARGI_VAR_PACKAGE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DATA_TERM| AML_HAS_ARGS|AML_DEFER), -/* 70 */ ACPI_OP ("ConcatRes", ARGP_CONCAT_RES_OP, ARGI_CONCAT_RES_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2R| AML_HAS_ARGS), -/* 71 */ ACPI_OP ("Mod", ARGP_MOD_OP, ARGI_MOD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2R| AML_HAS_ARGS), -/* 72 */ ACPI_OP ("CreateQWordField", ARGP_CREATE_QWORD_FIELD_OP,ARGI_CREATE_QWORD_FIELD_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_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_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS), -/* 74 */ ACPI_OP ("ToDecimalString", ARGP_TO_DEC_STR_OP, ARGI_TO_DEC_STR_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS), -/* 75 */ ACPI_OP ("ToHexString", ARGP_TO_HEX_STR_OP, ARGI_TO_HEX_STR_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS), -/* 76 */ ACPI_OP ("ToInteger", ARGP_TO_INTEGER_OP, ARGI_TO_INTEGER_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS), -/* 77 */ ACPI_OP ("ToString", ARGP_TO_STRING_OP, ARGI_TO_STRING_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_DYADIC2R| AML_HAS_ARGS), -/* 78 */ ACPI_OP ("CopyObject", ARGP_COPY_OP, ARGI_COPY_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS), -/* 79 */ ACPI_OP ("Mid", ARGP_MID_OP, ARGI_MID_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS), -/* 7A */ ACPI_OP ("Continue", ARGP_CONTINUE_OP, ARGI_CONTINUE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_CONTROL| AML_NO_ARGS ), -/* 7B */ ACPI_OP ("LoadTable", ARGP_LOAD_TABLE_OP, ARGI_LOAD_TABLE_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS), -/* 7C */ ACPI_OP ("DataOpRegion", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, ACPI_OP_TYPE_OPCODE | OPTYPE_MONADIC2R| AML_HAS_ARGS|AML_NSOBJECT|AML_NSOPCODE|AML_NSNODE|AML_NAMED), +/* 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), + + +/* 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), }; diff --git a/sys/contrib/dev/acpica/pstree.c b/sys/contrib/dev/acpica/pstree.c index a0e8c28..c7580c9 100644 --- a/sys/contrib/dev/acpica/pstree.c +++ b/sys/contrib/dev/acpica/pstree.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: pstree - Parser op tree manipulation/traversal/search - * $Revision: 33 $ + * $Revision: 35 $ * *****************************************************************************/ @@ -153,7 +153,7 @@ AcpiPsGetArg ( /* Get the info structure for this opcode */ OpInfo = AcpiPsGetOpcodeInfo (Op->Opcode); - if (ACPI_GET_OP_TYPE (OpInfo) != ACPI_OP_TYPE_OPCODE) + if (OpInfo->Class == AML_CLASS_UNKNOWN) { /* Invalid opcode or ASCII character */ @@ -162,7 +162,7 @@ AcpiPsGetArg ( /* Check if this opcode requires argument sub-objects */ - if (!(ACPI_GET_OP_ARGS (OpInfo))) + if (!(OpInfo->Flags & AML_HAS_ARGS)) { /* Has no linked argument objects */ @@ -215,7 +215,7 @@ AcpiPsAppendArg ( /* Get the info structure for this opcode */ OpInfo = AcpiPsGetOpcodeInfo (Op->Opcode); - if (ACPI_GET_OP_TYPE (OpInfo) != ACPI_OP_TYPE_OPCODE) + if (OpInfo->Class == AML_CLASS_UNKNOWN) { /* Invalid opcode */ @@ -225,7 +225,7 @@ AcpiPsAppendArg ( /* Check if this opcode requires argument sub-objects */ - if (!(ACPI_GET_OP_ARGS (OpInfo))) + if (!(OpInfo->Flags & AML_HAS_ARGS)) { /* Has no linked argument objects */ diff --git a/sys/contrib/dev/acpica/psxface.c b/sys/contrib/dev/acpica/psxface.c index e91f0c7..08b4178 100644 --- a/sys/contrib/dev/acpica/psxface.c +++ b/sys/contrib/dev/acpica/psxface.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: psxface - Parser external interfaces - * $Revision: 51 $ + * $Revision: 52 $ * *****************************************************************************/ @@ -301,7 +301,7 @@ AcpiPsxExecute ( */ if (*ReturnObjDesc) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Method returned ObjDesc=%X\n", + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Method returned ObjDesc=%p\n", *ReturnObjDesc)); DUMP_STACK_ENTRY (*ReturnObjDesc); diff --git a/sys/contrib/dev/acpica/rsutils.c b/sys/contrib/dev/acpica/rsutils.c index ffd6a59..cbe498d 100644 --- a/sys/contrib/dev/acpica/rsutils.c +++ b/sys/contrib/dev/acpica/rsutils.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: rsutils - Utilities for the resource manager - * $Revision: 22 $ + * $Revision: 23 $ * ******************************************************************************/ @@ -490,7 +490,6 @@ AcpiRsSetSrsMethodData ( */ Cleanup: - ACPI_MEM_FREE (ByteStream); return_ACPI_STATUS (Status); } diff --git a/sys/contrib/dev/acpica/tbconvrt.c b/sys/contrib/dev/acpica/tbconvrt.c index 84fa106..3f6a1ea 100644 --- a/sys/contrib/dev/acpica/tbconvrt.c +++ b/sys/contrib/dev/acpica/tbconvrt.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: tbconvrt - ACPI Table conversion utilities - * $Revision: 27 $ + * $Revision: 28 $ * *****************************************************************************/ @@ -576,7 +576,7 @@ AcpiTbConvertTableFadt (void) /* Dump the entire FADT */ ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, - "Hex dump of common internal FADT, size %ld (%lX)\n", + "Hex dump of common internal FADT, size %d (%X)\n", AcpiGbl_FADT->header.Length, AcpiGbl_FADT->header.Length)); DUMP_BUFFER ((UINT8 *) (AcpiGbl_FADT), AcpiGbl_FADT->header.Length); diff --git a/sys/contrib/dev/acpica/tbget.c b/sys/contrib/dev/acpica/tbget.c index 0d186df..e30e4bd 100644 --- a/sys/contrib/dev/acpica/tbget.c +++ b/sys/contrib/dev/acpica/tbget.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: tbget - ACPI Table get* routines - * $Revision: 55 $ + * $Revision: 56 $ * *****************************************************************************/ @@ -741,7 +741,7 @@ AcpiTbGetTableRsdt ( * Get the RSDT from the RSDP */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "RSDP located at %p, RSDT physical=%8.8lX%8.8lX \n", + "RSDP located at %p, RSDT physical=%8.8X%8.8X \n", AcpiGbl_RSDP, HIDWORD(AcpiGbl_RSDP->RsdtPhysicalAddress), LODWORD(AcpiGbl_RSDP->RsdtPhysicalAddress))); diff --git a/sys/contrib/dev/acpica/tbinstal.c b/sys/contrib/dev/acpica/tbinstal.c index a83464c..8e7ffdb 100644 --- a/sys/contrib/dev/acpica/tbinstal.c +++ b/sys/contrib/dev/acpica/tbinstal.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: tbinstal - ACPI table installation and removal - * $Revision: 44 $ + * $Revision: 45 $ * *****************************************************************************/ @@ -239,7 +239,7 @@ AcpiTbRecognizeTable ( Status = AcpiGbl_AcpiTableData[i].Status; ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Found %4.4s\n", - AcpiGbl_AcpiTableData[i].Signature)); + (char*)AcpiGbl_AcpiTableData[i].Signature)); break; } } diff --git a/sys/contrib/dev/acpica/tbutils.c b/sys/contrib/dev/acpica/tbutils.c index 50dc4f2..4e47623 100644 --- a/sys/contrib/dev/acpica/tbutils.c +++ b/sys/contrib/dev/acpica/tbutils.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: tbutils - Table manipulation utilities - * $Revision: 40 $ + * $Revision: 42 $ * *****************************************************************************/ @@ -299,10 +299,10 @@ AcpiTbValidateTableHeader ( if (!AcpiUtValidAcpiName (Signature)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Table signature at %p [%X] has invalid characters\n", + "Table signature at %p [%p] has invalid characters\n", TableHeader, &Signature)); - REPORT_WARNING (("Invalid table signature %4.4s found\n", &Signature)); + REPORT_WARNING (("Invalid table signature %4.4s found\n", (char*)&Signature)); DUMP_BUFFER (TableHeader, sizeof (ACPI_TABLE_HEADER)); return (AE_BAD_SIGNATURE); } @@ -314,7 +314,7 @@ AcpiTbValidateTableHeader ( { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid length in table header %p name %4.4s\n", - TableHeader, &Signature)); + TableHeader, (char*)&Signature)); REPORT_WARNING (("Invalid table header length found\n")); DUMP_BUFFER (TableHeader, sizeof (ACPI_TABLE_HEADER)); @@ -443,7 +443,7 @@ AcpiTbVerifyTableChecksum ( if (Checksum) { REPORT_WARNING (("Invalid checksum (%X) in table %4.4s\n", - Checksum, &TableHeader->Signature)); + Checksum, (char*)&TableHeader->Signature)); Status = AE_BAD_CHECKSUM; } diff --git a/sys/contrib/dev/acpica/tbxfroot.c b/sys/contrib/dev/acpica/tbxfroot.c index 228d3a7..e9a3e84 100644 --- a/sys/contrib/dev/acpica/tbxfroot.c +++ b/sys/contrib/dev/acpica/tbxfroot.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: tbxfroot - Find the root ACPI table (RSDT) - * $Revision: 51 $ + * $Revision: 52 $ * *****************************************************************************/ @@ -457,7 +457,7 @@ AcpiGetFirmwareTable ( ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "RSDP located at %p, RSDT physical=%8.8lX%8.8lX \n", + "RSDP located at %p, RSDT physical=%8.8X%8.8X \n", AcpiGbl_RSDP, HIDWORD(AcpiGbl_RSDP->RsdtPhysicalAddress), LODWORD(AcpiGbl_RSDP->RsdtPhysicalAddress))); diff --git a/sys/contrib/dev/acpica/utalloc.c b/sys/contrib/dev/acpica/utalloc.c index 0af4296..7b1bc43 100644 --- a/sys/contrib/dev/acpica/utalloc.c +++ b/sys/contrib/dev/acpica/utalloc.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: utalloc - local cache and memory allocation routines - * $Revision: 103 $ + * $Revision: 106 $ * *****************************************************************************/ @@ -621,7 +621,7 @@ AcpiUtDumpAllocations ( if (((ACPI_OPERAND_OBJECT *)(&Element->UserSpace))->Common.Type != ACPI_CACHED_OBJECT) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - "%p Len %04lX %9.9s-%ld", + "%p Len %04X %9.9s-%d", &Element->UserSpace, Element->Size, Element->Module, Element->Line)); @@ -632,8 +632,9 @@ AcpiUtDumpAllocations ( { case ACPI_DESC_TYPE_INTERNAL: ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, - " ObjType %s", - AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT *)(&Element->UserSpace))->Common.Type))); + " ObjType %12.12s R%d", + AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT *)(&Element->UserSpace))->Common.Type), + ((ACPI_OPERAND_OBJECT *)(&Element->UserSpace))->Common.ReferenceCount)); break; case ACPI_DESC_TYPE_PARSER: @@ -645,7 +646,7 @@ AcpiUtDumpAllocations ( case ACPI_DESC_TYPE_NAMED: ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, " Node %4.4s", - &((ACPI_NAMESPACE_NODE *)(&Element->UserSpace))->Name)); + (char*)&((ACPI_NAMESPACE_NODE *)(&Element->UserSpace))->Name)); break; case ACPI_DESC_TYPE_STATE: diff --git a/sys/contrib/dev/acpica/utcopy.c b/sys/contrib/dev/acpica/utcopy.c index 129e2b7..821f0ab 100644 --- a/sys/contrib/dev/acpica/utcopy.c +++ b/sys/contrib/dev/acpica/utcopy.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: utcopy - Internal to external object translation utilities - * $Revision: 82 $ + * $Revision: 83 $ * *****************************************************************************/ @@ -230,7 +230,7 @@ AcpiUtCopyIsimpleToEsimple ( case AML_REVISION_OP: ExternalObject->Type = ACPI_TYPE_INTEGER; - ExternalObject->Integer.Value = ACPI_CA_VERSION; + ExternalObject->Integer.Value = ACPI_CA_SUPPORT_LEVEL; break; case AML_INT_NAMEPATH_OP: diff --git a/sys/contrib/dev/acpica/utdebug.c b/sys/contrib/dev/acpica/utdebug.c index 2b7e562..b6193a0 100644 --- a/sys/contrib/dev/acpica/utdebug.c +++ b/sys/contrib/dev/acpica/utdebug.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: utdebug - Debug print routines - * $Revision: 89 $ + * $Revision: 90 $ * *****************************************************************************/ @@ -533,7 +533,7 @@ AcpiUtValueExit ( { AcpiUtDebugPrint (ACPI_LV_FUNCTIONS, LineNumber, DbgInfo, - "%s %08X\n", AcpiGbl_FnExitStr, Value); + "%s %8.8X%8.8X\n", AcpiGbl_FnExitStr, HIDWORD(Value), LODWORD(Value)); AcpiGbl_NestingLevel--; } diff --git a/sys/contrib/dev/acpica/utdelete.c b/sys/contrib/dev/acpica/utdelete.c index 3dcb20c..0c741d8 100644 --- a/sys/contrib/dev/acpica/utdelete.c +++ b/sys/contrib/dev/acpica/utdelete.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: utdelete - object deletion and reference count utilities - * $Revision: 78 $ + * $Revision: 81 $ * ******************************************************************************/ @@ -283,15 +283,10 @@ AcpiUtDeleteInternalObj ( */ if (ObjPointer) { - if (!AcpiTbSystemTablePointer (ObjPointer)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting Obj Ptr %p \n", ObjPointer)); - - ACPI_MEM_FREE (ObjPointer); - } + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Deleting Obj Ptr %p \n", ObjPointer)); + ACPI_MEM_FREE (ObjPointer); } - /* Only delete the object if it was dynamically allocated */ if (Object->Common.Flags & AOPOBJ_STATIC_ALLOCATION) @@ -521,14 +516,6 @@ AcpiUtUpdateObjectReference ( return_ACPI_STATUS (AE_OK); } - if (AcpiTbSystemTablePointer (Object)) - { - ACPI_DEBUG_PRINT ( - (ACPI_DB_INFO, "**** Object %p points into an ACPI table\n", - Object)); - return_ACPI_STATUS (AE_OK); - } - State = AcpiUtCreateUpdateState (Object, Action); @@ -657,24 +644,9 @@ AcpiUtUpdateObjectReference ( case ACPI_TYPE_REGION: - - /* TBD: [Investigate] - AcpiUtUpdateRefCount (Object->Region.AddrHandler, Action); - */ -/* - Status = - AcpiUtCreateUpdateStateAndPush (Object->Region.AddrHandler, - Action, &StateList); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } -*/ - break; - - case INTERNAL_TYPE_REFERENCE: + /* No subobjects */ break; } @@ -754,6 +726,17 @@ AcpiUtRemoveReference ( FUNCTION_TRACE_PTR ("UtRemoveReference", Object); + /* + * Allow a NULL pointer to be passed in, just ignore it. This saves + * each caller from having to check. Also, ignore NS nodes. + * + */ + if (!Object || + (VALID_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_NAMED))) + + { + return_VOID; + } /* * Ensure that we have a valid object diff --git a/sys/contrib/dev/acpica/uteval.c b/sys/contrib/dev/acpica/uteval.c index 67a8427..463c4f7 100644 --- a/sys/contrib/dev/acpica/uteval.c +++ b/sys/contrib/dev/acpica/uteval.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: uteval - Object evaluation - * $Revision: 30 $ + * $Revision: 31 $ * *****************************************************************************/ @@ -163,12 +163,12 @@ AcpiUtEvaluateNumericObject ( if (Status == AE_NOT_FOUND) { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s on %4.4s was not found\n", - ObjectName, &DeviceNode->Name)); + ObjectName, (char*)&DeviceNode->Name)); } else { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s on %4.4s failed with status %s\n", - ObjectName, &DeviceNode->Name, + ObjectName, (char*)&DeviceNode->Name, AcpiFormatException (Status))); } @@ -248,13 +248,13 @@ AcpiUtExecute_HID ( if (Status == AE_NOT_FOUND) { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "_HID on %4.4s was not found\n", - &DeviceNode->Name)); + (char*)&DeviceNode->Name)); } else { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "_HID on %4.4s failed %s\n", - &DeviceNode->Name, AcpiFormatException (Status))); + (char*)&DeviceNode->Name, AcpiFormatException (Status))); } return_ACPI_STATUS (Status); @@ -344,14 +344,14 @@ AcpiUtExecute_UID ( if (Status == AE_NOT_FOUND) { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "_UID on %4.4s was not found\n", - &DeviceNode->Name)); + (char*)&DeviceNode->Name)); } else { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "_UID on %4.4s failed %s\n", - &DeviceNode->Name, AcpiFormatException (Status))); + (char*)&DeviceNode->Name, AcpiFormatException (Status))); } return (Status); @@ -440,7 +440,7 @@ AcpiUtExecute_STA ( { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "_STA on %4.4s was not found, assuming present.\n", - &DeviceNode->Name)); + (char*)&DeviceNode->Name)); *Flags = 0x0F; Status = AE_OK; @@ -449,7 +449,7 @@ AcpiUtExecute_STA ( else if (ACPI_FAILURE (Status)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "_STA on %4.4s failed %s\n", - &DeviceNode->Name, + (char*)&DeviceNode->Name, AcpiFormatException (Status))); } diff --git a/sys/contrib/dev/acpica/utglobal.c b/sys/contrib/dev/acpica/utglobal.c index 44f6f36..bb71d87 100644 --- a/sys/contrib/dev/acpica/utglobal.c +++ b/sys/contrib/dev/acpica/utglobal.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: utglobal - Global variables for the ACPI subsystem - * $Revision: 131 $ + * $Revision: 133 $ * *****************************************************************************/ @@ -430,7 +430,7 @@ AcpiUtGetMutexName ( */ static const NATIVE_CHAR AcpiGbl_BadType[] = "UNDEFINED"; -#define TYPE_NAME_LENGTH 9 /* Maximum length of each string */ +#define TYPE_NAME_LENGTH 12 /* Maximum length of each string */ static const NATIVE_CHAR *AcpiGbl_NsTypeNames[] = /* printable names of ACPI types */ { @@ -448,21 +448,21 @@ static const NATIVE_CHAR *AcpiGbl_NsTypeNames[] = /* printable names of AC /* 11 */ "Power", /* 12 */ "Processor", /* 13 */ "Thermal", - /* 14 */ "BuffField", + /* 14 */ "BufferField", /* 15 */ "DdbHandle", - /* 16 */ "DebugObj", - /* 17 */ "RegnField", + /* 16 */ "DebugObject", + /* 17 */ "RegionField", /* 18 */ "BankField", - /* 19 */ "IndxField", + /* 19 */ "IndexField", /* 20 */ "Reference", /* 21 */ "Alias", /* 22 */ "Notify", - /* 23 */ "AddrHndlr", - /* 24 */ "RsrcDesc", - /* 25 */ "RsrcField", - /* 26 */ "RgnFldDfn", - /* 27 */ "BnkFldDfn", - /* 28 */ "IdxFldDfn", + /* 23 */ "AddrHandler", + /* 24 */ "ResourceDesc", + /* 25 */ "ResourceFld", + /* 26 */ "RegionFldDfn", + /* 27 */ "BankFldDfn", + /* 28 */ "IndexFldDfn", /* 29 */ "If", /* 30 */ "Else", /* 31 */ "While", diff --git a/sys/contrib/dev/acpica/utmath.c b/sys/contrib/dev/acpica/utmath.c index eb4fb07..f7bf84e 100644 --- a/sys/contrib/dev/acpica/utmath.c +++ b/sys/contrib/dev/acpica/utmath.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: utmath - Integer math support routines - * $Revision: 5 $ + * $Revision: 7 $ * ******************************************************************************/ @@ -167,6 +167,7 @@ AcpiUtShortDivide ( if (Divisor == 0) { + REPORT_ERROR (("AcpiUtShortDivide: Divide by zero\n")); return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO); } @@ -234,6 +235,7 @@ AcpiUtDivide ( if (*InDivisor == 0) { + REPORT_ERROR (("AcpiUtDivide: Divide by zero\n")); return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO); } @@ -370,6 +372,7 @@ AcpiUtShortDivide ( if (Divisor == 0) { + REPORT_ERROR (("AcpiUtShortDivide: Divide by zero\n")); return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO); } @@ -401,6 +404,7 @@ AcpiUtDivide ( if (*InDivisor == 0) { + REPORT_ERROR (("AcpiUtDivide: Divide by zero\n")); return_ACPI_STATUS (AE_AML_DIVIDE_BY_ZERO); } @@ -416,7 +420,7 @@ AcpiUtDivide ( *OutRemainder = *InDividend % *InDivisor; } - return_ACPI_STATUS (AE_OK) + return_ACPI_STATUS (AE_OK); } #endif diff --git a/sys/contrib/dev/acpica/utobject.c b/sys/contrib/dev/acpica/utobject.c index 19f0e6a..52979a3 100644 --- a/sys/contrib/dev/acpica/utobject.c +++ b/sys/contrib/dev/acpica/utobject.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: utobject - ACPI object create/delete/size/cache routines - * $Revision: 56 $ + * $Revision: 57 $ * *****************************************************************************/ @@ -213,16 +213,6 @@ AcpiUtValidInternalObject ( return (FALSE); } - /* Check for a pointer within one of the ACPI tables */ - - if (AcpiTbSystemTablePointer (Object)) - { - ACPI_DEBUG_PRINT ( - (ACPI_DB_INFO, "**** Object %p points into an ACPI table\n", - Object)); - return (FALSE); - } - /* Check the descriptor type field */ if (!VALID_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_INTERNAL)) |