diff --git a/src/add-ons/kernel/bus_managers/acpi/Jamfile b/src/add-ons/kernel/bus_managers/acpi/Jamfile index ec4f133ac7..002be3b746 100644 --- a/src/add-ons/kernel/bus_managers/acpi/Jamfile +++ b/src/add-ons/kernel/bus_managers/acpi/Jamfile @@ -187,9 +187,9 @@ SEARCH on [ FGristFiles $(namespace_src) ] = [ FDirName $(HAIKU_TOP) src add-on SEARCH on [ FGristFiles $(resources_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi resources ] ; SEARCH on [ FGristFiles $(tables_src) tbutils.c ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi tables ] ; SEARCH on [ FGristFiles $(utilities_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi utilities ] ; -SEARCH on [ FGristFiles $(dispatcher_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi interpreter dispatcher ] ; -SEARCH on [ FGristFiles $(executer_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi interpreter executer ] ; -SEARCH on [ FGristFiles $(parser_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi interpreter parser ] ; +SEARCH on [ FGristFiles $(dispatcher_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi dispatcher ] ; +SEARCH on [ FGristFiles $(executer_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi executer ] ; +SEARCH on [ FGristFiles $(parser_src) ] = [ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers acpi parser ] ; KernelAddon acpi : oshaiku.c diff --git a/src/add-ons/kernel/bus_managers/acpi/common/a16find.c b/src/add-ons/kernel/bus_managers/acpi/common/a16find.c index d90c5f21cc..07675a2677 100644 --- a/src/add-ons/kernel/bus_managers/acpi/common/a16find.c +++ b/src/add-ons/kernel/bus_managers/acpi/common/a16find.c @@ -201,7 +201,7 @@ AfWriteBuffer ( char * AfGenerateFilename (char *TableId) { - ACPI_NATIVE_UINT i; + UINT16 i; for (i = 0; i < 8 && TableId[i] != ' ' && TableId[i] != 0; i++) diff --git a/src/add-ons/kernel/bus_managers/acpi/common/adfile.c b/src/add-ons/kernel/bus_managers/acpi/common/adfile.c index 93c8d27f7e..b4879544cb 100644 --- a/src/add-ons/kernel/bus_managers/acpi/common/adfile.c +++ b/src/add-ons/kernel/bus_managers/acpi/common/adfile.c @@ -146,8 +146,8 @@ AdGenerateFilename ( char *Prefix, char *TableId) { - ACPI_NATIVE_UINT i; - ACPI_NATIVE_UINT j; + UINT32 i; + UINT32 j; for (i = 0; Prefix[i]; i++) @@ -183,7 +183,7 @@ AdGenerateFilename ( * ******************************************************************************/ -ACPI_NATIVE_INT +INT32 AdWriteBuffer ( char *Filename, char *Buffer, @@ -202,7 +202,7 @@ AdWriteBuffer ( Actual = fwrite (Buffer, (size_t) Length, 1, fp); fclose (fp); - return ((ACPI_NATIVE_INT) Actual); + return ((INT32) Actual); } diff --git a/src/add-ons/kernel/bus_managers/acpi/common/adisasm.c b/src/add-ons/kernel/bus_managers/acpi/common/adisasm.c index b78ef49f37..b3c2fabb55 100644 --- a/src/add-ons/kernel/bus_managers/acpi/common/adisasm.c +++ b/src/add-ons/kernel/bus_managers/acpi/common/adisasm.c @@ -179,7 +179,7 @@ AcpiDsMethodError ( ACPI_STATUS AcpiNsLoadTable ( - ACPI_NATIVE_UINT TableIndex, + UINT32 TableIndex, ACPI_NAMESPACE_NODE *Node) { return (AE_NOT_IMPLEMENTED); @@ -665,7 +665,30 @@ AdCreateTableHeader ( AcpiOsPrintf (" *\n * Original Table Header:\n"); AcpiOsPrintf (" * Signature \"%4.4s\"\n", Table->Signature); AcpiOsPrintf (" * Length 0x%8.8X (%u)\n", Table->Length, Table->Length); - AcpiOsPrintf (" * Revision 0x%2.2X\n", Table->Revision); + + /* Print and validate the revision */ + + AcpiOsPrintf (" * Revision 0x%2.2X", Table->Revision); + + switch (Table->Revision) + { + case 0: + AcpiOsPrintf (" **** Invalid Revision"); + break; + + case 1: + /* Revision of DSDT controls the ACPI integer width */ + + if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT)) + { + AcpiOsPrintf (" **** ACPI 1.0, no 64-bit math support"); + } + break; + + default: + break; + } + AcpiOsPrintf ("\n"); /* Print and validate the table checksum */ @@ -980,7 +1003,7 @@ AdGetLocalTables ( ACPI_TABLE_HEADER *NewTable; UINT32 NumTables; UINT32 PointerSize; - ACPI_NATIVE_UINT TableIndex; + UINT32 TableIndex; if (GetAllTables) @@ -1087,7 +1110,7 @@ AdParseTable ( ACPI_WALK_STATE *WalkState; UINT8 *AmlStart; UINT32 AmlLength; - ACPI_NATIVE_UINT TableIndex; + UINT32 TableIndex; if (!Table) @@ -1139,7 +1162,7 @@ AdParseTable ( if (LoadTable) { - Status = AcpiTbStoreTable ((ACPI_NATIVE_UINT) Table, Table, + Status = AcpiTbStoreTable ((ACPI_PHYSICAL_ADDRESS) Table, Table, Table->Length, ACPI_TABLE_ORIGIN_ALLOCATED, &TableIndex); if (ACPI_FAILURE (Status)) { diff --git a/src/add-ons/kernel/bus_managers/acpi/common/dmtable.c b/src/add-ons/kernel/bus_managers/acpi/common/dmtable.c index 4713efe418..92b5578c9d 100644 --- a/src/add-ons/kernel/bus_managers/acpi/common/dmtable.c +++ b/src/add-ons/kernel/bus_managers/acpi/common/dmtable.c @@ -151,6 +151,7 @@ static const char *AcpiDmDmarSubnames[] = { "Hardware Unit Definition", "Reserved Memory Region", + "Root Port ATS Capability", "Unknown SubTable Type" /* Reserved */ }; diff --git a/src/add-ons/kernel/bus_managers/acpi/common/dmtbdump.c b/src/add-ons/kernel/bus_managers/acpi/common/dmtbdump.c index 186c9543d9..98504886bb 100644 --- a/src/add-ons/kernel/bus_managers/acpi/common/dmtbdump.c +++ b/src/add-ons/kernel/bus_managers/acpi/common/dmtbdump.c @@ -295,10 +295,10 @@ AcpiDmDumpAsf ( ACPI_DMTABLE_INFO *InfoTable; ACPI_DMTABLE_INFO *DataInfoTable = NULL; UINT8 *DataTable = NULL; - ACPI_NATIVE_UINT DataCount = 0; - ACPI_NATIVE_UINT DataLength = 0; - ACPI_NATIVE_UINT DataOffset = 0; - ACPI_NATIVE_UINT i; + UINT32 DataCount = 0; + UINT32 DataLength = 0; + UINT32 DataOffset = 0; + UINT32 i; /* No main table, only sub-tables */ @@ -536,6 +536,10 @@ AcpiDmDumpDmar ( InfoTable = AcpiDmTableInfoDmar1; ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY); break; + case ACPI_DMAR_TYPE_ATSR: + InfoTable = AcpiDmTableInfoDmar2; + ScopeOffset = sizeof (ACPI_DMAR_TYPE_ATSR); + break; default: AcpiOsPrintf ("\n**** Unknown DMAR sub-table type %X\n\n", SubTable->Type); return; @@ -548,49 +552,42 @@ AcpiDmDumpDmar ( return; } - /* - * Currently, a common flag indicates whether there are any - * device scope entries present at the end of the subtable. - */ - if ((SubTable->Flags & ACPI_DMAR_INCLUDE_ALL) == 0) + /* Dump the device scope entries (if any) */ + + ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset); + while (ScopeOffset < SubTable->Length) { - /* Dump the device scope entries */ - - ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset); - while (ScopeOffset < SubTable->Length) + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable, + ScopeTable->Length, AcpiDmTableInfoDmarScope); + if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable, - ScopeTable->Length, AcpiDmTableInfoDmarScope); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Dump the PCI Path entries for this device scope */ - - PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */ - - PciPath = ACPI_ADD_PTR (UINT8, ScopeTable, - sizeof (ACPI_DMAR_DEVICE_SCOPE)); - - while (PathOffset < ScopeTable->Length) - { - AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, "PCI Path"); - AcpiOsPrintf ("[%2.2X, %2.2X]\n", PciPath[0], PciPath[1]); - - /* Point to next PCI Path entry */ - - PathOffset += 2; - PciPath += 2; - } - - /* Point to next device scope entry */ - - ScopeOffset += ScopeTable->Length; - ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, - ScopeTable, ScopeTable->Length); + return; } + + /* Dump the PCI Path entries for this device scope */ + + PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */ + + PciPath = ACPI_ADD_PTR (UINT8, ScopeTable, + sizeof (ACPI_DMAR_DEVICE_SCOPE)); + + while (PathOffset < ScopeTable->Length) + { + AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, "PCI Path"); + AcpiOsPrintf ("[%2.2X, %2.2X]\n", PciPath[0], PciPath[1]); + + /* Point to next PCI Path entry */ + + PathOffset += 2; + PciPath += 2; + } + + /* Point to next device scope entry */ + + ScopeOffset += ScopeTable->Length; + ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, + ScopeTable, ScopeTable->Length); } /* Point to next sub-table */ diff --git a/src/add-ons/kernel/bus_managers/acpi/common/dmtbinfo.c b/src/add-ons/kernel/bus_managers/acpi/common/dmtbinfo.c index bd1d4c8c91..5db076fde4 100644 --- a/src/add-ons/kernel/bus_managers/acpi/common/dmtbinfo.c +++ b/src/add-ons/kernel/bus_managers/acpi/common/dmtbinfo.c @@ -162,6 +162,7 @@ #define ACPI_DMARS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_DEVICE_SCOPE,f) #define ACPI_DMAR0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_HARDWARE_UNIT,f) #define ACPI_DMAR1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f) +#define ACPI_DMAR2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_ATSR,f) #define ACPI_EINJ0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,f) #define ACPI_HEST9_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_GENERIC,f) #define ACPI_HESTN_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_NOTIFY,f) @@ -576,6 +577,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDbgp[] = ACPI_DMTABLE_INFO AcpiDmTableInfoDmar[] = { {ACPI_DMT_UINT8, ACPI_DMAR_OFFSET (Width), "Host Address Width"}, + {ACPI_DMT_UINT8, ACPI_DMAR_OFFSET (Flags), "Flags"}, {ACPI_DMT_EXIT, 0, NULL} }; @@ -585,8 +587,6 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr[] = { {ACPI_DMT_DMAR, ACPI_DMAR0_OFFSET (Header.Type), "Subtable Type"}, {ACPI_DMT_UINT16, ACPI_DMAR0_OFFSET (Header.Length), "Length"}, - {ACPI_DMT_UINT8, ACPI_DMAR0_OFFSET (Header.Flags), "Flags"}, - {ACPI_DMT_UINT24, ACPI_DMAR0_OFFSET (Header.Reserved[0]), "Reserved"}, {ACPI_DMT_EXIT, 0, NULL} }; @@ -596,7 +596,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[] = { {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (EntryType), "Device Scope Entry Type"}, {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Length), "Entry Length"}, - {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Segment), "PCI Segment Number"}, + {ACPI_DMT_UINT16, ACPI_DMARS_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (EnumerationId), "Enumeration ID"}, {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Bus), "PCI Bus Number"}, {ACPI_DMT_EXIT, 0, NULL} }; @@ -607,19 +608,34 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[] = ACPI_DMTABLE_INFO AcpiDmTableInfoDmar0[] = { + {ACPI_DMT_UINT8, ACPI_DMAR0_OFFSET (Flags), "Flags"}, + {ACPI_DMT_UINT8, ACPI_DMAR0_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT16, ACPI_DMAR0_OFFSET (Segment), "PCI Segment Number"}, {ACPI_DMT_UINT64, ACPI_DMAR0_OFFSET (Address), "Register Base Address"}, {ACPI_DMT_EXIT, 0, NULL} }; -/* 1: Reserved Memory Defininition */ +/* 1: Reserved Memory Definition */ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar1[] = { - {ACPI_DMT_UINT64, ACPI_DMAR1_OFFSET (Address), "Base Address"}, + {ACPI_DMT_UINT16, ACPI_DMAR1_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT16, ACPI_DMAR1_OFFSET (Segment), "PCI Segment Number"}, + {ACPI_DMT_UINT64, ACPI_DMAR1_OFFSET (BaseAddress), "Base Address"}, {ACPI_DMT_UINT64, ACPI_DMAR1_OFFSET (EndAddress), "End Address (limit)"}, {ACPI_DMT_EXIT, 0, NULL} }; +/* 2: Root Port ATS Capability Definition */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[] = +{ + {ACPI_DMT_UINT8, ACPI_DMAR2_OFFSET (Flags), "Flags"}, + {ACPI_DMT_UINT8, ACPI_DMAR2_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT16, ACPI_DMAR2_OFFSET (Segment), "PCI Segment Number"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + /******************************************************************************* * @@ -1034,7 +1050,6 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[] = {ACPI_DMT_UINT16, ACPI_SRAT1_OFFSET (Reserved), "Reserved"}, {ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (BaseAddress), "Base Address"}, {ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (Length), "Address Length"}, - {ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (MemoryType), "Memory Type"}, {ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (Flags), "Flags (decoded below)"}, {ACPI_DMT_FLAG0, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Enabled"}, {ACPI_DMT_FLAG1, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Hot Pluggable"}, diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/Makefile b/src/add-ons/kernel/bus_managers/acpi/compiler/Makefile index cdeeddd0ca..85b52a83b3 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/Makefile +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/Makefile @@ -31,42 +31,42 @@ SRCS= aslcompilerparse.c aslcompilerlex.c aslanalyze.c aslcodegen.c \ ../namespace/nsutils.c \ ../namespace/nswalk.c \ ../namespace/nsxfobj.c \ - ../interpreter/parser/psargs.c \ - ../interpreter/parser/psloop.c \ - ../interpreter/parser/psopcode.c \ - ../interpreter/parser/psparse.c \ - ../interpreter/parser/psscope.c \ - ../interpreter/parser/pstree.c \ - ../interpreter/parser/psutils.c \ - ../interpreter/parser/pswalk.c \ - ../interpreter/dispatcher/dswscope.c \ - ../interpreter/dispatcher/dswstate.c \ - ../interpreter/dispatcher/dsfield.c \ - ../interpreter/dispatcher/dsobject.c \ - ../interpreter/dispatcher/dsopcode.c \ - ../interpreter/dispatcher/dsutils.c \ - ../interpreter/dispatcher/dswexec.c \ - ../interpreter/dispatcher/dswload.c \ - ../interpreter/executer/exconvrt.c \ - ../interpreter/executer/excreate.c \ - ../interpreter/executer/exdump.c \ - ../interpreter/executer/exmisc.c \ - ../interpreter/executer/exmutex.c \ - ../interpreter/executer/exnames.c \ - ../interpreter/executer/exoparg1.c \ - ../interpreter/executer/exoparg2.c \ - ../interpreter/executer/exoparg3.c \ - ../interpreter/executer/exoparg6.c \ - ../interpreter/executer/exprep.c \ - ../interpreter/executer/exregion.c \ - ../interpreter/executer/exresnte.c \ - ../interpreter/executer/exresolv.c \ - ../interpreter/executer/exresop.c \ - ../interpreter/executer/exstore.c \ - ../interpreter/executer/exstoren.c \ - ../interpreter/executer/exstorob.c \ - ../interpreter/executer/exsystem.c \ - ../interpreter/executer/exutils.c \ + ../parser/psargs.c \ + ../parser/psloop.c \ + ../parser/psopcode.c \ + ../parser/psparse.c \ + ../parser/psscope.c \ + ../parser/pstree.c \ + ../parser/psutils.c \ + ../parser/pswalk.c \ + ../dispatcher/dswscope.c \ + ../dispatcher/dswstate.c \ + ../dispatcher/dsfield.c \ + ../dispatcher/dsobject.c \ + ../dispatcher/dsopcode.c \ + ../dispatcher/dsutils.c \ + ../dispatcher/dswexec.c \ + ../dispatcher/dswload.c \ + ../executer/exconvrt.c \ + ../executer/excreate.c \ + ../executer/exdump.c \ + ../executer/exmisc.c \ + ../executer/exmutex.c \ + ../executer/exnames.c \ + ../executer/exoparg1.c \ + ../executer/exoparg2.c \ + ../executer/exoparg3.c \ + ../executer/exoparg6.c \ + ../executer/exprep.c \ + ../executer/exregion.c \ + ../executer/exresnte.c \ + ../executer/exresolv.c \ + ../executer/exresop.c \ + ../executer/exstore.c \ + ../executer/exstoren.c \ + ../executer/exstorob.c \ + ../executer/exsystem.c \ + ../executer/exutils.c \ ../common/adfile.c \ ../common/adisasm.c \ ../common/adwalk.c \ diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslmain.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslmain.c index ecff54aea3..780f7d56de 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslmain.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslmain.c @@ -328,7 +328,7 @@ AslCommandLine ( char **argv) { BOOLEAN BadCommandLine = FALSE; - ACPI_NATIVE_INT j; + int j; /* Minimum command line contains at least one option or an input file */ diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslopcodes.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslopcodes.c index 4caaa560ba..4da2d95769 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslopcodes.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslopcodes.c @@ -546,7 +546,7 @@ OpcDoEisaId ( UINT32 BigEndianId; char *InString; ACPI_STATUS Status = AE_OK; - ACPI_NATIVE_UINT i; + UINT32 i; InString = (char *) Op->Asl.Value.String; @@ -642,7 +642,7 @@ OpcDoUuId ( char *InString; char *Buffer; ACPI_STATUS Status = AE_OK; - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_PARSE_OBJECT *NewOp; diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/asloperands.c b/src/add-ons/kernel/bus_managers/acpi/compiler/asloperands.c index e1a7cc9312..7dc2e3ed6c 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/asloperands.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/asloperands.c @@ -948,7 +948,7 @@ OpnDoDefinitionBlock ( { ACPI_PARSE_OBJECT *Child; ACPI_SIZE Length; - ACPI_NATIVE_UINT i; + UINT32 i; char *Filename; diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslopt.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslopt.c index d2ffb54f38..c54143ec92 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslopt.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslopt.c @@ -288,9 +288,9 @@ OptBuildShortestPath ( { UINT32 NumCommonSegments; UINT32 MaxCommonSegments; - ACPI_NATIVE_UINT Index; + UINT32 Index; UINT32 NumCarats; - ACPI_NATIVE_UINT i; + UINT32 i; char *NewPath; char *NewPathExternal; ACPI_NAMESPACE_NODE *Node; diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslstubs.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslstubs.c index b01bc5f2ce..cc7ca7bd3d 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslstubs.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslstubs.c @@ -275,7 +275,7 @@ AcpiTbFindTable ( char *Signature, char *OemId, char *OemTableId, - ACPI_NATIVE_UINT *TableIndex) + UINT32 *TableIndex) { return (AE_SUPPORT); } diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslutils.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslutils.c index e203da49bf..5437d92f6d 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslutils.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslutils.c @@ -536,7 +536,7 @@ UtDisplaySummary ( if ((Gbl_ExceptionCount[ASL_ERROR] == 0) || (Gbl_IgnoreErrors)) { FlPrintFile (FileId, - "AML Output: %s - %d bytes %d named objects %d executable opcodes\n\n", + "AML Output: %s - %d bytes, %d named objects, %d executable opcodes\n\n", Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength, TotalNamedObjects, TotalExecutableOpcodes); } diff --git a/src/add-ons/kernel/bus_managers/acpi/debugger/dbcmds.c b/src/add-ons/kernel/bus_managers/acpi/debugger/dbcmds.c index 1f06141a9d..a79a582a81 100644 --- a/src/add-ons/kernel/bus_managers/acpi/debugger/dbcmds.c +++ b/src/add-ons/kernel/bus_managers/acpi/debugger/dbcmds.c @@ -433,7 +433,7 @@ void AcpiDbDisplayTableInfo ( char *TableArg) { - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_TABLE_DESC *TableDesc; diff --git a/src/add-ons/kernel/bus_managers/acpi/debugger/dbdisply.c b/src/add-ons/kernel/bus_managers/acpi/debugger/dbdisply.c index 70f16643df..abc437d90e 100644 --- a/src/add-ons/kernel/bus_managers/acpi/debugger/dbdisply.c +++ b/src/add-ons/kernel/bus_managers/acpi/debugger/dbdisply.c @@ -685,7 +685,7 @@ AcpiDbDisplayObjectType ( ACPI_BUFFER Buffer; ACPI_DEVICE_INFO *Info; ACPI_STATUS Status; - ACPI_NATIVE_UINT i; + UINT32 i; Handle = ACPI_TO_POINTER (ACPI_STRTOUL (ObjectArg, NULL, 16)); @@ -707,7 +707,7 @@ AcpiDbDisplayObjectType ( { for (i = 0; i < Info->CompatibilityId.Count; i++) { - AcpiOsPrintf ("CID #%d: %s\n", (UINT32) i, + AcpiOsPrintf ("CID #%d: %s\n", i, Info->CompatibilityId.Id[i].Value); } } diff --git a/src/add-ons/kernel/bus_managers/acpi/debugger/dbexec.c b/src/add-ons/kernel/bus_managers/acpi/debugger/dbexec.c index b16db212ae..a6498a7939 100644 --- a/src/add-ons/kernel/bus_managers/acpi/debugger/dbexec.c +++ b/src/add-ons/kernel/bus_managers/acpi/debugger/dbexec.c @@ -512,12 +512,12 @@ AcpiDbMethodThread ( if (Info->InitArgs) { AcpiDbUInt32ToHexString (Info->NumCreated, Info->IndexOfThreadStr); - AcpiDbUInt32ToHexString (AcpiOsGetThreadId (), Info->IdOfThreadStr); + AcpiDbUInt32ToHexString ((UINT32) AcpiOsGetThreadId (), Info->IdOfThreadStr); } if (Info->Threads && (Info->NumCreated < Info->NumThreads)) { - Info->Threads[Info->NumCreated++] = AcpiOsGetThreadId(); + Info->Threads[Info->NumCreated++] = (UINT32) AcpiOsGetThreadId(); } for (i = 0; i < Info->NumLoops; i++) diff --git a/src/add-ons/kernel/bus_managers/acpi/debugger/dbfileio.c b/src/add-ons/kernel/bus_managers/acpi/debugger/dbfileio.c index 5d4bd9082f..9288ea5d32 100644 --- a/src/add-ons/kernel/bus_managers/acpi/debugger/dbfileio.c +++ b/src/add-ons/kernel/bus_managers/acpi/debugger/dbfileio.c @@ -118,7 +118,10 @@ #include "acpi.h" #include "acdebug.h" + +#ifdef ACPI_APPLICATION #include "actables.h" +#endif #if (defined ACPI_DEBUGGER || defined ACPI_DISASSEMBLER) diff --git a/src/add-ons/kernel/bus_managers/acpi/debugger/dbhistry.c b/src/add-ons/kernel/bus_managers/acpi/debugger/dbhistry.c index 160f6eccbd..5b64315d83 100644 --- a/src/add-ons/kernel/bus_managers/acpi/debugger/dbhistry.c +++ b/src/add-ons/kernel/bus_managers/acpi/debugger/dbhistry.c @@ -210,7 +210,7 @@ void AcpiDbDisplayHistory ( void) { - ACPI_NATIVE_UINT i; + UINT32 i; UINT16 HistoryIndex; @@ -249,7 +249,7 @@ char * AcpiDbGetFromHistory ( char *CommandNumArg) { - ACPI_NATIVE_UINT i; + UINT32 i; UINT16 HistoryIndex; UINT32 CmdNum; diff --git a/src/add-ons/kernel/bus_managers/acpi/debugger/dbutils.c b/src/add-ons/kernel/bus_managers/acpi/debugger/dbutils.c index 5e69a833d5..d867904b1f 100644 --- a/src/add-ons/kernel/bus_managers/acpi/debugger/dbutils.c +++ b/src/add-ons/kernel/bus_managers/acpi/debugger/dbutils.c @@ -299,7 +299,7 @@ AcpiDbDumpExternalObject ( case ACPI_TYPE_LOCAL_REFERENCE: - AcpiOsPrintf ("[Object Reference] = ", ObjDesc->Reference.Handle); + AcpiOsPrintf ("[Object Reference] = "); AcpiDmDisplayInternalObject (ObjDesc->Reference.Handle, NULL); break; diff --git a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmbuffer.c b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmbuffer.c index b8614d3502..3f4cb50eac 100644 --- a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmbuffer.c +++ b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmbuffer.c @@ -282,7 +282,7 @@ AcpiDmIsUnicodeBuffer ( UINT32 WordCount; ACPI_PARSE_OBJECT *SizeOp; ACPI_PARSE_OBJECT *NextOp; - ACPI_NATIVE_UINT i; + UINT32 i; /* Buffer size is the buffer argument */ @@ -320,7 +320,7 @@ AcpiDmIsUnicodeBuffer ( for (i = 0; i < (ByteCount - 2); i += 2) { if ((!ACPI_IS_PRINT (ByteData[i])) || - (ByteData[i + 1] != 0)) + (ByteData[(ACPI_SIZE) i + 1] != 0)) { return (FALSE); } @@ -441,54 +441,37 @@ AcpiDmUnicode ( /******************************************************************************* * - * FUNCTION: AcpiDmIsEisaId + * FUNCTION: AcpiDmIsEisaIdElement * * PARAMETERS: Op - Op to be examined * * RETURN: None * - * DESCRIPTION: Determine if an Op can be converted to an EisaId. + * DESCRIPTION: Determine if an Op (argument to _HID or _CID) can be converted + * to an EISA ID. * ******************************************************************************/ void -AcpiDmIsEisaId ( +AcpiDmIsEisaIdElement ( ACPI_PARSE_OBJECT *Op) { - UINT32 Name; UINT32 BigEndianId; - ACPI_PARSE_OBJECT *NextOp; - ACPI_NATIVE_UINT i; UINT32 Prefix[3]; + UINT32 i; - /* Get the NameSegment */ - - Name = AcpiPsGetName (Op); - if (!Name) - { - return; - } - - /* We are looking for _HID */ - - if (!ACPI_COMPARE_NAME (&Name, METHOD_NAME__HID)) - { - return; - } - /* The parameter must be either a word or a dword */ - NextOp = AcpiPsGetDepthNext (NULL, Op); - if ((NextOp->Common.AmlOpcode != AML_DWORD_OP) && - (NextOp->Common.AmlOpcode != AML_WORD_OP)) + if ((Op->Common.AmlOpcode != AML_DWORD_OP) && + (Op->Common.AmlOpcode != AML_WORD_OP)) { return; } /* Swap from little-endian to big-endian to simplify conversion */ - BigEndianId = AcpiUtDwordByteSwap ((UINT32) NextOp->Common.Value.Integer); + BigEndianId = AcpiUtDwordByteSwap ((UINT32) Op->Common.Value.Integer); /* Create the 3 leading ASCII letters */ @@ -509,7 +492,79 @@ AcpiDmIsEisaId ( /* OK - mark this node as convertable to an EISA ID */ - NextOp->Common.DisasmOpcode = ACPI_DASM_EISAID; + Op->Common.DisasmOpcode = ACPI_DASM_EISAID; +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmIsEisaId + * + * PARAMETERS: Op - Op to be examined + * + * RETURN: None + * + * DESCRIPTION: Determine if a Name() Op can be converted to an EisaId. + * + ******************************************************************************/ + +void +AcpiDmIsEisaId ( + ACPI_PARSE_OBJECT *Op) +{ + UINT32 Name; + ACPI_PARSE_OBJECT *NextOp; + + + /* Get the NameSegment */ + + Name = AcpiPsGetName (Op); + if (!Name) + { + return; + } + + NextOp = AcpiPsGetDepthNext (NULL, Op); + if (!NextOp) + { + return; + } + + /* Check for _HID - has one argument */ + + if (ACPI_COMPARE_NAME (&Name, METHOD_NAME__HID)) + { + AcpiDmIsEisaIdElement (NextOp); + return; + } + + /* Exit if not _CID */ + + if (!ACPI_COMPARE_NAME (&Name, METHOD_NAME__CID)) + { + return; + } + + /* _CID can contain a single argument or a package */ + + if (NextOp->Common.AmlOpcode != AML_PACKAGE_OP) + { + AcpiDmIsEisaIdElement (NextOp); + return; + } + + /* _CID with Package: get the package length */ + + NextOp = AcpiPsGetDepthNext (NULL, NextOp); + + /* Don't need to use the length, just walk the peer list */ + + NextOp = NextOp->Common.Next; + while (NextOp) + { + AcpiDmIsEisaIdElement (NextOp); + NextOp = NextOp->Common.Next; + } } diff --git a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmnames.c b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmnames.c index dcee6ca2e5..bb9a31e39a 100644 --- a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmnames.c +++ b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmnames.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dmnames - AML disassembler, names, namestrings, pathnames - * $Revision: 1.18 $ + * $Revision: 1.19 $ * ******************************************************************************/ @@ -150,16 +150,20 @@ AcpiDmDisplayPath ( UINT32 AcpiDmDumpName ( - char *Name) + UINT32 Name) { UINT32 i; UINT32 Length; char NewName[4]; + /* Copy name locally in case the original name is not writeable */ + + *(UINT32 *) NewName = Name; + /* Ensure that the name is printable, even if we have to fix it */ - *(UINT32 *) NewName = AcpiUtRepairName (Name); + AcpiUtRepairName (NewName); /* Remove all trailing underscores from the name */ @@ -327,7 +331,7 @@ AcpiDmNamestring ( { /* Append Name segment */ - AcpiDmDumpName ((char *) Name); + AcpiDmDumpName (*ACPI_CAST_PTR (UINT32, Name)); SegCount--; if (SegCount) diff --git a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmopcode.c b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmopcode.c index 277caf1c80..7b398313c1 100644 --- a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmopcode.c +++ b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmopcode.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dmopcode - AML disassembler, specific AML opcodes - * $Revision: 1.105 $ + * $Revision: 1.106 $ * ******************************************************************************/ @@ -549,7 +549,7 @@ AcpiDmDisassembleOneOp ( case AML_INT_NAMEDFIELD_OP: - Length = AcpiDmDumpName ((char *) &Op->Named.Name); + Length = AcpiDmDumpName (Op->Named.Name); AcpiOsPrintf (",%*.s %d", (int) (5 - Length), " ", (UINT32) Op->Common.Value.Integer); AcpiDmCommaIfFieldMember (Op); diff --git a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrc.c b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrc.c index 3fd3d83504..e9aed02b77 100644 --- a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrc.c +++ b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrc.c @@ -133,7 +133,7 @@ void (*ACPI_RESOURCE_HANDLER) ( UINT32 Length, UINT32 Level); -static ACPI_RESOURCE_HANDLER AcpiGbl_DumpResourceDispatch [] = +static ACPI_RESOURCE_HANDLER AcpiGbl_DmResourceDispatch [] = { /* Small descriptors */ @@ -325,7 +325,7 @@ AcpiDmResourceTemplate ( UINT32 ByteCount) { ACPI_STATUS Status; - ACPI_NATIVE_UINT CurrentByteOffset; + UINT32 CurrentByteOffset; UINT8 ResourceType; UINT32 ResourceLength; void *Aml; @@ -343,7 +343,7 @@ AcpiDmResourceTemplate ( Node = Node->Child; } - for (CurrentByteOffset = 0; CurrentByteOffset < ByteCount; ) + for (CurrentByteOffset = 0; CurrentByteOffset < ByteCount;) { Aml = &ByteData[CurrentByteOffset]; @@ -423,7 +423,7 @@ AcpiDmResourceTemplate ( Node = Node->Peer; } - AcpiGbl_DumpResourceDispatch [ResourceIndex] ( + AcpiGbl_DmResourceDispatch [ResourceIndex] ( Aml, ResourceLength, Level); /* Descriptor post-processing */ diff --git a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrcl.c b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrcl.c index 24b894ad7a..659554feb0 100644 --- a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrcl.c +++ b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrcl.c @@ -215,7 +215,7 @@ AcpiDmMemoryFields ( UINT8 Type, UINT32 Level) { - ACPI_NATIVE_UINT i; + UINT32 i; for (i = 0; i < 4; i++) @@ -261,7 +261,7 @@ AcpiDmAddressFields ( UINT8 Type, UINT32 Level) { - ACPI_NATIVE_UINT i; + UINT32 i; AcpiOsPrintf ("\n"); diff --git a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmwalk.c b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmwalk.c index ff0ccf6504..b79a7ccd10 100644 --- a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmwalk.c +++ b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmwalk.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dmwalk - AML disassembly tree walk - * $Revision: 1.34 $ + * $Revision: 1.35 $ * ******************************************************************************/ @@ -622,7 +622,7 @@ AcpiDmDescendingOp ( } else { - AcpiDmDumpName ((char *) &Name); + AcpiDmDumpName (Name); } if (Op->Common.AmlOpcode != AML_INT_NAMEDFIELD_OP) diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsfield.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsfield.c similarity index 99% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsfield.c rename to src/add-ons/kernel/bus_managers/acpi/dispatcher/dsfield.c index 895c3ae427..8e35db4bcc 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsfield.c +++ b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsfield.c @@ -561,11 +561,6 @@ AcpiDsInitFieldObjects ( return_ACPI_STATUS (AE_BAD_PARAMETER); } - if (!Arg) - { - return_ACPI_STATUS (AE_AML_NO_OPERAND); - } - /* Creating new namespace node(s), should not already exist */ Flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | @@ -580,6 +575,7 @@ AcpiDsInitFieldObjects ( /* * Walk the list of entries in the FieldList + * Note: FieldList can be of zero length. In this case, Arg will be NULL. */ while (Arg) { diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsinit.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsinit.c similarity index 99% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsinit.c rename to src/add-ons/kernel/bus_managers/acpi/dispatcher/dsinit.c index 113eb87b29..3f00b51348 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsinit.c +++ b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsinit.c @@ -241,7 +241,7 @@ AcpiDsInitOneObject ( ACPI_STATUS AcpiDsInitializeObjects ( - ACPI_NATIVE_UINT TableIndex, + UINT32 TableIndex, ACPI_NAMESPACE_NODE *StartNode) { ACPI_STATUS Status; diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsmethod.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsmethod.c similarity index 99% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsmethod.c rename to src/add-ons/kernel/bus_managers/acpi/dispatcher/dsmethod.c index 9ea0ea3a78..4b7ded59a6 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsmethod.c +++ b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsmethod.c @@ -486,7 +486,6 @@ AcpiDsCallControlMethod ( } Info->Parameters = &ThisWalkState->Operands[0]; - Info->ParameterType = ACPI_PARAM_ARGS; Status = AcpiDsInitAmlWalk (NextWalkState, NULL, MethodNode, ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength, diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsmthdat.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsmthdat.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsmthdat.c rename to src/add-ons/kernel/bus_managers/acpi/dispatcher/dsmthdat.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsobject.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsobject.c similarity index 99% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsobject.c rename to src/add-ons/kernel/bus_managers/acpi/dispatcher/dsobject.c index 2c100bc44c..c077b2bc47 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsobject.c +++ b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsobject.c @@ -459,7 +459,7 @@ AcpiDsBuildInternalPackageObj ( ACPI_PARSE_OBJECT *Parent; ACPI_OPERAND_OBJECT *ObjDesc = NULL; ACPI_STATUS Status = AE_OK; - ACPI_NATIVE_UINT i; + UINT32 i; UINT16 Index; UINT16 ReferenceCount; diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsopcode.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsopcode.c similarity index 98% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsopcode.c rename to src/add-ons/kernel/bus_managers/acpi/dispatcher/dsopcode.c index 85b648f90c..3d10c3ddac 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsopcode.c +++ b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsopcode.c @@ -826,11 +826,6 @@ AcpiDsEvalBufferFieldOperands ( Status = AcpiExResolveOperands (Op->Common.AmlOpcode, ACPI_WALK_OPERANDS, WalkState); - - ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE, - AcpiPsGetOpcodeName (Op->Common.AmlOpcode), - WalkState->NumOperands, "after AcpiExResolveOperands"); - if (ACPI_FAILURE (Status)) { ACPI_ERROR ((AE_INFO, "(%s) bad operand(s) (%X)", @@ -922,10 +917,6 @@ AcpiDsEvalRegionOperands ( return_ACPI_STATUS (Status); } - ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE, - AcpiPsGetOpcodeName (Op->Common.AmlOpcode), - 1, "after AcpiExResolveOperands"); - ObjDesc = AcpiNsGetAttachedObject (Node); if (!ObjDesc) { @@ -988,7 +979,7 @@ AcpiDsEvalTableRegionOperands ( ACPI_OPERAND_OBJECT **Operand; ACPI_NAMESPACE_NODE *Node; ACPI_PARSE_OBJECT *NextOp; - ACPI_NATIVE_UINT TableIndex; + UINT32 TableIndex; ACPI_TABLE_HEADER *Table; @@ -1026,10 +1017,6 @@ AcpiDsEvalTableRegionOperands ( return_ACPI_STATUS (Status); } - ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE, - AcpiPsGetOpcodeName (Op->Common.AmlOpcode), - 1, "after AcpiExResolveOperands"); - Operand = &WalkState->Operands[0]; /* Find the ACPI table */ @@ -1247,10 +1234,8 @@ AcpiDsEvalBankFieldOperands ( return_ACPI_STATUS (Status); } - ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE, - AcpiPsGetOpcodeName (Op->Common.AmlOpcode), - 1, "after AcpiExResolveOperands"); - + ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, + AcpiPsGetOpcodeName (Op->Common.AmlOpcode), 1); /* * Get the BankValue operand and save it * (at Top of stack) diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsutils.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsutils.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dsutils.c rename to src/add-ons/kernel/bus_managers/acpi/dispatcher/dsutils.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dswexec.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswexec.c similarity index 98% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dswexec.c rename to src/add-ons/kernel/bus_managers/acpi/dispatcher/dswexec.c index ba7f944e34..eba860bf79 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dswexec.c +++ b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswexec.c @@ -515,12 +515,6 @@ AcpiDsExecEndOp ( Status = AcpiExResolveOperands (WalkState->Opcode, &(WalkState->Operands [WalkState->NumOperands -1]), WalkState); - if (ACPI_SUCCESS (Status)) - { - ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE, - AcpiPsGetOpcodeName (WalkState->Opcode), - WalkState->NumOperands, "after ExResolveOperands"); - } } if (ACPI_SUCCESS (Status)) diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dswload.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswload.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dswload.c rename to src/add-ons/kernel/bus_managers/acpi/dispatcher/dswload.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dswscope.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswscope.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dswscope.c rename to src/add-ons/kernel/bus_managers/acpi/dispatcher/dswscope.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dswstate.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswstate.c similarity index 97% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dswstate.c rename to src/add-ons/kernel/bus_managers/acpi/dispatcher/dswstate.c index 01619a7a04..0d1defec2c 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/dispatcher/dswstate.c +++ b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswstate.c @@ -154,7 +154,7 @@ AcpiDsResultPop ( ACPI_OPERAND_OBJECT **Object, ACPI_WALK_STATE *WalkState) { - ACPI_NATIVE_UINT Index; + UINT32 Index; ACPI_GENERIC_STATE *State; ACPI_STATUS Status; @@ -212,7 +212,7 @@ AcpiDsResultPop ( ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s] Index=%X State=%p Num=%X\n", *Object, AcpiUtGetObjectTypeName (*Object), - (UINT32) Index, WalkState, WalkState->ResultCount)); + Index, WalkState, WalkState->ResultCount)); return (AE_OK); } @@ -238,7 +238,7 @@ AcpiDsResultPush ( { ACPI_GENERIC_STATE *State; ACPI_STATUS Status; - ACPI_NATIVE_UINT Index; + UINT32 Index; ACPI_FUNCTION_NAME (DsResultPush); @@ -517,7 +517,7 @@ AcpiDsObjStackPopAndDelete ( UINT32 PopCount, ACPI_WALK_STATE *WalkState) { - ACPI_NATIVE_INT i; + INT32 i; ACPI_OPERAND_OBJECT *ObjDesc; @@ -529,7 +529,7 @@ AcpiDsObjStackPopAndDelete ( return; } - for (i = (ACPI_NATIVE_INT)(PopCount - 1); i >= 0; i--) + for (i = (INT32) PopCount - 1; i >= 0; i--) { if (WalkState->NumOperands == 0) { @@ -763,16 +763,8 @@ AcpiDsInitAmlWalk ( if (Info) { - if (Info->ParameterType == ACPI_PARAM_GPE) - { - WalkState->GpeEventInfo = - ACPI_CAST_PTR (ACPI_GPE_EVENT_INFO, Info->Parameters); - } - else - { - WalkState->Params = Info->Parameters; - WalkState->CallerReturnDesc = &Info->ReturnObject; - } + WalkState->Params = Info->Parameters; + WalkState->CallerReturnDesc = &Info->ReturnObject; } Status = AcpiPsInitScope (&WalkState->ParserState, Op); diff --git a/src/add-ons/kernel/bus_managers/acpi/events/evevent.c b/src/add-ons/kernel/bus_managers/acpi/events/evevent.c index 172a0e2c25..ed8299a4a3 100644 --- a/src/add-ons/kernel/bus_managers/acpi/events/evevent.c +++ b/src/add-ons/kernel/bus_managers/acpi/events/evevent.c @@ -289,7 +289,7 @@ static ACPI_STATUS AcpiEvFixedEventInitialize ( void) { - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_STATUS Status; @@ -338,7 +338,7 @@ AcpiEvFixedEventDetect ( UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED; UINT32 FixedStatus; UINT32 FixedEnable; - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_FUNCTION_NAME (EvFixedEventDetect); @@ -348,10 +348,8 @@ AcpiEvFixedEventDetect ( * Read the fixed feature status and enable registers, as all the cases * depend on their values. Ignore errors here. */ - (void) AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS, - &FixedStatus); - (void) AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_ENABLE, - &FixedEnable); + (void) AcpiHwRegisterRead (ACPI_REGISTER_PM1_STATUS, &FixedStatus); + (void) AcpiHwRegisterRead (ACPI_REGISTER_PM1_ENABLE, &FixedEnable); ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS, "Fixed Event Block: Enable %08X Status %08X\n", @@ -370,7 +368,7 @@ AcpiEvFixedEventDetect ( /* Found an active (signalled) event */ AcpiFixedEventCount[i]++; - IntStatus |= AcpiEvFixedEventDispatch ((UINT32) i); + IntStatus |= AcpiEvFixedEventDispatch (i); } } diff --git a/src/add-ons/kernel/bus_managers/acpi/events/evgpe.c b/src/add-ons/kernel/bus_managers/acpi/events/evgpe.c index 816be9a5e4..d09ce76292 100644 --- a/src/add-ons/kernel/bus_managers/acpi/events/evgpe.c +++ b/src/add-ons/kernel/bus_managers/acpi/events/evgpe.c @@ -350,16 +350,10 @@ AcpiEvDisableGpe ( /* - * Ignore this if the GPE is valid and not enabled. - * - * Flags is only zero if GPE is neither enabled or disabled -- it may - * be a spurious or stray GPE -- disable it in the default case below. + * Note: Always disable the GPE, even if we think that that it is already + * disabled. It is possible that the AML or some other code has enabled + * the GPE behind our back. */ - if (GpeEventInfo->Flags && - (!(GpeEventInfo->Flags & ACPI_GPE_ENABLE_MASK))) - { - return_ACPI_STATUS (AE_OK); - } /* Make sure HW enable masks are updated */ @@ -392,7 +386,7 @@ AcpiEvDisableGpe ( default: /* - * Even if we don't know the GPE type, make sure that we always + * If we don't know the GPE type, make sure that we always * disable it. This can prevent a certain type of GPE flood, where * the GPE has no _Lxx/_Exx method, and it cannot be determined * whether the GPE is wake, run, or wake/run. @@ -429,7 +423,7 @@ AcpiEvGetGpeEventInfo ( { ACPI_OPERAND_OBJECT *ObjDesc; ACPI_GPE_BLOCK_INFO *GpeBlock; - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_FUNCTION_ENTRY (); @@ -508,8 +502,8 @@ AcpiEvGpeDetect ( UINT32 StatusReg; UINT32 EnableReg; ACPI_CPU_FLAGS Flags; - ACPI_NATIVE_UINT i; - ACPI_NATIVE_UINT j; + UINT32 i; + UINT32 j; ACPI_FUNCTION_NAME (EvGpeDetect); @@ -589,8 +583,8 @@ AcpiEvGpeDetect ( * or method. */ IntStatus |= AcpiEvGpeDispatch ( - &GpeBlock->EventInfo[(i * ACPI_GPE_REGISTER_WIDTH) + j], - (UINT32) j + GpeRegisterInfo->BaseGpeNumber); + &GpeBlock->EventInfo[((ACPI_SIZE) i * ACPI_GPE_REGISTER_WIDTH) + j], + j + GpeRegisterInfo->BaseGpeNumber); } } } @@ -696,8 +690,6 @@ AcpiEvAsynchExecuteGpeMethod ( * control method that corresponds to this GPE */ Info->PrefixNode = LocalGpeEventInfo->Dispatch.MethodNode; - Info->Parameters = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT *, LocalGpeEventInfo); - Info->ParameterType = ACPI_PARAM_GPE; Info->Flags = ACPI_IGNORE_RETURN_VALUE; Status = AcpiNsEvaluate (Info); diff --git a/src/add-ons/kernel/bus_managers/acpi/events/evgpeblk.c b/src/add-ons/kernel/bus_managers/acpi/events/evgpeblk.c index 7cefe6470e..5095009d54 100644 --- a/src/add-ons/kernel/bus_managers/acpi/events/evgpeblk.c +++ b/src/add-ons/kernel/bus_managers/acpi/events/evgpeblk.c @@ -286,8 +286,8 @@ AcpiEvDeleteGpeHandlers ( ACPI_GPE_BLOCK_INFO *GpeBlock) { ACPI_GPE_EVENT_INFO *GpeEventInfo; - ACPI_NATIVE_UINT i; - ACPI_NATIVE_UINT j; + UINT32 i; + UINT32 j; ACPI_FUNCTION_TRACE (EvDeleteGpeHandlers); @@ -301,7 +301,7 @@ AcpiEvDeleteGpeHandlers ( for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) { - GpeEventInfo = &GpeBlock->EventInfo[(i * ACPI_GPE_REGISTER_WIDTH) + j]; + GpeEventInfo = &GpeBlock->EventInfo[((ACPI_SIZE) i * ACPI_GPE_REGISTER_WIDTH) + j]; if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == ACPI_GPE_DISPATCH_HANDLER) @@ -894,8 +894,8 @@ AcpiEvCreateGpeInfoBlocks ( ACPI_GPE_EVENT_INFO *GpeEventInfo = NULL; ACPI_GPE_EVENT_INFO *ThisEvent; ACPI_GPE_REGISTER_INFO *ThisRegister; - ACPI_NATIVE_UINT i; - ACPI_NATIVE_UINT j; + UINT32 i; + UINT32 j; ACPI_STATUS Status; @@ -1140,8 +1140,8 @@ AcpiEvInitializeGpeBlock ( ACPI_GPE_WALK_INFO GpeInfo; UINT32 WakeGpeCount; UINT32 GpeEnabledCount; - ACPI_NATIVE_UINT i; - ACPI_NATIVE_UINT j; + UINT32 i; + UINT32 j; ACPI_FUNCTION_TRACE (EvInitializeGpeBlock); @@ -1191,7 +1191,7 @@ AcpiEvInitializeGpeBlock ( { /* Get the info block for this particular GPE */ - GpeEventInfo = &GpeBlock->EventInfo[(i * ACPI_GPE_REGISTER_WIDTH) + j]; + GpeEventInfo = &GpeBlock->EventInfo[((ACPI_SIZE) i * ACPI_GPE_REGISTER_WIDTH) + j]; if (((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == ACPI_GPE_DISPATCH_METHOD) && (GpeEventInfo->Flags & ACPI_GPE_TYPE_RUNTIME)) diff --git a/src/add-ons/kernel/bus_managers/acpi/events/evmisc.c b/src/add-ons/kernel/bus_managers/acpi/events/evmisc.c index 210a934543..e77235f04c 100644 --- a/src/add-ons/kernel/bus_managers/acpi/events/evmisc.c +++ b/src/add-ons/kernel/bus_managers/acpi/events/evmisc.c @@ -681,7 +681,7 @@ void AcpiEvTerminate ( void) { - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_STATUS Status; @@ -699,7 +699,7 @@ AcpiEvTerminate ( for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) { - Status = AcpiDisableEvent ((UINT32) i, 0); + Status = AcpiDisableEvent (i, 0); if (ACPI_FAILURE (Status)) { ACPI_ERROR ((AE_INFO, diff --git a/src/add-ons/kernel/bus_managers/acpi/events/evregion.c b/src/add-ons/kernel/bus_managers/acpi/events/evregion.c index 9802b04b4d..bc555903e5 100644 --- a/src/add-ons/kernel/bus_managers/acpi/events/evregion.c +++ b/src/add-ons/kernel/bus_managers/acpi/events/evregion.c @@ -169,7 +169,7 @@ AcpiEvInstallRegionHandlers ( void) { ACPI_STATUS Status; - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_FUNCTION_TRACE (EvInstallRegionHandlers); @@ -245,7 +245,7 @@ AcpiEvInitializeOpRegions ( void) { ACPI_STATUS Status; - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_FUNCTION_TRACE (EvInitializeOpRegions); @@ -323,7 +323,6 @@ AcpiEvExecuteRegMethod ( Info->PrefixNode = RegionObj2->Extra.Method_REG; Info->Pathname = NULL; Info->Parameters = Args; - Info->ParameterType = ACPI_PARAM_ARGS; Info->Flags = ACPI_IGNORE_RETURN_VALUE; /* diff --git a/src/add-ons/kernel/bus_managers/acpi/events/evrgnini.c b/src/add-ons/kernel/bus_managers/acpi/events/evrgnini.c index 1764f1a121..c89f700e8b 100644 --- a/src/add-ons/kernel/bus_managers/acpi/events/evrgnini.c +++ b/src/add-ons/kernel/bus_managers/acpi/events/evrgnini.c @@ -393,6 +393,7 @@ AcpiEvPciConfigRegionSetup ( if (!PciDeviceNode) { + ACPI_FREE (PciId); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -493,7 +494,7 @@ AcpiEvIsPciRootBridge ( ACPI_STATUS Status; ACPI_DEVICE_ID Hid; ACPI_COMPATIBLE_ID_LIST *Cid; - ACPI_NATIVE_UINT i; + UINT32 i; /* diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exconfig.c b/src/add-ons/kernel/bus_managers/acpi/executer/exconfig.c similarity index 96% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exconfig.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exconfig.c index 7ca3aa84d4..b4c3b10f02 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exconfig.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exconfig.c @@ -132,7 +132,7 @@ static ACPI_STATUS AcpiExAddTable ( - ACPI_NATIVE_UINT TableIndex, + UINT32 TableIndex, ACPI_NAMESPACE_NODE *ParentNode, ACPI_OPERAND_OBJECT **DdbHandle); @@ -154,7 +154,7 @@ AcpiExAddTable ( static ACPI_STATUS AcpiExAddTable ( - ACPI_NATIVE_UINT TableIndex, + UINT32 TableIndex, ACPI_NAMESPACE_NODE *ParentNode, ACPI_OPERAND_OBJECT **DdbHandle) { @@ -215,12 +215,12 @@ AcpiExLoadTableOp ( { ACPI_STATUS Status; ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; - ACPI_NATIVE_UINT TableIndex; ACPI_NAMESPACE_NODE *ParentNode; ACPI_NAMESPACE_NODE *StartNode; ACPI_NAMESPACE_NODE *ParameterNode = NULL; ACPI_OPERAND_OBJECT *DdbHandle; ACPI_TABLE_HEADER *Table; + UINT32 TableIndex; ACPI_FUNCTION_TRACE (ExLoadTableOp); @@ -380,7 +380,7 @@ AcpiExLoadOp ( { ACPI_OPERAND_OBJECT *DdbHandle; ACPI_TABLE_DESC TableDesc; - ACPI_NATIVE_UINT TableIndex; + UINT32 TableIndex; ACPI_STATUS Status; UINT32 Length; @@ -480,7 +480,14 @@ AcpiExLoadOp ( goto Cleanup; } - Status = AcpiExAddTable (TableIndex, WalkState->ScopeInfo->Scope.Node, &DdbHandle); + /* + * Add the table to the namespace. + * + * Note: We load the table objects relative to the root of the namespace. + * This appears to go against the ACPI specification, but we do it for + * compatibility with other ACPI implementations. + */ + Status = AcpiExAddTable (TableIndex, AcpiGbl_RootNode, &DdbHandle); if (ACPI_FAILURE (Status)) { /* On error, TablePtr was deallocated above */ @@ -538,7 +545,7 @@ AcpiExUnloadTable ( { ACPI_STATUS Status = AE_OK; ACPI_OPERAND_OBJECT *TableDesc = DdbHandle; - ACPI_NATIVE_UINT TableIndex; + UINT32 TableIndex; ACPI_TABLE_HEADER *Table; @@ -558,9 +565,9 @@ AcpiExUnloadTable ( return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* Get the table index from the DdbHandle */ + /* Get the table index from the DdbHandle (ACPI_SIZE for 64-bit case) */ - TableIndex = (ACPI_NATIVE_UINT) TableDesc->Reference.Object; + TableIndex = (UINT32) (ACPI_SIZE) TableDesc->Reference.Object; /* Invoke table handler if present */ diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exconvrt.c b/src/add-ons/kernel/bus_managers/acpi/executer/exconvrt.c similarity index 99% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exconvrt.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exconvrt.c index 8d40933bdc..9ddbfab98a 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exconvrt.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exconvrt.c @@ -395,11 +395,11 @@ AcpiExConvertToAscii ( UINT8 DataWidth) { ACPI_INTEGER Digit; - ACPI_NATIVE_UINT i; - ACPI_NATIVE_UINT j; - ACPI_NATIVE_UINT k = 0; - ACPI_NATIVE_UINT HexLength; - ACPI_NATIVE_UINT DecimalLength; + UINT32 i; + UINT32 j; + UINT32 k = 0; + UINT32 HexLength; + UINT32 DecimalLength; UINT32 Remainder; BOOLEAN SupressZeros; @@ -461,7 +461,7 @@ AcpiExConvertToAscii ( /* HexLength: 2 ascii hex chars per data byte */ - HexLength = (ACPI_NATIVE_UINT) ACPI_MUL_2 (DataWidth); + HexLength = ACPI_MUL_2 (DataWidth); for (i = 0, j = (HexLength-1); i < HexLength; i++, j--) { /* Get one hex digit, most significant digits first */ diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/excreate.c b/src/add-ons/kernel/bus_managers/acpi/executer/excreate.c similarity index 99% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/excreate.c rename to src/add-ons/kernel/bus_managers/acpi/executer/excreate.c index 00eddcfc12..dc397dea9a 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/excreate.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/excreate.c @@ -121,8 +121,6 @@ #include "acinterp.h" #include "amlcode.h" #include "acnamesp.h" -#include "acevents.h" -#include "actables.h" #define _COMPONENT ACPI_EXECUTER diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exdump.c b/src/add-ons/kernel/bus_managers/acpi/executer/exdump.c similarity index 96% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exdump.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exdump.c index 5b52e5b435..3fc9acde45 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exdump.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exdump.c @@ -680,26 +680,22 @@ AcpiExDumpOperand ( case ACPI_TYPE_BUFFER: - AcpiOsPrintf ("Buffer len %X @ %p\n", + AcpiOsPrintf ("Buffer length %.2X @ %p\n", ObjDesc->Buffer.Length, ObjDesc->Buffer.Pointer); - Length = ObjDesc->Buffer.Length; - if (Length > 64) - { - Length = 64; - } /* Debug only -- dump the buffer contents */ if (ObjDesc->Buffer.Pointer) { - AcpiOsPrintf ("Buffer Contents: "); - - for (Index = 0; Index < Length; Index++) + Length = ObjDesc->Buffer.Length; + if (Length > 128) { - AcpiOsPrintf (" %02x", ObjDesc->Buffer.Pointer[Index]); + Length = 128; } - AcpiOsPrintf ("\n"); + + AcpiOsPrintf ("Buffer Contents: (displaying length 0x%.2X)\n", Length); + ACPI_DUMP_BUFFER (ObjDesc->Buffer.Pointer, Length); } break; @@ -877,63 +873,48 @@ AcpiExDumpOperand ( * * FUNCTION: AcpiExDumpOperands * - * PARAMETERS: Operands - Operand list - * InterpreterMode - Load or Exec - * Ident - Identification - * NumLevels - # of stack entries to dump above line - * Note - Output notation - * ModuleName - Caller's module name - * LineNumber - Caller's invocation line number + * PARAMETERS: Operands - A list of Operand objects + * OpcodeName - AML opcode name + * NumOperands - Operand count for this opcode * - * DESCRIPTION: Dump the object stack + * DESCRIPTION: Dump the operands associated with the opcode * ******************************************************************************/ void AcpiExDumpOperands ( ACPI_OPERAND_OBJECT **Operands, - ACPI_INTERPRETER_MODE InterpreterMode, - char *Ident, - UINT32 NumLevels, - char *Note, - char *ModuleName, - UINT32 LineNumber) + const char *OpcodeName, + UINT32 NumOperands) { - ACPI_NATIVE_UINT i; - - ACPI_FUNCTION_NAME (ExDumpOperands); - if (!Ident) + if (!OpcodeName) { - Ident = "?"; - } - - if (!Note) - { - Note = "?"; + OpcodeName = "UNKNOWN"; } ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "************* Operand Stack Contents (Opcode [%s], %d Operands)\n", - Ident, NumLevels)); + "**** Start operand dump for opcode [%s], %d operands\n", + OpcodeName, NumOperands)); - if (NumLevels == 0) + if (NumOperands == 0) { - NumLevels = 1; + NumOperands = 1; } - /* Dump the operand stack starting at the top */ + /* Dump the individual operands */ - for (i = 0; NumLevels > 0; i--, NumLevels--) + while (NumOperands) { - AcpiExDumpOperand (Operands[i], 0); + AcpiExDumpOperand (*Operands, 0); + Operands++; + NumOperands--; } ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "************* Operand Stack dump from %s(%d), %s\n", - ModuleName, LineNumber, Note)); + "**** End operand dump for [%s]\n", OpcodeName)); return; } diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exfield.c b/src/add-ons/kernel/bus_managers/acpi/executer/exfield.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exfield.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exfield.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exfldio.c b/src/add-ons/kernel/bus_managers/acpi/executer/exfldio.c similarity index 99% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exfldio.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exfldio.c index dc41eba1f9..a7ca38827c 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exfldio.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exfldio.c @@ -248,13 +248,13 @@ AcpiExSetupRegion ( /* * Slack mode only: We will go ahead and allow access to this * field if it is within the region length rounded up to the next - * access width boundary. + * access width boundary. ACPI_SIZE cast for 64-bit compile. */ if (ACPI_ROUND_UP (RgnDesc->Region.Length, ObjDesc->CommonField.AccessByteWidth) >= - (ObjDesc->CommonField.BaseByteOffset + - (ACPI_NATIVE_UINT) ObjDesc->CommonField.AccessByteWidth + - FieldDatumByteOffset)) + ((ACPI_SIZE) ObjDesc->CommonField.BaseByteOffset + + ObjDesc->CommonField.AccessByteWidth + + FieldDatumByteOffset)) { return_ACPI_STATUS (AE_OK); } diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exmisc.c b/src/add-ons/kernel/bus_managers/acpi/executer/exmisc.c similarity index 99% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exmisc.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exmisc.c index 165e997727..d0a754c59c 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exmisc.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exmisc.c @@ -429,8 +429,8 @@ AcpiExDoConcatenate ( /* Result of two Strings is a String */ - ReturnDesc = AcpiUtCreateStringObject ((ACPI_SIZE) - (Operand0->String.Length + + ReturnDesc = AcpiUtCreateStringObject ( + ((ACPI_SIZE) Operand0->String.Length + LocalOperand1->String.Length)); if (!ReturnDesc) { @@ -451,8 +451,8 @@ AcpiExDoConcatenate ( /* Result of two Buffers is a Buffer */ - ReturnDesc = AcpiUtCreateBufferObject ((ACPI_SIZE) - (Operand0->Buffer.Length + + ReturnDesc = AcpiUtCreateBufferObject ( + ((ACPI_SIZE) Operand0->Buffer.Length + LocalOperand1->Buffer.Length)); if (!ReturnDesc) { diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exmutex.c b/src/add-ons/kernel/bus_managers/acpi/executer/exmutex.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exmutex.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exmutex.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exnames.c b/src/add-ons/kernel/bus_managers/acpi/executer/exnames.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exnames.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exnames.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exoparg1.c b/src/add-ons/kernel/bus_managers/acpi/executer/exoparg1.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exoparg1.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exoparg1.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exoparg2.c b/src/add-ons/kernel/bus_managers/acpi/executer/exoparg2.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exoparg2.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exoparg2.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exoparg3.c b/src/add-ons/kernel/bus_managers/acpi/executer/exoparg3.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exoparg3.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exoparg3.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exoparg6.c b/src/add-ons/kernel/bus_managers/acpi/executer/exoparg6.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exoparg6.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exoparg6.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exprep.c b/src/add-ons/kernel/bus_managers/acpi/executer/exprep.c similarity index 99% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exprep.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exprep.c index 27906a309b..a99c6c5738 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exprep.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exprep.c @@ -605,8 +605,8 @@ AcpiExPrepFieldValue ( * operands must be evaluated. */ SecondDesc = ObjDesc->Common.NextObject; - SecondDesc->Extra.AmlStart = ((ACPI_PARSE_OBJECT*) (Info->DataRegisterNode))->Named.Data; - SecondDesc->Extra.AmlLength = ((ACPI_PARSE_OBJECT*) (Info->DataRegisterNode))->Named.Length; + SecondDesc->Extra.AmlStart = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Info->DataRegisterNode)->Named.Data; + SecondDesc->Extra.AmlLength = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Info->DataRegisterNode)->Named.Length; break; diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exregion.c b/src/add-ons/kernel/bus_managers/acpi/executer/exregion.c similarity index 99% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exregion.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exregion.c index 8075e064f1..8fcf845114 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exregion.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exregion.c @@ -240,7 +240,8 @@ AcpiExSystemMemorySpaceHandler ( /* Create a new mapping starting at the address given */ - MemInfo->MappedLogicalAddress = AcpiOsMapMemory ((ACPI_NATIVE_UINT) Address, WindowSize); + MemInfo->MappedLogicalAddress = AcpiOsMapMemory ( + (ACPI_PHYSICAL_ADDRESS) Address, WindowSize); if (!MemInfo->MappedLogicalAddress) { ACPI_ERROR ((AE_INFO, diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exresnte.c b/src/add-ons/kernel/bus_managers/acpi/executer/exresnte.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exresnte.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exresnte.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exresolv.c b/src/add-ons/kernel/bus_managers/acpi/executer/exresolv.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exresolv.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exresolv.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exresop.c b/src/add-ons/kernel/bus_managers/acpi/executer/exresop.c similarity index 99% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exresop.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exresop.c index f06742cbc7..eebd9fc8e6 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exresop.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exresop.c @@ -806,6 +806,9 @@ NextOperand: } } + ACPI_DUMP_OPERANDS (WalkState->Operands, + AcpiPsGetOpcodeName (Opcode), WalkState->NumOperands); + return_ACPI_STATUS (Status); } diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exstore.c b/src/add-ons/kernel/bus_managers/acpi/executer/exstore.c similarity index 99% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exstore.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exstore.c index 6c16fcff0c..824fb50cdf 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exstore.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exstore.c @@ -431,11 +431,6 @@ AcpiExStore ( "Target is not a Reference or Constant object - %s [%p]", AcpiUtGetObjectTypeName (DestDesc), DestDesc)); - ACPI_DUMP_STACK_ENTRY (SourceDesc); - ACPI_DUMP_STACK_ENTRY (DestDesc); - ACPI_DUMP_OPERANDS (&DestDesc, ACPI_IMODE_EXECUTE, "ExStore", - 2, "Target is not a Reference or Constant object"); - return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exstoren.c b/src/add-ons/kernel/bus_managers/acpi/executer/exstoren.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exstoren.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exstoren.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exstorob.c b/src/add-ons/kernel/bus_managers/acpi/executer/exstorob.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exstorob.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exstorob.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exsystem.c b/src/add-ons/kernel/bus_managers/acpi/executer/exsystem.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exsystem.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exsystem.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exutils.c b/src/add-ons/kernel/bus_managers/acpi/executer/exutils.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/executer/exutils.c rename to src/add-ons/kernel/bus_managers/acpi/executer/exutils.c diff --git a/src/add-ons/kernel/bus_managers/acpi/hardware/hwregs.c b/src/add-ons/kernel/bus_managers/acpi/hardware/hwregs.c index 2e2550180b..703459f65b 100644 --- a/src/add-ons/kernel/bus_managers/acpi/hardware/hwregs.c +++ b/src/add-ons/kernel/bus_managers/acpi/hardware/hwregs.c @@ -156,8 +156,7 @@ AcpiHwClearAcpiStatus ( LockFlags = AcpiOsAcquireLock (AcpiGbl_HardwareLock); - Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM1_STATUS, + Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_STATUS, ACPI_BITMASK_ALL_FIXED_STATUS); if (ACPI_FAILURE (Status)) { @@ -345,6 +344,63 @@ AcpiHwGetBitRegisterInfo ( } +/******************************************************************************* + * + * FUNCTION: AcpiGetRegisterUnlocked + * + * PARAMETERS: RegisterId - ID of ACPI BitRegister to access + * ReturnValue - Value that was read from the register + * + * RETURN: Status and the value read from specified Register. Value + * returned is normalized to bit0 (is shifted all the way right) + * + * DESCRIPTION: ACPI BitRegister read function. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiGetRegisterUnlocked ( + UINT32 RegisterId, + UINT32 *ReturnValue) +{ + UINT32 RegisterValue = 0; + ACPI_BIT_REGISTER_INFO *BitRegInfo; + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (AcpiGetRegisterUnlocked); + + + /* Get the info structure corresponding to the requested ACPI Register */ + + BitRegInfo = AcpiHwGetBitRegisterInfo (RegisterId); + if (!BitRegInfo) + { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + + /* Read from the register */ + + Status = AcpiHwRegisterRead (BitRegInfo->ParentRegister, + &RegisterValue); + + if (ACPI_SUCCESS (Status)) + { + /* Normalize the value that was read */ + + RegisterValue = ((RegisterValue & BitRegInfo->AccessBitMask) + >> BitRegInfo->BitPosition); + + *ReturnValue = RegisterValue; + + ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Read value %8.8X register %X\n", + RegisterValue, BitRegInfo->ParentRegister)); + } + + return_ACPI_STATUS (Status); +} + + /******************************************************************************* * * FUNCTION: AcpiGetRegister @@ -364,41 +420,15 @@ AcpiGetRegister ( UINT32 RegisterId, UINT32 *ReturnValue) { - UINT32 RegisterValue = 0; - ACPI_BIT_REGISTER_INFO *BitRegInfo; ACPI_STATUS Status; + ACPI_CPU_FLAGS Flags; - ACPI_FUNCTION_TRACE (AcpiGetRegister); + Flags = AcpiOsAcquireLock (AcpiGbl_HardwareLock); + Status = AcpiGetRegisterUnlocked (RegisterId, ReturnValue); + AcpiOsReleaseLock (AcpiGbl_HardwareLock, Flags); - - /* Get the info structure corresponding to the requested ACPI Register */ - - BitRegInfo = AcpiHwGetBitRegisterInfo (RegisterId); - if (!BitRegInfo) - { - return_ACPI_STATUS (AE_BAD_PARAMETER); - } - - /* Read from the register */ - - Status = AcpiHwRegisterRead (ACPI_MTX_LOCK, - BitRegInfo->ParentRegister, &RegisterValue); - - if (ACPI_SUCCESS (Status)) - { - /* Normalize the value that was read */ - - RegisterValue = ((RegisterValue & BitRegInfo->AccessBitMask) - >> BitRegInfo->BitPosition); - - *ReturnValue = RegisterValue; - - ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Read value %8.8X register %X\n", - RegisterValue, BitRegInfo->ParentRegister)); - } - - return_ACPI_STATUS (Status); + return Status; } ACPI_EXPORT_SYMBOL (AcpiGetRegister) @@ -445,8 +475,8 @@ AcpiSetRegister ( /* Always do a register read first so we can insert the new bits */ - Status = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, - BitRegInfo->ParentRegister, &RegisterValue); + Status = AcpiHwRegisterRead (BitRegInfo->ParentRegister, + &RegisterValue); if (ACPI_FAILURE (Status)) { goto UnlockAndExit; @@ -473,8 +503,8 @@ AcpiSetRegister ( BitRegInfo->BitPosition, BitRegInfo->AccessBitMask); if (Value) { - Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM1_STATUS, (UINT16) Value); + Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_STATUS, + (UINT16) Value); RegisterValue = 0; } break; @@ -485,8 +515,8 @@ AcpiSetRegister ( ACPI_REGISTER_INSERT_VALUE (RegisterValue, BitRegInfo->BitPosition, BitRegInfo->AccessBitMask, Value); - Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM1_ENABLE, (UINT16) RegisterValue); + Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_ENABLE, + (UINT16) RegisterValue); break; @@ -503,15 +533,15 @@ AcpiSetRegister ( ACPI_REGISTER_INSERT_VALUE (RegisterValue, BitRegInfo->BitPosition, BitRegInfo->AccessBitMask, Value); - Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM1_CONTROL, (UINT16) RegisterValue); + Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_CONTROL, + (UINT16) RegisterValue); break; case ACPI_REGISTER_PM2_CONTROL: - Status = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM2_CONTROL, &RegisterValue); + Status = AcpiHwRegisterRead (ACPI_REGISTER_PM2_CONTROL, + &RegisterValue); if (ACPI_FAILURE (Status)) { goto UnlockAndExit; @@ -528,8 +558,8 @@ AcpiSetRegister ( RegisterValue, ACPI_FORMAT_UINT64 (AcpiGbl_FADT.XPm2ControlBlock.Address))); - Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM2_CONTROL, (UINT8) (RegisterValue)); + Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM2_CONTROL, + (UINT8) (RegisterValue)); break; @@ -560,8 +590,7 @@ ACPI_EXPORT_SYMBOL (AcpiSetRegister) * * FUNCTION: AcpiHwRegisterRead * - * PARAMETERS: UseLock - Lock hardware? True/False - * RegisterId - ACPI Register ID + * PARAMETERS: RegisterId - ACPI Register ID * ReturnValue - Where the register value is returned * * RETURN: Status and the value read. @@ -572,24 +601,17 @@ ACPI_EXPORT_SYMBOL (AcpiSetRegister) ACPI_STATUS AcpiHwRegisterRead ( - BOOLEAN UseLock, UINT32 RegisterId, UINT32 *ReturnValue) { UINT32 Value1 = 0; UINT32 Value2 = 0; ACPI_STATUS Status; - ACPI_CPU_FLAGS LockFlags = 0; ACPI_FUNCTION_TRACE (HwRegisterRead); - if (ACPI_MTX_LOCK == UseLock) - { - LockFlags = AcpiOsAcquireLock (AcpiGbl_HardwareLock); - } - switch (RegisterId) { case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */ @@ -597,7 +619,7 @@ AcpiHwRegisterRead ( Status = AcpiHwLowLevelRead (16, &Value1, &AcpiGbl_FADT.XPm1aEventBlock); if (ACPI_FAILURE (Status)) { - goto UnlockAndExit; + goto Exit; } /* PM1B is optional */ @@ -612,7 +634,7 @@ AcpiHwRegisterRead ( Status = AcpiHwLowLevelRead (16, &Value1, &AcpiGbl_XPm1aEnable); if (ACPI_FAILURE (Status)) { - goto UnlockAndExit; + goto Exit; } /* PM1B is optional */ @@ -627,7 +649,7 @@ AcpiHwRegisterRead ( Status = AcpiHwLowLevelRead (16, &Value1, &AcpiGbl_FADT.XPm1aControlBlock); if (ACPI_FAILURE (Status)) { - goto UnlockAndExit; + goto Exit; } Status = AcpiHwLowLevelRead (16, &Value2, &AcpiGbl_FADT.XPm1bControlBlock); @@ -658,12 +680,7 @@ AcpiHwRegisterRead ( break; } -UnlockAndExit: - if (ACPI_MTX_LOCK == UseLock) - { - AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags); - } - +Exit: if (ACPI_SUCCESS (Status)) { *ReturnValue = Value1; @@ -677,8 +694,7 @@ UnlockAndExit: * * FUNCTION: AcpiHwRegisterWrite * - * PARAMETERS: UseLock - Lock hardware? True/False - * RegisterId - ACPI Register ID + * PARAMETERS: RegisterId - ACPI Register ID * Value - The value to write * * RETURN: Status @@ -702,34 +718,27 @@ UnlockAndExit: ACPI_STATUS AcpiHwRegisterWrite ( - BOOLEAN UseLock, UINT32 RegisterId, UINT32 Value) { ACPI_STATUS Status; - ACPI_CPU_FLAGS LockFlags = 0; UINT32 ReadValue; ACPI_FUNCTION_TRACE (HwRegisterWrite); - if (ACPI_MTX_LOCK == UseLock) - { - LockFlags = AcpiOsAcquireLock (AcpiGbl_HardwareLock); - } - switch (RegisterId) { case ACPI_REGISTER_PM1_STATUS: /* 16-bit access */ /* Perform a read first to preserve certain bits (per ACPI spec) */ - Status = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM1_STATUS, &ReadValue); + Status = AcpiHwRegisterRead (ACPI_REGISTER_PM1_STATUS, + &ReadValue); if (ACPI_FAILURE (Status)) { - goto UnlockAndExit; + goto Exit; } /* Insert the bits to be preserved */ @@ -741,7 +750,7 @@ AcpiHwRegisterWrite ( Status = AcpiHwLowLevelWrite (16, Value, &AcpiGbl_FADT.XPm1aEventBlock); if (ACPI_FAILURE (Status)) { - goto UnlockAndExit; + goto Exit; } /* PM1B is optional */ @@ -755,7 +764,7 @@ AcpiHwRegisterWrite ( Status = AcpiHwLowLevelWrite (16, Value, &AcpiGbl_XPm1aEnable); if (ACPI_FAILURE (Status)) { - goto UnlockAndExit; + goto Exit; } /* PM1B is optional */ @@ -771,11 +780,11 @@ AcpiHwRegisterWrite ( * * Note: This includes SCI_EN, we never want to change this bit */ - Status = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM1_CONTROL, &ReadValue); + Status = AcpiHwRegisterRead (ACPI_REGISTER_PM1_CONTROL, + &ReadValue); if (ACPI_FAILURE (Status)) { - goto UnlockAndExit; + goto Exit; } /* Insert the bits to be preserved */ @@ -787,7 +796,7 @@ AcpiHwRegisterWrite ( Status = AcpiHwLowLevelWrite (16, Value, &AcpiGbl_FADT.XPm1aControlBlock); if (ACPI_FAILURE (Status)) { - goto UnlockAndExit; + goto Exit; } Status = AcpiHwLowLevelWrite (16, Value, &AcpiGbl_FADT.XPm1bControlBlock); @@ -831,12 +840,7 @@ AcpiHwRegisterWrite ( break; } -UnlockAndExit: - if (ACPI_MTX_LOCK == UseLock) - { - AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags); - } - +Exit: return_ACPI_STATUS (Status); } diff --git a/src/add-ons/kernel/bus_managers/acpi/hardware/hwsleep.c b/src/add-ons/kernel/bus_managers/acpi/hardware/hwsleep.c index 2f638f9dd7..34f13c9e4f 100644 --- a/src/add-ons/kernel/bus_managers/acpi/hardware/hwsleep.c +++ b/src/add-ons/kernel/bus_managers/acpi/hardware/hwsleep.c @@ -258,11 +258,11 @@ ACPI_EXPORT_SYMBOL (AcpiGetFirmwareWakingVector) ACPI_STATUS AcpiEnterSleepStatePrep ( - UINT8 SleepState) + UINT8 SleepState) { - ACPI_STATUS Status; - ACPI_OBJECT_LIST ArgList; - ACPI_OBJECT Arg; + ACPI_STATUS Status; + ACPI_OBJECT_LIST ArgList; + ACPI_OBJECT Arg; ACPI_FUNCTION_TRACE (AcpiEnterSleepStatePrep); @@ -278,29 +278,20 @@ AcpiEnterSleepStatePrep ( return_ACPI_STATUS (Status); } - /* Setup parameter object */ + /* Execute the _PTS method (Prepare To Sleep) */ ArgList.Count = 1; ArgList.Pointer = &Arg; - Arg.Type = ACPI_TYPE_INTEGER; Arg.Integer.Value = SleepState; - /* Run the _PTS and _GTS methods */ - Status = AcpiEvaluateObject (NULL, METHOD_NAME__PTS, &ArgList, NULL); if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND) { return_ACPI_STATUS (Status); } - Status = AcpiEvaluateObject (NULL, METHOD_NAME__GTS, &ArgList, NULL); - if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND) - { - return_ACPI_STATUS (Status); - } - - /* Setup the argument to _SST */ + /* Setup the argument to the _SST method (System STatus) */ switch (SleepState) { @@ -323,8 +314,10 @@ AcpiEnterSleepStatePrep ( break; } - /* Set the system indicators to show the desired sleep state. */ - + /* + * Set the system indicators to show the desired sleep state. + * _SST is an optional method (return no error if not found) + */ Status = AcpiEvaluateObject (NULL, METHOD_NAME__SST, &ArgList, NULL); if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND) { @@ -345,7 +338,7 @@ ACPI_EXPORT_SYMBOL (AcpiEnterSleepStatePrep) * * RETURN: Status * - * DESCRIPTION: Enter a system sleep state (see ACPI 2.0 spec p 231) + * DESCRIPTION: Enter a system sleep state * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED * ******************************************************************************/ @@ -359,6 +352,8 @@ AcpiEnterSleepState ( ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo; ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo; UINT32 InValue; + ACPI_OBJECT_LIST ArgList; + ACPI_OBJECT Arg; ACPI_STATUS Status; @@ -420,10 +415,23 @@ AcpiEnterSleepState ( return_ACPI_STATUS (Status); } + /* Execute the _GTS method (Going To Sleep) */ + + ArgList.Count = 1; + ArgList.Pointer = &Arg; + Arg.Type = ACPI_TYPE_INTEGER; + Arg.Integer.Value = SleepState; + + Status = AcpiEvaluateObject (NULL, METHOD_NAME__GTS, &ArgList, NULL); + if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND) + { + return_ACPI_STATUS (Status); + } + /* Get current value of PM1A control */ - Status = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM1_CONTROL, &PM1AControl); + Status = AcpiHwRegisterRead (ACPI_REGISTER_PM1_CONTROL, + &PM1AControl); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -449,15 +457,15 @@ AcpiEnterSleepState ( /* Write #1: fill in SLP_TYP data */ - Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM1A_CONTROL, PM1AControl); + Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1A_CONTROL, + PM1AControl); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } - Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM1B_CONTROL, PM1BControl); + Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1B_CONTROL, + PM1BControl); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -472,15 +480,15 @@ AcpiEnterSleepState ( ACPI_FLUSH_CPU_CACHE (); - Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM1A_CONTROL, PM1AControl); + Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1A_CONTROL, + PM1AControl); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } - Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM1B_CONTROL, PM1BControl); + Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1B_CONTROL, + PM1BControl); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -501,8 +509,7 @@ AcpiEnterSleepState ( */ AcpiOsStall (10000000); - Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM1_CONTROL, + Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_CONTROL, SleepEnableRegInfo->AccessBitMask); if (ACPI_FAILURE (Status)) { @@ -646,8 +653,8 @@ AcpiLeaveSleepState ( /* Get current value of PM1A control */ - Status = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM1_CONTROL, &PM1AControl); + Status = AcpiHwRegisterRead (ACPI_REGISTER_PM1_CONTROL, + &PM1AControl); if (ACPI_SUCCESS (Status)) { /* Clear SLP_EN and SLP_TYP fields */ @@ -663,10 +670,10 @@ AcpiLeaveSleepState ( /* Just ignore any errors */ - (void) AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM1A_CONTROL, PM1AControl); - (void) AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, - ACPI_REGISTER_PM1B_CONTROL, PM1BControl); + (void) AcpiHwRegisterWrite (ACPI_REGISTER_PM1A_CONTROL, + PM1AControl); + (void) AcpiHwRegisterWrite (ACPI_REGISTER_PM1B_CONTROL, + PM1BControl); } } diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acconfig.h b/src/add-ons/kernel/bus_managers/acpi/include/acconfig.h index 9bce32cac7..2926f05df6 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acconfig.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acconfig.h @@ -137,7 +137,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20080321 +#define ACPI_CA_VERSION 0x20080609 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acdisasm.h b/src/add-ons/kernel/bus_managers/acpi/include/acdisasm.h index 7c2d6ef3a9..07dc1d4851 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acdisasm.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acdisasm.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acdisasm.h - AML disassembler - * $Revision: 1.44 $ + * $Revision: 1.45 $ * *****************************************************************************/ @@ -249,6 +249,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar1[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[]; @@ -446,7 +447,7 @@ AcpiDmCommaIfFieldMember ( */ UINT32 AcpiDmDumpName ( - char *Name); + UINT32 Name); ACPI_STATUS AcpiPsDisplayObjectPathname ( diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acdispat.h b/src/add-ons/kernel/bus_managers/acpi/include/acdispat.h index 036056ab7a..7d2c3d187e 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acdispat.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acdispat.h @@ -357,7 +357,7 @@ AcpiDsMethodError ( */ ACPI_STATUS AcpiDsInitializeObjects ( - ACPI_NATIVE_UINT TableIndex, + UINT32 TableIndex, ACPI_NAMESPACE_NODE *StartNode); diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acexcep.h b/src/add-ons/kernel/bus_managers/acpi/include/acexcep.h index 36a50aca00..58b0e81bef 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acexcep.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acexcep.h @@ -185,8 +185,9 @@ #define AE_BAD_HEX_CONSTANT (ACPI_STATUS) (0x0007 | AE_CODE_PROGRAMMER) #define AE_BAD_OCTAL_CONSTANT (ACPI_STATUS) (0x0008 | AE_CODE_PROGRAMMER) #define AE_BAD_DECIMAL_CONSTANT (ACPI_STATUS) (0x0009 | AE_CODE_PROGRAMMER) +#define AE_MISSING_ARGUMENTS (ACPI_STATUS) (0x000A | AE_CODE_PROGRAMMER) -#define AE_CODE_PGM_MAX 0x0009 +#define AE_CODE_PGM_MAX 0x000A /* @@ -309,6 +310,7 @@ char const *AcpiGbl_ExceptionNames_Env[] = char const *AcpiGbl_ExceptionNames_Pgm[] = { + NULL, "AE_BAD_PARAMETER", "AE_BAD_CHARACTER", "AE_BAD_PATHNAME", @@ -317,11 +319,13 @@ char const *AcpiGbl_ExceptionNames_Pgm[] = "AE_ALIGNMENT", "AE_BAD_HEX_CONSTANT", "AE_BAD_OCTAL_CONSTANT", - "AE_BAD_DECIMAL_CONSTANT" + "AE_BAD_DECIMAL_CONSTANT", + "AE_MISSING_ARGUMENTS" }; char const *AcpiGbl_ExceptionNames_Tbl[] = { + NULL, "AE_BAD_SIGNATURE", "AE_BAD_HEADER", "AE_BAD_CHECKSUM", @@ -332,6 +336,7 @@ char const *AcpiGbl_ExceptionNames_Tbl[] = char const *AcpiGbl_ExceptionNames_Aml[] = { + NULL, "AE_AML_ERROR", "AE_AML_PARSE", "AE_AML_BAD_OPCODE", @@ -370,6 +375,7 @@ char const *AcpiGbl_ExceptionNames_Aml[] = char const *AcpiGbl_ExceptionNames_Ctrl[] = { + NULL, "AE_CTRL_RETURN_VALUE", "AE_CTRL_PENDING", "AE_CTRL_TERMINATE", diff --git a/src/add-ons/kernel/bus_managers/acpi/include/achware.h b/src/add-ons/kernel/bus_managers/acpi/include/achware.h index 5677e374c1..e7cf1e9ee4 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/achware.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/achware.h @@ -155,13 +155,11 @@ AcpiHwGetBitRegisterInfo ( ACPI_STATUS AcpiHwRegisterRead ( - BOOLEAN UseLock, UINT32 RegisterId, UINT32 *ReturnValue); ACPI_STATUS AcpiHwRegisterWrite ( - BOOLEAN UseLock, UINT32 RegisterId, UINT32 Value); diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acinterp.h b/src/add-ons/kernel/bus_managers/acpi/include/acinterp.h index 9a96868bf7..268a9edada 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acinterp.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acinterp.h @@ -564,12 +564,8 @@ AcpiExDumpOperand ( void AcpiExDumpOperands ( ACPI_OPERAND_OBJECT **Operands, - ACPI_INTERPRETER_MODE InterpreterMode, - char *Ident, - UINT32 NumLevels, - char *Note, - char *ModuleName, - UINT32 LineNumber); + const char *OpcodeName, + UINT32 NumOpcodes); void AcpiExDumpObjectDescriptor ( diff --git a/src/add-ons/kernel/bus_managers/acpi/include/aclocal.h b/src/add-ons/kernel/bus_managers/acpi/include/aclocal.h index 0409709c83..3646f8c634 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/aclocal.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/aclocal.h @@ -392,8 +392,8 @@ typedef struct acpi_predefined_names typedef struct acpi_namestring_info { - char *ExternalName; - char *NextExternalChar; + const char *ExternalName; + const char *NextExternalChar; char *InternalName; UINT32 Length; UINT32 NumSegments; diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acmacros.h b/src/add-ons/kernel/bus_managers/acpi/include/acmacros.h index df2fba2259..7a54d8e735 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acmacros.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acmacros.h @@ -155,12 +155,12 @@ */ #define ACPI_CAST_PTR(t, p) ((t *) (ACPI_UINTPTR_T) (p)) #define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (ACPI_UINTPTR_T) (p)) -#define ACPI_ADD_PTR(t,a,b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8,(a)) + (ACPI_NATIVE_UINT)(b))) -#define ACPI_PTR_DIFF(a,b) (ACPI_NATIVE_UINT) (ACPI_CAST_PTR (UINT8,(a)) - ACPI_CAST_PTR (UINT8,(b))) +#define ACPI_ADD_PTR(t,a,b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8,(a)) + (ACPI_SIZE)(b))) +#define ACPI_PTR_DIFF(a,b) (ACPI_SIZE) (ACPI_CAST_PTR (UINT8,(a)) - ACPI_CAST_PTR (UINT8,(b))) /* Pointer/Integer type conversions */ -#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(ACPI_NATIVE_UINT) i) +#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(ACPI_SIZE) i) #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) #define ACPI_OFFSET(d,f) (ACPI_SIZE) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) @@ -375,22 +375,22 @@ typedef struct acpi_integer_overlay /* * Rounding macros (Power of two boundaries only) */ -#define ACPI_ROUND_DOWN(value,boundary) (((ACPI_NATIVE_UINT)(value)) & \ - (~(((ACPI_NATIVE_UINT) boundary)-1))) +#define ACPI_ROUND_DOWN(value,boundary) (((ACPI_SIZE)(value)) & \ + (~(((ACPI_SIZE) boundary)-1))) -#define ACPI_ROUND_UP(value,boundary) ((((ACPI_NATIVE_UINT)(value)) + \ - (((ACPI_NATIVE_UINT) boundary)-1)) & \ - (~(((ACPI_NATIVE_UINT) boundary)-1))) +#define ACPI_ROUND_UP(value,boundary) ((((ACPI_SIZE)(value)) + \ + (((ACPI_SIZE) boundary)-1)) & \ + (~(((ACPI_SIZE) boundary)-1))) -/* Note: sizeof(ACPI_NATIVE_UINT) evaluates to either 2, 4, or 8 */ +/* Note: sizeof(ACPI_SIZE) evaluates to either 4 or 8 (32- vs 64-bit mode) */ #define ACPI_ROUND_DOWN_TO_32BIT(a) ACPI_ROUND_DOWN(a,4) #define ACPI_ROUND_DOWN_TO_64BIT(a) ACPI_ROUND_DOWN(a,8) -#define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,sizeof(ACPI_NATIVE_UINT)) +#define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,sizeof(ACPI_SIZE)) #define ACPI_ROUND_UP_TO_32BIT(a) ACPI_ROUND_UP(a,4) #define ACPI_ROUND_UP_TO_64BIT(a) ACPI_ROUND_UP(a,8) -#define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,sizeof(ACPI_NATIVE_UINT)) +#define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,sizeof(ACPI_SIZE)) #define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) #define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) @@ -401,7 +401,7 @@ typedef struct acpi_integer_overlay #define ACPI_ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary)) -#define ACPI_IS_MISALIGNED(value) (((ACPI_NATIVE_UINT)value) & (sizeof(ACPI_NATIVE_UINT)-1)) +#define ACPI_IS_MISALIGNED(value) (((ACPI_SIZE)value) & (sizeof(ACPI_SIZE)-1)) /* * Bitmask creation @@ -496,7 +496,7 @@ typedef struct acpi_integer_overlay * error messages. The __FILE__ macro is not very useful for this, because it * often includes the entire pathname to the module */ -#define ACPI_MODULE_NAME(Name) static char ACPI_UNUSED_VAR *_AcpiModuleName = Name; +#define ACPI_MODULE_NAME(Name) static const char ACPI_UNUSED_VAR _AcpiModuleName[] = Name; #else #define ACPI_MODULE_NAME(Name) #endif @@ -549,19 +549,17 @@ typedef struct acpi_integer_overlay /* * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header, * define it now. This is the case where there the compiler does not support - * a __FUNCTION__ macro or equivalent. We save the function name on the - * local stack. + * a __FUNCTION__ macro or equivalent. */ #ifndef ACPI_GET_FUNCTION_NAME #define ACPI_GET_FUNCTION_NAME _AcpiFunctionName /* * The Name parameter should be the procedure name as a quoted string. - * This is declared as a local string ("MyFunctionName") so that it can - * be also used by the function exit macros below. + * The function name is also used by the function exit macros below. * Note: (const char) is used to be compatible with the debug interfaces * and macros such as __FUNCTION__. */ -#define ACPI_FUNCTION_NAME(Name) const char *_AcpiFunctionName = #Name; +#define ACPI_FUNCTION_NAME(Name) static const char _AcpiFunctionName[] = #Name; #else /* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */ @@ -660,7 +658,7 @@ typedef struct acpi_integer_overlay /* Stack and buffer dumping */ #define ACPI_DUMP_STACK_ENTRY(a) AcpiExDumpOperand((a),0) -#define ACPI_DUMP_OPERANDS(a,b,c,d,e) AcpiExDumpOperands(a,b,c,d,e,_AcpiModuleName,__LINE__) +#define ACPI_DUMP_OPERANDS(a,b,c) AcpiExDumpOperands(a,b,c) #define ACPI_DUMP_ENTRY(a,b) AcpiNsDumpEntry (a,b) @@ -698,7 +696,7 @@ typedef struct acpi_integer_overlay #define ACPI_FUNCTION_VALUE_EXIT(s) #define ACPI_FUNCTION_ENTRY() #define ACPI_DUMP_STACK_ENTRY(a) -#define ACPI_DUMP_OPERANDS(a,b,c,d,e) +#define ACPI_DUMP_OPERANDS(a,b,c) #define ACPI_DUMP_ENTRY(a,b) #define ACPI_DUMP_TABLES(a,b) #define ACPI_DUMP_PATHNAME(a,b,c,d) diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acnamesp.h b/src/add-ons/kernel/bus_managers/acpi/include/acnamesp.h index 27c26ec62b..cb4e5bd050 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acnamesp.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acnamesp.h @@ -169,7 +169,7 @@ AcpiNsLoadNamespace ( ACPI_STATUS AcpiNsLoadTable ( - ACPI_NATIVE_UINT TableIndex, + UINT32 TableIndex, ACPI_NAMESPACE_NODE *Node); @@ -198,13 +198,13 @@ AcpiNsGetNextNode ( */ ACPI_STATUS AcpiNsParseTable ( - ACPI_NATIVE_UINT TableIndex, + UINT32 TableIndex, ACPI_NAMESPACE_NODE *StartNode); ACPI_STATUS AcpiNsOneCompleteParse ( - ACPI_NATIVE_UINT PassNumber, - ACPI_NATIVE_UINT TableIndex, + UINT32 PassNumber, + UINT32 TableIndex, ACPI_NAMESPACE_NODE *StartNode); @@ -342,7 +342,7 @@ AcpiNsPatternMatch ( ACPI_STATUS AcpiNsGetNode ( ACPI_NAMESPACE_NODE *PrefixNode, - char *ExternalPathname, + const char *ExternalPathname, UINT32 Flags, ACPI_NAMESPACE_NODE **OutNode); @@ -431,24 +431,24 @@ AcpiNsLocal ( void AcpiNsReportError ( - char *ModuleName, + const char *ModuleName, UINT32 LineNumber, - char *InternalName, + const char *InternalName, ACPI_STATUS LookupStatus); void AcpiNsReportMethodError ( - char *ModuleName, + const char *ModuleName, UINT32 LineNumber, - char *Message, + const char *Message, ACPI_NAMESPACE_NODE *Node, - char *Path, + const char *Path, ACPI_STATUS LookupStatus); void AcpiNsPrintNodePathname ( ACPI_NAMESPACE_NODE *Node, - char *Msg); + const char *Msg); ACPI_STATUS AcpiNsBuildInternalName ( @@ -460,13 +460,13 @@ AcpiNsGetInternalNameLength ( ACPI_STATUS AcpiNsInternalizeName ( - char *DottedName, + const char *DottedName, char **ConvertedName); ACPI_STATUS AcpiNsExternalizeName ( UINT32 InternalNameLength, - char *InternalName, + const char *InternalName, UINT32 *ConvertedNameLength, char **ConvertedName); diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acpiosxf.h b/src/add-ons/kernel/bus_managers/acpi/include/acpiosxf.h index 5aea1d3379..d3fb8074eb 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acpiosxf.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acpiosxf.h @@ -274,7 +274,7 @@ AcpiOsFree ( void * AcpiOsMapMemory ( ACPI_PHYSICAL_ADDRESS Where, - ACPI_NATIVE_UINT Length); + ACPI_SIZE Length); void AcpiOsUnmapMemory ( diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acpixf.h b/src/add-ons/kernel/bus_managers/acpi/include/acpixf.h index 5577c6df79..364e9c89ea 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acpixf.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acpixf.h @@ -205,7 +205,7 @@ AcpiReallocateRootTable ( ACPI_STATUS AcpiFindRootPointer ( - ACPI_NATIVE_UINT *RsdpAddress); + ACPI_SIZE *RsdpAddress); ACPI_STATUS AcpiLoadTables ( @@ -214,18 +214,18 @@ AcpiLoadTables ( ACPI_STATUS AcpiGetTableHeader ( ACPI_STRING Signature, - ACPI_NATIVE_UINT Instance, + UINT32 Instance, ACPI_TABLE_HEADER *OutTableHeader); ACPI_STATUS AcpiGetTable ( ACPI_STRING Signature, - ACPI_NATIVE_UINT Instance, + UINT32 Instance, ACPI_TABLE_HEADER **OutTable); ACPI_STATUS AcpiGetTableByIndex ( - ACPI_NATIVE_UINT TableIndex, + UINT32 TableIndex, ACPI_TABLE_HEADER **OutTable); ACPI_STATUS @@ -524,6 +524,11 @@ AcpiGetRegister ( UINT32 RegisterId, UINT32 *ReturnValue); +ACPI_STATUS +AcpiGetRegisterUnlocked ( + UINT32 RegisterId, + UINT32 *ReturnValue); + ACPI_STATUS AcpiSetRegister ( UINT32 RegisterId, diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acstruct.h b/src/add-ons/kernel/bus_managers/acpi/include/acstruct.h index 8af7456ff2..f01f73455c 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acstruct.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acstruct.h @@ -184,7 +184,6 @@ typedef struct acpi_walk_state union acpi_operand_object **CallerReturnDesc; ACPI_GENERIC_STATE *ControlState; /* List of control states (nested IFs) */ struct acpi_namespace_node *DeferredNode; /* Used when executing deferred opcodes */ - struct acpi_gpe_event_info *GpeEventInfo; /* Info for GPE (_Lxx/_Exx methods only */ union acpi_operand_object *ImplicitReturnObj; struct acpi_namespace_node *MethodCallNode; /* Called method Node*/ ACPI_PARSE_OBJECT *MethodCallOp; /* MethodCall Op if running a method */ @@ -222,7 +221,7 @@ typedef struct acpi_init_walk_info UINT16 PackageInit; UINT16 ObjectCount; ACPI_OWNER_ID OwnerId; - ACPI_NATIVE_UINT TableIndex; + UINT32 TableIndex; } ACPI_INIT_WALK_INFO; @@ -280,18 +279,13 @@ typedef struct acpi_evaluate_info ACPI_OPERAND_OBJECT **Parameters; ACPI_NAMESPACE_NODE *ResolvedNode; ACPI_OPERAND_OBJECT *ReturnObject; + UINT8 ParamCount; UINT8 PassNumber; - UINT8 ParameterType; UINT8 ReturnObjectType; UINT8 Flags; } ACPI_EVALUATE_INFO; -/* Types for ParameterType above */ - -#define ACPI_PARAM_ARGS 0 -#define ACPI_PARAM_GPE 1 - /* Values for Flags above */ #define ACPI_IGNORE_RETURN_VALUE 1 diff --git a/src/add-ons/kernel/bus_managers/acpi/include/actables.h b/src/add-ons/kernel/bus_managers/acpi/include/actables.h index 07390241a8..93cc7907c6 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/actables.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/actables.h @@ -127,7 +127,7 @@ AcpiAllocateRootTable ( */ void AcpiTbParseFadt ( - ACPI_NATIVE_UINT TableIndex, + UINT32 TableIndex, UINT8 Flags); void @@ -144,7 +144,7 @@ AcpiTbFindTable ( char *Signature, char *OemId, char *OemTableId, - ACPI_NATIVE_UINT *TableIndex); + UINT32 *TableIndex); /* @@ -161,7 +161,7 @@ AcpiTbVerifyTable ( ACPI_STATUS AcpiTbAddTable ( ACPI_TABLE_DESC *TableDesc, - ACPI_NATIVE_UINT *TableIndex); + UINT32 *TableIndex); ACPI_STATUS AcpiTbStoreTable ( @@ -169,7 +169,7 @@ AcpiTbStoreTable ( ACPI_TABLE_HEADER *Table, UINT32 Length, UINT8 Flags, - ACPI_NATIVE_UINT *TableIndex); + UINT32 *TableIndex); void AcpiTbDeleteTable ( @@ -181,28 +181,28 @@ AcpiTbTerminate ( void AcpiTbDeleteNamespaceByOwner ( - ACPI_NATIVE_UINT TableIndex); + UINT32 TableIndex); ACPI_STATUS AcpiTbAllocateOwnerId ( - ACPI_NATIVE_UINT TableIndex); + UINT32 TableIndex); ACPI_STATUS AcpiTbReleaseOwnerId ( - ACPI_NATIVE_UINT TableIndex); + UINT32 TableIndex); ACPI_STATUS AcpiTbGetOwnerId ( - ACPI_NATIVE_UINT TableIndex, + UINT32 TableIndex, ACPI_OWNER_ID *OwnerId); BOOLEAN AcpiTbIsTableLoaded ( - ACPI_NATIVE_UINT TableIndex); + UINT32 TableIndex); void AcpiTbSetTableLoadedFlag ( - ACPI_NATIVE_UINT TableIndex, + UINT32 TableIndex, BOOLEAN IsLoaded); @@ -221,7 +221,7 @@ AcpiTbPrintTableHeader( UINT8 AcpiTbChecksum ( UINT8 *Buffer, - ACPI_NATIVE_UINT Length); + UINT32 Length); ACPI_STATUS AcpiTbVerifyChecksum ( @@ -233,7 +233,7 @@ AcpiTbInstallTable ( ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, char *Signature, - ACPI_NATIVE_UINT TableIndex); + UINT32 TableIndex); ACPI_STATUS AcpiTbParseRootTable ( diff --git a/src/add-ons/kernel/bus_managers/acpi/include/actbl1.h b/src/add-ons/kernel/bus_managers/acpi/include/actbl1.h index 34c20997bd..339e1abfc1 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/actbl1.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/actbl1.h @@ -423,6 +423,7 @@ typedef struct acpi_table_dbgp /******************************************************************************* * * DMAR - DMA Remapping table + * From "Intel Virtualization Technology for Directed I/O", Sept. 2007 * ******************************************************************************/ @@ -430,18 +431,21 @@ typedef struct acpi_table_dmar { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT8 Width; /* Host Address Width */ - UINT8 Reserved[11]; + UINT8 Flags; + UINT8 Reserved[10]; } ACPI_TABLE_DMAR; +/* Flags */ + +#define ACPI_DMAR_INTR_REMAP (1) + /* DMAR subtable header */ typedef struct acpi_dmar_header { UINT16 Type; UINT16 Length; - UINT8 Flags; - UINT8 Reserved[3]; } ACPI_DMAR_HEADER; @@ -451,14 +455,16 @@ enum AcpiDmarType { ACPI_DMAR_TYPE_HARDWARE_UNIT = 0, ACPI_DMAR_TYPE_RESERVED_MEMORY = 1, - ACPI_DMAR_TYPE_RESERVED = 2 /* 2 and greater are reserved */ + ACPI_DMAR_TYPE_ATSR = 2, + ACPI_DMAR_TYPE_RESERVED = 3 /* 3 and greater are reserved */ }; typedef struct acpi_dmar_device_scope { UINT8 EntryType; UINT8 Length; - UINT8 Segment; + UINT16 Reserved; + UINT8 EnumerationId; UINT8 Bus; } ACPI_DMAR_DEVICE_SCOPE; @@ -470,9 +476,17 @@ enum AcpiDmarScopeType ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0, ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1, ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2, - ACPI_DMAR_SCOPE_TYPE_RESERVED = 3 /* 3 and greater are reserved */ + ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3, + ACPI_DMAR_SCOPE_TYPE_HPET = 4, + ACPI_DMAR_SCOPE_TYPE_RESERVED = 5 /* 5 and greater are reserved */ }; +typedef struct acpi_dmar_pci_path +{ + UINT8 Device; + UINT8 Function; + +} ACPI_DMAR_PCI_PATH; /* * DMAR Sub-tables, correspond to Type in ACPI_DMAR_HEADER @@ -483,6 +497,9 @@ enum AcpiDmarScopeType typedef struct acpi_dmar_hardware_unit { ACPI_DMAR_HEADER Header; + UINT8 Flags; + UINT8 Reserved; + UINT16 Segment; UINT64 Address; /* Register Base Address */ } ACPI_DMAR_HARDWARE_UNIT; @@ -496,7 +513,9 @@ typedef struct acpi_dmar_hardware_unit typedef struct acpi_dmar_reserved_memory { ACPI_DMAR_HEADER Header; - UINT64 Address; /* 4K aligned base address */ + UINT16 Reserved; + UINT16 Segment; + UINT64 BaseAddress; /* 4K aligned base address */ UINT64 EndAddress; /* 4K aligned limit address */ } ACPI_DMAR_RESERVED_MEMORY; @@ -505,6 +524,21 @@ typedef struct acpi_dmar_reserved_memory #define ACPI_DMAR_ALLOW_ALL (1) +/* 2: Root Port ATS Capability Reporting Structure */ + +typedef struct acpi_dmar_atsr +{ + ACPI_DMAR_HEADER Header; + UINT8 Flags; + UINT8 Reserved; + UINT16 Segment; + +} ACPI_DMAR_ATSR; + +/* Flags */ + +#define ACPI_DMAR_ALL_PORTS (1) + /******************************************************************************* * @@ -1420,9 +1454,9 @@ typedef struct acpi_srat_mem_affinity UINT16 Reserved; /* Reserved, must be zero */ UINT64 BaseAddress; UINT64 Length; - UINT32 MemoryType; /* See acpi_address_range_id */ + UINT32 Reserved1; UINT32 Flags; - UINT64 Reserved1; /* Reserved, must be zero */ + UINT64 Reserved2; /* Reserved, must be zero */ } ACPI_SRAT_MEM_AFFINITY; @@ -1432,17 +1466,6 @@ typedef struct acpi_srat_mem_affinity #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */ #define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */ -/* Memory types */ - -enum acpi_address_range_id -{ - ACPI_ADDRESS_RANGE_MEMORY = 1, - ACPI_ADDRESS_RANGE_RESERVED = 2, - ACPI_ADDRESS_RANGE_ACPI = 3, - ACPI_ADDRESS_RANGE_NVS = 4, - ACPI_ADDRESS_RANGE_COUNT = 5 -}; - /******************************************************************************* * diff --git a/src/add-ons/kernel/bus_managers/acpi/include/actypes.h b/src/add-ons/kernel/bus_managers/acpi/include/actypes.h index e142534fea..c7baec6b27 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/actypes.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/actypes.h @@ -184,10 +184,10 @@ * usually used for memory allocation, efficient loop counters, and array * indexes. The types are similar to the size_t type in the C library and are * required because there is no C type that consistently represents the native - * data width. + * data width. ACPI_SIZE is needed because there is no guarantee that a + * kernel-level C library is present. * * ACPI_SIZE 16/32/64-bit unsigned value - * ACPI_NATIVE_UINT 16/32/64-bit unsigned value * ACPI_NATIVE_INT 16/32/64-bit signed value * */ @@ -223,9 +223,9 @@ typedef int INT32; /*! [End] no source code translation !*/ -typedef UINT64 ACPI_NATIVE_UINT; typedef INT64 ACPI_NATIVE_INT; +typedef UINT64 ACPI_SIZE; typedef UINT64 ACPI_IO_ADDRESS; typedef UINT64 ACPI_PHYSICAL_ADDRESS; @@ -264,9 +264,9 @@ typedef int INT32; /*! [End] no source code translation !*/ -typedef UINT32 ACPI_NATIVE_UINT; typedef INT32 ACPI_NATIVE_INT; +typedef UINT32 ACPI_SIZE; typedef UINT32 ACPI_IO_ADDRESS; typedef UINT32 ACPI_PHYSICAL_ADDRESS; @@ -281,11 +281,6 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS; #endif -/* Variable-width type, used instead of clib size_t */ - -typedef ACPI_NATIVE_UINT ACPI_SIZE; - - /******************************************************************************* * * OS-dependent and compiler-dependent types @@ -300,7 +295,7 @@ typedef ACPI_NATIVE_UINT ACPI_SIZE; /* Value returned by AcpiOsGetThreadId */ #ifndef ACPI_THREAD_ID -#define ACPI_THREAD_ID ACPI_NATIVE_UINT +#define ACPI_THREAD_ID ACPI_SIZE #endif /* Object returned from AcpiOsCreateLock */ @@ -312,7 +307,7 @@ typedef ACPI_NATIVE_UINT ACPI_SIZE; /* Flags for AcpiOsAcquireLock/AcpiOsReleaseLock */ #ifndef ACPI_CPU_FLAGS -#define ACPI_CPU_FLAGS ACPI_NATIVE_UINT +#define ACPI_CPU_FLAGS ACPI_SIZE #endif /* Object returned from AcpiOsCreateCache */ diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acutils.h b/src/add-ons/kernel/bus_managers/acpi/include/acutils.h index 8c5c1f19b2..953d7d767d 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acutils.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acutils.h @@ -1,7 +1,7 @@ /****************************************************************************** * * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures - * $Revision: 1.203 $ + * $Revision: 1.204 $ * *****************************************************************************/ @@ -320,7 +320,7 @@ AcpiUtMemcpy ( void * AcpiUtMemset ( void *Dest, - ACPI_NATIVE_UINT Value, + UINT8 Value, ACPI_SIZE Count); int @@ -417,14 +417,14 @@ void AcpiUtTrace ( UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId); void AcpiUtTracePtr ( UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId, void *Pointer); @@ -432,7 +432,7 @@ void AcpiUtTraceU32 ( UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId, UINT32 Integer); @@ -440,7 +440,7 @@ void AcpiUtTraceStr ( UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId, char *String); @@ -448,14 +448,14 @@ void AcpiUtExit ( UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId); void AcpiUtStatusExit ( UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId, ACPI_STATUS Status); @@ -463,7 +463,7 @@ void AcpiUtValueExit ( UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId, ACPI_INTEGER Value); @@ -471,7 +471,7 @@ void AcpiUtPtrExit ( UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId, UINT8 *Ptr); @@ -510,9 +510,9 @@ AcpiUtDebugPrint ( UINT32 RequestedDebugLevel, UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId, - char *Format, + const char *Format, ...) ACPI_PRINTF_LIKE(6); void ACPI_INTERNAL_VAR_XFACE @@ -520,38 +520,38 @@ AcpiUtDebugPrintRaw ( UINT32 RequestedDebugLevel, UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId, - char *Format, + const char *Format, ...) ACPI_PRINTF_LIKE(6); void ACPI_INTERNAL_VAR_XFACE AcpiUtError ( - char *ModuleName, + const char *ModuleName, UINT32 LineNumber, - char *Format, + const char *Format, ...) ACPI_PRINTF_LIKE(3); void ACPI_INTERNAL_VAR_XFACE AcpiUtException ( - char *ModuleName, + const char *ModuleName, UINT32 LineNumber, ACPI_STATUS Status, - char *Format, + const char *Format, ...) ACPI_PRINTF_LIKE(4); void ACPI_INTERNAL_VAR_XFACE AcpiUtWarning ( - char *ModuleName, + const char *ModuleName, UINT32 LineNumber, - char *Format, + const char *Format, ...) ACPI_PRINTF_LIKE(3); void ACPI_INTERNAL_VAR_XFACE AcpiUtInfo ( - char *ModuleName, + const char *ModuleName, UINT32 LineNumber, - char *Format, + const char *Format, ...) ACPI_PRINTF_LIKE(3); @@ -630,14 +630,14 @@ AcpiUtExecute_Sxds ( */ ACPI_OPERAND_OBJECT * AcpiUtCreateInternalObjectDbg ( - char *ModuleName, + const char *ModuleName, UINT32 LineNumber, UINT32 ComponentId, ACPI_OBJECT_TYPE Type); void * AcpiUtAllocateObjectDescDbg ( - char *ModuleName, + const char *ModuleName, UINT32 LineNumber, UINT32 ComponentId); @@ -780,14 +780,14 @@ BOOLEAN AcpiUtValidAcpiName ( UINT32 Name); -ACPI_NAME +void AcpiUtRepairName ( char *Name); BOOLEAN AcpiUtValidAcpiChar ( char Character, - ACPI_NATIVE_UINT Position); + UINT32 Position); ACPI_STATUS AcpiUtStrtoul64 ( @@ -897,14 +897,14 @@ void * AcpiUtAllocate ( ACPI_SIZE Size, UINT32 Component, - char *Module, + const char *Module, UINT32 Line); void * AcpiUtAllocateZeroed ( ACPI_SIZE Size, UINT32 Component, - char *Module, + const char *Module, UINT32 Line); #ifdef ACPI_DBG_TRACK_ALLOCATIONS @@ -912,21 +912,21 @@ void * AcpiUtAllocateAndTrack ( ACPI_SIZE Size, UINT32 Component, - char *Module, + const char *Module, UINT32 Line); void * AcpiUtAllocateZeroedAndTrack ( ACPI_SIZE Size, UINT32 Component, - char *Module, + const char *Module, UINT32 Line); void AcpiUtFreeAndTrack ( void *Address, UINT32 Component, - char *Module, + const char *Module, UINT32 Line); void @@ -936,7 +936,7 @@ AcpiUtDumpAllocationInfo ( void AcpiUtDumpAllocations ( UINT32 Component, - char *Module); + const char *Module); ACPI_STATUS AcpiUtCreateList ( diff --git a/src/add-ons/kernel/bus_managers/acpi/include/platform/acdos16.h b/src/add-ons/kernel/bus_managers/acpi/include/platform/acdos16.h deleted file mode 100644 index f3aead6084..0000000000 --- a/src/add-ons/kernel/bus_managers/acpi/include/platform/acdos16.h +++ /dev/null @@ -1,164 +0,0 @@ -/****************************************************************************** - * - * Name: acdos16.h - DOS specific defines, etc. - * $Revision: 1.18 $ - * - *****************************************************************************/ - -/****************************************************************************** - * - * 1. Copyright Notice - * - * Some or all of this work - Copyright (c) 1999 - 2008, 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 __ACDOS16_H__ -#define __ACDOS16_H__ - - -/* NOTE: 16-bit ACPICA is no longer supported, December 2006 */ - -#define ACPI_USE_STANDARD_HEADERS -#define ACPI_MACHINE_WIDTH 16 - -/* Use a struct for 64-bit integers */ - -typedef struct -{ - unsigned long Lo; - unsigned long Hi; - -} COMPILER_DEPENDENT_UINT64; - -typedef struct -{ - long Lo; - long Hi; - -} COMPILER_DEPENDENT_INT64; - -/* - * Calling conventions: - * - * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) - * ACPI_EXTERNAL_XFACE - External ACPI interfaces - * ACPI_INTERNAL_XFACE - Internal ACPI interfaces - * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces - */ -#define ACPI_SYSTEM_XFACE __cdecl -#define ACPI_EXTERNAL_XFACE -#define ACPI_INTERNAL_XFACE -#define ACPI_INTERNAL_VAR_XFACE __cdecl - -#define ACPI_ASM_MACROS -#define BREAKPOINT3 -#define ACPI_DISABLE_IRQS() -#define ACPI_ENABLE_IRQS() -#define halt() -#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) -#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) - - -#endif /* __ACDOS16_H__ */ diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsdump.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsdump.c index 1b536c0509..7e029442de 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsdump.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsdump.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: nsdump - table dumping routines for debug - * $Revision: 1.184 $ + * $Revision: 1.185 $ * *****************************************************************************/ @@ -160,7 +160,7 @@ AcpiNsPrintPathname ( UINT32 NumSegments, char *Pathname) { - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_FUNCTION_NAME (NsPrintPathname); @@ -311,14 +311,6 @@ AcpiNsDumpOneObject ( ACPI_WARNING ((AE_INFO, "Invalid ACPI Object Type %08X", Type)); } - if (!AcpiUtValidAcpiName (ThisNode->Name.Integer)) - { - ThisNode->Name.Integer = AcpiUtRepairName (ThisNode->Name.Ascii); - - ACPI_WARNING ((AE_INFO, "Invalid ACPI Name %08X", - ThisNode->Name.Integer)); - } - AcpiOsPrintf ("%4.4s", AcpiUtGetNodeName (ThisNode)); } @@ -617,13 +609,13 @@ AcpiNsDumpOneObject ( if (ObjType > ACPI_TYPE_LOCAL_MAX) { - AcpiOsPrintf ("(Ptr to ACPI Object type %X [UNKNOWN])\n", + AcpiOsPrintf ("(Pointer to ACPI Object type %.2X [UNKNOWN])\n", ObjType); BytesToDump = 32; } else { - AcpiOsPrintf ("(Ptr to ACPI Object type %X [%s])\n", + AcpiOsPrintf ("(Pointer to ACPI Object type %.2X [%s])\n", ObjType, AcpiUtGetTypeName (ObjType)); BytesToDump = sizeof (ACPI_OPERAND_OBJECT); } diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nseval.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nseval.c index 9eb0e75925..8d1196c20a 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nseval.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nseval.c @@ -221,6 +221,38 @@ AcpiNsEvaluate ( return_ACPI_STATUS (AE_NULL_OBJECT); } + /* Calculate the number of arguments being passed to the method */ + + Info->ParamCount = 0; + if (Info->Parameters) + { + while (Info->Parameters[Info->ParamCount]) + { + Info->ParamCount++; + } + } + + /* Error if too few arguments were passed in */ + + if (Info->ParamCount < Info->ObjDesc->Method.ParamCount) + { + ACPI_ERROR ((AE_INFO, + "Insufficient arguments - method [%4.4s] needs %d, found %d", + AcpiUtGetNodeName (Info->ResolvedNode), + Info->ObjDesc->Method.ParamCount, Info->ParamCount)); + return_ACPI_STATUS (AE_MISSING_ARGUMENTS); + } + + /* Just a warning if too many arguments */ + + else if (Info->ParamCount > Info->ObjDesc->Method.ParamCount) + { + ACPI_WARNING ((AE_INFO, + "Excess arguments - method [%4.4s] needs %d, found %d", + AcpiUtGetNodeName (Info->ResolvedNode), + Info->ObjDesc->Method.ParamCount, Info->ParamCount)); + } + ACPI_DUMP_PATHNAME (Info->ResolvedNode, "Execute Method:", ACPI_LV_INFO, _COMPONENT); diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsinit.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsinit.c index 0c4e20082a..e0116e0eb0 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsinit.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsinit.c @@ -666,7 +666,6 @@ AcpiNsInitOneDevice ( Info->PrefixNode = DeviceNode; Info->Pathname = METHOD_NAME__INI; Info->Parameters = NULL; - Info->ParameterType = ACPI_PARAM_ARGS; Info->Flags = ACPI_IGNORE_RETURN_VALUE; Status = AcpiNsEvaluate (Info); diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsload.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsload.c index c1f879d578..8e11306105 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsload.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsload.c @@ -154,7 +154,7 @@ AcpiNsDeleteSubtree ( ACPI_STATUS AcpiNsLoadTable ( - ACPI_NATIVE_UINT TableIndex, + UINT32 TableIndex, ACPI_NAMESPACE_NODE *Node) { ACPI_STATUS Status; diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsparse.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsparse.c index 4faab91773..2bd28decfa 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsparse.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsparse.c @@ -142,13 +142,13 @@ ACPI_STATUS AcpiNsOneCompleteParse ( - ACPI_NATIVE_UINT PassNumber, - ACPI_NATIVE_UINT TableIndex, + UINT32 PassNumber, + UINT32 TableIndex, ACPI_NAMESPACE_NODE *StartNode) { ACPI_PARSE_OBJECT *ParseRoot; ACPI_STATUS Status; - ACPI_NATIVE_UINT AmlLength; + UINT32 AmlLength; UINT8 *AmlStart; ACPI_WALK_STATE *WalkState; ACPI_TABLE_HEADER *Table; @@ -200,7 +200,7 @@ AcpiNsOneCompleteParse ( AmlStart = (UINT8 *) Table + sizeof (ACPI_TABLE_HEADER); AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER); Status = AcpiDsInitAmlWalk (WalkState, ParseRoot, NULL, - AmlStart, (UINT32) AmlLength, NULL, (UINT8) PassNumber); + AmlStart, AmlLength, NULL, (UINT8) PassNumber); } if (ACPI_FAILURE (Status)) @@ -247,7 +247,7 @@ Cleanup: ACPI_STATUS AcpiNsParseTable ( - ACPI_NATIVE_UINT TableIndex, + UINT32 TableIndex, ACPI_NAMESPACE_NODE *StartNode) { ACPI_STATUS Status; diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nssearch.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nssearch.c index 2b94b61c88..223e0e9521 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nssearch.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nssearch.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: nssearch - Namespace search - * $Revision: 1.122 $ + * $Revision: 1.123 $ * ******************************************************************************/ @@ -408,25 +408,7 @@ AcpiNsSearchAndEnter ( * this problem, and we want to be able to enable ACPI support for them, * even though there are a few bad names. */ - if (!AcpiUtValidAcpiName (TargetName)) - { - TargetName = AcpiUtRepairName (ACPI_CAST_PTR (char, &TargetName)); - - /* Report warning only if in strict mode or debug mode */ - - if (!AcpiGbl_EnableInterpreterSlack) - { - ACPI_WARNING ((AE_INFO, - "Found bad character(s) in name, repaired: [%4.4s]\n", - ACPI_CAST_PTR (char, &TargetName))); - } - else - { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, - "Found bad character(s) in name, repaired: [%4.4s]\n", - ACPI_CAST_PTR (char, &TargetName))); - } - } + AcpiUtRepairName (ACPI_CAST_PTR (char, &TargetName)); /* Try to find the name in the namespace level specified by the caller */ diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsutils.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsutils.c index 0eab329643..1c508a6afe 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsutils.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsutils.c @@ -154,9 +154,9 @@ AcpiNsFindParentName ( void AcpiNsReportError ( - char *ModuleName, + const char *ModuleName, UINT32 LineNumber, - char *InternalName, + const char *InternalName, ACPI_STATUS LookupStatus) { ACPI_STATUS Status; @@ -221,11 +221,11 @@ AcpiNsReportError ( void AcpiNsReportMethodError ( - char *ModuleName, + const char *ModuleName, UINT32 LineNumber, - char *Message, + const char *Message, ACPI_NAMESPACE_NODE *PrefixNode, - char *Path, + const char *Path, ACPI_STATUS MethodStatus) { ACPI_STATUS Status; @@ -264,7 +264,7 @@ AcpiNsReportMethodError ( void AcpiNsPrintNodePathname ( ACPI_NAMESPACE_NODE *Node, - char *Message) + const char *Message) { ACPI_BUFFER Buffer; ACPI_STATUS Status; @@ -415,7 +415,7 @@ void AcpiNsGetInternalNameLength ( ACPI_NAMESTRING_INFO *Info) { - char *NextExternalChar; + const char *NextExternalChar; UINT32 i; @@ -494,9 +494,9 @@ AcpiNsBuildInternalName ( { UINT32 NumSegments = Info->NumSegments; char *InternalName = Info->InternalName; - char *ExternalName = Info->NextExternalChar; + const char *ExternalName = Info->NextExternalChar; char *Result = NULL; - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_FUNCTION_TRACE (NsBuildInternalName); @@ -546,13 +546,13 @@ AcpiNsBuildInternalName ( else if (NumSegments == 2) { InternalName[i] = AML_DUAL_NAME_PREFIX; - Result = &InternalName[(ACPI_NATIVE_UINT) (i+1)]; + Result = &InternalName[(ACPI_SIZE) i+1]; } else { InternalName[i] = AML_MULTI_NAME_PREFIX_OP; - InternalName[(ACPI_NATIVE_UINT) (i+1)] = (char) NumSegments; - Result = &InternalName[(ACPI_NATIVE_UINT) (i+2)]; + InternalName[(ACPI_SIZE) i+1] = (char) NumSegments; + Result = &InternalName[(ACPI_SIZE) i+2]; } } @@ -628,7 +628,7 @@ AcpiNsBuildInternalName ( ACPI_STATUS AcpiNsInternalizeName ( - char *ExternalName, + const char *ExternalName, char **ConvertedName) { char *InternalName; @@ -694,16 +694,16 @@ AcpiNsInternalizeName ( ACPI_STATUS AcpiNsExternalizeName ( UINT32 InternalNameLength, - char *InternalName, + const char *InternalName, UINT32 *ConvertedNameLength, char **ConvertedName) { - ACPI_NATIVE_UINT NamesIndex = 0; - ACPI_NATIVE_UINT NumSegments = 0; - ACPI_NATIVE_UINT RequiredLength; - ACPI_NATIVE_UINT PrefixLength = 0; - ACPI_NATIVE_UINT i = 0; - ACPI_NATIVE_UINT j = 0; + UINT32 NamesIndex = 0; + UINT32 NumSegments = 0; + UINT32 RequiredLength; + UINT32 PrefixLength = 0; + UINT32 i = 0; + UINT32 j = 0; ACPI_FUNCTION_TRACE (NsExternalizeName); @@ -762,8 +762,8 @@ AcpiNsExternalizeName ( /* 4-byte names */ NamesIndex = PrefixLength + 2; - NumSegments = (ACPI_NATIVE_UINT) (UINT8) - InternalName[(ACPI_NATIVE_UINT) (PrefixLength + 1)]; + NumSegments = (UINT8) + InternalName[(ACPI_SIZE) PrefixLength + 1]; break; case AML_DUAL_NAME_PREFIX: @@ -1033,7 +1033,7 @@ AcpiNsOpensScope ( ACPI_STATUS AcpiNsGetNode ( ACPI_NAMESPACE_NODE *PrefixNode, - char *Pathname, + const char *Pathname, UINT32 Flags, ACPI_NAMESPACE_NODE **ReturnNode) { diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsxfeval.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsxfeval.c index d5e086386b..85b40693e8 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsxfeval.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsxfeval.c @@ -272,7 +272,6 @@ AcpiEvaluateObject ( } Info->Pathname = Pathname; - Info->ParameterType = ACPI_PARAM_ARGS; /* Convert and validate the device handle */ @@ -556,7 +555,7 @@ AcpiNsGetDeviceCallback ( UINT32 Flags; ACPI_DEVICE_ID Hid; ACPI_COMPATIBLE_ID_LIST *Cid; - ACPI_NATIVE_UINT i; + UINT32 i; BOOLEAN Found; diff --git a/src/add-ons/kernel/bus_managers/acpi/oshaiku.c b/src/add-ons/kernel/bus_managers/acpi/oshaiku.c index 1186161538..b513071ccb 100644 --- a/src/add-ons/kernel/bus_managers/acpi/oshaiku.c +++ b/src/add-ons/kernel/bus_managers/acpi/oshaiku.c @@ -200,7 +200,7 @@ ACPI_PHYSICAL_ADDRESS AcpiOsGetRootPointer (void) { #ifdef _KERNEL_MODE - ACPI_NATIVE_UINT address; + ACPI_SIZE address; ACPI_STATUS status; if (acpi_root == 0) { status = AcpiFindRootPointer(&address); @@ -500,7 +500,7 @@ AcpiOsGetLine ( void * AcpiOsMapMemory ( ACPI_PHYSICAL_ADDRESS where, - ACPI_NATIVE_UINT length) + ACPI_SIZE length) { #ifdef _KERNEL_MODE diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/parser/psargs.c b/src/add-ons/kernel/bus_managers/acpi/parser/psargs.c similarity index 99% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/parser/psargs.c rename to src/add-ons/kernel/bus_managers/acpi/parser/psargs.c index 6e9bf9d6ca..c32543c1c3 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/parser/psargs.c +++ b/src/add-ons/kernel/bus_managers/acpi/parser/psargs.c @@ -156,7 +156,7 @@ AcpiPsGetNextPackageLength ( { UINT8 *Aml = ParserState->Aml; UINT32 PackageLength = 0; - ACPI_NATIVE_UINT ByteCount; + UINT32 ByteCount; UINT8 ByteZeroMask = 0x3F; /* Default [0:5] */ @@ -168,7 +168,7 @@ AcpiPsGetNextPackageLength ( * used to encode the package length, either 0,1,2, or 3 */ ByteCount = (Aml[0] >> 6); - ParserState->Aml += (ByteCount + 1); + ParserState->Aml += ((ACPI_SIZE) ByteCount + 1); /* Get bytes 3, 2, 1 as needed */ @@ -371,7 +371,7 @@ AcpiPsGetNextNamepath ( PossibleMethodCall && (Node->Type == ACPI_TYPE_METHOD)) { - if (WalkState->Op->Common.AmlOpcode == AML_UNLOAD_OP) + if (WalkState->Opcode == AML_UNLOAD_OP) { /* * AcpiPsGetNextNamestring has increased the AML pointer, @@ -831,7 +831,7 @@ AcpiPsGetNextArg ( /* To support SuperName arg of Unload */ - if (WalkState->Op->Common.AmlOpcode == AML_UNLOAD_OP) + if (WalkState->Opcode == AML_UNLOAD_OP) { Status = AcpiPsGetNextNamepath (WalkState, ParserState, Arg, 1); diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/parser/psloop.c b/src/add-ons/kernel/bus_managers/acpi/parser/psloop.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/parser/psloop.c rename to src/add-ons/kernel/bus_managers/acpi/parser/psloop.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/parser/psopcode.c b/src/add-ons/kernel/bus_managers/acpi/parser/psopcode.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/parser/psopcode.c rename to src/add-ons/kernel/bus_managers/acpi/parser/psopcode.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/parser/psparse.c b/src/add-ons/kernel/bus_managers/acpi/parser/psparse.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/parser/psparse.c rename to src/add-ons/kernel/bus_managers/acpi/parser/psparse.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/parser/psscope.c b/src/add-ons/kernel/bus_managers/acpi/parser/psscope.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/parser/psscope.c rename to src/add-ons/kernel/bus_managers/acpi/parser/psscope.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/parser/pstree.c b/src/add-ons/kernel/bus_managers/acpi/parser/pstree.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/parser/pstree.c rename to src/add-ons/kernel/bus_managers/acpi/parser/pstree.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/parser/psutils.c b/src/add-ons/kernel/bus_managers/acpi/parser/psutils.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/parser/psutils.c rename to src/add-ons/kernel/bus_managers/acpi/parser/psutils.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/parser/pswalk.c b/src/add-ons/kernel/bus_managers/acpi/parser/pswalk.c similarity index 100% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/parser/pswalk.c rename to src/add-ons/kernel/bus_managers/acpi/parser/pswalk.c diff --git a/src/add-ons/kernel/bus_managers/acpi/interpreter/parser/psxface.c b/src/add-ons/kernel/bus_managers/acpi/parser/psxface.c similarity index 99% rename from src/add-ons/kernel/bus_managers/acpi/interpreter/parser/psxface.c rename to src/add-ons/kernel/bus_managers/acpi/parser/psxface.c index d1b5e8c67a..a68171397c 100644 --- a/src/add-ons/kernel/bus_managers/acpi/interpreter/parser/psxface.c +++ b/src/add-ons/kernel/bus_managers/acpi/parser/psxface.c @@ -453,11 +453,10 @@ AcpiPsUpdateParameterList ( ACPI_EVALUATE_INFO *Info, UINT16 Action) { - ACPI_NATIVE_UINT i; + UINT32 i; - if ((Info->ParameterType == ACPI_PARAM_ARGS) && - (Info->Parameters)) + if (Info->Parameters) { /* Update reference count for each parameter */ diff --git a/src/add-ons/kernel/bus_managers/acpi/resources/rscalc.c b/src/add-ons/kernel/bus_managers/acpi/resources/rscalc.c index 97dabe8287..01242b1937 100644 --- a/src/add-ons/kernel/bus_managers/acpi/resources/rscalc.c +++ b/src/add-ons/kernel/bus_managers/acpi/resources/rscalc.c @@ -158,7 +158,7 @@ static UINT8 AcpiRsCountSetBits ( UINT16 BitField) { - ACPI_NATIVE_UINT BitsSet; + UINT8 BitsSet; ACPI_FUNCTION_ENTRY (); @@ -171,7 +171,7 @@ AcpiRsCountSetBits ( BitField &= (UINT16) (BitField - 1); } - return ((UINT8) BitsSet); + return (BitsSet); } diff --git a/src/add-ons/kernel/bus_managers/acpi/resources/rscreate.c b/src/add-ons/kernel/bus_managers/acpi/resources/rscreate.c index b7c2b8196d..c6a0830cfa 100644 --- a/src/add-ons/kernel/bus_managers/acpi/resources/rscreate.c +++ b/src/add-ons/kernel/bus_managers/acpi/resources/rscreate.c @@ -271,9 +271,9 @@ AcpiRsCreatePciRoutingTable ( } /* - * Loop through the ACPI_INTERNAL_OBJECTS - Each object - * should be a package that in turn contains an - * ACPI_INTEGER Address, a UINT8 Pin, a Name and a UINT8 SourceIndex. + * Loop through the ACPI_INTERNAL_OBJECTS - Each object should be a + * package that in turn contains an ACPI_INTEGER Address, a UINT8 Pin, + * a Name, and a UINT8 SourceIndex. */ TopObjectList = PackageObject->Package.Elements; NumberOfElements = PackageObject->Package.Count; @@ -328,33 +328,44 @@ AcpiRsCreatePciRoutingTable ( /* 1) First subobject: Dereference the PRT.Address */ ObjDesc = SubObjectList[0]; - if (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_INTEGER) + if (ACPI_GET_OBJECT_TYPE (ObjDesc) != ACPI_TYPE_INTEGER) { - UserPrt->Address = ObjDesc->Integer.Value; - } - else - { - ACPI_ERROR ((AE_INFO, - "(PRT[%X].Address) Need Integer, found %s", + ACPI_ERROR ((AE_INFO, "(PRT[%X].Address) Need Integer, found %s", Index, AcpiUtGetObjectTypeName (ObjDesc))); return_ACPI_STATUS (AE_BAD_DATA); } + UserPrt->Address = ObjDesc->Integer.Value; + /* 2) Second subobject: Dereference the PRT.Pin */ ObjDesc = SubObjectList[1]; - if (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_INTEGER) + if (ACPI_GET_OBJECT_TYPE (ObjDesc) != ACPI_TYPE_INTEGER) { - UserPrt->Pin = (UINT32) ObjDesc->Integer.Value; - } - else - { - ACPI_ERROR ((AE_INFO, - "(PRT[%X].Pin) Need Integer, found %s", + ACPI_ERROR ((AE_INFO, "(PRT[%X].Pin) Need Integer, found %s", Index, AcpiUtGetObjectTypeName (ObjDesc))); return_ACPI_STATUS (AE_BAD_DATA); } + UserPrt->Pin = (UINT32) ObjDesc->Integer.Value; + + /* + * If the BIOS has erroneously reversed the _PRT SourceName (index 2) + * and the SourceIndex (index 3), fix it. _PRT is important enough to + * workaround this BIOS error. This also provides compatibility with + * other ACPI implementations. + */ + ObjDesc = SubObjectList[3]; + if (!ObjDesc || (ACPI_GET_OBJECT_TYPE (ObjDesc) != ACPI_TYPE_INTEGER)) + { + SubObjectList[3] = SubObjectList[2]; + SubObjectList[2] = ObjDesc; + + ACPI_WARNING ((AE_INFO, + "(PRT[%X].Source) SourceName and SourceIndex are reversed, fixed", + Index)); + } + /* * 3) Third subobject: Dereference the PRT.SourceName * The name may be unresolved (slack mode), so allow a null object @@ -430,11 +441,7 @@ AcpiRsCreatePciRoutingTable ( /* 4) Fourth subobject: Dereference the PRT.SourceIndex */ ObjDesc = SubObjectList[3]; - if (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_INTEGER) - { - UserPrt->SourceIndex = (UINT32) ObjDesc->Integer.Value; - } - else + if (ACPI_GET_OBJECT_TYPE (ObjDesc) != ACPI_TYPE_INTEGER) { ACPI_ERROR ((AE_INFO, "(PRT[%X].SourceIndex) Need Integer, found %s", @@ -442,6 +449,8 @@ AcpiRsCreatePciRoutingTable ( return_ACPI_STATUS (AE_BAD_DATA); } + UserPrt->SourceIndex = (UINT32) ObjDesc->Integer.Value; + /* Point to the next ACPI_OPERAND_OBJECT in the top level package */ TopObjectList++; diff --git a/src/add-ons/kernel/bus_managers/acpi/resources/rsmisc.c b/src/add-ons/kernel/bus_managers/acpi/resources/rsmisc.c index bd44cd6bd6..2b77b91cef 100644 --- a/src/add-ons/kernel/bus_managers/acpi/resources/rsmisc.c +++ b/src/add-ons/kernel/bus_managers/acpi/resources/rsmisc.c @@ -166,7 +166,7 @@ AcpiRsConvertAmlToResource ( ACPI_FUNCTION_TRACE (RsConvertAmlToResource); - if (((ACPI_NATIVE_UINT) Resource) & 0x3) + if (((ACPI_SIZE) Resource) & 0x3) { /* Each internal resource struct is expected to be 32-bit aligned */ diff --git a/src/add-ons/kernel/bus_managers/acpi/resources/rsutils.c b/src/add-ons/kernel/bus_managers/acpi/resources/rsutils.c index 807042b8c8..f324a74281 100644 --- a/src/add-ons/kernel/bus_managers/acpi/resources/rsutils.c +++ b/src/add-ons/kernel/bus_managers/acpi/resources/rsutils.c @@ -144,7 +144,7 @@ AcpiRsDecodeBitmask ( UINT16 Mask, UINT8 *List) { - ACPI_NATIVE_UINT i; + UINT8 i; UINT8 BitCount; @@ -157,7 +157,7 @@ AcpiRsDecodeBitmask ( { if (Mask & 0x0001) { - List[BitCount] = (UINT8) i; + List[BitCount] = i; BitCount++; } @@ -186,8 +186,8 @@ AcpiRsEncodeBitmask ( UINT8 *List, UINT8 Count) { - ACPI_NATIVE_UINT i; - ACPI_NATIVE_UINT Mask; + UINT32 i; + UINT16 Mask; ACPI_FUNCTION_ENTRY (); @@ -200,7 +200,7 @@ AcpiRsEncodeBitmask ( Mask |= (0x1 << List[i]); } - return ((UINT16) Mask); + return (Mask); } @@ -228,7 +228,7 @@ AcpiRsMoveData ( UINT16 ItemCount, UINT8 MoveType) { - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_FUNCTION_ENTRY (); @@ -824,7 +824,6 @@ AcpiRsSetSrsMethodData ( Info->PrefixNode = Node; Info->Pathname = METHOD_NAME__SRS; Info->Parameters = Args; - Info->ParameterType = ACPI_PARAM_ARGS; Info->Flags = ACPI_IGNORE_RETURN_VALUE; /* diff --git a/src/add-ons/kernel/bus_managers/acpi/tables/tbfadt.c b/src/add-ons/kernel/bus_managers/acpi/tables/tbfadt.c index 522f0f4a7e..ab911c740f 100644 --- a/src/add-ons/kernel/bus_managers/acpi/tables/tbfadt.c +++ b/src/add-ons/kernel/bus_managers/acpi/tables/tbfadt.c @@ -246,7 +246,7 @@ AcpiTbInitGenericAddress ( void AcpiTbParseFadt ( - ACPI_NATIVE_UINT TableIndex, + UINT32 TableIndex, UINT8 Flags) { UINT32 Length; @@ -378,9 +378,9 @@ static void AcpiTbConvertFadt ( void) { - UINT8 Pm1RegisterLength; - ACPI_GENERIC_ADDRESS *Target; - ACPI_NATIVE_UINT i; + UINT8 Pm1RegisterLength; + ACPI_GENERIC_ADDRESS *Target; + UINT32 i; /* Update the local FADT table header length */ @@ -487,7 +487,7 @@ AcpiTbValidateFadt ( UINT32 *Address32; ACPI_GENERIC_ADDRESS *Address64; UINT8 Length; - ACPI_NATIVE_UINT i; + UINT32 i; /* Examine all of the 64-bit extended address fields (X fields) */ diff --git a/src/add-ons/kernel/bus_managers/acpi/tables/tbfind.c b/src/add-ons/kernel/bus_managers/acpi/tables/tbfind.c index 4615505084..8fb4df1c0d 100644 --- a/src/add-ons/kernel/bus_managers/acpi/tables/tbfind.c +++ b/src/add-ons/kernel/bus_managers/acpi/tables/tbfind.c @@ -145,9 +145,9 @@ AcpiTbFindTable ( char *Signature, char *OemId, char *OemTableId, - ACPI_NATIVE_UINT *TableIndex) + UINT32 *TableIndex) { - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_STATUS Status; ACPI_TABLE_HEADER Header; diff --git a/src/add-ons/kernel/bus_managers/acpi/tables/tbinstal.c b/src/add-ons/kernel/bus_managers/acpi/tables/tbinstal.c index 24f4afb0ed..b7d2b869b9 100644 --- a/src/add-ons/kernel/bus_managers/acpi/tables/tbinstal.c +++ b/src/add-ons/kernel/bus_managers/acpi/tables/tbinstal.c @@ -193,10 +193,10 @@ AcpiTbVerifyTable ( ACPI_STATUS AcpiTbAddTable ( ACPI_TABLE_DESC *TableDesc, - ACPI_NATIVE_UINT *TableIndex) + UINT32 *TableIndex) { - ACPI_NATIVE_UINT i; - ACPI_NATIVE_UINT Length; + UINT32 i; + UINT32 Length; ACPI_STATUS Status = AE_OK; @@ -212,27 +212,13 @@ AcpiTbAddTable ( } } - /* The table must be either an SSDT or a PSDT */ - - if ((!ACPI_COMPARE_NAME (TableDesc->Pointer->Signature, ACPI_SIG_PSDT)) && - (!ACPI_COMPARE_NAME (TableDesc->Pointer->Signature, ACPI_SIG_SSDT))) - { - /* Check for a printable name */ - - if (AcpiUtValidAcpiName (*(UINT32 *) TableDesc->Pointer->Signature)) - { - ACPI_ERROR ((AE_INFO, - "Table has invalid signature [%4.4s], must be SSDT or PSDT", - TableDesc->Pointer->Signature)); - } - else - { - ACPI_ERROR ((AE_INFO, - "Table has invalid signature (0x%8.8X), must be SSDT or PSDT", - *(UINT32 *) TableDesc->Pointer->Signature)); - } - return_ACPI_STATUS (AE_BAD_SIGNATURE); - } + /* + * Originally, we checked the table signature for "SSDT" or "PSDT" here. + * Next, we added support for OEMx tables, signature "OEM". + * Valid tables were encountered with a null signature, so we've just + * given up on validating the signature, since it seems to be a waste + * of code. The original code was removed (05/2008). + */ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); @@ -316,8 +302,8 @@ AcpiTbResizeRootTableList ( /* Increase the Table Array size */ Tables = ACPI_ALLOCATE_ZEROED ( - (AcpiGbl_RootTableList.Size + ACPI_ROOT_TABLE_SIZE_INCREMENT) - * sizeof (ACPI_TABLE_DESC)); + ((ACPI_SIZE) AcpiGbl_RootTableList.Size + ACPI_ROOT_TABLE_SIZE_INCREMENT) + * sizeof (ACPI_TABLE_DESC)); if (!Tables) { ACPI_ERROR ((AE_INFO, "Could not allocate new root table array")); @@ -329,7 +315,7 @@ AcpiTbResizeRootTableList ( if (AcpiGbl_RootTableList.Tables) { ACPI_MEMCPY (Tables, AcpiGbl_RootTableList.Tables, - AcpiGbl_RootTableList.Size * sizeof (ACPI_TABLE_DESC)); + (ACPI_SIZE) AcpiGbl_RootTableList.Size * sizeof (ACPI_TABLE_DESC)); if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) { @@ -366,7 +352,7 @@ AcpiTbStoreTable ( ACPI_TABLE_HEADER *Table, UINT32 Length, UINT8 Flags, - ACPI_NATIVE_UINT *TableIndex) + UINT32 *TableIndex) { ACPI_STATUS Status = AE_OK; @@ -458,7 +444,7 @@ void AcpiTbTerminate ( void) { - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_FUNCTION_TRACE (TbTerminate); @@ -505,7 +491,7 @@ AcpiTbTerminate ( void AcpiTbDeleteNamespaceByOwner ( - ACPI_NATIVE_UINT TableIndex) + UINT32 TableIndex) { ACPI_OWNER_ID OwnerId; @@ -540,7 +526,7 @@ AcpiTbDeleteNamespaceByOwner ( ACPI_STATUS AcpiTbAllocateOwnerId ( - ACPI_NATIVE_UINT TableIndex) + UINT32 TableIndex) { ACPI_STATUS Status = AE_BAD_PARAMETER; @@ -574,7 +560,7 @@ AcpiTbAllocateOwnerId ( ACPI_STATUS AcpiTbReleaseOwnerId ( - ACPI_NATIVE_UINT TableIndex) + UINT32 TableIndex) { ACPI_STATUS Status = AE_BAD_PARAMETER; @@ -609,7 +595,7 @@ AcpiTbReleaseOwnerId ( ACPI_STATUS AcpiTbGetOwnerId ( - ACPI_NATIVE_UINT TableIndex, + UINT32 TableIndex, ACPI_OWNER_ID *OwnerId) { ACPI_STATUS Status = AE_BAD_PARAMETER; @@ -642,7 +628,7 @@ AcpiTbGetOwnerId ( BOOLEAN AcpiTbIsTableLoaded ( - ACPI_NATIVE_UINT TableIndex) + UINT32 TableIndex) { BOOLEAN IsLoaded = FALSE; @@ -674,7 +660,7 @@ AcpiTbIsTableLoaded ( void AcpiTbSetTableLoadedFlag ( - ACPI_NATIVE_UINT TableIndex, + UINT32 TableIndex, BOOLEAN IsLoaded) { diff --git a/src/add-ons/kernel/bus_managers/acpi/tables/tbutils.c b/src/add-ons/kernel/bus_managers/acpi/tables/tbutils.c index d4c283ad2a..ab21db646e 100644 --- a/src/add-ons/kernel/bus_managers/acpi/tables/tbutils.c +++ b/src/add-ons/kernel/bus_managers/acpi/tables/tbutils.c @@ -127,7 +127,7 @@ static ACPI_PHYSICAL_ADDRESS AcpiTbGetRootTableEntry ( UINT8 *TableEntry, - ACPI_NATIVE_UINT TableEntrySize); + UINT32 TableEntrySize); /******************************************************************************* @@ -267,7 +267,7 @@ AcpiTbVerifyChecksum ( UINT8 AcpiTbChecksum ( UINT8 *Buffer, - ACPI_NATIVE_UINT Length) + UINT32 Length) { UINT8 Sum = 0; UINT8 *End = Buffer + Length; @@ -303,7 +303,7 @@ AcpiTbInstallTable ( ACPI_PHYSICAL_ADDRESS Address, UINT8 Flags, char *Signature, - ACPI_NATIVE_UINT TableIndex) + UINT32 TableIndex) { ACPI_TABLE_HEADER *Table; @@ -377,7 +377,7 @@ UnmapAndExit: static ACPI_PHYSICAL_ADDRESS AcpiTbGetRootTableEntry ( UINT8 *TableEntry, - ACPI_NATIVE_UINT TableEntrySize) + UINT32 TableEntrySize) { UINT64 Address64; @@ -441,8 +441,8 @@ AcpiTbParseRootTable ( UINT8 Flags) { ACPI_TABLE_RSDP *Rsdp; - ACPI_NATIVE_UINT TableEntrySize; - ACPI_NATIVE_UINT i; + UINT32 TableEntrySize; + UINT32 i; UINT32 TableCount; ACPI_TABLE_HEADER *Table; ACPI_PHYSICAL_ADDRESS Address; diff --git a/src/add-ons/kernel/bus_managers/acpi/tables/tbxface.c b/src/add-ons/kernel/bus_managers/acpi/tables/tbxface.c index 3aa89dfc35..7e10ac221e 100644 --- a/src/add-ons/kernel/bus_managers/acpi/tables/tbxface.c +++ b/src/add-ons/kernel/bus_managers/acpi/tables/tbxface.c @@ -213,7 +213,7 @@ AcpiInitializeTables ( /* Root Table Array has been statically allocated by the host */ ACPI_MEMSET (InitialTableArray, 0, - InitialTableCount * sizeof (ACPI_TABLE_DESC)); + (ACPI_SIZE) InitialTableCount * sizeof (ACPI_TABLE_DESC)); AcpiGbl_RootTableList.Tables = InitialTableArray; AcpiGbl_RootTableList.Size = InitialTableCount; @@ -279,7 +279,8 @@ AcpiReallocateRootTable ( return_ACPI_STATUS (AE_SUPPORT); } - NewSize = (AcpiGbl_RootTableList.Count + ACPI_ROOT_TABLE_SIZE_INCREMENT) * + NewSize = ((ACPI_SIZE) AcpiGbl_RootTableList.Count + + ACPI_ROOT_TABLE_SIZE_INCREMENT) * sizeof (ACPI_TABLE_DESC); /* Create new array and copy the old array */ @@ -323,11 +324,11 @@ ACPI_EXPORT_SYMBOL (AcpiReallocateRootTable) ACPI_STATUS AcpiGetTableHeader ( char *Signature, - ACPI_NATIVE_UINT Instance, + UINT32 Instance, ACPI_TABLE_HEADER *OutTableHeader) { - ACPI_NATIVE_UINT i; - ACPI_NATIVE_UINT j; + UINT32 i; + UINT32 j; ACPI_TABLE_HEADER *Header; @@ -408,11 +409,11 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader) ACPI_STATUS AcpiGetTable ( char *Signature, - ACPI_NATIVE_UINT Instance, + UINT32 Instance, ACPI_TABLE_HEADER **OutTable) { - ACPI_NATIVE_UINT i; - ACPI_NATIVE_UINT j; + UINT32 i; + UINT32 j; ACPI_STATUS Status; @@ -469,7 +470,7 @@ ACPI_EXPORT_SYMBOL (AcpiGetTable) ACPI_STATUS AcpiGetTableByIndex ( - ACPI_NATIVE_UINT TableIndex, + UINT32 TableIndex, ACPI_TABLE_HEADER **Table) { ACPI_STATUS Status; @@ -534,7 +535,7 @@ AcpiTbLoadNamespace ( { ACPI_STATUS Status; ACPI_TABLE_HEADER *Table; - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_FUNCTION_TRACE (TbLoadNamespace); diff --git a/src/add-ons/kernel/bus_managers/acpi/tables/tbxfroot.c b/src/add-ons/kernel/bus_managers/acpi/tables/tbxfroot.c index 3740fcee93..0f971496e7 100644 --- a/src/add-ons/kernel/bus_managers/acpi/tables/tbxfroot.c +++ b/src/add-ons/kernel/bus_managers/acpi/tables/tbxfroot.c @@ -208,7 +208,7 @@ AcpiTbValidateRsdp ( ACPI_STATUS AcpiFindRootPointer ( - ACPI_NATIVE_UINT *TableAddress) + ACPI_SIZE *TableAddress) { UINT8 *TablePtr; UINT8 *MemRover; @@ -248,7 +248,7 @@ AcpiFindRootPointer ( * minimum of 1K length) */ TablePtr = AcpiOsMapMemory ( - (ACPI_NATIVE_UINT) PhysicalAddress, + (ACPI_PHYSICAL_ADDRESS) PhysicalAddress, ACPI_EBDA_WINDOW_SIZE); if (!TablePtr) { diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utalloc.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utalloc.c index 6026f62ba7..d251e12a0d 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utalloc.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utalloc.c @@ -408,7 +408,7 @@ void * AcpiUtAllocate ( ACPI_SIZE Size, UINT32 Component, - char *Module, + const char *Module, UINT32 Line) { void *Allocation; @@ -460,7 +460,7 @@ void * AcpiUtAllocateZeroed ( ACPI_SIZE Size, UINT32 Component, - char *Module, + const char *Module, UINT32 Line) { void *Allocation; diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utclib.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utclib.c index 5ccdf5c237..f4a9a370c1 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utclib.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utclib.c @@ -218,7 +218,7 @@ AcpiUtMemcpy ( void * AcpiUtMemset ( void *Dest, - ACPI_NATIVE_UINT Value, + UINT8 Value, ACPI_SIZE Count) { char *New = (char *) Dest; diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utcopy.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utcopy.c index 811d6f362f..fb987dceae 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utcopy.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utcopy.c @@ -680,7 +680,7 @@ AcpiUtCopyEpackageToIpackage ( ACPI_STATUS Status = AE_OK; ACPI_OPERAND_OBJECT *PackageObject; ACPI_OPERAND_OBJECT **PackageElements; - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_FUNCTION_TRACE (UtCopyEpackageToIpackage); @@ -709,7 +709,7 @@ AcpiUtCopyEpackageToIpackage ( { /* Truncate package and delete it */ - PackageObject->Package.Count = (UINT32) i; + PackageObject->Package.Count = i; PackageElements[i] = NULL; AcpiUtRemoveReference (PackageObject); return_ACPI_STATUS (Status); diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utdebug.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utdebug.c index 8e19a52902..70e4db8a2b 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utdebug.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utdebug.c @@ -252,9 +252,9 @@ AcpiUtDebugPrint ( UINT32 RequestedDebugLevel, UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId, - char *Format, + const char *Format, ...) { ACPI_THREAD_ID ThreadId; @@ -332,9 +332,9 @@ AcpiUtDebugPrintRaw ( UINT32 RequestedDebugLevel, UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId, - char *Format, + const char *Format, ...) { va_list args; @@ -374,7 +374,7 @@ void AcpiUtTrace ( UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId) { @@ -410,7 +410,7 @@ void AcpiUtTracePtr ( UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId, void *Pointer) { @@ -444,7 +444,7 @@ void AcpiUtTraceStr ( UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId, char *String) { @@ -479,7 +479,7 @@ void AcpiUtTraceU32 ( UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId, UINT32 Integer) { @@ -513,7 +513,7 @@ void AcpiUtExit ( UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId) { @@ -548,7 +548,7 @@ void AcpiUtStatusExit ( UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId, ACPI_STATUS Status) { @@ -595,7 +595,7 @@ void AcpiUtValueExit ( UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId, ACPI_INTEGER Value) { @@ -632,7 +632,7 @@ void AcpiUtPtrExit ( UINT32 LineNumber, const char *FunctionName, - char *ModuleName, + const char *ModuleName, UINT32 ComponentId, UINT8 *Ptr) { @@ -668,8 +668,8 @@ AcpiUtDumpBuffer2 ( UINT32 Count, UINT32 Display) { - ACPI_NATIVE_UINT i = 0; - ACPI_NATIVE_UINT j; + UINT32 i = 0; + UINT32 j; UINT32 Temp32; UINT8 BufChar; @@ -691,7 +691,7 @@ AcpiUtDumpBuffer2 ( { /* Print current offset */ - AcpiOsPrintf ("%6.4X: ", (UINT32) i); + AcpiOsPrintf ("%6.4X: ", i); /* Print 16 hex chars */ @@ -702,7 +702,7 @@ AcpiUtDumpBuffer2 ( /* Dump fill spaces */ AcpiOsPrintf ("%*s", ((Display * 2) + 1), " "); - j += (ACPI_NATIVE_UINT) Display; + j += Display; continue; } @@ -711,35 +711,35 @@ AcpiUtDumpBuffer2 ( case DB_BYTE_DISPLAY: default: /* Default is BYTE display */ - AcpiOsPrintf ("%02X ", Buffer[i + j]); + AcpiOsPrintf ("%02X ", Buffer[(ACPI_SIZE) i + j]); break; case DB_WORD_DISPLAY: - ACPI_MOVE_16_TO_32 (&Temp32, &Buffer[i + j]); + ACPI_MOVE_16_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]); AcpiOsPrintf ("%04X ", Temp32); break; case DB_DWORD_DISPLAY: - ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[i + j]); + ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]); AcpiOsPrintf ("%08X ", Temp32); break; case DB_QWORD_DISPLAY: - ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[i + j]); + ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]); AcpiOsPrintf ("%08X", Temp32); - ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[i + j + 4]); + ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j + 4]); AcpiOsPrintf ("%08X ", Temp32); break; } - j += (ACPI_NATIVE_UINT) Display; + j += Display; } /* @@ -755,7 +755,7 @@ AcpiUtDumpBuffer2 ( return; } - BufChar = Buffer[i + j]; + BufChar = Buffer[(ACPI_SIZE) i + j]; if (ACPI_IS_PRINT (BufChar)) { AcpiOsPrintf ("%c", BufChar); diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utdelete.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utdelete.c index 4679709045..7bb516f8b5 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utdelete.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utdelete.c @@ -557,7 +557,7 @@ AcpiUtUpdateObjectReference ( ACPI_GENERIC_STATE *StateList = NULL; ACPI_OPERAND_OBJECT *NextObject = NULL; ACPI_GENERIC_STATE *State; - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_FUNCTION_TRACE_PTR (UtUpdateObjectReference, Object); diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/uteval.c b/src/add-ons/kernel/bus_managers/acpi/utilities/uteval.c index 27a2a00724..ce81314520 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/uteval.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/uteval.c @@ -185,7 +185,7 @@ AcpiUtOsiImplementation ( ACPI_STATUS Status; ACPI_OPERAND_OBJECT *StringDesc; ACPI_OPERAND_OBJECT *ReturnDesc; - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_FUNCTION_TRACE (UtOsiImplementation); @@ -288,7 +288,6 @@ AcpiUtEvaluateObject ( Info->PrefixNode = PrefixNode; Info->Pathname = Path; - Info->ParameterType = ACPI_PARAM_ARGS; /* Evaluate the object/method */ @@ -613,7 +612,7 @@ AcpiUtExecute_CID ( UINT32 Count; UINT32 Size; ACPI_COMPATIBLE_ID_LIST *CidList; - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_FUNCTION_TRACE (UtExecute_CID); diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utglobal.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utglobal.c index 8b7d0494c6..22129b604a 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utglobal.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utglobal.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: utglobal - Global variables for the ACPI subsystem - * $Revision: 1.255 $ + * $Revision: 1.256 $ * *****************************************************************************/ @@ -591,12 +591,11 @@ AcpiUtGetNodeName ( return ("####"); } - /* Name must be a valid ACPI name */ - - if (!AcpiUtValidAcpiName (Node->Name.Integer)) - { - Node->Name.Integer = AcpiUtRepairName (Node->Name.Ascii); - } + /* + * Ensure name is valid. The name was validated/repaired when the node + * was created, but make sure it has not been corrupted. + */ + AcpiUtRepairName (Node->Name.Ascii); /* Return the name */ diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utmisc.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utmisc.c index 8c7bcec45b..64c2389908 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utmisc.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utmisc.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: utmisc - common utility procedures - * $Revision: 1.153 $ + * $Revision: 1.154 $ * ******************************************************************************/ @@ -143,7 +143,7 @@ const char * AcpiUtValidateException ( ACPI_STATUS Status) { - ACPI_STATUS SubStatus; + UINT32 SubStatus; const char *Exception = NULL; @@ -169,7 +169,7 @@ AcpiUtValidateException ( if (SubStatus <= AE_CODE_PGM_MAX) { - Exception = AcpiGbl_ExceptionNames_Pgm [SubStatus -1]; + Exception = AcpiGbl_ExceptionNames_Pgm [SubStatus]; } break; @@ -177,7 +177,7 @@ AcpiUtValidateException ( if (SubStatus <= AE_CODE_TBL_MAX) { - Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus -1]; + Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus]; } break; @@ -185,7 +185,7 @@ AcpiUtValidateException ( if (SubStatus <= AE_CODE_AML_MAX) { - Exception = AcpiGbl_ExceptionNames_Aml [SubStatus -1]; + Exception = AcpiGbl_ExceptionNames_Aml [SubStatus]; } break; @@ -193,7 +193,7 @@ AcpiUtValidateException ( if (SubStatus <= AE_CODE_CTRL_MAX) { - Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus -1]; + Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus]; } break; @@ -255,9 +255,9 @@ ACPI_STATUS AcpiUtAllocateOwnerId ( ACPI_OWNER_ID *OwnerId) { - ACPI_NATIVE_UINT i; - ACPI_NATIVE_UINT j; - ACPI_NATIVE_UINT k; + UINT32 i; + UINT32 j; + UINT32 k; ACPI_STATUS Status; @@ -372,7 +372,7 @@ AcpiUtReleaseOwnerId ( { ACPI_OWNER_ID OwnerId = *OwnerIdPtr; ACPI_STATUS Status; - ACPI_NATIVE_UINT Index; + UINT32 Index; UINT32 Bit; @@ -740,7 +740,7 @@ AcpiUtDisplayInitPathname ( BOOLEAN AcpiUtValidAcpiChar ( char Character, - ACPI_NATIVE_UINT Position) + UINT32 Position) { if (!((Character >= 'A' && Character <= 'Z') || @@ -780,7 +780,7 @@ BOOLEAN AcpiUtValidAcpiName ( UINT32 Name) { - ACPI_NATIVE_UINT i; + UINT32 i; ACPI_FUNCTION_ENTRY (); @@ -807,34 +807,63 @@ AcpiUtValidAcpiName ( * RETURN: Repaired version of the name * * DESCRIPTION: Repair an ACPI name: Change invalid characters to '*' and - * return the new name. + * return the new name. NOTE: the Name parameter must reside in + * read/write memory, cannot be a const. + * + * An ACPI Name must consist of valid ACPI characters. We will repair the name + * if necessary because we don't want to abort because of this, but we want + * all namespace names to be printable. A warning message is appropriate. + * + * This issue came up because there are in fact machines that exhibit + * this problem, and we want to be able to enable ACPI support for them, + * even though there are a few bad names. * ******************************************************************************/ -ACPI_NAME +void AcpiUtRepairName ( char *Name) { - ACPI_NATIVE_UINT i; - char NewName[ACPI_NAME_SIZE]; + UINT32 i; + BOOLEAN FoundBadChar = FALSE; + ACPI_FUNCTION_NAME (UtRepairName); + + + /* Check each character in the name */ + for (i = 0; i < ACPI_NAME_SIZE; i++) { - NewName[i] = Name[i]; + if (AcpiUtValidAcpiChar (Name[i], i)) + { + continue; + } /* * Replace a bad character with something printable, yet technically * still invalid. This prevents any collisions with existing "good" * names in the namespace. */ - if (!AcpiUtValidAcpiChar (Name[i], i)) - { - NewName[i] = '*'; - } + Name[i] = '*'; + FoundBadChar = TRUE; } - return (*(UINT32 *) NewName); + if (FoundBadChar) + { + /* Report warning only if in strict mode or debug mode */ + + if (!AcpiGbl_EnableInterpreterSlack) + { + ACPI_WARNING ((AE_INFO, + "Found bad character(s) in name, repaired: [%4.4s]\n", Name)); + } + else + { + ACPI_DEBUG_PRINT ((ACPI_DB_WARN, + "Found bad character(s) in name, repaired: [%4.4s]\n", Name)); + } + } } @@ -1235,9 +1264,9 @@ AcpiUtWalkPackageTree ( void ACPI_INTERNAL_VAR_XFACE AcpiUtError ( - char *ModuleName, + const char *ModuleName, UINT32 LineNumber, - char *Format, + const char *Format, ...) { va_list args; @@ -1253,10 +1282,10 @@ AcpiUtError ( void ACPI_INTERNAL_VAR_XFACE AcpiUtException ( - char *ModuleName, + const char *ModuleName, UINT32 LineNumber, ACPI_STATUS Status, - char *Format, + const char *Format, ...) { va_list args; @@ -1273,9 +1302,9 @@ AcpiUtException ( void ACPI_INTERNAL_VAR_XFACE AcpiUtWarning ( - char *ModuleName, + const char *ModuleName, UINT32 LineNumber, - char *Format, + const char *Format, ...) { va_list args; @@ -1291,9 +1320,9 @@ AcpiUtWarning ( void ACPI_INTERNAL_VAR_XFACE AcpiUtInfo ( - char *ModuleName, + const char *ModuleName, UINT32 LineNumber, - char *Format, + const char *Format, ...) { va_list args; diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utmutex.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utmutex.c index ecaa9ecf2a..0abc24cf1a 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utmutex.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utmutex.c @@ -332,7 +332,7 @@ AcpiUtAcquireMutex ( * the mutex ordering rule. This indicates a coding error somewhere in * the ACPI subsystem code. */ - for (i = MutexId; i < ACPI_MAX_MUTEX; i++) + for (i = MutexId; i < ACPI_NUM_MUTEX; i++) { if (AcpiGbl_MutexInfo[i].ThreadId == ThisThreadId) { @@ -434,7 +434,7 @@ AcpiUtReleaseMutex ( * ordering rule. This indicates a coding error somewhere in * the ACPI subsystem code. */ - for (i = MutexId; i < ACPI_MAX_MUTEX; i++) + for (i = MutexId; i < ACPI_NUM_MUTEX; i++) { if (AcpiGbl_MutexInfo[i].ThreadId == ThisThreadId) { diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utobject.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utobject.c index 44c0253f13..f49da2d3bf 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utobject.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utobject.c @@ -167,7 +167,7 @@ AcpiUtGetElementLength ( ACPI_OPERAND_OBJECT * AcpiUtCreateInternalObjectDbg ( - char *ModuleName, + const char *ModuleName, UINT32 LineNumber, UINT32 ComponentId, ACPI_OBJECT_TYPE Type) @@ -266,8 +266,8 @@ AcpiUtCreatePackageObject ( * Create the element array. Count+1 allows the array to be null * terminated. */ - PackageElements = ACPI_ALLOCATE_ZEROED ((ACPI_SIZE) - (Count + 1) * sizeof (void *)); + PackageElements = ACPI_ALLOCATE_ZEROED ( + ((ACPI_SIZE) Count + 1) * sizeof (void *)); if (!PackageElements) { ACPI_FREE (PackageDesc); @@ -462,7 +462,7 @@ AcpiUtValidInternalObject ( void * AcpiUtAllocateObjectDescDbg ( - char *ModuleName, + const char *ModuleName, UINT32 LineNumber, UINT32 ComponentId) { diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/uttrack.c b/src/add-ons/kernel/bus_managers/acpi/utilities/uttrack.c index 76ab1d7f1e..5a0a22185d 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/uttrack.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/uttrack.c @@ -146,14 +146,14 @@ AcpiUtTrackAllocation ( ACPI_SIZE Size, UINT8 AllocType, UINT32 Component, - char *Module, + const char *Module, UINT32 Line); static ACPI_STATUS AcpiUtRemoveAllocation ( ACPI_DEBUG_MEM_BLOCK *Address, UINT32 Component, - char *Module, + const char *Module, UINT32 Line); @@ -215,7 +215,7 @@ void * AcpiUtAllocateAndTrack ( ACPI_SIZE Size, UINT32 Component, - char *Module, + const char *Module, UINT32 Line) { ACPI_DEBUG_MEM_BLOCK *Allocation; @@ -268,7 +268,7 @@ void * AcpiUtAllocateZeroedAndTrack ( ACPI_SIZE Size, UINT32 Component, - char *Module, + const char *Module, UINT32 Line) { ACPI_DEBUG_MEM_BLOCK *Allocation; @@ -325,7 +325,7 @@ void AcpiUtFreeAndTrack ( void *Allocation, UINT32 Component, - char *Module, + const char *Module, UINT32 Line) { ACPI_DEBUG_MEM_BLOCK *DebugBlock; @@ -425,7 +425,7 @@ AcpiUtTrackAllocation ( ACPI_SIZE Size, UINT8 AllocType, UINT32 Component, - char *Module, + const char *Module, UINT32 Line) { ACPI_MEMORY_LIST *MemList; @@ -508,7 +508,7 @@ static ACPI_STATUS AcpiUtRemoveAllocation ( ACPI_DEBUG_MEM_BLOCK *Allocation, UINT32 Component, - char *Module, + const char *Module, UINT32 Line) { ACPI_MEMORY_LIST *MemList; @@ -639,7 +639,7 @@ AcpiUtDumpAllocationInfo ( void AcpiUtDumpAllocations ( UINT32 Component, - char *Module) + const char *Module) { ACPI_DEBUG_MEM_BLOCK *Element; ACPI_DESCRIPTOR *Descriptor; diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utxface.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utxface.c index 039c65207e..0d1c4d2d82 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utxface.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utxface.c @@ -262,7 +262,9 @@ AcpiEnableSubsystem ( * * Note2: Fixed events are initialized and enabled here. GPEs are * initialized, but cannot be enabled until after the hardware is - * completely initialized (SCI and GlobalLock activated) + * completely initialized (SCI and GlobalLock activated) and the various + * initialization control methods are run (_REG, _STA, _INI) on the + * entire namespace. */ if (!(Flags & ACPI_NO_EVENT_INIT)) { @@ -292,26 +294,6 @@ AcpiEnableSubsystem ( } } - /* - * Complete the GPE initialization for the GPE blocks defined in the FADT - * (GPE block 0 and 1). - * - * Note1: This is where the _PRW methods are executed for the GPEs. These - * methods can only be executed after the SCI and Global Lock handlers are - * installed and initialized. - * - * Note2: Currently, there seems to be no need to run the _REG methods - * before execution of the _PRW methods and enabling of the GPEs. - */ - if (!(Flags & ACPI_NO_EVENT_INIT)) - { - Status = AcpiEvInstallFadtGpes (); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - } - return_ACPI_STATUS (Status); } @@ -393,6 +375,27 @@ AcpiInitializeObjects ( } } + /* + * Initialize the GPE blocks defined in the FADT (GPE block 0 and 1). + * The runtime GPEs are enabled here. + * + * This is where the _PRW methods are executed for the GPEs. These + * methods can only be executed after the SCI and Global Lock handlers are + * installed and initialized. + * + * GPEs can only be enabled after the _REG, _STA, and _INI methods have + * been run. This ensures that all Operation Regions and all Devices have + * been initialized and are ready. + */ + if (!(Flags & ACPI_NO_EVENT_INIT)) + { + Status = AcpiEvInstallFadtGpes (); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + } + /* * Empty the caches (delete the cached objects) on the assumption that * the table load filled them up more than they will be at runtime --