Index: acconfig.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acconfig.h,v retrieving revision 1.21 diff -u -r1.21 acconfig.h --- acconfig.h 29 Aug 2002 01:52:25 -0000 1.21 +++ acconfig.h 5 Sep 2002 04:41:45 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acconfig.h - Global configuration constants - * $Revision: 109 $ + * $Revision: 110 $ * *****************************************************************************/ @@ -145,7 +145,7 @@ /* Version string */ -#define ACPI_CA_VERSION 0x20020815 +#define ACPI_CA_VERSION 0x20020829 /* Version of ACPI supported */ Index: acglobal.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acglobal.h,v retrieving revision 1.1.1.14 diff -u -r1.1.1.14 acglobal.h --- acglobal.h 29 Aug 2002 01:51:16 -0000 1.1.1.14 +++ acglobal.h 5 Sep 2002 04:41:45 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acglobal.h - Declarations for global variables - * $Revision: 130 $ + * $Revision: 131 $ * *****************************************************************************/ @@ -227,6 +227,7 @@ ACPI_EXTERN BOOLEAN AcpiGbl_StepToNextCall; ACPI_EXTERN BOOLEAN AcpiGbl_AcpiHardwarePresent; ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockPresent; +ACPI_EXTERN BOOLEAN AcpiGbl_EventsInitialized; extern BOOLEAN AcpiGbl_Shutdown; extern UINT32 AcpiGbl_StartupFlags; Index: aclocal.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/aclocal.h,v retrieving revision 1.1.1.19 diff -u -r1.1.1.19 aclocal.h --- aclocal.h 29 Aug 2002 01:51:16 -0000 1.1.1.19 +++ aclocal.h 5 Sep 2002 04:41:45 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: aclocal.h - Internal data types used across the ACPI subsystem - * $Revision: 175 $ + * $Revision: 176 $ * *****************************************************************************/ @@ -758,8 +758,8 @@ UINT32 AmlSubtreeLength; UINT32 FinalAmlLength; UINT32 FinalAmlOffset; + UINT32 CompileFlags; UINT16 ParseOpcode; - UINT16 CompileFlags; UINT8 AmlOpcodeLength; UINT8 AmlPkgLenBytes; UINT8 Extra; Index: acparser.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/acparser.h,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 acparser.h --- acparser.h 29 Aug 2002 01:51:17 -0000 1.1.1.10 +++ acparser.h 5 Sep 2002 04:41:45 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: acparser.h - AML Parser subcomponent prototypes and defines - * $Revision: 61 $ + * $Revision: 62 $ * *****************************************************************************/ @@ -135,6 +135,7 @@ #define ACPI_PARSE_EXECUTE 0x0030 #define ACPI_PARSE_MODE_MASK 0x0030 +#define ACPI_PARSE_DEFERRED_OP 0x0100 /* Parser external interfaces */ Index: actbl2.h =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/actbl2.h,v retrieving revision 1.1.1.5 diff -u -r1.1.1.5 actbl2.h --- actbl2.h 23 Feb 2002 05:10:35 -0000 1.1.1.5 +++ actbl2.h 5 Sep 2002 04:41:45 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: actbl2.h - ACPI Specification Revision 2.0 Tables - * $Revision: 27 $ + * $Revision: 28 $ * *****************************************************************************/ @@ -230,8 +230,8 @@ UINT16 Plvl3Lat; /* Worst case HW latency to enter/exit C3 state */ UINT16 FlushSize; /* Number of flush strides that need to be read */ UINT16 FlushStride; /* Processor's memory cache line width, in bytes */ - UINT8 DutyOffset; /* Processor’s duty cycle index in processor's P_CNT reg*/ - UINT8 DutyWidth; /* Processor’s duty cycle value bit width in P_CNT register.*/ + UINT8 DutyOffset; /* Processor's duty cycle index in processor's P_CNT reg*/ + UINT8 DutyWidth; /* Processor's duty cycle value bit width in P_CNT register.*/ UINT8 DayAlrm; /* Index to day-of-month alarm in RTC CMOS RAM */ UINT8 MonAlrm; /* Index to month-of-year alarm in RTC CMOS RAM */ UINT8 Century; /* Index to century in RTC CMOS RAM */ Index: dsopcode.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/dsopcode.c,v retrieving revision 1.1.1.17 diff -u -r1.1.1.17 dsopcode.c --- dsopcode.c 29 Aug 2002 01:51:18 -0000 1.1.1.17 +++ dsopcode.c 5 Sep 2002 04:41:45 -0000 @@ -2,7 +2,7 @@ * * Module Name: dsopcode - Dispatcher Op Region support and handling of * "control" opcodes - * $Revision: 81 $ + * $Revision: 82 $ * *****************************************************************************/ @@ -188,7 +188,7 @@ return_ACPI_STATUS (Status); } - WalkState->ParseFlags = 0; + WalkState->ParseFlags = ACPI_PARSE_DEFERRED_OP; /* Pass1: Parse the entire declaration */ Index: dswload.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/dswload.c,v retrieving revision 1.1.1.16 diff -u -r1.1.1.16 dswload.c --- dswload.c 29 Aug 2002 01:51:20 -0000 1.1.1.16 +++ dswload.c 5 Sep 2002 04:41:45 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: dswload - Dispatcher namespace load callbacks - * $Revision: 70 $ + * $Revision: 71 $ * *****************************************************************************/ @@ -202,25 +202,30 @@ ACPI_STATUS Status; ACPI_OBJECT_TYPE ObjectType; NATIVE_CHAR *Path; + UINT32 Flags; ACPI_FUNCTION_NAME ("DsLoad1BeginOp"); + Op = WalkState->Op; ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState)); - - if (Op && (Op->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState)); - } - /* We are only interested in opcodes that have an associated name */ if (Op) { if (!(WalkState->OpInfo->Flags & AML_NAMED)) { +#if 0 + if ((WalkState->OpInfo->Class == AML_CLASS_EXECUTE) || + (WalkState->OpInfo->Class == AML_CLASS_CONTROL)) + { + AcpiOsPrintf ("\n\n***EXECUTABLE OPCODE %s***\n\n", WalkState->OpInfo->Name); + *OutOp = Op; + return (AE_CTRL_SKIP); + } +#endif *OutOp = Op; return (AE_OK); } @@ -241,7 +246,33 @@ ObjectType = WalkState->OpInfo->ObjectType; ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "State=%p Op=%p Type=%X\n", WalkState, Op, ObjectType)); + "State=%p Op=%p [%s] ", WalkState, Op, AcpiUtGetTypeName (ObjectType))); + + /* + * Setup the search flags. + * + * Since we are entering a name into the namespace, we do not want to + * enable the search-to-root upsearch. + * + * There are only two conditions where it is acceptable that the name + * already exists: + * 1) the Scope() operator can reopen a scoping object that was + * previously defined (Scope, Method, Device, etc.) + * 2) Whenever we are parsing a deferred opcode (OpRegion, Buffer, + * BufferField, or Package), the name of the object is already + * in the namespace. + */ + Flags = ACPI_NS_NO_UPSEARCH; + if ((WalkState->Opcode != AML_SCOPE_OP) && + (!(WalkState->ParseFlags & ACPI_PARSE_DEFERRED_OP))) + { + Flags |= ACPI_NS_ERROR_IF_FOUND; + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Cannot already exist\n")); + } + else + { + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Both Find or Create allowed\n")); + } /* * Enter the named type into the internal namespace. We enter the name @@ -249,13 +280,41 @@ * arguments to the opcode must be created as we go back up the parse tree later. */ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType, - ACPI_IMODE_LOAD_PASS1, ACPI_NS_NO_UPSEARCH, WalkState, &(Node)); - + ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &(Node)); if (ACPI_FAILURE (Status)) { return (Status); } + /* + * For the scope op, we must check to make sure that the target is + * one of the opcodes that actually opens a scope + */ + if (WalkState->Opcode == AML_SCOPE_OP) + { + switch (Node->Type) + { + case ACPI_TYPE_ANY: /* Scope nodes are untyped (ANY) */ + case ACPI_TYPE_DEVICE: + case ACPI_TYPE_METHOD: + case ACPI_TYPE_POWER: + case ACPI_TYPE_PROCESSOR: + case ACPI_TYPE_THERMAL: + + /* These are acceptable types */ + break; + + default: + + /* All other types are an error */ + + ACPI_REPORT_ERROR (("Invalid type (%s) for target of Scope operator [%4.4s]\n", + AcpiUtGetTypeName (Node->Type), Path)); + + return (AE_AML_OPERAND_TYPE); + } + } + if (!Op) { /* Create a new op */ @@ -314,9 +373,9 @@ ACPI_FUNCTION_NAME ("DsLoad1EndOp"); + Op = WalkState->Op; ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState)); - /* We are only interested in opcodes that have an associated name */ Index: evevent.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/evevent.c,v retrieving revision 1.1.1.18 diff -u -r1.1.1.18 evevent.c --- evevent.c 29 Aug 2002 01:51:15 -0000 1.1.1.18 +++ evevent.c 5 Sep 2002 04:41:44 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evevent - Fixed and General Purpose Even handling and dispatch - * $Revision: 90 $ + * $Revision: 91 $ * *****************************************************************************/ @@ -234,6 +234,7 @@ return_ACPI_STATUS (Status); } + AcpiGbl_EventsInitialized = TRUE; return_ACPI_STATUS (Status); } Index: evmisc.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/evmisc.c,v retrieving revision 1.1.1.16 diff -u -r1.1.1.16 evmisc.c --- evmisc.c 29 Aug 2002 01:51:15 -0000 1.1.1.16 +++ evmisc.c 5 Sep 2002 04:41:44 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evmisc - Miscellaneous event manager support functions - * $Revision: 56 $ + * $Revision: 57 $ * *****************************************************************************/ @@ -667,7 +667,7 @@ * * RETURN: none * - * DESCRIPTION: free memory allocated for table storage. + * DESCRIPTION: Disable events and free memory allocated for table storage. * ******************************************************************************/ @@ -680,45 +680,49 @@ ACPI_FUNCTION_TRACE ("EvTerminate"); - /* - * Disable all event-related functionality. - * In all cases, on error, print a message but obviously we don't abort. - */ - /* - * Disable all fixed events - */ - for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) + if (AcpiGbl_EventsInitialized) { - Status = AcpiDisableEvent(i, ACPI_EVENT_FIXED, 0); - if (ACPI_FAILURE (Status)) + /* + * Disable all event-related functionality. + * In all cases, on error, print a message but obviously we don't abort. + */ + + /* + * Disable all fixed events + */ + for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Failed to disable fixed event %d.\n", i)); + Status = AcpiDisableEvent(i, ACPI_EVENT_FIXED, 0); + if (ACPI_FAILURE (Status)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not disable fixed event %d\n", i)); + } } - } - /* - * Disable all GPEs - */ - for (i = 0; i < AcpiGbl_GpeNumberMax; i++) - { - if (AcpiEvGetGpeNumberIndex(i) != ACPI_GPE_INVALID) + /* + * Disable all GPEs + */ + for (i = 0; i < AcpiGbl_GpeNumberMax; i++) { - Status = AcpiHwDisableGpe(i); - if (ACPI_FAILURE (Status)) + if (AcpiEvGetGpeNumberIndex(i) != ACPI_GPE_INVALID) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Failed to disable GPE %d.\n", i)); + Status = AcpiHwDisableGpe(i); + if (ACPI_FAILURE (Status)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not disable GPE %d\n", i)); + } } } - } - /* - * Remove SCI handler - */ - Status = AcpiEvRemoveSciHandler(); - if (ACPI_FAILURE(Status)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unable to remove SCI handler.\n")); + /* + * Remove SCI handler + */ + Status = AcpiEvRemoveSciHandler(); + if (ACPI_FAILURE(Status)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not remove SCI handler\n")); + } } /* @@ -729,7 +733,7 @@ Status = AcpiDisable (); if (ACPI_FAILURE (Status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "AcpiDisable failed.\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "AcpiDisable failed\n")); } } Index: utglobal.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/utglobal.c,v retrieving revision 1.6 diff -u -r1.6 utglobal.c --- utglobal.c 29 Aug 2002 01:52:26 -0000 1.6 +++ utglobal.c 5 Sep 2002 04:41:45 -0000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: utglobal - Global variables for the ACPI subsystem - * $Revision: 168 $ + * $Revision: 170 $ * *****************************************************************************/ @@ -264,10 +264,10 @@ /* - * Names built-in to the interpreter + * Predefined ACPI Names (Built-in to the Interpreter) * * Initial values are currently supported only for types String and Number. - * To avoid type punning, both are specified as strings in this table. + * Both are specified as strings in this table. * * NOTES: * 1) _SB_ is defined to be a device to allow _SB_/_INI to be run @@ -276,11 +276,11 @@ const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] = { - {"_GPE", INTERNAL_TYPE_DEF_ANY, NULL}, - {"_PR_", INTERNAL_TYPE_DEF_ANY, NULL}, + {"_GPE", INTERNAL_TYPE_SCOPE, NULL}, + {"_PR_", INTERNAL_TYPE_SCOPE, NULL}, {"_SB_", ACPI_TYPE_DEVICE, NULL}, - {"_SI_", INTERNAL_TYPE_DEF_ANY, NULL}, - {"_TZ_", INTERNAL_TYPE_DEF_ANY, NULL}, + {"_SI_", INTERNAL_TYPE_SCOPE, NULL}, + {"_TZ_", INTERNAL_TYPE_SCOPE, NULL}, {"_REV", ACPI_TYPE_INTEGER, "2"}, {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, {"_GL_", ACPI_TYPE_MUTEX, "0"}, @@ -294,9 +294,7 @@ /* * Properties of the ACPI Object Types, both internal and external. - * - * Elements of AcpiNsProperties are bit significant - * and the table is indexed by values of ACPI_OBJECT_TYPE + * The table is indexed by values of ACPI_OBJECT_TYPE */ const UINT8 AcpiGbl_NsProperties[] = @@ -629,7 +627,6 @@ /* * Strings and procedures used for debug only - * */ @@ -862,6 +859,7 @@ AcpiGbl_GpeRegisterInfo = NULL; AcpiGbl_GpeNumberInfo = NULL; + AcpiGbl_EventsInitialized = FALSE; /* Namespace */