diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/Makefile | 715 | ||||
-rw-r--r-- | compiler/aslcompile.c | 11 | ||||
-rw-r--r-- | compiler/aslcompiler.h | 14 | ||||
-rw-r--r-- | compiler/asldefine.h | 1 | ||||
-rw-r--r-- | compiler/aslerror.c | 7 | ||||
-rw-r--r-- | compiler/aslfiles.c | 93 | ||||
-rw-r--r-- | compiler/aslglobal.h | 5 | ||||
-rw-r--r-- | compiler/aslmain.c | 34 | ||||
-rw-r--r-- | compiler/aslstartup.c | 21 | ||||
-rw-r--r-- | compiler/aslutils.c | 45 | ||||
-rw-r--r-- | compiler/dtcompile.c | 39 | ||||
-rw-r--r-- | compiler/dtcompiler.h | 38 | ||||
-rw-r--r-- | compiler/dtfield.c | 153 | ||||
-rw-r--r-- | compiler/dtio.c | 250 | ||||
-rw-r--r-- | compiler/dttable.c | 20 | ||||
-rw-r--r-- | compiler/dttemplate.c | 445 | ||||
-rw-r--r-- | compiler/dttemplate.h | 757 | ||||
-rw-r--r-- | compiler/dtutils.c | 18 |
18 files changed, 2306 insertions, 360 deletions
diff --git a/compiler/Makefile b/compiler/Makefile index 6b6ac5c5105d..962ab670235a 100644 --- a/compiler/Makefile +++ b/compiler/Makefile @@ -1,161 +1,580 @@ - +# +# iASL compiler/disassembler +# + PROG= iasl -SRCS= \ - aslcompilerparse.c \ - aslcompilerlex.c \ - aslanalyze.c \ - aslcodegen.c \ - aslcompile.c \ - aslerror.c \ - aslfiles.c \ - aslfold.c \ - asllength.c \ - asllisting.c \ - aslload.c \ - asllookup.c \ - aslmain.c \ - aslmap.c \ - aslopcodes.c \ - asloperands.c \ - aslopt.c \ - aslpredef.c \ - aslresource.c \ - aslrestype1.c \ - aslrestype1i.c \ - aslrestype2.c \ - aslrestype2d.c \ - aslrestype2e.c \ - aslrestype2q.c \ - aslrestype2w.c \ - aslstartup.c \ - aslstubs.c \ - asltransform.c \ - asltree.c \ - aslutils.c \ - dtcompile.c \ - dtfield.c \ - dtio.c \ - dtsubtable.c \ - dttable.c \ - dtutils.c \ - ../common/getopt.c \ - ../utilities/utalloc.c \ - ../utilities/utcache.c \ - ../utilities/utcopy.c \ - ../utilities/utdebug.c \ - ../utilities/utdelete.c \ - ../utilities/utglobal.c \ - ../utilities/utinit.c \ - ../utilities/utlock.c \ - ../utilities/utobject.c \ - ../utilities/utmisc.c \ - ../utilities/utmath.c \ - ../utilities/utmutex.c \ - ../utilities/utresrc.c \ - ../utilities/utstate.c \ - ../utilities/utxface.c \ - ../namespace/nsaccess.c \ - ../namespace/nsalloc.c \ - ../namespace/nsdump.c \ - ../namespace/nsnames.c \ - ../namespace/nsobject.c \ - ../namespace/nsparse.c \ - ../namespace/nssearch.c \ - ../namespace/nsutils.c \ - ../namespace/nswalk.c \ - ../namespace/nsxfobj.c \ - ../parser/psargs.c \ - ../parser/psloop.c \ - ../parser/psopcode.c \ - ../parser/psparse.c \ - ../parser/psscope.c \ - ../parser/pstree.c \ - ../parser/psutils.c \ - ../parser/pswalk.c \ - ../dispatcher/dswscope.c \ - ../dispatcher/dswstate.c \ - ../dispatcher/dsfield.c \ - ../dispatcher/dsobject.c \ - ../dispatcher/dsopcode.c \ - ../dispatcher/dsutils.c \ - ../dispatcher/dswexec.c \ - ../dispatcher/dswload.c \ - ../executer/exconvrt.c \ - ../executer/excreate.c \ - ../executer/exdump.c \ - ../executer/exmisc.c \ - ../executer/exmutex.c \ - ../executer/exnames.c \ - ../executer/exoparg1.c \ - ../executer/exoparg2.c \ - ../executer/exoparg3.c \ - ../executer/exoparg6.c \ - ../executer/exprep.c \ - ../executer/exregion.c \ - ../executer/exresnte.c \ - ../executer/exresolv.c \ - ../executer/exresop.c \ - ../executer/exstore.c \ - ../executer/exstoren.c \ - ../executer/exstorob.c \ - ../executer/exsystem.c \ - ../executer/exutils.c \ - ../common/adfile.c \ - ../common/adisasm.c \ - ../common/adwalk.c \ - ../common/dmextern.c \ - ../common/dmrestag.c \ - ../common/dmtable.c \ - ../common/dmtbinfo.c \ - ../common/dmtbdump.c \ - ../debugger/dbfileio.c \ - ../disassembler/dmbuffer.c \ - ../disassembler/dmnames.c \ - ../disassembler/dmopcode.c \ - ../disassembler/dmobject.c \ - ../disassembler/dmresrc.c \ - ../disassembler/dmresrcl.c \ - ../disassembler/dmresrcs.c \ - ../disassembler/dmutils.c \ - ../disassembler/dmwalk.c \ - ../tables/tbfadt.c \ - ../tables/tbinstal.c \ - ../tables/tbutils.c \ - ../tables/tbxface.c \ - ../osunixxf.c + +ACPICA_SRC = .. +ASL_COMPILER = $(ACPICA_SRC)/compiler +ACPICA_COMMON = $(ACPICA_SRC)/common +ACPICA_CORE = $(ACPICA_SRC)/components +ACPICA_TOOLS = $(ACPICA_SRC)/tools +ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers NOMAN= YES CFLAGS+= -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include -I../compiler -#YACC= yacc -YACC= bison -YFLAGS+= -v -d -LEX= flex -LFLAGS+= -i +# +# Bison/Flex configuration +# +YACC= bison +YFLAGS+= -v -d -y -pAslCompiler -#.if $(YACC) == "bison" -YFLAGS+= -y -pAslCompiler -#.else -#CFLAGS+= -D_USE_BERKELEY_YACC -#.endif +LEX= flex +LFLAGS+= -i -s -PAslCompiler -LDLIBS = -lpthread -lrt -aslmain : $(patsubst %.c,%.o, $(SRCS)) - $(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) \ - $(LOADLIBES) $(LDLIBS) -o iasl +COMPILE = $(CC) -c $(CFLAGS) -o$@ $? +LDFLAGS += -lpthread -lrt -CLEANFILES= y.output y.tab.c y.tab.h aslcompiler.y.h \ - aslcompilerparse.c aslcompilerlex.c iasl -aslcompilerparse.c: aslcompiler.y - ${YACC} ${YFLAGS} aslcompiler.y - cp y.tab.c aslcompilerparse.c - cp y.tab.h aslcompiler.y.h +OBJS = \ + adfile.o \ + adisasm.o \ + adwalk.o \ + aslanalyze.o \ + aslcodegen.o \ + aslcompile.o \ + aslcompilerlex.o \ + aslcompilerparse.o \ + aslerror.o \ + aslfiles.o \ + aslfold.o \ + asllength.o \ + asllisting.o \ + aslload.o \ + asllookup.o \ + aslmain.o \ + aslmap.o \ + aslopcodes.o \ + asloperands.o \ + aslopt.o \ + aslpredef.o \ + aslresource.o \ + aslrestype1.o \ + aslrestype1i.o \ + aslrestype2.o \ + aslrestype2d.o \ + aslrestype2e.o \ + aslrestype2q.o \ + aslrestype2w.o \ + aslstartup.o \ + aslstubs.o \ + asltransform.o \ + asltree.o \ + aslutils.o \ + dtcompile.o \ + dtfield.o \ + dtio.o \ + dtsubtable.o \ + dttable.o \ + dttemplate.o \ + dtutils.o \ + dbfileio.o \ + dmbuffer.o \ + dmextern.o \ + dmnames.o \ + dmobject.o \ + dmopcode.o \ + dmresrc.o \ + dmresrcl.o \ + dmresrcs.o \ + dmrestag.o \ + dmtable.o \ + dmtbdump.o \ + dmtbinfo.o \ + dmutils.o \ + dmwalk.o \ + dsfield.o \ + dsobject.o \ + dsopcode.o \ + dsutils.o \ + dswexec.o \ + dswload.o \ + dswscope.o \ + dswstate.o \ + exconvrt.o \ + excreate.o \ + exdump.o \ + exmisc.o \ + exmutex.o \ + exnames.o \ + exoparg1.o \ + exoparg2.o \ + exoparg3.o \ + exoparg6.o \ + exprep.o \ + exregion.o \ + exresnte.o \ + exresolv.o \ + exresop.o \ + exstore.o \ + exstoren.o \ + exstorob.o \ + exsystem.o \ + exutils.o \ + getopt.o \ + nsaccess.o \ + nsalloc.o \ + nsdump.o \ + nsnames.o \ + nsobject.o \ + nsparse.o \ + nssearch.o \ + nsutils.o \ + nswalk.o \ + nsxfobj.o \ + osunixxf.o \ + psargs.o \ + psloop.o \ + psopcode.o \ + psparse.o \ + psscope.o \ + pstree.o \ + psutils.o \ + pswalk.o \ + tbfadt.o \ + tbinstal.o \ + tbutils.o \ + tbxface.o \ + utalloc.o \ + utcache.o \ + utcopy.o \ + utdebug.o \ + utdelete.o \ + utglobal.o \ + utinit.o \ + utlock.o \ + utmath.o \ + utmisc.o \ + utmutex.o \ + utobject.o \ + utresrc.o \ + utstate.o \ + utxface.o -aslcompilerlex.c: aslcompiler.l - ${LEX} ${LFLAGS} -PAslCompiler -oaslcompilerlex.c aslcompiler.l +INTERMEDIATES = \ + aslcompilerlex.c \ + aslcompilerparse.c -clean : - rm -f $(CLEANFILES) $(patsubst %.c,%.o, $(SRCS)) +MISC = \ + aslcompiler.y.h \ + aslcompilerparse.output + + +# +# Root rule +# +$(PROG) : $(INTERMEDIATES) $(OBJS) + $(CC) $(LDFLAGS) $(OBJS) -o $(PROG) + $(COPYPROG) + + +# +# Parser and Lexer - intermediate C files +# +aslcompilerlex.c : $(ASL_COMPILER)/aslcompiler.l + ${LEX} ${LFLAGS} -o$@ $? + +aslcompilerparse.c : $(ASL_COMPILER)/aslcompiler.y + ${YACC} ${YFLAGS} -o$@ $? + @mv -f aslcompilerparse.h aslcompiler.y.h + +# +# Parser and Lexer - final object files +# +# Cannot use the common compile warning flags since the C files are created +# by the utilities above and they are not necessarily ANSI C, etc. +# +aslcompilerlex.o : aslcompilerlex.c + $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $? + +aslcompilerparse.o : aslcompilerparse.c + $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $? + + +# +# Compiler source +# +aslanalyze.o : $(ASL_COMPILER)/aslanalyze.c + $(COMPILE) + +aslcodegen.o : $(ASL_COMPILER)/aslcodegen.c + $(COMPILE) + +aslcompile.o : $(ASL_COMPILER)/aslcompile.c + $(COMPILE) + +aslerror.o : $(ASL_COMPILER)/aslerror.c + $(COMPILE) + +aslfiles.o : $(ASL_COMPILER)/aslfiles.c + $(COMPILE) + +aslfold.o : $(ASL_COMPILER)/aslfold.c + $(COMPILE) + +asllength.o : $(ASL_COMPILER)/asllength.c + $(COMPILE) + +asllisting.o : $(ASL_COMPILER)/asllisting.c + $(COMPILE) + +aslload.o : $(ASL_COMPILER)/aslload.c + $(COMPILE) + +asllookup.o : $(ASL_COMPILER)/asllookup.c + $(COMPILE) + +aslmain.o : $(ASL_COMPILER)/aslmain.c + $(COMPILE) + +aslmap.o : $(ASL_COMPILER)/aslmap.c + $(COMPILE) + +aslopcodes.o : $(ASL_COMPILER)/aslopcodes.c + $(COMPILE) + +asloperands.o : $(ASL_COMPILER)/asloperands.c + $(COMPILE) + +aslopt.o : $(ASL_COMPILER)/aslopt.c + $(COMPILE) + +aslpredef.o : $(ASL_COMPILER)/aslpredef.c + $(COMPILE) + +aslresource.o : $(ASL_COMPILER)/aslresource.c + $(COMPILE) + +aslrestype1.o : $(ASL_COMPILER)/aslrestype1.c + $(COMPILE) + +aslrestype1i.o : $(ASL_COMPILER)/aslrestype1i.c + $(COMPILE) + +aslrestype2.o : $(ASL_COMPILER)/aslrestype2.c + $(COMPILE) + +aslrestype2d.o : $(ASL_COMPILER)/aslrestype2d.c + $(COMPILE) + +aslrestype2e.o : $(ASL_COMPILER)/aslrestype2e.c + $(COMPILE) + +aslrestype2q.o : $(ASL_COMPILER)/aslrestype2q.c + $(COMPILE) + +aslrestype2w.o : $(ASL_COMPILER)/aslrestype2w.c + $(COMPILE) + +aslstartup.o : $(ASL_COMPILER)/aslstartup.c + $(COMPILE) + +aslstubs.o : $(ASL_COMPILER)/aslstubs.c + $(COMPILE) + +asltransform.o : $(ASL_COMPILER)/asltransform.c + $(COMPILE) + +asltree.o : $(ASL_COMPILER)/asltree.c + $(COMPILE) + +aslutils.o : $(ASL_COMPILER)/aslutils.c + $(COMPILE) + + +# +# Data Table Compiler +# +dtcompile.o : $(ASL_COMPILER)/dtcompile.c + $(COMPILE) + +dtfield.o : $(ASL_COMPILER)/dtfield.c + $(COMPILE) + +dtio.o : $(ASL_COMPILER)/dtio.c + $(COMPILE) + +dtsubtable.o : $(ASL_COMPILER)/dtsubtable.c + $(COMPILE) + +dttable.o : $(ASL_COMPILER)/dttable.c + $(COMPILE) + +dttemplate.o : $(ASL_COMPILER)/dttemplate.c + $(COMPILE) + +dtutils.o : $(ASL_COMPILER)/dtutils.c + $(COMPILE) + + +# +# ACPICA core source - common +# +adfile.o : $(ACPICA_COMMON)/adfile.c + $(COMPILE) + +adisasm.o : $(ACPICA_COMMON)/adisasm.c + $(COMPILE) + +adwalk.o : $(ACPICA_COMMON)/adwalk.c + $(COMPILE) + +dmextern.o : $(ACPICA_COMMON)/dmextern.c + $(COMPILE) + +dmrestag.o : $(ACPICA_COMMON)/dmrestag.c + $(COMPILE) + +dmtable.o : $(ACPICA_COMMON)/dmtable.c + $(COMPILE) + +dmtbdump.o : $(ACPICA_COMMON)/dmtbdump.c + $(COMPILE) + +dmtbinfo.o : $(ACPICA_COMMON)/dmtbinfo.c + $(COMPILE) + +getopt.o : $(ACPICA_COMMON)/getopt.c + $(COMPILE) + + +# +# ACPICA core source +# +dbfileio.o : $(ACPICA_CORE)/debugger/dbfileio.c + $(COMPILE) + +dmbuffer.o : $(ACPICA_CORE)/disassembler/dmbuffer.c + $(COMPILE) + +dmnames.o : $(ACPICA_CORE)/disassembler/dmnames.c + $(COMPILE) + +dmobject.o : $(ACPICA_CORE)/disassembler/dmobject.c + $(COMPILE) + +dmopcode.o : $(ACPICA_CORE)/disassembler/dmopcode.c + $(COMPILE) + +dmresrc.o : $(ACPICA_CORE)/disassembler/dmresrc.c + $(COMPILE) + +dmresrcl.o : $(ACPICA_CORE)/disassembler/dmresrcl.c + $(COMPILE) + +dmresrcs.o : $(ACPICA_CORE)/disassembler/dmresrcs.c + $(COMPILE) + +dmutils.o : $(ACPICA_CORE)/disassembler/dmutils.c + $(COMPILE) +dmwalk.o : $(ACPICA_CORE)/disassembler/dmwalk.c + $(COMPILE) + +dsfield.o : $(ACPICA_CORE)/dispatcher/dsfield.c + $(COMPILE) + +dsobject.o : $(ACPICA_CORE)/dispatcher/dsobject.c + $(COMPILE) + +dsopcode.o : $(ACPICA_CORE)/dispatcher/dsopcode.c + $(COMPILE) + +dsutils.o : $(ACPICA_CORE)/dispatcher/dsutils.c + $(COMPILE) + +dswexec.o : $(ACPICA_CORE)/dispatcher/dswexec.c + $(COMPILE) + +dswload.o : $(ACPICA_CORE)/dispatcher/dswload.c + $(COMPILE) + +dswscope.o : $(ACPICA_CORE)/dispatcher/dswscope.c + $(COMPILE) + +dswstate.o : $(ACPICA_CORE)/dispatcher/dswstate.c + $(COMPILE) + +exconvrt.o : $(ACPICA_CORE)/executer/exconvrt.c + $(COMPILE) + +excreate.o : $(ACPICA_CORE)/executer/excreate.c + $(COMPILE) + +exdump.o : $(ACPICA_CORE)/executer/exdump.c + $(COMPILE) + +exmisc.o : $(ACPICA_CORE)/executer/exmisc.c + $(COMPILE) + +exmutex.o : $(ACPICA_CORE)/executer/exmutex.c + $(COMPILE) + +exnames.o : $(ACPICA_CORE)/executer/exnames.c + $(COMPILE) + +exoparg1.o : $(ACPICA_CORE)/executer/exoparg1.c + $(COMPILE) + +exoparg2.o : $(ACPICA_CORE)/executer/exoparg2.c + $(COMPILE) + +exoparg3.o : $(ACPICA_CORE)/executer/exoparg3.c + $(COMPILE) + +exoparg6.o : $(ACPICA_CORE)/executer/exoparg6.c + $(COMPILE) + +exprep.o : $(ACPICA_CORE)/executer/exprep.c + $(COMPILE) + +exregion.o : $(ACPICA_CORE)/executer/exregion.c + $(COMPILE) + +exresnte.o : $(ACPICA_CORE)/executer/exresnte.c + $(COMPILE) + +exresolv.o : $(ACPICA_CORE)/executer/exresolv.c + $(COMPILE) + +exresop.o : $(ACPICA_CORE)/executer/exresop.c + $(COMPILE) + +exstore.o : $(ACPICA_CORE)/executer/exstore.c + $(COMPILE) + +exstoren.o : $(ACPICA_CORE)/executer/exstoren.c + $(COMPILE) + +exstorob.o : $(ACPICA_CORE)/executer/exstorob.c + $(COMPILE) + +exsystem.o : $(ACPICA_CORE)/executer/exsystem.c + $(COMPILE) + +exutils.o : $(ACPICA_CORE)/executer/exutils.c + $(COMPILE) + +nsaccess.o : $(ACPICA_CORE)/namespace/nsaccess.c + $(COMPILE) + +nsalloc.o : $(ACPICA_CORE)/namespace/nsalloc.c + $(COMPILE) + +nsdump.o : $(ACPICA_CORE)/namespace/nsdump.c + $(COMPILE) + +nsnames.o : $(ACPICA_CORE)/namespace/nsnames.c + $(COMPILE) + +nsobject.o : $(ACPICA_CORE)/namespace/nsobject.c + $(COMPILE) + +nsparse.o : $(ACPICA_CORE)/namespace/nsparse.c + $(COMPILE) + +nssearch.o : $(ACPICA_CORE)/namespace/nssearch.c + $(COMPILE) + +nsutils.o : $(ACPICA_CORE)/namespace/nsutils.c + $(COMPILE) + +nswalk.o : $(ACPICA_CORE)/namespace/nswalk.c + $(COMPILE) + +nsxfobj.o : $(ACPICA_CORE)/namespace/nsxfobj.c + $(COMPILE) + +psargs.o : $(ACPICA_CORE)/parser/psargs.c + $(COMPILE) + +psloop.o : $(ACPICA_CORE)/parser/psloop.c + $(COMPILE) + +psopcode.o : $(ACPICA_CORE)/parser/psopcode.c + $(COMPILE) + +psparse.o : $(ACPICA_CORE)/parser/psparse.c + $(COMPILE) + +psscope.o : $(ACPICA_CORE)/parser/psscope.c + $(COMPILE) + +pstree.o : $(ACPICA_CORE)/parser/pstree.c + $(COMPILE) + +psutils.o : $(ACPICA_CORE)/parser/psutils.c + $(COMPILE) + +pswalk.o : $(ACPICA_CORE)/parser/pswalk.c + $(COMPILE) + +tbfadt.o : $(ACPICA_CORE)/tables/tbfadt.c + $(COMPILE) + +tbinstal.o : $(ACPICA_CORE)/tables/tbinstal.c + $(COMPILE) + +tbutils.o : $(ACPICA_CORE)/tables/tbutils.c + $(COMPILE) + +tbxface.o : $(ACPICA_CORE)/tables/tbxface.c + $(COMPILE) + +utalloc.o : $(ACPICA_CORE)/utilities/utalloc.c + $(COMPILE) + +utcache.o : $(ACPICA_CORE)/utilities/utcache.c + $(COMPILE) + +utcopy.o : $(ACPICA_CORE)/utilities/utcopy.c + $(COMPILE) + +utdebug.o : $(ACPICA_CORE)/utilities/utdebug.c + $(COMPILE) + +utdelete.o : $(ACPICA_CORE)/utilities/utdelete.c + $(COMPILE) + +utglobal.o : $(ACPICA_CORE)/utilities/utglobal.c + $(COMPILE) + +utinit.o : $(ACPICA_CORE)/utilities/utinit.c + $(COMPILE) + +utlock.o : $(ACPICA_CORE)/utilities/utlock.c + $(COMPILE) + +utmath.o : $(ACPICA_CORE)/utilities/utmath.c + $(COMPILE) + +utmisc.o : $(ACPICA_CORE)/utilities/utmisc.c + $(COMPILE) + +utmutex.o : $(ACPICA_CORE)/utilities/utmutex.c + $(COMPILE) + +utobject.o : $(ACPICA_CORE)/utilities/utobject.c + $(COMPILE) + +utresrc.o : $(ACPICA_CORE)/utilities/utresrc.c + $(COMPILE) + +utstate.o : $(ACPICA_CORE)/utilities/utstate.c + $(COMPILE) + +utxface.o : $(ACPICA_CORE)/utilities/utxface.c + $(COMPILE) + + +# +# Unix OS services layer (OSL) +# +osunixxf.o : $(ACPICA_OSL)/osunixxf.c + $(COMPILE) + + +clean : + rm -f $(PROG) $(PROG).exe $(OBJS) $(INTERMEDIATES) $(MISC) diff --git a/compiler/aslcompile.c b/compiler/aslcompile.c index 56663b571247..5b664ff5e3c5 100644 --- a/compiler/aslcompile.c +++ b/compiler/aslcompile.c @@ -903,10 +903,19 @@ CmCleanupAndExit ( /* * Delete intermediate ("combined") source file (if -ls flag not set) + * This file is created during normal ASL/AML compiles. It is not + * created by the data table compiler. + * + * If the -ls flag is set, then the .SRC file should not be deleted. + * In this case, Gbl_SourceOutputFlag is set to TRUE. + * + * Note: Handles are cleared by FlCloseFile above, so we look at the + * filename instead, to determine if the .SRC file was actually + * created. * * TBD: SourceOutput should be .TMP, then rename if we want to keep it? */ - if (!Gbl_SourceOutputFlag) + if (!Gbl_SourceOutputFlag && Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename) { if (remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename)) { diff --git a/compiler/aslcompiler.h b/compiler/aslcompiler.h index 02adaa4764f2..ee4f5ccc4a0e 100644 --- a/compiler/aslcompiler.h +++ b/compiler/aslcompiler.h @@ -189,8 +189,12 @@ AslPushInputFileStack ( char *Filename); /* - * aslstartup - called from main + * aslstartup - entered from main() */ +void +AslInitializeGlobals ( + void); + ACPI_STATUS AslDoOnePathname ( char *Pathname); @@ -694,6 +698,10 @@ DbgPrint ( #define ASL_TREE_OUTPUT 2 void +UtDisplaySupportedTables ( + void); + +void UtDisplayConstantOpcodes ( void); @@ -1024,5 +1032,9 @@ ACPI_STATUS DtDoCompile( void); +ACPI_STATUS +DtCreateTemplates ( + char *Signature); + #endif /* __ASLCOMPILER_H */ diff --git a/compiler/asldefine.h b/compiler/asldefine.h index a146f77f01a1..4cd8130b1347 100644 --- a/compiler/asldefine.h +++ b/compiler/asldefine.h @@ -182,6 +182,7 @@ #define FILE_SUFFIX_DISASSEMBLY "dsl" #define FILE_SUFFIX_ASM_INCLUDE "inc" #define FILE_SUFFIX_C_INCLUDE "h" +#define FILE_SUFFIX_ASL_CODE "asl" /* Types for input files */ diff --git a/compiler/aslerror.c b/compiler/aslerror.c index 4b9a04fa57cf..ff24e62b7aa9 100644 --- a/compiler/aslerror.c +++ b/compiler/aslerror.c @@ -280,7 +280,14 @@ AePrintException ( /* Get the file handles */ OutputFile = Gbl_Files[FileId].Handle; + + /* Use the merged header/source file if present, otherwise use input file */ + SourceFile = Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle; + if (!SourceFile) + { + SourceFile = Gbl_Files[ASL_FILE_INPUT].Handle; + } if (Header) { diff --git a/compiler/aslfiles.c b/compiler/aslfiles.c index c9f87f7f1310..6ba32ca9f748 100644 --- a/compiler/aslfiles.c +++ b/compiler/aslfiles.c @@ -768,6 +768,55 @@ FlOpenMiscOutputFiles ( char *Filename; + /* Create/Open a hex output file if asked */ + + if (Gbl_HexOutputFlag) + { + Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_HEX_DUMP); + if (!Filename) + { + AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME, + 0, 0, 0, 0, NULL, NULL); + return (AE_ERROR); + } + + /* Open the hex file, text mode */ + + FlOpenFile (ASL_FILE_HEX_OUTPUT, Filename, "w+"); + + AslCompilerSignon (ASL_FILE_HEX_OUTPUT); + AslCompilerFileHeader (ASL_FILE_HEX_OUTPUT); + } + + /* Create/Open a debug output file if asked */ + + if (Gbl_DebugFlag) + { + Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_DEBUG); + if (!Filename) + { + AslCommonError (ASL_ERROR, ASL_MSG_DEBUG_FILENAME, + 0, 0, 0, 0, NULL, NULL); + return (AE_ERROR); + } + + /* Open the debug file as STDERR, text mode */ + + /* TBD: hide this behind a FlReopenFile function */ + + Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename; + Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = + freopen (Filename, "w+t", stderr); + + AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT); + AslCompilerFileHeader (ASL_FILE_DEBUG_OUTPUT); + } + + if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA) + { + return (AE_OK); + } + /* Create/Open a combined source output file */ Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_SOURCE); @@ -887,26 +936,6 @@ FlOpenMiscOutputFiles ( AslCompilerFileHeader (ASL_FILE_C_INCLUDE_OUTPUT); } - /* Create/Open a hex output file if asked */ - - if (Gbl_HexOutputFlag) - { - Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_HEX_DUMP); - if (!Filename) - { - AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME, - 0, 0, 0, 0, NULL, NULL); - return (AE_ERROR); - } - - /* Open the hex file, text mode */ - - FlOpenFile (ASL_FILE_HEX_OUTPUT, Filename, "w+"); - - AslCompilerSignon (ASL_FILE_HEX_OUTPUT); - AslCompilerFileHeader (ASL_FILE_HEX_OUTPUT); - } - /* Create a namespace output file if asked */ if (Gbl_NsOutputFlag) @@ -927,30 +956,6 @@ FlOpenMiscOutputFiles ( AslCompilerFileHeader (ASL_FILE_NAMESPACE_OUTPUT); } - /* Create/Open a debug output file if asked */ - - if (Gbl_DebugFlag) - { - Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_DEBUG); - if (!Filename) - { - AslCommonError (ASL_ERROR, ASL_MSG_DEBUG_FILENAME, - 0, 0, 0, 0, NULL, NULL); - return (AE_ERROR); - } - - /* Open the debug file as STDERR, text mode */ - - /* TBD: hide this behind a FlReopenFile function */ - - Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename; - Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = - freopen (Filename, "w+t", stderr); - - AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT); - AslCompilerFileHeader (ASL_FILE_DEBUG_OUTPUT); - } - return (AE_OK); } diff --git a/compiler/aslglobal.h b/compiler/aslglobal.h index 6df7466af333..3f600d84223b 100644 --- a/compiler/aslglobal.h +++ b/compiler/aslglobal.h @@ -197,7 +197,8 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayRemarks, 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_DataTableCompilerAvailable, FALSE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseTemplates, FALSE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoTemplates, FALSE); #define HEX_OUTPUT_NONE 0 @@ -252,7 +253,7 @@ 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); - +ASL_EXTERN char *Gbl_TemplateSignature; ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentHexColumn, 0); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentAmlOffset, 0); diff --git a/compiler/aslmain.c b/compiler/aslmain.c index 406f67b2a9fa..e7f1ca123ff3 100644 --- a/compiler/aslmain.c +++ b/compiler/aslmain.c @@ -167,7 +167,7 @@ AslDoResponseFile ( #define ASL_TOKEN_SEPARATORS " \t\n" -#define ASL_SUPPORTED_OPTIONS "@:2b:c:d^e:fgh^i^I:l^no:p:r:s:t:v:w:x:yz" +#define ASL_SUPPORTED_OPTIONS "@:2b:c:d^e:fgh^i^I:l^no:p:r:s:t:T:v:w:x:z" /******************************************************************************* @@ -218,6 +218,10 @@ Options ( printf (" -ln Create namespace file (*.nsp)\n"); printf (" -ls Create combined source file (expanded includes) (*.src)\n"); + printf ("\nACPI Data Tables:\n"); + printf (" -T <Sig> Create table template file for <Sig> (or \"ALL\")\n"); + printf (" -vt Create verbose templates (full disassembly)\n"); + printf ("\nAML Disassembler:\n"); printf (" -d [file] Disassemble or decode binary ACPI table to file (*.dsl)\n"); printf (" -dc [file] Disassemble AML and immediately compile it\n"); @@ -230,6 +234,7 @@ Options ( printf (" -h Additional help and compiler debug options\n"); printf (" -hc Display operators allowed in constant expressions\n"); printf (" -hr Display ACPI reserved method names\n"); + printf (" -ht Display currently supported ACPI table names\n"); } @@ -268,7 +273,6 @@ HelpMessage ( printf (" -n Parse only, no output generation\n"); printf (" -ot Display compile times\n"); printf (" -x<level> Set debug level for trace output\n"); - printf (" -y Temporary: Enable data table compiler\n"); printf (" -z Do not insert new compiler ID for DataTables\n"); } @@ -582,6 +586,10 @@ AslDoOptions ( ApDisplayReservedNames (); exit (0); + case 't': + UtDisplaySupportedTables (); + exit (0); + default: printf ("Unknown option: -h%s\n", AcpiGbl_Optarg); return (-1); @@ -769,6 +777,12 @@ AslDoOptions ( break; + case 'T': + Gbl_DoTemplates = TRUE; + Gbl_TemplateSignature = AcpiGbl_Optarg; + break; + + case 'v': switch (AcpiGbl_Optarg[0]) @@ -797,6 +811,10 @@ AslDoOptions ( Gbl_DoSignon = FALSE; break; + case 't': + Gbl_VerboseTemplates = TRUE; + break; + default: printf ("Unknown option: -v%s\n", AcpiGbl_Optarg); return (-1); @@ -833,12 +851,6 @@ AslDoOptions ( break; - case 'y': - - Gbl_DataTableCompilerAvailable = TRUE; - break; - - case 'z': Gbl_UseOriginalCompilerId = TRUE; @@ -887,6 +899,12 @@ AslCommandLine ( BadCommandLine = AslDoOptions (argc, argv, FALSE); + if (Gbl_DoTemplates) + { + DtCreateTemplates (Gbl_TemplateSignature); + exit (1); + } + /* Next parameter must be the input filename */ if (!argv[AcpiGbl_Optind] && diff --git a/compiler/aslstartup.c b/compiler/aslstartup.c index 2588ccbdf8dd..32c6ae4bf534 100644 --- a/compiler/aslstartup.c +++ b/compiler/aslstartup.c @@ -131,10 +131,6 @@ BOOLEAN AslToFile = TRUE; /* Local prototypes */ -static void -AslInitializeGlobals ( - void); - static char ** AsDoWildcard ( char *DirectoryPathname, @@ -158,7 +154,7 @@ AslDetectSourceFileType ( * ******************************************************************************/ -static void +void AslInitializeGlobals ( void) { @@ -187,6 +183,9 @@ AslInitializeGlobals ( Gbl_Files[ASL_FILE_AML_OUTPUT].Filename = NULL; Gbl_Files[ASL_FILE_AML_OUTPUT].Handle = NULL; + + Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename = NULL; + Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle = NULL; } @@ -464,17 +463,6 @@ AslDoOneFile ( */ case ASL_INPUT_TYPE_ASCII_DATA: - /* - * Require use of command-line option to enable the data table - * compiler -- for now, until development of the compiler is - * complete. - */ - if (!Gbl_DataTableCompilerAvailable) - { - printf ("Data Table Compiler is not available yet\n"); - return (AE_SUPPORT); - } - Status = DtDoCompile (); if (Gbl_Signature) @@ -490,7 +478,6 @@ AslDoOneFile ( */ case ASL_INPUT_TYPE_ASCII_ASL: - /* ACPICA subsystem initialization */ Status = AdInitialize (); diff --git a/compiler/aslutils.c b/compiler/aslutils.c index e8d61babc785..23e58e5eb99f 100644 --- a/compiler/aslutils.c +++ b/compiler/aslutils.c @@ -117,6 +117,7 @@ #include "aslcompiler.h" #include "aslcompiler.y.h" +#include "acdisasm.h" #include "acnamesp.h" #include "amlcode.h" @@ -157,6 +158,50 @@ UtAttachNameseg ( /******************************************************************************* * + * FUNCTION: UtDisplaySupportedTables + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Print all supported ACPI table names. + * + ******************************************************************************/ + +void +UtDisplaySupportedTables ( + void) +{ + ACPI_DMTABLE_DATA *TableData; + UINT32 i = 6; + + + printf ("\nACPI tables supported by iASL subsystems in " + "version %8.8X:\n" + " ASL and Data Table compilers\n" + " AML and Data Table disassemblers\n" + " ACPI table template generator\n\n", ACPI_CA_VERSION); + + /* Special tables */ + + printf ("%8u) %s %s\n", 1, ACPI_SIG_DSDT, "Differentiated System Description Table"); + printf ("%8u) %s %s\n", 2, ACPI_SIG_SSDT, "Secondary System Description Table"); + printf ("%8u) %s %s\n", 3, ACPI_SIG_FADT, "Fixed ACPI Description Table (FADT)"); + printf ("%8u) %s %s\n", 4, ACPI_SIG_FACS, "Firmware ACPI Control Structure"); + printf ("%8u) %s %s\n", 5, ACPI_RSDP_NAME, "Root System Description Pointer"); + + /* All data tables with common table header */ + + for (TableData = AcpiDmTableData; TableData->Signature; TableData++) + { + printf ("%8u) %s %s\n", i, TableData->Signature, TableData->Name); + i++; + } +} + + +/******************************************************************************* + * * FUNCTION: AcpiPsDisplayConstantOpcodes * * PARAMETERS: None diff --git a/compiler/dtcompile.c b/compiler/dtcompile.c index 351d9cc83f35..651bdfa192e0 100644 --- a/compiler/dtcompile.c +++ b/compiler/dtcompile.c @@ -183,8 +183,10 @@ DtDoCompile ( /* TBD: temporary error message. Msgs should come from function above */ DtError (ASL_ERROR, ASL_MSG_SYNTAX, NULL, - "Could not parse input file"); - return (AE_ERROR); + "Input file does not appear to be an ASL or data table source file"); + + Status = AE_ERROR; + goto CleanupAndExit; } Event = UtBeginEvent ("Compile parse tree"); @@ -203,6 +205,7 @@ DtDoCompile ( DtError (ASL_ERROR, ASL_MSG_SYNTAX, NULL, "Could not compile input file"); + goto CleanupAndExit; } @@ -245,6 +248,9 @@ DtInitialize ( void) { + AcpiOsInitialize (); + AcpiUtInitGlobals (); + Gbl_FieldList = NULL; Gbl_RootTable = NULL; Gbl_SubtableStack = NULL; @@ -328,7 +334,9 @@ DtCompileDataTable ( Signature = DtGetFieldValue (*FieldList, "Signature"); if (!Signature) { - DtError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, *FieldList, NULL); + sprintf (MsgBuffer, "Expected \"%s\"", "Signature"); + DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME, + *FieldList, MsgBuffer); return (AE_ERROR); } @@ -362,6 +370,15 @@ DtCompileDataTable ( return (AE_ERROR); } + /* Validate the signature via the ACPI table list */ + + TableData = AcpiDmGetTableData (Signature); + if (!TableData) + { + DtFatal (ASL_MSG_UNKNOWN_TABLE, *FieldList, Signature); + return (AE_ERROR); + } + /* * All other tables must use the common ACPI table header. Insert the * current iASL IDs (name, version), and compile the header now. @@ -377,14 +394,7 @@ DtCompileDataTable ( DtPushSubtable (Gbl_RootTable); - /* Match signature and dispatch appropriately */ - - TableData = AcpiDmGetTableData (Signature); - if (!TableData) - { - DtFatal (ASL_MSG_UNKNOWN_TABLE, *FieldList, Signature); - return (AE_ERROR); - } + /* Dispatch to per-table compile */ if (TableData->CmTableHandler) { @@ -459,7 +469,6 @@ DtCompileTable ( UINT8 FieldType; UINT8 *Buffer; UINT8 *FlagBuffer = NULL; - UINT32 FlagBitPosition = 0; ACPI_STATUS Status; @@ -530,7 +539,6 @@ DtCompileTable ( LocalField = LocalField->Next; *Field = LocalField; - FlagBitPosition = 0; FlagBuffer = Buffer; break; @@ -540,8 +548,7 @@ DtCompileTable ( if (FlagBuffer) { - FlagBitPosition = DtCompileFlag (FlagBuffer, - LocalField, Info, FlagBitPosition); + DtCompileFlag (FlagBuffer, LocalField, Info); } else { @@ -576,6 +583,8 @@ DtCompileTable ( goto Error; } + DtSetSubtableLength (InlineSubtable); + ACPI_MEMCPY (Buffer, InlineSubtable->Buffer, FieldLength); ACPI_FREE (InlineSubtable->Buffer); ACPI_FREE (InlineSubtable); diff --git a/compiler/dtcompiler.h b/compiler/dtcompiler.h index 75d641190882..f2ce61bd54ab 100644 --- a/compiler/dtcompiler.h +++ b/compiler/dtcompiler.h @@ -290,12 +290,11 @@ DtCompileBuffer ( DT_FIELD *Field, UINT32 ByteLength); -UINT32 +void DtCompileFlag ( UINT8 *Buffer, DT_FIELD *Field, - ACPI_DMTABLE_INFO *Info, - UINT32 BitPosition); + ACPI_DMTABLE_INFO *Info); /* dtutils - Miscellaneous utilities */ @@ -447,6 +446,39 @@ ACPI_STATUS DtCompileXsdt ( void **PFieldList); +/* ACPI Table templates */ + +extern const unsigned char TemplateAsf[]; +extern const unsigned char TemplateBoot[]; +extern const unsigned char TemplateBert[]; +extern const unsigned char TemplateCpep[]; +extern const unsigned char TemplateDbgp[]; +extern const unsigned char TemplateDmar[]; +extern const unsigned char TemplateEcdt[]; +extern const unsigned char TemplateEinj[]; +extern const unsigned char TemplateErst[]; +extern const unsigned char TemplateFadt[]; +extern const unsigned char TemplateHest[]; +extern const unsigned char TemplateHpet[]; +extern const unsigned char TemplateIvrs[]; +extern const unsigned char TemplateMadt[]; +extern const unsigned char TemplateMcfg[]; +extern const unsigned char TemplateMchi[]; +extern const unsigned char TemplateMsct[]; +extern const unsigned char TemplateRsdt[]; +extern const unsigned char TemplateSbst[]; +extern const unsigned char TemplateSlic[]; +extern const unsigned char TemplateSlit[]; +extern const unsigned char TemplateSpcr[]; +extern const unsigned char TemplateSpmi[]; +extern const unsigned char TemplateSrat[]; +extern const unsigned char TemplateTcpa[]; +extern const unsigned char TemplateUefi[]; +extern const unsigned char TemplateWaet[]; +extern const unsigned char TemplateWdat[]; +extern const unsigned char TemplateWddt[]; +extern const unsigned char TemplateWdrt[]; +extern const unsigned char TemplateXsdt[]; /* Debug */ diff --git a/compiler/dtfield.c b/compiler/dtfield.c index d3f32a44152d..34696c1ace62 100644 --- a/compiler/dtfield.c +++ b/compiler/dtfield.c @@ -131,15 +131,9 @@ DtCompileString ( UINT32 ByteLength); static char * -DtPciPathToBuffer ( - char *PciPath); - -static void -DtCompilePciPath ( - UINT8 *Buffer, - char *StringValue, - DT_FIELD *Field, - UINT32 ByteLength); +DtNormalizeBuffer ( + char *Buffer, + UINT32 *Count); /****************************************************************************** @@ -180,10 +174,6 @@ DtCompileOneField ( DtCompileBuffer (Buffer, Field->Value, Field, ByteLength); break; - case DT_FIELD_TYPE_PCI_PATH: - DtCompilePciPath (Buffer, Field->Value, Field, ByteLength); - break; - default: DtFatal (ASL_MSG_COMPILER_INTERNAL, Field, "Invalid field type"); break; @@ -225,9 +215,6 @@ DtCompileString ( Length = ByteLength; } - /* If input string is shorter than ByteLength, pad with blanks */ - - ACPI_MEMSET (Buffer, 0x20, ByteLength); ACPI_MEMCPY (Buffer, Field->Value, Length); } @@ -347,33 +334,68 @@ Exit: /****************************************************************************** * - * FUNCTION: DtPciPathToBuffer + * FUNCTION: DtNormalizeBuffer * - * PARAMETERS: PciPath - DMAR "PCI Path" field + * PARAMETERS: Buffer - Input buffer + * Count - Output the count of hex number in + * the Buffer * - * RETURN: Strings of PCI path + * RETURN: The normalized buffer, freed by caller * - * DESCRIPTION: Remove brackets and comma from DMAR "PCI Path" string, for - * example: [1D, 01] ==> 1D 01 + * DESCRIPTION: [1A,2B,3C,4D] or 1A, 2B, 3C, 4D will be normalized + * to 1A 2B 3C 4D * *****************************************************************************/ static char * -DtPciPathToBuffer ( - char *PciPath) +DtNormalizeBuffer ( + char *Buffer, + UINT32 *Count) { - char *Buffer; + char *NewBuffer; + char *TmpBuffer; + UINT32 BufferCount = 0; + BOOLEAN Separator = TRUE; + char c; - Buffer = UtLocalCalloc (6); + NewBuffer = UtLocalCalloc (ACPI_STRLEN (Buffer) + 1); + TmpBuffer = NewBuffer; - Buffer[0] = PciPath[1]; - Buffer[1] = PciPath[2]; - Buffer[2] = ' '; - Buffer[3] = PciPath[5]; - Buffer[4] = PciPath[6]; + while ((c = *Buffer++)) + { + switch (c) + { + /* Valid separators */ + + case '[': + case ']': + case ' ': + case ',': + Separator = TRUE; + break; + + default: + if (Separator) + { + /* Insert blank as the standard separator */ + + if (NewBuffer[0]) + { + *TmpBuffer++ = ' '; + BufferCount++; + } + + Separator = FALSE; + } + + *TmpBuffer++ = c; + break; + } + } - return (Buffer); + *Count = BufferCount + 1; + return (NewBuffer); } @@ -407,13 +429,17 @@ DtCompileBuffer ( UINT32 Count; - Count = ACPI_STRLEN (StringValue) / 3 + 1; + /* Allow several different types of value separators */ + + StringValue = DtNormalizeBuffer (StringValue, &Count); Hex[2] = 0; for (i = 0; i < Count; i++) { - Hex[0] = StringValue[0]; - Hex[1] = StringValue[1]; + /* Each element of StringValue is three chars */ + + Hex[0] = StringValue[(3 * i)]; + Hex[1] = StringValue[(3 * i) + 1]; /* Convert one hex byte */ @@ -426,70 +452,36 @@ DtCompileBuffer ( } Buffer[i] = (UINT8) Value; - StringValue += 3; } + ACPI_FREE (StringValue); return (ByteLength - Count); } /****************************************************************************** * - * FUNCTION: DtCompilePciPath - * - * PARAMETERS: Buffer - Output buffer - * StringValue - DMAR pci path string - * ByteLength - Byte length of DMAR pci path string, 2 - * - * RETURN: None - * - * DESCRIPTION: Compile DMAR PCI path string to binary - * - *****************************************************************************/ - -static void -DtCompilePciPath ( - UINT8 *Buffer, - char *StringValue, - DT_FIELD *Field, - UINT32 ByteLength) -{ - char *PciPathBuffer; - - - /* Parse path to simple hex digits, then convert to binary */ - - PciPathBuffer = DtPciPathToBuffer (StringValue); - - DtCompileBuffer (Buffer, PciPathBuffer, Field, ByteLength); - ACPI_FREE (PciPathBuffer); -} - - -/****************************************************************************** - * * FUNCTION: DtCompileFlag * * PARAMETERS: Buffer - Output buffer * Field - Field to be compiled * Info - Flag info - * BitPosition - Flag bit position * - * RETURN: Next flag bit position + * RETURN: * * DESCRIPTION: Compile a flag * *****************************************************************************/ -UINT32 +void DtCompileFlag ( UINT8 *Buffer, DT_FIELD *Field, - ACPI_DMTABLE_INFO *Info, - UINT32 BitPosition) + ACPI_DMTABLE_INFO *Info) { UINT64 Value = 0; UINT32 BitLength = 1; + UINT8 BitPosition = 0; ACPI_STATUS Status; @@ -510,12 +502,20 @@ DtCompileFlag ( case ACPI_DMT_FLAG6: case ACPI_DMT_FLAG7: + BitPosition = Info->Opcode; BitLength = 1; break; case ACPI_DMT_FLAGS0: + + BitPosition = 0; + BitLength = 2; + break; + + case ACPI_DMT_FLAGS2: + BitPosition = 2; BitLength = 2; break; @@ -534,10 +534,5 @@ DtCompileFlag ( Value = 0; } - /* Insert the flag, return next flag bit position */ - - Buffer += ACPI_DIV_8 (BitPosition); - *Buffer |= (UINT8) (Value << ACPI_MOD_8 (BitPosition)); - - return (BitPosition + BitLength); + *Buffer |= (UINT8) (Value << BitPosition); } diff --git a/compiler/dtio.c b/compiler/dtio.c index 469cea60917d..4c19ad0b0c8c 100644 --- a/compiler/dtio.c +++ b/compiler/dtio.c @@ -122,33 +122,43 @@ ACPI_MODULE_NAME ("dtio") -/****************************************************************************** - * - * FUNCTION: DtIsComment - * - * PARAMETERS: Line - Current source code line - * - * RETURN: TRUE if comment, FALSE otherwise - * - * DESCRIPTION: Detect a comment in the source module - * - *****************************************************************************/ +/* Local prototypes */ -/* TBD: Temporary: very simple code to detect comments */ +static char * +DtTrim ( + char *String); -static int -DtIsComment( - char *Line) -{ +static void +DtLinkField ( + DT_FIELD *Field); - if (!ACPI_STRNCMP (Line, "/*", 2) || - !ACPI_STRNCMP (Line, " *", 2)) - { - return 1; - } +static void +DtParseLine ( + char *LineBuffer, + UINT32 Line, + UINT32 Offset); - return 0; -} +static UINT32 +DtGetNextLine ( + FILE *Handle); + +static void +DtWriteBinary ( + DT_SUBTABLE *Subtable, + void *Context, + void *ReturnValue); + + +/* States for DtGetNextLine */ + +#define DT_NORMAL_TEXT 0 +#define DT_START_QUOTED_STRING 1 +#define DT_START_COMMENT 2 +#define DT_SLASH_ASTERISK_COMMENT 3 +#define DT_SLASH_SLASH_COMMENT 4 +#define DT_END_COMMENT 5 + +UINT32 Gbl_NextLineOffset; /****************************************************************************** @@ -308,7 +318,7 @@ DtParseLine ( UINT32 NameColumn; - if (!LineBuffer || DtIsComment (LineBuffer)) + if (!LineBuffer) { return; } @@ -417,13 +427,184 @@ DtParseLine ( /****************************************************************************** * + * FUNCTION: DtGetNextLine + * + * PARAMETERS: Handle - Open file handle for the source file + * + * RETURN: Filled line buffer and offset of start-of-line (zero on EOF) + * + * DESCRIPTION: Get the next valid source line. Removes all comments. + * Ignores empty lines. + * + * Handles both slash-asterisk and slash-slash comments. + * Also, quoted strings, but no escapes within. + * + * Line is returned in Gbl_CurrentLineBuffer. + * Line number in original file is returned in Gbl_CurrentLineNumber. + * + *****************************************************************************/ + +static UINT32 +DtGetNextLine ( + FILE *Handle) +{ + UINT32 State = DT_NORMAL_TEXT; + UINT32 CurrentLineOffset; + UINT32 i; + char c; + + + for (i = 0; i < ASL_LINE_BUFFER_SIZE;) + { + c = (char) getc (Handle); + if (c == EOF) + { + return (0); + } + + switch (State) + { + case DT_NORMAL_TEXT: + + /* Normal text, insert char into line buffer */ + + Gbl_CurrentLineBuffer[i] = c; + switch (c) + { + case '/': + State = DT_START_COMMENT; + break; + + case '"': + State = DT_START_QUOTED_STRING; + i++; + break; + + case '\n': + CurrentLineOffset = Gbl_NextLineOffset; + Gbl_NextLineOffset = (UINT32) ftell (Handle); + Gbl_CurrentLineNumber++; + + /* Exit if line is complete. Ignore blank lines */ + + if (i != 0) + { + Gbl_CurrentLineBuffer[i+1] = 0; /* Terminate line */ + return (CurrentLineOffset); + } + break; + + default: + i++; + break; + } + break; + + case DT_START_QUOTED_STRING: + + /* Insert raw chars until end of quoted string */ + + Gbl_CurrentLineBuffer[i] = c; + i++; + + if (c == '"') + { + State = DT_NORMAL_TEXT; + } + break; + + case DT_START_COMMENT: + + /* Open comment if this character is an asterisk or slash */ + + switch (c) + { + case '*': + State = DT_SLASH_ASTERISK_COMMENT; + break; + + case '/': + State = DT_SLASH_SLASH_COMMENT; + break; + + default: /* Not a comment */ + i++; /* Save the preceeding slash */ + Gbl_CurrentLineBuffer[i] = c; + i++; + State = DT_NORMAL_TEXT; + break; + } + break; + + case DT_SLASH_ASTERISK_COMMENT: + + /* Ignore chars until an asterisk-slash is found */ + + switch (c) + { + case '\n': + Gbl_NextLineOffset = (UINT32) ftell (Handle); + Gbl_CurrentLineNumber++; + break; + + case '*': + State = DT_END_COMMENT; + break; + + default: + break; + } + break; + + case DT_SLASH_SLASH_COMMENT: + + /* Ignore chars until end-of-line */ + + if (c == '\n') + { + /* We will exit via the NORMAL_TEXT path */ + + ungetc (c, Handle); + State = DT_NORMAL_TEXT; + } + break; + + case DT_END_COMMENT: + + /* End comment if this char is a slash */ + + switch (c) + { + case '/': + State = DT_NORMAL_TEXT; + break; + + default: + State = DT_SLASH_ASTERISK_COMMENT; + break; + } + break; + + default: + DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, "Unknown input state"); + return (0); + } + } + + printf ("ERROR - Input line is too long (max %u)\n", ASL_LINE_BUFFER_SIZE); + return (0); +} + + +/****************************************************************************** + * * FUNCTION: DtScanFile * * PARAMETERS: Handle - Open file handle for the source file * * RETURN: Pointer to start of the constructed parse tree. * - * DESCRIPTION: Scan source file, link all field name and value + * DESCRIPTION: Scan source file, link all field names and values * to the global parse tree: Gbl_FieldList * *****************************************************************************/ @@ -432,23 +613,28 @@ DT_FIELD * DtScanFile ( FILE *Handle) { - UINT32 Line = 0; - UINT32 Offset = 0; + UINT32 Offset; + + + ACPI_FUNCTION_NAME (DtScanFile); /* Get the file size */ Gbl_InputByteCount = DtGetFileSize (Handle); + Gbl_CurrentLineNumber = 0; + Gbl_CurrentLineOffset = 0; + Gbl_NextLineOffset = 0; + /* Scan line-by-line */ - while (fgets (Gbl_CurrentLineBuffer, ASL_LINE_BUFFER_SIZE, Handle)) + while ((Offset = DtGetNextLine (Handle))) { - Line++; - Gbl_CurrentLineNumber++; - DtParseLine (Gbl_CurrentLineBuffer, Line, Offset); + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Line %2.2u/%4.4X - %s", + Gbl_CurrentLineNumber, Offset, Gbl_CurrentLineBuffer)); - Offset = (UINT32) ftell (Handle); + DtParseLine (Gbl_CurrentLineBuffer, Gbl_CurrentLineNumber, Offset); } return (Gbl_FieldList); diff --git a/compiler/dttable.c b/compiler/dttable.c index 2ab6b9ef6612..863fa23d8437 100644 --- a/compiler/dttable.c +++ b/compiler/dttable.c @@ -264,10 +264,13 @@ DtCompileRsdp ( DT_FIELD **PFieldList) { DT_SUBTABLE *Subtable; - ACPI_TABLE_RSDP *Table; + ACPI_TABLE_RSDP *Rsdp; + ACPI_RSDP_EXTENSION *RsdpExtension; ACPI_STATUS Status; + /* Compile the "common" RSDP (ACPI 1.0) */ + Status = DtCompileTable (PFieldList, AcpiDmTableInfoRsdp1, &Gbl_RootTable, TRUE); if (ACPI_FAILURE (Status)) @@ -275,11 +278,13 @@ DtCompileRsdp ( return (Status); } - Table = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Gbl_RootTable->Buffer); - DtSetTableChecksum (&Table->Checksum); + Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Gbl_RootTable->Buffer); + DtSetTableChecksum (&Rsdp->Checksum); - if (Table->Revision > 0) + if (Rsdp->Revision > 0) { + /* Compile the "extended" part of the RSDP as a subtable */ + Status = DtCompileTable (PFieldList, AcpiDmTableInfoRsdp2, &Subtable, TRUE); if (ACPI_FAILURE (Status)) @@ -288,7 +293,12 @@ DtCompileRsdp ( } DtInsertSubtable (Gbl_RootTable, Subtable); - DtSetTableChecksum (&Table->ExtendedChecksum); + + /* Set length and extended checksum for entire RSDP */ + + RsdpExtension = ACPI_CAST_PTR (ACPI_RSDP_EXTENSION, Subtable->Buffer); + RsdpExtension->Length = Gbl_RootTable->Length + Subtable->Length; + DtSetTableChecksum (&RsdpExtension->ExtendedChecksum); } return (AE_OK); diff --git a/compiler/dttemplate.c b/compiler/dttemplate.c new file mode 100644 index 000000000000..ad69a14c2799 --- /dev/null +++ b/compiler/dttemplate.c @@ -0,0 +1,445 @@ +/****************************************************************************** + * + * Module Name: dttemplate - ACPI table template generation + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#include "aslcompiler.h" +#include "acapps.h" +#include "dtcompiler.h" +#include "dttemplate.h" /* Contains the hex ACPI table templates */ + +#define _COMPONENT DT_COMPILER + ACPI_MODULE_NAME ("dttemplate") + + +/* Local prototypes */ + +static BOOLEAN +AcpiUtIsSpecialTable ( + char *Signature); + +static ACPI_STATUS +DtCreateOneTemplate ( + char *Signature, + ACPI_DMTABLE_DATA *TableData); + +static ACPI_STATUS +DtCreateAllTemplates ( + void); + + +/******************************************************************************* + * + * FUNCTION: AcpiUtIsSpecialTable + * + * PARAMETERS: Signature - ACPI table signature + * + * RETURN: TRUE if signature is a special ACPI table + * + * DESCRIPTION: Check for valid ACPI tables that are not in the main ACPI + * table data structure (AcpiDmTableData). + * + ******************************************************************************/ + +static BOOLEAN +AcpiUtIsSpecialTable ( + char *Signature) +{ + + if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_DSDT) || + ACPI_COMPARE_NAME (Signature, ACPI_SIG_SSDT) || + ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS) || + ACPI_COMPARE_NAME (Signature, ACPI_RSDP_NAME)) + { + return (TRUE); + } + + return (FALSE); +} + + +/******************************************************************************* + * + * FUNCTION: DtCreateTemplates + * + * PARAMETERS: Signature - ACPI table signature + * + * RETURN: Status + * + * DESCRIPTION: Create one or more template files. + * + ******************************************************************************/ + +ACPI_STATUS +DtCreateTemplates ( + char *Signature) +{ + ACPI_DMTABLE_DATA *TableData; + ACPI_STATUS Status; + + + AslInitializeGlobals (); + AcpiUtStrupr (Signature); + + /* Create all known templates if requested */ + + if (!ACPI_STRNCMP (Signature, "ALL", 3)) + { + Status = DtCreateAllTemplates (); + return (Status); + } + + /* + * Validate signature and get the template data: + * 1) Signature must be 4 characters + * 2) Signature must be a recognized ACPI table + * 3) There must be a template associated with the signature + */ + if (strlen (Signature) != ACPI_NAME_SIZE) + { + fprintf (stderr, "%s, Invalid ACPI table signature\n", Signature); + return (AE_ERROR); + } + + /* + * Some slack for the two strange tables whose name is different than + * their signatures: MADT->APIC and FADT->FACP. + */ + if (!strcmp (Signature, "MADT")) + { + Signature = "APIC"; + } + else if (!strcmp (Signature, "FADT")) + { + Signature = "FACP"; + } + + TableData = AcpiDmGetTableData (Signature); + if (TableData) + { + if (!TableData->Template) + { + fprintf (stderr, "%4.4s, No template available\n", Signature); + return (AE_ERROR); + } + } + else if (!AcpiUtIsSpecialTable (Signature)) + { + fprintf (stderr, + "%4.4s, Unrecognized ACPI table signature\n", Signature); + return (AE_ERROR); + } + + Status = AdInitialize (); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + Status = DtCreateOneTemplate (Signature, TableData); + return (Status); +} + + +/******************************************************************************* + * + * FUNCTION: DtCreateAllTemplates + * + * PARAMETERS: None + * + * RETURN: Status + * + * DESCRIPTION: Create all currently defined template files + * + ******************************************************************************/ + +static ACPI_STATUS +DtCreateAllTemplates ( + void) +{ + ACPI_DMTABLE_DATA *TableData; + ACPI_STATUS Status; + + + Status = AdInitialize (); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + fprintf (stderr, "Creating all supported Template files\n"); + + /* Walk entire ACPI table data structure */ + + for (TableData = AcpiDmTableData; TableData->Signature; TableData++) + { + /* If table has a template, create the template file */ + + if (TableData->Template) + { + Status = DtCreateOneTemplate (TableData->Signature, + TableData); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + } + } + + /* + * Create the "special ACPI tables: + * 1) DSDT/SSDT are AML tables, not data tables + * 2) FACS and RSDP have non-standard headers + */ + Status = DtCreateOneTemplate (ACPI_SIG_DSDT, NULL); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + Status = DtCreateOneTemplate (ACPI_SIG_SSDT, NULL); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + Status = DtCreateOneTemplate (ACPI_SIG_FACS, NULL); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + Status = DtCreateOneTemplate (ACPI_RSDP_NAME, NULL); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: DtCreateOneTemplate + * + * PARAMETERS: Signature - ACPI signature, NULL terminated. + * TableData - Entry in ACPI table data structure. + * NULL if a special ACPI table. + * + * RETURN: Status + * + * DESCRIPTION: Create one template source file for the requested ACPI table. + * + ******************************************************************************/ + +static ACPI_STATUS +DtCreateOneTemplate ( + char *Signature, + ACPI_DMTABLE_DATA *TableData) +{ + char *DisasmFilename; + FILE *File; + ACPI_STATUS Status = AE_OK; + + + /* New file will have a .asl suffix */ + + DisasmFilename = FlGenerateFilename ( + Signature, FILE_SUFFIX_ASL_CODE); + if (!DisasmFilename) + { + fprintf (stderr, "Could not generate output filename\n"); + return (AE_ERROR); + } + + /* Probably should prompt to overwrite the file */ + + AcpiUtStrlwr (DisasmFilename); + File = fopen (DisasmFilename, "w+"); + if (!File) + { + fprintf (stderr, "Could not open output file %s\n", DisasmFilename); + return (AE_ERROR); + } + + /* Emit the common file header */ + + AcpiOsRedirectOutput (File); + + AcpiOsPrintf ("/*\n * %s\n", IntelAcpiCA); + AcpiOsPrintf (" * iASL Compiler/Disassembler version %8.8X\n *\n", + ACPI_CA_VERSION); + AcpiOsPrintf (" * Template for [%4.4s] ACPI Table\n", + Signature); + + /* Dump the actual ACPI table */ + + if (TableData) + { + /* Normal case, tables that appear in AcpiDmTableData */ + + if (Gbl_VerboseTemplates) + { + AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength]" + " FieldName : HexFieldValue\n */\n\n"); + } + else + { + AcpiOsPrintf (" * Format: [ByteLength]" + " FieldName : HexFieldValue\n */\n\n"); + } + + AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, + TableData->Template)); + } + else + { + /* Special ACPI tables - DSDT, SSDT, FACS, RSDP */ + + AcpiOsPrintf (" */\n\n"); + if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_DSDT)) + { + fwrite (TemplateDsdt, sizeof (TemplateDsdt) -1, 1, File); + } + else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_SSDT)) + { + fwrite (TemplateSsdt, sizeof (TemplateSsdt) -1, 1, File); + } + else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS)) + { + AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, + TemplateFacs)); + } + else if (ACPI_COMPARE_NAME (Signature, ACPI_RSDP_NAME)) + { + AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, + TemplateRsdp)); + } + else + { + fprintf (stderr, + "%4.4s, Unrecognized ACPI table signature\n", Signature); + return (AE_ERROR); + } + } + + fprintf (stderr, + "Created ACPI table template for [%4.4s], written to \"%s\"\n", + Signature, DisasmFilename); + + fclose (File); + AcpiOsRedirectOutput (stdout); + ACPI_FREE (DisasmFilename); + return (Status); +} diff --git a/compiler/dttemplate.h b/compiler/dttemplate.h new file mode 100644 index 000000000000..5379b6ecfcec --- /dev/null +++ b/compiler/dttemplate.h @@ -0,0 +1,757 @@ +/****************************************************************************** + * + * Module Name: dttemplate.h - ACPI table template definitions + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#ifndef __DTTEMPLATE_H +#define __DTTEMPLATE_H + + +/* Special templates for DSDT and SSDT (AML byte-code tables) */ + +const char TemplateDsdt[] = + "DefinitionBlock (\"dsdt.aml\", \"DSDT\", 2, \"Intel\", \"Template\", 0x00000001)\n" + "{\n" + " Method (MAIN, 0, NotSerialized)\n" + " {\n" + " Return (Zero)\n" + " }\n" + "}\n\n"; + +const char TemplateSsdt[] = + "DefinitionBlock (\"ssdt.aml\", \"SSDT\", 2, \"Intel\", \"Template\", 0x00000001)\n" + "{\n" + " Method (MAIN, 0, NotSerialized)\n" + " {\n" + " Return (Zero)\n" + " }\n" + "}\n\n"; + + +/* Templates for ACPI data tables */ + +const unsigned char TemplateAsf[] = +{ + 0x41,0x53,0x46,0x21,0x72,0x00,0x00,0x00, /* 00000000 "ASF!r..." */ + 0x10,0x0B,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" */ + 0x28,0x05,0x10,0x20,0x00,0x00,0x10,0x00, /* 00000020 "(.. ...." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x14,0x00, /* 00000030 "........" */ + 0x00,0x00,0x01,0x0C,0x00,0x00,0x00,0x00, /* 00000038 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ + 0x02,0x00,0x0C,0x00,0x01,0x04,0x00,0x00, /* 00000048 "........" */ + 0x00,0x00,0x00,0x00,0x03,0x00,0x17,0x00, /* 00000050 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ + 0x00,0x00,0x00,0x84,0x00,0x07,0x00,0x00, /* 00000068 "........" */ + 0x01,0x00 /* 00000070 ".." */ +}; + +const unsigned char TemplateBert[] = +{ + 0x42,0x45,0x52,0x54,0x30,0x00,0x00,0x00, /* 00000000 "BERT0..." */ + 0x01,0x15,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" */ + 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000028 "........" */ +}; + +const unsigned char TemplateBoot[] = +{ + 0x42,0x4F,0x4F,0x54,0x28,0x00,0x00,0x00, /* 00000000 "BOOT(..." */ + 0x01,0x0D,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ + 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ + 0x00,0x00,0x04,0x06,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ + 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00 /* 00000020 "(.. ...." */ +}; + +const unsigned char TemplateCpep[] = +{ + 0x43,0x50,0x45,0x50,0x34,0x00,0x00,0x00, /* 00000000 "CPEP4..." */ + 0x01,0x0F,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 "(.. ...." */ + 0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00, /* 00000028 "........" */ + 0x00,0x00,0x00,0x00 /* 00000030 "...." */ +}; + +const unsigned char TemplateDbgp[] = +{ + 0x44,0x42,0x47,0x50,0x34,0x00,0x00,0x00, /* 00000000 "DBGP4..." */ + 0x01,0x1A,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 "(.. ...." */ + 0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x00,0x00,0x00 /* 00000030 "...." */ +}; + +const unsigned char TemplateDmar[] = +{ + 0x44,0x4D,0x41,0x52,0x8C,0x00,0x00,0x00, /* 00000000 "DMAR...." */ + 0x01,0x15,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" */ + 0x28,0x05,0x10,0x20,0x2F,0x01,0x00,0x00, /* 00000020 "(.. /..." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x00,0x18,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */ + 0x00,0x00,0x02,0xFD,0x00,0x00,0x00,0x00, /* 00000038 "........" */ + 0x03,0x08,0x00,0x00,0x08,0xF0,0x1F,0x07, /* 00000040 "........" */ + 0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* 00000048 ".. ....." */ + 0x00,0x10,0xC2,0x78,0x00,0x00,0x00,0x00, /* 00000050 "...x...." */ + 0xFF,0x3F,0xC2,0x78,0x00,0x00,0x00,0x00, /* 00000058 ".?.x...." */ + 0x01,0x08,0x00,0x00,0x00,0x00,0x1D,0x00, /* 00000060 "........" */ + 0x02,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */ + 0x02,0x08,0x00,0x00,0x00,0x00,0x01,0x00, /* 00000070 "........" */ + 0x03,0x00,0x14,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ + 0x00,0x00,0x02,0xFD,0x00,0x00,0x00,0x00, /* 00000080 "........" */ + 0x00,0x00,0x00,0x00 /* 00000088 "...." */ +}; + +const unsigned char TemplateEcdt[] = +{ + 0x45,0x43,0x44,0x54,0x42,0x00,0x00,0x00, /* 00000000 "ECDTB..." */ + 0x01,0x2D,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" */ + 0x28,0x05,0x10,0x20,0x01,0x08,0x00,0x00, /* 00000020 "(.. ...." */ + 0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "f......." */ + 0x01,0x08,0x00,0x00,0x62,0x00,0x00,0x00, /* 00000030 "....b..." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ + 0x09,0x00 /* 00000040 ".." */ +}; + +const unsigned char TemplateEinj[] = +{ + 0x45,0x49,0x4E,0x4A,0x30,0x01,0x00,0x00, /* 00000000 "EINJ0..." */ + 0x01,0x09,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" */ + 0x28,0x05,0x10,0x20,0x30,0x00,0x00,0x00, /* 00000020 "(.. 0..." */ + 0x00,0x00,0x00,0x00,0x0A,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000030 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000048 "........" */ + 0x01,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000050 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000068 "........" */ + 0x02,0x02,0x01,0x00,0x00,0x40,0x00,0x04, /* 00000070 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000088 "........" */ + 0x03,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000090 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000A8 "........" */ + 0x04,0x03,0x01,0x00,0x00,0x40,0x00,0x04, /* 000000B0 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000C8 "........" */ + 0x05,0x03,0x01,0x00,0x01,0x10,0x00,0x02, /* 000000D0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000E8 "........" */ + 0x06,0x01,0x00,0x00,0x00,0x40,0x00,0x04, /* 000000F0 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000108 "........" */ + 0x07,0x00,0x01,0x00,0x00,0x40,0x00,0x04, /* 00000110 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF /* 00000128 "........" */ +}; + +const unsigned char TemplateErst[] = +{ + 0x45,0x52,0x53,0x54,0x30,0x02,0x00,0x00, /* 00000000 "ERST0..." */ + 0x01,0xAB,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" */ + 0x28,0x05,0x10,0x20,0x30,0x00,0x00,0x00, /* 00000020 "(.. 0..." */ + 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x03,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000030 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000048 "........" */ + 0x01,0x03,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000050 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000068 "........" */ + 0x02,0x03,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000070 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000088 "........" */ + 0x03,0x04,0x01,0x00,0x00,0x40,0x00,0x04, /* 00000090 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000A8 "........" */ + 0x04,0x02,0x00,0x00,0x00,0x40,0x00,0x04, /* 000000B0 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000C8 "........" */ + 0x05,0x03,0x00,0x00,0x01,0x08,0x00,0x01, /* 000000D0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000E8 "........" */ + 0x06,0x01,0x00,0x00,0x00,0x40,0x00,0x04, /* 000000F0 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000108 "........" */ + 0x07,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000110 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000128 "........" */ + 0x08,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000130 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000148 "........" */ + 0x09,0x02,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000150 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000168 "........" */ + 0x0A,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000170 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000178 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000180 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000188 "........" */ + 0x0B,0x03,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000190 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000198 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001A0 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000001A8 "........" */ + 0x0C,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 000001B0 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001B8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C0 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000001C8 "........" */ + 0x0D,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 000001D0 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001D8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001E0 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000001E8 "........" */ + 0x0E,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 000001F0 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001F8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000200 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000208 "........" */ + 0x0F,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000210 ".....@.." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000218 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000220 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF /* 00000228 "........" */ +}; + +const unsigned char TemplateFacs[] = +{ + 0x46,0x41,0x43,0x53,0x40,0x00,0x00,0x00, /* 00000000 "FACS@..." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000008 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000010 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000018 "........" */ + 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000020 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000038 "........" */ +}; + +const unsigned char TemplateFadt[] = +{ + 0x46,0x41,0x43,0x50,0xF4,0x00,0x00,0x00, /* 00000000 "FACP...." */ + 0x04,0x4E,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".NINTEL " */ + 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ + 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ + 0x28,0x05,0x10,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 "........" */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ + 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000048 "........" */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ + 0x04,0x02,0x01,0x04,0x08,0x00,0x00,0x00, /* 00000058 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ + 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,0x00,0x01,0x00,0x00,0x00, /* 00000088 "........" */ + 0x00,0x00,0x00,0x00,0x01,0x20,0x00,0x02, /* 00000090 "..... .." */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ + 0x00,0x00,0x00,0x00,0x01,0x10,0x00,0x02, /* 000000A8 "........" */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */ + 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 "........" */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */ + 0x00,0x00,0x00,0x00 /* 000000F0 "...." */ +}; + +const unsigned char TemplateHest[] = +{ + 0x48,0x45,0x53,0x54,0xD4,0x01,0x00,0x00, /* 00000000 "HEST...." */ + 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" */ + 0x28,0x05,0x10,0x20,0x04,0x00,0x00,0x00, /* 00000020 "(.. ...." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, /* 00000028 "........" */ + 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ + 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 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 "........" */ + 0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, /* 00000088 "........" */ + 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000090 "........" */ + 0x00,0x00,0x00,0x00,0x00,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,0x02,0x00,0x00,0x00, /* 000000B0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */ + 0x00,0x00,0x00,0x00,0x01,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 "........" */ + 0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x01, /* 000000F0 "........" */ + 0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000F8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "........" */ + 0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00, /* 00000118 "........" */ + 0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00, /* 00000120 "........" */ + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */ + 0x00,0x00,0x00,0x00,0x09,0x00,0x02,0x00, /* 00000150 "........" */ + 0xFF,0xFF,0x00,0x01,0x01,0x00,0x00,0x00, /* 00000158 "........" */ + 0x01,0x00,0x00,0x00,0x00,0x10,0x00,0x00, /* 00000160 "........" */ + 0x00,0x40,0x00,0x04,0x00,0x00,0x00,0x00, /* 00000168 ".@......" */ + 0x00,0x00,0x00,0x00,0x03,0x1C,0x00,0x00, /* 00000170 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000178 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000180 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000188 "........" */ + 0x00,0x10,0x00,0x00,0x09,0x00,0x03,0x00, /* 00000190 "........" */ + 0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00, /* 00000198 "........" */ + 0x01,0x00,0x00,0x00,0x00,0x10,0x00,0x00, /* 000001A0 "........" */ + 0x00,0x40,0x00,0x04,0x00,0x00,0x00,0x00, /* 000001A8 ".@......" */ + 0x00,0x00,0x00,0x00,0x04,0x1C,0x00,0x00, /* 000001B0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001B8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C8 "........" */ + 0x00,0x10,0x00,0x00 /* 000001D0 "...." */ +}; + +const unsigned char TemplateHpet[] = +{ + 0x48,0x50,0x45,0x54,0x38,0x00,0x00,0x00, /* 00000000 "HPET8..." */ + 0x01,0x09,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" */ + 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000030 "........" */ +}; + +const unsigned char TemplateIvrs[] = +{ + 0x49,0x56,0x52,0x53,0xBC,0x00,0x00,0x00, /* 00000000 "IVRS...." */ + 0x01,0x87,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" */ + 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0x10,0x14,0x34,0x00,0x00,0x00,0x00,0x00, /* 00000030 "..4....." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ + 0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00, /* 00000048 "....@..." */ + 0x00,0x00,0x00,0x00,0x42,0x00,0x00,0x00, /* 00000050 "....B..." */ + 0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00, /* 00000058 "....H..." */ + 0x00,0x00,0x00,0x00,0x20,0x08,0x20,0x00, /* 00000060 ".... . ." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ + 0x00,0x00,0x00,0x00,0x21,0x04,0x20,0x00, /* 00000080 "....!. ." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ + 0x00,0x00,0x00,0x00,0x10,0x14,0x18,0x00, /* 000000A0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */ + 0x00,0x00,0x00,0x00 /* 000000B8 "...." */ +}; + +const unsigned char TemplateMadt[] = +{ + 0x41,0x50,0x49,0x43,0xB6,0x00,0x00,0x00, /* 00000000 "APIC...." */ + 0x01,0x45,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".EINTEL " */ + 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ + 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ + 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ + 0x01,0x00,0x00,0x00,0x00,0x08,0x00,0x00, /* 00000028 "........" */ + 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 "........" */ + 0x00,0x00,0x04,0x06,0x00,0x05,0x00,0x01, /* 00000050 "........" */ + 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" */ + 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 /* 000000B0 "......" */ +}; + +const unsigned char TemplateMcfg[] = +{ + 0x4D,0x43,0x46,0x47,0x3C,0x00,0x00,0x00, /* 00000000 "MCFG<..." */ + 0x01,0x19,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" */ + 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ + 0x00,0x00,0x00,0x00 /* 00000038 "...." */ +}; + +const unsigned char TemplateMchi[] = +{ + 0x4D,0x43,0x48,0x49,0x45,0x00,0x00,0x00, /* 00000000 "MCHIE..." */ + 0x01,0xE4,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ + 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ + 0x15,0x07,0x00,0x02,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ + 0x28,0x05,0x10,0x20,0x01,0x00,0x00,0x00, /* 00000020 "(.. ...." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x02,0x08,0x00, /* 00000030 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ + 0x00,0x00,0x00,0x00,0x00 /* 00000040 "....." */ +}; + +const unsigned char TemplateMsct[] = +{ + 0x4D,0x53,0x43,0x54,0x90,0x00,0x00,0x00, /* 00000000 "MSCT...." */ + 0x01,0xB7,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" */ + 0x28,0x05,0x10,0x20,0x38,0x00,0x00,0x00, /* 00000020 "(.. 8..." */ + 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0x00,0x00, /* 00000030 "........" */ + 0x01,0x16,0x00,0x00,0x00,0x00,0x03,0x00, /* 00000038 "........" */ + 0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */ + 0x00,0x00,0x40,0x00,0x00,0x00,0x01,0x16, /* 00000048 "..@....." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ + 0x00,0x00,0x00,0x00,0x01,0x16,0x00,0x00, /* 00000060 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */ + 0x00,0x00,0x01,0x16,0x00,0x00,0x00,0x00, /* 00000078 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000088 "........" */ +}; + +const unsigned char TemplateRsdp[] = +{ + 0x52,0x53,0x44,0x20,0x50,0x54,0x52,0x20, /* 00000000 "RSD PTR " */ + 0x43,0x49,0x4E,0x54,0x45,0x4C,0x20,0x02, /* 00000008 "CINTEL ." */ + 0x00,0x00,0x00,0x00,0x24,0x00,0x00,0x00, /* 00000010 "....$..." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000018 "........" */ + 0xDC,0x00,0x00,0x00 /* 00000020 "...." */ +}; + +const unsigned char TemplateRsdt[] = +{ + 0x52,0x53,0x44,0x54,0x44,0x00,0x00,0x00, /* 00000000 "RSDTD..." */ + 0x01,0xB1,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" */ + 0x28,0x05,0x10,0x20,0x10,0x00,0x00,0x00, /* 00000020 "(.. ...." */ + 0x20,0x00,0x00,0x00,0x30,0x00,0x00,0x00, /* 00000028 " ...0..." */ + 0x40,0x00,0x00,0x00,0x50,0x00,0x00,0x00, /* 00000030 "@...P..." */ + 0x60,0x00,0x00,0x00,0x70,0x00,0x00,0x00, /* 00000038 "`...p..." */ + 0x80,0x00,0x00,0x00 /* 00000040 "...." */ +}; + +const unsigned char TemplateSbst[] = +{ + 0x53,0x42,0x53,0x54,0x30,0x00,0x00,0x00, /* 00000000 "SBST0..." */ + 0x01,0x06,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" */ + 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000028 "........" */ +}; + +const unsigned char TemplateSlit[] = +{ + 0x53,0x4C,0x49,0x54,0x3C,0x00,0x00,0x00, /* 00000000 "SLIT<..." */ + 0x01,0x1B,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,0x04,0x00,0x00,0x00, /* 00000020 "(.. ...." */ + 0x00,0x00,0x00,0x00,0x0A,0x0F,0x0F,0x0F, /* 00000028 "........" */ + 0x0F,0x0A,0x0F,0x0F,0x0F,0x0F,0x0A,0x0F, /* 00000030 "........" */ + 0x0F,0x0F,0x0F,0x0A /* 00000038 "...." */ +}; + +const unsigned char TemplateSpcr[] = +{ + 0x53,0x50,0x43,0x52,0x50,0x00,0x00,0x00, /* 00000000 "SPCRP..." */ + 0x01,0xE3,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 "(.. ...." */ + 0x00,0x08,0x00,0x00,0x00,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 "........" */ +}; + +const unsigned char TemplateSpmi[] = +{ + 0x53,0x50,0x4D,0x49,0x41,0x00,0x00,0x00, /* 00000000 "SPMIA..." */ + 0x04,0xED,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 "(.. ...." */ + 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 "........" */ + 0x00 /* 00000040 "." */ +}; + +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" */ + 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ + 0x28,0x05,0x10,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 "........" */ + 0x01,0x28,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 ".(......" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */ + 0x00,0xFC,0x09,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000058 "........" */ + 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 "........" */ +}; + +const unsigned char TemplateTcpa[] = +{ + 0x54,0x43,0x50,0x41,0x32,0x00,0x00,0x00, /* 00000000 "TCPA2..." */ + 0x01,0x67,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".gINTEL " */ + 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ + 0x80,0x31,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 ".1..INTL" */ + 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */ + 0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x00 /* 00000030 ".." */ +}; + +const unsigned char TemplateUefi[] = +{ + 0x55,0x45,0x46,0x49,0x36,0x00,0x00,0x00, /* 00000000 "UEFI6..." */ + 0x01,0x9B,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" */ + 0x28,0x05,0x10,0x20,0x00,0x01,0x02,0x03, /* 00000020 "(.. ...." */ + 0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B, /* 00000028 "........" */ + 0x0C,0x0D,0x0E,0x0F,0x00,0x00 /* 00000030 "......" */ +}; + +const unsigned char TemplateWaet[] = +{ + 0x57,0x41,0x45,0x54,0x28,0x00,0x00,0x00, /* 00000000 "WAET(..." */ + 0x01,0x19,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" */ + 0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00 /* 00000020 "(.. ...." */ +}; + +const unsigned char TemplateWdat[] = +{ + 0x57,0x44,0x41,0x54,0x5C,0x00,0x00,0x00, /* 00000000 "WDAT\..." */ + 0x01,0xE3,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,0x20,0x00,0x00,0x00, /* 00000020 "(.. ..." */ + 0xFF,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00, /* 00000028 "........" */ + 0x58,0x02,0x00,0x00,0xFF,0x03,0x00,0x00, /* 00000030 "X......." */ + 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ + 0x0E,0x00,0x00,0x00,0x01,0x02,0x00,0x00, /* 00000040 "........" */ + 0x01,0x10,0x00,0x02,0x60,0x04,0x00,0x00, /* 00000048 "....`..." */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000050 "........" */ + 0x01,0x00,0x00,0x00 /* 00000058 "...." */ +}; + +const unsigned char TemplateWddt[] = +{ + 0x57,0x44,0x44,0x54,0x40,0x00,0x00,0x00, /* 00000000 "WDDT@..." */ + 0x01,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 "(.. ...." */ + 0x00,0x00,0x01,0xFF,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000038 "........" */ +}; + +const unsigned char TemplateWdrt[] = +{ + 0x57,0x44,0x52,0x54,0x47,0x00,0x00,0x00, /* 00000000 "WDRTG..." */ + 0x01,0xB0,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" */ + 0x28,0x05,0x10,0x20,0x00,0x20,0x00,0x00, /* 00000020 "(.. . .." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ + 0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 ". ......" */ + 0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF, /* 00000038 "........" */ + 0x00,0x00,0x00,0x00,0xFF,0xFF,0x00 /* 00000040 "......." */ +}; + +const unsigned char TemplateXsdt[] = +{ + 0x58,0x53,0x44,0x54,0x64,0x00,0x00,0x00, /* 00000000 "XSDTd..." */ + 0x01,0x8B,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" */ + 0x28,0x05,0x10,0x20,0x10,0x00,0x00,0x00, /* 00000020 "(.. ...." */ + 0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00, /* 00000028 ".... ..." */ + 0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00, /* 00000030 "....0..." */ + 0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00, /* 00000038 "....@..." */ + 0x00,0x00,0x00,0x00,0x50,0x00,0x00,0x00, /* 00000040 "....P..." */ + 0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00, /* 00000048 "....`..." */ + 0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00, /* 00000050 "....p..." */ + 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00, /* 00000058 "........" */ + 0x00,0x00,0x00,0x00 /* 00000060 "...." */ +}; + +#endif diff --git a/compiler/dtutils.c b/compiler/dtutils.c index c3a4a85cd094..2394b300868b 100644 --- a/compiler/dtutils.c +++ b/compiler/dtutils.c @@ -472,11 +472,8 @@ DtGetFieldType ( case ACPI_DMT_BUFFER: case ACPI_DMT_BUF16: - Type = DT_FIELD_TYPE_BUFFER; - break; - case ACPI_DMT_PCI_PATH: - Type = DT_FIELD_TYPE_PCI_PATH; + Type = DT_FIELD_TYPE_BUFFER; break; case ACPI_DMT_GAS: @@ -543,6 +540,8 @@ DtGetBufferLength ( * * DESCRIPTION: Get length of bytes needed to compile the field * + * Note: This function must remain in sync with AcpiDmDumpTable. + * *****************************************************************************/ UINT32 @@ -574,12 +573,16 @@ DtGetFieldLength ( case ACPI_DMT_UINT8: case ACPI_DMT_CHKSUM: case ACPI_DMT_SPACEID: + case ACPI_DMT_IVRS: case ACPI_DMT_MADT: case ACPI_DMT_SRAT: case ACPI_DMT_ASF: case ACPI_DMT_HESTNTYP: case ACPI_DMT_FADTPM: - case ACPI_DMT_IVRS: + case ACPI_DMT_EINJACT: + case ACPI_DMT_EINJINST: + case ACPI_DMT_ERSTACT: + case ACPI_DMT_ERSTINST: ByteLength = 1; break; @@ -753,6 +756,11 @@ DtSetTableLength ( ChildTable = DtGetNextSubtable (ParentTable, ChildTable); if (ChildTable) { + if (ChildTable->LengthField) + { + DtSetSubtableLength (ChildTable); + } + if (ChildTable->Child) { ParentTable = ChildTable; |