summaryrefslogtreecommitdiffstats
path: root/sys/contrib
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-04-04 10:17:51 +0000
committerdim <dim@FreeBSD.org>2015-04-04 10:17:51 +0000
commit441da571d47ec226c5c1799fe6e9dad14931a813 (patch)
tree03ae73b5fa8cee569039a08677ba8f5db4c7032b /sys/contrib
parenta66c38928305566ab81042d4242432a649ec767f (diff)
downloadFreeBSD-src-441da571d47ec226c5c1799fe6e9dad14931a813.zip
FreeBSD-src-441da571d47ec226c5c1799fe6e9dad14931a813.tar.gz
MFC r272444 (by jkim):
Merge ACPICA 20140926. MFC r278970 (by jkim): Merge ACPICA 20141107 and 20150204. Approved by: jkim Relnotes: yes
Diffstat (limited to 'sys/contrib')
-rwxr-xr-xsys/contrib/dev/acpica/acpica_prep.sh11
-rw-r--r--sys/contrib/dev/acpica/changes.txt1136
-rw-r--r--sys/contrib/dev/acpica/common/acgetline.c440
-rw-r--r--sys/contrib/dev/acpica/common/adfile.c31
-rw-r--r--sys/contrib/dev/acpica/common/adisasm.c272
-rw-r--r--sys/contrib/dev/acpica/common/adwalk.c96
-rw-r--r--sys/contrib/dev/acpica/common/ahids.c240
-rw-r--r--sys/contrib/dev/acpica/common/ahpredef.c39
-rw-r--r--sys/contrib/dev/acpica/common/ahuuids.c132
-rw-r--r--sys/contrib/dev/acpica/common/cmfsize.c113
-rw-r--r--sys/contrib/dev/acpica/common/dmextern.c718
-rw-r--r--sys/contrib/dev/acpica/common/dmrestag.c3
-rw-r--r--sys/contrib/dev/acpica/common/dmtable.c151
-rw-r--r--sys/contrib/dev/acpica/common/dmtbdump.c396
-rw-r--r--sys/contrib/dev/acpica/common/dmtbinfo.c282
-rw-r--r--sys/contrib/dev/acpica/common/getopt.c16
-rw-r--r--sys/contrib/dev/acpica/compiler/aslanalyze.c51
-rw-r--r--sys/contrib/dev/acpica/compiler/aslascii.c349
-rw-r--r--sys/contrib/dev/acpica/compiler/aslbtypes.c11
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcodegen.c30
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcompile.c757
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcompiler.h221
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcompiler.l104
-rw-r--r--sys/contrib/dev/acpica/compiler/asldefine.h14
-rw-r--r--sys/contrib/dev/acpica/compiler/aslerror.c225
-rw-r--r--sys/contrib/dev/acpica/compiler/aslfileio.c63
-rw-r--r--sys/contrib/dev/acpica/compiler/aslfiles.c45
-rw-r--r--sys/contrib/dev/acpica/compiler/aslfold.c3
-rw-r--r--sys/contrib/dev/acpica/compiler/aslglobal.h54
-rw-r--r--sys/contrib/dev/acpica/compiler/aslhex.c3
-rw-r--r--sys/contrib/dev/acpica/compiler/asllength.c3
-rw-r--r--sys/contrib/dev/acpica/compiler/asllisting.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/asllistsup.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslload.c35
-rw-r--r--sys/contrib/dev/acpica/compiler/asllookup.c59
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmain.c135
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmap.c35
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmapenter.c346
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmapoutput.c642
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmaputils.c402
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmessages.c409
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmessages.h273
-rw-r--r--sys/contrib/dev/acpica/compiler/aslmethod.c52
-rw-r--r--sys/contrib/dev/acpica/compiler/aslnamesp.c3
-rw-r--r--sys/contrib/dev/acpica/compiler/asloffset.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/aslopcodes.c786
-rw-r--r--sys/contrib/dev/acpica/compiler/asloperands.c10
-rw-r--r--sys/contrib/dev/acpica/compiler/aslopt.c22
-rw-r--r--sys/contrib/dev/acpica/compiler/asloptions.c87
-rw-r--r--sys/contrib/dev/acpica/compiler/aslparser.y131
-rw-r--r--sys/contrib/dev/acpica/compiler/aslpredef.c12
-rw-r--r--sys/contrib/dev/acpica/compiler/aslprepkg.c73
-rw-r--r--sys/contrib/dev/acpica/compiler/aslprintf.c380
-rw-r--r--sys/contrib/dev/acpica/compiler/aslprune.c239
-rw-r--r--sys/contrib/dev/acpica/compiler/aslresource.c181
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype1.c105
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype1i.c83
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2.c44
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2d.c54
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2e.c57
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2q.c54
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2s.c82
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrestype2w.c54
-rw-r--r--sys/contrib/dev/acpica/compiler/aslrules.y (renamed from sys/contrib/dev/acpica/compiler/aslcompiler.y)1065
-rw-r--r--sys/contrib/dev/acpica/compiler/aslstartup.c195
-rw-r--r--sys/contrib/dev/acpica/compiler/aslstubs.c29
-rw-r--r--sys/contrib/dev/acpica/compiler/aslsupport.l121
-rw-r--r--sys/contrib/dev/acpica/compiler/aslsupport.y120
-rw-r--r--sys/contrib/dev/acpica/compiler/asltokens.y468
-rw-r--r--sys/contrib/dev/acpica/compiler/asltransform.c13
-rw-r--r--sys/contrib/dev/acpica/compiler/asltree.c221
-rw-r--r--sys/contrib/dev/acpica/compiler/asltypes.h51
-rw-r--r--sys/contrib/dev/acpica/compiler/asltypes.y393
-rw-r--r--sys/contrib/dev/acpica/compiler/aslutils.c125
-rw-r--r--sys/contrib/dev/acpica/compiler/asluuid.c76
-rw-r--r--sys/contrib/dev/acpica/compiler/aslwalks.c14
-rw-r--r--sys/contrib/dev/acpica/compiler/aslxref.c238
-rw-r--r--sys/contrib/dev/acpica/compiler/dtcompile.c27
-rw-r--r--sys/contrib/dev/acpica/compiler/dtcompiler.h57
-rw-r--r--sys/contrib/dev/acpica/compiler/dtexpress.c4
-rw-r--r--sys/contrib/dev/acpica/compiler/dtfield.c43
-rw-r--r--sys/contrib/dev/acpica/compiler/dtio.c32
-rw-r--r--sys/contrib/dev/acpica/compiler/dtparser.l2
-rw-r--r--sys/contrib/dev/acpica/compiler/dtparser.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/dtsubtable.c10
-rw-r--r--sys/contrib/dev/acpica/compiler/dttable.c478
-rw-r--r--sys/contrib/dev/acpica/compiler/dttemplate.c9
-rw-r--r--sys/contrib/dev/acpica/compiler/dttemplate.h196
-rw-r--r--sys/contrib/dev/acpica/compiler/dtutils.c190
-rw-r--r--sys/contrib/dev/acpica/compiler/preprocess.h4
-rw-r--r--sys/contrib/dev/acpica/compiler/prexpress.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/prmacros.c15
-rw-r--r--sys/contrib/dev/acpica/compiler/prparser.l2
-rw-r--r--sys/contrib/dev/acpica/compiler/prparser.y2
-rw-r--r--sys/contrib/dev/acpica/compiler/prscan.c2
-rw-r--r--sys/contrib/dev/acpica/compiler/prutils.c13
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbcmds.c59
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbconvert.c59
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbdisply.c19
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbexec.c47
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbfileio.c323
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbhistry.c38
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbinput.c53
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbmethod.c209
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbnames.c23
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbstats.c5
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbtest.c1138
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbutils.c3
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbxface.c7
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmbuffer.c538
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmcstyle.c773
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmdeferred.c3
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmnames.c3
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmobject.c3
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmopcode.c244
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmresrc.c12
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmresrcl.c43
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c93
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmresrcs.c35
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmutils.c18
-rw-r--r--sys/contrib/dev/acpica/components/disassembler/dmwalk.c93
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsargs.c4
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dscontrol.c4
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsfield.c8
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsinit.c65
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsmethod.c160
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c4
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsobject.c4
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsopcode.c4
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dsutils.c20
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dswexec.c7
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dswload.c23
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dswload2.c4
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dswscope.c4
-rw-r--r--sys/contrib/dev/acpica/components/dispatcher/dswstate.c5
-rw-r--r--sys/contrib/dev/acpica/components/events/evevent.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evglock.c2
-rw-r--r--sys/contrib/dev/acpica/components/events/evgpe.c195
-rw-r--r--sys/contrib/dev/acpica/components/events/evgpeblk.c42
-rw-r--r--sys/contrib/dev/acpica/components/events/evgpeinit.c23
-rw-r--r--sys/contrib/dev/acpica/components/events/evgpeutil.c85
-rw-r--r--sys/contrib/dev/acpica/components/events/evhandler.c5
-rw-r--r--sys/contrib/dev/acpica/components/events/evmisc.c4
-rw-r--r--sys/contrib/dev/acpica/components/events/evregion.c63
-rw-r--r--sys/contrib/dev/acpica/components/events/evrgnini.c5
-rw-r--r--sys/contrib/dev/acpica/components/events/evsci.c4
-rw-r--r--sys/contrib/dev/acpica/components/events/evxface.c203
-rw-r--r--sys/contrib/dev/acpica/components/events/evxfevnt.c46
-rw-r--r--sys/contrib/dev/acpica/components/events/evxfgpe.c166
-rw-r--r--sys/contrib/dev/acpica/components/events/evxfregn.c4
-rw-r--r--sys/contrib/dev/acpica/components/executer/exconfig.c83
-rw-r--r--sys/contrib/dev/acpica/components/executer/exconvrt.c5
-rw-r--r--sys/contrib/dev/acpica/components/executer/excreate.c4
-rw-r--r--sys/contrib/dev/acpica/components/executer/exdebug.c15
-rw-r--r--sys/contrib/dev/acpica/components/executer/exdump.c229
-rw-r--r--sys/contrib/dev/acpica/components/executer/exfield.c174
-rw-r--r--sys/contrib/dev/acpica/components/executer/exfldio.c5
-rw-r--r--sys/contrib/dev/acpica/components/executer/exmisc.c4
-rw-r--r--sys/contrib/dev/acpica/components/executer/exmutex.c4
-rw-r--r--sys/contrib/dev/acpica/components/executer/exnames.c4
-rw-r--r--sys/contrib/dev/acpica/components/executer/exoparg1.c4
-rw-r--r--sys/contrib/dev/acpica/components/executer/exoparg2.c5
-rw-r--r--sys/contrib/dev/acpica/components/executer/exoparg3.c4
-rw-r--r--sys/contrib/dev/acpica/components/executer/exoparg6.c4
-rw-r--r--sys/contrib/dev/acpica/components/executer/exprep.c6
-rw-r--r--sys/contrib/dev/acpica/components/executer/exregion.c5
-rw-r--r--sys/contrib/dev/acpica/components/executer/exresnte.c8
-rw-r--r--sys/contrib/dev/acpica/components/executer/exresolv.c4
-rw-r--r--sys/contrib/dev/acpica/components/executer/exresop.c4
-rw-r--r--sys/contrib/dev/acpica/components/executer/exstore.c172
-rw-r--r--sys/contrib/dev/acpica/components/executer/exstoren.c4
-rw-r--r--sys/contrib/dev/acpica/components/executer/exstorob.c4
-rw-r--r--sys/contrib/dev/acpica/components/executer/exsystem.c16
-rw-r--r--sys/contrib/dev/acpica/components/executer/exutils.c94
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwacpi.c4
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwesleep.c2
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwgpe.c84
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwpci.c17
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwregs.c12
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwsleep.c16
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwtimer.c4
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwvalid.c4
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwxface.c12
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwxfsleep.c4
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsaccess.c4
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsalloc.c24
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsarguments.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsconvert.c4
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsdump.c11
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsdumpdv.c4
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nseval.c4
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsinit.c10
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsload.c8
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsnames.c4
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsobject.c24
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsparse.c4
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nspredef.c2
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsprepkg.c82
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsrepair.c29
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsrepair2.c42
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nssearch.c4
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsutils.c22
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nswalk.c5
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsxfeval.c23
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsxfname.c4
-rw-r--r--sys/contrib/dev/acpica/components/namespace/nsxfobj.c5
-rw-r--r--sys/contrib/dev/acpica/components/parser/psargs.c4
-rw-r--r--sys/contrib/dev/acpica/components/parser/psloop.c8
-rw-r--r--sys/contrib/dev/acpica/components/parser/psobject.c10
-rw-r--r--sys/contrib/dev/acpica/components/parser/psopcode.c3
-rw-r--r--sys/contrib/dev/acpica/components/parser/psopinfo.c55
-rw-r--r--sys/contrib/dev/acpica/components/parser/psparse.c3
-rw-r--r--sys/contrib/dev/acpica/components/parser/psscope.c3
-rw-r--r--sys/contrib/dev/acpica/components/parser/pstree.c5
-rw-r--r--sys/contrib/dev/acpica/components/parser/psutils.c3
-rw-r--r--sys/contrib/dev/acpica/components/parser/pswalk.c3
-rw-r--r--sys/contrib/dev/acpica/components/parser/psxface.c4
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsaddr.c4
-rw-r--r--sys/contrib/dev/acpica/components/resources/rscalc.c12
-rw-r--r--sys/contrib/dev/acpica/components/resources/rscreate.c61
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsdump.c7
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsdumpinfo.c7
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsinfo.c6
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsio.c4
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsirq.c4
-rw-r--r--sys/contrib/dev/acpica/components/resources/rslist.c4
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsmemory.c4
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsmisc.c4
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsserial.c4
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsutils.c7
-rw-r--r--sys/contrib/dev/acpica/components/resources/rsxface.c5
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbdata.c853
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbfadt.c367
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbfind.c6
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbinstal.c892
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbprint.c23
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbutils.c230
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbxface.c14
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbxfload.c98
-rw-r--r--sys/contrib/dev/acpica/components/tables/tbxfroot.c41
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utaddress.c18
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utalloc.c145
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utbuffer.c139
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utcache.c16
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utcopy.c17
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utdebug.c68
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utdecode.c114
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utdelete.c20
-rw-r--r--sys/contrib/dev/acpica/components/utilities/uterror.c4
-rw-r--r--sys/contrib/dev/acpica/components/utilities/uteval.c4
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utexcep.c5
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utfileio.c361
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utglobal.c193
-rw-r--r--sys/contrib/dev/acpica/components/utilities/uthex.c111
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utids.c4
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utinit.c161
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utlock.c4
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utmath.c5
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utmisc.c5
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utmutex.c5
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utobject.c6
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utosi.c33
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utownerid.c5
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utpredef.c4
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utprint.c811
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utresrc.c13
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utstate.c5
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utstring.c85
-rw-r--r--sys/contrib/dev/acpica/components/utilities/uttrack.c36
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utuuid.c101
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utxface.c11
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utxferror.c8
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utxfinit.c36
-rw-r--r--sys/contrib/dev/acpica/components/utilities/utxfmutex.c4
-rw-r--r--sys/contrib/dev/acpica/include/acapps.h25
-rw-r--r--sys/contrib/dev/acpica/include/acbuffer.h16
-rw-r--r--sys/contrib/dev/acpica/include/accommon.h2
-rw-r--r--sys/contrib/dev/acpica/include/acconfig.h25
-rw-r--r--sys/contrib/dev/acpica/include/acdebug.h16
-rw-r--r--sys/contrib/dev/acpica/include/acdisasm.h102
-rw-r--r--sys/contrib/dev/acpica/include/acdispat.h17
-rw-r--r--sys/contrib/dev/acpica/include/acevents.h16
-rw-r--r--sys/contrib/dev/acpica/include/acexcep.h2
-rw-r--r--sys/contrib/dev/acpica/include/acglobal.h425
-rw-r--r--sys/contrib/dev/acpica/include/achware.h2
-rw-r--r--sys/contrib/dev/acpica/include/acinterp.h14
-rw-r--r--sys/contrib/dev/acpica/include/aclocal.h53
-rw-r--r--sys/contrib/dev/acpica/include/acmacros.h42
-rw-r--r--sys/contrib/dev/acpica/include/acnames.h33
-rw-r--r--sys/contrib/dev/acpica/include/acnamesp.h2
-rw-r--r--sys/contrib/dev/acpica/include/acobject.h6
-rw-r--r--sys/contrib/dev/acpica/include/acopcode.h2
-rw-r--r--sys/contrib/dev/acpica/include/acoutput.h2
-rw-r--r--sys/contrib/dev/acpica/include/acparser.h3
-rw-r--r--sys/contrib/dev/acpica/include/acpi.h3
-rw-r--r--sys/contrib/dev/acpica/include/acpiosxf.h169
-rw-r--r--sys/contrib/dev/acpica/include/acpixf.h600
-rw-r--r--sys/contrib/dev/acpica/include/acpredef.h29
-rw-r--r--sys/contrib/dev/acpica/include/acresrc.h7
-rw-r--r--sys/contrib/dev/acpica/include/acrestyp.h2
-rw-r--r--sys/contrib/dev/acpica/include/acstruct.h5
-rw-r--r--sys/contrib/dev/acpica/include/actables.h97
-rw-r--r--sys/contrib/dev/acpica/include/actbl.h28
-rw-r--r--sys/contrib/dev/acpica/include/actbl1.h113
-rw-r--r--sys/contrib/dev/acpica/include/actbl2.h119
-rw-r--r--sys/contrib/dev/acpica/include/actbl3.h154
-rw-r--r--sys/contrib/dev/acpica/include/actypes.h142
-rw-r--r--sys/contrib/dev/acpica/include/acutils.h142
-rw-r--r--sys/contrib/dev/acpica/include/amlcode.h2
-rw-r--r--sys/contrib/dev/acpica/include/amlresrc.h56
-rw-r--r--sys/contrib/dev/acpica/include/platform/acenv.h73
-rw-r--r--sys/contrib/dev/acpica/include/platform/acenvex.h63
-rw-r--r--sys/contrib/dev/acpica/include/platform/acfreebsd.h2
-rw-r--r--sys/contrib/dev/acpica/include/platform/acgcc.h15
-rw-r--r--sys/contrib/dev/acpica/os_specific/service_layers/oslibcfs.c255
-rw-r--r--sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c236
316 files changed, 22338 insertions, 7520 deletions
diff --git a/sys/contrib/dev/acpica/acpica_prep.sh b/sys/contrib/dev/acpica/acpica_prep.sh
index 4a467a1..f4fdfb1 100755
--- a/sys/contrib/dev/acpica/acpica_prep.sh
+++ b/sys/contrib/dev/acpica/acpica_prep.sh
@@ -19,9 +19,10 @@ fulldirs="common compiler components include os_specific"
# files to remove
stripdirs="generate libraries tests tools"
stripfiles="Makefile README accygwin.h acefi.h achaiku.h acintel.h \
- aclinux.h acmacosx.h acmsvc.h acnetbsd.h acos2.h acwin.h \
- acwin64.h new_table.txt osfreebsdtbl.c oslinuxtbl.c osunixdir.c \
- osunixmap.c oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c"
+ aclinux.h aclinuxex.h acmacosx.h acmsvc.h acnetbsd.h acos2.h \
+ acwin.h acwin64.h new_table.txt osefitbl.c osefixf.c \
+ osfreebsdtbl.c oslinuxtbl.c osunixdir.c osunixmap.c oswindir.c \
+ oswintbl.c oswinxf.c readme.txt utclib.c"
# include files to canonify
src_headers="acapps.h acbuffer.h accommon.h acconfig.h acdebug.h \
@@ -30,8 +31,8 @@ src_headers="acapps.h acbuffer.h accommon.h acconfig.h acdebug.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 actbl2.h actbl3.h actypes.h acutils.h amlcode.h \
- amlresrc.h platform/acenv.h platform/acfreebsd.h \
- platform/acgcc.h"
+ amlresrc.h platform/acenv.h platform/acenvex.h \
+ platform/acfreebsd.h platform/acgcc.h"
comp_headers="aslcompiler.h asldefine.h aslglobal.h aslmessages.h \
aslsupport.l asltypes.h dtcompiler.h dttemplate.h preprocess.h"
platform_headers="acfreebsd.h acgcc.h"
diff --git a/sys/contrib/dev/acpica/changes.txt b/sys/contrib/dev/acpica/changes.txt
index ab43358..0469af0 100644
--- a/sys/contrib/dev/acpica/changes.txt
+++ b/sys/contrib/dev/acpica/changes.txt
@@ -1,4 +1,1140 @@
----------------------------------------
+04 February 2015. Summary of changes for version 20150204:
+
+This release is available at https://acpica.org/downloads
+
+ACPICA kernel-resident subsystem:
+
+Updated all ACPICA copyrights and signons to 2014. Added the 2014
+copyright to all module headers and signons, including the standard Linux
+header. This affects virtually every file in the ACPICA core subsystem,
+iASL compiler, all ACPICA utilities, and the test suites.
+
+Events: Introduce ACPI_GPE_DISPATCH_RAW_HANDLER to fix GPE storm issues.
+A raw gpe handling mechanism was created to allow better handling of GPE
+storms that aren't easily managed by the normal handler. The raw handler
+allows disabling/renabling of the the GPE so that interrupt storms can be
+avoided in cases where events cannot be timely serviced. In this scenario,
+handlers should use the AcpiSetGpe() API to disable/enable the GPE. This API
+will leave the reference counts undisturbed, thereby preventing unintentional
+clearing of the GPE when the intent in only to temporarily disable it. Raw
+handlers allow enabling and disabling of a GPE by removing GPE register
+locking. As such, raw handlers much provide their own locks while using
+GPE API's to protect access to GPE data structures.
+Lv Zheng
+
+Events: Always modify GPE registers under the GPE lock.
+Applies GPE lock around AcpiFinishGpe() to protect access to GPE register
+values. Reported as bug by joe.liu@apple.com.
+
+Unix makefiles: Separate option to disable optimizations and _FORTIFY_SOURCE.
+This change removes the _FORTIFY_SOURCE flag from the NOOPT disable option and
+creates a separate flag (NOFORTIFY) for this purpose. Some toolchains may
+define _FORTIFY_SOURCE which leads redefined errors when building ACPICA. This
+allows disabling the option without also having to disable optimazations.
+David Box
+
+ Current Release:
+ Non-Debug Version: 101.7K Code, 27.9K Data, 129.6K Total
+ Debug Version: 199.2K Code, 82.4K Data, 281.6K Total
+
+----------------------------------------
+07 November 2014. Summary of changes for version 20141107:
+
+This release is available at https://acpica.org/downloads
+
+This release introduces and implements language extensions to ASL that
+provide support for symbolic ("C-style") operators and expressions. These
+language extensions are known collectively as ASL+.
+
+
+1) iASL Compiler/Disassembler and Tools:
+
+Disassembler: Fixed a problem with disassembly of the UartSerialBus
+macro. Changed "StopBitsNone" to the correct "StopBitsZero". David E.
+Box.
+
+Disassembler: Fixed the Unicode macro support to add escape sequences.
+All non-printable ASCII values are emitted as escape sequences, as well
+as the standard escapes for quote and backslash. Ensures that the
+disassembled macro can be correctly recompiled.
+
+iASL: Added Printf/Fprintf macros for formatted output. These macros are
+translated to existing AML Concatenate and Store operations. Printf
+writes to the ASL Debug object. Fprintf allows the specification of an
+ASL name as the target. Only a single format specifier is required, %o,
+since the AML interpreter dynamically converts objects to the required
+type. David E. Box.
+
+ (old) Store (Concatenate (Concatenate (Concatenate (Concatenate
+ (Concatenate (Concatenate (Concatenate ("", Arg0),
+ ": Unexpected value for "), Arg1), ", "), Arg2),
+ " at line "), Arg3), Debug)
+
+ (new) Printf ("%o: Unexpected value for %o, %o at line %o",
+ Arg0, Arg1, Arg2, Arg3)
+
+ (old) Store (Concatenate (Concatenate (Concatenate (Concatenate
+ ("", Arg1), ": "), Arg0), " Successful"), STR1)
+
+ (new) Fprintf (STR1, "%o: %o Successful", Arg1, Arg0)
+
+iASL: Added debug options (-bp, -bt) to dynamically prune levels of the
+ASL parse tree before the AML code is generated. This allows blocks of
+ASL code to be removed in order to help locate and identify problem
+devices and/or code. David E. Box.
+
+AcpiExec: Added support (-fi) for an optional namespace object
+initialization file. This file specifies initial values for namespace
+objects as necessary for debugging and testing different ASL code paths
+that may be taken as a result of BIOS options.
+
+
+2) Overview of symbolic operator support for ASL (ASL+)
+-------------------------------------------------------
+
+As an extension to the ASL language, iASL implements support for symbolic
+(C-style) operators for math and logical expressions. This can greatly
+simplify ASL code as well as improve both readability and
+maintainability. These language extensions can exist concurrently with
+all legacy ASL code and expressions.
+
+The symbolic extensions are 100% compatible with existing AML
+interpreters, since no new AML opcodes are created. To implement the
+extensions, the iASL compiler transforms the symbolic expressions into
+the legacy ASL/AML equivalents at compile time.
+
+Full symbolic expressions are supported, along with the standard C
+precedence and associativity rules.
+
+Full disassembler support for the symbolic expressions is provided, and
+creates an automatic migration path for existing ASL code to ASL+ code
+via the disassembly process. By default, the disassembler now emits ASL+
+code with symbolic expressions. An option (-dl) is provided to force the
+disassembler to emit legacy ASL code if desired.
+
+Below is the complete list of the currently supported symbolic operators
+with examples. See the iASL User Guide for additional information.
+
+
+ASL+ Syntax Legacy ASL Equivalent
+----------- ---------------------
+
+ // Math operators
+
+Z = X + Y Add (X, Y, Z)
+Z = X - Y Subtract (X, Y, Z)
+Z = X * Y Multiply (X, Y, Z)
+Z = X / Y Divide (X, Y, , Z)
+Z = X % Y Mod (X, Y, Z)
+Z = X << Y ShiftLeft (X, Y, Z)
+Z = X >> Y ShiftRight (X, Y, Z)
+Z = X & Y And (X, Y, Z)
+Z = X | Y Or (X, Y, Z)
+Z = X ^ Y Xor (X, Y, Z)
+Z = ~X Not (X, Z)
+X++ Increment (X)
+X-- Decrement (X)
+
+ // Logical operators
+
+(X == Y) LEqual (X, Y)
+(X != Y) LNotEqual (X, Y)
+(X < Y) LLess (X, Y)
+(X > Y) LGreater (X, Y)
+(X <= Y) LLessEqual (X, Y)
+(X >= Y) LGreaterEqual (X, Y)
+(X && Y) LAnd (X, Y)
+(X || Y) LOr (X, Y)
+(!X) LNot (X)
+
+ // Assignment and compound assignment operations
+
+X = Y Store (Y, X)
+X += Y Add (X, Y, X)
+X -= Y Subtract (X, Y, X)
+X *= Y Multiply (X, Y, X)
+X /= Y Divide (X, Y, , X)
+X %= Y Mod (X, Y, X)
+X <<= Y ShiftLeft (X, Y, X)
+X >>= Y ShiftRight (X, Y, X)
+X &= Y And (X, Y, X)
+X |= Y Or (X, Y, X)
+X ^= Y Xor (X, Y, X)
+
+
+3) ASL+ Examples:
+-----------------
+
+Legacy ASL:
+ If (LOr (LOr (LEqual (And (R510, 0x03FB), 0x02E0), LEqual (
+ And (R520, 0x03FB), 0x02E0)), LOr (LEqual (And (R530,
+0x03FB),
+ 0x02E0), LEqual (And (R540, 0x03FB), 0x02E0))))
+ {
+ And (MEMB, 0xFFFFFFF0, SRMB)
+ Store (MEMB, Local2)
+ Store (PDBM, Local1)
+ And (PDBM, 0xFFFFFFFFFFFFFFF9, PDBM)
+ Store (SRMB, MEMB)
+ Or (PDBM, 0x02, PDBM)
+ }
+
+ASL+ version:
+ If (((R510 & 0x03FB) == 0x02E0) ||
+ ((R520 & 0x03FB) == 0x02E0) ||
+ ((R530 & 0x03FB) == 0x02E0) ||
+ ((R540 & 0x03FB) == 0x02E0))
+ {
+ SRMB = (MEMB & 0xFFFFFFF0)
+ Local2 = MEMB
+ Local1 = PDBM
+ PDBM &= 0xFFFFFFFFFFFFFFF9
+ MEMB = SRMB
+ PDBM |= 0x02
+ }
+
+Legacy ASL:
+ Store (0x1234, Local1)
+ Multiply (Add (Add (Local1, TEST), 0x20), Local2, Local3)
+ Multiply (Local2, Add (Add (Local1, TEST), 0x20), Local3)
+ Add (Local1, Add (TEST, Multiply (0x20, Local2)), Local3)
+ Store (Index (PKG1, 0x03), Local6)
+ Store (Add (Local3, Local2), Debug)
+ Add (Local1, 0x0F, Local2)
+ Add (Local1, Multiply (Local2, Local3), Local2)
+ Multiply (Add (Add (Local1, TEST), 0x20), ToBCD (Local1), Local3)
+
+ASL+ version:
+ Local1 = 0x1234
+ Local3 = (((Local1 + TEST) + 0x20) * Local2)
+ Local3 = (Local2 * ((Local1 + TEST) + 0x20))
+ Local3 = (Local1 + (TEST + (0x20 * Local2)))
+ Local6 = Index (PKG1, 0x03)
+ Debug = (Local3 + Local2)
+ Local2 = (Local1 + 0x0F)
+ Local2 = (Local1 + (Local2 * Local3))
+ Local3 = (((Local1 + TEST) + 0x20) * ToBCD (Local1))
+
+
+----------------------------------------
+26 September 2014. Summary of changes for version 20140926:
+
+1) ACPICA kernel-resident subsystem:
+
+Updated the GPIO operation region handler interface (GeneralPurposeIo).
+In order to support GPIO Connection objects with multiple pins, along
+with the related Field objects, the following changes to the interface
+have been made: The Address is now defined to be the offset in bits of
+the field unit from the previous invocation of a Connection. It can be
+viewed as a "Pin Number Index" into the connection resource descriptor.
+The BitWidth is the exact bit width of the field. It is usually one bit,
+but not always. See the ACPICA reference guide (section 8.8.6.2.1) for
+additional information and examples.
+
+GPE support: During ACPICA/GPE initialization, ensure that all GPEs with
+corresponding _Lxx/_Exx methods are disabled (they may have been enabled
+by the firmware), so that they cannot fire until they are enabled via
+AcpiUpdateAllGpes. Rafael J. Wysocki.
+
+Added a new return flag for the Event/GPE status interfaces --
+AcpiGetEventStatus and AcpiGetGpeStatus. The new
+ACPI_EVENT_FLAGS_HAS_HANDLER flag is used to indicate that the event or
+GPE currently has a handler associated with it, and can thus actually
+affect the system. Lv Zheng.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.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.
+
+ Current Release:
+ Non-Debug Version: 99.1K Code, 27.3K Data, 126.4K Total
+ Debug Version: 192.8K Code, 79.9K Data, 272.7K Total
+ Previous Release:
+ Non-Debug Version: 98.8K Code, 27.3K Data, 126.1K Total
+ Debug Version: 192.1K Code, 79.8K Data, 271.9K Total
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Fixed a memory allocation/free regression introduced in 20140828
+that could cause the compiler to crash. This was introduced inadvertently
+during the effort to eliminate compiler memory leaks. ACPICA BZ 1111,
+1113.
+
+iASL: Removed two error messages that have been found to create false
+positives, until they can be fixed and fully validated (ACPICA BZ 1112):
+1) Illegal forward reference within a method
+2) Illegal reference across two methods
+
+iASL: Implemented a new option (-lm) to create a hardware mapping file
+that summarizes all GPIO, I2C, SPI, and UART connections. This option
+works for both the compiler and disassembler. See the iASL compiler user
+guide for additional information and examples (section 6.4.6).
+
+AcpiDump: Added support for the version 1 (ACPI 1.0) RSDP in addition to
+version 2. This corrects the AE_BAD_HEADER exception seen on systems with
+a version 1 RSDP. Lv Zheng ACPICA BZ 1097.
+
+AcpiExec: For Unix versions, don't attempt to put STDIN into raw mode
+unless STDIN is actually a terminal. Assists with batch-mode processing.
+ACPICA BZ 1114.
+
+Disassembler/AcpiHelp: Added another large group of recognized _HID
+values.
+
+
+----------------------------------------
+28 August 2014. Summary of changes for version 20140828:
+
+1) ACPICA kernel-resident subsystem:
+
+Fixed a problem related to the internal use of the Timer() operator where
+a 64-bit divide could cause an attempted link to a double-precision math
+library. This divide is not actually necessary, so the code was
+restructured to eliminate it. Lv Zheng.
+
+ACPI 5.1: Added support for the runtime validation of the _DSD package
+(similar to the iASL support).
+
+ACPI 5.1/Headers: Added support for the GICC affinity subtable to the
+SRAT table. Hanjun Guo <hanjun.guo@linaro.org>.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.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.
+
+ Current Release:
+ Non-Debug Version: 98.8K Code, 27.3K Data, 126.1K Total
+ Debug Version: 192.1K Code, 79.8K Data, 271.9K Total
+ Previous Release:
+ Non-Debug Version: 98.7K Code, 27.3K Data, 126.0K Total1
+ Debug Version: 192.0K Code, 79.7K Data, 271.7K Total
+
+2) iASL Compiler/Disassembler and Tools:
+
+AcpiExec: Fixed a problem on unix systems where the original terminal
+state was not always properly restored upon exit. Seen when using the -v
+option. ACPICA BZ 1104.
+
+iASL: Fixed a problem with the validation of the ranges/length within the
+Memory24 resource descriptor. There was a boundary condition when the
+range was equal to the (length -1) caused by the fact that these values
+are defined in 256-byte blocks, not bytes. ACPICA BZ 1098
+
+Disassembler: Fixed a problem with the GpioInt descriptor interrupt
+polarity
+flags. The flags are actually 2 bits, not 1, and the "ActiveBoth" keyword
+is
+now supported properly.
+
+ACPI 5.1: Added the GICC affinity subtable to the SRAT table. Supported
+in the disassembler, data table compiler, and table template generator.
+
+iASL: Added a requirement for Device() objects that one of either a _HID
+or _ADR must exist within the scope of a Device, as per the ACPI
+specification. Remove a similar requirement that was incorrectly in place
+for the _DSD object.
+
+iASL: Added error detection for illegal named references within control
+methods that would cause runtime failures. Now trapped as errors are: 1)
+References to objects within a non-parent control method. 2) Forward
+references (within a method) -- for control methods, AML interpreters use
+a one-pass parse of control methods. ACPICA BZ 1008.
+
+iASL: Added error checking for dependencies related to the _PSx power
+methods. ACPICA BZ 1029.
+1) For _PS0, one of these must exist within the same scope: _PS1, _PS2,
+_PS3.
+2) For _PS1, _PS2, and PS3: A _PS0 object must exist within the same
+scope.
+
+iASL and table compiler: Cleanup miscellaneous memory leaks by fully
+deploying the existing object and string caches and adding new caches for
+the table compiler.
+
+iASL: Split the huge parser source file into multiple subfiles to improve
+manageability. Generation now requires the M4 macro preprocessor, which
+is part of the Bison distribution on both unix and windows platforms.
+
+AcpiSrc: Fixed and removed all extraneous warnings generated during
+entire ACPICA source code scan and/or conversion.
+
+
+----------------------------------------
+
+24 July 2014. Summary of changes for version 20140724:
+
+The ACPI 5.1 specification has been released and is available at:
+http://uefi.org/specs/access
+
+
+0) ACPI 5.1 support in ACPICA:
+
+ACPI 5.1 is fully supported in ACPICA as of this release.
+
+New predefined names. Support includes iASL and runtime ACPICA
+validation.
+ _CCA (Cache Coherency Attribute).
+ _DSD (Device-Specific Data). David Box.
+
+Modifications to existing ACPI tables. Support includes headers, iASL
+Data Table compiler, disassembler, and the template generator.
+ FADT - New fields and flags. Graeme Gregory.
+ GTDT - One new subtable and new fields. Tomasz Nowicki.
+ MADT - Two new subtables. Tomasz Nowicki.
+ PCCT - One new subtable.
+
+Miscellaneous.
+ New notification type for System Resource Affinity change events.
+
+
+1) ACPICA kernel-resident subsystem:
+
+Fixed a regression introduced in 20140627 where a fault can happen during
+the deletion of Alias AML namespace objects. The problem affected both
+the core ACPICA and the ACPICA tools including iASL and AcpiExec.
+
+Implemented a new GPE public interface, AcpiMarkGpeForWake. Provides a
+simple mechanism to enable wake GPEs that have no associated handler or
+control method. Rafael Wysocki.
+
+Updated the AcpiEnableGpe interface to disallow the enable if there is no
+handler or control method associated with the particular GPE. This will
+help avoid meaningless GPEs and even GPE floods. Rafael Wysocki.
+
+Updated GPE handling and dispatch by disabling the GPE before clearing
+the status bit for edge-triggered GPEs. Lv Zheng.
+
+Added Timer() support to the AML Debug object. The current timer value is
+now displayed with each invocation of (Store to) the debug object to
+enable simple generation of execution times for AML code (method
+execution for example.) ACPICA BZ 1093.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.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.
+
+ Current Release:
+ Non-Debug Version: 98.7K Code, 27.3K Data, 126.0K Total
+ Debug Version: 192.0K Code, 79.7K Data, 271.7K Total
+ Previous Release:
+ Non-Debug Version: 98.7K Code, 27.2K Data, 125.9K Total
+ Debug Version: 191.7K Code, 79.6K Data, 271.3K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+Fixed an issue with the recently added local printf implementation,
+concerning width/precision specifiers that could cause incorrect output.
+Lv Zheng. ACPICA BZ 1094.
+
+Disassembler: Added support to detect buffers that contain UUIDs and
+disassemble them to an invocation of the ToUUID operator. Also emit
+commented descriptions of known ACPI-related UUIDs.
+
+AcpiHelp: Added support to display known ACPI-related UUIDs. New option,
+-u. Adds three new files.
+
+iASL: Update table compiler and disassembler for DMAR table changes that
+were introduced in September 2013. With assistance by David Woodhouse.
+
+----------------------------------------
+27 June 2014. Summary of changes for version 20140627:
+
+1) ACPICA kernel-resident subsystem:
+
+Formatted Output: Implemented local versions of standard formatted output
+utilities such as printf, etc. Over time, it has been discovered that
+there are in fact many portability issues with printf, and the addition
+of this feature will fix/prevent these issues once and for all. Some
+known issues are summarized below:
+
+1) Output of 64-bit values is not portable. For example, UINT64 is %ull
+for the Linux kernel and is %uI64 for some MSVC versions.
+2) Invoking printf consistently in a manner that is portable across both
+32-bit and 64-bit platforms is difficult at best in many situations.
+3) The output format for pointers varies from system to system (leading
+zeros especially), and leads to inconsistent output from ACPICA across
+platforms.
+4) Certain platform-specific printf formats may conflict with ACPICA use.
+5) If there is no local C library available, ACPICA now has local support
+for printf.
+
+-- To address these printf issues in a complete manner, ACPICA now
+directly implements a small subset of printf format specifiers, only
+those that it requires. Adds a new file, utilities/utprint.c. Lv Zheng.
+
+Implemented support for ACPICA generation within the EFI environment.
+Initially, the AcpiDump utility is supported in the UEFI shell
+environment. Lv Zheng.
+
+Added a new external interface, AcpiLogError, to improve ACPICA
+portability. This allows the host to redirect error messages from the
+ACPICA utilities. Lv Zheng.
+
+Added and deployed new OSL file I/O interfaces to improve ACPICA
+portability:
+ AcpiOsOpenFile
+ AcpiOsCloseFile
+ AcpiOsReadFile
+ AcpiOsWriteFile
+ AcpiOsGetFileOffset
+ AcpiOsSetFileOffset
+There are C library implementations of these functions in the new file
+service_layers/oslibcfs.c -- however, the functions can be implemented by
+the local host in any way necessary. Lv Zheng.
+
+Implemented a mechanism to disable/enable ACPI table checksum validation
+at runtime. This can be useful when loading tables very early during OS
+initialization when it may not be possible to map the entire table in
+order to compute the checksum. Lv Zheng.
+
+Fixed a buffer allocation issue for the Generic Serial Bus support.
+Originally, a fixed buffer length was used. This change allows for
+variable-length buffers based upon the protocol indicated by the field
+access attributes. Reported by Lan Tianyu. Lv Zheng.
+
+Fixed a problem where an object detached from a namespace node was not
+properly terminated/cleared and could cause a circular list problem if
+reattached. ACPICA BZ 1063. David Box.
+
+Fixed a possible recursive lock acquisition in hwregs.c. Rakib Mullick.
+
+Fixed a possible memory leak in an error return path within the function
+AcpiUtCopyIobjectToIobject. ACPICA BZ 1087. Colin Ian King.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.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.
+
+ Current Release:
+ Non-Debug Version: 98.7K Code, 27.2K Data, 125.9K Total
+ Debug Version: 191.7K Code, 79.6K Data, 271.3K Total
+ Previous Release:
+ Non-Debug Version: 96.8K Code, 27.2K Data, 124.0K Total
+ Debug Version: 189.5K Code, 79.7K Data, 269.2K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+Disassembler: Add dump of ASCII equivalent text within a comment at the
+end of each line of the output for the Buffer() ASL operator.
+
+AcpiDump: Miscellaneous changes:
+ Fixed repetitive table dump in -n mode.
+ For older EFI platforms, use the ACPI 1.0 GUID during RSDP search if
+the ACPI 2.0 GUID fails.
+
+iASL: Fixed a problem where the compiler could fault if incorrectly given
+an acpidump output file as input. ACPICA BZ 1088. David Box.
+
+AcpiExec/AcpiNames: Fixed a problem where these utilities could fault if
+they are invoked without any arguments.
+
+Debugger: Fixed a possible memory leak in an error return path. ACPICA BZ
+1086. Colin Ian King.
+
+Disassembler: Cleaned up a block of code that extracts a parent Op
+object. Added a comment that explains that the parent is guaranteed to be
+valid in this case. ACPICA BZ 1069.
+
+----------------------------------------
+24 April 2014. Summary of changes for version 20140424:
+
+1) ACPICA kernel-resident subsystem:
+
+Implemented support to skip/ignore NULL address entries in the RSDT/XSDT.
+Some of these tables are known to contain a trailing NULL entry. Lv
+Zheng.
+
+Removed an extraneous error message for the case where there are a large
+number of system GPEs (> 124). This was the "32-bit FADT register is too
+long to convert to GAS struct" message, which is irrelevant for GPEs
+since the GPEx_BLK_LEN fields of the FADT are always used instead of the
+(limited capacity) GAS bit length. Also, several changes to ensure proper
+support for GPE numbers > 255, where some "GPE number" fields were 8-bits
+internally.
+
+Implemented and deployed additional configuration support for the public
+ACPICA external interfaces. Entire classes of interfaces can now be
+easily modified or configured out, replaced by stubbed inline functions
+by default. Lv Zheng.
+
+Moved all public ACPICA runtime configuration globals to the public
+ACPICA external interface file for convenience. Also, removed some
+obsolete/unused globals. See the file acpixf.h. Lv Zheng.
+
+Documentation: Added a new section to the ACPICA reference describing the
+maximum number of GPEs that can be supported by the FADT-defined GPEs in
+block zero and one. About 1200 total. See section 4.4.1 of the ACPICA
+reference.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.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.
+
+ Current Release:
+ Non-Debug Version: 96.8K Code, 27.2K Data, 124.0K Total
+ Debug Version: 189.5K Code, 79.7K Data, 269.2K Total
+ Previous Release:
+ Non-Debug Version: 97.0K Code, 27.2K Data, 124.2K Total
+ Debug Version: 189.7K Code, 79.5K Data, 269.2K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL and disassembler: Add full support for the LPIT table (Low Power
+Idle Table). Includes support in the disassembler, data table compiler,
+and template generator.
+
+AcpiDump utility:
+1) Add option to force the use of the RSDT (over the XSDT).
+2) Improve validation of the RSDP signature (use 8 chars instead of 4).
+
+iASL: Add check for predefined packages that are too large. For
+predefined names that contain subpackages, check if each subpackage is
+too large. (Check for too small already exists.)
+
+Debugger: Updated the GPE command (which simulates a GPE by executing the
+GPE code paths in ACPICA). The GPE device is now optional, and defaults
+to the GPE 0/1 FADT-defined blocks.
+
+Unix application OSL: Update line-editing support. Add additional error
+checking and take care not to reset terminal attributes on exit if they
+were never set. This should help guarantee that the terminal is always
+left in the previous state on program exit.
+
+----------------------------------------
+25 March 2014. Summary of changes for version 20140325:
+
+1) ACPICA kernel-resident subsystem:
+
+Updated the auto-serialize feature for control methods. This feature
+automatically serializes all methods that create named objects in order
+to prevent runtime errors. The update adds support to ignore the
+currently executing AML SyncLevel when invoking such a method, in order
+to prevent disruption of any existing SyncLevel priorities that may exist
+in the AML code. Although the use of SyncLevels is relatively rare, this
+change fixes a regression where an AE_AML_MUTEX_ORDER exception can
+appear on some machines starting with the 20140214 release.
+
+Added a new external interface to allow the host to install ACPI tables
+very early, before the namespace is even created. AcpiInstallTable gives
+the host additional flexibility for ACPI table management. Tables can be
+installed directly by the host as if they had originally appeared in the
+XSDT/RSDT. Installed tables can be SSDTs or other ACPI data tables
+(anything except the DSDT and FACS). Adds a new file, tbdata.c, along
+with additional internal restructuring and cleanup. See the ACPICA
+Reference for interface details. Lv Zheng.
+
+Added validation of the checksum for all incoming dynamically loaded
+tables (via external interfaces or via AML Load/LoadTable operators). Lv
+Zheng.
+
+Updated the use of the AcpiOsWaitEventsComplete interface during Notify
+and GPE handler removal. Restructured calls to eliminate possible race
+conditions. Lv Zheng.
+
+Added a warning for the use/execution of the ASL/AML Unload (table)
+operator. This will help detect and identify machines that use this
+operator if and when it is ever used. This operator has never been seen
+in the field and the usage model and possible side-effects of the drastic
+runtime action of a full table removal are unknown.
+
+Reverted the use of #pragma push/pop which was introduced in the 20140214
+release. It appears that push and pop are not implemented by enough
+compilers to make the use of this feature feasible for ACPICA at this
+time. However, these operators may be deployed in a future ACPICA
+release.
+
+Added the missing EXPORT_SYMBOL macros for the install and remove SCI
+handler interfaces.
+
+Source code generation:
+1) Disabled the use of the "strchr" macro for the gcc-specific
+generation. For some versions of gcc, this macro can periodically expose
+a compiler bug which in turn causes compile-time error(s).
+2) Added support for PPC64 compilation. Colin Ian King.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.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.
+
+ Current Release:
+ Non-Debug Version: 97.0K Code, 27.2K Data, 124.2K Total
+ Debug Version: 189.7K Code, 79.5K Data, 269.2K Total
+ Previous Release:
+ Non-Debug Version: 96.5K Code, 27.2K Data, 123.7K Total
+ Debug Version: 188.6K Code, 79.0K Data, 267.6K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+Disassembler: Added several new features to improve the readability of
+the resulting ASL code. Extra information is emitted within comment
+fields in the ASL code:
+1) Known _HID/_CID values are decoded to descriptive text.
+2) Standard values for the Notify() operator are decoded to descriptive
+text.
+3) Target operands are expanded to full pathnames (in a comment) when
+possible.
+
+Disassembler: Miscellaneous updates for extern() handling:
+1) Abort compiler if file specified by -fe option does not exist.
+2) Silence unnecessary warnings about argument count mismatches.
+3) Update warning messages concerning unresolved method externals.
+4) Emit "UnknownObj" keyword for externals whose type cannot be
+determined.
+
+AcpiHelp utility:
+1) Added the -a option to display both the ASL syntax and the AML
+encoding for an input ASL operator. This effectively displays all known
+information about an ASL operator with one AcpiHelp invocation.
+2) Added substring match support (similar to a wildcard) for the -i
+(_HID/PNP IDs) option.
+
+iASL/Disassembler: Since this tool does not yet support execution on big-
+endian machines, added detection of endianness and an error message if
+execution is attempted on big-endian. Support for big-endian within iASL
+is a feature that is on the ACPICA to-be-done list.
+
+AcpiBin utility:
+1) Remove option to extract binary files from an acpidump; this function
+is made obsolete by the AcpiXtract utility.
+2) General cleanup of open files and allocated buffers.
+
+----------------------------------------
+14 February 2014. Summary of changes for version 20140214:
+
+1) ACPICA kernel-resident subsystem:
+
+Implemented a new mechanism to proactively prevent problems with ill-
+behaved reentrant control methods that create named ACPI objects. This
+behavior is illegal as per the ACPI specification, but is nonetheless
+frequently seen in the field. Previously, this could lead to an
+AE_ALREADY_EXISTS exception if the method was actually entered by more
+than one thread. This new mechanism detects such methods at table load
+time and marks them "serialized" to prevent reentrancy. A new global
+option, AcpiGbl_AutoSerializeMethods, has been added to disable this
+feature if desired. This mechanism and global option obsoletes and
+supersedes the previous AcpiGbl_SerializeAllMethods option.
+
+Added the "Windows 2013" string to the _OSI support. ACPICA will now
+respond TRUE to _OSI queries with this string. It is the stated policy of
+ACPICA to add new strings to the _OSI support as soon as possible after
+they are defined. See the full ACPICA _OSI policy which has been added to
+the utilities/utosi.c file.
+
+Hardened/updated the _PRT return value auto-repair code:
+1) Do not abort the repair on a single subpackage failure, continue to
+check all subpackages.
+2) Add check for the minimum subpackage length (4).
+3) Properly handle extraneous NULL package elements.
+
+Added support to avoid the possibility of infinite loops when traversing
+object linked lists. Never allow an infinite loop, even in the face of
+corrupted object lists.
+
+ACPICA headers: Deployed the use of #pragma pack(push) and #pragma
+pack(pop) directives to ensure that the ACPICA headers are independent of
+compiler settings or other host headers.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.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.
+
+ Current Release:
+ Non-Debug Version: 96.5K Code, 27.2K Data, 123.7K Total
+ Debug Version: 188.6K Code, 79.0K Data, 267.6K Total
+ Previous Release:
+ Non-Debug Version: 96.2K Code, 27.0K Data, 123.2K Total
+ Debug Version: 187.5K Code, 78.3K Data, 265.8K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL/Table-compiler: Fixed a problem with support for the SPMI table. The
+first reserved field was incorrectly forced to have a value of zero. This
+change correctly forces the field to have a value of one. ACPICA BZ 1081.
+
+Debugger: Added missing support for the "Extra" and "Data" subobjects
+when displaying object data.
+
+Debugger: Added support to display entire object linked lists when
+displaying object data.
+
+iASL: Removed the obsolete -g option to obtain ACPI tables from the
+Windows registry. This feature has been superseded by the acpidump
+utility.
+
+----------------------------------------
+14 January 2014. Summary of changes for version 20140114:
+
+1) ACPICA kernel-resident subsystem:
+
+Updated all ACPICA copyrights and signons to 2014. Added the 2014
+copyright to all module headers and signons, including the standard Linux
+header. This affects virtually every file in the ACPICA core subsystem,
+iASL compiler, all ACPICA utilities, and the test suites.
+
+Improved parameter validation for AcpiInstallGpeBlock. Added the
+following checks:
+1) The incoming device handle refers to type ACPI_TYPE_DEVICE.
+2) There is not already a GPE block attached to the device.
+Likewise, with AcpiRemoveGpeBlock, ensure that the incoming object is a
+device.
+
+Correctly support "references" in the ACPI_OBJECT. This change fixes the
+support to allow references (namespace nodes) to be passed as arguments
+to control methods via the evaluate object interface. This is probably
+most useful for testing purposes, however.
+
+Improved support for 32/64 bit physical addresses in printf()-like
+output. This change improves the support for physical addresses in printf
+debug statements and other output on both 32-bit and 64-bit hosts. It
+consistently outputs the appropriate number of bytes for each host. The
+%p specifier is unsatisfactory since it does not emit uniform output on
+all hosts/clib implementations (on some, leading zeros are not supported,
+leading to difficult-to-read output).
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.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.
+
+ Current Release:
+ Non-Debug Version: 96.2K Code, 27.0K Data, 123.2K Total
+ Debug Version: 187.5K Code, 78.3K Data, 265.8K Total
+ Previous Release:
+ Non-Debug Version: 96.1K Code, 27.0K Data, 123.1K Total
+ Debug Version: 185.6K Code, 77.3K Data, 262.9K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Fix a possible fault when using the Connection() operator. Fixes a
+problem if the parent Field definition for the Connection operator refers
+to an operation region that does not exist. ACPICA BZ 1064.
+
+AcpiExec: Load of local test tables is now optional. The utility has the
+capability to load some various tables to test features of ACPICA.
+However, there are enough of them that the output of the utility became
+confusing. With this change, only the required local tables are displayed
+(RSDP, XSDT, etc.) along with the actual tables loaded via the command
+line specification. This makes the default output simler and easier to
+understand. The -el command line option restores the original behavior
+for testing purposes.
+
+AcpiExec: Added support for overlapping operation regions. This change
+expands the simulation of operation regions by supporting regions that
+overlap within the given address space. Supports SystemMemory and
+SystemIO. ASLTS test suite updated also. David Box. ACPICA BZ 1031.
+
+AcpiExec: Added region handler support for PCI_Config and EC spaces. This
+allows AcpiExec to simulate these address spaces, similar to the current
+support for SystemMemory and SystemIO.
+
+Debugger: Added new command to read/write/compare all namespace objects.
+The command "test objects" will exercise the entire namespace by writing
+new values to each data object, and ensuring that the write was
+successful. The original value is then restored and verified.
+
+Debugger: Added the "test predefined" command. This change makes this
+test public and puts it under the new "test" command. The test executes
+each and every predefined name within the current namespace.
+
+----------------------------------------
+18 December 2013. Summary of changes for version 20131218:
+
+Global note: The ACPI 5.0A specification was released this month. There
+are no changes needed for ACPICA since this release of ACPI is an
+errata/clarification release. The specification is available at
+acpi.info.
+
+
+1) ACPICA kernel-resident subsystem:
+
+Added validation of the XSDT root table if it is present. Some older
+platforms contain an XSDT that is ill-formed or otherwise invalid (such
+as containing some or all entries that are NULL pointers). This change
+adds a new function to validate the XSDT before actually using it. If the
+XSDT is found to be invalid, ACPICA will now automatically fall back to
+using the RSDT instead. Original implementation by Zhao Yakui. Ported to
+ACPICA and enhanced by Lv Zheng and Bob Moore.
+
+Added a runtime option to ignore the XSDT and force the use of the RSDT.
+This change adds a runtime option that will force ACPICA to use the RSDT
+instead of the XSDT (AcpiGbl_DoNotUseXsdt). Although the ACPI spec
+requires that an XSDT be used instead of the RSDT, the XSDT has been
+found to be corrupt or ill-formed on some machines. Lv Zheng.
+
+Added a runtime option to favor 32-bit FADT register addresses over the
+64-bit addresses. This change adds an option to favor 32-bit FADT
+addresses when there is a conflict between the 32-bit and 64-bit versions
+of the same register. The default behavior is to use the 64-bit version
+in accordance with the ACPI specification. This can now be overridden via
+the AcpiGbl_Use32BitFadtAddresses flag. ACPICA BZ 885. Lv Zheng.
+
+During the change above, the internal "Convert FADT" and "Verify FADT"
+functions have been merged to simplify the code, making it easier to
+understand and maintain. ACPICA BZ 933.
+
+Improve exception reporting and handling for GPE block installation.
+Return an actual status from AcpiEvGetGpeXruptBlock and don't clobber the
+status when exiting AcpiEvInstallGpeBlock. ACPICA BZ 1019.
+
+Added helper macros to extract bus/segment numbers from the HEST table.
+This change adds two macros to extract the encoded bus and segment
+numbers from the HEST Bus field - ACPI_HEST_BUS and ACPI_HEST_SEGMENT.
+Betty Dall <betty.dall@hp.com>
+
+Removed the unused ACPI_FREE_BUFFER macro. This macro is no longer used
+by ACPICA. It is not a public macro, so it should have no effect on
+existing OSV code. Lv Zheng.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.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.
+
+ Current Release:
+ Non-Debug Version: 96.1K Code, 27.0K Data, 123.1K Total
+ Debug Version: 185.6K Code, 77.3K Data, 262.9K Total
+ Previous Release:
+ Non-Debug Version: 95.9K Code, 27.0K Data, 122.9K Total
+ Debug Version: 185.1K Code, 77.2K Data, 262.3K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+Disassembler: Improved pathname support for emitted External()
+statements. This change adds full pathname support for external names
+that have been resolved internally by the inclusion of additional ACPI
+tables (via the iASL -e option). Without this change, the disassembler
+can emit multiple externals for the same object, or it become confused
+when the Scope() operator is used on an external object. Overall, greatly
+improves the ability to actually recompile the emitted ASL code when
+objects a referenced across multiple ACPI tables. Reported by Michael
+Tsirkin (mst@redhat.com).
+
+Tests/ASLTS: Updated functional control suite to execute with no errors.
+David Box. Fixed several errors related to the testing of the interpreter
+slack mode. Lv Zheng.
+
+iASL: Added support to detect names that are declared within a control
+method, but are unused (these are temporary names that are only valid
+during the time the method is executing). A remark is issued for these
+cases. ACPICA BZ 1022.
+
+iASL: Added full support for the DBG2 table. Adds full disassembler,
+table compiler, and template generator support for the DBG2 table (Debug
+Port 2 table).
+
+iASL: Added full support for the PCCT table, update the table definition.
+Updates the PCCT table definition in the actbl3.h header and adds table
+compiler and template generator support.
+
+iASL: Added an option to emit only error messages (no warnings/remarks).
+The -ve option will enable only error messages, warnings and remarks are
+suppressed. This can simplify debugging when only the errors are
+important, such as when an ACPI table is disassembled and there are many
+warnings and remarks -- but only the actual errors are of real interest.
+
+Example ACPICA code (source/tools/examples): Updated the example code so
+that it builds to an actual working program, not just example code. Added
+ACPI tables and execution of an example control method in the DSDT. Added
+makefile support for Unix generation.
+
+----------------------------------------
+15 November 2013. Summary of changes for version 20131115:
+
+This release is available at https://acpica.org/downloads
+
+
+1) ACPICA kernel-resident subsystem:
+
+Resource Manager: Fixed loop termination for the "get AML length"
+function. The loop previously had an error termination on a NULL resource
+pointer, which can never happen since the loop simply increments a valid
+resource pointer. This fix changes the loop to terminate with an error on
+an invalid end-of-buffer condition. The problem can be seen as an
+infinite loop by callers to AcpiSetCurrentResources with an invalid or
+corrupted resource descriptor, or a resource descriptor that is missing
+an END_TAG descriptor. Reported by Dan Carpenter
+<dan.carpenter@oracle.com>. Lv Zheng, Bob Moore.
+
+Table unload and ACPICA termination: Delete all attached data objects
+during namespace node deletion. This fix updates namespace node deletion
+to delete the entire list of attached objects (attached via
+AcpiAttachObject) instead of just one of the attached items. ACPICA BZ
+1024. Tomasz Nowicki (tomasz.nowicki@linaro.org).
+
+ACPICA termination: Added support to delete all objects attached to the
+root namespace node. This fix deletes any and all objects that have been
+attached to the root node via AcpiAttachData. Previously, none of these
+objects were deleted. Reported by Tomasz Nowicki. ACPICA BZ 1026.
+
+Debug output: Do not emit the function nesting level for the in-kernel
+build. The nesting level is really only useful during a single-thread
+execution. Therefore, only enable this output for the AcpiExec utility.
+Also, only emit the thread ID when executing under AcpiExec (Context
+switches are still always detected and a message is emitted). ACPICA BZ
+972.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.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.
+
+ Current Release:
+ Non-Debug Version: 95.9K Code, 27.0K Data, 122.9K Total
+ Debug Version: 185.1K Code, 77.2K Data, 262.3K Total
+ Previous Release:
+ Non-Debug Version: 95.8K Code, 27.0K Data, 122.8K Total
+ Debug Version: 185.2K Code, 77.2K Data, 262.4K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+AcpiExec/Unix-OSL: Use <termios.h> instead of <termio.h>. This is the
+correct portable POSIX header for terminal control functions.
+
+Disassembler: Fixed control method invocation issues related to the use
+of the CondRefOf() operator. The problem is seen in the disassembly where
+control method invocations may not be disassembled properly if the
+control method name has been used previously as an argument to CondRefOf.
+The solution is to not attempt to emit an external declaration for the
+CondRefOf target (it is not necessary in the first place). This prevents
+disassembler object type confusion. ACPICA BZ 988.
+
+Unix Makefiles: Added an option to disable compiler optimizations and the
+_FORTIFY_SOURCE flag. Some older compilers have problems compiling ACPICA
+with optimizations (reportedly, gcc 4.4 for example). This change adds a
+command line option for make (NOOPT) that disables all compiler
+optimizations and the _FORTIFY_SOURCE compiler flag. The default
+optimization is -O2 with the _FORTIFY_SOURCE flag specified. ACPICA BZ
+1034. Lv Zheng, Bob Moore.
+
+Tests/ASLTS: Added options to specify individual test cases and modes.
+This allows testers running aslts.sh to optionally specify individual
+test modes and test cases. Also added an option to disable the forced
+generation of the ACPICA tools from source if desired. Lv Zheng.
+
+----------------------------------------
+27 September 2013. Summary of changes for version 20130927:
+
+This release is available at https://acpica.org/downloads
+
+
+1) ACPICA kernel-resident subsystem:
+
+Fixed a problem with store operations to reference objects. This change
+fixes a problem where a Store operation to an ArgX object that contained
+a
+reference to a field object did not complete the automatic dereference
+and
+then write to the actual field object. Instead, the object type of the
+field object was inadvertently changed to match the type of the source
+operand. The new behavior will actually write to the field object (buffer
+field or field unit), thus matching the correct ACPI-defined behavior.
+
+Implemented support to allow the host to redefine individual OSL
+prototypes. This change enables the host to redefine OSL prototypes found
+in the acpiosxf.h file. This allows the host to implement OSL interfaces
+with a macro or inlined function. Further, it allows the host to add any
+additional required modifiers such as __iomem, __init, __exit, etc., as
+necessary on a per-interface basis. Enables maximum flexibility for the
+OSL interfaces. Lv Zheng.
+
+Hardcoded the access width for the FADT-defined reset register. The ACPI
+specification requires the reset register width to be 8 bits. ACPICA now
+hardcodes the width to 8 and ignores the FADT width value. This provides
+compatibility with other ACPI implementations that have allowed BIOS code
+with bad register width values to go unnoticed. Matthew Garett, Bob
+Moore,
+Lv Zheng.
+
+Changed the position/use of the ACPI_PRINTF_LIKE macro. This macro is
+used
+in the OSL header (acpiosxf). The change modifies the position of this
+macro in each instance where it is used (AcpiDebugPrint, etc.) to avoid
+build issues if the OSL defines the implementation of the interface to be
+an inline stub function. Lv Zheng.
+
+Deployed a new macro ACPI_EXPORT_SYMBOL_INIT for the main ACPICA
+initialization interfaces. This change adds a new macro for the main init
+and terminate external interfaces in order to support hosts that require
+additional or different processing for these functions. Changed from
+ACPI_EXPORT_SYMBOL to ACPI_EXPORT_SYMBOL_INIT for these functions. Lv
+Zheng, Bob Moore.
+
+Cleaned up the memory allocation macros for configurability. In the
+common
+case, the ACPI_ALLOCATE and related macros now resolve directly to their
+respective AcpiOs* OSL interfaces. Two options:
+1) The ACPI_ALLOCATE_ZEROED macro uses a simple local implementation by
+default, unless overridden by the USE_NATIVE_ALLOCATE_ZEROED define.
+2) For AcpiExec (and for debugging), the macros can optionally be
+resolved
+to the local ACPICA interfaces that track each allocation (local tracking
+is used to immediately detect memory leaks).
+Lv Zheng.
+
+Simplified the configuration for ACPI_REDUCED_HARDWARE. Allows the kernel
+to predefine this macro to either TRUE or FALSE during the system build.
+
+Replaced __FUNCTION_ with __func__ in the gcc-specific header.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.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.
+
+ Current Release:
+ Non-Debug Version: 95.8K Code, 27.0K Data, 122.8K Total
+ Debug Version: 185.2K Code, 77.2K Data, 262.4K Total
+ Previous Release:
+ Non-Debug Version: 96.7K Code, 27.1K Data, 123.9K Total
+ Debug Version: 184.4K Code, 76.8K Data, 261.2K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Implemented wildcard support for the -e option. This simplifies use
+when there are many SSDTs that must be included to resolve external
+method
+declarations. ACPICA BZ 1041. Example:
+ iasl -e ssdt*.dat -d dsdt.dat
+
+AcpiExec: Add history/line-editing for Unix/Linux systems. This change
+adds a portable module that implements full history and limited line
+editing for Unix and Linux systems. It does not use readline() due to
+portability issues. Instead it uses the POSIX termio interface to put the
+terminal in raw input mode so that the various special keys can be
+trapped
+(such as up/down-arrow for history support and left/right-arrow for line
+editing). Uses the existing debugger history mechanism. ACPICA BZ 1036.
+
+AcpiXtract: Add support to handle (ignore) "empty" lines containing only
+one or more spaces. This provides compatible with early or different
+versions of the AcpiDump utility. ACPICA BZ 1044.
+
+AcpiDump: Do not ignore tables that contain only an ACPI table header.
+Apparently, some BIOSs create SSDTs that contain an ACPI table header but
+no other data. This change adds support to dump these tables. Any tables
+shorter than the length of an ACPI table header remain in error (an error
+message is emitted). Reported by Yi Li.
+
+Debugger: Echo actual command along with the "unknown command" message.
+
+----------------------------------------
23 August 2013. Summary of changes for version 20130823:
1) ACPICA kernel-resident subsystem:
diff --git a/sys/contrib/dev/acpica/common/acgetline.c b/sys/contrib/dev/acpica/common/acgetline.c
new file mode 100644
index 0000000..712b4a3
--- /dev/null
+++ b/sys/contrib/dev/acpica/common/acgetline.c
@@ -0,0 +1,440 @@
+/******************************************************************************
+ *
+ * Module Name: acgetline - local line editing
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/amlcode.h>
+#include <contrib/dev/acpica/include/acparser.h>
+#include <contrib/dev/acpica/include/acdebug.h>
+
+#include <stdio.h>
+
+/*
+ * This is an os-independent implementation of line-editing services needed
+ * by the AcpiExec utility. It uses getchar() and putchar() and the existing
+ * history support provided by the AML debugger. It assumes that the terminal
+ * is in the correct line-editing mode such as raw and noecho. The OSL
+ * interface AcpiOsInitialize should do this. AcpiOsTerminate should put the
+ * terminal back into the original mode.
+ */
+#define _COMPONENT ACPI_OS_SERVICES
+ ACPI_MODULE_NAME ("acgetline")
+
+
+/* Local prototypes */
+
+static void
+AcpiAcClearLine (
+ UINT32 EndOfLine,
+ UINT32 CursorPosition);
+
+/* Various ASCII constants */
+
+#define _ASCII_NUL 0
+#define _ASCII_BACKSPACE 0x08
+#define _ASCII_TAB 0x09
+#define _ASCII_ESCAPE 0x1B
+#define _ASCII_SPACE 0x20
+#define _ASCII_LEFT_BRACKET 0x5B
+#define _ASCII_DEL 0x7F
+#define _ASCII_UP_ARROW 'A'
+#define _ASCII_DOWN_ARROW 'B'
+#define _ASCII_RIGHT_ARROW 'C'
+#define _ASCII_LEFT_ARROW 'D'
+#define _ASCII_NEWLINE '\n'
+
+extern UINT32 AcpiGbl_NextCmdNum;
+
+/* Erase a single character on the input command line */
+
+#define ACPI_CLEAR_CHAR() \
+ putchar (_ASCII_BACKSPACE); \
+ putchar (_ASCII_SPACE); \
+ putchar (_ASCII_BACKSPACE);
+
+/* Backup cursor by Count positions */
+
+#define ACPI_BACKUP_CURSOR(i, Count) \
+ for (i = 0; i < (Count); i++) \
+ {putchar (_ASCII_BACKSPACE);}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiAcClearLine
+ *
+ * PARAMETERS: EndOfLine - Current end-of-line index
+ * CursorPosition - Current cursor position within line
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Clear the entire command line the hard way, but probably the
+ * most portable.
+ *
+ *****************************************************************************/
+
+static void
+AcpiAcClearLine (
+ UINT32 EndOfLine,
+ UINT32 CursorPosition)
+{
+ UINT32 i;
+
+
+ if (CursorPosition < EndOfLine)
+ {
+ /* Clear line from current position to end of line */
+
+ for (i = 0; i < (EndOfLine - CursorPosition); i++)
+ {
+ putchar (' ');
+ }
+ }
+
+ /* Clear the entire line */
+
+ for (; EndOfLine > 0; EndOfLine--)
+ {
+ ACPI_CLEAR_CHAR ();
+ }
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiOsGetLine
+ *
+ * PARAMETERS: Buffer - Where to return the command line
+ * BufferLength - Maximum length of Buffer
+ * BytesRead - Where the actual byte count is returned
+ *
+ * RETURN: Status and actual bytes read
+ *
+ * DESCRIPTION: Get the next input line from the terminal. NOTE: terminal
+ * is expected to be in a mode that supports line-editing (raw,
+ * noecho). This function is intended to be very portable. Also,
+ * it uses the history support implemented in the AML debugger.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AcpiOsGetLine (
+ char *Buffer,
+ UINT32 BufferLength,
+ UINT32 *BytesRead)
+{
+ char *NextCommand;
+ UINT32 MaxCommandIndex = AcpiGbl_NextCmdNum - 1;
+ UINT32 CurrentCommandIndex = MaxCommandIndex;
+ UINT32 PreviousCommandIndex = MaxCommandIndex;
+ int InputChar;
+ UINT32 CursorPosition = 0;
+ UINT32 EndOfLine = 0;
+ UINT32 i;
+
+
+ /* Always clear the line buffer before we read a new line */
+
+ memset (Buffer, 0, BufferLength);
+
+ /*
+ * This loop gets one character at a time (except for esc sequences)
+ * until a newline or error is detected.
+ *
+ * Note: Don't attempt to write terminal control ESC sequences, even
+ * though it makes certain things more difficult.
+ */
+ while (1)
+ {
+ if (EndOfLine >= (BufferLength - 1))
+ {
+ return (AE_BUFFER_OVERFLOW);
+ }
+
+ InputChar = getchar ();
+ switch (InputChar)
+ {
+ default: /* This is the normal character case */
+
+ /* Echo the character (at EOL) and copy it to the line buffer */
+
+ if (EndOfLine == CursorPosition)
+ {
+ putchar (InputChar);
+ Buffer[EndOfLine] = (char) InputChar;
+
+ EndOfLine++;
+ CursorPosition++;
+ Buffer[EndOfLine] = 0;
+ continue;
+ }
+
+ /* Insert character into the middle of the buffer */
+
+ memmove (&Buffer[CursorPosition + 1], &Buffer[CursorPosition],
+ (EndOfLine - CursorPosition + 1));
+
+ Buffer [CursorPosition] = (char) InputChar;
+ Buffer [EndOfLine + 1] = 0;
+
+ /* Display the new part of line starting at the new character */
+
+ fprintf (stdout, "%s", &Buffer[CursorPosition]);
+
+ /* Restore cursor */
+
+ ACPI_BACKUP_CURSOR (i, EndOfLine - CursorPosition);
+ CursorPosition++;
+ EndOfLine++;
+ continue;
+
+ case _ASCII_DEL: /* Backspace key */
+
+ if (!EndOfLine) /* Any characters on the command line? */
+ {
+ continue;
+ }
+
+ if (EndOfLine == CursorPosition) /* Erase the final character */
+ {
+ ACPI_CLEAR_CHAR ();
+ EndOfLine--;
+ CursorPosition--;
+ continue;
+ }
+
+ if (!CursorPosition) /* Do not backup beyond start of line */
+ {
+ continue;
+ }
+
+ /* Remove the character from the line */
+
+ memmove (&Buffer[CursorPosition - 1], &Buffer[CursorPosition],
+ (EndOfLine - CursorPosition + 1));
+
+ /* Display the new part of line starting at the new character */
+
+ putchar (_ASCII_BACKSPACE);
+ fprintf (stdout, "%s ", &Buffer[CursorPosition - 1]);
+
+ /* Restore cursor */
+
+ ACPI_BACKUP_CURSOR (i, EndOfLine - CursorPosition + 1);
+ EndOfLine--;
+ if (CursorPosition > 0)
+ {
+ CursorPosition--;
+ }
+ continue;
+
+ case _ASCII_NEWLINE: /* Normal exit case at end of command line */
+ case _ASCII_NUL:
+
+ /* Return the number of bytes in the command line string */
+
+ if (BytesRead)
+ {
+ *BytesRead = EndOfLine;
+ }
+
+ /* Echo, terminate string buffer, and exit */
+
+ putchar (InputChar);
+ Buffer[EndOfLine] = 0;
+ return (AE_OK);
+
+ case _ASCII_TAB:
+
+ /* Ignore */
+
+ continue;
+
+ case EOF:
+
+ return (AE_ERROR);
+
+ case _ASCII_ESCAPE:
+
+ /* Check for escape sequences of the form "ESC[x" */
+
+ InputChar = getchar ();
+ if (InputChar != _ASCII_LEFT_BRACKET)
+ {
+ continue; /* Ignore this ESC, does not have the '[' */
+ }
+
+ /* Get the code following the ESC [ */
+
+ InputChar = getchar (); /* Backup one character */
+ switch (InputChar)
+ {
+ case _ASCII_LEFT_ARROW:
+
+ if (CursorPosition > 0)
+ {
+ putchar (_ASCII_BACKSPACE);
+ CursorPosition--;
+ }
+ continue;
+
+ case _ASCII_RIGHT_ARROW:
+ /*
+ * Move one character forward. Do this without sending
+ * ESC sequence to the terminal for max portability.
+ */
+ if (CursorPosition < EndOfLine)
+ {
+ /* Backup to start of line and print the entire line */
+
+ ACPI_BACKUP_CURSOR (i, CursorPosition);
+ fprintf (stdout, "%s", Buffer);
+
+ /* Backup to where the cursor should be */
+
+ CursorPosition++;
+ ACPI_BACKUP_CURSOR (i, EndOfLine - CursorPosition);
+ }
+ continue;
+
+ case _ASCII_UP_ARROW:
+
+ /* If no commands available or at start of history list, ignore */
+
+ if (!CurrentCommandIndex)
+ {
+ continue;
+ }
+
+ /* Manage our up/down progress */
+
+ if (CurrentCommandIndex > PreviousCommandIndex)
+ {
+ CurrentCommandIndex = PreviousCommandIndex;
+ }
+
+ /* Get the historical command from the debugger */
+
+ NextCommand = AcpiDbGetHistoryByIndex (CurrentCommandIndex);
+ if (!NextCommand)
+ {
+ return (AE_ERROR);
+ }
+
+ /* Make this the active command and echo it */
+
+ AcpiAcClearLine (EndOfLine, CursorPosition);
+ strcpy (Buffer, NextCommand);
+ fprintf (stdout, "%s", Buffer);
+ EndOfLine = CursorPosition = strlen (Buffer);
+
+ PreviousCommandIndex = CurrentCommandIndex;
+ CurrentCommandIndex--;
+ continue;
+
+ case _ASCII_DOWN_ARROW:
+
+ if (!MaxCommandIndex) /* Any commands available? */
+ {
+ continue;
+ }
+
+ /* Manage our up/down progress */
+
+ if (CurrentCommandIndex < PreviousCommandIndex)
+ {
+ CurrentCommandIndex = PreviousCommandIndex;
+ }
+
+ /* If we are the end of the history list, output a clear new line */
+
+ if ((CurrentCommandIndex + 1) > MaxCommandIndex)
+ {
+ AcpiAcClearLine (EndOfLine, CursorPosition);
+ EndOfLine = CursorPosition = 0;
+ PreviousCommandIndex = CurrentCommandIndex;
+ continue;
+ }
+
+ PreviousCommandIndex = CurrentCommandIndex;
+ CurrentCommandIndex++;
+
+ /* Get the historical command from the debugger */
+
+ NextCommand = AcpiDbGetHistoryByIndex (CurrentCommandIndex);
+ if (!NextCommand)
+ {
+ return (AE_ERROR);
+ }
+
+ /* Make this the active command and echo it */
+
+ AcpiAcClearLine (EndOfLine, CursorPosition);
+ strcpy (Buffer, NextCommand);
+ fprintf (stdout, "%s", Buffer);
+ EndOfLine = CursorPosition = strlen (Buffer);
+ continue;
+
+ case 0x31:
+ case 0x32:
+ case 0x33:
+ case 0x34:
+ case 0x35:
+ case 0x36:
+ /*
+ * Ignore the various keys like insert/delete/home/end, etc.
+ * But we must eat the final character of the ESC sequence.
+ */
+ InputChar = getchar ();
+ continue;
+
+ default:
+
+ /* Ignore random escape sequences that we don't care about */
+
+ continue;
+ }
+ continue;
+ }
+ }
+}
diff --git a/sys/contrib/dev/acpica/common/adfile.c b/sys/contrib/dev/acpica/common/adfile.c
index 5cde806..edf4513 100644
--- a/sys/contrib/dev/acpica/common/adfile.c
+++ b/sys/contrib/dev/acpica/common/adfile.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acapps.h>
@@ -199,20 +199,28 @@ FlGenerateFilename (
{
char *Position;
char *NewFilename;
+ char *DirectoryPosition;
/*
- * 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.
+ * 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 ((ACPI_SIZE)
+ NewFilename = UtStringCacheCalloc ((ACPI_SIZE)
strlen (InputFilename) + strlen (Suffix) + 2);
+ if (!NewFilename)
+ {
+ return (NULL);
+ }
+
strcpy (NewFilename, InputFilename);
/* Try to find the last dot in the filename */
+ DirectoryPosition = strrchr (NewFilename, '/');
Position = strrchr (NewFilename, '.');
- if (Position)
+
+ if (Position && (Position > DirectoryPosition))
{
/* Tack on the new suffix */
@@ -247,7 +255,7 @@ FlStrdup (
char *NewString;
- NewString = ACPI_ALLOCATE ((ACPI_SIZE) strlen (String) + 1);
+ NewString = UtStringCacheCalloc ((ACPI_SIZE) strlen (String) + 1);
if (!NewString)
{
return (NULL);
@@ -288,7 +296,6 @@ FlSplitInputPathname (
*OutDirectoryPath = NULL;
- *OutFilename = NULL;
if (!InputPath)
{
@@ -334,6 +341,12 @@ FlSplitInputPathname (
}
*OutDirectoryPath = DirectoryPath;
- *OutFilename = Filename;
+
+ if (OutFilename)
+ {
+ *OutFilename = Filename;
+ return (AE_OK);
+ }
+
return (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/common/adisasm.c b/sys/contrib/dev/acpica/common/adisasm.c
index c361a6a..2212450 100644
--- a/sys/contrib/dev/acpica/common/adisasm.c
+++ b/sys/contrib/dev/acpica/common/adisasm.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,12 +41,9 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#include <contrib/dev/acpica/include/acpi.h>
-#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/include/acparser.h>
#include <contrib/dev/acpica/include/amlcode.h>
-#include <contrib/dev/acpica/include/acdebug.h>
#include <contrib/dev/acpica/include/acdisasm.h>
#include <contrib/dev/acpica/include/acdispat.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -60,29 +57,8 @@
#define _COMPONENT ACPI_TOOLS
ACPI_MODULE_NAME ("adisasm")
-/*
- * Older versions of Bison won't emit this external in the generated header.
- * Newer versions do emit the external, so we don't need to do it.
- */
-#ifndef ASLCOMPILER_ASLCOMPILERPARSE_H
-extern int AslCompilerdebug;
-#endif
-
-ACPI_STATUS
-NsDisplayNamespace (
- void);
-
-void
-NsSetupNamespaceListing (
- void *Handle);
-
-
/* Local prototypes */
-static UINT32
-AdGetFileSize (
- FILE *File);
-
static void
AdCreateTableHeader (
char *Filename,
@@ -152,39 +128,7 @@ AcpiDsMethodDataInitArgs (
static ACPI_TABLE_DESC LocalTables[1];
-static ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot;
-
-
-/*******************************************************************************
- *
- * FUNCTION: AdGetFileSize
- *
- * PARAMETERS: File - Open file handle
- *
- * RETURN: File Size
- *
- * DESCRIPTION: Get current file size. Uses seek-to-EOF. File must be open.
- *
- ******************************************************************************/
-
-static UINT32
-AdGetFileSize (
- FILE *File)
-{
- UINT32 FileSize;
- long Offset;
-
-
- Offset = ftell (File);
-
- fseek (File, 0, SEEK_END);
- FileSize = (UINT32) ftell (File);
-
- /* Restore file pointer */
-
- fseek (File, Offset, SEEK_SET);
- return (FileSize);
-}
+ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot;
/*******************************************************************************
@@ -206,7 +150,7 @@ AdInitialize (
ACPI_STATUS Status;
- /* ACPI CA subsystem initialization */
+ /* ACPICA subsystem initialization */
Status = AcpiOsInitialize ();
if (ACPI_FAILURE (Status))
@@ -250,7 +194,6 @@ AdInitialize (
* 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
*
@@ -263,8 +206,7 @@ AdAmlDisassemble (
BOOLEAN OutToFile,
char *Filename,
char *Prefix,
- char **OutFilename,
- BOOLEAN GetAllTables)
+ char **OutFilename)
{
ACPI_STATUS Status;
char *DisasmFilename = NULL;
@@ -348,7 +290,7 @@ AdAmlDisassemble (
}
else
{
- Status = AdGetLocalTables (Filename, GetAllTables);
+ Status = AdGetLocalTables ();
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not get ACPI tables, %s\n",
@@ -383,7 +325,7 @@ AdAmlDisassemble (
/* Create/Open a disassembly output file */
DisasmFilename = FlGenerateFilename (Prefix, FILE_SUFFIX_DISASSEMBLY);
- if (!OutFilename)
+ if (!DisasmFilename)
{
fprintf (stderr, "Could not generate output filename\n");
Status = AE_ERROR;
@@ -395,6 +337,7 @@ AdAmlDisassemble (
{
fprintf (stderr, "Could not open output file %s\n", DisasmFilename);
Status = AE_ERROR;
+ ACPI_FREE (DisasmFilename);
goto Cleanup;
}
@@ -414,8 +357,12 @@ AdAmlDisassemble (
AcpiDmDumpDataTable (Table);
fprintf (stderr, "Acpi Data Table [%4.4s] decoded\n",
Table->Signature);
- fprintf (stderr, "Formatted output: %s - %u bytes\n",
- DisasmFilename, AdGetFileSize (File));
+
+ if (File)
+ {
+ fprintf (stderr, "Formatted output: %s - %u bytes\n",
+ DisasmFilename, CmGetFileSize (File));
+ }
}
else
{
@@ -433,8 +380,11 @@ AdAmlDisassemble (
{
AcpiOsPrintf ("/**** Before second load\n");
- NsSetupNamespaceListing (File);
- NsDisplayNamespace ();
+ if (File)
+ {
+ NsSetupNamespaceListing (File);
+ NsDisplayNamespace ();
+ }
AcpiOsPrintf ("*****/\n");
}
@@ -471,9 +421,10 @@ AdAmlDisassemble (
"reparsing with new information\n",
AcpiDmGetExternalMethodCount ());
- /* Reparse, rebuild namespace. no need to xref namespace */
+ /* Reparse, rebuild namespace */
AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot);
+ AcpiGbl_ParseOpRoot = NULL;
AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode);
AcpiGbl_RootNode = NULL;
@@ -487,6 +438,9 @@ AdAmlDisassemble (
AcpiGbl_RootNodeStruct.Flags = 0;
Status = AcpiNsRootInitialize ();
+
+ /* New namespace, add the external definitions first */
+
AcpiDmAddExternalsToNamespace ();
/* Parse the table again. No need to reload it, however */
@@ -499,11 +453,22 @@ AdAmlDisassemble (
goto Cleanup;
}
+ /* Cross reference the namespace again */
+
+ AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot,
+ AcpiGbl_RootNode, OwnerId);
+
+ AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot,
+ AcpiGbl_RootNode, OwnerId);
+
if (AslCompilerdebug)
{
AcpiOsPrintf ("/**** After second load and resource conversion\n");
- NsSetupNamespaceListing (File);
- NsDisplayNamespace ();
+ if (File)
+ {
+ NsSetupNamespaceListing (File);
+ NsDisplayNamespace ();
+ }
AcpiOsPrintf ("*****/\n");
AcpiDmDumpTree (AcpiGbl_ParseOpRoot);
@@ -532,8 +497,19 @@ AdAmlDisassemble (
AcpiDmDumpDataTable (Table);
fprintf (stderr, "Disassembly completed\n");
- fprintf (stderr, "ASL Output: %s - %u bytes\n",
- DisasmFilename, AdGetFileSize (File));
+ if (File)
+ {
+ fprintf (stderr, "ASL Output: %s - %u bytes\n",
+ DisasmFilename, CmGetFileSize (File));
+ }
+
+ if (Gbl_MapfileFlag)
+ {
+ fprintf (stderr, "%14s %s - %u bytes\n",
+ Gbl_Files[ASL_FILE_MAP_OUTPUT].ShortDescription,
+ Gbl_Files[ASL_FILE_MAP_OUTPUT].Filename,
+ FlGetFileSize (ASL_FILE_MAP_OUTPUT));
+ }
}
}
@@ -544,7 +520,7 @@ Cleanup:
ACPI_FREE (Table);
}
- if (OutToFile && File)
+ if (File)
{
if (AslCompilerdebug) /* Display final namespace, with transforms */
{
@@ -570,7 +546,7 @@ Cleanup:
*
* RETURN: None
*
- * DESCRIPTION: Create the disassembler header, including ACPI CA signon with
+ * DESCRIPTION: Create the disassembler header, including ACPICA signon with
* current time and date.
*
*****************************************************************************/
@@ -581,12 +557,26 @@ AdDisassemblerHeader (
{
time_t Timer;
+
time (&Timer);
/* Header and input table info */
AcpiOsPrintf ("/*\n");
- AcpiOsPrintf (ACPI_COMMON_HEADER ("AML Disassembler", " * "));
+ AcpiOsPrintf (ACPI_COMMON_HEADER (AML_DISASSEMBLER_NAME, " * "));
+
+ if (AcpiGbl_CstyleDisassembly)
+ {
+ AcpiOsPrintf (
+ " * Disassembling to symbolic ASL+ operators\n"
+ " *\n");
+ }
+ else
+ {
+ AcpiOsPrintf (
+ " * Disassembling to non-symbolic legacy ASL operators\n"
+ " *\n");
+ }
AcpiOsPrintf (" * Disassembly of %s, %s", Filename, ctime (&Timer));
AcpiOsPrintf (" *\n");
@@ -602,7 +592,7 @@ AdDisassemblerHeader (
*
* RETURN: None
*
- * DESCRIPTION: Create the ASL table header, including ACPI CA signon with
+ * DESCRIPTION: Create the ASL table header, including ACPICA signon with
* current time and date.
*
*****************************************************************************/
@@ -679,9 +669,18 @@ AdCreateTableHeader (
}
else
{
- NewFilename = ACPI_ALLOCATE_ZEROED (9);
- strncat (NewFilename, Table->Signature, 4);
- strcat (NewFilename, ".aml");
+ NewFilename = UtStringCacheCalloc (9);
+ if (NewFilename)
+ {
+ strncat (NewFilename, Table->Signature, 4);
+ strcat (NewFilename, ".aml");
+ }
+ }
+
+ if (!NewFilename)
+ {
+ AcpiOsPrintf (" **** Could not generate AML output filename\n");
+ return;
}
/* Open the ASL definition block */
@@ -690,8 +689,6 @@ AdCreateTableHeader (
"DefinitionBlock (\"%s\", \"%4.4s\", %hu, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
NewFilename, Table->Signature, Table->Revision,
Table->OemId, Table->OemTableId, Table->OemRevision);
-
- ACPI_FREE (NewFilename);
}
@@ -726,6 +723,7 @@ AdDisplayTables (
}
AcpiDmDisassemble (NULL, AcpiGbl_ParseOpRoot, ACPI_UINT32_MAX);
+ MpEmitMappingInfo ();
if (AcpiGbl_DbOpt_verbose)
{
@@ -746,8 +744,7 @@ AdDisplayTables (
*
* FUNCTION: AdGetLocalTables
*
- * PARAMETERS: Filename - Not used
- * GetAllTables - TRUE if all tables are desired
+ * PARAMETERS: None
*
* RETURN: Status
*
@@ -757,105 +754,36 @@ AdDisplayTables (
ACPI_STATUS
AdGetLocalTables (
- char *Filename,
- BOOLEAN GetAllTables)
+ void)
{
ACPI_STATUS Status;
ACPI_TABLE_HEADER TableHeader;
ACPI_TABLE_HEADER *NewTable;
- UINT32 NumTables;
- UINT32 PointerSize;
UINT32 TableIndex;
- if (GetAllTables)
- {
- ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_RSDT);
- AcpiOsTableOverride (&TableHeader, &NewTable);
- if (!NewTable)
- {
- fprintf (stderr, "Could not obtain RSDT\n");
- return (AE_NO_ACPI_TABLES);
- }
- else
- {
- AdWriteTable (NewTable, NewTable->Length,
- ACPI_SIG_RSDT, NewTable->OemTableId);
- }
-
- if (ACPI_COMPARE_NAME (NewTable->Signature, ACPI_SIG_RSDT))
- {
- PointerSize = sizeof (UINT32);
- }
- else
- {
- PointerSize = sizeof (UINT64);
- }
-
- /*
- * Determine the number of tables pointed to by the RSDT/XSDT.
- * This is defined by the ACPI Specification to be the number of
- * pointers contained within the RSDT/XSDT. The size of the pointers
- * is architecture-dependent.
- */
- NumTables = (NewTable->Length - sizeof (ACPI_TABLE_HEADER)) / PointerSize;
- AcpiOsPrintf ("There are %u tables defined in the %4.4s\n\n",
- NumTables, NewTable->Signature);
-
- /* Get the FADT */
-
- ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_FADT);
- AcpiOsTableOverride (&TableHeader, &NewTable);
- if (NewTable)
- {
- AdWriteTable (NewTable, NewTable->Length,
- ACPI_SIG_FADT, NewTable->OemTableId);
- }
- AcpiOsPrintf ("\n");
-
- /* Don't bother with FACS, it is usually all zeros */
- }
-
- /* Always get the DSDT */
+ /* Get the DSDT via table override */
ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_DSDT);
AcpiOsTableOverride (&TableHeader, &NewTable);
- if (NewTable)
- {
- AdWriteTable (NewTable, NewTable->Length,
- ACPI_SIG_DSDT, NewTable->OemTableId);
-
- /* Store DSDT in the Table Manager */
-
- 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
+ if (!NewTable)
{
fprintf (stderr, "Could not obtain DSDT\n");
return (AE_NO_ACPI_TABLES);
}
-#if 0
- /* TBD: Future implementation */
+ AdWriteTable (NewTable, NewTable->Length,
+ ACPI_SIG_DSDT, NewTable->OemTableId);
- AcpiOsPrintf ("\n");
+ /* Store DSDT in the Table Manager */
- /* Get all SSDTs */
-
- ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_SSDT);
- do
+ Status = AcpiTbStoreTable (0, NewTable, NewTable->Length,
+ 0, &TableIndex);
+ if (ACPI_FAILURE (Status))
{
- NewTable = NULL;
- Status = AcpiOsTableOverride (&TableHeader, &NewTable);
-
- } while (NewTable);
-#endif
+ fprintf (stderr, "Could not store DSDT\n");
+ return (AE_NO_ACPI_TABLES);
+ }
return (AE_OK);
}
@@ -944,7 +872,8 @@ AdParseTable (
if (LoadTable)
{
Status = AcpiTbStoreTable ((ACPI_PHYSICAL_ADDRESS) Table, Table,
- Table->Length, ACPI_TABLE_ORIGIN_ALLOCATED, &TableIndex);
+ Table->Length, ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL,
+ &TableIndex);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -979,9 +908,12 @@ AdParseTable (
return (AE_OK);
}
- /* Pass 3: Parse control methods and link their parse trees into the main parse tree */
-
- fprintf (stderr, "Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)\n");
+ /*
+ * Pass 3: Parse control methods and link their parse trees
+ * into the main parse tree
+ */
+ fprintf (stderr,
+ "Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)\n");
Status = AcpiDmParseDeferredOps (AcpiGbl_ParseOpRoot);
fprintf (stderr, "\n");
diff --git a/sys/contrib/dev/acpica/common/adwalk.c b/sys/contrib/dev/acpica/common/adwalk.c
index 80f6d83..b1dcf87 100644
--- a/sys/contrib/dev/acpica/common/adwalk.c
+++ b/sys/contrib/dev/acpica/common/adwalk.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
@@ -469,8 +468,9 @@ AcpiDmFindOrphanDescending (
!ChildOp->Common.Node)
{
AcpiNsExternalizeName (ACPI_UINT32_MAX, ChildOp->Common.Value.String,
- NULL, &Path);
- AcpiOsPrintf ("/* %-16s A-NAMEPATH: %s */\n", Op->Common.AmlOpName, Path);
+ NULL, &Path);
+ AcpiOsPrintf ("/* %-16s A-NAMEPATH: %s */\n",
+ Op->Common.AmlOpName, Path);
ACPI_FREE (Path);
NextOp = Op->Common.Next;
@@ -478,22 +478,26 @@ AcpiDmFindOrphanDescending (
{
/* This NamePath has no args, assume it is an integer */
- AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
+ AcpiDmAddOpToExternalList (ChildOp,
+ ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
return (AE_OK);
}
ArgCount = AcpiDmInspectPossibleArgs (3, 1, NextOp);
- AcpiOsPrintf ("/* A-CHILDREN: %u Actual %u */\n", ArgCount, AcpiDmCountChildren (Op));
+ AcpiOsPrintf ("/* A-CHILDREN: %u Actual %u */\n",
+ ArgCount, AcpiDmCountChildren (Op));
if (ArgCount < 1)
{
/* One Arg means this is just a Store(Name,Target) */
- AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
+ AcpiDmAddOpToExternalList (ChildOp,
+ ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
return (AE_OK);
}
- AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
+ AcpiDmAddOpToExternalList (ChildOp,
+ ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
}
break;
#endif
@@ -509,7 +513,8 @@ AcpiDmFindOrphanDescending (
{
/* This NamePath has no args, assume it is an integer */
- AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
+ AcpiDmAddOpToExternalList (ChildOp,
+ ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
return (AE_OK);
}
@@ -518,11 +523,13 @@ AcpiDmFindOrphanDescending (
{
/* One Arg means this is just a Store(Name,Target) */
- AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
+ AcpiDmAddOpToExternalList (ChildOp,
+ ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
return (AE_OK);
}
- AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
+ AcpiDmAddOpToExternalList (ChildOp,
+ ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
}
break;
@@ -554,7 +561,8 @@ AcpiDmFindOrphanDescending (
/* And namepath is the first argument */
(ParentOp->Common.Value.Arg == Op))
{
- AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_INTEGER, 0);
+ AcpiDmAddOpToExternalList (Op,
+ Op->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
break;
}
}
@@ -564,8 +572,8 @@ AcpiDmFindOrphanDescending (
* operator) - it *must* be a method invocation, nothing else is
* grammatically possible.
*/
- AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
-
+ AcpiDmAddOpToExternalList (Op,
+ Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
}
break;
@@ -741,6 +749,7 @@ AcpiDmXrefDescendingOp (
ACPI_NAMESPACE_NODE *Node;
ACPI_OPERAND_OBJECT *Object;
UINT32 ParamCount = 0;
+ char *Pathname;
WalkState = Info->WalkState;
@@ -750,11 +759,13 @@ AcpiDmXrefDescendingOp (
if ((!(OpInfo->Flags & AML_NAMED)) &&
(!(OpInfo->Flags & AML_CREATE)) &&
- (Op->Common.AmlOpcode != AML_INT_NAMEPATH_OP))
+ (Op->Common.AmlOpcode != AML_INT_NAMEPATH_OP) &&
+ (Op->Common.AmlOpcode != AML_NOTIFY_OP))
{
goto Exit;
}
+
/* Get the NamePath from the appropriate place */
if (OpInfo->Flags & AML_NAMED)
@@ -791,6 +802,10 @@ AcpiDmXrefDescendingOp (
Path = NextOp->Common.Value.String;
}
}
+ else if (Op->Common.AmlOpcode == AML_NOTIFY_OP)
+ {
+ Path = Op->Common.Value.Arg->Asl.Value.String;
+ }
else
{
Path = Op->Common.Value.String;
@@ -808,11 +823,14 @@ AcpiDmXrefDescendingOp (
* The namespace is also used as a lookup table for references to resource
* descriptors and the fields within them.
*/
+ Node = NULL;
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
WalkState, &Node);
if (ACPI_SUCCESS (Status) && (Node->Flags & ANOBJ_IS_EXTERNAL))
{
+ /* Node was created by an External() statement */
+
Status = AE_NOT_FOUND;
}
@@ -820,25 +838,38 @@ AcpiDmXrefDescendingOp (
{
if (Status == AE_NOT_FOUND)
{
- AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType, 0);
-
/*
- * We could install this into the namespace, but we catch duplicate
- * externals when they are added to the list.
+ * Add this symbol as an external declaration, except if the
+ * parent is a CondRefOf operator. For this operator, we do not
+ * need an external, nor do we want one, since this can cause
+ * disassembly problems if the symbol is actually a control
+ * method.
*/
-#if 0
- Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
- ACPI_IMODE_LOAD_PASS1, ACPI_NS_DONT_OPEN_SCOPE,
- WalkState, &Node);
-#endif
+ if (!(Op->Asl.Parent &&
+ (Op->Asl.Parent->Asl.AmlOpcode == AML_COND_REF_OF_OP)))
+ {
+ if (Node)
+ {
+ AcpiDmAddNodeToExternalList (Node,
+ (UINT8) ObjectType, 0, 0);
+ }
+ else
+ {
+ AcpiDmAddOpToExternalList (Op, Path,
+ (UINT8) ObjectType, 0, 0);
+ }
+ }
}
}
/*
- * Found the node in external table, add it to external list
- * Node->OwnerId == 0 indicates built-in ACPI Names, _OS_ etc
+ * Found the node, but check if it came from an external table.
+ * Add it to external list. Note: Node->OwnerId == 0 indicates
+ * one of the built-in ACPI Names (_OS_ etc.) which can safely
+ * be ignored.
*/
- else if (Node->OwnerId && WalkState->OwnerId != Node->OwnerId)
+ else if (Node->OwnerId &&
+ (WalkState->OwnerId != Node->OwnerId))
{
ObjectType2 = ObjectType;
@@ -852,7 +883,16 @@ AcpiDmXrefDescendingOp (
}
}
- AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, ParamCount | 0x80);
+ Pathname = AcpiNsGetExternalPathname (Node);
+ if (!Pathname)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ AcpiDmAddNodeToExternalList (Node, (UINT8) ObjectType2,
+ ParamCount, ACPI_EXT_RESOLVED_REFERENCE);
+
+ ACPI_FREE (Pathname);
Op->Common.Node = Node;
}
else
diff --git a/sys/contrib/dev/acpica/common/ahids.c b/sys/contrib/dev/acpica/common/ahids.c
new file mode 100644
index 0000000..038d9f6
--- /dev/null
+++ b/sys/contrib/dev/acpica/common/ahids.c
@@ -0,0 +1,240 @@
+/******************************************************************************
+ *
+ * Module Name: ahids - Table of ACPI/PNP _HID/_CID values
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+
+#define _COMPONENT ACPI_UTILITIES
+ ACPI_MODULE_NAME ("ahids")
+
+
+/*
+ * ACPI/PNP Device IDs with description strings
+ */
+const AH_DEVICE_ID AslDeviceIds[] =
+{
+ {"10EC5640", "Realtek I2S Audio Codec"},
+ {"80860F09", "Intel PWM Controller"},
+ {"80860F0A", "Intel Atom UART Controller"},
+ {"80860F0E", "Intel SPI Controller"},
+ {"80860F14", "Intel Baytrail SDIO/MMC Host Controller"},
+ {"80860F28", "Intel SST Audio DSP"},
+ {"80860F41", "Intel Baytrail I2C Host Controller"},
+ {"ACPI0001", "SMBus 1.0 Host Controller"},
+ {"ACPI0002", "Smart Battery Subsystem"},
+ {"ACPI0003", "Power Source Device"},
+ {"ACPI0004", "Module Device"},
+ {"ACPI0005", "SMBus 2.0 Host Controller"},
+ {"ACPI0006", "GPE Block Device"},
+ {"ACPI0007", "Processor Device"},
+ {"ACPI0008", "Ambient Light Sensor Device"},
+ {"ACPI0009", "I/O xAPIC Device"},
+ {"ACPI000A", "I/O APIC Device"},
+ {"ACPI000B", "I/O SAPIC Device"},
+ {"ACPI000C", "Processor Aggregator Device"},
+ {"ACPI000D", "Power Meter Device"},
+ {"ACPI000E", "Time and Alarm Device"},
+ {"ACPI000F", "User Presence Detection Device"},
+ {"ADMA0F28", "Intel Audio DMA"},
+ {"AMCR0F28", "Intel Audio Machine Driver"},
+ {"ATK4001", "Asus Radio Control Button"},
+ {"ATML1000", "Atmel Touchscreen Controller"},
+ {"AUTH2750", "AuthenTec AES2750"},
+ {"BCM2E39", "Broadcom BT Serial Bus Driver over UART Bus Enumerator"},
+ {"BCM4752E", "Broadcom GPS Controller"},
+ {"BMG0160", "Bosch Gyro Sensor"},
+ {"CPLM3218", "Capella Micro CM3218x Ambient Light Sensor"},
+ {"DELLABCE", "Dell Airplane Mode Switch Driver"},
+ {"DLAC3002", "Qualcomm Atheros Bluetooth UART Transport"},
+ {"FTTH5506", "FocalTech 5506 Touch Controller"},
+ {"HAD0F28", "Intel HDMI Audio Driver"},
+ {"INBC0000", "GPIO Expander"},
+ {"INT0002", "Virtual GPIO Controller"},
+ {"INT0800", "Intel 82802 Firmware Hub Device"},
+ {"INT3394", "ACPI System Fan"},
+ {"INT3396", "Standard Power Management Controller"},
+ {"INT33A0", "Intel Smart Connect Technology Device"},
+ {"INT33A1", "Intel Power Engine"},
+ {"INT33BB", "Intel Baytrail SD Host Controller"},
+ {"INT33BD", "Intel Baytrail Mailbox Device"},
+ {"INT33BE", "Camera Sensor OV5693"},
+ {"INT33C0", "Intel Serial I/O SPI Host Controller"},
+ {"INT33C1", "Intel Serial I/O SPI Host Controller"},
+ {"INT33C2", "Intel Serial I/O I2C Host Controller"},
+ {"INT33C3", "Intel Serial I/O I2C Host Controller"},
+ {"INT33C4", "Intel Serial I/O UART Host Controller"},
+ {"INT33C5", "Intel Serial I/O UART Host Controller"},
+ {"INT33C6", "Intel SD Host Controller"},
+ {"INT33C7", "Intel Serial I/O GPIO Host Controller"},
+ {"INT33C8", "Intel Smart Sound Technology Host Controller"},
+ {"INT33C9", "Wolfson Microelectronics Audio WM5102"},
+ {"INT33CA", "Intel SPB Peripheral"},
+ {"INT33CB", "Intel Smart Sound Technology Audio Codec"},
+ {"INT33D1", "Intel GPIO Buttons"},
+ {"INT33D2", "Intel GPIO Buttons"},
+ {"INT33D3", "Intel GPIO Buttons"},
+ {"INT33D4", "Intel GPIO Buttons"},
+ {"INT33D6", "Intel Virtual Buttons Device"},
+ {"INT33F0", "Camera Sensor MT9M114"},
+ {"INT33F4", "XPOWER PMIC Controller"},
+ {"INT33F5", "TI PMIC Controller"},
+ {"INT33FB", "MIPI-CSI Camera Sensor OV2722"},
+ {"INT33FC", "Intel Baytrail GPIO Controller"},
+ {"INT33FD", "Intel Baytrail Power Management IC"},
+ {"INT33FE", "XPOWER Battery Device"},
+ {"INT3400", "Intel Dynamic Power Performance Management"},
+ {"INT3401", "Intel Extended Thermal Model CPU"},
+ {"INT3403", "DPTF Temperature Sensor"},
+ {"INT3406", "Intel Dynamic Platform & Thermal Framework Display Participant"},
+ {"INT3407", "DPTF Platform Power Meter"},
+ {"INT340E", "Motherboard Resources"},
+ {"INT3420", "Intel Bluetooth RF Kill"},
+ {"INT3F0D", "ACPI Motherboard Resources"},
+ {"INTCF1A", "Sony IMX175 Camera Sensor"},
+ {"INTCFD9", "Intel Baytrail SOC GPIO Controller"},
+ {"INTL9C60", "Intel Baytrail SOC DMA Controller"},
+ {"INVN6500", "InvenSense MPU-6500 Six Axis Gyroscope and Accelerometer"},
+ {"LNXCPU", "Linux Logical CPU"},
+ {"LNXPOWER", "ACPI Power Resource (power gating)"},
+ {"LNXPWRBN", "System Power Button"},
+ {"LNXSYBUS", "System Bus"},
+ {"LNXSYSTM", "ACPI Root Node"},
+ {"LNXTHERM", "ACPI Thermal Zone"},
+ {"LNXVIDEO", "ACPI Video Controller"},
+ {"MAX17047", "Fuel Gauge Controller"},
+ {"MSFT0101", "TPM 2.0 Security Device"},
+ {"NXP5442", "NXP 5442 Near Field Communications Controller"},
+ {"NXP5472", "NXP NFC"},
+ {"PNP0000", "8259-compatible Programmable Interrupt Controller"},
+ {"PNP0001", "EISA Interrupt Controller"},
+ {"PNP0002", "MCA Interrupt Controller"},
+ {"PNP0003", "IO-APIC Interrupt Controller"},
+ {"PNP0100", "PC-class System Timer"},
+ {"PNP0103", "HPET System Timer"},
+ {"PNP0200", "PC-class DMA Controller"},
+ {"PNP0300", "IBM PC/XT Keyboard Controller (83 key)"},
+ {"PNP0301", "IBM PC/XT Keyboard Controller (86 key)"},
+ {"PNP0302", "IBM PC/XT Keyboard Controller (84 key)"},
+ {"PNP0303", "IBM Enhanced Keyboard (101/102-key, PS/2 Mouse)"},
+ {"PNP0400", "Standard LPT Parallel Port"},
+ {"PNP0401", "ECP Parallel Port"},
+ {"PNP0500", "Standard PC COM Serial Port"},
+ {"PNP0501", "16550A-compatible COM Serial Port"},
+ {"PNP0510", "Generic IRDA-compatible Device"},
+ {"PNP0800", "Microsoft Sound System Compatible Device"},
+ {"PNP0A03", "PCI Bus"},
+ {"PNP0A05", "Generic Container Device"},
+ {"PNP0A06", "Generic Container Device"},
+ {"PNP0A08", "PCI Express Bus"},
+ {"PNP0B00", "AT Real-Time Clock"},
+ {"PNP0B01", "Intel PIIX4-compatible RTC/CMOS Device"},
+ {"PNP0B02", "Dallas Semiconductor-compatible RTC/CMOS Device"},
+ {"PNP0C01", "System Board"},
+ {"PNP0C02", "PNP Motherboard Resources"},
+ {"PNP0C04", "x87-compatible Floating Point Processing Unit"},
+ {"PNP0C08", "ACPI Core Hardware"},
+ {"PNP0C09", "Embedded Controller Device"},
+ {"PNP0C0A", "Control Method Battery"},
+ {"PNP0C0B", "Fan (Thermal Solution)"},
+ {"PNP0C0C", "Power Button Device"},
+ {"PNP0C0D", "Lid Device"},
+ {"PNP0C0E", "Sleep Button Device"},
+ {"PNP0C0F", "PCI Interrupt Link Device"},
+ {"PNP0C10", "System Indicator Device"},
+ {"PNP0C11", "Thermal Zone"},
+ {"PNP0C12", "Device Bay Controller"},
+ {"PNP0C14", "Windows Management Instrumentation Device"},
+ {"PNP0C15", "Docking Station"},
+ {"PNP0C40", "Standard Button Controller"},
+ {"PNP0C50", "HID Protocol Device (I2C bus)"},
+ {"PNP0C60", "Display Sensor Device"},
+ {"PNP0C70", "Dock Sensor Device"},
+ {"PNP0C80", "Memory Device"},
+ {"PNP0D10", "XHCI USB Controller with debug"},
+ {"PNP0D15", "XHCI USB Controller without debug"},
+ {"PNP0D20", "EHCI USB Controller without debug"},
+ {"PNP0D25", "EHCI USB Controller with debug"},
+ {"PNP0D40", "SDA Standard Compliant SD Host Controller"},
+ {"PNP0D80", "Windows-compatible System Power Management Controller"},
+ {"PNP0F03", "Microsoft PS/2-style Mouse"},
+ {"PNP0F13", "PS/2 Mouse"},
+ {"RTL8723", "Realtek Wireless Controller"},
+ {"SMB0349", "Charger"},
+ {"SMO91D0", "Sensor Hub"},
+ {"SMSC3750", "SMSC 3750 USB MUX"},
+ {"SSPX0000", "Intel SSP Device"},
+ {"TBQ24296", "Charger"},
+
+ {NULL, NULL}
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiAhMatchHardwareId
+ *
+ * PARAMETERS: HardwareId - String representation of an _HID or _CID
+ *
+ * RETURN: ID info struct. NULL if HardwareId is not found
+ *
+ * DESCRIPTION: Lookup an _HID/_CID in the device ID table
+ *
+ ******************************************************************************/
+
+const AH_DEVICE_ID *
+AcpiAhMatchHardwareId (
+ char *HardwareId)
+{
+ const AH_DEVICE_ID *Info;
+
+
+ for (Info = AslDeviceIds; Info->Name; Info++)
+ {
+ if (!ACPI_STRCMP (HardwareId, Info->Name))
+ {
+ return (Info);
+ }
+ }
+
+ return (NULL);
+}
diff --git a/sys/contrib/dev/acpica/common/ahpredef.c b/sys/contrib/dev/acpica/common/ahpredef.c
index de28b40..a84353b 100644
--- a/sys/contrib/dev/acpica/common/ahpredef.c
+++ b/sys/contrib/dev/acpica/common/ahpredef.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -44,6 +44,9 @@
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
+#define _COMPONENT ACPI_UTILITIES
+ ACPI_MODULE_NAME ("ahpredef")
+
/*
* iASL only needs a partial table (short descriptions only).
* AcpiHelp needs the full table.
@@ -94,6 +97,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
AH_PREDEF ("_BTM", "Battery Time", "Returns the battery runtime"),
AH_PREDEF ("_BTP", "Battery Trip Point", "Sets a Control Method Battery trip point"),
AH_PREDEF ("_CBA", "Configuration Base Address", "Sets the base address for a PCI Express host bridge"),
+ AH_PREDEF ("_CCA", "Cache Coherency Attribute", "Returns a device's support level for cache coherency"),
AH_PREDEF ("_CDM", "Clock Domain", "Returns a logical processor's clock domain identifier"),
AH_PREDEF ("_CID", "Compatible ID", "Returns a device's Plug and Play Compatible ID list"),
AH_PREDEF ("_CLS", "Class Code", "Returns PCI class code and subclass"),
@@ -118,6 +122,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
AH_PREDEF ("_DOS", "Disable Output Switching", "Sets the display output switching mode"),
AH_PREDEF ("_DPL", "Device Selection Polarity", "Polarity of Device Selection signal, Resource Descriptor field"),
AH_PREDEF ("_DRS", "Drive Strength", "Drive Strength setting for GPIO connection, Resource Descriptor field"),
+ AH_PREDEF ("_DSD", "Device-Specific Data", "Returns a list of device property information"),
AH_PREDEF ("_DSM", "Device-Specific Method", "Executes device-specific functions"),
AH_PREDEF ("_DSS", "Device Set State", "Sets the display device state"),
AH_PREDEF ("_DSW", "Device Sleep Wake", "Sets the sleep and wake transition states for a device"),
@@ -169,6 +174,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
AH_PREDEF ("_LID", "Lid Status", "Returns the open/closed status of the lid on a mobile system"),
AH_PREDEF ("_LIN", "Lines In Use", "Handshake lines, Resource Descriptor field"),
AH_PREDEF ("_LL_", "Low Level", "Interrupt polarity, Resource Descriptor field"),
+ AH_PREDEF ("_LPD", "Low Power Dependencies", "Returns a list of dependencies for low power idle entry"),
AH_PREDEF ("_MAF", "Maximum Address Fixed", "Resource Descriptor field"),
AH_PREDEF ("_MAT", "Multiple APIC Table Entry", "Returns a list of MADT APIC structure entries"),
AH_PREDEF ("_MAX", "Maximum Base Address", "Resource Descriptor field"),
@@ -321,3 +327,34 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
AH_PREDEF ("_Wxx", "Wake Event", "Method executed as a result of a wake event"),
AH_PREDEF (NULL, NULL, NULL)
};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiAhMatchPredefinedName
+ *
+ * PARAMETERS: Nameseg - Predefined name string
+ *
+ * RETURN: ID info struct. NULL if Nameseg not found
+ *
+ * DESCRIPTION: Lookup a predefined name.
+ *
+ ******************************************************************************/
+
+const AH_PREDEFINED_NAME *
+AcpiAhMatchPredefinedName (
+ char *Nameseg)
+{
+ const AH_PREDEFINED_NAME *Info;
+
+
+ for (Info = AslPredefinedInfo; Info->Name; Info++)
+ {
+ if (ACPI_COMPARE_NAME (Nameseg, Info->Name))
+ {
+ return (Info);
+ }
+ }
+
+ return (NULL);
+}
diff --git a/sys/contrib/dev/acpica/common/ahuuids.c b/sys/contrib/dev/acpica/common/ahuuids.c
new file mode 100644
index 0000000..a96ab8f
--- /dev/null
+++ b/sys/contrib/dev/acpica/common/ahuuids.c
@@ -0,0 +1,132 @@
+/******************************************************************************
+ *
+ * Module Name: ahuuids - Table of known ACPI-related UUIDs
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+
+#define _COMPONENT ACPI_UTILITIES
+ ACPI_MODULE_NAME ("ahuuids")
+
+/*
+ * Table of "known" (ACPI-related) UUIDs
+ */
+const AH_UUID AcpiUuids[] =
+{
+ {"PCI Host Bridge Device",
+ "33db4d5b-1ff7-401c-9657-7441c03dd766"},
+
+ {"Platform-wide Capabilities",
+ "0811b06e-4a27-44f9-8d60-3cbbc22e7b48"},
+
+ {"Dynamic Enumeration",
+ "d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf"},
+
+ {"GPIO Controller",
+ "4f248f40-d5e2-499f-834c-27758ea1cd3f"},
+
+ {"Battery Thermal Limit",
+ "4c2067e3-887d-475c-9720-4af1d3ed602e"},
+
+ {"Thermal Extensions",
+ "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500"},
+
+ {"USB Controller",
+ "ce2ee385-00e6-48cb-9f05-2edb927c4899"},
+
+ {"HID I2C Device",
+ "3cdff6f7-4267-4555-ad05-b30a3d8938de"},
+
+ {"Power Button Device",
+ "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c"},
+
+ {"Device Labeling Interface",
+ "e5c937d0-3553-4d7a-9117-ea4d19c3434d"},
+
+ {"SATA Controller",
+ "e4db149b-fcfe-425b-a6d8-92357d78fc7f"},
+
+ {"Physical Presence Interface",
+ "3dddfaa6-361b-4eb4-a424-8d10089d1653"},
+
+ {"Device Properties for _DSD",
+ "daffd814-6eba-4d8c-8a91-bc9bbf4aa301"},
+
+ {NULL, NULL}
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiAhMatchUuid
+ *
+ * PARAMETERS: Data - Data buffer containing a UUID
+ *
+ * RETURN: ASCII description string for the UUID if it is found.
+ *
+ * DESCRIPTION: Returns a description string for "known" UUIDs, which are
+ * are UUIDs that are related to ACPI in some way.
+ *
+ ******************************************************************************/
+
+const char *
+AcpiAhMatchUuid (
+ UINT8 *Data)
+{
+ const AH_UUID *Info;
+ UINT8 UuidBuffer[UUID_BUFFER_LENGTH];
+
+
+ /* Walk the table of known ACPI-related UUIDs */
+
+ for (Info = AcpiUuids; Info->Description; Info++)
+ {
+ AcpiUtConvertStringToUuid (Info->String, UuidBuffer);
+
+ if (!ACPI_MEMCMP (Data, UuidBuffer, UUID_BUFFER_LENGTH))
+ {
+ return (Info->Description);
+ }
+ }
+
+ return (NULL);
+}
diff --git a/sys/contrib/dev/acpica/common/cmfsize.c b/sys/contrib/dev/acpica/common/cmfsize.c
new file mode 100644
index 0000000..542b150
--- /dev/null
+++ b/sys/contrib/dev/acpica/common/cmfsize.c
@@ -0,0 +1,113 @@
+/******************************************************************************
+ *
+ * Module Name: cfsize - Common get file size function
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acapps.h>
+#include <stdio.h>
+
+#define _COMPONENT ACPI_TOOLS
+ ACPI_MODULE_NAME ("cmfsize")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: CmGetFileSize
+ *
+ * PARAMETERS: File - Open file descriptor
+ *
+ * RETURN: File Size. On error, -1 (ACPI_UINT32_MAX)
+ *
+ * DESCRIPTION: Get the size of a file. Uses seek-to-EOF. File must be open.
+ * Does not disturb the current file pointer.
+ *
+ ******************************************************************************/
+
+UINT32
+CmGetFileSize (
+ ACPI_FILE File)
+{
+ long FileSize;
+ long CurrentOffset;
+ ACPI_STATUS Status;
+
+
+ /* Save the current file pointer, seek to EOF to obtain file size */
+
+ CurrentOffset = AcpiOsGetFileOffset (File);
+ if (CurrentOffset < 0)
+ {
+ goto OffsetError;
+ }
+
+ Status = AcpiOsSetFileOffset (File, 0, ACPI_FILE_END);
+ if (ACPI_FAILURE (Status))
+ {
+ goto SeekError;
+ }
+
+ FileSize = AcpiOsGetFileOffset (File);
+ if (FileSize < 0)
+ {
+ goto OffsetError;
+ }
+
+ /* Restore original file pointer */
+
+ Status = AcpiOsSetFileOffset (File, CurrentOffset, ACPI_FILE_BEGIN);
+ if (ACPI_FAILURE (Status))
+ {
+ goto SeekError;
+ }
+
+ return ((UINT32) FileSize);
+
+
+OffsetError:
+ AcpiLogError ("Could not get file offset");
+ return (ACPI_UINT32_MAX);
+
+SeekError:
+ AcpiLogError ("Could not set file offset");
+ return (ACPI_UINT32_MAX);
+}
diff --git a/sys/contrib/dev/acpica/common/dmextern.c b/sys/contrib/dev/acpica/common/dmextern.c
index 56e2781..0c262c4 100644
--- a/sys/contrib/dev/acpica/common/dmextern.c
+++ b/sys/contrib/dev/acpica/common/dmextern.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -67,7 +67,7 @@
*/
static const char *AcpiGbl_DmTypeNames[] =
{
- /* 00 */ "", /* Type ANY */
+ /* 00 */ ", UnknownObj", /* Type ANY */
/* 01 */ ", IntObj",
/* 02 */ ", StrObj",
/* 03 */ ", BuffObj",
@@ -104,10 +104,19 @@ AcpiDmNormalizeParentPrefix (
char *Path);
static void
-AcpiDmAddToExternalListFromFile (
+AcpiDmAddPathToExternalList (
char *Path,
UINT8 Type,
- UINT32 Value);
+ UINT32 Value,
+ UINT16 Flags);
+
+static ACPI_STATUS
+AcpiDmCreateNewExternal (
+ char *ExternalPath,
+ char *InternalPath,
+ UINT8 Type,
+ UINT32 Value,
+ UINT16 Flags);
/*******************************************************************************
@@ -279,48 +288,41 @@ Cleanup:
ACPI_STATUS
AcpiDmAddToExternalFileList (
- char *PathList)
+ char *Pathname)
{
ACPI_EXTERNAL_FILE *ExternalFile;
- char *Path;
- char *TmpPath;
+ char *LocalPathname;
- if (!PathList)
+ if (!Pathname)
{
return (AE_OK);
}
- Path = strtok (PathList, ",");
-
- while (Path)
+ LocalPathname = ACPI_ALLOCATE (strlen (Pathname) + 1);
+ if (!LocalPathname)
{
- TmpPath = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (Path) + 1);
- if (!TmpPath)
- {
- return (AE_NO_MEMORY);
- }
-
- ACPI_STRCPY (TmpPath, Path);
+ return (AE_NO_MEMORY);
+ }
- ExternalFile = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_FILE));
- if (!ExternalFile)
- {
- ACPI_FREE (TmpPath);
- return (AE_NO_MEMORY);
- }
+ ExternalFile = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_FILE));
+ if (!ExternalFile)
+ {
+ ACPI_FREE (LocalPathname);
+ return (AE_NO_MEMORY);
+ }
- ExternalFile->Path = TmpPath;
+ /* Take a copy of the file pathname */
- if (AcpiGbl_ExternalFileList)
- {
- ExternalFile->Next = AcpiGbl_ExternalFileList;
- }
+ strcpy (LocalPathname, Pathname);
+ ExternalFile->Path = LocalPathname;
- AcpiGbl_ExternalFileList = ExternalFile;
- Path = strtok (NULL, ",");
+ if (AcpiGbl_ExternalFileList)
+ {
+ ExternalFile->Next = AcpiGbl_ExternalFileList;
}
+ AcpiGbl_ExternalFileList = ExternalFile;
return (AE_OK);
}
@@ -356,12 +358,139 @@ AcpiDmClearExternalFileList (
/*******************************************************************************
*
- * FUNCTION: AcpiDmAddToExternalList
+ * FUNCTION: AcpiDmGetExternalsFromFile
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Process the optional external reference file.
+ *
+ * Each line in the file should be of the form:
+ * External (<Method namepath>, MethodObj, <ArgCount>)
+ *
+ * Example:
+ * External (_SB_.PCI0.XHC_.PS0X, MethodObj, 4)
+ *
+ ******************************************************************************/
+
+void
+AcpiDmGetExternalsFromFile (
+ void)
+{
+ FILE *ExternalRefFile;
+ char *Token;
+ char *MethodName;
+ UINT32 ArgCount;
+ UINT32 ImportCount = 0;
+
+
+ if (!Gbl_ExternalRefFilename)
+ {
+ return;
+ }
+
+ /* Open the file */
+
+ ExternalRefFile = fopen (Gbl_ExternalRefFilename, "r");
+ if (!ExternalRefFile)
+ {
+ fprintf (stderr, "Could not open external reference file \"%s\"\n",
+ Gbl_ExternalRefFilename);
+ AslAbort ();
+ return;
+ }
+
+ /* Each line defines a method */
+
+ while (fgets (StringBuffer, ASL_MSG_BUFFER_SIZE, ExternalRefFile))
+ {
+ Token = strtok (StringBuffer, METHOD_SEPARATORS); /* "External" */
+ if (!Token)
+ {
+ continue;
+ }
+ if (strcmp (Token, "External"))
+ {
+ continue;
+ }
+
+ MethodName = strtok (NULL, METHOD_SEPARATORS); /* Method namepath */
+ if (!MethodName)
+ {
+ continue;
+ }
+
+ Token = strtok (NULL, METHOD_SEPARATORS); /* "MethodObj" */
+ if (!Token)
+ {
+ continue;
+ }
+
+ if (strcmp (Token, "MethodObj"))
+ {
+ continue;
+ }
+
+ Token = strtok (NULL, METHOD_SEPARATORS); /* Arg count */
+ if (!Token)
+ {
+ continue;
+ }
+
+ /* Convert arg count string to an integer */
+
+ errno = 0;
+ ArgCount = strtoul (Token, NULL, 0);
+ if (errno)
+ {
+ fprintf (stderr, "Invalid argument count (%s)\n", Token);
+ continue;
+ }
+ if (ArgCount > 7)
+ {
+ fprintf (stderr, "Invalid argument count (%u)\n", ArgCount);
+ continue;
+ }
+
+ /* Add this external to the global list */
+
+ AcpiOsPrintf ("%s: Importing method external (%u arguments) %s\n",
+ Gbl_ExternalRefFilename, ArgCount, MethodName);
+
+ AcpiDmAddPathToExternalList (MethodName, ACPI_TYPE_METHOD,
+ ArgCount, (ACPI_EXT_RESOLVED_REFERENCE | ACPI_EXT_ORIGIN_FROM_FILE));
+ ImportCount++;
+ }
+
+ if (!ImportCount)
+ {
+ fprintf (stderr, "Did not find any external methods in reference file \"%s\"\n",
+ Gbl_ExternalRefFilename);
+ }
+ else
+ {
+ /* Add the external(s) to the namespace */
+
+ AcpiDmAddExternalsToNamespace ();
+
+ AcpiOsPrintf ("%s: Imported %u external method definitions\n",
+ Gbl_ExternalRefFilename, ImportCount);
+ }
+
+ fclose (ExternalRefFile);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmAddOpToExternalList
*
* PARAMETERS: Op - Current parser Op
* Path - Internal (AML) path to the object
* Type - ACPI object type to be added
* Value - Arg count if adding a Method object
+ * Flags - To be passed to the external object
*
* RETURN: None
*
@@ -369,60 +498,47 @@ AcpiDmClearExternalFileList (
* will in turn be later emitted as an External() declaration
* in the disassembled output.
*
+ * This function handles the most common case where the referenced
+ * name is simply not found in the constructed namespace.
+ *
******************************************************************************/
void
-AcpiDmAddToExternalList (
+AcpiDmAddOpToExternalList (
ACPI_PARSE_OBJECT *Op,
char *Path,
UINT8 Type,
- UINT32 Value)
+ UINT32 Value,
+ UINT16 Flags)
{
char *ExternalPath;
- char *Fullpath = NULL;
- ACPI_EXTERNAL_LIST *NewExternal;
- ACPI_EXTERNAL_LIST *NextExternal;
- ACPI_EXTERNAL_LIST *PrevExternal = NULL;
+ char *InternalPath = Path;
+ char *Temp;
ACPI_STATUS Status;
- BOOLEAN Resolved = FALSE;
+
+
+ ACPI_FUNCTION_TRACE (DmAddOpToExternalList);
if (!Path)
{
- return;
+ return_VOID;
}
- if (Type == ACPI_TYPE_METHOD)
- {
- if (Value & 0x80)
- {
- Resolved = TRUE;
- }
- Value &= 0x07;
- }
+ /* Remove a root backslash if present */
- /*
- * We don't want External() statements to contain a leading '\'.
- * This prevents duplicate external statements of the form:
- *
- * External (\ABCD)
- * External (ABCD)
- *
- * This would cause a compile time error when the disassembled
- * output file is recompiled.
- */
if ((*Path == AML_ROOT_PREFIX) && (Path[1]))
{
Path++;
}
- /* Externalize the ACPI pathname */
+ /* Externalize the pathname */
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path,
- NULL, &ExternalPath);
+ NULL, &ExternalPath);
if (ACPI_FAILURE (Status))
{
- return;
+ return_VOID;
}
/*
@@ -431,231 +547,140 @@ AcpiDmAddToExternalList (
*/
if (*Path == (UINT8) AML_PARENT_PREFIX)
{
- Fullpath = AcpiDmNormalizeParentPrefix (Op, ExternalPath);
- if (Fullpath)
- {
- /* Set new external path */
-
- ACPI_FREE (ExternalPath);
- ExternalPath = Fullpath;
- }
- }
+ Temp = AcpiDmNormalizeParentPrefix (Op, ExternalPath);
- /* Check all existing externals to ensure no duplicates */
+ /* Set new external path */
- NextExternal = AcpiGbl_ExternalList;
- while (NextExternal)
- {
- if (!ACPI_STRCMP (ExternalPath, NextExternal->Path))
+ ACPI_FREE (ExternalPath);
+ ExternalPath = Temp;
+ if (!Temp)
{
- /* Duplicate method, check that the Value (ArgCount) is the same */
-
- if ((NextExternal->Type == ACPI_TYPE_METHOD) &&
- (NextExternal->Value != Value))
- {
- ACPI_ERROR ((AE_INFO,
- "External method arg count mismatch %s: Current %u, attempted %u",
- NextExternal->Path, NextExternal->Value, Value));
- }
-
- /* Allow upgrade of type from ANY */
-
- else if (NextExternal->Type == ACPI_TYPE_ANY)
- {
- NextExternal->Type = Type;
- NextExternal->Value = Value;
- }
-
- ACPI_FREE (ExternalPath);
- return;
+ return_VOID;
}
- NextExternal = NextExternal->Next;
- }
-
- /* Allocate and init a new External() descriptor */
-
- NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST));
- if (!NewExternal)
- {
- ACPI_FREE (ExternalPath);
- return;
- }
-
- NewExternal->Path = ExternalPath;
- NewExternal->Type = Type;
- NewExternal->Value = Value;
- NewExternal->Resolved = Resolved;
- NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath);
-
- /* Was the external path with parent prefix normalized to a fullpath? */
-
- if (Fullpath == ExternalPath)
- {
- /* Get new internal path */
+ /* Create the new internal pathname */
- Status = AcpiNsInternalizeName (ExternalPath, &Path);
+ Flags |= ACPI_EXT_INTERNAL_PATH_ALLOCATED;
+ Status = AcpiNsInternalizeName (ExternalPath, &InternalPath);
if (ACPI_FAILURE (Status))
{
ACPI_FREE (ExternalPath);
- ACPI_FREE (NewExternal);
- return;
+ return_VOID;
}
-
- /* Set flag to indicate External->InternalPath need to be freed */
-
- NewExternal->Flags |= ACPI_IPATH_ALLOCATED;
}
- NewExternal->InternalPath = Path;
-
- /* Link the new descriptor into the global list, alphabetically ordered */
+ /* Create the new External() declaration node */
- NextExternal = AcpiGbl_ExternalList;
- while (NextExternal)
+ Status = AcpiDmCreateNewExternal (ExternalPath, InternalPath,
+ Type, Value, Flags);
+ if (ACPI_FAILURE (Status))
{
- if (AcpiUtStricmp (NewExternal->Path, NextExternal->Path) < 0)
+ ACPI_FREE (ExternalPath);
+ if (Flags & ACPI_EXT_INTERNAL_PATH_ALLOCATED)
{
- if (PrevExternal)
- {
- PrevExternal->Next = NewExternal;
- }
- else
- {
- AcpiGbl_ExternalList = NewExternal;
- }
-
- NewExternal->Next = NextExternal;
- return;
+ ACPI_FREE (InternalPath);
}
-
- PrevExternal = NextExternal;
- NextExternal = NextExternal->Next;
}
- if (PrevExternal)
- {
- PrevExternal->Next = NewExternal;
- }
- else
- {
- AcpiGbl_ExternalList = NewExternal;
- }
+ return_VOID;
}
/*******************************************************************************
*
- * FUNCTION: AcpiDmGetExternalsFromFile
+ * FUNCTION: AcpiDmAddNodeToExternalList
*
- * PARAMETERS: None
+ * PARAMETERS: Node - Namespace node for object to be added
+ * Type - ACPI object type to be added
+ * Value - Arg count if adding a Method object
+ * Flags - To be passed to the external object
*
* RETURN: None
*
- * DESCRIPTION: Process the optional external reference file.
- *
- * Each line in the file should be of the form:
- * External (<Method namepath>, MethodObj, <ArgCount>)
+ * DESCRIPTION: Insert a new name into the global list of Externals which
+ * will in turn be later emitted as an External() declaration
+ * in the disassembled output.
*
- * Example:
- * External (_SB_.PCI0.XHC_.PS0X, MethodObj, 4)
+ * This function handles the case where the referenced name has
+ * been found in the namespace, but the name originated in a
+ * table other than the one that is being disassembled (such
+ * as a table that is added via the iASL -e option).
*
******************************************************************************/
void
-AcpiDmGetExternalsFromFile (
- void)
+AcpiDmAddNodeToExternalList (
+ ACPI_NAMESPACE_NODE *Node,
+ UINT8 Type,
+ UINT32 Value,
+ UINT16 Flags)
{
- FILE *ExternalRefFile;
- char *Token;
- char *MethodName;
- UINT32 ArgCount;
- UINT32 ImportCount = 0;
+ char *ExternalPath;
+ char *InternalPath;
+ char *Temp;
+ ACPI_STATUS Status;
- if (!Gbl_ExternalRefFilename)
- {
- return;
- }
+ ACPI_FUNCTION_TRACE (DmAddNodeToExternalList);
- /* Open the file */
- ExternalRefFile = fopen (Gbl_ExternalRefFilename, "r");
- if (!ExternalRefFile)
+ if (!Node)
{
- fprintf (stderr, "Could not open external reference file \"%s\"\n",
- Gbl_ExternalRefFilename);
- return;
+ return_VOID;
}
- /* Each line defines a method */
+ /* Get the full external and internal pathnames to the node */
- while (fgets (StringBuffer, ASL_MSG_BUFFER_SIZE, ExternalRefFile))
+ ExternalPath = AcpiNsGetExternalPathname (Node);
+ if (!ExternalPath)
{
- Token = strtok (StringBuffer, METHOD_SEPARATORS); /* "External" */
- if (!Token) continue;
- if (strcmp (Token, "External")) continue;
-
- MethodName = strtok (NULL, METHOD_SEPARATORS); /* Method namepath */
- if (!MethodName) continue;
-
- Token = strtok (NULL, METHOD_SEPARATORS); /* "MethodObj" */
- if (!Token) continue;
- if (strcmp (Token, "MethodObj")) continue;
+ return_VOID;
+ }
- Token = strtok (NULL, METHOD_SEPARATORS); /* Arg count */
- if (!Token) continue;
+ Status = AcpiNsInternalizeName (ExternalPath, &InternalPath);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_FREE (ExternalPath);
+ return_VOID;
+ }
- /* Convert arg count string to an integer */
+ /* Remove the root backslash */
- errno = 0;
- ArgCount = strtoul (Token, NULL, 0);
- if (errno)
- {
- fprintf (stderr, "Invalid argument count (%s)\n", Token);
- continue;
- }
- if (ArgCount > 7)
+ if ((*ExternalPath == AML_ROOT_PREFIX) && (ExternalPath[1]))
+ {
+ Temp = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (ExternalPath) + 1);
+ if (!Temp)
{
- fprintf (stderr, "Invalid argument count (%u)\n", ArgCount);
- continue;
+ return_VOID;
}
- /* Add this external to the global list */
-
- AcpiOsPrintf ("%s: Importing method external (%u arguments) %s\n",
- Gbl_ExternalRefFilename, ArgCount, MethodName);
-
- AcpiDmAddToExternalListFromFile (MethodName, ACPI_TYPE_METHOD, ArgCount | 0x80);
- ImportCount++;
- }
-
- if (!ImportCount)
- {
- fprintf (stderr, "Did not find any external methods in reference file \"%s\"\n",
- Gbl_ExternalRefFilename);
+ ACPI_STRCPY (Temp, &ExternalPath[1]);
+ ACPI_FREE (ExternalPath);
+ ExternalPath = Temp;
}
- else
- {
- /* Add the external(s) to the namespace */
- AcpiDmAddExternalsToNamespace ();
+ /* Create the new External() declaration node */
- AcpiOsPrintf ("%s: Imported %u external method definitions\n",
- Gbl_ExternalRefFilename, ImportCount);
+ Status = AcpiDmCreateNewExternal (ExternalPath, InternalPath, Type,
+ Value, (Flags | ACPI_EXT_INTERNAL_PATH_ALLOCATED));
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_FREE (ExternalPath);
+ ACPI_FREE (InternalPath);
}
- fclose (ExternalRefFile);
+ return_VOID;
}
/*******************************************************************************
*
- * FUNCTION: AcpiDmAddToExternalListFromFile
+ * FUNCTION: AcpiDmAddPathToExternalList
*
- * PARAMETERS: Path - Internal (AML) path to the object
+ * PARAMETERS: Path - External name of the object to be added
* Type - ACPI object type to be added
* Value - Arg count if adding a Method object
+ * Flags - To be passed to the external object
*
* RETURN: None
*
@@ -663,73 +688,135 @@ AcpiDmGetExternalsFromFile (
* will in turn be later emitted as an External() declaration
* in the disassembled output.
*
+ * This function currently is used to add externals via a
+ * reference file (via the -fe iASL option).
+ *
******************************************************************************/
static void
-AcpiDmAddToExternalListFromFile (
+AcpiDmAddPathToExternalList (
char *Path,
UINT8 Type,
- UINT32 Value)
+ UINT32 Value,
+ UINT16 Flags)
{
char *InternalPath;
char *ExternalPath;
- ACPI_EXTERNAL_LIST *NewExternal;
- ACPI_EXTERNAL_LIST *NextExternal;
- ACPI_EXTERNAL_LIST *PrevExternal = NULL;
ACPI_STATUS Status;
- BOOLEAN Resolved = FALSE;
+
+
+ ACPI_FUNCTION_TRACE (DmAddPathToExternalList);
if (!Path)
{
- return;
+ return_VOID;
}
- /* TBD: Add a flags parameter */
+ /* Remove a root backslash if present */
- if (Type == ACPI_TYPE_METHOD)
+ if ((*Path == AML_ROOT_PREFIX) && (Path[1]))
{
- if (Value & 0x80)
- {
- Resolved = TRUE;
- }
- Value &= 0x07;
+ Path++;
}
- /*
- * We don't want External() statements to contain a leading '\'.
- * This prevents duplicate external statements of the form:
- *
- * External (\ABCD)
- * External (ABCD)
- *
- * This would cause a compile time error when the disassembled
- * output file is recompiled.
- */
- if ((*Path == AML_ROOT_PREFIX) && (Path[1]))
+ /* Create the internal and external pathnames */
+
+ Status = AcpiNsInternalizeName (Path, &InternalPath);
+ if (ACPI_FAILURE (Status))
{
- Path++;
+ return_VOID;
+ }
+
+ Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, InternalPath,
+ NULL, &ExternalPath);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_FREE (InternalPath);
+ return_VOID;
+ }
+
+ /* Create the new External() declaration node */
+
+ Status = AcpiDmCreateNewExternal (ExternalPath, InternalPath,
+ Type, Value, (Flags | ACPI_EXT_INTERNAL_PATH_ALLOCATED));
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_FREE (ExternalPath);
+ ACPI_FREE (InternalPath);
}
+ return_VOID;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmCreateNewExternal
+ *
+ * PARAMETERS: ExternalPath - External path to the object
+ * InternalPath - Internal (AML) path to the object
+ * Type - ACPI object type to be added
+ * Value - Arg count if adding a Method object
+ * Flags - To be passed to the external object
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Common low-level function to insert a new name into the global
+ * list of Externals which will in turn be later emitted as
+ * External() declarations in the disassembled output.
+ *
+ * Note: The external name should not include a root prefix
+ * (backslash). We do not want External() statements to contain
+ * a leading '\', as this prevents duplicate external statements
+ * of the form:
+ *
+ * External (\ABCD)
+ * External (ABCD)
+ *
+ * This would cause a compile time error when the disassembled
+ * output file is recompiled.
+ *
+ * There are two cases that are handled here. For both, we emit
+ * an External() statement:
+ * 1) The name was simply not found in the namespace.
+ * 2) The name was found, but it originated in a table other than
+ * the table that is being disassembled.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDmCreateNewExternal (
+ char *ExternalPath,
+ char *InternalPath,
+ UINT8 Type,
+ UINT32 Value,
+ UINT16 Flags)
+{
+ ACPI_EXTERNAL_LIST *NewExternal;
+ ACPI_EXTERNAL_LIST *NextExternal;
+ ACPI_EXTERNAL_LIST *PrevExternal = NULL;
+
+
+ ACPI_FUNCTION_TRACE (DmCreateNewExternal);
+
+
/* Check all existing externals to ensure no duplicates */
NextExternal = AcpiGbl_ExternalList;
while (NextExternal)
{
- if (!ACPI_STRCMP (Path, NextExternal->Path))
+ 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))
+ (NextExternal->Value != Value) &&
+ (Value > 0))
{
ACPI_ERROR ((AE_INFO,
- "(File) External method arg count mismatch %s: Current %u, override to %u",
+ "External method arg count mismatch %s: Current %u, attempted %u",
NextExternal->Path, NextExternal->Value, Value));
-
- /* Override, since new value came from external reference file */
-
- NextExternal->Value = Value;
}
/* Allow upgrade of type from ANY */
@@ -740,44 +827,31 @@ AcpiDmAddToExternalListFromFile (
NextExternal->Value = Value;
}
- return;
+ return_ACPI_STATUS (AE_ALREADY_EXISTS);
}
NextExternal = NextExternal->Next;
}
- /* Get the internal pathname (AML format) */
-
- Status = AcpiNsInternalizeName (Path, &InternalPath);
- if (ACPI_FAILURE (Status))
- {
- return;
- }
-
/* Allocate and init a new External() descriptor */
NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST));
if (!NewExternal)
{
- ACPI_FREE (InternalPath);
- return;
+ return_ACPI_STATUS (AE_NO_MEMORY);
}
- /* Must copy and normalize the input path */
-
- AcpiNsExternalizeName (ACPI_UINT32_MAX, InternalPath, NULL, &ExternalPath);
+ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
+ "Adding external reference node (%s) type [%s]\n",
+ ExternalPath, AcpiUtGetTypeName (Type)));
+ NewExternal->Flags = Flags;
+ NewExternal->Value = Value;
NewExternal->Path = ExternalPath;
NewExternal->Type = Type;
- NewExternal->Value = Value;
- NewExternal->Resolved = Resolved;
- NewExternal->Length = (UINT16) ACPI_STRLEN (Path);
+ NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath);
NewExternal->InternalPath = InternalPath;
- /* Set flag to indicate External->InternalPath needs to be freed */
-
- NewExternal->Flags |= ACPI_IPATH_ALLOCATED | ACPI_FROM_REFERENCE_FILE;
-
/* Link the new descriptor into the global list, alphabetically ordered */
NextExternal = AcpiGbl_ExternalList;
@@ -795,7 +869,7 @@ AcpiDmAddToExternalListFromFile (
}
NewExternal->Next = NextExternal;
- return;
+ return_ACPI_STATUS (AE_OK);
}
PrevExternal = NextExternal;
@@ -810,6 +884,8 @@ AcpiDmAddToExternalListFromFile (
{
AcpiGbl_ExternalList = NewExternal;
}
+
+ return_ACPI_STATUS (AE_OK);
}
@@ -985,7 +1061,7 @@ AcpiDmEmitExternals (
if (NextExternal->Type == ACPI_TYPE_METHOD)
{
AcpiGbl_NumExternalMethods++;
- if (NextExternal->Resolved)
+ if (NextExternal->Flags & ACPI_EXT_RESOLVED_REFERENCE)
{
AcpiGbl_ResolvedExternalMethods++;
}
@@ -1004,18 +1080,17 @@ AcpiDmEmitExternals (
while (NextExternal)
{
if ((NextExternal->Type == ACPI_TYPE_METHOD) &&
- (!NextExternal->Resolved))
+ (!(NextExternal->Flags & ACPI_EXT_RESOLVED_REFERENCE)))
{
AcpiOsPrintf (" External (%s%s",
NextExternal->Path,
AcpiDmGetObjectTypeName (NextExternal->Type));
- AcpiOsPrintf (
- ") // Warning: Unresolved Method, "
- "guessing %u arguments (may be incorrect, see warning above)\n",
+ AcpiOsPrintf (") // Warning: Unresolved method, "
+ "guessing %u arguments\n",
NextExternal->Value);
- NextExternal->Emitted = TRUE;
+ NextExternal->Flags |= ACPI_EXT_EXTERNAL_EMITTED;
}
NextExternal = NextExternal->Next;
@@ -1036,7 +1111,8 @@ AcpiDmEmitExternals (
NextExternal = AcpiGbl_ExternalList;
while (NextExternal)
{
- if (!NextExternal->Emitted && (NextExternal->Flags & ACPI_FROM_REFERENCE_FILE))
+ if (!(NextExternal->Flags & ACPI_EXT_EXTERNAL_EMITTED) &&
+ (NextExternal->Flags & ACPI_EXT_ORIGIN_FROM_FILE))
{
AcpiOsPrintf (" External (%s%s",
NextExternal->Path,
@@ -1051,7 +1127,7 @@ AcpiDmEmitExternals (
{
AcpiOsPrintf (")\n");
}
- NextExternal->Emitted = TRUE;
+ NextExternal->Flags |= ACPI_EXT_EXTERNAL_EMITTED;
}
NextExternal = NextExternal->Next;
@@ -1065,7 +1141,7 @@ AcpiDmEmitExternals (
*/
while (AcpiGbl_ExternalList)
{
- if (!AcpiGbl_ExternalList->Emitted)
+ if (!(AcpiGbl_ExternalList->Flags & ACPI_EXT_EXTERNAL_EMITTED))
{
AcpiOsPrintf (" External (%s%s",
AcpiGbl_ExternalList->Path,
@@ -1087,7 +1163,7 @@ AcpiDmEmitExternals (
/* Free this external info block and move on to next external */
NextExternal = AcpiGbl_ExternalList->Next;
- if (AcpiGbl_ExternalList->Flags & ACPI_IPATH_ALLOCATED)
+ if (AcpiGbl_ExternalList->Flags & ACPI_EXT_INTERNAL_PATH_ALLOCATED)
{
ACPI_FREE (AcpiGbl_ExternalList->InternalPath);
}
@@ -1209,12 +1285,24 @@ AcpiDmUnresolvedWarning (
" * were not specified. This resulting disassembler output file may not\n"
" * compile because the disassembler did not know how many arguments\n"
" * to assign to these methods. To specify the tables needed to resolve\n"
- " * external control method references, use the one of the following\n"
- " * example iASL invocations:\n"
- " * iasl -e <ssdt1.aml,ssdt2.aml...> -d <dsdt.aml>\n"
- " * iasl -e <dsdt.aml,ssdt2.aml...> -d <ssdt1.aml>\n"
+ " * external control method references, the -e option can be used to\n"
+ " * specify the filenames. Example iASL invocations:\n"
+ " * iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n"
+ " * iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n"
+ " * iasl -e ssdt*.aml -d dsdt.aml\n"
+ " *\n"
+ " * In addition, the -fe option can be used to specify a file containing\n"
+ " * control method external declarations with the associated method\n"
+ " * argument counts. Each line of the file must be of the form:\n"
+ " * External (<method pathname>, MethodObj, <argument count>)\n"
+ " * Invocation:\n"
+ " * iasl -fe refs.txt -d dsdt.aml\n"
+ " *\n"
+ " * The following methods were unresolved and many not compile properly\n"
+ " * because the disassembler had to guess at the number of arguments\n"
+ " * required for each:\n"
" */\n",
- AcpiGbl_NumExternalMethods);
+ AcpiGbl_NumExternalMethods);
}
else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods)
{
@@ -1223,10 +1311,21 @@ AcpiDmUnresolvedWarning (
AcpiOsPrintf (" /*\n"
" * iASL Warning: There were %u external control methods found during\n"
" * disassembly, but only %u %s resolved (%u unresolved). Additional\n"
- " * ACPI tables are required to properly disassemble the code. This\n"
+ " * ACPI tables may be required to properly disassemble the code. This\n"
" * resulting disassembler output file may not compile because the\n"
" * disassembler did not know how many arguments to assign to the\n"
" * unresolved methods.\n"
+ " *\n"
+ " * If necessary, the -fe option can be used to specify a file containing\n"
+ " * control method external declarations with the associated method\n"
+ " * argument counts. Each line of the file must be of the form:\n"
+ " * External (<method pathname>, MethodObj, <argument count>)\n"
+ " * Invocation:\n"
+ " * iasl -fe refs.txt -d dsdt.aml\n"
+ " *\n"
+ " * The following methods were unresolved and many not compile properly\n"
+ " * because the disassembler had to guess at the number of arguments\n"
+ " * required for each:\n"
" */\n",
AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods,
(AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"),
@@ -1245,10 +1344,18 @@ AcpiDmUnresolvedWarning (
"were not specified. The resulting disassembler output file may not\n"
"compile because the disassembler did not know how many arguments\n"
"to assign to these methods. To specify the tables needed to resolve\n"
- "external control method references, use the one of the following\n"
- "example iASL invocations:\n"
- " iasl -e <ssdt1.aml,ssdt2.aml...> -d <dsdt.aml>\n"
- " iasl -e <dsdt.aml,ssdt2.aml...> -d <ssdt1.aml>\n",
+ "external control method references, the -e option can be used to\n"
+ "specify the filenames. Example iASL invocations:\n"
+ " iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n"
+ " iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n"
+ " iasl -e ssdt*.aml -d dsdt.aml\n"
+ "\n"
+ "In addition, the -fe option can be used to specify a file containing\n"
+ "control method external declarations with the associated method\n"
+ "argument counts. Each line of the file must be of the form:\n"
+ " External (<method pathname>, MethodObj, <argument count>)\n"
+ "Invocation:\n"
+ " iasl -fe refs.txt -d dsdt.aml\n",
AcpiGbl_NumExternalMethods);
}
else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods)
@@ -1258,10 +1365,17 @@ AcpiDmUnresolvedWarning (
fprintf (stderr, "\n"
"iASL Warning: There were %u external control methods found during\n"
"disassembly, but only %u %s resolved (%u unresolved). Additional\n"
- "ACPI tables are required to properly disassemble the code. The\n"
+ "ACPI tables may be required to properly disassemble the code. The\n"
"resulting disassembler output file may not compile because the\n"
"disassembler did not know how many arguments to assign to the\n"
- "unresolved methods.\n",
+ "unresolved methods.\n"
+ "\n"
+ "If necessary, the -fe option can be used to specify a file containing\n"
+ "control method external declarations with the associated method\n"
+ "argument counts. Each line of the file must be of the form:\n"
+ " External (<method pathname>, MethodObj, <argument count>)\n"
+ "Invocation:\n"
+ " iasl -fe refs.txt -d dsdt.aml\n",
AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods,
(AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"),
(AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods));
diff --git a/sys/contrib/dev/acpica/common/dmrestag.c b/sys/contrib/dev/acpica/common/dmrestag.c
index 9b85498..c457658 100644
--- a/sys/contrib/dev/acpica/common/dmrestag.c
+++ b/sys/contrib/dev/acpica/common/dmrestag.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/common/dmtable.c b/sys/contrib/dev/acpica/common/dmtable.c
index e7ce520..d33d86f 100644
--- a/sys/contrib/dev/acpica/common/dmtable.c
+++ b/sys/contrib/dev/acpica/common/dmtable.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -87,9 +87,21 @@ static const char *AcpiDmDmarSubnames[] =
"Reserved Memory Region",
"Root Port ATS Capability",
"Remapping Hardware Static Affinity",
+ "ACPI Namespace Device Declaration",
"Unknown SubTable Type" /* Reserved */
};
+static const char *AcpiDmDmarScope[] =
+{
+ "Reserved value",
+ "PCI Endpoint Device",
+ "PCI Bridge Device",
+ "IOAPIC Device",
+ "Message-capable HPET Device",
+ "Namespace Device",
+ "Unknown Scope Type" /* Reserved */
+};
+
static const char *AcpiDmEinjActions[] =
{
"Begin Operation",
@@ -160,6 +172,13 @@ static const char *AcpiDmErstInstructions[] =
"Unknown Instruction"
};
+static const char *AcpiDmGtdtSubnames[] =
+{
+ "Generic Timer Block",
+ "Generic Watchdog Timer",
+ "Unknown SubTable Type" /* Reserved */
+};
+
static const char *AcpiDmHestSubnames[] =
{
"IA-32 Machine Check Exception",
@@ -189,20 +208,29 @@ static const char *AcpiDmHestNotifySubnames[] =
static const char *AcpiDmMadtSubnames[] =
{
- "Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */
- "I/O APIC", /* ACPI_MADT_TYPE_IO_APIC */
- "Interrupt Source Override", /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */
- "NMI Source", /* ACPI_MADT_TYPE_NMI_SOURCE */
- "Local APIC NMI", /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */
- "Local APIC Address Override", /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */
- "I/O SAPIC", /* ACPI_MADT_TYPE_IO_SAPIC */
- "Local SAPIC", /* ACPI_MADT_TYPE_LOCAL_SAPIC */
- "Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */
- "Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */
- "Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */
- "Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */
- "Generic Interrupt Distributor",/* ACPI_MADT_GENERIC_DISTRIBUTOR */
- "Unknown SubTable Type" /* Reserved */
+ "Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */
+ "I/O APIC", /* ACPI_MADT_TYPE_IO_APIC */
+ "Interrupt Source Override", /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */
+ "NMI Source", /* ACPI_MADT_TYPE_NMI_SOURCE */
+ "Local APIC NMI", /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */
+ "Local APIC Address Override", /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */
+ "I/O SAPIC", /* ACPI_MADT_TYPE_IO_SAPIC */
+ "Local SAPIC", /* ACPI_MADT_TYPE_LOCAL_SAPIC */
+ "Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */
+ "Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */
+ "Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */
+ "Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */
+ "Generic Interrupt Distributor", /* ACPI_MADT_GENERIC_DISTRIBUTOR */
+ "Generic MSI Frame", /* ACPI_MADT_GENERIC_MSI_FRAME */
+ "Generic Interrupt Redistributor", /* ACPI_MADT_GENERIC_REDISTRIBUTOR */
+ "Unknown SubTable Type" /* Reserved */
+};
+
+static const char *AcpiDmPcctSubnames[] =
+{
+ "Generic Communications Subspace", /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */
+ "HW-Reduced Communications Subspace",
+ "Unknown SubTable Type" /* Reserved */
};
static const char *AcpiDmPmttSubnames[] =
@@ -225,6 +253,7 @@ static const char *AcpiDmSratSubnames[] =
"Processor Local APIC/SAPIC Affinity",
"Memory Affinity",
"Processor Local x2APIC Affinity",
+ "GICC Affinity",
"Unknown SubTable Type" /* Reserved */
};
@@ -235,6 +264,12 @@ static const char *AcpiDmIvrsSubnames[] =
"Unknown SubTable Type" /* Reserved */
};
+static const char *AcpiDmLpitSubnames[] =
+{
+ "Native C-state Idle Structure",
+ "Simple I/O Idle Structure",
+ "Unknown SubTable Type" /* Reserved */
+};
#define ACPI_FADT_PM_RESERVED 9
@@ -286,7 +321,7 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot, "Simple Boot Flag Table"},
{ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep, "Corrected Platform Error Polling table"},
{ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt, "Core System Resource Table"},
- {ACPI_SIG_DBG2, NULL, AcpiDmDumpDbg2, NULL, NULL, "Debug Port table type 2"},
+ {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2, "Debug Port table type 2"},
{ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp, "Debug Port table"},
{ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar, "DMA Remapping table"},
{ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, TemplateEcdt, "Embedded Controller Boot Resources Table"},
@@ -294,17 +329,18 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst, "Error Record Serialization Table"},
{ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt, "Fixed ACPI Description Table (FADT)"},
{ACPI_SIG_FPDT, NULL, AcpiDmDumpFpdt, DtCompileFpdt, TemplateFpdt, "Firmware Performance Data Table"},
- {ACPI_SIG_GTDT, AcpiDmTableInfoGtdt, NULL, NULL, TemplateGtdt, "Generic Timer Description Table"},
+ {ACPI_SIG_GTDT, NULL, AcpiDmDumpGtdt, DtCompileGtdt, TemplateGtdt, "Generic Timer Description Table"},
{ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest, "Hardware Error Source Table"},
{ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet, "High Precision Event Timer table"},
{ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs, "I/O Virtualization Reporting Structure"},
+ {ACPI_SIG_LPIT, NULL, AcpiDmDumpLpit, DtCompileLpit, TemplateLpit, "Low Power Idle Table"},
{ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt, "Multiple APIC Description Table (MADT)"},
{ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg, "Memory Mapped Configuration table"},
{ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi, "Management Controller Host Interface table"},
{ACPI_SIG_MPST, AcpiDmTableInfoMpst, AcpiDmDumpMpst, DtCompileMpst, TemplateMpst, "Memory Power State Table"},
{ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct, "Maximum System Characteristics Table"},
{ACPI_SIG_MTMR, NULL, AcpiDmDumpMtmr, DtCompileMtmr, TemplateMtmr, "MID Timer Table"},
- {ACPI_SIG_PCCT, NULL, AcpiDmDumpPcct, NULL, NULL, "Platform Communications Channel Table"},
+ {ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct, "Platform Communications Channel Table"},
{ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt, "Platform Memory Topology Table"},
{ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt, "Root System Description Table"},
{ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt, "S3 Performance Table"},
@@ -650,6 +686,7 @@ AcpiDmDumpTable (
UINT32 ByteLength;
UINT8 Temp8;
UINT16 Temp16;
+ UINT64 Value;
ACPI_DMTABLE_DATA *TableData;
const char *Name;
BOOLEAN LastOutputBlankLine = FALSE;
@@ -691,7 +728,9 @@ AcpiDmDumpTable (
case ACPI_DMT_SPACEID:
case ACPI_DMT_ACCWIDTH:
case ACPI_DMT_IVRS:
+ case ACPI_DMT_GTDT:
case ACPI_DMT_MADT:
+ case ACPI_DMT_PCCT:
case ACPI_DMT_PMTT:
case ACPI_DMT_SRAT:
case ACPI_DMT_ASF:
@@ -701,6 +740,7 @@ AcpiDmDumpTable (
case ACPI_DMT_EINJINST:
case ACPI_DMT_ERSTACT:
case ACPI_DMT_ERSTINST:
+ case ACPI_DMT_DMAR_SCOPE:
ByteLength = 1;
break;
@@ -721,6 +761,7 @@ AcpiDmDumpTable (
case ACPI_DMT_NAME4:
case ACPI_DMT_SIG:
case ACPI_DMT_SLIC:
+ case ACPI_DMT_LPIT:
ByteLength = 4;
break;
@@ -863,10 +904,19 @@ AcpiDmDumpTable (
* Dump bytes - high byte first, low byte last.
* Note: All ACPI tables are little-endian.
*/
+ Value = 0;
for (Temp8 = (UINT8) ByteLength; Temp8 > 0; Temp8--)
{
AcpiOsPrintf ("%2.2X", Target[Temp8 - 1]);
+ Value |= Target[Temp8 - 1];
+ Value <<= 8;
+ }
+
+ if (!Value && (Info->Flags & DT_DESCRIBES_OPTIONAL))
+ {
+ AcpiOsPrintf (" [Optional field not present]");
}
+
AcpiOsPrintf ("\n");
break;
@@ -1022,6 +1072,19 @@ AcpiDmDumpTable (
AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]);
break;
+ case ACPI_DMT_DMAR_SCOPE:
+
+ /* DMAR device scope types */
+
+ Temp8 = *Target;
+ if (Temp8 > ACPI_DMAR_SCOPE_TYPE_RESERVED)
+ {
+ Temp8 = ACPI_DMAR_SCOPE_TYPE_RESERVED;
+ }
+
+ AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmDmarScope[Temp8]);
+ break;
+
case ACPI_DMT_EINJACT:
/* EINJ Action types */
@@ -1074,6 +1137,19 @@ AcpiDmDumpTable (
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstInstructions[Temp8]);
break;
+ case ACPI_DMT_GTDT:
+
+ /* GTDT subtable types */
+
+ Temp8 = *Target;
+ if (Temp8 > ACPI_GTDT_TYPE_RESERVED)
+ {
+ Temp8 = ACPI_GTDT_TYPE_RESERVED;
+ }
+
+ AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGtdtSubnames[Temp8]);
+ break;
+
case ACPI_DMT_HEST:
/* HEST subtable types */
@@ -1122,6 +1198,19 @@ AcpiDmDumpTable (
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmMadtSubnames[Temp8]);
break;
+ case ACPI_DMT_PCCT:
+
+ /* PCCT subtable types */
+
+ Temp8 = *Target;
+ if (Temp8 > ACPI_PCCT_TYPE_RESERVED)
+ {
+ Temp8 = ACPI_PCCT_TYPE_RESERVED;
+ }
+
+ AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmPcctSubnames[Temp8]);
+ break;
+
case ACPI_DMT_PMTT:
/* PMTT subtable types */
@@ -1202,6 +1291,32 @@ AcpiDmDumpTable (
AcpiOsPrintf (UINT8_FORMAT, *Target, Name);
break;
+ case ACPI_DMT_LPIT:
+
+ /* LPIT subtable types */
+
+ Temp8 = *Target;
+ switch (Temp8)
+ {
+ case ACPI_LPIT_TYPE_NATIVE_CSTATE:
+
+ Name = AcpiDmLpitSubnames[0];
+ break;
+
+ case ACPI_LPIT_TYPE_SIMPLE_IO:
+
+ Name = AcpiDmLpitSubnames[1];
+ break;
+
+ default:
+
+ Name = AcpiDmLpitSubnames[2];
+ break;
+ }
+
+ AcpiOsPrintf (UINT32_FORMAT, *Target, Name);
+ break;
+
case ACPI_DMT_EXIT:
return (AE_OK);
diff --git a/sys/contrib/dev/acpica/common/dmtbdump.c b/sys/contrib/dev/acpica/common/dmtbdump.c
index 89d38e7..399afa5 100644
--- a/sys/contrib/dev/acpica/common/dmtbdump.c
+++ b/sys/contrib/dev/acpica/common/dmtbdump.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -419,12 +419,12 @@ AcpiDmDumpAsf (
UINT8 Type;
- /* No main table, only sub-tables */
+ /* No main table, only subtables */
SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
SubTable->Header.Length, AcpiDmTableInfoAsfHdr);
@@ -479,7 +479,7 @@ AcpiDmDumpAsf (
default:
- AcpiOsPrintf ("\n**** Unknown ASF sub-table type 0x%X\n", SubTable->Header.Type);
+ AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n", SubTable->Header.Type);
return;
}
@@ -541,7 +541,7 @@ AcpiDmDumpAsf (
AcpiOsPrintf ("\n");
- /* Point to next sub-table */
+ /* Point to next subtable */
if (!SubTable->Header.Length)
{
@@ -586,7 +586,7 @@ AcpiDmDumpCpep (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset);
while (Offset < Table->Length)
@@ -599,7 +599,7 @@ AcpiDmDumpCpep (
return;
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Header.Length;
SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable,
@@ -638,7 +638,7 @@ AcpiDmDumpCsrt (
/* The main table only contains the ACPI header, thus already handled */
- /* Sub-tables (Resource Groups) */
+ /* Subtables (Resource Groups) */
SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset);
while (Offset < Table->Length)
@@ -702,7 +702,7 @@ AcpiDmDumpCsrt (
SubSubTable->Length);
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, SubTable,
@@ -746,7 +746,7 @@ AcpiDmDumpDbg2 (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
while (Offset < Table->Length)
@@ -809,10 +809,13 @@ AcpiDmDumpDbg2 (
/* Dump the OemData (optional) */
- AcpiDmDumpBuffer (SubTable, SubTable->OemDataOffset, SubTable->OemDataLength,
- Offset + SubTable->OemDataOffset, "OEM Data");
+ if (SubTable->OemDataOffset)
+ {
+ AcpiDmDumpBuffer (SubTable, SubTable->OemDataOffset, SubTable->OemDataLength,
+ Offset + SubTable->OemDataOffset, "OEM Data");
+ }
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, SubTable,
@@ -858,12 +861,12 @@ AcpiDmDumpDmar (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
@@ -888,21 +891,27 @@ AcpiDmDumpDmar (
ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY);
break;
- case ACPI_DMAR_TYPE_ATSR:
+ case ACPI_DMAR_TYPE_ROOT_ATS:
InfoTable = AcpiDmTableInfoDmar2;
ScopeOffset = sizeof (ACPI_DMAR_ATSR);
break;
- case ACPI_DMAR_HARDWARE_AFFINITY:
+ case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
InfoTable = AcpiDmTableInfoDmar3;
ScopeOffset = sizeof (ACPI_DMAR_RHSA);
break;
+ case ACPI_DMAR_TYPE_NAMESPACE:
+
+ InfoTable = AcpiDmTableInfoDmar4;
+ ScopeOffset = sizeof (ACPI_DMAR_ANDD);
+ break;
+
default:
- AcpiOsPrintf ("\n**** Unknown DMAR sub-table type 0x%X\n\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", SubTable->Type);
return;
}
@@ -913,7 +922,16 @@ AcpiDmDumpDmar (
return;
}
- /* Dump the device scope entries (if any) */
+ /*
+ * Dump the optional device scope entries
+ */
+ if ((SubTable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
+ (SubTable->Type == ACPI_DMAR_TYPE_NAMESPACE))
+ {
+ /* These types do not support device scopes */
+
+ goto NextSubtable;
+ }
ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset);
while (ScopeOffset < SubTable->Length)
@@ -953,7 +971,8 @@ AcpiDmDumpDmar (
ScopeTable, ScopeTable->Length);
}
- /* Point to next sub-table */
+NextSubtable:
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable, SubTable->Length);
@@ -992,7 +1011,7 @@ AcpiDmDumpEinj (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
while (Offset < Table->Length)
@@ -1005,7 +1024,7 @@ AcpiDmDumpEinj (
return;
}
- /* Point to next sub-table (each subtable is of fixed length) */
+ /* Point to next subtable (each subtable is of fixed length) */
Offset += sizeof (ACPI_WHEA_HEADER);
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
@@ -1045,7 +1064,7 @@ AcpiDmDumpErst (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
while (Offset < Table->Length)
@@ -1058,7 +1077,7 @@ AcpiDmDumpErst (
return;
}
- /* Point to next sub-table (each subtable is of fixed length) */
+ /* Point to next subtable (each subtable is of fixed length) */
Offset += sizeof (ACPI_WHEA_HEADER);
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
@@ -1093,12 +1112,12 @@ AcpiDmDumpFpdt (
/* There is no main table (other than the standard ACPI header) */
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
@@ -1122,7 +1141,7 @@ AcpiDmDumpFpdt (
default:
- AcpiOsPrintf ("\n**** Unknown FPDT sub-table type 0x%X\n\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n", SubTable->Type);
/* Attempt to continue */
@@ -1142,7 +1161,7 @@ AcpiDmDumpFpdt (
}
NextSubTable:
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable, SubTable->Length);
@@ -1152,6 +1171,123 @@ NextSubTable:
/*******************************************************************************
*
+ * FUNCTION: AcpiDmDumpGtdt
+ *
+ * PARAMETERS: Table - A GTDT table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Format the contents of a GTDT. This table type consists
+ * of an open-ended number of subtables.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpGtdt (
+ ACPI_TABLE_HEADER *Table)
+{
+ ACPI_STATUS Status;
+ ACPI_GTDT_HEADER *SubTable;
+ UINT32 Length = Table->Length;
+ UINT32 Offset = sizeof (ACPI_TABLE_GTDT);
+ ACPI_DMTABLE_INFO *InfoTable;
+ UINT32 SubTableLength;
+ UINT32 GtCount;
+ ACPI_GTDT_TIMER_ENTRY *GtxTable;
+
+
+ /* Main table */
+
+ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoGtdt);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Subtables */
+
+ SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
+ while (Offset < Table->Length)
+ {
+ /* Common subtable header */
+
+ AcpiOsPrintf ("\n");
+ Status = AcpiDmDumpTable (Length, Offset, SubTable,
+ SubTable->Length, AcpiDmTableInfoGtdtHdr);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ GtCount = 0;
+ switch (SubTable->Type)
+ {
+ case ACPI_GTDT_TYPE_TIMER_BLOCK:
+
+ SubTableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
+ GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
+ SubTable))->TimerCount;
+
+ InfoTable = AcpiDmTableInfoGtdt0;
+ break;
+
+ case ACPI_GTDT_TYPE_WATCHDOG:
+
+ SubTableLength = sizeof (ACPI_GTDT_WATCHDOG);
+
+ InfoTable = AcpiDmTableInfoGtdt1;
+ break;
+
+ default:
+
+ /* Cannot continue on unknown type - no length */
+
+ AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n", SubTable->Type);
+ return;
+ }
+
+ Status = AcpiDmDumpTable (Length, Offset, SubTable,
+ SubTable->Length, InfoTable);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Point to end of current subtable (each subtable above is of fixed length) */
+
+ Offset += SubTableLength;
+
+ /* If there are any Gt Timer Blocks from above, dump them now */
+
+ if (GtCount)
+ {
+ GtxTable = ACPI_ADD_PTR (ACPI_GTDT_TIMER_ENTRY, SubTable, SubTableLength);
+ SubTableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY);
+
+ while (GtCount)
+ {
+ AcpiOsPrintf ("\n");
+ Status = AcpiDmDumpTable (Length, Offset, GtxTable,
+ sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+ Offset += sizeof (ACPI_GTDT_TIMER_ENTRY);
+ GtxTable++;
+ GtCount--;
+ }
+ }
+
+ /* Point to next subtable */
+
+ SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, SubTable, SubTableLength);
+ }
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmDumpHest
*
* PARAMETERS: Table - A HEST table
@@ -1185,7 +1321,7 @@ AcpiDmDumpHest (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
while (Offset < Table->Length)
@@ -1243,7 +1379,7 @@ AcpiDmDumpHest (
/* Cannot continue on unknown type - no length */
- AcpiOsPrintf ("\n**** Unknown HEST sub-table type 0x%X\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n", SubTable->Type);
return;
}
@@ -1281,7 +1417,7 @@ AcpiDmDumpHest (
}
}
- /* Point to next sub-table */
+ /* Point to next subtable */
SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, SubTable, SubTableLength);
}
@@ -1324,12 +1460,12 @@ AcpiDmDumpIvrs (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -1355,7 +1491,7 @@ AcpiDmDumpIvrs (
default:
- AcpiOsPrintf ("\n**** Unknown IVRS sub-table type 0x%X\n",
+ AcpiOsPrintf ("\n**** Unknown IVRS subtable type 0x%X\n",
SubTable->Type);
/* Attempt to continue */
@@ -1458,7 +1594,7 @@ AcpiDmDumpIvrs (
}
NextSubTable:
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, SubTable, SubTable->Length);
@@ -1468,6 +1604,85 @@ NextSubTable:
/*******************************************************************************
*
+ * FUNCTION: AcpiDmDumpLpit
+ *
+ * PARAMETERS: Table - A LPIT table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Format the contents of a LPIT. This table type consists
+ * of an open-ended number of subtables. Note: There are no
+ * entries in the main table. An LPIT consists of the table
+ * header and then subtables only.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpLpit (
+ ACPI_TABLE_HEADER *Table)
+{
+ ACPI_STATUS Status;
+ ACPI_LPIT_HEADER *SubTable;
+ UINT32 Length = Table->Length;
+ UINT32 Offset = sizeof (ACPI_TABLE_LPIT);
+ ACPI_DMTABLE_INFO *InfoTable;
+ UINT32 SubTableLength;
+
+
+ /* Subtables */
+
+ SubTable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, Table, Offset);
+ while (Offset < Table->Length)
+ {
+ /* Common subtable header */
+
+ Status = AcpiDmDumpTable (Length, Offset, SubTable,
+ sizeof (ACPI_LPIT_HEADER), AcpiDmTableInfoLpitHdr);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ switch (SubTable->Type)
+ {
+ case ACPI_LPIT_TYPE_NATIVE_CSTATE:
+
+ InfoTable = AcpiDmTableInfoLpit0;
+ SubTableLength = sizeof (ACPI_LPIT_NATIVE);
+ break;
+
+ case ACPI_LPIT_TYPE_SIMPLE_IO:
+
+ InfoTable = AcpiDmTableInfoLpit1;
+ SubTableLength = sizeof (ACPI_LPIT_IO);
+ break;
+
+ default:
+
+ /* Cannot continue on unknown type - no length */
+
+ AcpiOsPrintf ("\n**** Unknown LPIT subtable type 0x%X\n", SubTable->Type);
+ return;
+ }
+
+ Status = AcpiDmDumpTable (Length, Offset, SubTable,
+ SubTableLength, InfoTable);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+ AcpiOsPrintf ("\n");
+
+ /* Point to next subtable */
+
+ Offset += SubTableLength;
+ SubTable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, SubTable, SubTableLength);
+ }
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmDumpMadt
*
* PARAMETERS: Table - A MADT table
@@ -1498,12 +1713,12 @@ AcpiDmDumpMadt (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
@@ -1580,9 +1795,19 @@ AcpiDmDumpMadt (
InfoTable = AcpiDmTableInfoMadt12;
break;
+ case ACPI_MADT_TYPE_GENERIC_MSI_FRAME:
+
+ InfoTable = AcpiDmTableInfoMadt13;
+ break;
+
+ case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR:
+
+ InfoTable = AcpiDmTableInfoMadt14;
+ break;
+
default:
- AcpiOsPrintf ("\n**** Unknown MADT sub-table type 0x%X\n\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown MADT subtable type 0x%X\n\n", SubTable->Type);
/* Attempt to continue */
@@ -1602,7 +1827,7 @@ AcpiDmDumpMadt (
}
NextSubTable:
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
@@ -1639,7 +1864,7 @@ AcpiDmDumpMcfg (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset);
while (Offset < Table->Length)
@@ -1659,7 +1884,7 @@ AcpiDmDumpMcfg (
return;
}
- /* Point to next sub-table (each subtable is of fixed length) */
+ /* Point to next subtable (each subtable is of fixed length) */
Offset += sizeof (ACPI_MCFG_ALLOCATION);
SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, SubTable,
@@ -1841,12 +2066,12 @@ AcpiDmDumpMsct (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -1856,7 +2081,7 @@ AcpiDmDumpMsct (
return;
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += sizeof (ACPI_MSCT_PROXIMITY);
SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, SubTable, sizeof (ACPI_MSCT_PROXIMITY));
@@ -1893,12 +2118,12 @@ AcpiDmDumpMtmr (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -1908,7 +2133,7 @@ AcpiDmDumpMtmr (
return;
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += sizeof (ACPI_MTMR_ENTRY);
SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, SubTable, sizeof (ACPI_MTMR_ENTRY));
@@ -1935,6 +2160,7 @@ AcpiDmDumpPcct (
{
ACPI_STATUS Status;
ACPI_PCCT_SUBSPACE *SubTable;
+ ACPI_DMTABLE_INFO *InfoTable;
UINT32 Length = Table->Length;
UINT32 Offset = sizeof (ACPI_TABLE_PCCT);
@@ -1947,20 +2173,50 @@ AcpiDmDumpPcct (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Table, Offset);
while (Offset < Table->Length)
{
+ /* Common subtable header */
+
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
- SubTable->Header.Length, AcpiDmTableInfoPcct0);
+ SubTable->Header.Length, AcpiDmTableInfoPcctHdr);
if (ACPI_FAILURE (Status))
{
return;
}
- /* Point to next sub-table */
+ switch (SubTable->Header.Type)
+ {
+ case ACPI_PCCT_TYPE_GENERIC_SUBSPACE:
+
+ InfoTable = AcpiDmTableInfoPcct0;
+ break;
+
+ case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE:
+
+ InfoTable = AcpiDmTableInfoPcct1;
+ break;
+
+ default:
+
+ AcpiOsPrintf (
+ "\n**** Unexpected or unknown PCCT subtable type 0x%X\n\n",
+ SubTable->Header.Type);
+ return;
+ }
+
+ AcpiOsPrintf ("\n");
+ Status = AcpiDmDumpTable (Length, Offset, SubTable,
+ SubTable->Header.Length, InfoTable);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Point to next subtable */
Offset += SubTable->Header.Length;
SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, SubTable,
@@ -2108,8 +2364,7 @@ AcpiDmDumpPmtt (
if (DomainCount)
{
AcpiOsPrintf (
- "\n**** DomainCount exceeds subtable length\n\n",
- MemSubTable->Type);
+ "\n**** DomainCount exceeds subtable length\n\n");
}
/* Walk the physical component (DIMM) subtables */
@@ -2209,7 +2464,7 @@ AcpiDmDumpS3pt (
SubTable = ACPI_ADD_PTR (ACPI_S3PT_HEADER, S3ptTable, Offset);
while (Offset < S3ptTable->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable,
@@ -2233,7 +2488,7 @@ AcpiDmDumpS3pt (
default:
- AcpiOsPrintf ("\n**** Unknown S3PT sub-table type 0x%X\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n", SubTable->Type);
/* Attempt to continue */
@@ -2254,7 +2509,7 @@ AcpiDmDumpS3pt (
}
NextSubTable:
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_S3PT_HEADER, SubTable, SubTable->Length);
@@ -2291,7 +2546,7 @@ AcpiDmDumpSlic (
SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -2315,7 +2570,7 @@ AcpiDmDumpSlic (
default:
- AcpiOsPrintf ("\n**** Unknown SLIC sub-table type 0x%X\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown SLIC subtable type 0x%X\n", SubTable->Type);
/* Attempt to continue */
@@ -2336,7 +2591,7 @@ AcpiDmDumpSlic (
}
NextSubTable:
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, SubTable, SubTable->Length);
@@ -2452,12 +2707,12 @@ AcpiDmDumpSrat (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -2484,8 +2739,13 @@ AcpiDmDumpSrat (
InfoTable = AcpiDmTableInfoSrat2;
break;
+ case ACPI_SRAT_TYPE_GICC_AFFINITY:
+
+ InfoTable = AcpiDmTableInfoSrat3;
+ break;
+
default:
- AcpiOsPrintf ("\n**** Unknown SRAT sub-table type 0x%X\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n", SubTable->Type);
/* Attempt to continue */
@@ -2506,7 +2766,7 @@ AcpiDmDumpSrat (
}
NextSubTable:
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
@@ -2543,12 +2803,12 @@ AcpiDmDumpVrtc (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -2558,7 +2818,7 @@ AcpiDmDumpVrtc (
return;
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += sizeof (ACPI_VRTC_ENTRY);
SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, SubTable, sizeof (ACPI_VRTC_ENTRY));
@@ -2595,12 +2855,12 @@ AcpiDmDumpWdat (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -2610,7 +2870,7 @@ AcpiDmDumpWdat (
return;
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += sizeof (ACPI_WDAT_ENTRY);
SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, SubTable, sizeof (ACPI_WDAT_ENTRY));
diff --git a/sys/contrib/dev/acpica/common/dmtbinfo.c b/sys/contrib/dev/acpica/common/dmtbinfo.c
index 4272a33..6a71c8a 100644
--- a/sys/contrib/dev/acpica/common/dmtbinfo.c
+++ b/sys/contrib/dev/acpica/common/dmtbinfo.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -137,11 +137,16 @@
#define ACPI_DMAR1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f)
#define ACPI_DMAR2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_ATSR,f)
#define ACPI_DMAR3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RHSA,f)
+#define ACPI_DMAR4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_ANDD,f)
#define ACPI_EINJ0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
#define ACPI_ERST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
#define ACPI_FPDTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_HEADER,f)
#define ACPI_FPDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_BOOT,f)
#define ACPI_FPDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_S3PT_PTR,f)
+#define ACPI_GTDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_TIMER_BLOCK,f)
+#define ACPI_GTDT0a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_TIMER_ENTRY,f)
+#define ACPI_GTDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_WATCHDOG,f)
+#define ACPI_GTDTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_HEADER,f)
#define ACPI_HEST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f)
#define ACPI_HEST1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f)
#define ACPI_HEST2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_NMI,f)
@@ -158,6 +163,9 @@
#define ACPI_IVRS8A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8A,f)
#define ACPI_IVRS8B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8B,f)
#define ACPI_IVRS8C_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8C,f)
+#define ACPI_LPITH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_LPIT_HEADER,f)
+#define ACPI_LPIT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_LPIT_NATIVE,f)
+#define ACPI_LPIT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_LPIT_IO,f)
#define ACPI_MADT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC,f)
#define ACPI_MADT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_IO_APIC,f)
#define ACPI_MADT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f)
@@ -171,6 +179,8 @@
#define ACPI_MADT10_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f)
#define ACPI_MADT11_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f)
#define ACPI_MADT12_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_DISTRIBUTOR,f)
+#define ACPI_MADT13_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_MSI_FRAME,f)
+#define ACPI_MADT14_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_REDISTRIBUTOR,f)
#define ACPI_MADTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
#define ACPI_MCFG0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f)
#define ACPI_MPST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_NODE,f)
@@ -181,6 +191,7 @@
#define ACPI_MSCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f)
#define ACPI_MTMR0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MTMR_ENTRY,f)
#define ACPI_PCCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f)
+#define ACPI_PCCT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED,f)
#define ACPI_PMTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_SOCKET,f)
#define ACPI_PMTT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_CONTROLLER,f)
#define ACPI_PMTT1A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_DOMAIN,f)
@@ -196,6 +207,7 @@
#define ACPI_SRAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f)
#define ACPI_SRAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
#define ACPI_SRAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f)
+#define ACPI_SRAT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_GICC_AFFINITY,f)
#define ACPI_VRTC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_VRTC_ENTRY,f)
#define ACPI_WDAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WDAT_ENTRY,f)
@@ -212,7 +224,11 @@
#define ACPI_SRAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_CPU_AFFINITY,f,o)
#define ACPI_SRAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_MEM_AFFINITY,f,o)
#define ACPI_SRAT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f,o)
+#define ACPI_SRAT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_GICC_AFFINITY,f,o)
#define ACPI_GTDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_GTDT,f,o)
+#define ACPI_GTDT0a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_TIMER_ENTRY,f,o)
+#define ACPI_GTDT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_WATCHDOG,f,o)
+#define ACPI_LPITH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_LPIT_HEADER,f,o)
#define ACPI_MADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_MADT,f,o)
#define ACPI_MADT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_APIC,f,o)
#define ACPI_MADT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f,o)
@@ -223,9 +239,11 @@
#define ACPI_MADT9_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC,f,o)
#define ACPI_MADT10_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f,o)
#define ACPI_MADT11_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f,o)
+#define ACPI_MADT13_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_GENERIC_MSI_FRAME,f,o)
#define ACPI_MPST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MPST_POWER_NODE,f,o)
#define ACPI_MPST2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MPST_POWER_DATA,f,o)
#define ACPI_PCCT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_PCCT,f,o)
+#define ACPI_PCCT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED,f,o)
#define ACPI_PMTTH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PMTT_HEADER,f,o)
#define ACPI_WDDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_WDDT,f,o)
#define ACPI_EINJ0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o)
@@ -436,17 +454,22 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[] =
{
{ACPI_DMT_GAS, ACPI_FADT_OFFSET (ResetRegister), "Reset Register", 0},
{ACPI_DMT_UINT8, ACPI_FADT_OFFSET (ResetValue), "Value to cause reset", 0},
- {ACPI_DMT_UINT24, ACPI_FADT_OFFSET (Reserved4[0]), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_FADT_OFFSET (ArmBootFlags), "Reserved", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (MinorRevision), "Reserved", 0},
ACPI_DMT_TERMINATOR
};
-/* ACPI 2.0+ Extensions (FADT version 3 and 4) */
+/* ACPI 2.0+ Extensions (FADT version 3, 4, and 5) */
ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[] =
{
{ACPI_DMT_GAS, ACPI_FADT_OFFSET (ResetRegister), "Reset Register", 0},
{ACPI_DMT_UINT8, ACPI_FADT_OFFSET (ResetValue), "Value to cause reset", 0},
- {ACPI_DMT_UINT24, ACPI_FADT_OFFSET (Reserved4[0]), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_FADT_OFFSET (ArmBootFlags), "ARM Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_FADT_FLAG_OFFSET(ArmBootFlags,0), "PSCI Compliant", 0},
+ {ACPI_DMT_FLAG1, ACPI_FADT_FLAG_OFFSET(ArmBootFlags,0), "Must use HVC for PSCI", 0},
+ ACPI_DMT_NEW_LINE,
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (MinorRevision), "FADT Minor Revision", 0},
{ACPI_DMT_UINT64, ACPI_FADT_OFFSET (XFacs), "FACS Address", 0},
{ACPI_DMT_UINT64, ACPI_FADT_OFFSET (XDsdt), "DSDT Address", 0},
{ACPI_DMT_GAS, ACPI_FADT_OFFSET (XPm1aEventBlock), "PM1A Event Block", 0},
@@ -720,12 +743,12 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Device[] =
{
{ACPI_DMT_UINT8, ACPI_DBG20_OFFSET (Revision), "Revision", 0},
- {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (Length), "Length", 0},
+ {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (Length), "Length", DT_LENGTH},
{ACPI_DMT_UINT8, ACPI_DBG20_OFFSET (RegisterCount), "Register Count", 0},
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (NamepathLength), "Namepath Length", 0},
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (NamepathOffset), "Namepath Offset", 0},
- {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (OemDataLength), "OEM Data Length", 0},
- {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (OemDataOffset), "OEM Data Offset", 0},
+ {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (OemDataLength), "OEM Data Length", DT_DESCRIBES_OPTIONAL},
+ {ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (OemDataOffset), "OEM Data Offset", DT_DESCRIBES_OPTIONAL},
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (PortType), "Port Type", 0},
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (PortSubtype), "Port Subtype", 0},
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (Reserved), "Reserved", 0},
@@ -754,6 +777,12 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Name[] =
ACPI_DMT_TERMINATOR
};
+ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2OemData[] =
+{
+ {ACPI_DMT_BUFFER, 0, "OEM Data", DT_OPTIONAL},
+ ACPI_DMT_TERMINATOR
+};
+
/*******************************************************************************
*
@@ -797,7 +826,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[] =
{
- {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (EntryType), "Device Scope Entry Type", 0},
+ {ACPI_DMT_DMAR_SCOPE, ACPI_DMARS_OFFSET (EntryType), "Device Scope Type", 0},
{ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Length), "Entry Length", DT_LENGTH},
{ACPI_DMT_UINT16, ACPI_DMARS_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (EnumerationId), "Enumeration ID", 0},
@@ -849,6 +878,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[] =
ACPI_DMT_TERMINATOR
};
+/* 4: ACPI Namespace Device Declaration Structure */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoDmar4[] =
+{
+ {ACPI_DMT_UINT24, ACPI_DMAR4_OFFSET (Reserved[0]), "Reserved", 0},
+ {ACPI_DMT_UINT8, ACPI_DMAR4_OFFSET (DeviceNumber), "Device Number", 0},
+ {ACPI_DMT_STRING, ACPI_DMAR4_OFFSET (DeviceName[0]), "Device Name", 0},
+ ACPI_DMT_TERMINATOR
+};
+
/*******************************************************************************
*
@@ -988,29 +1027,89 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt1[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[] =
{
- {ACPI_DMT_UINT64, ACPI_GTDT_OFFSET (Address), "Timer Address", 0},
- {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
- {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (Flags,0), "Memory Present", 0},
+ {ACPI_DMT_UINT64, ACPI_GTDT_OFFSET (CounterBlockAddresss), "Counter Block Address", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (Reserved), "Reserved", 0},
ACPI_DMT_NEW_LINE,
- {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecurePl1Interrupt), "Secure PL1 Interrupt", 0},
- {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecurePl1Flags), "SPL1 Flags (decoded below)", DT_FLAG},
- {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (SecurePl1Flags,0), "Trigger Mode", 0},
- {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (SecurePl1Flags,0), "Polarity", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecureEl1Interrupt), "Secure EL1 Interrupt", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecureEl1Flags), "EL1 Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (SecureEl1Flags,0), "Trigger Mode", 0},
+ {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (SecureEl1Flags,0), "Polarity", 0},
+ {ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (SecureEl1Flags,0), "Always On", 0},
ACPI_DMT_NEW_LINE,
- {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl1Interrupt), "Non-Secure PL1 Interrupt", 0},
- {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl1Flags), "NSPL1 Flags (decoded below)", DT_FLAG},
- {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecurePl1Flags,0),"Trigger Mode", 0},
- {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecurePl1Flags,0),"Polarity", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl1Interrupt), "Non-Secure EL1 Interrupt", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl1Flags), "NEL1 Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecureEl1Flags,0),"Trigger Mode", 0},
+ {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecureEl1Flags,0),"Polarity", 0},
+ {ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (NonSecureEl1Flags,0),"Always On", 0},
ACPI_DMT_NEW_LINE,
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (VirtualTimerInterrupt), "Virtual Timer Interrupt", 0},
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (VirtualTimerFlags), "VT Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Trigger Mode", 0},
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Polarity", 0},
+ {ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Always On", 0},
ACPI_DMT_NEW_LINE,
- {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl2Interrupt), "Non-Secure PL2 Interrupt", 0},
- {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl2Flags), "NSPL2 Flags (decoded below)", DT_FLAG},
- {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecurePl2Flags,0),"Trigger Mode", 0},
- {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecurePl2Flags,0),"Polarity", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl2Interrupt), "Non-Secure EL2 Interrupt", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl2Flags), "NEL2 Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecureEl2Flags,0),"Trigger Mode", 0},
+ {ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecureEl2Flags,0),"Polarity", 0},
+ {ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (NonSecureEl2Flags,0),"Always On", 0},
+ {ACPI_DMT_UINT64, ACPI_GTDT_OFFSET (CounterReadBlockAddress), "Counter Read Block Address", 0},
+ ACPI_DMT_NEW_LINE,
+ {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (PlatformTimerCount), "Platform Timer Count", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (PlatformTimerOffset), "Platform Timer Offset", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* GTDT Subtable header (one per Subtable) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtHdr[] =
+{
+ {ACPI_DMT_GTDT, ACPI_GTDTH_OFFSET (Type), "Subtable Type", 0},
+ {ACPI_DMT_UINT16, ACPI_GTDTH_OFFSET (Length), "Length", DT_LENGTH},
+ ACPI_DMT_TERMINATOR
+};
+
+/* GTDT Subtables */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0[] =
+{
+ {ACPI_DMT_UINT8, ACPI_GTDT0_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_GTDT0_OFFSET (BlockAddress), "Block Address", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT0_OFFSET (TimerCount), "Timer Count", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT0_OFFSET (TimerOffset), "Timer Offset", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0a[] =
+{
+ {ACPI_DMT_UINT8 , ACPI_GTDT0a_OFFSET (FrameNumber), "Frame Number", 0},
+ {ACPI_DMT_UINT24, ACPI_GTDT0a_OFFSET (Reserved[0]), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_GTDT0a_OFFSET (BaseAddress), "Base Address", 0},
+ {ACPI_DMT_UINT64, ACPI_GTDT0a_OFFSET (El0BaseAddress), "EL0 Base Address", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (TimerInterrupt), "Timer Interrupt", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (TimerFlags), "Timer Flags (decoded below)", 0},
+ {ACPI_DMT_FLAG0, ACPI_GTDT0a_FLAG_OFFSET (TimerFlags,0), "Trigger Mode", 0},
+ {ACPI_DMT_FLAG1, ACPI_GTDT0a_FLAG_OFFSET (TimerFlags,0), "Polarity", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (VirtualTimerInterrupt), "Virtual Timer Interrupt", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (VirtualTimerFlags), "Virtual Timer Flags (decoded below)", 0},
+ {ACPI_DMT_FLAG0, ACPI_GTDT0a_FLAG_OFFSET (VirtualTimerFlags,0), "Trigger Mode", 0},
+ {ACPI_DMT_FLAG1, ACPI_GTDT0a_FLAG_OFFSET (VirtualTimerFlags,0), "Polarity", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (CommonFlags), "Common Flags (decoded below)", 0},
+ {ACPI_DMT_FLAG0, ACPI_GTDT0a_FLAG_OFFSET (CommonFlags,0), "Secure", 0},
+ {ACPI_DMT_FLAG1, ACPI_GTDT0a_FLAG_OFFSET (CommonFlags,0), "Always On", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt1[] =
+{
+ {ACPI_DMT_UINT8, ACPI_GTDT1_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_GTDT1_OFFSET (RefreshFrameAddress), "Refresh Frame Address", 0},
+ {ACPI_DMT_UINT64, ACPI_GTDT1_OFFSET (ControlFrameAddress), "Control Frame Address", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT1_OFFSET (TimerInterrupt), "Timer Interrupt", 0},
+ {ACPI_DMT_UINT32, ACPI_GTDT1_OFFSET (TimerFlags), "Timer Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_GTDT1_FLAG_OFFSET (TimerFlags,0), "Trigger Mode", 0},
+ {ACPI_DMT_FLAG1, ACPI_GTDT1_FLAG_OFFSET (TimerFlags,0), "Polarity", 0},
+ {ACPI_DMT_FLAG2, ACPI_GTDT1_FLAG_OFFSET (TimerFlags,0), "Security", 0},
ACPI_DMT_TERMINATOR
};
@@ -1301,6 +1400,59 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8c[] =
/*******************************************************************************
*
+ * LPIT - Low Power Idle Table
+ *
+ ******************************************************************************/
+
+/* Main table consists only of the standard ACPI table header */
+
+/* Common Subtable header (one per Subtable) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoLpitHdr[] =
+{
+ {ACPI_DMT_LPIT, ACPI_LPITH_OFFSET (Type), "Subtable Type", 0},
+ {ACPI_DMT_UINT32, ACPI_LPITH_OFFSET (Length), "Length", DT_LENGTH},
+ {ACPI_DMT_UINT16, ACPI_LPITH_OFFSET (UniqueId), "Unique ID", 0},
+ {ACPI_DMT_UINT16, ACPI_LPITH_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_LPITH_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_LPITH_FLAG_OFFSET (Flags, 0), "State Disabled", 0},
+ {ACPI_DMT_FLAG1, ACPI_LPITH_FLAG_OFFSET (Flags, 0), "No Counter", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* LPIT Subtables */
+
+/* 0: Native C-state */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[] =
+{
+ {ACPI_DMT_GAS, ACPI_LPIT0_OFFSET (EntryTrigger), "Entry Trigger", 0},
+ {ACPI_DMT_UINT32, ACPI_LPIT0_OFFSET (Residency), "Residency", 0},
+ {ACPI_DMT_UINT32, ACPI_LPIT0_OFFSET (Latency), "Latency", 0},
+ {ACPI_DMT_GAS, ACPI_LPIT0_OFFSET (ResidencyCounter), "Residency Counter", 0},
+ {ACPI_DMT_UINT64, ACPI_LPIT0_OFFSET (CounterFrequency), "Counter Frequency", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* 1: Simple I/O */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoLpit1[] =
+{
+ {ACPI_DMT_GAS, ACPI_LPIT1_OFFSET (EntryTrigger), "Entry Trigger", 0},
+ {ACPI_DMT_UINT32, ACPI_LPIT1_OFFSET (TriggerAction), "Trigger Action", 0},
+ {ACPI_DMT_UINT64, ACPI_LPIT1_OFFSET (TriggerValue), "Trigger Value", 0},
+ {ACPI_DMT_UINT64, ACPI_LPIT1_OFFSET (TriggerMask), "Trigger Mask", 0},
+ {ACPI_DMT_GAS, ACPI_LPIT1_OFFSET (MinimumIdleState), "Minimum Idle State", 0},
+ {ACPI_DMT_UINT32, ACPI_LPIT1_OFFSET (Residency), "Residency", 0},
+ {ACPI_DMT_UINT32, ACPI_LPIT1_OFFSET (Latency), "Latency", 0},
+ {ACPI_DMT_GAS, ACPI_LPIT1_OFFSET (ResidencyCounter), "Residency Counter", 0},
+ {ACPI_DMT_UINT64, ACPI_LPIT1_OFFSET (CounterFrequency), "Counter Frequency", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
* MADT - Multiple APIC Description Table and subtables
*
******************************************************************************/
@@ -1464,14 +1616,21 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[] =
{
{ACPI_DMT_UINT16, ACPI_MADT11_OFFSET (Reserved), "Reserved", 0},
- {ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (GicId), "Local GIC Hardware ID", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (CpuInterfaceNumber), "CPU Interface Number", 0},
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (Uid), "Processor UID", 0},
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_MADT11_FLAG_OFFSET (Flags,0), "Processor Enabled", 0},
+ {ACPI_DMT_FLAG1, ACPI_MADT11_FLAG_OFFSET (Flags,0), "Performance Interrupt Trigger Mode", 0},
+ {ACPI_DMT_FLAG2, ACPI_MADT11_FLAG_OFFSET (Flags,0), "Virtual GIC Interrupt Trigger Mode", 0},
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (ParkingVersion), "Parking Protocol Version", 0},
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (PerformanceInterrupt), "Performance Interrupt", 0},
{ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (ParkedAddress), "Parked Address", 0},
{ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (BaseAddress), "Base Address", 0},
+ {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (GicvBaseAddress), "Virtual GIC Base Address", 0},
+ {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (GichBaseAddress), "Hypervisor GIC Base Address", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (VgicInterrupt), "Virtual GIC Interrupt", 0},
+ {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (GicrBaseAddress), "Redistributor Base Address", 0},
+ {ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (ArmMpidr), "ARM MPIDR", 0},
ACPI_DMT_TERMINATOR
};
@@ -1487,6 +1646,30 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[] =
ACPI_DMT_TERMINATOR
};
+/* 13: Generic MSI Frame (ACPI 5.1) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoMadt13[] =
+{
+ {ACPI_DMT_UINT16, ACPI_MADT13_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT13_OFFSET (MsiFrameId), "MSI Frame ID", 0},
+ {ACPI_DMT_UINT64, ACPI_MADT13_OFFSET (BaseAddress), "Base Address", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT13_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_MADT13_FLAG_OFFSET (Flags,0), "Select SPI", 0},
+ {ACPI_DMT_UINT16, ACPI_MADT13_OFFSET (SpiCount), "SPI Count", 0},
+ {ACPI_DMT_UINT16, ACPI_MADT13_OFFSET (SpiBase), "SPI Base", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* 14: Generic Redistributor (ACPI 5.1) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoMadt14[] =
+{
+ {ACPI_DMT_UINT16, ACPI_MADT14_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_MADT14_OFFSET (BaseAddress), "Base Address", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT14_OFFSET (Length), "Length", 0},
+ ACPI_DMT_TERMINATOR
+};
+
/*******************************************************************************
*
@@ -1677,25 +1860,52 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPcct[] =
{
{ACPI_DMT_UINT32, ACPI_PCCT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_PCCT_FLAG_OFFSET (Flags,0), "Doorbell", 0},
- {ACPI_DMT_UINT32, ACPI_PCCT_OFFSET (Latency), "Command Latency", 0},
- {ACPI_DMT_UINT32, ACPI_PCCT_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT_OFFSET (Reserved), "Reserved", 0},
ACPI_DMT_TERMINATOR
};
/* PCCT subtables */
+ACPI_DMTABLE_INFO AcpiDmTableInfoPcctHdr[] =
+{
+ {ACPI_DMT_PCCT, ACPI_PCCT0_OFFSET (Header.Type), "Subtable Type", 0},
+ {ACPI_DMT_UINT8, ACPI_PCCT0_OFFSET (Header.Length), "Length", DT_LENGTH},
+ ACPI_DMT_TERMINATOR
+};
+
/* 0: Generic Communications Subspace */
ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[] =
{
- {ACPI_DMT_UINT8, ACPI_PCCT0_OFFSET (Header.Type), "Subtable Type", 0},
- {ACPI_DMT_UINT8, ACPI_PCCT0_OFFSET (Header.Length), "Length", DT_LENGTH},
{ACPI_DMT_UINT48, ACPI_PCCT0_OFFSET (Reserved[0]), "Reserved", 0},
{ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (BaseAddress), "Base Address", 0},
{ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (Length), "Address Length", 0},
{ACPI_DMT_GAS, ACPI_PCCT0_OFFSET (DoorbellRegister), "Doorbell Register", 0},
{ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (PreserveMask), "Preserve Mask", 0},
{ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (WriteMask), "Write Mask", 0},
+ {ACPI_DMT_UINT32, ACPI_PCCT0_OFFSET (Latency), "Command Latency", 0},
+ {ACPI_DMT_UINT32, ACPI_PCCT0_OFFSET (MaxAccessRate), "Maximum Access Rate", 0},
+ {ACPI_DMT_UINT16, ACPI_PCCT0_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* 1: HW-reduced Communications Subspace (ACPI 5.1) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[] =
+{
+ {ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (DoorbellInterrupt), "Doorbell Interrupt", 0},
+ {ACPI_DMT_UINT8, ACPI_PCCT1_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_PCCT1_FLAG_OFFSET (Flags,0), "Polarity", 0},
+ {ACPI_DMT_FLAG1, ACPI_PCCT1_FLAG_OFFSET (Flags,0), "Mode", 0},
+ {ACPI_DMT_UINT8, ACPI_PCCT1_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (BaseAddress), "Base Address", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (Length), "Address Length", 0},
+ {ACPI_DMT_GAS, ACPI_PCCT1_OFFSET (DoorbellRegister), "Doorbell Register", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (PreserveMask), "Preserve Mask", 0},
+ {ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (WriteMask), "Write Mask", 0},
+ {ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (Latency), "Command Latency", 0},
+ {ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (MaxAccessRate), "Maximum Access Rate", 0},
+ {ACPI_DMT_UINT16, ACPI_PCCT1_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0},
ACPI_DMT_TERMINATOR
};
@@ -1927,7 +2137,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[] =
{
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterfaceType), "Interface Type", 0},
- {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved), "Reserved", DT_NON_ZERO}, /* Value must be 1 */
{ACPI_DMT_UINT16, ACPI_SPMI_OFFSET (SpecRevision), "IPMI Spec Version", 0},
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterruptType), "Interrupt Type", 0},
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (GpeNumber), "GPE Number", 0},
@@ -1978,7 +2188,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[] =
{ACPI_DMT_FLAG0, ACPI_SRAT0_FLAG_OFFSET (Flags,0), "Enabled", 0},
{ACPI_DMT_UINT8, ACPI_SRAT0_OFFSET (LocalSapicEid), "Local Sapic EID", 0},
{ACPI_DMT_UINT24, ACPI_SRAT0_OFFSET (ProximityDomainHi[0]), "Proximity Domain High(24)", 0},
- {ACPI_DMT_UINT32, ACPI_SRAT0_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT0_OFFSET (ClockDomain), "Clock Domain", 0},
ACPI_DMT_TERMINATOR
};
@@ -2013,6 +2223,18 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[] =
ACPI_DMT_TERMINATOR
};
+/* : GICC Affinity (ACPI 5.1) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[] =
+{
+ {ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (ProximityDomain), "Proximity Domain", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (AcpiProcessorUid), "Acpi Processor UID", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_SRAT3_FLAG_OFFSET (Flags,0), "Enabled", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (ClockDomain), "Clock Domain", 0},
+ ACPI_DMT_TERMINATOR
+};
+
/*******************************************************************************
*
diff --git a/sys/contrib/dev/acpica/common/getopt.c b/sys/contrib/dev/acpica/common/getopt.c
index 69f2ed5..b93156c 100644
--- a/sys/contrib/dev/acpica/common/getopt.c
+++ b/sys/contrib/dev/acpica/common/getopt.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -51,14 +51,12 @@
* "f|" - Option has required single-char sub-options
*/
-#include <stdio.h>
-#include <string.h>
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acapps.h>
#define ACPI_OPTION_ERROR(msg, badchar) \
- if (AcpiGbl_Opterr) {fprintf (stderr, "%s%c\n", msg, badchar);}
+ if (AcpiGbl_Opterr) {AcpiLogError ("%s%c\n", msg, badchar);}
int AcpiGbl_Opterr = 1;
@@ -123,7 +121,7 @@ AcpiGetoptArgument (
* PARAMETERS: argc, argv - from main
* opts - options info list
*
- * RETURN: Option character or EOF
+ * RETURN: Option character or ACPI_OPT_END
*
* DESCRIPTION: Get the next option
*
@@ -145,12 +143,12 @@ AcpiGetopt(
argv[AcpiGbl_Optind][0] != '-' ||
argv[AcpiGbl_Optind][1] == '\0')
{
- return (EOF);
+ return (ACPI_OPT_END);
}
- else if (strcmp (argv[AcpiGbl_Optind], "--") == 0)
+ else if (ACPI_STRCMP (argv[AcpiGbl_Optind], "--") == 0)
{
AcpiGbl_Optind++;
- return (EOF);
+ return (ACPI_OPT_END);
}
}
@@ -161,7 +159,7 @@ AcpiGetopt(
/* Make sure that the option is legal */
if (CurrentChar == ':' ||
- (OptsPtr = strchr (opts, CurrentChar)) == NULL)
+ (OptsPtr = ACPI_STRCHR (opts, CurrentChar)) == NULL)
{
ACPI_OPTION_ERROR ("Illegal option: -", CurrentChar);
diff --git a/sys/contrib/dev/acpica/compiler/aslanalyze.c b/sys/contrib/dev/acpica/compiler/aslanalyze.c
index f5338bc..3c3eee8 100644
--- a/sys/contrib/dev/acpica/compiler/aslanalyze.c
+++ b/sys/contrib/dev/acpica/compiler/aslanalyze.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <string.h>
@@ -569,3 +568,51 @@ ApCheckRegMethod (
AslError (ASL_WARNING, ASL_MSG_NO_REGION, Op, NULL);
}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: ApFindNameInScope
+ *
+ * PARAMETERS: Name - Name to search for
+ * Op - Current parse op
+ *
+ * RETURN: TRUE if name found in the same scope as Op.
+ *
+ * DESCRIPTION: Determine if a name appears in the same scope as Op, as either
+ * a Method() or a Name().
+ *
+ ******************************************************************************/
+
+BOOLEAN
+ApFindNameInScope (
+ char *Name,
+ ACPI_PARSE_OBJECT *Op)
+{
+ ACPI_PARSE_OBJECT *Next;
+ ACPI_PARSE_OBJECT *Parent;
+
+
+ /* Get the start of the current scope */
+
+ Parent = Op->Asl.Parent;
+ Next = Parent->Asl.Child;
+
+ /* Search entire scope for a match to the name */
+
+ while (Next)
+ {
+ if ((Next->Asl.ParseOpcode == PARSEOP_METHOD) ||
+ (Next->Asl.ParseOpcode == PARSEOP_NAME))
+ {
+ if (ACPI_COMPARE_NAME (Name, Next->Asl.NameSeg))
+ {
+ return (TRUE);
+ }
+ }
+
+ Next = Next->Asl.Next;
+ }
+
+ return (FALSE);
+}
diff --git a/sys/contrib/dev/acpica/compiler/aslascii.c b/sys/contrib/dev/acpica/compiler/aslascii.c
new file mode 100644
index 0000000..e6b3311
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/aslascii.c
@@ -0,0 +1,349 @@
+/******************************************************************************
+ *
+ * Module Name: aslascii - ASCII detection and support routines
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
+#include <contrib/dev/acpica/include/acapps.h>
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("aslascii")
+
+
+/* Local prototypes */
+
+static void
+FlConsumeAnsiComment (
+ FILE *Handle,
+ ASL_FILE_STATUS *Status);
+
+static void
+FlConsumeNewComment (
+ FILE *Handle,
+ ASL_FILE_STATUS *Status);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: FlCheckForAcpiTable
+ *
+ * PARAMETERS: Handle - Open input file
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Determine if a file seems to be a binary ACPI table, via the
+ * following checks on what would be the table header:
+ * 0) File must be at least as long as an ACPI_TABLE_HEADER
+ * 1) The header length field must match the file size
+ * 2) Signature, OemId, OemTableId, AslCompilerId must be ASCII
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+FlCheckForAcpiTable (
+ FILE *Handle)
+{
+ ACPI_TABLE_HEADER Table;
+ UINT32 FileSize;
+ size_t Actual;
+ UINT32 i;
+
+
+ /* Read a potential table header */
+
+ Actual = fread (&Table, 1, sizeof (ACPI_TABLE_HEADER), Handle);
+ fseek (Handle, 0, SEEK_SET);
+
+ if (Actual < sizeof (ACPI_TABLE_HEADER))
+ {
+ return (AE_ERROR);
+ }
+
+ /* Header length field must match the file size */
+
+ FileSize = CmGetFileSize (Handle);
+ if (Table.Length != FileSize)
+ {
+ return (AE_ERROR);
+ }
+
+ /*
+ * These fields must be ASCII:
+ * Signature, OemId, OemTableId, AslCompilerId.
+ * We allow a NULL terminator in OemId and OemTableId.
+ */
+ for (i = 0; i < ACPI_NAME_SIZE; i++)
+ {
+ if (!ACPI_IS_ASCII ((UINT8) Table.Signature[i]))
+ {
+ return (AE_ERROR);
+ }
+
+ if (!ACPI_IS_ASCII ((UINT8) Table.AslCompilerId[i]))
+ {
+ return (AE_ERROR);
+ }
+ }
+
+ for (i = 0; (i < ACPI_OEM_ID_SIZE) && (Table.OemId[i]); i++)
+ {
+ if (!ACPI_IS_ASCII ((UINT8) Table.OemId[i]))
+ {
+ return (AE_ERROR);
+ }
+ }
+
+ for (i = 0; (i < ACPI_OEM_TABLE_ID_SIZE) && (Table.OemTableId[i]); i++)
+ {
+ if (!ACPI_IS_ASCII ((UINT8) Table.OemTableId[i]))
+ {
+ return (AE_ERROR);
+ }
+ }
+
+ printf ("Binary file appears to be a valid ACPI table, disassembling\n");
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: FlCheckForAscii
+ *
+ * PARAMETERS: Handle - Open input file
+ * Filename - Input filename
+ * DisplayErrors - TRUE if error messages desired
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Verify that the input file is entirely ASCII. Ignores characters
+ * within comments. Note: does not handle nested comments and does
+ * not handle comment delimiters within string literals. However,
+ * on the rare chance this happens and an invalid character is
+ * missed, the parser will catch the error by failing in some
+ * spectactular manner.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+FlCheckForAscii (
+ FILE *Handle,
+ char *Filename,
+ BOOLEAN DisplayErrors)
+{
+ UINT8 Byte;
+ ACPI_SIZE BadBytes = 0;
+ BOOLEAN OpeningComment = FALSE;
+ ASL_FILE_STATUS Status;
+
+
+ Status.Line = 1;
+ Status.Offset = 0;
+
+ /* Read the entire file */
+
+ while (fread (&Byte, 1, 1, Handle) == 1)
+ {
+ /* Ignore comment fields (allow non-ascii within) */
+
+ if (OpeningComment)
+ {
+ /* Check for second comment open delimiter */
+
+ if (Byte == '*')
+ {
+ FlConsumeAnsiComment (Handle, &Status);
+ }
+
+ if (Byte == '/')
+ {
+ FlConsumeNewComment (Handle, &Status);
+ }
+
+ /* Reset */
+
+ OpeningComment = FALSE;
+ }
+ else if (Byte == '/')
+ {
+ OpeningComment = TRUE;
+ }
+
+ /* Check for an ASCII character */
+
+ if (!ACPI_IS_ASCII (Byte))
+ {
+ if ((BadBytes < 10) && (DisplayErrors))
+ {
+ AcpiOsPrintf (
+ "Non-ASCII character [0x%2.2X] found in line %u, file offset 0x%.2X\n",
+ Byte, Status.Line, Status.Offset);
+ }
+
+ BadBytes++;
+ }
+
+ /* Update line counter */
+
+ else if (Byte == 0x0A)
+ {
+ Status.Line++;
+ }
+
+ Status.Offset++;
+ }
+
+ /* Seek back to the beginning of the source file */
+
+ fseek (Handle, 0, SEEK_SET);
+
+ /* Were there any non-ASCII characters in the file? */
+
+ if (BadBytes)
+ {
+ if (DisplayErrors)
+ {
+ AcpiOsPrintf (
+ "%u non-ASCII characters found in input source text, could be a binary file\n",
+ BadBytes);
+ AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, Filename);
+ }
+
+ return (AE_BAD_CHARACTER);
+ }
+
+ /* File is OK (100% ASCII) */
+
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: FlConsumeAnsiComment
+ *
+ * PARAMETERS: Handle - Open input file
+ * Status - File current status struct
+ *
+ * RETURN: Number of lines consumed
+ *
+ * DESCRIPTION: Step over a normal slash-star type comment
+ *
+ ******************************************************************************/
+
+static void
+FlConsumeAnsiComment (
+ FILE *Handle,
+ ASL_FILE_STATUS *Status)
+{
+ UINT8 Byte;
+ BOOLEAN ClosingComment = FALSE;
+
+
+ while (fread (&Byte, 1, 1, Handle) == 1)
+ {
+ /* Scan until comment close is found */
+
+ if (ClosingComment)
+ {
+ if (Byte == '/')
+ {
+ return;
+ }
+
+ if (Byte != '*')
+ {
+ /* Reset */
+
+ ClosingComment = FALSE;
+ }
+ }
+ else if (Byte == '*')
+ {
+ ClosingComment = TRUE;
+ }
+
+ /* Maintain line count */
+
+ if (Byte == 0x0A)
+ {
+ Status->Line++;
+ }
+
+ Status->Offset++;
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: FlConsumeNewComment
+ *
+ * PARAMETERS: Handle - Open input file
+ * Status - File current status struct
+ *
+ * RETURN: Number of lines consumed
+ *
+ * DESCRIPTION: Step over a slash-slash type of comment
+ *
+ ******************************************************************************/
+
+static void
+FlConsumeNewComment (
+ FILE *Handle,
+ ASL_FILE_STATUS *Status)
+{
+ UINT8 Byte;
+
+
+ while (fread (&Byte, 1, 1, Handle) == 1)
+ {
+ Status->Offset++;
+
+ /* Comment ends at newline */
+
+ if (Byte == 0x0A)
+ {
+ Status->Line++;
+ return;
+ }
+ }
+}
diff --git a/sys/contrib/dev/acpica/compiler/aslbtypes.c b/sys/contrib/dev/acpica/compiler/aslbtypes.c
index 16f3a0b..0ba219a 100644
--- a/sys/contrib/dev/acpica/compiler/aslbtypes.c
+++ b/sys/contrib/dev/acpica/compiler/aslbtypes.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@@ -243,7 +242,7 @@ AnMapEtypeToBtype (
return (ACPI_BTYPE_INTEGER | ACPI_BTYPE_DDB_HANDLE);
- case ACPI_BTYPE_DEBUG_OBJECT:
+ case ACPI_TYPE_DEBUG_OBJECT:
/* Cannot be used as a source operand */
@@ -375,6 +374,12 @@ AnGetBtype (
UINT32 ThisNodeBtype = 0;
+ if (!Op)
+ {
+ AcpiOsPrintf ("Null Op in AnGetBtype\n");
+ return (ACPI_UINT32_MAX);
+ }
+
if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG) ||
(Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) ||
(Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
diff --git a/sys/contrib/dev/acpica/compiler/aslcodegen.c b/sys/contrib/dev/acpica/compiler/aslcodegen.c
index b7d510d..541236a 100644
--- a/sys/contrib/dev/acpica/compiler/aslcodegen.c
+++ b/sys/contrib/dev/acpica/compiler/aslcodegen.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@@ -108,6 +107,12 @@ CgGenerateAmlOutput (
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
CgAmlWriteWalk, NULL, NULL);
+
+ DbgPrint (ASL_TREE_OUTPUT,
+ "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr"
+ " Parent Child Next Flags AcTyp Final Col L\n",
+ 76, " ");
+
CgCloseTable ();
}
@@ -139,7 +144,8 @@ CgAmlWriteWalk (
DbgPrint (ASL_TREE_OUTPUT,
"Final parse tree used for AML output:\n");
DbgPrint (ASL_TREE_OUTPUT,
- "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr Child Parent Flags AcTyp Final Col L\n",
+ "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr"
+ " Parent Child Next Flags AcTyp Final Col L\n",
76, " ");
}
@@ -162,7 +168,8 @@ CgAmlWriteWalk (
}
DbgPrint (ASL_TREE_OUTPUT,
- "%08X %04X %04X %01X %04X %04X %04X %04X %08X %08X %08X %08X %08X %04X %02d %02d\n",
+ "%08X %04X %04X %01X %04X %04X %04X %04X "
+ "%08X %08X %08X %08X %08X %08X %04X %02d %02d\n",
/* 1 */ (UINT32) Op->Asl.Value.Integer,
/* 2 */ Op->Asl.ParseOpcode,
/* 3 */ Op->Asl.AmlOpcode,
@@ -172,13 +179,14 @@ CgAmlWriteWalk (
/* 7 */ Op->Asl.AmlSubtreeLength,
/* 8 */ Op->Asl.Parent ? Op->Asl.Parent->Asl.AmlSubtreeLength : 0,
/* 9 */ Op,
- /* 10 */ Op->Asl.Child,
- /* 11 */ Op->Asl.Parent,
- /* 12 */ Op->Asl.CompileFlags,
- /* 13 */ Op->Asl.AcpiBtype,
- /* 14 */ Op->Asl.FinalAmlLength,
- /* 15 */ Op->Asl.Column,
- /* 16 */ Op->Asl.LineNumber);
+ /* 10 */ Op->Asl.Parent,
+ /* 11 */ Op->Asl.Child,
+ /* 12 */ Op->Asl.Next,
+ /* 13 */ Op->Asl.CompileFlags,
+ /* 14 */ Op->Asl.AcpiBtype,
+ /* 15 */ Op->Asl.FinalAmlLength,
+ /* 16 */ Op->Asl.Column,
+ /* 17 */ Op->Asl.LineNumber);
/* Generate the AML for this node */
diff --git a/sys/contrib/dev/acpica/compiler/aslcompile.c b/sys/contrib/dev/acpica/compiler/aslcompile.c
index 48ccfa3..cf37c6a 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompile.c
+++ b/sys/contrib/dev/acpica/compiler/aslcompile.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,6 +43,7 @@
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/compiler/dtcompiler.h>
+#include <contrib/dev/acpica/include/acnamesp.h>
#include <stdio.h>
#include <time.h>
@@ -67,488 +68,12 @@ CmFlushSourceCode (
void);
static void
-FlConsumeAnsiComment (
- FILE *Handle,
- ASL_FILE_STATUS *Status);
-
-static void
-FlConsumeNewComment (
- FILE *Handle,
- ASL_FILE_STATUS *Status);
-
-static void
CmDumpAllEvents (
void);
/*******************************************************************************
*
- * FUNCTION: AslCompilerSignon
- *
- * PARAMETERS: FileId - ID of the output file
- *
- * RETURN: None
- *
- * DESCRIPTION: Display compiler signon
- *
- ******************************************************************************/
-
-void
-AslCompilerSignon (
- UINT32 FileId)
-{
- char *Prefix = "";
- char *UtilityName;
-
-
- /* Set line prefix depending on the destination file type */
-
- switch (FileId)
- {
- case ASL_FILE_ASM_SOURCE_OUTPUT:
- case ASL_FILE_ASM_INCLUDE_OUTPUT:
-
- Prefix = "; ";
- break;
-
- case ASL_FILE_HEX_OUTPUT:
-
- if (Gbl_HexOutputFlag == HEX_OUTPUT_ASM)
- {
- Prefix = "; ";
- }
- else if ((Gbl_HexOutputFlag == HEX_OUTPUT_C) ||
- (Gbl_HexOutputFlag == HEX_OUTPUT_ASL))
- {
- FlPrintFile (ASL_FILE_HEX_OUTPUT, "/*\n");
- Prefix = " * ";
- }
- break;
-
- case ASL_FILE_C_SOURCE_OUTPUT:
- case ASL_FILE_C_OFFSET_OUTPUT:
- case ASL_FILE_C_INCLUDE_OUTPUT:
-
- Prefix = " * ";
- break;
-
- default:
-
- /* No other output types supported */
-
- break;
- }
-
- /* Running compiler or disassembler? */
-
- if (Gbl_DisasmFlag)
- {
- UtilityName = AML_DISASSEMBLER_NAME;
- }
- else
- {
- UtilityName = ASL_COMPILER_NAME;
- }
-
- /* Compiler signon with copyright */
-
- FlPrintFile (FileId, "%s\n", Prefix);
- FlPrintFile (FileId, ACPI_COMMON_HEADER (UtilityName, Prefix));
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AslCompilerFileHeader
- *
- * PARAMETERS: FileId - ID of the output file
- *
- * RETURN: None
- *
- * DESCRIPTION: Header used at the beginning of output files
- *
- ******************************************************************************/
-
-void
-AslCompilerFileHeader (
- UINT32 FileId)
-{
- struct tm *NewTime;
- time_t Aclock;
- char *Prefix = "";
-
-
- /* Set line prefix depending on the destination file type */
-
- switch (FileId)
- {
- case ASL_FILE_ASM_SOURCE_OUTPUT:
- case ASL_FILE_ASM_INCLUDE_OUTPUT:
-
- Prefix = "; ";
- break;
-
- case ASL_FILE_HEX_OUTPUT:
-
- if (Gbl_HexOutputFlag == HEX_OUTPUT_ASM)
- {
- Prefix = "; ";
- }
- else if ((Gbl_HexOutputFlag == HEX_OUTPUT_C) ||
- (Gbl_HexOutputFlag == HEX_OUTPUT_ASL))
- {
- Prefix = " * ";
- }
- break;
-
- case ASL_FILE_C_SOURCE_OUTPUT:
- case ASL_FILE_C_OFFSET_OUTPUT:
- case ASL_FILE_C_INCLUDE_OUTPUT:
-
- Prefix = " * ";
- break;
-
- default:
-
- /* No other output types supported */
-
- break;
- }
-
- /* Compilation header with timestamp */
-
- (void) time (&Aclock);
- NewTime = localtime (&Aclock);
-
- FlPrintFile (FileId,
- "%sCompilation of \"%s\" - %s%s\n",
- Prefix, Gbl_Files[ASL_FILE_INPUT].Filename, asctime (NewTime),
- Prefix);
-
- switch (FileId)
- {
- case ASL_FILE_C_SOURCE_OUTPUT:
- case ASL_FILE_C_OFFSET_OUTPUT:
- case ASL_FILE_C_INCLUDE_OUTPUT:
-
- FlPrintFile (FileId, " */\n");
- break;
-
- default:
-
- /* Nothing to do for other output types */
-
- break;
- }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: CmFlushSourceCode
- *
- * PARAMETERS: None
- *
- * RETURN: None
- *
- * DESCRIPTION: Read in any remaining source code after the parse tree
- * has been constructed.
- *
- ******************************************************************************/
-
-static void
-CmFlushSourceCode (
- void)
-{
- char Buffer;
-
-
- while (FlReadFile (ASL_FILE_INPUT, &Buffer, 1) != AE_ERROR)
- {
- AslInsertLineBuffer ((int) Buffer);
- }
-
- AslResetCurrentLineBuffer ();
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: FlConsume*
- *
- * PARAMETERS: Handle - Open input file
- * Status - File current status struct
- *
- * RETURN: Number of lines consumed
- *
- * DESCRIPTION: Step over both types of comment during check for ascii chars
- *
- ******************************************************************************/
-
-static void
-FlConsumeAnsiComment (
- FILE *Handle,
- ASL_FILE_STATUS *Status)
-{
- UINT8 Byte;
- BOOLEAN ClosingComment = FALSE;
-
-
- while (fread (&Byte, 1, 1, Handle) == 1)
- {
- /* Scan until comment close is found */
-
- if (ClosingComment)
- {
- if (Byte == '/')
- {
- return;
- }
-
- if (Byte != '*')
- {
- /* Reset */
-
- ClosingComment = FALSE;
- }
- }
- else if (Byte == '*')
- {
- ClosingComment = TRUE;
- }
-
- /* Maintain line count */
-
- if (Byte == 0x0A)
- {
- Status->Line++;
- }
-
- Status->Offset++;
- }
-}
-
-
-static void
-FlConsumeNewComment (
- FILE *Handle,
- ASL_FILE_STATUS *Status)
-{
- UINT8 Byte;
-
-
- while (fread (&Byte, 1, 1, Handle) == 1)
- {
- Status->Offset++;
-
- /* Comment ends at newline */
-
- if (Byte == 0x0A)
- {
- Status->Line++;
- return;
- }
- }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: FlCheckForAcpiTable
- *
- * PARAMETERS: Handle - Open input file
- *
- * RETURN: Status
- *
- * DESCRIPTION: Determine if a file seems to be a binary ACPI table, via the
- * following checks on what would be the table header:
- * 0) File must be at least as long as an ACPI_TABLE_HEADER
- * 1) The header length field must match the file size
- * 2) Signature, OemId, OemTableId, AslCompilerId must be ASCII
- *
- ******************************************************************************/
-
-ACPI_STATUS
-FlCheckForAcpiTable (
- FILE *Handle)
-{
- ACPI_TABLE_HEADER Table;
- UINT32 FileSize;
- size_t Actual;
- UINT32 i;
-
-
- /* Read a potential table header */
-
- Actual = fread (&Table, 1, sizeof (ACPI_TABLE_HEADER), Handle);
- fseek (Handle, 0, SEEK_SET);
-
- if (Actual < sizeof (ACPI_TABLE_HEADER))
- {
- return (AE_ERROR);
- }
-
- /* Header length field must match the file size */
-
- FileSize = DtGetFileSize (Handle);
- if (Table.Length != FileSize)
- {
- return (AE_ERROR);
- }
-
- /*
- * These fields must be ASCII:
- * Signature, OemId, OemTableId, AslCompilerId.
- * We allow a NULL terminator in OemId and OemTableId.
- */
- for (i = 0; i < ACPI_NAME_SIZE; i++)
- {
- if (!ACPI_IS_ASCII ((UINT8) Table.Signature[i]))
- {
- return (AE_ERROR);
- }
-
- if (!ACPI_IS_ASCII ((UINT8) Table.AslCompilerId[i]))
- {
- return (AE_ERROR);
- }
- }
-
- for (i = 0; (i < ACPI_OEM_ID_SIZE) && (Table.OemId[i]); i++)
- {
- if (!ACPI_IS_ASCII ((UINT8) Table.OemId[i]))
- {
- return (AE_ERROR);
- }
- }
-
- for (i = 0; (i < ACPI_OEM_TABLE_ID_SIZE) && (Table.OemTableId[i]); i++)
- {
- if (!ACPI_IS_ASCII ((UINT8) Table.OemTableId[i]))
- {
- return (AE_ERROR);
- }
- }
-
- printf ("Binary file appears to be a valid ACPI table, disassembling\n");
- return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: FlCheckForAscii
- *
- * PARAMETERS: Handle - Open input file
- * Filename - Input filename
- * DisplayErrors - TRUE if error messages desired
- *
- * RETURN: Status
- *
- * DESCRIPTION: Verify that the input file is entirely ASCII. Ignores characters
- * within comments. Note: does not handle nested comments and does
- * not handle comment delimiters within string literals. However,
- * on the rare chance this happens and an invalid character is
- * missed, the parser will catch the error by failing in some
- * spectactular manner.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-FlCheckForAscii (
- FILE *Handle,
- char *Filename,
- BOOLEAN DisplayErrors)
-{
- UINT8 Byte;
- ACPI_SIZE BadBytes = 0;
- BOOLEAN OpeningComment = FALSE;
- ASL_FILE_STATUS Status;
-
-
- Status.Line = 1;
- Status.Offset = 0;
-
- /* Read the entire file */
-
- while (fread (&Byte, 1, 1, Handle) == 1)
- {
- /* Ignore comment fields (allow non-ascii within) */
-
- if (OpeningComment)
- {
- /* Check for second comment open delimiter */
-
- if (Byte == '*')
- {
- FlConsumeAnsiComment (Handle, &Status);
- }
-
- if (Byte == '/')
- {
- FlConsumeNewComment (Handle, &Status);
- }
-
- /* Reset */
-
- OpeningComment = FALSE;
- }
- else if (Byte == '/')
- {
- OpeningComment = TRUE;
- }
-
- /* Check for an ASCII character */
-
- if (!ACPI_IS_ASCII (Byte))
- {
- if ((BadBytes < 10) && (DisplayErrors))
- {
- AcpiOsPrintf (
- "Non-ASCII character [0x%2.2X] found in line %u, file offset 0x%.2X\n",
- Byte, Status.Line, Status.Offset);
- }
-
- BadBytes++;
- }
-
- /* Update line counter */
-
- else if (Byte == 0x0A)
- {
- Status.Line++;
- }
-
- Status.Offset++;
- }
-
- /* Seek back to the beginning of the source file */
-
- fseek (Handle, 0, SEEK_SET);
-
- /* Were there any non-ASCII characters in the file? */
-
- if (BadBytes)
- {
- if (DisplayErrors)
- {
- AcpiOsPrintf (
- "%u non-ASCII characters found in input source text, could be a binary file\n",
- BadBytes);
- AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, Filename);
- }
-
- return (AE_BAD_CHARACTER);
- }
-
- /* File is OK (100% ASCII) */
-
- return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: CmDoCompile
*
* PARAMETERS: None
@@ -593,10 +118,9 @@ CmDoCompile (
AslCompilerparse();
UtEndEvent (Event);
- /* Check for parse errors */
+ /* Check for parser-detected syntax errors */
- Status = AslCheckForErrorExit ();
- if (ACPI_FAILURE (Status))
+ if (Gbl_SyntaxError)
{
fprintf (stderr, "Compiler aborting due to parser-detected syntax error(s)\n");
LsDumpParseTree ();
@@ -617,12 +141,18 @@ CmDoCompile (
goto ErrorExit;
}
-
/* Flush out any remaining source after parse tree is complete */
Event = UtBeginEvent ("Flush source input");
CmFlushSourceCode ();
+ /* Prune the parse tree if requested (debug purposes only) */
+
+ if (Gbl_PruneParseTree)
+ {
+ AslPruneParseTree (Gbl_PruneDepth, Gbl_PruneType);
+ }
+
/* Optional parse tree dump, compiler debug output only */
LsDumpParseTree ();
@@ -802,6 +332,197 @@ ErrorExit:
/*******************************************************************************
*
+ * FUNCTION: AslCompilerSignon
+ *
+ * PARAMETERS: FileId - ID of the output file
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Display compiler signon
+ *
+ ******************************************************************************/
+
+void
+AslCompilerSignon (
+ UINT32 FileId)
+{
+ char *Prefix = "";
+ char *UtilityName;
+
+
+ /* Set line prefix depending on the destination file type */
+
+ switch (FileId)
+ {
+ case ASL_FILE_ASM_SOURCE_OUTPUT:
+ case ASL_FILE_ASM_INCLUDE_OUTPUT:
+
+ Prefix = "; ";
+ break;
+
+ case ASL_FILE_HEX_OUTPUT:
+
+ if (Gbl_HexOutputFlag == HEX_OUTPUT_ASM)
+ {
+ Prefix = "; ";
+ }
+ else if ((Gbl_HexOutputFlag == HEX_OUTPUT_C) ||
+ (Gbl_HexOutputFlag == HEX_OUTPUT_ASL))
+ {
+ FlPrintFile (ASL_FILE_HEX_OUTPUT, "/*\n");
+ Prefix = " * ";
+ }
+ break;
+
+ case ASL_FILE_C_SOURCE_OUTPUT:
+ case ASL_FILE_C_OFFSET_OUTPUT:
+ case ASL_FILE_C_INCLUDE_OUTPUT:
+
+ Prefix = " * ";
+ break;
+
+ default:
+
+ /* No other output types supported */
+
+ break;
+ }
+
+ /* Running compiler or disassembler? */
+
+ if (Gbl_DisasmFlag)
+ {
+ UtilityName = AML_DISASSEMBLER_NAME;
+ }
+ else
+ {
+ UtilityName = ASL_COMPILER_NAME;
+ }
+
+ /* Compiler signon with copyright */
+
+ FlPrintFile (FileId, "%s\n", Prefix);
+ FlPrintFile (FileId, ACPI_COMMON_HEADER (UtilityName, Prefix));
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AslCompilerFileHeader
+ *
+ * PARAMETERS: FileId - ID of the output file
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Header used at the beginning of output files
+ *
+ ******************************************************************************/
+
+void
+AslCompilerFileHeader (
+ UINT32 FileId)
+{
+ struct tm *NewTime;
+ time_t Aclock;
+ char *Prefix = "";
+
+
+ /* Set line prefix depending on the destination file type */
+
+ switch (FileId)
+ {
+ case ASL_FILE_ASM_SOURCE_OUTPUT:
+ case ASL_FILE_ASM_INCLUDE_OUTPUT:
+
+ Prefix = "; ";
+ break;
+
+ case ASL_FILE_HEX_OUTPUT:
+
+ if (Gbl_HexOutputFlag == HEX_OUTPUT_ASM)
+ {
+ Prefix = "; ";
+ }
+ else if ((Gbl_HexOutputFlag == HEX_OUTPUT_C) ||
+ (Gbl_HexOutputFlag == HEX_OUTPUT_ASL))
+ {
+ Prefix = " * ";
+ }
+ break;
+
+ case ASL_FILE_C_SOURCE_OUTPUT:
+ case ASL_FILE_C_OFFSET_OUTPUT:
+ case ASL_FILE_C_INCLUDE_OUTPUT:
+
+ Prefix = " * ";
+ break;
+
+ default:
+
+ /* No other output types supported */
+
+ break;
+ }
+
+ /* Compilation header with timestamp */
+
+ (void) time (&Aclock);
+ NewTime = localtime (&Aclock);
+
+ FlPrintFile (FileId,
+ "%sCompilation of \"%s\" - %s%s\n",
+ Prefix, Gbl_Files[ASL_FILE_INPUT].Filename, asctime (NewTime),
+ Prefix);
+
+ switch (FileId)
+ {
+ case ASL_FILE_C_SOURCE_OUTPUT:
+ case ASL_FILE_C_OFFSET_OUTPUT:
+ case ASL_FILE_C_INCLUDE_OUTPUT:
+
+ FlPrintFile (FileId, " */\n");
+ break;
+
+ default:
+
+ /* Nothing to do for other output types */
+
+ break;
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: CmFlushSourceCode
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Read in any remaining source code after the parse tree
+ * has been constructed.
+ *
+ ******************************************************************************/
+
+static void
+CmFlushSourceCode (
+ void)
+{
+ char Buffer;
+
+
+ while (FlReadFile (ASL_FILE_INPUT, &Buffer, 1) != AE_ERROR)
+ {
+ AslInsertLineBuffer ((int) Buffer);
+ }
+
+ AslResetCurrentLineBuffer ();
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: CmDoOutputFiles
*
* PARAMETERS: None
@@ -825,6 +546,10 @@ CmDoOutputFiles (
/* Dump the namespace to the .nsp file if requested */
(void) NsDisplayNamespace ();
+
+ /* Dump the device mapping file */
+
+ MpEmitMappingInfo ();
}
@@ -965,7 +690,8 @@ CmCleanupAndExit (
* We will delete the AML file if there are errors and the
* force AML output option has not been used.
*/
- if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors) &&
+ if ((Gbl_ExceptionCount[ASL_ERROR] > 0) &&
+ (!Gbl_IgnoreErrors) &&
Gbl_Files[ASL_FILE_AML_OUTPUT].Handle)
{
DeleteAmlFile = TRUE;
@@ -1025,4 +751,71 @@ CmCleanupAndExit (
{
FlDeleteFile (ASL_FILE_SOURCE_OUTPUT);
}
+
+ /* Final cleanup after compiling one file */
+
+ CmDeleteCaches ();
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: CmDeleteCaches
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Delete all local cache buffer blocks
+ *
+ ******************************************************************************/
+
+void
+CmDeleteCaches (
+ void)
+{
+ UINT32 BufferCount;
+ ASL_CACHE_INFO *Next;
+
+
+ /* Parse Op cache */
+
+ BufferCount = 0;
+ while (Gbl_ParseOpCacheList)
+ {
+ Next = Gbl_ParseOpCacheList->Next;
+ ACPI_FREE (Gbl_ParseOpCacheList);
+ Gbl_ParseOpCacheList = Next;
+ BufferCount++;
+ }
+
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "%u ParseOps, Buffer size: %u ops (%u bytes), %u Buffers\n",
+ Gbl_ParseOpCount, ASL_PARSEOP_CACHE_SIZE,
+ (sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE), BufferCount);
+
+ Gbl_ParseOpCount = 0;
+ Gbl_ParseOpCacheNext = NULL;
+ Gbl_ParseOpCacheLast = NULL;
+ RootNode = NULL;
+
+ /* Generic string cache */
+
+ BufferCount = 0;
+ while (Gbl_StringCacheList)
+ {
+ Next = Gbl_StringCacheList->Next;
+ ACPI_FREE (Gbl_StringCacheList);
+ Gbl_StringCacheList = Next;
+ BufferCount++;
+ }
+
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "%u Strings (%u bytes), Buffer size: %u bytes, %u Buffers\n",
+ Gbl_StringCount, Gbl_StringSize, ASL_STRING_CACHE_SIZE, BufferCount);
+
+ Gbl_StringSize = 0;
+ Gbl_StringCount = 0;
+ Gbl_StringCacheNext = NULL;
+ Gbl_StringCacheLast = NULL;
}
diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.h b/sys/contrib/dev/acpica/compiler/aslcompiler.h
index 132ae7d..7fb2088 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompiler.h
+++ b/sys/contrib/dev/acpica/compiler/aslcompiler.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#ifndef __ASLCOMPILER_H
#define __ASLCOMPILER_H
@@ -111,6 +110,11 @@ AslPushInputFileStack (
FILE *InputFile,
char *Filename);
+void
+AslParserCleanup (
+ void);
+
+
/*
* aslstartup - entered from main()
*/
@@ -123,11 +127,6 @@ ACPI_STATUS (*ASL_PATHNAME_CALLBACK) (
char *);
ACPI_STATUS
-AslDoOnePathname (
- char *Pathname,
- ASL_PATHNAME_CALLBACK Callback);
-
-ACPI_STATUS
AslDoOneFile (
char *Filename);
@@ -159,6 +158,14 @@ void
CmCleanupAndExit (
void);
+void
+CmDeleteCaches (
+ void);
+
+
+/*
+ * aslascii - ascii support
+ */
ACPI_STATUS
FlCheckForAcpiTable (
FILE *Handle);
@@ -280,14 +287,23 @@ void
ApCheckRegMethod (
ACPI_PARSE_OBJECT *Op);
+BOOLEAN
+ApFindNameInScope (
+ char *Name,
+ ACPI_PARSE_OBJECT *Op);
+
/*
* aslerror - error handling/reporting
*/
void
+AslAbort (
+ void);
+
+void
AslError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
ACPI_PARSE_OBJECT *Op,
char *ExtraMessage);
@@ -298,7 +314,7 @@ AslDisableException (
BOOLEAN
AslIsExceptionDisabled (
UINT8 Level,
- UINT8 MessageId);
+ UINT16 MessageId);
void
AslCoreSubsystemError (
@@ -314,7 +330,7 @@ AslCompilererror(
void
AslCommonError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 CurrentLineNumber,
UINT32 LogicalLineNumber,
UINT32 LogicalByteOffset,
@@ -325,7 +341,7 @@ AslCommonError (
void
AslCommonError2 (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 LineNumber,
UINT32 Column,
char *SourceLine,
@@ -346,10 +362,6 @@ void
AeClearErrorLog (
void);
-ACPI_PHYSICAL_ADDRESS
-AeLocalGetRootPointer (
- void);
-
/*
* asllisting - generate all "listing" type files
@@ -440,6 +452,22 @@ OpcAmlConstantWalk (
/*
+ * aslmessages - exception strings
+ */
+const char *
+AeDecodeMessageId (
+ UINT16 MessageId);
+
+const char *
+AeDecodeExceptionLevel (
+ UINT8 Level);
+
+UINT16
+AeBuildFullExceptionCode (
+ UINT8 Level,
+ UINT16 MessageId);
+
+/*
* asloffset - generate C offset file for BIOS support
*/
ACPI_STATUS
@@ -515,6 +543,27 @@ OptOptimizeNamePath (
/*
+ * aslprintf - Printf/Fprintf macros
+ */
+void
+OpcDoPrintf (
+ ACPI_PARSE_OBJECT *Op);
+
+void
+OpcDoFprintf (
+ ACPI_PARSE_OBJECT *Op);
+
+
+/*
+ * aslprune - parse tree pruner
+ */
+void
+AslPruneParseTree (
+ UINT32 PruneDepth,
+ UINT32 Type);
+
+
+/*
* aslcodegen - code generation
*/
void
@@ -656,6 +705,16 @@ TrCreateLeafNode (
UINT32 ParseOpcode);
ACPI_PARSE_OBJECT *
+TrCreateAssignmentNode (
+ ACPI_PARSE_OBJECT *Target,
+ ACPI_PARSE_OBJECT *Source);
+
+ACPI_PARSE_OBJECT *
+TrCreateTargetOperand (
+ ACPI_PARSE_OBJECT *OriginalOp,
+ ACPI_PARSE_OBJECT *ParentOp);
+
+ACPI_PARSE_OBJECT *
TrCreateValuedLeafNode (
UINT32 ParseOpcode,
UINT64 Value);
@@ -708,10 +767,6 @@ TrLinkPeerNodes (
* aslfiles - File I/O support
*/
void
-AslAbort (
- void);
-
-void
FlAddIncludeDirectory (
char *Dir);
@@ -784,6 +839,13 @@ ACPI_STATUS
FlOpenMiscOutputFiles (
char *InputFilename);
+/*
+ * aslhwmap - hardware map summary
+ */
+void
+MpEmitMappingInfo (
+ void);
+
/*
* asload - load namespace in prep for cross reference
@@ -883,10 +945,6 @@ void
UtDisplaySummary (
UINT32 FileId);
-UINT8
-UtHexCharToValue (
- int HexChar);
-
void
UtConvertByteToHex (
UINT8 RawByte,
@@ -906,13 +964,17 @@ UtSetParseOpName (
ACPI_PARSE_OBJECT *Op);
char *
-UtGetStringBuffer (
+UtStringCacheCalloc (
UINT32 Length);
void
UtExpandLineBuffers (
void);
+void
+UtFreeLineBuffers (
+ void);
+
ACPI_STATUS
UtInternalizeName (
char *ExternalName,
@@ -948,11 +1010,6 @@ AuValidateUuid (
char *InString);
ACPI_STATUS
-AuConvertStringToUuid (
- char *InString,
- char *UuIdBuffer);
-
-ACPI_STATUS
AuConvertUuidToString (
char *UuIdBuffer,
char *OutString);
@@ -1026,8 +1083,7 @@ RsCheckListForDuplicates (
ASL_RESOURCE_NODE *
RsDoOneResourceDescriptor (
- ACPI_PARSE_OBJECT *DescriptorTypeOp,
- UINT32 CurrentByteOffset,
+ ASL_RESOURCE_INFO *Info,
UINT8 *State);
/* Values for State above */
@@ -1051,43 +1107,35 @@ RsDoResourceTemplate (
*/
ASL_RESOURCE_NODE *
RsDoEndTagDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoEndDependentDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoMemory24Descriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoMemory32Descriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoMemory32FixedDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoStartDependentDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoStartDependentNoPriDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoVendorSmallDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
/*
@@ -1095,33 +1143,27 @@ RsDoVendorSmallDescriptor (
*/
ASL_RESOURCE_NODE *
RsDoDmaDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoFixedDmaDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoFixedIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoIrqDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoIrqNoFlagsDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
/*
@@ -1129,61 +1171,50 @@ RsDoIrqNoFlagsDescriptor (
*/
ASL_RESOURCE_NODE *
RsDoInterruptDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoVendorLargeDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoGeneralRegisterDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoGpioIntDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoGpioIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoI2cSerialBusDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoSpiSerialBusDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoUartSerialBusDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
/*
* aslrestype2d - DWord address descriptors
*/
ASL_RESOURCE_NODE *
RsDoDwordIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoDwordMemoryDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoDwordSpaceDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
/*
@@ -1191,18 +1222,15 @@ RsDoDwordSpaceDescriptor (
*/
ASL_RESOURCE_NODE *
RsDoExtendedIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoExtendedMemoryDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoExtendedSpaceDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
/*
@@ -1210,18 +1238,15 @@ RsDoExtendedSpaceDescriptor (
*/
ASL_RESOURCE_NODE *
RsDoQwordIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoQwordMemoryDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoQwordSpaceDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
/*
@@ -1229,18 +1254,16 @@ RsDoQwordSpaceDescriptor (
*/
ASL_RESOURCE_NODE *
RsDoWordIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoWordSpaceDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoWordBusNumberDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset);
+ ASL_RESOURCE_INFO *Info);
+
/*
* Entry to data table compiler subsystem
diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.l b/sys/contrib/dev/acpica/compiler/aslcompiler.l
index 5b2d9ce..f831233 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompiler.l
+++ b/sys/contrib/dev/acpica/compiler/aslcompiler.l
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -110,13 +110,56 @@ NamePathTail [.]{NameSeg}
[ \t] { count (0); }
-"/*" { if (!AslDoComment ()) yyterminate (); }
-"//" { if (!AslDoCommentType2 ()) yyterminate (); }
+"/*" { if (!AslDoComment ()) {yyterminate ();} }
+"//" { if (!AslDoCommentType2 ()) {yyterminate ();} }
-"\"" { if (AslDoStringLiteral ()) return (PARSEOP_STRING_LITERAL); else yyterminate (); }
+"\"" { if (AslDoStringLiteral ()) {return (PARSEOP_STRING_LITERAL);}
+ else {yyterminate ();} }
";" { count (0); return(';'); }
-
+ /* ASL Extension: Standard C operators */
+
+"~" { count (3); return (PARSEOP_EXP_NOT); }
+"!" { count (3); return (PARSEOP_EXP_LOGICAL_NOT); }
+"*" { count (3); return (PARSEOP_EXP_MULTIPLY); }
+"/" { count (3); return (PARSEOP_EXP_DIVIDE); }
+"%" { count (3); return (PARSEOP_EXP_MODULO); }
+"+" { count (3); return (PARSEOP_EXP_ADD); }
+"-" { count (3); return (PARSEOP_EXP_SUBTRACT); }
+">>" { count (3); return (PARSEOP_EXP_SHIFT_RIGHT); }
+"<<" { count (3); return (PARSEOP_EXP_SHIFT_LEFT); }
+"<" { count (3); return (PARSEOP_EXP_LESS); }
+">" { count (3); return (PARSEOP_EXP_GREATER); }
+"&" { count (3); return (PARSEOP_EXP_AND); }
+"<=" { count (3); return (PARSEOP_EXP_LESS_EQUAL); }
+">=" { count (3); return (PARSEOP_EXP_GREATER_EQUAL); }
+"==" { count (3); return (PARSEOP_EXP_EQUAL); }
+"!=" { count (3); return (PARSEOP_EXP_NOT_EQUAL); }
+"|" { count (3); return (PARSEOP_EXP_OR); }
+"&&" { count (3); return (PARSEOP_EXP_LOGICAL_AND); }
+"||" { count (3); return (PARSEOP_EXP_LOGICAL_OR); }
+"++" { count (3); return (PARSEOP_EXP_INCREMENT); }
+"--" { count (3); return (PARSEOP_EXP_DECREMENT); }
+"^ " { count (3); return (PARSEOP_EXP_XOR); }
+
+ /* ASL Extension: Standard C assignment operators */
+
+"=" { count (3); return (PARSEOP_EXP_EQUALS); }
+"+=" { count (3); return (PARSEOP_EXP_ADD_EQ); }
+"-=" { count (3); return (PARSEOP_EXP_SUB_EQ); }
+"*=" { count (3); return (PARSEOP_EXP_MUL_EQ); }
+"/=" { count (3); return (PARSEOP_EXP_DIV_EQ); }
+"%=" { count (3); return (PARSEOP_EXP_MOD_EQ); }
+"<<=" { count (3); return (PARSEOP_EXP_SHL_EQ); }
+">>=" { count (3); return (PARSEOP_EXP_SHR_EQ); }
+"&=" { count (3); return (PARSEOP_EXP_AND_EQ); }
+"^=" { count (3); return (PARSEOP_EXP_XOR_EQ); }
+"|=" { count (3); return (PARSEOP_EXP_OR_EQ); }
+
+
+ /*
+ * Begin standard ASL grammar
+ */
0[xX]{HexDigitChar}+ |
{DigitChar}+ { AslCompilerlval.i = UtDoConstant ((char *) AslCompilertext);
count (1); return (PARSEOP_INTEGER); }
@@ -591,6 +634,44 @@ NamePathTail [.]{NameSeg}
"Transfer8_16" { count (0); return (PARSEOP_XFERTYPE_8_16); }
"Transfer16" { count (0); return (PARSEOP_XFERTYPE_16); }
+ /* ToPld macro */
+
+"ToPLD" { count (0); return (PARSEOP_TOPLD); }
+
+"PLD_Revision" { count (0); return (PARSEOP_PLD_REVISION); }
+"PLD_IgnoreColor" { count (0); return (PARSEOP_PLD_IGNORECOLOR); }
+"PLD_Red" { count (0); return (PARSEOP_PLD_RED); }
+"PLD_Green" { count (0); return (PARSEOP_PLD_GREEN); }
+"PLD_Blue" { count (0); return (PARSEOP_PLD_BLUE); }
+"PLD_Width" { count (0); return (PARSEOP_PLD_WIDTH); }
+"PLD_Height" { count (0); return (PARSEOP_PLD_HEIGHT); }
+"PLD_UserVisible" { count (0); return (PARSEOP_PLD_USERVISIBLE); }
+"PLD_Dock" { count (0); return (PARSEOP_PLD_DOCK); }
+"PLD_Lid" { count (0); return (PARSEOP_PLD_LID); }
+"PLD_Panel" { count (0); return (PARSEOP_PLD_PANEL); }
+"PLD_VerticalPosition" { count (0); return (PARSEOP_PLD_VERTICALPOSITION); }
+"PLD_HorizontalPosition" { count (0); return (PARSEOP_PLD_HORIZONTALPOSITION); }
+"PLD_Shape" { count (0); return (PARSEOP_PLD_SHAPE); }
+"PLD_GroupOrientation" { count (0); return (PARSEOP_PLD_GROUPORIENTATION); }
+"PLD_GroupToken" { count (0); return (PARSEOP_PLD_GROUPTOKEN); }
+"PLD_GroupPosition" { count (0); return (PARSEOP_PLD_GROUPPOSITION); }
+"PLD_Bay" { count (0); return (PARSEOP_PLD_BAY); }
+"PLD_Ejectable" { count (0); return (PARSEOP_PLD_EJECTABLE); }
+"PLD_EjectRequired" { count (0); return (PARSEOP_PLD_EJECTREQUIRED); }
+"PLD_CabinetNumber" { count (0); return (PARSEOP_PLD_CABINETNUMBER); }
+"PLD_CardCageNumber" { count (0); return (PARSEOP_PLD_CARDCAGENUMBER); }
+"PLD_Reference" { count (0); return (PARSEOP_PLD_REFERENCE); }
+"PLD_Rotation" { count (0); return (PARSEOP_PLD_ROTATION); }
+"PLD_Order" { count (0); return (PARSEOP_PLD_ORDER); }
+"PLD_Reserved" { count (0); return (PARSEOP_PLD_RESERVED); }
+"PLD_VerticalOffset" { count (0); return (PARSEOP_PLD_VERTICALOFFSET); }
+"PLD_HorizontalOffset" { count (0); return (PARSEOP_PLD_HORIZONTALOFFSET); }
+
+
+ /* printf debug macros */
+"printf" { count (0); return (PARSEOP_PRINTF); }
+"fprintf" { count (0); return (PARSEOP_FPRINTF); }
+
/* Predefined compiler names */
"__DATE__" { count (0); return (PARSEOP___DATE__); }
@@ -607,7 +688,7 @@ NamePathTail [.]{NameSeg}
{NameSeg} { char *s;
count (0);
- s=malloc (ACPI_NAME_SIZE + 1);
+ s=UtStringCacheCalloc (ACPI_NAME_SIZE + 1);
if (strcmp (AslCompilertext, "\\"))
{
strcpy (s, "____");
@@ -620,18 +701,13 @@ NamePathTail [.]{NameSeg}
{NameString} { char *s;
count (0);
- s=malloc (strlen (AslCompilertext)+1);
+ s=UtStringCacheCalloc (strlen (AslCompilertext)+1);
AcpiUtStrupr (AslCompilertext);
strcpy (s, AslCompilertext);
- s[strlen (AslCompilertext)] = 0;
AslCompilerlval.s = s;
DbgPrint (ASL_PARSE_OUTPUT, "NameString: %s\n", s);
return (PARSEOP_NAMESTRING); }
-"*" |
-"/" { count (1);
- AslCompilererror ("Parse error, expecting ASL keyword or name");}
-
. { count (1);
sprintf (MsgBuffer,
"Invalid character (0x%2.2X), expecting ASL keyword or name",
@@ -639,9 +715,9 @@ NamePathTail [.]{NameSeg}
AslCompilererror (MsgBuffer);}
<<EOF>> { if (AslPopInputFileStack ())
- yyterminate();
+ {yyterminate();}
else
- return (PARSEOP_INCLUDE_END);};
+ {return (PARSEOP_INCLUDE_END);} };
%%
diff --git a/sys/contrib/dev/acpica/compiler/asldefine.h b/sys/contrib/dev/acpica/compiler/asldefine.h
index 76e2e12..f639ecc 100644
--- a/sys/contrib/dev/acpica/compiler/asldefine.h
+++ b/sys/contrib/dev/acpica/compiler/asldefine.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#ifndef __ASLDEFINE_H
#define __ASLDEFINE_H
@@ -50,19 +49,19 @@
* Compiler versions and names
*/
#define ASL_REVISION ACPI_CA_VERSION
-#define ASL_COMPILER_NAME "ASL Optimizing Compiler"
-#define AML_DISASSEMBLER_NAME "AML Disassembler"
+#define ASL_COMPILER_NAME "ASL+ Optimizing Compiler"
+#define AML_DISASSEMBLER_NAME "AML/ASL+ Disassembler"
#define ASL_INVOCATION_NAME "iasl"
#define ASL_CREATOR_ID "INTL"
-#define ASL_COMPLIANCE "Supports ACPI Specification Revision 5.0"
+#define ASL_COMPLIANCE "Supports ACPI Specification Revision 5.1"
/* Configuration constants */
#define ASL_MAX_ERROR_COUNT 200
-#define ASL_NODE_CACHE_SIZE 1024
-#define ASL_STRING_CACHE_SIZE 32768
+#define ASL_PARSEOP_CACHE_SIZE (1024 * 16)
+#define ASL_STRING_CACHE_SIZE (1024 * 64)
#define ASL_FIRST_PARSE_OPCODE PARSEOP_ACCESSAS
#define ASL_PARSE_OPCODE_BASE PARSEOP_ACCESSAS /* First Lex type */
@@ -109,6 +108,7 @@
#define FILE_SUFFIX_PREPROCESSOR "i"
#define FILE_SUFFIX_AML_CODE "aml"
+#define FILE_SUFFIX_MAP "map"
#define FILE_SUFFIX_LISTING "lst"
#define FILE_SUFFIX_HEX_DUMP "hex"
#define FILE_SUFFIX_DEBUG "txt"
diff --git a/sys/contrib/dev/acpica/compiler/aslerror.c b/sys/contrib/dev/acpica/compiler/aslerror.c
index ff6ec36..9b8928c 100644
--- a/sys/contrib/dev/acpica/compiler/aslerror.c
+++ b/sys/contrib/dev/acpica/compiler/aslerror.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define ASL_EXCEPTIONS
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#define _COMPONENT ACPI_COMPILER
@@ -56,6 +55,36 @@ AeAddToErrorLog (
/*******************************************************************************
*
+ * FUNCTION: AslAbort
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Dump the error log and abort the compiler. Used for serious
+ * I/O errors.
+ *
+ ******************************************************************************/
+
+void
+AslAbort (
+ void)
+{
+
+ AePrintErrorLog (ASL_FILE_STDERR);
+ if (Gbl_DebugFlag)
+ {
+ /* Print error summary to stdout also */
+
+ AePrintErrorLog (ASL_FILE_STDOUT);
+ }
+
+ exit (1);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AeClearErrorLog
*
* PARAMETERS: None
@@ -174,7 +203,7 @@ AePrintException (
int Actual;
size_t RActual;
UINT32 MsgLength;
- char *MainMessage;
+ const char *MainMessage;
char *ExtraMessage;
UINT32 SourceColumn;
UINT32 ErrorColumn;
@@ -200,6 +229,16 @@ AePrintException (
switch (Enode->Level)
{
+ case ASL_WARNING:
+ case ASL_WARNING2:
+ case ASL_WARNING3:
+
+ if (!Gbl_DisplayWarnings)
+ {
+ return;
+ }
+ break;
+
case ASL_REMARK:
if (!Gbl_DisplayRemarks)
@@ -222,11 +261,10 @@ AePrintException (
}
}
- /* Get the file handles */
+ /* Get the various required file handles */
OutputFile = Gbl_Files[FileId].Handle;
-
if (!Enode->SourceLine)
{
/* Use the merged header/source file if present, otherwise use input file */
@@ -360,109 +398,93 @@ AePrintException (
}
}
- /* NULL message ID, just print the raw message */
+ /* If a NULL message ID, just print the raw message */
if (Enode->MessageId == 0)
{
fprintf (OutputFile, "%s\n", Enode->Message);
+ return;
}
- else
- {
- /* Decode the message ID */
- if (Gbl_VerboseErrors)
- {
- fprintf (OutputFile, "%s %4.4d -",
- AslErrorLevel[Enode->Level],
- Enode->MessageId + ((Enode->Level+1) * 1000));
- }
- else /* IDE case */
- {
- fprintf (OutputFile, "%s %4.4d:",
- AslErrorLevelIde[Enode->Level],
- Enode->MessageId + ((Enode->Level+1) * 1000));
- }
+ /* Decode the message ID */
- MainMessage = AslMessages[Enode->MessageId];
- ExtraMessage = Enode->Message;
+ fprintf (OutputFile, "%s %4.4d -",
+ AeDecodeExceptionLevel (Enode->Level),
+ AeBuildFullExceptionCode (Enode->Level, Enode->MessageId));
- if (Enode->LineNumber)
- {
- /* Main message: try to use string from AslMessages first */
+ MainMessage = AeDecodeMessageId (Enode->MessageId);
+ ExtraMessage = Enode->Message;
- if (!MainMessage)
- {
- MainMessage = "";
- }
+ /* If a NULL line number, just print the decoded message */
- MsgLength = strlen (MainMessage);
- if (MsgLength == 0)
- {
- /* Use the secondary/extra message as main message */
+ if (!Enode->LineNumber)
+ {
+ fprintf (OutputFile, " %s %s\n\n", MainMessage, ExtraMessage);
+ return;
+ }
- MainMessage = Enode->Message;
- if (!MainMessage)
- {
- MainMessage = "";
- }
+ MsgLength = strlen (MainMessage);
+ if (MsgLength == 0)
+ {
+ /* Use the secondary/extra message as main message */
- MsgLength = strlen (MainMessage);
- ExtraMessage = NULL;
- }
+ MainMessage = Enode->Message;
+ if (!MainMessage)
+ {
+ MainMessage = "";
+ }
- if (Gbl_VerboseErrors && !PrematureEOF)
- {
- if (Total >= 256)
- {
- fprintf (OutputFile, " %s",
- MainMessage);
- }
- else
- {
- SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2;
- ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1;
+ MsgLength = strlen (MainMessage);
+ ExtraMessage = NULL;
+ }
- if ((MsgLength + ErrorColumn) < (SourceColumn - 1))
- {
- fprintf (OutputFile, "%*s%s",
- (int) ((SourceColumn - 1) - ErrorColumn),
- MainMessage, " ^ ");
- }
- else
- {
- fprintf (OutputFile, "%*s %s",
- (int) ((SourceColumn - ErrorColumn) + 1), "^",
- MainMessage);
- }
- }
+ if (Gbl_VerboseErrors && !PrematureEOF)
+ {
+ if (Total >= 256)
+ {
+ fprintf (OutputFile, " %s",
+ MainMessage);
+ }
+ else
+ {
+ SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2;
+ ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1;
+
+ if ((MsgLength + ErrorColumn) < (SourceColumn - 1))
+ {
+ fprintf (OutputFile, "%*s%s",
+ (int) ((SourceColumn - 1) - ErrorColumn),
+ MainMessage, " ^ ");
}
else
{
- fprintf (OutputFile, " %s", MainMessage);
+ fprintf (OutputFile, "%*s %s",
+ (int) ((SourceColumn - ErrorColumn) + 1), "^",
+ MainMessage);
}
+ }
+ }
+ else
+ {
+ fprintf (OutputFile, " %s", MainMessage);
+ }
- /* Print the extra info message if present */
+ /* Print the extra info message if present */
- if (ExtraMessage)
- {
- fprintf (OutputFile, " (%s)", ExtraMessage);
- }
+ if (ExtraMessage)
+ {
+ fprintf (OutputFile, " (%s)", ExtraMessage);
+ }
- if (PrematureEOF)
- {
- fprintf (OutputFile, " and premature End-Of-File");
- }
+ if (PrematureEOF)
+ {
+ fprintf (OutputFile, " and premature End-Of-File");
+ }
- fprintf (OutputFile, "\n");
- if (Gbl_VerboseErrors)
- {
- fprintf (OutputFile, "\n");
- }
- }
- else
- {
- fprintf (OutputFile, " %s %s\n\n", MainMessage, ExtraMessage);
- }
+ fprintf (OutputFile, "\n");
+ if (Gbl_VerboseErrors)
+ {
+ fprintf (OutputFile, "\n");
}
}
@@ -517,7 +539,7 @@ AePrintErrorLog (
void
AslCommonError2 (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 LineNumber,
UINT32 Column,
char *SourceLine,
@@ -535,7 +557,7 @@ AslCommonError2 (
{
/* Allocate a buffer for the message and a new error node */
- MessageBuffer = UtLocalCalloc (strlen (ExtraMessage) + 1);
+ MessageBuffer = UtStringCacheCalloc (strlen (ExtraMessage) + 1);
/* Keep a copy of the extra message */
@@ -549,7 +571,7 @@ AslCommonError2 (
if (Filename)
{
- Enode->Filename = Filename;
+ Enode->Filename = Filename;
Enode->FilenameLength = strlen (Filename);
if (Enode->FilenameLength < 6)
{
@@ -603,7 +625,7 @@ AslCommonError2 (
void
AslCommonError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 CurrentLineNumber,
UINT32 LogicalLineNumber,
UINT32 LogicalByteOffset,
@@ -611,7 +633,6 @@ AslCommonError (
char *Filename,
char *ExtraMessage)
{
- UINT32 MessageSize;
char *MessageBuffer = NULL;
ASL_ERROR_MSG *Enode;
@@ -622,8 +643,7 @@ AslCommonError (
{
/* Allocate a buffer for the message and a new error node */
- MessageSize = strlen (ExtraMessage) + 1;
- MessageBuffer = UtLocalCalloc (MessageSize);
+ MessageBuffer = UtStringCacheCalloc (strlen (ExtraMessage) + 1);
/* Keep a copy of the extra message */
@@ -634,7 +654,7 @@ AslCommonError (
if (Filename)
{
- Enode->Filename = Filename;
+ Enode->Filename = Filename;
Enode->FilenameLength = strlen (Filename);
if (Enode->FilenameLength < 6)
{
@@ -739,7 +759,7 @@ AslDisableException (
BOOLEAN
AslIsExceptionDisabled (
UINT8 Level,
- UINT8 MessageId)
+ UINT16 MessageId)
{
UINT32 EncodedMessageId;
UINT32 i;
@@ -764,7 +784,7 @@ AslIsExceptionDisabled (
* Ignore this warning/remark if it has been disabled by
* the user (-vw option)
*/
- EncodedMessageId = MessageId + ((Level + 1) * 1000);
+ EncodedMessageId = AeBuildFullExceptionCode (Level, MessageId);
for (i = 0; i < Gbl_DisabledMessagesIndex; i++)
{
/* Simple implementation via fixed array */
@@ -803,14 +823,15 @@ AslIsExceptionDisabled (
void
AslError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
ACPI_PARSE_OBJECT *Op,
char *ExtraMessage)
{
/* Check if user wants to ignore this exception */
- if (AslIsExceptionDisabled (Level, MessageId))
+ if (Gbl_AllExceptionsDisabled ||
+ AslIsExceptionDisabled (Level, MessageId))
{
return;
}
@@ -836,14 +857,14 @@ AslError (
* FUNCTION: AslCoreSubsystemError
*
* PARAMETERS: Op - Parse node where error happened
- * Status - The ACPI CA Exception
+ * Status - The ACPICA Exception
* ExtraMessage - additional error message
* Abort - TRUE -> Abort compilation
*
* RETURN: None
*
- * DESCRIPTION: Error reporting routine for exceptions returned by the ACPI
- * CA core subsystem.
+ * DESCRIPTION: Error reporting routine for exceptions returned by the ACPICA
+ * core subsystem.
*
******************************************************************************/
@@ -897,6 +918,8 @@ AslCompilererror (
const char *CompilerMessage)
{
+ Gbl_SyntaxError++;
+
AslCommonError (ASL_ERROR, ASL_MSG_SYNTAX, Gbl_CurrentLineNumber,
Gbl_LogicalLineNumber, Gbl_CurrentLineOffset,
Gbl_CurrentColumn, Gbl_Files[ASL_FILE_INPUT].Filename,
diff --git a/sys/contrib/dev/acpica/compiler/aslfileio.c b/sys/contrib/dev/acpica/compiler/aslfileio.c
index 660b82f..cf726dd 100644
--- a/sys/contrib/dev/acpica/compiler/aslfileio.c
+++ b/sys/contrib/dev/acpica/compiler/aslfileio.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,6 +42,7 @@
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
+#include <contrib/dev/acpica/include/acapps.h>
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslfileio")
@@ -49,36 +50,6 @@
/*******************************************************************************
*
- * FUNCTION: AslAbort
- *
- * PARAMETERS: None
- *
- * RETURN: None
- *
- * DESCRIPTION: Dump the error log and abort the compiler. Used for serious
- * I/O errors.
- *
- ******************************************************************************/
-
-void
-AslAbort (
- void)
-{
-
- AePrintErrorLog (ASL_FILE_STDERR);
- if (Gbl_DebugFlag)
- {
- /* Print error summary to stdout also */
-
- AePrintErrorLog (ASL_FILE_STDOUT);
- }
-
- exit (1);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: FlFileError
*
* PARAMETERS: FileId - Index into file info array
@@ -97,8 +68,8 @@ FlFileError (
UINT8 ErrorId)
{
- sprintf (MsgBuffer, "\"%s\" (%s)", Gbl_Files[FileId].Filename,
- strerror (errno));
+ sprintf (MsgBuffer, "\"%s\" (%s) - %s", Gbl_Files[FileId].Filename,
+ Gbl_Files[FileId].Description, strerror (errno));
AslCommonError (ASL_ERROR, ErrorId, 0, 0, 0, 0, NULL, MsgBuffer);
}
@@ -127,6 +98,9 @@ FlOpenFile (
FILE *File;
+ Gbl_Files[FileId].Filename = Filename;
+ Gbl_Files[FileId].Handle = NULL;
+
File = fopen (Filename, Mode);
if (!File)
{
@@ -134,8 +108,7 @@ FlOpenFile (
AslAbort ();
}
- Gbl_Files[FileId].Filename = Filename;
- Gbl_Files[FileId].Handle = File;
+ Gbl_Files[FileId].Handle = File;
}
@@ -147,7 +120,8 @@ FlOpenFile (
*
* RETURN: File Size
*
- * DESCRIPTION: Get current file size. Uses seek-to-EOF. File must be open.
+ * DESCRIPTION: Get current file size. Uses common seek-to-EOF function.
+ * File must be open. Aborts compiler on error.
*
******************************************************************************/
@@ -155,20 +129,15 @@ UINT32
FlGetFileSize (
UINT32 FileId)
{
- FILE *fp;
UINT32 FileSize;
- long Offset;
-
-
- fp = Gbl_Files[FileId].Handle;
- Offset = ftell (fp);
- fseek (fp, 0, SEEK_END);
- FileSize = (UINT32) ftell (fp);
- /* Restore file pointer */
+ FileSize = CmGetFileSize (Gbl_Files[FileId].Handle);
+ if (FileSize == ACPI_UINT32_MAX)
+ {
+ AslAbort();
+ }
- fseek (fp, Offset, SEEK_SET);
return (FileSize);
}
@@ -352,6 +321,8 @@ FlCloseFile (
AslAbort ();
}
+ /* Do not clear/free the filename string */
+
Gbl_Files[FileId].Handle = NULL;
return;
}
diff --git a/sys/contrib/dev/acpica/compiler/aslfiles.c b/sys/contrib/dev/acpica/compiler/aslfiles.c
index 2ed9413..63a8dbb 100644
--- a/sys/contrib/dev/acpica/compiler/aslfiles.c
+++ b/sys/contrib/dev/acpica/compiler/aslfiles.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -107,6 +107,8 @@ FlSetFilename (
DbgPrint (ASL_PARSE_OUTPUT, "\n#line: New filename %s (old %s)\n",
Filename, Gbl_Files[ASL_FILE_INPUT].Filename);
+ /* No need to free any existing filename */
+
Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
}
@@ -216,14 +218,14 @@ FlMergePathnames (
(*FilePathname == '/') ||
(FilePathname[1] == ':'))
{
- Pathname = ACPI_ALLOCATE (strlen (FilePathname) + 1);
+ Pathname = UtStringCacheCalloc (strlen (FilePathname) + 1);
strcpy (Pathname, FilePathname);
goto ConvertBackslashes;
}
/* Need a local copy of the prefix directory path */
- CommonPath = ACPI_ALLOCATE (strlen (PrefixDir) + 1);
+ CommonPath = UtStringCacheCalloc (strlen (PrefixDir) + 1);
strcpy (CommonPath, PrefixDir);
/*
@@ -259,14 +261,13 @@ FlMergePathnames (
/* Build the final merged pathname */
ConcatenatePaths:
- Pathname = ACPI_ALLOCATE_ZEROED (strlen (CommonPath) + strlen (FilePathname) + 2);
+ Pathname = UtStringCacheCalloc (strlen (CommonPath) + strlen (FilePathname) + 2);
if (LastElement && *CommonPath)
{
strcpy (Pathname, CommonPath);
strcat (Pathname, "/");
}
strcat (Pathname, FilePathname);
- ACPI_FREE (CommonPath);
/* Convert all backslashes to normal slashes */
@@ -484,6 +485,8 @@ FlOpenAmlOutputFile (
0, 0, 0, 0, NULL, NULL);
return (AE_ERROR);
}
+
+ Gbl_Files[ASL_FILE_AML_OUTPUT].Filename = Filename;
}
/* Open the output AML file in binary mode */
@@ -562,9 +565,14 @@ FlOpenMiscOutputFiles (
if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle)
{
- AslCommonError (ASL_ERROR, ASL_MSG_DEBUG_FILENAME,
- 0, 0, 0, 0, NULL, NULL);
- return (AE_ERROR);
+ /*
+ * A problem with freopen is that on error,
+ * we no longer have stderr.
+ */
+ Gbl_DebugFlag = FALSE;
+ memcpy (stderr, stdout, sizeof (FILE));
+ FlFileError (ASL_FILE_DEBUG_OUTPUT, ASL_MSG_DEBUG_FILENAME);
+ AslAbort ();
}
AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT);
@@ -757,6 +765,26 @@ FlOpenMiscOutputFiles (
AslCompilerFileHeader (ASL_FILE_NAMESPACE_OUTPUT);
}
+ /* Create/Open a map file if requested */
+
+ if (Gbl_MapfileFlag)
+ {
+ Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_MAP);
+ if (!Filename)
+ {
+ AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
+ 0, 0, 0, 0, NULL, NULL);
+ return (AE_ERROR);
+ }
+
+ /* Open the hex file, text mode (closed at compiler exit) */
+
+ FlOpenFile (ASL_FILE_MAP_OUTPUT, Filename, "w+t");
+
+ AslCompilerSignon (ASL_FILE_MAP_OUTPUT);
+ AslCompilerFileHeader (ASL_FILE_MAP_OUTPUT);
+ }
+
return (AE_OK);
}
@@ -824,6 +852,7 @@ FlParseInputPathname (
*(Substring+1) = 0;
}
+ UtConvertBackslashes (Gbl_OutputFilenamePrefix);
return (AE_OK);
}
#endif
diff --git a/sys/contrib/dev/acpica/compiler/aslfold.c b/sys/contrib/dev/acpica/compiler/aslfold.c
index 00595af..b8038ec 100644
--- a/sys/contrib/dev/acpica/compiler/aslfold.c
+++ b/sys/contrib/dev/acpica/compiler/aslfold.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
diff --git a/sys/contrib/dev/acpica/compiler/aslglobal.h b/sys/contrib/dev/acpica/compiler/aslglobal.h
index 3f2c401..c61b8ff 100644
--- a/sys/contrib/dev/acpica/compiler/aslglobal.h
+++ b/sys/contrib/dev/acpica/compiler/aslglobal.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#ifndef __ASLGLOBAL_H
#define __ASLGLOBAL_H
@@ -63,11 +62,6 @@
#ifdef _DECLARE_GLOBALS
UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0};
-char AslHexLookup[] =
-{
- '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
-};
-
/* Table below must match ASL_FILE_TYPES in asltypes.h */
@@ -87,12 +81,12 @@ ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES] =
{NULL, NULL, "C Source: ", "C Code Output"},
{NULL, NULL, "ASM Include: ", "Assembly Header Output"},
{NULL, NULL, "C Include: ", "C Header Output"},
- {NULL, NULL, "Offset Table: ", "C Offset Table Output"}
+ {NULL, NULL, "Offset Table: ", "C Offset Table Output"},
+ {NULL, NULL, "Device Map: ", "Device Map Output"}
};
#else
extern UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS];
-extern char AslHexLookup[];
extern ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES];
#endif
@@ -102,12 +96,20 @@ extern ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES];
*/
extern int yydebug;
extern FILE *AslCompilerin;
-extern int AslCompilerdebug;
extern int DtParserdebug;
extern int PrParserdebug;
extern const ASL_MAPPING_ENTRY AslKeywordMapping[];
extern char *AslCompilertext;
+/*
+ * Older versions of Bison won't emit this external in the generated header.
+ * Newer versions do emit the external, so we don't need to do it.
+ */
+#ifndef ASLCOMPILER_ASLCOMPILERPARSE_H
+extern int AslCompilerdebug;
+#endif
+
+
#define ASL_DEFAULT_LINE_BUFFER_SIZE (1024 * 32) /* 32K */
#define ASL_MSG_BUFFER_SIZE 4096
#define ASL_MAX_DISABLED_MESSAGES 32
@@ -125,6 +127,7 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_PreviousLineNumber, 0);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineNumber, 1);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_LogicalLineNumber, 1);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineOffset, 0);
+ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_SyntaxError, 0);
/* Exception reporting */
@@ -140,6 +143,7 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessFlag, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisassembleAll, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseDefaultAmlFilename, TRUE);
+ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_MapfileFlag, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NsOutputFlag, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessorOutputFlag, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DebugFlag, FALSE);
@@ -159,16 +163,18 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoErrors, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_WarningsAsErrors, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoResourceChecking, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisasmFlag, FALSE);
-ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_GetAllTables, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_IntegerOptimizationFlag, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ReferenceOptimizationFlag, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayRemarks, TRUE);
+ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayWarnings, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayOptimizations, FALSE);
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_WarningLevel, ASL_WARNING);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseOriginalCompilerId, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseTemplates, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoTemplates, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileGeneric, FALSE);
+ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AllExceptionsDisabled, FALSE);
+ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PruneParseTree, FALSE);
#define HEX_OUTPUT_NONE 0
@@ -206,6 +212,25 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalAllocated, 0);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalFolds, 0);
+/* Local caches */
+
+ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ParseOpCount, 0);
+ASL_EXTERN ASL_CACHE_INFO ASL_INIT_GLOBAL (*Gbl_ParseOpCacheList, NULL);
+ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_ParseOpCacheNext, NULL);
+ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_ParseOpCacheLast, NULL);
+
+ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_StringCount, 0);
+ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_StringSize, 0);
+ASL_EXTERN ASL_CACHE_INFO ASL_INIT_GLOBAL (*Gbl_StringCacheList, NULL);
+ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheNext, NULL);
+ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheLast, NULL);
+
+/* Map file */
+
+ASL_EXTERN ACPI_GPIO_INFO ASL_INIT_GLOBAL (*Gbl_GpioList, NULL);
+ASL_EXTERN ACPI_SERIAL_INFO ASL_INIT_GLOBAL (*Gbl_SerialList, NULL);
+
+
/* Misc */
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_RevisionOverride, 0);
@@ -214,10 +239,6 @@ ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*RootNode, NULL);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_TableLength, 0);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_SourceLine, 0);
ASL_EXTERN ASL_LISTING_NODE ASL_INIT_GLOBAL (*Gbl_ListingNode, NULL);
-ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_NodeCacheNext, NULL);
-ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_NodeCacheLast, NULL);
-ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheNext, NULL);
-ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheLast, NULL);
ASL_EXTERN ACPI_PARSE_OBJECT *Gbl_FirstLevelInsertionNode;
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_FileType, 0);
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_Signature, NULL);
@@ -232,7 +253,8 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_NumNamespaceObjects, 0)
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ReservedMethods, 0);
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableSignature, "NO_SIG");
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableId, "NO_ID");
-ASL_EXTERN FILE *AcpiGbl_DebugFile; /* Placeholder for oswinxf only */
+ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_PruneDepth, 0);
+ASL_EXTERN UINT16 ASL_INIT_GLOBAL (Gbl_PruneType, 0);
/* Static structures */
diff --git a/sys/contrib/dev/acpica/compiler/aslhex.c b/sys/contrib/dev/acpica/compiler/aslhex.c
index 8d69b92..f24de1c 100644
--- a/sys/contrib/dev/acpica/compiler/aslhex.c
+++ b/sys/contrib/dev/acpica/compiler/aslhex.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#define _COMPONENT ACPI_COMPILER
diff --git a/sys/contrib/dev/acpica/compiler/asllength.c b/sys/contrib/dev/acpica/compiler/asllength.c
index 53e860c..618b63f 100644
--- a/sys/contrib/dev/acpica/compiler/asllength.c
+++ b/sys/contrib/dev/acpica/compiler/asllength.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
diff --git a/sys/contrib/dev/acpica/compiler/asllisting.c b/sys/contrib/dev/acpica/compiler/asllisting.c
index 2b02541..9c51a93 100644
--- a/sys/contrib/dev/acpica/compiler/asllisting.c
+++ b/sys/contrib/dev/acpica/compiler/asllisting.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/asllistsup.c b/sys/contrib/dev/acpica/compiler/asllistsup.c
index 795672e..694fbc8 100644
--- a/sys/contrib/dev/acpica/compiler/asllistsup.c
+++ b/sys/contrib/dev/acpica/compiler/asllistsup.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslload.c b/sys/contrib/dev/acpica/compiler/aslload.c
index bc4d593..c8ae3ad 100644
--- a/sys/contrib/dev/acpica/compiler/aslload.c
+++ b/sys/contrib/dev/acpica/compiler/aslload.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __ASLLOAD_C__
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/include/amlcode.h>
#include <contrib/dev/acpica/include/acdispat.h>
@@ -129,6 +127,7 @@ LdLoadNamespace (
/* Dump the namespace if debug is enabled */
AcpiNsDumpTables (ACPI_NS_ALL, ACPI_UINT32_MAX);
+ ACPI_FREE (WalkState);
return (AE_OK);
}
@@ -359,7 +358,6 @@ LdNamespace1Begin (
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op %p [%s]\n",
Op, Op->Asl.ParseOpName));
-
/*
* We are only interested in opcodes that have an associated name
* (or multiple names)
@@ -373,6 +371,34 @@ LdNamespace1Begin (
Status = LdLoadFieldElements (Op, WalkState);
return (Status);
+ case AML_INT_CONNECTION_OP:
+
+
+ if (Op->Asl.Child->Asl.AmlOpcode != AML_INT_NAMEPATH_OP)
+ {
+ break;
+ }
+ Arg = Op->Asl.Child;
+
+ Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Asl.ExternalName,
+ ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
+ WalkState, &Node);
+ if (ACPI_FAILURE (Status))
+ {
+ break;
+ }
+
+ if (Node->Type == ACPI_TYPE_BUFFER)
+ {
+ Arg->Asl.Node = Node;
+
+ Arg = Node->Op->Asl.Child; /* Get namepath */
+ Arg = Arg->Asl.Next; /* Get actual buffer */
+ Arg = Arg->Asl.Child; /* Buffer length */
+ Arg = Arg->Asl.Next; /* RAW_DATA buffer */
+ }
+ break;
+
default:
/* All other opcodes go below */
@@ -466,7 +492,6 @@ LdNamespace1Begin (
ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
break;
-
case PARSEOP_SCOPE:
/*
* The name referenced by Scope(Name) must already exist at this point.
diff --git a/sys/contrib/dev/acpica/compiler/asllookup.c b/sys/contrib/dev/acpica/compiler/asllookup.c
index 66c0950..a527a38 100644
--- a/sys/contrib/dev/acpica/compiler/asllookup.c
+++ b/sys/contrib/dev/acpica/compiler/asllookup.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acparser.h>
@@ -105,7 +104,9 @@ LkFindUnreferencedObjects (
* DESCRIPTION: Check for an unreferenced namespace object and emit a warning.
* We have to be careful, because some types and names are
* typically or always unreferenced, we don't want to issue
- * excessive warnings.
+ * excessive warnings. Note: Names that are declared within a
+ * control method are temporary, so we always issue a remark
+ * if they are not referenced.
*
******************************************************************************/
@@ -117,6 +118,7 @@ LkIsObjectUsed (
void **ReturnValue)
{
ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
+ ACPI_NAMESPACE_NODE *Next;
/* Referenced flag is set during the namespace xref */
@@ -126,23 +128,19 @@ LkIsObjectUsed (
return (AE_OK);
}
- /*
- * Ignore names that start with an underscore,
- * these are the reserved ACPI names and are typically not referenced,
- * they are called by the host OS.
- */
- if (Node->Name.Ascii[0] == '_')
+ if (!Node->Op)
{
return (AE_OK);
}
- /* There are some types that are typically not referenced, ignore them */
+ /* These types are typically never directly referenced, ignore them */
switch (Node->Type)
{
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_PROCESSOR:
case ACPI_TYPE_POWER:
+ case ACPI_TYPE_THERMAL:
case ACPI_TYPE_LOCAL_RESOURCE:
return (AE_OK);
@@ -152,12 +150,47 @@ LkIsObjectUsed (
break;
}
- /* All others are valid unreferenced namespace objects */
+ /* Determine if the name is within a control method */
+
+ Next = Node->Parent;
+ while (Next)
+ {
+ if (Next->Type == ACPI_TYPE_METHOD)
+ {
+ /*
+ * Name is within a method, therefore it is temporary.
+ * Issue a remark even if it is a reserved name (starts
+ * with an underscore).
+ */
+ sprintf (MsgBuffer, "Name is within method [%4.4s]",
+ Next->Name.Ascii);
+ AslError (ASL_REMARK, ASL_MSG_NOT_REFERENCED,
+ LkGetNameOp (Node->Op), MsgBuffer);
+ return (AE_OK);
+ }
+
+ Next = Next->Parent;
+ }
+
+ /* The name is not within a control method */
- if (Node->Op)
+ /*
+ * Ignore names that start with an underscore. These are the reserved
+ * ACPI names and are typically not referenced since they are meant
+ * to be called by the host OS.
+ */
+ if (Node->Name.Ascii[0] == '_')
{
- AslError (ASL_WARNING2, ASL_MSG_NOT_REFERENCED, LkGetNameOp (Node->Op), NULL);
+ return (AE_OK);
}
+
+ /*
+ * What remains is an unresolved user name that is not within a method.
+ * However, the object could be referenced via another table, so issue
+ * the warning at level 2.
+ */
+ AslError (ASL_WARNING2, ASL_MSG_NOT_REFERENCED,
+ LkGetNameOp (Node->Op), NULL);
return (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslmain.c b/sys/contrib/dev/acpica/compiler/aslmain.c
index 67e561a..d7ba1ae 100644
--- a/sys/contrib/dev/acpica/compiler/aslmain.c
+++ b/sys/contrib/dev/acpica/compiler/aslmain.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -51,6 +51,17 @@
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslmain")
+/*
+ * Main routine for the iASL compiler.
+ *
+ * Portability note: The compiler depends upon the host for command-line
+ * wildcard support - it is not implemented locally. For example:
+ *
+ * Linux/Unix systems: Shell expands wildcards automatically.
+ *
+ * Windows: The setargv.obj module must be linked in to automatically
+ * expand wildcards.
+ */
/* Local prototypes */
@@ -62,6 +73,36 @@ static void
AslInitialize (
void);
+UINT8
+AcpiIsBigEndianMachine (
+ void);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiIsBigEndianMachine
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: TRUE if machine is big endian
+ * FALSE if machine is little endian
+ *
+ * DESCRIPTION: Detect whether machine is little endian or big endian.
+ *
+ ******************************************************************************/
+
+UINT8
+AcpiIsBigEndianMachine (
+ void)
+{
+ union {
+ UINT32 Integer;
+ UINT8 Bytes[4];
+ } Overlay = {0xFF000000};
+
+ return (Overlay.Bytes[0]); /* Returns 0xFF (TRUE) for big endian */
+}
+
/*******************************************************************************
*
@@ -83,11 +124,21 @@ Usage (
printf ("%s\n\n", ASL_COMPLIANCE);
ACPI_USAGE_HEADER ("iasl [Options] [Files]");
- printf ("\nGlobal:\n");
+ printf ("\nGeneral:\n");
ACPI_OPTION ("-@ <file>", "Specify command file");
ACPI_OPTION ("-I <dir>", "Specify additional include directory");
ACPI_OPTION ("-T <sig>|ALL|*", "Create table template file for ACPI <Sig>");
+ ACPI_OPTION ("-p <prefix>", "Specify path/filename prefix for all output files");
ACPI_OPTION ("-v", "Display compiler version");
+ ACPI_OPTION ("-vo", "Enable optimization comments");
+ ACPI_OPTION ("-vs", "Disable signon");
+
+ printf ("\nHelp:\n");
+ ACPI_OPTION ("-h", "This message");
+ ACPI_OPTION ("-hc", "Display operators allowed in constant expressions");
+ ACPI_OPTION ("-hf", "Display help for output filename generation");
+ ACPI_OPTION ("-hr", "Display ACPI reserved method names");
+ ACPI_OPTION ("-ht", "Display currently supported ACPI table names");
printf ("\nPreprocessor:\n");
ACPI_OPTION ("-D <symbol>", "Define symbol for preprocessor use");
@@ -95,13 +146,11 @@ Usage (
ACPI_OPTION ("-P", "Preprocess only and create preprocessor output file (*.i)");
ACPI_OPTION ("-Pn", "Disable preprocessor");
- printf ("\nGeneral Processing:\n");
- ACPI_OPTION ("-p <prefix>", "Specify path/filename prefix for all output files");
- ACPI_OPTION ("-va", "Disable all errors and warnings (summary only)");
+ printf ("\nErrors, Warnings, and Remarks:\n");
+ ACPI_OPTION ("-va", "Disable all errors/warnings/remarks");
+ ACPI_OPTION ("-ve", "Report only errors (ignore warnings and remarks)");
ACPI_OPTION ("-vi", "Less verbose errors and warnings for use with IDEs");
- ACPI_OPTION ("-vo", "Enable optimization comments");
ACPI_OPTION ("-vr", "Disable remarks");
- ACPI_OPTION ("-vs", "Disable signon");
ACPI_OPTION ("-vw <messageid>", "Disable specific warning or remark");
ACPI_OPTION ("-w1 -w2 -w3", "Set warning reporting level");
ACPI_OPTION ("-we", "Report warnings as errors");
@@ -123,6 +172,7 @@ Usage (
printf ("\nOptional Listing Files:\n");
ACPI_OPTION ("-l", "Create mixed listing file (ASL source and AML) (*.lst)");
+ ACPI_OPTION ("-lm", "Create hardware summary map file (*.map)");
ACPI_OPTION ("-ln", "Create namespace file (*.nsp)");
ACPI_OPTION ("-ls", "Create combined source file (expanded includes) (*.src)");
@@ -131,27 +181,23 @@ Usage (
ACPI_OPTION ("-vt", "Create verbose template files (full disassembly)");
printf ("\nAML Disassembler:\n");
- ACPI_OPTION ("-d <f1,f2>", "Disassemble or decode binary ACPI tables to file (*.dsl)");
+ ACPI_OPTION ("-d <f1 f2 ...>", "Disassemble or decode binary ACPI tables to file (*.dsl)");
ACPI_OPTION ("", " (Optional, file type is automatically detected)");
- ACPI_OPTION ("-da <f1,f2>", "Disassemble multiple tables from single namespace");
+ ACPI_OPTION ("-da <f1 f2 ...>", "Disassemble multiple tables from single namespace");
ACPI_OPTION ("-db", "Do not translate Buffers to Resource Templates");
- ACPI_OPTION ("-dc <f1,f2>", "Disassemble AML and immediately compile it");
+ ACPI_OPTION ("-dc <f1 f2 ...>", "Disassemble AML and immediately compile it");
ACPI_OPTION ("", " (Obtain DSDT from current system if no input file)");
- ACPI_OPTION ("-e <f1,f2>", "Include ACPI table(s) for external symbol resolution");
+ ACPI_OPTION ("-dl", "Emit legacy ASL code only (no C-style operators)");
+ ACPI_OPTION ("-e <f1 f2 ...>", "Include ACPI table(s) for external symbol resolution");
ACPI_OPTION ("-fe <file>", "Specify external symbol declaration file");
- ACPI_OPTION ("-g", "Get ACPI tables and write to files (*.dat)");
ACPI_OPTION ("-in", "Ignore NoOp opcodes");
ACPI_OPTION ("-vt", "Dump binary table data in hex format within output file");
- printf ("\nHelp:\n");
- ACPI_OPTION ("-h", "This message");
- ACPI_OPTION ("-hc", "Display operators allowed in constant expressions");
- ACPI_OPTION ("-hf", "Display help for output filename generation");
- ACPI_OPTION ("-hr", "Display ACPI reserved method names");
- ACPI_OPTION ("-ht", "Display currently supported ACPI table names");
-
printf ("\nDebug Options:\n");
- ACPI_OPTION ("-bf -bt", "Create debug file (full or parse tree only) (*.txt)");
+ ACPI_OPTION ("-bf", "Create debug file (full output) (*.txt)");
+ ACPI_OPTION ("-bs", "Create debug file (parse tree only) (*.txt)");
+ ACPI_OPTION ("-bp <depth>", "Prune ASL parse tree");
+ ACPI_OPTION ("-bt <type>", "Object type to be pruned from the parse tree");
ACPI_OPTION ("-f", "Ignore errors, force creation of AML output file(s)");
ACPI_OPTION ("-m <size>", "Set internal line buffer size (in Kbytes)");
ACPI_OPTION ("-n", "Parse only, no output generation");
@@ -286,8 +332,22 @@ main (
ACPI_STATUS Status;
int Index1;
int Index2;
+ int ReturnStatus = 0;
+
+ /*
+ * Big-endian machines are not currently supported. ACPI tables must
+ * be little-endian, and support for big-endian machines needs to
+ * be implemented.
+ */
+ if (AcpiIsBigEndianMachine ())
+ {
+ fprintf (stderr,
+ "iASL is not currently supported on big-endian machines.\n");
+ return (-1);
+ }
+ AcpiOsInitialize ();
ACPI_DEBUG_INITIALIZE (); /* For debug version only */
/* Initialize preprocessor and compiler before command line processing */
@@ -307,21 +367,11 @@ main (
/* Perform global actions first/only */
- if (Gbl_GetAllTables)
- {
- Status = AslDoOneFile (NULL);
- if (ACPI_FAILURE (Status))
- {
- return (-1);
- }
- return (0);
- }
-
if (Gbl_DisassembleAll)
{
while (argv[Index1])
{
- Status = AslDoOnePathname (argv[Index1], AcpiDmAddToExternalFileList);
+ Status = AcpiDmAddToExternalFileList (argv[Index1]);
if (ACPI_FAILURE (Status))
{
return (-1);
@@ -335,19 +385,36 @@ main (
while (argv[Index2])
{
- Status = AslDoOnePathname (argv[Index2], AslDoOneFile);
+ /*
+ * If -p not specified, we will use the input filename as the
+ * output filename prefix
+ */
+ if (Gbl_UseDefaultAmlFilename)
+ {
+ Gbl_OutputFilenamePrefix = argv[Index2];
+ UtConvertBackslashes (Gbl_OutputFilenamePrefix);
+ }
+
+ Status = AslDoOneFile (argv[Index2]);
if (ACPI_FAILURE (Status))
{
- return (-1);
+ ReturnStatus = -1;
+ goto CleanupAndExit;
}
Index2++;
}
+
+CleanupAndExit:
+
+ UtFreeLineBuffers ();
+ AslParserCleanup ();
+
if (AcpiGbl_ExternalFileList)
{
AcpiDmClearExternalFileList();
}
- return (0);
+ return (ReturnStatus);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslmap.c b/sys/contrib/dev/acpica/compiler/aslmap.c
index 0d2e636..3d0e327 100644
--- a/sys/contrib/dev/acpica/compiler/aslmap.c
+++ b/sys/contrib/dev/acpica/compiler/aslmap.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -446,7 +446,38 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
/* XFERTYPE_16 */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0),
/* XOR */ OP_TABLE_ENTRY (AML_BIT_XOR_OP, 0, 0, ACPI_BTYPE_INTEGER),
/* ZERO */ OP_TABLE_ENTRY (AML_ZERO_OP, 0, 0, ACPI_BTYPE_INTEGER),
-
+/* TOPLD */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_INTEGER),
+/* XFERSIZE_128 */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* REVISION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* IGNORECOLOR */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* RED */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* GREEN */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* BLUE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* WIDTH */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* HEIGHT */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* USERVISIBLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* DOCK */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* LID */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* PANEL */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* VERTICALPOSITION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* HORIZONTALPOSITION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* SHAPE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* GROUPORIENTATION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* GROUPTOKEN */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* GROUPPOSITION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* BAY */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* EJECTABLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* EJECTREQUIRED */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* CABINETNUMBER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* CARDCAGENUMBER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* REFERENCE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* ROTATION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* ORDER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* RESERVED */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* VERTICALOFFSET */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* HORIZONTALOFFSET */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
+/* PRINTF */ OP_TABLE_ENTRY (AML_STORE_OP, 0, 0, ACPI_BTYPE_DATA_REFERENCE),
+/* FPRINTF */ OP_TABLE_ENTRY (AML_STORE_OP, 0, 0, ACPI_BTYPE_DATA_REFERENCE),
/*! [End] no source code translation !*/
};
diff --git a/sys/contrib/dev/acpica/compiler/aslmapenter.c b/sys/contrib/dev/acpica/compiler/aslmapenter.c
new file mode 100644
index 0000000..a75ff33
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/aslmapenter.c
@@ -0,0 +1,346 @@
+/******************************************************************************
+ *
+ * Module Name: aslmapenter - Build resource descriptor/device maps
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acapps.h>
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
+
+/* This module used for application-level code only */
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("aslmapenter")
+
+/* Local prototypes */
+
+static ACPI_GPIO_INFO *
+MpCreateGpioInfo (
+ UINT16 PinNumber,
+ char *DeviceName);
+
+static ACPI_SERIAL_INFO *
+MpCreateSerialInfo (
+ char *DeviceName,
+ UINT16 Address);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpSaveGpioInfo
+ *
+ * PARAMETERS: Resource - GPIO resource descriptor
+ * PinCount - From GPIO descriptor
+ * PinList - From GPIO descriptor
+ * DeviceName - The "ResourceSource" name
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: External Interface.
+ * Save GPIO resource descriptor information.
+ * Creates new GPIO info blocks, one for each pin defined by the
+ * GPIO descriptor.
+ *
+ ******************************************************************************/
+
+void
+MpSaveGpioInfo (
+ ACPI_PARSE_OBJECT *Op,
+ AML_RESOURCE *Resource,
+ UINT32 PinCount,
+ UINT16 *PinList,
+ char *DeviceName)
+{
+ ACPI_GPIO_INFO *Info;
+ UINT32 i;
+
+
+ /* Mapfile option enabled? */
+
+ if (!Gbl_MapfileFlag)
+ {
+ return;
+ }
+
+ /* Create an info block for each pin defined in the descriptor */
+
+ for (i = 0; i < PinCount; i++)
+ {
+ Info = MpCreateGpioInfo (PinList[i], DeviceName);
+
+ Info->Op = Op;
+ Info->DeviceName = DeviceName;
+ Info->PinCount = PinCount;
+ Info->PinIndex = i;
+ Info->PinNumber = PinList[i];
+ Info->Type = Resource->Gpio.ConnectionType;
+ Info->Direction = (UINT8) (Resource->Gpio.IntFlags & 0x0003); /* _IOR, for IO descriptor */
+ Info->Polarity = (UINT8) ((Resource->Gpio.IntFlags >> 1) & 0x0003); /* _POL, for INT descriptor */
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpSaveSerialInfo
+ *
+ * PARAMETERS: Resource - A Serial resource descriptor
+ * DeviceName - The "ResourceSource" name.
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: External Interface.
+ * Save serial resource descriptor information.
+ * Creates a new serial info block.
+ *
+ ******************************************************************************/
+
+void
+MpSaveSerialInfo (
+ ACPI_PARSE_OBJECT *Op,
+ AML_RESOURCE *Resource,
+ char *DeviceName)
+{
+ ACPI_SERIAL_INFO *Info;
+ UINT16 Address;
+ UINT32 Speed;
+
+
+ /* Mapfile option enabled? */
+
+ if (!Gbl_MapfileFlag)
+ {
+ return;
+ }
+
+ if (Resource->DescriptorType != ACPI_RESOURCE_NAME_SERIAL_BUS)
+ {
+ return;
+ }
+
+ /* Extract address and speed from the resource descriptor */
+
+ switch (Resource->CommonSerialBus.Type)
+ {
+ case AML_RESOURCE_I2C_SERIALBUSTYPE:
+
+ Address = Resource->I2cSerialBus.SlaveAddress;
+ Speed = Resource->I2cSerialBus.ConnectionSpeed;
+ break;
+
+ case AML_RESOURCE_SPI_SERIALBUSTYPE:
+
+ Address = Resource->SpiSerialBus.DeviceSelection;
+ Speed = Resource->SpiSerialBus.ConnectionSpeed;
+ break;
+
+ case AML_RESOURCE_UART_SERIALBUSTYPE:
+
+ Address = 0;
+ Speed = Resource->UartSerialBus.DefaultBaudRate;
+ break;
+
+ default: /* Invalid bus subtype */
+ return;
+ }
+
+ Info = MpCreateSerialInfo (DeviceName, Address);
+
+ Info->Op = Op;
+ Info->DeviceName = DeviceName;
+ Info->Resource = Resource;
+ Info->Address = Address;
+ Info->Speed = Speed;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpCreateGpioInfo
+ *
+ * PARAMETERS: PinNumber - GPIO pin number
+ * DeviceName - The "ResourceSource" name
+ *
+ * RETURN: New GPIO info block.
+ *
+ * DESCRIPTION: Create a new GPIO info block and place it on the global list.
+ * The list is sorted by GPIO device names first, and pin numbers
+ * secondarily.
+ *
+ ******************************************************************************/
+
+static ACPI_GPIO_INFO *
+MpCreateGpioInfo (
+ UINT16 PinNumber,
+ char *DeviceName)
+{
+ ACPI_GPIO_INFO *Info;
+ ACPI_GPIO_INFO *NextGpio;
+ ACPI_GPIO_INFO *PrevGpio;
+
+
+ /*
+ * Allocate a new info block and insert it into the global GPIO list
+ * sorted by both source device name and then the pin number. There is
+ * one block per pin.
+ */
+ Info = ACPI_CAST_PTR (ACPI_GPIO_INFO,
+ UtStringCacheCalloc (sizeof (ACPI_GPIO_INFO)));
+
+ NextGpio = Gbl_GpioList;
+ PrevGpio = NULL;
+ if (!Gbl_GpioList)
+ {
+ Gbl_GpioList = Info;
+ Info->Next = NULL;
+ return (Info);
+ }
+
+ /* Sort on source DeviceName first */
+
+ while (NextGpio &&
+ (ACPI_STRCMP (DeviceName, NextGpio->DeviceName) > 0))
+ {
+ PrevGpio = NextGpio;
+ NextGpio = NextGpio->Next;
+ }
+
+ /* Now sort on the PinNumber */
+
+ while (NextGpio &&
+ (NextGpio->PinNumber < PinNumber) &&
+ !ACPI_STRCMP (DeviceName, NextGpio->DeviceName))
+ {
+ PrevGpio = NextGpio;
+ NextGpio = NextGpio->Next;
+ }
+
+ /* Finish the list insertion */
+
+ if (PrevGpio)
+ {
+ PrevGpio->Next = Info;
+ }
+ else
+ {
+ Gbl_GpioList = Info;
+ }
+
+ Info->Next = NextGpio;
+ return (Info);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpCreateSerialInfo
+ *
+ * PARAMETERS: DeviceName - The "ResourceSource" name.
+ * Address - Physical address for the device
+ *
+ * RETURN: New Serial info block.
+ *
+ * DESCRIPTION: Create a new Serial info block and place it on the global list.
+ * The list is sorted by Serial device names first, and addresses
+ * secondarily.
+ *
+ ******************************************************************************/
+
+static ACPI_SERIAL_INFO *
+MpCreateSerialInfo (
+ char *DeviceName,
+ UINT16 Address)
+{
+ ACPI_SERIAL_INFO *Info;
+ ACPI_SERIAL_INFO *NextSerial;
+ ACPI_SERIAL_INFO *PrevSerial;
+
+
+ /*
+ * Allocate a new info block and insert it into the global Serial list
+ * sorted by both source device name and then the address.
+ */
+ Info = ACPI_CAST_PTR (ACPI_SERIAL_INFO,
+ UtStringCacheCalloc (sizeof (ACPI_SERIAL_INFO)));
+
+ NextSerial = Gbl_SerialList;
+ PrevSerial = NULL;
+ if (!Gbl_SerialList)
+ {
+ Gbl_SerialList = Info;
+ Info->Next = NULL;
+ return (Info);
+ }
+
+ /* Sort on source DeviceName */
+
+ while (NextSerial &&
+ (ACPI_STRCMP (DeviceName, NextSerial->DeviceName) > 0))
+ {
+ PrevSerial = NextSerial;
+ NextSerial = NextSerial->Next;
+ }
+
+ /* Now sort on the Address */
+
+ while (NextSerial &&
+ (NextSerial->Address < Address) &&
+ !ACPI_STRCMP (DeviceName, NextSerial->DeviceName))
+ {
+ PrevSerial = NextSerial;
+ NextSerial = NextSerial->Next;
+ }
+
+ /* Finish the list insertion */
+
+ if (PrevSerial)
+ {
+ PrevSerial->Next = Info;
+ }
+ else
+ {
+ Gbl_SerialList = Info;
+ }
+
+ Info->Next = NextSerial;
+ return (Info);
+}
diff --git a/sys/contrib/dev/acpica/compiler/aslmapoutput.c b/sys/contrib/dev/acpica/compiler/aslmapoutput.c
new file mode 100644
index 0000000..622b1bd
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/aslmapoutput.c
@@ -0,0 +1,642 @@
+/******************************************************************************
+ *
+ * Module Name: aslmapoutput - Output/emit the resource descriptor/device maps
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acapps.h>
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
+#include "aslcompiler.y.h"
+#include <contrib/dev/acpica/include/acinterp.h>
+#include <contrib/dev/acpica/include/acparser.h>
+#include <contrib/dev/acpica/include/acnamesp.h>
+#include <contrib/dev/acpica/include/amlcode.h>
+
+/* This module used for application-level code only */
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("aslmapoutput")
+
+/* Local prototypes */
+
+static void
+MpEmitGpioInfo (
+ void);
+
+static void
+MpEmitSerialInfo (
+ void);
+
+static void
+MpEmitDeviceTree (
+ void);
+
+static ACPI_STATUS
+MpEmitOneDevice (
+ ACPI_HANDLE ObjHandle,
+ UINT32 NestingLevel,
+ void *Context,
+ void **ReturnValue);
+
+static void
+MpXrefDevices (
+ ACPI_GPIO_INFO *Info);
+
+static ACPI_STATUS
+MpNamespaceXrefBegin (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 Level,
+ void *Context);
+
+
+/* Strings used to decode flag bits */
+
+const char *DirectionDecode[] =
+{
+ "Both I/O ",
+ "InputOnly ",
+ "OutputOnly ",
+ "Preserve "
+};
+
+const char *PolarityDecode[] =
+{
+ "ActiveHigh",
+ "ActiveLow ",
+ "ActiveBoth",
+ "Reserved "
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpEmitMappingInfo
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: External interface.
+ * Map file has already been opened. Emit all of the collected
+ * hardware mapping information. Includes: GPIO information,
+ * Serial information, and a dump of the entire ACPI device tree.
+ *
+ ******************************************************************************/
+
+void
+MpEmitMappingInfo (
+ void)
+{
+
+ /* Mapfile option enabled? */
+
+ if (!Gbl_MapfileFlag)
+ {
+ return;
+ }
+
+ if (!Gbl_GpioList)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT,
+ "\nNo GPIO devices found\n");
+ }
+
+ if (!Gbl_SerialList)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT,
+ "\nNo Serial devices found (I2C/SPI/UART)\n");
+ }
+
+ if (!Gbl_GpioList && !Gbl_SerialList)
+ {
+ return;
+ }
+
+ /* Headers */
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "\nResource Descriptor Connectivity Map\n");
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "------------------------------------\n");
+
+ /* Emit GPIO and Serial descriptors, then entire ACPI device tree */
+
+ MpEmitGpioInfo ();
+ MpEmitSerialInfo ();
+ MpEmitDeviceTree ();
+
+ /* Clear the lists - no need to free memory here */
+
+ Gbl_SerialList = NULL;
+ Gbl_GpioList = NULL;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpEmitGpioInfo
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Emit the info about all GPIO devices found during the
+ * compile or disassembly.
+ *
+ ******************************************************************************/
+
+static void
+MpEmitGpioInfo (
+ void)
+{
+ ACPI_GPIO_INFO *Info;
+ char *Type;
+ char *PrevDeviceName = NULL;
+ const char *Direction;
+ const char *Polarity;
+ char *ParentPathname;
+ const char *Description;
+ char *HidString;
+ const AH_DEVICE_ID *HidInfo;
+
+
+ /* Walk the GPIO descriptor list */
+
+ Info = Gbl_GpioList;
+ while (Info)
+ {
+ HidString = MpGetHidViaNamestring (Info->DeviceName);
+
+ /* Print header info for the controller itself */
+
+ if (!PrevDeviceName ||
+ ACPI_STRCMP (PrevDeviceName, Info->DeviceName))
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT,
+ "\n\nGPIO Controller: %-8s %-28s",
+ HidString, Info->DeviceName);
+
+ HidInfo = AcpiAhMatchHardwareId (HidString);
+ if (HidInfo)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s",
+ HidInfo->Description);
+ }
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT,
+ "\n\nPin Type Direction Polarity"
+ " Dest _HID Destination\n");
+ }
+
+ PrevDeviceName = Info->DeviceName;
+
+ /* Setup various strings based upon the type (GpioInt or GpioIo) */
+
+ switch (Info->Type)
+ {
+ case AML_RESOURCE_GPIO_TYPE_INT:
+
+ Type = "GpioInt";
+ Direction = "-Interrupt-";
+ Polarity = PolarityDecode[Info->Polarity];
+ break;
+
+ case AML_RESOURCE_GPIO_TYPE_IO:
+
+ Type = "GpioIo ";
+ Direction = DirectionDecode[Info->Direction];
+ Polarity = " ";
+ break;
+
+ default:
+ continue;
+ }
+
+ /* Emit the GPIO info */
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "%4.4X %s %s %s ",
+ Info->PinNumber, Type, Direction, Polarity);
+
+ ParentPathname = NULL;
+ HidString = MpGetConnectionInfo (Info->Op, Info->PinIndex,
+ &Info->TargetNode, &ParentPathname);
+ if (HidString)
+ {
+ /*
+ * This is a Connection() field
+ * Attempt to find all references to the field.
+ */
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s %-28s",
+ HidString, ParentPathname);
+
+ MpXrefDevices (Info);
+ }
+ else
+ {
+ /*
+ * For Devices, attempt to get the _HID description string.
+ * Failing that (many _HIDs are not recognized), attempt to
+ * get the _DDN description string.
+ */
+ HidString = MpGetParentDeviceHid (Info->Op, &Info->TargetNode,
+ &ParentPathname);
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s %-28s",
+ HidString, ParentPathname);
+
+ /* Get the _HID description or _DDN string */
+
+ HidInfo = AcpiAhMatchHardwareId (HidString);
+ if (HidInfo)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s",
+ HidInfo->Description);
+ }
+ else if ((Description = MpGetDdnValue (ParentPathname)))
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s (_DDN)",
+ Description);
+ }
+ }
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n");
+ ACPI_FREE (ParentPathname);
+ Info = Info->Next;
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpEmitSerialInfo
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Emit the info about all Serial devices found during the
+ * compile or disassembly.
+ *
+ ******************************************************************************/
+
+static void
+MpEmitSerialInfo (
+ void)
+{
+ ACPI_SERIAL_INFO *Info;
+ char *Type;
+ char *ParentPathname;
+ char *PrevDeviceName = NULL;
+ char *HidString;
+ const AH_DEVICE_ID *HidInfo;
+ const char *Description;
+ AML_RESOURCE *Resource;
+
+
+ /* Walk the constructed serial descriptor list */
+
+ Info = Gbl_SerialList;
+ while (Info)
+ {
+ Resource = Info->Resource;
+ switch (Resource->CommonSerialBus.Type)
+ {
+ case AML_RESOURCE_I2C_SERIALBUSTYPE:
+ Type = "I2C ";
+ break;
+
+ case AML_RESOURCE_SPI_SERIALBUSTYPE:
+ Type = "SPI ";
+ break;
+
+ case AML_RESOURCE_UART_SERIALBUSTYPE:
+ Type = "UART";
+ break;
+
+ default:
+ Type = "UNKN";
+ break;
+ }
+
+ HidString = MpGetHidViaNamestring (Info->DeviceName);
+
+ /* Print header info for the controller itself */
+
+ if (!PrevDeviceName ||
+ ACPI_STRCMP (PrevDeviceName, Info->DeviceName))
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\n%s Controller: ",
+ Type);
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "%-8s %-28s",
+ HidString, Info->DeviceName);
+
+ HidInfo = AcpiAhMatchHardwareId (HidString);
+ if (HidInfo)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s",
+ HidInfo->Description);
+ }
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\n");
+ FlPrintFile (ASL_FILE_MAP_OUTPUT,
+ "Type Address Speed Dest _HID Destination\n");
+ }
+
+ PrevDeviceName = Info->DeviceName;
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "%s %4.4X %8.8X ",
+ Type, Info->Address, Info->Speed);
+
+ ParentPathname = NULL;
+ HidString = MpGetConnectionInfo (Info->Op, 0, &Info->TargetNode,
+ &ParentPathname);
+ if (HidString)
+ {
+ /*
+ * This is a Connection() field
+ * Attempt to find all references to the field.
+ */
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s %-28s",
+ HidString, ParentPathname);
+ }
+ else
+ {
+ /* Normal resource template */
+
+ HidString = MpGetParentDeviceHid (Info->Op, &Info->TargetNode,
+ &ParentPathname);
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s %-28s",
+ HidString, ParentPathname);
+
+ /* Get the _HID description or _DDN string */
+
+ HidInfo = AcpiAhMatchHardwareId (HidString);
+ if (HidInfo)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s",
+ HidInfo->Description);
+ }
+ else if ((Description = MpGetDdnValue (ParentPathname)))
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s (_DDN)",
+ Description);
+ }
+ }
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n");
+ ACPI_FREE (ParentPathname);
+ Info = Info->Next;
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpEmitDeviceTree
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Emit information about all devices within the ACPI namespace.
+ *
+ ******************************************************************************/
+
+static void
+MpEmitDeviceTree (
+ void)
+{
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\nACPI Device Tree\n");
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "----------------\n\n");
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "Device Pathname "
+ "_HID Description\n\n");
+
+ /* Walk the namespace from the root */
+
+ (void) AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
+ ACPI_UINT32_MAX, FALSE, MpEmitOneDevice, NULL, NULL, NULL);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpEmitOneDevice
+ *
+ * PARAMETERS: ACPI_NAMESPACE_WALK callback
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Emit information about one ACPI device in the namespace. Used
+ * during dump of all device objects within the namespace.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+MpEmitOneDevice (
+ ACPI_HANDLE ObjHandle,
+ UINT32 NestingLevel,
+ void *Context,
+ void **ReturnValue)
+{
+ char *DevicePathname;
+ char *DdnString;
+ char *HidString;
+ const AH_DEVICE_ID *HidInfo;
+
+
+ /* Device pathname */
+
+ DevicePathname = AcpiNsGetExternalPathname (
+ ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle));
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "%-32s", DevicePathname);
+
+ /* _HID or _DDN */
+
+ HidString = MpGetHidValue (
+ ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle));
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s", HidString);
+
+ HidInfo = AcpiAhMatchHardwareId (HidString);
+ if (HidInfo)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s",
+ HidInfo->Description);
+ }
+ else if ((DdnString = MpGetDdnValue (DevicePathname)))
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s (_DDN)", DdnString);
+ }
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n");
+ ACPI_FREE (DevicePathname);
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpXrefDevices
+ *
+ * PARAMETERS: Info - A GPIO Info block
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Cross-reference the parse tree and find all references to the
+ * specified GPIO device.
+ *
+ ******************************************************************************/
+
+static void
+MpXrefDevices (
+ ACPI_GPIO_INFO *Info)
+{
+
+ /* Walk the entire parse tree */
+
+ TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
+ MpNamespaceXrefBegin, NULL, Info);
+
+ if (!Info->References)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // **** No references in table");
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpNamespaceXrefBegin
+ *
+ * PARAMETERS: WALK_PARSE_TREE callback
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Walk parse tree callback used to cross-reference GPIO pins.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+MpNamespaceXrefBegin (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 Level,
+ void *Context)
+{
+ ACPI_GPIO_INFO *Info = ACPI_CAST_PTR (ACPI_GPIO_INFO, Context);
+ const ACPI_OPCODE_INFO *OpInfo;
+ char *DevicePathname;
+ ACPI_PARSE_OBJECT *ParentOp;
+ char *HidString;
+
+
+ ACPI_FUNCTION_TRACE_PTR (MpNamespaceXrefBegin, Op);
+
+ /*
+ * If this node is the actual declaration of a name
+ * [such as the XXXX name in "Method (XXXX)"],
+ * we are not interested in it here. We only care about names that
+ * are references to other objects within the namespace and the
+ * parent objects of name declarations
+ */
+ if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION)
+ {
+ return (AE_OK);
+ }
+
+ /* We are only interested in opcodes that have an associated name */
+
+ OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
+
+ if ((OpInfo->Flags & AML_NAMED) ||
+ (OpInfo->Flags & AML_CREATE))
+ {
+ return (AE_OK);
+ }
+
+ if ((Op->Asl.ParseOpcode != PARSEOP_NAMESTRING) &&
+ (Op->Asl.ParseOpcode != PARSEOP_NAMESEG) &&
+ (Op->Asl.ParseOpcode != PARSEOP_METHODCALL))
+ {
+ return (AE_OK);
+ }
+
+ if (!Op->Asl.Node)
+ {
+ return (AE_OK);
+ }
+
+ ParentOp = Op->Asl.Parent;
+ if (ParentOp->Asl.ParseOpcode == PARSEOP_FIELD)
+ {
+ return (AE_OK);
+ }
+
+ if (Op->Asl.Node == Info->TargetNode)
+ {
+ while (ParentOp && (!ParentOp->Asl.Node))
+ {
+ ParentOp = ParentOp->Asl.Parent;
+ }
+
+ if (ParentOp)
+ {
+ DevicePathname = AcpiNsGetExternalPathname (
+ ParentOp->Asl.Node);
+
+ if (!Info->References)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " // References:");
+ }
+
+ HidString = MpGetHidViaNamestring (DevicePathname);
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " %s [%s]",
+ DevicePathname, HidString);
+
+ Info->References++;
+
+ ACPI_FREE (DevicePathname);
+ }
+ }
+
+ return (AE_OK);
+}
diff --git a/sys/contrib/dev/acpica/compiler/aslmaputils.c b/sys/contrib/dev/acpica/compiler/aslmaputils.c
new file mode 100644
index 0000000..7b2e611
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/aslmaputils.c
@@ -0,0 +1,402 @@
+/******************************************************************************
+ *
+ * Module Name: aslmaputils - Utilities for the resource descriptor/device maps
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acapps.h>
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
+#include "aslcompiler.y.h"
+#include <contrib/dev/acpica/include/acinterp.h>
+#include <contrib/dev/acpica/include/acnamesp.h>
+#include <contrib/dev/acpica/include/amlcode.h>
+
+/* This module used for application-level code only */
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("aslmaputils")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpGetHidFromParseTree
+ *
+ * PARAMETERS: HidNode - Node for a _HID object
+ *
+ * RETURN: An _HID string value. Automatically converts _HID integers
+ * to strings. Never NULL.
+ *
+ * DESCRIPTION: Extract a _HID value from the parse tree, not the namespace.
+ * Used when a fully initialized namespace is not available.
+ *
+ ******************************************************************************/
+
+char *
+MpGetHidFromParseTree (
+ ACPI_NAMESPACE_NODE *HidNode)
+{
+ ACPI_PARSE_OBJECT *Op;
+ ACPI_PARSE_OBJECT *Arg;
+ char *HidString;
+
+
+ Op = HidNode->Op;
+
+ switch (Op->Asl.ParseOpcode)
+ {
+ case PARSEOP_NAME:
+
+ Arg = Op->Asl.Child; /* Get the NameSeg/NameString node */
+ Arg = Arg->Asl.Next; /* First peer is the object to be associated with the name */
+
+ switch (Arg->Asl.ParseOpcode)
+ {
+ case PARSEOP_STRING_LITERAL:
+
+ return (Arg->Asl.Value.String);
+
+ case PARSEOP_INTEGER:
+
+ /* Convert EISAID to a string */
+
+ HidString = UtStringCacheCalloc (ACPI_EISAID_STRING_SIZE);
+ AcpiExEisaIdToString (HidString, Arg->Asl.Value.Integer);
+ return (HidString);
+
+ default:
+
+ return ("UNKNOWN");
+ }
+
+ default:
+ return ("-No HID-");
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpGetHidValue
+ *
+ * PARAMETERS: DeviceNode - Node for parent device
+ *
+ * RETURN: An _HID string value. Automatically converts _HID integers
+ * to strings. Never NULL.
+ *
+ * DESCRIPTION: Extract _HID value from within a device scope. Does not
+ * actually execute a method, just gets the string or integer
+ * value for the _HID.
+ *
+ ******************************************************************************/
+
+char *
+MpGetHidValue (
+ ACPI_NAMESPACE_NODE *DeviceNode)
+{
+ ACPI_NAMESPACE_NODE *HidNode;
+ char *HidString;
+ ACPI_STATUS Status;
+
+
+ Status = AcpiNsGetNode (DeviceNode, METHOD_NAME__HID,
+ ACPI_NS_NO_UPSEARCH, &HidNode);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ErrorExit;
+ }
+
+ /* If only partial namespace, get the _HID from the parse tree */
+
+ if (!HidNode->Object)
+ {
+ return (MpGetHidFromParseTree (HidNode));
+ }
+
+ /* Handle the different _HID flavors */
+
+ switch (HidNode->Type)
+ {
+ case ACPI_TYPE_STRING:
+
+ return (HidNode->Object->String.Pointer);
+
+ case ACPI_TYPE_INTEGER:
+
+ /* Convert EISAID to a string */
+
+ HidString = UtStringCacheCalloc (ACPI_EISAID_STRING_SIZE);
+ AcpiExEisaIdToString (HidString, HidNode->Object->Integer.Value);
+ return (HidString);
+
+ case ACPI_TYPE_METHOD:
+
+ return ("-Method-");
+
+ default:
+
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, "BAD HID TYPE: %u", HidNode->Type);
+ break;
+ }
+
+
+ErrorExit:
+ return ("-No HID-");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpGetHidViaNamestring
+ *
+ * PARAMETERS: DeviceName - Namepath for parent device
+ *
+ * RETURN: _HID string. Never NULL.
+ *
+ * DESCRIPTION: Get a _HID value via a device pathname (instead of just simply
+ * a device node.)
+ *
+ ******************************************************************************/
+
+char *
+MpGetHidViaNamestring (
+ char *DeviceName)
+{
+ ACPI_NAMESPACE_NODE *DeviceNode;
+ ACPI_STATUS Status;
+
+
+ Status = AcpiNsGetNode (NULL, DeviceName, ACPI_NS_NO_UPSEARCH,
+ &DeviceNode);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ErrorExit;
+ }
+
+ return (MpGetHidValue (DeviceNode));
+
+
+ErrorExit:
+ return ("-No HID-");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpGetParentDeviceHid
+ *
+ * PARAMETERS: Op - Parse Op to be examined
+ * TargetNode - Where the field node is returned
+ * ParentDeviceName - Where the node path is returned
+ *
+ * RETURN: _HID string. Never NULL.
+ *
+ * DESCRIPTION: Find the parent Device or Scope Op, get the full pathname to
+ * the parent, and get the _HID associated with the parent.
+ *
+ ******************************************************************************/
+
+char *
+MpGetParentDeviceHid (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_NAMESPACE_NODE **TargetNode,
+ char **ParentDeviceName)
+{
+ ACPI_NAMESPACE_NODE *DeviceNode;
+
+
+ /* Find parent Device() or Scope() Op */
+
+ while (Op &&
+ (Op->Asl.AmlOpcode != AML_DEVICE_OP) &&
+ (Op->Asl.AmlOpcode != AML_SCOPE_OP))
+ {
+ Op = Op->Asl.Parent;
+ }
+
+ if (!Op)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " No_Parent_Device ");
+ goto ErrorExit;
+ }
+
+ /* Get the full pathname to the device and the _HID */
+
+ DeviceNode = Op->Asl.Node;
+ if (!DeviceNode)
+ {
+ FlPrintFile (ASL_FILE_MAP_OUTPUT, " No_Device_Node ");
+ goto ErrorExit;
+ }
+
+ *ParentDeviceName = AcpiNsGetExternalPathname (DeviceNode);
+ return (MpGetHidValue (DeviceNode));
+
+
+ErrorExit:
+ return ("-No HID-");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpGetDdnValue
+ *
+ * PARAMETERS: DeviceName - Namepath for parent device
+ *
+ * RETURN: _DDN description string. NULL on failure.
+ *
+ * DESCRIPTION: Execute the _DDN method for the device.
+ *
+ ******************************************************************************/
+
+char *
+MpGetDdnValue (
+ char *DeviceName)
+{
+ ACPI_NAMESPACE_NODE *DeviceNode;
+ ACPI_NAMESPACE_NODE *DdnNode;
+ ACPI_STATUS Status;
+
+
+ Status = AcpiNsGetNode (NULL, DeviceName, ACPI_NS_NO_UPSEARCH,
+ &DeviceNode);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ErrorExit;
+ }
+
+ Status = AcpiNsGetNode (DeviceNode, METHOD_NAME__DDN, ACPI_NS_NO_UPSEARCH,
+ &DdnNode);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ErrorExit;
+ }
+
+ if ((DdnNode->Type != ACPI_TYPE_STRING) ||
+ !DdnNode->Object)
+ {
+ goto ErrorExit;
+ }
+
+ return (DdnNode->Object->String.Pointer);
+
+
+ErrorExit:
+ return (NULL);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: MpGetConnectionInfo
+ *
+ * PARAMETERS: Op - Parse Op to be examined
+ * PinIndex - Index into GPIO PinList
+ * TargetNode - Where the field node is returned
+ * TargetName - Where the node path is returned
+ *
+ * RETURN: A substitute _HID string, indicating that the name is actually
+ * a field. NULL if the Op does not refer to a Connection.
+ *
+ * DESCRIPTION: Get the Field Unit that corresponds to the PinIndex after
+ * a Connection() invocation.
+ *
+ ******************************************************************************/
+
+char *
+MpGetConnectionInfo (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 PinIndex,
+ ACPI_NAMESPACE_NODE **TargetNode,
+ char **TargetName)
+{
+ ACPI_PARSE_OBJECT *NextOp;
+ UINT32 i;
+
+
+ /*
+ * Handle Connection() here. Find the next named FieldUnit.
+ * Note: we look at the ParseOpcode for the compiler, look
+ * at the AmlOpcode for the disassembler.
+ */
+ if ((Op->Asl.AmlOpcode == AML_INT_CONNECTION_OP) ||
+ (Op->Asl.ParseOpcode == PARSEOP_CONNECTION))
+ {
+ /* Find the correct field unit definition */
+
+ NextOp = Op;
+ for (i = 0; i <= PinIndex;)
+ {
+ NextOp = NextOp->Asl.Next;
+ while (NextOp &&
+ (NextOp->Asl.ParseOpcode != PARSEOP_NAMESEG) &&
+ (NextOp->Asl.AmlOpcode != AML_INT_NAMEDFIELD_OP))
+ {
+ NextOp = NextOp->Asl.Next;
+ }
+
+ if (!NextOp)
+ {
+ return ("UNKNOWN");
+ }
+
+ /* Add length of this field to the current pin index */
+
+ if (NextOp->Asl.ParseOpcode == PARSEOP_NAMESEG)
+ {
+ i += (UINT32) NextOp->Asl.Child->Asl.Value.Integer;
+ }
+ else /* AML_INT_NAMEDFIELD_OP */
+ {
+ i += (UINT32) NextOp->Asl.Value.Integer;
+ }
+ }
+
+ /* Return the node and pathname for the field unit */
+
+ *TargetNode = NextOp->Asl.Node;
+ *TargetName = AcpiNsGetExternalPathname (*TargetNode);
+ return ("-Field-");
+ }
+
+ return (NULL);
+}
diff --git a/sys/contrib/dev/acpica/compiler/aslmessages.c b/sys/contrib/dev/acpica/compiler/aslmessages.c
new file mode 100644
index 0000000..12a4208
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/aslmessages.c
@@ -0,0 +1,409 @@
+/******************************************************************************
+ *
+ * Module Name: aslmessages.c - Compiler error/warning message strings
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("aslmessages")
+
+
+/*
+ * Strings for message reporting levels, must match error
+ * type string tables in aslmessages.c
+ */
+const char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = {
+ "Optimize",
+ "Remark ",
+ "Warning ",
+ "Warning ",
+ "Warning ",
+ "Error "
+};
+
+/* All lowercase versions for IDEs */
+
+const char *AslErrorLevelIde [ASL_NUM_REPORT_LEVELS] = {
+ "optimize",
+ "remark ",
+ "warning ",
+ "warning ",
+ "warning ",
+ "error "
+};
+
+
+/*
+ * Actual message strings for each compiler message ID. There are currently
+ * three distinct blocks of error messages (so that they can be expanded
+ * individually):
+ * Main ASL compiler
+ * Data Table compiler
+ * Preprocessor
+ *
+ * NOTE1: These tables must match the enum list of message IDs in the file
+ * aslmessages.h exactly.
+ *
+ * NOTE2: With the introduction of the -vw option to disable specific messages,
+ * new messages should only be added to the end of this list, so that values
+ * for existing messages are not disturbed.
+ */
+
+/* ASL compiler */
+
+const char *AslCompilerMsgs [] =
+{
+/* The zeroth message is reserved */ "",
+/* ASL_MSG_ALIGNMENT */ "Must be a multiple of alignment/granularity value",
+/* ASL_MSG_ALPHANUMERIC_STRING */ "String must be entirely alphanumeric",
+/* ASL_MSG_AML_NOT_IMPLEMENTED */ "Opcode is not implemented in compiler AML code generator",
+/* ASL_MSG_ARG_COUNT_HI */ "Too many arguments",
+/* ASL_MSG_ARG_COUNT_LO */ "Too few arguments",
+/* ASL_MSG_ARG_INIT */ "Method argument is not initialized",
+/* ASL_MSG_BACKWARDS_OFFSET */ "Invalid backwards offset",
+/* ASL_MSG_BUFFER_LENGTH */ "Effective AML buffer length is zero",
+/* ASL_MSG_CLOSE */ "Could not close file",
+/* ASL_MSG_COMPILER_INTERNAL */ "Internal compiler error",
+/* ASL_MSG_COMPILER_RESERVED */ "Use of compiler reserved name",
+/* ASL_MSG_CONNECTION_MISSING */ "A Connection operator is required for this field SpaceId",
+/* ASL_MSG_CONNECTION_INVALID */ "Invalid OpRegion SpaceId for use of Connection operator",
+/* ASL_MSG_CONSTANT_EVALUATION */ "Could not evaluate constant expression",
+/* ASL_MSG_CONSTANT_FOLDED */ "Constant expression evaluated and reduced",
+/* ASL_MSG_CORE_EXCEPTION */ "From ACPICA Subsystem",
+/* ASL_MSG_DEBUG_FILE_OPEN */ "Could not open debug file",
+/* ASL_MSG_DEBUG_FILENAME */ "Could not create debug filename",
+/* ASL_MSG_DEPENDENT_NESTING */ "Dependent function macros cannot be nested",
+/* ASL_MSG_DMA_CHANNEL */ "Invalid DMA channel (must be 0-7)",
+/* ASL_MSG_DMA_LIST */ "Too many DMA channels (8 max)",
+/* ASL_MSG_DUPLICATE_CASE */ "Case value already specified",
+/* ASL_MSG_DUPLICATE_ITEM */ "Duplicate value in list",
+/* ASL_MSG_EARLY_EOF */ "Premature end-of-file reached",
+/* ASL_MSG_ENCODING_LENGTH */ "Package length too long to encode",
+/* ASL_MSG_EX_INTERRUPT_LIST */ "Too many interrupts (255 max)",
+/* ASL_MSG_EX_INTERRUPT_LIST_MIN */ "Too few interrupts (1 minimum required)",
+/* ASL_MSG_EX_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 32 bits)",
+/* ASL_MSG_FIELD_ACCESS_WIDTH */ "Access width is greater than region size",
+/* ASL_MSG_FIELD_UNIT_ACCESS_WIDTH */ "Access width of Field Unit extends beyond region limit",
+/* ASL_MSG_FIELD_UNIT_OFFSET */ "Field Unit extends beyond region limit",
+/* ASL_MSG_GPE_NAME_CONFLICT */ "Name conflicts with a previous GPE method",
+/* ASL_MSG_HID_LENGTH */ "_HID string must be exactly 7 or 8 characters",
+/* ASL_MSG_HID_PREFIX */ "_HID prefix must be all uppercase or decimal digits",
+/* ASL_MSG_HID_SUFFIX */ "_HID suffix must be all hex digits",
+/* ASL_MSG_INCLUDE_FILE_OPEN */ "Could not open include file",
+/* ASL_MSG_INPUT_FILE_OPEN */ "Could not open input file",
+/* ASL_MSG_INTEGER_LENGTH */ "64-bit integer in 32-bit table, truncating (DSDT version < 2)",
+/* ASL_MSG_INTEGER_OPTIMIZATION */ "Integer optimized to single-byte AML opcode",
+/* ASL_MSG_INTERRUPT_LIST */ "Too many interrupts (16 max)",
+/* ASL_MSG_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 0-15)",
+/* ASL_MSG_INVALID_ACCESS_SIZE */ "Invalid AccessSize (Maximum is 4 - QWord access)",
+/* ASL_MSG_INVALID_ADDR_FLAGS */ "Invalid combination of Length and Min/Max fixed flags",
+/* ASL_MSG_INVALID_CONSTANT_OP */ "Invalid operator in constant expression (not type 3/4/5)",
+/* ASL_MSG_INVALID_EISAID */ "EISAID string must be of the form \"UUUXXXX\" (3 uppercase, 4 hex digits)",
+/* ASL_MSG_INVALID_ESCAPE */ "Invalid or unknown escape sequence",
+/* ASL_MSG_INVALID_GRAN_FIXED */ "Granularity must be zero for fixed Min/Max",
+/* ASL_MSG_INVALID_GRANULARITY */ "Granularity must be zero or a power of two minus one",
+/* ASL_MSG_INVALID_LENGTH */ "Length is larger than Min/Max window",
+/* ASL_MSG_INVALID_LENGTH_FIXED */ "Length is not equal to fixed Min/Max window",
+/* ASL_MSG_INVALID_MIN_MAX */ "Address Min is greater than Address Max",
+/* ASL_MSG_INVALID_OPERAND */ "Invalid operand",
+/* ASL_MSG_INVALID_PERFORMANCE */ "Invalid performance/robustness value",
+/* ASL_MSG_INVALID_PRIORITY */ "Invalid priority value",
+/* ASL_MSG_INVALID_STRING */ "Invalid Hex/Octal Escape - Non-ASCII or NULL",
+/* ASL_MSG_INVALID_TARGET */ "Target operand not allowed in constant expression",
+/* 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_ISA_ADDRESS */ "Maximum 10-bit ISA address (0x3FF)",
+/* ASL_MSG_LEADING_ASTERISK */ "Invalid leading asterisk",
+/* 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",
+/* ASL_MSG_LOCAL_OUTSIDE_METHOD */ "Local or Arg used outside a control method",
+/* ASL_MSG_LONG_LINE */ "Splitting long input line",
+/* ASL_MSG_MEMORY_ALLOCATION */ "Memory allocation failure",
+/* ASL_MSG_MISSING_ENDDEPENDENT */ "Missing EndDependentFn() macro in dependent resource list",
+/* ASL_MSG_MISSING_STARTDEPENDENT */ "Missing StartDependentFn() macro in dependent resource list",
+/* ASL_MSG_MULTIPLE_DEFAULT */ "More than one Default statement within Switch construct",
+/* ASL_MSG_MULTIPLE_TYPES */ "Multiple types",
+/* ASL_MSG_NAME_EXISTS */ "Name already exists in scope",
+/* ASL_MSG_NAME_OPTIMIZATION */ "NamePath optimized",
+/* ASL_MSG_NAMED_OBJECT_IN_WHILE */ "Creating a named object in a While loop",
+/* ASL_MSG_NESTED_COMMENT */ "Nested comment found",
+/* ASL_MSG_NO_CASES */ "No Case statements under Switch",
+/* ASL_MSG_NO_REGION */ "_REG has no corresponding Operation Region",
+/* ASL_MSG_NO_RETVAL */ "Called method returns no value",
+/* ASL_MSG_NO_WHILE */ "No enclosing While statement",
+/* ASL_MSG_NON_ASCII */ "Invalid characters found in file",
+/* ASL_MSG_NON_ZERO */ "Operand evaluates to zero",
+/* ASL_MSG_NOT_EXIST */ "Object does not exist",
+/* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from scope",
+/* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke",
+/* ASL_MSG_NOT_PARAMETER */ "Not a parameter, used as local only",
+/* ASL_MSG_NOT_REACHABLE */ "Object is not accessible from this scope",
+/* ASL_MSG_NOT_REFERENCED */ "Object is not referenced",
+/* ASL_MSG_NULL_DESCRIPTOR */ "Min/Max/Length/Gran are all zero, but no resource tag",
+/* ASL_MSG_NULL_STRING */ "Invalid zero-length (null) string",
+/* ASL_MSG_OPEN */ "Could not open file",
+/* ASL_MSG_OUTPUT_FILE_OPEN */ "Could not open output AML file",
+/* ASL_MSG_OUTPUT_FILENAME */ "Could not create output filename",
+/* ASL_MSG_PACKAGE_LENGTH */ "Effective AML package length is zero",
+/* ASL_MSG_PREPROCESSOR_FILENAME */ "Could not create preprocessor filename",
+/* ASL_MSG_READ */ "Could not read file",
+/* ASL_MSG_RECURSION */ "Recursive method call",
+/* ASL_MSG_REGION_BUFFER_ACCESS */ "Host Operation Region requires BufferAcc access",
+/* ASL_MSG_REGION_BYTE_ACCESS */ "Host Operation Region requires ByteAcc access",
+/* ASL_MSG_RESERVED_ARG_COUNT_HI */ "Reserved method has too many arguments",
+/* ASL_MSG_RESERVED_ARG_COUNT_LO */ "Reserved method has too few arguments",
+/* ASL_MSG_RESERVED_METHOD */ "Reserved name must be a control method",
+/* ASL_MSG_RESERVED_NO_RETURN_VAL */ "Reserved method should not return a value",
+/* ASL_MSG_RESERVED_OPERAND_TYPE */ "Invalid object type for reserved name",
+/* ASL_MSG_RESERVED_PACKAGE_LENGTH */ "Invalid package length for reserved name",
+/* ASL_MSG_RESERVED_RETURN_VALUE */ "Reserved method must return a value",
+/* ASL_MSG_RESERVED_USE */ "Invalid use of reserved name",
+/* ASL_MSG_RESERVED_WORD */ "Use of reserved name",
+/* ASL_MSG_RESOURCE_FIELD */ "Resource field name cannot be used as a target",
+/* ASL_MSG_RESOURCE_INDEX */ "Missing ResourceSourceIndex (required)",
+/* ASL_MSG_RESOURCE_LIST */ "Too many resource items (internal error)",
+/* ASL_MSG_RESOURCE_SOURCE */ "Missing ResourceSource string (required)",
+/* ASL_MSG_RESULT_NOT_USED */ "Result is not used, operator has no effect",
+/* ASL_MSG_RETURN_TYPES */ "Not all control paths return a value",
+/* ASL_MSG_SCOPE_FWD_REF */ "Forward references from Scope operator not allowed",
+/* ASL_MSG_SCOPE_TYPE */ "Existing object has invalid type for Scope operator",
+/* ASL_MSG_SEEK */ "Could not seek file",
+/* ASL_MSG_SERIALIZED */ "Control Method marked Serialized",
+/* ASL_MSG_SERIALIZED_REQUIRED */ "Control Method should be made Serialized",
+/* ASL_MSG_SINGLE_NAME_OPTIMIZATION */ "NamePath optimized to NameSeg (uses run-time search path)",
+/* ASL_MSG_SOME_NO_RETVAL */ "Called method may not always return a value",
+/* ASL_MSG_STRING_LENGTH */ "String literal too long",
+/* ASL_MSG_SWITCH_TYPE */ "Switch expression is not a static Integer/Buffer/String data type, defaulting to Integer",
+/* ASL_MSG_SYNC_LEVEL */ "SyncLevel must be in the range 0-15",
+/* ASL_MSG_SYNTAX */ "",
+/* ASL_MSG_TABLE_SIGNATURE */ "Invalid Table Signature",
+/* ASL_MSG_TAG_LARGER */ "ResourceTag larger than Field",
+/* ASL_MSG_TAG_SMALLER */ "ResourceTag smaller than Field",
+/* ASL_MSG_TIMEOUT */ "Result is not used, possible operator timeout will be missed",
+/* ASL_MSG_TOO_MANY_TEMPS */ "Method requires too many temporary variables (_T_x)",
+/* ASL_MSG_TRUNCATION */ "64-bit return value will be truncated to 32 bits (DSDT version < 2)",
+/* ASL_MSG_UNKNOWN_RESERVED_NAME */ "Unknown reserved name",
+/* ASL_MSG_UNREACHABLE_CODE */ "Statement is unreachable",
+/* ASL_MSG_UNSUPPORTED */ "Unsupported feature",
+/* ASL_MSG_UPPER_CASE */ "Non-hex letters must be upper case",
+/* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)",
+/* ASL_MSG_WRITE */ "Could not write file",
+/* ASL_MSG_RANGE */ "Constant out of range",
+/* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer",
+/* ASL_MSG_MISSING_DEPENDENCY */ "Missing dependency",
+/* ASL_MSG_ILLEGAL_FORWARD_REF */ "Illegal forward reference within a method",
+/* ASL_MSG_ILLEGAL_METHOD_REF */ "Illegal reference across two methods"
+};
+
+/* Table compiler */
+
+const char *AslTableCompilerMsgs [] =
+{
+/* ASL_MSG_BUFFER_ELEMENT */ "Invalid element in buffer initializer list",
+/* ASL_MSG_DIVIDE_BY_ZERO */ "Expression contains divide-by-zero",
+/* ASL_MSG_FLAG_VALUE */ "Flag value is too large",
+/* ASL_MSG_INTEGER_SIZE */ "Integer too large for target",
+/* ASL_MSG_INVALID_EXPRESSION */ "Invalid expression",
+/* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name",
+/* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant",
+/* ASL_MSG_OEM_TABLE */ "OEM table - unknown contents",
+/* ASL_MSG_RESERVED_VALUE */ "Reserved field",
+/* ASL_MSG_UNKNOWN_LABEL */ "Label is undefined",
+/* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type",
+/* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature",
+/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero"
+};
+
+/* Preprocessor */
+
+const char *AslPreprocessorMsgs [] =
+{
+/* ASL_MSG_DIRECTIVE_SYNTAX */ "Invalid directive syntax",
+/* ASL_MSG_ENDIF_MISMATCH */ "Mismatched #endif",
+/* ASL_MSG_ERROR_DIRECTIVE */ "#error",
+/* ASL_MSG_EXISTING_NAME */ "Name is already defined",
+/* ASL_MSG_INVALID_INVOCATION */ "Invalid macro invocation",
+/* ASL_MSG_MACRO_SYNTAX */ "Invalid macro syntax",
+/* ASL_MSG_TOO_MANY_ARGUMENTS */ "Too many macro arguments",
+/* ASL_MSG_UNKNOWN_DIRECTIVE */ "Unknown directive",
+/* ASL_MSG_UNKNOWN_PRAGMA */ "Unknown pragma",
+/* ASL_MSG_WARNING_DIRECTIVE */ "#warning"
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AeDecodeMessageId
+ *
+ * PARAMETERS: MessageId - ASL message ID (exception code) to be
+ * formatted. Possibly fully encoded.
+ *
+ * RETURN: A string containing the exception message text.
+ *
+ * DESCRIPTION: This function validates and translates an ASL message ID into
+ * an ASCII string.
+ *
+ ******************************************************************************/
+
+const char *
+AeDecodeMessageId (
+ UINT16 MessageId)
+{
+ UINT32 Index;
+ const char **MessageTable;
+
+
+ /* Main ASL Compiler messages */
+
+ if (MessageId <= ASL_MSG_MAIN_COMPILER_END)
+ {
+ MessageTable = AslCompilerMsgs;
+ Index = MessageId;
+
+ if (Index >= ACPI_ARRAY_LENGTH (AslCompilerMsgs))
+ {
+ return ("[Unknown ASL Compiler exception ID]");
+ }
+ }
+
+ /* Data Table Compiler messages */
+
+ else if (MessageId <= ASL_MSG_TABLE_COMPILER_END)
+ {
+ MessageTable = AslTableCompilerMsgs;
+ Index = MessageId - ASL_MSG_TABLE_COMPILER;
+
+ if (Index >= ACPI_ARRAY_LENGTH (AslTableCompilerMsgs))
+ {
+ return ("[Unknown Table Compiler exception ID]");
+ }
+ }
+
+ /* Preprocessor messages */
+
+ else if (MessageId <= ASL_MSG_PREPROCESSOR_END)
+ {
+ MessageTable = AslPreprocessorMsgs;
+ Index = MessageId - ASL_MSG_PREPROCESSOR;
+
+ if (Index >= ACPI_ARRAY_LENGTH (AslPreprocessorMsgs))
+ {
+ return ("[Unknown Preprocesor exception ID]");
+ }
+ }
+
+ /* Everything else is unknown */
+
+ else
+ {
+ return ("[Unknown exception/component ID]");
+ }
+
+ return (MessageTable[Index]);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AeDecodeExceptionLevel
+ *
+ * PARAMETERS: Level - The ASL error level to be decoded
+ *
+ * RETURN: A string containing the error level text
+ *
+ * DESCRIPTION: This function validates and translates an ASL error level into
+ * an ASCII string.
+ *
+ ******************************************************************************/
+
+const char *
+AeDecodeExceptionLevel (
+ UINT8 Level)
+{
+ /* Range check on Level */
+
+ if (Level >= ACPI_ARRAY_LENGTH (AslErrorLevel))
+ {
+ return ("Unknown exception level");
+ }
+
+ /* Differentiate the string type to be used (IDE is all lower case) */
+
+ if (Gbl_VerboseErrors)
+ {
+ return (AslErrorLevel[Level]);
+ }
+
+ return (AslErrorLevelIde[Level]);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AeBuildFullExceptionCode
+ *
+ * PARAMETERS: Level - ASL error level
+ * MessageId - ASL exception code to be formatted
+ *
+ * RETURN: Fully encoded exception code
+ *
+ * DESCRIPTION: Build the full exception code from the error level and the
+ * actual message ID.
+ *
+ ******************************************************************************/
+
+UINT16
+AeBuildFullExceptionCode (
+ UINT8 Level,
+ UINT16 MessageId)
+{
+
+ /*
+ * Error level is in the thousands slot (error/warning/remark, etc.)
+ * Error codes are 0 - 999
+ */
+ return (((Level + 1) * 1000) + MessageId);
+}
diff --git a/sys/contrib/dev/acpica/compiler/aslmessages.h b/sys/contrib/dev/acpica/compiler/aslmessages.h
index 9fb7229..7a04a63 100644
--- a/sys/contrib/dev/acpica/compiler/aslmessages.h
+++ b/sys/contrib/dev/acpica/compiler/aslmessages.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,11 +41,12 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#ifndef __ASLMESSAGES_H
#define __ASLMESSAGES_H
+/* These values must match error type string tables in aslmessages.c */
+
typedef enum
{
ASL_OPTIMIZATION = 0,
@@ -58,43 +59,41 @@ typedef enum
} ASL_MESSAGE_TYPES;
-#ifdef ASL_EXCEPTIONS
-/* Strings for message reporting levels, must match values above */
+#define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings for types above */
-const char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = {
- "Optimize",
- "Remark ",
- "Warning ",
- "Warning ",
- "Warning ",
- "Error "
-};
+/*
+ * Exception code blocks, 0 - 999
+ * Available for new exception blocks: 600 - 999
+ */
+#define ASL_MSG_MAIN_COMPILER 0 /* 0 - 299 */
+#define ASL_MSG_MAIN_COMPILER_END 299
-/* All lowercase versions for IDEs */
+#define ASL_MSG_TABLE_COMPILER 300 /* 300 - 499 */
+#define ASL_MSG_TABLE_COMPILER_END 499
-const char *AslErrorLevelIde [ASL_NUM_REPORT_LEVELS] = {
- "optimize",
- "remark ",
- "warning ",
- "warning ",
- "warning ",
- "error "
-};
+#define ASL_MSG_PREPROCESSOR 500 /* 500 - 599 */
+#define ASL_MSG_PREPROCESSOR_END 599
-#define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings above */
-#endif
/*
- * Values for all compiler messages.
+ * Values (message IDs) for all compiler messages. There are currently
+ * three distinct blocks of error messages (so that they can be expanded
+ * individually):
+ * Main ASL compiler
+ * Data Table compiler
+ * Preprocessor
+ *
+ * NOTE1: This list must match the tables of message strings in the file
+ * aslmessages.c exactly.
*
- * NOTE: With the introduction of the -vw option to disable specific messages,
- * new messages should only be added to the end of this list, so that values
- * for existing messages are not disturbed.
+ * NOTE2: With the introduction of the -vw option to disable specific
+ * messages, new messages should only be added to the end of these
+ * lists, so that values for existing messages are not disturbed.
*/
typedef enum
{
- ASL_MSG_RESERVED = 0,
+ ASL_MSG_RESERVED = ASL_MSG_MAIN_COMPILER,
ASL_MSG_ALIGNMENT,
ASL_MSG_ALPHANUMERIC_STRING,
@@ -236,23 +235,13 @@ typedef enum
ASL_MSG_WRITE,
ASL_MSG_RANGE,
ASL_MSG_BUFFER_ALLOCATION,
+ ASL_MSG_MISSING_DEPENDENCY,
+ ASL_MSG_ILLEGAL_FORWARD_REF,
+ ASL_MSG_ILLEGAL_METHOD_REF,
- /* These messages are used by the Preprocessor only */
+ /* These messages are used by the Data Table compiler only */
- ASL_MSG_DIRECTIVE_SYNTAX,
- ASL_MSG_ENDIF_MISMATCH,
- ASL_MSG_ERROR_DIRECTIVE,
- ASL_MSG_EXISTING_NAME,
- ASL_MSG_INVALID_INVOCATION,
- ASL_MSG_MACRO_SYNTAX,
- ASL_MSG_TOO_MANY_ARGUMENTS,
- ASL_MSG_UNKNOWN_DIRECTIVE,
- ASL_MSG_UNKNOWN_PRAGMA,
- ASL_MSG_WARNING_DIRECTIVE,
-
- /* These messages are used by the data table compiler only */
-
- ASL_MSG_BUFFER_ELEMENT,
+ ASL_MSG_BUFFER_ELEMENT = ASL_MSG_TABLE_COMPILER,
ASL_MSG_DIVIDE_BY_ZERO,
ASL_MSG_FLAG_VALUE,
ASL_MSG_INTEGER_SIZE,
@@ -264,194 +253,22 @@ typedef enum
ASL_MSG_UNKNOWN_LABEL,
ASL_MSG_UNKNOWN_SUBTABLE,
ASL_MSG_UNKNOWN_TABLE,
- ASL_MSG_ZERO_VALUE
-
-} ASL_MESSAGE_IDS;
+ ASL_MSG_ZERO_VALUE,
+ /* These messages are used by the Preprocessor only */
-#ifdef ASL_EXCEPTIONS
-
-/*
- * Actual message strings for each compiler message.
- *
- * NOTE: With the introduction of the -vw option to disable specific messages,
- * new messages should only be added to the end of this list, so that values
- * for existing messages are not disturbed.
- */
-char *AslMessages [] =
-{
-/* The zeroth message is reserved */ "",
-/* ASL_MSG_ALIGNMENT */ "Must be a multiple of alignment/granularity value",
-/* ASL_MSG_ALPHANUMERIC_STRING */ "String must be entirely alphanumeric",
-/* ASL_MSG_AML_NOT_IMPLEMENTED */ "Opcode is not implemented in compiler AML code generator",
-/* ASL_MSG_ARG_COUNT_HI */ "Too many arguments",
-/* ASL_MSG_ARG_COUNT_LO */ "Too few arguments",
-/* ASL_MSG_ARG_INIT */ "Method argument is not initialized",
-/* ASL_MSG_BACKWARDS_OFFSET */ "Invalid backwards offset",
-/* ASL_MSG_BUFFER_LENGTH */ "Effective AML buffer length is zero",
-/* ASL_MSG_CLOSE */ "Could not close file",
-/* ASL_MSG_COMPILER_INTERNAL */ "Internal compiler error",
-/* ASL_MSG_COMPILER_RESERVED */ "Use of compiler reserved name",
-/* ASL_MSG_CONNECTION_MISSING */ "A Connection operator is required for this field SpaceId",
-/* ASL_MSG_CONNECTION_INVALID */ "Invalid OpRegion SpaceId for use of Connection operator",
-/* ASL_MSG_CONSTANT_EVALUATION */ "Could not evaluate constant expression",
-/* ASL_MSG_CONSTANT_FOLDED */ "Constant expression evaluated and reduced",
-/* ASL_MSG_CORE_EXCEPTION */ "From ACPI CA Subsystem",
-/* ASL_MSG_DEBUG_FILE_OPEN */ "Could not open debug file",
-/* ASL_MSG_DEBUG_FILENAME */ "Could not create debug filename",
-/* ASL_MSG_DEPENDENT_NESTING */ "Dependent function macros cannot be nested",\
-/* ASL_MSG_DMA_CHANNEL */ "Invalid DMA channel (must be 0-7)",
-/* ASL_MSG_DMA_LIST */ "Too many DMA channels (8 max)",
-/* ASL_MSG_DUPLICATE_CASE */ "Case value already specified",
-/* ASL_MSG_DUPLICATE_ITEM */ "Duplicate value in list",
-/* ASL_MSG_EARLY_EOF */ "Premature end-of-file reached",
-/* ASL_MSG_ENCODING_LENGTH */ "Package length too long to encode",
-/* ASL_MSG_EX_INTERRUPT_LIST */ "Too many interrupts (255 max)",
-/* ASL_MSG_EX_INTERRUPT_LIST_MIN */ "Too few interrupts (1 minimum required)",
-/* ASL_MSG_EX_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 32 bits)",
-/* ASL_MSG_FIELD_ACCESS_WIDTH */ "Access width is greater than region size",
-/* ASL_MSG_FIELD_UNIT_ACCESS_WIDTH */ "Access width of Field Unit extends beyond region limit",
-/* ASL_MSG_FIELD_UNIT_OFFSET */ "Field Unit extends beyond region limit",
-/* ASL_MSG_GPE_NAME_CONFLICT */ "Name conflicts with a previous GPE method",
-/* ASL_MSG_HID_LENGTH */ "_HID string must be exactly 7 or 8 characters",
-/* ASL_MSG_HID_PREFIX */ "_HID prefix must be all uppercase or decimal digits",
-/* ASL_MSG_HID_SUFFIX */ "_HID suffix must be all hex digits",
-/* ASL_MSG_INCLUDE_FILE_OPEN */ "Could not open include file",
-/* ASL_MSG_INPUT_FILE_OPEN */ "Could not open input file",
-/* ASL_MSG_INTEGER_LENGTH */ "64-bit integer in 32-bit table, truncating (DSDT version < 2)",
-/* ASL_MSG_INTEGER_OPTIMIZATION */ "Integer optimized to single-byte AML opcode",
-/* ASL_MSG_INTERRUPT_LIST */ "Too many interrupts (16 max)",
-/* ASL_MSG_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 0-15)",
-/* ASL_MSG_INVALID_ACCESS_SIZE */ "Invalid AccessSize (Maximum is 4 - QWord access)",
-/* ASL_MSG_INVALID_ADDR_FLAGS */ "Invalid combination of Length and Min/Max fixed flags",
-/* ASL_MSG_INVALID_CONSTANT_OP */ "Invalid operator in constant expression (not type 3/4/5)",
-/* ASL_MSG_INVALID_EISAID */ "EISAID string must be of the form \"UUUXXXX\" (3 uppercase, 4 hex digits)",
-/* ASL_MSG_INVALID_ESCAPE */ "Invalid or unknown escape sequence",
-/* ASL_MSG_INVALID_GRAN_FIXED */ "Granularity must be zero for fixed Min/Max",
-/* ASL_MSG_INVALID_GRANULARITY */ "Granularity must be zero or a power of two minus one",
-/* ASL_MSG_INVALID_LENGTH */ "Length is larger than Min/Max window",
-/* ASL_MSG_INVALID_LENGTH_FIXED */ "Length is not equal to fixed Min/Max window",
-/* ASL_MSG_INVALID_MIN_MAX */ "Address Min is greater than Address Max",
-/* ASL_MSG_INVALID_OPERAND */ "Invalid operand",
-/* ASL_MSG_INVALID_PERFORMANCE */ "Invalid performance/robustness value",
-/* ASL_MSG_INVALID_PRIORITY */ "Invalid priority value",
-/* ASL_MSG_INVALID_STRING */ "Invalid Hex/Octal Escape - Non-ASCII or NULL",
-/* ASL_MSG_INVALID_TARGET */ "Target operand not allowed in constant expression",
-/* 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_ISA_ADDRESS */ "Maximum 10-bit ISA address (0x3FF)",
-/* ASL_MSG_LEADING_ASTERISK */ "Invalid leading asterisk",
-/* 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",
-/* ASL_MSG_LOCAL_OUTSIDE_METHOD */ "Local or Arg used outside a control method",
-/* ASL_MSG_LONG_LINE */ "Splitting long input line",
-/* ASL_MSG_MEMORY_ALLOCATION */ "Memory allocation failure",
-/* ASL_MSG_MISSING_ENDDEPENDENT */ "Missing EndDependentFn() macro in dependent resource list",
-/* ASL_MSG_MISSING_STARTDEPENDENT */ "Missing StartDependentFn() macro in dependent resource list",
-/* ASL_MSG_MULTIPLE_DEFAULT */ "More than one Default statement within Switch construct",
-/* ASL_MSG_MULTIPLE_TYPES */ "Multiple types",
-/* ASL_MSG_NAME_EXISTS */ "Name already exists in scope",
-/* ASL_MSG_NAME_OPTIMIZATION */ "NamePath optimized",
-/* ASL_MSG_NAMED_OBJECT_IN_WHILE */ "Creating a named object in a While loop",
-/* ASL_MSG_NESTED_COMMENT */ "Nested comment found",
-/* ASL_MSG_NO_CASES */ "No Case statements under Switch",
-/* ASL_MSG_NO_REGION */ "_REG has no corresponding Operation Region",
-/* ASL_MSG_NO_RETVAL */ "Called method returns no value",
-/* ASL_MSG_NO_WHILE */ "No enclosing While statement",
-/* ASL_MSG_NON_ASCII */ "Invalid characters found in file",
-/* ASL_MSG_NON_ZERO */ "Operand evaluates to zero",
-/* ASL_MSG_NOT_EXIST */ "Object does not exist",
-/* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from scope",
-/* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke",
-/* ASL_MSG_NOT_PARAMETER */ "Not a parameter, used as local only",
-/* ASL_MSG_NOT_REACHABLE */ "Object is not accessible from this scope",
-/* ASL_MSG_NOT_REFERENCED */ "Namespace object is not referenced",
-/* ASL_MSG_NULL_DESCRIPTOR */ "Min/Max/Length/Gran are all zero, but no resource tag",
-/* ASL_MSG_NULL_STRING */ "Invalid zero-length (null) string",
-/* ASL_MSG_OPEN */ "Could not open file",
-/* ASL_MSG_OUTPUT_FILE_OPEN */ "Could not open output AML file",
-/* ASL_MSG_OUTPUT_FILENAME */ "Could not create output filename",
-/* ASL_MSG_PACKAGE_LENGTH */ "Effective AML package length is zero",
-/* ASL_MSG_PREPROCESSOR_FILENAME */ "Could not create preprocessor filename",
-/* ASL_MSG_READ */ "Could not read file",
-/* ASL_MSG_RECURSION */ "Recursive method call",
-/* ASL_MSG_REGION_BUFFER_ACCESS */ "Host Operation Region requires BufferAcc access",
-/* ASL_MSG_REGION_BYTE_ACCESS */ "Host Operation Region requires ByteAcc access",
-/* ASL_MSG_RESERVED_ARG_COUNT_HI */ "Reserved method has too many arguments",
-/* ASL_MSG_RESERVED_ARG_COUNT_LO */ "Reserved method has too few arguments",
-/* ASL_MSG_RESERVED_METHOD */ "Reserved name must be a control method",
-/* ASL_MSG_RESERVED_NO_RETURN_VAL */ "Reserved method should not return a value",
-/* ASL_MSG_RESERVED_OPERAND_TYPE */ "Invalid object type for reserved name",
-/* ASL_MSG_RESERVED_PACKAGE_LENGTH */ "Invalid package length for reserved name",
-/* ASL_MSG_RESERVED_RETURN_VALUE */ "Reserved method must return a value",
-/* ASL_MSG_RESERVED_USE */ "Invalid use of reserved name",
-/* ASL_MSG_RESERVED_WORD */ "Use of reserved name",
-/* ASL_MSG_RESOURCE_FIELD */ "Resource field name cannot be used as a target",
-/* ASL_MSG_RESOURCE_INDEX */ "Missing ResourceSourceIndex (required)",
-/* ASL_MSG_RESOURCE_LIST */ "Too many resource items (internal error)",
-/* ASL_MSG_RESOURCE_SOURCE */ "Missing ResourceSource string (required)",
-/* ASL_MSG_RESULT_NOT_USED */ "Result is not used, operator has no effect",
-/* ASL_MSG_RETURN_TYPES */ "Not all control paths return a value",
-/* ASL_MSG_SCOPE_FWD_REF */ "Forward references from Scope operator not allowed",
-/* ASL_MSG_SCOPE_TYPE */ "Existing object has invalid type for Scope operator",
-/* ASL_MSG_SEEK */ "Could not seek file",
-/* ASL_MSG_SERIALIZED */ "Control Method marked Serialized",
-/* ASL_MSG_SERIALIZED_REQUIRED */ "Control Method should be made Serialized",
-/* ASL_MSG_SINGLE_NAME_OPTIMIZATION */ "NamePath optimized to NameSeg (uses run-time search path)",
-/* ASL_MSG_SOME_NO_RETVAL */ "Called method may not always return a value",
-/* ASL_MSG_STRING_LENGTH */ "String literal too long",
-/* ASL_MSG_SWITCH_TYPE */ "Switch expression is not a static Integer/Buffer/String data type, defaulting to Integer",
-/* ASL_MSG_SYNC_LEVEL */ "SyncLevel must be in the range 0-15",
-/* ASL_MSG_SYNTAX */ "",
-/* ASL_MSG_TABLE_SIGNATURE */ "Invalid Table Signature",
-/* ASL_MSG_TAG_LARGER */ "ResourceTag larger than Field",
-/* ASL_MSG_TAG_SMALLER */ "ResourceTag smaller than Field",
-/* ASL_MSG_TIMEOUT */ "Result is not used, possible operator timeout will be missed",
-/* ASL_MSG_TOO_MANY_TEMPS */ "Method requires too many temporary variables (_T_x)",
-/* ASL_MSG_TRUNCATION */ "64-bit return value will be truncated to 32 bits (DSDT version < 2)",
-/* ASL_MSG_UNKNOWN_RESERVED_NAME */ "Unknown reserved name",
-/* ASL_MSG_UNREACHABLE_CODE */ "Statement is unreachable",
-/* ASL_MSG_UNSUPPORTED */ "Unsupported feature",
-/* ASL_MSG_UPPER_CASE */ "Non-hex letters must be upper case",
-/* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)",
-/* ASL_MSG_WRITE */ "Could not write file",
-/* ASL_MSG_RANGE */ "Constant out of range",
-/* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer",
-
-/* Preprocessor */
-
-/* ASL_MSG_DIRECTIVE_SYNTAX */ "Invalid directive syntax",
-/* ASL_MSG_ENDIF_MISMATCH */ "Mismatched #endif",
-/* ASL_MSG_ERROR_DIRECTIVE */ "#error",
-/* ASL_MSG_EXISTING_NAME */ "Name is already defined",
-/* ASL_MSG_INVALID_INVOCATION */ "Invalid macro invocation",
-/* ASL_MSG_MACRO_SYNTAX */ "Invalid macro syntax",
-/* ASL_MSG_TOO_MANY_ARGUMENTS */ "Too many macro arguments",
-/* ASL_MSG_UNKNOWN_DIRECTIVE */ "Unknown directive",
-/* ASL_MSG_UNKNOWN_PRAGMA */ "Unknown pragma",
-/* ASL_MSG_WARNING_DIRECTIVE */ "#warning",
-
-/* Table compiler */
+ ASL_MSG_DIRECTIVE_SYNTAX = ASL_MSG_PREPROCESSOR,
+ ASL_MSG_ENDIF_MISMATCH,
+ ASL_MSG_ERROR_DIRECTIVE,
+ ASL_MSG_EXISTING_NAME,
+ ASL_MSG_INVALID_INVOCATION,
+ ASL_MSG_MACRO_SYNTAX,
+ ASL_MSG_TOO_MANY_ARGUMENTS,
+ ASL_MSG_UNKNOWN_DIRECTIVE,
+ ASL_MSG_UNKNOWN_PRAGMA,
+ ASL_MSG_WARNING_DIRECTIVE,
-/* ASL_MSG_BUFFER_ELEMENT */ "Invalid element in buffer initializer list",
-/* ASL_MSG_DIVIDE_BY_ZERO */ "Expression contains divide-by-zero",
-/* ASL_MSG_FLAG_VALUE */ "Flag value is too large",
-/* ASL_MSG_INTEGER_SIZE */ "Integer too large for target",
-/* ASL_MSG_INVALID_EXPRESSION */ "Invalid expression",
-/* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name",
-/* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant",
-/* ASL_MSG_OEM_TABLE */ "OEM table - unknown contents",
-/* ASL_MSG_RESERVED_VALUE */ "Reserved field must be zero",
-/* ASL_MSG_UNKNOWN_LABEL */ "Label is undefined",
-/* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type",
-/* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature",
-/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero"
-};
+} ASL_MESSAGE_IDS;
-#endif /* ASL_EXCEPTIONS */
#endif /* __ASLMESSAGES_H */
diff --git a/sys/contrib/dev/acpica/compiler/aslmethod.c b/sys/contrib/dev/acpica/compiler/aslmethod.c
index 72f7647..fa9216e 100644
--- a/sys/contrib/dev/acpica/compiler/aslmethod.c
+++ b/sys/contrib/dev/acpica/compiler/aslmethod.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acparser.h>
@@ -108,7 +107,42 @@ MtMethodAnalysisWalkBegin (
WalkInfo->MethodStack = MethodInfo;
- /* Get the name node, ignored here */
+ /*
+ * Special handling for _PSx methods. Dependency rules (same scope):
+ *
+ * 1) _PS0 - One of these must exist: _PS1, _PS2, _PS3
+ * 2) _PS1/_PS2/_PS3: A _PS0 must exist
+ */
+ if (ACPI_COMPARE_NAME (METHOD_NAME__PS0, Op->Asl.NameSeg))
+ {
+ /* For _PS0, one of _PS1/_PS2/_PS3 must exist */
+
+ if ((!ApFindNameInScope (METHOD_NAME__PS1, Op)) &&
+ (!ApFindNameInScope (METHOD_NAME__PS2, Op)) &&
+ (!ApFindNameInScope (METHOD_NAME__PS3, Op)))
+ {
+ AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+ "_PS0 requires one of _PS1/_PS2/_PS3 in same scope");
+ }
+ }
+ else if (
+ ACPI_COMPARE_NAME (METHOD_NAME__PS1, Op->Asl.NameSeg) ||
+ ACPI_COMPARE_NAME (METHOD_NAME__PS2, Op->Asl.NameSeg) ||
+ ACPI_COMPARE_NAME (METHOD_NAME__PS3, Op->Asl.NameSeg))
+ {
+ /* For _PS1/_PS2/_PS3, a _PS0 must exist */
+
+ if (!ApFindNameInScope (METHOD_NAME__PS0, Op))
+ {
+ sprintf (MsgBuffer,
+ "%4.4s requires _PS0 in same scope", Op->Asl.NameSeg);
+
+ AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+ MsgBuffer);
+ }
+ }
+
+ /* Get the name node */
Next = Op->Asl.Child;
@@ -359,6 +393,17 @@ MtMethodAnalysisWalkBegin (
break;
case PARSEOP_DEVICE:
+
+ Next = Op->Asl.Child;
+
+ if (!ApFindNameInScope (METHOD_NAME__HID, Next) &&
+ !ApFindNameInScope (METHOD_NAME__ADR, Next))
+ {
+ AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+ "Device object requires a _HID or _ADR in same scope");
+ }
+ break;
+
case PARSEOP_EVENT:
case PARSEOP_MUTEX:
case PARSEOP_OPERATIONREGION:
@@ -412,6 +457,7 @@ MtMethodAnalysisWalkBegin (
AnCheckId (Next, ASL_TYPE_CID);
}
}
+
break;
default:
diff --git a/sys/contrib/dev/acpica/compiler/aslnamesp.c b/sys/contrib/dev/acpica/compiler/aslnamesp.c
index e7ad672..720d394 100644
--- a/sys/contrib/dev/acpica/compiler/aslnamesp.c
+++ b/sys/contrib/dev/acpica/compiler/aslnamesp.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acnamesp.h>
diff --git a/sys/contrib/dev/acpica/compiler/asloffset.c b/sys/contrib/dev/acpica/compiler/asloffset.c
index 390a118..14f7e95 100644
--- a/sys/contrib/dev/acpica/compiler/asloffset.c
+++ b/sys/contrib/dev/acpica/compiler/asloffset.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/aslopcodes.c b/sys/contrib/dev/acpica/compiler/aslopcodes.c
index 6d39da9..d4dbbe3 100644
--- a/sys/contrib/dev/acpica/compiler/aslopcodes.c
+++ b/sys/contrib/dev/acpica/compiler/aslopcodes.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@@ -69,9 +68,62 @@ OpcDoEisaId (
ACPI_PARSE_OBJECT *Op);
static void
+OpcDoPld (
+ ACPI_PARSE_OBJECT *Op);
+
+static void
OpcDoUuId (
ACPI_PARSE_OBJECT *Op);
+static UINT8 *
+OpcEncodePldBuffer (
+ ACPI_PLD_INFO *PldInfo);
+
+
+/* ToPld strings */
+
+static char *AslPldPanelList[] =
+{
+ "TOP",
+ "BOTTOM",
+ "LEFT",
+ "RIGHT",
+ "FRONT",
+ "BACK",
+ "UNKNOWN",
+ NULL
+};
+
+static char *AslPldVerticalPositionList[] =
+{
+ "UPPER",
+ "CENTER",
+ "LOWER",
+ NULL
+};
+
+static char *AslPldHorizontalPositionList[] =
+{
+ "LEFT",
+ "CENTER",
+ "RIGHT",
+ NULL
+};
+
+static char *AslPldShapeList[] =
+{
+ "ROUND",
+ "OVAL",
+ "SQUARE",
+ "VERTICALRECTANGLE",
+ "HORIZONTALRECTANGLE",
+ "VERTICALTRAPEZOID",
+ "HORIZONTALTRAPEZOID",
+ "UNKNOWN",
+ "CHAMFERED",
+ NULL
+};
+
/*******************************************************************************
*
@@ -403,6 +455,7 @@ OpcDoConnection (
ACPI_PARSE_OBJECT *BufferOp;
ACPI_PARSE_OBJECT *BufferLengthOp;
ACPI_PARSE_OBJECT *BufferDataOp;
+ ASL_RESOURCE_INFO Info;
UINT8 State;
@@ -417,8 +470,10 @@ OpcDoConnection (
BufferLengthOp = BufferOp->Asl.Child;
BufferDataOp = BufferLengthOp->Asl.Next;
+ Info.DescriptorTypeOp = BufferDataOp->Asl.Next;
+ Info.CurrentByteOffset = 0;
State = ACPI_RSTATE_NORMAL;
- Rnode = RsDoOneResourceDescriptor (BufferDataOp->Asl.Next, 0, &State);
+ Rnode = RsDoOneResourceDescriptor (&Info, &State);
if (!Rnode)
{
return; /* error */
@@ -623,10 +678,10 @@ OpcDoEisaId (
(UINT32) ((UINT8) (InString[1] - 0x40)) << 21 |
(UINT32) ((UINT8) (InString[2] - 0x40)) << 16 |
- (UtHexCharToValue (InString[3])) << 12 |
- (UtHexCharToValue (InString[4])) << 8 |
- (UtHexCharToValue (InString[5])) << 4 |
- UtHexCharToValue (InString[6]);
+ (AcpiUtAsciiCharToHex (InString[3])) << 12 |
+ (AcpiUtAsciiCharToHex (InString[4])) << 8 |
+ (AcpiUtAsciiCharToHex (InString[5])) << 4 |
+ AcpiUtAsciiCharToHex (InString[6]);
/* Swap to little-endian to get final ID (see function header) */
@@ -651,9 +706,698 @@ OpcDoEisaId (
/*******************************************************************************
*
+ * FUNCTION: OpcEncodePldBuffer
+ *
+ * PARAMETERS: PldInfo - _PLD buffer struct (Using local struct)
+ *
+ * RETURN: Encode _PLD buffer suitable for return value from _PLD
+ *
+ * DESCRIPTION: Bit-packs a _PLD buffer struct.
+ *
+ ******************************************************************************/
+
+static UINT8 *
+OpcEncodePldBuffer (
+ ACPI_PLD_INFO *PldInfo)
+{
+ UINT32 *Buffer;
+ UINT32 Dword;
+
+
+ Buffer = ACPI_ALLOCATE_ZEROED (ACPI_PLD_BUFFER_SIZE);
+ if (!Buffer)
+ {
+ return (NULL);
+ }
+
+ /* First 32 bits */
+
+ Dword = 0;
+ ACPI_PLD_SET_REVISION (&Dword, PldInfo->Revision);
+ ACPI_PLD_SET_IGNORE_COLOR (&Dword, PldInfo->IgnoreColor);
+ ACPI_PLD_SET_RED (&Dword, PldInfo->Red);
+ ACPI_PLD_SET_GREEN (&Dword, PldInfo->Green);
+ ACPI_PLD_SET_BLUE (&Dword, PldInfo->Blue);
+ ACPI_MOVE_32_TO_32 (&Buffer[0], &Dword);
+
+ /* Second 32 bits */
+
+ Dword = 0;
+ ACPI_PLD_SET_WIDTH (&Dword, PldInfo->Width);
+ ACPI_PLD_SET_HEIGHT (&Dword, PldInfo->Height);
+ ACPI_MOVE_32_TO_32 (&Buffer[1], &Dword);
+
+ /* Third 32 bits */
+
+ Dword = 0;
+ ACPI_PLD_SET_USER_VISIBLE (&Dword, PldInfo->UserVisible);
+ ACPI_PLD_SET_DOCK (&Dword, PldInfo->Dock);
+ ACPI_PLD_SET_LID (&Dword, PldInfo->Lid);
+ ACPI_PLD_SET_PANEL (&Dword, PldInfo->Panel);
+ ACPI_PLD_SET_VERTICAL (&Dword, PldInfo->VerticalPosition);
+ ACPI_PLD_SET_HORIZONTAL (&Dword, PldInfo->HorizontalPosition);
+ ACPI_PLD_SET_SHAPE (&Dword, PldInfo->Shape);
+ ACPI_PLD_SET_ORIENTATION (&Dword, PldInfo->GroupOrientation);
+ ACPI_PLD_SET_TOKEN (&Dword, PldInfo->GroupToken);
+ ACPI_PLD_SET_POSITION (&Dword, PldInfo->GroupPosition);
+ ACPI_PLD_SET_BAY (&Dword, PldInfo->Bay);
+ ACPI_MOVE_32_TO_32 (&Buffer[2], &Dword);
+
+ /* Fourth 32 bits */
+
+ Dword = 0;
+ ACPI_PLD_SET_EJECTABLE (&Dword, PldInfo->Ejectable);
+ ACPI_PLD_SET_OSPM_EJECT (&Dword, PldInfo->OspmEjectRequired);
+ ACPI_PLD_SET_CABINET (&Dword, PldInfo->CabinetNumber);
+ ACPI_PLD_SET_CARD_CAGE (&Dword, PldInfo->CardCageNumber);
+ ACPI_PLD_SET_REFERENCE (&Dword, PldInfo->Reference);
+ ACPI_PLD_SET_ROTATION (&Dword, PldInfo->Rotation);
+ ACPI_PLD_SET_ORDER (&Dword, PldInfo->Order);
+ ACPI_MOVE_32_TO_32 (&Buffer[3], &Dword);
+
+ if (PldInfo->Revision >= 2)
+ {
+ /* Fifth 32 bits */
+
+ Dword = 0;
+ ACPI_PLD_SET_VERT_OFFSET (&Dword, PldInfo->VerticalOffset);
+ ACPI_PLD_SET_HORIZ_OFFSET (&Dword, PldInfo->HorizontalOffset);
+ ACPI_MOVE_32_TO_32 (&Buffer[4], &Dword);
+ }
+
+ return (ACPI_CAST_PTR (UINT8, Buffer));
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: OpcStrupr (strupr)
+ *
+ * PARAMETERS: SrcString - The source string to convert
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Convert string to uppercase
+ *
+ * NOTE: This is not a POSIX function, so it appears here, not in utclib.c
+ *
+ ******************************************************************************/
+
+static void
+OpcStrupr (
+ char *SrcString)
+{
+ char *String;
+
+
+ if (!SrcString)
+ {
+ return;
+ }
+
+ /* Walk entire string, uppercasing the letters */
+
+ for (String = SrcString; *String; String++)
+ {
+ *String = (char) toupper ((int) *String);
+ }
+
+ return;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: OpcFindName
+ *
+ * PARAMETERS: List - Array of char strings to be searched
+ * Name - Char string to string for
+ * Index - Index value to set if found
+ *
+ * RETURN: TRUE if any names matched, FALSE otherwise
+ *
+ * DESCRIPTION: Match PLD name to value in lookup table. Sets Value to
+ * equivalent parameter value.
+ *
+ ******************************************************************************/
+
+static BOOLEAN
+OpcFindName (
+ char **List,
+ char *Name,
+ UINT64 *Index)
+{
+ char *Str;
+ UINT32 i;
+
+
+ OpcStrupr (Name);
+
+ for (i = 0, Str = List[0]; Str; i++, Str = List[i])
+ {
+ if (!(ACPI_STRNCMP (Str, Name, ACPI_STRLEN (Name))))
+ {
+ *Index = i;
+ return (TRUE);
+ }
+ }
+
+ return (FALSE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: OpcDoPld
+ *
+ * PARAMETERS: Op - Parse node
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Convert ToPLD macro to 20-byte buffer
+ *
+ ******************************************************************************/
+
+static void
+OpcDoPld (
+ ACPI_PARSE_OBJECT *Op)
+{
+ UINT8 *Buffer;
+ ACPI_PARSE_OBJECT *Node;
+ ACPI_PLD_INFO PldInfo;
+ ACPI_PARSE_OBJECT *NewOp;
+
+
+ if (!Op)
+ {
+ AslError(ASL_ERROR, ASL_MSG_NOT_EXIST, Op, NULL);
+ return;
+ }
+
+ if (Op->Asl.ParseOpcode != PARSEOP_TOPLD)
+ {
+ AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Op, NULL);
+ return;
+ }
+
+ Buffer = UtLocalCalloc (ACPI_PLD_BUFFER_SIZE);
+ if (!Buffer)
+ {
+ AslError(ASL_ERROR, ASL_MSG_BUFFER_ALLOCATION, Op, NULL);
+ return;
+ }
+
+ ACPI_MEMSET (&PldInfo, 0, sizeof (ACPI_PLD_INFO));
+
+ Node = Op->Asl.Child;
+ while (Node)
+ {
+ switch (Node->Asl.ParseOpcode)
+ {
+ case PARSEOP_PLD_REVISION:
+
+ if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
+ {
+ AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.Child->Asl.Value.Integer > 127)
+ {
+ AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
+ break;
+ }
+
+ PldInfo.Revision = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ break;
+
+ case PARSEOP_PLD_IGNORECOLOR:
+
+ if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
+ {
+ AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.Child->Asl.Value.Integer > 1)
+ {
+ AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
+ break;
+ }
+
+ PldInfo.IgnoreColor = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ break;
+
+ case PARSEOP_PLD_RED:
+ case PARSEOP_PLD_GREEN:
+ case PARSEOP_PLD_BLUE:
+
+ if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
+ {
+ AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.Child->Asl.Value.Integer > 255)
+ {
+ AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.ParseOpcode == PARSEOP_PLD_RED)
+ {
+ PldInfo.Red = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ }
+ else if (Node->Asl.ParseOpcode == PARSEOP_PLD_GREEN)
+ {
+ PldInfo.Green = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ }
+ else /* PARSEOP_PLD_BLUE */
+ {
+ PldInfo.Blue = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ }
+ break;
+
+ case PARSEOP_PLD_WIDTH:
+ case PARSEOP_PLD_HEIGHT:
+
+ if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
+ {
+ AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.Child->Asl.Value.Integer > 65535)
+ {
+ AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.ParseOpcode == PARSEOP_PLD_WIDTH)
+ {
+ PldInfo.Width = (UINT16) Node->Asl.Child->Asl.Value.Integer;
+ }
+ else /* PARSEOP_PLD_HEIGHT */
+ {
+ PldInfo.Height = (UINT16) Node->Asl.Child->Asl.Value.Integer;
+ }
+
+ break;
+
+ case PARSEOP_PLD_USERVISIBLE:
+ case PARSEOP_PLD_DOCK:
+ case PARSEOP_PLD_LID:
+
+ if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
+ {
+ AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.Child->Asl.Value.Integer > 1)
+ {
+ AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.ParseOpcode == PARSEOP_PLD_USERVISIBLE)
+ {
+ PldInfo.UserVisible = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ }
+ else if (Node->Asl.ParseOpcode == PARSEOP_PLD_DOCK)
+ {
+ PldInfo.Dock = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ }
+ else
+ {
+ PldInfo.Lid = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ }
+
+ break;
+
+ case PARSEOP_PLD_PANEL:
+
+ if (Node->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER)
+ {
+ if (Node->Asl.Child->Asl.Value.Integer > 6)
+ {
+ AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
+ break;
+ }
+ }
+ else /* PARSEOP_STRING */
+ {
+ if (!OpcFindName(AslPldPanelList,
+ Node->Asl.Child->Asl.Value.String,
+ &Node->Asl.Child->Asl.Value.Integer))
+ {
+ AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Node, NULL);
+ break;
+ }
+ }
+
+ PldInfo.Panel = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ break;
+
+ case PARSEOP_PLD_VERTICALPOSITION:
+
+ if (Node->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER)
+ {
+ if (Node->Asl.Child->Asl.Value.Integer > 2)
+ {
+ AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
+ break;
+ }
+ }
+ else /* PARSEOP_STRING */
+ {
+ if (!OpcFindName(AslPldVerticalPositionList,
+ Node->Asl.Child->Asl.Value.String,
+ &Node->Asl.Child->Asl.Value.Integer))
+ {
+ AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Node, NULL);
+ break;
+ }
+ }
+
+ PldInfo.VerticalPosition = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ break;
+
+ case PARSEOP_PLD_HORIZONTALPOSITION:
+
+ if (Node->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER)
+ {
+ if (Node->Asl.Child->Asl.Value.Integer > 2)
+ {
+ AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
+ break;
+ }
+ }
+ else /* PARSEOP_STRING */
+ {
+ if (!OpcFindName(AslPldHorizontalPositionList,
+ Node->Asl.Child->Asl.Value.String,
+ &Node->Asl.Child->Asl.Value.Integer))
+ {
+ AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Node, NULL);
+ break;
+ }
+ }
+
+ PldInfo.HorizontalPosition = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ break;
+
+ case PARSEOP_PLD_SHAPE:
+
+ if (Node->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER)
+ {
+ if (Node->Asl.Child->Asl.Value.Integer > 8)
+ {
+ AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
+ break;
+ }
+ }
+ else /* PARSEOP_STRING */
+ {
+ if (!OpcFindName(AslPldShapeList,
+ Node->Asl.Child->Asl.Value.String,
+ &Node->Asl.Child->Asl.Value.Integer))
+ {
+ AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Node, NULL);
+ break;
+ }
+ }
+
+ PldInfo.Shape = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ break;
+
+ case PARSEOP_PLD_GROUPORIENTATION:
+
+ if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
+ {
+ AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.Child->Asl.Value.Integer > 1)
+ {
+ AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
+ break;
+ }
+
+ PldInfo.GroupOrientation = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ break;
+
+ case PARSEOP_PLD_GROUPTOKEN:
+ case PARSEOP_PLD_GROUPPOSITION:
+
+ if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
+ {
+ AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.Child->Asl.Value.Integer > 255)
+ {
+ AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
+ break;
+ }
+
+
+ if (Node->Asl.ParseOpcode == PARSEOP_PLD_GROUPTOKEN)
+ {
+ PldInfo.GroupToken = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ }
+ else /* PARSEOP_PLD_GROUPPOSITION */
+ {
+ PldInfo.GroupPosition = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ }
+
+ break;
+
+ case PARSEOP_PLD_BAY:
+ case PARSEOP_PLD_EJECTABLE:
+ case PARSEOP_PLD_EJECTREQUIRED:
+
+ if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
+ {
+ AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.Child->Asl.Value.Integer > 1)
+ {
+ AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.ParseOpcode == PARSEOP_PLD_BAY)
+ {
+ PldInfo.Bay = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ }
+ else if (Node->Asl.ParseOpcode == PARSEOP_PLD_EJECTABLE)
+ {
+ PldInfo.Ejectable = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ }
+ else /* PARSEOP_PLD_EJECTREQUIRED */
+ {
+ PldInfo.OspmEjectRequired = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ }
+
+ break;
+
+ case PARSEOP_PLD_CABINETNUMBER:
+ case PARSEOP_PLD_CARDCAGENUMBER:
+
+ if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
+ {
+ AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.Child->Asl.Value.Integer > 255)
+ {
+ AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.ParseOpcode == PARSEOP_PLD_CABINETNUMBER)
+ {
+ PldInfo.CabinetNumber = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ }
+ else /* PARSEOP_PLD_CARDCAGENUMBER */
+ {
+ PldInfo.CardCageNumber = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ }
+
+ break;
+
+ case PARSEOP_PLD_REFERENCE:
+
+ if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
+ {
+ AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.Child->Asl.Value.Integer > 1)
+ {
+ AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
+ break;
+ }
+
+ PldInfo.Reference = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ break;
+
+ case PARSEOP_PLD_ROTATION:
+
+ if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
+ {
+ AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.Child->Asl.Value.Integer > 7)
+ {
+ switch (Node->Asl.Child->Asl.Value.Integer)
+ {
+ case 45:
+
+ Node->Asl.Child->Asl.Value.Integer = 1;
+ break;
+
+ case 90:
+
+ Node->Asl.Child->Asl.Value.Integer = 2;
+ break;
+
+ case 135:
+
+ Node->Asl.Child->Asl.Value.Integer = 3;
+ break;
+
+ case 180:
+
+ Node->Asl.Child->Asl.Value.Integer = 4;
+ break;
+
+ case 225:
+
+ Node->Asl.Child->Asl.Value.Integer = 5;
+ break;
+
+ case 270:
+
+ Node->Asl.Child->Asl.Value.Integer = 6;
+ break;
+
+ case 315:
+
+ Node->Asl.Child->Asl.Value.Integer = 7;
+ break;
+
+ default:
+
+ AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
+ break;
+ }
+ }
+
+ PldInfo.Rotation = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ break;
+
+ case PARSEOP_PLD_ORDER:
+
+ if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
+ {
+ AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.Child->Asl.Value.Integer > 31)
+ {
+ AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
+ break;
+ }
+
+ PldInfo.Order = (UINT8) Node->Asl.Child->Asl.Value.Integer;
+ break;
+
+ case PARSEOP_PLD_VERTICALOFFSET:
+ case PARSEOP_PLD_HORIZONTALOFFSET:
+
+ if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
+ {
+ AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.Child->Asl.Value.Integer > 65535)
+ {
+ AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
+ break;
+ }
+
+ if (Node->Asl.ParseOpcode == PARSEOP_PLD_VERTICALOFFSET)
+ {
+ PldInfo.VerticalOffset = (UINT16) Node->Asl.Child->Asl.Value.Integer;
+ }
+ else /* PARSEOP_PLD_HORIZONTALOFFSET */
+ {
+ PldInfo.HorizontalOffset = (UINT16) Node->Asl.Child->Asl.Value.Integer;
+ }
+
+ break;
+
+ default:
+
+ AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
+ break;
+ }
+
+ Node = Node->Asl.Next;
+ }
+
+ Buffer = OpcEncodePldBuffer(&PldInfo);
+
+ /* Change Op to a Buffer */
+
+ Op->Asl.ParseOpcode = PARSEOP_BUFFER;
+ Op->Common.AmlOpcode = AML_BUFFER_OP;
+
+ /* Disable further optimization */
+
+ Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
+ UtSetParseOpName (Op);
+
+ /* Child node is the buffer length */
+
+ NewOp = TrAllocateNode (PARSEOP_INTEGER);
+
+ NewOp->Asl.AmlOpcode = AML_BYTE_OP;
+ NewOp->Asl.Value.Integer = 20;
+ NewOp->Asl.Parent = Op;
+
+ Op->Asl.Child = NewOp;
+ Op = NewOp;
+
+ /* Peer to the child is the raw buffer data */
+
+ NewOp = TrAllocateNode (PARSEOP_RAW_DATA);
+ NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
+ NewOp->Asl.AmlLength = 20;
+ NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
+ NewOp->Asl.Parent = Op->Asl.Parent;
+
+ Op->Asl.Next = NewOp;
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: OpcDoUuId
*
- * PARAMETERS: Op - Parse node
+ * PARAMETERS: Op - Parse node
*
* RETURN: None
*
@@ -666,12 +1410,12 @@ OpcDoUuId (
ACPI_PARSE_OBJECT *Op)
{
char *InString;
- char *Buffer;
+ UINT8 *Buffer;
ACPI_STATUS Status = AE_OK;
ACPI_PARSE_OBJECT *NewOp;
- InString = (char *) Op->Asl.Value.String;
+ InString = ACPI_CAST_PTR (char, Op->Asl.Value.String);
Buffer = UtLocalCalloc (16);
Status = AuValidateUuid (InString);
@@ -681,7 +1425,7 @@ OpcDoUuId (
}
else
{
- (void) AuConvertStringToUuid (InString, Buffer);
+ AcpiUtConvertStringToUuid (InString, Buffer);
}
/* Change Op to a Buffer */
@@ -710,7 +1454,7 @@ OpcDoUuId (
NewOp = TrAllocateNode (PARSEOP_RAW_DATA);
NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
NewOp->Asl.AmlLength = 16;
- NewOp->Asl.Value.String = (char *) Buffer;
+ NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
NewOp->Asl.Parent = Op->Asl.Parent;
Op->Asl.Next = NewOp;
@@ -721,7 +1465,7 @@ OpcDoUuId (
*
* FUNCTION: OpcGenerateAmlOpcode
*
- * PARAMETERS: Op - Parse node
+ * PARAMETERS: Op - Parse node
*
* RETURN: None
*
@@ -735,7 +1479,6 @@ void
OpcGenerateAmlOpcode (
ACPI_PARSE_OBJECT *Op)
{
-
UINT16 Index;
@@ -781,6 +1524,21 @@ OpcGenerateAmlOpcode (
OpcDoEisaId (Op);
break;
+ case PARSEOP_PRINTF:
+
+ OpcDoPrintf (Op);
+ break;
+
+ case PARSEOP_FPRINTF:
+
+ OpcDoFprintf (Op);
+ break;
+
+ case PARSEOP_TOPLD:
+
+ OpcDoPld (Op);
+ break;
+
case PARSEOP_TOUUID:
OpcDoUuId (Op);
diff --git a/sys/contrib/dev/acpica/compiler/asloperands.c b/sys/contrib/dev/acpica/compiler/asloperands.c
index 07bf88f..b2972d4 100644
--- a/sys/contrib/dev/acpica/compiler/asloperands.c
+++ b/sys/contrib/dev/acpica/compiler/asloperands.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@@ -913,8 +912,8 @@ OpnDoDefinitionBlock (
* We will use the AML filename that is embedded in the source file
* for the output filename.
*/
- Filename = ACPI_ALLOCATE (strlen (Gbl_DirectoryPath) +
- strlen ((char *) Child->Asl.Value.Buffer) + 1);
+ Filename = UtStringCacheCalloc (strlen (Gbl_DirectoryPath) +
+ strlen ((char *) Child->Asl.Value.Buffer) + 1);
/* Prepend the current directory path */
@@ -922,6 +921,7 @@ OpnDoDefinitionBlock (
strcat (Filename, (char *) Child->Asl.Value.Buffer);
Gbl_OutputFilenamePrefix = Filename;
+ UtConvertBackslashes (Gbl_OutputFilenamePrefix);
}
Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
@@ -968,7 +968,7 @@ OpnDoDefinitionBlock (
if (Child->Asl.Value.String)
{
Length = ACPI_STRLEN (Child->Asl.Value.String);
- Gbl_TableId = AcpiOsAllocate (Length + 1);
+ Gbl_TableId = UtStringCacheCalloc (Length + 1);
ACPI_STRCPY (Gbl_TableId, Child->Asl.Value.String);
/*
diff --git a/sys/contrib/dev/acpica/compiler/aslopt.c b/sys/contrib/dev/acpica/compiler/aslopt.c
index 3471006..1079f9c 100644
--- a/sys/contrib/dev/acpica/compiler/aslopt.c
+++ b/sys/contrib/dev/acpica/compiler/aslopt.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@@ -168,7 +167,7 @@ OptSearchToRoot (
/* We must allocate a new string for the name (TargetPath gets deleted) */
- *NewPath = ACPI_ALLOCATE_ZEROED (ACPI_NAME_SIZE + 1);
+ *NewPath = UtStringCacheCalloc (ACPI_NAME_SIZE + 1);
ACPI_STRCPY (*NewPath, Path);
if (ACPI_STRNCMP (*NewPath, "_T_", 3))
@@ -576,7 +575,8 @@ OptOptimizeNamePath (
return_VOID;
}
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "%5d [%12.12s] [%12.12s] ",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
+ "PATH OPTIMIZE: Line %5d ParentOp [%12.12s] ThisOp [%12.12s] ",
Op->Asl.LogicalLineNumber,
AcpiPsGetOpcodeName (Op->Common.Parent->Common.AmlOpcode),
AcpiPsGetOpcodeName (Op->Common.AmlOpcode)));
@@ -620,7 +620,7 @@ OptOptimizeNamePath (
{
/* This is the declaration of a new name */
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "NAME"));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "NAME\n"));
/*
* The node of interest is the parent of this node (the containing
@@ -646,7 +646,7 @@ OptOptimizeNamePath (
{
/* This is a reference to an existing named object */
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "REF "));
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "REFERENCE\n"));
}
/*
@@ -688,9 +688,10 @@ OptOptimizeNamePath (
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
- "%37s (%2u) ==> %-32s(%2u) %-32s",
- (char *) CurrentPath.Pointer, (UINT32) CurrentPath.Length,
- (char *) TargetPath.Pointer, (UINT32) TargetPath.Length, ExternalNameString));
+ "CURRENT SCOPE: (%2u) %-37s FULL PATH TO NAME: (%2u) %-32s ACTUAL AML:%-32s\n",
+ (UINT32) CurrentPath.Length, (char *) CurrentPath.Pointer,
+ (UINT32) TargetPath.Length, (char *) TargetPath.Pointer,
+ ExternalNameString));
ACPI_FREE (ExternalNameString);
@@ -747,7 +748,8 @@ OptOptimizeNamePath (
HowMuchShorter = (AmlNameStringLength - ACPI_STRLEN (NewPath));
OptTotal += HowMuchShorter;
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, " REDUCED %2u (%u)",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
+ " REDUCED BY %2u (TOTAL SAVED %2u)",
(UINT32) HowMuchShorter, OptTotal));
if (Flags & AML_NAMED)
diff --git a/sys/contrib/dev/acpica/compiler/asloptions.c b/sys/contrib/dev/acpica/compiler/asloptions.c
index 66a9249..5868d98 100644
--- a/sys/contrib/dev/acpica/compiler/asloptions.c
+++ b/sys/contrib/dev/acpica/compiler/asloptions.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -118,8 +118,7 @@ AslCommandLine (
/* Next parameter must be the input filename */
if (!argv[AcpiGbl_Optind] &&
- !Gbl_DisasmFlag &&
- !Gbl_GetAllTables)
+ !Gbl_DisasmFlag)
{
printf ("Missing input filename\n");
BadCommandLine = TRUE;
@@ -169,7 +168,7 @@ AslDoOptions (
/* Get the command line options */
- while ((j = AcpiGetopt (argc, argv, ASL_SUPPORTED_OPTIONS)) != EOF) switch (j)
+ while ((j = AcpiGetopt (argc, argv, ASL_SUPPORTED_OPTIONS)) != ACPI_OPT_END) switch (j)
{
case '@': /* Begin a response file */
@@ -185,7 +184,7 @@ AslDoOptions (
}
break;
- case 'b': /* Debug output options */
+ case 'b': /* Debug options */
switch (AcpiGbl_Optarg[0])
{
@@ -194,10 +193,37 @@ AslDoOptions (
AslCompilerdebug = 1; /* same as yydebug */
DtParserdebug = 1;
PrParserdebug = 1;
+ Gbl_DebugFlag = TRUE;
+ break;
+
+ case 'p': /* Prune ASL parse tree */
+
+ /* Get the required argument */
+
+ if (AcpiGetoptArgument (argc, argv))
+ {
+ return (-1);
+ }
+
+ Gbl_PruneParseTree = TRUE;
+ Gbl_PruneDepth = (UINT8) strtoul (AcpiGbl_Optarg, NULL, 0);
+ break;
+
+ case 's':
+
+ Gbl_DebugFlag = TRUE;
break;
case 't':
+ /* Get the required argument */
+
+ if (AcpiGetoptArgument (argc, argv))
+ {
+ return (-1);
+ }
+
+ Gbl_PruneType = (UINT8) strtoul (AcpiGbl_Optarg, NULL, 0);
break;
default:
@@ -206,9 +232,6 @@ AslDoOptions (
return (-1);
}
- /* Produce debug output file */
-
- Gbl_DebugFlag = TRUE;
break;
case 'c':
@@ -251,6 +274,12 @@ AslDoOptions (
break;
+ case 'l': /* Use legacy ASL code (not ASL+) for disassembly */
+
+ Gbl_DoCompile = FALSE;
+ AcpiGbl_CstyleDisassembly = FALSE;
+ break;
+
default:
printf ("Unknown option: -d%s\n", AcpiGbl_Optarg);
@@ -267,11 +296,22 @@ AslDoOptions (
case 'e': /* External files for disassembler */
- Status = AcpiDmAddToExternalFileList (AcpiGbl_Optarg);
- if (ACPI_FAILURE (Status))
+ /* Get entire list of external files */
+
+ AcpiGbl_Optind--;
+ argv[AcpiGbl_Optind] = AcpiGbl_Optarg;
+
+ while (argv[AcpiGbl_Optind] &&
+ (argv[AcpiGbl_Optind][0] != '-'))
{
- printf ("Could not add %s to external list\n", AcpiGbl_Optarg);
- return (-1);
+ Status = AcpiDmAddToExternalFileList (argv[AcpiGbl_Optind]);
+ if (ACPI_FAILURE (Status))
+ {
+ printf ("Could not add %s to external list\n", argv[AcpiGbl_Optind]);
+ return (-1);
+ }
+
+ AcpiGbl_Optind++;
}
break;
@@ -308,9 +348,8 @@ AslDoOptions (
case 'g': /* Get all ACPI tables */
- Gbl_GetAllTables = TRUE;
- Gbl_DoCompile = FALSE;
- break;
+ printf ("-g option is deprecated, use acpidump utility instead\n");
+ exit (1);
case 'h':
@@ -404,6 +443,13 @@ AslDoOptions (
Gbl_PreprocessorOutputFlag = TRUE;
break;
+ case 'm':
+
+ /* Produce hardware map summary file */
+
+ Gbl_MapfileFlag = TRUE;
+ break;
+
case 'n':
/* Produce namespace file */
@@ -513,6 +559,7 @@ AslDoOptions (
case 'p': /* Override default AML output filename */
Gbl_OutputFilenamePrefix = AcpiGbl_Optarg;
+ UtConvertBackslashes (Gbl_OutputFilenamePrefix);
Gbl_UseDefaultAmlFilename = FALSE;
break;
@@ -596,11 +643,19 @@ AslDoOptions (
case 'a':
- /* Disable All error/warning messages */
+ /* Disable all error/warning/remark messages */
Gbl_NoErrors = TRUE;
break;
+ case 'e':
+
+ /* Disable all warning/remark messages (errors only) */
+
+ Gbl_DisplayRemarks = FALSE;
+ Gbl_DisplayWarnings = FALSE;
+ break;
+
case 'i':
/*
* Support for integrated development environment(s).
diff --git a/sys/contrib/dev/acpica/compiler/aslparser.y b/sys/contrib/dev/acpica/compiler/aslparser.y
new file mode 100644
index 0000000..223a49d
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/aslparser.y
@@ -0,0 +1,131 @@
+%{
+/******************************************************************************
+ *
+ * Module Name: aslparser.y - Master Bison/Yacc input file for iASL
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("aslparse")
+
+/*
+ * Global Notes:
+ *
+ * October 2005: The following list terms have been optimized (from the
+ * original ASL grammar in the ACPI specification) to force the immediate
+ * reduction of each list item so that the parse stack use doesn't increase on
+ * each list element and possibly overflow on very large lists (>4000 items).
+ * This dramatically reduces use of the parse stack overall.
+ *
+ * ArgList, TermList, Objectlist, ByteList, DWordList, PackageList,
+ * ResourceMacroList, and FieldUnitList
+ */
+
+void *
+AslLocalAllocate (
+ unsigned int Size);
+
+/* Bison/yacc configuration */
+
+#define static
+#undef malloc
+#define malloc AslLocalAllocate
+#undef alloca
+#define alloca AslLocalAllocate
+#define yytname AslCompilername
+
+#define YYINITDEPTH 600 /* State stack depth */
+#define YYDEBUG 1 /* Enable debug output */
+#define YYERROR_VERBOSE 1 /* Verbose error messages */
+#define YYFLAG -32768
+
+/* Define YYMALLOC/YYFREE to prevent redefinition errors */
+
+#define YYMALLOC AslLocalAllocate
+#define YYFREE ACPI_FREE
+%}
+
+/*
+ * Declare the type of values in the grammar
+ */
+%union {
+ UINT64 i;
+ char *s;
+ ACPI_PARSE_OBJECT *n;
+}
+
+/*
+ * These shift/reduce conflicts are expected. There should be zero
+ * reduce/reduce conflicts.
+ */
+%expect 89
+
+/*! [Begin] no source code translation */
+
+/*
+ * The M4 macro processor is used to bring in the parser items,
+ * in order to keep this master file smaller, and to break up
+ * the various parser items.
+ */
+m4_define(NoEcho)
+
+/* Token types */
+
+m4_include(asltokens.y)
+
+/* Production types/names */
+
+m4_include(asltypes.y)
+%%
+
+/* Production rules */
+
+m4_include(aslrules.y)
+%%
+
+/*! [End] no source code translation !*/
+
+/* Local support functions in C */
+
+m4_include(aslsupport.y)
diff --git a/sys/contrib/dev/acpica/compiler/aslpredef.c b/sys/contrib/dev/acpica/compiler/aslpredef.c
index 7f411fb..9a6778d 100644
--- a/sys/contrib/dev/acpica/compiler/aslpredef.c
+++ b/sys/contrib/dev/acpica/compiler/aslpredef.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -251,10 +251,16 @@ ApCheckPredefinedReturnValue (
const ACPI_PREDEFINED_INFO *ThisName;
- /* Check parent method for a match against the predefined name list */
-
+ /*
+ * Check parent method for a match against the predefined name list.
+ *
+ * Note: Disable compiler errors/warnings because any errors will be
+ * caught when analyzing the parent method. Eliminates duplicate errors.
+ */
+ Gbl_AllExceptionsDisabled = TRUE;
Index = ApCheckForPredefinedName (MethodInfo->Op,
MethodInfo->Op->Asl.NameSeg);
+ Gbl_AllExceptionsDisabled = FALSE;
switch (Index)
{
diff --git a/sys/contrib/dev/acpica/compiler/aslprepkg.c b/sys/contrib/dev/acpica/compiler/aslprepkg.c
index 9cc67f4..37a58df 100644
--- a/sys/contrib/dev/acpica/compiler/aslprepkg.c
+++ b/sys/contrib/dev/acpica/compiler/aslprepkg.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -169,7 +169,7 @@ ApCheckPackage (
{
case ACPI_PTYPE1_FIXED:
/*
- * The package count is fixed and there are no sub-packages
+ * The package count is fixed and there are no subpackages
*
* If package is too small, exit.
* If package is larger than expected, issue warning but continue
@@ -194,7 +194,7 @@ ApCheckPackage (
case ACPI_PTYPE1_VAR:
/*
- * The package count is variable, there are no sub-packages,
+ * The package count is variable, there are no subpackages,
* and all elements must be of the same type
*/
for (i = 0; i < Count; i++)
@@ -207,7 +207,7 @@ ApCheckPackage (
case ACPI_PTYPE1_OPTION:
/*
- * The package count is variable, there are no sub-packages.
+ * The package count is variable, there are no subpackages.
* There are a fixed number of required elements, and a variable
* number of optional elements.
*
@@ -251,7 +251,7 @@ ApCheckPackage (
Op = Op->Asl.Next;
Count--;
- /* Examine the sub-packages */
+ /* Examine the subpackages */
ApCheckPackageList (Predefined->Info.Name, Op,
Package, 1, Count);
@@ -259,7 +259,7 @@ ApCheckPackage (
case ACPI_PTYPE2_PKG_COUNT:
- /* First element is the (Integer) count of sub-packages to follow */
+ /* First element is the (Integer) count of subpackages to follow */
Status = ApCheckObjectType (Predefined->Info.Name, Op,
ACPI_RTYPE_INTEGER, 0);
@@ -283,12 +283,47 @@ ApCheckPackage (
Op = Op->Asl.Next;
- /* Examine the sub-packages */
+ /* Examine the subpackages */
ApCheckPackageList (Predefined->Info.Name, Op,
Package, 1, Count);
break;
+ case ACPI_PTYPE2_UUID_PAIR:
+
+ /* The package contains a variable list of UUID Buffer/Package pairs */
+
+ /* The length of the package must be even */
+
+ if (Count & 1)
+ {
+ sprintf (MsgBuffer, "%4.4s: Package length, %d, must be even.",
+ Predefined->Info.Name, Count);
+
+ AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH,
+ ParentOp->Asl.Child, MsgBuffer);
+ }
+
+ /* Validate the alternating types */
+
+ for (i = 0; i < Count; ++i)
+ {
+ if (i & 1)
+ {
+ ApCheckObjectType (Predefined->Info.Name, Op,
+ Package->RetInfo.ObjectType2, i);
+ }
+ else
+ {
+ ApCheckObjectType (Predefined->Info.Name, Op,
+ Package->RetInfo.ObjectType1, i);
+ }
+
+ Op = Op->Asl.Next;
+ }
+
+ break;
+
case ACPI_PTYPE2:
case ACPI_PTYPE2_FIXED:
case ACPI_PTYPE2_MIN:
@@ -296,10 +331,10 @@ ApCheckPackage (
case ACPI_PTYPE2_FIX_VAR:
/*
* These types all return a single Package that consists of a
- * variable number of sub-Packages.
+ * variable number of subpackages.
*/
- /* Examine the sub-packages */
+ /* Examine the subpackages */
ApCheckPackageList (Predefined->Info.Name, Op,
Package, 0, Count);
@@ -467,6 +502,12 @@ ApCheckPackageList (
Count, ExpectedCount);
break;
}
+ if (Count > ExpectedCount)
+ {
+ ApPackageTooLarge (PredefinedName, SubPackageOp,
+ Count, ExpectedCount);
+ break;
+ }
ApCheckPackageElements (PredefinedName, Op,
Package->RetInfo.ObjectType1, Package->RetInfo.Count1,
@@ -494,7 +535,7 @@ ApCheckPackageList (
case ACPI_PTYPE2_FIXED:
- /* Each sub-package has a fixed length */
+ /* Each subpackage has a fixed length */
ExpectedCount = Package->RetInfo2.Count;
if (Count < ExpectedCount)
@@ -503,6 +544,12 @@ ApCheckPackageList (
Count, ExpectedCount);
break;
}
+ if (Count > ExpectedCount)
+ {
+ ApPackageTooLarge (PredefinedName, SubPackageOp,
+ Count, ExpectedCount);
+ break;
+ }
/* Check each object/type combination */
@@ -517,7 +564,7 @@ ApCheckPackageList (
case ACPI_PTYPE2_MIN:
- /* Each sub-package has a variable but minimum length */
+ /* Each subpackage has a variable but minimum length */
ExpectedCount = Package->RetInfo.Count1;
if (Count < ExpectedCount)
@@ -527,7 +574,7 @@ ApCheckPackageList (
break;
}
- /* Check the type of each sub-package element */
+ /* Check the type of each subpackage element */
ApCheckPackageElements (PredefinedName, Op,
Package->RetInfo.ObjectType1, Count, 0, 0);
@@ -576,7 +623,7 @@ ApCheckPackageList (
Count = ExpectedCount;
}
- /* Check the type of each sub-package element */
+ /* Check the type of each subpackage element */
Op = Op->Asl.Next;
ApCheckPackageElements (PredefinedName, Op,
diff --git a/sys/contrib/dev/acpica/compiler/aslprintf.c b/sys/contrib/dev/acpica/compiler/aslprintf.c
new file mode 100644
index 0000000..c8647ea
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/aslprintf.c
@@ -0,0 +1,380 @@
+/******************************************************************************
+ *
+ * Module Name: aslprintf - ASL Printf/Fprintf macro support
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
+#include "aslcompiler.y.h"
+#include <contrib/dev/acpica/include/amlcode.h>
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("aslprintf")
+
+
+/* Local prototypes */
+
+static void
+OpcCreateConcatenateNode (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_PARSE_OBJECT *Node);
+
+static void
+OpcParsePrintf (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_PARSE_OBJECT *DestOp);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: OpcDoPrintf
+ *
+ * PARAMETERS: Op - printf parse node
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Convert printf macro to a Store(..., Debug) AML operation.
+ *
+ ******************************************************************************/
+
+void
+OpcDoPrintf (
+ ACPI_PARSE_OBJECT *Op)
+{
+ ACPI_PARSE_OBJECT *DestOp;
+
+
+ /* Store destination is the Debug op */
+
+ DestOp = TrAllocateNode (PARSEOP_DEBUG);
+ DestOp->Asl.AmlOpcode = AML_DEBUG_OP;
+ DestOp->Asl.Parent = Op;
+ DestOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
+
+ OpcParsePrintf (Op, DestOp);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: OpcDoFprintf
+ *
+ * PARAMETERS: Op - fprintf parse node
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Convert fprintf macro to a Store AML operation.
+ *
+ ******************************************************************************/
+
+void
+OpcDoFprintf (
+ ACPI_PARSE_OBJECT *Op)
+{
+ ACPI_PARSE_OBJECT *DestOp;
+
+
+ /* Store destination is the first argument of fprintf */
+
+ DestOp = Op->Asl.Child;
+ Op->Asl.Child = DestOp->Asl.Next;
+ DestOp->Asl.Next = NULL;
+
+ OpcParsePrintf (Op, DestOp);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: OpcParsePrintf
+ *
+ * PARAMETERS: Op - Printf parse node
+ * DestOp - Destination of Store operation
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Convert printf macro to a Store AML operation. The printf
+ * macro parse tree is layed out as follows:
+ *
+ * Op - printf parse op
+ * Op->Child - Format string
+ * Op->Next - Format string arguments
+ *
+ ******************************************************************************/
+
+static void
+OpcParsePrintf (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_PARSE_OBJECT *DestOp)
+{
+ char *Format;
+ char *StartPosition = NULL;
+ ACPI_PARSE_OBJECT *ArgNode;
+ ACPI_PARSE_OBJECT *NextNode;
+ UINT32 StringLength = 0;
+ char *NewString;
+ BOOLEAN StringToProcess = FALSE;
+ ACPI_PARSE_OBJECT *NewOp;
+
+
+ /* Get format string */
+
+ Format = ACPI_CAST_PTR (char, Op->Asl.Child->Asl.Value.String);
+ ArgNode = Op->Asl.Child->Asl.Next;
+
+ /*
+ * Detach argument list so that we can use a NULL check to distinguish
+ * the first concatenation operation we need to make
+ */
+ Op->Asl.Child = NULL;
+
+ for (; *Format; ++Format)
+ {
+ if (*Format != '%')
+ {
+ if (!StringToProcess)
+ {
+ /* Mark the beginning of a string */
+
+ StartPosition = Format;
+ StringToProcess = TRUE;
+ }
+
+ ++StringLength;
+ continue;
+ }
+
+ /* Save string, if any, to new string object and concat it */
+
+ if (StringToProcess)
+ {
+ NewString = UtStringCacheCalloc (StringLength + 1);
+ ACPI_STRNCPY (NewString, StartPosition, StringLength);
+
+ NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
+ NewOp->Asl.Value.String = NewString;
+ NewOp->Asl.AmlOpcode = AML_STRING_OP;
+ NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING;
+ NewOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
+
+ OpcCreateConcatenateNode(Op, NewOp);
+
+ StringLength = 0;
+ StringToProcess = FALSE;
+ }
+
+ ++Format;
+
+ /*
+ * We have a format parameter and will need an argument to go
+ * with it
+ */
+ if (!ArgNode ||
+ ArgNode->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
+ {
+ AslError(ASL_ERROR, ASL_MSG_ARG_COUNT_LO, Op, NULL);
+ return;
+ }
+
+ /*
+ * We do not support sub-specifiers of printf (flags, width,
+ * precision, length). For specifiers we only support %x/%X for
+ * hex or %s for strings. Also, %o for generic "acpi object".
+ */
+ switch (*Format)
+ {
+ case 's':
+
+ if (ArgNode->Asl.ParseOpcode != PARSEOP_STRING_LITERAL)
+ {
+ AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgNode,
+ "String required");
+ return;
+ }
+
+ NextNode = ArgNode->Asl.Next;
+ ArgNode->Asl.Next = NULL;
+ OpcCreateConcatenateNode(Op, ArgNode);
+ ArgNode = NextNode;
+ continue;
+
+ case 'X':
+ case 'x':
+ case 'o':
+
+ NextNode = ArgNode->Asl.Next;
+ ArgNode->Asl.Next = NULL;
+
+ /*
+ * Append an empty string if the first argument is
+ * not a string. This will implicitly conver the 2nd
+ * concat source to a string per the ACPI specification.
+ */
+ if (!Op->Asl.Child)
+ {
+ NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
+ NewOp->Asl.Value.String = "";
+ NewOp->Asl.AmlOpcode = AML_STRING_OP;
+ NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING;
+ NewOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
+
+ OpcCreateConcatenateNode(Op, NewOp);
+ }
+
+ OpcCreateConcatenateNode(Op, ArgNode);
+ ArgNode = NextNode;
+ break;
+
+ default:
+
+ AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Op,
+ "Unrecognized format specifier");
+ continue;
+ }
+ }
+
+ /* Process any remaining string */
+
+ if (StringToProcess)
+ {
+ NewString = UtStringCacheCalloc (StringLength + 1);
+ ACPI_STRNCPY (NewString, StartPosition, StringLength);
+
+ NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
+ NewOp->Asl.Value.String = NewString;
+ NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING;
+ NewOp->Asl.AmlOpcode = AML_STRING_OP;
+ NewOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
+
+ OpcCreateConcatenateNode(Op, NewOp);
+ }
+
+ /*
+ * If we get here and there's no child node then Format
+ * was an empty string. Just make a no op.
+ */
+ if (!Op->Asl.Child)
+ {
+ Op->Asl.ParseOpcode = PARSEOP_NOOP;
+ AslError(ASL_WARNING, ASL_MSG_NULL_STRING, Op,
+ "Converted to NOOP");
+ return;
+ }
+
+ /* Check for erroneous extra arguments */
+
+ if (ArgNode &&
+ ArgNode->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
+ {
+ AslError(ASL_WARNING, ASL_MSG_ARG_COUNT_HI, ArgNode,
+ "Extra arguments ignored");
+ }
+
+ /* Change Op to a Store */
+
+ Op->Asl.ParseOpcode = PARSEOP_STORE;
+ Op->Common.AmlOpcode = AML_STORE_OP;
+ Op->Asl.CompileFlags = 0;
+
+ /* Disable further optimization */
+
+ Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
+ UtSetParseOpName (Op);
+
+ /* Set Store destination */
+
+ Op->Asl.Child->Asl.Next = DestOp;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: OpcCreateConcatenateNode
+ *
+ * PARAMETERS: Op - Parse node
+ * Node - Parse node to be concatenated
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Make Node the child of Op. If child node already exists, then
+ * concat child with Node and makes concat node the child of Op.
+ *
+ ******************************************************************************/
+
+static void
+OpcCreateConcatenateNode (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_PARSE_OBJECT *Node)
+{
+ ACPI_PARSE_OBJECT *NewConcatOp;
+
+
+ if (!Op->Asl.Child)
+ {
+ Op->Asl.Child = Node;
+ Node->Asl.Parent = Op;
+ return;
+ }
+
+ NewConcatOp = TrAllocateNode (PARSEOP_CONCATENATE);
+ NewConcatOp->Asl.AmlOpcode = AML_CONCAT_OP;
+ NewConcatOp->Asl.AcpiBtype = 0x7;
+ NewConcatOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
+
+ /* First arg is child of Op*/
+
+ NewConcatOp->Asl.Child = Op->Asl.Child;
+ Op->Asl.Child->Asl.Parent = NewConcatOp;
+
+ /* Second arg is Node */
+
+ NewConcatOp->Asl.Child->Asl.Next = Node;
+ Node->Asl.Parent = NewConcatOp;
+
+ /* Third arg is Zero (not used) */
+
+ NewConcatOp->Asl.Child->Asl.Next->Asl.Next =
+ TrAllocateNode (PARSEOP_ZERO);
+ NewConcatOp->Asl.Child->Asl.Next->Asl.Next->Asl.Parent =
+ NewConcatOp;
+
+ Op->Asl.Child = NewConcatOp;
+ NewConcatOp->Asl.Parent = Op;
+}
diff --git a/sys/contrib/dev/acpica/compiler/aslprune.c b/sys/contrib/dev/acpica/compiler/aslprune.c
new file mode 100644
index 0000000..1a36928
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/aslprune.c
@@ -0,0 +1,239 @@
+/******************************************************************************
+ *
+ * Module Name: aslprune - Parse tree prune utility
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
+#include "aslcompiler.y.h"
+#include <contrib/dev/acpica/include/acapps.h>
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("aslprune")
+
+
+/* Local prototypes */
+
+static ACPI_STATUS
+PrTreePruneWalk (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 Level,
+ void *Context);
+
+static void
+PrPrintObjectAtLevel (
+ UINT32 Level,
+ const char *ObjectName);
+
+
+typedef struct acpi_prune_info
+{
+ UINT32 PruneLevel;
+ UINT16 ParseOpcode;
+ UINT16 Count;
+
+} ACPI_PRUNE_INFO;
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AslPruneParseTree
+ *
+ * PARAMETERS: PruneDepth - Number of levels to prune
+ * Type - Prune type (Device, Method, etc.)
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Prune off one or more levels of the ASL parse tree
+ *
+ ******************************************************************************/
+
+void
+AslPruneParseTree (
+ UINT32 PruneDepth,
+ UINT32 Type)
+{
+ ACPI_PRUNE_INFO PruneObj;
+
+
+ PruneObj.PruneLevel = PruneDepth;
+ PruneObj.Count = 0;
+
+ switch (Type)
+ {
+ case 0:
+ PruneObj.ParseOpcode = (UINT16) PARSEOP_DEVICE;
+ break;
+
+ case 1:
+ PruneObj.ParseOpcode = (UINT16) PARSEOP_METHOD;
+ break;
+
+ case 2:
+ PruneObj.ParseOpcode = (UINT16) PARSEOP_IF;
+ break;
+
+ default:
+ AcpiOsPrintf ("Unsupported type: %u\n", Type);
+ return;
+ }
+
+ AcpiOsPrintf ("Pruning parse tree, from depth %u\n",
+ PruneDepth);
+
+ AcpiOsPrintf ("\nRemoving Objects:\n");
+
+ TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
+ PrTreePruneWalk, NULL, ACPI_CAST_PTR (void, &PruneObj));
+
+ AcpiOsPrintf ("\n%u Total Objects Removed\n", PruneObj.Count);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: PrPrintObjectAtLevel
+ *
+ * PARAMETERS: Level - Current nesting level
+ * ObjectName - ACPI name for the object
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Print object name with indent
+ *
+ ******************************************************************************/
+
+static void
+PrPrintObjectAtLevel (
+ UINT32 Level,
+ const char *ObjectName)
+{
+ UINT32 i;
+
+
+ for (i = 0; i < Level; i++)
+ {
+ AcpiOsPrintf (" ");
+ }
+
+ AcpiOsPrintf ("[%s] at Level [%u]\n", ObjectName, Level);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: PrTreePruneWalk
+ *
+ * PARAMETERS: Parse tree walk callback
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Prune off one or more levels of the ASL parse tree
+ *
+ * Current objects that can be pruned are: Devices, Methods, and If/Else
+ * blocks.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+PrTreePruneWalk (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 Level,
+ void *Context)
+{
+ ACPI_PRUNE_INFO *PruneObj = (ACPI_PRUNE_INFO *) Context;
+
+
+ /* We only care about objects below the Prune Level threshold */
+
+ if (Level <= PruneObj->PruneLevel)
+ {
+ return (AE_OK);
+ }
+
+ if ((Op->Asl.ParseOpcode != PruneObj->ParseOpcode) &&
+ !(Op->Asl.ParseOpcode == PARSEOP_ELSE &&
+ PruneObj->ParseOpcode == PARSEOP_IF))
+ {
+ return (AE_OK);
+ }
+
+ switch (Op->Asl.ParseOpcode)
+ {
+ case PARSEOP_METHOD:
+
+ AcpiOsPrintf ("Method");
+ PrPrintObjectAtLevel (Level, Op->Asl.Child->Asl.Value.Name);
+ Op->Asl.Child->Asl.Next->Asl.Next->Asl.Next->Asl.Next->Asl.Next->Asl.Next = NULL;
+ PruneObj->Count++;
+ break;
+
+ case PARSEOP_DEVICE:
+
+ AcpiOsPrintf ("Device");
+ PrPrintObjectAtLevel (Level, Op->Asl.Child->Asl.Value.Name);
+ Op->Asl.Child->Asl.Next = NULL;
+ PruneObj->Count++;
+ break;
+
+ case PARSEOP_IF:
+ case PARSEOP_ELSE:
+
+ if (Op->Asl.ParseOpcode == PARSEOP_ELSE)
+ {
+ PrPrintObjectAtLevel(Level, "Else");
+ Op->Asl.Child = NULL;
+ }
+ else
+ {
+ PrPrintObjectAtLevel(Level, "If");
+ Op->Asl.Child->Asl.Next = NULL;
+ }
+
+ PruneObj->Count++;
+ break;
+
+ default:
+
+ break;
+ }
+
+ return (AE_OK);
+}
diff --git a/sys/contrib/dev/acpica/compiler/aslresource.c b/sys/contrib/dev/acpica/compiler/aslresource.c
index 0a95a90..5f513d7 100644
--- a/sys/contrib/dev/acpica/compiler/aslresource.c
+++ b/sys/contrib/dev/acpica/compiler/aslresource.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@@ -123,22 +122,10 @@ RsSmallAddressCheck (
return;
}
- /* Special case for Memory24, values are compressed */
-
- if (Type == ACPI_RESOURCE_NAME_MEMORY24)
- {
- if (!Alignment) /* Alignment==0 means 64K - no invalid alignment */
- {
- Alignment = ACPI_UINT16_MAX + 1;
- }
-
- Minimum <<= 8;
- Maximum <<= 8;
- Length *= 256;
- }
-
- /* IO descriptor has different definition of min/max, don't check */
-
+ /*
+ * Range checks for Memory24 and Memory32.
+ * IO descriptor has different definition of min/max, don't check.
+ */
if (Type != ACPI_RESOURCE_NAME_IO)
{
/* Basic checks on Min/Max/Length */
@@ -151,6 +138,19 @@ RsSmallAddressCheck (
{
AslError (ASL_ERROR, ASL_MSG_INVALID_LENGTH, LengthOp, NULL);
}
+
+ /* Special case for Memory24, min/max values are compressed */
+
+ if (Type == ACPI_RESOURCE_NAME_MEMORY24)
+ {
+ if (!Alignment) /* Alignment==0 means 64K alignment */
+ {
+ Alignment = ACPI_UINT16_MAX + 1;
+ }
+
+ Minimum <<= 8;
+ Maximum <<= 8;
+ }
}
/* Alignment of zero is not in ACPI spec, but is used to mean byte acc */
@@ -645,8 +645,7 @@ RsCheckListForDuplicates (
ASL_RESOURCE_NODE *
RsDoOneResourceDescriptor (
- ACPI_PARSE_OBJECT *DescriptorTypeOp,
- UINT32 CurrentByteOffset,
+ ASL_RESOURCE_INFO *Info,
UINT8 *State)
{
ASL_RESOURCE_NODE *Rnode = NULL;
@@ -654,36 +653,31 @@ RsDoOneResourceDescriptor (
/* Construct the resource */
- switch (DescriptorTypeOp->Asl.ParseOpcode)
+ switch (Info->DescriptorTypeOp->Asl.ParseOpcode)
{
case PARSEOP_DMA:
- Rnode = RsDoDmaDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoDmaDescriptor (Info);
break;
case PARSEOP_FIXEDDMA:
- Rnode = RsDoFixedDmaDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoFixedDmaDescriptor (Info);
break;
case PARSEOP_DWORDIO:
- Rnode = RsDoDwordIoDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoDwordIoDescriptor (Info);
break;
case PARSEOP_DWORDMEMORY:
- Rnode = RsDoDwordMemoryDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoDwordMemoryDescriptor (Info);
break;
case PARSEOP_DWORDSPACE:
- Rnode = RsDoDwordSpaceDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoDwordSpaceDescriptor (Info);
break;
case PARSEOP_ENDDEPENDENTFN:
@@ -693,13 +687,13 @@ RsDoOneResourceDescriptor (
case ACPI_RSTATE_NORMAL:
AslError (ASL_ERROR, ASL_MSG_MISSING_STARTDEPENDENT,
- DescriptorTypeOp, NULL);
+ Info->DescriptorTypeOp, NULL);
break;
case ACPI_RSTATE_START_DEPENDENT:
AslError (ASL_ERROR, ASL_MSG_DEPENDENT_NESTING,
- DescriptorTypeOp, NULL);
+ Info->DescriptorTypeOp, NULL);
break;
case ACPI_RSTATE_DEPENDENT_LIST:
@@ -709,104 +703,87 @@ RsDoOneResourceDescriptor (
}
*State = ACPI_RSTATE_NORMAL;
- Rnode = RsDoEndDependentDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoEndDependentDescriptor (Info);
break;
case PARSEOP_ENDTAG:
- Rnode = RsDoEndTagDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoEndTagDescriptor (Info);
break;
case PARSEOP_EXTENDEDIO:
- Rnode = RsDoExtendedIoDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoExtendedIoDescriptor (Info);
break;
case PARSEOP_EXTENDEDMEMORY:
- Rnode = RsDoExtendedMemoryDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoExtendedMemoryDescriptor (Info);
break;
case PARSEOP_EXTENDEDSPACE:
- Rnode = RsDoExtendedSpaceDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoExtendedSpaceDescriptor (Info);
break;
case PARSEOP_FIXEDIO:
- Rnode = RsDoFixedIoDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoFixedIoDescriptor (Info);
break;
case PARSEOP_INTERRUPT:
- Rnode = RsDoInterruptDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoInterruptDescriptor (Info);
break;
case PARSEOP_IO:
- Rnode = RsDoIoDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoIoDescriptor (Info);
break;
case PARSEOP_IRQ:
- Rnode = RsDoIrqDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoIrqDescriptor (Info);
break;
case PARSEOP_IRQNOFLAGS:
- Rnode = RsDoIrqNoFlagsDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoIrqNoFlagsDescriptor (Info);
break;
case PARSEOP_MEMORY24:
- Rnode = RsDoMemory24Descriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoMemory24Descriptor (Info);
break;
case PARSEOP_MEMORY32:
- Rnode = RsDoMemory32Descriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoMemory32Descriptor (Info);
break;
case PARSEOP_MEMORY32FIXED:
- Rnode = RsDoMemory32FixedDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoMemory32FixedDescriptor (Info);
break;
case PARSEOP_QWORDIO:
- Rnode = RsDoQwordIoDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoQwordIoDescriptor (Info);
break;
case PARSEOP_QWORDMEMORY:
- Rnode = RsDoQwordMemoryDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoQwordMemoryDescriptor (Info);
break;
case PARSEOP_QWORDSPACE:
- Rnode = RsDoQwordSpaceDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoQwordSpaceDescriptor (Info);
break;
case PARSEOP_REGISTER:
- Rnode = RsDoGeneralRegisterDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoGeneralRegisterDescriptor (Info);
break;
case PARSEOP_STARTDEPENDENTFN:
@@ -816,7 +793,7 @@ RsDoOneResourceDescriptor (
case ACPI_RSTATE_START_DEPENDENT:
AslError (ASL_ERROR, ASL_MSG_DEPENDENT_NESTING,
- DescriptorTypeOp, NULL);
+ Info->DescriptorTypeOp, NULL);
break;
case ACPI_RSTATE_NORMAL:
@@ -827,8 +804,7 @@ RsDoOneResourceDescriptor (
}
*State = ACPI_RSTATE_START_DEPENDENT;
- Rnode = RsDoStartDependentDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoStartDependentDescriptor (Info);
*State = ACPI_RSTATE_DEPENDENT_LIST;
break;
@@ -839,7 +815,7 @@ RsDoOneResourceDescriptor (
case ACPI_RSTATE_START_DEPENDENT:
AslError (ASL_ERROR, ASL_MSG_DEPENDENT_NESTING,
- DescriptorTypeOp, NULL);
+ Info->DescriptorTypeOp, NULL);
break;
case ACPI_RSTATE_NORMAL:
@@ -850,69 +826,58 @@ RsDoOneResourceDescriptor (
}
*State = ACPI_RSTATE_START_DEPENDENT;
- Rnode = RsDoStartDependentNoPriDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoStartDependentNoPriDescriptor (Info);
*State = ACPI_RSTATE_DEPENDENT_LIST;
break;
case PARSEOP_VENDORLONG:
- Rnode = RsDoVendorLargeDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoVendorLargeDescriptor (Info);
break;
case PARSEOP_VENDORSHORT:
- Rnode = RsDoVendorSmallDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoVendorSmallDescriptor (Info);
break;
case PARSEOP_WORDBUSNUMBER:
- Rnode = RsDoWordBusNumberDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoWordBusNumberDescriptor (Info);
break;
case PARSEOP_WORDIO:
- Rnode = RsDoWordIoDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoWordIoDescriptor (Info);
break;
case PARSEOP_WORDSPACE:
- Rnode = RsDoWordSpaceDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoWordSpaceDescriptor (Info);
break;
case PARSEOP_GPIO_INT:
- Rnode = RsDoGpioIntDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoGpioIntDescriptor (Info);
break;
case PARSEOP_GPIO_IO:
- Rnode = RsDoGpioIoDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoGpioIoDescriptor (Info);
break;
case PARSEOP_I2C_SERIALBUS:
- Rnode = RsDoI2cSerialBusDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoI2cSerialBusDescriptor (Info);
break;
case PARSEOP_SPI_SERIALBUS:
- Rnode = RsDoSpiSerialBusDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoSpiSerialBusDescriptor (Info);
break;
case PARSEOP_UART_SERIALBUS:
- Rnode = RsDoUartSerialBusDescriptor (DescriptorTypeOp,
- CurrentByteOffset);
+ Rnode = RsDoUartSerialBusDescriptor (Info);
break;
case PARSEOP_DEFAULT_ARG:
@@ -923,7 +888,7 @@ RsDoOneResourceDescriptor (
default:
printf ("Unknown resource descriptor type [%s]\n",
- DescriptorTypeOp->Asl.ParseOpName);
+ Info->DescriptorTypeOp->Asl.ParseOpName);
break;
}
@@ -932,14 +897,14 @@ RsDoOneResourceDescriptor (
* This allows the resource to be installed in the namespace so that
* references to the descriptor can be resolved.
*/
- DescriptorTypeOp->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
- DescriptorTypeOp->Asl.CompileFlags = NODE_IS_RESOURCE_DESC;
- DescriptorTypeOp->Asl.Value.Integer = CurrentByteOffset;
+ Info->DescriptorTypeOp->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
+ Info->DescriptorTypeOp->Asl.CompileFlags = NODE_IS_RESOURCE_DESC;
+ Info->DescriptorTypeOp->Asl.Value.Integer = Info->CurrentByteOffset;
if (Rnode)
{
- DescriptorTypeOp->Asl.FinalAmlLength = Rnode->BufferLength;
- DescriptorTypeOp->Asl.Extra = ((AML_RESOURCE *) Rnode->Buffer)->DescriptorType;
+ Info->DescriptorTypeOp->Asl.FinalAmlLength = Rnode->BufferLength;
+ Info->DescriptorTypeOp->Asl.Extra = ((AML_RESOURCE *) Rnode->Buffer)->DescriptorType;
}
return (Rnode);
@@ -1023,6 +988,7 @@ RsDoResourceTemplate (
ASL_RESOURCE_NODE HeadRnode;
ASL_RESOURCE_NODE *PreviousRnode;
ASL_RESOURCE_NODE *Rnode;
+ ASL_RESOURCE_INFO Info;
UINT8 State;
@@ -1055,9 +1021,22 @@ RsDoResourceTemplate (
PreviousRnode = &HeadRnode;
while (DescriptorTypeOp)
{
+ /* Save information for optional mapfile */
+
+ if (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONNECTION)
+ {
+ Info.MappingOp = Op->Asl.Parent;
+ }
+ else
+ {
+ Info.MappingOp = DescriptorTypeOp;
+ }
+
+ Info.DescriptorTypeOp = DescriptorTypeOp;
+ Info.CurrentByteOffset = CurrentByteOffset;
+
DescriptorTypeOp->Asl.CompileFlags |= NODE_IS_RESOURCE_DESC;
- Rnode = RsDoOneResourceDescriptor (DescriptorTypeOp, CurrentByteOffset,
- &State);
+ Rnode = RsDoOneResourceDescriptor (&Info, &State);
/*
* Update current byte offset to indicate the number of bytes from the
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype1.c b/sys/contrib/dev/acpica/compiler/aslrestype1.c
index 21a8705..4ac0635 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype1.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype1.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@@ -65,9 +64,7 @@
*
* FUNCTION: RsDoEndTagDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -77,8 +74,7 @@
ASL_RESOURCE_NODE *
RsDoEndTagDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ASL_RESOURCE_NODE *Rnode;
@@ -99,9 +95,7 @@ RsDoEndTagDescriptor (
*
* FUNCTION: RsDoEndDependentDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -111,8 +105,7 @@ RsDoEndTagDescriptor (
ASL_RESOURCE_NODE *
RsDoEndDependentDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ASL_RESOURCE_NODE *Rnode;
@@ -131,9 +124,7 @@ RsDoEndDependentDescriptor (
*
* FUNCTION: RsDoMemory24Descriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -143,8 +134,7 @@ RsDoEndDependentDescriptor (
ASL_RESOURCE_NODE *
RsDoMemory24Descriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -152,10 +142,12 @@ RsDoMemory24Descriptor (
ACPI_PARSE_OBJECT *MaxOp = NULL;
ACPI_PARSE_OBJECT *LengthOp = NULL;
ASL_RESOURCE_NODE *Rnode;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_MEMORY24));
Descriptor = Rnode->Buffer;
@@ -208,7 +200,7 @@ RsDoMemory24Descriptor (
case 5: /* Name */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -227,7 +219,7 @@ RsDoMemory24Descriptor (
Descriptor->Memory24.Maximum,
Descriptor->Memory24.AddressLength,
Descriptor->Memory24.Alignment,
- MinOp, MaxOp, LengthOp, NULL, Op);
+ MinOp, MaxOp, LengthOp, NULL, Info->DescriptorTypeOp);
return (Rnode);
}
@@ -237,9 +229,7 @@ RsDoMemory24Descriptor (
*
* FUNCTION: RsDoMemory32Descriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -249,8 +239,7 @@ RsDoMemory24Descriptor (
ASL_RESOURCE_NODE *
RsDoMemory32Descriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -259,10 +248,12 @@ RsDoMemory32Descriptor (
ACPI_PARSE_OBJECT *LengthOp = NULL;
ACPI_PARSE_OBJECT *AlignOp = NULL;
ASL_RESOURCE_NODE *Rnode;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_MEMORY32));
Descriptor = Rnode->Buffer;
@@ -316,7 +307,7 @@ RsDoMemory32Descriptor (
case 5: /* Name */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -335,7 +326,7 @@ RsDoMemory32Descriptor (
Descriptor->Memory32.Maximum,
Descriptor->Memory32.AddressLength,
Descriptor->Memory32.Alignment,
- MinOp, MaxOp, LengthOp, AlignOp, Op);
+ MinOp, MaxOp, LengthOp, AlignOp, Info->DescriptorTypeOp);
return (Rnode);
}
@@ -345,9 +336,7 @@ RsDoMemory32Descriptor (
*
* FUNCTION: RsDoMemory32FixedDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -357,16 +346,17 @@ RsDoMemory32Descriptor (
ASL_RESOURCE_NODE *
RsDoMemory32FixedDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_MEMORY32));
Descriptor = Rnode->Buffer;
@@ -402,7 +392,7 @@ RsDoMemory32FixedDescriptor (
case 3: /* Name */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -422,9 +412,7 @@ RsDoMemory32FixedDescriptor (
*
* FUNCTION: RsDoStartDependentDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -434,19 +422,21 @@ RsDoMemory32FixedDescriptor (
ASL_RESOURCE_NODE *
RsDoStartDependentDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
ASL_RESOURCE_NODE *PreviousRnode;
ASL_RESOURCE_NODE *NextRnode;
+ ASL_RESOURCE_INFO NextInfo;
+ UINT32 CurrentByteOffset;
UINT32 i;
UINT8 State;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_START_DEPENDENT));
PreviousRnode = Rnode;
@@ -492,8 +482,10 @@ RsDoStartDependentDescriptor (
default:
- NextRnode = RsDoOneResourceDescriptor (InitializerOp,
- CurrentByteOffset, &State);
+ NextInfo.CurrentByteOffset = CurrentByteOffset;
+ NextInfo.DescriptorTypeOp = InitializerOp;
+
+ NextRnode = RsDoOneResourceDescriptor (&NextInfo, &State);
/*
* Update current byte offset to indicate the number of bytes from the
@@ -517,9 +509,7 @@ RsDoStartDependentDescriptor (
*
* FUNCTION: RsDoStartDependentNoPriDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -529,18 +519,20 @@ RsDoStartDependentDescriptor (
ASL_RESOURCE_NODE *
RsDoStartDependentNoPriDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
ASL_RESOURCE_NODE *PreviousRnode;
ASL_RESOURCE_NODE *NextRnode;
+ ASL_RESOURCE_INFO NextInfo;
+ UINT32 CurrentByteOffset;
UINT8 State;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_START_DEPENDENT_NOPRIO));
Descriptor = Rnode->Buffer;
@@ -557,8 +549,10 @@ RsDoStartDependentNoPriDescriptor (
State = ACPI_RSTATE_START_DEPENDENT;
while (InitializerOp)
{
- NextRnode = RsDoOneResourceDescriptor (InitializerOp,
- CurrentByteOffset, &State);
+ NextInfo.CurrentByteOffset = CurrentByteOffset;
+ NextInfo.DescriptorTypeOp = InitializerOp;
+
+ NextRnode = RsDoOneResourceDescriptor (&NextInfo, &State);
/*
* Update current byte offset to indicate the number of bytes from the
@@ -579,9 +573,7 @@ RsDoStartDependentNoPriDescriptor (
*
* FUNCTION: RsDoVendorSmallDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -591,8 +583,7 @@ RsDoStartDependentNoPriDescriptor (
ASL_RESOURCE_NODE *
RsDoVendorSmallDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -601,7 +592,7 @@ RsDoVendorSmallDescriptor (
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
/* Allocate worst case - 7 vendor bytes */
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype1i.c b/sys/contrib/dev/acpica/compiler/aslrestype1i.c
index 4e78c2c..36e2400 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype1i.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype1i.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@@ -63,9 +62,7 @@
*
* FUNCTION: RsDoDmaDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -75,18 +72,19 @@
ASL_RESOURCE_NODE *
RsDoDmaDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
+ UINT32 CurrentByteOffset;
UINT32 i;
UINT8 DmaChannelMask = 0;
UINT8 DmaChannels = 0;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_DMA));
Descriptor = Rnode->Buffer;
@@ -122,7 +120,7 @@ RsDoDmaDescriptor (
case 3: /* Name */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -184,9 +182,7 @@ RsDoDmaDescriptor (
*
* FUNCTION: RsDoFixedDmaDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -196,16 +192,17 @@ RsDoDmaDescriptor (
ASL_RESOURCE_NODE *
RsDoFixedDmaDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_DMA));
Descriptor = Rnode->Buffer;
@@ -241,7 +238,7 @@ RsDoFixedDmaDescriptor (
case 3: /* Descriptor Name (optional) */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default: /* Ignore any extra nodes */
@@ -260,9 +257,7 @@ RsDoFixedDmaDescriptor (
*
* FUNCTION: RsDoFixedIoDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -272,17 +267,18 @@ RsDoFixedDmaDescriptor (
ASL_RESOURCE_NODE *
RsDoFixedIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ACPI_PARSE_OBJECT *AddressOp = NULL;
ASL_RESOURCE_NODE *Rnode;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_IO));
Descriptor = Rnode->Buffer;
@@ -314,7 +310,7 @@ RsDoFixedIoDescriptor (
case 2: /* Name */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -341,9 +337,7 @@ RsDoFixedIoDescriptor (
*
* FUNCTION: RsDoIoDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -353,8 +347,7 @@ RsDoFixedIoDescriptor (
ASL_RESOURCE_NODE *
RsDoIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -363,10 +356,12 @@ RsDoIoDescriptor (
ACPI_PARSE_OBJECT *LengthOp = NULL;
ACPI_PARSE_OBJECT *AlignOp = NULL;
ASL_RESOURCE_NODE *Rnode;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_IO));
Descriptor = Rnode->Buffer;
@@ -424,7 +419,7 @@ RsDoIoDescriptor (
case 5: /* Name */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -443,7 +438,7 @@ RsDoIoDescriptor (
Descriptor->Io.Maximum,
Descriptor->Io.AddressLength,
Descriptor->Io.Alignment,
- MinOp, MaxOp, LengthOp, AlignOp, Op);
+ MinOp, MaxOp, LengthOp, AlignOp, Info->DescriptorTypeOp);
return (Rnode);
}
@@ -453,9 +448,7 @@ RsDoIoDescriptor (
*
* FUNCTION: RsDoIrqDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -465,18 +458,19 @@ RsDoIoDescriptor (
ASL_RESOURCE_NODE *
RsDoIrqDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
UINT32 Interrupts = 0;
UINT16 IrqMask = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_IRQ));
/* Length = 3 (with flag byte) */
@@ -514,7 +508,7 @@ RsDoIrqDescriptor (
case 3: /* Name */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -576,9 +570,7 @@ RsDoIrqDescriptor (
*
* FUNCTION: RsDoIrqNoFlagsDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -588,18 +580,19 @@ RsDoIrqDescriptor (
ASL_RESOURCE_NODE *
RsDoIrqNoFlagsDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
UINT16 IrqMask = 0;
UINT32 Interrupts = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_IRQ_NOFLAGS));
Descriptor = Rnode->Buffer;
@@ -614,7 +607,7 @@ RsDoIrqNoFlagsDescriptor (
{
case 0: /* Name */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2.c b/sys/contrib/dev/acpica/compiler/aslrestype2.c
index 942d45e..af93a9e 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@@ -61,9 +60,7 @@
*
* FUNCTION: RsDoGeneralRegisterDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -73,16 +70,17 @@
ASL_RESOURCE_NODE *
RsDoGeneralRegisterDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_GENERIC_REGISTER));
Descriptor = Rnode->Buffer;
@@ -138,7 +136,7 @@ RsDoGeneralRegisterDescriptor (
case 5: /* ResourceTag (ACPI 3.0b) */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -157,9 +155,7 @@ RsDoGeneralRegisterDescriptor (
*
* FUNCTION: RsDoInterruptDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -169,8 +165,7 @@ RsDoGeneralRegisterDescriptor (
ASL_RESOURCE_NODE *
RsDoInterruptDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
AML_RESOURCE *Rover = NULL;
@@ -178,13 +173,15 @@ RsDoInterruptDescriptor (
ASL_RESOURCE_NODE *Rnode;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN HasResSourceIndex = FALSE;
UINT8 ResSourceIndex = 0;
UINT8 *ResSourceString = NULL;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
StringLength = RsGetStringDataLength (InitializerOp);
/* Count the interrupt numbers */
@@ -211,9 +208,9 @@ RsDoInterruptDescriptor (
OptionIndex += 4;
}
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_EXTENDED_IRQ) +
- 1 + OptionIndex + StringLength);
+ 1 + OptionIndex + StringLength);
Descriptor = Rnode->Buffer;
Descriptor->ExtendedIrq.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_IRQ;
@@ -303,7 +300,7 @@ RsDoInterruptDescriptor (
case 6: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -396,9 +393,7 @@ RsDoInterruptDescriptor (
*
* FUNCTION: RsDoVendorLargeDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -408,8 +403,7 @@ RsDoInterruptDescriptor (
ASL_RESOURCE_NODE *
RsDoVendorLargeDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -420,7 +414,7 @@ RsDoVendorLargeDescriptor (
/* Count the number of data bytes */
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
for (i = 0; InitializerOp; i++)
@@ -432,7 +426,7 @@ RsDoVendorLargeDescriptor (
InitializerOp = InitializerOp->Asl.Next;
}
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_VENDOR_LARGE) + i);
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2d.c b/sys/contrib/dev/acpica/compiler/aslrestype2d.c
index 035b6ec..25cbed9 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2d.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2d.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@@ -60,9 +59,7 @@
*
* FUNCTION: RsDoDwordIoDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -72,8 +69,7 @@
ASL_RESOURCE_NODE *
RsDoDwordIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -85,12 +81,14 @@ RsDoDwordIoDescriptor (
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
UINT8 *OptionalFields;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
@@ -245,7 +243,7 @@ RsDoDwordIoDescriptor (
case 12: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 13: /* Type */
@@ -279,10 +277,10 @@ RsDoDwordIoDescriptor (
(UINT64) Descriptor->Address32.AddressLength,
(UINT64) Descriptor->Address32.Granularity,
Descriptor->Address32.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
- OptionIndex + StringLength;
+ OptionIndex + StringLength;
return (Rnode);
}
@@ -291,9 +289,7 @@ RsDoDwordIoDescriptor (
*
* FUNCTION: RsDoDwordMemoryDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -303,8 +299,7 @@ RsDoDwordIoDescriptor (
ASL_RESOURCE_NODE *
RsDoDwordMemoryDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -316,12 +311,14 @@ RsDoDwordMemoryDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
@@ -480,7 +477,7 @@ RsDoDwordMemoryDescriptor (
case 13: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
@@ -515,10 +512,10 @@ RsDoDwordMemoryDescriptor (
(UINT64) Descriptor->Address32.AddressLength,
(UINT64) Descriptor->Address32.Granularity,
Descriptor->Address32.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
- OptionIndex + StringLength;
+ OptionIndex + StringLength;
return (Rnode);
}
@@ -527,9 +524,7 @@ RsDoDwordMemoryDescriptor (
*
* FUNCTION: RsDoDwordSpaceDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -539,8 +534,7 @@ RsDoDwordMemoryDescriptor (
ASL_RESOURCE_NODE *
RsDoDwordSpaceDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -552,12 +546,14 @@ RsDoDwordSpaceDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
@@ -712,7 +708,7 @@ RsDoDwordSpaceDescriptor (
case 13: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -733,9 +729,9 @@ RsDoDwordSpaceDescriptor (
(UINT64) Descriptor->Address32.AddressLength,
(UINT64) Descriptor->Address32.Granularity,
Descriptor->Address32.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
- OptionIndex + StringLength;
+ OptionIndex + StringLength;
return (Rnode);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2e.c b/sys/contrib/dev/acpica/compiler/aslrestype2e.c
index 5621762..ddb7ea3 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2e.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2e.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#define _COMPONENT ACPI_COMPILER
@@ -59,9 +58,7 @@
*
* FUNCTION: RsDoExtendedIoDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -71,8 +68,7 @@
ASL_RESOURCE_NODE *
RsDoExtendedIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -82,11 +78,13 @@ RsDoExtendedIoDescriptor (
ACPI_PARSE_OBJECT *GranOp = NULL;
ASL_RESOURCE_NODE *Rnode;
UINT16 StringLength = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
@@ -187,7 +185,7 @@ RsDoExtendedIoDescriptor (
case 11: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 12: /* Type */
@@ -221,9 +219,10 @@ RsDoExtendedIoDescriptor (
Descriptor->ExtAddress64.AddressLength,
Descriptor->ExtAddress64.Granularity,
Descriptor->ExtAddress64.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
- Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
+ Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) +
+ StringLength;
return (Rnode);
}
@@ -232,9 +231,7 @@ RsDoExtendedIoDescriptor (
*
* FUNCTION: RsDoExtendedMemoryDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -244,8 +241,7 @@ RsDoExtendedIoDescriptor (
ASL_RESOURCE_NODE *
RsDoExtendedMemoryDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -255,11 +251,13 @@ RsDoExtendedMemoryDescriptor (
ACPI_PARSE_OBJECT *GranOp = NULL;
ASL_RESOURCE_NODE *Rnode;
UINT16 StringLength = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
@@ -367,7 +365,7 @@ RsDoExtendedMemoryDescriptor (
case 12: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
@@ -402,9 +400,10 @@ RsDoExtendedMemoryDescriptor (
Descriptor->ExtAddress64.AddressLength,
Descriptor->ExtAddress64.Granularity,
Descriptor->ExtAddress64.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
- Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
+ Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) +
+ StringLength;
return (Rnode);
}
@@ -413,9 +412,7 @@ RsDoExtendedMemoryDescriptor (
*
* FUNCTION: RsDoExtendedSpaceDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -425,8 +422,7 @@ RsDoExtendedMemoryDescriptor (
ASL_RESOURCE_NODE *
RsDoExtendedSpaceDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -436,11 +432,13 @@ RsDoExtendedSpaceDescriptor (
ACPI_PARSE_OBJECT *GranOp = NULL;
ASL_RESOURCE_NODE *Rnode;
UINT16 StringLength = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
@@ -545,7 +543,7 @@ RsDoExtendedSpaceDescriptor (
case 12: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -565,8 +563,9 @@ RsDoExtendedSpaceDescriptor (
Descriptor->ExtAddress64.AddressLength,
Descriptor->ExtAddress64.Granularity,
Descriptor->ExtAddress64.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
- Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
+ Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) +
+ StringLength;
return (Rnode);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2q.c b/sys/contrib/dev/acpica/compiler/aslrestype2q.c
index 3a002a4..16398e5 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2q.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2q.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@@ -60,9 +59,7 @@
*
* FUNCTION: RsDoQwordIoDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -72,8 +69,7 @@
ASL_RESOURCE_NODE *
RsDoQwordIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -85,12 +81,14 @@ RsDoQwordIoDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
@@ -236,7 +234,7 @@ RsDoQwordIoDescriptor (
case 12: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 13: /* Type */
@@ -270,10 +268,10 @@ RsDoQwordIoDescriptor (
Descriptor->Address64.AddressLength,
Descriptor->Address64.Granularity,
Descriptor->Address64.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
- OptionIndex + StringLength;
+ OptionIndex + StringLength;
return (Rnode);
}
@@ -282,9 +280,7 @@ RsDoQwordIoDescriptor (
*
* FUNCTION: RsDoQwordMemoryDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -294,8 +290,7 @@ RsDoQwordIoDescriptor (
ASL_RESOURCE_NODE *
RsDoQwordMemoryDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -307,12 +302,14 @@ RsDoQwordMemoryDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
@@ -465,7 +462,7 @@ RsDoQwordMemoryDescriptor (
case 13: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
@@ -500,10 +497,10 @@ RsDoQwordMemoryDescriptor (
Descriptor->Address64.AddressLength,
Descriptor->Address64.Granularity,
Descriptor->Address64.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
- OptionIndex + StringLength;
+ OptionIndex + StringLength;
return (Rnode);
}
@@ -512,9 +509,7 @@ RsDoQwordMemoryDescriptor (
*
* FUNCTION: RsDoQwordSpaceDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -524,8 +519,7 @@ RsDoQwordMemoryDescriptor (
ASL_RESOURCE_NODE *
RsDoQwordSpaceDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -537,12 +531,14 @@ RsDoQwordSpaceDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
@@ -692,7 +688,7 @@ RsDoQwordSpaceDescriptor (
case 13: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -712,9 +708,9 @@ RsDoQwordSpaceDescriptor (
Descriptor->Address64.AddressLength,
Descriptor->Address64.Granularity,
Descriptor->Address64.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
- OptionIndex + StringLength;
+ OptionIndex + StringLength;
return (Rnode);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2s.c b/sys/contrib/dev/acpica/compiler/aslrestype2s.c
index 96be2ad..73680c2 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2s.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2s.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@@ -268,9 +267,7 @@ RsGetVendorData (
*
* FUNCTION: RsDoGpioIntDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -280,8 +277,7 @@ RsGetVendorData (
ASL_RESOURCE_NODE *
RsDoGpioIntDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -289,14 +285,18 @@ RsDoGpioIntDescriptor (
char *ResourceSource = NULL;
UINT8 *VendorData = NULL;
UINT16 *InterruptList = NULL;
+ UINT16 *PinList = NULL;
UINT16 ResSourceLength;
UINT16 VendorLength;
UINT16 InterruptLength;
UINT16 DescriptorSize;
+ UINT32 CurrentByteOffset;
+ UINT32 PinCount = 0;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
/*
* Calculate lengths for fields that have variable length:
@@ -324,6 +324,7 @@ RsDoGpioIntDescriptor (
/* Build pointers to optional areas */
InterruptList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_GPIO));
+ PinList = InterruptList;
ResourceSource = ACPI_ADD_PTR (char, InterruptList, InterruptLength);
VendorData = ACPI_ADD_PTR (UINT8, ResourceSource, ResSourceLength);
@@ -407,7 +408,7 @@ RsDoGpioIntDescriptor (
case 8: /* Resource Tag (Descriptor Name) */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 9: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
@@ -438,6 +439,7 @@ RsDoGpioIntDescriptor (
*/
*InterruptList = (UINT16) InitializerOp->Asl.Value.Integer;
InterruptList++;
+ PinCount++;
/* Case 10: First interrupt number in list */
@@ -466,6 +468,7 @@ RsDoGpioIntDescriptor (
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
}
+ MpSaveGpioInfo (Info->MappingOp, Descriptor, PinCount, PinList, ResourceSource);
return (Rnode);
}
@@ -474,9 +477,7 @@ RsDoGpioIntDescriptor (
*
* FUNCTION: RsDoGpioIoDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -486,8 +487,7 @@ RsDoGpioIntDescriptor (
ASL_RESOURCE_NODE *
RsDoGpioIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -495,14 +495,18 @@ RsDoGpioIoDescriptor (
char *ResourceSource = NULL;
UINT8 *VendorData = NULL;
UINT16 *InterruptList = NULL;
+ UINT16 *PinList = NULL;
UINT16 ResSourceLength;
UINT16 VendorLength;
UINT16 InterruptLength;
UINT16 DescriptorSize;
+ UINT32 CurrentByteOffset;
+ UINT32 PinCount = 0;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
/*
* Calculate lengths for fields that have variable length:
@@ -513,6 +517,7 @@ RsDoGpioIoDescriptor (
ResSourceLength = RsGetStringDataLength (InitializerOp);
VendorLength = RsGetBufferDataLength (InitializerOp);
InterruptLength = RsGetInterruptDataLength (InitializerOp);
+ PinList = InterruptList;
DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO) +
ResSourceLength + VendorLength + InterruptLength;
@@ -530,6 +535,7 @@ RsDoGpioIoDescriptor (
/* Build pointers to optional areas */
InterruptList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_GPIO));
+ PinList = InterruptList;
ResourceSource = ACPI_ADD_PTR (char, InterruptList, InterruptLength);
VendorData = ACPI_ADD_PTR (UINT8, ResourceSource, ResSourceLength);
@@ -613,7 +619,7 @@ RsDoGpioIoDescriptor (
case 8: /* Resource Tag (Descriptor Name) */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 9: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
@@ -643,6 +649,7 @@ RsDoGpioIoDescriptor (
*/
*InterruptList = (UINT16) InitializerOp->Asl.Value.Integer;
InterruptList++;
+ PinCount++;
/* Case 10: First interrupt number in list */
@@ -671,6 +678,7 @@ RsDoGpioIoDescriptor (
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
}
+ MpSaveGpioInfo (Info->MappingOp, Descriptor, PinCount, PinList, ResourceSource);
return (Rnode);
}
@@ -679,9 +687,7 @@ RsDoGpioIoDescriptor (
*
* FUNCTION: RsDoI2cSerialBusDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -691,8 +697,7 @@ RsDoGpioIoDescriptor (
ASL_RESOURCE_NODE *
RsDoI2cSerialBusDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -702,10 +707,12 @@ RsDoI2cSerialBusDescriptor (
UINT16 ResSourceLength;
UINT16 VendorLength;
UINT16 DescriptorSize;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
/*
* Calculate lengths for fields that have variable length:
@@ -801,7 +808,7 @@ RsDoI2cSerialBusDescriptor (
case 7: /* Resource Tag (Descriptor Name) */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 8: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
@@ -818,6 +825,7 @@ RsDoI2cSerialBusDescriptor (
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
}
+ MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
return (Rnode);
}
@@ -826,9 +834,7 @@ RsDoI2cSerialBusDescriptor (
*
* FUNCTION: RsDoSpiSerialBusDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -838,8 +844,7 @@ RsDoI2cSerialBusDescriptor (
ASL_RESOURCE_NODE *
RsDoSpiSerialBusDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -849,10 +854,12 @@ RsDoSpiSerialBusDescriptor (
UINT16 ResSourceLength;
UINT16 VendorLength;
UINT16 DescriptorSize;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
/*
* Calculate lengths for fields that have variable length:
@@ -976,7 +983,7 @@ RsDoSpiSerialBusDescriptor (
case 11: /* Resource Tag (Descriptor Name) */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 12: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
@@ -993,6 +1000,7 @@ RsDoSpiSerialBusDescriptor (
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
}
+ MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
return (Rnode);
}
@@ -1001,9 +1009,7 @@ RsDoSpiSerialBusDescriptor (
*
* FUNCTION: RsDoUartSerialBusDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -1013,8 +1019,7 @@ RsDoSpiSerialBusDescriptor (
ASL_RESOURCE_NODE *
RsDoUartSerialBusDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -1024,10 +1029,12 @@ RsDoUartSerialBusDescriptor (
UINT16 ResSourceLength;
UINT16 VendorLength;
UINT16 DescriptorSize;
+ UINT32 CurrentByteOffset;
UINT32 i;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
+ CurrentByteOffset = Info->CurrentByteOffset;
/*
* Calculate lengths for fields that have variable length:
@@ -1168,7 +1175,7 @@ RsDoUartSerialBusDescriptor (
case 12: /* Resource Tag (Descriptor Name) */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 13: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
@@ -1185,5 +1192,6 @@ RsDoUartSerialBusDescriptor (
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
}
+ MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
return (Rnode);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslrestype2w.c b/sys/contrib/dev/acpica/compiler/aslrestype2w.c
index be388b7..a9f4771 100644
--- a/sys/contrib/dev/acpica/compiler/aslrestype2w.c
+++ b/sys/contrib/dev/acpica/compiler/aslrestype2w.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@@ -60,9 +59,7 @@
*
* FUNCTION: RsDoWordIoDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -72,8 +69,7 @@
ASL_RESOURCE_NODE *
RsDoWordIoDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -85,12 +81,14 @@ RsDoWordIoDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
@@ -236,7 +234,7 @@ RsDoWordIoDescriptor (
case 12: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 13: /* Type */
@@ -270,10 +268,10 @@ RsDoWordIoDescriptor (
(UINT64) Descriptor->Address16.AddressLength,
(UINT64) Descriptor->Address16.Granularity,
Descriptor->Address16.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
- OptionIndex + StringLength;
+ OptionIndex + StringLength;
return (Rnode);
}
@@ -282,9 +280,7 @@ RsDoWordIoDescriptor (
*
* FUNCTION: RsDoWordBusNumberDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -294,8 +290,7 @@ RsDoWordIoDescriptor (
ASL_RESOURCE_NODE *
RsDoWordBusNumberDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -307,12 +302,14 @@ RsDoWordBusNumberDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
@@ -456,7 +453,7 @@ RsDoWordBusNumberDescriptor (
case 11: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -476,10 +473,10 @@ RsDoWordBusNumberDescriptor (
(UINT64) Descriptor->Address16.AddressLength,
(UINT64) Descriptor->Address16.Granularity,
Descriptor->Address16.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
- OptionIndex + StringLength;
+ OptionIndex + StringLength;
return (Rnode);
}
@@ -488,9 +485,7 @@ RsDoWordBusNumberDescriptor (
*
* FUNCTION: RsDoWordSpaceDescriptor
*
- * PARAMETERS: Op - Parent resource descriptor parse node
- * CurrentByteOffset - Offset into the resource template AML
- * buffer (to track references to the desc)
+ * PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@@ -500,8 +495,7 @@ RsDoWordBusNumberDescriptor (
ASL_RESOURCE_NODE *
RsDoWordSpaceDescriptor (
- ACPI_PARSE_OBJECT *Op,
- UINT32 CurrentByteOffset)
+ ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@@ -513,12 +507,14 @@ RsDoWordSpaceDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
+ UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
- InitializerOp = Op->Asl.Child;
+ InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
+ CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
@@ -673,7 +669,7 @@ RsDoWordSpaceDescriptor (
case 13: /* ResourceTag */
- UtAttachNamepathToOwner (Op, InitializerOp);
+ UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@@ -693,9 +689,9 @@ RsDoWordSpaceDescriptor (
(UINT64) Descriptor->Address16.AddressLength,
(UINT64) Descriptor->Address16.Granularity,
Descriptor->Address16.Flags,
- MinOp, MaxOp, LengthOp, GranOp, Op);
+ MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
- OptionIndex + StringLength;
+ OptionIndex + StringLength;
return (Rnode);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.y b/sys/contrib/dev/acpica/compiler/aslrules.y
index 42ff850..67f0413 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompiler.y
+++ b/sys/contrib/dev/acpica/compiler/aslrules.y
@@ -1,12 +1,12 @@
-%{
+NoEcho('
/******************************************************************************
*
- * Module Name: aslcompiler.y - Bison/Yacc input file (ASL grammar and actions)
+ * Module Name: aslrules.y - Bison/Yacc production rules
*
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,755 +42,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#include <contrib/dev/acpica/compiler/aslcompiler.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <contrib/dev/acpica/include/acpi.h>
-#include <contrib/dev/acpica/include/accommon.h>
+')
-#define _COMPONENT ACPI_COMPILER
- ACPI_MODULE_NAME ("aslparse")
-
-/*
- * Global Notes:
- *
- * October 2005: The following list terms have been optimized (from the
- * original ASL grammar in the ACPI specification) to force the immediate
- * reduction of each list item so that the parse stack use doesn't increase on
- * each list element and possibly overflow on very large lists (>4000 items).
- * This dramatically reduces use of the parse stack overall.
- *
- * ArgList, TermList, Objectlist, ByteList, DWordList, PackageList,
- * ResourceMacroList, and FieldUnitList
- */
-
-void * AslLocalAllocate (unsigned int Size);
-
-/* Bison/yacc configuration */
-
-#define static
-#undef alloca
-#define alloca AslLocalAllocate
-#define yytname AslCompilername
-
-#define YYINITDEPTH 600 /* State stack depth */
-#define YYDEBUG 1 /* Enable debug output */
-#define YYERROR_VERBOSE 1 /* Verbose error messages */
-
-/* Define YYMALLOC/YYFREE to prevent redefinition errors */
-
-#define YYMALLOC malloc
-#define YYFREE free
-
-/*
- * The windows version of bison defines this incorrectly as "32768" (Not negative).
- * We use a custom (edited binary) version of bison that defines YYFLAG as YYFBAD
- * instead (#define YYFBAD 32768), so we can define it correctly here.
- *
- * The problem is that if YYFLAG is positive, the extended syntax error messages
- * are disabled.
- */
-#define YYFLAG -32768
-
-%}
-
-/*
- * Declare the type of values in the grammar
- */
-%union {
- UINT64 i;
- char *s;
- ACPI_PARSE_OBJECT *n;
-}
-
-/*! [Begin] no source code translation */
-
-/*
- * These shift/reduce conflicts are expected. There should be zero
- * reduce/reduce conflicts.
- */
-%expect 86
-
-/******************************************************************************
- *
- * Token types: These are returned by the lexer
- *
- * NOTE: This list MUST match the AslKeywordMapping table found
- * in aslmap.c EXACTLY! Double check any changes!
- *
- *****************************************************************************/
-
-%token <i> PARSEOP_ACCESSAS
-%token <i> PARSEOP_ACCESSATTRIB_BLOCK
-%token <i> PARSEOP_ACCESSATTRIB_BLOCK_CALL
-%token <i> PARSEOP_ACCESSATTRIB_BYTE
-%token <i> PARSEOP_ACCESSATTRIB_MULTIBYTE
-%token <i> PARSEOP_ACCESSATTRIB_QUICK
-%token <i> PARSEOP_ACCESSATTRIB_RAW_BYTES
-%token <i> PARSEOP_ACCESSATTRIB_RAW_PROCESS
-%token <i> PARSEOP_ACCESSATTRIB_SND_RCV
-%token <i> PARSEOP_ACCESSATTRIB_WORD
-%token <i> PARSEOP_ACCESSATTRIB_WORD_CALL
-%token <i> PARSEOP_ACCESSTYPE_ANY
-%token <i> PARSEOP_ACCESSTYPE_BUF
-%token <i> PARSEOP_ACCESSTYPE_BYTE
-%token <i> PARSEOP_ACCESSTYPE_DWORD
-%token <i> PARSEOP_ACCESSTYPE_QWORD
-%token <i> PARSEOP_ACCESSTYPE_WORD
-%token <i> PARSEOP_ACQUIRE
-%token <i> PARSEOP_ADD
-%token <i> PARSEOP_ADDRESSINGMODE_7BIT
-%token <i> PARSEOP_ADDRESSINGMODE_10BIT
-%token <i> PARSEOP_ADDRESSTYPE_ACPI
-%token <i> PARSEOP_ADDRESSTYPE_MEMORY
-%token <i> PARSEOP_ADDRESSTYPE_NVS
-%token <i> PARSEOP_ADDRESSTYPE_RESERVED
-%token <i> PARSEOP_ALIAS
-%token <i> PARSEOP_AND
-%token <i> PARSEOP_ARG0
-%token <i> PARSEOP_ARG1
-%token <i> PARSEOP_ARG2
-%token <i> PARSEOP_ARG3
-%token <i> PARSEOP_ARG4
-%token <i> PARSEOP_ARG5
-%token <i> PARSEOP_ARG6
-%token <i> PARSEOP_BANKFIELD
-%token <i> PARSEOP_BITSPERBYTE_EIGHT
-%token <i> PARSEOP_BITSPERBYTE_FIVE
-%token <i> PARSEOP_BITSPERBYTE_NINE
-%token <i> PARSEOP_BITSPERBYTE_SEVEN
-%token <i> PARSEOP_BITSPERBYTE_SIX
-%token <i> PARSEOP_BREAK
-%token <i> PARSEOP_BREAKPOINT
-%token <i> PARSEOP_BUFFER
-%token <i> PARSEOP_BUSMASTERTYPE_MASTER
-%token <i> PARSEOP_BUSMASTERTYPE_NOTMASTER
-%token <i> PARSEOP_BYTECONST
-%token <i> PARSEOP_CASE
-%token <i> PARSEOP_CLOCKPHASE_FIRST
-%token <i> PARSEOP_CLOCKPHASE_SECOND
-%token <i> PARSEOP_CLOCKPOLARITY_HIGH
-%token <i> PARSEOP_CLOCKPOLARITY_LOW
-%token <i> PARSEOP_CONCATENATE
-%token <i> PARSEOP_CONCATENATERESTEMPLATE
-%token <i> PARSEOP_CONDREFOF
-%token <i> PARSEOP_CONNECTION
-%token <i> PARSEOP_CONTINUE
-%token <i> PARSEOP_COPYOBJECT
-%token <i> PARSEOP_CREATEBITFIELD
-%token <i> PARSEOP_CREATEBYTEFIELD
-%token <i> PARSEOP_CREATEDWORDFIELD
-%token <i> PARSEOP_CREATEFIELD
-%token <i> PARSEOP_CREATEQWORDFIELD
-%token <i> PARSEOP_CREATEWORDFIELD
-%token <i> PARSEOP_DATABUFFER
-%token <i> PARSEOP_DATATABLEREGION
-%token <i> PARSEOP_DEBUG
-%token <i> PARSEOP_DECODETYPE_POS
-%token <i> PARSEOP_DECODETYPE_SUB
-%token <i> PARSEOP_DECREMENT
-%token <i> PARSEOP_DEFAULT
-%token <i> PARSEOP_DEFAULT_ARG
-%token <i> PARSEOP_DEFINITIONBLOCK
-%token <i> PARSEOP_DEREFOF
-%token <i> PARSEOP_DEVICE
-%token <i> PARSEOP_DEVICEPOLARITY_HIGH
-%token <i> PARSEOP_DEVICEPOLARITY_LOW
-%token <i> PARSEOP_DIVIDE
-%token <i> PARSEOP_DMA
-%token <i> PARSEOP_DMATYPE_A
-%token <i> PARSEOP_DMATYPE_COMPATIBILITY
-%token <i> PARSEOP_DMATYPE_B
-%token <i> PARSEOP_DMATYPE_F
-%token <i> PARSEOP_DWORDCONST
-%token <i> PARSEOP_DWORDIO
-%token <i> PARSEOP_DWORDMEMORY
-%token <i> PARSEOP_DWORDSPACE
-%token <i> PARSEOP_EISAID
-%token <i> PARSEOP_ELSE
-%token <i> PARSEOP_ELSEIF
-%token <i> PARSEOP_ENDDEPENDENTFN
-%token <i> PARSEOP_ENDIAN_BIG
-%token <i> PARSEOP_ENDIAN_LITTLE
-%token <i> PARSEOP_ENDTAG
-%token <i> PARSEOP_ERRORNODE
-%token <i> PARSEOP_EVENT
-%token <i> PARSEOP_EXTENDEDIO
-%token <i> PARSEOP_EXTENDEDMEMORY
-%token <i> PARSEOP_EXTENDEDSPACE
-%token <i> PARSEOP_EXTERNAL
-%token <i> PARSEOP_FATAL
-%token <i> PARSEOP_FIELD
-%token <i> PARSEOP_FINDSETLEFTBIT
-%token <i> PARSEOP_FINDSETRIGHTBIT
-%token <i> PARSEOP_FIXEDDMA
-%token <i> PARSEOP_FIXEDIO
-%token <i> PARSEOP_FLOWCONTROL_HW
-%token <i> PARSEOP_FLOWCONTROL_NONE
-%token <i> PARSEOP_FLOWCONTROL_SW
-%token <i> PARSEOP_FROMBCD
-%token <i> PARSEOP_FUNCTION
-%token <i> PARSEOP_GPIO_INT
-%token <i> PARSEOP_GPIO_IO
-%token <i> PARSEOP_I2C_SERIALBUS
-%token <i> PARSEOP_IF
-%token <i> PARSEOP_INCLUDE
-%token <i> PARSEOP_INCLUDE_END
-%token <i> PARSEOP_INCREMENT
-%token <i> PARSEOP_INDEX
-%token <i> PARSEOP_INDEXFIELD
-%token <i> PARSEOP_INTEGER
-%token <i> PARSEOP_INTERRUPT
-%token <i> PARSEOP_INTLEVEL_ACTIVEBOTH
-%token <i> PARSEOP_INTLEVEL_ACTIVEHIGH
-%token <i> PARSEOP_INTLEVEL_ACTIVELOW
-%token <i> PARSEOP_INTTYPE_EDGE
-%token <i> PARSEOP_INTTYPE_LEVEL
-%token <i> PARSEOP_IO
-%token <i> PARSEOP_IODECODETYPE_10
-%token <i> PARSEOP_IODECODETYPE_16
-%token <i> PARSEOP_IORESTRICT_IN
-%token <i> PARSEOP_IORESTRICT_NONE
-%token <i> PARSEOP_IORESTRICT_OUT
-%token <i> PARSEOP_IORESTRICT_PRESERVE
-%token <i> PARSEOP_IRQ
-%token <i> PARSEOP_IRQNOFLAGS
-%token <i> PARSEOP_LAND
-%token <i> PARSEOP_LEQUAL
-%token <i> PARSEOP_LGREATER
-%token <i> PARSEOP_LGREATEREQUAL
-%token <i> PARSEOP_LLESS
-%token <i> PARSEOP_LLESSEQUAL
-%token <i> PARSEOP_LNOT
-%token <i> PARSEOP_LNOTEQUAL
-%token <i> PARSEOP_LOAD
-%token <i> PARSEOP_LOADTABLE
-%token <i> PARSEOP_LOCAL0
-%token <i> PARSEOP_LOCAL1
-%token <i> PARSEOP_LOCAL2
-%token <i> PARSEOP_LOCAL3
-%token <i> PARSEOP_LOCAL4
-%token <i> PARSEOP_LOCAL5
-%token <i> PARSEOP_LOCAL6
-%token <i> PARSEOP_LOCAL7
-%token <i> PARSEOP_LOCKRULE_LOCK
-%token <i> PARSEOP_LOCKRULE_NOLOCK
-%token <i> PARSEOP_LOR
-%token <i> PARSEOP_MATCH
-%token <i> PARSEOP_MATCHTYPE_MEQ
-%token <i> PARSEOP_MATCHTYPE_MGE
-%token <i> PARSEOP_MATCHTYPE_MGT
-%token <i> PARSEOP_MATCHTYPE_MLE
-%token <i> PARSEOP_MATCHTYPE_MLT
-%token <i> PARSEOP_MATCHTYPE_MTR
-%token <i> PARSEOP_MAXTYPE_FIXED
-%token <i> PARSEOP_MAXTYPE_NOTFIXED
-%token <i> PARSEOP_MEMORY24
-%token <i> PARSEOP_MEMORY32
-%token <i> PARSEOP_MEMORY32FIXED
-%token <i> PARSEOP_MEMTYPE_CACHEABLE
-%token <i> PARSEOP_MEMTYPE_NONCACHEABLE
-%token <i> PARSEOP_MEMTYPE_PREFETCHABLE
-%token <i> PARSEOP_MEMTYPE_WRITECOMBINING
-%token <i> PARSEOP_METHOD
-%token <i> PARSEOP_METHODCALL
-%token <i> PARSEOP_MID
-%token <i> PARSEOP_MINTYPE_FIXED
-%token <i> PARSEOP_MINTYPE_NOTFIXED
-%token <i> PARSEOP_MOD
-%token <i> PARSEOP_MULTIPLY
-%token <i> PARSEOP_MUTEX
-%token <i> PARSEOP_NAME
-%token <s> PARSEOP_NAMESEG
-%token <s> PARSEOP_NAMESTRING
-%token <i> PARSEOP_NAND
-%token <i> PARSEOP_NOOP
-%token <i> PARSEOP_NOR
-%token <i> PARSEOP_NOT
-%token <i> PARSEOP_NOTIFY
-%token <i> PARSEOP_OBJECTTYPE
-%token <i> PARSEOP_OBJECTTYPE_BFF
-%token <i> PARSEOP_OBJECTTYPE_BUF
-%token <i> PARSEOP_OBJECTTYPE_DDB
-%token <i> PARSEOP_OBJECTTYPE_DEV
-%token <i> PARSEOP_OBJECTTYPE_EVT
-%token <i> PARSEOP_OBJECTTYPE_FLD
-%token <i> PARSEOP_OBJECTTYPE_INT
-%token <i> PARSEOP_OBJECTTYPE_MTH
-%token <i> PARSEOP_OBJECTTYPE_MTX
-%token <i> PARSEOP_OBJECTTYPE_OPR
-%token <i> PARSEOP_OBJECTTYPE_PKG
-%token <i> PARSEOP_OBJECTTYPE_POW
-%token <i> PARSEOP_OBJECTTYPE_PRO
-%token <i> PARSEOP_OBJECTTYPE_STR
-%token <i> PARSEOP_OBJECTTYPE_THZ
-%token <i> PARSEOP_OBJECTTYPE_UNK
-%token <i> PARSEOP_OFFSET
-%token <i> PARSEOP_ONE
-%token <i> PARSEOP_ONES
-%token <i> PARSEOP_OPERATIONREGION
-%token <i> PARSEOP_OR
-%token <i> PARSEOP_PACKAGE
-%token <i> PARSEOP_PACKAGE_LENGTH
-%token <i> PARSEOP_PARITYTYPE_EVEN
-%token <i> PARSEOP_PARITYTYPE_MARK
-%token <i> PARSEOP_PARITYTYPE_NONE
-%token <i> PARSEOP_PARITYTYPE_ODD
-%token <i> PARSEOP_PARITYTYPE_SPACE
-%token <i> PARSEOP_PIN_NOPULL
-%token <i> PARSEOP_PIN_PULLDEFAULT
-%token <i> PARSEOP_PIN_PULLDOWN
-%token <i> PARSEOP_PIN_PULLUP
-%token <i> PARSEOP_POWERRESOURCE
-%token <i> PARSEOP_PROCESSOR
-%token <i> PARSEOP_QWORDCONST
-%token <i> PARSEOP_QWORDIO
-%token <i> PARSEOP_QWORDMEMORY
-%token <i> PARSEOP_QWORDSPACE
-%token <i> PARSEOP_RANGETYPE_ENTIRE
-%token <i> PARSEOP_RANGETYPE_ISAONLY
-%token <i> PARSEOP_RANGETYPE_NONISAONLY
-%token <i> PARSEOP_RAW_DATA
-%token <i> PARSEOP_READWRITETYPE_BOTH
-%token <i> PARSEOP_READWRITETYPE_READONLY
-%token <i> PARSEOP_REFOF
-%token <i> PARSEOP_REGIONSPACE_CMOS
-%token <i> PARSEOP_REGIONSPACE_EC
-%token <i> PARSEOP_REGIONSPACE_FFIXEDHW
-%token <i> PARSEOP_REGIONSPACE_GPIO
-%token <i> PARSEOP_REGIONSPACE_GSBUS
-%token <i> PARSEOP_REGIONSPACE_IO
-%token <i> PARSEOP_REGIONSPACE_IPMI
-%token <i> PARSEOP_REGIONSPACE_MEM
-%token <i> PARSEOP_REGIONSPACE_PCC
-%token <i> PARSEOP_REGIONSPACE_PCI
-%token <i> PARSEOP_REGIONSPACE_PCIBAR
-%token <i> PARSEOP_REGIONSPACE_SMBUS
-%token <i> PARSEOP_REGISTER
-%token <i> PARSEOP_RELEASE
-%token <i> PARSEOP_RESERVED_BYTES
-%token <i> PARSEOP_RESET
-%token <i> PARSEOP_RESOURCETEMPLATE
-%token <i> PARSEOP_RESOURCETYPE_CONSUMER
-%token <i> PARSEOP_RESOURCETYPE_PRODUCER
-%token <i> PARSEOP_RETURN
-%token <i> PARSEOP_REVISION
-%token <i> PARSEOP_SCOPE
-%token <i> PARSEOP_SERIALIZERULE_NOTSERIAL
-%token <i> PARSEOP_SERIALIZERULE_SERIAL
-%token <i> PARSEOP_SHARETYPE_EXCLUSIVE
-%token <i> PARSEOP_SHARETYPE_EXCLUSIVEWAKE
-%token <i> PARSEOP_SHARETYPE_SHARED
-%token <i> PARSEOP_SHARETYPE_SHAREDWAKE
-%token <i> PARSEOP_SHIFTLEFT
-%token <i> PARSEOP_SHIFTRIGHT
-%token <i> PARSEOP_SIGNAL
-%token <i> PARSEOP_SIZEOF
-%token <i> PARSEOP_SLAVEMODE_CONTROLLERINIT
-%token <i> PARSEOP_SLAVEMODE_DEVICEINIT
-%token <i> PARSEOP_SLEEP
-%token <i> PARSEOP_SPI_SERIALBUS
-%token <i> PARSEOP_STALL
-%token <i> PARSEOP_STARTDEPENDENTFN
-%token <i> PARSEOP_STARTDEPENDENTFN_NOPRI
-%token <i> PARSEOP_STOPBITS_ONE
-%token <i> PARSEOP_STOPBITS_ONEPLUSHALF
-%token <i> PARSEOP_STOPBITS_TWO
-%token <i> PARSEOP_STOPBITS_ZERO
-%token <i> PARSEOP_STORE
-%token <s> PARSEOP_STRING_LITERAL
-%token <i> PARSEOP_SUBTRACT
-%token <i> PARSEOP_SWITCH
-%token <i> PARSEOP_THERMALZONE
-%token <i> PARSEOP_TIMER
-%token <i> PARSEOP_TOBCD
-%token <i> PARSEOP_TOBUFFER
-%token <i> PARSEOP_TODECIMALSTRING
-%token <i> PARSEOP_TOHEXSTRING
-%token <i> PARSEOP_TOINTEGER
-%token <i> PARSEOP_TOSTRING
-%token <i> PARSEOP_TOUUID
-%token <i> PARSEOP_TRANSLATIONTYPE_DENSE
-%token <i> PARSEOP_TRANSLATIONTYPE_SPARSE
-%token <i> PARSEOP_TYPE_STATIC
-%token <i> PARSEOP_TYPE_TRANSLATION
-%token <i> PARSEOP_UART_SERIALBUS
-%token <i> PARSEOP_UNICODE
-%token <i> PARSEOP_UNLOAD
-%token <i> PARSEOP_UPDATERULE_ONES
-%token <i> PARSEOP_UPDATERULE_PRESERVE
-%token <i> PARSEOP_UPDATERULE_ZEROS
-%token <i> PARSEOP_VAR_PACKAGE
-%token <i> PARSEOP_VENDORLONG
-%token <i> PARSEOP_VENDORSHORT
-%token <i> PARSEOP_WAIT
-%token <i> PARSEOP_WHILE
-%token <i> PARSEOP_WIREMODE_FOUR
-%token <i> PARSEOP_WIREMODE_THREE
-%token <i> PARSEOP_WORDBUSNUMBER
-%token <i> PARSEOP_WORDCONST
-%token <i> PARSEOP_WORDIO
-%token <i> PARSEOP_WORDSPACE
-%token <i> PARSEOP_XFERSIZE_8
-%token <i> PARSEOP_XFERSIZE_16
-%token <i> PARSEOP_XFERSIZE_32
-%token <i> PARSEOP_XFERSIZE_64
-%token <i> PARSEOP_XFERSIZE_128
-%token <i> PARSEOP_XFERSIZE_256
-%token <i> PARSEOP_XFERTYPE_8
-%token <i> PARSEOP_XFERTYPE_8_16
-%token <i> PARSEOP_XFERTYPE_16
-%token <i> PARSEOP_XOR
-%token <i> PARSEOP_ZERO
-
-/*
- * Special functions. These should probably stay at the end of this
- * table.
- */
-%token <i> PARSEOP___DATE__
-%token <i> PARSEOP___FILE__
-%token <i> PARSEOP___LINE__
-%token <i> PARSEOP___PATH__
-
-
-/******************************************************************************
- *
- * Production names
- *
- *****************************************************************************/
-
-%type <n> ArgList
-%type <n> ASLCode
-%type <n> BufferData
-%type <n> BufferTermData
-%type <n> CompilerDirective
-%type <n> DataObject
-%type <n> DefinitionBlockTerm
-%type <n> IntegerData
-%type <n> NamedObject
-%type <n> NameSpaceModifier
-%type <n> Object
-%type <n> ObjectList
-%type <n> PackageData
-%type <n> ParameterTypePackage
-%type <n> ParameterTypePackageList
-%type <n> ParameterTypesPackage
-%type <n> ParameterTypesPackageList
-%type <n> RequiredTarget
-%type <n> SimpleTarget
-%type <n> StringData
-%type <n> Target
-%type <n> Term
-%type <n> TermArg
-%type <n> TermList
-%type <n> UserTerm
-
-/* Type4Opcode is obsolete */
-
-%type <n> Type1Opcode
-%type <n> Type2BufferOpcode
-%type <n> Type2BufferOrStringOpcode
-%type <n> Type2IntegerOpcode
-%type <n> Type2Opcode
-%type <n> Type2StringOpcode
-%type <n> Type3Opcode
-%type <n> Type5Opcode
-%type <n> Type6Opcode
-
-%type <n> AccessAsTerm
-%type <n> ExternalTerm
-%type <n> FieldUnit
-%type <n> FieldUnitEntry
-%type <n> FieldUnitList
-%type <n> IncludeTerm
-%type <n> OffsetTerm
-%type <n> OptionalAccessAttribTerm
-
-/* Named Objects */
-
-%type <n> BankFieldTerm
-%type <n> CreateBitFieldTerm
-%type <n> CreateByteFieldTerm
-%type <n> CreateDWordFieldTerm
-%type <n> CreateFieldTerm
-%type <n> CreateQWordFieldTerm
-%type <n> CreateWordFieldTerm
-%type <n> DataRegionTerm
-%type <n> DeviceTerm
-%type <n> EventTerm
-%type <n> FieldTerm
-%type <n> FunctionTerm
-%type <n> IndexFieldTerm
-%type <n> MethodTerm
-%type <n> MutexTerm
-%type <n> OpRegionTerm
-%type <n> OpRegionSpaceIdTerm
-%type <n> PowerResTerm
-%type <n> ProcessorTerm
-%type <n> ThermalZoneTerm
-
-/* Namespace modifiers */
-
-%type <n> AliasTerm
-%type <n> NameTerm
-%type <n> ScopeTerm
-
-/* Type 1 opcodes */
-
-%type <n> BreakPointTerm
-%type <n> BreakTerm
-%type <n> CaseDefaultTermList
-%type <n> CaseTerm
-%type <n> ContinueTerm
-%type <n> DefaultTerm
-%type <n> ElseTerm
-%type <n> FatalTerm
-%type <n> IfElseTerm
-%type <n> IfTerm
-%type <n> LoadTerm
-%type <n> NoOpTerm
-%type <n> NotifyTerm
-%type <n> ReleaseTerm
-%type <n> ResetTerm
-%type <n> ReturnTerm
-%type <n> SignalTerm
-%type <n> SleepTerm
-%type <n> StallTerm
-%type <n> SwitchTerm
-%type <n> UnloadTerm
-%type <n> WhileTerm
-/* %type <n> CaseTermList */
-
-/* Type 2 opcodes */
-
-%type <n> AcquireTerm
-%type <n> AddTerm
-%type <n> AndTerm
-%type <n> ConcatResTerm
-%type <n> ConcatTerm
-%type <n> CondRefOfTerm
-%type <n> CopyObjectTerm
-%type <n> DecTerm
-%type <n> DerefOfTerm
-%type <n> DivideTerm
-%type <n> FindSetLeftBitTerm
-%type <n> FindSetRightBitTerm
-%type <n> FromBCDTerm
-%type <n> IncTerm
-%type <n> IndexTerm
-%type <n> LAndTerm
-%type <n> LEqualTerm
-%type <n> LGreaterEqualTerm
-%type <n> LGreaterTerm
-%type <n> LLessEqualTerm
-%type <n> LLessTerm
-%type <n> LNotEqualTerm
-%type <n> LNotTerm
-%type <n> LoadTableTerm
-%type <n> LOrTerm
-%type <n> MatchTerm
-%type <n> MidTerm
-%type <n> ModTerm
-%type <n> MultiplyTerm
-%type <n> NAndTerm
-%type <n> NOrTerm
-%type <n> NotTerm
-%type <n> ObjectTypeTerm
-%type <n> OrTerm
-%type <n> RefOfTerm
-%type <n> ShiftLeftTerm
-%type <n> ShiftRightTerm
-%type <n> SizeOfTerm
-%type <n> StoreTerm
-%type <n> SubtractTerm
-%type <n> TimerTerm
-%type <n> ToBCDTerm
-%type <n> ToBufferTerm
-%type <n> ToDecimalStringTerm
-%type <n> ToHexStringTerm
-%type <n> ToIntegerTerm
-%type <n> ToStringTerm
-%type <n> WaitTerm
-%type <n> XOrTerm
-
-/* Keywords */
-
-%type <n> AccessAttribKeyword
-%type <n> AccessTypeKeyword
-%type <n> AddressingModeKeyword
-%type <n> AddressKeyword
-%type <n> AddressSpaceKeyword
-%type <n> BitsPerByteKeyword
-%type <n> ClockPhaseKeyword
-%type <n> ClockPolarityKeyword
-%type <n> DecodeKeyword
-%type <n> DevicePolarityKeyword
-%type <n> DMATypeKeyword
-%type <n> EndianKeyword
-%type <n> FlowControlKeyword
-%type <n> InterruptLevel
-%type <n> InterruptTypeKeyword
-%type <n> IODecodeKeyword
-%type <n> IoRestrictionKeyword
-%type <n> LockRuleKeyword
-%type <n> MatchOpKeyword
-%type <n> MaxKeyword
-%type <n> MemTypeKeyword
-%type <n> MinKeyword
-%type <n> ObjectTypeKeyword
-%type <n> OptionalBusMasterKeyword
-%type <n> OptionalReadWriteKeyword
-%type <n> ParityTypeKeyword
-%type <n> PinConfigByte
-%type <n> PinConfigKeyword
-%type <n> RangeTypeKeyword
-%type <n> RegionSpaceKeyword
-%type <n> ResourceTypeKeyword
-%type <n> SerializeRuleKeyword
-%type <n> ShareTypeKeyword
-%type <n> SlaveModeKeyword
-%type <n> StopBitsKeyword
-%type <n> TranslationKeyword
-%type <n> TypeKeyword
-%type <n> UpdateRuleKeyword
-%type <n> WireModeKeyword
-%type <n> XferSizeKeyword
-%type <n> XferTypeKeyword
-
-/* Types */
-
-%type <n> SuperName
-%type <n> ObjectTypeName
-%type <n> ArgTerm
-%type <n> LocalTerm
-%type <n> DebugTerm
-
-%type <n> Integer
-%type <n> ByteConst
-%type <n> WordConst
-%type <n> DWordConst
-%type <n> QWordConst
-%type <n> String
-
-%type <n> ConstTerm
-%type <n> ConstExprTerm
-%type <n> ByteConstExpr
-%type <n> WordConstExpr
-%type <n> DWordConstExpr
-%type <n> QWordConstExpr
-
-%type <n> DWordList
-%type <n> BufferTerm
-%type <n> ByteList
-
-%type <n> PackageElement
-%type <n> PackageList
-%type <n> PackageTerm
-%type <n> VarPackageLengthTerm
-
-/* Macros */
-
-%type <n> EISAIDTerm
-%type <n> ResourceMacroList
-%type <n> ResourceMacroTerm
-%type <n> ResourceTemplateTerm
-%type <n> ToUUIDTerm
-%type <n> UnicodeTerm
-
-/* Resource Descriptors */
-
-%type <n> ConnectionTerm
-%type <n> DataBufferTerm
-%type <n> DMATerm
-%type <n> DWordIOTerm
-%type <n> DWordMemoryTerm
-%type <n> DWordSpaceTerm
-%type <n> EndDependentFnTerm
-%type <n> ExtendedIOTerm
-%type <n> ExtendedMemoryTerm
-%type <n> ExtendedSpaceTerm
-%type <n> FixedDmaTerm
-%type <n> FixedIOTerm
-%type <n> GpioIntTerm
-%type <n> GpioIoTerm
-%type <n> I2cSerialBusTerm
-%type <n> InterruptTerm
-%type <n> IOTerm
-%type <n> IRQNoFlagsTerm
-%type <n> IRQTerm
-%type <n> Memory24Term
-%type <n> Memory32FixedTerm
-%type <n> Memory32Term
-%type <n> NameSeg
-%type <n> NameString
-%type <n> QWordIOTerm
-%type <n> QWordMemoryTerm
-%type <n> QWordSpaceTerm
-%type <n> RegisterTerm
-%type <n> SpiSerialBusTerm
-%type <n> StartDependentFnNoPriTerm
-%type <n> StartDependentFnTerm
-%type <n> UartSerialBusTerm
-%type <n> VendorLongTerm
-%type <n> VendorShortTerm
-%type <n> WordBusNumberTerm
-%type <n> WordIOTerm
-%type <n> WordSpaceTerm
-
-/* Local types that help construct the AML, not in ACPI spec */
-
-%type <n> AmlPackageLengthTerm
-%type <n> IncludeEndTerm
-%type <n> NameStringItem
-%type <n> TermArgItem
-
-%type <n> OptionalAccessSize
-%type <n> OptionalAddressingMode
-%type <n> OptionalAddressRange
-%type <n> OptionalBitsPerByte
-%type <n> OptionalBuffer_Last
-%type <n> OptionalByteConstExpr
-%type <n> OptionalCount
-%type <n> OptionalDecodeType
-%type <n> OptionalDevicePolarity
-%type <n> OptionalDWordConstExpr
-%type <n> OptionalEndian
-%type <n> OptionalFlowControl
-%type <n> OptionalIoRestriction
-%type <n> OptionalListString
-%type <n> OptionalMaxType
-%type <n> OptionalMemType
-%type <n> OptionalMinType
-%type <n> OptionalNameString
-%type <n> OptionalNameString_First
-%type <n> OptionalNameString_Last
-%type <n> OptionalObjectTypeKeyword
-%type <n> OptionalParameterTypePackage
-%type <n> OptionalParameterTypesPackage
-%type <n> OptionalParityType
-%type <n> OptionalQWordConstExpr
-%type <n> OptionalRangeType
-%type <n> OptionalReference
-%type <n> OptionalResourceType
-%type <n> OptionalResourceType_First
-%type <n> OptionalReturnArg
-%type <n> OptionalSerializeRuleKeyword
-%type <n> OptionalShareType
-%type <n> OptionalShareType_First
-%type <n> OptionalSlaveMode
-%type <n> OptionalStopBits
-%type <n> OptionalStringData
-%type <n> OptionalTermArg
-%type <n> OptionalTranslationType_Last
-%type <n> OptionalType
-%type <n> OptionalType_Last
-%type <n> OptionalWireMode
-%type <n> OptionalWordConst
-%type <n> OptionalWordConstExpr
-%type <n> OptionalXferSize
-
-%%
/*******************************************************************************
*
* Production rules start here
@@ -799,10 +52,7 @@ void * AslLocalAllocate (unsigned int Size);
/*
* ASL Names
- */
-
-
-/*
+ *
* Root rule. Allow multiple #line directives before the definition block
* to handle output from preprocessors
*/
@@ -842,6 +92,149 @@ DefinitionBlockTerm
'{' TermList '}' {$$ = TrLinkChildren ($<n>3,7,$4,$6,$8,$10,$12,$14,$18);}
;
+ /*
+ * ASL Extensions: C-style math/logical operators and expressions.
+ * The implementation transforms these operators into the standard
+ * AML opcodes and syntax.
+ *
+ * Supported operators and precedence rules (high-to-low)
+ *
+ * NOTE: The operator precedence and associativity rules are
+ * implemented by the tokens in asltokens.y
+ *
+ * (left-to-right):
+ * 1) ( ) expr++ expr--
+ *
+ * (right-to-left):
+ * 2) ! ~
+ *
+ * (left-to-right):
+ * 3) * / %
+ * 4) + -
+ * 5) >> <<
+ * 6) < > <= >=
+ * 7) == !=
+ * 8) &
+ * 9) ^
+ * 10) |
+ * 11) &&
+ * 12) ||
+ *
+ * (right-to-left):
+ * 13) = += -= *= /= %= <<= >>= &= ^= |=
+ */
+Expression
+
+ /* Unary operators */
+
+ : PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);}
+ TermArg {$$ = TrLinkChildren ($<n>2,1,$3);}
+ | PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);}
+ TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateLeafNode (PARSEOP_ZERO));}
+
+ | SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);}
+ {$$ = TrLinkChildren ($<n>3,1,$1);}
+ | SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);}
+ {$$ = TrLinkChildren ($<n>3,1,$1);}
+
+ /* Binary operators: math and logical */
+
+ | TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
+ | TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
+ TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateLeafNode (PARSEOP_ZERO),
+ TrCreateLeafNode (PARSEOP_ZERO));}
+ | TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
+ | TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
+ | TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
+ | TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
+ | TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
+
+ | TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafNode (PARSEOP_AND);}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
+ | TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafNode (PARSEOP_OR);}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
+ | TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
+
+ | TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);}
+ TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
+ | TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);}
+ TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
+ | TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);}
+ TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
+ | TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);}
+ TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
+
+ | TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);}
+ TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
+ | TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);}
+ TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
+
+ | TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);}
+ TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
+ | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);}
+ TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
+
+ /* Parentheses */
+
+ | '(' TermArg ')' { $$ = $2;}
+ ;
+
+EqualsTerm
+
+ /* All assignment-type operations */
+
+ : SuperName PARSEOP_EXP_EQUALS
+ TermArg {$$ = TrCreateAssignmentNode ($1, $3);}
+
+ | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
+ TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+
+ | TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
+ TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateLeafNode (PARSEOP_ZERO),
+ TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+
+ | TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
+ TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+
+ | TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
+ TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+
+ | TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
+ TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+
+ | TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
+ TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+
+ | TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
+ TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+
+ | TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_AND);}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
+ TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+
+ | TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_OR);}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
+ TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+
+ | TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,
+ TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
+ ;
+
+
/* ACPI 3.0 -- allow semicolons between terms */
TermList
@@ -854,6 +247,7 @@ TermList
Term
: Object {}
+ | Expression {}
| Type1Opcode {}
| Type2Opcode {}
| Type2IntegerOpcode {}
@@ -961,7 +355,8 @@ Removed from TermArg due to reduce/reduce conflicts
*/
TermArg
- : Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
+ : Expression {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
+ | Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
| DataObject {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
| NameString {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
| ArgTerm {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
@@ -1055,6 +450,7 @@ Type2Opcode
| RefOfTerm {}
| SizeOfTerm {}
| StoreTerm {}
+ | EqualsTerm {}
| TimerTerm {}
| WaitTerm {}
| UserTerm {}
@@ -1112,6 +508,8 @@ Type2BufferOpcode /* "Type5" Opcodes */
Type2BufferOrStringOpcode
: ConcatTerm {}
+ | PrintfTerm {}
+ | FprintfTerm {}
| MidTerm {}
;
@@ -1137,6 +535,7 @@ Type4Opcode
Type5Opcode
: ResourceTemplateTerm {}
| UnicodeTerm {}
+ | ToPLDTerm {}
| ToUUIDTerm {}
;
@@ -2120,6 +1519,86 @@ ToIntegerTerm
error ')' {$$ = AslDoError(); yyclearin;}
;
+PldKeyword
+ : PARSEOP_PLD_REVISION {$$ = TrCreateLeafNode (PARSEOP_PLD_REVISION);}
+ | PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafNode (PARSEOP_PLD_IGNORECOLOR);}
+ | PARSEOP_PLD_RED {$$ = TrCreateLeafNode (PARSEOP_PLD_RED);}
+ | PARSEOP_PLD_GREEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GREEN);}
+ | PARSEOP_PLD_BLUE {$$ = TrCreateLeafNode (PARSEOP_PLD_BLUE);}
+ | PARSEOP_PLD_WIDTH {$$ = TrCreateLeafNode (PARSEOP_PLD_WIDTH);}
+ | PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafNode (PARSEOP_PLD_HEIGHT);}
+ | PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafNode (PARSEOP_PLD_USERVISIBLE);}
+ | PARSEOP_PLD_DOCK {$$ = TrCreateLeafNode (PARSEOP_PLD_DOCK);}
+ | PARSEOP_PLD_LID {$$ = TrCreateLeafNode (PARSEOP_PLD_LID);}
+ | PARSEOP_PLD_PANEL {$$ = TrCreateLeafNode (PARSEOP_PLD_PANEL);}
+ | PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALPOSITION);}
+ | PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALPOSITION);}
+ | PARSEOP_PLD_SHAPE {$$ = TrCreateLeafNode (PARSEOP_PLD_SHAPE);}
+ | PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPORIENTATION);}
+ | PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPTOKEN);}
+ | PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPPOSITION);}
+ | PARSEOP_PLD_BAY {$$ = TrCreateLeafNode (PARSEOP_PLD_BAY);}
+ | PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTABLE);}
+ | PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTREQUIRED);}
+ | PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CABINETNUMBER);}
+ | PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CARDCAGENUMBER);}
+ | PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafNode (PARSEOP_PLD_REFERENCE);}
+ | PARSEOP_PLD_ROTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_ROTATION);}
+ | PARSEOP_PLD_ORDER {$$ = TrCreateLeafNode (PARSEOP_PLD_ORDER);}
+ | PARSEOP_PLD_RESERVED {$$ = TrCreateLeafNode (PARSEOP_PLD_RESERVED);}
+ | PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALOFFSET);}
+ | PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALOFFSET);}
+ ;
+
+PldKeywordList
+ : {$$ = NULL;}
+ | PldKeyword
+ PARSEOP_EXP_EQUALS Integer {$$ = TrLinkChildren ($1,1,$3);}
+ | PldKeyword
+ PARSEOP_EXP_EQUALS String {$$ = TrLinkChildren ($1,1,$3);}
+ | PldKeywordList ',' /* Allows a trailing comma at list end */
+ | PldKeywordList ','
+ PldKeyword
+ PARSEOP_EXP_EQUALS Integer {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));}
+ | PldKeywordList ','
+ PldKeyword
+ PARSEOP_EXP_EQUALS String {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));}
+ ;
+
+ToPLDTerm
+ : PARSEOP_TOPLD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);}
+ PldKeywordList
+ ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
+ | PARSEOP_TOPLD '('
+ error ')' {$$ = AslDoError(); yyclearin;}
+ ;
+
+PrintfArgList
+ : {$$ = NULL;}
+ | TermArg {$$ = $1;}
+ | PrintfArgList ','
+ TermArg {$$ = TrLinkPeerNode ($1, $3);}
+ ;
+
+PrintfTerm
+ : PARSEOP_PRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);}
+ StringData
+ PrintfArgList
+ ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
+ | PARSEOP_PRINTF '('
+ error ')' {$$ = AslDoError(); yyclearin;}
+ ;
+
+FprintfTerm
+ : PARSEOP_FPRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);}
+ TermArg ','
+ StringData
+ PrintfArgList
+ ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);}
+ | PARSEOP_FPRINTF '('
+ error ')' {$$ = AslDoError(); yyclearin;}
+ ;
+
ToStringTerm
: PARSEOP_TOSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);}
TermArg
@@ -3511,77 +2990,3 @@ OptionalXferSize
| ',' {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);}
| ',' XferSizeKeyword {$$ = $2;}
;
-
-%%
-/******************************************************************************
- *
- * Local support functions
- *
- *****************************************************************************/
-
-int
-AslCompilerwrap(void)
-{
- return (1);
-}
-
-/*! [End] no source code translation !*/
-
-void *
-AslLocalAllocate (unsigned int Size)
-{
- void *Mem;
-
-
- DbgPrint (ASL_PARSE_OUTPUT, "\nAslLocalAllocate: Expanding Stack to %u\n\n", Size);
-
- Mem = ACPI_ALLOCATE_ZEROED (Size);
- if (!Mem)
- {
- AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
- Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
- Gbl_InputByteCount, Gbl_CurrentColumn,
- Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
- exit (1);
- }
-
- return (Mem);
-}
-
-ACPI_PARSE_OBJECT *
-AslDoError (void)
-{
-
-
- return (TrCreateLeafNode (PARSEOP_ERRORNODE));
-
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: UtGetOpName
- *
- * PARAMETERS: ParseOpcode - Parser keyword ID
- *
- * RETURN: Pointer to the opcode name
- *
- * DESCRIPTION: Get the ascii name of the parse opcode
- *
- ******************************************************************************/
-
-char *
-UtGetOpName (
- UINT32 ParseOpcode)
-{
-#ifdef ASL_YYTNAME_START
- /*
- * First entries (ASL_YYTNAME_START) in yytname are special reserved names.
- * Ignore first 8 characters of the name
- */
- return ((char *) yytname
- [(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
-#else
- return ("[Unknown parser generator]");
-#endif
-}
diff --git a/sys/contrib/dev/acpica/compiler/aslstartup.c b/sys/contrib/dev/acpica/compiler/aslstartup.c
index e50b103..c8840b2 100644
--- a/sys/contrib/dev/acpica/compiler/aslstartup.c
+++ b/sys/contrib/dev/acpica/compiler/aslstartup.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/include/actables.h>
#include <contrib/dev/acpica/include/acdisasm.h>
@@ -51,18 +50,8 @@
ACPI_MODULE_NAME ("aslstartup")
-#define ASL_MAX_FILES 256
-static char *FileList[ASL_MAX_FILES];
-static BOOLEAN AslToFile = TRUE;
-
-
/* Local prototypes */
-static char **
-AsDoWildcard (
- char *DirectoryPathname,
- char *FileSpecifier);
-
static UINT8
AslDetectSourceFileType (
ASL_FILE_INFO *Info);
@@ -72,6 +61,11 @@ AslDoDisassembly (
void);
+/* Globals */
+
+static BOOLEAN AslToFile = TRUE;
+
+
/*******************************************************************************
*
* FUNCTION: AslInitializeGlobals
@@ -94,6 +88,7 @@ AslInitializeGlobals (
/* Init compiler globals */
+ Gbl_SyntaxError = 0;
Gbl_CurrentColumn = 0;
Gbl_CurrentLineNumber = 1;
Gbl_LogicalLineNumber = 1;
@@ -131,82 +126,6 @@ AslInitializeGlobals (
}
-/******************************************************************************
- *
- * FUNCTION: AsDoWildcard
- *
- * PARAMETERS: None
- *
- * RETURN: None
- *
- * DESCRIPTION: Process files via wildcards. This function is for the Windows
- * case only.
- *
- ******************************************************************************/
-
-static char **
-AsDoWildcard (
- char *DirectoryPathname,
- char *FileSpecifier)
-{
-#ifdef WIN32
- void *DirInfo;
- char *Filename;
- int FileCount;
-
-
- FileCount = 0;
-
- /* Open parent directory */
-
- DirInfo = AcpiOsOpenDirectory (DirectoryPathname, FileSpecifier, REQUEST_FILE_ONLY);
- if (!DirInfo)
- {
- /* Either the directory of file does not exist */
-
- Gbl_Files[ASL_FILE_INPUT].Filename = FileSpecifier;
- FlFileError (ASL_FILE_INPUT, ASL_MSG_OPEN);
- AslAbort ();
- }
-
- /* Process each file that matches the wildcard specification */
-
- while ((Filename = AcpiOsGetNextFilename (DirInfo)))
- {
- /* Add the filename to the file list */
-
- FileList[FileCount] = AcpiOsAllocate (strlen (Filename) + 1);
- strcpy (FileList[FileCount], Filename);
- FileCount++;
-
- if (FileCount >= ASL_MAX_FILES)
- {
- printf ("Max files reached\n");
- FileList[0] = NULL;
- return (FileList);
- }
- }
-
- /* Cleanup */
-
- AcpiOsCloseDirectory (DirInfo);
- FileList[FileCount] = NULL;
- return (FileList);
-
-#else
- /*
- * Linux/Unix cases - Wildcards are expanded by the shell automatically.
- * Just return the filename in a null terminated list
- */
- FileList[0] = AcpiOsAllocate (strlen (FileSpecifier) + 1);
- strcpy (FileList[0], FileSpecifier);
- FileList[1] = NULL;
-
- return (FileList);
-#endif
-}
-
-
/*******************************************************************************
*
* FUNCTION: AslDetectSourceFileType
@@ -332,7 +251,7 @@ AslDoDisassembly (
AcpiGbl_DbOpt_disasm = TRUE;
Status = AdAmlDisassemble (AslToFile,
Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_OutputFilenamePrefix,
- &Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_GetAllTables);
+ &Gbl_Files[ASL_FILE_INPUT].Filename);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -365,8 +284,11 @@ AslDoDisassembly (
return (AE_CTRL_CONTINUE);
}
- ACPI_FREE (Gbl_Files[ASL_FILE_INPUT].Filename);
+ /* No need to free the filename string */
+
Gbl_Files[ASL_FILE_INPUT].Filename = NULL;
+
+ CmDeleteCaches ();
return (AE_OK);
}
@@ -395,12 +317,29 @@ AslDoOneFile (
AslInitializeGlobals ();
PrInitializeGlobals ();
- Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
+ /*
+ * Extract the directory path. This path is used for possible include
+ * files and the optional AML filename embedded in the input file
+ * DefinitionBlock declaration.
+ */
+ Status = FlSplitInputPathname (Filename, &Gbl_DirectoryPath, NULL);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Take a copy of the input filename, convert any backslashes */
+
+ Gbl_Files[ASL_FILE_INPUT].Filename =
+ UtStringCacheCalloc (strlen (Filename) + 1);
+
+ strcpy (Gbl_Files[ASL_FILE_INPUT].Filename, Filename);
+ UtConvertBackslashes (Gbl_Files[ASL_FILE_INPUT].Filename);
/*
* AML Disassembly (Optional)
*/
- if (Gbl_DisasmFlag || Gbl_GetAllTables)
+ if (Gbl_DisasmFlag)
{
Status = AslDoDisassembly ();
if (Status != AE_CTRL_CONTINUE)
@@ -465,7 +404,6 @@ AslDoOneFile (
if (Gbl_Signature)
{
- ACPI_FREE (Gbl_Signature);
Gbl_Signature = NULL;
}
@@ -543,77 +481,6 @@ AslDoOneFile (
/*******************************************************************************
*
- * FUNCTION: AslDoOnePathname
- *
- * PARAMETERS: Pathname - Full pathname, possibly with wildcards
- *
- * RETURN: Status
- *
- * DESCRIPTION: Process one pathname, possible terminated with a wildcard
- * specification. If a wildcard, it is expanded and the multiple
- * files are processed.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AslDoOnePathname (
- char *Pathname,
- ASL_PATHNAME_CALLBACK PathCallback)
-{
- ACPI_STATUS Status = AE_OK;
- char **WildcardList;
- char *Filename;
- char *FullPathname;
-
-
- /* Split incoming path into a directory/filename combo */
-
- Status = FlSplitInputPathname (Pathname, &Gbl_DirectoryPath, &Filename);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- /* Expand possible wildcard into a file list (Windows/DOS only) */
-
- WildcardList = AsDoWildcard (Gbl_DirectoryPath, Filename);
- while (*WildcardList)
- {
- FullPathname = ACPI_ALLOCATE (
- strlen (Gbl_DirectoryPath) + strlen (*WildcardList) + 1);
-
- /* Construct a full path to the file */
-
- strcpy (FullPathname, Gbl_DirectoryPath);
- strcat (FullPathname, *WildcardList);
-
- /*
- * If -p not specified, we will use the input filename as the
- * output filename prefix
- */
- if (Gbl_UseDefaultAmlFilename)
- {
- Gbl_OutputFilenamePrefix = FullPathname;
- }
-
- /* Save status from all compiles */
-
- Status |= (*PathCallback) (FullPathname);
-
- ACPI_FREE (FullPathname);
- ACPI_FREE (*WildcardList);
- *WildcardList = NULL;
- WildcardList++;
- }
-
- ACPI_FREE (Gbl_DirectoryPath);
- ACPI_FREE (Filename);
- return (Status);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AslCheckForErrorExit
*
* PARAMETERS: None. Examines global exception count array
diff --git a/sys/contrib/dev/acpica/compiler/aslstubs.c b/sys/contrib/dev/acpica/compiler/aslstubs.c
index 9ac9698..2259255 100644
--- a/sys/contrib/dev/acpica/compiler/aslstubs.c
+++ b/sys/contrib/dev/acpica/compiler/aslstubs.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -53,17 +53,10 @@
/*
- * Stubs to simplify linkage to the ACPI CA core subsystem.
+ * Stubs to simplify linkage to the ACPICA core subsystem.
* Things like Events, Global Lock, etc. are not used
* by the compiler, so they are stubbed out here.
*/
-ACPI_PHYSICAL_ADDRESS
-AeLocalGetRootPointer (
- void)
-{
- return (0);
-}
-
void
AcpiNsExecModuleCodeList (
void)
@@ -232,21 +225,3 @@ AcpiTbFindTable (
{
return (AE_SUPPORT);
}
-
-/* OSL interfaces */
-
-ACPI_THREAD_ID
-AcpiOsGetThreadId (
- void)
-{
- return (0xFFFF);
-}
-
-ACPI_STATUS
-AcpiOsExecute (
- ACPI_EXECUTE_TYPE Type,
- ACPI_OSD_EXEC_CALLBACK Function,
- void *Context)
-{
- return (AE_SUPPORT);
-}
diff --git a/sys/contrib/dev/acpica/compiler/aslsupport.l b/sys/contrib/dev/acpica/compiler/aslsupport.l
index e7d2b1f..b3149cf 100644
--- a/sys/contrib/dev/acpica/compiler/aslsupport.l
+++ b/sys/contrib/dev/acpica/compiler/aslsupport.l
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,7 +42,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
/* Configuration */
#define ASL_SPACES_PER_TAB 4
@@ -72,6 +71,23 @@ ASL_FILE_NODE *Gbl_IncludeFileStack = NULL;
/*******************************************************************************
*
+ * FUNCTION: AslParserCleanup
+ *
+ * Used to delete the current buffer
+ *
+ ******************************************************************************/
+
+void
+AslParserCleanup (
+ void)
+{
+
+ yy_delete_buffer (YY_CURRENT_BUFFER);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AslDoLineDirective
*
* PARAMETERS: None. Uses input() to access current source code line
@@ -180,7 +196,8 @@ AslPopInputFileStack (
Fnode = Gbl_IncludeFileStack;
- DbgPrint (ASL_PARSE_OUTPUT, "\nPop InputFile Stack, Fnode %p\n\n", Fnode);
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "\nPop InputFile Stack, Fnode %p\n\n", Fnode);
if (!Fnode)
{
@@ -240,11 +257,11 @@ AslPushInputFileStack (
Fnode = UtLocalCalloc (sizeof (ASL_FILE_NODE));
- Fnode->File = yyin;
- Fnode->Next = Gbl_IncludeFileStack;
- Fnode->State = YY_CURRENT_BUFFER;
- Fnode->CurrentLineNumber = Gbl_CurrentLineNumber;
- Fnode->Filename = Gbl_Files[ASL_FILE_INPUT].Filename;
+ Fnode->File = yyin;
+ Fnode->Next = Gbl_IncludeFileStack;
+ Fnode->State = YY_CURRENT_BUFFER;
+ Fnode->Filename = Gbl_Files[ASL_FILE_INPUT].Filename;
+ Fnode->CurrentLineNumber = Gbl_CurrentLineNumber;
/* Push it on the stack */
@@ -255,11 +272,16 @@ AslPushInputFileStack (
State = yy_create_buffer (InputFile, YY_BUF_SIZE);
yy_switch_to_buffer (State);
- DbgPrint (ASL_PARSE_OUTPUT, "\nPush InputFile Stack, returning %p\n\n", InputFile);
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "\nPush InputFile Stack, returning %p\n\n", InputFile);
/* Reset the global line count and filename */
- Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
+ Gbl_Files[ASL_FILE_INPUT].Filename =
+ UtStringCacheCalloc (strlen (Filename) + 1);
+
+ strcpy (Gbl_Files[ASL_FILE_INPUT].Filename, Filename);
+
Gbl_CurrentLineNumber = 1;
yyin = InputFile;
}
@@ -301,7 +323,7 @@ AslResetCurrentLineBuffer (
*
* FUNCTION: AslInsertLineBuffer
*
- * PARAMETERS: SourceChar - One char from the input ASL source file
+ * PARAMETERS: SourceChar - One char from the input ASL source file
*
* RETURN: None
*
@@ -342,7 +364,8 @@ AslInsertLineBuffer (
*Gbl_LineBufPtr = (UINT8) SourceChar;
Gbl_LineBufPtr++;
- if (Gbl_LineBufPtr > (Gbl_CurrentLineBuffer + (Gbl_LineBufferSize - 1)))
+ if (Gbl_LineBufPtr >
+ (Gbl_CurrentLineBuffer + (Gbl_LineBufferSize - 1)))
{
#if 0
/*
@@ -351,9 +374,9 @@ AslInsertLineBuffer (
*/
sprintf (MsgBuffer, "Max %u", Gbl_LineBufferSize);
AslCommonError (ASL_WARNING, ASL_MSG_LONG_LINE,
- Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
- Gbl_CurrentLineOffset, Gbl_CurrentColumn,
- Gbl_Files[ASL_FILE_INPUT].Filename, MsgBuffer);
+ Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
+ Gbl_CurrentLineOffset, Gbl_CurrentColumn,
+ Gbl_Files[ASL_FILE_INPUT].Filename, MsgBuffer);
#endif
AslResetCurrentLineBuffer ();
@@ -372,12 +395,12 @@ AslInsertLineBuffer (
*
* FUNCTION: count
*
- * PARAMETERS: yytext - Contains the matched keyword.
- * Type - Keyword/Character type:
- * 0 = anything except a keyword
- * 1 = pseudo-keywords
- * 2 = non-executable ASL keywords
- * 3 = executable ASL keywords
+ * PARAMETERS: yytext - Contains the matched keyword.
+ * Type - Keyword/Character type:
+ * 0 = anything except a keyword
+ * 1 = pseudo-keywords
+ * 2 = non-executable ASL keywords
+ * 3 = executable ASL keywords
*
* RETURN: None
*
@@ -446,7 +469,7 @@ loop:
/* Eat chars until end-of-comment */
- while ((c = input()) != '*' && c != EOF)
+ while (((c = input ()) != '*') && (c != EOF))
{
AslInsertLineBuffer (c);
c1 = c;
@@ -464,16 +487,16 @@ loop:
if ((c1 == '/') && (c == '*'))
{
AslCommonError (ASL_WARNING, ASL_MSG_NESTED_COMMENT,
- Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
- Gbl_InputByteCount, Gbl_CurrentColumn,
- Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
+ Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
+ Gbl_InputByteCount, Gbl_CurrentColumn,
+ Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
}
/* Comment is closed only if the NEXT character is a slash */
AslInsertLineBuffer (c);
- if ((c1 = input()) != '/' && c1 != EOF)
+ if (((c1 = input ()) != '/') && (c1 != EOF))
{
unput(c1);
goto loop;
@@ -493,9 +516,9 @@ EarlyEOF:
* Premature End-Of-File
*/
AslCommonError (ASL_ERROR, ASL_MSG_EARLY_EOF,
- Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
- Gbl_CurrentLineOffset, Gbl_CurrentColumn,
- Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
+ Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
+ Gbl_CurrentLineOffset, Gbl_CurrentColumn,
+ Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
return (FALSE);
}
@@ -522,7 +545,7 @@ AslDoCommentType2 (
AslInsertLineBuffer ('/');
AslInsertLineBuffer ('/');
- while ((c = input()) != '\n' && c != EOF)
+ while (((c = input ()) != '\n') && (c != EOF))
{
AslInsertLineBuffer (c);
}
@@ -670,9 +693,9 @@ DoCharacter:
/* Unknown escape sequence issue warning, but use the character */
AslCommonError (ASL_WARNING, ASL_MSG_INVALID_ESCAPE,
- Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
- Gbl_CurrentLineOffset, Gbl_CurrentColumn,
- Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
+ Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
+ Gbl_CurrentLineOffset, Gbl_CurrentColumn,
+ Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
break;
}
break;
@@ -697,9 +720,9 @@ DoCharacter:
if ((Digit == 0) || (Digit > ACPI_ASCII_MAX))
{
AslCommonError (ASL_WARNING, ASL_MSG_INVALID_STRING,
- Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
- Gbl_CurrentLineOffset, Gbl_CurrentColumn,
- Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
+ Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
+ Gbl_CurrentLineOffset, Gbl_CurrentColumn,
+ Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
}
else
{
@@ -741,9 +764,9 @@ DoCharacter:
if ((Digit == 0) || (Digit > ACPI_ASCII_MAX))
{
AslCommonError (ASL_WARNING, ASL_MSG_INVALID_STRING,
- Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
- Gbl_CurrentLineOffset, Gbl_CurrentColumn,
- Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
+ Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
+ Gbl_CurrentLineOffset, Gbl_CurrentColumn,
+ Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
}
else
{
@@ -785,9 +808,9 @@ DoCharacter:
* Premature End-Of-File
*/
AslCommonError (ASL_ERROR, ASL_MSG_EARLY_EOF,
- Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
- Gbl_CurrentLineOffset, Gbl_CurrentColumn,
- Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
+ Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
+ Gbl_CurrentLineOffset, Gbl_CurrentColumn,
+ Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
return (FALSE);
@@ -797,13 +820,13 @@ CompletedString:
*/
*StringBuffer = 0;
- CleanString = UtGetStringBuffer (strlen (MsgBuffer) + 1);
+ CleanString = UtStringCacheCalloc (strlen (MsgBuffer) + 1);
if (!CleanString)
{
AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
- Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
- Gbl_CurrentLineOffset, Gbl_CurrentColumn,
- Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
+ Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
+ Gbl_CurrentLineOffset, Gbl_CurrentColumn,
+ Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
return (FALSE);
}
@@ -817,8 +840,8 @@ BufferOverflow:
/* Literal was too long */
AslCommonError (ASL_ERROR, ASL_MSG_STRING_LENGTH,
- Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
- Gbl_CurrentLineOffset, Gbl_CurrentColumn,
- Gbl_Files[ASL_FILE_INPUT].Filename, "Max length 4096");
+ Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
+ Gbl_CurrentLineOffset, Gbl_CurrentColumn,
+ Gbl_Files[ASL_FILE_INPUT].Filename, "Max length 4096");
return (FALSE);
}
diff --git a/sys/contrib/dev/acpica/compiler/aslsupport.y b/sys/contrib/dev/acpica/compiler/aslsupport.y
new file mode 100644
index 0000000..ba81b7d
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/aslsupport.y
@@ -0,0 +1,120 @@
+NoEcho('
+/******************************************************************************
+ *
+ * Module Name: aslsupport.y - Bison/Yacc C support functions
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+')
+
+/******************************************************************************
+ *
+ * Local support functions
+ *
+ *****************************************************************************/
+
+/*! [Begin] no source code translation */
+int
+AslCompilerwrap(void)
+{
+ return (1);
+}
+/*! [End] no source code translation !*/
+
+
+void *
+AslLocalAllocate (
+ unsigned int Size)
+{
+ void *Mem;
+
+
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "\nAslLocalAllocate: Expanding Stack to %u\n\n", Size);
+
+ Mem = ACPI_ALLOCATE_ZEROED (Size);
+ if (!Mem)
+ {
+ AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
+ Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
+ Gbl_InputByteCount, Gbl_CurrentColumn,
+ Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
+ exit (1);
+ }
+
+ return (Mem);
+}
+
+ACPI_PARSE_OBJECT *
+AslDoError (
+ void)
+{
+
+ return (TrCreateLeafNode (PARSEOP_ERRORNODE));
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: UtGetOpName
+ *
+ * PARAMETERS: ParseOpcode - Parser keyword ID
+ *
+ * RETURN: Pointer to the opcode name
+ *
+ * DESCRIPTION: Get the ascii name of the parse opcode
+ *
+ ******************************************************************************/
+
+char *
+UtGetOpName (
+ UINT32 ParseOpcode)
+{
+#ifdef ASL_YYTNAME_START
+ /*
+ * First entries (ASL_YYTNAME_START) in yytname are special reserved names.
+ * Ignore first 8 characters of the name
+ */
+ return ((char *) yytname
+ [(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
+#else
+ return ("[Unknown parser generator]");
+#endif
+}
diff --git a/sys/contrib/dev/acpica/compiler/asltokens.y b/sys/contrib/dev/acpica/compiler/asltokens.y
new file mode 100644
index 0000000..511fa9b
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/asltokens.y
@@ -0,0 +1,468 @@
+NoEcho('
+/******************************************************************************
+ *
+ * Module Name: asltokens.y - Bison/Yacc token types
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+')
+
+/******************************************************************************
+ *
+ * Token types: These are returned by the lexer
+ *
+ * NOTE: This list MUST match the AslKeywordMapping table found
+ * in aslmap.c EXACTLY! Double check any changes!
+ *
+ *****************************************************************************/
+
+%token <i> PARSEOP_ACCESSAS
+%token <i> PARSEOP_ACCESSATTRIB_BLOCK
+%token <i> PARSEOP_ACCESSATTRIB_BLOCK_CALL
+%token <i> PARSEOP_ACCESSATTRIB_BYTE
+%token <i> PARSEOP_ACCESSATTRIB_MULTIBYTE
+%token <i> PARSEOP_ACCESSATTRIB_QUICK
+%token <i> PARSEOP_ACCESSATTRIB_RAW_BYTES
+%token <i> PARSEOP_ACCESSATTRIB_RAW_PROCESS
+%token <i> PARSEOP_ACCESSATTRIB_SND_RCV
+%token <i> PARSEOP_ACCESSATTRIB_WORD
+%token <i> PARSEOP_ACCESSATTRIB_WORD_CALL
+%token <i> PARSEOP_ACCESSTYPE_ANY
+%token <i> PARSEOP_ACCESSTYPE_BUF
+%token <i> PARSEOP_ACCESSTYPE_BYTE
+%token <i> PARSEOP_ACCESSTYPE_DWORD
+%token <i> PARSEOP_ACCESSTYPE_QWORD
+%token <i> PARSEOP_ACCESSTYPE_WORD
+%token <i> PARSEOP_ACQUIRE
+%token <i> PARSEOP_ADD
+%token <i> PARSEOP_ADDRESSINGMODE_7BIT
+%token <i> PARSEOP_ADDRESSINGMODE_10BIT
+%token <i> PARSEOP_ADDRESSTYPE_ACPI
+%token <i> PARSEOP_ADDRESSTYPE_MEMORY
+%token <i> PARSEOP_ADDRESSTYPE_NVS
+%token <i> PARSEOP_ADDRESSTYPE_RESERVED
+%token <i> PARSEOP_ALIAS
+%token <i> PARSEOP_AND
+%token <i> PARSEOP_ARG0
+%token <i> PARSEOP_ARG1
+%token <i> PARSEOP_ARG2
+%token <i> PARSEOP_ARG3
+%token <i> PARSEOP_ARG4
+%token <i> PARSEOP_ARG5
+%token <i> PARSEOP_ARG6
+%token <i> PARSEOP_BANKFIELD
+%token <i> PARSEOP_BITSPERBYTE_EIGHT
+%token <i> PARSEOP_BITSPERBYTE_FIVE
+%token <i> PARSEOP_BITSPERBYTE_NINE
+%token <i> PARSEOP_BITSPERBYTE_SEVEN
+%token <i> PARSEOP_BITSPERBYTE_SIX
+%token <i> PARSEOP_BREAK
+%token <i> PARSEOP_BREAKPOINT
+%token <i> PARSEOP_BUFFER
+%token <i> PARSEOP_BUSMASTERTYPE_MASTER
+%token <i> PARSEOP_BUSMASTERTYPE_NOTMASTER
+%token <i> PARSEOP_BYTECONST
+%token <i> PARSEOP_CASE
+%token <i> PARSEOP_CLOCKPHASE_FIRST
+%token <i> PARSEOP_CLOCKPHASE_SECOND
+%token <i> PARSEOP_CLOCKPOLARITY_HIGH
+%token <i> PARSEOP_CLOCKPOLARITY_LOW
+%token <i> PARSEOP_CONCATENATE
+%token <i> PARSEOP_CONCATENATERESTEMPLATE
+%token <i> PARSEOP_CONDREFOF
+%token <i> PARSEOP_CONNECTION
+%token <i> PARSEOP_CONTINUE
+%token <i> PARSEOP_COPYOBJECT
+%token <i> PARSEOP_CREATEBITFIELD
+%token <i> PARSEOP_CREATEBYTEFIELD
+%token <i> PARSEOP_CREATEDWORDFIELD
+%token <i> PARSEOP_CREATEFIELD
+%token <i> PARSEOP_CREATEQWORDFIELD
+%token <i> PARSEOP_CREATEWORDFIELD
+%token <i> PARSEOP_DATABUFFER
+%token <i> PARSEOP_DATATABLEREGION
+%token <i> PARSEOP_DEBUG
+%token <i> PARSEOP_DECODETYPE_POS
+%token <i> PARSEOP_DECODETYPE_SUB
+%token <i> PARSEOP_DECREMENT
+%token <i> PARSEOP_DEFAULT
+%token <i> PARSEOP_DEFAULT_ARG
+%token <i> PARSEOP_DEFINITIONBLOCK
+%token <i> PARSEOP_DEREFOF
+%token <i> PARSEOP_DEVICE
+%token <i> PARSEOP_DEVICEPOLARITY_HIGH
+%token <i> PARSEOP_DEVICEPOLARITY_LOW
+%token <i> PARSEOP_DIVIDE
+%token <i> PARSEOP_DMA
+%token <i> PARSEOP_DMATYPE_A
+%token <i> PARSEOP_DMATYPE_COMPATIBILITY
+%token <i> PARSEOP_DMATYPE_B
+%token <i> PARSEOP_DMATYPE_F
+%token <i> PARSEOP_DWORDCONST
+%token <i> PARSEOP_DWORDIO
+%token <i> PARSEOP_DWORDMEMORY
+%token <i> PARSEOP_DWORDSPACE
+%token <i> PARSEOP_EISAID
+%token <i> PARSEOP_ELSE
+%token <i> PARSEOP_ELSEIF
+%token <i> PARSEOP_ENDDEPENDENTFN
+%token <i> PARSEOP_ENDIAN_BIG
+%token <i> PARSEOP_ENDIAN_LITTLE
+%token <i> PARSEOP_ENDTAG
+%token <i> PARSEOP_ERRORNODE
+%token <i> PARSEOP_EVENT
+%token <i> PARSEOP_EXTENDEDIO
+%token <i> PARSEOP_EXTENDEDMEMORY
+%token <i> PARSEOP_EXTENDEDSPACE
+%token <i> PARSEOP_EXTERNAL
+%token <i> PARSEOP_FATAL
+%token <i> PARSEOP_FIELD
+%token <i> PARSEOP_FINDSETLEFTBIT
+%token <i> PARSEOP_FINDSETRIGHTBIT
+%token <i> PARSEOP_FIXEDDMA
+%token <i> PARSEOP_FIXEDIO
+%token <i> PARSEOP_FLOWCONTROL_HW
+%token <i> PARSEOP_FLOWCONTROL_NONE
+%token <i> PARSEOP_FLOWCONTROL_SW
+%token <i> PARSEOP_FROMBCD
+%token <i> PARSEOP_FUNCTION
+%token <i> PARSEOP_GPIO_INT
+%token <i> PARSEOP_GPIO_IO
+%token <i> PARSEOP_I2C_SERIALBUS
+%token <i> PARSEOP_IF
+%token <i> PARSEOP_INCLUDE
+%token <i> PARSEOP_INCLUDE_END
+%token <i> PARSEOP_INCREMENT
+%token <i> PARSEOP_INDEX
+%token <i> PARSEOP_INDEXFIELD
+%token <i> PARSEOP_INTEGER
+%token <i> PARSEOP_INTERRUPT
+%token <i> PARSEOP_INTLEVEL_ACTIVEBOTH
+%token <i> PARSEOP_INTLEVEL_ACTIVEHIGH
+%token <i> PARSEOP_INTLEVEL_ACTIVELOW
+%token <i> PARSEOP_INTTYPE_EDGE
+%token <i> PARSEOP_INTTYPE_LEVEL
+%token <i> PARSEOP_IO
+%token <i> PARSEOP_IODECODETYPE_10
+%token <i> PARSEOP_IODECODETYPE_16
+%token <i> PARSEOP_IORESTRICT_IN
+%token <i> PARSEOP_IORESTRICT_NONE
+%token <i> PARSEOP_IORESTRICT_OUT
+%token <i> PARSEOP_IORESTRICT_PRESERVE
+%token <i> PARSEOP_IRQ
+%token <i> PARSEOP_IRQNOFLAGS
+%token <i> PARSEOP_LAND
+%token <i> PARSEOP_LEQUAL
+%token <i> PARSEOP_LGREATER
+%token <i> PARSEOP_LGREATEREQUAL
+%token <i> PARSEOP_LLESS
+%token <i> PARSEOP_LLESSEQUAL
+%token <i> PARSEOP_LNOT
+%token <i> PARSEOP_LNOTEQUAL
+%token <i> PARSEOP_LOAD
+%token <i> PARSEOP_LOADTABLE
+%token <i> PARSEOP_LOCAL0
+%token <i> PARSEOP_LOCAL1
+%token <i> PARSEOP_LOCAL2
+%token <i> PARSEOP_LOCAL3
+%token <i> PARSEOP_LOCAL4
+%token <i> PARSEOP_LOCAL5
+%token <i> PARSEOP_LOCAL6
+%token <i> PARSEOP_LOCAL7
+%token <i> PARSEOP_LOCKRULE_LOCK
+%token <i> PARSEOP_LOCKRULE_NOLOCK
+%token <i> PARSEOP_LOR
+%token <i> PARSEOP_MATCH
+%token <i> PARSEOP_MATCHTYPE_MEQ
+%token <i> PARSEOP_MATCHTYPE_MGE
+%token <i> PARSEOP_MATCHTYPE_MGT
+%token <i> PARSEOP_MATCHTYPE_MLE
+%token <i> PARSEOP_MATCHTYPE_MLT
+%token <i> PARSEOP_MATCHTYPE_MTR
+%token <i> PARSEOP_MAXTYPE_FIXED
+%token <i> PARSEOP_MAXTYPE_NOTFIXED
+%token <i> PARSEOP_MEMORY24
+%token <i> PARSEOP_MEMORY32
+%token <i> PARSEOP_MEMORY32FIXED
+%token <i> PARSEOP_MEMTYPE_CACHEABLE
+%token <i> PARSEOP_MEMTYPE_NONCACHEABLE
+%token <i> PARSEOP_MEMTYPE_PREFETCHABLE
+%token <i> PARSEOP_MEMTYPE_WRITECOMBINING
+%token <i> PARSEOP_METHOD
+%token <i> PARSEOP_METHODCALL
+%token <i> PARSEOP_MID
+%token <i> PARSEOP_MINTYPE_FIXED
+%token <i> PARSEOP_MINTYPE_NOTFIXED
+%token <i> PARSEOP_MOD
+%token <i> PARSEOP_MULTIPLY
+%token <i> PARSEOP_MUTEX
+%token <i> PARSEOP_NAME
+%token <s> PARSEOP_NAMESEG
+%token <s> PARSEOP_NAMESTRING
+%token <i> PARSEOP_NAND
+%token <i> PARSEOP_NOOP
+%token <i> PARSEOP_NOR
+%token <i> PARSEOP_NOT
+%token <i> PARSEOP_NOTIFY
+%token <i> PARSEOP_OBJECTTYPE
+%token <i> PARSEOP_OBJECTTYPE_BFF
+%token <i> PARSEOP_OBJECTTYPE_BUF
+%token <i> PARSEOP_OBJECTTYPE_DDB
+%token <i> PARSEOP_OBJECTTYPE_DEV
+%token <i> PARSEOP_OBJECTTYPE_EVT
+%token <i> PARSEOP_OBJECTTYPE_FLD
+%token <i> PARSEOP_OBJECTTYPE_INT
+%token <i> PARSEOP_OBJECTTYPE_MTH
+%token <i> PARSEOP_OBJECTTYPE_MTX
+%token <i> PARSEOP_OBJECTTYPE_OPR
+%token <i> PARSEOP_OBJECTTYPE_PKG
+%token <i> PARSEOP_OBJECTTYPE_POW
+%token <i> PARSEOP_OBJECTTYPE_PRO
+%token <i> PARSEOP_OBJECTTYPE_STR
+%token <i> PARSEOP_OBJECTTYPE_THZ
+%token <i> PARSEOP_OBJECTTYPE_UNK
+%token <i> PARSEOP_OFFSET
+%token <i> PARSEOP_ONE
+%token <i> PARSEOP_ONES
+%token <i> PARSEOP_OPERATIONREGION
+%token <i> PARSEOP_OR
+%token <i> PARSEOP_PACKAGE
+%token <i> PARSEOP_PACKAGE_LENGTH
+%token <i> PARSEOP_PARITYTYPE_EVEN
+%token <i> PARSEOP_PARITYTYPE_MARK
+%token <i> PARSEOP_PARITYTYPE_NONE
+%token <i> PARSEOP_PARITYTYPE_ODD
+%token <i> PARSEOP_PARITYTYPE_SPACE
+%token <i> PARSEOP_PIN_NOPULL
+%token <i> PARSEOP_PIN_PULLDEFAULT
+%token <i> PARSEOP_PIN_PULLDOWN
+%token <i> PARSEOP_PIN_PULLUP
+%token <i> PARSEOP_POWERRESOURCE
+%token <i> PARSEOP_PROCESSOR
+%token <i> PARSEOP_QWORDCONST
+%token <i> PARSEOP_QWORDIO
+%token <i> PARSEOP_QWORDMEMORY
+%token <i> PARSEOP_QWORDSPACE
+%token <i> PARSEOP_RANGETYPE_ENTIRE
+%token <i> PARSEOP_RANGETYPE_ISAONLY
+%token <i> PARSEOP_RANGETYPE_NONISAONLY
+%token <i> PARSEOP_RAW_DATA
+%token <i> PARSEOP_READWRITETYPE_BOTH
+%token <i> PARSEOP_READWRITETYPE_READONLY
+%token <i> PARSEOP_REFOF
+%token <i> PARSEOP_REGIONSPACE_CMOS
+%token <i> PARSEOP_REGIONSPACE_EC
+%token <i> PARSEOP_REGIONSPACE_FFIXEDHW
+%token <i> PARSEOP_REGIONSPACE_GPIO
+%token <i> PARSEOP_REGIONSPACE_GSBUS
+%token <i> PARSEOP_REGIONSPACE_IO
+%token <i> PARSEOP_REGIONSPACE_IPMI
+%token <i> PARSEOP_REGIONSPACE_MEM
+%token <i> PARSEOP_REGIONSPACE_PCC
+%token <i> PARSEOP_REGIONSPACE_PCI
+%token <i> PARSEOP_REGIONSPACE_PCIBAR
+%token <i> PARSEOP_REGIONSPACE_SMBUS
+%token <i> PARSEOP_REGISTER
+%token <i> PARSEOP_RELEASE
+%token <i> PARSEOP_RESERVED_BYTES
+%token <i> PARSEOP_RESET
+%token <i> PARSEOP_RESOURCETEMPLATE
+%token <i> PARSEOP_RESOURCETYPE_CONSUMER
+%token <i> PARSEOP_RESOURCETYPE_PRODUCER
+%token <i> PARSEOP_RETURN
+%token <i> PARSEOP_REVISION
+%token <i> PARSEOP_SCOPE
+%token <i> PARSEOP_SERIALIZERULE_NOTSERIAL
+%token <i> PARSEOP_SERIALIZERULE_SERIAL
+%token <i> PARSEOP_SHARETYPE_EXCLUSIVE
+%token <i> PARSEOP_SHARETYPE_EXCLUSIVEWAKE
+%token <i> PARSEOP_SHARETYPE_SHARED
+%token <i> PARSEOP_SHARETYPE_SHAREDWAKE
+%token <i> PARSEOP_SHIFTLEFT
+%token <i> PARSEOP_SHIFTRIGHT
+%token <i> PARSEOP_SIGNAL
+%token <i> PARSEOP_SIZEOF
+%token <i> PARSEOP_SLAVEMODE_CONTROLLERINIT
+%token <i> PARSEOP_SLAVEMODE_DEVICEINIT
+%token <i> PARSEOP_SLEEP
+%token <i> PARSEOP_SPI_SERIALBUS
+%token <i> PARSEOP_STALL
+%token <i> PARSEOP_STARTDEPENDENTFN
+%token <i> PARSEOP_STARTDEPENDENTFN_NOPRI
+%token <i> PARSEOP_STOPBITS_ONE
+%token <i> PARSEOP_STOPBITS_ONEPLUSHALF
+%token <i> PARSEOP_STOPBITS_TWO
+%token <i> PARSEOP_STOPBITS_ZERO
+%token <i> PARSEOP_STORE
+%token <s> PARSEOP_STRING_LITERAL
+%token <i> PARSEOP_SUBTRACT
+%token <i> PARSEOP_SWITCH
+%token <i> PARSEOP_THERMALZONE
+%token <i> PARSEOP_TIMER
+%token <i> PARSEOP_TOBCD
+%token <i> PARSEOP_TOBUFFER
+%token <i> PARSEOP_TODECIMALSTRING
+%token <i> PARSEOP_TOHEXSTRING
+%token <i> PARSEOP_TOINTEGER
+%token <i> PARSEOP_TOSTRING
+%token <i> PARSEOP_TOUUID
+%token <i> PARSEOP_TRANSLATIONTYPE_DENSE
+%token <i> PARSEOP_TRANSLATIONTYPE_SPARSE
+%token <i> PARSEOP_TYPE_STATIC
+%token <i> PARSEOP_TYPE_TRANSLATION
+%token <i> PARSEOP_UART_SERIALBUS
+%token <i> PARSEOP_UNICODE
+%token <i> PARSEOP_UNLOAD
+%token <i> PARSEOP_UPDATERULE_ONES
+%token <i> PARSEOP_UPDATERULE_PRESERVE
+%token <i> PARSEOP_UPDATERULE_ZEROS
+%token <i> PARSEOP_VAR_PACKAGE
+%token <i> PARSEOP_VENDORLONG
+%token <i> PARSEOP_VENDORSHORT
+%token <i> PARSEOP_WAIT
+%token <i> PARSEOP_WHILE
+%token <i> PARSEOP_WIREMODE_FOUR
+%token <i> PARSEOP_WIREMODE_THREE
+%token <i> PARSEOP_WORDBUSNUMBER
+%token <i> PARSEOP_WORDCONST
+%token <i> PARSEOP_WORDIO
+%token <i> PARSEOP_WORDSPACE
+%token <i> PARSEOP_XFERSIZE_8
+%token <i> PARSEOP_XFERSIZE_16
+%token <i> PARSEOP_XFERSIZE_32
+%token <i> PARSEOP_XFERSIZE_64
+%token <i> PARSEOP_XFERSIZE_128
+%token <i> PARSEOP_XFERSIZE_256
+%token <i> PARSEOP_XFERTYPE_8
+%token <i> PARSEOP_XFERTYPE_8_16
+%token <i> PARSEOP_XFERTYPE_16
+%token <i> PARSEOP_XOR
+%token <i> PARSEOP_ZERO
+
+/* ToPld macro */
+
+%token <i> PARSEOP_TOPLD
+%token <i> PARSEOP_PLD_REVISION
+%token <i> PARSEOP_PLD_IGNORECOLOR
+%token <i> PARSEOP_PLD_RED
+%token <i> PARSEOP_PLD_GREEN
+%token <i> PARSEOP_PLD_BLUE
+%token <i> PARSEOP_PLD_WIDTH
+%token <i> PARSEOP_PLD_HEIGHT
+%token <i> PARSEOP_PLD_USERVISIBLE
+%token <i> PARSEOP_PLD_DOCK
+%token <i> PARSEOP_PLD_LID
+%token <i> PARSEOP_PLD_PANEL
+%token <i> PARSEOP_PLD_VERTICALPOSITION
+%token <i> PARSEOP_PLD_HORIZONTALPOSITION
+%token <i> PARSEOP_PLD_SHAPE
+%token <i> PARSEOP_PLD_GROUPORIENTATION
+%token <i> PARSEOP_PLD_GROUPTOKEN
+%token <i> PARSEOP_PLD_GROUPPOSITION
+%token <i> PARSEOP_PLD_BAY
+%token <i> PARSEOP_PLD_EJECTABLE
+%token <i> PARSEOP_PLD_EJECTREQUIRED
+%token <i> PARSEOP_PLD_CABINETNUMBER
+%token <i> PARSEOP_PLD_CARDCAGENUMBER
+%token <i> PARSEOP_PLD_REFERENCE
+%token <i> PARSEOP_PLD_ROTATION
+%token <i> PARSEOP_PLD_ORDER
+%token <i> PARSEOP_PLD_RESERVED
+%token <i> PARSEOP_PLD_VERTICALOFFSET
+%token <i> PARSEOP_PLD_HORIZONTALOFFSET
+
+/*
+ * C-style expression parser. These must appear after all of the
+ * standard ASL operators and keywords.
+ *
+ * Note: The order of these tokens implements the precedence rules
+ * (low precedence to high). See aslrules.y for an exhaustive list.
+ */
+%right <i> PARSEOP_EXP_EQUALS
+ PARSEOP_EXP_ADD_EQ
+ PARSEOP_EXP_SUB_EQ
+ PARSEOP_EXP_MUL_EQ
+ PARSEOP_EXP_DIV_EQ
+ PARSEOP_EXP_MOD_EQ
+ PARSEOP_EXP_SHL_EQ
+ PARSEOP_EXP_SHR_EQ
+ PARSEOP_EXP_AND_EQ
+ PARSEOP_EXP_XOR_EQ
+ PARSEOP_EXP_OR_EQ
+
+%left <i> PARSEOP_EXP_LOGICAL_OR
+%left <i> PARSEOP_EXP_LOGICAL_AND
+%left <i> PARSEOP_EXP_OR
+%left <i> PARSEOP_EXP_XOR
+%left <i> PARSEOP_EXP_AND
+%left <i> PARSEOP_EXP_EQUAL
+ PARSEOP_EXP_NOT_EQUAL
+%left <i> PARSEOP_EXP_GREATER
+ PARSEOP_EXP_LESS
+ PARSEOP_EXP_GREATER_EQUAL
+ PARSEOP_EXP_LESS_EQUAL
+%left <i> PARSEOP_EXP_SHIFT_RIGHT
+ PARSEOP_EXP_SHIFT_LEFT
+%left <i> PARSEOP_EXP_ADD
+ PARSEOP_EXP_SUBTRACT
+%left <i> PARSEOP_EXP_MULTIPLY
+ PARSEOP_EXP_DIVIDE
+ PARSEOP_EXP_MODULO
+
+%right <i> PARSEOP_EXP_NOT
+ PARSEOP_EXP_LOGICAL_NOT
+
+%left <i> PARSEOP_EXP_INCREMENT
+ PARSEOP_EXP_DECREMENT
+
+%token <i> PARSEOP_PRINTF
+%token <i> PARSEOP_FPRINTF
+/* Specific parentheses tokens are not used at this time */
+ /* PARSEOP_EXP_PAREN_OPEN */
+ /* PARSEOP_EXP_PAREN_CLOSE */
+
+/*
+ * Special functions. These should probably stay at the end of this
+ * table.
+ */
+%token <i> PARSEOP___DATE__
+%token <i> PARSEOP___FILE__
+%token <i> PARSEOP___LINE__
+%token <i> PARSEOP___PATH__
diff --git a/sys/contrib/dev/acpica/compiler/asltransform.c b/sys/contrib/dev/acpica/compiler/asltransform.c
index 7e6ad39..c46801b 100644
--- a/sys/contrib/dev/acpica/compiler/asltransform.c
+++ b/sys/contrib/dev/acpica/compiler/asltransform.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@@ -377,7 +376,6 @@ TrDoDefinitionBlock (
*
* RETURN: None
*
- *
* DESCRIPTION: Translate ASL SWITCH statement to if/else pairs. There is
* no actual AML opcode for SWITCH -- it must be simulated.
*
@@ -450,10 +448,6 @@ TrDoSwitch (
{
/* Add an ELSE to complete the previous CASE */
- if (!Conditional)
- {
- return;
- }
NewOp = TrCreateLeafNode (PARSEOP_ELSE);
NewOp->Asl.Parent = Conditional->Asl.Parent;
TrAmlInitLineNumbers (NewOp, NewOp->Asl.Parent);
@@ -620,11 +614,6 @@ TrDoSwitch (
{
/* Convert the DEFAULT node to an ELSE */
- if (!Conditional)
- {
- return;
- }
-
TrAmlInitNode (DefaultOp, PARSEOP_ELSE);
DefaultOp->Asl.Parent = Conditional->Asl.Parent;
diff --git a/sys/contrib/dev/acpica/compiler/asltree.c b/sys/contrib/dev/acpica/compiler/asltree.c
index b2bbbfd..071231e 100644
--- a/sys/contrib/dev/acpica/compiler/asltree.c
+++ b/sys/contrib/dev/acpica/compiler/asltree.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acapps.h>
@@ -79,15 +78,29 @@ static ACPI_PARSE_OBJECT *
TrGetNextNode (
void)
{
+ ASL_CACHE_INFO *Cache;
+
- if (Gbl_NodeCacheNext >= Gbl_NodeCacheLast)
+ if (Gbl_ParseOpCacheNext >= Gbl_ParseOpCacheLast)
{
- Gbl_NodeCacheNext = UtLocalCalloc (sizeof (ACPI_PARSE_OBJECT) *
- ASL_NODE_CACHE_SIZE);
- Gbl_NodeCacheLast = Gbl_NodeCacheNext + ASL_NODE_CACHE_SIZE;
+ /* Allocate a new buffer */
+
+ Cache = UtLocalCalloc (sizeof (Cache->Next) +
+ (sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE));
+
+ /* Link new cache buffer to head of list */
+
+ Cache->Next = Gbl_ParseOpCacheList;
+ Gbl_ParseOpCacheList = Cache;
+
+ /* Setup cache management pointers */
+
+ Gbl_ParseOpCacheNext = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Cache->Buffer);
+ Gbl_ParseOpCacheLast = Gbl_ParseOpCacheNext + ASL_PARSEOP_CACHE_SIZE;
}
- return (Gbl_NodeCacheNext++);
+ Gbl_ParseOpCount++;
+ return (Gbl_ParseOpCacheNext++);
}
@@ -435,6 +448,124 @@ TrSetEndLineNumber (
/*******************************************************************************
*
+ * FUNCTION: TrCreateAssignmentNode
+ *
+ * PARAMETERS: Target - Assignment target
+ * Source - Assignment source
+ *
+ * RETURN: Pointer to the new node. Aborts on allocation failure
+ *
+ * DESCRIPTION: Implements the C-style '=' operator. It changes the parse
+ * tree if possible to utilize the last argument of the math
+ * operators which is a target operand -- thus saving invocation
+ * of and additional Store() operator. An optimization.
+ *
+ ******************************************************************************/
+
+ACPI_PARSE_OBJECT *
+TrCreateAssignmentNode (
+ ACPI_PARSE_OBJECT *Target,
+ ACPI_PARSE_OBJECT *Source)
+{
+ ACPI_PARSE_OBJECT *TargetOp;
+ ACPI_PARSE_OBJECT *SourceOp1;
+ ACPI_PARSE_OBJECT *SourceOp2;
+ ACPI_PARSE_OBJECT *Operator;
+
+
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "\nTrCreateAssignmentNode Line [%u to %u] Source %s Target %s\n",
+ Source->Asl.LineNumber, Source->Asl.EndLine,
+ UtGetOpName (Source->Asl.ParseOpcode),
+ UtGetOpName (Target->Asl.ParseOpcode));
+
+ TrSetNodeFlags (Target, NODE_IS_TARGET);
+
+ switch (Source->Asl.ParseOpcode)
+ {
+ /*
+ * Only these operators can be optimized because they have
+ * a target operand
+ */
+ case PARSEOP_ADD:
+ case PARSEOP_AND:
+ case PARSEOP_DIVIDE:
+ case PARSEOP_MOD:
+ case PARSEOP_MULTIPLY:
+ case PARSEOP_NOT:
+ case PARSEOP_OR:
+ case PARSEOP_SHIFTLEFT:
+ case PARSEOP_SHIFTRIGHT:
+ case PARSEOP_SUBTRACT:
+ case PARSEOP_XOR:
+
+ break;
+
+ /* Otherwise, just create a normal Store operator */
+
+ default:
+
+ goto CannotOptimize;
+ }
+
+ /*
+ * Transform the parse tree such that the target is moved to the
+ * last operand of the operator
+ */
+ SourceOp1 = Source->Asl.Child;
+ SourceOp2 = SourceOp1->Asl.Next;
+
+ /* NOT only has one operand, but has a target */
+
+ if (Source->Asl.ParseOpcode == PARSEOP_NOT)
+ {
+ SourceOp2 = SourceOp1;
+ }
+
+ /* DIVIDE has an extra target operand (remainder) */
+
+ if (Source->Asl.ParseOpcode == PARSEOP_DIVIDE)
+ {
+ SourceOp2 = SourceOp2->Asl.Next;
+ }
+
+ TargetOp = SourceOp2->Asl.Next;
+
+ /*
+ * Can't perform this optimization if there already is a target
+ * for the operator (ZERO is a "no target" placeholder).
+ */
+ if (TargetOp->Asl.ParseOpcode != PARSEOP_ZERO)
+ {
+ goto CannotOptimize;
+ }
+
+ /* Link in the target as the final operand */
+
+ SourceOp2->Asl.Next = Target;
+ Target->Asl.Parent = Source;
+
+ return (Source);
+
+
+CannotOptimize:
+
+ Operator = TrAllocateNode (PARSEOP_STORE);
+ TrLinkChildren (Operator, 2, Source, Target);
+
+ /* Set the appropriate line numbers for the new node */
+
+ Operator->Asl.LineNumber = Target->Asl.LineNumber;
+ Operator->Asl.LogicalLineNumber = Target->Asl.LogicalLineNumber;
+ Operator->Asl.LogicalByteOffset = Target->Asl.LogicalByteOffset;
+ Operator->Asl.Column = Target->Asl.Column;
+
+ return (Operator);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: TrCreateLeafNode
*
* PARAMETERS: ParseOpcode - New opcode to be assigned to the node
@@ -517,7 +648,6 @@ TrCreateConstantLeafNode (
/* Get the simple filename from the full path */
FlSplitInputPathname (Op->Asl.Filename, &Path, &Filename);
- ACPI_FREE (Path);
Op->Asl.Value.String = Filename;
break;
@@ -551,6 +681,81 @@ TrCreateConstantLeafNode (
/*******************************************************************************
*
+ * FUNCTION: TrCreateTargetOperand
+ *
+ * PARAMETERS: OriginalOp - Op to be copied
+ *
+ * RETURN: Pointer to the new node. Aborts on allocation failure
+ *
+ * DESCRIPTION: Copy an existing node (and subtree). Used in ASL+ (C-style)
+ * expressions where the target is the same as one of the
+ * operands. A new node and subtree must be created from the
+ * original so that the parse tree can be linked properly.
+ *
+ * NOTE: This code is specific to target operands that are the last
+ * operand in an ASL/AML operator. Meaning that the top-level
+ * parse Op in a possible subtree has a NULL Next pointer.
+ * This simplifies the recursion.
+ *
+ * Subtree example:
+ * DeRefOf (Local1) += 32
+ *
+ * This gets converted to:
+ * Add (DeRefOf (Local1), 32, DeRefOf (Local1))
+ *
+ * Each DeRefOf has a single child, Local1. Even more complex
+ * subtrees can be created via the Index and DeRefOf operators.
+ *
+ ******************************************************************************/
+
+ACPI_PARSE_OBJECT *
+TrCreateTargetOperand (
+ ACPI_PARSE_OBJECT *OriginalOp,
+ ACPI_PARSE_OBJECT *ParentOp)
+{
+ ACPI_PARSE_OBJECT *Op;
+
+
+ if (!OriginalOp)
+ {
+ return (NULL);
+ }
+
+ Op = TrGetNextNode ();
+
+ /* Copy the pertinent values (omit link pointer fields) */
+
+ Op->Asl.Value = OriginalOp->Asl.Value;
+ Op->Asl.Filename = OriginalOp->Asl.Filename;
+ Op->Asl.LineNumber = OriginalOp->Asl.LineNumber;
+ Op->Asl.LogicalLineNumber = OriginalOp->Asl.LogicalLineNumber;
+ Op->Asl.LogicalByteOffset = OriginalOp->Asl.LogicalByteOffset;
+ Op->Asl.Column = OriginalOp->Asl.Column;
+ Op->Asl.Flags = OriginalOp->Asl.Flags;
+ Op->Asl.CompileFlags = OriginalOp->Asl.CompileFlags;
+ Op->Asl.AmlOpcode = OriginalOp->Asl.AmlOpcode;
+ Op->Asl.ParseOpcode = OriginalOp->Asl.ParseOpcode;
+ Op->Asl.Parent = ParentOp;
+ UtSetParseOpName (Op);
+
+ /* Copy a possible subtree below this node */
+
+ if (OriginalOp->Asl.Child)
+ {
+ Op->Asl.Child = TrCreateTargetOperand (OriginalOp->Asl.Child, Op);
+ }
+
+ if (OriginalOp->Asl.Next) /* Null for top-level node */
+ {
+ Op->Asl.Next = TrCreateTargetOperand (OriginalOp->Asl.Next, ParentOp);
+ }
+
+ return (Op);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: TrCreateValuedLeafNode
*
* PARAMETERS: ParseOpcode - New opcode to be assigned to the node
diff --git a/sys/contrib/dev/acpica/compiler/asltypes.h b/sys/contrib/dev/acpica/compiler/asltypes.h
index 5ca17b3..4bd24da 100644
--- a/sys/contrib/dev/acpica/compiler/asltypes.h
+++ b/sys/contrib/dev/acpica/compiler/asltypes.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#ifndef __ASLTYPES_H
#define __ASLTYPES_H
@@ -166,15 +165,26 @@ typedef enum
ASL_FILE_C_SOURCE_OUTPUT,
ASL_FILE_ASM_INCLUDE_OUTPUT,
ASL_FILE_C_INCLUDE_OUTPUT,
- ASL_FILE_C_OFFSET_OUTPUT
+ ASL_FILE_C_OFFSET_OUTPUT,
+ ASL_FILE_MAP_OUTPUT
} ASL_FILE_TYPES;
-#define ASL_MAX_FILE_TYPE 14
+#define ASL_MAX_FILE_TYPE 15
#define ASL_NUM_FILES (ASL_MAX_FILE_TYPE + 1)
+/* Cache block structure for ParseOps and Strings */
+
+typedef struct asl_cache_info
+{
+ void *Next;
+ char Buffer[1];
+
+} ASL_CACHE_INFO;
+
+
typedef struct asl_include_dir
{
char *Dir;
@@ -196,7 +206,7 @@ typedef struct asl_error_msg
char *Filename;
char *SourceLine;
UINT32 FilenameLength;
- UINT8 MessageId;
+ UINT16 MessageId;
UINT8 Level;
} ASL_ERROR_MSG;
@@ -238,4 +248,35 @@ typedef struct asl_event_info
} ASL_EVENT_INFO;
+/* Hardware mapping file structures */
+
+typedef struct acpi_gpio_info
+{
+ struct acpi_gpio_info *Next;
+ ACPI_PARSE_OBJECT *Op;
+ char *DeviceName;
+ ACPI_NAMESPACE_NODE *TargetNode;
+ UINT32 References;
+ UINT32 PinCount;
+ UINT32 PinIndex;
+ UINT16 PinNumber;
+ UINT8 Type;
+ UINT8 Direction;
+ UINT8 Polarity;
+
+} ACPI_GPIO_INFO;
+
+typedef struct acpi_serial_info
+{
+ struct acpi_serial_info *Next;
+ ACPI_PARSE_OBJECT *Op;
+ char *DeviceName;
+ ACPI_NAMESPACE_NODE *TargetNode;
+ AML_RESOURCE *Resource;
+ UINT32 Speed;
+ UINT16 Address;
+
+} ACPI_SERIAL_INFO;
+
+
#endif /* __ASLTYPES_H */
diff --git a/sys/contrib/dev/acpica/compiler/asltypes.y b/sys/contrib/dev/acpica/compiler/asltypes.y
new file mode 100644
index 0000000..3177d1d
--- /dev/null
+++ b/sys/contrib/dev/acpica/compiler/asltypes.y
@@ -0,0 +1,393 @@
+NoEcho('
+/******************************************************************************
+ *
+ * Module Name: asltypes.y - Bison/Yacc production types/names
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+')
+
+/******************************************************************************
+ *
+ * Production names
+ *
+ *****************************************************************************/
+
+%type <n> ArgList
+%type <n> ASLCode
+%type <n> BufferData
+%type <n> BufferTermData
+%type <n> CompilerDirective
+%type <n> DataObject
+%type <n> DefinitionBlockTerm
+%type <n> IntegerData
+%type <n> NamedObject
+%type <n> NameSpaceModifier
+%type <n> Object
+%type <n> ObjectList
+%type <n> PackageData
+%type <n> ParameterTypePackage
+%type <n> ParameterTypePackageList
+%type <n> ParameterTypesPackage
+%type <n> ParameterTypesPackageList
+%type <n> RequiredTarget
+%type <n> SimpleTarget
+%type <n> StringData
+%type <n> Target
+%type <n> Term
+%type <n> TermArg
+%type <n> TermList
+%type <n> UserTerm
+
+/* Type4Opcode is obsolete */
+
+%type <n> Type1Opcode
+%type <n> Type2BufferOpcode
+%type <n> Type2BufferOrStringOpcode
+%type <n> Type2IntegerOpcode
+%type <n> Type2Opcode
+%type <n> Type2StringOpcode
+%type <n> Type3Opcode
+%type <n> Type5Opcode
+%type <n> Type6Opcode
+
+%type <n> AccessAsTerm
+%type <n> ExternalTerm
+%type <n> FieldUnit
+%type <n> FieldUnitEntry
+%type <n> FieldUnitList
+%type <n> IncludeTerm
+%type <n> OffsetTerm
+%type <n> OptionalAccessAttribTerm
+
+/* Named Objects */
+
+%type <n> BankFieldTerm
+%type <n> CreateBitFieldTerm
+%type <n> CreateByteFieldTerm
+%type <n> CreateDWordFieldTerm
+%type <n> CreateFieldTerm
+%type <n> CreateQWordFieldTerm
+%type <n> CreateWordFieldTerm
+%type <n> DataRegionTerm
+%type <n> DeviceTerm
+%type <n> EventTerm
+%type <n> FieldTerm
+%type <n> FunctionTerm
+%type <n> IndexFieldTerm
+%type <n> MethodTerm
+%type <n> MutexTerm
+%type <n> OpRegionTerm
+%type <n> OpRegionSpaceIdTerm
+%type <n> PowerResTerm
+%type <n> ProcessorTerm
+%type <n> ThermalZoneTerm
+
+/* Namespace modifiers */
+
+%type <n> AliasTerm
+%type <n> NameTerm
+%type <n> ScopeTerm
+
+/* Type 1 opcodes */
+
+%type <n> BreakPointTerm
+%type <n> BreakTerm
+%type <n> CaseDefaultTermList
+%type <n> CaseTerm
+%type <n> ContinueTerm
+%type <n> DefaultTerm
+%type <n> ElseTerm
+%type <n> FatalTerm
+%type <n> IfElseTerm
+%type <n> IfTerm
+%type <n> LoadTerm
+%type <n> NoOpTerm
+%type <n> NotifyTerm
+%type <n> ReleaseTerm
+%type <n> ResetTerm
+%type <n> ReturnTerm
+%type <n> SignalTerm
+%type <n> SleepTerm
+%type <n> StallTerm
+%type <n> SwitchTerm
+%type <n> UnloadTerm
+%type <n> WhileTerm
+/* %type <n> CaseTermList */
+
+/* Type 2 opcodes */
+
+%type <n> AcquireTerm
+%type <n> AddTerm
+%type <n> AndTerm
+%type <n> ConcatResTerm
+%type <n> ConcatTerm
+%type <n> CondRefOfTerm
+%type <n> CopyObjectTerm
+%type <n> DecTerm
+%type <n> DerefOfTerm
+%type <n> DivideTerm
+%type <n> FindSetLeftBitTerm
+%type <n> FindSetRightBitTerm
+%type <n> FromBCDTerm
+%type <n> IncTerm
+%type <n> IndexTerm
+%type <n> LAndTerm
+%type <n> LEqualTerm
+%type <n> LGreaterEqualTerm
+%type <n> LGreaterTerm
+%type <n> LLessEqualTerm
+%type <n> LLessTerm
+%type <n> LNotEqualTerm
+%type <n> LNotTerm
+%type <n> LoadTableTerm
+%type <n> LOrTerm
+%type <n> MatchTerm
+%type <n> MidTerm
+%type <n> ModTerm
+%type <n> MultiplyTerm
+%type <n> NAndTerm
+%type <n> NOrTerm
+%type <n> NotTerm
+%type <n> ObjectTypeTerm
+%type <n> OrTerm
+%type <n> RefOfTerm
+%type <n> ShiftLeftTerm
+%type <n> ShiftRightTerm
+%type <n> SizeOfTerm
+%type <n> StoreTerm
+%type <n> SubtractTerm
+%type <n> TimerTerm
+%type <n> ToBCDTerm
+%type <n> ToBufferTerm
+%type <n> ToDecimalStringTerm
+%type <n> ToHexStringTerm
+%type <n> ToIntegerTerm
+%type <n> ToStringTerm
+%type <n> WaitTerm
+%type <n> XOrTerm
+
+/* Keywords */
+
+%type <n> AccessAttribKeyword
+%type <n> AccessTypeKeyword
+%type <n> AddressingModeKeyword
+%type <n> AddressKeyword
+%type <n> AddressSpaceKeyword
+%type <n> BitsPerByteKeyword
+%type <n> ClockPhaseKeyword
+%type <n> ClockPolarityKeyword
+%type <n> DecodeKeyword
+%type <n> DevicePolarityKeyword
+%type <n> DMATypeKeyword
+%type <n> EndianKeyword
+%type <n> FlowControlKeyword
+%type <n> InterruptLevel
+%type <n> InterruptTypeKeyword
+%type <n> IODecodeKeyword
+%type <n> IoRestrictionKeyword
+%type <n> LockRuleKeyword
+%type <n> MatchOpKeyword
+%type <n> MaxKeyword
+%type <n> MemTypeKeyword
+%type <n> MinKeyword
+%type <n> ObjectTypeKeyword
+%type <n> OptionalBusMasterKeyword
+%type <n> OptionalReadWriteKeyword
+%type <n> ParityTypeKeyword
+%type <n> PinConfigByte
+%type <n> PinConfigKeyword
+%type <n> RangeTypeKeyword
+%type <n> RegionSpaceKeyword
+%type <n> ResourceTypeKeyword
+%type <n> SerializeRuleKeyword
+%type <n> ShareTypeKeyword
+%type <n> SlaveModeKeyword
+%type <n> StopBitsKeyword
+%type <n> TranslationKeyword
+%type <n> TypeKeyword
+%type <n> UpdateRuleKeyword
+%type <n> WireModeKeyword
+%type <n> XferSizeKeyword
+%type <n> XferTypeKeyword
+
+/* Types */
+
+%type <n> SuperName
+%type <n> ObjectTypeName
+%type <n> ArgTerm
+%type <n> LocalTerm
+%type <n> DebugTerm
+
+%type <n> Integer
+%type <n> ByteConst
+%type <n> WordConst
+%type <n> DWordConst
+%type <n> QWordConst
+%type <n> String
+
+%type <n> ConstTerm
+%type <n> ConstExprTerm
+%type <n> ByteConstExpr
+%type <n> WordConstExpr
+%type <n> DWordConstExpr
+%type <n> QWordConstExpr
+
+%type <n> DWordList
+%type <n> BufferTerm
+%type <n> ByteList
+
+%type <n> PackageElement
+%type <n> PackageList
+%type <n> PackageTerm
+%type <n> VarPackageLengthTerm
+
+/* Macros */
+
+%type <n> EISAIDTerm
+%type <n> ResourceMacroList
+%type <n> ResourceMacroTerm
+%type <n> ResourceTemplateTerm
+%type <n> PldKeyword
+%type <n> PldKeywordList
+%type <n> ToPLDTerm
+%type <n> ToUUIDTerm
+%type <n> UnicodeTerm
+%type <n> PrintfArgList
+%type <n> PrintfTerm
+%type <n> FprintfTerm
+
+/* Resource Descriptors */
+
+%type <n> ConnectionTerm
+%type <n> DataBufferTerm
+%type <n> DMATerm
+%type <n> DWordIOTerm
+%type <n> DWordMemoryTerm
+%type <n> DWordSpaceTerm
+%type <n> EndDependentFnTerm
+%type <n> ExtendedIOTerm
+%type <n> ExtendedMemoryTerm
+%type <n> ExtendedSpaceTerm
+%type <n> FixedDmaTerm
+%type <n> FixedIOTerm
+%type <n> GpioIntTerm
+%type <n> GpioIoTerm
+%type <n> I2cSerialBusTerm
+%type <n> InterruptTerm
+%type <n> IOTerm
+%type <n> IRQNoFlagsTerm
+%type <n> IRQTerm
+%type <n> Memory24Term
+%type <n> Memory32FixedTerm
+%type <n> Memory32Term
+%type <n> NameSeg
+%type <n> NameString
+%type <n> QWordIOTerm
+%type <n> QWordMemoryTerm
+%type <n> QWordSpaceTerm
+%type <n> RegisterTerm
+%type <n> SpiSerialBusTerm
+%type <n> StartDependentFnNoPriTerm
+%type <n> StartDependentFnTerm
+%type <n> UartSerialBusTerm
+%type <n> VendorLongTerm
+%type <n> VendorShortTerm
+%type <n> WordBusNumberTerm
+%type <n> WordIOTerm
+%type <n> WordSpaceTerm
+
+/* Local types that help construct the AML, not in ACPI spec */
+
+%type <n> AmlPackageLengthTerm
+%type <n> IncludeEndTerm
+%type <n> NameStringItem
+%type <n> TermArgItem
+
+%type <n> OptionalAccessSize
+%type <n> OptionalAddressingMode
+%type <n> OptionalAddressRange
+%type <n> OptionalBitsPerByte
+%type <n> OptionalBuffer_Last
+%type <n> OptionalByteConstExpr
+%type <n> OptionalCount
+%type <n> OptionalDecodeType
+%type <n> OptionalDevicePolarity
+%type <n> OptionalDWordConstExpr
+%type <n> OptionalEndian
+%type <n> OptionalFlowControl
+%type <n> OptionalIoRestriction
+%type <n> OptionalListString
+%type <n> OptionalMaxType
+%type <n> OptionalMemType
+%type <n> OptionalMinType
+%type <n> OptionalNameString
+%type <n> OptionalNameString_First
+%type <n> OptionalNameString_Last
+%type <n> OptionalObjectTypeKeyword
+%type <n> OptionalParameterTypePackage
+%type <n> OptionalParameterTypesPackage
+%type <n> OptionalParityType
+%type <n> OptionalQWordConstExpr
+%type <n> OptionalRangeType
+%type <n> OptionalReference
+%type <n> OptionalResourceType
+%type <n> OptionalResourceType_First
+%type <n> OptionalReturnArg
+%type <n> OptionalSerializeRuleKeyword
+%type <n> OptionalShareType
+%type <n> OptionalShareType_First
+%type <n> OptionalSlaveMode
+%type <n> OptionalStopBits
+%type <n> OptionalStringData
+%type <n> OptionalTermArg
+%type <n> OptionalTranslationType_Last
+%type <n> OptionalType
+%type <n> OptionalType_Last
+%type <n> OptionalWireMode
+%type <n> OptionalWordConst
+%type <n> OptionalWordConstExpr
+%type <n> OptionalXferSize
+
+/*
+ * C-style expression parser
+ */
+%type <n> Expression
+%type <n> EqualsTerm
diff --git a/sys/contrib/dev/acpica/compiler/aslutils.c b/sys/contrib/dev/acpica/compiler/aslutils.c
index eea5d68..7258daa 100644
--- a/sys/contrib/dev/acpica/compiler/aslutils.c
+++ b/sys/contrib/dev/acpica/compiler/aslutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acdisasm.h>
@@ -243,37 +242,6 @@ UtEndEvent (
/*******************************************************************************
*
- * FUNCTION: UtHexCharToValue
- *
- * PARAMETERS: HexChar - Hex character in Ascii
- *
- * RETURN: The binary value of the hex character
- *
- * DESCRIPTION: Perform ascii-to-hex translation
- *
- ******************************************************************************/
-
-UINT8
-UtHexCharToValue (
- int HexChar)
-{
-
- if (HexChar <= 0x39)
- {
- return ((UINT8) (HexChar - 0x30));
- }
-
- if (HexChar <= 0x46)
- {
- return ((UINT8) (HexChar - 0x37));
- }
-
- return ((UINT8) (HexChar - 0x57));
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: UtConvertByteToHex
*
* PARAMETERS: RawByte - Binary data
@@ -296,8 +264,8 @@ UtConvertByteToHex (
Buffer[0] = '0';
Buffer[1] = 'x';
- Buffer[2] = (UINT8) AslHexLookup[(RawByte >> 4) & 0xF];
- Buffer[3] = (UINT8) AslHexLookup[RawByte & 0xF];
+ Buffer[2] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 4);
+ Buffer[3] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 0);
}
@@ -312,7 +280,7 @@ UtConvertByteToHex (
* RETURN: Ascii hex byte is stored in Buffer.
*
* DESCRIPTION: Perform hex-to-ascii translation. The return data is prefixed
- * with "0x"
+ * with '0', and a trailing 'h' is added.
*
******************************************************************************/
@@ -323,8 +291,8 @@ UtConvertByteToAsmHex (
{
Buffer[0] = '0';
- Buffer[1] = (UINT8) AslHexLookup[(RawByte >> 4) & 0xF];
- Buffer[2] = (UINT8) AslHexLookup[RawByte & 0xF];
+ Buffer[1] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 4);
+ Buffer[2] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 0);
Buffer[3] = 'h';
}
@@ -585,7 +553,7 @@ UtCheckIntegerRange (
/*******************************************************************************
*
- * FUNCTION: UtGetStringBuffer
+ * FUNCTION: UtStringCacheCalloc
*
* PARAMETERS: Length - Size of buffer requested
*
@@ -598,22 +566,58 @@ UtCheckIntegerRange (
******************************************************************************/
char *
-UtGetStringBuffer (
+UtStringCacheCalloc (
UINT32 Length)
{
char *Buffer;
+ ASL_CACHE_INFO *Cache;
+ UINT32 CacheSize = ASL_STRING_CACHE_SIZE;
+
+
+ if (Length > CacheSize)
+ {
+ CacheSize = Length;
+
+ if (Gbl_StringCacheList)
+ {
+ Cache = UtLocalCalloc (sizeof (Cache->Next) + CacheSize);
+
+ /* Link new cache buffer just following head of list */
+
+ Cache->Next = Gbl_StringCacheList->Next;
+ Gbl_StringCacheList->Next = Cache;
+ /* Leave cache management pointers alone as they pertain to head */
+
+ Gbl_StringCount++;
+ Gbl_StringSize += Length;
+
+ return (Cache->Buffer);
+ }
+ }
if ((Gbl_StringCacheNext + Length) >= Gbl_StringCacheLast)
{
- Gbl_StringCacheNext = UtLocalCalloc (ASL_STRING_CACHE_SIZE + Length);
- Gbl_StringCacheLast = Gbl_StringCacheNext + ASL_STRING_CACHE_SIZE +
- Length;
+ /* Allocate a new buffer */
+
+ Cache = UtLocalCalloc (sizeof (Cache->Next) + CacheSize);
+
+ /* Link new cache buffer to head of list */
+
+ Cache->Next = Gbl_StringCacheList;
+ Gbl_StringCacheList = Cache;
+
+ /* Setup cache management pointers */
+
+ Gbl_StringCacheNext = Cache->Buffer;
+ Gbl_StringCacheLast = Gbl_StringCacheNext + CacheSize;
}
+ Gbl_StringCount++;
+ Gbl_StringSize += Length;
+
Buffer = Gbl_StringCacheNext;
Gbl_StringCacheNext += Length;
-
return (Buffer);
}
@@ -646,7 +650,8 @@ UtExpandLineBuffers (
NewSize = Gbl_LineBufferSize * 2;
if (Gbl_CurrentLineBuffer)
{
- DbgPrint (ASL_DEBUG_OUTPUT,"Increasing line buffer size from %u to %u\n",
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "Increasing line buffer size from %u to %u\n",
Gbl_LineBufferSize, NewSize);
}
@@ -691,6 +696,30 @@ ErrorExit:
}
+/******************************************************************************
+ *
+ * FUNCTION: UtFreeLineBuffers
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Free all line buffers
+ *
+ *****************************************************************************/
+
+void
+UtFreeLineBuffers (
+ void)
+{
+
+ free (Gbl_CurrentLineBuffer);
+ free (Gbl_MainTokenBuffer);
+ free (Gbl_MacroTokenBuffer);
+ free (Gbl_ExpressionTokenBuffer);
+}
+
+
/*******************************************************************************
*
* FUNCTION: UtInternalizeName
@@ -723,9 +752,9 @@ UtInternalizeName (
Info.ExternalName = ExternalName;
AcpiNsGetInternalNameLength (&Info);
- /* We need a segment to store the internal name */
+ /* We need a segment to store the internal name */
- Info.InternalName = UtGetStringBuffer (Info.Length);
+ Info.InternalName = UtStringCacheCalloc (Info.Length);
if (!Info.InternalName)
{
return (AE_NO_MEMORY);
@@ -918,7 +947,7 @@ UtDoConstant (
}
-/* TBD: use version in ACPI CA main code base? */
+/* TBD: use version in ACPICA main code base? */
/*******************************************************************************
*
diff --git a/sys/contrib/dev/acpica/compiler/asluuid.c b/sys/contrib/dev/acpica/compiler/asluuid.c
index ed884dc..4e345e9 100644
--- a/sys/contrib/dev/acpica/compiler/asluuid.c
+++ b/sys/contrib/dev/acpica/compiler/asluuid.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,42 +41,13 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("asluuid")
-/*
- * UUID support functions.
- *
- * This table is used to convert an input UUID ascii string to a 16 byte
- * buffer and the reverse. The table maps a UUID buffer index 0-15 to
- * the index within the 36-byte UUID string where the associated 2-byte
- * hex value can be found.
- *
- * 36-byte UUID strings are of the form:
- * aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
- * Where aa-pp are one byte hex numbers, made up of two hex digits
- *
- * Note: This table is basically the inverse of the string-to-offset table
- * found in the ACPI spec in the description of the ToUUID macro.
- */
-static UINT8 Gbl_MapToUuidOffset[16] =
-{
- 6,4,2,0,11,9,16,14,19,21,24,26,28,30,32,34
-};
-
-#define UUID_BUFFER_LENGTH 16
-#define UUID_STRING_LENGTH 36
-
-/* Positions for required hyphens (dashes) in UUID strings */
-
-#define UUID_HYPHEN1_OFFSET 8
-#define UUID_HYPHEN2_OFFSET 13
-#define UUID_HYPHEN3_OFFSET 18
-#define UUID_HYPHEN4_OFFSET 23
+extern UINT8 AcpiGbl_MapToUuidOffset[UUID_BUFFER_LENGTH];
/*******************************************************************************
@@ -137,42 +108,6 @@ AuValidateUuid (
/*******************************************************************************
*
- * FUNCTION: AuConvertStringToUuid
- *
- * PARAMETERS: InString - 36-byte formatted UUID string
- * UuidBuffer - 16-byte UUID buffer
- *
- * RETURN: Status
- *
- * DESCRIPTION: Convert 36-byte formatted UUID string to 16-byte UUID buffer
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AuConvertStringToUuid (
- char *InString,
- char *UuidBuffer)
-{
- UINT32 i;
-
-
- if (!InString || !UuidBuffer)
- {
- return (AE_BAD_PARAMETER);
- }
-
- for (i = 0; i < UUID_BUFFER_LENGTH; i++)
- {
- UuidBuffer[i] = (char) (UtHexCharToValue (InString[Gbl_MapToUuidOffset[i]]) << 4);
- UuidBuffer[i] |= (char) UtHexCharToValue (InString[Gbl_MapToUuidOffset[i] + 1]);
- }
-
- return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AuConvertUuidToString
*
* PARAMETERS: UuidBuffer - 16-byte UUID buffer
@@ -200,8 +135,11 @@ AuConvertUuidToString (
for (i = 0; i < UUID_BUFFER_LENGTH; i++)
{
- OutString[Gbl_MapToUuidOffset[i]] = (UINT8) AslHexLookup[(UuidBuffer[i] >> 4) & 0xF];
- OutString[Gbl_MapToUuidOffset[i] + 1] = (UINT8) AslHexLookup[UuidBuffer[i] & 0xF];
+ OutString[AcpiGbl_MapToUuidOffset[i]] =
+ AcpiUtHexToAsciiChar (UuidBuffer[i], 4);
+
+ OutString[AcpiGbl_MapToUuidOffset[i] + 1] =
+ AcpiUtHexToAsciiChar (UuidBuffer[i], 0);
}
/* Insert required hyphens (dashes) */
diff --git a/sys/contrib/dev/acpica/compiler/aslwalks.c b/sys/contrib/dev/acpica/compiler/aslwalks.c
index 7dfa7af..c378f2d 100644
--- a/sys/contrib/dev/acpica/compiler/aslwalks.c
+++ b/sys/contrib/dev/acpica/compiler/aslwalks.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acparser.h>
@@ -295,6 +294,13 @@ AnOperandTypecheckWalkEnd (
{
RequiredBtypes = AnMapArgTypeToBtype (ArgType);
+ if (!ArgOp)
+ {
+ AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, Op,
+ "Null ArgOp in argument loop");
+ AslAbort ();
+ }
+
ThisNodeBtype = AnGetBtype (ArgOp);
if (ThisNodeBtype == ACPI_UINT32_MAX)
{
@@ -605,6 +611,10 @@ AnOtherSemanticAnalysisWalkBegin (
ArgNode = Op->Asl.Parent; /* Field definition */
ArgNode = ArgNode->Asl.Child; /* First child is the OpRegion Name */
Node = ArgNode->Asl.Node; /* OpRegion namespace node */
+ if (!Node)
+ {
+ break;
+ }
ArgNode = Node->Op; /* OpRegion definition */
ArgNode = ArgNode->Asl.Child; /* First child is the OpRegion Name */
diff --git a/sys/contrib/dev/acpica/compiler/aslxref.c b/sys/contrib/dev/acpica/compiler/aslxref.c
index 51addc3..cda7ccf 100644
--- a/sys/contrib/dev/acpica/compiler/aslxref.c
+++ b/sys/contrib/dev/acpica/compiler/aslxref.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acparser.h>
@@ -86,6 +85,22 @@ XfCheckFieldRange (
UINT32 FieldBitLength,
UINT32 AccessBitWidth);
+#ifdef __UNDER_DEVELOPMENT
+static ACPI_PARSE_OBJECT *
+XfGetParentMethod (
+ ACPI_PARSE_OBJECT *Op);
+
+static void
+XfCheckIllegalReference (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_NAMESPACE_NODE *Node);
+
+static BOOLEAN
+XfIsObjectParental (
+ ACPI_PARSE_OBJECT *MethodOp1,
+ ACPI_PARSE_OBJECT *MethodOp2);
+#endif
+
/*******************************************************************************
*
@@ -130,6 +145,8 @@ XfCrossReferenceNamespace (
TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, XfNamespaceLocateBegin,
XfNamespaceLocateEnd, WalkState);
+
+ ACPI_FREE (WalkState);
return (AE_OK);
}
@@ -262,6 +279,182 @@ XfCheckFieldRange (
}
}
+
+#ifdef __UNDER_DEVELOPMENT
+/*******************************************************************************
+ *
+ * FUNCTION: XfIsObjectParental
+ *
+ * PARAMETERS: ChildOp - Op to be checked
+ * PossibleParentOp - Determine if this op is in the family
+ *
+ * RETURN: TRUE if ChildOp is a descendent of PossibleParentOp
+ *
+ * DESCRIPTION: Determine if an Op is a descendent of another Op. Used to
+ * detect if a method is declared within another method.
+ *
+ ******************************************************************************/
+
+static BOOLEAN
+XfIsObjectParental (
+ ACPI_PARSE_OBJECT *ChildOp,
+ ACPI_PARSE_OBJECT *PossibleParentOp)
+{
+ ACPI_PARSE_OBJECT *ParentOp;
+
+
+ /* Search upwards through the tree for possible parent */
+
+ ParentOp = ChildOp;
+ while (ParentOp)
+ {
+ if (ParentOp == PossibleParentOp)
+ {
+ return (TRUE);
+ }
+
+ ParentOp = ParentOp->Asl.Parent;
+ }
+
+ return (FALSE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: XfGetParentMethod
+ *
+ * PARAMETERS: Op - Op to be checked
+ *
+ * RETURN: Op for parent method. NULL if object is not within a method.
+ *
+ * DESCRIPTION: Determine if an object is within a control method. Used to
+ * implement special rules for named references from within a
+ * control method.
+ *
+ * NOTE: It would be better to have the parser set a flag in the Op if possible.
+ *
+ ******************************************************************************/
+
+static ACPI_PARSE_OBJECT *
+XfGetParentMethod (
+ ACPI_PARSE_OBJECT *Op)
+{
+ ACPI_PARSE_OBJECT *ParentOp;
+
+
+ if (!Op)
+ {
+ return (NULL);
+ }
+
+ if (Op->Asl.ParseOpcode == PARSEOP_METHOD)
+ {
+ return (NULL);
+ }
+
+ /* Walk upwards through the parse tree, up to the root if necessary */
+
+ ParentOp = Op;
+ while (ParentOp)
+ {
+ if (ParentOp->Asl.ParseOpcode == PARSEOP_METHOD)
+ {
+ return (ParentOp);
+ }
+
+ ParentOp = ParentOp->Asl.Parent;
+ }
+
+ /* Object is not within a method */
+
+ return (NULL);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: XfCheckIllegalReference
+ *
+ * PARAMETERS: Op - Op referring to the target
+ * TargetNode - Target of the reference
+ *
+ * RETURN: None. Emits error message for an illegal reference
+ *
+ * DESCRIPTION: Determine if a named reference is legal. A "named" reference
+ * is something like: Store(ABCD, ...), where ABCD is an AML
+ * Nameseg or Namepath.
+ *
+ * NOTE: Caller must ensure that the name Op is in fact a reference, and not
+ * an actual name declaration (creation of a named object).
+ *
+ ******************************************************************************/
+
+static void
+XfCheckIllegalReference (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_NAMESPACE_NODE *TargetNode)
+{
+ ACPI_PARSE_OBJECT *MethodOp1;
+ ACPI_PARSE_OBJECT *MethodOp2;
+ ACPI_PARSE_OBJECT *TargetOp;
+
+
+ /*
+ * Check for an illegal reference to a named object:
+ *
+ * 1) References from one control method to another, non-parent
+ * method are not allowed, they will fail at runtime.
+ *
+ * 2) Forward references within a control method are not allowed.
+ * AML interpreters use a one-pass parse of control methods
+ * so these forward references will fail at runtime.
+ */
+ TargetOp = TargetNode->Op;
+
+ MethodOp1 = XfGetParentMethod (Op);
+ MethodOp2 = XfGetParentMethod (TargetOp);
+
+ /* Are both objects within control method(s)? */
+
+ if (!MethodOp1 || !MethodOp2)
+ {
+ return;
+ }
+
+ /* Objects not in the same method? */
+
+ if (MethodOp1 != MethodOp2)
+ {
+ /*
+ * 1) Cross-method named reference
+ *
+ * This is OK if and only if the target reference is within in a
+ * method that is a parent of current method
+ */
+ if (!XfIsObjectParental (MethodOp1, MethodOp2))
+ {
+ AslError (ASL_ERROR, ASL_MSG_ILLEGAL_METHOD_REF, Op,
+ Op->Asl.ExternalName);
+ }
+ }
+
+ /*
+ * 2) Both reference and target are in the same method. Check if this is
+ * an (illegal) forward reference by examining the exact source code
+ * location of each (the referenced object and the object declaration).
+ * This is a bit nasty, yet effective.
+ */
+ else if (Op->Asl.LogicalByteOffset < TargetOp->Asl.LogicalByteOffset)
+ {
+ AslError (ASL_ERROR, ASL_MSG_ILLEGAL_FORWARD_REF, Op,
+ Op->Asl.ExternalName);
+ }
+
+}
+#endif
+
+
/*******************************************************************************
*
* FUNCTION: XfNamespaceLocateBegin
@@ -316,7 +509,7 @@ XfNamespaceLocateBegin (
*/
if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION)
{
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
/* We are only interested in opcodes that have an associated name */
@@ -329,7 +522,7 @@ XfNamespaceLocateBegin (
(Op->Asl.ParseOpcode != PARSEOP_NAMESEG) &&
(Op->Asl.ParseOpcode != PARSEOP_METHODCALL))
{
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
/*
@@ -340,7 +533,7 @@ XfNamespaceLocateBegin (
if ((Op->Asl.Parent) &&
(Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF))
{
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
/*
@@ -459,7 +652,8 @@ XfNamespaceLocateBegin (
Status = AE_OK;
}
- return (Status);
+
+ return_ACPI_STATUS (Status);
}
/* Check for a reference vs. name declaration */
@@ -470,6 +664,13 @@ XfNamespaceLocateBegin (
/* This node has been referenced, mark it for reference check */
Node->Flags |= ANOBJ_IS_REFERENCED;
+
+#ifdef __UNDER_DEVELOPMENT
+
+ /* Check for an illegal reference */
+
+ XfCheckIllegalReference (Op, Node);
+#endif
}
/* Attempt to optimize the NamePath */
@@ -624,7 +825,6 @@ XfNamespaceLocateBegin (
(Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
{
-
/*
* A reference to a method within one of these opcodes is not an
* invocation of the method, it is simply a reference to the method.
@@ -632,9 +832,11 @@ XfNamespaceLocateBegin (
if ((Op->Asl.Parent) &&
((Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_REFOF) ||
(Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_DEREFOF) ||
+ (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_PACKAGE) ||
+ (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_VAR_PACKAGE)||
(Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_OBJECTTYPE)))
{
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
/*
* There are two types of method invocation:
@@ -650,7 +852,7 @@ XfNamespaceLocateBegin (
Op->Asl.ExternalName, AcpiUtGetTypeName (Node->Type));
AslError (ASL_ERROR, ASL_MSG_NOT_METHOD, Op, MsgBuffer);
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
/* Save the method node in the caller's op */
@@ -658,7 +860,7 @@ XfNamespaceLocateBegin (
Op->Asl.Node = Node;
if (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF)
{
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
/*
@@ -822,8 +1024,16 @@ XfNamespaceLocateBegin (
}
}
+ /* 5) Check for a connection object */
+#if 0
+ else if (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONNECTION)
+ {
+ return_ACPI_STATUS (Status);
+ }
+#endif
+
Op->Asl.Node = Node;
- return (Status);
+ return_ACPI_STATUS (Status);
}
@@ -858,7 +1068,7 @@ XfNamespaceLocateEnd (
OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
if (!(OpInfo->Flags & AML_NAMED))
{
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
/* Not interested in name references, we did not open a scope for them */
@@ -867,7 +1077,7 @@ XfNamespaceLocateEnd (
(Op->Asl.ParseOpcode == PARSEOP_NAMESEG) ||
(Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
{
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
/* Pop the scope stack if necessary */
@@ -882,5 +1092,5 @@ XfNamespaceLocateEnd (
(void) AcpiDsScopeStackPop (WalkState);
}
- return (AE_OK);
+ return_ACPI_STATUS (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/compiler/dtcompile.c b/sys/contrib/dev/acpica/compiler/dtcompile.c
index 3407e1d..e94a222 100644
--- a/sys/contrib/dev/acpica/compiler/dtcompile.c
+++ b/sys/contrib/dev/acpica/compiler/dtcompile.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DTCOMPILE_C__
#define _DECLARE_DT_GLOBALS
#include <contrib/dev/acpica/compiler/aslcompiler.h>
@@ -141,8 +140,6 @@ DtDoCompile (
Status = DtCompileDataTable (&FieldList);
UtEndEvent (Event);
- DtFreeFieldList ();
-
if (ACPI_FAILURE (Status))
{
/* TBD: temporary error message. Msgs should come from function above */
@@ -170,6 +167,8 @@ DtDoCompile (
CleanupAndExit:
+ AcpiUtDeleteCaches ();
+ DtDeleteCaches ();
CmCleanupAndExit ();
return (Status);
}
@@ -298,7 +297,7 @@ DtCompileDataTable (
return (AE_ERROR);
}
- Gbl_Signature = UtLocalCalloc (ACPI_STRLEN (Signature) + 1);
+ Gbl_Signature = UtStringCacheCalloc (ACPI_STRLEN (Signature) + 1);
strcpy (Gbl_Signature, Signature);
/*
@@ -437,6 +436,7 @@ DtCompileTable (
UINT8 FieldType;
UINT8 *Buffer;
UINT8 *FlagBuffer = NULL;
+ char *String;
UINT32 CurrentFlagByteOffset = 0;
ACPI_STATUS Status;
@@ -446,18 +446,29 @@ DtCompileTable (
return (AE_BAD_PARAMETER);
}
+ /* Ignore optional subtable if name does not match */
+
+ if ((Info->Flags & DT_OPTIONAL) &&
+ ACPI_STRCMP ((*Field)->Name, Info->Name))
+ {
+ *RetSubtable = NULL;
+ return (AE_OK);
+ }
+
Length = DtGetSubtableLength (*Field, Info);
if (Length == ASL_EOF)
{
return (AE_ERROR);
}
- Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE));
+ Subtable = UtSubtableCacheCalloc ();
if (Length > 0)
{
- Subtable->Buffer = UtLocalCalloc (Length);
+ String = UtStringCacheCalloc (Length);
+ Subtable->Buffer = ACPI_CAST_PTR (UINT8, String);
}
+
Subtable->Length = Length;
Subtable->TotalLength = Length;
Buffer = Subtable->Buffer;
@@ -558,8 +569,6 @@ DtCompileTable (
DtSetSubtableLength (InlineSubtable);
ACPI_MEMCPY (Buffer, InlineSubtable->Buffer, FieldLength);
- ACPI_FREE (InlineSubtable->Buffer);
- ACPI_FREE (InlineSubtable);
LocalField = *Field;
break;
diff --git a/sys/contrib/dev/acpica/compiler/dtcompiler.h b/sys/contrib/dev/acpica/compiler/dtcompiler.h
index 51fec6d..307df3f 100644
--- a/sys/contrib/dev/acpica/compiler/dtcompiler.h
+++ b/sys/contrib/dev/acpica/compiler/dtcompiler.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -50,6 +50,10 @@
#include <contrib/dev/acpica/include/acdisasm.h>
+#define ASL_FIELD_CACHE_SIZE 512
+#define ASL_SUBTABLE_CACHE_SIZE 128
+
+
#undef DT_EXTERN
#ifdef _DECLARE_DT_GLOBALS
@@ -143,6 +147,18 @@ DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*Gbl_LabelList, NULL);
DT_EXTERN UINT32 DT_INIT_GLOBAL (Gbl_CurrentTableOffset, 0);
+/* Local caches */
+
+DT_EXTERN UINT32 DT_INIT_GLOBAL (Gbl_SubtableCount, 0);
+DT_EXTERN ASL_CACHE_INFO DT_INIT_GLOBAL (*Gbl_SubtableCacheList, NULL);
+DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*Gbl_SubtableCacheNext, NULL);
+DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*Gbl_SubtableCacheLast, NULL);
+
+DT_EXTERN UINT32 DT_INIT_GLOBAL (Gbl_FieldCount, 0);
+DT_EXTERN ASL_CACHE_INFO DT_INIT_GLOBAL (*Gbl_FieldCacheList, NULL);
+DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*Gbl_FieldCacheNext, NULL);
+DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*Gbl_FieldCacheLast, NULL);
+
/* dtcompiler - main module */
@@ -321,20 +337,20 @@ DtWalkTableTree (
void
DtError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage);
void
DtNameError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage);
void
DtFatal (
- UINT8 MessageId,
+ UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage);
@@ -343,10 +359,6 @@ DtStrtoul64 (
char *String,
UINT64 *ReturnInteger);
-UINT32
-DtGetFileSize (
- FILE *Handle);
-
char*
DtGetFieldValue (
DT_FIELD *Field);
@@ -372,8 +384,16 @@ void
DtSetTableLength(
void);
+DT_SUBTABLE *
+UtSubtableCacheCalloc (
+ void);
+
+DT_FIELD *
+UtFieldCacheCalloc (
+ void);
+
void
-DtFreeFieldList (
+DtDeleteCaches (
void);
@@ -400,6 +420,10 @@ DtCompileCsrt (
void **PFieldList);
ACPI_STATUS
+DtCompileDbg2 (
+ void **PFieldList);
+
+ACPI_STATUS
DtCompileDmar (
void **PFieldList);
@@ -420,6 +444,10 @@ DtCompileFpdt (
void **PFieldList);
ACPI_STATUS
+DtCompileGtdt (
+ void **PFieldList);
+
+ACPI_STATUS
DtCompileHest (
void **PFieldList);
@@ -428,6 +456,10 @@ DtCompileIvrs (
void **PFieldList);
ACPI_STATUS
+DtCompileLpit (
+ void **PFieldList);
+
+ACPI_STATUS
DtCompileMadt (
void **PFieldList);
@@ -452,6 +484,10 @@ DtCompilePmtt (
void **PFieldList);
ACPI_STATUS
+DtCompilePcct (
+ void **PFieldList);
+
+ACPI_STATUS
DtCompileRsdt (
void **PFieldList);
@@ -503,6 +539,7 @@ extern const unsigned char TemplateBert[];
extern const unsigned char TemplateBgrt[];
extern const unsigned char TemplateCpep[];
extern const unsigned char TemplateCsrt[];
+extern const unsigned char TemplateDbg2[];
extern const unsigned char TemplateDbgp[];
extern const unsigned char TemplateDmar[];
extern const unsigned char TemplateEcdt[];
@@ -514,12 +551,14 @@ extern const unsigned char TemplateGtdt[];
extern const unsigned char TemplateHest[];
extern const unsigned char TemplateHpet[];
extern const unsigned char TemplateIvrs[];
+extern const unsigned char TemplateLpit[];
extern const unsigned char TemplateMadt[];
extern const unsigned char TemplateMcfg[];
extern const unsigned char TemplateMchi[];
extern const unsigned char TemplateMpst[];
extern const unsigned char TemplateMsct[];
extern const unsigned char TemplateMtmr[];
+extern const unsigned char TemplatePcct[];
extern const unsigned char TemplatePmtt[];
extern const unsigned char TemplateRsdt[];
extern const unsigned char TemplateS3pt[];
diff --git a/sys/contrib/dev/acpica/compiler/dtexpress.c b/sys/contrib/dev/acpica/compiler/dtexpress.c
index 9689ef6..90054c9 100644
--- a/sys/contrib/dev/acpica/compiler/dtexpress.c
+++ b/sys/contrib/dev/acpica/compiler/dtexpress.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DTEXPRESS_C__
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/compiler/dtcompiler.h>
#include "dtparser.y.h"
diff --git a/sys/contrib/dev/acpica/compiler/dtfield.c b/sys/contrib/dev/acpica/compiler/dtfield.c
index 1f273d9..3b191ab 100644
--- a/sys/contrib/dev/acpica/compiler/dtfield.c
+++ b/sys/contrib/dev/acpica/compiler/dtfield.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DTFIELD_C__
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/compiler/dtcompiler.h>
@@ -259,7 +257,7 @@ DtCompileUuid (
}
else
{
- Status = AuConvertStringToUuid (InString, (char *) Buffer);
+ AcpiUtConvertStringToUuid (InString, Buffer);
}
return (Status);
@@ -311,21 +309,37 @@ DtCompileInteger (
return;
}
- /* Ensure that reserved fields are set to zero */
- /* TBD: should we set to zero, or just make this an ERROR? */
- /* TBD: Probably better to use a flag */
+ /*
+ * Ensure that reserved fields are set properly. Note: uses
+ * the DT_NON_ZERO flag to indicate that the reserved value
+ * must be exactly one. Otherwise, the value must be zero.
+ * This is sufficient for now.
+ */
+
+ /* TBD: Should use a flag rather than compare "Reserved" */
- if (!ACPI_STRCMP (Field->Name, "Reserved") &&
- (Value != 0))
+ if (!ACPI_STRCMP (Field->Name, "Reserved"))
{
- DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,
- "Setting to zero");
- Value = 0;
+ if (Flags & DT_NON_ZERO)
+ {
+ if (Value != 1)
+ {
+ DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,
+ "Must be one, setting to one");
+ Value = 1;
+ }
+ }
+ else if (Value != 0)
+ {
+ DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,
+ "Must be zero, setting to zero");
+ Value = 0;
+ }
}
/* Check if the value must be non-zero */
- if ((Value == 0) && (Flags & DT_NON_ZERO))
+ else if ((Flags & DT_NON_ZERO) && (Value == 0))
{
DtError (ASL_ERROR, ASL_MSG_ZERO_VALUE, Field, NULL);
}
@@ -340,7 +354,8 @@ DtCompileInteger (
if (Value > MaxValue)
{
- sprintf (MsgBuffer, "%8.8X%8.8X", ACPI_FORMAT_UINT64 (Value));
+ sprintf (MsgBuffer, "%8.8X%8.8X - max %u bytes",
+ ACPI_FORMAT_UINT64 (Value), ByteLength);
DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, MsgBuffer);
}
diff --git a/sys/contrib/dev/acpica/compiler/dtio.c b/sys/contrib/dev/acpica/compiler/dtio.c
index 39fb9da..e840fc9 100644
--- a/sys/contrib/dev/acpica/compiler/dtio.c
+++ b/sys/contrib/dev/acpica/compiler/dtio.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,10 +41,9 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DTIO_C__
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/compiler/dtcompiler.h>
+#include <contrib/dev/acpica/include/acapps.h>
#define _COMPONENT DT_COMPILER
ACPI_MODULE_NAME ("dtio")
@@ -132,7 +131,7 @@ DtTrim (
if (!ACPI_STRCMP (String, " "))
{
- ReturnString = UtLocalCalloc (1);
+ ReturnString = UtStringCacheCalloc (1);
return (ReturnString);
}
@@ -180,7 +179,7 @@ DtTrim (
/* Create the trimmed return string */
Length = ACPI_PTR_DIFF (End, Start) + 1;
- ReturnString = UtLocalCalloc (Length + 1);
+ ReturnString = UtStringCacheCalloc (Length + 1);
if (ACPI_STRLEN (Start))
{
ACPI_STRNCPY (ReturnString, Start, Length);
@@ -369,7 +368,7 @@ DtParseLine (
if ((Value && *Value) || IsNullString)
{
- Field = UtLocalCalloc (sizeof (DT_FIELD));
+ Field = UtFieldCacheCalloc ();
Field->Name = Name;
Field->Value = Value;
Field->Line = Line;
@@ -379,11 +378,7 @@ DtParseLine (
DtLinkField (Field);
}
- else /* Ignore this field, it has no valid data */
- {
- ACPI_FREE (Name);
- ACPI_FREE (Value);
- }
+ /* Else -- Ignore this field, it has no valid data */
return (AE_OK);
}
@@ -737,7 +732,11 @@ DtScanFile (
/* Get the file size */
- Gbl_InputByteCount = DtGetFileSize (Handle);
+ Gbl_InputByteCount = CmGetFileSize (Handle);
+ if (Gbl_InputByteCount == ACPI_UINT32_MAX)
+ {
+ AslAbort ();
+ }
Gbl_CurrentLineNumber = 0;
Gbl_CurrentLineOffset = 0;
@@ -816,7 +815,12 @@ DtOutputBinary (
/* Walk the entire parse tree, emitting the binary data */
DtWalkTableTree (RootTable, DtWriteBinary, NULL, NULL);
- Gbl_TableLength = DtGetFileSize (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
+
+ Gbl_TableLength = CmGetFileSize (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
+ if (Gbl_TableLength == ACPI_UINT32_MAX)
+ {
+ AslAbort ();
+ }
}
@@ -1025,6 +1029,8 @@ DtDumpSubtableList (
DbgPrint (ASL_DEBUG_OUTPUT,
"\nSubtable Tree: (Depth, Subtable, Length, TotalLength)\n\n");
DtWalkTableTree (Gbl_RootTable, DtDumpSubtableTree, NULL, NULL);
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "\n");
}
diff --git a/sys/contrib/dev/acpica/compiler/dtparser.l b/sys/contrib/dev/acpica/compiler/dtparser.l
index b0f6d6c..c6c29ae 100644
--- a/sys/contrib/dev/acpica/compiler/dtparser.l
+++ b/sys/contrib/dev/acpica/compiler/dtparser.l
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dtparser.y b/sys/contrib/dev/acpica/compiler/dtparser.y
index 47e74bd..0271d78 100644
--- a/sys/contrib/dev/acpica/compiler/dtparser.y
+++ b/sys/contrib/dev/acpica/compiler/dtparser.y
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/dtsubtable.c b/sys/contrib/dev/acpica/compiler/dtsubtable.c
index 67fcb9d..1e6a76a 100644
--- a/sys/contrib/dev/acpica/compiler/dtsubtable.c
+++ b/sys/contrib/dev/acpica/compiler/dtsubtable.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DTSUBTABLE_C__
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/compiler/dtcompiler.h>
@@ -73,13 +71,15 @@ DtCreateSubtable (
DT_SUBTABLE **RetSubtable)
{
DT_SUBTABLE *Subtable;
+ char *String;
- Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE));
+ Subtable = UtSubtableCacheCalloc ();
/* Create a new buffer for the subtable data */
- Subtable->Buffer = UtLocalCalloc (Length);
+ String = UtStringCacheCalloc (Length);
+ Subtable->Buffer = ACPI_CAST_PTR (UINT8, String);
ACPI_MEMCPY (Subtable->Buffer, Buffer, Length);
Subtable->Length = Length;
diff --git a/sys/contrib/dev/acpica/compiler/dttable.c b/sys/contrib/dev/acpica/compiler/dttable.c
index bb6c7cb..bc0cbd2 100644
--- a/sys/contrib/dev/acpica/compiler/dttable.c
+++ b/sys/contrib/dev/acpica/compiler/dttable.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DTTABLE_C__
-
/* Compile all complex data tables */
#include <contrib/dev/acpica/compiler/aslcompiler.h>
@@ -454,7 +452,7 @@ DtCompileCsrt (
UINT32 GroupLength;
- /* Sub-tables (Resource Groups) */
+ /* Subtables (Resource Groups) */
while (*PFieldList)
{
@@ -520,6 +518,156 @@ DtCompileCsrt (
/******************************************************************************
*
+ * FUNCTION: DtCompileDbg2
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile DBG2.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileDbg2 (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ UINT32 SubtableCount;
+ ACPI_DBG2_HEADER *Dbg2Header;
+ ACPI_DBG2_DEVICE *DeviceInfo;
+ UINT16 CurrentOffset;
+ UINT32 i;
+
+
+ /* Main table */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /* Main table fields */
+
+ Dbg2Header = ACPI_CAST_PTR (ACPI_DBG2_HEADER, Subtable->Buffer);
+ Dbg2Header->InfoOffset = sizeof (ACPI_TABLE_HEADER) + ACPI_PTR_DIFF (
+ ACPI_ADD_PTR (UINT8, Dbg2Header, sizeof (ACPI_DBG2_HEADER)), Dbg2Header);
+
+ SubtableCount = Dbg2Header->InfoCount;
+ DtPushSubtable (Subtable);
+
+ /* Process all Device Information subtables (Count = InfoCount) */
+
+ while (*PFieldList && SubtableCount)
+ {
+ /* Subtable: Debug Device Information */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Device,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DeviceInfo = ACPI_CAST_PTR (ACPI_DBG2_DEVICE, Subtable->Buffer);
+ CurrentOffset = (UINT16) sizeof (ACPI_DBG2_DEVICE);
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ ParentTable = DtPeekSubtable ();
+
+ /* BaseAddressRegister GAS array (Required, size is RegisterCount) */
+
+ DeviceInfo->BaseAddressOffset = CurrentOffset;
+ for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Addr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ CurrentOffset += (UINT16) sizeof (ACPI_GENERIC_ADDRESS);
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+
+ /* AddressSize array (Required, size = RegisterCount) */
+
+ DeviceInfo->AddressSizeOffset = CurrentOffset;
+ for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Size,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ CurrentOffset += (UINT16) sizeof (UINT32);
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+
+ /* NamespaceString device identifier (Required, size = NamePathLength) */
+
+ DeviceInfo->NamepathOffset = CurrentOffset;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Name,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Update the device info header */
+
+ DeviceInfo->NamepathLength = (UINT16) Subtable->Length;
+ CurrentOffset += (UINT16) DeviceInfo->NamepathLength;
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /* OemData - Variable-length data (Optional, size = OemDataLength) */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2OemData,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Update the device info header (zeros if no OEM data present) */
+
+ DeviceInfo->OemDataOffset = 0;
+ DeviceInfo->OemDataLength = 0;
+
+ /* Optional subtable (OemData) */
+
+ if (Subtable && Subtable->Length)
+ {
+ DeviceInfo->OemDataOffset = CurrentOffset;
+ DeviceInfo->OemDataLength = (UINT16) Subtable->Length;
+
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+
+ SubtableCount--;
+ DtPopSubtable (); /* Get next Device Information subtable */
+ }
+
+ DtPopSubtable ();
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: DtCompileDmar
*
* PARAMETERS: List - Current field list pointer
@@ -586,16 +734,21 @@ DtCompileDmar (
InfoTable = AcpiDmTableInfoDmar1;
break;
- case ACPI_DMAR_TYPE_ATSR:
+ case ACPI_DMAR_TYPE_ROOT_ATS:
InfoTable = AcpiDmTableInfoDmar2;
break;
- case ACPI_DMAR_HARDWARE_AFFINITY:
+ case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
InfoTable = AcpiDmTableInfoDmar3;
break;
+ case ACPI_DMAR_TYPE_NAMESPACE:
+
+ InfoTable = AcpiDmTableInfoDmar4;
+ break;
+
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "DMAR");
@@ -612,10 +765,20 @@ DtCompileDmar (
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
- DtPushSubtable (Subtable);
- /* Optional Device Scope subtables */
+ /*
+ * Optional Device Scope subtables
+ */
+ if ((DmarHeader->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
+ (DmarHeader->Type == ACPI_DMAR_TYPE_NAMESPACE))
+ {
+ /* These types do not support device scopes */
+ DtPopSubtable ();
+ continue;
+ }
+
+ DtPushSubtable (Subtable);
DeviceScopeLength = DmarHeader->Length - Subtable->Length -
ParentTable->Length;
while (DeviceScopeLength)
@@ -788,6 +951,125 @@ DtCompileFadt (
return (AE_OK);
}
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileGtdt
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile GTDT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileGtdt (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_SUBTABLE_HEADER *GtdtHeader;
+ ACPI_DMTABLE_INFO *InfoTable;
+ UINT32 GtCount;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdtHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ GtdtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
+
+ switch (GtdtHeader->Type)
+ {
+ case ACPI_GTDT_TYPE_TIMER_BLOCK:
+
+ InfoTable = AcpiDmTableInfoGtdt0;
+ break;
+
+ case ACPI_GTDT_TYPE_WATCHDOG:
+
+ InfoTable = AcpiDmTableInfoGtdt1;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "GTDT");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /*
+ * Additional GT block subtable data
+ */
+
+ switch (GtdtHeader->Type)
+ {
+ case ACPI_GTDT_TYPE_TIMER_BLOCK:
+
+ DtPushSubtable (Subtable);
+ ParentTable = DtPeekSubtable ();
+
+ GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
+ Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount;
+ while (GtCount)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt0a,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+
+ DtInsertSubtable (ParentTable, Subtable);
+ GtCount--;
+ }
+ DtPopSubtable ();
+ break;
+
+ default:
+
+ break;
+ }
+
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
/******************************************************************************
*
@@ -1154,6 +1436,87 @@ DtCompileIvrs (
/******************************************************************************
*
+ * FUNCTION: DtCompileLpit
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile LPIT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileLpit (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_DMTABLE_INFO *InfoTable;
+ ACPI_LPIT_HEADER *LpitHeader;
+
+
+ /* Note: Main table consists only of the standard ACPI table header */
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+
+ /* LPIT Subtable header */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoLpitHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ LpitHeader = ACPI_CAST_PTR (ACPI_LPIT_HEADER, Subtable->Buffer);
+
+ switch (LpitHeader->Type)
+ {
+ case ACPI_LPIT_TYPE_NATIVE_CSTATE:
+
+ InfoTable = AcpiDmTableInfoLpit0;
+ break;
+
+ case ACPI_LPIT_TYPE_SIMPLE_IO:
+
+ InfoTable = AcpiDmTableInfoLpit1;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "LPIT");
+ return (AE_ERROR);
+ }
+
+ /* LPIT Subtable */
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: DtCompileMadt
*
* PARAMETERS: List - Current field list pointer
@@ -1270,6 +1633,16 @@ DtCompileMadt (
InfoTable = AcpiDmTableInfoMadt12;
break;
+ case ACPI_MADT_TYPE_GENERIC_MSI_FRAME:
+
+ InfoTable = AcpiDmTableInfoMadt13;
+ break;
+
+ case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR:
+
+ InfoTable = AcpiDmTableInfoMadt14;
+ break;
+
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "MADT");
@@ -1505,6 +1878,90 @@ DtCompileMtmr (
/******************************************************************************
*
+ * FUNCTION: DtCompilePcct
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile PCCT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompilePcct (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_SUBTABLE_HEADER *PcctHeader;
+ ACPI_DMTABLE_INFO *InfoTable;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcct,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcctHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ PcctHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
+
+ switch (PcctHeader->Type)
+ {
+ case ACPI_PCCT_TYPE_GENERIC_SUBSPACE:
+
+ InfoTable = AcpiDmTableInfoPcct0;
+ break;
+
+ case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE:
+
+ InfoTable = AcpiDmTableInfoPcct1;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PCCT");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: DtCompilePmtt
*
* PARAMETERS: List - Current field list pointer
@@ -1961,6 +2418,11 @@ DtCompileSrat (
InfoTable = AcpiDmTableInfoSrat2;
break;
+ case ACPI_SRAT_TYPE_GICC_AFFINITY:
+
+ InfoTable = AcpiDmTableInfoSrat3;
+ break;
+
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SRAT");
diff --git a/sys/contrib/dev/acpica/compiler/dttemplate.c b/sys/contrib/dev/acpica/compiler/dttemplate.c
index ca66d16..3fcf081 100644
--- a/sys/contrib/dev/acpica/compiler/dttemplate.c
+++ b/sys/contrib/dev/acpica/compiler/dttemplate.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -187,6 +187,12 @@ GetTemplate:
}
Status = DtCreateOneTemplate (Signature, TableData);
+
+
+ /* Shutdown ACPICA subsystem */
+
+ (void) AcpiTerminate ();
+ CmDeleteCaches ();
return (Status);
}
@@ -397,6 +403,5 @@ DtCreateOneTemplate (
Cleanup:
fclose (File);
AcpiOsRedirectOutput (stdout);
- ACPI_FREE (DisasmFilename);
return (Status);
}
diff --git a/sys/contrib/dev/acpica/compiler/dttemplate.h b/sys/contrib/dev/acpica/compiler/dttemplate.h
index f620abd..0398d69 100644
--- a/sys/contrib/dev/acpica/compiler/dttemplate.h
+++ b/sys/contrib/dev/acpica/compiler/dttemplate.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -174,6 +174,33 @@ const unsigned char TemplateCsrt[] =
0x43,0x48,0x41,0x37 /* 00000148 "CHA7" */
};
+const unsigned char TemplateDbg2[] =
+{
+ 0x44,0x42,0x47,0x32,0xB2,0x00,0x00,0x00, /* 00000000 "DBG2...." */
+ 0x01,0xBA,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
+ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x15,0x11,0x13,0x20,0x2C,0x00,0x00,0x00, /* 00000020 "... ,..." */
+ 0x02,0x00,0x00,0x00,0xEE,0x3F,0x00,0x02, /* 00000028 ".....?.." */
+ 0x09,0x00,0x36,0x00,0x00,0x00,0x00,0x00, /* 00000030 "..6....." */
+ 0x00,0x80,0x00,0x00,0x00,0x00,0x16,0x00, /* 00000038 "........" */
+ 0x2E,0x00,0x01,0x32,0x00,0x03,0x88,0x77, /* 00000040 "...2...w" */
+ 0x66,0x55,0x44,0x33,0x22,0x11,0x01,0x64, /* 00000048 "fUD3"..d" */
+ 0x00,0x04,0x11,0x00,0xFF,0xEE,0xDD,0xCC, /* 00000050 "........" */
+ 0xBB,0xAA,0x10,0x32,0x54,0x76,0x98,0xBA, /* 00000058 "...2Tv.." */
+ 0xDC,0xFE,0x4D,0x79,0x44,0x65,0x76,0x69, /* 00000060 "..MyDevi" */
+ 0x63,0x65,0x00,0xEE,0x47,0x00,0x01,0x11, /* 00000068 "ce..G..." */
+ 0x00,0x26,0x00,0x10,0x00,0x37,0x00,0x00, /* 00000070 ".&...7.." */
+ 0x80,0x00,0x00,0x00,0x00,0x16,0x00,0x22, /* 00000078 "......."" */
+ 0x00,0x01,0x64,0x00,0x04,0x11,0x00,0xFF, /* 00000080 "..d....." */
+ 0xEE,0xDD,0xCC,0xBB,0xAA,0x98,0xBA,0xDC, /* 00000088 "........" */
+ 0xFE,0x5C,0x5C,0x5F,0x53,0x42,0x5F,0x2E, /* 00000090 ".\\_SB_." */
+ 0x50,0x43,0x49,0x30,0x2E,0x44,0x42,0x47, /* 00000098 "PCI0.DBG" */
+ 0x50,0x00,0x41,0x42,0x43,0x44,0x45,0x46, /* 000000A0 "P.ABCDEF" */
+ 0x47,0x48,0x49,0x50,0x51,0x52,0x53,0x54, /* 000000A8 "GHIPQRST" */
+ 0x55,0x56 /* 000000B0 "UV" */
+};
+
const unsigned char TemplateDbgp[] =
{
0x44,0x42,0x47,0x50,0x34,0x00,0x00,0x00, /* 00000000 "DBGP4..." */
@@ -353,10 +380,10 @@ const unsigned char TemplateFacs[] =
const unsigned char TemplateFadt[] =
{
0x46,0x41,0x43,0x50,0x0C,0x01,0x00,0x00, /* 00000000 "FACP...." */
- 0x05,0x18,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x05,0x64,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".dINTEL " */
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x23,0x11,0x11,0x20,0x01,0x00,0x00,0x00, /* 00000020 "#.. ...." */
+ 0x15,0x11,0x13,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
@@ -368,7 +395,7 @@ const unsigned char TemplateFadt[] =
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01, /* 00000070 "........" */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
- 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000080 "........" */
+ 0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00, /* 00000080 "........" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000088 "........" */
0x00,0x00,0x00,0x00,0x01,0x20,0x00,0x02, /* 00000090 "..... .." */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
@@ -379,7 +406,7 @@ const unsigned char TemplateFadt[] =
0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x00, /* 000000C0 "........" */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */
0x01,0x20,0x00,0x03,0x01,0x00,0x00,0x00, /* 000000D0 ". ......" */
- 0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x01, /* 000000D8 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x40,0x00,0x01, /* 000000D8 ".....@.." */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */
0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01, /* 000000F0 "........" */
@@ -407,16 +434,34 @@ const unsigned char TemplateFpdt[] =
const unsigned char TemplateGtdt[] =
{
- 0x47,0x54,0x44,0x54,0x50,0x00,0x00,0x00, /* 00000000 "GTDTP..." */
- 0x01,0xF1,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
- 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
- 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x23,0x06,0x11,0x20,0x00,0x00,0x00,0x00, /* 00000020 "#.. ...." */
- 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000028 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000048 "........" */
+ 0x47,0x54,0x44,0x54,0xe0,0x00,0x00,0x00, /* 00000000 "GTDT...." */
+ 0x02,0xb0,0x4c,0x49,0x4e,0x41,0x52,0x4f, /* 00000008 "..LINARO" */
+ 0x52,0x54,0x53,0x4d,0x56,0x45,0x56,0x38, /* 00000010 "RTSMVEV8" */
+ 0x01,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c, /* 00000018 "....INTL" */
+ 0x24,0x04,0x14,0x20,0x00,0x00,0x00,0x00, /* 00000020 "$.. ...." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
+ 0x1d,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */
+ 0x1e,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000038 "........" */
+ 0x1b,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000040 "........" */
+ 0x1a,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000048 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
+ 0x02,0x00,0x00,0x00,0x60,0x00,0x00,0x00, /* 00000058 "....`..." */
+ 0x00,0x64,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 ".d......" */
+ 0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 00000068 "........" */
+ 0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000088 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000090 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000098 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000a0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000a8 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000b0 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000b8 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x1c,0x00,0x00, /* 000000c0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000c8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d0 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000d8 "........" */
};
const unsigned char TemplateHest[] =
@@ -521,41 +566,75 @@ const unsigned char TemplateIvrs[] =
0x00,0x00,0x00,0x00 /* 000000B8 "...." */
};
-/* MADT with ACPI 5.0 subtables */
-
-const unsigned char TemplateMadt[] =
+const unsigned char TemplateLpit[] =
{
- 0x41,0x50,0x49,0x43,0xF6,0x00,0x00,0x00, /* 00000000 "APIC...." */
- 0x01,0xB0,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x4C,0x50,0x49,0x54,0xB4,0x00,0x00,0x00, /* 00000000 "LPIT...." */
+ 0x01,0x20,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ". INTEL " */
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x23,0x06,0x11,0x20,0x00,0x00,0x00,0x00, /* 00000020 "#.. ...." */
+ 0x25,0x03,0x14,0x20,0x00,0x00,0x00,0x00, /* 00000020 "%.. ...." */
+ 0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "8......." */
+ 0x00,0x00,0x00,0x00,0x7F,0x01,0x02,0x00, /* 00000030 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
+ 0x00,0x20,0x00,0x03,0x00,0x00,0x00,0x00, /* 00000048 ". ......" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000058 "........" */
+ 0x58,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000060 "X......." */
+ 0x00,0x00,0x00,0x00,0x01,0x10,0x00,0x02, /* 00000068 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x10,0x00,0x02, /* 00000088 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
+ 0x00,0x08,0x00,0x01,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */
+ 0x00,0x00,0x00,0x00 /* 000000B0 "...." */
+};
+
+/* MADT with ACPI 5.1 subtables */
+
+const unsigned char TemplateMadt[] =
+{
+ 0x41,0x50,0x49,0x43,0x2a,0x01,0x00,0x00, /* 00000000 "APIC*..." */
+ 0x04,0x34,0x49,0x4e,0x54,0x45,0x4c,0x20, /* 00000008 ".4INTEL " */
+ 0x54,0x45,0x4d,0x50,0x4c,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
+ 0x01,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c, /* 00000018 "....INTL" */
+ 0x24,0x04,0x14,0x20,0x00,0x00,0x00,0x00, /* 00000020 "$.. ...." */
0x01,0x00,0x00,0x00,0x00,0x08,0x00,0x00, /* 00000028 "........" */
- 0x01,0x00,0x00,0x00,0x01,0x0C,0x01,0x00, /* 00000030 "........" */
+ 0x01,0x00,0x00,0x00,0x01,0x0c,0x01,0x00, /* 00000030 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
- 0x02,0x0A,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
- 0x00,0x00,0x03,0x08,0x0D,0x00,0x01,0x00, /* 00000048 "........" */
+ 0x02,0x0a,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
+ 0x00,0x00,0x03,0x08,0x0d,0x00,0x01,0x00, /* 00000048 "........" */
0x00,0x00,0x04,0x06,0x00,0x05,0x00,0x01, /* 00000050 "........" */
- 0x05,0x0C,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
+ 0x05,0x0c,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
0x00,0x00,0x00,0x00,0x06,0x10,0x00,0x00, /* 00000060 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
0x00,0x00,0x00,0x00,0x07,0x16,0x00,0x00, /* 00000070 "........" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000078 "........" */
- 0x00,0x00,0x00,0x00,0x5C,0x43,0x50,0x55, /* 00000080 "....\CPU" */
+ 0x00,0x00,0x00,0x00,0x5c,0x43,0x50,0x55, /* 00000080 "....\CPU" */
0x30,0x00,0x08,0x10,0x05,0x00,0x00,0x00, /* 00000088 "0......." */
0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00, /* 00000090 "........" */
0x00,0x00,0x09,0x10,0x00,0x00,0x00,0x00, /* 00000098 "........" */
- 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
- 0x00,0x00,0x0A,0x0C,0x05,0x00,0x00,0x00, /* 000000A8 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0x28, /* 000000B0 ".......(" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */
- 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D0 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x18, /* 000000D8 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00 /* 000000F0 "......" */
+ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000a0 "........" */
+ 0x00,0x00,0x0a,0x0c,0x05,0x00,0x00,0x00, /* 000000a8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x4c, /* 000000b0 ".......L" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000b8 "........" */
+ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000c0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000c8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000e0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000e8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000f0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000f8 "........" */
+ 0x00,0x00,0x0e,0x10,0x00,0x00,0x00,0x00, /* 00000100 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */
+ 0x00,0x00,0x0c,0x18,0x00,0x00,0x00,0x00, /* 00000110 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */
+ 0x00,0x00 /* 00000128 ".. " */
};
const unsigned char TemplateMcfg[] =
@@ -646,6 +725,32 @@ const unsigned char TemplateMtmr[] =
0x00,0x00,0x00,0x00 /* 00000048 "...." */
};
+const unsigned char TemplatePcct[] =
+{
+ 0x50,0x43,0x43,0x54,0xAC,0x00,0x00,0x00, /* 00000000 "PCCT...." */
+ 0x01,0xCF,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
+ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x27,0x06,0x14,0x20,0x01,0x00,0x00,0x00, /* 00000020 "'.. ...." */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
+ 0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 ".>......" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
+ 0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
+ 0x01,0x32,0x00,0x03,0x00,0x00,0x00,0x00, /* 00000048 ".2......" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
+ 0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF, /* 00000058 "........" */
+ 0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x00,0x00, /* 00000060 "........" */
+ 0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x3E, /* 00000068 ".......>" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000070 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00, /* 00000078 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x32, /* 00000080 ".......2" */
+ 0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */
+ 0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000098 "........" */
+ 0xFF,0xFF,0x01,0x00,0x00,0x00,0x01,0x00, /* 000000A0 "........" */
+ 0x00,0x00,0x01,0x00 /* 000000A8 "...." */
+};
+
const unsigned char TemplatePmtt[] =
{
0x50,0x4D,0x54,0x54,0xB4,0x00,0x00,0x00, /* 00000000 "PMTT...." */
@@ -844,10 +949,10 @@ const unsigned char TemplateSpcr[] =
const unsigned char TemplateSpmi[] =
{
0x53,0x50,0x4D,0x49,0x41,0x00,0x00,0x00, /* 00000000 "SPMIA..." */
- 0x04,0xED,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x04,0x00,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
+ 0x14,0x01,0x14,0x20,0x00,0x01,0x00,0x00, /* 00000020 "... ...." */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
0x00,0x08,0x00,0x01,0x00,0x00,0x00,0x00, /* 00000030 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
@@ -856,11 +961,11 @@ const unsigned char TemplateSpmi[] =
const unsigned char TemplateSrat[] =
{
- 0x53,0x52,0x41,0x54,0x80,0x00,0x00,0x00, /* 00000000 "SRAT...." */
- 0x03,0x5A,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".ZINTEL " */
- 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
+ 0x53,0x52,0x41,0x54,0x92,0x00,0x00,0x00, /* 00000000 "SRAT...." */
+ 0x03,0x50,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".PINTEL " */
+ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x28,0x05,0x10,0x20,0x01,0x00,0x00,0x00, /* 00000020 "(.. ...." */
+ 0x24,0x07,0x14,0x20,0x01,0x00,0x00,0x00, /* 00000020 "$.. ...." */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
0x00,0x10,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
@@ -871,7 +976,10 @@ const unsigned char TemplateSrat[] =
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
0x02,0x18,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000070 "........" */
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000078 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
+ 0x03,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
+ 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */
+ 0x00,0x00 /* 00000090 ".." */
};
const unsigned char TemplateTcpa[] =
diff --git a/sys/contrib/dev/acpica/compiler/dtutils.c b/sys/contrib/dev/acpica/compiler/dtutils.c
index d7ef56e..3635f13 100644
--- a/sys/contrib/dev/acpica/compiler/dtutils.c
+++ b/sys/contrib/dev/acpica/compiler/dtutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DTUTILS_C__
-
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/compiler/dtcompiler.h>
#include <contrib/dev/acpica/include/actables.h>
@@ -77,7 +75,7 @@ DtSum (
void
DtError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage)
{
@@ -124,7 +122,7 @@ DtError (
void
DtNameError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage)
{
@@ -177,7 +175,7 @@ DtNameError (
void
DtFatal (
- UINT8 MessageId,
+ UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage)
{
@@ -286,36 +284,6 @@ DtStrtoul64 (
/******************************************************************************
*
- * FUNCTION: DtGetFileSize
- *
- * PARAMETERS: Handle - Open file handler
- *
- * RETURN: Current file size
- *
- * DESCRIPTION: Get the current size of a file. Seek to the EOF and get the
- * offset. Seek back to the original location.
- *
- *****************************************************************************/
-
-UINT32
-DtGetFileSize (
- FILE *Handle)
-{
- int CurrentOffset;
- int LastOffset;
-
-
- CurrentOffset = ftell (Handle);
- fseek (Handle, 0, SEEK_END);
- LastOffset = ftell (Handle);
- fseek (Handle, CurrentOffset, SEEK_SET);
-
- return ((UINT32) LastOffset);
-}
-
-
-/******************************************************************************
- *
* FUNCTION: DtGetFieldValue
*
* PARAMETERS: Field - Current field list pointer
@@ -531,7 +499,9 @@ DtGetFieldLength (
case ACPI_DMT_SPACEID:
case ACPI_DMT_ACCWIDTH:
case ACPI_DMT_IVRS:
+ case ACPI_DMT_GTDT:
case ACPI_DMT_MADT:
+ case ACPI_DMT_PCCT:
case ACPI_DMT_PMTT:
case ACPI_DMT_SRAT:
case ACPI_DMT_ASF:
@@ -541,6 +511,7 @@ DtGetFieldLength (
case ACPI_DMT_EINJINST:
case ACPI_DMT_ERSTACT:
case ACPI_DMT_ERSTINST:
+ case ACPI_DMT_DMAR_SCOPE:
ByteLength = 1;
break;
@@ -562,6 +533,7 @@ DtGetFieldLength (
case ACPI_DMT_NAME4:
case ACPI_DMT_SLIC:
case ACPI_DMT_SIG:
+ case ACPI_DMT_LPIT:
ByteLength = 4;
break;
@@ -871,39 +843,151 @@ DtWalkTableTree (
}
-/******************************************************************************
+/*******************************************************************************
*
- * FUNCTION: DtFreeFieldList
+ * FUNCTION: UtSubtableCacheCalloc
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Pointer to the buffer. Aborts on allocation failure
+ *
+ * DESCRIPTION: Allocate a subtable object buffer. Bypass the local
+ * dynamic memory manager for performance reasons (This has a
+ * major impact on the speed of the compiler.)
+ *
+ ******************************************************************************/
+
+DT_SUBTABLE *
+UtSubtableCacheCalloc (
+ void)
+{
+ ASL_CACHE_INFO *Cache;
+
+
+ if (Gbl_SubtableCacheNext >= Gbl_SubtableCacheLast)
+ {
+ /* Allocate a new buffer */
+
+ Cache = UtLocalCalloc (sizeof (Cache->Next) +
+ (sizeof (DT_SUBTABLE) * ASL_SUBTABLE_CACHE_SIZE));
+
+ /* Link new cache buffer to head of list */
+
+ Cache->Next = Gbl_SubtableCacheList;
+ Gbl_SubtableCacheList = Cache;
+
+ /* Setup cache management pointers */
+
+ Gbl_SubtableCacheNext = ACPI_CAST_PTR (DT_SUBTABLE, Cache->Buffer);
+ Gbl_SubtableCacheLast = Gbl_SubtableCacheNext + ASL_SUBTABLE_CACHE_SIZE;
+ }
+
+ Gbl_SubtableCount++;
+ return (Gbl_SubtableCacheNext++);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: UtFieldCacheCalloc
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Pointer to the buffer. Aborts on allocation failure
+ *
+ * DESCRIPTION: Allocate a field object buffer. Bypass the local
+ * dynamic memory manager for performance reasons (This has a
+ * major impact on the speed of the compiler.)
+ *
+ ******************************************************************************/
+
+DT_FIELD *
+UtFieldCacheCalloc (
+ void)
+{
+ ASL_CACHE_INFO *Cache;
+
+
+ if (Gbl_FieldCacheNext >= Gbl_FieldCacheLast)
+ {
+ /* Allocate a new buffer */
+
+ Cache = UtLocalCalloc (sizeof (Cache->Next) +
+ (sizeof (DT_FIELD) * ASL_FIELD_CACHE_SIZE));
+
+ /* Link new cache buffer to head of list */
+
+ Cache->Next = Gbl_FieldCacheList;
+ Gbl_FieldCacheList = Cache;
+
+ /* Setup cache management pointers */
+
+ Gbl_FieldCacheNext = ACPI_CAST_PTR (DT_FIELD, Cache->Buffer);
+ Gbl_FieldCacheLast = Gbl_FieldCacheNext + ASL_FIELD_CACHE_SIZE;
+ }
+
+ Gbl_FieldCount++;
+ return (Gbl_FieldCacheNext++);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: DtDeleteCaches
*
* PARAMETERS: None
*
* RETURN: None
*
- * DESCRIPTION: Free the field list
+ * DESCRIPTION: Delete all local cache buffer blocks
*
- *****************************************************************************/
+ ******************************************************************************/
void
-DtFreeFieldList (
+DtDeleteCaches (
void)
{
- DT_FIELD *Field = Gbl_FieldList;
- DT_FIELD *NextField;
+ UINT32 BufferCount;
+ ASL_CACHE_INFO *Next;
- /* Walk and free entire field list */
+ /* Field cache */
- while (Field)
+ BufferCount = 0;
+ while (Gbl_FieldCacheList)
{
- NextField = Field->Next; /* Save link */
+ Next = Gbl_FieldCacheList->Next;
+ ACPI_FREE (Gbl_FieldCacheList);
+ Gbl_FieldCacheList = Next;
+ BufferCount++;
+ }
- if (!(Field->Flags & DT_FIELD_NOT_ALLOCATED))
- {
- ACPI_FREE (Field->Name);
- ACPI_FREE (Field->Value);
- }
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "%u Fields, Buffer size: %u fields (%u bytes), %u Buffers\n",
+ Gbl_FieldCount, ASL_FIELD_CACHE_SIZE,
+ (sizeof (DT_FIELD) * ASL_FIELD_CACHE_SIZE), BufferCount);
+
+ Gbl_FieldCount = 0;
+ Gbl_FieldCacheNext = NULL;
+ Gbl_FieldCacheLast = NULL;
- ACPI_FREE (Field);
- Field = NextField;
+ /* Subtable cache */
+
+ BufferCount = 0;
+ while (Gbl_SubtableCacheList)
+ {
+ Next = Gbl_SubtableCacheList->Next;
+ ACPI_FREE (Gbl_SubtableCacheList);
+ Gbl_SubtableCacheList = Next;
+ BufferCount++;
}
+
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "%u Subtables, Buffer size: %u subtables (%u bytes), %u Buffers\n",
+ Gbl_SubtableCount, ASL_SUBTABLE_CACHE_SIZE,
+ (sizeof (DT_SUBTABLE) * ASL_SUBTABLE_CACHE_SIZE), BufferCount);
+
+ Gbl_SubtableCount = 0;
+ Gbl_SubtableCacheNext = NULL;
+ Gbl_SubtableCacheLast = NULL;
}
diff --git a/sys/contrib/dev/acpica/compiler/preprocess.h b/sys/contrib/dev/acpica/compiler/preprocess.h
index ae32a8c..d0642877 100644
--- a/sys/contrib/dev/acpica/compiler/preprocess.h
+++ b/sys/contrib/dev/acpica/compiler/preprocess.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -257,7 +257,7 @@ PrGetNextToken (
void
PrError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 Column);
void
diff --git a/sys/contrib/dev/acpica/compiler/prexpress.c b/sys/contrib/dev/acpica/compiler/prexpress.c
index c0aa565..0f0d938 100644
--- a/sys/contrib/dev/acpica/compiler/prexpress.c
+++ b/sys/contrib/dev/acpica/compiler/prexpress.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/prmacros.c b/sys/contrib/dev/acpica/compiler/prmacros.c
index d76de8b..866d089 100644
--- a/sys/contrib/dev/acpica/compiler/prmacros.c
+++ b/sys/contrib/dev/acpica/compiler/prmacros.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -360,7 +360,7 @@ PrAddMacro (
if (ArgCount >= PR_MAX_MACRO_ARGS)
{
PrError (ASL_ERROR, ASL_MSG_TOO_MANY_ARGUMENTS, TokenOffset);
- return;
+ goto ErrorExit;
}
}
@@ -400,7 +400,7 @@ PrAddMacro (
PrError (ASL_ERROR, ASL_MSG_TOO_MANY_ARGUMENTS,
THIS_TOKEN_OFFSET (Token));
- return;
+ goto ErrorExit;
}
break;
}
@@ -432,7 +432,7 @@ AddMacroToList:
THIS_TOKEN_OFFSET (Name));
}
- return;
+ goto ErrorExit;
}
DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID
@@ -451,6 +451,13 @@ AddMacroToList:
DefineInfo->Args = Args;
DefineInfo->ArgCount = ArgCount;
}
+
+ return;
+
+
+ErrorExit:
+ ACPI_FREE (Args);
+ return;
}
diff --git a/sys/contrib/dev/acpica/compiler/prparser.l b/sys/contrib/dev/acpica/compiler/prparser.l
index b580d57..3150b69 100644
--- a/sys/contrib/dev/acpica/compiler/prparser.l
+++ b/sys/contrib/dev/acpica/compiler/prparser.l
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/prparser.y b/sys/contrib/dev/acpica/compiler/prparser.y
index 391ad3f..20d6e6a 100644
--- a/sys/contrib/dev/acpica/compiler/prparser.y
+++ b/sys/contrib/dev/acpica/compiler/prparser.y
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/prscan.c b/sys/contrib/dev/acpica/compiler/prscan.c
index a3ac0c2..12e9b8e 100644
--- a/sys/contrib/dev/acpica/compiler/prscan.c
+++ b/sys/contrib/dev/acpica/compiler/prscan.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/compiler/prutils.c b/sys/contrib/dev/acpica/compiler/prutils.c
index 0dbf307..e36ea1d 100644
--- a/sys/contrib/dev/acpica/compiler/prutils.c
+++ b/sys/contrib/dev/acpica/compiler/prutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -149,7 +149,7 @@ PrGetNextToken (
void
PrError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 Column)
{
#if 0
@@ -340,7 +340,6 @@ PrOpenIncludeWithPrefix (
if (!IncludeFile)
{
fprintf (stderr, "Could not open include file %s\n", Pathname);
- ACPI_FREE (Pathname);
return (NULL);
}
@@ -393,15 +392,17 @@ PrPushInputFileStack (
/* Reset the global line count and filename */
- Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
+ Gbl_Files[ASL_FILE_INPUT].Filename =
+ UtStringCacheCalloc (strlen (Filename) + 1);
+ strcpy (Gbl_Files[ASL_FILE_INPUT].Filename, Filename);
+
Gbl_Files[ASL_FILE_INPUT].Handle = InputFile;
Gbl_PreviousLineNumber = 0;
Gbl_CurrentLineNumber = 0;
/* Emit a new #line directive for the include file */
- FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\"\n",
- 1, Filename);
+ FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\"\n", 1, Filename);
}
diff --git a/sys/contrib/dev/acpica/components/debugger/dbcmds.c b/sys/contrib/dev/acpica/components/debugger/dbcmds.c
index 921f428..c11451d 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbcmds.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbcmds.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acevents.h>
@@ -116,7 +115,7 @@ AcpiDbConvertToNode (
Node = ACPI_TO_POINTER (Address);
if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
{
- AcpiOsPrintf ("Address %p is invalid in this address space\n",
+ AcpiOsPrintf ("Address %p is invalid",
Node);
return (NULL);
}
@@ -125,7 +124,7 @@ AcpiDbConvertToNode (
if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
{
- AcpiOsPrintf ("Address %p is not a valid NS node [%s]\n",
+ AcpiOsPrintf ("Address %p is not a valid namespace node [%s]\n",
Node, AcpiUtGetDescriptorName (Node));
return (NULL);
}
@@ -139,6 +138,8 @@ AcpiDbConvertToNode (
Node = AcpiDbLocalNsLookup (InString);
if (!Node)
{
+ AcpiOsPrintf ("Could not find [%s] in namespace, defaulting to root node\n",
+ InString);
Node = AcpiGbl_RootNode;
}
}
@@ -337,7 +338,7 @@ AcpiDbDisplayTableInfo (
/* Header */
- AcpiOsPrintf ("Idx ID Status Type Sig Address Len Header\n");
+ AcpiOsPrintf ("Idx ID Status Type TableHeader (Sig, Address, Length)\n");
/* Walk the entire root table list */
@@ -362,35 +363,30 @@ AcpiDbDisplayTableInfo (
switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK)
{
- case ACPI_TABLE_ORIGIN_UNKNOWN:
-
- AcpiOsPrintf ("Unknown ");
- break;
-
- case ACPI_TABLE_ORIGIN_MAPPED:
+ case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
- AcpiOsPrintf ("Mapped ");
+ AcpiOsPrintf ("External/virtual ");
break;
- case ACPI_TABLE_ORIGIN_ALLOCATED:
+ case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL:
- AcpiOsPrintf ("Allocated ");
+ AcpiOsPrintf ("Internal/physical ");
break;
- case ACPI_TABLE_ORIGIN_OVERRIDE:
+ case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
- AcpiOsPrintf ("Override ");
+ AcpiOsPrintf ("Internal/virtual ");
break;
default:
- AcpiOsPrintf ("INVALID ");
+ AcpiOsPrintf ("INVALID TYPE ");
break;
}
/* Make sure that the table is mapped */
- Status = AcpiTbVerifyTable (TableDesc);
+ Status = AcpiTbValidateTable (TableDesc);
if (ACPI_FAILURE (Status))
{
return;
@@ -440,8 +436,6 @@ AcpiDbUnloadAcpiTable (
Node = AcpiDbConvertToNode (ObjectName);
if (!Node)
{
- AcpiOsPrintf ("Could not find [%s] in namespace\n",
- ObjectName);
return;
}
@@ -830,7 +824,7 @@ AcpiDmTestResourceConversion (
/* Convert internal resource list to external AML resource template */
- Status = AcpiRsCreateAmlResources (ResourceBuffer.Pointer, &NewAml);
+ Status = AcpiRsCreateAmlResources (&ResourceBuffer, &NewAml);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("AcpiRsCreateAmlResources failed: %s\n",
@@ -842,8 +836,8 @@ AcpiDmTestResourceConversion (
OriginalAml = ReturnBuffer.Pointer;
- AcpiDmCompareAmlResources (
- OriginalAml->Buffer.Pointer, (ACPI_RSDESC_SIZE) OriginalAml->Buffer.Length,
+ AcpiDmCompareAmlResources (OriginalAml->Buffer.Pointer,
+ (ACPI_RSDESC_SIZE) OriginalAml->Buffer.Length,
NewAml.Pointer, (ACPI_RSDESC_SIZE) NewAml.Length);
/* Cleanup and exit */
@@ -1042,7 +1036,7 @@ GetCrs:
}
EndCrs:
- ACPI_FREE_BUFFER (ReturnBuffer);
+ ACPI_FREE (ReturnBuffer.Pointer);
}
@@ -1192,14 +1186,25 @@ AcpiDbGenerateGpe (
char *GpeArg,
char *BlockArg)
{
- UINT32 BlockNumber;
+ UINT32 BlockNumber = 0;
UINT32 GpeNumber;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
- GpeNumber = ACPI_STRTOUL (GpeArg, NULL, 0);
- BlockNumber = ACPI_STRTOUL (BlockArg, NULL, 0);
+ GpeNumber = ACPI_STRTOUL (GpeArg, NULL, 0);
+ /*
+ * If no block arg, or block arg == 0 or 1, use the FADT-defined
+ * GPE blocks.
+ */
+ if (BlockArg)
+ {
+ BlockNumber = ACPI_STRTOUL (BlockArg, NULL, 0);
+ if (BlockNumber == 1)
+ {
+ BlockNumber = 0;
+ }
+ }
GpeEventInfo = AcpiEvGetGpeEventInfo (ACPI_TO_POINTER (BlockNumber),
GpeNumber);
diff --git a/sys/contrib/dev/acpica/components/debugger/dbconvert.c b/sys/contrib/dev/acpica/components/debugger/dbconvert.c
index 6daa753..f6c0286 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbconvert.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbconvert.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdebug.h>
@@ -362,7 +361,9 @@ AcpiDbEncodePldBuffer (
Dword = 0;
ACPI_PLD_SET_REVISION (&Dword, PldInfo->Revision);
ACPI_PLD_SET_IGNORE_COLOR (&Dword, PldInfo->IgnoreColor);
- ACPI_PLD_SET_COLOR (&Dword, PldInfo->Color);
+ ACPI_PLD_SET_RED (&Dword, PldInfo->Red);
+ ACPI_PLD_SET_GREEN (&Dword, PldInfo->Green);
+ ACPI_PLD_SET_BLUE (&Dword, PldInfo->Blue);
ACPI_MOVE_32_TO_32 (&Buffer[0], &Dword);
/* Second 32 bits */
@@ -481,45 +482,47 @@ AcpiDbDumpPldBuffer (
/* First 32-bit dword */
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "Revision", PldInfo->Revision);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "IgnoreColor", PldInfo->IgnoreColor);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "Color", PldInfo->Color);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Revision", PldInfo->Revision);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_IgnoreColor", PldInfo->IgnoreColor);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Red", PldInfo->Red);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Green", PldInfo->Green);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Blue", PldInfo->Blue);
/* Second 32-bit dword */
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "Width", PldInfo->Width);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "Height", PldInfo->Height);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Width", PldInfo->Width);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Height", PldInfo->Height);
/* Third 32-bit dword */
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "UserVisible", PldInfo->UserVisible);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "Dock", PldInfo->Dock);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "Lid", PldInfo->Lid);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "Panel", PldInfo->Panel);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "VerticalPosition", PldInfo->VerticalPosition);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "HorizontalPosition", PldInfo->HorizontalPosition);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "Shape", PldInfo->Shape);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupOrientation", PldInfo->GroupOrientation);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupToken", PldInfo->GroupToken);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupPosition", PldInfo->GroupPosition);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "Bay", PldInfo->Bay);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_UserVisible", PldInfo->UserVisible);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Dock", PldInfo->Dock);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Lid", PldInfo->Lid);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Panel", PldInfo->Panel);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_VerticalPosition", PldInfo->VerticalPosition);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_HorizontalPosition", PldInfo->HorizontalPosition);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Shape", PldInfo->Shape);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_GroupOrientation", PldInfo->GroupOrientation);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_GroupToken", PldInfo->GroupToken);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_GroupPosition", PldInfo->GroupPosition);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Bay", PldInfo->Bay);
/* Fourth 32-bit dword */
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "Ejectable", PldInfo->Ejectable);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "OspmEjectRequired", PldInfo->OspmEjectRequired);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "CabinetNumber", PldInfo->CabinetNumber);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "CardCageNumber", PldInfo->CardCageNumber);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "Reference", PldInfo->Reference);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "Rotation", PldInfo->Rotation);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "Order", PldInfo->Order);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Ejectable", PldInfo->Ejectable);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_EjectRequired", PldInfo->OspmEjectRequired);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_CabinetNumber", PldInfo->CabinetNumber);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_CardCageNumber", PldInfo->CardCageNumber);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Reference", PldInfo->Reference);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Rotation", PldInfo->Rotation);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Order", PldInfo->Order);
/* Fifth 32-bit dword */
if (BufferDesc->Buffer.Length > 16)
{
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "VerticalOffset", PldInfo->VerticalOffset);
- AcpiOsPrintf (ACPI_PLD_OUTPUT, "HorizontalOffset", PldInfo->HorizontalOffset);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_VerticalOffset", PldInfo->VerticalOffset);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_HorizontalOffset", PldInfo->HorizontalOffset);
}
ACPI_FREE (PldInfo);
diff --git a/sys/contrib/dev/acpica/components/debugger/dbdisply.c b/sys/contrib/dev/acpica/components/debugger/dbdisply.c
index 62edea0..507c2b0 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbdisply.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbdisply.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/amlcode.h>
@@ -303,6 +302,10 @@ AcpiDbDecodeAndDisplayObject (
/* Is not a recognizeable object */
+ AcpiOsPrintf (
+ "Not a known ACPI internal object, descriptor type %2.2X\n",
+ ACPI_GET_DESCRIPTOR_TYPE (ObjPtr));
+
Size = 16;
if (AcpiOsReadable (ObjPtr, 64))
{
@@ -897,7 +900,7 @@ AcpiDbDisplayGpes (
GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j;
GpeEventInfo = &GpeBlock->EventInfo[GpeIndex];
- if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
+ if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
ACPI_GPE_DISPATCH_NONE)
{
/* This GPE is not used (no method or handler), ignore it */
@@ -930,7 +933,7 @@ AcpiDbDisplayGpes (
AcpiOsPrintf ("RunOnly, ");
}
- switch (GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK)
+ switch (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags))
{
case ACPI_GPE_DISPATCH_NONE:
@@ -941,6 +944,7 @@ AcpiDbDisplayGpes (
AcpiOsPrintf ("Method");
break;
+
case ACPI_GPE_DISPATCH_HANDLER:
AcpiOsPrintf ("Handler");
@@ -958,10 +962,15 @@ AcpiDbDisplayGpes (
AcpiOsPrintf ("Implicit Notify on %u devices", Count);
break;
+ case ACPI_GPE_DISPATCH_RAW_HANDLER:
+
+ AcpiOsPrintf ("RawHandler");
+ break;
+
default:
AcpiOsPrintf ("UNKNOWN: %X",
- GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK);
+ ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags));
break;
}
diff --git a/sys/contrib/dev/acpica/components/debugger/dbexec.c b/sys/contrib/dev/acpica/components/debugger/dbexec.c
index 2566e2d..79c0ee9 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbexec.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbexec.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdebug.h>
@@ -62,7 +61,7 @@ AcpiDbExecuteMethod (
ACPI_DB_METHOD_INFO *Info,
ACPI_BUFFER *ReturnObj);
-static void
+static ACPI_STATUS
AcpiDbExecuteSetup (
ACPI_DB_METHOD_INFO *Info);
@@ -237,10 +236,15 @@ Cleanup:
*
******************************************************************************/
-static void
+static ACPI_STATUS
AcpiDbExecuteSetup (
ACPI_DB_METHOD_INFO *Info)
{
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_NAME (DbExecuteSetup);
+
/* Catenate the current scope to the supplied name */
@@ -248,10 +252,21 @@ AcpiDbExecuteSetup (
if ((Info->Name[0] != '\\') &&
(Info->Name[0] != '/'))
{
- ACPI_STRCAT (Info->Pathname, AcpiGbl_DbScopeBuf);
+ if (AcpiUtSafeStrcat (Info->Pathname, sizeof (Info->Pathname),
+ AcpiGbl_DbScopeBuf))
+ {
+ Status = AE_BUFFER_OVERFLOW;
+ goto ErrorExit;
+ }
+ }
+
+ if (AcpiUtSafeStrcat (Info->Pathname, sizeof (Info->Pathname),
+ Info->Name))
+ {
+ Status = AE_BUFFER_OVERFLOW;
+ goto ErrorExit;
}
- ACPI_STRCAT (Info->Pathname, Info->Name);
AcpiDbPrepNamestring (Info->Pathname);
AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
@@ -269,6 +284,13 @@ AcpiDbExecuteSetup (
AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
}
+
+ return (AE_OK);
+
+ErrorExit:
+
+ ACPI_EXCEPTION ((AE_INFO, Status, "During setup for method execution"));
+ return (Status);
}
@@ -429,7 +451,12 @@ AcpiDbExecute (
ReturnObj.Pointer = NULL;
ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
- AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo);
+ Status = AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_FREE (NameString);
+ return;
+ }
/* Get the NS node, determines existence also */
@@ -729,7 +756,11 @@ AcpiDbCreateExecutionThreads (
AcpiDbUint32ToHexString (NumThreads, AcpiGbl_DbMethodInfo.NumThreadsStr);
- AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo);
+ Status = AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo);
+ if (ACPI_FAILURE (Status))
+ {
+ goto CleanupAndExit;
+ }
/* Get the NS node, determines existence also */
diff --git a/sys/contrib/dev/acpica/components/debugger/dbfileio.c b/sys/contrib/dev/acpica/components/debugger/dbfileio.c
index 05fa4e7..9bf0b29 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbfileio.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbfileio.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,48 +42,18 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdebug.h>
-
-#ifdef ACPI_APPLICATION
#include <contrib/dev/acpica/include/actables.h>
-#endif
-
-#ifdef ACPI_ASL_COMPILER
-#include <contrib/dev/acpica/compiler/aslcompiler.h>
-#endif
#if (defined ACPI_DEBUGGER || defined ACPI_DISASSEMBLER)
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbfileio")
-/*
- * NOTE: this is here for lack of a better place. It is used in all
- * flavors of the debugger, need LCD file
- */
-#ifdef ACPI_APPLICATION
-#include <stdio.h>
-FILE *AcpiGbl_DebugFile = NULL;
-#endif
-
-
#ifdef ACPI_DEBUGGER
-/* Local prototypes */
-
-#ifdef ACPI_APPLICATION
-
-static ACPI_STATUS
-AcpiDbCheckTextModeCorruption (
- UINT8 *Table,
- UINT32 TableLength,
- UINT32 FileLength);
-
-#endif
-
/*******************************************************************************
*
* FUNCTION: AcpiDbCloseDebugFile
@@ -152,242 +122,7 @@ AcpiDbOpenDebugFile (
#ifdef ACPI_APPLICATION
-/*******************************************************************************
- *
- * FUNCTION: AcpiDbCheckTextModeCorruption
- *
- * PARAMETERS: Table - Table buffer
- * TableLength - Length of table from the table header
- * FileLength - Length of the file that contains the table
- *
- * RETURN: Status
- *
- * DESCRIPTION: Check table for text mode file corruption where all linefeed
- * characters (LF) have been replaced by carriage return linefeed
- * pairs (CR/LF).
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-AcpiDbCheckTextModeCorruption (
- UINT8 *Table,
- UINT32 TableLength,
- UINT32 FileLength)
-{
- UINT32 i;
- UINT32 Pairs = 0;
-
-
- if (TableLength != FileLength)
- {
- ACPI_WARNING ((AE_INFO,
- "File length (0x%X) is not the same as the table length (0x%X)",
- FileLength, TableLength));
- }
-
- /* Scan entire table to determine if each LF has been prefixed with a CR */
-
- for (i = 1; i < FileLength; i++)
- {
- if (Table[i] == 0x0A)
- {
- if (Table[i - 1] != 0x0D)
- {
- /* The LF does not have a preceding CR, table not corrupted */
-
- return (AE_OK);
- }
- else
- {
- /* Found a CR/LF pair */
-
- Pairs++;
- }
- i++;
- }
- }
-
- if (!Pairs)
- {
- return (AE_OK);
- }
-
- /*
- * Entire table scanned, each CR is part of a CR/LF pair --
- * meaning that the table was treated as a text file somewhere.
- *
- * NOTE: We can't "fix" the table, because any existing CR/LF pairs in the
- * original table are left untouched by the text conversion process --
- * meaning that we cannot simply replace CR/LF pairs with LFs.
- */
- AcpiOsPrintf ("Table has been corrupted by text mode conversion\n");
- AcpiOsPrintf ("All LFs (%u) were changed to CR/LF pairs\n", Pairs);
- AcpiOsPrintf ("Table cannot be repaired!\n");
- return (AE_BAD_VALUE);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiDbReadTable
- *
- * PARAMETERS: fp - File that contains table
- * Table - Return value, buffer with table
- * TableLength - Return value, length of table
- *
- * RETURN: Status
- *
- * DESCRIPTION: Load the DSDT from the file pointer
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-AcpiDbReadTable (
- FILE *fp,
- ACPI_TABLE_HEADER **Table,
- UINT32 *TableLength)
-{
- ACPI_TABLE_HEADER TableHeader;
- UINT32 Actual;
- ACPI_STATUS Status;
- UINT32 FileSize;
- BOOLEAN StandardHeader = TRUE;
-
-
- /* Get the file size */
-
- fseek (fp, 0, SEEK_END);
- FileSize = (UINT32) ftell (fp);
- fseek (fp, 0, SEEK_SET);
-
- if (FileSize < 4)
- {
- return (AE_BAD_HEADER);
- }
-
- /* Read the signature */
-
- if (fread (&TableHeader, 1, 4, fp) != 4)
- {
- AcpiOsPrintf ("Could not read the table signature\n");
- return (AE_BAD_HEADER);
- }
-
- fseek (fp, 0, SEEK_SET);
-
- /* The RSDP table does not have standard ACPI header */
-
- if (ACPI_COMPARE_NAME (TableHeader.Signature, "RSD "))
- {
- *TableLength = FileSize;
- StandardHeader = FALSE;
- }
- else
- {
- /* Read the table header */
-
- if (fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), fp) !=
- sizeof (ACPI_TABLE_HEADER))
- {
- AcpiOsPrintf ("Could not read the table header\n");
- return (AE_BAD_HEADER);
- }
-
-#if 0
- /* Validate the table header/length */
-
- Status = AcpiTbValidateTableHeader (&TableHeader);
- if (ACPI_FAILURE (Status))
- {
- AcpiOsPrintf ("Table header is invalid!\n");
- return (Status);
- }
-#endif
-
- /* File size must be at least as long as the Header-specified length */
-
- if (TableHeader.Length > FileSize)
- {
- AcpiOsPrintf (
- "TableHeader length [0x%X] greater than the input file size [0x%X]\n",
- TableHeader.Length, FileSize);
-
-#ifdef ACPI_ASL_COMPILER
- Status = FlCheckForAscii (fp, NULL, FALSE);
- if (ACPI_SUCCESS (Status))
- {
- AcpiOsPrintf ("File appears to be ASCII only, must be binary\n",
- TableHeader.Length, FileSize);
- }
-#endif
- return (AE_BAD_HEADER);
- }
-
-#ifdef ACPI_OBSOLETE_CODE
- /* We only support a limited number of table types */
-
- if (!ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_DSDT) &&
- !ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_PSDT) &&
- !ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_SSDT))
- {
- AcpiOsPrintf ("Table signature [%4.4s] is invalid or not supported\n",
- (char *) TableHeader.Signature);
- ACPI_DUMP_BUFFER (&TableHeader, sizeof (ACPI_TABLE_HEADER));
- return (AE_ERROR);
- }
-#endif
-
- *TableLength = TableHeader.Length;
- }
-
- /* Allocate a buffer for the table */
-
- *Table = AcpiOsAllocate ((size_t) FileSize);
- if (!*Table)
- {
- AcpiOsPrintf (
- "Could not allocate memory for ACPI table %4.4s (size=0x%X)\n",
- TableHeader.Signature, *TableLength);
- return (AE_NO_MEMORY);
- }
-
- /* Get the rest of the table */
-
- fseek (fp, 0, SEEK_SET);
- Actual = fread (*Table, 1, (size_t) FileSize, fp);
- if (Actual == FileSize)
- {
- if (StandardHeader)
- {
- /* Now validate the checksum */
-
- Status = AcpiTbVerifyChecksum ((void *) *Table,
- ACPI_CAST_PTR (ACPI_TABLE_HEADER, *Table)->Length);
-
- if (Status == AE_BAD_CHECKSUM)
- {
- Status = AcpiDbCheckTextModeCorruption ((UINT8 *) *Table,
- FileSize, (*Table)->Length);
- return (Status);
- }
- }
- return (AE_OK);
- }
-
- if (Actual > 0)
- {
- AcpiOsPrintf ("Warning - reading table, asked for %X got %X\n",
- FileSize, Actual);
- return (AE_OK);
- }
-
- AcpiOsPrintf ("Error - could not read the table file\n");
- AcpiOsFree (*Table);
- *Table = NULL;
- *TableLength = 0;
- return (AE_ERROR);
-}
-
+#include <contrib/dev/acpica/include/acapps.h>
/*******************************************************************************
*
@@ -431,7 +166,7 @@ AeLocalLoadTable (
/* Install the new table into the local data structures */
- Status = AcpiTbInstallTable (&TableInfo);
+ Status = AcpiTbInitTableDescriptor (&TableInfo);
if (ACPI_FAILURE (Status))
{
if (Status == AE_ALREADY_EXISTS)
@@ -462,54 +197,6 @@ AeLocalLoadTable (
return_ACPI_STATUS (Status);
}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiDbReadTableFromFile
- *
- * PARAMETERS: Filename - File where table is located
- * Table - Where a pointer to the table is returned
- *
- * RETURN: Status
- *
- * DESCRIPTION: Get an ACPI table from a file
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiDbReadTableFromFile (
- char *Filename,
- ACPI_TABLE_HEADER **Table)
-{
- FILE *File;
- UINT32 TableLength;
- ACPI_STATUS Status;
-
-
- /* Open the file */
-
- File = fopen (Filename, "rb");
- if (!File)
- {
- AcpiOsPrintf ("Could not open input file %s\n", Filename);
- return (AE_ERROR);
- }
-
- /* Get the entire file */
-
- fprintf (stderr, "Loading Acpi table from file %s\n", Filename);
- Status = AcpiDbReadTable (File, Table, &TableLength);
- fclose(File);
-
- if (ACPI_FAILURE (Status))
- {
- AcpiOsPrintf ("Could not get table from the file\n");
- return (Status);
- }
-
- return (AE_OK);
- }
#endif
@@ -537,7 +224,7 @@ AcpiDbGetTableFromFile (
BOOLEAN IsAmlTable = TRUE;
- Status = AcpiDbReadTableFromFile (Filename, &Table);
+ Status = AcpiUtReadTableFromFile (Filename, &Table);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -568,6 +255,8 @@ AcpiDbGetTableFromFile (
return (Status);
}
+ AcpiTbPrintTableHeader (0, Table);
+
fprintf (stderr,
"Acpi table [%4.4s] successfully installed and loaded\n",
Table->Signature);
diff --git a/sys/contrib/dev/acpica/components/debugger/dbhistry.c b/sys/contrib/dev/acpica/components/debugger/dbhistry.c
index 4a97ba4..e945779 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbhistry.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbhistry.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdebug.h>
@@ -69,7 +68,7 @@ static HISTORY_INFO AcpiGbl_HistoryBuffer[HISTORY_SIZE];
static UINT16 AcpiGbl_LoHistory = 0;
static UINT16 AcpiGbl_NumHistory = 0;
static UINT16 AcpiGbl_NextHistoryIndex = 0;
-static UINT32 AcpiGbl_NextCmdNum = 1;
+UINT32 AcpiGbl_NextCmdNum = 1;
/*******************************************************************************
@@ -94,6 +93,11 @@ AcpiDbAddToHistory (
/* Put command into the next available slot */
CmdLen = (UINT16) ACPI_STRLEN (CommandLine);
+ if (!CmdLen)
+ {
+ return;
+ }
+
if (AcpiGbl_HistoryBuffer[AcpiGbl_NextHistoryIndex].Command != NULL)
{
BufferLen = (UINT16) ACPI_STRLEN (
@@ -203,8 +207,6 @@ char *
AcpiDbGetFromHistory (
char *CommandNumArg)
{
- UINT32 i;
- UINT16 HistoryIndex;
UINT32 CmdNum;
@@ -218,6 +220,31 @@ AcpiDbGetFromHistory (
CmdNum = ACPI_STRTOUL (CommandNumArg, NULL, 0);
}
+ return (AcpiDbGetHistoryByIndex (CmdNum));
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbGetHistoryByIndex
+ *
+ * PARAMETERS: CmdNum - Index of the desired history entry.
+ * Values are 0...(AcpiGbl_NextCmdNum - 1)
+ *
+ * RETURN: Pointer to the retrieved command. Null on error.
+ *
+ * DESCRIPTION: Get a command from the history buffer
+ *
+ ******************************************************************************/
+
+char *
+AcpiDbGetHistoryByIndex (
+ UINT32 CmdNum)
+{
+ UINT32 i;
+ UINT16 HistoryIndex;
+
+
/* Search history buffer */
HistoryIndex = AcpiGbl_LoHistory;
@@ -230,6 +257,7 @@ AcpiDbGetFromHistory (
return (AcpiGbl_HistoryBuffer[HistoryIndex].Command);
}
+ /* History buffer is circular */
HistoryIndex++;
if (HistoryIndex >= HISTORY_SIZE)
diff --git a/sys/contrib/dev/acpica/components/debugger/dbinput.c b/sys/contrib/dev/acpica/components/debugger/dbinput.c
index c1a51f8..297b9e9 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbinput.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbinput.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdebug.h>
@@ -93,7 +92,6 @@ enum AcpiExDebuggerCommands
CMD_ALLOCATIONS,
CMD_ARGS,
CMD_ARGUMENTS,
- CMD_BATCH,
CMD_BREAKPOINT,
CMD_BUSINFO,
CMD_CALL,
@@ -128,7 +126,7 @@ enum AcpiExDebuggerCommands
CMD_METHODS,
CMD_NAMESPACE,
CMD_NOTIFY,
- CMD_OBJECT,
+ CMD_OBJECTS,
CMD_OPEN,
CMD_OSI,
CMD_OWNER,
@@ -147,6 +145,7 @@ enum AcpiExDebuggerCommands
CMD_TABLES,
CMD_TEMPLATE,
CMD_TERMINATE,
+ CMD_TEST,
CMD_THREADS,
CMD_TRACE,
CMD_TREE,
@@ -166,7 +165,6 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] =
{"ALLOCATIONS", 0},
{"ARGS", 0},
{"ARGUMENTS", 0},
- {"BATCH", 0},
{"BREAKPOINT", 1},
{"BUSINFO", 0},
{"CALL", 0},
@@ -182,7 +180,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] =
{"EXIT", 0},
{"FIND", 1},
{"GO", 0},
- {"GPE", 2},
+ {"GPE", 1},
{"GPES", 0},
{"HANDLERS", 0},
{"HELP", 0},
@@ -201,7 +199,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] =
{"METHODS", 0},
{"NAMESPACE", 0},
{"NOTIFY", 2},
- {"OBJECT", 1},
+ {"OBJECTS", 1},
{"OPEN", 1},
{"OSI", 0},
{"OWNER", 1},
@@ -220,6 +218,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] =
{"TABLES", 0},
{"TEMPLATE", 1},
{"TERMINATE", 0},
+ {"TEST", 1},
{"THREADS", 3},
{"TRACE", 1},
{"TREE", 0},
@@ -246,8 +245,7 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] =
{1, " Locks", "Current status of internal mutexes\n"},
{1, " Osi [Install|Remove <name>]", "Display or modify global _OSI list\n"},
{1, " Quit or Exit", "Exit this command\n"},
- {9, " Stats [Allocations|Memory|Misc|", "\n"},
- {1, " Objects|Sizes|Stack|Tables]", "Display namespace and memory statistics\n"},
+ {8, " Stats <SubCommand>", "Display namespace and memory statistics\n"},
{1, " Allocations", "Display list of current memory allocations\n"},
{1, " Memory", "Dump internal memory lists\n"},
{1, " Misc", "Namespace search and mutex stats\n"},
@@ -306,7 +304,7 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] =
{0, "\nHardware Related Commands:", "\n"},
{1, " Event <F|G> <Value>", "Generate AcpiEvent (Fixed/GPE)\n"},
- {1, " Gpe <GpeNum> <GpeBlock>", "Simulate a GPE\n"},
+ {1, " Gpe <GpeNum> [GpeBlockDevice]", "Simulate a GPE\n"},
{1, " Gpes", "Display info on all GPEs\n"},
{1, " Sci", "Generate an SCI\n"},
{1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"},
@@ -315,6 +313,11 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] =
{1, " Close", "Close debug output file\n"},
{1, " Load <Input Filename>", "Load ACPI table from a file\n"},
{1, " Open <Output Filename>", "Open a file for debug output\n"},
+
+ {0, "\nDebug Test Commands:", "\n"},
+ {3, " Test <TestName>", "Invoke a debug test\n"},
+ {1, " Objects", "Read/write/compare all namespace data objects\n"},
+ {1, " Predefined", "Execute all ACPI predefined names (_STA, etc.)\n"},
{0, NULL, NULL}
};
@@ -635,7 +638,13 @@ AcpiDbGetLine (
char *This;
- ACPI_STRCPY (AcpiGbl_DbParsedBuf, InputBuffer);
+ if (AcpiUtSafeStrcpy (AcpiGbl_DbParsedBuf, sizeof (AcpiGbl_DbParsedBuf),
+ InputBuffer))
+ {
+ AcpiOsPrintf ("Buffer overflow while parsing input line (max %u characters)\n",
+ sizeof (AcpiGbl_DbParsedBuf));
+ return (0);
+ }
This = AcpiGbl_DbParsedBuf;
for (i = 0; i < ACPI_DEBUGGER_MAX_ARGS; i++)
@@ -740,6 +749,11 @@ AcpiDbCommandDispatch (
return (AE_CTRL_TERMINATE);
}
+
+ /* Add all commands that come here to the history buffer */
+
+ AcpiDbAddToHistory (InputBuffer);
+
ParamCount = AcpiDbGetLine (InputBuffer);
CommandIndex = AcpiDbMatchCommand (AcpiGbl_DbArgs[0]);
Temp = 0;
@@ -781,11 +795,6 @@ AcpiDbCommandDispatch (
AcpiDbDisplayArguments ();
break;
- case CMD_BATCH:
-
- AcpiDbBatchExecute (AcpiGbl_DbArgs[1]);
- break;
-
case CMD_BREAKPOINT:
AcpiDbSetMethodBreakpoint (AcpiGbl_DbArgs[1], WalkState, Op);
@@ -989,7 +998,7 @@ AcpiDbCommandDispatch (
AcpiDbSendNotify (AcpiGbl_DbArgs[1], Temp);
break;
- case CMD_OBJECT:
+ case CMD_OBJECTS:
AcpiUtStrupr (AcpiGbl_DbArgs[1]);
Status = AcpiDbDisplayObjects (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
@@ -1088,6 +1097,11 @@ AcpiDbCommandDispatch (
/* AcpiInitialize (NULL); */
break;
+ case CMD_TEST:
+
+ AcpiDbExecuteTest (AcpiGbl_DbArgs[1]);
+ break;
+
case CMD_THREADS:
AcpiDbCreateExecutionThreads (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2],
@@ -1135,7 +1149,7 @@ AcpiDbCommandDispatch (
case CMD_NOT_FOUND:
default:
- AcpiOsPrintf ("Unknown Command\n");
+ AcpiOsPrintf ("%s: unknown command\n", AcpiGbl_DbArgs[0]);
return (AE_CTRL_TRUE);
}
@@ -1144,9 +1158,6 @@ AcpiDbCommandDispatch (
Status = AE_CTRL_TRUE;
}
- /* Add all commands that come here to the history buffer */
-
- AcpiDbAddToHistory (InputBuffer);
return (Status);
}
diff --git a/sys/contrib/dev/acpica/components/debugger/dbmethod.c b/sys/contrib/dev/acpica/components/debugger/dbmethod.c
index ca2d92b..8f2e4db 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbmethod.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbmethod.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdispat.h>
@@ -58,16 +57,6 @@
ACPI_MODULE_NAME ("dbmethod")
-/* Local prototypes */
-
-static ACPI_STATUS
-AcpiDbWalkForExecute (
- ACPI_HANDLE ObjHandle,
- UINT32 NestingLevel,
- void *Context,
- void **ReturnValue);
-
-
/*******************************************************************************
*
* FUNCTION: AcpiDbSetMethodBreakpoint
@@ -190,6 +179,11 @@ AcpiDbSetMethodData (
if (Type == 'N')
{
Node = AcpiDbConvertToNode (IndexArg);
+ if (!Node)
+ {
+ return;
+ }
+
if (Node->Type != ACPI_TYPE_INTEGER)
{
AcpiOsPrintf ("Can only set Integer nodes\n");
@@ -418,195 +412,4 @@ AcpiDbDisassembleMethod (
return (AE_OK);
}
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiDbWalkForExecute
- *
- * PARAMETERS: Callback from WalkNamespace
- *
- * RETURN: Status
- *
- * DESCRIPTION: Batch execution module. Currently only executes predefined
- * ACPI names.
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-AcpiDbWalkForExecute (
- ACPI_HANDLE ObjHandle,
- UINT32 NestingLevel,
- void *Context,
- void **ReturnValue)
-{
- ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
- ACPI_DB_EXECUTE_WALK *Info = (ACPI_DB_EXECUTE_WALK *) Context;
- char *Pathname;
- const ACPI_PREDEFINED_INFO *Predefined;
- ACPI_DEVICE_INFO *ObjInfo;
- ACPI_OBJECT_LIST ParamObjects;
- ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS];
- ACPI_OBJECT *ThisParam;
- ACPI_BUFFER ReturnObj;
- ACPI_STATUS Status;
- UINT16 ArgTypeList;
- UINT8 ArgCount;
- UINT8 ArgType;
- UINT32 i;
-
-
- /* The name must be a predefined ACPI name */
-
- Predefined = AcpiUtMatchPredefinedMethod (Node->Name.Ascii);
- if (!Predefined)
- {
- return (AE_OK);
- }
-
- if (Node->Type == ACPI_TYPE_LOCAL_SCOPE)
- {
- return (AE_OK);
- }
-
- Pathname = AcpiNsGetExternalPathname (Node);
- if (!Pathname)
- {
- return (AE_OK);
- }
-
- /* Get the object info for number of method parameters */
-
- Status = AcpiGetObjectInfo (ObjHandle, &ObjInfo);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParamObjects.Count = 0;
- ParamObjects.Pointer = NULL;
-
- if (ObjInfo->Type == ACPI_TYPE_METHOD)
- {
- /* Setup default parameters (with proper types) */
-
- ArgTypeList = Predefined->Info.ArgumentList;
- ArgCount = METHOD_GET_ARG_COUNT (ArgTypeList);
-
- /*
- * Setup the ACPI-required number of arguments, regardless of what
- * the actual method defines. If there is a difference, then the
- * method is wrong and a warning will be issued during execution.
- */
- ThisParam = Params;
- for (i = 0; i < ArgCount; i++)
- {
- ArgType = METHOD_GET_NEXT_TYPE (ArgTypeList);
- ThisParam->Type = ArgType;
-
- switch (ArgType)
- {
- case ACPI_TYPE_INTEGER:
-
- ThisParam->Integer.Value = 1;
- break;
-
- case ACPI_TYPE_STRING:
-
- ThisParam->String.Pointer = "This is the default argument string";
- ThisParam->String.Length = ACPI_STRLEN (ThisParam->String.Pointer);
- break;
-
- case ACPI_TYPE_BUFFER:
-
- ThisParam->Buffer.Pointer = (UINT8 *) Params; /* just a garbage buffer */
- ThisParam->Buffer.Length = 48;
- break;
-
- case ACPI_TYPE_PACKAGE:
-
- ThisParam->Package.Elements = NULL;
- ThisParam->Package.Count = 0;
- break;
-
- default:
-
- AcpiOsPrintf ("%s: Unsupported argument type: %u\n",
- Pathname, ArgType);
- break;
- }
-
- ThisParam++;
- }
-
- ParamObjects.Count = ArgCount;
- ParamObjects.Pointer = Params;
- }
-
- ACPI_FREE (ObjInfo);
- ReturnObj.Pointer = NULL;
- ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
-
- /* Do the actual method execution */
-
- AcpiGbl_MethodExecuting = TRUE;
-
- Status = AcpiEvaluateObject (Node, NULL, &ParamObjects, &ReturnObj);
-
- AcpiOsPrintf ("%-32s returned %s\n", Pathname, AcpiFormatException (Status));
- AcpiGbl_MethodExecuting = FALSE;
- ACPI_FREE (Pathname);
-
- /* 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);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiDbBatchExecute
- *
- * PARAMETERS: CountArg - Max number of methods to execute
- *
- * RETURN: None
- *
- * DESCRIPTION: Namespace batch execution. Execute predefined names in the
- * namespace, up to the max count, if specified.
- *
- ******************************************************************************/
-
-void
-AcpiDbBatchExecute (
- char *CountArg)
-{
- ACPI_DB_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, NULL, (void *) &Info, NULL);
-
- AcpiOsPrintf ("Evaluated %u predefined names in the namespace\n", Info.Count);
-}
-
#endif /* ACPI_DEBUGGER */
diff --git a/sys/contrib/dev/acpica/components/debugger/dbnames.c b/sys/contrib/dev/acpica/components/debugger/dbnames.c
index 5ac39fd..d749b1d 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbnames.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbnames.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -171,8 +170,7 @@ AcpiDbSetScope (
goto ErrorExit;
}
- ACPI_STRCPY (AcpiGbl_DbScopeBuf, Name);
- ACPI_STRCAT (AcpiGbl_DbScopeBuf, "\\");
+ AcpiGbl_DbScopeBuf[0] = 0;
}
else
{
@@ -184,9 +182,22 @@ AcpiDbSetScope (
{
goto ErrorExit;
}
+ }
- ACPI_STRCAT (AcpiGbl_DbScopeBuf, Name);
- ACPI_STRCAT (AcpiGbl_DbScopeBuf, "\\");
+ /* Build the final pathname */
+
+ if (AcpiUtSafeStrcat (AcpiGbl_DbScopeBuf, sizeof (AcpiGbl_DbScopeBuf),
+ Name))
+ {
+ Status = AE_BUFFER_OVERFLOW;
+ goto ErrorExit;
+ }
+
+ if (AcpiUtSafeStrcat (AcpiGbl_DbScopeBuf, sizeof (AcpiGbl_DbScopeBuf),
+ "\\"))
+ {
+ Status = AE_BUFFER_OVERFLOW;
+ goto ErrorExit;
}
AcpiGbl_DbScopeNode = Node;
diff --git a/sys/contrib/dev/acpica/components/debugger/dbstats.c b/sys/contrib/dev/acpica/components/debugger/dbstats.c
index ef23634..ecedcf9 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbstats.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbstats.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdebug.h>
@@ -401,7 +400,7 @@ AcpiDbDisplayStatistics (
AcpiUtStrupr (TypeArg);
Temp = AcpiDbMatchArgument (TypeArg, AcpiDbStatTypes);
- if (Temp == (UINT32) -1)
+ if (Temp == ACPI_TYPE_NOT_FOUND)
{
AcpiOsPrintf ("Invalid or unsupported argument\n");
return (AE_OK);
diff --git a/sys/contrib/dev/acpica/components/debugger/dbtest.c b/sys/contrib/dev/acpica/components/debugger/dbtest.c
new file mode 100644
index 0000000..ab14984
--- /dev/null
+++ b/sys/contrib/dev/acpica/components/debugger/dbtest.c
@@ -0,0 +1,1138 @@
+/*******************************************************************************
+ *
+ * Module Name: dbtest - Various debug-related tests
+ *
+ ******************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acdebug.h>
+#include <contrib/dev/acpica/include/acnamesp.h>
+#include <contrib/dev/acpica/include/acpredef.h>
+
+#ifdef ACPI_DEBUGGER
+
+#define _COMPONENT ACPI_CA_DEBUGGER
+ ACPI_MODULE_NAME ("dbtest")
+
+
+/* Local prototypes */
+
+static void
+AcpiDbTestAllObjects (
+ void);
+
+static ACPI_STATUS
+AcpiDbTestOneObject (
+ ACPI_HANDLE ObjHandle,
+ UINT32 NestingLevel,
+ void *Context,
+ void **ReturnValue);
+
+static ACPI_STATUS
+AcpiDbTestIntegerType (
+ ACPI_NAMESPACE_NODE *Node,
+ UINT32 BitLength);
+
+static ACPI_STATUS
+AcpiDbTestBufferType (
+ ACPI_NAMESPACE_NODE *Node,
+ UINT32 BitLength);
+
+static ACPI_STATUS
+AcpiDbTestStringType (
+ ACPI_NAMESPACE_NODE *Node,
+ UINT32 ByteLength);
+
+static ACPI_STATUS
+AcpiDbReadFromObject (
+ ACPI_NAMESPACE_NODE *Node,
+ ACPI_OBJECT_TYPE ExpectedType,
+ ACPI_OBJECT **Value);
+
+static ACPI_STATUS
+AcpiDbWriteToObject (
+ ACPI_NAMESPACE_NODE *Node,
+ ACPI_OBJECT *Value);
+
+static void
+AcpiDbEvaluateAllPredefinedNames (
+ char *CountArg);
+
+static ACPI_STATUS
+AcpiDbEvaluateOnePredefinedName (
+ ACPI_HANDLE ObjHandle,
+ UINT32 NestingLevel,
+ void *Context,
+ void **ReturnValue);
+
+/*
+ * Test subcommands
+ */
+static ACPI_DB_ARGUMENT_INFO AcpiDbTestTypes [] =
+{
+ {"OBJECTS"},
+ {"PREDEFINED"},
+ {NULL} /* Must be null terminated */
+};
+
+#define CMD_TEST_OBJECTS 0
+#define CMD_TEST_PREDEFINED 1
+
+#define BUFFER_FILL_VALUE 0xFF
+
+/*
+ * Support for the special debugger read/write control methods.
+ * These methods are installed into the current namespace and are
+ * used to read and write the various namespace objects. The point
+ * is to force the AML interpreter do all of the work.
+ */
+#define ACPI_DB_READ_METHOD "\\_T98"
+#define ACPI_DB_WRITE_METHOD "\\_T99"
+
+static ACPI_HANDLE ReadHandle = NULL;
+static ACPI_HANDLE WriteHandle = NULL;
+
+/* ASL Definitions of the debugger read/write control methods */
+
+#if 0
+DefinitionBlock ("ssdt.aml", "SSDT", 2, "Intel", "DEBUG", 0x00000001)
+{
+ Method (_T98, 1, NotSerialized) /* Read */
+ {
+ Return (DeRefOf (Arg0))
+ }
+}
+DefinitionBlock ("ssdt2.aml", "SSDT", 2, "Intel", "DEBUG", 0x00000001)
+{
+ Method (_T99, 2, NotSerialized) /* Write */
+ {
+ Store (Arg1, Arg0)
+ }
+}
+#endif
+
+static unsigned char ReadMethodCode[] =
+{
+ 0x53,0x53,0x44,0x54,0x2E,0x00,0x00,0x00, /* 00000000 "SSDT...." */
+ 0x02,0xC9,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 "..Intel." */
+ 0x44,0x45,0x42,0x55,0x47,0x00,0x00,0x00, /* 00000010 "DEBUG..." */
+ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x18,0x12,0x13,0x20,0x14,0x09,0x5F,0x54, /* 00000020 "... .._T" */
+ 0x39,0x38,0x01,0xA4,0x83,0x68 /* 00000028 "98...h" */
+};
+
+static unsigned char WriteMethodCode[] =
+{
+ 0x53,0x53,0x44,0x54,0x2E,0x00,0x00,0x00, /* 00000000 "SSDT...." */
+ 0x02,0x15,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 "..Intel." */
+ 0x44,0x45,0x42,0x55,0x47,0x00,0x00,0x00, /* 00000010 "DEBUG..." */
+ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x18,0x12,0x13,0x20,0x14,0x09,0x5F,0x54, /* 00000020 "... .._T" */
+ 0x39,0x39,0x02,0x70,0x69,0x68 /* 00000028 "99.pih" */
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbExecuteTest
+ *
+ * PARAMETERS: TypeArg - Subcommand
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Execute various debug tests.
+ *
+ * Note: Code is prepared for future expansion of the TEST command.
+ *
+ ******************************************************************************/
+
+void
+AcpiDbExecuteTest (
+ char *TypeArg)
+{
+ UINT32 Temp;
+
+
+ AcpiUtStrupr (TypeArg);
+ Temp = AcpiDbMatchArgument (TypeArg, AcpiDbTestTypes);
+ if (Temp == ACPI_TYPE_NOT_FOUND)
+ {
+ AcpiOsPrintf ("Invalid or unsupported argument\n");
+ return;
+ }
+
+ switch (Temp)
+ {
+ case CMD_TEST_OBJECTS:
+
+ AcpiDbTestAllObjects ();
+ break;
+
+ case CMD_TEST_PREDEFINED:
+
+ AcpiDbEvaluateAllPredefinedNames (NULL);
+ break;
+
+ default:
+ break;
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbTestAllObjects
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: This test implements the OBJECTS subcommand. It exercises the
+ * namespace by reading/writing/comparing all data objects such
+ * as integers, strings, buffers, fields, buffer fields, etc.
+ *
+ ******************************************************************************/
+
+static void
+AcpiDbTestAllObjects (
+ void)
+{
+ ACPI_STATUS Status;
+
+
+ /* Install the debugger read-object control method if necessary */
+
+ if (!ReadHandle)
+ {
+ Status = AcpiInstallMethod (ReadMethodCode);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("%s, Could not install debugger read method\n",
+ AcpiFormatException (Status));
+ return;
+ }
+
+ Status = AcpiGetHandle (NULL, ACPI_DB_READ_METHOD, &ReadHandle);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not obtain handle for debug method %s\n",
+ ACPI_DB_READ_METHOD);
+ return;
+ }
+ }
+
+ /* Install the debugger write-object control method if necessary */
+
+ if (!WriteHandle)
+ {
+ Status = AcpiInstallMethod (WriteMethodCode);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("%s, Could not install debugger write method\n",
+ AcpiFormatException (Status));
+ return;
+ }
+
+ Status = AcpiGetHandle (NULL, ACPI_DB_WRITE_METHOD, &WriteHandle);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not obtain handle for debug method %s\n",
+ ACPI_DB_WRITE_METHOD);
+ return;
+ }
+ }
+
+ /* Walk the entire namespace, testing each supported named data object */
+
+ (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
+ ACPI_UINT32_MAX, AcpiDbTestOneObject, NULL, NULL, NULL);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbTestOneObject
+ *
+ * PARAMETERS: ACPI_WALK_CALLBACK
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Test one namespace object. Supported types are Integer,
+ * String, Buffer, BufferField, and FieldUnit. All other object
+ * types are simply ignored.
+ *
+ * Note: Support for Packages is not implemented.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbTestOneObject (
+ ACPI_HANDLE ObjHandle,
+ UINT32 NestingLevel,
+ void *Context,
+ void **ReturnValue)
+{
+ ACPI_NAMESPACE_NODE *Node;
+ ACPI_OPERAND_OBJECT *ObjDesc;
+ ACPI_OPERAND_OBJECT *RegionObj;
+ ACPI_OBJECT_TYPE LocalType;
+ UINT32 BitLength = 0;
+ UINT32 ByteLength = 0;
+ ACPI_STATUS Status = AE_OK;
+
+
+ Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
+ ObjDesc = Node->Object;
+
+ /*
+ * For the supported types, get the actual bit length or
+ * byte length. Map the type to one of Integer/String/Buffer.
+ */
+ switch (Node->Type)
+ {
+ case ACPI_TYPE_INTEGER:
+
+ /* Integer width is either 32 or 64 */
+
+ LocalType = ACPI_TYPE_INTEGER;
+ BitLength = AcpiGbl_IntegerBitWidth;
+ break;
+
+ case ACPI_TYPE_STRING:
+
+ LocalType = ACPI_TYPE_STRING;
+ ByteLength = ObjDesc->String.Length;
+ break;
+
+ case ACPI_TYPE_BUFFER:
+
+ LocalType = ACPI_TYPE_BUFFER;
+ ByteLength = ObjDesc->Buffer.Length;
+ BitLength = ByteLength * 8;
+ break;
+
+ case ACPI_TYPE_FIELD_UNIT:
+ case ACPI_TYPE_BUFFER_FIELD:
+ case ACPI_TYPE_LOCAL_REGION_FIELD:
+ case ACPI_TYPE_LOCAL_INDEX_FIELD:
+ case ACPI_TYPE_LOCAL_BANK_FIELD:
+
+ LocalType = ACPI_TYPE_INTEGER;
+ if (ObjDesc)
+ {
+ /*
+ * Returned object will be a Buffer if the field length
+ * is larger than the size of an Integer (32 or 64 bits
+ * depending on the DSDT version).
+ */
+ BitLength = ObjDesc->CommonField.BitLength;
+ ByteLength = ACPI_ROUND_BITS_UP_TO_BYTES (BitLength);
+ if (BitLength > AcpiGbl_IntegerBitWidth)
+ {
+ LocalType = ACPI_TYPE_BUFFER;
+ }
+ }
+ break;
+
+ default:
+
+ /* Ignore all other types */
+
+ return (AE_OK);
+ }
+
+ /* Emit the common prefix: Type:Name */
+
+ AcpiOsPrintf ("%14s: %4.4s",
+ AcpiUtGetTypeName (Node->Type), Node->Name.Ascii);
+ if (!ObjDesc)
+ {
+ AcpiOsPrintf (" Ignoring, no attached object\n");
+ return (AE_OK);
+ }
+
+ /*
+ * Check for unsupported region types. Note: AcpiExec simulates
+ * access to SystemMemory, SystemIO, PCI_Config, and EC.
+ */
+ switch (Node->Type)
+ {
+ case ACPI_TYPE_LOCAL_REGION_FIELD:
+
+ RegionObj = ObjDesc->Field.RegionObj;
+ switch (RegionObj->Region.SpaceId)
+ {
+ case ACPI_ADR_SPACE_SYSTEM_MEMORY:
+ case ACPI_ADR_SPACE_SYSTEM_IO:
+ case ACPI_ADR_SPACE_PCI_CONFIG:
+ case ACPI_ADR_SPACE_EC:
+
+ break;
+
+ default:
+
+ AcpiOsPrintf (" %s space is not supported [%4.4s]\n",
+ AcpiUtGetRegionName (RegionObj->Region.SpaceId),
+ RegionObj->Region.Node->Name.Ascii);
+ return (AE_OK);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ /* At this point, we have resolved the object to one of the major types */
+
+ switch (LocalType)
+ {
+ case ACPI_TYPE_INTEGER:
+
+ Status = AcpiDbTestIntegerType (Node, BitLength);
+ break;
+
+ case ACPI_TYPE_STRING:
+
+ Status = AcpiDbTestStringType (Node, ByteLength);
+ break;
+
+ case ACPI_TYPE_BUFFER:
+
+ Status = AcpiDbTestBufferType (Node, BitLength);
+ break;
+
+ default:
+
+ AcpiOsPrintf (" Ignoring, type not implemented (%2.2X)",
+ LocalType);
+ break;
+ }
+
+ switch (Node->Type)
+ {
+ case ACPI_TYPE_LOCAL_REGION_FIELD:
+
+ RegionObj = ObjDesc->Field.RegionObj;
+ AcpiOsPrintf (" (%s)",
+ AcpiUtGetRegionName (RegionObj->Region.SpaceId));
+ break;
+
+ default:
+ break;
+ }
+
+ AcpiOsPrintf ("\n");
+ return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbTestIntegerType
+ *
+ * PARAMETERS: Node - Parent NS node for the object
+ * BitLength - Actual length of the object. Used for
+ * support of arbitrary length FieldUnit
+ * and BufferField objects.
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Test read/write for an Integer-valued object. Performs a
+ * write/read/compare of an arbitrary new value, then performs
+ * a write/read/compare of the original value.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbTestIntegerType (
+ ACPI_NAMESPACE_NODE *Node,
+ UINT32 BitLength)
+{
+ ACPI_OBJECT *Temp1 = NULL;
+ ACPI_OBJECT *Temp2 = NULL;
+ ACPI_OBJECT *Temp3 = NULL;
+ ACPI_OBJECT WriteValue;
+ UINT64 ValueToWrite;
+ ACPI_STATUS Status;
+
+
+ if (BitLength > 64)
+ {
+ AcpiOsPrintf (" Invalid length for an Integer: %u", BitLength);
+ return (AE_OK);
+ }
+
+ /* Read the original value */
+
+ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_INTEGER, &Temp1);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ AcpiOsPrintf (" (%4.4X/%3.3X) %8.8X%8.8X",
+ BitLength, ACPI_ROUND_BITS_UP_TO_BYTES (BitLength),
+ ACPI_FORMAT_UINT64 (Temp1->Integer.Value));
+
+ ValueToWrite = ACPI_UINT64_MAX >> (64 - BitLength);
+ if (Temp1->Integer.Value == ValueToWrite)
+ {
+ ValueToWrite = 0;
+ }
+
+ /* Write a new value */
+
+ WriteValue.Type = ACPI_TYPE_INTEGER;
+ WriteValue.Integer.Value = ValueToWrite;
+ Status = AcpiDbWriteToObject (Node, &WriteValue);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ /* Ensure that we can read back the new value */
+
+ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_INTEGER, &Temp2);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ if (Temp2->Integer.Value != ValueToWrite)
+ {
+ AcpiOsPrintf (" MISMATCH 2: %8.8X%8.8X, expecting %8.8X%8.8X",
+ ACPI_FORMAT_UINT64 (Temp2->Integer.Value),
+ ACPI_FORMAT_UINT64 (ValueToWrite));
+ }
+
+ /* Write back the original value */
+
+ WriteValue.Integer.Value = Temp1->Integer.Value;
+ Status = AcpiDbWriteToObject (Node, &WriteValue);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ /* Ensure that we can read back the original value */
+
+ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_INTEGER, &Temp3);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ if (Temp3->Integer.Value != Temp1->Integer.Value)
+ {
+ AcpiOsPrintf (" MISMATCH 3: %8.8X%8.8X, expecting %8.8X%8.8X",
+ ACPI_FORMAT_UINT64 (Temp3->Integer.Value),
+ ACPI_FORMAT_UINT64 (Temp1->Integer.Value));
+ }
+
+Exit:
+ if (Temp1) {AcpiOsFree (Temp1);}
+ if (Temp2) {AcpiOsFree (Temp2);}
+ if (Temp3) {AcpiOsFree (Temp3);}
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbTestBufferType
+ *
+ * PARAMETERS: Node - Parent NS node for the object
+ * BitLength - Actual length of the object.
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Test read/write for an Buffer-valued object. Performs a
+ * write/read/compare of an arbitrary new value, then performs
+ * a write/read/compare of the original value.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbTestBufferType (
+ ACPI_NAMESPACE_NODE *Node,
+ UINT32 BitLength)
+{
+ ACPI_OBJECT *Temp1 = NULL;
+ ACPI_OBJECT *Temp2 = NULL;
+ ACPI_OBJECT *Temp3 = NULL;
+ UINT8 *Buffer;
+ ACPI_OBJECT WriteValue;
+ ACPI_STATUS Status;
+ UINT32 ByteLength;
+ UINT32 i;
+ UINT8 ExtraBits;
+
+
+ ByteLength = ACPI_ROUND_BITS_UP_TO_BYTES (BitLength);
+ if (ByteLength == 0)
+ {
+ AcpiOsPrintf (" Ignoring zero length buffer");
+ return (AE_OK);
+ }
+
+ /* Allocate a local buffer */
+
+ Buffer = ACPI_ALLOCATE_ZEROED (ByteLength);
+ if (!Buffer)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ /* Read the original value */
+
+ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_BUFFER, &Temp1);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ /* Emit a few bytes of the buffer */
+
+ AcpiOsPrintf (" (%4.4X/%3.3X)", BitLength, Temp1->Buffer.Length);
+ for (i = 0; ((i < 4) && (i < ByteLength)); i++)
+ {
+ AcpiOsPrintf (" %2.2X", Temp1->Buffer.Pointer[i]);
+ }
+ AcpiOsPrintf ("... ");
+
+ /*
+ * Write a new value.
+ *
+ * Handle possible extra bits at the end of the buffer. Can
+ * happen for FieldUnits larger than an integer, but the bit
+ * count is not an integral number of bytes. Zero out the
+ * unused bits.
+ */
+ ACPI_MEMSET (Buffer, BUFFER_FILL_VALUE, ByteLength);
+ ExtraBits = BitLength % 8;
+ if (ExtraBits)
+ {
+ Buffer [ByteLength - 1] = ACPI_MASK_BITS_ABOVE (ExtraBits);
+ }
+
+ WriteValue.Type = ACPI_TYPE_BUFFER;
+ WriteValue.Buffer.Length = ByteLength;
+ WriteValue.Buffer.Pointer = Buffer;
+
+ Status = AcpiDbWriteToObject (Node, &WriteValue);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ /* Ensure that we can read back the new value */
+
+ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_BUFFER, &Temp2);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ if (ACPI_MEMCMP (Temp2->Buffer.Pointer, Buffer, ByteLength))
+ {
+ AcpiOsPrintf (" MISMATCH 2: New buffer value");
+ }
+
+ /* Write back the original value */
+
+ WriteValue.Buffer.Length = ByteLength;
+ WriteValue.Buffer.Pointer = Temp1->Buffer.Pointer;
+
+ Status = AcpiDbWriteToObject (Node, &WriteValue);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ /* Ensure that we can read back the original value */
+
+ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_BUFFER, &Temp3);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ if (ACPI_MEMCMP (Temp1->Buffer.Pointer, Temp3->Buffer.Pointer, ByteLength))
+ {
+ AcpiOsPrintf (" MISMATCH 3: While restoring original buffer");
+ }
+
+Exit:
+ ACPI_FREE (Buffer);
+ if (Temp1) {AcpiOsFree (Temp1);}
+ if (Temp2) {AcpiOsFree (Temp2);}
+ if (Temp3) {AcpiOsFree (Temp3);}
+ return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbTestStringType
+ *
+ * PARAMETERS: Node - Parent NS node for the object
+ * ByteLength - Actual length of the object.
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Test read/write for an String-valued object. Performs a
+ * write/read/compare of an arbitrary new value, then performs
+ * a write/read/compare of the original value.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbTestStringType (
+ ACPI_NAMESPACE_NODE *Node,
+ UINT32 ByteLength)
+{
+ ACPI_OBJECT *Temp1 = NULL;
+ ACPI_OBJECT *Temp2 = NULL;
+ ACPI_OBJECT *Temp3 = NULL;
+ char *ValueToWrite = "Test String from AML Debugger";
+ ACPI_OBJECT WriteValue;
+ ACPI_STATUS Status;
+
+
+ /* Read the original value */
+
+ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_STRING, &Temp1);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ AcpiOsPrintf (" (%4.4X/%3.3X) \"%s\"", (Temp1->String.Length * 8),
+ Temp1->String.Length, Temp1->String.Pointer);
+
+ /* Write a new value */
+
+ WriteValue.Type = ACPI_TYPE_STRING;
+ WriteValue.String.Length = ACPI_STRLEN (ValueToWrite);
+ WriteValue.String.Pointer = ValueToWrite;
+
+ Status = AcpiDbWriteToObject (Node, &WriteValue);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ /* Ensure that we can read back the new value */
+
+ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_STRING, &Temp2);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ if (ACPI_STRCMP (Temp2->String.Pointer, ValueToWrite))
+ {
+ AcpiOsPrintf (" MISMATCH 2: %s, expecting %s",
+ Temp2->String.Pointer, ValueToWrite);
+ }
+
+ /* Write back the original value */
+
+ WriteValue.String.Length = ACPI_STRLEN (Temp1->String.Pointer);
+ WriteValue.String.Pointer = Temp1->String.Pointer;
+
+ Status = AcpiDbWriteToObject (Node, &WriteValue);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ /* Ensure that we can read back the original value */
+
+ Status = AcpiDbReadFromObject (Node, ACPI_TYPE_STRING, &Temp3);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Exit;
+ }
+
+ if (ACPI_STRCMP (Temp1->String.Pointer, Temp3->String.Pointer))
+ {
+ AcpiOsPrintf (" MISMATCH 3: %s, expecting %s",
+ Temp3->String.Pointer, Temp1->String.Pointer);
+ }
+
+Exit:
+ if (Temp1) {AcpiOsFree (Temp1);}
+ if (Temp2) {AcpiOsFree (Temp2);}
+ if (Temp3) {AcpiOsFree (Temp3);}
+ return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbReadFromObject
+ *
+ * PARAMETERS: Node - Parent NS node for the object
+ * ExpectedType - Object type expected from the read
+ * Value - Where the value read is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Performs a read from the specified object by invoking the
+ * special debugger control method that reads the object. Thus,
+ * the AML interpreter is doing all of the work, increasing the
+ * validity of the test.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbReadFromObject (
+ ACPI_NAMESPACE_NODE *Node,
+ ACPI_OBJECT_TYPE ExpectedType,
+ ACPI_OBJECT **Value)
+{
+ ACPI_OBJECT *RetValue;
+ ACPI_OBJECT_LIST ParamObjects;
+ ACPI_OBJECT Params[2];
+ ACPI_BUFFER ReturnObj;
+ ACPI_STATUS Status;
+
+
+ Params[0].Type = ACPI_TYPE_LOCAL_REFERENCE;
+ Params[0].Reference.ActualType = Node->Type;
+ Params[0].Reference.Handle = ACPI_CAST_PTR (ACPI_HANDLE, Node);
+
+ ParamObjects.Count = 1;
+ ParamObjects.Pointer = Params;
+
+ ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
+
+ AcpiGbl_MethodExecuting = TRUE;
+ Status = AcpiEvaluateObject (ReadHandle, NULL, &ParamObjects, &ReturnObj);
+ AcpiGbl_MethodExecuting = FALSE;
+
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not read from object, %s",
+ AcpiFormatException (Status));
+ return (Status);
+ }
+
+ RetValue = (ACPI_OBJECT *) ReturnObj.Pointer;
+
+ switch (RetValue->Type)
+ {
+ case ACPI_TYPE_INTEGER:
+ case ACPI_TYPE_BUFFER:
+ case ACPI_TYPE_STRING:
+ /*
+ * Did we receive the type we wanted? Most important for the
+ * Integer/Buffer case (when a field is larger than an Integer,
+ * it should return a Buffer).
+ */
+ if (RetValue->Type != ExpectedType)
+ {
+ AcpiOsPrintf (" Type mismatch: Expected %s, Received %s",
+ AcpiUtGetTypeName (ExpectedType),
+ AcpiUtGetTypeName (RetValue->Type));
+
+ return (AE_TYPE);
+ }
+
+ *Value = RetValue;
+ break;
+
+ default:
+
+ AcpiOsPrintf (" Unsupported return object type, %s",
+ AcpiUtGetTypeName (RetValue->Type));
+ AcpiOsFree (ReturnObj.Pointer);
+
+ return (AE_TYPE);
+ }
+
+ return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbWriteToObject
+ *
+ * PARAMETERS: Node - Parent NS node for the object
+ * Value - Value to be written
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Performs a write to the specified object by invoking the
+ * special debugger control method that writes the object. Thus,
+ * the AML interpreter is doing all of the work, increasing the
+ * validity of the test.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbWriteToObject (
+ ACPI_NAMESPACE_NODE *Node,
+ ACPI_OBJECT *Value)
+{
+ ACPI_OBJECT_LIST ParamObjects;
+ ACPI_OBJECT Params[2];
+ ACPI_STATUS Status;
+
+
+ Params[0].Type = ACPI_TYPE_LOCAL_REFERENCE;
+ Params[0].Reference.ActualType = Node->Type;
+ Params[0].Reference.Handle = ACPI_CAST_PTR (ACPI_HANDLE, Node);
+
+ /* Copy the incoming user parameter */
+
+ ACPI_MEMCPY (&Params[1], Value, sizeof (ACPI_OBJECT));
+
+ ParamObjects.Count = 2;
+ ParamObjects.Pointer = Params;
+
+ AcpiGbl_MethodExecuting = TRUE;
+ Status = AcpiEvaluateObject (WriteHandle, NULL, &ParamObjects, NULL);
+ AcpiGbl_MethodExecuting = FALSE;
+
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not write to object, %s",
+ AcpiFormatException (Status));
+ }
+
+ return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbEvaluateAllPredefinedNames
+ *
+ * PARAMETERS: CountArg - Max number of methods to execute
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Namespace batch execution. Execute predefined names in the
+ * namespace, up to the max count, if specified.
+ *
+ ******************************************************************************/
+
+static void
+AcpiDbEvaluateAllPredefinedNames (
+ char *CountArg)
+{
+ ACPI_DB_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,
+ AcpiDbEvaluateOnePredefinedName, NULL, (void *) &Info, NULL);
+
+ AcpiOsPrintf ("Evaluated %u predefined names in the namespace\n", Info.Count);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbEvaluateOnePredefinedName
+ *
+ * PARAMETERS: Callback from WalkNamespace
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Batch execution module. Currently only executes predefined
+ * ACPI names.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbEvaluateOnePredefinedName (
+ ACPI_HANDLE ObjHandle,
+ UINT32 NestingLevel,
+ void *Context,
+ void **ReturnValue)
+{
+ ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
+ ACPI_DB_EXECUTE_WALK *Info = (ACPI_DB_EXECUTE_WALK *) Context;
+ char *Pathname;
+ const ACPI_PREDEFINED_INFO *Predefined;
+ ACPI_DEVICE_INFO *ObjInfo;
+ ACPI_OBJECT_LIST ParamObjects;
+ ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS];
+ ACPI_OBJECT *ThisParam;
+ ACPI_BUFFER ReturnObj;
+ ACPI_STATUS Status;
+ UINT16 ArgTypeList;
+ UINT8 ArgCount;
+ UINT8 ArgType;
+ UINT32 i;
+
+
+ /* The name must be a predefined ACPI name */
+
+ Predefined = AcpiUtMatchPredefinedMethod (Node->Name.Ascii);
+ if (!Predefined)
+ {
+ return (AE_OK);
+ }
+
+ if (Node->Type == ACPI_TYPE_LOCAL_SCOPE)
+ {
+ return (AE_OK);
+ }
+
+ Pathname = AcpiNsGetExternalPathname (Node);
+ if (!Pathname)
+ {
+ return (AE_OK);
+ }
+
+ /* Get the object info for number of method parameters */
+
+ Status = AcpiGetObjectInfo (ObjHandle, &ObjInfo);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_FREE (Pathname);
+ return (Status);
+ }
+
+ ParamObjects.Count = 0;
+ ParamObjects.Pointer = NULL;
+
+ if (ObjInfo->Type == ACPI_TYPE_METHOD)
+ {
+ /* Setup default parameters (with proper types) */
+
+ ArgTypeList = Predefined->Info.ArgumentList;
+ ArgCount = METHOD_GET_ARG_COUNT (ArgTypeList);
+
+ /*
+ * Setup the ACPI-required number of arguments, regardless of what
+ * the actual method defines. If there is a difference, then the
+ * method is wrong and a warning will be issued during execution.
+ */
+ ThisParam = Params;
+ for (i = 0; i < ArgCount; i++)
+ {
+ ArgType = METHOD_GET_NEXT_TYPE (ArgTypeList);
+ ThisParam->Type = ArgType;
+
+ switch (ArgType)
+ {
+ case ACPI_TYPE_INTEGER:
+
+ ThisParam->Integer.Value = 1;
+ break;
+
+ case ACPI_TYPE_STRING:
+
+ ThisParam->String.Pointer = "This is the default argument string";
+ ThisParam->String.Length = ACPI_STRLEN (ThisParam->String.Pointer);
+ break;
+
+ case ACPI_TYPE_BUFFER:
+
+ ThisParam->Buffer.Pointer = (UINT8 *) Params; /* just a garbage buffer */
+ ThisParam->Buffer.Length = 48;
+ break;
+
+ case ACPI_TYPE_PACKAGE:
+
+ ThisParam->Package.Elements = NULL;
+ ThisParam->Package.Count = 0;
+ break;
+
+ default:
+
+ AcpiOsPrintf ("%s: Unsupported argument type: %u\n",
+ Pathname, ArgType);
+ break;
+ }
+
+ ThisParam++;
+ }
+
+ ParamObjects.Count = ArgCount;
+ ParamObjects.Pointer = Params;
+ }
+
+ ACPI_FREE (ObjInfo);
+ ReturnObj.Pointer = NULL;
+ ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
+
+ /* Do the actual method execution */
+
+ AcpiGbl_MethodExecuting = TRUE;
+
+ Status = AcpiEvaluateObject (Node, NULL, &ParamObjects, &ReturnObj);
+
+ AcpiOsPrintf ("%-32s returned %s\n", Pathname, AcpiFormatException (Status));
+ AcpiGbl_MethodExecuting = FALSE;
+ ACPI_FREE (Pathname);
+
+ /* 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);
+}
+
+#endif /* ACPI_DEBUGGER */
diff --git a/sys/contrib/dev/acpica/components/debugger/dbutils.c b/sys/contrib/dev/acpica/components/debugger/dbutils.c
index 43036fd..5db98e1 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbutils.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbutils.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
diff --git a/sys/contrib/dev/acpica/components/debugger/dbxface.c b/sys/contrib/dev/acpica/components/debugger/dbxface.c
index c154c45..8d2e0a8 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbxface.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbxface.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/amlcode.h>
@@ -513,6 +512,10 @@ AcpiDbTerminate (
AcpiOsFree (AcpiGbl_DbBuffer);
AcpiGbl_DbBuffer = NULL;
}
+
+ /* Ensure that debug output is now disabled */
+
+ AcpiGbl_DbOutputFlags = ACPI_DB_DISABLE_OUTPUT;
}
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c b/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
index 32a7ddf..15b7e87 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,12 +41,13 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acutils.h>
#include <contrib/dev/acpica/include/acdisasm.h>
#include <contrib/dev/acpica/include/acparser.h>
#include <contrib/dev/acpica/include/amlcode.h>
+#include <contrib/dev/acpica/include/acinterp.h>
#ifdef ACPI_DISASSEMBLER
@@ -57,11 +58,15 @@
/* Local prototypes */
static void
+AcpiDmUuid (
+ ACPI_PARSE_OBJECT *Op);
+
+static void
AcpiDmUnicode (
ACPI_PARSE_OBJECT *Op);
static void
-AcpiDmIsEisaIdElement (
+AcpiDmGetHardwareIdType (
ACPI_PARSE_OBJECT *Op);
static void
@@ -71,6 +76,54 @@ AcpiDmPldBuffer (
UINT32 ByteCount);
+#define ACPI_BUFFER_BYTES_PER_LINE 8
+
+
+/* Strings for ToPld */
+
+static char *DmPanelList[] =
+{
+ "TOP",
+ "BOTTOM",
+ "LEFT",
+ "RIGHT",
+ "FRONT",
+ "BACK",
+ "UNKNOWN",
+ NULL
+};
+
+static char *DmVerticalPositionList[] =
+{
+ "UPPER",
+ "CENTER",
+ "LOWER",
+ NULL
+};
+
+static char *DmHorizontalPositionList[] =
+{
+ "LEFT",
+ "CENTER",
+ "RIGHT",
+ NULL
+};
+
+static char *DmShapeList[] =
+{
+ "ROUND",
+ "OVAL",
+ "SQUARE",
+ "VERTICALRECTANGLE",
+ "HORIZONTALRECTANGLE",
+ "VERTICALTRAPEZOID",
+ "HORIZONTALTRAPEZOID",
+ "UNKNOWN",
+ "CHAMFERED",
+ NULL
+};
+
+
/*******************************************************************************
*
* FUNCTION: AcpiDmDisasmByteList
@@ -93,6 +146,9 @@ AcpiDmDisasmByteList (
UINT32 ByteCount)
{
UINT32 i;
+ UINT32 j;
+ UINT32 CurrentIndex;
+ UINT8 BufChar;
if (!ByteCount)
@@ -100,39 +156,68 @@ AcpiDmDisasmByteList (
return;
}
- /* Dump the byte list */
-
- for (i = 0; i < ByteCount; i++)
+ for (i = 0; i < ByteCount; i += ACPI_BUFFER_BYTES_PER_LINE)
{
- /* New line every 8 bytes */
+ /* Line indent and offset prefix for each new line */
+
+ AcpiDmIndent (Level);
+ if (ByteCount > ACPI_BUFFER_BYTES_PER_LINE)
+ {
+ AcpiOsPrintf ("/* %04X */ ", i);
+ }
- if (((i % 8) == 0) && (i < ByteCount))
+ /* Dump the actual hex values */
+
+ for (j = 0; j < ACPI_BUFFER_BYTES_PER_LINE; j++)
{
- if (i > 0)
+ CurrentIndex = i + j;
+ if (CurrentIndex >= ByteCount)
{
- AcpiOsPrintf ("\n");
+ /* Dump fill spaces */
+
+ AcpiOsPrintf (" ");
+ continue;
}
- AcpiDmIndent (Level);
- if (ByteCount > 8)
+ AcpiOsPrintf (" 0x%2.2X", ByteData[CurrentIndex]);
+
+ /* Add comma if there are more bytes to display */
+
+ if (CurrentIndex < (ByteCount - 1))
+ {
+ AcpiOsPrintf (",");
+ }
+ else
{
- AcpiOsPrintf ("/* %04X */ ", i);
+ AcpiOsPrintf (" ");
}
}
- AcpiOsPrintf (" 0x%2.2X", (UINT32) ByteData[i]);
+ /* Dump the ASCII equivalents within a comment */
- /* Add comma if there are more bytes to display */
-
- if (i < (ByteCount -1))
+ AcpiOsPrintf (" /* ");
+ for (j = 0; j < ACPI_BUFFER_BYTES_PER_LINE; j++)
{
- AcpiOsPrintf (",");
+ CurrentIndex = i + j;
+ if (CurrentIndex >= ByteCount)
+ {
+ break;
+ }
+
+ BufChar = ByteData[CurrentIndex];
+ if (ACPI_IS_PRINT (BufChar))
+ {
+ AcpiOsPrintf ("%c", BufChar);
+ }
+ else
+ {
+ AcpiOsPrintf (".");
+ }
}
- }
- if (Level)
- {
- AcpiOsPrintf ("\n");
+ /* Finished with this line */
+
+ AcpiOsPrintf (" */\n");
}
}
@@ -181,14 +266,20 @@ AcpiDmByteList (
AcpiOsPrintf ("\n");
break;
+ case ACPI_DASM_UUID:
+
+ AcpiDmUuid (Op);
+ break;
+
case ACPI_DASM_UNICODE:
AcpiDmUnicode (Op);
break;
case ACPI_DASM_PLD_METHOD:
-
+#if 0
AcpiDmDisasmByteList (Info->Level, ByteData, ByteCount);
+#endif
AcpiDmPldBuffer (Info->Level, ByteData, ByteCount);
break;
@@ -206,6 +297,137 @@ AcpiDmByteList (
/*******************************************************************************
*
+ * FUNCTION: AcpiDmIsUuidBuffer
+ *
+ * PARAMETERS: Op - Buffer Object to be examined
+ *
+ * RETURN: TRUE if buffer contains a UUID
+ *
+ * DESCRIPTION: Determine if a buffer Op contains a UUID
+ *
+ * To help determine whether the buffer is a UUID versus a raw data buffer,
+ * there a are a couple bytes we can look at:
+ *
+ * xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
+ *
+ * The variant covered by the UUID specification is indicated by the two most
+ * significant bits of N being 1 0 (i.e., the hexadecimal N will always be
+ * 8, 9, A, or B).
+ *
+ * The variant covered by the UUID specification has five versions. For this
+ * variant, the four bits of M indicates the UUID version (i.e., the
+ * hexadecimal M will be either 1, 2, 3, 4, or 5).
+ *
+ ******************************************************************************/
+
+BOOLEAN
+AcpiDmIsUuidBuffer (
+ ACPI_PARSE_OBJECT *Op)
+{
+ UINT8 *ByteData;
+ UINT32 ByteCount;
+ ACPI_PARSE_OBJECT *SizeOp;
+ ACPI_PARSE_OBJECT *NextOp;
+
+
+ /* Buffer size is the buffer argument */
+
+ SizeOp = Op->Common.Value.Arg;
+
+ /* Next, the initializer byte list to examine */
+
+ NextOp = SizeOp->Common.Next;
+ if (!NextOp)
+ {
+ return (FALSE);
+ }
+
+ /* Extract the byte list info */
+
+ ByteData = NextOp->Named.Data;
+ ByteCount = (UINT32) NextOp->Common.Value.Integer;
+
+ /* Byte count must be exactly 16 */
+
+ if (ByteCount != UUID_BUFFER_LENGTH)
+ {
+ return (FALSE);
+ }
+
+ /* Check for valid "M" and "N" values (see function header above) */
+
+ if (((ByteData[7] & 0xF0) == 0x00) || /* M={1,2,3,4,5} */
+ ((ByteData[7] & 0xF0) > 0x50) ||
+ ((ByteData[8] & 0xF0) < 0x80) || /* N={8,9,A,B} */
+ ((ByteData[8] & 0xF0) > 0xB0))
+ {
+ return (FALSE);
+ }
+
+ /* Ignore the Size argument in the disassembly of this buffer op */
+
+ SizeOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
+ return (TRUE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmUuid
+ *
+ * PARAMETERS: Op - Byte List op containing a UUID
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Dump a buffer containing a UUID as a standard ASCII string.
+ *
+ * Output Format:
+ * In its canonical form, the UUID is represented by a string containing 32
+ * lowercase hexadecimal digits, displayed in 5 groups separated by hyphens.
+ * The complete form is 8-4-4-4-12 for a total of 36 characters (32
+ * alphanumeric characters representing hex digits and 4 hyphens). In bytes,
+ * 4-2-2-2-6. Example:
+ *
+ * ToUUID ("107ededd-d381-4fd7-8da9-08e9a6c79644")
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmUuid (
+ ACPI_PARSE_OBJECT *Op)
+{
+ UINT8 *Data;
+ const char *Description;
+
+
+ Data = ACPI_CAST_PTR (UINT8, Op->Named.Data);
+
+ /* Emit the 36-byte UUID string in the proper format/order */
+
+ AcpiOsPrintf (
+ "\"%2.2x%2.2x%2.2x%2.2x-"
+ "%2.2x%2.2x-"
+ "%2.2x%2.2x-"
+ "%2.2x%2.2x-"
+ "%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x\")",
+ Data[3], Data[2], Data[1], Data[0],
+ Data[5], Data[4],
+ Data[7], Data[6],
+ Data[8], Data[9],
+ Data[10], Data[11], Data[12], Data[13], Data[14], Data[15]);
+
+ /* Dump the UUID description string if available */
+
+ Description = AcpiAhMatchUuid (Data);
+ if (Description)
+ {
+ AcpiOsPrintf (" /* %s */", Description);
+ }
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmIsUnicodeBuffer
*
* PARAMETERS: Op - Buffer Object to be examined
@@ -258,11 +480,12 @@ AcpiDmIsUnicodeBuffer (
return (FALSE);
}
- /* For each word, 1st byte must be ascii, 2nd byte must be zero */
+ /* For each word, 1st byte must be ascii (1-0x7F), 2nd byte must be zero */
for (i = 0; i < (ByteCount - 2); i += 2)
{
- if ((!ACPI_IS_PRINT (ByteData[i])) ||
+ if ((ByteData[i] == 0) ||
+ (ByteData[i] > 0x7F) ||
(ByteData[(ACPI_SIZE) i + 1] != 0))
{
return (FALSE);
@@ -358,9 +581,14 @@ AcpiDmIsPldBuffer (
ACPI_PARSE_OBJECT *Op)
{
ACPI_NAMESPACE_NODE *Node;
+ ACPI_PARSE_OBJECT *SizeOp;
ACPI_PARSE_OBJECT *ParentOp;
+ /* Buffer size is the buffer argument */
+
+ SizeOp = Op->Common.Value.Arg;
+
ParentOp = Op->Common.Parent;
if (!ParentOp)
{
@@ -375,6 +603,9 @@ AcpiDmIsPldBuffer (
if (ACPI_COMPARE_NAME (Node->Name.Ascii, METHOD_NAME__PLD))
{
+ /* Ignore the Size argument in the disassembly of this buffer op */
+
+ SizeOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
return (TRUE);
}
@@ -397,6 +628,9 @@ AcpiDmIsPldBuffer (
if (ACPI_COMPARE_NAME (Node->Name.Ascii, METHOD_NAME__PLD))
{
+ /* Ignore the Size argument in the disassembly of this buffer op */
+
+ SizeOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
return (TRUE);
}
}
@@ -408,6 +642,51 @@ AcpiDmIsPldBuffer (
/*******************************************************************************
*
+ * FUNCTION: AcpiDmFindNameByIndex
+ *
+ * PARAMETERS: Index - Index of array to check
+ * List - Array to reference
+ *
+ * RETURN: String from List or empty string
+ *
+ * DESCRIPTION: Finds and returns the char string located at the given index
+ * position in List.
+ *
+ ******************************************************************************/
+
+static char *
+AcpiDmFindNameByIndex (
+ UINT64 Index,
+ char **List)
+{
+ char *Str;
+ UINT32 i;
+
+
+ /* Bounds check */
+
+ Str = List[0];
+ i = 0;
+
+ while(Str)
+ {
+ i++;
+ Str = List[i];
+ }
+
+ if (Index >= i)
+ {
+ /* TBD: Add error msg */
+
+ return ("");
+ }
+
+ return (List[Index]);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmPldBuffer
*
* PARAMETERS: Level - Current source code indentation level
@@ -420,9 +699,12 @@ AcpiDmIsPldBuffer (
*
******************************************************************************/
-#define ACPI_PLD_OUTPUT08 "%*.s/* %18s : %-6.2X */\n", ACPI_MUL_4 (Level), " "
-#define ACPI_PLD_OUTPUT16 "%*.s/* %18s : %-6.4X */\n", ACPI_MUL_4 (Level), " "
-#define ACPI_PLD_OUTPUT24 "%*.s/* %18s : %-6.6X */\n", ACPI_MUL_4 (Level), " "
+#define ACPI_PLD_OUTPUT08 "%*.s%-18s = 0x%X,\n", ACPI_MUL_4 (Level), " "
+#define ACPI_PLD_OUTPUT08P "%*.s%-18s = 0x%X)\n", ACPI_MUL_4 (Level), " "
+#define ACPI_PLD_OUTPUT16 "%*.s%-18s = 0x%X,\n", ACPI_MUL_4 (Level), " "
+#define ACPI_PLD_OUTPUT16P "%*.s%-18s = 0x%X)\n", ACPI_MUL_4 (Level), " "
+#define ACPI_PLD_OUTPUT24 "%*.s%-18s = 0x%X,\n", ACPI_MUL_4 (Level), " "
+#define ACPI_PLD_OUTPUTSTR "%*.s%-18s = \"%s\",\n", ACPI_MUL_4 (Level), " "
static void
AcpiDmPldBuffer (
@@ -449,47 +731,63 @@ AcpiDmPldBuffer (
return;
}
+ AcpiOsPrintf ("\n");
+
/* First 32-bit dword */
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Revision", PldInfo->Revision);
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "IgnoreColor", PldInfo->IgnoreColor);
- AcpiOsPrintf (ACPI_PLD_OUTPUT24,"Color", PldInfo->Color);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Revision", PldInfo->Revision);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_IgnoreColor", PldInfo->IgnoreColor);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Red", PldInfo->Red);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Green", PldInfo->Green);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Blue", PldInfo->Blue);
/* Second 32-bit dword */
- AcpiOsPrintf (ACPI_PLD_OUTPUT16,"Width", PldInfo->Width);
- AcpiOsPrintf (ACPI_PLD_OUTPUT16,"Height", PldInfo->Height);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT16, "PLD_Width", PldInfo->Width);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT16, "PLD_Height", PldInfo->Height);
/* Third 32-bit dword */
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "UserVisible", PldInfo->UserVisible);
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Dock", PldInfo->Dock);
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Lid", PldInfo->Lid);
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Panel", PldInfo->Panel);
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "VerticalPosition", PldInfo->VerticalPosition);
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "HorizontalPosition", PldInfo->HorizontalPosition);
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Shape", PldInfo->Shape);
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "GroupOrientation", PldInfo->GroupOrientation);
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "GroupToken", PldInfo->GroupToken);
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "GroupPosition", PldInfo->GroupPosition);
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Bay", PldInfo->Bay);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_UserVisible", PldInfo->UserVisible);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Dock", PldInfo->Dock);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Lid", PldInfo->Lid);
+ AcpiOsPrintf (ACPI_PLD_OUTPUTSTR, "PLD_Panel",
+ AcpiDmFindNameByIndex(PldInfo->Panel, DmPanelList));
+ AcpiOsPrintf (ACPI_PLD_OUTPUTSTR, "PLD_VerticalPosition",
+ AcpiDmFindNameByIndex(PldInfo->VerticalPosition, DmVerticalPositionList));
+ AcpiOsPrintf (ACPI_PLD_OUTPUTSTR, "PLD_HorizontalPosition",
+ AcpiDmFindNameByIndex(PldInfo->HorizontalPosition, DmHorizontalPositionList));
+ AcpiOsPrintf (ACPI_PLD_OUTPUTSTR, "PLD_Shape",
+ AcpiDmFindNameByIndex(PldInfo->Shape, DmShapeList));
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_GroupOrientation", PldInfo->GroupOrientation);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_GroupToken", PldInfo->GroupToken);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_GroupPosition", PldInfo->GroupPosition);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Bay", PldInfo->Bay);
/* Fourth 32-bit dword */
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Ejectable", PldInfo->Ejectable);
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "OspmEjectRequired", PldInfo->OspmEjectRequired);
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "CabinetNumber", PldInfo->CabinetNumber);
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "CardCageNumber", PldInfo->CardCageNumber);
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Reference", PldInfo->Reference);
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Rotation", PldInfo->Rotation);
- AcpiOsPrintf (ACPI_PLD_OUTPUT08, "Order", PldInfo->Order);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Ejectable", PldInfo->Ejectable);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_EjectRequired", PldInfo->OspmEjectRequired);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_CabinetNumber", PldInfo->CabinetNumber);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_CardCageNumber", PldInfo->CardCageNumber);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Reference", PldInfo->Reference);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Rotation", PldInfo->Rotation);
+
+ if (ByteCount < ACPI_PLD_REV1_BUFFER_SIZE)
+ {
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08P, "PLD_Order", PldInfo->Order);
+ }
+ else
+ {
+ AcpiOsPrintf (ACPI_PLD_OUTPUT08, "PLD_Order", PldInfo->Order);
+ }
/* Fifth 32-bit dword */
if (ByteCount >= ACPI_PLD_REV1_BUFFER_SIZE)
{
- AcpiOsPrintf (ACPI_PLD_OUTPUT16,"VerticalOffset", PldInfo->VerticalOffset);
- AcpiOsPrintf (ACPI_PLD_OUTPUT16,"HorizontalOffset", PldInfo->HorizontalOffset);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT16, "PLD_VerticalOffset", PldInfo->VerticalOffset);
+ AcpiOsPrintf (ACPI_PLD_OUTPUT16P, "PLD_HorizontalOffset", PldInfo->HorizontalOffset);
}
ACPI_FREE (PldInfo);
@@ -516,6 +814,7 @@ AcpiDmUnicode (
UINT16 *WordData;
UINT32 WordCount;
UINT32 i;
+ int OutputValue;
/* Extract the buffer info as a WORD buffer */
@@ -528,7 +827,23 @@ AcpiDmUnicode (
AcpiOsPrintf ("\"");
for (i = 0; i < (WordCount - 1); i++)
{
- AcpiOsPrintf ("%c", (int) WordData[i]);
+ OutputValue = (int) WordData[i];
+
+ /* Handle values that must be escaped */
+
+ if ((OutputValue == '\"') ||
+ (OutputValue == '\\'))
+ {
+ AcpiOsPrintf ("\\%c", OutputValue);
+ }
+ else if (!ACPI_IS_PRINT (OutputValue))
+ {
+ AcpiOsPrintf ("\\x%2.2X", OutputValue);
+ }
+ else
+ {
+ AcpiOsPrintf ("%c", OutputValue);
+ }
}
AcpiOsPrintf ("\")");
@@ -537,19 +852,20 @@ AcpiDmUnicode (
/*******************************************************************************
*
- * FUNCTION: AcpiDmIsEisaIdElement
+ * FUNCTION: AcpiDmGetHardwareIdType
*
* PARAMETERS: Op - Op to be examined
*
* RETURN: None
*
- * DESCRIPTION: Determine if an Op (argument to _HID or _CID) can be converted
- * to an EISA ID.
+ * DESCRIPTION: Determine the type of the argument to a _HID or _CID
+ * 1) Strings are allowed
+ * 2) If Integer, determine if it is a valid EISAID
*
******************************************************************************/
static void
-AcpiDmIsEisaIdElement (
+AcpiDmGetHardwareIdType (
ACPI_PARSE_OBJECT *Op)
{
UINT32 BigEndianId;
@@ -557,55 +873,66 @@ AcpiDmIsEisaIdElement (
UINT32 i;
- /* The parameter must be either a word or a dword */
-
- if ((Op->Common.AmlOpcode != AML_DWORD_OP) &&
- (Op->Common.AmlOpcode != AML_WORD_OP))
+ switch (Op->Common.AmlOpcode)
{
- return;
- }
+ case AML_STRING_OP:
- /* Swap from little-endian to big-endian to simplify conversion */
+ /* Mark this string as an _HID/_CID string */
- BigEndianId = AcpiUtDwordByteSwap ((UINT32) Op->Common.Value.Integer);
+ Op->Common.DisasmOpcode = ACPI_DASM_HID_STRING;
+ break;
- /* Create the 3 leading ASCII letters */
+ case AML_WORD_OP:
+ case AML_DWORD_OP:
- Prefix[0] = ((BigEndianId >> 26) & 0x1F) + 0x40;
- Prefix[1] = ((BigEndianId >> 21) & 0x1F) + 0x40;
- Prefix[2] = ((BigEndianId >> 16) & 0x1F) + 0x40;
+ /* Determine if a Word/Dword is a valid encoded EISAID */
- /* Verify that all 3 are ascii and alpha */
+ /* Swap from little-endian to big-endian to simplify conversion */
- for (i = 0; i < 3; i++)
- {
- if (!ACPI_IS_ASCII (Prefix[i]) ||
- !ACPI_IS_ALPHA (Prefix[i]))
+ BigEndianId = AcpiUtDwordByteSwap ((UINT32) Op->Common.Value.Integer);
+
+ /* Create the 3 leading ASCII letters */
+
+ Prefix[0] = ((BigEndianId >> 26) & 0x1F) + 0x40;
+ Prefix[1] = ((BigEndianId >> 21) & 0x1F) + 0x40;
+ Prefix[2] = ((BigEndianId >> 16) & 0x1F) + 0x40;
+
+ /* Verify that all 3 are ascii and alpha */
+
+ for (i = 0; i < 3; i++)
{
- return;
+ if (!ACPI_IS_ASCII (Prefix[i]) ||
+ !ACPI_IS_ALPHA (Prefix[i]))
+ {
+ return;
+ }
}
- }
- /* OK - mark this node as convertable to an EISA ID */
+ /* Mark this node as convertable to an EISA ID string */
+
+ Op->Common.DisasmOpcode = ACPI_DASM_EISAID;
+ break;
- Op->Common.DisasmOpcode = ACPI_DASM_EISAID;
+ default:
+ break;
+ }
}
/*******************************************************************************
*
- * FUNCTION: AcpiDmIsEisaId
+ * FUNCTION: AcpiDmCheckForHardwareId
*
* PARAMETERS: Op - Op to be examined
*
* RETURN: None
*
- * DESCRIPTION: Determine if a Name() Op can be converted to an EisaId.
+ * DESCRIPTION: Determine if a Name() Op is a _HID/_CID.
*
******************************************************************************/
void
-AcpiDmIsEisaId (
+AcpiDmCheckForHardwareId (
ACPI_PARSE_OBJECT *Op)
{
UINT32 Name;
@@ -630,7 +957,7 @@ AcpiDmIsEisaId (
if (ACPI_COMPARE_NAME (&Name, METHOD_NAME__HID))
{
- AcpiDmIsEisaIdElement (NextOp);
+ AcpiDmGetHardwareIdType (NextOp);
return;
}
@@ -645,20 +972,24 @@ AcpiDmIsEisaId (
if (NextOp->Common.AmlOpcode != AML_PACKAGE_OP)
{
- AcpiDmIsEisaIdElement (NextOp);
+ AcpiDmGetHardwareIdType (NextOp);
return;
}
- /* _CID with Package: get the package length */
+ /* _CID with Package: get the package length, check all elements */
NextOp = AcpiPsGetDepthNext (NULL, NextOp);
+ if (!NextOp)
+ {
+ return;
+ }
/* Don't need to use the length, just walk the peer list */
NextOp = NextOp->Common.Next;
while (NextOp)
{
- AcpiDmIsEisaIdElement (NextOp);
+ AcpiDmGetHardwareIdType (NextOp);
NextOp = NextOp->Common.Next;
}
}
@@ -666,41 +997,38 @@ AcpiDmIsEisaId (
/*******************************************************************************
*
- * FUNCTION: AcpiDmEisaId
+ * FUNCTION: AcpiDmDecompressEisaId
*
* PARAMETERS: EncodedId - Raw encoded EISA ID.
*
* RETURN: None
*
- * DESCRIPTION: Convert an encoded EISAID back to the original ASCII String.
+ * DESCRIPTION: Convert an encoded EISAID back to the original ASCII String
+ * and emit the correct ASL statement. If the ID is known, emit
+ * a description of the ID as a comment.
*
******************************************************************************/
void
-AcpiDmEisaId (
+AcpiDmDecompressEisaId (
UINT32 EncodedId)
{
- UINT32 BigEndianId;
-
+ char IdBuffer[ACPI_EISAID_STRING_SIZE];
+ const AH_DEVICE_ID *Info;
- /* Swap from little-endian to big-endian to simplify conversion */
- BigEndianId = AcpiUtDwordByteSwap (EncodedId);
+ /* Convert EISAID to a string an emit the statement */
+ AcpiExEisaIdToString (IdBuffer, EncodedId);
+ AcpiOsPrintf ("EisaId (\"%s\")", IdBuffer);
- /* Split to form "AAANNNN" string */
+ /* If we know about the ID, emit the description */
- AcpiOsPrintf ("EisaId (\"%c%c%c%4.4X\")",
-
- /* Three Alpha characters (AAA), 5 bits each */
-
- (int) ((BigEndianId >> 26) & 0x1F) + 0x40,
- (int) ((BigEndianId >> 21) & 0x1F) + 0x40,
- (int) ((BigEndianId >> 16) & 0x1F) + 0x40,
-
- /* Numeric part (NNNN) is simply the lower 16 bits */
-
- (UINT32) (BigEndianId & 0xFFFF));
+ Info = AcpiAhMatchHardwareId (IdBuffer);
+ if (Info)
+ {
+ AcpiOsPrintf (" /* %s */", Info->Description);
+ }
}
#endif
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c b/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c
new file mode 100644
index 0000000..b66dbed
--- /dev/null
+++ b/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c
@@ -0,0 +1,773 @@
+/*******************************************************************************
+ *
+ * Module Name: dmcstyle - Support for C-style operator disassembly
+ *
+ ******************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acparser.h>
+#include <contrib/dev/acpica/include/amlcode.h>
+#include <contrib/dev/acpica/include/acdisasm.h>
+#include <contrib/dev/acpica/include/acdebug.h>
+
+#ifdef ACPI_DISASSEMBLER
+
+#define _COMPONENT ACPI_CA_DEBUGGER
+ ACPI_MODULE_NAME ("dmcstyle")
+
+
+/* Local prototypes */
+
+static char *
+AcpiDmGetCompoundSymbol (
+ UINT16 AslOpcode);
+
+static void
+AcpiDmPromoteTarget (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_PARSE_OBJECT *Target);
+
+static BOOLEAN
+AcpiDmIsValidTarget (
+ ACPI_PARSE_OBJECT *Op);
+
+static BOOLEAN
+AcpiDmIsTargetAnOperand (
+ ACPI_PARSE_OBJECT *Target,
+ ACPI_PARSE_OBJECT *Operand,
+ BOOLEAN TopLevel);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmCheckForSymbolicOpcode
+ *
+ * PARAMETERS: Op - Current parse object
+ * Walk - Current parse tree walk info
+ *
+ * RETURN: TRUE if opcode can be converted to symbolic, FALSE otherwise
+ *
+ * DESCRIPTION: This is the main code that implements disassembly of AML code
+ * to C-style operators. Called during descending phase of the
+ * parse tree walk.
+ *
+ ******************************************************************************/
+
+BOOLEAN
+AcpiDmCheckForSymbolicOpcode (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_OP_WALK_INFO *Info)
+{
+ char *OperatorSymbol = NULL;
+ ACPI_PARSE_OBJECT *Child1;
+ ACPI_PARSE_OBJECT *Child2;
+ ACPI_PARSE_OBJECT *Target;
+
+
+ /* Exit immediately if ASL+ not enabled */
+
+ if (!AcpiGbl_CstyleDisassembly)
+ {
+ return (FALSE);
+ }
+
+ /* Get the first operand */
+
+ Child1 = AcpiPsGetArg (Op, 0);
+ if (!Child1)
+ {
+ return (FALSE);
+ }
+
+ /* Get the second operand */
+
+ Child2 = Child1->Common.Next;
+
+ /* Setup the operator string for this opcode */
+
+ switch (Op->Common.AmlOpcode)
+ {
+ case AML_ADD_OP:
+ OperatorSymbol = " + ";
+ break;
+
+ case AML_SUBTRACT_OP:
+ OperatorSymbol = " - ";
+ break;
+
+ case AML_MULTIPLY_OP:
+ OperatorSymbol = " * ";
+ break;
+
+ case AML_DIVIDE_OP:
+ OperatorSymbol = " / ";
+ break;
+
+ case AML_MOD_OP:
+ OperatorSymbol = " % ";
+ break;
+
+ case AML_SHIFT_LEFT_OP:
+ OperatorSymbol = " << ";
+ break;
+
+ case AML_SHIFT_RIGHT_OP:
+ OperatorSymbol = " >> ";
+ break;
+
+ case AML_BIT_AND_OP:
+ OperatorSymbol = " & ";
+ break;
+
+ case AML_BIT_OR_OP:
+ OperatorSymbol = " | ";
+ break;
+
+ case AML_BIT_XOR_OP:
+ OperatorSymbol = " ^ ";
+ break;
+
+ /* Logical operators, no target */
+
+ case AML_LAND_OP:
+ OperatorSymbol = " && ";
+ break;
+
+ case AML_LEQUAL_OP:
+ OperatorSymbol = " == ";
+ break;
+
+ case AML_LGREATER_OP:
+ OperatorSymbol = " > ";
+ break;
+
+ case AML_LLESS_OP:
+ OperatorSymbol = " < ";
+ break;
+
+ case AML_LOR_OP:
+ OperatorSymbol = " || ";
+ break;
+
+ case AML_LNOT_OP:
+ /*
+ * Check for the LNOT sub-opcodes. These correspond to
+ * LNotEqual, LLessEqual, and LGreaterEqual. There are
+ * no actual AML opcodes for these operators.
+ */
+ switch (Child1->Common.AmlOpcode)
+ {
+ case AML_LEQUAL_OP:
+ OperatorSymbol = " != ";
+ break;
+
+ case AML_LGREATER_OP:
+ OperatorSymbol = " <= ";
+ break;
+
+ case AML_LLESS_OP:
+ OperatorSymbol = " >= ";
+ break;
+
+ default:
+
+ /* Unary LNOT case, emit "!" immediately */
+
+ AcpiOsPrintf ("!");
+ return (TRUE);
+ }
+
+ Child1->Common.DisasmOpcode = ACPI_DASM_LNOT_SUFFIX;
+ Op->Common.DisasmOpcode = ACPI_DASM_LNOT_PREFIX;
+
+ /* Save symbol string in the next child (not peer) */
+
+ Child2 = AcpiPsGetArg (Child1, 0);
+ if (!Child2)
+ {
+ return (FALSE);
+ }
+
+ Child2->Common.OperatorSymbol = OperatorSymbol;
+ return (TRUE);
+
+#ifdef INDEX_SUPPORT
+ case AML_INDEX_OP:
+ Child1->Common.OperatorSymbol = " [";
+ Child2->Common.OperatorSymbol = "]";
+ break;
+#endif
+
+ /* Unary operators */
+
+ case AML_DECREMENT_OP:
+ OperatorSymbol = "--";
+ break;
+
+ case AML_INCREMENT_OP:
+ OperatorSymbol = "++";
+ break;
+
+ case AML_BIT_NOT_OP:
+ case AML_STORE_OP:
+ OperatorSymbol = NULL;
+ break;
+
+ default:
+ return (FALSE);
+ }
+
+ if (Child1->Common.DisasmOpcode == ACPI_DASM_LNOT_SUFFIX)
+ {
+ return (TRUE);
+ }
+
+ /*
+ * This is the key to how the disassembly of the C-style operators
+ * works. We save the operator symbol in the first child, thus
+ * deferring symbol output until after the first operand has been
+ * emitted.
+ */
+ if (!Child1->Common.OperatorSymbol)
+ {
+ Child1->Common.OperatorSymbol = OperatorSymbol;
+ }
+
+ /*
+ * Check for a valid target as the 3rd (or sometimes 2nd) operand
+ *
+ * Compound assignment operator support:
+ * Attempt to optimize constructs of the form:
+ * Add (Local1, 0xFF, Local1)
+ * to:
+ * Local1 += 0xFF
+ *
+ * Only the math operators and Store() have a target.
+ * Logicals have no target.
+ */
+ switch (Op->Common.AmlOpcode)
+ {
+ case AML_ADD_OP:
+ case AML_SUBTRACT_OP:
+ case AML_MULTIPLY_OP:
+ case AML_DIVIDE_OP:
+ case AML_MOD_OP:
+ case AML_SHIFT_LEFT_OP:
+ case AML_SHIFT_RIGHT_OP:
+ case AML_BIT_AND_OP:
+ case AML_BIT_OR_OP:
+ case AML_BIT_XOR_OP:
+
+ /* Target is 3rd operand */
+
+ Target = Child2->Common.Next;
+ if (Op->Common.AmlOpcode == AML_DIVIDE_OP)
+ {
+ /*
+ * Divide has an extra target operand (Remainder).
+ * If this extra target is specified, it cannot be converted
+ * to a C-style operator
+ */
+ if (AcpiDmIsValidTarget (Target))
+ {
+ Child1->Common.OperatorSymbol = NULL;
+ return (FALSE);
+ }
+
+ Target->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
+ Target = Target->Common.Next;
+ }
+
+ /* Parser should ensure there is at least a placeholder target */
+
+ if (!Target)
+ {
+ return (FALSE);
+ }
+
+ if (!AcpiDmIsValidTarget (Target))
+ {
+ /* Not a valid target (placeholder only, from parser) */
+ break;
+ }
+
+ /*
+ * Promote the target up to the first child in the parse
+ * tree. This is done because the target will be output
+ * first, in the form:
+ * <Target> = Operands...
+ */
+ AcpiDmPromoteTarget (Op, Target);
+
+ /*
+ * Check for possible conversion to a "Compound Assignment".
+ *
+ * Determine if either operand is the same as the target
+ * and display compound assignment operator and other operand.
+ */
+ if ((AcpiDmIsTargetAnOperand (Target, Child1, TRUE)) ||
+ (AcpiDmIsTargetAnOperand (Target, Child2, TRUE)))
+ {
+ Target->Common.OperatorSymbol =
+ AcpiDmGetCompoundSymbol (Op->Common.AmlOpcode);
+
+ /* Convert operator to compound assignment */
+
+ Op->Common.DisasmFlags |= ACPI_PARSEOP_COMPOUND;
+ Child1->Common.OperatorSymbol = NULL;
+ return (TRUE);
+ }
+
+ /*
+ * If we are within a C-style expression, emit an extra open
+ * paren. Implemented by examining the parent op.
+ */
+ switch (Op->Common.Parent->Common.AmlOpcode)
+ {
+ case AML_ADD_OP:
+ case AML_SUBTRACT_OP:
+ case AML_MULTIPLY_OP:
+ case AML_DIVIDE_OP:
+ case AML_MOD_OP:
+ case AML_SHIFT_LEFT_OP:
+ case AML_SHIFT_RIGHT_OP:
+ case AML_BIT_AND_OP:
+ case AML_BIT_OR_OP:
+ case AML_BIT_XOR_OP:
+ case AML_LAND_OP:
+ case AML_LEQUAL_OP:
+ case AML_LGREATER_OP:
+ case AML_LLESS_OP:
+ case AML_LOR_OP:
+
+ Op->Common.DisasmFlags |= ACPI_PARSEOP_ASSIGNMENT;
+ AcpiOsPrintf ("(");
+ break;
+
+ default:
+ break;
+ }
+
+ /* Normal output for ASL/AML operators with a target operand */
+
+ Target->Common.OperatorSymbol = " = (";
+ return (TRUE);
+
+ /* Binary operators, no parens */
+
+ case AML_DECREMENT_OP:
+ case AML_INCREMENT_OP:
+ return (TRUE);
+
+#ifdef INDEX_SUPPORT
+ case AML_INDEX_OP:
+
+ /* Target is optional, 3rd operand */
+
+ Target = Child2->Common.Next;
+ if (AcpiDmIsValidTarget (Target))
+ {
+ AcpiDmPromoteTarget (Op, Target);
+
+ if (!Target->Common.OperatorSymbol)
+ {
+ Target->Common.OperatorSymbol = " = ";
+ }
+ }
+ return (TRUE);
+#endif
+
+ case AML_STORE_OP:
+ /*
+ * Target is the 2nd operand.
+ * We know the target is valid, it is not optional.
+ * In the parse tree, simply swap the target with the
+ * source so that the target is processed first.
+ */
+ Target = Child1->Common.Next;
+ AcpiDmPromoteTarget (Op, Target);
+
+ if (!Target->Common.OperatorSymbol)
+ {
+ Target->Common.OperatorSymbol = " = ";
+ }
+ return (TRUE);
+
+ case AML_BIT_NOT_OP:
+
+ /* Target is optional, 2nd operand */
+
+ Target = Child1->Common.Next;
+ if (!Target)
+ {
+ return (FALSE);
+ }
+
+ if (AcpiDmIsValidTarget (Target))
+ {
+ /* Valid target, not a placeholder */
+
+ AcpiDmPromoteTarget (Op, Target);
+ Target->Common.OperatorSymbol = " = ~";
+ }
+ else
+ {
+ /* No target. Emit this prefix operator immediately */
+
+ AcpiOsPrintf ("~");
+ }
+ return (TRUE);
+
+ default:
+ break;
+ }
+
+ /* All other operators, emit an open paren */
+
+ AcpiOsPrintf ("(");
+ return (TRUE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmCloseOperator
+ *
+ * PARAMETERS: Op - Current parse object
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Closes an operator by adding a closing parentheses if and
+ * when necessary. Called during ascending phase of the
+ * parse tree walk.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmCloseOperator (
+ ACPI_PARSE_OBJECT *Op)
+{
+
+ /* Always emit paren if ASL+ disassembly disabled */
+
+ if (!AcpiGbl_CstyleDisassembly)
+ {
+ AcpiOsPrintf (")");
+ return;
+ }
+
+ /* Check if we need to add an additional closing paren */
+
+ switch (Op->Common.AmlOpcode)
+ {
+ case AML_ADD_OP:
+ case AML_SUBTRACT_OP:
+ case AML_MULTIPLY_OP:
+ case AML_DIVIDE_OP:
+ case AML_MOD_OP:
+ case AML_SHIFT_LEFT_OP:
+ case AML_SHIFT_RIGHT_OP:
+ case AML_BIT_AND_OP:
+ case AML_BIT_OR_OP:
+ case AML_BIT_XOR_OP:
+ case AML_LAND_OP:
+ case AML_LEQUAL_OP:
+ case AML_LGREATER_OP:
+ case AML_LLESS_OP:
+ case AML_LOR_OP:
+
+ /* Emit paren only if this is not a compound assignment */
+
+ if (Op->Common.DisasmFlags & ACPI_PARSEOP_COMPOUND)
+ {
+ return;
+ }
+
+ /* Emit extra close paren for assignment within an expression */
+
+ if (Op->Common.DisasmFlags & ACPI_PARSEOP_ASSIGNMENT)
+ {
+ AcpiOsPrintf (")");
+ }
+ break;
+
+
+ /* No need for parens for these */
+
+#ifdef INDEX_SUPPORT
+ case AML_INDEX_OP:
+#endif
+ case AML_DECREMENT_OP:
+ case AML_INCREMENT_OP:
+ case AML_LNOT_OP:
+ case AML_BIT_NOT_OP:
+ case AML_STORE_OP:
+ return;
+
+ default:
+
+ /* Always emit paren for non-ASL+ operators */
+ break;
+ }
+
+ AcpiOsPrintf (")");
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmGetCompoundSymbol
+ *
+ * PARAMETERS: AslOpcode
+ *
+ * RETURN: String containing the compound assignment symbol
+ *
+ * DESCRIPTION: Detect opcodes that can be converted to compound assignment,
+ * return the appropriate operator string.
+ *
+ ******************************************************************************/
+
+static char *
+AcpiDmGetCompoundSymbol (
+ UINT16 AmlOpcode)
+{
+ char *Symbol;
+
+
+ switch (AmlOpcode)
+ {
+ case AML_ADD_OP:
+ Symbol = " += ";
+ break;
+
+ case AML_SUBTRACT_OP:
+ Symbol = " -= ";
+ break;
+
+ case AML_MULTIPLY_OP:
+ Symbol = " *= ";
+ break;
+
+ case AML_DIVIDE_OP:
+ Symbol = " /= ";
+ break;
+
+ case AML_MOD_OP:
+ Symbol = " %= ";
+ break;
+
+ case AML_SHIFT_LEFT_OP:
+ Symbol = " <<= ";
+ break;
+
+ case AML_SHIFT_RIGHT_OP:
+ Symbol = " >>= ";
+ break;
+
+ case AML_BIT_AND_OP:
+ Symbol = " &= ";
+ break;
+
+ case AML_BIT_OR_OP:
+ Symbol = " |= ";
+ break;
+
+ case AML_BIT_XOR_OP:
+ Symbol = " ^= ";
+ break;
+
+ default:
+
+ /* No operator string for all other opcodes */
+ return (NULL);
+ }
+
+ return (Symbol);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmPromoteTarget
+ *
+ * PARAMETERS: Op - Operator parse object
+ * Target - Target associate with the Op
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Transform the parse tree by moving the target up to the first
+ * child of the Op.
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmPromoteTarget (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_PARSE_OBJECT *Target)
+{
+ ACPI_PARSE_OBJECT *Child;
+
+
+ /* Link target directly to the Op as first child */
+
+ Child = Op->Common.Value.Arg;
+ Op->Common.Value.Arg = Target;
+ Target->Common.Next = Child;
+
+ /* Find the last peer, it is linked to the target. Unlink it. */
+
+ while (Child->Common.Next != Target)
+ {
+ Child = Child->Common.Next;
+ }
+
+ Child->Common.Next = NULL;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmIsValidTarget
+ *
+ * PARAMETERS: Target - Target Op from the parse tree
+ *
+ * RETURN: TRUE if the Target is real. FALSE if it is just a placeholder
+ * Op that was inserted by the parser.
+ *
+ * DESCRIPTION: Determine if a Target Op is a placeholder Op or a real Target.
+ * In other words, determine if the optional target is used or
+ * not.
+ *
+ ******************************************************************************/
+
+static BOOLEAN
+AcpiDmIsValidTarget (
+ ACPI_PARSE_OBJECT *Target)
+{
+
+ if ((Target->Common.AmlOpcode == AML_INT_NAMEPATH_OP) &&
+ (Target->Common.Value.Arg == NULL))
+ {
+ return (FALSE);
+ }
+
+ return (TRUE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmIsTargetAnOperand
+ *
+ * PARAMETERS: Target - Target associated with the expression
+ * Operand - An operand associated with expression
+ *
+ * RETURN: TRUE if expression can be converted to a compound assignment.
+ * FALSE otherwise.
+ *
+ * DESCRIPTION: Determine if the Target duplicates the operand, in order to
+ * detect if the expression can be converted to a compound
+ * assigment. (+=, *=, etc.)
+ *
+ ******************************************************************************/
+
+static BOOLEAN
+AcpiDmIsTargetAnOperand (
+ ACPI_PARSE_OBJECT *Target,
+ ACPI_PARSE_OBJECT *Operand,
+ BOOLEAN TopLevel)
+{
+ const ACPI_OPCODE_INFO *OpInfo;
+ BOOLEAN Same;
+
+
+ /*
+ * Opcodes must match. Note: ignoring the difference between nameseg
+ * and namepath for now. May be needed later.
+ */
+ if (Target->Common.AmlOpcode != Operand->Common.AmlOpcode)
+ {
+ return (FALSE);
+ }
+
+ /* Nodes should match, even if they are NULL */
+
+ if (Target->Common.Node != Operand->Common.Node)
+ {
+ return (FALSE);
+ }
+
+ /* Determine if a child exists */
+
+ OpInfo = AcpiPsGetOpcodeInfo (Operand->Common.AmlOpcode);
+ if (OpInfo->Flags & AML_HAS_ARGS)
+ {
+ Same = AcpiDmIsTargetAnOperand (Target->Common.Value.Arg,
+ Operand->Common.Value.Arg, FALSE);
+ if (!Same)
+ {
+ return (FALSE);
+ }
+ }
+
+ /* Check the next peer, as long as we are not at the top level */
+
+ if ((!TopLevel) &&
+ Target->Common.Next)
+ {
+ Same = AcpiDmIsTargetAnOperand (Target->Common.Next,
+ Operand->Common.Next, FALSE);
+ if (!Same)
+ {
+ return (FALSE);
+ }
+ }
+
+ /* Supress the duplicate operand at the top-level */
+
+ if (TopLevel)
+ {
+ Operand->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
+ }
+ return (TRUE);
+}
+
+#endif
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c b/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c
index b047a60..9bf7451 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdispat.h>
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmnames.c b/sys/contrib/dev/acpica/components/disassembler/dmnames.c
index db7434d..07a90ff 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmnames.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmnames.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/amlcode.h>
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmobject.c b/sys/contrib/dev/acpica/components/disassembler/dmobject.c
index 5541e5a..6559ec0 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmobject.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmobject.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmopcode.c b/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
index 5435e13..f2ef535 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -46,12 +46,15 @@
#include <contrib/dev/acpica/include/acparser.h>
#include <contrib/dev/acpica/include/amlcode.h>
#include <contrib/dev/acpica/include/acdisasm.h>
+#include <contrib/dev/acpica/include/acinterp.h>
+#include <contrib/dev/acpica/include/acnamesp.h>
#ifdef ACPI_DISASSEMBLER
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dmopcode")
+
/* Local prototypes */
static void
@@ -61,6 +64,159 @@ AcpiDmMatchKeyword (
/*******************************************************************************
*
+ * FUNCTION: AcpiDmDisplayTargetPathname
+ *
+ * PARAMETERS: Op - Parse object
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: For AML opcodes that have a target operand, display the full
+ * pathname for the target, in a comment field. Handles Return()
+ * statements also.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDisplayTargetPathname (
+ ACPI_PARSE_OBJECT *Op)
+{
+ ACPI_PARSE_OBJECT *NextOp;
+ ACPI_PARSE_OBJECT *PrevOp = NULL;
+ char *Pathname;
+ const ACPI_OPCODE_INFO *OpInfo;
+
+
+ if (Op->Common.AmlOpcode == AML_RETURN_OP)
+ {
+ PrevOp = Op->Asl.Value.Arg;
+ }
+ else
+ {
+ OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
+ if (!(OpInfo->Flags & AML_HAS_TARGET))
+ {
+ return;
+ }
+
+ /* Target is the last Op in the arg list */
+
+ NextOp = Op->Asl.Value.Arg;
+ while (NextOp)
+ {
+ PrevOp = NextOp;
+ NextOp = PrevOp->Asl.Next;
+ }
+ }
+
+ if (!PrevOp)
+ {
+ return;
+ }
+
+ /* We must have a namepath AML opcode */
+
+ if (PrevOp->Asl.AmlOpcode != AML_INT_NAMEPATH_OP)
+ {
+ return;
+ }
+
+ /* A null string is the "no target specified" case */
+
+ if (!PrevOp->Asl.Value.String)
+ {
+ return;
+ }
+
+ /* No node means "unresolved external reference" */
+
+ if (!PrevOp->Asl.Node)
+ {
+ AcpiOsPrintf (" /* External reference */");
+ return;
+ }
+
+ /* Ignore if path is already from the root */
+
+ if (*PrevOp->Asl.Value.String == '\\')
+ {
+ return;
+ }
+
+ /* Now: we can get the full pathname */
+
+ Pathname = AcpiNsGetExternalPathname (PrevOp->Asl.Node);
+ if (!Pathname)
+ {
+ return;
+ }
+
+ AcpiOsPrintf (" /* %s */", Pathname);
+ ACPI_FREE (Pathname);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmNotifyDescription
+ *
+ * PARAMETERS: Op - Name() parse object
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Emit a description comment for the value associated with a
+ * Notify() operator.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmNotifyDescription (
+ ACPI_PARSE_OBJECT *Op)
+{
+ ACPI_PARSE_OBJECT *NextOp;
+ ACPI_NAMESPACE_NODE *Node;
+ UINT8 NotifyValue;
+ UINT8 Type = ACPI_TYPE_ANY;
+
+
+ /* The notify value is the second argument */
+
+ NextOp = Op->Asl.Value.Arg;
+ NextOp = NextOp->Asl.Next;
+
+ switch (NextOp->Common.AmlOpcode)
+ {
+ case AML_ZERO_OP:
+ case AML_ONE_OP:
+
+ NotifyValue = (UINT8) NextOp->Common.AmlOpcode;
+ break;
+
+ case AML_BYTE_OP:
+
+ NotifyValue = (UINT8) NextOp->Asl.Value.Integer;
+ break;
+
+ default:
+ return;
+ }
+
+ /*
+ * Attempt to get the namespace node so we can determine the object type.
+ * Some notify values are dependent on the object type (Device, Thermal,
+ * or Processor).
+ */
+ Node = Op->Asl.Node;
+ if (Node)
+ {
+ Type = Node->Type;
+ }
+
+ AcpiOsPrintf (" // %s", AcpiUtGetNotifyName (NotifyValue, Type));
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmPredefinedDescription
*
* PARAMETERS: Op - Name() parse object
@@ -183,14 +339,11 @@ AcpiDmPredefinedDescription (
/* Match the name in the info table */
- for (Info = AslPredefinedInfo; Info->Name; Info++)
+ Info = AcpiAhMatchPredefinedName (NameString);
+ if (Info)
{
- if (ACPI_COMPARE_NAME (NameString, Info->Name))
- {
- AcpiOsPrintf (" // %4.4s: %s",
- NameString, ACPI_CAST_PTR (char, Info->Description));
- return;
- }
+ AcpiOsPrintf (" // %4.4s: %s",
+ NameString, ACPI_CAST_PTR (char, Info->Description));
}
#endif
@@ -267,14 +420,11 @@ AcpiDmFieldPredefinedDescription (
/* Match the name in the info table */
- for (Info = AslPredefinedInfo; Info->Name; Info++)
+ Info = AcpiAhMatchPredefinedName (Tag);
+ if (Info)
{
- if (ACPI_COMPARE_NAME (Tag, Info->Name))
- {
- AcpiOsPrintf (" // %4.4s: %s", Tag,
- ACPI_CAST_PTR (char, Info->Description));
- return;
- }
+ AcpiOsPrintf (" // %4.4s: %s", Tag,
+ ACPI_CAST_PTR (char, Info->Description));
}
#endif
@@ -418,7 +568,6 @@ AcpiDmRegionFlags (
ACPI_PARSE_OBJECT *Op)
{
-
/* The next Op contains the SpaceId */
Op = AcpiPsGetDepthNext (NULL, Op);
@@ -488,7 +637,6 @@ AcpiDmMatchKeyword (
ACPI_PARSE_OBJECT *Op)
{
-
if (((UINT32) Op->Common.Value.Integer) > ACPI_MAX_MATCH_OPCODE)
{
AcpiOsPrintf ("/* Unknown Match Keyword encoding */");
@@ -527,6 +675,7 @@ AcpiDmDisassembleOneOp (
ACPI_PARSE_OBJECT *Child;
ACPI_STATUS Status;
UINT8 *Aml;
+ const AH_DEVICE_ID *IdInfo;
if (!Op)
@@ -544,27 +693,27 @@ AcpiDmDisassembleOneOp (
case ACPI_DASM_LNOT_SUFFIX:
- switch (Op->Common.AmlOpcode)
+ if (!AcpiGbl_CstyleDisassembly)
{
- case AML_LEQUAL_OP:
-
- AcpiOsPrintf ("LNotEqual");
- break;
-
- case AML_LGREATER_OP:
-
- AcpiOsPrintf ("LLessEqual");
- break;
-
- case AML_LLESS_OP:
+ switch (Op->Common.AmlOpcode)
+ {
+ case AML_LEQUAL_OP:
+ AcpiOsPrintf ("LNotEqual");
+ break;
- AcpiOsPrintf ("LGreaterEqual");
- break;
+ case AML_LGREATER_OP:
+ AcpiOsPrintf ("LLessEqual");
+ break;
- default:
+ case AML_LLESS_OP:
+ AcpiOsPrintf ("LGreaterEqual");
+ break;
- break;
+ default:
+ break;
+ }
}
+
Op->Common.DisasmOpcode = 0;
Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
return;
@@ -573,7 +722,6 @@ AcpiDmDisassembleOneOp (
break;
}
-
OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
/* The op and arguments */
@@ -605,7 +753,7 @@ AcpiDmDisassembleOneOp (
if (Op->Common.DisasmOpcode == ACPI_DASM_EISAID)
{
- AcpiDmEisaId ((UINT32) Op->Common.Value.Integer);
+ AcpiDmDecompressEisaId ((UINT32) Op->Common.Value.Integer);
}
else
{
@@ -617,7 +765,7 @@ AcpiDmDisassembleOneOp (
if (Op->Common.DisasmOpcode == ACPI_DASM_EISAID)
{
- AcpiDmEisaId ((UINT32) Op->Common.Value.Integer);
+ AcpiDmDecompressEisaId ((UINT32) Op->Common.Value.Integer);
}
else
{
@@ -634,6 +782,19 @@ AcpiDmDisassembleOneOp (
case AML_STRING_OP:
AcpiUtPrintString (Op->Common.Value.String, ACPI_UINT16_MAX);
+
+ /* For _HID/_CID strings, attempt to output a descriptive comment */
+
+ if (Op->Common.DisasmOpcode == ACPI_DASM_HID_STRING)
+ {
+ /* If we know about the ID, emit the description */
+
+ IdInfo = AcpiAhMatchHardwareId (Op->Common.Value.String);
+ if (IdInfo)
+ {
+ AcpiOsPrintf (" /* %s */", IdInfo->Description);
+ }
+ }
break;
case AML_BUFFER_OP:
@@ -664,7 +825,12 @@ AcpiDmDisassembleOneOp (
}
}
- if (AcpiDmIsUnicodeBuffer (Op))
+ if (AcpiDmIsUuidBuffer (Op))
+ {
+ Op->Common.DisasmOpcode = ACPI_DASM_UUID;
+ AcpiOsPrintf ("ToUUID (");
+ }
+ else if (AcpiDmIsUnicodeBuffer (Op))
{
Op->Common.DisasmOpcode = ACPI_DASM_UNICODE;
AcpiOsPrintf ("Unicode (");
@@ -677,7 +843,7 @@ AcpiDmDisassembleOneOp (
else if (AcpiDmIsPldBuffer (Op))
{
Op->Common.DisasmOpcode = ACPI_DASM_PLD_METHOD;
- AcpiOsPrintf ("Buffer");
+ AcpiOsPrintf ("ToPLD (");
}
else
{
@@ -765,7 +931,9 @@ AcpiDmDisassembleOneOp (
Length = (UINT32) Child->Common.Value.Integer;
Info->Level += 1;
+ Info->MappingOp = Op;
Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE;
+
AcpiDmResourceTemplate (Info, Op->Common.Parent, Aml, Length);
Info->Level -= 1;
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrc.c b/sys/contrib/dev/acpica/components/disassembler/dmresrc.c
index 6cdd07b..2a8147e 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrc.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/amlcode.h>
@@ -260,6 +259,11 @@ AcpiDmResourceTemplate (
ACPI_NAMESPACE_NODE *Node;
+ if (Op->Asl.AmlOpcode != AML_FIELD_OP)
+ {
+ Info->MappingOp = Op;
+ }
+
Level = Info->Level;
ResourceName = ACPI_DEFAULT_RESNAME;
Node = Op->Common.Node;
@@ -328,7 +332,7 @@ AcpiDmResourceTemplate (
/* Go ahead and insert EndDependentFn() */
- AcpiDmEndDependentDescriptor (Aml, ResourceLength, Level);
+ AcpiDmEndDependentDescriptor (Info, Aml, ResourceLength, Level);
AcpiDmIndent (Level);
AcpiOsPrintf (
@@ -350,7 +354,7 @@ AcpiDmResourceTemplate (
}
AcpiGbl_DmResourceDispatch [ResourceIndex] (
- Aml, ResourceLength, Level);
+ Info, Aml, ResourceLength, Level);
/* Descriptor post-processing */
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c b/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c
index 792ae80..b0cf41e 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdisasm.h>
@@ -576,7 +575,8 @@ AcpiDmResourceSource (
*
* FUNCTION: AcpiDmWordDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -588,6 +588,7 @@ AcpiDmResourceSource (
void
AcpiDmWordDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -621,7 +622,8 @@ AcpiDmWordDescriptor (
*
* FUNCTION: AcpiDmDwordDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -633,6 +635,7 @@ AcpiDmWordDescriptor (
void
AcpiDmDwordDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -666,7 +669,8 @@ AcpiDmDwordDescriptor (
*
* FUNCTION: AcpiDmQwordDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -678,6 +682,7 @@ AcpiDmDwordDescriptor (
void
AcpiDmQwordDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -711,7 +716,8 @@ AcpiDmQwordDescriptor (
*
* FUNCTION: AcpiDmExtendedDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -723,6 +729,7 @@ AcpiDmQwordDescriptor (
void
AcpiDmExtendedDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -758,7 +765,8 @@ AcpiDmExtendedDescriptor (
*
* FUNCTION: AcpiDmMemory24Descriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -770,6 +778,7 @@ AcpiDmExtendedDescriptor (
void
AcpiDmMemory24Descriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -797,7 +806,8 @@ AcpiDmMemory24Descriptor (
*
* FUNCTION: AcpiDmMemory32Descriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -809,6 +819,7 @@ AcpiDmMemory24Descriptor (
void
AcpiDmMemory32Descriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -836,7 +847,8 @@ AcpiDmMemory32Descriptor (
*
* FUNCTION: AcpiDmFixedMemory32Descriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -848,6 +860,7 @@ AcpiDmMemory32Descriptor (
void
AcpiDmFixedMemory32Descriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -877,7 +890,8 @@ AcpiDmFixedMemory32Descriptor (
*
* FUNCTION: AcpiDmGenericRegisterDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -889,6 +903,7 @@ AcpiDmFixedMemory32Descriptor (
void
AcpiDmGenericRegisterDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -933,7 +948,8 @@ AcpiDmGenericRegisterDescriptor (
*
* FUNCTION: AcpiDmInterruptDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -945,6 +961,7 @@ AcpiDmGenericRegisterDescriptor (
void
AcpiDmInterruptDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -1039,7 +1056,8 @@ AcpiDmVendorCommon (
*
* FUNCTION: AcpiDmVendorLargeDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -1051,6 +1069,7 @@ AcpiDmVendorCommon (
void
AcpiDmVendorLargeDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c b/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
index f938f93..ff5fabc 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdisasm.h>
@@ -56,24 +55,28 @@
static void
AcpiDmI2cSerialBusDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
static void
AcpiDmSpiSerialBusDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
static void
AcpiDmUartSerialBusDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
static void
AcpiDmGpioCommon (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Level);
@@ -168,7 +171,8 @@ Finish:
*
* FUNCTION: AcpiDmGpioCommon
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Level - Current source code indentation level
*
* RETURN: None
@@ -179,12 +183,14 @@ Finish:
static void
AcpiDmGpioCommon (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Level)
{
- UINT32 PinCount;
UINT16 *PinList;
UINT8 *VendorData;
+ char *DeviceName = NULL;
+ UINT32 PinCount;
UINT32 i;
@@ -193,9 +199,8 @@ AcpiDmGpioCommon (
AcpiDmIndent (Level + 1);
if (Resource->Gpio.ResSourceOffset)
{
- AcpiUtPrintString (
- ACPI_ADD_PTR (char, Resource, Resource->Gpio.ResSourceOffset),
- ACPI_UINT16_MAX);
+ DeviceName = ACPI_ADD_PTR (char, Resource, Resource->Gpio.ResSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
}
AcpiOsPrintf (", ");
@@ -243,6 +248,10 @@ AcpiDmGpioCommon (
AcpiDmIndent (Level + 1);
AcpiOsPrintf ("}\n");
+
+#ifndef _KERNEL
+ MpSaveGpioInfo (Info->MappingOp, Resource, PinCount, PinList, DeviceName);
+#endif
}
@@ -250,7 +259,8 @@ AcpiDmGpioCommon (
*
* FUNCTION: AcpiDmGpioIntDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -262,6 +272,7 @@ AcpiDmGpioCommon (
static void
AcpiDmGpioIntDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -274,7 +285,7 @@ AcpiDmGpioIntDescriptor (
AcpiDmIndent (Level);
AcpiOsPrintf ("GpioInt (%s, %s, %s, ",
AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.IntFlags)],
- AcpiGbl_LlDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->Gpio.IntFlags, 1)],
+ AcpiGbl_LlDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 1)],
AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
/* PinConfig, DebounceTimeout */
@@ -292,7 +303,7 @@ AcpiDmGpioIntDescriptor (
/* Dump the GpioInt/GpioIo common portion of the descriptor */
- AcpiDmGpioCommon (Resource, Level);
+ AcpiDmGpioCommon (Info, Resource, Level);
}
@@ -300,7 +311,8 @@ AcpiDmGpioIntDescriptor (
*
* FUNCTION: AcpiDmGpioIoDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -312,6 +324,7 @@ AcpiDmGpioIntDescriptor (
static void
AcpiDmGpioIoDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -344,7 +357,7 @@ AcpiDmGpioIoDescriptor (
/* Dump the GpioInt/GpioIo common portion of the descriptor */
- AcpiDmGpioCommon (Resource, Level);
+ AcpiDmGpioCommon (Info, Resource, Level);
}
@@ -352,7 +365,8 @@ AcpiDmGpioIoDescriptor (
*
* FUNCTION: AcpiDmGpioDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -364,6 +378,7 @@ AcpiDmGpioIoDescriptor (
void
AcpiDmGpioDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -377,12 +392,12 @@ AcpiDmGpioDescriptor (
{
case AML_RESOURCE_GPIO_TYPE_INT:
- AcpiDmGpioIntDescriptor (Resource, Length, Level);
+ AcpiDmGpioIntDescriptor (Info, Resource, Length, Level);
break;
case AML_RESOURCE_GPIO_TYPE_IO:
- AcpiDmGpioIoDescriptor (Resource, Length, Level);
+ AcpiDmGpioIoDescriptor (Info, Resource, Length, Level);
break;
default:
@@ -460,7 +475,8 @@ AcpiDmDumpSerialBusVendorData (
*
* FUNCTION: AcpiDmI2cSerialBusDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -472,11 +488,13 @@ AcpiDmDumpSerialBusVendorData (
static void
AcpiDmI2cSerialBusDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
{
UINT32 ResourceSourceOffset;
+ char *DeviceName;
/* SlaveAddress, SlaveMode, ConnectionSpeed, AddressingMode */
@@ -496,9 +514,8 @@ AcpiDmI2cSerialBusDescriptor (
ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
Resource->CommonSerialBus.TypeDataLength;
- AcpiUtPrintString (
- ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
- ACPI_UINT16_MAX);
+ DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
/* ResourceSourceIndex, ResourceUsage */
@@ -519,6 +536,10 @@ AcpiDmI2cSerialBusDescriptor (
AcpiDmIndent (Level + 1);
AcpiDmDumpSerialBusVendorData (Resource, Level);
AcpiOsPrintf (")\n");
+
+#ifndef _KERNEL
+ MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
+#endif
}
@@ -526,7 +547,8 @@ AcpiDmI2cSerialBusDescriptor (
*
* FUNCTION: AcpiDmSpiSerialBusDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -538,11 +560,13 @@ AcpiDmI2cSerialBusDescriptor (
static void
AcpiDmSpiSerialBusDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
{
UINT32 ResourceSourceOffset;
+ char *DeviceName;
/* DeviceSelection, DeviceSelectionPolarity, WireMode, DataBitLength */
@@ -571,9 +595,8 @@ AcpiDmSpiSerialBusDescriptor (
ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
Resource->CommonSerialBus.TypeDataLength;
- AcpiUtPrintString (
- ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
- ACPI_UINT16_MAX);
+ DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
/* ResourceSourceIndex, ResourceUsage */
@@ -594,6 +617,10 @@ AcpiDmSpiSerialBusDescriptor (
AcpiDmIndent (Level + 1);
AcpiDmDumpSerialBusVendorData (Resource, Level);
AcpiOsPrintf (")\n");
+
+#ifndef _KERNEL
+ MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
+#endif
}
@@ -601,7 +628,8 @@ AcpiDmSpiSerialBusDescriptor (
*
* FUNCTION: AcpiDmUartSerialBusDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -613,11 +641,13 @@ AcpiDmSpiSerialBusDescriptor (
static void
AcpiDmUartSerialBusDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
{
UINT32 ResourceSourceOffset;
+ char *DeviceName;
/* ConnectionSpeed, BitsPerByte, StopBits */
@@ -649,9 +679,8 @@ AcpiDmUartSerialBusDescriptor (
ResourceSourceOffset = sizeof (AML_RESOURCE_COMMON_SERIALBUS) +
Resource->CommonSerialBus.TypeDataLength;
- AcpiUtPrintString (
- ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
- ACPI_UINT16_MAX);
+ DeviceName = ACPI_ADD_PTR (char, Resource, ResourceSourceOffset),
+ AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
/* ResourceSourceIndex, ResourceUsage */
@@ -672,6 +701,10 @@ AcpiDmUartSerialBusDescriptor (
AcpiDmIndent (Level + 1);
AcpiDmDumpSerialBusVendorData (Resource, Level);
AcpiOsPrintf (")\n");
+
+#ifndef _KERNEL
+ MpSaveSerialInfo (Info->MappingOp, Resource, DeviceName);
+#endif
}
@@ -679,7 +712,8 @@ AcpiDmUartSerialBusDescriptor (
*
* FUNCTION: AcpiDmSerialBusDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -691,13 +725,14 @@ AcpiDmUartSerialBusDescriptor (
void
AcpiDmSerialBusDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
{
SerialBusResourceDispatch [Resource->CommonSerialBus.Type] (
- Resource, Length, Level);
+ Info, Resource, Length, Level);
}
#endif
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c b/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c
index 778d663..31b68b2 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdisasm.h>
@@ -57,7 +56,8 @@
*
* FUNCTION: AcpiDmIrqDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -69,6 +69,7 @@
void
AcpiDmIrqDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -102,7 +103,8 @@ AcpiDmIrqDescriptor (
*
* FUNCTION: AcpiDmDmaDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -114,6 +116,7 @@ AcpiDmIrqDescriptor (
void
AcpiDmDmaDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -139,7 +142,8 @@ AcpiDmDmaDescriptor (
*
* FUNCTION: AcpiDmFixedDmaDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -151,6 +155,7 @@ AcpiDmDmaDescriptor (
void
AcpiDmFixedDmaDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -182,7 +187,8 @@ AcpiDmFixedDmaDescriptor (
*
* FUNCTION: AcpiDmIoDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -194,6 +200,7 @@ AcpiDmFixedDmaDescriptor (
void
AcpiDmIoDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -227,7 +234,8 @@ AcpiDmIoDescriptor (
*
* FUNCTION: AcpiDmFixedIoDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -239,6 +247,7 @@ AcpiDmIoDescriptor (
void
AcpiDmFixedIoDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -265,7 +274,8 @@ AcpiDmFixedIoDescriptor (
*
* FUNCTION: AcpiDmStartDependentDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -277,6 +287,7 @@ AcpiDmFixedIoDescriptor (
void
AcpiDmStartDependentDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -304,7 +315,8 @@ AcpiDmStartDependentDescriptor (
*
* FUNCTION: AcpiDmEndDependentDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -316,6 +328,7 @@ AcpiDmStartDependentDescriptor (
void
AcpiDmEndDependentDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
@@ -332,7 +345,8 @@ AcpiDmEndDependentDescriptor (
*
* FUNCTION: AcpiDmVendorSmallDescriptor
*
- * PARAMETERS: Resource - Pointer to the resource descriptor
+ * PARAMETERS: Info - Extra resource info
+ * Resource - Pointer to the resource descriptor
* Length - Length of the descriptor in bytes
* Level - Current source code indentation level
*
@@ -344,6 +358,7 @@ AcpiDmEndDependentDescriptor (
void
AcpiDmVendorSmallDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level)
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmutils.c b/sys/contrib/dev/acpica/components/disassembler/dmutils.c
index 5d35d83..bdc252e 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmutils.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmutils.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/amlcode.h>
@@ -257,6 +256,13 @@ AcpiDmCommaIfListMember (
if (AcpiDmListType (Op->Common.Parent) & BLOCK_COMMA_LIST)
{
+ /* Exit if Target has been marked IGNORE */
+
+ if (Op->Common.Next->Common.DisasmFlags & ACPI_PARSEOP_IGNORE)
+ {
+ return (FALSE);
+ }
+
/* Check for a NULL target operand */
if ((Op->Common.Next->Common.AmlOpcode == AML_INT_NAMEPATH_OP) &&
@@ -280,7 +286,13 @@ AcpiDmCommaIfListMember (
return (FALSE);
}
- AcpiOsPrintf (", ");
+ /* Emit comma only if this is not a C-style operator */
+
+ if (!Op->Common.OperatorSymbol)
+ {
+ AcpiOsPrintf (", ");
+ }
+
return (TRUE);
}
diff --git a/sys/contrib/dev/acpica/components/disassembler/dmwalk.c b/sys/contrib/dev/acpica/components/disassembler/dmwalk.c
index 5a3fbc6..43a1139 100644
--- a/sys/contrib/dev/acpica/components/disassembler/dmwalk.c
+++ b/sys/contrib/dev/acpica/components/disassembler/dmwalk.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
@@ -285,7 +284,9 @@ AcpiDmBlockType (
case AML_BUFFER_OP:
- if (Op->Common.DisasmOpcode == ACPI_DASM_UNICODE)
+ if ((Op->Common.DisasmOpcode == ACPI_DASM_UNICODE) ||
+ (Op->Common.DisasmOpcode == ACPI_DASM_UUID) ||
+ (Op->Common.DisasmOpcode == ACPI_DASM_PLD_METHOD))
{
return (BLOCK_NONE);
}
@@ -301,6 +302,17 @@ AcpiDmBlockType (
return (BLOCK_PAREN);
+ case AML_INT_METHODCALL_OP:
+
+ if (Op->Common.Parent &&
+ ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
+ (Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP)))
+ {
+ /* This is a reference to a method, not an invocation */
+
+ return (BLOCK_NONE);
+ }
+
default:
OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
@@ -477,13 +489,20 @@ AcpiDmDescendingOp (
* keep track of the current column.
*/
Info->Count++;
- if (Info->Count /* +Info->LastLevel */ > 10)
+ if (Info->Count /* +Info->LastLevel */ > 12)
{
Info->Count = 0;
AcpiOsPrintf ("\n");
AcpiDmIndent (Info->LastLevel + 1);
}
+ /* If ASL+ is enabled, check for a C-style operator */
+
+ if (AcpiDmCheckForSymbolicOpcode (Op, Info))
+ {
+ return (AE_OK);
+ }
+
/* Print the opcode name */
AcpiDmDisassembleOneOp (NULL, Info, Op);
@@ -563,22 +582,19 @@ AcpiDmDescendingOp (
AcpiDmPredefinedDescription (Op);
break;
-
case AML_NAME_OP:
/* Check for _HID and related EISAID() */
- AcpiDmIsEisaId (Op);
+ AcpiDmCheckForHardwareId (Op);
AcpiOsPrintf (", ");
break;
-
case AML_REGION_OP:
AcpiDmRegionFlags (Op);
break;
-
case AML_POWER_RES_OP:
/* Mark the next two Ops as part of the parameter list */
@@ -591,7 +607,6 @@ AcpiDmDescendingOp (
NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST;
return (AE_OK);
-
case AML_PROCESSOR_OP:
/* Mark the next three Ops as part of the parameter list */
@@ -607,20 +622,17 @@ AcpiDmDescendingOp (
NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST;
return (AE_OK);
-
case AML_MUTEX_OP:
case AML_DATA_REGION_OP:
AcpiOsPrintf (", ");
return (AE_OK);
-
case AML_EVENT_OP:
case AML_ALIAS_OP:
return (AE_OK);
-
case AML_SCOPE_OP:
case AML_DEVICE_OP:
case AML_THERMAL_ZONE_OP:
@@ -628,7 +640,6 @@ AcpiDmDescendingOp (
AcpiOsPrintf (")");
break;
-
default:
AcpiOsPrintf ("*** Unhandled named opcode %X\n",
@@ -825,9 +836,9 @@ AcpiDmAscendingOp (
{
case BLOCK_PAREN:
- /* Completed an op that has arguments, add closing paren */
+ /* Completed an op that has arguments, add closing paren if needed */
- AcpiOsPrintf (")");
+ AcpiDmCloseOperator (Op);
if (Op->Common.AmlOpcode == AML_NAME_OP)
{
@@ -842,6 +853,15 @@ AcpiDmAscendingOp (
AcpiDmFieldPredefinedDescription (Op);
}
+ /* Decode Notify() values */
+
+ if (Op->Common.AmlOpcode == AML_NOTIFY_OP)
+ {
+ AcpiDmNotifyDescription (Op);
+ }
+
+ AcpiDmDisplayTargetPathname (Op);
+
/* Could be a nested operator, check if comma required */
if (!AcpiDmCommaIfListMember (Op))
@@ -949,6 +969,13 @@ AcpiDmAscendingOp (
}
/*
+ * The parent Op is guaranteed to be valid because of the flag
+ * ACPI_PARSEOP_PARAMLIST -- which means that this op is part of
+ * a parameter list and thus has a valid parent.
+ */
+ ParentOp = Op->Common.Parent;
+
+ /*
* Just completed a parameter node for something like "Buffer (param)".
* Close the paren and open up the term list block with a brace
*/
@@ -956,25 +983,24 @@ AcpiDmAscendingOp (
{
AcpiOsPrintf (")");
- /* Emit description comment for Name() with a predefined ACPI name */
-
- ParentOp = Op->Common.Parent;
- if (ParentOp)
+ /*
+ * Emit a description comment for a Name() operator that is a
+ * predefined ACPI name. Must check the grandparent.
+ */
+ ParentOp = ParentOp->Common.Parent;
+ if (ParentOp &&
+ (ParentOp->Asl.AmlOpcode == AML_NAME_OP))
{
- ParentOp = ParentOp->Common.Parent;
- if (ParentOp && ParentOp->Asl.AmlOpcode == AML_NAME_OP)
- {
- AcpiDmPredefinedDescription (ParentOp);
- }
+ AcpiDmPredefinedDescription (ParentOp);
}
+
AcpiOsPrintf ("\n");
AcpiDmIndent (Level - 1);
AcpiOsPrintf ("{\n");
}
else
{
- Op->Common.Parent->Common.DisasmFlags |=
- ACPI_PARSEOP_EMPTY_TERMLIST;
+ ParentOp->Common.DisasmFlags |= ACPI_PARSEOP_EMPTY_TERMLIST;
AcpiOsPrintf (") {");
}
}
@@ -984,8 +1010,21 @@ AcpiDmAscendingOp (
{
Info->Level++;
}
+
+ /*
+ * For ASL+, check for and emit a C-style symbol. If valid, the
+ * symbol string has been deferred until after the first operand
+ */
+ if (AcpiGbl_CstyleDisassembly)
+ {
+ if (Op->Asl.OperatorSymbol)
+ {
+ AcpiOsPrintf ("%s", Op->Asl.OperatorSymbol);
+ Op->Asl.OperatorSymbol = NULL;
+ }
+ }
+
return (AE_OK);
}
-
#endif /* ACPI_DISASSEMBLER */
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsargs.c b/sys/contrib/dev/acpica/components/dispatcher/dsargs.c
index 2c574ca1..254f704 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsargs.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsargs.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,8 +42,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DSARGS_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c b/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c
index 3d256ea..bb23156 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,8 +42,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DSCONTROL_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/amlcode.h>
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsfield.c b/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
index ab4f5b9..d376bb1 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DSFIELD_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/amlcode.h>
@@ -116,7 +114,7 @@ AcpiDsCreateExternalRegion (
* OperationRegion not found. Generate an External for it, and
* insert the name into the namespace.
*/
- AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_REGION, 0);
+ AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_REGION, 0, 0);
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_REGION,
ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, WalkState, Node);
if (ACPI_FAILURE (Status))
@@ -391,6 +389,7 @@ AcpiDsGetFieldNames (
*/
Info->ResourceBuffer = NULL;
Info->ConnectionNode = NULL;
+ Info->PinNumberIndex = 0;
/*
* A Connection() is either an actual resource descriptor (buffer)
@@ -466,6 +465,7 @@ AcpiDsGetFieldNames (
}
Info->FieldBitPosition += Info->FieldBitLength;
+ Info->PinNumberIndex++; /* Index relative to previous Connection() */
break;
default:
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsinit.c b/sys/contrib/dev/acpica/components/dispatcher/dsinit.c
index 5ab1f50..62f9bde 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsinit.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DSINIT_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdispat.h>
@@ -52,6 +50,7 @@
#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME ("dsinit")
+
/* Local prototypes */
static ACPI_STATUS
@@ -91,8 +90,8 @@ AcpiDsInitOneObject (
{
ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context;
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
- ACPI_OBJECT_TYPE Type;
ACPI_STATUS Status;
+ ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_FUNCTION_ENTRY ();
@@ -111,9 +110,7 @@ AcpiDsInitOneObject (
/* And even then, we are only interested in a few object types */
- Type = AcpiNsGetType (ObjHandle);
-
- switch (Type)
+ switch (AcpiNsGetType (ObjHandle))
{
case ACPI_TYPE_REGION:
@@ -129,8 +126,45 @@ AcpiDsInitOneObject (
break;
case ACPI_TYPE_METHOD:
-
+ /*
+ * Auto-serialization support. We will examine each method that is
+ * NotSerialized to determine if it creates any Named objects. If
+ * it does, it will be marked serialized to prevent problems if
+ * the method is entered by two or more threads and an attempt is
+ * made to create the same named object twice -- which results in
+ * an AE_ALREADY_EXISTS exception and method abort.
+ */
Info->MethodCount++;
+ ObjDesc = AcpiNsGetAttachedObject (Node);
+ if (!ObjDesc)
+ {
+ break;
+ }
+
+ /* Ignore if already serialized */
+
+ if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED)
+ {
+ Info->SerialMethodCount++;
+ break;
+ }
+
+ if (AcpiGbl_AutoSerializeMethods)
+ {
+ /* Parse/scan method and serialize it if necessary */
+
+ AcpiDsAutoSerializeMethod (Node, ObjDesc);
+ if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED)
+ {
+ /* Method was just converted to Serialized */
+
+ Info->SerialMethodCount++;
+ Info->SerializedMethodCount++;
+ break;
+ }
+ }
+
+ Info->NonSerialMethodCount++;
break;
case ACPI_TYPE_DEVICE:
@@ -187,7 +221,6 @@ AcpiDsInitializeObjects (
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"**** Starting initialization of namespace objects ****\n"));
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Parsing all Control Methods:"));
/* Set all init info to zero */
@@ -223,12 +256,14 @@ AcpiDsInitializeObjects (
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
- "\nTable [%4.4s](id %4.4X) - %u Objects with %u Devices %u Methods %u Regions\n",
- Table->Signature, OwnerId, Info.ObjectCount,
- Info.DeviceCount, Info.MethodCount, Info.OpRegionCount));
-
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "%u Methods, %u Regions\n", Info.MethodCount, Info.OpRegionCount));
+ "Table [%4.4s] (id %4.4X) - %4u Objects with %3u Devices, "
+ "%3u Regions, %3u Methods (%u/%u/%u Serial/Non/Cvt)\n",
+ Table->Signature, OwnerId, Info.ObjectCount, Info.DeviceCount,
+ Info.OpRegionCount, Info.MethodCount, Info.SerialMethodCount,
+ Info.NonSerialMethodCount, Info.SerializedMethodCount));
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "%u Methods, %u Regions\n",
+ Info.MethodCount, Info.OpRegionCount));
return_ACPI_STATUS (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c b/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c
index d2dccaf..a687c72 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,14 +41,14 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DSMETHOD_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdispat.h>
#include <contrib/dev/acpica/include/acinterp.h>
#include <contrib/dev/acpica/include/acnamesp.h>
#include <contrib/dev/acpica/include/acdisasm.h>
+#include <contrib/dev/acpica/include/acparser.h>
+#include <contrib/dev/acpica/include/amlcode.h>
#define _COMPONENT ACPI_DISPATCHER
@@ -57,12 +57,156 @@
/* Local prototypes */
static ACPI_STATUS
+AcpiDsDetectNamedOpcodes (
+ ACPI_WALK_STATE *WalkState,
+ ACPI_PARSE_OBJECT **OutOp);
+
+static ACPI_STATUS
AcpiDsCreateMethodMutex (
ACPI_OPERAND_OBJECT *MethodDesc);
/*******************************************************************************
*
+ * FUNCTION: AcpiDsAutoSerializeMethod
+ *
+ * PARAMETERS: Node - Namespace Node of the method
+ * ObjDesc - Method object attached to node
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Parse a control method AML to scan for control methods that
+ * need serialization due to the creation of named objects.
+ *
+ * NOTE: It is a bit of overkill to mark all such methods serialized, since
+ * there is only a problem if the method actually blocks during execution.
+ * A blocking operation is, for example, a Sleep() operation, or any access
+ * to an operation region. However, it is probably not possible to easily
+ * detect whether a method will block or not, so we simply mark all suspicious
+ * methods as serialized.
+ *
+ * NOTE2: This code is essentially a generic routine for parsing a single
+ * control method.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiDsAutoSerializeMethod (
+ ACPI_NAMESPACE_NODE *Node,
+ ACPI_OPERAND_OBJECT *ObjDesc)
+{
+ ACPI_STATUS Status;
+ ACPI_PARSE_OBJECT *Op = NULL;
+ ACPI_WALK_STATE *WalkState;
+
+
+ ACPI_FUNCTION_TRACE_PTR (DsAutoSerializeMethod, Node);
+
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
+ "Method auto-serialization parse [%4.4s] %p\n",
+ AcpiUtGetNodeName (Node), Node));
+
+ /* Create/Init a root op for the method parse tree */
+
+ Op = AcpiPsAllocOp (AML_METHOD_OP);
+ if (!Op)
+ {
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ AcpiPsSetName (Op, Node->Name.Integer);
+ Op->Common.Node = Node;
+
+ /* Create and initialize a new walk state */
+
+ WalkState = AcpiDsCreateWalkState (Node->OwnerId, NULL, NULL, NULL);
+ if (!WalkState)
+ {
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ Status = AcpiDsInitAmlWalk (WalkState, Op, Node, ObjDesc->Method.AmlStart,
+ ObjDesc->Method.AmlLength, NULL, 0);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiDsDeleteWalkState (WalkState);
+ return_ACPI_STATUS (Status);
+ }
+
+ WalkState->DescendingCallback = AcpiDsDetectNamedOpcodes;
+
+ /* Parse the method, scan for creation of named objects */
+
+ Status = AcpiPsParseAml (WalkState);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ AcpiPsDeleteParseTree (Op);
+ return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDsDetectNamedOpcodes
+ *
+ * PARAMETERS: WalkState - Current state of the parse tree walk
+ * OutOp - Unused, required for parser interface
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Descending callback used during the loading of ACPI tables.
+ * Currently used to detect methods that must be marked serialized
+ * in order to avoid problems with the creation of named objects.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDsDetectNamedOpcodes (
+ ACPI_WALK_STATE *WalkState,
+ ACPI_PARSE_OBJECT **OutOp)
+{
+
+ ACPI_FUNCTION_NAME (AcpiDsDetectNamedOpcodes);
+
+
+ /* We are only interested in opcodes that create a new name */
+
+ if (!(WalkState->OpInfo->Flags & (AML_NAMED | AML_CREATE | AML_FIELD)))
+ {
+ return (AE_OK);
+ }
+
+ /*
+ * At this point, we know we have a Named object opcode.
+ * Mark the method as serialized. Later code will create a mutex for
+ * this method to enforce serialization.
+ *
+ * Note, ACPI_METHOD_IGNORE_SYNC_LEVEL flag means that we will ignore the
+ * Sync Level mechanism for this method, even though it is now serialized.
+ * Otherwise, there can be conflicts with existing ASL code that actually
+ * uses sync levels.
+ */
+ WalkState->MethodDesc->Method.SyncLevel = 0;
+ WalkState->MethodDesc->Method.InfoFlags |=
+ (ACPI_METHOD_SERIALIZED | ACPI_METHOD_IGNORE_SYNC_LEVEL);
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+ "Method serialized [%4.4s] %p - [%s] (%4.4X)\n",
+ WalkState->MethodNode->Name.Ascii, WalkState->MethodNode,
+ WalkState->OpInfo->Name, WalkState->Opcode));
+
+ /* Abort the parse, no need to examine this method any further */
+
+ return (AE_CTRL_TERMINATE);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDsMethodError
*
* PARAMETERS: Status - Execution status
@@ -238,11 +382,16 @@ AcpiDsBeginMethodExecution (
/*
* The CurrentSyncLevel (per-thread) must be less than or equal to
* the sync level of the method. This mechanism provides some
- * deadlock prevention
+ * deadlock prevention.
+ *
+ * If the method was auto-serialized, we just ignore the sync level
+ * mechanism, because auto-serialization of methods can interfere
+ * with ASL code that actually uses sync levels.
*
* Top-level method invocation has no walk state at this point
*/
if (WalkState &&
+ (!(ObjDesc->Method.InfoFlags & ACPI_METHOD_IGNORE_SYNC_LEVEL)) &&
(WalkState->Thread->CurrentSyncLevel > ObjDesc->Method.Mutex->Mutex.SyncLevel))
{
ACPI_ERROR ((AE_INFO,
@@ -710,7 +859,8 @@ AcpiDsTerminateControlMethod (
* thread exits here.
*/
MethodDesc->Method.InfoFlags &= ~ACPI_METHOD_SERIALIZED_PENDING;
- MethodDesc->Method.InfoFlags |= ACPI_METHOD_SERIALIZED;
+ MethodDesc->Method.InfoFlags |=
+ (ACPI_METHOD_SERIALIZED | ACPI_METHOD_IGNORE_SYNC_LEVEL);
MethodDesc->Method.SyncLevel = 0;
}
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c b/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c
index 76157f5..4b998d9 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DSMTHDAT_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdispat.h>
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsobject.c b/sys/contrib/dev/acpica/components/dispatcher/dsobject.c
index a853d3d..106c6ab 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsobject.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsobject.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DSOBJECT_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c b/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c
index b7ff590..86fe26c 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DSOPCODE_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dsutils.c b/sys/contrib/dev/acpica/components/dispatcher/dsutils.c
index 0a386cc..f4f0f33 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dsutils.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dsutils.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DSUTILS_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
@@ -779,16 +777,16 @@ AcpiDsCreateOperands (
Index++;
}
- Index--;
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "NumOperands %d, ArgCount %d, Index %d\n",
+ WalkState->NumOperands, ArgCount, Index));
- /* It is the appropriate order to get objects from the Result stack */
+ /* Create the interpreter arguments, in reverse order */
+ Index--;
for (i = 0; i < ArgCount; i++)
{
Arg = Arguments[Index];
-
- /* Force the filling of the operand stack in inverse order */
-
WalkState->OperandIndex = (UINT8) Index;
Status = AcpiDsCreateOperand (WalkState, Arg, Index);
@@ -797,10 +795,10 @@ AcpiDsCreateOperands (
goto Cleanup;
}
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Created Arg #%u (%p) %u args total\n",
+ Index, Arg, ArgCount));
Index--;
-
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Arg #%u (%p) done, Arg1=%p\n",
- Index, Arg, FirstArg));
}
return_ACPI_STATUS (Status);
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswexec.c b/sys/contrib/dev/acpica/components/dispatcher/dswexec.c
index 6955f3c..f391fe0 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswexec.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswexec.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,8 +42,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DSWEXEC_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
@@ -541,7 +539,8 @@ AcpiDsExecEndOp (
return_ACPI_STATUS (AE_OK);
}
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%p\n", Op));
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
+ "Method invocation, Op=%p\n", Op));
/*
* (AML_METHODCALL) Op->Asl.Value.Arg->Asl.Node contains
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswload.c b/sys/contrib/dev/acpica/components/dispatcher/dswload.c
index 1cc8d4f..8bc425a 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswload.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswload.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DSWLOAD_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
@@ -80,8 +78,21 @@ AcpiDsInitCallbacks (
switch (PassNumber)
{
+ case 0:
+
+ /* Parse only - caller will setup callbacks */
+
+ WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 |
+ ACPI_PARSE_DELETE_TREE |
+ ACPI_PARSE_DISASSEMBLE;
+ WalkState->DescendingCallback = NULL;
+ WalkState->AscendingCallback = NULL;
+ break;
+
case 1:
+ /* Load pass 1 */
+
WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 |
ACPI_PARSE_DELETE_TREE;
WalkState->DescendingCallback = AcpiDsLoad1BeginOp;
@@ -90,6 +101,8 @@ AcpiDsInitCallbacks (
case 2:
+ /* Load pass 2 */
+
WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 |
ACPI_PARSE_DELETE_TREE;
WalkState->DescendingCallback = AcpiDsLoad2BeginOp;
@@ -98,6 +111,8 @@ AcpiDsInitCallbacks (
case 3:
+ /* Execution pass */
+
#ifndef ACPI_NO_METHOD_EXECUTION
WalkState->ParseFlags |= ACPI_PARSE_EXECUTE |
ACPI_PARSE_DELETE_TREE;
@@ -193,7 +208,7 @@ AcpiDsLoad1BeginOp (
* Target of Scope() not found. Generate an External for it, and
* insert the name into the namespace.
*/
- AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_DEVICE, 0);
+ AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_DEVICE, 0, 0);
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT,
WalkState, &Node);
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswload2.c b/sys/contrib/dev/acpica/components/dispatcher/dswload2.c
index 2b85413..4728774 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswload2.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswload2.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DSWLOAD2_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswscope.c b/sys/contrib/dev/acpica/components/dispatcher/dswscope.c
index 8530b5d..dc1fedc 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswscope.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswscope.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DSWSCOPE_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdispat.h>
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dswstate.c b/sys/contrib/dev/acpica/components/dispatcher/dswstate.c
index 8fd36bf..5211666 100644
--- a/sys/contrib/dev/acpica/components/dispatcher/dswstate.c
+++ b/sys/contrib/dev/acpica/components/dispatcher/dswstate.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __DSWSTATE_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/components/events/evevent.c b/sys/contrib/dev/acpica/components/events/evevent.c
index dc8457c..45d227c 100644
--- a/sys/contrib/dev/acpica/components/events/evevent.c
+++ b/sys/contrib/dev/acpica/components/events/evevent.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evglock.c b/sys/contrib/dev/acpica/components/events/evglock.c
index 9c5ade0..a9855c9 100644
--- a/sys/contrib/dev/acpica/components/events/evglock.c
+++ b/sys/contrib/dev/acpica/components/events/evglock.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/events/evgpe.c b/sys/contrib/dev/acpica/components/events/evgpe.c
index f4d1214..99043ad 100644
--- a/sys/contrib/dev/acpica/components/events/evgpe.c
+++ b/sys/contrib/dev/acpica/components/events/evgpe.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -131,18 +131,6 @@ AcpiEvEnableGpe (
ACPI_FUNCTION_TRACE (EvEnableGpe);
- /*
- * We will only allow a GPE to be enabled if it has either an associated
- * method (_Lxx/_Exx) or a handler, or is using the implicit notify
- * feature. Otherwise, the GPE will be immediately disabled by
- * AcpiEvGpeDispatch the first time it fires.
- */
- if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
- ACPI_GPE_DISPATCH_NONE)
- {
- return_ACPI_STATUS (AE_NO_HANDLER);
- }
-
/* Clear the GPE (of stale events) */
Status = AcpiHwClearGpe (GpeEventInfo);
@@ -153,7 +141,7 @@ AcpiEvEnableGpe (
/* Enable the requested GPE */
- Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE);
+ Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE_SAVE);
return_ACPI_STATUS (Status);
}
@@ -243,7 +231,7 @@ AcpiEvRemoveGpeReference (
Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo);
if (ACPI_SUCCESS (Status))
{
- Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
+ Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE_SAVE);
}
if (ACPI_FAILURE (Status))
@@ -383,7 +371,11 @@ AcpiEvGpeDetect (
{
ACPI_STATUS Status;
ACPI_GPE_BLOCK_INFO *GpeBlock;
+ ACPI_NAMESPACE_NODE *GpeDevice;
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
+ ACPI_GPE_EVENT_INFO *GpeEventInfo;
+ UINT32 GpeNumber;
+ ACPI_GPE_HANDLER_INFO *GpeHandlerInfo;
UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED;
UINT8 EnabledStatusByte;
UINT32 StatusReg;
@@ -414,6 +406,8 @@ AcpiEvGpeDetect (
GpeBlock = GpeXruptList->GpeBlockListHead;
while (GpeBlock)
{
+ GpeDevice = GpeBlock->Node;
+
/*
* Read all of the 8-bit GPE status and enable registers in this GPE
* block, saving all of them. Find all currently active GP events.
@@ -432,7 +426,7 @@ AcpiEvGpeDetect (
GpeRegisterInfo->EnableForWake))
{
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
- "Ignore disabled registers for GPE%02X-GPE%02X: "
+ "Ignore disabled registers for GPE %02X-%02X: "
"RunEnable=%02X, WakeEnable=%02X\n",
GpeRegisterInfo->BaseGpeNumber,
GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
@@ -458,7 +452,7 @@ AcpiEvGpeDetect (
}
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
- "Read registers for GPE%02X-GPE%02X: Status=%02X, Enable=%02X, "
+ "Read registers for GPE %02X-%02X: Status=%02X, Enable=%02X, "
"RunEnable=%02X, WakeEnable=%02X\n",
GpeRegisterInfo->BaseGpeNumber,
GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
@@ -482,16 +476,55 @@ AcpiEvGpeDetect (
{
/* Examine one GPE bit */
+ GpeEventInfo = &GpeBlock->EventInfo[((ACPI_SIZE) i *
+ ACPI_GPE_REGISTER_WIDTH) + j];
+ GpeNumber = j + GpeRegisterInfo->BaseGpeNumber;
+
if (EnabledStatusByte & (1 << j))
{
- /*
- * Found an active GPE. Dispatch the event to a handler
- * or method.
- */
- IntStatus |= AcpiEvGpeDispatch (GpeBlock->Node,
- &GpeBlock->EventInfo[((ACPI_SIZE) i *
- ACPI_GPE_REGISTER_WIDTH) + j],
- j + GpeRegisterInfo->BaseGpeNumber);
+ /* Invoke global event handler if present */
+
+ AcpiGpeCount++;
+ if (AcpiGbl_GlobalEventHandler)
+ {
+ AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_GPE,
+ GpeDevice, GpeNumber,
+ AcpiGbl_GlobalEventHandlerContext);
+ }
+
+ /* Found an active GPE */
+
+ if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
+ ACPI_GPE_DISPATCH_RAW_HANDLER)
+ {
+ /* Dispatch the event to a raw handler */
+
+ GpeHandlerInfo = GpeEventInfo->Dispatch.Handler;
+
+ /*
+ * There is no protection around the namespace node
+ * and the GPE handler to ensure a safe destruction
+ * because:
+ * 1. The namespace node is expected to always
+ * exist after loading a table.
+ * 2. The GPE handler is expected to be flushed by
+ * AcpiOsWaitEventsComplete() before the
+ * destruction.
+ */
+ AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+ IntStatus |= GpeHandlerInfo->Address (
+ GpeDevice, GpeNumber, GpeHandlerInfo->Context);
+ Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
+ }
+ else
+ {
+ /*
+ * Dispatch the event to a standard handler or
+ * method.
+ */
+ IntStatus |= AcpiEvGpeDispatch (GpeDevice,
+ GpeEventInfo, GpeNumber);
+ }
}
}
}
@@ -527,8 +560,7 @@ AcpiEvAsynchExecuteGpeMethod (
void *Context)
{
ACPI_GPE_EVENT_INFO *GpeEventInfo = Context;
- ACPI_STATUS Status;
- ACPI_GPE_EVENT_INFO *LocalGpeEventInfo;
+ ACPI_STATUS Status = AE_OK;
ACPI_EVALUATE_INFO *Info;
ACPI_GPE_NOTIFY_INFO *Notify;
@@ -536,46 +568,9 @@ AcpiEvAsynchExecuteGpeMethod (
ACPI_FUNCTION_TRACE (EvAsynchExecuteGpeMethod);
- /* Allocate a local GPE block */
-
- LocalGpeEventInfo = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_EVENT_INFO));
- if (!LocalGpeEventInfo)
- {
- ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
- "while handling a GPE"));
- return_VOID;
- }
-
- Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
- if (ACPI_FAILURE (Status))
- {
- return_VOID;
- }
-
- /* Must revalidate the GpeNumber/GpeBlock */
-
- if (!AcpiEvValidGpeEvent (GpeEventInfo))
- {
- Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
- return_VOID;
- }
-
- /*
- * Take a snapshot of the GPE info for this level - we copy the info to
- * prevent a race condition with RemoveHandler/RemoveBlock.
- */
- ACPI_MEMCPY (LocalGpeEventInfo, GpeEventInfo,
- sizeof (ACPI_GPE_EVENT_INFO));
-
- Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
- if (ACPI_FAILURE (Status))
- {
- return_VOID;
- }
-
/* Do the correct dispatch - normal method or implicit notify */
- switch (LocalGpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK)
+ switch (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags))
{
case ACPI_GPE_DISPATCH_NOTIFY:
/*
@@ -589,7 +584,7 @@ AcpiEvAsynchExecuteGpeMethod (
* June 2012: Expand implicit notify mechanism to support
* notifies on multiple device objects.
*/
- Notify = LocalGpeEventInfo->Dispatch.NotifyList;
+ Notify = GpeEventInfo->Dispatch.NotifyList;
while (ACPI_SUCCESS (Status) && Notify)
{
Status = AcpiEvQueueNotifyRequest (Notify->DeviceNode,
@@ -614,7 +609,7 @@ AcpiEvAsynchExecuteGpeMethod (
* Invoke the GPE Method (_Lxx, _Exx) i.e., evaluate the
* _Lxx/_Exx control method that corresponds to this GPE
*/
- Info->PrefixNode = LocalGpeEventInfo->Dispatch.MethodNode;
+ Info->PrefixNode = GpeEventInfo->Dispatch.MethodNode;
Info->Flags = ACPI_IGNORE_RETURN_VALUE;
Status = AcpiNsEvaluate (Info);
@@ -625,23 +620,26 @@ AcpiEvAsynchExecuteGpeMethod (
{
ACPI_EXCEPTION ((AE_INFO, Status,
"while evaluating GPE method [%4.4s]",
- AcpiUtGetNodeName (LocalGpeEventInfo->Dispatch.MethodNode)));
+ AcpiUtGetNodeName (GpeEventInfo->Dispatch.MethodNode)));
}
break;
default:
- return_VOID; /* Should never happen */
+ goto ErrorExit; /* Should never happen */
}
/* Defer enabling of GPE until all notify handlers are done */
Status = AcpiOsExecute (OSL_NOTIFY_HANDLER,
- AcpiEvAsynchEnableGpe, LocalGpeEventInfo);
- if (ACPI_FAILURE (Status))
+ AcpiEvAsynchEnableGpe, GpeEventInfo);
+ if (ACPI_SUCCESS (Status))
{
- ACPI_FREE (LocalGpeEventInfo);
+ return_VOID;
}
+
+ErrorExit:
+ AcpiEvAsynchEnableGpe (GpeEventInfo);
return_VOID;
}
@@ -665,11 +663,13 @@ AcpiEvAsynchEnableGpe (
void *Context)
{
ACPI_GPE_EVENT_INFO *GpeEventInfo = Context;
+ ACPI_CPU_FLAGS Flags;
+ Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
(void) AcpiEvFinishGpe (GpeEventInfo);
+ AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
- ACPI_FREE (GpeEventInfo);
return;
}
@@ -710,7 +710,7 @@ AcpiEvFinishGpe (
/*
* Enable this GPE, conditionally. This means that the GPE will
- * only be physically enabled if the EnableForRun bit is set
+ * only be physically enabled if the EnableMask bit is set
* in the EventInfo.
*/
(void) AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_CONDITIONAL_ENABLE);
@@ -748,13 +748,21 @@ AcpiEvGpeDispatch (
ACPI_FUNCTION_TRACE (EvGpeDispatch);
- /* Invoke global event handler if present */
-
- AcpiGpeCount++;
- if (AcpiGbl_GlobalEventHandler)
+ /*
+ * Always disable the GPE so that it does not keep firing before
+ * any asynchronous activity completes (either from the execution
+ * of a GPE method or an asynchronous GPE handler.)
+ *
+ * If there is no handler or method to run, just disable the
+ * GPE and leave it disabled permanently to prevent further such
+ * pointless events from firing.
+ */
+ Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
+ if (ACPI_FAILURE (Status))
{
- AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_GPE, GpeDevice,
- GpeNumber, AcpiGbl_GlobalEventHandlerContext);
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "Unable to disable GPE %02X", GpeNumber));
+ return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
}
/*
@@ -768,36 +776,21 @@ AcpiEvGpeDispatch (
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
- "Unable to clear GPE%02X", GpeNumber));
+ "Unable to clear GPE %02X", GpeNumber));
+ (void) AcpiHwLowSetGpe (GpeEventInfo,
+ ACPI_GPE_CONDITIONAL_ENABLE);
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
}
}
/*
- * Always disable the GPE so that it does not keep firing before
- * any asynchronous activity completes (either from the execution
- * of a GPE method or an asynchronous GPE handler.)
- *
- * If there is no handler or method to run, just disable the
- * GPE and leave it disabled permanently to prevent further such
- * pointless events from firing.
- */
- Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
- if (ACPI_FAILURE (Status))
- {
- ACPI_EXCEPTION ((AE_INFO, Status,
- "Unable to disable GPE%02X", GpeNumber));
- return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
- }
-
- /*
* Dispatch the GPE to either an installed handler or the control
* method associated with this GPE (_Lxx or _Exx). If a handler
* exists, we invoke it and do not attempt to run the method.
* If there is neither a handler nor a method, leave the GPE
* disabled.
*/
- switch (GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK)
+ switch (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags))
{
case ACPI_GPE_DISPATCH_HANDLER:
@@ -826,7 +819,7 @@ AcpiEvGpeDispatch (
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
- "Unable to queue handler for GPE%02X - event disabled",
+ "Unable to queue handler for GPE %02X - event disabled",
GpeNumber));
}
break;
@@ -838,7 +831,7 @@ AcpiEvGpeDispatch (
* a GPE to be enabled if it has no handler or method.
*/
ACPI_ERROR ((AE_INFO,
- "No handler or method for GPE%02X, disabling event",
+ "No handler or method for GPE %02X, disabling event",
GpeNumber));
break;
}
diff --git a/sys/contrib/dev/acpica/components/events/evgpeblk.c b/sys/contrib/dev/acpica/components/events/evgpeblk.c
index f0d53a3..53528c6 100644
--- a/sys/contrib/dev/acpica/components/events/evgpeblk.c
+++ b/sys/contrib/dev/acpica/components/events/evgpeblk.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -97,10 +97,9 @@ AcpiEvInstallGpeBlock (
return_ACPI_STATUS (Status);
}
- GpeXruptBlock = AcpiEvGetGpeXruptBlock (InterruptNumber);
- if (!GpeXruptBlock)
+ Status = AcpiEvGetGpeXruptBlock (InterruptNumber, &GpeXruptBlock);
+ if (ACPI_FAILURE (Status))
{
- Status = AE_NO_MEMORY;
goto UnlockAndExit;
}
@@ -128,7 +127,7 @@ AcpiEvInstallGpeBlock (
UnlockAndExit:
- Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
+ (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
return_ACPI_STATUS (Status);
}
@@ -283,17 +282,17 @@ AcpiEvCreateGpeInfoBlocks (
{
/* Init the RegisterInfo for this GPE register (8 GPEs) */
- ThisRegister->BaseGpeNumber = (UINT8) (GpeBlock->BlockBaseNumber +
- (i * ACPI_GPE_REGISTER_WIDTH));
+ ThisRegister->BaseGpeNumber = (UINT16)
+ (GpeBlock->BlockBaseNumber + (i * ACPI_GPE_REGISTER_WIDTH));
ThisRegister->StatusAddress.Address =
- GpeBlock->BlockAddress.Address + i;
+ GpeBlock->Address + i;
ThisRegister->EnableAddress.Address =
- GpeBlock->BlockAddress.Address + i + GpeBlock->RegisterCount;
+ GpeBlock->Address + i + GpeBlock->RegisterCount;
- ThisRegister->StatusAddress.SpaceId = GpeBlock->BlockAddress.SpaceId;
- ThisRegister->EnableAddress.SpaceId = GpeBlock->BlockAddress.SpaceId;
+ ThisRegister->StatusAddress.SpaceId = GpeBlock->SpaceId;
+ ThisRegister->EnableAddress.SpaceId = GpeBlock->SpaceId;
ThisRegister->StatusAddress.BitWidth = ACPI_GPE_REGISTER_WIDTH;
ThisRegister->EnableAddress.BitWidth = ACPI_GPE_REGISTER_WIDTH;
ThisRegister->StatusAddress.BitOffset = 0;
@@ -366,9 +365,10 @@ ErrorExit:
ACPI_STATUS
AcpiEvCreateGpeBlock (
ACPI_NAMESPACE_NODE *GpeDevice,
- ACPI_GENERIC_ADDRESS *GpeBlockAddress,
+ UINT64 Address,
+ UINT8 SpaceId,
UINT32 RegisterCount,
- UINT8 GpeBlockBaseNumber,
+ UINT16 GpeBlockBaseNumber,
UINT32 InterruptNumber,
ACPI_GPE_BLOCK_INFO **ReturnGpeBlock)
{
@@ -395,15 +395,14 @@ AcpiEvCreateGpeBlock (
/* Initialize the new GPE block */
+ GpeBlock->Address = Address;
+ GpeBlock->SpaceId = SpaceId;
GpeBlock->Node = GpeDevice;
GpeBlock->GpeCount = (UINT16) (RegisterCount * ACPI_GPE_REGISTER_WIDTH);
GpeBlock->Initialized = FALSE;
GpeBlock->RegisterCount = RegisterCount;
GpeBlock->BlockBaseNumber = GpeBlockBaseNumber;
- ACPI_MEMCPY (&GpeBlock->BlockAddress, GpeBlockAddress,
- sizeof (ACPI_GENERIC_ADDRESS));
-
/*
* Create the RegisterInfo and EventInfo sub-structures
* Note: disables and clears all GPEs in the block
@@ -446,11 +445,11 @@ AcpiEvCreateGpeBlock (
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
- " Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X\n",
+ " Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X%s\n",
(UINT32) GpeBlock->BlockBaseNumber,
(UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1)),
- GpeDevice->Name.Ascii, GpeBlock->RegisterCount,
- InterruptNumber));
+ GpeDevice->Name.Ascii, GpeBlock->RegisterCount, InterruptNumber,
+ InterruptNumber == AcpiGbl_FADT.SciInterrupt ? " (SCI)" : ""));
/* Update global count of currently available GPEs */
@@ -519,8 +518,9 @@ AcpiEvInitializeGpeBlock (
* Ignore GPEs that have no corresponding _Lxx/_Exx method
* and GPEs that are used to wake the system
*/
- if (((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == ACPI_GPE_DISPATCH_NONE) ||
- ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == ACPI_GPE_DISPATCH_HANDLER) ||
+ if ((ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == ACPI_GPE_DISPATCH_NONE) ||
+ (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == ACPI_GPE_DISPATCH_HANDLER) ||
+ (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == ACPI_GPE_DISPATCH_RAW_HANDLER) ||
(GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE))
{
continue;
diff --git a/sys/contrib/dev/acpica/components/events/evgpeinit.c b/sys/contrib/dev/acpica/components/events/evgpeinit.c
index 8c74149..0e53a1d 100644
--- a/sys/contrib/dev/acpica/components/events/evgpeinit.c
+++ b/sys/contrib/dev/acpica/components/events/evgpeinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acevents.h>
@@ -139,7 +138,9 @@ AcpiEvGpeInitialize (
/* Install GPE Block 0 */
Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
- &AcpiGbl_FADT.XGpe0Block, RegisterCount0, 0,
+ AcpiGbl_FADT.XGpe0Block.Address,
+ AcpiGbl_FADT.XGpe0Block.SpaceId,
+ RegisterCount0, 0,
AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[0]);
if (ACPI_FAILURE (Status))
@@ -177,7 +178,9 @@ AcpiEvGpeInitialize (
/* Install GPE Block 1 */
Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
- &AcpiGbl_FADT.XGpe1Block, RegisterCount1,
+ AcpiGbl_FADT.XGpe1Block.Address,
+ AcpiGbl_FADT.XGpe1Block.SpaceId,
+ RegisterCount1,
AcpiGbl_FADT.Gpe1Base,
AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[1]);
@@ -416,15 +419,17 @@ AcpiEvMatchGpeMethod (
return_ACPI_STATUS (AE_OK);
}
- if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
- ACPI_GPE_DISPATCH_HANDLER)
+ if ((ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
+ ACPI_GPE_DISPATCH_HANDLER) ||
+ (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
+ ACPI_GPE_DISPATCH_RAW_HANDLER))
{
/* If there is already a handler, ignore this GPE method */
return_ACPI_STATUS (AE_OK);
}
- if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
+ if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
ACPI_GPE_DISPATCH_METHOD)
{
/*
@@ -440,6 +445,10 @@ AcpiEvMatchGpeMethod (
return_ACPI_STATUS (AE_OK);
}
+ /* Disable the GPE in case it's been enabled already. */
+
+ (void) AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
+
/*
* Add the GPE information from above to the GpeEventInfo block for
* use during dispatch of this GPE.
diff --git a/sys/contrib/dev/acpica/components/events/evgpeutil.c b/sys/contrib/dev/acpica/components/events/evgpeutil.c
index 35caa5a..1f03859 100644
--- a/sys/contrib/dev/acpica/components/events/evgpeutil.c
+++ b/sys/contrib/dev/acpica/components/events/evgpeutil.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -115,60 +115,6 @@ UnlockAndExit:
/*******************************************************************************
*
- * FUNCTION: AcpiEvValidGpeEvent
- *
- * PARAMETERS: GpeEventInfo - Info for this GPE
- *
- * RETURN: TRUE if the GpeEvent is valid
- *
- * DESCRIPTION: Validate a GPE event. DO NOT CALL FROM INTERRUPT LEVEL.
- * Should be called only when the GPE lists are semaphore locked
- * and not subject to change.
- *
- ******************************************************************************/
-
-BOOLEAN
-AcpiEvValidGpeEvent (
- ACPI_GPE_EVENT_INFO *GpeEventInfo)
-{
- ACPI_GPE_XRUPT_INFO *GpeXruptBlock;
- ACPI_GPE_BLOCK_INFO *GpeBlock;
-
-
- ACPI_FUNCTION_ENTRY ();
-
-
- /* No need for spin lock since we are not changing any list elements */
-
- /* Walk the GPE interrupt levels */
-
- GpeXruptBlock = AcpiGbl_GpeXruptListHead;
- while (GpeXruptBlock)
- {
- GpeBlock = GpeXruptBlock->GpeBlockListHead;
-
- /* Walk the GPE blocks on this interrupt level */
-
- while (GpeBlock)
- {
- if ((&GpeBlock->EventInfo[0] <= GpeEventInfo) &&
- (&GpeBlock->EventInfo[GpeBlock->GpeCount] > GpeEventInfo))
- {
- return (TRUE);
- }
-
- GpeBlock = GpeBlock->Next;
- }
-
- GpeXruptBlock = GpeXruptBlock->Next;
- }
-
- return (FALSE);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiEvGetGpeDevice
*
* PARAMETERS: GPE_WALK_CALLBACK
@@ -217,8 +163,9 @@ AcpiEvGetGpeDevice (
* FUNCTION: AcpiEvGetGpeXruptBlock
*
* PARAMETERS: InterruptNumber - Interrupt for a GPE block
+ * GpeXruptBlock - Where the block is returned
*
- * RETURN: A GPE interrupt block
+ * RETURN: Status
*
* DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt
* block per unique interrupt level used for GPEs. Should be
@@ -227,9 +174,10 @@ AcpiEvGetGpeDevice (
*
******************************************************************************/
-ACPI_GPE_XRUPT_INFO *
+ACPI_STATUS
AcpiEvGetGpeXruptBlock (
- UINT32 InterruptNumber)
+ UINT32 InterruptNumber,
+ ACPI_GPE_XRUPT_INFO **GpeXruptBlock)
{
ACPI_GPE_XRUPT_INFO *NextGpeXrupt;
ACPI_GPE_XRUPT_INFO *GpeXrupt;
@@ -247,7 +195,8 @@ AcpiEvGetGpeXruptBlock (
{
if (NextGpeXrupt->InterruptNumber == InterruptNumber)
{
- return_PTR (NextGpeXrupt);
+ *GpeXruptBlock = NextGpeXrupt;
+ return_ACPI_STATUS (AE_OK);
}
NextGpeXrupt = NextGpeXrupt->Next;
@@ -258,7 +207,7 @@ AcpiEvGetGpeXruptBlock (
GpeXrupt = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_XRUPT_INFO));
if (!GpeXrupt)
{
- return_PTR (NULL);
+ return_ACPI_STATUS (AE_NO_MEMORY);
}
GpeXrupt->InterruptNumber = InterruptNumber;
@@ -281,6 +230,7 @@ AcpiEvGetGpeXruptBlock (
{
AcpiGbl_GpeXruptListHead = GpeXrupt;
}
+
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
/* Install new interrupt handler if not SCI_INT */
@@ -291,14 +241,15 @@ AcpiEvGetGpeXruptBlock (
AcpiEvGpeXruptHandler, GpeXrupt);
if (ACPI_FAILURE (Status))
{
- ACPI_ERROR ((AE_INFO,
+ ACPI_EXCEPTION ((AE_INFO, Status,
"Could not install GPE interrupt handler at level 0x%X",
InterruptNumber));
- return_PTR (NULL);
+ return_ACPI_STATUS (Status);
}
}
- return_PTR (GpeXrupt);
+ *GpeXruptBlock = GpeXrupt;
+ return_ACPI_STATUS (AE_OK);
}
@@ -411,8 +362,10 @@ AcpiEvDeleteGpeHandlers (
GpeEventInfo = &GpeBlock->EventInfo[((ACPI_SIZE) i *
ACPI_GPE_REGISTER_WIDTH) + j];
- if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
- ACPI_GPE_DISPATCH_HANDLER)
+ if ((ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
+ ACPI_GPE_DISPATCH_HANDLER) ||
+ (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
+ ACPI_GPE_DISPATCH_RAW_HANDLER))
{
/* Delete an installed handler block */
@@ -420,7 +373,7 @@ AcpiEvDeleteGpeHandlers (
GpeEventInfo->Dispatch.Handler = NULL;
GpeEventInfo->Flags &= ~ACPI_GPE_DISPATCH_MASK;
}
- else if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
+ else if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
ACPI_GPE_DISPATCH_NOTIFY)
{
/* Delete the implicit notification device list */
diff --git a/sys/contrib/dev/acpica/components/events/evhandler.c b/sys/contrib/dev/acpica/components/events/evhandler.c
index cb03bc9..419936b 100644
--- a/sys/contrib/dev/acpica/components/events/evhandler.c
+++ b/sys/contrib/dev/acpica/components/events/evhandler.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __EVHANDLER_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acevents.h>
diff --git a/sys/contrib/dev/acpica/components/events/evmisc.c b/sys/contrib/dev/acpica/components/events/evmisc.c
index 547534b..b178543 100644
--- a/sys/contrib/dev/acpica/components/events/evmisc.c
+++ b/sys/contrib/dev/acpica/components/events/evmisc.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -181,7 +181,7 @@ AcpiEvQueueNotifyRequest (
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Dispatching Notify on [%4.4s] (%s) Value 0x%2.2X (%s) Node %p\n",
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type),
- NotifyValue, AcpiUtGetNotifyName (NotifyValue), Node));
+ NotifyValue, AcpiUtGetNotifyName (NotifyValue, ACPI_TYPE_ANY), Node));
Status = AcpiOsExecute (OSL_NOTIFY_HANDLER, AcpiEvNotifyDispatch,
Info);
diff --git a/sys/contrib/dev/acpica/components/events/evregion.c b/sys/contrib/dev/acpica/components/events/evregion.c
index d469d6e..19ceb26 100644
--- a/sys/contrib/dev/acpica/components/events/evregion.c
+++ b/sys/contrib/dev/acpica/components/events/evregion.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __EVREGION_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acevents.h>
@@ -159,6 +156,7 @@ AcpiEvAddressSpaceDispatch (
ACPI_OPERAND_OBJECT *RegionObj2;
void *RegionContext = NULL;
ACPI_CONNECTION_INFO *Context;
+ ACPI_PHYSICAL_ADDRESS Address;
ACPI_FUNCTION_TRACE (EvAddressSpaceDispatch);
@@ -248,23 +246,33 @@ AcpiEvAddressSpaceDispatch (
/* We have everything we need, we can invoke the address space handler */
Handler = HandlerDesc->AddressSpace.Handler;
-
- ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
- "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
- &RegionObj->Region.Handler->AddressSpace, Handler,
- ACPI_FORMAT_NATIVE_UINT (RegionObj->Region.Address + RegionOffset),
- AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
+ Address = (RegionObj->Region.Address + RegionOffset);
/*
* Special handling for GenericSerialBus and GeneralPurposeIo:
* There are three extra parameters that must be passed to the
* handler via the context:
- * 1) Connection buffer, a resource template from Connection() op.
- * 2) Length of the above buffer.
- * 3) Actual access length from the AccessAs() op.
+ * 1) Connection buffer, a resource template from Connection() op
+ * 2) Length of the above buffer
+ * 3) Actual access length from the AccessAs() op
+ *
+ * In addition, for GeneralPurposeIo, the Address and BitWidth fields
+ * are defined as follows:
+ * 1) Address is the pin number index of the field (bit offset from
+ * the previous Connection)
+ * 2) BitWidth is the actual bit length of the field (number of pins)
*/
- if (((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) ||
- (RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO)) &&
+ if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) &&
+ Context &&
+ FieldObj)
+ {
+ /* Get the Connection (ResourceTemplate) buffer */
+
+ Context->Connection = FieldObj->Field.ResourceBuffer;
+ Context->Length = FieldObj->Field.ResourceLength;
+ Context->AccessLength = FieldObj->Field.AccessLength;
+ }
+ if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO) &&
Context &&
FieldObj)
{
@@ -273,8 +281,16 @@ AcpiEvAddressSpaceDispatch (
Context->Connection = FieldObj->Field.ResourceBuffer;
Context->Length = FieldObj->Field.ResourceLength;
Context->AccessLength = FieldObj->Field.AccessLength;
+ Address = FieldObj->Field.PinNumberIndex;
+ BitWidth = FieldObj->Field.BitLength;
}
+ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
+ "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
+ &RegionObj->Region.Handler->AddressSpace, Handler,
+ ACPI_FORMAT_NATIVE_UINT (Address),
+ AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
+
if (!(HandlerDesc->AddressSpace.HandlerFlags &
ACPI_ADDR_HANDLER_DEFAULT_INSTALLED))
{
@@ -288,9 +304,8 @@ AcpiEvAddressSpaceDispatch (
/* Call the handler */
- Status = Handler (Function,
- (RegionObj->Region.Address + RegionOffset), BitWidth, Value,
- Context, RegionObj2->Extra.RegionContext);
+ Status = Handler (Function, Address, BitWidth, Value, Context,
+ RegionObj2->Extra.RegionContext);
if (ACPI_FAILURE (Status))
{
@@ -333,6 +348,7 @@ AcpiEvDetachRegion(
{
ACPI_OPERAND_OBJECT *HandlerObj;
ACPI_OPERAND_OBJECT *ObjDesc;
+ ACPI_OPERAND_OBJECT *StartDesc;
ACPI_OPERAND_OBJECT **LastObjPtr;
ACPI_ADR_SPACE_SETUP RegionSetup;
void **RegionContext;
@@ -363,6 +379,7 @@ AcpiEvDetachRegion(
/* Find this region in the handler's list */
ObjDesc = HandlerObj->AddressSpace.RegionList;
+ StartDesc = ObjDesc;
LastObjPtr = &HandlerObj->AddressSpace.RegionList;
while (ObjDesc)
@@ -457,6 +474,16 @@ AcpiEvDetachRegion(
LastObjPtr = &ObjDesc->Region.Next;
ObjDesc = ObjDesc->Region.Next;
+
+ /* Prevent infinite loop if list is corrupted */
+
+ if (ObjDesc == StartDesc)
+ {
+ ACPI_ERROR ((AE_INFO,
+ "Circular handler list in region object %p",
+ RegionObj));
+ return_VOID;
+ }
}
/* If we get here, the region was not in the handler's region list */
diff --git a/sys/contrib/dev/acpica/components/events/evrgnini.c b/sys/contrib/dev/acpica/components/events/evrgnini.c
index 5a9e9e8..2984e8c 100644
--- a/sys/contrib/dev/acpica/components/events/evrgnini.c
+++ b/sys/contrib/dev/acpica/components/events/evrgnini.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __EVRGNINI_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acevents.h>
diff --git a/sys/contrib/dev/acpica/components/events/evsci.c b/sys/contrib/dev/acpica/components/events/evsci.c
index 4fa84f3..70920a5 100644
--- a/sys/contrib/dev/acpica/components/events/evsci.c
+++ b/sys/contrib/dev/acpica/components/events/evsci.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -135,7 +135,7 @@ AcpiEvSciXruptHandler (
/*
- * We are guaranteed by the ACPI CA initialization/shutdown code that
+ * We are guaranteed by the ACPICA initialization/shutdown code that
* if this interrupt handler is installed, ACPI is enabled.
*/
diff --git a/sys/contrib/dev/acpica/components/events/evxface.c b/sys/contrib/dev/acpica/components/events/evxface.c
index 4ed3247..6a4b254 100644
--- a/sys/contrib/dev/acpica/components/events/evxface.c
+++ b/sys/contrib/dev/acpica/components/events/evxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __EVXFACE_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -53,6 +52,21 @@
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evxface")
+#if (!ACPI_REDUCED_HARDWARE)
+
+/* Local prototypes */
+
+static ACPI_STATUS
+AcpiEvInstallGpeHandler (
+ ACPI_HANDLE GpeDevice,
+ UINT32 GpeNumber,
+ UINT32 Type,
+ BOOLEAN IsRawHandler,
+ ACPI_GPE_HANDLER Address,
+ void *Context);
+
+#endif
+
/*******************************************************************************
*
@@ -265,7 +279,7 @@ AcpiRemoveNotifyHandler (
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_OPERAND_OBJECT *HandlerObj;
ACPI_OPERAND_OBJECT *PreviousHandlerObj;
- ACPI_STATUS Status;
+ ACPI_STATUS Status = AE_OK;
UINT32 i;
@@ -280,16 +294,6 @@ AcpiRemoveNotifyHandler (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- /* Make sure all deferred notify tasks are completed */
-
- AcpiOsWaitEventsComplete ();
-
- Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
/* Root Object. Global handlers are removed here */
if (Device == ACPI_ROOT_OBJECT)
@@ -298,6 +302,12 @@ AcpiRemoveNotifyHandler (
{
if (HandlerType & (i+1))
{
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
if (!AcpiGbl_GlobalNotify[i].Handler ||
(AcpiGbl_GlobalNotify[i].Handler != Handler))
{
@@ -310,18 +320,23 @@ AcpiRemoveNotifyHandler (
AcpiGbl_GlobalNotify[i].Handler = NULL;
AcpiGbl_GlobalNotify[i].Context = NULL;
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+
+ /* Make sure all deferred notify tasks are completed */
+
+ AcpiOsWaitEventsComplete ();
}
}
- goto UnlockAndExit;
+ return_ACPI_STATUS (AE_OK);
}
/* All other objects: Are Notifies allowed on this object? */
if (!AcpiEvIsNotifyObject (Node))
{
- Status = AE_TYPE;
- goto UnlockAndExit;
+ return_ACPI_STATUS (AE_TYPE);
}
/* Must have an existing internal object */
@@ -329,8 +344,7 @@ AcpiRemoveNotifyHandler (
ObjDesc = AcpiNsGetAttachedObject (Node);
if (!ObjDesc)
{
- Status = AE_NOT_EXIST;
- goto UnlockAndExit;
+ return_ACPI_STATUS (AE_NOT_EXIST);
}
/* Internal object exists. Find the handler and remove it */
@@ -339,6 +353,12 @@ AcpiRemoveNotifyHandler (
{
if (HandlerType & (i+1))
{
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
HandlerObj = ObjDesc->CommonNotify.NotifyList[i];
PreviousHandlerObj = NULL;
@@ -370,10 +390,17 @@ AcpiRemoveNotifyHandler (
HandlerObj->Notify.Next[i];
}
+ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+
+ /* Make sure all deferred notify tasks are completed */
+
+ AcpiOsWaitEventsComplete ();
AcpiUtRemoveReference (HandlerObj);
}
}
+ return_ACPI_STATUS (Status);
+
UnlockAndExit:
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
@@ -519,6 +546,8 @@ Exit:
return_ACPI_STATUS (Status);
}
+ACPI_EXPORT_SYMBOL (AcpiInstallSciHandler)
+
/*******************************************************************************
*
@@ -595,6 +624,8 @@ UnlockAndExit:
return_ACPI_STATUS (Status);
}
+ACPI_EXPORT_SYMBOL (AcpiRemoveSciHandler)
+
/*******************************************************************************
*
@@ -806,27 +837,31 @@ ACPI_EXPORT_SYMBOL (AcpiRemoveFixedEventHandler)
/*******************************************************************************
*
- * FUNCTION: AcpiInstallGpeHandler
+ * FUNCTION: AcpiEvInstallGpeHandler
*
* PARAMETERS: GpeDevice - Namespace node for the GPE (NULL for FADT
* defined GPEs)
* GpeNumber - The GPE number within the GPE block
* Type - Whether this GPE should be treated as an
* edge- or level-triggered interrupt.
+ * IsRawHandler - Whether this GPE should be handled using
+ * the special GPE handler mode.
* Address - Address of the handler
* Context - Value passed to the handler on each GPE
*
* RETURN: Status
*
- * DESCRIPTION: Install a handler for a General Purpose Event.
+ * DESCRIPTION: Internal function to install a handler for a General Purpose
+ * Event.
*
******************************************************************************/
-ACPI_STATUS
-AcpiInstallGpeHandler (
+static ACPI_STATUS
+AcpiEvInstallGpeHandler (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
UINT32 Type,
+ BOOLEAN IsRawHandler,
ACPI_GPE_HANDLER Address,
void *Context)
{
@@ -836,7 +871,7 @@ AcpiInstallGpeHandler (
ACPI_CPU_FLAGS Flags;
- ACPI_FUNCTION_TRACE (AcpiInstallGpeHandler);
+ ACPI_FUNCTION_TRACE (EvInstallGpeHandler);
/* Parameter validation */
@@ -874,8 +909,10 @@ AcpiInstallGpeHandler (
/* Make sure that there isn't a handler there already */
- if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
- ACPI_GPE_DISPATCH_HANDLER)
+ if ((ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
+ ACPI_GPE_DISPATCH_HANDLER) ||
+ (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
+ ACPI_GPE_DISPATCH_RAW_HANDLER))
{
Status = AE_ALREADY_EXISTS;
goto FreeAndExit;
@@ -892,8 +929,10 @@ AcpiInstallGpeHandler (
* automatically during initialization, in which case it has to be
* disabled now to avoid spurious execution of the handler.
*/
- if (((Handler->OriginalFlags & ACPI_GPE_DISPATCH_METHOD) ||
- (Handler->OriginalFlags & ACPI_GPE_DISPATCH_NOTIFY)) &&
+ if (((ACPI_GPE_DISPATCH_TYPE (Handler->OriginalFlags) ==
+ ACPI_GPE_DISPATCH_METHOD) ||
+ (ACPI_GPE_DISPATCH_TYPE (Handler->OriginalFlags) ==
+ ACPI_GPE_DISPATCH_NOTIFY)) &&
GpeEventInfo->RuntimeCount)
{
Handler->OriginallyEnabled = TRUE;
@@ -914,7 +953,8 @@ AcpiInstallGpeHandler (
/* Setup up dispatch flags to indicate handler (vs. method/notify) */
GpeEventInfo->Flags &= ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK);
- GpeEventInfo->Flags |= (UINT8) (Type | ACPI_GPE_DISPATCH_HANDLER);
+ GpeEventInfo->Flags |= (UINT8) (Type | (IsRawHandler ?
+ ACPI_GPE_DISPATCH_RAW_HANDLER : ACPI_GPE_DISPATCH_HANDLER));
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
@@ -929,11 +969,91 @@ FreeAndExit:
goto UnlockAndExit;
}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiInstallGpeHandler
+ *
+ * PARAMETERS: GpeDevice - Namespace node for the GPE (NULL for FADT
+ * defined GPEs)
+ * GpeNumber - The GPE number within the GPE block
+ * Type - Whether this GPE should be treated as an
+ * edge- or level-triggered interrupt.
+ * Address - Address of the handler
+ * Context - Value passed to the handler on each GPE
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Install a handler for a General Purpose Event.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiInstallGpeHandler (
+ ACPI_HANDLE GpeDevice,
+ UINT32 GpeNumber,
+ UINT32 Type,
+ ACPI_GPE_HANDLER Address,
+ void *Context)
+{
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_TRACE (AcpiInstallGpeHandler);
+
+
+ Status = AcpiEvInstallGpeHandler (GpeDevice, GpeNumber, Type, FALSE,
+ Address, Context);
+
+ return_ACPI_STATUS (Status);
+}
+
ACPI_EXPORT_SYMBOL (AcpiInstallGpeHandler)
/*******************************************************************************
*
+ * FUNCTION: AcpiInstallGpeRawHandler
+ *
+ * PARAMETERS: GpeDevice - Namespace node for the GPE (NULL for FADT
+ * defined GPEs)
+ * GpeNumber - The GPE number within the GPE block
+ * Type - Whether this GPE should be treated as an
+ * edge- or level-triggered interrupt.
+ * Address - Address of the handler
+ * Context - Value passed to the handler on each GPE
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Install a handler for a General Purpose Event.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiInstallGpeRawHandler (
+ ACPI_HANDLE GpeDevice,
+ UINT32 GpeNumber,
+ UINT32 Type,
+ ACPI_GPE_HANDLER Address,
+ void *Context)
+{
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_TRACE (AcpiInstallGpeRawHandler);
+
+
+ Status = AcpiEvInstallGpeHandler (GpeDevice, GpeNumber, Type, TRUE,
+ Address, Context);
+
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiInstallGpeRawHandler)
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiRemoveGpeHandler
*
* PARAMETERS: GpeDevice - Namespace node for the GPE (NULL for FADT
@@ -969,10 +1089,6 @@ AcpiRemoveGpeHandler (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- /* Make sure all deferred GPE tasks are completed */
-
- AcpiOsWaitEventsComplete ();
-
Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
if (ACPI_FAILURE (Status))
{
@@ -992,8 +1108,10 @@ AcpiRemoveGpeHandler (
/* Make sure that a handler is indeed installed */
- if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) !=
- ACPI_GPE_DISPATCH_HANDLER)
+ if ((ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) !=
+ ACPI_GPE_DISPATCH_HANDLER) &&
+ (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) !=
+ ACPI_GPE_DISPATCH_RAW_HANDLER))
{
Status = AE_NOT_EXIST;
goto UnlockAndExit;
@@ -1010,6 +1128,7 @@ AcpiRemoveGpeHandler (
/* Remove the handler */
Handler = GpeEventInfo->Dispatch.Handler;
+ GpeEventInfo->Dispatch.Handler = NULL;
/* Restore Method node (if any), set dispatch flags */
@@ -1023,16 +1142,26 @@ AcpiRemoveGpeHandler (
* enabled, it should be enabled at this point to restore the
* post-initialization configuration.
*/
- if ((Handler->OriginalFlags & ACPI_GPE_DISPATCH_METHOD) &&
+ if (((ACPI_GPE_DISPATCH_TYPE (Handler->OriginalFlags) ==
+ ACPI_GPE_DISPATCH_METHOD) ||
+ (ACPI_GPE_DISPATCH_TYPE (Handler->OriginalFlags) ==
+ ACPI_GPE_DISPATCH_NOTIFY)) &&
Handler->OriginallyEnabled)
{
(void) AcpiEvAddGpeReference (GpeEventInfo);
}
+ AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+ (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
+
+ /* Make sure all deferred GPE tasks are completed */
+
+ AcpiOsWaitEventsComplete ();
+
/* Now we can free the handler object */
ACPI_FREE (Handler);
-
+ return_ACPI_STATUS (Status);
UnlockAndExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
diff --git a/sys/contrib/dev/acpica/components/events/evxfevnt.c b/sys/contrib/dev/acpica/components/events/evxfevnt.c
index eb17a3f..08507b3 100644
--- a/sys/contrib/dev/acpica/components/events/evxfevnt.c
+++ b/sys/contrib/dev/acpica/components/events/evxfevnt.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __EVXFEVNT_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -364,7 +363,9 @@ AcpiGetEventStatus (
UINT32 Event,
ACPI_EVENT_STATUS *EventStatus)
{
- ACPI_STATUS Status = AE_OK;
+ ACPI_STATUS Status;
+ ACPI_EVENT_STATUS LocalEventStatus = 0;
+ UINT32 InByte;
ACPI_FUNCTION_TRACE (AcpiGetEventStatus);
@@ -382,12 +383,43 @@ AcpiGetEventStatus (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- /* Get the status of the requested fixed event */
+ /* Fixed event currently can be dispatched? */
+
+ if (AcpiGbl_FixedEventHandlers[Event].Handler)
+ {
+ LocalEventStatus |= ACPI_EVENT_FLAG_HAS_HANDLER;
+ }
+
+ /* Fixed event currently enabled? */
Status = AcpiReadBitRegister (
- AcpiGbl_FixedEventInfo[Event].StatusRegisterId, EventStatus);
+ AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &InByte);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
- return_ACPI_STATUS (Status);
+ if (InByte)
+ {
+ LocalEventStatus |= ACPI_EVENT_FLAG_ENABLED;
+ }
+
+ /* Fixed event currently active? */
+
+ Status = AcpiReadBitRegister (
+ AcpiGbl_FixedEventInfo[Event].StatusRegisterId, &InByte);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ if (InByte)
+ {
+ LocalEventStatus |= ACPI_EVENT_FLAG_SET;
+ }
+
+ (*EventStatus) = LocalEventStatus;
+ return_ACPI_STATUS (AE_OK);
}
ACPI_EXPORT_SYMBOL (AcpiGetEventStatus)
diff --git a/sys/contrib/dev/acpica/components/events/evxfgpe.c b/sys/contrib/dev/acpica/components/events/evxfgpe.c
index 0a40bd9..f09d56a 100644
--- a/sys/contrib/dev/acpica/components/events/evxfgpe.c
+++ b/sys/contrib/dev/acpica/components/events/evxfgpe.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __EVXFGPE_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -140,12 +139,23 @@ AcpiEnableGpe (
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
- /* Ensure that we have a valid GPE number */
-
+ /*
+ * Ensure that we have a valid GPE number and that there is some way
+ * of handling the GPE (handler or a GPE method). In other words, we
+ * won't allow a valid GPE to be enabled if there is no way to handle it.
+ */
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (GpeEventInfo)
{
- Status = AcpiEvAddGpeReference (GpeEventInfo);
+ if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) !=
+ ACPI_GPE_DISPATCH_NONE)
+ {
+ Status = AcpiEvAddGpeReference (GpeEventInfo);
+ }
+ else
+ {
+ Status = AE_NO_HANDLER;
+ }
}
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
@@ -211,12 +221,21 @@ ACPI_EXPORT_SYMBOL (AcpiDisableGpe)
* RETURN: Status
*
* DESCRIPTION: Enable or disable an individual GPE. This function bypasses
- * the reference count mechanism used in the AcpiEnableGpe and
- * AcpiDisableGpe interfaces -- and should be used with care.
- *
- * Note: Typically used to disable a runtime GPE for short period of time,
- * then re-enable it, without disturbing the existing reference counts. This
- * is useful, for example, in the Embedded Controller (EC) driver.
+ * the reference count mechanism used in the AcpiEnableGpe(),
+ * AcpiDisableGpe() interfaces.
+ * This API is typically used by the GPE raw handler mode driver
+ * to switch between the polling mode and the interrupt mode after
+ * the driver has enabled the GPE.
+ * The APIs should be invoked in this order:
+ * AcpiEnableGpe() <- Ensure the reference count > 0
+ * AcpiSetGpe(ACPI_GPE_DISABLE) <- Enter polling mode
+ * AcpiSetGpe(ACPI_GPE_ENABLE) <- Leave polling mode
+ * AcpiDisableGpe() <- Decrease the reference count
+ *
+ * Note: If a GPE is shared by 2 silicon components, then both the drivers
+ * should support GPE polling mode or disabling the GPE for long period
+ * for one driver may break the other. So use it with care since all
+ * firmware _Lxx/_Exx handlers currently rely on the GPE interrupt mode.
*
******************************************************************************/
@@ -251,7 +270,7 @@ AcpiSetGpe (
{
case ACPI_GPE_ENABLE:
- Status = AcpiEvEnableGpe (GpeEventInfo);
+ Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE);
break;
case ACPI_GPE_DISABLE:
@@ -275,6 +294,60 @@ ACPI_EXPORT_SYMBOL (AcpiSetGpe)
/*******************************************************************************
*
+ * FUNCTION: AcpiMarkGpeForWake
+ *
+ * PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
+ * GpeNumber - GPE level within the GPE block
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Mark a GPE as having the ability to wake the system. Simply
+ * sets the ACPI_GPE_CAN_WAKE flag.
+ *
+ * Some potential callers of AcpiSetupGpeForWake may know in advance that
+ * there won't be any notify handlers installed for device wake notifications
+ * from the given GPE (one example is a button GPE in Linux). For these cases,
+ * AcpiMarkGpeForWake should be used instead of AcpiSetupGpeForWake.
+ * This will set the ACPI_GPE_CAN_WAKE flag for the GPE without trying to
+ * setup implicit wake notification for it (since there's no handler method).
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiMarkGpeForWake (
+ ACPI_HANDLE GpeDevice,
+ UINT32 GpeNumber)
+{
+ ACPI_GPE_EVENT_INFO *GpeEventInfo;
+ ACPI_STATUS Status = AE_BAD_PARAMETER;
+ ACPI_CPU_FLAGS Flags;
+
+
+ ACPI_FUNCTION_TRACE (AcpiMarkGpeForWake);
+
+
+ Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
+
+ /* Ensure that we have a valid GPE number */
+
+ GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
+ if (GpeEventInfo)
+ {
+ /* Mark the GPE as a possible wake event */
+
+ GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE;
+ Status = AE_OK;
+ }
+
+ AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiMarkGpeForWake)
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiSetupGpeForWake
*
* PARAMETERS: WakeDevice - Device associated with the GPE (via _PRW)
@@ -366,7 +439,7 @@ AcpiSetupGpeForWake (
* known as an "implicit notify". Note: The GPE is assumed to be
* level-triggered (for windows compatibility).
*/
- if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
+ if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
ACPI_GPE_DISPATCH_NONE)
{
/*
@@ -381,7 +454,7 @@ AcpiSetupGpeForWake (
* If we already have an implicit notify on this GPE, add
* this device to the notify list.
*/
- if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
+ if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
ACPI_GPE_DISPATCH_NOTIFY)
{
/* Ensure that the device is not already in the list */
@@ -738,6 +811,44 @@ AcpiEnableAllRuntimeGpes (
ACPI_EXPORT_SYMBOL (AcpiEnableAllRuntimeGpes)
+/******************************************************************************
+ *
+ * FUNCTION: AcpiEnableAllWakeupGpes
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Enable all "wakeup" GPEs and disable all of the other GPEs, in
+ * all GPE blocks.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiEnableAllWakeupGpes (
+ void)
+{
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_TRACE (AcpiEnableAllWakeupGpes);
+
+
+ Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ Status = AcpiHwEnableAllWakeupGpes ();
+ (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
+
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiEnableAllWakeupGpes)
+
+
/*******************************************************************************
*
* FUNCTION: AcpiInstallGpeBlock
@@ -790,11 +901,26 @@ AcpiInstallGpeBlock (
goto UnlockAndExit;
}
+ /* Validate the parent device */
+
+ if (Node->Type != ACPI_TYPE_DEVICE)
+ {
+ Status = AE_TYPE;
+ goto UnlockAndExit;
+ }
+
+ if (Node->Object)
+ {
+ Status = AE_ALREADY_EXISTS;
+ goto UnlockAndExit;
+ }
+
/*
* For user-installed GPE Block Devices, the GpeBlockBaseNumber
* is always zero
*/
- Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress, RegisterCount,
+ Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress->Address,
+ GpeBlockAddress->SpaceId, RegisterCount,
0, InterruptNumber, &GpeBlock);
if (ACPI_FAILURE (Status))
{
@@ -883,6 +1009,14 @@ AcpiRemoveGpeBlock (
goto UnlockAndExit;
}
+ /* Validate the parent device */
+
+ if (Node->Type != ACPI_TYPE_DEVICE)
+ {
+ Status = AE_TYPE;
+ goto UnlockAndExit;
+ }
+
/* Get the DeviceObject attached to the node */
ObjDesc = AcpiNsGetAttachedObject (Node);
diff --git a/sys/contrib/dev/acpica/components/events/evxfregn.c b/sys/contrib/dev/acpica/components/events/evxfregn.c
index 432657d..8b0d80e 100644
--- a/sys/contrib/dev/acpica/components/events/evxfregn.c
+++ b/sys/contrib/dev/acpica/components/events/evxfregn.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,7 +42,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EVXFREGN_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exconfig.c b/sys/contrib/dev/acpica/components/executer/exconfig.c
index 2306e83..0627f99 100644
--- a/sys/contrib/dev/acpica/components/executer/exconfig.c
+++ b/sys/contrib/dev/acpica/components/executer/exconfig.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXCONFIG_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acinterp.h>
@@ -380,8 +378,8 @@ AcpiExLoadOp (
ACPI_WALK_STATE *WalkState)
{
ACPI_OPERAND_OBJECT *DdbHandle;
+ ACPI_TABLE_HEADER *TableHeader;
ACPI_TABLE_HEADER *Table;
- ACPI_TABLE_DESC TableDesc;
UINT32 TableIndex;
ACPI_STATUS Status;
UINT32 Length;
@@ -390,8 +388,6 @@ AcpiExLoadOp (
ACPI_FUNCTION_TRACE (ExLoadOp);
- ACPI_MEMSET (&TableDesc, 0, sizeof (ACPI_TABLE_DESC));
-
/* Source Object can be either an OpRegion or a Buffer/Field */
switch (ObjDesc->Common.Type)
@@ -423,16 +419,16 @@ AcpiExLoadOp (
/* Get the table header first so we can get the table length */
- Table = ACPI_ALLOCATE (sizeof (ACPI_TABLE_HEADER));
- if (!Table)
+ TableHeader = ACPI_ALLOCATE (sizeof (ACPI_TABLE_HEADER));
+ if (!TableHeader)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
Status = AcpiExRegionRead (ObjDesc, sizeof (ACPI_TABLE_HEADER),
- ACPI_CAST_PTR (UINT8, Table));
- Length = Table->Length;
- ACPI_FREE (Table);
+ ACPI_CAST_PTR (UINT8, TableHeader));
+ Length = TableHeader->Length;
+ ACPI_FREE (TableHeader);
if (ACPI_FAILURE (Status))
{
@@ -464,8 +460,8 @@ AcpiExLoadOp (
/* Allocate a buffer for the table */
- TableDesc.Pointer = ACPI_ALLOCATE (Length);
- if (!TableDesc.Pointer)
+ Table = ACPI_ALLOCATE (Length);
+ if (!Table)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
@@ -473,14 +469,12 @@ AcpiExLoadOp (
/* Read the entire table */
Status = AcpiExRegionRead (ObjDesc, Length,
- ACPI_CAST_PTR (UINT8, TableDesc.Pointer));
+ ACPI_CAST_PTR (UINT8, Table));
if (ACPI_FAILURE (Status))
{
- ACPI_FREE (TableDesc.Pointer);
+ ACPI_FREE (Table);
return_ACPI_STATUS (Status);
}
-
- TableDesc.Address = ObjDesc->Region.Address;
break;
case ACPI_TYPE_BUFFER: /* Buffer or resolved RegionField */
@@ -497,8 +491,8 @@ AcpiExLoadOp (
/* Get the actual table length from the table header */
- Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ObjDesc->Buffer.Pointer);
- Length = Table->Length;
+ TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ObjDesc->Buffer.Pointer);
+ Length = TableHeader->Length;
/* Table cannot extend beyond the buffer */
@@ -515,14 +509,13 @@ AcpiExLoadOp (
* Copy the table from the buffer because the buffer could be modified
* or even deleted in the future
*/
- TableDesc.Pointer = ACPI_ALLOCATE (Length);
- if (!TableDesc.Pointer)
+ Table = ACPI_ALLOCATE (Length);
+ if (!Table)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
- ACPI_MEMCPY (TableDesc.Pointer, Table, Length);
- TableDesc.Address = ACPI_TO_INTEGER (TableDesc.Pointer);
+ ACPI_MEMCPY (Table, TableHeader, Length);
break;
default:
@@ -530,28 +523,31 @@ AcpiExLoadOp (
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
- /* Validate table checksum (will not get validated in TbAddTable) */
+ /* Install the new table into the local data structures */
+
+ ACPI_INFO ((AE_INFO, "Dynamic OEM Table Load:"));
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
- Status = AcpiTbVerifyChecksum (TableDesc.Pointer, Length);
+ Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table),
+ ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, TRUE, TRUE,
+ &TableIndex);
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
if (ACPI_FAILURE (Status))
{
- ACPI_FREE (TableDesc.Pointer);
+ /* Delete allocated table buffer */
+
+ ACPI_FREE (Table);
return_ACPI_STATUS (Status);
}
- /* Complete the table descriptor */
-
- TableDesc.Length = Length;
- TableDesc.Flags = ACPI_TABLE_ORIGIN_ALLOCATED;
-
- /* Install the new table into the local data structures */
-
- Status = AcpiTbAddTable (&TableDesc, &TableIndex);
+ /*
+ * Note: Now table is "INSTALLED", it must be validated before
+ * loading.
+ */
+ Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[TableIndex]);
if (ACPI_FAILURE (Status))
{
- /* Delete allocated table buffer */
-
- AcpiTbDeleteTable (&TableDesc);
return_ACPI_STATUS (Status);
}
@@ -583,9 +579,6 @@ AcpiExLoadOp (
return_ACPI_STATUS (Status);
}
- ACPI_INFO ((AE_INFO, "Dynamic OEM Table Load:"));
- AcpiTbPrintTableHeader (0, TableDesc.Pointer);
-
/* Remove the reference by added by AcpiExStore above */
AcpiUtRemoveReference (DdbHandle);
@@ -594,7 +587,7 @@ AcpiExLoadOp (
if (AcpiGbl_TableHandler)
{
- (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, TableDesc.Pointer,
+ (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,
AcpiGbl_TableHandlerContext);
}
@@ -628,6 +621,14 @@ AcpiExUnloadTable (
/*
+ * Temporarily emit a warning so that the ASL for the machine can be
+ * hopefully obtained. This is to say that the Unload() operator is
+ * extremely rare if not completely unused.
+ */
+ ACPI_WARNING ((AE_INFO,
+ "Received request to unload an ACPI table"));
+
+ /*
* Validate the handle
* Although the handle is partially validated in AcpiExReconfiguration()
* when it calls AcpiExResolveOperands(), the handle is more completely
diff --git a/sys/contrib/dev/acpica/components/executer/exconvrt.c b/sys/contrib/dev/acpica/components/executer/exconvrt.c
index f6113a5..50ccf26 100644
--- a/sys/contrib/dev/acpica/components/executer/exconvrt.c
+++ b/sys/contrib/dev/acpica/components/executer/exconvrt.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __EXCONVRT_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acinterp.h>
diff --git a/sys/contrib/dev/acpica/components/executer/excreate.c b/sys/contrib/dev/acpica/components/executer/excreate.c
index 55715c2..a855f20 100644
--- a/sys/contrib/dev/acpica/components/executer/excreate.c
+++ b/sys/contrib/dev/acpica/components/executer/excreate.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXCREATE_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acinterp.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exdebug.c b/sys/contrib/dev/acpica/components/executer/exdebug.c
index 06f35b8..5e98fd5 100644
--- a/sys/contrib/dev/acpica/components/executer/exdebug.c
+++ b/sys/contrib/dev/acpica/components/executer/exdebug.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXDEBUG_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acinterp.h>
@@ -82,6 +80,7 @@ AcpiExDoDebugObject (
UINT32 Index)
{
UINT32 i;
+ UINT32 Timer;
ACPI_FUNCTION_TRACE_PTR (ExDoDebugObject, SourceDesc);
@@ -96,12 +95,20 @@ AcpiExDoDebugObject (
}
/*
+ * We will emit the current timer value (in microseconds) with each
+ * debug output. Only need the lower 26 bits. This allows for 67
+ * million microseconds or 67 seconds before rollover.
+ */
+ Timer = ((UINT32) AcpiOsGetTimer () / 10); /* (100 nanoseconds to microseconds) */
+ Timer &= 0x03FFFFFF;
+
+ /*
* Print line header as long as we are not in the middle of an
* object display
*/
if (!((Level > 0) && Index == 0))
{
- AcpiOsPrintf ("[ACPI Debug] %*s", Level, " ");
+ AcpiOsPrintf ("[ACPI Debug %.8u] %*s", Timer, Level, " ");
}
/* Display the index for package output only */
diff --git a/sys/contrib/dev/acpica/components/executer/exdump.c b/sys/contrib/dev/acpica/components/executer/exdump.c
index c37f9ae..9986022 100644
--- a/sys/contrib/dev/acpica/components/executer/exdump.c
+++ b/sys/contrib/dev/acpica/components/executer/exdump.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXDUMP_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acinterp.h>
@@ -114,13 +112,14 @@ static ACPI_EXDUMP_INFO AcpiExDumpBuffer[5] =
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpBuffer), NULL},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Buffer.Length), "Length"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Buffer.Pointer), "Pointer"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Buffer.Node), "Parent Node"},
+ {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Buffer.Node), "Parent Node"},
{ACPI_EXD_BUFFER, 0, NULL}
};
-static ACPI_EXDUMP_INFO AcpiExDumpPackage[5] =
+static ACPI_EXDUMP_INFO AcpiExDumpPackage[6] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpPackage), NULL},
+ {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Package.Node), "Parent Node"},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Package.Flags), "Flags"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Package.Count), "Elements"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Package.Elements), "Element List"},
@@ -130,9 +129,9 @@ static ACPI_EXDUMP_INFO AcpiExDumpPackage[5] =
static ACPI_EXDUMP_INFO AcpiExDumpDevice[4] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpDevice), NULL},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.Handler), "Handler"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.NotifyList[0]), "System Notify"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.NotifyList[1]), "Device Notify"}
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.NotifyList[1]), "Device Notify"},
+ {ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (Device.Handler), "Handler"}
};
static ACPI_EXDUMP_INFO AcpiExDumpEvent[2] =
@@ -154,33 +153,36 @@ static ACPI_EXDUMP_INFO AcpiExDumpMethod[9] =
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Method.AmlStart), "Aml Start"}
};
-static ACPI_EXDUMP_INFO AcpiExDumpMutex[5] =
+static ACPI_EXDUMP_INFO AcpiExDumpMutex[6] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpMutex), NULL},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Mutex.SyncLevel), "Sync Level"},
+ {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Mutex.OriginalSyncLevel), "Original Sync Level"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Mutex.OwnerThread), "Owner Thread"},
{ACPI_EXD_UINT16, ACPI_EXD_OFFSET (Mutex.AcquisitionDepth), "Acquire Depth"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Mutex.OsMutex), "OsMutex"}
};
-static ACPI_EXDUMP_INFO AcpiExDumpRegion[7] =
+static ACPI_EXDUMP_INFO AcpiExDumpRegion[8] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegion), NULL},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Region.SpaceId), "Space Id"},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Region.Flags), "Flags"},
+ {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Region.Node), "Parent Node"},
{ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET (Region.Address), "Address"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Region.Length), "Length"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Region.Handler), "Handler"},
+ {ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (Region.Handler), "Handler"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Region.Next), "Next"}
};
-static ACPI_EXDUMP_INFO AcpiExDumpPower[5] =
+static ACPI_EXDUMP_INFO AcpiExDumpPower[6] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpPower), NULL},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (PowerResource.SystemLevel), "System Level"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (PowerResource.ResourceOrder), "Resource Order"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.NotifyList[0]), "System Notify"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.NotifyList[1]), "Device Notify"}
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.NotifyList[1]), "Device Notify"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.Handler), "Handler"}
};
static ACPI_EXDUMP_INFO AcpiExDumpProcessor[7] =
@@ -243,7 +245,7 @@ static ACPI_EXDUMP_INFO AcpiExDumpReference[8] =
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Reference.TargetType), "Target Type"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Reference.Value), "Value"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Object), "Object Desc"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Node), "Node"},
+ {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Reference.Node), "Node"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Where), "Where"},
{ACPI_EXD_REFERENCE,0, NULL}
};
@@ -252,16 +254,16 @@ static ACPI_EXDUMP_INFO AcpiExDumpAddressHandler[6] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpAddressHandler), NULL},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (AddressSpace.SpaceId), "Space Id"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.Next), "Next"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.RegionList), "Region List"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.Node), "Node"},
+ {ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (AddressSpace.Next), "Next"},
+ {ACPI_EXD_RGN_LIST, ACPI_EXD_OFFSET (AddressSpace.RegionList), "Region List"},
+ {ACPI_EXD_NODE, ACPI_EXD_OFFSET (AddressSpace.Node), "Node"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.Context), "Context"}
};
static ACPI_EXDUMP_INFO AcpiExDumpNotify[7] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpNotify), NULL},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Node), "Node"},
+ {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Notify.Node), "Node"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Notify.HandlerType), "Handler Type"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Handler), "Handler"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Context), "Context"},
@@ -269,15 +271,32 @@ static ACPI_EXDUMP_INFO AcpiExDumpNotify[7] =
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Next[1]), "Next Device Notify"}
};
+static ACPI_EXDUMP_INFO AcpiExDumpExtra[6] =
+{
+ {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpExtra), NULL},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Extra.Method_REG), "_REG Method"},
+ {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Extra.ScopeNode), "Scope Node"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Extra.RegionContext), "Region Context"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Extra.AmlStart), "Aml Start"},
+ {ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Extra.AmlLength), "Aml Length"}
+};
+
+static ACPI_EXDUMP_INFO AcpiExDumpData[3] =
+{
+ {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpData), NULL},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Data.Handler), "Handler"},
+ {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Data.Pointer), "Raw Data"}
+};
/* Miscellaneous tables */
-static ACPI_EXDUMP_INFO AcpiExDumpCommon[4] =
+static ACPI_EXDUMP_INFO AcpiExDumpCommon[5] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpCommon), NULL},
{ACPI_EXD_TYPE , 0, NULL},
{ACPI_EXD_UINT16, ACPI_EXD_OFFSET (Common.ReferenceCount), "Reference Count"},
- {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Common.Flags), "Flags"}
+ {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Common.Flags), "Flags"},
+ {ACPI_EXD_LIST, ACPI_EXD_OFFSET (Common.NextObject), "Object List"}
};
static ACPI_EXDUMP_INFO AcpiExDumpFieldCommon[7] =
@@ -288,16 +307,18 @@ static ACPI_EXDUMP_INFO AcpiExDumpFieldCommon[7] =
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (CommonField.BitLength), "Bit Length"},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (CommonField.StartFieldBitOffset),"Field Bit Offset"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (CommonField.BaseByteOffset), "Base Byte Offset"},
- {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (CommonField.Node), "Parent Node"}
+ {ACPI_EXD_NODE, ACPI_EXD_OFFSET (CommonField.Node), "Parent Node"}
};
-static ACPI_EXDUMP_INFO AcpiExDumpNode[5] =
+static ACPI_EXDUMP_INFO AcpiExDumpNode[7] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpNode), NULL},
{ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET (Flags), "Flags"},
{ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET (OwnerId), "Owner Id"},
- {ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET (Child), "Child List"},
- {ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET (Peer), "Next Peer"}
+ {ACPI_EXD_LIST, ACPI_EXD_NSOFFSET (Object), "Object List"},
+ {ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Parent), "Parent"},
+ {ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Child), "Child"},
+ {ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Peer), "Peer"}
};
@@ -332,7 +353,9 @@ static ACPI_EXDUMP_INFO *AcpiExDumpInfo[] =
AcpiExDumpAddressHandler,
NULL,
NULL,
- NULL
+ NULL,
+ AcpiExDumpExtra,
+ AcpiExDumpData
};
@@ -359,6 +382,10 @@ AcpiExDumpObject (
char *Name;
const char *ReferenceName;
UINT8 Count;
+ ACPI_OPERAND_OBJECT *Start;
+ ACPI_OPERAND_OBJECT *Data = NULL;
+ ACPI_OPERAND_OBJECT *Next;
+ ACPI_NAMESPACE_NODE *Node;
if (!Info)
@@ -386,7 +413,8 @@ AcpiExDumpObject (
case ACPI_EXD_TYPE:
- AcpiExOutString ("Type", AcpiUtGetObjectTypeName (ObjDesc));
+ AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
+ ObjDesc->Common.Type, AcpiUtGetObjectTypeName (ObjDesc));
break;
case ACPI_EXD_UINT8:
@@ -447,6 +475,120 @@ AcpiExDumpObject (
AcpiExDumpReferenceObj (ObjDesc);
break;
+ case ACPI_EXD_LIST:
+
+ Start = *ACPI_CAST_PTR (void *, Target);
+ Next = Start;
+
+ AcpiOsPrintf ("%20s : %p", Name, Next);
+ if (Next)
+ {
+ AcpiOsPrintf ("(%s %2.2X)",
+ AcpiUtGetObjectTypeName (Next), Next->Common.Type);
+
+ while (Next->Common.NextObject)
+ {
+ if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) &&
+ !Data)
+ {
+ Data = Next;
+ }
+
+ Next = Next->Common.NextObject;
+ AcpiOsPrintf ("->%p(%s %2.2X)", Next,
+ AcpiUtGetObjectTypeName (Next), Next->Common.Type);
+
+ if ((Next == Start) || (Next == Data))
+ {
+ AcpiOsPrintf ("\n**** Error: Object list appears to be circular linked");
+ break;
+ }
+ }
+ }
+
+ AcpiOsPrintf ("\n");
+ break;
+
+ case ACPI_EXD_HDLR_LIST:
+
+ Start = *ACPI_CAST_PTR (void *, Target);
+ Next = Start;
+
+ AcpiOsPrintf ("%20s : %p", Name, Next);
+ if (Next)
+ {
+ AcpiOsPrintf ("(%s %2.2X)",
+ AcpiUtGetObjectTypeName (Next), Next->Common.Type);
+
+ while (Next->AddressSpace.Next)
+ {
+ if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) &&
+ !Data)
+ {
+ Data = Next;
+ }
+
+ Next = Next->AddressSpace.Next;
+ AcpiOsPrintf ("->%p(%s %2.2X)", Next,
+ AcpiUtGetObjectTypeName (Next), Next->Common.Type);
+
+ if ((Next == Start) || (Next == Data))
+ {
+ AcpiOsPrintf ("\n**** Error: Handler list appears to be circular linked");
+ break;
+ }
+ }
+ }
+
+ AcpiOsPrintf ("\n");
+ break;
+
+ case ACPI_EXD_RGN_LIST:
+
+ Start = *ACPI_CAST_PTR (void *, Target);
+ Next = Start;
+
+ AcpiOsPrintf ("%20s : %p", Name, Next);
+ if (Next)
+ {
+ AcpiOsPrintf ("(%s %2.2X)",
+ AcpiUtGetObjectTypeName (Next), Next->Common.Type);
+
+ while (Next->Region.Next)
+ {
+ if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) &&
+ !Data)
+ {
+ Data = Next;
+ }
+
+ Next = Next->Region.Next;
+ AcpiOsPrintf ("->%p(%s %2.2X)", Next,
+ AcpiUtGetObjectTypeName (Next), Next->Common.Type);
+
+ if ((Next == Start) || (Next == Data))
+ {
+ AcpiOsPrintf ("\n**** Error: Region list appears to be circular linked");
+ break;
+ }
+ }
+ }
+
+ AcpiOsPrintf ("\n");
+ break;
+
+ case ACPI_EXD_NODE:
+
+ Node = *ACPI_CAST_PTR (ACPI_NAMESPACE_NODE *, Target);
+
+ AcpiOsPrintf ("%20s : %p", Name, Node);
+ if (Node)
+ {
+ AcpiOsPrintf (" [%4.4s]", Node->Name.Ascii);
+ }
+ AcpiOsPrintf ("\n");
+ break;
+
default:
AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",
@@ -864,9 +1006,8 @@ AcpiExDumpNamespaceNode (
}
AcpiOsPrintf ("%20s : %4.4s\n", "Name", AcpiUtGetNodeName (Node));
- AcpiExOutString ("Type", AcpiUtGetTypeName (Node->Type));
- AcpiExOutPointer ("Attached Object", AcpiNsGetAttachedObject (Node));
- AcpiExOutPointer ("Parent", Node->Parent);
+ AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
+ Node->Type, AcpiUtGetTypeName (Node->Type));
AcpiExDumpObject (ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Node),
AcpiExDumpNode);
@@ -1074,24 +1215,30 @@ AcpiExDumpObjectDescriptor (
AcpiOsPrintf ("\nAttached Object (%p):\n",
((ACPI_NAMESPACE_NODE *) ObjDesc)->Object);
- AcpiExDumpObjectDescriptor (
- ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object, Flags);
- return_VOID;
+ ObjDesc = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object;
+ goto DumpObject;
}
if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)
{
AcpiOsPrintf (
- "ExDumpObjectDescriptor: %p is not an ACPI operand object: [%s]\n",
+ "%p is not an ACPI operand object: [%s]\n",
ObjDesc, AcpiUtGetDescriptorName (ObjDesc));
return_VOID;
}
- if (ObjDesc->Common.Type > ACPI_TYPE_NS_NODE_MAX)
+ /* Validate the object type */
+
+ if (ObjDesc->Common.Type > ACPI_TYPE_LOCAL_MAX)
{
+ AcpiOsPrintf ("Not a known object type: %2.2X\n",
+ ObjDesc->Common.Type);
return_VOID;
}
+
+DumpObject:
+
/* Common Fields */
AcpiExDumpObject (ObjDesc, AcpiExDumpCommon);
@@ -1099,6 +1246,22 @@ AcpiExDumpObjectDescriptor (
/* Object-specific fields */
AcpiExDumpObject (ObjDesc, AcpiExDumpInfo[ObjDesc->Common.Type]);
+
+ if (ObjDesc->Common.Type == ACPI_TYPE_REGION)
+ {
+ ObjDesc = ObjDesc->Common.NextObject;
+ if (ObjDesc->Common.Type > ACPI_TYPE_LOCAL_MAX)
+ {
+ AcpiOsPrintf ("Secondary object is not a known object type: %2.2X\n",
+ ObjDesc->Common.Type);
+
+ return_VOID;
+ }
+
+ AcpiOsPrintf ("\nExtra attached Object (%p):\n", ObjDesc);
+ AcpiExDumpObject (ObjDesc, AcpiExDumpInfo[ObjDesc->Common.Type]);
+ }
+
return_VOID;
}
diff --git a/sys/contrib/dev/acpica/components/executer/exfield.c b/sys/contrib/dev/acpica/components/executer/exfield.c
index 9cab258..836a378 100644
--- a/sys/contrib/dev/acpica/components/executer/exfield.c
+++ b/sys/contrib/dev/acpica/components/executer/exfield.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,18 +41,84 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __EXFIELD_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdispat.h>
#include <contrib/dev/acpica/include/acinterp.h>
+#include <contrib/dev/acpica/include/amlcode.h>
#define _COMPONENT ACPI_EXECUTER
ACPI_MODULE_NAME ("exfield")
+/* Local prototypes */
+
+static UINT32
+AcpiExGetSerialAccessLength (
+ UINT32 AccessorType,
+ UINT32 AccessLength);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiExGetSerialAccessLength
+ *
+ * PARAMETERS: AccessorType - The type of the protocol indicated by region
+ * field access attributes
+ * AccessLength - The access length of the region field
+ *
+ * RETURN: Decoded access length
+ *
+ * DESCRIPTION: This routine returns the length of the GenericSerialBus
+ * protocol bytes
+ *
+ ******************************************************************************/
+
+static UINT32
+AcpiExGetSerialAccessLength (
+ UINT32 AccessorType,
+ UINT32 AccessLength)
+{
+ UINT32 Length;
+
+
+ switch (AccessorType)
+ {
+ case AML_FIELD_ATTRIB_QUICK:
+
+ Length = 0;
+ break;
+
+ case AML_FIELD_ATTRIB_SEND_RCV:
+ case AML_FIELD_ATTRIB_BYTE:
+
+ Length = 1;
+ break;
+
+ case AML_FIELD_ATTRIB_WORD:
+ case AML_FIELD_ATTRIB_WORD_CALL:
+
+ Length = 2;
+ break;
+
+ case AML_FIELD_ATTRIB_MULTIBYTE:
+ case AML_FIELD_ATTRIB_RAW_BYTES:
+ case AML_FIELD_ATTRIB_RAW_PROCESS:
+
+ Length = AccessLength;
+ break;
+
+ case AML_FIELD_ATTRIB_BLOCK:
+ case AML_FIELD_ATTRIB_BLOCK_CALL:
+ default:
+
+ Length = ACPI_GSBUS_BUFFER_SIZE - 2;
+ break;
+ }
+
+ return (Length);
+}
+
/*******************************************************************************
*
@@ -80,6 +146,7 @@ AcpiExReadDataFromField (
ACPI_SIZE Length;
void *Buffer;
UINT32 Function;
+ UINT16 AccessorType;
ACPI_FUNCTION_TRACE_PTR (ExReadDataFromField, ObjDesc);
@@ -129,8 +196,19 @@ AcpiExReadDataFromField (
}
else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
{
- Length = ACPI_GSBUS_BUFFER_SIZE;
- Function = ACPI_READ | (ObjDesc->Field.Attribute << 16);
+ AccessorType = ObjDesc->Field.Attribute;
+ Length = AcpiExGetSerialAccessLength (AccessorType,
+ ObjDesc->Field.AccessLength);
+
+ /*
+ * Add additional 2 bytes for the GenericSerialBus data buffer:
+ *
+ * Status; (Byte 0 of the data buffer)
+ * Length; (Byte 1 of the data buffer)
+ * Data[x-1]; (Bytes 2-x of the arbitrary length data buffer)
+ */
+ Length += 2;
+ Function = ACPI_READ | (AccessorType << 16);
}
else /* IPMI */
{
@@ -193,6 +271,39 @@ AcpiExReadDataFromField (
Buffer = &BufferDesc->Integer.Value;
}
+ if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
+ (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO))
+ {
+ /*
+ * For GPIO (GeneralPurposeIo), the Address will be the bit offset
+ * from the previous Connection() operator, making it effectively a
+ * pin number index. The BitLength is the length of the field, which
+ * is thus the number of pins.
+ */
+ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+ "GPIO FieldRead [FROM]: Pin %u Bits %u\n",
+ ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength));
+
+ /* Lock entire transaction if requested */
+
+ AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
+
+ /* Perform the write */
+
+ Status = AcpiExAccessRegion (ObjDesc, 0,
+ (UINT64 *) Buffer, ACPI_READ);
+ AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiUtRemoveReference (BufferDesc);
+ }
+ else
+ {
+ *RetBufferDesc = BufferDesc;
+ }
+ return_ACPI_STATUS (Status);
+ }
+
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"FieldRead [TO]: Obj %p, Type %X, Buf %p, ByteLen %X\n",
ObjDesc, ObjDesc->Common.Type, Buffer, (UINT32) Length));
@@ -251,6 +362,7 @@ AcpiExWriteDataToField (
void *Buffer;
ACPI_OPERAND_OBJECT *BufferDesc;
UINT32 Function;
+ UINT16 AccessorType;
ACPI_FUNCTION_TRACE_PTR (ExWriteDataToField, ObjDesc);
@@ -310,8 +422,19 @@ AcpiExWriteDataToField (
}
else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
{
- Length = ACPI_GSBUS_BUFFER_SIZE;
- Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16);
+ AccessorType = ObjDesc->Field.Attribute;
+ Length = AcpiExGetSerialAccessLength (AccessorType,
+ ObjDesc->Field.AccessLength);
+
+ /*
+ * Add additional 2 bytes for the GenericSerialBus data buffer:
+ *
+ * Status; (Byte 0 of the data buffer)
+ * Length; (Byte 1 of the data buffer)
+ * Data[x-1]; (Bytes 2-x of the arbitrary length data buffer)
+ */
+ Length += 2;
+ Function = ACPI_WRITE | (AccessorType << 16);
}
else /* IPMI */
{
@@ -354,6 +477,41 @@ AcpiExWriteDataToField (
*ResultDesc = BufferDesc;
return_ACPI_STATUS (Status);
}
+ else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
+ (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO))
+ {
+ /*
+ * For GPIO (GeneralPurposeIo), we will bypass the entire field
+ * mechanism and handoff the bit address and bit width directly to
+ * the handler. The Address will be the bit offset
+ * from the previous Connection() operator, making it effectively a
+ * pin number index. The BitLength is the length of the field, which
+ * is thus the number of pins.
+ */
+ if (SourceDesc->Common.Type != ACPI_TYPE_INTEGER)
+ {
+ return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
+ }
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
+ "GPIO FieldWrite [FROM]: (%s:%X), Val %.8X [TO]: Pin %u Bits %u\n",
+ AcpiUtGetTypeName (SourceDesc->Common.Type),
+ SourceDesc->Common.Type, (UINT32) SourceDesc->Integer.Value,
+ ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength));
+
+ Buffer = &SourceDesc->Integer.Value;
+
+ /* Lock entire transaction if requested */
+
+ AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
+
+ /* Perform the write */
+
+ Status = AcpiExAccessRegion (ObjDesc, 0,
+ (UINT64 *) Buffer, ACPI_WRITE);
+ AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
+ return_ACPI_STATUS (Status);
+ }
/* Get a pointer to the data to be written */
diff --git a/sys/contrib/dev/acpica/components/executer/exfldio.c b/sys/contrib/dev/acpica/components/executer/exfldio.c
index c355b74..c4d4019 100644
--- a/sys/contrib/dev/acpica/components/executer/exfldio.c
+++ b/sys/contrib/dev/acpica/components/executer/exfldio.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __EXFLDIO_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acinterp.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exmisc.c b/sys/contrib/dev/acpica/components/executer/exmisc.c
index 2abbe29..d4e1a3b 100644
--- a/sys/contrib/dev/acpica/components/executer/exmisc.c
+++ b/sys/contrib/dev/acpica/components/executer/exmisc.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXMISC_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acinterp.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exmutex.c b/sys/contrib/dev/acpica/components/executer/exmutex.c
index a6e5e14..cf82b04 100644
--- a/sys/contrib/dev/acpica/components/executer/exmutex.c
+++ b/sys/contrib/dev/acpica/components/executer/exmutex.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXMUTEX_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acinterp.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exnames.c b/sys/contrib/dev/acpica/components/executer/exnames.c
index 9c11e7f..b213165 100644
--- a/sys/contrib/dev/acpica/components/executer/exnames.c
+++ b/sys/contrib/dev/acpica/components/executer/exnames.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXNAMES_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acinterp.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exoparg1.c b/sys/contrib/dev/acpica/components/executer/exoparg1.c
index cd917ef..dc35c171 100644
--- a/sys/contrib/dev/acpica/components/executer/exoparg1.c
+++ b/sys/contrib/dev/acpica/components/executer/exoparg1.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXOPARG1_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exoparg2.c b/sys/contrib/dev/acpica/components/executer/exoparg2.c
index 6f98753..da1eb6c 100644
--- a/sys/contrib/dev/acpica/components/executer/exoparg2.c
+++ b/sys/contrib/dev/acpica/components/executer/exoparg2.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __EXOPARG2_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exoparg3.c b/sys/contrib/dev/acpica/components/executer/exoparg3.c
index b9c1c1a..6d0fdd1 100644
--- a/sys/contrib/dev/acpica/components/executer/exoparg3.c
+++ b/sys/contrib/dev/acpica/components/executer/exoparg3.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXOPARG3_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acinterp.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exoparg6.c b/sys/contrib/dev/acpica/components/executer/exoparg6.c
index ae675d3..4ff355c 100644
--- a/sys/contrib/dev/acpica/components/executer/exoparg6.c
+++ b/sys/contrib/dev/acpica/components/executer/exoparg6.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXOPARG6_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acinterp.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exprep.c b/sys/contrib/dev/acpica/components/executer/exprep.c
index 33c2049..c949d8a 100644
--- a/sys/contrib/dev/acpica/components/executer/exprep.c
+++ b/sys/contrib/dev/acpica/components/executer/exprep.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXPREP_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acinterp.h>
@@ -515,6 +513,8 @@ AcpiExPrepFieldValue (
ObjDesc->Field.ResourceLength = Info->ResourceLength;
}
+ ObjDesc->Field.PinNumberIndex = Info->PinNumberIndex;
+
/* Allow full data read from EC address space */
if ((ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) &&
diff --git a/sys/contrib/dev/acpica/components/executer/exregion.c b/sys/contrib/dev/acpica/components/executer/exregion.c
index 753cba6..9deef50 100644
--- a/sys/contrib/dev/acpica/components/executer/exregion.c
+++ b/sys/contrib/dev/acpica/components/executer/exregion.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __EXREGION_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acinterp.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exresnte.c b/sys/contrib/dev/acpica/components/executer/exresnte.c
index 267801c..99b64c2 100644
--- a/sys/contrib/dev/acpica/components/executer/exresnte.c
+++ b/sys/contrib/dev/acpica/components/executer/exresnte.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXRESNTE_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdispat.h>
@@ -134,8 +132,8 @@ AcpiExResolveNodeToValue (
if (!SourceDesc)
{
- ACPI_ERROR ((AE_INFO, "No object attached to node %p",
- Node));
+ ACPI_ERROR ((AE_INFO, "No object attached to node [%4.4s] %p",
+ Node->Name.Ascii, Node));
return_ACPI_STATUS (AE_AML_NO_OPERAND);
}
diff --git a/sys/contrib/dev/acpica/components/executer/exresolv.c b/sys/contrib/dev/acpica/components/executer/exresolv.c
index 837ba87..32862a9 100644
--- a/sys/contrib/dev/acpica/components/executer/exresolv.c
+++ b/sys/contrib/dev/acpica/components/executer/exresolv.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXRESOLV_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/amlcode.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exresop.c b/sys/contrib/dev/acpica/components/executer/exresop.c
index 24df299..5171f56 100644
--- a/sys/contrib/dev/acpica/components/executer/exresop.c
+++ b/sys/contrib/dev/acpica/components/executer/exresop.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXRESOP_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/amlcode.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exstore.c b/sys/contrib/dev/acpica/components/executer/exstore.c
index 894af0b..e14ab94 100644
--- a/sys/contrib/dev/acpica/components/executer/exstore.c
+++ b/sys/contrib/dev/acpica/components/executer/exstore.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXSTORE_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdispat.h>
@@ -62,6 +60,12 @@ AcpiExStoreObjectToIndex (
ACPI_OPERAND_OBJECT *DestDesc,
ACPI_WALK_STATE *WalkState);
+static ACPI_STATUS
+AcpiExStoreDirectToNode (
+ ACPI_OPERAND_OBJECT *SourceDesc,
+ ACPI_NAMESPACE_NODE *Node,
+ ACPI_WALK_STATE *WalkState);
+
/*******************************************************************************
*
@@ -393,7 +397,11 @@ AcpiExStoreObjectToIndex (
* When storing into an object the data is converted to the
* target object type then stored in the object. This means
* that the target object type (for an initialized target) will
- * not be changed by a store operation.
+ * not be changed by a store operation. A CopyObject can change
+ * the target type, however.
+ *
+ * The ImplicitConversion flag is set to NO/FALSE only when
+ * storing to an ArgX -- as per the rules of the ACPI spec.
*
* Assumes parameters are already validated.
*
@@ -420,7 +428,7 @@ AcpiExStoreObjectToNode (
TargetType = AcpiNsGetType (Node);
TargetDesc = AcpiNsGetAttachedObject (Node);
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p(%s) into node %p(%s)\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p (%s) to node %p (%s)\n",
SourceDesc, AcpiUtGetObjectTypeName (SourceDesc),
Node, AcpiUtGetTypeName (TargetType)));
@@ -434,49 +442,35 @@ AcpiExStoreObjectToNode (
return_ACPI_STATUS (Status);
}
- /* If no implicit conversion, drop into the default case below */
-
- if ((!ImplicitConversion) ||
- ((WalkState->Opcode == AML_COPY_OP) &&
- (TargetType != ACPI_TYPE_LOCAL_REGION_FIELD) &&
- (TargetType != ACPI_TYPE_LOCAL_BANK_FIELD) &&
- (TargetType != ACPI_TYPE_LOCAL_INDEX_FIELD)))
- {
- /*
- * Force execution of default (no implicit conversion). Note:
- * CopyObject does not perform an implicit conversion, as per the ACPI
- * spec -- except in case of region/bank/index fields -- because these
- * objects must retain their original type permanently.
- */
- TargetType = ACPI_TYPE_ANY;
- }
-
/* Do the actual store operation */
switch (TargetType)
{
- case ACPI_TYPE_BUFFER_FIELD:
- case ACPI_TYPE_LOCAL_REGION_FIELD:
- case ACPI_TYPE_LOCAL_BANK_FIELD:
- case ACPI_TYPE_LOCAL_INDEX_FIELD:
-
- /* For fields, copy the source data to the target field. */
-
- Status = AcpiExWriteDataToField (SourceDesc, TargetDesc,
- &WalkState->ResultObj);
- break;
-
case ACPI_TYPE_INTEGER:
case ACPI_TYPE_STRING:
case ACPI_TYPE_BUFFER:
/*
- * These target types are all of type Integer/String/Buffer, and
- * therefore support implicit conversion before the store.
- *
- * Copy and/or convert the source object to a new target object
+ * The simple data types all support implicit source operand
+ * conversion before the store.
*/
+
+ if ((WalkState->Opcode == AML_COPY_OP) ||
+ !ImplicitConversion)
+ {
+ /*
+ * However, CopyObject and Stores to ArgX do not perform
+ * an implicit conversion, as per the ACPI specification.
+ * A direct store is performed instead.
+ */
+ Status = AcpiExStoreDirectToNode (SourceDesc, Node,
+ WalkState);
+ break;
+ }
+
+ /* Store with implicit source operand conversion support */
+
Status = AcpiExStoreObjectToObject (SourceDesc, TargetDesc,
- &NewDesc, WalkState);
+ &NewDesc, WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -489,11 +483,12 @@ AcpiExStoreObjectToNode (
* the Name's type to that of the value being stored in it.
* SourceDesc reference count is incremented by AttachObject.
*
- * Note: This may change the type of the node if an explicit store
- * has been performed such that the node/object type has been
- * changed.
+ * Note: This may change the type of the node if an explicit
+ * store has been performed such that the node/object type
+ * has been changed.
*/
- Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type);
+ Status = AcpiNsAttachObject (Node, NewDesc,
+ NewDesc->Common.Type);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Store %s into %s via Convert/Attach\n",
@@ -502,33 +497,86 @@ AcpiExStoreObjectToNode (
}
break;
- default:
-
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Storing [%s] (%p) directly into node [%s] (%p)"
- " with no implicit conversion\n",
- AcpiUtGetObjectTypeName (SourceDesc), SourceDesc,
- AcpiUtGetObjectTypeName (TargetDesc), Node));
+ case ACPI_TYPE_BUFFER_FIELD:
+ case ACPI_TYPE_LOCAL_REGION_FIELD:
+ case ACPI_TYPE_LOCAL_BANK_FIELD:
+ case ACPI_TYPE_LOCAL_INDEX_FIELD:
+ /*
+ * For all fields, always write the source data to the target
+ * field. Any required implicit source operand conversion is
+ * performed in the function below as necessary. Note, field
+ * objects must retain their original type permanently.
+ */
+ Status = AcpiExWriteDataToField (SourceDesc, TargetDesc,
+ &WalkState->ResultObj);
+ break;
+ default:
/*
* No conversions for all other types. Directly store a copy of
- * the source object. NOTE: This is a departure from the ACPI
- * spec, which states "If conversion is impossible, abort the
- * running control method".
+ * the source object. This is the ACPI spec-defined behavior for
+ * the CopyObject operator.
*
- * This code implements "If conversion is impossible, treat the
- * Store operation as a CopyObject".
+ * NOTE: For the Store operator, this is a departure from the
+ * ACPI spec, which states "If conversion is impossible, abort
+ * the running control method". Instead, this code implements
+ * "If conversion is impossible, treat the Store operation as
+ * a CopyObject".
*/
- Status = AcpiUtCopyIobjectToIobject (SourceDesc, &NewDesc, WalkState);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type);
- AcpiUtRemoveReference (NewDesc);
+ Status = AcpiExStoreDirectToNode (SourceDesc, Node,
+ WalkState);
break;
}
return_ACPI_STATUS (Status);
}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiExStoreDirectToNode
+ *
+ * PARAMETERS: SourceDesc - Value to be stored
+ * Node - Named object to receive the value
+ * WalkState - Current walk state
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: "Store" an object directly to a node. This involves a copy
+ * and an attach.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiExStoreDirectToNode (
+ ACPI_OPERAND_OBJECT *SourceDesc,
+ ACPI_NAMESPACE_NODE *Node,
+ ACPI_WALK_STATE *WalkState)
+{
+ ACPI_STATUS Status;
+ ACPI_OPERAND_OBJECT *NewDesc;
+
+
+ ACPI_FUNCTION_TRACE (ExStoreDirectToNode);
+
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
+ "Storing [%s] (%p) directly into node [%s] (%p)"
+ " with no implicit conversion\n",
+ AcpiUtGetObjectTypeName (SourceDesc), SourceDesc,
+ AcpiUtGetTypeName (Node->Type), Node));
+
+ /* Copy the source object to a new object */
+
+ Status = AcpiUtCopyIobjectToIobject (SourceDesc, &NewDesc, WalkState);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Attach the new object to the node */
+
+ Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type);
+ AcpiUtRemoveReference (NewDesc);
+ return_ACPI_STATUS (Status);
+}
diff --git a/sys/contrib/dev/acpica/components/executer/exstoren.c b/sys/contrib/dev/acpica/components/executer/exstoren.c
index c0302c1..cc56fbd 100644
--- a/sys/contrib/dev/acpica/components/executer/exstoren.c
+++ b/sys/contrib/dev/acpica/components/executer/exstoren.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,8 +42,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXSTOREN_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acinterp.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exstorob.c b/sys/contrib/dev/acpica/components/executer/exstorob.c
index c68263c..c238310 100644
--- a/sys/contrib/dev/acpica/components/executer/exstorob.c
+++ b/sys/contrib/dev/acpica/components/executer/exstorob.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXSTOROB_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acinterp.h>
diff --git a/sys/contrib/dev/acpica/components/executer/exsystem.c b/sys/contrib/dev/acpica/components/executer/exsystem.c
index cc18d80..aa661e7 100644
--- a/sys/contrib/dev/acpica/components/executer/exsystem.c
+++ b/sys/contrib/dev/acpica/components/executer/exsystem.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXSYSTEM_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acinterp.h>
@@ -87,7 +85,7 @@ AcpiExSystemWaitSemaphore (
{
/* We must wait, so unlock the interpreter */
- AcpiExRelinquishInterpreter ();
+ AcpiExExitInterpreter ();
Status = AcpiOsWaitSemaphore (Semaphore, 1, Timeout);
@@ -97,7 +95,7 @@ AcpiExSystemWaitSemaphore (
/* Reacquire the interpreter */
- AcpiExReacquireInterpreter ();
+ AcpiExEnterInterpreter ();
}
return_ACPI_STATUS (Status);
@@ -140,7 +138,7 @@ AcpiExSystemWaitMutex (
{
/* We must wait, so unlock the interpreter */
- AcpiExRelinquishInterpreter ();
+ AcpiExExitInterpreter ();
Status = AcpiOsAcquireMutex (Mutex, Timeout);
@@ -150,7 +148,7 @@ AcpiExSystemWaitMutex (
/* Reacquire the interpreter */
- AcpiExReacquireInterpreter ();
+ AcpiExEnterInterpreter ();
}
return_ACPI_STATUS (Status);
@@ -227,7 +225,7 @@ AcpiExSystemDoSleep (
/* Since this thread will sleep, we must release the interpreter */
- AcpiExRelinquishInterpreter ();
+ AcpiExExitInterpreter ();
/*
* For compatibility with other ACPI implementations and to prevent
@@ -242,7 +240,7 @@ AcpiExSystemDoSleep (
/* And now we must get the interpreter again */
- AcpiExReacquireInterpreter ();
+ AcpiExEnterInterpreter ();
return (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/components/executer/exutils.c b/sys/contrib/dev/acpica/components/executer/exutils.c
index 29abfd1..a55b171 100644
--- a/sys/contrib/dev/acpica/components/executer/exutils.c
+++ b/sys/contrib/dev/acpica/components/executer/exutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __EXUTILS_C__
-
/*
* DEFINE_AML_GLOBALS is tested in amlcode.h
* to determine whether certain global names should be "defined" or only
@@ -112,42 +110,6 @@ AcpiExEnterInterpreter (
/*******************************************************************************
*
- * FUNCTION: AcpiExReacquireInterpreter
- *
- * PARAMETERS: None
- *
- * RETURN: None
- *
- * DESCRIPTION: Reacquire the interpreter execution region from within the
- * interpreter code. Failure to enter the interpreter region is a
- * fatal system error. Used in conjunction with
- * RelinquishInterpreter
- *
- ******************************************************************************/
-
-void
-AcpiExReacquireInterpreter (
- void)
-{
- ACPI_FUNCTION_TRACE (ExReacquireInterpreter);
-
-
- /*
- * If the global serialized flag is set, do not release the interpreter,
- * since it was not actually released by AcpiExRelinquishInterpreter.
- * This forces the interpreter to be single threaded.
- */
- if (!AcpiGbl_AllMethodsSerialized)
- {
- AcpiExEnterInterpreter ();
- }
-
- return_VOID;
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiExExitInterpreter
*
* PARAMETERS: None
@@ -156,7 +118,16 @@ AcpiExReacquireInterpreter (
*
* DESCRIPTION: Exit the interpreter execution region. This is the top level
* routine used to exit the interpreter when all processing has
- * been completed.
+ * been completed, or when the method blocks.
+ *
+ * Cases where the interpreter is unlocked internally:
+ * 1) Method will be blocked on a Sleep() AML opcode
+ * 2) Method will be blocked on an Acquire() AML opcode
+ * 3) Method will be blocked on a Wait() AML opcode
+ * 4) Method will be blocked to acquire the global lock
+ * 5) Method will be blocked waiting to execute a serialized control
+ * method that is currently executing
+ * 6) About to invoke a user-installed opregion handler
*
******************************************************************************/
@@ -182,49 +153,6 @@ AcpiExExitInterpreter (
/*******************************************************************************
*
- * FUNCTION: AcpiExRelinquishInterpreter
- *
- * PARAMETERS: None
- *
- * RETURN: None
- *
- * DESCRIPTION: Exit the interpreter execution region, from within the
- * interpreter - before attempting an operation that will possibly
- * block the running thread.
- *
- * Cases where the interpreter is unlocked internally
- * 1) Method to be blocked on a Sleep() AML opcode
- * 2) Method to be blocked on an Acquire() AML opcode
- * 3) Method to be blocked on a Wait() AML opcode
- * 4) Method to be blocked to acquire the global lock
- * 5) Method to be blocked waiting to execute a serialized control method
- * that is currently executing
- * 6) About to invoke a user-installed opregion handler
- *
- ******************************************************************************/
-
-void
-AcpiExRelinquishInterpreter (
- void)
-{
- ACPI_FUNCTION_TRACE (ExRelinquishInterpreter);
-
-
- /*
- * If the global serialized flag is set, do not release the interpreter.
- * This forces the interpreter to be single threaded.
- */
- if (!AcpiGbl_AllMethodsSerialized)
- {
- AcpiExExitInterpreter ();
- }
-
- return_VOID;
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiExTruncateFor32bitTable
*
* PARAMETERS: ObjDesc - Object to be truncated
diff --git a/sys/contrib/dev/acpica/components/hardware/hwacpi.c b/sys/contrib/dev/acpica/components/hardware/hwacpi.c
index 3cd3a44..a91b66f 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwacpi.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwacpi.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __HWACPI_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/hardware/hwesleep.c b/sys/contrib/dev/acpica/components/hardware/hwesleep.c
index 6717801..460b6ff 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwesleep.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwesleep.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/hardware/hwgpe.c b/sys/contrib/dev/acpica/components/hardware/hwgpe.c
index 99c0de6..9cc511e 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwgpe.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwgpe.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -58,6 +58,11 @@ AcpiHwEnableWakeupGpeBlock (
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Context);
+static ACPI_STATUS
+AcpiHwGpeEnableWrite (
+ UINT8 EnableMask,
+ ACPI_GPE_REGISTER_INFO *GpeRegisterInfo);
+
/******************************************************************************
*
@@ -128,13 +133,13 @@ AcpiHwLowSetGpe (
/* Set or clear just the bit that corresponds to this GPE */
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
- switch (Action)
+ switch (Action & ~ACPI_GPE_SAVE_MASK)
{
case ACPI_GPE_CONDITIONAL_ENABLE:
- /* Only enable if the EnableForRun bit is set */
+ /* Only enable if the corresponding EnableMask bit is set */
- if (!(RegisterBit & GpeRegisterInfo->EnableForRun))
+ if (!(RegisterBit & GpeRegisterInfo->EnableMask))
{
return (AE_BAD_PARAMETER);
}
@@ -160,6 +165,10 @@ AcpiHwLowSetGpe (
/* Write the updated enable mask */
Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
+ if (ACPI_SUCCESS (Status) && (Action & ACPI_GPE_SAVE_MASK))
+ {
+ GpeRegisterInfo->EnableMask = (UINT8) EnableMask;
+ }
return (Status);
}
@@ -241,6 +250,14 @@ AcpiHwGetGpeStatus (
return (AE_BAD_PARAMETER);
}
+ /* GPE currently handled? */
+
+ if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) !=
+ ACPI_GPE_DISPATCH_NONE)
+ {
+ LocalEventStatus |= ACPI_EVENT_FLAG_HAS_HANDLER;
+ }
+
/* Get the info block for the entire GPE register */
GpeRegisterInfo = GpeEventInfo->RegisterInfo;
@@ -285,6 +302,37 @@ AcpiHwGetGpeStatus (
/******************************************************************************
*
+ * FUNCTION: AcpiHwGpeEnableWrite
+ *
+ * PARAMETERS: EnableMask - Bit mask to write to the GPE register
+ * GpeRegisterInfo - Gpe Register info
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Write the enable mask byte to the given GPE register.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiHwGpeEnableWrite (
+ UINT8 EnableMask,
+ ACPI_GPE_REGISTER_INFO *GpeRegisterInfo)
+{
+ ACPI_STATUS Status;
+
+
+ Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
+ if (ACPI_SUCCESS (Status))
+ {
+ GpeRegisterInfo->EnableMask = EnableMask;
+ }
+
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: AcpiHwDisableGpeBlock
*
* PARAMETERS: GpeXruptInfo - GPE Interrupt info
@@ -312,7 +360,7 @@ AcpiHwDisableGpeBlock (
{
/* Disable all GPEs in this register */
- Status = AcpiHwWrite (0x00, &GpeBlock->RegisterInfo[i].EnableAddress);
+ Status = AcpiHwGpeEnableWrite (0x00, &GpeBlock->RegisterInfo[i]);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -385,6 +433,7 @@ AcpiHwEnableRuntimeGpeBlock (
{
UINT32 i;
ACPI_STATUS Status;
+ ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
/* NOTE: assumes that all GPEs are currently disabled */
@@ -393,15 +442,16 @@ AcpiHwEnableRuntimeGpeBlock (
for (i = 0; i < GpeBlock->RegisterCount; i++)
{
- if (!GpeBlock->RegisterInfo[i].EnableForRun)
+ GpeRegisterInfo = &GpeBlock->RegisterInfo[i];
+ if (!GpeRegisterInfo->EnableForRun)
{
continue;
}
/* Enable all "runtime" GPEs in this register */
- Status = AcpiHwWrite (GpeBlock->RegisterInfo[i].EnableForRun,
- &GpeBlock->RegisterInfo[i].EnableAddress);
+ Status = AcpiHwGpeEnableWrite (GpeRegisterInfo->EnableForRun,
+ GpeRegisterInfo);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -434,21 +484,21 @@ AcpiHwEnableWakeupGpeBlock (
{
UINT32 i;
ACPI_STATUS Status;
+ ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
/* Examine each GPE Register within the block */
for (i = 0; i < GpeBlock->RegisterCount; i++)
{
- if (!GpeBlock->RegisterInfo[i].EnableForWake)
- {
- continue;
- }
-
- /* Enable all "wake" GPEs in this register */
-
- Status = AcpiHwWrite (GpeBlock->RegisterInfo[i].EnableForWake,
- &GpeBlock->RegisterInfo[i].EnableAddress);
+ GpeRegisterInfo = &GpeBlock->RegisterInfo[i];
+
+ /*
+ * Enable all "wake" GPEs in this register and disable the
+ * remaining ones.
+ */
+ Status = AcpiHwGpeEnableWrite (GpeRegisterInfo->EnableForWake,
+ GpeRegisterInfo);
if (ACPI_FAILURE (Status))
{
return (Status);
diff --git a/sys/contrib/dev/acpica/components/hardware/hwpci.c b/sys/contrib/dev/acpica/components/hardware/hwpci.c
index a89a3dd..165d26c 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwpci.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwpci.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __HWPCI_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -161,11 +159,12 @@ AcpiHwDerivePciId (
/* Walk the list, updating the PCI device/function/bus numbers */
Status = AcpiHwProcessPciList (PciId, ListHead);
- }
- /* Always delete the list */
+ /* Delete the list */
+
+ AcpiHwDeletePciList (ListHead);
+ }
- AcpiHwDeletePciList (ListHead);
return_ACPI_STATUS (Status);
}
@@ -213,6 +212,9 @@ AcpiHwBuildPciList (
Status = AcpiGetParent (CurrentDevice, &ParentDevice);
if (ACPI_FAILURE (Status))
{
+ /* Must delete the list before exit */
+
+ AcpiHwDeletePciList (*ReturnListHead);
return (Status);
}
@@ -227,6 +229,9 @@ AcpiHwBuildPciList (
ListElement = ACPI_ALLOCATE (sizeof (ACPI_PCI_DEVICE));
if (!ListElement)
{
+ /* Must delete the list before exit */
+
+ AcpiHwDeletePciList (*ReturnListHead);
return (AE_NO_MEMORY);
}
diff --git a/sys/contrib/dev/acpica/components/hardware/hwregs.c b/sys/contrib/dev/acpica/components/hardware/hwregs.c
index 9c3f2a9..9d601c5 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwregs.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwregs.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,8 +42,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __HWREGS_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acevents.h>
@@ -310,17 +308,19 @@ AcpiHwClearAcpiStatus (
Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_STATUS,
ACPI_BITMASK_ALL_FIXED_STATUS);
+
+ AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags);
+
if (ACPI_FAILURE (Status))
{
- goto UnlockAndExit;
+ goto Exit;
}
/* Clear the GPE Bits in all GPE registers in all GPE blocks */
Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock, NULL);
-UnlockAndExit:
- AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags);
+Exit:
return_ACPI_STATUS (Status);
}
diff --git a/sys/contrib/dev/acpica/components/hardware/hwsleep.c b/sys/contrib/dev/acpica/components/hardware/hwsleep.c
index 0e6691a..2bc434e 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwsleep.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwsleep.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -72,7 +72,6 @@ AcpiHwLegacySleep (
UINT32 Pm1aControl;
UINT32 Pm1bControl;
UINT32 InValue;
- UINT32 Retry;
ACPI_STATUS Status;
@@ -192,7 +191,6 @@ AcpiHwLegacySleep (
/* Wait for transition back to Working State */
- Retry = 1000;
do
{
Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &InValue);
@@ -201,18 +199,6 @@ AcpiHwLegacySleep (
return_ACPI_STATUS (Status);
}
- if (AcpiGbl_EnableInterpreterSlack)
- {
- /*
- * Some BIOSs don't set WAK_STS at all. Give up waiting after
- * 1000 retries if it still isn't set.
- */
- if (Retry-- == 0)
- {
- break;
- }
- }
-
} while (!InValue);
return_ACPI_STATUS (AE_OK);
diff --git a/sys/contrib/dev/acpica/components/hardware/hwtimer.c b/sys/contrib/dev/acpica/components/hardware/hwtimer.c
index e103014..39c9e57 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwtimer.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwtimer.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
+#define EXPORT_ACPI_INTERFACES
+
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/hardware/hwvalid.c b/sys/contrib/dev/acpica/components/hardware/hwvalid.c
index 85a87d1..ade53ad 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwvalid.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwvalid.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __HWVALID_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/hardware/hwxface.c b/sys/contrib/dev/acpica/components/hardware/hwxface.c
index 8e0e5be..fcd5c9e 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwxface.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
+#define EXPORT_ACPI_INTERFACES
+
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -90,9 +92,15 @@ AcpiReset (
* 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.
+ *
+ * NOTE:
+ * The ACPI spec requires the reset register width to be 8, so we
+ * hardcode it here and ignore the FADT value. This maintains
+ * compatibility with other ACPI implementations that have allowed
+ * BIOS code with bad register width values to go unnoticed.
*/
Status = AcpiOsWritePort ((ACPI_IO_ADDRESS) ResetReg->Address,
- AcpiGbl_FADT.ResetValue, ResetReg->BitWidth);
+ AcpiGbl_FADT.ResetValue, ACPI_RESET_REGISTER_WIDTH);
}
else
{
diff --git a/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c b/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
index 8c3ec41..8d5ba97 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
+#define EXPORT_ACPI_INTERFACES
+
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/namespace/nsaccess.c b/sys/contrib/dev/acpica/components/namespace/nsaccess.c
index 523e092..667b5af 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsaccess.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsaccess.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __NSACCESS_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/amlcode.h>
diff --git a/sys/contrib/dev/acpica/components/namespace/nsalloc.c b/sys/contrib/dev/acpica/components/namespace/nsalloc.c
index ecec172..2a1e09e 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsalloc.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsalloc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __NSALLOC_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -121,6 +118,7 @@ AcpiNsDeleteNode (
ACPI_NAMESPACE_NODE *Node)
{
ACPI_OPERAND_OBJECT *ObjDesc;
+ ACPI_OPERAND_OBJECT *NextDesc;
ACPI_FUNCTION_NAME (NsDeleteNode);
@@ -131,12 +129,13 @@ AcpiNsDeleteNode (
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.
+ * Delete an attached data object list if present (objects that were
+ * attached via AcpiAttachData). Note: After any normal object is
+ * detached above, the only possible remaining object(s) are data
+ * objects, in a linked list.
*/
ObjDesc = Node->Object;
- if (ObjDesc &&
+ while (ObjDesc &&
(ObjDesc->Common.Type == ACPI_TYPE_LOCAL_DATA))
{
/* Invoke the attached data deletion handler if present */
@@ -146,7 +145,16 @@ AcpiNsDeleteNode (
ObjDesc->Data.Handler (Node, ObjDesc->Data.Pointer);
}
+ NextDesc = ObjDesc->Common.NextObject;
AcpiUtRemoveReference (ObjDesc);
+ ObjDesc = NextDesc;
+ }
+
+ /* Special case for the statically allocated root node */
+
+ if (Node == AcpiGbl_RootNode)
+ {
+ return;
}
/* Now we can delete the node */
diff --git a/sys/contrib/dev/acpica/components/namespace/nsarguments.c b/sys/contrib/dev/acpica/components/namespace/nsarguments.c
index 52ab8a9..5d41bb0 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsarguments.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsarguments.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsconvert.c b/sys/contrib/dev/acpica/components/namespace/nsconvert.c
index 4b12d3d..091c5cc 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsconvert.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsconvert.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,8 +42,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __NSCONVERT_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
diff --git a/sys/contrib/dev/acpica/components/namespace/nsdump.c b/sys/contrib/dev/acpica/components/namespace/nsdump.c
index 0ec5642..6140397 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsdump.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsdump.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __NSDUMP_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -748,6 +746,13 @@ AcpiNsDumpOneObjectPath (
}
Node = AcpiNsValidateHandle (ObjHandle);
+ if (!Node)
+ {
+ /* Ignore bad node during namespace walk */
+
+ return (AE_OK);
+ }
+
Pathname = AcpiNsGetExternalPathname (Node);
PathIndent = 1;
diff --git a/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c b/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c
index 868b104..05daaab 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __NSDUMPDV_C__
-
#include <contrib/dev/acpica/include/acpi.h>
diff --git a/sys/contrib/dev/acpica/components/namespace/nseval.c b/sys/contrib/dev/acpica/components/namespace/nseval.c
index 57098f4..ac1d9a9 100644
--- a/sys/contrib/dev/acpica/components/namespace/nseval.c
+++ b/sys/contrib/dev/acpica/components/namespace/nseval.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __NSEVAL_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/components/namespace/nsinit.c b/sys/contrib/dev/acpica/components/namespace/nsinit.c
index cd50447..847bf72 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsinit.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __NSXFINIT_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -129,9 +126,8 @@ AcpiNsInitializeObjects (
Info.PackageInit, Info.PackageCount, Info.ObjectCount));
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "%u Control Methods found\n", Info.MethodCount));
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "%u Op Regions found\n", Info.OpRegionCount));
+ "%u Control Methods found\n%u Op Regions found\n",
+ Info.MethodCount, Info.OpRegionCount));
return_ACPI_STATUS (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/components/namespace/nsload.c b/sys/contrib/dev/acpica/components/namespace/nsload.c
index d29a891..c9b1174 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsload.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsload.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __NSLOAD_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -148,12 +146,12 @@ Unlock:
* parse trees.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "**** Begin Table Method Parsing and Object Initialization\n"));
+ "**** Begin Table Object Initialization\n"));
Status = AcpiDsInitializeObjects (TableIndex, Node);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "**** Completed Table Method Parsing and Object Initialization\n"));
+ "**** Completed Table Object Initialization\n"));
return_ACPI_STATUS (Status);
}
diff --git a/sys/contrib/dev/acpica/components/namespace/nsnames.c b/sys/contrib/dev/acpica/components/namespace/nsnames.c
index cd4d440..edd6517 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsnames.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsnames.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __NSNAMES_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/amlcode.h>
diff --git a/sys/contrib/dev/acpica/components/namespace/nsobject.c b/sys/contrib/dev/acpica/components/namespace/nsobject.c
index b1d1f01..8327b76 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsobject.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsobject.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,9 +42,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __NSOBJECT_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -247,17 +244,32 @@ AcpiNsDetachObject (
}
}
- /* Clear the entry in all cases */
+ /* Clear the Node entry in all cases */
Node->Object = NULL;
if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_OPERAND)
{
+ /* Unlink object from front of possible object list */
+
Node->Object = ObjDesc->Common.NextObject;
+
+ /* Handle possible 2-descriptor object */
+
if (Node->Object &&
- ((Node->Object)->Common.Type != ACPI_TYPE_LOCAL_DATA))
+ (Node->Object->Common.Type != ACPI_TYPE_LOCAL_DATA))
{
Node->Object = Node->Object->Common.NextObject;
}
+
+ /*
+ * Detach the object from any data objects (which are still held by
+ * the namespace node)
+ */
+ if (ObjDesc->Common.NextObject &&
+ ((ObjDesc->Common.NextObject)->Common.Type == ACPI_TYPE_LOCAL_DATA))
+ {
+ ObjDesc->Common.NextObject = NULL;
+ }
}
/* Reset the node type to untyped */
diff --git a/sys/contrib/dev/acpica/components/namespace/nsparse.c b/sys/contrib/dev/acpica/components/namespace/nsparse.c
index f327f26..0f87fa1 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsparse.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsparse.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __NSPARSE_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
diff --git a/sys/contrib/dev/acpica/components/namespace/nspredef.c b/sys/contrib/dev/acpica/components/namespace/nspredef.c
index 74ed8f7..d885e5a 100644
--- a/sys/contrib/dev/acpica/components/namespace/nspredef.c
+++ b/sys/contrib/dev/acpica/components/namespace/nspredef.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/namespace/nsprepkg.c b/sys/contrib/dev/acpica/components/namespace/nsprepkg.c
index cccd2c1..5940a96 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsprepkg.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsprepkg.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -144,13 +144,13 @@ AcpiNsCheckPackage (
* Decode the type of the expected package contents
*
* PTYPE1 packages contain no subpackages
- * PTYPE2 packages contain sub-packages
+ * PTYPE2 packages contain subpackages
*/
switch (Package->RetInfo.Type)
{
case ACPI_PTYPE1_FIXED:
/*
- * The package count is fixed and there are no sub-packages
+ * The package count is fixed and there are no subpackages
*
* If package is too small, exit.
* If package is larger than expected, issue warning but continue
@@ -177,7 +177,7 @@ AcpiNsCheckPackage (
case ACPI_PTYPE1_VAR:
/*
- * The package count is variable, there are no sub-packages, and all
+ * The package count is variable, there are no subpackages, and all
* elements must be of the same type
*/
for (i = 0; i < Count; i++)
@@ -194,7 +194,7 @@ AcpiNsCheckPackage (
case ACPI_PTYPE1_OPTION:
/*
- * The package count is variable, there are no sub-packages. There are
+ * The package count is variable, there are no subpackages. There are
* a fixed number of required elements, and a variable number of
* optional elements.
*
@@ -250,14 +250,14 @@ AcpiNsCheckPackage (
Elements++;
Count--;
- /* Examine the sub-packages */
+ /* Examine the subpackages */
Status = AcpiNsCheckPackageList (Info, Package, Elements, Count);
break;
case ACPI_PTYPE2_PKG_COUNT:
- /* First element is the (Integer) count of sub-packages to follow */
+ /* First element is the (Integer) count of subpackages to follow */
Status = AcpiNsCheckObjectType (Info, Elements,
ACPI_RTYPE_INTEGER, 0);
@@ -279,7 +279,7 @@ AcpiNsCheckPackage (
Count = ExpectedCount;
Elements++;
- /* Examine the sub-packages */
+ /* Examine the subpackages */
Status = AcpiNsCheckPackageList (Info, Package, Elements, Count);
break;
@@ -291,9 +291,9 @@ AcpiNsCheckPackage (
case ACPI_PTYPE2_FIX_VAR:
/*
* These types all return a single Package that consists of a
- * variable number of sub-Packages.
+ * variable number of subpackages.
*
- * First, ensure that the first element is a sub-Package. If not,
+ * First, ensure that the first element is a subpackage. 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
@@ -316,11 +316,51 @@ AcpiNsCheckPackage (
Count = 1;
}
- /* Examine the sub-packages */
+ /* Examine the subpackages */
Status = AcpiNsCheckPackageList (Info, Package, Elements, Count);
break;
+ case ACPI_PTYPE2_UUID_PAIR:
+
+ /* The package must contain pairs of (UUID + type) */
+
+ if (Count & 1)
+ {
+ ExpectedCount = Count + 1;
+ goto PackageTooSmall;
+ }
+
+ while (Count > 0)
+ {
+ Status = AcpiNsCheckObjectType(Info, Elements,
+ Package->RetInfo.ObjectType1, 0);
+ if (ACPI_FAILURE(Status))
+ {
+ return (Status);
+ }
+
+ /* Validate length of the UUID buffer */
+
+ if ((*Elements)->Buffer.Length != 16)
+ {
+ ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname,
+ Info->NodeFlags, "Invalid length for UUID Buffer"));
+ return (AE_AML_OPERAND_VALUE);
+ }
+
+ Status = AcpiNsCheckObjectType(Info, Elements + 1,
+ Package->RetInfo.ObjectType2, 0);
+ if (ACPI_FAILURE(Status))
+ {
+ return (Status);
+ }
+
+ Elements += 2;
+ Count -= 2;
+ }
+ break;
+
default:
/* Should not get here if predefined info table is correct */
@@ -379,9 +419,9 @@ AcpiNsCheckPackageList (
/*
- * Validate each sub-Package in the parent Package
+ * Validate each subpackage in the parent Package
*
- * NOTE: assumes list of sub-packages contains no NULL elements.
+ * NOTE: assumes list of subpackages contains no NULL elements.
* Any NULL elements should have been removed by earlier call
* to AcpiNsRemoveNullElements.
*/
@@ -400,7 +440,7 @@ AcpiNsCheckPackageList (
return (Status);
}
- /* Examine the different types of expected sub-packages */
+ /* Examine the different types of expected subpackages */
Info->ParentPackage = SubPackage;
switch (Package->RetInfo.Type)
@@ -452,7 +492,7 @@ AcpiNsCheckPackageList (
case ACPI_PTYPE2_FIXED:
- /* Each sub-package has a fixed length */
+ /* Each subpackage has a fixed length */
ExpectedCount = Package->RetInfo2.Count;
if (SubPackage->Package.Count < ExpectedCount)
@@ -460,7 +500,7 @@ AcpiNsCheckPackageList (
goto PackageTooSmall;
}
- /* Check the type of each sub-package element */
+ /* Check the type of each subpackage element */
for (j = 0; j < ExpectedCount; j++)
{
@@ -475,7 +515,7 @@ AcpiNsCheckPackageList (
case ACPI_PTYPE2_MIN:
- /* Each sub-package has a variable but minimum length */
+ /* Each subpackage has a variable but minimum length */
ExpectedCount = Package->RetInfo.Count1;
if (SubPackage->Package.Count < ExpectedCount)
@@ -483,7 +523,7 @@ AcpiNsCheckPackageList (
goto PackageTooSmall;
}
- /* Check the type of each sub-package element */
+ /* Check the type of each subpackage element */
Status = AcpiNsCheckPackageElements (Info, SubElements,
Package->RetInfo.ObjectType1,
@@ -532,7 +572,7 @@ AcpiNsCheckPackageList (
(*SubElements)->Integer.Value = ExpectedCount;
}
- /* Check the type of each sub-package element */
+ /* Check the type of each subpackage element */
Status = AcpiNsCheckPackageElements (Info, (SubElements + 1),
Package->RetInfo.ObjectType1,
@@ -556,10 +596,10 @@ AcpiNsCheckPackageList (
PackageTooSmall:
- /* The sub-package count was smaller than required */
+ /* The subpackage count was smaller than required */
ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
- "Return Sub-Package[%u] is too small - found %u elements, expected %u",
+ "Return SubPackage[%u] is too small - found %u elements, expected %u",
i, SubPackage->Package.Count, ExpectedCount));
return (AE_AML_OPERAND_VALUE);
diff --git a/sys/contrib/dev/acpica/components/namespace/nsrepair.c b/sys/contrib/dev/acpica/components/namespace/nsrepair.c
index 879c95a..a1ffe25f 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsrepair.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsrepair.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __NSREPAIR_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -212,14 +210,29 @@ AcpiNsSimpleRepair (
* this predefined name. Either one return value is expected, or none,
* for both methods and other objects.
*
- * Exit now if there is no return object. Warning if one was expected.
+ * Try to fix if there was no return object. Warning if failed to fix.
*/
if (!ReturnObject)
{
if (ExpectedBtypes && (!(ExpectedBtypes & ACPI_RTYPE_NONE)))
{
- ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname,
- ACPI_WARN_ALWAYS, "Missing expected return value"));
+ if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT)
+ {
+ ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname,
+ ACPI_WARN_ALWAYS, "Found unexpected NULL package element"));
+
+ Status = AcpiNsRepairNullElement (Info, ExpectedBtypes,
+ PackageIndex, ReturnObjectPtr);
+ if (ACPI_SUCCESS (Status))
+ {
+ return (AE_OK); /* Repair was successful */
+ }
+ }
+ else
+ {
+ ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname,
+ ACPI_WARN_ALWAYS, "Missing expected return value"));
+ }
return (AE_AML_NO_RETURN_VALUE);
}
@@ -474,7 +487,7 @@ AcpiNsRepairNullElement (
* RETURN: None.
*
* DESCRIPTION: Remove all NULL package elements from packages that contain
- * a variable number of sub-packages. For these types of
+ * a variable number of subpackages. For these types of
* packages, NULL elements can be safely removed.
*
*****************************************************************************/
@@ -498,7 +511,7 @@ AcpiNsRemoveNullElements (
/*
* We can safely remove all NULL elements from these package types:
* PTYPE1_VAR packages contain a variable number of simple data types.
- * PTYPE2 packages contain a variable number of sub-packages.
+ * PTYPE2 packages contain a variable number of subpackages.
*/
switch (PackageType)
{
diff --git a/sys/contrib/dev/acpica/components/namespace/nsrepair2.c b/sys/contrib/dev/acpica/components/namespace/nsrepair2.c
index 6bfd17a..410b009 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsrepair2.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsrepair2.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,8 +42,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __NSREPAIR2_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -478,8 +476,8 @@ AcpiNsRepair_CID (
* DESCRIPTION: Repair for the _CST object:
* 1. Sort the list ascending by C state type
* 2. Ensure type cannot be zero
- * 3. A sub-package count of zero means _CST is meaningless
- * 4. Count must match the number of C state sub-packages
+ * 3. A subpackage count of zero means _CST is meaningless
+ * 4. Count must match the number of C state subpackages
*
*****************************************************************************/
@@ -672,6 +670,7 @@ AcpiNsRepair_PRT (
ACPI_OPERAND_OBJECT **TopObjectList;
ACPI_OPERAND_OBJECT **SubObjectList;
ACPI_OPERAND_OBJECT *ObjDesc;
+ ACPI_OPERAND_OBJECT *SubPackage;
UINT32 ElementCount;
UINT32 Index;
@@ -681,9 +680,19 @@ AcpiNsRepair_PRT (
TopObjectList = PackageObject->Package.Elements;
ElementCount = PackageObject->Package.Count;
- for (Index = 0; Index < ElementCount; Index++)
+ /* Examine each subpackage */
+
+ for (Index = 0; Index < ElementCount; Index++, TopObjectList++)
{
- SubObjectList = (*TopObjectList)->Package.Elements;
+ SubPackage = *TopObjectList;
+ SubObjectList = SubPackage->Package.Elements;
+
+ /* Check for minimum required element count */
+
+ if (SubPackage->Package.Count < 4)
+ {
+ continue;
+ }
/*
* If the BIOS has erroneously reversed the _PRT SourceName (index 2)
@@ -698,14 +707,11 @@ AcpiNsRepair_PRT (
SubObjectList[2] = ObjDesc;
Info->ReturnFlags |= ACPI_OBJECT_REPAIRED;
- ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
+ ACPI_WARN_PREDEFINED ((AE_INFO,
+ Info->FullPathname, Info->NodeFlags,
"PRT[%X]: Fixed reversed SourceName and SourceIndex",
Index));
}
-
- /* Point to the next ACPI_OPERAND_OBJECT in the top level package */
-
- TopObjectList++;
}
return (AE_OK);
@@ -745,7 +751,7 @@ AcpiNsRepair_PSS (
/*
- * Entries (sub-packages) in the _PSS Package must be sorted by power
+ * Entries (subpackages) in the _PSS Package must be sorted by power
* dissipation, in descending order. If it appears that the list is
* incorrectly sorted, sort it. We sort by CpuFrequency, since this
* should be proportional to the power.
@@ -838,9 +844,9 @@ AcpiNsRepair_TSS (
*
* PARAMETERS: Info - Method execution information block
* ReturnObject - Pointer to the top-level returned object
- * StartIndex - Index of the first sub-package
- * ExpectedCount - Minimum length of each sub-package
- * SortIndex - Sub-package entry to sort on
+ * StartIndex - Index of the first subpackage
+ * ExpectedCount - Minimum length of each subpackage
+ * SortIndex - Subpackage entry to sort on
* SortDirection - Ascending or descending
* SortKeyName - Name of the SortIndex field
*
@@ -881,7 +887,7 @@ AcpiNsCheckSortedList (
}
/*
- * NOTE: assumes list of sub-packages contains no NULL elements.
+ * NOTE: assumes list of subpackages contains no NULL elements.
* Any NULL elements should have been removed by earlier call
* to AcpiNsRemoveNullElements.
*/
@@ -911,7 +917,7 @@ AcpiNsCheckSortedList (
return (AE_AML_OPERAND_TYPE);
}
- /* Each sub-package must have the minimum length */
+ /* Each subpackage must have the minimum length */
if ((*OuterElements)->Package.Count < ExpectedCount)
{
diff --git a/sys/contrib/dev/acpica/components/namespace/nssearch.c b/sys/contrib/dev/acpica/components/namespace/nssearch.c
index 255956f..9f24f1c 100644
--- a/sys/contrib/dev/acpica/components/namespace/nssearch.c
+++ b/sys/contrib/dev/acpica/components/namespace/nssearch.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __NSSEARCH_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
diff --git a/sys/contrib/dev/acpica/components/namespace/nsutils.c b/sys/contrib/dev/acpica/components/namespace/nsutils.c
index fdde368..d7320a6 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsutils.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsutils.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,8 +42,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __NSUTILS_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -693,27 +691,29 @@ void
AcpiNsTerminate (
void)
{
- ACPI_OPERAND_OBJECT *ObjDesc;
+ ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (NsTerminate);
/*
- * 1) Free the entire namespace -- all nodes and objects
- *
- * Delete all object descriptors attached to namepsace nodes
+ * Free the entire namespace -- all nodes and all objects
+ * attached to the nodes
*/
AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode);
- /* Detach any objects attached to the root */
+ /* Delete any objects attached to the root node */
- ObjDesc = AcpiNsGetAttachedObject (AcpiGbl_RootNode);
- if (ObjDesc)
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
{
- AcpiNsDetachObject (AcpiGbl_RootNode);
+ return_VOID;
}
+ AcpiNsDeleteNode (AcpiGbl_RootNode);
+ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Namespace freed\n"));
return_VOID;
}
diff --git a/sys/contrib/dev/acpica/components/namespace/nswalk.c b/sys/contrib/dev/acpica/components/namespace/nswalk.c
index bba76ce..1674998 100644
--- a/sys/contrib/dev/acpica/components/namespace/nswalk.c
+++ b/sys/contrib/dev/acpica/components/namespace/nswalk.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __NSWALK_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
diff --git a/sys/contrib/dev/acpica/components/namespace/nsxfeval.c b/sys/contrib/dev/acpica/components/namespace/nsxfeval.c
index 984ee64..93226ef 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsxfeval.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsxfeval.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,8 +42,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __NSXFEVAL_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -91,7 +90,7 @@ AcpiEvaluateObjectTyped (
ACPI_OBJECT_TYPE ReturnType)
{
ACPI_STATUS Status;
- BOOLEAN MustFree = FALSE;
+ BOOLEAN FreeBufferOnError = FALSE;
ACPI_FUNCTION_TRACE (AcpiEvaluateObjectTyped);
@@ -106,12 +105,13 @@ AcpiEvaluateObjectTyped (
if (ReturnBuffer->Length == ACPI_ALLOCATE_BUFFER)
{
- MustFree = TRUE;
+ FreeBufferOnError = TRUE;
}
/* Evaluate the object */
- Status = AcpiEvaluateObject (Handle, Pathname, ExternalParams, ReturnBuffer);
+ Status = AcpiEvaluateObject (Handle, Pathname,
+ ExternalParams, ReturnBuffer);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -146,10 +146,15 @@ AcpiEvaluateObjectTyped (
AcpiUtGetTypeName (((ACPI_OBJECT *) ReturnBuffer->Pointer)->Type),
AcpiUtGetTypeName (ReturnType)));
- if (MustFree)
+ if (FreeBufferOnError)
{
- /* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */
-
+ /*
+ * Free a buffer created via ACPI_ALLOCATE_BUFFER.
+ * Note: We use AcpiOsFree here because AcpiOsAllocate was used
+ * to allocate the buffer. This purposefully bypasses the
+ * (optionally enabled) allocation tracking mechanism since we
+ * only want to track internal allocations.
+ */
AcpiOsFree (ReturnBuffer->Pointer);
ReturnBuffer->Pointer = NULL;
}
diff --git a/sys/contrib/dev/acpica/components/namespace/nsxfname.c b/sys/contrib/dev/acpica/components/namespace/nsxfname.c
index 9a7642e..804ea94 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsxfname.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsxfname.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,7 +42,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __NSXFNAME_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/namespace/nsxfobj.c b/sys/contrib/dev/acpica/components/namespace/nsxfobj.c
index 153dfaa..2481e7a 100644
--- a/sys/contrib/dev/acpica/components/namespace/nsxfobj.c
+++ b/sys/contrib/dev/acpica/components/namespace/nsxfobj.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,8 +42,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __NSXFOBJ_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/parser/psargs.c b/sys/contrib/dev/acpica/components/parser/psargs.c
index f61d4e1..b2a86fe 100644
--- a/sys/contrib/dev/acpica/components/parser/psargs.c
+++ b/sys/contrib/dev/acpica/components/parser/psargs.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __PSARGS_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/components/parser/psloop.c b/sys/contrib/dev/acpica/components/parser/psloop.c
index 6a88f4e..63b64ab 100644
--- a/sys/contrib/dev/acpica/components/parser/psloop.c
+++ b/sys/contrib/dev/acpica/components/parser/psloop.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
/*
* Parse the AML and build an operation tree as most interpreters, (such as
* Perl) do. Parsing is done by hand rather than with a YACC generated parser
@@ -489,6 +488,11 @@ AcpiPsParseLoop (
Status = AE_OK;
}
+ if (Status == AE_CTRL_TERMINATE)
+ {
+ return_ACPI_STATUS (Status);
+ }
+
Status = AcpiPsCompleteOp (WalkState, &Op, Status);
if (ACPI_FAILURE (Status))
{
diff --git a/sys/contrib/dev/acpica/components/parser/psobject.c b/sys/contrib/dev/acpica/components/parser/psobject.c
index 4bdb6dc..0ad37b9 100644
--- a/sys/contrib/dev/acpica/components/parser/psobject.c
+++ b/sys/contrib/dev/acpica/components/parser/psobject.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
@@ -229,7 +228,10 @@ AcpiPsBuildNamedOp (
Status = WalkState->DescendingCallback (WalkState, Op);
if (ACPI_FAILURE (Status))
{
- ACPI_EXCEPTION ((AE_INFO, Status, "During name lookup/catalog"));
+ if (Status != AE_CTRL_TERMINATE)
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "During name lookup/catalog"));
+ }
return_ACPI_STATUS (Status);
}
@@ -243,7 +245,7 @@ AcpiPsBuildNamedOp (
{
if (Status == AE_CTRL_PENDING)
{
- return_ACPI_STATUS (AE_CTRL_PARSE_PENDING);
+ Status = AE_CTRL_PARSE_PENDING;
}
return_ACPI_STATUS (Status);
}
diff --git a/sys/contrib/dev/acpica/components/parser/psopcode.c b/sys/contrib/dev/acpica/components/parser/psopcode.c
index 8ae0c80..c219778 100644
--- a/sys/contrib/dev/acpica/components/parser/psopcode.c
+++ b/sys/contrib/dev/acpica/components/parser/psopcode.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acopcode.h>
diff --git a/sys/contrib/dev/acpica/components/parser/psopinfo.c b/sys/contrib/dev/acpica/components/parser/psopinfo.c
index 3c6e4a5..e44bf7b 100644
--- a/sys/contrib/dev/acpica/components/parser/psopinfo.c
+++ b/sys/contrib/dev/acpica/components/parser/psopinfo.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
@@ -76,6 +75,10 @@ const ACPI_OPCODE_INFO *
AcpiPsGetOpcodeInfo (
UINT16 Opcode)
{
+#ifdef ACPI_DEBUG_OUTPUT
+ const char *OpcodeName = "Unknown AML opcode";
+#endif
+
ACPI_FUNCTION_NAME (PsGetOpcodeInfo);
@@ -97,10 +100,56 @@ AcpiPsGetOpcodeInfo (
return (&AcpiGbl_AmlOpInfo [AcpiGbl_LongOpIndex [(UINT8) Opcode]]);
}
+#if defined ACPI_ASL_COMPILER && defined ACPI_DEBUG_OUTPUT
+#include <contrib/dev/acpica/compiler/asldefine.h>
+
+ switch (Opcode)
+ {
+ case AML_RAW_DATA_BYTE:
+ OpcodeName = "-Raw Data Byte-";
+ break;
+
+ case AML_RAW_DATA_WORD:
+ OpcodeName = "-Raw Data Word-";
+ break;
+
+ case AML_RAW_DATA_DWORD:
+ OpcodeName = "-Raw Data Dword-";
+ break;
+
+ case AML_RAW_DATA_QWORD:
+ OpcodeName = "-Raw Data Qword-";
+ break;
+
+ case AML_RAW_DATA_BUFFER:
+ OpcodeName = "-Raw Data Buffer-";
+ break;
+
+ case AML_RAW_DATA_CHAIN:
+ OpcodeName = "-Raw Data Buffer Chain-";
+ break;
+
+ case AML_PACKAGE_LENGTH:
+ OpcodeName = "-Package Length-";
+ break;
+
+ case AML_UNASSIGNED_OPCODE:
+ OpcodeName = "-Unassigned Opcode-";
+ break;
+
+ case AML_DEFAULT_ARG_OP:
+ OpcodeName = "-Default Arg-";
+ break;
+
+ default:
+ break;
+ }
+#endif
+
/* Unknown AML opcode */
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Unknown AML opcode [%4.4X]\n", Opcode));
+ "%s [%4.4X]\n", OpcodeName, Opcode));
return (&AcpiGbl_AmlOpInfo [_UNK]);
}
diff --git a/sys/contrib/dev/acpica/components/parser/psparse.c b/sys/contrib/dev/acpica/components/parser/psparse.c
index 989abdf..aa978cc 100644
--- a/sys/contrib/dev/acpica/components/parser/psparse.c
+++ b/sys/contrib/dev/acpica/components/parser/psparse.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
/*
* Parse the AML and build an operation tree as most interpreters,
* like Perl, do. Parsing is done by hand rather than with a YACC
diff --git a/sys/contrib/dev/acpica/components/parser/psscope.c b/sys/contrib/dev/acpica/components/parser/psscope.c
index 3aa102bd..87e897e 100644
--- a/sys/contrib/dev/acpica/components/parser/psscope.c
+++ b/sys/contrib/dev/acpica/components/parser/psscope.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/components/parser/pstree.c b/sys/contrib/dev/acpica/components/parser/pstree.c
index c0eeaf6..daec8f3 100644
--- a/sys/contrib/dev/acpica/components/parser/pstree.c
+++ b/sys/contrib/dev/acpica/components/parser/pstree.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __PSTREE_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/components/parser/psutils.c b/sys/contrib/dev/acpica/components/parser/psutils.c
index 4b555cc..1a269a6 100644
--- a/sys/contrib/dev/acpica/components/parser/psutils.c
+++ b/sys/contrib/dev/acpica/components/parser/psutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/components/parser/pswalk.c b/sys/contrib/dev/acpica/components/parser/pswalk.c
index 6b6e289..044b068 100644
--- a/sys/contrib/dev/acpica/components/parser/pswalk.c
+++ b/sys/contrib/dev/acpica/components/parser/pswalk.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/components/parser/psxface.c b/sys/contrib/dev/acpica/components/parser/psxface.c
index 6235e19..2927f4c 100644
--- a/sys/contrib/dev/acpica/components/parser/psxface.c
+++ b/sys/contrib/dev/acpica/components/parser/psxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __PSXFACE_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
diff --git a/sys/contrib/dev/acpica/components/resources/rsaddr.c b/sys/contrib/dev/acpica/components/resources/rsaddr.c
index a8fa79d..f05c4fc 100644
--- a/sys/contrib/dev/acpica/components/resources/rsaddr.c
+++ b/sys/contrib/dev/acpica/components/resources/rsaddr.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __RSADDR_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acresrc.h>
diff --git a/sys/contrib/dev/acpica/components/resources/rscalc.c b/sys/contrib/dev/acpica/components/resources/rscalc.c
index 7fadb41..38db8c1 100644
--- a/sys/contrib/dev/acpica/components/resources/rscalc.c
+++ b/sys/contrib/dev/acpica/components/resources/rscalc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __RSCALC_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acresrc.h>
@@ -197,6 +195,7 @@ AcpiRsStreamOptionLength (
* FUNCTION: AcpiRsGetAmlLength
*
* PARAMETERS: Resource - Pointer to the resource linked list
+ * ResourceListSize - Size of the resource linked list
* SizeNeeded - Where the required size is returned
*
* RETURN: Status
@@ -210,9 +209,11 @@ AcpiRsStreamOptionLength (
ACPI_STATUS
AcpiRsGetAmlLength (
ACPI_RESOURCE *Resource,
+ ACPI_SIZE ResourceListSize,
ACPI_SIZE *SizeNeeded)
{
ACPI_SIZE AmlSizeNeeded = 0;
+ ACPI_RESOURCE *ResourceEnd;
ACPI_RS_LENGTH TotalSize;
@@ -221,7 +222,8 @@ AcpiRsGetAmlLength (
/* Traverse entire list of internal resource descriptors */
- while (Resource)
+ ResourceEnd = ACPI_ADD_PTR (ACPI_RESOURCE, Resource, ResourceListSize);
+ while (Resource < ResourceEnd)
{
/* Validate the descriptor type */
@@ -655,7 +657,7 @@ AcpiRsGetPciRoutingTableLength (
for (Index = 0; Index < NumberOfElements; Index++)
{
- /* Dereference the sub-package */
+ /* Dereference the subpackage */
PackageElement = *TopObjectList;
diff --git a/sys/contrib/dev/acpica/components/resources/rscreate.c b/sys/contrib/dev/acpica/components/resources/rscreate.c
index b599666..c646129 100644
--- a/sys/contrib/dev/acpica/components/resources/rscreate.c
+++ b/sys/contrib/dev/acpica/components/resources/rscreate.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __RSCREATE_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acresrc.h>
@@ -77,6 +75,10 @@ AcpiBufferToResource (
void *Resource;
void *CurrentResourcePtr;
+
+ ACPI_FUNCTION_TRACE (AcpiBufferToResource);
+
+
/*
* Note: we allow AE_AML_NO_RESOURCE_END_TAG, since an end tag
* is not required here.
@@ -92,7 +94,7 @@ AcpiBufferToResource (
}
if (ACPI_FAILURE (Status))
{
- return (Status);
+ return_ACPI_STATUS (Status);
}
/* Allocate a buffer for the converted resource */
@@ -101,7 +103,7 @@ AcpiBufferToResource (
CurrentResourcePtr = Resource;
if (!Resource)
{
- return (AE_NO_MEMORY);
+ return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Perform the AML-to-Resource conversion */
@@ -121,9 +123,11 @@ AcpiBufferToResource (
*ResourcePtr = Resource;
}
- return (Status);
+ return_ACPI_STATUS (Status);
}
+ACPI_EXPORT_SYMBOL (AcpiBufferToResource)
+
/*******************************************************************************
*
@@ -297,7 +301,7 @@ AcpiRsCreatePciRoutingTable (
*/
UserPrt->Length = (sizeof (ACPI_PCI_ROUTING_TABLE) - 4);
- /* Each sub-package must be of length 4 */
+ /* Each subpackage must be of length 4 */
if ((*TopObjectList)->Package.Count != 4)
{
@@ -308,7 +312,7 @@ AcpiRsCreatePciRoutingTable (
}
/*
- * Dereference the sub-package.
+ * Dereference the subpackage.
* The SubObjectList will now point to an array of the four IRQ
* elements: [Address, Pin, Source, SourceIndex]
*/
@@ -317,7 +321,7 @@ AcpiRsCreatePciRoutingTable (
/* 1) First subobject: Dereference the PRT.Address */
ObjDesc = SubObjectList[0];
- if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
+ if (!ObjDesc || ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
{
ACPI_ERROR ((AE_INFO, "(PRT[%u].Address) Need Integer, found %s",
Index, AcpiUtGetObjectTypeName (ObjDesc)));
@@ -329,7 +333,7 @@ AcpiRsCreatePciRoutingTable (
/* 2) Second subobject: Dereference the PRT.Pin */
ObjDesc = SubObjectList[1];
- if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
+ if (!ObjDesc || ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
{
ACPI_ERROR ((AE_INFO, "(PRT[%u].Pin) Need Integer, found %s",
Index, AcpiUtGetObjectTypeName (ObjDesc)));
@@ -410,7 +414,7 @@ AcpiRsCreatePciRoutingTable (
/* 4) Fourth subobject: Dereference the PRT.SourceIndex */
ObjDesc = SubObjectList[3];
- if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
+ if (!ObjDesc || ObjDesc->Common.Type != ACPI_TYPE_INTEGER)
{
ACPI_ERROR ((AE_INFO,
"(PRT[%u].SourceIndex) Need Integer, found %s",
@@ -435,23 +439,22 @@ AcpiRsCreatePciRoutingTable (
*
* FUNCTION: AcpiRsCreateAmlResources
*
- * PARAMETERS: LinkedListBuffer - Pointer to the resource linked list
- * OutputBuffer - Pointer to the user's buffer
+ * PARAMETERS: ResourceList - Pointer to the resource list buffer
+ * OutputBuffer - Where the AML buffer is returned
*
* RETURN: Status AE_OK if okay, else a valid ACPI_STATUS code.
* If the OutputBuffer is too small, the error will be
* AE_BUFFER_OVERFLOW and OutputBuffer->Length will point
* to the size buffer needed.
*
- * DESCRIPTION: Takes the linked list of device resources and
- * creates a bytestream to be used as input for the
- * _SRS control method.
+ * DESCRIPTION: Converts a list of device resources to an AML bytestream
+ * to be used as input for the _SRS control method.
*
******************************************************************************/
ACPI_STATUS
AcpiRsCreateAmlResources (
- ACPI_RESOURCE *LinkedListBuffer,
+ ACPI_BUFFER *ResourceList,
ACPI_BUFFER *OutputBuffer)
{
ACPI_STATUS Status;
@@ -461,17 +464,15 @@ AcpiRsCreateAmlResources (
ACPI_FUNCTION_TRACE (RsCreateAmlResources);
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "LinkedListBuffer = %p\n",
- LinkedListBuffer));
+ /* Params already validated, no need to re-validate here */
- /*
- * Params already validated, so we don't re-validate here
- *
- * Pass the LinkedListBuffer into a module that calculates
- * the buffer size needed for the byte stream.
- */
- Status = AcpiRsGetAmlLength (LinkedListBuffer,
- &AmlSizeNeeded);
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ResourceList Buffer = %p\n",
+ ResourceList->Pointer));
+
+ /* Get the buffer size needed for the AML byte stream */
+
+ Status = AcpiRsGetAmlLength (ResourceList->Pointer,
+ ResourceList->Length, &AmlSizeNeeded);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n",
(UINT32) AmlSizeNeeded, AcpiFormatException (Status)));
@@ -490,14 +491,14 @@ AcpiRsCreateAmlResources (
/* Do the conversion */
- Status = AcpiRsConvertResourcesToAml (LinkedListBuffer, AmlSizeNeeded,
- OutputBuffer->Pointer);
+ Status = AcpiRsConvertResourcesToAml (ResourceList->Pointer,
+ AmlSizeNeeded, OutputBuffer->Pointer);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "OutputBuffer %p Length %X\n",
- OutputBuffer->Pointer, (UINT32) OutputBuffer->Length));
+ OutputBuffer->Pointer, (UINT32) OutputBuffer->Length));
return_ACPI_STATUS (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/components/resources/rsdump.c b/sys/contrib/dev/acpica/components/resources/rsdump.c
index d729795..ddae6e0 100644
--- a/sys/contrib/dev/acpica/components/resources/rsdump.c
+++ b/sys/contrib/dev/acpica/components/resources/rsdump.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __RSDUMP_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acresrc.h>
@@ -52,7 +49,7 @@
ACPI_MODULE_NAME ("rsdump")
-#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
+#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER)
/* Local prototypes */
diff --git a/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c b/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c
index 865209b..aab597a 100644
--- a/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c
+++ b/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __RSDUMPINFO_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acresrc.h>
@@ -52,7 +49,7 @@
ACPI_MODULE_NAME ("rsdumpinfo")
-#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
+#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER)
#define ACPI_RSD_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_RESOURCE_DATA,f)
diff --git a/sys/contrib/dev/acpica/components/resources/rsinfo.c b/sys/contrib/dev/acpica/components/resources/rsinfo.c
index cb72332..f34b905 100644
--- a/sys/contrib/dev/acpica/components/resources/rsinfo.c
+++ b/sys/contrib/dev/acpica/components/resources/rsinfo.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __RSINFO_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acresrc.h>
@@ -141,7 +139,7 @@ ACPI_RSCONVERT_INFO *AcpiGbl_ConvertResourceSerialBusDispatch[] =
};
-#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
+#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER)
/* Dispatch table for resource dump functions */
diff --git a/sys/contrib/dev/acpica/components/resources/rsio.c b/sys/contrib/dev/acpica/components/resources/rsio.c
index 1a41fb9..473fe36 100644
--- a/sys/contrib/dev/acpica/components/resources/rsio.c
+++ b/sys/contrib/dev/acpica/components/resources/rsio.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __RSIO_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acresrc.h>
diff --git a/sys/contrib/dev/acpica/components/resources/rsirq.c b/sys/contrib/dev/acpica/components/resources/rsirq.c
index b3b5ee57..cf91f3d 100644
--- a/sys/contrib/dev/acpica/components/resources/rsirq.c
+++ b/sys/contrib/dev/acpica/components/resources/rsirq.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __RSIRQ_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acresrc.h>
diff --git a/sys/contrib/dev/acpica/components/resources/rslist.c b/sys/contrib/dev/acpica/components/resources/rslist.c
index 81e7292..8261058 100644
--- a/sys/contrib/dev/acpica/components/resources/rslist.c
+++ b/sys/contrib/dev/acpica/components/resources/rslist.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __RSLIST_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acresrc.h>
diff --git a/sys/contrib/dev/acpica/components/resources/rsmemory.c b/sys/contrib/dev/acpica/components/resources/rsmemory.c
index 049a7b1..761a000 100644
--- a/sys/contrib/dev/acpica/components/resources/rsmemory.c
+++ b/sys/contrib/dev/acpica/components/resources/rsmemory.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __RSMEMORY_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acresrc.h>
diff --git a/sys/contrib/dev/acpica/components/resources/rsmisc.c b/sys/contrib/dev/acpica/components/resources/rsmisc.c
index e895add..bc5b803 100644
--- a/sys/contrib/dev/acpica/components/resources/rsmisc.c
+++ b/sys/contrib/dev/acpica/components/resources/rsmisc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __RSMISC_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acresrc.h>
diff --git a/sys/contrib/dev/acpica/components/resources/rsserial.c b/sys/contrib/dev/acpica/components/resources/rsserial.c
index 69e2259..00e1887 100644
--- a/sys/contrib/dev/acpica/components/resources/rsserial.c
+++ b/sys/contrib/dev/acpica/components/resources/rsserial.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __RSIRQ_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acresrc.h>
diff --git a/sys/contrib/dev/acpica/components/resources/rsutils.c b/sys/contrib/dev/acpica/components/resources/rsutils.c
index 499efb9..c0e7b78 100644
--- a/sys/contrib/dev/acpica/components/resources/rsutils.c
+++ b/sys/contrib/dev/acpica/components/resources/rsutils.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __RSUTILS_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -827,7 +824,7 @@ AcpiRsSetSrsMethodData (
* Convert the linked list into a byte stream
*/
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
- Status = AcpiRsCreateAmlResources (InBuffer->Pointer, &Buffer);
+ Status = AcpiRsCreateAmlResources (InBuffer, &Buffer);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
diff --git a/sys/contrib/dev/acpica/components/resources/rsxface.c b/sys/contrib/dev/acpica/components/resources/rsxface.c
index b2ff381..2fe3e6f 100644
--- a/sys/contrib/dev/acpica/components/resources/rsxface.c
+++ b/sys/contrib/dev/acpica/components/resources/rsxface.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __RSXFACE_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/tables/tbdata.c b/sys/contrib/dev/acpica/components/tables/tbdata.c
new file mode 100644
index 0000000..4ff62dd
--- /dev/null
+++ b/sys/contrib/dev/acpica/components/tables/tbdata.c
@@ -0,0 +1,853 @@
+/******************************************************************************
+ *
+ * Module Name: tbdata - Table manager data structure functions
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/acnamesp.h>
+#include <contrib/dev/acpica/include/actables.h>
+
+#define _COMPONENT ACPI_TABLES
+ ACPI_MODULE_NAME ("tbdata")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbInitTableDescriptor
+ *
+ * PARAMETERS: TableDesc - Table descriptor
+ * Address - Physical address of the table
+ * Flags - Allocation flags of the table
+ * Table - Pointer to the table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Initialize a new table descriptor
+ *
+ ******************************************************************************/
+
+void
+AcpiTbInitTableDescriptor (
+ ACPI_TABLE_DESC *TableDesc,
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT8 Flags,
+ ACPI_TABLE_HEADER *Table)
+{
+
+ /*
+ * Initialize the table descriptor. Set the pointer to NULL, since the
+ * table is not fully mapped at this time.
+ */
+ ACPI_MEMSET (TableDesc, 0, sizeof (ACPI_TABLE_DESC));
+ TableDesc->Address = Address;
+ TableDesc->Length = Table->Length;
+ TableDesc->Flags = Flags;
+ ACPI_MOVE_32_TO_32 (TableDesc->Signature.Ascii, Table->Signature);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbAcquireTable
+ *
+ * PARAMETERS: TableDesc - Table descriptor
+ * TablePtr - Where table is returned
+ * TableLength - Where table length is returned
+ * TableFlags - Where table allocation flags are returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Acquire an ACPI table. It can be used for tables not
+ * maintained in the AcpiGbl_RootTableList.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiTbAcquireTable (
+ ACPI_TABLE_DESC *TableDesc,
+ ACPI_TABLE_HEADER **TablePtr,
+ UINT32 *TableLength,
+ UINT8 *TableFlags)
+{
+ ACPI_TABLE_HEADER *Table = NULL;
+
+
+ switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK)
+ {
+ case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL:
+
+ Table = AcpiOsMapMemory (TableDesc->Address, TableDesc->Length);
+ break;
+
+ case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
+ case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
+
+ Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, TableDesc->Address);
+ break;
+
+ default:
+
+ break;
+ }
+
+ /* Table is not valid yet */
+
+ if (!Table)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ /* Fill the return values */
+
+ *TablePtr = Table;
+ *TableLength = TableDesc->Length;
+ *TableFlags = TableDesc->Flags;
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbReleaseTable
+ *
+ * PARAMETERS: Table - Pointer for the table
+ * TableLength - Length for the table
+ * TableFlags - Allocation flags for the table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Release a table. The inverse of AcpiTbAcquireTable().
+ *
+ ******************************************************************************/
+
+void
+AcpiTbReleaseTable (
+ ACPI_TABLE_HEADER *Table,
+ UINT32 TableLength,
+ UINT8 TableFlags)
+{
+
+ switch (TableFlags & ACPI_TABLE_ORIGIN_MASK)
+ {
+ case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL:
+
+ AcpiOsUnmapMemory (Table, TableLength);
+ break;
+
+ case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
+ case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
+ default:
+
+ break;
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbAcquireTempTable
+ *
+ * PARAMETERS: TableDesc - Table descriptor to be acquired
+ * Address - Address of the table
+ * Flags - Allocation flags of the table
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: This function validates the table header to obtain the length
+ * of a table and fills the table descriptor to make its state as
+ * "INSTALLED". Such a table descriptor is only used for verified
+ * installation.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiTbAcquireTempTable (
+ ACPI_TABLE_DESC *TableDesc,
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT8 Flags)
+{
+ ACPI_TABLE_HEADER *TableHeader;
+
+
+ switch (Flags & ACPI_TABLE_ORIGIN_MASK)
+ {
+ case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL:
+
+ /* Get the length of the full table from the header */
+
+ TableHeader = AcpiOsMapMemory (Address, sizeof (ACPI_TABLE_HEADER));
+ if (!TableHeader)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ AcpiTbInitTableDescriptor (TableDesc, Address, Flags, TableHeader);
+ AcpiOsUnmapMemory (TableHeader, sizeof (ACPI_TABLE_HEADER));
+ return (AE_OK);
+
+ case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
+ case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
+
+ TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER, Address);
+ if (!TableHeader)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ AcpiTbInitTableDescriptor (TableDesc, Address, Flags, TableHeader);
+ return (AE_OK);
+
+ default:
+
+ break;
+ }
+
+ /* Table is not valid yet */
+
+ return (AE_NO_MEMORY);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbReleaseTempTable
+ *
+ * PARAMETERS: TableDesc - Table descriptor to be released
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: The inverse of AcpiTbAcquireTempTable().
+ *
+ *****************************************************************************/
+
+void
+AcpiTbReleaseTempTable (
+ ACPI_TABLE_DESC *TableDesc)
+{
+
+ /*
+ * Note that the .Address is maintained by the callers of
+ * AcpiTbAcquireTempTable(), thus do not invoke AcpiTbUninstallTable()
+ * where .Address will be freed.
+ */
+ AcpiTbInvalidateTable (TableDesc);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiTbValidateTable
+ *
+ * PARAMETERS: TableDesc - Table descriptor
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: This function is called to validate the table, the returned
+ * table descriptor is in "VALIDATED" state.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AcpiTbValidateTable (
+ ACPI_TABLE_DESC *TableDesc)
+{
+ ACPI_STATUS Status = AE_OK;
+
+
+ ACPI_FUNCTION_TRACE (TbValidateTable);
+
+
+ /* Validate the table if necessary */
+
+ if (!TableDesc->Pointer)
+ {
+ Status = AcpiTbAcquireTable (TableDesc, &TableDesc->Pointer,
+ &TableDesc->Length, &TableDesc->Flags);
+ if (!TableDesc->Pointer)
+ {
+ Status = AE_NO_MEMORY;
+ }
+ }
+
+ return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbInvalidateTable
+ *
+ * PARAMETERS: TableDesc - Table descriptor
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Invalidate one internal ACPI table, this is the inverse of
+ * AcpiTbValidateTable().
+ *
+ ******************************************************************************/
+
+void
+AcpiTbInvalidateTable (
+ ACPI_TABLE_DESC *TableDesc)
+{
+
+ ACPI_FUNCTION_TRACE (TbInvalidateTable);
+
+
+ /* Table must be validated */
+
+ if (!TableDesc->Pointer)
+ {
+ return_VOID;
+ }
+
+ AcpiTbReleaseTable (TableDesc->Pointer, TableDesc->Length,
+ TableDesc->Flags);
+ TableDesc->Pointer = NULL;
+
+ return_VOID;
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiTbValidateTempTable
+ *
+ * PARAMETERS: TableDesc - Table descriptor
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: This function is called to validate the table, the returned
+ * table descriptor is in "VALIDATED" state.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AcpiTbValidateTempTable (
+ ACPI_TABLE_DESC *TableDesc)
+{
+
+ if (!TableDesc->Pointer && !AcpiGbl_VerifyTableChecksum)
+ {
+ /*
+ * Only validates the header of the table.
+ * Note that Length contains the size of the mapping after invoking
+ * this work around, this value is required by
+ * AcpiTbReleaseTempTable().
+ * We can do this because in AcpiInitTableDescriptor(), the Length
+ * field of the installed descriptor is filled with the actual
+ * table length obtaining from the table header.
+ */
+ TableDesc->Length = sizeof (ACPI_TABLE_HEADER);
+ }
+
+ return (AcpiTbValidateTable (TableDesc));
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiTbVerifyTempTable
+ *
+ * PARAMETERS: TableDesc - Table descriptor
+ * Signature - Table signature to verify
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: This function is called to validate and verify the table, the
+ * returned table descriptor is in "VALIDATED" state.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AcpiTbVerifyTempTable (
+ ACPI_TABLE_DESC *TableDesc,
+ char *Signature)
+{
+ ACPI_STATUS Status = AE_OK;
+
+
+ ACPI_FUNCTION_TRACE (TbVerifyTempTable);
+
+
+ /* Validate the table */
+
+ Status = AcpiTbValidateTempTable (TableDesc);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ /* If a particular signature is expected (DSDT/FACS), it must match */
+
+ if (Signature &&
+ !ACPI_COMPARE_NAME (&TableDesc->Signature, Signature))
+ {
+ ACPI_BIOS_ERROR ((AE_INFO,
+ "Invalid signature 0x%X for ACPI table, expected [%s]",
+ TableDesc->Signature.Integer, Signature));
+ Status = AE_BAD_SIGNATURE;
+ goto InvalidateAndExit;
+ }
+
+ /* Verify the checksum */
+
+ if (AcpiGbl_VerifyTableChecksum)
+ {
+ Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
+ "%4.4s " ACPI_PRINTF_UINT
+ " Attempted table install failed",
+ AcpiUtValidAcpiName (TableDesc->Signature.Ascii) ?
+ TableDesc->Signature.Ascii : "????",
+ ACPI_FORMAT_TO_UINT (TableDesc->Address)));
+ goto InvalidateAndExit;
+ }
+ }
+
+ return_ACPI_STATUS (AE_OK);
+
+InvalidateAndExit:
+ AcpiTbInvalidateTable (TableDesc);
+ return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbResizeRootTableList
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Expand the size of global table array
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiTbResizeRootTableList (
+ void)
+{
+ ACPI_TABLE_DESC *Tables;
+ UINT32 TableCount;
+
+
+ ACPI_FUNCTION_TRACE (TbResizeRootTableList);
+
+
+ /* AllowResize flag is a parameter to AcpiInitializeTables */
+
+ if (!(AcpiGbl_RootTableList.Flags & ACPI_ROOT_ALLOW_RESIZE))
+ {
+ ACPI_ERROR ((AE_INFO, "Resize of Root Table Array is not allowed"));
+ return_ACPI_STATUS (AE_SUPPORT);
+ }
+
+ /* Increase the Table Array size */
+
+ if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
+ {
+ TableCount = AcpiGbl_RootTableList.MaxTableCount;
+ }
+ else
+ {
+ TableCount = AcpiGbl_RootTableList.CurrentTableCount;
+ }
+
+ Tables = ACPI_ALLOCATE_ZEROED (
+ ((ACPI_SIZE) TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT) *
+ sizeof (ACPI_TABLE_DESC));
+ if (!Tables)
+ {
+ ACPI_ERROR ((AE_INFO, "Could not allocate new root table array"));
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ /* Copy and free the previous table array */
+
+ if (AcpiGbl_RootTableList.Tables)
+ {
+ ACPI_MEMCPY (Tables, AcpiGbl_RootTableList.Tables,
+ (ACPI_SIZE) TableCount * sizeof (ACPI_TABLE_DESC));
+
+ if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
+ {
+ ACPI_FREE (AcpiGbl_RootTableList.Tables);
+ }
+ }
+
+ AcpiGbl_RootTableList.Tables = Tables;
+ AcpiGbl_RootTableList.MaxTableCount =
+ TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT;
+ AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED;
+
+ return_ACPI_STATUS (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbGetNextRootIndex
+ *
+ * PARAMETERS: TableIndex - Where table index is returned
+ *
+ * RETURN: Status and table index.
+ *
+ * DESCRIPTION: Allocate a new ACPI table entry to the global table list
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiTbGetNextRootIndex (
+ UINT32 *TableIndex)
+{
+ ACPI_STATUS Status;
+
+
+ /* Ensure that there is room for the table in the Root Table List */
+
+ if (AcpiGbl_RootTableList.CurrentTableCount >=
+ AcpiGbl_RootTableList.MaxTableCount)
+ {
+ Status = AcpiTbResizeRootTableList();
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ }
+
+ *TableIndex = AcpiGbl_RootTableList.CurrentTableCount;
+ AcpiGbl_RootTableList.CurrentTableCount++;
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbTerminate
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Delete all internal ACPI tables
+ *
+ ******************************************************************************/
+
+void
+AcpiTbTerminate (
+ void)
+{
+ UINT32 i;
+
+
+ ACPI_FUNCTION_TRACE (TbTerminate);
+
+
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+
+ /* Delete the individual tables */
+
+ for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
+ {
+ AcpiTbUninstallTable (&AcpiGbl_RootTableList.Tables[i]);
+ }
+
+ /*
+ * Delete the root table array if allocated locally. Array cannot be
+ * mapped, so we don't need to check for that flag.
+ */
+ if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
+ {
+ ACPI_FREE (AcpiGbl_RootTableList.Tables);
+ }
+
+ AcpiGbl_RootTableList.Tables = NULL;
+ AcpiGbl_RootTableList.Flags = 0;
+ AcpiGbl_RootTableList.CurrentTableCount = 0;
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ACPI Tables freed\n"));
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ return_VOID;
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbDeleteNamespaceByOwner
+ *
+ * PARAMETERS: TableIndex - Table index
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Delete all namespace objects created when this table was loaded.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiTbDeleteNamespaceByOwner (
+ UINT32 TableIndex)
+{
+ ACPI_OWNER_ID OwnerId;
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_TRACE (TbDeleteNamespaceByOwner);
+
+
+ Status = AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount)
+ {
+ /* The table index does not exist */
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ return_ACPI_STATUS (AE_NOT_EXIST);
+ }
+
+ /* Get the owner ID for this table, used to delete namespace nodes */
+
+ OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId;
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+
+ /*
+ * Need to acquire the namespace writer lock to prevent interference
+ * with any concurrent namespace walks. The interpreter must be
+ * released during the deletion since the acquisition of the deletion
+ * lock may block, and also since the execution of a namespace walk
+ * must be allowed to use the interpreter.
+ */
+ (void) AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER);
+ Status = AcpiUtAcquireWriteLock (&AcpiGbl_NamespaceRwLock);
+
+ AcpiNsDeleteNamespaceByOwner (OwnerId);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ AcpiUtReleaseWriteLock (&AcpiGbl_NamespaceRwLock);
+
+ Status = AcpiUtAcquireMutex (ACPI_MTX_INTERPRETER);
+ return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbAllocateOwnerId
+ *
+ * PARAMETERS: TableIndex - Table index
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Allocates OwnerId in TableDesc
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiTbAllocateOwnerId (
+ UINT32 TableIndex)
+{
+ ACPI_STATUS Status = AE_BAD_PARAMETER;
+
+
+ ACPI_FUNCTION_TRACE (TbAllocateOwnerId);
+
+
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+ if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
+ {
+ Status = AcpiUtAllocateOwnerId (
+ &(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId));
+ }
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbReleaseOwnerId
+ *
+ * PARAMETERS: TableIndex - Table index
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Releases OwnerId in TableDesc
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiTbReleaseOwnerId (
+ UINT32 TableIndex)
+{
+ ACPI_STATUS Status = AE_BAD_PARAMETER;
+
+
+ ACPI_FUNCTION_TRACE (TbReleaseOwnerId);
+
+
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+ if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
+ {
+ AcpiUtReleaseOwnerId (
+ &(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId));
+ Status = AE_OK;
+ }
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbGetOwnerId
+ *
+ * PARAMETERS: TableIndex - Table index
+ * OwnerId - Where the table OwnerId is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: returns OwnerId for the ACPI table
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiTbGetOwnerId (
+ UINT32 TableIndex,
+ ACPI_OWNER_ID *OwnerId)
+{
+ ACPI_STATUS Status = AE_BAD_PARAMETER;
+
+
+ ACPI_FUNCTION_TRACE (TbGetOwnerId);
+
+
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+ if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
+ {
+ *OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId;
+ Status = AE_OK;
+ }
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbIsTableLoaded
+ *
+ * PARAMETERS: TableIndex - Index into the root table
+ *
+ * RETURN: Table Loaded Flag
+ *
+ ******************************************************************************/
+
+BOOLEAN
+AcpiTbIsTableLoaded (
+ UINT32 TableIndex)
+{
+ BOOLEAN IsLoaded = FALSE;
+
+
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+ if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
+ {
+ IsLoaded = (BOOLEAN)
+ (AcpiGbl_RootTableList.Tables[TableIndex].Flags &
+ ACPI_TABLE_IS_LOADED);
+ }
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ return (IsLoaded);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiTbSetTableLoadedFlag
+ *
+ * PARAMETERS: TableIndex - Table index
+ * IsLoaded - TRUE if table is loaded, FALSE otherwise
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Sets the table loaded flag to either TRUE or FALSE.
+ *
+ ******************************************************************************/
+
+void
+AcpiTbSetTableLoadedFlag (
+ UINT32 TableIndex,
+ BOOLEAN IsLoaded)
+{
+
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+ if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
+ {
+ if (IsLoaded)
+ {
+ AcpiGbl_RootTableList.Tables[TableIndex].Flags |=
+ ACPI_TABLE_IS_LOADED;
+ }
+ else
+ {
+ AcpiGbl_RootTableList.Tables[TableIndex].Flags &=
+ ~ACPI_TABLE_IS_LOADED;
+ }
+ }
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+}
diff --git a/sys/contrib/dev/acpica/components/tables/tbfadt.c b/sys/contrib/dev/acpica/components/tables/tbfadt.c
index 4a27520..f35e217 100644
--- a/sys/contrib/dev/acpica/components/tables/tbfadt.c
+++ b/sys/contrib/dev/acpica/components/tables/tbfadt.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __TBFADT_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/actables.h>
@@ -58,20 +56,23 @@ AcpiTbInitGenericAddress (
UINT8 SpaceId,
UINT8 ByteWidth,
UINT64 Address,
- char *RegisterName);
+ char *RegisterName,
+ UINT8 Flags);
static void
AcpiTbConvertFadt (
void);
static void
-AcpiTbValidateFadt (
- void);
-
-static void
AcpiTbSetupFadtRegisters (
void);
+static UINT64
+AcpiTbSelectAddress (
+ char *RegisterName,
+ UINT32 Address32,
+ UINT64 Address64);
+
/* Table for conversion of FADT to common internal format and FADT validation */
@@ -82,13 +83,14 @@ typedef struct acpi_fadt_info
UINT16 Address32;
UINT16 Length;
UINT8 DefaultLength;
- UINT8 Type;
+ UINT8 Flags;
} ACPI_FADT_INFO;
#define ACPI_FADT_OPTIONAL 0
#define ACPI_FADT_REQUIRED 1
#define ACPI_FADT_SEPARATE_LENGTH 2
+#define ACPI_FADT_GPE_REGISTER 4
static ACPI_FADT_INFO FadtInfoTable[] =
{
@@ -139,14 +141,14 @@ static ACPI_FADT_INFO FadtInfoTable[] =
ACPI_FADT_OFFSET (Gpe0Block),
ACPI_FADT_OFFSET (Gpe0BlockLength),
0,
- ACPI_FADT_SEPARATE_LENGTH},
+ ACPI_FADT_SEPARATE_LENGTH | ACPI_FADT_GPE_REGISTER},
{"Gpe1Block",
ACPI_FADT_OFFSET (XGpe1Block),
ACPI_FADT_OFFSET (Gpe1Block),
ACPI_FADT_OFFSET (Gpe1BlockLength),
0,
- ACPI_FADT_SEPARATE_LENGTH}
+ ACPI_FADT_SEPARATE_LENGTH | ACPI_FADT_GPE_REGISTER}
};
#define ACPI_FADT_INFO_ENTRIES \
@@ -194,6 +196,7 @@ static ACPI_FADT_PM_INFO FadtPmInfoTable[] =
* SpaceId - ACPI Space ID for this register
* ByteWidth - Width of this register
* Address - Address of the register
+ * RegisterName - ASCII name of the ACPI register
*
* RETURN: None
*
@@ -209,21 +212,31 @@ AcpiTbInitGenericAddress (
UINT8 SpaceId,
UINT8 ByteWidth,
UINT64 Address,
- char *RegisterName)
+ char *RegisterName,
+ UINT8 Flags)
{
UINT8 BitWidth;
- /* Bit width field in the GAS is only one byte long, 255 max */
-
+ /*
+ * Bit width field in the GAS is only one byte long, 255 max.
+ * Check for BitWidth overflow in GAS.
+ */
BitWidth = (UINT8) (ByteWidth * 8);
-
- if (ByteWidth > 31) /* (31*8)=248 */
+ if (ByteWidth > 31) /* (31*8)=248, (32*8)=256 */
{
- ACPI_ERROR ((AE_INFO,
- "%s - 32-bit FADT register is too long (%u bytes, %u bits) "
- "to convert to GAS struct - 255 bits max, truncating",
- RegisterName, ByteWidth, (ByteWidth * 8)));
+ /*
+ * No error for GPE blocks, because we do not use the BitWidth
+ * for GPEs, the legacy length (ByteWidth) is used instead to
+ * allow for a large number of GPEs.
+ */
+ if (!(Flags & ACPI_FADT_GPE_REGISTER))
+ {
+ ACPI_ERROR ((AE_INFO,
+ "%s - 32-bit FADT register is too long (%u bytes, %u bits) "
+ "to convert to GAS struct - 255 bits max, truncating",
+ RegisterName, ByteWidth, (ByteWidth * 8)));
+ }
BitWidth = 255;
}
@@ -245,6 +258,72 @@ AcpiTbInitGenericAddress (
/*******************************************************************************
*
+ * FUNCTION: AcpiTbSelectAddress
+ *
+ * PARAMETERS: RegisterName - ASCII name of the ACPI register
+ * Address32 - 32-bit address of the register
+ * Address64 - 64-bit address of the register
+ *
+ * RETURN: The resolved 64-bit address
+ *
+ * DESCRIPTION: Select between 32-bit and 64-bit versions of addresses within
+ * the FADT. Used for the FACS and DSDT addresses.
+ *
+ * NOTES:
+ *
+ * Check for FACS and DSDT address mismatches. An address mismatch between
+ * the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and
+ * DSDT/X_DSDT) could be a corrupted address field or it might indicate
+ * the presence of two FACS or two DSDT tables.
+ *
+ * November 2013:
+ * By default, as per the ACPICA specification, a valid 64-bit address is
+ * used regardless of the value of the 32-bit address. However, this
+ * behavior can be overridden via the AcpiGbl_Use32BitFadtAddresses flag.
+ *
+ ******************************************************************************/
+
+static UINT64
+AcpiTbSelectAddress (
+ char *RegisterName,
+ UINT32 Address32,
+ UINT64 Address64)
+{
+
+ if (!Address64)
+ {
+ /* 64-bit address is zero, use 32-bit address */
+
+ return ((UINT64) Address32);
+ }
+
+ if (Address32 &&
+ (Address64 != (UINT64) Address32))
+ {
+ /* Address mismatch between 32-bit and 64-bit versions */
+
+ ACPI_BIOS_WARNING ((AE_INFO,
+ "32/64X %s address mismatch in FADT: "
+ "0x%8.8X/0x%8.8X%8.8X, using %u-bit address",
+ RegisterName, Address32, ACPI_FORMAT_UINT64 (Address64),
+ AcpiGbl_Use32BitFadtAddresses ? 32 : 64));
+
+ /* 32-bit address override */
+
+ if (AcpiGbl_Use32BitFadtAddresses)
+ {
+ return ((UINT64) Address32);
+ }
+ }
+
+ /* Default is to use the 64-bit address */
+
+ return (Address64);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiTbParseFadt
*
* PARAMETERS: TableIndex - Index for the FADT
@@ -296,14 +375,14 @@ AcpiTbParseFadt (
/* Obtain the DSDT and FACS tables via their addresses within the FADT */
- AcpiTbInstallTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XDsdt,
+ AcpiTbInstallFixedTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XDsdt,
ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT);
/* If Hardware Reduced flag is set, there is no FACS */
if (!AcpiGbl_ReducedHardware)
{
- AcpiTbInstallTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs,
+ AcpiTbInstallFixedTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs,
ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS);
}
}
@@ -365,10 +444,6 @@ AcpiTbCreateLocalFadt (
AcpiTbConvertFadt ();
- /* Validate FADT values now, before we make any changes */
-
- AcpiTbValidateFadt ();
-
/* Initialize the global ACPI register structures */
AcpiTbSetupFadtRegisters ();
@@ -379,33 +454,43 @@ AcpiTbCreateLocalFadt (
*
* FUNCTION: AcpiTbConvertFadt
*
- * PARAMETERS: None, uses AcpiGbl_FADT
+ * PARAMETERS: None - AcpiGbl_FADT is used.
*
* RETURN: None
*
* DESCRIPTION: Converts all versions of the FADT to a common internal format.
- * Expand 32-bit addresses to 64-bit as necessary.
+ * Expand 32-bit addresses to 64-bit as necessary. Also validate
+ * important fields within the FADT.
*
- * NOTE: AcpiGbl_FADT must be of size (ACPI_TABLE_FADT),
- * and must contain a copy of the actual FADT.
+ * NOTE: AcpiGbl_FADT must be of size (ACPI_TABLE_FADT), and must
+ * contain a copy of the actual BIOS-provided FADT.
*
* Notes on 64-bit register addresses:
*
* After this FADT conversion, later ACPICA code will only use the 64-bit "X"
* fields of the FADT for all ACPI register addresses.
*
- * The 64-bit "X" fields are optional extensions to the original 32-bit FADT
+ * The 64-bit X fields are optional extensions to the original 32-bit FADT
* V1.0 fields. Even if they are present in the FADT, they are optional and
* are unused if the BIOS sets them to zero. Therefore, we must copy/expand
- * 32-bit V1.0 fields if the corresponding X field is zero.
+ * 32-bit V1.0 fields to the 64-bit X fields if the the 64-bit X field is
+ * originally zero.
*
- * For ACPI 1.0 FADTs, all 32-bit address fields are expanded to the
- * corresponding "X" fields in the internal FADT.
+ * For ACPI 1.0 FADTs (that contain no 64-bit addresses), all 32-bit address
+ * fields are expanded to the corresponding 64-bit X fields in the internal
+ * common FADT.
*
* For ACPI 2.0+ FADTs, all valid (non-zero) 32-bit address fields are expanded
- * to the corresponding 64-bit X fields. For compatibility with other ACPI
- * implementations, we ignore the 64-bit field if the 32-bit field is valid,
- * regardless of whether the host OS is 32-bit or 64-bit.
+ * to the corresponding 64-bit X fields, if the 64-bit field is originally
+ * zero. Adhering to the ACPI specification, we completely ignore the 32-bit
+ * field if the 64-bit field is valid, regardless of whether the host OS is
+ * 32-bit or 64-bit.
+ *
+ * Possible additional checks:
+ * (AcpiGbl_FADT.Pm1EventLength >= 4)
+ * (AcpiGbl_FADT.Pm1ControlLength >= 2)
+ * (AcpiGbl_FADT.PmTimerLength >= 4)
+ * Gpe block lengths must be multiple of 2
*
******************************************************************************/
@@ -413,25 +498,15 @@ static void
AcpiTbConvertFadt (
void)
{
+ char *Name;
ACPI_GENERIC_ADDRESS *Address64;
UINT32 Address32;
+ UINT8 Length;
+ UINT8 Flags;
UINT32 i;
/*
- * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary.
- * Later code will always use the X 64-bit field.
- */
- if (!AcpiGbl_FADT.XFacs)
- {
- AcpiGbl_FADT.XFacs = (UINT64) AcpiGbl_FADT.Facs;
- }
- if (!AcpiGbl_FADT.XDsdt)
- {
- AcpiGbl_FADT.XDsdt = (UINT64) AcpiGbl_FADT.Dsdt;
- }
-
- /*
* For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which
* should be zero are indeed zero. This will workaround BIOSs that
* inadvertently place values in these fields.
@@ -458,113 +533,14 @@ AcpiTbConvertFadt (
AcpiGbl_FADT.Header.Length = sizeof (ACPI_TABLE_FADT);
/*
- * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
- * generic address structures as necessary. Later code will always use
- * the 64-bit address structures.
- *
- * March 2009:
- * We now always use the 32-bit address if it is valid (non-null). This
- * is not in accordance with the ACPI specification which states that
- * the 64-bit address supersedes the 32-bit version, but we do this for
- * compatibility with other ACPI implementations. Most notably, in the
- * case where both the 32 and 64 versions are non-null, we use the 32-bit
- * version. This is the only address that is guaranteed to have been
- * tested by the BIOS manufacturer.
- */
- for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++)
- {
- Address32 = *ACPI_ADD_PTR (UINT32,
- &AcpiGbl_FADT, FadtInfoTable[i].Address32);
-
- Address64 = ACPI_ADD_PTR (ACPI_GENERIC_ADDRESS,
- &AcpiGbl_FADT, FadtInfoTable[i].Address64);
-
- /*
- * If both 32- and 64-bit addresses are valid (non-zero),
- * they must match.
- */
- if (Address64->Address && Address32 &&
- (Address64->Address != (UINT64) Address32))
- {
- ACPI_BIOS_ERROR ((AE_INFO,
- "32/64X address mismatch in FADT/%s: "
- "0x%8.8X/0x%8.8X%8.8X, using 32",
- FadtInfoTable[i].Name, Address32,
- ACPI_FORMAT_UINT64 (Address64->Address)));
- }
-
- /* Always use 32-bit address if it is valid (non-null) */
-
- if (Address32)
- {
- /*
- * Copy the 32-bit address to the 64-bit GAS structure. The
- * Space ID is always I/O for 32-bit legacy address fields
- */
- AcpiTbInitGenericAddress (Address64, ACPI_ADR_SPACE_SYSTEM_IO,
- *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT, FadtInfoTable[i].Length),
- (UINT64) Address32, FadtInfoTable[i].Name);
- }
- }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbValidateFadt
- *
- * PARAMETERS: Table - Pointer to the FADT to be validated
- *
- * RETURN: None
- *
- * DESCRIPTION: Validate various important fields within the FADT. If a problem
- * is found, issue a message, but no status is returned.
- * Used by both the table manager and the disassembler.
- *
- * Possible additional checks:
- * (AcpiGbl_FADT.Pm1EventLength >= 4)
- * (AcpiGbl_FADT.Pm1ControlLength >= 2)
- * (AcpiGbl_FADT.PmTimerLength >= 4)
- * Gpe block lengths must be multiple of 2
- *
- ******************************************************************************/
-
-static void
-AcpiTbValidateFadt (
- void)
-{
- char *Name;
- ACPI_GENERIC_ADDRESS *Address64;
- UINT8 Length;
- UINT32 i;
-
-
- /*
- * Check for FACS and DSDT address mismatches. An address mismatch between
- * the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and
- * DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables.
+ * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary.
+ * Later ACPICA code will always use the X 64-bit field.
*/
- if (AcpiGbl_FADT.Facs &&
- (AcpiGbl_FADT.XFacs != (UINT64) AcpiGbl_FADT.Facs))
- {
- ACPI_BIOS_WARNING ((AE_INFO,
- "32/64X FACS address mismatch in FADT - "
- "0x%8.8X/0x%8.8X%8.8X, using 32",
- AcpiGbl_FADT.Facs, ACPI_FORMAT_UINT64 (AcpiGbl_FADT.XFacs)));
+ AcpiGbl_FADT.XFacs = AcpiTbSelectAddress ("FACS",
+ AcpiGbl_FADT.Facs, AcpiGbl_FADT.XFacs);
- AcpiGbl_FADT.XFacs = (UINT64) AcpiGbl_FADT.Facs;
- }
-
- if (AcpiGbl_FADT.Dsdt &&
- (AcpiGbl_FADT.XDsdt != (UINT64) AcpiGbl_FADT.Dsdt))
- {
- ACPI_BIOS_WARNING ((AE_INFO,
- "32/64X DSDT address mismatch in FADT - "
- "0x%8.8X/0x%8.8X%8.8X, using 32",
- AcpiGbl_FADT.Dsdt, ACPI_FORMAT_UINT64 (AcpiGbl_FADT.XDsdt)));
-
- AcpiGbl_FADT.XDsdt = (UINT64) AcpiGbl_FADT.Dsdt;
- }
+ AcpiGbl_FADT.XDsdt = AcpiTbSelectAddress ("DSDT",
+ AcpiGbl_FADT.Dsdt, AcpiGbl_FADT.XDsdt);
/* If Hardware Reduced flag is set, we are all done */
@@ -578,14 +554,81 @@ AcpiTbValidateFadt (
for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++)
{
/*
- * Generate pointer to the 64-bit address, get the register
- * length (width) and the register name
+ * Get the 32-bit and 64-bit addresses, as well as the register
+ * length and register name.
*/
+ Address32 = *ACPI_ADD_PTR (UINT32,
+ &AcpiGbl_FADT, FadtInfoTable[i].Address32);
+
Address64 = ACPI_ADD_PTR (ACPI_GENERIC_ADDRESS,
- &AcpiGbl_FADT, FadtInfoTable[i].Address64);
+ &AcpiGbl_FADT, FadtInfoTable[i].Address64);
+
Length = *ACPI_ADD_PTR (UINT8,
- &AcpiGbl_FADT, FadtInfoTable[i].Length);
+ &AcpiGbl_FADT, FadtInfoTable[i].Length);
+
Name = FadtInfoTable[i].Name;
+ Flags = FadtInfoTable[i].Flags;
+
+ /*
+ * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
+ * generic address structures as necessary. Later code will always use
+ * the 64-bit address structures.
+ *
+ * November 2013:
+ * Now always use the 64-bit address if it is valid (non-zero), in
+ * accordance with the ACPI specification which states that a 64-bit
+ * address supersedes the 32-bit version. This behavior can be
+ * overridden by the AcpiGbl_Use32BitFadtAddresses flag.
+ *
+ * During 64-bit address construction and verification,
+ * these cases are handled:
+ *
+ * Address32 zero, Address64 [don't care] - Use Address64
+ *
+ * Address32 non-zero, Address64 zero - Copy/use Address32
+ * Address32 non-zero == Address64 non-zero - Use Address64
+ * Address32 non-zero != Address64 non-zero - Warning, use Address64
+ *
+ * Override: if AcpiGbl_Use32BitFadtAddresses is TRUE, and:
+ * Address32 non-zero != Address64 non-zero - Warning, copy/use Address32
+ *
+ * Note: SpaceId is always I/O for 32-bit legacy address fields
+ */
+ if (Address32)
+ {
+ if (!Address64->Address)
+ {
+ /* 64-bit address is zero, use 32-bit address */
+
+ AcpiTbInitGenericAddress (Address64,
+ ACPI_ADR_SPACE_SYSTEM_IO,
+ *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT,
+ FadtInfoTable[i].Length),
+ (UINT64) Address32, Name, Flags);
+ }
+ else if (Address64->Address != (UINT64) Address32)
+ {
+ /* Address mismatch */
+
+ ACPI_BIOS_WARNING ((AE_INFO,
+ "32/64X address mismatch in FADT/%s: "
+ "0x%8.8X/0x%8.8X%8.8X, using %u-bit address",
+ Name, Address32,
+ ACPI_FORMAT_UINT64 (Address64->Address),
+ AcpiGbl_Use32BitFadtAddresses ? 32 : 64));
+
+ if (AcpiGbl_Use32BitFadtAddresses)
+ {
+ /* 32-bit address override */
+
+ AcpiTbInitGenericAddress (Address64,
+ ACPI_ADR_SPACE_SYSTEM_IO,
+ *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT,
+ FadtInfoTable[i].Length),
+ (UINT64) Address32, Name, Flags);
+ }
+ }
+ }
/*
* For each extended field, check for length mismatch between the
@@ -603,7 +646,7 @@ AcpiTbValidateFadt (
Name, ACPI_MUL_8 (Length), Address64->BitWidth));
}
- if (FadtInfoTable[i].Type & ACPI_FADT_REQUIRED)
+ if (FadtInfoTable[i].Flags & ACPI_FADT_REQUIRED)
{
/*
* Field is required (PM1aEvent, PM1aControl).
@@ -617,7 +660,7 @@ AcpiTbValidateFadt (
Name, ACPI_FORMAT_UINT64 (Address64->Address), Length));
}
}
- else if (FadtInfoTable[i].Type & ACPI_FADT_SEPARATE_LENGTH)
+ else if (FadtInfoTable[i].Flags & ACPI_FADT_SEPARATE_LENGTH)
{
/*
* Field is optional (PM2Control, GPE0, GPE1) AND has its own
@@ -724,7 +767,7 @@ AcpiTbSetupFadtRegisters (
Source64->SpaceId, Pm1RegisterByteWidth,
Source64->Address +
(FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth),
- "PmRegisters");
+ "PmRegisters", 0);
}
}
}
diff --git a/sys/contrib/dev/acpica/components/tables/tbfind.c b/sys/contrib/dev/acpica/components/tables/tbfind.c
index 6cd30e8..30a5750 100644
--- a/sys/contrib/dev/acpica/components/tables/tbfind.c
+++ b/sys/contrib/dev/acpica/components/tables/tbfind.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __TBFIND_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/actables.h>
@@ -108,7 +106,7 @@ AcpiTbFindTable (
{
/* Table is not currently mapped, map it */
- Status = AcpiTbVerifyTable (&AcpiGbl_RootTableList.Tables[i]);
+ Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[i]);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
diff --git a/sys/contrib/dev/acpica/components/tables/tbinstal.c b/sys/contrib/dev/acpica/components/tables/tbinstal.c
index 0652b16..2fe219d 100644
--- a/sys/contrib/dev/acpica/components/tables/tbinstal.c
+++ b/sys/contrib/dev/acpica/components/tables/tbinstal.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,778 +41,526 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __TBINSTAL_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
-#include <contrib/dev/acpica/include/acnamesp.h>
#include <contrib/dev/acpica/include/actables.h>
-
#define _COMPONENT ACPI_TABLES
ACPI_MODULE_NAME ("tbinstal")
+/* Local prototypes */
-/******************************************************************************
+static BOOLEAN
+AcpiTbCompareTables (
+ ACPI_TABLE_DESC *TableDesc,
+ UINT32 TableIndex);
+
+
+/*******************************************************************************
*
- * FUNCTION: AcpiTbVerifyTable
+ * FUNCTION: AcpiTbCompareTables
*
- * PARAMETERS: TableDesc - table
+ * PARAMETERS: TableDesc - Table 1 descriptor to be compared
+ * TableIndex - Index of table 2 to be compared
*
- * RETURN: Status
+ * RETURN: TRUE if both tables are identical.
*
- * DESCRIPTION: this function is called to verify and map table
+ * DESCRIPTION: This function compares a table with another table that has
+ * already been installed in the root table list.
*
- *****************************************************************************/
+ ******************************************************************************/
-ACPI_STATUS
-AcpiTbVerifyTable (
- ACPI_TABLE_DESC *TableDesc)
+static BOOLEAN
+AcpiTbCompareTables (
+ ACPI_TABLE_DESC *TableDesc,
+ UINT32 TableIndex)
{
ACPI_STATUS Status = AE_OK;
+ BOOLEAN IsIdentical;
+ ACPI_TABLE_HEADER *Table;
+ UINT32 TableLength;
+ UINT8 TableFlags;
- ACPI_FUNCTION_TRACE (TbVerifyTable);
-
-
- /* Map the table if necessary */
-
- if (!TableDesc->Pointer)
+ Status = AcpiTbAcquireTable (&AcpiGbl_RootTableList.Tables[TableIndex],
+ &Table, &TableLength, &TableFlags);
+ if (ACPI_FAILURE (Status))
{
- if ((TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) ==
- ACPI_TABLE_ORIGIN_MAPPED)
- {
- TableDesc->Pointer = AcpiOsMapMemory (
- TableDesc->Address, TableDesc->Length);
- }
-
- if (!TableDesc->Pointer)
- {
- return_ACPI_STATUS (AE_NO_MEMORY);
- }
+ return (FALSE);
}
- /* Always calculate checksum, ignore bad checksum if requested */
+ /*
+ * Check for a table match on the entire table length,
+ * not just the header.
+ */
+ IsIdentical = (BOOLEAN)((TableDesc->Length != TableLength ||
+ ACPI_MEMCMP (TableDesc->Pointer, Table, TableLength)) ?
+ FALSE : TRUE);
- Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length);
+ /* Release the acquired table */
- return_ACPI_STATUS (Status);
+ AcpiTbReleaseTable (Table, TableLength, TableFlags);
+ return (IsIdentical);
}
/*******************************************************************************
*
- * FUNCTION: AcpiTbAddTable
+ * FUNCTION: AcpiTbInstallTableWithOverride
*
- * PARAMETERS: TableDesc - Table descriptor
- * TableIndex - Where the table index is returned
+ * PARAMETERS: TableIndex - Index into root table array
+ * NewTableDesc - New table descriptor to install
+ * Override - Whether override should be performed
*
- * RETURN: Status
+ * RETURN: None
*
- * DESCRIPTION: This function is called to add an ACPI table. It is used to
- * dynamically load tables via the Load and LoadTable AML
- * operators.
+ * DESCRIPTION: Install an ACPI table into the global data structure. The
+ * table override mechanism is called to allow the host
+ * OS to replace any table before it is installed in the root
+ * table array.
*
******************************************************************************/
-ACPI_STATUS
-AcpiTbAddTable (
- ACPI_TABLE_DESC *TableDesc,
- UINT32 *TableIndex)
+void
+AcpiTbInstallTableWithOverride (
+ UINT32 TableIndex,
+ ACPI_TABLE_DESC *NewTableDesc,
+ BOOLEAN Override)
{
- UINT32 i;
- ACPI_STATUS Status = AE_OK;
-
- ACPI_FUNCTION_TRACE (TbAddTable);
-
-
- if (!TableDesc->Pointer)
+ if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount)
{
- Status = AcpiTbVerifyTable (TableDesc);
- if (ACPI_FAILURE (Status) || !TableDesc->Pointer)
- {
- return_ACPI_STATUS (Status);
- }
+ return;
}
/*
- * Validate the incoming table signature.
+ * ACPI Table Override:
*
- * 1) Originally, we checked the table signature for "SSDT" or "PSDT".
- * 2) We added support for OEMx tables, signature "OEM".
- * 3) Valid tables were encountered with a null signature, so we just
- * gave up on validating the signature, (05/2008).
- * 4) We encountered non-AML tables such as the MADT, which caused
- * interpreter errors and kernel faults. So now, we once again allow
- * only "SSDT", "OEMx", and now, also a null signature. (05/2011).
+ * Before we install the table, let the host OS override it with a new
+ * one if desired. Any table within the RSDT/XSDT can be replaced,
+ * including the DSDT which is pointed to by the FADT.
*/
- if ((TableDesc->Pointer->Signature[0] != 0x00) &&
- (!ACPI_COMPARE_NAME (TableDesc->Pointer->Signature, ACPI_SIG_SSDT)) &&
- (ACPI_STRNCMP (TableDesc->Pointer->Signature, "OEM", 3)))
+ if (Override)
{
- ACPI_BIOS_ERROR ((AE_INFO,
- "Table has invalid signature [%4.4s] (0x%8.8X), "
- "must be SSDT or OEMx",
- AcpiUtValidAcpiName (TableDesc->Pointer->Signature) ?
- TableDesc->Pointer->Signature : "????",
- *(UINT32 *) TableDesc->Pointer->Signature));
-
- return_ACPI_STATUS (AE_BAD_SIGNATURE);
+ AcpiTbOverrideTable (NewTableDesc);
}
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
-
- /* Check if table is already registered */
-
- for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
- {
- if (!AcpiGbl_RootTableList.Tables[i].Pointer)
- {
- Status = AcpiTbVerifyTable (&AcpiGbl_RootTableList.Tables[i]);
- if (ACPI_FAILURE (Status) ||
- !AcpiGbl_RootTableList.Tables[i].Pointer)
- {
- continue;
- }
- }
-
- /*
- * Check for a table match on the entire table length,
- * not just the header.
- */
- if (TableDesc->Length != AcpiGbl_RootTableList.Tables[i].Length)
- {
- continue;
- }
+ AcpiTbInitTableDescriptor (&AcpiGbl_RootTableList.Tables[TableIndex],
+ NewTableDesc->Address, NewTableDesc->Flags, NewTableDesc->Pointer);
- if (ACPI_MEMCMP (TableDesc->Pointer,
- AcpiGbl_RootTableList.Tables[i].Pointer,
- AcpiGbl_RootTableList.Tables[i].Length))
- {
- continue;
- }
+ AcpiTbPrintTableHeader (NewTableDesc->Address, NewTableDesc->Pointer);
- /*
- * Note: the current mechanism does not unregister a table if it is
- * dynamically unloaded. The related namespace entries are deleted,
- * but the table remains in the root table list.
- *
- * The assumption here is that the number of different tables that
- * will be loaded is actually small, and there is minimal overhead
- * in just keeping the table in case it is needed again.
- *
- * If this assumption changes in the future (perhaps on large
- * machines with many table load/unload operations), tables will
- * need to be unregistered when they are unloaded, and slots in the
- * root table list should be reused when empty.
- */
+ /* Set the global integer width (based upon revision of the DSDT) */
- /*
- * Table is already registered.
- * We can delete the table that was passed as a parameter.
- */
- AcpiTbDeleteTable (TableDesc);
- *TableIndex = i;
-
- if (AcpiGbl_RootTableList.Tables[i].Flags & ACPI_TABLE_IS_LOADED)
- {
- /* Table is still loaded, this is an error */
-
- Status = AE_ALREADY_EXISTS;
- goto Release;
- }
- else
- {
- /* Table was unloaded, allow it to be reloaded */
-
- TableDesc->Pointer = AcpiGbl_RootTableList.Tables[i].Pointer;
- TableDesc->Address = AcpiGbl_RootTableList.Tables[i].Address;
- Status = AE_OK;
- goto PrintHeader;
- }
- }
-
- /*
- * ACPI Table Override:
- * Allow the host to override dynamically loaded tables.
- * NOTE: the table is fully mapped at this point, and the mapping will
- * be deleted by TbTableOverride if the table is actually overridden.
- */
- (void) AcpiTbTableOverride (TableDesc->Pointer, TableDesc);
-
- /* Add the table to the global root table list */
-
- Status = AcpiTbStoreTable (TableDesc->Address, TableDesc->Pointer,
- TableDesc->Length, TableDesc->Flags, TableIndex);
- if (ACPI_FAILURE (Status))
+ if (TableIndex == ACPI_TABLE_INDEX_DSDT)
{
- goto Release;
+ AcpiUtSetIntegerWidth (NewTableDesc->Pointer->Revision);
}
-
-PrintHeader:
- AcpiTbPrintTableHeader (TableDesc->Address, TableDesc->Pointer);
-
-Release:
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
- return_ACPI_STATUS (Status);
}
/*******************************************************************************
*
- * FUNCTION: AcpiTbTableOverride
+ * FUNCTION: AcpiTbInstallFixedTable
*
- * PARAMETERS: TableHeader - Header for the original table
- * TableDesc - Table descriptor initialized for the
- * original table. May or may not be mapped.
+ * PARAMETERS: Address - Physical address of DSDT or FACS
+ * Signature - Table signature, NULL if no need to
+ * match
+ * TableIndex - Index into root table array
*
- * RETURN: Pointer to the entire new table. NULL if table not overridden.
- * If overridden, installs the new table within the input table
- * descriptor.
+ * RETURN: Status
*
- * DESCRIPTION: Attempt table override by calling the OSL override functions.
- * Note: If the table is overridden, then the entire new table
- * is mapped and returned by this function.
+ * DESCRIPTION: Install a fixed ACPI table (DSDT/FACS) into the global data
+ * structure.
*
******************************************************************************/
-ACPI_TABLE_HEADER *
-AcpiTbTableOverride (
- ACPI_TABLE_HEADER *TableHeader,
- ACPI_TABLE_DESC *TableDesc)
+ACPI_STATUS
+AcpiTbInstallFixedTable (
+ ACPI_PHYSICAL_ADDRESS Address,
+ char *Signature,
+ UINT32 TableIndex)
{
+ ACPI_TABLE_DESC NewTableDesc;
ACPI_STATUS Status;
- ACPI_TABLE_HEADER *NewTable = NULL;
- ACPI_PHYSICAL_ADDRESS NewAddress = 0;
- UINT32 NewTableLength = 0;
- UINT8 NewFlags;
- char *OverrideType;
- /* (1) Attempt logical override (returns a logical address) */
+ ACPI_FUNCTION_TRACE (TbInstallFixedTable);
+
- Status = AcpiOsTableOverride (TableHeader, &NewTable);
- if (ACPI_SUCCESS (Status) && NewTable)
+ if (!Address)
{
- NewAddress = ACPI_PTR_TO_PHYSADDR (NewTable);
- NewTableLength = NewTable->Length;
- NewFlags = ACPI_TABLE_ORIGIN_OVERRIDE;
- OverrideType = "Logical";
- goto FinishOverride;
+ ACPI_ERROR ((AE_INFO, "Null physical address for ACPI table [%s]",
+ Signature));
+ return (AE_NO_MEMORY);
}
- /* (2) Attempt physical override (returns a physical address) */
+ /* Fill a table descriptor for validation */
- Status = AcpiOsPhysicalTableOverride (TableHeader,
- &NewAddress, &NewTableLength);
- if (ACPI_SUCCESS (Status) && NewAddress && NewTableLength)
+ Status = AcpiTbAcquireTempTable (&NewTableDesc, Address,
+ ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL);
+ if (ACPI_FAILURE (Status))
{
- /* Map the entire new table */
-
- NewTable = AcpiOsMapMemory (NewAddress, NewTableLength);
- if (!NewTable)
- {
- ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
- "%4.4s %p Attempted physical table override failed",
- TableHeader->Signature,
- ACPI_CAST_PTR (void, TableDesc->Address)));
- return (NULL);
- }
-
- OverrideType = "Physical";
- NewFlags = ACPI_TABLE_ORIGIN_MAPPED;
- goto FinishOverride;
+ ACPI_ERROR ((AE_INFO, "Could not acquire table length at %p",
+ ACPI_CAST_PTR (void, Address)));
+ return_ACPI_STATUS (Status);
}
- return (NULL); /* There was no override */
+ /* Validate and verify a table before installation */
+ Status = AcpiTbVerifyTempTable (&NewTableDesc, Signature);
+ if (ACPI_FAILURE (Status))
+ {
+ goto ReleaseAndExit;
+ }
-FinishOverride:
-
- ACPI_INFO ((AE_INFO,
- "%4.4s %p %s table override, new table: %p",
- TableHeader->Signature,
- ACPI_CAST_PTR (void, TableDesc->Address),
- OverrideType, NewTable));
-
- /* We can now unmap/delete the original table (if fully mapped) */
-
- AcpiTbDeleteTable (TableDesc);
+ AcpiTbInstallTableWithOverride (TableIndex, &NewTableDesc, TRUE);
- /* Setup descriptor for the new table */
+ReleaseAndExit:
- TableDesc->Address = NewAddress;
- TableDesc->Pointer = NewTable;
- TableDesc->Length = NewTableLength;
- TableDesc->Flags = NewFlags;
+ /* Release the temporary table descriptor */
- return (NewTable);
+ AcpiTbReleaseTempTable (&NewTableDesc);
+ return_ACPI_STATUS (Status);
}
/*******************************************************************************
*
- * FUNCTION: AcpiTbResizeRootTableList
+ * FUNCTION: AcpiTbInstallStandardTable
*
- * PARAMETERS: None
+ * PARAMETERS: Address - Address of the table (might be a virtual
+ * address depending on the TableFlags)
+ * Flags - Flags for the table
+ * Reload - Whether reload should be performed
+ * Override - Whether override should be performed
+ * TableIndex - Where the table index is returned
*
* RETURN: Status
*
- * DESCRIPTION: Expand the size of global table array
+ * DESCRIPTION: This function is called to install an ACPI table that is
+ * neither DSDT nor FACS (a "standard" table.)
+ * When this function is called by "Load" or "LoadTable" opcodes,
+ * or by AcpiLoadTable() API, the "Reload" parameter is set.
+ * After sucessfully returning from this function, table is
+ * "INSTALLED" but not "VALIDATED".
*
******************************************************************************/
ACPI_STATUS
-AcpiTbResizeRootTableList (
- void)
+AcpiTbInstallStandardTable (
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT8 Flags,
+ BOOLEAN Reload,
+ BOOLEAN Override,
+ UINT32 *TableIndex)
{
- ACPI_TABLE_DESC *Tables;
- UINT32 TableCount;
+ UINT32 i;
+ ACPI_STATUS Status = AE_OK;
+ ACPI_TABLE_DESC NewTableDesc;
- ACPI_FUNCTION_TRACE (TbResizeRootTableList);
+ ACPI_FUNCTION_TRACE (TbInstallStandardTable);
- /* AllowResize flag is a parameter to AcpiInitializeTables */
+ /* Acquire a temporary table descriptor for validation */
- if (!(AcpiGbl_RootTableList.Flags & ACPI_ROOT_ALLOW_RESIZE))
+ Status = AcpiTbAcquireTempTable (&NewTableDesc, Address, Flags);
+ if (ACPI_FAILURE (Status))
{
- ACPI_ERROR ((AE_INFO, "Resize of Root Table Array is not allowed"));
- return_ACPI_STATUS (AE_SUPPORT);
+ ACPI_ERROR ((AE_INFO, "Could not acquire table length at %p",
+ ACPI_CAST_PTR (void, Address)));
+ return_ACPI_STATUS (Status);
}
- /* Increase the Table Array size */
-
- if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
- {
- TableCount = AcpiGbl_RootTableList.MaxTableCount;
- }
- else
+ /*
+ * Optionally do not load any SSDTs from the RSDT/XSDT. This can
+ * be useful for debugging ACPI problems on some machines.
+ */
+ if (!Reload &&
+ AcpiGbl_DisableSsdtTableInstall &&
+ ACPI_COMPARE_NAME (&NewTableDesc.Signature, ACPI_SIG_SSDT))
{
- TableCount = AcpiGbl_RootTableList.CurrentTableCount;
+ ACPI_INFO ((AE_INFO, "Ignoring installation of %4.4s at %p",
+ NewTableDesc.Signature.Ascii, ACPI_CAST_PTR (void, Address)));
+ goto ReleaseAndExit;
}
- Tables = ACPI_ALLOCATE_ZEROED (
- ((ACPI_SIZE) TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT) *
- sizeof (ACPI_TABLE_DESC));
- if (!Tables)
+ /* Validate and verify a table before installation */
+
+ Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL);
+ if (ACPI_FAILURE (Status))
{
- ACPI_ERROR ((AE_INFO, "Could not allocate new root table array"));
- return_ACPI_STATUS (AE_NO_MEMORY);
+ goto ReleaseAndExit;
}
- /* Copy and free the previous table array */
-
- if (AcpiGbl_RootTableList.Tables)
+ if (Reload)
{
- ACPI_MEMCPY (Tables, AcpiGbl_RootTableList.Tables,
- (ACPI_SIZE) TableCount * sizeof (ACPI_TABLE_DESC));
-
- if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
+ /*
+ * Validate the incoming table signature.
+ *
+ * 1) Originally, we checked the table signature for "SSDT" or "PSDT".
+ * 2) We added support for OEMx tables, signature "OEM".
+ * 3) Valid tables were encountered with a null signature, so we just
+ * gave up on validating the signature, (05/2008).
+ * 4) We encountered non-AML tables such as the MADT, which caused
+ * interpreter errors and kernel faults. So now, we once again allow
+ * only "SSDT", "OEMx", and now, also a null signature. (05/2011).
+ */
+ if ((NewTableDesc.Signature.Ascii[0] != 0x00) &&
+ (!ACPI_COMPARE_NAME (&NewTableDesc.Signature, ACPI_SIG_SSDT)) &&
+ (ACPI_STRNCMP (NewTableDesc.Signature.Ascii, "OEM", 3)))
{
- ACPI_FREE (AcpiGbl_RootTableList.Tables);
+ ACPI_BIOS_ERROR ((AE_INFO,
+ "Table has invalid signature [%4.4s] (0x%8.8X), "
+ "must be SSDT or OEMx",
+ AcpiUtValidAcpiName (NewTableDesc.Signature.Ascii) ?
+ NewTableDesc.Signature.Ascii : "????",
+ NewTableDesc.Signature.Integer));
+
+ Status = AE_BAD_SIGNATURE;
+ goto ReleaseAndExit;
}
- }
- AcpiGbl_RootTableList.Tables = Tables;
- AcpiGbl_RootTableList.MaxTableCount =
- TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT;
- AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED;
-
- return_ACPI_STATUS (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbStoreTable
- *
- * PARAMETERS: Address - Table address
- * Table - Table header
- * Length - Table length
- * Flags - flags
- *
- * RETURN: Status and table index.
- *
- * DESCRIPTION: Add an ACPI table to the global table list
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiTbStoreTable (
- ACPI_PHYSICAL_ADDRESS Address,
- ACPI_TABLE_HEADER *Table,
- UINT32 Length,
- UINT8 Flags,
- UINT32 *TableIndex)
-{
- ACPI_STATUS Status;
- ACPI_TABLE_DESC *NewTable;
+ /* Check if table is already registered */
+ for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
+ {
+ /*
+ * Check for a table match on the entire table length,
+ * not just the header.
+ */
+ if (!AcpiTbCompareTables (&NewTableDesc, i))
+ {
+ continue;
+ }
- /* Ensure that there is room for the table in the Root Table List */
+ /*
+ * Note: the current mechanism does not unregister a table if it is
+ * dynamically unloaded. The related namespace entries are deleted,
+ * but the table remains in the root table list.
+ *
+ * The assumption here is that the number of different tables that
+ * will be loaded is actually small, and there is minimal overhead
+ * in just keeping the table in case it is needed again.
+ *
+ * If this assumption changes in the future (perhaps on large
+ * machines with many table load/unload operations), tables will
+ * need to be unregistered when they are unloaded, and slots in the
+ * root table list should be reused when empty.
+ */
+ if (AcpiGbl_RootTableList.Tables[i].Flags & ACPI_TABLE_IS_LOADED)
+ {
+ /* Table is still loaded, this is an error */
- if (AcpiGbl_RootTableList.CurrentTableCount >=
- AcpiGbl_RootTableList.MaxTableCount)
- {
- Status = AcpiTbResizeRootTableList();
- if (ACPI_FAILURE (Status))
- {
- return (Status);
+ Status = AE_ALREADY_EXISTS;
+ goto ReleaseAndExit;
+ }
+ else
+ {
+ /*
+ * Table was unloaded, allow it to be reloaded.
+ * As we are going to return AE_OK to the caller, we should
+ * take the responsibility of freeing the input descriptor.
+ * Refill the input descriptor to ensure
+ * AcpiTbInstallTableWithOverride() can be called again to
+ * indicate the re-installation.
+ */
+ AcpiTbUninstallTable (&NewTableDesc);
+ *TableIndex = i;
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ return_ACPI_STATUS (AE_OK);
+ }
}
}
- NewTable = &AcpiGbl_RootTableList.Tables[AcpiGbl_RootTableList.CurrentTableCount];
-
- /* Initialize added table */
-
- NewTable->Address = Address;
- NewTable->Pointer = Table;
- NewTable->Length = Length;
- NewTable->OwnerId = 0;
- NewTable->Flags = Flags;
-
- ACPI_MOVE_32_TO_32 (&NewTable->Signature, Table->Signature);
-
- *TableIndex = AcpiGbl_RootTableList.CurrentTableCount;
- AcpiGbl_RootTableList.CurrentTableCount++;
- return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbDeleteTable
- *
- * PARAMETERS: TableIndex - Table index
- *
- * RETURN: None
- *
- * DESCRIPTION: Delete one internal ACPI table
- *
- ******************************************************************************/
-
-void
-AcpiTbDeleteTable (
- ACPI_TABLE_DESC *TableDesc)
-{
-
- /* Table must be mapped or allocated */
+ /* Add the table to the global root table list */
- if (!TableDesc->Pointer)
+ Status = AcpiTbGetNextRootIndex (&i);
+ if (ACPI_FAILURE (Status))
{
- return;
+ goto ReleaseAndExit;
}
- switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK)
- {
- case ACPI_TABLE_ORIGIN_MAPPED:
-
- AcpiOsUnmapMemory (TableDesc->Pointer, TableDesc->Length);
- break;
+ *TableIndex = i;
+ AcpiTbInstallTableWithOverride (i, &NewTableDesc, Override);
- case ACPI_TABLE_ORIGIN_ALLOCATED:
+ReleaseAndExit:
- ACPI_FREE (TableDesc->Pointer);
- break;
-
- /* Not mapped or allocated, there is nothing we can do */
-
- default:
-
- return;
- }
+ /* Release the temporary table descriptor */
- TableDesc->Pointer = NULL;
+ AcpiTbReleaseTempTable (&NewTableDesc);
+ return_ACPI_STATUS (Status);
}
/*******************************************************************************
*
- * FUNCTION: AcpiTbTerminate
+ * FUNCTION: AcpiTbOverrideTable
*
- * PARAMETERS: None
+ * PARAMETERS: OldTableDesc - Validated table descriptor to be
+ * overridden
*
* RETURN: None
*
- * DESCRIPTION: Delete all internal ACPI tables
+ * DESCRIPTION: Attempt table override by calling the OSL override functions.
+ * Note: If the table is overridden, then the entire new table
+ * is acquired and returned by this function.
+ * Before/after invocation, the table descriptor is in a state
+ * that is "VALIDATED".
*
******************************************************************************/
void
-AcpiTbTerminate (
- void)
+AcpiTbOverrideTable (
+ ACPI_TABLE_DESC *OldTableDesc)
{
- UINT32 i;
-
-
- ACPI_FUNCTION_TRACE (TbTerminate);
-
+ ACPI_STATUS Status;
+ char *OverrideType;
+ ACPI_TABLE_DESC NewTableDesc;
+ ACPI_TABLE_HEADER *Table;
+ ACPI_PHYSICAL_ADDRESS Address;
+ UINT32 Length;
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
- /* Delete the individual tables */
+ /* (1) Attempt logical override (returns a logical address) */
- for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
+ Status = AcpiOsTableOverride (OldTableDesc->Pointer, &Table);
+ if (ACPI_SUCCESS (Status) && Table)
{
- AcpiTbDeleteTable (&AcpiGbl_RootTableList.Tables[i]);
+ AcpiTbAcquireTempTable (&NewTableDesc, ACPI_PTR_TO_PHYSADDR (Table),
+ ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL);
+ OverrideType = "Logical";
+ goto FinishOverride;
}
- /*
- * Delete the root table array if allocated locally. Array cannot be
- * mapped, so we don't need to check for that flag.
- */
- if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED)
+ /* (2) Attempt physical override (returns a physical address) */
+
+ Status = AcpiOsPhysicalTableOverride (OldTableDesc->Pointer,
+ &Address, &Length);
+ if (ACPI_SUCCESS (Status) && Address && Length)
{
- ACPI_FREE (AcpiGbl_RootTableList.Tables);
+ AcpiTbAcquireTempTable (&NewTableDesc, Address,
+ ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL);
+ OverrideType = "Physical";
+ goto FinishOverride;
}
- AcpiGbl_RootTableList.Tables = NULL;
- AcpiGbl_RootTableList.Flags = 0;
- AcpiGbl_RootTableList.CurrentTableCount = 0;
-
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ACPI Tables freed\n"));
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
-
- return_VOID;
-}
-
+ return; /* There was no override */
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbDeleteNamespaceByOwner
- *
- * PARAMETERS: TableIndex - Table index
- *
- * RETURN: Status
- *
- * DESCRIPTION: Delete all namespace objects created when this table was loaded.
- *
- ******************************************************************************/
-ACPI_STATUS
-AcpiTbDeleteNamespaceByOwner (
- UINT32 TableIndex)
-{
- ACPI_OWNER_ID OwnerId;
- ACPI_STATUS Status;
-
-
- ACPI_FUNCTION_TRACE (TbDeleteNamespaceByOwner);
+FinishOverride:
+ /* Validate and verify a table before overriding */
- Status = AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+ Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL);
if (ACPI_FAILURE (Status))
{
- return_ACPI_STATUS (Status);
+ return;
}
- if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount)
- {
- /* The table index does not exist */
-
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
- return_ACPI_STATUS (AE_NOT_EXIST);
- }
+ ACPI_INFO ((AE_INFO, "%4.4s " ACPI_PRINTF_UINT
+ " %s table override, new table: " ACPI_PRINTF_UINT,
+ OldTableDesc->Signature.Ascii,
+ ACPI_FORMAT_TO_UINT (OldTableDesc->Address),
+ OverrideType, ACPI_FORMAT_TO_UINT (NewTableDesc.Address)));
- /* Get the owner ID for this table, used to delete namespace nodes */
+ /* We can now uninstall the original table */
- OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId;
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ AcpiTbUninstallTable (OldTableDesc);
/*
- * Need to acquire the namespace writer lock to prevent interference
- * with any concurrent namespace walks. The interpreter must be
- * released during the deletion since the acquisition of the deletion
- * lock may block, and also since the execution of a namespace walk
- * must be allowed to use the interpreter.
+ * Replace the original table descriptor and keep its state as
+ * "VALIDATED".
*/
- (void) AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER);
- Status = AcpiUtAcquireWriteLock (&AcpiGbl_NamespaceRwLock);
+ AcpiTbInitTableDescriptor (OldTableDesc, NewTableDesc.Address,
+ NewTableDesc.Flags, NewTableDesc.Pointer);
+ AcpiTbValidateTempTable (OldTableDesc);
- AcpiNsDeleteNamespaceByOwner (OwnerId);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- AcpiUtReleaseWriteLock (&AcpiGbl_NamespaceRwLock);
+ /* Release the temporary table descriptor */
- Status = AcpiUtAcquireMutex (ACPI_MTX_INTERPRETER);
- return_ACPI_STATUS (Status);
+ AcpiTbReleaseTempTable (&NewTableDesc);
}
/*******************************************************************************
*
- * FUNCTION: AcpiTbAllocateOwnerId
+ * FUNCTION: AcpiTbStoreTable
*
- * PARAMETERS: TableIndex - Table index
+ * PARAMETERS: Address - Table address
+ * Table - Table header
+ * Length - Table length
+ * Flags - Install flags
+ * TableIndex - Where the table index is returned
*
- * RETURN: Status
+ * RETURN: Status and table index.
*
- * DESCRIPTION: Allocates OwnerId in TableDesc
+ * DESCRIPTION: Add an ACPI table to the global table list
*
******************************************************************************/
ACPI_STATUS
-AcpiTbAllocateOwnerId (
- UINT32 TableIndex)
+AcpiTbStoreTable (
+ ACPI_PHYSICAL_ADDRESS Address,
+ ACPI_TABLE_HEADER *Table,
+ UINT32 Length,
+ UINT8 Flags,
+ UINT32 *TableIndex)
{
- ACPI_STATUS Status = AE_BAD_PARAMETER;
-
-
- ACPI_FUNCTION_TRACE (TbAllocateOwnerId);
+ ACPI_STATUS Status;
+ ACPI_TABLE_DESC *TableDesc;
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
- if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
+ Status = AcpiTbGetNextRootIndex (TableIndex);
+ if (ACPI_FAILURE (Status))
{
- Status = AcpiUtAllocateOwnerId
- (&(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId));
+ return (Status);
}
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
- return_ACPI_STATUS (Status);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbReleaseOwnerId
- *
- * PARAMETERS: TableIndex - Table index
- *
- * RETURN: Status
- *
- * DESCRIPTION: Releases OwnerId in TableDesc
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiTbReleaseOwnerId (
- UINT32 TableIndex)
-{
- ACPI_STATUS Status = AE_BAD_PARAMETER;
-
-
- ACPI_FUNCTION_TRACE (TbReleaseOwnerId);
-
-
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
- if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
- {
- AcpiUtReleaseOwnerId (
- &(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId));
- Status = AE_OK;
- }
+ /* Initialize added table */
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
- return_ACPI_STATUS (Status);
+ TableDesc = &AcpiGbl_RootTableList.Tables[*TableIndex];
+ AcpiTbInitTableDescriptor (TableDesc, Address, Flags, Table);
+ TableDesc->Pointer = Table;
+ return (AE_OK);
}
/*******************************************************************************
*
- * FUNCTION: AcpiTbGetOwnerId
+ * FUNCTION: AcpiTbUninstallTable
*
- * PARAMETERS: TableIndex - Table index
- * OwnerId - Where the table OwnerId is returned
+ * PARAMETERS: TableDesc - Table descriptor
*
- * RETURN: Status
+ * RETURN: None
*
- * DESCRIPTION: returns OwnerId for the ACPI table
+ * DESCRIPTION: Delete one internal ACPI table
*
******************************************************************************/
-ACPI_STATUS
-AcpiTbGetOwnerId (
- UINT32 TableIndex,
- ACPI_OWNER_ID *OwnerId)
+void
+AcpiTbUninstallTable (
+ ACPI_TABLE_DESC *TableDesc)
{
- ACPI_STATUS Status = AE_BAD_PARAMETER;
+ ACPI_FUNCTION_TRACE (TbUninstallTable);
- ACPI_FUNCTION_TRACE (TbGetOwnerId);
+ /* Table must be installed */
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
- if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
+ if (!TableDesc->Address)
{
- *OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId;
- Status = AE_OK;
+ return_VOID;
}
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
- return_ACPI_STATUS (Status);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbIsTableLoaded
- *
- * PARAMETERS: TableIndex - Table index
- *
- * RETURN: Table Loaded Flag
- *
- ******************************************************************************/
-
-BOOLEAN
-AcpiTbIsTableLoaded (
- UINT32 TableIndex)
-{
- BOOLEAN IsLoaded = FALSE;
-
+ AcpiTbInvalidateTable (TableDesc);
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
- if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
+ if ((TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) ==
+ ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL)
{
- IsLoaded = (BOOLEAN)
- (AcpiGbl_RootTableList.Tables[TableIndex].Flags &
- ACPI_TABLE_IS_LOADED);
+ ACPI_FREE (ACPI_CAST_PTR (void, TableDesc->Address));
}
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
- return (IsLoaded);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbSetTableLoadedFlag
- *
- * PARAMETERS: TableIndex - Table index
- * IsLoaded - TRUE if table is loaded, FALSE otherwise
- *
- * RETURN: None
- *
- * DESCRIPTION: Sets the table loaded flag to either TRUE or FALSE.
- *
- ******************************************************************************/
-
-void
-AcpiTbSetTableLoadedFlag (
- UINT32 TableIndex,
- BOOLEAN IsLoaded)
-{
-
- (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
- if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount)
- {
- if (IsLoaded)
- {
- AcpiGbl_RootTableList.Tables[TableIndex].Flags |=
- ACPI_TABLE_IS_LOADED;
- }
- else
- {
- AcpiGbl_RootTableList.Tables[TableIndex].Flags &=
- ~ACPI_TABLE_IS_LOADED;
- }
- }
-
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ TableDesc->Address = ACPI_PTR_TO_PHYSADDR (NULL);
+ return_VOID;
}
diff --git a/sys/contrib/dev/acpica/components/tables/tbprint.c b/sys/contrib/dev/acpica/components/tables/tbprint.c
index e85acce..8be1a9f 100644
--- a/sys/contrib/dev/acpica/components/tables/tbprint.c
+++ b/sys/contrib/dev/acpica/components/tables/tbprint.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __TBPRINT_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/actables.h>
@@ -147,15 +145,17 @@ AcpiTbPrintTableHeader (
/*
- * 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.
+ * The reason that we use ACPI_PRINTF_UINT and ACPI_FORMAT_TO_UINT is to
+ * support both 32-bit and 64-bit hosts/addresses in a consistent manner.
+ * The %p specifier does not emit uniform output on all hosts. On some,
+ * leading zeros are not supported.
*/
if (ACPI_COMPARE_NAME (Header->Signature, ACPI_SIG_FACS))
{
/* FACS only has signature and length fields */
- ACPI_INFO ((AE_INFO, "%4.4s %p %05X",
- Header->Signature, ACPI_CAST_PTR (void, Address),
+ ACPI_INFO ((AE_INFO, "%-4.4s " ACPI_PRINTF_UINT " %06X",
+ Header->Signature, ACPI_FORMAT_TO_UINT (Address),
Header->Length));
}
else if (ACPI_VALIDATE_RSDP_SIG (Header->Signature))
@@ -166,8 +166,8 @@ AcpiTbPrintTableHeader (
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_INFO ((AE_INFO, "RSDP " ACPI_PRINTF_UINT " %06X (v%.2d %-6.6s)",
+ ACPI_FORMAT_TO_UINT (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,
@@ -180,8 +180,9 @@ AcpiTbPrintTableHeader (
AcpiTbCleanupTableHeader (&LocalHeader, Header);
ACPI_INFO ((AE_INFO,
- "%4.4s %p %05X (v%.2d %6.6s %8.8s %08X %4.4s %08X)",
- LocalHeader.Signature, ACPI_CAST_PTR (void, Address),
+ "%-4.4s " ACPI_PRINTF_UINT
+ " %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)",
+ LocalHeader.Signature, ACPI_FORMAT_TO_UINT (Address),
LocalHeader.Length, LocalHeader.Revision, LocalHeader.OemId,
LocalHeader.OemTableId, LocalHeader.OemRevision,
LocalHeader.AslCompilerId, LocalHeader.AslCompilerRevision));
diff --git a/sys/contrib/dev/acpica/components/tables/tbutils.c b/sys/contrib/dev/acpica/components/tables/tbutils.c
index 5cc157d..8b80025 100644
--- a/sys/contrib/dev/acpica/components/tables/tbutils.c
+++ b/sys/contrib/dev/acpica/components/tables/tbutils.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __TBUTILS_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/actables.h>
@@ -193,9 +191,12 @@ AcpiTbCopyDsdt (
}
ACPI_MEMCPY (NewTable, TableDesc->Pointer, TableDesc->Length);
- AcpiTbDeleteTable (TableDesc);
- TableDesc->Pointer = NewTable;
- TableDesc->Flags = ACPI_TABLE_ORIGIN_ALLOCATED;
+ AcpiTbUninstallTable (TableDesc);
+
+ AcpiTbInitTableDescriptor (
+ &AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT],
+ ACPI_PTR_TO_PHYSADDR (NewTable), ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL,
+ NewTable);
ACPI_INFO ((AE_INFO,
"Forced DSDT copy: length 0x%05X copied locally, original unmapped",
@@ -207,125 +208,6 @@ AcpiTbCopyDsdt (
/*******************************************************************************
*
- * FUNCTION: AcpiTbInstallTable
- *
- * PARAMETERS: Address - Physical address of DSDT or FACS
- * Signature - Table signature, NULL if no need to
- * match
- * TableIndex - Index into root table array
- *
- * RETURN: None
- *
- * DESCRIPTION: Install an ACPI table into the global data structure. The
- * table override mechanism is called to allow the host
- * OS to replace any table before it is installed in the root
- * table array.
- *
- ******************************************************************************/
-
-void
-AcpiTbInstallTable (
- ACPI_PHYSICAL_ADDRESS Address,
- char *Signature,
- UINT32 TableIndex)
-{
- ACPI_TABLE_HEADER *Table;
- ACPI_TABLE_HEADER *FinalTable;
- ACPI_TABLE_DESC *TableDesc;
-
-
- if (!Address)
- {
- ACPI_ERROR ((AE_INFO, "Null physical address for ACPI table [%s]",
- Signature));
- return;
- }
-
- /* Map just the table header */
-
- Table = AcpiOsMapMemory (Address, sizeof (ACPI_TABLE_HEADER));
- if (!Table)
- {
- ACPI_ERROR ((AE_INFO, "Could not map memory for table [%s] at %p",
- Signature, ACPI_CAST_PTR (void, Address)));
- return;
- }
-
- /* If a particular signature is expected (DSDT/FACS), it must match */
-
- if (Signature &&
- !ACPI_COMPARE_NAME (Table->Signature, Signature))
- {
- ACPI_BIOS_ERROR ((AE_INFO,
- "Invalid signature 0x%X for ACPI table, expected [%s]",
- *ACPI_CAST_PTR (UINT32, Table->Signature), Signature));
- goto UnmapAndExit;
- }
-
- /*
- * Initialize the table entry. Set the pointer to NULL, since the
- * table is not fully mapped at this time.
- */
- TableDesc = &AcpiGbl_RootTableList.Tables[TableIndex];
-
- TableDesc->Address = Address;
- TableDesc->Pointer = NULL;
- TableDesc->Length = Table->Length;
- TableDesc->Flags = ACPI_TABLE_ORIGIN_MAPPED;
- ACPI_MOVE_32_TO_32 (TableDesc->Signature.Ascii, Table->Signature);
-
- /*
- * ACPI Table Override:
- *
- * Before we install the table, let the host OS override it with a new
- * one if desired. Any table within the RSDT/XSDT can be replaced,
- * including the DSDT which is pointed to by the FADT.
- *
- * NOTE: If the table is overridden, then FinalTable will contain a
- * mapped pointer to the full new table. If the table is not overridden,
- * or if there has been a physical override, then the table will be
- * fully mapped later (in verify table). In any case, we must
- * unmap the header that was mapped above.
- */
- FinalTable = AcpiTbTableOverride (Table, TableDesc);
- if (!FinalTable)
- {
- FinalTable = Table; /* There was no override */
- }
-
- AcpiTbPrintTableHeader (TableDesc->Address, FinalTable);
-
- /* Set the global integer width (based upon revision of the DSDT) */
-
- if (TableIndex == ACPI_TABLE_INDEX_DSDT)
- {
- AcpiUtSetIntegerWidth (FinalTable->Revision);
- }
-
- /*
- * If we have a physical override during this early loading of the ACPI
- * tables, unmap the table for now. It will be mapped again later when
- * it is actually used. This supports very early loading of ACPI tables,
- * before virtual memory is fully initialized and running within the
- * host OS. Note: A logical override has the ACPI_TABLE_ORIGIN_OVERRIDE
- * flag set and will not be deleted below.
- */
- if (FinalTable != Table)
- {
- AcpiTbDeleteTable (TableDesc);
- }
-
-
-UnmapAndExit:
-
- /* Always unmap the table header that we mapped above */
-
- AcpiOsUnmapMemory (Table, sizeof (ACPI_TABLE_HEADER));
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiTbGetRootTableEntry
*
* PARAMETERS: TableEntry - Pointer to the RSDT/XSDT table entry
@@ -353,7 +235,7 @@ AcpiTbGetRootTableEntry (
* Get the table physical address (32-bit for RSDT, 64-bit for XSDT):
* Note: Addresses are 32-bit aligned (not 64) in both RSDT and XSDT
*/
- if (TableEntrySize == sizeof (UINT32))
+ if (TableEntrySize == ACPI_RSDT_ENTRY_SIZE)
{
/*
* 32-bit platform, RSDT: Return 32-bit table entry
@@ -416,14 +298,14 @@ AcpiTbParseRootTable (
UINT32 Length;
UINT8 *TableEntry;
ACPI_STATUS Status;
+ UINT32 TableIndex;
ACPI_FUNCTION_TRACE (TbParseRootTable);
- /*
- * Map the entire RSDP and extract the address of the RSDT or XSDT
- */
+ /* Map the entire RSDP and extract the address of the RSDT or XSDT */
+
Rsdp = AcpiOsMapMemory (RsdpAddress, sizeof (ACPI_TABLE_RSDP));
if (!Rsdp)
{
@@ -433,24 +315,26 @@ AcpiTbParseRootTable (
AcpiTbPrintTableHeader (RsdpAddress,
ACPI_CAST_PTR (ACPI_TABLE_HEADER, Rsdp));
- /* Differentiate between RSDT and XSDT root tables */
+ /* Use XSDT if present and not overridden. Otherwise, use RSDT */
- if (Rsdp->Revision > 1 && Rsdp->XsdtPhysicalAddress)
+ if ((Rsdp->Revision > 1) &&
+ Rsdp->XsdtPhysicalAddress &&
+ !AcpiGbl_DoNotUseXsdt)
{
/*
- * Root table is an XSDT (64-bit physical addresses). We must use the
- * XSDT if the revision is > 1 and the XSDT pointer is present, as per
- * the ACPI specification.
+ * RSDP contains an XSDT (64-bit physical addresses). We must use
+ * the XSDT if the revision is > 1 and the XSDT pointer is present,
+ * as per the ACPI specification.
*/
Address = (ACPI_PHYSICAL_ADDRESS) Rsdp->XsdtPhysicalAddress;
- TableEntrySize = sizeof (UINT64);
+ TableEntrySize = ACPI_XSDT_ENTRY_SIZE;
}
else
{
/* Root table is an RSDT (32-bit physical addresses) */
Address = (ACPI_PHYSICAL_ADDRESS) Rsdp->RsdtPhysicalAddress;
- TableEntrySize = sizeof (UINT32);
+ TableEntrySize = ACPI_RSDT_ENTRY_SIZE;
}
/*
@@ -459,7 +343,6 @@ AcpiTbParseRootTable (
*/
AcpiOsUnmapMemory (Rsdp, sizeof (ACPI_TABLE_RSDP));
-
/* Map the RSDT/XSDT table header to get the full table length */
Table = AcpiOsMapMemory (Address, sizeof (ACPI_TABLE_HEADER));
@@ -470,12 +353,14 @@ AcpiTbParseRootTable (
AcpiTbPrintTableHeader (Address, Table);
- /* Get the length of the full table, verify length and map entire table */
-
+ /*
+ * Validate length of the table, and map entire table.
+ * Minimum length table must contain at least one entry.
+ */
Length = Table->Length;
AcpiOsUnmapMemory (Table, sizeof (ACPI_TABLE_HEADER));
- if (Length < sizeof (ACPI_TABLE_HEADER))
+ if (Length < (sizeof (ACPI_TABLE_HEADER) + TableEntrySize))
{
ACPI_BIOS_ERROR ((AE_INFO,
"Invalid table length 0x%X in RSDT/XSDT", Length));
@@ -497,71 +382,50 @@ AcpiTbParseRootTable (
return_ACPI_STATUS (Status);
}
- /* Calculate the number of tables described in the root table */
+ /* Get the number of entries and pointer to first entry */
TableCount = (UINT32) ((Table->Length - sizeof (ACPI_TABLE_HEADER)) /
TableEntrySize);
+ TableEntry = ACPI_ADD_PTR (UINT8, Table, sizeof (ACPI_TABLE_HEADER));
/*
* First two entries in the table array are reserved for the DSDT
* and FACS, which are not actually present in the RSDT/XSDT - they
* come from the FADT
*/
- TableEntry = ACPI_CAST_PTR (UINT8, Table) + sizeof (ACPI_TABLE_HEADER);
AcpiGbl_RootTableList.CurrentTableCount = 2;
- /*
- * Initialize the root table array from the RSDT/XSDT
- */
+ /* Initialize the root table array from the RSDT/XSDT */
+
for (i = 0; i < TableCount; i++)
{
- if (AcpiGbl_RootTableList.CurrentTableCount >=
- AcpiGbl_RootTableList.MaxTableCount)
- {
- /* There is no more room in the root table array, attempt resize */
-
- Status = AcpiTbResizeRootTableList ();
- if (ACPI_FAILURE (Status))
- {
- ACPI_WARNING ((AE_INFO, "Truncating %u table entries!",
- (unsigned) (TableCount -
- (AcpiGbl_RootTableList.CurrentTableCount - 2))));
- break;
- }
- }
-
/* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */
- AcpiGbl_RootTableList.Tables[AcpiGbl_RootTableList.CurrentTableCount].Address =
- AcpiTbGetRootTableEntry (TableEntry, TableEntrySize);
+ Address = AcpiTbGetRootTableEntry (TableEntry, TableEntrySize);
- TableEntry += TableEntrySize;
- AcpiGbl_RootTableList.CurrentTableCount++;
- }
-
- /*
- * It is not possible to map more than one entry in some environments,
- * so unmap the root table here before mapping other tables
- */
- AcpiOsUnmapMemory (Table, Length);
+ /* Skip NULL entries in RSDT/XSDT */
- /*
- * Complete the initialization of the root table array by examining
- * the header of each table
- */
- for (i = 2; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
- {
- AcpiTbInstallTable (AcpiGbl_RootTableList.Tables[i].Address,
- NULL, i);
+ if (!Address)
+ {
+ goto NextTable;
+ }
- /* Special case for FADT - get the DSDT and FACS */
+ Status = AcpiTbInstallStandardTable (Address,
+ ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, FALSE, TRUE, &TableIndex);
- if (ACPI_COMPARE_NAME (
- &AcpiGbl_RootTableList.Tables[i].Signature, ACPI_SIG_FADT))
+ if (ACPI_SUCCESS (Status) &&
+ ACPI_COMPARE_NAME (&AcpiGbl_RootTableList.Tables[TableIndex].Signature,
+ ACPI_SIG_FADT))
{
- AcpiTbParseFadt (i);
+ AcpiTbParseFadt (TableIndex);
}
+
+NextTable:
+
+ TableEntry += TableEntrySize;
}
+ AcpiOsUnmapMemory (Table, Length);
+
return_ACPI_STATUS (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/components/tables/tbxface.c b/sys/contrib/dev/acpica/components/tables/tbxface.c
index 80381aa..7336b18 100644
--- a/sys/contrib/dev/acpica/components/tables/tbxface.c
+++ b/sys/contrib/dev/acpica/components/tables/tbxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __TBXFACE_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -161,7 +161,7 @@ AcpiInitializeTables (
return_ACPI_STATUS (Status);
}
-ACPI_EXPORT_SYMBOL (AcpiInitializeTables)
+ACPI_EXPORT_SYMBOL_INIT (AcpiInitializeTables)
/*******************************************************************************
@@ -204,7 +204,7 @@ AcpiReallocateRootTable (
return_ACPI_STATUS (Status);
}
-ACPI_EXPORT_SYMBOL (AcpiReallocateRootTable)
+ACPI_EXPORT_SYMBOL_INIT (AcpiReallocateRootTable)
/*******************************************************************************
@@ -261,7 +261,7 @@ AcpiGetTableHeader (
{
if ((AcpiGbl_RootTableList.Tables[i].Flags &
ACPI_TABLE_ORIGIN_MASK) ==
- ACPI_TABLE_ORIGIN_MAPPED)
+ ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL)
{
Header = AcpiOsMapMemory (
AcpiGbl_RootTableList.Tables[i].Address,
@@ -344,7 +344,7 @@ AcpiGetTable (
continue;
}
- Status = AcpiTbVerifyTable (&AcpiGbl_RootTableList.Tables[i]);
+ Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[i]);
if (ACPI_SUCCESS (Status))
{
*OutTable = AcpiGbl_RootTableList.Tables[i].Pointer;
@@ -405,7 +405,7 @@ AcpiGetTableByIndex (
{
/* Table is not mapped, map it */
- Status = AcpiTbVerifyTable (&AcpiGbl_RootTableList.Tables[TableIndex]);
+ Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[TableIndex]);
if (ACPI_FAILURE (Status))
{
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
diff --git a/sys/contrib/dev/acpica/components/tables/tbxfload.c b/sys/contrib/dev/acpica/components/tables/tbxfload.c
index 171f74c..805bbad 100644
--- a/sys/contrib/dev/acpica/components/tables/tbxfload.c
+++ b/sys/contrib/dev/acpica/components/tables/tbxfload.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __TBXFLOAD_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -92,7 +92,7 @@ AcpiLoadTables (
return_ACPI_STATUS (Status);
}
-ACPI_EXPORT_SYMBOL (AcpiLoadTables)
+ACPI_EXPORT_SYMBOL_INIT (AcpiLoadTables)
/*******************************************************************************
@@ -130,7 +130,7 @@ AcpiTbLoadNamespace (
!ACPI_COMPARE_NAME (
&(AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Signature),
ACPI_SIG_DSDT) ||
- ACPI_FAILURE (AcpiTbVerifyTable (
+ ACPI_FAILURE (AcpiTbValidateTable (
&AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT])))
{
Status = AE_NO_ACPI_TABLES;
@@ -141,7 +141,7 @@ AcpiTbLoadNamespace (
* Save the DSDT pointer for simple access. This is the mapped memory
* address. We must take care here because the address of the .Tables
* array can change dynamically as tables are loaded at run-time. Note:
- * .Pointer field is not validated until after call to AcpiTbVerifyTable.
+ * .Pointer field is not validated until after call to AcpiTbValidateTable.
*/
AcpiGbl_DSDT = AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Pointer;
@@ -186,24 +186,12 @@ AcpiTbLoadNamespace (
ACPI_SIG_SSDT) &&
!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature),
ACPI_SIG_PSDT)) ||
- ACPI_FAILURE (AcpiTbVerifyTable (
+ ACPI_FAILURE (AcpiTbValidateTable (
&AcpiGbl_RootTableList.Tables[i])))
{
continue;
}
- /*
- * Optionally do not load any SSDTs from the RSDT/XSDT. This can
- * be useful for debugging ACPI problems on some machines.
- */
- if (AcpiGbl_DisableSsdtTableLoad)
- {
- ACPI_INFO ((AE_INFO, "Ignoring %4.4s at %p",
- AcpiGbl_RootTableList.Tables[i].Signature.Ascii,
- ACPI_CAST_PTR (void, AcpiGbl_RootTableList.Tables[i].Address)));
- continue;
- }
-
/* Ignore errors while loading tables, get as many as possible */
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
@@ -221,6 +209,53 @@ UnlockAndExit:
/*******************************************************************************
*
+ * FUNCTION: AcpiInstallTable
+ *
+ * PARAMETERS: Address - Address of the ACPI table to be installed.
+ * Physical - Whether the address is a physical table
+ * address or not
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Dynamically install an ACPI table.
+ * Note: This function should only be invoked after
+ * AcpiInitializeTables() and before AcpiLoadTables().
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiInstallTable (
+ ACPI_PHYSICAL_ADDRESS Address,
+ BOOLEAN Physical)
+{
+ ACPI_STATUS Status;
+ UINT8 Flags;
+ UINT32 TableIndex;
+
+
+ ACPI_FUNCTION_TRACE (AcpiInstallTable);
+
+
+ if (Physical)
+ {
+ Flags = ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL;
+ }
+ else
+ {
+ Flags = ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL;
+ }
+
+ Status = AcpiTbInstallStandardTable (Address, Flags,
+ FALSE, FALSE, &TableIndex);
+
+ return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL_INIT (AcpiInstallTable)
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiLoadTable
*
* PARAMETERS: Table - Pointer to a buffer containing the ACPI
@@ -241,7 +276,6 @@ AcpiLoadTable (
ACPI_TABLE_HEADER *Table)
{
ACPI_STATUS Status;
- ACPI_TABLE_DESC TableDesc;
UINT32 TableIndex;
@@ -255,14 +289,6 @@ AcpiLoadTable (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- /* Init local table descriptor */
-
- ACPI_MEMSET (&TableDesc, 0, sizeof (ACPI_TABLE_DESC));
- TableDesc.Address = ACPI_PTR_TO_PHYSADDR (Table);
- TableDesc.Pointer = Table;
- TableDesc.Length = Table->Length;
- TableDesc.Flags = ACPI_TABLE_ORIGIN_UNKNOWN;
-
/* Must acquire the interpreter lock during this operation */
Status = AcpiUtAcquireMutex (ACPI_MTX_INTERPRETER);
@@ -274,7 +300,23 @@ AcpiLoadTable (
/* Install the table and load it into the namespace */
ACPI_INFO ((AE_INFO, "Host-directed Dynamic ACPI Table Load:"));
- Status = AcpiTbAddTable (&TableDesc, &TableIndex);
+ (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
+
+ Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table),
+ ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, TRUE, FALSE,
+ &TableIndex);
+
+ (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
+ if (ACPI_FAILURE (Status))
+ {
+ goto UnlockAndExit;
+ }
+
+ /*
+ * Note: Now table is "INSTALLED", it must be validated before
+ * using.
+ */
+ Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[TableIndex]);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
diff --git a/sys/contrib/dev/acpica/components/tables/tbxfroot.c b/sys/contrib/dev/acpica/components/tables/tbxfroot.c
index 0b9fe72..26babdb 100644
--- a/sys/contrib/dev/acpica/components/tables/tbxfroot.c
+++ b/sys/contrib/dev/acpica/components/tables/tbxfroot.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __TBXFROOT_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/actables.h>
@@ -54,6 +52,43 @@
/*******************************************************************************
*
+ * FUNCTION: AcpiTbGetRsdpLength
+ *
+ * PARAMETERS: Rsdp - Pointer to RSDP
+ *
+ * RETURN: Table length
+ *
+ * DESCRIPTION: Get the length of the RSDP
+ *
+ ******************************************************************************/
+
+UINT32
+AcpiTbGetRsdpLength (
+ ACPI_TABLE_RSDP *Rsdp)
+{
+
+ if (!ACPI_VALIDATE_RSDP_SIG (Rsdp->Signature))
+ {
+ /* BAD Signature */
+
+ return (0);
+ }
+
+ /* "Length" field is available if table version >= 2 */
+
+ if (Rsdp->Revision >= 2)
+ {
+ return (Rsdp->Length);
+ }
+ else
+ {
+ return (ACPI_RSDP_CHECKSUM_LENGTH);
+ }
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiTbValidateRsdp
*
* PARAMETERS: Rsdp - Pointer to unvalidated RSDP
diff --git a/sys/contrib/dev/acpica/components/utilities/utaddress.c b/sys/contrib/dev/acpica/components/utilities/utaddress.c
index da8b046..02d6110 100644
--- a/sys/contrib/dev/acpica/components/utilities/utaddress.c
+++ b/sys/contrib/dev/acpica/components/utilities/utaddress.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __UTADDRESS_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -248,10 +246,11 @@ AcpiUtCheckAddressRange (
while (RangeInfo)
{
/*
- * Check if the requested Address/Length overlaps this AddressRange.
- * Four cases to consider:
+ * Check if the requested address/length overlaps this
+ * address range. There are four cases to consider:
*
- * 1) Input address/length is contained completely in the address range
+ * 1) Input address/length is contained completely in the
+ * address range
* 2) Input address/length overlaps range at the range start
* 3) Input address/length overlaps range at the range end
* 4) Input address/length completely encompasses the range
@@ -267,10 +266,13 @@ AcpiUtCheckAddressRange (
Pathname = AcpiNsGetExternalPathname (RangeInfo->RegionNode);
ACPI_WARNING ((AE_INFO,
- "0x%p-0x%p %s conflicts with Region %s %d",
+ "%s range 0x%p-0x%p conflicts with OpRegion 0x%p-0x%p (%s)",
+ AcpiUtGetRegionName (SpaceId),
ACPI_CAST_PTR (void, Address),
ACPI_CAST_PTR (void, EndAddress),
- AcpiUtGetRegionName (SpaceId), Pathname, OverlapCount));
+ ACPI_CAST_PTR (void, RangeInfo->StartAddress),
+ ACPI_CAST_PTR (void, RangeInfo->EndAddress),
+ Pathname));
ACPI_FREE (Pathname);
}
}
diff --git a/sys/contrib/dev/acpica/components/utilities/utalloc.c b/sys/contrib/dev/acpica/components/utilities/utalloc.c
index 0bdb2ff..99fb15a1 100644
--- a/sys/contrib/dev/acpica/components/utilities/utalloc.c
+++ b/sys/contrib/dev/acpica/components/utilities/utalloc.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __UTALLOC_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdebug.h>
@@ -51,6 +49,45 @@
ACPI_MODULE_NAME ("utalloc")
+#if !defined (USE_NATIVE_ALLOCATE_ZEROED)
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiOsAllocateZeroed
+ *
+ * PARAMETERS: Size - Size of the allocation
+ *
+ * RETURN: Address of the allocated memory on success, NULL on failure.
+ *
+ * DESCRIPTION: Subsystem equivalent of calloc. Allocate and zero memory.
+ * This is the default implementation. Can be overridden via the
+ * USE_NATIVE_ALLOCATE_ZEROED flag.
+ *
+ ******************************************************************************/
+
+void *
+AcpiOsAllocateZeroed (
+ ACPI_SIZE Size)
+{
+ void *Allocation;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ Allocation = AcpiOsAllocate (Size);
+ if (Allocation)
+ {
+ /* Clear the memory block */
+
+ ACPI_MEMSET (Allocation, 0, Size);
+ }
+
+ return (Allocation);
+}
+
+#endif /* !USE_NATIVE_ALLOCATE_ZEROED */
+
+
/*******************************************************************************
*
* FUNCTION: AcpiUtCreateCaches
@@ -285,9 +322,13 @@ AcpiUtInitializeBuffer (
return (AE_BUFFER_OVERFLOW);
case ACPI_ALLOCATE_BUFFER:
-
- /* Allocate a new buffer */
-
+ /*
+ * Allocate a new buffer. We directectly call AcpiOsAllocate here to
+ * purposefully bypass the (optionally enabled) internal allocation
+ * tracking mechanism since we only want to track internal
+ * allocations. Note: The caller should use AcpiOsFree to free this
+ * buffer created via ACPI_ALLOCATE_BUFFER.
+ */
Buffer->Pointer = AcpiOsAllocate (RequiredLength);
break;
@@ -321,95 +362,3 @@ AcpiUtInitializeBuffer (
ACPI_MEMSET (Buffer->Pointer, 0, RequiredLength);
return (AE_OK);
}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiUtAllocate
- *
- * PARAMETERS: Size - Size of the allocation
- * Component - Component type of caller
- * Module - Source file name of caller
- * Line - Line number of caller
- *
- * RETURN: Address of the allocated memory on success, NULL on failure.
- *
- * DESCRIPTION: Subsystem equivalent of malloc.
- *
- ******************************************************************************/
-
-void *
-AcpiUtAllocate (
- ACPI_SIZE Size,
- UINT32 Component,
- const char *Module,
- UINT32 Line)
-{
- void *Allocation;
-
-
- ACPI_FUNCTION_TRACE_U32 (UtAllocate, Size);
-
-
- /* Check for an inadvertent size of zero bytes */
-
- if (!Size)
- {
- ACPI_WARNING ((Module, Line,
- "Attempt to allocate zero bytes, allocating 1 byte"));
- Size = 1;
- }
-
- Allocation = AcpiOsAllocate (Size);
- if (!Allocation)
- {
- /* Report allocation error */
-
- ACPI_WARNING ((Module, Line,
- "Could not allocate size %u", (UINT32) Size));
-
- return_PTR (NULL);
- }
-
- return_PTR (Allocation);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiUtAllocateZeroed
- *
- * PARAMETERS: Size - Size of the allocation
- * Component - Component type of caller
- * Module - Source file name of caller
- * Line - Line number of caller
- *
- * RETURN: Address of the allocated memory on success, NULL on failure.
- *
- * DESCRIPTION: Subsystem equivalent of calloc. Allocate and zero memory.
- *
- ******************************************************************************/
-
-void *
-AcpiUtAllocateZeroed (
- ACPI_SIZE Size,
- UINT32 Component,
- const char *Module,
- UINT32 Line)
-{
- void *Allocation;
-
-
- ACPI_FUNCTION_ENTRY ();
-
-
- Allocation = AcpiUtAllocate (Size, Component, Module, Line);
- if (Allocation)
- {
- /* Clear the memory block */
-
- ACPI_MEMSET (Allocation, 0, Size);
- }
-
- return (Allocation);
-}
diff --git a/sys/contrib/dev/acpica/components/utilities/utbuffer.c b/sys/contrib/dev/acpica/components/utilities/utbuffer.c
index 508a940..862ac6b 100644
--- a/sys/contrib/dev/acpica/components/utilities/utbuffer.c
+++ b/sys/contrib/dev/acpica/components/utilities/utbuffer.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __UTBUFFER_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -218,3 +216,138 @@ AcpiUtDebugDumpBuffer (
AcpiUtDumpBuffer (Buffer, Count, Display, 0);
}
+
+
+#ifdef ACPI_APPLICATION
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtDumpBufferToFile
+ *
+ * PARAMETERS: File - File descriptor
+ * Buffer - Buffer to dump
+ * Count - Amount to dump, in bytes
+ * Display - BYTE, WORD, DWORD, or QWORD display:
+ * DB_BYTE_DISPLAY
+ * DB_WORD_DISPLAY
+ * DB_DWORD_DISPLAY
+ * DB_QWORD_DISPLAY
+ * BaseOffset - Beginning buffer offset (display only)
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Generic dump buffer in both hex and ascii to a file.
+ *
+ ******************************************************************************/
+
+void
+AcpiUtDumpBufferToFile (
+ ACPI_FILE File,
+ UINT8 *Buffer,
+ UINT32 Count,
+ UINT32 Display,
+ UINT32 BaseOffset)
+{
+ UINT32 i = 0;
+ UINT32 j;
+ UINT32 Temp32;
+ UINT8 BufChar;
+
+
+ if (!Buffer)
+ {
+ AcpiUtFilePrintf (File, "Null Buffer Pointer in DumpBuffer!\n");
+ return;
+ }
+
+ if ((Count < 4) || (Count & 0x01))
+ {
+ Display = DB_BYTE_DISPLAY;
+ }
+
+ /* Nasty little dump buffer routine! */
+
+ while (i < Count)
+ {
+ /* Print current offset */
+
+ AcpiUtFilePrintf (File, "%6.4X: ", (BaseOffset + i));
+
+ /* Print 16 hex chars */
+
+ for (j = 0; j < 16;)
+ {
+ if (i + j >= Count)
+ {
+ /* Dump fill spaces */
+
+ AcpiUtFilePrintf (File, "%*s", ((Display * 2) + 1), " ");
+ j += Display;
+ continue;
+ }
+
+ switch (Display)
+ {
+ case DB_BYTE_DISPLAY:
+ default: /* Default is BYTE display */
+
+ AcpiUtFilePrintf (File, "%02X ", Buffer[(ACPI_SIZE) i + j]);
+ break;
+
+ case DB_WORD_DISPLAY:
+
+ ACPI_MOVE_16_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
+ AcpiUtFilePrintf (File, "%04X ", Temp32);
+ break;
+
+ case DB_DWORD_DISPLAY:
+
+ ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
+ AcpiUtFilePrintf (File, "%08X ", Temp32);
+ break;
+
+ case DB_QWORD_DISPLAY:
+
+ ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
+ AcpiUtFilePrintf (File, "%08X", Temp32);
+
+ ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j + 4]);
+ AcpiUtFilePrintf (File, "%08X ", Temp32);
+ break;
+ }
+
+ j += Display;
+ }
+
+ /*
+ * Print the ASCII equivalent characters but watch out for the bad
+ * unprintable ones (printable chars are 0x20 through 0x7E)
+ */
+ AcpiUtFilePrintf (File, " ");
+ for (j = 0; j < 16; j++)
+ {
+ if (i + j >= Count)
+ {
+ AcpiUtFilePrintf (File, "\n");
+ return;
+ }
+
+ BufChar = Buffer[(ACPI_SIZE) i + j];
+ if (ACPI_IS_PRINT (BufChar))
+ {
+ AcpiUtFilePrintf (File, "%c", BufChar);
+ }
+ else
+ {
+ AcpiUtFilePrintf (File, ".");
+ }
+ }
+
+ /* Done with that line. */
+
+ AcpiUtFilePrintf (File, "\n");
+ i += 16;
+ }
+
+ return;
+}
+#endif
diff --git a/sys/contrib/dev/acpica/components/utilities/utcache.c b/sys/contrib/dev/acpica/components/utilities/utcache.c
index 2aa3e5b..aa0161c 100644
--- a/sys/contrib/dev/acpica/components/utilities/utcache.c
+++ b/sys/contrib/dev/acpica/components/utilities/utcache.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __UTCACHE_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -286,13 +284,13 @@ AcpiOsAcquireObject (
if (!Cache)
{
- return (NULL);
+ return_PTR (NULL);
}
Status = AcpiUtAcquireMutex (ACPI_MTX_CACHES);
if (ACPI_FAILURE (Status))
{
- return (NULL);
+ return_PTR (NULL);
}
ACPI_MEM_TRACKING (Cache->Requests++);
@@ -315,7 +313,7 @@ AcpiOsAcquireObject (
Status = AcpiUtReleaseMutex (ACPI_MTX_CACHES);
if (ACPI_FAILURE (Status))
{
- return (NULL);
+ return_PTR (NULL);
}
/* Clear (zero) the previously used Object */
@@ -340,16 +338,16 @@ AcpiOsAcquireObject (
Status = AcpiUtReleaseMutex (ACPI_MTX_CACHES);
if (ACPI_FAILURE (Status))
{
- return (NULL);
+ return_PTR (NULL);
}
Object = ACPI_ALLOCATE_ZEROED (Cache->ObjectSize);
if (!Object)
{
- return (NULL);
+ return_PTR (NULL);
}
}
- return (Object);
+ return_PTR (Object);
}
#endif /* ACPI_USE_LOCAL_CACHE */
diff --git a/sys/contrib/dev/acpica/components/utilities/utcopy.c b/sys/contrib/dev/acpica/components/utilities/utcopy.c
index dacbc5c..8a94ea6 100644
--- a/sys/contrib/dev/acpica/components/utilities/utcopy.c
+++ b/sys/contrib/dev/acpica/components/utilities/utcopy.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __UTCOPY_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -564,10 +562,10 @@ AcpiUtCopyEsimpleToIsimple (
case ACPI_TYPE_LOCAL_REFERENCE:
- /* TBD: should validate incoming handle */
+ /* An incoming reference is defined to be a namespace node */
- InternalObject->Reference.Class = ACPI_REFCLASS_NAME;
- InternalObject->Reference.Node = ExternalObject->Reference.Handle;
+ InternalObject->Reference.Class = ACPI_REFCLASS_REFOF;
+ InternalObject->Reference.Object = ExternalObject->Reference.Handle;
break;
default:
@@ -1063,5 +1061,12 @@ AcpiUtCopyIobjectToIobject (
Status = AcpiUtCopySimpleObject (SourceDesc, *DestDesc);
}
+ /* Delete the allocated object if copy failed */
+
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiUtRemoveReference(*DestDesc);
+ }
+
return_ACPI_STATUS (Status);
}
diff --git a/sys/contrib/dev/acpica/components/utilities/utdebug.c b/sys/contrib/dev/acpica/components/utilities/utdebug.c
index 93c0361..544450d 100644
--- a/sys/contrib/dev/acpica/components/utilities/utdebug.c
+++ b/sys/contrib/dev/acpica/components/utilities/utdebug.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __UTDEBUG_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -210,6 +210,7 @@ AcpiDebugPrint (
}
AcpiGbl_PrevThreadId = ThreadId;
+ AcpiGbl_NestingLevel = 0;
}
/*
@@ -218,13 +219,22 @@ AcpiDebugPrint (
*/
AcpiOsPrintf ("%9s-%04ld ", ModuleName, LineNumber);
+#ifdef ACPI_APPLICATION
+ /*
+ * For AcpiExec/iASL only, emit the thread ID and nesting level.
+ * Note: nesting level is really only useful during a single-thread
+ * execution. Otherwise, multiple threads will keep resetting the
+ * level.
+ */
if (ACPI_LV_THREADS & AcpiDbgLevel)
{
AcpiOsPrintf ("[%u] ", (UINT32) ThreadId);
}
- AcpiOsPrintf ("[%02ld] %-22.22s: ",
- AcpiGbl_NestingLevel, AcpiUtTrimFunctionName (FunctionName));
+ AcpiOsPrintf ("[%02ld] ", AcpiGbl_NestingLevel);
+#endif
+
+ AcpiOsPrintf ("%-22.22s: ", AcpiUtTrimFunctionName (FunctionName));
va_start (args, Format);
AcpiOsVprintf (Format, args);
@@ -474,7 +484,10 @@ AcpiUtExit (
"%s\n", AcpiGbl_FnExitStr);
}
- AcpiGbl_NestingLevel--;
+ if (AcpiGbl_NestingLevel)
+ {
+ AcpiGbl_NestingLevel--;
+ }
}
ACPI_EXPORT_SYMBOL (AcpiUtExit)
@@ -526,7 +539,10 @@ AcpiUtStatusExit (
}
}
- AcpiGbl_NestingLevel--;
+ if (AcpiGbl_NestingLevel)
+ {
+ AcpiGbl_NestingLevel--;
+ }
}
ACPI_EXPORT_SYMBOL (AcpiUtStatusExit)
@@ -568,7 +584,10 @@ AcpiUtValueExit (
ACPI_FORMAT_UINT64 (Value));
}
- AcpiGbl_NestingLevel--;
+ if (AcpiGbl_NestingLevel)
+ {
+ AcpiGbl_NestingLevel--;
+ }
}
ACPI_EXPORT_SYMBOL (AcpiUtValueExit)
@@ -609,7 +628,40 @@ AcpiUtPtrExit (
"%s %p\n", AcpiGbl_FnExitStr, Ptr);
}
- AcpiGbl_NestingLevel--;
+ if (AcpiGbl_NestingLevel)
+ {
+ AcpiGbl_NestingLevel--;
+ }
+}
+
+#endif
+
+
+#ifdef ACPI_APPLICATION
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiLogError
+ *
+ * PARAMETERS: Format - Printf format field
+ * ... - Optional printf arguments
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Print error message to the console, used by applications.
+ *
+ ******************************************************************************/
+
+void ACPI_INTERNAL_VAR_XFACE
+AcpiLogError (
+ const char *Format,
+ ...)
+{
+ va_list Args;
+
+ va_start (Args, Format);
+ (void) AcpiUtFileVprintf (ACPI_FILE_ERR, Format, Args);
+ va_end (Args);
}
+ACPI_EXPORT_SYMBOL (AcpiLogError)
#endif
diff --git a/sys/contrib/dev/acpica/components/utilities/utdecode.c b/sys/contrib/dev/acpica/components/utilities/utdecode.c
index 3075479..c1887ee 100644
--- a/sys/contrib/dev/acpica/components/utilities/utdecode.c
+++ b/sys/contrib/dev/acpica/components/utilities/utdecode.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __UTDECODE_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -93,38 +91,6 @@ const UINT8 AcpiGbl_NsProperties[ACPI_NUM_NS_TYPES] =
/*******************************************************************************
*
- * FUNCTION: AcpiUtHexToAsciiChar
- *
- * PARAMETERS: Integer - Contains the hex digit
- * Position - bit position of the digit within the
- * integer (multiple of 4)
- *
- * RETURN: The converted Ascii character
- *
- * DESCRIPTION: Convert a hex digit to an Ascii character
- *
- ******************************************************************************/
-
-/* Hex to ASCII conversion table */
-
-static const char AcpiGbl_HexToAscii[] =
-{
- '0','1','2','3','4','5','6','7',
- '8','9','A','B','C','D','E','F'
-};
-
-char
-AcpiUtHexToAsciiChar (
- UINT64 Integer,
- UINT32 Position)
-{
-
- return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiUtGetRegionName
*
* PARAMETERS: Space ID - ID for the region
@@ -527,7 +493,7 @@ AcpiUtGetMutexName (
/* Names for Notify() values, used for debug output */
-static const char *AcpiGbl_NotifyValueNames[ACPI_NOTIFY_MAX + 1] =
+static const char *AcpiGbl_GenericNotify[ACPI_NOTIFY_MAX + 1] =
{
/* 00 */ "Bus Check",
/* 01 */ "Device Check",
@@ -539,32 +505,88 @@ static const char *AcpiGbl_NotifyValueNames[ACPI_NOTIFY_MAX + 1] =
/* 07 */ "Power Fault",
/* 08 */ "Capabilities Check",
/* 09 */ "Device PLD Check",
- /* 10 */ "Reserved",
- /* 11 */ "System Locality Update",
- /* 12 */ "Shutdown Request"
+ /* 0A */ "Reserved",
+ /* 0B */ "System Locality Update",
+ /* 0C */ "Shutdown Request",
+ /* 0D */ "System Resource Affinity Update"
+};
+
+static const char *AcpiGbl_DeviceNotify[4] =
+{
+ /* 80 */ "Status Change",
+ /* 81 */ "Information Change",
+ /* 82 */ "Device-Specific Change",
+ /* 83 */ "Device-Specific Change"
};
+static const char *AcpiGbl_ProcessorNotify[4] =
+{
+ /* 80 */ "Performance Capability Change",
+ /* 81 */ "C-State Change",
+ /* 82 */ "Throttling Capability Change",
+ /* 83 */ "Device-Specific Change"
+};
+
+static const char *AcpiGbl_ThermalNotify[4] =
+{
+ /* 80 */ "Thermal Status Change",
+ /* 81 */ "Thermal Trip Point Change",
+ /* 82 */ "Thermal Device List Change",
+ /* 83 */ "Thermal Relationship Change"
+};
+
+
const char *
AcpiUtGetNotifyName (
- UINT32 NotifyValue)
+ UINT32 NotifyValue,
+ ACPI_OBJECT_TYPE Type)
{
+ /* 00 - 0D are common to all object types */
+
if (NotifyValue <= ACPI_NOTIFY_MAX)
{
- return (AcpiGbl_NotifyValueNames[NotifyValue]);
+ return (AcpiGbl_GenericNotify[NotifyValue]);
}
- else if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
+
+ /* 0D - 7F are reserved */
+
+ if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
{
return ("Reserved");
}
- else if (NotifyValue <= ACPI_MAX_DEVICE_SPECIFIC_NOTIFY)
+
+ /* 80 - 83 are per-object-type */
+
+ if (NotifyValue <= 0x83)
{
- return ("Device Specific");
+ switch (Type)
+ {
+ case ACPI_TYPE_ANY:
+ case ACPI_TYPE_DEVICE:
+ return (AcpiGbl_DeviceNotify [NotifyValue - 0x80]);
+
+ case ACPI_TYPE_PROCESSOR:
+ return (AcpiGbl_ProcessorNotify [NotifyValue - 0x80]);
+
+ case ACPI_TYPE_THERMAL:
+ return (AcpiGbl_ThermalNotify [NotifyValue - 0x80]);
+
+ default:
+ return ("Target object type does not support notifies");
+ }
}
- else
+
+ /* 84 - BF are device-specific */
+
+ if (NotifyValue <= ACPI_MAX_DEVICE_SPECIFIC_NOTIFY)
{
- return ("Hardware Specific");
+ return ("Device-Specific");
}
+
+ /* C0 and above are hardware-specific */
+
+ return ("Hardware-Specific");
}
#endif
diff --git a/sys/contrib/dev/acpica/components/utilities/utdelete.c b/sys/contrib/dev/acpica/components/utilities/utdelete.c
index 6f1f89b..bc9ab70 100644
--- a/sys/contrib/dev/acpica/components/utilities/utdelete.c
+++ b/sys/contrib/dev/acpica/components/utilities/utdelete.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __UTDELETE_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acinterp.h>
@@ -86,6 +84,7 @@ AcpiUtDeleteInternalObj (
ACPI_OPERAND_OBJECT *HandlerDesc;
ACPI_OPERAND_OBJECT *SecondDesc;
ACPI_OPERAND_OBJECT *NextDesc;
+ ACPI_OPERAND_OBJECT *StartDesc;
ACPI_OPERAND_OBJECT **LastObjPtr;
@@ -250,9 +249,10 @@ AcpiUtDeleteInternalObj (
if (HandlerDesc)
{
NextDesc = HandlerDesc->AddressSpace.RegionList;
+ StartDesc = NextDesc;
LastObjPtr = &HandlerDesc->AddressSpace.RegionList;
- /* Remove the region object from the handler's list */
+ /* Remove the region object from the handler list */
while (NextDesc)
{
@@ -262,10 +262,20 @@ AcpiUtDeleteInternalObj (
break;
}
- /* Walk the linked list of handler */
+ /* Walk the linked list of handlers */
LastObjPtr = &NextDesc->Region.Next;
NextDesc = NextDesc->Region.Next;
+
+ /* Prevent infinite loop if list is corrupted */
+
+ if (NextDesc == StartDesc)
+ {
+ ACPI_ERROR ((AE_INFO,
+ "Circular region list in address handler object %p",
+ HandlerDesc));
+ return_VOID;
+ }
}
if (HandlerDesc->AddressSpace.HandlerFlags &
diff --git a/sys/contrib/dev/acpica/components/utilities/uterror.c b/sys/contrib/dev/acpica/components/utilities/uterror.c
index b7aef18..35e9ce6 100644
--- a/sys/contrib/dev/acpica/components/utilities/uterror.c
+++ b/sys/contrib/dev/acpica/components/utilities/uterror.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __UTERROR_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
diff --git a/sys/contrib/dev/acpica/components/utilities/uteval.c b/sys/contrib/dev/acpica/components/utilities/uteval.c
index ba4d6ee..b9d63b4 100644
--- a/sys/contrib/dev/acpica/components/utilities/uteval.c
+++ b/sys/contrib/dev/acpica/components/utilities/uteval.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __UTEVAL_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
diff --git a/sys/contrib/dev/acpica/components/utilities/utexcep.c b/sys/contrib/dev/acpica/components/utilities/utexcep.c
index d69dbf0..2a38cff 100644
--- a/sys/contrib/dev/acpica/components/utilities/utexcep.c
+++ b/sys/contrib/dev/acpica/components/utilities/utexcep.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __UTEXCEP_C__
+#define EXPORT_ACPI_INTERFACES
#define ACPI_DEFINE_EXCEPTION_TABLE
#include <contrib/dev/acpica/include/acpi.h>
diff --git a/sys/contrib/dev/acpica/components/utilities/utfileio.c b/sys/contrib/dev/acpica/components/utilities/utfileio.c
new file mode 100644
index 0000000..bef66f6
--- /dev/null
+++ b/sys/contrib/dev/acpica/components/utilities/utfileio.c
@@ -0,0 +1,361 @@
+/*******************************************************************************
+ *
+ * Module Name: utfileio - simple file I/O routines
+ *
+ ******************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+#include <contrib/dev/acpica/include/actables.h>
+#include <contrib/dev/acpica/include/acapps.h>
+
+#ifdef ACPI_ASL_COMPILER
+#include <contrib/dev/acpica/compiler/aslcompiler.h>
+#endif
+
+
+#define _COMPONENT ACPI_CA_DEBUGGER
+ ACPI_MODULE_NAME ("utfileio")
+
+
+#ifdef ACPI_APPLICATION
+
+/* Local prototypes */
+
+static ACPI_STATUS
+AcpiUtCheckTextModeCorruption (
+ UINT8 *Table,
+ UINT32 TableLength,
+ UINT32 FileLength);
+
+static ACPI_STATUS
+AcpiUtReadTable (
+ FILE *fp,
+ ACPI_TABLE_HEADER **Table,
+ UINT32 *TableLength);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtCheckTextModeCorruption
+ *
+ * PARAMETERS: Table - Table buffer
+ * TableLength - Length of table from the table header
+ * FileLength - Length of the file that contains the table
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Check table for text mode file corruption where all linefeed
+ * characters (LF) have been replaced by carriage return linefeed
+ * pairs (CR/LF).
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiUtCheckTextModeCorruption (
+ UINT8 *Table,
+ UINT32 TableLength,
+ UINT32 FileLength)
+{
+ UINT32 i;
+ UINT32 Pairs = 0;
+
+
+ if (TableLength != FileLength)
+ {
+ ACPI_WARNING ((AE_INFO,
+ "File length (0x%X) is not the same as the table length (0x%X)",
+ FileLength, TableLength));
+ }
+
+ /* Scan entire table to determine if each LF has been prefixed with a CR */
+
+ for (i = 1; i < FileLength; i++)
+ {
+ if (Table[i] == 0x0A)
+ {
+ if (Table[i - 1] != 0x0D)
+ {
+ /* The LF does not have a preceding CR, table not corrupted */
+
+ return (AE_OK);
+ }
+ else
+ {
+ /* Found a CR/LF pair */
+
+ Pairs++;
+ }
+ i++;
+ }
+ }
+
+ if (!Pairs)
+ {
+ return (AE_OK);
+ }
+
+ /*
+ * Entire table scanned, each CR is part of a CR/LF pair --
+ * meaning that the table was treated as a text file somewhere.
+ *
+ * NOTE: We can't "fix" the table, because any existing CR/LF pairs in the
+ * original table are left untouched by the text conversion process --
+ * meaning that we cannot simply replace CR/LF pairs with LFs.
+ */
+ AcpiOsPrintf ("Table has been corrupted by text mode conversion\n");
+ AcpiOsPrintf ("All LFs (%u) were changed to CR/LF pairs\n", Pairs);
+ AcpiOsPrintf ("Table cannot be repaired!\n");
+ return (AE_BAD_VALUE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtReadTable
+ *
+ * PARAMETERS: fp - File that contains table
+ * Table - Return value, buffer with table
+ * TableLength - Return value, length of table
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Load the DSDT from the file pointer
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiUtReadTable (
+ FILE *fp,
+ ACPI_TABLE_HEADER **Table,
+ UINT32 *TableLength)
+{
+ ACPI_TABLE_HEADER TableHeader;
+ UINT32 Actual;
+ ACPI_STATUS Status;
+ UINT32 FileSize;
+ BOOLEAN StandardHeader = TRUE;
+ INT32 Count;
+
+ /* Get the file size */
+
+ FileSize = CmGetFileSize (fp);
+ if (FileSize == ACPI_UINT32_MAX)
+ {
+ return (AE_ERROR);
+ }
+
+ if (FileSize < 4)
+ {
+ return (AE_BAD_HEADER);
+ }
+
+ /* Read the signature */
+
+ fseek (fp, 0, SEEK_SET);
+
+ Count = fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), fp);
+ if (Count != sizeof (ACPI_TABLE_HEADER))
+ {
+ AcpiOsPrintf ("Could not read the table header\n");
+ return (AE_BAD_HEADER);
+ }
+
+ /* The RSDP table does not have standard ACPI header */
+
+ if (ACPI_VALIDATE_RSDP_SIG (TableHeader.Signature))
+ {
+ *TableLength = FileSize;
+ StandardHeader = FALSE;
+ }
+ else
+ {
+
+#if 0
+ /* Validate the table header/length */
+
+ Status = AcpiTbValidateTableHeader (&TableHeader);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Table header is invalid!\n");
+ return (Status);
+ }
+#endif
+
+ /* File size must be at least as long as the Header-specified length */
+
+ if (TableHeader.Length > FileSize)
+ {
+ AcpiOsPrintf (
+ "TableHeader length [0x%X] greater than the input file size [0x%X]\n",
+ TableHeader.Length, FileSize);
+
+#ifdef ACPI_ASL_COMPILER
+ Status = FlCheckForAscii (fp, NULL, FALSE);
+ if (ACPI_SUCCESS (Status))
+ {
+ AcpiOsPrintf ("File appears to be ASCII only, must be binary\n");
+ }
+#endif
+ return (AE_BAD_HEADER);
+ }
+
+#ifdef ACPI_OBSOLETE_CODE
+ /* We only support a limited number of table types */
+
+ if (!ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_DSDT) &&
+ !ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_PSDT) &&
+ !ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_SSDT))
+ {
+ AcpiOsPrintf ("Table signature [%4.4s] is invalid or not supported\n",
+ (char *) TableHeader.Signature);
+ ACPI_DUMP_BUFFER (&TableHeader, sizeof (ACPI_TABLE_HEADER));
+ return (AE_ERROR);
+ }
+#endif
+
+ *TableLength = TableHeader.Length;
+ }
+
+ /* Allocate a buffer for the table */
+
+ *Table = AcpiOsAllocate ((size_t) FileSize);
+ if (!*Table)
+ {
+ AcpiOsPrintf (
+ "Could not allocate memory for ACPI table %4.4s (size=0x%X)\n",
+ TableHeader.Signature, *TableLength);
+ return (AE_NO_MEMORY);
+ }
+
+ /* Get the rest of the table */
+
+ fseek (fp, 0, SEEK_SET);
+ Actual = fread (*Table, 1, (size_t) FileSize, fp);
+ if (Actual == FileSize)
+ {
+ if (StandardHeader)
+ {
+ /* Now validate the checksum */
+
+ Status = AcpiTbVerifyChecksum ((void *) *Table,
+ ACPI_CAST_PTR (ACPI_TABLE_HEADER, *Table)->Length);
+
+ if (Status == AE_BAD_CHECKSUM)
+ {
+ Status = AcpiUtCheckTextModeCorruption ((UINT8 *) *Table,
+ FileSize, (*Table)->Length);
+ return (Status);
+ }
+ }
+ return (AE_OK);
+ }
+
+ if (Actual > 0)
+ {
+ AcpiOsPrintf ("Warning - reading table, asked for %X got %X\n",
+ FileSize, Actual);
+ return (AE_OK);
+ }
+
+ AcpiOsPrintf ("Error - could not read the table file\n");
+ AcpiOsFree (*Table);
+ *Table = NULL;
+ *TableLength = 0;
+ return (AE_ERROR);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtReadTableFromFile
+ *
+ * PARAMETERS: Filename - File where table is located
+ * Table - Where a pointer to the table is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Get an ACPI table from a file
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtReadTableFromFile (
+ char *Filename,
+ ACPI_TABLE_HEADER **Table)
+{
+ FILE *File;
+ UINT32 FileSize;
+ UINT32 TableLength;
+ ACPI_STATUS Status = AE_ERROR;
+
+
+ /* Open the file, get current size */
+
+ File = fopen (Filename, "rb");
+ if (!File)
+ {
+ perror ("Could not open input file");
+ return (Status);
+ }
+
+ FileSize = CmGetFileSize (File);
+ if (FileSize == ACPI_UINT32_MAX)
+ {
+ goto Exit;
+ }
+
+ /* Get the entire file */
+
+ fprintf (stderr, "Loading Acpi table from file %10s - Length %.8u (%06X)\n",
+ Filename, FileSize, FileSize);
+
+ Status = AcpiUtReadTable (File, Table, &TableLength);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not get table from the file\n");
+ }
+
+Exit:
+ fclose(File);
+ return (Status);
+}
+
+#endif
diff --git a/sys/contrib/dev/acpica/components/utilities/utglobal.c b/sys/contrib/dev/acpica/components/utilities/utglobal.c
index 6233a4a..1dfd3e1 100644
--- a/sys/contrib/dev/acpica/components/utilities/utglobal.c
+++ b/sys/contrib/dev/acpica/components/utilities/utglobal.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __UTGLOBAL_C__
+#define EXPORT_ACPI_INTERFACES
#define DEFINE_ACPI_GLOBALS
#include <contrib/dev/acpica/include/acpi.h>
@@ -57,37 +57,7 @@
*
******************************************************************************/
-/*
- * We want the debug switches statically initialized so they
- * are already set when the debugger is entered.
- */
-
-/* Debug switch - level and trace mask */
-
-#ifdef ACPI_DEBUG_OUTPUT
-UINT32 AcpiDbgLevel = ACPI_DEBUG_DEFAULT;
-#else
-UINT32 AcpiDbgLevel = ACPI_NORMAL_DEFAULT;
-#endif
-
-/* Debug switch - layer (component) mask */
-
-UINT32 AcpiDbgLayer = ACPI_COMPONENT_DEFAULT;
-UINT32 AcpiGbl_NestingLevel = 0;
-
-/* Debugger globals */
-
-BOOLEAN AcpiGbl_DbTerminateThreads = FALSE;
-BOOLEAN AcpiGbl_AbortMethod = FALSE;
-BOOLEAN AcpiGbl_MethodExecuting = FALSE;
-
-/* System flags */
-
-UINT32 AcpiGbl_StartupFlags = 0;
-
-/* System starts uninitialized */
-
-BOOLEAN AcpiGbl_Shutdown = TRUE;
+/* Various state name strings */
const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT] =
{
@@ -202,163 +172,6 @@ ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] =
};
#endif /* !ACPI_REDUCED_HARDWARE */
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiUtInitGlobals
- *
- * PARAMETERS: None
- *
- * RETURN: Status
- *
- * DESCRIPTION: Initialize ACPICA globals. All globals that require specific
- * initialization should be initialized here. This allows for
- * a warm restart.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiUtInitGlobals (
- void)
-{
- ACPI_STATUS Status;
- UINT32 i;
-
-
- ACPI_FUNCTION_TRACE (UtInitGlobals);
-
-
- /* Create all memory caches */
-
- Status = AcpiUtCreateCaches ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- /* Address Range lists */
-
- for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++)
- {
- AcpiGbl_AddressRangeList[i] = NULL;
- }
-
- /* Mutex locked flags */
-
- for (i = 0; i < ACPI_NUM_MUTEX; i++)
- {
- AcpiGbl_MutexInfo[i].Mutex = NULL;
- AcpiGbl_MutexInfo[i].ThreadId = ACPI_MUTEX_NOT_ACQUIRED;
- AcpiGbl_MutexInfo[i].UseCount = 0;
- }
-
- for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++)
- {
- AcpiGbl_OwnerIdMask[i] = 0;
- }
-
- /* Last OwnerID is never valid */
-
- AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
-
- /* Event counters */
-
- AcpiMethodCount = 0;
- AcpiSciCount = 0;
- AcpiGpeCount = 0;
-
- for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
- {
- AcpiFixedEventCount[i] = 0;
- }
-
-#if (!ACPI_REDUCED_HARDWARE)
-
- /* GPE/SCI support */
-
- AcpiGbl_AllGpesInitialized = FALSE;
- AcpiGbl_GpeXruptListHead = NULL;
- AcpiGbl_GpeFadtBlocks[0] = NULL;
- AcpiGbl_GpeFadtBlocks[1] = NULL;
- AcpiCurrentGpeCount = 0;
-
- AcpiGbl_GlobalEventHandler = NULL;
- AcpiGbl_SciHandlerList = NULL;
-
-#endif /* !ACPI_REDUCED_HARDWARE */
-
- /* Global handlers */
-
- AcpiGbl_GlobalNotify[0].Handler = NULL;
- AcpiGbl_GlobalNotify[1].Handler = NULL;
- AcpiGbl_ExceptionHandler = NULL;
- AcpiGbl_InitHandler = NULL;
- AcpiGbl_TableHandler = NULL;
- AcpiGbl_InterfaceHandler = NULL;
-
- /* Global Lock support */
-
- AcpiGbl_GlobalLockSemaphore = NULL;
- AcpiGbl_GlobalLockMutex = NULL;
- AcpiGbl_GlobalLockAcquired = FALSE;
- AcpiGbl_GlobalLockHandle = 0;
- AcpiGbl_GlobalLockPresent = FALSE;
-
- /* Miscellaneous variables */
-
- AcpiGbl_DSDT = NULL;
- AcpiGbl_CmSingleStep = FALSE;
- AcpiGbl_DbTerminateThreads = FALSE;
- AcpiGbl_Shutdown = FALSE;
- AcpiGbl_NsLookupCount = 0;
- AcpiGbl_PsFindCount = 0;
- AcpiGbl_AcpiHardwarePresent = TRUE;
- AcpiGbl_LastOwnerIdIndex = 0;
- AcpiGbl_NextOwnerIdOffset = 0;
- AcpiGbl_TraceMethodName = 0;
- AcpiGbl_TraceDbgLevel = 0;
- AcpiGbl_TraceDbgLayer = 0;
- AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING;
- AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT;
- AcpiGbl_OsiMutex = NULL;
- AcpiGbl_RegMethodsExecuted = FALSE;
-
- /* Hardware oriented */
-
- AcpiGbl_EventsInitialized = FALSE;
- AcpiGbl_SystemAwakeAndRunning = TRUE;
-
- /* Namespace */
-
- AcpiGbl_ModuleCodeList = NULL;
- AcpiGbl_RootNode = NULL;
- AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
- AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
- AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE;
- AcpiGbl_RootNodeStruct.Parent = NULL;
- AcpiGbl_RootNodeStruct.Child = NULL;
- AcpiGbl_RootNodeStruct.Peer = NULL;
- AcpiGbl_RootNodeStruct.Object = NULL;
-
-
-#ifdef ACPI_DISASSEMBLER
- AcpiGbl_ExternalList = NULL;
- AcpiGbl_NumExternalMethods = 0;
- AcpiGbl_ResolvedExternalMethods = 0;
-#endif
-
-#ifdef ACPI_DEBUG_OUTPUT
- AcpiGbl_LowestStackPointer = ACPI_CAST_PTR (ACPI_SIZE, ACPI_SIZE_MAX);
-#endif
-
-#ifdef ACPI_DBG_TRACK_ALLOCATIONS
- AcpiGbl_DisplayFinalMemStats = FALSE;
- AcpiGbl_DisableMemTracking = FALSE;
-#endif
-
- return_ACPI_STATUS (AE_OK);
-}
-
/* Public globals */
ACPI_EXPORT_SYMBOL (AcpiGbl_FADT)
diff --git a/sys/contrib/dev/acpica/components/utilities/uthex.c b/sys/contrib/dev/acpica/components/utilities/uthex.c
new file mode 100644
index 0000000..3486008
--- /dev/null
+++ b/sys/contrib/dev/acpica/components/utilities/uthex.c
@@ -0,0 +1,111 @@
+/******************************************************************************
+ *
+ * Module Name: uthex -- Hex/ASCII support functions
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("uthex")
+
+
+/* Hex to ASCII conversion table */
+
+static char AcpiGbl_HexToAscii[] =
+{
+ '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtHexToAsciiChar
+ *
+ * PARAMETERS: Integer - Contains the hex digit
+ * Position - bit position of the digit within the
+ * integer (multiple of 4)
+ *
+ * RETURN: The converted Ascii character
+ *
+ * DESCRIPTION: Convert a hex digit to an Ascii character
+ *
+ ******************************************************************************/
+
+char
+AcpiUtHexToAsciiChar (
+ UINT64 Integer,
+ UINT32 Position)
+{
+
+ return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtHexCharToValue
+ *
+ * PARAMETERS: AsciiChar - Hex character in Ascii
+ *
+ * RETURN: The binary value of the ascii/hex character
+ *
+ * DESCRIPTION: Perform ascii-to-hex translation
+ *
+ ******************************************************************************/
+
+UINT8
+AcpiUtAsciiCharToHex (
+ int HexChar)
+{
+
+ if (HexChar <= 0x39)
+ {
+ return ((UINT8) (HexChar - 0x30));
+ }
+
+ if (HexChar <= 0x46)
+ {
+ return ((UINT8) (HexChar - 0x37));
+ }
+
+ return ((UINT8) (HexChar - 0x57));
+}
diff --git a/sys/contrib/dev/acpica/components/utilities/utids.c b/sys/contrib/dev/acpica/components/utilities/utids.c
index b001767..7d31429 100644
--- a/sys/contrib/dev/acpica/components/utilities/utids.c
+++ b/sys/contrib/dev/acpica/components/utilities/utids.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __UTIDS_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acinterp.h>
diff --git a/sys/contrib/dev/acpica/components/utilities/utinit.c b/sys/contrib/dev/acpica/components/utilities/utinit.c
index 760d789..fd7fba2 100644
--- a/sys/contrib/dev/acpica/components/utilities/utinit.c
+++ b/sys/contrib/dev/acpica/components/utilities/utinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __UTINIT_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -116,6 +113,162 @@ AcpiUtFreeGpeLists (
#endif /* !ACPI_REDUCED_HARDWARE */
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtInitGlobals
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Initialize ACPICA globals. All globals that require specific
+ * initialization should be initialized here. This allows for
+ * a warm restart.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtInitGlobals (
+ void)
+{
+ ACPI_STATUS Status;
+ UINT32 i;
+
+
+ ACPI_FUNCTION_TRACE (UtInitGlobals);
+
+
+ /* Create all memory caches */
+
+ Status = AcpiUtCreateCaches ();
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Address Range lists */
+
+ for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++)
+ {
+ AcpiGbl_AddressRangeList[i] = NULL;
+ }
+
+ /* Mutex locked flags */
+
+ for (i = 0; i < ACPI_NUM_MUTEX; i++)
+ {
+ AcpiGbl_MutexInfo[i].Mutex = NULL;
+ AcpiGbl_MutexInfo[i].ThreadId = ACPI_MUTEX_NOT_ACQUIRED;
+ AcpiGbl_MutexInfo[i].UseCount = 0;
+ }
+
+ for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++)
+ {
+ AcpiGbl_OwnerIdMask[i] = 0;
+ }
+
+ /* Last OwnerID is never valid */
+
+ AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
+
+ /* Event counters */
+
+ AcpiMethodCount = 0;
+ AcpiSciCount = 0;
+ AcpiGpeCount = 0;
+
+ for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
+ {
+ AcpiFixedEventCount[i] = 0;
+ }
+
+#if (!ACPI_REDUCED_HARDWARE)
+
+ /* GPE/SCI support */
+
+ AcpiGbl_AllGpesInitialized = FALSE;
+ AcpiGbl_GpeXruptListHead = NULL;
+ AcpiGbl_GpeFadtBlocks[0] = NULL;
+ AcpiGbl_GpeFadtBlocks[1] = NULL;
+ AcpiCurrentGpeCount = 0;
+
+ AcpiGbl_GlobalEventHandler = NULL;
+ AcpiGbl_SciHandlerList = NULL;
+
+#endif /* !ACPI_REDUCED_HARDWARE */
+
+ /* Global handlers */
+
+ AcpiGbl_GlobalNotify[0].Handler = NULL;
+ AcpiGbl_GlobalNotify[1].Handler = NULL;
+ AcpiGbl_ExceptionHandler = NULL;
+ AcpiGbl_InitHandler = NULL;
+ AcpiGbl_TableHandler = NULL;
+ AcpiGbl_InterfaceHandler = NULL;
+
+ /* Global Lock support */
+
+ AcpiGbl_GlobalLockSemaphore = NULL;
+ AcpiGbl_GlobalLockMutex = NULL;
+ AcpiGbl_GlobalLockAcquired = FALSE;
+ AcpiGbl_GlobalLockHandle = 0;
+ AcpiGbl_GlobalLockPresent = FALSE;
+
+ /* Miscellaneous variables */
+
+ AcpiGbl_DSDT = NULL;
+ AcpiGbl_CmSingleStep = FALSE;
+ AcpiGbl_Shutdown = FALSE;
+ AcpiGbl_NsLookupCount = 0;
+ AcpiGbl_PsFindCount = 0;
+ AcpiGbl_AcpiHardwarePresent = TRUE;
+ AcpiGbl_LastOwnerIdIndex = 0;
+ AcpiGbl_NextOwnerIdOffset = 0;
+ AcpiGbl_TraceDbgLevel = 0;
+ AcpiGbl_TraceDbgLayer = 0;
+ AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING;
+ AcpiGbl_OsiMutex = NULL;
+ AcpiGbl_RegMethodsExecuted = FALSE;
+
+ /* Hardware oriented */
+
+ AcpiGbl_EventsInitialized = FALSE;
+ AcpiGbl_SystemAwakeAndRunning = TRUE;
+
+ /* Namespace */
+
+ AcpiGbl_ModuleCodeList = NULL;
+ AcpiGbl_RootNode = NULL;
+ AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
+ AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
+ AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE;
+ AcpiGbl_RootNodeStruct.Parent = NULL;
+ AcpiGbl_RootNodeStruct.Child = NULL;
+ AcpiGbl_RootNodeStruct.Peer = NULL;
+ AcpiGbl_RootNodeStruct.Object = NULL;
+
+
+#ifdef ACPI_DISASSEMBLER
+ AcpiGbl_ExternalList = NULL;
+ AcpiGbl_NumExternalMethods = 0;
+ AcpiGbl_ResolvedExternalMethods = 0;
+#endif
+
+#ifdef ACPI_DEBUG_OUTPUT
+ AcpiGbl_LowestStackPointer = ACPI_CAST_PTR (ACPI_SIZE, ACPI_SIZE_MAX);
+#endif
+
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+ AcpiGbl_DisplayFinalMemStats = FALSE;
+ AcpiGbl_DisableMemTracking = FALSE;
+#endif
+
+ ACPI_DEBUGGER_EXEC (AcpiGbl_DbTerminateThreads = FALSE);
+
+ return_ACPI_STATUS (AE_OK);
+}
+
+
/******************************************************************************
*
* FUNCTION: AcpiUtTerminate
diff --git a/sys/contrib/dev/acpica/components/utilities/utlock.c b/sys/contrib/dev/acpica/components/utilities/utlock.c
index da933c2..3903e99 100644
--- a/sys/contrib/dev/acpica/components/utilities/utlock.c
+++ b/sys/contrib/dev/acpica/components/utilities/utlock.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __UTLOCK_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/utilities/utmath.c b/sys/contrib/dev/acpica/components/utilities/utmath.c
index b535ffc..ce11f39 100644
--- a/sys/contrib/dev/acpica/components/utilities/utmath.c
+++ b/sys/contrib/dev/acpica/components/utilities/utmath.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __UTMATH_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/utilities/utmisc.c b/sys/contrib/dev/acpica/components/utilities/utmisc.c
index 6ff6b2a..d5d81ca 100644
--- a/sys/contrib/dev/acpica/components/utilities/utmisc.c
+++ b/sys/contrib/dev/acpica/components/utilities/utmisc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __UTMISC_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
diff --git a/sys/contrib/dev/acpica/components/utilities/utmutex.c b/sys/contrib/dev/acpica/components/utilities/utmutex.c
index 260f2b5..c7b162b 100644
--- a/sys/contrib/dev/acpica/components/utilities/utmutex.c
+++ b/sys/contrib/dev/acpica/components/utilities/utmutex.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __UTMUTEX_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/utilities/utobject.c b/sys/contrib/dev/acpica/components/utilities/utobject.c
index 46c3514..4c80c40 100644
--- a/sys/contrib/dev/acpica/components/utilities/utobject.c
+++ b/sys/contrib/dev/acpica/components/utilities/utobject.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __UTOBJECT_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -400,7 +398,7 @@ AcpiUtValidInternalObject (
default:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "%p is not not an ACPI operand obj [%s]\n",
+ "%p is not an ACPI operand obj [%s]\n",
Object, AcpiUtGetDescriptorName (Object)));
break;
}
diff --git a/sys/contrib/dev/acpica/components/utilities/utosi.c b/sys/contrib/dev/acpica/components/utilities/utosi.c
index 9cf5765..6b225ca 100644
--- a/sys/contrib/dev/acpica/components/utilities/utosi.c
+++ b/sys/contrib/dev/acpica/components/utilities/utosi.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __UTOSI_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -50,6 +48,34 @@
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utosi")
+
+/******************************************************************************
+ *
+ * ACPICA policy for new _OSI strings:
+ *
+ * It is the stated policy of ACPICA that new _OSI strings will be integrated
+ * into this module as soon as possible after they are defined. It is strongly
+ * recommended that all ACPICA hosts mirror this policy and integrate any
+ * changes to this module as soon as possible. There are several historical
+ * reasons behind this policy:
+ *
+ * 1) New BIOSs tend to test only the case where the host responds TRUE to
+ * the latest version of Windows, which would respond to the latest/newest
+ * _OSI string. Not responding TRUE to the latest version of Windows will
+ * risk executing untested code paths throughout the DSDT and SSDTs.
+ *
+ * 2) If a new _OSI string is recognized only after a significant delay, this
+ * has the potential to cause problems on existing working machines because
+ * of the possibility that a new and different path through the ASL code
+ * will be executed.
+ *
+ * 3) New _OSI strings are tending to come out about once per year. A delay
+ * in recognizing a new string for a significant amount of time risks the
+ * release of another string which only compounds the initial problem.
+ *
+ *****************************************************************************/
+
+
/*
* Strings supported by the _OSI predefined control method (which is
* implemented internally within this module.)
@@ -78,6 +104,7 @@ static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[] =
{"Windows 2006 SP2", NULL, 0, ACPI_OSI_WIN_VISTA_SP2}, /* Windows Vista SP2 - Added 09/2010 */
{"Windows 2009", NULL, 0, ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */
{"Windows 2012", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8 and Server 2012 - Added 08/2012 */
+ {"Windows 2013", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8.1 and Server 2012 R2 - Added 01/2014 */
/* Feature Group Strings */
diff --git a/sys/contrib/dev/acpica/components/utilities/utownerid.c b/sys/contrib/dev/acpica/components/utilities/utownerid.c
index 74f4d83..34c0024 100644
--- a/sys/contrib/dev/acpica/components/utilities/utownerid.c
+++ b/sys/contrib/dev/acpica/components/utilities/utownerid.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __UTOWNERID_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
diff --git a/sys/contrib/dev/acpica/components/utilities/utpredef.c b/sys/contrib/dev/acpica/components/utilities/utpredef.c
index 8864120..a445f85 100644
--- a/sys/contrib/dev/acpica/components/utilities/utpredef.c
+++ b/sys/contrib/dev/acpica/components/utilities/utpredef.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __UTPREDEF_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acpredef.h>
diff --git a/sys/contrib/dev/acpica/components/utilities/utprint.c b/sys/contrib/dev/acpica/components/utilities/utprint.c
new file mode 100644
index 0000000..d870ad4
--- /dev/null
+++ b/sys/contrib/dev/acpica/components/utilities/utprint.c
@@ -0,0 +1,811 @@
+/******************************************************************************
+ *
+ * Module Name: utprint - Formatted printing routines
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+
+#define _COMPONENT ACPI_UTILITIES
+ ACPI_MODULE_NAME ("utprint")
+
+
+#define ACPI_FORMAT_SIGN 0x01
+#define ACPI_FORMAT_SIGN_PLUS 0x02
+#define ACPI_FORMAT_SIGN_PLUS_SPACE 0x04
+#define ACPI_FORMAT_ZERO 0x08
+#define ACPI_FORMAT_LEFT 0x10
+#define ACPI_FORMAT_UPPER 0x20
+#define ACPI_FORMAT_PREFIX 0x40
+
+
+/* Local prototypes */
+
+static ACPI_SIZE
+AcpiUtBoundStringLength (
+ const char *String,
+ ACPI_SIZE Count);
+
+static char *
+AcpiUtBoundStringOutput (
+ char *String,
+ const char *End,
+ char c);
+
+static char *
+AcpiUtFormatNumber (
+ char *String,
+ char *End,
+ UINT64 Number,
+ UINT8 Base,
+ INT32 Width,
+ INT32 Precision,
+ UINT8 Type);
+
+static char *
+AcpiUtPutNumber (
+ char *String,
+ UINT64 Number,
+ UINT8 Base,
+ BOOLEAN Upper);
+
+
+/* Module globals */
+
+static const char AcpiGbl_LowerHexDigits[] = "0123456789abcdef";
+static const char AcpiGbl_UpperHexDigits[] = "0123456789ABCDEF";
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtBoundStringLength
+ *
+ * PARAMETERS: String - String with boundary
+ * Count - Boundary of the string
+ *
+ * RETURN: Length of the string. Less than or equal to Count.
+ *
+ * DESCRIPTION: Calculate the length of a string with boundary.
+ *
+ ******************************************************************************/
+
+static ACPI_SIZE
+AcpiUtBoundStringLength (
+ const char *String,
+ ACPI_SIZE Count)
+{
+ UINT32 Length = 0;
+
+
+ while (*String && Count)
+ {
+ Length++;
+ String++;
+ Count--;
+ }
+
+ return (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtBoundStringOutput
+ *
+ * PARAMETERS: String - String with boundary
+ * End - Boundary of the string
+ * c - Character to be output to the string
+ *
+ * RETURN: Updated position for next valid character
+ *
+ * DESCRIPTION: Output a character into a string with boundary check.
+ *
+ ******************************************************************************/
+
+static char *
+AcpiUtBoundStringOutput (
+ char *String,
+ const char *End,
+ char c)
+{
+
+ if (String < End)
+ {
+ *String = c;
+ }
+
+ ++String;
+ return (String);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtPutNumber
+ *
+ * PARAMETERS: String - Buffer to hold reverse-ordered string
+ * Number - Integer to be converted
+ * Base - Base of the integer
+ * Upper - Whether or not using upper cased digits
+ *
+ * RETURN: Updated position for next valid character
+ *
+ * DESCRIPTION: Convert an integer into a string, note that, the string holds a
+ * reversed ordered number without the trailing zero.
+ *
+ ******************************************************************************/
+
+static char *
+AcpiUtPutNumber (
+ char *String,
+ UINT64 Number,
+ UINT8 Base,
+ BOOLEAN Upper)
+{
+ const char *Digits;
+ UINT64 DigitIndex;
+ char *Pos;
+
+
+ Pos = String;
+ Digits = Upper ? AcpiGbl_UpperHexDigits : AcpiGbl_LowerHexDigits;
+
+ if (Number == 0)
+ {
+ *(Pos++) = '0';
+ }
+ else
+ {
+ while (Number)
+ {
+ (void) AcpiUtDivide (Number, Base, &Number, &DigitIndex);
+ *(Pos++) = Digits[DigitIndex];
+ }
+ }
+
+ /* *(Pos++) = '0'; */
+ return (Pos);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtScanNumber
+ *
+ * PARAMETERS: String - String buffer
+ * NumberPtr - Where the number is returned
+ *
+ * RETURN: Updated position for next valid character
+ *
+ * DESCRIPTION: Scan a string for a decimal integer.
+ *
+ ******************************************************************************/
+
+const char *
+AcpiUtScanNumber (
+ const char *String,
+ UINT64 *NumberPtr)
+{
+ UINT64 Number = 0;
+
+
+ while (ACPI_IS_DIGIT (*String))
+ {
+ Number *= 10;
+ Number += *(String++) - '0';
+ }
+
+ *NumberPtr = Number;
+ return (String);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtPrintNumber
+ *
+ * PARAMETERS: String - String buffer
+ * Number - The number to be converted
+ *
+ * RETURN: Updated position for next valid character
+ *
+ * DESCRIPTION: Print a decimal integer into a string.
+ *
+ ******************************************************************************/
+
+const char *
+AcpiUtPrintNumber (
+ char *String,
+ UINT64 Number)
+{
+ char AsciiString[20];
+ const char *Pos1;
+ char *Pos2;
+
+
+ Pos1 = AcpiUtPutNumber (AsciiString, Number, 10, FALSE);
+ Pos2 = String;
+
+ while (Pos1 != AsciiString)
+ {
+ *(Pos2++) = *(--Pos1);
+ }
+
+ *Pos2 = 0;
+ return (String);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtFormatNumber
+ *
+ * PARAMETERS: String - String buffer with boundary
+ * End - Boundary of the string
+ * Number - The number to be converted
+ * Base - Base of the integer
+ * Width - Field width
+ * Precision - Precision of the integer
+ * Type - Special printing flags
+ *
+ * RETURN: Updated position for next valid character
+ *
+ * DESCRIPTION: Print an integer into a string with any base and any precision.
+ *
+ ******************************************************************************/
+
+static char *
+AcpiUtFormatNumber (
+ char *String,
+ char *End,
+ UINT64 Number,
+ UINT8 Base,
+ INT32 Width,
+ INT32 Precision,
+ UINT8 Type)
+{
+ char *Pos;
+ char Sign;
+ char Zero;
+ BOOLEAN NeedPrefix;
+ BOOLEAN Upper;
+ INT32 i;
+ char ReversedString[66];
+
+
+ /* Parameter validation */
+
+ if (Base < 2 || Base > 16)
+ {
+ return (NULL);
+ }
+
+ if (Type & ACPI_FORMAT_LEFT)
+ {
+ Type &= ~ACPI_FORMAT_ZERO;
+ }
+
+ NeedPrefix = ((Type & ACPI_FORMAT_PREFIX) && Base != 10) ? TRUE : FALSE;
+ Upper = (Type & ACPI_FORMAT_UPPER) ? TRUE : FALSE;
+ Zero = (Type & ACPI_FORMAT_ZERO) ? '0' : ' ';
+
+ /* Calculate size according to sign and prefix */
+
+ Sign = '\0';
+ if (Type & ACPI_FORMAT_SIGN)
+ {
+ if ((INT64) Number < 0)
+ {
+ Sign = '-';
+ Number = - (INT64) Number;
+ Width--;
+ }
+ else if (Type & ACPI_FORMAT_SIGN_PLUS)
+ {
+ Sign = '+';
+ Width--;
+ }
+ else if (Type & ACPI_FORMAT_SIGN_PLUS_SPACE)
+ {
+ Sign = ' ';
+ Width--;
+ }
+ }
+ if (NeedPrefix)
+ {
+ Width--;
+ if (Base == 16)
+ {
+ Width--;
+ }
+ }
+
+ /* Generate full string in reverse order */
+
+ Pos = AcpiUtPutNumber (ReversedString, Number, Base, Upper);
+ i = ACPI_PTR_DIFF (Pos, ReversedString);
+
+ /* Printing 100 using %2d gives "100", not "00" */
+
+ if (i > Precision)
+ {
+ Precision = i;
+ }
+
+ Width -= Precision;
+
+ /* Output the string */
+
+ if (!(Type & (ACPI_FORMAT_ZERO | ACPI_FORMAT_LEFT)))
+ {
+ while (--Width >= 0)
+ {
+ String = AcpiUtBoundStringOutput (String, End, ' ');
+ }
+ }
+ if (Sign)
+ {
+ String = AcpiUtBoundStringOutput (String, End, Sign);
+ }
+ if (NeedPrefix)
+ {
+ String = AcpiUtBoundStringOutput (String, End, '0');
+ if (Base == 16)
+ {
+ String = AcpiUtBoundStringOutput (String, End,
+ Upper ? 'X' : 'x');
+ }
+ }
+ if (!(Type & ACPI_FORMAT_LEFT))
+ {
+ while (--Width >= 0)
+ {
+ String = AcpiUtBoundStringOutput (String, End, Zero);
+ }
+ }
+
+ while (i <= --Precision)
+ {
+ String = AcpiUtBoundStringOutput (String, End, '0');
+ }
+ while (--i >= 0)
+ {
+ String = AcpiUtBoundStringOutput (String, End,
+ ReversedString[i]);
+ }
+ while (--Width >= 0)
+ {
+ String = AcpiUtBoundStringOutput (String, End, ' ');
+ }
+
+ return (String);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtVsnprintf
+ *
+ * PARAMETERS: String - String with boundary
+ * Size - Boundary of the string
+ * Format - Standard printf format
+ * Args - Argument list
+ *
+ * RETURN: Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to a string using argument list pointer.
+ *
+ ******************************************************************************/
+
+int
+AcpiUtVsnprintf (
+ char *String,
+ ACPI_SIZE Size,
+ const char *Format,
+ va_list Args)
+{
+ UINT8 Base = 10;
+ UINT8 Type = 0;
+ INT32 Width = -1;
+ INT32 Precision = -1;
+ char Qualifier = 0;
+ UINT64 Number;
+ char *Pos;
+ char *End;
+ char c;
+ const char *s;
+ const void *p;
+ INT32 Length;
+ int i;
+
+
+ Pos = String;
+ End = String + Size;
+
+ for (; *Format; ++Format)
+ {
+ if (*Format != '%')
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, *Format);
+ continue;
+ }
+
+ /* Process sign */
+
+ do
+ {
+ ++Format;
+ if (*Format == '#')
+ {
+ Type |= ACPI_FORMAT_PREFIX;
+ }
+ else if (*Format == '0')
+ {
+ Type |= ACPI_FORMAT_ZERO;
+ }
+ else if (*Format == '+')
+ {
+ Type |= ACPI_FORMAT_SIGN_PLUS;
+ }
+ else if (*Format == ' ')
+ {
+ Type |= ACPI_FORMAT_SIGN_PLUS_SPACE;
+ }
+ else if (*Format == '-')
+ {
+ Type |= ACPI_FORMAT_LEFT;
+ }
+ else
+ {
+ break;
+ }
+ } while (1);
+
+ /* Process width */
+
+ Width = -1;
+ if (ACPI_IS_DIGIT (*Format))
+ {
+ Format = AcpiUtScanNumber (Format, &Number);
+ Width = (INT32) Number;
+ }
+ else if (*Format == '*')
+ {
+ ++Format;
+ Width = va_arg (Args, int);
+ if (Width < 0)
+ {
+ Width = -Width;
+ Type |= ACPI_FORMAT_LEFT;
+ }
+ }
+
+ /* Process precision */
+
+ Precision = -1;
+ if (*Format == '.')
+ {
+ ++Format;
+ if (ACPI_IS_DIGIT(*Format))
+ {
+ Format = AcpiUtScanNumber (Format, &Number);
+ Precision = (INT32) Number;
+ }
+ else if (*Format == '*')
+ {
+ ++Format;
+ Precision = va_arg (Args, int);
+ }
+ if (Precision < 0)
+ {
+ Precision = 0;
+ }
+ }
+
+ /* Process qualifier */
+
+ Qualifier = -1;
+ if (*Format == 'h' || *Format == 'l' || *Format == 'L')
+ {
+ Qualifier = *Format;
+ ++Format;
+
+ if (Qualifier == 'l' && *Format == 'l')
+ {
+ Qualifier = 'L';
+ ++Format;
+ }
+ }
+
+ switch (*Format)
+ {
+ case '%':
+
+ Pos = AcpiUtBoundStringOutput (Pos, End, '%');
+ continue;
+
+ case 'c':
+
+ if (!(Type & ACPI_FORMAT_LEFT))
+ {
+ while (--Width > 0)
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
+ }
+ }
+
+ c = (char) va_arg (Args, int);
+ Pos = AcpiUtBoundStringOutput (Pos, End, c);
+
+ while (--Width > 0)
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
+ }
+ continue;
+
+ case 's':
+
+ s = va_arg (Args, char *);
+ if (!s)
+ {
+ s = "<NULL>";
+ }
+ Length = AcpiUtBoundStringLength (s, Precision);
+ if (!(Type & ACPI_FORMAT_LEFT))
+ {
+ while (Length < Width--)
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
+ }
+ }
+ for (i = 0; i < Length; ++i)
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, *s);
+ ++s;
+ }
+ while (Length < Width--)
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
+ }
+ continue;
+
+ case 'o':
+
+ Base = 8;
+ break;
+
+ case 'X':
+
+ Type |= ACPI_FORMAT_UPPER;
+
+ case 'x':
+
+ Base = 16;
+ break;
+
+ case 'd':
+ case 'i':
+
+ Type |= ACPI_FORMAT_SIGN;
+
+ case 'u':
+
+ break;
+
+ case 'p':
+
+ if (Width == -1)
+ {
+ Width = 2 * sizeof (void *);
+ Type |= ACPI_FORMAT_ZERO;
+ }
+
+ p = va_arg (Args, void *);
+ Pos = AcpiUtFormatNumber (Pos, End,
+ ACPI_TO_INTEGER (p), 16, Width, Precision, Type);
+ continue;
+
+ default:
+
+ Pos = AcpiUtBoundStringOutput (Pos, End, '%');
+ if (*Format)
+ {
+ Pos = AcpiUtBoundStringOutput (Pos, End, *Format);
+ }
+ else
+ {
+ --Format;
+ }
+ continue;
+ }
+
+ if (Qualifier == 'L')
+ {
+ Number = va_arg (Args, UINT64);
+ if (Type & ACPI_FORMAT_SIGN)
+ {
+ Number = (INT64) Number;
+ }
+ }
+ else if (Qualifier == 'l')
+ {
+ Number = va_arg (Args, unsigned long);
+ if (Type & ACPI_FORMAT_SIGN)
+ {
+ Number = (INT32) Number;
+ }
+ }
+ else if (Qualifier == 'h')
+ {
+ Number = (UINT16) va_arg (Args, int);
+ if (Type & ACPI_FORMAT_SIGN)
+ {
+ Number = (INT16) Number;
+ }
+ }
+ else
+ {
+ Number = va_arg (Args, unsigned int);
+ if (Type & ACPI_FORMAT_SIGN)
+ {
+ Number = (signed int) Number;
+ }
+ }
+
+ Pos = AcpiUtFormatNumber (Pos, End, Number, Base,
+ Width, Precision, Type);
+ }
+
+ if (Size > 0)
+ {
+ if (Pos < End)
+ {
+ *Pos = '\0';
+ }
+ else
+ {
+ End[-1] = '\0';
+ }
+ }
+
+ return (ACPI_PTR_DIFF (Pos, String));
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtSnprintf
+ *
+ * PARAMETERS: String - String with boundary
+ * Size - Boundary of the string
+ * Format, ... - Standard printf format
+ *
+ * RETURN: Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to a string.
+ *
+ ******************************************************************************/
+
+int
+AcpiUtSnprintf (
+ char *String,
+ ACPI_SIZE Size,
+ const char *Format,
+ ...)
+{
+ va_list Args;
+ int Length;
+
+
+ va_start (Args, Format);
+ Length = AcpiUtVsnprintf (String, Size, Format, Args);
+ va_end (Args);
+
+ return (Length);
+}
+
+
+#ifdef ACPI_APPLICATION
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtFileVprintf
+ *
+ * PARAMETERS: File - File descriptor
+ * Format - Standard printf format
+ * Args - Argument list
+ *
+ * RETURN: Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to a file using argument list pointer.
+ *
+ ******************************************************************************/
+
+int
+AcpiUtFileVprintf (
+ ACPI_FILE File,
+ const char *Format,
+ va_list Args)
+{
+ ACPI_CPU_FLAGS Flags;
+ int Length;
+
+
+ Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock);
+ Length = AcpiUtVsnprintf (AcpiGbl_PrintBuffer,
+ sizeof (AcpiGbl_PrintBuffer), Format, Args);
+
+ (void) AcpiOsWriteFile (File, AcpiGbl_PrintBuffer, Length, 1);
+ AcpiOsReleaseLock (AcpiGbl_PrintLock, Flags);
+
+ return (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtFilePrintf
+ *
+ * PARAMETERS: File - File descriptor
+ * Format, ... - Standard printf format
+ *
+ * RETURN: Number of bytes actually written.
+ *
+ * DESCRIPTION: Formatted output to a file.
+ *
+ ******************************************************************************/
+
+int
+AcpiUtFilePrintf (
+ ACPI_FILE File,
+ const char *Format,
+ ...)
+{
+ va_list Args;
+ int Length;
+
+
+ va_start (Args, Format);
+ Length = AcpiUtFileVprintf (File, Format, Args);
+ va_end (Args);
+
+ return (Length);
+}
+#endif
diff --git a/sys/contrib/dev/acpica/components/utilities/utresrc.c b/sys/contrib/dev/acpica/components/utilities/utresrc.c
index 3a47a0c..65b23f1 100644
--- a/sys/contrib/dev/acpica/components/utilities/utresrc.c
+++ b/sys/contrib/dev/acpica/components/utilities/utresrc.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __UTRESRC_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acresrc.h>
@@ -53,7 +50,7 @@
ACPI_MODULE_NAME ("utresrc")
-#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
+#if defined(ACPI_DEBUG_OUTPUT) || defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
/*
* Strings used to decode resource descriptors.
@@ -100,7 +97,9 @@ const char *AcpiGbl_IoDecode[] =
const char *AcpiGbl_LlDecode[] =
{
"ActiveHigh",
- "ActiveLow"
+ "ActiveLow",
+ "ActiveBoth",
+ "Reserved"
};
const char *AcpiGbl_MaxDecode[] =
@@ -299,7 +298,7 @@ const char *AcpiGbl_BpbDecode[] =
const char *AcpiGbl_SbDecode[] =
{
- "StopBitsNone",
+ "StopBitsZero",
"StopBitsOne",
"StopBitsOnePlusHalf",
"StopBitsTwo"
diff --git a/sys/contrib/dev/acpica/components/utilities/utstate.c b/sys/contrib/dev/acpica/components/utilities/utstate.c
index e0e5cce..d90d694 100644
--- a/sys/contrib/dev/acpica/components/utilities/utstate.c
+++ b/sys/contrib/dev/acpica/components/utilities/utstate.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __UTSTATE_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/utilities/utstring.c b/sys/contrib/dev/acpica/components/utilities/utstring.c
index 79b5452..4cbf435 100644
--- a/sys/contrib/dev/acpica/components/utilities/utstring.c
+++ b/sys/contrib/dev/acpica/components/utilities/utstring.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __UTSTRING_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -420,7 +417,7 @@ AcpiUtPrintString (
}
AcpiOsPrintf ("\"");
- for (i = 0; String[i] && (i < MaxLength); i++)
+ for (i = 0; (i < MaxLength) && String[i]; i++)
{
/* Escape sequences */
@@ -685,3 +682,81 @@ UtConvertBackslashes (
}
}
#endif
+
+#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtSafeStrcpy, AcpiUtSafeStrcat, AcpiUtSafeStrncat
+ *
+ * PARAMETERS: Adds a "DestSize" parameter to each of the standard string
+ * functions. This is the size of the Destination buffer.
+ *
+ * RETURN: TRUE if the operation would overflow the destination buffer.
+ *
+ * DESCRIPTION: Safe versions of standard Clib string functions. Ensure that
+ * the result of the operation will not overflow the output string
+ * buffer.
+ *
+ * NOTE: These functions are typically only helpful for processing
+ * user input and command lines. For most ACPICA code, the
+ * required buffer length is precisely calculated before buffer
+ * allocation, so the use of these functions is unnecessary.
+ *
+ ******************************************************************************/
+
+BOOLEAN
+AcpiUtSafeStrcpy (
+ char *Dest,
+ ACPI_SIZE DestSize,
+ char *Source)
+{
+
+ if (ACPI_STRLEN (Source) >= DestSize)
+ {
+ return (TRUE);
+ }
+
+ ACPI_STRCPY (Dest, Source);
+ return (FALSE);
+}
+
+BOOLEAN
+AcpiUtSafeStrcat (
+ char *Dest,
+ ACPI_SIZE DestSize,
+ char *Source)
+{
+
+ if ((ACPI_STRLEN (Dest) + ACPI_STRLEN (Source)) >= DestSize)
+ {
+ return (TRUE);
+ }
+
+ ACPI_STRCAT (Dest, Source);
+ return (FALSE);
+}
+
+#ifndef _KERNEL
+BOOLEAN
+AcpiUtSafeStrncat (
+ char *Dest,
+ ACPI_SIZE DestSize,
+ char *Source,
+ ACPI_SIZE MaxTransferLength)
+{
+ ACPI_SIZE ActualTransferLength;
+
+
+ ActualTransferLength = ACPI_MIN (MaxTransferLength, ACPI_STRLEN (Source));
+
+ if ((ACPI_STRLEN (Dest) + ActualTransferLength) >= DestSize)
+ {
+ return (TRUE);
+ }
+
+ ACPI_STRNCAT (Dest, Source, MaxTransferLength);
+ return (FALSE);
+}
+#endif
+
+#endif
diff --git a/sys/contrib/dev/acpica/components/utilities/uttrack.c b/sys/contrib/dev/acpica/components/utilities/uttrack.c
index 5c381f0..5f208b5 100644
--- a/sys/contrib/dev/acpica/components/utilities/uttrack.c
+++ b/sys/contrib/dev/acpica/components/utilities/uttrack.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -52,8 +52,6 @@
* occurs in the body of AcpiUtFree.
*/
-#define __UTTRACK_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -151,10 +149,23 @@ AcpiUtAllocateAndTrack (
ACPI_STATUS Status;
- Allocation = AcpiUtAllocate (Size + sizeof (ACPI_DEBUG_MEM_HEADER),
- Component, Module, Line);
+ /* Check for an inadvertent size of zero bytes */
+
+ if (!Size)
+ {
+ ACPI_WARNING ((Module, Line,
+ "Attempt to allocate zero bytes, allocating 1 byte"));
+ Size = 1;
+ }
+
+ Allocation = AcpiOsAllocate (Size + sizeof (ACPI_DEBUG_MEM_HEADER));
if (!Allocation)
{
+ /* Report allocation error */
+
+ ACPI_WARNING ((Module, Line,
+ "Could not allocate size %u", (UINT32) Size));
+
return (NULL);
}
@@ -204,8 +215,16 @@ AcpiUtAllocateZeroedAndTrack (
ACPI_STATUS Status;
- Allocation = AcpiUtAllocateZeroed (Size + sizeof (ACPI_DEBUG_MEM_HEADER),
- Component, Module, Line);
+ /* Check for an inadvertent size of zero bytes */
+
+ if (!Size)
+ {
+ ACPI_WARNING ((Module, Line,
+ "Attempt to allocate zero bytes, allocating 1 byte"));
+ Size = 1;
+ }
+
+ Allocation = AcpiOsAllocateZeroed (Size + sizeof (ACPI_DEBUG_MEM_HEADER));
if (!Allocation)
{
/* Report allocation error */
@@ -286,7 +305,8 @@ AcpiUtFreeAndTrack (
}
AcpiOsFree (DebugBlock);
- ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p freed\n", Allocation));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p freed (block %p)\n",
+ Allocation, DebugBlock));
return_VOID;
}
diff --git a/sys/contrib/dev/acpica/components/utilities/utuuid.c b/sys/contrib/dev/acpica/components/utilities/utuuid.c
new file mode 100644
index 0000000..8b3cb99
--- /dev/null
+++ b/sys/contrib/dev/acpica/components/utilities/utuuid.c
@@ -0,0 +1,101 @@
+/******************************************************************************
+ *
+ * Module Name: utuuid -- UUID support functions
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/include/accommon.h>
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("utuuid")
+
+
+/*
+ * UUID support functions.
+ *
+ * This table is used to convert an input UUID ascii string to a 16 byte
+ * buffer and the reverse. The table maps a UUID buffer index 0-15 to
+ * the index within the 36-byte UUID string where the associated 2-byte
+ * hex value can be found.
+ *
+ * 36-byte UUID strings are of the form:
+ * aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
+ * Where aa-pp are one byte hex numbers, made up of two hex digits
+ *
+ * Note: This table is basically the inverse of the string-to-offset table
+ * found in the ACPI spec in the description of the ToUUID macro.
+ */
+const UINT8 AcpiGbl_MapToUuidOffset[UUID_BUFFER_LENGTH] =
+{
+ 6,4,2,0,11,9,16,14,19,21,24,26,28,30,32,34
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtConvertStringToUuid
+ *
+ * PARAMETERS: InString - 36-byte formatted UUID string
+ * UuidBuffer - Where the 16-byte UUID buffer is returned
+ *
+ * RETURN: None. Output data is returned in the UuidBuffer
+ *
+ * DESCRIPTION: Convert a 36-byte formatted UUID string to 16-byte UUID buffer
+ *
+ ******************************************************************************/
+
+void
+AcpiUtConvertStringToUuid (
+ char *InString,
+ UINT8 *UuidBuffer)
+{
+ UINT32 i;
+
+
+ for (i = 0; i < UUID_BUFFER_LENGTH; i++)
+ {
+ UuidBuffer[i] =
+ (AcpiUtAsciiCharToHex (InString[AcpiGbl_MapToUuidOffset[i]]) << 4);
+
+ UuidBuffer[i] |=
+ AcpiUtAsciiCharToHex (InString[AcpiGbl_MapToUuidOffset[i] + 1]);
+ }
+}
diff --git a/sys/contrib/dev/acpica/components/utilities/utxface.c b/sys/contrib/dev/acpica/components/utilities/utxface.c
index b6003e6..aab7473 100644
--- a/sys/contrib/dev/acpica/components/utilities/utxface.c
+++ b/sys/contrib/dev/acpica/components/utilities/utxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __UTXFACE_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -114,7 +113,7 @@ AcpiTerminate (
return_ACPI_STATUS (Status);
}
-ACPI_EXPORT_SYMBOL (AcpiTerminate)
+ACPI_EXPORT_SYMBOL_INIT (AcpiTerminate)
#ifndef ACPI_ASL_COMPILER
@@ -621,7 +620,9 @@ AcpiDecodePldBuffer (
ACPI_MOVE_32_TO_32 (&Dword, &Buffer[0]);
PldInfo->Revision = ACPI_PLD_GET_REVISION (&Dword);
PldInfo->IgnoreColor = ACPI_PLD_GET_IGNORE_COLOR (&Dword);
- PldInfo->Color = ACPI_PLD_GET_COLOR (&Dword);
+ PldInfo->Red = ACPI_PLD_GET_RED (&Dword);
+ PldInfo->Green = ACPI_PLD_GET_GREEN (&Dword);
+ PldInfo->Blue = ACPI_PLD_GET_BLUE (&Dword);
/* Second 32-bit DWord */
diff --git a/sys/contrib/dev/acpica/components/utilities/utxferror.c b/sys/contrib/dev/acpica/components/utilities/utxferror.c
index 8f11b29..89fc516 100644
--- a/sys/contrib/dev/acpica/components/utilities/utxferror.c
+++ b/sys/contrib/dev/acpica/components/utilities/utxferror.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __UTXFERROR_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -55,6 +55,8 @@
* tools/applications.
*/
+#ifndef ACPI_NO_ERROR_MESSAGES /* Entire module */
+
/*******************************************************************************
*
* FUNCTION: AcpiError
@@ -294,3 +296,5 @@ AcpiBiosWarning (
}
ACPI_EXPORT_SYMBOL (AcpiBiosWarning)
+
+#endif /* ACPI_NO_ERROR_MESSAGES */
diff --git a/sys/contrib/dev/acpica/components/utilities/utxfinit.c b/sys/contrib/dev/acpica/components/utilities/utxfinit.c
index c828a71..36107ca 100644
--- a/sys/contrib/dev/acpica/components/utilities/utxfinit.c
+++ b/sys/contrib/dev/acpica/components/utilities/utxfinit.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
-#define __UTXFINIT_C__
+#define EXPORT_ACPI_INTERFACES
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -54,6 +53,11 @@
#define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME ("utxfinit")
+/* For AcpiExec only */
+void
+AeDoObjectOverrides (
+ void);
+
/*******************************************************************************
*
@@ -130,11 +134,19 @@ AcpiInitializeSubsystem (
/* If configured, initialize the AML debugger */
- ACPI_DEBUGGER_EXEC (Status = AcpiDbInitialize ());
- return_ACPI_STATUS (Status);
+#ifdef ACPI_DEBUGGER
+ Status = AcpiDbInitialize ();
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "During Debugger initialization"));
+ return_ACPI_STATUS (Status);
+ }
+#endif
+
+ return_ACPI_STATUS (AE_OK);
}
-ACPI_EXPORT_SYMBOL (AcpiInitializeSubsystem)
+ACPI_EXPORT_SYMBOL_INIT (AcpiInitializeSubsystem)
/*******************************************************************************
@@ -256,7 +268,7 @@ AcpiEnableSubsystem (
return_ACPI_STATUS (Status);
}
-ACPI_EXPORT_SYMBOL (AcpiEnableSubsystem)
+ACPI_EXPORT_SYMBOL_INIT (AcpiEnableSubsystem)
/*******************************************************************************
@@ -301,6 +313,14 @@ AcpiInitializeObjects (
}
}
+#ifdef ACPI_EXEC_APP
+ /*
+ * This call implements the "initialization file" option for AcpiExec.
+ * This is the precise point that we want to perform the overrides.
+ */
+ AeDoObjectOverrides ();
+#endif
+
/*
* Execute any module-level code that was detected during the table load
* phase. Although illegal since ACPI 2.0, there are many machines that
@@ -355,4 +375,4 @@ AcpiInitializeObjects (
return_ACPI_STATUS (Status);
}
-ACPI_EXPORT_SYMBOL (AcpiInitializeObjects)
+ACPI_EXPORT_SYMBOL_INIT (AcpiInitializeObjects)
diff --git a/sys/contrib/dev/acpica/components/utilities/utxfmutex.c b/sys/contrib/dev/acpica/components/utilities/utxfmutex.c
index ae5a345..559f4b4 100644
--- a/sys/contrib/dev/acpica/components/utilities/utxfmutex.c
+++ b/sys/contrib/dev/acpica/components/utilities/utxfmutex.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __UTXFMUTEX_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
diff --git a/sys/contrib/dev/acpica/include/acapps.h b/sys/contrib/dev/acpica/include/acapps.h
index fc95423..7c4880a 100644
--- a/sys/contrib/dev/acpica/include/acapps.h
+++ b/sys/contrib/dev/acpica/include/acapps.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -52,7 +52,7 @@
/* Common info for tool signons */
#define ACPICA_NAME "Intel ACPI Component Architecture"
-#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2013 Intel Corporation"
+#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2015 Intel Corporation"
#if ACPI_MACHINE_WIDTH == 64
#define ACPI_WIDTH "-64"
@@ -84,10 +84,13 @@
/* Macros for usage messages */
#define ACPI_USAGE_HEADER(Usage) \
- printf ("Usage: %s\nOptions:\n", Usage);
+ AcpiOsPrintf ("Usage: %s\nOptions:\n", Usage);
+
+#define ACPI_USAGE_TEXT(Description) \
+ AcpiOsPrintf (Description);
#define ACPI_OPTION(Name, Description) \
- printf (" %-18s%s\n", Name, Description);
+ AcpiOsPrintf (" %-18s%s\n", Name, Description);
#define FILE_SUFFIX_DISASSEMBLY "dsl"
@@ -114,6 +117,14 @@ extern int AcpiGbl_SubOptChar;
extern char *AcpiGbl_Optarg;
+/*
+ * cmfsize - Common get file size function
+ */
+UINT32
+CmGetFileSize (
+ ACPI_FILE File);
+
+
#ifndef ACPI_DUMP_APP
/*
* adisasm
@@ -123,8 +134,7 @@ AdAmlDisassemble (
BOOLEAN OutToFile,
char *Filename,
char *Prefix,
- char **OutFilename,
- BOOLEAN GetAllTables);
+ char **OutFilename);
void
AdPrintStatistics (
@@ -141,8 +151,7 @@ AdDumpTables (
ACPI_STATUS
AdGetLocalTables (
- char *Filename,
- BOOLEAN GetAllTables);
+ void);
ACPI_STATUS
AdParseTable (
diff --git a/sys/contrib/dev/acpica/include/acbuffer.h b/sys/contrib/dev/acpica/include/acbuffer.h
index 9651024..37f4170 100644
--- a/sys/contrib/dev/acpica/include/acbuffer.h
+++ b/sys/contrib/dev/acpica/include/acbuffer.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -119,7 +119,9 @@ typedef struct acpi_pld_info
{
UINT8 Revision;
UINT8 IgnoreColor;
- UINT32 Color;
+ UINT8 Red;
+ UINT8 Green;
+ UINT8 Blue;
UINT16 Width;
UINT16 Height;
UINT8 UserVisible;
@@ -165,8 +167,14 @@ typedef struct acpi_pld_info
#define ACPI_PLD_GET_IGNORE_COLOR(dword) ACPI_GET_BITS (dword, 7, ACPI_1BIT_MASK)
#define ACPI_PLD_SET_IGNORE_COLOR(dword,value) ACPI_SET_BITS (dword, 7, ACPI_1BIT_MASK, value) /* Offset 7, Len 1 */
-#define ACPI_PLD_GET_COLOR(dword) ACPI_GET_BITS (dword, 8, ACPI_24BIT_MASK)
-#define ACPI_PLD_SET_COLOR(dword,value) ACPI_SET_BITS (dword, 8, ACPI_24BIT_MASK, value) /* Offset 8, Len 24 */
+#define ACPI_PLD_GET_RED(dword) ACPI_GET_BITS (dword, 8, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_RED(dword,value) ACPI_SET_BITS (dword, 8, ACPI_8BIT_MASK, value) /* Offset 8, Len 8 */
+
+#define ACPI_PLD_GET_GREEN(dword) ACPI_GET_BITS (dword, 16, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_GREEN(dword,value) ACPI_SET_BITS (dword, 16, ACPI_8BIT_MASK, value) /* Offset 16, Len 8 */
+
+#define ACPI_PLD_GET_BLUE(dword) ACPI_GET_BITS (dword, 24, ACPI_8BIT_MASK)
+#define ACPI_PLD_SET_BLUE(dword,value) ACPI_SET_BITS (dword, 24, ACPI_8BIT_MASK, value) /* Offset 24, Len 8 */
/* Second 32-bit dword, bits 33:63 */
diff --git a/sys/contrib/dev/acpica/include/accommon.h b/sys/contrib/dev/acpica/include/accommon.h
index 074b6c1..e63943b 100644
--- a/sys/contrib/dev/acpica/include/accommon.h
+++ b/sys/contrib/dev/acpica/include/accommon.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acconfig.h b/sys/contrib/dev/acpica/include/acconfig.h
index 6a267fe..46dbc31 100644
--- a/sys/contrib/dev/acpica/include/acconfig.h
+++ b/sys/contrib/dev/acpica/include/acconfig.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -84,7 +84,9 @@
* Should the subsystem abort the loading of an ACPI table if the
* table checksum is incorrect?
*/
+#ifndef ACPI_CHECKSUM_ABORT
#define ACPI_CHECKSUM_ABORT FALSE
+#endif
/*
* Generate a version of ACPICA that only supports "reduced hardware"
@@ -101,7 +103,9 @@
* ACPI PM timer
* FACS table (Waking vectors and Global Lock)
*/
+#ifndef ACPI_REDUCED_HARDWARE
#define ACPI_REDUCED_HARDWARE FALSE
+#endif
/******************************************************************************
@@ -219,6 +223,25 @@
/******************************************************************************
*
+ * Miscellaneous constants
+ *
+ *****************************************************************************/
+
+/* UUID constants */
+
+#define UUID_BUFFER_LENGTH 16 /* Length of UUID in memory */
+#define UUID_STRING_LENGTH 36 /* Total length of a UUID string */
+
+/* Positions for required hyphens (dashes) in UUID strings */
+
+#define UUID_HYPHEN1_OFFSET 8
+#define UUID_HYPHEN2_OFFSET 13
+#define UUID_HYPHEN3_OFFSET 18
+#define UUID_HYPHEN4_OFFSET 23
+
+
+/******************************************************************************
+ *
* ACPI AML Debugger
*
*****************************************************************************/
diff --git a/sys/contrib/dev/acpica/include/acdebug.h b/sys/contrib/dev/acpica/include/acdebug.h
index 37d41d3..f630575 100644
--- a/sys/contrib/dev/acpica/include/acdebug.h
+++ b/sys/contrib/dev/acpica/include/acdebug.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -164,6 +164,11 @@ void
AcpiDbGenerateSci (
void))
+void
+AcpiDbExecuteTest (
+ char *TypeArg);
+
+
/*
* dbconvert - miscellaneous conversion routines
*/
@@ -372,11 +377,6 @@ AcpiDbGetTableFromFile (
char *Filename,
ACPI_TABLE_HEADER **Table);
-ACPI_STATUS
-AcpiDbReadTableFromFile (
- char *Filename,
- ACPI_TABLE_HEADER **Table);
-
/*
* dbhistry - debugger HISTORY command
@@ -393,6 +393,10 @@ char *
AcpiDbGetFromHistory (
char *CommandNumArg);
+char *
+AcpiDbGetHistoryByIndex (
+ UINT32 CommanddNum);
+
/*
* dbinput - user front-end to the AML debugger
diff --git a/sys/contrib/dev/acpica/include/acdisasm.h b/sys/contrib/dev/acpica/include/acdisasm.h
index 4fadd40..34cf1f7 100644
--- a/sys/contrib/dev/acpica/include/acdisasm.h
+++ b/sys/contrib/dev/acpica/include/acdisasm.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -69,14 +69,14 @@ typedef const struct acpi_dmtable_info
} ACPI_DMTABLE_INFO;
+/* Values for Flags field above */
+
#define DT_LENGTH 0x01 /* Field is a subtable length */
#define DT_FLAG 0x02 /* Field is a flag value */
#define DT_NON_ZERO 0x04 /* Field must be non-zero */
-
-/* TBD: Not used at this time */
-
-#define DT_OPTIONAL 0x08
-#define DT_COUNT 0x10
+#define DT_OPTIONAL 0x08 /* Field is optional */
+#define DT_DESCRIBES_OPTIONAL 0x10 /* Field describes an optional field (length, etc.) */
+#define DT_COUNT 0x20 /* Currently not used */
/*
* Values for Opcode above.
@@ -137,16 +137,20 @@ typedef enum
ACPI_DMT_ASF,
ACPI_DMT_DMAR,
+ ACPI_DMT_DMAR_SCOPE,
ACPI_DMT_EINJACT,
ACPI_DMT_EINJINST,
ACPI_DMT_ERSTACT,
ACPI_DMT_ERSTINST,
ACPI_DMT_FADTPM,
+ ACPI_DMT_GTDT,
ACPI_DMT_HEST,
ACPI_DMT_HESTNTFY,
ACPI_DMT_HESTNTYP,
ACPI_DMT_IVRS,
+ ACPI_DMT_LPIT,
ACPI_DMT_MADT,
+ ACPI_DMT_PCCT,
ACPI_DMT_PMTT,
ACPI_DMT_SLIC,
ACPI_DMT_SRAT,
@@ -186,6 +190,7 @@ typedef struct acpi_op_walk_info
UINT32 BitOffset;
UINT32 Flags;
ACPI_WALK_STATE *WalkState;
+ ACPI_PARSE_OBJECT *MappingOp;
} ACPI_OP_WALK_INFO;
@@ -203,6 +208,7 @@ ACPI_STATUS (*ASL_WALK_CALLBACK) (
typedef
void (*ACPI_RESOURCE_HANDLER) (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
@@ -244,6 +250,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Device[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Addr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Size[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Name[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2OemData[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbgp[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr[];
@@ -252,6 +259,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 AcpiDmTableInfoDmar4[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[];
@@ -269,6 +277,10 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoGas[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtHdr[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0a[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHeader[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[];
@@ -281,6 +293,9 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest9[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpitHdr[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs1[];
@@ -303,6 +318,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt9[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt13[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt14[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[];
@@ -324,7 +341,9 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1a[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmttHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcctHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt[];
@@ -343,6 +362,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoSratHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[];
@@ -438,6 +458,10 @@ AcpiDmDumpFpdt (
ACPI_TABLE_HEADER *Table);
void
+AcpiDmDumpGtdt (
+ ACPI_TABLE_HEADER *Table);
+
+void
AcpiDmDumpHest (
ACPI_TABLE_HEADER *Table);
@@ -446,6 +470,10 @@ AcpiDmDumpIvrs (
ACPI_TABLE_HEADER *Table);
void
+AcpiDmDumpLpit (
+ ACPI_TABLE_HEADER *Table);
+
+void
AcpiDmDumpMadt (
ACPI_TABLE_HEADER *Table);
@@ -549,6 +577,14 @@ AcpiDmMethodFlags (
ACPI_PARSE_OBJECT *Op);
void
+AcpiDmDisplayTargetPathname (
+ ACPI_PARSE_OBJECT *Op);
+
+void
+AcpiDmNotifyDescription (
+ ACPI_PARSE_OBJECT *Op);
+
+void
AcpiDmPredefinedDescription (
ACPI_PARSE_OBJECT *Op);
@@ -628,14 +664,18 @@ AcpiDmByteList (
ACPI_PARSE_OBJECT *Op);
void
-AcpiDmIsEisaId (
+AcpiDmCheckForHardwareId (
ACPI_PARSE_OBJECT *Op);
void
-AcpiDmEisaId (
+AcpiDmDecompressEisaId (
UINT32 EncodedId);
BOOLEAN
+AcpiDmIsUuidBuffer (
+ ACPI_PARSE_OBJECT *Op);
+
+BOOLEAN
AcpiDmIsUnicodeBuffer (
ACPI_PARSE_OBJECT *Op);
@@ -668,11 +708,19 @@ AcpiDmClearExternalFileList (
void);
void
-AcpiDmAddToExternalList (
+AcpiDmAddOpToExternalList (
ACPI_PARSE_OBJECT *Op,
char *Path,
UINT8 Type,
- UINT32 Value);
+ UINT32 Value,
+ UINT16 Flags);
+
+void
+AcpiDmAddNodeToExternalList (
+ ACPI_NAMESPACE_NODE *Node,
+ UINT8 Type,
+ UINT32 Value,
+ UINT16 Flags);
void
AcpiDmAddExternalsToNamespace (
@@ -747,72 +795,84 @@ AcpiDmDescriptorName (
*/
void
AcpiDmWordDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmDwordDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmExtendedDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmQwordDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmMemory24Descriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmMemory32Descriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmFixedMemory32Descriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmGenericRegisterDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmInterruptDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmVendorLargeDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmGpioDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmSerialBusDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
@@ -830,48 +890,56 @@ AcpiDmVendorCommon (
*/
void
AcpiDmIrqDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmDmaDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmFixedDmaDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmIoDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmFixedIoDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmStartDependentDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmEndDependentDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
void
AcpiDmVendorSmallDescriptor (
+ ACPI_OP_WALK_INFO *Info,
AML_RESOURCE *Resource,
UINT32 Length,
UINT32 Level);
@@ -911,11 +979,23 @@ AcpiDmCheckResourceReference (
/*
+ * dmcstyle
+ */
+BOOLEAN
+AcpiDmCheckForSymbolicOpcode (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_OP_WALK_INFO *Info);
+
+void
+AcpiDmCloseOperator (
+ ACPI_PARSE_OBJECT *Op);
+
+
+/*
* acdisasm
*/
void
AdDisassemblerHeader (
char *Filename);
-
#endif /* __ACDISASM_H__ */
diff --git a/sys/contrib/dev/acpica/include/acdispat.h b/sys/contrib/dev/acpica/include/acdispat.h
index fc747f1..9364fe3 100644
--- a/sys/contrib/dev/acpica/include/acdispat.h
+++ b/sys/contrib/dev/acpica/include/acdispat.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#ifndef _ACDISPAT_H_
#define _ACDISPAT_H_
@@ -173,13 +172,15 @@ AcpiDsInitFieldObjects (
/*
- * dsload - Parser/Interpreter interface, pass 1 namespace load callbacks
+ * dsload - Parser/Interpreter interface
*/
ACPI_STATUS
AcpiDsInitCallbacks (
ACPI_WALK_STATE *WalkState,
UINT32 PassNumber);
+/* dsload - pass 1 namespace load callbacks */
+
ACPI_STATUS
AcpiDsLoad1BeginOp (
ACPI_WALK_STATE *WalkState,
@@ -190,9 +191,8 @@ AcpiDsLoad1EndOp (
ACPI_WALK_STATE *WalkState);
-/*
- * dsload - Parser/Interpreter interface, pass 2 namespace load callbacks
- */
+/* dsload - pass 2 namespace load callbacks */
+
ACPI_STATUS
AcpiDsLoad2BeginOp (
ACPI_WALK_STATE *WalkState,
@@ -257,8 +257,9 @@ AcpiDsMethodDataInit (
* dsmethod - Parser/Interpreter interface - control method parsing
*/
ACPI_STATUS
-AcpiDsParseMethod (
- ACPI_NAMESPACE_NODE *Node);
+AcpiDsAutoSerializeMethod (
+ ACPI_NAMESPACE_NODE *Node,
+ ACPI_OPERAND_OBJECT *ObjDesc);
ACPI_STATUS
AcpiDsCallControlMethod (
diff --git a/sys/contrib/dev/acpica/include/acevents.h b/sys/contrib/dev/acpica/include/acevents.h
index 67095aa..2ae0aca 100644
--- a/sys/contrib/dev/acpica/include/acevents.h
+++ b/sys/contrib/dev/acpica/include/acevents.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -144,9 +144,10 @@ AcpiEvFinishGpe (
ACPI_STATUS
AcpiEvCreateGpeBlock (
ACPI_NAMESPACE_NODE *GpeDevice,
- ACPI_GENERIC_ADDRESS *GpeBlockAddress,
+ UINT64 Address,
+ UINT8 SpaceId,
UINT32 RegisterCount,
- UINT8 GpeBlockBaseNumber,
+ UINT16 GpeBlockBaseNumber,
UINT32 InterruptNumber,
ACPI_GPE_BLOCK_INFO **ReturnGpeBlock);
@@ -196,19 +197,16 @@ AcpiEvWalkGpeList (
ACPI_GPE_CALLBACK GpeWalkCallback,
void *Context);
-BOOLEAN
-AcpiEvValidGpeEvent (
- ACPI_GPE_EVENT_INFO *GpeEventInfo);
-
ACPI_STATUS
AcpiEvGetGpeDevice (
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Context);
-ACPI_GPE_XRUPT_INFO *
+ACPI_STATUS
AcpiEvGetGpeXruptBlock (
- UINT32 InterruptNumber);
+ UINT32 InterruptNumber,
+ ACPI_GPE_XRUPT_INFO **GpeXruptBlock);
ACPI_STATUS
AcpiEvDeleteGpeXrupt (
diff --git a/sys/contrib/dev/acpica/include/acexcep.h b/sys/contrib/dev/acpica/include/acexcep.h
index 7bcfe1d..7a3fdcb 100644
--- a/sys/contrib/dev/acpica/include/acexcep.h
+++ b/sys/contrib/dev/acpica/include/acexcep.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acglobal.h b/sys/contrib/dev/acpica/include/acglobal.h
index cb76f65..9b6e936 100644
--- a/sys/contrib/dev/acpica/include/acglobal.h
+++ b/sys/contrib/dev/acpica/include/acglobal.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -45,167 +45,42 @@
#define __ACGLOBAL_H__
-/*
- * Ensure that the globals are actually defined and initialized only once.
- *
- * The use of these macros allows a single list of globals (here) in order
- * to simplify maintenance of the code.
- */
-#ifdef DEFINE_ACPI_GLOBALS
-#define ACPI_EXTERN
-#define ACPI_INIT_GLOBAL(a,b) a=b
-#else
-#define ACPI_EXTERN extern
-#define ACPI_INIT_GLOBAL(a,b) a
-#endif
-
-
-#ifdef DEFINE_ACPI_GLOBALS
-
-/* Public globals, available from outside ACPICA subsystem */
-
/*****************************************************************************
*
- * Runtime configuration (static defaults that can be overriden at runtime)
+ * Globals related to the ACPI tables
*
****************************************************************************/
-/*
- * Enable "slack" in the AML interpreter? Default is FALSE, and the
- * interpreter strictly follows the ACPI specification. Setting to TRUE
- * allows the interpreter to ignore certain errors and/or bad AML constructs.
- *
- * Currently, these features are enabled by this flag:
- *
- * 1) Allow "implicit return" of last value in a control method
- * 2) Allow access beyond the end of an operation region
- * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
- * 4) Allow ANY object type to be a source operand for the Store() operator
- * 5) Allow unresolved references (invalid target name) in package objects
- * 6) Enable warning messages for behavior that is not ACPI spec compliant
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_EnableInterpreterSlack, FALSE);
-
-/*
- * Automatically serialize ALL control methods? Default is FALSE, meaning
- * to use the Serialized/NotSerialized method flags on a per method basis.
- * Only change this if the ASL code is poorly written and cannot handle
- * reentrancy even though methods are marked "NotSerialized".
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_AllMethodsSerialized, FALSE);
-
-/*
- * Create the predefined _OSI method in the namespace? Default is TRUE
- * because ACPI CA is fully compatible with other ACPI implementations.
- * Changing this will revert ACPI CA (and machine ASL) to pre-OSI behavior.
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_CreateOsiMethod, TRUE);
-
-/*
- * Optionally use default values for the ACPI register widths. Set this to
- * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_UseDefaultRegisterWidths, TRUE);
-
-/*
- * Optionally enable output from the AML Debug Object.
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_EnableAmlDebugObject, FALSE);
-
-/*
- * Optionally copy the entire DSDT to local memory (instead of simply
- * mapping it.) There are some BIOSs that corrupt or replace the original
- * DSDT, creating the need for this option. Default is FALSE, do not copy
- * the DSDT.
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_CopyDsdtLocally, FALSE);
-
-/*
- * Optionally truncate I/O addresses to 16 bits. Provides compatibility
- * with other ACPI implementations. NOTE: During ACPICA initialization,
- * this value is set to TRUE if any Windows OSI strings have been
- * requested by the BIOS.
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_TruncateIoAddresses, FALSE);
-
-/*
- * Disable runtime checking and repair of values returned by control methods.
- * Use only if the repair is causing a problem on a particular machine.
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_DisableAutoRepair, FALSE);
-
-/*
- * Optionally do not load any SSDTs from the RSDT/XSDT during initialization.
- * This can be useful for debugging ACPI problems on some machines.
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_DisableSsdtTableLoad, FALSE);
-
-/*
- * We keep track of the latest version of Windows that has been requested by
- * the BIOS.
- */
-UINT8 ACPI_INIT_GLOBAL (AcpiGbl_OsiData, 0);
-
-
-/* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */
+/* Master list of all ACPI tables that were found in the RSDT/XSDT */
-ACPI_TABLE_FADT AcpiGbl_FADT;
-UINT32 AcpiCurrentGpeCount;
-UINT32 AcpiGbl_TraceFlags;
-ACPI_NAME AcpiGbl_TraceMethodName;
-BOOLEAN AcpiGbl_SystemAwakeAndRunning;
+ACPI_GLOBAL (ACPI_TABLE_LIST, AcpiGbl_RootTableList);
-/*
- * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
- * that the ACPI hardware is no longer required. A flag in the FADT indicates
- * a reduced HW machine, and that flag is duplicated here for convenience.
- */
-BOOLEAN AcpiGbl_ReducedHardware;
-
-#endif /* DEFINE_ACPI_GLOBALS */
-
-/* Do not disassemble buffers to resource descriptors */
-
-ACPI_EXTERN UINT8 ACPI_INIT_GLOBAL (AcpiGbl_NoResourceDisassembly, FALSE);
-
-/*****************************************************************************
- *
- * ACPI Table globals
- *
- ****************************************************************************/
+/* DSDT information. Used to check for DSDT corruption */
-/*
- * AcpiGbl_RootTableList is the master list of ACPI tables that were
- * found in the RSDT/XSDT.
- */
-ACPI_EXTERN ACPI_TABLE_LIST AcpiGbl_RootTableList;
+ACPI_GLOBAL (ACPI_TABLE_HEADER *, AcpiGbl_DSDT);
+ACPI_GLOBAL (ACPI_TABLE_HEADER, AcpiGbl_OriginalDsdtHeader);
#if (!ACPI_REDUCED_HARDWARE)
-ACPI_EXTERN ACPI_TABLE_FACS *AcpiGbl_FACS;
+ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_FACS);
#endif /* !ACPI_REDUCED_HARDWARE */
/* These addresses are calculated from the FADT Event Block addresses */
-ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1aStatus;
-ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1aEnable;
-
-ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1bStatus;
-ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1bEnable;
-
-/* DSDT information. Used to check for DSDT corruption */
+ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1aStatus);
+ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1aEnable);
-ACPI_EXTERN ACPI_TABLE_HEADER *AcpiGbl_DSDT;
-ACPI_EXTERN ACPI_TABLE_HEADER AcpiGbl_OriginalDsdtHeader;
+ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1bStatus);
+ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1bEnable);
/*
- * Handle both ACPI 1.0 and ACPI 2.0 Integer widths. The integer width is
+ * Handle both ACPI 1.0 and ACPI 2.0+ Integer widths. The integer width is
* determined by the revision of the DSDT: If the DSDT revision is less than
* 2, use only the lower 32 bits of the internal 64-bit Integer.
*/
-ACPI_EXTERN UINT8 AcpiGbl_IntegerBitWidth;
-ACPI_EXTERN UINT8 AcpiGbl_IntegerByteWidth;
-ACPI_EXTERN UINT8 AcpiGbl_IntegerNybbleWidth;
+ACPI_GLOBAL (UINT8, AcpiGbl_IntegerBitWidth);
+ACPI_GLOBAL (UINT8, AcpiGbl_IntegerByteWidth);
+ACPI_GLOBAL (UINT8, AcpiGbl_IntegerNybbleWidth);
/*****************************************************************************
@@ -219,36 +94,36 @@ ACPI_EXTERN UINT8 AcpiGbl_IntegerNybbleWidth;
* actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs.
* (The table maps local handles to the real OS handles)
*/
-ACPI_EXTERN ACPI_MUTEX_INFO AcpiGbl_MutexInfo[ACPI_NUM_MUTEX];
+ACPI_GLOBAL (ACPI_MUTEX_INFO, AcpiGbl_MutexInfo[ACPI_NUM_MUTEX]);
/*
* Global lock mutex is an actual AML mutex object
* Global lock semaphore works in conjunction with the actual global lock
* Global lock spinlock is used for "pending" handshake
*/
-ACPI_EXTERN ACPI_OPERAND_OBJECT *AcpiGbl_GlobalLockMutex;
-ACPI_EXTERN ACPI_SEMAPHORE AcpiGbl_GlobalLockSemaphore;
-ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_GlobalLockPendingLock;
-ACPI_EXTERN UINT16 AcpiGbl_GlobalLockHandle;
-ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockAcquired;
-ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockPresent;
-ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockPending;
+ACPI_GLOBAL (ACPI_OPERAND_OBJECT *, AcpiGbl_GlobalLockMutex);
+ACPI_GLOBAL (ACPI_SEMAPHORE, AcpiGbl_GlobalLockSemaphore);
+ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_GlobalLockPendingLock);
+ACPI_GLOBAL (UINT16, AcpiGbl_GlobalLockHandle);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockAcquired);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockPresent);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockPending);
/*
* Spinlocks are used for interfaces that can be possibly called at
* interrupt level
*/
-ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_GpeLock; /* For GPE data structs and registers */
-ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_HardwareLock; /* For ACPI H/W except GPE registers */
-ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_ReferenceCountLock;
+ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_GpeLock); /* For GPE data structs and registers */
+ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_HardwareLock); /* For ACPI H/W except GPE registers */
+ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_ReferenceCountLock);
/* Mutex for _OSI support */
-ACPI_EXTERN ACPI_MUTEX AcpiGbl_OsiMutex;
+ACPI_GLOBAL (ACPI_MUTEX, AcpiGbl_OsiMutex);
/* Reader/Writer lock is used for namespace walk and dynamic table unload */
-ACPI_EXTERN ACPI_RW_LOCK AcpiGbl_NamespaceRwLock;
+ACPI_GLOBAL (ACPI_RW_LOCK, AcpiGbl_NamespaceRwLock);
/*****************************************************************************
@@ -259,69 +134,67 @@ ACPI_EXTERN ACPI_RW_LOCK AcpiGbl_NamespaceRwLock;
/* Object caches */
-ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_NamespaceCache;
-ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_StateCache;
-ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_PsNodeCache;
-ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_PsNodeExtCache;
-ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_OperandCache;
+ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_NamespaceCache);
+ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_StateCache);
+ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_PsNodeCache);
+ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_PsNodeExtCache);
+ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_OperandCache);
+
+/* System */
+
+ACPI_INIT_GLOBAL (UINT32, AcpiGbl_StartupFlags, 0);
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_Shutdown, TRUE);
/* Global handlers */
-ACPI_EXTERN ACPI_GLOBAL_NOTIFY_HANDLER AcpiGbl_GlobalNotify[2];
-ACPI_EXTERN ACPI_EXCEPTION_HANDLER AcpiGbl_ExceptionHandler;
-ACPI_EXTERN ACPI_INIT_HANDLER AcpiGbl_InitHandler;
-ACPI_EXTERN ACPI_TABLE_HANDLER AcpiGbl_TableHandler;
-ACPI_EXTERN void *AcpiGbl_TableHandlerContext;
-ACPI_EXTERN ACPI_WALK_STATE *AcpiGbl_BreakpointWalk;
-ACPI_EXTERN ACPI_INTERFACE_HANDLER AcpiGbl_InterfaceHandler;
-ACPI_EXTERN ACPI_SCI_HANDLER_INFO *AcpiGbl_SciHandlerList;
+ACPI_GLOBAL (ACPI_GLOBAL_NOTIFY_HANDLER,AcpiGbl_GlobalNotify[2]);
+ACPI_GLOBAL (ACPI_EXCEPTION_HANDLER, AcpiGbl_ExceptionHandler);
+ACPI_GLOBAL (ACPI_INIT_HANDLER, AcpiGbl_InitHandler);
+ACPI_GLOBAL (ACPI_TABLE_HANDLER, AcpiGbl_TableHandler);
+ACPI_GLOBAL (void *, AcpiGbl_TableHandlerContext);
+ACPI_GLOBAL (ACPI_INTERFACE_HANDLER, AcpiGbl_InterfaceHandler);
+ACPI_GLOBAL (ACPI_SCI_HANDLER_INFO *, AcpiGbl_SciHandlerList);
/* Owner ID support */
-ACPI_EXTERN UINT32 AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS];
-ACPI_EXTERN UINT8 AcpiGbl_LastOwnerIdIndex;
-ACPI_EXTERN UINT8 AcpiGbl_NextOwnerIdOffset;
+ACPI_GLOBAL (UINT32, AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS]);
+ACPI_GLOBAL (UINT8, AcpiGbl_LastOwnerIdIndex);
+ACPI_GLOBAL (UINT8, AcpiGbl_NextOwnerIdOffset);
/* Initialization sequencing */
-ACPI_EXTERN BOOLEAN AcpiGbl_RegMethodsExecuted;
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_RegMethodsExecuted);
/* Misc */
-ACPI_EXTERN UINT32 AcpiGbl_OriginalMode;
-ACPI_EXTERN UINT32 AcpiGbl_RsdpOriginalLocation;
-ACPI_EXTERN UINT32 AcpiGbl_NsLookupCount;
-ACPI_EXTERN UINT32 AcpiGbl_PsFindCount;
-ACPI_EXTERN UINT16 AcpiGbl_Pm1EnableRegisterSave;
-ACPI_EXTERN UINT8 AcpiGbl_DebuggerConfiguration;
-ACPI_EXTERN BOOLEAN AcpiGbl_StepToNextCall;
-ACPI_EXTERN BOOLEAN AcpiGbl_AcpiHardwarePresent;
-ACPI_EXTERN BOOLEAN AcpiGbl_EventsInitialized;
-ACPI_EXTERN ACPI_INTERFACE_INFO *AcpiGbl_SupportedInterfaces;
-ACPI_EXTERN ACPI_ADDRESS_RANGE *AcpiGbl_AddressRangeList[ACPI_ADDRESS_RANGE_MAX];
+ACPI_GLOBAL (UINT32, AcpiGbl_OriginalMode);
+ACPI_GLOBAL (UINT32, AcpiGbl_NsLookupCount);
+ACPI_GLOBAL (UINT32, AcpiGbl_PsFindCount);
+ACPI_GLOBAL (UINT16, AcpiGbl_Pm1EnableRegisterSave);
+ACPI_GLOBAL (UINT8, AcpiGbl_DebuggerConfiguration);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_StepToNextCall);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_AcpiHardwarePresent);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_EventsInitialized);
+ACPI_GLOBAL (ACPI_INTERFACE_INFO *, AcpiGbl_SupportedInterfaces);
+ACPI_GLOBAL (ACPI_ADDRESS_RANGE *, AcpiGbl_AddressRangeList[ACPI_ADDRESS_RANGE_MAX]);
-#ifndef DEFINE_ACPI_GLOBALS
+/* Other miscellaneous, declared and initialized in utglobal */
-/* Other miscellaneous */
-
-extern BOOLEAN AcpiGbl_Shutdown;
-extern UINT32 AcpiGbl_StartupFlags;
extern const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT];
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
+extern const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES];
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
-/* Lists for tracking memory allocations */
+/* Lists for tracking memory allocations (debug only) */
-ACPI_EXTERN ACPI_MEMORY_LIST *AcpiGbl_GlobalList;
-ACPI_EXTERN ACPI_MEMORY_LIST *AcpiGbl_NsNodeList;
-ACPI_EXTERN BOOLEAN AcpiGbl_DisplayFinalMemStats;
-ACPI_EXTERN BOOLEAN AcpiGbl_DisableMemTracking;
+ACPI_GLOBAL (ACPI_MEMORY_LIST *, AcpiGbl_GlobalList);
+ACPI_GLOBAL (ACPI_MEMORY_LIST *, AcpiGbl_NsNodeList);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DisplayFinalMemStats);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DisableMemTracking);
#endif
@@ -337,22 +210,23 @@ ACPI_EXTERN BOOLEAN AcpiGbl_DisableMemTracking;
#define NUM_PREDEFINED_NAMES 9
#endif
-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;
+ACPI_GLOBAL (ACPI_NAMESPACE_NODE, AcpiGbl_RootNodeStruct);
+ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_RootNode);
+ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_FadtGpeDevice);
+ACPI_GLOBAL (ACPI_OPERAND_OBJECT *, AcpiGbl_ModuleCodeList);
extern const UINT8 AcpiGbl_NsProperties [ACPI_NUM_NS_TYPES];
extern const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames [NUM_PREDEFINED_NAMES];
#ifdef ACPI_DEBUG_OUTPUT
-ACPI_EXTERN UINT32 AcpiGbl_CurrentNodeCount;
-ACPI_EXTERN UINT32 AcpiGbl_CurrentNodeSize;
-ACPI_EXTERN UINT32 AcpiGbl_MaxConcurrentNodeCount;
-ACPI_EXTERN ACPI_SIZE *AcpiGbl_EntryStackPointer;
-ACPI_EXTERN ACPI_SIZE *AcpiGbl_LowestStackPointer;
-ACPI_EXTERN UINT32 AcpiGbl_DeepestNesting;
+ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeCount);
+ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeSize);
+ACPI_GLOBAL (UINT32, AcpiGbl_MaxConcurrentNodeCount);
+ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_EntryStackPointer);
+ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_LowestStackPointer);
+ACPI_GLOBAL (UINT32, AcpiGbl_DeepestNesting);
+ACPI_INIT_GLOBAL (UINT32, AcpiGbl_NestingLevel, 0);
#endif
@@ -362,11 +236,11 @@ ACPI_EXTERN UINT32 AcpiGbl_DeepestNesting;
*
****************************************************************************/
-ACPI_EXTERN ACPI_THREAD_STATE *AcpiGbl_CurrentWalkList;
+ACPI_GLOBAL (ACPI_THREAD_STATE *, AcpiGbl_CurrentWalkList);
/* Control method single step flag */
-ACPI_EXTERN UINT8 AcpiGbl_CmSingleStep;
+ACPI_GLOBAL (UINT8, AcpiGbl_CmSingleStep);
/*****************************************************************************
@@ -375,9 +249,10 @@ ACPI_EXTERN UINT8 AcpiGbl_CmSingleStep;
*
****************************************************************************/
-extern ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG];
-ACPI_EXTERN UINT8 AcpiGbl_SleepTypeA;
-ACPI_EXTERN UINT8 AcpiGbl_SleepTypeB;
+extern ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG];
+
+ACPI_GLOBAL (UINT8, AcpiGbl_SleepTypeA);
+ACPI_GLOBAL (UINT8, AcpiGbl_SleepTypeB);
/*****************************************************************************
@@ -388,13 +263,14 @@ ACPI_EXTERN UINT8 AcpiGbl_SleepTypeB;
#if (!ACPI_REDUCED_HARDWARE)
-ACPI_EXTERN UINT8 AcpiGbl_AllGpesInitialized;
-ACPI_EXTERN ACPI_GPE_XRUPT_INFO *AcpiGbl_GpeXruptListHead;
-ACPI_EXTERN ACPI_GPE_BLOCK_INFO *AcpiGbl_GpeFadtBlocks[ACPI_MAX_GPE_BLOCKS];
-ACPI_EXTERN ACPI_GBL_EVENT_HANDLER AcpiGbl_GlobalEventHandler;
-ACPI_EXTERN void *AcpiGbl_GlobalEventHandlerContext;
-ACPI_EXTERN ACPI_FIXED_EVENT_HANDLER AcpiGbl_FixedEventHandlers[ACPI_NUM_FIXED_EVENTS];
-extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS];
+ACPI_GLOBAL (UINT8, AcpiGbl_AllGpesInitialized);
+ACPI_GLOBAL (ACPI_GPE_XRUPT_INFO *, AcpiGbl_GpeXruptListHead);
+ACPI_GLOBAL (ACPI_GPE_BLOCK_INFO *, AcpiGbl_GpeFadtBlocks[ACPI_MAX_GPE_BLOCKS]);
+ACPI_GLOBAL (ACPI_GBL_EVENT_HANDLER, AcpiGbl_GlobalEventHandler);
+ACPI_GLOBAL (void *, AcpiGbl_GlobalEventHandlerContext);
+ACPI_GLOBAL (ACPI_FIXED_EVENT_HANDLER, AcpiGbl_FixedEventHandlers[ACPI_NUM_FIXED_EVENTS]);
+
+extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS];
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -404,23 +280,19 @@ extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EV
*
****************************************************************************/
-/* Procedure nesting level for debug output */
-
-extern UINT32 AcpiGbl_NestingLevel;
-
/* Event counters */
-ACPI_EXTERN UINT32 AcpiMethodCount;
-ACPI_EXTERN UINT32 AcpiGpeCount;
-ACPI_EXTERN UINT32 AcpiSciCount;
-ACPI_EXTERN UINT32 AcpiFixedEventCount[ACPI_NUM_FIXED_EVENTS];
+ACPI_GLOBAL (UINT32, AcpiMethodCount);
+ACPI_GLOBAL (UINT32, AcpiGpeCount);
+ACPI_GLOBAL (UINT32, AcpiSciCount);
+ACPI_GLOBAL (UINT32, AcpiFixedEventCount[ACPI_NUM_FIXED_EVENTS]);
/* Support for dynamic control method tracing mechanism */
-ACPI_EXTERN UINT32 AcpiGbl_OriginalDbgLevel;
-ACPI_EXTERN UINT32 AcpiGbl_OriginalDbgLayer;
-ACPI_EXTERN UINT32 AcpiGbl_TraceDbgLevel;
-ACPI_EXTERN UINT32 AcpiGbl_TraceDbgLayer;
+ACPI_GLOBAL (UINT32, AcpiGbl_OriginalDbgLevel);
+ACPI_GLOBAL (UINT32, AcpiGbl_OriginalDbgLayer);
+ACPI_GLOBAL (UINT32, AcpiGbl_TraceDbgLevel);
+ACPI_GLOBAL (UINT32, AcpiGbl_TraceDbgLayer);
/*****************************************************************************
@@ -429,65 +301,81 @@ ACPI_EXTERN UINT32 AcpiGbl_TraceDbgLayer;
*
****************************************************************************/
-ACPI_EXTERN UINT8 AcpiGbl_DbOutputFlags;
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DbOutputFlags, ACPI_DB_CONSOLE_OUTPUT);
#ifdef ACPI_DISASSEMBLER
-ACPI_EXTERN BOOLEAN ACPI_INIT_GLOBAL (AcpiGbl_IgnoreNoopOperator, FALSE);
+/* Do not disassemble buffers to resource descriptors */
-ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_disasm;
-ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_verbose;
-ACPI_EXTERN BOOLEAN AcpiGbl_NumExternalMethods;
-ACPI_EXTERN UINT32 AcpiGbl_ResolvedExternalMethods;
-ACPI_EXTERN ACPI_EXTERNAL_LIST *AcpiGbl_ExternalList;
-ACPI_EXTERN ACPI_EXTERNAL_FILE *AcpiGbl_ExternalFileList;
-#endif
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_NoResourceDisassembly, FALSE);
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnoreNoopOperator, FALSE);
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_CstyleDisassembly, TRUE);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_disasm);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_verbose);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_NumExternalMethods);
+ACPI_GLOBAL (UINT32, AcpiGbl_ResolvedExternalMethods);
+ACPI_GLOBAL (ACPI_EXTERNAL_LIST *, AcpiGbl_ExternalList);
+ACPI_GLOBAL (ACPI_EXTERNAL_FILE *, AcpiGbl_ExternalFileList);
+#endif
#ifdef ACPI_DEBUGGER
-extern BOOLEAN AcpiGbl_MethodExecuting;
-extern BOOLEAN AcpiGbl_AbortMethod;
-extern BOOLEAN AcpiGbl_DbTerminateThreads;
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DbTerminateThreads, FALSE);
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_AbortMethod, FALSE);
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_MethodExecuting, FALSE);
-ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_tables;
-ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_stats;
-ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_ini_methods;
-ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_NoRegionSupport;
-ACPI_EXTERN BOOLEAN AcpiGbl_DbOutputToFile;
-ACPI_EXTERN char *AcpiGbl_DbBuffer;
-ACPI_EXTERN char *AcpiGbl_DbFilename;
-ACPI_EXTERN UINT32 AcpiGbl_DbDebugLevel;
-ACPI_EXTERN UINT32 AcpiGbl_DbConsoleDebugLevel;
-ACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_DbScopeNode;
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_tables);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_stats);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_ini_methods);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoRegionSupport);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOutputToFile);
+ACPI_GLOBAL (char *, AcpiGbl_DbBuffer);
+ACPI_GLOBAL (char *, AcpiGbl_DbFilename);
+ACPI_GLOBAL (UINT32, AcpiGbl_DbDebugLevel);
+ACPI_GLOBAL (UINT32, AcpiGbl_DbConsoleDebugLevel);
+ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_DbScopeNode);
-ACPI_EXTERN char *AcpiGbl_DbArgs[ACPI_DEBUGGER_MAX_ARGS];
-ACPI_EXTERN ACPI_OBJECT_TYPE AcpiGbl_DbArgTypes[ACPI_DEBUGGER_MAX_ARGS];
+ACPI_GLOBAL (char *, AcpiGbl_DbArgs[ACPI_DEBUGGER_MAX_ARGS]);
+ACPI_GLOBAL (ACPI_OBJECT_TYPE, AcpiGbl_DbArgTypes[ACPI_DEBUGGER_MAX_ARGS]);
/* These buffers should all be the same size */
-ACPI_EXTERN char AcpiGbl_DbLineBuf[ACPI_DB_LINE_BUFFER_SIZE];
-ACPI_EXTERN char AcpiGbl_DbParsedBuf[ACPI_DB_LINE_BUFFER_SIZE];
-ACPI_EXTERN char AcpiGbl_DbScopeBuf[ACPI_DB_LINE_BUFFER_SIZE];
-ACPI_EXTERN char AcpiGbl_DbDebugFilename[ACPI_DB_LINE_BUFFER_SIZE];
+ACPI_GLOBAL (char, AcpiGbl_DbLineBuf[ACPI_DB_LINE_BUFFER_SIZE]);
+ACPI_GLOBAL (char, AcpiGbl_DbParsedBuf[ACPI_DB_LINE_BUFFER_SIZE]);
+ACPI_GLOBAL (char, AcpiGbl_DbScopeBuf[ACPI_DB_LINE_BUFFER_SIZE]);
+ACPI_GLOBAL (char, AcpiGbl_DbDebugFilename[ACPI_DB_LINE_BUFFER_SIZE]);
/*
* Statistic globals
*/
-ACPI_EXTERN UINT16 AcpiGbl_ObjTypeCount[ACPI_TYPE_NS_NODE_MAX+1];
-ACPI_EXTERN UINT16 AcpiGbl_NodeTypeCount[ACPI_TYPE_NS_NODE_MAX+1];
-ACPI_EXTERN UINT16 AcpiGbl_ObjTypeCountMisc;
-ACPI_EXTERN UINT16 AcpiGbl_NodeTypeCountMisc;
-ACPI_EXTERN UINT32 AcpiGbl_NumNodes;
-ACPI_EXTERN UINT32 AcpiGbl_NumObjects;
+ACPI_GLOBAL (UINT16, AcpiGbl_ObjTypeCount[ACPI_TYPE_NS_NODE_MAX+1]);
+ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCount[ACPI_TYPE_NS_NODE_MAX+1]);
+ACPI_GLOBAL (UINT16, AcpiGbl_ObjTypeCountMisc);
+ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCountMisc);
+ACPI_GLOBAL (UINT32, AcpiGbl_NumNodes);
+ACPI_GLOBAL (UINT32, AcpiGbl_NumObjects);
+
+#endif /* ACPI_DEBUGGER */
+
+
+/*****************************************************************************
+ *
+ * Application globals
+ *
+ ****************************************************************************/
+#ifdef ACPI_APPLICATION
-ACPI_EXTERN UINT32 AcpiGbl_SizeOfParseTree;
-ACPI_EXTERN UINT32 AcpiGbl_SizeOfMethodTrees;
-ACPI_EXTERN UINT32 AcpiGbl_SizeOfNodeEntries;
-ACPI_EXTERN UINT32 AcpiGbl_SizeOfAcpiObjects;
+ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_DebugFile, NULL);
+ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_OutputFile, NULL);
-#endif /* ACPI_DEBUGGER */
+/* Print buffer */
+
+ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_PrintLock); /* For print buffer */
+ACPI_GLOBAL (char, AcpiGbl_PrintBuffer[1024]);
+
+#endif /* ACPI_APPLICATION */
/*****************************************************************************
@@ -496,7 +384,8 @@ ACPI_EXTERN UINT32 AcpiGbl_SizeOfAcpiObjects;
*
****************************************************************************/
-extern const AH_PREDEFINED_NAME AslPredefinedInfo[];
+extern const AH_PREDEFINED_NAME AslPredefinedInfo[];
+extern const AH_DEVICE_ID AslDeviceIds[];
#endif /* __ACGLOBAL_H__ */
diff --git a/sys/contrib/dev/acpica/include/achware.h b/sys/contrib/dev/acpica/include/achware.h
index 9577fd1..6ab28b6 100644
--- a/sys/contrib/dev/acpica/include/achware.h
+++ b/sys/contrib/dev/acpica/include/achware.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acinterp.h b/sys/contrib/dev/acpica/include/acinterp.h
index ebf4c98..66463d6 100644
--- a/sys/contrib/dev/acpica/include/acinterp.h
+++ b/sys/contrib/dev/acpica/include/acinterp.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -89,6 +89,10 @@ typedef const struct acpi_exdump_info
#define ACPI_EXD_PACKAGE 11
#define ACPI_EXD_FIELD 12
#define ACPI_EXD_REFERENCE 13
+#define ACPI_EXD_LIST 14 /* Operand object list */
+#define ACPI_EXD_HDLR_LIST 15 /* Address Handler list */
+#define ACPI_EXD_RGN_LIST 16 /* Region list */
+#define ACPI_EXD_NODE 17 /* Namespace Node */
/* restore default alignment */
@@ -612,14 +616,6 @@ void
AcpiExExitInterpreter (
void);
-void
-AcpiExReacquireInterpreter (
- void);
-
-void
-AcpiExRelinquishInterpreter (
- void);
-
BOOLEAN
AcpiExTruncateFor32bitTable (
ACPI_OPERAND_OBJECT *ObjDesc);
diff --git a/sys/contrib/dev/acpica/include/aclocal.h b/sys/contrib/dev/acpica/include/aclocal.h
index 5ee1430..5f9b0f3 100644
--- a/sys/contrib/dev/acpica/include/aclocal.h
+++ b/sys/contrib/dev/acpica/include/aclocal.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -291,6 +291,7 @@ typedef struct acpi_create_field_info
UINT32 FieldBitPosition;
UINT32 FieldBitLength;
UINT16 ResourceLength;
+ UINT16 PinNumberIndex;
UINT8 FieldFlags;
UINT8 Attribute;
UINT8 FieldType;
@@ -516,9 +517,10 @@ typedef struct acpi_gpe_register_info
{
ACPI_GENERIC_ADDRESS StatusAddress; /* Address of status reg */
ACPI_GENERIC_ADDRESS EnableAddress; /* Address of enable reg */
+ UINT16 BaseGpeNumber; /* Base GPE number for this register */
UINT8 EnableForWake; /* GPEs to keep enabled when sleeping */
UINT8 EnableForRun; /* GPEs to keep enabled when running */
- UINT8 BaseGpeNumber; /* Base GPE number for this register */
+ UINT8 EnableMask; /* Current mask of enabled GPEs */
} ACPI_GPE_REGISTER_INFO;
@@ -534,10 +536,11 @@ typedef struct acpi_gpe_block_info
struct acpi_gpe_xrupt_info *XruptBlock; /* Backpointer to interrupt block */
ACPI_GPE_REGISTER_INFO *RegisterInfo; /* One per GPE register pair */
ACPI_GPE_EVENT_INFO *EventInfo; /* One for each GPE */
- ACPI_GENERIC_ADDRESS BlockAddress; /* Base address of the block */
+ UINT64 Address; /* Base address of the block */
UINT32 RegisterCount; /* Number of register pairs in block */
UINT16 GpeCount; /* Number of individual GPEs in block */
- UINT8 BlockBaseNumber;/* Base GPE number for this block */
+ UINT16 BlockBaseNumber;/* Base GPE number for this block */
+ UINT8 SpaceId;
BOOLEAN Initialized; /* TRUE if this block is initialized */
} ACPI_GPE_BLOCK_INFO;
@@ -867,6 +870,7 @@ typedef union acpi_parse_value
ACPI_DISASM_ONLY_MEMBERS (\
UINT8 DisasmFlags; /* Used during AML disassembly */\
UINT8 DisasmOpcode; /* Subtype used for disassembly */\
+ char *OperatorSymbol;/* Used for C-style operator name strings */\
char AmlOpName[16]) /* Op name (debug only) */
@@ -877,11 +881,13 @@ typedef union acpi_parse_value
#define ACPI_DASM_STRING 0x02 /* Buffer is a ASCII string */
#define ACPI_DASM_UNICODE 0x03 /* Buffer is a Unicode string */
#define ACPI_DASM_PLD_METHOD 0x04 /* Buffer is a _PLD method bit-packed buffer */
-#define ACPI_DASM_EISAID 0x05 /* Integer is an EISAID */
-#define ACPI_DASM_MATCHOP 0x06 /* Parent opcode is a Match() operator */
-#define ACPI_DASM_LNOT_PREFIX 0x07 /* Start of a LNotEqual (etc.) pair of opcodes */
-#define ACPI_DASM_LNOT_SUFFIX 0x08 /* End of a LNotEqual (etc.) pair of opcodes */
-#define ACPI_DASM_IGNORE 0x09 /* Not used at this time */
+#define ACPI_DASM_UUID 0x05 /* Buffer is a UUID/GUID */
+#define ACPI_DASM_EISAID 0x06 /* Integer is an EISAID */
+#define ACPI_DASM_MATCHOP 0x07 /* Parent opcode is a Match() operator */
+#define ACPI_DASM_LNOT_PREFIX 0x08 /* Start of a LNotEqual (etc.) pair of opcodes */
+#define ACPI_DASM_LNOT_SUFFIX 0x09 /* End of a LNotEqual (etc.) pair of opcodes */
+#define ACPI_DASM_HID_STRING 0x0A /* String is a _HID or _CID */
+#define ACPI_DASM_IGNORE 0x0B /* Not used at this time */
/*
* Generic operation (for example: If, While, Store)
@@ -987,6 +993,8 @@ typedef struct acpi_parse_state
#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
#define ACPI_PARSEOP_PREDEF_CHECKED 0x08
#define ACPI_PARSEOP_SPECIAL 0x10
+#define ACPI_PARSEOP_COMPOUND 0x20
+#define ACPI_PARSEOP_ASSIGNMENT 0x40
/*****************************************************************************
@@ -1218,17 +1226,17 @@ typedef struct acpi_external_list
struct acpi_external_list *Next;
UINT32 Value;
UINT16 Length;
+ UINT16 Flags;
UINT8 Type;
- UINT8 Flags;
- BOOLEAN Resolved;
- BOOLEAN Emitted;
} ACPI_EXTERNAL_LIST;
/* Values for Flags field above */
-#define ACPI_IPATH_ALLOCATED 0x01
-#define ACPI_FROM_REFERENCE_FILE 0x02
+#define ACPI_EXT_RESOLVED_REFERENCE 0x01 /* Object was resolved during cross ref */
+#define ACPI_EXT_ORIGIN_FROM_FILE 0x02 /* External came from a file */
+#define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */
+#define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */
typedef struct acpi_external_file
@@ -1259,7 +1267,7 @@ typedef struct acpi_db_method_info
char *Name;
UINT32 Flags;
UINT32 NumLoops;
- char Pathname[128];
+ char Pathname[ACPI_DB_LINE_BUFFER_SIZE];
char **Args;
ACPI_OBJECT_TYPE *Types;
@@ -1286,6 +1294,7 @@ typedef struct acpi_integrity_info
} ACPI_INTEGRITY_INFO;
+#define ACPI_DB_DISABLE_OUTPUT 0x00
#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01
#define ACPI_DB_CONSOLE_OUTPUT 0x02
#define ACPI_DB_DUPLICATE_OUTPUT 0x03
@@ -1348,4 +1357,18 @@ typedef struct ah_predefined_name
} AH_PREDEFINED_NAME;
+typedef struct ah_device_id
+{
+ char *Name;
+ char *Description;
+
+} AH_DEVICE_ID;
+
+typedef struct ah_uuid
+{
+ char *Description;
+ char *String;
+
+} AH_UUID;
+
#endif /* __ACLOCAL_H__ */
diff --git a/sys/contrib/dev/acpica/include/acmacros.h b/sys/contrib/dev/acpica/include/acmacros.h
index 28bd2af..b23d175 100644
--- a/sys/contrib/dev/acpica/include/acmacros.h
+++ b/sys/contrib/dev/acpica/include/acmacros.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -64,17 +64,21 @@
#define ACPI_SET64(ptr, val) (*ACPI_CAST64 (ptr) = (UINT64) (val))
/*
- * printf() format helpers
+ * printf() format helpers. These macros are workarounds for the difficulties
+ * with emitting 64-bit integers and 64-bit pointers with the same code
+ * for both 32-bit and 64-bit hosts.
*/
-
-/* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */
-
#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i)
#if ACPI_MACHINE_WIDTH == 64
#define ACPI_FORMAT_NATIVE_UINT(i) ACPI_FORMAT_UINT64(i)
+#define ACPI_FORMAT_TO_UINT(i) ACPI_FORMAT_UINT64(i)
+#define ACPI_PRINTF_UINT "0x%8.8X%8.8X"
+
#else
-#define ACPI_FORMAT_NATIVE_UINT(i) 0, (i)
+#define ACPI_FORMAT_NATIVE_UINT(i) 0, (UINT32) (i)
+#define ACPI_FORMAT_TO_UINT(i) (UINT32) (i)
+#define ACPI_PRINTF_UINT "0x%8.8X"
#endif
@@ -415,32 +419,6 @@
/*
- * Memory allocation tracking (DEBUG ONLY)
- */
-#define ACPI_MEM_PARAMETERS _COMPONENT, _AcpiModuleName, __LINE__
-
-#ifndef ACPI_DBG_TRACK_ALLOCATIONS
-
-/* Memory allocation */
-
-#define ACPI_ALLOCATE(a) AcpiUtAllocate((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
-#define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroed((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
-#define ACPI_FREE(a) AcpiOsFree(a)
-#define ACPI_MEM_TRACKING(a)
-
-#else
-
-/* Memory allocation */
-
-#define ACPI_ALLOCATE(a) AcpiUtAllocateAndTrack((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
-#define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroedAndTrack((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
-#define ACPI_FREE(a) AcpiUtFreeAndTrack(a, ACPI_MEM_PARAMETERS)
-#define ACPI_MEM_TRACKING(a) a
-
-#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
-
-
-/*
* Macros used for ACPICA utilities only
*/
diff --git a/sys/contrib/dev/acpica/include/acnames.h b/sys/contrib/dev/acpica/include/acnames.h
index d6fdaa6..6bb6bbf 100644
--- a/sys/contrib/dev/acpica/include/acnames.h
+++ b/sys/contrib/dev/acpica/include/acnames.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -46,24 +46,31 @@
/* Method names - these methods can appear anywhere in the namespace */
-#define METHOD_NAME__SB_ "_SB_"
-#define METHOD_NAME__HID "_HID"
-#define METHOD_NAME__CID "_CID"
-#define METHOD_NAME__UID "_UID"
-#define METHOD_NAME__SUB "_SUB"
#define METHOD_NAME__ADR "_ADR"
-#define METHOD_NAME__INI "_INI"
-#define METHOD_NAME__STA "_STA"
-#define METHOD_NAME__REG "_REG"
-#define METHOD_NAME__SEG "_SEG"
+#define METHOD_NAME__AEI "_AEI"
#define METHOD_NAME__BBN "_BBN"
-#define METHOD_NAME__PRT "_PRT"
+#define METHOD_NAME__CBA "_CBA"
+#define METHOD_NAME__CID "_CID"
#define METHOD_NAME__CRS "_CRS"
+#define METHOD_NAME__DDN "_DDN"
+#define METHOD_NAME__HID "_HID"
+#define METHOD_NAME__INI "_INI"
+#define METHOD_NAME__PLD "_PLD"
+#define METHOD_NAME__DSD "_DSD"
#define METHOD_NAME__PRS "_PRS"
-#define METHOD_NAME__AEI "_AEI"
+#define METHOD_NAME__PRT "_PRT"
#define METHOD_NAME__PRW "_PRW"
+#define METHOD_NAME__PS0 "_PS0"
+#define METHOD_NAME__PS1 "_PS1"
+#define METHOD_NAME__PS2 "_PS2"
+#define METHOD_NAME__PS3 "_PS3"
+#define METHOD_NAME__REG "_REG"
+#define METHOD_NAME__SB_ "_SB_"
+#define METHOD_NAME__SEG "_SEG"
#define METHOD_NAME__SRS "_SRS"
-#define METHOD_NAME__PLD "_PLD"
+#define METHOD_NAME__STA "_STA"
+#define METHOD_NAME__SUB "_SUB"
+#define METHOD_NAME__UID "_UID"
/* Method names - these methods must appear at the namespace root */
diff --git a/sys/contrib/dev/acpica/include/acnamesp.h b/sys/contrib/dev/acpica/include/acnamesp.h
index 2dba629..07e76b5 100644
--- a/sys/contrib/dev/acpica/include/acnamesp.h
+++ b/sys/contrib/dev/acpica/include/acnamesp.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acobject.h b/sys/contrib/dev/acpica/include/acobject.h
index e755daa..b7b624b 100644
--- a/sys/contrib/dev/acpica/include/acobject.h
+++ b/sys/contrib/dev/acpica/include/acobject.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -232,7 +232,8 @@ typedef struct acpi_object_method
#define ACPI_METHOD_INTERNAL_ONLY 0x02 /* Method is implemented internally (_OSI) */
#define ACPI_METHOD_SERIALIZED 0x04 /* Method is serialized */
#define ACPI_METHOD_SERIALIZED_PENDING 0x08 /* Method is to be marked serialized */
-#define ACPI_METHOD_MODIFIED_NAMESPACE 0x10 /* Method modified the namespace */
+#define ACPI_METHOD_IGNORE_SYNC_LEVEL 0x10 /* Method was auto-serialized at table load time */
+#define ACPI_METHOD_MODIFIED_NAMESPACE 0x20 /* Method modified the namespace */
/******************************************************************************
@@ -337,6 +338,7 @@ typedef struct acpi_object_region_field
UINT16 ResourceLength;
union acpi_operand_object *RegionObj; /* Containing OpRegion object */
UINT8 *ResourceBuffer; /* ResourceTemplate for serial regions/fields */
+ UINT16 PinNumberIndex; /* Index relative to previous Connection/Template */
} ACPI_OBJECT_REGION_FIELD;
diff --git a/sys/contrib/dev/acpica/include/acopcode.h b/sys/contrib/dev/acpica/include/acopcode.h
index ba37842..f4ba55d 100644
--- a/sys/contrib/dev/acpica/include/acopcode.h
+++ b/sys/contrib/dev/acpica/include/acopcode.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acoutput.h b/sys/contrib/dev/acpica/include/acoutput.h
index e7b1248..ab07809 100644
--- a/sys/contrib/dev/acpica/include/acoutput.h
+++ b/sys/contrib/dev/acpica/include/acoutput.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acparser.h b/sys/contrib/dev/acpica/include/acparser.h
index 7f236d8..4ad2ec2 100644
--- a/sys/contrib/dev/acpica/include/acparser.h
+++ b/sys/contrib/dev/acpica/include/acparser.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#ifndef __ACPARSER_H__
#define __ACPARSER_H__
diff --git a/sys/contrib/dev/acpica/include/acpi.h b/sys/contrib/dev/acpica/include/acpi.h
index 5450ad4..c57d4e3 100644
--- a/sys/contrib/dev/acpica/include/acpi.h
+++ b/sys/contrib/dev/acpica/include/acpi.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -62,5 +62,6 @@
#include <contrib/dev/acpica/include/acrestyp.h> /* Resource Descriptor structs */
#include <contrib/dev/acpica/include/acpiosxf.h> /* OSL interfaces (ACPICA-to-OS) */
#include <contrib/dev/acpica/include/acpixf.h> /* ACPI core subsystem external interfaces */
+#include <contrib/dev/acpica/include/platform/acenvex.h> /* Extra environment-specific items */
#endif /* __ACPI_H__ */
diff --git a/sys/contrib/dev/acpica/include/acpiosxf.h b/sys/contrib/dev/acpica/include/acpiosxf.h
index c948d3f..21cac7a 100644
--- a/sys/contrib/dev/acpica/include/acpiosxf.h
+++ b/sys/contrib/dev/acpica/include/acpiosxf.h
@@ -6,9 +6,8 @@
*
*****************************************************************************/
-
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -85,85 +84,111 @@ typedef struct acpi_signal_fatal_info
/*
* OSL Initialization and shutdown primitives
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInitialize
ACPI_STATUS
AcpiOsInitialize (
void);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTerminate
ACPI_STATUS
AcpiOsTerminate (
void);
+#endif
/*
* ACPI Table interfaces
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetRootPointer
ACPI_PHYSICAL_ADDRESS
AcpiOsGetRootPointer (
void);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPredefinedOverride
ACPI_STATUS
AcpiOsPredefinedOverride (
const ACPI_PREDEFINED_NAMES *InitVal,
ACPI_STRING *NewVal);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTableOverride
ACPI_STATUS
AcpiOsTableOverride (
ACPI_TABLE_HEADER *ExistingTable,
ACPI_TABLE_HEADER **NewTable);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPhysicalTableOverride
ACPI_STATUS
AcpiOsPhysicalTableOverride (
ACPI_TABLE_HEADER *ExistingTable,
ACPI_PHYSICAL_ADDRESS *NewAddress,
UINT32 *NewTableLength);
+#endif
/*
* Spinlock primitives
*/
-#ifndef AcpiOsCreateLock
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateLock
ACPI_STATUS
AcpiOsCreateLock (
ACPI_SPINLOCK *OutHandle);
#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteLock
void
AcpiOsDeleteLock (
ACPI_SPINLOCK Handle);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireLock
ACPI_CPU_FLAGS
AcpiOsAcquireLock (
ACPI_SPINLOCK Handle);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseLock
void
AcpiOsReleaseLock (
ACPI_SPINLOCK Handle,
ACPI_CPU_FLAGS Flags);
+#endif
/*
* Semaphore primitives
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateSemaphore
ACPI_STATUS
AcpiOsCreateSemaphore (
UINT32 MaxUnits,
UINT32 InitialUnits,
ACPI_SEMAPHORE *OutHandle);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteSemaphore
ACPI_STATUS
AcpiOsDeleteSemaphore (
ACPI_SEMAPHORE Handle);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWaitSemaphore
ACPI_STATUS
AcpiOsWaitSemaphore (
ACPI_SEMAPHORE Handle,
UINT32 Units,
UINT16 Timeout);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSignalSemaphore
ACPI_STATUS
AcpiOsSignalSemaphore (
ACPI_SEMAPHORE Handle,
UINT32 Units);
+#endif
/*
@@ -172,151 +197,208 @@ AcpiOsSignalSemaphore (
*/
#if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE)
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateMutex
ACPI_STATUS
AcpiOsCreateMutex (
ACPI_MUTEX *OutHandle);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteMutex
void
AcpiOsDeleteMutex (
ACPI_MUTEX Handle);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireMutex
ACPI_STATUS
AcpiOsAcquireMutex (
ACPI_MUTEX Handle,
UINT16 Timeout);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseMutex
void
AcpiOsReleaseMutex (
ACPI_MUTEX Handle);
#endif
+#endif
+
/*
* Memory allocation and mapping
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocate
void *
AcpiOsAllocate (
ACPI_SIZE Size);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocateZeroed
+void *
+AcpiOsAllocateZeroed (
+ ACPI_SIZE Size);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsFree
void
AcpiOsFree (
void * Memory);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsMapMemory
void *
AcpiOsMapMemory (
ACPI_PHYSICAL_ADDRESS Where,
ACPI_SIZE Length);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsUnmapMemory
void
AcpiOsUnmapMemory (
void *LogicalAddress,
ACPI_SIZE Size);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetPhysicalAddress
ACPI_STATUS
AcpiOsGetPhysicalAddress (
void *LogicalAddress,
ACPI_PHYSICAL_ADDRESS *PhysicalAddress);
+#endif
/*
* Memory/Object Cache
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateCache
ACPI_STATUS
AcpiOsCreateCache (
char *CacheName,
UINT16 ObjectSize,
UINT16 MaxDepth,
ACPI_CACHE_T **ReturnCache);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteCache
ACPI_STATUS
AcpiOsDeleteCache (
ACPI_CACHE_T *Cache);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPurgeCache
ACPI_STATUS
AcpiOsPurgeCache (
ACPI_CACHE_T *Cache);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireObject
void *
AcpiOsAcquireObject (
ACPI_CACHE_T *Cache);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseObject
ACPI_STATUS
AcpiOsReleaseObject (
ACPI_CACHE_T *Cache,
void *Object);
+#endif
/*
* Interrupt handlers
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInstallInterruptHandler
ACPI_STATUS
AcpiOsInstallInterruptHandler (
UINT32 InterruptNumber,
ACPI_OSD_HANDLER ServiceRoutine,
void *Context);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRemoveInterruptHandler
ACPI_STATUS
AcpiOsRemoveInterruptHandler (
UINT32 InterruptNumber,
ACPI_OSD_HANDLER ServiceRoutine);
+#endif
/*
* Threads and Scheduling
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetThreadId
ACPI_THREAD_ID
AcpiOsGetThreadId (
void);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsExecute
ACPI_STATUS
AcpiOsExecute (
ACPI_EXECUTE_TYPE Type,
ACPI_OSD_EXEC_CALLBACK Function,
void *Context);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWaitEventsComplete
void
AcpiOsWaitEventsComplete (
void);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSleep
void
AcpiOsSleep (
UINT64 Milliseconds);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsStall
void
AcpiOsStall (
UINT32 Microseconds);
+#endif
/*
* Platform and hardware-independent I/O interfaces
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadPort
ACPI_STATUS
AcpiOsReadPort (
ACPI_IO_ADDRESS Address,
UINT32 *Value,
UINT32 Width);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritePort
ACPI_STATUS
AcpiOsWritePort (
ACPI_IO_ADDRESS Address,
UINT32 Value,
UINT32 Width);
+#endif
/*
* Platform and hardware-independent physical memory interfaces
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadMemory
ACPI_STATUS
AcpiOsReadMemory (
ACPI_PHYSICAL_ADDRESS Address,
UINT64 *Value,
UINT32 Width);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWriteMemory
ACPI_STATUS
AcpiOsWriteMemory (
ACPI_PHYSICAL_ADDRESS Address,
UINT64 Value,
UINT32 Width);
+#endif
/*
@@ -324,103 +406,131 @@ AcpiOsWriteMemory (
* Note: Can't use "Register" as a parameter, changed to "Reg" --
* certain compilers complain.
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadPciConfiguration
ACPI_STATUS
AcpiOsReadPciConfiguration (
ACPI_PCI_ID *PciId,
UINT32 Reg,
UINT64 *Value,
UINT32 Width);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritePciConfiguration
ACPI_STATUS
AcpiOsWritePciConfiguration (
ACPI_PCI_ID *PciId,
UINT32 Reg,
UINT64 Value,
UINT32 Width);
+#endif
/*
* Miscellaneous
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadable
BOOLEAN
AcpiOsReadable (
void *Pointer,
ACPI_SIZE Length);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritable
BOOLEAN
AcpiOsWritable (
void *Pointer,
ACPI_SIZE Length);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTimer
UINT64
AcpiOsGetTimer (
void);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSignal
ACPI_STATUS
AcpiOsSignal (
UINT32 Function,
void *Info);
+#endif
/*
* Debug print routines
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPrintf
void ACPI_INTERNAL_VAR_XFACE
AcpiOsPrintf (
const char *Format,
...);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsVprintf
void
AcpiOsVprintf (
const char *Format,
va_list Args);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRedirectOutput
void
AcpiOsRedirectOutput (
void *Destination);
+#endif
/*
* Debug input
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetLine
ACPI_STATUS
AcpiOsGetLine (
char *Buffer,
UINT32 BufferLength,
UINT32 *BytesRead);
+#endif
/*
* Obtain ACPI table(s)
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByName
ACPI_STATUS
AcpiOsGetTableByName (
char *Signature,
UINT32 Instance,
ACPI_TABLE_HEADER **Table,
ACPI_PHYSICAL_ADDRESS *Address);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByIndex
ACPI_STATUS
AcpiOsGetTableByIndex (
UINT32 Index,
ACPI_TABLE_HEADER **Table,
UINT32 *Instance,
ACPI_PHYSICAL_ADDRESS *Address);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByAddress
ACPI_STATUS
AcpiOsGetTableByAddress (
ACPI_PHYSICAL_ADDRESS Address,
ACPI_TABLE_HEADER **Table);
+#endif
/*
* Directory manipulation
*/
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenDirectory
void *
AcpiOsOpenDirectory (
char *Pathname,
char *WildcardSpec,
char RequestedFileType);
+#endif
/* RequesteFileType values */
@@ -428,13 +538,66 @@ AcpiOsOpenDirectory (
#define REQUEST_DIR_ONLY 1
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetNextFilename
char *
AcpiOsGetNextFilename (
void *DirHandle);
+#endif
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseDirectory
void
AcpiOsCloseDirectory (
void *DirHandle);
+#endif
+
+
+/*
+ * File I/O and related support
+ */
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenFile
+ACPI_FILE
+AcpiOsOpenFile (
+ const char *Path,
+ UINT8 Modes);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseFile
+void
+AcpiOsCloseFile (
+ ACPI_FILE File);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadFile
+int
+AcpiOsReadFile (
+ ACPI_FILE File,
+ void *Buffer,
+ ACPI_SIZE Size,
+ ACPI_SIZE Count);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWriteFile
+int
+AcpiOsWriteFile (
+ ACPI_FILE File,
+ void *Buffer,
+ ACPI_SIZE Size,
+ ACPI_SIZE Count);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetFileOffset
+long
+AcpiOsGetFileOffset (
+ ACPI_FILE File);
+#endif
+
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSetFileOffset
+ACPI_STATUS
+AcpiOsSetFileOffset (
+ ACPI_FILE File,
+ long Offset,
+ UINT8 From);
+#endif
#endif /* __ACPIOSXF_H__ */
diff --git a/sys/contrib/dev/acpica/include/acpixf.h b/sys/contrib/dev/acpica/include/acpixf.h
index 80f724a..26988ab 100644
--- a/sys/contrib/dev/acpica/include/acpixf.h
+++ b/sys/contrib/dev/acpica/include/acpixf.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,62 +41,258 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#ifndef __ACXFACE_H__
#define __ACXFACE_H__
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20130823
+#define ACPI_CA_VERSION 0x20150204
#include <contrib/dev/acpica/include/acconfig.h>
#include <contrib/dev/acpica/include/actypes.h>
#include <contrib/dev/acpica/include/actbl.h>
#include <contrib/dev/acpica/include/acbuffer.h>
+
+/*****************************************************************************
+ *
+ * Macros used for ACPICA globals and configuration
+ *
+ ****************************************************************************/
+
+/*
+ * Ensure that global variables are defined and initialized only once.
+ *
+ * The use of these macros allows for a single list of globals (here)
+ * in order to simplify maintenance of the code.
+ */
+#ifdef DEFINE_ACPI_GLOBALS
+#define ACPI_GLOBAL(type,name) \
+ extern type name; \
+ type name
+
+#define ACPI_INIT_GLOBAL(type,name,value) \
+ type name=value
+
+#else
+#ifndef ACPI_GLOBAL
+#define ACPI_GLOBAL(type,name) \
+ extern type name
+#endif
+
+#ifndef ACPI_INIT_GLOBAL
+#define ACPI_INIT_GLOBAL(type,name,value) \
+ extern type name
+#endif
+#endif
+
+/*
+ * These macros configure the various ACPICA interfaces. They are
+ * useful for generating stub inline functions for features that are
+ * configured out of the current kernel or ACPICA application.
+ */
+#ifndef ACPI_EXTERNAL_RETURN_STATUS
+#define ACPI_EXTERNAL_RETURN_STATUS(Prototype) \
+ Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_OK
+#define ACPI_EXTERNAL_RETURN_OK(Prototype) \
+ Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_VOID
+#define ACPI_EXTERNAL_RETURN_VOID(Prototype) \
+ Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_UINT32
+#define ACPI_EXTERNAL_RETURN_UINT32(Prototype) \
+ Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_PTR
+#define ACPI_EXTERNAL_RETURN_PTR(Prototype) \
+ Prototype;
+#endif
+
+
+/*****************************************************************************
+ *
+ * Public globals and runtime configuration options
+ *
+ ****************************************************************************/
+
/*
- * Globals that are publically available
+ * Enable "slack mode" of the AML interpreter? Default is FALSE, and the
+ * interpreter strictly follows the ACPI specification. Setting to TRUE
+ * allows the interpreter to ignore certain errors and/or bad AML constructs.
+ *
+ * Currently, these features are enabled by this flag:
+ *
+ * 1) Allow "implicit return" of last value in a control method
+ * 2) Allow access beyond the end of an operation region
+ * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
+ * 4) Allow ANY object type to be a source operand for the Store() operator
+ * 5) Allow unresolved references (invalid target name) in package objects
+ * 6) Enable warning messages for behavior that is not ACPI spec compliant
*/
-extern UINT32 AcpiCurrentGpeCount;
-extern ACPI_TABLE_FADT AcpiGbl_FADT;
-extern BOOLEAN AcpiGbl_SystemAwakeAndRunning;
-extern BOOLEAN AcpiGbl_ReducedHardware; /* ACPI 5.0 */
-extern UINT8 AcpiGbl_OsiData;
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableInterpreterSlack, FALSE);
-/* Runtime configuration of debug print levels */
+/*
+ * Automatically serialize all methods that create named objects? Default
+ * is TRUE, meaning that all NonSerialized methods are scanned once at
+ * table load time to determine those that create named objects. Methods
+ * that create named objects are marked Serialized in order to prevent
+ * possible run-time problems if they are entered by more than one thread.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_AutoSerializeMethods, TRUE);
-extern UINT32 AcpiDbgLevel;
-extern UINT32 AcpiDbgLayer;
+/*
+ * Create the predefined _OSI method in the namespace? Default is TRUE
+ * because ACPICA is fully compatible with other ACPI implementations.
+ * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CreateOsiMethod, TRUE);
-/* ACPICA runtime options */
+/*
+ * Optionally use default values for the ACPI register widths. Set this to
+ * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_UseDefaultRegisterWidths, TRUE);
+
+/*
+ * Whether or not to verify the table checksum before installation. Set
+ * this to TRUE to verify the table checksum before install it to the table
+ * manager. Note that enabling this option causes errors to happen in some
+ * OSPMs during early initialization stages. Default behavior is to do such
+ * verification.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_VerifyTableChecksum, TRUE);
+
+/*
+ * Optionally enable output from the AML Debug Object.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableAmlDebugObject, FALSE);
+
+/*
+ * Optionally copy the entire DSDT to local memory (instead of simply
+ * mapping it.) There are some BIOSs that corrupt or replace the original
+ * DSDT, creating the need for this option. Default is FALSE, do not copy
+ * the DSDT.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CopyDsdtLocally, FALSE);
+
+/*
+ * Optionally ignore an XSDT if present and use the RSDT instead.
+ * Although the ACPI specification requires that an XSDT be used instead
+ * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
+ * some machines. Default behavior is to use the XSDT if present.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE);
+
+/*
+ * Optionally use 32-bit FADT addresses if and when there is a conflict
+ * (address mismatch) between the 32-bit and 64-bit versions of the
+ * address. Although ACPICA adheres to the ACPI specification which
+ * requires the use of the corresponding 64-bit address if it is non-zero,
+ * some machines have been found to have a corrupted non-zero 64-bit
+ * address. Default is FALSE, do not favor the 32-bit addresses.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_Use32BitFadtAddresses, FALSE);
+
+/*
+ * Optionally truncate I/O addresses to 16 bits. Provides compatibility
+ * with other ACPI implementations. NOTE: During ACPICA initialization,
+ * this value is set to TRUE if any Windows OSI strings have been
+ * requested by the BIOS.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_TruncateIoAddresses, FALSE);
+
+/*
+ * Disable runtime checking and repair of values returned by control methods.
+ * Use only if the repair is causing a problem on a particular machine.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableAutoRepair, FALSE);
+
+/*
+ * Optionally do not install any SSDTs from the RSDT/XSDT during initialization.
+ * This can be useful for debugging ACPI problems on some machines.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableSsdtTableInstall, FALSE);
+
+/*
+ * We keep track of the latest version of Windows that has been requested by
+ * the BIOS. ACPI 5.0.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_OsiData, 0);
+
+/*
+ * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
+ * that the ACPI hardware is no longer required. A flag in the FADT indicates
+ * a reduced HW machine, and that flag is duplicated here for convenience.
+ */
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ReducedHardware, FALSE);
+
+/*
+ * This mechanism is used to trace a specified AML method. The method is
+ * traced each time it is executed.
+ */
+ACPI_INIT_GLOBAL (UINT32, AcpiGbl_TraceFlags, 0);
+ACPI_INIT_GLOBAL (ACPI_NAME, AcpiGbl_TraceMethodName, 0);
+
+/*
+ * Runtime configuration of debug output control masks. We want the debug
+ * switches statically initialized so they are already set when the debugger
+ * is entered.
+ */
+#ifdef ACPI_DEBUG_OUTPUT
+ACPI_INIT_GLOBAL (UINT32, AcpiDbgLevel, ACPI_DEBUG_DEFAULT);
+#else
+ACPI_INIT_GLOBAL (UINT32, AcpiDbgLevel, ACPI_NORMAL_DEFAULT);
+#endif
+ACPI_INIT_GLOBAL (UINT32, AcpiDbgLayer, ACPI_COMPONENT_DEFAULT);
+
+/*
+ * Other miscellaneous globals
+ */
+ACPI_GLOBAL (ACPI_TABLE_FADT, AcpiGbl_FADT);
+ACPI_GLOBAL (UINT32, AcpiCurrentGpeCount);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_SystemAwakeAndRunning);
-extern UINT8 AcpiGbl_EnableInterpreterSlack;
-extern UINT8 AcpiGbl_AllMethodsSerialized;
-extern UINT8 AcpiGbl_CreateOsiMethod;
-extern UINT8 AcpiGbl_UseDefaultRegisterWidths;
-extern ACPI_NAME AcpiGbl_TraceMethodName;
-extern UINT32 AcpiGbl_TraceFlags;
-extern UINT8 AcpiGbl_EnableAmlDebugObject;
-extern UINT8 AcpiGbl_CopyDsdtLocally;
-extern UINT8 AcpiGbl_TruncateIoAddresses;
-extern UINT8 AcpiGbl_DisableAutoRepair;
-extern UINT8 AcpiGbl_DisableSsdtTableLoad;
+/*****************************************************************************
+ *
+ * ACPICA public interface configuration.
+ *
+ * Interfaces that are configured out of the ACPICA build are replaced
+ * by inlined stubs by default.
+ *
+ ****************************************************************************/
/*
- * Hardware-reduced prototypes. All interfaces that use these macros will
- * be configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
+ * Hardware-reduced prototypes (default: Not hardware reduced).
+ *
+ * All ACPICA hardware-related interfaces that use these macros will be
+ * configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
* is set to TRUE.
+ *
+ * Note: This static build option for reduced hardware is intended to
+ * reduce ACPICA code size if desired or necessary. However, even if this
+ * option is not specified, the runtime behavior of ACPICA is dependent
+ * on the actual FADT reduced hardware flag (HW_REDUCED_ACPI). If set,
+ * the flag will enable similar behavior -- ACPICA will not attempt
+ * to access any ACPI-relate hardware (SCI, GPEs, Fixed Events, etc.)
*/
#if (!ACPI_REDUCED_HARDWARE)
#define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \
- Prototype;
+ ACPI_EXTERNAL_RETURN_STATUS(Prototype)
#define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \
- Prototype;
+ ACPI_EXTERNAL_RETURN_OK(Prototype)
#define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
- Prototype;
+ ACPI_EXTERNAL_RETURN_VOID(Prototype)
#else
#define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \
@@ -106,35 +302,100 @@ extern UINT8 AcpiGbl_DisableSsdtTableLoad;
static ACPI_INLINE Prototype {return(AE_OK);}
#define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
- static ACPI_INLINE Prototype {}
+ static ACPI_INLINE Prototype {return;}
#endif /* !ACPI_REDUCED_HARDWARE */
/*
+ * Error message prototypes (default: error messages enabled).
+ *
+ * All interfaces related to error and warning messages
+ * will be configured out of the ACPICA build if the
+ * ACPI_NO_ERROR_MESSAGE flag is defined.
+ */
+#ifndef ACPI_NO_ERROR_MESSAGES
+#define ACPI_MSG_DEPENDENT_RETURN_VOID(Prototype) \
+ Prototype;
+
+#else
+#define ACPI_MSG_DEPENDENT_RETURN_VOID(Prototype) \
+ static ACPI_INLINE Prototype {return;}
+
+#endif /* ACPI_NO_ERROR_MESSAGES */
+
+
+/*
+ * Debugging output prototypes (default: no debug output).
+ *
+ * All interfaces related to debug output messages
+ * will be configured out of the ACPICA build unless the
+ * ACPI_DEBUG_OUTPUT flag is defined.
+ */
+#ifdef ACPI_DEBUG_OUTPUT
+#define ACPI_DBG_DEPENDENT_RETURN_VOID(Prototype) \
+ Prototype;
+
+#else
+#define ACPI_DBG_DEPENDENT_RETURN_VOID(Prototype) \
+ static ACPI_INLINE Prototype {return;}
+
+#endif /* ACPI_DEBUG_OUTPUT */
+
+
+/*
+ * Application prototypes
+ *
+ * All interfaces used by application will be configured
+ * out of the ACPICA build unless the ACPI_APPLICATION
+ * flag is defined.
+ */
+#ifdef ACPI_APPLICATION
+#define ACPI_APP_DEPENDENT_RETURN_VOID(Prototype) \
+ Prototype;
+
+#else
+#define ACPI_APP_DEPENDENT_RETURN_VOID(Prototype) \
+ static ACPI_INLINE Prototype {return;}
+
+#endif /* ACPI_APPLICATION */
+
+
+/*****************************************************************************
+ *
+ * ACPICA public interface prototypes
+ *
+ ****************************************************************************/
+
+/*
* Initialization
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInitializeTables (
ACPI_TABLE_DESC *InitialStorage,
UINT32 InitialTableCount,
- BOOLEAN AllowResize);
+ BOOLEAN AllowResize))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInitializeSubsystem (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEnableSubsystem (
- UINT32 Flags);
+ UINT32 Flags))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInitializeObjects (
- UINT32 Flags);
+ UINT32 Flags))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiTerminate (
- void);
+ void))
/*
@@ -150,124 +411,136 @@ ACPI_STATUS
AcpiDisable (
void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiSubsystemStatus (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetSystemInfo (
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetStatistics (
- ACPI_STATISTICS *Stats);
+ ACPI_STATISTICS *Stats))
+ACPI_EXTERNAL_RETURN_PTR (
const char *
AcpiFormatException (
- ACPI_STATUS Exception);
+ ACPI_STATUS Exception))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiPurgeCachedObjects (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallInterface (
- ACPI_STRING InterfaceName);
+ ACPI_STRING InterfaceName))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveInterface (
- ACPI_STRING InterfaceName);
+ ACPI_STRING InterfaceName))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiUpdateInterfaces (
- UINT8 Action);
+ UINT8 Action))
+ACPI_EXTERNAL_RETURN_UINT32 (
UINT32
AcpiCheckAddressRange (
ACPI_ADR_SPACE_TYPE SpaceId,
ACPI_PHYSICAL_ADDRESS Address,
ACPI_SIZE Length,
- BOOLEAN Warn);
+ BOOLEAN Warn))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiDecodePldBuffer (
UINT8 *InBuffer,
ACPI_SIZE Length,
- ACPI_PLD_INFO **ReturnBuffer);
-
-/*
- * ACPI Memory management
- */
-void *
-AcpiAllocate (
- UINT32 Size);
-
-void *
-AcpiCallocate (
- UINT32 Size);
-
-void
-AcpiFree (
- void *Address);
+ ACPI_PLD_INFO **ReturnBuffer))
/*
* ACPI table load/unload interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
+ACPI_STATUS
+AcpiInstallTable (
+ ACPI_PHYSICAL_ADDRESS Address,
+ BOOLEAN Physical))
+
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiLoadTable (
- ACPI_TABLE_HEADER *Table);
+ ACPI_TABLE_HEADER *Table))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiUnloadParentTable (
- ACPI_HANDLE Object);
+ ACPI_HANDLE Object))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiLoadTables (
- void);
+ void))
/*
* ACPI table manipulation interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiReallocateRootTable (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiFindRootPointer (
- ACPI_SIZE *RsdpAddress);
+ ACPI_SIZE *RsdpAddress))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetTableHeader (
ACPI_STRING Signature,
UINT32 Instance,
- ACPI_TABLE_HEADER *OutTableHeader);
+ ACPI_TABLE_HEADER *OutTableHeader))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetTable (
ACPI_STRING Signature,
UINT32 Instance,
- ACPI_TABLE_HEADER **OutTable);
+ ACPI_TABLE_HEADER **OutTable))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetTableByIndex (
UINT32 TableIndex,
- ACPI_TABLE_HEADER **OutTable);
+ ACPI_TABLE_HEADER **OutTable))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallTableHandler (
ACPI_TABLE_HANDLER Handler,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveTableHandler (
- ACPI_TABLE_HANDLER Handler);
+ ACPI_TABLE_HANDLER Handler))
/*
* Namespace and name interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiWalkNamespace (
ACPI_OBJECT_TYPE Type,
@@ -276,104 +549,119 @@ AcpiWalkNamespace (
ACPI_WALK_CALLBACK DescendingCallback,
ACPI_WALK_CALLBACK AscendingCallback,
void *Context,
- void **ReturnValue);
+ void **ReturnValue))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetDevices (
char *HID,
ACPI_WALK_CALLBACK UserFunction,
void *Context,
- void **ReturnValue);
+ void **ReturnValue))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetName (
ACPI_HANDLE Object,
UINT32 NameType,
- ACPI_BUFFER *RetPathPtr);
+ ACPI_BUFFER *RetPathPtr))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetHandle (
ACPI_HANDLE Parent,
ACPI_STRING Pathname,
- ACPI_HANDLE *RetHandle);
+ ACPI_HANDLE *RetHandle))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiAttachData (
ACPI_HANDLE Object,
ACPI_OBJECT_HANDLER Handler,
- void *Data);
+ void *Data))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiDetachData (
ACPI_HANDLE Object,
- ACPI_OBJECT_HANDLER Handler);
+ ACPI_OBJECT_HANDLER Handler))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetData (
ACPI_HANDLE Object,
ACPI_OBJECT_HANDLER Handler,
- void **Data);
+ void **Data))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiDebugTrace (
char *Name,
UINT32 DebugLevel,
UINT32 DebugLayer,
- UINT32 Flags);
+ UINT32 Flags))
/*
* Object manipulation and enumeration
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEvaluateObject (
ACPI_HANDLE Object,
ACPI_STRING Pathname,
ACPI_OBJECT_LIST *ParameterObjects,
- ACPI_BUFFER *ReturnObjectBuffer);
+ ACPI_BUFFER *ReturnObjectBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEvaluateObjectTyped (
ACPI_HANDLE Object,
ACPI_STRING Pathname,
ACPI_OBJECT_LIST *ExternalParams,
ACPI_BUFFER *ReturnBuffer,
- ACPI_OBJECT_TYPE ReturnType);
+ ACPI_OBJECT_TYPE ReturnType))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetObjectInfo (
ACPI_HANDLE Object,
- ACPI_DEVICE_INFO **ReturnBuffer);
+ ACPI_DEVICE_INFO **ReturnBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallMethod (
- UINT8 *Buffer);
+ UINT8 *Buffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetNextObject (
ACPI_OBJECT_TYPE Type,
ACPI_HANDLE Parent,
ACPI_HANDLE Child,
- ACPI_HANDLE *OutHandle);
+ ACPI_HANDLE *OutHandle))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetType (
ACPI_HANDLE Object,
- ACPI_OBJECT_TYPE *OutType);
+ ACPI_OBJECT_TYPE *OutType))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetParent (
ACPI_HANDLE Object,
- ACPI_HANDLE *OutHandle);
+ ACPI_HANDLE *OutHandle))
/*
* Handler interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallInitializationHandler (
ACPI_INIT_HANDLER Handler,
- UINT32 Function);
+ UINT32 Function))
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
@@ -416,45 +704,60 @@ AcpiInstallGpeHandler (
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
+AcpiInstallGpeRawHandler (
+ ACPI_HANDLE GpeDevice,
+ UINT32 GpeNumber,
+ UINT32 Type,
+ ACPI_GPE_HANDLER Address,
+ void *Context))
+
+ACPI_HW_DEPENDENT_RETURN_STATUS (
+ACPI_STATUS
AcpiRemoveGpeHandler (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
ACPI_GPE_HANDLER Address))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallNotifyHandler (
ACPI_HANDLE Device,
UINT32 HandlerType,
ACPI_NOTIFY_HANDLER Handler,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveNotifyHandler (
ACPI_HANDLE Device,
UINT32 HandlerType,
- ACPI_NOTIFY_HANDLER Handler);
+ ACPI_NOTIFY_HANDLER Handler))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallAddressSpaceHandler (
ACPI_HANDLE Device,
ACPI_ADR_SPACE_TYPE SpaceId,
ACPI_ADR_SPACE_HANDLER Handler,
ACPI_ADR_SPACE_SETUP Setup,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveAddressSpaceHandler (
ACPI_HANDLE Device,
ACPI_ADR_SPACE_TYPE SpaceId,
- ACPI_ADR_SPACE_HANDLER Handler);
+ ACPI_ADR_SPACE_HANDLER Handler))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallExceptionHandler (
- ACPI_EXCEPTION_HANDLER Handler);
+ ACPI_EXCEPTION_HANDLER Handler))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallInterfaceHandler (
- ACPI_INTERFACE_HANDLER Handler);
+ ACPI_INTERFACE_HANDLER Handler))
/*
@@ -475,16 +778,18 @@ AcpiReleaseGlobalLock (
/*
* Interfaces to AML mutex objects
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiAcquireMutex (
ACPI_HANDLE Handle,
ACPI_STRING Pathname,
- UINT16 Timeout);
+ UINT16 Timeout))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiReleaseMutex (
ACPI_HANDLE Handle,
- ACPI_STRING Pathname);
+ ACPI_STRING Pathname))
/*
@@ -555,6 +860,12 @@ AcpiFinishGpe (
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
+AcpiMarkGpeForWake (
+ ACPI_HANDLE GpeDevice,
+ UINT32 GpeNumber))
+
+ACPI_HW_DEPENDENT_RETURN_STATUS (
+ACPI_STATUS
AcpiSetupGpeForWake (
ACPI_HANDLE ParentDevice,
ACPI_HANDLE GpeDevice,
@@ -586,6 +897,11 @@ AcpiEnableAllRuntimeGpes (
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
+AcpiEnableAllWakeupGpes (
+ void))
+
+ACPI_HW_DEPENDENT_RETURN_STATUS (
+ACPI_STATUS
AcpiGetGpeDevice (
UINT32 GpeIndex,
ACPI_HANDLE *GpeDevice))
@@ -612,79 +928,92 @@ ACPI_STATUS (*ACPI_WALK_RESOURCE_CALLBACK) (
ACPI_RESOURCE *Resource,
void *Context);
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetVendorResource (
ACPI_HANDLE Device,
char *Name,
ACPI_VENDOR_UUID *Uuid,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetCurrentResources (
ACPI_HANDLE Device,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetPossibleResources (
ACPI_HANDLE Device,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetEventResources (
ACPI_HANDLE DeviceHandle,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiWalkResourceBuffer (
ACPI_BUFFER *Buffer,
ACPI_WALK_RESOURCE_CALLBACK UserFunction,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiWalkResources (
ACPI_HANDLE Device,
char *Name,
ACPI_WALK_RESOURCE_CALLBACK UserFunction,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiSetCurrentResources (
ACPI_HANDLE Device,
- ACPI_BUFFER *InBuffer);
+ ACPI_BUFFER *InBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetIrqRoutingTable (
ACPI_HANDLE Device,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiResourceToAddress64 (
ACPI_RESOURCE *Resource,
- ACPI_RESOURCE_ADDRESS64 *Out);
+ ACPI_RESOURCE_ADDRESS64 *Out))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiBufferToResource (
UINT8 *AmlBuffer,
UINT16 AmlBufferLength,
- ACPI_RESOURCE **ResourcePtr);
+ ACPI_RESOURCE **ResourcePtr))
/*
* Hardware (ACPI device) interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiReset (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRead (
UINT64 *Value,
- ACPI_GENERIC_ADDRESS *Reg);
+ ACPI_GENERIC_ADDRESS *Reg))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiWrite (
UINT64 Value,
- ACPI_GENERIC_ADDRESS *Reg);
+ ACPI_GENERIC_ADDRESS *Reg))
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
@@ -702,32 +1031,37 @@ AcpiWriteBitRegister (
/*
* Sleep/Wake interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetSleepTypeData (
UINT8 SleepState,
UINT8 *Slp_TypA,
- UINT8 *Slp_TypB);
+ UINT8 *Slp_TypB))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEnterSleepStatePrep (
- UINT8 SleepState);
+ UINT8 SleepState))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEnterSleepState (
- UINT8 SleepState);
+ UINT8 SleepState))
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiEnterSleepStateS4bios (
void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiLeaveSleepStatePrep (
- UINT8 SleepState);
+ UINT8 SleepState))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiLeaveSleepState (
- UINT8 SleepState);
+ UINT8 SleepState))
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
@@ -766,55 +1100,67 @@ AcpiGetTimerDuration (
/*
* Error/Warning output
*/
+ACPI_MSG_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiError (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...) ACPI_PRINTF_LIKE(3);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(4)
void ACPI_INTERNAL_VAR_XFACE
AcpiException (
const char *ModuleName,
UINT32 LineNumber,
ACPI_STATUS Status,
const char *Format,
- ...) ACPI_PRINTF_LIKE(4);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiWarning (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...) ACPI_PRINTF_LIKE(3);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiInfo (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...) ACPI_PRINTF_LIKE(3);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiBiosError (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...) ACPI_PRINTF_LIKE(3);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiBiosWarning (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...) ACPI_PRINTF_LIKE(3);
+ ...))
/*
* Debug output
*/
-#ifdef ACPI_DEBUG_OUTPUT
-
+ACPI_DBG_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(6)
void ACPI_INTERNAL_VAR_XFACE
AcpiDebugPrint (
UINT32 RequestedDebugLevel,
@@ -823,8 +1169,10 @@ AcpiDebugPrint (
const char *ModuleName,
UINT32 ComponentId,
const char *Format,
- ...) ACPI_PRINTF_LIKE(6);
+ ...))
+ACPI_DBG_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(6)
void ACPI_INTERNAL_VAR_XFACE
AcpiDebugPrintRaw (
UINT32 RequestedDebugLevel,
@@ -833,7 +1181,13 @@ AcpiDebugPrintRaw (
const char *ModuleName,
UINT32 ComponentId,
const char *Format,
- ...) ACPI_PRINTF_LIKE(6);
-#endif
+ ...))
+
+ACPI_APP_DEPENDENT_RETURN_VOID (
+ACPI_PRINTF_LIKE(1)
+void ACPI_INTERNAL_VAR_XFACE
+AcpiLogError (
+ const char *Format,
+ ...))
#endif /* __ACXFACE_H__ */
diff --git a/sys/contrib/dev/acpica/include/acpredef.h b/sys/contrib/dev/acpica/include/acpredef.h
index 46f3d69..c832f51 100644
--- a/sys/contrib/dev/acpica/include/acpredef.h
+++ b/sys/contrib/dev/acpica/include/acpredef.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -49,7 +49,7 @@
*
* Return Package types
*
- * 1) PTYPE1 packages do not contain sub-packages.
+ * 1) PTYPE1 packages do not contain subpackages.
*
* ACPI_PTYPE1_FIXED: Fixed-length length, 1 or 2 object types:
* object type
@@ -64,8 +64,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 subpackages. Each
+ * of the different types describe the contents of each of the subpackages.
*
* ACPI_PTYPE2: Each subpackage contains 1 or 2 object types. Zero-length
* parent package is allowed:
@@ -106,6 +106,11 @@
* count = 0 (optional)
* (Used for _DLM)
*
+ * ACPI_PTYPE2_UUID_PAIR: Each subpackage is preceded by a UUID Buffer. The UUID
+ * defines the format of the package. Zero-length parent package is
+ * allowed.
+ * (Used for _DSD)
+ *
*****************************************************************************/
enum AcpiReturnPackageTypes
@@ -119,7 +124,8 @@ enum AcpiReturnPackageTypes
ACPI_PTYPE2_FIXED = 7,
ACPI_PTYPE2_MIN = 8,
ACPI_PTYPE2_REV_FIXED = 9,
- ACPI_PTYPE2_FIX_VAR = 10
+ ACPI_PTYPE2_FIX_VAR = 10,
+ ACPI_PTYPE2_UUID_PAIR = 11
};
@@ -366,6 +372,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
{{"_CBA", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* See PCI firmware spec 3.0 */
+ {{"_CCA", METHOD_0ARGS,
+ METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* ACPI 5.1 */
+
{{"_CDM", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
@@ -434,6 +443,10 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
{{"_DOS", METHOD_1ARGS (ACPI_TYPE_INTEGER),
METHOD_NO_RETURN_VALUE}},
+ {{"_DSD", METHOD_0ARGS,
+ METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each: 1 Buf, 1 Pkg */
+ PACKAGE_INFO (ACPI_PTYPE2_UUID_PAIR, ACPI_RTYPE_BUFFER, 1, ACPI_RTYPE_PACKAGE, 1,0),
+
{{"_DSM", METHOD_4ARGS (ACPI_TYPE_BUFFER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_PACKAGE),
METHOD_RETURNS (ACPI_RTYPE_ALL)}}, /* Must return a value, but it can be of any type */
@@ -554,7 +567,7 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
/*
* For _HPX, a single package is returned, containing a variable-length number
- * of sub-packages. Each sub-package contains a PCI record setting.
+ * of subpackages. Each subpackage contains a PCI record setting.
* There are several different type of record settings, of different
* lengths, but all elements of all settings are Integers.
*/
@@ -580,6 +593,10 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
{{"_LID", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
+ {{"_LPD", METHOD_0ARGS,
+ METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (1 Int(rev), n Pkg (2 Int) */
+ PACKAGE_INFO (ACPI_PTYPE2_REV_FIXED, ACPI_RTYPE_INTEGER, 2,0,0,0),
+
{{"_MAT", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
diff --git a/sys/contrib/dev/acpica/include/acresrc.h b/sys/contrib/dev/acpica/include/acresrc.h
index b894e2f..3b62275 100644
--- a/sys/contrib/dev/acpica/include/acresrc.h
+++ b/sys/contrib/dev/acpica/include/acresrc.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -197,7 +197,7 @@ AcpiRsCreateResourceList (
ACPI_STATUS
AcpiRsCreateAmlResources (
- ACPI_RESOURCE *LinkedListBuffer,
+ ACPI_BUFFER *ResourceList,
ACPI_BUFFER *OutputBuffer);
ACPI_STATUS
@@ -251,7 +251,8 @@ AcpiRsGetListLength (
ACPI_STATUS
AcpiRsGetAmlLength (
- ACPI_RESOURCE *LinkedListBuffer,
+ ACPI_RESOURCE *ResourceList,
+ ACPI_SIZE ResourceListSize,
ACPI_SIZE *SizeNeeded);
ACPI_STATUS
diff --git a/sys/contrib/dev/acpica/include/acrestyp.h b/sys/contrib/dev/acpica/include/acrestyp.h
index 9d69825..971dd72 100644
--- a/sys/contrib/dev/acpica/include/acrestyp.h
+++ b/sys/contrib/dev/acpica/include/acrestyp.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/acstruct.h b/sys/contrib/dev/acpica/include/acstruct.h
index a6ba5ea..1de614f 100644
--- a/sys/contrib/dev/acpica/include/acstruct.h
+++ b/sys/contrib/dev/acpica/include/acstruct.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -139,6 +139,9 @@ typedef struct acpi_init_walk_info
UINT32 TableIndex;
UINT32 ObjectCount;
UINT32 MethodCount;
+ UINT32 SerialMethodCount;
+ UINT32 NonSerialMethodCount;
+ UINT32 SerializedMethodCount;
UINT32 DeviceCount;
UINT32 OpRegionCount;
UINT32 FieldCount;
diff --git a/sys/contrib/dev/acpica/include/actables.h b/sys/contrib/dev/acpica/include/actables.h
index 4295894..bc1574d 100644
--- a/sys/contrib/dev/acpica/include/actables.h
+++ b/sys/contrib/dev/acpica/include/actables.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -52,6 +52,10 @@ AcpiAllocateRootTable (
/*
* tbxfroot - Root pointer utilities
*/
+UINT32
+AcpiTbGetRsdpLength (
+ ACPI_TABLE_RSDP *Rsdp);
+
ACPI_STATUS
AcpiTbValidateRsdp (
ACPI_TABLE_RSDP *Rsdp);
@@ -63,6 +67,49 @@ AcpiTbScanMemoryForRsdp (
/*
+ * tbdata - table data structure management
+ */
+ACPI_STATUS
+AcpiTbGetNextRootIndex (
+ UINT32 *TableIndex);
+
+void
+AcpiTbInitTableDescriptor (
+ ACPI_TABLE_DESC *TableDesc,
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT8 Flags,
+ ACPI_TABLE_HEADER *Table);
+
+ACPI_STATUS
+AcpiTbAcquireTempTable (
+ ACPI_TABLE_DESC *TableDesc,
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT8 Flags);
+
+void
+AcpiTbReleaseTempTable (
+ ACPI_TABLE_DESC *TableDesc);
+
+ACPI_STATUS
+AcpiTbValidateTempTable (
+ ACPI_TABLE_DESC *TableDesc);
+
+ACPI_STATUS
+AcpiTbVerifyTempTable (
+ ACPI_TABLE_DESC *TableDesc,
+ char *Signature);
+
+BOOLEAN
+AcpiTbIsTableLoaded (
+ UINT32 TableIndex);
+
+void
+AcpiTbSetTableLoadedFlag (
+ UINT32 TableIndex,
+ BOOLEAN IsLoaded);
+
+
+/*
* tbfadt - FADT parse/convert/validate
*/
void
@@ -94,17 +141,36 @@ AcpiTbResizeRootTableList (
void);
ACPI_STATUS
-AcpiTbVerifyTable (
+AcpiTbValidateTable (
ACPI_TABLE_DESC *TableDesc);
-ACPI_TABLE_HEADER *
-AcpiTbTableOverride (
- ACPI_TABLE_HEADER *TableHeader,
+void
+AcpiTbInvalidateTable (
ACPI_TABLE_DESC *TableDesc);
+void
+AcpiTbOverrideTable (
+ ACPI_TABLE_DESC *OldTableDesc);
+
ACPI_STATUS
-AcpiTbAddTable (
+AcpiTbAcquireTable (
ACPI_TABLE_DESC *TableDesc,
+ ACPI_TABLE_HEADER **TablePtr,
+ UINT32 *TableLength,
+ UINT8 *TableFlags);
+
+void
+AcpiTbReleaseTable (
+ ACPI_TABLE_HEADER *Table,
+ UINT32 TableLength,
+ UINT8 TableFlags);
+
+ACPI_STATUS
+AcpiTbInstallStandardTable (
+ ACPI_PHYSICAL_ADDRESS Address,
+ UINT8 Flags,
+ BOOLEAN Reload,
+ BOOLEAN Override,
UINT32 *TableIndex);
ACPI_STATUS
@@ -116,7 +182,7 @@ AcpiTbStoreTable (
UINT32 *TableIndex);
void
-AcpiTbDeleteTable (
+AcpiTbUninstallTable (
ACPI_TABLE_DESC *TableDesc);
void
@@ -140,15 +206,6 @@ AcpiTbGetOwnerId (
UINT32 TableIndex,
ACPI_OWNER_ID *OwnerId);
-BOOLEAN
-AcpiTbIsTableLoaded (
- UINT32 TableIndex);
-
-void
-AcpiTbSetTableLoadedFlag (
- UINT32 TableIndex,
- BOOLEAN IsLoaded);
-
/*
* tbutils - table manager utilities
@@ -185,7 +242,13 @@ AcpiTbCopyDsdt (
UINT32 TableIndex);
void
-AcpiTbInstallTable (
+AcpiTbInstallTableWithOverride (
+ UINT32 TableIndex,
+ ACPI_TABLE_DESC *NewTableDesc,
+ BOOLEAN Override);
+
+ACPI_STATUS
+AcpiTbInstallFixedTable (
ACPI_PHYSICAL_ADDRESS Address,
char *Signature,
UINT32 TableIndex);
diff --git a/sys/contrib/dev/acpica/include/actbl.h b/sys/contrib/dev/acpica/include/actbl.h
index d77d6c4..6d79808 100644
--- a/sys/contrib/dev/acpica/include/actbl.h
+++ b/sys/contrib/dev/acpica/include/actbl.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -203,6 +203,9 @@ typedef struct acpi_table_xsdt
} ACPI_TABLE_XSDT;
+#define ACPI_RSDT_ENTRY_SIZE (sizeof (UINT32))
+#define ACPI_XSDT_ENTRY_SIZE (sizeof (UINT64))
+
/*******************************************************************************
*
@@ -293,7 +296,8 @@ typedef struct acpi_table_fadt
UINT32 Flags; /* Miscellaneous flag bits (see below for individual flags) */
ACPI_GENERIC_ADDRESS ResetRegister; /* 64-bit address of the Reset register */
UINT8 ResetValue; /* Value to write to the ResetRegister port to reset the system */
- UINT8 Reserved4[3]; /* Reserved, must be zero */
+ UINT16 ArmBootFlags; /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */
+ UINT8 MinorRevision; /* FADT Minor Revision (ACPI 5.1) */
UINT64 XFacs; /* 64-bit physical address of FACS */
UINT64 XDsdt; /* 64-bit physical address of DSDT */
ACPI_GENERIC_ADDRESS XPm1aEventBlock; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */
@@ -310,7 +314,7 @@ typedef struct acpi_table_fadt
} ACPI_TABLE_FADT;
-/* Masks for FADT Boot Architecture Flags (BootFlags) [Vx]=Introduced in this FADT revision */
+/* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */
#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 */
@@ -319,6 +323,11 @@ typedef struct acpi_table_fadt
#define ACPI_FADT_NO_ASPM (1<<4) /* 04: [V4] PCIe ASPM control must not be enabled */
#define ACPI_FADT_NO_CMOS_RTC (1<<5) /* 05: [V5] No CMOS real-time clock present */
+/* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */
+
+#define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5+] PSCI 0.2+ is implemented */
+#define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5+] HVC must be used instead of SMC as the PSCI conduit */
+
/* Masks for FADT flags */
#define ACPI_FADT_WBINVD (1) /* 00: [V1] The WBINVD instruction works properly */
@@ -399,12 +408,11 @@ typedef struct acpi_table_desc
/* Masks for Flags field above */
-#define ACPI_TABLE_ORIGIN_UNKNOWN (0)
-#define ACPI_TABLE_ORIGIN_MAPPED (1)
-#define ACPI_TABLE_ORIGIN_ALLOCATED (2)
-#define ACPI_TABLE_ORIGIN_OVERRIDE (4)
-#define ACPI_TABLE_ORIGIN_MASK (7)
-#define ACPI_TABLE_IS_LOADED (8)
+#define ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL (0) /* Virtual address, external maintained */
+#define ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL (1) /* Physical address, internally mapped */
+#define ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL (2) /* Virtual address, internallly allocated */
+#define ACPI_TABLE_ORIGIN_MASK (3)
+#define ACPI_TABLE_IS_LOADED (8)
/*
@@ -433,7 +441,7 @@ typedef struct acpi_table_desc
* FADT V5 size: 0x10C
*/
#define ACPI_FADT_V1_SIZE (UINT32) (ACPI_FADT_OFFSET (Flags) + 4)
-#define ACPI_FADT_V2_SIZE (UINT32) (ACPI_FADT_OFFSET (Reserved4[0]) + 3)
+#define ACPI_FADT_V2_SIZE (UINT32) (ACPI_FADT_OFFSET (MinorRevision) + 1)
#define ACPI_FADT_V3_SIZE (UINT32) (ACPI_FADT_OFFSET (SleepControl))
#define ACPI_FADT_V5_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT))
diff --git a/sys/contrib/dev/acpica/include/actbl1.h b/sys/contrib/dev/acpica/include/actbl1.h
index 67579da..66b3d07 100644
--- a/sys/contrib/dev/acpica/include/actbl1.h
+++ b/sys/contrib/dev/acpica/include/actbl1.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -524,7 +524,7 @@ typedef struct acpi_hest_aer_common
UINT8 Enabled;
UINT32 RecordsToPreallocate;
UINT32 MaxSectionsPerRecord;
- UINT32 Bus;
+ UINT32 Bus; /* Bus and Segment numbers */
UINT16 Device;
UINT16 Function;
UINT16 DeviceControl;
@@ -541,6 +541,14 @@ typedef struct acpi_hest_aer_common
#define ACPI_HEST_FIRMWARE_FIRST (1)
#define ACPI_HEST_GLOBAL (1<<1)
+/*
+ * Macros to access the bus/segment numbers in Bus field above:
+ * Bus number is encoded in bits 7:0
+ * Segment number is encoded in bits 23:8
+ */
+#define ACPI_HEST_BUS(Bus) ((Bus) & 0xFF)
+#define ACPI_HEST_SEGMENT(Bus) (((Bus) >> 8) & 0xFFFF)
+
/* Hardware Error Notification */
@@ -754,25 +762,27 @@ typedef struct acpi_table_madt
enum AcpiMadtType
{
- ACPI_MADT_TYPE_LOCAL_APIC = 0,
- ACPI_MADT_TYPE_IO_APIC = 1,
- ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
- ACPI_MADT_TYPE_NMI_SOURCE = 3,
- ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
- ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
- ACPI_MADT_TYPE_IO_SAPIC = 6,
- ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
- ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
- ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
- ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
- ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
- ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
- ACPI_MADT_TYPE_RESERVED = 13 /* 13 and greater are reserved */
+ ACPI_MADT_TYPE_LOCAL_APIC = 0,
+ ACPI_MADT_TYPE_IO_APIC = 1,
+ ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
+ ACPI_MADT_TYPE_NMI_SOURCE = 3,
+ ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
+ ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
+ ACPI_MADT_TYPE_IO_SAPIC = 6,
+ ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
+ ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
+ ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
+ ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
+ ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
+ ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
+ ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
+ ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
+ ACPI_MADT_TYPE_RESERVED = 15 /* 15 and greater are reserved */
};
/*
- * MADT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
+ * MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
*/
/* 0: Processor Local APIC */
@@ -928,16 +938,27 @@ typedef struct acpi_madt_generic_interrupt
{
ACPI_SUBTABLE_HEADER Header;
UINT16 Reserved; /* Reserved - must be zero */
- UINT32 GicId;
+ UINT32 CpuInterfaceNumber;
UINT32 Uid;
UINT32 Flags;
UINT32 ParkingVersion;
UINT32 PerformanceInterrupt;
UINT64 ParkedAddress;
UINT64 BaseAddress;
+ UINT64 GicvBaseAddress;
+ UINT64 GichBaseAddress;
+ UINT32 VgicInterrupt;
+ UINT64 GicrBaseAddress;
+ UINT64 ArmMpidr;
} ACPI_MADT_GENERIC_INTERRUPT;
+/* Masks for Flags field above */
+
+/* ACPI_MADT_ENABLED (1) Processor is usable if set */
+#define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */
+#define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */
+
/* 12: Generic Distributor (ACPI 5.0) */
@@ -953,11 +974,42 @@ typedef struct acpi_madt_generic_distributor
} ACPI_MADT_GENERIC_DISTRIBUTOR;
+/* 13: Generic MSI Frame (ACPI 5.1) */
+
+typedef struct acpi_madt_generic_msi_frame
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT16 Reserved; /* Reserved - must be zero */
+ UINT32 MsiFrameId;
+ UINT64 BaseAddress;
+ UINT32 Flags;
+ UINT16 SpiCount;
+ UINT16 SpiBase;
+
+} ACPI_MADT_GENERIC_MSI_FRAME;
+
+/* Masks for Flags field above */
+
+#define ACPI_MADT_OVERRIDE_SPI_VALUES (1)
+
+
+/* 14: Generic Redistributor (ACPI 5.1) */
+
+typedef struct acpi_madt_generic_redistributor
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT16 Reserved; /* reserved - must be zero */
+ UINT64 BaseAddress;
+ UINT32 Length;
+
+} ACPI_MADT_GENERIC_REDISTRIBUTOR;
+
+
/*
* Common flags fields for MADT subtables
*/
-/* MADT Local APIC flags (LapicFlags) and GIC flags */
+/* MADT Local APIC flags */
#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
@@ -1066,11 +1118,12 @@ enum AcpiSratType
ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
- ACPI_SRAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
+ ACPI_SRAT_TYPE_GICC_AFFINITY = 3,
+ ACPI_SRAT_TYPE_RESERVED = 4 /* 4 and greater are reserved */
};
/*
- * SRAT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
+ * SRAT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
*/
/* 0: Processor Local APIC/SAPIC Affinity */
@@ -1083,7 +1136,7 @@ typedef struct acpi_srat_cpu_affinity
UINT32 Flags;
UINT8 LocalSapicEid;
UINT8 ProximityDomainHi[3];
- UINT32 Reserved; /* Reserved, must be zero */
+ UINT32 ClockDomain;
} ACPI_SRAT_CPU_AFFINITY;
@@ -1133,6 +1186,22 @@ typedef struct acpi_srat_x2apic_cpu_affinity
#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
+/* 3: GICC Affinity (ACPI 5.1) */
+
+typedef struct acpi_srat_gicc_affinity
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT32 ProximityDomain;
+ UINT32 AcpiProcessorUid;
+ UINT32 Flags;
+ UINT32 ClockDomain;
+
+} ACPI_SRAT_GICC_AFFINITY;
+
+/* Flags for ACPI_SRAT_GICC_AFFINITY */
+
+#define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */
+
/* Reset to default packing */
#pragma pack()
diff --git a/sys/contrib/dev/acpica/include/actbl2.h b/sys/contrib/dev/acpica/include/actbl2.h
index 327a810..2251af8 100644
--- a/sys/contrib/dev/acpica/include/actbl2.h
+++ b/sys/contrib/dev/acpica/include/actbl2.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -72,6 +72,7 @@
#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */
#define ACPI_SIG_IBFT "IBFT" /* iSCSI Boot Firmware Table */
#define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */
+#define ACPI_SIG_LPIT "LPIT" /* Low Power Idle Table */
#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
#define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */
#define ACPI_SIG_MTMR "MTMR" /* MID Timer table */
@@ -373,6 +374,14 @@ typedef struct acpi_table_dbg2
} ACPI_TABLE_DBG2;
+typedef struct acpi_dbg2_header
+{
+ UINT32 InfoOffset;
+ UINT32 InfoCount;
+
+} ACPI_DBG2_HEADER;
+
+
/* Debug Device Information Subtable */
typedef struct acpi_dbg2_device
@@ -441,7 +450,7 @@ typedef struct acpi_table_dbgp
* Version 1
*
* Conforms to "Intel Virtualization Technology for Directed I/O",
- * Version 1.2, Sept. 2008
+ * Version 2.2, Sept. 2013
*
******************************************************************************/
@@ -474,9 +483,10 @@ enum AcpiDmarType
{
ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
- ACPI_DMAR_TYPE_ATSR = 2,
- ACPI_DMAR_HARDWARE_AFFINITY = 3,
- ACPI_DMAR_TYPE_RESERVED = 4 /* 4 and greater are reserved */
+ ACPI_DMAR_TYPE_ROOT_ATS = 2,
+ ACPI_DMAR_TYPE_HARDWARE_AFFINITY = 3,
+ ACPI_DMAR_TYPE_NAMESPACE = 4,
+ ACPI_DMAR_TYPE_RESERVED = 5 /* 5 and greater are reserved */
};
@@ -492,7 +502,7 @@ typedef struct acpi_dmar_device_scope
} ACPI_DMAR_DEVICE_SCOPE;
-/* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE */
+/* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE - device types */
enum AcpiDmarScopeType
{
@@ -501,7 +511,8 @@ enum AcpiDmarScopeType
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 */
+ ACPI_DMAR_SCOPE_TYPE_NAMESPACE = 5,
+ ACPI_DMAR_SCOPE_TYPE_RESERVED = 6 /* 6 and greater are reserved */
};
typedef struct acpi_dmar_pci_path
@@ -513,7 +524,7 @@ typedef struct acpi_dmar_pci_path
/*
- * DMAR Sub-tables, correspond to Type in ACPI_DMAR_HEADER
+ * DMAR Subtables, correspond to Type in ACPI_DMAR_HEADER
*/
/* 0: Hardware Unit Definition */
@@ -578,6 +589,18 @@ typedef struct acpi_dmar_rhsa
} ACPI_DMAR_RHSA;
+/* 4: ACPI Namespace Device Declaration Structure */
+
+typedef struct acpi_dmar_andd
+{
+ ACPI_DMAR_HEADER Header;
+ UINT8 Reserved[3];
+ UINT8 DeviceNumber;
+ char DeviceName[1];
+
+} ACPI_DMAR_ANDD;
+
+
/*******************************************************************************
*
* HPET - High Precision Event Timer table
@@ -926,7 +949,83 @@ typedef struct acpi_ivrs_memory
/*******************************************************************************
*
- * MCFG - PCI Memory Mapped Configuration table and sub-table
+ * LPIT - Low Power Idle Table
+ *
+ * Conforms to "ACPI Low Power Idle Table (LPIT) and _LPD Proposal (DRAFT)"
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_lpit
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+
+} ACPI_TABLE_LPIT;
+
+
+/* LPIT subtable header */
+
+typedef struct acpi_lpit_header
+{
+ UINT32 Type; /* Subtable type */
+ UINT32 Length; /* Subtable length */
+ UINT16 UniqueId;
+ UINT16 Reserved;
+ UINT32 Flags;
+
+} ACPI_LPIT_HEADER;
+
+/* Values for subtable Type above */
+
+enum AcpiLpitType
+{
+ ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00,
+ ACPI_LPIT_TYPE_SIMPLE_IO = 0x01
+};
+
+/* Masks for Flags field above */
+
+#define ACPI_LPIT_STATE_DISABLED (1)
+#define ACPI_LPIT_NO_COUNTER (1<<1)
+
+/*
+ * LPIT subtables, correspond to Type in ACPI_LPIT_HEADER
+ */
+
+/* 0x00: Native C-state instruction based LPI structure */
+
+typedef struct acpi_lpit_native
+{
+ ACPI_LPIT_HEADER Header;
+ ACPI_GENERIC_ADDRESS EntryTrigger;
+ UINT32 Residency;
+ UINT32 Latency;
+ ACPI_GENERIC_ADDRESS ResidencyCounter;
+ UINT64 CounterFrequency;
+
+} ACPI_LPIT_NATIVE;
+
+
+/* 0x01: Simple I/O based LPI structure */
+
+typedef struct acpi_lpit_io
+{
+ ACPI_LPIT_HEADER Header;
+ ACPI_GENERIC_ADDRESS EntryTrigger;
+ UINT32 TriggerAction;
+ UINT64 TriggerValue;
+ UINT64 TriggerMask;
+ ACPI_GENERIC_ADDRESS MinimumIdleState;
+ UINT32 Residency;
+ UINT32 Latency;
+ ACPI_GENERIC_ADDRESS ResidencyCounter;
+ UINT64 CounterFrequency;
+
+} ACPI_LPIT_IO;
+
+
+/*******************************************************************************
+ *
+ * MCFG - PCI Memory Mapped Configuration table and subtable
* Version 1
*
* Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
@@ -1050,7 +1149,7 @@ enum AcpiSlicType
/*
- * SLIC Sub-tables, correspond to Type in ACPI_SLIC_HEADER
+ * SLIC Subtables, correspond to Type in ACPI_SLIC_HEADER
*/
/* 0: Public Key Structure */
diff --git a/sys/contrib/dev/acpica/include/actbl3.h b/sys/contrib/dev/acpica/include/actbl3.h
index acf2e13..f7ae670 100644
--- a/sys/contrib/dev/acpica/include/actbl3.h
+++ b/sys/contrib/dev/acpica/include/actbl3.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -280,35 +280,115 @@ typedef struct acpi_s3pt_suspend
/*******************************************************************************
*
- * GTDT - Generic Timer Description Table (ACPI 5.0)
- * Version 1
+ * GTDT - Generic Timer Description Table (ACPI 5.1)
+ * Version 2
*
******************************************************************************/
typedef struct acpi_table_gtdt
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
- UINT64 Address;
- UINT32 Flags;
- UINT32 SecurePl1Interrupt;
- UINT32 SecurePl1Flags;
- UINT32 NonSecurePl1Interrupt;
- UINT32 NonSecurePl1Flags;
+ UINT64 CounterBlockAddresss;
+ UINT32 Reserved;
+ UINT32 SecureEl1Interrupt;
+ UINT32 SecureEl1Flags;
+ UINT32 NonSecureEl1Interrupt;
+ UINT32 NonSecureEl1Flags;
UINT32 VirtualTimerInterrupt;
UINT32 VirtualTimerFlags;
- UINT32 NonSecurePl2Interrupt;
- UINT32 NonSecurePl2Flags;
+ UINT32 NonSecureEl2Interrupt;
+ UINT32 NonSecureEl2Flags;
+ UINT64 CounterReadBlockAddress;
+ UINT32 PlatformTimerCount;
+ UINT32 PlatformTimerOffset;
} ACPI_TABLE_GTDT;
-/* Values for Flags field above */
+/* Flag Definitions: Timer Block Physical Timers and Virtual timers */
+
+#define ACPI_GTDT_INTERRUPT_MODE (1)
+#define ACPI_GTDT_INTERRUPT_POLARITY (1<<1)
+#define ACPI_GTDT_ALWAYS_ON (1<<2)
+
+
+/* Common GTDT subtable header */
+
+typedef struct acpi_gtdt_header
+{
+ UINT8 Type;
+ UINT16 Length;
+
+} ACPI_GTDT_HEADER;
+
+/* Values for GTDT subtable type above */
+
+enum AcpiGtdtType
+{
+ ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
+ ACPI_GTDT_TYPE_WATCHDOG = 1,
+ ACPI_GTDT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
+};
+
+
+/* GTDT Subtables, correspond to Type in acpi_gtdt_header */
+
+/* 0: Generic Timer Block */
+
+typedef struct acpi_gtdt_timer_block
+{
+ ACPI_GTDT_HEADER Header;
+ UINT8 Reserved;
+ UINT64 BlockAddress;
+ UINT32 TimerCount;
+ UINT32 TimerOffset;
+
+} ACPI_GTDT_TIMER_BLOCK;
+
+/* Timer Sub-Structure, one per timer */
+
+typedef struct acpi_gtdt_timer_entry
+{
+ UINT8 FrameNumber;
+ UINT8 Reserved[3];
+ UINT64 BaseAddress;
+ UINT64 El0BaseAddress;
+ UINT32 TimerInterrupt;
+ UINT32 TimerFlags;
+ UINT32 VirtualTimerInterrupt;
+ UINT32 VirtualTimerFlags;
+ UINT32 CommonFlags;
+
+} ACPI_GTDT_TIMER_ENTRY;
-#define ACPI_GTDT_MAPPED_BLOCK_PRESENT 1
+/* Flag Definitions: TimerFlags and VirtualTimerFlags above */
-/* Values for all "TimerFlags" fields above */
+#define ACPI_GTDT_GT_IRQ_MODE (1)
+#define ACPI_GTDT_GT_IRQ_POLARITY (1<<1)
-#define ACPI_GTDT_INTERRUPT_MODE 1
-#define ACPI_GTDT_INTERRUPT_POLARITY 2
+/* Flag Definitions: CommonFlags above */
+
+#define ACPI_GTDT_GT_IS_SECURE_TIMER (1)
+#define ACPI_GTDT_GT_ALWAYS_ON (1<<1)
+
+
+/* 1: SBSA Generic Watchdog Structure */
+
+typedef struct acpi_gtdt_watchdog
+{
+ ACPI_GTDT_HEADER Header;
+ UINT8 Reserved;
+ UINT64 RefreshFrameAddress;
+ UINT64 ControlFrameAddress;
+ UINT32 TimerInterrupt;
+ UINT32 TimerFlags;
+
+} ACPI_GTDT_WATCHDOG;
+
+/* Flag Definitions: TimerFlags above */
+
+#define ACPI_GTDT_WATCHDOG_IRQ_MODE (1)
+#define ACPI_GTDT_WATCHDOG_IRQ_POLARITY (1<<1)
+#define ACPI_GTDT_WATCHDOG_SECURE (1<<2)
/*******************************************************************************
@@ -440,8 +520,7 @@ typedef struct acpi_table_pcct
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT32 Flags;
- UINT32 Latency;
- UINT32 Reserved;
+ UINT64 Reserved;
} ACPI_TABLE_PCCT;
@@ -449,8 +528,17 @@ typedef struct acpi_table_pcct
#define ACPI_PCCT_DOORBELL 1
+/* Values for subtable type in ACPI_SUBTABLE_HEADER */
+
+enum AcpiPcctType
+{
+ ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
+ ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
+ ACPI_PCCT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
+};
+
/*
- * PCCT subtables
+ * PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
*/
/* 0: Generic Communications Subspace */
@@ -464,10 +552,38 @@ typedef struct acpi_pcct_subspace
ACPI_GENERIC_ADDRESS DoorbellRegister;
UINT64 PreserveMask;
UINT64 WriteMask;
+ UINT32 Latency;
+ UINT32 MaxAccessRate;
+ UINT16 MinTurnaroundTime;
} ACPI_PCCT_SUBSPACE;
+/* 1: HW-reduced Communications Subspace (ACPI 5.1) */
+
+typedef struct acpi_pcct_hw_reduced
+{
+ ACPI_SUBTABLE_HEADER Header;
+ UINT32 DoorbellInterrupt;
+ UINT8 Flags;
+ UINT8 Reserved;
+ UINT64 BaseAddress;
+ UINT64 Length;
+ ACPI_GENERIC_ADDRESS DoorbellRegister;
+ UINT64 PreserveMask;
+ UINT64 WriteMask;
+ UINT32 Latency;
+ UINT32 MaxAccessRate;
+ UINT16 MinTurnaroundTime;
+
+} ACPI_PCCT_HW_REDUCED;
+
+/* Values for doorbell flags above */
+
+#define ACPI_PCCT_INTERRUPT_POLARITY (1)
+#define ACPI_PCCT_INTERRUPT_MODE (1<<1)
+
+
/*
* PCC memory structures (not part of the ACPI table)
*/
diff --git a/sys/contrib/dev/acpica/include/actypes.h b/sys/contrib/dev/acpica/include/actypes.h
index dafbfd5..c6f2170 100644
--- a/sys/contrib/dev/acpica/include/actypes.h
+++ b/sys/contrib/dev/acpica/include/actypes.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -55,8 +55,6 @@
#error ACPI_MACHINE_WIDTH not defined
#endif
-/*! [Begin] no source code translation */
-
/*
* Data type ranges
* Note: These macros are designed to be compiler independent as well as
@@ -124,13 +122,16 @@
*
******************************************************************************/
+#ifndef ACPI_USE_SYSTEM_INTTYPES
+
typedef unsigned char BOOLEAN;
typedef unsigned char UINT8;
typedef unsigned short UINT16;
+typedef short INT16;
typedef COMPILER_DEPENDENT_UINT64 UINT64;
typedef COMPILER_DEPENDENT_INT64 INT64;
-/*! [End] no source code translation !*/
+#endif /* ACPI_USE_SYSTEM_INTTYPES */
/*
* Value returned by AcpiOsGetThreadId. There is no standard "thread_id"
@@ -151,12 +152,12 @@ typedef COMPILER_DEPENDENT_INT64 INT64;
#if ACPI_MACHINE_WIDTH == 64
-/*! [Begin] no source code translation (keep the typedefs as-is) */
+#ifndef ACPI_USE_SYSTEM_INTTYPES
typedef unsigned int UINT32;
typedef int INT32;
-/*! [End] no source code translation !*/
+#endif /* ACPI_USE_SYSTEM_INTTYPES */
typedef INT64 ACPI_NATIVE_INT;
@@ -190,12 +191,12 @@ typedef UINT64 ACPI_PHYSICAL_ADDRESS;
#elif ACPI_MACHINE_WIDTH == 32
-/*! [Begin] no source code translation (keep the typedefs as-is) */
+#ifndef ACPI_USE_SYSTEM_INTTYPES
typedef unsigned int UINT32;
typedef int INT32;
-/*! [End] no source code translation !*/
+#endif /* ACPI_USE_SYSTEM_INTTYPES */
typedef INT32 ACPI_NATIVE_INT;
@@ -303,9 +304,18 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS;
#endif
/*
- * All ACPICA functions that are available to the rest of the kernel are
- * tagged with this macro which can be defined as appropriate for the host.
+ * All ACPICA external functions that are available to the rest of the kernel
+ * are tagged with thes macros which can be defined as appropriate for the host.
+ *
+ * Notes:
+ * ACPI_EXPORT_SYMBOL_INIT is used for initialization and termination
+ * interfaces that may need special processing.
+ * ACPI_EXPORT_SYMBOL is used for all other public external functions.
*/
+#ifndef ACPI_EXPORT_SYMBOL_INIT
+#define ACPI_EXPORT_SYMBOL_INIT(Symbol)
+#endif
+
#ifndef ACPI_EXPORT_SYMBOL
#define ACPI_EXPORT_SYMBOL(Symbol)
#endif
@@ -319,6 +329,45 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS;
#endif
+/*******************************************************************************
+ *
+ * Configuration
+ *
+ ******************************************************************************/
+
+#ifdef ACPI_NO_MEM_ALLOCATIONS
+
+#define ACPI_ALLOCATE(a) NULL
+#define ACPI_ALLOCATE_ZEROED(a) NULL
+#define ACPI_FREE(a)
+#define ACPI_MEM_TRACKING(a)
+
+#else /* ACPI_NO_MEM_ALLOCATIONS */
+
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+/*
+ * Memory allocation tracking (used by AcpiExec to detect memory leaks)
+ */
+#define ACPI_MEM_PARAMETERS _COMPONENT, _AcpiModuleName, __LINE__
+#define ACPI_ALLOCATE(a) AcpiUtAllocateAndTrack ((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
+#define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroedAndTrack ((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
+#define ACPI_FREE(a) AcpiUtFreeAndTrack (a, ACPI_MEM_PARAMETERS)
+#define ACPI_MEM_TRACKING(a) a
+
+#else
+/*
+ * Normal memory allocation directly via the OS services layer
+ */
+#define ACPI_ALLOCATE(a) AcpiOsAllocate ((ACPI_SIZE) (a))
+#define ACPI_ALLOCATE_ZEROED(a) AcpiOsAllocateZeroed ((ACPI_SIZE) (a))
+#define ACPI_FREE(a) AcpiOsFree (a)
+#define ACPI_MEM_TRACKING(a)
+
+#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
+
+#endif /* ACPI_NO_MEM_ALLOCATIONS */
+
+
/******************************************************************************
*
* ACPI Specification constants (Do not change unless the specification changes)
@@ -335,6 +384,7 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS;
#define ACPI_PM1_REGISTER_WIDTH 16
#define ACPI_PM2_REGISTER_WIDTH 8
#define ACPI_PM_TIMER_WIDTH 32
+#define ACPI_RESET_REGISTER_WIDTH 8
/* Names within the namespace are 4 bytes long */
@@ -474,7 +524,7 @@ typedef UINT64 ACPI_INTEGER;
#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(ACPI_SIZE) i)
#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) NULL)
-#define ACPI_OFFSET(d, f) (ACPI_SIZE) ACPI_PTR_DIFF (&(((d *)0)->f), (void *) NULL)
+#define ACPI_OFFSET(d, f) ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) NULL)
#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
@@ -568,8 +618,9 @@ typedef UINT64 ACPI_INTEGER;
#define ACPI_NOTIFY_RESERVED (UINT8) 0x0A
#define ACPI_NOTIFY_LOCALITY_UPDATE (UINT8) 0x0B
#define ACPI_NOTIFY_SHUTDOWN_REQUEST (UINT8) 0x0C
+#define ACPI_NOTIFY_AFFINITY_UPDATE (UINT8) 0x0D
-#define ACPI_NOTIFY_MAX 0x0C
+#define ACPI_NOTIFY_MAX 0x0D
/*
* Types associated with ACPI names and objects. The first group of
@@ -669,14 +720,15 @@ typedef UINT32 ACPI_EVENT_TYPE;
* The encoding of ACPI_EVENT_STATUS is illustrated below.
* Note that a set bit (1) indicates the property is TRUE
* (e.g. if bit 0 is set then the event is enabled).
- * +-------------+-+-+-+
- * | Bits 31:3 |2|1|0|
- * +-------------+-+-+-+
- * | | | |
- * | | | +- Enabled?
- * | | +--- Enabled for wake?
- * | +----- Set?
- * +----------- <Reserved>
+ * +-------------+-+-+-+-+
+ * | Bits 31:4 |3|2|1|0|
+ * +-------------+-+-+-+-+
+ * | | | | |
+ * | | | | +- Enabled?
+ * | | | +--- Enabled for wake?
+ * | | +----- Set?
+ * | +------- Has a handler?
+ * +------------- <Reserved>
*/
typedef UINT32 ACPI_EVENT_STATUS;
@@ -684,17 +736,22 @@ typedef UINT32 ACPI_EVENT_STATUS;
#define ACPI_EVENT_FLAG_ENABLED (ACPI_EVENT_STATUS) 0x01
#define ACPI_EVENT_FLAG_WAKE_ENABLED (ACPI_EVENT_STATUS) 0x02
#define ACPI_EVENT_FLAG_SET (ACPI_EVENT_STATUS) 0x04
+#define ACPI_EVENT_FLAG_HAS_HANDLER (ACPI_EVENT_STATUS) 0x08
/* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */
#define ACPI_GPE_ENABLE 0
#define ACPI_GPE_DISABLE 1
#define ACPI_GPE_CONDITIONAL_ENABLE 2
+#define ACPI_GPE_SAVE_MASK 4
+
+#define ACPI_GPE_ENABLE_SAVE (ACPI_GPE_ENABLE | ACPI_GPE_SAVE_MASK)
+#define ACPI_GPE_DISABLE_SAVE (ACPI_GPE_DISABLE | ACPI_GPE_SAVE_MASK)
/*
* GPE info flags - Per GPE
* +-------+-+-+---+
- * | 7:4 |3|2|1:0|
+ * | 7:5 |4|3|2:0|
* +-------+-+-+---+
* | | | |
* | | | +-- Type of dispatch:to method, handler, notify, or none
@@ -706,13 +763,15 @@ typedef UINT32 ACPI_EVENT_STATUS;
#define ACPI_GPE_DISPATCH_METHOD (UINT8) 0x01
#define ACPI_GPE_DISPATCH_HANDLER (UINT8) 0x02
#define ACPI_GPE_DISPATCH_NOTIFY (UINT8) 0x03
-#define ACPI_GPE_DISPATCH_MASK (UINT8) 0x03
+#define ACPI_GPE_DISPATCH_RAW_HANDLER (UINT8) 0x04
+#define ACPI_GPE_DISPATCH_MASK (UINT8) 0x07
+#define ACPI_GPE_DISPATCH_TYPE(flags) ((UINT8) ((flags) & ACPI_GPE_DISPATCH_MASK))
-#define ACPI_GPE_LEVEL_TRIGGERED (UINT8) 0x04
+#define ACPI_GPE_LEVEL_TRIGGERED (UINT8) 0x08
#define ACPI_GPE_EDGE_TRIGGERED (UINT8) 0x00
-#define ACPI_GPE_XRUPT_TYPE_MASK (UINT8) 0x04
+#define ACPI_GPE_XRUPT_TYPE_MASK (UINT8) 0x08
-#define ACPI_GPE_CAN_WAKE (UINT8) 0x08
+#define ACPI_GPE_CAN_WAKE (UINT8) 0x10
/*
* Flags for GPE and Lock interfaces
@@ -916,8 +975,18 @@ typedef struct acpi_object_list
* Miscellaneous common Data Structures used by the interfaces
*/
#define ACPI_NO_BUFFER 0
-#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1)
-#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2)
+
+#ifdef ACPI_NO_MEM_ALLOCATIONS
+
+#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (0)
+#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (0)
+
+#else /* ACPI_NO_MEM_ALLOCATIONS */
+
+#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1) /* Let ACPICA allocate buffer */
+#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2) /* For internal use only (enables tracking) */
+
+#endif /* ACPI_NO_MEM_ALLOCATIONS */
typedef struct acpi_buffer
{
@@ -926,10 +995,6 @@ typedef struct acpi_buffer
} ACPI_BUFFER;
-/* Free a buffer created in an ACPI_BUFFER via ACPI_ALLOCATE_LOCAL_BUFFER */
-
-#define ACPI_FREE_BUFFER(b) ACPI_FREE(b.Pointer)
-
/*
* NameType for AcpiGetName
@@ -1281,4 +1346,19 @@ typedef struct acpi_memory_list
#define ACPI_OSI_WIN_8 0x0C
+/* Definitions of file IO */
+
+#define ACPI_FILE_READING 0x01
+#define ACPI_FILE_WRITING 0x02
+#define ACPI_FILE_BINARY 0x04
+
+#define ACPI_FILE_BEGIN 0x01
+#define ACPI_FILE_END 0x02
+
+
+/* Definitions of getopt */
+
+#define ACPI_OPT_END -1
+
+
#endif /* __ACTYPES_H__ */
diff --git a/sys/contrib/dev/acpica/include/acutils.h b/sys/contrib/dev/acpica/include/acutils.h
index c80dd36..a651863 100644
--- a/sys/contrib/dev/acpica/include/acutils.h
+++ b/sys/contrib/dev/acpica/include/acutils.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -50,7 +50,7 @@ extern const UINT8 AcpiGbl_ResourceAmlSerialBusSizes[];
/* Strings used by the disassembler and debugger resource dump routines */
-#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
+#if defined(ACPI_DEBUG_OUTPUT) || defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
extern const char *AcpiGbl_BmDecode[];
extern const char *AcpiGbl_ConfigDecode[];
@@ -96,7 +96,6 @@ extern const char *AcpiGbl_PtDecode[];
#ifdef ACPI_ASL_COMPILER
#include <stdio.h>
-extern FILE *AcpiGbl_OutputFile;
#define ACPI_MSG_REDIRECT_BEGIN \
FILE *OutputFile = AcpiGbl_OutputFile; \
@@ -189,8 +188,8 @@ AcpiUtGetMutexName (
const char *
AcpiUtGetNotifyName (
- UINT32 NotifyValue);
-
+ UINT32 NotifyValue,
+ ACPI_OBJECT_TYPE Type);
#endif
char *
@@ -226,6 +225,10 @@ AcpiUtHexToAsciiChar (
UINT64 Integer,
UINT32 Position);
+UINT8
+AcpiUtAsciiCharToHex (
+ int HexChar);
+
BOOLEAN
AcpiUtValidObjectType (
ACPI_OBJECT_TYPE Type);
@@ -253,6 +256,11 @@ AcpiUtStrlen (
const char *String);
char *
+AcpiUtStrchr (
+ const char *String,
+ int ch);
+
+char *
AcpiUtStrcpy (
char *DstString,
const char *SrcString);
@@ -340,7 +348,7 @@ extern const UINT8 _acpi_ctype[];
#define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD))
#define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP))
#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
-#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU))
+#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU))
#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
#endif /* !ACPI_USE_SYSTEM_CLIBRARY */
@@ -482,6 +490,16 @@ AcpiUtDumpBuffer (
UINT32 Display,
UINT32 Offset);
+#ifdef ACPI_APPLICATION
+void
+AcpiUtDumpBufferToFile (
+ ACPI_FILE File,
+ UINT8 *Buffer,
+ UINT32 Count,
+ UINT32 Display,
+ UINT32 BaseOffset);
+#endif
+
void
AcpiUtReportError (
char *ModuleName,
@@ -551,6 +569,17 @@ AcpiUtExecutePowerMethods (
/*
+ * utfileio - file operations
+ */
+#ifdef ACPI_APPLICATION
+ACPI_STATUS
+AcpiUtReadTableFromFile (
+ char *Filename,
+ ACPI_TABLE_HEADER **Table);
+#endif
+
+
+/*
* utids - device ID support
*/
ACPI_STATUS
@@ -926,6 +955,29 @@ void
AcpiUtRepairName (
char *Name);
+#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
+BOOLEAN
+AcpiUtSafeStrcpy (
+ char *Dest,
+ ACPI_SIZE DestSize,
+ char *Source);
+
+BOOLEAN
+AcpiUtSafeStrcat (
+ char *Dest,
+ ACPI_SIZE DestSize,
+ char *Source);
+
+#ifndef _KERNEL
+BOOLEAN
+AcpiUtSafeStrncat (
+ char *Dest,
+ ACPI_SIZE DestSize,
+ char *Source,
+ ACPI_SIZE MaxTransferLength);
+#endif
+#endif
+
/*
* utmutex - mutex support
@@ -967,20 +1019,6 @@ AcpiUtInitializeBuffer (
ACPI_BUFFER *Buffer,
ACPI_SIZE RequiredLength);
-void *
-AcpiUtAllocate (
- ACPI_SIZE Size,
- UINT32 Component,
- const char *Module,
- UINT32 Line);
-
-void *
-AcpiUtAllocateZeroed (
- ACPI_SIZE Size,
- UINT32 Component,
- const char *Module,
- UINT32 Line);
-
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
void *
AcpiUtAllocateAndTrack (
@@ -1092,4 +1130,68 @@ AcpiUtMethodError (
const char *Path,
ACPI_STATUS LookupStatus);
+/*
+ * Utility functions for ACPI names and IDs
+ */
+const AH_PREDEFINED_NAME *
+AcpiAhMatchPredefinedName (
+ char *Nameseg);
+
+const AH_DEVICE_ID *
+AcpiAhMatchHardwareId (
+ char *Hid);
+
+const char *
+AcpiAhMatchUuid (
+ UINT8 *Data);
+
+/*
+ * utprint - printf/vprintf output functions
+ */
+const char *
+AcpiUtScanNumber (
+ const char *String,
+ UINT64 *NumberPtr);
+
+const char *
+AcpiUtPrintNumber (
+ char *String,
+ UINT64 Number);
+
+int
+AcpiUtVsnprintf (
+ char *String,
+ ACPI_SIZE Size,
+ const char *Format,
+ va_list Args);
+
+int
+AcpiUtSnprintf (
+ char *String,
+ ACPI_SIZE Size,
+ const char *Format,
+ ...);
+
+#ifdef ACPI_APPLICATION
+int
+AcpiUtFileVprintf (
+ ACPI_FILE File,
+ const char *Format,
+ va_list Args);
+
+int
+AcpiUtFilePrintf (
+ ACPI_FILE File,
+ const char *Format,
+ ...);
+#endif
+
+/*
+ * utuuid -- UUID support functions
+ */
+void
+AcpiUtConvertStringToUuid (
+ char *InString,
+ UINT8 *UuidBuffer);
+
#endif /* _ACUTILS_H */
diff --git a/sys/contrib/dev/acpica/include/amlcode.h b/sys/contrib/dev/acpica/include/amlcode.h
index 66af4c2..03530b9 100644
--- a/sys/contrib/dev/acpica/include/amlcode.h
+++ b/sys/contrib/dev/acpica/include/amlcode.h
@@ -7,7 +7,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/amlresrc.h b/sys/contrib/dev/acpica/include/amlresrc.h
index 8e68559..b38028e 100644
--- a/sys/contrib/dev/acpica/include/amlresrc.h
+++ b/sys/contrib/dev/acpica/include/amlresrc.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -122,6 +122,14 @@ typedef struct asl_resource_node
} ASL_RESOURCE_NODE;
+typedef struct asl_resource_info
+{
+ ACPI_PARSE_OBJECT *DescriptorTypeOp; /* Resource descriptor parse node */
+ ACPI_PARSE_OBJECT *MappingOp; /* Used for mapfile support */
+ UINT32 CurrentByteOffset; /* Offset in resource template */
+
+} ASL_RESOURCE_INFO;
+
/* Macros used to generate AML resource length fields */
@@ -574,4 +582,50 @@ typedef union aml_resource
} AML_RESOURCE;
+
+/* Interfaces used by both the disassembler and compiler */
+
+void
+MpSaveGpioInfo (
+ ACPI_PARSE_OBJECT *Op,
+ AML_RESOURCE *Resource,
+ UINT32 PinCount,
+ UINT16 *PinList,
+ char *DeviceName);
+
+void
+MpSaveSerialInfo (
+ ACPI_PARSE_OBJECT *Op,
+ AML_RESOURCE *Resource,
+ char *DeviceName);
+
+char *
+MpGetHidFromParseTree (
+ ACPI_NAMESPACE_NODE *HidNode);
+
+char *
+MpGetHidViaNamestring (
+ char *DeviceName);
+
+char *
+MpGetConnectionInfo (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 PinIndex,
+ ACPI_NAMESPACE_NODE **TargetNode,
+ char **TargetName);
+
+char *
+MpGetParentDeviceHid (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_NAMESPACE_NODE **TargetNode,
+ char **ParentDeviceName);
+
+char *
+MpGetDdnValue (
+ char *DeviceName);
+
+char *
+MpGetHidValue (
+ ACPI_NAMESPACE_NODE *DeviceNode);
+
#endif
diff --git a/sys/contrib/dev/acpica/include/platform/acenv.h b/sys/contrib/dev/acpica/include/platform/acenv.h
index 6866de2..759a68e 100644
--- a/sys/contrib/dev/acpica/include/platform/acenv.h
+++ b/sys/contrib/dev/acpica/include/platform/acenv.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -88,32 +88,55 @@
#define ACPI_DBG_TRACK_ALLOCATIONS
#endif
-/* AcpiNames configuration. Single threaded with debugger output enabled. */
-
-#ifdef ACPI_NAMES_APP
-#define ACPI_DEBUGGER
-#define ACPI_APPLICATION
-#define ACPI_SINGLE_THREADED
-#endif
-
/*
- * AcpiBin/AcpiDump/AcpiSrc/AcpiXtract configuration. All single
- * threaded, with no debug output.
+ * AcpiBin/AcpiDump/AcpiHelp/AcpiNames/AcpiSrc/AcpiXtract/Example configuration.
+ * All single threaded.
*/
-#if (defined ACPI_BIN_APP) || \
- (defined ACPI_DUMP_APP) || \
- (defined ACPI_SRC_APP) || \
- (defined ACPI_XTRACT_APP)
+#if (defined ACPI_BIN_APP) || \
+ (defined ACPI_DUMP_APP) || \
+ (defined ACPI_HELP_APP) || \
+ (defined ACPI_NAMES_APP) || \
+ (defined ACPI_SRC_APP) || \
+ (defined ACPI_XTRACT_APP) || \
+ (defined ACPI_EXAMPLE_APP)
#define ACPI_APPLICATION
#define ACPI_SINGLE_THREADED
#endif
+/* AcpiHelp configuration. Error messages disabled. */
+
#ifdef ACPI_HELP_APP
-#define ACPI_APPLICATION
-#define ACPI_SINGLE_THREADED
#define ACPI_NO_ERROR_MESSAGES
#endif
+/* AcpiNames configuration. Debug output enabled. */
+
+#ifdef ACPI_NAMES_APP
+#define ACPI_DEBUG_OUTPUT
+#endif
+
+/* AcpiExec/AcpiNames/Example configuration. Native RSDP used. */
+
+#if (defined ACPI_EXEC_APP) || \
+ (defined ACPI_EXAMPLE_APP) || \
+ (defined ACPI_NAMES_APP)
+#define ACPI_USE_NATIVE_RSDP_POINTER
+#endif
+
+/* AcpiDump configuration. Native mapping used if provied by OSPMs */
+
+#ifdef ACPI_DUMP_APP
+#define ACPI_USE_NATIVE_MEMORY_MAPPING
+#define USE_NATIVE_ALLOCATE_ZEROED
+#endif
+
+/* AcpiNames/Example configuration. Hardware disabled */
+
+#if (defined ACPI_EXAMPLE_APP) || \
+ (defined ACPI_NAMES_APP)
+#define ACPI_REDUCED_HARDWARE 1
+#endif
+
/* Linkable ACPICA library */
#ifdef ACPI_LIBRARY
@@ -184,6 +207,9 @@
#elif defined(_AED_EFI)
#include "acefi.h"
+#elif defined(_GNU_EFI)
+#include "acefi.h"
+
#elif defined(__HAIKU__)
#include "achaiku.h"
@@ -396,4 +422,17 @@ typedef char *va_list;
#endif /* ACPI_USE_SYSTEM_CLIBRARY */
+#ifndef ACPI_FILE
+#ifdef ACPI_APPLICATION
+#include <stdio.h>
+#define ACPI_FILE FILE *
+#define ACPI_FILE_OUT stdout
+#define ACPI_FILE_ERR stderr
+#else
+#define ACPI_FILE void *
+#define ACPI_FILE_OUT NULL
+#define ACPI_FILE_ERR NULL
+#endif /* ACPI_APPLICATION */
+#endif /* ACPI_FILE */
+
#endif /* __ACENV_H__ */
diff --git a/sys/contrib/dev/acpica/include/platform/acenvex.h b/sys/contrib/dev/acpica/include/platform/acenvex.h
new file mode 100644
index 0000000..d08d03b
--- /dev/null
+++ b/sys/contrib/dev/acpica/include/platform/acenvex.h
@@ -0,0 +1,63 @@
+/******************************************************************************
+ *
+ * Name: acenvex.h - Extra host and compiler configuration
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#ifndef __ACENVEX_H__
+#define __ACENVEX_H__
+
+/*! [Begin] no source code translation */
+
+/******************************************************************************
+ *
+ * Extra host configuration files. All ACPICA headers are included before
+ * including these files.
+ *
+ *****************************************************************************/
+
+#if defined(_LINUX) || defined(__linux__)
+#include "aclinuxex.h"
+
+#endif
+
+/*! [End] no source code translation !*/
+
+#endif /* __ACENVEX_H__ */
diff --git a/sys/contrib/dev/acpica/include/platform/acfreebsd.h b/sys/contrib/dev/acpica/include/platform/acfreebsd.h
index 34786c3..f4ba48c 100644
--- a/sys/contrib/dev/acpica/include/platform/acfreebsd.h
+++ b/sys/contrib/dev/acpica/include/platform/acfreebsd.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/include/platform/acgcc.h b/sys/contrib/dev/acpica/include/platform/acgcc.h
index 1662a9b..2a27445 100644
--- a/sys/contrib/dev/acpica/include/platform/acgcc.h
+++ b/sys/contrib/dev/acpica/include/platform/acgcc.h
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -48,7 +48,7 @@
/* Function name is used for debug output. Non-ANSI, compiler-dependent */
-#define ACPI_GET_FUNCTION_NAME __FUNCTION__
+#define ACPI_GET_FUNCTION_NAME __func__
/*
* This macro is used to tag functions as "printf-like" because
@@ -64,4 +64,15 @@
*/
#define ACPI_UNUSED_VAR __attribute__ ((unused))
+/*
+ * Some versions of gcc implement strchr() with a buggy macro. So,
+ * undef it here. Prevents error messages of this form (usually from the
+ * file getopt.c):
+ *
+ * error: logical '&&' with non-zero constant will always evaluate as true
+ */
+#ifdef strchr
+#undef strchr
+#endif
+
#endif /* __ACGCC_H__ */
diff --git a/sys/contrib/dev/acpica/os_specific/service_layers/oslibcfs.c b/sys/contrib/dev/acpica/os_specific/service_layers/oslibcfs.c
new file mode 100644
index 0000000..c24cca4
--- /dev/null
+++ b/sys/contrib/dev/acpica/os_specific/service_layers/oslibcfs.c
@@ -0,0 +1,255 @@
+/******************************************************************************
+ *
+ * Module Name: oslibcfs - C library OSL for file I/O
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include <contrib/dev/acpica/include/acpi.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+#define _COMPONENT ACPI_OS_SERVICES
+ ACPI_MODULE_NAME ("oslibcfs")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiOsOpenFile
+ *
+ * PARAMETERS: Path - File path
+ * Modes - File operation type
+ *
+ * RETURN: File descriptor.
+ *
+ * DESCRIPTION: Open a file for reading (ACPI_FILE_READING) or/and writing
+ * (ACPI_FILE_WRITING).
+ *
+ ******************************************************************************/
+
+ACPI_FILE
+AcpiOsOpenFile (
+ const char *Path,
+ UINT8 Modes)
+{
+ ACPI_FILE File;
+ UINT32 i = 0;
+ char ModesStr[4];
+
+
+ if (Modes & ACPI_FILE_READING)
+ {
+ ModesStr[i++] = 'r';
+ }
+ if (Modes & ACPI_FILE_WRITING)
+ {
+ ModesStr[i++] = 'w';
+ }
+ if (Modes & ACPI_FILE_BINARY)
+ {
+ ModesStr[i++] = 'b';
+ }
+
+ ModesStr[i++] = '\0';
+
+ File = fopen (Path, ModesStr);
+ if (!File)
+ {
+ perror ("Could not open file");
+ }
+
+ return (File);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiOsCloseFile
+ *
+ * PARAMETERS: File - An open file descriptor
+ *
+ * RETURN: None.
+ *
+ * DESCRIPTION: Close a file opened via AcpiOsOpenFile.
+ *
+ ******************************************************************************/
+
+void
+AcpiOsCloseFile (
+ ACPI_FILE File)
+{
+ fclose (File);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiOsReadFile
+ *
+ * PARAMETERS: File - An open file descriptor
+ * Buffer - Data buffer
+ * Size - Data block size
+ * Count - Number of data blocks
+ *
+ * RETURN: Number of bytes actually read.
+ *
+ * DESCRIPTION: Read from a file.
+ *
+ ******************************************************************************/
+
+int
+AcpiOsReadFile (
+ ACPI_FILE File,
+ void *Buffer,
+ ACPI_SIZE Size,
+ ACPI_SIZE Count)
+{
+ int Length;
+
+
+ Length = fread (Buffer, Size, Count, File);
+ if (Length < 0)
+ {
+ perror ("Error reading file");
+ }
+
+ return (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiOsWriteFile
+ *
+ * PARAMETERS: File - An open file descriptor
+ * Buffer - Data buffer
+ * Size - Data block size
+ * Count - Number of data blocks
+ *
+ * RETURN: Number of bytes actually written.
+ *
+ * DESCRIPTION: Write to a file.
+ *
+ ******************************************************************************/
+
+int
+AcpiOsWriteFile (
+ ACPI_FILE File,
+ void *Buffer,
+ ACPI_SIZE Size,
+ ACPI_SIZE Count)
+{
+ int Length;
+
+
+ Length = fwrite (Buffer, Size, Count, File);
+ if (Length < 0)
+ {
+ perror ("Error writing file");
+ }
+
+ return (Length);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiOsGetFileOffset
+ *
+ * PARAMETERS: File - An open file descriptor
+ *
+ * RETURN: Current file pointer position.
+ *
+ * DESCRIPTION: Get current file offset.
+ *
+ ******************************************************************************/
+
+long
+AcpiOsGetFileOffset (
+ ACPI_FILE File)
+{
+ long Offset;
+
+
+ Offset = ftell (File);
+ return (Offset);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiOsSetFileOffset
+ *
+ * PARAMETERS: File - An open file descriptor
+ * Offset - New file offset
+ * From - From begin/end of file
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Set current file offset.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiOsSetFileOffset (
+ ACPI_FILE File,
+ long Offset,
+ UINT8 From)
+{
+ int Ret = 0;
+
+
+ if (From == ACPI_FILE_BEGIN)
+ {
+ Ret = fseek (File, Offset, SEEK_SET);
+ }
+ if (From == ACPI_FILE_END)
+ {
+ Ret = fseek (File, Offset, SEEK_END);
+ }
+
+ if (Ret < 0)
+ {
+ return (AE_ERROR);
+ }
+ else
+ {
+ return (AE_OK);
+ }
+}
diff --git a/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c b/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c
index 31bb471..fcd5fbc 100644
--- a/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c
+++ b/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
/*
* These interfaces are required in order to compile the ASL compiler and the
* various ACPICA tools under Linux or other Unix-like system.
@@ -65,16 +64,11 @@
ACPI_MODULE_NAME ("osunixxf")
-extern FILE *AcpiGbl_DebugFile;
-FILE *AcpiGbl_OutputFile;
+BOOLEAN AcpiGbl_DebugTimeout = FALSE;
/* Upcalls to AcpiExec */
-ACPI_PHYSICAL_ADDRESS
-AeLocalGetRootPointer (
- void);
-
void
AeTableOverride (
ACPI_TABLE_HEADER *ExistingTable,
@@ -84,7 +78,127 @@ typedef void* (*PTHREAD_CALLBACK) (void *);
/* Buffer used by AcpiOsVprintf */
-#define ACPI_VPRINTF_BUFFER_SIZE 512
+#define ACPI_VPRINTF_BUFFER_SIZE 512
+#define _ASCII_NEWLINE '\n'
+
+/* Terminal support for AcpiExec only */
+
+#ifdef ACPI_EXEC_APP
+#include <termios.h>
+
+struct termios OriginalTermAttributes;
+int TermAttributesWereSet = 0;
+
+ACPI_STATUS
+AcpiUtReadLine (
+ char *Buffer,
+ UINT32 BufferLength,
+ UINT32 *BytesRead);
+
+static void
+OsEnterLineEditMode (
+ void);
+
+static void
+OsExitLineEditMode (
+ void);
+
+
+/******************************************************************************
+ *
+ * FUNCTION: OsEnterLineEditMode, OsExitLineEditMode
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Enter/Exit the raw character input mode for the terminal.
+ *
+ * Interactive line-editing support for the AML debugger. Used with the
+ * common/acgetline module.
+ *
+ * readline() is not used because of non-portability. It is not available
+ * on all systems, and if it is, often the package must be manually installed.
+ *
+ * Therefore, we use the POSIX tcgetattr/tcsetattr and do the minimal line
+ * editing that we need in AcpiOsGetLine.
+ *
+ * If the POSIX tcgetattr/tcsetattr interfaces are unavailable, these
+ * calls will also work:
+ * For OsEnterLineEditMode: system ("stty cbreak -echo")
+ * For OsExitLineEditMode: system ("stty cooked echo")
+ *
+ *****************************************************************************/
+
+static void
+OsEnterLineEditMode (
+ void)
+{
+ struct termios LocalTermAttributes;
+
+
+ TermAttributesWereSet = 0;
+
+ /* STDIN must be a terminal */
+
+ if (!isatty (STDIN_FILENO))
+ {
+ return;
+ }
+
+ /* Get and keep the original attributes */
+
+ if (tcgetattr (STDIN_FILENO, &OriginalTermAttributes))
+ {
+ fprintf (stderr, "Could not get terminal attributes!\n");
+ return;
+ }
+
+ /* Set the new attributes to enable raw character input */
+
+ memcpy (&LocalTermAttributes, &OriginalTermAttributes,
+ sizeof (struct termios));
+
+ LocalTermAttributes.c_lflag &= ~(ICANON | ECHO);
+ LocalTermAttributes.c_cc[VMIN] = 1;
+ LocalTermAttributes.c_cc[VTIME] = 0;
+
+ if (tcsetattr (STDIN_FILENO, TCSANOW, &LocalTermAttributes))
+ {
+ fprintf (stderr, "Could not set terminal attributes!\n");
+ return;
+ }
+
+ TermAttributesWereSet = 1;
+}
+
+
+static void
+OsExitLineEditMode (
+ void)
+{
+
+ if (!TermAttributesWereSet)
+ {
+ return;
+ }
+
+ /* Set terminal attributes back to the original values */
+
+ if (tcsetattr (STDIN_FILENO, TCSANOW, &OriginalTermAttributes))
+ {
+ fprintf (stderr, "Could not restore terminal attributes!\n");
+ }
+}
+
+
+#else
+
+/* These functions are not needed for other ACPICA utilities */
+
+#define OsEnterLineEditMode()
+#define OsExitLineEditMode()
+#endif
/******************************************************************************
@@ -95,7 +209,7 @@ typedef void* (*PTHREAD_CALLBACK) (void *);
*
* RETURN: Status
*
- * DESCRIPTION: Init and terminate. Nothing to do.
+ * DESCRIPTION: Initialize and terminate this module.
*
*****************************************************************************/
@@ -103,21 +217,33 @@ ACPI_STATUS
AcpiOsInitialize (
void)
{
+ ACPI_STATUS Status;
+
AcpiGbl_OutputFile = stdout;
+
+ OsEnterLineEditMode ();
+
+ Status = AcpiOsCreateLock (&AcpiGbl_PrintLock);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
return (AE_OK);
}
-
ACPI_STATUS
AcpiOsTerminate (
void)
{
+ OsExitLineEditMode ();
return (AE_OK);
}
+#ifndef ACPI_USE_NATIVE_RSDP_POINTER
/******************************************************************************
*
* FUNCTION: AcpiOsGetRootPointer
@@ -135,8 +261,9 @@ AcpiOsGetRootPointer (
void)
{
- return (AeLocalGetRootPointer ());
+ return (0);
}
+#endif
/******************************************************************************
@@ -370,6 +497,7 @@ AcpiOsVprintf (
}
+#ifndef ACPI_EXEC_APP
/******************************************************************************
*
* FUNCTION: AcpiOsGetLine
@@ -380,7 +508,9 @@ AcpiOsVprintf (
*
* RETURN: Status and actual bytes read
*
- * DESCRIPTION: Formatted input with argument list pointer
+ * DESCRIPTION: Get the next input line from the terminal. NOTE: For the
+ * AcpiExec utility, we use the acgetline module instead to
+ * provide line-editing and history support.
*
*****************************************************************************/
@@ -390,44 +520,49 @@ AcpiOsGetLine (
UINT32 BufferLength,
UINT32 *BytesRead)
{
- int Temp;
- UINT32 i;
+ int InputChar;
+ UINT32 EndOfLine;
+
+ /* Standard AcpiOsGetLine for all utilities except AcpiExec */
- for (i = 0; ; i++)
+ for (EndOfLine = 0; ; EndOfLine++)
{
- if (i >= BufferLength)
+ if (EndOfLine >= BufferLength)
{
return (AE_BUFFER_OVERFLOW);
}
- if ((Temp = getchar ()) == EOF)
+ if ((InputChar = getchar ()) == EOF)
{
return (AE_ERROR);
}
- if (!Temp || Temp == '\n')
+ if (!InputChar || InputChar == _ASCII_NEWLINE)
{
break;
}
- Buffer [i] = (char) Temp;
+ Buffer[EndOfLine] = (char) InputChar;
}
/* Null terminate the buffer */
- Buffer [i] = 0;
+ Buffer[EndOfLine] = 0;
/* Return the number of bytes in the string */
if (BytesRead)
{
- *BytesRead = i;
+ *BytesRead = EndOfLine;
}
+
return (AE_OK);
}
+#endif
+#ifndef ACPI_USE_NATIVE_MEMORY_MAPPING
/******************************************************************************
*
* FUNCTION: AcpiOsMapMemory
@@ -473,6 +608,7 @@ AcpiOsUnmapMemory (
return;
}
+#endif
/******************************************************************************
@@ -499,6 +635,32 @@ AcpiOsAllocate (
}
+#ifdef USE_NATIVE_ALLOCATE_ZEROED
+/******************************************************************************
+ *
+ * FUNCTION: AcpiOsAllocateZeroed
+ *
+ * PARAMETERS: Size - Amount to allocate, in bytes
+ *
+ * RETURN: Pointer to the new allocation. Null on error.
+ *
+ * DESCRIPTION: Allocate and zero memory. Algorithm is dependent on the OS.
+ *
+ *****************************************************************************/
+
+void *
+AcpiOsAllocateZeroed (
+ ACPI_SIZE size)
+{
+ void *Mem;
+
+
+ Mem = (void *) calloc (1, (size_t) size);
+ return (Mem);
+}
+#endif
+
+
/******************************************************************************
*
* FUNCTION: AcpiOsFree
@@ -1005,7 +1167,7 @@ AcpiOsGetTimer (
* FUNCTION: AcpiOsReadPciConfiguration
*
* PARAMETERS: PciId - Seg/Bus/Dev
- * Register - Device Register
+ * PciRegister - Device Register
* Value - Buffer where value is placed
* Width - Number of bits
*
@@ -1018,7 +1180,7 @@ AcpiOsGetTimer (
ACPI_STATUS
AcpiOsReadPciConfiguration (
ACPI_PCI_ID *PciId,
- UINT32 Register,
+ UINT32 PciRegister,
UINT64 *Value,
UINT32 Width)
{
@@ -1033,7 +1195,7 @@ AcpiOsReadPciConfiguration (
* FUNCTION: AcpiOsWritePciConfiguration
*
* PARAMETERS: PciId - Seg/Bus/Dev
- * Register - Device Register
+ * PciRegister - Device Register
* Value - Value to be written
* Width - Number of bits
*
@@ -1046,7 +1208,7 @@ AcpiOsReadPciConfiguration (
ACPI_STATUS
AcpiOsWritePciConfiguration (
ACPI_PCI_ID *PciId,
- UINT32 Register,
+ UINT32 PciRegister,
UINT64 Value,
UINT32 Width)
{
@@ -1242,7 +1404,7 @@ AcpiOsWritable (
*
* FUNCTION: AcpiOsSignal
*
- * PARAMETERS: Function - ACPI CA signal function code
+ * PARAMETERS: Function - ACPI A signal function code
* Info - Pointer to function-dependent structure
*
* RETURN: Status
@@ -1334,6 +1496,26 @@ AcpiOsExecute (
return (0);
}
+#else /* ACPI_SINGLE_THREADED */
+ACPI_THREAD_ID
+AcpiOsGetThreadId (
+ void)
+{
+ return (1);
+}
+
+ACPI_STATUS
+AcpiOsExecute (
+ ACPI_EXECUTE_TYPE Type,
+ ACPI_OSD_EXEC_CALLBACK Function,
+ void *Context)
+{
+
+ Function (Context);
+
+ return (AE_OK);
+}
+
#endif /* ACPI_SINGLE_THREADED */
OpenPOWER on IntegriCloud