summaryrefslogtreecommitdiffstats
path: root/source/compiler
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2012-08-16 17:26:22 +0000
committerjkim <jkim@FreeBSD.org>2012-08-16 17:26:22 +0000
commit08e6f22ac3350a67c38e9b42b5dce2a7d5fa08b4 (patch)
treea28a9676fa0b9e969cfd83d7a508660c754c8b3e /source/compiler
parentdbd90a99cde8c4a942a41f095faa72f479694173 (diff)
downloadFreeBSD-src-08e6f22ac3350a67c38e9b42b5dce2a7d5fa08b4.zip
FreeBSD-src-08e6f22ac3350a67c38e9b42b5dce2a7d5fa08b4.tar.gz
Import ACPICA 20120816.
Diffstat (limited to 'source/compiler')
-rw-r--r--source/compiler/Makefile360
-rw-r--r--source/compiler/aslcompiler.h5
-rw-r--r--source/compiler/aslcompiler.y146
-rw-r--r--source/compiler/aslfold.c129
-rw-r--r--source/compiler/aslmessages.h2
-rw-r--r--source/compiler/asltree.c86
-rw-r--r--source/compiler/aslutils.c55
-rwxr-xr-xsource/compiler/new_table.txt88
8 files changed, 351 insertions, 520 deletions
diff --git a/source/compiler/Makefile b/source/compiler/Makefile
deleted file mode 100644
index 86e0753..0000000
--- a/source/compiler/Makefile
+++ /dev/null
@@ -1,360 +0,0 @@
-#
-# iASL compiler/disassembler
-#
-# NOTE: This makefile is intended to be used within the native
-# ACPICA source tree.
-#
-
-#
-# Configuration
-# Notes:
-# gcc should be version 4 or greater, otherwise some of the options
-# used will not be recognized.
-# Global optimization flags (such as -O2, -Os) are not used, since
-# they cause issues on some compilers.
-# The _GNU_SOURCE symbol is required for many hosts.
-#
-PROG = iasl
-
-HOST = _LINUX
-NOMAN = YES
-COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $<
-
-ACPICA_SRC = ../../source
-ACPICA_COMMON = $(ACPICA_SRC)/common
-ACPICA_TOOLS = $(ACPICA_SRC)/tools
-ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers
-ACPICA_CORE = $(ACPICA_SRC)/components
-ACPICA_INCLUDE = $(ACPICA_SRC)/include
-ACPICA_DEBUGGER = $(ACPICA_CORE)/debugger
-ACPICA_DISASSEMBLER = $(ACPICA_CORE)/disassembler
-ACPICA_DISPATCHER = $(ACPICA_CORE)/dispatcher
-ACPICA_EVENTS = $(ACPICA_CORE)/events
-ACPICA_EXECUTER = $(ACPICA_CORE)/executer
-ACPICA_HARDWARE = $(ACPICA_CORE)/hardware
-ACPICA_NAMESPACE = $(ACPICA_CORE)/namespace
-ACPICA_PARSER = $(ACPICA_CORE)/parser
-ACPICA_RESOURCES = $(ACPICA_CORE)/resources
-ACPICA_TABLES = $(ACPICA_CORE)/tables
-ACPICA_UTILITIES = $(ACPICA_CORE)/utilities
-ASL_COMPILER = $(ACPICA_SRC)/compiler
-INSTALLDIR = /usr/bin
-INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR)
-
-ACPICA_HEADERS = \
- $(wildcard $(ACPICA_INCLUDE)/*.h) \
- $(wildcard $(ACPICA_INCLUDE)/platform/*.h)
-
-#
-# Search paths for source files
-#
-vpath %.c \
- $(ASL_COMPILER) \
- $(ACPICA_DEBUGGER) \
- $(ACPICA_DISASSEMBLER) \
- $(ACPICA_DISPATCHER) \
- $(ACPICA_EXECUTER) \
- $(ACPICA_NAMESPACE) \
- $(ACPICA_PARSER) \
- $(ACPICA_TABLES) \
- $(ACPICA_UTILITIES) \
- $(ACPICA_COMMON) \
- $(ACPICA_OSL)
-
-HEADERS = \
- $(wildcard $(ASL_COMPILER)/*.h) \
- aslcompiler.y.h \
- dtparser.y.h \
- prparser.y.h
-
-OBJECTS = \
- aslcompilerlex.o \
- aslcompilerparse.o \
- dtparserlex.o \
- dtparserparse.o \
- prparserlex.o \
- prparserparse.o \
- adfile.o \
- adisasm.o \
- adwalk.o \
- ahpredef.o \
- aslanalyze.o \
- aslbtypes.o \
- aslcodegen.o \
- aslcompile.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 \
- aslrestype2s.o \
- aslrestype2q.o \
- aslrestype2w.o \
- aslstartup.o \
- aslstubs.o \
- asltransform.o \
- asltree.o \
- aslutils.o \
- asluuid.o \
- aslwalks.o \
- dtcompile.o \
- dtexpress.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 \
- dmresrcl2.o \
- dmresrcs.o \
- dmrestag.o \
- dmtable.o \
- dmtbdump.o \
- dmtbinfo.o \
- dmutils.o \
- dmwalk.o \
- dsargs.o \
- dscontrol.o \
- dsfield.o \
- dsobject.o \
- dsopcode.o \
- dsutils.o \
- dswexec.o \
- dswload.o \
- dswload2.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 \
- prexpress.o \
- prmacros.o \
- prscan.o \
- prutils.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 \
- utaddress.o \
- utalloc.o \
- utcache.o \
- utcopy.o \
- utdebug.o \
- utdecode.o \
- utdelete.o \
- utexcep.o \
- utglobal.o \
- utinit.o \
- utlock.o \
- utmath.o \
- utmisc.o \
- utmutex.o \
- utobject.o \
- utresrc.o \
- utstate.o \
- utxferror.o \
- utxface.o
-
-INTERMEDIATES = \
- aslcompilerlex.c \
- aslcompilerparse.c \
- dtparserlex.c \
- dtparserparse.c \
- prparserlex.c \
- prparserparse.c
-
-MISC = \
- aslcompilerparse.h \
- aslcompiler.y.h \
- aslcompilerparse.output \
- dtparserparse.h \
- dtparser.y.h \
- dtparserparse.output \
- prparserparse.h \
- prparser.y.h \
- prparserparse.output
-
-CFLAGS+= \
- -D$(HOST) \
- -D_GNU_SOURCE \
- -DACPI_ASL_COMPILER \
- -I$(ACPICA_INCLUDE) \
- -I$(ASL_COMPILER)
-
-CWARNINGFLAGS = \
- -ansi \
- -Wall \
- -Wbad-function-cast \
- -Wdeclaration-after-statement \
- -Werror \
- -Wformat=2 \
- -Wmissing-declarations \
- -Wmissing-prototypes \
- -Wstrict-aliasing=0 \
- -Wstrict-prototypes \
- -Wswitch-default \
- -Wpointer-arith \
- -Wundef
-
-#
-# gcc 4+ flags
-#
-CWARNINGFLAGS += \
- -Waddress \
- -Waggregate-return \
- -Wchar-subscripts \
- -Wempty-body \
- -Wlogical-op \
- -Wmissing-declarations \
- -Wmissing-field-initializers \
- -Wmissing-parameter-type \
- -Wnested-externs \
- -Wold-style-declaration \
- -Wold-style-definition \
- -Wredundant-decls \
- -Wtype-limits
-
-#
-# Bison/Flex configuration
-#
-YACC= bison
-YFLAGS+= -v -d -y
-
-LEX= flex
-LFLAGS+= -i -s
-
-#
-# Root rule
-#
-$(PROG) : $(INTERMEDIATES) $(MISC) $(OBJECTS)
- $(CC) $(OBJECTS) $(LDFLAGS) -o $(PROG)
-
-#
-# Parser and Lexer - intermediate C files
-#
-aslcompilerlex.c : $(ASL_COMPILER)/aslcompiler.l $(ASL_COMPILER)/aslsupport.l
- ${LEX} ${LFLAGS} -PAslCompiler -o$@ $(ASL_COMPILER)/aslcompiler.l
-
-aslcompilerparse.c aslcompilerparse.h : $(ASL_COMPILER)/aslcompiler.y
- ${YACC} ${YFLAGS} -pAslCompiler -o$@ $?
-
-dtparserlex.c : $(ASL_COMPILER)/dtparser.l
- ${LEX} ${LFLAGS} -PDtParser -o$@ $?
-
-dtparserparse.c dtparserparse.h : $(ASL_COMPILER)/dtparser.y
- ${YACC} ${YFLAGS} -pDtParser -o$@ $?
-
-prparserlex.c : $(ASL_COMPILER)/prparser.l
- ${LEX} ${LFLAGS} -PPrParser -o$@ $?
-
-prparserparse.c prparserparse.h : $(ASL_COMPILER)/prparser.y
- ${YACC} ${YFLAGS} -pPrParser -o$@ $?
-
-
-# Rename headers produced by bison/yacc
-
-aslcompiler.y.h : aslcompilerparse.h
- @echo Copy intermediate file:
- @cp -f -v aslcompilerparse.h aslcompiler.y.h
-
-dtparser.y.h: dtparserparse.h
- @echo Copy intermediate file:
- @cp -f -v dtparserparse.h dtparser.y.h
-
-prparser.y.h: prparserparse.h
- @echo Copy intermediate file:
- @cp -f -v prparserparse.h prparser.y.h
-
-
-#
-# Parsers and Lexers - 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 -Wstrict-aliasing=0 -o$@ $?
-
-aslcompilerparse.o : aslcompilerparse.c
- $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
-
-dtparserlex.o : dtparserlex.c
- $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
-
-dtparserparse.o : dtparserparse.c
- $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
-
-prparserlex.o : prparserlex.c
- $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
-
-prparserparse.o : prparserparse.c
- $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $?
-
-
-%.o : %.c $(HEADERS) $(ACPICA_HEADERS)
- $(COMPILE)
-
-clean :
- rm -f $(PROG) $(PROG).exe $(OBJECTS) $(INTERMEDIATES) $(MISC)
-
-install :
- $(INSTALLPROG)
diff --git a/source/compiler/aslcompiler.h b/source/compiler/aslcompiler.h
index 937530d..09b3f6c 100644
--- a/source/compiler/aslcompiler.h
+++ b/source/compiler/aslcompiler.h
@@ -594,6 +594,11 @@ TrSetNodeFlags (
UINT32 Flags);
ACPI_PARSE_OBJECT *
+TrSetNodeAmlLength (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 Length);
+
+ACPI_PARSE_OBJECT *
TrLinkPeerNodes (
UINT32 NumPeers,
...);
diff --git a/source/compiler/aslcompiler.y b/source/compiler/aslcompiler.y
index 7df36a8..92ae940 100644
--- a/source/compiler/aslcompiler.y
+++ b/source/compiler/aslcompiler.y
@@ -560,7 +560,7 @@ void * AslLocalAllocate (unsigned int Size);
%type <n> SwitchTerm
%type <n> UnloadTerm
%type <n> WhileTerm
-//%type <n> CaseTermList
+/* %type <n> CaseTermList */
/* Type 2 opcodes */
@@ -2507,30 +2507,38 @@ ConstExprTerm
| PARSEOP___PATH__ {$$ = TrCreateConstantLeafNode (PARSEOP___PATH__);}
;
+/*
+ * The NODE_COMPILE_TIME_CONST flag in the following constant expressions
+ * enables compile-time constant folding to reduce the Type3Opcodes/Type2IntegerOpcodes
+ * to simple integers. It is an error if these types of expressions cannot be
+ * reduced, since the AML grammar for ****ConstExpr requires a simple constant.
+ * Note: The required byte length of the constant is passed through to the
+ * constant folding code in the node AmlLength field.
+ */
ByteConstExpr
- : Type3Opcode {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
- | Type2IntegerOpcode {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
+ : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);}
+ | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);}
| ConstExprTerm {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
| ByteConst {}
;
WordConstExpr
- : Type3Opcode {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
- | Type2IntegerOpcode {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
+ : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);}
+ | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);}
| ConstExprTerm {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
| WordConst {}
;
DWordConstExpr
- : Type3Opcode {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
- | Type2IntegerOpcode {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
+ : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);}
+ | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);}
| ConstExprTerm {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
| DWordConst {}
;
QWordConstExpr
- : Type3Opcode {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
- | Type2IntegerOpcode {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
+ : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);}
+ | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);}
| ConstExprTerm {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
| QWordConst {}
;
@@ -2839,10 +2847,10 @@ ExtendedSpaceTerm
FixedDmaTerm
: PARSEOP_FIXEDDMA '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDDMA);}
- WordConstExpr // 04: DMA RequestLines
- ',' WordConstExpr // 06: DMA Channels
- OptionalXferSize // 07: DMA TransferSize
- OptionalNameString // 08: DescriptorName
+ WordConstExpr /* 04: DMA RequestLines */
+ ',' WordConstExpr /* 06: DMA Channels */
+ OptionalXferSize /* 07: DMA TransferSize */
+ OptionalNameString /* 08: DescriptorName */
')' {$$ = TrLinkChildren ($<n>3,4,$4,$6,$7,$8);}
| PARSEOP_FIXEDDMA '('
error ')' {$$ = AslDoError(); yyclearin;}
@@ -2860,16 +2868,16 @@ FixedIOTerm
GpioIntTerm
: PARSEOP_GPIO_INT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_INT);}
- InterruptTypeKeyword // 04: InterruptType
- ',' InterruptLevel // 06: InterruptLevel
- OptionalShareType // 07: SharedType
- ',' PinConfigByte // 09: PinConfig
- OptionalWordConstExpr // 10: DebounceTimeout
- ',' StringData // 12: ResourceSource
- OptionalByteConstExpr // 13: ResourceSourceIndex
- OptionalResourceType // 14: ResourceType
- OptionalNameString // 15: DescriptorName
- OptionalBuffer_Last // 16: VendorData
+ InterruptTypeKeyword /* 04: InterruptType */
+ ',' InterruptLevel /* 06: InterruptLevel */
+ OptionalShareType /* 07: SharedType */
+ ',' PinConfigByte /* 09: PinConfig */
+ OptionalWordConstExpr /* 10: DebounceTimeout */
+ ',' StringData /* 12: ResourceSource */
+ OptionalByteConstExpr /* 13: ResourceSourceIndex */
+ OptionalResourceType /* 14: ResourceType */
+ OptionalNameString /* 15: DescriptorName */
+ OptionalBuffer_Last /* 16: VendorData */
')' '{'
DWordConstExpr '}' {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);}
| PARSEOP_GPIO_INT '('
@@ -2878,16 +2886,16 @@ GpioIntTerm
GpioIoTerm
: PARSEOP_GPIO_IO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_IO);}
- OptionalShareType_First // 04: SharedType
- ',' PinConfigByte // 06: PinConfig
- OptionalWordConstExpr // 07: DebounceTimeout
- OptionalWordConstExpr // 08: DriveStrength
- OptionalIoRestriction // 09: IoRestriction
- ',' StringData // 11: ResourceSource
- OptionalByteConstExpr // 12: ResourceSourceIndex
- OptionalResourceType // 13: ResourceType
- OptionalNameString // 14: DescriptorName
- OptionalBuffer_Last // 15: VendorData
+ OptionalShareType_First /* 04: SharedType */
+ ',' PinConfigByte /* 06: PinConfig */
+ OptionalWordConstExpr /* 07: DebounceTimeout */
+ OptionalWordConstExpr /* 08: DriveStrength */
+ OptionalIoRestriction /* 09: IoRestriction */
+ ',' StringData /* 11: ResourceSource */
+ OptionalByteConstExpr /* 12: ResourceSourceIndex */
+ OptionalResourceType /* 13: ResourceType */
+ OptionalNameString /* 14: DescriptorName */
+ OptionalBuffer_Last /* 15: VendorData */
')' '{'
DWordList '}' {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);}
| PARSEOP_GPIO_IO '('
@@ -2896,15 +2904,15 @@ GpioIoTerm
I2cSerialBusTerm
: PARSEOP_I2C_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);}
- WordConstExpr // 04: SlaveAddress
- OptionalSlaveMode // 05: SlaveMode
- ',' DWordConstExpr // 07: ConnectionSpeed
- OptionalAddressingMode // 08: AddressingMode
- ',' StringData // 10: ResourceSource
- OptionalByteConstExpr // 11: ResourceSourceIndex
- OptionalResourceType // 12: ResourceType
- OptionalNameString // 13: DescriptorName
- OptionalBuffer_Last // 14: VendorData
+ WordConstExpr /* 04: SlaveAddress */
+ OptionalSlaveMode /* 05: SlaveMode */
+ ',' DWordConstExpr /* 07: ConnectionSpeed */
+ OptionalAddressingMode /* 08: AddressingMode */
+ ',' StringData /* 10: ResourceSource */
+ OptionalByteConstExpr /* 11: ResourceSourceIndex */
+ OptionalResourceType /* 12: ResourceType */
+ OptionalNameString /* 13: DescriptorName */
+ OptionalBuffer_Last /* 14: VendorData */
')' {$$ = TrLinkChildren ($<n>3,9,$4,$5,$7,$8,$10,$11,$12,$13,$14);}
| PARSEOP_I2C_SERIALBUS '('
error ')' {$$ = AslDoError(); yyclearin;}
@@ -3077,19 +3085,19 @@ RegisterTerm
SpiSerialBusTerm
: PARSEOP_SPI_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);}
- WordConstExpr // 04: DeviceSelection
- OptionalDevicePolarity // 05: DevicePolarity
- OptionalWireMode // 06: WireMode
- ',' ByteConstExpr // 08: DataBitLength
- OptionalSlaveMode // 09: SlaveMode
- ',' DWordConstExpr // 11: ConnectionSpeed
- ',' ClockPolarityKeyword // 13: ClockPolarity
- ',' ClockPhaseKeyword // 15: ClockPhase
- ',' StringData // 17: ResourceSource
- OptionalByteConstExpr // 18: ResourceSourceIndex
- OptionalResourceType // 19: ResourceType
- OptionalNameString // 20: DescriptorName
- OptionalBuffer_Last // 21: VendorData
+ WordConstExpr /* 04: DeviceSelection */
+ OptionalDevicePolarity /* 05: DevicePolarity */
+ OptionalWireMode /* 06: WireMode */
+ ',' ByteConstExpr /* 08: DataBitLength */
+ OptionalSlaveMode /* 09: SlaveMode */
+ ',' DWordConstExpr /* 11: ConnectionSpeed */
+ ',' ClockPolarityKeyword /* 13: ClockPolarity */
+ ',' ClockPhaseKeyword /* 15: ClockPhase */
+ ',' StringData /* 17: ResourceSource */
+ OptionalByteConstExpr /* 18: ResourceSourceIndex */
+ OptionalResourceType /* 19: ResourceType */
+ OptionalNameString /* 20: DescriptorName */
+ OptionalBuffer_Last /* 21: VendorData */
')' {$$ = TrLinkChildren ($<n>3,13,$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21);}
| PARSEOP_SPI_SERIALBUS '('
error ')' {$$ = AslDoError(); yyclearin;}
@@ -3115,20 +3123,20 @@ StartDependentFnTerm
UartSerialBusTerm
: PARSEOP_UART_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);}
- DWordConstExpr // 04: ConnectionSpeed
- OptionalBitsPerByte // 05: BitsPerByte
- OptionalStopBits // 06: StopBits
- ',' ByteConstExpr // 08: LinesInUse
- OptionalEndian // 09: Endianess
- OptionalParityType // 10: Parity
- OptionalFlowControl // 11: FlowControl
- ',' WordConstExpr // 13: Rx BufferSize
- ',' WordConstExpr // 15: Tx BufferSize
- ',' StringData // 17: ResourceSource
- OptionalByteConstExpr // 18: ResourceSourceIndex
- OptionalResourceType // 19: ResourceType
- OptionalNameString // 20: DescriptorName
- OptionalBuffer_Last // 21: VendorData
+ DWordConstExpr /* 04: ConnectionSpeed */
+ OptionalBitsPerByte /* 05: BitsPerByte */
+ OptionalStopBits /* 06: StopBits */
+ ',' ByteConstExpr /* 08: LinesInUse */
+ OptionalEndian /* 09: Endianess */
+ OptionalParityType /* 10: Parity */
+ OptionalFlowControl /* 11: FlowControl */
+ ',' WordConstExpr /* 13: Rx BufferSize */
+ ',' WordConstExpr /* 15: Tx BufferSize */
+ ',' StringData /* 17: ResourceSource */
+ OptionalByteConstExpr /* 18: ResourceSourceIndex */
+ OptionalResourceType /* 19: ResourceType */
+ OptionalNameString /* 20: DescriptorName */
+ OptionalBuffer_Last /* 21: VendorData */
')' {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21);}
| PARSEOP_UART_SERIALBUS '('
error ')' {$$ = AslDoError(); yyclearin;}
diff --git a/source/compiler/aslfold.c b/source/compiler/aslfold.c
index c1fd271..6c8cb37 100644
--- a/source/compiler/aslfold.c
+++ b/source/compiler/aslfold.c
@@ -73,6 +73,11 @@ OpcAmlCheckForConstant (
UINT32 Level,
void *Context);
+static void
+OpcUpdateIntegerNode (
+ ACPI_PARSE_OBJECT *Op,
+ UINT64 Value);
+
/*******************************************************************************
*
@@ -214,14 +219,14 @@ OpcAmlCheckForConstant (
{
/*
* We are looking at at normal expression to see if it can be
- * reduced. It can't. No error
+ * reduced. It can't. No error
*/
return (AE_TYPE);
}
/*
* This is an expression that MUST reduce to a constant, and it
- * can't be reduced. This is an error
+ * can't be reduced. This is an error
*/
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
{
@@ -319,17 +324,17 @@ OpcAmlConstantWalk (
return AE_NO_MEMORY;
}
- WalkState->NextOp = NULL;
- WalkState->Params = NULL;
- WalkState->CallerReturnDesc = &ObjDesc;
- WalkState->WalkType = WalkType;
+ WalkState->NextOp = NULL;
+ WalkState->Params = NULL;
+ WalkState->WalkType = WalkType;
+ WalkState->CallerReturnDesc = &ObjDesc;
/*
* Examine the entire subtree -- all nodes must be constants
* or type 3/4/5 opcodes
*/
Status = TrWalkParseTree (Op, ASL_WALK_VISIT_DOWNWARD,
- OpcAmlCheckForConstant, NULL, WalkState);
+ OpcAmlCheckForConstant, NULL, WalkState);
/*
* Did we find an entire subtree that contains all constants and type 3/4/5
@@ -369,7 +374,7 @@ OpcAmlConstantWalk (
/* Hand off the subtree to the AML interpreter */
Status = TrWalkParseTree (Op, ASL_WALK_VISIT_TWICE,
- OpcAmlEvaluationWalk1, OpcAmlEvaluationWalk2, WalkState);
+ OpcAmlEvaluationWalk1, OpcAmlEvaluationWalk2, WalkState);
Op->Common.Parent = OriginalParentOp;
/* TBD: we really *should* release the RootOp node */
@@ -382,22 +387,26 @@ OpcAmlConstantWalk (
Status = AcpiDsResultPop (&ObjDesc, WalkState);
}
+
+ /* Check for error from the ACPICA core */
+
+ if (ACPI_FAILURE (Status))
+ {
+ AslCoreSubsystemError (Op, Status,
+ "Failure during constant evaluation", FALSE);
+ }
}
if (ACPI_FAILURE (Status))
{
/* We could not resolve the subtree for some reason */
- AslCoreSubsystemError (Op, Status,
- "Failure during constant evaluation", FALSE);
AslError (ASL_ERROR, ASL_MSG_CONSTANT_EVALUATION, Op,
Op->Asl.ParseOpName);
- /* Set the subtree value to ZERO anyway. Eliminates further errors */
+ /* Set the subtree value to ZERO anyway. Eliminates further errors */
- Op->Asl.ParseOpcode = PARSEOP_INTEGER;
- Op->Common.Value.Integer = 0;
- OpcSetOptimalIntegerSize (Op);
+ OpcUpdateIntegerNode (Op, 0);
}
else
{
@@ -412,21 +421,20 @@ OpcAmlConstantWalk (
{
case ACPI_TYPE_INTEGER:
- Op->Asl.ParseOpcode = PARSEOP_INTEGER;
- Op->Common.Value.Integer = ObjDesc->Integer.Value;
- OpcSetOptimalIntegerSize (Op);
+ OpcUpdateIntegerNode (Op, ObjDesc->Integer.Value);
DbgPrint (ASL_PARSE_OUTPUT,
- "Constant expression reduced to (INTEGER) %8.8X%8.8X\n",
- ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
+ "Constant expression reduced to (%s) %8.8X%8.8X\n",
+ Op->Asl.ParseOpName,
+ ACPI_FORMAT_UINT64 (Op->Common.Value.Integer));
break;
case ACPI_TYPE_STRING:
- Op->Asl.ParseOpcode = PARSEOP_STRING_LITERAL;
- Op->Common.AmlOpcode = AML_STRING_OP;
- Op->Asl.AmlLength = ACPI_STRLEN (ObjDesc->String.Pointer) + 1;
+ Op->Asl.ParseOpcode = PARSEOP_STRING_LITERAL;
+ Op->Common.AmlOpcode = AML_STRING_OP;
+ Op->Asl.AmlLength = ACPI_STRLEN (ObjDesc->String.Pointer) + 1;
Op->Common.Value.String = ObjDesc->String.Pointer;
DbgPrint (ASL_PARSE_OUTPUT,
@@ -438,18 +446,18 @@ OpcAmlConstantWalk (
case ACPI_TYPE_BUFFER:
- Op->Asl.ParseOpcode = PARSEOP_BUFFER;
- Op->Common.AmlOpcode = AML_BUFFER_OP;
- Op->Asl.CompileFlags = NODE_AML_PACKAGE;
+ Op->Asl.ParseOpcode = PARSEOP_BUFFER;
+ Op->Common.AmlOpcode = AML_BUFFER_OP;
+ Op->Asl.CompileFlags = NODE_AML_PACKAGE;
UtSetParseOpName (Op);
/* Child node is the buffer length */
RootOp = TrAllocateNode (PARSEOP_INTEGER);
- RootOp->Asl.AmlOpcode = AML_DWORD_OP;
+ RootOp->Asl.AmlOpcode = AML_DWORD_OP;
RootOp->Asl.Value.Integer = ObjDesc->Buffer.Length;
- RootOp->Asl.Parent = Op;
+ RootOp->Asl.Parent = Op;
(void) OpcSetOptimalIntegerSize (RootOp);
@@ -460,10 +468,10 @@ OpcAmlConstantWalk (
/* Peer to the child is the raw buffer data */
RootOp = TrAllocateNode (PARSEOP_RAW_DATA);
- RootOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
- RootOp->Asl.AmlLength = ObjDesc->Buffer.Length;
- RootOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer;
- RootOp->Asl.Parent = Op->Asl.Parent;
+ RootOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
+ RootOp->Asl.AmlLength = ObjDesc->Buffer.Length;
+ RootOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer;
+ RootOp->Asl.Parent = Op->Asl.Parent;
Op->Asl.Next = RootOp;
Op = RootOp;
@@ -476,7 +484,7 @@ OpcAmlConstantWalk (
default:
printf ("Unsupported return type: %s\n",
- AcpiUtGetObjectTypeName (ObjDesc));
+ AcpiUtGetObjectTypeName (ObjDesc));
break;
}
}
@@ -485,7 +493,62 @@ OpcAmlConstantWalk (
Op->Asl.Child = NULL;
AcpiDsDeleteWalkState (WalkState);
-
return (AE_CTRL_DEPTH);
}
+
+/*******************************************************************************
+ *
+ * FUNCTION: OpcUpdateIntegerNode
+ *
+ * PARAMETERS: Op - Current parse object
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Update node to the correct integer type.
+ *
+ ******************************************************************************/
+
+static void
+OpcUpdateIntegerNode (
+ ACPI_PARSE_OBJECT *Op,
+ UINT64 Value)
+{
+
+ Op->Common.Value.Integer = Value;
+
+ /*
+ * The AmlLength is used by the parser to indicate a constant,
+ * (if non-zero). Length is either (1/2/4/8)
+ */
+ switch (Op->Asl.AmlLength)
+ {
+ case 1:
+ TrUpdateNode (PARSEOP_BYTECONST, Op);
+ Op->Asl.AmlOpcode = AML_RAW_DATA_BYTE;
+ break;
+
+ case 2:
+ TrUpdateNode (PARSEOP_WORDCONST, Op);
+ Op->Asl.AmlOpcode = AML_RAW_DATA_WORD;
+ break;
+
+ case 4:
+ TrUpdateNode (PARSEOP_DWORDCONST, Op);
+ Op->Asl.AmlOpcode = AML_RAW_DATA_DWORD;
+ break;
+
+ case 8:
+ TrUpdateNode (PARSEOP_QWORDCONST, Op);
+ Op->Asl.AmlOpcode = AML_RAW_DATA_QWORD;
+ break;
+
+ case 0:
+ default:
+ OpcSetOptimalIntegerSize (Op);
+ TrUpdateNode (PARSEOP_INTEGER, Op);
+ break;
+ }
+
+ Op->Asl.AmlLength = 0;
+}
diff --git a/source/compiler/aslmessages.h b/source/compiler/aslmessages.h
index 595e5f4..4c4e79a 100644
--- a/source/compiler/aslmessages.h
+++ b/source/compiler/aslmessages.h
@@ -197,6 +197,7 @@ typedef enum
ASL_MSG_UPPER_CASE,
ASL_MSG_VENDOR_LIST,
ASL_MSG_WRITE,
+ ASL_MSG_RANGE,
/* These messages are used by the Preprocessor only */
@@ -371,6 +372,7 @@ char *AslMessages [] = {
/* ASL_MSG_UPPER_CASE */ "Non-hex letters must be upper case",
/* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)",
/* ASL_MSG_WRITE */ "Could not write file",
+/* ASL_MSG_RANGE */ "Constant out of range",
/* Preprocessor */
diff --git a/source/compiler/asltree.c b/source/compiler/asltree.c
index dc6cb44..12223b6 100644
--- a/source/compiler/asltree.c
+++ b/source/compiler/asltree.c
@@ -68,9 +68,9 @@ TrGetNodeFlagName (
*
* PARAMETERS: None
*
- * RETURN: New parse node. Aborts on allocation failure
+ * RETURN: New parse node. Aborts on allocation failure
*
- * DESCRIPTION: Allocate a new parse node for the parse tree. Bypass the local
+ * DESCRIPTION: Allocate a new parse node for the parse tree. Bypass the local
* dynamic memory manager for performance reasons (This has a
* major impact on the speed of the compiler.)
*
@@ -98,7 +98,7 @@ TrGetNextNode (
*
* PARAMETERS: ParseOpcode - Opcode to be assigned to the node
*
- * RETURN: New parse node. Aborts on allocation failure
+ * RETURN: New parse node. Aborts on allocation failure
*
* DESCRIPTION: Allocate and initialize a new parse node for the parse tree
*
@@ -133,7 +133,7 @@ TrAllocateNode (
*
* RETURN: None
*
- * DESCRIPTION: "release" a node. In truth, nothing is done since the node
+ * DESCRIPTION: "release" a node. In truth, nothing is done since the node
* is part of a larger buffer
*
******************************************************************************/
@@ -156,9 +156,9 @@ TrReleaseNode (
*
* RETURN: The updated node
*
- * DESCRIPTION: Change the parse opcode assigned to a node. Usually used to
+ * DESCRIPTION: Change the parse opcode assigned to a node. Usually used to
* change an opcode to DEFAULT_ARG so that the node is ignored
- * during the code generation. Also used to set generic integers
+ * during the code generation. Also used to set generic integers
* to a specific size (8, 16, 32, or 64 bits)
*
******************************************************************************/
@@ -186,19 +186,21 @@ TrUpdateNode (
switch (ParseOpcode)
{
case PARSEOP_BYTECONST:
- Op->Asl.Value.Integer = 0xFF;
+ Op->Asl.Value.Integer = ACPI_UINT8_MAX;
break;
case PARSEOP_WORDCONST:
- Op->Asl.Value.Integer = 0xFFFF;
+ Op->Asl.Value.Integer = ACPI_UINT16_MAX;
break;
case PARSEOP_DWORDCONST:
- Op->Asl.Value.Integer = 0xFFFFFFFF;
+ Op->Asl.Value.Integer = ACPI_UINT32_MAX;
break;
+ /* Don't need to do the QWORD case */
+
default:
- /* Don't care about others, don't need to check QWORD */
+ /* Don't care about others */
break;
}
}
@@ -213,15 +215,18 @@ TrUpdateNode (
switch (ParseOpcode)
{
case PARSEOP_BYTECONST:
- Op = UtCheckIntegerRange (Op, 0x00, ACPI_UINT8_MAX);
+ UtCheckIntegerRange (Op, 0x00, ACPI_UINT8_MAX);
+ Op->Asl.Value.Integer &= ACPI_UINT8_MAX;
break;
case PARSEOP_WORDCONST:
- Op = UtCheckIntegerRange (Op, 0x00, ACPI_UINT16_MAX);
+ UtCheckIntegerRange (Op, 0x00, ACPI_UINT16_MAX);
+ Op->Asl.Value.Integer &= ACPI_UINT16_MAX;
break;
case PARSEOP_DWORDCONST:
- Op = UtCheckIntegerRange (Op, 0x00, ACPI_UINT32_MAX);
+ UtCheckIntegerRange (Op, 0x00, ACPI_UINT32_MAX);
+ Op->Asl.Value.Integer &= ACPI_UINT32_MAX;
break;
default:
@@ -315,7 +320,7 @@ TrGetNodeFlagName (
*
* RETURN: The updated parser op
*
- * DESCRIPTION: Set bits in the node flags word. Will not clear bits, only set
+ * DESCRIPTION: Set bits in the node flags word. Will not clear bits, only set
*
******************************************************************************/
@@ -335,8 +340,41 @@ TrSetNodeFlags (
}
Op->Asl.CompileFlags |= Flags;
+ return (Op);
+}
- return Op;
+
+/*******************************************************************************
+ *
+ * FUNCTION: TrSetNodeAmlLength
+ *
+ * PARAMETERS: Op - An existing parse node
+ * Length - AML Length
+ *
+ * RETURN: The updated parser op
+ *
+ * DESCRIPTION: Set the AML Length in a node. Used by the parser to indicate
+ * the presence of a node that must be reduced to a fixed length
+ * constant.
+ *
+ ******************************************************************************/
+
+ACPI_PARSE_OBJECT *
+TrSetNodeAmlLength (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 Length)
+{
+
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "\nSetNodeAmlLength: Op %p, %8.8X\n", Op, Length);
+
+ if (!Op)
+ {
+ return NULL;
+ }
+
+ Op->Asl.AmlLength = Length;
+ return (Op);
}
@@ -376,7 +414,7 @@ TrSetEndLineNumber (
*
* PARAMETERS: ParseOpcode - New opcode to be assigned to the node
*
- * RETURN: Pointer to the new node. Aborts on allocation failure
+ * RETURN: Pointer to the new node. Aborts on allocation failure
*
* DESCRIPTION: Create a simple leaf node (no children or peers, and no value
* assigned to the node)
@@ -406,7 +444,7 @@ TrCreateLeafNode (
*
* PARAMETERS: ParseOpcode - The constant opcode
*
- * RETURN: Pointer to the new node. Aborts on allocation failure
+ * RETURN: Pointer to the new node. Aborts on allocation failure
*
* DESCRIPTION: Create a leaf node (no children or peers) for one of the
* special constants - __LINE__, __FILE__, and __DATE__.
@@ -488,7 +526,7 @@ TrCreateConstantLeafNode (
* PARAMETERS: ParseOpcode - New opcode to be assigned to the node
* Value - Value to be assigned to the node
*
- * RETURN: Pointer to the new node. Aborts on allocation failure
+ * RETURN: Pointer to the new node. Aborts on allocation failure
*
* DESCRIPTION: Create a leaf node (no children or peers) with a value
* assigned to it
@@ -553,9 +591,9 @@ TrCreateValuedLeafNode (
* PARAMETERS: ParseOpcode - Opcode to be assigned to the node
* NumChildren - Number of children to follow
* ... - A list of child nodes to link to the new
- * node. NumChildren long.
+ * node. NumChildren long.
*
- * RETURN: Pointer to the new node. Aborts on allocation failure
+ * RETURN: Pointer to the new node. Aborts on allocation failure
*
* DESCRIPTION: Create a new parse node and link together a list of child
* nodes underneath the new node.
@@ -621,7 +659,7 @@ TrCreateNode (
/*
* If child is NULL, this means that an optional argument
- * was omitted. We must create a placeholder with a special
+ * was omitted. We must create a placeholder with a special
* opcode (DEFAULT_ARG) so that the code generator will know
* that it must emit the correct default for this argument
*/
@@ -675,7 +713,7 @@ TrCreateNode (
* PARAMETERS: Op - An existing parse node
* NumChildren - Number of children to follow
* ... - A list of child nodes to link to the new
- * node. NumChildren long.
+ * node. NumChildren long.
*
* RETURN: The updated (linked) node
*
@@ -745,7 +783,7 @@ TrLinkChildren (
/*
* If child is NULL, this means that an optional argument
- * was omitted. We must create a placeholder with a special
+ * was omitted. We must create a placeholder with a special
* opcode (DEFAULT_ARG) so that the code generator will know
* that it must emit the correct default for this argument
*/
@@ -800,7 +838,7 @@ TrLinkChildren (
*
* RETURN: Op1 or the non-null node.
*
- * DESCRIPTION: Link two nodes as peers. Handles cases where one peer is null.
+ * DESCRIPTION: Link two nodes as peers. Handles cases where one peer is null.
*
******************************************************************************/
diff --git a/source/compiler/aslutils.c b/source/compiler/aslutils.c
index 9cc109b..771ba09 100644
--- a/source/compiler/aslutils.c
+++ b/source/compiler/aslutils.c
@@ -105,34 +105,34 @@ UtAttachNameseg (
*
******************************************************************************/
+#define ACPI_TABLE_HELP_FORMAT "%8u) %s %s\n"
+
void
UtDisplaySupportedTables (
void)
{
ACPI_DMTABLE_DATA *TableData;
- UINT32 i = 6;
+ UINT32 i;
- 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);
+ printf ("\nACPI tables supported by iASL version %8.8X:\n"
+ " (Compiler, Disassembler, 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");
+ printf (" Special tables and AML tables:\n");
+ printf (ACPI_TABLE_HELP_FORMAT, 1, ACPI_RSDP_NAME, "Root System Description Pointer");
+ printf (ACPI_TABLE_HELP_FORMAT, 2, ACPI_SIG_FACS, "Firmware ACPI Control Structure");
+ printf (ACPI_TABLE_HELP_FORMAT, 3, ACPI_SIG_DSDT, "Differentiated System Description Table");
+ printf (ACPI_TABLE_HELP_FORMAT, 4, ACPI_SIG_SSDT, "Secondary System Description Table");
/* All data tables with common table header */
- for (TableData = AcpiDmTableData; TableData->Signature; TableData++)
+ printf ("\n Standard ACPI data tables:\n");
+ for (TableData = AcpiDmTableData, i = 5; TableData->Signature; TableData++, i++)
{
- printf ("%8u) %s %s\n", i, TableData->Signature, TableData->Name);
- i++;
+ printf (ACPI_TABLE_HELP_FORMAT, i, TableData->Signature, TableData->Name);
}
}
@@ -591,36 +591,23 @@ UtCheckIntegerRange (
UINT32 LowValue,
UINT32 HighValue)
{
- char *ParseError = NULL;
- char Buffer[64];
-
if (!Op)
{
return NULL;
}
- if (Op->Asl.Value.Integer < LowValue)
- {
- ParseError = "Value below valid range";
- Op->Asl.Value.Integer = LowValue;
- }
-
- if (Op->Asl.Value.Integer > HighValue)
+ if ((Op->Asl.Value.Integer < LowValue) ||
+ (Op->Asl.Value.Integer > HighValue))
{
- ParseError = "Value above valid range";
- Op->Asl.Value.Integer = HighValue;
- }
+ sprintf (MsgBuffer, "0x%X, allowable: 0x%X-0x%X",
+ (UINT32) Op->Asl.Value.Integer, LowValue, HighValue);
- if (ParseError)
- {
- sprintf (Buffer, "%s 0x%X-0x%X", ParseError, LowValue, HighValue);
- AslCompilererror (Buffer);
-
- return NULL;
+ AslError (ASL_ERROR, ASL_MSG_RANGE, Op, MsgBuffer);
+ return (NULL);
}
- return Op;
+ return (Op);
}
diff --git a/source/compiler/new_table.txt b/source/compiler/new_table.txt
new file mode 100755
index 0000000..1e48d38
--- /dev/null
+++ b/source/compiler/new_table.txt
@@ -0,0 +1,88 @@
+How to add a new ACPI table to ACPICA and the iASL compiler.
+------------------------------------------------------------
+
+There are four main tasks that are needed to provide support for a
+new ACPI table:
+ 1) Create a full definition of the table and any subtables
+ in the ACPICA headers.
+ 2) Add disassembler support for the new table
+ 3) Add iASL table compiler support for the new table
+ 4) Create a default template for the new table for iASL -T
+ option.
+
+Notes for each of these tasks provided below.
+
+
+1) Header Support
+-----------------
+
+New tables should be added to the appropriate header:
+ actbl2.h: Used for new tables that are not defined in the ACPI spec.
+ actbl3.h: Used for new tables that are defined in the ACPI spec.
+
+Use ACPI_TABLE_HEADER for the common ACPI table header.
+Subtables should be defined separately from the main table.
+Don't add placeholder fields for subtables and other multiple data items.
+ (Don't use xxxxx[1] for a field that can have multiple items.)
+ The disassembler and data table compiler depends on this.
+For tables not defined in the ACPI spec, add a comment to indicate where
+ the table came from.
+Use other table definitions for additional guidance.
+
+
+2) iASL Disassembler Support
+----------------------------
+
+Add definition of the table (and subtables) in common/dmtbinfo.c
+Add table access macro(s) of the form ACPI_xxxx_OFFSET
+Add ACPI_DMT_TERMINATOR at the end of every table/subtable definition
+
+Add externals for the table/subtable definitions in acdisasm.h
+Add an entry for the new table in the AcpiDmTableData in common/dmtable.c
+
+If there are no subtables, add the AcpiDmTableInfoXXXX name to the
+ AcpiDmTableData and it will automatically be disassembled.
+
+If there are subtables, a dump routine must be written:
+Add an AcpiDmDumpXXXX function to dmtbdump.c -- note, code for another
+ similar table can often be ported for the new table.
+Add an external for this function to acdisasm.h
+Add this function to the AcpiDmTableData entry for the new ACPI table
+
+Debug/Test: Either find an existing example of the new ACPI table, or
+ create one using the "generic ACPI table support" included in the
+ iASL data table compiler. Use the -G option to force a
+ generic compile. It is often best to create the table from scratch,
+ since this clearly exposes the dependencies (lengths, offsets, etc.)
+ that the Table Compiler support will need to generate.
+
+
+3) iASL Table Compiler Support
+------------------------------
+
+Simple tables do not require a compile routine. The definition of the
+ table in common/dmtbinfo.c (created in step 2 above) will suffice.
+
+Complex tables with subtables will require a compile routine with a name
+ of the form DtCompileXXXX.
+Add a DtCompileXXXX function to the dttable.c module.
+Add an external for this function in dtcompiler.h
+Add this function to the AcpiDmTableData entry for the new ACPI table
+ in common/dmtable.c
+
+
+4) Template Support (-T iASL option)
+------------------------------------
+
+Create an example of the new ACPI table. This example should create
+ multiple subtables (if supported), and multiple instances of any
+ variable length data.
+
+Compile the example file with the -sc option. This will create a C
+ array that contains the table contents.
+
+Add this array to the dttemplate.h file. Name the array TemplateXXXX.
+Add this array name to the AcpiDmTableData entry for the new ACPI table
+
+Debug/Test: Create the template file. Compile the file. Disassemble the file.
+ Compile the disassembly file.
OpenPOWER on IntegriCloud