Property changes on: usr.sbin/acpi ___________________________________________________________________ Modified: svn:mergeinfo Merged /head/usr.sbin/acpi:r197106,198237,199337,202771 Index: usr.sbin/acpi/acpidb/acpidb.c =================================================================== --- usr.sbin/acpi/acpidb/acpidb.c (revision 203510) +++ usr.sbin/acpi/acpidb/acpidb.c (working copy) @@ -81,7 +81,7 @@ static int aml_simulate_regcontent_write(int regtype, ACPI_PHYSICAL_ADDRESS addr, UINT8 *valuep); -static ACPI_INTEGER aml_simulate_prompt(char *msg, ACPI_INTEGER def_val); +static UINT64 aml_simulate_prompt(char *msg, UINT64 def_val); static void aml_simulation_regload(const char *dumpfile); static void aml_simulation_regdump(const char *dumpfile); @@ -161,11 +161,11 @@ return (aml_simulate_regcontent_add(regtype, addr, *valuep)); } -static ACPI_INTEGER -aml_simulate_prompt(char *msg, ACPI_INTEGER def_val) +static UINT64 +aml_simulate_prompt(char *msg, UINT64 def_val) { char buf[16], *ep; - ACPI_INTEGER val; + UINT64 val; val = def_val; printf("DEBUG"); @@ -271,12 +271,12 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, int Prompt) { int state; UINT8 val; - ACPI_INTEGER value, i; + UINT64 value, i; char msg[256]; static const char *space_names[] = { "SYSTEM_MEMORY", "SYSTEM_IO", "PCI_CONFIG", @@ -336,7 +336,7 @@ UINT32 Function, \ ACPI_PHYSICAL_ADDRESS Address, \ UINT32 BitWidth, \ - ACPI_INTEGER *Value) \ + UINT64 *Value) \ { \ return (aml_vm_space_handler(id, Function, Address, \ BitWidth, Value, aml_debug_prompt)); \ Index: usr.sbin/acpi/acpidb/Makefile =================================================================== --- usr.sbin/acpi/acpidb/Makefile (revision 203510) +++ usr.sbin/acpi/acpidb/Makefile (working copy) @@ -38,8 +38,8 @@ # namespace SRCS+= nsaccess.c nsalloc.c nsdump.c nseval.c nsinit.c \ nsload.c nsnames.c nsobject.c nsparse.c nspredef.c \ - nssearch.c nsutils.c nswalk.c nsxfeval.c nsxfname.c \ - nsxfobj.c + nsrepair.c nsrepair2.c nssearch.c nsutils.c nswalk.c \ + nsxfeval.c nsxfname.c nsxfobj.c # resources SRCS+= rsaddr.c rscalc.c rscreate.c rsdump.c rsinfo.c \ @@ -52,9 +52,9 @@ # utilities SRCS+= utalloc.c utcache.c utcopy.c utdebug.c utdelete.c \ - uteval.c utglobal.c utinit.c utlock.c utmath.c utmisc.c \ - utmutex.c utobject.c utresrc.c utstate.c uttrack.c \ - utxface.c + uteval.c utglobal.c utids.c utinit.c utlock.c utmath.c \ + utmisc.c utmutex.c utobject.c utresrc.c utstate.c \ + uttrack.c utxface.c MAN= acpidb.8 WARNS?= 2 Index: usr.sbin/acpi/iasl/Makefile =================================================================== --- usr.sbin/acpi/iasl/Makefile (revision 203510) +++ usr.sbin/acpi/iasl/Makefile (working copy) @@ -5,7 +5,8 @@ SRCS+= osunixxf.c # common -SRCS+= dmrestag.c dmtable.c dmtbdump.c dmtbinfo.c getopt.c +SRCS+= dmextern.c dmrestag.c dmtable.c dmtbdump.c dmtbinfo.c \ + getopt.c # compiler SRCS+= aslanalyze.c aslcodegen.c aslcompile.c aslcompiler.y.h \ Property changes on: sys ___________________________________________________________________ Modified: svn:mergeinfo Merged /head/sys:r197104-197105,197107,197688,198237,199337-199338,200553-200554,202771,202773 Index: sys/conf/files =================================================================== --- sys/conf/files (revision 203510) +++ sys/conf/files (working copy) @@ -171,105 +171,108 @@ contrib/dev/acpica/dispatcher/dswload.c optional acpi contrib/dev/acpica/dispatcher/dswscope.c optional acpi contrib/dev/acpica/dispatcher/dswstate.c optional acpi -contrib/dev/acpica/events/evevent.c optional acpi -contrib/dev/acpica/events/evgpe.c optional acpi -contrib/dev/acpica/events/evgpeblk.c optional acpi -contrib/dev/acpica/events/evmisc.c optional acpi -contrib/dev/acpica/events/evregion.c optional acpi -contrib/dev/acpica/events/evrgnini.c optional acpi -contrib/dev/acpica/events/evsci.c optional acpi -contrib/dev/acpica/events/evxface.c optional acpi -contrib/dev/acpica/events/evxfevnt.c optional acpi -contrib/dev/acpica/events/evxfregn.c optional acpi -contrib/dev/acpica/executer/exconfig.c optional acpi -contrib/dev/acpica/executer/exconvrt.c optional acpi -contrib/dev/acpica/executer/excreate.c optional acpi -contrib/dev/acpica/executer/exdump.c optional acpi -contrib/dev/acpica/executer/exfield.c optional acpi -contrib/dev/acpica/executer/exfldio.c optional acpi -contrib/dev/acpica/executer/exmisc.c optional acpi -contrib/dev/acpica/executer/exmutex.c optional acpi -contrib/dev/acpica/executer/exnames.c optional acpi -contrib/dev/acpica/executer/exoparg1.c optional acpi -contrib/dev/acpica/executer/exoparg2.c optional acpi -contrib/dev/acpica/executer/exoparg3.c optional acpi -contrib/dev/acpica/executer/exoparg6.c optional acpi -contrib/dev/acpica/executer/exprep.c optional acpi -contrib/dev/acpica/executer/exregion.c optional acpi -contrib/dev/acpica/executer/exresnte.c optional acpi -contrib/dev/acpica/executer/exresolv.c optional acpi -contrib/dev/acpica/executer/exresop.c optional acpi -contrib/dev/acpica/executer/exstore.c optional acpi -contrib/dev/acpica/executer/exstoren.c optional acpi -contrib/dev/acpica/executer/exstorob.c optional acpi -contrib/dev/acpica/executer/exsystem.c optional acpi -contrib/dev/acpica/executer/exutils.c optional acpi -contrib/dev/acpica/hardware/hwacpi.c optional acpi -contrib/dev/acpica/hardware/hwgpe.c optional acpi -contrib/dev/acpica/hardware/hwregs.c optional acpi -contrib/dev/acpica/hardware/hwsleep.c optional acpi -contrib/dev/acpica/hardware/hwtimer.c optional acpi -contrib/dev/acpica/hardware/hwvalid.c optional acpi -contrib/dev/acpica/hardware/hwxface.c optional acpi -contrib/dev/acpica/namespace/nsaccess.c optional acpi -contrib/dev/acpica/namespace/nsalloc.c optional acpi -contrib/dev/acpica/namespace/nsdump.c optional acpi -contrib/dev/acpica/namespace/nseval.c optional acpi -contrib/dev/acpica/namespace/nsinit.c optional acpi -contrib/dev/acpica/namespace/nsload.c optional acpi -contrib/dev/acpica/namespace/nsnames.c optional acpi -contrib/dev/acpica/namespace/nsobject.c optional acpi -contrib/dev/acpica/namespace/nsparse.c optional acpi -contrib/dev/acpica/namespace/nspredef.c optional acpi -contrib/dev/acpica/namespace/nssearch.c optional acpi -contrib/dev/acpica/namespace/nsutils.c optional acpi -contrib/dev/acpica/namespace/nswalk.c optional acpi -contrib/dev/acpica/namespace/nsxfeval.c optional acpi -contrib/dev/acpica/namespace/nsxfname.c optional acpi -contrib/dev/acpica/namespace/nsxfobj.c optional acpi -contrib/dev/acpica/parser/psargs.c optional acpi -contrib/dev/acpica/parser/psloop.c optional acpi -contrib/dev/acpica/parser/psopcode.c optional acpi -contrib/dev/acpica/parser/psparse.c optional acpi -contrib/dev/acpica/parser/psscope.c optional acpi -contrib/dev/acpica/parser/pstree.c optional acpi -contrib/dev/acpica/parser/psutils.c optional acpi -contrib/dev/acpica/parser/pswalk.c optional acpi -contrib/dev/acpica/parser/psxface.c optional acpi -contrib/dev/acpica/resources/rsaddr.c optional acpi -contrib/dev/acpica/resources/rscalc.c optional acpi -contrib/dev/acpica/resources/rscreate.c optional acpi -contrib/dev/acpica/resources/rsdump.c optional acpi -contrib/dev/acpica/resources/rsinfo.c optional acpi -contrib/dev/acpica/resources/rsio.c optional acpi -contrib/dev/acpica/resources/rsirq.c optional acpi -contrib/dev/acpica/resources/rslist.c optional acpi -contrib/dev/acpica/resources/rsmemory.c optional acpi -contrib/dev/acpica/resources/rsmisc.c optional acpi -contrib/dev/acpica/resources/rsutils.c optional acpi -contrib/dev/acpica/resources/rsxface.c optional acpi -contrib/dev/acpica/tables/tbfadt.c optional acpi -contrib/dev/acpica/tables/tbfind.c optional acpi -contrib/dev/acpica/tables/tbinstal.c optional acpi -contrib/dev/acpica/tables/tbutils.c optional acpi -contrib/dev/acpica/tables/tbxface.c optional acpi -contrib/dev/acpica/tables/tbxfroot.c optional acpi -contrib/dev/acpica/utilities/utalloc.c optional acpi -contrib/dev/acpica/utilities/utcache.c optional acpi -contrib/dev/acpica/utilities/utcopy.c optional acpi -contrib/dev/acpica/utilities/utdebug.c optional acpi -contrib/dev/acpica/utilities/utdelete.c optional acpi -contrib/dev/acpica/utilities/uteval.c optional acpi -contrib/dev/acpica/utilities/utglobal.c optional acpi -contrib/dev/acpica/utilities/utinit.c optional acpi -contrib/dev/acpica/utilities/utlock.c optional acpi -contrib/dev/acpica/utilities/utmath.c optional acpi -contrib/dev/acpica/utilities/utmisc.c optional acpi -contrib/dev/acpica/utilities/utmutex.c optional acpi -contrib/dev/acpica/utilities/utobject.c optional acpi -contrib/dev/acpica/utilities/utresrc.c optional acpi -contrib/dev/acpica/utilities/utstate.c optional acpi -contrib/dev/acpica/utilities/utxface.c optional acpi +contrib/dev/acpica/events/evevent.c optional acpi +contrib/dev/acpica/events/evgpe.c optional acpi +contrib/dev/acpica/events/evgpeblk.c optional acpi +contrib/dev/acpica/events/evmisc.c optional acpi +contrib/dev/acpica/events/evregion.c optional acpi +contrib/dev/acpica/events/evrgnini.c optional acpi +contrib/dev/acpica/events/evsci.c optional acpi +contrib/dev/acpica/events/evxface.c optional acpi +contrib/dev/acpica/events/evxfevnt.c optional acpi +contrib/dev/acpica/events/evxfregn.c optional acpi +contrib/dev/acpica/executer/exconfig.c optional acpi +contrib/dev/acpica/executer/exconvrt.c optional acpi +contrib/dev/acpica/executer/excreate.c optional acpi +contrib/dev/acpica/executer/exdump.c optional acpi +contrib/dev/acpica/executer/exfield.c optional acpi +contrib/dev/acpica/executer/exfldio.c optional acpi +contrib/dev/acpica/executer/exmisc.c optional acpi +contrib/dev/acpica/executer/exmutex.c optional acpi +contrib/dev/acpica/executer/exnames.c optional acpi +contrib/dev/acpica/executer/exoparg1.c optional acpi +contrib/dev/acpica/executer/exoparg2.c optional acpi +contrib/dev/acpica/executer/exoparg3.c optional acpi +contrib/dev/acpica/executer/exoparg6.c optional acpi +contrib/dev/acpica/executer/exprep.c optional acpi +contrib/dev/acpica/executer/exregion.c optional acpi +contrib/dev/acpica/executer/exresnte.c optional acpi +contrib/dev/acpica/executer/exresolv.c optional acpi +contrib/dev/acpica/executer/exresop.c optional acpi +contrib/dev/acpica/executer/exstore.c optional acpi +contrib/dev/acpica/executer/exstoren.c optional acpi +contrib/dev/acpica/executer/exstorob.c optional acpi +contrib/dev/acpica/executer/exsystem.c optional acpi +contrib/dev/acpica/executer/exutils.c optional acpi +contrib/dev/acpica/hardware/hwacpi.c optional acpi +contrib/dev/acpica/hardware/hwgpe.c optional acpi +contrib/dev/acpica/hardware/hwregs.c optional acpi +contrib/dev/acpica/hardware/hwsleep.c optional acpi +contrib/dev/acpica/hardware/hwtimer.c optional acpi +contrib/dev/acpica/hardware/hwvalid.c optional acpi +contrib/dev/acpica/hardware/hwxface.c optional acpi +contrib/dev/acpica/namespace/nsaccess.c optional acpi +contrib/dev/acpica/namespace/nsalloc.c optional acpi +contrib/dev/acpica/namespace/nsdump.c optional acpi +contrib/dev/acpica/namespace/nseval.c optional acpi +contrib/dev/acpica/namespace/nsinit.c optional acpi +contrib/dev/acpica/namespace/nsload.c optional acpi +contrib/dev/acpica/namespace/nsnames.c optional acpi +contrib/dev/acpica/namespace/nsobject.c optional acpi +contrib/dev/acpica/namespace/nsparse.c optional acpi +contrib/dev/acpica/namespace/nspredef.c optional acpi +contrib/dev/acpica/namespace/nsrepair.c optional acpi +contrib/dev/acpica/namespace/nsrepair2.c optional acpi +contrib/dev/acpica/namespace/nssearch.c optional acpi +contrib/dev/acpica/namespace/nsutils.c optional acpi +contrib/dev/acpica/namespace/nswalk.c optional acpi +contrib/dev/acpica/namespace/nsxfeval.c optional acpi +contrib/dev/acpica/namespace/nsxfname.c optional acpi +contrib/dev/acpica/namespace/nsxfobj.c optional acpi +contrib/dev/acpica/parser/psargs.c optional acpi +contrib/dev/acpica/parser/psloop.c optional acpi +contrib/dev/acpica/parser/psopcode.c optional acpi +contrib/dev/acpica/parser/psparse.c optional acpi +contrib/dev/acpica/parser/psscope.c optional acpi +contrib/dev/acpica/parser/pstree.c optional acpi +contrib/dev/acpica/parser/psutils.c optional acpi +contrib/dev/acpica/parser/pswalk.c optional acpi +contrib/dev/acpica/parser/psxface.c optional acpi +contrib/dev/acpica/resources/rsaddr.c optional acpi +contrib/dev/acpica/resources/rscalc.c optional acpi +contrib/dev/acpica/resources/rscreate.c optional acpi +contrib/dev/acpica/resources/rsdump.c optional acpi +contrib/dev/acpica/resources/rsinfo.c optional acpi +contrib/dev/acpica/resources/rsio.c optional acpi +contrib/dev/acpica/resources/rsirq.c optional acpi +contrib/dev/acpica/resources/rslist.c optional acpi +contrib/dev/acpica/resources/rsmemory.c optional acpi +contrib/dev/acpica/resources/rsmisc.c optional acpi +contrib/dev/acpica/resources/rsutils.c optional acpi +contrib/dev/acpica/resources/rsxface.c optional acpi +contrib/dev/acpica/tables/tbfadt.c optional acpi +contrib/dev/acpica/tables/tbfind.c optional acpi +contrib/dev/acpica/tables/tbinstal.c optional acpi +contrib/dev/acpica/tables/tbutils.c optional acpi +contrib/dev/acpica/tables/tbxface.c optional acpi +contrib/dev/acpica/tables/tbxfroot.c optional acpi +contrib/dev/acpica/utilities/utalloc.c optional acpi +contrib/dev/acpica/utilities/utcache.c optional acpi +contrib/dev/acpica/utilities/utcopy.c optional acpi +contrib/dev/acpica/utilities/utdebug.c optional acpi +contrib/dev/acpica/utilities/utdelete.c optional acpi +contrib/dev/acpica/utilities/uteval.c optional acpi +contrib/dev/acpica/utilities/utglobal.c optional acpi +contrib/dev/acpica/utilities/utids.c optional acpi +contrib/dev/acpica/utilities/utinit.c optional acpi +contrib/dev/acpica/utilities/utlock.c optional acpi +contrib/dev/acpica/utilities/utmath.c optional acpi +contrib/dev/acpica/utilities/utmisc.c optional acpi +contrib/dev/acpica/utilities/utmutex.c optional acpi +contrib/dev/acpica/utilities/utobject.c optional acpi +contrib/dev/acpica/utilities/utresrc.c optional acpi +contrib/dev/acpica/utilities/utstate.c optional acpi +contrib/dev/acpica/utilities/utxface.c optional acpi contrib/ipfilter/netinet/fil.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_auth.c optional ipfilter inet \ Index: sys/modules/acpi/acpi/Makefile =================================================================== --- sys/modules/acpi/acpi/Makefile (revision 203510) +++ sys/modules/acpi/acpi/Makefile (working copy) @@ -27,6 +27,10 @@ KMOD= acpi # ACPI CA sources +SRCS+= dbcmds.c dbdisply.c dbexec.c dbfileio.c dbhistry.c dbinput.c dbstats.c +SRCS+= dbutils.c dbxface.c +SRCS+= dmbuffer.c dmnames.c dmopcode.c dmobject.c dmresrc.c dmresrcl.c +SRCS+= dmresrcs.c dmutils.c dmwalk.c SRCS+= dsfield.c dsinit.c dsmethod.c dsmthdat.c dsobject.c dsopcode.c SRCS+= dsutils.c dswexec.c dswload.c dswscope.c dswstate.c SRCS+= evevent.c evgpe.c evgpeblk.c evmisc.c evregion.c evrgnini.c evsci.c @@ -37,16 +41,16 @@ SRCS+= exstoren.c exstorob.c exsystem.c exutils.c SRCS+= hwacpi.c hwgpe.c hwregs.c hwsleep.c hwtimer.c hwvalid.c hwxface.c SRCS+= nsaccess.c nsalloc.c nsdump.c nseval.c nsinit.c nsload.c nsnames.c -SRCS+= nsobject.c nsparse.c nspredef.c nssearch.c nsutils.c nswalk.c -SRCS+= nsxfeval.c nsxfname.c nsxfobj.c +SRCS+= nsobject.c nsparse.c nspredef.c nsrepair.c nsrepair2.c nssearch.c +SRCS+= nsutils.c nswalk.c nsxfeval.c nsxfname.c nsxfobj.c SRCS+= psargs.c psloop.c psopcode.c psparse.c psscope.c pstree.c psutils.c SRCS+= pswalk.c psxface.c SRCS+= rsaddr.c rscalc.c rscreate.c rsdump.c rsinfo.c rsio.c rsirq.c rslist.c SRCS+= rsmemory.c rsmisc.c rsutils.c rsxface.c SRCS+= tbfadt.c tbfind.c tbinstal.c tbutils.c tbxface.c tbxfroot.c SRCS+= utalloc.c utcache.c utcopy.c utdebug.c utdelete.c uteval.c utglobal.c -SRCS+= utinit.c utlock.c utmath.c utmisc.c utmutex.c utobject.c utresrc.c -SRCS+= utstate.c utxface.c +SRCS+= utids.c utinit.c utlock.c utmath.c utmisc.c utmutex.c utobject.c +SRCS+= utresrc.c utstate.c utxface.c # OSPM layer and core hardware drivers SRCS+= acpi.c acpi_button.c acpi_isab.c acpi_package.c acpi_pci.c acpi_pcib.c @@ -69,12 +73,6 @@ # This obviously needs a better and more structural fix. SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_compat.h opt_hwpmc_hooks.h -# Debugging support -DBSRC= dbcmds.c dbdisply.c dbexec.c dbfileio.c dbhistry.c dbinput.c dbstats.c -DBSRC+= dbutils.c dbxface.c -DBSRC+= dmbuffer.c dmnames.c dmopcode.c dmobject.c dmresrc.c dmresrcl.c -DBSRC+= dmresrcs.c dmutils.c dmwalk.c - .if !defined(KERNBUILDDIR) .if KTR CFLAGS+=-DKTR @@ -87,7 +85,6 @@ .endif .if ACPI_DEBUG CFLAGS+=-DACPI_DEBUG -SRCS+= ${DBSRC} opt_ddb.h: Makefile echo "#define DDB 1" > ${.TARGET} .else @@ -98,10 +95,12 @@ # Machine-specific code such as sleep/wakeup SRCS+= acpi_machdep.c acpi_wakecode.h acpi_wakeup.c -.if ${MACHINE} == "i386" -SRCS+= madt.c assym.s +SRCS+= assym.s madt.c +CLEANFILES+= acpi_wakecode.bin acpi_wakecode.h acpi_wakecode.o +.if ${MACHINE_ARCH} == "amd64" +SRCS+= opt_global.h +CLEANFILES+= acpi_wakedata.h .endif -CLEANFILES+= acpi_wakecode.h acpi_wakecode.o acpi_wakecode.bin ${DBSRC:.c=.o} acpi_wakecode.h: acpi_wakecode.S assym.s ${MAKE} -f ${.CURDIR}/../../../${MACHINE_ARCH}/acpica/Makefile \ Index: sys/dev/acpica/acpi_powerres.c =================================================================== --- sys/dev/acpica/acpi_powerres.c (revision 203510) +++ sys/dev/acpica/acpi_powerres.c (working copy) @@ -88,8 +88,8 @@ TAILQ_ENTRY(acpi_powerresource) ap_link; TAILQ_HEAD(,acpi_powerreference) ap_references; ACPI_HANDLE ap_resource; - ACPI_INTEGER ap_systemlevel; - ACPI_INTEGER ap_order; + UINT64 ap_systemlevel; + UINT64 ap_order; int ap_state; }; Index: sys/dev/acpica/Osd/OsdSchedule.c =================================================================== --- sys/dev/acpica/Osd/OsdSchedule.c (revision 203510) +++ sys/dev/acpica/Osd/OsdSchedule.c (working copy) @@ -215,7 +215,7 @@ } void -AcpiOsSleep(ACPI_INTEGER Milliseconds) +AcpiOsSleep(UINT64 Milliseconds) { int timo; Index: sys/dev/acpica/Osd/OsdHardware.c =================================================================== --- sys/dev/acpica/Osd/OsdHardware.c (revision 203510) +++ sys/dev/acpica/Osd/OsdHardware.c (working copy) @@ -145,7 +145,7 @@ ACPI_STATUS AcpiOsWritePciConfiguration (ACPI_PCI_ID *PciId, UINT32 Register, - ACPI_INTEGER Value, UINT32 Width) + UINT64 Value, UINT32 Width) { u_int32_t byte_width = Width / 8; Index: sys/dev/acpica/acpi_if.m =================================================================== --- sys/dev/acpica/acpi_if.m (revision 203510) +++ sys/dev/acpica/acpi_if.m (working copy) @@ -177,13 +177,13 @@ # # device_t dev: EC device # u_int addr: Address to read from in EC space -# ACPI_INTEGER *val: Location to store read value +# UINT64 *val: Location to store read value # int width: Size of area to read in bytes # METHOD int ec_read { device_t dev; u_int addr; - ACPI_INTEGER *val; + UINT64 *val; int width; }; @@ -192,13 +192,13 @@ # # device_t dev: EC device # u_int addr: Address to write to in EC space -# ACPI_INTEGER val: Value to write +# UINT64 val: Value to write # int width: Size of value to write in bytes # METHOD int ec_write { device_t dev; u_int addr; - ACPI_INTEGER val; + UINT64 val; int width; }; Index: sys/dev/acpica/acpi.c =================================================================== --- sys/dev/acpica/acpi.c (revision 203510) +++ sys/dev/acpica/acpi.c (working copy) @@ -864,25 +864,21 @@ acpi_child_pnpinfo_str_method(device_t cbdev, device_t child, char *buf, size_t buflen) { - ACPI_BUFFER adbuf = {ACPI_ALLOCATE_BUFFER, NULL}; - ACPI_DEVICE_INFO *adinfo; struct acpi_device *dinfo = device_get_ivars(child); - char *end; - int error; + ACPI_DEVICE_INFO *adinfo; - error = AcpiGetObjectInfo(dinfo->ad_handle, &adbuf); - adinfo = (ACPI_DEVICE_INFO *) adbuf.Pointer; - if (error) + if (ACPI_FAILURE(AcpiGetObjectInfo(dinfo->ad_handle, &adinfo))) { snprintf(buf, buflen, "unknown"); - else - snprintf(buf, buflen, "_HID=%s _UID=%lu", - (adinfo->Valid & ACPI_VALID_HID) ? - adinfo->HardwareId.Value : "none", - (adinfo->Valid & ACPI_VALID_UID) ? - strtoul(adinfo->UniqueId.Value, &end, 10) : 0); - if (adinfo) - AcpiOsFree(adinfo); + return (0); + } + snprintf(buf, buflen, "_HID=%s _UID=%lu", + (adinfo->Valid & ACPI_VALID_HID) ? + adinfo->HardwareId.String : "none", + (adinfo->Valid & ACPI_VALID_UID) ? + strtoul(adinfo->UniqueId.String, NULL, 10) : 0UL); + AcpiOsFree(adinfo); + return (0); } @@ -1315,31 +1311,21 @@ acpi_isa_get_logicalid(device_t dev) { ACPI_DEVICE_INFO *devinfo; - ACPI_BUFFER buf; ACPI_HANDLE h; - ACPI_STATUS error; - u_int32_t pnpid; + uint32_t pnpid; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - pnpid = 0; - buf.Pointer = NULL; - buf.Length = ACPI_ALLOCATE_BUFFER; - /* Fetch and validate the HID. */ - if ((h = acpi_get_handle(dev)) == NULL) - goto out; - error = AcpiGetObjectInfo(h, &buf); - if (ACPI_FAILURE(error)) - goto out; - devinfo = (ACPI_DEVICE_INFO *)buf.Pointer; + if ((h = acpi_get_handle(dev)) == NULL || + ACPI_FAILURE(AcpiGetObjectInfo(h, &devinfo))) + return_VALUE (0); - if ((devinfo->Valid & ACPI_VALID_HID) != 0) - pnpid = PNP_EISAID(devinfo->HardwareId.Value); + pnpid = (devinfo->Valid & ACPI_VALID_HID) != 0 && + devinfo->HardwareId.Length >= ACPI_EISAID_STRING_SIZE ? + PNP_EISAID(devinfo->HardwareId.String) : 0; + AcpiOsFree(devinfo); -out: - if (buf.Pointer != NULL) - AcpiOsFree(buf.Pointer); return_VALUE (pnpid); } @@ -1347,41 +1333,36 @@ acpi_isa_get_compatid(device_t dev, uint32_t *cids, int count) { ACPI_DEVICE_INFO *devinfo; - ACPI_BUFFER buf; + ACPI_DEVICE_ID *ids; ACPI_HANDLE h; - ACPI_STATUS error; uint32_t *pnpid; - int valid, i; + int i, valid; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); pnpid = cids; - valid = 0; - buf.Pointer = NULL; - buf.Length = ACPI_ALLOCATE_BUFFER; /* Fetch and validate the CID */ - if ((h = acpi_get_handle(dev)) == NULL) - goto out; - error = AcpiGetObjectInfo(h, &buf); - if (ACPI_FAILURE(error)) - goto out; - devinfo = (ACPI_DEVICE_INFO *)buf.Pointer; - if ((devinfo->Valid & ACPI_VALID_CID) == 0) - goto out; + if ((h = acpi_get_handle(dev)) == NULL || + ACPI_FAILURE(AcpiGetObjectInfo(h, &devinfo))) + return_VALUE (0); - if (devinfo->CompatibilityId.Count < count) - count = devinfo->CompatibilityId.Count; - for (i = 0; i < count; i++) { - if (strncmp(devinfo->CompatibilityId.Id[i].Value, "PNP", 3) != 0) - continue; - *pnpid++ = PNP_EISAID(devinfo->CompatibilityId.Id[i].Value); - valid++; + if ((devinfo->Valid & ACPI_VALID_CID) == 0) { + AcpiOsFree(devinfo); + return_VALUE (0); } -out: - if (buf.Pointer != NULL) - AcpiOsFree(buf.Pointer); + if (devinfo->CompatibleIdList.Count < count) + count = devinfo->CompatibleIdList.Count; + ids = devinfo->CompatibleIdList.Ids; + for (i = 0, valid = 0; i < count; i++) + if (ids[i].Length >= ACPI_EISAID_STRING_SIZE && + strncmp(ids[i].String, "PNP", 3) == 0) { + *pnpid++ = PNP_EISAID(ids[i].String); + valid++; + } + AcpiOsFree(devinfo); + return_VALUE (valid); } @@ -1389,11 +1370,15 @@ acpi_device_id_probe(device_t bus, device_t dev, char **ids) { ACPI_HANDLE h; + ACPI_OBJECT_TYPE t; int i; h = acpi_get_handle(dev); - if (ids == NULL || h == NULL || acpi_get_type(dev) != ACPI_TYPE_DEVICE) + if (ids == NULL || h == NULL) return (NULL); + t = acpi_get_type(dev); + if (t != ACPI_TYPE_DEVICE && t != ACPI_TYPE_PROCESSOR) + return (NULL); /* Try to match one of the array of IDs with a HID or CID. */ for (i = 0; ids[i] != NULL; i++) { @@ -1538,7 +1523,7 @@ ctx.arg = arg; ctx.parent = h; return (AcpiWalkNamespace(ACPI_TYPE_ANY, h, max_depth, - acpi_device_scan_cb, &ctx, NULL)); + acpi_device_scan_cb, NULL, &ctx, NULL)); } /* @@ -1664,7 +1649,7 @@ */ ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "namespace scan\n")); AcpiWalkNamespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, 100, acpi_probe_child, - bus, NULL); + NULL, bus, NULL); /* Pre-allocate resources for our rman from any sysresource devices. */ acpi_sysres_alloc(bus); @@ -1821,7 +1806,7 @@ * placeholder object handler so we can store a device_t in an ACPI_HANDLE. */ void -acpi_fake_objhandler(ACPI_HANDLE h, UINT32 fn, void *data) +acpi_fake_objhandler(ACPI_HANDLE h, void *data) { } @@ -1910,30 +1895,18 @@ { ACPI_DEVICE_INFO *devinfo; ACPI_HANDLE h; - ACPI_BUFFER buf; - ACPI_STATUS error; - int ret; + BOOLEAN present; - ret = FALSE; - if ((h = acpi_get_handle(dev)) == NULL) + if ((h = acpi_get_handle(dev)) == NULL || + ACPI_FAILURE(AcpiGetObjectInfo(h, &devinfo))) return (FALSE); - buf.Pointer = NULL; - buf.Length = ACPI_ALLOCATE_BUFFER; - error = AcpiGetObjectInfo(h, &buf); - if (ACPI_FAILURE(error)) - return (FALSE); - devinfo = (ACPI_DEVICE_INFO *)buf.Pointer; /* If no _STA method, must be present */ - if ((devinfo->Valid & ACPI_VALID_STA) == 0) - ret = TRUE; + present = (devinfo->Valid & ACPI_VALID_STA) == 0 || + ACPI_DEVICE_PRESENT(devinfo->CurrentStatus) ? TRUE : FALSE; - /* Return true for 'present' and 'functioning' */ - if (ACPI_DEVICE_PRESENT(devinfo->CurrentStatus)) - ret = TRUE; - - AcpiOsFree(buf.Pointer); - return (ret); + AcpiOsFree(devinfo); + return (present); } /* @@ -1944,30 +1917,18 @@ { ACPI_DEVICE_INFO *devinfo; ACPI_HANDLE h; - ACPI_BUFFER buf; - ACPI_STATUS error; - int ret; + BOOLEAN present; - ret = FALSE; - if ((h = acpi_get_handle(dev)) == NULL) + if ((h = acpi_get_handle(dev)) == NULL || + ACPI_FAILURE(AcpiGetObjectInfo(h, &devinfo))) return (FALSE); - buf.Pointer = NULL; - buf.Length = ACPI_ALLOCATE_BUFFER; - error = AcpiGetObjectInfo(h, &buf); - if (ACPI_FAILURE(error)) - return (FALSE); - devinfo = (ACPI_DEVICE_INFO *)buf.Pointer; /* If no _STA method, must be present */ - if ((devinfo->Valid & ACPI_VALID_STA) == 0) - ret = TRUE; + present = (devinfo->Valid & ACPI_VALID_STA) == 0 || + ACPI_BATTERY_PRESENT(devinfo->CurrentStatus) ? TRUE : FALSE; - /* Return true for 'present', 'battery present', and 'functioning' */ - if (ACPI_BATTERY_PRESENT(devinfo->CurrentStatus)) - ret = TRUE; - - AcpiOsFree(buf.Pointer); - return (ret); + AcpiOsFree(devinfo); + return (present); } /* @@ -1977,33 +1938,26 @@ acpi_MatchHid(ACPI_HANDLE h, const char *hid) { ACPI_DEVICE_INFO *devinfo; - ACPI_BUFFER buf; - ACPI_STATUS error; - int ret, i; + BOOLEAN ret; + int i; - ret = FALSE; - if (hid == NULL || h == NULL) - return (ret); - buf.Pointer = NULL; - buf.Length = ACPI_ALLOCATE_BUFFER; - error = AcpiGetObjectInfo(h, &buf); - if (ACPI_FAILURE(error)) - return (ret); - devinfo = (ACPI_DEVICE_INFO *)buf.Pointer; + if (hid == NULL || h == NULL || + ACPI_FAILURE(AcpiGetObjectInfo(h, &devinfo))) + return (FALSE); + ret = FALSE; if ((devinfo->Valid & ACPI_VALID_HID) != 0 && - strcmp(hid, devinfo->HardwareId.Value) == 0) + strcmp(hid, devinfo->HardwareId.String) == 0) ret = TRUE; - else if ((devinfo->Valid & ACPI_VALID_CID) != 0) { - for (i = 0; i < devinfo->CompatibilityId.Count; i++) { - if (strcmp(hid, devinfo->CompatibilityId.Id[i].Value) == 0) { + else if ((devinfo->Valid & ACPI_VALID_CID) != 0) + for (i = 0; i < devinfo->CompatibleIdList.Count; i++) { + if (strcmp(hid, devinfo->CompatibleIdList.Ids[i].String) == 0) { ret = TRUE; break; } } - } - AcpiOsFree(buf.Pointer); + AcpiOsFree(devinfo); return (ret); } @@ -2825,7 +2779,7 @@ if (ACPI_SUCCESS(AcpiGetHandle(ACPI_ROOT_OBJECT, "\\_SB_", &sb_handle))) AcpiWalkNamespace(ACPI_TYPE_DEVICE, sb_handle, 100, - acpi_wake_prep, &sstate, NULL); + acpi_wake_prep, NULL, &sstate, NULL); return (0); } Index: sys/dev/acpica/acpi_dock.c =================================================================== --- sys/dev/acpica/acpi_dock.c (revision 203510) +++ sys/dev/acpica/acpi_dock.c (working copy) @@ -224,7 +224,7 @@ ACPI_INIT_WALK_INFO Info; AcpiNsWalkNamespace(ACPI_TYPE_ANY, handle, - 100, TRUE, AcpiNsInitOneDevice, &Info, NULL); + 100, TRUE, AcpiNsInitOneDevice, NULL, &Info, NULL); #endif dev = acpi_get_device(handle); @@ -249,7 +249,7 @@ status = AcpiGetHandle(ACPI_ROOT_OBJECT, "\\_SB_", &sb_handle); if (ACPI_SUCCESS(status)) { AcpiWalkNamespace(ACPI_TYPE_DEVICE, sb_handle, - 100, acpi_dock_insert_child, dev, NULL); + 100, acpi_dock_insert_child, NULL, dev, NULL); } } @@ -319,7 +319,7 @@ status = AcpiGetHandle(ACPI_ROOT_OBJECT, "\\_SB_", &sb_handle); if (ACPI_SUCCESS(status)) { AcpiWalkNamespace(ACPI_TYPE_DEVICE, sb_handle, - 100, acpi_dock_eject_child, &dev, NULL); + 100, acpi_dock_eject_child, NULL, &dev, NULL); } } Index: sys/dev/acpica/acpi_cpu.c =================================================================== --- sys/dev/acpica/acpi_cpu.c (revision 203510) +++ sys/dev/acpica/acpi_cpu.c (working copy) @@ -940,7 +940,7 @@ * get the time very close to the CPU start/stop clock logic, this * is the only reliable time source. */ - AcpiRead(&start_time, &AcpiGbl_FADT.XPmTimerBlock); + AcpiHwRead(&start_time, &AcpiGbl_FADT.XPmTimerBlock); CPU_GET_REG(cx_next->p_lvlx, 1); /* @@ -949,8 +949,8 @@ * the processor has stopped. Doing it again provides enough * margin that we are certain to have a correct value. */ - AcpiRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); - AcpiRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); + AcpiHwRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); + AcpiHwRead(&end_time, &AcpiGbl_FADT.XPmTimerBlock); /* Enable bus master arbitration and disable bus master wakeup. */ if (cx_next->type == ACPI_STATE_C3 && Index: sys/dev/acpica/acpivar.h =================================================================== --- sys/dev/acpica/acpivar.h (revision 203510) +++ sys/dev/acpica/acpivar.h (working copy) @@ -254,7 +254,7 @@ __ACPI_BUS_ACCESSOR(acpi, private, ACPI, PRIVATE, void *) __ACPI_BUS_ACCESSOR(acpi, flags, ACPI, FLAGS, int) -void acpi_fake_objhandler(ACPI_HANDLE h, UINT32 fn, void *data); +void acpi_fake_objhandler(ACPI_HANDLE h, void *data); static __inline device_t acpi_get_device(ACPI_HANDLE handle) { @@ -447,7 +447,7 @@ #define ACPI_PKG_VALID(pkg, size) \ ((pkg) != NULL && (pkg)->Type == ACPI_TYPE_PACKAGE && \ (pkg)->Package.Count >= (size)) -int acpi_PkgInt(ACPI_OBJECT *res, int idx, ACPI_INTEGER *dst); +int acpi_PkgInt(ACPI_OBJECT *res, int idx, UINT64 *dst); int acpi_PkgInt32(ACPI_OBJECT *res, int idx, uint32_t *dst); int acpi_PkgStr(ACPI_OBJECT *res, int idx, void *dst, size_t size); int acpi_PkgGas(device_t dev, ACPI_OBJECT *res, int idx, int *type, Index: sys/dev/acpica/acpi_video.c =================================================================== --- sys/dev/acpica/acpi_video.c (revision 203510) +++ sys/dev/acpica/acpi_video.c (working copy) @@ -840,7 +840,7 @@ argset.dod_pkg = res; argset.count = 0; status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, handle, 1, - vid_enum_outputs_subr, &argset, NULL); + vid_enum_outputs_subr, NULL, &argset, NULL); if (ACPI_FAILURE(status)) printf("failed walking down %s - %s\n", acpi_name(handle), AcpiFormatException(status)); Index: sys/dev/acpica/acpi_smbat.c =================================================================== --- sys/dev/acpica/acpi_smbat.c (revision 203510) +++ sys/dev/acpica/acpi_smbat.c (working copy) @@ -190,7 +190,7 @@ uint16_t *ptr) { int error, to; - ACPI_INTEGER val; + UINT64 val; ACPI_SERIAL_ASSERT(smbat); @@ -257,7 +257,7 @@ acpi_smbus_read_multi_1(struct acpi_smbat_softc *sc, uint8_t addr, uint8_t cmd, uint8_t *ptr, uint16_t len) { - ACPI_INTEGER val; + UINT64 val; uint8_t to; int error; Index: sys/dev/acpica/acpi_pcib_acpi.c =================================================================== --- sys/dev/acpica/acpi_pcib_acpi.c (revision 203510) +++ sys/dev/acpica/acpi_pcib_acpi.c (working copy) @@ -131,14 +131,18 @@ static int acpi_pcib_acpi_probe(device_t dev) { - static char *pcib_ids[] = { "PNP0A03", "PNP0A08", NULL }; + ACPI_DEVICE_INFO *devinfo; + ACPI_HANDLE h; + int root; - if (acpi_disabled("pcib") || - ACPI_ID_PROBE(device_get_parent(dev), dev, pcib_ids) == NULL) + if (acpi_disabled("pcib") || (h = acpi_get_handle(dev)) == NULL || + ACPI_FAILURE(AcpiGetObjectInfo(h, &devinfo))) return (ENXIO); + root = (devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0; + AcpiOsFree(devinfo); + if (!root || pci_cfgregopen() == 0) + return (ENXIO); - if (pci_cfgregopen() == 0) - return (ENXIO); device_set_desc(dev, "ACPI Host-PCI bridge"); return (0); } Index: sys/dev/acpica/acpi_pci.c =================================================================== --- sys/dev/acpica/acpi_pci.c (revision 203510) +++ sys/dev/acpica/acpi_pci.c (working copy) @@ -314,7 +314,7 @@ */ pci_add_children(dev, domain, busno, sizeof(struct acpi_pci_devinfo)); AcpiWalkNamespace(ACPI_TYPE_DEVICE, acpi_get_handle(dev), 1, - acpi_pci_save_handle, dev, NULL); + acpi_pci_save_handle, NULL, dev, NULL); return (bus_generic_attach(dev)); } Index: sys/dev/acpica/acpi_ec.c =================================================================== --- sys/dev/acpica/acpi_ec.c (revision 203510) +++ sys/dev/acpica/acpi_ec.c (working copy) @@ -223,7 +223,7 @@ void *Context, void **return_Context); static ACPI_STATUS EcSpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, - UINT32 width, ACPI_INTEGER *Value, + UINT32 width, UINT64 *Value, void *Context, void *RegionContext); static ACPI_STATUS EcWaitEvent(struct acpi_ec_softc *sc, EC_EVENT Event, u_int gen_count); @@ -238,9 +238,9 @@ static int acpi_ec_resume(device_t dev); static int acpi_ec_shutdown(device_t dev); static int acpi_ec_read_method(device_t dev, u_int addr, - ACPI_INTEGER *val, int width); + UINT64 *val, int width); static int acpi_ec_write_method(device_t dev, u_int addr, - ACPI_INTEGER val, int width); + UINT64 val, int width); static device_method_t acpi_ec_methods[] = { /* Device interface */ @@ -581,7 +581,7 @@ /* Methods to allow other devices (e.g., smbat) to read/write EC space. */ static int -acpi_ec_read_method(device_t dev, u_int addr, ACPI_INTEGER *val, int width) +acpi_ec_read_method(device_t dev, u_int addr, UINT64 *val, int width) { struct acpi_ec_softc *sc; ACPI_STATUS status; @@ -594,7 +594,7 @@ } static int -acpi_ec_write_method(device_t dev, u_int addr, ACPI_INTEGER val, int width) +acpi_ec_write_method(device_t dev, u_int addr, UINT64 val, int width) { struct acpi_ec_softc *sc; ACPI_STATUS status; @@ -724,7 +724,7 @@ static ACPI_STATUS EcSpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 width, - ACPI_INTEGER *Value, void *Context, void *RegionContext) + UINT64 *Value, void *Context, void *RegionContext) { struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; ACPI_STATUS Status; @@ -765,7 +765,7 @@ case ACPI_READ: Status = EcRead(sc, EcAddr, &EcData); if (ACPI_SUCCESS(Status)) - *Value |= ((ACPI_INTEGER)EcData) << i; + *Value |= ((UINT64)EcData) << i; break; case ACPI_WRITE: EcData = (UINT8)((*Value) >> i); Index: sys/dev/acpica/acpi_package.c =================================================================== --- sys/dev/acpica/acpi_package.c (revision 203510) +++ sys/dev/acpica/acpi_package.c (working copy) @@ -45,7 +45,7 @@ */ int -acpi_PkgInt(ACPI_OBJECT *res, int idx, ACPI_INTEGER *dst) +acpi_PkgInt(ACPI_OBJECT *res, int idx, UINT64 *dst) { ACPI_OBJECT *obj; @@ -60,7 +60,7 @@ int acpi_PkgInt32(ACPI_OBJECT *res, int idx, uint32_t *dst) { - ACPI_INTEGER tmp; + UINT64 tmp; int error; error = acpi_PkgInt(res, idx, &tmp); Index: sys/dev/fdc/fdc_acpi.c =================================================================== --- sys/dev/fdc/fdc_acpi.c (revision 203510) +++ sys/dev/fdc/fdc_acpi.c (working copy) @@ -97,9 +97,7 @@ struct fdc_data *sc; ACPI_BUFFER buf; device_t bus; - int error, fde_count, i; - ACPI_OBJECT *obj, *pkg; - uint32_t fde[ACPI_FDC_MAXDEVS]; + int error; /* Get our softc and use the same accessor as ISA. */ sc = device_get_softc(dev); @@ -128,64 +126,13 @@ */ bus = device_get_parent(dev); if (ACPI_FAILURE(ACPI_EVALUATE_OBJECT(bus, dev, "_FDE", NULL, &buf))) { - error = ENXIO; - goto out_hintsprobe; + error = fdc_hints_probe(dev); + goto out; } - /* Parse the output of _FDE in various ways. */ - obj = pkg = (ACPI_OBJECT *)buf.Pointer; - switch (obj->Type) { - case ACPI_TYPE_BUFFER: - /* - * The spec says _FDE should be a buffer of five 32-bit - * integers. In violation of the spec, some systems use - * five bytes instead. - */ - switch (obj->Buffer.Length) { - case ACPI_FDC_FDE_LEN: - bcopy(obj->Buffer.Pointer, fde, ACPI_FDC_FDE_LEN); - break; - case ACPI_FDC_MAXDEVS: - for (i = 0; i < ACPI_FDC_MAXDEVS; i++) - fde[i] = ((uint8_t *)obj->Buffer.Pointer)[i]; - break; - default: - device_printf(dev, "_FDE wrong length: %d\n", - obj->Buffer.Length); - error = ENXIO; - goto out_hintsprobe; - } - break; - case ACPI_TYPE_PACKAGE: - /* - * In violation of the spec, systems including the ASUS - * K8V return a package of five integers instead of a - * buffer of five 32-bit integers. - */ - fde_count = min(ACPI_FDC_MAXDEVS, pkg->Package.Count); - for (i = 0; i < fde_count; i++) { - obj = &pkg->Package.Elements[i]; - if (obj->Type == ACPI_TYPE_INTEGER) - fde[i] = (uint32_t)obj->Integer.Value; - } - break; - default: - device_printf(dev, "invalid _FDE type %d\n", obj->Type); - error = ENXIO; - goto out_hintsprobe; - } - /* Add fd child devices as specified. */ - error = fdc_acpi_probe_children(bus, dev, fde); + error = fdc_acpi_probe_children(bus, dev, buf.Pointer); -out_hintsprobe: - /* - * If there was a problem with the _FDE drive enumeration, fall - * back to the hints-based probe. - */ - if (error) - error = fdc_hints_probe(dev); - out: if (buf.Pointer) free(buf.Pointer, M_TEMP); Index: sys/dev/acpi_support/acpi_ibm.c =================================================================== --- sys/dev/acpi_support/acpi_ibm.c (revision 203510) +++ sys/dev/acpi_support/acpi_ibm.c (working copy) @@ -526,7 +526,7 @@ static int acpi_ibm_sysctl_get(struct acpi_ibm_softc *sc, int method) { - ACPI_INTEGER val_ec; + UINT64 val_ec; int val = 0, key; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -657,7 +657,7 @@ acpi_ibm_sysctl_set(struct acpi_ibm_softc *sc, int method, int arg) { int val, step; - ACPI_INTEGER val_ec; + UINT64 val_ec; ACPI_OBJECT Arg; ACPI_OBJECT_LIST Args; ACPI_STATUS status; Index: sys/dev/acpi_support/acpi_panasonic.c =================================================================== --- sys/dev/acpi_support/acpi_panasonic.c (revision 203510) +++ sys/dev/acpi_support/acpi_panasonic.c (working copy) @@ -82,9 +82,9 @@ static int acpi_panasonic_detach(device_t dev); static int acpi_panasonic_shutdown(device_t dev); static int acpi_panasonic_sysctl(SYSCTL_HANDLER_ARGS); -static ACPI_INTEGER acpi_panasonic_sinf(ACPI_HANDLE h, ACPI_INTEGER index); -static void acpi_panasonic_sset(ACPI_HANDLE h, ACPI_INTEGER index, - ACPI_INTEGER val); +static UINT64 acpi_panasonic_sinf(ACPI_HANDLE h, UINT64 index); +static void acpi_panasonic_sset(ACPI_HANDLE h, UINT64 index, + UINT64 val); static int acpi_panasonic_hkey_event(struct acpi_panasonic_softc *sc, ACPI_HANDLE h, UINT32 *arg); static void acpi_panasonic_hkey_action(struct acpi_panasonic_softc *sc, @@ -265,12 +265,12 @@ return (error); } -static ACPI_INTEGER -acpi_panasonic_sinf(ACPI_HANDLE h, ACPI_INTEGER index) +static UINT64 +acpi_panasonic_sinf(ACPI_HANDLE h, UINT64 index) { ACPI_BUFFER buf; ACPI_OBJECT *res; - ACPI_INTEGER ret; + UINT64 ret; ACPI_SERIAL_ASSERT(panasonic); ret = -1; @@ -286,7 +286,7 @@ } static void -acpi_panasonic_sset(ACPI_HANDLE h, ACPI_INTEGER index, ACPI_INTEGER val) +acpi_panasonic_sset(ACPI_HANDLE h, UINT64 index, UINT64 val) { ACPI_OBJECT_LIST args; ACPI_OBJECT obj[2]; @@ -394,7 +394,7 @@ { ACPI_BUFFER buf; ACPI_OBJECT *res; - ACPI_INTEGER val; + UINT64 val; int status; ACPI_SERIAL_ASSERT(panasonic); Index: sys/dev/acpi_support/acpi_wmi.c =================================================================== --- sys/dev/acpi_support/acpi_wmi.c (revision 203510) +++ sys/dev/acpi_support/acpi_wmi.c (working copy) @@ -141,7 +141,7 @@ void *context); static ACPI_STATUS acpi_wmi_ec_handler(UINT32 function, ACPI_PHYSICAL_ADDRESS address, UINT32 width, - ACPI_INTEGER *value, void *context, + UINT64 *value, void *context, void *region_context); /* helpers */ static ACPI_STATUS acpi_wmi_read_wdg_blocks(ACPI_HANDLE h); @@ -646,12 +646,12 @@ */ static ACPI_STATUS acpi_wmi_ec_handler(UINT32 function, ACPI_PHYSICAL_ADDRESS address, - UINT32 width, ACPI_INTEGER *value, void *context, + UINT32 width, UINT64 *value, void *context, void *region_context) { struct acpi_wmi_softc *sc; int i; - ACPI_INTEGER ec_data; + UINT64 ec_data; UINT8 ec_addr; ACPI_STATUS status; @@ -672,7 +672,7 @@ case ACPI_READ: status = ACPI_EC_READ(sc->ec_dev, ec_addr, &ec_data, 1); if (ACPI_SUCCESS(status)) - *value |= ((ACPI_INTEGER)ec_data) << i; + *value |= ((UINT64)ec_data) << i; break; case ACPI_WRITE: ec_data = (UINT8)((*value) >> i); Property changes on: sys/dev/xen/xenpci ___________________________________________________________________ Modified: svn:mergeinfo Merged /head/sys/dev/xen/xenpci:r197104-197105,197107,197688,198237,199337-199338,200553-200554,202771,202773 Property changes on: sys/contrib/pf ___________________________________________________________________ Modified: svn:mergeinfo Merged /head/sys/contrib/pf:r197104-197105,197107,197688,198237,199337-199338,200553-200554,202771,202773 Property changes on: sys/contrib/dev/acpica ___________________________________________________________________ Modified: svn:mergeinfo Merged /vendor-sys/acpica/dist:r193332-202768 Merged /head/sys/contrib/dev/acpica:r197104-197105,197107,197688,198237,199337-199338,200553-200554,202771,202773 Index: sys/contrib/dev/acpica/acpica_prep.sh =================================================================== --- sys/contrib/dev/acpica/acpica_prep.sh (revision 203510) +++ sys/contrib/dev/acpica/acpica_prep.sh (working copy) @@ -21,7 +21,7 @@ # files to remove stripdirs="acpisrc acpixtract examples generate os_specific" stripfiles="Makefile README acintel.h aclinux.h acmsvc.h acnetbsd.h \ - acos2.h accygwin.h acefi.h actbl2.h acwin.h acwin64.h aeexec.c \ + acos2.h accygwin.h acefi.h acwin.h acwin64.h aeexec.c \ aehandlers.c aemain.c aetables.c osunixdir.c readme.txt \ utclib.c" @@ -31,8 +31,8 @@ aclocal.h acmacros.h acnames.h acnamesp.h acobject.h acopcode.h \ acoutput.h acparser.h acpi.h acpiosxf.h acpixf.h acpredef.h \ acresrc.h acrestyp.h acstruct.h actables.h actbl.h actbl1.h \ - actypes.h acutils.h amlcode.h amlresrc.h platform/acenv.h \ - platform/acfreebsd.h platform/acgcc.h" + actbl2.h actypes.h acutils.h amlcode.h amlresrc.h \ + platform/acenv.h platform/acfreebsd.h platform/acgcc.h" comp_headers="aslcompiler.h asldefine.h aslglobal.h asltypes.h" platform_headers="acfreebsd.h acgcc.h" Index: sys/contrib/dev/acpica/include/acdebug.h =================================================================== --- sys/contrib/dev/acpica/include/acdebug.h (revision 203510) +++ sys/contrib/dev/acpica/include/acdebug.h (working copy) @@ -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,14 +126,20 @@ } 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) #define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\ @@ -265,7 +271,7 @@ void AcpiDbBatchExecute ( - void); + char *CountArg); /* * dbdisply - debug display commands @@ -313,6 +319,7 @@ ACPI_OPERAND_OBJECT *ObjDesc, ACPI_WALK_STATE *WalkState); + /* * dbexec - debugger control method execution */ Index: sys/contrib/dev/acpica/include/platform/acenv.h =================================================================== --- sys/contrib/dev/acpica/include/platform/acenv.h (revision 203510) +++ sys/contrib/dev/acpica/include/platform/acenv.h (working copy) @@ -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 @@ -262,11 +262,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. */ @@ -424,8 +424,8 @@ #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 */ Index: sys/contrib/dev/acpica/include/platform/acfreebsd.h =================================================================== --- sys/contrib/dev/acpica/include/platform/acfreebsd.h (revision 203510) +++ sys/contrib/dev/acpica/include/platform/acfreebsd.h (working copy) @@ -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 Index: sys/contrib/dev/acpica/include/platform/acgcc.h =================================================================== --- sys/contrib/dev/acpica/include/platform/acgcc.h (revision 203510) +++ sys/contrib/dev/acpica/include/platform/acgcc.h (working copy) @@ -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 Index: sys/contrib/dev/acpica/include/aclocal.h =================================================================== --- sys/contrib/dev/acpica/include/aclocal.h (revision 203510) +++ sys/contrib/dev/acpica/include/aclocal.h (working copy) @@ -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 @@ -493,6 +493,24 @@ } ACPI_PREDEFINED_INFO; + +/* Data block used during object validation */ + +typedef struct acpi_predefined_data +{ + char *Pathname; + const ACPI_PREDEFINED_INFO *Predefined; + union acpi_operand_object *ParentPackage; + UINT32 Flags; + UINT8 NodeFlags; + +} ACPI_PREDEFINED_DATA; + +/* Defines for Flags field above */ + +#define ACPI_OBJECT_REPAIRED 1 + + /* * Bitmapped return value types * Note: the actual data types must be contiguous, a loop in nspredef.c @@ -835,8 +853,7 @@ 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 */ @@ -1110,6 +1127,9 @@ #define ACPI_OSI_WIN_XP_SP2 0x05 #define ACPI_OSI_WINSRV_2003_SP1 0x06 #define ACPI_OSI_WIN_VISTA 0x07 +#define ACPI_OSI_WINSRV_2008 0x08 +#define ACPI_OSI_WIN_VISTA_SP1 0x09 +#define ACPI_OSI_WIN_7 0x0A #define ACPI_ALWAYS_ILLEGAL 0x00 @@ -1198,6 +1218,29 @@ /***************************************************************************** * + * 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 * ****************************************************************************/ Index: sys/contrib/dev/acpica/include/acglobal.h =================================================================== --- sys/contrib/dev/acpica/include/acglobal.h (revision 203510) +++ sys/contrib/dev/acpica/include/acglobal.h (working copy) @@ -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 @@ -324,7 +324,8 @@ extern BOOLEAN AcpiGbl_Shutdown; extern UINT32 AcpiGbl_StartupFlags; extern const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT]; -extern const char *AcpiGbl_HighestDstateNames[4]; +extern const char *AcpiGbl_LowestDstateNames[ACPI_NUM_SxW_METHODS]; +extern const char *AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS]; extern const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES]; extern const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS]; #endif @@ -355,7 +356,9 @@ ACPI_EXTERN ACPI_NAMESPACE_NODE AcpiGbl_RootNodeStruct; ACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_RootNode; ACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_FadtGpeDevice; +ACPI_EXTERN ACPI_OPERAND_OBJECT *AcpiGbl_ModuleCodeList; + extern const UINT8 AcpiGbl_NsProperties [ACPI_NUM_NS_TYPES]; extern const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames [NUM_PREDEFINED_NAMES]; @@ -443,6 +446,7 @@ ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_disasm; ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_verbose; +ACPI_EXTERN ACPI_EXTERNAL_LIST *AcpiGbl_ExternalList; #endif Index: sys/contrib/dev/acpica/include/acapps.h =================================================================== --- sys/contrib/dev/acpica/include/acapps.h (revision 203510) +++ sys/contrib/dev/acpica/include/acapps.h (working copy) @@ -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 @@ BOOLEAN GetAllTables); void -AdPrintStatistics (void); +AdPrintStatistics ( + void); ACPI_STATUS AdFindDsdt( @@ -159,7 +160,8 @@ UINT32 *DsdtLength); void -AdDumpTables (void); +AdDumpTables ( + void); ACPI_STATUS AdGetLocalTables ( @@ -179,8 +181,10 @@ ACPI_TABLE_HEADER *Table); ACPI_STATUS -AdDisplayStatistics (void); +AdDisplayStatistics ( + void); + /* * adwalk */ @@ -209,6 +213,7 @@ ACPI_PARSE_OBJECT *ParseTreeRoot, ACPI_NAMESPACE_NODE *NamespaceRoot); + /* * adfile */ @@ -228,11 +233,6 @@ char **OutFilename); char * -FlGenerateFilename ( - char *InputFilename, - char *Suffix); - -char * AdGenerateFilename ( char *Prefix, char *TableId); Index: sys/contrib/dev/acpica/include/acnames.h =================================================================== --- sys/contrib/dev/acpica/include/acnames.h (revision 203510) +++ sys/contrib/dev/acpica/include/acnames.h (working copy) @@ -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 Index: sys/contrib/dev/acpica/include/acevents.h =================================================================== --- sys/contrib/dev/acpica/include/acevents.h (revision 203510) +++ sys/contrib/dev/acpica/include/acevents.h (working copy) @@ -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 @@ UINT32 Function, UINT32 RegionOffset, UINT32 BitWidth, - ACPI_INTEGER *Value); + UINT64 *Value); ACPI_STATUS AcpiEvAttachRegion ( Index: sys/contrib/dev/acpica/include/acpi.h =================================================================== --- sys/contrib/dev/acpica/include/acpi.h (revision 203510) +++ sys/contrib/dev/acpica/include/acpi.h (working copy) @@ -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 Index: sys/contrib/dev/acpica/include/actables.h =================================================================== --- sys/contrib/dev/acpica/include/actables.h (revision 203510) +++ sys/contrib/dev/acpica/include/actables.h (working copy) @@ -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 Index: sys/contrib/dev/acpica/include/acstruct.h =================================================================== --- sys/contrib/dev/acpica/include/acstruct.h (revision 203510) +++ sys/contrib/dev/acpica/include/acstruct.h (working copy) @@ -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 Index: sys/contrib/dev/acpica/include/acmacros.h =================================================================== --- sys/contrib/dev/acpica/include/acmacros.h (revision 203510) +++ sys/contrib/dev/acpica/include/acmacros.h (working copy) @@ -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 */ @@ -402,6 +402,8 @@ */ #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 @@ -409,6 +411,8 @@ #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 */ @@ -469,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 */ @@ -489,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) Index: sys/contrib/dev/acpica/include/acrestyp.h =================================================================== --- sys/contrib/dev/acpica/include/acrestyp.h (revision 203510) +++ sys/contrib/dev/acpica/include/acrestyp.h (working copy) @@ -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 @@ { 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 */ Index: sys/contrib/dev/acpica/include/accommon.h =================================================================== --- sys/contrib/dev/acpica/include/accommon.h (revision 203510) +++ sys/contrib/dev/acpica/include/accommon.h (working copy) @@ -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 Index: sys/contrib/dev/acpica/include/acparser.h =================================================================== --- sys/contrib/dev/acpica/include/acparser.h (revision 203510) +++ sys/contrib/dev/acpica/include/acparser.h (working copy) @@ -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 @@ -137,6 +137,7 @@ #define ACPI_PARSE_DEFERRED_OP 0x0100 #define ACPI_PARSE_DISASSEMBLE 0x0200 +#define ACPI_PARSE_MODULE_LEVEL 0x0400 /****************************************************************************** * Index: sys/contrib/dev/acpica/include/acoutput.h =================================================================== --- sys/contrib/dev/acpica/include/acoutput.h (revision 203510) +++ sys/contrib/dev/acpica/include/acoutput.h (working copy) @@ -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) Index: sys/contrib/dev/acpica/include/amlcode.h =================================================================== --- sys/contrib/dev/acpica/include/amlcode.h (revision 203510) +++ sys/contrib/dev/acpica/include/amlcode.h (working copy) @@ -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 @@ -485,6 +485,7 @@ REGION_SMBUS, REGION_CMOS, REGION_PCI_BAR, + REGION_IPMI, REGION_DATA_TABLE, /* Internal use only */ REGION_FIXED_HW = 0x7F Index: sys/contrib/dev/acpica/include/acutils.h =================================================================== --- sys/contrib/dev/acpica/include/acutils.h (revision 203510) +++ sys/contrib/dev/acpica/include/acutils.h (working copy) @@ -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 @@ char AcpiUtHexToAsciiChar ( - ACPI_INTEGER Integer, + UINT64 Integer, UINT32 Position); BOOLEAN @@ -470,7 +470,7 @@ const char *FunctionName, const char *ModuleName, UINT32 ComponentId, - ACPI_INTEGER Value); + UINT64 Value); void AcpiUtPtrExit ( @@ -550,33 +550,40 @@ AcpiUtEvaluateNumericObject ( char *ObjectName, ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_INTEGER *Address); + UINT64 *Value); ACPI_STATUS -AcpiUtExecute_HID ( +AcpiUtExecute_STA ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID *Hid); + UINT32 *StatusFlags); ACPI_STATUS -AcpiUtExecute_CID ( +AcpiUtExecutePowerMethods ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_COMPATIBLE_ID_LIST **ReturnCidList); + const char **MethodNames, + UINT8 MethodCount, + UINT8 *OutValues); + +/* + * utids - device ID support + */ ACPI_STATUS -AcpiUtExecute_STA ( +AcpiUtExecute_HID ( ACPI_NAMESPACE_NODE *DeviceNode, - UINT32 *StatusFlags); + ACPI_DEVICE_ID **ReturnId); ACPI_STATUS AcpiUtExecute_UID ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID *Uid); + ACPI_DEVICE_ID **ReturnId); ACPI_STATUS -AcpiUtExecute_Sxds ( +AcpiUtExecute_CID ( ACPI_NAMESPACE_NODE *DeviceNode, - UINT8 *Highest); + ACPI_DEVICE_ID_LIST **ReturnCidList); + /* * utlock - reader/writer locks */ @@ -637,6 +644,10 @@ UINT32 Count); ACPI_OPERAND_OBJECT * +AcpiUtCreateIntegerObject ( + UINT64 Value); + +ACPI_OPERAND_OBJECT * AcpiUtCreateBufferObject ( ACPI_SIZE BufferSize); @@ -709,16 +720,16 @@ */ 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); /* @@ -729,6 +740,10 @@ ACPI_STATUS Status); BOOLEAN +AcpiUtIsPciRootBridge ( + char *Id); + +BOOLEAN AcpiUtIsAmlTable ( ACPI_TABLE_HEADER *Table); @@ -773,8 +788,26 @@ AcpiUtStrtoul64 ( char *String, UINT32 Base, - ACPI_INTEGER *RetInteger); + UINT64 *RetInteger); +void ACPI_INTERNAL_VAR_XFACE +AcpiUtPredefinedWarning ( + const char *ModuleName, + UINT32 LineNumber, + char *Pathname, + UINT8 NodeFlags, + 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 Index: sys/contrib/dev/acpica/include/acinterp.h =================================================================== --- sys/contrib/dev/acpica/include/acinterp.h (revision 203510) +++ sys/contrib/dev/acpica/include/acinterp.h (working copy) @@ -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 @@ 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 @@ void AcpiExSetBufferDatum ( - ACPI_INTEGER MergedDatum, + UINT64 MergedDatum, void *Buffer, UINT32 BufferLength, UINT32 ByteGranularity, @@ -266,7 +266,7 @@ AcpiExAccessRegion ( ACPI_OPERAND_OBJECT *ObjDesc, UINT32 FieldDatumByteOffset, - ACPI_INTEGER *Value, + UINT64 *Value, UINT32 ReadWrite); @@ -296,8 +296,8 @@ ACPI_STATUS AcpiExDoLogicalNumericOp ( UINT16 Opcode, - ACPI_INTEGER Integer0, - ACPI_INTEGER Integer1, + UINT64 Integer0, + UINT64 Integer1, BOOLEAN *LogicalResult); ACPI_STATUS @@ -307,11 +307,11 @@ 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 @@ ACPI_STATUS AcpiExSystemDoSuspend( - ACPI_INTEGER Time); + UINT64 Time); ACPI_STATUS AcpiExSystemDoStall ( @@ -696,13 +696,13 @@ void AcpiExEisaIdToString ( - UINT32 NumericId, - char *OutString); + char *Dest, + UINT64 CompressedId); void -AcpiExUnsignedIntegerToString ( - ACPI_INTEGER Value, - char *OutString); +AcpiExIntegerToString ( + char *Dest, + UINT64 Value); /* @@ -713,7 +713,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -722,7 +722,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -731,7 +731,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -740,7 +740,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -749,7 +749,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -758,7 +758,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -767,7 +767,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -777,7 +777,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); Index: sys/contrib/dev/acpica/include/actbl1.h =================================================================== --- sys/contrib/dev/acpica/include/actbl1.h (revision 203510) +++ sys/contrib/dev/acpica/include/actbl1.h (working copy) @@ -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,42 +119,32 @@ /******************************************************************************* * - * Additional ACPI Tables + * Additional ACPI Tables (1) * * These tables are not consumed directly by the ACPICA subsystem, but are * included here to support device drivers and the AML disassembler. * + * The tables in this file are fully defined within the ACPI specification. + * ******************************************************************************/ /* - * Values for description table header signatures. Useful because they make - * it more difficult to inadvertently type in the wrong signature. + * Values for description table header signatures for tables defined in this + * file. Useful because they make it more difficult to inadvertently type in + * the wrong signature. */ -#define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */ #define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */ -#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */ #define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */ -#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */ -#define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */ #define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */ #define ACPI_SIG_EINJ "EINJ" /* Error Injection table */ #define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */ #define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */ -#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */ -#define ACPI_SIG_IBFT "IBFT" /* iSCSI Boot Firmware Table */ #define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */ -#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */ +#define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */ #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */ -#define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */ #define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */ -#define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */ -#define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */ #define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */ -#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */ -#define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */ -#define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */ -#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */ /* @@ -170,8 +160,14 @@ */ -/* Common Subtable header (used in MADT, SRAT, etc.) */ +/******************************************************************************* + * + * Common subtable headers + * + ******************************************************************************/ +/* Generic subtable header (used in MADT, SRAT, etc.) */ + typedef struct acpi_subtable_header { UINT8 Type; @@ -180,7 +176,7 @@ } ACPI_SUBTABLE_HEADER; -/* Common Subtable header for WHEA tables (EINJ, ERST, WDAT) */ +/* Subtable header for WHEA tables (EINJ, ERST, WDAT) */ typedef struct acpi_whea_header { @@ -197,141 +193,11 @@ /******************************************************************************* * - * ASF - Alert Standard Format table (Signature "ASF!") + * BERT - Boot Error Record Table (ACPI 4.0) + * Version 1 * - * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003 - * ******************************************************************************/ -typedef struct acpi_table_asf -{ - ACPI_TABLE_HEADER Header; /* Common ACPI table header */ - -} ACPI_TABLE_ASF; - - -/* ASF subtable header */ - -typedef struct acpi_asf_header -{ - UINT8 Type; - UINT8 Reserved; - UINT16 Length; - -} ACPI_ASF_HEADER; - - -/* Values for Type field above */ - -enum AcpiAsfType -{ - ACPI_ASF_TYPE_INFO = 0, - ACPI_ASF_TYPE_ALERT = 1, - ACPI_ASF_TYPE_CONTROL = 2, - ACPI_ASF_TYPE_BOOT = 3, - ACPI_ASF_TYPE_ADDRESS = 4, - ACPI_ASF_TYPE_RESERVED = 5 -}; - -/* - * ASF subtables - */ - -/* 0: ASF Information */ - -typedef struct acpi_asf_info -{ - ACPI_ASF_HEADER Header; - UINT8 MinResetValue; - UINT8 MinPollInterval; - UINT16 SystemId; - UINT32 MfgId; - UINT8 Flags; - UINT8 Reserved2[3]; - -} ACPI_ASF_INFO; - -/* 1: ASF Alerts */ - -typedef struct acpi_asf_alert -{ - ACPI_ASF_HEADER Header; - UINT8 AssertMask; - UINT8 DeassertMask; - UINT8 Alerts; - UINT8 DataLength; - -} ACPI_ASF_ALERT; - -typedef struct acpi_asf_alert_data -{ - UINT8 Address; - UINT8 Command; - UINT8 Mask; - UINT8 Value; - UINT8 SensorType; - UINT8 Type; - UINT8 Offset; - UINT8 SourceType; - UINT8 Severity; - UINT8 SensorNumber; - UINT8 Entity; - UINT8 Instance; - -} ACPI_ASF_ALERT_DATA; - -/* 2: ASF Remote Control */ - -typedef struct acpi_asf_remote -{ - ACPI_ASF_HEADER Header; - UINT8 Controls; - UINT8 DataLength; - UINT16 Reserved2; - -} ACPI_ASF_REMOTE; - -typedef struct acpi_asf_control_data -{ - UINT8 Function; - UINT8 Address; - UINT8 Command; - UINT8 Value; - -} ACPI_ASF_CONTROL_DATA; - -/* 3: ASF RMCP Boot Options */ - -typedef struct acpi_asf_rmcp -{ - ACPI_ASF_HEADER Header; - UINT8 Capabilities[7]; - UINT8 CompletionCode; - UINT32 EnterpriseId; - UINT8 Command; - UINT16 Parameter; - UINT16 BootOptions; - UINT16 OemParameters; - -} ACPI_ASF_RMCP; - -/* 4: ASF Address */ - -typedef struct acpi_asf_address -{ - ACPI_ASF_HEADER Header; - UINT8 EpromAddress; - UINT8 Devices; - -} ACPI_ASF_ADDRESS; - - -/******************************************************************************* - * - * BERT - Boot Error Record Table - * - ******************************************************************************/ - typedef struct acpi_table_bert { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ @@ -341,44 +207,47 @@ } ACPI_TABLE_BERT; -/* Boot Error Region */ +/* Boot Error Region (not a subtable, pointed to by Address field above) */ typedef struct acpi_bert_region { - UINT32 BlockStatus; - UINT32 RawDataOffset; - UINT32 RawDataLength; - UINT32 DataLength; - UINT32 ErrorSeverity; + UINT32 BlockStatus; /* Type of error information */ + UINT32 RawDataOffset; /* Offset to raw error data */ + UINT32 RawDataLength; /* Length of raw error data */ + UINT32 DataLength; /* Length of generic error data */ + UINT32 ErrorSeverity; /* Severity code */ } ACPI_BERT_REGION; -/* BlockStatus Flags */ +/* Values for BlockStatus flags above */ #define ACPI_BERT_UNCORRECTABLE (1) -#define ACPI_BERT_CORRECTABLE (2) -#define ACPI_BERT_MULTIPLE_UNCORRECTABLE (4) -#define ACPI_BERT_MULTIPLE_CORRECTABLE (8) +#define ACPI_BERT_CORRECTABLE (1<<1) +#define ACPI_BERT_MULTIPLE_UNCORRECTABLE (1<<2) +#define ACPI_BERT_MULTIPLE_CORRECTABLE (1<<3) +#define ACPI_BERT_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */ +/* Values for ErrorSeverity above */ -/******************************************************************************* - * - * BOOT - Simple Boot Flag Table - * - ******************************************************************************/ - -typedef struct acpi_table_boot +enum AcpiBertErrorSeverity { - ACPI_TABLE_HEADER Header; /* Common ACPI table header */ - UINT8 CmosIndex; /* Index in CMOS RAM for the boot register */ - UINT8 Reserved[3]; + ACPI_BERT_ERROR_CORRECTABLE = 0, + ACPI_BERT_ERROR_FATAL = 1, + ACPI_BERT_ERROR_CORRECTED = 2, + ACPI_BERT_ERROR_NONE = 3, + ACPI_BERT_ERROR_RESERVED = 4 /* 4 and greater are reserved */ +}; -} ACPI_TABLE_BOOT; +/* + * Note: The generic error data that follows the ErrorSeverity field above + * uses the ACPI_HEST_GENERIC_DATA defined under the HEST table below + */ /******************************************************************************* * - * CPEP - Corrected Platform Error Polling table + * CPEP - Corrected Platform Error Polling table (ACPI 4.0) + * Version 1 * ******************************************************************************/ @@ -394,8 +263,7 @@ typedef struct acpi_cpep_polling { - UINT8 Type; - UINT8 Length; + ACPI_SUBTABLE_HEADER Header; UINT8 Id; /* Processor ID */ UINT8 Eid; /* Processor EID */ UINT32 Interval; /* Polling interval (msec) */ @@ -405,143 +273,8 @@ /******************************************************************************* * - * DBGP - Debug Port table - * - ******************************************************************************/ - -typedef struct acpi_table_dbgp -{ - ACPI_TABLE_HEADER Header; /* Common ACPI table header */ - UINT8 Type; /* 0=full 16550, 1=subset of 16550 */ - UINT8 Reserved[3]; - ACPI_GENERIC_ADDRESS DebugPort; - -} ACPI_TABLE_DBGP; - - -/******************************************************************************* - * - * DMAR - DMA Remapping table - * From "Intel Virtualization Technology for Directed I/O", Sept. 2007 - * - ******************************************************************************/ - -typedef struct acpi_table_dmar -{ - ACPI_TABLE_HEADER Header; /* Common ACPI table header */ - UINT8 Width; /* Host Address Width */ - UINT8 Flags; - UINT8 Reserved[10]; - -} ACPI_TABLE_DMAR; - -/* Flags */ - -#define ACPI_DMAR_INTR_REMAP (1) - -/* DMAR subtable header */ - -typedef struct acpi_dmar_header -{ - UINT16 Type; - UINT16 Length; - -} ACPI_DMAR_HEADER; - -/* Values for subtable type in ACPI_DMAR_HEADER */ - -enum AcpiDmarType -{ - ACPI_DMAR_TYPE_HARDWARE_UNIT = 0, - ACPI_DMAR_TYPE_RESERVED_MEMORY = 1, - ACPI_DMAR_TYPE_ATSR = 2, - ACPI_DMAR_TYPE_RESERVED = 3 /* 3 and greater are reserved */ -}; - -typedef struct acpi_dmar_device_scope -{ - UINT8 EntryType; - UINT8 Length; - UINT16 Reserved; - UINT8 EnumerationId; - UINT8 Bus; - -} ACPI_DMAR_DEVICE_SCOPE; - -/* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE */ - -enum AcpiDmarScopeType -{ - ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0, - ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1, - ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2, - ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3, - ACPI_DMAR_SCOPE_TYPE_HPET = 4, - ACPI_DMAR_SCOPE_TYPE_RESERVED = 5 /* 5 and greater are reserved */ -}; - -typedef struct acpi_dmar_pci_path -{ - UINT8 Device; - UINT8 Function; - -} ACPI_DMAR_PCI_PATH; - -/* - * DMAR Sub-tables, correspond to Type in ACPI_DMAR_HEADER - */ - -/* 0: Hardware Unit Definition */ - -typedef struct acpi_dmar_hardware_unit -{ - ACPI_DMAR_HEADER Header; - UINT8 Flags; - UINT8 Reserved; - UINT16 Segment; - UINT64 Address; /* Register Base Address */ - -} ACPI_DMAR_HARDWARE_UNIT; - -/* Flags */ - -#define ACPI_DMAR_INCLUDE_ALL (1) - -/* 1: Reserved Memory Defininition */ - -typedef struct acpi_dmar_reserved_memory -{ - ACPI_DMAR_HEADER Header; - UINT16 Reserved; - UINT16 Segment; - UINT64 BaseAddress; /* 4K aligned base address */ - UINT64 EndAddress; /* 4K aligned limit address */ - -} ACPI_DMAR_RESERVED_MEMORY; - -/* Flags */ - -#define ACPI_DMAR_ALLOW_ALL (1) - -/* 2: Root Port ATS Capability Reporting Structure */ - -typedef struct acpi_dmar_atsr -{ - ACPI_DMAR_HEADER Header; - UINT8 Flags; - UINT8 Reserved; - UINT16 Segment; - -} ACPI_DMAR_ATSR; - -/* Flags */ - -#define ACPI_DMAR_ALL_PORTS (1) - - -/******************************************************************************* - * * ECDT - Embedded Controller Boot Resources Table + * Version 1 * ******************************************************************************/ @@ -559,7 +292,8 @@ /******************************************************************************* * - * EINJ - Error Injection Table + * EINJ - Error Injection Table (ACPI 4.0) + * Version 1 * ******************************************************************************/ @@ -567,11 +301,13 @@ { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT32 HeaderLength; - UINT32 Reserved; + UINT8 Flags; + UINT8 Reserved[3]; UINT32 Entries; } ACPI_TABLE_EINJ; + /* EINJ Injection Instruction Entries (actions) */ typedef struct acpi_einj_entry @@ -580,6 +316,10 @@ } ACPI_EINJ_ENTRY; +/* Masks for Flags field above */ + +#define ACPI_EINJ_PRESERVE (1) + /* Values for Action field above */ enum AcpiEinjActions @@ -608,6 +348,7 @@ ACPI_EINJ_INSTRUCTION_RESERVED = 5 /* 5 and greater are reserved */ }; + /* EINJ Trigger Error Action Table */ typedef struct acpi_einj_trigger @@ -619,10 +360,37 @@ } ACPI_EINJ_TRIGGER; +/* Command status return values */ +enum AcpiEinjCommandStatus +{ + ACPI_EINJ_SUCCESS = 0, + ACPI_EINJ_FAILURE = 1, + ACPI_EINJ_INVALID_ACCESS = 2, + ACPI_EINJ_STATUS_RESERVED = 3 /* 3 and greater are reserved */ +}; + + +/* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */ + +#define ACPI_EINJ_PROCESSOR_CORRECTABLE (1) +#define ACPI_EINJ_PROCESSOR_UNCORRECTABLE (1<<1) +#define ACPI_EINJ_PROCESSOR_FATAL (1<<2) +#define ACPI_EINJ_MEMORY_CORRECTABLE (1<<3) +#define ACPI_EINJ_MEMORY_UNCORRECTABLE (1<<4) +#define ACPI_EINJ_MEMORY_FATAL (1<<5) +#define ACPI_EINJ_PCIX_CORRECTABLE (1<<6) +#define ACPI_EINJ_PCIX_UNCORRECTABLE (1<<7) +#define ACPI_EINJ_PCIX_FATAL (1<<8) +#define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9) +#define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10) +#define ACPI_EINJ_PLATFORM_FATAL (1<<11) + + /******************************************************************************* * - * ERST - Error Record Serialization Table + * ERST - Error Record Serialization Table (ACPI 4.0) + * Version 1 * ******************************************************************************/ @@ -635,6 +403,7 @@ } ACPI_TABLE_ERST; + /* ERST Serialization Entries (actions) */ typedef struct acpi_erst_entry @@ -643,20 +412,24 @@ } ACPI_ERST_ENTRY; +/* Masks for Flags field above */ + +#define ACPI_ERST_PRESERVE (1) + /* Values for Action field above */ enum AcpiErstActions { - ACPI_ERST_BEGIN_WRITE_OPERATION = 0, - ACPI_ERST_BEGIN_READ_OPERATION = 1, - ACPI_ERST_BETGIN_CLEAR_OPERATION= 2, - ACPI_ERST_END_OPERATION = 3, + ACPI_ERST_BEGIN_WRITE = 0, + ACPI_ERST_BEGIN_READ = 1, + ACPI_ERST_BEGIN_CLEAR = 2, + ACPI_ERST_END = 3, ACPI_ERST_SET_RECORD_OFFSET = 4, ACPI_ERST_EXECUTE_OPERATION = 5, ACPI_ERST_CHECK_BUSY_STATUS = 6, ACPI_ERST_GET_COMMAND_STATUS = 7, - ACPI_ERST_GET_RECORD_IDENTIFIER = 8, - ACPI_ERST_SET_RECORD_IDENTIFIER = 9, + ACPI_ERST_GET_RECORD_ID = 8, + ACPI_ERST_SET_RECORD_ID = 9, ACPI_ERST_GET_RECORD_COUNT = 10, ACPI_ERST_BEGIN_DUMMY_WRIITE = 11, ACPI_ERST_NOT_USED = 12, @@ -692,10 +465,34 @@ ACPI_ERST_INSTRUCTION_RESERVED = 19 /* 19 and greater are reserved */ }; +/* Command status return values */ +enum AcpiErstCommandStatus +{ + ACPI_ERST_SUCESS = 0, + ACPI_ERST_NO_SPACE = 1, + ACPI_ERST_NOT_AVAILABLE = 2, + ACPI_ERST_FAILURE = 3, + ACPI_ERST_RECORD_EMPTY = 4, + ACPI_ERST_NOT_FOUND = 5, + ACPI_ERST_STATUS_RESERVED = 6 /* 6 and greater are reserved */ +}; + + +/* Error Record Serialization Information */ + +typedef struct acpi_erst_info +{ + UINT16 Signature; /* Should be "ER" */ + UINT8 Data[48]; + +} ACPI_ERST_INFO; + + /******************************************************************************* * - * HEST - Hardware Error Source Table + * HEST - Hardware Error Source Table (ACPI 4.0) + * Version 1 * ******************************************************************************/ @@ -712,6 +509,7 @@ typedef struct acpi_hest_header { UINT16 Type; + UINT16 SourceId; } ACPI_HEST_HEADER; @@ -720,93 +518,70 @@ enum AcpiHestTypes { - ACPI_HEST_TYPE_XPF_MACHINE_CHECK = 0, - ACPI_HEST_TYPE_XPF_CORRECTED_MACHINE_CHECK = 1, - ACPI_HEST_TYPE_XPF_UNUSED = 2, - ACPI_HEST_TYPE_XPF_NON_MASKABLE_INTERRUPT = 3, - ACPI_HEST_TYPE_IPF_CORRECTED_MACHINE_CHECK = 4, - ACPI_HEST_TYPE_IPF_CORRECTED_PLATFORM_ERROR = 5, - ACPI_HEST_TYPE_AER_ROOT_PORT = 6, - ACPI_HEST_TYPE_AER_ENDPOINT = 7, - ACPI_HEST_TYPE_AER_BRIDGE = 8, - ACPI_HEST_TYPE_GENERIC_HARDWARE_ERROR_SOURCE = 9, - ACPI_HEST_TYPE_RESERVED = 10 /* 10 and greater are reserved */ + ACPI_HEST_TYPE_IA32_CHECK = 0, + ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1, + ACPI_HEST_TYPE_IA32_NMI = 2, + ACPI_HEST_TYPE_NOT_USED3 = 3, + ACPI_HEST_TYPE_NOT_USED4 = 4, + ACPI_HEST_TYPE_NOT_USED5 = 5, + ACPI_HEST_TYPE_AER_ROOT_PORT = 6, + ACPI_HEST_TYPE_AER_ENDPOINT = 7, + ACPI_HEST_TYPE_AER_BRIDGE = 8, + ACPI_HEST_TYPE_GENERIC_ERROR = 9, + ACPI_HEST_TYPE_RESERVED = 10 /* 10 and greater are reserved */ }; /* - * HEST Sub-subtables + * HEST substructures contained in subtables */ -/* XPF Machine Check Error Bank */ - -typedef struct acpi_hest_xpf_error_bank +/* + * IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and + * ACPI_HEST_IA_CORRECTED structures. + */ +typedef struct acpi_hest_ia_error_bank { UINT8 BankNumber; UINT8 ClearStatusOnInit; UINT8 StatusFormat; - UINT8 ConfigWriteEnable; + UINT8 Reserved; UINT32 ControlRegister; - UINT64 ControlInitData; + UINT64 ControlData; UINT32 StatusRegister; UINT32 AddressRegister; UINT32 MiscRegister; -} ACPI_HEST_XPF_ERROR_BANK; +} ACPI_HEST_IA_ERROR_BANK; -/* Generic Error Status */ +/* Common HEST sub-structure for PCI/AER structures below (6,7,8) */ -typedef struct acpi_hest_generic_status -{ - UINT32 BlockStatus; - UINT32 RawDataOffset; - UINT32 RawDataLength; - UINT32 DataLength; - UINT32 ErrorSeverity; - -} ACPI_HEST_GENERIC_STATUS; - - -/* Generic Error Data */ - -typedef struct acpi_hest_generic_data -{ - UINT8 SectionType[16]; - UINT32 ErrorSeverity; - UINT16 Revision; - UINT8 ValidationBits; - UINT8 Flags; - UINT32 ErrorDataLength; - UINT8 FruId[16]; - UINT8 FruText[20]; - -} ACPI_HEST_GENERIC_DATA; - - -/* Common HEST structure for PCI/AER types below (6,7,8) */ - typedef struct acpi_hest_aer_common { - UINT16 SourceId; - UINT16 ConfigWriteEnable; + UINT16 Reserved1; UINT8 Flags; UINT8 Enabled; - UINT32 RecordsToPreAllocate; + UINT32 RecordsToPreallocate; UINT32 MaxSectionsPerRecord; UINT32 Bus; UINT16 Device; UINT16 Function; UINT16 DeviceControl; - UINT16 Reserved; - UINT32 UncorrectableErrorMask; - UINT32 UncorrectableErrorSeverity; - UINT32 CorrectableErrorMask; - UINT32 AdvancedErrorCapabilities; + UINT16 Reserved2; + UINT32 UncorrectableMask; + UINT32 UncorrectableSeverity; + UINT32 CorrectableMask; + UINT32 AdvancedCapabilities; } ACPI_HEST_AER_COMMON; +/* Masks for HEST Flags fields */ +#define ACPI_HEST_FIRMWARE_FIRST (1) +#define ACPI_HEST_GLOBAL (1<<1) + + /* Hardware Error Notification */ typedef struct acpi_hest_notify @@ -835,88 +610,70 @@ ACPI_HEST_NOTIFY_RESERVED = 5 /* 5 and greater are reserved */ }; +/* Values for ConfigWriteEnable bitfield above */ +#define ACPI_HEST_TYPE (1) +#define ACPI_HEST_POLL_INTERVAL (1<<1) +#define ACPI_HEST_POLL_THRESHOLD_VALUE (1<<2) +#define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3) +#define ACPI_HEST_ERR_THRESHOLD_VALUE (1<<4) +#define ACPI_HEST_ERR_THRESHOLD_WINDOW (1<<5) + + /* * HEST subtables - * - * From WHEA Design Document, 16 May 2007. - * Note: There is no subtable type 2 in this version of the document, - * and there are two different subtable type 3s. */ - /* 0: XPF Machine Check Exception */ +/* 0: IA32 Machine Check Exception */ -typedef struct acpi_hest_xpf_machine_check +typedef struct acpi_hest_ia_machine_check { ACPI_HEST_HEADER Header; - UINT16 SourceId; - UINT16 ConfigWriteEnable; + UINT16 Reserved1; UINT8 Flags; - UINT8 Reserved1; - UINT32 RecordsToPreAllocate; + UINT8 Enabled; + UINT32 RecordsToPreallocate; UINT32 MaxSectionsPerRecord; UINT64 GlobalCapabilityData; UINT64 GlobalControlData; UINT8 NumHardwareBanks; - UINT8 Reserved2[7]; + UINT8 Reserved3[7]; -} ACPI_HEST_XPF_MACHINE_CHECK; +} ACPI_HEST_IA_MACHINE_CHECK; -/* 1: XPF Corrected Machine Check */ +/* 1: IA32 Corrected Machine Check */ -typedef struct acpi_table_hest_xpf_corrected +typedef struct acpi_hest_ia_corrected { ACPI_HEST_HEADER Header; - UINT16 SourceId; - UINT16 ConfigWriteEnable; + UINT16 Reserved1; UINT8 Flags; UINT8 Enabled; - UINT32 RecordsToPreAllocate; + UINT32 RecordsToPreallocate; UINT32 MaxSectionsPerRecord; ACPI_HEST_NOTIFY Notify; UINT8 NumHardwareBanks; - UINT8 Reserved[3]; + UINT8 Reserved2[3]; -} ACPI_HEST_XPF_CORRECTED; +} ACPI_HEST_IA_CORRECTED; -/* 3: XPF Non-Maskable Interrupt */ +/* 2: IA32 Non-Maskable Interrupt */ -typedef struct acpi_hest_xpf_nmi +typedef struct acpi_hest_ia_nmi { ACPI_HEST_HEADER Header; - UINT16 SourceId; UINT32 Reserved; - UINT32 RecordsToPreAllocate; + UINT32 RecordsToPreallocate; UINT32 MaxSectionsPerRecord; UINT32 MaxRawDataLength; -} ACPI_HEST_XPF_NMI; +} ACPI_HEST_IA_NMI; -/* 4: IPF Corrected Machine Check */ +/* 3,4,5: Not used */ -typedef struct acpi_hest_ipf_corrected -{ - ACPI_HEST_HEADER Header; - UINT8 Enabled; - UINT8 Reserved; - -} ACPI_HEST_IPF_CORRECTED; - - -/* 5: IPF Corrected Platform Error */ - -typedef struct acpi_hest_ipf_corrected_platform -{ - ACPI_HEST_HEADER Header; - UINT8 Enabled; - UINT8 Reserved; - -} ACPI_HEST_IPF_CORRECTED_PLATFORM; - - /* 6: PCI Express Root Port AER */ typedef struct acpi_hest_aer_root @@ -944,9 +701,9 @@ { ACPI_HEST_HEADER Header; ACPI_HEST_AER_COMMON Aer; - UINT32 SecondaryUncorrectableErrorMask; - UINT32 SecondaryUncorrectableErrorSeverity; - UINT32 SecondaryAdvancedCapabilities; + UINT32 UncorrectableMask2; + UINT32 UncorrectableSeverity2; + UINT32 AdvancedCapabilities2; } ACPI_HEST_AER_BRIDGE; @@ -956,156 +713,60 @@ typedef struct acpi_hest_generic { ACPI_HEST_HEADER Header; - UINT16 SourceId; UINT16 RelatedSourceId; - UINT8 ConfigWriteEnable; + UINT8 Reserved; UINT8 Enabled; - UINT32 RecordsToPreAllocate; + UINT32 RecordsToPreallocate; UINT32 MaxSectionsPerRecord; UINT32 MaxRawDataLength; ACPI_GENERIC_ADDRESS ErrorStatusAddress; ACPI_HEST_NOTIFY Notify; - UINT32 ErrorStatusBlockLength; + UINT32 ErrorBlockLength; } ACPI_HEST_GENERIC; -/******************************************************************************* - * - * HPET - High Precision Event Timer table - * - ******************************************************************************/ +/* Generic Error Status block */ -typedef struct acpi_table_hpet +typedef struct acpi_hest_generic_status { - ACPI_TABLE_HEADER Header; /* Common ACPI table header */ - UINT32 Id; /* Hardware ID of event timer block */ - ACPI_GENERIC_ADDRESS Address; /* Address of event timer block */ - UINT8 Sequence; /* HPET sequence number */ - UINT16 MinimumTick; /* Main counter min tick, periodic mode */ - UINT8 Flags; + UINT32 BlockStatus; + UINT32 RawDataOffset; + UINT32 RawDataLength; + UINT32 DataLength; + UINT32 ErrorSeverity; -} ACPI_TABLE_HPET; +} ACPI_HEST_GENERIC_STATUS; -/*! Flags */ +/* Values for BlockStatus flags above */ -#define ACPI_HPET_PAGE_PROTECT (1) /* 00: No page protection */ -#define ACPI_HPET_PAGE_PROTECT_4 (1<<1) /* 01: 4KB page protected */ -#define ACPI_HPET_PAGE_PROTECT_64 (1<<2) /* 02: 64KB page protected */ +#define ACPI_HEST_UNCORRECTABLE (1) +#define ACPI_HEST_CORRECTABLE (1<<1) +#define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2) +#define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3) +#define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */ -/*! [End] no source code translation !*/ +/* Generic Error Data entry */ -/******************************************************************************* - * - * IBFT - Boot Firmware Table - * - ******************************************************************************/ - -typedef struct acpi_table_ibft +typedef struct acpi_hest_generic_data { - ACPI_TABLE_HEADER Header; /* Common ACPI table header */ - UINT8 Reserved[12]; - -} ACPI_TABLE_IBFT; - - -/* IBFT common subtable header */ - -typedef struct acpi_ibft_header -{ - UINT8 Type; - UINT8 Version; - UINT16 Length; - UINT8 Index; + UINT8 SectionType[16]; + UINT32 ErrorSeverity; + UINT16 Revision; + UINT8 ValidationBits; UINT8 Flags; + UINT32 ErrorDataLength; + UINT8 FruId[16]; + UINT8 FruText[20]; -} ACPI_IBFT_HEADER; +} ACPI_HEST_GENERIC_DATA; -/* Values for Type field above */ - -enum AcpiIbftType -{ - ACPI_IBFT_TYPE_NOT_USED = 0, - ACPI_IBFT_TYPE_CONTROL = 1, - ACPI_IBFT_TYPE_INITIATOR = 2, - ACPI_IBFT_TYPE_NIC = 3, - ACPI_IBFT_TYPE_TARGET = 4, - ACPI_IBFT_TYPE_EXTENSIONS = 5, - ACPI_IBFT_TYPE_RESERVED = 6 /* 6 and greater are reserved */ -}; - - -/* IBFT subtables */ - -typedef struct acpi_ibft_control -{ - ACPI_IBFT_HEADER Header; - UINT16 Extensions; - UINT16 InitiatorOffset; - UINT16 Nic0Offset; - UINT16 Target0Offset; - UINT16 Nic1Offset; - UINT16 Target1Offset; - -} ACPI_IBFT_CONTROL; - -typedef struct acpi_ibft_initiator -{ - ACPI_IBFT_HEADER Header; - UINT8 SnsServer[16]; - UINT8 SlpServer[16]; - UINT8 PrimaryServer[16]; - UINT8 SecondaryServer[16]; - UINT16 NameLength; - UINT16 NameOffset; - -} ACPI_IBFT_INITIATOR; - -typedef struct acpi_ibft_nic -{ - ACPI_IBFT_HEADER Header; - UINT8 IpAddress[16]; - UINT8 SubnetMaskPrefix; - UINT8 Origin; - UINT8 Gateway[16]; - UINT8 PrimaryDns[16]; - UINT8 SecondaryDns[16]; - UINT8 Dhcp[16]; - UINT16 Vlan; - UINT8 MacAddress[6]; - UINT16 PciAddress; - UINT16 NameLength; - UINT16 NameOffset; - -} ACPI_IBFT_NIC; - -typedef struct acpi_ibft_target -{ - ACPI_IBFT_HEADER Header; - UINT8 TargetIpAddress[16]; - UINT16 TargetIpSocket; - UINT8 TargetBootLun[8]; - UINT8 ChapType; - UINT8 NicAssociation; - UINT16 TargetNameLength; - UINT16 TargetNameOffset; - UINT16 ChapNameLength; - UINT16 ChapNameOffset; - UINT16 ChapSecretLength; - UINT16 ChapSecretOffset; - UINT16 ReverseChapNameLength; - UINT16 ReverseChapNameOffset; - UINT16 ReverseChapSecretLength; - UINT16 ReverseChapSecretOffset; - -} ACPI_IBFT_TARGET; - - /******************************************************************************* * * MADT - Multiple APIC Description Table + * Version 3 * ******************************************************************************/ @@ -1117,9 +778,9 @@ } ACPI_TABLE_MADT; -/* Flags */ +/* Masks for Flags field above */ -#define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */ +#define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */ /* Values for PCATCompat flag */ @@ -1127,7 +788,7 @@ #define ACPI_MADT_MULTIPLE_APIC 1 -/* Values for subtable type in ACPI_SUBTABLE_HEADER */ +/* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */ enum AcpiMadtType { @@ -1161,6 +822,7 @@ } ACPI_MADT_LOCAL_APIC; + /* 1: IO APIC */ typedef struct acpi_madt_io_apic @@ -1173,6 +835,7 @@ } ACPI_MADT_IO_APIC; + /* 2: Interrupt Override */ typedef struct acpi_madt_interrupt_override @@ -1185,6 +848,7 @@ } ACPI_MADT_INTERRUPT_OVERRIDE; + /* 3: NMI Source */ typedef struct acpi_madt_nmi_source @@ -1195,6 +859,7 @@ } ACPI_MADT_NMI_SOURCE; + /* 4: Local APIC NMI */ typedef struct acpi_madt_local_apic_nmi @@ -1206,6 +871,7 @@ } ACPI_MADT_LOCAL_APIC_NMI; + /* 5: Address Override */ typedef struct acpi_madt_local_apic_override @@ -1216,6 +882,7 @@ } ACPI_MADT_LOCAL_APIC_OVERRIDE; + /* 6: I/O Sapic */ typedef struct acpi_madt_io_sapic @@ -1228,6 +895,7 @@ } ACPI_MADT_IO_SAPIC; + /* 7: Local Sapic */ typedef struct acpi_madt_local_sapic @@ -1243,6 +911,7 @@ } ACPI_MADT_LOCAL_SAPIC; + /* 8: Platform Interrupt Source */ typedef struct acpi_madt_interrupt_source @@ -1258,12 +927,13 @@ } ACPI_MADT_INTERRUPT_SOURCE; -/* Flags field above */ +/* Masks for Flags field above */ #define ACPI_MADT_CPEI_OVERRIDE (1) -/* 9: Processor Local X2APIC (07/2008) */ +/* 9: Processor Local X2APIC (ACPI 4.0) */ + typedef struct acpi_madt_local_x2apic { ACPI_SUBTABLE_HEADER Header; @@ -1274,8 +944,9 @@ } ACPI_MADT_LOCAL_X2APIC; -/* 10: Local X2APIC NMI (07/2008) */ +/* 10: Local X2APIC NMI (ACPI 4.0) */ + typedef struct acpi_madt_local_x2apic_nmi { ACPI_SUBTABLE_HEADER Header; @@ -1315,34 +986,40 @@ /******************************************************************************* * - * MCFG - PCI Memory Mapped Configuration table and sub-table + * MSCT - Maximum System Characteristics Table (ACPI 4.0) + * Version 1 * ******************************************************************************/ -typedef struct acpi_table_mcfg +typedef struct acpi_table_msct { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ - UINT8 Reserved[8]; + UINT32 ProximityOffset; /* Location of proximity info struct(s) */ + UINT32 MaxProximityDomains;/* Max number of proximity domains */ + UINT32 MaxClockDomains; /* Max number of clock domains */ + UINT64 MaxAddress; /* Max physical address in system */ -} ACPI_TABLE_MCFG; +} ACPI_TABLE_MSCT; -/* Subtable */ +/* Subtable - Maximum Proximity Domain Information. Version 1 */ -typedef struct acpi_mcfg_allocation +typedef struct acpi_msct_proximity { - UINT64 Address; /* Base address, processor-relative */ - UINT16 PciSegment; /* PCI segment group number */ - UINT8 StartBusNumber; /* Starting PCI Bus number */ - UINT8 EndBusNumber; /* Final PCI Bus number */ - UINT32 Reserved; + UINT8 Revision; + UINT8 Length; + UINT32 RangeStart; /* Start of domain range */ + UINT32 RangeEnd; /* End of domain range */ + UINT32 ProcessorCapacity; + UINT64 MemoryCapacity; /* In bytes */ -} ACPI_MCFG_ALLOCATION; +} ACPI_MSCT_PROXIMITY; /******************************************************************************* * * SBST - Smart Battery Specification Table + * Version 1 * ******************************************************************************/ @@ -1359,6 +1036,7 @@ /******************************************************************************* * * SLIT - System Locality Distance Information Table + * Version 1 * ******************************************************************************/ @@ -1373,66 +1051,8 @@ /******************************************************************************* * - * SPCR - Serial Port Console Redirection table - * - ******************************************************************************/ - -typedef struct acpi_table_spcr -{ - ACPI_TABLE_HEADER Header; /* Common ACPI table header */ - UINT8 InterfaceType; /* 0=full 16550, 1=subset of 16550 */ - UINT8 Reserved[3]; - ACPI_GENERIC_ADDRESS SerialPort; - UINT8 InterruptType; - UINT8 PcInterrupt; - UINT32 Interrupt; - UINT8 BaudRate; - UINT8 Parity; - UINT8 StopBits; - UINT8 FlowControl; - UINT8 TerminalType; - UINT8 Reserved1; - UINT16 PciDeviceId; - UINT16 PciVendorId; - UINT8 PciBus; - UINT8 PciDevice; - UINT8 PciFunction; - UINT32 PciFlags; - UINT8 PciSegment; - UINT32 Reserved2; - -} ACPI_TABLE_SPCR; - - -/******************************************************************************* - * - * SPMI - Server Platform Management Interface table - * - ******************************************************************************/ - -typedef struct acpi_table_spmi -{ - ACPI_TABLE_HEADER Header; /* Common ACPI table header */ - UINT8 Reserved; - UINT8 InterfaceType; - UINT16 SpecRevision; /* Version of IPMI */ - UINT8 InterruptType; - UINT8 GpeNumber; /* GPE assigned */ - UINT8 Reserved1; - UINT8 PciDeviceFlag; - UINT32 Interrupt; - ACPI_GENERIC_ADDRESS IpmiRegister; - UINT8 PciSegment; - UINT8 PciBus; - UINT8 PciDevice; - UINT8 PciFunction; - -} ACPI_TABLE_SPMI; - - -/******************************************************************************* - * * SRAT - System Resource Affinity Table + * Version 3 * ******************************************************************************/ @@ -1472,6 +1092,11 @@ } ACPI_SRAT_CPU_AFFINITY; +/* Flags */ + +#define ACPI_SRAT_CPU_USE_AFFINITY (1) /* 00: Use affinity structure */ + + /* 1: Memory Affinity */ typedef struct acpi_srat_mem_affinity @@ -1493,8 +1118,9 @@ #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */ #define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */ -/* 2: Processor Local X2_APIC Affinity (07/2008) */ +/* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */ + typedef struct acpi_srat_x2apic_cpu_affinity { ACPI_SUBTABLE_HEADER Header; @@ -1502,6 +1128,8 @@ UINT32 ProximityDomain; UINT32 ApicId; UINT32 Flags; + UINT32 ClockDomain; + UINT32 Reserved2; } ACPI_SRAT_X2APIC_CPU_AFFINITY; @@ -1510,132 +1138,6 @@ #define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */ -/******************************************************************************* - * - * TCPA - Trusted Computing Platform Alliance table - * - ******************************************************************************/ - -typedef struct acpi_table_tcpa -{ - ACPI_TABLE_HEADER Header; /* Common ACPI table header */ - UINT16 Reserved; - UINT32 MaxLogLength; /* Maximum length for the event log area */ - UINT64 LogAddress; /* Address of the event log area */ - -} ACPI_TABLE_TCPA; - - -/******************************************************************************* - * - * UEFI - UEFI Boot optimization Table - * - ******************************************************************************/ - -typedef struct acpi_table_uefi -{ - ACPI_TABLE_HEADER Header; /* Common ACPI table header */ - UINT8 Identifier[16]; /* UUID identifier */ - UINT16 DataOffset; /* Offset of remaining data in table */ - UINT8 Data; - -} ACPI_TABLE_UEFI; - - -/******************************************************************************* - * - * WDAT - Watchdog Action Table - * - ******************************************************************************/ - -typedef struct acpi_table_wdat -{ - ACPI_TABLE_HEADER Header; /* Common ACPI table header */ - UINT32 HeaderLength; /* Watchdog Header Length */ - UINT16 PciSegment; /* PCI Segment number */ - UINT8 PciBus; /* PCI Bus number */ - UINT8 PciDevice; /* PCI Device number */ - UINT8 PciFunction; /* PCI Function number */ - UINT8 Reserved[3]; - UINT32 TimerPeriod; /* Period of one timer count (msec) */ - UINT32 MaxCount; /* Maximum counter value supported */ - UINT32 MinCount; /* Minimum counter value */ - UINT8 Flags; - UINT8 Reserved2[3]; - UINT32 Entries; /* Number of watchdog entries that follow */ - -} ACPI_TABLE_WDAT; - -/* WDAT Instruction Entries (actions) */ - -typedef struct acpi_wdat_entry -{ - ACPI_WHEA_HEADER WheaHeader; /* Common header for WHEA tables */ - -} ACPI_WDAT_ENTRY; - -/* Values for Action field above */ - -enum AcpiWdatActions -{ - ACPI_WDAT_RESET = 1, - ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4, - ACPI_WDAT_GET_COUNTDOWN = 5, - ACPI_WDAT_SET_COUNTDOWN = 6, - ACPI_WDAT_GET_RUNNING_STATE = 8, - ACPI_WDAT_SET_RUNNING_STATE = 9, - ACPI_WDAT_GET_STOPPED_STATE = 10, - ACPI_WDAT_SET_STOPPED_STATE = 11, - ACPI_WDAT_GET_REBOOT = 16, - ACPI_WDAT_SET_REBOOT = 17, - ACPI_WDAT_GET_SHUTDOWN = 18, - ACPI_WDAT_SET_SHUTDOWN = 19, - ACPI_WDAT_GET_STATUS = 32, - ACPI_WDAT_SET_STATUS = 33, - ACPI_WDAT_ACTION_RESERVED = 34 /* 34 and greater are reserved */ -}; - -/* Values for Instruction field above */ - -enum AcpiWdatInstructions -{ - ACPI_WDAT_READ_VALUE = 0, - ACPI_WDAT_READ_COUNTDOWN = 1, - ACPI_WDAT_WRITE_VALUE = 2, - ACPI_WDAT_WRITE_COUNTDOWN = 3, - ACPI_WDAT_INSTRUCTION_RESERVED = 4, /* 4 and greater are reserved */ - ACPI_WDAT_PRESERVE_REGISTER = 0x80 /* Except for this value */ -}; - - -/******************************************************************************* - * - * WDRT - Watchdog Resource Table - * - ******************************************************************************/ - -typedef struct acpi_table_wdrt -{ - ACPI_TABLE_HEADER Header; /* Common ACPI table header */ - UINT32 HeaderLength; /* Watchdog Header Length */ - UINT8 PciSegment; /* PCI Segment number */ - UINT8 PciBus; /* PCI Bus number */ - UINT8 PciDevice; /* PCI Device number */ - UINT8 PciFunction; /* PCI Function number */ - UINT32 TimerPeriod; /* Period of one timer count (msec) */ - UINT32 MaxCount; /* Maximum counter value supported */ - UINT32 MinCount; /* Minimum counter value */ - UINT8 Flags; - UINT8 Reserved[3]; - UINT32 Entries; /* Number of watchdog entries that follow */ - -} ACPI_TABLE_WDRT; - -/* Flags */ - -#define ACPI_WDRT_TIMER_ENABLED (1) /* 00: Timer enabled */ - - /* Reset to default packing */ #pragma pack() Index: sys/contrib/dev/acpica/include/actbl2.h =================================================================== --- sys/contrib/dev/acpica/include/actbl2.h (revision 203505) +++ sys/contrib/dev/acpica/include/actbl2.h (working copy) @@ -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 Index: sys/contrib/dev/acpica/include/amlresrc.h =================================================================== --- sys/contrib/dev/acpica/include/amlresrc.h (revision 203510) +++ sys/contrib/dev/acpica/include/amlresrc.h (working copy) @@ -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 Index: sys/contrib/dev/acpica/include/acexcep.h =================================================================== --- sys/contrib/dev/acpica/include/acexcep.h (revision 203510) +++ sys/contrib/dev/acpica/include/acexcep.h (working copy) @@ -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 Index: sys/contrib/dev/acpica/include/actypes.h =================================================================== --- sys/contrib/dev/acpica/include/actypes.h (revision 203510) +++ sys/contrib/dev/acpica/include/actypes.h (working copy) @@ -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 @@ -415,7 +415,7 @@ /* PM Timer ticks per second (HZ) */ -#define PM_TIMER_FREQUENCY 3579545 +#define PM_TIMER_FREQUENCY 3579545 /******************************************************************************* @@ -470,22 +470,7 @@ } 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,7 +485,20 @@ #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 + /******************************************************************************* * * Commonly used macros @@ -816,7 +814,8 @@ #define ACPI_ADR_SPACE_SMBUS (ACPI_ADR_SPACE_TYPE) 4 #define ACPI_ADR_SPACE_CMOS (ACPI_ADR_SPACE_TYPE) 5 #define ACPI_ADR_SPACE_PCI_BAR_TARGET (ACPI_ADR_SPACE_TYPE) 6 -#define ACPI_ADR_SPACE_DATA_TABLE (ACPI_ADR_SPACE_TYPE) 7 +#define ACPI_ADR_SPACE_IPMI (ACPI_ADR_SPACE_TYPE) 7 +#define ACPI_ADR_SPACE_DATA_TABLE (ACPI_ADR_SPACE_TYPE) 8 #define ACPI_ADR_SPACE_FIXED_HARDWARE (ACPI_ADR_SPACE_TYPE) 127 @@ -889,7 +888,7 @@ struct { ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_INTEGER */ - ACPI_INTEGER Value; /* The actual number */ + UINT64 Value; /* The actual number */ } Integer; struct @@ -1056,7 +1055,6 @@ typedef void (*ACPI_OBJECT_HANDLER) ( ACPI_HANDLE Object, - UINT32 Function, void *Data); typedef @@ -1094,7 +1092,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); @@ -1123,47 +1121,68 @@ #define ACPI_INTERRUPT_NOT_HANDLED 0x00 #define ACPI_INTERRUPT_HANDLED 0x01 +/* Length of 32-bit EISAID values when converted back to a string */ -/* Length of _HID, _UID, _CID, and UUID values */ +#define ACPI_EISAID_STRING_SIZE 8 /* Includes null terminator */ -#define ACPI_DEVICE_ID_LENGTH 0x09 -#define ACPI_MAX_CID_LENGTH 48 +/* Length of UUID (string) values */ + #define ACPI_UUID_LENGTH 16 -/* Common string version of device HIDs and UIDs */ +/* Structures used for device/processor HID, UID, CID */ + typedef struct acpi_device_id { - char Value[ACPI_DEVICE_ID_LENGTH]; + UINT32 Length; /* Length of string + null */ + char *String; } ACPI_DEVICE_ID; -/* Common string version of device CIDs */ - -typedef struct acpi_compatible_id +typedef struct acpi_device_id_list { - char Value[ACPI_MAX_CID_LENGTH]; + UINT32 Count; /* Number of IDs in Ids array */ + UINT32 ListSize; /* Size of list, including ID strings */ + ACPI_DEVICE_ID Ids[1]; /* ID array */ -} ACPI_COMPATIBLE_ID; +} ACPI_DEVICE_ID_LIST; -typedef struct acpi_compatible_id_list +/* + * Structure returned from AcpiGetObjectInfo. + * Optimized for both 32- and 64-bit builds + */ +typedef struct acpi_device_info { - UINT32 Count; - UINT32 Size; - ACPI_COMPATIBLE_ID Id[1]; + UINT32 InfoSize; /* Size of info, including ID strings */ + UINT32 Name; /* ACPI object Name */ + ACPI_OBJECT_TYPE Type; /* ACPI object Type */ + UINT8 ParamCount; /* If a method, required parameter count */ + UINT8 Valid; /* Indicates which optional fields are valid */ + UINT8 Flags; /* Miscellaneous info */ + UINT8 HighestDstates[4]; /* _SxD values: 0xFF indicates not valid */ + UINT8 LowestDstates[5]; /* _SxW values: 0xFF indicates not valid */ + UINT32 CurrentStatus; /* _STA value */ + UINT64 Address; /* _ADR value */ + ACPI_DEVICE_ID HardwareId; /* _HID value */ + ACPI_DEVICE_ID UniqueId; /* _UID value */ + ACPI_DEVICE_ID_LIST CompatibleIdList; /* _CID list */ -} ACPI_COMPATIBLE_ID_LIST; +} ACPI_DEVICE_INFO; +/* Values for Flags field above (AcpiGetObjectInfo) */ -/* Structure and flags for AcpiGetObjectInfo */ +#define ACPI_PCI_ROOT_BRIDGE 0x01 -#define ACPI_VALID_STA 0x0001 -#define ACPI_VALID_ADR 0x0002 -#define ACPI_VALID_HID 0x0004 -#define ACPI_VALID_UID 0x0008 -#define ACPI_VALID_CID 0x0010 -#define ACPI_VALID_SXDS 0x0020 +/* Flags for Valid field above (AcpiGetObjectInfo) */ +#define ACPI_VALID_STA 0x01 +#define ACPI_VALID_ADR 0x02 +#define ACPI_VALID_HID 0x04 +#define ACPI_VALID_UID 0x08 +#define ACPI_VALID_CID 0x10 +#define ACPI_VALID_SXDS 0x20 +#define ACPI_VALID_SXWS 0x40 + /* Flags for _STA method */ #define ACPI_STA_DEVICE_PRESENT 0x01 @@ -1174,36 +1193,6 @@ #define ACPI_STA_BATTERY_PRESENT 0x10 -#define ACPI_COMMON_OBJ_INFO \ - ACPI_OBJECT_TYPE Type; /* ACPI object type */ \ - ACPI_NAME Name /* ACPI object Name */ - - -typedef struct acpi_obj_info_header -{ - ACPI_COMMON_OBJ_INFO; - -} ACPI_OBJ_INFO_HEADER; - - -/* Structure returned from Get Object Info */ - -typedef struct acpi_device_info -{ - ACPI_COMMON_OBJ_INFO; - - UINT32 ParamCount; /* If a method, required parameter count */ - UINT32 Valid; /* Indicates which fields below are valid */ - UINT32 CurrentStatus; /* _STA value */ - ACPI_INTEGER Address; /* _ADR value if any */ - ACPI_DEVICE_ID HardwareId; /* _HID value if any */ - ACPI_DEVICE_ID UniqueId; /* _UID value if any */ - UINT8 HighestDstates[4]; /* _SxD values: 0xFF indicates not valid */ - ACPI_COMPATIBLE_ID_LIST CompatibilityId; /* List of _CIDs if any */ - -} ACPI_DEVICE_INFO; - - /* Context structs for address space handlers */ typedef struct acpi_pci_id @@ -1215,7 +1204,6 @@ } ACPI_PCI_ID; - typedef struct acpi_mem_space_context { UINT32 Length; Index: sys/contrib/dev/acpica/include/acconfig.h =================================================================== --- sys/contrib/dev/acpica/include/acconfig.h (revision 203510) +++ sys/contrib/dev/acpica/include/acconfig.h (working copy) @@ -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 */ @@ -236,7 +236,7 @@ /* Operation regions */ -#define ACPI_NUM_PREDEFINED_REGIONS 8 +#define ACPI_NUM_PREDEFINED_REGIONS 9 #define ACPI_USER_REGION_BEGIN 0x80 /* Maximum SpaceIds for Operation Regions */ @@ -252,11 +252,17 @@ #define ACPI_RSDP_CHECKSUM_LENGTH 20 #define ACPI_RSDP_XCHECKSUM_LENGTH 36 -/* SMBus bidirectional buffer size */ +/* SMBus and IPMI bidirectional buffer size */ #define ACPI_SMBUS_BUFFER_SIZE 34 +#define ACPI_IPMI_BUFFER_SIZE 66 +/* _SxD and _SxW control methods */ +#define ACPI_NUM_SxD_METHODS 4 +#define ACPI_NUM_SxW_METHODS 5 + + /****************************************************************************** * * ACPI AML Debugger Index: sys/contrib/dev/acpica/include/acpredef.h =================================================================== --- sys/contrib/dev/acpica/include/acpredef.h (revision 203510) +++ sys/contrib/dev/acpica/include/acpredef.h (working copy) @@ -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 @@ -136,8 +136,8 @@ * (Used for _PRW) * * - * 2) PTYPE2 packages contain a Variable-length number of sub-packages. Each of the - * different types describe the contents of each of the sub-packages. + * 2) PTYPE2 packages contain a Variable-length number of sub-packages. Each + * of the different types describe the contents of each of the sub-packages. * * ACPI_PTYPE2: Each subpackage contains 1 or 2 object types: * object type @@ -157,12 +157,15 @@ * count * (Used for _CST) * - * ACPI_PTYPE2_Fixed-length: Each subpackage is of Fixed-length length + * ACPI_PTYPE2_FIXED: Each subpackage is of Fixed-length * (Used for _PRT) * * ACPI_PTYPE2_MIN: Each subpackage has a Variable-length but minimum length * (Used for _HPX) * + * ACPI_PTYPE2_REV_FIXED: Revision at start, each subpackage is Fixed-length + * (Used for _ART, _FPS) + * *****************************************************************************/ enum AcpiReturnPackageTypes @@ -174,10 +177,12 @@ ACPI_PTYPE2_COUNT = 5, ACPI_PTYPE2_PKG_COUNT = 6, ACPI_PTYPE2_FIXED = 7, - ACPI_PTYPE2_MIN = 8 + ACPI_PTYPE2_MIN = 8, + ACPI_PTYPE2_REV_FIXED = 9 }; +#ifdef ACPI_CREATE_PREDEFINED_TABLE /* * Predefined method/object information table. * @@ -188,7 +193,7 @@ * AcpiEvaluateObject: * _Lxx and _Exx GPE methods * _Qxx EC methods - * _T_x compiler temporary Variable-lengths + * _T_x compiler temporary variables * * 2) Predefined names that never actually exist within the AML code: * Predefined resource descriptor field names @@ -263,21 +268,30 @@ {{{ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 2,0}, 0,0}}, {{"_ALT", 0, ACPI_RTYPE_INTEGER}}, + {{"_ART", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (1 Int(rev), n Pkg (2 Ref/11 Int) */ + {{{ACPI_PTYPE2_REV_FIXED,ACPI_RTYPE_REFERENCE, 2, ACPI_RTYPE_INTEGER}, 11,0}}, + {{"_BBN", 0, ACPI_RTYPE_INTEGER}}, {{"_BCL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints) */ {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0}, 0,0}}, {{"_BCM", 1, 0}}, + {{"_BCT", 1, ACPI_RTYPE_INTEGER}}, {{"_BDN", 0, ACPI_RTYPE_INTEGER}}, {{"_BFS", 1, 0}}, {{"_BIF", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (9 Int),(4 Str) */ {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 9, ACPI_RTYPE_STRING}, 4,0}}, + {{"_BIX", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (16 Int),(4 Str) */ + {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16, ACPI_RTYPE_STRING}, 4,0}}, + {{"_BLT", 3, 0}}, + {{"_BMA", 1, ACPI_RTYPE_INTEGER}}, {{"_BMC", 1, 0}}, {{"_BMD", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (5 Int) */ {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 5,0}, 0,0}}, + {{"_BMS", 1, ACPI_RTYPE_INTEGER}}, {{"_BQC", 0, ACPI_RTYPE_INTEGER}}, {{"_BST", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (4 Int) */ {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0}, 0,0}}, @@ -285,6 +299,7 @@ {{"_BTM", 1, ACPI_RTYPE_INTEGER}}, {{"_BTP", 1, 0}}, {{"_CBA", 0, ACPI_RTYPE_INTEGER}}, /* See PCI firmware spec 3.0 */ + {{"_CDM", 0, ACPI_RTYPE_INTEGER}}, {{"_CID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints/Strs) */ {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING, 0,0}, 0,0}}, @@ -310,6 +325,7 @@ {{"_DSM", 4, ACPI_RTYPE_ALL}}, /* Must return a type, but it can be of any type */ {{"_DSS", 1, 0}}, {{"_DSW", 3, 0}}, + {{"_DTI", 1, 0}}, {{"_EC_", 0, ACPI_RTYPE_INTEGER}}, {{"_EDL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs)*/ {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, @@ -325,9 +341,22 @@ {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16,0}, 0,0}}, {{"_FDM", 1, 0}}, + {{"_FIF", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (4 Int) */ + {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0}, 0,0}}, + {{"_FIX", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints) */ {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0}, 0,0}}, + {{"_FPS", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (1 Int(rev), n Pkg (5 Int) */ + {{{ACPI_PTYPE2_REV_FIXED,ACPI_RTYPE_INTEGER, 5, 0}, 0,0}}, + + {{"_FSL", 1, 0}}, + {{"_FST", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (3 Int) */ + {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3,0}, 0,0}}, + + + {{"_GAI", 0, ACPI_RTYPE_INTEGER}}, + {{"_GHL", 0, ACPI_RTYPE_INTEGER}}, {{"_GLK", 0, ACPI_RTYPE_INTEGER}}, {{"_GPD", 0, ACPI_RTYPE_INTEGER}}, {{"_GPE", 0, ACPI_RTYPE_INTEGER}}, /* _GPE method, not _GPE scope */ @@ -355,15 +384,21 @@ {{"_LCK", 1, 0}}, {{"_LID", 0, ACPI_RTYPE_INTEGER}}, {{"_MAT", 0, ACPI_RTYPE_BUFFER}}, + {{"_MBM", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (8 Int) */ + {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 8,0}, 0,0}}, + {{"_MLS", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (2 Str) */ {{{ACPI_PTYPE2, ACPI_RTYPE_STRING, 2,0}, 0,0}}, {{"_MSG", 1, 0}}, + {{"_MSM", 4, ACPI_RTYPE_INTEGER}}, + {{"_NTT", 0, ACPI_RTYPE_INTEGER}}, {{"_OFF", 0, 0}}, {{"_ON_", 0, 0}}, {{"_OS_", 0, ACPI_RTYPE_STRING}}, {{"_OSC", 4, ACPI_RTYPE_BUFFER}}, {{"_OST", 3, 0}}, + {{"_PAI", 1, ACPI_RTYPE_INTEGER}}, {{"_PCL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, @@ -371,10 +406,21 @@ {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_BUFFER, 2,0}, 0,0}}, {{"_PDC", 1, 0}}, + {{"_PDL", 0, ACPI_RTYPE_INTEGER}}, {{"_PIC", 1, 0}}, + {{"_PIF", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (3 Int),(3 Str) */ + {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3, ACPI_RTYPE_STRING}, 3,0}}, + {{"_PLD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Bufs) */ {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_BUFFER, 0,0}, 0,0}}, + {{"_PMC", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (11 Int),(3 Str) */ + {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 11, ACPI_RTYPE_STRING}, 3,0}}, + + {{"_PMD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ + {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + + {{"_PMM", 0, ACPI_RTYPE_INTEGER}}, {{"_PPC", 0, ACPI_RTYPE_INTEGER}}, {{"_PPE", 0, ACPI_RTYPE_INTEGER}}, /* See dig64 spec */ {{"_PR0", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ @@ -386,17 +432,26 @@ {{"_PR2", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_PR3", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ + {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + + {{"_PRL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ + {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_PRS", 0, ACPI_RTYPE_BUFFER}}, /* - * For _PRT, many BIOSs reverse the 2nd and 3rd Package elements. This bug is so prevalent that there - * is code in the ACPICA Resource Manager to detect this and switch them back. For now, do not allow - * and issue a warning. To allow this and eliminate the warning, add the ACPI_RTYPE_REFERENCE - * type to the 2nd element (index 1) in the statement below. + * For _PRT, many BIOSs reverse the 3rd and 4th Package elements (Source + * and SourceIndex). This bug is so prevalent that there is code in the + * ACPICA Resource Manager to detect this and switch them back. For now, + * do not allow and issue a warning. To allow this and eliminate the + * warning, add the ACPI_RTYPE_REFERENCE type to the 4th element (index 3) + * in the statement below. */ {{"_PRT", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (4): Int,Int,Int/Ref,Int */ {{{ACPI_PTYPE2_FIXED, 4, ACPI_RTYPE_INTEGER,ACPI_RTYPE_INTEGER}, - ACPI_RTYPE_INTEGER | ACPI_RTYPE_REFERENCE,ACPI_RTYPE_INTEGER}}, + ACPI_RTYPE_INTEGER | ACPI_RTYPE_REFERENCE, + ACPI_RTYPE_INTEGER}}, {{"_PRW", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each: Pkg/Int,Int,[Variable-length Refs] (Pkg is Ref/Int) */ {{{ACPI_PTYPE1_OPTION, 2, ACPI_RTYPE_INTEGER | ACPI_RTYPE_PACKAGE, @@ -422,7 +477,11 @@ {{"_PTC", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (2 Buf) */ {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_BUFFER, 2,0}, 0,0}}, + {{"_PTP", 2, ACPI_RTYPE_INTEGER}}, {{"_PTS", 1, 0}}, + {{"_PUR", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (2 Int) */ + {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 2,0}, 0,0}}, + {{"_PXM", 0, ACPI_RTYPE_INTEGER}}, {{"_REG", 2, 0}}, {{"_REV", 0, ACPI_RTYPE_INTEGER}}, @@ -468,6 +527,7 @@ /* Note: the 3-arg definition may be removed for ACPI 4.0 */ {{"_SDD", 1, 0}}, {{"_SEG", 0, ACPI_RTYPE_INTEGER}}, + {{"_SHL", 1, ACPI_RTYPE_INTEGER}}, {{"_SLI", 0, ACPI_RTYPE_BUFFER}}, {{"_SPD", 1, ACPI_RTYPE_INTEGER}}, {{"_SRS", 1, 0}}, @@ -475,11 +535,15 @@ {{"_SST", 1, 0}}, {{"_STA", 0, ACPI_RTYPE_INTEGER}}, {{"_STM", 3, 0}}, + {{"_STP", 2, ACPI_RTYPE_INTEGER}}, {{"_STR", 0, ACPI_RTYPE_BUFFER}}, + {{"_STV", 2, ACPI_RTYPE_INTEGER}}, {{"_SUN", 0, ACPI_RTYPE_INTEGER}}, {{"_SWS", 0, ACPI_RTYPE_INTEGER}}, {{"_TC1", 0, ACPI_RTYPE_INTEGER}}, {{"_TC2", 0, ACPI_RTYPE_INTEGER}}, + {{"_TIP", 1, ACPI_RTYPE_INTEGER}}, + {{"_TIV", 1, ACPI_RTYPE_INTEGER}}, {{"_TMP", 0, ACPI_RTYPE_INTEGER}}, {{"_TPC", 0, ACPI_RTYPE_INTEGER}}, {{"_TPT", 1, 0}}, @@ -530,5 +594,5 @@ _PRT - currently ignore reversed entries. Attempt to fix here? Think about possibly fixing package elements like _BIF, etc. #endif - #endif +#endif Index: sys/contrib/dev/acpica/include/acobject.h =================================================================== --- sys/contrib/dev/acpica/include/acobject.h (revision 203510) +++ sys/contrib/dev/acpica/include/acobject.h (working copy) @@ -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 @@ -170,6 +170,7 @@ #define AOPOBJ_OBJECT_INITIALIZED 0x08 #define AOPOBJ_SETUP_COMPLETE 0x10 #define AOPOBJ_SINGLE_DATUM 0x20 +#define AOPOBJ_MODULE_LEVEL 0x40 /****************************************************************************** @@ -189,7 +190,7 @@ { ACPI_OBJECT_COMMON_HEADER UINT8 Fill[3]; /* Prevent warning on some compilers */ - ACPI_INTEGER Value; + UINT64 Value; } ACPI_OBJECT_INTEGER; @@ -287,7 +288,12 @@ 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; Index: sys/contrib/dev/acpica/include/achware.h =================================================================== --- sys/contrib/dev/acpica/include/achware.h (revision 203510) +++ sys/contrib/dev/acpica/include/achware.h (working copy) @@ -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 @@ -141,6 +141,22 @@ /* * hwregs - ACPI Register I/O */ +ACPI_STATUS +AcpiHwValidateRegister ( + ACPI_GENERIC_ADDRESS *Reg, + UINT8 MaxBitWidth, + UINT64 *Address); + +ACPI_STATUS +AcpiHwRead ( + UINT32 *Value, + ACPI_GENERIC_ADDRESS *Reg); + +ACPI_STATUS +AcpiHwWrite ( + UINT32 Value, + ACPI_GENERIC_ADDRESS *Reg); + ACPI_BIT_REGISTER_INFO * AcpiHwGetBitRegisterInfo ( UINT32 RegisterId); Index: sys/contrib/dev/acpica/include/acpixf.h =================================================================== --- sys/contrib/dev/acpica/include/acpixf.h (revision 203510) +++ sys/contrib/dev/acpica/include/acpixf.h (working copy) @@ -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 0x20090521 +#define ACPI_CA_VERSION 0x20100121 #include #include @@ -267,7 +267,8 @@ 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); @@ -336,7 +337,7 @@ ACPI_STATUS AcpiGetObjectInfo ( ACPI_HANDLE Handle, - ACPI_BUFFER *ReturnBuffer); + ACPI_DEVICE_INFO **ReturnBuffer); ACPI_STATUS AcpiInstallMethod ( @@ -573,12 +574,12 @@ ACPI_STATUS AcpiRead ( - UINT32 *Value, + UINT64 *Value, ACPI_GENERIC_ADDRESS *Reg); ACPI_STATUS AcpiWrite ( - UINT32 Value, + UINT64 Value, ACPI_GENERIC_ADDRESS *Reg); ACPI_STATUS Index: sys/contrib/dev/acpica/include/acpiosxf.h =================================================================== --- sys/contrib/dev/acpica/include/acpiosxf.h (revision 203510) +++ sys/contrib/dev/acpica/include/acpiosxf.h (working copy) @@ -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 @@ void AcpiOsSleep ( - ACPI_INTEGER Milliseconds); + UINT64 Milliseconds); void AcpiOsStall ( @@ -401,7 +401,7 @@ AcpiOsWritePciConfiguration ( ACPI_PCI_ID *PciId, UINT32 Reg, - ACPI_INTEGER Value, + UINT64 Value, UINT32 Width); Index: sys/contrib/dev/acpica/include/acopcode.h =================================================================== --- sys/contrib/dev/acpica/include/acopcode.h (revision 203510) +++ sys/contrib/dev/acpica/include/acopcode.h (working copy) @@ -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 Index: sys/contrib/dev/acpica/include/acresrc.h =================================================================== --- sys/contrib/dev/acpica/include/acresrc.h (revision 203510) +++ sys/contrib/dev/acpica/include/acresrc.h (working copy) @@ -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 Index: sys/contrib/dev/acpica/include/acdisasm.h =================================================================== --- sys/contrib/dev/acpica/include/acdisasm.h (revision 203510) +++ sys/contrib/dev/acpica/include/acdisasm.h (working copy) @@ -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,19 +125,7 @@ #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 { UINT8 Opcode; @@ -183,7 +171,10 @@ #define ACPI_DMT_EXIT 30 #define ACPI_DMT_SIG 31 #define ACPI_DMT_FADTPM 32 +#define ACPI_DMT_BUF16 33 +#define ACPI_DMT_IVRS 34 + typedef void (*ACPI_DMTABLE_HANDLER) ( ACPI_TABLE_HEADER *Table); @@ -250,6 +241,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[]; @@ -263,15 +255,22 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest1[]; -extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest3[]; -extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest4[]; -extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest5[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest6[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest7[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest8[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest9[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs1[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs4[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8a[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8b[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8c[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt1[]; @@ -287,6 +286,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[]; @@ -300,6 +301,10 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoWaet[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[]; @@ -364,6 +369,10 @@ ACPI_TABLE_HEADER *Table); void +AcpiDmDumpIvrs ( + ACPI_TABLE_HEADER *Table); + +void AcpiDmDumpMcfg ( ACPI_TABLE_HEADER *Table); @@ -371,6 +380,10 @@ AcpiDmDumpMadt ( ACPI_TABLE_HEADER *Table); +void +AcpiDmDumpMsct ( + ACPI_TABLE_HEADER *Table); + UINT32 AcpiDmDumpRsdp ( ACPI_TABLE_HEADER *Table); @@ -388,6 +401,10 @@ ACPI_TABLE_HEADER *Table); void +AcpiDmDumpWdat ( + ACPI_TABLE_HEADER *Table); + +void AcpiDmDumpXsdt ( ACPI_TABLE_HEADER *Table); @@ -446,15 +463,7 @@ AcpiDmMatchOp ( ACPI_PARSE_OBJECT *Op); -BOOLEAN -AcpiDmCommaIfListMember ( - ACPI_PARSE_OBJECT *Op); -void -AcpiDmCommaIfFieldMember ( - ACPI_PARSE_OBJECT *Op); - - /* * dmnames */ @@ -527,6 +536,33 @@ /* + * 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 */ void @@ -561,18 +597,10 @@ ACPI_PARSE_OBJECT *Op); void -AcpiDmIndent ( - UINT32 Level); - -void AcpiDmBitList ( UINT16 Mask); void -AcpiDmDecodeAttribute ( - UINT8 Attribute); - -void AcpiDmDescriptorName ( void); @@ -698,11 +726,22 @@ * 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 */ Index: sys/contrib/dev/acpica/include/actbl.h =================================================================== --- sys/contrib/dev/acpica/include/actbl.h (revision 203510) +++ sys/contrib/dev/acpica/include/actbl.h (working copy) @@ -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 @@ -116,9 +116,25 @@ #ifndef __ACTBL_H__ #define __ACTBL_H__ + +/******************************************************************************* + * + * Fundamental ACPI tables + * + * This file contains definitions for the ACPI tables that are directly consumed + * by ACPICA. All other tables are consumed by the OS-dependent ACPI-related + * device drivers and other OS support code. + * + * The RSDP and FACS do not use the common ACPI table header. All other ACPI + * tables use the header. + * + ******************************************************************************/ + + /* - * Values for description table header signatures. Useful because they make - * it more difficult to inadvertently type in the wrong signature. + * Values for description table header signatures for tables defined in this + * file. Useful because they make it more difficult to inadvertently type in + * the wrong signature. */ #define ACPI_SIG_DSDT "DSDT" /* Differentiated System Description Table */ #define ACPI_SIG_FADT "FACP" /* Fixed ACPI Description Table */ @@ -137,23 +153,17 @@ */ #pragma pack(1) - /* - * These are the ACPI tables that are directly consumed by the subsystem. - * - * The RSDP and FACS do not use the common ACPI table header. All other ACPI - * tables use the header. - * * Note about bitfields: The UINT8 type is used for bitfields in ACPI tables. * This is the only type that is even remotely portable. Anything else is not * portable, so do not use any other bitfield types. */ + /******************************************************************************* * - * ACPI Table Header. This common header is used by all tables except the - * RSDP and FACS. The define is used for direct inclusion of header into - * other ACPI tables + * Master ACPI Table Header. This common header is used by all ACPI tables + * except the RSDP and FACS. * ******************************************************************************/ @@ -172,13 +182,16 @@ } ACPI_TABLE_HEADER; -/* +/******************************************************************************* + * * GAS - Generic Address Structure (ACPI 2.0+) * * Note: Since this structure is used in the ACPI tables, it is byte aligned. - * If misalignment is not supported, access to the Address field must be - * performed with care. - */ + * If misaliged access is not supported by the hardware, accesses to the + * 64-bit Address field must be performed with care. + * + ******************************************************************************/ + typedef struct acpi_generic_address { UINT8 SpaceId; /* Address space where struct or register exists */ @@ -193,6 +206,7 @@ /******************************************************************************* * * RSDP - Root System Description Pointer (Signature is "RSD PTR ") + * Version 2 * ******************************************************************************/ @@ -216,6 +230,7 @@ /******************************************************************************* * * RSDT/XSDT - Root System Description Tables + * Version 1 (both) * ******************************************************************************/ @@ -250,23 +265,31 @@ UINT32 Flags; UINT64 XFirmwareWakingVector; /* 64-bit version of the Firmware Waking Vector (ACPI 2.0+) */ UINT8 Version; /* Version of this table (ACPI 2.0+) */ - UINT8 Reserved[31]; /* Reserved, must be zero */ + UINT8 Reserved[3]; /* Reserved, must be zero */ + UINT32 OspmFlags; /* Flags to be set by OSPM (ACPI 4.0) */ + UINT8 Reserved1[24]; /* Reserved, must be zero */ } ACPI_TABLE_FACS; -/* Flag macros */ +/* Masks for GlobalLock flag field above */ -#define ACPI_FACS_S4_BIOS_PRESENT (1) /* 00: S4BIOS support is present */ +#define ACPI_GLOCK_PENDING (1) /* 00: Pending global lock ownership */ +#define ACPI_GLOCK_OWNED (1<<1) /* 01: Global lock is owned */ -/* Global lock flags */ +/* Masks for Flags field above */ -#define ACPI_GLOCK_PENDING 0x01 /* 00: Pending global lock ownership */ -#define ACPI_GLOCK_OWNED 0x02 /* 01: Global lock is owned */ +#define ACPI_FACS_S4_BIOS_PRESENT (1) /* 00: S4BIOS support is present */ +#define ACPI_FACS_64BIT_WAKE (1<<1) /* 01: 64-bit wake vector supported (ACPI 4.0) */ +/* Masks for OspmFlags field above */ +#define ACPI_FACS_64BIT_ENVIRONMENT (1) /* 00: 64-bit wake environment is required (ACPI 4.0) */ + + /******************************************************************************* * * FADT - Fixed ACPI Description Table (Signature "FACP") + * Version 4 * ******************************************************************************/ @@ -330,7 +353,7 @@ } ACPI_TABLE_FADT; -/* FADT Boot Architecture Flags (BootFlags) */ +/* Masks for FADT Boot Architecture Flags (BootFlags) */ #define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */ #define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */ @@ -338,7 +361,7 @@ #define ACPI_FADT_NO_MSI (1<<3) /* 03: [V4] Message Signaled Interrupts (MSI) must not be enabled */ #define ACPI_FADT_NO_ASPM (1<<4) /* 04: [V4] PCIe ASPM control must not be enabled */ -/* FADT flags */ +/* Masks for FADT flags */ #define ACPI_FADT_WBINVD (1) /* 00: [V1] The wbinvd instruction works properly */ #define ACPI_FADT_WBINVD_FLUSH (1<<1) /* 01: [V1] wbinvd flushes but does not invalidate caches */ @@ -362,7 +385,7 @@ #define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local xAPICs must use physical dest mode (ACPI 3.0) */ -/* FADT Prefered Power Management Profiles */ +/* Values for PreferredProfile (Prefered Power Management Profiles) */ enum AcpiPreferedPmProfiles { @@ -381,6 +404,9 @@ #pragma pack() +/* + * Internal table-related structures + */ typedef union acpi_name_union { UINT32 Integer; @@ -388,9 +414,9 @@ } ACPI_NAME_UNION; -/* - * Internal ACPI Table Descriptor. One per ACPI table - */ + +/* Internal ACPI Table Descriptor. One per ACPI table. */ + typedef struct acpi_table_desc { ACPI_PHYSICAL_ADDRESS Address; @@ -402,7 +428,7 @@ } ACPI_TABLE_DESC; -/* Flags for above */ +/* Masks for Flags field above */ #define ACPI_TABLE_ORIGIN_UNKNOWN (0) #define ACPI_TABLE_ORIGIN_MAPPED (1) @@ -416,6 +442,7 @@ * Get the remaining ACPI tables */ #include +#include /* Macros used to generate offsets to specific table fields */ Index: sys/contrib/dev/acpica/include/acnamesp.h =================================================================== --- sys/contrib/dev/acpica/include/acnamesp.h (revision 203510) +++ sys/contrib/dev/acpica/include/acnamesp.h (working copy) @@ -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 @@ -146,7 +146,15 @@ #define ACPI_NS_WALK_UNLOCK 0x01 #define ACPI_NS_WALK_TEMP_NODES 0x02 +/* Object is not a package element */ +#define ACPI_NOT_PACKAGE_ELEMENT ACPI_UINT32_MAX + +/* Always emit warning message, not dependent on node flags */ + +#define ACPI_WARN_ALWAYS 0 + + /* * nsinit - Namespace initialization */ @@ -181,7 +189,8 @@ ACPI_HANDLE StartObject, UINT32 MaxDepth, UINT32 Flags, - ACPI_WALK_CALLBACK UserFunction, + ACPI_WALK_CALLBACK PreOrderVisit, + ACPI_WALK_CALLBACK PostOrderVisit, void *Context, void **ReturnValue); @@ -241,6 +250,10 @@ ACPI_NAMESPACE_NODE *Node); void +AcpiNsRemoveNode ( + ACPI_NAMESPACE_NODE *Node); + +void AcpiNsDeleteNamespaceSubtree ( ACPI_NAMESPACE_NODE *ParentHandle); @@ -310,7 +323,11 @@ AcpiNsEvaluate ( ACPI_EVALUATE_INFO *Info); +void +AcpiNsExecModuleCodeList ( + void); + /* * nspredef - Support for predefined/reserved names */ @@ -412,6 +429,48 @@ /* + * nsrepair - General return object repair for all + * predefined methods/objects + */ +ACPI_STATUS +AcpiNsRepairObject ( + ACPI_PREDEFINED_DATA *Data, + UINT32 ExpectedBtypes, + UINT32 PackageIndex, + ACPI_OPERAND_OBJECT **ReturnObjectPtr); + +ACPI_STATUS +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 */ ACPI_STATUS @@ -496,13 +555,9 @@ char **ConvertedName); ACPI_NAMESPACE_NODE * -AcpiNsMapHandleToNode ( +AcpiNsValidateHandle ( ACPI_HANDLE Handle); -ACPI_HANDLE -AcpiNsConvertEntryToHandle( - ACPI_NAMESPACE_NODE *Node); - void AcpiNsTerminate ( void); Index: sys/contrib/dev/acpica/include/acdispat.h =================================================================== --- sys/contrib/dev/acpica/include/acdispat.h (revision 203510) +++ sys/contrib/dev/acpica/include/acdispat.h (working copy) @@ -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 Index: sys/contrib/dev/acpica/executer/exmutex.c =================================================================== --- sys/contrib/dev/acpica/executer/exmutex.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exmutex.c (working copy) @@ -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 @@ 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 @@ 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 Index: sys/contrib/dev/acpica/executer/exnames.c =================================================================== --- sys/contrib/dev/acpica/executer/exnames.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exnames.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/executer/excreate.c =================================================================== --- sys/contrib/dev/acpica/executer/excreate.c (revision 203510) +++ sys/contrib/dev/acpica/executer/excreate.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/executer/exdump.c =================================================================== --- sys/contrib/dev/acpica/executer/exdump.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exdump.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/executer/exconfig.c =================================================================== --- sys/contrib/dev/acpica/executer/exconfig.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exconfig.c (working copy) @@ -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 @@ -196,8 +196,15 @@ { AcpiUtRemoveReference (ObjDesc); *DdbHandle = NULL; + return_ACPI_STATUS (Status); } + /* Execute any module-level code that was found in the table */ + + AcpiExExitInterpreter (); + AcpiNsExecModuleCodeList (); + AcpiExEnterInterpreter (); + return_ACPI_STATUS (Status); } @@ -256,15 +263,13 @@ /* 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); } @@ -382,7 +387,7 @@ UINT8 *Buffer) { ACPI_STATUS Status; - ACPI_INTEGER Value; + UINT64 Value; UINT32 RegionOffset = 0; UINT32 i; @@ -605,7 +610,10 @@ Status = AcpiTbAddTable (&TableDesc, &TableIndex); if (ACPI_FAILURE (Status)) { - goto Cleanup; + /* Delete allocated table buffer */ + + AcpiTbDeleteTable (&TableDesc); + return_ACPI_STATUS (Status); } /* @@ -648,13 +656,6 @@ AcpiGbl_TableHandlerContext); } -Cleanup: - if (ACPI_FAILURE (Status)) - { - /* Delete allocated table buffer */ - - AcpiTbDeleteTable (&TableDesc); - } return_ACPI_STATUS (Status); } Index: sys/contrib/dev/acpica/executer/exprep.c =================================================================== --- sys/contrib/dev/acpica/executer/exprep.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exprep.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/executer/exstorob.c =================================================================== --- sys/contrib/dev/acpica/executer/exstorob.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exstorob.c (working copy) @@ -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,6 +150,13 @@ ACPI_FUNCTION_TRACE_PTR (ExStoreBufferToBuffer, SourceDesc); + /* If Source and Target are the same, just return */ + + if (SourceDesc == TargetDesc) + { + return_ACPI_STATUS (AE_OK); + } + /* We know that SourceDesc is a buffer by now */ Buffer = ACPI_CAST_PTR (UINT8, SourceDesc->Buffer.Pointer); @@ -248,6 +255,13 @@ ACPI_FUNCTION_TRACE_PTR (ExStoreStringToString, SourceDesc); + /* If Source and Target are the same, just return */ + + if (SourceDesc == TargetDesc) + { + return_ACPI_STATUS (AE_OK); + } + /* We know that SourceDesc is a string by now */ Buffer = ACPI_CAST_PTR (UINT8, SourceDesc->String.Pointer); Index: sys/contrib/dev/acpica/executer/exresolv.c =================================================================== --- sys/contrib/dev/acpica/executer/exresolv.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exresolv.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/executer/exstoren.c =================================================================== --- sys/contrib/dev/acpica/executer/exstoren.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exstoren.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/executer/exconvrt.c =================================================================== --- sys/contrib/dev/acpica/executer/exconvrt.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exconvrt.c (working copy) @@ -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 @@ { ACPI_OPERAND_OBJECT *ReturnDesc; UINT8 *Pointer; - ACPI_INTEGER Result; + UINT64 Result; UINT32 i; UINT32 Count; ACPI_STATUS Status; @@ -247,7 +247,7 @@ * 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 @@ /* Create a new integer */ - ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); + ReturnDesc = AcpiUtCreateIntegerObject (Result); if (!ReturnDesc) { return_ACPI_STATUS (AE_NO_MEMORY); @@ -271,7 +271,6 @@ /* Save the Result */ - ReturnDesc->Integer.Value = Result; AcpiExTruncateFor32bitTable (ReturnDesc); *ResultDesc = ReturnDesc; return_ACPI_STATUS (AE_OK); @@ -390,12 +389,12 @@ 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 @@ 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 */ } Index: sys/contrib/dev/acpica/executer/exregion.c =================================================================== --- sys/contrib/dev/acpica/executer/exregion.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exregion.c (working copy) @@ -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 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { @@ -157,7 +157,8 @@ 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 @@ * 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 @@ * 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 @@ } /* - * 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 @@ /* Save the physical address and mapping size */ MemInfo->MappedPhysicalAddress = Address; - MemInfo->MappedLength = WindowSize; + MemInfo->MappedLength = MapLength; } /* @@ -262,7 +282,7 @@ * 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 @@ 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 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { @@ -427,7 +447,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { @@ -507,7 +527,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { @@ -544,7 +564,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { @@ -581,7 +601,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext) { Index: sys/contrib/dev/acpica/executer/exfield.c =================================================================== --- sys/contrib/dev/acpica/executer/exfield.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exfield.c (working copy) @@ -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 @@ -151,6 +151,7 @@ ACPI_OPERAND_OBJECT *BufferDesc; ACPI_SIZE Length; void *Buffer; + UINT32 Function; ACPI_FUNCTION_TRACE_PTR (ExReadDataFromField, ObjDesc); @@ -183,13 +184,27 @@ } } else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) && - (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS)) + (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || + ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI)) { /* - * This is an SMBus read. We must create a buffer to hold the data - * and directly access the region handler. + * This is an SMBus or IPMI read. We must create a buffer to hold + * the data and then directly access the region handler. + * + * Note: Smbus protocol value is passed in upper 16-bits of Function */ - BufferDesc = AcpiUtCreateBufferObject (ACPI_SMBUS_BUFFER_SIZE); + if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS) + { + Length = ACPI_SMBUS_BUFFER_SIZE; + Function = ACPI_READ | (ObjDesc->Field.Attribute << 16); + } + else /* IPMI */ + { + Length = ACPI_IPMI_BUFFER_SIZE; + Function = ACPI_READ; + } + + BufferDesc = AcpiUtCreateBufferObject (Length); if (!BufferDesc) { return_ACPI_STATUS (AE_NO_MEMORY); @@ -199,13 +214,11 @@ AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags); - /* - * Perform the read. - * Note: Smbus protocol value is passed in upper 16-bits of Function - */ + /* Call the region handler for the read */ + Status = AcpiExAccessRegion (ObjDesc, 0, - ACPI_CAST_PTR (ACPI_INTEGER, BufferDesc->Buffer.Pointer), - ACPI_READ | (ObjDesc->Field.Attribute << 16)); + ACPI_CAST_PTR (UINT64, BufferDesc->Buffer.Pointer), + Function); AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags); goto Exit; } @@ -213,7 +226,7 @@ /* * 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. @@ -236,14 +249,13 @@ { /* 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; } @@ -304,6 +316,7 @@ UINT32 Length; void *Buffer; ACPI_OPERAND_OBJECT *BufferDesc; + UINT32 Function; ACPI_FUNCTION_TRACE_PTR (ExWriteDataToField, ObjDesc); @@ -332,40 +345,59 @@ } } else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) && - (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS)) + (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || + ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI)) { /* - * This is an SMBus write. We will bypass the entire field mechanism - * and handoff the buffer directly to the handler. + * This is an SMBus or IPMI write. We will bypass the entire field + * mechanism and handoff the buffer directly to the handler. For + * these address spaces, the buffer is bi-directional; on a write, + * return data is returned in the same buffer. * - * Source must be a buffer of sufficient size (ACPI_SMBUS_BUFFER_SIZE). + * Source must be a buffer of sufficient size: + * ACPI_SMBUS_BUFFER_SIZE or ACPI_IPMI_BUFFER_SIZE. + * + * Note: SMBus protocol type is passed in upper 16-bits of Function */ if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER) { - ACPI_ERROR ((AE_INFO, "SMBus write requires Buffer, found type %s", + ACPI_ERROR ((AE_INFO, + "SMBus or IPMI write requires Buffer, found type %s", AcpiUtGetObjectTypeName (SourceDesc))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } - if (SourceDesc->Buffer.Length < ACPI_SMBUS_BUFFER_SIZE) + if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS) { + Length = ACPI_SMBUS_BUFFER_SIZE; + Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16); + } + else /* IPMI */ + { + Length = ACPI_IPMI_BUFFER_SIZE; + Function = ACPI_WRITE; + } + + if (SourceDesc->Buffer.Length < Length) + { ACPI_ERROR ((AE_INFO, - "SMBus write requires Buffer of length %X, found length %X", - ACPI_SMBUS_BUFFER_SIZE, SourceDesc->Buffer.Length)); + "SMBus or IPMI write requires Buffer of length %X, found length %X", + Length, SourceDesc->Buffer.Length)); return_ACPI_STATUS (AE_AML_BUFFER_LIMIT); } - BufferDesc = AcpiUtCreateBufferObject (ACPI_SMBUS_BUFFER_SIZE); + /* Create the bi-directional buffer */ + + BufferDesc = AcpiUtCreateBufferObject (Length); if (!BufferDesc) { return_ACPI_STATUS (AE_NO_MEMORY); } Buffer = BufferDesc->Buffer.Pointer; - ACPI_MEMCPY (Buffer, SourceDesc->Buffer.Pointer, - ACPI_SMBUS_BUFFER_SIZE); + ACPI_MEMCPY (Buffer, SourceDesc->Buffer.Pointer, Length); /* Lock entire transaction if requested */ @@ -374,11 +406,9 @@ /* * Perform the write (returns status and perhaps data in the * same buffer) - * Note: SMBus protocol type is passed in upper 16-bits of Function. */ Status = AcpiExAccessRegion (ObjDesc, 0, - (ACPI_INTEGER *) Buffer, - ACPI_WRITE | (ObjDesc->Field.Attribute << 16)); + (UINT64 *) Buffer, Function); AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags); *ResultDesc = BufferDesc; Index: sys/contrib/dev/acpica/executer/exsystem.c =================================================================== --- sys/contrib/dev/acpica/executer/exsystem.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exsystem.c (working copy) @@ -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 @@ ACPI_STATUS AcpiExSystemDoSuspend ( - ACPI_INTEGER HowLong) + UINT64 HowLong) { ACPI_FUNCTION_ENTRY (); Index: sys/contrib/dev/acpica/executer/exresop.c =================================================================== --- sys/contrib/dev/acpica/executer/exresop.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exresop.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/executer/exoparg1.c =================================================================== --- sys/contrib/dev/acpica/executer/exoparg1.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exoparg1.c (working copy) @@ -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 @@ /* 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 @@ 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 @@ /* 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 @@ * 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 @@ /* 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 @@ 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 @@ { 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 @@ */ if (!Operand[0]->Integer.Value) { - ReturnDesc->Integer.Value = ACPI_INTEGER_MAX; + ReturnDesc->Integer.Value = ACPI_UINT64_MAX; } break; @@ -838,14 +837,12 @@ /* 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 @@ * 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 @@ * 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; Index: sys/contrib/dev/acpica/executer/exoparg2.c =================================================================== --- sys/contrib/dev/acpica/executer/exoparg2.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exoparg2.c (working copy) @@ -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 @@ { 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 @@ */ if (LogicalResult) { - ReturnDesc->Integer.Value = ACPI_INTEGER_MAX; + ReturnDesc->Integer.Value = ACPI_UINT64_MAX; } Cleanup: Index: sys/contrib/dev/acpica/executer/exoparg3.c =================================================================== --- sys/contrib/dev/acpica/executer/exoparg3.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exoparg3.c (working copy) @@ -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 @@ ACPI_OPERAND_OBJECT *ReturnDesc = NULL; char *Buffer = NULL; ACPI_STATUS Status = AE_OK; - ACPI_INTEGER Index; + UINT64 Index; ACPI_SIZE Length; Index: sys/contrib/dev/acpica/executer/exmisc.c =================================================================== --- sys/contrib/dev/acpica/executer/exmisc.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exmisc.c (working copy) @@ -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 @@ * ******************************************************************************/ -ACPI_INTEGER +UINT64 AcpiExDoMathOp ( UINT16 Opcode, - ACPI_INTEGER Integer0, - ACPI_INTEGER Integer1) + UINT64 Integer0, + UINT64 Integer1) { ACPI_FUNCTION_ENTRY (); @@ -615,8 +615,8 @@ 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 @@ 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; Index: sys/contrib/dev/acpica/executer/exstore.c =================================================================== --- sys/contrib/dev/acpica/executer/exstore.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exstore.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/executer/exfldio.c =================================================================== --- sys/contrib/dev/acpica/executer/exfldio.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exfldio.c (working copy) @@ -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 @@ 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 ( @@ -202,12 +202,13 @@ } /* - * Exit now for SMBus address space, it has a non-linear address space + * Exit now for SMBus or IPMI address space, it has a non-linear address space * and the request cannot be directly validated */ - if (RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_SMBUS) + if (RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || + RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_IPMI) { - /* SMBus has a non-linear address space */ + /* SMBus or IPMI has a non-linear address space */ return_ACPI_STATUS (AE_OK); } @@ -295,7 +296,7 @@ * 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 * @@ -309,7 +310,7 @@ AcpiExAccessRegion ( ACPI_OPERAND_OBJECT *ObjDesc, UINT32 FieldDatumByteOffset, - ACPI_INTEGER *Value, + UINT64 *Value, UINT32 Function) { ACPI_STATUS Status; @@ -407,7 +408,7 @@ static BOOLEAN AcpiExRegisterOverflow ( ACPI_OPERAND_OBJECT *ObjDesc, - ACPI_INTEGER Value) + UINT64 Value) { if (ObjDesc->CommonField.BitLength >= ACPI_INTEGER_BIT_SIZE) @@ -419,7 +420,7 @@ 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 @@ -456,11 +457,11 @@ 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); @@ -542,7 +543,7 @@ * the register */ if (AcpiExRegisterOverflow (ObjDesc->BankField.BankObj, - (ACPI_INTEGER) ObjDesc->BankField.Value)) + (UINT64) ObjDesc->BankField.Value)) { return_ACPI_STATUS (AE_AML_REGISTER_LIMIT); } @@ -585,7 +586,7 @@ * the register */ if (AcpiExRegisterOverflow (ObjDesc->IndexField.IndexObj, - (ACPI_INTEGER) ObjDesc->IndexField.Value)) + (UINT64) ObjDesc->IndexField.Value)) { return_ACPI_STATUS (AE_AML_REGISTER_LIMIT); } @@ -614,7 +615,7 @@ "Read from Data Register\n")); Status = AcpiExExtractFromField (ObjDesc->IndexField.DataObj, - Value, sizeof (ACPI_INTEGER)); + Value, sizeof (UINT64)); } else { @@ -625,7 +626,7 @@ ACPI_FORMAT_UINT64 (*Value))); Status = AcpiExInsertIntoField (ObjDesc->IndexField.DataObj, - Value, sizeof (ACPI_INTEGER)); + Value, sizeof (UINT64)); } break; @@ -678,13 +679,13 @@ 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); @@ -696,7 +697,7 @@ /* 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 */ @@ -786,8 +787,8 @@ UINT32 BufferLength) { ACPI_STATUS Status; - ACPI_INTEGER RawDatum; - ACPI_INTEGER MergedDatum; + UINT64 RawDatum; + UINT64 MergedDatum; UINT32 FieldOffset = 0; UINT32 BufferOffset = 0; UINT32 BufferTailBits; @@ -916,10 +917,10 @@ 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; @@ -971,7 +972,7 @@ */ if (ObjDesc->CommonField.AccessBitWidth == ACPI_INTEGER_BIT_SIZE) { - WidthMask = ACPI_INTEGER_MAX; + WidthMask = ACPI_UINT64_MAX; } else { Index: sys/contrib/dev/acpica/executer/exoparg6.c =================================================================== --- sys/contrib/dev/acpica/executer/exoparg6.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exoparg6.c (working copy) @@ -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 @@ 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 @@ } /* 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 @@ } - /* 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 @@ * * 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++) Index: sys/contrib/dev/acpica/executer/exresnte.c =================================================================== --- sys/contrib/dev/acpica/executer/exresnte.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exresnte.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/executer/exutils.c =================================================================== --- sys/contrib/dev/acpica/executer/exutils.c (revision 203510) +++ sys/contrib/dev/acpica/executer/exutils.c (working copy) @@ -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 @@ * 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 @@ 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) { @@ -482,59 +482,76 @@ * * FUNCTION: AcpiExEisaIdToString * - * PARAMETERS: NumericId - EISA ID to be converted + * PARAMETERS: CompressedId - EISAID to be converted * OutString - Where to put the converted string (8 bytes) * * RETURN: None * - * DESCRIPTION: Convert a numeric EISA ID to string representation + * DESCRIPTION: Convert a numeric EISAID to string representation. Return + * buffer must be large enough to hold the string. The string + * returned is always exactly of length ACPI_EISAID_STRING_SIZE + * (includes null terminator). The EISAID is always 32 bits. * ******************************************************************************/ void AcpiExEisaIdToString ( - UINT32 NumericId, - char *OutString) + char *OutString, + UINT64 CompressedId) { - UINT32 EisaId; + UINT32 SwappedId; ACPI_FUNCTION_ENTRY (); + /* The EISAID should be a 32-bit integer */ + + if (CompressedId > ACPI_UINT32_MAX) + { + ACPI_WARNING ((AE_INFO, + "Expected EISAID is larger than 32 bits: 0x%8.8X%8.8X, truncating", + ACPI_FORMAT_UINT64 (CompressedId))); + } + /* Swap ID to big-endian to get contiguous bits */ - EisaId = AcpiUtDwordByteSwap (NumericId); + SwappedId = AcpiUtDwordByteSwap ((UINT32) CompressedId); - OutString[0] = (char) ('@' + (((unsigned long) EisaId >> 26) & 0x1f)); - OutString[1] = (char) ('@' + ((EisaId >> 21) & 0x1f)); - OutString[2] = (char) ('@' + ((EisaId >> 16) & 0x1f)); - OutString[3] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) EisaId, 12); - OutString[4] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) EisaId, 8); - OutString[5] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) EisaId, 4); - OutString[6] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) EisaId, 0); + /* First 3 bytes are uppercase letters. Next 4 bytes are hexadecimal */ + + 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 ((UINT64) SwappedId, 12); + OutString[4] = AcpiUtHexToAsciiChar ((UINT64) SwappedId, 8); + OutString[5] = AcpiUtHexToAsciiChar ((UINT64) SwappedId, 4); + OutString[6] = AcpiUtHexToAsciiChar ((UINT64) SwappedId, 0); OutString[7] = 0; } /******************************************************************************* * - * FUNCTION: AcpiExUnsignedIntegerToString + * FUNCTION: AcpiExIntegerToString * - * PARAMETERS: Value - Value to be converted - * OutString - Where to put the converted string (8 bytes) + * PARAMETERS: OutString - Where to put the converted string. At least + * 21 bytes are needed to hold the largest + * possible 64-bit integer. + * Value - Value to be converted * * RETURN: None, string * - * DESCRIPTION: Convert a number to string representation. Assumes string - * buffer is large enough to hold the string. + * DESCRIPTION: Convert a 64-bit integer to decimal string representation. + * Assumes string buffer is large enough to hold the string. The + * largest string is (ACPI_MAX64_DECIMAL_DIGITS + 1). * ******************************************************************************/ void -AcpiExUnsignedIntegerToString ( - ACPI_INTEGER Value, - char *OutString) +AcpiExIntegerToString ( + char *OutString, + UINT64 Value) { UINT32 Count; UINT32 DigitsNeeded; Index: sys/contrib/dev/acpica/debugger/dbstats.c =================================================================== --- sys/contrib/dev/acpica/debugger/dbstats.c (revision 203510) +++ sys/contrib/dev/acpica/debugger/dbstats.c (working copy) @@ -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 @@ } (void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, FALSE, AcpiDbClassifyOneObject, NULL, NULL); + ACPI_UINT32_MAX, FALSE, AcpiDbClassifyOneObject, NULL, NULL, NULL); } Index: sys/contrib/dev/acpica/debugger/dbinput.c =================================================================== --- sys/contrib/dev/acpica/debugger/dbinput.c (revision 203510) +++ sys/contrib/dev/acpica/debugger/dbinput.c (working copy) @@ -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 @@ break; case CMD_BATCH: - AcpiDbBatchExecute (); + AcpiDbBatchExecute (AcpiGbl_DbArgs[1]); break; case CMD_BREAKPOINT: Index: sys/contrib/dev/acpica/debugger/dbutils.c =================================================================== --- sys/contrib/dev/acpica/debugger/dbutils.c (revision 203510) +++ sys/contrib/dev/acpica/debugger/dbutils.c (working copy) @@ -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 @@ 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); } Index: sys/contrib/dev/acpica/debugger/dbhistry.c =================================================================== --- sys/contrib/dev/acpica/debugger/dbhistry.c (revision 203510) +++ sys/contrib/dev/acpica/debugger/dbhistry.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/debugger/dbdisply.c =================================================================== --- sys/contrib/dev/acpica/debugger/dbdisply.c (revision 203510) +++ sys/contrib/dev/acpica/debugger/dbdisply.c (working copy) @@ -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 @@ -682,42 +682,52 @@ char *ObjectArg) { ACPI_HANDLE Handle; - ACPI_BUFFER Buffer; ACPI_DEVICE_INFO *Info; ACPI_STATUS Status; UINT32 i; Handle = ACPI_TO_POINTER (ACPI_STRTOUL (ObjectArg, NULL, 16)); - Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiGetObjectInfo (Handle, &Buffer); - if (ACPI_SUCCESS (Status)) + Status = AcpiGetObjectInfo (Handle, &Info); + if (ACPI_FAILURE (Status)) { - Info = Buffer.Pointer; - AcpiOsPrintf ( - "S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X HID: %s, ADR: %8.8X%8.8X, Status %8.8X\n", - Info->HighestDstates[0], Info->HighestDstates[1], - Info->HighestDstates[2], Info->HighestDstates[3], - Info->HardwareId.Value, - ACPI_FORMAT_UINT64 (Info->Address), - Info->CurrentStatus); + AcpiOsPrintf ("Could not get object info, %s\n", + AcpiFormatException (Status)); + return; + } - if (Info->Valid & ACPI_VALID_CID) - { - for (i = 0; i < Info->CompatibilityId.Count; i++) - { - AcpiOsPrintf ("CID #%d: %s\n", i, - Info->CompatibilityId.Id[i].Value); - } - } + AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n", + ACPI_FORMAT_UINT64 (Info->Address), + Info->CurrentStatus, Info->Flags); - ACPI_FREE (Info); + AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n", + Info->HighestDstates[0], Info->HighestDstates[1], + Info->HighestDstates[2], Info->HighestDstates[3]); + + AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n", + Info->LowestDstates[0], Info->LowestDstates[1], + Info->LowestDstates[2], Info->LowestDstates[3], + Info->LowestDstates[4]); + + if (Info->Valid & ACPI_VALID_HID) + { + AcpiOsPrintf ("HID: %s\n", Info->HardwareId.String); } - else + if (Info->Valid & ACPI_VALID_UID) { - AcpiOsPrintf ("%s\n", AcpiFormatException (Status)); + AcpiOsPrintf ("UID: %s\n", Info->UniqueId.String); } + if (Info->Valid & ACPI_VALID_CID) + { + for (i = 0; i < Info->CompatibleIdList.Count; i++) + { + AcpiOsPrintf ("CID %d: %s\n", i, + Info->CompatibleIdList.Ids[i].String); + } + } + + ACPI_FREE (Info); } Index: sys/contrib/dev/acpica/debugger/dbexec.c =================================================================== --- sys/contrib/dev/acpica/debugger/dbexec.c (revision 203510) +++ sys/contrib/dev/acpica/debugger/dbexec.c (working copy) @@ -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 @@ -176,7 +176,6 @@ ACPI_OBJECT_LIST ParamObjects; ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS]; ACPI_HANDLE Handle; - ACPI_BUFFER Buffer; UINT32 i; ACPI_DEVICE_INFO *ObjInfo; @@ -196,8 +195,7 @@ /* Get the object info for number of method parameters */ - Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiGetObjectInfo (Handle, &Buffer); + Status = AcpiGetObjectInfo (Handle, &ObjInfo); if (ACPI_FAILURE (Status)) { return (Status); @@ -206,7 +204,6 @@ ParamObjects.Pointer = NULL; ParamObjects.Count = 0; - ObjInfo = Buffer.Pointer; if (ObjInfo->Type == ACPI_TYPE_METHOD) { /* Are there arguments to the method? */ @@ -246,7 +243,7 @@ default: Params[i].Type = ACPI_TYPE_INTEGER; - Params[i].Integer.Value = i * (ACPI_INTEGER) 0x1000; + Params[i].Integer.Value = i * (UINT64) 0x1000; break; } } @@ -256,7 +253,7 @@ } } - ACPI_FREE (Buffer.Pointer); + ACPI_FREE (ObjInfo); /* Prepare for a return object of arbitrary size */ @@ -456,7 +453,7 @@ 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 @@ -487,7 +484,7 @@ * 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 Index: sys/contrib/dev/acpica/debugger/dbcmds.c =================================================================== --- sys/contrib/dev/acpica/debugger/dbcmds.c (revision 203510) +++ sys/contrib/dev/acpica/debugger/dbcmds.c (working copy) @@ -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 @@ /* 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 @@ /* 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); } @@ -500,17 +501,16 @@ void *Context, void **ReturnValue) { - ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; - UINT32 *Count = (UINT32 *) Context; - const ACPI_PREDEFINED_INFO *Predefined; - ACPI_BUFFER ReturnObj; - ACPI_STATUS Status; - char *Pathname; - ACPI_BUFFER Buffer; + ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; + ACPI_EXECUTE_WALK *Info = (ACPI_EXECUTE_WALK *) Context; + ACPI_BUFFER ReturnObj; + ACPI_STATUS Status; + char *Pathname; UINT32 i; ACPI_DEVICE_INFO *ObjInfo; ACPI_OBJECT_LIST ParamObjects; ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS]; + const ACPI_PREDEFINED_INFO *Predefined; Predefined = AcpiNsCheckForPredefinedName (Node); @@ -532,8 +532,7 @@ /* Get the object info for number of method parameters */ - Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiGetObjectInfo (ObjHandle, &Buffer); + Status = AcpiGetObjectInfo (ObjHandle, &ObjInfo); if (ACPI_FAILURE (Status)) { return (Status); @@ -542,10 +541,8 @@ ParamObjects.Pointer = NULL; ParamObjects.Count = 0; - ObjInfo = Buffer.Pointer; if (ObjInfo->Type == ACPI_TYPE_METHOD) { - /* Setup default parameters */ for (i = 0; i < ObjInfo->ParamCount; i++) @@ -558,12 +555,10 @@ ParamObjects.Count = ObjInfo->ParamCount; } - ACPI_FREE (Buffer.Pointer); - + ACPI_FREE (ObjInfo); ReturnObj.Pointer = NULL; ReturnObj.Length = ACPI_ALLOCATE_BUFFER; - /* Do the actual method execution */ AcpiGbl_MethodExecuting = TRUE; @@ -572,11 +567,21 @@ 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); } @@ -584,27 +589,37 @@ * * 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); } @@ -1150,15 +1165,13 @@ /* 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) @@ -1310,7 +1323,7 @@ /* 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", @@ -1426,7 +1439,7 @@ /* 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); @@ -1927,7 +1940,7 @@ /* 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); @@ -1997,12 +2010,17 @@ ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; ACPI_STATUS Status; ACPI_BUFFER Buffer; - ACPI_INTEGER ADR; - ACPI_DEVICE_ID Id; - ACPI_COMPATIBLE_ID_LIST *Cid; ACPI_NAMESPACE_NODE *TempNode; + ACPI_DEVICE_INFO *Info; + UINT32 i; + if ((Node->Type != ACPI_TYPE_DEVICE) && + (Node->Type != ACPI_TYPE_PROCESSOR)) + { + return (AE_OK); + } + /* Exit if there is no _PRT under this device */ Status = AcpiGetHandle (Node, METHOD_NAME__PRT, @@ -2022,57 +2040,70 @@ return (AE_OK); } + Status = AcpiGetObjectInfo (ObjHandle, &Info); + if (ACPI_FAILURE (Status)) + { + return (AE_OK); + } + /* Display the full path */ - AcpiOsPrintf ("%-32s", (char *) Buffer.Pointer); + AcpiOsPrintf ("%-32s Type %X", (char *) Buffer.Pointer, Node->Type); ACPI_FREE (Buffer.Pointer); + if (Info->Flags & ACPI_PCI_ROOT_BRIDGE) + { + AcpiOsPrintf (" - Is PCI Root Bridge"); + } + AcpiOsPrintf ("\n"); + /* _PRT info */ - AcpiOsPrintf ("_PRT=%p", TempNode); + AcpiOsPrintf ("_PRT: %p\n", TempNode); - /* Get the _ADR value */ + /* Dump _ADR, _HID, _UID, _CID */ - Status = AcpiUtEvaluateNumericObject (METHOD_NAME__ADR, Node, &ADR); - if (ACPI_FAILURE (Status)) + if (Info->Valid & ACPI_VALID_ADR) { - AcpiOsPrintf (" No _ADR "); + AcpiOsPrintf ("_ADR: %8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Info->Address)); } else { - AcpiOsPrintf (" _ADR=%8.8X", (UINT32) ADR); + AcpiOsPrintf ("_ADR: \n"); } - /* Get the _HID if present */ - - Status = AcpiUtExecute_HID (Node, &Id); - if (ACPI_SUCCESS (Status)) + if (Info->Valid & ACPI_VALID_HID) { - AcpiOsPrintf (" _HID=%s", Id.Value); + AcpiOsPrintf ("_HID: %s\n", Info->HardwareId.String); } else { - AcpiOsPrintf (" "); + AcpiOsPrintf ("_HID: \n"); } - /* Get the _UID if present */ - - Status = AcpiUtExecute_UID (Node, &Id); - if (ACPI_SUCCESS (Status)) + if (Info->Valid & ACPI_VALID_UID) { - AcpiOsPrintf (" _UID=%s", Id.Value); + AcpiOsPrintf ("_UID: %s\n", Info->UniqueId.String); } + else + { + AcpiOsPrintf ("_UID: \n"); + } - /* Get the _CID if present */ - - Status = AcpiUtExecute_CID (Node, &Cid); - if (ACPI_SUCCESS (Status)) + if (Info->Valid & ACPI_VALID_CID) { - AcpiOsPrintf (" _CID=%s", Cid->Id[0].Value); - ACPI_FREE (Cid); + for (i = 0; i < Info->CompatibleIdList.Count; i++) + { + AcpiOsPrintf ("_CID: %s\n", + Info->CompatibleIdList.Ids[i].String); + } } + else + { + AcpiOsPrintf ("_CID: \n"); + } - AcpiOsPrintf ("\n"); + ACPI_FREE (Info); return (AE_OK); } @@ -2095,8 +2126,8 @@ { /* Search all nodes in namespace */ - (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - AcpiDbBusWalk, NULL, NULL); + (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, + AcpiDbBusWalk, NULL, NULL, NULL); } #endif /* ACPI_DEBUGGER */ Index: sys/contrib/dev/acpica/debugger/dbxface.c =================================================================== --- sys/contrib/dev/acpica/debugger/dbxface.c (revision 203510) +++ sys/contrib/dev/acpica/debugger/dbxface.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/debugger/dbfileio.c =================================================================== --- sys/contrib/dev/acpica/debugger/dbfileio.c (revision 203510) +++ sys/contrib/dev/acpica/debugger/dbfileio.c (working copy) @@ -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 @@ UINT32 TableLength, UINT32 FileLength); -static ACPI_STATUS -AeLocalLoadTable ( - ACPI_TABLE_HEADER *TablePtr); #endif /******************************************************************************* @@ -424,7 +421,7 @@ { /* 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) Index: sys/contrib/dev/acpica/dispatcher/dswstate.c =================================================================== --- sys/contrib/dev/acpica/dispatcher/dswstate.c (revision 203510) +++ sys/contrib/dev/acpica/dispatcher/dswstate.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/dispatcher/dsopcode.c =================================================================== --- sys/contrib/dev/acpica/dispatcher/dsopcode.c (revision 203510) +++ sys/contrib/dev/acpica/dispatcher/dsopcode.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/dispatcher/dswexec.c =================================================================== --- sys/contrib/dev/acpica/dispatcher/dswexec.c (revision 203510) +++ sys/contrib/dev/acpica/dispatcher/dswexec.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/dispatcher/dsmethod.c =================================================================== --- sys/contrib/dev/acpica/dispatcher/dsmethod.c (revision 203510) +++ sys/contrib/dev/acpica/dispatcher/dsmethod.c (working copy) @@ -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 @@ 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; @@ -693,10 +693,15 @@ } /* - * Delete any namespace objects created anywhere within - * the namespace by the execution of this method + * Delete any namespace objects created anywhere within the + * namespace by the execution of this method. Unless this method + * is a module-level executable code method, in which case we + * want make the objects permanent. */ - AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId); + if (!(MethodDesc->Method.Flags & AOPOBJ_MODULE_LEVEL)) + { + AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId); + } } /* Decrement the thread count on the method */ @@ -745,7 +750,10 @@ /* No more threads, we can free the OwnerId */ - AcpiUtReleaseOwnerId (&MethodDesc->Method.OwnerId); + if (!(MethodDesc->Method.Flags & AOPOBJ_MODULE_LEVEL)) + { + AcpiUtReleaseOwnerId (&MethodDesc->Method.OwnerId); + } } return_VOID; Index: sys/contrib/dev/acpica/dispatcher/dsutils.c =================================================================== --- sys/contrib/dev/acpica/dispatcher/dsutils.c (revision 203510) +++ sys/contrib/dev/acpica/dispatcher/dsutils.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/dispatcher/dswscope.c =================================================================== --- sys/contrib/dev/acpica/dispatcher/dswscope.c (revision 203510) +++ sys/contrib/dev/acpica/dispatcher/dswscope.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/dispatcher/dsmthdat.c =================================================================== --- sys/contrib/dev/acpica/dispatcher/dsmthdat.c (revision 203510) +++ sys/contrib/dev/acpica/dispatcher/dsmthdat.c (working copy) @@ -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 @@ 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; } @@ -548,9 +547,10 @@ case ACPI_REFCLASS_LOCAL: - ACPI_ERROR ((AE_INFO, - "Uninitialized Local[%d] at node %p", Index, Node)); - + /* + * No error message for this case, will be trapped again later to + * detect and ignore cases of Store(LocalX,LocalX) + */ return_ACPI_STATUS (AE_AML_UNINITIALIZED_LOCAL); default: Index: sys/contrib/dev/acpica/dispatcher/dsfield.c =================================================================== --- sys/contrib/dev/acpica/dispatcher/dsfield.c (revision 203510) +++ sys/contrib/dev/acpica/dispatcher/dsfield.c (working copy) @@ -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 @@ -211,9 +211,12 @@ Flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_ERROR_IF_FOUND; - /* Mark node temporary if we are executing a method */ - - if (WalkState->MethodNode) + /* + * Mark node temporary if we are executing a normal control + * method. (Don't mark if this is a module-level code method) + */ + if (WalkState->MethodNode && + !(WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL)) { Flags |= ACPI_NS_TEMPORARY; } @@ -311,7 +314,7 @@ ACPI_PARSE_OBJECT *Arg) { ACPI_STATUS Status; - ACPI_INTEGER Position; + UINT64 Position; ACPI_FUNCTION_TRACE_PTR (DsGetFieldNames, Info); @@ -335,8 +338,8 @@ { 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) { @@ -403,8 +406,8 @@ /* 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) { @@ -566,9 +569,12 @@ Flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | ACPI_NS_ERROR_IF_FOUND; - /* Mark node(s) temporary if we are executing a method */ - - if (WalkState->MethodNode) + /* + * Mark node(s) temporary if we are executing a normal control + * method. (Don't mark if this is a module-level code method) + */ + if (WalkState->MethodNode && + !(WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL)) { Flags |= ACPI_NS_TEMPORARY; } Index: sys/contrib/dev/acpica/dispatcher/dsinit.c =================================================================== --- sys/contrib/dev/acpica/dispatcher/dsinit.c (revision 203510) +++ sys/contrib/dev/acpica/dispatcher/dsinit.c (working copy) @@ -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 @@ * 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")); Index: sys/contrib/dev/acpica/dispatcher/dsobject.c =================================================================== --- sys/contrib/dev/acpica/dispatcher/dsobject.c (revision 203510) +++ sys/contrib/dev/acpica/dispatcher/dsobject.c (working copy) @@ -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 @@ -570,23 +570,36 @@ { /* * NumElements was exhausted, but there are remaining elements in the - * PackageList. + * PackageList. Truncate the package to NumElements. * * 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, for now, we just print an error message and - * no exception is returned. + * 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. */ while (Arg) { + /* + * We must delete any package elements that were created earlier + * and are not going to be used because of the package truncation. + */ + if (Arg->Common.Node) + { + AcpiUtRemoveReference ( + ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node)); + Arg->Common.Node = NULL; + } + /* Find out how many elements there really are */ i++; Arg = Arg->Common.Next; } - ACPI_ERROR ((AE_INFO, - "Package List length (%X) larger than NumElements count (%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) @@ -596,7 +609,7 @@ * Note: this is not an error, the package is padded out with NULLs. */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Package List length (%X) smaller than NumElements count (%X), padded with null elements\n", + "Package List length (0x%X) smaller than NumElements count (0x%X), padded with null elements\n", i, ElementCount)); } @@ -774,7 +787,7 @@ 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 */ Index: sys/contrib/dev/acpica/dispatcher/dswload.c =================================================================== --- sys/contrib/dev/acpica/dispatcher/dswload.c (revision 203510) +++ sys/contrib/dev/acpica/dispatcher/dswload.c (working copy) @@ -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 @@ * 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 @@ 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 @@ /* 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); } @@ -672,20 +674,6 @@ (WalkState->Opcode != AML_INT_NAMEPATH_OP)) || (!(WalkState->OpInfo->Flags & AML_NAMED))) { -#ifdef ACPI_ENABLE_MODULE_LEVEL_CODE - if ((WalkState->OpInfo->Class == AML_CLASS_EXECUTE) || - (WalkState->OpInfo->Class == AML_CLASS_CONTROL)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "Begin/EXEC: %s (fl %8.8X)\n", WalkState->OpInfo->Name, - WalkState->OpInfo->Flags)); - - /* Executing a type1 or type2 opcode outside of a method */ - - Status = AcpiDsExecBeginOp (WalkState, OutOp); - return_ACPI_STATUS (Status); - } -#endif return_ACPI_STATUS (AE_OK); } @@ -746,29 +734,45 @@ 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, - ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, - WalkState, &(Node)); - if (ACPI_FAILURE (Status)) + + /* Special case for Scope(\) -> refers to the Root node */ + + if (Op && (Op->Named.Node == AcpiGbl_RootNode)) { -#ifdef ACPI_ASL_COMPILER - if (Status == AE_NOT_FOUND) + Node = Op->Named.Node; + + Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState); + if (ACPI_FAILURE (Status)) { - Status = AE_OK; + return_ACPI_STATUS (Status); } - else + } + 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)) { +#ifdef ACPI_ASL_COMPILER + if (Status == AE_NOT_FOUND) + { + Status = AE_OK; + } + else + { + ACPI_ERROR_NAMESPACE (BufferPtr, Status); + } +#else ACPI_ERROR_NAMESPACE (BufferPtr, Status); +#endif + return_ACPI_STATUS (Status); } -#else - ACPI_ERROR_NAMESPACE (BufferPtr, Status); -#endif - return_ACPI_STATUS (Status); } /* @@ -792,15 +796,16 @@ 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; @@ -811,8 +816,9 @@ /* 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); } @@ -862,7 +868,12 @@ { /* Execution mode, node cannot already exist, node is temporary */ - Flags |= (ACPI_NS_ERROR_IF_FOUND | ACPI_NS_TEMPORARY); + Flags |= ACPI_NS_ERROR_IF_FOUND; + + if (!(WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL)) + { + Flags |= ACPI_NS_TEMPORARY; + } } /* Add new entry or lookup existing entry */ @@ -952,24 +963,6 @@ if (!(WalkState->OpInfo->Flags & AML_NSOBJECT)) { -#ifndef ACPI_NO_METHOD_EXECUTION -#ifdef ACPI_ENABLE_MODULE_LEVEL_CODE - /* No namespace object. Executable opcode? */ - - if ((WalkState->OpInfo->Class == AML_CLASS_EXECUTE) || - (WalkState->OpInfo->Class == AML_CLASS_CONTROL)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "End/EXEC: %s (fl %8.8X)\n", WalkState->OpInfo->Name, - WalkState->OpInfo->Flags)); - - /* Executing a type1 or type2 opcode outside of a method */ - - Status = AcpiDsExecEndOp (WalkState); - return_ACPI_STATUS (Status); - } -#endif -#endif return_ACPI_STATUS (AE_OK); } @@ -1165,33 +1158,40 @@ } /* - * 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)) { /* Index: sys/contrib/dev/acpica/changes.txt =================================================================== --- sys/contrib/dev/acpica/changes.txt (revision 203510) +++ sys/contrib/dev/acpica/changes.txt (working copy) @@ -1,10 +1,470 @@ ---------------------------------------- -21 May 2009. Summary of changes for version 20090521: +21 January 2010. Summary of changes for version 20100121: -This release is available at www.acpica.org/downloads +1) ACPI CA Core Subsystem: +Added the 2010 copyright to all module headers and signons. This affects +virtually every file in the ACPICA core subsystem, the iASL compiler, the +tools/utilities, and the test suites. + +Implemented a change to the AcpiGetDevices interface to eliminate unnecessary +invocations of the _STA method. In the case where a specific _HID is +requested, do not run _STA until a _HID match is found. This eliminates +potentially dozens of _STA calls during a search for a particular device/HID, +which in turn can improve boot times. ACPICA BZ 828. Lin Ming. + +Implemented an additional repair for predefined method return values. Attempt +to repair unexpected NULL elements within returned Package objects. Create an +Integer of value zero, a NULL String, or a zero-length Buffer as appropriate. +ACPICA BZ 818. Lin Ming, Bob Moore. + +Removed the obsolete ACPI_INTEGER data type. This type was introduced as the +code was migrated from ACPI 1.0 (with 32-bit AML integers) to ACPI 2.0 (with +64-bit AML integers). It is now obsolete and this change removes it from the +ACPICA code base, replaced by UINT64. The original typedef has been retained +for now for compatibility with existing device driver code. ACPICA BZ 824. + +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. Updated the source +accordingly. This includes some code restructuring to eliminate unreachable +code, elimination of some gotos, elimination of unused return values, some +additional casting, and removal of redundant declarations. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 87.0K Code, 18.0K Data, 105.0K Total + Debug Version: 163.4K Code, 50.8K Data, 214.2K Total + Current Release: + Non-Debug Version: 87.1K Code, 18.0K Data, 105.1K Total + Debug Version: 163.5K Code, 50.9K Data, 214.4K Total + +2) iASL Compiler/Disassembler and Tools: + +No functional changes for this release. + +---------------------------------------- +14 December 2009. Summary of changes for version 20091214: + 1) ACPI CA Core Subsystem: +Enhanced automatic data type conversions for predefined name repairs. This +change expands the automatic repairs/conversions for predefined name return +values to make Integers, Strings, and Buffers fully interchangeable. Also, a +Buffer can be converted to a Package of Integers if necessary. The nsrepair.c +module was completely restructured. Lin Ming, Bob Moore. + +Implemented automatic removal of null package elements during predefined name +repairs. This change will automatically remove embedded and trailing NULL +package elements from returned package objects that are defined to contain a +variable number of sub-packages. The driver is then presented with a package +with no null elements to deal with. ACPICA BZ 819. + +Implemented a repair for the predefined _FDE and _GTM names. The expected +return value for both names is a Buffer of 5 DWORDs. This repair fixes two +possible problems (both seen in the field), where a package of integers is +returned, or a buffer of BYTEs is returned. With assistance from Jung-uk Kim. + +Implemented additional module-level code support. This change will properly +execute module-level code that is not at the root of the namespace (under a +Device object, etc.). Now executes the code within the current scope instead +of the root. ACPICA BZ 762. Lin Ming. + +Fixed possible mutex acquisition errors when running _REG methods. Fixes a +problem where mutex errors can occur when running a _REG method that is in +the same scope as a method-defined operation region or an operation region +under a module-level IF block. This type of code is rare, so the problem has +not been seen before. ACPICA BZ 826. Lin Ming, Bob Moore. + +Fixed a possible memory leak during module-level code execution. An object +could be leaked for each block of executed module-level code if the +interpreter slack mode is enabled This change deletes any implicitly returned +object from the module-level code block. Lin Ming. + +Removed messages for successful predefined repair(s). The repair mechanism +was considered too wordy. Now, messages are only unconditionally emitted if +the return object cannot be repaired. Existing messages for successful +repairs were converted to ACPI_DEBUG_PRINT messages for now. ACPICA BZ 827. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 86.6K Code, 18.2K Data, 104.8K Total + Debug Version: 162.7K Code, 50.8K Data, 213.5K Total + Current Release: + Non-Debug Version: 87.0K Code, 18.0K Data, 105.0K Total + Debug Version: 163.4K Code, 50.8K Data, 214.2K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a regression introduced in 20091112 where intermediate .SRC files +were no longer automatically removed at the termination of the compile. + +acpiexec: Implemented the -f option to specify default region fill value. +This option specifies the value used to initialize buffers that simulate +operation regions. Default value is zero. Useful for debugging problems that +depend on a specific initial value for a region or field. + +---------------------------------------- +12 November 2009. Summary of changes for version 20091112: + +1) ACPI CA Core Subsystem: + +Implemented a post-order callback to AcpiWalkNamespace. The existing +interface only has a pre-order callback. This change adds an additional +parameter for a post-order callback which will be more useful for bus scans. +ACPICA BZ 779. Lin Ming. Updated the ACPICA Programmer Reference. + +Modified the behavior of the operation region memory mapping cache for +SystemMemory. Ensure that the memory mappings created for operation regions +do not cross 4K page boundaries. Crossing a page boundary while mapping +regions can cause kernel warnings on some hosts if the pages have different +attributes. Such regions are probably BIOS bugs, and this is the workaround. +Linux BZ 14445. Lin Ming. + +Implemented an automatic repair for predefined methods that must return +sorted lists. This change will repair (by sorting) packages returned by _ALR, +_PSS, and _TSS. Drivers can now assume that the packages are correctly sorted +and do not contain NULL package elements. Adds one new file, +namespace/nsrepair2.c. ACPICA BZ 784. Lin Ming, Bob Moore. + +Fixed a possible fault during predefined name validation if a return Package +object contains NULL elements. Also adds a warning if a NULL element is +followed by any non-null elements. ACPICA BZ 813, 814. Future enhancement may +include repair or removal of all such NULL elements where possible. + +Implemented additional module-level executable AML code support. This change +will execute module-level code that is not at the root of the namespace +(under a Device object, etc.) at table load time. Module-level executable AML +code has been illegal since ACPI 2.0. ACPICA BZ 762. Lin Ming. + +Implemented a new internal function to create Integer objects. This function +simplifies miscellaneous object creation code. ACPICA BZ 823. + +Reduced the severity of predefined repair messages, Warning to Info. Since +the object was successfully repaired, a warning is too severe. Reduced to an +info message for now. These messages may eventually be changed to debug-only. +ACPICA BZ 812. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 85.8K Code, 18.0K Data, 103.8K Total + Debug Version: 161.8K Code, 50.6K Data, 212.4K Total + Current Release: + Non-Debug Version: 86.6K Code, 18.2K Data, 104.8K Total + Debug Version: 162.7K Code, 50.8K Data, 213.5K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented Switch() with While(1) so that Break works correctly. This +change correctly implements the Switch operator with a surrounding While(1) +so that the Break operator works as expected. ACPICA BZ 461. Lin Ming. + +iASL: Added a message if a package initializer list is shorter than package +length. Adds a new remark for a Package() declaration if an initializer list +exists, but is shorter than the declared length of the package. Although +technically legal, this is probably a coding error and it is seen in the +field. ACPICA BZ 815. Lin Ming, Bob Moore. + +iASL: Fixed a problem where the compiler could fault after the maximum number +of errors was reached (200). + +acpixtract: Fixed a possible warning for pointer cast if the compiler warning +level set very high. + +---------------------------------------- +13 October 2009. Summary of changes for version 20091013: + +1) ACPI CA Core Subsystem: + +Fixed a problem where an Operation Region _REG method could be executed more +than once. If a custom address space handler is installed by the host before +the "initialize operation regions" phase of the ACPICA initialization, any +_REG methods for that address space could be executed twice. This change +fixes the problem. ACPICA BZ 427. Lin Ming. + +Fixed a possible memory leak for the Scope() ASL operator. When the exact +invocation of "Scope(\)" is executed (change scope to root), one internal +operand object was leaked. Lin Ming. + +Implemented a run-time repair for the _MAT predefined method. If the _MAT +return value is defined as a Field object in the AML, and the field +size is less than or equal to the default width of an integer (32 or 64),_MAT +can incorrectly return an Integer instead of a Buffer. ACPICA now +automatically repairs this problem. ACPICA BZ 810. + +Implemented a run-time repair for the _BIF and _BIX predefined methods. The +"OEM Information" field is often incorrectly returned as an Integer with +value zero if the field is not supported by the platform. This is due to an +ambiguity in the ACPI specification. The field should always be a string. +ACPICA now automatically repairs this problem by returning a NULL string +within the returned Package. ACPICA BZ 807. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 85.6K Code, 18.0K Data, 103.6K Total + Debug Version: 161.7K Code, 50.9K Data, 212.6K Total + Current Release: + Non-Debug Version: 85.8K Code, 18.0K Data, 103.8K Total + Debug Version: 161.8K Code, 50.6K Data, 212.4K Total + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Fixed a problem where references to external symbols that +contained one or more parent-prefixes (carats) were not handled correctly, +possibly causing a fault. ACPICA BZ 806. Lin Ming. + +Disassembler: Restructured the code so that all functions that handle +external symbols are in a single module. One new file is added, +common/dmextern.c. + +AML Debugger: Added a max count argument for the Batch command (which +executes multiple predefined methods within the namespace.) + +iASL: Updated the compiler documentation (User Reference.) Available at +http://www.acpica.org/documentation/. ACPICA BZ 750. + +AcpiXtract: Updated for Lint and other formatting changes. Close all open +files. + +---------------------------------------- +03 September 2009. Summary of changes for version 20090903: + +1) ACPI CA Core Subsystem: + +For Windows Vista compatibility, added the automatic execution of an _INI +method located at the namespace root (\_INI). This method is executed at +table load time. This support is in addition to the automatic execution of +\_SB._INI. Lin Ming. + +Fixed a possible memory leak in the interpreter for AML package objects if +the package initializer list is longer than the defined size of the package. +This apparently can only happen if the BIOS changes the package size on the +fly (seen in a _PSS object), as ASL compilers do not allow this. The +interpreter will truncate the package to the defined size (and issue an error +message), but previously could leave the extra objects undeleted if they were +pre-created during the argument processing (such is the case if the package +consists of a number of sub-packages as in the _PSS.) ACPICA BZ 805. + +Fixed a problem seen when a Buffer or String is stored to itself via ASL. +This has been reported in the field. Previously, ACPICA would zero out the +buffer/string. Now, the operation is treated as a noop. Provides Windows +compatibility. ACPICA BZ 803. Lin Ming. + +Removed an extraneous error message for ASL constructs of the form +Store(LocalX,LocalX) when LocalX is uninitialized. These curious statements +are seen in many BIOSs and are once again treated as NOOPs and no error is +emitted when they are encountered. ACPICA BZ 785. + +Fixed an extraneous warning message if a _DSM reserved method returns a +Package object. _DSM can return any type of object, so validation on the +return type cannot be performed. ACPICA BZ 802. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 85.5K Code, 18.0K Data, 103.5K Total + Debug Version: 161.6K Code, 50.9K Data, 212.5K Total + Current Release: + Non-Debug Version: 85.6K Code, 18.0K Data, 103.6K Total + Debug Version: 161.7K Code, 50.9K Data, 212.6K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a problem with the use of the Alias operator and Resource +Templates. The correct alias is now constructed and no error is emitted. +ACPICA BZ 738. + +iASL: Implemented the -I option to specify additional search directories for +include files. Allows multiple additional search paths for include files. +Directories are searched in the order specified on the command line (after +the local directory is searched.) ACPICA BZ 800. + +iASL: Fixed a problem where the full pathname for include files was not +emitted for warnings/errors. This caused the IDE support to not work +properly. ACPICA BZ 765. + +iASL: Implemented the -@ option to specify a Windows-style response file +containing additional command line options. ACPICA BZ 801. + +AcpiExec: Added support to load multiple AML files simultaneously (such as a +DSDT and multiple SSDTs). Also added support for wildcards within the AML +pathname. These features allow all machine tables to be easily loaded and +debugged together. ACPICA BZ 804. + +Disassembler: Added missing support for disassembly of HEST table Error Bank +subtables. + +---------------------------------------- +30 July 2009. Summary of changes for version 20090730: + +The ACPI 4.0 implementation for ACPICA is complete with this release. + +1) ACPI CA Core Subsystem: + +ACPI 4.0: Added header file support for all new and changed ACPI tables. +Completely new tables are: IBFT, IVRS, MSCT, and WAET. Tables that are new +for ACPI 4.0, but have previously been supported in ACPICA are: CPEP, BERT, +EINJ, ERST, and HEST. Other newly supported tables are: UEFI and WDAT. There +have been some ACPI 4.0 changes to other existing tables. Split the large +actbl1.h header into the existing actbl2.h header. ACPICA BZ 774. + +ACPI 4.0: Implemented predefined name validation for all new names. There are +31 new names in ACPI 4.0. The predefined validation module was split into two +files. The new file is namespace/nsrepair.c. ACPICA BZ 770. + +Implemented support for so-called "module-level executable code". This is +executable AML code that exists outside of any control method and is intended +to be executed at table load time. Although illegal since ACPI 2.0, this type +of code still exists and is apparently still being created. Blocks of this +code are now detected and executed as intended. Currently, the code blocks +must exist under either an If, Else, or While construct; these are the +typical cases seen in the field. ACPICA BZ 762. Lin Ming. + +Implemented an automatic dynamic repair for predefined names that return +nested Package objects. This applies to predefined names that are defined to +return a variable-length Package of sub-packages. If the number of sub- +packages is one, BIOS code is occasionally seen that creates a simple single +package with no sub-packages. This code attempts to fix the problem by +wrapping a new package object around the existing package. These methods can +be repaired: _ALR, _CSD, _HPX, _MLS, _PRT, _PSS, _TRT, and _TSS. ACPICA BZ +790. + +Fixed a regression introduced in 20090625 for the AcpiGetDevices interface. +The _HID/_CID matching was broken and no longer matched IDs correctly. ACPICA +BZ 793. + +Fixed a problem with AcpiReset where the reset would silently fail if the +register was one of the protected I/O ports. AcpiReset now bypasses the port +validation mechanism. This may eventually be driven into the AcpiRead/Write +interfaces. + +Fixed a regression related to the recent update of the AcpiRead/Write +interfaces. A sleep/suspend could fail if the optional PM2 Control register +does not exist during an attempt to write the Bus Master Arbitration bit. +(However, some hosts already delete the code that writes this bit, and the +code may in fact be obsolete at this date.) ACPICA BZ 799. + +Fixed a problem where AcpiTerminate could fault if inadvertently called twice +in succession. ACPICA BZ 795. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 84.7K Code, 17.8K Data, 102.5K Total + Debug Version: 160.5K Code, 50.6K Data, 211.1K Total + Current Release: + Non-Debug Version: 85.5K Code, 18.0K Data, 103.5K Total + Debug Version: 161.6K Code, 50.9K Data, 212.5K Total + +2) iASL Compiler/Disassembler and Tools: + +ACPI 4.0: Implemented disassembler support for all new ACPI tables and +changes to existing tables. ACPICA BZ 775. + +---------------------------------------- +25 June 2009. Summary of changes for version 20090625: + +The ACPI 4.0 Specification was released on June 16 and is available at +www.acpi.info. ACPICA implementation of ACPI 4.0 is underway and will +continue for the next few releases. + +1) ACPI CA Core Subsystem: + +ACPI 4.0: Implemented interpreter support for the IPMI operation region +address space. Includes support for bi-directional data buffers and an IPMI +address space handler (to be installed by an IPMI device driver.) ACPICA BZ +773. Lin Ming. + +ACPI 4.0: Added changes for existing ACPI tables - FACS and SRAT. Includes +support in both the header files and the disassembler. + +Completed a major update for the AcpiGetObjectInfo external interface. +Changes include: + - Support for variable, unlimited length HID, UID, and CID strings. + - Support Processor objects the same as Devices (HID,UID,CID,ADR,STA, etc.) + - Call the _SxW power methods on behalf of a device object. + - Determine if a device is a PCI root bridge. + - Change the ACPI_BUFFER parameter to ACPI_DEVICE_INFO. +These changes will require an update to all callers of this interface. See +the updated ACPICA Programmer Reference for details. One new source file has +been added - utilities/utids.c. ACPICA BZ 368, 780. + +Updated the AcpiRead and AcpiWrite external interfaces to support 64-bit +transfers. The Value parameter has been extended from 32 bits to 64 bits in +order to support new ACPI 4.0 tables. These changes will require an update to +all callers of these interfaces. See the ACPICA Programmer Reference for +details. ACPICA BZ 768. + +Fixed several problems with AcpiAttachData. The handler was not invoked when +the host node was deleted. The data sub-object was not automatically deleted +when the host node was deleted. The interface to the handler had an unused +parameter, this was removed. ACPICA BZ 778. + +Enhanced the function that dumps ACPI table headers. All non-printable +characters in the string fields are now replaced with '?' (Signature, OemId, +OemTableId, and CompilerId.) ACPI tables with non-printable characters in +these fields are occasionally seen in the field. ACPICA BZ 788. + +Fixed a problem with predefined method repair code where the code that +attempts to repair/convert an object of incorrect type is only executed on +the first time the predefined method is called. The mechanism that disables +warnings on subsequent calls was interfering with the repair mechanism. +ACPICA BZ 781. + +Fixed a possible memory leak in the predefined validation/repair code when a +buffer is automatically converted to an expected string object. + +Removed obsolete 16-bit files from the distribution and from the current git +tree head. ACPICA BZ 776. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 83.4K Code, 17.5K Data, 100.9K Total + Debug Version: 158.9K Code, 50.0K Data, 208.9K Total + Current Release: + Non-Debug Version: 84.7K Code, 17.8K Data, 102.5K Total + Debug Version: 160.5K Code, 50.6K Data, 211.1K Total + +2) iASL Compiler/Disassembler and Tools: + +ACPI 4.0: iASL and Disassembler - implemented support for the new IPMI +operation region keyword. ACPICA BZ 771, 772. Lin Ming. + +ACPI 4.0: iASL - implemented compile-time validation support for all new +predefined names and control methods (31 total). ACPICA BZ 769. + +---------------------------------------- +21 May 2009. Summary of changes for version 20090521: + +1) ACPI CA Core Subsystem: + Disabled the preservation of the SCI enable bit in the PM1 control register. The SCI enable bit (bit 0, SCI_EN) is defined by the ACPI specification to be a "preserved" bit - "OSPM always preserves this bit position", section @@ -74,8 +534,6 @@ ---------------------------------------- 22 April 2009. Summary of changes for version 20090422: -This release is available at www.acpica.org/downloads - 1) ACPI CA Core Subsystem: Fixed a compatibility issue with the recently released I/O port protection @@ -623,9 +1081,6 @@ 29 July 2008. Summary of changes for version 20080729: -This release is available at http://acpica.org/downloads -Direct git access via http://www.acpica.org/repos/acpica.git - 1) ACPI CA Core Subsystem: Fix a possible deadlock in the GPE dispatch. Remove call to @@ -715,9 +1170,6 @@ ---------------------------------------- 01 July 2008. Summary of changes for version 20080701: -This release is available at http://acpica.org/downloads -Direct git access via http://www.acpica.org/repos/acpica.git - 0) Git source tree / acpica.org Fixed a problem where a git-clone from http would not transfer the entire Index: sys/contrib/dev/acpica/common/adisasm.c =================================================================== --- sys/contrib/dev/acpica/common/adisasm.c (revision 203510) +++ sys/contrib/dev/acpica/common/adisasm.c (working copy) @@ -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 @@ AdDisassemblerHeader ( char *Filename); -void -AdAddExternalsToNamespace ( - void); - -UINT32 -AdMethodExternalCount ( - void); - ACPI_STATUS AdDeferredParse ( ACPI_PARSE_OBJECT *Op, @@ -171,9 +167,7 @@ AdParseDeferredOps ( ACPI_PARSE_OBJECT *Root); -ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot; - /* Stubs for ASL compiler */ #ifndef ACPI_ASL_COMPILER @@ -192,7 +186,6 @@ { return (Status); } - #endif ACPI_STATUS @@ -238,18 +231,19 @@ } -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 @@ } -/******************************************************************************* - * - * 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 @@ * *****************************************************************************/ -extern char *Gbl_ExternalFilename; - ACPI_STATUS AdAmlDisassemble ( BOOLEAN OutToFile, @@ -403,12 +321,11 @@ 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 @@ /* 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 @@ } /* - * Output: ASL code. - * Redirect to a file if requested + * Output: ASL code. Redirect to a file if requested */ if (OutToFile) { @@ -589,11 +499,11 @@ * 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 @@ 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 @@ * * 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 @@ * * FUNCTION: AdParseDeferredOps * - * PARAMETERS: Root - Root of the parse tree + * PARAMETERS: Root - Root of the parse tree * * RETURN: Status * @@ -1055,8 +965,8 @@ * * 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 @@ 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 @@ * * 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 * Index: sys/contrib/dev/acpica/common/dmtbinfo.c =================================================================== --- sys/contrib/dev/acpica/common/dmtbinfo.c (revision 203510) +++ sys/contrib/dev/acpica/common/dmtbinfo.c (working copy) @@ -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 @@ -139,14 +139,19 @@ #define ACPI_ERST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_ERST,f) #define ACPI_HEST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_HEST,f) #define ACPI_HPET_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_HPET,f) +#define ACPI_IVRS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_IVRS,f) #define ACPI_MADT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MADT,f) #define ACPI_MCFG_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MCFG,f) +#define ACPI_MSCT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MSCT,f) #define ACPI_SBST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SBST,f) #define ACPI_SLIT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SLIT,f) #define ACPI_SPCR_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SPCR,f) #define ACPI_SPMI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SPMI,f) #define ACPI_SRAT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SRAT,f) #define ACPI_TCPA_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_TCPA,f) +#define ACPI_UEFI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_UEFI,f) +#define ACPI_WAET_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WAET,f) +#define ACPI_WDAT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDAT,f) #define ACPI_WDRT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDRT,f) /* Subtables */ @@ -163,17 +168,24 @@ #define ACPI_DMAR0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_HARDWARE_UNIT,f) #define ACPI_DMAR1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f) #define ACPI_DMAR2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_ATSR,f) +#define ACPI_DMAR3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_RHSA,f) #define ACPI_EINJ0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,f) -#define ACPI_HEST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_XPF_MACHINE_CHECK,f) -#define ACPI_HEST1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_XPF_CORRECTED,f) -#define ACPI_HEST3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_XPF_NMI,f) -#define ACPI_HEST4_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IPF_CORRECTED,f) -#define ACPI_HEST5_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IPF_CORRECTED_PLATFORM,f) +#define ACPI_HEST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f) +#define ACPI_HEST1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f) +#define ACPI_HEST2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_NMI,f) #define ACPI_HEST6_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_AER_ROOT,f) #define ACPI_HEST7_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_AER,f) #define ACPI_HEST8_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_AER_BRIDGE,f) #define ACPI_HEST9_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_GENERIC,f) #define ACPI_HESTN_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_NOTIFY,f) +#define ACPI_HESTB_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_ERROR_BANK,f) +#define ACPI_IVRSH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_HEADER,f) +#define ACPI_IVRS0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_HARDWARE,f) +#define ACPI_IVRS1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_MEMORY,f) +#define ACPI_IVRSD_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DE_HEADER,f) +#define ACPI_IVRS8A_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DEVICE8A,f) +#define ACPI_IVRS8B_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DEVICE8B,f) +#define ACPI_IVRS8C_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DEVICE8C,f) #define ACPI_MADT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC,f) #define ACPI_MADT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_IO_APIC,f) #define ACPI_MADT2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f) @@ -187,10 +199,12 @@ #define ACPI_MADT10_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f) #define ACPI_MADTH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) #define ACPI_MCFG0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f) +#define ACPI_MSCT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f) #define ACPI_SRATH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) #define ACPI_SRAT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f) #define ACPI_SRAT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f) #define ACPI_SRAT2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f) +#define ACPI_WDAT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WDAT_ENTRY,f) /* * Simplify access to flag fields by breaking them up into bytes @@ -299,12 +313,16 @@ {ACPI_DMT_NAME4, ACPI_FACS_OFFSET (Signature[0]), "Signature"}, {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (Length), "Length"}, {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (HardwareSignature), "Hardware Signature"}, - {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (FirmwareWakingVector), "Firmware Waking Vector(32)"}, + {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (FirmwareWakingVector), "32 Firmware Waking Vector"}, {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (GlobalLock), "Global Lock"}, {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (Flags), "Flags (decoded below)"}, {ACPI_DMT_FLAG0, ACPI_FACS_FLAG_OFFSET (Flags,0), "S4BIOS Support Present"}, - {ACPI_DMT_UINT64, ACPI_FACS_OFFSET (XFirmwareWakingVector), "Firmware Waking Vector(64)"}, + {ACPI_DMT_FLAG1, ACPI_FACS_FLAG_OFFSET (Flags,0), "64-bit Wake Supported (V2)"}, + {ACPI_DMT_UINT64, ACPI_FACS_OFFSET (XFirmwareWakingVector), "64 Firmware Waking Vector"}, {ACPI_DMT_UINT8, ACPI_FACS_OFFSET (Version), "Version"}, + {ACPI_DMT_UINT24, ACPI_FACS_OFFSET (Reserved[0]), "Reserved"}, + {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (OspmFlags), "OspmFlags (decoded below)"}, + {ACPI_DMT_FLAG0, ACPI_FACS_FLAG_OFFSET (OspmFlags,0), "64-bit Wake Env Required (V2)"}, {ACPI_DMT_EXIT, 0, NULL} }; @@ -454,9 +472,9 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoAsf0[] = { {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (MinResetValue), "Minimum Reset Value"}, - {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (MinResetValue), "Minimum Polling Interval"}, + {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (MinPollInterval), "Minimum Polling Interval"}, {ACPI_DMT_UINT16, ACPI_ASF0_OFFSET (SystemId), "System ID"}, - {ACPI_DMT_UINT32, ACPI_ASF0_OFFSET (SystemId), "Manufacturer ID"}, + {ACPI_DMT_UINT32, ACPI_ASF0_OFFSET (MfgId), "Manufacturer ID"}, {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (Flags), "Flags"}, {ACPI_DMT_UINT24, ACPI_ASF0_OFFSET (Reserved2[0]), "Reserved"}, {ACPI_DMT_EXIT, 0, NULL} @@ -579,8 +597,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[] = { - {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Type), "Subtable Type"}, - {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Length), "Length"}, + {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Header.Type), "Subtable Type"}, + {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Header.Length), "Length"}, {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Id), "Processor ID"}, {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Eid), "Processor EID"}, {ACPI_DMT_UINT32, ACPI_CPEP0_OFFSET (Interval), "Polling Interval"}, @@ -671,7 +689,17 @@ {ACPI_DMT_EXIT, 0, NULL} }; +/* 3: Remapping Hardware Static Affinity Structure */ +ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[] = +{ + {ACPI_DMT_UINT32, ACPI_DMAR3_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT64, ACPI_DMAR3_OFFSET (BaseAddress), "Base Address"}, + {ACPI_DMT_UINT32, ACPI_DMAR3_OFFSET (ProximityDomain), "Proximity Domain"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + + /******************************************************************************* * * ECDT - Embedded Controller Boot Resources Table @@ -698,7 +726,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[] = { {ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (HeaderLength), "Injection Header Length"}, - {ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT8, ACPI_EINJ_OFFSET (Flags), "Flags"}, + {ACPI_DMT_UINT24, ACPI_EINJ_OFFSET (Reserved[0]), "Reserved"}, {ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (Entries), "Injection Entry Count"}, {ACPI_DMT_EXIT, 0, NULL} }; @@ -743,97 +772,84 @@ {ACPI_DMT_EXIT, 0, NULL} }; +/* Common HEST structures for subtables */ + +#define ACPI_DM_HEST_HEADER \ + {ACPI_DMT_HEST, ACPI_HEST0_OFFSET (Header.Type), "Subtable Type"}, \ + {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Header.SourceId), "Source Id"} + +#define ACPI_DM_HEST_AER \ + {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved1), "Reserved"}, \ + {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags"}, \ + {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Enabled), "Enabled"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.RecordsToPreallocate), "Records To Preallocate"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.MaxSectionsPerRecord), "Max Sections Per Record"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.Bus), "Bus"}, \ + {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Device), "Device"}, \ + {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Function), "Function"}, \ + {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.DeviceControl), "DeviceControl"}, \ + {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved2), "Reserved"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableMask), "Uncorrectable Mask"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableSeverity), "Uncorrectable Severity"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.CorrectableMask), "Correctable Mask"}, \ + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.AdvancedCapabilities), "Advanced Capabilities"} + + /* HEST Subtables */ -/* 0: XPF Machine Check Exception */ +/* 0: IA32 Machine Check Exception */ ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[] = { - {ACPI_DMT_HEST, ACPI_HEST0_OFFSET (Header.Type), "Subtable Type"}, - {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (SourceId), "Source Id"}, - {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (ConfigWriteEnable), "Configuration Write Enable"}, + ACPI_DM_HEST_HEADER, + {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Reserved1), "Reserved"}, {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Flags), "Flags"}, - {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Reserved1), "Reserved"}, - {ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (RecordsToPreAllocate), "Records To Preallocate"}, + {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Enabled), "Enabled"}, + {ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (RecordsToPreallocate), "Records To Preallocate"}, {ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"}, {ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalCapabilityData), "Global Capability Data"}, {ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalControlData), "Global Control Data"}, {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (NumHardwareBanks), "Num Hardware Banks"}, - {ACPI_DMT_UINT56, ACPI_HEST0_OFFSET (Reserved2), "Reserved"}, + {ACPI_DMT_UINT56, ACPI_HEST0_OFFSET (Reserved3[0]), "Reserved"}, {ACPI_DMT_EXIT, 0, NULL} }; -/* 1: XPF Corrected Machine Check */ +/* 1: IA32 Corrected Machine Check */ ACPI_DMTABLE_INFO AcpiDmTableInfoHest1[] = { - {ACPI_DMT_HEST, ACPI_HEST1_OFFSET (Header.Type), "Subtable Type"}, - {ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (SourceId), "Source Id"}, - {ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (ConfigWriteEnable), "Configuration Write Enable"}, + ACPI_DM_HEST_HEADER, + {ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (Reserved1), "Reserved"}, {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Flags), "Flags"}, {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Enabled), "Enabled"}, - {ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (RecordsToPreAllocate), "Records To Preallocate"}, + {ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (RecordsToPreallocate), "Records To Preallocate"}, {ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"}, {ACPI_DMT_HESTNTFY, ACPI_HEST1_OFFSET (Notify), "Notify"}, {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (NumHardwareBanks), "Num Hardware Banks"}, - {ACPI_DMT_UINT24, ACPI_HEST1_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT24, ACPI_HEST1_OFFSET (Reserved2[0]), "Reserved"}, {ACPI_DMT_EXIT, 0, NULL} }; -/* 3: XPF Non-Maskable Interrupt */ +/* 2: IA32 Non-Maskable Interrupt */ -ACPI_DMTABLE_INFO AcpiDmTableInfoHest3[] = +ACPI_DMTABLE_INFO AcpiDmTableInfoHest2[] = { - {ACPI_DMT_HEST, ACPI_HEST3_OFFSET (Header.Type), "Subtable Type"}, - {ACPI_DMT_UINT16, ACPI_HEST3_OFFSET (SourceId), "Source Id"}, - {ACPI_DMT_UINT32, ACPI_HEST3_OFFSET (Reserved), "Reserved"}, - {ACPI_DMT_UINT32, ACPI_HEST3_OFFSET (RecordsToPreAllocate), "Records To Preallocate"}, - {ACPI_DMT_UINT32, ACPI_HEST3_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"}, - {ACPI_DMT_UINT32, ACPI_HEST3_OFFSET (MaxRawDataLength), "Max Raw Data Length"}, + ACPI_DM_HEST_HEADER, + {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (RecordsToPreallocate), "Records To Preallocate"}, + {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"}, + {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (MaxRawDataLength), "Max Raw Data Length"}, {ACPI_DMT_EXIT, 0, NULL} }; -/* 4: IPF Corrected Machine Check */ -ACPI_DMTABLE_INFO AcpiDmTableInfoHest4[] = -{ - {ACPI_DMT_HEST, ACPI_HEST4_OFFSET (Header.Type), "Subtable Type"}, - {ACPI_DMT_UINT8, ACPI_HEST4_OFFSET (Enabled), "Enabled"}, - {ACPI_DMT_UINT8, ACPI_HEST4_OFFSET (Reserved), "Reserved"}, - {ACPI_DMT_EXIT, 0, NULL} -}; - -/* 5: IPF Corrected Platform Error */ - -ACPI_DMTABLE_INFO AcpiDmTableInfoHest5[] = -{ - {ACPI_DMT_HEST, ACPI_HEST5_OFFSET (Header.Type), "Subtable Type"}, - {ACPI_DMT_UINT8, ACPI_HEST5_OFFSET (Enabled), "Enabled"}, - {ACPI_DMT_UINT8, ACPI_HEST5_OFFSET (Reserved), "Reserved"}, - {ACPI_DMT_EXIT, 0, NULL} -}; - /* 6: PCI Express Root Port AER */ ACPI_DMTABLE_INFO AcpiDmTableInfoHest6[] = { - {ACPI_DMT_HEST, ACPI_HEST6_OFFSET (Header.Type), "Subtable Type"}, - {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.SourceId), "Source Id"}, - {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.ConfigWriteEnable), "Configuration Write Enable"}, - {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags"}, - {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Enabled), "Enabled"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.RecordsToPreAllocate), "Records To Preallocate"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.MaxSectionsPerRecord), "Max Sections Per Record"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.Bus), "Bus"}, - {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Device), "Device"}, - {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Function), "Function"}, - {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.DeviceControl), "DeviceControl"}, - {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved), "Reserved"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableErrorMask), "Uncorrectable Error Mask"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableErrorSeverity), "Uncorrectable Error Severity"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.CorrectableErrorMask), "Correctable Error Mask"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.AdvancedErrorCapabilities), "Advanced Error Capabilities"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (RootErrorCommand), "Root Error Command"}, + ACPI_DM_HEST_HEADER, + ACPI_DM_HEST_AER, + {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (RootErrorCommand), "Root Error Command"}, {ACPI_DMT_EXIT, 0, NULL} }; @@ -841,22 +857,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest7[] = { - {ACPI_DMT_HEST, ACPI_HEST6_OFFSET (Header.Type), "Subtable Type"}, - {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.SourceId), "Source Id"}, - {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.ConfigWriteEnable), "Configuration Write Enable"}, - {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags"}, - {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Enabled), "Enabled"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.RecordsToPreAllocate), "Records To Preallocate"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.MaxSectionsPerRecord), "Max Sections Per Record"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.Bus), "Bus"}, - {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Device), "Device"}, - {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Function), "Function"}, - {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.DeviceControl), "DeviceControl"}, - {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved), "Reserved"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableErrorMask), "Uncorrectable Error Mask"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableErrorSeverity), "Uncorrectable Error Severity"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.CorrectableErrorMask), "Correctable Error Mask"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.AdvancedErrorCapabilities), "Advanced Error Capabilities"}, + ACPI_DM_HEST_HEADER, + ACPI_DM_HEST_AER, {ACPI_DMT_EXIT, 0, NULL} }; @@ -864,25 +866,11 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest8[] = { - {ACPI_DMT_HEST, ACPI_HEST6_OFFSET (Header.Type), "Subtable Type"}, - {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.SourceId), "Source Id"}, - {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.ConfigWriteEnable), "Configuration Write Enable"}, - {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags"}, - {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Enabled), "Enabled"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.RecordsToPreAllocate), "Records To Preallocate"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.MaxSectionsPerRecord), "Max Sections Per Record"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.Bus), "Bus"}, - {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Device), "Device"}, - {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Function), "Function"}, - {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.DeviceControl), "DeviceControl"}, - {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved), "Reserved"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableErrorMask), "Uncorrectable Error Mask"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableErrorSeverity), "Uncorrectable Error Severity"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.CorrectableErrorMask), "Correctable Error Mask"}, - {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.AdvancedErrorCapabilities), "Advanced Error Capabilities"}, - {ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (SecondaryUncorrectableErrorMask), "2nd Uncorrectable Err Mask"}, - {ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (SecondaryUncorrectableErrorSeverity), "2nd Uncorrectable Err Severity"}, - {ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (SecondaryAdvancedCapabilities), "2nd Advanced Capabilities"}, + ACPI_DM_HEST_HEADER, + ACPI_DM_HEST_AER, + {ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (UncorrectableMask2), "2nd Uncorrectable Mask"}, + {ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (UncorrectableSeverity2), "2nd Uncorrectable Severity"}, + {ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (AdvancedCapabilities2), "2nd Advanced Capabilities"}, {ACPI_DMT_EXIT, 0, NULL} }; @@ -890,21 +878,20 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest9[] = { - {ACPI_DMT_HEST, ACPI_HEST9_OFFSET (Header.Type), "Subtable Type"}, - {ACPI_DMT_UINT16, ACPI_HEST9_OFFSET (SourceId), "Source Id"}, + ACPI_DM_HEST_HEADER, {ACPI_DMT_UINT16, ACPI_HEST9_OFFSET (RelatedSourceId), "Related Source Id"}, - {ACPI_DMT_UINT8, ACPI_HEST9_OFFSET (ConfigWriteEnable), "Configuration Write Enable"}, + {ACPI_DMT_UINT8, ACPI_HEST9_OFFSET (Reserved), "Reserved"}, {ACPI_DMT_UINT8, ACPI_HEST9_OFFSET (Enabled), "Enabled"}, - {ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (RecordsToPreAllocate), "Records To Preallocate"}, + {ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (RecordsToPreallocate), "Records To Preallocate"}, {ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"}, {ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (MaxRawDataLength), "Max Raw Data Length"}, {ACPI_DMT_GAS, ACPI_HEST9_OFFSET (ErrorStatusAddress), "Error Status Address"}, {ACPI_DMT_HESTNTFY, ACPI_HEST9_OFFSET (Notify), "Notify"}, - {ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (ErrorStatusBlockLength), "Error Status Block Length"}, + {ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (ErrorBlockLength), "Error Status Block Length"}, {ACPI_DMT_EXIT, 0, NULL} }; -ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[10] = +ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[] = { {ACPI_DMT_HESTNTYP, ACPI_HESTN_OFFSET (Type), "Notify Type"}, {ACPI_DMT_UINT8, ACPI_HESTN_OFFSET (Length), "Notify Length"}, @@ -919,6 +906,25 @@ }; +/* + * IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and + * ACPI_HEST_IA_CORRECTED structures. + */ +ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank[] = +{ + {ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (BankNumber), "Bank Number"}, + {ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (ClearStatusOnInit), "Clear Status On Init"}, + {ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (StatusFormat), "Status Format"}, + {ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (ControlRegister), "Control Register"}, + {ACPI_DMT_UINT64, ACPI_HESTB_OFFSET (ControlData), "Control Data"}, + {ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (StatusRegister), "Status Register"}, + {ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (AddressRegister), "Address Register"}, + {ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (MiscRegister), "Misc Register"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + + /******************************************************************************* * * HPET - High Precision Event Timer table @@ -932,15 +938,110 @@ {ACPI_DMT_UINT8, ACPI_HPET_OFFSET (Sequence), "Sequence Number"}, {ACPI_DMT_UINT16, ACPI_HPET_OFFSET (MinimumTick), "Minimum Clock Ticks"}, {ACPI_DMT_UINT8, ACPI_HPET_OFFSET (Flags), "Flags (decoded below)"}, - {ACPI_DMT_FLAG0, ACPI_HPET_FLAG_OFFSET (Flags,0), "Page Protect"}, - {ACPI_DMT_FLAG1, ACPI_HPET_FLAG_OFFSET (Flags,0), "4K Page Protect"}, - {ACPI_DMT_FLAG2, ACPI_HPET_FLAG_OFFSET (Flags,0), "64K Page Protect"}, + {ACPI_DMT_FLAG0, ACPI_HPET_FLAG_OFFSET (Flags,0), "4K Page Protect"}, + {ACPI_DMT_FLAG1, ACPI_HPET_FLAG_OFFSET (Flags,0), "64K Page Protect"}, {ACPI_DMT_EXIT, 0, NULL} }; /******************************************************************************* * + * IVRS - I/O Virtualization Reporting Structure + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs[] = +{ + {ACPI_DMT_UINT32, ACPI_IVRS_OFFSET (Info), "Virtualization Info"}, + {ACPI_DMT_UINT64, ACPI_IVRS_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + +/* Common Subtable header (one per Subtable) */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHdr[] = +{ + {ACPI_DMT_IVRS, ACPI_IVRSH_OFFSET (Type), "Subtable Type"}, + {ACPI_DMT_UINT8, ACPI_IVRSH_OFFSET (Flags), "Flags"}, + {ACPI_DMT_UINT16, ACPI_IVRSH_OFFSET (Length), "Length"}, + {ACPI_DMT_UINT16, ACPI_IVRSH_OFFSET (DeviceId), "DeviceId"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + +/* IVRS subtables */ + +/* 0x10: I/O Virtualization Hardware Definition (IVHD) Block */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs0[] = +{ + {ACPI_DMT_UINT16, ACPI_IVRS0_OFFSET (CapabilityOffset), "Capability Offset"}, + {ACPI_DMT_UINT64, ACPI_IVRS0_OFFSET (BaseAddress), "Base Address"}, + {ACPI_DMT_UINT16, ACPI_IVRS0_OFFSET (PciSegmentGroup), "PCI Segment Group"}, + {ACPI_DMT_UINT16, ACPI_IVRS0_OFFSET (Info), "Virtualization Info"}, + {ACPI_DMT_UINT32, ACPI_IVRS0_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + +/* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition (IVMD) Block */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs1[] = +{ + {ACPI_DMT_UINT16, ACPI_IVRS1_OFFSET (AuxData), "Auxiliary Data"}, + {ACPI_DMT_UINT64, ACPI_IVRS1_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_UINT64, ACPI_IVRS1_OFFSET (StartAddress), "Start Address"}, + {ACPI_DMT_UINT64, ACPI_IVRS1_OFFSET (MemoryLength), "Memory Length"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + +/* Device entry header for IVHD block */ + +#define ACPI_DMT_IVRS_DE_HEADER \ + {ACPI_DMT_UINT8, ACPI_IVRSD_OFFSET (Type), "Entry Type"}, \ + {ACPI_DMT_UINT16, ACPI_IVRSD_OFFSET (Id), "Device ID"}, \ + {ACPI_DMT_UINT8, ACPI_IVRSD_OFFSET (DataSetting), "Data Setting"} + +/* 4-byte device entry */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs4[] = +{ + ACPI_DMT_IVRS_DE_HEADER, + {ACPI_DMT_EXIT, 0, NULL} +}; + +/* 8-byte device entry */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8a[] = +{ + ACPI_DMT_IVRS_DE_HEADER, + {ACPI_DMT_UINT8, ACPI_IVRS8A_OFFSET (Reserved1), "Reserved"}, + {ACPI_DMT_UINT16, ACPI_IVRS8A_OFFSET (UsedId), "Source Used Device ID"}, + {ACPI_DMT_UINT8, ACPI_IVRS8A_OFFSET (Reserved2), "Reserved"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + +/* 8-byte device entry */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8b[] = +{ + ACPI_DMT_IVRS_DE_HEADER, + {ACPI_DMT_UINT32, ACPI_IVRS8B_OFFSET (ExtendedData), "Extended Data"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + +/* 8-byte device entry */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8c[] = +{ + ACPI_DMT_IVRS_DE_HEADER, + {ACPI_DMT_UINT8, ACPI_IVRS8C_OFFSET (Handle), "Handle"}, + {ACPI_DMT_UINT16, ACPI_IVRS8C_OFFSET (UsedId), "Source Used Device ID"}, + {ACPI_DMT_UINT8, ACPI_IVRS8C_OFFSET (Variety), "Variety"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + + +/******************************************************************************* + * * MADT - Multiple APIC Description Table and subtables * ******************************************************************************/ @@ -1074,7 +1175,7 @@ {ACPI_DMT_EXIT, 0, NULL} }; -/* 9: Processor Local X2_APIC (07/2008) */ +/* 9: Processor Local X2_APIC (ACPI 4.0) */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt9[] = { @@ -1086,7 +1187,7 @@ {ACPI_DMT_EXIT, 0, NULL} }; -/* 10: Local X2_APIC NMI (07/2008) */ +/* 10: Local X2_APIC NMI (ACPI 4.0) */ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[] = { @@ -1125,6 +1226,35 @@ /******************************************************************************* * + * MSCT - Maximum System Characteristics Table (ACPI 4.0) + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMsct[] = +{ + {ACPI_DMT_UINT32, ACPI_MSCT_OFFSET (ProximityOffset), "Proximity Offset"}, + {ACPI_DMT_UINT32, ACPI_MSCT_OFFSET (MaxProximityDomains), "Max Proximity Domains"}, + {ACPI_DMT_UINT32, ACPI_MSCT_OFFSET (MaxClockDomains), "Max Clock Domains"}, + {ACPI_DMT_UINT64, ACPI_MSCT_OFFSET (MaxAddress), "Max Physical Address"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + +/* Subtable - Maximum Proximity Domain Information. Version 1 */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[] = +{ + {ACPI_DMT_UINT8, ACPI_MSCT0_OFFSET (Revision), "Revision"}, + {ACPI_DMT_UINT8, ACPI_MSCT0_OFFSET (Length), "Length"}, + {ACPI_DMT_UINT32, ACPI_MSCT0_OFFSET (RangeStart), "Domain Range Start"}, + {ACPI_DMT_UINT32, ACPI_MSCT0_OFFSET (RangeEnd), "Domain Range End"}, + {ACPI_DMT_UINT32, ACPI_MSCT0_OFFSET (ProcessorCapacity), "Processor Capacity"}, + {ACPI_DMT_UINT64, ACPI_MSCT0_OFFSET (MemoryCapacity), "Memory Capacity"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + + +/******************************************************************************* + * * SBST - Smart Battery Specification Table * ******************************************************************************/ @@ -1203,8 +1333,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[] = { + {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterfaceType), "Interface Type"}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved), "Reserved"}, - {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterfaceType), "Interface Type"}, {ACPI_DMT_UINT16, ACPI_SPMI_OFFSET (SpecRevision), "IPMI Spec Version"}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterruptType), "Interrupt Type"}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (GpeNumber), "GPE Number"}, @@ -1216,6 +1346,7 @@ {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciBus), "PCI Bus"}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciDevice), "PCI Device"}, {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciFunction), "PCI Function"}, + {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved2), "Reserved"}, {ACPI_DMT_EXIT, 0, NULL} }; @@ -1275,7 +1406,7 @@ {ACPI_DMT_EXIT, 0, NULL} }; -/* 2: Processor Local X2_APIC Affinity (07/2008) */ +/* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[] = { @@ -1284,6 +1415,8 @@ {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ApicId), "Apic ID"}, {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Flags), "Flags (decoded below)"}, {ACPI_DMT_FLAG0, ACPI_SRAT2_FLAG_OFFSET (Flags,0), "Enabled"}, + {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ClockDomain), "Clock Domain"}, + {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Reserved2), "Reserved"}, {ACPI_DMT_EXIT, 0, NULL} }; @@ -1305,25 +1438,90 @@ /******************************************************************************* * + * UEFI - UEFI Boot optimization Table + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[] = +{ + {ACPI_DMT_BUF16, ACPI_UEFI_OFFSET (Identifier[0]), "UUID Identifier"}, + {ACPI_DMT_UINT16, ACPI_UEFI_OFFSET (DataOffset), "Data Offset"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + + +/******************************************************************************* + * + * WAET - Windows ACPI Emulated devices Table + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoWaet[] = +{ + {ACPI_DMT_UINT32, ACPI_WAET_OFFSET (Flags), "Flags (decoded below)"}, + {ACPI_DMT_FLAG0, ACPI_WAET_OFFSET (Flags), "RTC needs no INT ack"}, + {ACPI_DMT_FLAG1, ACPI_WAET_OFFSET (Flags), "PM timer, one read only"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + + +/******************************************************************************* + * + * WDAT - Watchdog Action Table + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoWdat[] = +{ + {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (HeaderLength), "Header Length"}, + {ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (PciSegment), "PCI Segment"}, + {ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (PciBus), "PCI Bus"}, + {ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (PciDevice), "PCI Device"}, + {ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (PciFunction), "PCI Function"}, + {ACPI_DMT_UINT24, ACPI_WDAT_OFFSET (Reserved[0]), "Reserved"}, + {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (TimerPeriod), "Timer Period"}, + {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (MaxCount), "Max Count"}, + {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (MinCount), "Min Count"}, + {ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (Flags), "Flags (decoded below)"}, + {ACPI_DMT_FLAG0, ACPI_WDAT_OFFSET (Flags), "Enabled"}, + {ACPI_DMT_FLAG7, ACPI_WDAT_OFFSET (Flags), "Stopped When Asleep"}, + {ACPI_DMT_UINT24, ACPI_WDAT_OFFSET (Reserved2[0]), "Reserved"}, + {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (Entries), "Watchdog Entry Count"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + +/* WDAT Subtables - Watchdog Instruction Entries */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoWdat0[] = +{ + {ACPI_DMT_UINT8, ACPI_WDAT0_OFFSET (Action), "Watchdog Action"}, + {ACPI_DMT_UINT8, ACPI_WDAT0_OFFSET (Instruction), "Instruction"}, + {ACPI_DMT_UINT16, ACPI_WDAT0_OFFSET (Reserved), "Reserved"}, + {ACPI_DMT_GAS, ACPI_WDAT0_OFFSET (RegisterRegion), "Register Region"}, + {ACPI_DMT_UINT32, ACPI_WDAT0_OFFSET (Value), "Value"}, + {ACPI_DMT_UINT32, ACPI_WDAT0_OFFSET (Mask), "Register Mask"}, + {ACPI_DMT_EXIT, 0, NULL} +}; + + +/******************************************************************************* + * * WDRT - Watchdog Resource Table * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[] = { - {ACPI_DMT_UINT32, ACPI_WDRT_OFFSET (HeaderLength), "Header Length"}, - {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciSegment), "PCI Segment"}, + {ACPI_DMT_GAS, ACPI_WDRT_OFFSET (ControlRegister), "Control Register"}, + {ACPI_DMT_GAS, ACPI_WDRT_OFFSET (CountRegister), "Count Register"}, + {ACPI_DMT_UINT16, ACPI_WDRT_OFFSET (PciDeviceId), "PCI Device ID"}, + {ACPI_DMT_UINT16, ACPI_WDRT_OFFSET (PciVendorId), "PCI Vendor ID"}, {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciBus), "PCI Bus"}, {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciDevice), "PCI Device"}, {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciFunction), "PCI Function"}, - {ACPI_DMT_UINT32, ACPI_WDRT_OFFSET (TimerPeriod), "Timer Period"}, - {ACPI_DMT_UINT32, ACPI_WDRT_OFFSET (MaxCount), "Max Count"}, - {ACPI_DMT_UINT32, ACPI_WDRT_OFFSET (MinCount), "Min Count"}, - {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (Flags), "Flags (decoded below)"}, - {ACPI_DMT_FLAG0, ACPI_WDRT_OFFSET (Flags), "Enabled"}, - {ACPI_DMT_FLAG7, ACPI_WDRT_OFFSET (Flags), "Stopped When Asleep"}, - {ACPI_DMT_UINT24, ACPI_WDRT_OFFSET (Reserved[0]), "Reserved"}, - {ACPI_DMT_UINT32, ACPI_WDRT_OFFSET (Entries), "Watchdog Entries"}, + {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciSegment), "PCI Segment"}, + {ACPI_DMT_UINT16, ACPI_WDRT_OFFSET (MaxCount), "Max Count"}, + {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (Units), "Counter Units"}, {ACPI_DMT_EXIT, 0, NULL} }; Index: sys/contrib/dev/acpica/common/getopt.c =================================================================== --- sys/contrib/dev/acpica/common/getopt.c (revision 203510) +++ sys/contrib/dev/acpica/common/getopt.c (working copy) @@ -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 @@ 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 @@ 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 { Index: sys/contrib/dev/acpica/common/adwalk.c =================================================================== --- sys/contrib/dev/acpica/common/adwalk.c (revision 203510) +++ sys/contrib/dev/acpica/common/adwalk.c (working copy) @@ -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 #include #include -#include #include #include #include @@ -184,7 +183,7 @@ * * FUNCTION: AcpiDmDumpTree * - * PARAMETERS: Origin - Starting object + * PARAMETERS: Origin - Starting object * * RETURN: None * @@ -218,7 +217,7 @@ * * FUNCTION: AcpiDmFindOrphanMethods * - * PARAMETERS: Origin - Starting object + * PARAMETERS: Origin - Starting object * * RETURN: None * @@ -426,7 +425,6 @@ void *Context) { ACPI_OP_WALK_INFO *Info = Context; - const ACPI_OPCODE_INFO *OpInfo; char *Path; @@ -435,11 +433,9 @@ 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 @@ 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 @@ { /* 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 @@ { /* 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 @@ { /* 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 @@ { /* 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 @@ /* 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 @@ * 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 @@ { 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 @@ 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; Index: sys/contrib/dev/acpica/common/adfile.c =================================================================== --- sys/contrib/dev/acpica/common/adfile.c (revision 203510) +++ sys/contrib/dev/acpica/common/adfile.c (working copy) @@ -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 #include -#include #define _COMPONENT ACPI_TOOLS @@ -135,12 +134,13 @@ 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 @@ * * 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 @@ * * 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 @@ * 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 @@ char *NewString; - NewString = ACPI_ALLOCATE (strlen (String) + 1); + NewString = ACPI_ALLOCATE ((ACPI_SIZE) strlen (String) + 1); if (!NewString) { return (NULL); Index: sys/contrib/dev/acpica/common/dmrestag.c =================================================================== --- sys/contrib/dev/acpica/common/dmrestag.c (revision 203510) +++ sys/contrib/dev/acpica/common/dmrestag.c (working copy) @@ -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 @@ -387,7 +387,7 @@ static UINT32 AcpiGbl_NextResourceId = 0; static UINT8 AcpiGbl_NextPrefix = 0; -static UINT8 AcpiGbl_Prefix[ACPI_NUM_RES_PREFIX] = +static char AcpiGbl_Prefix[ACPI_NUM_RES_PREFIX] = {'Y','Z','J','K','X'}; Index: sys/contrib/dev/acpica/common/dmextern.c =================================================================== --- sys/contrib/dev/acpica/common/dmextern.c (revision 203505) +++ sys/contrib/dev/acpica/common/dmextern.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/common/dmtable.c =================================================================== --- sys/contrib/dev/acpica/common/dmtable.c (revision 203510) +++ sys/contrib/dev/acpica/common/dmtable.c (working copy) @@ -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,6 +132,7 @@ static void AcpiDmCheckAscii ( UINT8 *Target, + char *RepairedName, UINT32 Count); UINT8 @@ -156,17 +157,18 @@ "Hardware Unit Definition", "Reserved Memory Region", "Root Port ATS Capability", + "Remapping Hardware Static Affinity", "Unknown SubTable Type" /* Reserved */ }; static const char *AcpiDmHestSubnames[] = { - "XPF Machine Check Exception", - "XPF Corrected Machine Check", - "NOT USED???", - "XPF Non-Maskable Interrupt", - "IPF Corrected Machine Check", - "IPF Corrected Platform Error", + "IA-32 Machine Check Exception", + "IA-32 Corrected Machine Check", + "IA-32 Non-Maskable Interrupt", + "Unknown SubTable Type", /* 3 - Reserved */ + "Unknown SubTable Type", /* 4 - Reserved */ + "Unknown SubTable Type", /* 5 - Reserved */ "PCI Express Root Port AER", "PCI Express AER (AER Endpoint)", "PCI Express/PCI-X Bridge AER", @@ -208,7 +210,14 @@ "Unknown SubTable Type" /* Reserved */ }; +static const char *AcpiDmIvrsSubnames[] = +{ + "Hardware Definition Block", + "Memory Definition Block", + "Unknown SubTable Type" /* Reserved */ +}; + #define ACPI_FADT_PM_RESERVED 8 static const char *AcpiDmFadtProfiles[] = @@ -224,11 +233,12 @@ "Unknown Profile Type" }; - /******************************************************************************* * * ACPI Table Data, indexed by signature. * + * Each entry contains: Signature, Table Info, Handler, Description + * * Simple tables have only a TableInfo structure, complex tables have a handler. * This table must be NULL terminated. RSDP and FACS are special-cased * elsewhere. @@ -249,8 +259,10 @@ {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, "Fixed ACPI Description Table"}, {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, "Hardware Error Source Table"}, {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, "High Precision Event Timer table"}, + {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, "I/O Virtualization Reporting Structure"}, {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, "Multiple APIC Description Table"}, {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, "Memory Mapped Configuration table"}, + {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, "Maximum System Characteristics Table"}, {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, "Root System Description Table"}, {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, "Smart Battery Specification Table"}, {ACPI_SIG_SLIC, AcpiDmTableInfoSlic, NULL, "Software Licensing Description Table"}, @@ -259,6 +271,9 @@ {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, "Server Platform Management Interface table"}, {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, "System Resource Affinity Table"}, {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, "Trusted Computing Platform Alliance table"}, + {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, "UEFI Boot Optimization Table"}, + {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, "Windows ACPI Emulated Devices Table"}, + {ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, "Watchdog Action Table"}, {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, "Watchdog Resource Table"}, {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, "Extended System Description Table"}, {NULL, NULL, NULL, NULL} @@ -511,7 +526,9 @@ UINT8 Temp8; UINT16 Temp16; ACPI_DMTABLE_DATA *TableData; + const char *Name; BOOLEAN LastOutputBlankLine = FALSE; + char RepairedName[8]; if (!Info) @@ -547,6 +564,7 @@ case ACPI_DMT_UINT8: case ACPI_DMT_CHKSUM: case ACPI_DMT_SPACEID: + case ACPI_DMT_IVRS: case ACPI_DMT_MADT: case ACPI_DMT_SRAT: case ACPI_DMT_ASF: @@ -577,6 +595,9 @@ case ACPI_DMT_NAME8: ByteLength = 8; break; + case ACPI_DMT_BUF16: + ByteLength = 16; + break; case ACPI_DMT_STRING: ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1; break; @@ -677,17 +698,28 @@ ACPI_FORMAT_UINT64 (ACPI_GET64 (Target))); break; + case ACPI_DMT_BUF16: + + /* Buffer of length 16 */ + + for (Temp8 = 0; Temp8 < 16; Temp8++) + { + AcpiOsPrintf ("%2.2X,", Target[Temp8]); + } + AcpiOsPrintf ("\n"); + break; + case ACPI_DMT_STRING: - AcpiOsPrintf ("%s\n", ACPI_CAST_PTR (char, Target)); + AcpiOsPrintf ("\"%s\"\n", ACPI_CAST_PTR (char, Target)); break; /* Fixed length ASCII name fields */ case ACPI_DMT_SIG: - AcpiDmCheckAscii (Target, 4); - AcpiOsPrintf ("\"%4.4s\" ", Target); + AcpiDmCheckAscii (Target, RepairedName, 4); + AcpiOsPrintf ("\"%.4s\" ", RepairedName); TableData = AcpiDmGetTableData (ACPI_CAST_PTR (char, Target)); if (TableData) { @@ -698,20 +730,20 @@ case ACPI_DMT_NAME4: - AcpiDmCheckAscii (Target, 4); - AcpiOsPrintf ("\"%4.4s\"\n", Target); + AcpiDmCheckAscii (Target, RepairedName, 4); + AcpiOsPrintf ("\"%.4s\"\n", RepairedName); break; case ACPI_DMT_NAME6: - AcpiDmCheckAscii (Target, 6); - AcpiOsPrintf ("\"%6.6s\"\n", Target); + AcpiDmCheckAscii (Target, RepairedName, 6); + AcpiOsPrintf ("\"%.6s\"\n", RepairedName); break; case ACPI_DMT_NAME8: - AcpiDmCheckAscii (Target, 8); - AcpiOsPrintf ("\"%8.8s\"\n", Target); + AcpiDmCheckAscii (Target, RepairedName, 8); + AcpiOsPrintf ("\"%.8s\"\n", RepairedName); break; /* Special Data Types */ @@ -742,8 +774,8 @@ /* Generic Address Structure */ AcpiOsPrintf ("\n"); - AcpiDmDumpTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length, - CurrentOffset, Target, sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas); + AcpiDmDumpTable (TableLength, CurrentOffset, Target, + sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas); AcpiOsPrintf ("\n"); LastOutputBlankLine = TRUE; break; @@ -790,8 +822,8 @@ case ACPI_DMT_HESTNTFY: AcpiOsPrintf ("\n"); - AcpiDmDumpTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length, - CurrentOffset, Target, sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify); + AcpiDmDumpTable (TableLength, CurrentOffset, Target, + sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify); AcpiOsPrintf ("\n"); LastOutputBlankLine = TRUE; break; @@ -849,6 +881,31 @@ AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmFadtProfiles[Temp8]); break; + case ACPI_DMT_IVRS: + + /* IVRS subtable types */ + + Temp8 = *Target; + switch (Temp8) + { + case ACPI_IVRS_TYPE_HARDWARE: + Name = AcpiDmIvrsSubnames[0]; + break; + + case ACPI_IVRS_TYPE_MEMORY1: + case ACPI_IVRS_TYPE_MEMORY2: + case ACPI_IVRS_TYPE_MEMORY3: + Name = AcpiDmIvrsSubnames[1]; + break; + + default: + Name = AcpiDmIvrsSubnames[2]; + break; + } + + AcpiOsPrintf ("%2.2X <%s>\n", *Target, Name); + break; + case ACPI_DMT_EXIT: return (AE_OK); @@ -888,6 +945,7 @@ static void AcpiDmCheckAscii ( UINT8 *Name, + char *RepairedName, UINT32 Count) { UINT32 i; @@ -895,9 +953,15 @@ for (i = 0; i < Count; i++) { - if (!Name[i] || !isprint (Name[i])) + RepairedName[i] = (char) Name[i]; + + if (!Name[i]) { - Name[i] = ' '; + return; } + if (!isprint (Name[i])) + { + RepairedName[i] = ' '; + } } } Index: sys/contrib/dev/acpica/common/dmtbdump.c =================================================================== --- sys/contrib/dev/acpica/common/dmtbdump.c (revision 203510) +++ sys/contrib/dev/acpica/common/dmtbdump.c (working copy) @@ -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 @@ -306,6 +306,7 @@ UINT32 DataLength = 0; UINT32 DataOffset = 0; UINT32 i; + UINT8 Type; /* No main table, only sub-tables */ @@ -322,7 +323,11 @@ return; } - switch (SubTable->Header.Type & 0x7F) /* Mask off top bit */ + /* The actual type is the lower 7 bits of Type */ + + Type = (UINT8) (SubTable->Header.Type & 0x7F); + + switch (Type) { case ACPI_ASF_TYPE_INFO: InfoTable = AcpiDmTableInfoAsf0; @@ -332,8 +337,8 @@ InfoTable = AcpiDmTableInfoAsf1; DataInfoTable = AcpiDmTableInfoAsf1a; DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ALERT)); - DataCount = ((ACPI_ASF_ALERT *) SubTable)->Alerts; - DataLength = ((ACPI_ASF_ALERT *) SubTable)->DataLength; + DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->Alerts; + DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->DataLength; DataOffset = Offset + sizeof (ACPI_ASF_ALERT); break; @@ -341,8 +346,8 @@ InfoTable = AcpiDmTableInfoAsf2; DataInfoTable = AcpiDmTableInfoAsf2a; DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_REMOTE)); - DataCount = ((ACPI_ASF_REMOTE *) SubTable)->Controls; - DataLength = ((ACPI_ASF_REMOTE *) SubTable)->DataLength; + DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->Controls; + DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->DataLength; DataOffset = Offset + sizeof (ACPI_ASF_REMOTE); break; @@ -353,7 +358,7 @@ case ACPI_ASF_TYPE_ADDRESS: InfoTable = AcpiDmTableInfoAsf4; DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ADDRESS)); - DataLength = ((ACPI_ASF_ADDRESS *) SubTable)->Devices; + DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, SubTable)->Devices; DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS); break; @@ -371,7 +376,7 @@ /* Dump variable-length extra data */ - switch (SubTable->Header.Type & 0x7F) /* Mask off top bit */ + switch (Type) { case ACPI_ASF_TYPE_ALERT: case ACPI_ASF_TYPE_CONTROL: @@ -471,7 +476,7 @@ { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, AcpiDmTableInfoCpep0); + SubTable->Header.Length, AcpiDmTableInfoCpep0); if (ACPI_FAILURE (Status)) { return; @@ -479,8 +484,9 @@ /* Point to next sub-table */ - Offset += SubTable->Length; - SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable, SubTable->Length); + Offset += SubTable->Header.Length; + SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable, + SubTable->Header.Length); } } @@ -550,6 +556,10 @@ InfoTable = AcpiDmTableInfoDmar2; ScopeOffset = sizeof (ACPI_DMAR_ATSR); break; + case ACPI_DMAR_HARDWARE_AFFINITY: + InfoTable = AcpiDmTableInfoDmar3; + ScopeOffset = sizeof (ACPI_DMAR_RHSA); + break; default: AcpiOsPrintf ("\n**** Unknown DMAR sub-table type %X\n\n", SubTable->Type); return; @@ -737,6 +747,8 @@ UINT32 Offset = sizeof (ACPI_TABLE_HEST); ACPI_DMTABLE_INFO *InfoTable; UINT32 SubTableLength; + UINT32 BankCount; + ACPI_HEST_IA_ERROR_BANK *BankTable; /* Main table */ @@ -752,33 +764,28 @@ SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset); while (Offset < Table->Length) { + BankCount = 0; switch (SubTable->Type) { - case ACPI_HEST_TYPE_XPF_MACHINE_CHECK: + case ACPI_HEST_TYPE_IA32_CHECK: InfoTable = AcpiDmTableInfoHest0; - SubTableLength = sizeof (ACPI_HEST_XPF_MACHINE_CHECK); + SubTableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK); + BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK, + SubTable))->NumHardwareBanks; break; - case ACPI_HEST_TYPE_XPF_CORRECTED_MACHINE_CHECK: + case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK: InfoTable = AcpiDmTableInfoHest1; - SubTableLength = sizeof (ACPI_HEST_XPF_CORRECTED); + SubTableLength = sizeof (ACPI_HEST_IA_CORRECTED); + BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED, + SubTable))->NumHardwareBanks; break; - case ACPI_HEST_TYPE_XPF_NON_MASKABLE_INTERRUPT: - InfoTable = AcpiDmTableInfoHest3; - SubTableLength = sizeof (ACPI_HEST_XPF_NMI); + case ACPI_HEST_TYPE_IA32_NMI: + InfoTable = AcpiDmTableInfoHest2; + SubTableLength = sizeof (ACPI_HEST_IA_NMI); break; - case ACPI_HEST_TYPE_IPF_CORRECTED_MACHINE_CHECK: - InfoTable = AcpiDmTableInfoHest4; - SubTableLength = sizeof (ACPI_HEST_IPF_CORRECTED); - break; - - case ACPI_HEST_TYPE_IPF_CORRECTED_PLATFORM_ERROR: - InfoTable = AcpiDmTableInfoHest5; - SubTableLength = sizeof (ACPI_HEST_IPF_CORRECTED_PLATFORM); - break; - case ACPI_HEST_TYPE_AER_ROOT_PORT: InfoTable = AcpiDmTableInfoHest6; SubTableLength = sizeof (ACPI_HEST_AER_ROOT); @@ -794,7 +801,7 @@ SubTableLength = sizeof (ACPI_HEST_AER_BRIDGE); break; - case ACPI_HEST_TYPE_GENERIC_HARDWARE_ERROR_SOURCE: + case ACPI_HEST_TYPE_GENERIC_ERROR: InfoTable = AcpiDmTableInfoHest9; SubTableLength = sizeof (ACPI_HEST_GENERIC); break; @@ -814,9 +821,34 @@ return; } - /* Point to next sub-table (each subtable is of fixed length) */ + /* Point to end of current subtable (each subtable above is of fixed length) */ Offset += SubTableLength; + + /* If there are any (fixed-length) Error Banks from above, dump them now */ + + if (BankCount) + { + BankTable = ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK, SubTable, SubTableLength); + SubTableLength += BankCount * sizeof (ACPI_HEST_IA_ERROR_BANK); + + while (BankCount) + { + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Length, Offset, BankTable, + sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank); + if (ACPI_FAILURE (Status)) + { + return; + } + Offset += sizeof (ACPI_HEST_IA_ERROR_BANK); + BankTable++; + BankCount--; + } + } + + /* Point to next sub-table */ + SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, SubTable, SubTableLength); } } @@ -824,6 +856,179 @@ /******************************************************************************* * + * FUNCTION: AcpiDmDumpIvrs + * + * PARAMETERS: Table - A IVRS table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a IVRS + * + ******************************************************************************/ + +static UINT8 EntrySizes[] = {4,8,16,32}; + +void +AcpiDmDumpIvrs ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + UINT32 Offset = sizeof (ACPI_TABLE_IVRS); + UINT32 EntryOffset; + UINT32 EntryLength; + UINT32 EntryType; + ACPI_IVRS_DE_HEADER *DeviceEntry; + ACPI_IVRS_HEADER *SubTable; + ACPI_DMTABLE_INFO *InfoTable; + + + /* Main table */ + + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIvrs); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Sub-tables */ + + SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset); + while (Offset < Table->Length) + { + /* Common sub-table header */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, + SubTable->Length, AcpiDmTableInfoIvrsHdr); + if (ACPI_FAILURE (Status)) + { + return; + } + + switch (SubTable->Type) + { + case ACPI_IVRS_TYPE_HARDWARE: + InfoTable = AcpiDmTableInfoIvrs0; + break; + case ACPI_IVRS_TYPE_MEMORY1: + case ACPI_IVRS_TYPE_MEMORY2: + case ACPI_IVRS_TYPE_MEMORY3: + InfoTable = AcpiDmTableInfoIvrs1; + break; + default: + AcpiOsPrintf ("\n**** Unknown IVRS sub-table type %X\n", + SubTable->Type); + + /* Attempt to continue */ + + if (!SubTable->Length) + { + AcpiOsPrintf ("Invalid zero length subtable\n"); + return; + } + goto NextSubTable; + } + + /* Dump the subtable */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, + SubTable->Length, InfoTable); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* The hardware subtable can contain multiple device entries */ + + if (SubTable->Type == ACPI_IVRS_TYPE_HARDWARE) + { + EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE); + DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, SubTable, + sizeof (ACPI_IVRS_HARDWARE)); + + while (EntryOffset < (Offset + SubTable->Length)) + { + AcpiOsPrintf ("\n"); + /* + * Upper 2 bits of Type encode the length of the device entry + * + * 00 = 4 byte + * 01 = 8 byte + * 10 = 16 byte - currently no entries defined + * 11 = 32 byte - currently no entries defined + */ + EntryType = DeviceEntry->Type; + EntryLength = EntrySizes [EntryType >> 6]; + + switch (EntryType) + { + /* 4-byte device entries */ + + case ACPI_IVRS_TYPE_PAD4: + case ACPI_IVRS_TYPE_ALL: + case ACPI_IVRS_TYPE_SELECT: + case ACPI_IVRS_TYPE_START: + case ACPI_IVRS_TYPE_END: + + InfoTable = AcpiDmTableInfoIvrs4; + break; + + /* 8-byte entries, type A */ + + case ACPI_IVRS_TYPE_ALIAS_SELECT: + case ACPI_IVRS_TYPE_ALIAS_START: + + InfoTable = AcpiDmTableInfoIvrs8a; + break; + + /* 8-byte entries, type B */ + + case ACPI_IVRS_TYPE_PAD8: + case ACPI_IVRS_TYPE_EXT_SELECT: + case ACPI_IVRS_TYPE_EXT_START: + + InfoTable = AcpiDmTableInfoIvrs8b; + break; + + /* 8-byte entries, type C */ + + case ACPI_IVRS_TYPE_SPECIAL: + + InfoTable = AcpiDmTableInfoIvrs8c; + break; + + default: + InfoTable = AcpiDmTableInfoIvrs4; + AcpiOsPrintf ( + "\n**** Unknown IVRS device entry type/length: " + "%.2X/%X at offset %.4X: (header below)\n", + EntryType, EntryLength, EntryOffset); + break; + } + + /* Dump the Device Entry */ + + Status = AcpiDmDumpTable (Table->Length, EntryOffset, + DeviceEntry, EntryLength, InfoTable); + + EntryOffset += EntryLength; + DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, DeviceEntry, + EntryLength); + } + } + +NextSubTable: + /* Point to next sub-table */ + + Offset += SubTable->Length; + SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, SubTable, SubTable->Length); + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmDumpMadt * * PARAMETERS: Table - A MADT table @@ -993,6 +1198,58 @@ /******************************************************************************* * + * FUNCTION: AcpiDmDumpMsct + * + * PARAMETERS: Table - A MSCT table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a MSCT + * + ******************************************************************************/ + +void +AcpiDmDumpMsct ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + UINT32 Offset = sizeof (ACPI_TABLE_MSCT); + ACPI_MSCT_PROXIMITY *SubTable; + + + /* Main table */ + + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMsct); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Sub-tables */ + + SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset); + while (Offset < Table->Length) + { + /* Common sub-table header */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, + sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Point to next sub-table */ + + Offset += sizeof (ACPI_MSCT_PROXIMITY); + SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, SubTable, sizeof (ACPI_MSCT_PROXIMITY)); + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiDmDumpSlit * * PARAMETERS: Table - An SLIT @@ -1149,3 +1406,54 @@ } } + +/******************************************************************************* + * + * FUNCTION: AcpiDmDumpWdat + * + * PARAMETERS: Table - A WDAT table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a WDAT + * + ******************************************************************************/ + +void +AcpiDmDumpWdat ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + UINT32 Offset = sizeof (ACPI_TABLE_WDAT); + ACPI_WDAT_ENTRY *SubTable; + + + /* Main table */ + + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoWdat); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Sub-tables */ + + SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset); + while (Offset < Table->Length) + { + /* Common sub-table header */ + + AcpiOsPrintf ("\n"); + Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, + sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Point to next sub-table */ + + Offset += sizeof (ACPI_WDAT_ENTRY); + SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, SubTable, sizeof (ACPI_WDAT_ENTRY)); + } +} Index: sys/contrib/dev/acpica/parser/psargs.c =================================================================== --- sys/contrib/dev/acpica/parser/psargs.c (revision 203510) +++ sys/contrib/dev/acpica/parser/psargs.c (working copy) @@ -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 @@ /* 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; Index: sys/contrib/dev/acpica/parser/pswalk.c =================================================================== --- sys/contrib/dev/acpica/parser/pswalk.c (revision 203510) +++ sys/contrib/dev/acpica/parser/pswalk.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/parser/pstree.c =================================================================== --- sys/contrib/dev/acpica/parser/pstree.c (revision 203510) +++ sys/contrib/dev/acpica/parser/pstree.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/parser/psutils.c =================================================================== --- sys/contrib/dev/acpica/parser/psutils.c (revision 203510) +++ sys/contrib/dev/acpica/parser/psutils.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/parser/psxface.c =================================================================== --- sys/contrib/dev/acpica/parser/psxface.c (revision 203510) +++ sys/contrib/dev/acpica/parser/psxface.c (working copy) @@ -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 @@ -394,11 +394,16 @@ goto Cleanup; } + if (Info->ObjDesc->Method.Flags & AOPOBJ_MODULE_LEVEL) + { + WalkState->ParseFlags |= ACPI_PARSE_MODULE_LEVEL; + } + /* Invoke an internal method if necessary */ 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 */ @@ -417,15 +422,13 @@ 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 */ Index: sys/contrib/dev/acpica/parser/psloop.c =================================================================== --- sys/contrib/dev/acpica/parser/psloop.c (revision 203510) +++ sys/contrib/dev/acpica/parser/psloop.c (working copy) @@ -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 @@ -171,7 +171,14 @@ ACPI_PARSE_OBJECT *Op, ACPI_STATUS Status); +static void +AcpiPsLinkModuleCode ( + ACPI_PARSE_OBJECT *ParentOp, + UINT8 *AmlStart, + UINT32 AmlLength, + ACPI_OWNER_ID OwnerId); + /******************************************************************************* * * FUNCTION: AcpiPsGetAmlOpcode @@ -502,6 +509,7 @@ { ACPI_STATUS Status = AE_OK; ACPI_PARSE_OBJECT *Arg = NULL; + const ACPI_OPCODE_INFO *OpInfo; ACPI_FUNCTION_TRACE_PTR (PsGetArguments, WalkState); @@ -558,13 +566,11 @@ } - /* Special processing for certain opcodes */ - - /* TBD (remove): Temporary mechanism to disable this code if needed */ - -#ifdef ACPI_ENABLE_MODULE_LEVEL_CODE - - if ((WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS1) && + /* + * Handle executable code at "module-level". This refers to + * executable opcodes that appear outside of any control method. + */ + if ((WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS2) && ((WalkState->ParseFlags & ACPI_PARSE_DISASSEMBLE) == 0)) { /* @@ -580,6 +586,19 @@ case AML_ELSE_OP: case AML_WHILE_OP: + /* + * Currently supported module-level opcodes are: + * IF/ELSE/WHILE. These appear to be the most common, + * and easiest to support since they open an AML + * package. + */ + if (WalkState->PassNumber == ACPI_IMODE_LOAD_PASS1) + { + AcpiPsLinkModuleCode (Op->Common.Parent, AmlOpStart, + (UINT32) (WalkState->ParserState.PkgEnd - AmlOpStart), + WalkState->OwnerId); + } + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Pass1: Skipping an If/Else/While body\n")); @@ -590,11 +609,34 @@ break; default: + /* + * Check for an unsupported executable opcode at module + * level. We must be in PASS1, the parent must be a SCOPE, + * The opcode class must be EXECUTE, and the opcode must + * not be an argument to another opcode. + */ + if ((WalkState->PassNumber == ACPI_IMODE_LOAD_PASS1) && + (Op->Common.Parent->Common.AmlOpcode == AML_SCOPE_OP)) + { + OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); + if ((OpInfo->Class == AML_CLASS_EXECUTE) && + (!Arg)) + { + ACPI_WARNING ((AE_INFO, + "Detected an unsupported executable opcode " + "at module-level: [0x%.4X] at table offset 0x%.4X", + Op->Common.AmlOpcode, + (UINT32) (ACPI_PTR_DIFF (AmlOpStart, + WalkState->ParserState.AmlStart) + + sizeof (ACPI_TABLE_HEADER)))); + } + } break; } } -#endif + /* Special processing for certain opcodes */ + switch (Op->Common.AmlOpcode) { case AML_METHOD_OP: @@ -661,6 +703,97 @@ /******************************************************************************* * + * FUNCTION: AcpiPsLinkModuleCode + * + * PARAMETERS: ParentOp - Parent parser op + * AmlStart - Pointer to the AML + * AmlLength - Length of executable AML + * OwnerId - OwnerId of module level code + * + * RETURN: None. + * + * DESCRIPTION: Wrap the module-level code with a method object and link the + * object to the global list. Note, the mutex field of the method + * object is used to link multiple module-level code objects. + * + ******************************************************************************/ + +static void +AcpiPsLinkModuleCode ( + ACPI_PARSE_OBJECT *ParentOp, + UINT8 *AmlStart, + UINT32 AmlLength, + ACPI_OWNER_ID OwnerId) +{ + ACPI_OPERAND_OBJECT *Prev; + ACPI_OPERAND_OBJECT *Next; + ACPI_OPERAND_OBJECT *MethodObj; + ACPI_NAMESPACE_NODE *ParentNode; + + + /* Get the tail of the list */ + + Prev = Next = AcpiGbl_ModuleCodeList; + while (Next) + { + Prev = Next; + Next = Next->Method.Mutex; + } + + /* + * Insert the module level code into the list. Merge it if it is + * adjacent to the previous element. + */ + if (!Prev || + ((Prev->Method.AmlStart + Prev->Method.AmlLength) != AmlStart)) + { + /* Create, initialize, and link a new temporary method object */ + + MethodObj = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD); + if (!MethodObj) + { + 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; + } + else + { + Prev->Method.Mutex = MethodObj; + } + } + else + { + Prev->Method.AmlLength += AmlLength; + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiPsCompleteOp * * PARAMETERS: WalkState - Current state Index: sys/contrib/dev/acpica/parser/psopcode.c =================================================================== --- sys/contrib/dev/acpica/parser/psopcode.c (revision 203510) +++ sys/contrib/dev/acpica/parser/psopcode.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/parser/psscope.c =================================================================== --- sys/contrib/dev/acpica/parser/psscope.c (revision 203510) +++ sys/contrib/dev/acpica/parser/psscope.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/parser/psparse.c =================================================================== --- sys/contrib/dev/acpica/parser/psparse.c (revision 203510) +++ sys/contrib/dev/acpica/parser/psparse.c (working copy) @@ -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 @@ !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 */ Index: sys/contrib/dev/acpica/namespace/nswalk.c =================================================================== --- sys/contrib/dev/acpica/namespace/nswalk.c (revision 203510) +++ sys/contrib/dev/acpica/namespace/nswalk.c (working copy) @@ -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 @@ * 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 @@ 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 @@ ACPI_NAMESPACE_NODE *ParentNode; ACPI_OBJECT_TYPE ChildType; UINT32 Level; + BOOLEAN NodePreviouslyVisited = FALSE; ACPI_FUNCTION_TRACE (NsWalkNamespace); @@ -299,7 +304,7 @@ /* Null child means "get first node" */ ParentNode = StartNode; - ChildNode = NULL; + ChildNode = AcpiNsGetNextNode (ParentNode, NULL); ChildType = ACPI_TYPE_ANY; Level = 1; @@ -308,103 +313,139 @@ * 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; - Status = AE_OK; - ChildNode = AcpiNsGetNextNode (ParentNode, ChildNode); - if (ChildNode) + /* Found next child, get the type if we are not searching for ANY */ + + if (Type != ACPI_TYPE_ANY) { - /* Found next child, get the type if we are not searching for ANY */ + ChildType = ChildNode->Type; + } - if (Type != ACPI_TYPE_ANY) + /* + * 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) { - ChildType = ChildNode->Type; + MutexStatus = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (MutexStatus)) + { + return_ACPI_STATUS (MutexStatus); + } } /* - * 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. + * Invoke the user function, either pre-order or post-order + * or both. */ - if ((ChildNode->Flags & ANOBJ_TEMPORARY) && - !(Flags & ACPI_NS_WALK_TEMP_NODES)) + if (!NodePreviouslyVisited) { - Status = AE_CTRL_DEPTH; + if (PreOrderVisit) + { + Status = PreOrderVisit (ChildNode, Level, + Context, ReturnValue); + } } - - /* Type must match requested type */ - - else if (ChildType == Type) + else { - /* - * Found a matching node, invoke the user callback function. - * Unlock the namespace if flag is set. - */ - if (Flags & ACPI_NS_WALK_UNLOCK) + if (PostOrderVisit) { - MutexStatus = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); - if (ACPI_FAILURE (MutexStatus)) - { - return_ACPI_STATUS (MutexStatus); - } + Status = PostOrderVisit (ChildNode, Level, + Context, ReturnValue); } + } - Status = UserFunction (ChildNode, Level, Context, ReturnValue); - - if (Flags & ACPI_NS_WALK_UNLOCK) + if (Flags & ACPI_NS_WALK_UNLOCK) + { + MutexStatus = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (MutexStatus)) { - MutexStatus = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); - if (ACPI_FAILURE (MutexStatus)) - { - return_ACPI_STATUS (MutexStatus); - } + return_ACPI_STATUS (MutexStatus); } + } - switch (Status) - { - case AE_OK: - case AE_CTRL_DEPTH: + switch (Status) + { + case AE_OK: + case AE_CTRL_DEPTH: - /* Just keep going */ - break; + /* Just keep going */ + break; - case AE_CTRL_TERMINATE: + case AE_CTRL_TERMINATE: - /* Exit now, with OK status */ + /* Exit now, with OK status */ - return_ACPI_STATUS (AE_OK); + return_ACPI_STATUS (AE_OK); - default: + default: - /* All others are valid exceptions */ + /* All others are valid exceptions */ - return_ACPI_STATUS (Status); - } + 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)) + /* + * 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) { - if (ChildNode->Child) - { - /* There is at least one child of this node, visit it */ + /* There is at least one child of this node, visit it */ - Level++; - ParentNode = ChildNode; - ChildNode = NULL; - } + 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) + { + NodePreviouslyVisited = FALSE; + } + + /* No peers, re-visit parent */ + else { /* @@ -414,6 +455,8 @@ Level--; ChildNode = ParentNode; ParentNode = AcpiNsGetParentNode (ParentNode); + + NodePreviouslyVisited = TRUE; } } Index: sys/contrib/dev/acpica/namespace/nsdumpdv.c =================================================================== --- sys/contrib/dev/acpica/namespace/nsdumpdv.c (revision 203510) +++ sys/contrib/dev/acpica/namespace/nsdumpdv.c (working copy) @@ -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 @@ Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, SysBusHandle, ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK, - AcpiNsDumpOneDevice, NULL, NULL); + AcpiNsDumpOneDevice, NULL, NULL, NULL); } #endif Index: sys/contrib/dev/acpica/namespace/nsutils.c =================================================================== --- sys/contrib/dev/acpica/namespace/nsutils.c (revision 203510) +++ sys/contrib/dev/acpica/namespace/nsutils.c (working copy) @@ -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 @@ /******************************************************************************* * - * 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. + * 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. * - * The current implemenation is basically a placeholder until such time comes - * that it is needed. - * ******************************************************************************/ ACPI_NAMESPACE_NODE * -AcpiNsMapHandleToNode ( +AcpiNsValidateHandle ( ACPI_HANDLE Handle) { @@ -902,48 +903,6 @@ /******************************************************************************* * - * 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 * * PARAMETERS: none Index: sys/contrib/dev/acpica/namespace/nsaccess.c =================================================================== --- sys/contrib/dev/acpica/namespace/nsaccess.c (revision 203510) +++ sys/contrib/dev/acpica/namespace/nsaccess.c (working copy) @@ -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 @@ /* 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; Index: sys/contrib/dev/acpica/namespace/nsnames.c =================================================================== --- sys/contrib/dev/acpica/namespace/nsnames.c (revision 203510) +++ sys/contrib/dev/acpica/namespace/nsnames.c (working copy) @@ -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 @@ ACPI_FUNCTION_TRACE_PTR (NsHandleToPathname, TargetHandle); - Node = AcpiNsMapHandleToNode (TargetHandle); + Node = AcpiNsValidateHandle (TargetHandle); if (!Node) { return_ACPI_STATUS (AE_BAD_PARAMETER); Index: sys/contrib/dev/acpica/namespace/nsinit.c =================================================================== --- sys/contrib/dev/acpica/namespace/nsinit.c (revision 203510) +++ sys/contrib/dev/acpica/namespace/nsinit.c (working copy) @@ -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 @@ /* 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 @@ /* 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; @@ -264,10 +264,26 @@ goto ErrorExit; } + /* + * Execute the "global" _INI method that may appear at the root. This + * support is provided for Windows compatibility (Vista+) and is not + * part of the ACPI specification. + */ + Info.EvaluateInfo->PrefixNode = AcpiGbl_RootNode; + Info.EvaluateInfo->Pathname = METHOD_NAME__INI; + Info.EvaluateInfo->Parameters = NULL; + Info.EvaluateInfo->Flags = ACPI_IGNORE_RETURN_VALUE; + + Status = AcpiNsEvaluate (Info.EvaluateInfo); + if (ACPI_SUCCESS (Status)) + { + Info.Num_INI++; + } + /* 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)) Index: sys/contrib/dev/acpica/namespace/nsrepair2.c =================================================================== --- sys/contrib/dev/acpica/namespace/nsrepair2.c (revision 203505) +++ sys/contrib/dev/acpica/namespace/nsrepair2.c (working copy) @@ -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 @@ -153,6 +153,11 @@ 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); @@ -171,11 +176,7 @@ UINT8 SortDirection, char *SortKeyName); -static ACPI_STATUS -AcpiNsRemoveNullElements ( - ACPI_OPERAND_OBJECT *Package); - -static ACPI_STATUS +static void AcpiNsSortList ( ACPI_OPERAND_OBJECT **Elements, UINT32 Count, @@ -192,19 +193,30 @@ * This table contains the names of the predefined methods for which we can * perform more complex repairs. * - * _ALR: Sort the list ascending by AmbientIlluminance if necessary - * _PSS: Sort the list descending by Power if necessary - * _TSS: Sort the list descending by Power if necessary + * 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 */ + {{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 @@ -215,7 +227,7 @@ * 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 + * 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 @@ -315,6 +327,99 @@ /****************************************************************************** * + * 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 @@ -451,9 +556,11 @@ ACPI_OPERAND_OBJECT *ObjDesc; UINT32 i; UINT32 PreviousValue; - ACPI_STATUS Status; + ACPI_FUNCTION_NAME (NsCheckSortedList); + + /* The top-level object must be a package */ if (ReturnObject->Common.Type != ACPI_TYPE_PACKAGE) @@ -462,26 +569,10 @@ } /* - * Detect any NULL package elements and remove them from the - * package. - * - * TBD: We may want to do this for all predefined names that - * return a variable-length package of packages. + * NOTE: assumes list of sub-packages contains no NULL elements. + * Any NULL elements should have been removed by earlier call + * to AcpiNsRemoveNullElements. */ - Status = AcpiNsRemoveNullElements (ReturnObject); - if (Status == AE_NULL_ENTRY) - { - ACPI_INFO_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "NULL elements removed from package")); - - /* Exit if package is now zero length */ - - if (!ReturnObject->Package.Count) - { - return (AE_NULL_ENTRY); - } - } - OuterElements = ReturnObject->Package.Elements; OuterElementCount = ReturnObject->Package.Count; if (!OuterElementCount) @@ -523,24 +614,21 @@ /* * The list must be sorted in the specified order. If we detect a - * discrepancy, issue a warning and sort the entire list + * discrepancy, sort the entire list. */ if (((SortDirection == ACPI_SORT_ASCENDING) && (ObjDesc->Integer.Value < PreviousValue)) || ((SortDirection == ACPI_SORT_DESCENDING) && (ObjDesc->Integer.Value > PreviousValue))) { - Status = AcpiNsSortList (ReturnObject->Package.Elements, - OuterElementCount, SortIndex, SortDirection); - if (ACPI_FAILURE (Status)) - { - return (Status); - } + AcpiNsSortList (ReturnObject->Package.Elements, + OuterElementCount, SortIndex, SortDirection); Data->Flags |= ACPI_OBJECT_REPAIRED; - ACPI_INFO_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Repaired unsorted list - now sorted by %s", SortKeyName)); + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Repaired unsorted list - now sorted by %s\n", + Data->Pathname, SortKeyName)); return (AE_OK); } @@ -554,66 +642,6 @@ /****************************************************************************** * - * FUNCTION: AcpiNsRemoveNullElements - * - * PARAMETERS: ObjDesc - A Package object - * - * RETURN: Status. AE_NULL_ENTRY means that one or more elements were - * removed. - * - * DESCRIPTION: Remove all NULL package elements and update the package count. - * - *****************************************************************************/ - -static ACPI_STATUS -AcpiNsRemoveNullElements ( - ACPI_OPERAND_OBJECT *ObjDesc) -{ - ACPI_OPERAND_OBJECT **Source; - ACPI_OPERAND_OBJECT **Dest; - ACPI_STATUS Status = AE_OK; - UINT32 Count; - UINT32 NewCount; - UINT32 i; - - - Count = ObjDesc->Package.Count; - NewCount = Count; - - Source = ObjDesc->Package.Elements; - Dest = Source; - - /* Examine all elements of the package object */ - - for (i = 0; i < Count; i++) - { - if (!*Source) - { - Status = AE_NULL_ENTRY; - NewCount--; - } - else - { - *Dest = *Source; - Dest++; - } - Source++; - } - - if (Status == AE_NULL_ENTRY) - { - /* NULL terminate list and update the package count */ - - *Dest = NULL; - ObjDesc->Package.Count = NewCount; - } - - return (Status); -} - - -/****************************************************************************** - * * FUNCTION: AcpiNsSortList * * PARAMETERS: Elements - Package object element list @@ -621,15 +649,16 @@ * Index - Sort by which package element * SortDirection - Ascending or Descending sort * - * RETURN: Status + * 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. + * 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 ACPI_STATUS +static void AcpiNsSortList ( ACPI_OPERAND_OBJECT **Elements, UINT32 Count, @@ -664,6 +693,4 @@ } } } - - return (AE_OK); } Index: sys/contrib/dev/acpica/namespace/nssearch.c =================================================================== --- sys/contrib/dev/acpica/namespace/nssearch.c (revision 203510) +++ sys/contrib/dev/acpica/namespace/nssearch.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/namespace/nspredef.c =================================================================== --- sys/contrib/dev/acpica/namespace/nspredef.c (revision 203510) +++ sys/contrib/dev/acpica/namespace/nspredef.c (working copy) @@ -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 @@ -113,7 +113,7 @@ * *****************************************************************************/ -#define __NSPREDEF_C__ +#define ACPI_CREATE_PREDEFINED_TABLE #include #include @@ -146,17 +146,24 @@ * ******************************************************************************/ + /* Local prototypes */ static ACPI_STATUS AcpiNsCheckPackage ( - char *Pathname, - ACPI_OPERAND_OBJECT **ReturnObjectPtr, - const ACPI_PREDEFINED_INFO *Predefined); + ACPI_PREDEFINED_DATA *Data, + ACPI_OPERAND_OBJECT **ReturnObjectPtr); static ACPI_STATUS +AcpiNsCheckPackageList ( + ACPI_PREDEFINED_DATA *Data, + const ACPI_PREDEFINED_INFO *Package, + ACPI_OPERAND_OBJECT **Elements, + UINT32 Count); + +static ACPI_STATUS AcpiNsCheckPackageElements ( - char *Pathname, + ACPI_PREDEFINED_DATA *Data, ACPI_OPERAND_OBJECT **Elements, UINT8 Type1, UINT32 Count1, @@ -166,21 +173,20 @@ static ACPI_STATUS AcpiNsCheckObjectType ( - char *Pathname, + ACPI_PREDEFINED_DATA *Data, ACPI_OPERAND_OBJECT **ReturnObjectPtr, UINT32 ExpectedBtypes, UINT32 PackageIndex); static ACPI_STATUS AcpiNsCheckReference ( - char *Pathname, + ACPI_PREDEFINED_DATA *Data, ACPI_OPERAND_OBJECT *ReturnObject); -static ACPI_STATUS -AcpiNsRepairObject ( - UINT32 ExpectedBtypes, - UINT32 PackageIndex, - ACPI_OPERAND_OBJECT **ReturnObjectPtr); +static void +AcpiNsGetExpectedTypes ( + char *Buffer, + UINT32 ExpectedBtypes); /* * Names for the types that can be returned by the predefined objects. @@ -195,14 +201,14 @@ "/Reference", }; -#define ACPI_NOT_PACKAGE ACPI_UINT32_MAX - /******************************************************************************* * * FUNCTION: AcpiNsCheckPredefinedNames * * PARAMETERS: Node - Namespace node for the method/object + * UserParamCount - Number of parameters actually passed + * ReturnStatus - Status from the object evaluation * ReturnObjectPtr - Pointer to the object returned from the * evaluation of a method or object * @@ -223,13 +229,14 @@ ACPI_STATUS Status = AE_OK; const ACPI_PREDEFINED_INFO *Predefined; char *Pathname; + ACPI_PREDEFINED_DATA *Data; /* Match the name for this method/object against the predefined list */ Predefined = AcpiNsCheckForPredefinedName (Node); - /* Get the full pathname to the object, for use in error messages */ + /* Get the full pathname to the object, for use in warning messages */ Pathname = AcpiNsGetExternalPathname (Node); if (!Pathname) @@ -248,30 +255,18 @@ if (!Predefined) { - goto Exit; + goto Cleanup; } - /* If the method failed, we cannot validate the return object */ - - if ((ReturnStatus != AE_OK) && (ReturnStatus != AE_CTRL_RETURN_VALUE)) - { - goto Exit; - } - /* - * Only validate the return value on the first successful evaluation of - * the method. This ensures that any warnings will only be emitted during - * the very first evaluation of the method/object. + * If the method failed or did not actually return an object, we cannot + * validate the return object */ - if (Node->Flags & ANOBJ_EVALUATED) + if ((ReturnStatus != AE_OK) && (ReturnStatus != AE_CTRL_RETURN_VALUE)) { - goto Exit; + goto Cleanup; } - /* Mark the node as having been successfully evaluated */ - - Node->Flags |= ANOBJ_EVALUATED; - /* * If there is no return value, check if we require a return value for * this predefined name. Either one return value is expected, or none, @@ -284,45 +279,87 @@ if ((Predefined->Info.ExpectedBtypes) && (!(Predefined->Info.ExpectedBtypes & ACPI_RTYPE_NONE))) { - ACPI_ERROR ((AE_INFO, - "%s: Missing expected return value", Pathname)); + ACPI_WARN_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, + "Missing expected return value")); Status = AE_AML_NO_RETURN_VALUE; } - goto Exit; + goto Cleanup; } /* - * We have a return value, but if one wasn't expected, just exit, this is - * not a problem + * 1) We have a return value, but if one wasn't expected, just exit, this is + * not a problem. For example, if the "Implicit Return" feature is + * enabled, methods will always return a value. * - * For example, if the "Implicit Return" feature is enabled, methods will - * always return a value + * 2) If the return value can be of any type, then we cannot perform any + * validation, exit. */ - if (!Predefined->Info.ExpectedBtypes) + if ((!Predefined->Info.ExpectedBtypes) || + (Predefined->Info.ExpectedBtypes == ACPI_RTYPE_ALL)) { - goto Exit; + goto Cleanup; } + /* Create the parameter data block for object validation */ + + Data = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PREDEFINED_DATA)); + if (!Data) + { + goto Cleanup; + } + Data->Predefined = Predefined; + Data->NodeFlags = Node->Flags; + 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 (Pathname, ReturnObjectPtr, - Predefined->Info.ExpectedBtypes, ACPI_NOT_PACKAGE); + Status = AcpiNsCheckObjectType (Data, ReturnObjectPtr, + Predefined->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT); if (ACPI_FAILURE (Status)) { goto Exit; } - /* For returned Package objects, check the type of all sub-objects */ + /* + * 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; + } + } - if (ReturnObject->Common.Type == ACPI_TYPE_PACKAGE) + /* + * 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); + +Exit: + /* + * If the object validation failed or if we successfully repaired one + * or more objects, mark the parent node to suppress further warning + * messages during the next evaluation of the same method/object. + */ + if (ACPI_FAILURE (Status) || (Data->Flags & ACPI_OBJECT_REPAIRED)) { - Status = AcpiNsCheckPackage (Pathname, ReturnObjectPtr, Predefined); + Node->Flags |= ANOBJ_EVALUATED; } + ACPI_FREE (Data); -Exit: +Cleanup: ACPI_FREE (Pathname); return (Status); } @@ -365,11 +402,11 @@ ParamCount = Node->Object->Method.ParamCount; } - /* Argument count check for non-predefined methods/objects */ - if (!Predefined) { /* + * Check the parameter count for non-predefined methods/objects. + * * Warning if too few or too many arguments have been passed by the * caller. An incorrect number of arguments may not cause the method * to fail. However, the method will fail if there are too few @@ -377,58 +414,49 @@ */ if (UserParamCount < ParamCount) { - ACPI_WARNING ((AE_INFO, - "%s: Insufficient arguments - needs %d, found %d", - Pathname, ParamCount, UserParamCount)); + ACPI_WARN_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, + "Insufficient arguments - needs %u, found %u", + ParamCount, UserParamCount)); } else if (UserParamCount > ParamCount) { - ACPI_WARNING ((AE_INFO, - "%s: Excess arguments - needs %d, found %d", - Pathname, ParamCount, UserParamCount)); + ACPI_WARN_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, + "Excess arguments - needs %u, found %u", + ParamCount, UserParamCount)); } return; } - /* Allow two different legal argument counts (_SCP, etc.) */ - + /* + * Validate the user-supplied parameter count. + * Allow two different legal argument counts (_SCP, etc.) + */ RequiredParamsCurrent = Predefined->Info.ParamCount & 0x0F; RequiredParamsOld = Predefined->Info.ParamCount >> 4; if (UserParamCount != ACPI_UINT32_MAX) { - /* Validate the user-supplied parameter count */ - if ((UserParamCount != RequiredParamsCurrent) && (UserParamCount != RequiredParamsOld)) { - ACPI_WARNING ((AE_INFO, - "%s: Parameter count mismatch - " - "caller passed %d, ACPI requires %d", - Pathname, UserParamCount, RequiredParamsCurrent)); + ACPI_WARN_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, + "Parameter count mismatch - " + "caller passed %u, ACPI requires %u", + UserParamCount, RequiredParamsCurrent)); } } /* - * Only validate the argument count on the first successful evaluation of - * the method. This ensures that any warnings will only be emitted during - * the very first evaluation of the method/object. - */ - if (Node->Flags & ANOBJ_EVALUATED) - { - return; - } - - /* * Check that the ASL-defined parameter count is what is expected for - * this predefined name. + * this predefined name (parameter count as defined by the ACPI + * specification) */ if ((ParamCount != RequiredParamsCurrent) && (ParamCount != RequiredParamsOld)) { - ACPI_WARNING ((AE_INFO, - "%s: Parameter count mismatch - ASL declared %d, ACPI requires %d", - Pathname, ParamCount, RequiredParamsCurrent)); + ACPI_WARN_PREDEFINED ((AE_INFO, Pathname, Node->Flags, + "Parameter count mismatch - ASL declared %u, ACPI requires %u", + ParamCount, RequiredParamsCurrent)); } } @@ -466,8 +494,6 @@ { if (ACPI_COMPARE_NAME (Node->Name.Ascii, ThisName->Info.Name)) { - /* Return pointer to this table entry */ - return (ThisName); } @@ -483,7 +509,7 @@ ThisName++; } - return (NULL); + return (NULL); /* Not found */ } @@ -491,10 +517,9 @@ * * FUNCTION: AcpiNsCheckPackage * - * PARAMETERS: Pathname - Full pathname to the node (for error msgs) + * PARAMETERS: Data - Pointer to validation data structure * ReturnObjectPtr - Pointer to the object returned from the * evaluation of a method or object - * Predefined - Pointer to entry in predefined name table * * RETURN: Status * @@ -505,20 +530,16 @@ static ACPI_STATUS AcpiNsCheckPackage ( - char *Pathname, - ACPI_OPERAND_OBJECT **ReturnObjectPtr, - const ACPI_PREDEFINED_INFO *Predefined) + ACPI_PREDEFINED_DATA *Data, + ACPI_OPERAND_OBJECT **ReturnObjectPtr) { ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; const ACPI_PREDEFINED_INFO *Package; - ACPI_OPERAND_OBJECT *SubPackage; ACPI_OPERAND_OBJECT **Elements; - ACPI_OPERAND_OBJECT **SubElements; - ACPI_STATUS Status; + ACPI_STATUS Status = AE_OK; UINT32 ExpectedCount; UINT32 Count; UINT32 i; - UINT32 j; ACPI_FUNCTION_NAME (NsCheckPackage); @@ -526,12 +547,18 @@ /* The package info for this name is in the next table entry */ - Package = Predefined + 1; + Package = Data->Predefined + 1; ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%s Validating return Package of Type %X, Count %X\n", - Pathname, Package->RetInfo.Type, ReturnObject->Package.Count)); + 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; @@ -541,8 +568,8 @@ if (!Count) { - ACPI_WARNING ((AE_INFO, - "%s: Return Package has no elements (empty)", Pathname)); + ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, + "Return Package has no elements (empty)")); return (AE_AML_OPERAND_VALUE); } @@ -570,20 +597,17 @@ } else if (Count > ExpectedCount) { - ACPI_WARNING ((AE_INFO, + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, "%s: Return Package is larger than needed - " - "found %u, expected %u", Pathname, Count, ExpectedCount)); + "found %u, expected %u\n", + Data->Pathname, Count, ExpectedCount)); } /* Validate all elements of the returned package */ - Status = AcpiNsCheckPackageElements (Pathname, Elements, + Status = AcpiNsCheckPackageElements (Data, Elements, Package->RetInfo.ObjectType1, Package->RetInfo.Count1, Package->RetInfo.ObjectType2, Package->RetInfo.Count2, 0); - if (ACPI_FAILURE (Status)) - { - return (Status); - } break; @@ -595,7 +619,7 @@ */ for (i = 0; i < Count; i++) { - Status = AcpiNsCheckObjectType (Pathname, Elements, + Status = AcpiNsCheckObjectType (Data, Elements, Package->RetInfo.ObjectType1, i); if (ACPI_FAILURE (Status)) { @@ -629,7 +653,7 @@ { /* These are the required package elements (0, 1, or 2) */ - Status = AcpiNsCheckObjectType (Pathname, Elements, + Status = AcpiNsCheckObjectType (Data, Elements, Package->RetInfo3.ObjectType[i], i); if (ACPI_FAILURE (Status)) { @@ -640,7 +664,7 @@ { /* These are the optional package elements */ - Status = AcpiNsCheckObjectType (Pathname, Elements, + Status = AcpiNsCheckObjectType (Data, Elements, Package->RetInfo3.TailObjectType, i); if (ACPI_FAILURE (Status)) { @@ -652,11 +676,31 @@ break; + case ACPI_PTYPE2_REV_FIXED: + + /* First element is the (Integer) revision */ + + Status = AcpiNsCheckObjectType (Data, Elements, + ACPI_RTYPE_INTEGER, 0); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + Elements++; + Count--; + + /* Examine the sub-packages */ + + Status = AcpiNsCheckPackageList (Data, Package, Elements, Count); + break; + + case ACPI_PTYPE2_PKG_COUNT: /* First element is the (Integer) count of sub-packages to follow */ - Status = AcpiNsCheckObjectType (Pathname, Elements, + Status = AcpiNsCheckObjectType (Data, Elements, ACPI_RTYPE_INTEGER, 0); if (ACPI_FAILURE (Status)) { @@ -676,9 +720,10 @@ Count = ExpectedCount; Elements++; - /* Now we can walk the sub-packages */ + /* Examine the sub-packages */ - /*lint -fallthrough */ + Status = AcpiNsCheckPackageList (Data, Package, Elements, Count); + break; case ACPI_PTYPE2: @@ -687,147 +732,249 @@ case ACPI_PTYPE2_COUNT: /* - * These types all return a single package that consists of a variable - * number of sub-packages + * These types all return a single Package that consists of a + * variable number of sub-Packages. + * + * First, ensure that the first element is a sub-Package. If not, + * the BIOS may have incorrectly returned the object as a single + * package instead of a Package of Packages (a common error if + * there is only one entry). We may be able to repair this by + * wrapping the returned Package with a new outer Package. */ - for (i = 0; i < Count; i++) + if (*Elements && ((*Elements)->Common.Type != ACPI_TYPE_PACKAGE)) { - SubPackage = *Elements; - SubElements = SubPackage->Package.Elements; + /* Create the new outer package and populate it */ - /* Each sub-object must be of type Package */ - - Status = AcpiNsCheckObjectType (Pathname, &SubPackage, - ACPI_RTYPE_PACKAGE, i); + Status = AcpiNsRepairPackageList (Data, ReturnObjectPtr); if (ACPI_FAILURE (Status)) { return (Status); } - /* Examine the different types of sub-packages */ + /* Update locals to point to the new package (of 1 element) */ - switch (Package->RetInfo.Type) - { - case ACPI_PTYPE2: - case ACPI_PTYPE2_PKG_COUNT: + ReturnObject = *ReturnObjectPtr; + Elements = ReturnObject->Package.Elements; + Count = 1; + } - /* Each subpackage has a fixed number of elements */ + /* Examine the sub-packages */ - ExpectedCount = - Package->RetInfo.Count1 + Package->RetInfo.Count2; - if (SubPackage->Package.Count != ExpectedCount) - { - Count = SubPackage->Package.Count; - goto PackageTooSmall; - } + Status = AcpiNsCheckPackageList (Data, Package, Elements, Count); + break; - Status = AcpiNsCheckPackageElements (Pathname, SubElements, - Package->RetInfo.ObjectType1, - Package->RetInfo.Count1, - Package->RetInfo.ObjectType2, - Package->RetInfo.Count2, 0); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - break; - case ACPI_PTYPE2_FIXED: + default: - /* Each sub-package has a fixed length */ + /* Should not get here if predefined info table is correct */ - ExpectedCount = Package->RetInfo2.Count; - if (SubPackage->Package.Count < ExpectedCount) - { - Count = SubPackage->Package.Count; - goto PackageTooSmall; - } + ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, + "Invalid internal return type in table entry: %X", + Package->RetInfo.Type)); - /* Check the type of each sub-package element */ + return (AE_AML_INTERNAL); + } - for (j = 0; j < ExpectedCount; j++) - { - Status = AcpiNsCheckObjectType (Pathname, &SubElements[j], - Package->RetInfo2.ObjectType[j], j); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - } - break; + return (Status); - case ACPI_PTYPE2_MIN: - /* Each sub-package has a variable but minimum length */ +PackageTooSmall: - ExpectedCount = Package->RetInfo.Count1; - if (SubPackage->Package.Count < ExpectedCount) - { - Count = SubPackage->Package.Count; - goto PackageTooSmall; - } + /* Error exit for the case with an incorrect package count */ - /* Check the type of each sub-package element */ + ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, + "Return Package is too small - found %u elements, expected %u", + Count, ExpectedCount)); - Status = AcpiNsCheckPackageElements (Pathname, SubElements, - Package->RetInfo.ObjectType1, - SubPackage->Package.Count, 0, 0, 0); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - break; + return (AE_AML_OPERAND_VALUE); +} - case ACPI_PTYPE2_COUNT: - /* First element is the (Integer) count of elements to follow */ +/******************************************************************************* + * + * FUNCTION: AcpiNsCheckPackageList + * + * PARAMETERS: Data - Pointer to validation data structure + * Package - Pointer to package-specific info for method + * Elements - Element list of parent package. All elements + * of this list should be of type Package. + * Count - Count of subpackages + * + * RETURN: Status + * + * DESCRIPTION: Examine a list of subpackages + * + ******************************************************************************/ - Status = AcpiNsCheckObjectType (Pathname, SubElements, - ACPI_RTYPE_INTEGER, 0); - if (ACPI_FAILURE (Status)) - { - return (Status); - } +static ACPI_STATUS +AcpiNsCheckPackageList ( + ACPI_PREDEFINED_DATA *Data, + const ACPI_PREDEFINED_INFO *Package, + ACPI_OPERAND_OBJECT **Elements, + UINT32 Count) +{ + ACPI_OPERAND_OBJECT *SubPackage; + ACPI_OPERAND_OBJECT **SubElements; + ACPI_STATUS Status; + UINT32 ExpectedCount; + UINT32 i; + UINT32 j; - /* Make sure package is large enough for the Count */ - ExpectedCount = (UINT32) (*SubElements)->Integer.Value; - if (SubPackage->Package.Count < ExpectedCount) - { - Count = SubPackage->Package.Count; - goto PackageTooSmall; - } + /* + * 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; - /* Check the type of each sub-package element */ + /* Each sub-object must be of type Package */ - Status = AcpiNsCheckPackageElements (Pathname, - (SubElements + 1), - Package->RetInfo.ObjectType1, - (ExpectedCount - 1), 0, 0, 1); + Status = AcpiNsCheckObjectType (Data, &SubPackage, + ACPI_RTYPE_PACKAGE, i); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Examine the different types of expected sub-packages */ + + Data->ParentPackage = SubPackage; + switch (Package->RetInfo.Type) + { + case ACPI_PTYPE2: + case ACPI_PTYPE2_PKG_COUNT: + case ACPI_PTYPE2_REV_FIXED: + + /* Each subpackage has a fixed number of elements */ + + ExpectedCount = Package->RetInfo.Count1 + Package->RetInfo.Count2; + if (SubPackage->Package.Count < ExpectedCount) + { + goto PackageTooSmall; + } + + Status = AcpiNsCheckPackageElements (Data, SubElements, + Package->RetInfo.ObjectType1, + Package->RetInfo.Count1, + Package->RetInfo.ObjectType2, + Package->RetInfo.Count2, 0); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + break; + + + case ACPI_PTYPE2_FIXED: + + /* Each sub-package has a fixed length */ + + ExpectedCount = Package->RetInfo2.Count; + if (SubPackage->Package.Count < ExpectedCount) + { + goto PackageTooSmall; + } + + /* Check the type of each sub-package element */ + + for (j = 0; j < ExpectedCount; j++) + { + Status = AcpiNsCheckObjectType (Data, &SubElements[j], + Package->RetInfo2.ObjectType[j], j); if (ACPI_FAILURE (Status)) { return (Status); } - break; + } + break; - default: - break; + + case ACPI_PTYPE2_MIN: + + /* Each sub-package has a variable but minimum length */ + + ExpectedCount = Package->RetInfo.Count1; + if (SubPackage->Package.Count < ExpectedCount) + { + goto PackageTooSmall; } - Elements++; - } - break; + /* Check the type of each sub-package element */ + Status = AcpiNsCheckPackageElements (Data, SubElements, + Package->RetInfo.ObjectType1, + SubPackage->Package.Count, 0, 0, 0); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + break; - default: - /* Should not get here if predefined info table is correct */ + case ACPI_PTYPE2_COUNT: - ACPI_WARNING ((AE_INFO, - "%s: Invalid internal return type in table entry: %X", - Pathname, Package->RetInfo.Type)); + /* + * First element is the (Integer) count of elements, including + * the count field (the ACPI name is NumElements) + */ + Status = AcpiNsCheckObjectType (Data, SubElements, + ACPI_RTYPE_INTEGER, 0); + if (ACPI_FAILURE (Status)) + { + return (Status); + } - return (AE_AML_INTERNAL); + /* + * Make sure package is large enough for the Count and is + * is as large as the minimum size + */ + ExpectedCount = (UINT32) (*SubElements)->Integer.Value; + if (SubPackage->Package.Count < ExpectedCount) + { + goto PackageTooSmall; + } + if (SubPackage->Package.Count < Package->RetInfo.Count1) + { + 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 */ + + Status = AcpiNsCheckPackageElements (Data, (SubElements + 1), + Package->RetInfo.ObjectType1, + (ExpectedCount - 1), 0, 0, 1); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + break; + + + default: /* Should not get here, type was validated by caller */ + + return (AE_AML_INTERNAL); + } + + Elements++; } return (AE_OK); @@ -835,10 +982,11 @@ PackageTooSmall: - /* Error exit for the case with an incorrect package count */ + /* The sub-package count was smaller than required */ - ACPI_WARNING ((AE_INFO, "%s: Return Package is too small - " - "found %u, expected %u", Pathname, Count, ExpectedCount)); + ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, + "Return Sub-Package[%u] is too small - found %u elements, expected %u", + i, SubPackage->Package.Count, ExpectedCount)); return (AE_AML_OPERAND_VALUE); } @@ -848,7 +996,7 @@ * * FUNCTION: AcpiNsCheckPackageElements * - * PARAMETERS: Pathname - Full pathname to the node (for error msgs) + * PARAMETERS: Data - Pointer to validation data structure * Elements - Pointer to the package elements array * Type1 - Object type for first group * Count1 - Count for first group @@ -865,7 +1013,7 @@ static ACPI_STATUS AcpiNsCheckPackageElements ( - char *Pathname, + ACPI_PREDEFINED_DATA *Data, ACPI_OPERAND_OBJECT **Elements, UINT8 Type1, UINT32 Count1, @@ -885,7 +1033,7 @@ */ for (i = 0; i < Count1; i++) { - Status = AcpiNsCheckObjectType (Pathname, ThisElement, + Status = AcpiNsCheckObjectType (Data, ThisElement, Type1, i + StartIndex); if (ACPI_FAILURE (Status)) { @@ -896,7 +1044,7 @@ for (i = 0; i < Count2; i++) { - Status = AcpiNsCheckObjectType (Pathname, ThisElement, + Status = AcpiNsCheckObjectType (Data, ThisElement, Type2, (i + Count1 + StartIndex)); if (ACPI_FAILURE (Status)) { @@ -913,12 +1061,13 @@ * * FUNCTION: AcpiNsCheckObjectType * - * PARAMETERS: Pathname - Full pathname to the node (for error msgs) + * PARAMETERS: Data - Pointer to validation data structure * ReturnObjectPtr - Pointer to the object returned from the * evaluation of a method or object * ExpectedBtypes - Bitmap of expected return type(s) * PackageIndex - Index of object within parent package (if - * applicable - ACPI_NOT_PACKAGE otherwise) + * applicable - ACPI_NOT_PACKAGE_ELEMENT + * otherwise) * * RETURN: Status * @@ -929,7 +1078,7 @@ static ACPI_STATUS AcpiNsCheckObjectType ( - char *Pathname, + ACPI_PREDEFINED_DATA *Data, ACPI_OPERAND_OBJECT **ReturnObjectPtr, UINT32 ExpectedBtypes, UINT32 PackageIndex) @@ -938,17 +1087,22 @@ ACPI_STATUS Status = AE_OK; UINT32 ReturnBtype; char TypeBuffer[48]; /* Room for 5 types */ - UINT32 ThisRtype; - UINT32 i; - UINT32 j; /* - * 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; } @@ -956,9 +1110,9 @@ if (ACPI_GET_DESCRIPTOR_TYPE (ReturnObject) == ACPI_DESC_TYPE_NAMED) { - ACPI_WARNING ((AE_INFO, - "%s: Invalid return type - Found a Namespace node [%4.4s] type %s", - Pathname, ReturnObject->Node.Name.Ascii, + ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, + "Invalid return type - Found a Namespace node [%4.4s] type %s", + ReturnObject->Node.Name.Ascii, AcpiUtGetTypeName (ReturnObject->Node.Type))); return (AE_AML_OPERAND_TYPE); } @@ -1001,60 +1155,45 @@ /* 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 (ExpectedBtypes, PackageIndex, - ReturnObjectPtr); - if (ACPI_SUCCESS (Status)) + if (ReturnObject->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) { - return (Status); + 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 (Pathname, ReturnObject); + return (AE_OK); /* Repair was successful */ } - return (Status); - TypeErrorExit: /* Create a string with all expected types for this predefined object */ - j = 1; - TypeBuffer[0] = 0; - ThisRtype = ACPI_RTYPE_INTEGER; + AcpiNsGetExpectedTypes (TypeBuffer, ExpectedBtypes); - for (i = 0; i < ACPI_NUM_RTYPES; i++) + if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT) { - /* If one of the expected types, concatenate the name of this type */ - - if (ExpectedBtypes & ThisRtype) - { - ACPI_STRCAT (TypeBuffer, &AcpiRtypeNames[i][j]); - j = 0; /* Use name separator from now on */ - } - ThisRtype <<= 1; /* Next Rtype */ + ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, + "Return type mismatch - found %s, expected %s", + AcpiUtGetObjectTypeName (ReturnObject), TypeBuffer)); } - - if (PackageIndex == ACPI_NOT_PACKAGE) - { - ACPI_WARNING ((AE_INFO, - "%s: Return type mismatch - found %s, expected %s", - Pathname, AcpiUtGetObjectTypeName (ReturnObject), TypeBuffer)); - } else { - ACPI_WARNING ((AE_INFO, - "%s: Return Package type mismatch at index %u - " - "found %s, expected %s", Pathname, PackageIndex, + ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, + "Return Package type mismatch at index %u - " + "found %s, expected %s", PackageIndex, AcpiUtGetObjectTypeName (ReturnObject), TypeBuffer)); } @@ -1066,7 +1205,7 @@ * * FUNCTION: AcpiNsCheckReference * - * PARAMETERS: Pathname - Full pathname to the node (for error msgs) + * PARAMETERS: Data - Pointer to validation data structure * ReturnObject - Object returned from the evaluation of a * method or object * @@ -1080,7 +1219,7 @@ static ACPI_STATUS AcpiNsCheckReference ( - char *Pathname, + ACPI_PREDEFINED_DATA *Data, ACPI_OPERAND_OBJECT *ReturnObject) { @@ -1094,10 +1233,9 @@ return (AE_OK); } - ACPI_WARNING ((AE_INFO, - "%s: Return type mismatch - " - "unexpected reference object type [%s] %2.2X", - Pathname, AcpiUtGetReferenceName (ReturnObject), + ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, + "Return type mismatch - unexpected reference object type [%s] %2.2X", + AcpiUtGetReferenceName (ReturnObject), ReturnObject->Reference.Class)); return (AE_AML_OPERAND_TYPE); @@ -1106,91 +1244,41 @@ /******************************************************************************* * - * FUNCTION: AcpiNsRepairObject + * FUNCTION: AcpiNsGetExpectedTypes * - * PARAMETERS: Pathname - Full pathname to the node (for error msgs) - * PackageIndex - Used to determine if target is in a package - * ReturnObjectPtr - Pointer to the object returned from the - * evaluation of a method or object + * PARAMETERS: Buffer - Pointer to where the string is returned + * ExpectedBtypes - Bitmap of expected return type(s) * - * RETURN: Status. AE_OK if repair was successful. + * RETURN: Buffer is populated with type names. * - * DESCRIPTION: Attempt to repair/convert a return object of a type that was - * not expected. + * DESCRIPTION: Translate the expected types bitmap into a string of ascii + * names of expected types, for use in warning messages. * ******************************************************************************/ -static ACPI_STATUS -AcpiNsRepairObject ( - UINT32 ExpectedBtypes, - UINT32 PackageIndex, - ACPI_OPERAND_OBJECT **ReturnObjectPtr) +static void +AcpiNsGetExpectedTypes ( + char *Buffer, + UINT32 ExpectedBtypes) { - ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; - ACPI_OPERAND_OBJECT *NewObject; - ACPI_SIZE Length; + UINT32 ThisRtype; + UINT32 i; + UINT32 j; - switch (ReturnObject->Common.Type) + j = 1; + Buffer[0] = 0; + ThisRtype = ACPI_RTYPE_INTEGER; + + for (i = 0; i < ACPI_NUM_RTYPES; i++) { - case ACPI_TYPE_BUFFER: + /* If one of the expected types, concatenate the name of this type */ - if (!(ExpectedBtypes & ACPI_RTYPE_STRING)) + if (ExpectedBtypes & ThisRtype) { - return (AE_AML_OPERAND_TYPE); + ACPI_STRCAT (Buffer, &AcpiRtypeNames[i][j]); + j = 0; /* Use name separator from now on */ } - - /* - * Have a Buffer, expected a String, convert. 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])) - { - Length++; - } - - /* Allocate a new string object */ - - NewObject = AcpiUtCreateStringObject (Length); - if (!NewObject) - { - return (AE_NO_MEMORY); - } - - /* - * Copy the raw buffer data with no transform. String is already NULL - * terminated at Length+1. - */ - ACPI_MEMCPY (NewObject->String.Pointer, - ReturnObject->Buffer.Pointer, Length); - - /* Install the new return object */ - - AcpiUtRemoveReference (ReturnObject); - *ReturnObjectPtr = NewObject; - - /* - * If the object is a package element, we need to: - * 1. Decrement the reference count of the orignal object, it was - * incremented when building the package - * 2. Increment the reference count of the new object, it will be - * decremented when releasing the package - */ - if (PackageIndex != ACPI_NOT_PACKAGE) - { - AcpiUtRemoveReference (ReturnObject); - AcpiUtAddReference (NewObject); - } - return (AE_OK); - - default: - break; + ThisRtype <<= 1; /* Next Rtype */ } - - return (AE_AML_OPERAND_TYPE); } - Index: sys/contrib/dev/acpica/namespace/nsdump.c =================================================================== --- sys/contrib/dev/acpica/namespace/nsdump.c (revision 203510) +++ sys/contrib/dev/acpica/namespace/nsdump.c (working copy) @@ -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 @@ 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 @@ (void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth, ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES, - AcpiNsDumpOneObject, (void *) &Info, NULL); + AcpiNsDumpOneObject, NULL, (void *) &Info, NULL); } Index: sys/contrib/dev/acpica/namespace/nsobject.c =================================================================== --- sys/contrib/dev/acpica/namespace/nsobject.c (revision 203510) +++ sys/contrib/dev/acpica/namespace/nsobject.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/namespace/nsxfobj.c =================================================================== --- sys/contrib/dev/acpica/namespace/nsxfobj.c (revision 203510) +++ sys/contrib/dev/acpica/namespace/nsxfobj.c (working copy) @@ -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 @@ /* Convert and validate the handle */ - Node = AcpiNsMapHandleToNode (Handle); + Node = AcpiNsValidateHandle (Handle); if (!Node) { (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); @@ -233,7 +233,7 @@ /* Convert and validate the handle */ - Node = AcpiNsMapHandleToNode (Handle); + Node = AcpiNsValidateHandle (Handle); if (!Node) { Status = AE_BAD_PARAMETER; @@ -243,7 +243,7 @@ /* 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 @@ { /* 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 @@ /* 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 @@ if (RetHandle) { - *RetHandle = AcpiNsConvertEntryToHandle (Node); + *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, Node); } Index: sys/contrib/dev/acpica/namespace/nsparse.c =================================================================== --- sys/contrib/dev/acpica/namespace/nsparse.c (revision 203510) +++ sys/contrib/dev/acpica/namespace/nsparse.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/namespace/nsxfname.c =================================================================== --- sys/contrib/dev/acpica/namespace/nsxfname.c (revision 203510) +++ sys/contrib/dev/acpica/namespace/nsxfname.c (working copy) @@ -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 @@ -126,7 +126,15 @@ #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsxfname") +/* Local prototypes */ +static char * +AcpiNsCopyDeviceId ( + ACPI_DEVICE_ID *Dest, + ACPI_DEVICE_ID *Source, + char *StringArea); + + /****************************************************************************** * * FUNCTION: AcpiGetHandle @@ -170,7 +178,7 @@ if (Parent) { - PrefixNode = AcpiNsMapHandleToNode (Parent); + PrefixNode = AcpiNsValidateHandle (Parent); if (!PrefixNode) { return (AE_BAD_PARAMETER); @@ -192,7 +200,7 @@ if (!ACPI_STRCMP (Pathname, ACPI_NS_ROOT_PATH)) { - *RetHandle = AcpiNsConvertEntryToHandle (AcpiGbl_RootNode); + *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, AcpiGbl_RootNode); return (AE_OK); } } @@ -208,7 +216,7 @@ 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); @@ -274,7 +282,7 @@ return (Status); } - Node = AcpiNsMapHandleToNode (Handle); + Node = AcpiNsValidateHandle (Handle); if (!Node) { Status = AE_BAD_PARAMETER; @@ -308,10 +316,42 @@ /****************************************************************************** * + * FUNCTION: AcpiNsCopyDeviceId + * + * PARAMETERS: Dest - Pointer to the destination DEVICE_ID + * Source - Pointer to the source DEVICE_ID + * StringArea - Pointer to where to copy the dest string + * + * RETURN: Pointer to the next string area + * + * DESCRIPTION: Copy a single DEVICE_ID, including the string data. + * + ******************************************************************************/ + +static char * +AcpiNsCopyDeviceId ( + ACPI_DEVICE_ID *Dest, + ACPI_DEVICE_ID *Source, + char *StringArea) +{ + /* Create the destination DEVICE_ID */ + + Dest->String = StringArea; + Dest->Length = Source->Length; + + /* Copy actual string and return a pointer to the next string area */ + + ACPI_MEMCPY (StringArea, Source->String, Source->Length); + return (StringArea + Source->Length); +} + + +/****************************************************************************** + * * FUNCTION: AcpiGetObjectInfo * - * PARAMETERS: Handle - Object Handle - * Buffer - Where the info is returned + * PARAMETERS: Handle - Object Handle + * ReturnBuffer - Where the info is returned * * RETURN: Status * @@ -319,100 +359,98 @@ * namespace node and possibly by running several standard * control methods (Such as in the case of a device.) * + * For Device and Processor objects, run the Device _HID, _UID, _CID, _STA, + * _ADR, _SxW, and _SxD methods. + * + * Note: Allocates the return buffer, must be freed by the caller. + * ******************************************************************************/ ACPI_STATUS AcpiGetObjectInfo ( ACPI_HANDLE Handle, - ACPI_BUFFER *Buffer) + ACPI_DEVICE_INFO **ReturnBuffer) { - ACPI_STATUS Status; ACPI_NAMESPACE_NODE *Node; ACPI_DEVICE_INFO *Info; - ACPI_DEVICE_INFO *ReturnInfo; - ACPI_COMPATIBLE_ID_LIST *CidList = NULL; - ACPI_SIZE Size; + ACPI_DEVICE_ID_LIST *CidList = NULL; + ACPI_DEVICE_ID *Hid = NULL; + ACPI_DEVICE_ID *Uid = NULL; + char *NextIdString; + ACPI_OBJECT_TYPE Type; + ACPI_NAME Name; + UINT8 ParamCount= 0; + UINT8 Valid = 0; + UINT32 InfoSize; + UINT32 i; + ACPI_STATUS Status; /* Parameter validation */ - if (!Handle || !Buffer) + if (!Handle || !ReturnBuffer) { return (AE_BAD_PARAMETER); } - Status = AcpiUtValidateBuffer (Buffer); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - - Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_DEVICE_INFO)); - if (!Info) - { - return (AE_NO_MEMORY); - } - Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { goto Cleanup; } - Node = AcpiNsMapHandleToNode (Handle); + Node = AcpiNsValidateHandle (Handle); if (!Node) { (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); - Status = AE_BAD_PARAMETER; - goto Cleanup; + return (AE_BAD_PARAMETER); } - /* Init return structure */ + /* Get the namespace node data while the namespace is locked */ - Size = sizeof (ACPI_DEVICE_INFO); + InfoSize = sizeof (ACPI_DEVICE_INFO); + Type = Node->Type; + Name = Node->Name.Integer; - Info->Type = Node->Type; - Info->Name = Node->Name.Integer; - Info->Valid = 0; - if (Node->Type == ACPI_TYPE_METHOD) { - Info->ParamCount = Node->Object->Method.ParamCount; + ParamCount = Node->Object->Method.ParamCount; } Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { - goto Cleanup; + return (Status); } - /* If not a device, we are all done */ - - if (Info->Type == ACPI_TYPE_DEVICE) + if ((Type == ACPI_TYPE_DEVICE) || + (Type == ACPI_TYPE_PROCESSOR)) { /* - * Get extra info for ACPI Devices objects only: - * Run the Device _HID, _UID, _CID, _STA, _ADR and _SxD methods. + * Get extra info for ACPI Device/Processor objects only: + * Run the Device _HID, _UID, and _CID methods. * * Note: none of these methods are required, so they may or may - * not be present for this device. The Info->Valid bitfield is used - * to indicate which methods were found and ran successfully. + * not be present for this device. The Info->Valid bitfield is used + * to indicate which methods were found and run successfully. */ /* Execute the Device._HID method */ - Status = AcpiUtExecute_HID (Node, &Info->HardwareId); + Status = AcpiUtExecute_HID (Node, &Hid); if (ACPI_SUCCESS (Status)) { - Info->Valid |= ACPI_VALID_HID; + InfoSize += Hid->Length; + Valid |= ACPI_VALID_HID; } /* Execute the Device._UID method */ - Status = AcpiUtExecute_UID (Node, &Info->UniqueId); + Status = AcpiUtExecute_UID (Node, &Uid); if (ACPI_SUCCESS (Status)) { - Info->Valid |= ACPI_VALID_UID; + InfoSize += Uid->Length; + Valid |= ACPI_VALID_UID; } /* Execute the Device._CID method */ @@ -420,57 +458,151 @@ Status = AcpiUtExecute_CID (Node, &CidList); if (ACPI_SUCCESS (Status)) { - Size += CidList->Size; - Info->Valid |= ACPI_VALID_CID; + /* Add size of CID strings and CID pointer array */ + + InfoSize += (CidList->ListSize - sizeof (ACPI_DEVICE_ID_LIST)); + Valid |= ACPI_VALID_CID; } + } + /* + * Now that we have the variable-length data, we can allocate the + * return buffer + */ + Info = ACPI_ALLOCATE_ZEROED (InfoSize); + if (!Info) + { + Status = AE_NO_MEMORY; + goto Cleanup; + } + + /* Get the fixed-length data */ + + if ((Type == ACPI_TYPE_DEVICE) || + (Type == ACPI_TYPE_PROCESSOR)) + { + /* + * Get extra info for ACPI Device/Processor objects only: + * Run the _STA, _ADR and, SxW, and _SxD methods. + * + * Note: none of these methods are required, so they may or may + * not be present for this device. The Info->Valid bitfield is used + * to indicate which methods were found and run successfully. + */ + /* Execute the Device._STA method */ Status = AcpiUtExecute_STA (Node, &Info->CurrentStatus); if (ACPI_SUCCESS (Status)) { - Info->Valid |= ACPI_VALID_STA; + Valid |= ACPI_VALID_STA; } /* Execute the Device._ADR method */ Status = AcpiUtEvaluateNumericObject (METHOD_NAME__ADR, Node, - &Info->Address); + &Info->Address); if (ACPI_SUCCESS (Status)) { - Info->Valid |= ACPI_VALID_ADR; + Valid |= ACPI_VALID_ADR; } + /* Execute the Device._SxW methods */ + + Status = AcpiUtExecutePowerMethods (Node, + AcpiGbl_LowestDstateNames, ACPI_NUM_SxW_METHODS, + Info->LowestDstates); + if (ACPI_SUCCESS (Status)) + { + Valid |= ACPI_VALID_SXWS; + } + /* Execute the Device._SxD methods */ - Status = AcpiUtExecute_Sxds (Node, Info->HighestDstates); + Status = AcpiUtExecutePowerMethods (Node, + AcpiGbl_HighestDstateNames, ACPI_NUM_SxD_METHODS, + Info->HighestDstates); if (ACPI_SUCCESS (Status)) { - Info->Valid |= ACPI_VALID_SXDS; + Valid |= ACPI_VALID_SXDS; } } - /* Validate/Allocate/Clear caller buffer */ + /* + * Create a pointer to the string area of the return buffer. + * Point to the end of the base ACPI_DEVICE_INFO structure. + */ + NextIdString = ACPI_CAST_PTR (char, Info->CompatibleIdList.Ids); + if (CidList) + { + /* Point past the CID DEVICE_ID array */ - Status = AcpiUtInitializeBuffer (Buffer, Size); - if (ACPI_FAILURE (Status)) + NextIdString += ((ACPI_SIZE) CidList->Count * sizeof (ACPI_DEVICE_ID)); + } + + /* + * Copy the HID, UID, and CIDs to the return buffer. The variable-length + * strings are copied to the reserved area at the end of the buffer. + * + * For HID and CID, check if the ID is a PCI Root Bridge. + */ + if (Hid) { - goto Cleanup; + NextIdString = AcpiNsCopyDeviceId (&Info->HardwareId, + Hid, NextIdString); + + if (AcpiUtIsPciRootBridge (Hid->String)) + { + Info->Flags |= ACPI_PCI_ROOT_BRIDGE; + } } - /* Populate the return buffer */ + if (Uid) + { + NextIdString = AcpiNsCopyDeviceId (&Info->UniqueId, + Uid, NextIdString); + } - ReturnInfo = Buffer->Pointer; - ACPI_MEMCPY (ReturnInfo, Info, sizeof (ACPI_DEVICE_INFO)); - if (CidList) { - ACPI_MEMCPY (&ReturnInfo->CompatibilityId, CidList, CidList->Size); + Info->CompatibleIdList.Count = CidList->Count; + Info->CompatibleIdList.ListSize = CidList->ListSize; + + /* Copy each CID */ + + for (i = 0; i < CidList->Count; i++) + { + NextIdString = AcpiNsCopyDeviceId (&Info->CompatibleIdList.Ids[i], + &CidList->Ids[i], NextIdString); + + if (AcpiUtIsPciRootBridge (CidList->Ids[i].String)) + { + Info->Flags |= ACPI_PCI_ROOT_BRIDGE; + } + } } + /* Copy the fixed-length data */ + Info->InfoSize = InfoSize; + Info->Type = Type; + Info->Name = Name; + Info->ParamCount = ParamCount; + Info->Valid = Valid; + + *ReturnBuffer = Info; + Status = AE_OK; + + Cleanup: - ACPI_FREE (Info); + if (Hid) + { + ACPI_FREE (Hid); + } + if (Uid) + { + ACPI_FREE (Uid); + } if (CidList) { ACPI_FREE (CidList); Index: sys/contrib/dev/acpica/namespace/nsload.c =================================================================== --- sys/contrib/dev/acpica/namespace/nsload.c (revision 203510) +++ sys/contrib/dev/acpica/namespace/nsload.c (working copy) @@ -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 @@ -376,8 +376,7 @@ /* Now delete the starting object, and we are done */ - AcpiNsDeleteNode (ChildHandle); - + AcpiNsRemoveNode (ChildHandle); return_ACPI_STATUS (AE_OK); } Index: sys/contrib/dev/acpica/namespace/nsrepair.c =================================================================== --- sys/contrib/dev/acpica/namespace/nsrepair.c (revision 203505) +++ sys/contrib/dev/acpica/namespace/nsrepair.c (working copy) @@ -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 @@ -115,10 +115,11 @@ #define __NSREPAIR_C__ -#include "acpi.h" -#include "accommon.h" -#include "acnamesp.h" -#include "acpredef.h" +#include +#include +#include +#include +#include #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsrepair") @@ -126,6 +127,60 @@ /******************************************************************************* * + * 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 * * PARAMETERS: Data - Pointer to validation data structure @@ -152,29 +207,230 @@ { 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 @@ * 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); } - else + + /* 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++) { - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Converted Buffer to expected String")); + *DwordBuffer = (UINT32) (*Elements)->Integer.Value; + DwordBuffer++; + Elements++; } + break; - /* Delete old object, install the new return object */ + default: + return (AE_AML_OPERAND_TYPE); + } - AcpiUtRemoveReference (ReturnObject); - *ReturnObjectPtr = NewObject; - Data->Flags |= ACPI_OBJECT_REPAIRED; + *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: - break; + return; } - return (AE_AML_OPERAND_TYPE); + 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 + { + *Dest = *Source; + Dest++; + } + Source++; + } + + /* 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 @@ 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 @@ *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); } Index: sys/contrib/dev/acpica/namespace/nsxfeval.c =================================================================== --- sys/contrib/dev/acpica/namespace/nsxfeval.c (revision 203510) +++ sys/contrib/dev/acpica/namespace/nsxfeval.c (working copy) @@ -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 @@ /* 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 @@ * 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 @@ * * 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 @@ 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 @@ if ((Type > ACPI_TYPE_LOCAL_MAX) || (!MaxDepth) || - (!UserFunction)) + (!PreOrderVisit && !PostOrderVisit)) { return_ACPI_STATUS (AE_BAD_PARAMETER); } @@ -621,7 +625,8 @@ } 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); @@ -658,10 +663,11 @@ ACPI_STATUS Status; ACPI_NAMESPACE_NODE *Node; UINT32 Flags; - ACPI_DEVICE_ID Hid; - ACPI_COMPATIBLE_ID_LIST *Cid; + ACPI_DEVICE_ID *Hid; + ACPI_DEVICE_ID_LIST *Cid; UINT32 i; BOOLEAN Found; + int NoMatch; Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); @@ -670,7 +676,7 @@ return (Status); } - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { @@ -682,27 +688,20 @@ return (AE_BAD_PARAMETER); } - /* 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); - } - - /* 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); @@ -715,7 +714,10 @@ return (AE_CTRL_DEPTH); } - if (ACPI_STRNCMP (Hid.Value, Info->Hid, sizeof (Hid.Value)) != 0) + NoMatch = ACPI_STRCMP (Hid->String, Info->Hid); + ACPI_FREE (Hid); + + if (NoMatch) { /* * HID does not match, attempt match within the @@ -736,8 +738,7 @@ Found = FALSE; for (i = 0; i < Cid->Count; i++) { - if (ACPI_STRNCMP (Cid->Id[i].Value, Info->Hid, - sizeof (ACPI_COMPATIBLE_ID)) == 0) + if (ACPI_STRCMP (Cid->Ids[i].String, Info->Hid) == 0) { /* Found a matching CID */ @@ -754,6 +755,25 @@ } } + /* 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, @@ -830,7 +850,7 @@ 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); @@ -880,7 +900,7 @@ /* Convert and validate the handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { Status = AE_BAD_PARAMETER; @@ -935,7 +955,7 @@ /* Convert and validate the handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { Status = AE_BAD_PARAMETER; @@ -993,7 +1013,7 @@ /* Convert and validate the handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { Status = AE_BAD_PARAMETER; Index: sys/contrib/dev/acpica/namespace/nseval.c =================================================================== --- sys/contrib/dev/acpica/namespace/nseval.c (revision 203510) +++ sys/contrib/dev/acpica/namespace/nseval.c (working copy) @@ -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,7 +126,14 @@ #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nseval") +/* Local prototypes */ +static void +AcpiNsExecModuleCode ( + ACPI_OPERAND_OBJECT *MethodObj, + ACPI_EVALUATE_INFO *Info); + + /******************************************************************************* * * FUNCTION: AcpiNsEvaluate @@ -360,3 +367,192 @@ return_ACPI_STATUS (Status); } + +/******************************************************************************* + * + * FUNCTION: AcpiNsExecModuleCodeList + * + * PARAMETERS: None + * + * RETURN: None. Exceptions during method execution are ignored, since + * we cannot abort a table load. + * + * DESCRIPTION: Execute all elements of the global module-level code list. + * Each element is executed as a single control method. + * + ******************************************************************************/ + +void +AcpiNsExecModuleCodeList ( + void) +{ + ACPI_OPERAND_OBJECT *Prev; + ACPI_OPERAND_OBJECT *Next; + ACPI_EVALUATE_INFO *Info; + UINT32 MethodCount = 0; + + + ACPI_FUNCTION_TRACE (NsExecModuleCodeList); + + + /* Exit now if the list is empty */ + + Next = AcpiGbl_ModuleCodeList; + if (!Next) + { + return_VOID; + } + + /* Allocate the evaluation information block */ + + Info = ACPI_ALLOCATE (sizeof (ACPI_EVALUATE_INFO)); + if (!Info) + { + return_VOID; + } + + /* Walk the list, executing each "method" */ + + while (Next) + { + Prev = Next; + Next = Next->Method.Mutex; + + /* Clear the link field and execute the method */ + + Prev->Method.Mutex = NULL; + AcpiNsExecModuleCode (Prev, Info); + MethodCount++; + + /* Delete the (temporary) method object */ + + AcpiUtRemoveReference (Prev); + } + + ACPI_INFO ((AE_INFO, + "Executed %u blocks of module-level executable AML code", + MethodCount)); + + ACPI_FREE (Info); + AcpiGbl_ModuleCodeList = NULL; + return_VOID; +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsExecModuleCode + * + * PARAMETERS: MethodObj - Object container for the module-level code + * Info - Info block for method evaluation + * + * RETURN: None. Exceptions during method execution are ignored, since + * we cannot abort a table load. + * + * DESCRIPTION: Execute a control method containing a block of module-level + * executable AML code. The control method is temporarily + * installed to the root node, then evaluated. + * + ******************************************************************************/ + +static void +AcpiNsExecModuleCode ( + ACPI_OPERAND_OBJECT *MethodObj, + ACPI_EVALUATE_INFO *Info) +{ + 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 = ParentNode; + + /* + * Get the currently attached parent object. Add a reference, because the + * ref count will be decreased when the method object is installed to + * the parent node. + */ + ParentObj = AcpiNsGetAttachedObject (ParentNode); + if (ParentObj) + { + AcpiUtAddReference (ParentObj); + } + + /* Install the method (module-level code) in the parent node */ + + Status = AcpiNsAttachObject (ParentNode, MethodObj, + ACPI_TYPE_METHOD); + if (ACPI_FAILURE (Status)) + { + goto Exit; + } + + /* 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 (ParentNode); + + /* Restore the original parent object */ + + if (ParentObj) + { + Status = AcpiNsAttachObject (ParentNode, ParentObj, Type); + } + else + { + ParentNode->Type = (UINT8) Type; + } + +Exit: + if (ParentObj) + { + AcpiUtRemoveReference (ParentObj); + } + return_VOID; +} + Index: sys/contrib/dev/acpica/namespace/nsalloc.c =================================================================== --- sys/contrib/dev/acpica/namespace/nsalloc.c (revision 203510) +++ sys/contrib/dev/acpica/namespace/nsalloc.c (working copy) @@ -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 @@ -181,7 +181,10 @@ * * RETURN: None * - * DESCRIPTION: Delete a namespace node + * DESCRIPTION: Delete a namespace node. All node deletions must come through + * here. Detaches any attached objects, including any attached + * data. If a handler is associated with attached data, it is + * invoked before the node is deleted. * ******************************************************************************/ @@ -189,12 +192,67 @@ AcpiNsDeleteNode ( ACPI_NAMESPACE_NODE *Node) { + ACPI_OPERAND_OBJECT *ObjDesc; + + + ACPI_FUNCTION_NAME (NsDeleteNode); + + + /* Detach an object if there is one */ + + AcpiNsDetachObject (Node); + + /* + * Delete an attached data object if present (an object that was created + * and attached via AcpiAttachData). Note: After any normal object is + * detached above, the only possible remaining object is a data object. + */ + ObjDesc = Node->Object; + if (ObjDesc && + (ObjDesc->Common.Type == ACPI_TYPE_LOCAL_DATA)) + { + /* Invoke the attached data deletion handler if present */ + + if (ObjDesc->Data.Handler) + { + ObjDesc->Data.Handler (Node, ObjDesc->Data.Pointer); + } + + AcpiUtRemoveReference (ObjDesc); + } + + /* Now we can delete the node */ + + (void) AcpiOsReleaseObject (AcpiGbl_NamespaceCache, Node); + + ACPI_MEM_TRACKING (AcpiGbl_NsNodeList->TotalFreed++); + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Node %p, Remaining %X\n", + Node, AcpiGbl_CurrentNodeCount)); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsRemoveNode + * + * PARAMETERS: Node - Node to be removed/deleted + * + * RETURN: None + * + * DESCRIPTION: Remove (unlink) and delete a namespace node + * + ******************************************************************************/ + +void +AcpiNsRemoveNode ( + ACPI_NAMESPACE_NODE *Node) +{ ACPI_NAMESPACE_NODE *ParentNode; ACPI_NAMESPACE_NODE *PrevNode; ACPI_NAMESPACE_NODE *NextNode; - ACPI_FUNCTION_TRACE_PTR (NsDeleteNode, Node); + ACPI_FUNCTION_TRACE_PTR (NsRemoveNode, Node); ParentNode = AcpiNsGetParentNode (Node); @@ -237,12 +295,9 @@ } } - ACPI_MEM_TRACKING (AcpiGbl_NsNodeList->TotalFreed++); + /* Delete the node and any attached objects */ - /* Detach an object if there is one, then delete the node */ - - AcpiNsDetachObject (Node); - (void) AcpiOsReleaseObject (AcpiGbl_NamespaceCache, Node); + AcpiNsDeleteNode (Node); return_VOID; } @@ -385,23 +440,11 @@ ParentNode, ChildNode)); } - /* Now we can free this child object */ - - ACPI_MEM_TRACKING (AcpiGbl_NsNodeList->TotalFreed++); - - ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Object %p, Remaining %X\n", - ChildNode, AcpiGbl_CurrentNodeCount)); - - /* Detach an object if there is one, then free the child node */ - - AcpiNsDetachObject (ChildNode); - - /* Now we can delete the node */ - - (void) AcpiOsReleaseObject (AcpiGbl_NamespaceCache, ChildNode); - - /* And move on to the next child in the list */ - + /* + * Delete this child node and move on to the next child in the list. + * No need to unlink the node since we are deleting the entire branch. + */ + AcpiNsDeleteNode (ChildNode); ChildNode = NextNode; } while (!(Flags & ANOBJ_END_OF_PEER_LIST)); @@ -561,7 +604,7 @@ if (DeletionNode) { AcpiNsDeleteChildren (DeletionNode); - AcpiNsDeleteNode (DeletionNode); + AcpiNsRemoveNode (DeletionNode); DeletionNode = NULL; } Index: sys/contrib/dev/acpica/hardware/hwvalid.c =================================================================== --- sys/contrib/dev/acpica/hardware/hwvalid.c (revision 203510) +++ sys/contrib/dev/acpica/hardware/hwvalid.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/hardware/hwregs.c =================================================================== --- sys/contrib/dev/acpica/hardware/hwregs.c (revision 203510) +++ sys/contrib/dev/acpica/hardware/hwregs.c (working copy) @@ -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 @@ -140,6 +140,209 @@ ACPI_GENERIC_ADDRESS *RegisterB); +/****************************************************************************** + * + * FUNCTION: AcpiHwValidateRegister + * + * PARAMETERS: Reg - GAS register structure + * MaxBitWidth - Max BitWidth supported (32 or 64) + * Address - Pointer to where the gas->address + * is returned + * + * RETURN: Status + * + * DESCRIPTION: Validate the contents of a GAS register. Checks the GAS + * pointer, Address, SpaceId, BitWidth, and BitOffset. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiHwValidateRegister ( + ACPI_GENERIC_ADDRESS *Reg, + UINT8 MaxBitWidth, + UINT64 *Address) +{ + + /* Must have a valid pointer to a GAS structure */ + + if (!Reg) + { + return (AE_BAD_PARAMETER); + } + + /* + * Copy the target address. This handles possible alignment issues. + * Address must not be null. A null address also indicates an optional + * ACPI register that is not supported, so no error message. + */ + ACPI_MOVE_64_TO_64 (Address, &Reg->Address); + if (!(*Address)) + { + return (AE_BAD_ADDRESS); + } + + /* Validate the SpaceID */ + + if ((Reg->SpaceId != ACPI_ADR_SPACE_SYSTEM_MEMORY) && + (Reg->SpaceId != ACPI_ADR_SPACE_SYSTEM_IO)) + { + ACPI_ERROR ((AE_INFO, + "Unsupported address space: 0x%X", Reg->SpaceId)); + return (AE_SUPPORT); + } + + /* Validate the BitWidth */ + + if ((Reg->BitWidth != 8) && + (Reg->BitWidth != 16) && + (Reg->BitWidth != 32) && + (Reg->BitWidth != MaxBitWidth)) + { + ACPI_ERROR ((AE_INFO, + "Unsupported register bit width: 0x%X", Reg->BitWidth)); + return (AE_SUPPORT); + } + + /* Validate the BitOffset. Just a warning for now. */ + + if (Reg->BitOffset != 0) + { + ACPI_WARNING ((AE_INFO, + "Unsupported register bit offset: 0x%X", Reg->BitOffset)); + } + + return (AE_OK); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiHwRead + * + * PARAMETERS: Value - Where the value is returned + * Reg - GAS register structure + * + * RETURN: Status + * + * DESCRIPTION: Read from either memory or IO space. This is a 32-bit max + * version of AcpiRead, used internally since the overhead of + * 64-bit values is not needed. + * + * LIMITATIONS: + * BitWidth must be exactly 8, 16, or 32. + * SpaceID must be SystemMemory or SystemIO. + * BitOffset and AccessWidth are currently ignored, as there has + * not been a need to implement these. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiHwRead ( + UINT32 *Value, + ACPI_GENERIC_ADDRESS *Reg) +{ + UINT64 Address; + ACPI_STATUS Status; + + + ACPI_FUNCTION_NAME (HwRead); + + + /* Validate contents of the GAS register */ + + Status = AcpiHwValidateRegister (Reg, 32, &Address); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Initialize entire 32-bit return value to zero */ + + *Value = 0; + + /* + * Two address spaces supported: Memory or IO. PCI_Config is + * not supported here because the GAS structure is insufficient + */ + if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) + { + Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS) + Address, Value, Reg->BitWidth); + } + else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ + { + Status = AcpiHwReadPort ((ACPI_IO_ADDRESS) + Address, Value, Reg->BitWidth); + } + + ACPI_DEBUG_PRINT ((ACPI_DB_IO, + "Read: %8.8X width %2d from %8.8X%8.8X (%s)\n", + *Value, Reg->BitWidth, ACPI_FORMAT_UINT64 (Address), + AcpiUtGetRegionName (Reg->SpaceId))); + + return (Status); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiHwWrite + * + * PARAMETERS: Value - Value to be written + * Reg - GAS register structure + * + * RETURN: Status + * + * DESCRIPTION: Write to either memory or IO space. This is a 32-bit max + * version of AcpiWrite, used internally since the overhead of + * 64-bit values is not needed. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiHwWrite ( + UINT32 Value, + ACPI_GENERIC_ADDRESS *Reg) +{ + UINT64 Address; + ACPI_STATUS Status; + + + ACPI_FUNCTION_NAME (HwWrite); + + + /* Validate contents of the GAS register */ + + Status = AcpiHwValidateRegister (Reg, 32, &Address); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* + * Two address spaces supported: Memory or IO. PCI_Config is + * not supported here because the GAS structure is insufficient + */ + if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) + { + Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS) + Address, Value, Reg->BitWidth); + } + else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ + { + Status = AcpiHwWritePort ((ACPI_IO_ADDRESS) + Address, Value, Reg->BitWidth); + } + + ACPI_DEBUG_PRINT ((ACPI_DB_IO, + "Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n", + Value, Reg->BitWidth, ACPI_FORMAT_UINT64 (Address), + AcpiUtGetRegionName (Reg->SpaceId))); + + return (Status); +} + + /******************************************************************************* * * FUNCTION: AcpiHwClearAcpiStatus @@ -245,7 +448,7 @@ ACPI_FUNCTION_TRACE (HwWritePm1Control); - Status = AcpiWrite (Pm1aControl, &AcpiGbl_FADT.XPm1aControlBlock); + Status = AcpiHwWrite (Pm1aControl, &AcpiGbl_FADT.XPm1aControlBlock); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -253,7 +456,7 @@ if (AcpiGbl_FADT.XPm1bControlBlock.Address) { - Status = AcpiWrite (Pm1bControl, &AcpiGbl_FADT.XPm1bControlBlock); + Status = AcpiHwWrite (Pm1bControl, &AcpiGbl_FADT.XPm1bControlBlock); } return_ACPI_STATUS (Status); } @@ -319,13 +522,13 @@ case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ - Status = AcpiRead (&Value, &AcpiGbl_FADT.XPm2ControlBlock); + Status = AcpiHwRead (&Value, &AcpiGbl_FADT.XPm2ControlBlock); break; case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ - Status = AcpiRead (&Value, &AcpiGbl_FADT.XPmTimerBlock); + Status = AcpiHwRead (&Value, &AcpiGbl_FADT.XPmTimerBlock); break; @@ -450,7 +653,7 @@ * For control registers, all reserved bits must be preserved, * as per the ACPI spec. */ - Status = AcpiRead (&ReadValue, &AcpiGbl_FADT.XPm2ControlBlock); + Status = AcpiHwRead (&ReadValue, &AcpiGbl_FADT.XPm2ControlBlock); if (ACPI_FAILURE (Status)) { goto Exit; @@ -460,13 +663,13 @@ ACPI_INSERT_BITS (Value, ACPI_PM2_CONTROL_PRESERVED_BITS, ReadValue); - Status = AcpiWrite (Value, &AcpiGbl_FADT.XPm2ControlBlock); + Status = AcpiHwWrite (Value, &AcpiGbl_FADT.XPm2ControlBlock); break; case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ - Status = AcpiWrite (Value, &AcpiGbl_FADT.XPmTimerBlock); + Status = AcpiHwWrite (Value, &AcpiGbl_FADT.XPmTimerBlock); break; @@ -517,7 +720,7 @@ /* The first register is always required */ - Status = AcpiRead (&ValueA, RegisterA); + Status = AcpiHwRead (&ValueA, RegisterA); if (ACPI_FAILURE (Status)) { return (Status); @@ -527,7 +730,7 @@ if (RegisterB->Address) { - Status = AcpiRead (&ValueB, RegisterB); + Status = AcpiHwRead (&ValueB, RegisterB); if (ACPI_FAILURE (Status)) { return (Status); @@ -574,7 +777,7 @@ /* The first register is always required */ - Status = AcpiWrite (Value, RegisterA); + Status = AcpiHwWrite (Value, RegisterA); if (ACPI_FAILURE (Status)) { return (Status); @@ -594,7 +797,7 @@ */ if (RegisterB->Address) { - Status = AcpiWrite (Value, RegisterB); + Status = AcpiHwWrite (Value, RegisterB); } return (Status); Index: sys/contrib/dev/acpica/hardware/hwtimer.c =================================================================== --- sys/contrib/dev/acpica/hardware/hwtimer.c (revision 203510) +++ sys/contrib/dev/acpica/hardware/hwtimer.c (working copy) @@ -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 @@ -187,7 +187,7 @@ return_ACPI_STATUS (AE_BAD_PARAMETER); } - Status = AcpiRead (Ticks, &AcpiGbl_FADT.XPmTimerBlock); + Status = AcpiHwRead (Ticks, &AcpiGbl_FADT.XPmTimerBlock); return_ACPI_STATUS (Status); } @@ -232,7 +232,7 @@ { ACPI_STATUS Status; UINT32 DeltaTicks; - ACPI_INTEGER Quotient; + UINT64 Quotient; ACPI_FUNCTION_TRACE (AcpiGetTimerDuration); Index: sys/contrib/dev/acpica/hardware/hwxface.c =================================================================== --- sys/contrib/dev/acpica/hardware/hwxface.c (revision 203510) +++ sys/contrib/dev/acpica/hardware/hwxface.c (working copy) @@ -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 @@ -157,9 +157,23 @@ return_ACPI_STATUS (AE_NOT_EXIST); } - /* Write the reset value to the reset register */ + if (ResetReg->SpaceId == ACPI_ADR_SPACE_SYSTEM_IO) + { + /* + * For I/O space, write directly to the OSL. This bypasses the port + * validation mechanism, which may block a valid write to the reset + * register. + */ + Status = AcpiOsWritePort ((ACPI_IO_ADDRESS) ResetReg->Address, + AcpiGbl_FADT.ResetValue, ResetReg->BitWidth); + } + else + { + /* Write the reset value to the reset register */ - Status = AcpiWrite (AcpiGbl_FADT.ResetValue, ResetReg); + Status = AcpiHwWrite (AcpiGbl_FADT.ResetValue, ResetReg); + } + return_ACPI_STATUS (Status); } @@ -177,13 +191,20 @@ * * DESCRIPTION: Read from either memory or IO space. * + * LIMITATIONS: + * BitWidth must be exactly 8, 16, 32, or 64. + * SpaceID must be SystemMemory or SystemIO. + * BitOffset and AccessWidth are currently ignored, as there has + * not been a need to implement these. + * ******************************************************************************/ ACPI_STATUS AcpiRead ( - UINT32 *Value, + UINT64 *ReturnValue, ACPI_GENERIC_ADDRESS *Reg) { + UINT32 Value; UINT32 Width; UINT64 Address; ACPI_STATUS Status; @@ -192,63 +213,85 @@ ACPI_FUNCTION_NAME (AcpiRead); - /* - * Must have a valid pointer to a GAS structure, and a non-zero address - * within. - */ - if (!Reg) + if (!ReturnValue) { return (AE_BAD_PARAMETER); } - /* Get a local copy of the address. Handles possible alignment issues */ + /* Validate contents of the GAS register. Allow 64-bit transfers */ - ACPI_MOVE_64_TO_64 (&Address, &Reg->Address); - if (!Address) + Status = AcpiHwValidateRegister (Reg, 64, &Address); + if (ACPI_FAILURE (Status)) { - return (AE_BAD_ADDRESS); + return (Status); } - /* Supported widths are 8/16/32 */ - Width = Reg->BitWidth; - if ((Width != 8) && (Width != 16) && (Width != 32)) + if (Width == 64) { - return (AE_SUPPORT); + Width = 32; /* Break into two 32-bit transfers */ } - /* Initialize entire 32-bit return value to zero */ + /* Initialize entire 64-bit return value to zero */ - *Value = 0; + *ReturnValue = 0; + Value = 0; /* * Two address spaces supported: Memory or IO. PCI_Config is * not supported here because the GAS structure is insufficient */ - switch (Reg->SpaceId) + if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) { - case ACPI_ADR_SPACE_SYSTEM_MEMORY: + Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS) + Address, &Value, Width); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + *ReturnValue = Value; - Status = AcpiOsReadMemory ( - (ACPI_PHYSICAL_ADDRESS) Address, Value, Width); - break; + if (Reg->BitWidth == 64) + { + /* Read the top 32 bits */ + Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS) + (Address + 4), &Value, 32); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + *ReturnValue |= ((UINT64) Value << 32); + } + } + else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ + { + Status = AcpiHwReadPort ((ACPI_IO_ADDRESS) + Address, &Value, Width); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + *ReturnValue = Value; - case ACPI_ADR_SPACE_SYSTEM_IO: + if (Reg->BitWidth == 64) + { + /* Read the top 32 bits */ - Status = AcpiHwReadPort ((ACPI_IO_ADDRESS) Address, Value, Width); - break; - - - default: - ACPI_ERROR ((AE_INFO, - "Unsupported address space: %X", Reg->SpaceId)); - return (AE_BAD_PARAMETER); + Status = AcpiHwReadPort ((ACPI_IO_ADDRESS) + (Address + 4), &Value, 32); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + *ReturnValue |= ((UINT64) Value << 32); + } } ACPI_DEBUG_PRINT ((ACPI_DB_IO, - "Read: %8.8X width %2d from %8.8X%8.8X (%s)\n", - *Value, Width, ACPI_FORMAT_UINT64 (Address), + "Read: %8.8X%8.8X width %2d from %8.8X%8.8X (%s)\n", + ACPI_FORMAT_UINT64 (*ReturnValue), Reg->BitWidth, + ACPI_FORMAT_UINT64 (Address), AcpiUtGetRegionName (Reg->SpaceId))); return (Status); @@ -261,7 +304,7 @@ * * FUNCTION: AcpiWrite * - * PARAMETERS: Value - To be written + * PARAMETERS: Value - Value to be written * Reg - GAS register structure * * RETURN: Status @@ -272,7 +315,7 @@ ACPI_STATUS AcpiWrite ( - UINT32 Value, + UINT64 Value, ACPI_GENERIC_ADDRESS *Reg) { UINT32 Width; @@ -283,60 +326,67 @@ ACPI_FUNCTION_NAME (AcpiWrite); - /* - * Must have a valid pointer to a GAS structure, and a non-zero address - * within. - */ - if (!Reg) - { - return (AE_BAD_PARAMETER); - } + /* Validate contents of the GAS register. Allow 64-bit transfers */ - /* Get a local copy of the address. Handles possible alignment issues */ - - ACPI_MOVE_64_TO_64 (&Address, &Reg->Address); - if (!Address) + Status = AcpiHwValidateRegister (Reg, 64, &Address); + if (ACPI_FAILURE (Status)) { - return (AE_BAD_ADDRESS); + return (Status); } - /* Supported widths are 8/16/32 */ - Width = Reg->BitWidth; - if ((Width != 8) && (Width != 16) && (Width != 32)) + if (Width == 64) { - return (AE_SUPPORT); + Width = 32; /* Break into two 32-bit transfers */ } /* - * Two address spaces supported: Memory or IO. - * PCI_Config is not supported here because the GAS struct is insufficient + * Two address spaces supported: Memory or IO. PCI_Config is + * not supported here because the GAS structure is insufficient */ - switch (Reg->SpaceId) + if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) { - case ACPI_ADR_SPACE_SYSTEM_MEMORY: + Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS) + Address, ACPI_LODWORD (Value), Width); + if (ACPI_FAILURE (Status)) + { + return (Status); + } - Status = AcpiOsWriteMemory ( - (ACPI_PHYSICAL_ADDRESS) Address, Value, Width); - break; + if (Reg->BitWidth == 64) + { + Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS) + (Address + 4), ACPI_HIDWORD (Value), 32); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + } + } + else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ + { + Status = AcpiHwWritePort ((ACPI_IO_ADDRESS) + Address, ACPI_LODWORD (Value), Width); + if (ACPI_FAILURE (Status)) + { + return (Status); + } - - case ACPI_ADR_SPACE_SYSTEM_IO: - - Status = AcpiHwWritePort ( - (ACPI_IO_ADDRESS) Address, Value, Width); - break; - - - default: - ACPI_ERROR ((AE_INFO, - "Unsupported address space: %X", Reg->SpaceId)); - return (AE_BAD_PARAMETER); + if (Reg->BitWidth == 64) + { + Status = AcpiHwWritePort ((ACPI_IO_ADDRESS) + (Address + 4), ACPI_HIDWORD (Value), 32); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + } } ACPI_DEBUG_PRINT ((ACPI_DB_IO, - "Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n", - Value, Width, ACPI_FORMAT_UINT64 (Address), + "Wrote: %8.8X%8.8X width %2d to %8.8X%8.8X (%s)\n", + ACPI_FORMAT_UINT64 (Value), Reg->BitWidth, + ACPI_FORMAT_UINT64 (Address), AcpiUtGetRegionName (Reg->SpaceId))); return (Status); Index: sys/contrib/dev/acpica/hardware/hwsleep.c =================================================================== --- sys/contrib/dev/acpica/hardware/hwsleep.c (revision 203510) +++ sys/contrib/dev/acpica/hardware/hwsleep.c (working copy) @@ -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 @@ -346,10 +346,13 @@ if (SleepState != ACPI_STATE_S5) { - /* Disable BM arbitration */ - + /* + * Disable BM arbitration. This feature is contained within an + * optional register (PM2 Control), so ignore a BAD_ADDRESS + * exception. + */ Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 1); - if (ACPI_FAILURE (Status)) + if (ACPI_FAILURE (Status) && (Status != AE_BAD_ADDRESS)) { return_ACPI_STATUS (Status); } @@ -694,10 +697,13 @@ AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].StatusRegisterId, ACPI_CLEAR_STATUS); - /* Enable BM arbitration */ - + /* + * Enable BM arbitration. This feature is contained within an + * optional register (PM2 Control), so ignore a BAD_ADDRESS + * exception. + */ Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 0); - if (ACPI_FAILURE (Status)) + if (ACPI_FAILURE (Status) && (Status != AE_BAD_ADDRESS)) { return_ACPI_STATUS (Status); } Index: sys/contrib/dev/acpica/hardware/hwgpe.c =================================================================== --- sys/contrib/dev/acpica/hardware/hwgpe.c (revision 203510) +++ sys/contrib/dev/acpica/hardware/hwgpe.c (working copy) @@ -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 @@ -161,7 +161,7 @@ /* Get current value of the enable register that contains this GPE */ - Status = AcpiRead (&EnableMask, &GpeRegisterInfo->EnableAddress); + Status = AcpiHwRead (&EnableMask, &GpeRegisterInfo->EnableAddress); if (ACPI_FAILURE (Status)) { return (Status); @@ -175,7 +175,7 @@ /* Write the updated enable mask */ - Status = AcpiWrite (EnableMask, &GpeRegisterInfo->EnableAddress); + Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress); return (Status); } @@ -215,7 +215,7 @@ /* Write the entire GPE (runtime) enable register */ - Status = AcpiWrite (GpeRegisterInfo->EnableForRun, + Status = AcpiHwWrite (GpeRegisterInfo->EnableForRun, &GpeRegisterInfo->EnableAddress); return (Status); @@ -252,7 +252,7 @@ * Write a one to the appropriate bit in the status register to * clear this GPE. */ - Status = AcpiWrite (RegisterBit, + Status = AcpiHwWrite (RegisterBit, &GpeEventInfo->RegisterInfo->StatusAddress); return (Status); @@ -317,10 +317,10 @@ /* GPE currently active (status bit == 1)? */ - Status = AcpiRead (&InByte, &GpeRegisterInfo->StatusAddress); + Status = AcpiHwRead (&InByte, &GpeRegisterInfo->StatusAddress); if (ACPI_FAILURE (Status)) { - goto UnlockAndExit; + return (Status); } if (RegisterBit & InByte) @@ -331,10 +331,7 @@ /* Set return value */ (*EventStatus) = LocalEventStatus; - - -UnlockAndExit: - return (Status); + return (AE_OK); } @@ -367,7 +364,7 @@ { /* Disable all GPEs in this register */ - Status = AcpiWrite (0x00, &GpeBlock->RegisterInfo[i].EnableAddress); + Status = AcpiHwWrite (0x00, &GpeBlock->RegisterInfo[i].EnableAddress); if (ACPI_FAILURE (Status)) { return (Status); @@ -407,7 +404,7 @@ { /* Clear status on all GPEs in this register */ - Status = AcpiWrite (0xFF, &GpeBlock->RegisterInfo[i].StatusAddress); + Status = AcpiHwWrite (0xFF, &GpeBlock->RegisterInfo[i].StatusAddress); if (ACPI_FAILURE (Status)) { return (Status); @@ -455,7 +452,7 @@ /* Enable all "runtime" GPEs in this register */ - Status = AcpiWrite (GpeBlock->RegisterInfo[i].EnableForRun, + Status = AcpiHwWrite (GpeBlock->RegisterInfo[i].EnableForRun, &GpeBlock->RegisterInfo[i].EnableAddress); if (ACPI_FAILURE (Status)) { @@ -502,7 +499,7 @@ /* Enable all "wake" GPEs in this register */ - Status = AcpiWrite (GpeBlock->RegisterInfo[i].EnableForWake, + Status = AcpiHwWrite (GpeBlock->RegisterInfo[i].EnableForWake, &GpeBlock->RegisterInfo[i].EnableAddress); if (ACPI_FAILURE (Status)) { Index: sys/contrib/dev/acpica/hardware/hwacpi.c =================================================================== --- sys/contrib/dev/acpica/hardware/hwacpi.c (revision 203510) +++ sys/contrib/dev/acpica/hardware/hwacpi.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/tools/acpiexec/aecommon.h =================================================================== --- sys/contrib/dev/acpica/tools/acpiexec/aecommon.h (revision 203510) +++ sys/contrib/dev/acpica/tools/acpiexec/aecommon.h (working copy) @@ -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 @@ -135,9 +135,18 @@ #include #include -extern FILE *AcpiGbl_DebugFile; -extern BOOLEAN AcpiGbl_IgnoreErrors; +extern FILE *AcpiGbl_DebugFile; +extern BOOLEAN AcpiGbl_IgnoreErrors; +extern UINT8 AcpiGbl_RegionFillValue; + +typedef struct ae_table_desc +{ + ACPI_TABLE_HEADER *Table; + struct ae_table_desc *Next; + +} AE_TABLE_DESC; + /* * Debug Regions */ @@ -170,7 +179,8 @@ ACPI_STATUS AeBuildLocalTables ( - ACPI_TABLE_HEADER *UserTable); + UINT32 TableCount, + AE_TABLE_DESC *TableList); ACPI_STATUS AeInstallTables ( @@ -222,7 +232,7 @@ UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 BitWidth, - ACPI_INTEGER *Value, + UINT64 *Value, void *HandlerContext, void *RegionContext); Index: sys/contrib/dev/acpica/events/evregion.c =================================================================== --- sys/contrib/dev/acpica/events/evregion.c (revision 203510) +++ sys/contrib/dev/acpica/events/evregion.c (working copy) @@ -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, @@ -233,6 +238,57 @@ /******************************************************************************* * + * 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 * * PARAMETERS: None @@ -266,11 +322,16 @@ 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,26 +400,22 @@ * 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[2] = NULL; /* Terminate list */ - Args[0]->Integer.Value = RegionObj->Region.SpaceId; - Args[1]->Integer.Value = Function; - Args[2] = NULL; - /* Execute the method, no return value */ ACPI_DEBUG_EXEC ( @@ -385,7 +442,7 @@ * 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 @@ UINT32 Function, UINT32 RegionOffset, UINT32 BitWidth, - ACPI_INTEGER *Value) + UINT64 *Value) { ACPI_STATUS Status; ACPI_ADR_SPACE_HANDLER Handler; @@ -788,7 +845,7 @@ /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { return (AE_BAD_PARAMETER); @@ -1112,7 +1169,7 @@ * 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 @@ * 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 @@ /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (ObjHandle); + Node = AcpiNsValidateHandle (ObjHandle); if (!Node) { return (AE_BAD_PARAMETER); Index: sys/contrib/dev/acpica/events/evgpeblk.c =================================================================== --- sys/contrib/dev/acpica/events/evgpeblk.c (revision 203510) +++ sys/contrib/dev/acpica/events/evgpeblk.c (working copy) @@ -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 @@ -995,7 +995,7 @@ /* Disable all GPEs within this register */ - Status = AcpiWrite (0x00, &ThisRegister->EnableAddress); + Status = AcpiHwWrite (0x00, &ThisRegister->EnableAddress); if (ACPI_FAILURE (Status)) { goto ErrorExit; @@ -1003,7 +1003,7 @@ /* Clear any pending GPE events within this register */ - Status = AcpiWrite (0xFF, &ThisRegister->StatusAddress); + Status = AcpiHwWrite (0xFF, &ThisRegister->StatusAddress); if (ACPI_FAILURE (Status)) { goto ErrorExit; @@ -1110,7 +1110,7 @@ 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 @@ Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK, - AcpiEvMatchPrwAndGpe, &GpeInfo, NULL); + AcpiEvMatchPrwAndGpe, NULL, &GpeInfo, NULL); } /* Index: sys/contrib/dev/acpica/events/evrgnini.c =================================================================== --- sys/contrib/dev/acpica/events/evrgnini.c (revision 203510) +++ sys/contrib/dev/acpica/events/evrgnini.c (working copy) @@ -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 @@ -127,10 +127,6 @@ /* Local prototypes */ static BOOLEAN -AcpiEvMatchPciRootBridge ( - char *Id); - -static BOOLEAN AcpiEvIsPciRootBridge ( ACPI_NAMESPACE_NODE *Node); @@ -264,7 +260,7 @@ 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; @@ -444,42 +440,6 @@ /******************************************************************************* * - * FUNCTION: AcpiEvMatchPciRootBridge - * - * PARAMETERS: Id - The HID/CID in string format - * - * RETURN: TRUE if the Id is a match for a PCI/PCI-Express Root Bridge - * - * DESCRIPTION: Determine if the input ID is a PCI Root Bridge ID. - * - ******************************************************************************/ - -static BOOLEAN -AcpiEvMatchPciRootBridge ( - char *Id) -{ - - /* - * Check if this is a PCI root. - * ACPI 3.0+: check for a PCI Express root also. - */ - if (!(ACPI_STRNCMP (Id, - PCI_ROOT_HID_STRING, - sizeof (PCI_ROOT_HID_STRING))) || - - !(ACPI_STRNCMP (Id, - PCI_EXPRESS_ROOT_HID_STRING, - sizeof (PCI_EXPRESS_ROOT_HID_STRING)))) - { - return (TRUE); - } - - return (FALSE); -} - - -/******************************************************************************* - * * FUNCTION: AcpiEvIsPciRootBridge * * PARAMETERS: Node - Device node being examined @@ -496,9 +456,10 @@ ACPI_NAMESPACE_NODE *Node) { ACPI_STATUS Status; - ACPI_DEVICE_ID Hid; - ACPI_COMPATIBLE_ID_LIST *Cid; + ACPI_DEVICE_ID *Hid; + ACPI_DEVICE_ID_LIST *Cid; UINT32 i; + BOOLEAN Match; /* Get the _HID and check for a PCI Root Bridge */ @@ -509,7 +470,10 @@ return (FALSE); } - if (AcpiEvMatchPciRootBridge (Hid.Value)) + Match = AcpiUtIsPciRootBridge (Hid->String); + ACPI_FREE (Hid); + + if (Match) { return (TRUE); } @@ -526,7 +490,7 @@ for (i = 0; i < Cid->Count; i++) { - if (AcpiEvMatchPciRootBridge (Cid->Id[i].Value)) + if (AcpiUtIsPciRootBridge (Cid->Ids[i].String)) { ACPI_FREE (Cid); return (TRUE); @@ -752,6 +716,20 @@ 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; Index: sys/contrib/dev/acpica/events/evxface.c =================================================================== --- sys/contrib/dev/acpica/events/evxface.c (revision 203510) +++ sys/contrib/dev/acpica/events/evxface.c (working copy) @@ -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 @@ /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node) { Status = AE_BAD_PARAMETER; @@ -555,7 +555,7 @@ /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node) { Status = AE_BAD_PARAMETER; Index: sys/contrib/dev/acpica/events/evxfregn.c =================================================================== --- sys/contrib/dev/acpica/events/evxfregn.c (revision 203510) +++ sys/contrib/dev/acpica/events/evxfregn.c (working copy) @@ -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 @@ /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node) { Status = AE_BAD_PARAMETER; @@ -244,7 +244,7 @@ /* Convert and validate the device handle */ - Node = AcpiNsMapHandleToNode (Device); + Node = AcpiNsValidateHandle (Device); if (!Node || ((Node->Type != ACPI_TYPE_DEVICE) && (Node->Type != ACPI_TYPE_PROCESSOR) && Index: sys/contrib/dev/acpica/events/evxfevnt.c =================================================================== --- sys/contrib/dev/acpica/events/evxfevnt.c (revision 203510) +++ sys/contrib/dev/acpica/events/evxfevnt.c (working copy) @@ -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 @@ return (Status); } - Node = AcpiNsMapHandleToNode (GpeDevice); + Node = AcpiNsValidateHandle (GpeDevice); if (!Node) { Status = AE_BAD_PARAMETER; @@ -905,7 +905,7 @@ return (Status); } - Node = AcpiNsMapHandleToNode (GpeDevice); + Node = AcpiNsValidateHandle (GpeDevice); if (!Node) { Status = AE_BAD_PARAMETER; Index: sys/contrib/dev/acpica/events/evgpe.c =================================================================== --- sys/contrib/dev/acpica/events/evgpe.c (revision 203510) +++ sys/contrib/dev/acpica/events/evgpe.c (working copy) @@ -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 @@ -543,7 +543,7 @@ /* Read the Status Register */ - Status = AcpiRead (&StatusReg, &GpeRegisterInfo->StatusAddress); + Status = AcpiHwRead (&StatusReg, &GpeRegisterInfo->StatusAddress); if (ACPI_FAILURE (Status)) { goto UnlockAndExit; @@ -551,7 +551,7 @@ /* Read the Enable Register */ - Status = AcpiRead (&EnableReg, &GpeRegisterInfo->EnableAddress); + Status = AcpiHwRead (&EnableReg, &GpeRegisterInfo->EnableAddress); if (ACPI_FAILURE (Status)) { goto UnlockAndExit; Index: sys/contrib/dev/acpica/events/evmisc.c =================================================================== --- sys/contrib/dev/acpica/events/evmisc.c (revision 203510) +++ sys/contrib/dev/acpica/events/evmisc.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/events/evsci.c =================================================================== --- sys/contrib/dev/acpica/events/evsci.c (revision 203510) +++ sys/contrib/dev/acpica/events/evsci.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/events/evevent.c =================================================================== --- sys/contrib/dev/acpica/events/evevent.c (revision 203510) +++ sys/contrib/dev/acpica/events/evevent.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/osunixxf.c =================================================================== --- sys/contrib/dev/acpica/osunixxf.c (revision 203510) +++ sys/contrib/dev/acpica/osunixxf.c (working copy) @@ -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 @@ -871,7 +871,7 @@ void AcpiOsSleep ( - ACPI_INTEGER milliseconds) + UINT64 milliseconds) { sleep (milliseconds / 1000); /* Sleep for whole seconds */ @@ -976,7 +976,7 @@ AcpiOsWritePciConfiguration ( ACPI_PCI_ID *PciId, UINT32 Register, - ACPI_INTEGER Value, + UINT64 Value, UINT32 Width) { Index: sys/contrib/dev/acpica/tables/tbinstal.c =================================================================== --- sys/contrib/dev/acpica/tables/tbinstal.c (revision 203510) +++ sys/contrib/dev/acpica/tables/tbinstal.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/tables/tbfadt.c =================================================================== --- sys/contrib/dev/acpica/tables/tbfadt.c (revision 203510) +++ sys/contrib/dev/acpica/tables/tbfadt.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/tables/tbfind.c =================================================================== --- sys/contrib/dev/acpica/tables/tbfind.c (revision 203510) +++ sys/contrib/dev/acpica/tables/tbfind.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/tables/tbutils.c =================================================================== --- sys/contrib/dev/acpica/tables/tbutils.c (revision 203510) +++ sys/contrib/dev/acpica/tables/tbutils.c (working copy) @@ -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,6 +124,16 @@ /* Local prototypes */ +static void +AcpiTbFixString ( + char *String, + ACPI_SIZE Length); + +static void +AcpiTbCleanupTableHeader ( + ACPI_TABLE_HEADER *OutHeader, + ACPI_TABLE_HEADER *Header); + static ACPI_PHYSICAL_ADDRESS AcpiTbGetRootTableEntry ( UINT8 *TableEntry, @@ -185,6 +195,67 @@ /******************************************************************************* * + * FUNCTION: AcpiTbFixString + * + * PARAMETERS: String - String to be repaired + * Length - Maximum length + * + * RETURN: None + * + * DESCRIPTION: Replace every non-printable or non-ascii byte in the string + * with a question mark '?'. + * + ******************************************************************************/ + +static void +AcpiTbFixString ( + char *String, + ACPI_SIZE Length) +{ + + while (Length && *String) + { + if (!ACPI_IS_PRINT (*String)) + { + *String = '?'; + } + String++; + Length--; + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbCleanupTableHeader + * + * PARAMETERS: OutHeader - Where the cleaned header is returned + * Header - Input ACPI table header + * + * RETURN: Returns the cleaned header in OutHeader + * + * DESCRIPTION: Copy the table header and ensure that all "string" fields in + * the header consist of printable characters. + * + ******************************************************************************/ + +static void +AcpiTbCleanupTableHeader ( + ACPI_TABLE_HEADER *OutHeader, + ACPI_TABLE_HEADER *Header) +{ + + ACPI_MEMCPY (OutHeader, Header, sizeof (ACPI_TABLE_HEADER)); + + AcpiTbFixString (OutHeader->Signature, ACPI_NAME_SIZE); + AcpiTbFixString (OutHeader->OemId, ACPI_OEM_ID_SIZE); + AcpiTbFixString (OutHeader->OemTableId, ACPI_OEM_TABLE_ID_SIZE); + AcpiTbFixString (OutHeader->AslCompilerId, ACPI_NAME_SIZE); +} + + +/******************************************************************************* + * * FUNCTION: AcpiTbPrintTableHeader * * PARAMETERS: Address - Table physical address @@ -201,7 +272,9 @@ ACPI_PHYSICAL_ADDRESS Address, ACPI_TABLE_HEADER *Header) { + ACPI_TABLE_HEADER LocalHeader; + /* * The reason that the Address is cast to a void pointer is so that we * can use %p which will work properly on both 32-bit and 64-bit hosts. @@ -218,23 +291,29 @@ { /* RSDP has no common fields */ + ACPI_MEMCPY (LocalHeader.OemId, + ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->OemId, ACPI_OEM_ID_SIZE); + AcpiTbFixString (LocalHeader.OemId, ACPI_OEM_ID_SIZE); + ACPI_INFO ((AE_INFO, "RSDP %p %05X (v%.2d %6.6s)", ACPI_CAST_PTR (void, Address), (ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision > 0) ? ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Length : 20, ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision, - ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->OemId)); + LocalHeader.OemId)); } else { /* Standard ACPI table with full common header */ + AcpiTbCleanupTableHeader (&LocalHeader, Header); + ACPI_INFO ((AE_INFO, "%4.4s %p %05X (v%.2d %6.6s %8.8s %08X %4.4s %08X)", - Header->Signature, ACPI_CAST_PTR (void, Address), - Header->Length, Header->Revision, Header->OemId, - Header->OemTableId, Header->OemRevision, Header->AslCompilerId, - Header->AslCompilerRevision)); + LocalHeader.Signature, ACPI_CAST_PTR (void, Address), + LocalHeader.Length, LocalHeader.Revision, LocalHeader.OemId, + LocalHeader.OemTableId, LocalHeader.OemRevision, + LocalHeader.AslCompilerId, LocalHeader.AslCompilerRevision)); } } Index: sys/contrib/dev/acpica/tables/tbxfroot.c =================================================================== --- sys/contrib/dev/acpica/tables/tbxfroot.c (revision 203510) +++ sys/contrib/dev/acpica/tables/tbxfroot.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/tables/tbxface.c =================================================================== --- sys/contrib/dev/acpica/tables/tbxface.c (revision 203510) +++ sys/contrib/dev/acpica/tables/tbxface.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/resources/rsaddr.c =================================================================== --- sys/contrib/dev/acpica/resources/rsaddr.c (revision 203510) +++ sys/contrib/dev/acpica/resources/rsaddr.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/resources/rsinfo.c =================================================================== --- sys/contrib/dev/acpica/resources/rsinfo.c (revision 203510) +++ sys/contrib/dev/acpica/resources/rsinfo.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/resources/rsirq.c =================================================================== --- sys/contrib/dev/acpica/resources/rsirq.c (revision 203510) +++ sys/contrib/dev/acpica/resources/rsirq.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/resources/rslist.c =================================================================== --- sys/contrib/dev/acpica/resources/rslist.c (revision 203510) +++ sys/contrib/dev/acpica/resources/rslist.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/resources/rsmisc.c =================================================================== --- sys/contrib/dev/acpica/resources/rsmisc.c (revision 203510) +++ sys/contrib/dev/acpica/resources/rsmisc.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/resources/rsutils.c =================================================================== --- sys/contrib/dev/acpica/resources/rsutils.c (revision 203510) +++ sys/contrib/dev/acpica/resources/rsutils.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/resources/rscalc.c =================================================================== --- sys/contrib/dev/acpica/resources/rscalc.c (revision 203510) +++ sys/contrib/dev/acpica/resources/rscalc.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/resources/rscreate.c =================================================================== --- sys/contrib/dev/acpica/resources/rscreate.c (revision 203510) +++ sys/contrib/dev/acpica/resources/rscreate.c (working copy) @@ -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 @@ /* * 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; Index: sys/contrib/dev/acpica/resources/rsdump.c =================================================================== --- sys/contrib/dev/acpica/resources/rsdump.c (revision 203510) +++ sys/contrib/dev/acpica/resources/rsdump.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/resources/rsxface.c =================================================================== --- sys/contrib/dev/acpica/resources/rsxface.c (revision 203510) +++ sys/contrib/dev/acpica/resources/rsxface.c (working copy) @@ -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 @@ return_ACPI_STATUS (AE_BAD_PARAMETER); } - Node = AcpiNsMapHandleToNode (DeviceHandle); + Node = AcpiNsValidateHandle (DeviceHandle); if (!Node) { return_ACPI_STATUS (AE_BAD_PARAMETER); Index: sys/contrib/dev/acpica/resources/rsio.c =================================================================== --- sys/contrib/dev/acpica/resources/rsio.c (revision 203510) +++ sys/contrib/dev/acpica/resources/rsio.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/resources/rsmemory.c =================================================================== --- sys/contrib/dev/acpica/resources/rsmemory.c (revision 203510) +++ sys/contrib/dev/acpica/resources/rsmemory.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/compiler/asldefine.h =================================================================== --- sys/contrib/dev/acpica/compiler/asldefine.h (revision 203510) +++ sys/contrib/dev/acpica/compiler/asldefine.h (working copy) @@ -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,8 +127,8 @@ #define IntelAcpiCA "Intel ACPI Component Architecture" #define CompilerId "ASL Optimizing Compiler" #define DisassemblerId "AML Disassembler" -#define CompilerCopyright "Copyright (C) 2000 - 2009 Intel Corporation" -#define CompilerCompliance "Supports ACPI Specification Revision 3.0a" +#define CompilerCopyright "Copyright (c) 2000 - 2010 Intel Corporation" +#define CompilerCompliance "Supports ACPI Specification Revision 4.0" #define CompilerName "iasl" #define CompilerCreatorId "INTL" Index: sys/contrib/dev/acpica/compiler/asltree.c =================================================================== --- sys/contrib/dev/acpica/compiler/asltree.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/asltree.c (working copy) @@ -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 @@ ACPI_PARSE_OBJECT * TrCreateValuedLeafNode ( UINT32 ParseOpcode, - ACPI_INTEGER Value) + UINT64 Value) { ACPI_PARSE_OBJECT *Op; Index: sys/contrib/dev/acpica/compiler/aslcompiler.y =================================================================== --- sys/contrib/dev/acpica/compiler/aslcompiler.y (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslcompiler.y (working copy) @@ -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 @@ -400,6 +400,7 @@ %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 @@ -2175,6 +2176,7 @@ | 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 @@ 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 */ Index: sys/contrib/dev/acpica/compiler/aslstubs.c =================================================================== --- sys/contrib/dev/acpica/compiler/aslstubs.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslstubs.c (working copy) @@ -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 @@ -119,6 +119,7 @@ #include #include #include +#include #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslstubs") @@ -136,6 +137,12 @@ return 0; } +void +AcpiNsExecModuleCodeList ( + void) +{ +} + ACPI_STATUS AcpiHwReadPort ( ACPI_IO_ADDRESS Address, Index: sys/contrib/dev/acpica/compiler/aslutils.c =================================================================== --- sys/contrib/dev/acpica/compiler/aslutils.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslutils.c (working copy) @@ -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 @@ UtStrtoul64 ( char *String, UINT32 Base, - ACPI_INTEGER *RetInteger); + UINT64 *RetInteger); static void UtPadNameWithUnderscores ( @@ -846,12 +846,12 @@ * ******************************************************************************/ -ACPI_INTEGER +UINT64 UtDoConstant ( char *String) { ACPI_STATUS Status; - ACPI_INTEGER Converted; + UINT64 Converted; char ErrBuf[64]; @@ -888,11 +888,11 @@ 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 @@ /* Skip over any white space in the buffer: */ - while (isspace (*String) || *String == '\t') + while (isspace ((int) *String) || *String == '\t') { ++String; } @@ -948,7 +948,7 @@ { if (*String == '0') { - if (tolower (*(++String)) == 'x') + if (tolower ((int) *(++String)) == 'x') { Base = 16; ++String; @@ -975,7 +975,7 @@ if (Base == 16 && *String == '0' && - tolower (*(++String)) == 'x') + tolower ((int) *(++String)) == 'x') { String++; } @@ -984,14 +984,14 @@ 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 @@ /* 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; } Index: sys/contrib/dev/acpica/compiler/aslfiles.c =================================================================== --- sys/contrib/dev/acpica/compiler/aslfiles.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslfiles.c (working copy) @@ -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 @@ -128,11 +128,12 @@ char *Filename, char *Mode); -static FILE * -FlOpenLocalFile ( - char *LocalName, - char *Mode); +FILE * +FlOpenIncludeWithPrefix ( + char *PrefixDir, + char *Filename); + #ifdef ACPI_OBSOLETE_FUNCTIONS ACPI_STATUS FlParseInputPathname ( @@ -172,45 +173,6 @@ /******************************************************************************* * - * FUNCTION: FlOpenLocalFile - * - * PARAMETERS: LocalName - Single filename (not a pathname) - * Mode - Open mode for fopen - * - * RETURN: File descriptor - * - * DESCRIPTION: Build a complete pathname for the input filename and open - * the file. - * - ******************************************************************************/ - -static FILE * -FlOpenLocalFile ( - char *LocalName, - char *Mode) -{ - - StringBuffer[0] = 0; - - /* Check for an absolute pathname */ - - if ((LocalName[0] != '/') && /* Forward slash */ - (LocalName[0] != '\\') && /* backslash (Win) */ - (LocalName[1] != ':')) /* Device name (Win) */ - { - /* The include file path is relative, prepend the directory path */ - - strcat (StringBuffer, Gbl_DirectoryPath); - } - strcat (StringBuffer, LocalName); - - DbgPrint (ASL_PARSE_OUTPUT, "FlOpenLocalFile: %s\n", StringBuffer); - return (fopen (StringBuffer, (const char *) Mode)); -} - - -/******************************************************************************* - * * FUNCTION: FlFileError * * PARAMETERS: FileId - Index into file info array @@ -481,6 +443,122 @@ /******************************************************************************* * + * FUNCTION: FlAddIncludeDirectory + * + * PARAMETERS: Dir - Directory pathname string + * + * RETURN: None + * + * DESCRIPTION: Add a directory the list of include prefix directories. + * + ******************************************************************************/ + +void +FlAddIncludeDirectory ( + char *Dir) +{ + ASL_INCLUDE_DIR *NewDir; + ASL_INCLUDE_DIR *NextDir; + ASL_INCLUDE_DIR *PrevDir = NULL; + UINT32 NeedsSeparator = 0; + size_t DirLength; + + + DirLength = strlen (Dir); + if (!DirLength) + { + return; + } + + /* Make sure that the pathname ends with a path separator */ + + if ((Dir[DirLength-1] != '/') && + (Dir[DirLength-1] != '\\')) + { + NeedsSeparator = 1; + } + + NewDir = ACPI_ALLOCATE_ZEROED (sizeof (ASL_INCLUDE_DIR)); + NewDir->Dir = ACPI_ALLOCATE (DirLength + 1 + NeedsSeparator); + strcpy (NewDir->Dir, Dir); + if (NeedsSeparator) + { + strcat (NewDir->Dir, "/"); + } + + /* + * Preserve command line ordering of -I options by adding new elements + * at the end of the list + */ + NextDir = Gbl_IncludeDirList; + while (NextDir) + { + PrevDir = NextDir; + NextDir = NextDir->Next; + } + + if (PrevDir) + { + PrevDir->Next = NewDir; + } + else + { + Gbl_IncludeDirList = NewDir; + } +} + + +/******************************************************************************* + * + * FUNCTION: FlOpenIncludeWithPrefix + * + * PARAMETERS: PrefixDir - Prefix directory pathname. Can be a zero + * length string. + * Filename - The include filename from the source ASL. + * + * RETURN: Valid file descriptor if successful. Null otherwise. + * + * DESCRIPTION: Open an include file and push it on the input file stack. + * + ******************************************************************************/ + +FILE * +FlOpenIncludeWithPrefix ( + char *PrefixDir, + char *Filename) +{ + FILE *IncludeFile; + char *Pathname; + + + /* Build the full pathname to the file */ + + Pathname = ACPI_ALLOCATE (strlen (PrefixDir) + strlen (Filename) + 1); + + strcpy (Pathname, PrefixDir); + strcat (Pathname, Filename); + + DbgPrint (ASL_PARSE_OUTPUT, "\nAttempt to open include file: path %s\n\n", + Pathname); + + /* Attempt to open the file, push if successful */ + + IncludeFile = fopen (Pathname, "r"); + if (IncludeFile) + { + /* Push the include file on the open input file stack */ + + AslPushInputFileStack (IncludeFile, Pathname); + return (IncludeFile); + } + + ACPI_FREE (Pathname); + return (NULL); +} + + +/******************************************************************************* + * * FUNCTION: FlOpenIncludeFile * * PARAMETERS: Op - Parse node for the INCLUDE ASL statement @@ -495,7 +573,8 @@ FlOpenIncludeFile ( ACPI_PARSE_OBJECT *Op) { - FILE *IncFile; + FILE *IncludeFile; + ASL_INCLUDE_DIR *NextDir; /* Op must be valid */ @@ -518,21 +597,58 @@ FlPrintFile (ASL_FILE_SOURCE_OUTPUT, "\n"); Gbl_CurrentLineOffset++; - /* Prepend the directory pathname and open the include file */ - DbgPrint (ASL_PARSE_OUTPUT, "\nOpen include file: path %s\n\n", - Op->Asl.Value.String); - IncFile = FlOpenLocalFile (Op->Asl.Value.String, "r"); - if (!IncFile) + /* Attempt to open the include file */ + + /* If the file specifies an absolute path, just open it */ + + if ((Op->Asl.Value.String[0] == '/') || + (Op->Asl.Value.String[0] == '\\') || + (Op->Asl.Value.String[1] == ':')) { - sprintf (MsgBuffer, "%s (%s)", Op->Asl.Value.String, strerror (errno)); - AslError (ASL_ERROR, ASL_MSG_INCLUDE_FILE_OPEN, Op, MsgBuffer); + IncludeFile = FlOpenIncludeWithPrefix ("", Op->Asl.Value.String); + if (!IncludeFile) + { + goto ErrorExit; + } return; } - /* Push the include file on the open input file stack */ + /* + * The include filename is not an absolute path. + * + * First, search for the file within the "local" directory -- meaning + * the same directory that contains the source file. + * + * Construct the file pathname from the global directory name. + */ + IncludeFile = FlOpenIncludeWithPrefix (Gbl_DirectoryPath, Op->Asl.Value.String); + if (IncludeFile) + { + return; + } - AslPushInputFileStack (IncFile, Op->Asl.Value.String); + /* + * Second, search for the file within the (possibly multiple) directories + * specified by the -I option on the command line. + */ + NextDir = Gbl_IncludeDirList; + while (NextDir) + { + IncludeFile = FlOpenIncludeWithPrefix (NextDir->Dir, Op->Asl.Value.String); + if (IncludeFile) + { + return; + } + + NextDir = NextDir->Next; + } + + /* We could not open the include file after trying very hard */ + +ErrorExit: + sprintf (MsgBuffer, "%s, %s", Op->Asl.Value.String, strerror (errno)); + AslError (ASL_ERROR, ASL_MSG_INCLUDE_FILE_OPEN, Op, MsgBuffer); } Index: sys/contrib/dev/acpica/compiler/aslopt.c =================================================================== --- sys/contrib/dev/acpica/compiler/aslopt.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslopt.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/compiler/aslstartup.c =================================================================== --- sys/contrib/dev/acpica/compiler/aslstartup.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslstartup.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/compiler/aslanalyze.c =================================================================== --- sys/contrib/dev/acpica/compiler/aslanalyze.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslanalyze.c (working copy) @@ -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 @@ { /* 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 @@ */ 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 @@ */ 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; } Index: sys/contrib/dev/acpica/compiler/aslcodegen.c =================================================================== --- sys/contrib/dev/acpica/compiler/aslcodegen.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslcodegen.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/compiler/aslglobal.h =================================================================== --- sys/contrib/dev/acpica/compiler/aslglobal.h (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslglobal.h (working copy) @@ -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 @@ -148,7 +148,7 @@ #define ASL_LINE_BUFFER_SIZE 512 #define ASL_MSG_BUFFER_SIZE 4096 #define HEX_TABLE_LINE_SIZE 8 -#define HEX_LISTING_LINE_SIZE 16 +#define HEX_LISTING_LINE_SIZE 8 /* Source code buffers and pointers for error reporting */ @@ -165,7 +165,6 @@ 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 */ @@ -212,6 +211,7 @@ ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_ExternalFilename, NULL); ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_IncludeFilename, NULL); ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_OutputFilenamePrefix, NULL); +ASL_EXTERN ASL_INCLUDE_DIR ASL_INIT_GLOBAL (*Gbl_IncludeDirList, NULL); ASL_EXTERN char *Gbl_CurrentInputFilename; ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_HasIncludeFiles, FALSE); @@ -277,5 +277,12 @@ 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 */ Index: sys/contrib/dev/acpica/compiler/asllookup.c =================================================================== --- sys/contrib/dev/acpica/compiler/asllookup.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/asllookup.c (working copy) @@ -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 @@ /* 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 @@ 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 @@ /* 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 @@ /* 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); } @@ -1337,6 +1337,7 @@ break; case REGION_SMBUS: + case REGION_IPMI: if ((UINT8) Op->Asl.Parent->Asl.Value.Integer != AML_FIELD_ACCESS_BUFFER) { Index: sys/contrib/dev/acpica/compiler/asllisting.c =================================================================== --- sys/contrib/dev/acpica/compiler/asllisting.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/asllisting.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/compiler/asltypes.h =================================================================== --- sys/contrib/dev/acpica/compiler/asltypes.h (revision 203510) +++ sys/contrib/dev/acpica/compiler/asltypes.h (working copy) @@ -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 @@ -255,6 +255,14 @@ #define ASL_NUM_FILES (ASL_MAX_FILE_TYPE + 1) +typedef struct asl_include_dir +{ + char *Dir; + struct asl_include_dir *Next; + +} ASL_INCLUDE_DIR; + + /* An entry in the exception list, one for each error/warning */ typedef struct asl_error_msg @@ -361,7 +369,8 @@ 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, @@ -480,7 +489,8 @@ /* 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", @@ -561,11 +571,6 @@ #define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings above */ -/* Exception counters */ +#endif /* ASL_EXCEPTIONS */ -UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0}; - -#endif - - #endif /* __ASLTYPES_H */ Index: sys/contrib/dev/acpica/compiler/asltransform.c =================================================================== --- sys/contrib/dev/acpica/compiler/asltransform.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/asltransform.c (working copy) @@ -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 @@ 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 @@ 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 @@ * 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 @@ */ 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 @@ { return; } + TrAmlInitNode (DefaultOp, PARSEOP_ELSE); DefaultOp->Asl.Parent = Conditional->Asl.Parent; @@ -762,7 +761,7 @@ /* 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 @@ { 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 @@ 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); } Index: sys/contrib/dev/acpica/compiler/asloperands.c =================================================================== --- sys/contrib/dev/acpica/compiler/asloperands.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/asloperands.c (working copy) @@ -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 @@ } else { - Op->Asl.Value.Integer = ACPI_INTEGER_MAX; + Op->Asl.Value.Integer = ACPI_UINT64_MAX; } } @@ -788,20 +788,30 @@ 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 @@ 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"); Index: sys/contrib/dev/acpica/compiler/aslrestype1.c =================================================================== --- sys/contrib/dev/acpica/compiler/aslrestype1.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslrestype1.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/compiler/aslmap.c =================================================================== --- sys/contrib/dev/acpica/compiler/aslmap.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslmap.c (working copy) @@ -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,8 @@ * * Name - The ACPI reserved name * Args - Number of arguments to the method - * Flags - Whether this method must return a value or not + * Flags - Whether this method must return a value or not. Or if the + * name is a resource descriptor label. * ******************************************************************************/ @@ -264,24 +265,30 @@ {"_ALP", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ {"_ALR", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ {"_ALT", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ + {"_ART", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_ASI", 0, ASL_RSVD_RESOURCE_NAME}, {"_ASZ", 0, ASL_RSVD_RESOURCE_NAME}, {"_BAS", 0, ASL_RSVD_RESOURCE_NAME}, {"_BBN", 0, ASL_RSVD_RETURN_VALUE}, {"_BCL", 0, ASL_RSVD_RETURN_VALUE}, {"_BCM", 1, 0}, + {"_BCT", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_BDN", 0, ASL_RSVD_RETURN_VALUE}, {"_BFS", 1, 0}, {"_BIF", 0, ASL_RSVD_RETURN_VALUE}, + {"_BIX", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_BLT", 3, 0}, /* Acpi 3.0 */ {"_BM_", 0, ASL_RSVD_RESOURCE_NAME}, + {"_BMA", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_BMC", 1, 0}, /* Acpi 3.0 */ {"_BMD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ + {"_BMS", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_BQC", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ {"_BST", 0, ASL_RSVD_RETURN_VALUE}, {"_BTM", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ {"_BTP", 1, 0}, {"_CBA", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ + {"_CDM", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_CID", 0, ASL_RSVD_RETURN_VALUE}, {"_CRS", 0, ASL_RSVD_RETURN_VALUE}, {"_CRT", 0, ASL_RSVD_RETURN_VALUE}, @@ -300,6 +307,7 @@ {"_DSM", 4, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ {"_DSS", 1, 0}, {"_DSW", 3, 0}, /* Acpi 3.0 */ + {"_DTI", 1, 0}, /* Acpi 4.0 */ {"_EC_", 0, ASL_RSVD_RETURN_VALUE}, {"_EDL", 0, ASL_RSVD_RETURN_VALUE}, {"_EJ0", 1, 0}, @@ -312,7 +320,13 @@ {"_FDE", 0, ASL_RSVD_RETURN_VALUE}, {"_FDI", 0, ASL_RSVD_RETURN_VALUE}, {"_FDM", 1, 0}, + {"_FIF", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_FIX", 0, ASL_RSVD_RETURN_VALUE}, + {"_FPS", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ + {"_FSL", 1, 0}, /* Acpi 4.0 */ + {"_FST", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ + {"_GAI", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ + {"_GHL", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_GL_", 0, ASL_RSVD_RETURN_VALUE}, {"_GLK", 0, ASL_RSVD_RETURN_VALUE}, {"_GPD", 0, ASL_RSVD_RETURN_VALUE}, @@ -338,28 +352,39 @@ {"_MAF", 0, ASL_RSVD_RESOURCE_NAME}, {"_MAT", 0, ASL_RSVD_RETURN_VALUE}, {"_MAX", 0, ASL_RSVD_RESOURCE_NAME}, + {"_MBM", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_MEM", 0, ASL_RSVD_RESOURCE_NAME}, {"_MIF", 0, ASL_RSVD_RESOURCE_NAME}, {"_MIN", 0, ASL_RSVD_RESOURCE_NAME}, {"_MLS", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ {"_MSG", 1, 0}, + {"_MSM", 4, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_MTP", 0, ASL_RSVD_RESOURCE_NAME}, + {"_NTT", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_OFF", 0, 0}, {"_ON_", 0, 0}, {"_OS_", 0, ASL_RSVD_RETURN_VALUE}, {"_OSC", 4, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ {"_OSI", 1, ASL_RSVD_RETURN_VALUE}, {"_OST", 3, 0}, /* Acpi 3.0 */ + {"_PAI", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_PCL", 0, ASL_RSVD_RETURN_VALUE}, {"_PCT", 0, ASL_RSVD_RETURN_VALUE}, {"_PDC", 1, 0}, + {"_PDL", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_PIC", 1, 0}, + {"_PIF", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_PLD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ + {"_PMC", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ + {"_PMD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ + {"_PMM", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_PPC", 0, ASL_RSVD_RETURN_VALUE}, {"_PPE", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ {"_PR0", 0, ASL_RSVD_RETURN_VALUE}, {"_PR1", 0, ASL_RSVD_RETURN_VALUE}, {"_PR2", 0, ASL_RSVD_RETURN_VALUE}, + {"_PR3", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ + {"_PRL", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_PRS", 0, ASL_RSVD_RETURN_VALUE}, {"_PRT", 0, ASL_RSVD_RETURN_VALUE}, {"_PRW", 0, ASL_RSVD_RETURN_VALUE}, @@ -375,7 +400,9 @@ {"_PSV", 0, ASL_RSVD_RETURN_VALUE}, {"_PSW", 1, 0}, {"_PTC", 0, ASL_RSVD_RETURN_VALUE}, + {"_PTP", 2, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_PTS", 1, 0}, + {"_PUR", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_PXM", 0, ASL_RSVD_RETURN_VALUE}, {"_RBO", 0, ASL_RSVD_RESOURCE_NAME}, {"_RBW", 0, ASL_RSVD_RESOURCE_NAME}, @@ -407,6 +434,7 @@ {"_SCP", 0x13, 0}, /* Acpi 1.0 - one arg; Acpi 3.0 - three args */ {"_SDD", 1, 0}, /* Acpi 3.0 */ {"_SEG", 0, ASL_RSVD_RETURN_VALUE}, + {"_SHL", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_SHR", 0, ASL_RSVD_RESOURCE_NAME}, {"_SI_", 0, ASL_RSVD_SCOPE}, {"_SIZ", 0, ASL_RSVD_RESOURCE_NAME}, @@ -417,12 +445,16 @@ {"_SST", 1, 0}, {"_STA", 0, ASL_RSVD_RETURN_VALUE}, {"_STM", 3, 0}, + {"_STP", 2, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_STR", 0, ASL_RSVD_RETURN_VALUE}, + {"_STV", 2, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_SUN", 0, ASL_RSVD_RETURN_VALUE}, {"_SWS", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ {"_TC1", 0, ASL_RSVD_RETURN_VALUE}, {"_TC2", 0, ASL_RSVD_RETURN_VALUE}, {"_TDL", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0b */ + {"_TIP", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ + {"_TIV", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */ {"_TMP", 0, ASL_RSVD_RETURN_VALUE}, {"_TPC", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */ {"_TPT", 1, 0}, /* Acpi 3.0 */ @@ -681,6 +713,7 @@ /* REGIONSPACE_CMOS */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_CMOS, 0, 0), /* REGIONSPACE_EC */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_EC, 0, 0), /* REGIONSPACE_IO */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_IO, 0, 0), +/* REGIONSPACE_IPMI */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_IPMI, 0, 0), /* REGIONSPACE_MEM */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_MEMORY, 0, 0), /* REGIONSPACE_PCI */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_PCI_CONFIG, 0, 0), /* REGIONSPACE_PCIBAR */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_PCI_BAR, 0, 0), Index: sys/contrib/dev/acpica/compiler/aslrestype2.c =================================================================== --- sys/contrib/dev/acpica/compiler/aslrestype2.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslrestype2.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/compiler/aslload.c =================================================================== --- sys/contrib/dev/acpica/compiler/aslload.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslload.c (working copy) @@ -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 @@ -353,6 +353,7 @@ Node->Value = (UINT32) Op->Asl.Value.Integer; Node->Op = Op; + Op->Asl.Node = Node; /* * Now enter the predefined fields, for easy lookup when referenced @@ -533,7 +534,7 @@ if (Op->Asl.CompileFlags == NODE_IS_RESOURCE_DESC) { Status = LdLoadResourceElements (Op, WalkState); - goto Exit; + return_ACPI_STATUS (Status); } ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); @@ -574,8 +575,10 @@ 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 */ @@ -710,15 +713,14 @@ 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); } } @@ -756,8 +758,7 @@ Node->Value = (UINT32) Op->Asl.Extra; } -Exit: - return (Status); + return_ACPI_STATUS (Status); } @@ -884,7 +885,8 @@ return (AE_OK); } - AslCoreSubsystemError (Op, Status, "Failure from lookup\n", FALSE); + AslCoreSubsystemError (Op, Status, + "Failure from namespace lookup", FALSE); return (AE_OK); } Index: sys/contrib/dev/acpica/compiler/aslcompiler.h =================================================================== --- sys/contrib/dev/acpica/compiler/aslcompiler.h (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslcompiler.h (working copy) @@ -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 @@ ACPI_PARSE_OBJECT * TrCreateValuedLeafNode ( UINT32 ParseOpcode, - ACPI_INTEGER Value); + UINT64 Value); ACPI_PARSE_OBJECT * TrLinkChildren ( @@ -556,6 +556,10 @@ void); void +FlAddIncludeDirectory ( + char *Dir); + +void FlOpenIncludeFile ( ACPI_PARSE_OBJECT *Op); @@ -714,7 +718,7 @@ UINT32 LowValue, UINT32 HighValue); -ACPI_INTEGER +UINT64 UtDoConstant ( char *String); Index: sys/contrib/dev/acpica/compiler/asllength.c =================================================================== --- sys/contrib/dev/acpica/compiler/asllength.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/asllength.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/compiler/aslcompiler.l =================================================================== --- sys/contrib/dev/acpica/compiler/aslcompiler.l (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslcompiler.l (working copy) @@ -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 @@ -386,6 +386,7 @@ "SMBus" { count (0); return (PARSEOP_REGIONSPACE_SMBUS); } "SystemCMOS" { count (0); return (PARSEOP_REGIONSPACE_CMOS); } "PciBarTarget" { count (0); return (PARSEOP_REGIONSPACE_PCIBAR); } +"IPMI" { count (0); return (PARSEOP_REGIONSPACE_IPMI); } "FFixedHW" { count (0); return (PARSEOP_ADDRESSSPACE_FFIXEDHW); } Index: sys/contrib/dev/acpica/compiler/aslmain.c =================================================================== --- sys/contrib/dev/acpica/compiler/aslmain.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslmain.c (working copy) @@ -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,7 +150,26 @@ int argc, char **argv); +static int +AslDoOptions ( + int argc, + char **argv, + BOOLEAN IsResponseFile); +static void +AslMergeOptionTokens ( + char *InBuffer, + char *OutBuffer); + +static int +AslDoResponseFile ( + char *Filename); + + +#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:" + + /******************************************************************************* * * FUNCTION: Options @@ -168,8 +187,12 @@ void) { - printf ("General Output:\n"); - printf (" -p Specify path/filename prefix for all output files\n"); + printf ("Global:\n"); + printf (" -@ Specify command file\n"); + printf (" -I Specify additional include directory\n"); + + printf ("\nGeneral Output:\n"); + printf (" -p Specify path/filename prefix for all output files\n"); printf (" -va Disable all errors and warnings (summary only)\n"); printf (" -vi Less verbose errors and warnings for use with IDEs\n"); printf (" -vo Enable optimization comments\n"); @@ -310,39 +333,149 @@ /******************************************************************************* * - * FUNCTION: AslCommandLine + * FUNCTION: AslMergeOptionTokens * - * PARAMETERS: argc/argv + * PARAMETERS: InBuffer - Input containing an option string + * OutBuffer - Merged output buffer * * RETURN: None * - * DESCRIPTION: Command line processing + * DESCRIPTION: Remove all whitespace from an option string. * ******************************************************************************/ +static void +AslMergeOptionTokens ( + char *InBuffer, + char *OutBuffer) +{ + char *Token; + + + *OutBuffer = 0; + + Token = strtok (InBuffer, ASL_TOKEN_SEPARATORS); + while (Token) + { + strcat (OutBuffer, Token); + Token = strtok (NULL, ASL_TOKEN_SEPARATORS); + } +} + + +/******************************************************************************* + * + * FUNCTION: AslDoResponseFile + * + * PARAMETERS: Filename - Name of the response file + * + * RETURN: Status + * + * DESCRIPTION: Open a response file and process all options within. + * + ******************************************************************************/ + static int -AslCommandLine ( - int argc, - char **argv) +AslDoResponseFile ( + char *Filename) { - BOOLEAN BadCommandLine = FALSE; - int j; + char *argv = StringBuffer2; + FILE *ResponseFile; + int OptStatus = 0; + int Opterr; + int Optind; - /* Minimum command line contains at least one option or an input file */ + ResponseFile = fopen (Filename, "r"); + if (!ResponseFile) + { + printf ("Could not open command file %s, %s\n", + Filename, strerror (errno)); + return -1; + } - if (argc < 2) + /* Must save the current GetOpt globals */ + + Opterr = AcpiGbl_Opterr; + Optind = AcpiGbl_Optind; + + /* + * Process all lines in the response file. There must be one complete + * option per line + */ + while (fgets (StringBuffer, ASL_MSG_BUFFER_SIZE, ResponseFile)) { - AslCompilerSignon (ASL_FILE_STDOUT); - Usage (); - exit (1); + /* Compress all tokens, allowing us to use a single argv entry */ + + AslMergeOptionTokens (StringBuffer, StringBuffer2); + + /* Process the option */ + + AcpiGbl_Opterr = 0; + AcpiGbl_Optind = 0; + + OptStatus = AslDoOptions (1, &argv, TRUE); + if (OptStatus) + { + printf ("Invalid option in command file %s: %s\n", + Filename, StringBuffer); + break; + } } + /* Restore the GetOpt globals */ + + AcpiGbl_Opterr = Opterr; + AcpiGbl_Optind = Optind; + + fclose (ResponseFile); + return (OptStatus); +} + + +/******************************************************************************* + * + * FUNCTION: AslDoOptions + * + * PARAMETERS: argc/argv - Standard argc/argv + * IsResponseFile - TRUE if executing a response file. + * + * RETURN: Status + * + * DESCRIPTION: Command line option processing + * + ******************************************************************************/ + +static int +AslDoOptions ( + int argc, + char **argv, + BOOLEAN IsResponseFile) +{ + int j; + + /* Get the command line options */ - while ((j = AcpiGetopt (argc, argv, "2b:cd^e:fgh^i^l^o:p:r:s:t:v:w:x:")) != EOF) switch (j) + while ((j = AcpiGetopt (argc, argv, ASL_SUPPORTED_OPTIONS)) != EOF) switch (j) { + case '@': /* Begin a response file */ + + if (IsResponseFile) + { + printf ("Nested command files are not supported\n"); + return -1; + } + + if (AslDoResponseFile (AcpiGbl_Optarg)) + { + return -1; + } + break; + + case '2': + Gbl_Acpi2 = TRUE; break; @@ -364,8 +497,7 @@ default: printf ("Unknown option: -b%s\n", AcpiGbl_Optarg); - BadCommandLine = TRUE; - break; + return (-1); } /* Produce debug output file */ @@ -394,8 +526,7 @@ default: printf ("Unknown option: -d%s\n", AcpiGbl_Optarg); - BadCommandLine = TRUE; - break; + return (-1); } Gbl_DisasmFlag = TRUE; @@ -444,12 +575,17 @@ default: printf ("Unknown option: -h%s\n", AcpiGbl_Optarg); - BadCommandLine = TRUE; - break; + return (-1); } break; + case 'I': /* Add an include file search directory */ + + FlAddIncludeDirectory (AcpiGbl_Optarg); + break; + + case 'i': switch (AcpiGbl_Optarg[0]) @@ -470,8 +606,7 @@ default: printf ("Unknown option: -s%s\n", AcpiGbl_Optarg); - BadCommandLine = TRUE; - break; + return (-1); } break; @@ -500,8 +635,7 @@ default: printf ("Unknown option: -l%s\n", AcpiGbl_Optarg); - BadCommandLine = TRUE; - break; + return (-1); } break; @@ -549,8 +683,7 @@ default: printf ("Unknown option: -c%s\n", AcpiGbl_Optarg); - BadCommandLine = TRUE; - break; + return (-1); } break; @@ -589,8 +722,7 @@ default: printf ("Unknown option: -s%s\n", AcpiGbl_Optarg); - BadCommandLine = TRUE; - break; + return (-1); } break; @@ -611,8 +743,7 @@ default: printf ("Unknown option: -t%s\n", AcpiGbl_Optarg); - BadCommandLine = TRUE; - break; + return (-1); } break; @@ -647,8 +778,7 @@ default: printf ("Unknown option: -v%s\n", AcpiGbl_Optarg); - BadCommandLine = TRUE; - break; + return (-1); } break; @@ -671,8 +801,7 @@ default: printf ("Unknown option: -w%s\n", AcpiGbl_Optarg); - BadCommandLine = TRUE; - break; + return (-1); } break; @@ -685,10 +814,46 @@ default: - BadCommandLine = TRUE; - break; + return (-1); } + return (0); +} + + +/******************************************************************************* + * + * FUNCTION: AslCommandLine + * + * PARAMETERS: argc/argv + * + * RETURN: Last argv index + * + * DESCRIPTION: Command line processing + * + ******************************************************************************/ + +static int +AslCommandLine ( + int argc, + char **argv) +{ + int BadCommandLine = 0; + + + /* Minimum command line contains at least the command and an input file */ + + if (argc < 2) + { + AslCompilerSignon (ASL_FILE_STDOUT); + Usage (); + exit (1); + } + + /* Process all command line options */ + + BadCommandLine = AslDoOptions (argc, argv, FALSE); + /* Next parameter must be the input filename */ if (!argv[AcpiGbl_Optind] && Index: sys/contrib/dev/acpica/compiler/aslfold.c =================================================================== --- sys/contrib/dev/acpica/compiler/aslfold.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslfold.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/compiler/aslresource.c =================================================================== --- sys/contrib/dev/acpica/compiler/aslresource.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslresource.c (working copy) @@ -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 @@ { 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); } Index: sys/contrib/dev/acpica/compiler/aslcompile.c =================================================================== --- sys/contrib/dev/acpica/compiler/aslcompile.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslcompile.c (working copy) @@ -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 @@ 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 @@ 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 @@ 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); } Index: sys/contrib/dev/acpica/compiler/aslerror.c =================================================================== --- sys/contrib/dev/acpica/compiler/aslerror.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslerror.c (working copy) @@ -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,22 +169,18 @@ ASL_ERROR_MSG *Prev; - if (!Gbl_ErrorLog) - { - Gbl_ErrorLog = Enode; - return; - } + /* If Gbl_ErrorLog is null, this is the first error node */ - /* List is sorted according to line number */ - if (!Gbl_ErrorLog) { Gbl_ErrorLog = Enode; 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 @@ Gbl_NextError = Gbl_ErrorLog; CmDoOutputFiles (); CmCleanupAndExit (); + exit(1); } return; Index: sys/contrib/dev/acpica/compiler/aslopcodes.c =================================================================== --- sys/contrib/dev/acpica/compiler/aslopcodes.c (revision 203510) +++ sys/contrib/dev/acpica/compiler/aslopcodes.c (working copy) @@ -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 @@ } break; - case ACPI_INTEGER_MAX: + case ACPI_UINT64_MAX: /* Check for table integer width (32 or 64) */ @@ -568,7 +568,7 @@ if (i < 3) { - if (!isupper (InString[i])) + if (!isupper ((int) InString[i])) { Status = AE_BAD_PARAMETER; } @@ -576,7 +576,7 @@ /* 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 @@ } else { - if (!isxdigit (InString[i])) + if (!isxdigit ((int) InString[i])) { Status = AE_BAD_PARAMETER; } Index: sys/contrib/dev/acpica/utilities/utxface.c =================================================================== --- sys/contrib/dev/acpica/utilities/utxface.c (revision 203510) +++ sys/contrib/dev/acpica/utilities/utxface.c (working copy) @@ -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 @@ -360,6 +360,16 @@ } /* + * Execute any module-level code that was detected during the table load + * phase. Although illegal since ACPI 2.0, there are many machines that + * contain this type of code. Each block of detected executable AML code + * outside of any control method is wrapped with a temporary control + * method object and placed on a global list. The methods on this list + * are executed below. + */ + AcpiNsExecModuleCodeList (); + + /* * Initialize the objects that remain uninitialized. This runs the * executable AML that may be part of the declaration of these objects: * OperationRegions, BufferFields, Buffers, and Packages. @@ -437,7 +447,7 @@ * * RETURN: Status * - * DESCRIPTION: Shutdown the ACPI subsystem. Release all resources. + * DESCRIPTION: Shutdown the ACPICA subsystem and release all resources. * ******************************************************************************/ @@ -451,15 +461,28 @@ ACPI_FUNCTION_TRACE (AcpiTerminate); + /* Just exit if subsystem is already shutdown */ + + if (AcpiGbl_Shutdown) + { + ACPI_ERROR ((AE_INFO, "ACPI Subsystem is already terminated")); + return_ACPI_STATUS (AE_OK); + } + + /* Subsystem appears active, go ahead and shut it down */ + + AcpiGbl_Shutdown = TRUE; + AcpiGbl_StartupFlags = 0; + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Shutting down ACPI Subsystem\n")); + /* Terminate the AML Debugger if present */ - ACPI_DEBUGGER_EXEC(AcpiGbl_DbTerminateThreads = TRUE); + ACPI_DEBUGGER_EXEC (AcpiGbl_DbTerminateThreads = TRUE); /* Shutdown and free all resources */ AcpiUtSubsystemShutdown (); - /* Free the mutex objects */ AcpiUtMutexTerminate (); @@ -480,8 +503,8 @@ ACPI_EXPORT_SYMBOL (AcpiTerminate) + #ifndef ACPI_ASL_COMPILER - /******************************************************************************* * * FUNCTION: AcpiSubsystemStatus Index: sys/contrib/dev/acpica/utilities/utdebug.c =================================================================== --- sys/contrib/dev/acpica/utilities/utdebug.c (revision 203510) +++ sys/contrib/dev/acpica/utilities/utdebug.c (working copy) @@ -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 @@ const char *FunctionName, const char *ModuleName, UINT32 ComponentId, - ACPI_INTEGER Value) + UINT64 Value) { AcpiDebugPrint (ACPI_LV_FUNCTIONS, Index: sys/contrib/dev/acpica/utilities/uteval.c =================================================================== --- sys/contrib/dev/acpica/utilities/uteval.c (revision 203510) +++ sys/contrib/dev/acpica/utilities/uteval.c (working copy) @@ -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,32 +118,18 @@ #include #include #include -#include #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("uteval") -/* Local prototypes */ -static void -AcpiUtCopyIdString ( - char *Destination, - char *Source, - ACPI_SIZE MaxLength); - -static ACPI_STATUS -AcpiUtTranslateOneCid ( - ACPI_OPERAND_OBJECT *ObjDesc, - ACPI_COMPATIBLE_ID *OneCid); - - /* * Strings supported by the _OSI predefined (internal) method. * * March 2009: Removed "Linux" as this host no longer wants to respond true * for this string. Basically, the only safe OS strings are windows-related - * and in many or most cases represent the only test path within the + * and in many or most cases represent the only test path within the * BIOS-provided ASL code. * * The second element of each entry is used to track the newest version of @@ -160,6 +146,9 @@ {"Windows 2001 SP2", ACPI_OSI_WIN_XP_SP2}, /* Windows XP SP2 */ {"Windows 2001.1 SP1", ACPI_OSI_WINSRV_2003_SP1}, /* Windows Server 2003 SP1 - Added 03/2006 */ {"Windows 2006", ACPI_OSI_WIN_VISTA}, /* Windows Vista - Added 03/2006 */ + {"Windows 2006.1", ACPI_OSI_WINSRV_2008}, /* Windows Server 2008 - Added 09/2009 */ + {"Windows 2006 SP1", ACPI_OSI_WIN_VISTA_SP1}, /* Windows Vista SP1 - Added 09/2009 */ + {"Windows 2009", ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */ /* Feature Group Strings */ @@ -280,7 +269,7 @@ * RETURN: Status * * DESCRIPTION: Evaluates a namespace object and verifies the type of the - * return object. Common code that simplifies accessing objects + * return object. Common code that simplifies accessing objects * that have required return objects of fixed types. * * NOTE: Internal function, no parameter validation @@ -376,7 +365,7 @@ (!ExpectedReturnBtypes)) { /* - * We received a return object, but one was not expected. This can + * We received a return object, but one was not expected. This can * happen frequently if the "implicit return" feature is enabled. * Just delete the return object and return AE_OK. */ @@ -419,12 +408,12 @@ * * PARAMETERS: ObjectName - Object name to be evaluated * DeviceNode - Node for the device - * Address - Where the value is returned + * Value - Where the value is returned * * RETURN: Status * * DESCRIPTION: Evaluates a numeric namespace object for a selected device - * and stores result in *Address. + * and stores result in *Value. * * NOTE: Internal function, no parameter validation * @@ -434,7 +423,7 @@ AcpiUtEvaluateNumericObject ( char *ObjectName, ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_INTEGER *Address) + UINT64 *Value) { ACPI_OPERAND_OBJECT *ObjDesc; ACPI_STATUS Status; @@ -452,7 +441,7 @@ /* Get the returned Integer */ - *Address = ObjDesc->Integer.Value; + *Value = ObjDesc->Integer.Value; /* On exit, we must delete the return object */ @@ -463,325 +452,6 @@ /******************************************************************************* * - * FUNCTION: AcpiUtCopyIdString - * - * PARAMETERS: Destination - Where to copy the string - * Source - Source string - * MaxLength - Length of the destination buffer - * - * RETURN: None - * - * DESCRIPTION: Copies an ID string for the _HID, _CID, and _UID methods. - * Performs removal of a leading asterisk if present -- workaround - * for a known issue on a bunch of machines. - * - ******************************************************************************/ - -static void -AcpiUtCopyIdString ( - char *Destination, - char *Source, - ACPI_SIZE MaxLength) -{ - - /* - * Workaround for ID strings that have a leading asterisk. This construct - * is not allowed by the ACPI specification (ID strings must be - * alphanumeric), but enough existing machines have this embedded in their - * ID strings that the following code is useful. - */ - if (*Source == '*') - { - Source++; - } - - /* Do the actual copy */ - - ACPI_STRNCPY (Destination, Source, MaxLength); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiUtExecute_HID - * - * PARAMETERS: DeviceNode - Node for the device - * Hid - Where the HID is returned - * - * RETURN: Status - * - * DESCRIPTION: Executes the _HID control method that returns the hardware - * ID of the device. - * - * NOTE: Internal function, no parameter validation - * - ******************************************************************************/ - -ACPI_STATUS -AcpiUtExecute_HID ( - ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID *Hid) -{ - ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_STATUS Status; - - - ACPI_FUNCTION_TRACE (UtExecute_HID); - - - Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__HID, - ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER) - { - /* Convert the Numeric HID to string */ - - AcpiExEisaIdToString ((UINT32) ObjDesc->Integer.Value, Hid->Value); - } - else - { - /* Copy the String HID from the returned object */ - - AcpiUtCopyIdString (Hid->Value, ObjDesc->String.Pointer, - sizeof (Hid->Value)); - } - - /* On exit, we must delete the return object */ - - AcpiUtRemoveReference (ObjDesc); - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiUtTranslateOneCid - * - * PARAMETERS: ObjDesc - _CID object, must be integer or string - * OneCid - Where the CID string is returned - * - * RETURN: Status - * - * DESCRIPTION: Return a numeric or string _CID value as a string. - * (Compatible ID) - * - * NOTE: Assumes a maximum _CID string length of - * ACPI_MAX_CID_LENGTH. - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiUtTranslateOneCid ( - ACPI_OPERAND_OBJECT *ObjDesc, - ACPI_COMPATIBLE_ID *OneCid) -{ - - - switch (ObjDesc->Common.Type) - { - case ACPI_TYPE_INTEGER: - - /* Convert the Numeric CID to string */ - - AcpiExEisaIdToString ((UINT32) ObjDesc->Integer.Value, OneCid->Value); - return (AE_OK); - - case ACPI_TYPE_STRING: - - if (ObjDesc->String.Length > ACPI_MAX_CID_LENGTH) - { - return (AE_AML_STRING_LIMIT); - } - - /* Copy the String CID from the returned object */ - - AcpiUtCopyIdString (OneCid->Value, ObjDesc->String.Pointer, - ACPI_MAX_CID_LENGTH); - return (AE_OK); - - default: - - return (AE_TYPE); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiUtExecute_CID - * - * PARAMETERS: DeviceNode - Node for the device - * ReturnCidList - Where the CID list is returned - * - * RETURN: Status - * - * DESCRIPTION: Executes the _CID control method that returns one or more - * compatible hardware IDs for the device. - * - * NOTE: Internal function, no parameter validation - * - ******************************************************************************/ - -ACPI_STATUS -AcpiUtExecute_CID ( - ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_COMPATIBLE_ID_LIST **ReturnCidList) -{ - ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_STATUS Status; - UINT32 Count; - UINT32 Size; - ACPI_COMPATIBLE_ID_LIST *CidList; - UINT32 i; - - - ACPI_FUNCTION_TRACE (UtExecute_CID); - - - /* Evaluate the _CID method for this device */ - - Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__CID, - ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_PACKAGE, - &ObjDesc); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* Get the number of _CIDs returned */ - - Count = 1; - if (ObjDesc->Common.Type == ACPI_TYPE_PACKAGE) - { - Count = ObjDesc->Package.Count; - } - - /* Allocate a worst-case buffer for the _CIDs */ - - Size = (((Count - 1) * sizeof (ACPI_COMPATIBLE_ID)) + - sizeof (ACPI_COMPATIBLE_ID_LIST)); - - CidList = ACPI_ALLOCATE_ZEROED ((ACPI_SIZE) Size); - if (!CidList) - { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - /* Init CID list */ - - CidList->Count = Count; - CidList->Size = Size; - - /* - * A _CID can return either a single compatible ID or a package of - * compatible IDs. Each compatible ID can be one of the following: - * 1) Integer (32 bit compressed EISA ID) or - * 2) String (PCI ID format, e.g. "PCI\VEN_vvvv&DEV_dddd&SUBSYS_ssssssss") - */ - - /* The _CID object can be either a single CID or a package (list) of CIDs */ - - if (ObjDesc->Common.Type == ACPI_TYPE_PACKAGE) - { - /* Translate each package element */ - - for (i = 0; i < Count; i++) - { - Status = AcpiUtTranslateOneCid (ObjDesc->Package.Elements[i], - &CidList->Id[i]); - if (ACPI_FAILURE (Status)) - { - break; - } - } - } - else - { - /* Only one CID, translate to a string */ - - Status = AcpiUtTranslateOneCid (ObjDesc, CidList->Id); - } - - /* Cleanup on error */ - - if (ACPI_FAILURE (Status)) - { - ACPI_FREE (CidList); - } - else - { - *ReturnCidList = CidList; - } - - /* On exit, we must delete the _CID return object */ - - AcpiUtRemoveReference (ObjDesc); - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiUtExecute_UID - * - * PARAMETERS: DeviceNode - Node for the device - * Uid - Where the UID is returned - * - * RETURN: Status - * - * DESCRIPTION: Executes the _UID control method that returns the hardware - * ID of the device. - * - * NOTE: Internal function, no parameter validation - * - ******************************************************************************/ - -ACPI_STATUS -AcpiUtExecute_UID ( - ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID *Uid) -{ - ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_STATUS Status; - - - ACPI_FUNCTION_TRACE (UtExecute_UID); - - - Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__UID, - ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER) - { - /* Convert the Numeric UID to string */ - - AcpiExUnsignedIntegerToString (ObjDesc->Integer.Value, Uid->Value); - } - else - { - /* Copy the String UID from the returned object */ - - AcpiUtCopyIdString (Uid->Value, ObjDesc->String.Pointer, - sizeof (Uid->Value)); - } - - /* On exit, we must delete the return object */ - - AcpiUtRemoveReference (ObjDesc); - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * * FUNCTION: AcpiUtExecute_STA * * PARAMETERS: DeviceNode - Node for the device @@ -838,63 +508,68 @@ /******************************************************************************* * - * FUNCTION: AcpiUtExecute_Sxds + * FUNCTION: AcpiUtExecutePowerMethods * * PARAMETERS: DeviceNode - Node for the device - * Flags - Where the status flags are returned + * MethodNames - Array of power method names + * MethodCount - Number of methods to execute + * OutValues - Where the power method values are returned * - * RETURN: Status + * RETURN: Status, OutValues * - * DESCRIPTION: Executes _STA for selected device and stores results in - * *Flags. + * DESCRIPTION: Executes the specified power methods for the device and returns + * the result(s). * * NOTE: Internal function, no parameter validation * ******************************************************************************/ ACPI_STATUS -AcpiUtExecute_Sxds ( +AcpiUtExecutePowerMethods ( ACPI_NAMESPACE_NODE *DeviceNode, - UINT8 *Highest) + const char **MethodNames, + UINT8 MethodCount, + UINT8 *OutValues) { ACPI_OPERAND_OBJECT *ObjDesc; ACPI_STATUS Status; + ACPI_STATUS FinalStatus = AE_NOT_FOUND; UINT32 i; - ACPI_FUNCTION_TRACE (UtExecute_Sxds); + ACPI_FUNCTION_TRACE (UtExecutePowerMethods); - for (i = 0; i < 4; i++) + for (i = 0; i < MethodCount; i++) { - Highest[i] = 0xFF; + /* + * Execute the power method (_SxD or _SxW). The only allowable + * return type is an Integer. + */ Status = AcpiUtEvaluateObject (DeviceNode, - ACPI_CAST_PTR (char, AcpiGbl_HighestDstateNames[i]), + ACPI_CAST_PTR (char, MethodNames[i]), ACPI_BTYPE_INTEGER, &ObjDesc); - if (ACPI_FAILURE (Status)) + if (ACPI_SUCCESS (Status)) { - if (Status != AE_NOT_FOUND) - { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "%s on Device %4.4s, %s\n", - ACPI_CAST_PTR (char, AcpiGbl_HighestDstateNames[i]), - AcpiUtGetNodeName (DeviceNode), - AcpiFormatException (Status))); + OutValues[i] = (UINT8) ObjDesc->Integer.Value; - return_ACPI_STATUS (Status); - } - } - else - { - /* Extract the Dstate value */ - - Highest[i] = (UINT8) ObjDesc->Integer.Value; - /* Delete the return object */ AcpiUtRemoveReference (ObjDesc); + FinalStatus = AE_OK; /* At least one value is valid */ + continue; } + + OutValues[i] = ACPI_UINT8_MAX; + if (Status == AE_NOT_FOUND) + { + continue; /* Ignore if not found */ + } + + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Failed %s on Device %4.4s, %s\n", + ACPI_CAST_PTR (char, MethodNames[i]), + AcpiUtGetNodeName (DeviceNode), AcpiFormatException (Status))); } - return_ACPI_STATUS (AE_OK); + return_ACPI_STATUS (FinalStatus); } Index: sys/contrib/dev/acpica/utilities/utlock.c =================================================================== --- sys/contrib/dev/acpica/utilities/utlock.c (revision 203510) +++ sys/contrib/dev/acpica/utilities/utlock.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/utilities/utmath.c =================================================================== --- sys/contrib/dev/acpica/utilities/utmath.c (revision 203510) +++ sys/contrib/dev/acpica/utilities/utmath.c (working copy) @@ -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 @@ 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 @@ * 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 @@ ACPI_STATUS AcpiUtShortDivide ( - ACPI_INTEGER InDividend, + UINT64 InDividend, UINT32 Divisor, - ACPI_INTEGER *OutQuotient, + UINT64 *OutQuotient, UINT32 *OutRemainder) { @@ -395,10 +395,10 @@ 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); Index: sys/contrib/dev/acpica/utilities/utalloc.c =================================================================== --- sys/contrib/dev/acpica/utilities/utalloc.c (revision 203510) +++ sys/contrib/dev/acpica/utilities/utalloc.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/utilities/utmisc.c =================================================================== --- sys/contrib/dev/acpica/utilities/utmisc.c (revision 203510) +++ sys/contrib/dev/acpica/utilities/utmisc.c (working copy) @@ -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,7 +124,13 @@ #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("utmisc") +/* + * Common suffix for messages + */ +#define ACPI_COMMON_MSG_SUFFIX \ + AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber) + /******************************************************************************* * * FUNCTION: AcpiUtValidateException @@ -207,6 +213,40 @@ /******************************************************************************* * + * FUNCTION: AcpiUtIsPciRootBridge + * + * PARAMETERS: Id - The HID/CID in string format + * + * RETURN: TRUE if the Id is a match for a PCI/PCI-Express Root Bridge + * + * DESCRIPTION: Determine if the input ID is a PCI Root Bridge ID. + * + ******************************************************************************/ + +BOOLEAN +AcpiUtIsPciRootBridge ( + char *Id) +{ + + /* + * Check if this is a PCI root bridge. + * ACPI 3.0+: check for a PCI Express root also. + */ + if (!(ACPI_STRCMP (Id, + PCI_ROOT_HID_STRING)) || + + !(ACPI_STRCMP (Id, + PCI_EXPRESS_ROOT_HID_STRING))) + { + return (TRUE); + } + + return (FALSE); +} + + +/******************************************************************************* + * * FUNCTION: AcpiUtIsAmlTable * * PARAMETERS: Table - An ACPI table @@ -889,12 +929,12 @@ 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; @@ -1031,7 +1071,7 @@ /* Divide the digit into the correct position */ - (void) AcpiUtShortDivide ((Dividend - (ACPI_INTEGER) ThisDigit), + (void) AcpiUtShortDivide ((Dividend - (UINT64) ThisDigit), Base, &Quotient, NULL); if (ReturnValue > Quotient) @@ -1283,7 +1323,7 @@ va_start (args, Format); AcpiOsVprintf (Format, args); - AcpiOsPrintf (" %8.8X %s-%u\n", ACPI_CA_VERSION, ModuleName, LineNumber); + ACPI_COMMON_MSG_SUFFIX; va_end (args); } @@ -1302,7 +1342,7 @@ va_start (args, Format); AcpiOsVprintf (Format, args); - AcpiOsPrintf (" %8.8X %s-%u\n", ACPI_CA_VERSION, ModuleName, LineNumber); + ACPI_COMMON_MSG_SUFFIX; va_end (args); } @@ -1320,7 +1360,7 @@ va_start (args, Format); AcpiOsVprintf (Format, args); - AcpiOsPrintf (" %8.8X %s-%u\n", ACPI_CA_VERSION, ModuleName, LineNumber); + ACPI_COMMON_MSG_SUFFIX; va_end (args); } @@ -1353,3 +1393,98 @@ ACPI_EXPORT_SYMBOL (AcpiInfo) +/******************************************************************************* + * + * FUNCTION: AcpiUtPredefinedWarning + * + * 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: Warnings 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 error + * messages for methods that are repeatedly evaluated. + * + ******************************************************************************/ + +void ACPI_INTERNAL_VAR_XFACE +AcpiUtPredefinedWarning ( + 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 Warning for %s: ", Pathname); + + va_start (args, Format); + AcpiOsVprintf (Format, args); + 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); +} Index: sys/contrib/dev/acpica/utilities/utglobal.c =================================================================== --- sys/contrib/dev/acpica/utilities/utglobal.c (revision 203510) +++ sys/contrib/dev/acpica/utilities/utglobal.c (working copy) @@ -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 @@ -172,8 +172,17 @@ "\\_S5_" }; -const char *AcpiGbl_HighestDstateNames[4] = +const char *AcpiGbl_LowestDstateNames[ACPI_NUM_SxW_METHODS] = { + "_S0W", + "_S1W", + "_S2W", + "_S3W", + "_S4W" +}; + +const char *AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS] = +{ "_S1D", "_S2D", "_S3D", @@ -322,7 +331,7 @@ char AcpiUtHexToAsciiChar ( - ACPI_INTEGER Integer, + UINT64 Integer, UINT32 Position) { @@ -398,6 +407,7 @@ "SMBus", "SystemCMOS", "PCIBARTarget", + "IPMI", "DataTable" }; @@ -928,6 +938,7 @@ /* Namespace */ + AcpiGbl_ModuleCodeList = NULL; AcpiGbl_RootNode = NULL; AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME; AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED; @@ -938,6 +949,10 @@ 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 Index: sys/contrib/dev/acpica/utilities/utdelete.c =================================================================== --- sys/contrib/dev/acpica/utilities/utdelete.c (revision 203510) +++ sys/contrib/dev/acpica/utilities/utdelete.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/utilities/utmutex.c =================================================================== --- sys/contrib/dev/acpica/utilities/utmutex.c (revision 203510) +++ sys/contrib/dev/acpica/utilities/utmutex.c (working copy) @@ -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 @@ AcpiUtCreateMutex ( ACPI_MUTEX_HANDLE MutexId); -static ACPI_STATUS +static void AcpiUtDeleteMutex ( ACPI_MUTEX_HANDLE MutexId); @@ -216,7 +216,7 @@ for (i = 0; i < ACPI_NUM_MUTEX; i++) { - (void) AcpiUtDeleteMutex (i); + AcpiUtDeleteMutex (i); } /* Delete the spinlocks */ @@ -253,11 +253,6 @@ 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 @@ * ******************************************************************************/ -static ACPI_STATUS +static void AcpiUtDeleteMutex ( ACPI_MUTEX_HANDLE MutexId) { @@ -289,17 +284,10 @@ 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); } Index: sys/contrib/dev/acpica/utilities/utcache.c =================================================================== --- sys/contrib/dev/acpica/utilities/utcache.c (revision 203510) +++ sys/contrib/dev/acpica/utilities/utcache.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/utilities/utinit.c =================================================================== --- sys/contrib/dev/acpica/utilities/utinit.c (revision 203510) +++ sys/contrib/dev/acpica/utilities/utinit.c (working copy) @@ -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 @@ -184,12 +184,12 @@ * * FUNCTION: AcpiUtSubsystemShutdown * - * PARAMETERS: none + * PARAMETERS: None * - * RETURN: none + * RETURN: None * - * DESCRIPTION: Shutdown the various subsystems. Don't delete the mutex - * objects here -- because the AML debugger may be still running. + * DESCRIPTION: Shutdown the various components. Do not delete the mutex + * objects here, because the AML debugger may be still running. * ******************************************************************************/ @@ -197,25 +197,9 @@ AcpiUtSubsystemShutdown ( void) { - ACPI_FUNCTION_TRACE (UtSubsystemShutdown); - /* Just exit if subsystem is already shutdown */ - if (AcpiGbl_Shutdown) - { - ACPI_ERROR ((AE_INFO, - "ACPI Subsystem is already terminated")); - return_VOID; - } - - /* Subsystem appears active, go ahead and shut it down */ - - AcpiGbl_Shutdown = TRUE; - AcpiGbl_StartupFlags = 0; - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Shutting down ACPI Subsystem\n")); - #ifndef ACPI_ASL_COMPILER /* Close the AcpiEvent Handling */ Index: sys/contrib/dev/acpica/utilities/uttrack.c =================================================================== --- sys/contrib/dev/acpica/utilities/uttrack.c (revision 203510) +++ sys/contrib/dev/acpica/utilities/uttrack.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/utilities/utobject.c =================================================================== --- sys/contrib/dev/acpica/utilities/utobject.c (revision 203510) +++ sys/contrib/dev/acpica/utilities/utobject.c (working copy) @@ -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 @@ -281,6 +281,41 @@ /******************************************************************************* * + * 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 * * PARAMETERS: BufferSize - Size of buffer to be created Index: sys/contrib/dev/acpica/utilities/utcopy.c =================================================================== --- sys/contrib/dev/acpica/utilities/utcopy.c (revision 203510) +++ sys/contrib/dev/acpica/utilities/utcopy.c (working copy) @@ -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 @@ * 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 @@ * 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 @@ * 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 @@ * * 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 @@ * * 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 @@ * * 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 * Index: sys/contrib/dev/acpica/utilities/utresrc.c =================================================================== --- sys/contrib/dev/acpica/utilities/utresrc.c (revision 203510) +++ sys/contrib/dev/acpica/utilities/utresrc.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/utilities/utids.c =================================================================== --- sys/contrib/dev/acpica/utilities/utids.c (revision 203505) +++ sys/contrib/dev/acpica/utilities/utids.c (working copy) @@ -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 @@ -115,9 +115,9 @@ #define __UTIDS_C__ -#include "acpi.h" -#include "accommon.h" -#include "acinterp.h" +#include +#include +#include #define _COMPONENT ACPI_UTILITIES Index: sys/contrib/dev/acpica/utilities/utstate.c =================================================================== --- sys/contrib/dev/acpica/utilities/utstate.c (revision 203510) +++ sys/contrib/dev/acpica/utilities/utstate.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/disassembler/dmresrc.c =================================================================== --- sys/contrib/dev/acpica/disassembler/dmresrc.c (revision 203510) +++ sys/contrib/dev/acpica/disassembler/dmresrc.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/disassembler/dmwalk.c =================================================================== --- sys/contrib/dev/acpica/disassembler/dmwalk.c (revision 203510) +++ sys/contrib/dev/acpica/disassembler/dmwalk.c (working copy) @@ -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,72 +159,9 @@ 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]); -} - - -/******************************************************************************* - * * FUNCTION: AcpiDmDisassemble * * PARAMETERS: WalkState - Current state @@ -522,7 +470,6 @@ 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 @@ /* 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); } } Index: sys/contrib/dev/acpica/disassembler/dmutils.c =================================================================== --- sys/contrib/dev/acpica/disassembler/dmutils.c (revision 203510) +++ sys/contrib/dev/acpica/disassembler/dmutils.c (working copy) @@ -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,123 +199,8 @@ }; -#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 * * PARAMETERS: Attribute - Attribute field of AccessAs keyword Index: sys/contrib/dev/acpica/disassembler/dmresrcs.c =================================================================== --- sys/contrib/dev/acpica/disassembler/dmresrcs.c (revision 203510) +++ sys/contrib/dev/acpica/disassembler/dmresrcs.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/disassembler/dmnames.c =================================================================== --- sys/contrib/dev/acpica/disassembler/dmnames.c (revision 203510) +++ sys/contrib/dev/acpica/disassembler/dmnames.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/disassembler/dmobject.c =================================================================== --- sys/contrib/dev/acpica/disassembler/dmobject.c (revision 203510) +++ sys/contrib/dev/acpica/disassembler/dmobject.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/disassembler/dmbuffer.c =================================================================== --- sys/contrib/dev/acpica/disassembler/dmbuffer.c (revision 203510) +++ sys/contrib/dev/acpica/disassembler/dmbuffer.c (working copy) @@ -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 Index: sys/contrib/dev/acpica/disassembler/dmopcode.c =================================================================== --- sys/contrib/dev/acpica/disassembler/dmopcode.c (revision 203510) +++ sys/contrib/dev/acpica/disassembler/dmopcode.c (working copy) @@ -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 @@ 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; Index: sys/contrib/dev/acpica/disassembler/dmresrcl.c =================================================================== --- sys/contrib/dev/acpica/disassembler/dmresrcl.c (revision 203510) +++ sys/contrib/dev/acpica/disassembler/dmresrcl.c (working copy) @@ -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 Property changes on: sys/cddl/contrib/opensolaris ___________________________________________________________________ Modified: svn:mergeinfo Merged /head/sys/cddl/contrib/opensolaris:r197104-197105,197107,197688,198237,199337-199338,200553-200554,202771,202773 Property changes on: sys/amd64/include/xen ___________________________________________________________________ Modified: svn:mergeinfo Merged /head/sys/amd64/include/xen:r197104-197105,197107,197688,198237,199337-199338,200553-200554,202771,202773