From 57c418cdd6e5a51145490dc14291413d5f2f277e Mon Sep 17 00:00:00 2001 From: Fredrik Holmqvist Date: Sun, 21 Feb 2010 19:46:35 +0000 Subject: [PATCH] Update ACPI to 20100121. Changes from ACPI include: * eliminate unnecessary invocations of the _STA method, which in turn can improve boot times. * Implemented an additional repair for predefined method return values. * Removed the obsolete ACPI_INTEGER data type. * Removed the unused UINT32_STRUCT type, and the obsolete Integer64 field in the parse tree object. * Added additional warning options for the gcc-4 generation. * Enhanced automatic data type conversions for predefined name repairs. * Implemented automatic removal of null package elements during predefined name repairs. * Implemented a repair for the predefined _FDE and _GTM names. * Implemented additional module-level code support. * Fixed possible mutex acquisition errors when running _REG methods. * Fixed a possible memory leak during module-level code execution. * Removed messages for successful predefined repair(s). * Implemented a post-order callback to AcpiWalkNamespace. * Modified the behavior of the operation region memory mapping cache for SystemMemory. * Implemented an automatic repair for predefined methods that must return sorted lists. * Fixed a possible fault during predefined name validation if a return Package object contains NULL elements. * Implemented additional module-level executable AML code support. * Fixed a problem where an Operation Region _REG method could be executed more than once. * Fixed a possible memory leak for the Scope() ASL operator. * Implemented a run-time repair for the _MAT predefined method. * Implemented a run-time repair for the _BIF and _BIX predefined methods. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35559 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/bus_managers/acpi/Jamfile | 1 + .../kernel/bus_managers/acpi/common/adfile.c | 26 +- .../kernel/bus_managers/acpi/common/adisasm.c | 161 +--- .../kernel/bus_managers/acpi/common/adwalk.c | 36 +- .../bus_managers/acpi/common/dmextern.c | 646 ++++++++++++++++ .../bus_managers/acpi/common/dmrestag.c | 2 +- .../kernel/bus_managers/acpi/common/dmtable.c | 5 +- .../bus_managers/acpi/common/dmtbdump.c | 2 +- .../bus_managers/acpi/common/dmtbinfo.c | 2 +- .../kernel/bus_managers/acpi/common/getopt.c | 10 +- .../bus_managers/acpi/compiler/Makefile | 1 + .../bus_managers/acpi/compiler/aslanalyze.c | 10 +- .../bus_managers/acpi/compiler/aslcodegen.c | 2 +- .../bus_managers/acpi/compiler/aslcompile.c | 33 +- .../bus_managers/acpi/compiler/aslcompiler.h | 6 +- .../bus_managers/acpi/compiler/aslcompiler.l | 2 +- .../{aslcompiler.y.y => aslcompiler.y} | 274 +++---- .../bus_managers/acpi/compiler/asldefine.h | 4 +- .../bus_managers/acpi/compiler/aslerror.c | 17 +- .../bus_managers/acpi/compiler/aslfiles.c | 2 +- .../bus_managers/acpi/compiler/aslfold.c | 2 +- .../bus_managers/acpi/compiler/aslglobal.h | 10 +- .../bus_managers/acpi/compiler/asllength.c | 2 +- .../bus_managers/acpi/compiler/asllisting.c | 2 +- .../bus_managers/acpi/compiler/aslload.c | 23 +- .../bus_managers/acpi/compiler/asllookup.c | 10 +- .../bus_managers/acpi/compiler/aslmain.c | 5 +- .../bus_managers/acpi/compiler/aslmap.c | 2 +- .../bus_managers/acpi/compiler/aslopcodes.c | 10 +- .../bus_managers/acpi/compiler/asloperands.c | 30 +- .../bus_managers/acpi/compiler/aslopt.c | 2 +- .../bus_managers/acpi/compiler/aslresource.c | 4 +- .../bus_managers/acpi/compiler/aslrestype1.c | 2 +- .../bus_managers/acpi/compiler/aslrestype2.c | 2 +- .../bus_managers/acpi/compiler/aslstartup.c | 2 +- .../bus_managers/acpi/compiler/aslstubs.c | 2 +- .../bus_managers/acpi/compiler/asltransform.c | 63 +- .../bus_managers/acpi/compiler/asltree.c | 4 +- .../bus_managers/acpi/compiler/asltypes.h | 15 +- .../bus_managers/acpi/compiler/aslutils.c | 28 +- .../bus_managers/acpi/debugger/dbcmds.c | 62 +- .../bus_managers/acpi/debugger/dbdisply.c | 2 +- .../bus_managers/acpi/debugger/dbexec.c | 8 +- .../bus_managers/acpi/debugger/dbfileio.c | 7 +- .../bus_managers/acpi/debugger/dbhistry.c | 2 +- .../bus_managers/acpi/debugger/dbinput.c | 4 +- .../bus_managers/acpi/debugger/dbstats.c | 4 +- .../bus_managers/acpi/debugger/dbutils.c | 6 +- .../bus_managers/acpi/debugger/dbxface.c | 2 +- .../bus_managers/acpi/disassembler/dmbuffer.c | 2 +- .../bus_managers/acpi/disassembler/dmnames.c | 2 +- .../bus_managers/acpi/disassembler/dmobject.c | 2 +- .../bus_managers/acpi/disassembler/dmopcode.c | 6 +- .../bus_managers/acpi/disassembler/dmresrc.c | 2 +- .../bus_managers/acpi/disassembler/dmresrcl.c | 2 +- .../bus_managers/acpi/disassembler/dmresrcs.c | 2 +- .../bus_managers/acpi/disassembler/dmutils.c | 120 +-- .../bus_managers/acpi/disassembler/dmwalk.c | 107 +-- .../bus_managers/acpi/dispatcher/dsfield.c | 12 +- .../bus_managers/acpi/dispatcher/dsinit.c | 4 +- .../bus_managers/acpi/dispatcher/dsmethod.c | 4 +- .../bus_managers/acpi/dispatcher/dsmthdat.c | 5 +- .../bus_managers/acpi/dispatcher/dsobject.c | 10 +- .../bus_managers/acpi/dispatcher/dsopcode.c | 2 +- .../bus_managers/acpi/dispatcher/dsutils.c | 2 +- .../bus_managers/acpi/dispatcher/dswexec.c | 2 +- .../bus_managers/acpi/dispatcher/dswload.c | 123 ++-- .../bus_managers/acpi/dispatcher/dswscope.c | 2 +- .../bus_managers/acpi/dispatcher/dswstate.c | 2 +- .../kernel/bus_managers/acpi/events/evevent.c | 2 +- .../kernel/bus_managers/acpi/events/evgpe.c | 2 +- .../bus_managers/acpi/events/evgpeblk.c | 6 +- .../kernel/bus_managers/acpi/events/evmisc.c | 2 +- .../bus_managers/acpi/events/evregion.c | 93 ++- .../bus_managers/acpi/events/evrgnini.c | 18 +- .../kernel/bus_managers/acpi/events/evsci.c | 2 +- .../kernel/bus_managers/acpi/events/evxface.c | 6 +- .../bus_managers/acpi/events/evxfevnt.c | 6 +- .../bus_managers/acpi/events/evxfregn.c | 6 +- .../bus_managers/acpi/executer/exconfig.c | 20 +- .../bus_managers/acpi/executer/exconvrt.c | 17 +- .../bus_managers/acpi/executer/excreate.c | 2 +- .../bus_managers/acpi/executer/exdump.c | 2 +- .../bus_managers/acpi/executer/exfield.c | 11 +- .../bus_managers/acpi/executer/exfldio.c | 50 +- .../bus_managers/acpi/executer/exmisc.c | 16 +- .../bus_managers/acpi/executer/exmutex.c | 20 +- .../bus_managers/acpi/executer/exnames.c | 2 +- .../bus_managers/acpi/executer/exoparg1.c | 44 +- .../bus_managers/acpi/executer/exoparg2.c | 6 +- .../bus_managers/acpi/executer/exoparg3.c | 4 +- .../bus_managers/acpi/executer/exoparg6.c | 13 +- .../bus_managers/acpi/executer/exprep.c | 2 +- .../bus_managers/acpi/executer/exregion.c | 68 +- .../bus_managers/acpi/executer/exresnte.c | 2 +- .../bus_managers/acpi/executer/exresolv.c | 2 +- .../bus_managers/acpi/executer/exresop.c | 2 +- .../bus_managers/acpi/executer/exstore.c | 2 +- .../bus_managers/acpi/executer/exstoren.c | 2 +- .../bus_managers/acpi/executer/exstorob.c | 2 +- .../bus_managers/acpi/executer/exsystem.c | 4 +- .../bus_managers/acpi/executer/exutils.c | 24 +- .../bus_managers/acpi/hardware/hwacpi.c | 2 +- .../kernel/bus_managers/acpi/hardware/hwgpe.c | 9 +- .../bus_managers/acpi/hardware/hwregs.c | 2 +- .../bus_managers/acpi/hardware/hwsleep.c | 2 +- .../bus_managers/acpi/hardware/hwtimer.c | 4 +- .../bus_managers/acpi/hardware/hwvalid.c | 2 +- .../bus_managers/acpi/hardware/hwxface.c | 2 +- .../kernel/bus_managers/acpi/include/acapps.h | 34 +- .../bus_managers/acpi/include/accommon.h | 2 +- .../bus_managers/acpi/include/acconfig.h | 6 +- .../bus_managers/acpi/include/acdebug.h | 12 +- .../bus_managers/acpi/include/acdisasm.h | 76 +- .../bus_managers/acpi/include/acdispat.h | 2 +- .../bus_managers/acpi/include/acevents.h | 4 +- .../bus_managers/acpi/include/acexcep.h | 2 +- .../bus_managers/acpi/include/acglobal.h | 3 +- .../bus_managers/acpi/include/achware.h | 2 +- .../bus_managers/acpi/include/acinterp.h | 44 +- .../bus_managers/acpi/include/aclocal.h | 29 +- .../bus_managers/acpi/include/acmacros.h | 16 +- .../bus_managers/acpi/include/acnames.h | 2 +- .../bus_managers/acpi/include/acnamesp.h | 39 +- .../bus_managers/acpi/include/acobject.h | 11 +- .../bus_managers/acpi/include/acopcode.h | 2 +- .../bus_managers/acpi/include/acoutput.h | 10 +- .../bus_managers/acpi/include/acparser.h | 2 +- .../kernel/bus_managers/acpi/include/acpi.h | 2 +- .../bus_managers/acpi/include/acpiosxf.h | 6 +- .../kernel/bus_managers/acpi/include/acpixf.h | 7 +- .../bus_managers/acpi/include/acpredef.h | 2 +- .../bus_managers/acpi/include/acresrc.h | 2 +- .../bus_managers/acpi/include/acrestyp.h | 4 +- .../bus_managers/acpi/include/acstruct.h | 2 +- .../bus_managers/acpi/include/actables.h | 2 +- .../kernel/bus_managers/acpi/include/actbl.h | 2 +- .../kernel/bus_managers/acpi/include/actbl1.h | 2 +- .../kernel/bus_managers/acpi/include/actbl2.h | 2 +- .../bus_managers/acpi/include/actypes.h | 36 +- .../bus_managers/acpi/include/acutils.h | 35 +- .../bus_managers/acpi/include/amlcode.h | 2 +- .../bus_managers/acpi/include/amlresrc.h | 2 +- .../acpi/include/platform/accygwin.h | 5 +- .../acpi/include/platform/acefi.h | 2 +- .../acpi/include/platform/acenv.h | 10 +- .../acpi/include/platform/acfreebsd.h | 2 +- .../acpi/include/platform/acgcc.h | 2 +- .../acpi/include/platform/acintel.h | 2 +- .../acpi/include/platform/aclinux.h | 2 +- .../acpi/include/platform/acmsvc.h | 2 +- .../acpi/include/platform/acnetbsd.h | 2 +- .../acpi/include/platform/acos2.h | 2 +- .../acpi/include/platform/acwin.h | 2 +- .../acpi/include/platform/acwin64.h | 2 +- .../bus_managers/acpi/namespace/nsaccess.c | 4 +- .../bus_managers/acpi/namespace/nsalloc.c | 2 +- .../bus_managers/acpi/namespace/nsdump.c | 6 +- .../bus_managers/acpi/namespace/nsdumpdv.c | 4 +- .../bus_managers/acpi/namespace/nseval.c | 75 +- .../bus_managers/acpi/namespace/nsinit.c | 8 +- .../bus_managers/acpi/namespace/nsload.c | 2 +- .../bus_managers/acpi/namespace/nsnames.c | 4 +- .../bus_managers/acpi/namespace/nsobject.c | 2 +- .../bus_managers/acpi/namespace/nsparse.c | 2 +- .../bus_managers/acpi/namespace/nspredef.c | 107 ++- .../bus_managers/acpi/namespace/nsrepair.c | 657 ++++++++++++++++- .../bus_managers/acpi/namespace/nsrepair2.c | 696 ++++++++++++++++++ .../bus_managers/acpi/namespace/nssearch.c | 2 +- .../bus_managers/acpi/namespace/nsutils.c | 65 +- .../bus_managers/acpi/namespace/nswalk.c | 249 ++++--- .../bus_managers/acpi/namespace/nsxfeval.c | 93 ++- .../bus_managers/acpi/namespace/nsxfname.c | 12 +- .../bus_managers/acpi/namespace/nsxfobj.c | 14 +- .../kernel/bus_managers/acpi/parser/psargs.c | 4 +- .../kernel/bus_managers/acpi/parser/psloop.c | 26 +- .../bus_managers/acpi/parser/psopcode.c | 2 +- .../kernel/bus_managers/acpi/parser/psparse.c | 6 +- .../kernel/bus_managers/acpi/parser/psscope.c | 2 +- .../kernel/bus_managers/acpi/parser/pstree.c | 2 +- .../kernel/bus_managers/acpi/parser/psutils.c | 2 +- .../kernel/bus_managers/acpi/parser/pswalk.c | 2 +- .../kernel/bus_managers/acpi/parser/psxface.c | 8 +- .../bus_managers/acpi/resources/rsaddr.c | 2 +- .../bus_managers/acpi/resources/rscalc.c | 2 +- .../bus_managers/acpi/resources/rscreate.c | 4 +- .../bus_managers/acpi/resources/rsdump.c | 2 +- .../bus_managers/acpi/resources/rsinfo.c | 2 +- .../kernel/bus_managers/acpi/resources/rsio.c | 2 +- .../bus_managers/acpi/resources/rsirq.c | 2 +- .../bus_managers/acpi/resources/rslist.c | 2 +- .../bus_managers/acpi/resources/rsmemory.c | 2 +- .../bus_managers/acpi/resources/rsmisc.c | 2 +- .../bus_managers/acpi/resources/rsutils.c | 2 +- .../bus_managers/acpi/resources/rsxface.c | 4 +- .../kernel/bus_managers/acpi/tables/tbfadt.c | 2 +- .../kernel/bus_managers/acpi/tables/tbfind.c | 2 +- .../bus_managers/acpi/tables/tbinstal.c | 2 +- .../kernel/bus_managers/acpi/tables/tbutils.c | 2 +- .../kernel/bus_managers/acpi/tables/tbxface.c | 2 +- .../bus_managers/acpi/tables/tbxfroot.c | 2 +- .../bus_managers/acpi/utilities/utalloc.c | 2 +- .../bus_managers/acpi/utilities/utcache.c | 2 +- .../bus_managers/acpi/utilities/utclib.c | 2 +- .../bus_managers/acpi/utilities/utcopy.c | 29 +- .../bus_managers/acpi/utilities/utdebug.c | 4 +- .../bus_managers/acpi/utilities/utdelete.c | 2 +- .../bus_managers/acpi/utilities/uteval.c | 4 +- .../bus_managers/acpi/utilities/utglobal.c | 8 +- .../bus_managers/acpi/utilities/utids.c | 2 +- .../bus_managers/acpi/utilities/utinit.c | 2 +- .../bus_managers/acpi/utilities/utlock.c | 2 +- .../bus_managers/acpi/utilities/utmath.c | 30 +- .../bus_managers/acpi/utilities/utmisc.c | 60 +- .../bus_managers/acpi/utilities/utmutex.c | 20 +- .../bus_managers/acpi/utilities/utobject.c | 37 +- .../bus_managers/acpi/utilities/utresrc.c | 2 +- .../bus_managers/acpi/utilities/utstate.c | 2 +- .../bus_managers/acpi/utilities/uttrack.c | 2 +- .../bus_managers/acpi/utilities/utxface.c | 2 +- 220 files changed, 3644 insertions(+), 1564 deletions(-) create mode 100644 src/add-ons/kernel/bus_managers/acpi/common/dmextern.c rename src/add-ons/kernel/bus_managers/acpi/compiler/{aslcompiler.y.y => aslcompiler.y} (90%) mode change 100755 => 100644 src/add-ons/kernel/bus_managers/acpi/compiler/aslstartup.c create mode 100644 src/add-ons/kernel/bus_managers/acpi/namespace/nsrepair2.c diff --git a/src/add-ons/kernel/bus_managers/acpi/Jamfile b/src/add-ons/kernel/bus_managers/acpi/Jamfile index 073c6fc1ee..b48e9b2155 100644 --- a/src/add-ons/kernel/bus_managers/acpi/Jamfile +++ b/src/add-ons/kernel/bus_managers/acpi/Jamfile @@ -103,6 +103,7 @@ local namespace_src = nsparse.c nspredef.c nsrepair.c + nsrepair2.c nssearch.c nsutils.c nswalk.c diff --git a/src/add-ons/kernel/bus_managers/acpi/common/adfile.c b/src/add-ons/kernel/bus_managers/acpi/common/adfile.c index 1de4b248f8..c7f3dfb476 100644 --- a/src/add-ons/kernel/bus_managers/acpi/common/adfile.c +++ b/src/add-ons/kernel/bus_managers/acpi/common/adfile.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -119,7 +119,6 @@ #include "acapps.h" #include -#include #define _COMPONENT ACPI_TOOLS @@ -135,12 +134,13 @@ AdWriteBuffer ( char FilenameBuf[20]; + /****************************************************************************** * * FUNCTION: AfGenerateFilename * - * PARAMETERS: Prefix - prefix string - * TableId - The table ID + * PARAMETERS: Prefix - prefix string + * TableId - The table ID * * RETURN: Pointer to the completed string * @@ -180,9 +180,9 @@ AdGenerateFilename ( * * FUNCTION: AfWriteBuffer * - * PARAMETERS: Filename - name of file - * Buffer - data to write - * Length - length of data + * PARAMETERS: Filename - name of file + * Buffer - data to write + * Length - length of data * * RETURN: Actual number of bytes written * @@ -217,10 +217,10 @@ AdWriteBuffer ( * * FUNCTION: AfWriteTable * - * PARAMETERS: Table - pointer to the ACPI table - * Length - length of the table - * TableName - the table signature - * OemTableID - from the table header + * PARAMETERS: Table - pointer to the ACPI table + * Length - length of the table + * TableName - the table signature + * OemTableID - from the table header * * RETURN: None * @@ -272,7 +272,7 @@ FlGenerateFilename ( * Copy the original filename to a new buffer. Leave room for the worst case * where we append the suffix, an added dot and the null terminator. */ - NewFilename = ACPI_ALLOCATE_ZEROED ( + NewFilename = ACPI_ALLOCATE_ZEROED ((ACPI_SIZE) strlen (InputFilename) + strlen (Suffix) + 2); strcpy (NewFilename, InputFilename); @@ -314,7 +314,7 @@ FlStrdup ( char *NewString; - NewString = ACPI_ALLOCATE (strlen (String) + 1); + NewString = ACPI_ALLOCATE ((ACPI_SIZE) strlen (String) + 1); if (!NewString) { return (NULL); diff --git a/src/add-ons/kernel/bus_managers/acpi/common/adisasm.c b/src/add-ons/kernel/bus_managers/acpi/common/adisasm.c index 8aaa3b4bb5..093cfe5536 100644 --- a/src/add-ons/kernel/bus_managers/acpi/common/adisasm.c +++ b/src/add-ons/kernel/bus_managers/acpi/common/adisasm.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -132,14 +132,18 @@ #define _COMPONENT ACPI_TOOLS ACPI_MODULE_NAME ("adisasm") -extern int AslCompilerdebug; + +extern int AslCompilerdebug; +extern char *Gbl_ExternalFilename; + ACPI_STATUS LsDisplayNamespace ( void); void -LsSetupNsList (void * Handle); +LsSetupNsList ( + void *Handle); /* Local prototypes */ @@ -153,14 +157,6 @@ void AdDisassemblerHeader ( char *Filename); -void -AdAddExternalsToNamespace ( - void); - -UINT32 -AdMethodExternalCount ( - void); - ACPI_STATUS AdDeferredParse ( ACPI_PARSE_OBJECT *Op, @@ -171,8 +167,6 @@ ACPI_STATUS AdParseDeferredOps ( ACPI_PARSE_OBJECT *Root); -ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot; - /* Stubs for ASL compiler */ @@ -192,7 +186,6 @@ AcpiDsMethodError ( { return (Status); } - #endif ACPI_STATUS @@ -238,18 +231,19 @@ AcpiDsMethodDataInitArgs ( } -ACPI_TABLE_DESC LocalTables[1]; +static ACPI_TABLE_DESC LocalTables[1]; +static ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot; /******************************************************************************* * * FUNCTION: AdInitialize * - * PARAMETERS: None. + * PARAMETERS: None * * RETURN: Status * - * DESCRIPTION: CA initialization + * DESCRIPTION: ACPICA and local initialization * ******************************************************************************/ @@ -296,89 +290,15 @@ AdInitialize ( } -/******************************************************************************* - * - * FUNCTION: AdAddExternalsToNamespace - * - * PARAMETERS: - * - * RETURN: None - * - * DESCRIPTION: - * - ******************************************************************************/ - -void -AdAddExternalsToNamespace ( - void) -{ - ACPI_STATUS Status; - ACPI_NAMESPACE_NODE *Node; - ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList; - ACPI_OPERAND_OBJECT *MethodDesc; - - - while (External) - { - Status = AcpiNsLookup (NULL, External->InternalPath, External->Type, - ACPI_IMODE_LOAD_PASS1, ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE, - NULL, &Node); - - if (External->Type == ACPI_TYPE_METHOD) - { - MethodDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD); - MethodDesc->Method.ParamCount = (UINT8) External->Value; - Node->Object = MethodDesc; - } - - External = External->Next; - } -} - - -/******************************************************************************* - * - * FUNCTION: AdMethodExternalCount - * - * PARAMETERS: None - * - * RETURN: Status - * - * DESCRIPTION: Return the number of externals that have been generated - * - ******************************************************************************/ - -UINT32 -AdMethodExternalCount ( - void) -{ - ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList; - UINT32 Count = 0; - - - while (External) - { - if (External->Type == ACPI_TYPE_METHOD) - { - Count++; - } - - External = External->Next; - } - - return (Count); -} - - /****************************************************************************** * * FUNCTION: AdAmlDisassemble * - * PARAMETERS: Filename - AML input filename - * OutToFile - TRUE if output should go to a file - * Prefix - Path prefix for output - * OutFilename - where the filename is returned - * GetAllTables - TRUE if all tables are desired + * PARAMETERS: Filename - AML input filename + * OutToFile - TRUE if output should go to a file + * Prefix - Path prefix for output + * OutFilename - where the filename is returned + * GetAllTables - TRUE if all tables are desired * * RETURN: Status * @@ -386,8 +306,6 @@ AdMethodExternalCount ( * *****************************************************************************/ -extern char *Gbl_ExternalFilename; - ACPI_STATUS AdAmlDisassemble ( BOOLEAN OutToFile, @@ -403,12 +321,11 @@ AdAmlDisassemble ( ACPI_TABLE_HEADER *Table = NULL; ACPI_TABLE_HEADER *ExternalTable; ACPI_OWNER_ID OwnerId; - ACPI_EXTERNAL_LIST *NextExternal; /* - * Input: AML Code from either a file, - * or via GetTables (memory or registry) + * Input: AML code from either a file or via GetTables (memory or + * registry) */ if (Filename) { @@ -462,13 +379,7 @@ AdAmlDisassemble ( /* Clear external list generated by Scope in external tables */ - while (AcpiGbl_ExternalList) - { - NextExternal = AcpiGbl_ExternalList->Next; - ACPI_FREE (AcpiGbl_ExternalList->Path); - ACPI_FREE (AcpiGbl_ExternalList); - AcpiGbl_ExternalList = NextExternal; - } + AcpiDmClearExternalList (); } } else @@ -501,8 +412,7 @@ AdAmlDisassemble ( } /* - * Output: ASL code. - * Redirect to a file if requested + * Output: ASL code. Redirect to a file if requested */ if (OutToFile) { @@ -589,11 +499,11 @@ AdAmlDisassemble ( * tree with the new information (namely, the number of arguments per * method) */ - if (AdMethodExternalCount ()) + if (AcpiDmGetExternalMethodCount ()) { fprintf (stderr, "\nFound %d external control methods, reparsing with new information\n", - AdMethodExternalCount()); + AcpiDmGetExternalMethodCount ()); /* * Reparse, rebuild namespace. no need to xref namespace @@ -611,7 +521,7 @@ AdAmlDisassemble ( AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST; Status = AcpiNsRootInitialize (); - AdAddExternalsToNamespace (); + AcpiDmAddExternalsToNamespace (); /* Parse table. No need to reload it, however (FALSE) */ @@ -855,9 +765,9 @@ AdDisplayTables ( * * FUNCTION: AdDeferredParse * - * PARAMETERS: Op - Root Op of the deferred opcode - * Aml - Pointer to the raw AML - * AmlLength - Length of the AML + * PARAMETERS: Op - Root Op of the deferred opcode + * Aml - Pointer to the raw AML + * AmlLength - Length of the AML * * RETURN: Status * @@ -981,7 +891,7 @@ AdDeferredParse ( * * FUNCTION: AdParseDeferredOps * - * PARAMETERS: Root - Root of the parse tree + * PARAMETERS: Root - Root of the parse tree * * RETURN: Status * @@ -1055,8 +965,8 @@ AdParseDeferredOps ( * * FUNCTION: AdGetLocalTables * - * PARAMETERS: Filename - Not used - * GetAllTables - TRUE if all tables are desired + * PARAMETERS: Filename - Not used + * GetAllTables - TRUE if all tables are desired * * RETURN: Status * @@ -1138,6 +1048,11 @@ AdGetLocalTables ( Status = AcpiTbStoreTable (0, NewTable, NewTable->Length, 0, &TableIndex); + if (ACPI_FAILURE (Status)) + { + fprintf (stderr, "Could not store DSDT\n"); + return AE_NO_ACPI_TABLES; + } } else { @@ -1169,10 +1084,10 @@ AdGetLocalTables ( * * FUNCTION: AdParseTable * - * PARAMETERS: Table - Pointer to the raw table - * OwnerId - Returned OwnerId of the table - * LoadTable - If add table to the global table list - * External - If this is an external table + * PARAMETERS: Table - Pointer to the raw table + * OwnerId - Returned OwnerId of the table + * LoadTable - If add table to the global table list + * External - If this is an external table * * RETURN: Status * diff --git a/src/add-ons/kernel/bus_managers/acpi/common/adwalk.c b/src/add-ons/kernel/bus_managers/acpi/common/adwalk.c index 67d9b11389..09411faeec 100644 --- a/src/add-ons/kernel/bus_managers/acpi/common/adwalk.c +++ b/src/add-ons/kernel/bus_managers/acpi/common/adwalk.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -118,7 +118,6 @@ #include "accommon.h" #include "acparser.h" #include "amlcode.h" -#include "acdebug.h" #include "acdisasm.h" #include "acdispat.h" #include "acnamesp.h" @@ -184,7 +183,7 @@ AcpiDmResourceDescendingOp ( * * FUNCTION: AcpiDmDumpTree * - * PARAMETERS: Origin - Starting object + * PARAMETERS: Origin - Starting object * * RETURN: None * @@ -218,7 +217,7 @@ AcpiDmDumpTree ( * * FUNCTION: AcpiDmFindOrphanMethods * - * PARAMETERS: Origin - Starting object + * PARAMETERS: Origin - Starting object * * RETURN: None * @@ -426,7 +425,6 @@ AcpiDmDumpDescending ( void *Context) { ACPI_OP_WALK_INFO *Info = Context; - const ACPI_OPCODE_INFO *OpInfo; char *Path; @@ -435,11 +433,9 @@ AcpiDmDumpDescending ( return (AE_OK); } - OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - Info->Count++; - /* Most of the information (count, level, name) here */ + Info->Count++; AcpiOsPrintf ("% 5d [%2.2d] ", Info->Count, Level); AcpiDmIndent (Level); AcpiOsPrintf ("%-28s", AcpiPsGetOpcodeName (Op->Common.AmlOpcode)); @@ -472,7 +468,7 @@ AcpiDmDumpDescending ( case AML_METHOD_OP: case AML_DEVICE_OP: case AML_INT_NAMEDFIELD_OP: - AcpiOsPrintf ("%4.4s", &Op->Named.Name); + AcpiOsPrintf ("%4.4s", ACPI_CAST_PTR (char, &Op->Named.Name)); break; default: @@ -536,7 +532,7 @@ AcpiDmFindOrphanDescending ( { /* This NamePath has no args, assume it is an integer */ - AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); return (AE_OK); } @@ -547,11 +543,11 @@ AcpiDmFindOrphanDescending ( { /* One Arg means this is just a Store(Name,Target) */ - AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); return (AE_OK); } - AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); + AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); } break; #endif @@ -567,7 +563,7 @@ AcpiDmFindOrphanDescending ( { /* This NamePath has no args, assume it is an integer */ - AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); return (AE_OK); } @@ -576,11 +572,11 @@ AcpiDmFindOrphanDescending ( { /* One Arg means this is just a Store(Name,Target) */ - AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0); return (AE_OK); } - AcpiDmAddToExternalList (ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); + AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); } break; @@ -611,7 +607,7 @@ AcpiDmFindOrphanDescending ( /* And namepath is the first argument */ (ParentOp->Common.Value.Arg == Op)) { - AcpiDmAddToExternalList (Op->Common.Value.String, ACPI_TYPE_INTEGER, 0); + AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_INTEGER, 0); break; } } @@ -621,7 +617,7 @@ AcpiDmFindOrphanDescending ( * operator) - it *must* be a method invocation, nothing else is * grammatically possible. */ - AcpiDmAddToExternalList (Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); + AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount); } break; @@ -858,7 +854,7 @@ AcpiDmXrefDescendingOp ( { if (Status == AE_NOT_FOUND) { - AcpiDmAddToExternalList (Path, (UINT8) ObjectType, 0); + AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType, 0); /* * We could install this into the namespace, but we catch duplicate @@ -888,12 +884,12 @@ AcpiDmXrefDescendingOp ( if (ObjectType2 == ACPI_TYPE_METHOD) { - AcpiDmAddToExternalList (Path, ACPI_TYPE_METHOD, + AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_METHOD, Object->Method.ParamCount); } else { - AcpiDmAddToExternalList (Path, (UINT8) ObjectType2, 0); + AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, 0); } Op->Common.Node = Node; diff --git a/src/add-ons/kernel/bus_managers/acpi/common/dmextern.c b/src/add-ons/kernel/bus_managers/acpi/common/dmextern.c new file mode 100644 index 0000000000..29b15d805e --- /dev/null +++ b/src/add-ons/kernel/bus_managers/acpi/common/dmextern.c @@ -0,0 +1,646 @@ +/****************************************************************************** + * + * Module Name: dmextern - Support for External() ASL statements + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2010, 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. + * + *****************************************************************************/ + +#include "acpi.h" +#include "accommon.h" +#include "amlcode.h" +#include "acnamesp.h" +#include "acdisasm.h" + + +/* + * This module is used for application-level code (iASL disassembler) only. + * + * It contains the code to create and emit any necessary External() ASL + * statements for the module being disassembled. + */ +#define _COMPONENT ACPI_CA_DISASSEMBLER + ACPI_MODULE_NAME ("dmextern") + + +/* + * This table maps ACPI_OBJECT_TYPEs to the corresponding ASL + * ObjectTypeKeyword. Used to generate typed external declarations + */ +static const char *AcpiGbl_DmTypeNames[] = +{ + /* 00 */ "", /* Type ANY */ + /* 01 */ ", IntObj", + /* 02 */ ", StrObj", + /* 03 */ ", BuffObj", + /* 04 */ ", PkgObj", + /* 05 */ ", FieldUnitObj", + /* 06 */ ", DeviceObj", + /* 07 */ ", EventObj", + /* 08 */ ", MethodObj", + /* 09 */ ", MutexObj", + /* 10 */ ", OpRegionObj", + /* 11 */ ", PowerResObj", + /* 12 */ ", ProcessorObj", + /* 13 */ ", ThermalZoneObj", + /* 14 */ ", BuffFieldObj", + /* 15 */ ", DDBHandleObj", + /* 16 */ "", /* Debug object */ + /* 17 */ ", FieldUnitObj", + /* 18 */ ", FieldUnitObj", + /* 19 */ ", FieldUnitObj" +}; + + +/* Local prototypes */ + +static const char * +AcpiDmGetObjectTypeName ( + ACPI_OBJECT_TYPE Type); + +static char * +AcpiDmNormalizeParentPrefix ( + ACPI_PARSE_OBJECT *Op, + char *Path); + + +/******************************************************************************* + * + * FUNCTION: AcpiDmGetObjectTypeName + * + * PARAMETERS: Type - An ACPI_OBJECT_TYPE + * + * RETURN: Pointer to a string + * + * DESCRIPTION: Map an object type to the ASL object type string. + * + ******************************************************************************/ + +static const char * +AcpiDmGetObjectTypeName ( + ACPI_OBJECT_TYPE Type) +{ + + if (Type == ACPI_TYPE_LOCAL_SCOPE) + { + Type = ACPI_TYPE_DEVICE; + } + + else if (Type > ACPI_TYPE_LOCAL_INDEX_FIELD) + { + return (""); + } + + return (AcpiGbl_DmTypeNames[Type]); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmNormalizeParentPrefix + * + * PARAMETERS: Op - Parse op + * Path - Path with parent prefix + * + * RETURN: The full pathname to the object (from the namespace root) + * + * DESCRIPTION: Returns the full pathname of a path with parent prefix + * The caller must free the fullpath returned. + * + ******************************************************************************/ + +static char * +AcpiDmNormalizeParentPrefix ( + ACPI_PARSE_OBJECT *Op, + char *Path) +{ + ACPI_NAMESPACE_NODE *Node; + char *Fullpath; + char *ParentPath; + ACPI_SIZE Length; + + + /* Search upwards in the parse tree until we reach a namespace node */ + + while (Op) + { + if (Op->Common.Node) + { + break; + } + + Op = Op->Common.Parent; + } + + if (!Op) + { + return (NULL); + } + + /* + * Find the actual parent node for the reference: + * Remove all carat prefixes from the input path. + * There may be multiple parent prefixes (For example, ^^^M000) + */ + Node = Op->Common.Node; + while (Node && (*Path == (UINT8) AML_PARENT_PREFIX)) + { + Node = AcpiNsGetParentNode (Node); + Path++; + } + + if (!Node) + { + return (NULL); + } + + /* Get the full pathname for the parent node */ + + ParentPath = AcpiNsGetExternalPathname (Node); + if (!ParentPath) + { + return (NULL); + } + + Length = (ACPI_STRLEN (ParentPath) + ACPI_STRLEN (Path) + 1); + Fullpath = ACPI_ALLOCATE_ZEROED (Length); + if (!Fullpath) + { + goto Cleanup; + } + + /* + * Concatenate parent fullpath and path. For example, + * parent fullpath "\_SB_", Path "^INIT", Fullpath "\_SB_.INIT" + * + * Copy the parent path + */ + ACPI_STRCAT (Fullpath, ParentPath); + + /* Add dot separator (don't need dot if parent fullpath is a single "\") */ + + if (ParentPath[1]) + { + ACPI_STRCAT (Fullpath, "."); + } + + /* Copy child path (carat parent prefix(es) were skipped above) */ + + ACPI_STRCAT (Fullpath, Path); + +Cleanup: + ACPI_FREE (ParentPath); + return (Fullpath); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmAddToExternalList + * + * PARAMETERS: Op - Current parser Op + * Path - Internal (AML) path to the object + * Type - ACPI object type to be added + * Value - Arg count if adding a Method object + * + * RETURN: None + * + * DESCRIPTION: Insert a new name into the global list of Externals which + * will in turn be later emitted as an External() declaration + * in the disassembled output. + * + ******************************************************************************/ + +void +AcpiDmAddToExternalList ( + ACPI_PARSE_OBJECT *Op, + char *Path, + UINT8 Type, + UINT32 Value) +{ + char *ExternalPath; + char *Fullpath = NULL; + ACPI_EXTERNAL_LIST *NewExternal; + ACPI_EXTERNAL_LIST *NextExternal; + ACPI_EXTERNAL_LIST *PrevExternal = NULL; + ACPI_STATUS Status; + + + if (!Path) + { + return; + } + + /* Externalize the ACPI path */ + + Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path, + NULL, &ExternalPath); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Get the full pathname from root if "Path" has a parent prefix */ + + if (*Path == (UINT8) AML_PARENT_PREFIX) + { + Fullpath = AcpiDmNormalizeParentPrefix (Op, ExternalPath); + if (Fullpath) + { + /* Set new external path */ + + ACPI_FREE (ExternalPath); + ExternalPath = Fullpath; + } + } + + /* Check all existing externals to ensure no duplicates */ + + NextExternal = AcpiGbl_ExternalList; + while (NextExternal) + { + if (!ACPI_STRCMP (ExternalPath, NextExternal->Path)) + { + /* Duplicate method, check that the Value (ArgCount) is the same */ + + if ((NextExternal->Type == ACPI_TYPE_METHOD) && + (NextExternal->Value != Value)) + { + ACPI_ERROR ((AE_INFO, + "Argument count mismatch for method %s %d %d", + NextExternal->Path, NextExternal->Value, Value)); + } + + /* Allow upgrade of type from ANY */ + + else if (NextExternal->Type == ACPI_TYPE_ANY) + { + NextExternal->Type = Type; + NextExternal->Value = Value; + } + + ACPI_FREE (ExternalPath); + return; + } + + NextExternal = NextExternal->Next; + } + + /* Allocate and init a new External() descriptor */ + + NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST)); + if (!NewExternal) + { + ACPI_FREE (ExternalPath); + return; + } + + NewExternal->Path = ExternalPath; + NewExternal->Type = Type; + NewExternal->Value = Value; + NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath); + + /* Was the external path with parent prefix normalized to a fullpath? */ + + if (Fullpath == ExternalPath) + { + /* Get new internal path */ + + Status = AcpiNsInternalizeName (ExternalPath, &Path); + if (ACPI_FAILURE (Status)) + { + ACPI_FREE (ExternalPath); + ACPI_FREE (NewExternal); + return; + } + + /* Set flag to indicate External->InternalPath need to be freed */ + + NewExternal->Flags |= ACPI_IPATH_ALLOCATED; + } + + NewExternal->InternalPath = Path; + + /* Link the new descriptor into the global list, ordered by string length */ + + NextExternal = AcpiGbl_ExternalList; + while (NextExternal) + { + if (NewExternal->Length <= NextExternal->Length) + { + if (PrevExternal) + { + PrevExternal->Next = NewExternal; + } + else + { + AcpiGbl_ExternalList = NewExternal; + } + + NewExternal->Next = NextExternal; + return; + } + + PrevExternal = NextExternal; + NextExternal = NextExternal->Next; + } + + if (PrevExternal) + { + PrevExternal->Next = NewExternal; + } + else + { + AcpiGbl_ExternalList = NewExternal; + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmAddExternalsToNamespace + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Add all externals to the namespace. Allows externals to be + * "resolved". + * + ******************************************************************************/ + +void +AcpiDmAddExternalsToNamespace ( + void) +{ + ACPI_STATUS Status; + ACPI_NAMESPACE_NODE *Node; + ACPI_OPERAND_OBJECT *MethodDesc; + ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList; + + + while (External) + { + /* Add the external name (object) into the namespace */ + + Status = AcpiNsLookup (NULL, External->InternalPath, External->Type, + ACPI_IMODE_LOAD_PASS1, + ACPI_NS_EXTERNAL | ACPI_NS_DONT_OPEN_SCOPE, + NULL, &Node); + + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, + "while adding external to namespace [%s]", + External->Path)); + } + else if (External->Type == ACPI_TYPE_METHOD) + { + /* For methods, we need to save the argument count */ + + MethodDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD); + MethodDesc->Method.ParamCount = (UINT8) External->Value; + Node->Object = MethodDesc; + } + + External = External->Next; + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmGetExternalMethodCount + * + * PARAMETERS: None + * + * RETURN: The number of control method externals in the external list + * + * DESCRIPTION: Return the number of method externals that have been generated. + * If any control method externals have been found, we must + * re-parse the entire definition block with the new information + * (number of arguments for the methods.) This is limitation of + * AML, we don't know the number of arguments from the control + * method invocation itself. + * + ******************************************************************************/ + +UINT32 +AcpiDmGetExternalMethodCount ( + void) +{ + ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList; + UINT32 Count = 0; + + + while (External) + { + if (External->Type == ACPI_TYPE_METHOD) + { + Count++; + } + + External = External->Next; + } + + return (Count); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmClearExternalList + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Free the entire External info list + * + ******************************************************************************/ + +void +AcpiDmClearExternalList ( + void) +{ + ACPI_EXTERNAL_LIST *NextExternal; + + + while (AcpiGbl_ExternalList) + { + NextExternal = AcpiGbl_ExternalList->Next; + ACPI_FREE (AcpiGbl_ExternalList->Path); + ACPI_FREE (AcpiGbl_ExternalList); + AcpiGbl_ExternalList = NextExternal; + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmEmitExternals + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Emit an External() ASL statement for each of the externals in + * the global external info list. + * + ******************************************************************************/ + +void +AcpiDmEmitExternals ( + void) +{ + ACPI_EXTERNAL_LIST *NextExternal; + + + if (!AcpiGbl_ExternalList) + { + return; + } + + /* + * Walk the list of externals (unresolved references) + * found during the AML parsing + */ + while (AcpiGbl_ExternalList) + { + AcpiOsPrintf (" External (%s%s", + AcpiGbl_ExternalList->Path, + AcpiDmGetObjectTypeName (AcpiGbl_ExternalList->Type)); + + if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD) + { + AcpiOsPrintf (") // %d Arguments\n", + AcpiGbl_ExternalList->Value); + } + else + { + AcpiOsPrintf (")\n"); + } + + /* Free this external info block and move on to next external */ + + NextExternal = AcpiGbl_ExternalList->Next; + if (AcpiGbl_ExternalList->Flags & ACPI_IPATH_ALLOCATED) + { + ACPI_FREE (AcpiGbl_ExternalList->InternalPath); + } + + ACPI_FREE (AcpiGbl_ExternalList->Path); + ACPI_FREE (AcpiGbl_ExternalList); + AcpiGbl_ExternalList = NextExternal; + } + + AcpiOsPrintf ("\n"); +} + diff --git a/src/add-ons/kernel/bus_managers/acpi/common/dmrestag.c b/src/add-ons/kernel/bus_managers/acpi/common/dmrestag.c index e314b318af..97f6c476e5 100644 --- a/src/add-ons/kernel/bus_managers/acpi/common/dmrestag.c +++ b/src/add-ons/kernel/bus_managers/acpi/common/dmrestag.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/common/dmtable.c b/src/add-ons/kernel/bus_managers/acpi/common/dmtable.c index 9b0e1e50a3..dd82016fef 100644 --- a/src/add-ons/kernel/bus_managers/acpi/common/dmtable.c +++ b/src/add-ons/kernel/bus_managers/acpi/common/dmtable.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -218,7 +218,6 @@ static const char *AcpiDmIvrsSubnames[] = }; - #define ACPI_FADT_PM_RESERVED 8 static const char *AcpiDmFadtProfiles[] = @@ -954,7 +953,7 @@ AcpiDmCheckAscii ( for (i = 0; i < Count; i++) { - RepairedName[i] = Name[i]; + RepairedName[i] = (char) Name[i]; if (!Name[i]) { diff --git a/src/add-ons/kernel/bus_managers/acpi/common/dmtbdump.c b/src/add-ons/kernel/bus_managers/acpi/common/dmtbdump.c index e2dd8090fa..30d86708ce 100644 --- a/src/add-ons/kernel/bus_managers/acpi/common/dmtbdump.c +++ b/src/add-ons/kernel/bus_managers/acpi/common/dmtbdump.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/common/dmtbinfo.c b/src/add-ons/kernel/bus_managers/acpi/common/dmtbinfo.c index 832914905d..805c81f653 100644 --- a/src/add-ons/kernel/bus_managers/acpi/common/dmtbinfo.c +++ b/src/add-ons/kernel/bus_managers/acpi/common/dmtbinfo.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/common/getopt.c b/src/add-ons/kernel/bus_managers/acpi/common/getopt.c index 54cff3ec2d..db1eb167d1 100644 --- a/src/add-ons/kernel/bus_managers/acpi/common/getopt.c +++ b/src/add-ons/kernel/bus_managers/acpi/common/getopt.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -195,9 +195,9 @@ AcpiGetopt( if (*++OptsPtr == ':') { - if (argv[AcpiGbl_Optind][CurrentCharPtr+1] != '\0') + if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '\0') { - AcpiGbl_Optarg = &argv[AcpiGbl_Optind++][CurrentCharPtr+1]; + AcpiGbl_Optarg = &argv[AcpiGbl_Optind++][(int) (CurrentCharPtr+1)]; } else if (++AcpiGbl_Optind >= argc) { @@ -218,9 +218,9 @@ AcpiGetopt( else if (*OptsPtr == '^') { - if (argv[AcpiGbl_Optind][CurrentCharPtr+1] != '\0') + if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '\0') { - AcpiGbl_Optarg = &argv[AcpiGbl_Optind][CurrentCharPtr+1]; + AcpiGbl_Optarg = &argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)]; } else { diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/Makefile b/src/add-ons/kernel/bus_managers/acpi/compiler/Makefile index 740842c023..597d1ffcbe 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/Makefile +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/Makefile @@ -71,6 +71,7 @@ SRCS= aslcompilerparse.c aslcompilerlex.c aslanalyze.c aslcodegen.c \ ../common/adfile.c \ ../common/adisasm.c \ ../common/adwalk.c \ + ../common/dmextern.c \ ../common/dmrestag.c \ ../common/dmtable.c \ ../common/dmtbinfo.c \ diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslanalyze.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslanalyze.c index d44adda8ff..4cbfcd6e06 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslanalyze.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslanalyze.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -667,8 +667,8 @@ AnCheckForReservedName ( { /* The next two characters must be hex digits */ - if ((isxdigit (Name[2])) && - (isxdigit (Name[3]))) + if ((isxdigit ((int) Name[2])) && + (isxdigit ((int) Name[3]))) { return (ACPI_EVENT_RESERVED_NAME); } @@ -1236,7 +1236,7 @@ AnMethodAnalysisWalkBegin ( */ for (i = 0; Next->Asl.Value.String[i]; i++) { - if (!isalnum (Next->Asl.Value.String[i])) + if (!isalnum ((int) Next->Asl.Value.String[i])) { AslError (ASL_ERROR, ASL_MSG_ALPHANUMERIC_STRING, Next, Next->Asl.Value.String); @@ -2157,7 +2157,7 @@ AnOtherSemanticAnalysisWalkBegin ( */ if (((ArgNode->Asl.ParseOpcode == PARSEOP_WORDCONST) || (ArgNode->Asl.ParseOpcode == PARSEOP_INTEGER)) && - (ArgNode->Asl.Value.Integer >= (ACPI_INTEGER) ACPI_WAIT_FOREVER)) + (ArgNode->Asl.Value.Integer >= (UINT64) ACPI_WAIT_FOREVER)) { break; } diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslcodegen.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslcodegen.c index af3f292e3f..dcd6997003 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslcodegen.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslcodegen.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslcompile.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslcompile.c index 07de1fe63c..90e90991b7 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslcompile.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslcompile.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -895,6 +895,14 @@ CmCleanupAndExit ( 10) / Gbl_NsLookupCount); } + + if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) + { + printf ("\nMaximum error count (%d) exceeded\n", ASL_MAX_ERROR_COUNT); + } + + UtDisplaySummary (ASL_FILE_STDOUT); + /* Close all open files */ for (i = 2; i < ASL_MAX_FILE_TYPE; i++) @@ -902,14 +910,6 @@ CmCleanupAndExit ( FlCloseFile (i); } - /* - * TBD: SourceOutput should be .TMP, then rename if we want to keep it? - */ - if (!Gbl_SourceOutputFlag) - { - remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); - } - /* Delete AML file if there are errors */ if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors)) @@ -917,12 +917,19 @@ CmCleanupAndExit ( remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename); } - if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) + /* + * Delete intermediate ("combined") source file (if -ls flag not set) + * + * TBD: SourceOutput should be .TMP, then rename if we want to keep it? + */ + if (!Gbl_SourceOutputFlag) { - printf ("\nMaximum error count (%d) exceeded\n", ASL_MAX_ERROR_COUNT); + if (remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename)) + { + printf ("Could not remove SRC file, %s\n", + Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); + } } - - UtDisplaySummary (ASL_FILE_STDOUT); } diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslcompiler.h b/src/add-ons/kernel/bus_managers/acpi/compiler/aslcompiler.h index 2678c596a2..76bf51a8b9 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslcompiler.h +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslcompiler.h @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -511,7 +511,7 @@ TrCreateLeafNode ( ACPI_PARSE_OBJECT * TrCreateValuedLeafNode ( UINT32 ParseOpcode, - ACPI_INTEGER Value); + UINT64 Value); ACPI_PARSE_OBJECT * TrLinkChildren ( @@ -718,7 +718,7 @@ UtCheckIntegerRange ( UINT32 LowValue, UINT32 HighValue); -ACPI_INTEGER +UINT64 UtDoConstant ( char *String); diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslcompiler.l b/src/add-ons/kernel/bus_managers/acpi/compiler/aslcompiler.l index d64dbf6a0a..dd0473c757 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslcompiler.l +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslcompiler.l @@ -10,7 +10,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslcompiler.y.y b/src/add-ons/kernel/bus_managers/acpi/compiler/aslcompiler.y similarity index 90% rename from src/add-ons/kernel/bus_managers/acpi/compiler/aslcompiler.y.y rename to src/add-ons/kernel/bus_managers/acpi/compiler/aslcompiler.y index 769d5233ca..3c12a3dfc3 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslcompiler.y.y +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslcompiler.y @@ -3,7 +3,6 @@ /****************************************************************************** * * Module Name: aslcompiler.y - Bison input file (ASL grammar and actions) - * $Revision: 1.104 $ * *****************************************************************************/ @@ -11,7 +10,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2006, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -129,6 +128,7 @@ #include #include #include "acpi.h" +#include "accommon.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslparse") @@ -188,10 +188,10 @@ AslLocalAllocate (unsigned int Size); /*! [Begin] no source code translation */ /* - * These shift/reduce conflicts are expected. There should be zer0 + * These shift/reduce conflicts are expected. There should be zero * reduce/reduce conflicts. */ -%expect 64 +%expect 60 /* @@ -400,6 +400,7 @@ AslLocalAllocate (unsigned int Size); %token PARSEOP_REGIONSPACE_CMOS %token PARSEOP_REGIONSPACE_EC %token PARSEOP_REGIONSPACE_IO +%token PARSEOP_REGIONSPACE_IPMI %token PARSEOP_REGIONSPACE_MEM %token PARSEOP_REGIONSPACE_PCI %token PARSEOP_REGIONSPACE_PCIBAR @@ -794,7 +795,7 @@ ASLCode ; DefinitionBlockTerm - : PARSEOP_DEFINITIONBLOCK '(' {$$ = TrCreateLeafNode (PARSEOP_DEFINITIONBLOCK);} + : PARSEOP_DEFINITIONBLOCK '(' {$$ = TrCreateLeafNode (PARSEOP_DEFINITIONBLOCK);} String ',' String ',' ByteConst ',' @@ -1111,8 +1112,8 @@ Type6Opcode ; IncludeTerm - : PARSEOP_INCLUDE '(' {$$ = TrCreateLeafNode (PARSEOP_INCLUDE);} - String ')' {$$ = TrLinkChildren ($3,1,$4);FlOpenIncludeFile ($4);} + : PARSEOP_INCLUDE '(' {$$ = TrCreateLeafNode (PARSEOP_INCLUDE);} + String ')' {TrLinkChildren ($3,1,$4);FlOpenIncludeFile ($4);} TermList IncludeEndTerm {$$ = TrLinkPeerNodes (3,$3,$7,$8);} ; @@ -1147,7 +1148,7 @@ ExternalTerm BankFieldTerm - : PARSEOP_BANKFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_BANKFIELD);} + : PARSEOP_BANKFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_BANKFIELD);} NameString NameStringItem TermArgItem @@ -1198,7 +1199,7 @@ AccessAsTerm ; CreateBitFieldTerm - : PARSEOP_CREATEBITFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);} + : PARSEOP_CREATEBITFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);} TermArg TermArgItem NameStringItem @@ -1208,7 +1209,7 @@ CreateBitFieldTerm ; CreateByteFieldTerm - : PARSEOP_CREATEBYTEFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEBYTEFIELD);} + : PARSEOP_CREATEBYTEFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEBYTEFIELD);} TermArg TermArgItem NameStringItem @@ -1218,7 +1219,7 @@ CreateByteFieldTerm ; CreateDWordFieldTerm - : PARSEOP_CREATEDWORDFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEDWORDFIELD);} + : PARSEOP_CREATEDWORDFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEDWORDFIELD);} TermArg TermArgItem NameStringItem @@ -1228,7 +1229,7 @@ CreateDWordFieldTerm ; CreateFieldTerm - : PARSEOP_CREATEFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEFIELD);} + : PARSEOP_CREATEFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEFIELD);} TermArg TermArgItem TermArgItem @@ -1239,7 +1240,7 @@ CreateFieldTerm ; CreateQWordFieldTerm - : PARSEOP_CREATEQWORDFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEQWORDFIELD);} + : PARSEOP_CREATEQWORDFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEQWORDFIELD);} TermArg TermArgItem NameStringItem @@ -1249,7 +1250,7 @@ CreateQWordFieldTerm ; CreateWordFieldTerm - : PARSEOP_CREATEWORDFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEWORDFIELD);} + : PARSEOP_CREATEWORDFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_CREATEWORDFIELD);} TermArg TermArgItem NameStringItem @@ -1259,7 +1260,7 @@ CreateWordFieldTerm ; DataRegionTerm - : PARSEOP_DATATABLEREGION '(' {$$ = TrCreateLeafNode (PARSEOP_DATATABLEREGION);} + : PARSEOP_DATATABLEREGION '(' {$$ = TrCreateLeafNode (PARSEOP_DATATABLEREGION);} NameString TermArgItem TermArgItem @@ -1270,7 +1271,7 @@ DataRegionTerm ; DeviceTerm - : PARSEOP_DEVICE '(' {$$ = TrCreateLeafNode (PARSEOP_DEVICE);} + : PARSEOP_DEVICE '(' {$$ = TrCreateLeafNode (PARSEOP_DEVICE);} NameString ')' '{' ObjectList '}' {$$ = TrLinkChildren ($3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} @@ -1279,7 +1280,7 @@ DeviceTerm ; EventTerm - : PARSEOP_EVENT '(' {$$ = TrCreateLeafNode (PARSEOP_EVENT);} + : PARSEOP_EVENT '(' {$$ = TrCreateLeafNode (PARSEOP_EVENT);} NameString ')' {$$ = TrLinkChildren ($3,1,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION));} | PARSEOP_EVENT '(' @@ -1287,7 +1288,7 @@ EventTerm ; FieldTerm - : PARSEOP_FIELD '(' {$$ = TrCreateLeafNode (PARSEOP_FIELD);} + : PARSEOP_FIELD '(' {$$ = TrCreateLeafNode (PARSEOP_FIELD);} NameString ',' AccessTypeKeyword ',' LockRuleKeyword @@ -1299,7 +1300,7 @@ FieldTerm ; FunctionTerm - : PARSEOP_FUNCTION '(' {$$ = TrCreateLeafNode (PARSEOP_METHOD);} + : PARSEOP_FUNCTION '(' {$$ = TrCreateLeafNode (PARSEOP_METHOD);} NameString OptionalParameterTypePackage OptionalParameterTypesPackage @@ -1313,7 +1314,7 @@ FunctionTerm ; IndexFieldTerm - : PARSEOP_INDEXFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} + : PARSEOP_INDEXFIELD '(' {$$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} NameString NameStringItem ',' AccessTypeKeyword @@ -1326,9 +1327,9 @@ IndexFieldTerm ; MethodTerm - : PARSEOP_METHOD '(' {$$ = TrCreateLeafNode (PARSEOP_METHOD);} + : PARSEOP_METHOD '(' {$$ = TrCreateLeafNode (PARSEOP_METHOD);} NameString - OptionalByteConstExpr {$$ = UtCheckIntegerRange ($5, 0, 7);} + OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);} OptionalSerializeRuleKeyword OptionalByteConstExpr OptionalParameterTypePackage @@ -1340,7 +1341,7 @@ MethodTerm ; MutexTerm - : PARSEOP_MUTEX '(' {$$ = TrCreateLeafNode (PARSEOP_MUTEX);} + : PARSEOP_MUTEX '(' {$$ = TrCreateLeafNode (PARSEOP_MUTEX);} NameString ',' ByteConstExpr ')' {$$ = TrLinkChildren ($3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} @@ -1349,7 +1350,7 @@ MutexTerm ; OpRegionTerm - : PARSEOP_OPERATIONREGION '(' {$$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} + : PARSEOP_OPERATIONREGION '(' {$$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} NameString ',' OpRegionSpaceIdTerm TermArgItem @@ -1365,7 +1366,7 @@ OpRegionSpaceIdTerm ; PowerResTerm - : PARSEOP_POWERRESOURCE '(' {$$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} + : PARSEOP_POWERRESOURCE '(' {$$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} NameString ',' ByteConstExpr ',' WordConstExpr @@ -1376,7 +1377,7 @@ PowerResTerm ; ProcessorTerm - : PARSEOP_PROCESSOR '(' {$$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} + : PARSEOP_PROCESSOR '(' {$$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} NameString ',' ByteConstExpr OptionalDWordConstExpr @@ -1388,7 +1389,7 @@ ProcessorTerm ; ThermalZoneTerm - : PARSEOP_THERMALZONE '(' {$$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} + : PARSEOP_THERMALZONE '(' {$$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} NameString ')' '{' ObjectList '}' {$$ = TrLinkChildren ($3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} @@ -1401,7 +1402,7 @@ ThermalZoneTerm AliasTerm - : PARSEOP_ALIAS '(' {$$ = TrCreateLeafNode (PARSEOP_ALIAS);} + : PARSEOP_ALIAS '(' {$$ = TrCreateLeafNode (PARSEOP_ALIAS);} NameString NameStringItem ')' {$$ = TrLinkChildren ($3,2,$4,TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));} @@ -1410,7 +1411,7 @@ AliasTerm ; NameTerm - : PARSEOP_NAME '(' {$$ = TrCreateLeafNode (PARSEOP_NAME);} + : PARSEOP_NAME '(' {$$ = TrCreateLeafNode (PARSEOP_NAME);} NameString ',' DataObject ')' {$$ = TrLinkChildren ($3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} @@ -1419,7 +1420,7 @@ NameTerm ; ScopeTerm - : PARSEOP_SCOPE '(' {$$ = TrCreateLeafNode (PARSEOP_SCOPE);} + : PARSEOP_SCOPE '(' {$$ = TrCreateLeafNode (PARSEOP_SCOPE);} NameString ')' '{' ObjectList '}' {$$ = TrLinkChildren ($3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} @@ -1444,7 +1445,7 @@ ContinueTerm ; FatalTerm - : PARSEOP_FATAL '(' {$$ = TrCreateLeafNode (PARSEOP_FATAL);} + : PARSEOP_FATAL '(' {$$ = TrCreateLeafNode (PARSEOP_FATAL);} ByteConstExpr ',' DWordConstExpr TermArgItem @@ -1458,7 +1459,7 @@ IfElseTerm ; IfTerm - : PARSEOP_IF '(' {$$ = TrCreateLeafNode (PARSEOP_IF);} + : PARSEOP_IF '(' {$$ = TrCreateLeafNode (PARSEOP_IF);} TermArg ')' '{' TermList '}' {$$ = TrLinkChildren ($3,2,$4,$7);} @@ -1469,7 +1470,7 @@ IfTerm ElseTerm : {$$ = NULL;} - | PARSEOP_ELSE '{' {$$ = TrCreateLeafNode (PARSEOP_ELSE);} + | PARSEOP_ELSE '{' {$$ = TrCreateLeafNode (PARSEOP_ELSE);} TermList '}' {$$ = TrLinkChildren ($3,1,$4);} | PARSEOP_ELSE '{' @@ -1478,11 +1479,11 @@ ElseTerm | PARSEOP_ELSE error {$$ = AslDoError(); yyclearin;} - | PARSEOP_ELSEIF '(' {$$ = TrCreateLeafNode (PARSEOP_ELSE);} - TermArg {$$ = TrCreateLeafNode (PARSEOP_IF);} + | PARSEOP_ELSEIF '(' {$$ = TrCreateLeafNode (PARSEOP_ELSE);} + TermArg {$$ = TrCreateLeafNode (PARSEOP_IF);} ')' '{' - TermList '}' {$$ = TrLinkChildren ($5,2,$4,$8);} - ElseTerm {$$ = TrLinkPeerNode ($5,$11);} + TermList '}' {TrLinkChildren ($5,2,$4,$8);} + ElseTerm {TrLinkPeerNode ($5,$11);} {$$ = TrLinkChildren ($3,1,$5);} | PARSEOP_ELSEIF '(' @@ -1493,7 +1494,7 @@ ElseTerm ; LoadTerm - : PARSEOP_LOAD '(' {$$ = TrCreateLeafNode (PARSEOP_LOAD);} + : PARSEOP_LOAD '(' {$$ = TrCreateLeafNode (PARSEOP_LOAD);} NameString RequiredTarget ')' {$$ = TrLinkChildren ($3,2,$4,$5);} @@ -1506,7 +1507,7 @@ NoOpTerm ; NotifyTerm - : PARSEOP_NOTIFY '(' {$$ = TrCreateLeafNode (PARSEOP_NOTIFY);} + : PARSEOP_NOTIFY '(' {$$ = TrCreateLeafNode (PARSEOP_NOTIFY);} SuperName TermArgItem ')' {$$ = TrLinkChildren ($3,2,$4,$5);} @@ -1515,7 +1516,7 @@ NotifyTerm ; ReleaseTerm - : PARSEOP_RELEASE '(' {$$ = TrCreateLeafNode (PARSEOP_RELEASE);} + : PARSEOP_RELEASE '(' {$$ = TrCreateLeafNode (PARSEOP_RELEASE);} SuperName ')' {$$ = TrLinkChildren ($3,1,$4);} | PARSEOP_RELEASE '(' @@ -1523,7 +1524,7 @@ ReleaseTerm ; ResetTerm - : PARSEOP_RESET '(' {$$ = TrCreateLeafNode (PARSEOP_RESET);} + : PARSEOP_RESET '(' {$$ = TrCreateLeafNode (PARSEOP_RESET);} SuperName ')' {$$ = TrLinkChildren ($3,1,$4);} | PARSEOP_RESET '(' @@ -1531,7 +1532,7 @@ ResetTerm ; ReturnTerm - : PARSEOP_RETURN '(' {$$ = TrCreateLeafNode (PARSEOP_RETURN);} + : PARSEOP_RETURN '(' {$$ = TrCreateLeafNode (PARSEOP_RETURN);} OptionalReturnArg ')' {$$ = TrLinkChildren ($3,1,$4);} | PARSEOP_RETURN {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_RETURN),1,TrCreateLeafNode (PARSEOP_ZERO));} @@ -1540,7 +1541,7 @@ ReturnTerm ; SignalTerm - : PARSEOP_SIGNAL '(' {$$ = TrCreateLeafNode (PARSEOP_SIGNAL);} + : PARSEOP_SIGNAL '(' {$$ = TrCreateLeafNode (PARSEOP_SIGNAL);} SuperName ')' {$$ = TrLinkChildren ($3,1,$4);} | PARSEOP_SIGNAL '(' @@ -1548,7 +1549,7 @@ SignalTerm ; SleepTerm - : PARSEOP_SLEEP '(' {$$ = TrCreateLeafNode (PARSEOP_SLEEP);} + : PARSEOP_SLEEP '(' {$$ = TrCreateLeafNode (PARSEOP_SLEEP);} TermArg ')' {$$ = TrLinkChildren ($3,1,$4);} | PARSEOP_SLEEP '(' @@ -1556,7 +1557,7 @@ SleepTerm ; StallTerm - : PARSEOP_STALL '(' {$$ = TrCreateLeafNode (PARSEOP_STALL);} + : PARSEOP_STALL '(' {$$ = TrCreateLeafNode (PARSEOP_STALL);} TermArg ')' {$$ = TrLinkChildren ($3,1,$4);} | PARSEOP_STALL '(' @@ -1564,7 +1565,7 @@ StallTerm ; SwitchTerm - : PARSEOP_SWITCH '(' {$$ = TrCreateLeafNode (PARSEOP_SWITCH);} + : PARSEOP_SWITCH '(' {$$ = TrCreateLeafNode (PARSEOP_SWITCH);} TermArg ')' '{' CaseDefaultTermList '}' @@ -1607,7 +1608,7 @@ CaseTermList */ CaseTerm - : PARSEOP_CASE '(' {$$ = TrCreateLeafNode (PARSEOP_CASE);} + : PARSEOP_CASE '(' {$$ = TrCreateLeafNode (PARSEOP_CASE);} DataObject ')' '{' TermList '}' {$$ = TrLinkChildren ($3,2,$4,$7);} @@ -1616,14 +1617,14 @@ CaseTerm ; DefaultTerm - : PARSEOP_DEFAULT '{' {$$ = TrCreateLeafNode (PARSEOP_DEFAULT);} + : PARSEOP_DEFAULT '{' {$$ = TrCreateLeafNode (PARSEOP_DEFAULT);} TermList '}' {$$ = TrLinkChildren ($3,1,$4);} | PARSEOP_DEFAULT '{' error '}' {$$ = AslDoError(); yyclearin;} ; UnloadTerm - : PARSEOP_UNLOAD '(' {$$ = TrCreateLeafNode (PARSEOP_UNLOAD);} + : PARSEOP_UNLOAD '(' {$$ = TrCreateLeafNode (PARSEOP_UNLOAD);} SuperName ')' {$$ = TrLinkChildren ($3,1,$4);} | PARSEOP_UNLOAD '(' @@ -1631,7 +1632,7 @@ UnloadTerm ; WhileTerm - : PARSEOP_WHILE '(' {$$ = TrCreateLeafNode (PARSEOP_WHILE);} + : PARSEOP_WHILE '(' {$$ = TrCreateLeafNode (PARSEOP_WHILE);} TermArg ')' '{' TermList '}' {$$ = TrLinkChildren ($3,2,$4,$7);} @@ -1643,7 +1644,7 @@ WhileTerm /******* Type 2 opcodes *******************************************************/ AcquireTerm - : PARSEOP_ACQUIRE '(' {$$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} + : PARSEOP_ACQUIRE '(' {$$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} SuperName ',' WordConstExpr ')' {$$ = TrLinkChildren ($3,2,$4,$6);} @@ -1652,7 +1653,7 @@ AcquireTerm ; AddTerm - : PARSEOP_ADD '(' {$$ = TrCreateLeafNode (PARSEOP_ADD);} + : PARSEOP_ADD '(' {$$ = TrCreateLeafNode (PARSEOP_ADD);} TermArg TermArgItem Target @@ -1662,7 +1663,7 @@ AddTerm ; AndTerm - : PARSEOP_AND '(' {$$ = TrCreateLeafNode (PARSEOP_AND);} + : PARSEOP_AND '(' {$$ = TrCreateLeafNode (PARSEOP_AND);} TermArg TermArgItem Target @@ -1672,7 +1673,7 @@ AndTerm ; ConcatTerm - : PARSEOP_CONCATENATE '(' {$$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} + : PARSEOP_CONCATENATE '(' {$$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} TermArg TermArgItem Target @@ -1682,7 +1683,7 @@ ConcatTerm ; ConcatResTerm - : PARSEOP_CONCATENATERESTEMPLATE '(' {$$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);} + : PARSEOP_CONCATENATERESTEMPLATE '(' {$$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);} TermArg TermArgItem Target @@ -1692,7 +1693,7 @@ ConcatResTerm ; CondRefOfTerm - : PARSEOP_CONDREFOF '(' {$$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} + : PARSEOP_CONDREFOF '(' {$$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} SuperName Target ')' {$$ = TrLinkChildren ($3,2,$4,$5);} @@ -1701,7 +1702,7 @@ CondRefOfTerm ; CopyObjectTerm - : PARSEOP_COPYOBJECT '(' {$$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} + : PARSEOP_COPYOBJECT '(' {$$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} TermArg ',' SimpleTarget ')' {$$ = TrLinkChildren ($3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} @@ -1710,7 +1711,7 @@ CopyObjectTerm ; DecTerm - : PARSEOP_DECREMENT '(' {$$ = TrCreateLeafNode (PARSEOP_DECREMENT);} + : PARSEOP_DECREMENT '(' {$$ = TrCreateLeafNode (PARSEOP_DECREMENT);} SuperName ')' {$$ = TrLinkChildren ($3,1,$4);} | PARSEOP_DECREMENT '(' @@ -1718,7 +1719,7 @@ DecTerm ; DerefOfTerm - : PARSEOP_DEREFOF '(' {$$ = TrCreateLeafNode (PARSEOP_DEREFOF);} + : PARSEOP_DEREFOF '(' {$$ = TrCreateLeafNode (PARSEOP_DEREFOF);} TermArg ')' {$$ = TrLinkChildren ($3,1,$4);} | PARSEOP_DEREFOF '(' @@ -1726,7 +1727,7 @@ DerefOfTerm ; DivideTerm - : PARSEOP_DIVIDE '(' {$$ = TrCreateLeafNode (PARSEOP_DIVIDE);} + : PARSEOP_DIVIDE '(' {$$ = TrCreateLeafNode (PARSEOP_DIVIDE);} TermArg TermArgItem Target @@ -1737,7 +1738,7 @@ DivideTerm ; FindSetLeftBitTerm - : PARSEOP_FINDSETLEFTBIT '(' {$$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} + : PARSEOP_FINDSETLEFTBIT '(' {$$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} TermArg Target ')' {$$ = TrLinkChildren ($3,2,$4,$5);} @@ -1746,7 +1747,7 @@ FindSetLeftBitTerm ; FindSetRightBitTerm - : PARSEOP_FINDSETRIGHTBIT '(' {$$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} + : PARSEOP_FINDSETRIGHTBIT '(' {$$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} TermArg Target ')' {$$ = TrLinkChildren ($3,2,$4,$5);} @@ -1755,7 +1756,7 @@ FindSetRightBitTerm ; FromBCDTerm - : PARSEOP_FROMBCD '(' {$$ = TrCreateLeafNode (PARSEOP_FROMBCD);} + : PARSEOP_FROMBCD '(' {$$ = TrCreateLeafNode (PARSEOP_FROMBCD);} TermArg Target ')' {$$ = TrLinkChildren ($3,2,$4,$5);} @@ -1764,7 +1765,7 @@ FromBCDTerm ; IncTerm - : PARSEOP_INCREMENT '(' {$$ = TrCreateLeafNode (PARSEOP_INCREMENT);} + : PARSEOP_INCREMENT '(' {$$ = TrCreateLeafNode (PARSEOP_INCREMENT);} SuperName ')' {$$ = TrLinkChildren ($3,1,$4);} | PARSEOP_INCREMENT '(' @@ -1772,7 +1773,7 @@ IncTerm ; IndexTerm - : PARSEOP_INDEX '(' {$$ = TrCreateLeafNode (PARSEOP_INDEX);} + : PARSEOP_INDEX '(' {$$ = TrCreateLeafNode (PARSEOP_INDEX);} TermArg TermArgItem Target @@ -1782,7 +1783,7 @@ IndexTerm ; LAndTerm - : PARSEOP_LAND '(' {$$ = TrCreateLeafNode (PARSEOP_LAND);} + : PARSEOP_LAND '(' {$$ = TrCreateLeafNode (PARSEOP_LAND);} TermArg TermArgItem ')' {$$ = TrLinkChildren ($3,2,$4,$5);} @@ -1791,7 +1792,7 @@ LAndTerm ; LEqualTerm - : PARSEOP_LEQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LEQUAL);} + : PARSEOP_LEQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LEQUAL);} TermArg TermArgItem ')' {$$ = TrLinkChildren ($3,2,$4,$5);} @@ -1800,7 +1801,7 @@ LEqualTerm ; LGreaterTerm - : PARSEOP_LGREATER '(' {$$ = TrCreateLeafNode (PARSEOP_LGREATER);} + : PARSEOP_LGREATER '(' {$$ = TrCreateLeafNode (PARSEOP_LGREATER);} TermArg TermArgItem ')' {$$ = TrLinkChildren ($3,2,$4,$5);} @@ -1809,7 +1810,7 @@ LGreaterTerm ; LGreaterEqualTerm - : PARSEOP_LGREATEREQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LLESS);} + : PARSEOP_LGREATEREQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LLESS);} TermArg TermArgItem ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($3,2,$4,$5));} @@ -1818,7 +1819,7 @@ LGreaterEqualTerm ; LLessTerm - : PARSEOP_LLESS '(' {$$ = TrCreateLeafNode (PARSEOP_LLESS);} + : PARSEOP_LLESS '(' {$$ = TrCreateLeafNode (PARSEOP_LLESS);} TermArg TermArgItem ')' {$$ = TrLinkChildren ($3,2,$4,$5);} @@ -1827,7 +1828,7 @@ LLessTerm ; LLessEqualTerm - : PARSEOP_LLESSEQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LGREATER);} + : PARSEOP_LLESSEQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LGREATER);} TermArg TermArgItem ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($3,2,$4,$5));} @@ -1836,7 +1837,7 @@ LLessEqualTerm ; LNotTerm - : PARSEOP_LNOT '(' {$$ = TrCreateLeafNode (PARSEOP_LNOT);} + : PARSEOP_LNOT '(' {$$ = TrCreateLeafNode (PARSEOP_LNOT);} TermArg ')' {$$ = TrLinkChildren ($3,1,$4);} | PARSEOP_LNOT '(' @@ -1844,7 +1845,7 @@ LNotTerm ; LNotEqualTerm - : PARSEOP_LNOTEQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LEQUAL);} + : PARSEOP_LNOTEQUAL '(' {$$ = TrCreateLeafNode (PARSEOP_LEQUAL);} TermArg TermArgItem ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($3,2,$4,$5));} @@ -1853,7 +1854,7 @@ LNotEqualTerm ; LoadTableTerm - : PARSEOP_LOADTABLE '(' {$$ = TrCreateLeafNode (PARSEOP_LOADTABLE);} + : PARSEOP_LOADTABLE '(' {$$ = TrCreateLeafNode (PARSEOP_LOADTABLE);} TermArg TermArgItem TermArgItem @@ -1866,7 +1867,7 @@ LoadTableTerm ; LOrTerm - : PARSEOP_LOR '(' {$$ = TrCreateLeafNode (PARSEOP_LOR);} + : PARSEOP_LOR '(' {$$ = TrCreateLeafNode (PARSEOP_LOR);} TermArg TermArgItem ')' {$$ = TrLinkChildren ($3,2,$4,$5);} @@ -1875,7 +1876,7 @@ LOrTerm ; MatchTerm - : PARSEOP_MATCH '(' {$$ = TrCreateLeafNode (PARSEOP_MATCH);} + : PARSEOP_MATCH '(' {$$ = TrCreateLeafNode (PARSEOP_MATCH);} TermArg ',' MatchOpKeyword TermArgItem @@ -1888,7 +1889,7 @@ MatchTerm ; MidTerm - : PARSEOP_MID '(' {$$ = TrCreateLeafNode (PARSEOP_MID);} + : PARSEOP_MID '(' {$$ = TrCreateLeafNode (PARSEOP_MID);} TermArg TermArgItem TermArgItem @@ -1899,7 +1900,7 @@ MidTerm ; ModTerm - : PARSEOP_MOD '(' {$$ = TrCreateLeafNode (PARSEOP_MOD);} + : PARSEOP_MOD '(' {$$ = TrCreateLeafNode (PARSEOP_MOD);} TermArg TermArgItem Target @@ -1909,7 +1910,7 @@ ModTerm ; MultiplyTerm - : PARSEOP_MULTIPLY '(' {$$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} + : PARSEOP_MULTIPLY '(' {$$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} TermArg TermArgItem Target @@ -1919,7 +1920,7 @@ MultiplyTerm ; NAndTerm - : PARSEOP_NAND '(' {$$ = TrCreateLeafNode (PARSEOP_NAND);} + : PARSEOP_NAND '(' {$$ = TrCreateLeafNode (PARSEOP_NAND);} TermArg TermArgItem Target @@ -1929,7 +1930,7 @@ NAndTerm ; NOrTerm - : PARSEOP_NOR '(' {$$ = TrCreateLeafNode (PARSEOP_NOR);} + : PARSEOP_NOR '(' {$$ = TrCreateLeafNode (PARSEOP_NOR);} TermArg TermArgItem Target @@ -1939,7 +1940,7 @@ NOrTerm ; NotTerm - : PARSEOP_NOT '(' {$$ = TrCreateLeafNode (PARSEOP_NOT);} + : PARSEOP_NOT '(' {$$ = TrCreateLeafNode (PARSEOP_NOT);} TermArg Target ')' {$$ = TrLinkChildren ($3,2,$4,$5);} @@ -1948,7 +1949,7 @@ NotTerm ; ObjectTypeTerm - : PARSEOP_OBJECTTYPE '(' {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} + : PARSEOP_OBJECTTYPE '(' {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} SuperName ')' {$$ = TrLinkChildren ($3,1,$4);} | PARSEOP_OBJECTTYPE '(' @@ -1956,7 +1957,7 @@ ObjectTypeTerm ; OrTerm - : PARSEOP_OR '(' {$$ = TrCreateLeafNode (PARSEOP_OR);} + : PARSEOP_OR '(' {$$ = TrCreateLeafNode (PARSEOP_OR);} TermArg TermArgItem Target @@ -1970,7 +1971,7 @@ OrTerm * we've taken a pointer to it. (hard to tell if a local becomes initialized this way.) */ RefOfTerm - : PARSEOP_REFOF '(' {$$ = TrCreateLeafNode (PARSEOP_REFOF);} + : PARSEOP_REFOF '(' {$$ = TrCreateLeafNode (PARSEOP_REFOF);} SuperName ')' {$$ = TrLinkChildren ($3,1,TrSetNodeFlags ($4, NODE_IS_TARGET));} | PARSEOP_REFOF '(' @@ -1978,7 +1979,7 @@ RefOfTerm ; ShiftLeftTerm - : PARSEOP_SHIFTLEFT '(' {$$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} + : PARSEOP_SHIFTLEFT '(' {$$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} TermArg TermArgItem Target @@ -1988,7 +1989,7 @@ ShiftLeftTerm ; ShiftRightTerm - : PARSEOP_SHIFTRIGHT '(' {$$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} + : PARSEOP_SHIFTRIGHT '(' {$$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} TermArg TermArgItem Target @@ -1998,7 +1999,7 @@ ShiftRightTerm ; SizeOfTerm - : PARSEOP_SIZEOF '(' {$$ = TrCreateLeafNode (PARSEOP_SIZEOF);} + : PARSEOP_SIZEOF '(' {$$ = TrCreateLeafNode (PARSEOP_SIZEOF);} SuperName ')' {$$ = TrLinkChildren ($3,1,$4);} | PARSEOP_SIZEOF '(' @@ -2006,7 +2007,7 @@ SizeOfTerm ; StoreTerm - : PARSEOP_STORE '(' {$$ = TrCreateLeafNode (PARSEOP_STORE);} + : PARSEOP_STORE '(' {$$ = TrCreateLeafNode (PARSEOP_STORE);} TermArg ',' SuperName ')' {$$ = TrLinkChildren ($3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} @@ -2015,7 +2016,7 @@ StoreTerm ; SubtractTerm - : PARSEOP_SUBTRACT '(' {$$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} + : PARSEOP_SUBTRACT '(' {$$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} TermArg TermArgItem Target @@ -2025,7 +2026,7 @@ SubtractTerm ; TimerTerm - : PARSEOP_TIMER '(' {$$ = TrCreateLeafNode (PARSEOP_TIMER);} + : PARSEOP_TIMER '(' {$$ = TrCreateLeafNode (PARSEOP_TIMER);} ')' {$$ = TrLinkChildren ($3,0);} | PARSEOP_TIMER {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_TIMER),0);} | PARSEOP_TIMER '(' @@ -2033,7 +2034,7 @@ TimerTerm ; ToBCDTerm - : PARSEOP_TOBCD '(' {$$ = TrCreateLeafNode (PARSEOP_TOBCD);} + : PARSEOP_TOBCD '(' {$$ = TrCreateLeafNode (PARSEOP_TOBCD);} TermArg Target ')' {$$ = TrLinkChildren ($3,2,$4,$5);} @@ -2042,7 +2043,7 @@ ToBCDTerm ; ToBufferTerm - : PARSEOP_TOBUFFER '(' {$$ = TrCreateLeafNode (PARSEOP_TOBUFFER);} + : PARSEOP_TOBUFFER '(' {$$ = TrCreateLeafNode (PARSEOP_TOBUFFER);} TermArg Target ')' {$$ = TrLinkChildren ($3,2,$4,$5);} @@ -2051,7 +2052,7 @@ ToBufferTerm ; ToDecimalStringTerm - : PARSEOP_TODECIMALSTRING '(' {$$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);} + : PARSEOP_TODECIMALSTRING '(' {$$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);} TermArg Target ')' {$$ = TrLinkChildren ($3,2,$4,$5);} @@ -2060,7 +2061,7 @@ ToDecimalStringTerm ; ToHexStringTerm - : PARSEOP_TOHEXSTRING '(' {$$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);} + : PARSEOP_TOHEXSTRING '(' {$$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);} TermArg Target ')' {$$ = TrLinkChildren ($3,2,$4,$5);} @@ -2069,7 +2070,7 @@ ToHexStringTerm ; ToIntegerTerm - : PARSEOP_TOINTEGER '(' {$$ = TrCreateLeafNode (PARSEOP_TOINTEGER);} + : PARSEOP_TOINTEGER '(' {$$ = TrCreateLeafNode (PARSEOP_TOINTEGER);} TermArg Target ')' {$$ = TrLinkChildren ($3,2,$4,$5);} @@ -2078,7 +2079,7 @@ ToIntegerTerm ; ToStringTerm - : PARSEOP_TOSTRING '(' {$$ = TrCreateLeafNode (PARSEOP_TOSTRING);} + : PARSEOP_TOSTRING '(' {$$ = TrCreateLeafNode (PARSEOP_TOSTRING);} TermArg OptionalCount Target @@ -2095,7 +2096,7 @@ ToUUIDTerm ; WaitTerm - : PARSEOP_WAIT '(' {$$ = TrCreateLeafNode (PARSEOP_WAIT);} + : PARSEOP_WAIT '(' {$$ = TrCreateLeafNode (PARSEOP_WAIT);} SuperName TermArgItem ')' {$$ = TrLinkChildren ($3,2,$4,$5);} @@ -2104,7 +2105,7 @@ WaitTerm ; XOrTerm - : PARSEOP_XOR '(' {$$ = TrCreateLeafNode (PARSEOP_XOR);} + : PARSEOP_XOR '(' {$$ = TrCreateLeafNode (PARSEOP_XOR);} TermArg TermArgItem Target @@ -2175,6 +2176,7 @@ RegionSpaceKeyword | PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_SMBUS);} | PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_CMOS);} | PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCIBAR);} + | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);} ; AddressSpaceKeyword @@ -2386,7 +2388,7 @@ QWordConstExpr ConstExprTerm : PARSEOP_ZERO {$$ = TrCreateValuedLeafNode (PARSEOP_ZERO, 0);} | PARSEOP_ONE {$$ = TrCreateValuedLeafNode (PARSEOP_ONE, 1);} - | PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_INTEGER_MAX);} + | PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_UINT64_MAX);} ; /* OptionalCount must appear before ByteList or an incorrect reduction will result */ @@ -2399,7 +2401,7 @@ OptionalCount BufferTerm - : PARSEOP_BUFFER '(' {$$ = TrCreateLeafNode (PARSEOP_BUFFER);} + : PARSEOP_BUFFER '(' {$$ = TrCreateLeafNode (PARSEOP_BUFFER);} OptionalTermArg ')' '{' BufferTermData '}' {$$ = TrLinkChildren ($3,2,$4,$7);} @@ -2429,7 +2431,7 @@ DWordList ; PackageTerm - : PARSEOP_PACKAGE '(' {$$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);} + : PARSEOP_PACKAGE '(' {$$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);} VarPackageLengthTerm ')' '{' PackageList '}' {$$ = TrLinkChildren ($3,2,$4,$7);} @@ -2481,7 +2483,7 @@ ResourceTemplateTerm ; UnicodeTerm - : PARSEOP_UNICODE '(' {$$ = TrCreateLeafNode (PARSEOP_UNICODE);} + : PARSEOP_UNICODE '(' {$$ = TrCreateLeafNode (PARSEOP_UNICODE);} StringData ')' {$$ = TrLinkChildren ($3,2,0,$4);} | PARSEOP_UNICODE '(' @@ -2525,7 +2527,7 @@ ResourceMacroTerm ; DMATerm - : PARSEOP_DMA '(' {$$ = TrCreateLeafNode (PARSEOP_DMA);} + : PARSEOP_DMA '(' {$$ = TrCreateLeafNode (PARSEOP_DMA);} DMATypeKeyword OptionalBusMasterKeyword ',' XferTypeKeyword @@ -2537,7 +2539,7 @@ DMATerm ; DWordIOTerm - : PARSEOP_DWORDIO '(' {$$ = TrCreateLeafNode (PARSEOP_DWORDIO);} + : PARSEOP_DWORDIO '(' {$$ = TrCreateLeafNode (PARSEOP_DWORDIO);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -2559,7 +2561,7 @@ DWordIOTerm ; DWordMemoryTerm - : PARSEOP_DWORDMEMORY '(' {$$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);} + : PARSEOP_DWORDMEMORY '(' {$$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);} OptionalResourceType_First OptionalDecodeType OptionalMinType @@ -2582,8 +2584,8 @@ DWordMemoryTerm ; DWordSpaceTerm - : PARSEOP_DWORDSPACE '(' {$$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);} - ByteConstExpr {$$ = UtCheckIntegerRange ($4, 0xC0, 0xFF);} + : PARSEOP_DWORDSPACE '(' {$$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);} + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} OptionalResourceType OptionalDecodeType OptionalMinType @@ -2611,7 +2613,7 @@ EndDependentFnTerm ; ExtendedIOTerm - : PARSEOP_EXTENDEDIO '(' {$$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);} + : PARSEOP_EXTENDEDIO '(' {$$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -2632,7 +2634,7 @@ ExtendedIOTerm ; ExtendedMemoryTerm - : PARSEOP_EXTENDEDMEMORY '(' {$$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);} + : PARSEOP_EXTENDEDMEMORY '(' {$$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);} OptionalResourceType_First OptionalDecodeType OptionalMinType @@ -2654,8 +2656,8 @@ ExtendedMemoryTerm ; ExtendedSpaceTerm - : PARSEOP_EXTENDEDSPACE '(' {$$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);} - ByteConstExpr {$$ = UtCheckIntegerRange ($4, 0xC0, 0xFF);} + : PARSEOP_EXTENDEDSPACE '(' {$$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);} + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} OptionalResourceType OptionalDecodeType OptionalMinType @@ -2674,7 +2676,7 @@ ExtendedSpaceTerm ; FixedIOTerm - : PARSEOP_FIXEDIO '(' {$$ = TrCreateLeafNode (PARSEOP_FIXEDIO);} + : PARSEOP_FIXEDIO '(' {$$ = TrCreateLeafNode (PARSEOP_FIXEDIO);} WordConstExpr ',' ByteConstExpr OptionalNameString_Last @@ -2684,7 +2686,7 @@ FixedIOTerm ; InterruptTerm - : PARSEOP_INTERRUPT '(' {$$ = TrCreateLeafNode (PARSEOP_INTERRUPT);} + : PARSEOP_INTERRUPT '(' {$$ = TrCreateLeafNode (PARSEOP_INTERRUPT);} OptionalResourceType_First ',' InterruptTypeKeyword ',' InterruptLevel @@ -2699,7 +2701,7 @@ InterruptTerm ; IOTerm - : PARSEOP_IO '(' {$$ = TrCreateLeafNode (PARSEOP_IO);} + : PARSEOP_IO '(' {$$ = TrCreateLeafNode (PARSEOP_IO);} IODecodeKeyword ',' WordConstExpr ',' WordConstExpr @@ -2712,7 +2714,7 @@ IOTerm ; IRQNoFlagsTerm - : PARSEOP_IRQNOFLAGS '(' {$$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);} + : PARSEOP_IRQNOFLAGS '(' {$$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);} OptionalNameString_First ')' '{' ByteList '}' {$$ = TrLinkChildren ($3,2,$4,$7);} @@ -2721,7 +2723,7 @@ IRQNoFlagsTerm ; IRQTerm - : PARSEOP_IRQ '(' {$$ = TrCreateLeafNode (PARSEOP_IRQ);} + : PARSEOP_IRQ '(' {$$ = TrCreateLeafNode (PARSEOP_IRQ);} InterruptTypeKeyword ',' InterruptLevel OptionalShareType @@ -2733,7 +2735,7 @@ IRQTerm ; Memory24Term - : PARSEOP_MEMORY24 '(' {$$ = TrCreateLeafNode (PARSEOP_MEMORY24);} + : PARSEOP_MEMORY24 '(' {$$ = TrCreateLeafNode (PARSEOP_MEMORY24);} OptionalReadWriteKeyword ',' WordConstExpr ',' WordConstExpr @@ -2746,7 +2748,7 @@ Memory24Term ; Memory32FixedTerm - : PARSEOP_MEMORY32FIXED '(' {$$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);} + : PARSEOP_MEMORY32FIXED '(' {$$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);} OptionalReadWriteKeyword ',' DWordConstExpr ',' DWordConstExpr @@ -2757,7 +2759,7 @@ Memory32FixedTerm ; Memory32Term - : PARSEOP_MEMORY32 '(' {$$ = TrCreateLeafNode (PARSEOP_MEMORY32);} + : PARSEOP_MEMORY32 '(' {$$ = TrCreateLeafNode (PARSEOP_MEMORY32);} OptionalReadWriteKeyword ',' DWordConstExpr ',' DWordConstExpr @@ -2770,7 +2772,7 @@ Memory32Term ; QWordIOTerm - : PARSEOP_QWORDIO '(' {$$ = TrCreateLeafNode (PARSEOP_QWORDIO);} + : PARSEOP_QWORDIO '(' {$$ = TrCreateLeafNode (PARSEOP_QWORDIO);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -2792,7 +2794,7 @@ QWordIOTerm ; QWordMemoryTerm - : PARSEOP_QWORDMEMORY '(' {$$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);} + : PARSEOP_QWORDMEMORY '(' {$$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);} OptionalResourceType_First OptionalDecodeType OptionalMinType @@ -2815,8 +2817,8 @@ QWordMemoryTerm ; QWordSpaceTerm - : PARSEOP_QWORDSPACE '(' {$$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);} - ByteConstExpr {$$ = UtCheckIntegerRange ($4, 0xC0, 0xFF);} + : PARSEOP_QWORDSPACE '(' {$$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);} + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} OptionalResourceType OptionalDecodeType OptionalMinType @@ -2836,7 +2838,7 @@ QWordSpaceTerm ; RegisterTerm - : PARSEOP_REGISTER '(' {$$ = TrCreateLeafNode (PARSEOP_REGISTER);} + : PARSEOP_REGISTER '(' {$$ = TrCreateLeafNode (PARSEOP_REGISTER);} AddressSpaceKeyword ',' ByteConstExpr ',' ByteConstExpr @@ -2849,7 +2851,7 @@ RegisterTerm ; StartDependentFnTerm - : PARSEOP_STARTDEPENDENTFN '(' {$$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);} + : PARSEOP_STARTDEPENDENTFN '(' {$$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);} ByteConstExpr ',' ByteConstExpr ')' '{' @@ -2859,7 +2861,7 @@ StartDependentFnTerm ; StartDependentFnNoPriTerm - : PARSEOP_STARTDEPENDENTFN_NOPRI '(' {$$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} + : PARSEOP_STARTDEPENDENTFN_NOPRI '(' {$$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} ')' '{' ResourceMacroList '}' {$$ = TrLinkChildren ($3,1,$6);} | PARSEOP_STARTDEPENDENTFN_NOPRI '(' @@ -2867,7 +2869,7 @@ StartDependentFnNoPriTerm ; VendorLongTerm - : PARSEOP_VENDORLONG '(' {$$ = TrCreateLeafNode (PARSEOP_VENDORLONG);} + : PARSEOP_VENDORLONG '(' {$$ = TrCreateLeafNode (PARSEOP_VENDORLONG);} OptionalNameString_First ')' '{' ByteList '}' {$$ = TrLinkChildren ($3,2,$4,$7);} @@ -2876,7 +2878,7 @@ VendorLongTerm ; VendorShortTerm - : PARSEOP_VENDORSHORT '(' {$$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);} + : PARSEOP_VENDORSHORT '(' {$$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);} OptionalNameString_First ')' '{' ByteList '}' {$$ = TrLinkChildren ($3,2,$4,$7);} @@ -2885,7 +2887,7 @@ VendorShortTerm ; WordBusNumberTerm - : PARSEOP_WORDBUSNUMBER '(' {$$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);} + : PARSEOP_WORDBUSNUMBER '(' {$$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -2904,7 +2906,7 @@ WordBusNumberTerm ; WordIOTerm - : PARSEOP_WORDIO '(' {$$ = TrCreateLeafNode (PARSEOP_WORDIO);} + : PARSEOP_WORDIO '(' {$$ = TrCreateLeafNode (PARSEOP_WORDIO);} OptionalResourceType_First OptionalMinType OptionalMaxType @@ -2926,8 +2928,8 @@ WordIOTerm ; WordSpaceTerm - : PARSEOP_WORDSPACE '(' {$$ = TrCreateLeafNode (PARSEOP_WORDSPACE);} - ByteConstExpr {$$ = UtCheckIntegerRange ($4, 0xC0, 0xFF);} + : PARSEOP_WORDSPACE '(' {$$ = TrCreateLeafNode (PARSEOP_WORDSPACE);} + ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} OptionalResourceType OptionalDecodeType OptionalMinType @@ -3070,8 +3072,7 @@ OptionalRangeType OptionalReference : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ | ',' {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ - | ',' DataObject {$$ = $2;} - | ',' NameString {$$ = $2;} + | ',' TermArg {$$ = $2;} ; OptionalResourceType_First @@ -3080,8 +3081,7 @@ OptionalResourceType_First ; OptionalResourceType - : {$$ = NULL;} - | ',' {$$ = NULL;} + : ',' {$$ = NULL;} | ',' ResourceTypeKeyword {$$ = $2;} ; diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/asldefine.h b/src/add-ons/kernel/bus_managers/acpi/compiler/asldefine.h index aeb368fa06..75345a5d7f 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/asldefine.h +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/asldefine.h @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -127,7 +127,7 @@ #define IntelAcpiCA "Intel ACPI Component Architecture" #define CompilerId "ASL Optimizing Compiler" #define DisassemblerId "AML Disassembler" -#define CompilerCopyright "Copyright (C) 2000 - 2009 Intel Corporation" +#define CompilerCopyright "Copyright (c) 2000 - 2010 Intel Corporation" #define CompilerCompliance "Supports ACPI Specification Revision 4.0" #define CompilerName "iasl" #define CompilerCreatorId "INTL" diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslerror.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslerror.c index 87300b1529..f90df3807f 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslerror.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslerror.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -169,13 +169,7 @@ AeAddToErrorLog ( ASL_ERROR_MSG *Prev; - if (!Gbl_ErrorLog) - { - Gbl_ErrorLog = Enode; - return; - } - - /* List is sorted according to line number */ + /* If Gbl_ErrorLog is null, this is the first error node */ if (!Gbl_ErrorLog) { @@ -183,8 +177,10 @@ AeAddToErrorLog ( return; } - /* Walk error list until we find a line number greater than ours */ - + /* + * Walk error list until we find a line number greater than ours. + * List is sorted according to line number. + */ Prev = NULL; Next = Gbl_ErrorLog; @@ -535,6 +531,7 @@ AslCommonError ( Gbl_NextError = Gbl_ErrorLog; CmDoOutputFiles (); CmCleanupAndExit (); + exit(1); } return; diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslfiles.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslfiles.c index 3d24ab3970..ebf59a408e 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslfiles.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslfiles.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslfold.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslfold.c index 4bb305ef1c..c0644aa2a9 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslfold.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslfold.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslglobal.h b/src/add-ons/kernel/bus_managers/acpi/compiler/aslglobal.h index 6aecfb6fb4..69fcf8438a 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslglobal.h +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslglobal.h @@ -10,7 +10,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -165,7 +165,6 @@ ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_LineBufPtr, Gbl_Curren ASL_EXTERN ASL_ERROR_MSG ASL_INIT_GLOBAL (*Gbl_ErrorLog,NULL); ASL_EXTERN ASL_ERROR_MSG ASL_INIT_GLOBAL (*Gbl_NextError,NULL); -extern UINT32 Gbl_ExceptionCount[]; /* Option flags */ @@ -278,5 +277,12 @@ ASL_EXTERN char MsgBuffer[ASL_MSG_BUFFER_SIZE]; ASL_EXTERN char StringBuffer[ASL_MSG_BUFFER_SIZE]; ASL_EXTERN char StringBuffer2[ASL_MSG_BUFFER_SIZE]; + +#ifdef _DECLARE_GLOBALS +UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0}; +#else +extern UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS]; +#endif + #endif /* __ASLGLOBAL_H */ diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/asllength.c b/src/add-ons/kernel/bus_managers/acpi/compiler/asllength.c index bd222e68f4..5a9d1ce603 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/asllength.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/asllength.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/asllisting.c b/src/add-ons/kernel/bus_managers/acpi/compiler/asllisting.c index f229d5fb78..c4253c2e11 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/asllisting.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/asllisting.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslload.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslload.c index 8d06544e7d..5e9fa1ba15 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslload.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslload.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -534,7 +534,7 @@ LdNamespace1Begin ( if (Op->Asl.CompileFlags == NODE_IS_RESOURCE_DESC) { Status = LdLoadResourceElements (Op, WalkState); - goto Exit; + return_ACPI_STATUS (Status); } ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); @@ -575,8 +575,10 @@ LdNamespace1Begin ( goto FinishNode; } - AslCoreSubsystemError (Op, Status, "Failure from lookup\n", FALSE); - goto Exit; + AslCoreSubsystemError (Op, Status, + "Failure from namespace lookup", FALSE); + + return_ACPI_STATUS (Status); } /* We found a node with this name, now check the type */ @@ -711,15 +713,14 @@ LdNamespace1Begin ( AslError (ASL_ERROR, ASL_MSG_NAME_EXISTS, Op, Op->Asl.ExternalName); - Status = AE_OK; - goto Exit; + return_ACPI_STATUS (AE_OK); } } else { AslCoreSubsystemError (Op, Status, - "Failure from lookup %s\n", FALSE); - goto Exit; + "Failure from namespace lookup", FALSE); + return_ACPI_STATUS (Status); } } @@ -757,8 +758,7 @@ FinishNode: Node->Value = (UINT32) Op->Asl.Extra; } -Exit: - return (Status); + return_ACPI_STATUS (Status); } @@ -885,7 +885,8 @@ LdNamespace2Begin ( return (AE_OK); } - AslCoreSubsystemError (Op, Status, "Failure from lookup\n", FALSE); + AslCoreSubsystemError (Op, Status, + "Failure from namespace lookup", FALSE); return (AE_OK); } diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/asllookup.c b/src/add-ons/kernel/bus_managers/acpi/compiler/asllookup.c index 51c036967c..2c1253d2d4 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/asllookup.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/asllookup.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -526,7 +526,7 @@ LsDisplayNamespace ( /* Walk entire namespace from the root */ Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, FALSE, LsDoOneNamespaceObject, + ACPI_UINT32_MAX, FALSE, LsDoOneNamespaceObject, NULL, NULL, NULL); /* Print the full pathname for each namespace node */ @@ -534,7 +534,7 @@ LsDisplayNamespace ( FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "\nNamespace pathnames\n\n"); Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, FALSE, LsDoOnePathname, + ACPI_UINT32_MAX, FALSE, LsDoOnePathname, NULL, NULL, NULL); return (Status); @@ -598,7 +598,7 @@ LkObjectExists ( /* Walk entire namespace from the supplied root */ Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, FALSE, LsCompareOneNamespaceObject, + ACPI_UINT32_MAX, FALSE, LsCompareOneNamespaceObject, NULL, Name, NULL); if (Status == AE_CTRL_TRUE) { @@ -753,7 +753,7 @@ LkFindUnreferencedObjects ( /* Walk entire namespace from the supplied root */ (void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, FALSE, LkIsObjectUsed, + ACPI_UINT32_MAX, FALSE, LkIsObjectUsed, NULL, NULL, NULL); } diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslmain.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslmain.c index aa29ab82f8..45d7252c0a 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslmain.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslmain.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -165,9 +165,6 @@ static int AslDoResponseFile ( char *Filename); -extern int AcpiGbl_Opterr; -extern int AcpiGbl_Optind; - #define ASL_TOKEN_SEPARATORS " \t\n" #define ASL_SUPPORTED_OPTIONS "@:2b:cd^e:fgh^i^I:l^o:p:r:s:t:v:w:x:" diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslmap.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslmap.c index 4c1fdf0c6f..6b3019a726 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslmap.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslmap.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslopcodes.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslopcodes.c index e386266427..1c6eef7248 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslopcodes.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslopcodes.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -328,7 +328,7 @@ OpcSetOptimalIntegerSize ( } break; - case ACPI_INTEGER_MAX: + case ACPI_UINT64_MAX: /* Check for table integer width (32 or 64) */ @@ -568,7 +568,7 @@ OpcDoEisaId ( if (i < 3) { - if (!isupper (InString[i])) + if (!isupper ((int) InString[i])) { Status = AE_BAD_PARAMETER; } @@ -576,7 +576,7 @@ OpcDoEisaId ( /* Last 4 characters must be hex digits */ - else if (!isxdigit (InString[i])) + else if (!isxdigit ((int) InString[i])) { Status = AE_BAD_PARAMETER; } @@ -666,7 +666,7 @@ OpcDoUuId ( } else { - if (!isxdigit (InString[i])) + if (!isxdigit ((int) InString[i])) { Status = AE_BAD_PARAMETER; } diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/asloperands.c b/src/add-ons/kernel/bus_managers/acpi/compiler/asloperands.c index c354855dd6..bf6dcf2cba 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/asloperands.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/asloperands.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -604,7 +604,7 @@ OpnDoRegion ( } else { - Op->Asl.Value.Integer = ACPI_INTEGER_MAX; + Op->Asl.Value.Integer = ACPI_UINT64_MAX; } } @@ -788,20 +788,30 @@ OpnDoPackage ( if ((PackageLengthOp->Asl.ParseOpcode == PARSEOP_INTEGER) || (PackageLengthOp->Asl.ParseOpcode == PARSEOP_QWORDCONST)) { - if (PackageLengthOp->Asl.Value.Integer >= PackageLength) + if (PackageLengthOp->Asl.Value.Integer > PackageLength) { - /* Allow package to be longer than the initializer list */ + /* + * Allow package length to be longer than the initializer + * list -- but if the length of initializer list is nonzero, + * issue a message since this is probably a coding error, + * even though technically legal. + */ + if (PackageLength > 0) + { + AslError (ASL_REMARK, ASL_MSG_LIST_LENGTH_SHORT, + PackageLengthOp, NULL); + } PackageLength = (UINT32) PackageLengthOp->Asl.Value.Integer; } - else + else if (PackageLengthOp->Asl.Value.Integer < PackageLength) { /* - * Initializer list is longer than the package length. This - * is an error as per the ACPI spec. + * The package length is smaller than the length of the + * initializer list. This is an error as per the ACPI spec. */ - AslError (ASL_ERROR, ASL_MSG_LIST_LENGTH, - PackageLengthOp->Asl.Next, NULL); + AslError (ASL_ERROR, ASL_MSG_LIST_LENGTH_LONG, + PackageLengthOp, NULL); } } @@ -997,7 +1007,7 @@ OpnDoDefinitionBlock ( for (i = 0; i < 4; i++) { - if (!isalnum (Gbl_TableSignature[i])) + if (!isalnum ((int) Gbl_TableSignature[i])) { AslError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, Child, "Contains non-alphanumeric characters"); diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslopt.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslopt.c index 3013f4cbd2..6f0b756c0f 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslopt.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslopt.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslresource.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslresource.c index ceebd9c1e8..421fde3a36 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslresource.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslresource.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -184,7 +184,7 @@ RsCreateBitField ( { Op->Asl.ExternalName = Name; - Op->Asl.Value.Integer = ((ACPI_INTEGER) ByteOffset * 8) + BitOffset; + Op->Asl.Value.Integer = ((UINT64) ByteOffset * 8) + BitOffset; Op->Asl.CompileFlags |= (NODE_IS_RESOURCE_FIELD | NODE_IS_BIT_OFFSET); } diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslrestype1.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslrestype1.c index edc8405403..1dbff0310f 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslrestype1.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslrestype1.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslrestype2.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslrestype2.c index 7074a5576e..7ca8eeb70c 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslrestype2.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslrestype2.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslstartup.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslstartup.c old mode 100755 new mode 100644 index 87e102bd9e..ea61c9e392 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslstartup.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslstartup.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslstubs.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslstubs.c index b352a68a9d..66e3c0cce0 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslstubs.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslstubs.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/asltransform.c b/src/add-ons/kernel/bus_managers/acpi/compiler/asltransform.c index eb4546818c..5327a90723 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/asltransform.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/asltransform.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -468,6 +468,8 @@ TrDoSwitch ( ACPI_PARSE_OBJECT *NewOp; ACPI_PARSE_OBJECT *NewOp2; ACPI_PARSE_OBJECT *MethodOp; + ACPI_PARSE_OBJECT *StoreOp; + ACPI_PARSE_OBJECT *BreakOp; char *PredicateValueName; UINT16 Index; UINT32 Btype; @@ -552,7 +554,7 @@ TrDoSwitch ( NewOp = NewOp2; NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, - (ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName)); + (UINT64) ACPI_TO_INTEGER (PredicateValueName)); NewOp->Asl.Next = NewOp2; TrAmlInitLineNumbers (NewOp2, Predicate); @@ -610,7 +612,7 @@ TrDoSwitch ( * CaseOp->Child->Peer is the beginning of the case block */ NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, - (ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName)); + (UINT64) ACPI_TO_INTEGER (PredicateValueName)); NewOp->Asl.Next = Predicate; TrAmlInitLineNumbers (NewOp, Predicate); @@ -638,11 +640,7 @@ TrDoSwitch ( */ if (CurrentParentNode == StartNode) { - Conditional->Asl.Parent = CurrentParentNode->Asl.Parent; - - /* Link IF into the peer list */ - - TrAmlInsertPeer (CurrentParentNode, Conditional); + Conditional->Asl.Next = NULL; } else { @@ -695,6 +693,7 @@ TrDoSwitch ( { return; } + TrAmlInitNode (DefaultOp, PARSEOP_ELSE); DefaultOp->Asl.Parent = Conditional->Asl.Parent; @@ -762,7 +761,7 @@ TrDoSwitch ( /* Create the NameSeg child for the Name node */ NewOp2 = TrCreateValuedLeafNode (PARSEOP_NAMESEG, - (ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName)); + (UINT64) ACPI_TO_INTEGER (PredicateValueName)); NewOp2->Asl.CompileFlags |= NODE_IS_NAME_DECLARATION; NewOp->Asl.Child = NewOp2; @@ -772,22 +771,22 @@ TrDoSwitch ( { case ACPI_BTYPE_INTEGER: NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_ZERO, - (ACPI_INTEGER) 0); + (UINT64) 0); break; case ACPI_BTYPE_STRING: NewOp2->Asl.Next = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, - (ACPI_INTEGER) ACPI_TO_INTEGER ("")); + (UINT64) ACPI_TO_INTEGER ("")); break; case ACPI_BTYPE_BUFFER: (void) TrLinkPeerNode (NewOp2, TrCreateValuedLeafNode (PARSEOP_BUFFER, - (ACPI_INTEGER) 0)); + (UINT64) 0)); Next = NewOp2->Asl.Next; (void) TrLinkChildren (Next, 1, TrCreateValuedLeafNode (PARSEOP_ZERO, - (ACPI_INTEGER) 1)); + (UINT64) 1)); (void) TrLinkPeerNode (Next->Asl.Child, - TrCreateValuedLeafNode (PARSEOP_DEFAULT_ARG, (ACPI_INTEGER) 0)); + TrCreateValuedLeafNode (PARSEOP_DEFAULT_ARG, (UINT64) 0)); TrAmlSetSubtreeParent (Next->Asl.Child, Next); break; @@ -799,22 +798,44 @@ TrDoSwitch ( TrAmlSetSubtreeParent (NewOp2, NewOp); /* - * Transform the Switch() into a Store() node which will be used to save the + * Transform the Switch() into a While(One)-Break node. + * And create a Store() node which will be used to save the * Switch() value. The store is of the form: Store (Value, _T_x) * where _T_x is the temp variable. */ - TrAmlInitNode (StartNode, PARSEOP_STORE); - StartNode->Asl.Child = NULL; + TrAmlInitNode (StartNode, PARSEOP_WHILE); + NewOp = TrCreateLeafNode (PARSEOP_ONE); + NewOp->Asl.Next = Predicate->Asl.Next; + NewOp->Asl.Parent = StartNode; + StartNode->Asl.Child = NewOp; + + /* Create a Store() node */ + + StoreOp = TrCreateLeafNode (PARSEOP_STORE); + StoreOp->Asl.Parent = StartNode; + TrAmlInsertPeer (NewOp, StoreOp); /* Complete the Store subtree */ - StartNode->Asl.Child = Predicate; - Predicate->Asl.Parent = StartNode; + StoreOp->Asl.Child = Predicate; + Predicate->Asl.Parent = StoreOp; NewOp = TrCreateValuedLeafNode (PARSEOP_NAMESEG, - (ACPI_INTEGER) ACPI_TO_INTEGER (PredicateValueName)); - NewOp->Asl.Parent = StartNode; + (UINT64) ACPI_TO_INTEGER (PredicateValueName)); + NewOp->Asl.Parent = StoreOp; Predicate->Asl.Next = NewOp; + + /* Create a Break() node and insert it into the end of While() */ + + Conditional = StartNode->Asl.Child; + while (Conditional->Asl.Next) + { + Conditional = Conditional->Asl.Next; + } + + BreakOp = TrCreateLeafNode (PARSEOP_BREAK); + BreakOp->Asl.Parent = StartNode; + TrAmlInsertPeer (Conditional, BreakOp); } diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/asltree.c b/src/add-ons/kernel/bus_managers/acpi/compiler/asltree.c index 30f59ee46d..1167f51bec 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/asltree.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/asltree.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -490,7 +490,7 @@ TrCreateLeafNode ( ACPI_PARSE_OBJECT * TrCreateValuedLeafNode ( UINT32 ParseOpcode, - ACPI_INTEGER Value) + UINT64 Value) { ACPI_PARSE_OBJECT *Op; diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/asltypes.h b/src/add-ons/kernel/bus_managers/acpi/compiler/asltypes.h index fb2396f4dd..9e1d426d2b 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/asltypes.h +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/asltypes.h @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -369,7 +369,8 @@ typedef enum ASL_MSG_INVALID_TIME, ASL_MSG_INVALID_TYPE, ASL_MSG_INVALID_UUID, - ASL_MSG_LIST_LENGTH, + ASL_MSG_LIST_LENGTH_LONG, + ASL_MSG_LIST_LENGTH_SHORT, ASL_MSG_LISTING_FILE_OPEN, ASL_MSG_LISTING_FILENAME, ASL_MSG_LOCAL_INIT, @@ -488,7 +489,8 @@ char *AslMessages [] = { /* ASL_MSG_INVALID_TIME */ "Time parameter too long (255 max)", /* ASL_MSG_INVALID_TYPE */ "Invalid type", /* ASL_MSG_INVALID_UUID */ "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"", -/* ASL_MSG_LIST_LENGTH */ "Initializer list too long", +/* ASL_MSG_LIST_LENGTH_LONG */ "Initializer list longer than declared package length", +/* ASL_MSG_LIST_LENGTH_SHORT */ "Initializer list shorter than declared package length", /* ASL_MSG_LISTING_FILE_OPEN */ "Could not open listing file", /* ASL_MSG_LISTING_FILENAME */ "Could not create listing filename", /* ASL_MSG_LOCAL_INIT */ "Method local variable is not initialized", @@ -569,11 +571,6 @@ char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = { #define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings above */ -/* Exception counters */ - -UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0}; - -#endif - +#endif /* ASL_EXCEPTIONS */ #endif /* __ASLTYPES_H */ diff --git a/src/add-ons/kernel/bus_managers/acpi/compiler/aslutils.c b/src/add-ons/kernel/bus_managers/acpi/compiler/aslutils.c index ecba7c32cf..01db90a306 100644 --- a/src/add-ons/kernel/bus_managers/acpi/compiler/aslutils.c +++ b/src/add-ons/kernel/bus_managers/acpi/compiler/aslutils.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -142,7 +142,7 @@ static ACPI_STATUS UtStrtoul64 ( char *String, UINT32 Base, - ACPI_INTEGER *RetInteger); + UINT64 *RetInteger); static void UtPadNameWithUnderscores ( @@ -846,12 +846,12 @@ UtAttachNamepathToOwner ( * ******************************************************************************/ -ACPI_INTEGER +UINT64 UtDoConstant ( char *String) { ACPI_STATUS Status; - ACPI_INTEGER Converted; + UINT64 Converted; char ErrBuf[64]; @@ -888,11 +888,11 @@ static ACPI_STATUS UtStrtoul64 ( char *String, UINT32 Base, - ACPI_INTEGER *RetInteger) + UINT64 *RetInteger) { UINT32 Index; UINT32 Sign; - ACPI_INTEGER ReturnValue = 0; + UINT64 ReturnValue = 0; ACPI_STATUS Status = AE_OK; @@ -916,7 +916,7 @@ UtStrtoul64 ( /* Skip over any white space in the buffer: */ - while (isspace (*String) || *String == '\t') + while (isspace ((int) *String) || *String == '\t') { ++String; } @@ -948,7 +948,7 @@ UtStrtoul64 ( { if (*String == '0') { - if (tolower (*(++String)) == 'x') + if (tolower ((int) *(++String)) == 'x') { Base = 16; ++String; @@ -975,7 +975,7 @@ UtStrtoul64 ( if (Base == 16 && *String == '0' && - tolower (*(++String)) == 'x') + tolower ((int) *(++String)) == 'x') { String++; } @@ -984,14 +984,14 @@ UtStrtoul64 ( while (*String) { - if (isdigit (*String)) + if (isdigit ((int) *String)) { Index = ((UINT8) *String) - '0'; } else { - Index = (UINT8) toupper (*String); - if (isupper ((char) Index)) + Index = (UINT8) toupper ((int) *String); + if (isupper ((int) Index)) { Index = Index - 'A' + 10; } @@ -1008,8 +1008,8 @@ UtStrtoul64 ( /* Check to see if value is out of range: */ - if (ReturnValue > ((ACPI_INTEGER_MAX - (ACPI_INTEGER) Index) / - (ACPI_INTEGER) Base)) + if (ReturnValue > ((ACPI_UINT64_MAX - (UINT64) Index) / + (UINT64) Base)) { goto ErrorExit; } diff --git a/src/add-ons/kernel/bus_managers/acpi/debugger/dbcmds.c b/src/add-ons/kernel/bus_managers/acpi/debugger/dbcmds.c index 5504535af3..50a8b2e037 100644 --- a/src/add-ons/kernel/bus_managers/acpi/debugger/dbcmds.c +++ b/src/add-ons/kernel/bus_managers/acpi/debugger/dbcmds.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -130,6 +130,7 @@ #define _COMPONENT ACPI_CA_DEBUGGER ACPI_MODULE_NAME ("dbcmds") + /* Local prototypes */ static ACPI_STATUS @@ -382,7 +383,7 @@ AcpiDbFindReferences ( /* Search all nodes in namespace */ (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - AcpiDbWalkForReferences, (void *) ObjDesc, NULL); + AcpiDbWalkForReferences, NULL, (void *) ObjDesc, NULL); } @@ -474,7 +475,7 @@ AcpiDbCheckPredefinedNames ( /* Search all nodes in namespace */ (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - AcpiDbWalkForPredefinedNames, (void *) &Count, NULL); + AcpiDbWalkForPredefinedNames, NULL, (void *) &Count, NULL); AcpiOsPrintf ("Found %d predefined names in the namespace\n", Count); } @@ -501,7 +502,7 @@ AcpiDbWalkForExecute ( void **ReturnValue) { ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; - UINT32 *Count = (UINT32 *) Context; + ACPI_EXECUTE_WALK *Info = (ACPI_EXECUTE_WALK *) Context; ACPI_BUFFER ReturnObj; ACPI_STATUS Status; char *Pathname; @@ -542,7 +543,6 @@ AcpiDbWalkForExecute ( if (ObjInfo->Type == ACPI_TYPE_METHOD) { - /* Setup default parameters */ for (i = 0; i < ObjInfo->ParamCount; i++) @@ -556,11 +556,9 @@ AcpiDbWalkForExecute ( } ACPI_FREE (ObjInfo); - ReturnObj.Pointer = NULL; ReturnObj.Length = ACPI_ALLOCATE_BUFFER; - /* Do the actual method execution */ AcpiGbl_MethodExecuting = TRUE; @@ -569,11 +567,21 @@ AcpiDbWalkForExecute ( AcpiOsPrintf ("%-32s returned %s\n", Pathname, AcpiFormatException (Status)); AcpiGbl_MethodExecuting = FALSE; - ACPI_FREE (Pathname); - (*Count)++; - return (AE_OK); + /* Ignore status from method execution */ + + Status = AE_OK; + + /* Update count, check if we have executed enough methods */ + + Info->Count++; + if (Info->Count >= Info->MaxCount) + { + Status = AE_CTRL_TERMINATE; + } + + return (Status); } @@ -581,27 +589,37 @@ AcpiDbWalkForExecute ( * * FUNCTION: AcpiDbBatchExecute * - * PARAMETERS: None + * PARAMETERS: CountArg - Max number of methods to execute * * RETURN: None * - * DESCRIPTION: Namespace batch execution. + * DESCRIPTION: Namespace batch execution. Execute predefined names in the + * namespace, up to the max count, if specified. * ******************************************************************************/ void AcpiDbBatchExecute ( - void) + char *CountArg) { - UINT32 Count = 0; + ACPI_EXECUTE_WALK Info; + + + Info.Count = 0; + Info.MaxCount = ACPI_UINT32_MAX; + + if (CountArg) + { + Info.MaxCount = ACPI_STRTOUL (CountArg, NULL, 0); + } /* Search all nodes in namespace */ (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - AcpiDbWalkForExecute, (void *) &Count, NULL); + AcpiDbWalkForExecute, NULL, (void *) &Info, NULL); - AcpiOsPrintf ("Executed %d predefined names in the namespace\n", Count); + AcpiOsPrintf ("Executed %d predefined names in the namespace\n", Info.Count); } @@ -1143,15 +1161,13 @@ AcpiDbSetMethodData ( /* Create and initialize the new object */ - ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); + ObjDesc = AcpiUtCreateIntegerObject ((UINT64) Value); if (!ObjDesc) { AcpiOsPrintf ("Could not create an internal object\n"); return; } - ObjDesc->Integer.Value = Value; - /* Store the new object into the target */ switch (Type) @@ -1303,7 +1319,7 @@ AcpiDbDisplayObjects ( /* Walk the namespace from the root */ (void) AcpiWalkNamespace (Type, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - AcpiDbWalkForSpecificObjects, (void *) &Info, NULL); + AcpiDbWalkForSpecificObjects, NULL, (void *) &Info, NULL); AcpiOsPrintf ( "\nFound %u objects of type [%s] in the current ACPI Namespace\n", @@ -1419,7 +1435,7 @@ AcpiDbFindNameInNamespace ( /* Walk the namespace from the root */ (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - AcpiDbWalkAndMatchName, AcpiName, NULL); + AcpiDbWalkAndMatchName, NULL, AcpiName, NULL); AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT); return (AE_OK); @@ -1920,7 +1936,7 @@ AcpiDbCheckIntegrity ( /* Search all nodes in namespace */ (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - AcpiDbIntegrityWalk, (void *) &Info, NULL); + AcpiDbIntegrityWalk, NULL, (void *) &Info, NULL); AcpiOsPrintf ("Verified %d namespace nodes with %d Objects\n", Info.Nodes, Info.Objects); @@ -2107,7 +2123,7 @@ AcpiDbGetBusInfo ( /* Search all nodes in namespace */ (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - AcpiDbBusWalk, NULL, NULL); + AcpiDbBusWalk, NULL, NULL, NULL); } #endif /* ACPI_DEBUGGER */ diff --git a/src/add-ons/kernel/bus_managers/acpi/debugger/dbdisply.c b/src/add-ons/kernel/bus_managers/acpi/debugger/dbdisply.c index fbcb8f10d3..7c04ffca8b 100644 --- a/src/add-ons/kernel/bus_managers/acpi/debugger/dbdisply.c +++ b/src/add-ons/kernel/bus_managers/acpi/debugger/dbdisply.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/debugger/dbexec.c b/src/add-ons/kernel/bus_managers/acpi/debugger/dbexec.c index f6e20ce55c..da21a12589 100644 --- a/src/add-ons/kernel/bus_managers/acpi/debugger/dbexec.c +++ b/src/add-ons/kernel/bus_managers/acpi/debugger/dbexec.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -243,7 +243,7 @@ AcpiDbExecuteMethod ( default: Params[i].Type = ACPI_TYPE_INTEGER; - Params[i].Integer.Value = i * (ACPI_INTEGER) 0x1000; + Params[i].Integer.Value = i * (UINT64) 0x1000; break; } } @@ -453,7 +453,7 @@ AcpiDbExecute ( if (*Name == '*') { (void) AcpiWalkNamespace (ACPI_TYPE_METHOD, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, AcpiDbExecutionWalk, NULL, NULL); + ACPI_UINT32_MAX, AcpiDbExecutionWalk, NULL, NULL, NULL); return; } else @@ -484,7 +484,7 @@ AcpiDbExecute ( * Allow any handlers in separate threads to complete. * (Such as Notify handlers invoked from AML executed above). */ - AcpiOsSleep ((ACPI_INTEGER) 10); + AcpiOsSleep ((UINT64) 10); #ifdef ACPI_DEBUG_OUTPUT diff --git a/src/add-ons/kernel/bus_managers/acpi/debugger/dbfileio.c b/src/add-ons/kernel/bus_managers/acpi/debugger/dbfileio.c index d52a72caa6..c6f2e253ac 100644 --- a/src/add-ons/kernel/bus_managers/acpi/debugger/dbfileio.c +++ b/src/add-ons/kernel/bus_managers/acpi/debugger/dbfileio.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -150,9 +150,6 @@ AcpiDbCheckTextModeCorruption ( UINT32 TableLength, UINT32 FileLength); -static ACPI_STATUS -AeLocalLoadTable ( - ACPI_TABLE_HEADER *TablePtr); #endif /******************************************************************************* @@ -424,7 +421,7 @@ AcpiDbReadTable ( { /* Now validate the checksum */ - Status = AcpiTbChecksum ((void *) *Table, + Status = AcpiTbVerifyChecksum ((void *) *Table, ACPI_CAST_PTR (ACPI_TABLE_HEADER, *Table)->Length); if (Status == AE_BAD_CHECKSUM) diff --git a/src/add-ons/kernel/bus_managers/acpi/debugger/dbhistry.c b/src/add-ons/kernel/bus_managers/acpi/debugger/dbhistry.c index e8e8a76bf1..613711e0fd 100644 --- a/src/add-ons/kernel/bus_managers/acpi/debugger/dbhistry.c +++ b/src/add-ons/kernel/bus_managers/acpi/debugger/dbhistry.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/debugger/dbinput.c b/src/add-ons/kernel/bus_managers/acpi/debugger/dbinput.c index a64d547fdc..29b51b6d75 100644 --- a/src/add-ons/kernel/bus_managers/acpi/debugger/dbinput.c +++ b/src/add-ons/kernel/bus_managers/acpi/debugger/dbinput.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -644,7 +644,7 @@ AcpiDbCommandDispatch ( break; case CMD_BATCH: - AcpiDbBatchExecute (); + AcpiDbBatchExecute (AcpiGbl_DbArgs[1]); break; case CMD_BREAKPOINT: diff --git a/src/add-ons/kernel/bus_managers/acpi/debugger/dbstats.c b/src/add-ons/kernel/bus_managers/acpi/debugger/dbstats.c index f2f2f78f6a..ace8263734 100644 --- a/src/add-ons/kernel/bus_managers/acpi/debugger/dbstats.c +++ b/src/add-ons/kernel/bus_managers/acpi/debugger/dbstats.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -446,7 +446,7 @@ AcpiDbCountNamespaceObjects ( } (void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, FALSE, AcpiDbClassifyOneObject, NULL, NULL); + ACPI_UINT32_MAX, FALSE, AcpiDbClassifyOneObject, NULL, NULL, NULL); } diff --git a/src/add-ons/kernel/bus_managers/acpi/debugger/dbutils.c b/src/add-ons/kernel/bus_managers/acpi/debugger/dbutils.c index b49726369b..19ff3f02a2 100644 --- a/src/add-ons/kernel/bus_managers/acpi/debugger/dbutils.c +++ b/src/add-ons/kernel/bus_managers/acpi/debugger/dbutils.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -275,6 +275,10 @@ AcpiDbDumpExternalObject ( AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length); if (ObjDesc->Buffer.Length) { + if (ObjDesc->Buffer.Length > 16) + { + AcpiOsPrintf ("\n"); + } AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer), ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT); } diff --git a/src/add-ons/kernel/bus_managers/acpi/debugger/dbxface.c b/src/add-ons/kernel/bus_managers/acpi/debugger/dbxface.c index f3f7a44746..1c0557ac31 100644 --- a/src/add-ons/kernel/bus_managers/acpi/debugger/dbxface.c +++ b/src/add-ons/kernel/bus_managers/acpi/debugger/dbxface.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmbuffer.c b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmbuffer.c index 5a4d1742f3..b9222f9533 100644 --- a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmbuffer.c +++ b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmbuffer.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmnames.c b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmnames.c index b09d3d35f5..bdfa15ac9e 100644 --- a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmnames.c +++ b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmnames.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmobject.c b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmobject.c index 0f569922ad..6156caed59 100644 --- a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmobject.c +++ b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmobject.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmopcode.c b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmopcode.c index 931ef6c0db..bbc3a2d27f 100644 --- a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmopcode.c +++ b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmopcode.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -473,8 +473,8 @@ AcpiDmDisassembleOneOp ( case AML_QWORD_OP: - AcpiOsPrintf ("0x%8.8X%8.8X", Op->Common.Value.Integer64.Hi, - Op->Common.Value.Integer64.Lo); + AcpiOsPrintf ("0x%8.8X%8.8X", + ACPI_FORMAT_UINT64 (Op->Common.Value.Integer)); break; diff --git a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrc.c b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrc.c index f0fc4b1bd6..12bde688d4 100644 --- a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrc.c +++ b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrc.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrcl.c b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrcl.c index b1b86db2f3..d8a549b58c 100644 --- a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrcl.c +++ b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrcl.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrcs.c b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrcs.c index 50898527fb..6af288b1e8 100644 --- a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrcs.c +++ b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmresrcs.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmutils.c b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmutils.c index 75794b9f70..7eea82ed5f 100644 --- a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmutils.c +++ b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmutils.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -129,9 +129,6 @@ ACPI_MODULE_NAME ("dmutils") -ACPI_EXTERNAL_LIST *AcpiGbl_ExternalList = NULL; - - /* Data used in keeping track of fields */ #if 0 const char *AcpiGbl_FENames[] = @@ -202,121 +199,6 @@ const char *AcpiGbl_IrqDecode[] = }; -#ifdef ACPI_ASL_COMPILER -/******************************************************************************* - * - * FUNCTION: AcpiDmAddToExternalList - * - * PARAMETERS: Path - Internal (AML) path to the object - * - * RETURN: None - * - * DESCRIPTION: Insert a new path into the list of Externals which will in - * turn be emitted as an External() declaration in the disassembled - * output. - * - ******************************************************************************/ - -void -AcpiDmAddToExternalList ( - char *Path, - UINT8 Type, - UINT32 Value) -{ - char *ExternalPath; - ACPI_EXTERNAL_LIST *NewExternal; - ACPI_EXTERNAL_LIST *NextExternal; - ACPI_EXTERNAL_LIST *PrevExternal = NULL; - ACPI_STATUS Status; - - - if (!Path) - { - return; - } - - /* Externalize the ACPI path */ - - Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path, - NULL, &ExternalPath); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Ensure that we don't have duplicate externals */ - - NextExternal = AcpiGbl_ExternalList; - while (NextExternal) - { - /* Allow upgrade of type from ANY */ - - if (!ACPI_STRCMP (ExternalPath, NextExternal->Path)) - { - /* Duplicate method, check that the Value (ArgCount) is the same */ - - if ((NextExternal->Type == ACPI_TYPE_METHOD) && - (NextExternal->Value != Value)) - { - ACPI_ERROR ((AE_INFO, "Argument count mismatch for method %s %d %d", - NextExternal->Path, NextExternal->Value, Value)); - } - if (NextExternal->Type == ACPI_TYPE_ANY) - { - NextExternal->Type = Type; - NextExternal->Value = Value; - } - ACPI_FREE (ExternalPath); - return; - } - NextExternal = NextExternal->Next; - } - - /* Allocate and init a new External() descriptor */ - - NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST)); - NewExternal->InternalPath = Path; - NewExternal->Path = ExternalPath; - NewExternal->Type = Type; - NewExternal->Value = Value; - NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath); - - /* Link the new descriptor into the global list, ordered by string length */ - - NextExternal = AcpiGbl_ExternalList; - while (NextExternal) - { - if (NewExternal->Length <= NextExternal->Length) - { - if (PrevExternal) - { - PrevExternal->Next = NewExternal; - } - else - { - AcpiGbl_ExternalList = NewExternal; - } - - NewExternal->Next = NextExternal; - return; - } - - PrevExternal = NextExternal; - NextExternal = NextExternal->Next; - } - - if (PrevExternal) - { - PrevExternal->Next = NewExternal; - } - else - { - AcpiGbl_ExternalList = NewExternal; - } -} -#endif - - /******************************************************************************* * * FUNCTION: AcpiDmDecodeAttribute diff --git a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmwalk.c b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmwalk.c index 156e2dd5b1..f460e6ac3f 100644 --- a/src/add-ons/kernel/bus_managers/acpi/disassembler/dmwalk.c +++ b/src/add-ons/kernel/bus_managers/acpi/disassembler/dmwalk.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -130,6 +130,17 @@ #define DB_FULL_OP_INFO "[%4.4s] @%5.5X #%4.4X: " +/* Stub for non-compiler code */ + +#ifndef ACPI_ASL_COMPILER +void +AcpiDmEmitExternals ( + void) +{ + return; +} +#endif + /* Local prototypes */ static ACPI_STATUS @@ -148,69 +159,6 @@ static UINT32 AcpiDmBlockType ( ACPI_PARSE_OBJECT *Op); -static const char * -AcpiDmGetObjectTypeName ( - ACPI_OBJECT_TYPE Type); - -/* - * This table maps ACPI_OBJECT_TYPEs to the corresponding ASL - * ObjectTypeKeyword. Used to generate typed external declarations - */ -static const char *AcpiGbl_DmTypeNames[] = -{ - /* 00 */ "", /* Type ANY */ - /* 01 */ ", IntObj", - /* 02 */ ", StrObj", - /* 03 */ ", BuffObj", - /* 04 */ ", PkgObj", - /* 05 */ ", FieldUnitObj", - /* 06 */ ", DeviceObj", - /* 07 */ ", EventObj", - /* 08 */ ", MethodObj", - /* 09 */ ", MutexObj", - /* 10 */ ", OpRegionObj", - /* 11 */ ", PowerResObj", - /* 12 */ ", ProcessorObj", - /* 13 */ ", ThermalZoneObj", - /* 14 */ ", BuffFieldObj", - /* 15 */ ", DDBHandleObj", - /* 16 */ "", /* Debug object */ - /* 17 */ ", FieldUnitObj", - /* 18 */ ", FieldUnitObj", - /* 19 */ ", FieldUnitObj" -}; - - -/******************************************************************************* - * - * FUNCTION: AcpiDmGetObjectTypeName - * - * PARAMETERS: Type - An ACPI_OBJECT_TYPE - * - * RETURN: Pointer to a string - * - * DESCRIPTION: Map an object type to the ASL object type string. - * - ******************************************************************************/ - -static const char * -AcpiDmGetObjectTypeName ( - ACPI_OBJECT_TYPE Type) -{ - - if (Type == ACPI_TYPE_LOCAL_SCOPE) - { - Type = ACPI_TYPE_DEVICE; - } - - else if (Type > ACPI_TYPE_LOCAL_INDEX_FIELD) - { - return (""); - } - - return (AcpiGbl_DmTypeNames[Type]); -} - /******************************************************************************* * @@ -522,7 +470,6 @@ AcpiDmDescendingOp ( const ACPI_OPCODE_INFO *OpInfo; UINT32 Name; ACPI_PARSE_OBJECT *NextOp; - ACPI_EXTERNAL_LIST *NextExternal; if (Op->Common.DisasmFlags & ACPI_PARSEOP_IGNORE) @@ -554,35 +501,7 @@ AcpiDmDescendingOp ( /* Emit all External() declarations here */ - if (AcpiGbl_ExternalList) - { - /* - * Walk the list of externals (unresolved references) - * found during parsing - */ - while (AcpiGbl_ExternalList) - { - AcpiOsPrintf (" External (%s%s", - AcpiGbl_ExternalList->Path, - AcpiDmGetObjectTypeName (AcpiGbl_ExternalList->Type)); - - if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD) - { - AcpiOsPrintf (") // %d Arguments\n", AcpiGbl_ExternalList->Value); - } - else - { - AcpiOsPrintf (")\n"); - } - - NextExternal = AcpiGbl_ExternalList->Next; - ACPI_FREE (AcpiGbl_ExternalList->Path); - ACPI_FREE (AcpiGbl_ExternalList); - AcpiGbl_ExternalList = NextExternal; - } - AcpiOsPrintf ("\n"); - } - + AcpiDmEmitExternals (); return (AE_OK); } } diff --git a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsfield.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsfield.c index 12d55f40c4..8453c88087 100644 --- a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsfield.c +++ b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsfield.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -314,7 +314,7 @@ AcpiDsGetFieldNames ( ACPI_PARSE_OBJECT *Arg) { ACPI_STATUS Status; - ACPI_INTEGER Position; + UINT64 Position; ACPI_FUNCTION_TRACE_PTR (DsGetFieldNames, Info); @@ -338,8 +338,8 @@ AcpiDsGetFieldNames ( { case AML_INT_RESERVEDFIELD_OP: - Position = (ACPI_INTEGER) Info->FieldBitPosition - + (ACPI_INTEGER) Arg->Common.Value.Size; + Position = (UINT64) Info->FieldBitPosition + + (UINT64) Arg->Common.Value.Size; if (Position > ACPI_UINT32_MAX) { @@ -406,8 +406,8 @@ AcpiDsGetFieldNames ( /* Keep track of bit position for the next field */ - Position = (ACPI_INTEGER) Info->FieldBitPosition - + (ACPI_INTEGER) Arg->Common.Value.Size; + Position = (UINT64) Info->FieldBitPosition + + (UINT64) Arg->Common.Value.Size; if (Position > ACPI_UINT32_MAX) { diff --git a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsinit.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsinit.c index af29476410..4525a0bc4f 100644 --- a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsinit.c +++ b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsinit.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -283,7 +283,7 @@ AcpiDsInitializeObjects ( * the namespace reader lock. */ Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, StartNode, ACPI_UINT32_MAX, - ACPI_NS_WALK_UNLOCK, AcpiDsInitOneObject, &Info, NULL); + ACPI_NS_WALK_UNLOCK, AcpiDsInitOneObject, NULL, &Info, NULL); if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace")); diff --git a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsmethod.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsmethod.c index 1766fc353d..29153b0754 100644 --- a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsmethod.c +++ b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsmethod.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -519,7 +519,7 @@ AcpiDsCallControlMethod ( if (ObjDesc->Method.MethodFlags & AML_METHOD_INTERNAL_ONLY) { - Status = ObjDesc->Method.Implementation (NextWalkState); + Status = ObjDesc->Method.Extra.Implementation (NextWalkState); if (Status == AE_OK) { Status = AE_CTRL_TERMINATE; diff --git a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsmthdat.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsmthdat.c index 43777ab80f..128308286c 100644 --- a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsmthdat.c +++ b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsmthdat.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -524,13 +524,12 @@ AcpiDsMethodDataGetValue ( if (AcpiGbl_EnableInterpreterSlack) { - Object = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); + Object = AcpiUtCreateIntegerObject ((UINT64) 0); if (!Object) { return_ACPI_STATUS (AE_NO_MEMORY); } - Object->Integer.Value = 0; Node->Object = Object; } diff --git a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsobject.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsobject.c index 57e78c1b33..2796f66c70 100644 --- a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsobject.c +++ b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsobject.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -574,7 +574,7 @@ AcpiDsBuildInternalPackageObj ( * * Note: technically, this is an error, from ACPI spec: "It is an error * for NumElements to be less than the number of elements in the - * PackageList". However, we just print an error message and + * PackageList". However, we just print a message and * no exception is returned. This provides Windows compatibility. Some * BIOSs will alter the NumElements on the fly, creating this type * of ill-formed package object. @@ -598,8 +598,8 @@ AcpiDsBuildInternalPackageObj ( Arg = Arg->Common.Next; } - ACPI_ERROR ((AE_INFO, - "Package List length (0x%X) larger than NumElements count (0x%X), truncated\n", + ACPI_INFO ((AE_INFO, + "Actual Package length (0x%X) is larger than NumElements field (0x%X), truncated\n", i, ElementCount)); } else if (i < ElementCount) @@ -787,7 +787,7 @@ AcpiDsInitObjectFromOp ( case AML_ONES_OP: - ObjDesc->Integer.Value = ACPI_INTEGER_MAX; + ObjDesc->Integer.Value = ACPI_UINT64_MAX; /* Truncate value if we are executing from a 32-bit ACPI table */ diff --git a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsopcode.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsopcode.c index 3edbacc1d9..328a350092 100644 --- a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsopcode.c +++ b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsopcode.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsutils.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsutils.c index 6c211ace8c..8eb8b3dbbd 100644 --- a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsutils.c +++ b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dsutils.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswexec.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswexec.c index 9485c62bb1..d4b3f0c928 100644 --- a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswexec.c +++ b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswexec.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswload.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswload.c index 2c067f14d9..1a02f9f1c8 100644 --- a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswload.c +++ b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswload.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -263,7 +263,7 @@ AcpiDsLoad1BeginOp ( * Target of Scope() not found. Generate an External for it, and * insert the name into the namespace. */ - AcpiDmAddToExternalList (Path, ACPI_TYPE_DEVICE, 0); + AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_DEVICE, 0); Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType, ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, WalkState, &Node); @@ -296,18 +296,19 @@ AcpiDsLoad1BeginOp ( case ACPI_TYPE_BUFFER: /* - * These types we will allow, but we will change the type. This - * enables some existing code of the form: + * These types we will allow, but we will change the type. + * This enables some existing code of the form: * * Name (DEB, 0) * Scope (DEB) { ... } * - * Note: silently change the type here. On the second pass, we will report - * a warning + * Note: silently change the type here. On the second pass, + * we will report a warning */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)\n", - Path, AcpiUtGetTypeName (Node->Type))); + "Type override - [%4.4s] had invalid type (%s) " + "for Scope operator, changed to type ANY\n", + AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type))); Node->Type = ACPI_TYPE_ANY; WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY; @@ -318,8 +319,9 @@ AcpiDsLoad1BeginOp ( /* All other types are an error */ ACPI_ERROR ((AE_INFO, - "Invalid type (%s) for target of Scope operator [%4.4s] (Cannot override)", - AcpiUtGetTypeName (Node->Type), Path)); + "Invalid type (%s) for target of " + "Scope operator [%4.4s] (Cannot override)", + AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -732,29 +734,45 @@ AcpiDsLoad2BeginOp ( break; case AML_SCOPE_OP: - /* - * The Path is an object reference to an existing object. - * Don't enter the name into the namespace, but look it up - * for use later. - */ - Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType, + + /* Special case for Scope(\) -> refers to the Root node */ + + if (Op && (Op->Named.Node == AcpiGbl_RootNode)) + { + Node = Op->Named.Node; + + Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } + else + { + /* + * The Path is an object reference to an existing object. + * Don't enter the name into the namespace, but look it up + * for use later. + */ + Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState, &(Node)); - if (ACPI_FAILURE (Status)) - { + if (ACPI_FAILURE (Status)) + { #ifdef ACPI_ASL_COMPILER - if (Status == AE_NOT_FOUND) - { - Status = AE_OK; - } - else - { - ACPI_ERROR_NAMESPACE (BufferPtr, Status); - } + if (Status == AE_NOT_FOUND) + { + Status = AE_OK; + } + else + { + ACPI_ERROR_NAMESPACE (BufferPtr, Status); + } #else - ACPI_ERROR_NAMESPACE (BufferPtr, Status); + ACPI_ERROR_NAMESPACE (BufferPtr, Status); #endif - return_ACPI_STATUS (Status); + return_ACPI_STATUS (Status); + } } /* @@ -778,15 +796,16 @@ AcpiDsLoad2BeginOp ( case ACPI_TYPE_BUFFER: /* - * These types we will allow, but we will change the type. This - * enables some existing code of the form: + * These types we will allow, but we will change the type. + * This enables some existing code of the form: * * Name (DEB, 0) * Scope (DEB) { ... } */ ACPI_WARNING ((AE_INFO, - "Type override - [%4.4s] had invalid type (%s) for Scope operator, changed to (Scope)", - BufferPtr, AcpiUtGetTypeName (Node->Type))); + "Type override - [%4.4s] had invalid type (%s) " + "for Scope operator, changed to type ANY\n", + AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type))); Node->Type = ACPI_TYPE_ANY; WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY; @@ -797,8 +816,9 @@ AcpiDsLoad2BeginOp ( /* All other types are an error */ ACPI_ERROR ((AE_INFO, - "Invalid type (%s) for target of Scope operator [%4.4s]", - AcpiUtGetTypeName (Node->Type), BufferPtr)); + "Invalid type (%s) for target of " + "Scope operator [%4.4s] (Cannot override)", + AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node))); return (AE_AML_OPERAND_TYPE); } @@ -1138,33 +1158,40 @@ AcpiDsLoad2EndOp ( } /* - * If we are executing a method, initialize the region + * The OpRegion is not fully parsed at this time. The only valid + * argument is the SpaceId. (We must save the address of the + * AML of the address and length operands) + * + * If we have a valid region, initialize it. The namespace is + * unlocked at this point. + * + * Need to unlock interpreter if it is locked (if we are running + * a control method), in order to allow _REG methods to be run + * during AcpiEvInitializeRegion. */ if (WalkState->MethodNode) { + /* + * Executing a method: initialize the region and unlock + * the interpreter + */ Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length, RegionSpace, WalkState); if (ACPI_FAILURE (Status)) { return (Status); } + + AcpiExExitInterpreter (); } - /* - * The OpRegion is not fully parsed at this time. Only valid - * argument is the SpaceId. (We must save the address of the - * AML of the address and length operands) - */ - - /* - * If we have a valid region, initialize it - * Namespace is NOT locked at this point. - * - * TBD: need to unlock interpreter if it is locked, in order - * to allow _REG methods to be run. - */ Status = AcpiEvInitializeRegion (AcpiNsGetAttachedObject (Node), FALSE); + if (WalkState->MethodNode) + { + AcpiExEnterInterpreter (); + } + if (ACPI_FAILURE (Status)) { /* diff --git a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswscope.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswscope.c index 023f9ef666..5ab611ec67 100644 --- a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswscope.c +++ b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswscope.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswstate.c b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswstate.c index f0962bf53f..ffe2895fa8 100644 --- a/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswstate.c +++ b/src/add-ons/kernel/bus_managers/acpi/dispatcher/dswstate.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/events/evevent.c b/src/add-ons/kernel/bus_managers/acpi/events/evevent.c index 16f40271fc..05cc4cd8b7 100644 --- a/src/add-ons/kernel/bus_managers/acpi/events/evevent.c +++ b/src/add-ons/kernel/bus_managers/acpi/events/evevent.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/events/evgpe.c b/src/add-ons/kernel/bus_managers/acpi/events/evgpe.c index 17738b3840..de1f861d5d 100644 --- a/src/add-ons/kernel/bus_managers/acpi/events/evgpe.c +++ b/src/add-ons/kernel/bus_managers/acpi/events/evgpe.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/events/evgpeblk.c b/src/add-ons/kernel/bus_managers/acpi/events/evgpeblk.c index 343a31d28e..10f48a5d91 100644 --- a/src/add-ons/kernel/bus_managers/acpi/events/evgpeblk.c +++ b/src/add-ons/kernel/bus_managers/acpi/events/evgpeblk.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -1110,7 +1110,7 @@ AcpiEvCreateGpeBlock ( Status = AcpiNsWalkNamespace (ACPI_TYPE_METHOD, GpeDevice, ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK, - AcpiEvSaveMethodInfo, GpeBlock, NULL); + AcpiEvSaveMethodInfo, NULL, GpeBlock, NULL); /* Return the new block */ @@ -1192,7 +1192,7 @@ AcpiEvInitializeGpeBlock ( Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK, - AcpiEvMatchPrwAndGpe, &GpeInfo, NULL); + AcpiEvMatchPrwAndGpe, NULL, &GpeInfo, NULL); } /* diff --git a/src/add-ons/kernel/bus_managers/acpi/events/evmisc.c b/src/add-ons/kernel/bus_managers/acpi/events/evmisc.c index 1e7f9e1cb5..62f549d1ca 100644 --- a/src/add-ons/kernel/bus_managers/acpi/events/evmisc.c +++ b/src/add-ons/kernel/bus_managers/acpi/events/evmisc.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/events/evregion.c b/src/add-ons/kernel/bus_managers/acpi/events/evregion.c index 32d7b642f9..f3e10bec8b 100644 --- a/src/add-ons/kernel/bus_managers/acpi/events/evregion.c +++ b/src/add-ons/kernel/bus_managers/acpi/events/evregion.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -128,6 +128,11 @@ /* Local prototypes */ +static BOOLEAN +AcpiEvHasDefaultHandler ( + ACPI_NAMESPACE_NODE *Node, + ACPI_ADR_SPACE_TYPE SpaceId); + static ACPI_STATUS AcpiEvRegRun ( ACPI_HANDLE ObjHandle, @@ -231,6 +236,57 @@ UnlockAndExit: } +/******************************************************************************* + * + * FUNCTION: AcpiEvHasDefaultHandler + * + * PARAMETERS: Node - Namespace node for the device + * SpaceId - The address space ID + * + * RETURN: TRUE if default handler is installed, FALSE otherwise + * + * DESCRIPTION: Check if the default handler is installed for the requested + * space ID. + * + ******************************************************************************/ + +static BOOLEAN +AcpiEvHasDefaultHandler ( + ACPI_NAMESPACE_NODE *Node, + ACPI_ADR_SPACE_TYPE SpaceId) +{ + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_OPERAND_OBJECT *HandlerObj; + + + /* Must have an existing internal object */ + + ObjDesc = AcpiNsGetAttachedObject (Node); + if (ObjDesc) + { + HandlerObj = ObjDesc->Device.Handler; + + /* Walk the linked list of handlers for this object */ + + while (HandlerObj) + { + if (HandlerObj->AddressSpace.SpaceId == SpaceId) + { + if (HandlerObj->AddressSpace.HandlerFlags & + ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) + { + return (TRUE); + } + } + + HandlerObj = HandlerObj->AddressSpace.Next; + } + } + + return (FALSE); +} + + /******************************************************************************* * * FUNCTION: AcpiEvInitializeOpRegions @@ -266,11 +322,16 @@ AcpiEvInitializeOpRegions ( for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++) { /* - * TBD: Make sure handler is the DEFAULT handler, otherwise - * _REG will have already been run. + * Make sure the installed handler is the DEFAULT handler. If not the + * default, the _REG methods will have already been run (when the + * handler was installed) */ - Status = AcpiEvExecuteRegMethods (AcpiGbl_RootNode, - AcpiGbl_DefaultAddressSpaces[i]); + if (AcpiEvHasDefaultHandler (AcpiGbl_RootNode, + AcpiGbl_DefaultAddressSpaces[i])) + { + Status = AcpiEvExecuteRegMethods (AcpiGbl_RootNode, + AcpiGbl_DefaultAddressSpaces[i]); + } } (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); @@ -339,25 +400,21 @@ AcpiEvExecuteRegMethod ( * connection status 1 for connecting the handler, 0 for disconnecting * the handler (Passed as a parameter) */ - Args[0] = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); + Args[0] = AcpiUtCreateIntegerObject ((UINT64) RegionObj->Region.SpaceId); if (!Args[0]) { Status = AE_NO_MEMORY; goto Cleanup1; } - Args[1] = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); + Args[1] = AcpiUtCreateIntegerObject ((UINT64) Function); if (!Args[1]) { Status = AE_NO_MEMORY; goto Cleanup2; } - /* Setup the parameter objects */ - - Args[0]->Integer.Value = RegionObj->Region.SpaceId; - Args[1]->Integer.Value = Function; - Args[2] = NULL; + Args[2] = NULL; /* Terminate list */ /* Execute the method, no return value */ @@ -385,7 +442,7 @@ Cleanup1: * RegionOffset - Where in the region to read or write * BitWidth - Field width in bits (8, 16, 32, or 64) * Value - Pointer to in or out value, must be - * full 64-bit ACPI_INTEGER + * a full 64-bit integer * * RETURN: Status * @@ -400,7 +457,7 @@ AcpiEvAddressSpaceDispatch ( UINT32 Function, UINT32 RegionOffset, UINT32 BitWidth, - ACPI_INTEGER *Value) + UINT64 *Value) { ACPI_STATUS Status; ACPI_ADR_SPACE_HANDLER Handler; @@ -788,7 +845,7 @@ AcpiEvInstallHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { return (AE_BAD_PARAMETER); @@ -1112,7 +1169,7 @@ AcpiEvInstallSpaceHandler ( * of the branch */ Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX, - ACPI_NS_WALK_UNLOCK, AcpiEvInstallHandler, + ACPI_NS_WALK_UNLOCK, AcpiEvInstallHandler, NULL, HandlerObj, NULL); UnlockAndExit: @@ -1152,7 +1209,7 @@ AcpiEvExecuteRegMethods ( * regions of this Space ID before we can run any _REG methods) */ Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX, - ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, + ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL, &SpaceId, NULL); return_ACPI_STATUS (Status); @@ -1186,7 +1243,7 @@ AcpiEvRegRun ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { return (AE_BAD_PARAMETER); diff --git a/src/add-ons/kernel/bus_managers/acpi/events/evrgnini.c b/src/add-ons/kernel/bus_managers/acpi/events/evrgnini.c index 9c45ee84f0..8a6cbfd941 100644 --- a/src/add-ons/kernel/bus_managers/acpi/events/evrgnini.c +++ b/src/add-ons/kernel/bus_managers/acpi/events/evrgnini.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -260,7 +260,7 @@ AcpiEvPciConfigRegionSetup ( void **RegionContext) { ACPI_STATUS Status = AE_OK; - ACPI_INTEGER PciValue; + UINT64 PciValue; ACPI_PCI_ID *PciId = *RegionContext; ACPI_OPERAND_OBJECT *HandlerObj; ACPI_NAMESPACE_NODE *ParentNode; @@ -716,6 +716,20 @@ AcpiEvInitializeRegion ( HandlerObj = ObjDesc->ThermalZone.Handler; break; + case ACPI_TYPE_METHOD: + /* + * If we are executing module level code, the original + * Node's object was replaced by this Method object and we + * saved the handler in the method object. + * + * See AcpiNsExecModuleCode + */ + if (ObjDesc->Method.Flags & AOPOBJ_MODULE_LEVEL) + { + HandlerObj = ObjDesc->Method.Extra.Handler; + } + break; + default: /* Ignore other objects */ break; diff --git a/src/add-ons/kernel/bus_managers/acpi/events/evsci.c b/src/add-ons/kernel/bus_managers/acpi/events/evsci.c index cde433ce3e..ec622d4f82 100644 --- a/src/add-ons/kernel/bus_managers/acpi/events/evsci.c +++ b/src/add-ons/kernel/bus_managers/acpi/events/evsci.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/events/evxface.c b/src/add-ons/kernel/bus_managers/acpi/events/evxface.c index f816abad3a..3ca00215e8 100644 --- a/src/add-ons/kernel/bus_managers/acpi/events/evxface.c +++ b/src/add-ons/kernel/bus_managers/acpi/events/evxface.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -368,7 +368,7 @@ AcpiInstallNotifyHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node) { Status = AE_BAD_PARAMETER; @@ -555,7 +555,7 @@ AcpiRemoveNotifyHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node) { Status = AE_BAD_PARAMETER; diff --git a/src/add-ons/kernel/bus_managers/acpi/events/evxfevnt.c b/src/add-ons/kernel/bus_managers/acpi/events/evxfevnt.c index bc24f18c51..886096153c 100644 --- a/src/add-ons/kernel/bus_managers/acpi/events/evxfevnt.c +++ b/src/add-ons/kernel/bus_managers/acpi/events/evxfevnt.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -805,7 +805,7 @@ AcpiInstallGpeBlock ( return (Status); } - Node = AcpiNsMapHandleToNode (GpeDevice); + Node = AcpiNsValidateHandle (GpeDevice); if (!Node) { Status = AE_BAD_PARAMETER; @@ -905,7 +905,7 @@ AcpiRemoveGpeBlock ( return (Status); } - Node = AcpiNsMapHandleToNode (GpeDevice); + Node = AcpiNsValidateHandle (GpeDevice); if (!Node) { Status = AE_BAD_PARAMETER; diff --git a/src/add-ons/kernel/bus_managers/acpi/events/evxfregn.c b/src/add-ons/kernel/bus_managers/acpi/events/evxfregn.c index d4f499130a..365174fb68 100644 --- a/src/add-ons/kernel/bus_managers/acpi/events/evxfregn.c +++ b/src/add-ons/kernel/bus_managers/acpi/events/evxfregn.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -171,7 +171,7 @@ AcpiInstallAddressSpaceHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node) { Status = AE_BAD_PARAMETER; @@ -244,7 +244,7 @@ AcpiRemoveAddressSpaceHandler ( /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node || ((Node->Type != ACPI_TYPE_DEVICE) && (Node->Type != ACPI_TYPE_PROCESSOR) && diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exconfig.c b/src/add-ons/kernel/bus_managers/acpi/executer/exconfig.c index 8c08165251..034afb65c3 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exconfig.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exconfig.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -263,15 +263,13 @@ AcpiExLoadTableOp ( /* Table not found, return an Integer=0 and AE_OK */ - DdbHandle = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); + DdbHandle = AcpiUtCreateIntegerObject ((UINT64) 0); if (!DdbHandle) { return_ACPI_STATUS (AE_NO_MEMORY); } - DdbHandle->Integer.Value = 0; *ReturnDesc = DdbHandle; - return_ACPI_STATUS (AE_OK); } @@ -389,7 +387,7 @@ AcpiExRegionRead ( UINT8 *Buffer) { ACPI_STATUS Status; - ACPI_INTEGER Value; + UINT64 Value; UINT32 RegionOffset = 0; UINT32 i; @@ -612,7 +610,10 @@ AcpiExLoadOp ( Status = AcpiTbAddTable (&TableDesc, &TableIndex); if (ACPI_FAILURE (Status)) { - goto Cleanup; + /* Delete allocated table buffer */ + + AcpiTbDeleteTable (&TableDesc); + return_ACPI_STATUS (Status); } /* @@ -655,13 +656,6 @@ AcpiExLoadOp ( AcpiGbl_TableHandlerContext); } -Cleanup: - if (ACPI_FAILURE (Status)) - { - /* Delete allocated table buffer */ - - AcpiTbDeleteTable (&TableDesc); - } return_ACPI_STATUS (Status); } diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exconvrt.c b/src/add-ons/kernel/bus_managers/acpi/executer/exconvrt.c index e7d8530329..2e154d1202 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exconvrt.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exconvrt.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -129,7 +129,7 @@ static UINT32 AcpiExConvertToAscii ( - ACPI_INTEGER Integer, + UINT64 Integer, UINT16 Base, UINT8 *String, UINT8 MaxLength); @@ -158,7 +158,7 @@ AcpiExConvertToInteger ( { ACPI_OPERAND_OBJECT *ReturnDesc; UINT8 *Pointer; - ACPI_INTEGER Result; + UINT64 Result; UINT32 i; UINT32 Count; ACPI_STATUS Status; @@ -247,7 +247,7 @@ AcpiExConvertToInteger ( * Little endian is used, meaning that the first byte of the buffer * is the LSB of the integer */ - Result |= (((ACPI_INTEGER) Pointer[i]) << (i * 8)); + Result |= (((UINT64) Pointer[i]) << (i * 8)); } break; @@ -260,7 +260,7 @@ AcpiExConvertToInteger ( /* Create a new integer */ - ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); + ReturnDesc = AcpiUtCreateIntegerObject (Result); if (!ReturnDesc) { return_ACPI_STATUS (AE_NO_MEMORY); @@ -271,7 +271,6 @@ AcpiExConvertToInteger ( /* Save the Result */ - ReturnDesc->Integer.Value = Result; AcpiExTruncateFor32bitTable (ReturnDesc); *ResultDesc = ReturnDesc; return_ACPI_STATUS (AE_OK); @@ -390,12 +389,12 @@ AcpiExConvertToBuffer ( static UINT32 AcpiExConvertToAscii ( - ACPI_INTEGER Integer, + UINT64 Integer, UINT16 Base, UINT8 *String, UINT8 DataWidth) { - ACPI_INTEGER Digit; + UINT64 Digit; UINT32 i; UINT32 j; UINT32 k = 0; @@ -660,7 +659,7 @@ AcpiExConvertToString ( for (i = 0; i < ObjDesc->Buffer.Length; i++) { NewBuf += AcpiExConvertToAscii ( - (ACPI_INTEGER) ObjDesc->Buffer.Pointer[i], Base, + (UINT64) ObjDesc->Buffer.Pointer[i], Base, NewBuf, 1); *NewBuf++ = Separator; /* each separated by a comma or space */ } diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/excreate.c b/src/add-ons/kernel/bus_managers/acpi/executer/excreate.c index e5463187a8..728603e49c 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/excreate.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/excreate.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exdump.c b/src/add-ons/kernel/bus_managers/acpi/executer/exdump.c index 5de5a6f6e4..5ef9fe83c7 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exdump.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exdump.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exfield.c b/src/add-ons/kernel/bus_managers/acpi/executer/exfield.c index 0ee522c572..5657ea8847 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exfield.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exfield.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -217,7 +217,7 @@ AcpiExReadDataFromField ( /* Call the region handler for the read */ Status = AcpiExAccessRegion (ObjDesc, 0, - ACPI_CAST_PTR (ACPI_INTEGER, BufferDesc->Buffer.Pointer), + ACPI_CAST_PTR (UINT64, BufferDesc->Buffer.Pointer), Function); AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags); goto Exit; @@ -226,7 +226,7 @@ AcpiExReadDataFromField ( /* * Allocate a buffer for the contents of the field. * - * If the field is larger than the size of an ACPI_INTEGER, create + * If the field is larger than the current integer width, create * a BUFFER to hold it. Otherwise, use an INTEGER. This allows * the use of arithmetic operators on the returned value if the * field size is equal or smaller than an Integer. @@ -249,14 +249,13 @@ AcpiExReadDataFromField ( { /* Field will fit within an Integer (normal case) */ - BufferDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); + BufferDesc = AcpiUtCreateIntegerObject ((UINT64) 0); if (!BufferDesc) { return_ACPI_STATUS (AE_NO_MEMORY); } Length = AcpiGbl_IntegerByteWidth; - BufferDesc->Integer.Value = 0; Buffer = &BufferDesc->Integer.Value; } @@ -409,7 +408,7 @@ AcpiExWriteDataToField ( * same buffer) */ Status = AcpiExAccessRegion (ObjDesc, 0, - (ACPI_INTEGER *) Buffer, Function); + (UINT64 *) Buffer, Function); AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags); *ResultDesc = BufferDesc; diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exfldio.c b/src/add-ons/kernel/bus_managers/acpi/executer/exfldio.c index 37a6786551..403cb06944 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exfldio.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exfldio.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -133,13 +133,13 @@ static ACPI_STATUS AcpiExFieldDatumIo ( ACPI_OPERAND_OBJECT *ObjDesc, UINT32 FieldDatumByteOffset, - ACPI_INTEGER *Value, + UINT64 *Value, UINT32 ReadWrite); static BOOLEAN AcpiExRegisterOverflow ( ACPI_OPERAND_OBJECT *ObjDesc, - ACPI_INTEGER Value); + UINT64 Value); static ACPI_STATUS AcpiExSetupRegion ( @@ -296,7 +296,7 @@ AcpiExSetupRegion ( * FieldDatumByteOffset - Byte offset of this datum within the * parent field * Value - Where to store value (must at least - * the size of ACPI_INTEGER) + * 64 bits) * Function - Read or Write flag plus other region- * dependent flags * @@ -310,7 +310,7 @@ ACPI_STATUS AcpiExAccessRegion ( ACPI_OPERAND_OBJECT *ObjDesc, UINT32 FieldDatumByteOffset, - ACPI_INTEGER *Value, + UINT64 *Value, UINT32 Function) { ACPI_STATUS Status; @@ -408,7 +408,7 @@ AcpiExAccessRegion ( static BOOLEAN AcpiExRegisterOverflow ( ACPI_OPERAND_OBJECT *ObjDesc, - ACPI_INTEGER Value) + UINT64 Value) { if (ObjDesc->CommonField.BitLength >= ACPI_INTEGER_BIT_SIZE) @@ -420,7 +420,7 @@ AcpiExRegisterOverflow ( return (FALSE); } - if (Value >= ((ACPI_INTEGER) 1 << ObjDesc->CommonField.BitLength)) + if (Value >= ((UINT64) 1 << ObjDesc->CommonField.BitLength)) { /* * The Value is larger than the maximum value that can fit into @@ -457,11 +457,11 @@ static ACPI_STATUS AcpiExFieldDatumIo ( ACPI_OPERAND_OBJECT *ObjDesc, UINT32 FieldDatumByteOffset, - ACPI_INTEGER *Value, + UINT64 *Value, UINT32 ReadWrite) { ACPI_STATUS Status; - ACPI_INTEGER LocalValue; + UINT64 LocalValue; ACPI_FUNCTION_TRACE_U32 (ExFieldDatumIo, FieldDatumByteOffset); @@ -543,7 +543,7 @@ AcpiExFieldDatumIo ( * the register */ if (AcpiExRegisterOverflow (ObjDesc->BankField.BankObj, - (ACPI_INTEGER) ObjDesc->BankField.Value)) + (UINT64) ObjDesc->BankField.Value)) { return_ACPI_STATUS (AE_AML_REGISTER_LIMIT); } @@ -586,7 +586,7 @@ AcpiExFieldDatumIo ( * the register */ if (AcpiExRegisterOverflow (ObjDesc->IndexField.IndexObj, - (ACPI_INTEGER) ObjDesc->IndexField.Value)) + (UINT64) ObjDesc->IndexField.Value)) { return_ACPI_STATUS (AE_AML_REGISTER_LIMIT); } @@ -615,7 +615,7 @@ AcpiExFieldDatumIo ( "Read from Data Register\n")); Status = AcpiExExtractFromField (ObjDesc->IndexField.DataObj, - Value, sizeof (ACPI_INTEGER)); + Value, sizeof (UINT64)); } else { @@ -626,7 +626,7 @@ AcpiExFieldDatumIo ( ACPI_FORMAT_UINT64 (*Value))); Status = AcpiExInsertIntoField (ObjDesc->IndexField.DataObj, - Value, sizeof (ACPI_INTEGER)); + Value, sizeof (UINT64)); } break; @@ -679,13 +679,13 @@ AcpiExFieldDatumIo ( ACPI_STATUS AcpiExWriteWithUpdateRule ( ACPI_OPERAND_OBJECT *ObjDesc, - ACPI_INTEGER Mask, - ACPI_INTEGER FieldValue, + UINT64 Mask, + UINT64 FieldValue, UINT32 FieldDatumByteOffset) { ACPI_STATUS Status = AE_OK; - ACPI_INTEGER MergedValue; - ACPI_INTEGER CurrentValue; + UINT64 MergedValue; + UINT64 CurrentValue; ACPI_FUNCTION_TRACE_U32 (ExWriteWithUpdateRule, Mask); @@ -697,7 +697,7 @@ AcpiExWriteWithUpdateRule ( /* If the mask is all ones, we don't need to worry about the update rule */ - if (Mask != ACPI_INTEGER_MAX) + if (Mask != ACPI_UINT64_MAX) { /* Decode the update rule */ @@ -787,8 +787,8 @@ AcpiExExtractFromField ( UINT32 BufferLength) { ACPI_STATUS Status; - ACPI_INTEGER RawDatum; - ACPI_INTEGER MergedDatum; + UINT64 RawDatum; + UINT64 MergedDatum; UINT32 FieldOffset = 0; UINT32 BufferOffset = 0; UINT32 BufferTailBits; @@ -917,10 +917,10 @@ AcpiExInsertIntoField ( UINT32 BufferLength) { ACPI_STATUS Status; - ACPI_INTEGER Mask; - ACPI_INTEGER WidthMask; - ACPI_INTEGER MergedDatum; - ACPI_INTEGER RawDatum = 0; + UINT64 Mask; + UINT64 WidthMask; + UINT64 MergedDatum; + UINT64 RawDatum = 0; UINT32 FieldOffset = 0; UINT32 BufferOffset = 0; UINT32 BufferTailBits; @@ -972,7 +972,7 @@ AcpiExInsertIntoField ( */ if (ObjDesc->CommonField.AccessBitWidth == ACPI_INTEGER_BIT_SIZE) { - WidthMask = ACPI_INTEGER_MAX; + WidthMask = ACPI_UINT64_MAX; } else { diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exmisc.c b/src/add-ons/kernel/bus_managers/acpi/executer/exmisc.c index 41e4a9752e..54cb1f0019 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exmisc.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exmisc.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -508,11 +508,11 @@ Cleanup: * ******************************************************************************/ -ACPI_INTEGER +UINT64 AcpiExDoMathOp ( UINT16 Opcode, - ACPI_INTEGER Integer0, - ACPI_INTEGER Integer1) + UINT64 Integer0, + UINT64 Integer1) { ACPI_FUNCTION_ENTRY (); @@ -615,8 +615,8 @@ AcpiExDoMathOp ( ACPI_STATUS AcpiExDoLogicalNumericOp ( UINT16 Opcode, - ACPI_INTEGER Integer0, - ACPI_INTEGER Integer1, + UINT64 Integer0, + UINT64 Integer1, BOOLEAN *LogicalResult) { ACPI_STATUS Status = AE_OK; @@ -690,8 +690,8 @@ AcpiExDoLogicalOp ( BOOLEAN *LogicalResult) { ACPI_OPERAND_OBJECT *LocalOperand1 = Operand1; - ACPI_INTEGER Integer0; - ACPI_INTEGER Integer1; + UINT64 Integer0; + UINT64 Integer1; UINT32 Length0; UINT32 Length1; ACPI_STATUS Status = AE_OK; diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exmutex.c b/src/add-ons/kernel/bus_managers/acpi/executer/exmutex.c index db5ab9e77a..d0aa9deda2 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exmutex.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exmutex.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -490,6 +490,15 @@ AcpiExReleaseMutex ( return_ACPI_STATUS (AE_AML_MUTEX_NOT_ACQUIRED); } + /* Must have a valid thread ID */ + + if (!WalkState->Thread) + { + ACPI_ERROR ((AE_INFO, "Cannot release Mutex [%4.4s], null thread info", + AcpiUtGetNodeName (ObjDesc->Mutex.Node))); + return_ACPI_STATUS (AE_AML_INTERNAL); + } + /* * The Mutex is owned, but this thread must be the owner. * Special case for Global Lock, any thread can release @@ -505,15 +514,6 @@ AcpiExReleaseMutex ( return_ACPI_STATUS (AE_AML_NOT_OWNER); } - /* Must have a valid thread ID */ - - if (!WalkState->Thread) - { - ACPI_ERROR ((AE_INFO, "Cannot release Mutex [%4.4s], null thread info", - AcpiUtGetNodeName (ObjDesc->Mutex.Node))); - return_ACPI_STATUS (AE_AML_INTERNAL); - } - /* * The sync level of the mutex must be equal to the current sync level. In * other words, the current level means that at least one mutex at that diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exnames.c b/src/add-ons/kernel/bus_managers/acpi/executer/exnames.c index 89fa2d4874..a0ee8a5dbd 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exnames.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exnames.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exoparg1.c b/src/add-ons/kernel/bus_managers/acpi/executer/exoparg1.c index 70085693ba..b7ee459685 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exoparg1.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exoparg1.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -183,13 +183,12 @@ AcpiExOpcode_0A_0T_1R ( /* Create a return object of type Integer */ - ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); + ReturnDesc = AcpiUtCreateIntegerObject (AcpiOsGetTimer ()); if (!ReturnDesc) { Status = AE_NO_MEMORY; goto Cleanup; } - ReturnDesc->Integer.Value = AcpiOsGetTimer (); break; default: /* Unknown opcode */ @@ -369,8 +368,8 @@ AcpiExOpcode_1A_1T_1R ( ACPI_OPERAND_OBJECT *ReturnDesc2 = NULL; UINT32 Temp32; UINT32 i; - ACPI_INTEGER PowerOfTen; - ACPI_INTEGER Digit; + UINT64 PowerOfTen; + UINT64 Digit; ACPI_FUNCTION_TRACE_STR (ExOpcode_1A_1T_1R, @@ -478,7 +477,7 @@ AcpiExOpcode_1A_1T_1R ( /* Sum the digit into the result with the current power of 10 */ ReturnDesc->Integer.Value += - (((ACPI_INTEGER) Temp32) * PowerOfTen); + (((UINT64) Temp32) * PowerOfTen); /* Shift to next BCD digit */ @@ -507,7 +506,7 @@ AcpiExOpcode_1A_1T_1R ( * remainder from above */ ReturnDesc->Integer.Value |= - (((ACPI_INTEGER) Temp32) << ACPI_MUL_4 (i)); + (((UINT64) Temp32) << ACPI_MUL_4 (i)); } /* Overflow if there is any data left in Digit */ @@ -554,7 +553,7 @@ AcpiExOpcode_1A_1T_1R ( /* The object exists in the namespace, return TRUE */ - ReturnDesc->Integer.Value = ACPI_INTEGER_MAX; + ReturnDesc->Integer.Value = ACPI_UINT64_MAX; goto Cleanup; @@ -720,7 +719,7 @@ AcpiExOpcode_1A_0T_1R ( ACPI_OPERAND_OBJECT *ReturnDesc = NULL; ACPI_STATUS Status = AE_OK; UINT32 Type; - ACPI_INTEGER Value; + UINT64 Value; ACPI_FUNCTION_TRACE_STR (ExOpcode_1A_0T_1R, @@ -733,7 +732,7 @@ AcpiExOpcode_1A_0T_1R ( { case AML_LNOT_OP: /* LNot (Operand) */ - ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); + ReturnDesc = AcpiUtCreateIntegerObject ((UINT64) 0); if (!ReturnDesc) { Status = AE_NO_MEMORY; @@ -746,7 +745,7 @@ AcpiExOpcode_1A_0T_1R ( */ if (!Operand[0]->Integer.Value) { - ReturnDesc->Integer.Value = ACPI_INTEGER_MAX; + ReturnDesc->Integer.Value = ACPI_UINT64_MAX; } break; @@ -838,14 +837,12 @@ AcpiExOpcode_1A_0T_1R ( /* Allocate a descriptor to hold the type. */ - ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); + ReturnDesc = AcpiUtCreateIntegerObject ((UINT64) Type); if (!ReturnDesc) { Status = AE_NO_MEMORY; goto Cleanup; } - - ReturnDesc->Integer.Value = Type; break; @@ -917,14 +914,12 @@ AcpiExOpcode_1A_0T_1R ( * Now that we have the size of the object, create a result * object to hold the value */ - ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); + ReturnDesc = AcpiUtCreateIntegerObject (Value); if (!ReturnDesc) { Status = AE_NO_MEMORY; goto Cleanup; } - - ReturnDesc->Integer.Value = Value; break; @@ -1089,21 +1084,18 @@ AcpiExOpcode_1A_0T_1R ( * NOTE: index into a buffer is NOT a pointer to a * sub-buffer of the main buffer, it is only a pointer to a * single element (byte) of the buffer! + * + * Since we are returning the value of the buffer at the + * indexed location, we don't need to add an additional + * reference to the buffer itself. */ - ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); + ReturnDesc = AcpiUtCreateIntegerObject ((UINT64) + TempDesc->Buffer.Pointer[Operand[0]->Reference.Value]); if (!ReturnDesc) { Status = AE_NO_MEMORY; goto Cleanup; } - - /* - * Since we are returning the value of the buffer at the - * indexed location, we don't need to add an additional - * reference to the buffer itself. - */ - ReturnDesc->Integer.Value = - TempDesc->Buffer.Pointer[Operand[0]->Reference.Value]; break; diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exoparg2.c b/src/add-ons/kernel/bus_managers/acpi/executer/exoparg2.c index 7c42652cc4..81eda0e191 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exoparg2.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exoparg2.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -383,7 +383,7 @@ AcpiExOpcode_2A_1T_1R ( { ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; ACPI_OPERAND_OBJECT *ReturnDesc = NULL; - ACPI_INTEGER Index; + UINT64 Index; ACPI_STATUS Status = AE_OK; ACPI_SIZE Length; @@ -716,7 +716,7 @@ StoreLogicalResult: */ if (LogicalResult) { - ReturnDesc->Integer.Value = ACPI_INTEGER_MAX; + ReturnDesc->Integer.Value = ACPI_UINT64_MAX; } Cleanup: diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exoparg3.c b/src/add-ons/kernel/bus_managers/acpi/executer/exoparg3.c index 591d6aceb1..923337cd27 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exoparg3.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exoparg3.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -239,7 +239,7 @@ AcpiExOpcode_3A_1T_1R ( ACPI_OPERAND_OBJECT *ReturnDesc = NULL; char *Buffer = NULL; ACPI_STATUS Status = AE_OK; - ACPI_INTEGER Index; + UINT64 Index; ACPI_SIZE Length; diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exoparg6.c b/src/add-ons/kernel/bus_managers/acpi/executer/exoparg6.c index 96c16a33bd..5b35710c9a 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exoparg6.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exoparg6.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -305,7 +305,7 @@ AcpiExOpcode_6A_0T_1R ( ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; ACPI_OPERAND_OBJECT *ReturnDesc = NULL; ACPI_STATUS Status = AE_OK; - ACPI_INTEGER Index; + UINT64 Index; ACPI_OPERAND_OBJECT *ThisElement; @@ -344,8 +344,9 @@ AcpiExOpcode_6A_0T_1R ( } /* Create an integer for the return value */ + /* Default return value is ACPI_UINT64_MAX if no match found */ - ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); + ReturnDesc = AcpiUtCreateIntegerObject (ACPI_UINT64_MAX); if (!ReturnDesc) { Status = AE_NO_MEMORY; @@ -353,10 +354,6 @@ AcpiExOpcode_6A_0T_1R ( } - /* Default return value if no match found */ - - ReturnDesc->Integer.Value = ACPI_INTEGER_MAX; - /* * Examine each element until a match is found. Both match conditions * must be satisfied for a match to occur. Within the loop, @@ -365,7 +362,7 @@ AcpiExOpcode_6A_0T_1R ( * * Upon finding a match, the loop will terminate via "break" at * the bottom. If it terminates "normally", MatchValue will be - * ACPI_INTEGER_MAX (Ones) (its initial value) indicating that no + * ACPI_UINT64_MAX (Ones) (its initial value) indicating that no * match was found. */ for ( ; Index < Operand[0]->Package.Count; Index++) diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exprep.c b/src/add-ons/kernel/bus_managers/acpi/executer/exprep.c index c915361e81..d6b144bf84 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exprep.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exprep.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exregion.c b/src/add-ons/kernel/bus_managers/acpi/executer/exregion.c index 958dc4e067..f551f17687 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exregion.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exregion.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -149,7 +149,7 @@ AcpiExSystemMemorySpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { @@ -157,7 +157,8 @@ AcpiExSystemMemorySpaceHandler ( void *LogicalAddrPtr = NULL; ACPI_MEM_SPACE_CONTEXT *MemInfo = RegionContext; UINT32 Length; - ACPI_SIZE WindowSize; + ACPI_SIZE MapLength; + ACPI_SIZE PageBoundaryMapLength; #ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED UINT32 Remainder; #endif @@ -197,7 +198,7 @@ AcpiExSystemMemorySpaceHandler ( * Hardware does not support non-aligned data transfers, we must verify * the request. */ - (void) AcpiUtShortDivide ((ACPI_INTEGER) Address, Length, NULL, &Remainder); + (void) AcpiUtShortDivide ((UINT64) Address, Length, NULL, &Remainder); if (Remainder != 0) { return_ACPI_STATUS (AE_AML_ALIGNMENT); @@ -210,8 +211,8 @@ AcpiExSystemMemorySpaceHandler ( * 2) Address beyond the current mapping? */ if ((Address < MemInfo->MappedPhysicalAddress) || - (((ACPI_INTEGER) Address + Length) > - ((ACPI_INTEGER) + (((UINT64) Address + Length) > + ((UINT64) MemInfo->MappedPhysicalAddress + MemInfo->MappedLength))) { /* @@ -227,26 +228,45 @@ AcpiExSystemMemorySpaceHandler ( } /* - * Don't attempt to map memory beyond the end of the region, and - * constrain the maximum mapping size to something reasonable. + * October 2009: Attempt to map from the requested address to the + * end of the region. However, we will never map more than one + * page, nor will we cross a page boundary. */ - WindowSize = (ACPI_SIZE) + MapLength = (ACPI_SIZE) ((MemInfo->Address + MemInfo->Length) - Address); - if (WindowSize > ACPI_SYSMEM_REGION_WINDOW_SIZE) + /* + * If mapping the entire remaining portion of the region will cross + * a page boundary, just map up to the page boundary, do not cross. + * On some systems, crossing a page boundary while mapping regions + * can cause warnings if the pages have different attributes + * due to resource management. + * + * This has the added benefit of constraining a single mapping to + * one page, which is similar to the original code that used a 4k + * maximum window. + */ + PageBoundaryMapLength = + ACPI_ROUND_UP (Address, ACPI_DEFAULT_PAGE_SIZE) - Address; + if (PageBoundaryMapLength == 0) { - WindowSize = ACPI_SYSMEM_REGION_WINDOW_SIZE; + PageBoundaryMapLength = ACPI_DEFAULT_PAGE_SIZE; + } + + if (MapLength > PageBoundaryMapLength) + { + MapLength = PageBoundaryMapLength; } /* Create a new mapping starting at the address given */ MemInfo->MappedLogicalAddress = AcpiOsMapMemory ( - (ACPI_PHYSICAL_ADDRESS) Address, WindowSize); + (ACPI_PHYSICAL_ADDRESS) Address, MapLength); if (!MemInfo->MappedLogicalAddress) { ACPI_ERROR ((AE_INFO, "Could not map memory at %8.8X%8.8X, size %X", - ACPI_FORMAT_NATIVE_UINT (Address), (UINT32) WindowSize)); + ACPI_FORMAT_NATIVE_UINT (Address), (UINT32) MapLength)); MemInfo->MappedLength = 0; return_ACPI_STATUS (AE_NO_MEMORY); } @@ -254,7 +274,7 @@ AcpiExSystemMemorySpaceHandler ( /* Save the physical address and mapping size */ MemInfo->MappedPhysicalAddress = Address; - MemInfo->MappedLength = WindowSize; + MemInfo->MappedLength = MapLength; } /* @@ -262,7 +282,7 @@ AcpiExSystemMemorySpaceHandler ( * access */ LogicalAddrPtr = MemInfo->MappedLogicalAddress + - ((ACPI_INTEGER) Address - (ACPI_INTEGER) MemInfo->MappedPhysicalAddress); + ((UINT64) Address - (UINT64) MemInfo->MappedPhysicalAddress); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "System-Memory (width %d) R/W %d Address=%8.8X%8.8X\n", @@ -284,19 +304,19 @@ AcpiExSystemMemorySpaceHandler ( switch (BitWidth) { case 8: - *Value = (ACPI_INTEGER) ACPI_GET8 (LogicalAddrPtr); + *Value = (UINT64) ACPI_GET8 (LogicalAddrPtr); break; case 16: - *Value = (ACPI_INTEGER) ACPI_GET16 (LogicalAddrPtr); + *Value = (UINT64) ACPI_GET16 (LogicalAddrPtr); break; case 32: - *Value = (ACPI_INTEGER) ACPI_GET32 (LogicalAddrPtr); + *Value = (UINT64) ACPI_GET32 (LogicalAddrPtr); break; case 64: - *Value = (ACPI_INTEGER) ACPI_GET64 (LogicalAddrPtr); + *Value = (UINT64) ACPI_GET64 (LogicalAddrPtr); break; default: @@ -363,7 +383,7 @@ AcpiExSystemIoSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { @@ -427,7 +447,7 @@ AcpiExPciConfigSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { @@ -507,7 +527,7 @@ AcpiExCmosSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { @@ -544,7 +564,7 @@ AcpiExPciBarSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { @@ -581,7 +601,7 @@ AcpiExDataTableSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exresnte.c b/src/add-ons/kernel/bus_managers/acpi/executer/exresnte.c index 5481bc899a..a4922c0b71 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exresnte.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exresnte.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exresolv.c b/src/add-ons/kernel/bus_managers/acpi/executer/exresolv.c index a3c8ab9b5c..f78c119aed 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exresolv.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exresolv.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exresop.c b/src/add-ons/kernel/bus_managers/acpi/executer/exresop.c index ecc63f6135..ed60d2a42a 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exresop.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exresop.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exstore.c b/src/add-ons/kernel/bus_managers/acpi/executer/exstore.c index 8ec8a23cff..5ff1175867 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exstore.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exstore.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exstoren.c b/src/add-ons/kernel/bus_managers/acpi/executer/exstoren.c index 0810560d39..22ccbbf6d4 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exstoren.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exstoren.c @@ -10,7 +10,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exstorob.c b/src/add-ons/kernel/bus_managers/acpi/executer/exstorob.c index b2f125d01f..0649fdf698 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exstorob.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exstorob.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exsystem.c b/src/add-ons/kernel/bus_managers/acpi/executer/exsystem.c index 19674606a6..9f4583fc13 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exsystem.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exsystem.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -293,7 +293,7 @@ AcpiExSystemDoStall ( ACPI_STATUS AcpiExSystemDoSuspend ( - ACPI_INTEGER HowLong) + UINT64 HowLong) { ACPI_FUNCTION_ENTRY (); diff --git a/src/add-ons/kernel/bus_managers/acpi/executer/exutils.c b/src/add-ons/kernel/bus_managers/acpi/executer/exutils.c index 1f5e861b68..d8815aa517 100644 --- a/src/add-ons/kernel/bus_managers/acpi/executer/exutils.c +++ b/src/add-ons/kernel/bus_managers/acpi/executer/exutils.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -144,7 +144,7 @@ static UINT32 AcpiExDigitsNeeded ( - ACPI_INTEGER Value, + UINT64 Value, UINT32 Base); @@ -334,7 +334,7 @@ AcpiExTruncateFor32bitTable ( * We are running a method that exists in a 32-bit ACPI table. * Truncate the value to 32 bits by zeroing out the upper 32-bit field */ - ObjDesc->Integer.Value &= (ACPI_INTEGER) ACPI_UINT32_MAX; + ObjDesc->Integer.Value &= (UINT64) ACPI_UINT32_MAX; } } @@ -446,17 +446,17 @@ AcpiExReleaseGlobalLock ( static UINT32 AcpiExDigitsNeeded ( - ACPI_INTEGER Value, + UINT64 Value, UINT32 Base) { UINT32 NumDigits; - ACPI_INTEGER CurrentValue; + UINT64 CurrentValue; ACPI_FUNCTION_TRACE (ExDigitsNeeded); - /* ACPI_INTEGER is unsigned, so we don't worry about a '-' prefix */ + /* UINT64 is unsigned, so we don't worry about a '-' prefix */ if (Value == 0) { @@ -497,7 +497,7 @@ AcpiExDigitsNeeded ( void AcpiExEisaIdToString ( char *OutString, - ACPI_INTEGER CompressedId) + UINT64 CompressedId) { UINT32 SwappedId; @@ -523,10 +523,10 @@ AcpiExEisaIdToString ( OutString[0] = (char) (0x40 + (((unsigned long) SwappedId >> 26) & 0x1F)); OutString[1] = (char) (0x40 + ((SwappedId >> 21) & 0x1F)); OutString[2] = (char) (0x40 + ((SwappedId >> 16) & 0x1F)); - OutString[3] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) SwappedId, 12); - OutString[4] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) SwappedId, 8); - OutString[5] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) SwappedId, 4); - OutString[6] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) SwappedId, 0); + OutString[3] = AcpiUtHexToAsciiChar ((UINT64) SwappedId, 12); + OutString[4] = AcpiUtHexToAsciiChar ((UINT64) SwappedId, 8); + OutString[5] = AcpiUtHexToAsciiChar ((UINT64) SwappedId, 4); + OutString[6] = AcpiUtHexToAsciiChar ((UINT64) SwappedId, 0); OutString[7] = 0; } @@ -551,7 +551,7 @@ AcpiExEisaIdToString ( void AcpiExIntegerToString ( char *OutString, - ACPI_INTEGER Value) + UINT64 Value) { UINT32 Count; UINT32 DigitsNeeded; diff --git a/src/add-ons/kernel/bus_managers/acpi/hardware/hwacpi.c b/src/add-ons/kernel/bus_managers/acpi/hardware/hwacpi.c index 6b6d90ee02..fb88f9663a 100644 --- a/src/add-ons/kernel/bus_managers/acpi/hardware/hwacpi.c +++ b/src/add-ons/kernel/bus_managers/acpi/hardware/hwacpi.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/hardware/hwgpe.c b/src/add-ons/kernel/bus_managers/acpi/hardware/hwgpe.c index a45603d9d5..24e741e11a 100644 --- a/src/add-ons/kernel/bus_managers/acpi/hardware/hwgpe.c +++ b/src/add-ons/kernel/bus_managers/acpi/hardware/hwgpe.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -320,7 +320,7 @@ AcpiHwGetGpeStatus ( Status = AcpiHwRead (&InByte, &GpeRegisterInfo->StatusAddress); if (ACPI_FAILURE (Status)) { - goto UnlockAndExit; + return (Status); } if (RegisterBit & InByte) @@ -331,10 +331,7 @@ AcpiHwGetGpeStatus ( /* Set return value */ (*EventStatus) = LocalEventStatus; - - -UnlockAndExit: - return (Status); + return (AE_OK); } diff --git a/src/add-ons/kernel/bus_managers/acpi/hardware/hwregs.c b/src/add-ons/kernel/bus_managers/acpi/hardware/hwregs.c index 163840d7f4..60ca92cc81 100644 --- a/src/add-ons/kernel/bus_managers/acpi/hardware/hwregs.c +++ b/src/add-ons/kernel/bus_managers/acpi/hardware/hwregs.c @@ -10,7 +10,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/hardware/hwsleep.c b/src/add-ons/kernel/bus_managers/acpi/hardware/hwsleep.c index fed4f1ddbf..ad6ad1e796 100644 --- a/src/add-ons/kernel/bus_managers/acpi/hardware/hwsleep.c +++ b/src/add-ons/kernel/bus_managers/acpi/hardware/hwsleep.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/hardware/hwtimer.c b/src/add-ons/kernel/bus_managers/acpi/hardware/hwtimer.c index f86fb7f865..2675dadf35 100644 --- a/src/add-ons/kernel/bus_managers/acpi/hardware/hwtimer.c +++ b/src/add-ons/kernel/bus_managers/acpi/hardware/hwtimer.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -232,7 +232,7 @@ AcpiGetTimerDuration ( { ACPI_STATUS Status; UINT32 DeltaTicks; - ACPI_INTEGER Quotient; + UINT64 Quotient; ACPI_FUNCTION_TRACE (AcpiGetTimerDuration); diff --git a/src/add-ons/kernel/bus_managers/acpi/hardware/hwvalid.c b/src/add-ons/kernel/bus_managers/acpi/hardware/hwvalid.c index 650b695b2c..905dc7950f 100644 --- a/src/add-ons/kernel/bus_managers/acpi/hardware/hwvalid.c +++ b/src/add-ons/kernel/bus_managers/acpi/hardware/hwvalid.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/hardware/hwxface.c b/src/add-ons/kernel/bus_managers/acpi/hardware/hwxface.c index 6c345a593e..9ef6286bdb 100644 --- a/src/add-ons/kernel/bus_managers/acpi/hardware/hwxface.c +++ b/src/add-ons/kernel/bus_managers/acpi/hardware/hwxface.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acapps.h b/src/add-ons/kernel/bus_managers/acpi/include/acapps.h index e1f31b791b..418e20fb08 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acapps.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acapps.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -124,21 +124,21 @@ #define FILE_SUFFIX_DISASSEMBLY "dsl" #define ACPI_TABLE_FILE_SUFFIX ".dat" -extern UINT8 *DsdtPtr; -extern UINT32 AcpiDsdtLength; -extern UINT8 *AmlStart; -extern UINT32 AmlLength; - - -extern int AcpiGbl_Optind; -extern char *AcpiGbl_Optarg; +/* + * getopt + */ int AcpiGetopt( int argc, char **argv, char *opts); +extern int AcpiGbl_Optind; +extern int AcpiGbl_Opterr; +extern char *AcpiGbl_Optarg; + + /* * adisasm */ @@ -151,7 +151,8 @@ AdAmlDisassemble ( BOOLEAN GetAllTables); void -AdPrintStatistics (void); +AdPrintStatistics ( + void); ACPI_STATUS AdFindDsdt( @@ -159,7 +160,8 @@ AdFindDsdt( UINT32 *DsdtLength); void -AdDumpTables (void); +AdDumpTables ( + void); ACPI_STATUS AdGetLocalTables ( @@ -179,7 +181,9 @@ AdDisplayTables ( ACPI_TABLE_HEADER *Table); ACPI_STATUS -AdDisplayStatistics (void); +AdDisplayStatistics ( + void); + /* * adwalk @@ -209,6 +213,7 @@ AcpiDmConvertResourceIndexes ( ACPI_PARSE_OBJECT *ParseTreeRoot, ACPI_NAMESPACE_NODE *NamespaceRoot); + /* * adfile */ @@ -227,11 +232,6 @@ FlSplitInputPathname ( char **OutDirectoryPath, char **OutFilename); -char * -FlGenerateFilename ( - char *InputFilename, - char *Suffix); - char * AdGenerateFilename ( char *Prefix, diff --git a/src/add-ons/kernel/bus_managers/acpi/include/accommon.h b/src/add-ons/kernel/bus_managers/acpi/include/accommon.h index 690d3cdba9..36026d768e 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/accommon.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/accommon.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acconfig.h b/src/add-ons/kernel/bus_managers/acpi/include/acconfig.h index 1fcc45a364..9417b449dc 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acconfig.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acconfig.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -177,9 +177,9 @@ #define ACPI_MAX_REFERENCE_COUNT 0x800 -/* Size of cached memory mapping for system memory operation region */ +/* Default page size for use in mapping memory for operation regions */ -#define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096 +#define ACPI_DEFAULT_PAGE_SIZE 4096 /* Must be power of 2 */ /* OwnerId tracking. 8 entries allows for 255 OwnerIds */ diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acdebug.h b/src/add-ons/kernel/bus_managers/acpi/include/acdebug.h index dedaa649ea..2be2fd409b 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acdebug.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acdebug.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -126,13 +126,19 @@ typedef struct CommandInfo } COMMAND_INFO; - typedef struct ArgumentInfo { char *Name; /* Argument Name */ } ARGUMENT_INFO; +typedef struct acpi_execute_walk +{ + UINT32 Count; + UINT32 MaxCount; + +} ACPI_EXECUTE_WALK; + #define PARAM_LIST(pl) pl #define DBTEST_OUTPUT_LEVEL(lvl) if (AcpiGbl_DbOpt_verbose) @@ -265,7 +271,7 @@ AcpiDbCheckPredefinedNames ( void AcpiDbBatchExecute ( - void); + char *CountArg); /* * dbdisply - debug display commands diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acdisasm.h b/src/add-ons/kernel/bus_managers/acpi/include/acdisasm.h index 50c5f677c7..1fe077b059 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acdisasm.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acdisasm.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -125,18 +125,6 @@ #define BLOCK_COMMA_LIST 4 #define ACPI_DEFAULT_RESNAME *(UINT32 *) "__RD" -typedef struct acpi_external_list -{ - char *Path; - char *InternalPath; - struct acpi_external_list *Next; - UINT32 Value; - UINT16 Length; - UINT8 Type; - -} ACPI_EXTERNAL_LIST; - -extern ACPI_EXTERNAL_LIST *AcpiGbl_ExternalList; typedef const struct acpi_dmtable_info { @@ -475,14 +463,6 @@ void AcpiDmMatchOp ( ACPI_PARSE_OBJECT *Op); -BOOLEAN -AcpiDmCommaIfListMember ( - ACPI_PARSE_OBJECT *Op); - -void -AcpiDmCommaIfFieldMember ( - ACPI_PARSE_OBJECT *Op); - /* * dmnames @@ -555,6 +535,33 @@ AcpiDmIsStringBuffer ( ACPI_PARSE_OBJECT *Op); +/* + * dmextern + */ +void +AcpiDmAddToExternalList ( + ACPI_PARSE_OBJECT *Op, + char *Path, + UINT8 Type, + UINT32 Value); + +void +AcpiDmAddExternalsToNamespace ( + void); + +UINT32 +AcpiDmGetExternalMethodCount ( + void); + +void +AcpiDmClearExternalList ( + void); + +void +AcpiDmEmitExternals ( + void); + + /* * dmresrc */ @@ -589,18 +596,10 @@ ACPI_STATUS AcpiDmIsResourceTemplate ( ACPI_PARSE_OBJECT *Op); -void -AcpiDmIndent ( - UINT32 Level); - void AcpiDmBitList ( UINT16 Mask); -void -AcpiDmDecodeAttribute ( - UINT8 Attribute); - void AcpiDmDescriptorName ( void); @@ -727,10 +726,21 @@ AcpiDmVendorSmallDescriptor ( * dmutils */ void -AcpiDmAddToExternalList ( - char *Path, - UINT8 Type, - UINT32 Value); +AcpiDmDecodeAttribute ( + UINT8 Attribute); + +void +AcpiDmIndent ( + UINT32 Level); + +BOOLEAN +AcpiDmCommaIfListMember ( + ACPI_PARSE_OBJECT *Op); + +void +AcpiDmCommaIfFieldMember ( + ACPI_PARSE_OBJECT *Op); + /* * dmrestag diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acdispat.h b/src/add-ons/kernel/bus_managers/acpi/include/acdispat.h index 2aa86232b2..d7af8003df 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acdispat.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acdispat.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acevents.h b/src/add-ons/kernel/bus_managers/acpi/include/acevents.h index 0cd5e2e286..567ac1ec0e 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acevents.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acevents.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -265,7 +265,7 @@ AcpiEvAddressSpaceDispatch ( UINT32 Function, UINT32 RegionOffset, UINT32 BitWidth, - ACPI_INTEGER *Value); + UINT64 *Value); ACPI_STATUS AcpiEvAttachRegion ( diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acexcep.h b/src/add-ons/kernel/bus_managers/acpi/include/acexcep.h index dfe2e2ee73..89fe5c6689 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acexcep.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acexcep.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acglobal.h b/src/add-ons/kernel/bus_managers/acpi/include/acglobal.h index 42b0d82c9a..4469ee334e 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acglobal.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acglobal.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -446,6 +446,7 @@ ACPI_EXTERN UINT8 AcpiGbl_DbOutputFlags; ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_disasm; ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_verbose; +ACPI_EXTERN ACPI_EXTERNAL_LIST *AcpiGbl_ExternalList; #endif diff --git a/src/add-ons/kernel/bus_managers/acpi/include/achware.h b/src/add-ons/kernel/bus_managers/acpi/include/achware.h index c171a5fc1d..be0b4df327 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/achware.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/achware.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acinterp.h b/src/add-ons/kernel/bus_managers/acpi/include/acinterp.h index 74c5f0b4eb..de7dbf8030 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acinterp.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acinterp.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -214,13 +214,13 @@ AcpiExCommonBufferSetup ( ACPI_STATUS AcpiExWriteWithUpdateRule ( ACPI_OPERAND_OBJECT *ObjDesc, - ACPI_INTEGER Mask, - ACPI_INTEGER FieldValue, + UINT64 Mask, + UINT64 FieldValue, UINT32 FieldDatumByteOffset); void AcpiExGetBufferDatum( - ACPI_INTEGER *Datum, + UINT64 *Datum, void *Buffer, UINT32 BufferLength, UINT32 ByteGranularity, @@ -228,7 +228,7 @@ AcpiExGetBufferDatum( void AcpiExSetBufferDatum ( - ACPI_INTEGER MergedDatum, + UINT64 MergedDatum, void *Buffer, UINT32 BufferLength, UINT32 ByteGranularity, @@ -266,7 +266,7 @@ ACPI_STATUS AcpiExAccessRegion ( ACPI_OPERAND_OBJECT *ObjDesc, UINT32 FieldDatumByteOffset, - ACPI_INTEGER *Value, + UINT64 *Value, UINT32 ReadWrite); @@ -296,8 +296,8 @@ AcpiExDoConcatenate ( ACPI_STATUS AcpiExDoLogicalNumericOp ( UINT16 Opcode, - ACPI_INTEGER Integer0, - ACPI_INTEGER Integer1, + UINT64 Integer0, + UINT64 Integer1, BOOLEAN *LogicalResult); ACPI_STATUS @@ -307,11 +307,11 @@ AcpiExDoLogicalOp ( ACPI_OPERAND_OBJECT *Operand1, BOOLEAN *LogicalResult); -ACPI_INTEGER +UINT64 AcpiExDoMathOp ( UINT16 Opcode, - ACPI_INTEGER Operand0, - ACPI_INTEGER Operand1); + UINT64 Operand0, + UINT64 Operand1); ACPI_STATUS AcpiExCreateMutex ( @@ -425,7 +425,7 @@ AcpiExSystemDoNotifyOp ( ACPI_STATUS AcpiExSystemDoSuspend( - ACPI_INTEGER Time); + UINT64 Time); ACPI_STATUS AcpiExSystemDoStall ( @@ -697,12 +697,12 @@ AcpiExReleaseGlobalLock ( void AcpiExEisaIdToString ( char *Dest, - ACPI_INTEGER CompressedId); + UINT64 CompressedId); void AcpiExIntegerToString ( char *Dest, - ACPI_INTEGER Value); + UINT64 Value); /* @@ -713,7 +713,7 @@ AcpiExSystemMemorySpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -722,7 +722,7 @@ AcpiExSystemIoSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -731,7 +731,7 @@ AcpiExPciConfigSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -740,7 +740,7 @@ AcpiExCmosSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -749,7 +749,7 @@ AcpiExPciBarSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -758,7 +758,7 @@ AcpiExEmbeddedControllerSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -767,7 +767,7 @@ AcpiExSmBusSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -777,7 +777,7 @@ AcpiExDataTableSpaceHandler ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); diff --git a/src/add-ons/kernel/bus_managers/acpi/include/aclocal.h b/src/add-ons/kernel/bus_managers/acpi/include/aclocal.h index b8ea4f1432..0aeacff6c5 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/aclocal.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/aclocal.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -500,6 +500,7 @@ typedef struct acpi_predefined_data { char *Pathname; const ACPI_PREDEFINED_INFO *Predefined; + union acpi_operand_object *ParentPackage; UINT32 Flags; UINT8 NodeFlags; @@ -852,8 +853,7 @@ typedef struct acpi_opcode_info typedef union acpi_parse_value { - ACPI_INTEGER Integer; /* Integer constant (Up to 64 bits) */ - UINT64_STRUCT Integer64; /* Structure overlay for 2 32-bit Dwords */ + UINT64 Integer; /* Integer constant (Up to 64 bits) */ UINT32 Size; /* bytelist or field size */ char *String; /* NULL terminated string */ UINT8 *Buffer; /* buffer or string */ @@ -1216,6 +1216,29 @@ typedef struct acpi_port_info #define ACPI_ASCII_ZERO 0x30 +/***************************************************************************** + * + * Disassembler + * + ****************************************************************************/ + +typedef struct acpi_external_list +{ + char *Path; + char *InternalPath; + struct acpi_external_list *Next; + UINT32 Value; + UINT16 Length; + UINT8 Type; + UINT8 Flags; + +} ACPI_EXTERNAL_LIST; + +/* Values for Flags field above */ + +#define ACPI_IPATH_ALLOCATED 0x01 + + /***************************************************************************** * * Debugger diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acmacros.h b/src/add-ons/kernel/bus_managers/acpi/include/acmacros.h index 28c934deb9..e9a6f42cbf 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acmacros.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acmacros.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -335,8 +335,8 @@ * MASK_BITS_ABOVE creates a mask starting AT the position and above * MASK_BITS_BELOW creates a mask starting one bit BELOW the position */ -#define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_INTEGER_MAX) << ((UINT32) (position)))) -#define ACPI_MASK_BITS_BELOW(position) ((ACPI_INTEGER_MAX) << ((UINT32) (position))) +#define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_UINT64_MAX) << ((UINT32) (position)))) +#define ACPI_MASK_BITS_BELOW(position) ((ACPI_UINT64_MAX) << ((UINT32) (position))) /* Bitfields within ACPI registers */ @@ -403,6 +403,7 @@ #define ACPI_ERROR_NAMESPACE(s, e) AcpiNsReportError (AE_INFO, s, e); #define ACPI_ERROR_METHOD(s, n, p, e) AcpiNsReportMethodError (AE_INFO, s, n, p, e); #define ACPI_WARN_PREDEFINED(plist) AcpiUtPredefinedWarning plist +#define ACPI_INFO_PREDEFINED(plist) AcpiUtPredefinedInfo plist #else @@ -411,6 +412,7 @@ #define ACPI_ERROR_NAMESPACE(s, e) #define ACPI_ERROR_METHOD(s, n, p, e) #define ACPI_WARN_PREDEFINED(plist) +#define ACPI_INFO_PREDEFINED(plist) #endif /* ACPI_NO_ERROR_MESSAGES */ @@ -471,16 +473,16 @@ AcpiUtPtrExit (ACPI_DEBUG_PARAMETERS, (UINT8 *) _s); \ return (_s); }) #define return_VALUE(s) ACPI_DO_WHILE0 ({ \ - register ACPI_INTEGER _s = (s); \ + register UINT64 _s = (s); \ AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, _s); \ return (_s); }) #define return_UINT8(s) ACPI_DO_WHILE0 ({ \ register UINT8 _s = (UINT8) (s); \ - AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (ACPI_INTEGER) _s); \ + AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (UINT64) _s); \ return (_s); }) #define return_UINT32(s) ACPI_DO_WHILE0 ({ \ register UINT32 _s = (UINT32) (s); \ - AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (ACPI_INTEGER) _s); \ + AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (UINT64) _s); \ return (_s); }) #else /* Use original less-safe macros */ @@ -491,7 +493,7 @@ AcpiUtPtrExit (ACPI_DEBUG_PARAMETERS, (UINT8 *) (s)); \ return((s)); }) #define return_VALUE(s) ACPI_DO_WHILE0 ({ \ - AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (ACPI_INTEGER) (s)); \ + AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (UINT64) (s)); \ return((s)); }) #define return_UINT8(s) return_VALUE(s) #define return_UINT32(s) return_VALUE(s) diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acnames.h b/src/add-ons/kernel/bus_managers/acpi/include/acnames.h index eb9944aa16..12dd89ce14 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acnames.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acnames.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acnamesp.h b/src/add-ons/kernel/bus_managers/acpi/include/acnamesp.h index ce0ba2aa08..9ddd12e210 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acnamesp.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acnamesp.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -189,7 +189,8 @@ AcpiNsWalkNamespace ( ACPI_HANDLE StartObject, UINT32 MaxDepth, UINT32 Flags, - ACPI_WALK_CALLBACK UserFunction, + ACPI_WALK_CALLBACK PreOrderVisit, + ACPI_WALK_CALLBACK PostOrderVisit, void *Context, void **ReturnValue); @@ -428,7 +429,8 @@ AcpiNsGetAttachedData ( /* - * nsrepair - return object repair for predefined methods/objects + * nsrepair - General return object repair for all + * predefined methods/objects */ ACPI_STATUS AcpiNsRepairObject ( @@ -442,6 +444,31 @@ AcpiNsRepairPackageList ( ACPI_PREDEFINED_DATA *Data, ACPI_OPERAND_OBJECT **ObjDescPtr); +ACPI_STATUS +AcpiNsRepairNullElement ( + ACPI_PREDEFINED_DATA *Data, + UINT32 ExpectedBtypes, + UINT32 PackageIndex, + ACPI_OPERAND_OBJECT **ReturnObjectPtr); + +void +AcpiNsRemoveNullElements ( + ACPI_PREDEFINED_DATA *Data, + UINT8 PackageType, + ACPI_OPERAND_OBJECT *ObjDesc); + + +/* + * nsrepair2 - Return object repair for specific + * predefined methods/objects + */ +ACPI_STATUS +AcpiNsComplexRepairs ( + ACPI_PREDEFINED_DATA *Data, + ACPI_NAMESPACE_NODE *Node, + ACPI_STATUS ValidateStatus, + ACPI_OPERAND_OBJECT **ReturnObjectPtr); + /* * nssearch - Namespace searching and entry @@ -528,13 +555,9 @@ AcpiNsExternalizeName ( char **ConvertedName); ACPI_NAMESPACE_NODE * -AcpiNsMapHandleToNode ( +AcpiNsValidateHandle ( ACPI_HANDLE Handle); -ACPI_HANDLE -AcpiNsConvertEntryToHandle( - ACPI_NAMESPACE_NODE *Node); - void AcpiNsTerminate ( void); diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acobject.h b/src/add-ons/kernel/bus_managers/acpi/include/acobject.h index 5a33fdcf7b..f86f839267 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acobject.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acobject.h @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -190,7 +190,7 @@ typedef struct acpi_object_integer { ACPI_OBJECT_COMMON_HEADER UINT8 Fill[3]; /* Prevent warning on some compilers */ - ACPI_INTEGER Value; + UINT64 Value; } ACPI_OBJECT_INTEGER; @@ -288,7 +288,12 @@ typedef struct acpi_object_method UINT8 SyncLevel; union acpi_operand_object *Mutex; UINT8 *AmlStart; - ACPI_INTERNAL_METHOD Implementation; + union + { + ACPI_INTERNAL_METHOD Implementation; + union acpi_operand_object *Handler; + } Extra; + UINT32 AmlLength; UINT8 ThreadCount; ACPI_OWNER_ID OwnerId; diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acopcode.h b/src/add-ons/kernel/bus_managers/acpi/include/acopcode.h index bb309c78d3..94d585d227 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acopcode.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acopcode.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acoutput.h b/src/add-ons/kernel/bus_managers/acpi/include/acoutput.h index 2b796b541a..8018fed538 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acoutput.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acoutput.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -158,7 +158,8 @@ #define ACPI_LV_INIT 0x00000001 #define ACPI_LV_DEBUG_OBJECT 0x00000002 #define ACPI_LV_INFO 0x00000004 -#define ACPI_LV_ALL_EXCEPTIONS 0x00000007 +#define ACPI_LV_REPAIR 0x00000008 +#define ACPI_LV_ALL_EXCEPTIONS 0x0000000F /* Trace verbosity level 1 [Standard Trace Level] */ @@ -217,6 +218,7 @@ #define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) #define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) #define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) +#define ACPI_DB_REPAIR ACPI_DEBUG_LEVEL (ACPI_LV_REPAIR) #define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) /* Trace level -- also used in the global "DebugLevel" */ @@ -248,8 +250,8 @@ /* Defaults for DebugLevel, debug and normal */ -#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT) -#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT) +#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR) +#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR) #define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acparser.h b/src/add-ons/kernel/bus_managers/acpi/include/acparser.h index 086688e322..35fe0060f1 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acparser.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acparser.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acpi.h b/src/add-ons/kernel/bus_managers/acpi/include/acpi.h index ac0af0387b..fa7cec4568 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acpi.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acpi.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acpiosxf.h b/src/add-ons/kernel/bus_managers/acpi/include/acpiosxf.h index 730057d1ef..0c22b63bb6 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acpiosxf.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acpiosxf.h @@ -12,7 +12,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -346,7 +346,7 @@ AcpiOsWaitEventsComplete ( void AcpiOsSleep ( - ACPI_INTEGER Milliseconds); + UINT64 Milliseconds); void AcpiOsStall ( @@ -401,7 +401,7 @@ ACPI_STATUS AcpiOsWritePciConfiguration ( ACPI_PCI_ID *PciId, UINT32 Reg, - ACPI_INTEGER Value, + UINT64 Value, UINT32 Width); diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acpixf.h b/src/add-ons/kernel/bus_managers/acpi/include/acpixf.h index 14f9b43381..c67b8b9f45 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acpixf.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acpixf.h @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -120,7 +120,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20090903 +#define ACPI_CA_VERSION 0x20100121 #include "actypes.h" #include "actbl.h" @@ -267,7 +267,8 @@ AcpiWalkNamespace ( ACPI_OBJECT_TYPE Type, ACPI_HANDLE StartObject, UINT32 MaxDepth, - ACPI_WALK_CALLBACK UserFunction, + ACPI_WALK_CALLBACK PreOrderVisit, + ACPI_WALK_CALLBACK PostOrderVisit, void *Context, void **ReturnValue); diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acpredef.h b/src/add-ons/kernel/bus_managers/acpi/include/acpredef.h index 2be401520b..9b881fb800 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acpredef.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acpredef.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acresrc.h b/src/add-ons/kernel/bus_managers/acpi/include/acresrc.h index c70aa5e23d..323d040bd0 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acresrc.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acresrc.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acrestyp.h b/src/add-ons/kernel/bus_managers/acpi/include/acrestyp.h index 7eb7600d98..0a85d29f5a 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acrestyp.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acrestyp.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -534,7 +534,7 @@ typedef struct acpi_pci_routing_table { UINT32 Length; UINT32 Pin; - ACPI_INTEGER Address; /* here for 64-bit alignment */ + UINT64 Address; /* here for 64-bit alignment */ UINT32 SourceIndex; char Source[4]; /* pad to 64 bits so sizeof() works in all cases */ diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acstruct.h b/src/add-ons/kernel/bus_managers/acpi/include/acstruct.h index 45c85fe0b2..d4696b8300 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acstruct.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acstruct.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/actables.h b/src/add-ons/kernel/bus_managers/acpi/include/actables.h index e4428e6415..54fdaae9b1 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/actables.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/actables.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/actbl.h b/src/add-ons/kernel/bus_managers/acpi/include/actbl.h index caa3bdbe3b..c25ad50a57 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/actbl.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/actbl.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/actbl1.h b/src/add-ons/kernel/bus_managers/acpi/include/actbl1.h index 8af7a18380..ac11a3fe6b 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/actbl1.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/actbl1.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/actbl2.h b/src/add-ons/kernel/bus_managers/acpi/include/actbl2.h index e57c02356c..c96715d3c0 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/actbl2.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/actbl2.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/actypes.h b/src/add-ons/kernel/bus_managers/acpi/include/actypes.h index 0e01b97bbe..8d0d06ad62 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/actypes.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/actypes.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -470,22 +470,7 @@ typedef union uint64_overlay } UINT64_OVERLAY; -typedef struct uint32_struct -{ - UINT32 Lo; - UINT32 Hi; -} UINT32_STRUCT; - - -/* - * Acpi integer width. In ACPI version 1, integers are 32 bits. In ACPI - * version 2, integers are 64 bits. Note that this pertains to the ACPI integer - * type only, not other integers used in the implementation of the ACPI CA - * subsystem. - */ -typedef UINT64 ACPI_INTEGER; -#define ACPI_INTEGER_MAX ACPI_UINT64_MAX #define ACPI_INTEGER_BIT_SIZE 64 #define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ #define ACPI_MAX64_DECIMAL_DIGITS 20 @@ -500,6 +485,19 @@ typedef UINT64 ACPI_INTEGER; #define ACPI_WAIT_FOREVER 0xFFFF /* UINT16, as per ACPI spec */ #define ACPI_DO_NOT_WAIT 0 +/* + * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are 32 bits. + * In ACPI version 2 (2000) and later, integers are 64 bits. Note that this + * pertains to the ACPI integer type only, not to other integers used in the + * implementation of the ACPICA subsystem. + * + * 01/2010: This type is obsolete and has been removed from the entire ACPICA + * code base. It remains here for compatibility with device drivers that use + * the type. However, it will be removed in the future. + */ +typedef UINT64 ACPI_INTEGER; +#define ACPI_INTEGER_MAX ACPI_UINT64_MAX + /******************************************************************************* * @@ -890,7 +888,7 @@ typedef union acpi_object struct { ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_INTEGER */ - ACPI_INTEGER Value; /* The actual number */ + UINT64 Value; /* The actual number */ } Integer; struct @@ -1094,7 +1092,7 @@ ACPI_STATUS (*ACPI_ADR_SPACE_HANDLER) ( UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -1164,7 +1162,7 @@ typedef struct acpi_device_info UINT8 HighestDstates[4]; /* _SxD values: 0xFF indicates not valid */ UINT8 LowestDstates[5]; /* _SxW values: 0xFF indicates not valid */ UINT32 CurrentStatus; /* _STA value */ - ACPI_INTEGER Address; /* _ADR value */ + UINT64 Address; /* _ADR value */ ACPI_DEVICE_ID HardwareId; /* _HID value */ ACPI_DEVICE_ID UniqueId; /* _UID value */ ACPI_DEVICE_ID_LIST CompatibleIdList; /* _CID list */ diff --git a/src/add-ons/kernel/bus_managers/acpi/include/acutils.h b/src/add-ons/kernel/bus_managers/acpi/include/acutils.h index 33d33c2f47..ae406c3882 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/acutils.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/acutils.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -235,7 +235,7 @@ AcpiUtGetEventName ( char AcpiUtHexToAsciiChar ( - ACPI_INTEGER Integer, + UINT64 Integer, UINT32 Position); BOOLEAN @@ -470,7 +470,7 @@ AcpiUtValueExit ( const char *FunctionName, const char *ModuleName, UINT32 ComponentId, - ACPI_INTEGER Value); + UINT64 Value); void AcpiUtPtrExit ( @@ -550,7 +550,7 @@ ACPI_STATUS AcpiUtEvaluateNumericObject ( char *ObjectName, ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_INTEGER *Value); + UINT64 *Value); ACPI_STATUS AcpiUtExecute_STA ( @@ -643,6 +643,10 @@ ACPI_OPERAND_OBJECT * AcpiUtCreatePackageObject ( UINT32 Count); +ACPI_OPERAND_OBJECT * +AcpiUtCreateIntegerObject ( + UINT64 Value); + ACPI_OPERAND_OBJECT * AcpiUtCreateBufferObject ( ACPI_SIZE BufferSize); @@ -716,16 +720,16 @@ AcpiUtDeleteGenericState ( */ ACPI_STATUS AcpiUtDivide ( - ACPI_INTEGER InDividend, - ACPI_INTEGER InDivisor, - ACPI_INTEGER *OutQuotient, - ACPI_INTEGER *OutRemainder); + UINT64 InDividend, + UINT64 InDivisor, + UINT64 *OutQuotient, + UINT64 *OutRemainder); ACPI_STATUS AcpiUtShortDivide ( - ACPI_INTEGER InDividend, + UINT64 InDividend, UINT32 Divisor, - ACPI_INTEGER *OutQuotient, + UINT64 *OutQuotient, UINT32 *OutRemainder); /* @@ -784,7 +788,7 @@ ACPI_STATUS AcpiUtStrtoul64 ( char *String, UINT32 Base, - ACPI_INTEGER *RetInteger); + UINT64 *RetInteger); void ACPI_INTERNAL_VAR_XFACE AcpiUtPredefinedWarning ( @@ -795,6 +799,15 @@ AcpiUtPredefinedWarning ( const char *Format, ...); +void ACPI_INTERNAL_VAR_XFACE +AcpiUtPredefinedInfo ( + const char *ModuleName, + UINT32 LineNumber, + char *Pathname, + UINT8 NodeFlags, + const char *Format, + ...); + /* Values for Base above (16=Hex, 10=Decimal) */ #define ACPI_ANY_BASE 0 diff --git a/src/add-ons/kernel/bus_managers/acpi/include/amlcode.h b/src/add-ons/kernel/bus_managers/acpi/include/amlcode.h index 19740d9083..d6fc7d00ce 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/amlcode.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/amlcode.h @@ -10,7 +10,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/amlresrc.h b/src/add-ons/kernel/bus_managers/acpi/include/amlresrc.h index 689564c628..9084e44540 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/amlresrc.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/amlresrc.h @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/platform/accygwin.h b/src/add-ons/kernel/bus_managers/acpi/include/platform/accygwin.h index e9585b44b1..6936024839 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/platform/accygwin.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/platform/accygwin.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -155,6 +155,9 @@ #define inline #endif +#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) if (GLptr) Acq=1; else Acq=0; +#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = 1 + /* Cygwin uses GCC */ diff --git a/src/add-ons/kernel/bus_managers/acpi/include/platform/acefi.h b/src/add-ons/kernel/bus_managers/acpi/include/platform/acefi.h index 40afaa401c..5c900ef9cf 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/platform/acefi.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/platform/acefi.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/platform/acenv.h b/src/add-ons/kernel/bus_managers/acpi/include/platform/acenv.h index eb0f795a19..443f72d768 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/platform/acenv.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/platform/acenv.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -265,11 +265,11 @@ /* Global Lock acquire/release */ #ifndef ACPI_ACQUIRE_GLOBAL_LOCK -#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) Acq = 1 +#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acquired) Acquired = 1 #endif #ifndef ACPI_RELEASE_GLOBAL_LOCK -#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) Acq = 0 +#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = 0 #endif /* Flush CPU cache - used when going to sleep. Wbinvd or similar. */ @@ -427,8 +427,8 @@ typedef char *va_list; #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 AcpiUtToUpper -#define ACPI_TOLOWER AcpiUtToLower +#define ACPI_TOUPPER(c) AcpiUtToUpper ((int) (c)) +#define ACPI_TOLOWER(c) AcpiUtToLower ((int) (c)) #endif /* ACPI_USE_SYSTEM_CLIBRARY */ diff --git a/src/add-ons/kernel/bus_managers/acpi/include/platform/acfreebsd.h b/src/add-ons/kernel/bus_managers/acpi/include/platform/acfreebsd.h index 20c5687c20..09ad54ae1b 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/platform/acfreebsd.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/platform/acfreebsd.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/platform/acgcc.h b/src/add-ons/kernel/bus_managers/acpi/include/platform/acgcc.h index 449942278c..d0098b1800 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/platform/acgcc.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/platform/acgcc.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/platform/acintel.h b/src/add-ons/kernel/bus_managers/acpi/include/platform/acintel.h index 44197a0994..a7e75ec603 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/platform/acintel.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/platform/acintel.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/platform/aclinux.h b/src/add-ons/kernel/bus_managers/acpi/include/platform/aclinux.h index c6f868cdbf..9009689c93 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/platform/aclinux.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/platform/aclinux.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/platform/acmsvc.h b/src/add-ons/kernel/bus_managers/acpi/include/platform/acmsvc.h index 0320e74d1e..62e69d16dc 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/platform/acmsvc.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/platform/acmsvc.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/platform/acnetbsd.h b/src/add-ons/kernel/bus_managers/acpi/include/platform/acnetbsd.h index c04851b926..302d719f2a 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/platform/acnetbsd.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/platform/acnetbsd.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/platform/acos2.h b/src/add-ons/kernel/bus_managers/acpi/include/platform/acos2.h index 21e3373c24..90e6b2e491 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/platform/acos2.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/platform/acos2.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/platform/acwin.h b/src/add-ons/kernel/bus_managers/acpi/include/platform/acwin.h index d1fa2ee22b..583f677b47 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/platform/acwin.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/platform/acwin.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/include/platform/acwin64.h b/src/add-ons/kernel/bus_managers/acpi/include/platform/acwin64.h index faec855e22..64c1f99702 100644 --- a/src/add-ons/kernel/bus_managers/acpi/include/platform/acwin64.h +++ b/src/add-ons/kernel/bus_managers/acpi/include/platform/acwin64.h @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsaccess.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsaccess.c index 172b26d3ab..86f412a9c8 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsaccess.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsaccess.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -251,7 +251,7 @@ AcpiNsRootInitialize ( /* Mark this as a very SPECIAL method */ ObjDesc->Method.MethodFlags = AML_METHOD_INTERNAL_ONLY; - ObjDesc->Method.Implementation = AcpiUtOsiImplementation; + ObjDesc->Method.Extra.Implementation = AcpiUtOsiImplementation; #endif break; diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsalloc.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsalloc.c index 9693cb7835..aadafbf781 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsalloc.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsalloc.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsdump.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsdump.c index 762437aa12..a0dd59e3d2 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsdump.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsdump.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -286,7 +286,7 @@ AcpiNsDumpOneObject ( return (AE_OK); } - ThisNode = AcpiNsMapHandleToNode (ObjHandle); + ThisNode = AcpiNsValidateHandle (ObjHandle); if (!ThisNode) { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Invalid object handle %p\n", @@ -736,7 +736,7 @@ AcpiNsDumpObjects ( (void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth, ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES, - AcpiNsDumpOneObject, (void *) &Info, NULL); + AcpiNsDumpOneObject, NULL, (void *) &Info, NULL); } diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsdumpdv.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsdumpdv.c index a2456b2429..deabaaee03 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsdumpdv.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsdumpdv.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -225,7 +225,7 @@ AcpiNsDumpRootDevices ( Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, SysBusHandle, ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK, - AcpiNsDumpOneDevice, NULL, NULL); + AcpiNsDumpOneDevice, NULL, NULL, NULL); } #endif diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nseval.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nseval.c index c84a4d58ce..200a957089 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nseval.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nseval.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -460,52 +460,99 @@ AcpiNsExecModuleCode ( ACPI_OPERAND_OBJECT *MethodObj, ACPI_EVALUATE_INFO *Info) { - ACPI_OPERAND_OBJECT *RootObj; + ACPI_OPERAND_OBJECT *ParentObj; + ACPI_NAMESPACE_NODE *ParentNode; + ACPI_OBJECT_TYPE Type; ACPI_STATUS Status; ACPI_FUNCTION_TRACE (NsExecModuleCode); + /* + * Get the parent node. We cheat by using the NextObject field + * of the method object descriptor. + */ + ParentNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, + MethodObj->Method.NextObject); + Type = AcpiNsGetType (ParentNode); + + /* + * Get the region handler and save it in the method object. We may need + * this if an operation region declaration causes a _REG method to be run. + * + * We can't do this in AcpiPsLinkModuleCode because + * AcpiGbl_RootNode->Object is NULL at PASS1. + */ + if ((Type == ACPI_TYPE_DEVICE) && ParentNode->Object) + { + MethodObj->Method.Extra.Handler = + ParentNode->Object->Device.Handler; + } + + /* Must clear NextObject (AcpiNsAttachObject needs the field) */ + + MethodObj->Method.NextObject = NULL; + /* Initialize the evaluation information block */ ACPI_MEMSET (Info, 0, sizeof (ACPI_EVALUATE_INFO)); - Info->PrefixNode = AcpiGbl_RootNode; + Info->PrefixNode = ParentNode; /* - * Get the currently attached root object. Add a reference, because the + * Get the currently attached parent object. Add a reference, because the * ref count will be decreased when the method object is installed to - * the root node. + * the parent node. */ - RootObj = AcpiNsGetAttachedObject (AcpiGbl_RootNode); - AcpiUtAddReference (RootObj); + ParentObj = AcpiNsGetAttachedObject (ParentNode); + if (ParentObj) + { + AcpiUtAddReference (ParentObj); + } - /* Install the method (module-level code) in the root node */ + /* Install the method (module-level code) in the parent node */ - Status = AcpiNsAttachObject (AcpiGbl_RootNode, MethodObj, + Status = AcpiNsAttachObject (ParentNode, MethodObj, ACPI_TYPE_METHOD); if (ACPI_FAILURE (Status)) { goto Exit; } - /* Execute the root node as a control method */ + /* Execute the parent node as a control method */ Status = AcpiNsEvaluate (Info); ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "Executed module-level code at %p\n", MethodObj->Method.AmlStart)); + /* Delete a possible implicit return value (in slack mode) */ + + if (Info->ReturnObject) + { + AcpiUtRemoveReference (Info->ReturnObject); + } + /* Detach the temporary method object */ - AcpiNsDetachObject (AcpiGbl_RootNode); + AcpiNsDetachObject (ParentNode); - /* Restore the original root object */ + /* Restore the original parent object */ - Status = AcpiNsAttachObject (AcpiGbl_RootNode, RootObj, ACPI_TYPE_DEVICE); + if (ParentObj) + { + Status = AcpiNsAttachObject (ParentNode, ParentObj, Type); + } + else + { + ParentNode->Type = (UINT8) Type; + } Exit: - AcpiUtRemoveReference (RootObj); + if (ParentObj) + { + AcpiUtRemoveReference (ParentObj); + } return_VOID; } diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsinit.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsinit.c index fcea63e7ac..770235e8e3 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsinit.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsinit.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -185,7 +185,7 @@ AcpiNsInitializeObjects ( /* Walk entire namespace from the supplied root */ Status = AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, AcpiNsInitOneObject, + ACPI_UINT32_MAX, AcpiNsInitOneObject, NULL, &Info, NULL); if (ACPI_FAILURE (Status)) { @@ -249,7 +249,7 @@ AcpiNsInitializeDevices ( /* Tree analysis: find all subtrees that contain _INI methods */ Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, FALSE, AcpiNsFindIniMethods, &Info, NULL); + ACPI_UINT32_MAX, FALSE, AcpiNsFindIniMethods, NULL, &Info, NULL); if (ACPI_FAILURE (Status)) { goto ErrorExit; @@ -283,7 +283,7 @@ AcpiNsInitializeDevices ( /* Walk namespace to execute all _INIs on present devices */ Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, FALSE, AcpiNsInitOneDevice, &Info, NULL); + ACPI_UINT32_MAX, FALSE, AcpiNsInitOneDevice, NULL, &Info, NULL); ACPI_FREE (Info.EvaluateInfo); if (ACPI_FAILURE (Status)) diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsload.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsload.c index a9f3824718..bf20ac5f06 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsload.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsload.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsnames.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsnames.c index 0dd148fa7c..9423d561b7 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsnames.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsnames.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -337,7 +337,7 @@ AcpiNsHandleToPathname ( ACPI_FUNCTION_TRACE_PTR (NsHandleToPathname, TargetHandle); - Node = AcpiNsMapHandleToNode (TargetHandle); + Node = AcpiNsValidateHandle (TargetHandle); if (!Node) { return_ACPI_STATUS (AE_BAD_PARAMETER); diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsobject.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsobject.c index c0163f4ea2..af5df1983e 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsobject.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsobject.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsparse.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsparse.c index 58301560ae..52cbc97599 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsparse.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsparse.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nspredef.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nspredef.c index 93bcbdef28..ef76930b51 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nspredef.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nspredef.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -313,25 +313,41 @@ AcpiNsCheckPredefinedNames ( Data->Pathname = Pathname; /* - * Check that the type of the return object is what is expected for - * this predefined name + * Check that the type of the main return object is what is expected + * for this predefined name */ Status = AcpiNsCheckObjectType (Data, ReturnObjectPtr, Predefined->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT); if (ACPI_FAILURE (Status)) { - goto CheckValidationStatus; + goto Exit; } - /* For returned Package objects, check the type of all sub-objects */ - - if (ReturnObject->Common.Type == ACPI_TYPE_PACKAGE) + /* + * For returned Package objects, check the type of all sub-objects. + * Note: Package may have been newly created by call above. + */ + if ((*ReturnObjectPtr)->Common.Type == ACPI_TYPE_PACKAGE) { + Data->ParentPackage = *ReturnObjectPtr; Status = AcpiNsCheckPackage (Data, ReturnObjectPtr); + if (ACPI_FAILURE (Status)) + { + goto Exit; + } } + /* + * The return object was OK, or it was successfully repaired above. + * Now make some additional checks such as verifying that package + * objects are sorted correctly (if required) or buffer objects have + * the correct data width (bytes vs. dwords). These repairs are + * performed on a per-name basis, i.e., the code is specific to + * particular predefined names. + */ + Status = AcpiNsComplexRepairs (Data, Node, Status, ReturnObjectPtr); -CheckValidationStatus: +Exit: /* * If the object validation failed or if we successfully repaired one * or more objects, mark the parent node to suppress further warning @@ -343,7 +359,6 @@ CheckValidationStatus: } ACPI_FREE (Data); - Cleanup: ACPI_FREE (Pathname); return (Status); @@ -538,6 +553,12 @@ AcpiNsCheckPackage ( "%s Validating return Package of Type %X, Count %X\n", Data->Pathname, Package->RetInfo.Type, ReturnObject->Package.Count)); + /* + * For variable-length Packages, we can safely remove all embedded + * and trailing NULL package elements + */ + AcpiNsRemoveNullElements (Data, Package->RetInfo.Type, ReturnObject); + /* Extract package count and elements array */ Elements = ReturnObject->Package.Elements; @@ -576,9 +597,10 @@ AcpiNsCheckPackage ( } else if (Count > ExpectedCount) { - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Return Package is larger than needed - " - "found %u, expected %u", Count, ExpectedCount)); + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Return Package is larger than needed - " + "found %u, expected %u\n", + Data->Pathname, Count, ExpectedCount)); } /* Validate all elements of the returned package */ @@ -719,7 +741,7 @@ AcpiNsCheckPackage ( * there is only one entry). We may be able to repair this by * wrapping the returned Package with a new outer Package. */ - if ((*Elements)->Common.Type != ACPI_TYPE_PACKAGE) + if (*Elements && ((*Elements)->Common.Type != ACPI_TYPE_PACKAGE)) { /* Create the new outer package and populate it */ @@ -799,12 +821,18 @@ AcpiNsCheckPackageList ( UINT32 j; - /* Validate each sub-Package in the parent Package */ - + /* + * Validate each sub-Package in the parent Package + * + * NOTE: assumes list of sub-packages contains no NULL elements. + * Any NULL elements should have been removed by earlier call + * to AcpiNsRemoveNullElements. + */ for (i = 0; i < Count; i++) { SubPackage = *Elements; SubElements = SubPackage->Package.Elements; + Data->ParentPackage = SubPackage; /* Each sub-object must be of type Package */ @@ -817,6 +845,7 @@ AcpiNsCheckPackageList ( /* Examine the different types of expected sub-packages */ + Data->ParentPackage = SubPackage; switch (Package->RetInfo.Type) { case ACPI_PTYPE2: @@ -893,7 +922,7 @@ AcpiNsCheckPackageList ( /* * First element is the (Integer) count of elements, including - * the count field. + * the count field (the ACPI name is NumElements) */ Status = AcpiNsCheckObjectType (Data, SubElements, ACPI_RTYPE_INTEGER, 0); @@ -916,6 +945,17 @@ AcpiNsCheckPackageList ( ExpectedCount = Package->RetInfo.Count1; goto PackageTooSmall; } + if (ExpectedCount == 0) + { + /* + * Either the NumEntries element was originally zero or it was + * a NULL element and repaired to an Integer of value zero. + * In either case, repair it by setting NumEntries to be the + * actual size of the subpackage. + */ + ExpectedCount = SubPackage->Package.Count; + (*SubElements)->Integer.Value = ExpectedCount; + } /* Check the type of each sub-package element */ @@ -1050,11 +1090,19 @@ AcpiNsCheckObjectType ( /* - * If we get a NULL ReturnObject here, it is a NULL package element, - * and this is always an error. + * If we get a NULL ReturnObject here, it is a NULL package element. + * Since all extraneous NULL package elements were removed earlier by a + * call to AcpiNsRemoveNullElements, this is an unexpected NULL element. + * We will attempt to repair it. */ if (!ReturnObject) { + Status = AcpiNsRepairNullElement (Data, ExpectedBtypes, + PackageIndex, ReturnObjectPtr); + if (ACPI_SUCCESS (Status)) + { + return (AE_OK); /* Repair was successful */ + } goto TypeErrorExit; } @@ -1107,28 +1155,27 @@ AcpiNsCheckObjectType ( /* Is the object one of the expected types? */ - if (!(ReturnBtype & ExpectedBtypes)) + if (ReturnBtype & ExpectedBtypes) { - /* Type mismatch -- attempt repair of the returned object */ + /* For reference objects, check that the reference type is correct */ - Status = AcpiNsRepairObject (Data, ExpectedBtypes, - PackageIndex, ReturnObjectPtr); - if (ACPI_SUCCESS (Status)) + if (ReturnObject->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) { - return (AE_OK); /* Repair was successful */ + Status = AcpiNsCheckReference (Data, ReturnObject); } - goto TypeErrorExit; + + return (Status); } - /* For reference objects, check that the reference type is correct */ + /* Type mismatch -- attempt repair of the returned object */ - if (ReturnObject->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) + Status = AcpiNsRepairObject (Data, ExpectedBtypes, + PackageIndex, ReturnObjectPtr); + if (ACPI_SUCCESS (Status)) { - Status = AcpiNsCheckReference (Data, ReturnObject); + return (AE_OK); /* Repair was successful */ } - return (Status); - TypeErrorExit: diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsrepair.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsrepair.c index ae534264ab..76d62bf7a0 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsrepair.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsrepair.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -118,12 +118,67 @@ #include "acpi.h" #include "accommon.h" #include "acnamesp.h" +#include "acinterp.h" #include "acpredef.h" #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsrepair") +/******************************************************************************* + * + * This module attempts to repair or convert objects returned by the + * predefined methods to an object type that is expected, as per the ACPI + * specification. The need for this code is dictated by the many machines that + * return incorrect types for the standard predefined methods. Performing these + * conversions here, in one place, eliminates the need for individual ACPI + * device drivers to do the same. Note: Most of these conversions are different + * than the internal object conversion routines used for implicit object + * conversion. + * + * The following conversions can be performed as necessary: + * + * Integer -> String + * Integer -> Buffer + * String -> Integer + * String -> Buffer + * Buffer -> Integer + * Buffer -> String + * Buffer -> Package of Integers + * Package -> Package of one Package + * + * Additional possible repairs: + * + * Optional/unnecessary NULL package elements removed + * Required package elements that are NULL replaced by Integer/String/Buffer + * Incorrect standalone package wrapped with required outer package + * + ******************************************************************************/ + + +/* Local prototypes */ + +static ACPI_STATUS +AcpiNsConvertToInteger ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +static ACPI_STATUS +AcpiNsConvertToString ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +static ACPI_STATUS +AcpiNsConvertToBuffer ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +static ACPI_STATUS +AcpiNsConvertToPackage ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + + /******************************************************************************* * * FUNCTION: AcpiNsRepairObject @@ -152,29 +207,230 @@ AcpiNsRepairObject ( { ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; ACPI_OPERAND_OBJECT *NewObject; - ACPI_SIZE Length; + ACPI_STATUS Status; - switch (ReturnObject->Common.Type) + ACPI_FUNCTION_NAME (NsRepairObject); + + + /* + * At this point, we know that the type of the returned object was not + * one of the expected types for this predefined name. Attempt to + * repair the object by converting it to one of the expected object + * types for this predefined name. + */ + if (ExpectedBtypes & ACPI_RTYPE_INTEGER) { + Status = AcpiNsConvertToInteger (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + if (ExpectedBtypes & ACPI_RTYPE_STRING) + { + Status = AcpiNsConvertToString (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + if (ExpectedBtypes & ACPI_RTYPE_BUFFER) + { + Status = AcpiNsConvertToBuffer (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + if (ExpectedBtypes & ACPI_RTYPE_PACKAGE) + { + Status = AcpiNsConvertToPackage (ReturnObject, &NewObject); + if (ACPI_SUCCESS (Status)) + { + goto ObjectRepaired; + } + } + + /* We cannot repair this object */ + + return (AE_AML_OPERAND_TYPE); + + +ObjectRepaired: + + /* Object was successfully repaired */ + + /* + * If the original object is a package element, we need to: + * 1. Set the reference count of the new object to match the + * reference count of the old object. + * 2. Decrement the reference count of the original object. + */ + if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT) + { + NewObject->Common.ReferenceCount = + ReturnObject->Common.ReferenceCount; + + if (ReturnObject->Common.ReferenceCount > 1) + { + ReturnObject->Common.ReferenceCount--; + } + + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Converted %s to expected %s at index %u\n", + Data->Pathname, AcpiUtGetObjectTypeName (ReturnObject), + AcpiUtGetObjectTypeName (NewObject), PackageIndex)); + } + else + { + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Converted %s to expected %s\n", + Data->Pathname, AcpiUtGetObjectTypeName (ReturnObject), + AcpiUtGetObjectTypeName (NewObject))); + } + + /* Delete old object, install the new return object */ + + AcpiUtRemoveReference (ReturnObject); + *ReturnObjectPtr = NewObject; + Data->Flags |= ACPI_OBJECT_REPAIRED; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToInteger + * + * PARAMETERS: OriginalObject - Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a String/Buffer object to an Integer. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiNsConvertToInteger ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + ACPI_STATUS Status; + UINT64 Value = 0; + UINT32 i; + + + switch (OriginalObject->Common.Type) + { + case ACPI_TYPE_STRING: + + /* String-to-Integer conversion */ + + Status = AcpiUtStrtoul64 (OriginalObject->String.Pointer, + ACPI_ANY_BASE, &Value); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + break; + case ACPI_TYPE_BUFFER: - /* Does the method/object legally return a string? */ + /* Buffer-to-Integer conversion. Max buffer size is 64 bits. */ - if (!(ExpectedBtypes & ACPI_RTYPE_STRING)) + if (OriginalObject->Buffer.Length > 8) { return (AE_AML_OPERAND_TYPE); } + /* Extract each buffer byte to create the integer */ + + for (i = 0; i < OriginalObject->Buffer.Length; i++) + { + Value |= ((UINT64) OriginalObject->Buffer.Pointer[i] << (i * 8)); + } + break; + + default: + return (AE_AML_OPERAND_TYPE); + } + + NewObject = AcpiUtCreateIntegerObject (Value); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + *ReturnObject = NewObject; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToString + * + * PARAMETERS: OriginalObject - Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a Integer/Buffer object to a String. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiNsConvertToString ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + ACPI_SIZE Length; + ACPI_STATUS Status; + + + switch (OriginalObject->Common.Type) + { + case ACPI_TYPE_INTEGER: /* - * Have a Buffer, expected a String, convert. Use a ToString + * Integer-to-String conversion. Commonly, convert + * an integer of value 0 to a NULL string. The last element of + * _BIF and _BIX packages occasionally need this fix. + */ + if (OriginalObject->Integer.Value == 0) + { + /* Allocate a new NULL string object */ + + NewObject = AcpiUtCreateStringObject (0); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + } + else + { + Status = AcpiExConvertToString (OriginalObject, &NewObject, + ACPI_IMPLICIT_CONVERT_HEX); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + } + break; + + case ACPI_TYPE_BUFFER: + /* + * Buffer-to-String conversion. Use a ToString * conversion, no transform performed on the buffer data. The best * example of this is the _BIF method, where the string data from * the battery is often (incorrectly) returned as buffer object(s). */ Length = 0; - while ((Length < ReturnObject->Buffer.Length) && - (ReturnObject->Buffer.Pointer[Length])) + while ((Length < OriginalObject->Buffer.Length) && + (OriginalObject->Buffer.Pointer[Length])) { Length++; } @@ -192,46 +448,372 @@ AcpiNsRepairObject ( * terminated at Length+1. */ ACPI_MEMCPY (NewObject->String.Pointer, - ReturnObject->Buffer.Pointer, Length); + OriginalObject->Buffer.Pointer, Length); + break; + default: + return (AE_AML_OPERAND_TYPE); + } + + *ReturnObject = NewObject; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToBuffer + * + * PARAMETERS: OriginalObject - Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a Integer/String/Package object to a Buffer. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiNsConvertToBuffer ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + ACPI_STATUS Status; + ACPI_OPERAND_OBJECT **Elements; + UINT32 *DwordBuffer; + UINT32 Count; + UINT32 i; + + + switch (OriginalObject->Common.Type) + { + case ACPI_TYPE_INTEGER: /* - * If the original object is a package element, we need to: - * 1. Set the reference count of the new object to match the - * reference count of the old object. - * 2. Decrement the reference count of the original object. + * Integer-to-Buffer conversion. + * Convert the Integer to a packed-byte buffer. _MAT and other + * objects need this sometimes, if a read has been performed on a + * Field object that is less than or equal to the global integer + * size (32 or 64 bits). */ - if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT) + Status = AcpiExConvertToBuffer (OriginalObject, &NewObject); + if (ACPI_FAILURE (Status)) { - NewObject->Common.ReferenceCount = - ReturnObject->Common.ReferenceCount; + return (Status); + } + break; - if (ReturnObject->Common.ReferenceCount > 1) + case ACPI_TYPE_STRING: + + /* String-to-Buffer conversion. Simple data copy */ + + NewObject = AcpiUtCreateBufferObject (OriginalObject->String.Length); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + ACPI_MEMCPY (NewObject->Buffer.Pointer, + OriginalObject->String.Pointer, OriginalObject->String.Length); + break; + + case ACPI_TYPE_PACKAGE: + /* + * This case is often seen for predefined names that must return a + * Buffer object with multiple DWORD integers within. For example, + * _FDE and _GTM. The Package can be converted to a Buffer. + */ + + /* All elements of the Package must be integers */ + + Elements = OriginalObject->Package.Elements; + Count = OriginalObject->Package.Count; + + for (i = 0; i < Count; i++) + { + if ((!*Elements) || + ((*Elements)->Common.Type != ACPI_TYPE_INTEGER)) { - ReturnObject->Common.ReferenceCount--; + return (AE_AML_OPERAND_TYPE); } + Elements++; + } - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Converted Buffer to expected String at index %u", - PackageIndex)); + /* Create the new buffer object to replace the Package */ + + NewObject = AcpiUtCreateBufferObject (ACPI_MUL_4 (Count)); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + /* Copy the package elements (integers) to the buffer as DWORDs */ + + Elements = OriginalObject->Package.Elements; + DwordBuffer = ACPI_CAST_PTR (UINT32, NewObject->Buffer.Pointer); + + for (i = 0; i < Count; i++) + { + *DwordBuffer = (UINT32) (*Elements)->Integer.Value; + DwordBuffer++; + Elements++; + } + break; + + default: + return (AE_AML_OPERAND_TYPE); + } + + *ReturnObject = NewObject; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToPackage + * + * PARAMETERS: OriginalObject - Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a Buffer object to a Package. Each byte of + * the buffer is converted to a single integer package element. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiNsConvertToPackage ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + ACPI_OPERAND_OBJECT **Elements; + UINT32 Length; + UINT8 *Buffer; + + + switch (OriginalObject->Common.Type) + { + case ACPI_TYPE_BUFFER: + + /* Buffer-to-Package conversion */ + + Length = OriginalObject->Buffer.Length; + NewObject = AcpiUtCreatePackageObject (Length); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + /* Convert each buffer byte to an integer package element */ + + Elements = NewObject->Package.Elements; + Buffer = OriginalObject->Buffer.Pointer; + + while (Length--) + { + *Elements = AcpiUtCreateIntegerObject ((UINT64) *Buffer); + if (!*Elements) + { + AcpiUtRemoveReference (NewObject); + return (AE_NO_MEMORY); + } + Elements++; + Buffer++; + } + break; + + default: + return (AE_AML_OPERAND_TYPE); + } + + *ReturnObject = NewObject; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsRepairNullElement + * + * PARAMETERS: Data - Pointer to validation data structure + * ExpectedBtypes - Object types expected + * PackageIndex - Index of object within parent package (if + * applicable - ACPI_NOT_PACKAGE_ELEMENT + * otherwise) + * ReturnObjectPtr - Pointer to the object returned from the + * evaluation of a method or object + * + * RETURN: Status. AE_OK if repair was successful. + * + * DESCRIPTION: Attempt to repair a NULL element of a returned Package object. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiNsRepairNullElement ( + ACPI_PREDEFINED_DATA *Data, + UINT32 ExpectedBtypes, + UINT32 PackageIndex, + ACPI_OPERAND_OBJECT **ReturnObjectPtr) +{ + ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; + ACPI_OPERAND_OBJECT *NewObject; + + + ACPI_FUNCTION_NAME (NsRepairNullElement); + + + /* No repair needed if return object is non-NULL */ + + if (ReturnObject) + { + return (AE_OK); + } + + /* + * Attempt to repair a NULL element of a Package object. This applies to + * predefined names that return a fixed-length package and each element + * is required. It does not apply to variable-length packages where NULL + * elements are allowed, especially at the end of the package. + */ + if (ExpectedBtypes & ACPI_RTYPE_INTEGER) + { + /* Need an Integer - create a zero-value integer */ + + NewObject = AcpiUtCreateIntegerObject (0); + } + else if (ExpectedBtypes & ACPI_RTYPE_STRING) + { + /* Need a String - create a NULL string */ + + NewObject = AcpiUtCreateStringObject (0); + } + else if (ExpectedBtypes & ACPI_RTYPE_BUFFER) + { + /* Need a Buffer - create a zero-length buffer */ + + NewObject = AcpiUtCreateBufferObject (0); + } + else + { + /* Error for all other expected types */ + + return (AE_AML_OPERAND_TYPE); + } + + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + /* Set the reference count according to the parent Package object */ + + NewObject->Common.ReferenceCount = Data->ParentPackage->Common.ReferenceCount; + + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Converted NULL package element to expected %s at index %u\n", + Data->Pathname, AcpiUtGetObjectTypeName (NewObject), PackageIndex)); + + *ReturnObjectPtr = NewObject; + Data->Flags |= ACPI_OBJECT_REPAIRED; + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiNsRemoveNullElements + * + * PARAMETERS: Data - Pointer to validation data structure + * PackageType - An AcpiReturnPackageTypes value + * ObjDesc - A Package object + * + * RETURN: None. + * + * DESCRIPTION: Remove all NULL package elements from packages that contain + * a variable number of sub-packages. For these types of + * packages, NULL elements can be safely removed. + * + *****************************************************************************/ + +void +AcpiNsRemoveNullElements ( + ACPI_PREDEFINED_DATA *Data, + UINT8 PackageType, + ACPI_OPERAND_OBJECT *ObjDesc) +{ + ACPI_OPERAND_OBJECT **Source; + ACPI_OPERAND_OBJECT **Dest; + UINT32 Count; + UINT32 NewCount; + UINT32 i; + + + ACPI_FUNCTION_NAME (NsRemoveNullElements); + + + /* + * PTYPE1 packages contain no subpackages. + * PTYPE2 packages contain a variable number of sub-packages. We can + * safely remove all NULL elements from the PTYPE2 packages. + */ + switch (PackageType) + { + case ACPI_PTYPE1_FIXED: + case ACPI_PTYPE1_VAR: + case ACPI_PTYPE1_OPTION: + return; + + case ACPI_PTYPE2: + case ACPI_PTYPE2_COUNT: + case ACPI_PTYPE2_PKG_COUNT: + case ACPI_PTYPE2_FIXED: + case ACPI_PTYPE2_MIN: + case ACPI_PTYPE2_REV_FIXED: + break; + + default: + return; + } + + Count = ObjDesc->Package.Count; + NewCount = Count; + + Source = ObjDesc->Package.Elements; + Dest = Source; + + /* Examine all elements of the package object, remove nulls */ + + for (i = 0; i < Count; i++) + { + if (!*Source) + { + NewCount--; } else { - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Converted Buffer to expected String")); + *Dest = *Source; + Dest++; } - - /* Delete old object, install the new return object */ - - AcpiUtRemoveReference (ReturnObject); - *ReturnObjectPtr = NewObject; - Data->Flags |= ACPI_OBJECT_REPAIRED; - return (AE_OK); - - default: - break; + Source++; } - return (AE_AML_OPERAND_TYPE); + /* Update parent package if any null elements were removed */ + + if (NewCount < Count) + { + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Found and removed %u NULL elements\n", + Data->Pathname, (Count - NewCount))); + + /* NULL terminate list and update the package count */ + + *Dest = NULL; + ObjDesc->Package.Count = NewCount; + } } @@ -267,6 +849,9 @@ AcpiNsRepairPackageList ( ACPI_OPERAND_OBJECT *PkgObjDesc; + ACPI_FUNCTION_NAME (NsRepairPackageList); + + /* * Create the new outer package and populate it. The new package will * have a single element, the lone subpackage. @@ -284,8 +869,8 @@ AcpiNsRepairPackageList ( *ObjDescPtr = PkgObjDesc; Data->Flags |= ACPI_OBJECT_REPAIRED; - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Incorrectly formed Package, attempting repair")); + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Repaired incorrectly formed Package\n", Data->Pathname)); return (AE_OK); } diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsrepair2.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsrepair2.c new file mode 100644 index 0000000000..220608e2db --- /dev/null +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsrepair2.c @@ -0,0 +1,696 @@ +/****************************************************************************** + * + * Module Name: nsrepair2 - Repair for objects returned by specific + * predefined methods + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#define __NSREPAIR2_C__ + +#include "acpi.h" +#include "accommon.h" +#include "acnamesp.h" + +#define _COMPONENT ACPI_NAMESPACE + ACPI_MODULE_NAME ("nsrepair2") + + +/* + * Information structure and handler for ACPI predefined names that can + * be repaired on a per-name basis. + */ +typedef +ACPI_STATUS (*ACPI_REPAIR_FUNCTION) ( + ACPI_PREDEFINED_DATA *Data, + ACPI_OPERAND_OBJECT **ReturnObjectPtr); + +typedef struct acpi_repair_info +{ + char Name[ACPI_NAME_SIZE]; + ACPI_REPAIR_FUNCTION RepairFunction; + +} ACPI_REPAIR_INFO; + + +/* Local prototypes */ + +static const ACPI_REPAIR_INFO * +AcpiNsMatchRepairableName ( + ACPI_NAMESPACE_NODE *Node); + +static ACPI_STATUS +AcpiNsRepair_ALR ( + ACPI_PREDEFINED_DATA *Data, + ACPI_OPERAND_OBJECT **ReturnObjectPtr); + +static ACPI_STATUS +AcpiNsRepair_FDE ( + ACPI_PREDEFINED_DATA *Data, + ACPI_OPERAND_OBJECT **ReturnObjectPtr); + +static ACPI_STATUS +AcpiNsRepair_PSS ( + ACPI_PREDEFINED_DATA *Data, + ACPI_OPERAND_OBJECT **ReturnObjectPtr); + +static ACPI_STATUS +AcpiNsRepair_TSS ( + ACPI_PREDEFINED_DATA *Data, + ACPI_OPERAND_OBJECT **ReturnObjectPtr); + +static ACPI_STATUS +AcpiNsCheckSortedList ( + ACPI_PREDEFINED_DATA *Data, + ACPI_OPERAND_OBJECT *ReturnObject, + UINT32 ExpectedCount, + UINT32 SortIndex, + UINT8 SortDirection, + char *SortKeyName); + +static void +AcpiNsSortList ( + ACPI_OPERAND_OBJECT **Elements, + UINT32 Count, + UINT32 Index, + UINT8 SortDirection); + +/* Values for SortDirection above */ + +#define ACPI_SORT_ASCENDING 0 +#define ACPI_SORT_DESCENDING 1 + + +/* + * This table contains the names of the predefined methods for which we can + * perform more complex repairs. + * + * As necessary: + * + * _ALR: Sort the list ascending by AmbientIlluminance + * _FDE: Convert Buffer of BYTEs to a Buffer of DWORDs + * _GTM: Convert Buffer of BYTEs to a Buffer of DWORDs + * _PSS: Sort the list descending by Power + * _TSS: Sort the list descending by Power + */ +static const ACPI_REPAIR_INFO AcpiNsRepairableNames[] = +{ + {"_ALR", AcpiNsRepair_ALR}, + {"_FDE", AcpiNsRepair_FDE}, + {"_GTM", AcpiNsRepair_FDE}, /* _GTM has same repair as _FDE */ + {"_PSS", AcpiNsRepair_PSS}, + {"_TSS", AcpiNsRepair_TSS}, + {{0,0,0,0}, NULL} /* Table terminator */ +}; + + +#define ACPI_FDE_FIELD_COUNT 5 +#define ACPI_FDE_BYTE_BUFFER_SIZE 5 +#define ACPI_FDE_DWORD_BUFFER_SIZE (ACPI_FDE_FIELD_COUNT * sizeof (UINT32)) + + +/****************************************************************************** + * + * FUNCTION: AcpiNsComplexRepairs + * + * PARAMETERS: Data - Pointer to validation data structure + * Node - Namespace node for the method/object + * ValidateStatus - Original status of earlier validation + * ReturnObjectPtr - Pointer to the object returned from the + * evaluation of a method or object + * + * RETURN: Status. AE_OK if repair was successful. If name is not + * matched, ValidateStatus is returned. + * + * DESCRIPTION: Attempt to repair/convert a return object of a type that was + * not expected. + * + *****************************************************************************/ + +ACPI_STATUS +AcpiNsComplexRepairs ( + ACPI_PREDEFINED_DATA *Data, + ACPI_NAMESPACE_NODE *Node, + ACPI_STATUS ValidateStatus, + ACPI_OPERAND_OBJECT **ReturnObjectPtr) +{ + const ACPI_REPAIR_INFO *Predefined; + ACPI_STATUS Status; + + + /* Check if this name is in the list of repairable names */ + + Predefined = AcpiNsMatchRepairableName (Node); + if (!Predefined) + { + return (ValidateStatus); + } + + Status = Predefined->RepairFunction (Data, ReturnObjectPtr); + return (Status); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiNsMatchRepairableName + * + * PARAMETERS: Node - Namespace node for the method/object + * + * RETURN: Pointer to entry in repair table. NULL indicates not found. + * + * DESCRIPTION: Check an object name against the repairable object list. + * + *****************************************************************************/ + +static const ACPI_REPAIR_INFO * +AcpiNsMatchRepairableName ( + ACPI_NAMESPACE_NODE *Node) +{ + const ACPI_REPAIR_INFO *ThisName; + + + /* Search info table for a repairable predefined method/object name */ + + ThisName = AcpiNsRepairableNames; + while (ThisName->RepairFunction) + { + if (ACPI_COMPARE_NAME (Node->Name.Ascii, ThisName->Name)) + { + return (ThisName); + } + ThisName++; + } + + return (NULL); /* Not found */ +} + + +/****************************************************************************** + * + * FUNCTION: AcpiNsRepair_ALR + * + * PARAMETERS: Data - Pointer to validation data structure + * ReturnObjectPtr - Pointer to the object returned from the + * evaluation of a method or object + * + * RETURN: Status. AE_OK if object is OK or was repaired successfully + * + * DESCRIPTION: Repair for the _ALR object. If necessary, sort the object list + * ascending by the ambient illuminance values. + * + *****************************************************************************/ + +static ACPI_STATUS +AcpiNsRepair_ALR ( + ACPI_PREDEFINED_DATA *Data, + ACPI_OPERAND_OBJECT **ReturnObjectPtr) +{ + ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; + ACPI_STATUS Status; + + + Status = AcpiNsCheckSortedList (Data, ReturnObject, 2, 1, + ACPI_SORT_ASCENDING, "AmbientIlluminance"); + + return (Status); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiNsRepair_FDE + * + * PARAMETERS: Data - Pointer to validation data structure + * ReturnObjectPtr - Pointer to the object returned from the + * evaluation of a method or object + * + * RETURN: Status. AE_OK if object is OK or was repaired successfully + * + * DESCRIPTION: Repair for the _FDE and _GTM objects. The expected return + * value is a Buffer of 5 DWORDs. This function repairs a common + * problem where the return value is a Buffer of BYTEs, not + * DWORDs. + * + *****************************************************************************/ + +static ACPI_STATUS +AcpiNsRepair_FDE ( + ACPI_PREDEFINED_DATA *Data, + ACPI_OPERAND_OBJECT **ReturnObjectPtr) +{ + ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; + ACPI_OPERAND_OBJECT *BufferObject; + UINT8 *ByteBuffer; + UINT32 *DwordBuffer; + UINT32 i; + + + ACPI_FUNCTION_NAME (NsRepair_FDE); + + + switch (ReturnObject->Common.Type) + { + case ACPI_TYPE_BUFFER: + + /* This is the expected type. Length should be (at least) 5 DWORDs */ + + if (ReturnObject->Buffer.Length >= ACPI_FDE_DWORD_BUFFER_SIZE) + { + return (AE_OK); + } + + /* We can only repair if we have exactly 5 BYTEs */ + + if (ReturnObject->Buffer.Length != ACPI_FDE_BYTE_BUFFER_SIZE) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, + "Incorrect return buffer length %u, expected %u", + ReturnObject->Buffer.Length, ACPI_FDE_DWORD_BUFFER_SIZE)); + + return (AE_AML_OPERAND_TYPE); + } + + /* Create the new (larger) buffer object */ + + BufferObject = AcpiUtCreateBufferObject (ACPI_FDE_DWORD_BUFFER_SIZE); + if (!BufferObject) + { + return (AE_NO_MEMORY); + } + + /* Expand each byte to a DWORD */ + + ByteBuffer = ReturnObject->Buffer.Pointer; + DwordBuffer = ACPI_CAST_PTR (UINT32, BufferObject->Buffer.Pointer); + + for (i = 0; i < ACPI_FDE_FIELD_COUNT; i++) + { + *DwordBuffer = (UINT32) *ByteBuffer; + DwordBuffer++; + ByteBuffer++; + } + + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s Expanded Byte Buffer to expected DWord Buffer\n", + Data->Pathname)); + break; + + default: + return (AE_AML_OPERAND_TYPE); + } + + /* Delete the original return object, return the new buffer object */ + + AcpiUtRemoveReference (ReturnObject); + *ReturnObjectPtr = BufferObject; + + Data->Flags |= ACPI_OBJECT_REPAIRED; + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiNsRepair_TSS + * + * PARAMETERS: Data - Pointer to validation data structure + * ReturnObjectPtr - Pointer to the object returned from the + * evaluation of a method or object + * + * RETURN: Status. AE_OK if object is OK or was repaired successfully + * + * DESCRIPTION: Repair for the _TSS object. If necessary, sort the object list + * descending by the power dissipation values. + * + *****************************************************************************/ + +static ACPI_STATUS +AcpiNsRepair_TSS ( + ACPI_PREDEFINED_DATA *Data, + ACPI_OPERAND_OBJECT **ReturnObjectPtr) +{ + ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; + ACPI_STATUS Status; + + + Status = AcpiNsCheckSortedList (Data, ReturnObject, 5, 1, + ACPI_SORT_DESCENDING, "PowerDissipation"); + + return (Status); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiNsRepair_PSS + * + * PARAMETERS: Data - Pointer to validation data structure + * ReturnObjectPtr - Pointer to the object returned from the + * evaluation of a method or object + * + * RETURN: Status. AE_OK if object is OK or was repaired successfully + * + * DESCRIPTION: Repair for the _PSS object. If necessary, sort the object list + * by the CPU frequencies. Check that the power dissipation values + * are all proportional to CPU frequency (i.e., sorting by + * frequency should be the same as sorting by power.) + * + *****************************************************************************/ + +static ACPI_STATUS +AcpiNsRepair_PSS ( + ACPI_PREDEFINED_DATA *Data, + ACPI_OPERAND_OBJECT **ReturnObjectPtr) +{ + ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; + ACPI_OPERAND_OBJECT **OuterElements; + UINT32 OuterElementCount; + ACPI_OPERAND_OBJECT **Elements; + ACPI_OPERAND_OBJECT *ObjDesc; + UINT32 PreviousValue; + ACPI_STATUS Status; + UINT32 i; + + + /* + * Entries (sub-packages) in the _PSS Package must be sorted by power + * dissipation, in descending order. If it appears that the list is + * incorrectly sorted, sort it. We sort by CpuFrequency, since this + * should be proportional to the power. + */ + Status =AcpiNsCheckSortedList (Data, ReturnObject, 6, 0, + ACPI_SORT_DESCENDING, "CpuFrequency"); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* + * We now know the list is correctly sorted by CPU frequency. Check if + * the power dissipation values are proportional. + */ + PreviousValue = ACPI_UINT32_MAX; + OuterElements = ReturnObject->Package.Elements; + OuterElementCount = ReturnObject->Package.Count; + + for (i = 0; i < OuterElementCount; i++) + { + Elements = (*OuterElements)->Package.Elements; + ObjDesc = Elements[1]; /* Index1 = PowerDissipation */ + + if ((UINT32) ObjDesc->Integer.Value > PreviousValue) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, + "SubPackage[%u,%u] - suspicious power dissipation values", + i-1, i)); + } + + PreviousValue = (UINT32) ObjDesc->Integer.Value; + OuterElements++; + } + + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiNsCheckSortedList + * + * PARAMETERS: Data - Pointer to validation data structure + * ReturnObject - Pointer to the top-level returned object + * ExpectedCount - Minimum length of each sub-package + * SortIndex - Sub-package entry to sort on + * SortDirection - Ascending or descending + * SortKeyName - Name of the SortIndex field + * + * RETURN: Status. AE_OK if the list is valid and is sorted correctly or + * has been repaired by sorting the list. + * + * DESCRIPTION: Check if the package list is valid and sorted correctly by the + * SortIndex. If not, then sort the list. + * + *****************************************************************************/ + +static ACPI_STATUS +AcpiNsCheckSortedList ( + ACPI_PREDEFINED_DATA *Data, + ACPI_OPERAND_OBJECT *ReturnObject, + UINT32 ExpectedCount, + UINT32 SortIndex, + UINT8 SortDirection, + char *SortKeyName) +{ + UINT32 OuterElementCount; + ACPI_OPERAND_OBJECT **OuterElements; + ACPI_OPERAND_OBJECT **Elements; + ACPI_OPERAND_OBJECT *ObjDesc; + UINT32 i; + UINT32 PreviousValue; + + + ACPI_FUNCTION_NAME (NsCheckSortedList); + + + /* The top-level object must be a package */ + + if (ReturnObject->Common.Type != ACPI_TYPE_PACKAGE) + { + return (AE_AML_OPERAND_TYPE); + } + + /* + * NOTE: assumes list of sub-packages contains no NULL elements. + * Any NULL elements should have been removed by earlier call + * to AcpiNsRemoveNullElements. + */ + OuterElements = ReturnObject->Package.Elements; + OuterElementCount = ReturnObject->Package.Count; + if (!OuterElementCount) + { + return (AE_AML_PACKAGE_LIMIT); + } + + PreviousValue = 0; + if (SortDirection == ACPI_SORT_DESCENDING) + { + PreviousValue = ACPI_UINT32_MAX; + } + + /* Examine each subpackage */ + + for (i = 0; i < OuterElementCount; i++) + { + /* Each element of the top-level package must also be a package */ + + if ((*OuterElements)->Common.Type != ACPI_TYPE_PACKAGE) + { + return (AE_AML_OPERAND_TYPE); + } + + /* Each sub-package must have the minimum length */ + + if ((*OuterElements)->Package.Count < ExpectedCount) + { + return (AE_AML_PACKAGE_LIMIT); + } + + Elements = (*OuterElements)->Package.Elements; + ObjDesc = Elements[SortIndex]; + + if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER) + { + return (AE_AML_OPERAND_TYPE); + } + + /* + * The list must be sorted in the specified order. If we detect a + * discrepancy, sort the entire list. + */ + if (((SortDirection == ACPI_SORT_ASCENDING) && + (ObjDesc->Integer.Value < PreviousValue)) || + ((SortDirection == ACPI_SORT_DESCENDING) && + (ObjDesc->Integer.Value > PreviousValue))) + { + AcpiNsSortList (ReturnObject->Package.Elements, + OuterElementCount, SortIndex, SortDirection); + + Data->Flags |= ACPI_OBJECT_REPAIRED; + + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Repaired unsorted list - now sorted by %s\n", + Data->Pathname, SortKeyName)); + return (AE_OK); + } + + PreviousValue = (UINT32) ObjDesc->Integer.Value; + OuterElements++; + } + + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiNsSortList + * + * PARAMETERS: Elements - Package object element list + * Count - Element count for above + * Index - Sort by which package element + * SortDirection - Ascending or Descending sort + * + * RETURN: None + * + * DESCRIPTION: Sort the objects that are in a package element list. + * + * NOTE: Assumes that all NULL elements have been removed from the package, + * and that all elements have been verified to be of type Integer. + * + *****************************************************************************/ + +static void +AcpiNsSortList ( + ACPI_OPERAND_OBJECT **Elements, + UINT32 Count, + UINT32 Index, + UINT8 SortDirection) +{ + ACPI_OPERAND_OBJECT *ObjDesc1; + ACPI_OPERAND_OBJECT *ObjDesc2; + ACPI_OPERAND_OBJECT *TempObj; + UINT32 i; + UINT32 j; + + + /* Simple bubble sort */ + + for (i = 1; i < Count; i++) + { + for (j = (Count - 1); j >= i; j--) + { + ObjDesc1 = Elements[j-1]->Package.Elements[Index]; + ObjDesc2 = Elements[j]->Package.Elements[Index]; + + if (((SortDirection == ACPI_SORT_ASCENDING) && + (ObjDesc1->Integer.Value > ObjDesc2->Integer.Value)) || + + ((SortDirection == ACPI_SORT_DESCENDING) && + (ObjDesc1->Integer.Value < ObjDesc2->Integer.Value))) + { + TempObj = Elements[j-1]; + Elements[j-1] = Elements[j]; + Elements[j] = TempObj; + } + } + } +} diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nssearch.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nssearch.c index fce7c5ad4d..b17f60f7bd 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nssearch.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nssearch.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsutils.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsutils.c index dffc0d4432..ee40473aaf 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsutils.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsutils.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -857,25 +857,26 @@ AcpiNsExternalizeName ( /******************************************************************************* * - * FUNCTION: AcpiNsMapHandleToNode + * FUNCTION: AcpiNsValidateHandle * - * PARAMETERS: Handle - Handle to be converted to an Node + * PARAMETERS: Handle - Handle to be validated and typecast to a + * namespace node. * - * RETURN: A Name table entry pointer + * RETURN: A pointer to a namespace node * - * DESCRIPTION: Convert a namespace handle to a real Node + * DESCRIPTION: Convert a namespace handle to a namespace node. Handles special + * cases for the root node. * - * Note: Real integer handles would allow for more verification + * NOTE: Real integer handles would allow for more verification * and keep all pointers within this subsystem - however this introduces - * more (and perhaps unnecessary) overhead. - * - * The current implemenation is basically a placeholder until such time comes - * that it is needed. + * more overhead and has not been necessary to this point. Drivers + * holding handles are typically notified before a node becomes invalid + * due to a table unload. * ******************************************************************************/ ACPI_NAMESPACE_NODE * -AcpiNsMapHandleToNode ( +AcpiNsValidateHandle ( ACPI_HANDLE Handle) { @@ -900,48 +901,6 @@ AcpiNsMapHandleToNode ( } -/******************************************************************************* - * - * FUNCTION: AcpiNsConvertEntryToHandle - * - * PARAMETERS: Node - Node to be converted to a Handle - * - * RETURN: A user handle - * - * DESCRIPTION: Convert a real Node to a namespace handle - * - ******************************************************************************/ - -ACPI_HANDLE -AcpiNsConvertEntryToHandle ( - ACPI_NAMESPACE_NODE *Node) -{ - - - /* - * Simple implementation for now; - */ - return ((ACPI_HANDLE) Node); - - -/* Example future implementation --------------------- - - if (!Node) - { - return (NULL); - } - - if (Node == AcpiGbl_RootNode) - { - return (ACPI_ROOT_OBJECT); - } - - - return ((ACPI_HANDLE) Node); -------------------------------------------------------*/ -} - - /******************************************************************************* * * FUNCTION: AcpiNsTerminate diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nswalk.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nswalk.c index 881573e905..b6c573bda7 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nswalk.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nswalk.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -247,24 +247,27 @@ AcpiNsGetNextNodeTyped ( * MaxDepth - Depth to which search is to reach * Flags - Whether to unlock the NS before invoking * the callback routine - * UserFunction - Called when an object of "Type" is found - * Context - Passed to user function - * ReturnValue - from the UserFunction if terminated early. - * Otherwise, returns NULL. + * PreOrderVisit - Called during tree pre-order visit + * when an object of "Type" is found + * PostOrderVisit - Called during tree post-order visit + * when an object of "Type" is found + * Context - Passed to user function(s) above + * ReturnValue - from the UserFunction if terminated + * early. Otherwise, returns NULL. * RETURNS: Status * * DESCRIPTION: Performs a modified depth-first walk of the namespace tree, * starting (and ending) at the node specified by StartHandle. - * The UserFunction is called whenever a node that matches - * the type parameter is found. If the user function returns + * The callback function is called whenever a node that matches + * the type parameter is found. If the callback function returns * a non-zero value, the search is terminated immediately and * this value is returned to the caller. * * The point of this procedure is to provide a generic namespace * walk routine that can be called from multiple places to - * provide multiple services; the User Function can be tailored - * to each task, whether it is a print function, a compare - * function, etc. + * provide multiple services; the callback function(s) can be + * tailored to each task, whether it is a print function, + * a compare function, etc. * ******************************************************************************/ @@ -274,7 +277,8 @@ AcpiNsWalkNamespace ( ACPI_HANDLE StartNode, UINT32 MaxDepth, UINT32 Flags, - ACPI_WALK_CALLBACK UserFunction, + ACPI_WALK_CALLBACK PreOrderVisit, + ACPI_WALK_CALLBACK PostOrderVisit, void *Context, void **ReturnValue) { @@ -284,6 +288,7 @@ AcpiNsWalkNamespace ( ACPI_NAMESPACE_NODE *ParentNode; ACPI_OBJECT_TYPE ChildType; UINT32 Level; + BOOLEAN NodePreviouslyVisited = FALSE; ACPI_FUNCTION_TRACE (NsWalkNamespace); @@ -299,7 +304,7 @@ AcpiNsWalkNamespace ( /* Null child means "get first node" */ ParentNode = StartNode; - ChildNode = NULL; + ChildNode = AcpiNsGetNextNode (ParentNode, NULL); ChildType = ACPI_TYPE_ANY; Level = 1; @@ -308,103 +313,139 @@ AcpiNsWalkNamespace ( * started. When Level is zero, the loop is done because we have * bubbled up to (and passed) the original parent handle (StartEntry) */ - while (Level > 0) + while (Level > 0 && ChildNode) { - /* Get the next node in this scope. Null if not found */ - Status = AE_OK; + + /* Found next child, get the type if we are not searching for ANY */ + + if (Type != ACPI_TYPE_ANY) + { + ChildType = ChildNode->Type; + } + + /* + * Ignore all temporary namespace nodes (created during control + * method execution) unless told otherwise. These temporary nodes + * can cause a race condition because they can be deleted during + * the execution of the user function (if the namespace is + * unlocked before invocation of the user function.) Only the + * debugger namespace dump will examine the temporary nodes. + */ + if ((ChildNode->Flags & ANOBJ_TEMPORARY) && + !(Flags & ACPI_NS_WALK_TEMP_NODES)) + { + Status = AE_CTRL_DEPTH; + } + + /* Type must match requested type */ + + else if (ChildType == Type) + { + /* + * Found a matching node, invoke the user callback function. + * Unlock the namespace if flag is set. + */ + if (Flags & ACPI_NS_WALK_UNLOCK) + { + MutexStatus = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (MutexStatus)) + { + return_ACPI_STATUS (MutexStatus); + } + } + + /* + * Invoke the user function, either pre-order or post-order + * or both. + */ + if (!NodePreviouslyVisited) + { + if (PreOrderVisit) + { + Status = PreOrderVisit (ChildNode, Level, + Context, ReturnValue); + } + } + else + { + if (PostOrderVisit) + { + Status = PostOrderVisit (ChildNode, Level, + Context, ReturnValue); + } + } + + if (Flags & ACPI_NS_WALK_UNLOCK) + { + MutexStatus = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (MutexStatus)) + { + return_ACPI_STATUS (MutexStatus); + } + } + + switch (Status) + { + case AE_OK: + case AE_CTRL_DEPTH: + + /* Just keep going */ + break; + + case AE_CTRL_TERMINATE: + + /* Exit now, with OK status */ + + return_ACPI_STATUS (AE_OK); + + default: + + /* All others are valid exceptions */ + + return_ACPI_STATUS (Status); + } + } + + /* + * Depth first search: Attempt to go down another level in the + * namespace if we are allowed to. Don't go any further if we have + * reached the caller specified maximum depth or if the user + * function has specified that the maximum depth has been reached. + */ + if (!NodePreviouslyVisited && + (Level < MaxDepth) && + (Status != AE_CTRL_DEPTH)) + { + if (ChildNode->Child) + { + /* There is at least one child of this node, visit it */ + + Level++; + ParentNode = ChildNode; + ChildNode = AcpiNsGetNextNode (ParentNode, NULL); + continue; + } + } + + /* No more children, re-visit this node */ + + if (!NodePreviouslyVisited) + { + NodePreviouslyVisited = TRUE; + continue; + } + + /* No more children, visit peers */ + ChildNode = AcpiNsGetNextNode (ParentNode, ChildNode); if (ChildNode) { - /* Found next child, get the type if we are not searching for ANY */ - - if (Type != ACPI_TYPE_ANY) - { - ChildType = ChildNode->Type; - } - - /* - * Ignore all temporary namespace nodes (created during control - * method execution) unless told otherwise. These temporary nodes - * can cause a race condition because they can be deleted during - * the execution of the user function (if the namespace is - * unlocked before invocation of the user function.) Only the - * debugger namespace dump will examine the temporary nodes. - */ - if ((ChildNode->Flags & ANOBJ_TEMPORARY) && - !(Flags & ACPI_NS_WALK_TEMP_NODES)) - { - Status = AE_CTRL_DEPTH; - } - - /* Type must match requested type */ - - else if (ChildType == Type) - { - /* - * Found a matching node, invoke the user callback function. - * Unlock the namespace if flag is set. - */ - if (Flags & ACPI_NS_WALK_UNLOCK) - { - MutexStatus = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); - if (ACPI_FAILURE (MutexStatus)) - { - return_ACPI_STATUS (MutexStatus); - } - } - - Status = UserFunction (ChildNode, Level, Context, ReturnValue); - - if (Flags & ACPI_NS_WALK_UNLOCK) - { - MutexStatus = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); - if (ACPI_FAILURE (MutexStatus)) - { - return_ACPI_STATUS (MutexStatus); - } - } - - switch (Status) - { - case AE_OK: - case AE_CTRL_DEPTH: - - /* Just keep going */ - break; - - case AE_CTRL_TERMINATE: - - /* Exit now, with OK status */ - - return_ACPI_STATUS (AE_OK); - - default: - - /* All others are valid exceptions */ - - return_ACPI_STATUS (Status); - } - } - - /* - * Depth first search: Attempt to go down another level in the - * namespace if we are allowed to. Don't go any further if we have - * reached the caller specified maximum depth or if the user - * function has specified that the maximum depth has been reached. - */ - if ((Level < MaxDepth) && (Status != AE_CTRL_DEPTH)) - { - if (ChildNode->Child) - { - /* There is at least one child of this node, visit it */ - - Level++; - ParentNode = ChildNode; - ChildNode = NULL; - } - } + NodePreviouslyVisited = FALSE; } + + /* No peers, re-visit parent */ + else { /* @@ -414,6 +455,8 @@ AcpiNsWalkNamespace ( Level--; ChildNode = ParentNode; ParentNode = AcpiNsGetParentNode (ParentNode); + + NodePreviouslyVisited = TRUE; } } diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsxfeval.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsxfeval.c index a0d1a95127..945690a7c1 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsxfeval.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsxfeval.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -281,7 +281,7 @@ AcpiEvaluateObject ( /* Convert and validate the device handle */ - Info->PrefixNode = AcpiNsMapHandleToNode (Handle); + Info->PrefixNode = AcpiNsValidateHandle (Handle); if (!Info->PrefixNode) { Status = AE_BAD_PARAMETER; @@ -544,8 +544,11 @@ AcpiNsResolveReferences ( * PARAMETERS: Type - ACPI_OBJECT_TYPE to search for * StartObject - Handle in namespace where search begins * MaxDepth - Depth to which search is to reach - * UserFunction - Called when an object of "Type" is found - * Context - Passed to user function + * PreOrderVisit - Called during tree pre-order visit + * when an object of "Type" is found + * PostOrderVisit - Called during tree post-order visit + * when an object of "Type" is found + * Context - Passed to user function(s) above * ReturnValue - Location where return value of * UserFunction is put if terminated early * @@ -554,16 +557,16 @@ AcpiNsResolveReferences ( * * DESCRIPTION: Performs a modified depth-first walk of the namespace tree, * starting (and ending) at the object specified by StartHandle. - * The UserFunction is called whenever an object that matches - * the type parameter is found. If the user function returns + * The callback function is called whenever an object that matches + * the type parameter is found. If the callback function returns * a non-zero value, the search is terminated immediately and this * value is returned to the caller. * * The point of this procedure is to provide a generic namespace * walk routine that can be called from multiple places to - * provide multiple services; the User Function can be tailored - * to each task, whether it is a print function, a compare - * function, etc. + * provide multiple services; the callback function(s) can be + * tailored to each task, whether it is a print function, + * a compare function, etc. * ******************************************************************************/ @@ -572,7 +575,8 @@ AcpiWalkNamespace ( ACPI_OBJECT_TYPE Type, ACPI_HANDLE StartObject, UINT32 MaxDepth, - ACPI_WALK_CALLBACK UserFunction, + ACPI_WALK_CALLBACK PreOrderVisit, + ACPI_WALK_CALLBACK PostOrderVisit, void *Context, void **ReturnValue) { @@ -586,7 +590,7 @@ AcpiWalkNamespace ( if ((Type > ACPI_TYPE_LOCAL_MAX) || (!MaxDepth) || - (!UserFunction)) + (!PreOrderVisit && !PostOrderVisit)) { return_ACPI_STATUS (AE_BAD_PARAMETER); } @@ -621,7 +625,8 @@ AcpiWalkNamespace ( } Status = AcpiNsWalkNamespace (Type, StartObject, MaxDepth, - ACPI_NS_WALK_UNLOCK, UserFunction, Context, ReturnValue); + ACPI_NS_WALK_UNLOCK, PreOrderVisit, + PostOrderVisit, Context, ReturnValue); (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); @@ -671,7 +676,7 @@ AcpiNsGetDeviceCallback ( return (Status); } - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { @@ -683,27 +688,20 @@ AcpiNsGetDeviceCallback ( return (AE_BAD_PARAMETER); } - /* Run _STA to determine if device is present */ -#if 0 - Status = AcpiUtExecute_STA (Node, &Flags); - if (ACPI_FAILURE (Status)) - { - return (AE_CTRL_DEPTH); - } - - if (!(Flags & ACPI_STA_DEVICE_PRESENT) && - !(Flags & ACPI_STA_DEVICE_FUNCTIONING)) - { - /* - * Don't examine the children of the device only when the - * device is neither present nor functional. See ACPI spec, - * description of _STA for more information. - */ - return (AE_CTRL_DEPTH); - } -#endif - /* Filter based on device HID & CID */ - + /* + * First, filter based on the device HID and CID. + * + * 01/2010: For this case where a specific HID is requested, we don't + * want to run _STA until we have an actual HID match. Thus, we will + * not unnecessarily execute _STA on devices for which the caller + * doesn't care about. Previously, _STA was executed unconditionally + * on all devices found here. + * + * A side-effect of this change is that now we will continue to search + * for a matching HID even under device trees where the parent device + * would have returned a _STA that indicates it is not present or + * not functioning (thus aborting the search on that branch). + */ if (Info->Hid != NULL) { Status = AcpiUtExecute_HID (Node, &Hid); @@ -757,6 +755,25 @@ AcpiNsGetDeviceCallback ( } } + /* Run _STA to determine if device is present */ + + Status = AcpiUtExecute_STA (Node, &Flags); + if (ACPI_FAILURE (Status)) + { + return (AE_CTRL_DEPTH); + } + + if (!(Flags & ACPI_STA_DEVICE_PRESENT) && + !(Flags & ACPI_STA_DEVICE_FUNCTIONING)) + { + /* + * Don't examine the children of the device only when the + * device is neither present nor functional. See ACPI spec, + * description of _STA for more information. + */ + return (AE_CTRL_DEPTH); + } + /* We have a valid device, invoke the user function */ Status = Info->UserFunction (ObjHandle, NestingLevel, Info->Context, @@ -833,7 +850,7 @@ AcpiGetDevices ( Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK, - AcpiNsGetDeviceCallback, &Info, ReturnValue); + AcpiNsGetDeviceCallback, NULL, &Info, ReturnValue); (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (Status); @@ -883,7 +900,7 @@ AcpiAttachData ( /* Convert and validate the handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { Status = AE_BAD_PARAMETER; @@ -938,7 +955,7 @@ AcpiDetachData ( /* Convert and validate the handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { Status = AE_BAD_PARAMETER; @@ -996,7 +1013,7 @@ AcpiGetData ( /* Convert and validate the handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { Status = AE_BAD_PARAMETER; diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsxfname.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsxfname.c index 166862bc2a..8fd3d4c7ea 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsxfname.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsxfname.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -178,7 +178,7 @@ AcpiGetHandle ( if (Parent) { - PrefixNode = AcpiNsMapHandleToNode (Parent); + PrefixNode = AcpiNsValidateHandle (Parent); if (!PrefixNode) { return (AE_BAD_PARAMETER); @@ -200,7 +200,7 @@ AcpiGetHandle ( if (!ACPI_STRCMP (Pathname, ACPI_NS_ROOT_PATH)) { - *RetHandle = AcpiNsConvertEntryToHandle (AcpiGbl_RootNode); + *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, AcpiGbl_RootNode); return (AE_OK); } } @@ -216,7 +216,7 @@ AcpiGetHandle ( Status = AcpiNsGetNode (PrefixNode, Pathname, ACPI_NS_NO_UPSEARCH, &Node); if (ACPI_SUCCESS (Status)) { - *RetHandle = AcpiNsConvertEntryToHandle (Node); + *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, Node); } return (Status); @@ -282,7 +282,7 @@ AcpiGetName ( return (Status); } - Node = AcpiNsMapHandleToNode (Handle); + Node = AcpiNsValidateHandle (Handle); if (!Node) { Status = AE_BAD_PARAMETER; @@ -399,7 +399,7 @@ AcpiGetObjectInfo ( goto Cleanup; } - Node = AcpiNsMapHandleToNode (Handle); + Node = AcpiNsValidateHandle (Handle); if (!Node) { (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); diff --git a/src/add-ons/kernel/bus_managers/acpi/namespace/nsxfobj.c b/src/add-ons/kernel/bus_managers/acpi/namespace/nsxfobj.c index 023cb6990b..aef106e80b 100644 --- a/src/add-ons/kernel/bus_managers/acpi/namespace/nsxfobj.c +++ b/src/add-ons/kernel/bus_managers/acpi/namespace/nsxfobj.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -172,7 +172,7 @@ AcpiGetType ( /* Convert and validate the handle */ - Node = AcpiNsMapHandleToNode (Handle); + Node = AcpiNsValidateHandle (Handle); if (!Node) { (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); @@ -233,7 +233,7 @@ AcpiGetParent ( /* Convert and validate the handle */ - Node = AcpiNsMapHandleToNode (Handle); + Node = AcpiNsValidateHandle (Handle); if (!Node) { Status = AE_BAD_PARAMETER; @@ -243,7 +243,7 @@ AcpiGetParent ( /* Get the parent entry */ ParentNode = AcpiNsGetParentNode (Node); - *RetHandle = AcpiNsConvertEntryToHandle (ParentNode); + *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, ParentNode); /* Return exception if parent is null */ @@ -312,7 +312,7 @@ AcpiGetNextObject ( { /* Start search at the beginning of the specified scope */ - ParentNode = AcpiNsMapHandleToNode (Parent); + ParentNode = AcpiNsValidateHandle (Parent); if (!ParentNode) { Status = AE_BAD_PARAMETER; @@ -324,7 +324,7 @@ AcpiGetNextObject ( /* Non-null handle, ignore the parent */ /* Convert and validate the handle */ - ChildNode = AcpiNsMapHandleToNode (Child); + ChildNode = AcpiNsValidateHandle (Child); if (!ChildNode) { Status = AE_BAD_PARAMETER; @@ -343,7 +343,7 @@ AcpiGetNextObject ( if (RetHandle) { - *RetHandle = AcpiNsConvertEntryToHandle (Node); + *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, Node); } diff --git a/src/add-ons/kernel/bus_managers/acpi/parser/psargs.c b/src/add-ons/kernel/bus_managers/acpi/parser/psargs.c index 60d4a835b1..78127e5d4d 100644 --- a/src/add-ons/kernel/bus_managers/acpi/parser/psargs.c +++ b/src/add-ons/kernel/bus_managers/acpi/parser/psargs.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -514,7 +514,7 @@ AcpiPsGetNextSimpleArg ( /* Get 1 byte from the AML stream */ Opcode = AML_BYTE_OP; - Arg->Common.Value.Integer = (ACPI_INTEGER) *Aml; + Arg->Common.Value.Integer = (UINT64) *Aml; Length = 1; break; diff --git a/src/add-ons/kernel/bus_managers/acpi/parser/psloop.c b/src/add-ons/kernel/bus_managers/acpi/parser/psloop.c index fe9b7311a2..67f79261f3 100644 --- a/src/add-ons/kernel/bus_managers/acpi/parser/psloop.c +++ b/src/add-ons/kernel/bus_managers/acpi/parser/psloop.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -173,6 +173,7 @@ AcpiPsCompleteFinalOp ( static void AcpiPsLinkModuleCode ( + ACPI_PARSE_OBJECT *ParentOp, UINT8 *AmlStart, UINT32 AmlLength, ACPI_OWNER_ID OwnerId); @@ -593,7 +594,7 @@ AcpiPsGetArguments ( */ if (WalkState->PassNumber == ACPI_IMODE_LOAD_PASS1) { - AcpiPsLinkModuleCode (AmlOpStart, + AcpiPsLinkModuleCode (Op->Common.Parent, AmlOpStart, (UINT32) (WalkState->ParserState.PkgEnd - AmlOpStart), WalkState->OwnerId); } @@ -704,7 +705,8 @@ AcpiPsGetArguments ( * * FUNCTION: AcpiPsLinkModuleCode * - * PARAMETERS: AmlStart - Pointer to the AML + * PARAMETERS: ParentOp - Parent parser op + * AmlStart - Pointer to the AML * AmlLength - Length of executable AML * OwnerId - OwnerId of module level code * @@ -718,6 +720,7 @@ AcpiPsGetArguments ( static void AcpiPsLinkModuleCode ( + ACPI_PARSE_OBJECT *ParentOp, UINT8 *AmlStart, UINT32 AmlLength, ACPI_OWNER_ID OwnerId) @@ -725,6 +728,7 @@ AcpiPsLinkModuleCode ( ACPI_OPERAND_OBJECT *Prev; ACPI_OPERAND_OBJECT *Next; ACPI_OPERAND_OBJECT *MethodObj; + ACPI_NAMESPACE_NODE *ParentNode; /* Get the tail of the list */ @@ -751,11 +755,27 @@ AcpiPsLinkModuleCode ( return; } + if (ParentOp->Common.Node) + { + ParentNode = ParentOp->Common.Node; + } + else + { + ParentNode = AcpiGbl_RootNode; + } + MethodObj->Method.AmlStart = AmlStart; MethodObj->Method.AmlLength = AmlLength; MethodObj->Method.OwnerId = OwnerId; MethodObj->Method.Flags |= AOPOBJ_MODULE_LEVEL; + /* + * Save the parent node in NextObject. This is cheating, but we + * don't want to expand the method object. + */ + MethodObj->Method.NextObject = + ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, ParentNode); + if (!Prev) { AcpiGbl_ModuleCodeList = MethodObj; diff --git a/src/add-ons/kernel/bus_managers/acpi/parser/psopcode.c b/src/add-ons/kernel/bus_managers/acpi/parser/psopcode.c index d107c52370..e3e32ea555 100644 --- a/src/add-ons/kernel/bus_managers/acpi/parser/psopcode.c +++ b/src/add-ons/kernel/bus_managers/acpi/parser/psopcode.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/parser/psparse.c b/src/add-ons/kernel/bus_managers/acpi/parser/psparse.c index d9d6a2944b..4a1c29d2f4 100644 --- a/src/add-ons/kernel/bus_managers/acpi/parser/psparse.c +++ b/src/add-ons/kernel/bus_managers/acpi/parser/psparse.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -705,13 +705,11 @@ AcpiPsParseAml ( !PreviousWalkState->ImplicitReturnObj) { PreviousWalkState->ImplicitReturnObj = - AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); + AcpiUtCreateIntegerObject ((UINT64) 0); if (!PreviousWalkState->ImplicitReturnObj) { return_ACPI_STATUS (AE_NO_MEMORY); } - - PreviousWalkState->ImplicitReturnObj->Integer.Value = 0; } /* Restart the calling control method */ diff --git a/src/add-ons/kernel/bus_managers/acpi/parser/psscope.c b/src/add-ons/kernel/bus_managers/acpi/parser/psscope.c index 979dbb1515..bb7e149390 100644 --- a/src/add-ons/kernel/bus_managers/acpi/parser/psscope.c +++ b/src/add-ons/kernel/bus_managers/acpi/parser/psscope.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/parser/pstree.c b/src/add-ons/kernel/bus_managers/acpi/parser/pstree.c index 20ac405cac..6a425e9cf4 100644 --- a/src/add-ons/kernel/bus_managers/acpi/parser/pstree.c +++ b/src/add-ons/kernel/bus_managers/acpi/parser/pstree.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/parser/psutils.c b/src/add-ons/kernel/bus_managers/acpi/parser/psutils.c index 42f2b015d6..17be364a27 100644 --- a/src/add-ons/kernel/bus_managers/acpi/parser/psutils.c +++ b/src/add-ons/kernel/bus_managers/acpi/parser/psutils.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/parser/pswalk.c b/src/add-ons/kernel/bus_managers/acpi/parser/pswalk.c index d8d5f5e6f2..81310ba09f 100644 --- a/src/add-ons/kernel/bus_managers/acpi/parser/pswalk.c +++ b/src/add-ons/kernel/bus_managers/acpi/parser/pswalk.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/parser/psxface.c b/src/add-ons/kernel/bus_managers/acpi/parser/psxface.c index 1859b69214..b34d9859af 100644 --- a/src/add-ons/kernel/bus_managers/acpi/parser/psxface.c +++ b/src/add-ons/kernel/bus_managers/acpi/parser/psxface.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -403,7 +403,7 @@ AcpiPsExecuteMethod ( if (Info->ObjDesc->Method.MethodFlags & AML_METHOD_INTERNAL_ONLY) { - Status = Info->ObjDesc->Method.Implementation (WalkState); + Status = Info->ObjDesc->Method.Extra.Implementation (WalkState); Info->ReturnObject = WalkState->ReturnDesc; /* Cleanup states */ @@ -422,15 +422,13 @@ AcpiPsExecuteMethod ( if (AcpiGbl_EnableInterpreterSlack) { WalkState->ImplicitReturnObj = - AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); + AcpiUtCreateIntegerObject ((UINT64) 0); if (!WalkState->ImplicitReturnObj) { Status = AE_NO_MEMORY; AcpiDsDeleteWalkState (WalkState); goto Cleanup; } - - WalkState->ImplicitReturnObj->Integer.Value = 0; } /* Parse the AML */ diff --git a/src/add-ons/kernel/bus_managers/acpi/resources/rsaddr.c b/src/add-ons/kernel/bus_managers/acpi/resources/rsaddr.c index f2f3c4421f..eeed1dffdb 100644 --- a/src/add-ons/kernel/bus_managers/acpi/resources/rsaddr.c +++ b/src/add-ons/kernel/bus_managers/acpi/resources/rsaddr.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/resources/rscalc.c b/src/add-ons/kernel/bus_managers/acpi/resources/rscalc.c index 76aa44ff83..3215c9ecdb 100644 --- a/src/add-ons/kernel/bus_managers/acpi/resources/rscalc.c +++ b/src/add-ons/kernel/bus_managers/acpi/resources/rscalc.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/resources/rscreate.c b/src/add-ons/kernel/bus_managers/acpi/resources/rscreate.c index e9c840b64e..c2929aa430 100644 --- a/src/add-ons/kernel/bus_managers/acpi/resources/rscreate.c +++ b/src/add-ons/kernel/bus_managers/acpi/resources/rscreate.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -270,7 +270,7 @@ AcpiRsCreatePciRoutingTable ( /* * Loop through the ACPI_INTERNAL_OBJECTS - Each object should be a - * package that in turn contains an ACPI_INTEGER Address, a UINT8 Pin, + * package that in turn contains an UINT64 Address, a UINT8 Pin, * a Name, and a UINT8 SourceIndex. */ TopObjectList = PackageObject->Package.Elements; diff --git a/src/add-ons/kernel/bus_managers/acpi/resources/rsdump.c b/src/add-ons/kernel/bus_managers/acpi/resources/rsdump.c index 62db284c6f..3c1275f52f 100644 --- a/src/add-ons/kernel/bus_managers/acpi/resources/rsdump.c +++ b/src/add-ons/kernel/bus_managers/acpi/resources/rsdump.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/resources/rsinfo.c b/src/add-ons/kernel/bus_managers/acpi/resources/rsinfo.c index abf79943d9..8f6aa0aa35 100644 --- a/src/add-ons/kernel/bus_managers/acpi/resources/rsinfo.c +++ b/src/add-ons/kernel/bus_managers/acpi/resources/rsinfo.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/resources/rsio.c b/src/add-ons/kernel/bus_managers/acpi/resources/rsio.c index fb9213dd72..a29c655c48 100644 --- a/src/add-ons/kernel/bus_managers/acpi/resources/rsio.c +++ b/src/add-ons/kernel/bus_managers/acpi/resources/rsio.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/resources/rsirq.c b/src/add-ons/kernel/bus_managers/acpi/resources/rsirq.c index 7eab435139..21120f6edb 100644 --- a/src/add-ons/kernel/bus_managers/acpi/resources/rsirq.c +++ b/src/add-ons/kernel/bus_managers/acpi/resources/rsirq.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/resources/rslist.c b/src/add-ons/kernel/bus_managers/acpi/resources/rslist.c index 3adce2b393..8d31a91519 100644 --- a/src/add-ons/kernel/bus_managers/acpi/resources/rslist.c +++ b/src/add-ons/kernel/bus_managers/acpi/resources/rslist.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/resources/rsmemory.c b/src/add-ons/kernel/bus_managers/acpi/resources/rsmemory.c index a3d08c01a1..f4d1cca436 100644 --- a/src/add-ons/kernel/bus_managers/acpi/resources/rsmemory.c +++ b/src/add-ons/kernel/bus_managers/acpi/resources/rsmemory.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/resources/rsmisc.c b/src/add-ons/kernel/bus_managers/acpi/resources/rsmisc.c index 3565334e73..ecea3e0c1a 100644 --- a/src/add-ons/kernel/bus_managers/acpi/resources/rsmisc.c +++ b/src/add-ons/kernel/bus_managers/acpi/resources/rsmisc.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/resources/rsutils.c b/src/add-ons/kernel/bus_managers/acpi/resources/rsutils.c index 4e0f04ce8e..b5c2ab5a73 100644 --- a/src/add-ons/kernel/bus_managers/acpi/resources/rsutils.c +++ b/src/add-ons/kernel/bus_managers/acpi/resources/rsutils.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/resources/rsxface.c b/src/add-ons/kernel/bus_managers/acpi/resources/rsxface.c index 32ed559569..2a019d1844 100644 --- a/src/add-ons/kernel/bus_managers/acpi/resources/rsxface.c +++ b/src/add-ons/kernel/bus_managers/acpi/resources/rsxface.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -191,7 +191,7 @@ AcpiRsValidateParameters ( return_ACPI_STATUS (AE_BAD_PARAMETER); } - Node = AcpiNsMapHandleToNode (DeviceHandle); + Node = AcpiNsValidateHandle (DeviceHandle); if (!Node) { return_ACPI_STATUS (AE_BAD_PARAMETER); diff --git a/src/add-ons/kernel/bus_managers/acpi/tables/tbfadt.c b/src/add-ons/kernel/bus_managers/acpi/tables/tbfadt.c index c657a0b75a..b6d32f3cc1 100644 --- a/src/add-ons/kernel/bus_managers/acpi/tables/tbfadt.c +++ b/src/add-ons/kernel/bus_managers/acpi/tables/tbfadt.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/tables/tbfind.c b/src/add-ons/kernel/bus_managers/acpi/tables/tbfind.c index 1838b5eb78..e1c110f452 100644 --- a/src/add-ons/kernel/bus_managers/acpi/tables/tbfind.c +++ b/src/add-ons/kernel/bus_managers/acpi/tables/tbfind.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/tables/tbinstal.c b/src/add-ons/kernel/bus_managers/acpi/tables/tbinstal.c index c911f84f68..78cf164a99 100644 --- a/src/add-ons/kernel/bus_managers/acpi/tables/tbinstal.c +++ b/src/add-ons/kernel/bus_managers/acpi/tables/tbinstal.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/tables/tbutils.c b/src/add-ons/kernel/bus_managers/acpi/tables/tbutils.c index ec2a88e283..0959ab25a5 100644 --- a/src/add-ons/kernel/bus_managers/acpi/tables/tbutils.c +++ b/src/add-ons/kernel/bus_managers/acpi/tables/tbutils.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/tables/tbxface.c b/src/add-ons/kernel/bus_managers/acpi/tables/tbxface.c index 4c12916c5a..6a4f413d04 100644 --- a/src/add-ons/kernel/bus_managers/acpi/tables/tbxface.c +++ b/src/add-ons/kernel/bus_managers/acpi/tables/tbxface.c @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/tables/tbxfroot.c b/src/add-ons/kernel/bus_managers/acpi/tables/tbxfroot.c index e0a571f36f..4f0ab81084 100644 --- a/src/add-ons/kernel/bus_managers/acpi/tables/tbxfroot.c +++ b/src/add-ons/kernel/bus_managers/acpi/tables/tbxfroot.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utalloc.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utalloc.c index a66b94005c..f72959a4d8 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utalloc.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utalloc.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utcache.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utcache.c index aabc0a2305..2cee9a13ce 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utcache.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utcache.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utclib.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utclib.c index a9b8122fab..fd7796fee5 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utclib.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utclib.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utcopy.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utcopy.c index 20a0e34324..fe44083c59 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utcopy.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utcopy.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -422,11 +422,11 @@ AcpiUtCopyIelementToEelement ( * RETURN: Status * * DESCRIPTION: This function is called to place a package object in a user - * buffer. A package object by definition contains other objects. + * buffer. A package object by definition contains other objects. * * The buffer is assumed to have sufficient space for the object. - * The caller must have verified the buffer length needed using the - * AcpiUtGetObjectSize function before calling this function. + * The caller must have verified the buffer length needed using + * the AcpiUtGetObjectSize function before calling this function. * ******************************************************************************/ @@ -485,12 +485,12 @@ AcpiUtCopyIpackageToEpackage ( * FUNCTION: AcpiUtCopyIobjectToEobject * * PARAMETERS: InternalObject - The internal object to be converted - * BufferPtr - Where the object is returned + * RetBuffer - Where the object is returned * * RETURN: Status * - * DESCRIPTION: This function is called to build an API object to be returned to - * the caller. + * DESCRIPTION: This function is called to build an API object to be returned + * to the caller. * ******************************************************************************/ @@ -742,7 +742,7 @@ AcpiUtCopyEpackageToIpackage ( * PARAMETERS: ExternalObject - The external object to be converted * InternalObject - Where the internal object is returned * - * RETURN: Status - the status of the call + * RETURN: Status * * DESCRIPTION: Converts an external object to an internal object. * @@ -784,7 +784,7 @@ AcpiUtCopyEobjectToIobject ( * * RETURN: Status * - * DESCRIPTION: Simple copy of one internal object to another. Reference count + * DESCRIPTION: Simple copy of one internal object to another. Reference count * of the destination object is preserved. * ******************************************************************************/ @@ -1034,10 +1034,11 @@ ErrorExit: * * FUNCTION: AcpiUtCopyIpackageToIpackage * - * PARAMETERS: *SourceObj - Pointer to the source package object - * *DestObj - Where the internal object is returned + * PARAMETERS: SourceObj - Pointer to the source package object + * DestObj - Where the internal object is returned + * WalkState - Current Walk state descriptor * - * RETURN: Status - the status of the call + * RETURN: Status * * DESCRIPTION: This function is called to copy an internal package object * into another internal package object. @@ -1093,9 +1094,9 @@ AcpiUtCopyIpackageToIpackage ( * * FUNCTION: AcpiUtCopyIobjectToIobject * - * PARAMETERS: WalkState - Current walk state - * SourceDesc - The internal object to be copied + * PARAMETERS: SourceDesc - The internal object to be copied * DestDesc - Where the copied object is returned + * WalkState - Current walk state * * RETURN: Status * diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utdebug.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utdebug.c index 3901b07d19..0a91716f24 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utdebug.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utdebug.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -598,7 +598,7 @@ AcpiUtValueExit ( const char *FunctionName, const char *ModuleName, UINT32 ComponentId, - ACPI_INTEGER Value) + UINT64 Value) { AcpiDebugPrint (ACPI_LV_FUNCTIONS, diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utdelete.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utdelete.c index bf30aee74e..31bf40b4e7 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utdelete.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utdelete.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/uteval.c b/src/add-ons/kernel/bus_managers/acpi/utilities/uteval.c index ecb0cf19a7..c959d44bb5 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/uteval.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/uteval.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -423,7 +423,7 @@ ACPI_STATUS AcpiUtEvaluateNumericObject ( char *ObjectName, ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_INTEGER *Value) + UINT64 *Value) { ACPI_OPERAND_OBJECT *ObjDesc; ACPI_STATUS Status; diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utglobal.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utglobal.c index b61b3fb5ba..236d811714 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utglobal.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utglobal.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -331,7 +331,7 @@ static const char AcpiGbl_HexToAscii[] = char AcpiUtHexToAsciiChar ( - ACPI_INTEGER Integer, + UINT64 Integer, UINT32 Position) { @@ -949,6 +949,10 @@ AcpiUtInitGlobals ( AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST; +#ifdef ACPI_DISASSEMBLER + AcpiGbl_ExternalList = NULL; +#endif + #ifdef ACPI_DEBUG_OUTPUT AcpiGbl_LowestStackPointer = ACPI_CAST_PTR (ACPI_SIZE, ACPI_SIZE_MAX); #endif diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utids.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utids.c index 7669330500..ee7b19d885 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utids.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utids.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utinit.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utinit.c index d59904b46a..767c5623ef 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utinit.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utinit.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utlock.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utlock.c index dd4e100001..e17ca3e7d7 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utlock.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utlock.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utmath.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utmath.c index b0a40ff2bc..54d492f234 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utmath.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utmath.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -149,9 +149,9 @@ ACPI_STATUS AcpiUtShortDivide ( - ACPI_INTEGER Dividend, + UINT64 Dividend, UINT32 Divisor, - ACPI_INTEGER *OutQuotient, + UINT64 *OutQuotient, UINT32 *OutRemainder) { UINT64_OVERLAY DividendOvl; @@ -213,10 +213,10 @@ AcpiUtShortDivide ( ACPI_STATUS AcpiUtDivide ( - ACPI_INTEGER InDividend, - ACPI_INTEGER InDivisor, - ACPI_INTEGER *OutQuotient, - ACPI_INTEGER *OutRemainder) + UINT64 InDividend, + UINT64 InDivisor, + UINT64 *OutQuotient, + UINT64 *OutRemainder) { UINT64_OVERLAY Dividend; UINT64_OVERLAY Divisor; @@ -293,8 +293,8 @@ AcpiUtDivide ( * The 64-bit remainder must be generated. */ Partial1 = Quotient.Part.Lo * Divisor.Part.Hi; - Partial2.Full = (ACPI_INTEGER) Quotient.Part.Lo * Divisor.Part.Lo; - Partial3.Full = (ACPI_INTEGER) Partial2.Part.Hi + Partial1; + Partial2.Full = (UINT64) Quotient.Part.Lo * Divisor.Part.Lo; + Partial3.Full = (UINT64) Partial2.Part.Hi + Partial1; Remainder.Part.Hi = Partial3.Part.Lo; Remainder.Part.Lo = Partial2.Part.Lo; @@ -362,9 +362,9 @@ AcpiUtDivide ( ACPI_STATUS AcpiUtShortDivide ( - ACPI_INTEGER InDividend, + UINT64 InDividend, UINT32 Divisor, - ACPI_INTEGER *OutQuotient, + UINT64 *OutQuotient, UINT32 *OutRemainder) { @@ -395,10 +395,10 @@ AcpiUtShortDivide ( ACPI_STATUS AcpiUtDivide ( - ACPI_INTEGER InDividend, - ACPI_INTEGER InDivisor, - ACPI_INTEGER *OutQuotient, - ACPI_INTEGER *OutRemainder) + UINT64 InDividend, + UINT64 InDivisor, + UINT64 *OutQuotient, + UINT64 *OutRemainder) { ACPI_FUNCTION_TRACE (UtDivide); diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utmisc.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utmisc.c index 89e1addba6..37b15e2c4c 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utmisc.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utmisc.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -929,12 +929,12 @@ ACPI_STATUS AcpiUtStrtoul64 ( char *String, UINT32 Base, - ACPI_INTEGER *RetInteger) + UINT64 *RetInteger) { UINT32 ThisDigit = 0; - ACPI_INTEGER ReturnValue = 0; - ACPI_INTEGER Quotient; - ACPI_INTEGER Dividend; + UINT64 ReturnValue = 0; + UINT64 Quotient; + UINT64 Dividend; UINT32 ToIntegerOp = (Base == ACPI_ANY_BASE); UINT32 Mode32 = (AcpiGbl_IntegerByteWidth == 4); UINT8 ValidDigits = 0; @@ -1071,7 +1071,7 @@ AcpiUtStrtoul64 ( /* Divide the digit into the correct position */ - (void) AcpiUtShortDivide ((Dividend - (ACPI_INTEGER) ThisDigit), + (void) AcpiUtShortDivide ((Dividend - (UINT64) ThisDigit), Base, &Quotient, NULL); if (ReturnValue > Quotient) @@ -1435,3 +1435,51 @@ AcpiUtPredefinedWarning ( ACPI_COMMON_MSG_SUFFIX; va_end (args); } + +/******************************************************************************* + * + * FUNCTION: AcpiUtPredefinedInfo + * + * PARAMETERS: ModuleName - Caller's module name (for error output) + * LineNumber - Caller's line number (for error output) + * Pathname - Full pathname to the node + * NodeFlags - From Namespace node for the method/object + * Format - Printf format string + additional args + * + * RETURN: None + * + * DESCRIPTION: Info messages for the predefined validation module. Messages + * are only emitted the first time a problem with a particular + * method/object is detected. This prevents a flood of + * messages for methods that are repeatedly evaluated. + * + ******************************************************************************/ + +void ACPI_INTERNAL_VAR_XFACE +AcpiUtPredefinedInfo ( + const char *ModuleName, + UINT32 LineNumber, + char *Pathname, + UINT8 NodeFlags, + const char *Format, + ...) +{ + va_list args; + + + /* + * Warning messages for this method/object will be disabled after the + * first time a validation fails or an object is successfully repaired. + */ + if (NodeFlags & ANOBJ_EVALUATED) + { + return; + } + + AcpiOsPrintf ("ACPI Info for %s: ", Pathname); + + va_start (args, Format); + AcpiOsVprintf (Format, args); + ACPI_COMMON_MSG_SUFFIX; + va_end (args); +} diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utmutex.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utmutex.c index f6e7cc3652..9e0ed3b713 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utmutex.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utmutex.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -128,7 +128,7 @@ static ACPI_STATUS AcpiUtCreateMutex ( ACPI_MUTEX_HANDLE MutexId); -static ACPI_STATUS +static void AcpiUtDeleteMutex ( ACPI_MUTEX_HANDLE MutexId); @@ -216,7 +216,7 @@ AcpiUtMutexTerminate ( for (i = 0; i < ACPI_NUM_MUTEX; i++) { - (void) AcpiUtDeleteMutex (i); + AcpiUtDeleteMutex (i); } /* Delete the spinlocks */ @@ -253,11 +253,6 @@ AcpiUtCreateMutex ( ACPI_FUNCTION_TRACE_U32 (UtCreateMutex, MutexId); - if (MutexId > ACPI_MAX_MUTEX) - { - return_ACPI_STATUS (AE_BAD_PARAMETER); - } - if (!AcpiGbl_MutexInfo[MutexId].Mutex) { Status = AcpiOsCreateMutex (&AcpiGbl_MutexInfo[MutexId].Mutex); @@ -281,7 +276,7 @@ AcpiUtCreateMutex ( * ******************************************************************************/ -static ACPI_STATUS +static void AcpiUtDeleteMutex ( ACPI_MUTEX_HANDLE MutexId) { @@ -289,17 +284,10 @@ AcpiUtDeleteMutex ( ACPI_FUNCTION_TRACE_U32 (UtDeleteMutex, MutexId); - if (MutexId > ACPI_MAX_MUTEX) - { - return_ACPI_STATUS (AE_BAD_PARAMETER); - } - AcpiOsDeleteMutex (AcpiGbl_MutexInfo[MutexId].Mutex); AcpiGbl_MutexInfo[MutexId].Mutex = NULL; AcpiGbl_MutexInfo[MutexId].ThreadId = ACPI_MUTEX_NOT_ACQUIRED; - - return_ACPI_STATUS (AE_OK); } diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utobject.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utobject.c index e38d2b2879..fabed520c7 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utobject.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utobject.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License @@ -279,6 +279,41 @@ AcpiUtCreatePackageObject ( } +/******************************************************************************* + * + * FUNCTION: AcpiUtCreateIntegerObject + * + * PARAMETERS: InitialValue - Initial value for the integer + * + * RETURN: Pointer to a new Integer object, null on failure + * + * DESCRIPTION: Create an initialized integer object + * + ******************************************************************************/ + +ACPI_OPERAND_OBJECT * +AcpiUtCreateIntegerObject ( + UINT64 InitialValue) +{ + ACPI_OPERAND_OBJECT *IntegerDesc; + + + ACPI_FUNCTION_TRACE (UtCreateIntegerObject); + + + /* Create and initialize a new integer object */ + + IntegerDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); + if (!IntegerDesc) + { + return_PTR (NULL); + } + + IntegerDesc->Integer.Value = InitialValue; + return_PTR (IntegerDesc); +} + + /******************************************************************************* * * FUNCTION: AcpiUtCreateBufferObject diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utresrc.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utresrc.c index 2f19d63986..02bb1dbfe6 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utresrc.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utresrc.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utstate.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utstate.c index 245ca02bfc..08218d11c9 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utstate.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utstate.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/uttrack.c b/src/add-ons/kernel/bus_managers/acpi/utilities/uttrack.c index d712c1a3e5..500ed45824 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/uttrack.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/uttrack.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License diff --git a/src/add-ons/kernel/bus_managers/acpi/utilities/utxface.c b/src/add-ons/kernel/bus_managers/acpi/utilities/utxface.c index ba57f4922b..f59a08dba4 100644 --- a/src/add-ons/kernel/bus_managers/acpi/utilities/utxface.c +++ b/src/add-ons/kernel/bus_managers/acpi/utilities/utxface.c @@ -8,7 +8,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. * All rights reserved. * * 2. License