Message ID | 1434617710-22485-1-git-send-email-colin.king@canonical.com |
---|---|
State | Rejected |
Headers | show |
NACK - ACPICA version 20150619 has just been released, so I'll re-work this patch to accommodate that new release. On 18/06/15 09:55, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > Update to ACPICA 20150616, for changes since the previous > release incorporated in fwts please refer to the follwing: > > https://lists.acpica.org/pipermail/devel/2015-June/000766.html > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/acpica/fwts_acpica.c | 19 ++- > src/acpica/source/common/adisasm.c | 2 +- > src/acpica/source/common/ahids.c | 2 +- > src/acpica/source/common/ahpredef.c | 2 +- > src/acpica/source/common/ahuuids.c | 78 +++++----- > src/acpica/source/common/dmextern.c | 16 +- > src/acpica/source/common/dmrestag.c | 8 +- > src/acpica/source/common/dmtable.c | 4 +- > src/acpica/source/common/dmtbdump.c | 6 +- > src/acpica/source/common/dmtbinfo.c | 13 +- > src/acpica/source/compiler/aslanalyze.c | 10 +- > src/acpica/source/compiler/aslascii.c | 2 +- > src/acpica/source/compiler/aslcodegen.c | 11 +- > src/acpica/source/compiler/aslcompile.c | 13 +- > src/acpica/source/compiler/aslcompiler.h | 2 +- > src/acpica/source/compiler/aslcompiler.l | 2 +- > src/acpica/source/compiler/asldefine.h | 5 +- > src/acpica/source/compiler/aslerror.c | 6 +- > src/acpica/source/compiler/aslfileio.c | 38 ++++- > src/acpica/source/compiler/aslfiles.c | 55 +++++-- > src/acpica/source/compiler/aslfold.c | 48 +++--- > src/acpica/source/compiler/aslglobal.h | 4 +- > src/acpica/source/compiler/aslmain.c | 2 +- > src/acpica/source/compiler/aslmapoutput.c | 4 +- > src/acpica/source/compiler/aslmethod.c | 4 +- > src/acpica/source/compiler/aslopcodes.c | 6 +- > src/acpica/source/compiler/asloperands.c | 6 +- > src/acpica/source/compiler/aslopt.c | 22 +-- > src/acpica/source/compiler/aslprintf.c | 4 +- > src/acpica/source/compiler/aslstartup.c | 2 + > src/acpica/source/compiler/aslsupport.l | 9 +- > src/acpica/source/compiler/asltypes.h | 54 +++++-- > src/acpica/source/compiler/aslutils.c | 25 ++-- > src/acpica/source/compiler/asluuid.c | 2 +- > src/acpica/source/compiler/dtcompile.c | 8 +- > src/acpica/source/compiler/dtexpress.c | 2 +- > src/acpica/source/compiler/dtfield.c | 12 +- > src/acpica/source/compiler/dtio.c | 16 +- > src/acpica/source/compiler/dtparser.y | 15 +- > src/acpica/source/compiler/dtsubtable.c | 4 +- > src/acpica/source/compiler/dttable.c | 6 +- > src/acpica/source/compiler/dttemplate.c | 28 +++- > src/acpica/source/compiler/dttemplate.h | 11 +- > src/acpica/source/compiler/dtutils.c | 10 +- > src/acpica/source/compiler/prparser.y | 11 +- > src/acpica/source/compiler/prscan.c | 160 ++++++++++++++++---- > src/acpica/source/compiler/prutils.c | 9 +- > src/acpica/source/components/debugger/dbcmds.c | 16 +- > src/acpica/source/components/debugger/dbconvert.c | 8 +- > src/acpica/source/components/debugger/dbdisply.c | 2 +- > src/acpica/source/components/debugger/dbexec.c | 14 +- > src/acpica/source/components/debugger/dbfileio.c | 2 +- > src/acpica/source/components/debugger/dbhistry.c | 8 +- > src/acpica/source/components/debugger/dbinput.c | 10 +- > src/acpica/source/components/debugger/dbmethod.c | 8 +- > src/acpica/source/components/debugger/dbnames.c | 10 +- > src/acpica/source/components/debugger/dbtest.c | 20 +-- > src/acpica/source/components/debugger/dbutils.c | 4 +- > src/acpica/source/components/debugger/dbxface.c | 2 +- > .../source/components/disassembler/dmbuffer.c | 8 +- > .../source/components/disassembler/dmcstyle.c | 89 +++++++++-- > .../source/components/disassembler/dmopcode.c | 6 +- > src/acpica/source/components/dispatcher/dsfield.c | 2 +- > src/acpica/source/components/dispatcher/dsinit.c | 2 +- > src/acpica/source/components/dispatcher/dsobject.c | 4 +- > src/acpica/source/components/dispatcher/dsutils.c | 2 +- > src/acpica/source/components/dispatcher/dswload.c | 15 +- > src/acpica/source/components/events/evgpe.c | 5 +- > src/acpica/source/components/events/evgpeinit.c | 2 +- > src/acpica/source/components/executer/exconfig.c | 2 +- > src/acpica/source/components/executer/exconvrt.c | 4 +- > src/acpica/source/components/executer/exdebug.c | 35 ++++- > src/acpica/source/components/executer/exdump.c | 13 +- > src/acpica/source/components/executer/exfield.c | 2 +- > src/acpica/source/components/executer/exfldio.c | 18 +-- > src/acpica/source/components/executer/exmisc.c | 18 +-- > src/acpica/source/components/executer/exnames.c | 2 +- > src/acpica/source/components/executer/exoparg2.c | 9 +- > src/acpica/source/components/executer/exoparg3.c | 2 +- > src/acpica/source/components/executer/exregion.c | 4 +- > src/acpica/source/components/executer/exstorob.c | 12 +- > src/acpica/source/components/executer/exutils.c | 37 +++++ > src/acpica/source/components/hardware/hwgpe.c | 13 +- > src/acpica/source/components/hardware/hwxfsleep.c | 91 +++++++----- > src/acpica/source/components/namespace/nsaccess.c | 17 ++- > src/acpica/source/components/namespace/nsconvert.c | 4 +- > src/acpica/source/components/namespace/nsdump.c | 2 +- > src/acpica/source/components/namespace/nseval.c | 7 +- > src/acpica/source/components/namespace/nsinit.c | 4 +- > src/acpica/source/components/namespace/nsparse.c | 8 + > src/acpica/source/components/namespace/nsrepair2.c | 2 +- > src/acpica/source/components/namespace/nssearch.c | 38 ++++- > src/acpica/source/components/namespace/nsutils.c | 2 +- > src/acpica/source/components/namespace/nsxfeval.c | 4 +- > src/acpica/source/components/namespace/nsxfname.c | 32 +++- > src/acpica/source/components/parser/psutils.c | 2 +- > src/acpica/source/components/resources/rscreate.c | 4 +- > src/acpica/source/components/resources/rsmisc.c | 8 +- > src/acpica/source/components/resources/rsutils.c | 8 +- > src/acpica/source/components/resources/rsxface.c | 6 +- > src/acpica/source/components/tables/tbdata.c | 4 +- > src/acpica/source/components/tables/tbfadt.c | 21 ++- > src/acpica/source/components/tables/tbfind.c | 14 +- > src/acpica/source/components/tables/tbinstal.c | 4 +- > src/acpica/source/components/tables/tbprint.c | 6 +- > src/acpica/source/components/tables/tbutils.c | 41 ++++-- > src/acpica/source/components/tables/tbxface.c | 6 +- > src/acpica/source/components/tables/tbxfload.c | 13 +- > src/acpica/source/components/utilities/utalloc.c | 6 +- > src/acpica/source/components/utilities/utbuffer.c | 4 +- > src/acpica/source/components/utilities/utcache.c | 6 +- > src/acpica/source/components/utilities/utcopy.c | 16 +- > src/acpica/source/components/utilities/utids.c | 104 ++++++++++++- > src/acpica/source/components/utilities/utmisc.c | 7 +- > src/acpica/source/components/utilities/utosi.c | 8 +- > src/acpica/source/components/utilities/utpredef.c | 4 +- > src/acpica/source/components/utilities/utprint.c | 6 +- > src/acpica/source/components/utilities/utstring.c | 32 ++-- > src/acpica/source/components/utilities/uttrack.c | 8 +- > src/acpica/source/components/utilities/utxface.c | 6 +- > src/acpica/source/include/acglobal.h | 2 + > src/acpica/source/include/acinterp.h | 5 + > src/acpica/source/include/aclocal.h | 1 + > src/acpica/source/include/acnames.h | 1 + > src/acpica/source/include/acnamesp.h | 1 + > src/acpica/source/include/acobject.h | 15 +- > src/acpica/source/include/acoutput.h | 13 +- > src/acpica/source/include/acpixf.h | 26 ++-- > src/acpica/source/include/acstruct.h | 1 + > src/acpica/source/include/actbl.h | 1 + > src/acpica/source/include/actbl1.h | 14 +- > src/acpica/source/include/actbl2.h | 87 ++++++++++- > src/acpica/source/include/actbl3.h | 39 +---- > src/acpica/source/include/actypes.h | 36 ++--- > src/acpica/source/include/acutils.h | 107 ++++++++++---- > src/acpica/source/include/acuuid.h | 162 +++++++++++++++++++++ > src/acpica/source/include/platform/acenv.h | 80 +++++----- > src/acpica/source/include/platform/acenvex.h | 6 + > src/acpica/source/include/platform/acgcc.h | 4 + > src/acpica/source/tools/acpiexec/aehandlers.c | 2 +- > src/acpica/source/tools/acpiexec/aeinitfile.c | 20 ++- > src/acpica/source/tools/acpiexec/aeregion.c | 10 +- > 142 files changed, 1658 insertions(+), 718 deletions(-) > create mode 100644 src/acpica/source/include/acuuid.h > > diff --git a/src/acpica/fwts_acpica.c b/src/acpica/fwts_acpica.c > index 9bfd0ae..2954e39 100644 > --- a/src/acpica/fwts_acpica.c > +++ b/src/acpica/fwts_acpica.c > @@ -1168,8 +1168,23 @@ static ACPI_STATUS fwts_acpi_walk_for_object_names( > buffer.Pointer = tmpbuf; > buffer.Length = sizeof(tmpbuf); > > - if (!ACPI_FAILURE(AcpiNsHandleToPathname(objHandle, &buffer))) > - fwts_list_append(list, strdup((char *)buffer.Pointer)); > + if (!ACPI_FAILURE(AcpiNsHandleToPathname(objHandle, &buffer))) { > + /* > + * Originally we used strdup here however, the > + * built-in strdup was expanding a macro that > + * produced __retval = (char *) (void)memcpy((__retval) > + * which causes build issues casting from a (void)memcpy > + * so we manually do a strdup() here instead. > + */ > + char *ptr = (char *)buffer.Pointer; > + size_t len = strlen(ptr) + 1; > + char *str = malloc(len); > + > + if (str) { > + strncpy(str, ptr, len); > + fwts_list_append(list, str); > + } > + } > > return AE_OK; > } > diff --git a/src/acpica/source/common/adisasm.c b/src/acpica/source/common/adisasm.c > index 8ee9ccc..d4f0fe6 100644 > --- a/src/acpica/source/common/adisasm.c > +++ b/src/acpica/source/common/adisasm.c > @@ -315,7 +315,7 @@ AdAmlDisassemble ( > while (ExternalFileList) > { > ExternalFilename = ExternalFileList->Path; > - if (!ACPI_STRCMP (ExternalFilename, Filename)) > + if (!strcmp (ExternalFilename, Filename)) > { > /* Next external file */ > > diff --git a/src/acpica/source/common/ahids.c b/src/acpica/source/common/ahids.c > index 1ff3c7c..fed0981 100644 > --- a/src/acpica/source/common/ahids.c > +++ b/src/acpica/source/common/ahids.c > @@ -302,7 +302,7 @@ AcpiAhMatchHardwareId ( > > for (Info = AslDeviceIds; Info->Name; Info++) > { > - if (!ACPI_STRCMP (HardwareId, Info->Name)) > + if (!strcmp (HardwareId, Info->Name)) > { > return (Info); > } > diff --git a/src/acpica/source/common/ahpredef.c b/src/acpica/source/common/ahpredef.c > index 27c28f1..5104def 100644 > --- a/src/acpica/source/common/ahpredef.c > +++ b/src/acpica/source/common/ahpredef.c > @@ -321,7 +321,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = > AH_PREDEF ("_RBW", "Register Bit Width", "Resource Descriptor field"), > AH_PREDEF ("_RDI", "Resource Dependencies for Idle", "Returns a list of dependencies for idle states"), > AH_PREDEF ("_REG", "Region Availability", "Inform AML code of an operation region availability change"), > - AH_PREDEF ("_REV", "Supported ACPI Revision", "Returns the revision of the ACPI specification that is implemented"), > + AH_PREDEF ("_REV", "Supported Integer Width", "Returns the supported integer width (<= 1: 32 bits only, >=2: both 32 and 64 bits"), > AH_PREDEF ("_RMV", "Removal Status", "Returns a device's removal ability status (docking)"), > AH_PREDEF ("_RNG", "Range", "Memory range type, Resource Descriptor field"), > AH_PREDEF ("_RST", "Device Reset", "Executes a reset on a device"), > diff --git a/src/acpica/source/common/ahuuids.c b/src/acpica/source/common/ahuuids.c > index 4e5d087..118473d 100644 > --- a/src/acpica/source/common/ahuuids.c > +++ b/src/acpica/source/common/ahuuids.c > @@ -115,6 +115,7 @@ > > #include "acpi.h" > #include "accommon.h" > +#include "acuuid.h" > > #define _COMPONENT ACPI_UTILITIES > ACPI_MODULE_NAME ("ahuuids") > @@ -124,44 +125,36 @@ > */ > const AH_UUID AcpiUuids[] = > { > - {"PCI Host Bridge Device", > - "33db4d5b-1ff7-401c-9657-7441c03dd766"}, > - > - {"Platform-wide Capabilities", > - "0811b06e-4a27-44f9-8d60-3cbbc22e7b48"}, > - > - {"Dynamic Enumeration", > - "d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf"}, > - > - {"GPIO Controller", > - "4f248f40-d5e2-499f-834c-27758ea1cd3f"}, > - > - {"Battery Thermal Limit", > - "4c2067e3-887d-475c-9720-4af1d3ed602e"}, > - > - {"Thermal Extensions", > - "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500"}, > - > - {"USB Controller", > - "ce2ee385-00e6-48cb-9f05-2edb927c4899"}, > - > - {"HID I2C Device", > - "3cdff6f7-4267-4555-ad05-b30a3d8938de"}, > - > - {"Power Button Device", > - "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c"}, > - > - {"Device Labeling Interface", > - "e5c937d0-3553-4d7a-9117-ea4d19c3434d"}, > - > - {"SATA Controller", > - "e4db149b-fcfe-425b-a6d8-92357d78fc7f"}, > - > - {"Physical Presence Interface", > - "3dddfaa6-361b-4eb4-a424-8d10089d1653"}, > - > - {"Device Properties for _DSD", > - "daffd814-6eba-4d8c-8a91-bc9bbf4aa301"}, > + {"[Controllers]", NULL}, > + {"GPIO Controller", UUID_GPIO_CONTROLLER}, > + {"USB Controller", UUID_USB_CONTROLLER}, > + {"SATA Controller", UUID_SATA_CONTROLLER}, > + > + {"[Devices]", NULL}, > + {"PCI Host Bridge Device", UUID_PCI_HOST_BRIDGE}, > + {"HID I2C Device", UUID_I2C_DEVICE}, > + {"Power Button Device", UUID_POWER_BUTTON}, > + > + {"[Interfaces]", NULL}, > + {"Device Labeling Interface", UUID_DEVICE_LABELING}, > + {"Physical Presence Interface", UUID_PHYSICAL_PRESENCE}, > + > + {"[Non-volatile DIMM and NFIT table]", NULL}, > + {"Volatile Memory Region", UUID_VOLATILE_MEMORY}, > + {"Persistent Memory Region", UUID_PERSISTENT_MEMORY}, > + {"NVDIMM Control Region", UUID_CONTROL_REGION}, > + {"NVDIMM Data Region", UUID_DATA_REGION}, > + {"Volatile Virtual Disk", UUID_VOLATILE_VIRTUAL_DISK}, > + {"Volatile Virtual CD", UUID_VOLATILE_VIRTUAL_CD}, > + {"Persistent Virtual Disk", UUID_PERSISTENT_VIRTUAL_DISK}, > + {"Persistent Virtual CD", UUID_PERSISTENT_VIRTUAL_CD}, > + > + {"[Miscellaneous]", NULL}, > + {"Platform-wide Capabilities", UUID_PLATFORM_CAPABILITIES}, > + {"Dynamic Enumeration", UUID_DYNAMIC_ENUMERATION}, > + {"Battery Thermal Limit", UUID_BATTERY_THERMAL_LIMIT}, > + {"Thermal Extensions", UUID_THERMAL_EXTENSIONS}, > + {"Device Properties for _DSD", UUID_DEVICE_PROPERTIES}, > > {NULL, NULL} > }; > @@ -192,9 +185,16 @@ AcpiAhMatchUuid ( > > for (Info = AcpiUuids; Info->Description; Info++) > { > + /* Null string means desciption is a UUID class */ > + > + if (!Info->String) > + { > + continue; > + } > + > AcpiUtConvertStringToUuid (Info->String, UuidBuffer); > > - if (!ACPI_MEMCMP (Data, UuidBuffer, UUID_BUFFER_LENGTH)) > + if (!memcmp (Data, UuidBuffer, UUID_BUFFER_LENGTH)) > { > return (Info->Description); > } > diff --git a/src/acpica/source/common/dmextern.c b/src/acpica/source/common/dmextern.c > index dc3c8b4..832379e 100644 > --- a/src/acpica/source/common/dmextern.c > +++ b/src/acpica/source/common/dmextern.c > @@ -296,7 +296,7 @@ AcpiDmNormalizeParentPrefix ( > return (NULL); > } > > - Length = (ACPI_STRLEN (ParentPath) + ACPI_STRLEN (Path) + 1); > + Length = (strlen (ParentPath) + strlen (Path) + 1); > if (ParentPath[1]) > { > /* > @@ -325,7 +325,7 @@ AcpiDmNormalizeParentPrefix ( > * > * Copy the parent path > */ > - ACPI_STRCPY (Fullpath, &ParentPath[Index]); > + strcpy (Fullpath, &ParentPath[Index]); > > /* > * Add dot separator > @@ -333,12 +333,12 @@ AcpiDmNormalizeParentPrefix ( > */ > if (ParentPath[1]) > { > - ACPI_STRCAT (Fullpath, "."); > + strcat (Fullpath, "."); > } > > /* Copy child path (carat parent prefix(es) were skipped above) */ > > - ACPI_STRCAT (Fullpath, Path); > + strcat (Fullpath, Path); > > Cleanup: > ACPI_FREE (ParentPath); > @@ -720,13 +720,13 @@ AcpiDmAddNodeToExternalList ( > > if ((*ExternalPath == AML_ROOT_PREFIX) && (ExternalPath[1])) > { > - Temp = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (ExternalPath) + 1); > + Temp = ACPI_ALLOCATE_ZEROED (strlen (ExternalPath) + 1); > if (!Temp) > { > return_VOID; > } > > - ACPI_STRCPY (Temp, &ExternalPath[1]); > + strcpy (Temp, &ExternalPath[1]); > ACPI_FREE (ExternalPath); > ExternalPath = Temp; > } > @@ -878,7 +878,7 @@ AcpiDmCreateNewExternal ( > NextExternal = AcpiGbl_ExternalList; > while (NextExternal) > { > - if (!ACPI_STRCMP (ExternalPath, NextExternal->Path)) > + if (!strcmp (ExternalPath, NextExternal->Path)) > { > /* Duplicate method, check that the Value (ArgCount) is the same */ > > @@ -921,7 +921,7 @@ AcpiDmCreateNewExternal ( > NewExternal->Value = Value; > NewExternal->Path = ExternalPath; > NewExternal->Type = Type; > - NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath); > + NewExternal->Length = (UINT16) strlen (ExternalPath); > NewExternal->InternalPath = InternalPath; > > /* Link the new descriptor into the global list, alphabetically ordered */ > diff --git a/src/acpica/source/common/dmrestag.c b/src/acpica/source/common/dmrestag.c > index 15c2d84..d91ede9 100644 > --- a/src/acpica/source/common/dmrestag.c > +++ b/src/acpica/source/common/dmrestag.c > @@ -751,10 +751,10 @@ AcpiGetTagPathname ( > * end up in the final compiled AML, it's just an appearance issue for the > * disassembled code. > */ > - Pathname[ACPI_STRLEN (Pathname) - ACPI_NAME_SIZE] = 0; > - ACPI_STRNCAT (Pathname, ResourceNode->Name.Ascii, ACPI_NAME_SIZE); > - ACPI_STRCAT (Pathname, "."); > - ACPI_STRNCAT (Pathname, Tag, ACPI_NAME_SIZE); > + Pathname[strlen (Pathname) - ACPI_NAME_SIZE] = 0; > + strncat (Pathname, ResourceNode->Name.Ascii, ACPI_NAME_SIZE); > + strcat (Pathname, "."); > + strncat (Pathname, Tag, ACPI_NAME_SIZE); > > /* Internalize the namepath to AML format */ > > diff --git a/src/acpica/source/common/dmtable.c b/src/acpica/source/common/dmtable.c > index 6397abe..e05e687 100644 > --- a/src/acpica/source/common/dmtable.c > +++ b/src/acpica/source/common/dmtable.c > @@ -600,7 +600,7 @@ AcpiDmDumpDataTable ( > TableData = AcpiDmGetTableData (Table->Signature); > if (!TableData) > { > - if (!ACPI_STRNCMP (Table->Signature, "OEM", 3)) > + if (!strncmp (Table->Signature, "OEM", 3)) > { > AcpiOsPrintf ("\n**** OEM-defined ACPI table [%4.4s], unknown contents\n\n", > Table->Signature); > @@ -928,7 +928,7 @@ AcpiDmDumpTable ( > > case ACPI_DMT_STRING: > > - ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1; > + ByteLength = strlen (ACPI_CAST_PTR (char, Target)) + 1; > break; > > case ACPI_DMT_GAS: > diff --git a/src/acpica/source/common/dmtbdump.c b/src/acpica/source/common/dmtbdump.c > index 9196dbb..3b68637 100644 > --- a/src/acpica/source/common/dmtbdump.c > +++ b/src/acpica/source/common/dmtbdump.c > @@ -227,7 +227,7 @@ AcpiDmDumpUnicode ( > > for (i = 0; i < Length; i += 2) > { > - if (!ACPI_IS_PRINT (Buffer[i])) > + if (!isprint (Buffer[i])) > { > goto DumpRawBuffer; > } > @@ -1773,7 +1773,7 @@ AcpiDmDumpIort ( > InfoTable = AcpiDmTableInfoIort1; > Length = ACPI_OFFSET (ACPI_IORT_NAMED_COMPONENT, DeviceName); > String = ACPI_ADD_PTR (char, IortNode, NodeOffset + Length); > - Length += ACPI_STRLEN (String) + 1; > + Length += strlen (String) + 1; > break; > > case ACPI_IORT_NODE_PCI_ROOT_COMPLEX: > @@ -3416,7 +3416,7 @@ AcpiDmDumpStao ( > while (Offset < Table->Length) > { > Namepath = ACPI_ADD_PTR (char, Table, Offset); > - StringLength = ACPI_STRLEN (Namepath) + 1; > + StringLength = strlen (Namepath) + 1; > > AcpiDmLineHeader (Offset, StringLength, "Namestring"); > AcpiOsPrintf ("\"%s\"\n", Namepath); > diff --git a/src/acpica/source/common/dmtbinfo.c b/src/acpica/source/common/dmtbinfo.c > index 41e4d6a..aab5d72 100644 > --- a/src/acpica/source/common/dmtbinfo.c > +++ b/src/acpica/source/common/dmtbinfo.c > @@ -185,7 +185,7 @@ > #define ACPI_SPMI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPMI,f) > #define ACPI_SRAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SRAT,f) > #define ACPI_STAO_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_STAO,f) > -#define ACPI_TCPA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA,f) > +#define ACPI_TCPA_CLIENT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_CLIENT,f) > #define ACPI_TPM2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM2,f) > #define ACPI_UEFI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_UEFI,f) > #define ACPI_WAET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WAET,f) > @@ -2683,15 +2683,15 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoStaoStr[] = > > /******************************************************************************* > * > - * TCPA - Trusted Computing Platform Alliance table > + * TCPA - Trusted Computing Platform Alliance table (Client) > * > ******************************************************************************/ > > ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[] = > { > - {ACPI_DMT_UINT16, ACPI_TCPA_OFFSET (Reserved), "Reserved", 0}, > - {ACPI_DMT_UINT32, ACPI_TCPA_OFFSET (MaxLogLength), "Max Event Log Length", 0}, > - {ACPI_DMT_UINT64, ACPI_TCPA_OFFSET (LogAddress), "Event Log Address", 0}, > + {ACPI_DMT_UINT16, ACPI_TCPA_CLIENT_OFFSET (PlatformClass), "Platform Class", 0}, > + {ACPI_DMT_UINT32, ACPI_TCPA_CLIENT_OFFSET (MinimumLogLength), "Min Event Log Length", 0}, > + {ACPI_DMT_UINT64, ACPI_TCPA_CLIENT_OFFSET (LogAddress), "Event Log Address", 0}, > ACPI_DMT_TERMINATOR > }; > > @@ -2704,7 +2704,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[] = > > ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[] = > { > - {ACPI_DMT_UINT32, ACPI_TPM2_OFFSET (Flags), "Flags", 0}, > + {ACPI_DMT_UINT16, ACPI_TPM2_OFFSET (PlatformClass), "Platform Class", 0}, > + {ACPI_DMT_UINT16, ACPI_TPM2_OFFSET (Reserved), "Reserved", 0}, > {ACPI_DMT_UINT64, ACPI_TPM2_OFFSET (ControlAddress), "Control Address", 0}, > {ACPI_DMT_UINT32, ACPI_TPM2_OFFSET (StartMethod), "Start Method", 0}, > ACPI_DMT_TERMINATOR > diff --git a/src/acpica/source/compiler/aslanalyze.c b/src/acpica/source/compiler/aslanalyze.c > index 1fae183..dde91ba 100644 > --- a/src/acpica/source/compiler/aslanalyze.c > +++ b/src/acpica/source/compiler/aslanalyze.c > @@ -139,8 +139,8 @@ AnIsInternalMethod ( > ACPI_PARSE_OBJECT *Op) > { > > - if ((!ACPI_STRCMP (Op->Asl.ExternalName, "\\_OSI")) || > - (!ACPI_STRCMP (Op->Asl.ExternalName, "_OSI"))) > + if ((!strcmp (Op->Asl.ExternalName, "\\_OSI")) || > + (!strcmp (Op->Asl.ExternalName, "_OSI"))) > { > return (TRUE); > } > @@ -166,8 +166,8 @@ AnGetInternalMethodReturnType ( > ACPI_PARSE_OBJECT *Op) > { > > - if ((!ACPI_STRCMP (Op->Asl.ExternalName, "\\_OSI")) || > - (!ACPI_STRCMP (Op->Asl.ExternalName, "_OSI"))) > + if ((!strcmp (Op->Asl.ExternalName, "\\_OSI")) || > + (!strcmp (Op->Asl.ExternalName, "_OSI"))) > { > return (ACPI_BTYPE_STRING); > } > @@ -534,7 +534,7 @@ ApCheckForGpeNameConflict ( > > /* Verify 3rd/4th chars are a valid hex value */ > > - GpeNumber = ACPI_STRTOUL (&Name[2], NULL, 16); > + GpeNumber = strtoul (&Name[2], NULL, 16); > if (GpeNumber == ACPI_UINT32_MAX) > { > return; > diff --git a/src/acpica/source/compiler/aslascii.c b/src/acpica/source/compiler/aslascii.c > index b858a38..07f7af8 100644 > --- a/src/acpica/source/compiler/aslascii.c > +++ b/src/acpica/source/compiler/aslascii.c > @@ -298,7 +298,7 @@ FlCheckForAscii ( > > /* Ensure character is either printable or a "space" char */ > > - else if (!ACPI_IS_PRINT (Byte) && !ACPI_IS_SPACE (Byte)) > + else if (!isprint (Byte) && !isspace (Byte)) > { > if ((BadBytes < 10) && (DisplayErrors)) > { > diff --git a/src/acpica/source/compiler/aslcodegen.c b/src/acpica/source/compiler/aslcodegen.c > index 2f10d31..1508231 100644 > --- a/src/acpica/source/compiler/aslcodegen.c > +++ b/src/acpica/source/compiler/aslcodegen.c > @@ -182,7 +182,7 @@ CgGenerateAmlOutput ( > > DbgPrint (ASL_TREE_OUTPUT, > "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr" > - " Parent Child Next Flags AcTyp Final Col L\n", > + " Parent Child Next Flags AcTyp Final Col L# EL# LL# ELL#\n", > 76, " "); > > CgCloseTable (); > @@ -217,7 +217,7 @@ CgAmlWriteWalk ( > "Final parse tree used for AML output:\n"); > DbgPrint (ASL_TREE_OUTPUT, > "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr" > - " Parent Child Next Flags AcTyp Final Col L\n", > + " Parent Child Next Flags AcTyp Final Col L# EL# LL# ELL#\n", > 76, " "); > } > > @@ -241,7 +241,7 @@ CgAmlWriteWalk ( > > DbgPrint (ASL_TREE_OUTPUT, > "%08X %04X %04X %01X %04X %04X %04X %04X " > - "%08X %08X %08X %08X %08X %08X %04X %02d %02d\n", > + "%08X %08X %08X %08X %08X %08X %04X %02d %02d %02d %02d %02d\n", > /* 1 */ (UINT32) Op->Asl.Value.Integer, > /* 2 */ Op->Asl.ParseOpcode, > /* 3 */ Op->Asl.AmlOpcode, > @@ -258,7 +258,10 @@ CgAmlWriteWalk ( > /* 14 */ Op->Asl.AcpiBtype, > /* 15 */ Op->Asl.FinalAmlLength, > /* 16 */ Op->Asl.Column, > - /* 17 */ Op->Asl.LineNumber); > + /* 17 */ Op->Asl.LineNumber, > + /* 18 */ Op->Asl.EndLine, > + /* 19 */ Op->Asl.LogicalLineNumber, > + /* 20 */ Op->Asl.EndLogicalLine); > > /* Generate the AML for this node */ > > diff --git a/src/acpica/source/compiler/aslcompile.c b/src/acpica/source/compiler/aslcompile.c > index 969f97d..c172387 100644 > --- a/src/acpica/source/compiler/aslcompile.c > +++ b/src/acpica/source/compiler/aslcompile.c > @@ -175,6 +175,9 @@ CmDoCompile ( > /* Preprocessor */ > > PrDoPreprocess (); > + Gbl_CurrentLineNumber = 1; > + Gbl_LogicalLineNumber = 1; > + > if (Gbl_PreprocessOnly) > { > UtEndEvent (Event); > @@ -184,6 +187,7 @@ CmDoCompile ( > } > UtEndEvent (Event); > > + > /* Build the parse tree */ > > Event = UtBeginEvent ("Parse source code and build parse tree"); > @@ -780,7 +784,7 @@ CmCleanupAndExit ( > /* Close all open files */ > > /* > - * Take care with the preprocessor file (.i), it might be the same > + * Take care with the preprocessor file (.pre), it might be the same > * as the "input" file, depending on where the compiler has terminated > * or aborted. Prevent attempt to close the same file twice in > * loop below. > @@ -805,10 +809,9 @@ CmCleanupAndExit ( > FlDeleteFile (ASL_FILE_AML_OUTPUT); > } > > - /* Delete the preprocessor output file (.i) unless -li flag is set */ > + /* Delete the preprocessor temp file unless full debug was specified */ > > - if (!Gbl_PreprocessorOutputFlag && > - Gbl_PreprocessFlag) > + if (Gbl_PreprocessFlag && !Gbl_KeepPreprocessorTempFile) > { > FlDeleteFile (ASL_FILE_PREPROCESSOR); > } > @@ -824,8 +827,6 @@ CmCleanupAndExit ( > * Note: Handles are cleared by FlCloseFile above, so we look at the > * filename instead, to determine if the .SRC file was actually > * created. > - * > - * TBD: SourceOutput should be .TMP, then rename if we want to keep it? > */ > if (!Gbl_SourceOutputFlag) > { > diff --git a/src/acpica/source/compiler/aslcompiler.h b/src/acpica/source/compiler/aslcompiler.h > index 5c78095..86a28ad 100644 > --- a/src/acpica/source/compiler/aslcompiler.h > +++ b/src/acpica/source/compiler/aslcompiler.h > @@ -1075,7 +1075,7 @@ UtDoConstant ( > char *String); > > ACPI_STATUS > -UtStrtoul64 ( > +stroul64 ( > char *String, > UINT32 Base, > UINT64 *RetInteger); > diff --git a/src/acpica/source/compiler/aslcompiler.l b/src/acpica/source/compiler/aslcompiler.l > index 56df646..a5dda27 100644 > --- a/src/acpica/source/compiler/aslcompiler.l > +++ b/src/acpica/source/compiler/aslcompiler.l > @@ -781,7 +781,7 @@ NamePathTail [.]{NameSeg} > return (PARSEOP_NAMESTRING); } > > . { count (1); > - if (ACPI_IS_PRINT (*AslCompilertext)) > + if (isprint (*AslCompilertext)) > { > sprintf (MsgBuffer, > "Invalid character (%c), expecting ASL keyword or name", > diff --git a/src/acpica/source/compiler/asldefine.h b/src/acpica/source/compiler/asldefine.h > index 7d34da8..4b71af1 100644 > --- a/src/acpica/source/compiler/asldefine.h > +++ b/src/acpica/source/compiler/asldefine.h > @@ -177,7 +177,8 @@ > > /* filename suffixes for output files */ > > -#define FILE_SUFFIX_PREPROCESSOR "i" > +#define FILE_SUFFIX_PREPROC_USER "i " > +#define FILE_SUFFIX_PREPROCESSOR "pre" > #define FILE_SUFFIX_AML_CODE "aml" > #define FILE_SUFFIX_MAP "map" > #define FILE_SUFFIX_LISTING "lst" > @@ -208,6 +209,8 @@ > #define ASL_ABORT TRUE > #define ASL_NO_ABORT FALSE > #define ASL_EOF ACPI_UINT32_MAX > +#define ASL_WITHIN_COMMENT (ACPI_UINT32_MAX -1) > +#define ASL_BLANK_LINE (ACPI_UINT32_MAX -1) > > > /* Listings */ > diff --git a/src/acpica/source/compiler/aslerror.c b/src/acpica/source/compiler/aslerror.c > index d033fdb..c9df5d8 100644 > --- a/src/acpica/source/compiler/aslerror.c > +++ b/src/acpica/source/compiler/aslerror.c > @@ -633,11 +633,11 @@ AslCommonError2 ( > > /* Keep a copy of the extra message */ > > - ACPI_STRCPY (MessageBuffer, ExtraMessage); > + strcpy (MessageBuffer, ExtraMessage); > } > > LineBuffer = UtLocalCalloc (strlen (SourceLine) + 1); > - ACPI_STRCPY (LineBuffer, SourceLine); > + strcpy (LineBuffer, SourceLine); > > /* Initialize the error node */ > > @@ -719,7 +719,7 @@ AslCommonError ( > > /* Keep a copy of the extra message */ > > - ACPI_STRCPY (MessageBuffer, ExtraMessage); > + strcpy (MessageBuffer, ExtraMessage); > } > > /* Initialize the error node */ > diff --git a/src/acpica/source/compiler/aslfileio.c b/src/acpica/source/compiler/aslfileio.c > index 4d3d963..9588528 100644 > --- a/src/acpica/source/compiler/aslfileio.c > +++ b/src/acpica/source/compiler/aslfileio.c > @@ -290,6 +290,19 @@ FlWriteFile ( > FlFileError (FileId, ASL_MSG_WRITE); > AslAbort (); > } > + > + if ((FileId == ASL_FILE_PREPROCESSOR) && Gbl_PreprocessorOutputFlag) > + { > + /* Duplicate the output to the user preprocessor (.i) file */ > + > + Actual = fwrite ((char *) Buffer, 1, Length, > + Gbl_Files[ASL_FILE_PREPROCESSOR_USER].Handle); > + if (Actual != Length) > + { > + FlFileError (FileId, ASL_MSG_WRITE); > + AslAbort (); > + } > + } > } > > > @@ -319,7 +332,6 @@ FlPrintFile ( > > > va_start (Args, Format); > - > Actual = vfprintf (Gbl_Files[FileId].Handle, Format, Args); > va_end (Args); > > @@ -328,6 +340,30 @@ FlPrintFile ( > FlFileError (FileId, ASL_MSG_WRITE); > AslAbort (); > } > + > + if ((FileId == ASL_FILE_PREPROCESSOR) && Gbl_PreprocessorOutputFlag) > + { > + /* > + * Duplicate the output to the user preprocessor (.i) file, > + * except: no #line directives. > + */ > + if (!strncmp (Format, "#line", 5)) > + { > + return; > + } > + > + va_start (Args, Format); > + Actual = vfprintf (Gbl_Files[ASL_FILE_PREPROCESSOR_USER].Handle, > + Format, Args); > + va_end (Args); > + > + if (Actual == -1) > + { > + FlFileError (FileId, ASL_MSG_WRITE); > + AslAbort (); > + } > + } > + > } > > > diff --git a/src/acpica/source/compiler/aslfiles.c b/src/acpica/source/compiler/aslfiles.c > index 7443776..4fa8562 100644 > --- a/src/acpica/source/compiler/aslfiles.c > +++ b/src/acpica/source/compiler/aslfiles.c > @@ -115,6 +115,7 @@ > > #include "aslcompiler.h" > #include "acapps.h" > +#include "dtcompiler.h" > > #define _COMPONENT ACPI_COMPILER > ACPI_MODULE_NAME ("aslfiles") > @@ -156,7 +157,6 @@ FlSetLineNumber ( > LineNumber, Gbl_LogicalLineNumber); > > Gbl_CurrentLineNumber = LineNumber; > - Gbl_LogicalLineNumber = LineNumber; > } > > > @@ -375,6 +375,7 @@ FlOpenIncludeWithPrefix ( > { > FILE *IncludeFile; > char *Pathname; > + UINT32 OriginalLineNumber; > > > /* Build the full pathname to the file */ > @@ -394,13 +395,20 @@ FlOpenIncludeWithPrefix ( > return (NULL); > } > > -#ifdef _MUST_HANDLE_COMMENTS > /* > - * Check entire include file for any # preprocessor directives. > + * Check the entire include file for any # preprocessor directives. > * This is because there may be some confusion between the #include > - * preprocessor directive and the ASL Include statement. > + * preprocessor directive and the ASL Include statement. A file included > + * by the ASL include cannot contain preprocessor directives because > + * the preprocessor has already run by the time the ASL include is > + * recognized (by the compiler, not the preprocessor.) > + * > + * Note: DtGetNextLine strips/ignores comments. > + * Save current line number since DtGetNextLine modifies it. > */ > - while (fgets (Gbl_CurrentLineBuffer, Gbl_LineBufferSize, IncludeFile)) > + Gbl_CurrentLineNumber--; > + OriginalLineNumber = Gbl_CurrentLineNumber; > + while (DtGetNextLine (IncludeFile) != ASL_EOF) > { > if (Gbl_CurrentLineBuffer[0] == '#') > { > @@ -408,7 +416,7 @@ FlOpenIncludeWithPrefix ( > Op, "use #include instead"); > } > } > -#endif > + Gbl_CurrentLineNumber = OriginalLineNumber; > > /* Must seek back to the start of the file */ > > @@ -651,8 +659,6 @@ FlOpenMiscOutputFiles ( > > /* Open the debug file as STDERR, text mode */ > > - /* TBD: hide this behind a FlReopenFile function */ > - > Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename; > Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = > freopen (Filename, "w+t", stderr); > @@ -660,13 +666,15 @@ FlOpenMiscOutputFiles ( > if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle) > { > /* > - * A problem with freopen is that on error, > - * we no longer have stderr. > + * A problem with freopen is that on error, we no longer > + * have stderr and cannot emit normal error messages. > + * Emit error to stdout, close files, and exit. > */ > - Gbl_DebugFlag = FALSE; > - memcpy (stderr, stdout, sizeof (FILE)); > - FlFileError (ASL_FILE_DEBUG_OUTPUT, ASL_MSG_DEBUG_FILENAME); > - AslAbort (); > + fprintf (stdout, > + "\nCould not open debug output file: %s\n\n", Filename); > + > + CmCleanupAndExit (); > + exit (1); > } > > AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT); > @@ -693,7 +701,7 @@ FlOpenMiscOutputFiles ( > AslCompilerFileHeader (ASL_FILE_LISTING_OUTPUT); > } > > - /* Create the preprocessor output file if preprocessor enabled */ > + /* Create the preprocessor output temp file if preprocessor enabled */ > > if (Gbl_PreprocessFlag) > { > @@ -708,6 +716,23 @@ FlOpenMiscOutputFiles ( > FlOpenFile (ASL_FILE_PREPROCESSOR, Filename, "w+t"); > } > > + /* > + * Create the "user" preprocessor output file if -li flag set. > + * Note, this file contains no embedded #line directives. > + */ > + if (Gbl_PreprocessorOutputFlag) > + { > + Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_PREPROC_USER); > + if (!Filename) > + { > + AslCommonError (ASL_ERROR, ASL_MSG_PREPROCESSOR_FILENAME, > + 0, 0, 0, 0, NULL, NULL); > + return (AE_ERROR); > + } > + > + FlOpenFile (ASL_FILE_PREPROCESSOR_USER, Filename, "w+t"); > + } > + > /* All done for data table compiler */ > > if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA) > diff --git a/src/acpica/source/compiler/aslfold.c b/src/acpica/source/compiler/aslfold.c > index e320c76..f01d81f 100644 > --- a/src/acpica/source/compiler/aslfold.c > +++ b/src/acpica/source/compiler/aslfold.c > @@ -452,10 +452,12 @@ TrSimpleConstantReduction ( > return (Status); > } > > + /* Disconnect any existing children, install new constant */ > + > + Op->Asl.Child = NULL; > TrInstallReducedConstant (Op, ObjDesc); > > UtSetParseOpName (Op); > - Op->Asl.Child = NULL; > return (AE_OK); > } > > @@ -619,7 +621,8 @@ TrInstallReducedConstant ( > ACPI_PARSE_OBJECT *Op, > ACPI_OPERAND_OBJECT *ObjDesc) > { > - ACPI_PARSE_OBJECT *RootOp; > + ACPI_PARSE_OBJECT *LengthOp; > + ACPI_PARSE_OBJECT *DataOp; > > > TotalFolds++; > @@ -646,17 +649,22 @@ TrInstallReducedConstant ( > > Op->Asl.ParseOpcode = PARSEOP_STRING_LITERAL; > Op->Common.AmlOpcode = AML_STRING_OP; > - Op->Asl.AmlLength = ACPI_STRLEN (ObjDesc->String.Pointer) + 1; > + Op->Asl.AmlLength = strlen (ObjDesc->String.Pointer) + 1; > Op->Common.Value.String = ObjDesc->String.Pointer; > > DbgPrint (ASL_PARSE_OUTPUT, > "Constant expression reduced to (STRING) %s\n\n", > Op->Common.Value.String); > - > break; > > case ACPI_TYPE_BUFFER: > - > + /* > + * Create a new parse subtree of the form: > + * > + * BUFFER (Buffer AML opcode) > + * INTEGER (Buffer length in bytes) > + * RAW_DATA (Buffer byte data) > + */ > Op->Asl.ParseOpcode = PARSEOP_BUFFER; > Op->Common.AmlOpcode = AML_BUFFER_OP; > Op->Asl.CompileFlags = NODE_AML_PACKAGE; > @@ -664,28 +672,24 @@ TrInstallReducedConstant ( > > /* Child node is the buffer length */ > > - RootOp = TrAllocateNode (PARSEOP_INTEGER); > + LengthOp = TrAllocateNode (PARSEOP_INTEGER); > > - RootOp->Asl.AmlOpcode = AML_DWORD_OP; > - RootOp->Asl.Value.Integer = ObjDesc->Buffer.Length; > - RootOp->Asl.Parent = Op; > + LengthOp->Asl.AmlOpcode = AML_DWORD_OP; > + LengthOp->Asl.Value.Integer = ObjDesc->Buffer.Length; > + LengthOp->Asl.Parent = Op; > + (void) OpcSetOptimalIntegerSize (LengthOp); > > - (void) OpcSetOptimalIntegerSize (RootOp); > - > - Op->Asl.Child = RootOp; > - Op = RootOp; > - UtSetParseOpName (Op); > + Op->Asl.Child = LengthOp; > > - /* Peer to the child is the raw buffer data */ > + /* Next child is the raw buffer data */ > > - RootOp = TrAllocateNode (PARSEOP_RAW_DATA); > - RootOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; > - RootOp->Asl.AmlLength = ObjDesc->Buffer.Length; > - RootOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer; > - RootOp->Asl.Parent = Op->Asl.Parent; > + DataOp = TrAllocateNode (PARSEOP_RAW_DATA); > + DataOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; > + DataOp->Asl.AmlLength = ObjDesc->Buffer.Length; > + DataOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer; > + DataOp->Asl.Parent = Op; > > - Op->Asl.Next = RootOp; > - Op = RootOp; > + LengthOp->Asl.Next = DataOp; > > DbgPrint (ASL_PARSE_OUTPUT, > "Constant expression reduced to (BUFFER) length %X\n\n", > diff --git a/src/acpica/source/compiler/aslglobal.h b/src/acpica/source/compiler/aslglobal.h > index a26d752..15d6485 100644 > --- a/src/acpica/source/compiler/aslglobal.h > +++ b/src/acpica/source/compiler/aslglobal.h > @@ -145,6 +145,7 @@ ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES] = > {NULL, NULL, "Binary Output:", "AML Output"}, > {NULL, NULL, "Source Output:", "Source Output"}, > {NULL, NULL, "Preprocessor: ", "Preprocessor Output"}, > + {NULL, NULL, "Preprocessor: ", "Preprocessor Temp File"}, > {NULL, NULL, "Listing File: ", "Listing Output"}, > {NULL, NULL, "Hex Dump: ", "Hex Table Output"}, > {NULL, NULL, "Namespace: ", "Namespace Output"}, > @@ -195,10 +196,10 @@ ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_CurrentLineBuffer, NUL > ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_LineBufPtr, NULL); > ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_LineBufferSize, ASL_DEFAULT_LINE_BUFFER_SIZE); > ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentColumn, 0); > -ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_PreviousLineNumber, 0); > ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineNumber, 1); > ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_LogicalLineNumber, 1); > ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineOffset, 0); > +ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_OriginalInputFileSize, 0); > ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_SyntaxError, 0); > > /* Exception reporting */ > @@ -218,6 +219,7 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseDefaultAmlFilename, > ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_MapfileFlag, FALSE); > ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NsOutputFlag, FALSE); > ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessorOutputFlag, FALSE); > +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_KeepPreprocessorTempFile, FALSE); > ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DebugFlag, FALSE); > ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AsmOutputFlag, FALSE); > ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_C_OutputFlag, FALSE); > diff --git a/src/acpica/source/compiler/aslmain.c b/src/acpica/source/compiler/aslmain.c > index 59fdbe8..3d94f24 100644 > --- a/src/acpica/source/compiler/aslmain.c > +++ b/src/acpica/source/compiler/aslmain.c > @@ -333,7 +333,7 @@ AslSignalHandler ( > > /* Close all open files */ > > - Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .i file is same as source file */ > + Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .pre file is same as source file */ > > for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++) > { > diff --git a/src/acpica/source/compiler/aslmapoutput.c b/src/acpica/source/compiler/aslmapoutput.c > index 9537cac..ef85594 100644 > --- a/src/acpica/source/compiler/aslmapoutput.c > +++ b/src/acpica/source/compiler/aslmapoutput.c > @@ -279,7 +279,7 @@ MpEmitGpioInfo ( > /* Print header info for the controller itself */ > > if (!PrevDeviceName || > - ACPI_STRCMP (PrevDeviceName, Info->DeviceName)) > + strcmp (PrevDeviceName, Info->DeviceName)) > { > FlPrintFile (ASL_FILE_MAP_OUTPUT, > "\n\nGPIO Controller: %-8s %-28s", > @@ -432,7 +432,7 @@ MpEmitSerialInfo ( > /* Print header info for the controller itself */ > > if (!PrevDeviceName || > - ACPI_STRCMP (PrevDeviceName, Info->DeviceName)) > + strcmp (PrevDeviceName, Info->DeviceName)) > { > FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\n%s Controller: ", > Type); > diff --git a/src/acpica/source/compiler/aslmethod.c b/src/acpica/source/compiler/aslmethod.c > index b8ca5e9..c997c54 100644 > --- a/src/acpica/source/compiler/aslmethod.c > +++ b/src/acpica/source/compiler/aslmethod.c > @@ -502,7 +502,7 @@ MtMethodAnalysisWalkBegin ( > > /* Special typechecking for _HID */ > > - if (!ACPI_STRCMP (METHOD_NAME__HID, Op->Asl.NameSeg)) > + if (!strcmp (METHOD_NAME__HID, Op->Asl.NameSeg)) > { > Next = Op->Asl.Child->Asl.Next; > AnCheckId (Next, ASL_TYPE_HID); > @@ -510,7 +510,7 @@ MtMethodAnalysisWalkBegin ( > > /* Special typechecking for _CID */ > > - else if (!ACPI_STRCMP (METHOD_NAME__CID, Op->Asl.NameSeg)) > + else if (!strcmp (METHOD_NAME__CID, Op->Asl.NameSeg)) > { > Next = Op->Asl.Child->Asl.Next; > > diff --git a/src/acpica/source/compiler/aslopcodes.c b/src/acpica/source/compiler/aslopcodes.c > index 36044b0..809e5e7 100644 > --- a/src/acpica/source/compiler/aslopcodes.c > +++ b/src/acpica/source/compiler/aslopcodes.c > @@ -708,7 +708,7 @@ OpcDoEisaId ( > * The EISAID string must be exactly 7 characters and of the form > * "UUUXXXX" -- 3 uppercase letters and 4 hex digits (e.g., "PNP0001") > */ > - if (ACPI_STRLEN (InString) != 7) > + if (strlen (InString) != 7) > { > Status = AE_BAD_PARAMETER; > } > @@ -927,7 +927,7 @@ OpcFindName ( > > for (i = 0, Str = List[0]; Str; i++, Str = List[i]) > { > - if (!(ACPI_STRNCMP (Str, Name, ACPI_STRLEN (Name)))) > + if (!(strncmp (Str, Name, strlen (Name)))) > { > *Index = i; > return (TRUE); > @@ -979,7 +979,7 @@ OpcDoPld ( > return; > } > > - ACPI_MEMSET (&PldInfo, 0, sizeof (ACPI_PLD_INFO)); > + memset (&PldInfo, 0, sizeof (ACPI_PLD_INFO)); > > Node = Op->Asl.Child; > while (Node) > diff --git a/src/acpica/source/compiler/asloperands.c b/src/acpica/source/compiler/asloperands.c > index ab06d14..71d94c7 100644 > --- a/src/acpica/source/compiler/asloperands.c > +++ b/src/acpica/source/compiler/asloperands.c > @@ -1004,7 +1004,7 @@ OpnDoDefinitionBlock ( > if (Child->Asl.Value.String) > { > Gbl_TableSignature = Child->Asl.Value.String; > - if (ACPI_STRLEN (Gbl_TableSignature) != 4) > + if (strlen (Gbl_TableSignature) != 4) > { > AslError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, Child, > "Length not exactly 4"); > @@ -1039,9 +1039,9 @@ OpnDoDefinitionBlock ( > Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; > if (Child->Asl.Value.String) > { > - Length = ACPI_STRLEN (Child->Asl.Value.String); > + Length = strlen (Child->Asl.Value.String); > Gbl_TableId = UtStringCacheCalloc (Length + 1); > - ACPI_STRCPY (Gbl_TableId, Child->Asl.Value.String); > + strcpy (Gbl_TableId, Child->Asl.Value.String); > > /* > * Convert anything non-alphanumeric to an underscore. This > diff --git a/src/acpica/source/compiler/aslopt.c b/src/acpica/source/compiler/aslopt.c > index 65fce99..8aae62e 100644 > --- a/src/acpica/source/compiler/aslopt.c > +++ b/src/acpica/source/compiler/aslopt.c > @@ -240,9 +240,9 @@ OptSearchToRoot ( > /* We must allocate a new string for the name (TargetPath gets deleted) */ > > *NewPath = UtStringCacheCalloc (ACPI_NAME_SIZE + 1); > - ACPI_STRCPY (*NewPath, Path); > + strcpy (*NewPath, Path); > > - if (ACPI_STRNCMP (*NewPath, "_T_", 3)) > + if (strncmp (*NewPath, "_T_", 3)) > { > AslError (ASL_OPTIMIZATION, ASL_MSG_SINGLE_NAME_OPTIMIZATION, Op, > *NewPath); > @@ -413,7 +413,7 @@ OptBuildShortestPath ( > Index = TargetPath->Length; > } > > - ACPI_STRCPY (&NewPathExternal[i], &((char *) TargetPath->Pointer)[Index]); > + strcpy (&NewPathExternal[i], &((char *) TargetPath->Pointer)[Index]); > ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, " %-24s", NewPathExternal)); > > /* > @@ -430,11 +430,11 @@ OptBuildShortestPath ( > return (Status); > } > > - if (ACPI_STRLEN (NewPath) >= AmlNameStringLength) > + if (strlen (NewPath) >= AmlNameStringLength) > { > ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, > " NOT SHORTER (New %u old %u)", > - (UINT32) ACPI_STRLEN (NewPath), (UINT32) AmlNameStringLength)); > + (UINT32) strlen (NewPath), (UINT32) AmlNameStringLength)); > ACPI_FREE (NewPathExternal); > return (AE_NOT_FOUND); > } > @@ -669,7 +669,7 @@ OptOptimizeNamePath ( > * The original path must be longer than one NameSeg (4 chars) for there > * to be any possibility that it can be optimized to a shorter string > */ > - AmlNameStringLength = ACPI_STRLEN (AmlNameString); > + AmlNameStringLength = strlen (AmlNameString); > if (AmlNameStringLength <= ACPI_NAME_SIZE) > { > ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, > @@ -817,7 +817,7 @@ OptOptimizeNamePath ( > */ > if (ACPI_SUCCESS (Status)) > { > - HowMuchShorter = (AmlNameStringLength - ACPI_STRLEN (NewPath)); > + HowMuchShorter = (AmlNameStringLength - strlen (NewPath)); > OptTotal += HowMuchShorter; > > ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, > @@ -833,12 +833,12 @@ OptOptimizeNamePath ( > * (alias name) is the second operand > */ > Op->Asl.Child->Asl.Next->Asl.Value.String = NewPath; > - Op->Asl.Child->Asl.Next->Asl.AmlLength = ACPI_STRLEN (NewPath); > + Op->Asl.Child->Asl.Next->Asl.AmlLength = strlen (NewPath); > } > else > { > Op->Asl.Child->Asl.Value.String = NewPath; > - Op->Asl.Child->Asl.AmlLength = ACPI_STRLEN (NewPath); > + Op->Asl.Child->Asl.AmlLength = strlen (NewPath); > } > } > else if (Flags & AML_CREATE) > @@ -853,14 +853,14 @@ OptOptimizeNamePath ( > /* Update the parse node with the new NamePath */ > > NextOp->Asl.Value.String = NewPath; > - NextOp->Asl.AmlLength = ACPI_STRLEN (NewPath); > + NextOp->Asl.AmlLength = strlen (NewPath); > } > else > { > /* Update the parse node with the new NamePath */ > > Op->Asl.Value.String = NewPath; > - Op->Asl.AmlLength = ACPI_STRLEN (NewPath); > + Op->Asl.AmlLength = strlen (NewPath); > } > } > else > diff --git a/src/acpica/source/compiler/aslprintf.c b/src/acpica/source/compiler/aslprintf.c > index 1ace80f..593ea65 100644 > --- a/src/acpica/source/compiler/aslprintf.c > +++ b/src/acpica/source/compiler/aslprintf.c > @@ -258,7 +258,7 @@ OpcParsePrintf ( > if (StringToProcess) > { > NewString = UtStringCacheCalloc (StringLength + 1); > - ACPI_STRNCPY (NewString, StartPosition, StringLength); > + strncpy (NewString, StartPosition, StringLength); > > NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL); > NewOp->Asl.Value.String = NewString; > @@ -347,7 +347,7 @@ OpcParsePrintf ( > if (StringToProcess) > { > NewString = UtStringCacheCalloc (StringLength + 1); > - ACPI_STRNCPY (NewString, StartPosition, StringLength); > + strncpy (NewString, StartPosition, StringLength); > > NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL); > NewOp->Asl.Value.String = NewString; > diff --git a/src/acpica/source/compiler/aslstartup.c b/src/acpica/source/compiler/aslstartup.c > index 5cc0959..0f8c728 100644 > --- a/src/acpica/source/compiler/aslstartup.c > +++ b/src/acpica/source/compiler/aslstartup.c > @@ -431,6 +431,8 @@ AslDoOneFile ( > return (AE_ERROR); > } > > + Gbl_OriginalInputFileSize = FlGetFileSize (ASL_FILE_INPUT); > + > /* Determine input file type */ > > Gbl_FileType = AslDetectSourceFileType (&Gbl_Files[ASL_FILE_INPUT]); > diff --git a/src/acpica/source/compiler/aslsupport.l b/src/acpica/source/compiler/aslsupport.l > index c7f1f93..f1a7c59 100644 > --- a/src/acpica/source/compiler/aslsupport.l > +++ b/src/acpica/source/compiler/aslsupport.l > @@ -185,6 +185,7 @@ AslDoLineDirective ( > char *Filename; > UINT32 i; > > + Gbl_HasIncludeFiles = TRUE; > > /* Eat the entire line that contains the #line directive */ > > @@ -785,7 +786,7 @@ DoCharacter: > * string and resume processing of the next character > */ > ConvertBuffer[i] = 0; > - Digit = (UINT8) ACPI_STRTOUL (ConvertBuffer, NULL, 8); > + Digit = (UINT8) strtoul (ConvertBuffer, NULL, 8); > > /* Check for NULL or non-ascii character (ignore if so) */ > > @@ -821,7 +822,7 @@ DoCharacter: > > /* Up to two hex digits allowed */ > > - if (!ACPI_IS_XDIGIT (StringChar) || > + if (!isxdigit (StringChar) || > (i > 1)) > { > /* > @@ -829,7 +830,7 @@ DoCharacter: > * string and resume processing of the next character > */ > ConvertBuffer[i] = 0; > - Digit = (UINT8) ACPI_STRTOUL (ConvertBuffer, NULL, 16); > + Digit = (UINT8) strtoul (ConvertBuffer, NULL, 16); > > /* Check for NULL or non-ascii character (ignore if so) */ > > @@ -902,7 +903,7 @@ CompletedString: > return (FALSE); > } > > - ACPI_STRCPY (CleanString, MsgBuffer); > + strcpy (CleanString, MsgBuffer); > AslCompilerlval.s = CleanString; > return (TRUE); > > diff --git a/src/acpica/source/compiler/asltypes.h b/src/acpica/source/compiler/asltypes.h > index 21c64ed..0f08ae4 100644 > --- a/src/acpica/source/compiler/asltypes.h > +++ b/src/acpica/source/compiler/asltypes.h > @@ -220,32 +220,56 @@ typedef struct asl_file_status > /* > * File types. Note: Any changes to this table must also be reflected > * in the Gbl_Files array. > + * > + * Corresponding filename suffixes are in comments > + * > + * NOTE: Don't move the first 4 file types > */ > typedef enum > { > ASL_FILE_STDOUT = 0, > ASL_FILE_STDERR, > - ASL_FILE_INPUT, > - ASL_FILE_AML_OUTPUT, /* Don't move these first 4 file types */ > - ASL_FILE_SOURCE_OUTPUT, > - ASL_FILE_PREPROCESSOR, > - ASL_FILE_LISTING_OUTPUT, > - ASL_FILE_HEX_OUTPUT, > - ASL_FILE_NAMESPACE_OUTPUT, > - ASL_FILE_DEBUG_OUTPUT, > - ASL_FILE_ASM_SOURCE_OUTPUT, > - ASL_FILE_C_SOURCE_OUTPUT, > - ASL_FILE_ASM_INCLUDE_OUTPUT, > - ASL_FILE_C_INCLUDE_OUTPUT, > - ASL_FILE_C_OFFSET_OUTPUT, > - ASL_FILE_MAP_OUTPUT > + ASL_FILE_INPUT, /* .asl */ > + ASL_FILE_AML_OUTPUT, /* .aml */ > + ASL_FILE_SOURCE_OUTPUT, /* .src */ > + ASL_FILE_PREPROCESSOR, /* .pre */ > + ASL_FILE_PREPROCESSOR_USER, /* .i */ > + ASL_FILE_LISTING_OUTPUT, /* .lst */ > + ASL_FILE_HEX_OUTPUT, /* .hex */ > + ASL_FILE_NAMESPACE_OUTPUT, /* .nsp */ > + ASL_FILE_DEBUG_OUTPUT, /* .txt */ > + ASL_FILE_ASM_SOURCE_OUTPUT, /* .asm */ > + ASL_FILE_C_SOURCE_OUTPUT, /* .c */ > + ASL_FILE_ASM_INCLUDE_OUTPUT,/* .inc */ > + ASL_FILE_C_INCLUDE_OUTPUT, /* .h */ > + ASL_FILE_C_OFFSET_OUTPUT, /* offset.h */ > + ASL_FILE_MAP_OUTPUT /* .map */ > > } ASL_FILE_TYPES; > > > -#define ASL_MAX_FILE_TYPE 15 > +#define ASL_MAX_FILE_TYPE 16 > #define ASL_NUM_FILES (ASL_MAX_FILE_TYPE + 1) > > +/* filename suffixes for output files */ > + > +#define FILE_SUFFIX_PREPROC_USER "i " > +#define FILE_SUFFIX_PREPROCESSOR "pre" > +#define FILE_SUFFIX_AML_CODE "aml" > +#define FILE_SUFFIX_MAP "map" > +#define FILE_SUFFIX_LISTING "lst" > +#define FILE_SUFFIX_HEX_DUMP "hex" > +#define FILE_SUFFIX_DEBUG "txt" > +#define FILE_SUFFIX_SOURCE "src" > +#define FILE_SUFFIX_NAMESPACE "nsp" > +#define FILE_SUFFIX_ASM_SOURCE "asm" > +#define FILE_SUFFIX_C_SOURCE "c" > +#define FILE_SUFFIX_DISASSEMBLY "dsl" > +#define FILE_SUFFIX_ASM_INCLUDE "inc" > +#define FILE_SUFFIX_C_INCLUDE "h" > +#define FILE_SUFFIX_ASL_CODE "asl" > +#define FILE_SUFFIX_C_OFFSET "offset.h" > + > > /* Cache block structure for ParseOps and Strings */ > > diff --git a/src/acpica/source/compiler/aslutils.c b/src/acpica/source/compiler/aslutils.c > index a5e53c7..32d120d 100644 > --- a/src/acpica/source/compiler/aslutils.c > +++ b/src/acpica/source/compiler/aslutils.c > @@ -513,17 +513,20 @@ UtDisplaySummary ( > "%-14s %s - %u lines, %u bytes, %u keywords\n", > "ASL Input:", > Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_CurrentLineNumber, > - Gbl_InputByteCount, TotalKeywords); > + Gbl_OriginalInputFileSize, TotalKeywords); > > /* AML summary */ > > if ((Gbl_ExceptionCount[ASL_ERROR] == 0) || (Gbl_IgnoreErrors)) > { > - FlPrintFile (FileId, > - "%-14s %s - %u bytes, %u named objects, %u executable opcodes\n", > - "AML Output:", > - Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength, > - TotalNamedObjects, TotalExecutableOpcodes); > + if (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle) > + { > + FlPrintFile (FileId, > + "%-14s %s - %u bytes, %u named objects, %u executable opcodes\n", > + "AML Output:", > + Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength, > + TotalNamedObjects, TotalExecutableOpcodes); > + } > } > } > > @@ -543,9 +546,9 @@ UtDisplaySummary ( > continue; > } > > - /* .I is a temp file unless specifically requested */ > + /* .PRE is the preprocessor intermediate file */ > > - if ((i == ASL_FILE_PREPROCESSOR) && (!Gbl_PreprocessorOutputFlag)) > + if ((i == ASL_FILE_PREPROCESSOR) && (!Gbl_KeepPreprocessorTempFile)) > { > continue; > } > @@ -1004,7 +1007,7 @@ UtDoConstant ( > char ErrBuf[64]; > > > - Status = UtStrtoul64 (String, 0, &Converted); > + Status = stroul64 (String, 0, &Converted); > if (ACPI_FAILURE (Status)) > { > sprintf (ErrBuf, "%s %s\n", "Conversion error:", > @@ -1020,7 +1023,7 @@ UtDoConstant ( > > /******************************************************************************* > * > - * FUNCTION: UtStrtoul64 > + * FUNCTION: stroul64 > * > * PARAMETERS: String - Null terminated string > * Terminater - Where a pointer to the terminating byte > @@ -1034,7 +1037,7 @@ UtDoConstant ( > ******************************************************************************/ > > ACPI_STATUS > -UtStrtoul64 ( > +stroul64 ( > char *String, > UINT32 Base, > UINT64 *RetInteger) > diff --git a/src/acpica/source/compiler/asluuid.c b/src/acpica/source/compiler/asluuid.c > index db2dd34..b9854b9 100644 > --- a/src/acpica/source/compiler/asluuid.c > +++ b/src/acpica/source/compiler/asluuid.c > @@ -141,7 +141,7 @@ AuValidateUuid ( > UINT32 i; > > > - if (!InString || (ACPI_STRLEN (InString) != UUID_STRING_LENGTH)) > + if (!InString || (strlen (InString) != UUID_STRING_LENGTH)) > { > return (AE_BAD_PARAMETER); > } > diff --git a/src/acpica/source/compiler/dtcompile.c b/src/acpica/source/compiler/dtcompile.c > index 5c75f4b..98d663e 100644 > --- a/src/acpica/source/compiler/dtcompile.c > +++ b/src/acpica/source/compiler/dtcompile.c > @@ -374,7 +374,7 @@ DtCompileDataTable ( > return (AE_ERROR); > } > > - Gbl_Signature = UtStringCacheCalloc (ACPI_STRLEN (Signature) + 1); > + Gbl_Signature = UtStringCacheCalloc (strlen (Signature) + 1); > strcpy (Gbl_Signature, Signature); > > /* > @@ -430,6 +430,8 @@ DtCompileDataTable ( > TableData = AcpiDmGetTableData (Signature); > if (!TableData || Gbl_CompileGeneric) > { > + /* Unknown table signature and/or force generic compile */ > + > DtCompileGeneric ((void **) FieldList, NULL, NULL); > goto FinishHeader; > } > @@ -526,7 +528,7 @@ DtCompileTable ( > /* Ignore optional subtable if name does not match */ > > if ((Info->Flags & DT_OPTIONAL) && > - ACPI_STRCMP ((*Field)->Name, Info->Name)) > + strcmp ((*Field)->Name, Info->Name)) > { > *RetSubtable = NULL; > return (AE_OK); > @@ -663,7 +665,7 @@ DtCompileTable ( > > DtSetSubtableLength (InlineSubtable); > > - ACPI_MEMCPY (Buffer, InlineSubtable->Buffer, FieldLength); > + memcpy (Buffer, InlineSubtable->Buffer, FieldLength); > LocalField = *Field; > break; > > diff --git a/src/acpica/source/compiler/dtexpress.c b/src/acpica/source/compiler/dtexpress.c > index 2fdd4d2..e5af53b 100644 > --- a/src/acpica/source/compiler/dtexpress.c > +++ b/src/acpica/source/compiler/dtexpress.c > @@ -485,7 +485,7 @@ DtLookupLabel ( > LabelField = Gbl_LabelList; > while (LabelField) > { > - if (!ACPI_STRCMP (Name, LabelField->Value)) > + if (!strcmp (Name, LabelField->Value)) > { > return (LabelField); > } > diff --git a/src/acpica/source/compiler/dtfield.c b/src/acpica/source/compiler/dtfield.c > index f3810c2..adde63d 100644 > --- a/src/acpica/source/compiler/dtfield.c > +++ b/src/acpica/source/compiler/dtfield.c > @@ -238,7 +238,7 @@ DtCompileString ( > UINT32 Length; > > > - Length = ACPI_STRLEN (Field->Value); > + Length = strlen (Field->Value); > > /* Check if the string is too long for the field */ > > @@ -249,7 +249,7 @@ DtCompileString ( > Length = ByteLength; > } > > - ACPI_MEMCPY (Buffer, Field->Value, Length); > + memcpy (Buffer, Field->Value, Length); > } > > > @@ -284,7 +284,7 @@ DtCompileUnicode ( > > AsciiString = Field->Value; > UnicodeString = (UINT16 *) Buffer; > - Count = ACPI_STRLEN (AsciiString) + 1; > + Count = strlen (AsciiString) + 1; > > /* Convert to Unicode string (including null terminator) */ > > @@ -390,7 +390,7 @@ DtCompileInteger ( > > /* TBD: Should use a flag rather than compare "Reserved" */ > > - if (!ACPI_STRCMP (Field->Name, "Reserved")) > + if (!strcmp (Field->Name, "Reserved")) > { > if (Flags & DT_NON_ZERO) > { > @@ -431,7 +431,7 @@ DtCompileInteger ( > DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, MsgBuffer); > } > > - ACPI_MEMCPY (Buffer, &Value, ByteLength); > + memcpy (Buffer, &Value, ByteLength); > return; > } > > @@ -463,7 +463,7 @@ DtNormalizeBuffer ( > char c; > > > - NewBuffer = UtLocalCalloc (ACPI_STRLEN (Buffer) + 1); > + NewBuffer = UtLocalCalloc (strlen (Buffer) + 1); > TmpBuffer = NewBuffer; > > while ((c = *Buffer++)) > diff --git a/src/acpica/source/compiler/dtio.c b/src/acpica/source/compiler/dtio.c > index 9b044ee..7d7c223 100644 > --- a/src/acpica/source/compiler/dtio.c > +++ b/src/acpica/source/compiler/dtio.c > @@ -201,7 +201,7 @@ DtTrim ( > > /* Skip lines that start with a space */ > > - if (!ACPI_STRCMP (String, " ")) > + if (!strcmp (String, " ")) > { > ReturnString = UtStringCacheCalloc (1); > return (ReturnString); > @@ -210,7 +210,7 @@ DtTrim ( > /* Setup pointers to start and end of input string */ > > Start = String; > - End = String + ACPI_STRLEN (String) - 1; > + End = String + strlen (String) - 1; > > /* Find first non-whitespace character */ > > @@ -252,9 +252,9 @@ DtTrim ( > > Length = ACPI_PTR_DIFF (End, Start) + 1; > ReturnString = UtStringCacheCalloc (Length + 1); > - if (ACPI_STRLEN (Start)) > + if (strlen (Start)) > { > - ACPI_STRNCPY (ReturnString, Start, Length); > + strncpy (ReturnString, Start, Length); > } > > ReturnString[Length] = 0; > @@ -385,7 +385,7 @@ DtParseLine ( > Length = ACPI_PTR_DIFF (End, Start); > > TmpName = UtLocalCalloc (Length + 1); > - ACPI_STRNCPY (TmpName, Start, Length); > + strncpy (TmpName, Start, Length); > Name = DtTrim (TmpName); > ACPI_FREE (TmpName); > > @@ -432,7 +432,7 @@ DtParseLine ( > Length = ACPI_PTR_DIFF (End, Start); > TmpValue = UtLocalCalloc (Length + 1); > > - ACPI_STRNCPY (TmpValue, Start, Length); > + strncpy (TmpValue, Start, Length); > Value = DtTrim (TmpValue); > ACPI_FREE (TmpValue); > > @@ -487,7 +487,7 @@ DtGetNextLine ( > int c; > > > - ACPI_MEMSET (Gbl_CurrentLineBuffer, 0, Gbl_LineBufferSize); > + memset (Gbl_CurrentLineBuffer, 0, Gbl_LineBufferSize); > for (i = 0; ;) > { > /* > @@ -969,7 +969,7 @@ DtDumpBuffer ( > } > > BufChar = Buffer[(ACPI_SIZE) i + j]; > - if (ACPI_IS_PRINT (BufChar)) > + if (isprint (BufChar)) > { > FlPrintFile (FileId, "%c", BufChar); > } > diff --git a/src/acpica/source/compiler/dtparser.y b/src/acpica/source/compiler/dtparser.y > index 96e6c14..e48799b 100644 > --- a/src/acpica/source/compiler/dtparser.y > +++ b/src/acpica/source/compiler/dtparser.y > @@ -120,6 +120,13 @@ > #define _COMPONENT DT_COMPILER > ACPI_MODULE_NAME ("dtparser") > > +void * AslLocalAllocate (unsigned int Size); > + > +/* Bison/yacc configuration */ > + > +#undef alloca > +#define alloca AslLocalAllocate > + > int DtParserlex (void); > int DtParserparse (void); > void DtParsererror (char const *msg); > @@ -234,15 +241,15 @@ Expression > > /* Default base for a non-prefixed integer is 16 */ > > - | EXPOP_NUMBER { UtStrtoul64 (DtParsertext, 16, &$$);} > + | EXPOP_NUMBER { stroul64 (DtParsertext, 16, &$$);} > > /* Standard hex number (0x1234) */ > > - | EXPOP_HEX_NUMBER { UtStrtoul64 (DtParsertext, 16, &$$);} > + | EXPOP_HEX_NUMBER { stroul64 (DtParsertext, 16, &$$);} > > - /* TBD: Decimal number with prefix (0d1234) - Not supported by UtStrtoul64 at this time */ > + /* TBD: Decimal number with prefix (0d1234) - Not supported by stroul64 at this time */ > > - | EXPOP_DECIMAL_NUMBER { UtStrtoul64 (DtParsertext, 10, &$$);} > + | EXPOP_DECIMAL_NUMBER { stroul64 (DtParsertext, 10, &$$);} > ; > %% > > diff --git a/src/acpica/source/compiler/dtsubtable.c b/src/acpica/source/compiler/dtsubtable.c > index 2461cc2..348758c 100644 > --- a/src/acpica/source/compiler/dtsubtable.c > +++ b/src/acpica/source/compiler/dtsubtable.c > @@ -152,7 +152,7 @@ DtCreateSubtable ( > > String = UtStringCacheCalloc (Length); > Subtable->Buffer = ACPI_CAST_PTR (UINT8, String); > - ACPI_MEMCPY (Subtable->Buffer, Buffer, Length); > + memcpy (Subtable->Buffer, Buffer, Length); > > Subtable->Length = Length; > Subtable->TotalLength = Length; > @@ -451,6 +451,6 @@ DtSetSubtableLength ( > return; > } > > - ACPI_MEMCPY (Subtable->LengthField, &Subtable->TotalLength, > + memcpy (Subtable->LengthField, &Subtable->TotalLength, > Subtable->SizeOfLengthField); > } > diff --git a/src/acpica/source/compiler/dttable.c b/src/acpica/source/compiler/dttable.c > index db9ac24..80b8a95 100644 > --- a/src/acpica/source/compiler/dttable.c > +++ b/src/acpica/source/compiler/dttable.c > @@ -1896,7 +1896,7 @@ DtCompileIvrs ( > if (IvrsHeader->Type == ACPI_IVRS_TYPE_HARDWARE) > { > while (*PFieldList && > - !ACPI_STRCMP ((*PFieldList)->Name, "Entry Type")) > + !strcmp ((*PFieldList)->Name, "Entry Type")) > { > SubtableStart = *PFieldList; > DtCompileInteger (&EntryType, *PFieldList, 1, 0); > @@ -3475,13 +3475,13 @@ DtCompileGeneric ( > > /* Now we can actually compile the parse tree */ > > - if (*Length) > + if (Length && *Length) > { > *Length = 0; > } > while (*PFieldList) > { > - if (Name && !ACPI_STRCMP ((*PFieldList)->Name, Name)) > + if (Name && !strcmp ((*PFieldList)->Name, Name)) > { > break; > } > diff --git a/src/acpica/source/compiler/dttemplate.c b/src/acpica/source/compiler/dttemplate.c > index 809ca61..8c2f8b2 100644 > --- a/src/acpica/source/compiler/dttemplate.c > +++ b/src/acpica/source/compiler/dttemplate.c > @@ -157,6 +157,7 @@ AcpiUtIsSpecialTable ( > { > > if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_DSDT) || > + ACPI_COMPARE_NAME (Signature, ACPI_SIG_OSDT) || > ACPI_COMPARE_NAME (Signature, ACPI_SIG_SSDT) || > ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS) || > ACPI_COMPARE_NAME (Signature, ACPI_RSDP_NAME)) > @@ -199,8 +200,8 @@ DtCreateTemplates ( > } > > AcpiUtStrupr (Signature); > - if (!ACPI_STRCMP (Signature, "ALL") || > - !ACPI_STRCMP (Signature, "*")) > + if (!strcmp (Signature, "ALL") || > + !strcmp (Signature, "*")) > { > /* Create all available/known templates */ > > @@ -399,7 +400,7 @@ DtCreateOneTemplate ( > AcpiOsPrintf ("/*\n"); > AcpiOsPrintf (ACPI_COMMON_HEADER ("iASL Compiler/Disassembler", " * ")); > > - AcpiOsPrintf (" * Template for [%4.4s] ACPI Table\n", > + AcpiOsPrintf (" * Template for [%4.4s] ACPI Table", > Signature); > > /* Dump the actual ACPI table */ > @@ -408,6 +409,8 @@ DtCreateOneTemplate ( > { > /* Normal case, tables that appear in AcpiDmTableData */ > > + AcpiOsPrintf (" (static data table)\n"); > + > if (Gbl_VerboseTemplates) > { > AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength]" > @@ -416,7 +419,7 @@ DtCreateOneTemplate ( > else > { > AcpiOsPrintf (" * Format: [ByteLength]" > - " FieldName : HexFieldValue\n */\n\n"); > + " FieldName : HexFieldValue\n */\n"); > } > > AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, > @@ -424,9 +427,11 @@ DtCreateOneTemplate ( > } > else > { > - /* Special ACPI tables - DSDT, SSDT, FADT, RSDP */ > + /* Special ACPI tables - DSDT, SSDT, OSDT, FADT, RSDP */ > + > + AcpiOsPrintf (" (AML byte code table)\n"); > > - AcpiOsPrintf (" */\n\n"); > + AcpiOsPrintf (" */\n"); > if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_DSDT)) > { > Actual = fwrite (TemplateDsdt, 1, sizeof (TemplateDsdt) -1, File); > @@ -449,6 +454,17 @@ DtCreateOneTemplate ( > goto Cleanup; > } > } > + else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_OSDT)) > + { > + Actual = fwrite (TemplateOsdt, 1, sizeof (TemplateOsdt) -1, File); > + if (Actual != sizeof (TemplateOsdt) -1) > + { > + fprintf (stderr, > + "Could not write to output file %s\n", DisasmFilename); > + Status = AE_ERROR; > + goto Cleanup; > + } > + } > else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS)) /* FADT */ > { > AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, > diff --git a/src/acpica/source/compiler/dttemplate.h b/src/acpica/source/compiler/dttemplate.h > index 22eb736..9b08e4b 100644 > --- a/src/acpica/source/compiler/dttemplate.h > +++ b/src/acpica/source/compiler/dttemplate.h > @@ -117,7 +117,7 @@ > #define __DTTEMPLATE_H > > > -/* Special templates for DSDT and SSDT (AML byte-code tables) */ > +/* Special templates for the ASL/AML tables: DSDT, SSDT, and OSDT */ > > const char TemplateDsdt[] = > "DefinitionBlock (\"dsdt.aml\", \"DSDT\", 2, \"Intel\", \"Template\", 0x00000001)\n" > @@ -137,6 +137,15 @@ const char TemplateSsdt[] = > " }\n" > "}\n\n"; > > +const char TemplateOsdt[] = > + "DefinitionBlock (\"osdt.aml\", \"OSDT\", 2, \"Intel\", \"Template\", 0x00000001)\n" > + "{\n" > + " Method (MAIN, 0, NotSerialized)\n" > + " {\n" > + " Return (Zero)\n" > + " }\n" > + "}\n\n"; > + > > /* Templates for ACPI data tables */ > > diff --git a/src/acpica/source/compiler/dtutils.c b/src/acpica/source/compiler/dtutils.c > index 658cde6..9e6db68 100644 > --- a/src/acpica/source/compiler/dtutils.c > +++ b/src/acpica/source/compiler/dtutils.c > @@ -313,7 +313,7 @@ DtStrtoul64 ( > > while (*ThisChar) > { > - if (ACPI_IS_DIGIT (*ThisChar)) > + if (isdigit (*ThisChar)) > { > /* Convert ASCII 0-9 to Decimal value */ > > @@ -321,8 +321,8 @@ DtStrtoul64 ( > } > else /* Letter */ > { > - ThisDigit = (UINT32) ACPI_TOUPPER (*ThisChar); > - if (!ACPI_IS_XDIGIT ((char) ThisDigit)) > + ThisDigit = (UINT32) toupper (*ThisChar); > + if (!isxdigit ((char) ThisDigit)) > { > /* Not A-F */ > > @@ -640,7 +640,7 @@ DtGetFieldLength ( > Value = DtGetFieldValue (Field); > if (Value) > { > - ByteLength = ACPI_STRLEN (Value) + 1; > + ByteLength = strlen (Value) + 1; > } > else > { /* At this point, this is a fatal error */ > @@ -705,7 +705,7 @@ DtGetFieldLength ( > > /* TBD: error if Value is NULL? (as below?) */ > > - ByteLength = (ACPI_STRLEN (Value) + 1) * sizeof(UINT16); > + ByteLength = (strlen (Value) + 1) * sizeof(UINT16); > break; > > default: > diff --git a/src/acpica/source/compiler/prparser.y b/src/acpica/source/compiler/prparser.y > index 990b79b..68c140f 100644 > --- a/src/acpica/source/compiler/prparser.y > +++ b/src/acpica/source/compiler/prparser.y > @@ -120,6 +120,13 @@ > #define _COMPONENT ASL_PREPROCESSOR > ACPI_MODULE_NAME ("prparser") > > +void * AslLocalAllocate (unsigned int Size); > + > +/* Bison/yacc configuration */ > + > +#undef alloca > +#define alloca AslLocalAllocate > + > int PrParserlex (void); > int PrParserparse (void); > void PrParsererror (char const *msg); > @@ -247,11 +254,11 @@ Expression > > /* Default base for a non-prefixed integer is 10 */ > > - | EXPOP_NUMBER { UtStrtoul64 (PrParsertext, 10, &$$);} > + | EXPOP_NUMBER { stroul64 (PrParsertext, 10, &$$);} > > /* Standard hex number (0x1234) */ > > - | EXPOP_HEX_NUMBER { UtStrtoul64 (PrParsertext, 16, &$$);} > + | EXPOP_HEX_NUMBER { stroul64 (PrParsertext, 16, &$$);} > ; > %% > > diff --git a/src/acpica/source/compiler/prscan.c b/src/acpica/source/compiler/prscan.c > index cafcea5..51657d6 100644 > --- a/src/acpica/source/compiler/prscan.c > +++ b/src/acpica/source/compiler/prscan.c > @@ -139,6 +139,14 @@ PrDoDirective ( > char *DirectiveToken, > char **Next); > > +static void > +PrGetNextLineInit ( > + void); > + > +static UINT32 > +PrGetNextLine ( > + FILE *Handle); > + > static int > PrMatchDirective ( > char *Directive); > @@ -258,7 +266,7 @@ PrInitializeGlobals ( > /* Init globals */ > > Gbl_InputFileList = NULL; > - Gbl_CurrentLineNumber = 0; > + Gbl_CurrentLineNumber = 1; > Gbl_PreprocessorLineNumber = 1; > Gbl_PreprocessorError = FALSE; > > @@ -343,7 +351,7 @@ PrDoPreprocess ( > > } while (MoreInputFiles); > > - /* Point compiler input to the new preprocessor output file (.i) */ > + /* Point compiler input to the new preprocessor output file (.pre) */ > > FlCloseFile (ASL_FILE_INPUT); > Gbl_Files[ASL_FILE_INPUT].Handle = Gbl_Files[ASL_FILE_PREPROCESSOR].Handle; > @@ -352,7 +360,10 @@ PrDoPreprocess ( > /* Reset globals to allow compiler to run */ > > FlSeekFile (ASL_FILE_INPUT, 0); > - Gbl_CurrentLineNumber = 1; > + if (!Gbl_PreprocessOnly) > + { > + Gbl_CurrentLineNumber = 0; > + } > > DbgPrint (ASL_DEBUG_OUTPUT, "Preprocessing phase complete \n\n"); > } > @@ -369,7 +380,8 @@ PrDoPreprocess ( > * DESCRIPTION: Preprocess one entire file, line-by-line. > * > * Input: Raw user ASL from ASL_FILE_INPUT > - * Output: Preprocessed file written to ASL_FILE_PREPROCESSOR > + * Output: Preprocessed file written to ASL_FILE_PREPROCESSOR and > + * (optionally) ASL_FILE_PREPROCESSOR_USER > * > ******************************************************************************/ > > @@ -377,7 +389,7 @@ static void > PrPreprocessInputFile ( > void) > { > - UINT32 Offset; > + UINT32 Status; > char *Token; > char *ReplaceString; > PR_DEFINE_INFO *DefineInfo; > @@ -386,10 +398,21 @@ PrPreprocessInputFile ( > int OffsetAdjust; > > > + PrGetNextLineInit (); > + > /* Scan line-by-line. Comments and blank lines are skipped by this function */ > > - while ((Offset = DtGetNextLine (Gbl_Files[ASL_FILE_INPUT].Handle)) != ASL_EOF) > + while ((Status = PrGetNextLine (Gbl_Files[ASL_FILE_INPUT].Handle)) != ASL_EOF) > { > + Gbl_CurrentLineNumber++; > + Gbl_LogicalLineNumber++; > + > + if ((Status == ASL_WITHIN_COMMENT) || > + (Status == ASL_BLANK_LINE)) > + { > + goto WriteEntireLine; > + } > + > /* Need a copy of the input line for strok() */ > > strcpy (Gbl_MainTokenBuffer, Gbl_CurrentLineBuffer); > @@ -469,24 +492,13 @@ PrPreprocessInputFile ( > Token = PrGetNextToken (NULL, PR_TOKEN_SEPARATORS, &Next); > } > > - /* > - * Emit a #line directive if necessary, to keep the line numbers in > - * the (.i) file synchronized with the original source code file, so > - * that the correct line number appears in any error messages > - * generated by the actual compiler. > - */ > - if (Gbl_CurrentLineNumber > (Gbl_PreviousLineNumber + 1)) > - { > - FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u\n", > - Gbl_CurrentLineNumber); > - } > - > - Gbl_PreviousLineNumber = Gbl_CurrentLineNumber; > Gbl_PreprocessorLineNumber++; > > + > +WriteEntireLine: > /* > * Now we can write the possibly modified source line to the > - * preprocessor (.i) file > + * preprocessor file(s). > */ > FlWriteFile (ASL_FILE_PREPROCESSOR, Gbl_CurrentLineBuffer, > strlen (Gbl_CurrentLineBuffer)); > @@ -726,7 +738,7 @@ PrDoDirective ( > { > #ifndef MACROS_SUPPORTED > AcpiOsPrintf ("%s ERROR - line %u: #define macros are not supported yet\n", > - Gbl_CurrentLineBuffer, Gbl_CurrentLineNumber); > + Gbl_CurrentLineBuffer, Gbl_LogicalLineNumber); > exit(1); > #else > PrAddMacro (Token, Next); > @@ -763,7 +775,7 @@ PrDoDirective ( > #endif > DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID > "New #define: %s->%s\n", > - Gbl_CurrentLineNumber, Token, Token2); > + Gbl_LogicalLineNumber, Token, Token2); > > PrAddDefine (Token, Token2, FALSE); > } > @@ -832,10 +844,7 @@ PrDoDirective ( > "User #line invocation %s\n", Gbl_CurrentLineNumber, > Token); > > - /* Update local line numbers */ > - > Gbl_CurrentLineNumber = (UINT32) Value; > - Gbl_PreviousLineNumber = 0; > > /* Emit #line into the preprocessor file */ > > @@ -911,6 +920,107 @@ SyntaxError: > > /******************************************************************************* > * > + * FUNCTION: PrGetNextLine, PrGetNextLineInit > + * > + * PARAMETERS: Handle - Open file handle for the source file > + * > + * RETURN: Status of the GetLine operation: > + * AE_OK - Normal line, OK status > + * ASL_WITHIN_COMMENT - Line is part of a multi-line comment > + * ASL_EOF - End-of-file reached > + * > + * DESCRIPTION: Get the next text line from the input file. Does not strip > + * comments. > + * > + ******************************************************************************/ > + > +#define PR_NORMAL_TEXT 0 > +#define PR_WITHIN_COMMENT 1 > + > +static UINT8 AcpiGbl_LineScanState = PR_NORMAL_TEXT; > + > +static void > +PrGetNextLineInit ( > + void) > +{ > + AcpiGbl_LineScanState = 0; > +} > + > +static UINT32 > +PrGetNextLine ( > + FILE *Handle) > +{ > + UINT32 i; > + int c = 0; > + int PreviousChar; > + > + > + /* Always clear the global line buffer */ > + > + memset (Gbl_CurrentLineBuffer, 0, Gbl_LineBufferSize); > + for (i = 0; ;) > + { > + /* > + * If line is too long, expand the line buffers. Also increases > + * Gbl_LineBufferSize. > + */ > + if (i >= Gbl_LineBufferSize) > + { > + UtExpandLineBuffers (); > + } > + > + PreviousChar = c; > + c = getc (Handle); > + if (c == EOF) > + { > + return (ASL_EOF); > + } > + > + /* We need to worry about multi-line slash-asterisk comments */ > + > + /* Check for comment open */ > + > + if ((AcpiGbl_LineScanState == PR_NORMAL_TEXT) && > + (PreviousChar == '/') && (c == '*')) > + { > + AcpiGbl_LineScanState = PR_WITHIN_COMMENT; > + } > + > + /* Check for comment close */ > + > + if ((AcpiGbl_LineScanState == PR_WITHIN_COMMENT) && > + (PreviousChar == '*') && (c == '/')) > + { > + AcpiGbl_LineScanState = PR_NORMAL_TEXT; > + } > + > + /* Always copy the character into line buffer */ > + > + Gbl_CurrentLineBuffer[i] = (char) c; > + i++; > + > + /* Always exit on end-of-line */ > + > + if (c == '\n') > + { > + /* Handle multi-line comments */ > + > + if (AcpiGbl_LineScanState == PR_WITHIN_COMMENT) > + { > + return (ASL_WITHIN_COMMENT); > + } > + if (i == 1) > + { > + return (ASL_BLANK_LINE); > + } > + return (AE_OK); > + } > + } > +} > + > + > +/******************************************************************************* > + * > * FUNCTION: PrMatchDirective > * > * PARAMETERS: Directive - Pointer to directive name token > diff --git a/src/acpica/source/compiler/prutils.c b/src/acpica/source/compiler/prutils.c > index 329f6d0..b367650 100644 > --- a/src/acpica/source/compiler/prutils.c > +++ b/src/acpica/source/compiler/prutils.c > @@ -454,6 +454,8 @@ PrPushInputFileStack ( > PR_FILE_NODE *Fnode; > > > + Gbl_HasIncludeFiles = TRUE; > + > /* Save the current state in an Fnode */ > > Fnode = UtLocalCalloc (sizeof (PR_FILE_NODE)); > @@ -478,11 +480,11 @@ PrPushInputFileStack ( > strcpy (Gbl_Files[ASL_FILE_INPUT].Filename, Filename); > > Gbl_Files[ASL_FILE_INPUT].Handle = InputFile; > - Gbl_PreviousLineNumber = 0; > - Gbl_CurrentLineNumber = 0; > + Gbl_CurrentLineNumber = 1; > > /* Emit a new #line directive for the include file */ > > + Gbl_CurrentLineNumber = 1; > FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\"\n", 1, Filename); > } > > @@ -532,12 +534,11 @@ PrPopInputFileStack ( > Gbl_Files[ASL_FILE_INPUT].Filename = Fnode->Filename; > Gbl_Files[ASL_FILE_INPUT].Handle = Fnode->File; > Gbl_CurrentLineNumber = Fnode->CurrentLineNumber; > - Gbl_PreviousLineNumber = 0; > > /* Emit a new #line directive after the include file */ > > FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\"\n", > - Gbl_CurrentLineNumber + 1, Fnode->Filename); > + Gbl_CurrentLineNumber, Fnode->Filename); > > /* All done with this node */ > > diff --git a/src/acpica/source/components/debugger/dbcmds.c b/src/acpica/source/components/debugger/dbcmds.c > index 8c723b3..db2f282 100644 > --- a/src/acpica/source/components/debugger/dbcmds.c > +++ b/src/acpica/source/components/debugger/dbcmds.c > @@ -183,7 +183,7 @@ AcpiDbConvertToNode ( > { > /* Numeric argument, convert */ > > - Address = ACPI_STRTOUL (InString, NULL, 16); > + Address = strtoul (InString, NULL, 16); > Node = ACPI_TO_POINTER (Address); > if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE))) > { > @@ -261,7 +261,7 @@ AcpiDbSleep ( > > /* Convert argument to binary and invoke the sleep state */ > > - SleepState = (UINT8) ACPI_STRTOUL (ObjectArg, NULL, 0); > + SleepState = (UINT8) strtoul (ObjectArg, NULL, 0); > AcpiDbDoOneSleepState (SleepState); > return_ACPI_STATUS (AE_OK); > } > @@ -633,7 +633,7 @@ AcpiDbDisplayInterfaces ( > > /* Install - install an interface */ > > - SubString = ACPI_STRSTR ("INSTALL", ActionArg); > + SubString = strstr ("INSTALL", ActionArg); > if (SubString) > { > Status = AcpiInstallInterface (InterfaceNameArg); > @@ -647,7 +647,7 @@ AcpiDbDisplayInterfaces ( > > /* Remove - remove an interface */ > > - SubString = ACPI_STRSTR ("REMOVE", ActionArg); > + SubString = strstr ("REMOVE", ActionArg); > if (SubString) > { > Status = AcpiRemoveInterface (InterfaceNameArg); > @@ -808,7 +808,7 @@ AcpiDmCompareAmlResources ( > > /* Check for descriptor byte match */ > > - else if (ACPI_MEMCMP (Aml1, Aml2, Aml1Length)) > + else if (memcmp (Aml1, Aml2, Aml1Length)) > { > AcpiOsPrintf ( > "**** Data mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X ****\n", > @@ -1210,7 +1210,7 @@ AcpiDbDisplayResources ( > > /* Asterisk means "display resources for all devices" */ > > - if (!ObjectArg || (!ACPI_STRCMP (ObjectArg, "*"))) > + if (!ObjectArg || (!strcmp (ObjectArg, "*"))) > { > (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, > ACPI_UINT32_MAX, AcpiDbDeviceResources, NULL, NULL, NULL); > @@ -1263,7 +1263,7 @@ AcpiDbGenerateGpe ( > ACPI_GPE_EVENT_INFO *GpeEventInfo; > > > - GpeNumber = ACPI_STRTOUL (GpeArg, NULL, 0); > + GpeNumber = strtoul (GpeArg, NULL, 0); > > /* > * If no block arg, or block arg == 0 or 1, use the FADT-defined > @@ -1271,7 +1271,7 @@ AcpiDbGenerateGpe ( > */ > if (BlockArg) > { > - BlockNumber = ACPI_STRTOUL (BlockArg, NULL, 0); > + BlockNumber = strtoul (BlockArg, NULL, 0); > if (BlockNumber == 1) > { > BlockNumber = 0; > diff --git a/src/acpica/source/components/debugger/dbconvert.c b/src/acpica/source/components/debugger/dbconvert.c > index 14caa2b..7e5ea39 100644 > --- a/src/acpica/source/components/debugger/dbconvert.c > +++ b/src/acpica/source/components/debugger/dbconvert.c > @@ -149,7 +149,7 @@ AcpiDbHexCharToValue ( > > /* Digit must be ascii [0-9a-fA-F] */ > > - if (!ACPI_IS_XDIGIT (HexChar)) > + if (!isxdigit (HexChar)) > { > return (AE_BAD_HEX_CONSTANT); > } > @@ -160,7 +160,7 @@ AcpiDbHexCharToValue ( > } > else > { > - Value = (UINT8) (ACPI_TOUPPER (HexChar) - 0x37); > + Value = (UINT8) (toupper (HexChar) - 0x37); > } > > *ReturnValue = Value; > @@ -378,7 +378,7 @@ AcpiDbConvertToObject ( > > Object->Type = ACPI_TYPE_STRING; > Object->String.Pointer = String; > - Object->String.Length = (UINT32) ACPI_STRLEN (String); > + Object->String.Length = (UINT32) strlen (String); > break; > > case ACPI_TYPE_BUFFER: > @@ -543,7 +543,7 @@ AcpiDbDumpPldBuffer ( > > /* The two bit-packed buffers should match */ > > - if (ACPI_MEMCMP (NewBuffer, BufferDesc->Buffer.Pointer, > + if (memcmp (NewBuffer, BufferDesc->Buffer.Pointer, > BufferDesc->Buffer.Length)) > { > AcpiOsPrintf ("Converted _PLD buffer does not compare. New:\n"); > diff --git a/src/acpica/source/components/debugger/dbdisply.c b/src/acpica/source/components/debugger/dbdisply.c > index 04a7591..e8ea451 100644 > --- a/src/acpica/source/components/debugger/dbdisply.c > +++ b/src/acpica/source/components/debugger/dbdisply.c > @@ -213,7 +213,7 @@ AcpiDbGetPointer ( > ACPI_SIZE Address; > > > - Address = ACPI_STRTOUL (Target, NULL, 16); > + Address = strtoul (Target, NULL, 16); > ObjPtr = ACPI_TO_POINTER (Address); > return (ObjPtr); > } > diff --git a/src/acpica/source/components/debugger/dbexec.c b/src/acpica/source/components/debugger/dbexec.c > index c865c47..54d535a 100644 > --- a/src/acpica/source/components/debugger/dbexec.c > +++ b/src/acpica/source/components/debugger/dbexec.c > @@ -505,15 +505,15 @@ AcpiDbExecute ( > } > else > { > - NameString = ACPI_ALLOCATE (ACPI_STRLEN (Name) + 1); > + NameString = ACPI_ALLOCATE (strlen (Name) + 1); > if (!NameString) > { > return; > } > > - ACPI_MEMSET (&AcpiGbl_DbMethodInfo, 0, sizeof (ACPI_DB_METHOD_INFO)); > + memset (&AcpiGbl_DbMethodInfo, 0, sizeof (ACPI_DB_METHOD_INFO)); > > - ACPI_STRCPY (NameString, Name); > + strcpy (NameString, Name); > AcpiUtStrupr (NameString); > AcpiGbl_DbMethodInfo.Name = NameString; > AcpiGbl_DbMethodInfo.Args = Args; > @@ -741,8 +741,8 @@ AcpiDbCreateExecutionThreads ( > > /* Get the arguments */ > > - NumThreads = ACPI_STRTOUL (NumThreadsArg, NULL, 0); > - NumLoops = ACPI_STRTOUL (NumLoopsArg, NULL, 0); > + NumThreads = strtoul (NumThreadsArg, NULL, 0); > + NumLoops = strtoul (NumLoopsArg, NULL, 0); > > if (!NumThreads || !NumLoops) > { > @@ -786,7 +786,7 @@ AcpiDbCreateExecutionThreads ( > return; > } > > - ACPI_MEMSET (&AcpiGbl_DbMethodInfo, 0, sizeof (ACPI_DB_METHOD_INFO)); > + memset (&AcpiGbl_DbMethodInfo, 0, sizeof (ACPI_DB_METHOD_INFO)); > > /* Array to store IDs of threads */ > > @@ -801,7 +801,7 @@ AcpiDbCreateExecutionThreads ( > (void) AcpiOsDeleteSemaphore (InfoGate); > return; > } > - ACPI_MEMSET (AcpiGbl_DbMethodInfo.Threads, 0, Size); > + memset (AcpiGbl_DbMethodInfo.Threads, 0, Size); > > /* Setup the context to be passed to each thread */ > > diff --git a/src/acpica/source/components/debugger/dbfileio.c b/src/acpica/source/components/debugger/dbfileio.c > index dc55c6e..bc45b1a 100644 > --- a/src/acpica/source/components/debugger/dbfileio.c > +++ b/src/acpica/source/components/debugger/dbfileio.c > @@ -184,7 +184,7 @@ AcpiDbOpenDebugFile ( > } > > AcpiOsPrintf ("Debug output file %s opened\n", Name); > - ACPI_STRNCPY (AcpiGbl_DbDebugFilename, Name, > + strncpy (AcpiGbl_DbDebugFilename, Name, > sizeof (AcpiGbl_DbDebugFilename)); > AcpiGbl_DbOutputToFile = TRUE; > > diff --git a/src/acpica/source/components/debugger/dbhistry.c b/src/acpica/source/components/debugger/dbhistry.c > index ad11d4f..3e52d9b 100644 > --- a/src/acpica/source/components/debugger/dbhistry.c > +++ b/src/acpica/source/components/debugger/dbhistry.c > @@ -164,7 +164,7 @@ AcpiDbAddToHistory ( > > /* Put command into the next available slot */ > > - CmdLen = (UINT16) ACPI_STRLEN (CommandLine); > + CmdLen = (UINT16) strlen (CommandLine); > if (!CmdLen) > { > return; > @@ -172,7 +172,7 @@ AcpiDbAddToHistory ( > > if (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command != NULL) > { > - BufferLen = (UINT16) ACPI_STRLEN ( > + BufferLen = (UINT16) strlen ( > AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command); > if (CmdLen > BufferLen) > { > @@ -188,7 +188,7 @@ AcpiDbAddToHistory ( > AcpiOsAllocate (CmdLen + 1); > } > > - ACPI_STRCPY (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command, > + strcpy (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command, > CommandLine); > > AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].CmdNum = > @@ -289,7 +289,7 @@ AcpiDbGetFromHistory ( > > else > { > - CmdNum = ACPI_STRTOUL (CommandNumArg, NULL, 0); > + CmdNum = strtoul (CommandNumArg, NULL, 0); > } > > return (AcpiDbGetHistoryByIndex (CmdNum)); > diff --git a/src/acpica/source/components/debugger/dbinput.c b/src/acpica/source/components/debugger/dbinput.c > index 573f384..b9a403e 100644 > --- a/src/acpica/source/components/debugger/dbinput.c > +++ b/src/acpica/source/components/debugger/dbinput.c > @@ -433,7 +433,7 @@ AcpiDbMatchCommandHelp ( > > while ((*Command) && (*Invocation) && (*Invocation != ' ')) > { > - if (ACPI_TOLOWER (*Command) != ACPI_TOLOWER (*Invocation)) > + if (tolower (*Command) != tolower (*Invocation)) > { > return (FALSE); > } > @@ -774,7 +774,7 @@ AcpiDbMatchCommand ( > > for (i = CMD_FIRST_VALID; AcpiGbl_DbCommands[i].Name; i++) > { > - if (ACPI_STRSTR (AcpiGbl_DbCommands[i].Name, UserCommand) == > + if (strstr (AcpiGbl_DbCommands[i].Name, UserCommand) == > AcpiGbl_DbCommands[i].Name) > { > return (i); > @@ -1018,7 +1018,7 @@ AcpiDbCommandDispatch ( > else if (ParamCount == 2) > { > Temp = AcpiGbl_DbConsoleDebugLevel; > - AcpiGbl_DbConsoleDebugLevel = ACPI_STRTOUL (AcpiGbl_DbArgs[1], > + AcpiGbl_DbConsoleDebugLevel = strtoul (AcpiGbl_DbArgs[1], > NULL, 16); > AcpiOsPrintf ( > "Debug Level for console output was %8.8lX, now %8.8lX\n", > @@ -1027,7 +1027,7 @@ AcpiDbCommandDispatch ( > else > { > Temp = AcpiGbl_DbDebugLevel; > - AcpiGbl_DbDebugLevel = ACPI_STRTOUL (AcpiGbl_DbArgs[1], NULL, 16); > + AcpiGbl_DbDebugLevel = strtoul (AcpiGbl_DbArgs[1], NULL, 16); > AcpiOsPrintf ( > "Debug Level for file output was %8.8lX, now %8.8lX\n", > Temp, AcpiGbl_DbDebugLevel); > @@ -1066,7 +1066,7 @@ AcpiDbCommandDispatch ( > > case CMD_NOTIFY: > > - Temp = ACPI_STRTOUL (AcpiGbl_DbArgs[2], NULL, 0); > + Temp = strtoul (AcpiGbl_DbArgs[2], NULL, 0); > AcpiDbSendNotify (AcpiGbl_DbArgs[1], Temp); > break; > > diff --git a/src/acpica/source/components/debugger/dbmethod.c b/src/acpica/source/components/debugger/dbmethod.c > index 056da77..f6c9c51 100644 > --- a/src/acpica/source/components/debugger/dbmethod.c > +++ b/src/acpica/source/components/debugger/dbmethod.c > @@ -161,7 +161,7 @@ AcpiDbSetMethodBreakpoint ( > > /* Get and verify the breakpoint address */ > > - Address = ACPI_STRTOUL (Location, NULL, 16); > + Address = strtoul (Location, NULL, 16); > if (Address <= Op->Common.AmlOffset) > { > AcpiOsPrintf ("Breakpoint %X is beyond current address %X\n", > @@ -246,7 +246,7 @@ AcpiDbSetMethodData ( > return; > } > > - Value = ACPI_STRTOUL (ValueArg, NULL, 16); > + Value = strtoul (ValueArg, NULL, 16); > > if (Type == 'N') > { > @@ -268,7 +268,7 @@ AcpiDbSetMethodData ( > > /* Get the index and value */ > > - Index = ACPI_STRTOUL (IndexArg, NULL, 16); > + Index = strtoul (IndexArg, NULL, 16); > > WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList); > if (!WalkState) > @@ -376,7 +376,7 @@ AcpiDbDisassembleAml ( > > if (Statements) > { > - NumStatements = ACPI_STRTOUL (Statements, NULL, 0); > + NumStatements = strtoul (Statements, NULL, 0); > } > > AcpiDmDisassemble (NULL, Op, NumStatements); > diff --git a/src/acpica/source/components/debugger/dbnames.c b/src/acpica/source/components/debugger/dbnames.c > index ccaa672..7d936c8 100644 > --- a/src/acpica/source/components/debugger/dbnames.c > +++ b/src/acpica/source/components/debugger/dbnames.c > @@ -320,7 +320,7 @@ AcpiDbDumpNamespace ( > > if (DepthArg) > { > - MaxDepth = ACPI_STRTOUL (DepthArg, NULL, 0); > + MaxDepth = strtoul (DepthArg, NULL, 0); > } > } > > @@ -391,13 +391,13 @@ AcpiDbDumpNamespaceByOwner ( > ACPI_OWNER_ID OwnerId; > > > - OwnerId = (ACPI_OWNER_ID) ACPI_STRTOUL (OwnerArg, NULL, 0); > + OwnerId = (ACPI_OWNER_ID) strtoul (OwnerArg, NULL, 0); > > /* Now we can check for the depth argument */ > > if (DepthArg) > { > - MaxDepth = ACPI_STRTOUL (DepthArg, NULL, 0); > + MaxDepth = strtoul (DepthArg, NULL, 0); > } > > AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT); > @@ -498,7 +498,7 @@ AcpiDbFindNameInNamespace ( > char *AcpiNamePtr = AcpiName; > > > - if (ACPI_STRLEN (NameArg) > 4) > + if (strlen (NameArg) > 4) > { > AcpiOsPrintf ("Name must be no longer than 4 characters\n"); > return (AE_OK); > @@ -902,7 +902,7 @@ AcpiDbFindReferences ( > > /* Convert string to object pointer */ > > - Address = ACPI_STRTOUL (ObjectArg, NULL, 16); > + Address = strtoul (ObjectArg, NULL, 16); > ObjDesc = ACPI_TO_POINTER (Address); > > /* Search all nodes in namespace */ > diff --git a/src/acpica/source/components/debugger/dbtest.c b/src/acpica/source/components/debugger/dbtest.c > index 26bfc1c..40fab5c 100644 > --- a/src/acpica/source/components/debugger/dbtest.c > +++ b/src/acpica/source/components/debugger/dbtest.c > @@ -718,7 +718,7 @@ AcpiDbTestBufferType ( > * count is not an integral number of bytes. Zero out the > * unused bits. > */ > - ACPI_MEMSET (Buffer, BUFFER_FILL_VALUE, ByteLength); > + memset (Buffer, BUFFER_FILL_VALUE, ByteLength); > ExtraBits = BitLength % 8; > if (ExtraBits) > { > @@ -743,7 +743,7 @@ AcpiDbTestBufferType ( > goto Exit; > } > > - if (ACPI_MEMCMP (Temp2->Buffer.Pointer, Buffer, ByteLength)) > + if (memcmp (Temp2->Buffer.Pointer, Buffer, ByteLength)) > { > AcpiOsPrintf (" MISMATCH 2: New buffer value"); > } > @@ -767,7 +767,7 @@ AcpiDbTestBufferType ( > goto Exit; > } > > - if (ACPI_MEMCMP (Temp1->Buffer.Pointer, Temp3->Buffer.Pointer, ByteLength)) > + if (memcmp (Temp1->Buffer.Pointer, Temp3->Buffer.Pointer, ByteLength)) > { > AcpiOsPrintf (" MISMATCH 3: While restoring original buffer"); > } > @@ -823,7 +823,7 @@ AcpiDbTestStringType ( > /* Write a new value */ > > WriteValue.Type = ACPI_TYPE_STRING; > - WriteValue.String.Length = ACPI_STRLEN (ValueToWrite); > + WriteValue.String.Length = strlen (ValueToWrite); > WriteValue.String.Pointer = ValueToWrite; > > Status = AcpiDbWriteToObject (Node, &WriteValue); > @@ -840,7 +840,7 @@ AcpiDbTestStringType ( > goto Exit; > } > > - if (ACPI_STRCMP (Temp2->String.Pointer, ValueToWrite)) > + if (strcmp (Temp2->String.Pointer, ValueToWrite)) > { > AcpiOsPrintf (" MISMATCH 2: %s, expecting %s", > Temp2->String.Pointer, ValueToWrite); > @@ -848,7 +848,7 @@ AcpiDbTestStringType ( > > /* Write back the original value */ > > - WriteValue.String.Length = ACPI_STRLEN (Temp1->String.Pointer); > + WriteValue.String.Length = strlen (Temp1->String.Pointer); > WriteValue.String.Pointer = Temp1->String.Pointer; > > Status = AcpiDbWriteToObject (Node, &WriteValue); > @@ -865,7 +865,7 @@ AcpiDbTestStringType ( > goto Exit; > } > > - if (ACPI_STRCMP (Temp1->String.Pointer, Temp3->String.Pointer)) > + if (strcmp (Temp1->String.Pointer, Temp3->String.Pointer)) > { > AcpiOsPrintf (" MISMATCH 3: %s, expecting %s", > Temp3->String.Pointer, Temp1->String.Pointer); > @@ -998,7 +998,7 @@ AcpiDbWriteToObject ( > > /* Copy the incoming user parameter */ > > - ACPI_MEMCPY (&Params[1], Value, sizeof (ACPI_OBJECT)); > + memcpy (&Params[1], Value, sizeof (ACPI_OBJECT)); > > ParamObjects.Count = 2; > ParamObjects.Pointer = Params; > @@ -1042,7 +1042,7 @@ AcpiDbEvaluateAllPredefinedNames ( > > if (CountArg) > { > - Info.MaxCount = ACPI_STRTOUL (CountArg, NULL, 0); > + Info.MaxCount = strtoul (CountArg, NULL, 0); > } > > /* Search all nodes in namespace */ > @@ -1149,7 +1149,7 @@ AcpiDbEvaluateOnePredefinedName ( > case ACPI_TYPE_STRING: > > ThisParam->String.Pointer = "This is the default argument string"; > - ThisParam->String.Length = ACPI_STRLEN (ThisParam->String.Pointer); > + ThisParam->String.Length = strlen (ThisParam->String.Pointer); > break; > > case ACPI_TYPE_BUFFER: > diff --git a/src/acpica/source/components/debugger/dbutils.c b/src/acpica/source/components/debugger/dbutils.c > index fd3445c..5c85a15 100644 > --- a/src/acpica/source/components/debugger/dbutils.c > +++ b/src/acpica/source/components/debugger/dbutils.c > @@ -168,7 +168,7 @@ AcpiDbMatchArgument ( > > for (i = 0; Arguments[i].Name; i++) > { > - if (ACPI_STRSTR (Arguments[i].Name, UserArgument) == Arguments[i].Name) > + if (strstr (Arguments[i].Name, UserArgument) == Arguments[i].Name) > { > return (i); > } > @@ -447,7 +447,7 @@ AcpiDbUint32ToHexString ( > > if (Value == 0) > { > - ACPI_STRCPY (Buffer, "0"); > + strcpy (Buffer, "0"); > return; > } > > diff --git a/src/acpica/source/components/debugger/dbxface.c b/src/acpica/source/components/debugger/dbxface.c > index 542319f..673178f 100644 > --- a/src/acpica/source/components/debugger/dbxface.c > +++ b/src/acpica/source/components/debugger/dbxface.c > @@ -503,7 +503,7 @@ AcpiDbInitialize ( > { > return_ACPI_STATUS (AE_NO_MEMORY); > } > - ACPI_MEMSET (AcpiGbl_DbBuffer, 0, ACPI_DEBUG_BUFFER_SIZE); > + memset (AcpiGbl_DbBuffer, 0, ACPI_DEBUG_BUFFER_SIZE); > > /* Initial scope is the root */ > > diff --git a/src/acpica/source/components/disassembler/dmbuffer.c b/src/acpica/source/components/disassembler/dmbuffer.c > index 8ad879c..f4fee3d 100644 > --- a/src/acpica/source/components/disassembler/dmbuffer.c > +++ b/src/acpica/source/components/disassembler/dmbuffer.c > @@ -277,7 +277,7 @@ AcpiDmDisasmByteList ( > } > > BufChar = ByteData[CurrentIndex]; > - if (ACPI_IS_PRINT (BufChar)) > + if (isprint (BufChar)) > { > AcpiOsPrintf ("%c", BufChar); > } > @@ -626,7 +626,7 @@ AcpiDmIsStringBuffer ( > * they will be handled in the string output routine > */ > > - if (!ACPI_IS_PRINT (ByteData[i])) > + if (!isprint (ByteData[i])) > { > return (FALSE); > } > @@ -908,7 +908,7 @@ AcpiDmUnicode ( > { > AcpiOsPrintf ("\\%c", OutputValue); > } > - else if (!ACPI_IS_PRINT (OutputValue)) > + else if (!isprint (OutputValue)) > { > AcpiOsPrintf ("\\x%2.2X", OutputValue); > } > @@ -974,7 +974,7 @@ AcpiDmGetHardwareIdType ( > for (i = 0; i < 3; i++) > { > if (!ACPI_IS_ASCII (Prefix[i]) || > - !ACPI_IS_ALPHA (Prefix[i])) > + !isalpha (Prefix[i])) > { > return; > } > diff --git a/src/acpica/source/components/disassembler/dmcstyle.c b/src/acpica/source/components/disassembler/dmcstyle.c > index 951af09..9584052 100644 > --- a/src/acpica/source/components/disassembler/dmcstyle.c > +++ b/src/acpica/source/components/disassembler/dmcstyle.c > @@ -409,23 +409,70 @@ AcpiDmCheckForSymbolicOpcode ( > */ > AcpiDmPromoteTarget (Op, Target); > > - /* > - * Check for possible conversion to a "Compound Assignment". > - * > - * Determine if either operand is the same as the target > - * and display compound assignment operator and other operand. > - */ > - if ((AcpiDmIsTargetAnOperand (Target, Child1, TRUE)) || > - (AcpiDmIsTargetAnOperand (Target, Child2, TRUE))) > + /* Check operands for conversion to a "Compound Assignment" */ > + > + switch (Op->Common.AmlOpcode) > { > - Target->Common.OperatorSymbol = > - AcpiDmGetCompoundSymbol (Op->Common.AmlOpcode); > + /* Commutative operators */ > + > + case AML_ADD_OP: > + case AML_MULTIPLY_OP: > + case AML_BIT_AND_OP: > + case AML_BIT_OR_OP: > + case AML_BIT_XOR_OP: > + /* > + * For the commutative operators, we can convert to a > + * compound statement only if at least one (either) operand > + * is the same as the target. > + * > + * Add (A, B, A) --> A += B > + * Add (B, A, A) --> A += B > + * Add (B, C, A) --> A = (B + C) > + */ > + if ((AcpiDmIsTargetAnOperand (Target, Child1, TRUE)) || > + (AcpiDmIsTargetAnOperand (Target, Child2, TRUE))) > + { > + Target->Common.OperatorSymbol = > + AcpiDmGetCompoundSymbol (Op->Common.AmlOpcode); > > - /* Convert operator to compound assignment */ > + /* Convert operator to compound assignment */ > > - Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND; > - Child1->Common.OperatorSymbol = NULL; > - return (TRUE); > + Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND; > + Child1->Common.OperatorSymbol = NULL; > + return (TRUE); > + } > + break; > + > + /* Non-commutative operators */ > + > + case AML_SUBTRACT_OP: > + case AML_DIVIDE_OP: > + case AML_MOD_OP: > + case AML_SHIFT_LEFT_OP: > + case AML_SHIFT_RIGHT_OP: > + /* > + * For the non-commutative operators, we can convert to a > + * compound statement only if the target is the same as the > + * first operand. > + * > + * Subtract (A, B, A) --> A -= B > + * Subtract (B, A, A) --> A = (B - A) > + */ > + if ((AcpiDmIsTargetAnOperand (Target, Child1, TRUE))) > + { > + Target->Common.OperatorSymbol = > + AcpiDmGetCompoundSymbol (Op->Common.AmlOpcode); > + > + /* Convert operator to compound assignment */ > + > + Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND; > + Child1->Common.OperatorSymbol = NULL; > + return (TRUE); > + } > + break; > + > + default: > + break; > } > > /* > @@ -495,8 +542,12 @@ AcpiDmCheckForSymbolicOpcode ( > * source so that the target is processed first. > */ > Target = Child1->Common.Next; > - AcpiDmPromoteTarget (Op, Target); > + if (!Target) > + { > + return (FALSE); > + } > > + AcpiDmPromoteTarget (Op, Target); > if (!Target->Common.OperatorSymbol) > { > Target->Common.OperatorSymbol = " = "; > @@ -746,7 +797,8 @@ AcpiDmPromoteTarget ( > * > * DESCRIPTION: Determine if a Target Op is a placeholder Op or a real Target. > * In other words, determine if the optional target is used or > - * not. > + * not. Note: If Target is NULL, something is seriously wrong, > + * probably with the parse tree. > * > ******************************************************************************/ > > @@ -755,6 +807,11 @@ AcpiDmIsValidTarget ( > ACPI_PARSE_OBJECT *Target) > { > > + if (!Target) > + { > + return (FALSE); > + } > + > if ((Target->Common.AmlOpcode == AML_INT_NAMEPATH_OP) && > (Target->Common.Value.Arg == NULL)) > { > diff --git a/src/acpica/source/components/disassembler/dmopcode.c b/src/acpica/source/components/disassembler/dmopcode.c > index 72cb99c..f2bd41e 100644 > --- a/src/acpica/source/components/disassembler/dmopcode.c > +++ b/src/acpica/source/components/disassembler/dmopcode.c > @@ -341,10 +341,10 @@ AcpiDmPredefinedDescription ( > * Note: NameString is guaranteed to be upper case here. > */ > LastCharIsDigit = > - (ACPI_IS_DIGIT (NameString[3])); /* d */ > + (isdigit (NameString[3])); /* d */ > LastCharsAreHex = > - (ACPI_IS_XDIGIT (NameString[2]) && /* xx */ > - ACPI_IS_XDIGIT (NameString[3])); > + (isxdigit (NameString[2]) && /* xx */ > + isxdigit (NameString[3])); > > switch (NameString[1]) > { > diff --git a/src/acpica/source/components/dispatcher/dsfield.c b/src/acpica/source/components/dispatcher/dsfield.c > index 37d4cc1..cf8c189 100644 > --- a/src/acpica/source/components/dispatcher/dsfield.c > +++ b/src/acpica/source/components/dispatcher/dsfield.c > @@ -602,7 +602,7 @@ AcpiDsCreateField ( > } > } > > - ACPI_MEMSET (&Info, 0, sizeof (ACPI_CREATE_FIELD_INFO)); > + memset (&Info, 0, sizeof (ACPI_CREATE_FIELD_INFO)); > > /* Second arg is the field flags */ > > diff --git a/src/acpica/source/components/dispatcher/dsinit.c b/src/acpica/source/components/dispatcher/dsinit.c > index 585e127..2cd5c4e 100644 > --- a/src/acpica/source/components/dispatcher/dsinit.c > +++ b/src/acpica/source/components/dispatcher/dsinit.c > @@ -296,7 +296,7 @@ AcpiDsInitializeObjects ( > > /* Set all init info to zero */ > > - ACPI_MEMSET (&Info, 0, sizeof (ACPI_INIT_WALK_INFO)); > + memset (&Info, 0, sizeof (ACPI_INIT_WALK_INFO)); > > Info.OwnerId = OwnerId; > Info.TableIndex = TableIndex; > diff --git a/src/acpica/source/components/dispatcher/dsobject.c b/src/acpica/source/components/dispatcher/dsobject.c > index b5cad38..0eb2f44 100644 > --- a/src/acpica/source/components/dispatcher/dsobject.c > +++ b/src/acpica/source/components/dispatcher/dsobject.c > @@ -420,7 +420,7 @@ AcpiDsBuildInternalBufferObj ( > > if (ByteList) > { > - ACPI_MEMCPY (ObjDesc->Buffer.Pointer, ByteList->Named.Data, > + memcpy (ObjDesc->Buffer.Pointer, ByteList->Named.Data, > ByteListLength); > } > } > @@ -847,7 +847,7 @@ AcpiDsInitObjectFromOp ( > case ACPI_TYPE_STRING: > > ObjDesc->String.Pointer = Op->Common.Value.String; > - ObjDesc->String.Length = (UINT32) ACPI_STRLEN (Op->Common.Value.String); > + ObjDesc->String.Length = (UINT32) strlen (Op->Common.Value.String); > > /* > * The string is contained in the ACPI table, don't ever try > diff --git a/src/acpica/source/components/dispatcher/dsutils.c b/src/acpica/source/components/dispatcher/dsutils.c > index 0269916..0ba26fa 100644 > --- a/src/acpica/source/components/dispatcher/dsutils.c > +++ b/src/acpica/source/components/dispatcher/dsutils.c > @@ -677,7 +677,7 @@ AcpiDsCreateOperand ( > > ObjDesc = AcpiUtCreateStringObject ((ACPI_SIZE) NameLength); > > - ACPI_STRNCPY (ObjDesc->String.Pointer, NameString, NameLength); > + strncpy (ObjDesc->String.Pointer, NameString, NameLength); > Status = AE_OK; > } > else > diff --git a/src/acpica/source/components/dispatcher/dswload.c b/src/acpica/source/components/dispatcher/dswload.c > index be090fc..a1327ba 100644 > --- a/src/acpica/source/components/dispatcher/dswload.c > +++ b/src/acpica/source/components/dispatcher/dswload.c > @@ -397,9 +397,18 @@ AcpiDsLoad1BeginOp ( > if ((WalkState->Opcode != AML_SCOPE_OP) && > (!(WalkState->ParseFlags & ACPI_PARSE_DEFERRED_OP))) > { > - Flags |= ACPI_NS_ERROR_IF_FOUND; > - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Cannot already exist\n", > - AcpiUtGetTypeName (ObjectType))); > + if (WalkState->NamespaceOverride) > + { > + Flags |= ACPI_NS_OVERRIDE_IF_FOUND; > + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Override allowed\n", > + AcpiUtGetTypeName (ObjectType))); > + } > + else > + { > + Flags |= ACPI_NS_ERROR_IF_FOUND; > + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Cannot already exist\n", > + AcpiUtGetTypeName (ObjectType))); > + } > } > else > { > diff --git a/src/acpica/source/components/events/evgpe.c b/src/acpica/source/components/events/evgpe.c > index 16428d6..4dceaa4 100644 > --- a/src/acpica/source/components/events/evgpe.c > +++ b/src/acpica/source/components/events/evgpe.c > @@ -176,6 +176,7 @@ AcpiEvUpdateGpeEnableMask ( > { > ACPI_SET_BIT (GpeRegisterInfo->EnableForRun, (UINT8) RegisterBit); > } > + GpeRegisterInfo->EnableMask = GpeRegisterInfo->EnableForRun; > > return_ACPI_STATUS (AE_OK); > } > @@ -213,7 +214,7 @@ AcpiEvEnableGpe ( > > /* Enable the requested GPE */ > > - Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE_SAVE); > + Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE); > return_ACPI_STATUS (Status); > } > > @@ -303,7 +304,7 @@ AcpiEvRemoveGpeReference ( > Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo); > if (ACPI_SUCCESS (Status)) > { > - Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE_SAVE); > + Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE); > } > > if (ACPI_FAILURE (Status)) > diff --git a/src/acpica/source/components/events/evgpeinit.c b/src/acpica/source/components/events/evgpeinit.c > index 5848b75..bf3c6e5 100644 > --- a/src/acpica/source/components/events/evgpeinit.c > +++ b/src/acpica/source/components/events/evgpeinit.c > @@ -467,7 +467,7 @@ AcpiEvMatchGpeMethod ( > > /* 4) The last two characters of the name are the hex GPE Number */ > > - GpeNumber = ACPI_STRTOUL (&Name[2], NULL, 16); > + GpeNumber = strtoul (&Name[2], NULL, 16); > if (GpeNumber == ACPI_UINT32_MAX) > { > /* Conversion failed; invalid method, just ignore it */ > diff --git a/src/acpica/source/components/executer/exconfig.c b/src/acpica/source/components/executer/exconfig.c > index c311a69..9580bc0 100644 > --- a/src/acpica/source/components/executer/exconfig.c > +++ b/src/acpica/source/components/executer/exconfig.c > @@ -588,7 +588,7 @@ AcpiExLoadOp ( > return_ACPI_STATUS (AE_NO_MEMORY); > } > > - ACPI_MEMCPY (Table, TableHeader, Length); > + memcpy (Table, TableHeader, Length); > break; > > default: > diff --git a/src/acpica/source/components/executer/exconvrt.c b/src/acpica/source/components/executer/exconvrt.c > index 1cf54e2..0023668 100644 > --- a/src/acpica/source/components/executer/exconvrt.c > +++ b/src/acpica/source/components/executer/exconvrt.c > @@ -323,7 +323,7 @@ AcpiExConvertToBuffer ( > /* Copy the integer to the buffer, LSB first */ > > NewBuf = ReturnDesc->Buffer.Pointer; > - ACPI_MEMCPY (NewBuf, > + memcpy (NewBuf, > &ObjDesc->Integer.Value, > AcpiGbl_IntegerByteWidth); > break; > @@ -348,7 +348,7 @@ AcpiExConvertToBuffer ( > /* Copy the string to the buffer */ > > NewBuf = ReturnDesc->Buffer.Pointer; > - ACPI_STRNCPY ((char *) NewBuf, (char *) ObjDesc->String.Pointer, > + strncpy ((char *) NewBuf, (char *) ObjDesc->String.Pointer, > ObjDesc->String.Length); > break; > > diff --git a/src/acpica/source/components/executer/exdebug.c b/src/acpica/source/components/executer/exdebug.c > index 64fef55..79ca96c 100644 > --- a/src/acpica/source/components/executer/exdebug.c > +++ b/src/acpica/source/components/executer/exdebug.c > @@ -153,6 +153,8 @@ AcpiExDoDebugObject ( > { > UINT32 i; > UINT32 Timer; > + ACPI_OPERAND_OBJECT *ObjectDesc; > + UINT32 Value; > > > ACPI_FUNCTION_TRACE_PTR (ExDoDebugObject, SourceDesc); > @@ -339,8 +341,37 @@ AcpiExDoDebugObject ( > } > else > { > - AcpiExDoDebugObject (SourceDesc->Reference.Object, > - Level+4, 0); > + ObjectDesc = SourceDesc->Reference.Object; > + Value = SourceDesc->Reference.Value; > + > + switch (ObjectDesc->Common.Type) > + { > + case ACPI_TYPE_BUFFER: > + > + AcpiOsPrintf ("Buffer[%u] = 0x%2.2X\n", > + Value, *SourceDesc->Reference.IndexPointer); > + break; > + > + case ACPI_TYPE_STRING: > + > + AcpiOsPrintf ("String[%u] = \"%c\" (0x%2.2X)\n", > + Value, *SourceDesc->Reference.IndexPointer, > + *SourceDesc->Reference.IndexPointer); > + break; > + > + case ACPI_TYPE_PACKAGE: > + > + AcpiOsPrintf ("Package[%u] = ", Value); > + AcpiExDoDebugObject (*SourceDesc->Reference.Where, > + Level+4, 0); > + break; > + > + default: > + > + AcpiOsPrintf ("Unknown Reference object type %X\n", > + ObjectDesc->Common.Type); > + break; > + } > } > } > break; > diff --git a/src/acpica/source/components/executer/exdump.c b/src/acpica/source/components/executer/exdump.c > index 09930ed..bf9df64 100644 > --- a/src/acpica/source/components/executer/exdump.c > +++ b/src/acpica/source/components/executer/exdump.c > @@ -310,7 +310,7 @@ static ACPI_EXDUMP_INFO AcpiExDumpIndexField[5] = > {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (IndexField.DataObj), "Data Object"} > }; > > -static ACPI_EXDUMP_INFO AcpiExDumpReference[8] = > +static ACPI_EXDUMP_INFO AcpiExDumpReference[9] = > { > {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpReference), NULL}, > {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Reference.Class), "Class"}, > @@ -319,6 +319,7 @@ static ACPI_EXDUMP_INFO AcpiExDumpReference[8] = > {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Object), "Object Desc"}, > {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Reference.Node), "Node"}, > {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Where), "Where"}, > + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.IndexPointer), "Index Pointer"}, > {ACPI_EXD_REFERENCE,0, NULL} > }; > > @@ -1125,16 +1126,18 @@ AcpiExDumpReferenceObj ( > { > if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_OPERAND) > { > - AcpiOsPrintf (" Target: %p", ObjDesc->Reference.Object); > + AcpiOsPrintf ("%22s %p", "Target :", > + ObjDesc->Reference.Object); > if (ObjDesc->Reference.Class == ACPI_REFCLASS_TABLE) > { > - AcpiOsPrintf (" Table Index: %X\n", ObjDesc->Reference.Value); > + AcpiOsPrintf (" Table Index: %X\n", > + ObjDesc->Reference.Value); > } > else > { > - AcpiOsPrintf (" Target: %p [%s]\n", ObjDesc->Reference.Object, > + AcpiOsPrintf (" [%s]\n", > AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT *) > - ObjDesc->Reference.Object)->Common.Type)); > + ObjDesc->Reference.Object)->Common.Type)); > } > } > else > diff --git a/src/acpica/source/components/executer/exfield.c b/src/acpica/source/components/executer/exfield.c > index 3083985..dbd294b 100644 > --- a/src/acpica/source/components/executer/exfield.c > +++ b/src/acpica/source/components/executer/exfield.c > @@ -532,7 +532,7 @@ AcpiExWriteDataToField ( > } > > Buffer = BufferDesc->Buffer.Pointer; > - ACPI_MEMCPY (Buffer, SourceDesc->Buffer.Pointer, Length); > + memcpy (Buffer, SourceDesc->Buffer.Pointer, Length); > > /* Lock entire transaction if requested */ > > diff --git a/src/acpica/source/components/executer/exfldio.c b/src/acpica/source/components/executer/exfldio.c > index cd0233d..39a0f37 100644 > --- a/src/acpica/source/components/executer/exfldio.c > +++ b/src/acpica/source/components/executer/exfldio.c > @@ -528,7 +528,7 @@ AcpiExFieldDatumIo ( > * Copy the data from the source buffer. > * Length is the field width in bytes. > */ > - ACPI_MEMCPY (Value, > + memcpy (Value, > (ObjDesc->BufferField.BufferObj)->Buffer.Pointer + > ObjDesc->BufferField.BaseByteOffset + > FieldDatumByteOffset, > @@ -540,7 +540,7 @@ AcpiExFieldDatumIo ( > * Copy the data to the target buffer. > * Length is the field width in bytes. > */ > - ACPI_MEMCPY ((ObjDesc->BufferField.BufferObj)->Buffer.Pointer + > + memcpy ((ObjDesc->BufferField.BufferObj)->Buffer.Pointer + > ObjDesc->BufferField.BaseByteOffset + > FieldDatumByteOffset, > Value, ObjDesc->CommonField.AccessByteWidth); > @@ -820,7 +820,7 @@ AcpiExExtractFromField ( > return_ACPI_STATUS (AE_BUFFER_OVERFLOW); > } > > - ACPI_MEMSET (Buffer, 0, BufferLength); > + memset (Buffer, 0, BufferLength); > AccessBitWidth = ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth); > > /* Handle the simple case here */ > @@ -837,7 +837,7 @@ AcpiExExtractFromField ( > /* Use RawDatum (UINT64) to handle buffers < 64 bits */ > > Status = AcpiExFieldDatumIo (ObjDesc, 0, &RawDatum, ACPI_READ); > - ACPI_MEMCPY (Buffer, &RawDatum, BufferLength); > + memcpy (Buffer, &RawDatum, BufferLength); > } > > return_ACPI_STATUS (Status); > @@ -907,7 +907,7 @@ AcpiExExtractFromField ( > > /* Write merged datum to target buffer */ > > - ACPI_MEMCPY (((char *) Buffer) + BufferOffset, &MergedDatum, > + memcpy (((char *) Buffer) + BufferOffset, &MergedDatum, > ACPI_MIN(ObjDesc->CommonField.AccessByteWidth, > BufferLength - BufferOffset)); > > @@ -925,7 +925,7 @@ AcpiExExtractFromField ( > > /* Write the last datum to the buffer */ > > - ACPI_MEMCPY (((char *) Buffer) + BufferOffset, &MergedDatum, > + memcpy (((char *) Buffer) + BufferOffset, &MergedDatum, > ACPI_MIN(ObjDesc->CommonField.AccessByteWidth, > BufferLength - BufferOffset)); > > @@ -998,7 +998,7 @@ AcpiExInsertIntoField ( > * at Byte zero. All unused (upper) bytes of the > * buffer will be 0. > */ > - ACPI_MEMCPY ((char *) NewBuffer, (char *) Buffer, BufferLength); > + memcpy ((char *) NewBuffer, (char *) Buffer, BufferLength); > Buffer = NewBuffer; > BufferLength = RequiredLength; > } > @@ -1041,7 +1041,7 @@ AcpiExInsertIntoField ( > > /* Get initial Datum from the input buffer */ > > - ACPI_MEMCPY (&RawDatum, Buffer, > + memcpy (&RawDatum, Buffer, > ACPI_MIN(ObjDesc->CommonField.AccessByteWidth, > BufferLength - BufferOffset)); > > @@ -1093,7 +1093,7 @@ AcpiExInsertIntoField ( > /* Get the next input datum from the buffer */ > > BufferOffset += ObjDesc->CommonField.AccessByteWidth; > - ACPI_MEMCPY (&RawDatum, ((char *) Buffer) + BufferOffset, > + memcpy (&RawDatum, ((char *) Buffer) + BufferOffset, > ACPI_MIN(ObjDesc->CommonField.AccessByteWidth, > BufferLength - BufferOffset)); > > diff --git a/src/acpica/source/components/executer/exmisc.c b/src/acpica/source/components/executer/exmisc.c > index d92b271..f678670 100644 > --- a/src/acpica/source/components/executer/exmisc.c > +++ b/src/acpica/source/components/executer/exmisc.c > @@ -298,8 +298,8 @@ AcpiExConcatTemplate ( > * EndTag descriptor is copied from Operand1. > */ > NewBuf = ReturnDesc->Buffer.Pointer; > - ACPI_MEMCPY (NewBuf, Operand0->Buffer.Pointer, Length0); > - ACPI_MEMCPY (NewBuf + Length0, Operand1->Buffer.Pointer, Length1); > + memcpy (NewBuf, Operand0->Buffer.Pointer, Length0); > + memcpy (NewBuf + Length0, Operand1->Buffer.Pointer, Length1); > > /* Insert EndTag and set the checksum to zero, means "ignore checksum" */ > > @@ -413,12 +413,12 @@ AcpiExDoConcatenate ( > > /* Copy the first integer, LSB first */ > > - ACPI_MEMCPY (NewBuf, &Operand0->Integer.Value, > + memcpy (NewBuf, &Operand0->Integer.Value, > AcpiGbl_IntegerByteWidth); > > /* Copy the second integer (LSB first) after the first */ > > - ACPI_MEMCPY (NewBuf + AcpiGbl_IntegerByteWidth, > + memcpy (NewBuf + AcpiGbl_IntegerByteWidth, > &LocalOperand1->Integer.Value, > AcpiGbl_IntegerByteWidth); > break; > @@ -440,8 +440,8 @@ AcpiExDoConcatenate ( > > /* Concatenate the strings */ > > - ACPI_STRCPY (NewBuf, Operand0->String.Pointer); > - ACPI_STRCPY (NewBuf + Operand0->String.Length, > + strcpy (NewBuf, Operand0->String.Pointer); > + strcpy (NewBuf + Operand0->String.Length, > LocalOperand1->String.Pointer); > break; > > @@ -462,9 +462,9 @@ AcpiExDoConcatenate ( > > /* Concatenate the buffers */ > > - ACPI_MEMCPY (NewBuf, Operand0->Buffer.Pointer, > + memcpy (NewBuf, Operand0->Buffer.Pointer, > Operand0->Buffer.Length); > - ACPI_MEMCPY (NewBuf + Operand0->Buffer.Length, > + memcpy (NewBuf + Operand0->Buffer.Length, > LocalOperand1->Buffer.Pointer, > LocalOperand1->Buffer.Length); > break; > @@ -785,7 +785,7 @@ AcpiExDoLogicalOp ( > > /* Lexicographic compare: compare the data bytes */ > > - Compare = ACPI_MEMCMP (Operand0->Buffer.Pointer, > + Compare = memcmp (Operand0->Buffer.Pointer, > LocalOperand1->Buffer.Pointer, > (Length0 > Length1) ? Length1 : Length0); > > diff --git a/src/acpica/source/components/executer/exnames.c b/src/acpica/source/components/executer/exnames.c > index b402d3b..38ceba0 100644 > --- a/src/acpica/source/components/executer/exnames.c > +++ b/src/acpica/source/components/executer/exnames.c > @@ -293,7 +293,7 @@ AcpiExNameSegment ( > > if (NameString) > { > - ACPI_STRCAT (NameString, CharBuf); > + strcat (NameString, CharBuf); > ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, > "Appended to - %s\n", NameString)); > } > diff --git a/src/acpica/source/components/executer/exoparg2.c b/src/acpica/source/components/executer/exoparg2.c > index 399b259..f1ab706 100644 > --- a/src/acpica/source/components/executer/exoparg2.c > +++ b/src/acpica/source/components/executer/exoparg2.c > @@ -440,7 +440,7 @@ AcpiExOpcode_2A_1T_1R ( > * Copy the raw buffer data with no transform. > * (NULL terminated already) > */ > - ACPI_MEMCPY (ReturnDesc->String.Pointer, > + memcpy (ReturnDesc->String.Pointer, > Operand[0]->Buffer.Pointer, Length); > break; > > @@ -484,6 +484,8 @@ AcpiExOpcode_2A_1T_1R ( > } > > ReturnDesc->Reference.TargetType = ACPI_TYPE_BUFFER_FIELD; > + ReturnDesc->Reference.IndexPointer = > + &(Operand[0]->Buffer.Pointer [Index]); > break; > > case ACPI_TYPE_BUFFER: > @@ -495,6 +497,8 @@ AcpiExOpcode_2A_1T_1R ( > } > > ReturnDesc->Reference.TargetType = ACPI_TYPE_BUFFER_FIELD; > + ReturnDesc->Reference.IndexPointer = > + &(Operand[0]->Buffer.Pointer [Index]); > break; > > case ACPI_TYPE_PACKAGE: > @@ -506,7 +510,8 @@ AcpiExOpcode_2A_1T_1R ( > } > > ReturnDesc->Reference.TargetType = ACPI_TYPE_PACKAGE; > - ReturnDesc->Reference.Where = &Operand[0]->Package.Elements [Index]; > + ReturnDesc->Reference.Where = > + &Operand[0]->Package.Elements [Index]; > break; > > default: > diff --git a/src/acpica/source/components/executer/exoparg3.c b/src/acpica/source/components/executer/exoparg3.c > index b0928af..b2c49be 100644 > --- a/src/acpica/source/components/executer/exoparg3.c > +++ b/src/acpica/source/components/executer/exoparg3.c > @@ -334,7 +334,7 @@ AcpiExOpcode_3A_1T_1R ( > { > /* We have a buffer, copy the portion requested */ > > - ACPI_MEMCPY (Buffer, Operand[0]->String.Pointer + Index, > + memcpy (Buffer, Operand[0]->String.Pointer + Index, > Length); > } > > diff --git a/src/acpica/source/components/executer/exregion.c b/src/acpica/source/components/executer/exregion.c > index 31bbb60..cf60500 100644 > --- a/src/acpica/source/components/executer/exregion.c > +++ b/src/acpica/source/components/executer/exregion.c > @@ -630,13 +630,13 @@ AcpiExDataTableSpaceHandler ( > { > case ACPI_READ: > > - ACPI_MEMCPY (ACPI_CAST_PTR (char, Value), ACPI_PHYSADDR_TO_PTR (Address), > + memcpy (ACPI_CAST_PTR (char, Value), ACPI_PHYSADDR_TO_PTR (Address), > ACPI_DIV_8 (BitWidth)); > break; > > case ACPI_WRITE: > > - ACPI_MEMCPY (ACPI_PHYSADDR_TO_PTR (Address), ACPI_CAST_PTR (char, Value), > + memcpy (ACPI_PHYSADDR_TO_PTR (Address), ACPI_CAST_PTR (char, Value), > ACPI_DIV_8 (BitWidth)); > break; > > diff --git a/src/acpica/source/components/executer/exstorob.c b/src/acpica/source/components/executer/exstorob.c > index 48c3440..8c23aee 100644 > --- a/src/acpica/source/components/executer/exstorob.c > +++ b/src/acpica/source/components/executer/exstorob.c > @@ -181,8 +181,8 @@ AcpiExStoreBufferToBuffer ( > { > /* Clear existing buffer and copy in the new one */ > > - ACPI_MEMSET (TargetDesc->Buffer.Pointer, 0, TargetDesc->Buffer.Length); > - ACPI_MEMCPY (TargetDesc->Buffer.Pointer, Buffer, Length); > + memset (TargetDesc->Buffer.Pointer, 0, TargetDesc->Buffer.Length); > + memcpy (TargetDesc->Buffer.Pointer, Buffer, Length); > > #ifdef ACPI_OBSOLETE_BEHAVIOR > /* > @@ -211,7 +211,7 @@ AcpiExStoreBufferToBuffer ( > { > /* Truncate the source, copy only what will fit */ > > - ACPI_MEMCPY (TargetDesc->Buffer.Pointer, Buffer, > + memcpy (TargetDesc->Buffer.Pointer, Buffer, > TargetDesc->Buffer.Length); > > ACPI_DEBUG_PRINT ((ACPI_DB_INFO, > @@ -275,9 +275,9 @@ AcpiExStoreStringToString ( > * String will fit in existing non-static buffer. > * Clear old string and copy in the new one > */ > - ACPI_MEMSET (TargetDesc->String.Pointer, 0, > + memset (TargetDesc->String.Pointer, 0, > (ACPI_SIZE) TargetDesc->String.Length + 1); > - ACPI_MEMCPY (TargetDesc->String.Pointer, Buffer, Length); > + memcpy (TargetDesc->String.Pointer, Buffer, Length); > } > else > { > @@ -301,7 +301,7 @@ AcpiExStoreStringToString ( > } > > TargetDesc->Common.Flags &= ~AOPOBJ_STATIC_POINTER; > - ACPI_MEMCPY (TargetDesc->String.Pointer, Buffer, Length); > + memcpy (TargetDesc->String.Pointer, Buffer, Length); > } > > /* Set the new target length */ > diff --git a/src/acpica/source/components/executer/exutils.c b/src/acpica/source/components/executer/exutils.c > index b432cba..90a791d 100644 > --- a/src/acpica/source/components/executer/exutils.c > +++ b/src/acpica/source/components/executer/exutils.c > @@ -505,6 +505,43 @@ AcpiExIntegerToString ( > > /******************************************************************************* > * > + * FUNCTION: AcpiExPciClsToString > + * > + * PARAMETERS: OutString - Where to put the converted string (7 bytes) > + * PARAMETERS: ClassCode - PCI class code to be converted (3 bytes) > + * > + * RETURN: None > + * > + * DESCRIPTION: Convert 3-bytes PCI class code to string representation. > + * Return buffer must be large enough to hold the string. The > + * string returned is always exactly of length > + * ACPI_PCICLS_STRING_SIZE (includes null terminator). > + * > + ******************************************************************************/ > + > +void > +AcpiExPciClsToString ( > + char *OutString, > + UINT8 ClassCode[3]) > +{ > + > + ACPI_FUNCTION_ENTRY (); > + > + > + /* All 3 bytes are hexadecimal */ > + > + OutString[0] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[0], 4); > + OutString[1] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[0], 0); > + OutString[2] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[1], 4); > + OutString[3] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[1], 0); > + OutString[4] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[2], 4); > + OutString[5] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[2], 0); > + OutString[6] = 0; > +} > + > + > +/******************************************************************************* > + * > * FUNCTION: AcpiIsValidSpaceId > * > * PARAMETERS: SpaceId - ID to be validated > diff --git a/src/acpica/source/components/hardware/hwgpe.c b/src/acpica/source/components/hardware/hwgpe.c > index c532689..1ab6965 100644 > --- a/src/acpica/source/components/hardware/hwgpe.c > +++ b/src/acpica/source/components/hardware/hwgpe.c > @@ -169,6 +169,8 @@ AcpiHwGetGpeRegisterBit ( > * RETURN: Status > * > * DESCRIPTION: Enable or disable a single GPE in the parent enable register. > + * The EnableMask field of the involved GPE register must be > + * updated by the caller if necessary. > * > ******************************************************************************/ > > @@ -205,7 +207,7 @@ AcpiHwLowSetGpe ( > /* Set or clear just the bit that corresponds to this GPE */ > > RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo); > - switch (Action & ~ACPI_GPE_SAVE_MASK) > + switch (Action) > { > case ACPI_GPE_CONDITIONAL_ENABLE: > > @@ -237,10 +239,6 @@ AcpiHwLowSetGpe ( > /* Write the updated enable mask */ > > Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress); > - if (ACPI_SUCCESS (Status) && (Action & ACPI_GPE_SAVE_MASK)) > - { > - GpeRegisterInfo->EnableMask = (UINT8) EnableMask; > - } > return (Status); > } > > @@ -406,11 +404,8 @@ AcpiHwGpeEnableWrite ( > ACPI_STATUS Status; > > > + GpeRegisterInfo->EnableMask = EnableMask; > Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress); > - if (ACPI_SUCCESS (Status)) > - { > - GpeRegisterInfo->EnableMask = EnableMask; > - } > > return (Status); > } > diff --git a/src/acpica/source/components/hardware/hwxfsleep.c b/src/acpica/source/components/hardware/hwxfsleep.c > index 2c7066b..9d33fd9 100644 > --- a/src/acpica/source/components/hardware/hwxfsleep.c > +++ b/src/acpica/source/components/hardware/hwxfsleep.c > @@ -124,6 +124,12 @@ > /* Local prototypes */ > > static ACPI_STATUS > +AcpiHwSetFirmwareWakingVector ( > + ACPI_TABLE_FACS *Facs, > + ACPI_PHYSICAL_ADDRESS PhysicalAddress, > + ACPI_PHYSICAL_ADDRESS PhysicalAddress64); > + > +static ACPI_STATUS > AcpiHwSleepDispatch ( > UINT8 SleepState, > UINT32 FunctionId); > @@ -149,29 +155,33 @@ static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[] = > /* > * These functions are removed for the ACPI_REDUCED_HARDWARE case: > * AcpiSetFirmwareWakingVector > - * AcpiSetFirmwareWakingVector64 > * AcpiEnterSleepStateS4bios > */ > > #if (!ACPI_REDUCED_HARDWARE) > /******************************************************************************* > * > - * FUNCTION: AcpiSetFirmwareWakingVector > + * FUNCTION: AcpiHwSetFirmwareWakingVector > * > - * PARAMETERS: PhysicalAddress - 32-bit physical address of ACPI real mode > - * entry point. > + * PARAMETERS: Facs - Pointer to FACS table > + * PhysicalAddress - 32-bit physical address of ACPI real mode > + * entry point > + * PhysicalAddress64 - 64-bit physical address of ACPI protected > + * entry point > * > * RETURN: Status > * > - * DESCRIPTION: Sets the 32-bit FirmwareWakingVector field of the FACS > + * DESCRIPTION: Sets the FirmwareWakingVector fields of the FACS > * > ******************************************************************************/ > > -ACPI_STATUS > -AcpiSetFirmwareWakingVector ( > - UINT32 PhysicalAddress) > +static ACPI_STATUS > +AcpiHwSetFirmwareWakingVector ( > + ACPI_TABLE_FACS *Facs, > + ACPI_PHYSICAL_ADDRESS PhysicalAddress, > + ACPI_PHYSICAL_ADDRESS PhysicalAddress64) > { > - ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector); > + ACPI_FUNCTION_TRACE (AcpiHwSetFirmwareWakingVector); > > > /* > @@ -184,60 +194,73 @@ AcpiSetFirmwareWakingVector ( > > /* Set the 32-bit vector */ > > - AcpiGbl_FACS->FirmwareWakingVector = PhysicalAddress; > - > - /* Clear the 64-bit vector if it exists */ > + Facs->FirmwareWakingVector = (UINT32) PhysicalAddress; > > - if ((AcpiGbl_FACS->Length > 32) && (AcpiGbl_FACS->Version >= 1)) > + if (Facs->Length > 32) > { > - AcpiGbl_FACS->XFirmwareWakingVector = 0; > + if (Facs->Version >= 1) > + { > + /* Set the 64-bit vector */ > + > + Facs->XFirmwareWakingVector = PhysicalAddress64; > + } > + else > + { > + /* Clear the 64-bit vector if it exists */ > + > + Facs->XFirmwareWakingVector = 0; > + } > } > > return_ACPI_STATUS (AE_OK); > } > > -ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector) > - > > -#if ACPI_MACHINE_WIDTH == 64 > /******************************************************************************* > * > - * FUNCTION: AcpiSetFirmwareWakingVector64 > + * FUNCTION: AcpiSetFirmwareWakingVector > * > - * PARAMETERS: PhysicalAddress - 64-bit physical address of ACPI protected > - * mode entry point. > + * PARAMETERS: PhysicalAddress - 32-bit physical address of ACPI real mode > + * entry point > + * PhysicalAddress64 - 64-bit physical address of ACPI protected > + * entry point > * > * RETURN: Status > * > - * DESCRIPTION: Sets the 64-bit X_FirmwareWakingVector field of the FACS, if > - * it exists in the table. This function is intended for use with > - * 64-bit host operating systems. > + * DESCRIPTION: Sets the FirmwareWakingVector fields of the FACS > * > ******************************************************************************/ > > ACPI_STATUS > -AcpiSetFirmwareWakingVector64 ( > - UINT64 PhysicalAddress) > +AcpiSetFirmwareWakingVector ( > + ACPI_PHYSICAL_ADDRESS PhysicalAddress, > + ACPI_PHYSICAL_ADDRESS PhysicalAddress64) > { > - ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector64); > > + ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector); > > - /* Determine if the 64-bit vector actually exists */ > + /* If Hardware Reduced flag is set, there is no FACS */ > > - if ((AcpiGbl_FACS->Length <= 32) || (AcpiGbl_FACS->Version < 1)) > + if (AcpiGbl_ReducedHardware) > { > - return_ACPI_STATUS (AE_NOT_EXIST); > + return (AE_OK); > } > > - /* Clear 32-bit vector, set the 64-bit X_ vector */ > + if (AcpiGbl_Facs32) > + { > + (void) AcpiHwSetFirmwareWakingVector (AcpiGbl_Facs32, > + PhysicalAddress, PhysicalAddress64); > + } > + if (AcpiGbl_Facs64) > + { > + (void) AcpiHwSetFirmwareWakingVector (AcpiGbl_Facs64, > + PhysicalAddress, PhysicalAddress64); > + } > > - AcpiGbl_FACS->FirmwareWakingVector = 0; > - AcpiGbl_FACS->XFirmwareWakingVector = PhysicalAddress; > return_ACPI_STATUS (AE_OK); > } > > -ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector64) > -#endif > +ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector) > > > /******************************************************************************* > diff --git a/src/acpica/source/components/namespace/nsaccess.c b/src/acpica/source/components/namespace/nsaccess.c > index 58d56e5..6667308 100644 > --- a/src/acpica/source/components/namespace/nsaccess.c > +++ b/src/acpica/source/components/namespace/nsaccess.c > @@ -183,7 +183,7 @@ AcpiNsRootInitialize ( > { > /* _OSI is optional for now, will be permanent later */ > > - if (!ACPI_STRCMP (InitVal->Name, "_OSI") && !AcpiGbl_CreateOsiMethod) > + if (!strcmp (InitVal->Name, "_OSI") && !AcpiGbl_CreateOsiMethod) > { > continue; > } > @@ -263,7 +263,7 @@ AcpiNsRootInitialize ( > > /* Build an object around the static string */ > > - ObjDesc->String.Length = (UINT32) ACPI_STRLEN (Val); > + ObjDesc->String.Length = (UINT32) strlen (Val); > ObjDesc->String.Pointer = Val; > ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER; > break; > @@ -284,7 +284,7 @@ AcpiNsRootInitialize ( > > /* Special case for ACPI Global Lock */ > > - if (ACPI_STRCMP (InitVal->Name, "_GL_") == 0) > + if (strcmp (InitVal->Name, "_GL_") == 0) > { > AcpiGbl_GlobalLockMutex = ObjDesc; > > @@ -391,7 +391,9 @@ AcpiNsLookup ( > return_ACPI_STATUS (AE_BAD_PARAMETER); > } > > - LocalFlags = Flags & ~(ACPI_NS_ERROR_IF_FOUND | ACPI_NS_SEARCH_PARENT); > + LocalFlags = Flags & > + ~(ACPI_NS_ERROR_IF_FOUND | ACPI_NS_OVERRIDE_IF_FOUND | > + ACPI_NS_SEARCH_PARENT); > *ReturnNode = ACPI_ENTRY_NOT_FOUND; > AcpiGbl_NsLookupCount++; > > @@ -643,6 +645,13 @@ AcpiNsLookup ( > { > LocalFlags |= ACPI_NS_ERROR_IF_FOUND; > } > + > + /* Set override flag according to caller */ > + > + if (Flags & ACPI_NS_OVERRIDE_IF_FOUND) > + { > + LocalFlags |= ACPI_NS_OVERRIDE_IF_FOUND; > + } > } > > /* Extract one ACPI name from the front of the pathname */ > diff --git a/src/acpica/source/components/namespace/nsconvert.c b/src/acpica/source/components/namespace/nsconvert.c > index be20f43..b79458e 100644 > --- a/src/acpica/source/components/namespace/nsconvert.c > +++ b/src/acpica/source/components/namespace/nsconvert.c > @@ -274,7 +274,7 @@ AcpiNsConvertToString ( > * Copy the raw buffer data with no transform. String is already NULL > * terminated at Length+1. > */ > - ACPI_MEMCPY (NewObject->String.Pointer, > + memcpy (NewObject->String.Pointer, > OriginalObject->Buffer.Pointer, Length); > break; > > @@ -341,7 +341,7 @@ AcpiNsConvertToBuffer ( > return (AE_NO_MEMORY); > } > > - ACPI_MEMCPY (NewObject->Buffer.Pointer, > + memcpy (NewObject->Buffer.Pointer, > OriginalObject->String.Pointer, OriginalObject->String.Length); > break; > > diff --git a/src/acpica/source/components/namespace/nsdump.c b/src/acpica/source/components/namespace/nsdump.c > index 8b6c8ce..9f21957 100644 > --- a/src/acpica/source/components/namespace/nsdump.c > +++ b/src/acpica/source/components/namespace/nsdump.c > @@ -195,7 +195,7 @@ AcpiNsPrintPathname ( > { > for (i = 0; i < 4; i++) > { > - ACPI_IS_PRINT (Pathname[i]) ? > + isprint (Pathname[i]) ? > AcpiOsPrintf ("%c", Pathname[i]) : > AcpiOsPrintf ("?"); > } > diff --git a/src/acpica/source/components/namespace/nseval.c b/src/acpica/source/components/namespace/nseval.c > index b6d662b..947a34d 100644 > --- a/src/acpica/source/components/namespace/nseval.c > +++ b/src/acpica/source/components/namespace/nseval.c > @@ -136,15 +136,14 @@ AcpiNsExecModuleCode ( > * > * FUNCTION: AcpiNsEvaluate > * > - * PARAMETERS: Info - Evaluation info block, contains: > + * PARAMETERS: Info - Evaluation info block, contains these fields > + * and more: > * PrefixNode - Prefix or Method/Object Node to execute > * RelativePath - Name of method to execute, If NULL, the > * Node is the object to execute > * Parameters - List of parameters to pass to the method, > * terminated by NULL. Params itself may be > * NULL if no parameters are being passed. > - * ReturnObject - Where to put method's return value (if > - * any). If NULL, no value is returned. > * ParameterType - Type of Parameter list > * ReturnObject - Where to put method's return value (if > * any). If NULL, no value is returned. > @@ -536,7 +535,7 @@ AcpiNsExecModuleCode ( > > /* Initialize the evaluation information block */ > > - ACPI_MEMSET (Info, 0, sizeof (ACPI_EVALUATE_INFO)); > + memset (Info, 0, sizeof (ACPI_EVALUATE_INFO)); > Info->PrefixNode = ParentNode; > > /* > diff --git a/src/acpica/source/components/namespace/nsinit.c b/src/acpica/source/components/namespace/nsinit.c > index 279b409..6bedef9 100644 > --- a/src/acpica/source/components/namespace/nsinit.c > +++ b/src/acpica/source/components/namespace/nsinit.c > @@ -177,7 +177,7 @@ AcpiNsInitializeObjects ( > > /* Set all init info to zero */ > > - ACPI_MEMSET (&Info, 0, sizeof (ACPI_INIT_WALK_INFO)); > + memset (&Info, 0, sizeof (ACPI_INIT_WALK_INFO)); > > /* Walk entire namespace from the supplied root */ > > @@ -686,7 +686,7 @@ AcpiNsInitOneDevice ( > ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname ( > ACPI_TYPE_METHOD, DeviceNode, METHOD_NAME__INI)); > > - ACPI_MEMSET (Info, 0, sizeof (ACPI_EVALUATE_INFO)); > + memset (Info, 0, sizeof (ACPI_EVALUATE_INFO)); > Info->PrefixNode = DeviceNode; > Info->RelativePathname = METHOD_NAME__INI; > Info->Parameters = NULL; > diff --git a/src/acpica/source/components/namespace/nsparse.c b/src/acpica/source/components/namespace/nsparse.c > index da137e8..481e7c3 100644 > --- a/src/acpica/source/components/namespace/nsparse.c > +++ b/src/acpica/source/components/namespace/nsparse.c > @@ -201,6 +201,14 @@ AcpiNsOneCompleteParse ( > AmlStart, AmlLength, NULL, (UINT8) PassNumber); > } > > + /* Found OSDT table, enable the namespace override feature */ > + > + if (ACPI_COMPARE_NAME(Table->Signature, ACPI_SIG_OSDT) && > + PassNumber == ACPI_IMODE_LOAD_PASS1) > + { > + WalkState->NamespaceOverride = TRUE; > + } > + > if (ACPI_FAILURE (Status)) > { > AcpiDsDeleteWalkState (WalkState); > diff --git a/src/acpica/source/components/namespace/nsrepair2.c b/src/acpica/source/components/namespace/nsrepair2.c > index 3300819..f921ffd 100644 > --- a/src/acpica/source/components/namespace/nsrepair2.c > +++ b/src/acpica/source/components/namespace/nsrepair2.c > @@ -709,7 +709,7 @@ AcpiNsRepair_HID ( > */ > for (Dest = NewString->String.Pointer; *Source; Dest++, Source++) > { > - *Dest = (char) ACPI_TOUPPER (*Source); > + *Dest = (char) toupper (*Source); > } > > AcpiUtRemoveReference (ReturnObject); > diff --git a/src/acpica/source/components/namespace/nssearch.c b/src/acpica/source/components/namespace/nssearch.c > index 81cac95..fe6c0ad 100644 > --- a/src/acpica/source/components/namespace/nssearch.c > +++ b/src/acpica/source/components/namespace/nssearch.c > @@ -410,10 +410,42 @@ AcpiNsSearchAndEnter ( > * If we found it AND the request specifies that a find is an error, > * return the error > */ > - if ((Status == AE_OK) && > - (Flags & ACPI_NS_ERROR_IF_FOUND)) > + if (Status == AE_OK) > { > - Status = AE_ALREADY_EXISTS; > + /* The node was found in the namespace */ > + > + /* > + * If the namespace override feature is enabled for this node, > + * delete any existing attached sub-object and make the node > + * look like a new node that is owned by the override table. > + */ > + if (Flags & ACPI_NS_OVERRIDE_IF_FOUND) > + { > + AcpiNsDeleteChildren (*ReturnNode); > + if (AcpiGbl_RuntimeNamespaceOverride) > + { > + AcpiUtRemoveReference ((*ReturnNode)->Object); > + (*ReturnNode)->Object = NULL; > + (*ReturnNode)->OwnerId = WalkState->OwnerId; > + } > + else > + { > + AcpiNsRemoveNode (*ReturnNode); > + *ReturnNode = ACPI_ENTRY_NOT_FOUND; > + } > + > + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, > + "Namespace override: %4.4s pass %u type %X Owner %X\n", > + ACPI_CAST_PTR(char, &TargetName), InterpreterMode, > + (*ReturnNode)->Type, WalkState->OwnerId)); > + } > + > + /* Return an error if we don't expect to find the object */ > + > + else if (Flags & ACPI_NS_ERROR_IF_FOUND) > + { > + Status = AE_ALREADY_EXISTS; > + } > } > > #ifdef ACPI_ASL_COMPILER > diff --git a/src/acpica/source/components/namespace/nsutils.c b/src/acpica/source/components/namespace/nsutils.c > index 220c447..c1187ba 100644 > --- a/src/acpica/source/components/namespace/nsutils.c > +++ b/src/acpica/source/components/namespace/nsutils.c > @@ -419,7 +419,7 @@ AcpiNsBuildInternalName ( > { > /* Convert the character to uppercase and save it */ > > - Result[i] = (char) ACPI_TOUPPER ((int) *ExternalName); > + Result[i] = (char) toupper ((int) *ExternalName); > ExternalName++; > } > } > diff --git a/src/acpica/source/components/namespace/nsxfeval.c b/src/acpica/source/components/namespace/nsxfeval.c > index 7e23365..06328a6 100644 > --- a/src/acpica/source/components/namespace/nsxfeval.c > +++ b/src/acpica/source/components/namespace/nsxfeval.c > @@ -830,7 +830,7 @@ AcpiNsGetDeviceCallback ( > return (AE_CTRL_DEPTH); > } > > - NoMatch = ACPI_STRCMP (Hid->String, Info->Hid); > + NoMatch = strcmp (Hid->String, Info->Hid); > ACPI_FREE (Hid); > > if (NoMatch) > @@ -854,7 +854,7 @@ AcpiNsGetDeviceCallback ( > Found = FALSE; > for (i = 0; i < Cid->Count; i++) > { > - if (ACPI_STRCMP (Cid->Ids[i].String, Info->Hid) == 0) > + if (strcmp (Cid->Ids[i].String, Info->Hid) == 0) > { > /* Found a matching CID */ > > diff --git a/src/acpica/source/components/namespace/nsxfname.c b/src/acpica/source/components/namespace/nsxfname.c > index 4c71e37..d3f411b 100644 > --- a/src/acpica/source/components/namespace/nsxfname.c > +++ b/src/acpica/source/components/namespace/nsxfname.c > @@ -198,7 +198,7 @@ AcpiGetHandle ( > > /* Special case for root-only, since we can't search for it */ > > - if (!ACPI_STRCMP (Pathname, ACPI_NS_ROOT_PATH)) > + if (!strcmp (Pathname, ACPI_NS_ROOT_PATH)) > { > *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, AcpiGbl_RootNode); > return (AE_OK); > @@ -343,7 +343,7 @@ AcpiNsCopyDeviceId ( > > /* Copy actual string and return a pointer to the next string area */ > > - ACPI_MEMCPY (StringArea, Source->String, Source->Length); > + memcpy (StringArea, Source->String, Source->Length); > return (StringArea + Source->Length); > } > > @@ -362,7 +362,7 @@ AcpiNsCopyDeviceId ( > * control methods (Such as in the case of a device.) > * > * For Device and Processor objects, run the Device _HID, _UID, _CID, _SUB, > - * _STA, _ADR, _SxW, and _SxD methods. > + * _CLS, _STA, _ADR, _SxW, and _SxD methods. > * > * Note: Allocates the return buffer, must be freed by the caller. > * > @@ -379,11 +379,12 @@ AcpiGetObjectInfo ( > ACPI_PNP_DEVICE_ID *Hid = NULL; > ACPI_PNP_DEVICE_ID *Uid = NULL; > ACPI_PNP_DEVICE_ID *Sub = NULL; > + ACPI_PNP_DEVICE_ID *Cls = NULL; > char *NextIdString; > ACPI_OBJECT_TYPE Type; > ACPI_NAME Name; > UINT8 ParamCount= 0; > - UINT8 Valid = 0; > + UINT16 Valid = 0; > UINT32 InfoSize; > UINT32 i; > ACPI_STATUS Status; > @@ -431,7 +432,7 @@ AcpiGetObjectInfo ( > { > /* > * Get extra info for ACPI Device/Processor objects only: > - * Run the Device _HID, _UID, _SUB, and _CID methods. > + * Run the Device _HID, _UID, _SUB, _CID, and _CLS methods. > * > * Note: none of these methods are required, so they may or may > * not be present for this device. The Info->Valid bitfield is used > @@ -475,6 +476,15 @@ AcpiGetObjectInfo ( > InfoSize += (CidList->ListSize - sizeof (ACPI_PNP_DEVICE_ID_LIST)); > Valid |= ACPI_VALID_CID; > } > + > + /* Execute the Device._CLS method */ > + > + Status = AcpiUtExecute_CLS (Node, &Cls); > + if (ACPI_SUCCESS (Status)) > + { > + InfoSize += Cls->Length; > + Valid |= ACPI_VALID_CLS; > + } > } > > /* > @@ -606,6 +616,12 @@ AcpiGetObjectInfo ( > } > } > > + if (Cls) > + { > + NextIdString = AcpiNsCopyDeviceId (&Info->ClassCode, > + Cls, NextIdString); > + } > + > /* Copy the fixed-length data */ > > Info->InfoSize = InfoSize; > @@ -635,6 +651,10 @@ Cleanup: > { > ACPI_FREE (CidList); > } > + if (Cls) > + { > + ACPI_FREE (Cls); > + } > return (Status); > } > > @@ -756,7 +776,7 @@ AcpiInstallMethod ( > > /* Copy the method AML to the local buffer */ > > - ACPI_MEMCPY (AmlBuffer, AmlStart, AmlLength); > + memcpy (AmlBuffer, AmlStart, AmlLength); > > /* Initialize the method object with the new method's information */ > > diff --git a/src/acpica/source/components/parser/psutils.c b/src/acpica/source/components/parser/psutils.c > index 328ff5b..a36a3f3 100644 > --- a/src/acpica/source/components/parser/psutils.c > +++ b/src/acpica/source/components/parser/psutils.c > @@ -176,7 +176,7 @@ AcpiPsInitOp ( > Op->Common.DescriptorType = ACPI_DESC_TYPE_PARSER; > Op->Common.AmlOpcode = Opcode; > > - ACPI_DISASM_ONLY_MEMBERS (ACPI_STRNCPY (Op->Common.AmlOpName, > + ACPI_DISASM_ONLY_MEMBERS (strncpy (Op->Common.AmlOpName, > (AcpiPsGetOpcodeInfo (Opcode))->Name, > sizeof (Op->Common.AmlOpName))); > } > diff --git a/src/acpica/source/components/resources/rscreate.c b/src/acpica/source/components/resources/rscreate.c > index dd430ef..7d9009f 100644 > --- a/src/acpica/source/components/resources/rscreate.c > +++ b/src/acpica/source/components/resources/rscreate.c > @@ -446,12 +446,12 @@ AcpiRsCreatePciRoutingTable ( > > /* +1 to include null terminator */ > > - UserPrt->Length += (UINT32) ACPI_STRLEN (UserPrt->Source) + 1; > + UserPrt->Length += (UINT32) strlen (UserPrt->Source) + 1; > break; > > case ACPI_TYPE_STRING: > > - ACPI_STRCPY (UserPrt->Source, ObjDesc->String.Pointer); > + strcpy (UserPrt->Source, ObjDesc->String.Pointer); > > /* > * Add to the Length field the length of the string > diff --git a/src/acpica/source/components/resources/rsmisc.c b/src/acpica/source/components/resources/rsmisc.c > index 7871715..1a5512e 100644 > --- a/src/acpica/source/components/resources/rsmisc.c > +++ b/src/acpica/source/components/resources/rsmisc.c > @@ -202,7 +202,7 @@ AcpiRsConvertAmlToResource ( > /* > * Get the resource type and the initial (minimum) length > */ > - ACPI_MEMSET (Resource, 0, INIT_RESOURCE_LENGTH (Info)); > + memset (Resource, 0, INIT_RESOURCE_LENGTH (Info)); > Resource->Type = INIT_RESOURCE_TYPE (Info); > Resource->Length = INIT_RESOURCE_LENGTH (Info); > break; > @@ -398,13 +398,13 @@ AcpiRsConvertAmlToResource ( > > case ACPI_RSC_SET8: > > - ACPI_MEMSET (Destination, Info->AmlOffset, Info->Value); > + memset (Destination, Info->AmlOffset, Info->Value); > break; > > case ACPI_RSC_DATA8: > > Target = ACPI_ADD_PTR (char, Resource, Info->Value); > - ACPI_MEMCPY (Destination, Source, ACPI_GET16 (Target)); > + memcpy (Destination, Source, ACPI_GET16 (Target)); > break; > > case ACPI_RSC_ADDRESS: > @@ -577,7 +577,7 @@ AcpiRsConvertResourceToAml ( > { > case ACPI_RSC_INITSET: > > - ACPI_MEMSET (Aml, 0, INIT_RESOURCE_LENGTH (Info)); > + memset (Aml, 0, INIT_RESOURCE_LENGTH (Info)); > AmlLength = INIT_RESOURCE_LENGTH (Info); > AcpiRsSetResourceHeader (INIT_RESOURCE_TYPE (Info), AmlLength, Aml); > break; > diff --git a/src/acpica/source/components/resources/rsutils.c b/src/acpica/source/components/resources/rsutils.c > index 55445b0..a7dc215 100644 > --- a/src/acpica/source/components/resources/rsutils.c > +++ b/src/acpica/source/components/resources/rsutils.c > @@ -246,7 +246,7 @@ AcpiRsMoveData ( > case ACPI_RSC_MOVE_SERIAL_VEN: > case ACPI_RSC_MOVE_SERIAL_RES: > > - ACPI_MEMCPY (Destination, Source, ItemCount); > + memcpy (Destination, Source, ItemCount); > return; > > /* > @@ -480,11 +480,11 @@ AcpiRsGetResourceSource ( > * > * Zero the entire area of the buffer. > */ > - TotalLength = (UINT32) ACPI_STRLEN ( > + TotalLength = (UINT32) strlen ( > ACPI_CAST_PTR (char, &AmlResourceSource[1])) + 1; > TotalLength = (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (TotalLength); > > - ACPI_MEMSET (ResourceSource->StringPtr, 0, TotalLength); > + memset (ResourceSource->StringPtr, 0, TotalLength); > > /* Copy the ResourceSource string to the destination */ > > @@ -549,7 +549,7 @@ AcpiRsSetResourceSource ( > > /* Copy the ResourceSource string */ > > - ACPI_STRCPY (ACPI_CAST_PTR (char, &AmlResourceSource[1]), > + strcpy (ACPI_CAST_PTR (char, &AmlResourceSource[1]), > ResourceSource->StringPtr); > > /* > diff --git a/src/acpica/source/components/resources/rsxface.c b/src/acpica/source/components/resources/rsxface.c > index 834ae9c..9aea3dc 100644 > --- a/src/acpica/source/components/resources/rsxface.c > +++ b/src/acpica/source/components/resources/rsxface.c > @@ -519,7 +519,7 @@ AcpiResourceToAddress64 ( > > /* Simple copy for 64 bit source */ > > - ACPI_MEMCPY (Out, &Resource->Data, sizeof (ACPI_RESOURCE_ADDRESS64)); > + memcpy (Out, &Resource->Data, sizeof (ACPI_RESOURCE_ADDRESS64)); > break; > > default: > @@ -630,7 +630,7 @@ AcpiRsMatchVendorResource ( > */ > if ((Vendor->ByteLength < (ACPI_UUID_LENGTH + 1)) || > (Vendor->UuidSubtype != Info->Uuid->Subtype) || > - (ACPI_MEMCMP (Vendor->Uuid, Info->Uuid->Data, ACPI_UUID_LENGTH))) > + (memcmp (Vendor->Uuid, Info->Uuid->Data, ACPI_UUID_LENGTH))) > { > return (AE_OK); > } > @@ -646,7 +646,7 @@ AcpiRsMatchVendorResource ( > > /* Found the correct resource, copy and return it */ > > - ACPI_MEMCPY (Buffer->Pointer, Resource, Resource->Length); > + memcpy (Buffer->Pointer, Resource, Resource->Length); > Buffer->Length = Resource->Length; > > /* Found the desired descriptor, terminate resource walk */ > diff --git a/src/acpica/source/components/tables/tbdata.c b/src/acpica/source/components/tables/tbdata.c > index b89f6e8..daacf41 100644 > --- a/src/acpica/source/components/tables/tbdata.c > +++ b/src/acpica/source/components/tables/tbdata.c > @@ -149,7 +149,7 @@ AcpiTbInitTableDescriptor ( > * Initialize the table descriptor. Set the pointer to NULL, since the > * table is not fully mapped at this time. > */ > - ACPI_MEMSET (TableDesc, 0, sizeof (ACPI_TABLE_DESC)); > + memset (TableDesc, 0, sizeof (ACPI_TABLE_DESC)); > TableDesc->Address = Address; > TableDesc->Length = Table->Length; > TableDesc->Flags = Flags; > @@ -583,7 +583,7 @@ AcpiTbResizeRootTableList ( > > if (AcpiGbl_RootTableList.Tables) > { > - ACPI_MEMCPY (Tables, AcpiGbl_RootTableList.Tables, > + memcpy (Tables, AcpiGbl_RootTableList.Tables, > (ACPI_SIZE) TableCount * sizeof (ACPI_TABLE_DESC)); > > if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) > diff --git a/src/acpica/source/components/tables/tbfadt.c b/src/acpica/source/components/tables/tbfadt.c > index 93d76da..15a57e3 100644 > --- a/src/acpica/source/components/tables/tbfadt.c > +++ b/src/acpica/source/components/tables/tbfadt.c > @@ -454,8 +454,16 @@ AcpiTbParseFadt ( > > if (!AcpiGbl_ReducedHardware) > { > - AcpiTbInstallFixedTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs, > - ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS); > + if (AcpiGbl_FADT.Facs) > + { > + AcpiTbInstallFixedTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.Facs, > + ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS); > + } > + if (AcpiGbl_FADT.XFacs) > + { > + AcpiTbInstallFixedTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs, > + ACPI_SIG_FACS, ACPI_TABLE_INDEX_X_FACS); > + } > } > } > > @@ -497,11 +505,11 @@ AcpiTbCreateLocalFadt ( > > /* Clear the entire local FADT */ > > - ACPI_MEMSET (&AcpiGbl_FADT, 0, sizeof (ACPI_TABLE_FADT)); > + memset (&AcpiGbl_FADT, 0, sizeof (ACPI_TABLE_FADT)); > > /* Copy the original FADT, up to sizeof (ACPI_TABLE_FADT) */ > > - ACPI_MEMCPY (&AcpiGbl_FADT, Table, > + memcpy (&AcpiGbl_FADT, Table, > ACPI_MIN (Length, sizeof (ACPI_TABLE_FADT))); > > /* Take a copy of the Hardware Reduced flag */ > @@ -605,12 +613,9 @@ AcpiTbConvertFadt ( > AcpiGbl_FADT.Header.Length = sizeof (ACPI_TABLE_FADT); > > /* > - * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary. > + * Expand the 32-bit DSDT addresses to 64-bit as necessary. > * Later ACPICA code will always use the X 64-bit field. > */ > - AcpiGbl_FADT.XFacs = AcpiTbSelectAddress ("FACS", > - AcpiGbl_FADT.Facs, AcpiGbl_FADT.XFacs); > - > AcpiGbl_FADT.XDsdt = AcpiTbSelectAddress ("DSDT", > AcpiGbl_FADT.Dsdt, AcpiGbl_FADT.XDsdt); > > diff --git a/src/acpica/source/components/tables/tbfind.c b/src/acpica/source/components/tables/tbfind.c > index c7acd1c..a52d0de 100644 > --- a/src/acpica/source/components/tables/tbfind.c > +++ b/src/acpica/source/components/tables/tbfind.c > @@ -155,16 +155,16 @@ AcpiTbFindTable ( > > /* Normalize the input strings */ > > - ACPI_MEMSET (&Header, 0, sizeof (ACPI_TABLE_HEADER)); > + memset (&Header, 0, sizeof (ACPI_TABLE_HEADER)); > ACPI_MOVE_NAME (Header.Signature, Signature); > - ACPI_STRNCPY (Header.OemId, OemId, ACPI_OEM_ID_SIZE); > - ACPI_STRNCPY (Header.OemTableId, OemTableId, ACPI_OEM_TABLE_ID_SIZE); > + strncpy (Header.OemId, OemId, ACPI_OEM_ID_SIZE); > + strncpy (Header.OemTableId, OemTableId, ACPI_OEM_TABLE_ID_SIZE); > > /* Search for the table */ > > for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) > { > - if (ACPI_MEMCMP (&(AcpiGbl_RootTableList.Tables[i].Signature), > + if (memcmp (&(AcpiGbl_RootTableList.Tables[i].Signature), > Header.Signature, ACPI_NAME_SIZE)) > { > /* Not the requested table */ > @@ -192,13 +192,13 @@ AcpiTbFindTable ( > > /* Check for table match on all IDs */ > > - if (!ACPI_MEMCMP (AcpiGbl_RootTableList.Tables[i].Pointer->Signature, > + if (!memcmp (AcpiGbl_RootTableList.Tables[i].Pointer->Signature, > Header.Signature, ACPI_NAME_SIZE) && > (!OemId[0] || > - !ACPI_MEMCMP (AcpiGbl_RootTableList.Tables[i].Pointer->OemId, > + !memcmp (AcpiGbl_RootTableList.Tables[i].Pointer->OemId, > Header.OemId, ACPI_OEM_ID_SIZE)) && > (!OemTableId[0] || > - !ACPI_MEMCMP (AcpiGbl_RootTableList.Tables[i].Pointer->OemTableId, > + !memcmp (AcpiGbl_RootTableList.Tables[i].Pointer->OemTableId, > Header.OemTableId, ACPI_OEM_TABLE_ID_SIZE))) > { > *TableIndex = i; > diff --git a/src/acpica/source/components/tables/tbinstal.c b/src/acpica/source/components/tables/tbinstal.c > index 8833ef3..4ddf2ee 100644 > --- a/src/acpica/source/components/tables/tbinstal.c > +++ b/src/acpica/source/components/tables/tbinstal.c > @@ -166,7 +166,7 @@ AcpiTbCompareTables ( > * not just the header. > */ > IsIdentical = (BOOLEAN)((TableDesc->Length != TableLength || > - ACPI_MEMCMP (TableDesc->Pointer, Table, TableLength)) ? > + memcmp (TableDesc->Pointer, Table, TableLength)) ? > FALSE : TRUE); > > /* Release the acquired table */ > @@ -381,7 +381,7 @@ AcpiTbInstallStandardTable ( > */ > if ((NewTableDesc.Signature.Ascii[0] != 0x00) && > (!ACPI_COMPARE_NAME (&NewTableDesc.Signature, ACPI_SIG_SSDT)) && > - (ACPI_STRNCMP (NewTableDesc.Signature.Ascii, "OEM", 3))) > + (strncmp (NewTableDesc.Signature.Ascii, "OEM", 3))) > { > ACPI_BIOS_ERROR ((AE_INFO, > "Table has invalid signature [%4.4s] (0x%8.8X), " > diff --git a/src/acpica/source/components/tables/tbprint.c b/src/acpica/source/components/tables/tbprint.c > index 105925b..c7b64b4 100644 > --- a/src/acpica/source/components/tables/tbprint.c > +++ b/src/acpica/source/components/tables/tbprint.c > @@ -156,7 +156,7 @@ AcpiTbFixString ( > > while (Length && *String) > { > - if (!ACPI_IS_PRINT (*String)) > + if (!isprint (*String)) > { > *String = '?'; > } > @@ -186,7 +186,7 @@ AcpiTbCleanupTableHeader ( > ACPI_TABLE_HEADER *Header) > { > > - ACPI_MEMCPY (OutHeader, Header, sizeof (ACPI_TABLE_HEADER)); > + memcpy (OutHeader, Header, sizeof (ACPI_TABLE_HEADER)); > > AcpiTbFixString (OutHeader->Signature, ACPI_NAME_SIZE); > AcpiTbFixString (OutHeader->OemId, ACPI_OEM_ID_SIZE); > @@ -228,7 +228,7 @@ AcpiTbPrintTableHeader ( > { > /* RSDP has no common fields */ > > - ACPI_MEMCPY (LocalHeader.OemId, > + memcpy (LocalHeader.OemId, > ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->OemId, ACPI_OEM_ID_SIZE); > AcpiTbFixString (LocalHeader.OemId, ACPI_OEM_ID_SIZE); > > diff --git a/src/acpica/source/components/tables/tbutils.c b/src/acpica/source/components/tables/tbutils.c > index b2fdb91..f9d8eaa 100644 > --- a/src/acpica/source/components/tables/tbutils.c > +++ b/src/acpica/source/components/tables/tbutils.c > @@ -147,8 +147,13 @@ ACPI_STATUS > AcpiTbInitializeFacs ( > void) > { > - ACPI_STATUS Status; > > + /* If there is no FACS, just continue. There was already an error msg */ > + > + if (!AcpiGbl_FACS) > + { > + return (AE_OK); > + } > > /* If Hardware Reduced flag is set, there is no FACS */ > > @@ -158,9 +163,25 @@ AcpiTbInitializeFacs ( > return (AE_OK); > } > > - Status = AcpiGetTableByIndex (ACPI_TABLE_INDEX_FACS, > - ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_FACS)); > - return (Status); > + (void) AcpiGetTableByIndex (ACPI_TABLE_INDEX_FACS, > + ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_Facs32)); > + (void) AcpiGetTableByIndex (ACPI_TABLE_INDEX_X_FACS, > + ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_Facs64)); > + if (!AcpiGbl_Facs32 && !AcpiGbl_Facs64) > + { > + return (AE_NO_MEMORY); > + } > + > + if (AcpiGbl_Use32BitFacsAddresses) > + { > + AcpiGbl_FACS = AcpiGbl_Facs32 ? AcpiGbl_Facs32 : AcpiGbl_Facs64; > + } > + else > + { > + AcpiGbl_FACS = AcpiGbl_Facs64 ? AcpiGbl_Facs64 : AcpiGbl_Facs32; > + } > + > + return (AE_OK); > } > #endif /* !ACPI_REDUCED_HARDWARE */ > > @@ -183,7 +204,7 @@ AcpiTbTablesLoaded ( > void) > { > > - if (AcpiGbl_RootTableList.CurrentTableCount >= 3) > + if (AcpiGbl_RootTableList.CurrentTableCount >= 4) > { > return (TRUE); > } > @@ -262,7 +283,7 @@ AcpiTbCopyDsdt ( > return (NULL); > } > > - ACPI_MEMCPY (NewTable, TableDesc->Pointer, TableDesc->Length); > + memcpy (NewTable, TableDesc->Pointer, TableDesc->Length); > AcpiTbUninstallTable (TableDesc); > > AcpiTbInitTableDescriptor ( > @@ -461,11 +482,11 @@ AcpiTbParseRootTable ( > TableEntry = ACPI_ADD_PTR (UINT8, Table, sizeof (ACPI_TABLE_HEADER)); > > /* > - * First two entries in the table array are reserved for the DSDT > - * and FACS, which are not actually present in the RSDT/XSDT - they > - * come from the FADT > + * First three entries in the table array are reserved for the DSDT > + * and 32bit/64bit FACS, which are not actually present in the > + * RSDT/XSDT - they come from the FADT > */ > - AcpiGbl_RootTableList.CurrentTableCount = 2; > + AcpiGbl_RootTableList.CurrentTableCount = 3; > > /* Initialize the root table array from the RSDT/XSDT */ > > diff --git a/src/acpica/source/components/tables/tbxface.c b/src/acpica/source/components/tables/tbxface.c > index d2351d3..25e1405 100644 > --- a/src/acpica/source/components/tables/tbxface.c > +++ b/src/acpica/source/components/tables/tbxface.c > @@ -204,7 +204,7 @@ AcpiInitializeTables ( > { > /* Root Table Array has been statically allocated by the host */ > > - ACPI_MEMSET (InitialTableArray, 0, > + memset (InitialTableArray, 0, > (ACPI_SIZE) InitialTableCount * sizeof (ACPI_TABLE_DESC)); > > AcpiGbl_RootTableList.Tables = InitialTableArray; > @@ -343,7 +343,7 @@ AcpiGetTableHeader ( > return (AE_NO_MEMORY); > } > > - ACPI_MEMCPY (OutTableHeader, Header, > + memcpy (OutTableHeader, Header, > sizeof (ACPI_TABLE_HEADER)); > AcpiOsUnmapMemory (Header, sizeof (ACPI_TABLE_HEADER)); > } > @@ -354,7 +354,7 @@ AcpiGetTableHeader ( > } > else > { > - ACPI_MEMCPY (OutTableHeader, > + memcpy (OutTableHeader, > AcpiGbl_RootTableList.Tables[i].Pointer, > sizeof (ACPI_TABLE_HEADER)); > } > diff --git a/src/acpica/source/components/tables/tbxfload.c b/src/acpica/source/components/tables/tbxfload.c > index 83f6420..7a6711f 100644 > --- a/src/acpica/source/components/tables/tbxfload.c > +++ b/src/acpica/source/components/tables/tbxfload.c > @@ -236,7 +236,7 @@ AcpiTbLoadNamespace ( > * Save the original DSDT header for detection of table corruption > * and/or replacement of the DSDT from outside the OS. > */ > - ACPI_MEMCPY (&AcpiGbl_OriginalDsdtHeader, AcpiGbl_DSDT, > + memcpy (&AcpiGbl_OriginalDsdtHeader, AcpiGbl_DSDT, > sizeof (ACPI_TABLE_HEADER)); > > (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); > @@ -254,10 +254,13 @@ AcpiTbLoadNamespace ( > (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); > for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) > { > - if ((!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), > + if (!AcpiGbl_RootTableList.Tables[i].Address || > + (!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), > ACPI_SIG_SSDT) && > !ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), > - ACPI_SIG_PSDT)) || > + ACPI_SIG_PSDT) && > + !ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), > + ACPI_SIG_OSDT)) || > ACPI_FAILURE (AcpiTbValidateTable ( > &AcpiGbl_RootTableList.Tables[i]))) > { > @@ -310,11 +313,11 @@ AcpiInstallTable ( > > if (Physical) > { > - Flags = ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL; > + Flags = ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL; > } > else > { > - Flags = ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL; > + Flags = ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL; > } > > Status = AcpiTbInstallStandardTable (Address, Flags, > diff --git a/src/acpica/source/components/utilities/utalloc.c b/src/acpica/source/components/utilities/utalloc.c > index 0c8c928..62c3e28 100644 > --- a/src/acpica/source/components/utilities/utalloc.c > +++ b/src/acpica/source/components/utilities/utalloc.c > @@ -151,7 +151,7 @@ AcpiOsAllocateZeroed ( > { > /* Clear the memory block */ > > - ACPI_MEMSET (Allocation, 0, Size); > + memset (Allocation, 0, Size); > } > > return (Allocation); > @@ -261,7 +261,7 @@ AcpiUtDeleteCaches ( > > if (AcpiGbl_DisplayFinalMemStats) > { > - ACPI_STRCPY (Buffer, "MEMORY"); > + strcpy (Buffer, "MEMORY"); > (void) AcpiDbDisplayStatistics (Buffer); > } > #endif > @@ -431,6 +431,6 @@ AcpiUtInitializeBuffer ( > > /* Have a valid buffer, clear it */ > > - ACPI_MEMSET (Buffer->Pointer, 0, RequiredLength); > + memset (Buffer->Pointer, 0, RequiredLength); > return (AE_OK); > } > diff --git a/src/acpica/source/components/utilities/utbuffer.c b/src/acpica/source/components/utilities/utbuffer.c > index 65110fb..79aff33 100644 > --- a/src/acpica/source/components/utilities/utbuffer.c > +++ b/src/acpica/source/components/utilities/utbuffer.c > @@ -240,7 +240,7 @@ AcpiUtDumpBuffer ( > } > > BufChar = Buffer[(ACPI_SIZE) i + j]; > - if (ACPI_IS_PRINT (BufChar)) > + if (isprint (BufChar)) > { > AcpiOsPrintf ("%c", BufChar); > } > @@ -413,7 +413,7 @@ AcpiUtDumpBufferToFile ( > } > > BufChar = Buffer[(ACPI_SIZE) i + j]; > - if (ACPI_IS_PRINT (BufChar)) > + if (isprint (BufChar)) > { > AcpiUtFilePrintf (File, "%c", BufChar); > } > diff --git a/src/acpica/source/components/utilities/utcache.c b/src/acpica/source/components/utilities/utcache.c > index 25c8e0e..5cf5250 100644 > --- a/src/acpica/source/components/utilities/utcache.c > +++ b/src/acpica/source/components/utilities/utcache.c > @@ -164,7 +164,7 @@ AcpiOsCreateCache ( > > /* Populate the cache object and return it */ > > - ACPI_MEMSET (Cache, 0, sizeof (ACPI_MEMORY_LIST)); > + memset (Cache, 0, sizeof (ACPI_MEMORY_LIST)); > Cache->ListName = CacheName; > Cache->ObjectSize = ObjectSize; > Cache->MaxDepth = MaxDepth; > @@ -314,7 +314,7 @@ AcpiOsReleaseObject ( > > /* Mark the object as cached */ > > - ACPI_MEMSET (Object, 0xCA, Cache->ObjectSize); > + memset (Object, 0xCA, Cache->ObjectSize); > ACPI_SET_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_CACHED); > > /* Put the object at the head of the cache list */ > @@ -390,7 +390,7 @@ AcpiOsAcquireObject ( > > /* Clear (zero) the previously used Object */ > > - ACPI_MEMSET (Object, 0, Cache->ObjectSize); > + memset (Object, 0, Cache->ObjectSize); > } > else > { > diff --git a/src/acpica/source/components/utilities/utcopy.c b/src/acpica/source/components/utilities/utcopy.c > index 7dfc104..bc77787 100644 > --- a/src/acpica/source/components/utilities/utcopy.c > +++ b/src/acpica/source/components/utilities/utcopy.c > @@ -218,7 +218,7 @@ AcpiUtCopyIsimpleToEsimple ( > > /* Always clear the external object */ > > - ACPI_MEMSET (ExternalObject, 0, sizeof (ACPI_OBJECT)); > + memset (ExternalObject, 0, sizeof (ACPI_OBJECT)); > > /* > * In general, the external object will be the same type as > @@ -237,7 +237,7 @@ AcpiUtCopyIsimpleToEsimple ( > *BufferSpaceUsed = ACPI_ROUND_UP_TO_NATIVE_WORD ( > (ACPI_SIZE) InternalObject->String.Length + 1); > > - ACPI_MEMCPY ((void *) DataSpace, > + memcpy ((void *) DataSpace, > (void *) InternalObject->String.Pointer, > (ACPI_SIZE) InternalObject->String.Length + 1); > break; > @@ -249,7 +249,7 @@ AcpiUtCopyIsimpleToEsimple ( > *BufferSpaceUsed = ACPI_ROUND_UP_TO_NATIVE_WORD ( > InternalObject->String.Length); > > - ACPI_MEMCPY ((void *) DataSpace, > + memcpy ((void *) DataSpace, > (void *) InternalObject->Buffer.Pointer, > InternalObject->Buffer.Length); > break; > @@ -600,7 +600,7 @@ AcpiUtCopyEsimpleToIsimple ( > goto ErrorExit; > } > > - ACPI_MEMCPY (InternalObject->String.Pointer, > + memcpy (InternalObject->String.Pointer, > ExternalObject->String.Pointer, > ExternalObject->String.Length); > > @@ -616,7 +616,7 @@ AcpiUtCopyEsimpleToIsimple ( > goto ErrorExit; > } > > - ACPI_MEMCPY (InternalObject->Buffer.Pointer, > + memcpy (InternalObject->Buffer.Pointer, > ExternalObject->Buffer.Pointer, > ExternalObject->Buffer.Length); > > @@ -804,7 +804,7 @@ AcpiUtCopySimpleObject ( > CopySize = sizeof (ACPI_NAMESPACE_NODE); > } > > - ACPI_MEMCPY (ACPI_CAST_PTR (char, DestDesc), > + memcpy (ACPI_CAST_PTR (char, DestDesc), > ACPI_CAST_PTR (char, SourceDesc), CopySize); > > /* Restore the saved fields */ > @@ -838,7 +838,7 @@ AcpiUtCopySimpleObject ( > > /* Copy the actual buffer data */ > > - ACPI_MEMCPY (DestDesc->Buffer.Pointer, > + memcpy (DestDesc->Buffer.Pointer, > SourceDesc->Buffer.Pointer, SourceDesc->Buffer.Length); > } > break; > @@ -860,7 +860,7 @@ AcpiUtCopySimpleObject ( > > /* Copy the actual string data */ > > - ACPI_MEMCPY (DestDesc->String.Pointer, SourceDesc->String.Pointer, > + memcpy (DestDesc->String.Pointer, SourceDesc->String.Pointer, > (ACPI_SIZE) SourceDesc->String.Length + 1); > } > break; > diff --git a/src/acpica/source/components/utilities/utids.c b/src/acpica/source/components/utilities/utids.c > index f611997..3bb12f0 100644 > --- a/src/acpica/source/components/utilities/utids.c > +++ b/src/acpica/source/components/utilities/utids.c > @@ -1,6 +1,6 @@ > /****************************************************************************** > * > - * Module Name: utids - support for device IDs - HID, UID, CID > + * Module Name: utids - support for device IDs - HID, UID, CID, SUB, CLS > * > *****************************************************************************/ > > @@ -193,7 +193,7 @@ AcpiUtExecute_HID ( > } > else > { > - ACPI_STRCPY (Hid->String, ObjDesc->String.Pointer); > + strcpy (Hid->String, ObjDesc->String.Pointer); > } > > Hid->Length = Length; > @@ -266,7 +266,7 @@ AcpiUtExecute_SUB ( > > /* Simply copy existing string */ > > - ACPI_STRCPY (Sub->String, ObjDesc->String.Pointer); > + strcpy (Sub->String, ObjDesc->String.Pointer); > Sub->Length = Length; > *ReturnId = Sub; > > @@ -351,7 +351,7 @@ AcpiUtExecute_UID ( > } > else > { > - ACPI_STRCPY (Uid->String, ObjDesc->String.Pointer); > + strcpy (Uid->String, ObjDesc->String.Pointer); > } > > Uid->Length = Length; > @@ -498,7 +498,7 @@ AcpiUtExecute_CID ( > { > /* Copy the String CID from the returned object */ > > - ACPI_STRCPY (NextIdString, CidObjects[i]->String.Pointer); > + strcpy (NextIdString, CidObjects[i]->String.Pointer); > Length = CidObjects[i]->String.Length + 1; > } > > @@ -521,3 +521,97 @@ Cleanup: > AcpiUtRemoveReference (ObjDesc); > return_ACPI_STATUS (Status); > } > + > + > +/******************************************************************************* > + * > + * FUNCTION: AcpiUtExecute_CLS > + * > + * PARAMETERS: DeviceNode - Node for the device > + * ReturnId - Where the _CLS is returned > + * > + * RETURN: Status > + * > + * DESCRIPTION: Executes the _CLS control method that returns PCI-defined > + * class code of the device. The _CLS value is always a package > + * containing PCI class information as a list of integers. > + * The returned string has format "BBSSPP", where: > + * BB = Base-class code > + * SS = Sub-class code > + * PP = Programming Interface code > + * > + ******************************************************************************/ > + > +ACPI_STATUS > +AcpiUtExecute_CLS ( > + ACPI_NAMESPACE_NODE *DeviceNode, > + ACPI_PNP_DEVICE_ID **ReturnId) > +{ > + ACPI_OPERAND_OBJECT *ObjDesc; > + ACPI_OPERAND_OBJECT **ClsObjects; > + UINT32 Count; > + ACPI_PNP_DEVICE_ID *Cls; > + UINT32 Length; > + ACPI_STATUS Status; > + UINT8 ClassCode[3] = {0, 0, 0}; > + > + > + ACPI_FUNCTION_TRACE (UtExecute_CLS); > + > + > + Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__CLS, > + ACPI_BTYPE_PACKAGE, &ObjDesc); > + if (ACPI_FAILURE (Status)) > + { > + return_ACPI_STATUS (Status); > + } > + > + /* Get the size of the String to be returned, includes null terminator */ > + > + Length = ACPI_PCICLS_STRING_SIZE; > + ClsObjects = ObjDesc->Package.Elements; > + Count = ObjDesc->Package.Count; > + > + if (ObjDesc->Common.Type == ACPI_TYPE_PACKAGE) > + { > + if (Count > 0 && ClsObjects[0]->Common.Type == ACPI_TYPE_INTEGER) > + { > + ClassCode[0] = (UINT8) ClsObjects[0]->Integer.Value; > + } > + if (Count > 1 && ClsObjects[1]->Common.Type == ACPI_TYPE_INTEGER) > + { > + ClassCode[1] = (UINT8) ClsObjects[1]->Integer.Value; > + } > + if (Count > 2 && ClsObjects[2]->Common.Type == ACPI_TYPE_INTEGER) > + { > + ClassCode[2] = (UINT8) ClsObjects[2]->Integer.Value; > + } > + } > + > + /* Allocate a buffer for the CLS */ > + > + Cls = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length); > + if (!Cls) > + { > + Status = AE_NO_MEMORY; > + goto Cleanup; > + } > + > + /* Area for the string starts after PNP_DEVICE_ID struct */ > + > + Cls->String = ACPI_ADD_PTR (char, Cls, sizeof (ACPI_PNP_DEVICE_ID)); > + > + /* Simply copy existing string */ > + > + AcpiExPciClsToString (Cls->String, ClassCode); > + Cls->Length = Length; > + *ReturnId = Cls; > + > + > +Cleanup: > + > + /* On exit, we must delete the return object */ > + > + AcpiUtRemoveReference (ObjDesc); > + return_ACPI_STATUS (Status); > +} > diff --git a/src/acpica/source/components/utilities/utmisc.c b/src/acpica/source/components/utilities/utmisc.c > index 32ce271..141db80 100644 > --- a/src/acpica/source/components/utilities/utmisc.c > +++ b/src/acpica/source/components/utilities/utmisc.c > @@ -143,10 +143,10 @@ AcpiUtIsPciRootBridge ( > * Check if this is a PCI root bridge. > * ACPI 3.0+: check for a PCI Express root also. > */ > - if (!(ACPI_STRCMP (Id, > + if (!(strcmp (Id, > PCI_ROOT_HID_STRING)) || > > - !(ACPI_STRCMP (Id, > + !(strcmp (Id, > PCI_EXPRESS_ROOT_HID_STRING))) > { > return (TRUE); > @@ -180,7 +180,8 @@ AcpiUtIsAmlTable ( > > if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT) || > ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_PSDT) || > - ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_SSDT)) > + ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_SSDT) || > + ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_OSDT)) > { > return (TRUE); > } > diff --git a/src/acpica/source/components/utilities/utosi.c b/src/acpica/source/components/utilities/utosi.c > index d88fe8f..b4d8a71 100644 > --- a/src/acpica/source/components/utilities/utosi.c > +++ b/src/acpica/source/components/utilities/utosi.c > @@ -328,7 +328,7 @@ AcpiUtInstallInterface ( > return (AE_NO_MEMORY); > } > > - InterfaceInfo->Name = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (InterfaceName) + 1); > + InterfaceInfo->Name = ACPI_ALLOCATE_ZEROED (strlen (InterfaceName) + 1); > if (!InterfaceInfo->Name) > { > ACPI_FREE (InterfaceInfo); > @@ -337,7 +337,7 @@ AcpiUtInstallInterface ( > > /* Initialize new info and insert at the head of the global list */ > > - ACPI_STRCPY (InterfaceInfo->Name, InterfaceName); > + strcpy (InterfaceInfo->Name, InterfaceName); > InterfaceInfo->Flags = ACPI_OSI_DYNAMIC; > InterfaceInfo->Next = AcpiGbl_SupportedInterfaces; > > @@ -370,7 +370,7 @@ AcpiUtRemoveInterface ( > PreviousInterface = NextInterface = AcpiGbl_SupportedInterfaces; > while (NextInterface) > { > - if (!ACPI_STRCMP (InterfaceName, NextInterface->Name)) > + if (!strcmp (InterfaceName, NextInterface->Name)) > { > /* Found: name is in either the static list or was added at runtime */ > > @@ -491,7 +491,7 @@ AcpiUtGetInterface ( > NextInterface = AcpiGbl_SupportedInterfaces; > while (NextInterface) > { > - if (!ACPI_STRCMP (InterfaceName, NextInterface->Name)) > + if (!strcmp (InterfaceName, NextInterface->Name)) > { > return (NextInterface); > } > diff --git a/src/acpica/source/components/utilities/utpredef.c b/src/acpica/source/components/utilities/utpredef.c > index 19561be..11471c7 100644 > --- a/src/acpica/source/components/utilities/utpredef.c > +++ b/src/acpica/source/components/utilities/utpredef.c > @@ -238,7 +238,7 @@ AcpiUtGetExpectedReturnTypes ( > > if (!ExpectedBtypes) > { > - ACPI_STRCPY (Buffer, "NONE"); > + strcpy (Buffer, "NONE"); > return; > } > > @@ -252,7 +252,7 @@ AcpiUtGetExpectedReturnTypes ( > > if (ExpectedBtypes & ThisRtype) > { > - ACPI_STRCAT (Buffer, &UtRtypeNames[i][j]); > + strcat (Buffer, &UtRtypeNames[i][j]); > j = 0; /* Use name separator from now on */ > } > > diff --git a/src/acpica/source/components/utilities/utprint.c b/src/acpica/source/components/utilities/utprint.c > index 13bf94a..c2d8870 100644 > --- a/src/acpica/source/components/utilities/utprint.c > +++ b/src/acpica/source/components/utilities/utprint.c > @@ -299,7 +299,7 @@ AcpiUtScanNumber ( > UINT64 Number = 0; > > > - while (ACPI_IS_DIGIT (*String)) > + while (isdigit (*String)) > { > Number *= 10; > Number += *(String++) - '0'; > @@ -577,7 +577,7 @@ AcpiUtVsnprintf ( > /* Process width */ > > Width = -1; > - if (ACPI_IS_DIGIT (*Format)) > + if (isdigit (*Format)) > { > Format = AcpiUtScanNumber (Format, &Number); > Width = (INT32) Number; > @@ -599,7 +599,7 @@ AcpiUtVsnprintf ( > if (*Format == '.') > { > ++Format; > - if (ACPI_IS_DIGIT(*Format)) > + if (isdigit(*Format)) > { > Format = AcpiUtScanNumber (Format, &Number); > Precision = (INT32) Number; > diff --git a/src/acpica/source/components/utilities/utstring.c b/src/acpica/source/components/utilities/utstring.c > index 953f304..75e6ace 100644 > --- a/src/acpica/source/components/utilities/utstring.c > +++ b/src/acpica/source/components/utilities/utstring.c > @@ -161,7 +161,7 @@ AcpiUtStrlwr ( > > for (String = SrcString; *String; String++) > { > - *String = (char) ACPI_TOLOWER (*String); > + *String = (char) tolower (*String); > } > > return; > @@ -240,7 +240,7 @@ AcpiUtStrupr ( > > for (String = SrcString; *String; String++) > { > - *String = (char) ACPI_TOUPPER (*String); > + *String = (char) toupper (*String); > } > > return; > @@ -306,7 +306,7 @@ AcpiUtStrtoul64 ( > > /* Skip over any white space in the buffer */ > > - while ((*String) && (ACPI_IS_SPACE (*String) || *String == '\t')) > + while ((*String) && (isspace (*String) || *String == '\t')) > { > String++; > } > @@ -317,7 +317,7 @@ AcpiUtStrtoul64 ( > * Base equal to ACPI_ANY_BASE means 'ToInteger operation case'. > * We need to determine if it is decimal or hexadecimal. > */ > - if ((*String == '0') && (ACPI_TOLOWER (*(String + 1)) == 'x')) > + if ((*String == '0') && (tolower (*(String + 1)) == 'x')) > { > SignOf0x = 1; > Base = 16; > @@ -333,7 +333,7 @@ AcpiUtStrtoul64 ( > > /* Any string left? Check that '0x' is not followed by white space. */ > > - if (!(*String) || ACPI_IS_SPACE (*String) || *String == '\t') > + if (!(*String) || isspace (*String) || *String == '\t') > { > if (ToIntegerOp) > { > @@ -355,7 +355,7 @@ AcpiUtStrtoul64 ( > > while (*String) > { > - if (ACPI_IS_DIGIT (*String)) > + if (isdigit (*String)) > { > /* Convert ASCII 0-9 to Decimal value */ > > @@ -369,8 +369,8 @@ AcpiUtStrtoul64 ( > } > else > { > - ThisDigit = (UINT8) ACPI_TOUPPER (*String); > - if (ACPI_IS_XDIGIT ((char) ThisDigit)) > + ThisDigit = (UINT8) toupper (*String); > + if (isxdigit ((char) ThisDigit)) > { > /* Convert ASCII Hex char to value */ > > @@ -541,7 +541,7 @@ AcpiUtPrintString ( > > /* Check for printable character or hex escape */ > > - if (ACPI_IS_PRINT (String[i])) > + if (isprint (String[i])) > { > /* This is a normal character */ > > @@ -783,12 +783,12 @@ AcpiUtSafeStrcpy ( > char *Source) > { > > - if (ACPI_STRLEN (Source) >= DestSize) > + if (strlen (Source) >= DestSize) > { > return (TRUE); > } > > - ACPI_STRCPY (Dest, Source); > + strcpy (Dest, Source); > return (FALSE); > } > > @@ -799,12 +799,12 @@ AcpiUtSafeStrcat ( > char *Source) > { > > - if ((ACPI_STRLEN (Dest) + ACPI_STRLEN (Source)) >= DestSize) > + if ((strlen (Dest) + strlen (Source)) >= DestSize) > { > return (TRUE); > } > > - ACPI_STRCAT (Dest, Source); > + strcat (Dest, Source); > return (FALSE); > } > > @@ -818,14 +818,14 @@ AcpiUtSafeStrncat ( > ACPI_SIZE ActualTransferLength; > > > - ActualTransferLength = ACPI_MIN (MaxTransferLength, ACPI_STRLEN (Source)); > + ActualTransferLength = ACPI_MIN (MaxTransferLength, strlen (Source)); > > - if ((ACPI_STRLEN (Dest) + ActualTransferLength) >= DestSize) > + if ((strlen (Dest) + ActualTransferLength) >= DestSize) > { > return (TRUE); > } > > - ACPI_STRNCAT (Dest, Source, MaxTransferLength); > + strncat (Dest, Source, MaxTransferLength); > return (FALSE); > } > #endif > diff --git a/src/acpica/source/components/utilities/uttrack.c b/src/acpica/source/components/utilities/uttrack.c > index 284bee0..f7f0bce 100644 > --- a/src/acpica/source/components/utilities/uttrack.c > +++ b/src/acpica/source/components/utilities/uttrack.c > @@ -185,7 +185,7 @@ AcpiUtCreateList ( > return (AE_NO_MEMORY); > } > > - ACPI_MEMSET (Cache, 0, sizeof (ACPI_MEMORY_LIST)); > + memset (Cache, 0, sizeof (ACPI_MEMORY_LIST)); > > Cache->ListName = ListName; > Cache->ObjectSize = ObjectSize; > @@ -517,7 +517,7 @@ AcpiUtTrackAllocation ( > Allocation->Component = Component; > Allocation->Line = Line; > > - ACPI_STRNCPY (Allocation->Module, Module, ACPI_MAX_MODULE_NAME); > + strncpy (Allocation->Module, Module, ACPI_MAX_MODULE_NAME); > Allocation->Module[ACPI_MAX_MODULE_NAME-1] = 0; > > if (!Element) > @@ -628,7 +628,7 @@ AcpiUtRemoveAllocation ( > > /* Mark the segment as deleted */ > > - ACPI_MEMSET (&Allocation->UserSpace, 0xEA, Allocation->Size); > + memset (&Allocation->UserSpace, 0xEA, Allocation->Size); > > Status = AcpiUtReleaseMutex (ACPI_MTX_MEMORY); > return (Status); > @@ -739,7 +739,7 @@ AcpiUtDumpAllocations ( > while (Element) > { > if ((Element->Component & Component) && > - ((Module == NULL) || (0 == ACPI_STRCMP (Module, Element->Module)))) > + ((Module == NULL) || (0 == strcmp (Module, Element->Module)))) > { > Descriptor = ACPI_CAST_PTR (ACPI_DESCRIPTOR, &Element->UserSpace); > > diff --git a/src/acpica/source/components/utilities/utxface.c b/src/acpica/source/components/utilities/utxface.c > index e01c4d5..612024f 100644 > --- a/src/acpica/source/components/utilities/utxface.c > +++ b/src/acpica/source/components/utilities/utxface.c > @@ -335,7 +335,7 @@ AcpiGetStatistics ( > Stats->SciCount = AcpiSciCount; > Stats->GpeCount = AcpiGpeCount; > > - ACPI_MEMCPY (Stats->FixedEventCount, AcpiFixedEventCount, > + memcpy (Stats->FixedEventCount, AcpiFixedEventCount, > sizeof (AcpiFixedEventCount)); > > > @@ -439,7 +439,7 @@ AcpiInstallInterface ( > > /* Parameter validation */ > > - if (!InterfaceName || (ACPI_STRLEN (InterfaceName) == 0)) > + if (!InterfaceName || (strlen (InterfaceName) == 0)) > { > return (AE_BAD_PARAMETER); > } > @@ -504,7 +504,7 @@ AcpiRemoveInterface ( > > /* Parameter validation */ > > - if (!InterfaceName || (ACPI_STRLEN (InterfaceName) == 0)) > + if (!InterfaceName || (strlen (InterfaceName) == 0)) > { > return (AE_BAD_PARAMETER); > } > diff --git a/src/acpica/source/include/acglobal.h b/src/acpica/source/include/acglobal.h > index 1610799..3e399ba 100644 > --- a/src/acpica/source/include/acglobal.h > +++ b/src/acpica/source/include/acglobal.h > @@ -134,6 +134,8 @@ ACPI_GLOBAL (ACPI_TABLE_HEADER, AcpiGbl_OriginalDsdtHeader); > > #if (!ACPI_REDUCED_HARDWARE) > ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_FACS); > +ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_Facs32); > +ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_Facs64); > > #endif /* !ACPI_REDUCED_HARDWARE */ > > diff --git a/src/acpica/source/include/acinterp.h b/src/acpica/source/include/acinterp.h > index f0edcb1..7c74e05 100644 > --- a/src/acpica/source/include/acinterp.h > +++ b/src/acpica/source/include/acinterp.h > @@ -710,6 +710,11 @@ AcpiExIntegerToString ( > char *Dest, > UINT64 Value); > > +void > +AcpiExPciClsToString ( > + char *Dest, > + UINT8 ClassCode[3]); > + > BOOLEAN > AcpiIsValidSpaceId ( > UINT8 SpaceId); > diff --git a/src/acpica/source/include/aclocal.h b/src/acpica/source/include/aclocal.h > index dc7a2eb..b550282 100644 > --- a/src/acpica/source/include/aclocal.h > +++ b/src/acpica/source/include/aclocal.h > @@ -310,6 +310,7 @@ typedef struct acpi_table_list > > #define ACPI_TABLE_INDEX_DSDT (0) > #define ACPI_TABLE_INDEX_FACS (1) > +#define ACPI_TABLE_INDEX_X_FACS (2) > > > typedef struct acpi_find_context > diff --git a/src/acpica/source/include/acnames.h b/src/acpica/source/include/acnames.h > index e87f927..7c5ef64 100644 > --- a/src/acpica/source/include/acnames.h > +++ b/src/acpica/source/include/acnames.h > @@ -123,6 +123,7 @@ > #define METHOD_NAME__BBN "_BBN" > #define METHOD_NAME__CBA "_CBA" > #define METHOD_NAME__CID "_CID" > +#define METHOD_NAME__CLS "_CLS" > #define METHOD_NAME__CRS "_CRS" > #define METHOD_NAME__DDN "_DDN" > #define METHOD_NAME__HID "_HID" > diff --git a/src/acpica/source/include/acnamesp.h b/src/acpica/source/include/acnamesp.h > index b66d3e4..1b19357 100644 > --- a/src/acpica/source/include/acnamesp.h > +++ b/src/acpica/source/include/acnamesp.h > @@ -139,6 +139,7 @@ > #define ACPI_NS_PREFIX_IS_SCOPE 0x10 > #define ACPI_NS_EXTERNAL 0x20 > #define ACPI_NS_TEMPORARY 0x40 > +#define ACPI_NS_OVERRIDE_IF_FOUND 0x80 > > /* Flags for AcpiNsWalkNamespace */ > > diff --git a/src/acpica/source/include/acobject.h b/src/acpica/source/include/acobject.h > index 0712e75..fbd28a9 100644 > --- a/src/acpica/source/include/acobject.h > +++ b/src/acpica/source/include/acobject.h > @@ -502,13 +502,14 @@ typedef struct acpi_object_addr_handler > typedef struct acpi_object_reference > { > ACPI_OBJECT_COMMON_HEADER > - UINT8 Class; /* Reference Class */ > - UINT8 TargetType; /* Used for Index Op */ > - UINT8 Reserved; > - void *Object; /* NameOp=>HANDLE to obj, IndexOp=>ACPI_OPERAND_OBJECT */ > - ACPI_NAMESPACE_NODE *Node; /* RefOf or Namepath */ > - union acpi_operand_object **Where; /* Target of Index */ > - UINT32 Value; /* Used for Local/Arg/Index/DdbHandle */ > + UINT8 Class; /* Reference Class */ > + UINT8 TargetType; /* Used for Index Op */ > + UINT8 Reserved; > + void *Object; /* NameOp=>HANDLE to obj, IndexOp=>ACPI_OPERAND_OBJECT */ > + ACPI_NAMESPACE_NODE *Node; /* RefOf or Namepath */ > + union acpi_operand_object **Where; /* Target of Index */ > + UINT8 *IndexPointer; /* Used for Buffers and Strings */ > + UINT32 Value; /* Used for Local/Arg/Index/DdbHandle */ > > } ACPI_OBJECT_REFERENCE; > > diff --git a/src/acpica/source/include/acoutput.h b/src/acpica/source/include/acoutput.h > index f0cd27a..9570a38 100644 > --- a/src/acpica/source/include/acoutput.h > +++ b/src/acpica/source/include/acoutput.h > @@ -370,8 +370,12 @@ > > /* DEBUG_PRINT functions */ > > -#define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist > -#define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW plist > +#ifndef COMPILER_VA_MACRO > + > +#define ACPI_DEBUG_PRINT(plist) AcpiDebugPrint plist > +#define ACPI_DEBUG_PRINT_RAW(plist) AcpiDebugPrintRaw plist > + > +#else > > /* Helper macros for DEBUG_PRINT */ > > @@ -391,6 +395,11 @@ > ACPI_DO_DEBUG_PRINT (AcpiDebugPrintRaw, Level, Line, \ > Filename, Modulename, Component, __VA_ARGS__) > > +#define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist > +#define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW plist > + > +#endif > + > > /* > * Function entry tracing > diff --git a/src/acpica/source/include/acpixf.h b/src/acpica/source/include/acpixf.h > index 93d4284..cf0bb58 100644 > --- a/src/acpica/source/include/acpixf.h > +++ b/src/acpica/source/include/acpixf.h > @@ -118,7 +118,7 @@ > > /* Current ACPICA subsystem version in YYYYMMDD format */ > > -#define ACPI_CA_VERSION 0x20150515 > +#define ACPI_CA_VERSION 0x20150616 > > #include "acconfig.h" > #include "actypes.h" > @@ -274,6 +274,15 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE); > ACPI_INIT_GLOBAL (UINT8, AcpiGbl_Use32BitFadtAddresses, FALSE); > > /* > + * Optionally use 32-bit FACS table addresses. > + * It is reported that some platforms fail to resume from system suspending > + * if 64-bit FACS table address is selected: > + * https://bugzilla.kernel.org/show_bug.cgi?id=74021 > + * Default is TRUE, favor the 32-bit addresses. > + */ > +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_Use32BitFacsAddresses, TRUE); > + > +/* > * Optionally truncate I/O addresses to 16 bits. Provides compatibility > * with other ACPI implementations. NOTE: During ACPICA initialization, > * this value is set to TRUE if any Windows OSI strings have been > @@ -294,6 +303,11 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableAutoRepair, FALSE); > ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableSsdtTableInstall, FALSE); > > /* > + * Optionally enable runtime namespace override. > + */ > +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_RuntimeNamespaceOverride, TRUE); > + > +/* > * We keep track of the latest version of Windows that has been requested by > * the BIOS. ACPI 5.0. > */ > @@ -1138,14 +1152,8 @@ AcpiLeaveSleepState ( > ACPI_HW_DEPENDENT_RETURN_STATUS ( > ACPI_STATUS > AcpiSetFirmwareWakingVector ( > - UINT32 PhysicalAddress)) > - > -#if ACPI_MACHINE_WIDTH == 64 > -ACPI_HW_DEPENDENT_RETURN_STATUS ( > -ACPI_STATUS > -AcpiSetFirmwareWakingVector64 ( > - UINT64 PhysicalAddress)) > -#endif > + ACPI_PHYSICAL_ADDRESS PhysicalAddress, > + ACPI_PHYSICAL_ADDRESS PhysicalAddress64)) > > > /* > diff --git a/src/acpica/source/include/acstruct.h b/src/acpica/source/include/acstruct.h > index ad43d6c..d647826 100644 > --- a/src/acpica/source/include/acstruct.h > +++ b/src/acpica/source/include/acstruct.h > @@ -157,6 +157,7 @@ typedef struct acpi_walk_state > UINT8 ReturnUsed; > UINT8 ScopeDepth; > UINT8 PassNumber; /* Parse pass during table load */ > + BOOLEAN NamespaceOverride; /* Override existing objects */ > UINT8 ResultSize; /* Total elements for the result stack */ > UINT8 ResultCount; /* Current number of occupied elements of result stack */ > UINT32 AmlOffset; > diff --git a/src/acpica/source/include/actbl.h b/src/acpica/source/include/actbl.h > index f3cf709..7ec5f62 100644 > --- a/src/acpica/source/include/actbl.h > +++ b/src/acpica/source/include/actbl.h > @@ -139,6 +139,7 @@ > #define ACPI_SIG_DSDT "DSDT" /* Differentiated System Description Table */ > #define ACPI_SIG_FADT "FACP" /* Fixed ACPI Description Table */ > #define ACPI_SIG_FACS "FACS" /* Firmware ACPI Control Structure */ > +#define ACPI_SIG_OSDT "OSDT" /* Override System Description Table */ > #define ACPI_SIG_PSDT "PSDT" /* Persistent System Description Table */ > #define ACPI_SIG_RSDP "RSD PTR " /* Root System Description Pointer */ > #define ACPI_SIG_RSDT "RSDT" /* Root System Description Table */ > diff --git a/src/acpica/source/include/actbl1.h b/src/acpica/source/include/actbl1.h > index 1c508a0..f7eaa4c 100644 > --- a/src/acpica/source/include/actbl1.h > +++ b/src/acpica/source/include/actbl1.h > @@ -1046,10 +1046,22 @@ typedef struct acpi_madt_generic_distributor > UINT64 BaseAddress; > UINT32 GlobalIrqBase; > UINT8 Version; > - UINT8 Reserved2[3]; /* Reserved - must be zero */ > + UINT8 Reserved2[3]; /* Reserved - must be zero */ > > } ACPI_MADT_GENERIC_DISTRIBUTOR; > > +/* Values for Version field above */ > + > +enum AcpiMadtGicVersion > +{ > + ACPI_MADT_GIC_VERSION_NONE = 0, > + ACPI_MADT_GIC_VERSION_V1 = 1, > + ACPI_MADT_GIC_VERSION_V2 = 2, > + ACPI_MADT_GIC_VERSION_V3 = 3, > + ACPI_MADT_GIC_VERSION_V4 = 4, > + ACPI_MADT_GIC_VERSION_RESERVED = 5 /* 5 and greater are reserved */ > +}; > + > > /* 13: Generic MSI Frame (ACPI 5.1) */ > > diff --git a/src/acpica/source/include/actbl2.h b/src/acpica/source/include/actbl2.h > index acc0b5f..c838959 100644 > --- a/src/acpica/source/include/actbl2.h > +++ b/src/acpica/source/include/actbl2.h > @@ -124,8 +124,8 @@ > * These tables are not consumed directly by the ACPICA subsystem, but are > * included here to support device drivers and the AML disassembler. > * > - * The tables in this file are defined by third-party specifications, and are > - * not defined directly by the ACPI specification itself. > + * Generally, the tables in this file are defined by third-party specifications, > + * and are not defined directly by the ACPI specification itself. > * > ******************************************************************************/ > > @@ -154,6 +154,7 @@ > #define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */ > #define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */ > #define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */ > +#define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface table */ > #define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */ > #define ACPI_SIG_VRTC "VRTC" /* Virtual Real Time Clock Table */ > #define ACPI_SIG_WAET "WAET" /* Windows ACPI Emulated devices Table */ > @@ -1440,21 +1441,91 @@ enum AcpiSpmiInterfaceTypes > /******************************************************************************* > * > * TCPA - Trusted Computing Platform Alliance table > - * Version 1 > + * Version 2 > + * > + * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0", > + * December 19, 2014 > * > - * Conforms to "TCG PC Specific Implementation Specification", > - * Version 1.1, August 18, 2003 > + * NOTE: There are two versions of the table with the same signature -- > + * the client version and the server version. > * > ******************************************************************************/ > > -typedef struct acpi_table_tcpa > +typedef struct acpi_table_tcpa_client > +{ > + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ > + UINT16 PlatformClass; > + UINT32 MinimumLogLength; /* Minimum length for the event log area */ > + UINT64 LogAddress; /* Address of the event log area */ > + > +} ACPI_TABLE_TCPA_CLIENT; > + > +typedef struct acpi_table_tcpa_server > { > ACPI_TABLE_HEADER Header; /* Common ACPI table header */ > + UINT16 PlatformClass; > UINT16 Reserved; > - UINT32 MaxLogLength; /* Maximum length for the event log area */ > + UINT64 MinimumLogLength; /* Minimum length for the event log area */ > UINT64 LogAddress; /* Address of the event log area */ > + UINT16 SpecRevision; > + UINT8 DeviceFlags; > + UINT8 InterruptFlags; > + UINT8 GpeNumber; > + UINT8 Reserved2[3]; > + UINT32 GlobalInterrupt; > + ACPI_GENERIC_ADDRESS Address; > + UINT32 Reserved3; > + ACPI_GENERIC_ADDRESS ConfigAddress; > + UINT8 Group; > + UINT8 Bus; /* PCI Bus/Segment/Function numbers */ > + UINT8 Device; > + UINT8 Function; > + > +} ACPI_TABLE_TCPA_SERVER; > + > +/* Values for DeviceFlags above */ > + > +#define ACPI_TCPA_PCI_DEVICE (1) > +#define ACPI_TCPA_BUS_PNP (1<<1) > +#define ACPI_TCPA_ADDRESS_VALID (1<<2) > + > +/* Values for InterruptFlags above */ > + > +#define ACPI_TCPA_INTERRUPT_MODE (1) > +#define ACPI_TCPA_INTERRUPT_POLARITY (1<<1) > +#define ACPI_TCPA_SCI_VIA_GPE (1<<2) > +#define ACPI_TCPA_GLOBAL_INTERRUPT (1<<3) > + > + > +/******************************************************************************* > + * > + * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table > + * Version 4 > + * > + * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0", > + * December 19, 2014 > + * > + ******************************************************************************/ > + > +typedef struct acpi_table_tpm2 > +{ > + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ > + UINT16 PlatformClass; > + UINT16 Reserved; > + UINT64 ControlAddress; > + UINT32 StartMethod; > + > + /* Platform-specific data follows */ > + > +} ACPI_TABLE_TPM2; > + > +/* Values for StartMethod above */ > > -} ACPI_TABLE_TCPA; > +#define ACPI_TPM2_NOT_ALLOWED 0 > +#define ACPI_TPM2_START_METHOD 2 > +#define ACPI_TPM2_MEMORY_MAPPED 6 > +#define ACPI_TPM2_COMMAND_BUFFER 7 > +#define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD 8 > > > /******************************************************************************* > diff --git a/src/acpica/source/include/actbl3.h b/src/acpica/source/include/actbl3.h > index 88ac753..bfc18d7 100644 > --- a/src/acpica/source/include/actbl3.h > +++ b/src/acpica/source/include/actbl3.h > @@ -124,7 +124,8 @@ > * These tables are not consumed directly by the ACPICA subsystem, but are > * included here to support device drivers and the AML disassembler. > * > - * The tables in this file are fully defined within the ACPI specification. > + * In general, the tables in this file are fully defined within the ACPI > + * specification. > * > ******************************************************************************/ > > @@ -143,7 +144,6 @@ > #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */ > #define ACPI_SIG_RASF "RASF" /* RAS Feature table */ > #define ACPI_SIG_STAO "STAO" /* Status Override table */ > -#define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface table */ > #define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */ > #define ACPI_SIG_XENV "XENV" /* Xen Environment table */ > > @@ -920,41 +920,6 @@ typedef struct acpi_table_stao > > /******************************************************************************* > * > - * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table > - * Version 3 > - * > - * Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November 2011 > - * > - ******************************************************************************/ > - > -typedef struct acpi_table_tpm2 > -{ > - ACPI_TABLE_HEADER Header; /* Common ACPI table header */ > - UINT32 Flags; > - UINT64 ControlAddress; > - UINT32 StartMethod; > - > -} ACPI_TABLE_TPM2; > - > -/* Control area structure (not part of table, pointed to by ControlAddress) */ > - > -typedef struct acpi_tpm2_control > -{ > - UINT32 Reserved; > - UINT32 Error; > - UINT32 Cancel; > - UINT32 Start; > - UINT64 InterruptControl; > - UINT32 CommandSize; > - UINT64 CommandAddress; > - UINT32 ResponseSize; > - UINT64 ResponseAddress; > - > -} ACPI_TPM2_CONTROL; > - > - > -/******************************************************************************* > - * > * WPBT - Windows Platform Environment Table (ACPI 6.0) > * Version 1 > * > diff --git a/src/acpica/source/include/actypes.h b/src/acpica/source/include/actypes.h > index 98fcf48..0b7b37e 100644 > --- a/src/acpica/source/include/actypes.h > +++ b/src/acpica/source/include/actypes.h > @@ -627,14 +627,14 @@ typedef UINT64 ACPI_INTEGER; > #define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (UINT32, (a)) == *ACPI_CAST_PTR (UINT32, (b))) > #define ACPI_MOVE_NAME(dest,src) (*ACPI_CAST_PTR (UINT32, (dest)) = *ACPI_CAST_PTR (UINT32, (src))) > #else > -#define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) > -#define ACPI_MOVE_NAME(dest,src) (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE)) > +#define ACPI_COMPARE_NAME(a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) > +#define ACPI_MOVE_NAME(dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE)) > #endif > > /* Support for the special RSDP signature (8 characters) */ > > -#define ACPI_VALIDATE_RSDP_SIG(a) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8)) > -#define ACPI_MAKE_RSDP_SIG(dest) (ACPI_MEMCPY (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8)) > +#define ACPI_VALIDATE_RSDP_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8)) > +#define ACPI_MAKE_RSDP_SIG(dest) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8)) > > > /******************************************************************************* > @@ -839,10 +839,6 @@ typedef UINT32 ACPI_EVENT_STATUS; > #define ACPI_GPE_ENABLE 0 > #define ACPI_GPE_DISABLE 1 > #define ACPI_GPE_CONDITIONAL_ENABLE 2 > -#define ACPI_GPE_SAVE_MASK 4 > - > -#define ACPI_GPE_ENABLE_SAVE (ACPI_GPE_ENABLE | ACPI_GPE_SAVE_MASK) > -#define ACPI_GPE_DISABLE_SAVE (ACPI_GPE_DISABLE | ACPI_GPE_SAVE_MASK) > > /* > * GPE info flags - Per GPE > @@ -1299,6 +1295,10 @@ UINT32 (*ACPI_INTERFACE_HANDLER) ( > > #define ACPI_UUID_LENGTH 16 > > +/* Length of 3-byte PCI class code values when converted back to a string */ > + > +#define ACPI_PCICLS_STRING_SIZE 7 /* Includes null terminator */ > + > > /* Structures used for device/processor HID, UID, CID, and SUB */ > > @@ -1327,7 +1327,7 @@ typedef struct acpi_device_info > UINT32 Name; /* ACPI object Name */ > ACPI_OBJECT_TYPE Type; /* ACPI object Type */ > UINT8 ParamCount; /* If a method, required parameter count */ > - UINT8 Valid; /* Indicates which optional fields are valid */ > + UINT16 Valid; /* Indicates which optional fields are valid */ > UINT8 Flags; /* Miscellaneous info */ > UINT8 HighestDstates[4]; /* _SxD values: 0xFF indicates not valid */ > UINT8 LowestDstates[5]; /* _SxW values: 0xFF indicates not valid */ > @@ -1336,6 +1336,7 @@ typedef struct acpi_device_info > ACPI_PNP_DEVICE_ID HardwareId; /* _HID value */ > ACPI_PNP_DEVICE_ID UniqueId; /* _UID value */ > ACPI_PNP_DEVICE_ID SubsystemId; /* _SUB value */ > + ACPI_PNP_DEVICE_ID ClassCode; /* _CLS value */ > ACPI_PNP_DEVICE_ID_LIST CompatibleIdList; /* _CID list <must be last> */ > > } ACPI_DEVICE_INFO; > @@ -1346,14 +1347,15 @@ typedef struct acpi_device_info > > /* Flags for Valid field above (AcpiGetObjectInfo) */ > > -#define ACPI_VALID_STA 0x01 > -#define ACPI_VALID_ADR 0x02 > -#define ACPI_VALID_HID 0x04 > -#define ACPI_VALID_UID 0x08 > -#define ACPI_VALID_SUB 0x10 > -#define ACPI_VALID_CID 0x20 > -#define ACPI_VALID_SXDS 0x40 > -#define ACPI_VALID_SXWS 0x80 > +#define ACPI_VALID_STA 0x0001 > +#define ACPI_VALID_ADR 0x0002 > +#define ACPI_VALID_HID 0x0004 > +#define ACPI_VALID_UID 0x0008 > +#define ACPI_VALID_SUB 0x0010 > +#define ACPI_VALID_CID 0x0020 > +#define ACPI_VALID_CLS 0x0040 > +#define ACPI_VALID_SXDS 0x0100 > +#define ACPI_VALID_SXWS 0x0200 > > /* Flags for _STA return value (CurrentStatus above) */ > > diff --git a/src/acpica/source/include/acutils.h b/src/acpica/source/include/acutils.h > index 93edeee..99839df 100644 > --- a/src/acpica/source/include/acutils.h > +++ b/src/acpica/source/include/acutils.h > @@ -323,85 +323,113 @@ AcpiUtSubsystemShutdown ( > */ > #ifndef ACPI_USE_SYSTEM_CLIBRARY > > +#ifdef memcmp > +#error memcmp defined! > +#endif > + > +#undef strstr > +#undef strchr > +#undef strlen > +#undef strcpy > +#undef strncpy > +#undef strncmp > +#undef strcmp > +#undef strcat > +#undef strncat > +#undef strtoul > +#undef memcmp > +#undef memcpy > +#undef memset > +#undef toupper > +#undef tolower > +#undef isxdigit > +#undef isdigit > +#undef isspace > +#undef isupper > +#undef isprint > +#undef isalpha > + > ACPI_SIZE > -AcpiUtStrlen ( > +strlen ( > const char *String); > > char * > -AcpiUtStrchr ( > +strchr ( > const char *String, > int ch); > > char * > -AcpiUtStrcpy ( > +strcpy ( > char *DstString, > const char *SrcString); > > char * > -AcpiUtStrncpy ( > +strncpy ( > char *DstString, > const char *SrcString, > ACPI_SIZE Count); > > int > -AcpiUtMemcmp ( > - const char *Buffer1, > - const char *Buffer2, > - ACPI_SIZE Count); > - > -int > -AcpiUtStrncmp ( > +strncmp ( > const char *String1, > const char *String2, > ACPI_SIZE Count); > > int > -AcpiUtStrcmp ( > +strcmp ( > const char *String1, > const char *String2); > > char * > -AcpiUtStrcat ( > +strcat ( > char *DstString, > const char *SrcString); > > char * > -AcpiUtStrncat ( > +strncat ( > char *DstString, > const char *SrcString, > ACPI_SIZE Count); > > UINT32 > -AcpiUtStrtoul ( > +strtoul ( > const char *String, > char **Terminator, > UINT32 Base); > > char * > -AcpiUtStrstr ( > +strstr ( > char *String1, > char *String2); > > +int > +memcmp ( > + void *Buffer1, > + void *Buffer2, > + ACPI_SIZE Count); > + > void * > -AcpiUtMemcpy ( > +memcpy ( > void *Dest, > const void *Src, > ACPI_SIZE Count); > > void * > -AcpiUtMemset ( > +memset ( > void *Dest, > - UINT8 Value, > + int Value, > ACPI_SIZE Count); > > int > -AcpiUtToUpper ( > +toupper ( > int c); > > int > -AcpiUtToLower ( > +tolower ( > int c); > > + > + > extern const UINT8 _acpi_ctype[]; > > #define _ACPI_XA 0x00 /* extra alphabetic - not supported */ > @@ -415,13 +443,31 @@ extern const UINT8 _acpi_ctype[]; > #define _ACPI_UP 0x01 /* 'A'-'Z' */ > #define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ > > -#define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) > -#define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) > -#define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD)) > -#define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP)) > -#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) > -#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU)) > -#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) > +#define isdigit(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) > +#define isspace(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) > +#define isxdigit(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD)) > +#define isupper(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP)) > +#define islower(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) > +#define isprint(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU)) > +#define isalpha(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) > + > +#ifndef ACPI_CLIBRARY > +#define strstr(s1,s2) strstr ((s1), (s2)) > +#define strchr(s1,c) strchr ((s1), (c)) > +#define strlen(s) (ACPI_SIZE) strlen ((s)) > +#define strcpy(d,s) (void) strcpy ((d), (s)) > +#define strncpy(d,s,n) (void) strncpy ((d), (s), (ACPI_SIZE)(n)) > +#define strncmp(d,s,n) strncmp ((d), (s), (ACPI_SIZE)(n)) > +#define strcmp(d,s) strcmp ((d), (s)) > +#define strcat(d,s) (void) strcat ((d), (s)) > +#define strncat(d,s,n) strncat ((d), (s), (ACPI_SIZE)(n)) > +#define strtoul(d,s,n) strtoul ((d), (s), (ACPI_SIZE)(n)) > +#define memcmp(s1,s2,n) memcmp((void *)(s1), (void *)(s2), (ACPI_SIZE)(n)) > +#define memcpy(d,s,n) (void) memcpy ((d), (s), (ACPI_SIZE)(n)) > +#define memset(d,v,n) (void) memset ((d), (v), (ACPI_SIZE)(n)) > +#define toupper(c) toupper ((int) (c)) > +#define tolower(c) tolower ((int) (c)) > +#endif /* ACPI_CLIBRARY */ > > #endif /* !ACPI_USE_SYSTEM_CLIBRARY */ > > @@ -674,6 +720,11 @@ AcpiUtExecute_CID ( > ACPI_NAMESPACE_NODE *DeviceNode, > ACPI_PNP_DEVICE_ID_LIST **ReturnCidList); > > +ACPI_STATUS > +AcpiUtExecute_CLS ( > + ACPI_NAMESPACE_NODE *DeviceNode, > + ACPI_PNP_DEVICE_ID **ReturnId); > + > > /* > * utlock - reader/writer locks > diff --git a/src/acpica/source/include/acuuid.h b/src/acpica/source/include/acuuid.h > new file mode 100644 > index 0000000..f43ec22 > --- /dev/null > +++ b/src/acpica/source/include/acuuid.h > @@ -0,0 +1,162 @@ > +/****************************************************************************** > + * > + * Name: acuuid.h - ACPI-related UUID/GUID definitions > + * > + *****************************************************************************/ > + > +/****************************************************************************** > + * > + * 1. Copyright Notice > + * > + * Some or all of this work - Copyright (c) 1999 - 2015, 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 __ACUUID_H__ > +#define __ACUUID_H__ > + > +/* > + * Note1: UUIDs and GUIDs are defined to be identical in ACPI. > + * > + * Note2: This file is standalone and should remain that way. > + */ > + > +/* Controllers */ > + > +#define UUID_GPIO_CONTROLLER "4f248f40-d5e2-499f-834c-27758ea1cd3f" > +#define UUID_USB_CONTROLLER "ce2ee385-00e6-48cb-9f05-2edb927c4899" > +#define UUID_SATA_CONTROLLER "e4db149b-fcfe-425b-a6d8-92357d78fc7f" > + > +/* Devices */ > + > +#define UUID_PCI_HOST_BRIDGE "33db4d5b-1ff7-401c-9657-7441c03dd766" > +#define UUID_I2C_DEVICE "3cdff6f7-4267-4555-ad05-b30a3d8938de" > +#define UUID_POWER_BUTTON "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c" > + > +/* Interfaces */ > + > +#define UUID_DEVICE_LABELING "e5c937d0-3553-4d7a-9117-ea4d19c3434d" > +#define UUID_PHYSICAL_PRESENCE "3dddfaa6-361b-4eb4-a424-8d10089d1653" > + > +/* NVDIMM - NFIT table */ > + > +#define UUID_VOLATILE_MEMORY "7305944f-fdda-44e3-b16c-3f22d252e5d0" > +#define UUID_PERSISTENT_MEMORY "66f0d379-b4f3-4074-ac43-0d3318b78cdb" > +#define UUID_CONTROL_REGION "92f701f6-13b4-405d-910b-299367e8234c" > +#define UUID_DATA_REGION "91af0530-5d86-470e-a6b0-0a2db9408249" > +#define UUID_VOLATILE_VIRTUAL_DISK "77ab535a-45fc-624b-5560-f7b281d1f96e" > +#define UUID_VOLATILE_VIRTUAL_CD "3d5abd30-4175-87ce-6d64-d2ade523c4bb" > +#define UUID_PERSISTENT_VIRTUAL_DISK "5cea02c9-4d07-69d3-269f-4496fbe096f9" > +#define UUID_PERSISTENT_VIRTUAL_CD "08018188-42cd-bb48-100f-5387d53ded3d" > + > +/* Miscellaneous */ > + > +#define UUID_PLATFORM_CAPABILITIES "0811b06e-4a27-44f9-8d60-3cbbc22e7b48" > +#define UUID_DYNAMIC_ENUMERATION "d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf" > +#define UUID_BATTERY_THERMAL_LIMIT "4c2067e3-887d-475c-9720-4af1d3ed602e" > +#define UUID_THERMAL_EXTENSIONS "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500" > +#define UUID_DEVICE_PROPERTIES "daffd814-6eba-4d8c-8a91-bc9bbf4aa301" > + > + > +#endif /* __AUUID_H__ */ > diff --git a/src/acpica/source/include/platform/acenv.h b/src/acpica/source/include/platform/acenv.h > index f596d8c..d3ebbfe 100644 > --- a/src/acpica/source/include/platform/acenv.h > +++ b/src/acpica/source/include/platform/acenv.h > @@ -421,27 +421,49 @@ > > /* We will be linking to the standard Clib functions */ > > -#define ACPI_STRSTR(s1,s2) strstr((s1), (s2)) > -#define ACPI_STRCHR(s1,c) strchr((s1), (c)) > -#define ACPI_STRLEN(s) (ACPI_SIZE) strlen((s)) > -#define ACPI_STRCPY(d,s) (void) strcpy((d), (s)) > -#define ACPI_STRNCPY(d,s,n) (void) strncpy((d), (s), (ACPI_SIZE)(n)) > -#define ACPI_STRNCMP(d,s,n) strncmp((d), (s), (ACPI_SIZE)(n)) > -#define ACPI_STRCMP(d,s) strcmp((d), (s)) > -#define ACPI_STRCAT(d,s) (void) strcat((d), (s)) > -#define ACPI_STRNCAT(d,s,n) strncat((d), (s), (ACPI_SIZE)(n)) > -#define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (ACPI_SIZE)(n)) > -#define ACPI_MEMCMP(s1,s2,n) memcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n)) > -#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (ACPI_SIZE)(n)) > -#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (ACPI_SIZE)(n)) > -#define ACPI_TOUPPER(i) toupper((int) (i)) > -#define ACPI_TOLOWER(i) tolower((int) (i)) > -#define ACPI_IS_XDIGIT(i) isxdigit((int) (i)) > -#define ACPI_IS_DIGIT(i) isdigit((int) (i)) > -#define ACPI_IS_SPACE(i) isspace((int) (i)) > -#define ACPI_IS_UPPER(i) isupper((int) (i)) > -#define ACPI_IS_PRINT(i) isprint((int) (i)) > -#define ACPI_IS_ALPHA(i) isalpha((int) (i)) > +#undef strstr > +#undef strchr > +#undef strlen > +#undef strcpy > +#undef strncpy > +#undef strncmp > +#undef strcmp > +#undef strcat > +#undef strncat > +#undef strtoul > +#undef memcmp > +#undef memcpy > +#undef memset > +#undef toupper > +#undef tolower > +#undef isxdigit > +#undef isdigit > +#undef isspace > +#undef isupper > +#undef isprint > +#undef isalpha > + > +#define strstr(s1,s2) strstr((s1), (s2)) > +#define strchr(s1,c) strchr((s1), (c)) > +#define strlen(s) (ACPI_SIZE) strlen((s)) > +#define strcpy(d,s) (void) strcpy((d), (s)) > +#define strncpy(d,s,n) (void) strncpy((d), (s), (ACPI_SIZE)(n)) > +#define strncmp(d,s,n) strncmp((d), (s), (ACPI_SIZE)(n)) > +#define strcmp(d,s) strcmp((d), (s)) > +#define strcat(d,s) (void) strcat((d), (s)) > +#define strncat(d,s,n) strncat((d), (s), (ACPI_SIZE)(n)) > +#define strtoul(d,s,n) strtoul((d), (s), (ACPI_SIZE)(n)) > +#define memcmp(s1,s2,n) memcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n)) > +#define memcpy(d,s,n) (void) memcpy((d), (s), (ACPI_SIZE)(n)) > +#define memset(d,s,n) (void) memset((d), (s), (ACPI_SIZE)(n)) > +#define toupper(i) toupper((int) (i)) > +#define tolower(i) tolower((int) (i)) > +#define isxdigit(i) isxdigit((int) (i)) > +#define isdigit(i) isdigit((int) (i)) > +#define isspace(i) isspace((int) (i)) > +#define isupper(i) isupper((int) (i)) > +#define isprint(i) isprint((int) (i)) > +#define isalpha(i) isalpha((int) (i)) > > #else > > @@ -480,22 +502,6 @@ typedef char *va_list; > > /* Use the local (ACPICA) definitions of the clib functions */ > > -#define ACPI_STRSTR(s1,s2) AcpiUtStrstr ((s1), (s2)) > -#define ACPI_STRCHR(s1,c) AcpiUtStrchr ((s1), (c)) > -#define ACPI_STRLEN(s) (ACPI_SIZE) AcpiUtStrlen ((s)) > -#define ACPI_STRCPY(d,s) (void) AcpiUtStrcpy ((d), (s)) > -#define ACPI_STRNCPY(d,s,n) (void) AcpiUtStrncpy ((d), (s), (ACPI_SIZE)(n)) > -#define ACPI_STRNCMP(d,s,n) AcpiUtStrncmp ((d), (s), (ACPI_SIZE)(n)) > -#define ACPI_STRCMP(d,s) AcpiUtStrcmp ((d), (s)) > -#define ACPI_STRCAT(d,s) (void) AcpiUtStrcat ((d), (s)) > -#define ACPI_STRNCAT(d,s,n) AcpiUtStrncat ((d), (s), (ACPI_SIZE)(n)) > -#define ACPI_STRTOUL(d,s,n) AcpiUtStrtoul ((d), (s), (ACPI_SIZE)(n)) > -#define ACPI_MEMCMP(s1,s2,n) AcpiUtMemcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n)) > -#define ACPI_MEMCPY(d,s,n) (void) AcpiUtMemcpy ((d), (s), (ACPI_SIZE)(n)) > -#define ACPI_MEMSET(d,v,n) (void) AcpiUtMemset ((d), (v), (ACPI_SIZE)(n)) > -#define ACPI_TOUPPER(c) AcpiUtToUpper ((int) (c)) > -#define ACPI_TOLOWER(c) AcpiUtToLower ((int) (c)) > - > #endif /* ACPI_USE_SYSTEM_CLIBRARY */ > > #ifndef ACPI_FILE > diff --git a/src/acpica/source/include/platform/acenvex.h b/src/acpica/source/include/platform/acenvex.h > index 26467b9..ac1cb92 100644 > --- a/src/acpica/source/include/platform/acenvex.h > +++ b/src/acpica/source/include/platform/acenvex.h > @@ -128,6 +128,12 @@ > #if defined(_LINUX) || defined(__linux__) > #include "aclinuxex.h" > > +#elif defined(_AED_EFI) > +#include "acefiex.h" > + > +#elif defined(_GNU_EFI) > +#include "acefiex.h" > + > #elif defined(__DragonFly__) > #include "acdragonflyex.h" > > diff --git a/src/acpica/source/include/platform/acgcc.h b/src/acpica/source/include/platform/acgcc.h > index fde18f4..958b4ac 100644 > --- a/src/acpica/source/include/platform/acgcc.h > +++ b/src/acpica/source/include/platform/acgcc.h > @@ -147,4 +147,8 @@ > #undef strchr > #endif > > +/* GCC supports __VA_ARGS__ in macros */ > + > +#define COMPILER_VA_MACRO 1 > + > #endif /* __ACGCC_H__ */ > diff --git a/src/acpica/source/tools/acpiexec/aehandlers.c b/src/acpica/source/tools/acpiexec/aehandlers.c > index eb1e3ab..c4eb02a 100644 > --- a/src/acpica/source/tools/acpiexec/aehandlers.c > +++ b/src/acpica/source/tools/acpiexec/aehandlers.c > @@ -450,7 +450,7 @@ AeExceptionHandler ( > > Arg[1].Type = ACPI_TYPE_STRING; > Arg[1].String.Pointer = ACPI_CAST_PTR (char, Exception); > - Arg[1].String.Length = ACPI_STRLEN (Exception); > + Arg[1].String.Length = strlen (Exception); > > Arg[2].Type = ACPI_TYPE_INTEGER; > Arg[2].Integer.Value = AcpiOsGetThreadId(); > diff --git a/src/acpica/source/tools/acpiexec/aeinitfile.c b/src/acpica/source/tools/acpiexec/aeinitfile.c > index 0de7b96..deb1795 100644 > --- a/src/acpica/source/tools/acpiexec/aeinitfile.c > +++ b/src/acpica/source/tools/acpiexec/aeinitfile.c > @@ -130,8 +130,9 @@ AeDoOneOverride ( > ACPI_WALK_STATE *WalkState); > > > -#define AE_FILE_BUFFER_SIZE 512 > +#define AE_FILE_BUFFER_SIZE 512 > > +static char LineBuffer[AE_FILE_BUFFER_SIZE]; > static char NameBuffer[AE_FILE_BUFFER_SIZE]; > static char ValueBuffer[AE_FILE_BUFFER_SIZE]; > static FILE *InitFile; > @@ -199,15 +200,18 @@ AeDoObjectOverrides ( > > ObjDesc = AcpiUtCreateIntegerObject (0); > WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL); > - > NameBuffer[0] = '\\'; > > - /* Read the entire file line-by-line */ > + /* Read the entire file line-by-line */ > > - while (fscanf (InitFile, "%s %s\n", > - ACPI_CAST_PTR (char, &NameBuffer[1]), > - ACPI_CAST_PTR (char, &ValueBuffer)) == 2) > + while (fgets (LineBuffer, AE_FILE_BUFFER_SIZE, InitFile) != NULL) > { > + if (sscanf (LineBuffer, "%s %s\n", > + &NameBuffer[1], ValueBuffer) != 2) > + { > + goto CleanupAndExit; > + } > + > /* Add a root prefix if not present in the string */ > > i = 0; > @@ -221,6 +225,7 @@ AeDoObjectOverrides ( > > /* Cleanup */ > > +CleanupAndExit: > fclose (InitFile); > AcpiDsDeleteWalkState (WalkState); > AcpiUtRemoveReference (ObjDesc); > @@ -272,7 +277,8 @@ AeDoOneOverride ( > Status = AcpiUtStrtoul64 (ValueString, 0, &Value); > if (ACPI_FAILURE (Status)) > { > - AcpiOsPrintf ("%s\n", AcpiFormatException (Status)); > + AcpiOsPrintf ("%s %s\n", ValueString, > + AcpiFormatException (Status)); > return; > } > > diff --git a/src/acpica/source/tools/acpiexec/aeregion.c b/src/acpica/source/tools/acpiexec/aeregion.c > index a7823bf..55b8e7f 100644 > --- a/src/acpica/source/tools/acpiexec/aeregion.c > +++ b/src/acpica/source/tools/acpiexec/aeregion.c > @@ -804,7 +804,7 @@ AeRegionHandler ( > > /* Initialize the region with the default fill value */ > > - ACPI_MEMSET (RegionElement->Buffer, > + memset (RegionElement->Buffer, > AcpiGbl_RegionFillValue, RegionElement->Length); > > /* > @@ -819,7 +819,7 @@ AeRegionHandler ( > * Copy the old buffer to its same location within the new > * buffer > */ > - ACPI_MEMCPY (BufferValue, OldBuffer, RegionLength); > + memcpy (BufferValue, OldBuffer, RegionLength); > AcpiOsFree (OldBuffer); > } > } > @@ -848,7 +848,7 @@ AeRegionHandler ( > > /* Initialize the region with the default fill value */ > > - ACPI_MEMSET (RegionElement->Buffer, AcpiGbl_RegionFillValue, Length); > + memset (RegionElement->Buffer, AcpiGbl_RegionFillValue, Length); > > RegionElement->Address = BaseAddress; > RegionElement->Length = Length; > @@ -915,14 +915,14 @@ DoFunction: > /* > * Set the pointer Value to whatever is in the buffer > */ > - ACPI_MEMCPY (Value, BufferValue, ByteWidth); > + memcpy (Value, BufferValue, ByteWidth); > break; > > case ACPI_WRITE: > /* > * Write the contents of Value to the buffer > */ > - ACPI_MEMCPY (BufferValue, Value, ByteWidth); > + memcpy (BufferValue, Value, ByteWidth); > break; > > default: >
diff --git a/src/acpica/fwts_acpica.c b/src/acpica/fwts_acpica.c index 9bfd0ae..2954e39 100644 --- a/src/acpica/fwts_acpica.c +++ b/src/acpica/fwts_acpica.c @@ -1168,8 +1168,23 @@ static ACPI_STATUS fwts_acpi_walk_for_object_names( buffer.Pointer = tmpbuf; buffer.Length = sizeof(tmpbuf); - if (!ACPI_FAILURE(AcpiNsHandleToPathname(objHandle, &buffer))) - fwts_list_append(list, strdup((char *)buffer.Pointer)); + if (!ACPI_FAILURE(AcpiNsHandleToPathname(objHandle, &buffer))) { + /* + * Originally we used strdup here however, the + * built-in strdup was expanding a macro that + * produced __retval = (char *) (void)memcpy((__retval) + * which causes build issues casting from a (void)memcpy + * so we manually do a strdup() here instead. + */ + char *ptr = (char *)buffer.Pointer; + size_t len = strlen(ptr) + 1; + char *str = malloc(len); + + if (str) { + strncpy(str, ptr, len); + fwts_list_append(list, str); + } + } return AE_OK; } diff --git a/src/acpica/source/common/adisasm.c b/src/acpica/source/common/adisasm.c index 8ee9ccc..d4f0fe6 100644 --- a/src/acpica/source/common/adisasm.c +++ b/src/acpica/source/common/adisasm.c @@ -315,7 +315,7 @@ AdAmlDisassemble ( while (ExternalFileList) { ExternalFilename = ExternalFileList->Path; - if (!ACPI_STRCMP (ExternalFilename, Filename)) + if (!strcmp (ExternalFilename, Filename)) { /* Next external file */ diff --git a/src/acpica/source/common/ahids.c b/src/acpica/source/common/ahids.c index 1ff3c7c..fed0981 100644 --- a/src/acpica/source/common/ahids.c +++ b/src/acpica/source/common/ahids.c @@ -302,7 +302,7 @@ AcpiAhMatchHardwareId ( for (Info = AslDeviceIds; Info->Name; Info++) { - if (!ACPI_STRCMP (HardwareId, Info->Name)) + if (!strcmp (HardwareId, Info->Name)) { return (Info); } diff --git a/src/acpica/source/common/ahpredef.c b/src/acpica/source/common/ahpredef.c index 27c28f1..5104def 100644 --- a/src/acpica/source/common/ahpredef.c +++ b/src/acpica/source/common/ahpredef.c @@ -321,7 +321,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_RBW", "Register Bit Width", "Resource Descriptor field"), AH_PREDEF ("_RDI", "Resource Dependencies for Idle", "Returns a list of dependencies for idle states"), AH_PREDEF ("_REG", "Region Availability", "Inform AML code of an operation region availability change"), - AH_PREDEF ("_REV", "Supported ACPI Revision", "Returns the revision of the ACPI specification that is implemented"), + AH_PREDEF ("_REV", "Supported Integer Width", "Returns the supported integer width (<= 1: 32 bits only, >=2: both 32 and 64 bits"), AH_PREDEF ("_RMV", "Removal Status", "Returns a device's removal ability status (docking)"), AH_PREDEF ("_RNG", "Range", "Memory range type, Resource Descriptor field"), AH_PREDEF ("_RST", "Device Reset", "Executes a reset on a device"), diff --git a/src/acpica/source/common/ahuuids.c b/src/acpica/source/common/ahuuids.c index 4e5d087..118473d 100644 --- a/src/acpica/source/common/ahuuids.c +++ b/src/acpica/source/common/ahuuids.c @@ -115,6 +115,7 @@ #include "acpi.h" #include "accommon.h" +#include "acuuid.h" #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("ahuuids") @@ -124,44 +125,36 @@ */ const AH_UUID AcpiUuids[] = { - {"PCI Host Bridge Device", - "33db4d5b-1ff7-401c-9657-7441c03dd766"}, - - {"Platform-wide Capabilities", - "0811b06e-4a27-44f9-8d60-3cbbc22e7b48"}, - - {"Dynamic Enumeration", - "d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf"}, - - {"GPIO Controller", - "4f248f40-d5e2-499f-834c-27758ea1cd3f"}, - - {"Battery Thermal Limit", - "4c2067e3-887d-475c-9720-4af1d3ed602e"}, - - {"Thermal Extensions", - "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500"}, - - {"USB Controller", - "ce2ee385-00e6-48cb-9f05-2edb927c4899"}, - - {"HID I2C Device", - "3cdff6f7-4267-4555-ad05-b30a3d8938de"}, - - {"Power Button Device", - "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c"}, - - {"Device Labeling Interface", - "e5c937d0-3553-4d7a-9117-ea4d19c3434d"}, - - {"SATA Controller", - "e4db149b-fcfe-425b-a6d8-92357d78fc7f"}, - - {"Physical Presence Interface", - "3dddfaa6-361b-4eb4-a424-8d10089d1653"}, - - {"Device Properties for _DSD", - "daffd814-6eba-4d8c-8a91-bc9bbf4aa301"}, + {"[Controllers]", NULL}, + {"GPIO Controller", UUID_GPIO_CONTROLLER}, + {"USB Controller", UUID_USB_CONTROLLER}, + {"SATA Controller", UUID_SATA_CONTROLLER}, + + {"[Devices]", NULL}, + {"PCI Host Bridge Device", UUID_PCI_HOST_BRIDGE}, + {"HID I2C Device", UUID_I2C_DEVICE}, + {"Power Button Device", UUID_POWER_BUTTON}, + + {"[Interfaces]", NULL}, + {"Device Labeling Interface", UUID_DEVICE_LABELING}, + {"Physical Presence Interface", UUID_PHYSICAL_PRESENCE}, + + {"[Non-volatile DIMM and NFIT table]", NULL}, + {"Volatile Memory Region", UUID_VOLATILE_MEMORY}, + {"Persistent Memory Region", UUID_PERSISTENT_MEMORY}, + {"NVDIMM Control Region", UUID_CONTROL_REGION}, + {"NVDIMM Data Region", UUID_DATA_REGION}, + {"Volatile Virtual Disk", UUID_VOLATILE_VIRTUAL_DISK}, + {"Volatile Virtual CD", UUID_VOLATILE_VIRTUAL_CD}, + {"Persistent Virtual Disk", UUID_PERSISTENT_VIRTUAL_DISK}, + {"Persistent Virtual CD", UUID_PERSISTENT_VIRTUAL_CD}, + + {"[Miscellaneous]", NULL}, + {"Platform-wide Capabilities", UUID_PLATFORM_CAPABILITIES}, + {"Dynamic Enumeration", UUID_DYNAMIC_ENUMERATION}, + {"Battery Thermal Limit", UUID_BATTERY_THERMAL_LIMIT}, + {"Thermal Extensions", UUID_THERMAL_EXTENSIONS}, + {"Device Properties for _DSD", UUID_DEVICE_PROPERTIES}, {NULL, NULL} }; @@ -192,9 +185,16 @@ AcpiAhMatchUuid ( for (Info = AcpiUuids; Info->Description; Info++) { + /* Null string means desciption is a UUID class */ + + if (!Info->String) + { + continue; + } + AcpiUtConvertStringToUuid (Info->String, UuidBuffer); - if (!ACPI_MEMCMP (Data, UuidBuffer, UUID_BUFFER_LENGTH)) + if (!memcmp (Data, UuidBuffer, UUID_BUFFER_LENGTH)) { return (Info->Description); } diff --git a/src/acpica/source/common/dmextern.c b/src/acpica/source/common/dmextern.c index dc3c8b4..832379e 100644 --- a/src/acpica/source/common/dmextern.c +++ b/src/acpica/source/common/dmextern.c @@ -296,7 +296,7 @@ AcpiDmNormalizeParentPrefix ( return (NULL); } - Length = (ACPI_STRLEN (ParentPath) + ACPI_STRLEN (Path) + 1); + Length = (strlen (ParentPath) + strlen (Path) + 1); if (ParentPath[1]) { /* @@ -325,7 +325,7 @@ AcpiDmNormalizeParentPrefix ( * * Copy the parent path */ - ACPI_STRCPY (Fullpath, &ParentPath[Index]); + strcpy (Fullpath, &ParentPath[Index]); /* * Add dot separator @@ -333,12 +333,12 @@ AcpiDmNormalizeParentPrefix ( */ if (ParentPath[1]) { - ACPI_STRCAT (Fullpath, "."); + strcat (Fullpath, "."); } /* Copy child path (carat parent prefix(es) were skipped above) */ - ACPI_STRCAT (Fullpath, Path); + strcat (Fullpath, Path); Cleanup: ACPI_FREE (ParentPath); @@ -720,13 +720,13 @@ AcpiDmAddNodeToExternalList ( if ((*ExternalPath == AML_ROOT_PREFIX) && (ExternalPath[1])) { - Temp = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (ExternalPath) + 1); + Temp = ACPI_ALLOCATE_ZEROED (strlen (ExternalPath) + 1); if (!Temp) { return_VOID; } - ACPI_STRCPY (Temp, &ExternalPath[1]); + strcpy (Temp, &ExternalPath[1]); ACPI_FREE (ExternalPath); ExternalPath = Temp; } @@ -878,7 +878,7 @@ AcpiDmCreateNewExternal ( NextExternal = AcpiGbl_ExternalList; while (NextExternal) { - if (!ACPI_STRCMP (ExternalPath, NextExternal->Path)) + if (!strcmp (ExternalPath, NextExternal->Path)) { /* Duplicate method, check that the Value (ArgCount) is the same */ @@ -921,7 +921,7 @@ AcpiDmCreateNewExternal ( NewExternal->Value = Value; NewExternal->Path = ExternalPath; NewExternal->Type = Type; - NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath); + NewExternal->Length = (UINT16) strlen (ExternalPath); NewExternal->InternalPath = InternalPath; /* Link the new descriptor into the global list, alphabetically ordered */ diff --git a/src/acpica/source/common/dmrestag.c b/src/acpica/source/common/dmrestag.c index 15c2d84..d91ede9 100644 --- a/src/acpica/source/common/dmrestag.c +++ b/src/acpica/source/common/dmrestag.c @@ -751,10 +751,10 @@ AcpiGetTagPathname ( * end up in the final compiled AML, it's just an appearance issue for the * disassembled code. */ - Pathname[ACPI_STRLEN (Pathname) - ACPI_NAME_SIZE] = 0; - ACPI_STRNCAT (Pathname, ResourceNode->Name.Ascii, ACPI_NAME_SIZE); - ACPI_STRCAT (Pathname, "."); - ACPI_STRNCAT (Pathname, Tag, ACPI_NAME_SIZE); + Pathname[strlen (Pathname) - ACPI_NAME_SIZE] = 0; + strncat (Pathname, ResourceNode->Name.Ascii, ACPI_NAME_SIZE); + strcat (Pathname, "."); + strncat (Pathname, Tag, ACPI_NAME_SIZE); /* Internalize the namepath to AML format */ diff --git a/src/acpica/source/common/dmtable.c b/src/acpica/source/common/dmtable.c index 6397abe..e05e687 100644 --- a/src/acpica/source/common/dmtable.c +++ b/src/acpica/source/common/dmtable.c @@ -600,7 +600,7 @@ AcpiDmDumpDataTable ( TableData = AcpiDmGetTableData (Table->Signature); if (!TableData) { - if (!ACPI_STRNCMP (Table->Signature, "OEM", 3)) + if (!strncmp (Table->Signature, "OEM", 3)) { AcpiOsPrintf ("\n**** OEM-defined ACPI table [%4.4s], unknown contents\n\n", Table->Signature); @@ -928,7 +928,7 @@ AcpiDmDumpTable ( case ACPI_DMT_STRING: - ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1; + ByteLength = strlen (ACPI_CAST_PTR (char, Target)) + 1; break; case ACPI_DMT_GAS: diff --git a/src/acpica/source/common/dmtbdump.c b/src/acpica/source/common/dmtbdump.c index 9196dbb..3b68637 100644 --- a/src/acpica/source/common/dmtbdump.c +++ b/src/acpica/source/common/dmtbdump.c @@ -227,7 +227,7 @@ AcpiDmDumpUnicode ( for (i = 0; i < Length; i += 2) { - if (!ACPI_IS_PRINT (Buffer[i])) + if (!isprint (Buffer[i])) { goto DumpRawBuffer; } @@ -1773,7 +1773,7 @@ AcpiDmDumpIort ( InfoTable = AcpiDmTableInfoIort1; Length = ACPI_OFFSET (ACPI_IORT_NAMED_COMPONENT, DeviceName); String = ACPI_ADD_PTR (char, IortNode, NodeOffset + Length); - Length += ACPI_STRLEN (String) + 1; + Length += strlen (String) + 1; break; case ACPI_IORT_NODE_PCI_ROOT_COMPLEX: @@ -3416,7 +3416,7 @@ AcpiDmDumpStao ( while (Offset < Table->Length) { Namepath = ACPI_ADD_PTR (char, Table, Offset); - StringLength = ACPI_STRLEN (Namepath) + 1; + StringLength = strlen (Namepath) + 1; AcpiDmLineHeader (Offset, StringLength, "Namestring"); AcpiOsPrintf ("\"%s\"\n", Namepath); diff --git a/src/acpica/source/common/dmtbinfo.c b/src/acpica/source/common/dmtbinfo.c index 41e4d6a..aab5d72 100644 --- a/src/acpica/source/common/dmtbinfo.c +++ b/src/acpica/source/common/dmtbinfo.c @@ -185,7 +185,7 @@ #define ACPI_SPMI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPMI,f) #define ACPI_SRAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SRAT,f) #define ACPI_STAO_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_STAO,f) -#define ACPI_TCPA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA,f) +#define ACPI_TCPA_CLIENT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_CLIENT,f) #define ACPI_TPM2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM2,f) #define ACPI_UEFI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_UEFI,f) #define ACPI_WAET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WAET,f) @@ -2683,15 +2683,15 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoStaoStr[] = /******************************************************************************* * - * TCPA - Trusted Computing Platform Alliance table + * TCPA - Trusted Computing Platform Alliance table (Client) * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[] = { - {ACPI_DMT_UINT16, ACPI_TCPA_OFFSET (Reserved), "Reserved", 0}, - {ACPI_DMT_UINT32, ACPI_TCPA_OFFSET (MaxLogLength), "Max Event Log Length", 0}, - {ACPI_DMT_UINT64, ACPI_TCPA_OFFSET (LogAddress), "Event Log Address", 0}, + {ACPI_DMT_UINT16, ACPI_TCPA_CLIENT_OFFSET (PlatformClass), "Platform Class", 0}, + {ACPI_DMT_UINT32, ACPI_TCPA_CLIENT_OFFSET (MinimumLogLength), "Min Event Log Length", 0}, + {ACPI_DMT_UINT64, ACPI_TCPA_CLIENT_OFFSET (LogAddress), "Event Log Address", 0}, ACPI_DMT_TERMINATOR }; @@ -2704,7 +2704,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[] = ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[] = { - {ACPI_DMT_UINT32, ACPI_TPM2_OFFSET (Flags), "Flags", 0}, + {ACPI_DMT_UINT16, ACPI_TPM2_OFFSET (PlatformClass), "Platform Class", 0}, + {ACPI_DMT_UINT16, ACPI_TPM2_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_TPM2_OFFSET (ControlAddress), "Control Address", 0}, {ACPI_DMT_UINT32, ACPI_TPM2_OFFSET (StartMethod), "Start Method", 0}, ACPI_DMT_TERMINATOR diff --git a/src/acpica/source/compiler/aslanalyze.c b/src/acpica/source/compiler/aslanalyze.c index 1fae183..dde91ba 100644 --- a/src/acpica/source/compiler/aslanalyze.c +++ b/src/acpica/source/compiler/aslanalyze.c @@ -139,8 +139,8 @@ AnIsInternalMethod ( ACPI_PARSE_OBJECT *Op) { - if ((!ACPI_STRCMP (Op->Asl.ExternalName, "\\_OSI")) || - (!ACPI_STRCMP (Op->Asl.ExternalName, "_OSI"))) + if ((!strcmp (Op->Asl.ExternalName, "\\_OSI")) || + (!strcmp (Op->Asl.ExternalName, "_OSI"))) { return (TRUE); } @@ -166,8 +166,8 @@ AnGetInternalMethodReturnType ( ACPI_PARSE_OBJECT *Op) { - if ((!ACPI_STRCMP (Op->Asl.ExternalName, "\\_OSI")) || - (!ACPI_STRCMP (Op->Asl.ExternalName, "_OSI"))) + if ((!strcmp (Op->Asl.ExternalName, "\\_OSI")) || + (!strcmp (Op->Asl.ExternalName, "_OSI"))) { return (ACPI_BTYPE_STRING); } @@ -534,7 +534,7 @@ ApCheckForGpeNameConflict ( /* Verify 3rd/4th chars are a valid hex value */ - GpeNumber = ACPI_STRTOUL (&Name[2], NULL, 16); + GpeNumber = strtoul (&Name[2], NULL, 16); if (GpeNumber == ACPI_UINT32_MAX) { return; diff --git a/src/acpica/source/compiler/aslascii.c b/src/acpica/source/compiler/aslascii.c index b858a38..07f7af8 100644 --- a/src/acpica/source/compiler/aslascii.c +++ b/src/acpica/source/compiler/aslascii.c @@ -298,7 +298,7 @@ FlCheckForAscii ( /* Ensure character is either printable or a "space" char */ - else if (!ACPI_IS_PRINT (Byte) && !ACPI_IS_SPACE (Byte)) + else if (!isprint (Byte) && !isspace (Byte)) { if ((BadBytes < 10) && (DisplayErrors)) { diff --git a/src/acpica/source/compiler/aslcodegen.c b/src/acpica/source/compiler/aslcodegen.c index 2f10d31..1508231 100644 --- a/src/acpica/source/compiler/aslcodegen.c +++ b/src/acpica/source/compiler/aslcodegen.c @@ -182,7 +182,7 @@ CgGenerateAmlOutput ( DbgPrint (ASL_TREE_OUTPUT, "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr" - " Parent Child Next Flags AcTyp Final Col L\n", + " Parent Child Next Flags AcTyp Final Col L# EL# LL# ELL#\n", 76, " "); CgCloseTable (); @@ -217,7 +217,7 @@ CgAmlWriteWalk ( "Final parse tree used for AML output:\n"); DbgPrint (ASL_TREE_OUTPUT, "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr" - " Parent Child Next Flags AcTyp Final Col L\n", + " Parent Child Next Flags AcTyp Final Col L# EL# LL# ELL#\n", 76, " "); } @@ -241,7 +241,7 @@ CgAmlWriteWalk ( DbgPrint (ASL_TREE_OUTPUT, "%08X %04X %04X %01X %04X %04X %04X %04X " - "%08X %08X %08X %08X %08X %08X %04X %02d %02d\n", + "%08X %08X %08X %08X %08X %08X %04X %02d %02d %02d %02d %02d\n", /* 1 */ (UINT32) Op->Asl.Value.Integer, /* 2 */ Op->Asl.ParseOpcode, /* 3 */ Op->Asl.AmlOpcode, @@ -258,7 +258,10 @@ CgAmlWriteWalk ( /* 14 */ Op->Asl.AcpiBtype, /* 15 */ Op->Asl.FinalAmlLength, /* 16 */ Op->Asl.Column, - /* 17 */ Op->Asl.LineNumber); + /* 17 */ Op->Asl.LineNumber, + /* 18 */ Op->Asl.EndLine, + /* 19 */ Op->Asl.LogicalLineNumber, + /* 20 */ Op->Asl.EndLogicalLine); /* Generate the AML for this node */ diff --git a/src/acpica/source/compiler/aslcompile.c b/src/acpica/source/compiler/aslcompile.c index 969f97d..c172387 100644 --- a/src/acpica/source/compiler/aslcompile.c +++ b/src/acpica/source/compiler/aslcompile.c @@ -175,6 +175,9 @@ CmDoCompile ( /* Preprocessor */ PrDoPreprocess (); + Gbl_CurrentLineNumber = 1; + Gbl_LogicalLineNumber = 1; + if (Gbl_PreprocessOnly) { UtEndEvent (Event); @@ -184,6 +187,7 @@ CmDoCompile ( } UtEndEvent (Event); + /* Build the parse tree */ Event = UtBeginEvent ("Parse source code and build parse tree"); @@ -780,7 +784,7 @@ CmCleanupAndExit ( /* Close all open files */ /* - * Take care with the preprocessor file (.i), it might be the same + * Take care with the preprocessor file (.pre), it might be the same * as the "input" file, depending on where the compiler has terminated * or aborted. Prevent attempt to close the same file twice in * loop below. @@ -805,10 +809,9 @@ CmCleanupAndExit ( FlDeleteFile (ASL_FILE_AML_OUTPUT); } - /* Delete the preprocessor output file (.i) unless -li flag is set */ + /* Delete the preprocessor temp file unless full debug was specified */ - if (!Gbl_PreprocessorOutputFlag && - Gbl_PreprocessFlag) + if (Gbl_PreprocessFlag && !Gbl_KeepPreprocessorTempFile) { FlDeleteFile (ASL_FILE_PREPROCESSOR); } @@ -824,8 +827,6 @@ CmCleanupAndExit ( * Note: Handles are cleared by FlCloseFile above, so we look at the * filename instead, to determine if the .SRC file was actually * created. - * - * TBD: SourceOutput should be .TMP, then rename if we want to keep it? */ if (!Gbl_SourceOutputFlag) { diff --git a/src/acpica/source/compiler/aslcompiler.h b/src/acpica/source/compiler/aslcompiler.h index 5c78095..86a28ad 100644 --- a/src/acpica/source/compiler/aslcompiler.h +++ b/src/acpica/source/compiler/aslcompiler.h @@ -1075,7 +1075,7 @@ UtDoConstant ( char *String); ACPI_STATUS -UtStrtoul64 ( +stroul64 ( char *String, UINT32 Base, UINT64 *RetInteger); diff --git a/src/acpica/source/compiler/aslcompiler.l b/src/acpica/source/compiler/aslcompiler.l index 56df646..a5dda27 100644 --- a/src/acpica/source/compiler/aslcompiler.l +++ b/src/acpica/source/compiler/aslcompiler.l @@ -781,7 +781,7 @@ NamePathTail [.]{NameSeg} return (PARSEOP_NAMESTRING); } . { count (1); - if (ACPI_IS_PRINT (*AslCompilertext)) + if (isprint (*AslCompilertext)) { sprintf (MsgBuffer, "Invalid character (%c), expecting ASL keyword or name", diff --git a/src/acpica/source/compiler/asldefine.h b/src/acpica/source/compiler/asldefine.h index 7d34da8..4b71af1 100644 --- a/src/acpica/source/compiler/asldefine.h +++ b/src/acpica/source/compiler/asldefine.h @@ -177,7 +177,8 @@ /* filename suffixes for output files */ -#define FILE_SUFFIX_PREPROCESSOR "i" +#define FILE_SUFFIX_PREPROC_USER "i " +#define FILE_SUFFIX_PREPROCESSOR "pre" #define FILE_SUFFIX_AML_CODE "aml" #define FILE_SUFFIX_MAP "map" #define FILE_SUFFIX_LISTING "lst" @@ -208,6 +209,8 @@ #define ASL_ABORT TRUE #define ASL_NO_ABORT FALSE #define ASL_EOF ACPI_UINT32_MAX +#define ASL_WITHIN_COMMENT (ACPI_UINT32_MAX -1) +#define ASL_BLANK_LINE (ACPI_UINT32_MAX -1) /* Listings */ diff --git a/src/acpica/source/compiler/aslerror.c b/src/acpica/source/compiler/aslerror.c index d033fdb..c9df5d8 100644 --- a/src/acpica/source/compiler/aslerror.c +++ b/src/acpica/source/compiler/aslerror.c @@ -633,11 +633,11 @@ AslCommonError2 ( /* Keep a copy of the extra message */ - ACPI_STRCPY (MessageBuffer, ExtraMessage); + strcpy (MessageBuffer, ExtraMessage); } LineBuffer = UtLocalCalloc (strlen (SourceLine) + 1); - ACPI_STRCPY (LineBuffer, SourceLine); + strcpy (LineBuffer, SourceLine); /* Initialize the error node */ @@ -719,7 +719,7 @@ AslCommonError ( /* Keep a copy of the extra message */ - ACPI_STRCPY (MessageBuffer, ExtraMessage); + strcpy (MessageBuffer, ExtraMessage); } /* Initialize the error node */ diff --git a/src/acpica/source/compiler/aslfileio.c b/src/acpica/source/compiler/aslfileio.c index 4d3d963..9588528 100644 --- a/src/acpica/source/compiler/aslfileio.c +++ b/src/acpica/source/compiler/aslfileio.c @@ -290,6 +290,19 @@ FlWriteFile ( FlFileError (FileId, ASL_MSG_WRITE); AslAbort (); } + + if ((FileId == ASL_FILE_PREPROCESSOR) && Gbl_PreprocessorOutputFlag) + { + /* Duplicate the output to the user preprocessor (.i) file */ + + Actual = fwrite ((char *) Buffer, 1, Length, + Gbl_Files[ASL_FILE_PREPROCESSOR_USER].Handle); + if (Actual != Length) + { + FlFileError (FileId, ASL_MSG_WRITE); + AslAbort (); + } + } } @@ -319,7 +332,6 @@ FlPrintFile ( va_start (Args, Format); - Actual = vfprintf (Gbl_Files[FileId].Handle, Format, Args); va_end (Args); @@ -328,6 +340,30 @@ FlPrintFile ( FlFileError (FileId, ASL_MSG_WRITE); AslAbort (); } + + if ((FileId == ASL_FILE_PREPROCESSOR) && Gbl_PreprocessorOutputFlag) + { + /* + * Duplicate the output to the user preprocessor (.i) file, + * except: no #line directives. + */ + if (!strncmp (Format, "#line", 5)) + { + return; + } + + va_start (Args, Format); + Actual = vfprintf (Gbl_Files[ASL_FILE_PREPROCESSOR_USER].Handle, + Format, Args); + va_end (Args); + + if (Actual == -1) + { + FlFileError (FileId, ASL_MSG_WRITE); + AslAbort (); + } + } + } diff --git a/src/acpica/source/compiler/aslfiles.c b/src/acpica/source/compiler/aslfiles.c index 7443776..4fa8562 100644 --- a/src/acpica/source/compiler/aslfiles.c +++ b/src/acpica/source/compiler/aslfiles.c @@ -115,6 +115,7 @@ #include "aslcompiler.h" #include "acapps.h" +#include "dtcompiler.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslfiles") @@ -156,7 +157,6 @@ FlSetLineNumber ( LineNumber, Gbl_LogicalLineNumber); Gbl_CurrentLineNumber = LineNumber; - Gbl_LogicalLineNumber = LineNumber; } @@ -375,6 +375,7 @@ FlOpenIncludeWithPrefix ( { FILE *IncludeFile; char *Pathname; + UINT32 OriginalLineNumber; /* Build the full pathname to the file */ @@ -394,13 +395,20 @@ FlOpenIncludeWithPrefix ( return (NULL); } -#ifdef _MUST_HANDLE_COMMENTS /* - * Check entire include file for any # preprocessor directives. + * Check the entire include file for any # preprocessor directives. * This is because there may be some confusion between the #include - * preprocessor directive and the ASL Include statement. + * preprocessor directive and the ASL Include statement. A file included + * by the ASL include cannot contain preprocessor directives because + * the preprocessor has already run by the time the ASL include is + * recognized (by the compiler, not the preprocessor.) + * + * Note: DtGetNextLine strips/ignores comments. + * Save current line number since DtGetNextLine modifies it. */ - while (fgets (Gbl_CurrentLineBuffer, Gbl_LineBufferSize, IncludeFile)) + Gbl_CurrentLineNumber--; + OriginalLineNumber = Gbl_CurrentLineNumber; + while (DtGetNextLine (IncludeFile) != ASL_EOF) { if (Gbl_CurrentLineBuffer[0] == '#') { @@ -408,7 +416,7 @@ FlOpenIncludeWithPrefix ( Op, "use #include instead"); } } -#endif + Gbl_CurrentLineNumber = OriginalLineNumber; /* Must seek back to the start of the file */ @@ -651,8 +659,6 @@ FlOpenMiscOutputFiles ( /* Open the debug file as STDERR, text mode */ - /* TBD: hide this behind a FlReopenFile function */ - Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename; Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = freopen (Filename, "w+t", stderr); @@ -660,13 +666,15 @@ FlOpenMiscOutputFiles ( if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle) { /* - * A problem with freopen is that on error, - * we no longer have stderr. + * A problem with freopen is that on error, we no longer + * have stderr and cannot emit normal error messages. + * Emit error to stdout, close files, and exit. */ - Gbl_DebugFlag = FALSE; - memcpy (stderr, stdout, sizeof (FILE)); - FlFileError (ASL_FILE_DEBUG_OUTPUT, ASL_MSG_DEBUG_FILENAME); - AslAbort (); + fprintf (stdout, + "\nCould not open debug output file: %s\n\n", Filename); + + CmCleanupAndExit (); + exit (1); } AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT); @@ -693,7 +701,7 @@ FlOpenMiscOutputFiles ( AslCompilerFileHeader (ASL_FILE_LISTING_OUTPUT); } - /* Create the preprocessor output file if preprocessor enabled */ + /* Create the preprocessor output temp file if preprocessor enabled */ if (Gbl_PreprocessFlag) { @@ -708,6 +716,23 @@ FlOpenMiscOutputFiles ( FlOpenFile (ASL_FILE_PREPROCESSOR, Filename, "w+t"); } + /* + * Create the "user" preprocessor output file if -li flag set. + * Note, this file contains no embedded #line directives. + */ + if (Gbl_PreprocessorOutputFlag) + { + Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_PREPROC_USER); + if (!Filename) + { + AslCommonError (ASL_ERROR, ASL_MSG_PREPROCESSOR_FILENAME, + 0, 0, 0, 0, NULL, NULL); + return (AE_ERROR); + } + + FlOpenFile (ASL_FILE_PREPROCESSOR_USER, Filename, "w+t"); + } + /* All done for data table compiler */ if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA) diff --git a/src/acpica/source/compiler/aslfold.c b/src/acpica/source/compiler/aslfold.c index e320c76..f01d81f 100644 --- a/src/acpica/source/compiler/aslfold.c +++ b/src/acpica/source/compiler/aslfold.c @@ -452,10 +452,12 @@ TrSimpleConstantReduction ( return (Status); } + /* Disconnect any existing children, install new constant */ + + Op->Asl.Child = NULL; TrInstallReducedConstant (Op, ObjDesc); UtSetParseOpName (Op); - Op->Asl.Child = NULL; return (AE_OK); } @@ -619,7 +621,8 @@ TrInstallReducedConstant ( ACPI_PARSE_OBJECT *Op, ACPI_OPERAND_OBJECT *ObjDesc) { - ACPI_PARSE_OBJECT *RootOp; + ACPI_PARSE_OBJECT *LengthOp; + ACPI_PARSE_OBJECT *DataOp; TotalFolds++; @@ -646,17 +649,22 @@ TrInstallReducedConstant ( Op->Asl.ParseOpcode = PARSEOP_STRING_LITERAL; Op->Common.AmlOpcode = AML_STRING_OP; - Op->Asl.AmlLength = ACPI_STRLEN (ObjDesc->String.Pointer) + 1; + Op->Asl.AmlLength = strlen (ObjDesc->String.Pointer) + 1; Op->Common.Value.String = ObjDesc->String.Pointer; DbgPrint (ASL_PARSE_OUTPUT, "Constant expression reduced to (STRING) %s\n\n", Op->Common.Value.String); - break; case ACPI_TYPE_BUFFER: - + /* + * Create a new parse subtree of the form: + * + * BUFFER (Buffer AML opcode) + * INTEGER (Buffer length in bytes) + * RAW_DATA (Buffer byte data) + */ Op->Asl.ParseOpcode = PARSEOP_BUFFER; Op->Common.AmlOpcode = AML_BUFFER_OP; Op->Asl.CompileFlags = NODE_AML_PACKAGE; @@ -664,28 +672,24 @@ TrInstallReducedConstant ( /* Child node is the buffer length */ - RootOp = TrAllocateNode (PARSEOP_INTEGER); + LengthOp = TrAllocateNode (PARSEOP_INTEGER); - RootOp->Asl.AmlOpcode = AML_DWORD_OP; - RootOp->Asl.Value.Integer = ObjDesc->Buffer.Length; - RootOp->Asl.Parent = Op; + LengthOp->Asl.AmlOpcode = AML_DWORD_OP; + LengthOp->Asl.Value.Integer = ObjDesc->Buffer.Length; + LengthOp->Asl.Parent = Op; + (void) OpcSetOptimalIntegerSize (LengthOp); - (void) OpcSetOptimalIntegerSize (RootOp); - - Op->Asl.Child = RootOp; - Op = RootOp; - UtSetParseOpName (Op); + Op->Asl.Child = LengthOp; - /* Peer to the child is the raw buffer data */ + /* Next child is the raw buffer data */ - RootOp = TrAllocateNode (PARSEOP_RAW_DATA); - RootOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; - RootOp->Asl.AmlLength = ObjDesc->Buffer.Length; - RootOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer; - RootOp->Asl.Parent = Op->Asl.Parent; + DataOp = TrAllocateNode (PARSEOP_RAW_DATA); + DataOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; + DataOp->Asl.AmlLength = ObjDesc->Buffer.Length; + DataOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer; + DataOp->Asl.Parent = Op; - Op->Asl.Next = RootOp; - Op = RootOp; + LengthOp->Asl.Next = DataOp; DbgPrint (ASL_PARSE_OUTPUT, "Constant expression reduced to (BUFFER) length %X\n\n", diff --git a/src/acpica/source/compiler/aslglobal.h b/src/acpica/source/compiler/aslglobal.h index a26d752..15d6485 100644 --- a/src/acpica/source/compiler/aslglobal.h +++ b/src/acpica/source/compiler/aslglobal.h @@ -145,6 +145,7 @@ ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES] = {NULL, NULL, "Binary Output:", "AML Output"}, {NULL, NULL, "Source Output:", "Source Output"}, {NULL, NULL, "Preprocessor: ", "Preprocessor Output"}, + {NULL, NULL, "Preprocessor: ", "Preprocessor Temp File"}, {NULL, NULL, "Listing File: ", "Listing Output"}, {NULL, NULL, "Hex Dump: ", "Hex Table Output"}, {NULL, NULL, "Namespace: ", "Namespace Output"}, @@ -195,10 +196,10 @@ ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_CurrentLineBuffer, NUL ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_LineBufPtr, NULL); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_LineBufferSize, ASL_DEFAULT_LINE_BUFFER_SIZE); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentColumn, 0); -ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_PreviousLineNumber, 0); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineNumber, 1); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_LogicalLineNumber, 1); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineOffset, 0); +ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_OriginalInputFileSize, 0); ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_SyntaxError, 0); /* Exception reporting */ @@ -218,6 +219,7 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseDefaultAmlFilename, ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_MapfileFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NsOutputFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessorOutputFlag, FALSE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_KeepPreprocessorTempFile, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DebugFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AsmOutputFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_C_OutputFlag, FALSE); diff --git a/src/acpica/source/compiler/aslmain.c b/src/acpica/source/compiler/aslmain.c index 59fdbe8..3d94f24 100644 --- a/src/acpica/source/compiler/aslmain.c +++ b/src/acpica/source/compiler/aslmain.c @@ -333,7 +333,7 @@ AslSignalHandler ( /* Close all open files */ - Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .i file is same as source file */ + Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .pre file is same as source file */ for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++) { diff --git a/src/acpica/source/compiler/aslmapoutput.c b/src/acpica/source/compiler/aslmapoutput.c index 9537cac..ef85594 100644 --- a/src/acpica/source/compiler/aslmapoutput.c +++ b/src/acpica/source/compiler/aslmapoutput.c @@ -279,7 +279,7 @@ MpEmitGpioInfo ( /* Print header info for the controller itself */ if (!PrevDeviceName || - ACPI_STRCMP (PrevDeviceName, Info->DeviceName)) + strcmp (PrevDeviceName, Info->DeviceName)) { FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\nGPIO Controller: %-8s %-28s", @@ -432,7 +432,7 @@ MpEmitSerialInfo ( /* Print header info for the controller itself */ if (!PrevDeviceName || - ACPI_STRCMP (PrevDeviceName, Info->DeviceName)) + strcmp (PrevDeviceName, Info->DeviceName)) { FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\n%s Controller: ", Type); diff --git a/src/acpica/source/compiler/aslmethod.c b/src/acpica/source/compiler/aslmethod.c index b8ca5e9..c997c54 100644 --- a/src/acpica/source/compiler/aslmethod.c +++ b/src/acpica/source/compiler/aslmethod.c @@ -502,7 +502,7 @@ MtMethodAnalysisWalkBegin ( /* Special typechecking for _HID */ - if (!ACPI_STRCMP (METHOD_NAME__HID, Op->Asl.NameSeg)) + if (!strcmp (METHOD_NAME__HID, Op->Asl.NameSeg)) { Next = Op->Asl.Child->Asl.Next; AnCheckId (Next, ASL_TYPE_HID); @@ -510,7 +510,7 @@ MtMethodAnalysisWalkBegin ( /* Special typechecking for _CID */ - else if (!ACPI_STRCMP (METHOD_NAME__CID, Op->Asl.NameSeg)) + else if (!strcmp (METHOD_NAME__CID, Op->Asl.NameSeg)) { Next = Op->Asl.Child->Asl.Next; diff --git a/src/acpica/source/compiler/aslopcodes.c b/src/acpica/source/compiler/aslopcodes.c index 36044b0..809e5e7 100644 --- a/src/acpica/source/compiler/aslopcodes.c +++ b/src/acpica/source/compiler/aslopcodes.c @@ -708,7 +708,7 @@ OpcDoEisaId ( * The EISAID string must be exactly 7 characters and of the form * "UUUXXXX" -- 3 uppercase letters and 4 hex digits (e.g., "PNP0001") */ - if (ACPI_STRLEN (InString) != 7) + if (strlen (InString) != 7) { Status = AE_BAD_PARAMETER; } @@ -927,7 +927,7 @@ OpcFindName ( for (i = 0, Str = List[0]; Str; i++, Str = List[i]) { - if (!(ACPI_STRNCMP (Str, Name, ACPI_STRLEN (Name)))) + if (!(strncmp (Str, Name, strlen (Name)))) { *Index = i; return (TRUE); @@ -979,7 +979,7 @@ OpcDoPld ( return; } - ACPI_MEMSET (&PldInfo, 0, sizeof (ACPI_PLD_INFO)); + memset (&PldInfo, 0, sizeof (ACPI_PLD_INFO)); Node = Op->Asl.Child; while (Node) diff --git a/src/acpica/source/compiler/asloperands.c b/src/acpica/source/compiler/asloperands.c index ab06d14..71d94c7 100644 --- a/src/acpica/source/compiler/asloperands.c +++ b/src/acpica/source/compiler/asloperands.c @@ -1004,7 +1004,7 @@ OpnDoDefinitionBlock ( if (Child->Asl.Value.String) { Gbl_TableSignature = Child->Asl.Value.String; - if (ACPI_STRLEN (Gbl_TableSignature) != 4) + if (strlen (Gbl_TableSignature) != 4) { AslError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, Child, "Length not exactly 4"); @@ -1039,9 +1039,9 @@ OpnDoDefinitionBlock ( Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; if (Child->Asl.Value.String) { - Length = ACPI_STRLEN (Child->Asl.Value.String); + Length = strlen (Child->Asl.Value.String); Gbl_TableId = UtStringCacheCalloc (Length + 1); - ACPI_STRCPY (Gbl_TableId, Child->Asl.Value.String); + strcpy (Gbl_TableId, Child->Asl.Value.String); /* * Convert anything non-alphanumeric to an underscore. This diff --git a/src/acpica/source/compiler/aslopt.c b/src/acpica/source/compiler/aslopt.c index 65fce99..8aae62e 100644 --- a/src/acpica/source/compiler/aslopt.c +++ b/src/acpica/source/compiler/aslopt.c @@ -240,9 +240,9 @@ OptSearchToRoot ( /* We must allocate a new string for the name (TargetPath gets deleted) */ *NewPath = UtStringCacheCalloc (ACPI_NAME_SIZE + 1); - ACPI_STRCPY (*NewPath, Path); + strcpy (*NewPath, Path); - if (ACPI_STRNCMP (*NewPath, "_T_", 3)) + if (strncmp (*NewPath, "_T_", 3)) { AslError (ASL_OPTIMIZATION, ASL_MSG_SINGLE_NAME_OPTIMIZATION, Op, *NewPath); @@ -413,7 +413,7 @@ OptBuildShortestPath ( Index = TargetPath->Length; } - ACPI_STRCPY (&NewPathExternal[i], &((char *) TargetPath->Pointer)[Index]); + strcpy (&NewPathExternal[i], &((char *) TargetPath->Pointer)[Index]); ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, " %-24s", NewPathExternal)); /* @@ -430,11 +430,11 @@ OptBuildShortestPath ( return (Status); } - if (ACPI_STRLEN (NewPath) >= AmlNameStringLength) + if (strlen (NewPath) >= AmlNameStringLength) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, " NOT SHORTER (New %u old %u)", - (UINT32) ACPI_STRLEN (NewPath), (UINT32) AmlNameStringLength)); + (UINT32) strlen (NewPath), (UINT32) AmlNameStringLength)); ACPI_FREE (NewPathExternal); return (AE_NOT_FOUND); } @@ -669,7 +669,7 @@ OptOptimizeNamePath ( * The original path must be longer than one NameSeg (4 chars) for there * to be any possibility that it can be optimized to a shorter string */ - AmlNameStringLength = ACPI_STRLEN (AmlNameString); + AmlNameStringLength = strlen (AmlNameString); if (AmlNameStringLength <= ACPI_NAME_SIZE) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, @@ -817,7 +817,7 @@ OptOptimizeNamePath ( */ if (ACPI_SUCCESS (Status)) { - HowMuchShorter = (AmlNameStringLength - ACPI_STRLEN (NewPath)); + HowMuchShorter = (AmlNameStringLength - strlen (NewPath)); OptTotal += HowMuchShorter; ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, @@ -833,12 +833,12 @@ OptOptimizeNamePath ( * (alias name) is the second operand */ Op->Asl.Child->Asl.Next->Asl.Value.String = NewPath; - Op->Asl.Child->Asl.Next->Asl.AmlLength = ACPI_STRLEN (NewPath); + Op->Asl.Child->Asl.Next->Asl.AmlLength = strlen (NewPath); } else { Op->Asl.Child->Asl.Value.String = NewPath; - Op->Asl.Child->Asl.AmlLength = ACPI_STRLEN (NewPath); + Op->Asl.Child->Asl.AmlLength = strlen (NewPath); } } else if (Flags & AML_CREATE) @@ -853,14 +853,14 @@ OptOptimizeNamePath ( /* Update the parse node with the new NamePath */ NextOp->Asl.Value.String = NewPath; - NextOp->Asl.AmlLength = ACPI_STRLEN (NewPath); + NextOp->Asl.AmlLength = strlen (NewPath); } else { /* Update the parse node with the new NamePath */ Op->Asl.Value.String = NewPath; - Op->Asl.AmlLength = ACPI_STRLEN (NewPath); + Op->Asl.AmlLength = strlen (NewPath); } } else diff --git a/src/acpica/source/compiler/aslprintf.c b/src/acpica/source/compiler/aslprintf.c index 1ace80f..593ea65 100644 --- a/src/acpica/source/compiler/aslprintf.c +++ b/src/acpica/source/compiler/aslprintf.c @@ -258,7 +258,7 @@ OpcParsePrintf ( if (StringToProcess) { NewString = UtStringCacheCalloc (StringLength + 1); - ACPI_STRNCPY (NewString, StartPosition, StringLength); + strncpy (NewString, StartPosition, StringLength); NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL); NewOp->Asl.Value.String = NewString; @@ -347,7 +347,7 @@ OpcParsePrintf ( if (StringToProcess) { NewString = UtStringCacheCalloc (StringLength + 1); - ACPI_STRNCPY (NewString, StartPosition, StringLength); + strncpy (NewString, StartPosition, StringLength); NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL); NewOp->Asl.Value.String = NewString; diff --git a/src/acpica/source/compiler/aslstartup.c b/src/acpica/source/compiler/aslstartup.c index 5cc0959..0f8c728 100644 --- a/src/acpica/source/compiler/aslstartup.c +++ b/src/acpica/source/compiler/aslstartup.c @@ -431,6 +431,8 @@ AslDoOneFile ( return (AE_ERROR); } + Gbl_OriginalInputFileSize = FlGetFileSize (ASL_FILE_INPUT); + /* Determine input file type */ Gbl_FileType = AslDetectSourceFileType (&Gbl_Files[ASL_FILE_INPUT]); diff --git a/src/acpica/source/compiler/aslsupport.l b/src/acpica/source/compiler/aslsupport.l index c7f1f93..f1a7c59 100644 --- a/src/acpica/source/compiler/aslsupport.l +++ b/src/acpica/source/compiler/aslsupport.l @@ -185,6 +185,7 @@ AslDoLineDirective ( char *Filename; UINT32 i; + Gbl_HasIncludeFiles = TRUE; /* Eat the entire line that contains the #line directive */ @@ -785,7 +786,7 @@ DoCharacter: * string and resume processing of the next character */ ConvertBuffer[i] = 0; - Digit = (UINT8) ACPI_STRTOUL (ConvertBuffer, NULL, 8); + Digit = (UINT8) strtoul (ConvertBuffer, NULL, 8); /* Check for NULL or non-ascii character (ignore if so) */ @@ -821,7 +822,7 @@ DoCharacter: /* Up to two hex digits allowed */ - if (!ACPI_IS_XDIGIT (StringChar) || + if (!isxdigit (StringChar) || (i > 1)) { /* @@ -829,7 +830,7 @@ DoCharacter: * string and resume processing of the next character */ ConvertBuffer[i] = 0; - Digit = (UINT8) ACPI_STRTOUL (ConvertBuffer, NULL, 16); + Digit = (UINT8) strtoul (ConvertBuffer, NULL, 16); /* Check for NULL or non-ascii character (ignore if so) */ @@ -902,7 +903,7 @@ CompletedString: return (FALSE); } - ACPI_STRCPY (CleanString, MsgBuffer); + strcpy (CleanString, MsgBuffer); AslCompilerlval.s = CleanString; return (TRUE); diff --git a/src/acpica/source/compiler/asltypes.h b/src/acpica/source/compiler/asltypes.h index 21c64ed..0f08ae4 100644 --- a/src/acpica/source/compiler/asltypes.h +++ b/src/acpica/source/compiler/asltypes.h @@ -220,32 +220,56 @@ typedef struct asl_file_status /* * File types. Note: Any changes to this table must also be reflected * in the Gbl_Files array. + * + * Corresponding filename suffixes are in comments + * + * NOTE: Don't move the first 4 file types */ typedef enum { ASL_FILE_STDOUT = 0, ASL_FILE_STDERR, - ASL_FILE_INPUT, - ASL_FILE_AML_OUTPUT, /* Don't move these first 4 file types */ - ASL_FILE_SOURCE_OUTPUT, - ASL_FILE_PREPROCESSOR, - ASL_FILE_LISTING_OUTPUT, - ASL_FILE_HEX_OUTPUT, - ASL_FILE_NAMESPACE_OUTPUT, - ASL_FILE_DEBUG_OUTPUT, - ASL_FILE_ASM_SOURCE_OUTPUT, - ASL_FILE_C_SOURCE_OUTPUT, - ASL_FILE_ASM_INCLUDE_OUTPUT, - ASL_FILE_C_INCLUDE_OUTPUT, - ASL_FILE_C_OFFSET_OUTPUT, - ASL_FILE_MAP_OUTPUT + ASL_FILE_INPUT, /* .asl */ + ASL_FILE_AML_OUTPUT, /* .aml */ + ASL_FILE_SOURCE_OUTPUT, /* .src */ + ASL_FILE_PREPROCESSOR, /* .pre */ + ASL_FILE_PREPROCESSOR_USER, /* .i */ + ASL_FILE_LISTING_OUTPUT, /* .lst */ + ASL_FILE_HEX_OUTPUT, /* .hex */ + ASL_FILE_NAMESPACE_OUTPUT, /* .nsp */ + ASL_FILE_DEBUG_OUTPUT, /* .txt */ + ASL_FILE_ASM_SOURCE_OUTPUT, /* .asm */ + ASL_FILE_C_SOURCE_OUTPUT, /* .c */ + ASL_FILE_ASM_INCLUDE_OUTPUT,/* .inc */ + ASL_FILE_C_INCLUDE_OUTPUT, /* .h */ + ASL_FILE_C_OFFSET_OUTPUT, /* offset.h */ + ASL_FILE_MAP_OUTPUT /* .map */ } ASL_FILE_TYPES; -#define ASL_MAX_FILE_TYPE 15 +#define ASL_MAX_FILE_TYPE 16 #define ASL_NUM_FILES (ASL_MAX_FILE_TYPE + 1) +/* filename suffixes for output files */ + +#define FILE_SUFFIX_PREPROC_USER "i " +#define FILE_SUFFIX_PREPROCESSOR "pre" +#define FILE_SUFFIX_AML_CODE "aml" +#define FILE_SUFFIX_MAP "map" +#define FILE_SUFFIX_LISTING "lst" +#define FILE_SUFFIX_HEX_DUMP "hex" +#define FILE_SUFFIX_DEBUG "txt" +#define FILE_SUFFIX_SOURCE "src" +#define FILE_SUFFIX_NAMESPACE "nsp" +#define FILE_SUFFIX_ASM_SOURCE "asm" +#define FILE_SUFFIX_C_SOURCE "c" +#define FILE_SUFFIX_DISASSEMBLY "dsl" +#define FILE_SUFFIX_ASM_INCLUDE "inc" +#define FILE_SUFFIX_C_INCLUDE "h" +#define FILE_SUFFIX_ASL_CODE "asl" +#define FILE_SUFFIX_C_OFFSET "offset.h" + /* Cache block structure for ParseOps and Strings */ diff --git a/src/acpica/source/compiler/aslutils.c b/src/acpica/source/compiler/aslutils.c index a5e53c7..32d120d 100644 --- a/src/acpica/source/compiler/aslutils.c +++ b/src/acpica/source/compiler/aslutils.c @@ -513,17 +513,20 @@ UtDisplaySummary ( "%-14s %s - %u lines, %u bytes, %u keywords\n", "ASL Input:", Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_CurrentLineNumber, - Gbl_InputByteCount, TotalKeywords); + Gbl_OriginalInputFileSize, TotalKeywords); /* AML summary */ if ((Gbl_ExceptionCount[ASL_ERROR] == 0) || (Gbl_IgnoreErrors)) { - FlPrintFile (FileId, - "%-14s %s - %u bytes, %u named objects, %u executable opcodes\n", - "AML Output:", - Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength, - TotalNamedObjects, TotalExecutableOpcodes); + if (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle) + { + FlPrintFile (FileId, + "%-14s %s - %u bytes, %u named objects, %u executable opcodes\n", + "AML Output:", + Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength, + TotalNamedObjects, TotalExecutableOpcodes); + } } } @@ -543,9 +546,9 @@ UtDisplaySummary ( continue; } - /* .I is a temp file unless specifically requested */ + /* .PRE is the preprocessor intermediate file */ - if ((i == ASL_FILE_PREPROCESSOR) && (!Gbl_PreprocessorOutputFlag)) + if ((i == ASL_FILE_PREPROCESSOR) && (!Gbl_KeepPreprocessorTempFile)) { continue; } @@ -1004,7 +1007,7 @@ UtDoConstant ( char ErrBuf[64]; - Status = UtStrtoul64 (String, 0, &Converted); + Status = stroul64 (String, 0, &Converted); if (ACPI_FAILURE (Status)) { sprintf (ErrBuf, "%s %s\n", "Conversion error:", @@ -1020,7 +1023,7 @@ UtDoConstant ( /******************************************************************************* * - * FUNCTION: UtStrtoul64 + * FUNCTION: stroul64 * * PARAMETERS: String - Null terminated string * Terminater - Where a pointer to the terminating byte @@ -1034,7 +1037,7 @@ UtDoConstant ( ******************************************************************************/ ACPI_STATUS -UtStrtoul64 ( +stroul64 ( char *String, UINT32 Base, UINT64 *RetInteger) diff --git a/src/acpica/source/compiler/asluuid.c b/src/acpica/source/compiler/asluuid.c index db2dd34..b9854b9 100644 --- a/src/acpica/source/compiler/asluuid.c +++ b/src/acpica/source/compiler/asluuid.c @@ -141,7 +141,7 @@ AuValidateUuid ( UINT32 i; - if (!InString || (ACPI_STRLEN (InString) != UUID_STRING_LENGTH)) + if (!InString || (strlen (InString) != UUID_STRING_LENGTH)) { return (AE_BAD_PARAMETER); } diff --git a/src/acpica/source/compiler/dtcompile.c b/src/acpica/source/compiler/dtcompile.c index 5c75f4b..98d663e 100644 --- a/src/acpica/source/compiler/dtcompile.c +++ b/src/acpica/source/compiler/dtcompile.c @@ -374,7 +374,7 @@ DtCompileDataTable ( return (AE_ERROR); } - Gbl_Signature = UtStringCacheCalloc (ACPI_STRLEN (Signature) + 1); + Gbl_Signature = UtStringCacheCalloc (strlen (Signature) + 1); strcpy (Gbl_Signature, Signature); /* @@ -430,6 +430,8 @@ DtCompileDataTable ( TableData = AcpiDmGetTableData (Signature); if (!TableData || Gbl_CompileGeneric) { + /* Unknown table signature and/or force generic compile */ + DtCompileGeneric ((void **) FieldList, NULL, NULL); goto FinishHeader; } @@ -526,7 +528,7 @@ DtCompileTable ( /* Ignore optional subtable if name does not match */ if ((Info->Flags & DT_OPTIONAL) && - ACPI_STRCMP ((*Field)->Name, Info->Name)) + strcmp ((*Field)->Name, Info->Name)) { *RetSubtable = NULL; return (AE_OK); @@ -663,7 +665,7 @@ DtCompileTable ( DtSetSubtableLength (InlineSubtable); - ACPI_MEMCPY (Buffer, InlineSubtable->Buffer, FieldLength); + memcpy (Buffer, InlineSubtable->Buffer, FieldLength); LocalField = *Field; break; diff --git a/src/acpica/source/compiler/dtexpress.c b/src/acpica/source/compiler/dtexpress.c index 2fdd4d2..e5af53b 100644 --- a/src/acpica/source/compiler/dtexpress.c +++ b/src/acpica/source/compiler/dtexpress.c @@ -485,7 +485,7 @@ DtLookupLabel ( LabelField = Gbl_LabelList; while (LabelField) { - if (!ACPI_STRCMP (Name, LabelField->Value)) + if (!strcmp (Name, LabelField->Value)) { return (LabelField); } diff --git a/src/acpica/source/compiler/dtfield.c b/src/acpica/source/compiler/dtfield.c index f3810c2..adde63d 100644 --- a/src/acpica/source/compiler/dtfield.c +++ b/src/acpica/source/compiler/dtfield.c @@ -238,7 +238,7 @@ DtCompileString ( UINT32 Length; - Length = ACPI_STRLEN (Field->Value); + Length = strlen (Field->Value); /* Check if the string is too long for the field */ @@ -249,7 +249,7 @@ DtCompileString ( Length = ByteLength; } - ACPI_MEMCPY (Buffer, Field->Value, Length); + memcpy (Buffer, Field->Value, Length); } @@ -284,7 +284,7 @@ DtCompileUnicode ( AsciiString = Field->Value; UnicodeString = (UINT16 *) Buffer; - Count = ACPI_STRLEN (AsciiString) + 1; + Count = strlen (AsciiString) + 1; /* Convert to Unicode string (including null terminator) */ @@ -390,7 +390,7 @@ DtCompileInteger ( /* TBD: Should use a flag rather than compare "Reserved" */ - if (!ACPI_STRCMP (Field->Name, "Reserved")) + if (!strcmp (Field->Name, "Reserved")) { if (Flags & DT_NON_ZERO) { @@ -431,7 +431,7 @@ DtCompileInteger ( DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, MsgBuffer); } - ACPI_MEMCPY (Buffer, &Value, ByteLength); + memcpy (Buffer, &Value, ByteLength); return; } @@ -463,7 +463,7 @@ DtNormalizeBuffer ( char c; - NewBuffer = UtLocalCalloc (ACPI_STRLEN (Buffer) + 1); + NewBuffer = UtLocalCalloc (strlen (Buffer) + 1); TmpBuffer = NewBuffer; while ((c = *Buffer++)) diff --git a/src/acpica/source/compiler/dtio.c b/src/acpica/source/compiler/dtio.c index 9b044ee..7d7c223 100644 --- a/src/acpica/source/compiler/dtio.c +++ b/src/acpica/source/compiler/dtio.c @@ -201,7 +201,7 @@ DtTrim ( /* Skip lines that start with a space */ - if (!ACPI_STRCMP (String, " ")) + if (!strcmp (String, " ")) { ReturnString = UtStringCacheCalloc (1); return (ReturnString); @@ -210,7 +210,7 @@ DtTrim ( /* Setup pointers to start and end of input string */ Start = String; - End = String + ACPI_STRLEN (String) - 1; + End = String + strlen (String) - 1; /* Find first non-whitespace character */ @@ -252,9 +252,9 @@ DtTrim ( Length = ACPI_PTR_DIFF (End, Start) + 1; ReturnString = UtStringCacheCalloc (Length + 1); - if (ACPI_STRLEN (Start)) + if (strlen (Start)) { - ACPI_STRNCPY (ReturnString, Start, Length); + strncpy (ReturnString, Start, Length); } ReturnString[Length] = 0; @@ -385,7 +385,7 @@ DtParseLine ( Length = ACPI_PTR_DIFF (End, Start); TmpName = UtLocalCalloc (Length + 1); - ACPI_STRNCPY (TmpName, Start, Length); + strncpy (TmpName, Start, Length); Name = DtTrim (TmpName); ACPI_FREE (TmpName); @@ -432,7 +432,7 @@ DtParseLine ( Length = ACPI_PTR_DIFF (End, Start); TmpValue = UtLocalCalloc (Length + 1); - ACPI_STRNCPY (TmpValue, Start, Length); + strncpy (TmpValue, Start, Length); Value = DtTrim (TmpValue); ACPI_FREE (TmpValue); @@ -487,7 +487,7 @@ DtGetNextLine ( int c; - ACPI_MEMSET (Gbl_CurrentLineBuffer, 0, Gbl_LineBufferSize); + memset (Gbl_CurrentLineBuffer, 0, Gbl_LineBufferSize); for (i = 0; ;) { /* @@ -969,7 +969,7 @@ DtDumpBuffer ( } BufChar = Buffer[(ACPI_SIZE) i + j]; - if (ACPI_IS_PRINT (BufChar)) + if (isprint (BufChar)) { FlPrintFile (FileId, "%c", BufChar); } diff --git a/src/acpica/source/compiler/dtparser.y b/src/acpica/source/compiler/dtparser.y index 96e6c14..e48799b 100644 --- a/src/acpica/source/compiler/dtparser.y +++ b/src/acpica/source/compiler/dtparser.y @@ -120,6 +120,13 @@ #define _COMPONENT DT_COMPILER ACPI_MODULE_NAME ("dtparser") +void * AslLocalAllocate (unsigned int Size); + +/* Bison/yacc configuration */ + +#undef alloca +#define alloca AslLocalAllocate + int DtParserlex (void); int DtParserparse (void); void DtParsererror (char const *msg); @@ -234,15 +241,15 @@ Expression /* Default base for a non-prefixed integer is 16 */ - | EXPOP_NUMBER { UtStrtoul64 (DtParsertext, 16, &$$);} + | EXPOP_NUMBER { stroul64 (DtParsertext, 16, &$$);} /* Standard hex number (0x1234) */ - | EXPOP_HEX_NUMBER { UtStrtoul64 (DtParsertext, 16, &$$);} + | EXPOP_HEX_NUMBER { stroul64 (DtParsertext, 16, &$$);} - /* TBD: Decimal number with prefix (0d1234) - Not supported by UtStrtoul64 at this time */ + /* TBD: Decimal number with prefix (0d1234) - Not supported by stroul64 at this time */ - | EXPOP_DECIMAL_NUMBER { UtStrtoul64 (DtParsertext, 10, &$$);} + | EXPOP_DECIMAL_NUMBER { stroul64 (DtParsertext, 10, &$$);} ; %% diff --git a/src/acpica/source/compiler/dtsubtable.c b/src/acpica/source/compiler/dtsubtable.c index 2461cc2..348758c 100644 --- a/src/acpica/source/compiler/dtsubtable.c +++ b/src/acpica/source/compiler/dtsubtable.c @@ -152,7 +152,7 @@ DtCreateSubtable ( String = UtStringCacheCalloc (Length); Subtable->Buffer = ACPI_CAST_PTR (UINT8, String); - ACPI_MEMCPY (Subtable->Buffer, Buffer, Length); + memcpy (Subtable->Buffer, Buffer, Length); Subtable->Length = Length; Subtable->TotalLength = Length; @@ -451,6 +451,6 @@ DtSetSubtableLength ( return; } - ACPI_MEMCPY (Subtable->LengthField, &Subtable->TotalLength, + memcpy (Subtable->LengthField, &Subtable->TotalLength, Subtable->SizeOfLengthField); } diff --git a/src/acpica/source/compiler/dttable.c b/src/acpica/source/compiler/dttable.c index db9ac24..80b8a95 100644 --- a/src/acpica/source/compiler/dttable.c +++ b/src/acpica/source/compiler/dttable.c @@ -1896,7 +1896,7 @@ DtCompileIvrs ( if (IvrsHeader->Type == ACPI_IVRS_TYPE_HARDWARE) { while (*PFieldList && - !ACPI_STRCMP ((*PFieldList)->Name, "Entry Type")) + !strcmp ((*PFieldList)->Name, "Entry Type")) { SubtableStart = *PFieldList; DtCompileInteger (&EntryType, *PFieldList, 1, 0); @@ -3475,13 +3475,13 @@ DtCompileGeneric ( /* Now we can actually compile the parse tree */ - if (*Length) + if (Length && *Length) { *Length = 0; } while (*PFieldList) { - if (Name && !ACPI_STRCMP ((*PFieldList)->Name, Name)) + if (Name && !strcmp ((*PFieldList)->Name, Name)) { break; } diff --git a/src/acpica/source/compiler/dttemplate.c b/src/acpica/source/compiler/dttemplate.c index 809ca61..8c2f8b2 100644 --- a/src/acpica/source/compiler/dttemplate.c +++ b/src/acpica/source/compiler/dttemplate.c @@ -157,6 +157,7 @@ AcpiUtIsSpecialTable ( { if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_DSDT) || + ACPI_COMPARE_NAME (Signature, ACPI_SIG_OSDT) || ACPI_COMPARE_NAME (Signature, ACPI_SIG_SSDT) || ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS) || ACPI_COMPARE_NAME (Signature, ACPI_RSDP_NAME)) @@ -199,8 +200,8 @@ DtCreateTemplates ( } AcpiUtStrupr (Signature); - if (!ACPI_STRCMP (Signature, "ALL") || - !ACPI_STRCMP (Signature, "*")) + if (!strcmp (Signature, "ALL") || + !strcmp (Signature, "*")) { /* Create all available/known templates */ @@ -399,7 +400,7 @@ DtCreateOneTemplate ( AcpiOsPrintf ("/*\n"); AcpiOsPrintf (ACPI_COMMON_HEADER ("iASL Compiler/Disassembler", " * ")); - AcpiOsPrintf (" * Template for [%4.4s] ACPI Table\n", + AcpiOsPrintf (" * Template for [%4.4s] ACPI Table", Signature); /* Dump the actual ACPI table */ @@ -408,6 +409,8 @@ DtCreateOneTemplate ( { /* Normal case, tables that appear in AcpiDmTableData */ + AcpiOsPrintf (" (static data table)\n"); + if (Gbl_VerboseTemplates) { AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength]" @@ -416,7 +419,7 @@ DtCreateOneTemplate ( else { AcpiOsPrintf (" * Format: [ByteLength]" - " FieldName : HexFieldValue\n */\n\n"); + " FieldName : HexFieldValue\n */\n"); } AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, @@ -424,9 +427,11 @@ DtCreateOneTemplate ( } else { - /* Special ACPI tables - DSDT, SSDT, FADT, RSDP */ + /* Special ACPI tables - DSDT, SSDT, OSDT, FADT, RSDP */ + + AcpiOsPrintf (" (AML byte code table)\n"); - AcpiOsPrintf (" */\n\n"); + AcpiOsPrintf (" */\n"); if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_DSDT)) { Actual = fwrite (TemplateDsdt, 1, sizeof (TemplateDsdt) -1, File); @@ -449,6 +454,17 @@ DtCreateOneTemplate ( goto Cleanup; } } + else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_OSDT)) + { + Actual = fwrite (TemplateOsdt, 1, sizeof (TemplateOsdt) -1, File); + if (Actual != sizeof (TemplateOsdt) -1) + { + fprintf (stderr, + "Could not write to output file %s\n", DisasmFilename); + Status = AE_ERROR; + goto Cleanup; + } + } else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS)) /* FADT */ { AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, diff --git a/src/acpica/source/compiler/dttemplate.h b/src/acpica/source/compiler/dttemplate.h index 22eb736..9b08e4b 100644 --- a/src/acpica/source/compiler/dttemplate.h +++ b/src/acpica/source/compiler/dttemplate.h @@ -117,7 +117,7 @@ #define __DTTEMPLATE_H -/* Special templates for DSDT and SSDT (AML byte-code tables) */ +/* Special templates for the ASL/AML tables: DSDT, SSDT, and OSDT */ const char TemplateDsdt[] = "DefinitionBlock (\"dsdt.aml\", \"DSDT\", 2, \"Intel\", \"Template\", 0x00000001)\n" @@ -137,6 +137,15 @@ const char TemplateSsdt[] = " }\n" "}\n\n"; +const char TemplateOsdt[] = + "DefinitionBlock (\"osdt.aml\", \"OSDT\", 2, \"Intel\", \"Template\", 0x00000001)\n" + "{\n" + " Method (MAIN, 0, NotSerialized)\n" + " {\n" + " Return (Zero)\n" + " }\n" + "}\n\n"; + /* Templates for ACPI data tables */ diff --git a/src/acpica/source/compiler/dtutils.c b/src/acpica/source/compiler/dtutils.c index 658cde6..9e6db68 100644 --- a/src/acpica/source/compiler/dtutils.c +++ b/src/acpica/source/compiler/dtutils.c @@ -313,7 +313,7 @@ DtStrtoul64 ( while (*ThisChar) { - if (ACPI_IS_DIGIT (*ThisChar)) + if (isdigit (*ThisChar)) { /* Convert ASCII 0-9 to Decimal value */ @@ -321,8 +321,8 @@ DtStrtoul64 ( } else /* Letter */ { - ThisDigit = (UINT32) ACPI_TOUPPER (*ThisChar); - if (!ACPI_IS_XDIGIT ((char) ThisDigit)) + ThisDigit = (UINT32) toupper (*ThisChar); + if (!isxdigit ((char) ThisDigit)) { /* Not A-F */ @@ -640,7 +640,7 @@ DtGetFieldLength ( Value = DtGetFieldValue (Field); if (Value) { - ByteLength = ACPI_STRLEN (Value) + 1; + ByteLength = strlen (Value) + 1; } else { /* At this point, this is a fatal error */ @@ -705,7 +705,7 @@ DtGetFieldLength ( /* TBD: error if Value is NULL? (as below?) */ - ByteLength = (ACPI_STRLEN (Value) + 1) * sizeof(UINT16); + ByteLength = (strlen (Value) + 1) * sizeof(UINT16); break; default: diff --git a/src/acpica/source/compiler/prparser.y b/src/acpica/source/compiler/prparser.y index 990b79b..68c140f 100644 --- a/src/acpica/source/compiler/prparser.y +++ b/src/acpica/source/compiler/prparser.y @@ -120,6 +120,13 @@ #define _COMPONENT ASL_PREPROCESSOR ACPI_MODULE_NAME ("prparser") +void * AslLocalAllocate (unsigned int Size); + +/* Bison/yacc configuration */ + +#undef alloca +#define alloca AslLocalAllocate + int PrParserlex (void); int PrParserparse (void); void PrParsererror (char const *msg); @@ -247,11 +254,11 @@ Expression /* Default base for a non-prefixed integer is 10 */ - | EXPOP_NUMBER { UtStrtoul64 (PrParsertext, 10, &$$);} + | EXPOP_NUMBER { stroul64 (PrParsertext, 10, &$$);} /* Standard hex number (0x1234) */ - | EXPOP_HEX_NUMBER { UtStrtoul64 (PrParsertext, 16, &$$);} + | EXPOP_HEX_NUMBER { stroul64 (PrParsertext, 16, &$$);} ; %% diff --git a/src/acpica/source/compiler/prscan.c b/src/acpica/source/compiler/prscan.c index cafcea5..51657d6 100644 --- a/src/acpica/source/compiler/prscan.c +++ b/src/acpica/source/compiler/prscan.c @@ -139,6 +139,14 @@ PrDoDirective ( char *DirectiveToken, char **Next); +static void +PrGetNextLineInit ( + void); + +static UINT32 +PrGetNextLine ( + FILE *Handle); + static int PrMatchDirective ( char *Directive); @@ -258,7 +266,7 @@ PrInitializeGlobals ( /* Init globals */ Gbl_InputFileList = NULL; - Gbl_CurrentLineNumber = 0; + Gbl_CurrentLineNumber = 1; Gbl_PreprocessorLineNumber = 1; Gbl_PreprocessorError = FALSE; @@ -343,7 +351,7 @@ PrDoPreprocess ( } while (MoreInputFiles); - /* Point compiler input to the new preprocessor output file (.i) */ + /* Point compiler input to the new preprocessor output file (.pre) */ FlCloseFile (ASL_FILE_INPUT); Gbl_Files[ASL_FILE_INPUT].Handle = Gbl_Files[ASL_FILE_PREPROCESSOR].Handle; @@ -352,7 +360,10 @@ PrDoPreprocess ( /* Reset globals to allow compiler to run */ FlSeekFile (ASL_FILE_INPUT, 0); - Gbl_CurrentLineNumber = 1; + if (!Gbl_PreprocessOnly) + { + Gbl_CurrentLineNumber = 0; + } DbgPrint (ASL_DEBUG_OUTPUT, "Preprocessing phase complete \n\n"); } @@ -369,7 +380,8 @@ PrDoPreprocess ( * DESCRIPTION: Preprocess one entire file, line-by-line. * * Input: Raw user ASL from ASL_FILE_INPUT - * Output: Preprocessed file written to ASL_FILE_PREPROCESSOR + * Output: Preprocessed file written to ASL_FILE_PREPROCESSOR and + * (optionally) ASL_FILE_PREPROCESSOR_USER * ******************************************************************************/ @@ -377,7 +389,7 @@ static void PrPreprocessInputFile ( void) { - UINT32 Offset; + UINT32 Status; char *Token; char *ReplaceString; PR_DEFINE_INFO *DefineInfo; @@ -386,10 +398,21 @@ PrPreprocessInputFile ( int OffsetAdjust; + PrGetNextLineInit (); + /* Scan line-by-line. Comments and blank lines are skipped by this function */ - while ((Offset = DtGetNextLine (Gbl_Files[ASL_FILE_INPUT].Handle)) != ASL_EOF) + while ((Status = PrGetNextLine (Gbl_Files[ASL_FILE_INPUT].Handle)) != ASL_EOF) { + Gbl_CurrentLineNumber++; + Gbl_LogicalLineNumber++; + + if ((Status == ASL_WITHIN_COMMENT) || + (Status == ASL_BLANK_LINE)) + { + goto WriteEntireLine; + } + /* Need a copy of the input line for strok() */ strcpy (Gbl_MainTokenBuffer, Gbl_CurrentLineBuffer); @@ -469,24 +492,13 @@ PrPreprocessInputFile ( Token = PrGetNextToken (NULL, PR_TOKEN_SEPARATORS, &Next); } - /* - * Emit a #line directive if necessary, to keep the line numbers in - * the (.i) file synchronized with the original source code file, so - * that the correct line number appears in any error messages - * generated by the actual compiler. - */ - if (Gbl_CurrentLineNumber > (Gbl_PreviousLineNumber + 1)) - { - FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u\n", - Gbl_CurrentLineNumber); - } - - Gbl_PreviousLineNumber = Gbl_CurrentLineNumber; Gbl_PreprocessorLineNumber++; + +WriteEntireLine: /* * Now we can write the possibly modified source line to the - * preprocessor (.i) file + * preprocessor file(s). */ FlWriteFile (ASL_FILE_PREPROCESSOR, Gbl_CurrentLineBuffer, strlen (Gbl_CurrentLineBuffer)); @@ -726,7 +738,7 @@ PrDoDirective ( { #ifndef MACROS_SUPPORTED AcpiOsPrintf ("%s ERROR - line %u: #define macros are not supported yet\n", - Gbl_CurrentLineBuffer, Gbl_CurrentLineNumber); + Gbl_CurrentLineBuffer, Gbl_LogicalLineNumber); exit(1); #else PrAddMacro (Token, Next); @@ -763,7 +775,7 @@ PrDoDirective ( #endif DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID "New #define: %s->%s\n", - Gbl_CurrentLineNumber, Token, Token2); + Gbl_LogicalLineNumber, Token, Token2); PrAddDefine (Token, Token2, FALSE); } @@ -832,10 +844,7 @@ PrDoDirective ( "User #line invocation %s\n", Gbl_CurrentLineNumber, Token); - /* Update local line numbers */ - Gbl_CurrentLineNumber = (UINT32) Value; - Gbl_PreviousLineNumber = 0; /* Emit #line into the preprocessor file */ @@ -911,6 +920,107 @@ SyntaxError: /******************************************************************************* * + * FUNCTION: PrGetNextLine, PrGetNextLineInit + * + * PARAMETERS: Handle - Open file handle for the source file + * + * RETURN: Status of the GetLine operation: + * AE_OK - Normal line, OK status + * ASL_WITHIN_COMMENT - Line is part of a multi-line comment + * ASL_EOF - End-of-file reached + * + * DESCRIPTION: Get the next text line from the input file. Does not strip + * comments. + * + ******************************************************************************/ + +#define PR_NORMAL_TEXT 0 +#define PR_WITHIN_COMMENT 1 + +static UINT8 AcpiGbl_LineScanState = PR_NORMAL_TEXT; + +static void +PrGetNextLineInit ( + void) +{ + AcpiGbl_LineScanState = 0; +} + +static UINT32 +PrGetNextLine ( + FILE *Handle) +{ + UINT32 i; + int c = 0; + int PreviousChar; + + + /* Always clear the global line buffer */ + + memset (Gbl_CurrentLineBuffer, 0, Gbl_LineBufferSize); + for (i = 0; ;) + { + /* + * If line is too long, expand the line buffers. Also increases + * Gbl_LineBufferSize. + */ + if (i >= Gbl_LineBufferSize) + { + UtExpandLineBuffers (); + } + + PreviousChar = c; + c = getc (Handle); + if (c == EOF) + { + return (ASL_EOF); + } + + /* We need to worry about multi-line slash-asterisk comments */ + + /* Check for comment open */ + + if ((AcpiGbl_LineScanState == PR_NORMAL_TEXT) && + (PreviousChar == '/') && (c == '*')) + { + AcpiGbl_LineScanState = PR_WITHIN_COMMENT; + } + + /* Check for comment close */ + + if ((AcpiGbl_LineScanState == PR_WITHIN_COMMENT) && + (PreviousChar == '*') && (c == '/')) + { + AcpiGbl_LineScanState = PR_NORMAL_TEXT; + } + + /* Always copy the character into line buffer */ + + Gbl_CurrentLineBuffer[i] = (char) c; + i++; + + /* Always exit on end-of-line */ + + if (c == '\n') + { + /* Handle multi-line comments */ + + if (AcpiGbl_LineScanState == PR_WITHIN_COMMENT) + { + return (ASL_WITHIN_COMMENT); + } + if (i == 1) + { + return (ASL_BLANK_LINE); + } + return (AE_OK); + } + } +} + + +/******************************************************************************* + * * FUNCTION: PrMatchDirective * * PARAMETERS: Directive - Pointer to directive name token diff --git a/src/acpica/source/compiler/prutils.c b/src/acpica/source/compiler/prutils.c index 329f6d0..b367650 100644 --- a/src/acpica/source/compiler/prutils.c +++ b/src/acpica/source/compiler/prutils.c @@ -454,6 +454,8 @@ PrPushInputFileStack ( PR_FILE_NODE *Fnode; + Gbl_HasIncludeFiles = TRUE; + /* Save the current state in an Fnode */ Fnode = UtLocalCalloc (sizeof (PR_FILE_NODE)); @@ -478,11 +480,11 @@ PrPushInputFileStack ( strcpy (Gbl_Files[ASL_FILE_INPUT].Filename, Filename); Gbl_Files[ASL_FILE_INPUT].Handle = InputFile; - Gbl_PreviousLineNumber = 0; - Gbl_CurrentLineNumber = 0; + Gbl_CurrentLineNumber = 1; /* Emit a new #line directive for the include file */ + Gbl_CurrentLineNumber = 1; FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\"\n", 1, Filename); } @@ -532,12 +534,11 @@ PrPopInputFileStack ( Gbl_Files[ASL_FILE_INPUT].Filename = Fnode->Filename; Gbl_Files[ASL_FILE_INPUT].Handle = Fnode->File; Gbl_CurrentLineNumber = Fnode->CurrentLineNumber; - Gbl_PreviousLineNumber = 0; /* Emit a new #line directive after the include file */ FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\"\n", - Gbl_CurrentLineNumber + 1, Fnode->Filename); + Gbl_CurrentLineNumber, Fnode->Filename); /* All done with this node */ diff --git a/src/acpica/source/components/debugger/dbcmds.c b/src/acpica/source/components/debugger/dbcmds.c index 8c723b3..db2f282 100644 --- a/src/acpica/source/components/debugger/dbcmds.c +++ b/src/acpica/source/components/debugger/dbcmds.c @@ -183,7 +183,7 @@ AcpiDbConvertToNode ( { /* Numeric argument, convert */ - Address = ACPI_STRTOUL (InString, NULL, 16); + Address = strtoul (InString, NULL, 16); Node = ACPI_TO_POINTER (Address); if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE))) { @@ -261,7 +261,7 @@ AcpiDbSleep ( /* Convert argument to binary and invoke the sleep state */ - SleepState = (UINT8) ACPI_STRTOUL (ObjectArg, NULL, 0); + SleepState = (UINT8) strtoul (ObjectArg, NULL, 0); AcpiDbDoOneSleepState (SleepState); return_ACPI_STATUS (AE_OK); } @@ -633,7 +633,7 @@ AcpiDbDisplayInterfaces ( /* Install - install an interface */ - SubString = ACPI_STRSTR ("INSTALL", ActionArg); + SubString = strstr ("INSTALL", ActionArg); if (SubString) { Status = AcpiInstallInterface (InterfaceNameArg); @@ -647,7 +647,7 @@ AcpiDbDisplayInterfaces ( /* Remove - remove an interface */ - SubString = ACPI_STRSTR ("REMOVE", ActionArg); + SubString = strstr ("REMOVE", ActionArg); if (SubString) { Status = AcpiRemoveInterface (InterfaceNameArg); @@ -808,7 +808,7 @@ AcpiDmCompareAmlResources ( /* Check for descriptor byte match */ - else if (ACPI_MEMCMP (Aml1, Aml2, Aml1Length)) + else if (memcmp (Aml1, Aml2, Aml1Length)) { AcpiOsPrintf ( "**** Data mismatch in descriptor [%.2X] type %2.2X, Offset %8.8X ****\n", @@ -1210,7 +1210,7 @@ AcpiDbDisplayResources ( /* Asterisk means "display resources for all devices" */ - if (!ObjectArg || (!ACPI_STRCMP (ObjectArg, "*"))) + if (!ObjectArg || (!strcmp (ObjectArg, "*"))) { (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, AcpiDbDeviceResources, NULL, NULL, NULL); @@ -1263,7 +1263,7 @@ AcpiDbGenerateGpe ( ACPI_GPE_EVENT_INFO *GpeEventInfo; - GpeNumber = ACPI_STRTOUL (GpeArg, NULL, 0); + GpeNumber = strtoul (GpeArg, NULL, 0); /* * If no block arg, or block arg == 0 or 1, use the FADT-defined @@ -1271,7 +1271,7 @@ AcpiDbGenerateGpe ( */ if (BlockArg) { - BlockNumber = ACPI_STRTOUL (BlockArg, NULL, 0); + BlockNumber = strtoul (BlockArg, NULL, 0); if (BlockNumber == 1) { BlockNumber = 0; diff --git a/src/acpica/source/components/debugger/dbconvert.c b/src/acpica/source/components/debugger/dbconvert.c index 14caa2b..7e5ea39 100644 --- a/src/acpica/source/components/debugger/dbconvert.c +++ b/src/acpica/source/components/debugger/dbconvert.c @@ -149,7 +149,7 @@ AcpiDbHexCharToValue ( /* Digit must be ascii [0-9a-fA-F] */ - if (!ACPI_IS_XDIGIT (HexChar)) + if (!isxdigit (HexChar)) { return (AE_BAD_HEX_CONSTANT); } @@ -160,7 +160,7 @@ AcpiDbHexCharToValue ( } else { - Value = (UINT8) (ACPI_TOUPPER (HexChar) - 0x37); + Value = (UINT8) (toupper (HexChar) - 0x37); } *ReturnValue = Value; @@ -378,7 +378,7 @@ AcpiDbConvertToObject ( Object->Type = ACPI_TYPE_STRING; Object->String.Pointer = String; - Object->String.Length = (UINT32) ACPI_STRLEN (String); + Object->String.Length = (UINT32) strlen (String); break; case ACPI_TYPE_BUFFER: @@ -543,7 +543,7 @@ AcpiDbDumpPldBuffer ( /* The two bit-packed buffers should match */ - if (ACPI_MEMCMP (NewBuffer, BufferDesc->Buffer.Pointer, + if (memcmp (NewBuffer, BufferDesc->Buffer.Pointer, BufferDesc->Buffer.Length)) { AcpiOsPrintf ("Converted _PLD buffer does not compare. New:\n"); diff --git a/src/acpica/source/components/debugger/dbdisply.c b/src/acpica/source/components/debugger/dbdisply.c index 04a7591..e8ea451 100644 --- a/src/acpica/source/components/debugger/dbdisply.c +++ b/src/acpica/source/components/debugger/dbdisply.c @@ -213,7 +213,7 @@ AcpiDbGetPointer ( ACPI_SIZE Address; - Address = ACPI_STRTOUL (Target, NULL, 16); + Address = strtoul (Target, NULL, 16); ObjPtr = ACPI_TO_POINTER (Address); return (ObjPtr); } diff --git a/src/acpica/source/components/debugger/dbexec.c b/src/acpica/source/components/debugger/dbexec.c index c865c47..54d535a 100644 --- a/src/acpica/source/components/debugger/dbexec.c +++ b/src/acpica/source/components/debugger/dbexec.c @@ -505,15 +505,15 @@ AcpiDbExecute ( } else { - NameString = ACPI_ALLOCATE (ACPI_STRLEN (Name) + 1); + NameString = ACPI_ALLOCATE (strlen (Name) + 1); if (!NameString) { return; } - ACPI_MEMSET (&AcpiGbl_DbMethodInfo, 0, sizeof (ACPI_DB_METHOD_INFO)); + memset (&AcpiGbl_DbMethodInfo, 0, sizeof (ACPI_DB_METHOD_INFO)); - ACPI_STRCPY (NameString, Name); + strcpy (NameString, Name); AcpiUtStrupr (NameString); AcpiGbl_DbMethodInfo.Name = NameString; AcpiGbl_DbMethodInfo.Args = Args; @@ -741,8 +741,8 @@ AcpiDbCreateExecutionThreads ( /* Get the arguments */ - NumThreads = ACPI_STRTOUL (NumThreadsArg, NULL, 0); - NumLoops = ACPI_STRTOUL (NumLoopsArg, NULL, 0); + NumThreads = strtoul (NumThreadsArg, NULL, 0); + NumLoops = strtoul (NumLoopsArg, NULL, 0); if (!NumThreads || !NumLoops) { @@ -786,7 +786,7 @@ AcpiDbCreateExecutionThreads ( return; } - ACPI_MEMSET (&AcpiGbl_DbMethodInfo, 0, sizeof (ACPI_DB_METHOD_INFO)); + memset (&AcpiGbl_DbMethodInfo, 0, sizeof (ACPI_DB_METHOD_INFO)); /* Array to store IDs of threads */ @@ -801,7 +801,7 @@ AcpiDbCreateExecutionThreads ( (void) AcpiOsDeleteSemaphore (InfoGate); return; } - ACPI_MEMSET (AcpiGbl_DbMethodInfo.Threads, 0, Size); + memset (AcpiGbl_DbMethodInfo.Threads, 0, Size); /* Setup the context to be passed to each thread */ diff --git a/src/acpica/source/components/debugger/dbfileio.c b/src/acpica/source/components/debugger/dbfileio.c index dc55c6e..bc45b1a 100644 --- a/src/acpica/source/components/debugger/dbfileio.c +++ b/src/acpica/source/components/debugger/dbfileio.c @@ -184,7 +184,7 @@ AcpiDbOpenDebugFile ( } AcpiOsPrintf ("Debug output file %s opened\n", Name); - ACPI_STRNCPY (AcpiGbl_DbDebugFilename, Name, + strncpy (AcpiGbl_DbDebugFilename, Name, sizeof (AcpiGbl_DbDebugFilename)); AcpiGbl_DbOutputToFile = TRUE; diff --git a/src/acpica/source/components/debugger/dbhistry.c b/src/acpica/source/components/debugger/dbhistry.c index ad11d4f..3e52d9b 100644 --- a/src/acpica/source/components/debugger/dbhistry.c +++ b/src/acpica/source/components/debugger/dbhistry.c @@ -164,7 +164,7 @@ AcpiDbAddToHistory ( /* Put command into the next available slot */ - CmdLen = (UINT16) ACPI_STRLEN (CommandLine); + CmdLen = (UINT16) strlen (CommandLine); if (!CmdLen) { return; @@ -172,7 +172,7 @@ AcpiDbAddToHistory ( if (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command != NULL) { - BufferLen = (UINT16) ACPI_STRLEN ( + BufferLen = (UINT16) strlen ( AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command); if (CmdLen > BufferLen) { @@ -188,7 +188,7 @@ AcpiDbAddToHistory ( AcpiOsAllocate (CmdLen + 1); } - ACPI_STRCPY (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command, + strcpy (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command, CommandLine); AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].CmdNum = @@ -289,7 +289,7 @@ AcpiDbGetFromHistory ( else { - CmdNum = ACPI_STRTOUL (CommandNumArg, NULL, 0); + CmdNum = strtoul (CommandNumArg, NULL, 0); } return (AcpiDbGetHistoryByIndex (CmdNum)); diff --git a/src/acpica/source/components/debugger/dbinput.c b/src/acpica/source/components/debugger/dbinput.c index 573f384..b9a403e 100644 --- a/src/acpica/source/components/debugger/dbinput.c +++ b/src/acpica/source/components/debugger/dbinput.c @@ -433,7 +433,7 @@ AcpiDbMatchCommandHelp ( while ((*Command) && (*Invocation) && (*Invocation != ' ')) { - if (ACPI_TOLOWER (*Command) != ACPI_TOLOWER (*Invocation)) + if (tolower (*Command) != tolower (*Invocation)) { return (FALSE); } @@ -774,7 +774,7 @@ AcpiDbMatchCommand ( for (i = CMD_FIRST_VALID; AcpiGbl_DbCommands[i].Name; i++) { - if (ACPI_STRSTR (AcpiGbl_DbCommands[i].Name, UserCommand) == + if (strstr (AcpiGbl_DbCommands[i].Name, UserCommand) == AcpiGbl_DbCommands[i].Name) { return (i); @@ -1018,7 +1018,7 @@ AcpiDbCommandDispatch ( else if (ParamCount == 2) { Temp = AcpiGbl_DbConsoleDebugLevel; - AcpiGbl_DbConsoleDebugLevel = ACPI_STRTOUL (AcpiGbl_DbArgs[1], + AcpiGbl_DbConsoleDebugLevel = strtoul (AcpiGbl_DbArgs[1], NULL, 16); AcpiOsPrintf ( "Debug Level for console output was %8.8lX, now %8.8lX\n", @@ -1027,7 +1027,7 @@ AcpiDbCommandDispatch ( else { Temp = AcpiGbl_DbDebugLevel; - AcpiGbl_DbDebugLevel = ACPI_STRTOUL (AcpiGbl_DbArgs[1], NULL, 16); + AcpiGbl_DbDebugLevel = strtoul (AcpiGbl_DbArgs[1], NULL, 16); AcpiOsPrintf ( "Debug Level for file output was %8.8lX, now %8.8lX\n", Temp, AcpiGbl_DbDebugLevel); @@ -1066,7 +1066,7 @@ AcpiDbCommandDispatch ( case CMD_NOTIFY: - Temp = ACPI_STRTOUL (AcpiGbl_DbArgs[2], NULL, 0); + Temp = strtoul (AcpiGbl_DbArgs[2], NULL, 0); AcpiDbSendNotify (AcpiGbl_DbArgs[1], Temp); break; diff --git a/src/acpica/source/components/debugger/dbmethod.c b/src/acpica/source/components/debugger/dbmethod.c index 056da77..f6c9c51 100644 --- a/src/acpica/source/components/debugger/dbmethod.c +++ b/src/acpica/source/components/debugger/dbmethod.c @@ -161,7 +161,7 @@ AcpiDbSetMethodBreakpoint ( /* Get and verify the breakpoint address */ - Address = ACPI_STRTOUL (Location, NULL, 16); + Address = strtoul (Location, NULL, 16); if (Address <= Op->Common.AmlOffset) { AcpiOsPrintf ("Breakpoint %X is beyond current address %X\n", @@ -246,7 +246,7 @@ AcpiDbSetMethodData ( return; } - Value = ACPI_STRTOUL (ValueArg, NULL, 16); + Value = strtoul (ValueArg, NULL, 16); if (Type == 'N') { @@ -268,7 +268,7 @@ AcpiDbSetMethodData ( /* Get the index and value */ - Index = ACPI_STRTOUL (IndexArg, NULL, 16); + Index = strtoul (IndexArg, NULL, 16); WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList); if (!WalkState) @@ -376,7 +376,7 @@ AcpiDbDisassembleAml ( if (Statements) { - NumStatements = ACPI_STRTOUL (Statements, NULL, 0); + NumStatements = strtoul (Statements, NULL, 0); } AcpiDmDisassemble (NULL, Op, NumStatements); diff --git a/src/acpica/source/components/debugger/dbnames.c b/src/acpica/source/components/debugger/dbnames.c index ccaa672..7d936c8 100644 --- a/src/acpica/source/components/debugger/dbnames.c +++ b/src/acpica/source/components/debugger/dbnames.c @@ -320,7 +320,7 @@ AcpiDbDumpNamespace ( if (DepthArg) { - MaxDepth = ACPI_STRTOUL (DepthArg, NULL, 0); + MaxDepth = strtoul (DepthArg, NULL, 0); } } @@ -391,13 +391,13 @@ AcpiDbDumpNamespaceByOwner ( ACPI_OWNER_ID OwnerId; - OwnerId = (ACPI_OWNER_ID) ACPI_STRTOUL (OwnerArg, NULL, 0); + OwnerId = (ACPI_OWNER_ID) strtoul (OwnerArg, NULL, 0); /* Now we can check for the depth argument */ if (DepthArg) { - MaxDepth = ACPI_STRTOUL (DepthArg, NULL, 0); + MaxDepth = strtoul (DepthArg, NULL, 0); } AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT); @@ -498,7 +498,7 @@ AcpiDbFindNameInNamespace ( char *AcpiNamePtr = AcpiName; - if (ACPI_STRLEN (NameArg) > 4) + if (strlen (NameArg) > 4) { AcpiOsPrintf ("Name must be no longer than 4 characters\n"); return (AE_OK); @@ -902,7 +902,7 @@ AcpiDbFindReferences ( /* Convert string to object pointer */ - Address = ACPI_STRTOUL (ObjectArg, NULL, 16); + Address = strtoul (ObjectArg, NULL, 16); ObjDesc = ACPI_TO_POINTER (Address); /* Search all nodes in namespace */ diff --git a/src/acpica/source/components/debugger/dbtest.c b/src/acpica/source/components/debugger/dbtest.c index 26bfc1c..40fab5c 100644 --- a/src/acpica/source/components/debugger/dbtest.c +++ b/src/acpica/source/components/debugger/dbtest.c @@ -718,7 +718,7 @@ AcpiDbTestBufferType ( * count is not an integral number of bytes. Zero out the * unused bits. */ - ACPI_MEMSET (Buffer, BUFFER_FILL_VALUE, ByteLength); + memset (Buffer, BUFFER_FILL_VALUE, ByteLength); ExtraBits = BitLength % 8; if (ExtraBits) { @@ -743,7 +743,7 @@ AcpiDbTestBufferType ( goto Exit; } - if (ACPI_MEMCMP (Temp2->Buffer.Pointer, Buffer, ByteLength)) + if (memcmp (Temp2->Buffer.Pointer, Buffer, ByteLength)) { AcpiOsPrintf (" MISMATCH 2: New buffer value"); } @@ -767,7 +767,7 @@ AcpiDbTestBufferType ( goto Exit; } - if (ACPI_MEMCMP (Temp1->Buffer.Pointer, Temp3->Buffer.Pointer, ByteLength)) + if (memcmp (Temp1->Buffer.Pointer, Temp3->Buffer.Pointer, ByteLength)) { AcpiOsPrintf (" MISMATCH 3: While restoring original buffer"); } @@ -823,7 +823,7 @@ AcpiDbTestStringType ( /* Write a new value */ WriteValue.Type = ACPI_TYPE_STRING; - WriteValue.String.Length = ACPI_STRLEN (ValueToWrite); + WriteValue.String.Length = strlen (ValueToWrite); WriteValue.String.Pointer = ValueToWrite; Status = AcpiDbWriteToObject (Node, &WriteValue); @@ -840,7 +840,7 @@ AcpiDbTestStringType ( goto Exit; } - if (ACPI_STRCMP (Temp2->String.Pointer, ValueToWrite)) + if (strcmp (Temp2->String.Pointer, ValueToWrite)) { AcpiOsPrintf (" MISMATCH 2: %s, expecting %s", Temp2->String.Pointer, ValueToWrite); @@ -848,7 +848,7 @@ AcpiDbTestStringType ( /* Write back the original value */ - WriteValue.String.Length = ACPI_STRLEN (Temp1->String.Pointer); + WriteValue.String.Length = strlen (Temp1->String.Pointer); WriteValue.String.Pointer = Temp1->String.Pointer; Status = AcpiDbWriteToObject (Node, &WriteValue); @@ -865,7 +865,7 @@ AcpiDbTestStringType ( goto Exit; } - if (ACPI_STRCMP (Temp1->String.Pointer, Temp3->String.Pointer)) + if (strcmp (Temp1->String.Pointer, Temp3->String.Pointer)) { AcpiOsPrintf (" MISMATCH 3: %s, expecting %s", Temp3->String.Pointer, Temp1->String.Pointer); @@ -998,7 +998,7 @@ AcpiDbWriteToObject ( /* Copy the incoming user parameter */ - ACPI_MEMCPY (&Params[1], Value, sizeof (ACPI_OBJECT)); + memcpy (&Params[1], Value, sizeof (ACPI_OBJECT)); ParamObjects.Count = 2; ParamObjects.Pointer = Params; @@ -1042,7 +1042,7 @@ AcpiDbEvaluateAllPredefinedNames ( if (CountArg) { - Info.MaxCount = ACPI_STRTOUL (CountArg, NULL, 0); + Info.MaxCount = strtoul (CountArg, NULL, 0); } /* Search all nodes in namespace */ @@ -1149,7 +1149,7 @@ AcpiDbEvaluateOnePredefinedName ( case ACPI_TYPE_STRING: ThisParam->String.Pointer = "This is the default argument string"; - ThisParam->String.Length = ACPI_STRLEN (ThisParam->String.Pointer); + ThisParam->String.Length = strlen (ThisParam->String.Pointer); break; case ACPI_TYPE_BUFFER: diff --git a/src/acpica/source/components/debugger/dbutils.c b/src/acpica/source/components/debugger/dbutils.c index fd3445c..5c85a15 100644 --- a/src/acpica/source/components/debugger/dbutils.c +++ b/src/acpica/source/components/debugger/dbutils.c @@ -168,7 +168,7 @@ AcpiDbMatchArgument ( for (i = 0; Arguments[i].Name; i++) { - if (ACPI_STRSTR (Arguments[i].Name, UserArgument) == Arguments[i].Name) + if (strstr (Arguments[i].Name, UserArgument) == Arguments[i].Name) { return (i); } @@ -447,7 +447,7 @@ AcpiDbUint32ToHexString ( if (Value == 0) { - ACPI_STRCPY (Buffer, "0"); + strcpy (Buffer, "0"); return; } diff --git a/src/acpica/source/components/debugger/dbxface.c b/src/acpica/source/components/debugger/dbxface.c index 542319f..673178f 100644 --- a/src/acpica/source/components/debugger/dbxface.c +++ b/src/acpica/source/components/debugger/dbxface.c @@ -503,7 +503,7 @@ AcpiDbInitialize ( { return_ACPI_STATUS (AE_NO_MEMORY); } - ACPI_MEMSET (AcpiGbl_DbBuffer, 0, ACPI_DEBUG_BUFFER_SIZE); + memset (AcpiGbl_DbBuffer, 0, ACPI_DEBUG_BUFFER_SIZE); /* Initial scope is the root */ diff --git a/src/acpica/source/components/disassembler/dmbuffer.c b/src/acpica/source/components/disassembler/dmbuffer.c index 8ad879c..f4fee3d 100644 --- a/src/acpica/source/components/disassembler/dmbuffer.c +++ b/src/acpica/source/components/disassembler/dmbuffer.c @@ -277,7 +277,7 @@ AcpiDmDisasmByteList ( } BufChar = ByteData[CurrentIndex]; - if (ACPI_IS_PRINT (BufChar)) + if (isprint (BufChar)) { AcpiOsPrintf ("%c", BufChar); } @@ -626,7 +626,7 @@ AcpiDmIsStringBuffer ( * they will be handled in the string output routine */ - if (!ACPI_IS_PRINT (ByteData[i])) + if (!isprint (ByteData[i])) { return (FALSE); } @@ -908,7 +908,7 @@ AcpiDmUnicode ( { AcpiOsPrintf ("\\%c", OutputValue); } - else if (!ACPI_IS_PRINT (OutputValue)) + else if (!isprint (OutputValue)) { AcpiOsPrintf ("\\x%2.2X", OutputValue); } @@ -974,7 +974,7 @@ AcpiDmGetHardwareIdType ( for (i = 0; i < 3; i++) { if (!ACPI_IS_ASCII (Prefix[i]) || - !ACPI_IS_ALPHA (Prefix[i])) + !isalpha (Prefix[i])) { return; } diff --git a/src/acpica/source/components/disassembler/dmcstyle.c b/src/acpica/source/components/disassembler/dmcstyle.c index 951af09..9584052 100644 --- a/src/acpica/source/components/disassembler/dmcstyle.c +++ b/src/acpica/source/components/disassembler/dmcstyle.c @@ -409,23 +409,70 @@ AcpiDmCheckForSymbolicOpcode ( */ AcpiDmPromoteTarget (Op, Target); - /* - * Check for possible conversion to a "Compound Assignment". - * - * Determine if either operand is the same as the target - * and display compound assignment operator and other operand. - */ - if ((AcpiDmIsTargetAnOperand (Target, Child1, TRUE)) || - (AcpiDmIsTargetAnOperand (Target, Child2, TRUE))) + /* Check operands for conversion to a "Compound Assignment" */ + + switch (Op->Common.AmlOpcode) { - Target->Common.OperatorSymbol = - AcpiDmGetCompoundSymbol (Op->Common.AmlOpcode); + /* Commutative operators */ + + case AML_ADD_OP: + case AML_MULTIPLY_OP: + case AML_BIT_AND_OP: + case AML_BIT_OR_OP: + case AML_BIT_XOR_OP: + /* + * For the commutative operators, we can convert to a + * compound statement only if at least one (either) operand + * is the same as the target. + * + * Add (A, B, A) --> A += B + * Add (B, A, A) --> A += B + * Add (B, C, A) --> A = (B + C) + */ + if ((AcpiDmIsTargetAnOperand (Target, Child1, TRUE)) || + (AcpiDmIsTargetAnOperand (Target, Child2, TRUE))) + { + Target->Common.OperatorSymbol = + AcpiDmGetCompoundSymbol (Op->Common.AmlOpcode); - /* Convert operator to compound assignment */ + /* Convert operator to compound assignment */ - Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND; - Child1->Common.OperatorSymbol = NULL; - return (TRUE); + Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND; + Child1->Common.OperatorSymbol = NULL; + return (TRUE); + } + break; + + /* Non-commutative operators */ + + case AML_SUBTRACT_OP: + case AML_DIVIDE_OP: + case AML_MOD_OP: + case AML_SHIFT_LEFT_OP: + case AML_SHIFT_RIGHT_OP: + /* + * For the non-commutative operators, we can convert to a + * compound statement only if the target is the same as the + * first operand. + * + * Subtract (A, B, A) --> A -= B + * Subtract (B, A, A) --> A = (B - A) + */ + if ((AcpiDmIsTargetAnOperand (Target, Child1, TRUE))) + { + Target->Common.OperatorSymbol = + AcpiDmGetCompoundSymbol (Op->Common.AmlOpcode); + + /* Convert operator to compound assignment */ + + Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND; + Child1->Common.OperatorSymbol = NULL; + return (TRUE); + } + break; + + default: + break; } /* @@ -495,8 +542,12 @@ AcpiDmCheckForSymbolicOpcode ( * source so that the target is processed first. */ Target = Child1->Common.Next; - AcpiDmPromoteTarget (Op, Target); + if (!Target) + { + return (FALSE); + } + AcpiDmPromoteTarget (Op, Target); if (!Target->Common.OperatorSymbol) { Target->Common.OperatorSymbol = " = "; @@ -746,7 +797,8 @@ AcpiDmPromoteTarget ( * * DESCRIPTION: Determine if a Target Op is a placeholder Op or a real Target. * In other words, determine if the optional target is used or - * not. + * not. Note: If Target is NULL, something is seriously wrong, + * probably with the parse tree. * ******************************************************************************/ @@ -755,6 +807,11 @@ AcpiDmIsValidTarget ( ACPI_PARSE_OBJECT *Target) { + if (!Target) + { + return (FALSE); + } + if ((Target->Common.AmlOpcode == AML_INT_NAMEPATH_OP) && (Target->Common.Value.Arg == NULL)) { diff --git a/src/acpica/source/components/disassembler/dmopcode.c b/src/acpica/source/components/disassembler/dmopcode.c index 72cb99c..f2bd41e 100644 --- a/src/acpica/source/components/disassembler/dmopcode.c +++ b/src/acpica/source/components/disassembler/dmopcode.c @@ -341,10 +341,10 @@ AcpiDmPredefinedDescription ( * Note: NameString is guaranteed to be upper case here. */ LastCharIsDigit = - (ACPI_IS_DIGIT (NameString[3])); /* d */ + (isdigit (NameString[3])); /* d */ LastCharsAreHex = - (ACPI_IS_XDIGIT (NameString[2]) && /* xx */ - ACPI_IS_XDIGIT (NameString[3])); + (isxdigit (NameString[2]) && /* xx */ + isxdigit (NameString[3])); switch (NameString[1]) { diff --git a/src/acpica/source/components/dispatcher/dsfield.c b/src/acpica/source/components/dispatcher/dsfield.c index 37d4cc1..cf8c189 100644 --- a/src/acpica/source/components/dispatcher/dsfield.c +++ b/src/acpica/source/components/dispatcher/dsfield.c @@ -602,7 +602,7 @@ AcpiDsCreateField ( } } - ACPI_MEMSET (&Info, 0, sizeof (ACPI_CREATE_FIELD_INFO)); + memset (&Info, 0, sizeof (ACPI_CREATE_FIELD_INFO)); /* Second arg is the field flags */ diff --git a/src/acpica/source/components/dispatcher/dsinit.c b/src/acpica/source/components/dispatcher/dsinit.c index 585e127..2cd5c4e 100644 --- a/src/acpica/source/components/dispatcher/dsinit.c +++ b/src/acpica/source/components/dispatcher/dsinit.c @@ -296,7 +296,7 @@ AcpiDsInitializeObjects ( /* Set all init info to zero */ - ACPI_MEMSET (&Info, 0, sizeof (ACPI_INIT_WALK_INFO)); + memset (&Info, 0, sizeof (ACPI_INIT_WALK_INFO)); Info.OwnerId = OwnerId; Info.TableIndex = TableIndex; diff --git a/src/acpica/source/components/dispatcher/dsobject.c b/src/acpica/source/components/dispatcher/dsobject.c index b5cad38..0eb2f44 100644 --- a/src/acpica/source/components/dispatcher/dsobject.c +++ b/src/acpica/source/components/dispatcher/dsobject.c @@ -420,7 +420,7 @@ AcpiDsBuildInternalBufferObj ( if (ByteList) { - ACPI_MEMCPY (ObjDesc->Buffer.Pointer, ByteList->Named.Data, + memcpy (ObjDesc->Buffer.Pointer, ByteList->Named.Data, ByteListLength); } } @@ -847,7 +847,7 @@ AcpiDsInitObjectFromOp ( case ACPI_TYPE_STRING: ObjDesc->String.Pointer = Op->Common.Value.String; - ObjDesc->String.Length = (UINT32) ACPI_STRLEN (Op->Common.Value.String); + ObjDesc->String.Length = (UINT32) strlen (Op->Common.Value.String); /* * The string is contained in the ACPI table, don't ever try diff --git a/src/acpica/source/components/dispatcher/dsutils.c b/src/acpica/source/components/dispatcher/dsutils.c index 0269916..0ba26fa 100644 --- a/src/acpica/source/components/dispatcher/dsutils.c +++ b/src/acpica/source/components/dispatcher/dsutils.c @@ -677,7 +677,7 @@ AcpiDsCreateOperand ( ObjDesc = AcpiUtCreateStringObject ((ACPI_SIZE) NameLength); - ACPI_STRNCPY (ObjDesc->String.Pointer, NameString, NameLength); + strncpy (ObjDesc->String.Pointer, NameString, NameLength); Status = AE_OK; } else diff --git a/src/acpica/source/components/dispatcher/dswload.c b/src/acpica/source/components/dispatcher/dswload.c index be090fc..a1327ba 100644 --- a/src/acpica/source/components/dispatcher/dswload.c +++ b/src/acpica/source/components/dispatcher/dswload.c @@ -397,9 +397,18 @@ AcpiDsLoad1BeginOp ( if ((WalkState->Opcode != AML_SCOPE_OP) && (!(WalkState->ParseFlags & ACPI_PARSE_DEFERRED_OP))) { - Flags |= ACPI_NS_ERROR_IF_FOUND; - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Cannot already exist\n", - AcpiUtGetTypeName (ObjectType))); + if (WalkState->NamespaceOverride) + { + Flags |= ACPI_NS_OVERRIDE_IF_FOUND; + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Override allowed\n", + AcpiUtGetTypeName (ObjectType))); + } + else + { + Flags |= ACPI_NS_ERROR_IF_FOUND; + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Cannot already exist\n", + AcpiUtGetTypeName (ObjectType))); + } } else { diff --git a/src/acpica/source/components/events/evgpe.c b/src/acpica/source/components/events/evgpe.c index 16428d6..4dceaa4 100644 --- a/src/acpica/source/components/events/evgpe.c +++ b/src/acpica/source/components/events/evgpe.c @@ -176,6 +176,7 @@ AcpiEvUpdateGpeEnableMask ( { ACPI_SET_BIT (GpeRegisterInfo->EnableForRun, (UINT8) RegisterBit); } + GpeRegisterInfo->EnableMask = GpeRegisterInfo->EnableForRun; return_ACPI_STATUS (AE_OK); } @@ -213,7 +214,7 @@ AcpiEvEnableGpe ( /* Enable the requested GPE */ - Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE_SAVE); + Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE); return_ACPI_STATUS (Status); } @@ -303,7 +304,7 @@ AcpiEvRemoveGpeReference ( Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo); if (ACPI_SUCCESS (Status)) { - Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE_SAVE); + Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE); } if (ACPI_FAILURE (Status)) diff --git a/src/acpica/source/components/events/evgpeinit.c b/src/acpica/source/components/events/evgpeinit.c index 5848b75..bf3c6e5 100644 --- a/src/acpica/source/components/events/evgpeinit.c +++ b/src/acpica/source/components/events/evgpeinit.c @@ -467,7 +467,7 @@ AcpiEvMatchGpeMethod ( /* 4) The last two characters of the name are the hex GPE Number */ - GpeNumber = ACPI_STRTOUL (&Name[2], NULL, 16); + GpeNumber = strtoul (&Name[2], NULL, 16); if (GpeNumber == ACPI_UINT32_MAX) { /* Conversion failed; invalid method, just ignore it */ diff --git a/src/acpica/source/components/executer/exconfig.c b/src/acpica/source/components/executer/exconfig.c index c311a69..9580bc0 100644 --- a/src/acpica/source/components/executer/exconfig.c +++ b/src/acpica/source/components/executer/exconfig.c @@ -588,7 +588,7 @@ AcpiExLoadOp ( return_ACPI_STATUS (AE_NO_MEMORY); } - ACPI_MEMCPY (Table, TableHeader, Length); + memcpy (Table, TableHeader, Length); break; default: diff --git a/src/acpica/source/components/executer/exconvrt.c b/src/acpica/source/components/executer/exconvrt.c index 1cf54e2..0023668 100644 --- a/src/acpica/source/components/executer/exconvrt.c +++ b/src/acpica/source/components/executer/exconvrt.c @@ -323,7 +323,7 @@ AcpiExConvertToBuffer ( /* Copy the integer to the buffer, LSB first */ NewBuf = ReturnDesc->Buffer.Pointer; - ACPI_MEMCPY (NewBuf, + memcpy (NewBuf, &ObjDesc->Integer.Value, AcpiGbl_IntegerByteWidth); break; @@ -348,7 +348,7 @@ AcpiExConvertToBuffer ( /* Copy the string to the buffer */ NewBuf = ReturnDesc->Buffer.Pointer; - ACPI_STRNCPY ((char *) NewBuf, (char *) ObjDesc->String.Pointer, + strncpy ((char *) NewBuf, (char *) ObjDesc->String.Pointer, ObjDesc->String.Length); break; diff --git a/src/acpica/source/components/executer/exdebug.c b/src/acpica/source/components/executer/exdebug.c index 64fef55..79ca96c 100644 --- a/src/acpica/source/components/executer/exdebug.c +++ b/src/acpica/source/components/executer/exdebug.c @@ -153,6 +153,8 @@ AcpiExDoDebugObject ( { UINT32 i; UINT32 Timer; + ACPI_OPERAND_OBJECT *ObjectDesc; + UINT32 Value; ACPI_FUNCTION_TRACE_PTR (ExDoDebugObject, SourceDesc); @@ -339,8 +341,37 @@ AcpiExDoDebugObject ( } else { - AcpiExDoDebugObject (SourceDesc->Reference.Object, - Level+4, 0); + ObjectDesc = SourceDesc->Reference.Object; + Value = SourceDesc->Reference.Value; + + switch (ObjectDesc->Common.Type) + { + case ACPI_TYPE_BUFFER: + + AcpiOsPrintf ("Buffer[%u] = 0x%2.2X\n", + Value, *SourceDesc->Reference.IndexPointer); + break; + + case ACPI_TYPE_STRING: + + AcpiOsPrintf ("String[%u] = \"%c\" (0x%2.2X)\n", + Value, *SourceDesc->Reference.IndexPointer, + *SourceDesc->Reference.IndexPointer); + break; + + case ACPI_TYPE_PACKAGE: + + AcpiOsPrintf ("Package[%u] = ", Value); + AcpiExDoDebugObject (*SourceDesc->Reference.Where, + Level+4, 0); + break; + + default: + + AcpiOsPrintf ("Unknown Reference object type %X\n", + ObjectDesc->Common.Type); + break; + } } } break; diff --git a/src/acpica/source/components/executer/exdump.c b/src/acpica/source/components/executer/exdump.c index 09930ed..bf9df64 100644 --- a/src/acpica/source/components/executer/exdump.c +++ b/src/acpica/source/components/executer/exdump.c @@ -310,7 +310,7 @@ static ACPI_EXDUMP_INFO AcpiExDumpIndexField[5] = {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (IndexField.DataObj), "Data Object"} }; -static ACPI_EXDUMP_INFO AcpiExDumpReference[8] = +static ACPI_EXDUMP_INFO AcpiExDumpReference[9] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpReference), NULL}, {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Reference.Class), "Class"}, @@ -319,6 +319,7 @@ static ACPI_EXDUMP_INFO AcpiExDumpReference[8] = {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Object), "Object Desc"}, {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Reference.Node), "Node"}, {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Where), "Where"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.IndexPointer), "Index Pointer"}, {ACPI_EXD_REFERENCE,0, NULL} }; @@ -1125,16 +1126,18 @@ AcpiExDumpReferenceObj ( { if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_OPERAND) { - AcpiOsPrintf (" Target: %p", ObjDesc->Reference.Object); + AcpiOsPrintf ("%22s %p", "Target :", + ObjDesc->Reference.Object); if (ObjDesc->Reference.Class == ACPI_REFCLASS_TABLE) { - AcpiOsPrintf (" Table Index: %X\n", ObjDesc->Reference.Value); + AcpiOsPrintf (" Table Index: %X\n", + ObjDesc->Reference.Value); } else { - AcpiOsPrintf (" Target: %p [%s]\n", ObjDesc->Reference.Object, + AcpiOsPrintf (" [%s]\n", AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT *) - ObjDesc->Reference.Object)->Common.Type)); + ObjDesc->Reference.Object)->Common.Type)); } } else diff --git a/src/acpica/source/components/executer/exfield.c b/src/acpica/source/components/executer/exfield.c index 3083985..dbd294b 100644 --- a/src/acpica/source/components/executer/exfield.c +++ b/src/acpica/source/components/executer/exfield.c @@ -532,7 +532,7 @@ AcpiExWriteDataToField ( } Buffer = BufferDesc->Buffer.Pointer; - ACPI_MEMCPY (Buffer, SourceDesc->Buffer.Pointer, Length); + memcpy (Buffer, SourceDesc->Buffer.Pointer, Length); /* Lock entire transaction if requested */ diff --git a/src/acpica/source/components/executer/exfldio.c b/src/acpica/source/components/executer/exfldio.c index cd0233d..39a0f37 100644 --- a/src/acpica/source/components/executer/exfldio.c +++ b/src/acpica/source/components/executer/exfldio.c @@ -528,7 +528,7 @@ AcpiExFieldDatumIo ( * Copy the data from the source buffer. * Length is the field width in bytes. */ - ACPI_MEMCPY (Value, + memcpy (Value, (ObjDesc->BufferField.BufferObj)->Buffer.Pointer + ObjDesc->BufferField.BaseByteOffset + FieldDatumByteOffset, @@ -540,7 +540,7 @@ AcpiExFieldDatumIo ( * Copy the data to the target buffer. * Length is the field width in bytes. */ - ACPI_MEMCPY ((ObjDesc->BufferField.BufferObj)->Buffer.Pointer + + memcpy ((ObjDesc->BufferField.BufferObj)->Buffer.Pointer + ObjDesc->BufferField.BaseByteOffset + FieldDatumByteOffset, Value, ObjDesc->CommonField.AccessByteWidth); @@ -820,7 +820,7 @@ AcpiExExtractFromField ( return_ACPI_STATUS (AE_BUFFER_OVERFLOW); } - ACPI_MEMSET (Buffer, 0, BufferLength); + memset (Buffer, 0, BufferLength); AccessBitWidth = ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth); /* Handle the simple case here */ @@ -837,7 +837,7 @@ AcpiExExtractFromField ( /* Use RawDatum (UINT64) to handle buffers < 64 bits */ Status = AcpiExFieldDatumIo (ObjDesc, 0, &RawDatum, ACPI_READ); - ACPI_MEMCPY (Buffer, &RawDatum, BufferLength); + memcpy (Buffer, &RawDatum, BufferLength); } return_ACPI_STATUS (Status); @@ -907,7 +907,7 @@ AcpiExExtractFromField ( /* Write merged datum to target buffer */ - ACPI_MEMCPY (((char *) Buffer) + BufferOffset, &MergedDatum, + memcpy (((char *) Buffer) + BufferOffset, &MergedDatum, ACPI_MIN(ObjDesc->CommonField.AccessByteWidth, BufferLength - BufferOffset)); @@ -925,7 +925,7 @@ AcpiExExtractFromField ( /* Write the last datum to the buffer */ - ACPI_MEMCPY (((char *) Buffer) + BufferOffset, &MergedDatum, + memcpy (((char *) Buffer) + BufferOffset, &MergedDatum, ACPI_MIN(ObjDesc->CommonField.AccessByteWidth, BufferLength - BufferOffset)); @@ -998,7 +998,7 @@ AcpiExInsertIntoField ( * at Byte zero. All unused (upper) bytes of the * buffer will be 0. */ - ACPI_MEMCPY ((char *) NewBuffer, (char *) Buffer, BufferLength); + memcpy ((char *) NewBuffer, (char *) Buffer, BufferLength); Buffer = NewBuffer; BufferLength = RequiredLength; } @@ -1041,7 +1041,7 @@ AcpiExInsertIntoField ( /* Get initial Datum from the input buffer */ - ACPI_MEMCPY (&RawDatum, Buffer, + memcpy (&RawDatum, Buffer, ACPI_MIN(ObjDesc->CommonField.AccessByteWidth, BufferLength - BufferOffset)); @@ -1093,7 +1093,7 @@ AcpiExInsertIntoField ( /* Get the next input datum from the buffer */ BufferOffset += ObjDesc->CommonField.AccessByteWidth; - ACPI_MEMCPY (&RawDatum, ((char *) Buffer) + BufferOffset, + memcpy (&RawDatum, ((char *) Buffer) + BufferOffset, ACPI_MIN(ObjDesc->CommonField.AccessByteWidth, BufferLength - BufferOffset)); diff --git a/src/acpica/source/components/executer/exmisc.c b/src/acpica/source/components/executer/exmisc.c index d92b271..f678670 100644 --- a/src/acpica/source/components/executer/exmisc.c +++ b/src/acpica/source/components/executer/exmisc.c @@ -298,8 +298,8 @@ AcpiExConcatTemplate ( * EndTag descriptor is copied from Operand1. */ NewBuf = ReturnDesc->Buffer.Pointer; - ACPI_MEMCPY (NewBuf, Operand0->Buffer.Pointer, Length0); - ACPI_MEMCPY (NewBuf + Length0, Operand1->Buffer.Pointer, Length1); + memcpy (NewBuf, Operand0->Buffer.Pointer, Length0); + memcpy (NewBuf + Length0, Operand1->Buffer.Pointer, Length1); /* Insert EndTag and set the checksum to zero, means "ignore checksum" */ @@ -413,12 +413,12 @@ AcpiExDoConcatenate ( /* Copy the first integer, LSB first */ - ACPI_MEMCPY (NewBuf, &Operand0->Integer.Value, + memcpy (NewBuf, &Operand0->Integer.Value, AcpiGbl_IntegerByteWidth); /* Copy the second integer (LSB first) after the first */ - ACPI_MEMCPY (NewBuf + AcpiGbl_IntegerByteWidth, + memcpy (NewBuf + AcpiGbl_IntegerByteWidth, &LocalOperand1->Integer.Value, AcpiGbl_IntegerByteWidth); break; @@ -440,8 +440,8 @@ AcpiExDoConcatenate ( /* Concatenate the strings */ - ACPI_STRCPY (NewBuf, Operand0->String.Pointer); - ACPI_STRCPY (NewBuf + Operand0->String.Length, + strcpy (NewBuf, Operand0->String.Pointer); + strcpy (NewBuf + Operand0->String.Length, LocalOperand1->String.Pointer); break; @@ -462,9 +462,9 @@ AcpiExDoConcatenate ( /* Concatenate the buffers */ - ACPI_MEMCPY (NewBuf, Operand0->Buffer.Pointer, + memcpy (NewBuf, Operand0->Buffer.Pointer, Operand0->Buffer.Length); - ACPI_MEMCPY (NewBuf + Operand0->Buffer.Length, + memcpy (NewBuf + Operand0->Buffer.Length, LocalOperand1->Buffer.Pointer, LocalOperand1->Buffer.Length); break; @@ -785,7 +785,7 @@ AcpiExDoLogicalOp ( /* Lexicographic compare: compare the data bytes */ - Compare = ACPI_MEMCMP (Operand0->Buffer.Pointer, + Compare = memcmp (Operand0->Buffer.Pointer, LocalOperand1->Buffer.Pointer, (Length0 > Length1) ? Length1 : Length0); diff --git a/src/acpica/source/components/executer/exnames.c b/src/acpica/source/components/executer/exnames.c index b402d3b..38ceba0 100644 --- a/src/acpica/source/components/executer/exnames.c +++ b/src/acpica/source/components/executer/exnames.c @@ -293,7 +293,7 @@ AcpiExNameSegment ( if (NameString) { - ACPI_STRCAT (NameString, CharBuf); + strcat (NameString, CharBuf); ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Appended to - %s\n", NameString)); } diff --git a/src/acpica/source/components/executer/exoparg2.c b/src/acpica/source/components/executer/exoparg2.c index 399b259..f1ab706 100644 --- a/src/acpica/source/components/executer/exoparg2.c +++ b/src/acpica/source/components/executer/exoparg2.c @@ -440,7 +440,7 @@ AcpiExOpcode_2A_1T_1R ( * Copy the raw buffer data with no transform. * (NULL terminated already) */ - ACPI_MEMCPY (ReturnDesc->String.Pointer, + memcpy (ReturnDesc->String.Pointer, Operand[0]->Buffer.Pointer, Length); break; @@ -484,6 +484,8 @@ AcpiExOpcode_2A_1T_1R ( } ReturnDesc->Reference.TargetType = ACPI_TYPE_BUFFER_FIELD; + ReturnDesc->Reference.IndexPointer = + &(Operand[0]->Buffer.Pointer [Index]); break; case ACPI_TYPE_BUFFER: @@ -495,6 +497,8 @@ AcpiExOpcode_2A_1T_1R ( } ReturnDesc->Reference.TargetType = ACPI_TYPE_BUFFER_FIELD; + ReturnDesc->Reference.IndexPointer = + &(Operand[0]->Buffer.Pointer [Index]); break; case ACPI_TYPE_PACKAGE: @@ -506,7 +510,8 @@ AcpiExOpcode_2A_1T_1R ( } ReturnDesc->Reference.TargetType = ACPI_TYPE_PACKAGE; - ReturnDesc->Reference.Where = &Operand[0]->Package.Elements [Index]; + ReturnDesc->Reference.Where = + &Operand[0]->Package.Elements [Index]; break; default: diff --git a/src/acpica/source/components/executer/exoparg3.c b/src/acpica/source/components/executer/exoparg3.c index b0928af..b2c49be 100644 --- a/src/acpica/source/components/executer/exoparg3.c +++ b/src/acpica/source/components/executer/exoparg3.c @@ -334,7 +334,7 @@ AcpiExOpcode_3A_1T_1R ( { /* We have a buffer, copy the portion requested */ - ACPI_MEMCPY (Buffer, Operand[0]->String.Pointer + Index, + memcpy (Buffer, Operand[0]->String.Pointer + Index, Length); } diff --git a/src/acpica/source/components/executer/exregion.c b/src/acpica/source/components/executer/exregion.c index 31bbb60..cf60500 100644 --- a/src/acpica/source/components/executer/exregion.c +++ b/src/acpica/source/components/executer/exregion.c @@ -630,13 +630,13 @@ AcpiExDataTableSpaceHandler ( { case ACPI_READ: - ACPI_MEMCPY (ACPI_CAST_PTR (char, Value), ACPI_PHYSADDR_TO_PTR (Address), + memcpy (ACPI_CAST_PTR (char, Value), ACPI_PHYSADDR_TO_PTR (Address), ACPI_DIV_8 (BitWidth)); break; case ACPI_WRITE: - ACPI_MEMCPY (ACPI_PHYSADDR_TO_PTR (Address), ACPI_CAST_PTR (char, Value), + memcpy (ACPI_PHYSADDR_TO_PTR (Address), ACPI_CAST_PTR (char, Value), ACPI_DIV_8 (BitWidth)); break; diff --git a/src/acpica/source/components/executer/exstorob.c b/src/acpica/source/components/executer/exstorob.c index 48c3440..8c23aee 100644 --- a/src/acpica/source/components/executer/exstorob.c +++ b/src/acpica/source/components/executer/exstorob.c @@ -181,8 +181,8 @@ AcpiExStoreBufferToBuffer ( { /* Clear existing buffer and copy in the new one */ - ACPI_MEMSET (TargetDesc->Buffer.Pointer, 0, TargetDesc->Buffer.Length); - ACPI_MEMCPY (TargetDesc->Buffer.Pointer, Buffer, Length); + memset (TargetDesc->Buffer.Pointer, 0, TargetDesc->Buffer.Length); + memcpy (TargetDesc->Buffer.Pointer, Buffer, Length); #ifdef ACPI_OBSOLETE_BEHAVIOR /* @@ -211,7 +211,7 @@ AcpiExStoreBufferToBuffer ( { /* Truncate the source, copy only what will fit */ - ACPI_MEMCPY (TargetDesc->Buffer.Pointer, Buffer, + memcpy (TargetDesc->Buffer.Pointer, Buffer, TargetDesc->Buffer.Length); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, @@ -275,9 +275,9 @@ AcpiExStoreStringToString ( * String will fit in existing non-static buffer. * Clear old string and copy in the new one */ - ACPI_MEMSET (TargetDesc->String.Pointer, 0, + memset (TargetDesc->String.Pointer, 0, (ACPI_SIZE) TargetDesc->String.Length + 1); - ACPI_MEMCPY (TargetDesc->String.Pointer, Buffer, Length); + memcpy (TargetDesc->String.Pointer, Buffer, Length); } else { @@ -301,7 +301,7 @@ AcpiExStoreStringToString ( } TargetDesc->Common.Flags &= ~AOPOBJ_STATIC_POINTER; - ACPI_MEMCPY (TargetDesc->String.Pointer, Buffer, Length); + memcpy (TargetDesc->String.Pointer, Buffer, Length); } /* Set the new target length */ diff --git a/src/acpica/source/components/executer/exutils.c b/src/acpica/source/components/executer/exutils.c index b432cba..90a791d 100644 --- a/src/acpica/source/components/executer/exutils.c +++ b/src/acpica/source/components/executer/exutils.c @@ -505,6 +505,43 @@ AcpiExIntegerToString ( /******************************************************************************* * + * FUNCTION: AcpiExPciClsToString + * + * PARAMETERS: OutString - Where to put the converted string (7 bytes) + * PARAMETERS: ClassCode - PCI class code to be converted (3 bytes) + * + * RETURN: None + * + * DESCRIPTION: Convert 3-bytes PCI class code to string representation. + * Return buffer must be large enough to hold the string. The + * string returned is always exactly of length + * ACPI_PCICLS_STRING_SIZE (includes null terminator). + * + ******************************************************************************/ + +void +AcpiExPciClsToString ( + char *OutString, + UINT8 ClassCode[3]) +{ + + ACPI_FUNCTION_ENTRY (); + + + /* All 3 bytes are hexadecimal */ + + OutString[0] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[0], 4); + OutString[1] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[0], 0); + OutString[2] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[1], 4); + OutString[3] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[1], 0); + OutString[4] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[2], 4); + OutString[5] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[2], 0); + OutString[6] = 0; +} + + +/******************************************************************************* + * * FUNCTION: AcpiIsValidSpaceId * * PARAMETERS: SpaceId - ID to be validated diff --git a/src/acpica/source/components/hardware/hwgpe.c b/src/acpica/source/components/hardware/hwgpe.c index c532689..1ab6965 100644 --- a/src/acpica/source/components/hardware/hwgpe.c +++ b/src/acpica/source/components/hardware/hwgpe.c @@ -169,6 +169,8 @@ AcpiHwGetGpeRegisterBit ( * RETURN: Status * * DESCRIPTION: Enable or disable a single GPE in the parent enable register. + * The EnableMask field of the involved GPE register must be + * updated by the caller if necessary. * ******************************************************************************/ @@ -205,7 +207,7 @@ AcpiHwLowSetGpe ( /* Set or clear just the bit that corresponds to this GPE */ RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo); - switch (Action & ~ACPI_GPE_SAVE_MASK) + switch (Action) { case ACPI_GPE_CONDITIONAL_ENABLE: @@ -237,10 +239,6 @@ AcpiHwLowSetGpe ( /* Write the updated enable mask */ Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress); - if (ACPI_SUCCESS (Status) && (Action & ACPI_GPE_SAVE_MASK)) - { - GpeRegisterInfo->EnableMask = (UINT8) EnableMask; - } return (Status); } @@ -406,11 +404,8 @@ AcpiHwGpeEnableWrite ( ACPI_STATUS Status; + GpeRegisterInfo->EnableMask = EnableMask; Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress); - if (ACPI_SUCCESS (Status)) - { - GpeRegisterInfo->EnableMask = EnableMask; - } return (Status); } diff --git a/src/acpica/source/components/hardware/hwxfsleep.c b/src/acpica/source/components/hardware/hwxfsleep.c index 2c7066b..9d33fd9 100644 --- a/src/acpica/source/components/hardware/hwxfsleep.c +++ b/src/acpica/source/components/hardware/hwxfsleep.c @@ -124,6 +124,12 @@ /* Local prototypes */ static ACPI_STATUS +AcpiHwSetFirmwareWakingVector ( + ACPI_TABLE_FACS *Facs, + ACPI_PHYSICAL_ADDRESS PhysicalAddress, + ACPI_PHYSICAL_ADDRESS PhysicalAddress64); + +static ACPI_STATUS AcpiHwSleepDispatch ( UINT8 SleepState, UINT32 FunctionId); @@ -149,29 +155,33 @@ static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[] = /* * These functions are removed for the ACPI_REDUCED_HARDWARE case: * AcpiSetFirmwareWakingVector - * AcpiSetFirmwareWakingVector64 * AcpiEnterSleepStateS4bios */ #if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * - * FUNCTION: AcpiSetFirmwareWakingVector + * FUNCTION: AcpiHwSetFirmwareWakingVector * - * PARAMETERS: PhysicalAddress - 32-bit physical address of ACPI real mode - * entry point. + * PARAMETERS: Facs - Pointer to FACS table + * PhysicalAddress - 32-bit physical address of ACPI real mode + * entry point + * PhysicalAddress64 - 64-bit physical address of ACPI protected + * entry point * * RETURN: Status * - * DESCRIPTION: Sets the 32-bit FirmwareWakingVector field of the FACS + * DESCRIPTION: Sets the FirmwareWakingVector fields of the FACS * ******************************************************************************/ -ACPI_STATUS -AcpiSetFirmwareWakingVector ( - UINT32 PhysicalAddress) +static ACPI_STATUS +AcpiHwSetFirmwareWakingVector ( + ACPI_TABLE_FACS *Facs, + ACPI_PHYSICAL_ADDRESS PhysicalAddress, + ACPI_PHYSICAL_ADDRESS PhysicalAddress64) { - ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector); + ACPI_FUNCTION_TRACE (AcpiHwSetFirmwareWakingVector); /* @@ -184,60 +194,73 @@ AcpiSetFirmwareWakingVector ( /* Set the 32-bit vector */ - AcpiGbl_FACS->FirmwareWakingVector = PhysicalAddress; - - /* Clear the 64-bit vector if it exists */ + Facs->FirmwareWakingVector = (UINT32) PhysicalAddress; - if ((AcpiGbl_FACS->Length > 32) && (AcpiGbl_FACS->Version >= 1)) + if (Facs->Length > 32) { - AcpiGbl_FACS->XFirmwareWakingVector = 0; + if (Facs->Version >= 1) + { + /* Set the 64-bit vector */ + + Facs->XFirmwareWakingVector = PhysicalAddress64; + } + else + { + /* Clear the 64-bit vector if it exists */ + + Facs->XFirmwareWakingVector = 0; + } } return_ACPI_STATUS (AE_OK); } -ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector) - -#if ACPI_MACHINE_WIDTH == 64 /******************************************************************************* * - * FUNCTION: AcpiSetFirmwareWakingVector64 + * FUNCTION: AcpiSetFirmwareWakingVector * - * PARAMETERS: PhysicalAddress - 64-bit physical address of ACPI protected - * mode entry point. + * PARAMETERS: PhysicalAddress - 32-bit physical address of ACPI real mode + * entry point + * PhysicalAddress64 - 64-bit physical address of ACPI protected + * entry point * * RETURN: Status * - * DESCRIPTION: Sets the 64-bit X_FirmwareWakingVector field of the FACS, if - * it exists in the table. This function is intended for use with - * 64-bit host operating systems. + * DESCRIPTION: Sets the FirmwareWakingVector fields of the FACS * ******************************************************************************/ ACPI_STATUS -AcpiSetFirmwareWakingVector64 ( - UINT64 PhysicalAddress) +AcpiSetFirmwareWakingVector ( + ACPI_PHYSICAL_ADDRESS PhysicalAddress, + ACPI_PHYSICAL_ADDRESS PhysicalAddress64) { - ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector64); + ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector); - /* Determine if the 64-bit vector actually exists */ + /* If Hardware Reduced flag is set, there is no FACS */ - if ((AcpiGbl_FACS->Length <= 32) || (AcpiGbl_FACS->Version < 1)) + if (AcpiGbl_ReducedHardware) { - return_ACPI_STATUS (AE_NOT_EXIST); + return (AE_OK); } - /* Clear 32-bit vector, set the 64-bit X_ vector */ + if (AcpiGbl_Facs32) + { + (void) AcpiHwSetFirmwareWakingVector (AcpiGbl_Facs32, + PhysicalAddress, PhysicalAddress64); + } + if (AcpiGbl_Facs64) + { + (void) AcpiHwSetFirmwareWakingVector (AcpiGbl_Facs64, + PhysicalAddress, PhysicalAddress64); + } - AcpiGbl_FACS->FirmwareWakingVector = 0; - AcpiGbl_FACS->XFirmwareWakingVector = PhysicalAddress; return_ACPI_STATUS (AE_OK); } -ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector64) -#endif +ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector) /******************************************************************************* diff --git a/src/acpica/source/components/namespace/nsaccess.c b/src/acpica/source/components/namespace/nsaccess.c index 58d56e5..6667308 100644 --- a/src/acpica/source/components/namespace/nsaccess.c +++ b/src/acpica/source/components/namespace/nsaccess.c @@ -183,7 +183,7 @@ AcpiNsRootInitialize ( { /* _OSI is optional for now, will be permanent later */ - if (!ACPI_STRCMP (InitVal->Name, "_OSI") && !AcpiGbl_CreateOsiMethod) + if (!strcmp (InitVal->Name, "_OSI") && !AcpiGbl_CreateOsiMethod) { continue; } @@ -263,7 +263,7 @@ AcpiNsRootInitialize ( /* Build an object around the static string */ - ObjDesc->String.Length = (UINT32) ACPI_STRLEN (Val); + ObjDesc->String.Length = (UINT32) strlen (Val); ObjDesc->String.Pointer = Val; ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER; break; @@ -284,7 +284,7 @@ AcpiNsRootInitialize ( /* Special case for ACPI Global Lock */ - if (ACPI_STRCMP (InitVal->Name, "_GL_") == 0) + if (strcmp (InitVal->Name, "_GL_") == 0) { AcpiGbl_GlobalLockMutex = ObjDesc; @@ -391,7 +391,9 @@ AcpiNsLookup ( return_ACPI_STATUS (AE_BAD_PARAMETER); } - LocalFlags = Flags & ~(ACPI_NS_ERROR_IF_FOUND | ACPI_NS_SEARCH_PARENT); + LocalFlags = Flags & + ~(ACPI_NS_ERROR_IF_FOUND | ACPI_NS_OVERRIDE_IF_FOUND | + ACPI_NS_SEARCH_PARENT); *ReturnNode = ACPI_ENTRY_NOT_FOUND; AcpiGbl_NsLookupCount++; @@ -643,6 +645,13 @@ AcpiNsLookup ( { LocalFlags |= ACPI_NS_ERROR_IF_FOUND; } + + /* Set override flag according to caller */ + + if (Flags & ACPI_NS_OVERRIDE_IF_FOUND) + { + LocalFlags |= ACPI_NS_OVERRIDE_IF_FOUND; + } } /* Extract one ACPI name from the front of the pathname */ diff --git a/src/acpica/source/components/namespace/nsconvert.c b/src/acpica/source/components/namespace/nsconvert.c index be20f43..b79458e 100644 --- a/src/acpica/source/components/namespace/nsconvert.c +++ b/src/acpica/source/components/namespace/nsconvert.c @@ -274,7 +274,7 @@ AcpiNsConvertToString ( * Copy the raw buffer data with no transform. String is already NULL * terminated at Length+1. */ - ACPI_MEMCPY (NewObject->String.Pointer, + memcpy (NewObject->String.Pointer, OriginalObject->Buffer.Pointer, Length); break; @@ -341,7 +341,7 @@ AcpiNsConvertToBuffer ( return (AE_NO_MEMORY); } - ACPI_MEMCPY (NewObject->Buffer.Pointer, + memcpy (NewObject->Buffer.Pointer, OriginalObject->String.Pointer, OriginalObject->String.Length); break; diff --git a/src/acpica/source/components/namespace/nsdump.c b/src/acpica/source/components/namespace/nsdump.c index 8b6c8ce..9f21957 100644 --- a/src/acpica/source/components/namespace/nsdump.c +++ b/src/acpica/source/components/namespace/nsdump.c @@ -195,7 +195,7 @@ AcpiNsPrintPathname ( { for (i = 0; i < 4; i++) { - ACPI_IS_PRINT (Pathname[i]) ? + isprint (Pathname[i]) ? AcpiOsPrintf ("%c", Pathname[i]) : AcpiOsPrintf ("?"); } diff --git a/src/acpica/source/components/namespace/nseval.c b/src/acpica/source/components/namespace/nseval.c index b6d662b..947a34d 100644 --- a/src/acpica/source/components/namespace/nseval.c +++ b/src/acpica/source/components/namespace/nseval.c @@ -136,15 +136,14 @@ AcpiNsExecModuleCode ( * * FUNCTION: AcpiNsEvaluate * - * PARAMETERS: Info - Evaluation info block, contains: + * PARAMETERS: Info - Evaluation info block, contains these fields + * and more: * PrefixNode - Prefix or Method/Object Node to execute * RelativePath - Name of method to execute, If NULL, the * Node is the object to execute * Parameters - List of parameters to pass to the method, * terminated by NULL. Params itself may be * NULL if no parameters are being passed. - * ReturnObject - Where to put method's return value (if - * any). If NULL, no value is returned. * ParameterType - Type of Parameter list * ReturnObject - Where to put method's return value (if * any). If NULL, no value is returned. @@ -536,7 +535,7 @@ AcpiNsExecModuleCode ( /* Initialize the evaluation information block */ - ACPI_MEMSET (Info, 0, sizeof (ACPI_EVALUATE_INFO)); + memset (Info, 0, sizeof (ACPI_EVALUATE_INFO)); Info->PrefixNode = ParentNode; /* diff --git a/src/acpica/source/components/namespace/nsinit.c b/src/acpica/source/components/namespace/nsinit.c index 279b409..6bedef9 100644 --- a/src/acpica/source/components/namespace/nsinit.c +++ b/src/acpica/source/components/namespace/nsinit.c @@ -177,7 +177,7 @@ AcpiNsInitializeObjects ( /* Set all init info to zero */ - ACPI_MEMSET (&Info, 0, sizeof (ACPI_INIT_WALK_INFO)); + memset (&Info, 0, sizeof (ACPI_INIT_WALK_INFO)); /* Walk entire namespace from the supplied root */ @@ -686,7 +686,7 @@ AcpiNsInitOneDevice ( ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname ( ACPI_TYPE_METHOD, DeviceNode, METHOD_NAME__INI)); - ACPI_MEMSET (Info, 0, sizeof (ACPI_EVALUATE_INFO)); + memset (Info, 0, sizeof (ACPI_EVALUATE_INFO)); Info->PrefixNode = DeviceNode; Info->RelativePathname = METHOD_NAME__INI; Info->Parameters = NULL; diff --git a/src/acpica/source/components/namespace/nsparse.c b/src/acpica/source/components/namespace/nsparse.c index da137e8..481e7c3 100644 --- a/src/acpica/source/components/namespace/nsparse.c +++ b/src/acpica/source/components/namespace/nsparse.c @@ -201,6 +201,14 @@ AcpiNsOneCompleteParse ( AmlStart, AmlLength, NULL, (UINT8) PassNumber); } + /* Found OSDT table, enable the namespace override feature */ + + if (ACPI_COMPARE_NAME(Table->Signature, ACPI_SIG_OSDT) && + PassNumber == ACPI_IMODE_LOAD_PASS1) + { + WalkState->NamespaceOverride = TRUE; + } + if (ACPI_FAILURE (Status)) { AcpiDsDeleteWalkState (WalkState); diff --git a/src/acpica/source/components/namespace/nsrepair2.c b/src/acpica/source/components/namespace/nsrepair2.c index 3300819..f921ffd 100644 --- a/src/acpica/source/components/namespace/nsrepair2.c +++ b/src/acpica/source/components/namespace/nsrepair2.c @@ -709,7 +709,7 @@ AcpiNsRepair_HID ( */ for (Dest = NewString->String.Pointer; *Source; Dest++, Source++) { - *Dest = (char) ACPI_TOUPPER (*Source); + *Dest = (char) toupper (*Source); } AcpiUtRemoveReference (ReturnObject); diff --git a/src/acpica/source/components/namespace/nssearch.c b/src/acpica/source/components/namespace/nssearch.c index 81cac95..fe6c0ad 100644 --- a/src/acpica/source/components/namespace/nssearch.c +++ b/src/acpica/source/components/namespace/nssearch.c @@ -410,10 +410,42 @@ AcpiNsSearchAndEnter ( * If we found it AND the request specifies that a find is an error, * return the error */ - if ((Status == AE_OK) && - (Flags & ACPI_NS_ERROR_IF_FOUND)) + if (Status == AE_OK) { - Status = AE_ALREADY_EXISTS; + /* The node was found in the namespace */ + + /* + * If the namespace override feature is enabled for this node, + * delete any existing attached sub-object and make the node + * look like a new node that is owned by the override table. + */ + if (Flags & ACPI_NS_OVERRIDE_IF_FOUND) + { + AcpiNsDeleteChildren (*ReturnNode); + if (AcpiGbl_RuntimeNamespaceOverride) + { + AcpiUtRemoveReference ((*ReturnNode)->Object); + (*ReturnNode)->Object = NULL; + (*ReturnNode)->OwnerId = WalkState->OwnerId; + } + else + { + AcpiNsRemoveNode (*ReturnNode); + *ReturnNode = ACPI_ENTRY_NOT_FOUND; + } + + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, + "Namespace override: %4.4s pass %u type %X Owner %X\n", + ACPI_CAST_PTR(char, &TargetName), InterpreterMode, + (*ReturnNode)->Type, WalkState->OwnerId)); + } + + /* Return an error if we don't expect to find the object */ + + else if (Flags & ACPI_NS_ERROR_IF_FOUND) + { + Status = AE_ALREADY_EXISTS; + } } #ifdef ACPI_ASL_COMPILER diff --git a/src/acpica/source/components/namespace/nsutils.c b/src/acpica/source/components/namespace/nsutils.c index 220c447..c1187ba 100644 --- a/src/acpica/source/components/namespace/nsutils.c +++ b/src/acpica/source/components/namespace/nsutils.c @@ -419,7 +419,7 @@ AcpiNsBuildInternalName ( { /* Convert the character to uppercase and save it */ - Result[i] = (char) ACPI_TOUPPER ((int) *ExternalName); + Result[i] = (char) toupper ((int) *ExternalName); ExternalName++; } } diff --git a/src/acpica/source/components/namespace/nsxfeval.c b/src/acpica/source/components/namespace/nsxfeval.c index 7e23365..06328a6 100644 --- a/src/acpica/source/components/namespace/nsxfeval.c +++ b/src/acpica/source/components/namespace/nsxfeval.c @@ -830,7 +830,7 @@ AcpiNsGetDeviceCallback ( return (AE_CTRL_DEPTH); } - NoMatch = ACPI_STRCMP (Hid->String, Info->Hid); + NoMatch = strcmp (Hid->String, Info->Hid); ACPI_FREE (Hid); if (NoMatch) @@ -854,7 +854,7 @@ AcpiNsGetDeviceCallback ( Found = FALSE; for (i = 0; i < Cid->Count; i++) { - if (ACPI_STRCMP (Cid->Ids[i].String, Info->Hid) == 0) + if (strcmp (Cid->Ids[i].String, Info->Hid) == 0) { /* Found a matching CID */ diff --git a/src/acpica/source/components/namespace/nsxfname.c b/src/acpica/source/components/namespace/nsxfname.c index 4c71e37..d3f411b 100644 --- a/src/acpica/source/components/namespace/nsxfname.c +++ b/src/acpica/source/components/namespace/nsxfname.c @@ -198,7 +198,7 @@ AcpiGetHandle ( /* Special case for root-only, since we can't search for it */ - if (!ACPI_STRCMP (Pathname, ACPI_NS_ROOT_PATH)) + if (!strcmp (Pathname, ACPI_NS_ROOT_PATH)) { *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, AcpiGbl_RootNode); return (AE_OK); @@ -343,7 +343,7 @@ AcpiNsCopyDeviceId ( /* Copy actual string and return a pointer to the next string area */ - ACPI_MEMCPY (StringArea, Source->String, Source->Length); + memcpy (StringArea, Source->String, Source->Length); return (StringArea + Source->Length); } @@ -362,7 +362,7 @@ AcpiNsCopyDeviceId ( * control methods (Such as in the case of a device.) * * For Device and Processor objects, run the Device _HID, _UID, _CID, _SUB, - * _STA, _ADR, _SxW, and _SxD methods. + * _CLS, _STA, _ADR, _SxW, and _SxD methods. * * Note: Allocates the return buffer, must be freed by the caller. * @@ -379,11 +379,12 @@ AcpiGetObjectInfo ( ACPI_PNP_DEVICE_ID *Hid = NULL; ACPI_PNP_DEVICE_ID *Uid = NULL; ACPI_PNP_DEVICE_ID *Sub = NULL; + ACPI_PNP_DEVICE_ID *Cls = NULL; char *NextIdString; ACPI_OBJECT_TYPE Type; ACPI_NAME Name; UINT8 ParamCount= 0; - UINT8 Valid = 0; + UINT16 Valid = 0; UINT32 InfoSize; UINT32 i; ACPI_STATUS Status; @@ -431,7 +432,7 @@ AcpiGetObjectInfo ( { /* * Get extra info for ACPI Device/Processor objects only: - * Run the Device _HID, _UID, _SUB, and _CID methods. + * Run the Device _HID, _UID, _SUB, _CID, and _CLS methods. * * Note: none of these methods are required, so they may or may * not be present for this device. The Info->Valid bitfield is used @@ -475,6 +476,15 @@ AcpiGetObjectInfo ( InfoSize += (CidList->ListSize - sizeof (ACPI_PNP_DEVICE_ID_LIST)); Valid |= ACPI_VALID_CID; } + + /* Execute the Device._CLS method */ + + Status = AcpiUtExecute_CLS (Node, &Cls); + if (ACPI_SUCCESS (Status)) + { + InfoSize += Cls->Length; + Valid |= ACPI_VALID_CLS; + } } /* @@ -606,6 +616,12 @@ AcpiGetObjectInfo ( } } + if (Cls) + { + NextIdString = AcpiNsCopyDeviceId (&Info->ClassCode, + Cls, NextIdString); + } + /* Copy the fixed-length data */ Info->InfoSize = InfoSize; @@ -635,6 +651,10 @@ Cleanup: { ACPI_FREE (CidList); } + if (Cls) + { + ACPI_FREE (Cls); + } return (Status); } @@ -756,7 +776,7 @@ AcpiInstallMethod ( /* Copy the method AML to the local buffer */ - ACPI_MEMCPY (AmlBuffer, AmlStart, AmlLength); + memcpy (AmlBuffer, AmlStart, AmlLength); /* Initialize the method object with the new method's information */ diff --git a/src/acpica/source/components/parser/psutils.c b/src/acpica/source/components/parser/psutils.c index 328ff5b..a36a3f3 100644 --- a/src/acpica/source/components/parser/psutils.c +++ b/src/acpica/source/components/parser/psutils.c @@ -176,7 +176,7 @@ AcpiPsInitOp ( Op->Common.DescriptorType = ACPI_DESC_TYPE_PARSER; Op->Common.AmlOpcode = Opcode; - ACPI_DISASM_ONLY_MEMBERS (ACPI_STRNCPY (Op->Common.AmlOpName, + ACPI_DISASM_ONLY_MEMBERS (strncpy (Op->Common.AmlOpName, (AcpiPsGetOpcodeInfo (Opcode))->Name, sizeof (Op->Common.AmlOpName))); } diff --git a/src/acpica/source/components/resources/rscreate.c b/src/acpica/source/components/resources/rscreate.c index dd430ef..7d9009f 100644 --- a/src/acpica/source/components/resources/rscreate.c +++ b/src/acpica/source/components/resources/rscreate.c @@ -446,12 +446,12 @@ AcpiRsCreatePciRoutingTable ( /* +1 to include null terminator */ - UserPrt->Length += (UINT32) ACPI_STRLEN (UserPrt->Source) + 1; + UserPrt->Length += (UINT32) strlen (UserPrt->Source) + 1; break; case ACPI_TYPE_STRING: - ACPI_STRCPY (UserPrt->Source, ObjDesc->String.Pointer); + strcpy (UserPrt->Source, ObjDesc->String.Pointer); /* * Add to the Length field the length of the string diff --git a/src/acpica/source/components/resources/rsmisc.c b/src/acpica/source/components/resources/rsmisc.c index 7871715..1a5512e 100644 --- a/src/acpica/source/components/resources/rsmisc.c +++ b/src/acpica/source/components/resources/rsmisc.c @@ -202,7 +202,7 @@ AcpiRsConvertAmlToResource ( /* * Get the resource type and the initial (minimum) length */ - ACPI_MEMSET (Resource, 0, INIT_RESOURCE_LENGTH (Info)); + memset (Resource, 0, INIT_RESOURCE_LENGTH (Info)); Resource->Type = INIT_RESOURCE_TYPE (Info); Resource->Length = INIT_RESOURCE_LENGTH (Info); break; @@ -398,13 +398,13 @@ AcpiRsConvertAmlToResource ( case ACPI_RSC_SET8: - ACPI_MEMSET (Destination, Info->AmlOffset, Info->Value); + memset (Destination, Info->AmlOffset, Info->Value); break; case ACPI_RSC_DATA8: Target = ACPI_ADD_PTR (char, Resource, Info->Value); - ACPI_MEMCPY (Destination, Source, ACPI_GET16 (Target)); + memcpy (Destination, Source, ACPI_GET16 (Target)); break; case ACPI_RSC_ADDRESS: @@ -577,7 +577,7 @@ AcpiRsConvertResourceToAml ( { case ACPI_RSC_INITSET: - ACPI_MEMSET (Aml, 0, INIT_RESOURCE_LENGTH (Info)); + memset (Aml, 0, INIT_RESOURCE_LENGTH (Info)); AmlLength = INIT_RESOURCE_LENGTH (Info); AcpiRsSetResourceHeader (INIT_RESOURCE_TYPE (Info), AmlLength, Aml); break; diff --git a/src/acpica/source/components/resources/rsutils.c b/src/acpica/source/components/resources/rsutils.c index 55445b0..a7dc215 100644 --- a/src/acpica/source/components/resources/rsutils.c +++ b/src/acpica/source/components/resources/rsutils.c @@ -246,7 +246,7 @@ AcpiRsMoveData ( case ACPI_RSC_MOVE_SERIAL_VEN: case ACPI_RSC_MOVE_SERIAL_RES: - ACPI_MEMCPY (Destination, Source, ItemCount); + memcpy (Destination, Source, ItemCount); return; /* @@ -480,11 +480,11 @@ AcpiRsGetResourceSource ( * * Zero the entire area of the buffer. */ - TotalLength = (UINT32) ACPI_STRLEN ( + TotalLength = (UINT32) strlen ( ACPI_CAST_PTR (char, &AmlResourceSource[1])) + 1; TotalLength = (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (TotalLength); - ACPI_MEMSET (ResourceSource->StringPtr, 0, TotalLength); + memset (ResourceSource->StringPtr, 0, TotalLength); /* Copy the ResourceSource string to the destination */ @@ -549,7 +549,7 @@ AcpiRsSetResourceSource ( /* Copy the ResourceSource string */ - ACPI_STRCPY (ACPI_CAST_PTR (char, &AmlResourceSource[1]), + strcpy (ACPI_CAST_PTR (char, &AmlResourceSource[1]), ResourceSource->StringPtr); /* diff --git a/src/acpica/source/components/resources/rsxface.c b/src/acpica/source/components/resources/rsxface.c index 834ae9c..9aea3dc 100644 --- a/src/acpica/source/components/resources/rsxface.c +++ b/src/acpica/source/components/resources/rsxface.c @@ -519,7 +519,7 @@ AcpiResourceToAddress64 ( /* Simple copy for 64 bit source */ - ACPI_MEMCPY (Out, &Resource->Data, sizeof (ACPI_RESOURCE_ADDRESS64)); + memcpy (Out, &Resource->Data, sizeof (ACPI_RESOURCE_ADDRESS64)); break; default: @@ -630,7 +630,7 @@ AcpiRsMatchVendorResource ( */ if ((Vendor->ByteLength < (ACPI_UUID_LENGTH + 1)) || (Vendor->UuidSubtype != Info->Uuid->Subtype) || - (ACPI_MEMCMP (Vendor->Uuid, Info->Uuid->Data, ACPI_UUID_LENGTH))) + (memcmp (Vendor->Uuid, Info->Uuid->Data, ACPI_UUID_LENGTH))) { return (AE_OK); } @@ -646,7 +646,7 @@ AcpiRsMatchVendorResource ( /* Found the correct resource, copy and return it */ - ACPI_MEMCPY (Buffer->Pointer, Resource, Resource->Length); + memcpy (Buffer->Pointer, Resource, Resource->Length); Buffer->Length = Resource->Length; /* Found the desired descriptor, terminate resource walk */ diff --git a/src/acpica/source/components/tables/tbdata.c b/src/acpica/source/components/tables/tbdata.c index b89f6e8..daacf41 100644 --- a/src/acpica/source/components/tables/tbdata.c +++ b/src/acpica/source/components/tables/tbdata.c @@ -149,7 +149,7 @@ AcpiTbInitTableDescriptor ( * Initialize the table descriptor. Set the pointer to NULL, since the * table is not fully mapped at this time. */ - ACPI_MEMSET (TableDesc, 0, sizeof (ACPI_TABLE_DESC)); + memset (TableDesc, 0, sizeof (ACPI_TABLE_DESC)); TableDesc->Address = Address; TableDesc->Length = Table->Length; TableDesc->Flags = Flags; @@ -583,7 +583,7 @@ AcpiTbResizeRootTableList ( if (AcpiGbl_RootTableList.Tables) { - ACPI_MEMCPY (Tables, AcpiGbl_RootTableList.Tables, + memcpy (Tables, AcpiGbl_RootTableList.Tables, (ACPI_SIZE) TableCount * sizeof (ACPI_TABLE_DESC)); if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) diff --git a/src/acpica/source/components/tables/tbfadt.c b/src/acpica/source/components/tables/tbfadt.c index 93d76da..15a57e3 100644 --- a/src/acpica/source/components/tables/tbfadt.c +++ b/src/acpica/source/components/tables/tbfadt.c @@ -454,8 +454,16 @@ AcpiTbParseFadt ( if (!AcpiGbl_ReducedHardware) { - AcpiTbInstallFixedTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs, - ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS); + if (AcpiGbl_FADT.Facs) + { + AcpiTbInstallFixedTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.Facs, + ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS); + } + if (AcpiGbl_FADT.XFacs) + { + AcpiTbInstallFixedTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs, + ACPI_SIG_FACS, ACPI_TABLE_INDEX_X_FACS); + } } } @@ -497,11 +505,11 @@ AcpiTbCreateLocalFadt ( /* Clear the entire local FADT */ - ACPI_MEMSET (&AcpiGbl_FADT, 0, sizeof (ACPI_TABLE_FADT)); + memset (&AcpiGbl_FADT, 0, sizeof (ACPI_TABLE_FADT)); /* Copy the original FADT, up to sizeof (ACPI_TABLE_FADT) */ - ACPI_MEMCPY (&AcpiGbl_FADT, Table, + memcpy (&AcpiGbl_FADT, Table, ACPI_MIN (Length, sizeof (ACPI_TABLE_FADT))); /* Take a copy of the Hardware Reduced flag */ @@ -605,12 +613,9 @@ AcpiTbConvertFadt ( AcpiGbl_FADT.Header.Length = sizeof (ACPI_TABLE_FADT); /* - * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary. + * Expand the 32-bit DSDT addresses to 64-bit as necessary. * Later ACPICA code will always use the X 64-bit field. */ - AcpiGbl_FADT.XFacs = AcpiTbSelectAddress ("FACS", - AcpiGbl_FADT.Facs, AcpiGbl_FADT.XFacs); - AcpiGbl_FADT.XDsdt = AcpiTbSelectAddress ("DSDT", AcpiGbl_FADT.Dsdt, AcpiGbl_FADT.XDsdt); diff --git a/src/acpica/source/components/tables/tbfind.c b/src/acpica/source/components/tables/tbfind.c index c7acd1c..a52d0de 100644 --- a/src/acpica/source/components/tables/tbfind.c +++ b/src/acpica/source/components/tables/tbfind.c @@ -155,16 +155,16 @@ AcpiTbFindTable ( /* Normalize the input strings */ - ACPI_MEMSET (&Header, 0, sizeof (ACPI_TABLE_HEADER)); + memset (&Header, 0, sizeof (ACPI_TABLE_HEADER)); ACPI_MOVE_NAME (Header.Signature, Signature); - ACPI_STRNCPY (Header.OemId, OemId, ACPI_OEM_ID_SIZE); - ACPI_STRNCPY (Header.OemTableId, OemTableId, ACPI_OEM_TABLE_ID_SIZE); + strncpy (Header.OemId, OemId, ACPI_OEM_ID_SIZE); + strncpy (Header.OemTableId, OemTableId, ACPI_OEM_TABLE_ID_SIZE); /* Search for the table */ for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) { - if (ACPI_MEMCMP (&(AcpiGbl_RootTableList.Tables[i].Signature), + if (memcmp (&(AcpiGbl_RootTableList.Tables[i].Signature), Header.Signature, ACPI_NAME_SIZE)) { /* Not the requested table */ @@ -192,13 +192,13 @@ AcpiTbFindTable ( /* Check for table match on all IDs */ - if (!ACPI_MEMCMP (AcpiGbl_RootTableList.Tables[i].Pointer->Signature, + if (!memcmp (AcpiGbl_RootTableList.Tables[i].Pointer->Signature, Header.Signature, ACPI_NAME_SIZE) && (!OemId[0] || - !ACPI_MEMCMP (AcpiGbl_RootTableList.Tables[i].Pointer->OemId, + !memcmp (AcpiGbl_RootTableList.Tables[i].Pointer->OemId, Header.OemId, ACPI_OEM_ID_SIZE)) && (!OemTableId[0] || - !ACPI_MEMCMP (AcpiGbl_RootTableList.Tables[i].Pointer->OemTableId, + !memcmp (AcpiGbl_RootTableList.Tables[i].Pointer->OemTableId, Header.OemTableId, ACPI_OEM_TABLE_ID_SIZE))) { *TableIndex = i; diff --git a/src/acpica/source/components/tables/tbinstal.c b/src/acpica/source/components/tables/tbinstal.c index 8833ef3..4ddf2ee 100644 --- a/src/acpica/source/components/tables/tbinstal.c +++ b/src/acpica/source/components/tables/tbinstal.c @@ -166,7 +166,7 @@ AcpiTbCompareTables ( * not just the header. */ IsIdentical = (BOOLEAN)((TableDesc->Length != TableLength || - ACPI_MEMCMP (TableDesc->Pointer, Table, TableLength)) ? + memcmp (TableDesc->Pointer, Table, TableLength)) ? FALSE : TRUE); /* Release the acquired table */ @@ -381,7 +381,7 @@ AcpiTbInstallStandardTable ( */ if ((NewTableDesc.Signature.Ascii[0] != 0x00) && (!ACPI_COMPARE_NAME (&NewTableDesc.Signature, ACPI_SIG_SSDT)) && - (ACPI_STRNCMP (NewTableDesc.Signature.Ascii, "OEM", 3))) + (strncmp (NewTableDesc.Signature.Ascii, "OEM", 3))) { ACPI_BIOS_ERROR ((AE_INFO, "Table has invalid signature [%4.4s] (0x%8.8X), " diff --git a/src/acpica/source/components/tables/tbprint.c b/src/acpica/source/components/tables/tbprint.c index 105925b..c7b64b4 100644 --- a/src/acpica/source/components/tables/tbprint.c +++ b/src/acpica/source/components/tables/tbprint.c @@ -156,7 +156,7 @@ AcpiTbFixString ( while (Length && *String) { - if (!ACPI_IS_PRINT (*String)) + if (!isprint (*String)) { *String = '?'; } @@ -186,7 +186,7 @@ AcpiTbCleanupTableHeader ( ACPI_TABLE_HEADER *Header) { - ACPI_MEMCPY (OutHeader, Header, sizeof (ACPI_TABLE_HEADER)); + memcpy (OutHeader, Header, sizeof (ACPI_TABLE_HEADER)); AcpiTbFixString (OutHeader->Signature, ACPI_NAME_SIZE); AcpiTbFixString (OutHeader->OemId, ACPI_OEM_ID_SIZE); @@ -228,7 +228,7 @@ AcpiTbPrintTableHeader ( { /* RSDP has no common fields */ - ACPI_MEMCPY (LocalHeader.OemId, + memcpy (LocalHeader.OemId, ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->OemId, ACPI_OEM_ID_SIZE); AcpiTbFixString (LocalHeader.OemId, ACPI_OEM_ID_SIZE); diff --git a/src/acpica/source/components/tables/tbutils.c b/src/acpica/source/components/tables/tbutils.c index b2fdb91..f9d8eaa 100644 --- a/src/acpica/source/components/tables/tbutils.c +++ b/src/acpica/source/components/tables/tbutils.c @@ -147,8 +147,13 @@ ACPI_STATUS AcpiTbInitializeFacs ( void) { - ACPI_STATUS Status; + /* If there is no FACS, just continue. There was already an error msg */ + + if (!AcpiGbl_FACS) + { + return (AE_OK); + } /* If Hardware Reduced flag is set, there is no FACS */ @@ -158,9 +163,25 @@ AcpiTbInitializeFacs ( return (AE_OK); } - Status = AcpiGetTableByIndex (ACPI_TABLE_INDEX_FACS, - ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_FACS)); - return (Status); + (void) AcpiGetTableByIndex (ACPI_TABLE_INDEX_FACS, + ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_Facs32)); + (void) AcpiGetTableByIndex (ACPI_TABLE_INDEX_X_FACS, + ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_Facs64)); + if (!AcpiGbl_Facs32 && !AcpiGbl_Facs64) + { + return (AE_NO_MEMORY); + } + + if (AcpiGbl_Use32BitFacsAddresses) + { + AcpiGbl_FACS = AcpiGbl_Facs32 ? AcpiGbl_Facs32 : AcpiGbl_Facs64; + } + else + { + AcpiGbl_FACS = AcpiGbl_Facs64 ? AcpiGbl_Facs64 : AcpiGbl_Facs32; + } + + return (AE_OK); } #endif /* !ACPI_REDUCED_HARDWARE */ @@ -183,7 +204,7 @@ AcpiTbTablesLoaded ( void) { - if (AcpiGbl_RootTableList.CurrentTableCount >= 3) + if (AcpiGbl_RootTableList.CurrentTableCount >= 4) { return (TRUE); } @@ -262,7 +283,7 @@ AcpiTbCopyDsdt ( return (NULL); } - ACPI_MEMCPY (NewTable, TableDesc->Pointer, TableDesc->Length); + memcpy (NewTable, TableDesc->Pointer, TableDesc->Length); AcpiTbUninstallTable (TableDesc); AcpiTbInitTableDescriptor ( @@ -461,11 +482,11 @@ AcpiTbParseRootTable ( TableEntry = ACPI_ADD_PTR (UINT8, Table, sizeof (ACPI_TABLE_HEADER)); /* - * First two entries in the table array are reserved for the DSDT - * and FACS, which are not actually present in the RSDT/XSDT - they - * come from the FADT + * First three entries in the table array are reserved for the DSDT + * and 32bit/64bit FACS, which are not actually present in the + * RSDT/XSDT - they come from the FADT */ - AcpiGbl_RootTableList.CurrentTableCount = 2; + AcpiGbl_RootTableList.CurrentTableCount = 3; /* Initialize the root table array from the RSDT/XSDT */ diff --git a/src/acpica/source/components/tables/tbxface.c b/src/acpica/source/components/tables/tbxface.c index d2351d3..25e1405 100644 --- a/src/acpica/source/components/tables/tbxface.c +++ b/src/acpica/source/components/tables/tbxface.c @@ -204,7 +204,7 @@ AcpiInitializeTables ( { /* Root Table Array has been statically allocated by the host */ - ACPI_MEMSET (InitialTableArray, 0, + memset (InitialTableArray, 0, (ACPI_SIZE) InitialTableCount * sizeof (ACPI_TABLE_DESC)); AcpiGbl_RootTableList.Tables = InitialTableArray; @@ -343,7 +343,7 @@ AcpiGetTableHeader ( return (AE_NO_MEMORY); } - ACPI_MEMCPY (OutTableHeader, Header, + memcpy (OutTableHeader, Header, sizeof (ACPI_TABLE_HEADER)); AcpiOsUnmapMemory (Header, sizeof (ACPI_TABLE_HEADER)); } @@ -354,7 +354,7 @@ AcpiGetTableHeader ( } else { - ACPI_MEMCPY (OutTableHeader, + memcpy (OutTableHeader, AcpiGbl_RootTableList.Tables[i].Pointer, sizeof (ACPI_TABLE_HEADER)); } diff --git a/src/acpica/source/components/tables/tbxfload.c b/src/acpica/source/components/tables/tbxfload.c index 83f6420..7a6711f 100644 --- a/src/acpica/source/components/tables/tbxfload.c +++ b/src/acpica/source/components/tables/tbxfload.c @@ -236,7 +236,7 @@ AcpiTbLoadNamespace ( * Save the original DSDT header for detection of table corruption * and/or replacement of the DSDT from outside the OS. */ - ACPI_MEMCPY (&AcpiGbl_OriginalDsdtHeader, AcpiGbl_DSDT, + memcpy (&AcpiGbl_OriginalDsdtHeader, AcpiGbl_DSDT, sizeof (ACPI_TABLE_HEADER)); (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); @@ -254,10 +254,13 @@ AcpiTbLoadNamespace ( (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) { - if ((!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), + if (!AcpiGbl_RootTableList.Tables[i].Address || + (!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), ACPI_SIG_SSDT) && !ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), - ACPI_SIG_PSDT)) || + ACPI_SIG_PSDT) && + !ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), + ACPI_SIG_OSDT)) || ACPI_FAILURE (AcpiTbValidateTable ( &AcpiGbl_RootTableList.Tables[i]))) { @@ -310,11 +313,11 @@ AcpiInstallTable ( if (Physical) { - Flags = ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL; + Flags = ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL; } else { - Flags = ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL; + Flags = ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL; } Status = AcpiTbInstallStandardTable (Address, Flags, diff --git a/src/acpica/source/components/utilities/utalloc.c b/src/acpica/source/components/utilities/utalloc.c index 0c8c928..62c3e28 100644 --- a/src/acpica/source/components/utilities/utalloc.c +++ b/src/acpica/source/components/utilities/utalloc.c @@ -151,7 +151,7 @@ AcpiOsAllocateZeroed ( { /* Clear the memory block */ - ACPI_MEMSET (Allocation, 0, Size); + memset (Allocation, 0, Size); } return (Allocation); @@ -261,7 +261,7 @@ AcpiUtDeleteCaches ( if (AcpiGbl_DisplayFinalMemStats) { - ACPI_STRCPY (Buffer, "MEMORY"); + strcpy (Buffer, "MEMORY"); (void) AcpiDbDisplayStatistics (Buffer); } #endif @@ -431,6 +431,6 @@ AcpiUtInitializeBuffer ( /* Have a valid buffer, clear it */ - ACPI_MEMSET (Buffer->Pointer, 0, RequiredLength); + memset (Buffer->Pointer, 0, RequiredLength); return (AE_OK); } diff --git a/src/acpica/source/components/utilities/utbuffer.c b/src/acpica/source/components/utilities/utbuffer.c index 65110fb..79aff33 100644 --- a/src/acpica/source/components/utilities/utbuffer.c +++ b/src/acpica/source/components/utilities/utbuffer.c @@ -240,7 +240,7 @@ AcpiUtDumpBuffer ( } BufChar = Buffer[(ACPI_SIZE) i + j]; - if (ACPI_IS_PRINT (BufChar)) + if (isprint (BufChar)) { AcpiOsPrintf ("%c", BufChar); } @@ -413,7 +413,7 @@ AcpiUtDumpBufferToFile ( } BufChar = Buffer[(ACPI_SIZE) i + j]; - if (ACPI_IS_PRINT (BufChar)) + if (isprint (BufChar)) { AcpiUtFilePrintf (File, "%c", BufChar); } diff --git a/src/acpica/source/components/utilities/utcache.c b/src/acpica/source/components/utilities/utcache.c index 25c8e0e..5cf5250 100644 --- a/src/acpica/source/components/utilities/utcache.c +++ b/src/acpica/source/components/utilities/utcache.c @@ -164,7 +164,7 @@ AcpiOsCreateCache ( /* Populate the cache object and return it */ - ACPI_MEMSET (Cache, 0, sizeof (ACPI_MEMORY_LIST)); + memset (Cache, 0, sizeof (ACPI_MEMORY_LIST)); Cache->ListName = CacheName; Cache->ObjectSize = ObjectSize; Cache->MaxDepth = MaxDepth; @@ -314,7 +314,7 @@ AcpiOsReleaseObject ( /* Mark the object as cached */ - ACPI_MEMSET (Object, 0xCA, Cache->ObjectSize); + memset (Object, 0xCA, Cache->ObjectSize); ACPI_SET_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_CACHED); /* Put the object at the head of the cache list */ @@ -390,7 +390,7 @@ AcpiOsAcquireObject ( /* Clear (zero) the previously used Object */ - ACPI_MEMSET (Object, 0, Cache->ObjectSize); + memset (Object, 0, Cache->ObjectSize); } else { diff --git a/src/acpica/source/components/utilities/utcopy.c b/src/acpica/source/components/utilities/utcopy.c index 7dfc104..bc77787 100644 --- a/src/acpica/source/components/utilities/utcopy.c +++ b/src/acpica/source/components/utilities/utcopy.c @@ -218,7 +218,7 @@ AcpiUtCopyIsimpleToEsimple ( /* Always clear the external object */ - ACPI_MEMSET (ExternalObject, 0, sizeof (ACPI_OBJECT)); + memset (ExternalObject, 0, sizeof (ACPI_OBJECT)); /* * In general, the external object will be the same type as @@ -237,7 +237,7 @@ AcpiUtCopyIsimpleToEsimple ( *BufferSpaceUsed = ACPI_ROUND_UP_TO_NATIVE_WORD ( (ACPI_SIZE) InternalObject->String.Length + 1); - ACPI_MEMCPY ((void *) DataSpace, + memcpy ((void *) DataSpace, (void *) InternalObject->String.Pointer, (ACPI_SIZE) InternalObject->String.Length + 1); break; @@ -249,7 +249,7 @@ AcpiUtCopyIsimpleToEsimple ( *BufferSpaceUsed = ACPI_ROUND_UP_TO_NATIVE_WORD ( InternalObject->String.Length); - ACPI_MEMCPY ((void *) DataSpace, + memcpy ((void *) DataSpace, (void *) InternalObject->Buffer.Pointer, InternalObject->Buffer.Length); break; @@ -600,7 +600,7 @@ AcpiUtCopyEsimpleToIsimple ( goto ErrorExit; } - ACPI_MEMCPY (InternalObject->String.Pointer, + memcpy (InternalObject->String.Pointer, ExternalObject->String.Pointer, ExternalObject->String.Length); @@ -616,7 +616,7 @@ AcpiUtCopyEsimpleToIsimple ( goto ErrorExit; } - ACPI_MEMCPY (InternalObject->Buffer.Pointer, + memcpy (InternalObject->Buffer.Pointer, ExternalObject->Buffer.Pointer, ExternalObject->Buffer.Length); @@ -804,7 +804,7 @@ AcpiUtCopySimpleObject ( CopySize = sizeof (ACPI_NAMESPACE_NODE); } - ACPI_MEMCPY (ACPI_CAST_PTR (char, DestDesc), + memcpy (ACPI_CAST_PTR (char, DestDesc), ACPI_CAST_PTR (char, SourceDesc), CopySize); /* Restore the saved fields */ @@ -838,7 +838,7 @@ AcpiUtCopySimpleObject ( /* Copy the actual buffer data */ - ACPI_MEMCPY (DestDesc->Buffer.Pointer, + memcpy (DestDesc->Buffer.Pointer, SourceDesc->Buffer.Pointer, SourceDesc->Buffer.Length); } break; @@ -860,7 +860,7 @@ AcpiUtCopySimpleObject ( /* Copy the actual string data */ - ACPI_MEMCPY (DestDesc->String.Pointer, SourceDesc->String.Pointer, + memcpy (DestDesc->String.Pointer, SourceDesc->String.Pointer, (ACPI_SIZE) SourceDesc->String.Length + 1); } break; diff --git a/src/acpica/source/components/utilities/utids.c b/src/acpica/source/components/utilities/utids.c index f611997..3bb12f0 100644 --- a/src/acpica/source/components/utilities/utids.c +++ b/src/acpica/source/components/utilities/utids.c @@ -1,6 +1,6 @@ /****************************************************************************** * - * Module Name: utids - support for device IDs - HID, UID, CID + * Module Name: utids - support for device IDs - HID, UID, CID, SUB, CLS * *****************************************************************************/ @@ -193,7 +193,7 @@ AcpiUtExecute_HID ( } else { - ACPI_STRCPY (Hid->String, ObjDesc->String.Pointer); + strcpy (Hid->String, ObjDesc->String.Pointer); } Hid->Length = Length; @@ -266,7 +266,7 @@ AcpiUtExecute_SUB ( /* Simply copy existing string */ - ACPI_STRCPY (Sub->String, ObjDesc->String.Pointer); + strcpy (Sub->String, ObjDesc->String.Pointer); Sub->Length = Length; *ReturnId = Sub; @@ -351,7 +351,7 @@ AcpiUtExecute_UID ( } else { - ACPI_STRCPY (Uid->String, ObjDesc->String.Pointer); + strcpy (Uid->String, ObjDesc->String.Pointer); } Uid->Length = Length; @@ -498,7 +498,7 @@ AcpiUtExecute_CID ( { /* Copy the String CID from the returned object */ - ACPI_STRCPY (NextIdString, CidObjects[i]->String.Pointer); + strcpy (NextIdString, CidObjects[i]->String.Pointer); Length = CidObjects[i]->String.Length + 1; } @@ -521,3 +521,97 @@ Cleanup: AcpiUtRemoveReference (ObjDesc); return_ACPI_STATUS (Status); } + + +/******************************************************************************* + * + * FUNCTION: AcpiUtExecute_CLS + * + * PARAMETERS: DeviceNode - Node for the device + * ReturnId - Where the _CLS is returned + * + * RETURN: Status + * + * DESCRIPTION: Executes the _CLS control method that returns PCI-defined + * class code of the device. The _CLS value is always a package + * containing PCI class information as a list of integers. + * The returned string has format "BBSSPP", where: + * BB = Base-class code + * SS = Sub-class code + * PP = Programming Interface code + * + ******************************************************************************/ + +ACPI_STATUS +AcpiUtExecute_CLS ( + ACPI_NAMESPACE_NODE *DeviceNode, + ACPI_PNP_DEVICE_ID **ReturnId) +{ + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_OPERAND_OBJECT **ClsObjects; + UINT32 Count; + ACPI_PNP_DEVICE_ID *Cls; + UINT32 Length; + ACPI_STATUS Status; + UINT8 ClassCode[3] = {0, 0, 0}; + + + ACPI_FUNCTION_TRACE (UtExecute_CLS); + + + Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__CLS, + ACPI_BTYPE_PACKAGE, &ObjDesc); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* Get the size of the String to be returned, includes null terminator */ + + Length = ACPI_PCICLS_STRING_SIZE; + ClsObjects = ObjDesc->Package.Elements; + Count = ObjDesc->Package.Count; + + if (ObjDesc->Common.Type == ACPI_TYPE_PACKAGE) + { + if (Count > 0 && ClsObjects[0]->Common.Type == ACPI_TYPE_INTEGER) + { + ClassCode[0] = (UINT8) ClsObjects[0]->Integer.Value; + } + if (Count > 1 && ClsObjects[1]->Common.Type == ACPI_TYPE_INTEGER) + { + ClassCode[1] = (UINT8) ClsObjects[1]->Integer.Value; + } + if (Count > 2 && ClsObjects[2]->Common.Type == ACPI_TYPE_INTEGER) + { + ClassCode[2] = (UINT8) ClsObjects[2]->Integer.Value; + } + } + + /* Allocate a buffer for the CLS */ + + Cls = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length); + if (!Cls) + { + Status = AE_NO_MEMORY; + goto Cleanup; + } + + /* Area for the string starts after PNP_DEVICE_ID struct */ + + Cls->String = ACPI_ADD_PTR (char, Cls, sizeof (ACPI_PNP_DEVICE_ID)); + + /* Simply copy existing string */ + + AcpiExPciClsToString (Cls->String, ClassCode); + Cls->Length = Length; + *ReturnId = Cls; + + +Cleanup: + + /* On exit, we must delete the return object */ + + AcpiUtRemoveReference (ObjDesc); + return_ACPI_STATUS (Status); +} diff --git a/src/acpica/source/components/utilities/utmisc.c b/src/acpica/source/components/utilities/utmisc.c index 32ce271..141db80 100644 --- a/src/acpica/source/components/utilities/utmisc.c +++ b/src/acpica/source/components/utilities/utmisc.c @@ -143,10 +143,10 @@ AcpiUtIsPciRootBridge ( * Check if this is a PCI root bridge. * ACPI 3.0+: check for a PCI Express root also. */ - if (!(ACPI_STRCMP (Id, + if (!(strcmp (Id, PCI_ROOT_HID_STRING)) || - !(ACPI_STRCMP (Id, + !(strcmp (Id, PCI_EXPRESS_ROOT_HID_STRING))) { return (TRUE); @@ -180,7 +180,8 @@ AcpiUtIsAmlTable ( if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT) || ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_PSDT) || - ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_SSDT)) + ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_SSDT) || + ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_OSDT)) { return (TRUE); } diff --git a/src/acpica/source/components/utilities/utosi.c b/src/acpica/source/components/utilities/utosi.c index d88fe8f..b4d8a71 100644 --- a/src/acpica/source/components/utilities/utosi.c +++ b/src/acpica/source/components/utilities/utosi.c @@ -328,7 +328,7 @@ AcpiUtInstallInterface ( return (AE_NO_MEMORY); } - InterfaceInfo->Name = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (InterfaceName) + 1); + InterfaceInfo->Name = ACPI_ALLOCATE_ZEROED (strlen (InterfaceName) + 1); if (!InterfaceInfo->Name) { ACPI_FREE (InterfaceInfo); @@ -337,7 +337,7 @@ AcpiUtInstallInterface ( /* Initialize new info and insert at the head of the global list */ - ACPI_STRCPY (InterfaceInfo->Name, InterfaceName); + strcpy (InterfaceInfo->Name, InterfaceName); InterfaceInfo->Flags = ACPI_OSI_DYNAMIC; InterfaceInfo->Next = AcpiGbl_SupportedInterfaces; @@ -370,7 +370,7 @@ AcpiUtRemoveInterface ( PreviousInterface = NextInterface = AcpiGbl_SupportedInterfaces; while (NextInterface) { - if (!ACPI_STRCMP (InterfaceName, NextInterface->Name)) + if (!strcmp (InterfaceName, NextInterface->Name)) { /* Found: name is in either the static list or was added at runtime */ @@ -491,7 +491,7 @@ AcpiUtGetInterface ( NextInterface = AcpiGbl_SupportedInterfaces; while (NextInterface) { - if (!ACPI_STRCMP (InterfaceName, NextInterface->Name)) + if (!strcmp (InterfaceName, NextInterface->Name)) { return (NextInterface); } diff --git a/src/acpica/source/components/utilities/utpredef.c b/src/acpica/source/components/utilities/utpredef.c index 19561be..11471c7 100644 --- a/src/acpica/source/components/utilities/utpredef.c +++ b/src/acpica/source/components/utilities/utpredef.c @@ -238,7 +238,7 @@ AcpiUtGetExpectedReturnTypes ( if (!ExpectedBtypes) { - ACPI_STRCPY (Buffer, "NONE"); + strcpy (Buffer, "NONE"); return; } @@ -252,7 +252,7 @@ AcpiUtGetExpectedReturnTypes ( if (ExpectedBtypes & ThisRtype) { - ACPI_STRCAT (Buffer, &UtRtypeNames[i][j]); + strcat (Buffer, &UtRtypeNames[i][j]); j = 0; /* Use name separator from now on */ } diff --git a/src/acpica/source/components/utilities/utprint.c b/src/acpica/source/components/utilities/utprint.c index 13bf94a..c2d8870 100644 --- a/src/acpica/source/components/utilities/utprint.c +++ b/src/acpica/source/components/utilities/utprint.c @@ -299,7 +299,7 @@ AcpiUtScanNumber ( UINT64 Number = 0; - while (ACPI_IS_DIGIT (*String)) + while (isdigit (*String)) { Number *= 10; Number += *(String++) - '0'; @@ -577,7 +577,7 @@ AcpiUtVsnprintf ( /* Process width */ Width = -1; - if (ACPI_IS_DIGIT (*Format)) + if (isdigit (*Format)) { Format = AcpiUtScanNumber (Format, &Number); Width = (INT32) Number; @@ -599,7 +599,7 @@ AcpiUtVsnprintf ( if (*Format == '.') { ++Format; - if (ACPI_IS_DIGIT(*Format)) + if (isdigit(*Format)) { Format = AcpiUtScanNumber (Format, &Number); Precision = (INT32) Number; diff --git a/src/acpica/source/components/utilities/utstring.c b/src/acpica/source/components/utilities/utstring.c index 953f304..75e6ace 100644 --- a/src/acpica/source/components/utilities/utstring.c +++ b/src/acpica/source/components/utilities/utstring.c @@ -161,7 +161,7 @@ AcpiUtStrlwr ( for (String = SrcString; *String; String++) { - *String = (char) ACPI_TOLOWER (*String); + *String = (char) tolower (*String); } return; @@ -240,7 +240,7 @@ AcpiUtStrupr ( for (String = SrcString; *String; String++) { - *String = (char) ACPI_TOUPPER (*String); + *String = (char) toupper (*String); } return; @@ -306,7 +306,7 @@ AcpiUtStrtoul64 ( /* Skip over any white space in the buffer */ - while ((*String) && (ACPI_IS_SPACE (*String) || *String == '\t')) + while ((*String) && (isspace (*String) || *String == '\t')) { String++; } @@ -317,7 +317,7 @@ AcpiUtStrtoul64 ( * Base equal to ACPI_ANY_BASE means 'ToInteger operation case'. * We need to determine if it is decimal or hexadecimal. */ - if ((*String == '0') && (ACPI_TOLOWER (*(String + 1)) == 'x')) + if ((*String == '0') && (tolower (*(String + 1)) == 'x')) { SignOf0x = 1; Base = 16; @@ -333,7 +333,7 @@ AcpiUtStrtoul64 ( /* Any string left? Check that '0x' is not followed by white space. */ - if (!(*String) || ACPI_IS_SPACE (*String) || *String == '\t') + if (!(*String) || isspace (*String) || *String == '\t') { if (ToIntegerOp) { @@ -355,7 +355,7 @@ AcpiUtStrtoul64 ( while (*String) { - if (ACPI_IS_DIGIT (*String)) + if (isdigit (*String)) { /* Convert ASCII 0-9 to Decimal value */ @@ -369,8 +369,8 @@ AcpiUtStrtoul64 ( } else { - ThisDigit = (UINT8) ACPI_TOUPPER (*String); - if (ACPI_IS_XDIGIT ((char) ThisDigit)) + ThisDigit = (UINT8) toupper (*String); + if (isxdigit ((char) ThisDigit)) { /* Convert ASCII Hex char to value */ @@ -541,7 +541,7 @@ AcpiUtPrintString ( /* Check for printable character or hex escape */ - if (ACPI_IS_PRINT (String[i])) + if (isprint (String[i])) { /* This is a normal character */ @@ -783,12 +783,12 @@ AcpiUtSafeStrcpy ( char *Source) { - if (ACPI_STRLEN (Source) >= DestSize) + if (strlen (Source) >= DestSize) { return (TRUE); } - ACPI_STRCPY (Dest, Source); + strcpy (Dest, Source); return (FALSE); } @@ -799,12 +799,12 @@ AcpiUtSafeStrcat ( char *Source) { - if ((ACPI_STRLEN (Dest) + ACPI_STRLEN (Source)) >= DestSize) + if ((strlen (Dest) + strlen (Source)) >= DestSize) { return (TRUE); } - ACPI_STRCAT (Dest, Source); + strcat (Dest, Source); return (FALSE); } @@ -818,14 +818,14 @@ AcpiUtSafeStrncat ( ACPI_SIZE ActualTransferLength; - ActualTransferLength = ACPI_MIN (MaxTransferLength, ACPI_STRLEN (Source)); + ActualTransferLength = ACPI_MIN (MaxTransferLength, strlen (Source)); - if ((ACPI_STRLEN (Dest) + ActualTransferLength) >= DestSize) + if ((strlen (Dest) + ActualTransferLength) >= DestSize) { return (TRUE); } - ACPI_STRNCAT (Dest, Source, MaxTransferLength); + strncat (Dest, Source, MaxTransferLength); return (FALSE); } #endif diff --git a/src/acpica/source/components/utilities/uttrack.c b/src/acpica/source/components/utilities/uttrack.c index 284bee0..f7f0bce 100644 --- a/src/acpica/source/components/utilities/uttrack.c +++ b/src/acpica/source/components/utilities/uttrack.c @@ -185,7 +185,7 @@ AcpiUtCreateList ( return (AE_NO_MEMORY); } - ACPI_MEMSET (Cache, 0, sizeof (ACPI_MEMORY_LIST)); + memset (Cache, 0, sizeof (ACPI_MEMORY_LIST)); Cache->ListName = ListName; Cache->ObjectSize = ObjectSize; @@ -517,7 +517,7 @@ AcpiUtTrackAllocation ( Allocation->Component = Component; Allocation->Line = Line; - ACPI_STRNCPY (Allocation->Module, Module, ACPI_MAX_MODULE_NAME); + strncpy (Allocation->Module, Module, ACPI_MAX_MODULE_NAME); Allocation->Module[ACPI_MAX_MODULE_NAME-1] = 0; if (!Element) @@ -628,7 +628,7 @@ AcpiUtRemoveAllocation ( /* Mark the segment as deleted */ - ACPI_MEMSET (&Allocation->UserSpace, 0xEA, Allocation->Size); + memset (&Allocation->UserSpace, 0xEA, Allocation->Size); Status = AcpiUtReleaseMutex (ACPI_MTX_MEMORY); return (Status); @@ -739,7 +739,7 @@ AcpiUtDumpAllocations ( while (Element) { if ((Element->Component & Component) && - ((Module == NULL) || (0 == ACPI_STRCMP (Module, Element->Module)))) + ((Module == NULL) || (0 == strcmp (Module, Element->Module)))) { Descriptor = ACPI_CAST_PTR (ACPI_DESCRIPTOR, &Element->UserSpace); diff --git a/src/acpica/source/components/utilities/utxface.c b/src/acpica/source/components/utilities/utxface.c index e01c4d5..612024f 100644 --- a/src/acpica/source/components/utilities/utxface.c +++ b/src/acpica/source/components/utilities/utxface.c @@ -335,7 +335,7 @@ AcpiGetStatistics ( Stats->SciCount = AcpiSciCount; Stats->GpeCount = AcpiGpeCount; - ACPI_MEMCPY (Stats->FixedEventCount, AcpiFixedEventCount, + memcpy (Stats->FixedEventCount, AcpiFixedEventCount, sizeof (AcpiFixedEventCount)); @@ -439,7 +439,7 @@ AcpiInstallInterface ( /* Parameter validation */ - if (!InterfaceName || (ACPI_STRLEN (InterfaceName) == 0)) + if (!InterfaceName || (strlen (InterfaceName) == 0)) { return (AE_BAD_PARAMETER); } @@ -504,7 +504,7 @@ AcpiRemoveInterface ( /* Parameter validation */ - if (!InterfaceName || (ACPI_STRLEN (InterfaceName) == 0)) + if (!InterfaceName || (strlen (InterfaceName) == 0)) { return (AE_BAD_PARAMETER); } diff --git a/src/acpica/source/include/acglobal.h b/src/acpica/source/include/acglobal.h index 1610799..3e399ba 100644 --- a/src/acpica/source/include/acglobal.h +++ b/src/acpica/source/include/acglobal.h @@ -134,6 +134,8 @@ ACPI_GLOBAL (ACPI_TABLE_HEADER, AcpiGbl_OriginalDsdtHeader); #if (!ACPI_REDUCED_HARDWARE) ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_FACS); +ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_Facs32); +ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_Facs64); #endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/src/acpica/source/include/acinterp.h b/src/acpica/source/include/acinterp.h index f0edcb1..7c74e05 100644 --- a/src/acpica/source/include/acinterp.h +++ b/src/acpica/source/include/acinterp.h @@ -710,6 +710,11 @@ AcpiExIntegerToString ( char *Dest, UINT64 Value); +void +AcpiExPciClsToString ( + char *Dest, + UINT8 ClassCode[3]); + BOOLEAN AcpiIsValidSpaceId ( UINT8 SpaceId); diff --git a/src/acpica/source/include/aclocal.h b/src/acpica/source/include/aclocal.h index dc7a2eb..b550282 100644 --- a/src/acpica/source/include/aclocal.h +++ b/src/acpica/source/include/aclocal.h @@ -310,6 +310,7 @@ typedef struct acpi_table_list #define ACPI_TABLE_INDEX_DSDT (0) #define ACPI_TABLE_INDEX_FACS (1) +#define ACPI_TABLE_INDEX_X_FACS (2) typedef struct acpi_find_context diff --git a/src/acpica/source/include/acnames.h b/src/acpica/source/include/acnames.h index e87f927..7c5ef64 100644 --- a/src/acpica/source/include/acnames.h +++ b/src/acpica/source/include/acnames.h @@ -123,6 +123,7 @@ #define METHOD_NAME__BBN "_BBN" #define METHOD_NAME__CBA "_CBA" #define METHOD_NAME__CID "_CID" +#define METHOD_NAME__CLS "_CLS" #define METHOD_NAME__CRS "_CRS" #define METHOD_NAME__DDN "_DDN" #define METHOD_NAME__HID "_HID" diff --git a/src/acpica/source/include/acnamesp.h b/src/acpica/source/include/acnamesp.h index b66d3e4..1b19357 100644 --- a/src/acpica/source/include/acnamesp.h +++ b/src/acpica/source/include/acnamesp.h @@ -139,6 +139,7 @@ #define ACPI_NS_PREFIX_IS_SCOPE 0x10 #define ACPI_NS_EXTERNAL 0x20 #define ACPI_NS_TEMPORARY 0x40 +#define ACPI_NS_OVERRIDE_IF_FOUND 0x80 /* Flags for AcpiNsWalkNamespace */ diff --git a/src/acpica/source/include/acobject.h b/src/acpica/source/include/acobject.h index 0712e75..fbd28a9 100644 --- a/src/acpica/source/include/acobject.h +++ b/src/acpica/source/include/acobject.h @@ -502,13 +502,14 @@ typedef struct acpi_object_addr_handler typedef struct acpi_object_reference { ACPI_OBJECT_COMMON_HEADER - UINT8 Class; /* Reference Class */ - UINT8 TargetType; /* Used for Index Op */ - UINT8 Reserved; - void *Object; /* NameOp=>HANDLE to obj, IndexOp=>ACPI_OPERAND_OBJECT */ - ACPI_NAMESPACE_NODE *Node; /* RefOf or Namepath */ - union acpi_operand_object **Where; /* Target of Index */ - UINT32 Value; /* Used for Local/Arg/Index/DdbHandle */ + UINT8 Class; /* Reference Class */ + UINT8 TargetType; /* Used for Index Op */ + UINT8 Reserved; + void *Object; /* NameOp=>HANDLE to obj, IndexOp=>ACPI_OPERAND_OBJECT */ + ACPI_NAMESPACE_NODE *Node; /* RefOf or Namepath */ + union acpi_operand_object **Where; /* Target of Index */ + UINT8 *IndexPointer; /* Used for Buffers and Strings */ + UINT32 Value; /* Used for Local/Arg/Index/DdbHandle */ } ACPI_OBJECT_REFERENCE; diff --git a/src/acpica/source/include/acoutput.h b/src/acpica/source/include/acoutput.h index f0cd27a..9570a38 100644 --- a/src/acpica/source/include/acoutput.h +++ b/src/acpica/source/include/acoutput.h @@ -370,8 +370,12 @@ /* DEBUG_PRINT functions */ -#define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist -#define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW plist +#ifndef COMPILER_VA_MACRO + +#define ACPI_DEBUG_PRINT(plist) AcpiDebugPrint plist +#define ACPI_DEBUG_PRINT_RAW(plist) AcpiDebugPrintRaw plist + +#else /* Helper macros for DEBUG_PRINT */ @@ -391,6 +395,11 @@ ACPI_DO_DEBUG_PRINT (AcpiDebugPrintRaw, Level, Line, \ Filename, Modulename, Component, __VA_ARGS__) +#define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist +#define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW plist + +#endif + /* * Function entry tracing diff --git a/src/acpica/source/include/acpixf.h b/src/acpica/source/include/acpixf.h index 93d4284..cf0bb58 100644 --- a/src/acpica/source/include/acpixf.h +++ b/src/acpica/source/include/acpixf.h @@ -118,7 +118,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20150515 +#define ACPI_CA_VERSION 0x20150616 #include "acconfig.h" #include "actypes.h" @@ -274,6 +274,15 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE); ACPI_INIT_GLOBAL (UINT8, AcpiGbl_Use32BitFadtAddresses, FALSE); /* + * Optionally use 32-bit FACS table addresses. + * It is reported that some platforms fail to resume from system suspending + * if 64-bit FACS table address is selected: + * https://bugzilla.kernel.org/show_bug.cgi?id=74021 + * Default is TRUE, favor the 32-bit addresses. + */ +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_Use32BitFacsAddresses, TRUE); + +/* * Optionally truncate I/O addresses to 16 bits. Provides compatibility * with other ACPI implementations. NOTE: During ACPICA initialization, * this value is set to TRUE if any Windows OSI strings have been @@ -294,6 +303,11 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableAutoRepair, FALSE); ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableSsdtTableInstall, FALSE); /* + * Optionally enable runtime namespace override. + */ +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_RuntimeNamespaceOverride, TRUE); + +/* * We keep track of the latest version of Windows that has been requested by * the BIOS. ACPI 5.0. */ @@ -1138,14 +1152,8 @@ AcpiLeaveSleepState ( ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiSetFirmwareWakingVector ( - UINT32 PhysicalAddress)) - -#if ACPI_MACHINE_WIDTH == 64 -ACPI_HW_DEPENDENT_RETURN_STATUS ( -ACPI_STATUS -AcpiSetFirmwareWakingVector64 ( - UINT64 PhysicalAddress)) -#endif + ACPI_PHYSICAL_ADDRESS PhysicalAddress, + ACPI_PHYSICAL_ADDRESS PhysicalAddress64)) /* diff --git a/src/acpica/source/include/acstruct.h b/src/acpica/source/include/acstruct.h index ad43d6c..d647826 100644 --- a/src/acpica/source/include/acstruct.h +++ b/src/acpica/source/include/acstruct.h @@ -157,6 +157,7 @@ typedef struct acpi_walk_state UINT8 ReturnUsed; UINT8 ScopeDepth; UINT8 PassNumber; /* Parse pass during table load */ + BOOLEAN NamespaceOverride; /* Override existing objects */ UINT8 ResultSize; /* Total elements for the result stack */ UINT8 ResultCount; /* Current number of occupied elements of result stack */ UINT32 AmlOffset; diff --git a/src/acpica/source/include/actbl.h b/src/acpica/source/include/actbl.h index f3cf709..7ec5f62 100644 --- a/src/acpica/source/include/actbl.h +++ b/src/acpica/source/include/actbl.h @@ -139,6 +139,7 @@ #define ACPI_SIG_DSDT "DSDT" /* Differentiated System Description Table */ #define ACPI_SIG_FADT "FACP" /* Fixed ACPI Description Table */ #define ACPI_SIG_FACS "FACS" /* Firmware ACPI Control Structure */ +#define ACPI_SIG_OSDT "OSDT" /* Override System Description Table */ #define ACPI_SIG_PSDT "PSDT" /* Persistent System Description Table */ #define ACPI_SIG_RSDP "RSD PTR " /* Root System Description Pointer */ #define ACPI_SIG_RSDT "RSDT" /* Root System Description Table */ diff --git a/src/acpica/source/include/actbl1.h b/src/acpica/source/include/actbl1.h index 1c508a0..f7eaa4c 100644 --- a/src/acpica/source/include/actbl1.h +++ b/src/acpica/source/include/actbl1.h @@ -1046,10 +1046,22 @@ typedef struct acpi_madt_generic_distributor UINT64 BaseAddress; UINT32 GlobalIrqBase; UINT8 Version; - UINT8 Reserved2[3]; /* Reserved - must be zero */ + UINT8 Reserved2[3]; /* Reserved - must be zero */ } ACPI_MADT_GENERIC_DISTRIBUTOR; +/* Values for Version field above */ + +enum AcpiMadtGicVersion +{ + ACPI_MADT_GIC_VERSION_NONE = 0, + ACPI_MADT_GIC_VERSION_V1 = 1, + ACPI_MADT_GIC_VERSION_V2 = 2, + ACPI_MADT_GIC_VERSION_V3 = 3, + ACPI_MADT_GIC_VERSION_V4 = 4, + ACPI_MADT_GIC_VERSION_RESERVED = 5 /* 5 and greater are reserved */ +}; + /* 13: Generic MSI Frame (ACPI 5.1) */ diff --git a/src/acpica/source/include/actbl2.h b/src/acpica/source/include/actbl2.h index acc0b5f..c838959 100644 --- a/src/acpica/source/include/actbl2.h +++ b/src/acpica/source/include/actbl2.h @@ -124,8 +124,8 @@ * These tables are not consumed directly by the ACPICA subsystem, but are * included here to support device drivers and the AML disassembler. * - * The tables in this file are defined by third-party specifications, and are - * not defined directly by the ACPI specification itself. + * Generally, the tables in this file are defined by third-party specifications, + * and are not defined directly by the ACPI specification itself. * ******************************************************************************/ @@ -154,6 +154,7 @@ #define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */ #define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */ #define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */ +#define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface table */ #define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */ #define ACPI_SIG_VRTC "VRTC" /* Virtual Real Time Clock Table */ #define ACPI_SIG_WAET "WAET" /* Windows ACPI Emulated devices Table */ @@ -1440,21 +1441,91 @@ enum AcpiSpmiInterfaceTypes /******************************************************************************* * * TCPA - Trusted Computing Platform Alliance table - * Version 1 + * Version 2 + * + * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0", + * December 19, 2014 * - * Conforms to "TCG PC Specific Implementation Specification", - * Version 1.1, August 18, 2003 + * NOTE: There are two versions of the table with the same signature -- + * the client version and the server version. * ******************************************************************************/ -typedef struct acpi_table_tcpa +typedef struct acpi_table_tcpa_client +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT16 PlatformClass; + UINT32 MinimumLogLength; /* Minimum length for the event log area */ + UINT64 LogAddress; /* Address of the event log area */ + +} ACPI_TABLE_TCPA_CLIENT; + +typedef struct acpi_table_tcpa_server { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT16 PlatformClass; UINT16 Reserved; - UINT32 MaxLogLength; /* Maximum length for the event log area */ + UINT64 MinimumLogLength; /* Minimum length for the event log area */ UINT64 LogAddress; /* Address of the event log area */ + UINT16 SpecRevision; + UINT8 DeviceFlags; + UINT8 InterruptFlags; + UINT8 GpeNumber; + UINT8 Reserved2[3]; + UINT32 GlobalInterrupt; + ACPI_GENERIC_ADDRESS Address; + UINT32 Reserved3; + ACPI_GENERIC_ADDRESS ConfigAddress; + UINT8 Group; + UINT8 Bus; /* PCI Bus/Segment/Function numbers */ + UINT8 Device; + UINT8 Function; + +} ACPI_TABLE_TCPA_SERVER; + +/* Values for DeviceFlags above */ + +#define ACPI_TCPA_PCI_DEVICE (1) +#define ACPI_TCPA_BUS_PNP (1<<1) +#define ACPI_TCPA_ADDRESS_VALID (1<<2) + +/* Values for InterruptFlags above */ + +#define ACPI_TCPA_INTERRUPT_MODE (1) +#define ACPI_TCPA_INTERRUPT_POLARITY (1<<1) +#define ACPI_TCPA_SCI_VIA_GPE (1<<2) +#define ACPI_TCPA_GLOBAL_INTERRUPT (1<<3) + + +/******************************************************************************* + * + * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table + * Version 4 + * + * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0", + * December 19, 2014 + * + ******************************************************************************/ + +typedef struct acpi_table_tpm2 +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT16 PlatformClass; + UINT16 Reserved; + UINT64 ControlAddress; + UINT32 StartMethod; + + /* Platform-specific data follows */ + +} ACPI_TABLE_TPM2; + +/* Values for StartMethod above */ -} ACPI_TABLE_TCPA; +#define ACPI_TPM2_NOT_ALLOWED 0 +#define ACPI_TPM2_START_METHOD 2 +#define ACPI_TPM2_MEMORY_MAPPED 6 +#define ACPI_TPM2_COMMAND_BUFFER 7 +#define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD 8 /******************************************************************************* diff --git a/src/acpica/source/include/actbl3.h b/src/acpica/source/include/actbl3.h index 88ac753..bfc18d7 100644 --- a/src/acpica/source/include/actbl3.h +++ b/src/acpica/source/include/actbl3.h @@ -124,7 +124,8 @@ * These tables are not consumed directly by the ACPICA subsystem, but are * included here to support device drivers and the AML disassembler. * - * The tables in this file are fully defined within the ACPI specification. + * In general, the tables in this file are fully defined within the ACPI + * specification. * ******************************************************************************/ @@ -143,7 +144,6 @@ #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */ #define ACPI_SIG_RASF "RASF" /* RAS Feature table */ #define ACPI_SIG_STAO "STAO" /* Status Override table */ -#define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface table */ #define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */ #define ACPI_SIG_XENV "XENV" /* Xen Environment table */ @@ -920,41 +920,6 @@ typedef struct acpi_table_stao /******************************************************************************* * - * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table - * Version 3 - * - * Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November 2011 - * - ******************************************************************************/ - -typedef struct acpi_table_tpm2 -{ - ACPI_TABLE_HEADER Header; /* Common ACPI table header */ - UINT32 Flags; - UINT64 ControlAddress; - UINT32 StartMethod; - -} ACPI_TABLE_TPM2; - -/* Control area structure (not part of table, pointed to by ControlAddress) */ - -typedef struct acpi_tpm2_control -{ - UINT32 Reserved; - UINT32 Error; - UINT32 Cancel; - UINT32 Start; - UINT64 InterruptControl; - UINT32 CommandSize; - UINT64 CommandAddress; - UINT32 ResponseSize; - UINT64 ResponseAddress; - -} ACPI_TPM2_CONTROL; - - -/******************************************************************************* - * * WPBT - Windows Platform Environment Table (ACPI 6.0) * Version 1 * diff --git a/src/acpica/source/include/actypes.h b/src/acpica/source/include/actypes.h index 98fcf48..0b7b37e 100644 --- a/src/acpica/source/include/actypes.h +++ b/src/acpica/source/include/actypes.h @@ -627,14 +627,14 @@ typedef UINT64 ACPI_INTEGER; #define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (UINT32, (a)) == *ACPI_CAST_PTR (UINT32, (b))) #define ACPI_MOVE_NAME(dest,src) (*ACPI_CAST_PTR (UINT32, (dest)) = *ACPI_CAST_PTR (UINT32, (src))) #else -#define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) -#define ACPI_MOVE_NAME(dest,src) (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE)) +#define ACPI_COMPARE_NAME(a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) +#define ACPI_MOVE_NAME(dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE)) #endif /* Support for the special RSDP signature (8 characters) */ -#define ACPI_VALIDATE_RSDP_SIG(a) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8)) -#define ACPI_MAKE_RSDP_SIG(dest) (ACPI_MEMCPY (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8)) +#define ACPI_VALIDATE_RSDP_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8)) +#define ACPI_MAKE_RSDP_SIG(dest) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8)) /******************************************************************************* @@ -839,10 +839,6 @@ typedef UINT32 ACPI_EVENT_STATUS; #define ACPI_GPE_ENABLE 0 #define ACPI_GPE_DISABLE 1 #define ACPI_GPE_CONDITIONAL_ENABLE 2 -#define ACPI_GPE_SAVE_MASK 4 - -#define ACPI_GPE_ENABLE_SAVE (ACPI_GPE_ENABLE | ACPI_GPE_SAVE_MASK) -#define ACPI_GPE_DISABLE_SAVE (ACPI_GPE_DISABLE | ACPI_GPE_SAVE_MASK) /* * GPE info flags - Per GPE @@ -1299,6 +1295,10 @@ UINT32 (*ACPI_INTERFACE_HANDLER) ( #define ACPI_UUID_LENGTH 16 +/* Length of 3-byte PCI class code values when converted back to a string */ + +#define ACPI_PCICLS_STRING_SIZE 7 /* Includes null terminator */ + /* Structures used for device/processor HID, UID, CID, and SUB */ @@ -1327,7 +1327,7 @@ typedef struct acpi_device_info UINT32 Name; /* ACPI object Name */ ACPI_OBJECT_TYPE Type; /* ACPI object Type */ UINT8 ParamCount; /* If a method, required parameter count */ - UINT8 Valid; /* Indicates which optional fields are valid */ + UINT16 Valid; /* Indicates which optional fields are valid */ UINT8 Flags; /* Miscellaneous info */ UINT8 HighestDstates[4]; /* _SxD values: 0xFF indicates not valid */ UINT8 LowestDstates[5]; /* _SxW values: 0xFF indicates not valid */ @@ -1336,6 +1336,7 @@ typedef struct acpi_device_info ACPI_PNP_DEVICE_ID HardwareId; /* _HID value */ ACPI_PNP_DEVICE_ID UniqueId; /* _UID value */ ACPI_PNP_DEVICE_ID SubsystemId; /* _SUB value */ + ACPI_PNP_DEVICE_ID ClassCode; /* _CLS value */ ACPI_PNP_DEVICE_ID_LIST CompatibleIdList; /* _CID list <must be last> */ } ACPI_DEVICE_INFO; @@ -1346,14 +1347,15 @@ typedef struct acpi_device_info /* Flags for Valid field above (AcpiGetObjectInfo) */ -#define ACPI_VALID_STA 0x01 -#define ACPI_VALID_ADR 0x02 -#define ACPI_VALID_HID 0x04 -#define ACPI_VALID_UID 0x08 -#define ACPI_VALID_SUB 0x10 -#define ACPI_VALID_CID 0x20 -#define ACPI_VALID_SXDS 0x40 -#define ACPI_VALID_SXWS 0x80 +#define ACPI_VALID_STA 0x0001 +#define ACPI_VALID_ADR 0x0002 +#define ACPI_VALID_HID 0x0004 +#define ACPI_VALID_UID 0x0008 +#define ACPI_VALID_SUB 0x0010 +#define ACPI_VALID_CID 0x0020 +#define ACPI_VALID_CLS 0x0040 +#define ACPI_VALID_SXDS 0x0100 +#define ACPI_VALID_SXWS 0x0200 /* Flags for _STA return value (CurrentStatus above) */ diff --git a/src/acpica/source/include/acutils.h b/src/acpica/source/include/acutils.h index 93edeee..99839df 100644 --- a/src/acpica/source/include/acutils.h +++ b/src/acpica/source/include/acutils.h @@ -323,85 +323,113 @@ AcpiUtSubsystemShutdown ( */ #ifndef ACPI_USE_SYSTEM_CLIBRARY +#ifdef memcmp +#error memcmp defined! +#endif + +#undef strstr +#undef strchr +#undef strlen +#undef strcpy +#undef strncpy +#undef strncmp +#undef strcmp +#undef strcat +#undef strncat +#undef strtoul +#undef memcmp +#undef memcpy +#undef memset +#undef toupper +#undef tolower +#undef isxdigit +#undef isdigit +#undef isspace +#undef isupper +#undef isprint +#undef isalpha + ACPI_SIZE -AcpiUtStrlen ( +strlen ( const char *String); char * -AcpiUtStrchr ( +strchr ( const char *String, int ch); char * -AcpiUtStrcpy ( +strcpy ( char *DstString, const char *SrcString); char * -AcpiUtStrncpy ( +strncpy ( char *DstString, const char *SrcString, ACPI_SIZE Count); int -AcpiUtMemcmp ( - const char *Buffer1, - const char *Buffer2, - ACPI_SIZE Count); - -int -AcpiUtStrncmp ( +strncmp ( const char *String1, const char *String2, ACPI_SIZE Count); int -AcpiUtStrcmp ( +strcmp ( const char *String1, const char *String2); char * -AcpiUtStrcat ( +strcat ( char *DstString, const char *SrcString); char * -AcpiUtStrncat ( +strncat ( char *DstString, const char *SrcString, ACPI_SIZE Count); UINT32 -AcpiUtStrtoul ( +strtoul ( const char *String, char **Terminator, UINT32 Base); char * -AcpiUtStrstr ( +strstr ( char *String1, char *String2); +int +memcmp ( + void *Buffer1, + void *Buffer2, + ACPI_SIZE Count); + void * -AcpiUtMemcpy ( +memcpy ( void *Dest, const void *Src, ACPI_SIZE Count); void * -AcpiUtMemset ( +memset ( void *Dest, - UINT8 Value, + int Value, ACPI_SIZE Count); int -AcpiUtToUpper ( +toupper ( int c); int -AcpiUtToLower ( +tolower ( int c); + + extern const UINT8 _acpi_ctype[]; #define _ACPI_XA 0x00 /* extra alphabetic - not supported */ @@ -415,13 +443,31 @@ extern const UINT8 _acpi_ctype[]; #define _ACPI_UP 0x01 /* 'A'-'Z' */ #define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ -#define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) -#define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) -#define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD)) -#define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP)) -#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) -#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU)) -#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) +#define isdigit(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) +#define isspace(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) +#define isxdigit(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD)) +#define isupper(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP)) +#define islower(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) +#define isprint(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU)) +#define isalpha(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) + +#ifndef ACPI_CLIBRARY +#define strstr(s1,s2) strstr ((s1), (s2)) +#define strchr(s1,c) strchr ((s1), (c)) +#define strlen(s) (ACPI_SIZE) strlen ((s)) +#define strcpy(d,s) (void) strcpy ((d), (s)) +#define strncpy(d,s,n) (void) strncpy ((d), (s), (ACPI_SIZE)(n)) +#define strncmp(d,s,n) strncmp ((d), (s), (ACPI_SIZE)(n)) +#define strcmp(d,s) strcmp ((d), (s)) +#define strcat(d,s) (void) strcat ((d), (s)) +#define strncat(d,s,n) strncat ((d), (s), (ACPI_SIZE)(n)) +#define strtoul(d,s,n) strtoul ((d), (s), (ACPI_SIZE)(n)) +#define memcmp(s1,s2,n) memcmp((void *)(s1), (void *)(s2), (ACPI_SIZE)(n)) +#define memcpy(d,s,n) (void) memcpy ((d), (s), (ACPI_SIZE)(n)) +#define memset(d,v,n) (void) memset ((d), (v), (ACPI_SIZE)(n)) +#define toupper(c) toupper ((int) (c)) +#define tolower(c) tolower ((int) (c)) +#endif /* ACPI_CLIBRARY */ #endif /* !ACPI_USE_SYSTEM_CLIBRARY */ @@ -674,6 +720,11 @@ AcpiUtExecute_CID ( ACPI_NAMESPACE_NODE *DeviceNode, ACPI_PNP_DEVICE_ID_LIST **ReturnCidList); +ACPI_STATUS +AcpiUtExecute_CLS ( + ACPI_NAMESPACE_NODE *DeviceNode, + ACPI_PNP_DEVICE_ID **ReturnId); + /* * utlock - reader/writer locks diff --git a/src/acpica/source/include/acuuid.h b/src/acpica/source/include/acuuid.h new file mode 100644 index 0000000..f43ec22 --- /dev/null +++ b/src/acpica/source/include/acuuid.h @@ -0,0 +1,162 @@ +/****************************************************************************** + * + * Name: acuuid.h - ACPI-related UUID/GUID definitions + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2015, 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 __ACUUID_H__ +#define __ACUUID_H__ + +/* + * Note1: UUIDs and GUIDs are defined to be identical in ACPI. + * + * Note2: This file is standalone and should remain that way. + */ + +/* Controllers */ + +#define UUID_GPIO_CONTROLLER "4f248f40-d5e2-499f-834c-27758ea1cd3f" +#define UUID_USB_CONTROLLER "ce2ee385-00e6-48cb-9f05-2edb927c4899" +#define UUID_SATA_CONTROLLER "e4db149b-fcfe-425b-a6d8-92357d78fc7f" + +/* Devices */ + +#define UUID_PCI_HOST_BRIDGE "33db4d5b-1ff7-401c-9657-7441c03dd766" +#define UUID_I2C_DEVICE "3cdff6f7-4267-4555-ad05-b30a3d8938de" +#define UUID_POWER_BUTTON "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c" + +/* Interfaces */ + +#define UUID_DEVICE_LABELING "e5c937d0-3553-4d7a-9117-ea4d19c3434d" +#define UUID_PHYSICAL_PRESENCE "3dddfaa6-361b-4eb4-a424-8d10089d1653" + +/* NVDIMM - NFIT table */ + +#define UUID_VOLATILE_MEMORY "7305944f-fdda-44e3-b16c-3f22d252e5d0" +#define UUID_PERSISTENT_MEMORY "66f0d379-b4f3-4074-ac43-0d3318b78cdb" +#define UUID_CONTROL_REGION "92f701f6-13b4-405d-910b-299367e8234c" +#define UUID_DATA_REGION "91af0530-5d86-470e-a6b0-0a2db9408249" +#define UUID_VOLATILE_VIRTUAL_DISK "77ab535a-45fc-624b-5560-f7b281d1f96e" +#define UUID_VOLATILE_VIRTUAL_CD "3d5abd30-4175-87ce-6d64-d2ade523c4bb" +#define UUID_PERSISTENT_VIRTUAL_DISK "5cea02c9-4d07-69d3-269f-4496fbe096f9" +#define UUID_PERSISTENT_VIRTUAL_CD "08018188-42cd-bb48-100f-5387d53ded3d" + +/* Miscellaneous */ + +#define UUID_PLATFORM_CAPABILITIES "0811b06e-4a27-44f9-8d60-3cbbc22e7b48" +#define UUID_DYNAMIC_ENUMERATION "d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf" +#define UUID_BATTERY_THERMAL_LIMIT "4c2067e3-887d-475c-9720-4af1d3ed602e" +#define UUID_THERMAL_EXTENSIONS "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500" +#define UUID_DEVICE_PROPERTIES "daffd814-6eba-4d8c-8a91-bc9bbf4aa301" + + +#endif /* __AUUID_H__ */ diff --git a/src/acpica/source/include/platform/acenv.h b/src/acpica/source/include/platform/acenv.h index f596d8c..d3ebbfe 100644 --- a/src/acpica/source/include/platform/acenv.h +++ b/src/acpica/source/include/platform/acenv.h @@ -421,27 +421,49 @@ /* We will be linking to the standard Clib functions */ -#define ACPI_STRSTR(s1,s2) strstr((s1), (s2)) -#define ACPI_STRCHR(s1,c) strchr((s1), (c)) -#define ACPI_STRLEN(s) (ACPI_SIZE) strlen((s)) -#define ACPI_STRCPY(d,s) (void) strcpy((d), (s)) -#define ACPI_STRNCPY(d,s,n) (void) strncpy((d), (s), (ACPI_SIZE)(n)) -#define ACPI_STRNCMP(d,s,n) strncmp((d), (s), (ACPI_SIZE)(n)) -#define ACPI_STRCMP(d,s) strcmp((d), (s)) -#define ACPI_STRCAT(d,s) (void) strcat((d), (s)) -#define ACPI_STRNCAT(d,s,n) strncat((d), (s), (ACPI_SIZE)(n)) -#define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (ACPI_SIZE)(n)) -#define ACPI_MEMCMP(s1,s2,n) memcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n)) -#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (ACPI_SIZE)(n)) -#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (ACPI_SIZE)(n)) -#define ACPI_TOUPPER(i) toupper((int) (i)) -#define ACPI_TOLOWER(i) tolower((int) (i)) -#define ACPI_IS_XDIGIT(i) isxdigit((int) (i)) -#define ACPI_IS_DIGIT(i) isdigit((int) (i)) -#define ACPI_IS_SPACE(i) isspace((int) (i)) -#define ACPI_IS_UPPER(i) isupper((int) (i)) -#define ACPI_IS_PRINT(i) isprint((int) (i)) -#define ACPI_IS_ALPHA(i) isalpha((int) (i)) +#undef strstr +#undef strchr +#undef strlen +#undef strcpy +#undef strncpy +#undef strncmp +#undef strcmp +#undef strcat +#undef strncat +#undef strtoul +#undef memcmp +#undef memcpy +#undef memset +#undef toupper +#undef tolower +#undef isxdigit +#undef isdigit +#undef isspace +#undef isupper +#undef isprint +#undef isalpha + +#define strstr(s1,s2) strstr((s1), (s2)) +#define strchr(s1,c) strchr((s1), (c)) +#define strlen(s) (ACPI_SIZE) strlen((s)) +#define strcpy(d,s) (void) strcpy((d), (s)) +#define strncpy(d,s,n) (void) strncpy((d), (s), (ACPI_SIZE)(n)) +#define strncmp(d,s,n) strncmp((d), (s), (ACPI_SIZE)(n)) +#define strcmp(d,s) strcmp((d), (s)) +#define strcat(d,s) (void) strcat((d), (s)) +#define strncat(d,s,n) strncat((d), (s), (ACPI_SIZE)(n)) +#define strtoul(d,s,n) strtoul((d), (s), (ACPI_SIZE)(n)) +#define memcmp(s1,s2,n) memcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n)) +#define memcpy(d,s,n) (void) memcpy((d), (s), (ACPI_SIZE)(n)) +#define memset(d,s,n) (void) memset((d), (s), (ACPI_SIZE)(n)) +#define toupper(i) toupper((int) (i)) +#define tolower(i) tolower((int) (i)) +#define isxdigit(i) isxdigit((int) (i)) +#define isdigit(i) isdigit((int) (i)) +#define isspace(i) isspace((int) (i)) +#define isupper(i) isupper((int) (i)) +#define isprint(i) isprint((int) (i)) +#define isalpha(i) isalpha((int) (i)) #else @@ -480,22 +502,6 @@ typedef char *va_list; /* Use the local (ACPICA) definitions of the clib functions */ -#define ACPI_STRSTR(s1,s2) AcpiUtStrstr ((s1), (s2)) -#define ACPI_STRCHR(s1,c) AcpiUtStrchr ((s1), (c)) -#define ACPI_STRLEN(s) (ACPI_SIZE) AcpiUtStrlen ((s)) -#define ACPI_STRCPY(d,s) (void) AcpiUtStrcpy ((d), (s)) -#define ACPI_STRNCPY(d,s,n) (void) AcpiUtStrncpy ((d), (s), (ACPI_SIZE)(n)) -#define ACPI_STRNCMP(d,s,n) AcpiUtStrncmp ((d), (s), (ACPI_SIZE)(n)) -#define ACPI_STRCMP(d,s) AcpiUtStrcmp ((d), (s)) -#define ACPI_STRCAT(d,s) (void) AcpiUtStrcat ((d), (s)) -#define ACPI_STRNCAT(d,s,n) AcpiUtStrncat ((d), (s), (ACPI_SIZE)(n)) -#define ACPI_STRTOUL(d,s,n) AcpiUtStrtoul ((d), (s), (ACPI_SIZE)(n)) -#define ACPI_MEMCMP(s1,s2,n) AcpiUtMemcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n)) -#define ACPI_MEMCPY(d,s,n) (void) AcpiUtMemcpy ((d), (s), (ACPI_SIZE)(n)) -#define ACPI_MEMSET(d,v,n) (void) AcpiUtMemset ((d), (v), (ACPI_SIZE)(n)) -#define ACPI_TOUPPER(c) AcpiUtToUpper ((int) (c)) -#define ACPI_TOLOWER(c) AcpiUtToLower ((int) (c)) - #endif /* ACPI_USE_SYSTEM_CLIBRARY */ #ifndef ACPI_FILE diff --git a/src/acpica/source/include/platform/acenvex.h b/src/acpica/source/include/platform/acenvex.h index 26467b9..ac1cb92 100644 --- a/src/acpica/source/include/platform/acenvex.h +++ b/src/acpica/source/include/platform/acenvex.h @@ -128,6 +128,12 @@ #if defined(_LINUX) || defined(__linux__) #include "aclinuxex.h" +#elif defined(_AED_EFI) +#include "acefiex.h" + +#elif defined(_GNU_EFI) +#include "acefiex.h" + #elif defined(__DragonFly__) #include "acdragonflyex.h" diff --git a/src/acpica/source/include/platform/acgcc.h b/src/acpica/source/include/platform/acgcc.h index fde18f4..958b4ac 100644 --- a/src/acpica/source/include/platform/acgcc.h +++ b/src/acpica/source/include/platform/acgcc.h @@ -147,4 +147,8 @@ #undef strchr #endif +/* GCC supports __VA_ARGS__ in macros */ + +#define COMPILER_VA_MACRO 1 + #endif /* __ACGCC_H__ */ diff --git a/src/acpica/source/tools/acpiexec/aehandlers.c b/src/acpica/source/tools/acpiexec/aehandlers.c index eb1e3ab..c4eb02a 100644 --- a/src/acpica/source/tools/acpiexec/aehandlers.c +++ b/src/acpica/source/tools/acpiexec/aehandlers.c @@ -450,7 +450,7 @@ AeExceptionHandler ( Arg[1].Type = ACPI_TYPE_STRING; Arg[1].String.Pointer = ACPI_CAST_PTR (char, Exception); - Arg[1].String.Length = ACPI_STRLEN (Exception); + Arg[1].String.Length = strlen (Exception); Arg[2].Type = ACPI_TYPE_INTEGER; Arg[2].Integer.Value = AcpiOsGetThreadId(); diff --git a/src/acpica/source/tools/acpiexec/aeinitfile.c b/src/acpica/source/tools/acpiexec/aeinitfile.c index 0de7b96..deb1795 100644 --- a/src/acpica/source/tools/acpiexec/aeinitfile.c +++ b/src/acpica/source/tools/acpiexec/aeinitfile.c @@ -130,8 +130,9 @@ AeDoOneOverride ( ACPI_WALK_STATE *WalkState); -#define AE_FILE_BUFFER_SIZE 512 +#define AE_FILE_BUFFER_SIZE 512 +static char LineBuffer[AE_FILE_BUFFER_SIZE]; static char NameBuffer[AE_FILE_BUFFER_SIZE]; static char ValueBuffer[AE_FILE_BUFFER_SIZE]; static FILE *InitFile; @@ -199,15 +200,18 @@ AeDoObjectOverrides ( ObjDesc = AcpiUtCreateIntegerObject (0); WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL); - NameBuffer[0] = '\\'; - /* Read the entire file line-by-line */ + /* Read the entire file line-by-line */ - while (fscanf (InitFile, "%s %s\n", - ACPI_CAST_PTR (char, &NameBuffer[1]), - ACPI_CAST_PTR (char, &ValueBuffer)) == 2) + while (fgets (LineBuffer, AE_FILE_BUFFER_SIZE, InitFile) != NULL) { + if (sscanf (LineBuffer, "%s %s\n", + &NameBuffer[1], ValueBuffer) != 2) + { + goto CleanupAndExit; + } + /* Add a root prefix if not present in the string */ i = 0; @@ -221,6 +225,7 @@ AeDoObjectOverrides ( /* Cleanup */ +CleanupAndExit: fclose (InitFile); AcpiDsDeleteWalkState (WalkState); AcpiUtRemoveReference (ObjDesc); @@ -272,7 +277,8 @@ AeDoOneOverride ( Status = AcpiUtStrtoul64 (ValueString, 0, &Value); if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("%s\n", AcpiFormatException (Status)); + AcpiOsPrintf ("%s %s\n", ValueString, + AcpiFormatException (Status)); return; } diff --git a/src/acpica/source/tools/acpiexec/aeregion.c b/src/acpica/source/tools/acpiexec/aeregion.c index a7823bf..55b8e7f 100644 --- a/src/acpica/source/tools/acpiexec/aeregion.c +++ b/src/acpica/source/tools/acpiexec/aeregion.c @@ -804,7 +804,7 @@ AeRegionHandler ( /* Initialize the region with the default fill value */ - ACPI_MEMSET (RegionElement->Buffer, + memset (RegionElement->Buffer, AcpiGbl_RegionFillValue, RegionElement->Length); /* @@ -819,7 +819,7 @@ AeRegionHandler ( * Copy the old buffer to its same location within the new * buffer */ - ACPI_MEMCPY (BufferValue, OldBuffer, RegionLength); + memcpy (BufferValue, OldBuffer, RegionLength); AcpiOsFree (OldBuffer); } } @@ -848,7 +848,7 @@ AeRegionHandler ( /* Initialize the region with the default fill value */ - ACPI_MEMSET (RegionElement->Buffer, AcpiGbl_RegionFillValue, Length); + memset (RegionElement->Buffer, AcpiGbl_RegionFillValue, Length); RegionElement->Address = BaseAddress; RegionElement->Length = Length; @@ -915,14 +915,14 @@ DoFunction: /* * Set the pointer Value to whatever is in the buffer */ - ACPI_MEMCPY (Value, BufferValue, ByteWidth); + memcpy (Value, BufferValue, ByteWidth); break; case ACPI_WRITE: /* * Write the contents of Value to the buffer */ - ACPI_MEMCPY (BufferValue, Value, ByteWidth); + memcpy (BufferValue, Value, ByteWidth); break; default: