diff -ruN acpica-unix-20001020/Subsystem/Common/cmalloc.c acpica-unix-20001115/Subsystem/Common/cmalloc.c --- acpica-unix-20001020/Subsystem/Common/cmalloc.c Sat Oct 21 06:44:51 2000 +++ acpica-unix-20001115/Subsystem/Common/cmalloc.c Thu Nov 16 09:18:37 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: cmalloc - local memory allocation routines - * $Revision: 76 $ + * $Revision: 78 $ * *****************************************************************************/ @@ -475,42 +475,42 @@ DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, ("%30s: %4d (%3d Kb)\n", "Current allocations", AcpiGbl_CurrentAllocCount, - (AcpiGbl_CurrentAllocSize + 1023) / 1024)); + ROUND_UP_TO_1K (AcpiGbl_CurrentAllocSize))); DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, ("%30s: %4d (%3d Kb)\n", "Max concurrent allocations", AcpiGbl_MaxConcurrentAllocCount, - (AcpiGbl_MaxConcurrentAllocSize + 1023) / 1024)); + ROUND_UP_TO_1K (AcpiGbl_MaxConcurrentAllocSize))); DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, ("%30s: %4d (%3d Kb)\n", "Current Internal objects", AcpiGbl_CurrentObjectCount, - (AcpiGbl_CurrentObjectSize + 1023) / 1024)); + ROUND_UP_TO_1K (AcpiGbl_CurrentObjectSize))); DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, ("%30s: %4d (%3d Kb)\n", "Max internal objects", AcpiGbl_MaxConcurrentObjectCount, - (AcpiGbl_MaxConcurrentObjectSize + 1023) / 1024)); + ROUND_UP_TO_1K (AcpiGbl_MaxConcurrentObjectSize))); DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, ("%30s: %4d (%3d Kb)\n", "Current Nodes", AcpiGbl_CurrentNodeCount, - (AcpiGbl_CurrentNodeSize + 1023) / 1024)); + ROUND_UP_TO_1K (AcpiGbl_CurrentNodeSize))); DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, ("%30s: %4d (%3d Kb)\n", "Max Nodes", AcpiGbl_MaxConcurrentNodeCount, - ((AcpiGbl_MaxConcurrentNodeCount * sizeof (ACPI_NAMESPACE_NODE)) + 1023) / 1024)); + ROUND_UP_TO_1K ((AcpiGbl_MaxConcurrentNodeCount * sizeof (ACPI_NAMESPACE_NODE))))); DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, ("%30s: %4d (%3d Kb)\n", "Total (all) internal objects", AcpiGbl_RunningObjectCount, - (AcpiGbl_RunningObjectSize + 1023) / 1024)); + ROUND_UP_TO_1K (AcpiGbl_RunningObjectSize))); DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, ("%30s: %4d (%3d Kb)\n", "Total (all) allocations", AcpiGbl_RunningAllocCount, - (AcpiGbl_RunningAllocSize + 1023) / 1024)); + ROUND_UP_TO_1K (AcpiGbl_RunningAllocSize))); return_VOID; } @@ -642,7 +642,7 @@ UINT32 Line) { void *Address = NULL; - DEBUG_EXEC (\ + DEBUG_ONLY_MEMBERS (\ ACPI_STATUS Status) @@ -709,7 +709,7 @@ UINT32 Line) { void *Address = NULL; - DEBUG_EXEC (\ + DEBUG_ONLY_MEMBERS (\ ACPI_STATUS Status) diff -ruN acpica-unix-20001020/Subsystem/Common/cmclib.c acpica-unix-20001115/Subsystem/Common/cmclib.c --- acpica-unix-20001020/Subsystem/Common/cmclib.c Sat Oct 21 06:44:51 2000 +++ acpica-unix-20001115/Subsystem/Common/cmclib.c Thu Nov 16 09:18:37 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: cmclib - Local implementation of C library functions - * $Revision: 26 $ + * $Revision: 28 $ * *****************************************************************************/ @@ -134,10 +134,6 @@ MODULE_NAME ("cmclib") -#ifdef _MSC_VER /* disable some level-4 warnings for VC++ */ -#pragma warning(disable:4706) /* warning C4706: assignment within conditional expression */ -#endif - #ifndef ACPI_USE_SYSTEM_CLIBRARY /******************************************************************************* @@ -738,7 +734,7 @@ return (NULL); } - /* Walk entire string, uppercasing the letters */ + /* Walk entire string, comparing the letters */ for (String = String1; *String2; ) { diff -ruN acpica-unix-20001020/Subsystem/Common/cmcopy.c acpica-unix-20001115/Subsystem/Common/cmcopy.c --- acpica-unix-20001020/Subsystem/Common/cmcopy.c Sat Oct 21 06:44:52 2000 +++ acpica-unix-20001115/Subsystem/Common/cmcopy.c Thu Nov 16 09:18:37 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: cmcopy - Internal to external object translation utilities - * $Revision: 56 $ + * $Revision: 58 $ * *****************************************************************************/ @@ -155,7 +155,7 @@ * ******************************************************************************/ -ACPI_STATUS +static ACPI_STATUS AcpiCmBuildExternalSimpleObject ( ACPI_OPERAND_OBJECT *InternalObj, ACPI_OBJECT *ExternalObj, @@ -296,7 +296,7 @@ * ******************************************************************************/ -ACPI_STATUS +static ACPI_STATUS AcpiCmBuildExternalPackageObject ( ACPI_OPERAND_OBJECT *InternalObj, UINT8 *Buffer, @@ -602,6 +602,10 @@ } +#ifdef ACPI_FUTURE_IMPLEMENTATION + +/* Code to convert packages that are parameters to control methods */ + /****************************************************************************** * * FUNCTION: AcpiCmBuildInternalPackageObject @@ -621,7 +625,7 @@ * ******************************************************************************/ -ACPI_STATUS +static ACPI_STATUS AcpiCmBuildInternalPackageObject ( ACPI_OPERAND_OBJECT *InternalObj, UINT8 *Buffer, @@ -767,6 +771,8 @@ } /* while (1) */ } +#endif /* Future implementation */ + /****************************************************************************** * @@ -797,6 +803,10 @@ /* * Package objects contain other objects (which can be objects) * buildpackage does it all + * + * TBD: Package conversion must be completed and tested + * NOTE: this code converts packages as input parameters to + * control methods only. This is a very, very rare case. */ /* Status = AcpiCmBuildInternalPackageObject(InternalObj, diff -ruN acpica-unix-20001020/Subsystem/Common/cmdelete.c acpica-unix-20001115/Subsystem/Common/cmdelete.c --- acpica-unix-20001020/Subsystem/Common/cmdelete.c Sat Oct 21 06:44:52 2000 +++ acpica-unix-20001115/Subsystem/Common/cmdelete.c Thu Nov 16 09:18:37 2000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: cmdelete - object deletion and reference count utilities - * $Revision: 57 $ + * $Revision: 59 $ * ******************************************************************************/ @@ -250,7 +250,7 @@ if (Object->Region.Extra) { - /* + /* * Free the RegionContext if and only if the handler is one of the * default handlers -- and therefore, we created the context object * locally, it was not created by an external caller. @@ -392,7 +392,7 @@ * ******************************************************************************/ -void +static void AcpiCmUpdateRefCount ( ACPI_OPERAND_OBJECT *Object, UINT32 Action) diff -ruN acpica-unix-20001020/Subsystem/Common/cmglobal.c acpica-unix-20001115/Subsystem/Common/cmglobal.c --- acpica-unix-20001020/Subsystem/Common/cmglobal.c Sat Oct 21 06:44:52 2000 +++ acpica-unix-20001115/Subsystem/Common/cmglobal.c Thu Nov 16 09:18:37 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: cmglobal - Global variables for the ACPI subsystem - * $Revision: 104 $ + * $Revision: 110 $ * *****************************************************************************/ @@ -166,6 +166,9 @@ BOOLEAN AcpiGbl_Shutdown = TRUE; +UINT8 AcpiGbl_DecodeTo8bit [8] = {1,2,4,8,16,32,64,128}; + + /****************************************************************************** * * Namespace globals @@ -230,18 +233,19 @@ NSP_NORMAL, /* 21 Alias */ NSP_NORMAL, /* 22 Notify */ NSP_NORMAL, /* 23 Address Handler */ - NSP_NORMAL, /* 24 DefFieldDefn */ - NSP_NORMAL, /* 25 BankFieldDefn */ - NSP_NORMAL, /* 26 IndexFieldDefn */ - NSP_NORMAL, /* 27 If */ - NSP_NORMAL, /* 28 Else */ - NSP_NORMAL, /* 29 While */ - NSP_NEWSCOPE, /* 30 Scope */ - NSP_LOCAL, /* 31 DefAny */ - NSP_NORMAL, /* 32 Method Arg */ - NSP_NORMAL, /* 33 Method Local */ - NSP_NORMAL, /* 34 Extra */ - NSP_NORMAL /* 35 Invalid */ + NSP_NEWSCOPE | NSP_LOCAL, /* 24 Resource */ + NSP_NORMAL, /* 25 DefFieldDefn */ + NSP_NORMAL, /* 26 BankFieldDefn */ + NSP_NORMAL, /* 27 IndexFieldDefn */ + NSP_NORMAL, /* 28 If */ + NSP_NORMAL, /* 29 Else */ + NSP_NORMAL, /* 30 While */ + NSP_NEWSCOPE, /* 31 Scope */ + NSP_LOCAL, /* 32 DefAny */ + NSP_NORMAL, /* 33 Method Arg */ + NSP_NORMAL, /* 34 Method Local */ + NSP_NORMAL, /* 35 Extra */ + NSP_NORMAL /* 36 Invalid */ }; @@ -249,6 +253,10 @@ * * Table globals * + * NOTE: This table includes ONLY the ACPI tables that the subsystem consumes. + * it is NOT an exhaustive list of all possible ACPI tables. All ACPI tables + * that are not used by the subsystem are simply ignored. + * ******************************************************************************/ @@ -257,19 +265,15 @@ ACPI_TABLE_SUPPORT AcpiGbl_AcpiTableData[NUM_ACPI_TABLES] = { - /* Name, Signature, Signature size, How many allowed?, Supported? Global typed pointer */ + /*********** Name, Signature, Signature size, How many allowed?, Supported? Global typed pointer */ - /* RSDP 0 */ {"RSDP", RSDP_SIG, sizeof (RSDP_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, NULL}, - /* APIC 1 */ {APIC_SIG, APIC_SIG, sizeof (APIC_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &AcpiGbl_APIC}, - /* DSDT 2 */ {DSDT_SIG, DSDT_SIG, sizeof (DSDT_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &AcpiGbl_DSDT}, - /* FACP 3 */ {FACP_SIG, FACP_SIG, sizeof (FACP_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &AcpiGbl_FACP}, - /* FACS 4 */ {FACS_SIG, FACS_SIG, sizeof (FACS_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &AcpiGbl_FACS}, - /* PSDT 5 */ {PSDT_SIG, PSDT_SIG, sizeof (PSDT_SIG)-1, ACPI_TABLE_MULTIPLE, AE_OK, NULL}, - /* RSDT 6 */ {RSDT_SIG, RSDT_SIG, sizeof (RSDT_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, NULL}, - /* SSDT 7 */ {SSDT_SIG, SSDT_SIG, sizeof (SSDT_SIG)-1, ACPI_TABLE_MULTIPLE, AE_OK, NULL}, - /* SBST 8 */ {SBST_SIG, SBST_SIG, sizeof (SBST_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &AcpiGbl_SBST}, - /* SPIC 9 */ {SPIC_SIG, SPIC_SIG, sizeof (SPIC_SIG)-1, ACPI_TABLE_MULTIPLE, AE_OK, NULL}, - /* BOOT 10 */{BOOT_SIG, BOOT_SIG, sizeof (BOOT_SIG)-1, ACPI_TABLE_SINGLE, AE_SUPPORT, NULL} + /* RSDP 0 */ {RSDP_NAME, RSDP_SIG, sizeof (RSDP_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, NULL}, + /* DSDT 1 */ {DSDT_SIG, DSDT_SIG, sizeof (DSDT_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &AcpiGbl_DSDT}, + /* FADT 2 */ {FADT_SIG, FADT_SIG, sizeof (FADT_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &AcpiGbl_FADT}, + /* FACS 3 */ {FACS_SIG, FACS_SIG, sizeof (FACS_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &AcpiGbl_FACS}, + /* PSDT 4 */ {PSDT_SIG, PSDT_SIG, sizeof (PSDT_SIG)-1, ACPI_TABLE_MULTIPLE, AE_OK, NULL}, + /* SSDT 5 */ {SSDT_SIG, SSDT_SIG, sizeof (SSDT_SIG)-1, ACPI_TABLE_MULTIPLE, AE_OK, NULL}, + /* XSDT 6 */ {XSDT_SIG, XSDT_SIG, sizeof (RSDT_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, NULL}, }; @@ -348,18 +352,19 @@ /* 21 */ "Alias", /* 22 */ "Notify", /* 23 */ "AddrHndlr", - /* 24 */ "DefFldDfn", - /* 25 */ "BnkFldDfn", - /* 26 */ "IdxFldDfn", - /* 27 */ "If", - /* 28 */ "Else", - /* 29 */ "While", - /* 30 */ "Scope", - /* 31 */ "DefAny", - /* 32 */ "MethodArg", - /* 33 */ "MethodLcl", - /* 34 */ "Extra", - /* 35 */ "Invalid" + /* 24 */ "Resource", + /* 25 */ "DefFldDfn", + /* 26 */ "BnkFldDfn", + /* 27 */ "IdxFldDfn", + /* 28 */ "If", + /* 29 */ "Else", + /* 30 */ "While", + /* 31 */ "Scope", + /* 32 */ "DefAny", + /* 33 */ "MethodArg", + /* 34 */ "MethodLcl", + /* 35 */ "Extra", + /* 36 */ "Invalid" }; @@ -609,12 +614,10 @@ /* Global "typed" ACPI table pointers */ AcpiGbl_RSDP = NULL; - AcpiGbl_RSDT = NULL; + AcpiGbl_XSDT = NULL; AcpiGbl_FACS = NULL; - AcpiGbl_FACP = NULL; - AcpiGbl_APIC = NULL; + AcpiGbl_FADT = NULL; AcpiGbl_DSDT = NULL; - AcpiGbl_SBST = NULL; /* Global Lock support */ @@ -628,7 +631,6 @@ AcpiGbl_StartupFlags = 0; AcpiGbl_GlobalLockSet = FALSE; AcpiGbl_RsdpOriginalLocation = 0; - AcpiGbl_WhenToParseMethods = METHOD_PARSE_CONFIGURATION; AcpiGbl_CmSingleStep = FALSE; AcpiGbl_DbTerminateThreads = FALSE; AcpiGbl_Shutdown = FALSE; @@ -665,15 +667,6 @@ AcpiGbl_WalkStateCacheDepth = 0; AcpiGbl_WalkStateCacheRequests = 0; AcpiGbl_WalkStateCacheHits = 0; - - /* Interpreter */ - - AcpiGbl_BufSeq = 0; - AcpiGbl_NodeErr = FALSE; - - /* Parser */ - - AcpiGbl_ParsedNamespaceRoot = NULL; /* Hardware oriented */ diff -ruN acpica-unix-20001020/Subsystem/Common/cminit.c acpica-unix-20001115/Subsystem/Common/cminit.c --- acpica-unix-20001020/Subsystem/Common/cminit.c Sat Oct 21 06:44:52 2000 +++ acpica-unix-20001115/Subsystem/Common/cminit.c Thu Nov 16 09:18:38 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: cminit - Common ACPI subsystem initialization - * $Revision: 84 $ + * $Revision: 88 $ * *****************************************************************************/ @@ -130,7 +130,7 @@ /******************************************************************************* * - * FUNCTION: AcpiCmFacpRegisterError + * FUNCTION: AcpiCmFadtRegisterError * * PARAMETERS: *RegisterName - Pointer to string identifying register * Value - Actual register contents value @@ -143,15 +143,15 @@ * ******************************************************************************/ -ACPI_STATUS -AcpiCmFacpRegisterError ( +static ACPI_STATUS +AcpiCmFadtRegisterError ( NATIVE_CHAR *RegisterName, - UINT32 Value) + UINT64 Value) { REPORT_ERROR ( - ("Invalid FACP register value, %s = 0x%X (FACP=0x%X)\n", - RegisterName, Value, AcpiGbl_FACP)); + ("Invalid FADT register value, %s = 0x%X (FADT=0x%X)\n", + RegisterName, Value, AcpiGbl_FADT)); return (AE_BAD_VALUE); @@ -160,18 +160,18 @@ /****************************************************************************** * - * FUNCTION: AcpiCmValidateFacp + * FUNCTION: AcpiCmValidateFadt * * PARAMETERS: None * * RETURN: Status * - * DESCRIPTION: Validate various ACPI registers in the FACP + * DESCRIPTION: Validate various ACPI registers in the FADT * ******************************************************************************/ ACPI_STATUS -AcpiCmValidateFacp ( +AcpiCmValidateFadt ( void) { ACPI_STATUS Status = AE_OK; @@ -182,61 +182,64 @@ * but don't abort on any problems, just display error */ - if (AcpiGbl_FACP->Pm1EvtLen < 4) + if (AcpiGbl_FADT->Pm1EvtLen < 4) { - Status = AcpiCmFacpRegisterError ("PM1_EVT_LEN", - (UINT32) AcpiGbl_FACP->Pm1EvtLen); + Status = AcpiCmFadtRegisterError ("PM1_EVT_LEN", + (UINT32) AcpiGbl_FADT->Pm1EvtLen); } - if (!AcpiGbl_FACP->Pm1CntLen) + if (!AcpiGbl_FADT->Pm1CntLen) { - Status = AcpiCmFacpRegisterError ("PM1_CNT_LEN", - (UINT32) AcpiGbl_FACP->Pm1CntLen); + Status = AcpiCmFadtRegisterError ("PM1_CNT_LEN", + (UINT32) AcpiGbl_FADT->Pm1CntLen); } - if (!AcpiGbl_FACP->Pm1aEvtBlk) + if (!AcpiGbl_FADT->XPm1aEvtBlk.Address) { - Status = AcpiCmFacpRegisterError ("PM1a_EVT_BLK", - AcpiGbl_FACP->Pm1aEvtBlk); + Status = AcpiCmFadtRegisterError ("PM1a_EVT_BLK", + AcpiGbl_FADT->XPm1aEvtBlk.Address); } - if (!AcpiGbl_FACP->Pm1aCntBlk) + if (!AcpiGbl_FADT->XPm1aCntBlk.Address) { - Status = AcpiCmFacpRegisterError ("PM1a_CNT_BLK", - AcpiGbl_FACP->Pm1aCntBlk); + Status = AcpiCmFadtRegisterError ("PM1a_CNT_BLK", + AcpiGbl_FADT->XPm1aCntBlk.Address); } - if (!AcpiGbl_FACP->PmTmrBlk) + if (!AcpiGbl_FADT->XPmTmrBlk.Address) { - Status = AcpiCmFacpRegisterError ("PM_TMR_BLK", - AcpiGbl_FACP->PmTmrBlk); + Status = AcpiCmFadtRegisterError ("PM_TMR_BLK", + AcpiGbl_FADT->XPmTmrBlk.Address); } - if (AcpiGbl_FACP->Pm2CntBlk && !AcpiGbl_FACP->Pm2CntLen) + if ((AcpiGbl_FADT->XPm2CntBlk.Address && + !AcpiGbl_FADT->Pm2CntLen)) { - Status = AcpiCmFacpRegisterError ("PM2_CNT_LEN", - (UINT32) AcpiGbl_FACP->Pm2CntLen); + Status = AcpiCmFadtRegisterError ("PM2_CNT_LEN", + (UINT32) AcpiGbl_FADT->Pm2CntLen); } - if (AcpiGbl_FACP->PmTmLen < 4) + if (AcpiGbl_FADT->PmTmLen < 4) { - Status = AcpiCmFacpRegisterError ("PM_TM_LEN", - (UINT32) AcpiGbl_FACP->PmTmLen); + Status = AcpiCmFadtRegisterError ("PM_TM_LEN", + (UINT32) AcpiGbl_FADT->PmTmLen); } /* length of GPE blocks must be a multiple of 2 */ - if (AcpiGbl_FACP->Gpe0Blk && (AcpiGbl_FACP->Gpe0BlkLen & 1)) + if (AcpiGbl_FADT->XGpe0Blk.Address && + (AcpiGbl_FADT->Gpe0BlkLen & 1)) { - Status = AcpiCmFacpRegisterError ("GPE0_BLK_LEN", - (UINT32) AcpiGbl_FACP->Gpe0BlkLen); + Status = AcpiCmFadtRegisterError ("GPE0_BLK_LEN", + (UINT32) AcpiGbl_FADT->Gpe0BlkLen); } - if (AcpiGbl_FACP->Gpe1Blk && (AcpiGbl_FACP->Gpe1BlkLen & 1)) + if (AcpiGbl_FADT->XGpe1Blk.Address && + (AcpiGbl_FADT->Gpe1BlkLen & 1)) { - Status = AcpiCmFacpRegisterError ("GPE1_BLK_LEN", - (UINT32) AcpiGbl_FACP->Gpe1BlkLen); + Status = AcpiCmFadtRegisterError ("GPE1_BLK_LEN", + (UINT32) AcpiGbl_FADT->Gpe1BlkLen); } return (Status); diff -ruN acpica-unix-20001020/Subsystem/Common/cmobject.c acpica-unix-20001115/Subsystem/Common/cmobject.c --- acpica-unix-20001020/Subsystem/Common/cmobject.c Sat Oct 21 06:44:52 2000 +++ acpica-unix-20001115/Subsystem/Common/cmobject.c Thu Nov 16 09:18:38 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: cmobject - ACPI object create/delete/size/cache routines - * $Revision: 30 $ + * $Revision: 31 $ * *****************************************************************************/ @@ -658,10 +658,10 @@ { ACPI_OPERAND_OBJECT *ThisInternalObj; - ACPI_OPERAND_OBJECT *ParentObj[MAX_PACKAGE_DEPTH] = { 0,0,0,0,0 }; + ACPI_OPERAND_OBJECT *ParentObj[MAX_PACKAGE_DEPTH]; ACPI_OPERAND_OBJECT *ThisParent; UINT32 ThisIndex; - UINT32 Index[MAX_PACKAGE_DEPTH] = { 0,0,0,0,0 }; + UINT32 Index[MAX_PACKAGE_DEPTH]; UINT32 Length = 0; UINT32 ObjectSpace; UINT32 CurrentDepth = 0; @@ -671,6 +671,11 @@ FUNCTION_TRACE_PTR ("CmGetPackageObjectSize", InternalObj); + + /* Init the package stack TBD: replace with linked list */ + + MEMSET(ParentObj, 0, MAX_PACKAGE_DEPTH); + MEMSET(Index, 0, MAX_PACKAGE_DEPTH); ParentObj[0] = InternalObj; diff -ruN acpica-unix-20001020/Subsystem/Common/cmxface.c acpica-unix-20001115/Subsystem/Common/cmxface.c --- acpica-unix-20001020/Subsystem/Common/cmxface.c Sat Oct 21 06:44:52 2000 +++ acpica-unix-20001115/Subsystem/Common/cmxface.c Thu Nov 16 09:18:38 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: cmxface - External interfaces for "global" ACPI functions - * $Revision: 51 $ + * $Revision: 54 $ * *****************************************************************************/ @@ -226,9 +226,9 @@ FUNCTION_TRACE ("AcpiEnableSubsystem"); - /* Sanity check the FACP for valid values */ + /* Sanity check the FADT for valid values */ - Status = AcpiCmValidateFacp (); + Status = AcpiCmValidateFadt (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -274,7 +274,11 @@ { DEBUG_PRINT (TRACE_EXEC, ("[Init] Going into ACPI mode\n")); - AcpiEnable (); + Status = AcpiEnable (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } } /* @@ -356,7 +360,7 @@ /* Terminate the AML Debuger if present */ - AcpiGbl_DbTerminateThreads = TRUE; + DEBUGGER_EXEC(AcpiGbl_DbTerminateThreads = TRUE); /* TBD: [Investigate] This is no longer needed?*/ /* AcpiCmReleaseMutex (ACPI_MTX_DEBUG_CMD_READY); */ diff -ruN acpica-unix-20001020/Subsystem/Debugger/dbdisply.c acpica-unix-20001115/Subsystem/Debugger/dbdisply.c --- acpica-unix-20001020/Subsystem/Debugger/dbdisply.c Sat Oct 21 06:44:53 2000 +++ acpica-unix-20001115/Subsystem/Debugger/dbdisply.c Thu Nov 16 09:18:38 2000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbdisply - debug display commands - * $Revision: 34 $ + * $Revision: 35 $ * ******************************************************************************/ @@ -579,7 +579,7 @@ } ObjDesc = WalkState->MethodDesc; - Node = WalkState->Origin->Node; + Node = WalkState->MethodNode; NumArgs = ObjDesc->Method.ParamCount; Concurrency = ObjDesc->Method.Concurrency; @@ -686,7 +686,7 @@ } ObjDesc = WalkState->MethodDesc; - Node = WalkState->Origin->Node; + Node = WalkState->MethodNode; AcpiOsPrintf ("Local Variables for method [%4.4s]:\n", &Node->Name); @@ -820,14 +820,14 @@ } ObjDesc = WalkState->MethodDesc; - Node = WalkState->Origin->Node; + Node = WalkState->MethodNode; AcpiOsPrintf ("Current Control Method Call Tree\n"); for (i = 0; WalkState; i++) { ObjDesc = WalkState->MethodDesc; - Node = WalkState->Origin->Node; + Node = WalkState->MethodNode; AcpiOsPrintf (" [%4.4s]\n", &Node->Name); diff -ruN acpica-unix-20001020/Subsystem/Debugger/dbexec.c acpica-unix-20001115/Subsystem/Debugger/dbexec.c --- acpica-unix-20001020/Subsystem/Debugger/dbexec.c Sat Oct 21 06:44:53 2000 +++ acpica-unix-20001115/Subsystem/Debugger/dbexec.c Thu Nov 16 09:18:38 2000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbexec - debugger control method execution - * $Revision: 16 $ + * $Revision: 18 $ * ******************************************************************************/ @@ -291,18 +291,21 @@ UINT32 Flags) { ACPI_STATUS Status; + ACPI_BUFFER ReturnObj; + + +#ifdef ACPI_DEBUG UINT32 PreviousAllocations; UINT32 PreviousSize; UINT32 Allocations; UINT32 Size; - ACPI_BUFFER ReturnObj; /* Memory allocation tracking */ PreviousAllocations = AcpiGbl_CurrentAllocCount; PreviousSize = AcpiGbl_CurrentAllocSize; - +#endif Info.Name = Name; Info.Args = Args; @@ -312,6 +315,8 @@ Status = AcpiDbExecuteMethod (&Info, &ReturnObj); +#ifdef ACPI_DEBUG + /* Memory allocation tracking */ Allocations = AcpiGbl_CurrentAllocCount - PreviousAllocations; @@ -324,7 +329,7 @@ AcpiOsPrintf ("Outstanding: %ld allocations of total size %ld after execution\n", Allocations, Size); } - +#endif if (ACPI_FAILURE (Status)) { diff -ruN acpica-unix-20001020/Subsystem/Debugger/dbfileio.c acpica-unix-20001115/Subsystem/Debugger/dbfileio.c --- acpica-unix-20001020/Subsystem/Debugger/dbfileio.c Sat Oct 21 06:44:53 2000 +++ acpica-unix-20001115/Subsystem/Debugger/dbfileio.c Thu Nov 16 09:18:38 2000 @@ -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: 30 $ + * $Revision: 33 $ * ******************************************************************************/ @@ -270,28 +270,44 @@ UINT8 *AmlPtr; UINT32 AmlLength; UINT32 Actual; + ACPI_STATUS Status; /* Read the table header */ - if (fread (&TableHeader, 1, sizeof (TableHeader), fp) != sizeof (TableHeader)) + if (fread (&TableHeader, 1, sizeof (TableHeader), fp) != sizeof (ACPI_TABLE_HEADER)) { AcpiOsPrintf ("Couldn't read the table header\n"); return (AE_BAD_SIGNATURE); } - /* Get and validate the table length */ - *TableLength = TableHeader.Length; - if (!*TableLength) + /* Validate the table header/length */ + + Status = AcpiTbValidateTableHeader (&TableHeader); + if ((ACPI_FAILURE (Status)) || + (TableHeader.Length > (1024 * 1024))) + { + AcpiOsPrintf ("Table header is invalid!\n"); + return (AE_ERROR); + } + + + /* We only support a limited number of table types */ + + if (STRNCMP ((char *) TableHeader.Signature, DSDT_SIG, 4) && + STRNCMP ((char *) TableHeader.Signature, PSDT_SIG, 4) && + STRNCMP ((char *) TableHeader.Signature, SSDT_SIG, 4)) { - AcpiOsPrintf ("Found a table length of zero!\n"); + AcpiOsPrintf ("Table signature is invalid\n"); + DUMP_BUFFER (&TableHeader, sizeof (ACPI_TABLE_HEADER)); return (AE_ERROR); } /* Allocate a buffer for the table */ - *TablePtr = (ACPI_TABLE_HEADER *) malloc ((size_t) *TableLength); + *TableLength = TableHeader.Length; + *TablePtr = (ACPI_TABLE_HEADER *) AcpiCmAllocate ((size_t) *TableLength); if (!*TablePtr) { AcpiOsPrintf ("Could not allocate memory for the table (size=0x%X)\n", TableHeader.Length); @@ -322,7 +338,7 @@ AcpiOsPrintf ("Error - could not read the table file\n"); - free (*TablePtr); + AcpiCmFree (*TablePtr); *TablePtr = NULL; *TableLength = 0; @@ -454,7 +470,7 @@ AcpiOsPrintf ("Could not install table, %s\n", AcpiCmFormatException (Status)); } - free (TablePtr); + AcpiCmFree (TablePtr); return (Status); } diff -ruN acpica-unix-20001020/Subsystem/Dispatcher/dsobject.c acpica-unix-20001115/Subsystem/Dispatcher/dsobject.c --- acpica-unix-20001020/Subsystem/Dispatcher/dsobject.c Sat Oct 21 06:44:54 2000 +++ acpica-unix-20001115/Subsystem/Dispatcher/dsobject.c Thu Nov 16 09:18:39 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: dsobject - Dispatcher object management routines - * $Revision: 48 $ + * $Revision: 51 $ * *****************************************************************************/ @@ -157,9 +157,11 @@ OBJECT_TYPE_INTERNAL Type; ACPI_STATUS Status; ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context; + UINT8 TableRevision; Info->ObjectCount++; + TableRevision = Info->TableDesc->Pointer->Revision; /* * We are only interested in objects owned by the table that @@ -194,6 +196,15 @@ DEBUG_PRINT_RAW (ACPI_OK, (".")); + /* + * Set the execution data width (32 or 64) based upon the + * revision number of the parent ACPI table. + */ + + if (TableRevision == 1) + { + ((ACPI_NAMESPACE_NODE *)ObjHandle)->Flags |= ANOBJ_DATA_WIDTH_32; + } /* * Always parse methods to detect errors, we may delete @@ -214,15 +225,10 @@ } /* - * Keep the parse tree only if we are parsing all methods - * at init time (versus just-in-time) + * Delete the parse tree. We simple re-parse the method + * for every execution since there isn't much overhead */ - - if (AcpiGbl_WhenToParseMethods != METHOD_PARSE_AT_INIT) - { - AcpiNsDeleteNamespaceSubtree (ObjHandle); - } - + AcpiNsDeleteNamespaceSubtree (ObjHandle); break; default: @@ -267,10 +273,10 @@ DEBUG_PRINT_RAW (ACPI_OK, ("Parsing Methods:")); - Info.MethodCount = 0; - Info.OpRegionCount = 0; - Info.ObjectCount = 0; - Info.TableDesc = TableDesc; + Info.MethodCount = 0; + Info.OpRegionCount = 0; + Info.ObjectCount = 0; + Info.TableDesc = TableDesc; /* Walk entire namespace from the supplied root */ @@ -511,7 +517,7 @@ * ****************************************************************************/ -ACPI_STATUS +static ACPI_STATUS AcpiDsBuildInternalSimpleObj ( ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op, @@ -563,7 +569,6 @@ Op->Value.String, Op->AmlOffset)); } *ObjDescPtr = NULL; - return_ACPI_STATUS (AE_OK); } return_ACPI_STATUS (Status); diff -ruN acpica-unix-20001020/Subsystem/Dispatcher/dsopcode.c acpica-unix-20001115/Subsystem/Dispatcher/dsopcode.c --- acpica-unix-20001020/Subsystem/Dispatcher/dsopcode.c Sat Oct 21 06:44:54 2000 +++ acpica-unix-20001115/Subsystem/Dispatcher/dsopcode.c Thu Nov 16 09:18:39 2000 @@ -2,7 +2,7 @@ * * Module Name: dsopcode - Dispatcher Op Region support and handling of * "control" opcodes - * $Revision: 21 $ + * $Revision: 25 $ * *****************************************************************************/ @@ -728,26 +728,41 @@ return_ACPI_STATUS (Status); } + /* Resolve the length and address operands to numbers */ + + Status = AcpiAmlResolveOperands (Op->Opcode, WALK_OPERANDS, WalkState); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + DUMP_OPERANDS (WALK_OPERANDS, IMODE_EXECUTE, + AcpiPsGetOpcodeName (Op->Opcode), + 1, "after AcpiAmlResolveOperands"); + + ObjDesc = AcpiNsGetAttachedObject (Node); if (!ObjDesc) { return_ACPI_STATUS (AE_NOT_EXIST); } - /* Get the length and save it */ - - /* Top of stack */ + /* + * Get the length operand and save it + * (at Top of stack) + */ OperandDesc = WalkState->Operands[WalkState->NumOperands - 1]; ObjDesc->Region.Length = (UINT32) OperandDesc->Number.Value; AcpiCmRemoveReference (OperandDesc); - /* Get the address and save it */ - - /* Top of stack - 1 */ + /* + * Get the address and save it + * (at top of stack - 1) + */ OperandDesc = WalkState->Operands[WalkState->NumOperands - 2]; - ObjDesc->Region.Address = OperandDesc->Number.Value; + ObjDesc->Region.Address = (ACPI_PHYSICAL_ADDRESS) OperandDesc->Number.Value; AcpiCmRemoveReference (OperandDesc); diff -ruN acpica-unix-20001020/Subsystem/Dispatcher/dsutils.c acpica-unix-20001115/Subsystem/Dispatcher/dsutils.c --- acpica-unix-20001020/Subsystem/Dispatcher/dsutils.c Sat Oct 21 06:44:54 2000 +++ acpica-unix-20001115/Subsystem/Dispatcher/dsutils.c Thu Nov 16 09:18:39 2000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dsutils - Dispatcher utilities - * $Revision: 45 $ + * $Revision: 48 $ * ******************************************************************************/ @@ -218,8 +218,8 @@ case AML_IF_OP: case AML_WHILE_OP: - /* - * If we are executing the predicate AND this is the predicate op, + /* + * If we are executing the predicate AND this is the predicate op, * we will use the return value! */ @@ -235,9 +235,8 @@ break; } - - /* Fall through to not used case below */ + /* Fall through to not used case below */ case OPTYPE_NAMED_OBJECT: /* Scope, method, etc. */ @@ -393,6 +392,7 @@ ParentOp = Arg->Parent; if ((AcpiPsIsNodeOp (ParentOp->Opcode)) && (ParentOp->Opcode != AML_METHODCALL_OP) && + (ParentOp->Opcode != AML_REGION_OP) && (ParentOp->Opcode != AML_NAMEPATH_OP)) { /* Enter name into namespace if not found */ @@ -521,7 +521,7 @@ * a missing or null operand! */ DEBUG_PRINT (ACPI_ERROR, - ("DsCreateOperand: Could not pop result\n")); + ("DsCreateOperand: Missing or null operand, %s\n", AcpiCmFormatException (Status))); return_ACPI_STATUS (Status); } diff -ruN acpica-unix-20001020/Subsystem/Dispatcher/dswexec.c acpica-unix-20001115/Subsystem/Dispatcher/dswexec.c --- acpica-unix-20001020/Subsystem/Dispatcher/dswexec.c Sat Oct 21 06:44:54 2000 +++ acpica-unix-20001115/Subsystem/Dispatcher/dswexec.c Thu Nov 16 09:18:39 2000 @@ -2,7 +2,7 @@ * * Module Name: dswexec - Dispatcher method execution callbacks; * dispatch to interpreter. - * $Revision: 45 $ + * $Revision: 48 $ * *****************************************************************************/ @@ -130,7 +130,6 @@ MODULE_NAME ("dswexec") - /***************************************************************************** * * FUNCTION: AcpiDsGetPredicateValue @@ -139,7 +138,7 @@ * * RETURN: Status * - * DESCRIPTION: + * DESCRIPTION: * ****************************************************************************/ @@ -163,6 +162,10 @@ Status = AcpiDsResultStackPop (&ObjDesc, WalkState); if (ACPI_FAILURE (Status)) { + DEBUG_PRINT (ACPI_ERROR, + ("DsGetPredicateValue: Missing or null operand, %s\n", + AcpiCmFormatException (Status))); + return_ACPI_STATUS (Status); } } @@ -194,7 +197,7 @@ } - /* + /* * Result of predicate evaluation currently must * be a number */ @@ -210,9 +213,13 @@ } - /* + /* TBD: 64/32-bit */ + + ObjDesc->Number.Value &= (UINT64) 0x00000000FFFFFFFF; + + /* * Save the result of the predicate evaluation on - * the control stack + * the control stack */ if (ObjDesc->Number.Value) @@ -222,9 +229,9 @@ else { - /* + /* * Predicate is FALSE, we will just toss the - * rest of the package + * rest of the package */ WalkState->ControlState->Common.Value = FALSE; @@ -232,7 +239,6 @@ } - Cleanup: DEBUG_PRINT (TRACE_EXEC, @@ -243,7 +249,7 @@ DEBUGGER_EXEC (AcpiDbDisplayResultObject (ObjDesc, WalkState)); - /* + /* * Delete the predicate result object (we know that * we don't need it anymore) */ @@ -757,6 +763,12 @@ /* + * ACPI 2.0 support for 64-bit integers: + * Truncate numeric result value if we are executing from a 32-bit ACPI table + */ + AcpiAmlTruncateFor32bitTable (ResultObj, WalkState); + + /* * Check if we just completed the evaluation of a * conditional predicate */ @@ -766,14 +778,12 @@ CONTROL_PREDICATE_EXECUTING) && (WalkState->ControlState->Control.PredicateOp == Op)) { - Status = AcpiDsGetPredicateValue (WalkState, Op, (UINT32) ResultObj); ResultObj = NULL; } Cleanup: - if (ResultObj) { /* Break to debugger to display result */ diff -ruN acpica-unix-20001020/Subsystem/Dispatcher/dswstate.c acpica-unix-20001115/Subsystem/Dispatcher/dswstate.c --- acpica-unix-20001020/Subsystem/Dispatcher/dswstate.c Sat Oct 21 06:44:54 2000 +++ acpica-unix-20001115/Subsystem/Dispatcher/dswstate.c Thu Nov 16 09:18:40 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: dswstate - Dispatcher parse tree walk management routines - * $Revision: 31 $ + * $Revision: 34 $ * *****************************************************************************/ @@ -217,8 +217,8 @@ if (WalkState->NumResults == 0) { - DEBUG_PRINT (ACPI_ERROR, - ("DsResultStackPop: Underflow! State=%p Cur=%X Num=%X\n", + DEBUG_PRINT (TRACE_EXEC, + ("DsResultStackPop: Underflow - State=%p Cur=%X Num=%X\n", WalkState, WalkState->CurrentResult, WalkState->NumResults)); return (AE_AML_NO_OPERAND); } @@ -574,7 +574,7 @@ * ******************************************************************************/ -void +static void AcpiDsPushWalkState ( ACPI_WALK_STATE *WalkState, ACPI_WALK_LIST *WalkList) @@ -703,7 +703,9 @@ /* Init the method args/local */ +#ifndef _ACPI_ASL_COMPILER AcpiDsMethodDataInit (WalkState); +#endif /* Put the new state at the head of the walk list */ diff -ruN acpica-unix-20001020/Subsystem/Events/evevent.c acpica-unix-20001115/Subsystem/Events/evevent.c --- acpica-unix-20001020/Subsystem/Events/evevent.c Sat Oct 21 06:44:54 2000 +++ acpica-unix-20001115/Subsystem/Events/evevent.c Thu Nov 16 09:18:40 2000 @@ -2,7 +2,7 @@ * * Module Name: evevent - Fixed and General Purpose AcpiEvent * handling and dispatch - * $Revision: 17 $ + * $Revision: 26 $ * *****************************************************************************/ @@ -205,11 +205,23 @@ /* Install handlers for control method GPE handlers (_Lxx, _Exx) */ - AcpiEvInitGpeControlMethods (); + Status = AcpiEvInitGpeControlMethods (); + if (ACPI_FAILURE (Status)) + { + DEBUG_PRINT (ACPI_FATAL, + ("EvInitialize: Unable to initialize Gpe control methods\n")); + return_ACPI_STATUS (Status); + } /* Install the handler for the Global Lock */ Status = AcpiEvInitGlobalLockHandler (); + if (ACPI_FAILURE (Status)) + { + DEBUG_PRINT (ACPI_FATAL, + ("EvInitialize: Unable to initialize Global Lock handler\n")); + return_ACPI_STATUS (Status); + } return_ACPI_STATUS (Status); @@ -241,16 +253,11 @@ AcpiGbl_FixedEventHandlers[i].Context = NULL; } - AcpiHwRegisterAccess (ACPI_WRITE, ACPI_MTX_LOCK, ACPI_EVENT_PMTIMER + - TMR_EN, 0); - AcpiHwRegisterAccess (ACPI_WRITE, ACPI_MTX_LOCK, ACPI_EVENT_GLOBAL + - TMR_EN, 0); - AcpiHwRegisterAccess (ACPI_WRITE, ACPI_MTX_LOCK, ACPI_EVENT_POWER_BUTTON + - TMR_EN, 0); - AcpiHwRegisterAccess (ACPI_WRITE, ACPI_MTX_LOCK, ACPI_EVENT_SLEEP_BUTTON + - TMR_EN, 0); - AcpiHwRegisterAccess (ACPI_WRITE, ACPI_MTX_LOCK, ACPI_EVENT_RTC + - TMR_EN, 0); + AcpiHwRegisterBitAccess (ACPI_WRITE, ACPI_MTX_LOCK, TMR_EN, 0); + AcpiHwRegisterBitAccess (ACPI_WRITE, ACPI_MTX_LOCK, GBL_EN, 0); + AcpiHwRegisterBitAccess (ACPI_WRITE, ACPI_MTX_LOCK, PWRBTN_EN, 0); + AcpiHwRegisterBitAccess (ACPI_WRITE, ACPI_MTX_LOCK, SLPBTN_EN, 0); + AcpiHwRegisterBitAccess (ACPI_WRITE, ACPI_MTX_LOCK, RTC_EN, 0); return (AE_OK); } @@ -272,32 +279,22 @@ AcpiEvFixedEventDetect(void) { UINT32 IntStatus = INTERRUPT_NOT_HANDLED; - UINT32 StatusRegister = 0; - UINT32 EnableRegister = 0; + UINT32 StatusRegister; + UINT32 EnableRegister; /* * Read the fixed feature status and enable registers, as all the cases * depend on their values. */ - StatusRegister = (UINT32) AcpiOsIn16 (AcpiGbl_FACP->Pm1aEvtBlk); - if (AcpiGbl_FACP->Pm1bEvtBlk) - { - StatusRegister |= (UINT32) AcpiOsIn16 (AcpiGbl_FACP->Pm1bEvtBlk); - } - - EnableRegister = (UINT32) AcpiOsIn16 (AcpiGbl_FACP->Pm1aEvtBlk + - DIV_2 (AcpiGbl_FACP->Pm1EvtLen)); - if (AcpiGbl_FACP->Pm1bEvtBlk) - { - EnableRegister |= (UINT32) AcpiOsIn16 (AcpiGbl_FACP->Pm1bEvtBlk + - DIV_2 (AcpiGbl_FACP->Pm1EvtLen)); - } + StatusRegister = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, PM1_STS); + EnableRegister = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, PM1_EN); DEBUG_PRINT (TRACE_INTERRUPTS, ("Fixed AcpiEvent Block: Enable = %08x\tStatus = %08x\n", EnableRegister, StatusRegister)); + /* power management timer roll over */ if ((StatusRegister & ACPI_STATUS_PMTIMER) && @@ -351,10 +348,38 @@ AcpiEvFixedEventDispatch ( UINT32 Event) { + UINT32 RegisterId; + /* Clear the status bit */ - AcpiHwRegisterAccess (ACPI_WRITE, ACPI_MTX_DO_NOT_LOCK, TMR_STS + - Event, 1); + switch (Event) + { + case ACPI_EVENT_PMTIMER: + RegisterId = TMR_STS; + break; + + case ACPI_EVENT_GLOBAL: + RegisterId = GBL_STS; + break; + + case ACPI_EVENT_POWER_BUTTON: + RegisterId = PWRBTN_STS; + break; + + case ACPI_EVENT_SLEEP_BUTTON: + RegisterId = SLPBTN_STS; + break; + + case ACPI_EVENT_RTC: + RegisterId = RTC_STS; + break; + + default: + return 0; + break; + } + + AcpiHwRegisterBitAccess (ACPI_WRITE, ACPI_MTX_DO_NOT_LOCK, RegisterId, 1); /* * Make sure we've got a handler. If not, report an error. @@ -362,8 +387,10 @@ */ if (NULL == AcpiGbl_FixedEventHandlers[Event].Handler) { - AcpiHwRegisterAccess (ACPI_WRITE, ACPI_MTX_DO_NOT_LOCK, - TMR_EN + Event, 0); + RegisterId = (PM1_EN | REGISTER_BIT_ID(RegisterId)); + + AcpiHwRegisterBitAccess (ACPI_WRITE, ACPI_MTX_DO_NOT_LOCK, + RegisterId, 0); REPORT_ERROR ( ("EvGpeDispatch: No installed handler for fixed event [0x%08X]\n", @@ -404,29 +431,30 @@ FUNCTION_TRACE ("EvGpeInitialize"); - /*******************************************************************/ - /* Setting up various GPE counts */ - /* */ - /* You may ask,why are the GPE register block lengths divided by 2?*/ - /* From the ACPI 2.0 Spec, section, 4.7.1.6 General-Purpose Event */ - /* Registers, we have, */ - /* */ - /* "Each register block contains two registers of equal length: */ - /* GPEx_STS and GPEx_EN (where x is 0 or 1). The length of the */ - /* GPE0_STS and GPE0_EN registers is equal to half the GPE0_LEN. */ - /* The length of the GPE1_STS and GPE1_EN registers is equal to */ - /* half the GPE1_LEN. If a generic register block is not supported */ - /* then its respective block pointer and block length values in the*/ - /* FADT table contain zeros. The GPE0_LEN and GPE1_LEN do not need */ - /* to be the same size." */ - /*******************************************************************/ - Gpe0RegisterCount = (UINT16) DIV_2 (AcpiGbl_FACP->Gpe0BlkLen); - Gpe1RegisterCount = (UINT16) DIV_2 (AcpiGbl_FACP->Gpe1BlkLen); + /* + * Set up various GPE counts + * + * You may ask,why are the GPE register block lengths divided by 2? + * From the ACPI 2.0 Spec, section, 4.7.1.6 General-Purpose Event + * Registers, we have, + * + * "Each register block contains two registers of equal length + * GPEx_STS and GPEx_EN (where x is 0 or 1). The length of the + * GPE0_STS and GPE0_EN registers is equal to half the GPE0_LEN + * The length of the GPE1_STS and GPE1_EN registers is equal to + * half the GPE1_LEN. If a generic register block is not supported + * then its respective block pointer and block length values in the + * FADT table contain zeros. The GPE0_LEN and GPE1_LEN do not need + * to be the same size." + */ + + Gpe0RegisterCount = (UINT16) DIV_2 (AcpiGbl_FADT->Gpe0BlkLen); + Gpe1RegisterCount = (UINT16) DIV_2 (AcpiGbl_FADT->Gpe1BlkLen); AcpiGbl_GpeRegisterCount = Gpe0RegisterCount + Gpe1RegisterCount; if (!AcpiGbl_GpeRegisterCount) { - REPORT_WARNING (("Zero GPEs are defined in the FACP\n")); + REPORT_WARNING (("Zero GPEs are defined in the FADT\n")); return_ACPI_STATUS (AE_OK); } @@ -476,10 +504,10 @@ for (i = 0; i < Gpe0RegisterCount; i++) { AcpiGbl_GpeRegisters[RegisterIndex].StatusAddr = - (UINT16) (AcpiGbl_FACP->Gpe0Blk + i); + (UINT16) (AcpiGbl_FADT->XGpe0Blk.Address + i); AcpiGbl_GpeRegisters[RegisterIndex].EnableAddr = - (UINT16) (AcpiGbl_FACP->Gpe0Blk + i + Gpe0RegisterCount); + (UINT16) (AcpiGbl_FADT->XGpe0Blk.Address + i + Gpe0RegisterCount); AcpiGbl_GpeRegisters[RegisterIndex].GpeBase = (UINT8) MUL_8 (i); @@ -505,13 +533,13 @@ for (i = 0; i < Gpe1RegisterCount; i++) { AcpiGbl_GpeRegisters[RegisterIndex].StatusAddr = - (UINT16) (AcpiGbl_FACP->Gpe1Blk + i); + (UINT16) (AcpiGbl_FADT->XGpe1Blk.Address + i); AcpiGbl_GpeRegisters[RegisterIndex].EnableAddr = - (UINT16) (AcpiGbl_FACP->Gpe1Blk + i + Gpe1RegisterCount); + (UINT16) (AcpiGbl_FADT->XGpe1Blk.Address + i + Gpe1RegisterCount); AcpiGbl_GpeRegisters[RegisterIndex].GpeBase = - (UINT8) (AcpiGbl_FACP->Gpe1Base + MUL_8 (i)); + (UINT8) (AcpiGbl_FADT->Gpe1Base + MUL_8 (i)); for (j = 0; j < 8; j++) { @@ -531,9 +559,9 @@ } DEBUG_PRINT (ACPI_INFO, - ("GPE registers: %d@%X (Blk0) %d@%X (Blk1)\n", - Gpe0RegisterCount, AcpiGbl_FACP->Gpe0Blk, Gpe1RegisterCount, - AcpiGbl_FACP->Gpe1Blk)); + ("GPE registers: %d@%p (Blk0) %d@%p (Blk1)\n", + Gpe0RegisterCount, AcpiGbl_FADT->XGpe0Blk.Address, Gpe1RegisterCount, + AcpiGbl_FADT->XGpe1Blk.Address)); return_ACPI_STATUS (AE_OK); } @@ -561,7 +589,7 @@ * ******************************************************************************/ -ACPI_STATUS +static ACPI_STATUS AcpiEvSaveMethodInfo ( ACPI_HANDLE ObjHandle, UINT32 Level, @@ -686,31 +714,6 @@ /****************************************************************************** * - * FUNCTION: AcpiEvGpeCleanup - * - * PARAMETERS: None - * - * RETURN: None - * - * DESCRIPTION: Cleanup in preparation for unload. - * - ******************************************************************************/ - -void -AcpiEvGpeCleanup (void) -{ - FUNCTION_TRACE ("EvGpeCleanup"); - - - AcpiCmFree (AcpiGbl_GpeRegisters); - AcpiCmFree (AcpiGbl_GpeInfo); - - return_VOID; -} - - -/****************************************************************************** - * * FUNCTION: AcpiEvGpeDetect * * PARAMETERS: None @@ -799,7 +802,7 @@ * ******************************************************************************/ -void +static void AcpiEvAsynchExecuteGpeMethod ( void *Context) { @@ -817,21 +820,11 @@ AcpiCmReleaseMutex (ACPI_MTX_EVENTS); /* - * Function Handler (e.g. EC): - * --------------------------- - * Execute the installed function handler to handle this event. - */ - if (GpeInfo.Handler) - { - GpeInfo.Handler (GpeInfo.Context); - } - - /* * Method Handler (_Lxx, _Exx): * ---------------------------- * AcpiEvaluate the _Lxx/_Exx control method that corresponds to this GPE. */ - else if (GpeInfo.MethodHandle) + if (GpeInfo.MethodHandle) { AcpiNsEvaluateByHandle (GpeInfo.MethodHandle, NULL, NULL); } @@ -843,7 +836,7 @@ * that edge-triggered events are cleared prior to calling (via DPC) * this function. */ - if (GpeInfo.Type | ACPI_EVENT_LEVEL_TRIGGERED) + if (GpeInfo.Type & ACPI_EVENT_LEVEL_TRIGGERED) { AcpiHwClearGpe (GpeNumber); } @@ -907,7 +900,7 @@ * level-triggered events are cleared after the GPE is serviced * (see AcpiEvAsynchExecuteGpeMethod). */ - if (AcpiGbl_GpeInfo [GpeNumber].Type | ACPI_EVENT_EDGE_TRIGGERED) + if (AcpiGbl_GpeInfo[GpeNumber].Type & ACPI_EVENT_EDGE_TRIGGERED) { AcpiHwClearGpe (GpeNumber); } @@ -918,8 +911,7 @@ * Queue the handler, which is either an installable function handler * (e.g. EC) or a control method (e.g. _Lxx/_Exx) for later execution. */ - if (AcpiGbl_GpeInfo [GpeNumber].Handler || - AcpiGbl_GpeInfo [GpeNumber].MethodHandle) + if (AcpiGbl_GpeInfo[GpeNumber].MethodHandle) { if (ACPI_FAILURE (AcpiOsQueueForExecution (OSD_PRIORITY_GPE, AcpiEvAsynchExecuteGpeMethod, @@ -935,7 +927,24 @@ GpeNumber)); } } + else if (AcpiGbl_GpeInfo[GpeNumber].Handler) + { + ACPI_GPE_LEVEL_INFO GpeInfo; + /* + * Function Handler (e.g. EC): + * --------------------------- + * Execute the installed function handler to handle this event. + * Without queueing. + */ + AcpiCmAcquireMutex (ACPI_MTX_EVENTS); + GpeInfo = AcpiGbl_GpeInfo [GpeNumber]; + AcpiCmReleaseMutex (ACPI_MTX_EVENTS); + if (GpeInfo.Handler) + { + GpeInfo.Handler (GpeInfo.Context); + } + } /* * Non Handled GPEs: * ----------------- diff -ruN acpica-unix-20001020/Subsystem/Events/evmisc.c acpica-unix-20001115/Subsystem/Events/evmisc.c --- acpica-unix-20001020/Subsystem/Events/evmisc.c Sat Oct 21 06:44:55 2000 +++ acpica-unix-20001115/Subsystem/Events/evmisc.c Thu Nov 16 09:18:40 2000 @@ -2,7 +2,7 @@ * * Module Name: evmisc - ACPI device notification handler dispatch * and ACPI Global Lock support - * $Revision: 15 $ + * $Revision: 19 $ * *****************************************************************************/ @@ -268,7 +268,7 @@ * **************************************************************************/ -void +static void AcpiEvGlobalLockThread ( void *Context) { @@ -297,7 +297,7 @@ * **************************************************************************/ -UINT32 +static UINT32 AcpiEvGlobalLockHandler ( void *Context) { @@ -311,7 +311,7 @@ * take another interrupt when it becomes free. */ - GlobalLock = &AcpiGbl_FACS->GlobalLock; + GlobalLock = AcpiGbl_FACS->GlobalLock; ACPI_ACQUIRE_GLOBAL_LOCK (GlobalLock, Acquired); if (Acquired) { @@ -398,7 +398,7 @@ /* We must acquire the actual hardware lock */ - GlobalLock = &AcpiGbl_FACS->GlobalLock; + GlobalLock = AcpiGbl_FACS->GlobalLock; ACPI_ACQUIRE_GLOBAL_LOCK (GlobalLock, Acquired); if (Acquired) { @@ -467,7 +467,7 @@ * release */ - GlobalLock = &AcpiGbl_FACS->GlobalLock; + GlobalLock = AcpiGbl_FACS->GlobalLock; ACPI_RELEASE_GLOBAL_LOCK (GlobalLock, Pending); AcpiGbl_GlobalLockAcquired = FALSE; @@ -477,8 +477,8 @@ */ if (Pending) { - AcpiHwRegisterAccess (ACPI_WRITE, ACPI_MTX_LOCK, - PM1_CONTROL | GBL_RLS, 1); + AcpiHwRegisterBitAccess (ACPI_WRITE, ACPI_MTX_LOCK, + GBL_RLS, 1); } } diff -ruN acpica-unix-20001020/Subsystem/Events/evregion.c acpica-unix-20001115/Subsystem/Events/evregion.c --- acpica-unix-20001020/Subsystem/Events/evregion.c Sat Oct 21 06:44:55 2000 +++ acpica-unix-20001115/Subsystem/Events/evregion.c Thu Nov 16 09:18:40 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * - * Module Name: evregion - ACPI AddressSpace / OpRegion handler dispatch - * $Revision: 85 $ + * Module Name: evregion - ACPI AddressSpace (OpRegion) handler dispatch + * $Revision: 88 $ * *****************************************************************************/ @@ -211,7 +211,7 @@ * *************************************************************************/ -ACPI_STATUS +static ACPI_STATUS AcpiEvExecuteRegMethod ( ACPI_OPERAND_OBJECT *RegionObj, UINT32 Function) @@ -289,7 +289,7 @@ AcpiEvAddressSpaceDispatch ( ACPI_OPERAND_OBJECT *RegionObj, UINT32 Function, - ACPI_INTEGER Address, + ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT32 *Value) { diff -ruN acpica-unix-20001020/Subsystem/Events/evrgnini.c acpica-unix-20001115/Subsystem/Events/evrgnini.c --- acpica-unix-20001020/Subsystem/Events/evrgnini.c Sat Oct 21 06:44:55 2000 +++ acpica-unix-20001115/Subsystem/Events/evrgnini.c Thu Nov 16 09:18:40 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * - * Module Name: evrgnini- ACPI AddressSpace / OpRegion init - * $Revision: 27 $ + * Module Name: evrgnini- ACPI AddressSpace (OpRegion) init + * $Revision: 29 $ * *****************************************************************************/ @@ -329,16 +329,16 @@ while (Node != AcpiGbl_RootNode) { Status = AcpiCmExecute_HID(Node, &ObjectHID); - + if (ACPI_SUCCESS (Status)) { - if (!(STRNCMP(ObjectHID.Buffer, PCI_ROOT_HID_STRING, + if (!(STRNCMP(ObjectHID.Buffer, PCI_ROOT_HID_STRING, sizeof (PCI_ROOT_HID_STRING)))) { AcpiInstallAddressSpaceHandler(Node, ADDRESS_SPACE_PCI_CONFIG, ACPI_DEFAULT_HANDLER, NULL, NULL); - + break; } } @@ -350,7 +350,7 @@ { Node = HandlerObj->AddrHandler.Node; } - + Status = AcpiCmEvaluateNumericObject (METHOD_NAME__SEG, Node, &Temp); if (ACPI_SUCCESS (Status)) { diff -ruN acpica-unix-20001020/Subsystem/Events/evsci.c acpica-unix-20001115/Subsystem/Events/evsci.c --- acpica-unix-20001020/Subsystem/Events/evsci.c Sat Oct 21 06:44:55 2000 +++ acpica-unix-20001115/Subsystem/Events/evsci.c Thu Nov 16 09:18:40 2000 @@ -2,7 +2,7 @@ * * Module Name: evsci - System Control Interrupt configuration and * legacy to ACPI mode state transition functions - * $Revision: 60 $ + * $Revision: 67 $ * ******************************************************************************/ @@ -150,7 +150,7 @@ * ******************************************************************************/ -UINT32 +static UINT32 AcpiEvSciHandler (void *Context) { UINT32 InterruptHandled = INTERRUPT_NOT_HANDLED; @@ -163,7 +163,7 @@ * Make sure that ACPI is enabled by checking SCI_EN. Note that we are * required to treat the SCI interrupt as sharable, level, active low. */ - if (!AcpiHwRegisterAccess (ACPI_READ, ACPI_MTX_DO_NOT_LOCK, SCI_EN)) + if (!AcpiHwRegisterBitAccess (ACPI_READ, ACPI_MTX_DO_NOT_LOCK, SCI_EN)) { /* ACPI is not enabled; this interrupt cannot be for us */ @@ -209,7 +209,7 @@ FUNCTION_TRACE ("EvInstallSciHandler"); - Except = AcpiOsInstallInterruptHandler ((UINT32) AcpiGbl_FACP->SciInt, + Except = AcpiOsInstallInterruptHandler ((UINT32) AcpiGbl_FADT->SciInt, AcpiEvSciHandler, NULL); @@ -269,7 +269,7 @@ #endif - AcpiOsRemoveInterruptHandler ((UINT32) AcpiGbl_FACP->SciInt, + AcpiOsRemoveInterruptHandler ((UINT32) AcpiGbl_FADT->SciInt, AcpiEvSciHandler); return_ACPI_STATUS (AE_OK); @@ -347,21 +347,11 @@ { /* Restore the fixed events */ - if (AcpiOsIn16 (AcpiGbl_FACP->Pm1aEvtBlk + 2) != - AcpiGbl_Pm1EnableRegisterSave) - { - AcpiOsOut16 ((AcpiGbl_FACP->Pm1aEvtBlk + 2), - AcpiGbl_Pm1EnableRegisterSave); - } - - if (AcpiGbl_FACP->Pm1bEvtBlk) - { - if (AcpiOsIn16 (AcpiGbl_FACP->Pm1bEvtBlk + 2) != + if (AcpiHwRegisterRead (ACPI_MTX_LOCK, PM1_EN) != AcpiGbl_Pm1EnableRegisterSave) - { - AcpiOsOut16 ((AcpiGbl_FACP->Pm1bEvtBlk + 2), - AcpiGbl_Pm1EnableRegisterSave); - } + { + AcpiHwRegisterWrite (ACPI_MTX_LOCK, PM1_EN, + AcpiGbl_Pm1EnableRegisterSave); } @@ -372,29 +362,27 @@ /* Now restore the GPEs */ - for (Index = 0; Index < DIV_2 (AcpiGbl_FACP->Gpe0BlkLen); Index++) + for (Index = 0; Index < DIV_2 (AcpiGbl_FADT->Gpe0BlkLen); Index++) { - if (AcpiOsIn8 (AcpiGbl_FACP->Gpe0Blk + - DIV_2 (AcpiGbl_FACP->Gpe0BlkLen)) != - AcpiGbl_Gpe0EnableRegisterSave[Index]) + if (AcpiHwRegisterRead (ACPI_MTX_LOCK, GPE0_EN_BLOCK | Index) != + AcpiGbl_Gpe0EnableRegisterSave[Index]) { - AcpiOsOut8 ((AcpiGbl_FACP->Gpe0Blk + - DIV_2 (AcpiGbl_FACP->Gpe0BlkLen)), - AcpiGbl_Gpe0EnableRegisterSave[Index]); + AcpiHwRegisterWrite (ACPI_MTX_LOCK, GPE0_EN_BLOCK | Index, + AcpiGbl_Gpe0EnableRegisterSave[Index]); } } - if (AcpiGbl_FACP->Gpe1Blk && AcpiGbl_FACP->Gpe1BlkLen) + /* GPE 1 present? */ + + if (AcpiGbl_FADT->Gpe1BlkLen) { - for (Index = 0; Index < DIV_2 (AcpiGbl_FACP->Gpe1BlkLen); Index++) + for (Index = 0; Index < DIV_2 (AcpiGbl_FADT->Gpe1BlkLen); Index++) { - if (AcpiOsIn8 (AcpiGbl_FACP->Gpe1Blk + - DIV_2 (AcpiGbl_FACP->Gpe1BlkLen)) != + if (AcpiHwRegisterRead (ACPI_MTX_LOCK, GPE1_EN_BLOCK | Index) != AcpiGbl_Gpe1EnableRegisterSave[Index]) { - AcpiOsOut8 ((AcpiGbl_FACP->Gpe1Blk + - DIV_2 (AcpiGbl_FACP->Gpe1BlkLen)), - AcpiGbl_Gpe1EnableRegisterSave[Index]); + AcpiHwRegisterWrite (ACPI_MTX_LOCK, GPE1_EN_BLOCK | Index, + AcpiGbl_Gpe1EnableRegisterSave[Index]); } } } diff -ruN acpica-unix-20001020/Subsystem/Events/evxface.c acpica-unix-20001115/Subsystem/Events/evxface.c --- acpica-unix-20001020/Subsystem/Events/evxface.c Sat Oct 21 06:44:55 2000 +++ acpica-unix-20001115/Subsystem/Events/evxface.c Thu Nov 16 09:18:40 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evxface - External interfaces for ACPI events - * $Revision: 91 $ + * $Revision: 96 $ * *****************************************************************************/ @@ -179,11 +179,11 @@ AcpiGbl_FixedEventHandlers[Event].Handler = Handler; AcpiGbl_FixedEventHandlers[Event].Context = Context; - if (1 != AcpiHwRegisterAccess (ACPI_WRITE, - ACPI_MTX_LOCK, Event + TMR_EN, 1)) + Status = AcpiEnableEvent(Event, ACPI_EVENT_FIXED); + + if (!ACPI_SUCCESS(Status)) { - DEBUG_PRINT (ACPI_WARN, - ("Could not write to fixed event enable register.\n")); + DEBUG_PRINT (ACPI_WARN, ("Could not enable fixed event.\n")); /* Remove the handler */ @@ -239,13 +239,16 @@ /* Disable the event before removing the handler - just in case... */ - if (0 != AcpiHwRegisterAccess (ACPI_WRITE, - ACPI_MTX_LOCK, Event + TMR_EN, 0)) + Status = AcpiDisableEvent(Event, ACPI_EVENT_FIXED); + + if (!ACPI_SUCCESS(Status)) { DEBUG_PRINT (ACPI_WARN, ("Could not write to fixed event enable register.\n")); + Status = AE_ERROR; - goto Cleanup; + AcpiCmReleaseMutex (ACPI_MTX_EVENTS); + return_ACPI_STATUS (Status); } /* Remove the handler */ @@ -255,7 +258,6 @@ DEBUG_PRINT (ACPI_INFO, ("Disabled fixed event %d.\n", Event)); -Cleanup: AcpiCmReleaseMutex (ACPI_MTX_EVENTS); return_ACPI_STATUS (Status); } diff -ruN acpica-unix-20001020/Subsystem/Events/evxfevnt.c acpica-unix-20001115/Subsystem/Events/evxfevnt.c --- acpica-unix-20001020/Subsystem/Events/evxfevnt.c Sat Oct 21 06:44:55 2000 +++ acpica-unix-20001115/Subsystem/Events/evxfevnt.c Thu Nov 16 09:18:40 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evxfevnt - External Interfaces, ACPI event disable/enable - * $Revision: 22 $ + * $Revision: 26 $ * *****************************************************************************/ @@ -287,7 +287,14 @@ * enable register bit) */ - AcpiHwRegisterAccess (ACPI_WRITE, TRUE, RegisterId, 1); + AcpiHwRegisterBitAccess (ACPI_WRITE, ACPI_MTX_LOCK, RegisterId, 1); + + if (1 != AcpiHwRegisterBitAccess(ACPI_READ, ACPI_MTX_LOCK, RegisterId)) + { + DEBUG_PRINT(ACPI_ERROR, ("Fixed event bit clear when it should be set,\n")); + return_ACPI_STATUS (AE_ERROR); + } + break; @@ -384,7 +391,14 @@ * enable register bit) */ - AcpiHwRegisterAccess (ACPI_WRITE, TRUE, RegisterId, 0); + AcpiHwRegisterBitAccess (ACPI_WRITE, ACPI_MTX_LOCK, RegisterId, 0); + + if (0 != AcpiHwRegisterBitAccess(ACPI_READ, ACPI_MTX_LOCK, RegisterId)) + { + DEBUG_PRINT(ACPI_ERROR, ("Fixed event bit set when it should be clear,\n")); + return_ACPI_STATUS (AE_ERROR); + } + break; @@ -478,7 +492,7 @@ * status register bit) */ - AcpiHwRegisterAccess (ACPI_WRITE, TRUE, RegisterId, 1); + AcpiHwRegisterBitAccess (ACPI_WRITE, ACPI_MTX_LOCK, RegisterId, 1); break; @@ -579,7 +593,7 @@ /* Get the status of the requested fixed event */ - *EventStatus = AcpiHwRegisterAccess (ACPI_READ, TRUE, RegisterId); + *EventStatus = AcpiHwRegisterBitAccess (ACPI_READ, ACPI_MTX_LOCK, RegisterId); break; diff -ruN acpica-unix-20001020/Subsystem/Hardware/hwacpi.c acpica-unix-20001115/Subsystem/Hardware/hwacpi.c --- acpica-unix-20001020/Subsystem/Hardware/hwacpi.c Sat Oct 21 06:44:55 2000 +++ acpica-unix-20001115/Subsystem/Hardware/hwacpi.c Thu Nov 16 09:18:41 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: hwacpi - ACPI hardware functions - mode and timer - * $Revision: 24 $ + * $Revision: 31 $ * *****************************************************************************/ @@ -149,11 +149,11 @@ /* We must have the ACPI tables by the time we get here */ - if (!AcpiGbl_FACP) + if (!AcpiGbl_FADT) { AcpiGbl_RestoreAcpiChipset = FALSE; - DEBUG_PRINT (ACPI_ERROR, ("HwInitialize: No FACP!\n")); + DEBUG_PRINT (ACPI_ERROR, ("HwInitialize: No FADT!\n")); return_ACPI_STATUS (AE_NO_ACPI_TABLES); } @@ -217,27 +217,21 @@ /* Target system supports ACPI mode */ /* - * The purpose of this block of code is to save the initial state + * The purpose of this code is to save the initial state * of the ACPI event enable registers. An exit function will be * registered which will restore this state when the application * exits. The exit function will also clear all of the ACPI event * status bits prior to restoring the original mode. * * The location of the PM1aEvtBlk enable registers is defined as the - * base of PM1aEvtBlk + PM1aEvtBlkLength / 2. Since the spec further + * base of PM1aEvtBlk + DIV_2(PM1aEvtBlkLength). Since the spec further * fully defines the PM1aEvtBlk to be a total of 4 bytes, the offset * for the enable registers is always 2 from the base. It is hard * coded here. If this changes in the spec, this code will need to * be modified. The PM1bEvtBlk behaves as expected. */ - AcpiGbl_Pm1EnableRegisterSave = - AcpiOsIn16 ((AcpiGbl_FACP->Pm1aEvtBlk + 2)); - if (AcpiGbl_FACP->Pm1bEvtBlk) - { - AcpiGbl_Pm1EnableRegisterSave |= - AcpiOsIn16 ((AcpiGbl_FACP->Pm1bEvtBlk + 2)); - } + AcpiGbl_Pm1EnableRegisterSave = (UINT16) AcpiHwRegisterRead (ACPI_MTX_LOCK, PM1_EN); /* @@ -245,12 +239,12 @@ * block is not fixed, so the buffer must be allocated with malloc */ - if (AcpiGbl_FACP->Gpe0Blk && AcpiGbl_FACP->Gpe0BlkLen) + if (AcpiGbl_FADT->XGpe0Blk.Address && AcpiGbl_FADT->Gpe0BlkLen) { - /* GPE0 specified in FACP */ + /* GPE0 specified in FADT */ AcpiGbl_Gpe0EnableRegisterSave = - AcpiCmAllocate (DIV_2 (AcpiGbl_FACP->Gpe0BlkLen)); + AcpiCmAllocate (DIV_2 (AcpiGbl_FADT->Gpe0BlkLen)); if (!AcpiGbl_Gpe0EnableRegisterSave) { return_ACPI_STATUS (AE_NO_MEMORY); @@ -258,11 +252,10 @@ /* Save state of GPE0 enable bits */ - for (Index = 0; Index < DIV_2 (AcpiGbl_FACP->Gpe0BlkLen); Index++) + for (Index = 0; Index < DIV_2 (AcpiGbl_FADT->Gpe0BlkLen); Index++) { AcpiGbl_Gpe0EnableRegisterSave[Index] = - AcpiOsIn8 (AcpiGbl_FACP->Gpe0Blk + - DIV_2 (AcpiGbl_FACP->Gpe0BlkLen)); + (UINT8) AcpiHwRegisterRead (ACPI_MTX_LOCK, GPE0_EN_BLOCK | Index); } } @@ -271,12 +264,12 @@ AcpiGbl_Gpe0EnableRegisterSave = NULL; } - if (AcpiGbl_FACP->Gpe1Blk && AcpiGbl_FACP->Gpe1BlkLen) + if (AcpiGbl_FADT->XGpe1Blk.Address && AcpiGbl_FADT->Gpe1BlkLen) { /* GPE1 defined */ AcpiGbl_Gpe1EnableRegisterSave = - AcpiCmAllocate (DIV_2 (AcpiGbl_FACP->Gpe1BlkLen)); + AcpiCmAllocate (DIV_2 (AcpiGbl_FADT->Gpe1BlkLen)); if (!AcpiGbl_Gpe1EnableRegisterSave) { return_ACPI_STATUS (AE_NO_MEMORY); @@ -284,11 +277,10 @@ /* save state of GPE1 enable bits */ - for (Index = 0; Index < DIV_2 (AcpiGbl_FACP->Gpe1BlkLen); Index++) + for (Index = 0; Index < DIV_2 (AcpiGbl_FADT->Gpe1BlkLen); Index++) { AcpiGbl_Gpe1EnableRegisterSave[Index] = - AcpiOsIn8 (AcpiGbl_FACP->Gpe1Blk + - DIV_2 (AcpiGbl_FACP->Gpe1BlkLen)); + (UINT8) AcpiHwRegisterRead (ACPI_MTX_LOCK, GPE1_EN_BLOCK | Index); } } @@ -329,7 +321,7 @@ { /* BIOS should have disabled ALL fixed and GP events */ - AcpiOsOut8 (AcpiGbl_FACP->SmiCmd, AcpiGbl_FACP->AcpiEnable); + AcpiOsOut8 (AcpiGbl_FADT->SmiCmd, AcpiGbl_FADT->AcpiEnable); DEBUG_PRINT (ACPI_INFO, ("Attempting to enable ACPI mode\n")); } @@ -340,7 +332,7 @@ * enable bits to default */ - AcpiOsOut8 (AcpiGbl_FACP->SmiCmd, AcpiGbl_FACP->AcpiDisable); + AcpiOsOut8 (AcpiGbl_FADT->SmiCmd, AcpiGbl_FADT->AcpiDisable); DEBUG_PRINT (ACPI_INFO, ("Attempting to enable Legacy (non-ACPI) mode\n")); } @@ -375,7 +367,7 @@ FUNCTION_TRACE ("HwGetMode"); - if (AcpiHwRegisterAccess (ACPI_READ, ACPI_MTX_LOCK, SCI_EN)) + if (AcpiHwRegisterBitAccess (ACPI_READ, ACPI_MTX_LOCK, SCI_EN)) { return_VALUE (SYS_MODE_ACPI); } @@ -468,7 +460,7 @@ FUNCTION_TRACE ("AcpiPmtTicks"); - Ticks = AcpiOsIn32 (AcpiGbl_FACP->PmTmrBlk); + Ticks = AcpiOsIn32 ((ACPI_IO_ADDRESS) AcpiGbl_FADT->XPmTmrBlk.Address); return_VALUE (Ticks); } @@ -491,7 +483,7 @@ { FUNCTION_TRACE ("AcpiPmtResolution"); - if (0 == AcpiGbl_FACP->TmrValExt) + if (0 == AcpiGbl_FADT->TmrValExt) { return_VALUE (24); } diff -ruN acpica-unix-20001020/Subsystem/Hardware/hwcpu32.c acpica-unix-20001115/Subsystem/Hardware/hwcpu32.c --- acpica-unix-20001020/Subsystem/Hardware/hwcpu32.c Sat Oct 21 06:44:55 2000 +++ acpica-unix-20001115/Subsystem/Hardware/hwcpu32.c Thu Nov 16 09:18:41 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: hwcpu32.c - CPU support for IA32 (Throttling, CxStates) - * $Revision: 33 $ + * $Revision: 39 $ * *****************************************************************************/ @@ -226,7 +226,7 @@ * We have to do something useless after reading LVL2 because chipsets * cannot guarantee that STPCLK# gets asserted in time to freeze execution. */ - AcpiOsIn8 ((ACPI_IO_ADDRESS) AcpiGbl_FACP->Pm2CntBlk); + AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, PM2_CONTROL); /* * Compute Time in C2: @@ -265,7 +265,6 @@ UINT32 *PmTimerTicks) { UINT32 Timer = 0; - UINT8 Pm2CntBlk = 0; UINT32 BusMasterStatus = 0; @@ -282,12 +281,12 @@ * eventually cause a demotion to C2 */ if (1 == (BusMasterStatus = - AcpiHwRegisterAccess (ACPI_READ, ACPI_MTX_LOCK, BM_STS))) + AcpiHwRegisterBitAccess (ACPI_READ, ACPI_MTX_LOCK, BM_STS))) { /* * Clear the BM_STS bit by setting it. */ - AcpiHwRegisterAccess (ACPI_WRITE, ACPI_MTX_LOCK, BM_STS, 1); + AcpiHwRegisterBitAccess (ACPI_WRITE, ACPI_MTX_LOCK, BM_STS, 1); *PmTimerTicks = 0; return (AE_OK); } @@ -302,9 +301,7 @@ * ---------------------- * Set the PM2_CNT.ARB_DIS bit (bit #0), preserving all other bits. */ - Pm2CntBlk = AcpiOsIn8 ((ACPI_IO_ADDRESS) AcpiGbl_FACP->Pm2CntBlk); - Pm2CntBlk |= 0x01; - AcpiOsOut8 ((ACPI_IO_ADDRESS) AcpiGbl_FACP->Pm2CntBlk, Pm2CntBlk); + AcpiHwRegisterBitAccess(ACPI_WRITE, ACPI_MTX_LOCK, ARB_DIS, 1); /* * Get the timer base before entering C state @@ -324,8 +321,7 @@ * We have to do something useless after reading LVL3 because chipsets * cannot guarantee that STPCLK# gets asserted in time to freeze execution. */ - AcpiOsIn8 ((ACPI_IO_ADDRESS) AcpiGbl_FACP->Pm2CntBlk); - + AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, PM2_CONTROL); /* * Immediately compute the time in the C state */ @@ -336,9 +332,7 @@ * ------------------------ * Clear the PM2_CNT.ARB_DIS bit (bit #0), preserving all other bits. */ - Pm2CntBlk = AcpiOsIn8 ((ACPI_IO_ADDRESS) AcpiGbl_FACP->Pm2CntBlk); - Pm2CntBlk &= 0xFE; - AcpiOsOut8 ((ACPI_IO_ADDRESS) AcpiGbl_FACP->Pm2CntBlk, Pm2CntBlk); + AcpiHwRegisterBitAccess(ACPI_WRITE, ACPI_MTX_LOCK, ARB_DIS, 0); /* TBD: [Unhandled]: Support 24-bit timers (this algorithm assumes 32-bit) */ @@ -431,7 +425,7 @@ switch (CxState) { case 3: - AcpiHwRegisterAccess (ACPI_WRITE, ACPI_MTX_LOCK, BM_RLD, 1); + AcpiHwRegisterBitAccess (ACPI_WRITE, ACPI_MTX_LOCK, BM_RLD, 1); break; } @@ -445,7 +439,7 @@ switch (AcpiHwActiveCxState) { case 3: - AcpiHwRegisterAccess (ACPI_WRITE, ACPI_MTX_LOCK, BM_RLD, 0); + AcpiHwRegisterBitAccess (ACPI_WRITE, ACPI_MTX_LOCK, BM_RLD, 0); break; } @@ -511,18 +505,18 @@ * and on SMP systems when P_LVL2_UP (which indicates C2 only on UP) * is not set. */ - if (AcpiGbl_FACP->Plvl2Lat <= 100) + if (AcpiGbl_FADT->Plvl2Lat <= 100) { if (!SMP_system) { AcpiHwCxHandlers[2] = AcpiHwEnterC2; - CxStates[2] = AcpiGbl_FACP->Plvl2Lat; + CxStates[2] = AcpiGbl_FADT->Plvl2Lat; } - else if (!AcpiGbl_FACP->Plvl2Up) + else if (!AcpiGbl_FADT->Plvl2Up) { AcpiHwCxHandlers[2] = AcpiHwEnterC2; - CxStates[2] = AcpiGbl_FACP->Plvl2Lat; + CxStates[2] = AcpiGbl_FADT->Plvl2Lat; } } @@ -537,13 +531,13 @@ * cannot be used on SMP systems, and flushing caches (e.g. WBINVD) * is simply too costly (at this time). */ - if (AcpiGbl_FACP->Plvl3Lat <= 1000) + if (AcpiGbl_FADT->Plvl3Lat <= 1000) { - if (!SMP_system && (AcpiGbl_FACP->Pm2CntBlk && - AcpiGbl_FACP->Pm2CntLen)) + if (!SMP_system && (AcpiGbl_FADT->XPm2CntBlk.Address && + AcpiGbl_FADT->Pm2CntLen)) { AcpiHwCxHandlers[3] = AcpiHwEnterC3; - CxStates[3] = AcpiGbl_FACP->Plvl3Lat; + CxStates[3] = AcpiGbl_FADT->Plvl3Lat; } } diff -ruN acpica-unix-20001020/Subsystem/Hardware/hwgpe.c acpica-unix-20001115/Subsystem/Hardware/hwgpe.c --- acpica-unix-20001020/Subsystem/Hardware/hwgpe.c Sat Oct 21 06:44:55 2000 +++ acpica-unix-20001115/Subsystem/Hardware/hwgpe.c Thu Nov 16 09:18:41 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: hwgpe - Low level GPE enable/disable/clear functions - * $Revision: 22 $ + * $Revision: 25 $ * *****************************************************************************/ @@ -123,9 +123,6 @@ MODULE_NAME ("hwgpe") -UINT8 DecodeTo8bit [8] = {1,2,4,8,16,32,64,128}; - - /****************************************************************************** * * FUNCTION: AcpiHwEnableGpe @@ -154,7 +151,7 @@ /* * Figure out the bit offset for this GPE within the target register. */ - BitMask = DecodeTo8bit [MOD_8 (GpeNumber)]; + BitMask = AcpiGbl_DecodeTo8bit [MOD_8 (GpeNumber)]; /* * Read the current value of the register, set the appropriate bit @@ -194,7 +191,7 @@ /* * Figure out the bit offset for this GPE within the target register. */ - BitMask = DecodeTo8bit [MOD_8 (GpeNumber)]; + BitMask = AcpiGbl_DecodeTo8bit [MOD_8 (GpeNumber)]; /* * Read the current value of the register, clear the appropriate bit, @@ -233,7 +230,7 @@ /* * Figure out the bit offset for this GPE within the target register. */ - BitMask = DecodeTo8bit [MOD_8 (GpeNumber)]; + BitMask = AcpiGbl_DecodeTo8bit [MOD_8 (GpeNumber)]; /* * Write a one to the appropriate bit in the status register to @@ -279,7 +276,7 @@ /* * Figure out the bit offset for this GPE within the target register. */ - BitMask = DecodeTo8bit [MOD_8 (GpeNumber)]; + BitMask = AcpiGbl_DecodeTo8bit [MOD_8 (GpeNumber)]; /* * Enabled?: diff -ruN acpica-unix-20001020/Subsystem/Hardware/hwregs.c acpica-unix-20001115/Subsystem/Hardware/hwregs.c --- acpica-unix-20001020/Subsystem/Hardware/hwregs.c Sat Oct 21 06:44:56 2000 +++ acpica-unix-20001115/Subsystem/Hardware/hwregs.c Thu Nov 16 09:18:41 2000 @@ -3,7 +3,7 @@ * * Module Name: hwregs - Read/write access functions for the various ACPI * control and status registers. - * $Revision: 71 $ + * $Revision: 81 $ * ******************************************************************************/ @@ -128,8 +128,8 @@ /* This matches the #defines in actypes.h. */ -NATIVE_CHAR *SleepStateTable[] = {"\\_S0_","\\_S1_","\\_S2_","\\_S3_", - "\\_S4_","\\_S4B","\\_S5_"}; +NATIVE_CHAR *SleepStateTable[] = {"\\_S0_","\\_S1_","\\_S2_","\\_S3_", + "\\_S4_","\\_S4B","\\_S5_"}; /******************************************************************************* @@ -145,7 +145,7 @@ * ******************************************************************************/ -UINT32 +static UINT32 AcpiHwGetBitShift ( UINT32 Mask) { @@ -185,38 +185,42 @@ DEBUG_PRINT (TRACE_IO, ("About to write %04X to %04X\n", - ALL_FIXED_STS_BITS, (UINT16) AcpiGbl_FACP->Pm1aEvtBlk)); + ALL_FIXED_STS_BITS, + (UINT16) AcpiGbl_FADT->XPm1aEvtBlk.Address)); AcpiCmAcquireMutex (ACPI_MTX_HARDWARE); - AcpiOsOut16 (AcpiGbl_FACP->Pm1aEvtBlk, (UINT16) ALL_FIXED_STS_BITS); + AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, PM1_STS, ALL_FIXED_STS_BITS); + - if (AcpiGbl_FACP->Pm1bEvtBlk) + if (AcpiGbl_FADT->XPm1bEvtBlk.Address) { - AcpiOsOut16 ((UINT16) AcpiGbl_FACP->Pm1bEvtBlk, + AcpiOsOut16 ((ACPI_IO_ADDRESS) AcpiGbl_FADT->XPm1bEvtBlk.Address, (UINT16) ALL_FIXED_STS_BITS); } /* now clear the GPE Bits */ - if (AcpiGbl_FACP->Gpe0BlkLen) + if (AcpiGbl_FADT->Gpe0BlkLen) { - GpeLength = (UINT16) DIV_2 (AcpiGbl_FACP->Gpe0BlkLen); + GpeLength = (UINT16) DIV_2 (AcpiGbl_FADT->Gpe0BlkLen); for (Index = 0; Index < GpeLength; Index++) { - AcpiOsOut8 ((AcpiGbl_FACP->Gpe0Blk + Index), (UINT8) 0xff); + AcpiOsOut8 ((ACPI_IO_ADDRESS) (AcpiGbl_FADT->XGpe0Blk.Address + Index), + (UINT8) 0xff); } } - if (AcpiGbl_FACP->Gpe1BlkLen) + if (AcpiGbl_FADT->Gpe1BlkLen) { - GpeLength = (UINT16) DIV_2 (AcpiGbl_FACP->Gpe1BlkLen); + GpeLength = (UINT16) DIV_2 (AcpiGbl_FADT->Gpe1BlkLen); for (Index = 0; Index < GpeLength; Index++) { - AcpiOsOut8 ((AcpiGbl_FACP->Gpe1Blk + Index), (UINT8) 0xff); + AcpiOsOut8 ((ACPI_IO_ADDRESS) (AcpiGbl_FADT->XGpe1Blk.Address + Index), + (UINT8) 0xff); } } @@ -332,23 +336,23 @@ /******************************************************************************* * - * FUNCTION: AcpiHwRegisterAccess + * FUNCTION: AcpiHwRegisterBitAccess * * PARAMETERS: ReadWrite - Either ACPI_READ or ACPI_WRITE. * UseLock - Lock the hardware - * RegisterId - index of ACPI register to access + * RegisterId - index of ACPI Register to access * Value - (only used on write) value to write to the - * register. Shifted all the way right. + * Register. Shifted all the way right. * - * RETURN: Value written to or read from specified register. This value + * RETURN: Value written to or read from specified Register. This value * is shifted all the way right. * - * DESCRIPTION: Generic ACPI register read/write function. + * DESCRIPTION: Generic ACPI Register read/write function. * ******************************************************************************/ UINT32 -AcpiHwRegisterAccess ( +AcpiHwRegisterBitAccess ( NATIVE_UINT ReadWrite, BOOLEAN UseLock, UINT32 RegisterId, @@ -357,10 +361,8 @@ UINT32 RegisterValue = 0; UINT32 Mask = 0; UINT32 Value = 0; - ACPI_IO_ADDRESS GpeReg = 0; - - FUNCTION_TRACE ("HwRegisterIO"); + FUNCTION_TRACE ("HwRegisterBitAccess"); if (ReadWrite == ACPI_WRITE) @@ -372,224 +374,128 @@ va_end (marker); } - /* - * TBD: [Restructure] May want to split the AcpiEvent code and the - * Control code - */ + if (ACPI_MTX_LOCK == UseLock) { + AcpiCmAcquireMutex (ACPI_MTX_HARDWARE); + } /* * Decode the Register ID + * Register id = Register block id | bit id + * + * Check bit id to fine locate Register offset. + * check Mask to determine Register offset, and then read-write. */ - switch (RegisterId & REGISTER_BLOCK_MASK) + switch (REGISTER_BLOCK_ID(RegisterId)) { - case PM1_EVT: + case PM1_STS: - if (RegisterId < TMR_EN) + switch (RegisterId) { - /* status register */ - - if (ACPI_MTX_LOCK == UseLock) - { - AcpiCmAcquireMutex (ACPI_MTX_HARDWARE); - } + case TMR_STS: + Mask = TMR_STS_MASK; + break; + case BM_STS: + Mask = BM_STS_MASK; + break; - RegisterValue = (UINT32) AcpiOsIn16 (AcpiGbl_FACP->Pm1aEvtBlk); - DEBUG_PRINT (TRACE_IO, ("PM1a status: Read 0x%X from 0x%X\n", - RegisterValue, AcpiGbl_FACP->Pm1aEvtBlk)); + case GBL_STS: + Mask = GBL_STS_MASK; + break; - if (AcpiGbl_FACP->Pm1bEvtBlk) - { - RegisterValue |= (UINT32) AcpiOsIn16 (AcpiGbl_FACP->Pm1bEvtBlk); - DEBUG_PRINT (TRACE_IO, ("PM1b status: Read 0x%X from 0x%X\n", - RegisterValue, AcpiGbl_FACP->Pm1bEvtBlk)); - } + case PWRBTN_STS: + Mask = PWRBTN_STS_MASK; + break; - switch (RegisterId) - { - case TMR_STS: - Mask = TMR_STS_MASK; - break; - - case BM_STS: - Mask = BM_STS_MASK; - break; - - case GBL_STS: - Mask = GBL_STS_MASK; - break; - - case PWRBTN_STS: - Mask = PWRBTN_STS_MASK; - break; - - case SLPBTN_STS: - Mask = SLPBTN_STS_MASK; - break; - - case RTC_STS: - Mask = RTC_STS_MASK; - break; - - case WAK_STS: - Mask = WAK_STS_MASK; - break; - - default: - Mask = 0; - break; - } + case SLPBTN_STS: + Mask = SLPBTN_STS_MASK; + break; - if (ReadWrite == ACPI_WRITE) - { - /* - * Status registers are different from the rest. Clear by - * writing 1, writing 0 has no effect. So, the only relevent - * information is the single bit we're interested in, all - * others should be written as 0 so they will be left - * unchanged - */ - - Value <<= AcpiHwGetBitShift (Mask); - Value &= Mask; - - if (Value) - { - DEBUG_PRINT (TRACE_IO, - ("About to write 0x%X to 0x%X\n", Value, - AcpiGbl_FACP->Pm1aEvtBlk)); - - AcpiOsOut16 (AcpiGbl_FACP->Pm1aEvtBlk, (UINT16) Value); - - if (AcpiGbl_FACP->Pm1bEvtBlk) - { - AcpiOsOut16 (AcpiGbl_FACP->Pm1bEvtBlk, (UINT16) Value); - } + case RTC_STS: + Mask = RTC_STS_MASK; + break; - RegisterValue = 0; - } - } + case WAK_STS: + Mask = WAK_STS_MASK; + break; - if (ACPI_MTX_LOCK == UseLock) - { - AcpiCmReleaseMutex (ACPI_MTX_HARDWARE); - } + default: + Mask = 0; + break; } - else + RegisterValue = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, PM1_STS); + + if (ReadWrite == ACPI_WRITE) { - /* enable register */ + /* + * Status Registers are different from the rest. Clear by + * writing 1, writing 0 has no effect. So, the only relevent + * information is the single bit we're interested in, all + * others should be written as 0 so they will be left + * unchanged + */ - if (ACPI_MTX_LOCK == UseLock) + Value <<= AcpiHwGetBitShift (Mask); + Value &= Mask; + + if (Value) { - AcpiCmAcquireMutex (ACPI_MTX_HARDWARE); + AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, PM1_STS, (UINT16) Value); + + RegisterValue = 0; } + } - RegisterValue = (UINT32) AcpiOsIn16 (AcpiGbl_FACP->Pm1aEvtBlk + - DIV_2 (AcpiGbl_FACP->Pm1EvtLen)); + break; - DEBUG_PRINT (TRACE_IO, ("PM1a enable: Read 0x%X from 0x%X\n", - RegisterValue, (AcpiGbl_FACP->Pm1aEvtBlk + - DIV_2 (AcpiGbl_FACP->Pm1EvtLen)))); - if (AcpiGbl_FACP->Pm1bEvtBlk) - { - RegisterValue |= (UINT32) AcpiOsIn16 (AcpiGbl_FACP->Pm1bEvtBlk + - DIV_2 (AcpiGbl_FACP->Pm1EvtLen)); + case PM1_EN: - DEBUG_PRINT (TRACE_IO, ("PM1b enable: Read 0x%X from 0x%X\n", - RegisterValue, (AcpiGbl_FACP->Pm1bEvtBlk + - DIV_2 (AcpiGbl_FACP->Pm1EvtLen)))); - } - - switch (RegisterId) - { - case TMR_EN: - Mask = TMR_EN_MASK; - break; - - case GBL_EN: - Mask = GBL_EN_MASK; - break; - - case PWRBTN_EN: - Mask = PWRBTN_EN_MASK; - break; - - case SLPBTN_EN: - Mask = SLPBTN_EN_MASK; - break; - - case RTC_EN: - Mask = RTC_EN_MASK; - break; - - default: - Mask = 0; - break; - } + switch (RegisterId) + { + case TMR_EN: + Mask = TMR_EN_MASK; + break; - if (ReadWrite == ACPI_WRITE) - { - RegisterValue &= ~Mask; - Value <<= AcpiHwGetBitShift (Mask); - Value &= Mask; - RegisterValue |= Value; - - DEBUG_PRINT (TRACE_IO, - ("About to write %04X to %04X\n", RegisterValue, - (AcpiGbl_FACP->Pm1aEvtBlk + - DIV_2 (AcpiGbl_FACP->Pm1EvtLen)))); - - AcpiOsOut16 ((AcpiGbl_FACP->Pm1aEvtBlk + - DIV_2 (AcpiGbl_FACP->Pm1EvtLen)), - (UINT16) RegisterValue); - - if (AcpiGbl_FACP->Pm1bEvtBlk) - { - AcpiOsOut16 ((AcpiGbl_FACP->Pm1bEvtBlk + - DIV_2 (AcpiGbl_FACP->Pm1EvtLen)), - (UINT16) RegisterValue); - } - } - if(ACPI_MTX_LOCK == UseLock) - { - AcpiCmReleaseMutex (ACPI_MTX_HARDWARE); - } - } - break; + case GBL_EN: + Mask = GBL_EN_MASK; + break; + case PWRBTN_EN: + Mask = PWRBTN_EN_MASK; + break; - case PM1_CONTROL: + case SLPBTN_EN: + Mask = SLPBTN_EN_MASK; + break; - RegisterValue = 0; + case RTC_EN: + Mask = RTC_EN_MASK; + break; - if (ACPI_MTX_LOCK == UseLock) - { - AcpiCmAcquireMutex (ACPI_MTX_HARDWARE); + default: + Mask = 0; + break; } - if (RegisterId != SLP_TYPE_B) + RegisterValue = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, PM1_EN); + + if (ReadWrite == ACPI_WRITE) { - /* - * SLP_TYPx registers are written differently - * than any other control registers with - * respect to A and B registers. The value - * for A may be different than the value for B - */ + RegisterValue &= ~Mask; + Value <<= AcpiHwGetBitShift (Mask); + Value &= Mask; + RegisterValue |= Value; - RegisterValue = (UINT32) AcpiOsIn16 (AcpiGbl_FACP->Pm1aCntBlk); - DEBUG_PRINT (TRACE_IO, ("PM1a control: Read 0x%X from 0x%X\n", - RegisterValue, AcpiGbl_FACP->Pm1aCntBlk)); + AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, PM1_EN, (UINT16) RegisterValue); } - if (AcpiGbl_FACP->Pm1bCntBlk && RegisterId != (UINT32) SLP_TYPE_A) - { - RegisterValue |= (UINT32) AcpiOsIn16 (AcpiGbl_FACP->Pm1bCntBlk); - DEBUG_PRINT (TRACE_IO, ("PM1b control: Read 0x%X from 0x%X\n", - RegisterValue, AcpiGbl_FACP->Pm1bCntBlk)); - } + break; + + + case PM1_CONTROL: switch (RegisterId) { @@ -619,6 +525,16 @@ break; } + + /* + * Read the PM1 Control register. + * Note that at this level, the fact that there are actually TWO + * registers (A and B) and that B may not exist, are abstracted. + */ + RegisterValue = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, PM1_CONTROL); + + DEBUG_PRINT (TRACE_IO, ("PM1 control: Read 0x%X\n", RegisterValue)); + if (ReadWrite == ACPI_WRITE) { RegisterValue &= ~Mask; @@ -627,56 +543,20 @@ RegisterValue |= Value; /* - * SLP_TYPE_x registers are written differently - * than any other control registers with - * respect to A and B registers. The value + * SLP_TYPE_x Registers are written differently + * than any other control Registers with + * respect to A and B Registers. The value * for A may be different than the value for B */ - if (RegisterId != SLP_TYPE_B) - { - if (Mask == SLP_EN_MASK) - { - disable(); /* disable interrupts */ - } - - AcpiOsOut16 (AcpiGbl_FACP->Pm1aCntBlk, (UINT16) RegisterValue); - - if (Mask == SLP_EN_MASK) - { - /* - * Enable interrupts, the SCI handler is likely going to - * be invoked as soon as interrupts are enabled, since gpe's - * and most fixed resume events also generate SCI's. - */ - enable(); - } - } - - if (AcpiGbl_FACP->Pm1bCntBlk && RegisterId != (UINT32) SLP_TYPE_A) - { - AcpiOsOut16 (AcpiGbl_FACP->Pm1bCntBlk, (UINT16) RegisterValue); - } - } - - if (ACPI_MTX_LOCK == UseLock) - { - AcpiCmReleaseMutex (ACPI_MTX_HARDWARE); + AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, + PM1_CONTROL, (UINT16) RegisterValue); } break; case PM2_CONTROL: - if (ACPI_MTX_LOCK == UseLock) - { - AcpiCmAcquireMutex (ACPI_MTX_HARDWARE); - } - - RegisterValue = (UINT32) AcpiOsIn16 (AcpiGbl_FACP->Pm2CntBlk); - DEBUG_PRINT (TRACE_IO, ("PM2 control: Read 0x%X from 0x%X\n", - RegisterValue, AcpiGbl_FACP->Pm2CntBlk)); - switch (RegisterId) { case ARB_DIS: @@ -688,6 +568,11 @@ break; } + RegisterValue = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, PM2_CONTROL); + + DEBUG_PRINT (TRACE_IO, ("PM2 control: Read 0x%X from 0x%X\n", + RegisterValue, AcpiGbl_FADT->XPm2CntBlk.Address)); + if (ReadWrite == ACPI_WRITE) { RegisterValue &= ~Mask; @@ -697,92 +582,63 @@ DEBUG_PRINT (TRACE_IO, ("About to write %04X to %04X\n", RegisterValue, - AcpiGbl_FACP->Pm2CntBlk)); - - AcpiOsOut16 (AcpiGbl_FACP->Pm2CntBlk, (UINT16) RegisterValue); - } + AcpiGbl_FADT->XPm2CntBlk.Address)); - if (ACPI_MTX_LOCK == UseLock) - { - AcpiCmReleaseMutex (ACPI_MTX_HARDWARE); + AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, + PM2_CONTROL, (UINT8) (RegisterValue)); } break; case PM_TIMER: - RegisterValue = AcpiOsIn32 (AcpiGbl_FACP->PmTmrBlk); + Mask = TMR_VAL_MASK; + RegisterValue = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, + PM_TIMER); DEBUG_PRINT (TRACE_IO, ("PM_TIMER: Read 0x%X from 0x%X\n", - RegisterValue, AcpiGbl_FACP->PmTmrBlk)); + RegisterValue, AcpiGbl_FADT->XPmTmrBlk.Address)); - Mask = ACPI_UINT32_MAX; break; case GPE1_EN_BLOCK: - - GpeReg = (AcpiGbl_FACP->Gpe1Blk + AcpiGbl_FACP->Gpe1Base) + - (GpeReg + (DIV_2 (AcpiGbl_FACP->Gpe1BlkLen))); - - case GPE1_STS_BLOCK: - - if (!GpeReg) - { - GpeReg = (AcpiGbl_FACP->Gpe1Blk + AcpiGbl_FACP->Gpe1Base); - } - - case GPE0_EN_BLOCK: - - if (!GpeReg) - { - GpeReg = AcpiGbl_FACP->Gpe0Blk + DIV_2 (AcpiGbl_FACP->Gpe0BlkLen); - } - - case GPE0_STS_BLOCK: - if (!GpeReg) - { - GpeReg = AcpiGbl_FACP->Gpe0Blk; - } - - /* Determine the bit to be accessed */ + /* Determine the bit to be accessed + * + * (UINT32) RegisterId: + * 31 24 16 8 0 + * +--------+--------+--------+--------+ + * | gpe_block_id | gpe_bit_number | + * +--------+--------+--------+--------+ + * + * gpe_block_id is one of GPE[01]_EN_BLOCK and GPE[01]_STS_BLOCK + * gpe_bit_number is relative from the gpe_block (0x00~0xFF) + */ - Mask = (((UINT32) RegisterId) & BIT_IN_REGISTER_MASK); - Mask = 1 << (Mask-1); + Mask = REGISTER_BIT_ID(RegisterId); /* gpe_bit_number */ + RegisterId = REGISTER_BLOCK_ID(RegisterId) | (Mask >> 3); + Mask = AcpiGbl_DecodeTo8bit [Mask % 8]; /* * The base address of the GPE 0 Register Block * Plus 1/2 the length of the GPE 0 Register Block - * The enable register is the register following the Status Register - * and each register is defined as 1/2 of the total Register Block + * The enable Register is the Register following the Status Register + * and each Register is defined as 1/2 of the total Register Block */ /* * This sets the bit within EnableBit that needs to be written to - * the register indicated in Mask to a 1, all others are 0 + * the Register indicated in Mask to a 1, all others are 0 */ - if (Mask > LOW_BYTE) - { - /* Shift the value 1 byte to the right and add 1 to the register */ - - Mask >>= ONE_BYTE; - GpeReg++; - } - /* Now get the current Enable Bits in the selected Reg */ - if(ACPI_MTX_LOCK == UseLock) - { - AcpiCmAcquireMutex (ACPI_MTX_HARDWARE); - } - - RegisterValue = (UINT32) AcpiOsIn8 (GpeReg); + RegisterValue = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, RegisterId); DEBUG_PRINT (TRACE_IO, ("GPE Enable bits: Read 0x%X from 0x%X\n", - RegisterValue, GpeReg)); + RegisterValue, RegisterId)); if (ReadWrite == ACPI_WRITE) { @@ -792,30 +648,30 @@ RegisterValue |= Value; /* This write will put the Action state into the General Purpose */ - /* Enable Register indexed by the value in Mask */ DEBUG_PRINT (TRACE_IO, ("About to write %04X to %04X\n", - RegisterValue, GpeReg)); - - AcpiOsOut8 (GpeReg, (UINT8) RegisterValue); - RegisterValue = (UINT32) AcpiOsIn8 (GpeReg); - } - - if(ACPI_MTX_LOCK == UseLock) - { - AcpiCmReleaseMutex (ACPI_MTX_HARDWARE); + RegisterValue, RegisterId)); + AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, + RegisterId, (UINT8) RegisterValue); + RegisterValue = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, RegisterId); } break; + case SMI_CMD_BLOCK: case PROCESSOR_BLOCK: + /* not used */ default: Mask = 0; break; } + if (ACPI_MTX_LOCK == UseLock) { + AcpiCmReleaseMutex (ACPI_MTX_HARDWARE); + } + RegisterValue &= Mask; RegisterValue >>= AcpiHwGetBitShift (Mask); @@ -823,3 +679,485 @@ DEBUG_PRINT (TRACE_IO, ("Register I/O: returning 0x%X\n", RegisterValue)); return_VALUE (RegisterValue); } + + +/****************************************************************************** + * + * FUNCTION: AcpiHwRegisterRead + * + * PARAMETERS: UseLock - Mutex hw access. + * RegisterId - RegisterID + Offset. + * + * RETURN: Value read or written. + * + * DESCRIPTION: Acpi register read function. Registers are read at the + * given offset. + * + ******************************************************************************/ + +UINT32 +AcpiHwRegisterRead ( + BOOLEAN UseLock, + UINT32 RegisterId) +{ + UINT32 Value = 0; + UINT32 Offset = REGISTER_OFFSET (RegisterId); + UINT32 BankOffset; + + FUNCTION_TRACE ("AcpiHwRegisterRead"); + + if (ACPI_MTX_LOCK == UseLock) + { + AcpiCmAcquireMutex (ACPI_MTX_HARDWARE); + } + + + switch (REGISTER_BLOCK_ID(RegisterId)) + { + case PM1_STS: /* 16-bit access */ + + Value = AcpiHwLowLevelRead (16, &AcpiGbl_FADT->XPm1aEvtBlk, Offset); + Value |= AcpiHwLowLevelRead (16, &AcpiGbl_FADT->XPm1bEvtBlk, Offset); + break; + + + case PM1_EN: /* 16-bit access*/ + + BankOffset = DIV_2 (AcpiGbl_FADT->Pm1EvtLen); + Value = AcpiHwLowLevelRead (16, &AcpiGbl_FADT->XPm1aEvtBlk, BankOffset + Offset); + Value |= AcpiHwLowLevelRead (16, &AcpiGbl_FADT->XPm1bEvtBlk, BankOffset + Offset); + break; + + + case PM1_CONTROL: /* 16-bit access */ + + if (RegisterId != SLP_TYPE_B) + { + Value |= AcpiHwLowLevelRead (16, &AcpiGbl_FADT->XPm1aCntBlk, 0); + } + + if (RegisterId != SLP_TYPE_A) + { + Value |= AcpiHwLowLevelRead (16, &AcpiGbl_FADT->XPm1bCntBlk, 0); + } + break; + + + case PM2_CONTROL: /* 8-bit access */ + + Value = AcpiHwLowLevelRead (8, &AcpiGbl_FADT->XPm2CntBlk, Offset); + break; + + + case PM_TIMER: /* 32-bit access */ + + Value = AcpiHwLowLevelRead (32, &AcpiGbl_FADT->XPmTmrBlk, Offset); + break; + + + case GPE0_STS_BLOCK: /* 8-bit access */ + + Value = AcpiHwLowLevelRead (8, &AcpiGbl_FADT->XGpe0Blk, Offset); + break; + + + case GPE0_EN_BLOCK: /* 8-bit access */ + + BankOffset = DIV_2 (AcpiGbl_FADT->Gpe0BlkLen); + Value = AcpiHwLowLevelRead (8, &AcpiGbl_FADT->XGpe0Blk, BankOffset + Offset); + break; + + + case GPE1_STS_BLOCK: /* 8-bit access */ + + Value = AcpiHwLowLevelRead (8, &AcpiGbl_FADT->XGpe1Blk, Offset); + break; + + + case GPE1_EN_BLOCK: /* 8-bit access */ + + BankOffset = DIV_2 (AcpiGbl_FADT->Gpe1BlkLen); + Value = AcpiHwLowLevelRead (8, &AcpiGbl_FADT->XGpe1Blk, BankOffset + Offset); + break; + + + case SMI_CMD_BLOCK: /* 8bit */ + + Value = (UINT32) AcpiOsIn8 (AcpiGbl_FADT->SmiCmd); + break; + + + default: + Value = 0; + break; + } + + + if (ACPI_MTX_LOCK == UseLock) + { + AcpiCmReleaseMutex (ACPI_MTX_HARDWARE); + } + + return_VALUE (Value); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiHwRegisterWrite + * + * PARAMETERS: UseLock - Mutex hw access. + * RegisterId - RegisterID + Offset. + * + * RETURN: Value read or written. + * + * DESCRIPTION: Acpi register Write function. Registers are written at the + * given offset. + * + ******************************************************************************/ + +void +AcpiHwRegisterWrite ( + BOOLEAN UseLock, + UINT32 RegisterId, + UINT32 Value) +{ + UINT32 Offset = REGISTER_OFFSET (RegisterId); + UINT32 BankOffset; + + FUNCTION_TRACE ("AcpiHwRegisterWrite"); + + + if (ACPI_MTX_LOCK == UseLock) + { + AcpiCmAcquireMutex (ACPI_MTX_HARDWARE); + } + + + switch (REGISTER_BLOCK_ID (RegisterId)) + { + case PM1_STS: /* 16-bit access */ + + AcpiHwLowLevelWrite (16, Value, &AcpiGbl_FADT->XPm1aEvtBlk, Offset); + AcpiHwLowLevelWrite (16, Value, &AcpiGbl_FADT->XPm1bEvtBlk, Offset); + break; + + + case PM1_EN: /* 16-bit access*/ + + BankOffset = DIV_2 (AcpiGbl_FADT->Pm1EvtLen); + AcpiHwLowLevelWrite (16, Value, &AcpiGbl_FADT->XPm1aEvtBlk, BankOffset + Offset); + AcpiHwLowLevelWrite (16, Value, &AcpiGbl_FADT->XPm1bEvtBlk, BankOffset + Offset); + break; + + + case PM1_CONTROL: /* 16-bit access */ + + /* + * If SLP_TYP_A or SLP_TYP_B, only write to one reg block. + * Otherwise, write to both. + */ + if (RegisterId == SLP_TYPE_A) + { + AcpiHwLowLevelWrite (16, Value, &AcpiGbl_FADT->XPm1aCntBlk, Offset); + } + else if (RegisterId == SLP_TYPE_B) + { + AcpiHwLowLevelWrite (16, Value, &AcpiGbl_FADT->XPm1bCntBlk, Offset); + } + else + { + /* disable/re-enable interrupts if sleeping */ + if (RegisterId == SLP_EN) + { + disable(); + } + + AcpiHwLowLevelWrite (16, Value, &AcpiGbl_FADT->XPm1aCntBlk, Offset); + AcpiHwLowLevelWrite (16, Value, &AcpiGbl_FADT->XPm1bCntBlk, Offset); + + if (RegisterId == SLP_EN) + { + enable(); + } + } + + break; + + + case PM2_CONTROL: /* 8-bit access */ + + AcpiHwLowLevelWrite (8, Value, &AcpiGbl_FADT->XPm2CntBlk, Offset); + break; + + + case PM_TIMER: /* 32-bit access */ + + AcpiHwLowLevelWrite (32, Value, &AcpiGbl_FADT->XPmTmrBlk, Offset); + break; + + + case GPE0_STS_BLOCK: /* 8-bit access */ + + AcpiHwLowLevelWrite (8, Value, &AcpiGbl_FADT->XGpe0Blk, Offset); + break; + + + case GPE0_EN_BLOCK: /* 8-bit access */ + + BankOffset = DIV_2 (AcpiGbl_FADT->Gpe0BlkLen); + AcpiHwLowLevelWrite (8, Value, &AcpiGbl_FADT->XGpe0Blk, BankOffset + Offset); + break; + + + case GPE1_STS_BLOCK: /* 8-bit access */ + + AcpiHwLowLevelWrite (8, Value, &AcpiGbl_FADT->XGpe1Blk, Offset); + break; + + + case GPE1_EN_BLOCK: /* 8-bit access */ + + BankOffset = DIV_2 (AcpiGbl_FADT->Gpe1BlkLen); + AcpiHwLowLevelWrite (8, Value, &AcpiGbl_FADT->XGpe1Blk, BankOffset + Offset); + break; + + + case SMI_CMD_BLOCK: /* 8bit */ + + /* For 2.0, SMI_CMD is always in IO space */ + /* TBD: what about 1.0? 0.71? */ + + AcpiOsOut8 (AcpiGbl_FADT->SmiCmd, (UINT8) Value); + break; + + + default: + Value = 0; + break; + } + + + if (ACPI_MTX_LOCK == UseLock) + { + AcpiCmReleaseMutex (ACPI_MTX_HARDWARE); + } + + return_VOID; +} + + +/****************************************************************************** + * + * FUNCTION: AcpiHwLowLevelRead + * + * PARAMETERS: Register - GAS register structure + * Offset - Offset from the base address in the GAS + * Width - 8, 16, or 32 + * + * RETURN: Value read + * + * DESCRIPTION: Read from either memory, IO, or PCI config space. + * + ******************************************************************************/ + +UINT32 +AcpiHwLowLevelRead ( + UINT32 Width, + ACPI_GAS *Reg, + UINT32 Offset) +{ + UINT32 Value = 0; + ACPI_PHYSICAL_ADDRESS MemAddress; + ACPI_IO_ADDRESS IoAddress; + UINT32 PciRegister; + UINT32 PciDevFunc; + + + /* + * Must have a valid pointer to a GAS structure, and + * a non-zero address within + */ + if ((!Reg) || + (!Reg->Address)) + { + return 0; + } + + + /* + * Three address spaces supported: + * Memory, Io, or PCI config. + */ + + switch (Reg->AddressSpaceId) + { + case ADDRESS_SPACE_SYSTEM_MEMORY: + + MemAddress = (ACPI_PHYSICAL_ADDRESS) Reg->Address + Offset; + + switch (Width) + { + case 8: + Value = AcpiOsMemIn8 (MemAddress); + break; + case 16: + Value = AcpiOsMemIn16 (MemAddress); + break; + case 32: + Value = AcpiOsMemIn32 (MemAddress); + break; + } + break; + + + case ADDRESS_SPACE_SYSTEM_IO: + + IoAddress = (ACPI_IO_ADDRESS) Reg->Address + Offset; + + switch (Width) + { + case 8: + Value = AcpiOsIn8 (IoAddress); + break; + case 16: + Value = AcpiOsIn16 (IoAddress); + break; + case 32: + Value = AcpiOsIn32 (IoAddress); + break; + } + break; + + + case ADDRESS_SPACE_PCI_CONFIG: + + PciDevFunc = ACPI_PCI_DEVFUN (Reg->Address); + PciRegister = ACPI_PCI_REGISTER (Reg->Address) + Offset; + + switch (Width) + { + case 8: + AcpiOsReadPciCfgByte (0, PciDevFunc, PciRegister, (UINT8 *) &Value); + break; + case 16: + AcpiOsReadPciCfgWord (0, PciDevFunc, PciRegister, (UINT16 *) &Value); + break; + case 32: + AcpiOsReadPciCfgDword (0, PciDevFunc, PciRegister, (UINT32 *) &Value); + break; + } + break; + } + + return Value; +} + + +/****************************************************************************** + * + * FUNCTION: AcpiHwLowLevelWrite + * + * PARAMETERS: Width - 8, 16, or 32 + * Value - To be written + * Register - GAS register structure + * Offset - Offset from the base address in the GAS + * + * + * RETURN: Value read + * + * DESCRIPTION: Read from either memory, IO, or PCI config space. + * + ******************************************************************************/ + +void +AcpiHwLowLevelWrite ( + UINT32 Width, + UINT32 Value, + ACPI_GAS *Reg, + UINT32 Offset) +{ + ACPI_PHYSICAL_ADDRESS MemAddress; + ACPI_IO_ADDRESS IoAddress; + UINT32 PciRegister; + UINT32 PciDevFunc; + + + /* + * Must have a valid pointer to a GAS structure, and + * a non-zero address within + */ + if ((!Reg) || + (!Reg->Address)) + { + return; + } + + + /* + * Three address spaces supported: + * Memory, Io, or PCI config. + */ + + switch (Reg->AddressSpaceId) + { + case ADDRESS_SPACE_SYSTEM_MEMORY: + + MemAddress = (ACPI_PHYSICAL_ADDRESS) Reg->Address + Offset; + + switch (Width) + { + case 8: + AcpiOsMemOut8 (MemAddress, (UINT8) Value); + break; + case 16: + AcpiOsMemOut16 (MemAddress, (UINT16) Value); + break; + case 32: + AcpiOsMemOut32 (MemAddress, (UINT32) Value); + break; + } + break; + + + case ADDRESS_SPACE_SYSTEM_IO: + + IoAddress = (ACPI_IO_ADDRESS) Reg->Address + Offset; + + switch (Width) + { + case 8: + AcpiOsOut8 (IoAddress, (UINT8) Value); + break; + case 16: + AcpiOsOut16 (IoAddress, (UINT16) Value); + break; + case 32: + AcpiOsOut32 (IoAddress, (UINT32) Value); + break; + } + break; + + + case ADDRESS_SPACE_PCI_CONFIG: + + PciDevFunc = ACPI_PCI_DEVFUN (Reg->Address); + PciRegister = ACPI_PCI_REGISTER (Reg->Address) + Offset; + + switch (Width) + { + case 8: + AcpiOsWritePciCfgByte (0, PciDevFunc, PciRegister, (UINT8) Value); + break; + case 16: + AcpiOsWritePciCfgWord (0, PciDevFunc, PciRegister, (UINT16) Value); + break; + case 32: + AcpiOsWritePciCfgDword (0, PciDevFunc, PciRegister, (UINT32) Value); + break; + } + break; + } +} + + diff -ruN acpica-unix-20001020/Subsystem/Hardware/hwxface.c acpica-unix-20001115/Subsystem/Hardware/hwxface.c --- acpica-unix-20001020/Subsystem/Hardware/hwxface.c Sat Oct 21 06:44:56 2000 +++ acpica-unix-20001115/Subsystem/Hardware/hwxface.c Thu Nov 16 09:18:41 2000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Name: hwxface.c - Hardware access external interfaces - * $Revision: 32 $ + * $Revision: 36 $ * *****************************************************************************/ @@ -160,7 +160,7 @@ NATIVE_UINT NumThrottleStates; NATIVE_UINT BufferSpaceNeeded; NATIVE_UINT i; - UINT8 DutyWidth = 0; + UINT8 DutyWidth; ACPI_NAMESPACE_NODE *CpuNode; ACPI_OPERAND_OBJECT *CpuObj; ACPI_CPU_THROTTLING_STATE *StatePtr; @@ -197,12 +197,10 @@ return_ACPI_STATUS (AE_NOT_FOUND); } -#ifndef _IA64 /* - * No Duty fields in IA64 tables + * (Duty Width on IA-64 is zero) */ - DutyWidth = AcpiGbl_FACP->DutyWidth; -#endif + DutyWidth = AcpiGbl_FADT->DutyWidth; /* * P0 must always have a P_BLK all others may be null @@ -277,8 +275,8 @@ ACPI_OPERAND_OBJECT *CpuObj; UINT32 NumThrottleStates; UINT32 DutyCycle; - UINT8 DutyOffset = 0; - UINT8 DutyWidth = 0; + UINT8 DutyOffset; + UINT8 DutyWidth; FUNCTION_TRACE ("AcpiGetProcessorThrottlingState"); @@ -300,13 +298,11 @@ return_ACPI_STATUS (AE_NOT_FOUND); } -#ifndef _IA64 /* * No Duty fields in IA64 tables */ - DutyOffset = AcpiGbl_FACP->DutyOffset; - DutyWidth = AcpiGbl_FACP->DutyWidth; -#endif + DutyOffset = AcpiGbl_FADT->DutyOffset; + DutyWidth = AcpiGbl_FADT->DutyWidth; /* * Must have a valid P_BLK P0 must have a P_BLK all others may be null @@ -370,8 +366,8 @@ ACPI_NAMESPACE_NODE *CpuNode; ACPI_OPERAND_OBJECT *CpuObj; UINT32 NumThrottleStates = 0; - UINT8 DutyOffset = 0; - UINT8 DutyWidth = 0; + UINT8 DutyOffset; + UINT8 DutyWidth; UINT32 DutyCycle = 0; @@ -394,13 +390,11 @@ return_ACPI_STATUS (AE_NOT_FOUND); } -#ifndef _IA64 /* * No Duty fields in IA64 tables */ - DutyOffset = AcpiGbl_FACP->DutyOffset; - DutyWidth = AcpiGbl_FACP->DutyWidth; -#endif + DutyOffset = AcpiGbl_FADT->DutyOffset; + DutyWidth = AcpiGbl_FADT->DutyWidth; /* * Must have a valid P_BLK P0 must have a P_BLK all others may be null @@ -427,7 +421,7 @@ return_ACPI_STATUS (AE_SUPPORT); } - NumThrottleStates = (int) AcpiHwLocalPow (2,DutyWidth); + NumThrottleStates = (UINT32) AcpiHwLocalPow (2,DutyWidth); /* * Convert throttling state to duty cycle (invert). @@ -664,8 +658,9 @@ ACPI_STATUS AcpiSetFirmwareWakingVector ( - void *PhysicalAddress) + ACPI_PHYSICAL_ADDRESS PhysicalAddress) { + FUNCTION_TRACE ("AcpiSetFirmwareWakingVector"); @@ -678,7 +673,14 @@ /* Set the vector */ - * ((void **) AcpiGbl_FACS->FirmwareWakingVector) = PhysicalAddress; + if (AcpiGbl_FACS->VectorWidth == 32) + { + * (UINT32 *) AcpiGbl_FACS->FirmwareWakingVector = (UINT32) PhysicalAddress; + } + else + { + *AcpiGbl_FACS->FirmwareWakingVector = PhysicalAddress; + } return_ACPI_STATUS (AE_OK); } @@ -689,7 +691,7 @@ * FUNCTION: AcpiGetFirmwareWakingVector * * PARAMETERS: *PhysicalAddress - Output buffer where contents of - * the dFirmwareWakingVector field of + * the FirmwareWakingVector field of * the FACS will be stored. * * RETURN: Status @@ -700,8 +702,9 @@ ACPI_STATUS AcpiGetFirmwareWakingVector ( - void **PhysicalAddress) + ACPI_PHYSICAL_ADDRESS *PhysicalAddress) { + FUNCTION_TRACE ("AcpiGetFirmwareWakingVector"); @@ -719,8 +722,14 @@ /* Get the vector */ - *PhysicalAddress = * ((void **) AcpiGbl_FACS->FirmwareWakingVector); - + if (AcpiGbl_FACS->VectorWidth == 32) + { + *PhysicalAddress = * (UINT32 *) AcpiGbl_FACS->FirmwareWakingVector; + } + else + { + *PhysicalAddress = *AcpiGbl_FACS->FirmwareWakingVector; + } return_ACPI_STATUS (AE_OK); } diff -ruN acpica-unix-20001020/Subsystem/Include/accommon.h acpica-unix-20001115/Subsystem/Include/accommon.h --- acpica-unix-20001020/Subsystem/Include/accommon.h Sat Oct 21 06:44:56 2000 +++ acpica-unix-20001115/Subsystem/Include/accommon.h Thu Nov 16 09:18:41 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: accommon.h -- prototypes for the common (subsystem-wide) procedures - * $Revision: 80 $ + * $Revision: 81 $ * *****************************************************************************/ @@ -154,7 +154,7 @@ void); ACPI_STATUS -AcpiCmValidateFacp ( +AcpiCmValidateFadt ( void); /* diff -ruN acpica-unix-20001020/Subsystem/Include/acconfig.h acpica-unix-20001115/Subsystem/Include/acconfig.h --- acpica-unix-20001020/Subsystem/Include/acconfig.h Sat Oct 21 06:44:56 2000 +++ acpica-unix-20001115/Subsystem/Include/acconfig.h Thu Nov 16 09:18:41 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acconfig.h - Global configuration constants - * $Revision: 44 $ + * $Revision: 48 $ * *****************************************************************************/ @@ -147,21 +147,6 @@ #define ACPI_CA_VERSION __DATE__ -/* - * How and when control methods will be parsed - * The default action is to parse all methods at table load time to verify them, but delete the parse trees - * to conserve memory. Methods are parsed just in time before execution and the parse tree is deleted - * when execution completes. - */ -#define METHOD_PARSE_AT_INIT 0x0 /* Parse at table init, never delete the method parse tree */ -#define METHOD_PARSE_JUST_IN_TIME 0x1 /* Parse only when a method is invoked */ -#define METHOD_DELETE_AT_COMPLETION 0x2 /* Delete parse tree on method completion */ - -/* Default parsing configuration */ - -#define METHOD_PARSE_CONFIGURATION (METHOD_PARSE_JUST_IN_TIME | METHOD_DELETE_AT_COMPLETION) - - /* Maximum objects in the various object caches */ #define MAX_STATE_CACHE_DEPTH 64 /* State objects for stacks */ @@ -170,15 +155,6 @@ #define MAX_OBJECT_CACHE_DEPTH 64 /* Interpreter operand objects */ #define MAX_WALK_CACHE_DEPTH 2 /* Objects for parse tree walks (method execution) */ -/* - * NameSpace Table size - * - * All tables are the same size to simplify the implementation. - * Tables may be extended by allocating additional tables that - * are in turn linked together to form a chain of tables. - */ - -#define NS_TABLE_SIZE 4 /* String size constants */ @@ -247,14 +223,14 @@ /* Names within the namespace are 4 bytes long */ #define ACPI_NAME_SIZE 4 -#define PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 INT8 for separator */ +#define PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 INT8 for separator */ #define PATH_SEPARATOR '.' /* Constants used in searching for the RSDP in low memory */ -#define LO_RSDP_WINDOW_BASE (void *) 0 -#define HI_RSDP_WINDOW_BASE (void *) 0xE0000 +#define LO_RSDP_WINDOW_BASE 0 /* Physical Address */ +#define HI_RSDP_WINDOW_BASE 0xE0000 /* Physical Address */ #define LO_RSDP_WINDOW_SIZE 0x400 #define HI_RSDP_WINDOW_SIZE 0x20000 #define RSDP_SCAN_STEP 16 diff -ruN acpica-unix-20001020/Subsystem/Include/acdispat.h acpica-unix-20001115/Subsystem/Include/acdispat.h --- acpica-unix-20001020/Subsystem/Include/acdispat.h Sat Oct 21 06:44:56 2000 +++ acpica-unix-20001115/Subsystem/Include/acdispat.h Thu Nov 16 09:18:41 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acdispat.h - dispatcher (parser to interpreter interface) - * $Revision: 31 $ + * $Revision: 32 $ * *****************************************************************************/ @@ -127,8 +127,6 @@ #define MTH_TYPE_LOCAL 0 #define MTH_TYPE_ARG 1 - - /* Common interfaces */ diff -ruN acpica-unix-20001020/Subsystem/Include/acefi.h acpica-unix-20001115/Subsystem/Include/acefi.h --- acpica-unix-20001020/Subsystem/Include/acefi.h Sat Oct 21 06:44:56 2000 +++ acpica-unix-20001115/Subsystem/Include/acefi.h Thu Nov 16 09:18:41 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acefi.h - OS specific defines, etc. - * $Revision: 1 $ + * $Revision: 3 $ * *****************************************************************************/ @@ -123,5 +123,14 @@ #include #include +#undef UINT8 +#undef BOOLEAN +#undef UCHAR +#undef UINT16 +#undef INT32 +#undef UINT32 +#undef INT64 +#undef UINT64 -#endif /* __ACEFI_H__ */ + +#endif /* __ACEFI_H__ */ diff -ruN acpica-unix-20001020/Subsystem/Include/acenv.h acpica-unix-20001115/Subsystem/Include/acenv.h --- acpica-unix-20001020/Subsystem/Include/acenv.h Sat Oct 21 06:44:56 2000 +++ acpica-unix-20001115/Subsystem/Include/acenv.h Thu Nov 16 09:18:41 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acenv.h - Generation environment specific items - * $Revision: 61 $ + * $Revision: 65 $ * *****************************************************************************/ @@ -139,6 +139,13 @@ #define ACPI_USE_SYSTEM_CLIBRARY #endif +#ifdef _ACPI_ASL_COMPILER +#define ACPI_DEBUG +#define ACPI_APPLICATION +#define ENABLE_DEBUGGER +#define ACPI_USE_SYSTEM_CLIBRARY +#endif + /* * Environment configuration. The purpose of this file is to interface to the @@ -357,18 +364,6 @@ /* this has been moved to compiler-specific headers, which are included from the platform header. */ - - - -/* TBD: move this elsewhere! */ - -#ifdef __ia64__ -/* Look at interim FADT to determine IO or memory mapped */ -#define IoAddressSpace(flag) (AcpiGbl_FACP->AddressSpace & flag) -#else -/* always IO space */ -#define IoAddressSpace(flag) (1) -#endif #endif /* __ACENV_H__ */ diff -ruN acpica-unix-20001020/Subsystem/Include/acevents.h acpica-unix-20001115/Subsystem/Include/acevents.h --- acpica-unix-20001020/Subsystem/Include/acevents.h Sat Oct 21 06:44:56 2000 +++ acpica-unix-20001115/Subsystem/Include/acevents.h Thu Nov 16 09:18:42 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acevents.h - Event subcomponent prototypes and defines - * $Revision: 59 $ + * $Revision: 60 $ * *****************************************************************************/ @@ -200,7 +200,7 @@ AcpiEvAddressSpaceDispatch ( ACPI_OPERAND_OBJECT *RegionObj, UINT32 Function, - ACPI_INTEGER Address, + ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT32 *Value); diff -ruN acpica-unix-20001020/Subsystem/Include/acglobal.h acpica-unix-20001115/Subsystem/Include/acglobal.h --- acpica-unix-20001020/Subsystem/Include/acglobal.h Sat Oct 21 06:44:57 2000 +++ acpica-unix-20001115/Subsystem/Include/acglobal.h Thu Nov 16 09:18:42 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acglobal.h - Declarations for global variables - * $Revision: 85 $ + * $Revision: 92 $ * *****************************************************************************/ @@ -165,13 +165,12 @@ * of each in the system. Each global points to the actual table. * */ -ACPI_EXTERN ROOT_SYSTEM_DESCRIPTOR_POINTER *AcpiGbl_RSDP; -ACPI_EXTERN ROOT_SYSTEM_DESCRIPTION_TABLE *AcpiGbl_RSDT; -ACPI_EXTERN FIRMWARE_ACPI_CONTROL_STRUCTURE *AcpiGbl_FACS; -ACPI_EXTERN FIXED_ACPI_DESCRIPTION_TABLE *AcpiGbl_FACP; -ACPI_EXTERN APIC_TABLE *AcpiGbl_APIC; -ACPI_EXTERN ACPI_TABLE_HEADER *AcpiGbl_DSDT; -ACPI_EXTERN ACPI_TABLE_HEADER *AcpiGbl_SBST; +ACPI_EXTERN RSDP_DESCRIPTOR *AcpiGbl_RSDP; +ACPI_EXTERN XSDT_DESCRIPTOR *AcpiGbl_XSDT; +ACPI_EXTERN FADT_DESCRIPTOR *AcpiGbl_FADT; +ACPI_EXTERN ACPI_TABLE_HEADER *AcpiGbl_DSDT; +ACPI_EXTERN ACPI_COMMON_FACS *AcpiGbl_FACS; + /* * Since there may be multiple SSDTs and PSDTS, a single pointer is not * sufficient; Therefore, there isn't one! @@ -254,6 +253,7 @@ extern BOOLEAN AcpiGbl_Shutdown; extern UINT32 AcpiGbl_SystemFlags; extern UINT32 AcpiGbl_StartupFlags; +extern UINT8 AcpiGbl_DecodeTo8bit[]; /***************************************************************************** @@ -288,23 +288,8 @@ ****************************************************************************/ -ACPI_EXTERN UINT32 AcpiGbl_WhenToParseMethods; ACPI_EXTERN ACPI_WALK_LIST *AcpiGbl_CurrentWalkList; -/* Base of AML block, and pointer to current location in it */ - -ACPI_EXTERN UINT8 *AcpiGbl_PCodeBase; -ACPI_EXTERN UINT8 *AcpiGbl_PCode; - -/* - * Length of AML block, and remaining length of current package. - */ -ACPI_EXTERN UINT32 AcpiGbl_PCodeBlockLen; -ACPI_EXTERN UINT32 AcpiGbl_PCodeLen; - -ACPI_EXTERN UINT32 AcpiGbl_BufSeq; /* Counts allocated Buffer descriptors */ -ACPI_EXTERN UINT32 AcpiGbl_NodeErr; /* Indicate if inc_error should be called */ - /* * Handle to the last method found - used during pass1 of load */ @@ -330,10 +315,6 @@ ACPI_EXTERN ACPI_PARSE_OBJECT *AcpiGbl_ParsedNamespaceRoot; -extern ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[]; -extern UINT8 AcpiGbl_AmlOpInfoIndex[256]; - - /***************************************************************************** * * Hardware globals @@ -380,9 +361,10 @@ * ****************************************************************************/ +#ifdef ENABLE_DEBUGGER ACPI_EXTERN BOOLEAN AcpiGbl_MethodExecuting; ACPI_EXTERN BOOLEAN AcpiGbl_DbTerminateThreads; - +#endif /* Memory allocation metrics - Debug Only! */ diff -ruN acpica-unix-20001020/Subsystem/Include/achware.h acpica-unix-20001115/Subsystem/Include/achware.h --- acpica-unix-20001020/Subsystem/Include/achware.h Sat Oct 21 06:44:57 2000 +++ acpica-unix-20001115/Subsystem/Include/achware.h Thu Nov 16 09:18:42 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: achware.h -- hardware specific interfaces - * $Revision: 42 $ + * $Revision: 48 $ * *****************************************************************************/ @@ -147,11 +147,37 @@ /* Register I/O Prototypes */ + UINT32 -AcpiHwRegisterAccess ( +AcpiHwRegisterBitAccess ( NATIVE_UINT ReadWrite, BOOLEAN UseLock, - UINT32 RegisterId, ... /* DWORD Value */); + UINT32 RegisterId, + ... /* DWORD Write Value */); + +UINT32 +AcpiHwRegisterRead ( + BOOLEAN UseLock, + UINT32 RegisterId); + +void +AcpiHwRegisterWrite ( + BOOLEAN UseLock, + UINT32 RegisterId, + UINT32 Value); + +UINT32 +AcpiHwLowLevelRead ( + UINT32 Width, + ACPI_GAS *Reg, + UINT32 Offset); + +void +AcpiHwLowLevelWrite ( + UINT32 Width, + UINT32 Value, + ACPI_GAS *Reg, + UINT32 Offset); void AcpiHwClearAcpiStatus ( @@ -216,6 +242,16 @@ AcpiHwGetCxInfo ( UINT32 CxStates[]); +ACPI_STATUS +AcpiHwGetCxHandler ( + UINT32 CxState, + ACPI_C_STATE_HANDLER *Handler); + +ACPI_STATUS +AcpiHwSetCxHandler ( + UINT32 CxState, + ACPI_C_STATE_HANDLER Handler); + /* Throttling Prototypes */ @@ -255,6 +291,10 @@ UINT32 AcpiHwPmtResolution ( void); + +ACPI_STATUS +AcpiGetTimer ( + UINT32 *OutTicks); #endif /* __ACHWARE_H__ */ diff -ruN acpica-unix-20001020/Subsystem/Include/acinterp.h acpica-unix-20001115/Subsystem/Include/acinterp.h --- acpica-unix-20001020/Subsystem/Include/acinterp.h Sat Oct 21 06:44:57 2000 +++ acpica-unix-20001115/Subsystem/Include/acinterp.h Thu Nov 16 09:18:42 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acinterp.h - Interpreter subcomponent prototypes and defines - * $Revision: 82 $ + * $Revision: 85 $ * *****************************************************************************/ @@ -417,7 +417,8 @@ ACPI_STATUS AcpiAmlResolveNodeToValue ( - ACPI_NAMESPACE_NODE **StackPtr); + ACPI_NAMESPACE_NODE **StackPtr, + ACPI_WALK_STATE *WalkState); ACPI_STATUS AcpiAmlResolveObjectToValue ( @@ -533,6 +534,11 @@ AcpiAmlExitInterpreter ( void); +void +AcpiAmlTruncateFor32bitTable ( + ACPI_OPERAND_OBJECT *ObjDesc, + ACPI_WALK_STATE *WalkState); + BOOLEAN AcpiAmlValidateObjectType ( ACPI_OBJECT_TYPE Type); @@ -546,10 +552,6 @@ BOOLEAN Locked); UINT32 -AcpiAmlBufSeq ( - void); - -UINT32 AcpiAmlDigitsNeeded ( ACPI_INTEGER Value, UINT32 Base); @@ -578,7 +580,7 @@ ACPI_STATUS AcpiAmlSystemMemorySpaceHandler ( UINT32 Function, - ACPI_INTEGER Address, + ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT32 *Value, void *HandlerContext, @@ -587,7 +589,7 @@ ACPI_STATUS AcpiAmlSystemIoSpaceHandler ( UINT32 Function, - ACPI_INTEGER Address, + ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT32 *Value, void *HandlerContext, @@ -596,7 +598,7 @@ ACPI_STATUS AcpiAmlPciConfigSpaceHandler ( UINT32 Function, - ACPI_INTEGER Address, + ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT32 *Value, void *HandlerContext, @@ -605,7 +607,7 @@ ACPI_STATUS AcpiAmlEmbeddedControllerSpaceHandler ( UINT32 Function, - ACPI_INTEGER Address, + ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT32 *Value, void *HandlerContext, @@ -614,7 +616,7 @@ ACPI_STATUS AcpiAmlSmBusSpaceHandler ( UINT32 Function, - ACPI_INTEGER Address, + ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT32 *Value, void *HandlerContext, diff -ruN acpica-unix-20001020/Subsystem/Include/aclinux.h acpica-unix-20001115/Subsystem/Include/aclinux.h --- acpica-unix-20001020/Subsystem/Include/aclinux.h Sat Oct 21 06:44:57 2000 +++ acpica-unix-20001115/Subsystem/Include/aclinux.h Thu Nov 16 09:18:42 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: aclinux.h - OS specific defines, etc. - * $Revision: 1 $ + * $Revision: 4 $ * *****************************************************************************/ @@ -130,6 +130,14 @@ /* Linux uses GCC */ #include "acgcc.h" + +#undef DEBUGGER_THREADING +#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED + +/* Linux ia32 can't do int64 well */ +#ifndef _IA64 +#define ACPI_NO_INTEGER64_SUPPORT +#endif #if 0 diff -ruN acpica-unix-20001020/Subsystem/Include/aclocal.h acpica-unix-20001115/Subsystem/Include/aclocal.h --- acpica-unix-20001020/Subsystem/Include/aclocal.h Sat Oct 21 06:44:57 2000 +++ acpica-unix-20001115/Subsystem/Include/aclocal.h Thu Nov 16 09:18:42 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: aclocal.h - Internal data types used across the ACPI subsystem - * $Revision: 82 $ + * $Revision: 89 $ * *****************************************************************************/ @@ -268,6 +268,7 @@ #define ANOBJ_AML_ATTACHMENT 0x1 #define ANOBJ_END_OF_PEER_LIST 0x2 +#define ANOBJ_DATA_WIDTH_32 0x4 /* Parent table is 64-bits */ /* @@ -281,6 +282,7 @@ ACPI_TABLE_HEADER *Pointer; void *BasePointer; UINT8 *AmlPointer; + UINT64 PhysicalAddress; UINT32 AmlLength; UINT32 Length; UINT32 Count; @@ -544,8 +546,7 @@ UINT32 ParseArgs; /* Grammar/Parse time arguments */ UINT32 RuntimeArgs; /* Interpret time arguments */ - DEBUG_ONLY_MEMBERS ( - NATIVE_CHAR *Name) /* op name (debug only) */ + DEBUG_ONLY_MEMBERS (NATIVE_CHAR *Name) /* op name (debug only) */ } ACPI_OPCODE_INFO; @@ -572,7 +573,7 @@ DEBUG_ONLY_MEMBERS (\ NATIVE_CHAR OpName[16]) /* op name (debug only) */\ /* NON-DEBUG members below: */\ - ACPI_NAMESPACE_NODE *Node;/* for use by interpreter */\ + ACPI_NAMESPACE_NODE *Node; /* for use by interpreter */\ ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\ @@ -649,7 +650,7 @@ UINT8 CurrentResult; /* */ struct acpi_walk_state *Next; /* Next WalkState in list */ - ACPI_PARSE_OBJECT *Origin; /* Start of walk */ + ACPI_PARSE_OBJECT *Origin; /* Start of walk [Obsolete] */ /* TBD: Obsolete with removal of WALK procedure ? */ ACPI_PARSE_OBJECT *PrevOp; /* Last op that was processed */ @@ -769,72 +770,92 @@ #define MAX_CX_STATE_LATENCY 0xFFFFFFFF #define MAX_CX_STATES 4 + /* * The #define's and enum below establish an abstract way of identifying what * register block and register is to be accessed. Do not change any of the * values as they are used in switch statements and offset calculations. */ -#define REGISTER_BLOCK_MASK 0xFF00 -#define BIT_IN_REGISTER_MASK 0x00FF -#define PM1_EVT 0x0100 -#define PM1_CONTROL 0x0200 -#define PM2_CONTROL 0x0300 -#define PM_TIMER 0x0400 -#define PROCESSOR_BLOCK 0x0500 -#define GPE0_STS_BLOCK 0x0600 -#define GPE0_EN_BLOCK 0x0700 -#define GPE1_STS_BLOCK 0x0800 -#define GPE1_EN_BLOCK 0x0900 - -enum -{ - /* PM1 status register ids */ +#define REGISTER_BLOCK_MASK 0xFF00 /* Register Block Id */ +#define BIT_IN_REGISTER_MASK 0x00FF /* Bit Id in the Register Block Id */ +#define BYTE_IN_REGISTER_MASK 0x00FF /* Register Offset in the Register Block */ - TMR_STS = (PM1_EVT | 0x01), - BM_STS, - GBL_STS, - PWRBTN_STS, - SLPBTN_STS, - RTC_STS, - WAK_STS, +#define REGISTER_BLOCK_ID(RegId) (RegId & REGISTER_BLOCK_MASK) +#define REGISTER_BIT_ID(RegId) (RegId & BIT_IN_REGISTER_MASK) +#define REGISTER_OFFSET(RegId) (RegId & BYTE_IN_REGISTER_MASK) - /* PM1 enable register ids */ +/* + * Access Rule + * To access a Register Bit: + * -> Use Bit Name (= Register Block Id | Bit Id) defined in the enum. + * + * To access a Register: + * -> Use Register Id (= Register Block Id | Register Offset) + */ - TMR_EN, - /* need to skip 1 enable number since there's no bus master enable register */ - GBL_EN = (PM1_EVT | 0x0A), - PWRBTN_EN, - SLPBTN_EN, - RTC_EN, - /* PM1 control register ids */ +/* + * Register Block Id + */ +#define PM1_STS 0x0100 +#define PM1_EN 0x0200 +#define PM1_CONTROL 0x0300 +#define PM2_CONTROL 0x0400 +#define PM_TIMER 0x0500 +#define PROCESSOR_BLOCK 0x0600 +#define GPE0_STS_BLOCK 0x0700 +#define GPE0_EN_BLOCK 0x0800 +#define GPE1_STS_BLOCK 0x0900 +#define GPE1_EN_BLOCK 0x0A00 +#define SMI_CMD_BLOCK 0x0B00 - SCI_EN = (PM1_CONTROL | 0x01), - BM_RLD, - GBL_RLS, - SLP_TYPE_A, - SLP_TYPE_B, - SLP_EN, +/* + * Address space bitmasks for mmio or io spaces + */ - /* PM2 control register ids */ +#define SMI_CMD_ADDRESS_SPACE 0x01 +#define PM1_BLK_ADDRESS_SPACE 0x02 +#define PM2_CNT_BLK_ADDRESS_SPACE 0x04 +#define PM_TMR_BLK_ADDRESS_SPACE 0x08 +#define GPE0_BLK_ADDRESS_SPACE 0x10 +#define GPE1_BLK_ADDRESS_SPACE 0x20 - ARB_DIS = (PM2_CONTROL | 0x01), +/* + * Control bit definitions + */ +#define TMR_STS (PM1_STS | 0x01) +#define BM_STS (PM1_STS | 0x02) +#define GBL_STS (PM1_STS | 0x03) +#define PWRBTN_STS (PM1_STS | 0x04) +#define SLPBTN_STS (PM1_STS | 0x05) +#define RTC_STS (PM1_STS | 0x06) +#define WAK_STS (PM1_STS | 0x07) - /* PM Timer register ids */ +#define TMR_EN (PM1_EN | 0x01) + /* no BM_EN */ +#define GBL_EN (PM1_EN | 0x03) +#define PWRBTN_EN (PM1_EN | 0x04) +#define SLPBTN_EN (PM1_EN | 0x05) +#define RTC_EN (PM1_EN | 0x06) +#define WAK_EN (PM1_EN | 0x07) - TMR_VAL = (PM_TIMER | 0x01), +#define SCI_EN (PM1_CONTROL | 0x01) +#define BM_RLD (PM1_CONTROL | 0x02) +#define GBL_RLS (PM1_CONTROL | 0x03) +#define SLP_TYPE_A (PM1_CONTROL | 0x04) +#define SLP_TYPE_B (PM1_CONTROL | 0x05) +#define SLP_EN (PM1_CONTROL | 0x06) - GPE0_STS = (GPE0_STS_BLOCK | 0x01), - GPE0_EN = (GPE0_EN_BLOCK | 0x01), +#define ARB_DIS (PM2_CONTROL | 0x01) - GPE1_STS = (GPE1_STS_BLOCK | 0x01), - GPE1_EN = (GPE0_EN_BLOCK | 0x01), +#define TMR_VAL (PM_TIMER | 0x01) - /* Last register value is one less than LAST_REG */ +#define GPE0_STS (GPE0_STS_BLOCK | 0x01) +#define GPE0_EN (GPE0_EN_BLOCK | 0x01) - LAST_REG -}; +#define GPE1_STS (GPE1_STS_BLOCK | 0x01) +#define GPE1_EN (GPE1_EN_BLOCK | 0x01) #define TMR_STS_MASK 0x0001 @@ -845,8 +866,9 @@ #define RTC_STS_MASK 0x0400 #define WAK_STS_MASK 0x8000 -#define ALL_FIXED_STS_BITS (TMR_STS_MASK | BM_STS_MASK | GBL_STS_MASK | PWRBTN_STS_MASK | \ - SLPBTN_STS_MASK | RTC_STS_MASK | WAK_STS_MASK) +#define ALL_FIXED_STS_BITS (TMR_STS_MASK | BM_STS_MASK | GBL_STS_MASK \ + | PWRBTN_STS_MASK | SLPBTN_STS_MASK \ + | RTC_STS_MASK | WAK_STS_MASK) #define TMR_EN_MASK 0x0001 #define GBL_EN_MASK 0x0020 @@ -861,6 +883,7 @@ #define SLP_EN_MASK 0x2000 #define ARB_DIS_MASK 0x0001 +#define TMR_VAL_MASK 0xFFFFFFFF #define GPE0_STS_MASK #define GPE0_EN_MASK @@ -871,16 +894,6 @@ #define ACPI_READ 1 #define ACPI_WRITE 2 - -#define LOW_BYTE 0x00FF -#define ONE_BYTE 0x08 - -#ifndef SET - #define SET 1 -#endif -#ifndef CLEAR - #define CLEAR 0 -#endif /* Plug and play */ diff -ruN acpica-unix-20001020/Subsystem/Include/acmacros.h acpica-unix-20001115/Subsystem/Include/acmacros.h --- acpica-unix-20001020/Subsystem/Include/acmacros.h Sat Oct 21 06:44:57 2000 +++ acpica-unix-20001115/Subsystem/Include/acmacros.h Thu Nov 16 09:18:42 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acmacros.h - C macros for the entire subsystem. - * $Revision: 50 $ + * $Revision: 56 $ * *****************************************************************************/ @@ -219,6 +219,11 @@ #define MUL_16(a) _MUL(a,4) #define MOD_16(a) _MOD(a,16) +/* + * Divide and Modulo + */ +#define ACPI_DIVIDE(n,d) ((n) / (d)) +#define ACPI_MODULO(n,d) ((n) % (d)) /* * Rounding macros (Power of two boundaries only) @@ -228,18 +233,35 @@ #define ROUND_UP(value,boundary) (((value) + ((boundary)-1)) & (~((boundary)-1))) #define ROUND_DOWN_TO_32_BITS(a) ROUND_DOWN(a,4) +#define ROUND_DOWN_TO_64_BITS(a) ROUND_DOWN(a,8) #define ROUND_DOWN_TO_NATIVE_WORD(a) ROUND_DOWN(a,ALIGNED_ADDRESS_BOUNDARY) #define ROUND_UP_TO_32BITS(a) ROUND_UP(a,4) +#define ROUND_UP_TO_64BITS(a) ROUND_UP(a,8) #define ROUND_UP_TO_NATIVE_WORD(a) ROUND_UP(a,ALIGNED_ADDRESS_BOUNDARY) #define ROUND_PTR_UP_TO_4(a,b) ((b *)(((NATIVE_UINT)(a) + 3) & ~3)) +#define ROUND_PTR_UP_TO_8(a,b) ((b *)(((NATIVE_UINT)(a) + 7) & ~7)) + +#define ROUND_UP_TO_1K(a) (((a) + 1023) >> 10) #ifdef DEBUG_ASSERT #undef DEBUG_ASSERT #endif +/* Macros for GAS addressing */ + +#define ACPI_PCI_DEVICE_MASK (UINT64) 0x0000FFFF00000000 +#define ACPI_PCI_FUNCTION_MASK (UINT64) 0x00000000FFFF0000 +#define ACPI_PCI_REGISTER_MASK (UINT64) 0x000000000000FFFF + +#define ACPI_PCI_FUNCTION(a) (UINT32) ((((a) & ACPI_PCI_FUNCTION_MASK) >> 16)) +#define ACPI_PCI_DEVICE(a) (UINT32) ((((a) & ACPI_PCI_DEVICE_MASK) >> 32)) +#define ACPI_PCI_REGISTER(a) (UINT32) (((a) & ACPI_PCI_REGISTER_MASK)) +#define ACPI_PCI_DEVFUN(a) (UINT32) ((ACPI_PCI_DEVICE(a) << 16) | ACPI_PCI_FUNCTION(a)) + + /* * An ACPI_HANDLE (which is actually an ACPI_NAMESPACE_NODE *) can appear in some contexts, * such as on apObjStack, where a pointer to an ACPI_OPERAND_OBJECT can also @@ -335,11 +357,11 @@ #else -#define REPORT_INFO(fp) {_ReportInfo("",__LINE__,_COMPONENT); \ +#define REPORT_INFO(fp) {_ReportInfo("ACPI",__LINE__,_COMPONENT); \ DebugPrintRaw PARAM_LIST(fp);} -#define REPORT_ERROR(fp) {_ReportError("",__LINE__,_COMPONENT); \ +#define REPORT_ERROR(fp) {_ReportError("ACPI",__LINE__,_COMPONENT); \ DebugPrintRaw PARAM_LIST(fp);} -#define REPORT_WARNING(fp) {_ReportWarning("",__LINE__,_COMPONENT); \ +#define REPORT_WARNING(fp) {_ReportWarning("ACPI",__LINE__,_COMPONENT); \ DebugPrintRaw PARAM_LIST(fp);} #endif @@ -394,7 +416,7 @@ /* Conditional execution */ -#define DEBUG_EXEC(a) a; +#define DEBUG_EXEC(a) a #define NORMAL_EXEC(a) #define DEBUG_DEFINE(a) a; @@ -499,7 +521,7 @@ * DEBUG_PRINT stuff (set by ACPI_DEBUG) is on, or not. */ #ifdef ENABLE_DEBUGGER -#define DEBUGGER_EXEC(a) a; +#define DEBUGGER_EXEC(a) a #else #define DEBUGGER_EXEC(a) #endif @@ -532,5 +554,6 @@ #define ADD_OBJECT_NAME(a,b) #endif + #endif /* ACMACROS_H */ diff -ruN acpica-unix-20001020/Subsystem/Include/acmsvc.h acpica-unix-20001115/Subsystem/Include/acmsvc.h --- acpica-unix-20001020/Subsystem/Include/acmsvc.h Sat Oct 21 06:44:57 2000 +++ acpica-unix-20001115/Subsystem/Include/acmsvc.h Thu Nov 16 09:18:42 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acmsvc.h - VC specific defines, etc. - * $Revision: 1 $ + * $Revision: 2 $ * *****************************************************************************/ @@ -124,6 +124,9 @@ /* warn C4127: conditional expression is constant */ #pragma warning(disable:4127) + +/* warn C4706: assignment within conditional expression */ +#pragma warning(disable:4706) #endif /* __ACMSVC_H__ */ diff -ruN acpica-unix-20001020/Subsystem/Include/acnamesp.h acpica-unix-20001115/Subsystem/Include/acnamesp.h --- acpica-unix-20001020/Subsystem/Include/acnamesp.h Sat Oct 21 06:44:57 2000 +++ acpica-unix-20001115/Subsystem/Include/acnamesp.h Thu Nov 16 09:18:43 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acnamesp.h - Namespace subcomponent prototypes and defines - * $Revision: 97 $ + * $Revision: 98 $ * *****************************************************************************/ @@ -445,10 +445,6 @@ ACPI_NAMESPACE_NODE *Node, OBJECT_TYPE_INTERNAL Type, ACPI_NAMESPACE_NODE **RetNode); - -ACPI_NAMESPACE_NODE * -AcpiNsCreateNode ( - UINT32 AcpiName); void AcpiNsInstallNode ( diff -ruN acpica-unix-20001020/Subsystem/Include/acobject.h acpica-unix-20001115/Subsystem/Include/acobject.h --- acpica-unix-20001020/Subsystem/Include/acobject.h Sat Oct 21 06:44:57 2000 +++ acpica-unix-20001115/Subsystem/Include/acobject.h Thu Nov 16 09:18:43 2000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Name: acobject.h - Definition of ACPI_OPERAND_OBJECT (Internal object only) - * $Revision: 74 $ + * $Revision: 75 $ * *****************************************************************************/ @@ -310,7 +310,7 @@ UINT8 SpaceId; UINT32 Length; - ACPI_INTEGER Address; + ACPI_PHYSICAL_ADDRESS Address; union acpi_operand_obj *Extra; /* Pointer to executable AML (in region definition) */ union acpi_operand_obj *AddrHandler; /* Handler for system notifies */ diff -ruN acpica-unix-20001020/Subsystem/Include/acpiosxf.h acpica-unix-20001115/Subsystem/Include/acpiosxf.h --- acpica-unix-20001020/Subsystem/Include/acpiosxf.h Sat Oct 21 06:44:58 2000 +++ acpica-unix-20001115/Subsystem/Include/acpiosxf.h Thu Nov 16 09:18:43 2000 @@ -203,7 +203,7 @@ ACPI_STATUS AcpiOsMapMemory ( - void *PhysicalAddress, + ACPI_PHYSICAL_ADDRESS PhysicalAddress, UINT32 Length, void **LogicalAddress); @@ -286,30 +286,29 @@ UINT8 AcpiOsMemIn8 ( - ACPI_MEM_ADDRESS InAddr); - + ACPI_PHYSICAL_ADDRESS InAddr); UINT16 AcpiOsMemIn16 ( - ACPI_MEM_ADDRESS InAddr); + ACPI_PHYSICAL_ADDRESS InAddr); UINT32 AcpiOsMemIn32 ( - ACPI_MEM_ADDRESS InAddr); + ACPI_PHYSICAL_ADDRESS InAddr); void AcpiOsMemOut8 ( - ACPI_MEM_ADDRESS OutAddr, + ACPI_PHYSICAL_ADDRESS OutAddr, UINT8 Value); void AcpiOsMemOut16 ( - ACPI_MEM_ADDRESS OutAddr, + ACPI_PHYSICAL_ADDRESS OutAddr, UINT16 Value); void AcpiOsMemOut32 ( - ACPI_MEM_ADDRESS OutAddr, + ACPI_PHYSICAL_ADDRESS OutAddr, UINT32 Value); diff -ruN acpica-unix-20001020/Subsystem/Include/acpixf.h acpica-unix-20001115/Subsystem/Include/acpixf.h --- acpica-unix-20001020/Subsystem/Include/acpixf.h Sat Oct 21 06:44:58 2000 +++ acpica-unix-20001115/Subsystem/Include/acpixf.h Thu Nov 16 09:18:43 2000 @@ -161,11 +161,11 @@ ACPI_STATUS AcpiFindRootPointer ( - void **RsdpPhysicalAddress); + ACPI_PHYSICAL_ADDRESS *RsdpPhysicalAddress); ACPI_STATUS AcpiLoadTables ( - void *RsdpPhysicalAddress); + ACPI_PHYSICAL_ADDRESS RsdpPhysicalAddress); ACPI_STATUS AcpiLoadTable ( @@ -201,7 +201,6 @@ void *Context, void * *ReturnValue); - ACPI_STATUS AcpiGetDevices ( NATIVE_CHAR *HID, @@ -370,11 +369,11 @@ ACPI_STATUS AcpiSetFirmwareWakingVector ( - void *PhysicalAddress); + ACPI_PHYSICAL_ADDRESS PhysicalAddress); ACPI_STATUS AcpiGetFirmwareWakingVector ( - void **PhysicalAddress); + ACPI_PHYSICAL_ADDRESS *PhysicalAddress); ACPI_STATUS AcpiGetProcessorThrottlingInfo ( diff -ruN acpica-unix-20001020/Subsystem/Include/actables.h acpica-unix-20001115/Subsystem/Include/actables.h --- acpica-unix-20001020/Subsystem/Include/actables.h Sat Oct 21 06:44:58 2000 +++ acpica-unix-20001115/Subsystem/Include/actables.h Thu Nov 16 09:18:43 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: actables.h - ACPI table management - * $Revision: 22 $ + * $Revision: 27 $ * *****************************************************************************/ @@ -128,6 +128,23 @@ UINT16 TableId, ACPI_TABLE_DESC **TableDesc); +/* + * tbconvrt - Table conversion routines + */ + +ACPI_STATUS +AcpiTbConvertToXsdt ( + ACPI_TABLE_DESC *TableInfo, + UINT32 *NumberOfTables); + +ACPI_STATUS +AcpiTbConvertTableFadt ( + void); + +ACPI_STATUS +AcpiTbBuildCommonFacs ( + ACPI_TABLE_DESC *TableInfo); + /* * tbget - Table "get" routines @@ -141,13 +158,13 @@ ACPI_STATUS AcpiTbGetTable ( - void *PhysicalAddress, + ACPI_PHYSICAL_ADDRESS PhysicalAddress, ACPI_TABLE_HEADER *BufferPtr, ACPI_TABLE_DESC *TableInfo); ACPI_STATUS AcpiTbVerifyRsdp ( - void *RSDP_PhysicalAddress); + ACPI_PHYSICAL_ADDRESS RSDP_PhysicalAddress); ACPI_STATUS AcpiTbGetTableFacs ( @@ -238,7 +255,7 @@ ACPI_STATUS AcpiTbMapAcpiTable ( - void *PhysicalAddress, + ACPI_PHYSICAL_ADDRESS PhysicalAddress, UINT32 *Size, void **LogicalAddress); diff -ruN acpica-unix-20001020/Subsystem/Include/actbl.h acpica-unix-20001115/Subsystem/Include/actbl.h --- acpica-unix-20001020/Subsystem/Include/actbl.h Sat Oct 21 06:44:58 2000 +++ acpica-unix-20001115/Subsystem/Include/actbl.h Thu Nov 16 09:18:43 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: actbl.h - Table data structures defined in ACPI specification - * $Revision: 35 $ + * $Revision: 43 $ * *****************************************************************************/ @@ -122,33 +122,47 @@ * Values for description table header signatures */ -#define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */ -#define APIC_SIG "APIC" /* Multiple APIC Description Table */ -#define DSDT_SIG "DSDT" /* Differentiated System Description Table */ -#define FACP_SIG "FACP" /* Fixed ACPI Description Table */ -#define FACS_SIG "FACS" /* Firmware ACPI Control Structure */ -#define PSDT_SIG "PSDT" /* Persistent System Description Table */ -#define RSDT_SIG "RSDT" /* Root System Description Table */ -#define SSDT_SIG "SSDT" /* Secondary System Description Table */ -#define SBST_SIG "SBST" /* Smart Battery Specification Table */ -#define SPIC_SIG "SPIC" /* iosapic table */ -#define BOOT_SIG "BOOT" /* Boot table */ +#define RSDP_NAME "RSDP" +#define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */ +#define APIC_SIG "APIC" /* Multiple APIC Description Table */ +#define DSDT_SIG "DSDT" /* Differentiated System Description Table */ +#define FADT_SIG "FACP" /* Fixed ACPI Description Table */ +#define FACS_SIG "FACS" /* Firmware ACPI Control Structure */ +#define PSDT_SIG "PSDT" /* Persistent System Description Table */ +#define RSDT_SIG "RSDT" /* Root System Description Table */ +#define XSDT_SIG "XSDT" /* Extended System Description Table */ +#define SSDT_SIG "SSDT" /* Secondary System Description Table */ +#define SBST_SIG "SBST" /* Smart Battery Specification Table */ +#define SPIC_SIG "SPIC" /* iosapic table */ +#define BOOT_SIG "BOOT" /* Boot table */ -#define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */ +#define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */ /* values of Mapic.Model */ -#define DUAL_PIC 0 -#define MULTIPLE_APIC 1 +#define DUAL_PIC 0 +#define MULTIPLE_APIC 1 /* values of Type in APIC_HEADER */ -#define APIC_PROC 0 -#define APIC_IO 1 +#define APIC_PROC 0 +#define APIC_IO 1 /* + * Common table types. The base code can remain + * constant if the underlying tables are changed + */ +#define RSDT_DESCRIPTOR RSDT_DESCRIPTOR_REV2 +#define XSDT_DESCRIPTOR XSDT_DESCRIPTOR_REV2 +#define FACS_DESCRIPTOR FACS_DESCRIPTOR_REV2 +#define FADT_DESCRIPTOR FADT_DESCRIPTOR_REV2 + + +#pragma pack(1) + +/* * Architecture-independent tables * The architecture dependent tables are in separate files */ @@ -158,10 +172,14 @@ NATIVE_CHAR Signature [8]; /* contains "RSD PTR " */ UINT8 Checksum; /* to make sum of struct == 0 */ NATIVE_CHAR OemId [6]; /* OEM identification */ - UINT8 Reserved; /* reserved - must be zero */ - UINT32 RsdtPhysicalAddress; /* physical address of RSDT */ + UINT8 Revision; /* Must be 0 for 1.0, 2 for 2.0 */ + UINT32 RsdtPhysicalAddress; /* 32-bit physical address of RSDT */ + UINT32 Length; /* XSDT Length in bytes including hdr */ + UINT64 XsdtPhysicalAddress; /* 64-bit physical address of XSDT */ + UINT8 ExtendedChecksum; /* Checksum of entire table */ + NATIVE_CHAR Reserved [3]; /* reserved field must be 0 */ -} ROOT_SYSTEM_DESCRIPTOR_POINTER; +} RSDP_DESCRIPTOR; typedef struct /* ACPI common table header */ @@ -180,6 +198,15 @@ } ACPI_TABLE_HEADER; +typedef struct /* Common FACS for internal use */ +{ + UINT32 *GlobalLock; + UINT64 *FirmwareWakingVector; + UINT8 VectorWidth; + +} ACPI_COMMON_FACS; + + typedef struct /* APIC Table */ { ACPI_TABLE_HEADER header; /* table header */ @@ -238,6 +265,9 @@ } SMART_BATTERY_DESCRIPTION_TABLE; +#pragma pack() + + /* * ACPI Table information. We save the table address, length, * and type of memory allocation (mapped or allocated) for each @@ -267,16 +297,12 @@ } ACPI_TABLE_SUPPORT; - /* * Get the architecture-specific tables */ -#ifdef IA64 -#include "actbl64.h" -#else -#include "actbl32.h" -#endif - +#include "actbl1.h" /* Acpi 1.0 table defintions */ +#include "actbl71.h" /* Acpi 0.71 IA-64 Extension table defintions */ +#include "actbl2.h" /* Acpi 2.0 table definitions */ #endif /* __ACTBL_H__ */ diff -ruN acpica-unix-20001020/Subsystem/Include/actbl1.h acpica-unix-20001115/Subsystem/Include/actbl1.h --- acpica-unix-20001020/Subsystem/Include/actbl1.h Thu Jan 1 09:00:00 1970 +++ acpica-unix-20001115/Subsystem/Include/actbl1.h Thu Nov 16 09:18:43 2000 @@ -0,0 +1,214 @@ +/****************************************************************************** + * + * Name: actbl1.h - ACPI 1.0 tables + * $Revision: 15 $ + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999, Intel Corp. All rights + * reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#ifndef __ACTBL1_H__ +#define __ACTBL1_H__ + +#pragma pack(1) + +/*************************************/ +/* ACPI Specification Rev 1.0 for */ +/* the Root System Description Table */ +/*************************************/ +typedef struct +{ + ACPI_TABLE_HEADER header; /* Table header */ + UINT32 TableOffsetEntry [1]; /* Array of pointers to other */ + /* ACPI tables */ +} RSDT_DESCRIPTOR_REV1; + + +/***************************************/ +/* ACPI Specification Rev 1.0 for */ +/* the Firmware ACPI Control Structure */ +/***************************************/ +typedef struct +{ + NATIVE_CHAR Signature[4]; /* signature "FACS" */ + UINT32 Length; /* length of structure, in bytes */ + UINT32 HardwareSignature; /* hardware configuration signature */ + UINT32 FirmwareWakingVector; /* ACPI OS waking vector */ + UINT32 GlobalLock; /* Global Lock */ + UINT32_BIT S4Bios_f : 1; /* Indicates if S4BIOS support is present */ + UINT32_BIT Reserved1 : 31; /* must be 0 */ + UINT8 Resverved3 [40]; /* reserved - must be zero */ + +} FACS_DESCRIPTOR_REV1; + + +/************************************/ +/* ACPI Specification Rev 1.0 for */ +/* the Fixed ACPI Description Table */ +/************************************/ +typedef struct +{ + ACPI_TABLE_HEADER header; /* table header */ + UINT32 FirmwareCtrl; /* Physical address of FACS */ + UINT32 Dsdt; /* Physical address of DSDT */ + UINT8 Model; /* System Interrupt Model */ + UINT8 Reserved1; /* reserved */ + UINT16 SciInt; /* System vector of SCI interrupt */ + UINT32 SmiCmd; /* Port address of SMI command port */ + UINT8 AcpiEnable; /* value to write to smi_cmd to enable ACPI */ + UINT8 AcpiDisable; /* value to write to smi_cmd to disable ACPI */ + UINT8 S4BiosReq; /* Value to write to SMI CMD to enter S4BIOS state */ + UINT8 Reserved2; /* reserved - must be zero */ + UINT32 Pm1aEvtBlk; /* Port address of Power Mgt 1a AcpiEvent Reg Blk */ + UINT32 Pm1bEvtBlk; /* Port address of Power Mgt 1b AcpiEvent Reg Blk */ + UINT32 Pm1aCntBlk; /* Port address of Power Mgt 1a Control Reg Blk */ + UINT32 Pm1bCntBlk; /* Port address of Power Mgt 1b Control Reg Blk */ + UINT32 Pm2CntBlk; /* Port address of Power Mgt 2 Control Reg Blk */ + UINT32 PmTmrBlk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ + UINT32 Gpe0Blk; /* Port addr of General Purpose AcpiEvent 0 Reg Blk */ + UINT32 Gpe1Blk; /* Port addr of General Purpose AcpiEvent 1 Reg Blk */ + UINT8 Pm1EvtLen; /* Byte Length of ports at pm1X_evt_blk */ + UINT8 Pm1CntLen; /* Byte Length of ports at pm1X_cnt_blk */ + UINT8 Pm2CntLen; /* Byte Length of ports at pm2_cnt_blk */ + UINT8 PmTmLen; /* Byte Length of ports at pm_tm_blk */ + UINT8 Gpe0BlkLen; /* Byte Length of ports at gpe0_blk */ + UINT8 Gpe1BlkLen; /* Byte Length of ports at gpe1_blk */ + UINT8 Gpe1Base; /* offset in gpe model where gpe1 events start */ + UINT8 Reserved3; /* reserved */ + UINT16 Plvl2Lat; /* worst case HW latency to enter/exit C2 state */ + UINT16 Plvl3Lat; /* worst case HW latency to enter/exit C3 state */ + UINT16 FlushSize; /* Size of area read to flush caches */ + UINT16 FlushStride; /* Stride used in flushing caches */ + UINT8 DutyOffset; /* bit location of duty cycle field in p_cnt reg */ + UINT8 DutyWidth; /* bit width of duty cycle field in p_cnt reg */ + 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 */ + UINT8 Reserved4; /* reserved */ + UINT8 Reserved4a; /* reserved */ + UINT8 Reserved4b; /* reserved */ + UINT32_BIT WbInvd : 1; /* wbinvd instruction works properly */ + UINT32_BIT WbInvdFlush : 1; /* wbinvd flushes but does not invalidate */ + UINT32_BIT ProcC1 : 1; /* all processors support C1 state */ + UINT32_BIT Plvl2Up : 1; /* C2 state works on MP system */ + UINT32_BIT PwrButton : 1; /* Power button is handled as a generic feature */ + UINT32_BIT SleepButton : 1; /* Sleep button is handled as a generic feature, or not present */ + UINT32_BIT FixedRTC : 1; /* RTC wakeup stat not in fixed register space */ + UINT32_BIT Rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ + UINT32_BIT TmrValExt : 1; /* tmr_val is 32 bits */ + UINT32_BIT Reserved5 : 23; /* reserved - must be zero */ + +} FADT_DESCRIPTOR_REV1; + +#pragma pack() + +#endif /* __ACTBL1_H__ */ + + diff -ruN acpica-unix-20001020/Subsystem/Include/actbl2.h acpica-unix-20001115/Subsystem/Include/actbl2.h --- acpica-unix-20001020/Subsystem/Include/actbl2.h Thu Jan 1 09:00:00 1970 +++ acpica-unix-20001115/Subsystem/Include/actbl2.h Thu Nov 16 09:18:44 2000 @@ -0,0 +1,280 @@ +/****************************************************************************** + * + * Name: actbl2.h - ACPI Specification Revision 2.0 Tables + * $Revision: 19 $ + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999, Intel Corp. All rights + * reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#ifndef __ACTBL2_H__ +#define __ACTBL2_H__ + +/**************************************/ +/* Prefered Power Management Profiles */ +/**************************************/ +#define PM_UNSPECIFIED 0 +#define PM_DESKTOP 1 +#define PM_MOBILE 2 +#define PM_WORKSTATION 3 +#define PM_ENTERPRISE_SERVER 4 +#define PM_SOHO_SERVER 5 +#define PM_APPLIANCE_PC 6 + +/*********************************************/ +/* ACPI Boot Arch Flags, See spec Table 5-10 */ +/*********************************************/ +#define BAF_LEGACY_DEVICES 0x0001 +#define BAF_8042_KEYBOARD_CONTROLLER 0x0002 + +#define FADT2_REVISION_ID 3 + +#pragma pack(1) + +/*************************************/ +/* ACPI Specification Rev 2.0 for */ +/* the Root System Description Table */ +/*************************************/ +typedef struct +{ + ACPI_TABLE_HEADER header; /* Table header */ + UINT32 TableOffsetEntry [1]; /* Array of pointers to */ + /* other tables' headers */ +} RSDT_DESCRIPTOR_REV2; + + +/********************************************/ +/* ACPI Specification Rev 2.0 for the */ +/* Extended System Description Table (XSDT) */ +/********************************************/ +typedef struct +{ + ACPI_TABLE_HEADER Header; /* Table header */ + UINT64 TableOffsetEntry [1]; /* Array of pointers to */ + /* other tables' headers */ +} XSDT_DESCRIPTOR_REV2; + +/***************************************/ +/* ACPI Specification Rev 2.0 for */ +/* the Firmware ACPI Control Structure */ +/***************************************/ +typedef struct +{ + NATIVE_CHAR Signature[4]; /* signature "FACS" */ + UINT32 Length; /* length of structure, in bytes */ + UINT32 HardwareSignature; /* hardware configuration signature */ + UINT32 FirmwareWakingVector; /* 32bit physical address of the Firmware Waking Vector. */ + UINT32 GlobalLock; /* Global Lock used to synchronize access to shared hardware resources */ + UINT32_BIT S4Bios_f : 1; /* Indicates if S4BIOS support is present */ + UINT32_BIT Reserved1 : 31; /* must be 0 */ + UINT64 XFirmwareWakingVector; /* 64bit physical address of the Firmware Waking Vector. */ + UINT8 Version; /* Version of this table */ + UINT8 Reserved3 [31]; /* reserved - must be zero */ + +} FACS_DESCRIPTOR_REV2; + + +/***************************************/ +/* ACPI Specification Rev 2.0 for */ +/* the Generic Address Structure (GAS) */ +/***************************************/ +typedef struct +{ + UINT8 AddressSpaceId; /* Address space where struct or register exists. */ + UINT8 RegisterBitWidth; /* Size in bits of given register */ + UINT8 RegisterBitOffset; /* Bit offset within the register */ + UINT8 Reserved; /* Must be 0 */ + UINT64 Address; /* 64-bit address of struct or register */ + +} ACPI_GAS; + + +/************************************/ +/* ACPI Specification Rev 2.0 for */ +/* the Fixed ACPI Description Table */ +/************************************/ +typedef struct +{ + ACPI_TABLE_HEADER header; /* table header */ + UINT32 V1_FirmwareCtrl; /* 32-bit physical address of FACS */ + UINT32 V1_Dsdt; /* 32-bit physical address of DSDT */ + UINT8 Reserved1; /* System Interrupt Model isn't used in ACPI 2.0*/ + UINT8 Prefer_PM_Profile; /* Conveys preferred power management profile to OSPM. */ + UINT16 SciInt; /* System vector of SCI interrupt */ + UINT32 SmiCmd; /* Port address of SMI command port */ + UINT8 AcpiEnable; /* value to write to smi_cmd to enable ACPI */ + UINT8 AcpiDisable; /* value to write to smi_cmd to disable ACPI */ + UINT8 S4BiosReq; /* Value to write to SMI CMD to enter S4BIOS state */ + UINT8 PstateCnt; /* processor performance state control*/ + UINT32 V1_Pm1aEvtBlk; /* Port address of Power Mgt 1a AcpiEvent Reg Blk */ + UINT32 V1_Pm1bEvtBlk; /* Port address of Power Mgt 1b AcpiEvent Reg Blk */ + UINT32 V1_Pm1aCntBlk; /* Port address of Power Mgt 1a Control Reg Blk */ + UINT32 V1_Pm1bCntBlk; /* Port address of Power Mgt 1b Control Reg Blk */ + UINT32 V1_Pm2CntBlk; /* Port address of Power Mgt 2 Control Reg Blk */ + UINT32 V1_PmTmrBlk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ + UINT32 V1_Gpe0Blk; /* Port addr of General Purpose AcpiEvent 0 Reg Blk */ + UINT32 V1_Gpe1Blk; /* Port addr of General Purpose AcpiEvent 1 Reg Blk */ + UINT8 Pm1EvtLen; /* Byte Length of ports at pm1X_evt_blk */ + UINT8 Pm1CntLen; /* Byte Length of ports at pm1X_cnt_blk */ + UINT8 Pm2CntLen; /* Byte Length of ports at pm2_cnt_blk */ + UINT8 PmTmLen; /* Byte Length of ports at pm_tm_blk */ + UINT8 Gpe0BlkLen; /* Byte Length of ports at gpe0_blk */ + UINT8 Gpe1BlkLen; /* Byte Length of ports at gpe1_blk */ + UINT8 Gpe1Base; /* offset in gpe model where gpe1 events start */ + UINT8 CstCnt; /* Support for the _CST object and C States change notification.*/ + UINT16 Plvl2Lat; /* worst case HW latency to enter/exit C2 state */ + 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 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 */ + UINT16 IapcBootArch; /* IA-PC Boot Architecture Flags. See Table 5-10 for description*/ + UINT8 Reserved2; /* reserved */ + UINT32_BIT WbInvd : 1; /* wbinvd instruction works properly */ + UINT32_BIT WbInvdFlush : 1; /* wbinvd flushes but does not invalidate */ + UINT32_BIT ProcC1 : 1; /* all processors support C1 state */ + UINT32_BIT Plvl2Up : 1; /* C2 state works on MP system */ + UINT32_BIT PwrButton : 1; /* Power button is handled as a generic feature */ + UINT32_BIT SleepButton : 1; /* Sleep button is handled as a generic feature, or not present */ + UINT32_BIT FixedRTC : 1; /* RTC wakeup stat not in fixed register space */ + UINT32_BIT Rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ + UINT32_BIT TmrValExt : 1; /* tmr_val is 32 bits */ + UINT32_BIT DockCap : 1; /* Supports Docking */ + UINT32_BIT ResetRegSup : 1; /* Indicates system supports system reset via the FADT RESET_REG*/ + UINT32_BIT SealedCase : 1; /* Indicates system has no internal expansion capabilities and case is sealed. */ + UINT32_BIT Headless : 1; /* Indicates system does not have local video capabilities or local input devices.*/ + UINT32_BIT CpuSwSleep : 1; /* Indicates to OSPM that a processor native instruction */ + /* must be executed after writing the SLP_TYPx register. */ + UINT32_BIT Reserved6 : 18; /* reserved - must be zero */ + + ACPI_GAS ResetRegister; /* Reset register address in GAS format */ + UINT8 ResetValue; /* Value to write to the ResetRegister port to reset the system. */ + UINT8 Reserved7[3]; /* These three bytes must be zero */ + UINT64 XFirmwareCtrl; /* 64-bit physical address of FACS */ + UINT64 XDsdt; /* 64-bit physical address of DSDT */ + ACPI_GAS XPm1aEvtBlk; /* Extended Power Mgt 1a AcpiEvent Reg Blk address */ + ACPI_GAS XPm1bEvtBlk; /* Extended Power Mgt 1b AcpiEvent Reg Blk address */ + ACPI_GAS XPm1aCntBlk; /* Extended Power Mgt 1a Control Reg Blk address */ + ACPI_GAS XPm1bCntBlk; /* Extended Power Mgt 1b Control Reg Blk address */ + ACPI_GAS XPm2CntBlk; /* Extended Power Mgt 2 Control Reg Blk address */ + ACPI_GAS XPmTmrBlk; /* Extended Power Mgt Timer Ctrl Reg Blk address */ + ACPI_GAS XGpe0Blk; /* Extended General Purpose AcpiEvent 0 Reg Blk address */ + ACPI_GAS XGpe1Blk; /* Extended General Purpose AcpiEvent 1 Reg Blk address */ + +} FADT_DESCRIPTOR_REV2; + + +#pragma pack() + +#endif /* __ACTBL2_H__ */ + diff -ruN acpica-unix-20001020/Subsystem/Include/actbl32.h acpica-unix-20001115/Subsystem/Include/actbl32.h --- acpica-unix-20001020/Subsystem/Include/actbl32.h Sat Oct 21 06:44:58 2000 +++ acpica-unix-20001115/Subsystem/Include/actbl32.h Thu Jan 1 09:00:00 1970 @@ -1,206 +0,0 @@ -/****************************************************************************** - * - * Name: actbl32.h - ACPI tables specific to IA32 - * $Revision: 11 $ - * - *****************************************************************************/ - -/****************************************************************************** - * - * 1. Copyright Notice - * - * Some or all of this work - Copyright (c) 1999, Intel Corp. All rights - * reserved. - * - * 2. License - * - * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided - * you this software, covering your right to use that party's intellectual - * property rights. - * - * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a - * copy of the source code appearing in this file ("Covered Code") an - * irrevocable, perpetual, worldwide license under Intel's copyrights in the - * base code distributed originally by Intel ("Original Intel Code") to copy, - * make derivatives, distribute, use and display any portion of the Covered - * Code in any form, with the right to sublicense such rights; and - * - * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent - * license (with the right to sublicense), under only those claims of Intel - * patents that are infringed by the Original Intel Code, to make, use, sell, - * offer to sell, and import the Covered Code and derivative works thereof - * solely to the minimum extent necessary to exercise the above copyright - * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right - * is granted directly or by implication, estoppel or otherwise; - * - * The above copyright and patent license is granted only if the following - * conditions are met: - * - * 3. Conditions - * - * 3.1. Redistribution of Source with Rights to Further Distribute Source. - * Redistribution of source code of any substantial portion of the Covered - * Code or modification with rights to further distribute source must include - * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, - * Licensee must cause all Covered Code to which Licensee contributes to - * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee - * must include a prominent statement that the modification is derived, - * directly or indirectly, from Original Intel Code. - * - * 3.2. Redistribution of Source with no Rights to Further Distribute Source. - * Redistribution of source code of any substantial portion of the Covered - * Code or modification without rights to further distribute source must - * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In - * addition, Licensee may not authorize further sublicense of source of any - * portion of the Covered Code, and must include terms to the effect that the - * license from Licensee to its licensee is limited to the intellectual - * property embodied in the software Licensee provides to its licensee, and - * not to intellectual property embodied in modifications its licensee may - * make. - * - * 3.3. Redistribution of Executable. Redistribution in executable form of any - * substantial portion of the Covered Code or modification must reproduce the - * above Copyright Notice, and the following Disclaimer and Export Compliance - * provision in the documentation and/or other materials provided with the - * distribution. - * - * 3.4. Intel retains all right, title, and interest in and to the Original - * Intel Code. - * - * 3.5. Neither the name Intel nor any other trademark owned or controlled by - * Intel shall be used in advertising or otherwise to promote the sale, use or - * other dealings in products derived from or relating to the Covered Code - * without prior written authorization from Intel. - * - * 4. Disclaimer and Export Compliance - * - * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A - * PARTICULAR PURPOSE. - * - * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES - * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR - * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, - * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY - * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS - * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY - * LIMITED REMEDY. - * - * 4.3. Licensee shall not export, either directly or indirectly, any of this - * software or system incorporating such software without first obtaining any - * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the - * event Licensee exports any such software from the United States or - * re-exports any such software from a foreign destination, Licensee shall - * ensure that the distribution and export/re-export of the software is in - * compliance with all laws, regulations, orders, or other restrictions of the - * U.S. Export Administration Regulations. Licensee agrees that neither it nor - * any of its subsidiaries will export/re-export any technical data, process, - * software, or service, directly or indirectly, to any country for which the - * United States government or any agency thereof requires an export license, - * other governmental approval, or letter of assurance, without first obtaining - * such license, approval or letter. - * - *****************************************************************************/ - -#ifndef __ACTBL32_H__ -#define __ACTBL32_H__ - - -/* IA32 Root System Description Table */ - -typedef struct -{ - ACPI_TABLE_HEADER header; /* Table header */ - void *TableOffsetEntry [1]; /* Array of pointers to other */ - /* tables' headers */ -} ROOT_SYSTEM_DESCRIPTION_TABLE; - - -/* IA32 Firmware ACPI Control Structure */ - -typedef struct -{ - NATIVE_CHAR Signature[4]; /* signature "FACS" */ - UINT32 Length; /* length of structure, in bytes */ - UINT32 HardwareSignature; /* hardware configuration signature */ - UINT32 FirmwareWakingVector; /* ACPI OS waking vector */ - UINT32 GlobalLock; /* Global Lock */ - UINT32_BIT S4Bios_f : 1; /* Indicates if S4BIOS support is present */ - UINT32_BIT Reserved1 : 31; /* must be 0 */ - UINT8 Resverved3 [40]; /* reserved - must be zero */ - -} FIRMWARE_ACPI_CONTROL_STRUCTURE; - - -/* IA32 Fixed ACPI Description Table */ - -typedef struct -{ - ACPI_TABLE_HEADER header; /* table header */ - ACPI_TBLPTR FirmwareCtrl; /* Physical address of FACS */ - ACPI_TBLPTR Dsdt; /* Physical address of DSDT */ - UINT8 Model; /* System Interrupt Model */ - UINT8 Reserved1; /* reserved */ - UINT16 SciInt; /* System vector of SCI interrupt */ - ACPI_IO_ADDRESS SmiCmd; /* Port address of SMI command port */ - UINT8 AcpiEnable; /* value to write to smi_cmd to enable ACPI */ - UINT8 AcpiDisable; /* value to write to smi_cmd to disable ACPI */ - UINT8 S4BiosReq; /* Value to write to SMI CMD to enter S4BIOS state */ - UINT8 Reserved2; /* reserved - must be zero */ - ACPI_IO_ADDRESS Pm1aEvtBlk; /* Port address of Power Mgt 1a AcpiEvent Reg Blk */ - ACPI_IO_ADDRESS Pm1bEvtBlk; /* Port address of Power Mgt 1b AcpiEvent Reg Blk */ - ACPI_IO_ADDRESS Pm1aCntBlk; /* Port address of Power Mgt 1a Control Reg Blk */ - ACPI_IO_ADDRESS Pm1bCntBlk; /* Port address of Power Mgt 1b Control Reg Blk */ - ACPI_IO_ADDRESS Pm2CntBlk; /* Port address of Power Mgt 2 Control Reg Blk */ - ACPI_IO_ADDRESS PmTmrBlk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ - ACPI_IO_ADDRESS Gpe0Blk; /* Port addr of General Purpose AcpiEvent 0 Reg Blk */ - ACPI_IO_ADDRESS Gpe1Blk; /* Port addr of General Purpose AcpiEvent 1 Reg Blk */ - UINT8 Pm1EvtLen; /* Byte Length of ports at pm1X_evt_blk */ - UINT8 Pm1CntLen; /* Byte Length of ports at pm1X_cnt_blk */ - UINT8 Pm2CntLen; /* Byte Length of ports at pm2_cnt_blk */ - UINT8 PmTmLen; /* Byte Length of ports at pm_tm_blk */ - UINT8 Gpe0BlkLen; /* Byte Length of ports at gpe0_blk */ - UINT8 Gpe1BlkLen; /* Byte Length of ports at gpe1_blk */ - UINT8 Gpe1Base; /* offset in gpe model where gpe1 events start */ - UINT8 Reserved3; /* reserved */ - UINT16 Plvl2Lat; /* worst case HW latency to enter/exit C2 state */ - UINT16 Plvl3Lat; /* worst case HW latency to enter/exit C3 state */ - UINT16 FlushSize; /* Size of area read to flush caches */ - UINT16 FlushStride; /* Stride used in flushing caches */ - UINT8 DutyOffset; /* bit location of duty cycle field in p_cnt reg */ - UINT8 DutyWidth; /* bit width of duty cycle field in p_cnt reg */ - 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 */ - UINT8 Reserved4; /* reserved */ - UINT8 Reserved4a; /* reserved */ - UINT8 Reserved4b; /* reserved */ - UINT32_BIT WbInvd : 1; /* wbinvd instruction works properly */ - UINT32_BIT WbInvdFlush : 1; /* wbinvd flushes but does not invalidate */ - UINT32_BIT ProcC1 : 1; /* all processors support C1 state */ - UINT32_BIT Plvl2Up : 1; /* C2 state works on MP system */ - UINT32_BIT PwrButton : 1; /* Power button is handled as a generic feature */ - UINT32_BIT SleepButton : 1; /* Sleep button is handled as a generic feature, or not present */ - UINT32_BIT FixedRTC : 1; /* RTC wakeup stat not in fixed register space */ - UINT32_BIT Rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ - UINT32_BIT TmrValExt : 1; /* tmr_val is 32 bits */ - UINT32_BIT Reserved5 : 23; /* reserved - must be zero */ - -} FIXED_ACPI_DESCRIPTION_TABLE; - - -#endif /* __ACTBL32_H__ */ - - diff -ruN acpica-unix-20001020/Subsystem/Include/actbl64.h acpica-unix-20001115/Subsystem/Include/actbl64.h --- acpica-unix-20001020/Subsystem/Include/actbl64.h Sat Oct 21 06:44:58 2000 +++ acpica-unix-20001115/Subsystem/Include/actbl64.h Thu Jan 1 09:00:00 1970 @@ -1,206 +0,0 @@ -/****************************************************************************** - * - * Name: actbl64.h - ACPI tables specific to IA64 - * $Revision: 12 $ - * - *****************************************************************************/ - -/****************************************************************************** - * - * 1. Copyright Notice - * - * Some or all of this work - Copyright (c) 1999, Intel Corp. All rights - * reserved. - * - * 2. License - * - * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided - * you this software, covering your right to use that party's intellectual - * property rights. - * - * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a - * copy of the source code appearing in this file ("Covered Code") an - * irrevocable, perpetual, worldwide license under Intel's copyrights in the - * base code distributed originally by Intel ("Original Intel Code") to copy, - * make derivatives, distribute, use and display any portion of the Covered - * Code in any form, with the right to sublicense such rights; and - * - * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent - * license (with the right to sublicense), under only those claims of Intel - * patents that are infringed by the Original Intel Code, to make, use, sell, - * offer to sell, and import the Covered Code and derivative works thereof - * solely to the minimum extent necessary to exercise the above copyright - * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right - * is granted directly or by implication, estoppel or otherwise; - * - * The above copyright and patent license is granted only if the following - * conditions are met: - * - * 3. Conditions - * - * 3.1. Redistribution of Source with Rights to Further Distribute Source. - * Redistribution of source code of any substantial portion of the Covered - * Code or modification with rights to further distribute source must include - * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, - * Licensee must cause all Covered Code to which Licensee contributes to - * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee - * must include a prominent statement that the modification is derived, - * directly or indirectly, from Original Intel Code. - * - * 3.2. Redistribution of Source with no Rights to Further Distribute Source. - * Redistribution of source code of any substantial portion of the Covered - * Code or modification without rights to further distribute source must - * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In - * addition, Licensee may not authorize further sublicense of source of any - * portion of the Covered Code, and must include terms to the effect that the - * license from Licensee to its licensee is limited to the intellectual - * property embodied in the software Licensee provides to its licensee, and - * not to intellectual property embodied in modifications its licensee may - * make. - * - * 3.3. Redistribution of Executable. Redistribution in executable form of any - * substantial portion of the Covered Code or modification must reproduce the - * above Copyright Notice, and the following Disclaimer and Export Compliance - * provision in the documentation and/or other materials provided with the - * distribution. - * - * 3.4. Intel retains all right, title, and interest in and to the Original - * Intel Code. - * - * 3.5. Neither the name Intel nor any other trademark owned or controlled by - * Intel shall be used in advertising or otherwise to promote the sale, use or - * other dealings in products derived from or relating to the Covered Code - * without prior written authorization from Intel. - * - * 4. Disclaimer and Export Compliance - * - * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY - * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A - * PARTICULAR PURPOSE. - * - * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES - * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR - * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, - * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY - * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS - * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY - * LIMITED REMEDY. - * - * 4.3. Licensee shall not export, either directly or indirectly, any of this - * software or system incorporating such software without first obtaining any - * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the - * event Licensee exports any such software from the United States or - * re-exports any such software from a foreign destination, Licensee shall - * ensure that the distribution and export/re-export of the software is in - * compliance with all laws, regulations, orders, or other restrictions of the - * U.S. Export Administration Regulations. Licensee agrees that neither it nor - * any of its subsidiaries will export/re-export any technical data, process, - * software, or service, directly or indirectly, to any country for which the - * United States government or any agency thereof requires an export license, - * other governmental approval, or letter of assurance, without first obtaining - * such license, approval or letter. - * - *****************************************************************************/ - -#ifndef __ACTBL64_H__ -#define __ACTBL64_H__ - - -typedef UINT64 IO_ADDRESS; /* Only for clarity in declarations */ - - -/* IA64 Root System Description Table */ - -typedef struct -{ - ACPI_TABLE_HEADER header; /* Table header */ - UINT32 ReservedPad; /* IA64 alignment, must be 0 */ - void *TableOffsetEntry [1]; /* Array of pointers to other */ - /* tables' headers */ -} ROOT_SYSTEM_DESCRIPTION_TABLE; - - -/* IA64 Firmware ACPI Control Structure */ - -typedef struct -{ - NATIVE_CHAR Signature[4]; /* signature "FACS" */ - UINT32 Length; /* length of structure, in bytes */ - UINT32 HardwareSignature; /* hardware configuration signature */ - UINT32 Reserved4; /* must be 0 */ - UINT64 FirmwareWakingVector; /* ACPI OS waking vector */ - UINT64 GlobalLock; /* Global Lock */ - UINT32_BIT S4Bios_f : 1; /* Indicates if S4BIOS support is present */ - UINT32_BIT Reserved1 : 31; /* must be 0 */ - UINT8 Resverved3 [28]; /* reserved - must be zero */ - -} FIRMWARE_ACPI_CONTROL_STRUCTURE; - - -/* IA64 Fixed ACPI Description Table */ - -typedef struct -{ - ACPI_TABLE_HEADER header; /* table header */ - UINT32 ReservedPad; /* IA64 alignment, must be 0 */ - ACPI_TBLPTR FirmwareCtrl; /* Physical address of FACS */ - ACPI_TBLPTR Dsdt; /* Physical address of DSDT */ - UINT8 Model; /* System Interrupt Model */ - UINT8 AddressSpace; /* Address Space Bitmask */ - UINT16 SciInt; /* System vector of SCI interrupt */ - UINT8 AcpiEnable; /* value to write to smi_cmd to enable ACPI */ - UINT8 AcpiDisable; /* value to write to smi_cmd to disable ACPI */ - UINT8 S4BiosReq; /* Value to write to SMI CMD to enter S4BIOS state */ - UINT8 Reserved2; /* reserved - must be zero */ - UINT64 SmiCmd; /* Port address of SMI command port */ - UINT64 Pm1aEvtBlk; /* Port address of Power Mgt 1a AcpiEvent Reg Blk */ - UINT64 Pm1bEvtBlk; /* Port address of Power Mgt 1b AcpiEvent Reg Blk */ - UINT64 Pm1aCntBlk; /* Port address of Power Mgt 1a Control Reg Blk */ - UINT64 Pm1bCntBlk; /* Port address of Power Mgt 1b Control Reg Blk */ - UINT64 Pm2CntBlk; /* Port address of Power Mgt 2 Control Reg Blk */ - UINT64 PmTmrBlk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ - UINT64 Gpe0Blk; /* Port addr of General Purpose AcpiEvent 0 Reg Blk */ - UINT64 Gpe1Blk; /* Port addr of General Purpose AcpiEvent 1 Reg Blk */ - UINT8 Pm1EvtLen; /* Byte Length of ports at pm1X_evt_blk */ - UINT8 Pm1CntLen; /* Byte Length of ports at pm1X_cnt_blk */ - UINT8 Pm2CntLen; /* Byte Length of ports at pm2_cnt_blk */ - UINT8 PmTmLen; /* Byte Length of ports at pm_tm_blk */ - UINT8 Gpe0BlkLen; /* Byte Length of ports at gpe0_blk */ - UINT8 Gpe1BlkLen; /* Byte Length of ports at gpe1_blk */ - UINT8 Gpe1Base; /* offset in gpe model where gpe1 events start */ - UINT8 Reserved3; /* reserved */ - UINT16 Plvl2Lat; /* worst case HW latency to enter/exit C2 state */ - UINT16 Plvl3Lat; /* worst case HW latency to enter/exit C3 state */ - 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 */ - UINT8 Reserved4; /* reserved */ - UINT32_BIT FlushCash : 1; /* PAL_FLUSH_CACHE is correctly supported */ - UINT32_BIT Reserved5 : 1; /* reserved - must be zero */ - UINT32_BIT ProcC1 : 1; /* all processors support C1 state */ - UINT32_BIT Plvl2Up : 1; /* C2 state works on MP system */ - UINT32_BIT PwrButton : 1; /* Power button is handled as a generic feature */ - UINT32_BIT SleepButton : 1; /* Sleep button is handled as a generic feature, or not present */ - UINT32_BIT FixedRTC : 1; /* RTC wakeup stat not in fixed register space */ - UINT32_BIT Rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ - UINT32_BIT TmrValExt : 1; /* tmr_val is 32 bits */ - UINT32_BIT DockCap : 1; /* Supports Docking */ - UINT32_BIT Reserved6 : 22; /* reserved - must be zero */ - -} FIXED_ACPI_DESCRIPTION_TABLE; - - -#endif /* __ACTBL64_H__ */ - diff -ruN acpica-unix-20001020/Subsystem/Include/actbl71.h acpica-unix-20001115/Subsystem/Include/actbl71.h --- acpica-unix-20001020/Subsystem/Include/actbl71.h Thu Jan 1 09:00:00 1970 +++ acpica-unix-20001115/Subsystem/Include/actbl71.h Thu Nov 16 09:18:44 2000 @@ -0,0 +1,235 @@ +/****************************************************************************** + * + * Name: actbl71.h - IA-64 Extensions to the ACPI Spec Rev. 0.71 + * This file includes tables specific to this + * specification revision. + * $Revision: 7 $ + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999, Intel Corp. All rights + * reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#ifndef __ACTBL71_H__ +#define __ACTBL71_H__ + +/* 0.71 FADT AddressSpace data item bitmasks defines */ +/* If the associated bit is zero then it is in memory space else in io space */ +#define SMI_CMD_ADDRESS_SPACE 0x01 +#define PM1_BLK_ADDRESS_SPACE 0x02 +#define PM2_CNT_BLK_ADDRESS_SPACE 0x04 +#define PM_TMR_BLK_ADDRESS_SPACE 0x08 +#define GPE0_BLK_ADDRESS_SPACE 0x10 +#define GPE1_BLK_ADDRESS_SPACE 0x20 + +/* Only for clarity in declarations */ +typedef UINT64 IO_ADDRESS; + +#pragma pack(1) + +typedef struct /* Root System Descriptor Pointer */ +{ + NATIVE_CHAR Signature [8]; /* contains "RSD PTR " */ + UINT8 Checksum; /* to make sum of struct == 0 */ + NATIVE_CHAR OemId [6]; /* OEM identification */ + UINT8 Reserved; /* Must be 0 for 1.0, 2 for 2.0 */ + UINT64 RsdtPhysicalAddress; /* 64-bit physical address of RSDT */ +} RSDP_DESCRIPTOR_REV071; + + +/*****************************************/ +/* IA64 Extensions to ACPI Spec Rev 0.71 */ +/* for the Root System Description Table */ +/*****************************************/ +typedef struct +{ + ACPI_TABLE_HEADER header; /* Table header */ + UINT32 ReservedPad; /* IA64 alignment, must be 0 */ + UINT64 TableOffsetEntry [1]; /* Array of pointers to other */ + /* tables' headers */ +} RSDT_DESCRIPTOR_REV071; + + +/*******************************************/ +/* IA64 Extensions to ACPI Spec Rev 0.71 */ +/* for the Firmware ACPI Control Structure */ +/*******************************************/ +typedef struct +{ + NATIVE_CHAR Signature[4]; /* signature "FACS" */ + UINT32 Length; /* length of structure, in bytes */ + UINT32 HardwareSignature; /* hardware configuration signature */ + UINT32 Reserved4; /* must be 0 */ + UINT64 FirmwareWakingVector; /* ACPI OS waking vector */ + UINT64 GlobalLock; /* Global Lock */ + UINT32_BIT S4Bios_f : 1; /* Indicates if S4BIOS support is present */ + UINT32_BIT Reserved1 : 31; /* must be 0 */ + UINT8 Reserved3 [28]; /* reserved - must be zero */ + +} FACS_DESCRIPTOR_REV071; + + +/******************************************/ +/* IA64 Extensions to ACPI Spec Rev 0.71 */ +/* for the Fixed ACPI Description Table */ +/******************************************/ +typedef struct +{ + ACPI_TABLE_HEADER header; /* table header */ + UINT32 ReservedPad; /* IA64 alignment, must be 0 */ + UINT64 FirmwareCtrl; /* 64-bit Physical address of FACS */ + UINT64 Dsdt; /* 64-bit Physical address of DSDT */ + UINT8 Model; /* System Interrupt Model */ + UINT8 AddressSpace; /* Address Space Bitmask */ + UINT16 SciInt; /* System vector of SCI interrupt */ + UINT8 AcpiEnable; /* value to write to smi_cmd to enable ACPI */ + UINT8 AcpiDisable; /* value to write to smi_cmd to disable ACPI */ + UINT8 S4BiosReq; /* Value to write to SMI CMD to enter S4BIOS state */ + UINT8 Reserved2; /* reserved - must be zero */ + UINT64 SmiCmd; /* Port address of SMI command port */ + UINT64 Pm1aEvtBlk; /* Port address of Power Mgt 1a AcpiEvent Reg Blk */ + UINT64 Pm1bEvtBlk; /* Port address of Power Mgt 1b AcpiEvent Reg Blk */ + UINT64 Pm1aCntBlk; /* Port address of Power Mgt 1a Control Reg Blk */ + UINT64 Pm1bCntBlk; /* Port address of Power Mgt 1b Control Reg Blk */ + UINT64 Pm2CntBlk; /* Port address of Power Mgt 2 Control Reg Blk */ + UINT64 PmTmrBlk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ + UINT64 Gpe0Blk; /* Port addr of General Purpose AcpiEvent 0 Reg Blk */ + UINT64 Gpe1Blk; /* Port addr of General Purpose AcpiEvent 1 Reg Blk */ + UINT8 Pm1EvtLen; /* Byte Length of ports at pm1X_evt_blk */ + UINT8 Pm1CntLen; /* Byte Length of ports at pm1X_cnt_blk */ + UINT8 Pm2CntLen; /* Byte Length of ports at pm2_cnt_blk */ + UINT8 PmTmLen; /* Byte Length of ports at pm_tm_blk */ + UINT8 Gpe0BlkLen; /* Byte Length of ports at gpe0_blk */ + UINT8 Gpe1BlkLen; /* Byte Length of ports at gpe1_blk */ + UINT8 Gpe1Base; /* offset in gpe model where gpe1 events start */ + UINT8 Reserved3; /* reserved */ + UINT16 Plvl2Lat; /* worst case HW latency to enter/exit C2 state */ + UINT16 Plvl3Lat; /* worst case HW latency to enter/exit C3 state */ + 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 */ + UINT8 Reserved4; /* reserved */ + UINT32_BIT FlushCash : 1; /* PAL_FLUSH_CACHE is correctly supported */ + UINT32_BIT Reserved5 : 1; /* reserved - must be zero */ + UINT32_BIT ProcC1 : 1; /* all processors support C1 state */ + UINT32_BIT Plvl2Up : 1; /* C2 state works on MP system */ + UINT32_BIT PwrButton : 1; /* Power button is handled as a generic feature */ + UINT32_BIT SleepButton : 1; /* Sleep button is handled as a generic feature, or not present */ + UINT32_BIT FixedRTC : 1; /* RTC wakeup stat not in fixed register space */ + UINT32_BIT Rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ + UINT32_BIT TmrValExt : 1; /* tmr_val is 32 bits */ + UINT32_BIT DockCap : 1; /* Supports Docking */ + UINT32_BIT Reserved6 : 22; /* reserved - must be zero */ + +} FADT_DESCRIPTOR_REV071; + +#pragma pack() + +#endif /* __ACTBL71_H__ */ + diff -ruN acpica-unix-20001020/Subsystem/Include/actypes.h acpica-unix-20001115/Subsystem/Include/actypes.h --- acpica-unix-20001020/Subsystem/Include/actypes.h Sat Oct 21 06:44:59 2000 +++ acpica-unix-20001115/Subsystem/Include/actypes.h Thu Nov 16 09:18:44 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: actypes.h - Common data types for the entire ACPI subsystem - * $Revision: 143 $ + * $Revision: 152 $ * *****************************************************************************/ @@ -158,7 +158,7 @@ typedef NATIVE_UINT ACPI_TBLPTR; typedef UINT64 ACPI_IO_ADDRESS; -typedef UINT64 ACPI_MEM_ADDRESS; +typedef UINT64 ACPI_PHYSICAL_ADDRESS; #define ALIGNED_ADDRESS_BOUNDARY 0x00000008 @@ -182,14 +182,16 @@ typedef UINT32 ACPI_TBLPTR; typedef UINT32 ACPI_IO_ADDRESS; -typedef UINT32 ACPI_MEM_ADDRESS; +typedef UINT32 ACPI_PHYSICAL_ADDRESS; #define ALIGNED_ADDRESS_BOUNDARY 0x00000002 #define _HW_ALIGNMENT_SUPPORT -/* (16-bit only) Force internal integers to be 32, not 64 bits */ - -#define ACPI_VERSION_1 +/* + * (16-bit only) internal integers must be 32-bits, so + * 64-bit integers cannot be supported + */ +#define ACPI_NO_INTEGER64_SUPPORT #else @@ -209,11 +211,10 @@ typedef NATIVE_UINT ACPI_TBLPTR; typedef UINT32 ACPI_IO_ADDRESS; -typedef UINT32 ACPI_MEM_ADDRESS; +typedef UINT64 ACPI_PHYSICAL_ADDRESS; #define ALIGNED_ADDRESS_BOUNDARY 0x00000004 #define _HW_ALIGNMENT_SUPPORT - #endif @@ -279,19 +280,14 @@ typedef void* ACPI_HANDLE; /* Actually a ptr to an Node */ -/* TBD: TEMP ONLY! */ - -#define ACPI_VERSION_1 - /* * Acpi integer width. In ACPI version 1, integers are - * 32 bits. In ACPI version 2, integers are 64 bits. Period. + * 32 bits. In ACPI version 2, integers are 64 bits. * Note that this pertains to the ACPI integer type only, not * other integers used in the implementation of the ACPI CA * subsystem. */ - -#ifdef ACPI_VERSION_1 +#ifdef ACPI_NO_INTEGER64_SUPPORT /* 32-bit Integers */ @@ -306,6 +302,7 @@ typedef UINT64 ACPI_INTEGER; #define ACPI_INTEGER_MAX ACPI_UINT64_MAX; #define ACPI_INTEGER_BIT_SIZE 64 + #endif @@ -345,17 +342,13 @@ typedef UINT32 ACPI_TABLE_TYPE; #define ACPI_TABLE_RSDP (ACPI_TABLE_TYPE) 0 -#define ACPI_TABLE_APIC (ACPI_TABLE_TYPE) 1 -#define ACPI_TABLE_DSDT (ACPI_TABLE_TYPE) 2 -#define ACPI_TABLE_FACP (ACPI_TABLE_TYPE) 3 -#define ACPI_TABLE_FACS (ACPI_TABLE_TYPE) 4 -#define ACPI_TABLE_PSDT (ACPI_TABLE_TYPE) 5 -#define ACPI_TABLE_RSDT (ACPI_TABLE_TYPE) 6 -#define ACPI_TABLE_SSDT (ACPI_TABLE_TYPE) 7 -#define ACPI_TABLE_SBST (ACPI_TABLE_TYPE) 8 -#define ACPI_TABLE_SPIC (ACPI_TABLE_TYPE) 9 -#define ACPI_TABLE_BOOT (ACPI_TABLE_TYPE) 10 -#define ACPI_TABLE_MAX 10 +#define ACPI_TABLE_DSDT (ACPI_TABLE_TYPE) 1 +#define ACPI_TABLE_FADT (ACPI_TABLE_TYPE) 2 +#define ACPI_TABLE_FACS (ACPI_TABLE_TYPE) 3 +#define ACPI_TABLE_PSDT (ACPI_TABLE_TYPE) 4 +#define ACPI_TABLE_SSDT (ACPI_TABLE_TYPE) 5 +#define ACPI_TABLE_XSDT (ACPI_TABLE_TYPE) 6 +#define ACPI_TABLE_MAX 6 #define NUM_ACPI_TABLES (ACPI_TABLE_MAX+1) @@ -408,26 +401,28 @@ #define INTERNAL_TYPE_ALIAS 21 /* 0x15 */ #define INTERNAL_TYPE_NOTIFY 22 /* 0x16 */ #define INTERNAL_TYPE_ADDRESS_HANDLER 23 /* 0x17 */ +#define INTERNAL_TYPE_RESOURCE 24 /* 0x18 */ + -#define INTERNAL_TYPE_NODE_MAX 23 +#define INTERNAL_TYPE_NODE_MAX 24 /* These are pseudo-types because there are never any namespace nodes with these types */ -#define INTERNAL_TYPE_DEF_FIELD_DEFN 24 /* 0x18 Name, ByteConst, multiple FieldElement */ -#define INTERNAL_TYPE_BANK_FIELD_DEFN 25 /* 0x19 2 Name,DWordConst,ByteConst,multi FieldElement */ -#define INTERNAL_TYPE_INDEX_FIELD_DEFN 26 /* 0x1A 2 Name, ByteConst, multiple FieldElement */ -#define INTERNAL_TYPE_IF 27 /* 0x1B OpCode, multiple Code */ -#define INTERNAL_TYPE_ELSE 28 /* 0x1C multiple Code */ -#define INTERNAL_TYPE_WHILE 29 /* 0x1D OpCode, multiple Code */ -#define INTERNAL_TYPE_SCOPE 30 /* 0x1E Name, multiple Node */ -#define INTERNAL_TYPE_DEF_ANY 31 /* 0x1F type is Any, suppress search of enclosing scopes */ -#define INTERNAL_TYPE_METHOD_ARGUMENT 32 /* 0x20 */ -#define INTERNAL_TYPE_METHOD_LOCAL_VAR 33 /* 0x21 */ -#define INTERNAL_TYPE_EXTRA 34 /* 0x22 */ +#define INTERNAL_TYPE_DEF_FIELD_DEFN 25 /* 0x19 Name, ByteConst, multiple FieldElement */ +#define INTERNAL_TYPE_BANK_FIELD_DEFN 26 /* 0x1A 2 Name,DWordConst,ByteConst,multi FieldElement */ +#define INTERNAL_TYPE_INDEX_FIELD_DEFN 27 /* 0x1B 2 Name, ByteConst, multiple FieldElement */ +#define INTERNAL_TYPE_IF 28 /* 0x1C OpCode, multiple Code */ +#define INTERNAL_TYPE_ELSE 29 /* 0x1D multiple Code */ +#define INTERNAL_TYPE_WHILE 30 /* 0x1E OpCode, multiple Code */ +#define INTERNAL_TYPE_SCOPE 31 /* 0x1F Name, multiple Node */ +#define INTERNAL_TYPE_DEF_ANY 32 /* 0x20 type is Any, suppress search of enclosing scopes */ +#define INTERNAL_TYPE_METHOD_ARGUMENT 33 /* 0x21 */ +#define INTERNAL_TYPE_METHOD_LOCAL_VAR 34 /* 0x22 */ +#define INTERNAL_TYPE_EXTRA 35 /* 0x23 */ -#define INTERNAL_TYPE_MAX 34 +#define INTERNAL_TYPE_MAX 35 -#define INTERNAL_TYPE_INVALID 35 +#define INTERNAL_TYPE_INVALID 36 #define ACPI_TYPE_NOT_FOUND 0xFF /* @@ -482,6 +477,7 @@ */ typedef UINT32 ACPI_EVENT_STATUS; +#define ACPI_EVENT_FLAG_DISABLED (ACPI_EVENT_STATUS) 0x00 #define ACPI_EVENT_FLAG_ENABLED (ACPI_EVENT_STATUS) 0x01 #define ACPI_EVENT_FLAG_SET (ACPI_EVENT_STATUS) 0x02 @@ -696,7 +692,7 @@ typedef ACPI_STATUS (*ADDRESS_SPACE_HANDLER) ( UINT32 Function, - ACPI_INTEGER Address, + ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT32 *Value, void *HandlerContext, @@ -772,7 +768,7 @@ typedef struct { - UINT8 *MappedPhysicalAddress; + UINT64 MappedPhysicalAddress; UINT8 *MappedLogicalAddress; UINT32 MappedLength; } MEM_HANDLER_CONTEXT; diff -ruN acpica-unix-20001020/Subsystem/Interpreter/amconfig.c acpica-unix-20001115/Subsystem/Interpreter/amconfig.c --- acpica-unix-20001020/Subsystem/Interpreter/amconfig.c Sat Oct 21 06:44:59 2000 +++ acpica-unix-20001115/Subsystem/Interpreter/amconfig.c Thu Nov 16 09:18:44 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: amconfig - Namespace reconfiguration (Load/Unload opcodes) - * $Revision: 24 $ + * $Revision: 25 $ * *****************************************************************************/ @@ -144,7 +144,7 @@ * ****************************************************************************/ -ACPI_STATUS +static ACPI_STATUS AcpiAmlExecLoadTable ( ACPI_OPERAND_OBJECT *RgnDesc, ACPI_HANDLE *DdbHandle) @@ -290,7 +290,7 @@ * ****************************************************************************/ -ACPI_STATUS +static ACPI_STATUS AcpiAmlExecUnloadTable ( ACPI_HANDLE DdbHandle) { diff -ruN acpica-unix-20001020/Subsystem/Interpreter/amcreate.c acpica-unix-20001115/Subsystem/Interpreter/amcreate.c --- acpica-unix-20001020/Subsystem/Interpreter/amcreate.c Sat Oct 21 06:44:59 2000 +++ acpica-unix-20001115/Subsystem/Interpreter/amcreate.c Thu Nov 16 09:18:44 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: amcreate - Named object creation - * $Revision: 48 $ + * $Revision: 50 $ * *****************************************************************************/ @@ -213,16 +213,6 @@ ObjDesc->FieldUnit.Node = Node; -/* - Status = AcpiNsAttachObject (Node, ObjDesc, - (UINT8) ACPI_TYPE_FIELD_UNIT); - - if (ACPI_FAILURE (Status)) - { - goto Cleanup; - } -*/ - /* * This operation is supposed to cause the destination Name to refer * to the defined FieldUnit -- it must not store the constructed @@ -305,328 +295,6 @@ AcpiCmRemoveReference (ObjDesc); ObjDesc = NULL; - } - - return_ACPI_STATUS (Status); -} - - -ACPI_STATUS -AcpiAmlExecCreateField_original ( - UINT16 Opcode, - ACPI_WALK_STATE *WalkState) -{ - ACPI_OPERAND_OBJECT *ResDesc = NULL; - ACPI_OPERAND_OBJECT *CntDesc = NULL; - ACPI_OPERAND_OBJECT *OffDesc = NULL; - ACPI_OPERAND_OBJECT *SrcDesc = NULL; - ACPI_OPERAND_OBJECT *FieldDesc; - ACPI_OPERAND_OBJECT *ObjDesc; - OBJECT_TYPE_INTERNAL ResType; - ACPI_STATUS Status; - UINT32 NumOperands = 3; - UINT32 Offset; - UINT32 BitOffset; - UINT16 BitCount; - UINT8 TypeFound; - - - FUNCTION_TRACE ("AmlExecCreateField"); - - - /* Resolve the operands */ - - Status = AcpiAmlResolveOperands (Opcode, WALK_OPERANDS, WalkState); - DUMP_OPERANDS (WALK_OPERANDS, IMODE_EXECUTE, AcpiPsGetOpcodeName (Opcode), - NumOperands, "after AcpiAmlResolveOperands"); - - - /* Get the operands */ - - Status |= AcpiDsObjStackPopObject (&ResDesc, WalkState); - if (AML_CREATE_FIELD_OP == Opcode) - { - NumOperands = 4; - Status |= AcpiDsObjStackPopObject (&CntDesc, WalkState); - } - - Status |= AcpiDsObjStackPopObject (&OffDesc, WalkState); - Status |= AcpiDsObjStackPopObject (&SrcDesc, WalkState); - - if (ACPI_FAILURE (Status)) - { - /* Invalid parameters on object stack */ - - DEBUG_PRINT (ACPI_ERROR, - ("ExecCreateField/%s: bad operand(s) (0x%X)\n", - AcpiPsGetOpcodeName (Opcode), Status)); - - goto Cleanup; - } - - - Offset = (UINT32) OffDesc->Number.Value; - - - /* - * If ResDesc is a Name, it will be a direct name pointer after - * AcpiAmlResolveOperands() - */ - - if (!VALID_DESCRIPTOR_TYPE (ResDesc, ACPI_DESC_TYPE_NAMED)) - { - DEBUG_PRINT (ACPI_ERROR, - ("AmlExecCreateField (%s): destination must be a Node\n", - AcpiPsGetOpcodeName (Opcode))); - - Status = AE_AML_OPERAND_TYPE; - goto Cleanup; - } - - - /* - * Setup the Bit offsets and counts, according to the opcode - */ - - switch (Opcode) - { - - /* DefCreateBitField */ - - case AML_BIT_FIELD_OP: - - /* Offset is in bits, Field is a bit */ - - BitOffset = Offset; - BitCount = 1; - break; - - - /* DefCreateByteField */ - - case AML_BYTE_FIELD_OP: - - /* Offset is in bytes, field is a byte */ - - BitOffset = 8 * Offset; - BitCount = 8; - break; - - - /* DefCreateWordField */ - - case AML_WORD_FIELD_OP: - - /* Offset is in bytes, field is a word */ - - BitOffset = 8 * Offset; - BitCount = 16; - break; - - - /* DefCreateDWordField */ - - case AML_DWORD_FIELD_OP: - - /* Offset is in bytes, field is a dword */ - - BitOffset = 8 * Offset; - BitCount = 32; - break; - - - /* DefCreateField */ - - case AML_CREATE_FIELD_OP: - - /* Offset is in bits, count is in bits */ - - BitOffset = Offset; - BitCount = (UINT16) CntDesc->Number.Value; - break; - - - default: - - DEBUG_PRINT (ACPI_ERROR, - ("AmlExecCreateField: Internal error - unknown field creation opcode %02x\n", - Opcode)); - Status = AE_AML_BAD_OPCODE; - goto Cleanup; - } - - - /* - * Setup field according to the object type - */ - - switch (SrcDesc->Common.Type) - { - - /* SourceBuff := TermArg=>Buffer */ - - case ACPI_TYPE_BUFFER: - - if (BitOffset + (UINT32) BitCount > - (8 * (UINT32) SrcDesc->Buffer.Length)) - { - DEBUG_PRINT (ACPI_ERROR, - ("AmlExecCreateField: Field exceeds Buffer %d > %d\n", - BitOffset + (UINT32) BitCount, - 8 * (UINT32) SrcDesc->Buffer.Length)); - Status = AE_AML_BUFFER_LIMIT; - goto Cleanup; - } - - - /* Allocate an object for the field */ - - FieldDesc = AcpiCmCreateInternalObject (ACPI_TYPE_FIELD_UNIT); - if (!FieldDesc) - { - Status = AE_NO_MEMORY; - goto Cleanup; - } - - /* Construct the field object */ - - FieldDesc->FieldUnit.Access = (UINT8) ACCESS_ANY_ACC; - FieldDesc->FieldUnit.LockRule = (UINT8) GLOCK_NEVER_LOCK; - FieldDesc->FieldUnit.UpdateRule = (UINT8) UPDATE_PRESERVE; - FieldDesc->FieldUnit.Length = BitCount; - FieldDesc->FieldUnit.BitOffset = (UINT8) (BitOffset % 8); - FieldDesc->FieldUnit.Offset = DIV_8 (BitOffset); - FieldDesc->FieldUnit.Container = SrcDesc; - - /* An additional reference for SrcDesc */ - - AcpiCmAddReference (SrcDesc); - - break; - - - /* Improper object type */ - - default: - - TypeFound = SrcDesc->Common.Type; - - if ((TypeFound > (UINT8) INTERNAL_TYPE_REFERENCE) || - !AcpiCmValidObjectType (TypeFound)) - { - DEBUG_PRINT (ACPI_ERROR, - ("AmlExecCreateField: Tried to create field in invalid object type - 0x%X\n", - TypeFound)); - } - - else - { - DEBUG_PRINT (ACPI_ERROR, - ("AmlExecCreateField: Tried to create field in improper object type - %s\n", - AcpiCmGetTypeName (TypeFound))); - } - - Status = AE_AML_OPERAND_TYPE; - goto Cleanup; - } - - - if (AML_CREATE_FIELD_OP == Opcode) - { - /* Delete object descriptor unique to CreateField */ - - AcpiCmRemoveReference (CntDesc); - CntDesc = NULL; - } - - /* - * This operation is supposed to cause the destination Name to refer - * to the defined FieldUnit -- it must not store the constructed - * FieldUnit 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 AcpiAmlExecStore() to perform an indirect - * store rather than setting the value of the Name itself, clobber that - * reference before calling AcpiAmlExecStore(). - */ - - ResType = AcpiNsGetType (ResDesc); - - /* Type of Name's existing value */ - - switch (ResType) - { - - case ACPI_TYPE_FIELD_UNIT: - - case INTERNAL_TYPE_ALIAS: - case INTERNAL_TYPE_BANK_FIELD: - case INTERNAL_TYPE_DEF_FIELD: - case INTERNAL_TYPE_INDEX_FIELD: - - ObjDesc = AcpiNsGetAttachedObject (ResDesc); - if (ObjDesc) - { - /* - * There is an existing object here; delete it and zero out the - * object field within the Node - */ - - DUMP_PATHNAME (ResDesc, - "AmlExecCreateField: Removing Current Reference", - TRACE_BFIELD, _COMPONENT); - - DUMP_ENTRY (ResDesc, TRACE_BFIELD); - DUMP_STACK_ENTRY (ObjDesc); - - AcpiCmRemoveReference (ObjDesc); - AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) ResDesc, NULL, - ACPI_TYPE_ANY); - } - - /* Set the type to ANY (or the store below will fail) */ - - ((ACPI_NAMESPACE_NODE *) ResDesc)->Type = ACPI_TYPE_ANY; - - break; - - - default: - - break; - } - - - /* Store constructed field descriptor in result location */ - - Status = AcpiAmlExecStore (FieldDesc, ResDesc, WalkState); - - /* - * If the field descriptor was not physically stored (or if a failure - * above), we must delete it - */ - if (FieldDesc->Common.ReferenceCount <= 1) - { - AcpiCmRemoveReference (FieldDesc); - } - - -Cleanup: - - /* Always delete the operands */ - - AcpiCmRemoveReference (OffDesc); - AcpiCmRemoveReference (SrcDesc); - - if (AML_CREATE_FIELD_OP == Opcode) - { - AcpiCmRemoveReference (CntDesc); - } - - /* On failure, delete the result descriptor */ - - if (ACPI_FAILURE (Status)) - { - AcpiCmRemoveReference (ResDesc); /* Result descriptor */ } return_ACPI_STATUS (Status); diff -ruN acpica-unix-20001020/Subsystem/Interpreter/amdyadic.c acpica-unix-20001115/Subsystem/Interpreter/amdyadic.c --- acpica-unix-20001020/Subsystem/Interpreter/amdyadic.c Sat Oct 21 06:44:59 2000 +++ acpica-unix-20001115/Subsystem/Interpreter/amdyadic.c Thu Nov 16 09:18:44 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: amdyadic - ACPI AML (p-code) execution for dyadic operators - * $Revision: 65 $ + * $Revision: 67 $ * *****************************************************************************/ @@ -272,7 +272,6 @@ ACPI_OPERAND_OBJECT *RetDesc = NULL; ACPI_OPERAND_OBJECT *RetDesc2 = NULL; ACPI_STATUS Status = AE_OK; - ACPI_INTEGER Remainder; UINT32 NumOperands = 3; NATIVE_CHAR *NewBuf; @@ -399,7 +398,7 @@ case AML_DIVIDE_OP: - if ((UINT32) 0 == ObjDesc2->Number.Value) + if (!ObjDesc2->Number.Value) { REPORT_ERROR (("AmlExecDyadic2R/DivideOp: Divide by zero\n")); @@ -415,14 +414,15 @@ goto Cleanup; } - Remainder = ObjDesc->Number.Value % - ObjDesc2->Number.Value; - RetDesc->Number.Value = Remainder; + /* Remainder (modulo) */ + + RetDesc->Number.Value = ACPI_MODULO (ObjDesc->Number.Value, + ObjDesc2->Number.Value); /* Result (what we used to call the quotient) */ - RetDesc2->Number.Value = ObjDesc->Number.Value / - ObjDesc2->Number.Value; + RetDesc2->Number.Value = ACPI_DIVIDE (ObjDesc->Number.Value, + ObjDesc2->Number.Value); break; diff -ruN acpica-unix-20001020/Subsystem/Interpreter/amfldio.c acpica-unix-20001115/Subsystem/Interpreter/amfldio.c --- acpica-unix-20001020/Subsystem/Interpreter/amfldio.c Sat Oct 21 06:44:59 2000 +++ acpica-unix-20001115/Subsystem/Interpreter/amfldio.c Thu Nov 16 09:18:44 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: amfldio - Aml Field I/O - * $Revision: 28 $ + * $Revision: 30 $ * *****************************************************************************/ @@ -152,7 +152,7 @@ { ACPI_STATUS Status; ACPI_OPERAND_OBJECT *RgnDesc = NULL; - ACPI_INTEGER Address; + ACPI_PHYSICAL_ADDRESS Address; UINT32 LocalValue = 0; UINT32 FieldByteWidth; @@ -454,7 +454,7 @@ * ******************************************************************************/ -ACPI_STATUS +static ACPI_STATUS AcpiAmlWriteFieldData ( ACPI_OPERAND_OBJECT *ObjDesc, UINT32 FieldByteOffset, @@ -463,7 +463,7 @@ { ACPI_STATUS Status = AE_OK; ACPI_OPERAND_OBJECT *RgnDesc = NULL; - ACPI_INTEGER Address; + ACPI_PHYSICAL_ADDRESS Address; UINT32 FieldByteWidth; @@ -545,7 +545,7 @@ * ****************************************************************************/ -ACPI_STATUS +static ACPI_STATUS AcpiAmlWriteFieldDataWithUpdateRule ( ACPI_OPERAND_OBJECT *ObjDesc, UINT32 Mask, diff -ruN acpica-unix-20001020/Subsystem/Interpreter/ammonad.c acpica-unix-20001115/Subsystem/Interpreter/ammonad.c --- acpica-unix-20001020/Subsystem/Interpreter/ammonad.c Sat Oct 21 06:45:00 2000 +++ acpica-unix-20001115/Subsystem/Interpreter/ammonad.c Thu Nov 16 09:18:45 2000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: ammonad - ACPI AML (p-code) execution for monadic operators - * $Revision: 81 $ + * $Revision: 83 $ * *****************************************************************************/ @@ -143,7 +143,7 @@ * ******************************************************************************/ -ACPI_STATUS +static ACPI_STATUS AcpiAmlGetObjectReference ( ACPI_OPERAND_OBJECT *ObjDesc, ACPI_OPERAND_OBJECT **RetDesc, @@ -461,6 +461,8 @@ case AML_FROM_BCD_OP: + /* TBD: for ACPI 2.0, expand to 64 bits */ + d0 = (UINT32) (ObjDesc->Number.Value & 15); d1 = (UINT32) (ObjDesc->Number.Value >> 4 & 15); d2 = (UINT32) (ObjDesc->Number.Value >> 8 & 15); @@ -483,6 +485,7 @@ case AML_TO_BCD_OP: + /* TBD: for ACPI 2.0, expand to 64 bits */ if (ObjDesc->Number.Value > 9999) { @@ -493,10 +496,10 @@ } RetDesc->Number.Value - = ObjDesc->Number.Value % 10 - + (ObjDesc->Number.Value / 10 % 10 << 4) - + (ObjDesc->Number.Value / 100 % 10 << 8) - + (ObjDesc->Number.Value / 1000 % 10 << 12); + = ACPI_MODULO (ObjDesc->Number.Value, 10) + + (ACPI_MODULO (ACPI_DIVIDE (ObjDesc->Number.Value, 10), 10) << 4) + + (ACPI_MODULO (ACPI_DIVIDE (ObjDesc->Number.Value, 100), 10) << 8) + + (ACPI_MODULO (ACPI_DIVIDE (ObjDesc->Number.Value, 1000), 10) << 12); break; diff -ruN acpica-unix-20001020/Subsystem/Interpreter/amprep.c acpica-unix-20001115/Subsystem/Interpreter/amprep.c --- acpica-unix-20001020/Subsystem/Interpreter/amprep.c Sat Oct 21 06:45:00 2000 +++ acpica-unix-20001115/Subsystem/Interpreter/amprep.c Thu Nov 16 09:18:45 2000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: amprep - ACPI AML (p-code) execution - field prep utilities - * $Revision: 67 $ + * $Revision: 68 $ * *****************************************************************************/ @@ -140,7 +140,7 @@ * ******************************************************************************/ -UINT32 +static UINT32 AcpiAmlDecodeFieldAccessType ( UINT32 Access) { @@ -192,7 +192,7 @@ * ******************************************************************************/ -ACPI_STATUS +static ACPI_STATUS AcpiAmlPrepCommonFieldObject ( ACPI_OPERAND_OBJECT *ObjDesc, UINT8 FieldFlags, diff -ruN acpica-unix-20001020/Subsystem/Interpreter/amregion.c acpica-unix-20001115/Subsystem/Interpreter/amregion.c --- acpica-unix-20001020/Subsystem/Interpreter/amregion.c Sat Oct 21 06:45:00 2000 +++ acpica-unix-20001115/Subsystem/Interpreter/amregion.c Thu Nov 16 09:18:45 2000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: amregion - ACPI default OpRegion (address space) handlers - * $Revision: 36 $ + * $Revision: 40 $ * *****************************************************************************/ @@ -151,7 +151,7 @@ ACPI_STATUS AcpiAmlSystemMemorySpaceHandler ( UINT32 Function, - ACPI_INTEGER Address, + ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT32 *Value, void *HandlerContext, @@ -197,9 +197,9 @@ * 2) Address beyond the current mapping? */ - if ((Address < (ACPI_INTEGER) MemInfo->MappedPhysicalAddress) || + if ((Address < MemInfo->MappedPhysicalAddress) || ((Address + Length) > - (ACPI_INTEGER) (MemInfo->MappedPhysicalAddress + MemInfo->MappedLength))) + (MemInfo->MappedPhysicalAddress + MemInfo->MappedLength))) { /* * The request cannot be resolved by the current memory mapping; @@ -218,7 +218,7 @@ /* Create a new mapping starting at the address given */ - Status = AcpiOsMapMemory ((void *) (UINT32) Address, SYSMEM_REGION_WINDOW_SIZE, + Status = AcpiOsMapMemory (Address, SYSMEM_REGION_WINDOW_SIZE, (void **) &MemInfo->MappedLogicalAddress); if (ACPI_FAILURE (Status)) { @@ -227,7 +227,7 @@ /* TBD: should these pointers go to 64-bit in all cases ? */ - MemInfo->MappedPhysicalAddress = (UINT8 *) (UINT32) Address; + MemInfo->MappedPhysicalAddress = Address; MemInfo->MappedLength = SYSMEM_REGION_WINDOW_SIZE; } @@ -240,7 +240,7 @@ /* TBD: should these pointers go to 64-bit in all cases ? */ LogicalAddrPtr = MemInfo->MappedLogicalAddress + - ((UINT8 *) (UINT32) Address - MemInfo->MappedPhysicalAddress); + (Address - MemInfo->MappedPhysicalAddress); /* Perform the memory read or write */ @@ -324,7 +324,7 @@ ACPI_STATUS AcpiAmlSystemIoSpaceHandler ( UINT32 Function, - ACPI_INTEGER Address, + ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT32 *Value, void *HandlerContext, @@ -432,7 +432,7 @@ ACPI_STATUS AcpiAmlPciConfigSpaceHandler ( UINT32 Function, - ACPI_INTEGER Address, + ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, UINT32 *Value, void *HandlerContext, diff -ruN acpica-unix-20001020/Subsystem/Interpreter/amresnte.c acpica-unix-20001115/Subsystem/Interpreter/amresnte.c --- acpica-unix-20001020/Subsystem/Interpreter/amresnte.c Sat Oct 21 06:45:00 2000 +++ acpica-unix-20001115/Subsystem/Interpreter/amresnte.c Thu Nov 16 09:18:45 2000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: amresnte - AML Interpreter object resolution - * $Revision: 23 $ + * $Revision: 24 $ * *****************************************************************************/ @@ -157,7 +157,9 @@ ACPI_STATUS AcpiAmlResolveNodeToValue ( - ACPI_NAMESPACE_NODE **StackPtr) + ACPI_NAMESPACE_NODE **StackPtr, + ACPI_WALK_STATE *WalkState) + { ACPI_STATUS Status = AE_OK; ACPI_OPERAND_OBJECT *ValDesc = NULL; @@ -644,7 +646,7 @@ case AML_ONES_OP: - TempVal = ACPI_UINT32_MAX; + TempVal = ACPI_INTEGER_MAX; break; @@ -667,6 +669,9 @@ ObjDesc->Number.Value = TempVal; + /* Truncate value if we are executing from a 32-bit ACPI table */ + + AcpiAmlTruncateFor32bitTable (ObjDesc, WalkState); break; diff -ruN acpica-unix-20001020/Subsystem/Interpreter/amresolv.c acpica-unix-20001115/Subsystem/Interpreter/amresolv.c --- acpica-unix-20001020/Subsystem/Interpreter/amresolv.c Sat Oct 21 06:45:00 2000 +++ acpica-unix-20001115/Subsystem/Interpreter/amresolv.c Thu Nov 16 09:18:45 2000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: amresolv - AML Interpreter object resolution - * $Revision: 76 $ + * $Revision: 77 $ * *****************************************************************************/ @@ -316,7 +316,7 @@ if (VALID_DESCRIPTOR_TYPE (*StackPtr, ACPI_DESC_TYPE_NAMED)) { - Status = AcpiAmlResolveNodeToValue ((ACPI_NAMESPACE_NODE **) StackPtr); + Status = AcpiAmlResolveNodeToValue ((ACPI_NAMESPACE_NODE **) StackPtr, WalkState); } @@ -495,6 +495,10 @@ StackDesc->Common.Type = (UINT8) ACPI_TYPE_NUMBER; StackDesc->Number.Value = ACPI_INTEGER_MAX; + + /* Truncate value if we are executing from a 32-bit ACPI table */ + + AcpiAmlTruncateFor32bitTable (StackDesc, WalkState); break; diff -ruN acpica-unix-20001020/Subsystem/Interpreter/amstoren.c acpica-unix-20001115/Subsystem/Interpreter/amstoren.c --- acpica-unix-20001020/Subsystem/Interpreter/amstoren.c Sat Oct 21 06:45:00 2000 +++ acpica-unix-20001115/Subsystem/Interpreter/amstoren.c Thu Nov 16 09:18:45 2000 @@ -3,7 +3,7 @@ * * Module Name: amstoren - AML Interpreter object store support, * Store to Node (namespace object) - * $Revision: 22 $ + * $Revision: 23 $ * *****************************************************************************/ @@ -669,7 +669,12 @@ case ACPI_TYPE_NUMBER: + DestDesc->Number.Value = ValDesc->Number.Value; + + /* Truncate value if we are executing from a 32-bit ACPI table */ + + AcpiAmlTruncateFor32bitTable (DestDesc, WalkState); break; diff -ruN acpica-unix-20001020/Subsystem/Interpreter/amstorob.c acpica-unix-20001115/Subsystem/Interpreter/amstorob.c --- acpica-unix-20001020/Subsystem/Interpreter/amstorob.c Sat Oct 21 06:45:00 2000 +++ acpica-unix-20001115/Subsystem/Interpreter/amstorob.c Thu Nov 16 09:18:45 2000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: amstorob - AML Interpreter object store support, store to object - * $Revision: 16 $ + * $Revision: 17 $ * *****************************************************************************/ @@ -416,6 +416,10 @@ case ACPI_TYPE_NUMBER: DestDesc->Number.Value = ValDesc->Number.Value; + + /* Truncate value if we are executing from a 32-bit ACPI table */ + + AcpiAmlTruncateFor32bitTable (DestDesc, WalkState); break; default: diff -ruN acpica-unix-20001020/Subsystem/Interpreter/amutils.c acpica-unix-20001115/Subsystem/Interpreter/amutils.c --- acpica-unix-20001020/Subsystem/Interpreter/amutils.c Sat Oct 21 06:45:01 2000 +++ acpica-unix-20001115/Subsystem/Interpreter/amutils.c Thu Nov 16 09:18:46 2000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: amutils - interpreter/scanner utilities - * $Revision: 56 $ + * $Revision: 63 $ * *****************************************************************************/ @@ -227,24 +227,45 @@ /******************************************************************************* * - * FUNCTION: AcpiAmlBufSeq + * FUNCTION: AcpiAmlTruncateFor32bitTable * - * RETURN: The next buffer descriptor sequence number + * PARAMETERS: ObjDesc - Object to be truncated + * WalkState - Current walk state + * (A method must be executing) * - * DESCRIPTION: Provide a unique sequence number for each Buffer descriptor - * allocated during the interpreter's existence. These numbers - * are used to relate FieldUnit descriptors to the Buffers - * within which the fields are defined. + * RETURN: none * - * Just increment the global counter and return it. + * DESCRIPTION: Truncate a number to 32-bits if the currently executing method + * belongs to a 32-bit ACPI table. * ******************************************************************************/ -UINT32 -AcpiAmlBufSeq (void) +void +AcpiAmlTruncateFor32bitTable ( + ACPI_OPERAND_OBJECT *ObjDesc, + ACPI_WALK_STATE *WalkState) { - return (++AcpiGbl_BufSeq); + /* + * Object must be a valid number and we must be executing + * a control method + */ + + if ((!ObjDesc) || + (ObjDesc->Common.Type != ACPI_TYPE_NUMBER) || + (!WalkState->MethodNode)) + { + return; + } + + if (WalkState->MethodNode->Flags & ANOBJ_DATA_WIDTH_32) + { + /* + * 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 + */ + ObjDesc->Number.Value &= (UINT64) ACPI_UINT32_MAX; + } } @@ -371,7 +392,7 @@ else { - for (NumDigits = 1 + (val < 0) ; val /= base ; ++NumDigits) + for (NumDigits = 1 + (val < 0); (val = ACPI_DIVIDE (val,base)); ++NumDigits) { ; } } @@ -389,7 +410,7 @@ * ******************************************************************************/ -UINT32 +static UINT32 _ntohl ( UINT32 Value) { @@ -478,8 +499,8 @@ for (Count = DigitsNeeded; Count > 0; Count--) { - OutString[Count-1] = (NATIVE_CHAR) ('0' + (Value % 10)); - Value /= 10; + OutString[Count-1] = (NATIVE_CHAR) ('0' + (ACPI_MODULO (Value, 10))); + Value = ACPI_DIVIDE (Value, 10); } return (AE_OK); @@ -530,8 +551,8 @@ LevelPtr = &CopyLevel[0]; CurrentDepth = 0; - DestObj->Common.Type = SourceObj->Common.Type; - DestObj->Package.Count = SourceObj->Package.Count; + DestObj->Common.Type = SourceObj->Common.Type; + DestObj->Package.Count = SourceObj->Package.Count; /* @@ -556,8 +577,8 @@ while (1) { ThisIndex = LevelPtr->Index; - ThisDestObj = (ACPI_OPERAND_OBJECT *) LevelPtr->DestObj->Package.Elements[ThisIndex]; - ThisSourceObj = (ACPI_OPERAND_OBJECT *) LevelPtr->SourceObj->Package.Elements[ThisIndex]; + ThisDestObj = (ACPI_OPERAND_OBJECT *) LevelPtr->DestObj->Package.Elements[ThisIndex]; + ThisSourceObj = (ACPI_OPERAND_OBJECT *) LevelPtr->SourceObj->Package.Elements[ThisIndex]; if (IS_THIS_OBJECT_TYPE (ThisSourceObj, ACPI_TYPE_PACKAGE)) { diff -ruN acpica-unix-20001020/Subsystem/Namespace/nsaccess.c acpica-unix-20001115/Subsystem/Namespace/nsaccess.c --- acpica-unix-20001020/Subsystem/Namespace/nsaccess.c Sat Oct 21 06:45:01 2000 +++ acpica-unix-20001115/Subsystem/Namespace/nsaccess.c Thu Nov 16 09:18:46 2000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: nsaccess - Top-level functions for accessing ACPI namespace - * $Revision: 111 $ + * $Revision: 113 $ * ******************************************************************************/ @@ -187,8 +187,7 @@ IMODE_LOAD_PASS2, NS_NO_UPSEARCH, NULL, &NewNode); - if (ACPI_FAILURE (Status) || - (!NewNode)) + if (ACPI_FAILURE (Status) || (!NewNode)) /* Must be on same line for code converter */ { DEBUG_PRINT (ACPI_ERROR, ("Could not create predefined name %s, %s\n", @@ -362,7 +361,8 @@ BOOLEAN NullNamePath = FALSE; OBJECT_TYPE_INTERNAL TypeToCheckFor; OBJECT_TYPE_INTERNAL ThisSearchType; - DEBUG_EXEC (UINT32 i) + + DEBUG_ONLY_MEMBERS (UINT32 i) FUNCTION_TRACE ("NsLookup"); diff -ruN acpica-unix-20001020/Subsystem/Namespace/nsalloc.c acpica-unix-20001115/Subsystem/Namespace/nsalloc.c --- acpica-unix-20001020/Subsystem/Namespace/nsalloc.c Sat Oct 21 06:45:01 2000 +++ acpica-unix-20001115/Subsystem/Namespace/nsalloc.c Thu Nov 16 09:18:46 2000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: nsalloc - Namespace allocation and deletion utilities - * $Revision: 41 $ + * $Revision: 42 $ * ******************************************************************************/ @@ -578,7 +578,7 @@ * ******************************************************************************/ -void +static void AcpiNsRemoveReference ( ACPI_NAMESPACE_NODE *Node) { diff -ruN acpica-unix-20001020/Subsystem/Namespace/nsdump.c acpica-unix-20001115/Subsystem/Namespace/nsdump.c --- acpica-unix-20001020/Subsystem/Namespace/nsdump.c Sat Oct 21 06:45:01 2000 +++ acpica-unix-20001115/Subsystem/Namespace/nsdump.c Thu Nov 16 09:18:46 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: nsdump - table dumping routines for debug - * $Revision: 80 $ + * $Revision: 81 $ * *****************************************************************************/ @@ -521,6 +521,7 @@ } +#ifndef _ACPI_ASL_COMPILER /**************************************************************************** * * FUNCTION: AcpiNsDumpOneDevice @@ -594,6 +595,7 @@ AcpiNsDumpOneDevice, NULL, NULL); } +#endif /**************************************************************************** * diff -ruN acpica-unix-20001020/Subsystem/Namespace/nsinit.c acpica-unix-20001115/Subsystem/Namespace/nsinit.c --- acpica-unix-20001020/Subsystem/Namespace/nsinit.c Sat Oct 21 06:45:01 2000 +++ acpica-unix-20001115/Subsystem/Namespace/nsinit.c Thu Nov 16 09:18:46 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: nsinit - namespace initialization - * $Revision: 4 $ + * $Revision: 5 $ * *****************************************************************************/ @@ -437,8 +437,7 @@ Status = AcpiNsEvaluateRelative (ObjHandle, "_HID", NULL, &RetObj); if (AE_NOT_FOUND == Status) { - /* No _HID --> Can't be a PCI root bridge */ - + /* No _HID --> Can't be a PCI root bridge */ return_ACPI_STATUS (AE_OK); } @@ -508,7 +507,7 @@ AcpiCmRemoveReference (RetObj); } - return_ACPI_STATUS (AE_OK); + return_ACPI_STATUS (Status); } diff -ruN acpica-unix-20001020/Subsystem/Namespace/nsload.c acpica-unix-20001115/Subsystem/Namespace/nsload.c --- acpica-unix-20001020/Subsystem/Namespace/nsload.c Sat Oct 21 06:45:01 2000 +++ acpica-unix-20001115/Subsystem/Namespace/nsload.c Thu Nov 16 09:18:46 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: nsload - namespace loading/expanding/contracting procedures - * $Revision: 31 $ + * $Revision: 32 $ * *****************************************************************************/ @@ -321,12 +321,6 @@ { return_ACPI_STATUS (Status); } - - - /* TBD: no longer needed, remove */ - - AcpiGbl_ParsedNamespaceRoot = NULL; - return_ACPI_STATUS (Status); } diff -ruN acpica-unix-20001020/Subsystem/Namespace/nsobject.c acpica-unix-20001115/Subsystem/Namespace/nsobject.c --- acpica-unix-20001020/Subsystem/Namespace/nsobject.c Sat Oct 21 06:45:01 2000 +++ acpica-unix-20001115/Subsystem/Namespace/nsobject.c Thu Nov 16 09:18:46 2000 @@ -2,7 +2,7 @@ * * Module Name: nsobject - Utilities for objects attached to namespace * table entries - * $Revision: 46 $ + * $Revision: 47 $ * ******************************************************************************/ @@ -513,7 +513,7 @@ { /* handle invalid */ - REPORT_WARNING (("NsGetAttachedObject: Null handle\n")); + DEBUG_PRINT (ACPI_WARN, ("NsGetAttachedObject: Null handle\n")); return_PTR (NULL); } diff -ruN acpica-unix-20001020/Subsystem/Namespace/nssearch.c acpica-unix-20001115/Subsystem/Namespace/nssearch.c --- acpica-unix-20001020/Subsystem/Namespace/nssearch.c Sat Oct 21 06:45:02 2000 +++ acpica-unix-20001115/Subsystem/Namespace/nssearch.c Thu Nov 16 09:18:47 2000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: nssearch - Namespace search - * $Revision: 58 $ + * $Revision: 59 $ * ******************************************************************************/ @@ -284,7 +284,7 @@ * ******************************************************************************/ -ACPI_STATUS +static ACPI_STATUS AcpiNsSearchParentTree ( UINT32 TargetName, ACPI_NAMESPACE_NODE *Node, diff -ruN acpica-unix-20001020/Subsystem/Namespace/nsutils.c acpica-unix-20001115/Subsystem/Namespace/nsutils.c --- acpica-unix-20001020/Subsystem/Namespace/nsutils.c Sat Oct 21 06:45:02 2000 +++ acpica-unix-20001115/Subsystem/Namespace/nsutils.c Thu Nov 16 09:18:47 2000 @@ -2,7 +2,7 @@ * * Module Name: nsutils - Utilities for accessing ACPI namespace, accessing * parents and siblings and Scope manipulation - * $Revision: 71 $ + * $Revision: 72 $ * *****************************************************************************/ @@ -248,9 +248,10 @@ { NATIVE_CHAR *Result = NULL; NATIVE_CHAR *InternalName; - UINT32 NumSegments; + UINT32 NumSegments = 0; BOOLEAN FullyQualified = FALSE; UINT32 i; + UINT32 NumCarats = 0; FUNCTION_TRACE ("NsInternalizeName"); @@ -280,6 +281,18 @@ ExternalName++; } + else + { + /* + * Handle Carat prefixes + */ + + while (*ExternalName == '^') + { + NumCarats++; + ExternalName++; + } + } /* * Determine the number of ACPI name "segments" by counting @@ -288,19 +301,22 @@ * + 1, and zero separators is ok. */ - NumSegments = 1; - for (i = 0; ExternalName[i]; i++) + if (*ExternalName) { - if (AcpiNsValidPathSeparator (ExternalName[i])) + NumSegments = 1; + for (i = 0; ExternalName[i]; i++) { - NumSegments++; + if (AcpiNsValidPathSeparator (ExternalName[i])) + { + NumSegments++; + } } } /* We need a segment to store the internal version of the name */ - InternalName = AcpiCmCallocate ((ACPI_NAME_SIZE * NumSegments) + 4); + InternalName = AcpiCmCallocate ((ACPI_NAME_SIZE * NumSegments) + 4 + NumCarats); if (!InternalName) { return_ACPI_STATUS (AE_NO_MEMORY); @@ -312,15 +328,58 @@ if (FullyQualified) { InternalName[0] = '\\'; - InternalName[1] = AML_MULTI_NAME_PREFIX_OP; - InternalName[2] = (char) NumSegments; - Result = &InternalName[3]; + + if (NumSegments <= 1) + { + Result = &InternalName[1]; + } + else if (NumSegments == 2) + { + InternalName[1] = AML_DUAL_NAME_PREFIX; + Result = &InternalName[2]; + } + else + { + InternalName[1] = AML_MULTI_NAME_PREFIX_OP; + InternalName[2] = (char) NumSegments; + Result = &InternalName[3]; + } + } + else { - InternalName[0] = AML_MULTI_NAME_PREFIX_OP; - InternalName[1] = (char) NumSegments; - Result = &InternalName[2]; + /* + * Not fully qualified. + * Handle Carats first, then append the name segments + */ + + i = 0; + if (NumCarats) + { + for (i = 0; i < NumCarats; i++) + { + InternalName[i] = '^'; + } + } + + if (NumSegments == 1) + { + Result = &InternalName[i]; + } + + else if (NumSegments == 2) + { + InternalName[i] = AML_DUAL_NAME_PREFIX; + Result = &InternalName[i+1]; + } + + else + { + InternalName[i] = AML_MULTI_NAME_PREFIX_OP; + InternalName[i+1] = (char) NumSegments; + Result = &InternalName[i+2]; + } } @@ -378,7 +437,7 @@ { DEBUG_PRINT (TRACE_EXEC, ("NsInternalizeName: returning [%p] (abs) \"\\%s\"\n", - InternalName, &InternalName[3])); + InternalName, &InternalName[0])); } else { diff -ruN acpica-unix-20001020/Subsystem/Namespace/nsxfname.c acpica-unix-20001115/Subsystem/Namespace/nsxfname.c --- acpica-unix-20001020/Subsystem/Namespace/nsxfname.c Sat Oct 21 06:45:02 2000 +++ acpica-unix-20001115/Subsystem/Namespace/nsxfname.c Thu Nov 16 09:18:47 2000 @@ -2,7 +2,7 @@ * * Module Name: nsxfname - Public interfaces to the ACPI subsystem * ACPI Namespace oriented interfaces - * $Revision: 71 $ + * $Revision: 72 $ * *****************************************************************************/ @@ -155,7 +155,7 @@ ACPI_HANDLE *RetHandle) { ACPI_STATUS Status; - ACPI_NAMESPACE_NODE *Node; + ACPI_NAMESPACE_NODE *Node = NULL; ACPI_NAMESPACE_NODE *PrefixNode = NULL; @@ -168,14 +168,13 @@ { AcpiCmAcquireMutex (ACPI_MTX_NAMESPACE); - Node = AcpiNsConvertHandleToEntry (Parent); - if (!Node) + PrefixNode = AcpiNsConvertHandleToEntry (Parent); + if (!PrefixNode) { AcpiCmReleaseMutex (ACPI_MTX_NAMESPACE); return (AE_BAD_PARAMETER); } - PrefixNode = Node->Child; AcpiCmReleaseMutex (ACPI_MTX_NAMESPACE); } @@ -191,8 +190,7 @@ /* * Find the Node and convert to the user format */ - Node = NULL; - Status = AcpiNsGetNode (Pathname, PrefixNode, &Node); + Status = AcpiNsGetNode (Pathname, Node, &Node); *RetHandle = NULL; if(ACPI_SUCCESS(Status)) diff -ruN acpica-unix-20001020/Subsystem/Parser/psargs.c acpica-unix-20001115/Subsystem/Parser/psargs.c --- acpica-unix-20001020/Subsystem/Parser/psargs.c Sat Oct 21 06:45:02 2000 +++ acpica-unix-20001115/Subsystem/Parser/psargs.c Thu Nov 16 09:18:47 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: psargs - Parse AML opcode arguments - * $Revision: 35 $ + * $Revision: 40 $ * *****************************************************************************/ @@ -125,20 +125,6 @@ MODULE_NAME ("psargs") -UINT32 -AcpiPsPkgLengthEncodingSize ( - UINT32 FirstByte) -{ - - /* - * Bits 6-7 contain the number of bytes - * in the encoded package length (-1) - */ - - return ((FirstByte >> 6) + 1); -} - - /******************************************************************************* * * FUNCTION: AcpiPsGetNextPackageLength @@ -153,58 +139,6 @@ ******************************************************************************/ UINT32 -xxxAcpiPsGetNextPackageLength ( - ACPI_PARSE_STATE *ParserState) -{ - UINT32 EncodingLength; - UINT32 PackageLength = 0; - UINT8 *AmlPtr = ParserState->Aml; - - - FUNCTION_TRACE ("PsGetNextPackageLength"); - - - EncodingLength = AcpiPsPkgLengthEncodingSize ((UINT32) GET8 (AmlPtr)); - - - switch (EncodingLength) - { - case 1: /* 1-byte encoding (bits 0-5) */ - - PackageLength = ((UINT32) GET8 (AmlPtr) & 0x3f); - break; - - - case 2: /* 2-byte encoding (next byte + bits 0-3) */ - - PackageLength = ((((UINT32) GET8 (AmlPtr + 1)) << 4) | - (((UINT32) GET8 (AmlPtr)) & 0x0f)); - break; - - - case 3: /* 3-byte encoding (next 2 bytes + bits 0-3) */ - - PackageLength = ((((UINT32) GET8 (AmlPtr + 2)) << 12) | - (((UINT32) GET8 (AmlPtr + 1)) << 4) | - (((UINT32) GET8 (AmlPtr)) & 0x0f)); - break; - - - case 4: /* 4-byte encoding (next 3 bytes + bits 0-3) */ - - PackageLength = ((((UINT32) GET8 (AmlPtr + 3)) << 20) | - (((UINT32) GET8 (AmlPtr + 2)) << 12) | - (((UINT32) GET8 (AmlPtr + 1)) << 4) | - (((UINT32) GET8 (AmlPtr)) & 0x0f)); - break; - } - - ParserState->Aml += EncodingLength; - - return_VALUE (PackageLength); -} - -UINT32 AcpiPsGetNextPackageLength ( ACPI_PARSE_STATE *ParserState) { @@ -223,32 +157,33 @@ { case 0: /* 1-byte encoding (bits 0-5) */ - Length = (EncodedLength & 0x3f); + Length = (EncodedLength & 0x3F); break; case 1: /* 2-byte encoding (next byte + bits 0-3) */ - Length = (GET8 (ParserState->Aml) << 4) | (EncodedLength & 0xf); + Length = ((GET8 (ParserState->Aml) << 04) | + (EncodedLength & 0x0F)); ParserState->Aml++; break; case 2: /* 3-byte encoding (next 2 bytes + bits 0-3) */ - Length = ( (GET8 (ParserState->Aml + 1) << 12) - | (GET8 (ParserState->Aml) << 4) - | (EncodedLength & 0xf)); + Length = ((GET8 (ParserState->Aml + 1) << 12) | + (GET8 (ParserState->Aml) << 04) | + (EncodedLength & 0x0F)); ParserState->Aml += 2; break; case 3: /* 4-byte encoding (next 3 bytes + bits 0-3) */ - Length = ( (GET8 (ParserState->Aml + 2) << 20) - | (GET8 (ParserState->Aml + 1) << 12) - | (GET8 (ParserState->Aml) << 4) - | (EncodedLength & 0xf)); + Length = ((GET8 (ParserState->Aml + 2) << 20) | + (GET8 (ParserState->Aml + 1) << 12) | + (GET8 (ParserState->Aml) << 04) | + (EncodedLength & 0x0F)); ParserState->Aml += 3; break; } @@ -570,6 +505,11 @@ NameOp->Node = MethodNode; AcpiPsAppendArg (Arg, NameOp); + + if (!(ACPI_OPERAND_OBJECT *) MethodNode->Object) + { + return_VOID; + } *ArgCount = ((ACPI_OPERAND_OBJECT *) MethodNode->Object)->Method.ParamCount; } diff -ruN acpica-unix-20001020/Subsystem/Parser/psfind.c acpica-unix-20001115/Subsystem/Parser/psfind.c --- acpica-unix-20001020/Subsystem/Parser/psfind.c Sat Oct 21 06:45:02 2000 +++ acpica-unix-20001115/Subsystem/Parser/psfind.c Thu Nov 16 09:18:47 2000 @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: psfind - Parse tree search routine - * $Revision: 17 $ + * $Revision: 18 $ * *****************************************************************************/ @@ -138,7 +138,7 @@ * ******************************************************************************/ -ACPI_PARSE_OBJECT* +static ACPI_PARSE_OBJECT* AcpiPsGetParent ( ACPI_PARSE_OBJECT *Op) { @@ -183,7 +183,7 @@ * ******************************************************************************/ -ACPI_PARSE_OBJECT * +static ACPI_PARSE_OBJECT * AcpiPsFindName ( ACPI_PARSE_OBJECT *Scope, UINT32 Name, diff -ruN acpica-unix-20001020/Subsystem/Parser/psopcode.c acpica-unix-20001115/Subsystem/Parser/psopcode.c --- acpica-unix-20001020/Subsystem/Parser/psopcode.c Sat Oct 21 06:45:02 2000 +++ acpica-unix-20001115/Subsystem/Parser/psopcode.c Thu Nov 16 09:18:47 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: psopcode - Parser opcode information table - * $Revision: 20 $ + * $Revision: 24 $ * *****************************************************************************/ @@ -124,9 +124,6 @@ MODULE_NAME ("psopcode") -UINT8 AcpiGbl_AmlShortOpInfoIndex[]; -UINT8 AcpiGbl_AmlLongOpInfoIndex[]; - #define _UNK 0x6B /* * Reserved ASCII characters. Do not use any of these for @@ -146,119 +143,6 @@ /******************************************************************************* * - * FUNCTION: AcpiPsGetOpcodeInfo - * - * PARAMETERS: Opcode - The AML opcode - * - * RETURN: A pointer to the info about the opcode. NULL if the opcode was - * not found in the table. - * - * DESCRIPTION: Find AML opcode description based on the opcode. - * NOTE: This procedure must ALWAYS return a valid pointer! - * - ******************************************************************************/ - -ACPI_OPCODE_INFO * -AcpiPsGetOpcodeInfo ( - UINT16 Opcode) -{ - ACPI_OPCODE_INFO *OpInfo; - UINT8 UpperOpcode; - UINT8 LowerOpcode; - - - /* Split the 16-bit opcode into separate bytes */ - - UpperOpcode = (UINT8) (Opcode >> 8); - LowerOpcode = (UINT8) Opcode; - - /* Default is "unknown opcode" */ - - OpInfo = &AcpiGbl_AmlOpInfo [_UNK]; - - - /* - * Detect normal 8-bit opcode or extended 16-bit opcode - */ - - switch (UpperOpcode) - { - case 0: - - /* Simple (8-bit) opcode: 0-255, can't index beyond table */ - - OpInfo = &AcpiGbl_AmlOpInfo [AcpiGbl_AmlShortOpInfoIndex [LowerOpcode]]; - break; - - - case AML_EXTOP: - - /* Extended (16-bit, prefix+opcode) opcode */ - - if (LowerOpcode <= MAX_EXTENDED_OPCODE) - { - OpInfo = &AcpiGbl_AmlOpInfo [AcpiGbl_AmlLongOpInfoIndex [LowerOpcode]]; - } - break; - - - case AML_LNOT_OP: - - /* This case is for the bogus opcodes LNOTEQUAL, LLESSEQUAL, LGREATEREQUAL */ - /* TBD: [Investigate] remove this case? */ - - DEBUG_PRINT (ACPI_ERROR, ("PsGetOpcodeInfo: Bad multi-byte opcode=%X\n", - Opcode)); - - break; - - - default: - - DEBUG_PRINT (ACPI_ERROR, ("PsGetOpcodeInfo: Unknown extended opcode=%X\n", - Opcode)); - - break; - } - - - /* Get the Op info pointer for this opcode */ - - return (OpInfo); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiPsGetOpcodeName - * - * PARAMETERS: Opcode - The AML opcode - * - * RETURN: A pointer to the name of the opcode (ASCII String) - * Note: Never returns NULL. - * - * DESCRIPTION: Translate an opcode into a human-readable string - * - ******************************************************************************/ - -NATIVE_CHAR * -AcpiPsGetOpcodeName ( - UINT16 Opcode) -{ - ACPI_OPCODE_INFO *Op; - - - Op = AcpiPsGetOpcodeInfo (Opcode); - - /* Always guaranteed to return a valid pointer */ - - DEBUG_ONLY_MEMBERS (return Op->Name); - return ("AE_NOT_CONFIGURED"); -} - - -/******************************************************************************* - * * NAME: AcpiGbl_AmlOpInfo * * DESCRIPTION: Opcode table. Each entry contains @@ -485,7 +369,7 @@ #define ARGI_REVISION_OP ARG_NONE #define ARGI_DEBUG_OP ARG_NONE #define ARGI_FATAL_OP ARGI_LIST3 (ARGI_NUMBER, ARGI_NUMBER, ARGI_NUMBER) -#define ARGI_REGION_OP ARGI_INVALID_OPCODE +#define ARGI_REGION_OP ARGI_LIST2 (ARGI_NUMBER, ARGI_NUMBER) #define ARGI_DEF_FIELD_OP ARGI_INVALID_OPCODE #define ARGI_DEVICE_OP ARGI_INVALID_OPCODE #define ARGI_PROCESSOR_OP ARGI_INVALID_OPCODE @@ -510,7 +394,7 @@ */ -ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[] = +static ACPI_OPCODE_INFO AmlOpInfo[] = { /* Index Opcode Type Class Has Arguments? Name Parser Args Interpreter Args */ @@ -637,7 +521,7 @@ * index into the table above */ -UINT8 AcpiGbl_AmlShortOpInfoIndex[256] = +static UINT8 AmlShortOpInfoIndex[256] = { /* 0 1 2 3 4 5 6 7 */ /* 0x00 */ 0x00, 0x01, _UNK, _UNK, _UNK, _UNK, 0x02, _UNK, @@ -675,7 +559,7 @@ }; -UINT8 AcpiGbl_AmlLongOpInfoIndex[NUM_EXTENDED_OPCODE] = +static UINT8 AmlLongOpInfoIndex[NUM_EXTENDED_OPCODE] = { /* 0 1 2 3 4 5 6 7 */ /* 0x00 */ _UNK, 0x46, 0x47, _UNK, _UNK, _UNK, _UNK, _UNK, @@ -700,5 +584,121 @@ /* 0 1 2 3 4 5 6 7 */ /* 0x00 */ + + +/******************************************************************************* + * + * FUNCTION: AcpiPsGetOpcodeInfo + * + * PARAMETERS: Opcode - The AML opcode + * + * RETURN: A pointer to the info about the opcode. NULL if the opcode was + * not found in the table. + * + * DESCRIPTION: Find AML opcode description based on the opcode. + * NOTE: This procedure must ALWAYS return a valid pointer! + * + ******************************************************************************/ + +ACPI_OPCODE_INFO * +AcpiPsGetOpcodeInfo ( + UINT16 Opcode) +{ + ACPI_OPCODE_INFO *OpInfo; + UINT8 UpperOpcode; + UINT8 LowerOpcode; + + + /* Split the 16-bit opcode into separate bytes */ + + UpperOpcode = (UINT8) (Opcode >> 8); + LowerOpcode = (UINT8) Opcode; + + /* Default is "unknown opcode" */ + + OpInfo = &AmlOpInfo [_UNK]; + + + /* + * Detect normal 8-bit opcode or extended 16-bit opcode + */ + + switch (UpperOpcode) + { + case 0: + + /* Simple (8-bit) opcode: 0-255, can't index beyond table */ + + OpInfo = &AmlOpInfo [AmlShortOpInfoIndex [LowerOpcode]]; + break; + + + case AML_EXTOP: + + /* Extended (16-bit, prefix+opcode) opcode */ + + if (LowerOpcode <= MAX_EXTENDED_OPCODE) + { + OpInfo = &AmlOpInfo [AmlLongOpInfoIndex [LowerOpcode]]; + } + break; + + + case AML_LNOT_OP: + + /* This case is for the bogus opcodes LNOTEQUAL, LLESSEQUAL, LGREATEREQUAL */ + /* TBD: [Investigate] remove this case? */ + + DEBUG_PRINT (ACPI_ERROR, ("PsGetOpcodeInfo: Bad multi-byte opcode=%X\n", + Opcode)); + + break; + + + default: + + DEBUG_PRINT (ACPI_ERROR, ("PsGetOpcodeInfo: Unknown extended opcode=%X\n", + Opcode)); + + break; + } + + + /* Get the Op info pointer for this opcode */ + + return (OpInfo); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiPsGetOpcodeName + * + * PARAMETERS: Opcode - The AML opcode + * + * RETURN: A pointer to the name of the opcode (ASCII String) + * Note: Never returns NULL. + * + * DESCRIPTION: Translate an opcode into a human-readable string + * + ******************************************************************************/ + +NATIVE_CHAR * +AcpiPsGetOpcodeName ( + UINT16 Opcode) +{ + ACPI_OPCODE_INFO *Op; + + + Op = AcpiPsGetOpcodeInfo (Opcode); + + /* Always guaranteed to return a valid pointer */ + +#ifdef ACPI_DEBUG + return (Op->Name); +#else + return ("AE_NOT_CONFIGURED"); +#endif +} diff -ruN acpica-unix-20001020/Subsystem/Parser/psparse.c acpica-unix-20001115/Subsystem/Parser/psparse.c --- acpica-unix-20001020/Subsystem/Parser/psparse.c Sat Oct 21 06:45:02 2000 +++ acpica-unix-20001115/Subsystem/Parser/psparse.c Thu Nov 16 09:18:47 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: psparse - Parser top level AML parse routines - * $Revision: 60 $ + * $Revision: 65 $ * *****************************************************************************/ @@ -121,7 +121,7 @@ * generated parser to tightly constrain stack and dynamic memory * usage. At the same time, parsing is kept flexible and the code * fairly compact by parsing based on a list of AML opcode - * templates in AcpiGbl_AmlOpInfo[] + * templates in AmlOpInfo[] */ #include "acpi.h" @@ -141,101 +141,6 @@ /******************************************************************************* * - * FUNCTION: AcpiPsDeleteCompletedOp - * - * PARAMETERS: State - Walk state - * Op - Completed op - * - * RETURN: AE_OK - * - * DESCRIPTION: Callback function for AcpiPsGetNextWalkOp(). Used during - * AcpiPsDeleteParse tree to delete Op objects when all sub-objects - * have been visited (and deleted.) - * - ******************************************************************************/ - -ACPI_STATUS -AcpiPsDeleteCompletedOp ( - ACPI_WALK_STATE *State, - ACPI_PARSE_OBJECT *Op) -{ - - AcpiPsFreeOp (Op); - return (AE_OK); -} - - -#ifndef PARSER_ONLY -/******************************************************************************* - * - * FUNCTION: AcpiPsDeleteParseTree - * - * PARAMETERS: SubtreeRoot - Root of tree (or subtree) to delete - * - * RETURN: None - * - * DESCRIPTION: Delete a portion of or an entire parse tree. - * - ******************************************************************************/ - -void -AcpiPsDeleteParseTree ( - ACPI_PARSE_OBJECT *SubtreeRoot) -{ - ACPI_WALK_STATE *WalkState; - ACPI_WALK_LIST WalkList; - - - FUNCTION_TRACE_PTR ("PsDeleteParseTree", SubtreeRoot); - - - if (!SubtreeRoot) - { - return_VOID; - } - - /* Create and initialize a new walk list */ - - WalkList.WalkState = NULL; - WalkState = AcpiDsCreateWalkState (TABLE_ID_DSDT, NULL, NULL, &WalkList); - if (!WalkState) - { - return_VOID; - } - - WalkState->ParserState = NULL; - WalkState->ParseFlags = 0; - WalkState->DescendingCallback = NULL; - WalkState->AscendingCallback = NULL; - - - WalkState->Origin = SubtreeRoot; - WalkState->NextOp = SubtreeRoot; - - - /* Head downward in the tree */ - - WalkState->NextOpInfo = NEXT_OP_DOWNWARD; - - /* Visit all nodes in the subtree */ - - while (WalkState->NextOp) - { - AcpiPsGetNextWalkOp (WalkState, WalkState->NextOp, - AcpiPsDeleteCompletedOp); - } - - /* We are done with this walk */ - - AcpiDsDeleteWalkState (WalkState); - - return_VOID; -} -#endif - - -/******************************************************************************* - * * FUNCTION: AcpiPsPeekOpcode * * PARAMETERS: None @@ -246,7 +151,7 @@ * ******************************************************************************/ -UINT32 +static UINT32 AcpiPsGetOpcodeSize ( UINT32 Opcode) { @@ -428,7 +333,7 @@ * ******************************************************************************/ -BOOLEAN +static BOOLEAN AcpiPsCompleteThisOp ( ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op) @@ -560,8 +465,7 @@ * ******************************************************************************/ - -ACPI_STATUS +static ACPI_STATUS AcpiPsNextParseState ( ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op, @@ -700,12 +604,12 @@ ACPI_PARSE_STATE *ParserState; - FUNCTION_TRACE_PTR ("PsParseLoop", WalkState); ParserState = WalkState->ParserState; +#ifndef PARSER_ONLY if (WalkState->WalkType & WALK_METHOD_RESTART) { /* We are restarting a preempted control method */ @@ -725,11 +629,18 @@ { /* - * A predicate was just completed, get the value of the + * A predicate was just completed, get the value of the * predicate and branch based on that value */ Status = AcpiDsGetPredicateValue (WalkState, NULL, TRUE); + if (Status == AE_AML_NO_OPERAND) + { + DEBUG_PRINT (ACPI_ERROR, + ("PsParseLoop: Invoked method did not return a value, %s\n", + AcpiCmFormatException (Status))); + + } Status = AcpiPsNextParseState (WalkState, Op, Status); } @@ -745,6 +656,7 @@ ArgTypes = WalkState->PrevArgTypes; } } +#endif /* * Iterative parsing loop, while there is more aml to process: diff -ruN acpica-unix-20001020/Subsystem/Parser/pstree.c acpica-unix-20001115/Subsystem/Parser/pstree.c --- acpica-unix-20001020/Subsystem/Parser/pstree.c Sat Oct 21 06:45:03 2000 +++ acpica-unix-20001115/Subsystem/Parser/pstree.c Thu Nov 16 09:18:48 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: pstree - Parser op tree manipulation/traversal/search - * $Revision: 23 $ + * $Revision: 25 $ * *****************************************************************************/ @@ -394,125 +394,6 @@ } return (Next); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiPsFetchPrefix - * - * PARAMETERS: Scope - Op to fetch prefix for - * Path - A namestring containing the prefix - * io - Direction flag - * - * RETURN: Op referenced by the prefix - * - * DESCRIPTION: Fetch and handle path prefix ('\\' or '^') - * - ******************************************************************************/ - -ACPI_PARSE_OBJECT * -AcpiPsFetchPrefix ( - ACPI_PARSE_OBJECT *Scope, - NATIVE_CHAR **Path, - UINT32 io) -{ - UINT32 prefix = io ? GET8 (*Path):**Path; - - - switch (prefix) - { - case '\\': - case '/': - - /* go to the root */ - - *Path += 1; - while (Scope->Parent) - { - Scope = Scope->Parent; - } - break; - - - case '^': - - /* go up one level */ - - *Path += 1; - Scope = Scope->Parent; - break; - } - - if (Scope && !Scope->Parent) - { - /* searching from the root, start with its children */ - - Scope = AcpiPsGetChild (Scope); - } - - return (Scope); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiPsFetchName - * - * PARAMETERS: Path - A string containing the name segment - * io - Direction flag - * - * RETURN: The 4-INT8 ASCII ACPI Name as a UINT32 - * - * DESCRIPTION: Fetch ACPI name segment (dot-delimited) - * - ******************************************************************************/ - -UINT32 -AcpiPsFetchName ( - NATIVE_CHAR **Path, - UINT32 io) -{ - UINT32 Name = 0; - NATIVE_CHAR *nm; - UINT32 i; - NATIVE_CHAR ch; - - - if (io) - { - /* Get the name from the path pointer */ - - MOVE_UNALIGNED32_TO_32 (&Name, *Path); - *Path += 4; - } - - else - { - if (**Path == '.') - { - *Path += 1; - } - - nm = (NATIVE_CHAR *) &Name; - for (i = 0; i < 4; i++) - { - ch = **Path; - if (ch && ch != '.') - { - *nm = ch; - *Path += 1; - } - - else - { - *nm = '_'; - } - nm++; - } - } - - return (Name); } diff -ruN acpica-unix-20001020/Subsystem/Parser/pswalk.c acpica-unix-20001115/Subsystem/Parser/pswalk.c --- acpica-unix-20001020/Subsystem/Parser/pswalk.c Sat Oct 21 06:45:03 2000 +++ acpica-unix-20001115/Subsystem/Parser/pswalk.c Thu Nov 16 09:18:48 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: pswalk - Parser routines to walk parsed op tree(s) - * $Revision: 47 $ + * $Revision: 50 $ * *****************************************************************************/ @@ -184,116 +184,42 @@ Status = AscendingCallback (WalkState, Op); - switch (Status) + /* + * If we are back to the starting point, the walk is complete. + */ + if (Op == WalkState->Origin) { - case AE_CTRL_TERMINATE: + /* Reached the point of origin, the walk is complete */ - /* - * A control method was terminated via a RETURN statement. - * The walk of this method is complete. - */ - WalkState->PrevOp = WalkState->Origin; + WalkState->PrevOp = Op; WalkState->NextOp = NULL; - return_ACPI_STATUS (AE_OK); - break; - - - case AE_CTRL_FALSE: - - /* - * Either an IF/WHILE Predicate was false or we encountered a BREAK - * opcode. In both cases, we do not execute the rest of the - * package; We simply close out the parent (finishing the walk of - * this branch of the tree) and continue execution at the parent - * level. - */ - - Next = Parent->Next; - Status = AE_OK; - - /* - * If there is a sibling to the parent, we must close out the - * parent now, because we are going to continue to go downward (to - * the sibling) in the parse tree. - */ - if (Next) - { - Status = AscendingCallback (WalkState, Parent); - - /* The parent sibling will be next */ - - WalkState->PrevOp = Op; - WalkState->NextOp = Next; - WalkState->NextOpInfo = NEXT_OP_DOWNWARD; - - /* Continue downward */ - - return_ACPI_STATUS (AE_OK); - } - - /* - * Drop into the loop below because we are moving upwards in - * the tree - */ - - break; - - - default: - /* - * If we are back to the starting point, the walk is complete. - */ - if (Op == WalkState->Origin) - { - /* Reached the point of origin, the walk is complete */ - - WalkState->PrevOp = Op; - WalkState->NextOp = NULL; - - return_ACPI_STATUS (Status); - } - - /* - * Check for a sibling to the current op. A sibling means - * we are still going "downward" in the tree. - */ - - if (Next) - { - /* There is a sibling, it will be next */ - - WalkState->PrevOp = Op; - WalkState->NextOp = Next; - WalkState->NextOpInfo = NEXT_OP_DOWNWARD; + return_ACPI_STATUS (Status); + } - /* Continue downward */ + /* + * Check for a sibling to the current op. A sibling means + * we are still going "downward" in the tree. + */ - return_ACPI_STATUS (Status); - } + if (Next) + { + /* There is a sibling, it will be next */ - /* - * No sibling, but check status. - * Abort on error from callback routine - */ - if (ACPI_FAILURE (Status)) - { - /* Next op will be the parent */ + WalkState->PrevOp = Op; + WalkState->NextOp = Next; + WalkState->NextOpInfo = NEXT_OP_DOWNWARD; - WalkState->PrevOp = Op; - WalkState->NextOp = Parent; - WalkState->NextOpInfo = NEXT_OP_UPWARD; + /* Continue downward */ - return_ACPI_STATUS (Status); - } + return_ACPI_STATUS (Status); + } - /* - * Drop into the loop below because we are moving upwards in - * the tree - */ - break; - } + /* + * Drop into the loop below because we are moving upwards in + * the tree + */ } else @@ -321,69 +247,6 @@ Status = AscendingCallback (WalkState, Parent); - - switch (Status) - { - case AE_CTRL_FALSE: - - /* - * Either an IF/WHILE Predicate was false or we encountered a - * BREAK opcode. In both cases, we do not execute the rest of the - * package; We simply close out the parent (finishing the walk of - * this branch of the tree) and continue execution at the parent - * level. - */ - - Parent = GrandParent; - Next = GrandParent->Next; - GrandParent = GrandParent->Parent; - - Status = AscendingCallback (WalkState, Parent); - - /* Now continue to the next node in the tree */ - - break; - - - case AE_CTRL_TRUE: - - /* - * Predicate of a WHILE was true and the loop just completed an - * execution. Go back to the start of the loop and reevaluate the - * predicate. - */ - - Op = WalkState->ControlState->Control.PredicateOp; - - WalkState->ControlState->Common.State = CONTROL_PREDICATE_EXECUTING; - - /* - * AcpiEvaluate the predicate again (next) - * Because we will traverse WHILE tree again - */ - - WalkState->PrevOp = Op->Parent; - WalkState->NextOp = Op; - WalkState->NextOpInfo = NEXT_OP_DOWNWARD; - - return_ACPI_STATUS (AE_OK); - break; - - - case AE_CTRL_TERMINATE: - - /* - * A control method was terminated via a RETURN statement. - * The walk of this method is complete. - */ - WalkState->PrevOp = WalkState->Origin; - WalkState->NextOp = NULL; - - return_ACPI_STATUS (AE_OK); - break; - } - - /* * If we are back to the starting point, the walk is complete. */ @@ -397,7 +260,6 @@ return_ACPI_STATUS (Status); } - /* * If there is a sibling to this parent (it is not the starting point * Op), then we will visit it. @@ -413,19 +275,6 @@ return_ACPI_STATUS (Status); } - /* - * No sibling, check for an error from closing the parent - * (Also, AE_PENDING if a method call was encountered) - */ - if (ACPI_FAILURE (Status)) - { - WalkState->PrevOp = Parent; - WalkState->NextOp = GrandParent; - WalkState->NextOpInfo = NEXT_OP_UPWARD; - - return_ACPI_STATUS (Status); - } - /* No siblings, no errors, just move up one more level in the tree */ Op = Parent; @@ -445,283 +294,94 @@ /******************************************************************************* * - * FUNCTION: AcpiPsWalkLoop + * FUNCTION: AcpiPsDeleteCompletedOp * - * PARAMETERS: WalkList - State of the walk - * StartOp - Starting Op of the subtree to be walked - * DescendingCallback - Procedure called when a new Op is - * encountered - * AscendingCallback - Procedure called when Op is complete + * PARAMETERS: State - Walk state + * Op - Completed op * - * RETURN: Status + * RETURN: AE_OK * - * DESCRIPTION: Perform a walk of the parsed AML tree. Begins and terminates at - * the StartOp. + * DESCRIPTION: Callback function for AcpiPsGetNextWalkOp(). Used during + * AcpiPsDeleteParse tree to delete Op objects when all sub-objects + * have been visited (and deleted.) * ******************************************************************************/ -ACPI_STATUS -AcpiPsWalkLoop ( - ACPI_WALK_LIST *WalkList, - ACPI_PARSE_OBJECT *StartOp, - ACPI_PARSE_DOWNWARDS DescendingCallback, - ACPI_PARSE_UPWARDS AscendingCallback) +static ACPI_STATUS +AcpiPsDeleteCompletedOp ( + ACPI_WALK_STATE *State, + ACPI_PARSE_OBJECT *Op) { - ACPI_STATUS Status = AE_OK; - ACPI_WALK_STATE *WalkState; - ACPI_PARSE_OBJECT *Op = StartOp; - - - FUNCTION_TRACE_PTR ("PsWalkLoop", StartOp); - - WalkState = AcpiDsGetCurrentWalkState (WalkList); - - - /* Walk entire subtree, visiting all nodes depth-first */ - - while (Op) - { - if (WalkState->NextOpInfo != NEXT_OP_UPWARD) - { - Status = DescendingCallback (Op->Opcode, Op, WalkState, NULL); - } - - /* - * A TRUE exception means that an ELSE was detected, but the IF - * predicate evaluated TRUE. - */ - if (Status == AE_CTRL_TRUE) - { - /* - * Ignore the entire ELSE block by moving on to the the next opcode. - * And we do that by simply going up in the tree (either to the next - * sibling or to the parent) from here. - */ - - WalkState->NextOpInfo = NEXT_OP_UPWARD; - } - - /* Get the next node (op) in the depth-first walk */ - - Status = AcpiPsGetNextWalkOp (WalkState, Op, AscendingCallback); - - /* - * A PENDING exception means that a control method invocation has been - * detected - */ - - if (Status == AE_CTRL_PENDING) - { - /* Transfer control to the called control method */ - - Status = AcpiDsCallControlMethod (WalkList, WalkState, Op); - - /* - * If the transfer to the new method method call worked, a new walk - * state was created -- get it - */ - - WalkState = AcpiDsGetCurrentWalkState (WalkList); - } - - /* Abort the walk on any exception */ - - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - Op = WalkState->NextOp; - } - - return_ACPI_STATUS (AE_OK); + AcpiPsFreeOp (Op); + return (AE_OK); } /******************************************************************************* * - * FUNCTION: AcpiPsWalkParsedAml + * FUNCTION: AcpiPsDeleteParseTree * - * PARAMETERS: StartOp - Starting Op of the subtree to be walked - * EndOp - Where to terminate the walk - * DescendingCallback - Procedure called when a new Op is - * encountered - * AscendingCallback - Procedure called when Op is complete + * PARAMETERS: SubtreeRoot - Root of tree (or subtree) to delete * - * RETURN: Status - * - * DESCRIPTION: Top level interface to walk the parsed AML tree. Handles - * preemption of executing control methods. + * RETURN: None * - * NOTE: The EndOp is usually only different from the StartOp if - * we don't want to visit the StartOp during the tree descent. + * DESCRIPTION: Delete a portion of or an entire parse tree. * ******************************************************************************/ -ACPI_STATUS -mmmmAcpiPsWalkParsedAml ( - ACPI_PARSE_OBJECT *StartOp, - ACPI_PARSE_OBJECT *EndOp, - ACPI_OPERAND_OBJECT *MthDesc, - ACPI_NAMESPACE_NODE *StartNode, - ACPI_OPERAND_OBJECT **Params, - ACPI_OPERAND_OBJECT **CallerReturnDesc, - ACPI_OWNER_ID OwnerId, - ACPI_PARSE_DOWNWARDS DescendingCallback, - ACPI_PARSE_UPWARDS AscendingCallback) +void +AcpiPsDeleteParseTree ( + ACPI_PARSE_OBJECT *SubtreeRoot) { - ACPI_PARSE_OBJECT *Op; ACPI_WALK_STATE *WalkState; - ACPI_OPERAND_OBJECT *ReturnDesc; - ACPI_STATUS Status; ACPI_WALK_LIST WalkList; - ACPI_WALK_LIST *PrevWalkList; - FUNCTION_TRACE_PTR ("PsWalkParsedAml", StartOp); + FUNCTION_TRACE_PTR ("PsDeleteParseTree", SubtreeRoot); - /* Parameter Validation */ - - if (!StartOp || !EndOp) + if (!SubtreeRoot) { - return (AE_BAD_PARAMETER); + return_VOID; } - /* Initialize a new walk list */ + /* Create and initialize a new walk list */ WalkList.WalkState = NULL; - - WalkState = AcpiDsCreateWalkState (OwnerId, EndOp, MthDesc, &WalkList); + WalkState = AcpiDsCreateWalkState (TABLE_ID_DSDT, NULL, NULL, &WalkList); if (!WalkState) { - return_ACPI_STATUS (AE_NO_MEMORY); + return_VOID; } - /* TBD: [Restructure] TEMP until we pass WalkState to the interpreter - */ - PrevWalkList = AcpiGbl_CurrentWalkList; - AcpiGbl_CurrentWalkList = &WalkList; + WalkState->ParserState = NULL; + WalkState->ParseFlags = 0; + WalkState->DescendingCallback = NULL; + WalkState->AscendingCallback = NULL; - if (StartNode) - { - /* Push start scope on scope stack and make it current */ - Status = AcpiDsScopeStackPush (StartNode, ACPI_TYPE_METHOD, WalkState); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } + WalkState->Origin = SubtreeRoot; + WalkState->NextOp = SubtreeRoot; - } - if (MthDesc) - { - /* Init arguments if this is a control method */ - /* TBD: [Restructure] add walkstate as a param */ + /* Head downward in the tree */ - AcpiDsMethodDataInitArgs (Params, MTH_NUM_ARGS, WalkState); - } + WalkState->NextOpInfo = NEXT_OP_DOWNWARD; - Op = StartOp; - Status = AE_OK; + /* Visit all nodes in the subtree */ - - /* - * Execute the walk loop as long as there is a valid Walk State. This - * handles nested control method invocations without recursion. - */ - - DEBUG_PRINT (TRACE_PARSE, ("PsWalkParsedAml: Op=%p EndOp=%p State=%p\n", - Op, EndOp, WalkState)); - - while (WalkState) + while (WalkState->NextOp) { - if (ACPI_SUCCESS (Status)) - { - Status = AcpiPsWalkLoop (&WalkList, Op, DescendingCallback, - AscendingCallback); - } - - DEBUG_PRINT (TRACE_PARSE, - ("PsWalkParsedAml: Completed one call to walk loop, State=%p\n", - WalkState)); - - /* We are done with this walk, move on to the parent if any */ - - BREAKPOINT3; - - WalkState = AcpiDsPopWalkState (&WalkList); - - /* Extract return value before we delete WalkState */ - - ReturnDesc = WalkState->ReturnDesc; - - DEBUG_PRINT (TRACE_PARSE, - ("PsWalkParsedAml: ReturnValue=%p, State=%p\n", - WalkState->ReturnDesc, WalkState)); - - /* Reset the current scope to the beginning of scope stack */ - - AcpiDsScopeStackClear (WalkState); - - /* - * If we just returned from the execution of a control method, - * there's lots of cleanup to do - */ - - if (WalkState->MethodDesc) - { - AcpiDsTerminateControlMethod (WalkState); - } - - /* Delete this walk state and all linked control states */ - - AcpiDsDeleteWalkState (WalkState); - - /* Check if we have restarted a preempted walk */ - - WalkState = AcpiDsGetCurrentWalkState (&WalkList); - if (WalkState && - ACPI_SUCCESS (Status)) - { - /* There is another walk state, restart it */ - - /* - * If the method returned value is not used by the parent, - * The object is deleted - */ - - AcpiDsRestartControlMethod (WalkState, ReturnDesc); - - /* Get the next Op to process */ - - Op = WalkState->NextOp; - } - - /* - * Just completed a 1st-level method, save the final internal return - * value (if any) - */ - - else if (CallerReturnDesc) - { - *CallerReturnDesc = ReturnDesc; /* NULL if no return value */ - } - - else if (ReturnDesc) - { - /* Caller doesn't want it, must delete it */ - - AcpiCmRemoveReference (ReturnDesc); - } + AcpiPsGetNextWalkOp (WalkState, WalkState->NextOp, + AcpiPsDeleteCompletedOp); } + /* We are done with this walk */ - AcpiGbl_CurrentWalkList = PrevWalkList; + AcpiDsDeleteWalkState (WalkState); - return_ACPI_STATUS (Status); + return_VOID; } diff -ruN acpica-unix-20001020/Subsystem/Resources/rsaddr.c acpica-unix-20001115/Subsystem/Resources/rsaddr.c --- acpica-unix-20001020/Subsystem/Resources/rsaddr.c Sat Oct 21 06:45:03 2000 +++ acpica-unix-20001115/Subsystem/Resources/rsaddr.c Thu Nov 16 09:18:48 2000 @@ -4,7 +4,7 @@ * AcpiRsAddress16Stream * AcpiRsAddress32Resource * AcpiRsAddress32Stream - * $Revision: 11 $ + * $Revision: 12 $ * ******************************************************************************/ @@ -120,6 +120,7 @@ #define __RSADDR_C__ #include "acpi.h" +#include "acresrc.h" #define _COMPONENT RESOURCE_MANAGER MODULE_NAME ("rsaddr") diff -ruN acpica-unix-20001020/Subsystem/Resources/rscalc.c acpica-unix-20001115/Subsystem/Resources/rscalc.c --- acpica-unix-20001020/Subsystem/Resources/rscalc.c Sat Oct 21 06:45:03 2000 +++ acpica-unix-20001115/Subsystem/Resources/rscalc.c Thu Nov 16 09:18:48 2000 @@ -2,7 +2,7 @@ * * Module Name: rscalc - AcpiRsCalculateByteStreamLength * AcpiRsCalculateListLength - * $Revision: 11 $ + * $Revision: 16 $ * ******************************************************************************/ @@ -118,6 +118,7 @@ #define __RSCALC_C__ #include "acpi.h" +#include "acresrc.h" #define _COMPONENT RESOURCE_MANAGER MODULE_NAME ("rscalc") @@ -884,7 +885,7 @@ UINT32 *BufferSizeNeeded) { UINT32 NumberOfElements; - UINT32 TempSizeNeeded; + UINT32 TempSizeNeeded = 0; ACPI_OPERAND_OBJECT **TopObjectList; UINT32 Index; ACPI_OPERAND_OBJECT *PackageElement; @@ -908,8 +909,6 @@ * NOTE: The NumberOfElements is incremented by one to add an end * table structure that is essentially a structure of zeros. */ - TempSizeNeeded = (NumberOfElements + 1) * - (sizeof (PCI_ROUTING_TABLE) - 1); /* * But each PRT_ENTRY structure has a pointer to a string and @@ -951,6 +950,8 @@ } } + TempSizeNeeded += (sizeof (PCI_ROUTING_TABLE) - 1); + /* * Was a String type found? */ @@ -972,15 +973,19 @@ TempSizeNeeded += sizeof(UINT32); } + + /* Round up the size since each element must be aligned */ + + TempSizeNeeded = ROUND_UP_TO_64BITS (TempSizeNeeded); + /* * Point to the next ACPI_OPERAND_OBJECT */ TopObjectList++; } - /* Align the count before returning it */ - *BufferSizeNeeded = ROUND_UP_TO_32BITS (TempSizeNeeded); + *BufferSizeNeeded = TempSizeNeeded + sizeof (PCI_ROUTING_TABLE); return_ACPI_STATUS (AE_OK); -} +} diff -ruN acpica-unix-20001020/Subsystem/Resources/rscreate.c acpica-unix-20001115/Subsystem/Resources/rscreate.c --- acpica-unix-20001020/Subsystem/Resources/rscreate.c Sat Oct 21 06:45:03 2000 +++ acpica-unix-20001115/Subsystem/Resources/rscreate.c Thu Nov 16 09:18:48 2000 @@ -3,7 +3,7 @@ * Module Name: rscreate - AcpiRsCreateResourceList * AcpiRsCreatePciRoutingTable * AcpiRsCreateByteStream - * $Revision: 19 $ + * $Revision: 21 $ * ******************************************************************************/ @@ -303,6 +303,9 @@ NumberOfElements = PackageObject->Package.Count; UserPrt = (PCI_ROUTING_TABLE *) Buffer; + + Buffer = ROUND_PTR_UP_TO_8 (Buffer, UINT8); + for (Index = 0; Index < NumberOfElements; Index++) { /* @@ -312,9 +315,9 @@ * be zero because we cleared the return buffer earlier */ Buffer += UserPrt->Length; - Buffer = ROUND_PTR_UP_TO_4 (Buffer, UINT8); UserPrt = (PCI_ROUTING_TABLE *) Buffer; + /* * Fill in the Length field with the information we * have at this point. @@ -405,7 +408,7 @@ /* Now align the current length */ - UserPrt->Length = ROUND_UP_TO_32BITS (UserPrt->Length); + UserPrt->Length = ROUND_UP_TO_64BITS (UserPrt->Length); /* * Dereference the Source Index diff -ruN acpica-unix-20001020/Subsystem/Resources/rsdump.c acpica-unix-20001115/Subsystem/Resources/rsdump.c --- acpica-unix-20001020/Subsystem/Resources/rsdump.c Sat Oct 21 06:45:03 2000 +++ acpica-unix-20001115/Subsystem/Resources/rsdump.c Thu Nov 16 09:18:48 2000 @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: rsdump - Functions do dump out the resource structures. - * $Revision: 11 $ + * $Revision: 12 $ * ******************************************************************************/ @@ -118,6 +118,7 @@ #define __RSDUMP_C__ #include "acpi.h" +#include "acresrc.h" #define _COMPONENT RESOURCE_MANAGER MODULE_NAME ("rsdump") diff -ruN acpica-unix-20001020/Subsystem/Resources/rsio.c acpica-unix-20001115/Subsystem/Resources/rsio.c --- acpica-unix-20001020/Subsystem/Resources/rsio.c Sat Oct 21 06:45:03 2000 +++ acpica-unix-20001115/Subsystem/Resources/rsio.c Thu Nov 16 09:18:48 2000 @@ -6,7 +6,7 @@ * AcpiRsFixedIoStream * AcpiRsDmaResource * AcpiRsDmaStream - * $Revision: 9 $ + * $Revision: 10 $ * ******************************************************************************/ @@ -122,6 +122,7 @@ #define __RSIO_C__ #include "acpi.h" +#include "acresrc.h" #define _COMPONENT RESOURCE_MANAGER MODULE_NAME ("rsio") diff -ruN acpica-unix-20001020/Subsystem/Resources/rsirq.c acpica-unix-20001115/Subsystem/Resources/rsirq.c --- acpica-unix-20001020/Subsystem/Resources/rsirq.c Sat Oct 21 06:45:03 2000 +++ acpica-unix-20001115/Subsystem/Resources/rsirq.c Thu Nov 16 09:18:48 2000 @@ -4,7 +4,7 @@ * AcpiRsIrqStream * AcpiRsExtendedIrqResource * AcpiRsExtendedIrqStream - * $Revision: 10 $ + * $Revision: 11 $ * ******************************************************************************/ @@ -120,6 +120,7 @@ #define __RSIRQ_C__ #include "acpi.h" +#include "acresrc.h" #define _COMPONENT RESOURCE_MANAGER MODULE_NAME ("rsirq") diff -ruN acpica-unix-20001020/Subsystem/Resources/rsmemory.c acpica-unix-20001115/Subsystem/Resources/rsmemory.c --- acpica-unix-20001020/Subsystem/Resources/rsmemory.c Sat Oct 21 06:45:04 2000 +++ acpica-unix-20001115/Subsystem/Resources/rsmemory.c Thu Nov 16 09:18:49 2000 @@ -6,7 +6,7 @@ * AcpiRsFixedMemory32Resource * AcpiRsMemory32RangeStream * AcpiRsFixedMemory32Stream - * $Revision: 9 $ + * $Revision: 10 $ * ******************************************************************************/ @@ -122,6 +122,7 @@ #define __RSMEMORY_C__ #include "acpi.h" +#include "acresrc.h" #define _COMPONENT RESOURCE_MANAGER MODULE_NAME ("rsmemory") diff -ruN acpica-unix-20001020/Subsystem/Resources/rsmisc.c acpica-unix-20001115/Subsystem/Resources/rsmisc.c --- acpica-unix-20001020/Subsystem/Resources/rsmisc.c Sat Oct 21 06:45:04 2000 +++ acpica-unix-20001115/Subsystem/Resources/rsmisc.c Thu Nov 16 09:18:49 2000 @@ -8,7 +8,7 @@ * AcpiRsEndDependentFunctionsResource * AcpiRsStartDependentFunctionsStream * AcpiRsEndDependentFunctionsStream - * $Revision: 9 $ + * $Revision: 10 $ * ******************************************************************************/ @@ -124,6 +124,7 @@ #define __RSMISC_C__ #include "acpi.h" +#include "acresrc.h" #define _COMPONENT RESOURCE_MANAGER MODULE_NAME ("rsmisc") diff -ruN acpica-unix-20001020/Subsystem/Tables/tbconvrt.c acpica-unix-20001115/Subsystem/Tables/tbconvrt.c --- acpica-unix-20001020/Subsystem/Tables/tbconvrt.c Thu Jan 1 09:00:00 1970 +++ acpica-unix-20001115/Subsystem/Tables/tbconvrt.c Thu Nov 16 09:18:49 2000 @@ -0,0 +1,671 @@ +/****************************************************************************** + * + * Module Name: tbconvrt - ACPI Table conversion utilities + * $Revision: 14 $ + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999, Intel Corp. All rights + * reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#define __TBCONVRT_C__ + +#include "acpi.h" +#include "achware.h" +#include "actables.h" +#include "actbl.h" + + +#define _COMPONENT TABLE_MANAGER + MODULE_NAME ("tbconvrt") + + +/* + * Build a GAS structure from earlier ACPI table entries (V1.0 and 0.71 extensions) + * + * 1) Address space + * 2) Length in bytes -- convert to length in bits + * 3) Bit offset is zero + * 4) Reserved field is zero + * 5) Expand address to 64 bits + */ +#define ASL_BUILD_GAS_FROM_ENTRY(a,b,c,d) {a.AddressSpaceId = (UINT8) d;\ + a.RegisterBitWidth = (UINT8) MUL_8 (b);\ + a.RegisterBitOffset = 0;\ + a.Reserved = 0;\ + a.Address = (UINT64) c;} + + +/* ACPI V1.0 entries -- address space is always I/O */ + +#define ASL_BUILD_GAS_FROM_V1_ENTRY(a,b,c) ASL_BUILD_GAS_FROM_ENTRY(a,b,c,ADDRESS_SPACE_SYSTEM_IO) + + + +/******************************************************************************* + * + * FUNCTION: AcpiTbConvertToXsdt + * + * PARAMETERS: + * + * RETURN: + * + * DESCRIPTION: + * + ******************************************************************************/ + +ACPI_STATUS +AcpiTbConvertToXsdt ( + ACPI_TABLE_DESC *TableInfo, + UINT32 *NumberOfTables) +{ + UINT32 TableSize; + UINT32 PointerSize; + UINT32 i; + XSDT_DESCRIPTOR *NewTable; + + +#ifndef _IA64 + + if (AcpiGbl_RSDP->Revision < 2) + { + PointerSize = sizeof (UINT32); + } + + else +#endif + { + PointerSize = sizeof (UINT64); + } + + /* + * Determine the number of tables pointed to by the RSDT/XSDT. + * This is defined by the ACPI Specification to be the number of + * pointers contained within the RSDT/XSDT. The size of the pointers + * is architecture-dependent. + */ + + TableSize = TableInfo->Pointer->Length; + *NumberOfTables = (TableSize - + sizeof (ACPI_TABLE_HEADER)) / PointerSize; + + /* Compute size of the converted XSDT */ + + TableSize = (*NumberOfTables * sizeof (UINT64)) + sizeof (ACPI_TABLE_HEADER); + + + /* Allocate an XSDT */ + + NewTable = AcpiCmCallocate (TableSize); + if (!NewTable) + { + return (AE_NO_MEMORY); + } + + /* Copy the header and set the length */ + + MEMCPY (NewTable, TableInfo->Pointer, sizeof (ACPI_TABLE_HEADER)); + NewTable->Header.Length = TableSize; + + /* Copy the table pointers */ + + for (i = 0; i < *NumberOfTables; i++) + { + if (AcpiGbl_RSDP->Revision < 2) + { +#ifdef _IA64 + NewTable->TableOffsetEntry[i] = + ((RSDT_DESCRIPTOR_REV071 *) TableInfo->Pointer)->TableOffsetEntry[i]; +#else + NewTable->TableOffsetEntry[i] = + ((RSDT_DESCRIPTOR_REV1 *) TableInfo->Pointer)->TableOffsetEntry[i]; +#endif + } + else + { + NewTable->TableOffsetEntry[i] = + ((XSDT_DESCRIPTOR *) TableInfo->Pointer)->TableOffsetEntry[i]; + } + } + + + /* Delete the original table (either mapped or in a buffer) */ + + AcpiTbDeleteSingleTable (TableInfo); + + + /* Point the table descriptor to the new table */ + + TableInfo->Pointer = (ACPI_TABLE_HEADER *) NewTable; + TableInfo->BasePointer = (ACPI_TABLE_HEADER *) NewTable; + TableInfo->Length = TableSize; + TableInfo->Allocation = ACPI_MEM_ALLOCATED; + + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbConvertTableFadt + * + * PARAMETERS: + * + * RETURN: + * + * DESCRIPTION: + * Converts BIOS supplied 1.0 and 0.71 ACPI FADT to an intermediate + * ACPI 2.0 FADT. If the BIOS supplied a 2.0 FADT then it is simply + * copied to the intermediate FADT. The ACPI CA software uses this + * intermediate FADT. Thus a significant amount of special #ifdef + * type codeing is saved. This intermediate FADT will need to be + * freed at some point. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiTbConvertTableFadt (void) +{ + +#ifdef _IA64 + FADT_DESCRIPTOR_REV071 *FADT71; + UINT8 Pm1AddressSpace; + UINT8 Pm2AddressSpace; + UINT8 PmTimerAddressSpace; + UINT8 Gpe0AddressSpace; + UINT8 Gpe1AddressSpace; +#else + FADT_DESCRIPTOR_REV1 *FADT1; +#endif + + FADT_DESCRIPTOR_REV2 *FADT2; + ACPI_TABLE_DESC *TableDesc; + + + FUNCTION_TRACE ("AcpiTbConvertTableFadt"); + + + /* AcpiGbl_FADT is valid */ + /* Allocate and zero the 2.0 buffer */ + + FADT2 = AcpiCmCallocate (sizeof (FADT_DESCRIPTOR_REV2)); + if (FADT2 == NULL) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + + /* The ACPI FADT revision number is FADT2_REVISION_ID=3 */ + /* So, if the current table revision is less than 3 it is type 1.0 or 0.71 */ + + if (AcpiGbl_FADT->header.Revision >= FADT2_REVISION_ID) + { + /* We have an ACPI 2.0 FADT but we must copy it to our local buffer */ + + *FADT2 = *((FADT_DESCRIPTOR_REV2*) AcpiGbl_FADT); + + } + + else + { + +#ifdef _IA64 + /* + * For the 64-bit case only, a revision ID less than V2.0 means the + * tables are the 0.71 extensions + */ + + /* The BIOS stored FADT should agree with Revision 0.71 */ + + FADT71 = (FADT_DESCRIPTOR_REV071 *) AcpiGbl_FADT; + + /* Copy the table header*/ + + FADT2->header = FADT71->header; + + /* Copy the common fields */ + + FADT2->SciInt = FADT71->SciInt; + FADT2->AcpiEnable = FADT71->AcpiEnable; + FADT2->AcpiDisable = FADT71->AcpiDisable; + FADT2->S4BiosReq = FADT71->S4BiosReq; + FADT2->Plvl2Lat = FADT71->Plvl2Lat; + FADT2->Plvl3Lat = FADT71->Plvl3Lat; + FADT2->DayAlrm = FADT71->DayAlrm; + FADT2->MonAlrm = FADT71->MonAlrm; + FADT2->Century = FADT71->Century; + FADT2->Gpe1Base = FADT71->Gpe1Base; + + /* + * We still use the block length registers even though + * the GAS structure should obsolete them. This is because + * these registers are byte lengths versus the GAS which + * contains a bit width + */ + FADT2->Pm1EvtLen = FADT71->Pm1EvtLen; + FADT2->Pm1CntLen = FADT71->Pm1CntLen; + FADT2->Pm2CntLen = FADT71->Pm2CntLen; + FADT2->PmTmLen = FADT71->PmTmLen; + FADT2->Gpe0BlkLen = FADT71->Gpe0BlkLen; + FADT2->Gpe1BlkLen = FADT71->Gpe1BlkLen; + FADT2->Gpe1Base = FADT71->Gpe1Base; + + /* Copy the existing 0.71 flags to 2.0. The other bits are zero.*/ + + FADT2->WbInvd = FADT71->FlushCash; + FADT2->ProcC1 = FADT71->ProcC1; + FADT2->Plvl2Up = FADT71->Plvl2Up; + FADT2->PwrButton = FADT71->PwrButton; + FADT2->SleepButton = FADT71->SleepButton; + FADT2->FixedRTC = FADT71->FixedRTC; + FADT2->Rtcs4 = FADT71->Rtcs4; + FADT2->TmrValExt = FADT71->TmrValExt; + FADT2->DockCap = FADT71->DockCap; + + + /* We should not use these next two addresses */ + /* Since our buffer is pre-zeroed nothing to do for */ + /* the next three data items in the structure */ + /* FADT2->FirmwareCtrl = 0; */ + /* FADT2->Dsdt = 0; */ + + /* System Interrupt Model isn't used in ACPI 2.0*/ + /* FADT2->Reserved1 = 0; */ + + /* This field is set by the OEM to convey the preferred */ + /* power management profile to OSPM. It doesn't have any*/ + /* 0.71 equivalence. Since we don't know what kind of */ + /* 64-bit system this is, we will pick unspecified. */ + + FADT2->Prefer_PM_Profile = PM_UNSPECIFIED; + + + /* Port address of SMI command port */ + /* We shouldn't use this port because IA64 doesn't */ + /* have or use SMI. It has PMI. */ + + FADT2->SmiCmd = (UINT32)(FADT71->SmiCmd & 0xFFFFFFFF); + + + /* processor performance state control*/ + /* The value OSPM writes to the SMI_CMD register to assume */ + /* processor performance state control responsibility. */ + /* There isn't any equivalence in 0.71 */ + /* Again this should be meaningless for IA64 */ + /* FADT2->PstateCnt = 0; */ + + /* The 32-bit Power management and GPE registers are */ + /* not valid in IA-64 and we are not going to use them */ + /* so leaving them pre-zeroed. */ + + /* Support for the _CST object and C States change notification.*/ + /* This data item hasn't any 0.71 equivalence so leaving it zero.*/ + /* FADT2->CstCnt = 0; */ + + /* number of flush strides that need to be read */ + /* No 0.71 equivalence. Leave pre-zeroed. */ + /* FADT2->FlushSize = 0; */ + + /* Processor's memory cache line width, in bytes */ + /* No 0.71 equivalence. Leave pre-zeroed. */ + /* FADT2->FlushStride = 0; */ + + /* Processor’s duty cycle index in processor's P_CNT reg*/ + /* No 0.71 equivalence. Leave pre-zeroed. */ + /* FADT2->DutyOffset = 0; */ + + /* Processor’s duty cycle value bit width in P_CNT register.*/ + /* No 0.71 equivalence. Leave pre-zeroed. */ + /* FADT2->DutyWidth = 0; */ + + + /* Since there isn't any equivalence in 0.71 */ + /* and since BigSur had to support legacy */ + + FADT2->IapcBootArch = BAF_LEGACY_DEVICES; + + /* Copy to ACPI 2.0 64-BIT Extended Addresses */ + + FADT2->XFirmwareCtrl = FADT71->FirmwareCtrl; + FADT2->XDsdt = FADT71->Dsdt; + + + /* Extract the address space IDs */ + + Pm1AddressSpace = (UINT8)((FADT71->AddressSpace & PM1_BLK_ADDRESS_SPACE) >> 1); + Pm2AddressSpace = (UINT8)((FADT71->AddressSpace & PM2_CNT_BLK_ADDRESS_SPACE) >> 2); + PmTimerAddressSpace = (UINT8)((FADT71->AddressSpace & PM_TMR_BLK_ADDRESS_SPACE) >> 3); + Gpe0AddressSpace = (UINT8)((FADT71->AddressSpace & GPE0_BLK_ADDRESS_SPACE) >> 4); + Gpe1AddressSpace = (UINT8)((FADT71->AddressSpace & GPE1_BLK_ADDRESS_SPACE) >> 5); + + /* + * Convert the 0.71 (non-GAS style) Block addresses to V2.0 GAS structures, + * in this order: + * + * PM 1A Events + * PM 1B Events + * PM 1A Control + * PM 1B Control + * PM 2 Control + * PM Timer Control + * GPE Block 0 + * GPE Block 1 + */ + + ASL_BUILD_GAS_FROM_ENTRY (FADT2->XPm1aEvtBlk, FADT71->Pm1EvtLen, FADT71->Pm1aEvtBlk, Pm1AddressSpace); + ASL_BUILD_GAS_FROM_ENTRY (FADT2->XPm1bEvtBlk, FADT71->Pm1EvtLen, FADT71->Pm1bEvtBlk, Pm1AddressSpace); + ASL_BUILD_GAS_FROM_ENTRY (FADT2->XPm1aCntBlk, FADT71->Pm1CntLen, FADT71->Pm1aCntBlk, Pm1AddressSpace); + ASL_BUILD_GAS_FROM_ENTRY (FADT2->XPm1bCntBlk, FADT71->Pm1CntLen, FADT71->Pm1bCntBlk, Pm1AddressSpace); + ASL_BUILD_GAS_FROM_ENTRY (FADT2->XPm2CntBlk, FADT71->Pm2CntLen, FADT71->Pm2CntBlk, Pm2AddressSpace); + ASL_BUILD_GAS_FROM_ENTRY (FADT2->XPmTmrBlk, FADT71->PmTmLen, FADT71->PmTmrBlk, PmTimerAddressSpace); + ASL_BUILD_GAS_FROM_ENTRY (FADT2->XGpe0Blk, FADT71->Gpe0BlkLen, FADT71->Gpe0Blk, Gpe0AddressSpace); + ASL_BUILD_GAS_FROM_ENTRY (FADT2->XGpe1Blk, FADT71->Gpe1BlkLen, FADT71->Gpe1Blk, Gpe1AddressSpace); + +#else + + /* ACPI 1.0 FACS */ + + + /* The BIOS stored FADT should agree with Revision 1.0 */ + + FADT1 = (FADT_DESCRIPTOR_REV1*) AcpiGbl_FADT; + + /* + * Copy the table header and the common part of the tables + * The 2.0 table is an extension of the 1.0 table, so the + * entire 1.0 table can be copied first, then expand some + * fields to 64 bits. + */ + + MEMCPY (FADT2, FADT1, sizeof (FADT_DESCRIPTOR_REV1)); + + + /* Convert table pointers to 64-bit fields */ + + FADT2->XFirmwareCtrl = (UINT64) FADT1->FirmwareCtrl; + FADT2->XDsdt = (UINT64) FADT1->Dsdt; + + /* System Interrupt Model isn't used in ACPI 2.0*/ + /* FADT2->Reserved1 = 0; */ + + /* This field is set by the OEM to convey the preferred */ + /* power management profile to OSPM. It doesn't have any*/ + /* 1.0 equivalence. Since we don't know what kind of */ + /* 32-bit system this is, we will pick unspecified. */ + + FADT2->Prefer_PM_Profile = PM_UNSPECIFIED; + + + /* Processor Performance State Control. This is the value */ + /* OSPM writes to the SMI_CMD register to assume processor */ + /* performance state control responsibility. There isn't */ + /* any equivalence in 1.0. So leave it zeroed. */ + + FADT2->PstateCnt = 0; + + + /* Support for the _CST object and C States change notification.*/ + /* This data item hasn't any 1.0 equivalence so leaving it zero.*/ + + FADT2->CstCnt = 0; + + + /* Since there isn't any equivalence in 1.0 and since it */ + /* is highly likely that a 1.0 system has legacy support. */ + + FADT2->IapcBootArch = BAF_LEGACY_DEVICES; + + + /* + * Convert the V1.0 Block addresses to V2.0 GAS structures + * in this order: + * + * PM 1A Events + * PM 1B Events + * PM 1A Control + * PM 1B Control + * PM 2 Control + * PM Timer Control + * GPE Block 0 + * GPE Block 1 + */ + + ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->XPm1aEvtBlk, FADT1->Pm1EvtLen, FADT1->Pm1aEvtBlk); + ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->XPm1bEvtBlk, FADT1->Pm1EvtLen, FADT1->Pm1bEvtBlk); + ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->XPm1aCntBlk, FADT1->Pm1CntLen, FADT1->Pm1aCntBlk); + ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->XPm1bCntBlk, FADT1->Pm1CntLen, FADT1->Pm1bCntBlk); + ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->XPm2CntBlk, FADT1->Pm2CntLen, FADT1->Pm2CntBlk); + ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->XPmTmrBlk, FADT1->PmTmLen, FADT1->PmTmrBlk); + ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->XGpe0Blk, FADT1->Gpe0BlkLen, FADT1->Gpe0Blk); + ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->XGpe1Blk, FADT1->Gpe1BlkLen, FADT1->Gpe1Blk); +#endif + } + + + /* + * Global FADT pointer will point to the common V2.0 FADT + */ + AcpiGbl_FADT = FADT2; + + + /* Free the original table */ + + TableDesc = &AcpiGbl_AcpiTables[ACPI_TABLE_FADT]; + AcpiTbDeleteSingleTable (TableDesc); + + + /* Install the new table */ + + TableDesc->Pointer = (ACPI_TABLE_HEADER *) AcpiGbl_FADT; + TableDesc->BasePointer = AcpiGbl_FADT; + TableDesc->Allocation = ACPI_MEM_ALLOCATED; + TableDesc->Length = sizeof (FADT_DESCRIPTOR_REV2); + + + /* Dump the FADT Header */ + + DEBUG_PRINT (TRACE_TABLES, ("Hex dump of FADT Header:\n")); + DUMP_BUFFER ((UINT8 *) AcpiGbl_FADT, sizeof (ACPI_TABLE_HEADER)); + + /* Dump the entire FADT */ + + DEBUG_PRINT (TRACE_TABLES, + ("Hex dump of FADT (After header), size %d (0x%x)\n", + AcpiGbl_FADT->header.Length, AcpiGbl_FADT->header.Length)); + DUMP_BUFFER ((UINT8 *) (&AcpiGbl_FADT->V1_FirmwareCtrl), AcpiGbl_FADT->header.Length); + + + return_ACPI_STATUS (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbConvertTableFacs + * + * PARAMETERS: + * + * RETURN: + * + * DESCRIPTION: + * + ******************************************************************************/ + +ACPI_STATUS +AcpiTbBuildCommonFacs ( + ACPI_TABLE_DESC *TableInfo) +{ + ACPI_COMMON_FACS *CommonFacs; + +#ifdef _IA64 + FACS_DESCRIPTOR_REV071 *FACS71; +#else + FACS_DESCRIPTOR_REV1 *FACS1; +#endif + + FACS_DESCRIPTOR_REV2 *FACS2; + + + FUNCTION_TRACE ("AcpiTbBuildCommonFacs"); + + + /* Allocate a common FACS */ + + CommonFacs = AcpiCmCallocate (sizeof (ACPI_COMMON_FACS)); + if (!CommonFacs) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + + /* Copy fields to the new FACS */ + + if (AcpiGbl_RSDP->Revision < 2) + { +#ifdef _IA64 + /* 0.71 FACS */ + + FACS71 = (FACS_DESCRIPTOR_REV071 *) AcpiGbl_FACS; + + CommonFacs->GlobalLock = (UINT32 *) &(FACS71->GlobalLock); + CommonFacs->FirmwareWakingVector = &FACS71->FirmwareWakingVector; + CommonFacs->VectorWidth = 64; +#else + /* ACPI 1.0 FACS */ + + FACS1 = (FACS_DESCRIPTOR_REV1 *) AcpiGbl_FACS; + + CommonFacs->GlobalLock = &(FACS1->GlobalLock); + CommonFacs->FirmwareWakingVector = (UINT64 *) &FACS1->FirmwareWakingVector; + CommonFacs->VectorWidth = 32; + +#endif + } + + else + { + /* ACPI 2.0 FACS */ + + FACS2 = (FACS_DESCRIPTOR_REV2 *) AcpiGbl_FACS; + + CommonFacs->GlobalLock = &(FACS2->GlobalLock); + CommonFacs->FirmwareWakingVector = &FACS2->XFirmwareWakingVector; + CommonFacs->VectorWidth = 64; + } + + + /* Set the global FACS pointer to point to the common FACS */ + + + AcpiGbl_FACS = CommonFacs; + + return_ACPI_STATUS (AE_OK); +} + + diff -ruN acpica-unix-20001020/Subsystem/Tables/tbget.c acpica-unix-20001115/Subsystem/Tables/tbget.c --- acpica-unix-20001020/Subsystem/Tables/tbget.c Sat Oct 21 06:45:04 2000 +++ acpica-unix-20001115/Subsystem/Tables/tbget.c Thu Nov 16 09:18:49 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: tbget - ACPI Table get* routines - * $Revision: 26 $ + * $Revision: 39 $ * *****************************************************************************/ @@ -124,6 +124,7 @@ #define _COMPONENT TABLE_MANAGER MODULE_NAME ("tbget") +#define RSDP_CHECKSUM_LENGTH 20 /******************************************************************************* * @@ -227,7 +228,7 @@ ACPI_STATUS AcpiTbGetTable ( - void *PhysicalAddress, + ACPI_PHYSICAL_ADDRESS PhysicalAddress, ACPI_TABLE_HEADER *BufferPtr, ACPI_TABLE_DESC *TableInfo) { @@ -353,9 +354,10 @@ MEMSET (&TableInfo, 0, sizeof (ACPI_TABLE_DESC)); - /* Get the table via the RSDT */ + /* Get the table via the XSDT */ - Status = AcpiTbGetTable ((void *) AcpiGbl_RSDT->TableOffsetEntry[Index], + Status = AcpiTbGetTable ((ACPI_PHYSICAL_ADDRESS) + AcpiGbl_XSDT->TableOffsetEntry[Index], TablePtr, &TableInfo); /* Ignore a table that failed verification */ @@ -388,23 +390,21 @@ } - /* Dump the FACP Header */ - - DEBUG_PRINT (TRACE_TABLES, ("Hex dump of FADT Header:\n")); - DUMP_BUFFER ((UINT8 *) AcpiGbl_FACP, sizeof (ACPI_TABLE_HEADER)); - - /* Dump the entire FACP */ - - DEBUG_PRINT (TRACE_TABLES, - ("Hex dump of FADT (After header), size %d (0x%x)\n", - AcpiGbl_FACP->header.Length, AcpiGbl_FACP->header.Length)); - DUMP_BUFFER ((UINT8 *) (&AcpiGbl_FACP->FirmwareCtrl), AcpiGbl_FACP->header.Length); + /* + * Convert the FADT to a common format. This allows earlier revisions of the + * table to coexist with newer versions, using common access code. + */ + Status = AcpiTbConvertTableFadt (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } /* * Get the minimum set of ACPI tables, namely: * - * 1) FACP (via RSDT in loop above) + * 1) FADT (via RSDT in loop above) * 2) FACS * 3) DSDT * @@ -412,8 +412,8 @@ /* - * Get the FACS (must have the FACP first, from loop above) - * AcpiTbGetTableFacs will fail if FACP pointer is not valid + * Get the FACS (must have the FADT first, from loop above) + * AcpiTbGetTableFacs will fail if FADT pointer is not valid */ Status = AcpiTbGetTableFacs (TablePtr, &TableInfo); @@ -422,6 +422,7 @@ return_ACPI_STATUS (Status); } + /* Install the FACS */ Status = AcpiTbInstallTable (TablePtr, &TableInfo); @@ -430,10 +431,23 @@ return_ACPI_STATUS (Status); } + /* + * Create the common FACS pointer table + * (Contains pointers to the original table) + */ + + Status = AcpiTbBuildCommonFacs (&TableInfo); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + - /* Get the DSDT (We know that the FACP if valid now) */ + /* + * Get the DSDT (We know that the FADT is valid now) + */ - Status = AcpiTbGetTable ((void *) AcpiGbl_FACP->Dsdt, TablePtr, &TableInfo); + Status = AcpiTbGetTable (AcpiGbl_FADT->XDsdt, TablePtr, &TableInfo); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -463,9 +477,13 @@ * Initialize the capabilities flags. * Assumes that platform supports ACPI_MODE since we have tables! */ - AcpiGbl_SystemFlags |= AcpiHwGetModeCapabilities (); + + /* Always delete the RSDP mapping, we are done with it */ + + AcpiTbDeleteAcpiTable (ACPI_TABLE_RSDP); + return_ACPI_STATUS (Status); } @@ -484,7 +502,7 @@ ACPI_STATUS AcpiTbVerifyRsdp ( - void *RsdpPhysicalAddress) + ACPI_PHYSICAL_ADDRESS RsdpPhysicalAddress) { ACPI_TABLE_DESC TableInfo; ACPI_STATUS Status; @@ -498,7 +516,7 @@ * Obtain access to the RSDP structure */ Status = AcpiOsMapMemory (RsdpPhysicalAddress, - sizeof (ROOT_SYSTEM_DESCRIPTOR_POINTER), + sizeof (RSDP_DESCRIPTOR), (void **) &TablePtr); if (ACPI_FAILURE (Status)) { @@ -516,7 +534,7 @@ goto Cleanup; } - if (AcpiTbChecksum (TablePtr, sizeof (ROOT_SYSTEM_DESCRIPTOR_POINTER)) != 0) + if (AcpiTbChecksum (TablePtr, RSDP_CHECKSUM_LENGTH) != 0) { /* Nope, BAD Checksum */ @@ -524,10 +542,12 @@ goto Cleanup; } + /* TBD: Check extended checksum if table version >= 2 */ + /* The RSDP supplied is OK */ TableInfo.Pointer = (ACPI_TABLE_HEADER *) TablePtr; - TableInfo.Length = sizeof (ROOT_SYSTEM_DESCRIPTOR_POINTER); + TableInfo.Length = sizeof (RSDP_DESCRIPTOR); TableInfo.Allocation = ACPI_MEM_MAPPED; TableInfo.BasePointer = TablePtr; @@ -542,14 +562,14 @@ /* Save the RSDP in a global for easy access */ - AcpiGbl_RSDP = (ROOT_SYSTEM_DESCRIPTOR_POINTER *) TableInfo.Pointer; + AcpiGbl_RSDP = (RSDP_DESCRIPTOR *) TableInfo.Pointer; return_ACPI_STATUS (Status); /* Error exit */ Cleanup: - AcpiOsUnmapMemory (TablePtr, sizeof (ROOT_SYSTEM_DESCRIPTOR_POINTER)); + AcpiOsUnmapMemory (TablePtr, sizeof (RSDP_DESCRIPTOR)); return_ACPI_STATUS (Status); } @@ -572,6 +592,9 @@ { ACPI_TABLE_DESC TableInfo; ACPI_STATUS Status = AE_OK; + ACPI_PHYSICAL_ADDRESS PhysicalAddress; + UINT32 SignatureLength; + char *TableSignature; FUNCTION_TRACE ("AcpiTbGetTableRsdt"); @@ -585,62 +608,84 @@ ("RSDP located at %p, RSDT physical=%p \n", AcpiGbl_RSDP, AcpiGbl_RSDP->RsdtPhysicalAddress)); - Status = AcpiTbGetTable ((void *) AcpiGbl_RSDP->RsdtPhysicalAddress, - NULL, &TableInfo); + /* + * For RSDP revision 0 or 1, we use the RSDT. + * For RSDP revision 2 (and above), we use the XSDT + */ + if (AcpiGbl_RSDP->Revision < 2) + { +#ifdef _IA64 + /* 0.71 RSDP has 64bit Rsdt address field */ + PhysicalAddress = ((RSDP_DESCRIPTOR_REV071 *)AcpiGbl_RSDP)->RsdtPhysicalAddress; +#else + PhysicalAddress = AcpiGbl_RSDP->RsdtPhysicalAddress; +#endif + TableSignature = RSDT_SIG; + SignatureLength = sizeof (RSDT_SIG) -1; + } + else + { + PhysicalAddress = (ACPI_PHYSICAL_ADDRESS) AcpiGbl_RSDP->XsdtPhysicalAddress; + TableSignature = XSDT_SIG; + SignatureLength = sizeof (XSDT_SIG) -1; + } + + + /* Get the RSDT/XSDT */ + + Status = AcpiTbGetTable (PhysicalAddress, NULL, &TableInfo); if (ACPI_FAILURE (Status)) { DEBUG_PRINT (ACPI_ERROR, ("GetTableRsdt: Could not get the RSDT, %s\n", AcpiCmFormatException (Status))); + return_ACPI_STATUS (Status); + } - if (Status == AE_BAD_SIGNATURE) - { - /* Invalid RSDT signature */ - REPORT_ERROR (("Invalid signature where RSDP indicates RSDT should be located\n")); + /* Check the RSDT or XSDT signature */ - DUMP_BUFFER (AcpiGbl_RSDP, 20); + if (STRNCMP ((char *) TableInfo.Pointer, TableSignature, + SignatureLength)) + { + /* Invalid RSDT or XSDT signature */ - DEBUG_PRINT_RAW (ACPI_ERROR, - ("RSDP points to RSDT at %lXh, but RSDT signature is invalid\n", - (void *) AcpiGbl_RSDP->RsdtPhysicalAddress)); - } + REPORT_ERROR (("Invalid signature where RSDP indicates %s should be located\n", + TableSignature)); + + DUMP_BUFFER (AcpiGbl_RSDP, 20); + + DEBUG_PRINT_RAW (ACPI_ERROR, + ("RSDP points to %X at %lXh, but signature is invalid\n", + TableSignature, (void *) AcpiGbl_RSDP->RsdtPhysicalAddress)); - REPORT_ERROR (("Unable to locate the RSDT\n")); return_ACPI_STATUS (Status); } - /* Always delete the RSDP mapping */ + /* Valid RSDT signature, verify the checksum */ + + Status = AcpiTbVerifyTableChecksum (TableInfo.Pointer); - AcpiTbDeleteAcpiTable (ACPI_TABLE_RSDP); - /* Save the table pointers and allocation info */ + /* Convert and/or copy to an XSDT structure */ - Status = AcpiTbInitTableDescriptor (ACPI_TABLE_RSDT, &TableInfo); + Status = AcpiTbConvertToXsdt (&TableInfo, NumberOfTables); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } - AcpiGbl_RSDT = (ROOT_SYSTEM_DESCRIPTION_TABLE *) TableInfo.Pointer; - - - /* Valid RSDT signature, verify the checksum */ - - DEBUG_PRINT (ACPI_INFO, ("RSDT located at %p\n", AcpiGbl_RSDT)); - - Status = AcpiTbVerifyTableChecksum ((ACPI_TABLE_HEADER *) AcpiGbl_RSDT); + /* Save the table pointers and allocation info */ - /* - * Determine the number of tables pointed to by the RSDT. - * This is defined by the ACPI Specification to be the number of - * pointers contained within the RSDT. The size of the pointers - * is architecture-dependent. - */ + Status = AcpiTbInitTableDescriptor (ACPI_TABLE_XSDT, &TableInfo); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } - *NumberOfTables = ((AcpiGbl_RSDT->header.Length - - sizeof (ACPI_TABLE_HEADER)) / sizeof (void *)); + AcpiGbl_XSDT = (XSDT_DESCRIPTOR *) TableInfo.Pointer; + DEBUG_PRINT (ACPI_INFO, ("XSDT located at %p\n", AcpiGbl_XSDT)); return_ACPI_STATUS (Status); } @@ -656,9 +701,9 @@ * * RETURN: Status * - * DESCRIPTION: Returns a pointer to the FACS as defined in FACP. This - * function assumes the global variable FACP has been - * correctly initialized. The value of FACP->FirmwareCtrl + * DESCRIPTION: Returns a pointer to the FACS as defined in FADT. This + * function assumes the global variable FADT has been + * correctly initialized. The value of FADT->FirmwareCtrl * into a far pointer which is returned. * *****************************************************************************/ @@ -677,14 +722,14 @@ FUNCTION_TRACE ("TbGetTableFacs"); - /* Must have a valid FACP pointer */ + /* Must have a valid FADT pointer */ - if (!AcpiGbl_FACP) + if (!AcpiGbl_FADT) { return_ACPI_STATUS (AE_NO_ACPI_TABLES); } - Size = sizeof (FIRMWARE_ACPI_CONTROL_STRUCTURE); + Size = sizeof (FACS_DESCRIPTOR); if (BufferPtr) { /* @@ -708,7 +753,7 @@ { /* Just map the physical memory to our address space */ - Status = AcpiTbMapAcpiTable ((void *) AcpiGbl_FACP->FirmwareCtrl, + Status = AcpiTbMapAcpiTable (AcpiGbl_FADT->XFirmwareCtrl, &Size, &TablePtr); if (ACPI_FAILURE(Status)) { diff -ruN acpica-unix-20001020/Subsystem/Tables/tbinstal.c acpica-unix-20001115/Subsystem/Tables/tbinstal.c --- acpica-unix-20001020/Subsystem/Tables/tbinstal.c Sat Oct 21 06:45:04 2000 +++ acpica-unix-20001115/Subsystem/Tables/tbinstal.c Thu Nov 16 09:18:49 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: tbinstal - ACPI table installation and removal - * $Revision: 32 $ + * $Revision: 33 $ * *****************************************************************************/ @@ -479,38 +479,24 @@ AcpiGbl_RSDP = NULL; break; - case ACPI_TABLE_APIC: - AcpiGbl_APIC = NULL; - break; - case ACPI_TABLE_DSDT: AcpiGbl_DSDT = NULL; break; - case ACPI_TABLE_FACP: - AcpiGbl_FACP = NULL; + case ACPI_TABLE_FADT: + AcpiGbl_FADT = NULL; break; case ACPI_TABLE_FACS: AcpiGbl_FACS = NULL; break; - case ACPI_TABLE_PSDT: - break; - - case ACPI_TABLE_RSDT: - AcpiGbl_RSDT = NULL; + case ACPI_TABLE_XSDT: + AcpiGbl_XSDT = NULL; break; case ACPI_TABLE_SSDT: - break; - - case ACPI_TABLE_SBST: - AcpiGbl_SBST = NULL; - - case ACPI_TABLE_SPIC: - break; - + case ACPI_TABLE_PSDT: default: break; } diff -ruN acpica-unix-20001020/Subsystem/Tables/tbutils.c acpica-unix-20001115/Subsystem/Tables/tbutils.c --- acpica-unix-20001020/Subsystem/Tables/tbutils.c Sat Oct 21 06:45:04 2000 +++ acpica-unix-20001115/Subsystem/Tables/tbutils.c Thu Nov 16 09:18:49 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: tbutils - Table manipulation utilities - * $Revision: 28 $ + * $Revision: 30 $ * *****************************************************************************/ @@ -337,7 +337,7 @@ ACPI_STATUS AcpiTbMapAcpiTable ( - void *PhysicalAddress, + ACPI_PHYSICAL_ADDRESS PhysicalAddress, UINT32 *Size, void **LogicalAddress) { diff -ruN acpica-unix-20001020/Subsystem/Tables/tbxface.c acpica-unix-20001115/Subsystem/Tables/tbxface.c --- acpica-unix-20001020/Subsystem/Tables/tbxface.c Sat Oct 21 06:45:04 2000 +++ acpica-unix-20001115/Subsystem/Tables/tbxface.c Thu Nov 16 09:18:49 2000 @@ -2,7 +2,7 @@ * * Module Name: tbxface - Public interfaces to the ACPI subsystem * ACPI table oriented interfaces - * $Revision: 28 $ + * $Revision: 32 $ * *****************************************************************************/ @@ -142,7 +142,7 @@ ACPI_STATUS AcpiLoadTables ( - void *RsdpPhysicalAddress) + ACPI_PHYSICAL_ADDRESS RsdpPhysicalAddress) { ACPI_STATUS Status = AE_OK; UINT32 NumberOfTables = 0; @@ -156,6 +156,8 @@ Status = AcpiTbVerifyRsdp (RsdpPhysicalAddress); if (ACPI_FAILURE (Status)) { + REPORT_ERROR (("AcpiLoadTables: RSDP Failed validation: %s\n", + AcpiCmFormatException (Status))); goto ErrorExit; } @@ -164,6 +166,8 @@ Status = AcpiTbGetTableRsdt (&NumberOfTables); if (ACPI_FAILURE (Status)) { + REPORT_ERROR (("AcpiLoadTables: Could not load RSDT: %s\n", + AcpiCmFormatException (Status))); goto ErrorExit; } @@ -172,6 +176,8 @@ Status = AcpiTbGetAllTables (NumberOfTables, NULL); if (ACPI_FAILURE (Status)) { + REPORT_ERROR (("AcpiLoadTables: Error getting required tables (DSDT/FADT/FACS): %s\n", + AcpiCmFormatException (Status))); goto ErrorExit; } @@ -183,6 +189,8 @@ Status = AcpiNsLoadNamespace (); if (ACPI_FAILURE (Status)) { + REPORT_ERROR (("AcpiLoadTables: Could not load namespace: %s\n", + AcpiCmFormatException (Status))); goto ErrorExit; } @@ -232,7 +240,7 @@ /* Copy the table to a local buffer */ - Status = AcpiTbGetTable (NULL, TablePtr, &TableInfo); + Status = AcpiTbGetTable (0, TablePtr, &TableInfo); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -481,7 +489,7 @@ /* * RSD PTR is the only "table" without a header */ - RetBufLen = sizeof (ROOT_SYSTEM_DESCRIPTOR_POINTER); + RetBufLen = sizeof (RSDP_DESCRIPTOR); } else { diff -ruN acpica-unix-20001020/Subsystem/Tables/tbxfroot.c acpica-unix-20001115/Subsystem/Tables/tbxfroot.c --- acpica-unix-20001020/Subsystem/Tables/tbxfroot.c Sat Oct 21 06:45:04 2000 +++ acpica-unix-20001115/Subsystem/Tables/tbxfroot.c Thu Nov 16 09:18:49 2000 @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: tbxfroot - Find the root ACPI table (RSDT) - * $Revision: 28 $ + * $Revision: 33 $ * *****************************************************************************/ @@ -124,6 +124,8 @@ #define _COMPONENT TABLE_MANAGER MODULE_NAME ("tbxfroot") +#define RSDP_CHECKSUM_LENGTH 20 + /******************************************************************************* * @@ -139,7 +141,7 @@ ACPI_STATUS AcpiFindRootPointer ( - void **RsdpPhysicalAddress) + ACPI_PHYSICAL_ADDRESS *RsdpPhysicalAddress) { ACPI_TABLE_DESC TableInfo; ACPI_STATUS Status; @@ -153,11 +155,11 @@ Status = AcpiTbFindRsdp (&TableInfo); if (ACPI_FAILURE (Status)) { - REPORT_WARNING (("RSDP structure not found\n")); + DEBUG_PRINT (ACPI_ERROR, ("RSDP structure not found\n")); return_ACPI_STATUS (AE_NO_ACPI_TABLES); } - *RsdpPhysicalAddress = TableInfo.Pointer; + *RsdpPhysicalAddress = TableInfo.PhysicalAddress; return_ACPI_STATUS (AE_OK); } @@ -197,9 +199,8 @@ /* The signature and checksum must both be correct */ if (STRNCMP ((NATIVE_CHAR *) MemRover, - RSDP_SIG, sizeof (RSDP_SIG)-1) == 0 && - AcpiTbChecksum (MemRover, - sizeof (ROOT_SYSTEM_DESCRIPTOR_POINTER)) == 0) + RSDP_SIG, sizeof (RSDP_SIG)-1) == 0 && + AcpiTbChecksum (MemRover, RSDP_CHECKSUM_LENGTH) == 0) { /* If so, we have found the RSDP */ @@ -238,7 +239,7 @@ { UINT8 *TablePtr; UINT8 *MemRover; - UINT8 *PhysAddr; + UINT64 PhysAddr; ACPI_STATUS Status = AE_OK; @@ -274,7 +275,7 @@ PhysAddr = LO_RSDP_WINDOW_BASE; PhysAddr += (MemRover - TablePtr); - TableInfo->Pointer = (ACPI_TABLE_HEADER *) PhysAddr; + TableInfo->PhysicalAddress = PhysAddr; return_ACPI_STATUS (AE_OK); } @@ -305,7 +306,7 @@ PhysAddr = HI_RSDP_WINDOW_BASE; PhysAddr += (MemRover - TablePtr); - TableInfo->Pointer = (ACPI_TABLE_HEADER *) PhysAddr; + TableInfo->PhysicalAddress = PhysAddr; return_ACPI_STATUS (AE_OK); }