Import ACPICA 20190816.
This commit is contained in:
parent
0ada71f05e
commit
e63852a753
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor-sys/acpica/dist/; revision=351127 svn path=/vendor-sys/acpica/20190816/; revision=351128; tag=vendor/acpica/20190816
66
changes.txt
66
changes.txt
@ -1,3 +1,69 @@
|
||||
----------------------------------------
|
||||
16 August 2019. Summary of changes for version 20190816:
|
||||
|
||||
This release is available at https://acpica.org/downloads
|
||||
|
||||
|
||||
1) ACPICA kernel-resident subsystem:
|
||||
|
||||
Modified the OwnerId mechanism to allow for more Owner Ids. The previous
|
||||
limit was 256 Ids, now it is 4096 Ids. This prevents OWNER_ID_LIMIT
|
||||
exceptions on machines with a large number of initialization threads,
|
||||
many CPU cores and nested initialization control methods.
|
||||
|
||||
Introduced acpi_dispatch_gpe() as a wrapper around AcpiEvDetectGpe() for
|
||||
checking if the given GPE (as represented by a GPE device handle and a
|
||||
GPE number) is currently active and dispatching it (if that's the case)
|
||||
outside of interrupt context.
|
||||
|
||||
Table load: exit the interpreter before initializing objects within the
|
||||
new table This prevents re-acquiring the interpreter lock when loading
|
||||
tables
|
||||
|
||||
Added the "Windows 2019" string to the _OSI support (version 1903). Jung-
|
||||
uk Kim
|
||||
|
||||
Macros: removed pointer math on a null pointer. Causes warnings on some
|
||||
compilers and/or tools. Changed ACPI_TO_POINTER to use ACPI_CAST_PTR
|
||||
instead of using arithmetic.
|
||||
|
||||
Fully deployed the ACPI_PRINTF_LIKE macro. This macro was not being used
|
||||
across all "printf-like" internal functions. Also, cleanup all calls to
|
||||
such functions (both in 32-bit mode and 64-bit mode) now that they are
|
||||
analyzed by the gcc compiler via ACPI_PRINTF_LIKE.
|
||||
|
||||
|
||||
2) iASL Compiler/Disassembler and ACPICA tools:
|
||||
|
||||
iASL: implemented a new data table compiler flex/bison front-end. This
|
||||
change is internal and is not intended to result in changes to the
|
||||
compiled code. This new compiler front-end can be invoked using the -tp
|
||||
option for now, until the old mechanism is removed.
|
||||
|
||||
ASLTS: Implemented a new data table compiler test suite. This test suite
|
||||
generates all table templates and compile/disassemble/re-compile/binary-
|
||||
compare each file.
|
||||
|
||||
iASL: return -1 if AML files were not generated due to compiler errors
|
||||
|
||||
iASL: added a warning on use of the now-legacy ASL Processor () keyword.
|
||||
|
||||
iASL: added an error on _UID object declaration that returns a String
|
||||
within a Processor () declaration. A _UID for a processor must be an
|
||||
Integer.
|
||||
|
||||
iASL: added a null terminator to name strings that consist only of
|
||||
multiple parent prefixes (^)
|
||||
|
||||
iASL: added support to compile both ASL and data table files in a single
|
||||
command.
|
||||
|
||||
Updated the tool generation project files that were recently migrated to
|
||||
MSVC 2017 to eliminate all new warnings. The new project files appear in
|
||||
the directory \acpica\generate\msvc2017. This change effectively
|
||||
deprecates the older project files in \acpica\generate\msvc9.
|
||||
|
||||
|
||||
----------------------------------------
|
||||
03 July 2019. Summary of changes for version 20190703:
|
||||
|
||||
|
@ -147,6 +147,14 @@ ACPICA_HEADERS = \
|
||||
#
|
||||
OPT_CFLAGS ?= $(CWARNINGFLAGS)
|
||||
|
||||
#
|
||||
# Debug flags
|
||||
#
|
||||
ifeq ($(DEBUG),TRUE)
|
||||
CFLAGS +=-g
|
||||
LDFLAGS +=-g
|
||||
endif
|
||||
|
||||
#
|
||||
# Common compiler flags
|
||||
# The _GNU_SOURCE symbol is required for many hosts.
|
||||
@ -272,3 +280,4 @@ MFLAGS= -P -I$(ASL_COMPILER)
|
||||
|
||||
LEX= flex
|
||||
LFLAGS += -i -s
|
||||
DLFLAGS += -i
|
||||
|
@ -33,12 +33,15 @@ vpath %.c \
|
||||
HEADERS = \
|
||||
$(wildcard $(ASL_COMPILER)/*.h)\
|
||||
$(OBJDIR)/aslcompiler.y.h\
|
||||
$(OBJDIR)/dtcompilerparser.y.h\
|
||||
$(OBJDIR)/dtparser.y.h\
|
||||
$(OBJDIR)/prparser.y.h
|
||||
|
||||
OBJECTS = \
|
||||
$(OBJDIR)/aslcompilerlex.o\
|
||||
$(OBJDIR)/aslcompilerparse.o\
|
||||
$(OBJDIR)/dtcompilerparserlex.o\
|
||||
$(OBJDIR)/dtcompilerparserparse.o\
|
||||
$(OBJDIR)/dtparserlex.o\
|
||||
$(OBJDIR)/dtparserparse.o\
|
||||
$(OBJDIR)/prparserlex.o\
|
||||
@ -251,11 +254,14 @@ INTERMEDIATES = \
|
||||
$(OBJDIR)/aslcompilerparse.c\
|
||||
$(OBJDIR)/dtparserlex.c\
|
||||
$(OBJDIR)/dtparserparse.c\
|
||||
$(OBJDIR)/dtcompilerparserlex.c\
|
||||
$(OBJDIR)/dtcompilerparserparse.c\
|
||||
$(OBJDIR)/prparserlex.c\
|
||||
$(OBJDIR)/prparserparse.c
|
||||
|
||||
MISC = \
|
||||
$(OBJDIR)/aslcompiler.y.h\
|
||||
$(OBJDIR)/dtcompilerparser.y.h\
|
||||
$(OBJDIR)/dtparser.y.h\
|
||||
$(OBJDIR)/prparser.y.h
|
||||
|
||||
@ -322,9 +328,17 @@ $(OBJDIR)/aslcompilerparse.c $(OBJDIR)/aslcompiler.y.h : $(OBJDIR)/aslcompiler.y
|
||||
@echo "- " $(YACC) " "$<
|
||||
@$(call safe_yacc,AslCompiler,$<,$@)
|
||||
|
||||
$(OBJDIR)/dtcompilerparserlex.c : $(ASL_COMPILER)/dtcompilerparser.l $(OBJDIR)/dtcompilerparser.y.h
|
||||
@echo "- " $(LEX) " "$<
|
||||
@$(LEX) $(DLFLAGS) -PDtCompilerParser -o$@ $<
|
||||
|
||||
$(OBJDIR)/dtcompilerparserparse.c $(OBJDIR)/dtcompilerparser.y.h : $(ASL_COMPILER)/dtcompilerparser.y
|
||||
@echo "- " $(YACC) " "$<
|
||||
@$(call safe_yacc,DtCompilerParser,$<,$@)
|
||||
|
||||
$(OBJDIR)/dtparserlex.c : $(ASL_COMPILER)/dtparser.l $(OBJDIR)/dtparser.y.h
|
||||
@echo "- " $(LEX) " "$<
|
||||
@$(LEX) $(LFLAGS) -PDtParser -o$@ $<
|
||||
@$(LEX) $(DLFLAGS) -PDtParser -o$@ $<
|
||||
|
||||
$(OBJDIR)/dtparserparse.c $(OBJDIR)/dtparser.y.h : $(ASL_COMPILER)/dtparser.y
|
||||
@echo "- " $(YACC) " "$<
|
||||
@ -352,6 +366,14 @@ $(OBJDIR)/aslcompilerparse.o : $(OBJDIR)/aslcompilerparse.c
|
||||
@echo "- " "Intermediate" $<
|
||||
@$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
|
||||
|
||||
$(OBJDIR)/dtcompilerparserlex.o : $(OBJDIR)/dtcompilerparserlex.c
|
||||
@echo "- " "Intermediate" $<
|
||||
@$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
|
||||
|
||||
$(OBJDIR)/dtcompilerparserparse.o : $(OBJDIR)/dtcompilerparserparse.c
|
||||
@echo "- " "Intermediate" $<
|
||||
@$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
|
||||
|
||||
$(OBJDIR)/dtparserlex.o : $(OBJDIR)/dtparserlex.c
|
||||
@echo "- " "Intermediate" $<
|
||||
@$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
|
||||
|
@ -480,6 +480,7 @@ AcpiDmDumpDescending (
|
||||
{
|
||||
ACPI_OP_WALK_INFO *Info = Context;
|
||||
char *Path;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
if (!Op)
|
||||
@ -522,12 +523,20 @@ AcpiDmDumpDescending (
|
||||
|
||||
if (Op->Common.Value.String)
|
||||
{
|
||||
AcpiNsExternalizeName (ACPI_UINT32_MAX, Op->Common.Value.String,
|
||||
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Op->Common.Value.String,
|
||||
NULL, &Path);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
AcpiOsPrintf ("%s %p", Path, Op->Common.Node);
|
||||
ACPI_FREE (Path);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("Could not externalize pathname for node [%4.4s]",
|
||||
Op->Common.Node->Name.Ascii);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("[NULL]");
|
||||
}
|
||||
@ -830,9 +839,9 @@ AcpiDmLoadDescendingOp (
|
||||
* 2) Not the root node
|
||||
* 3) Not a node created by Scope
|
||||
*/
|
||||
|
||||
if (!PreDefined && Node != AcpiGbl_RootNode &&
|
||||
Op->Common.AmlOpcode != AML_SCOPE_OP)
|
||||
if (!PreDefined &&
|
||||
(Node != AcpiGbl_RootNode) &&
|
||||
(Op->Common.AmlOpcode != AML_SCOPE_OP))
|
||||
{
|
||||
Node->OwnerId = WalkState->OwnerId;
|
||||
}
|
||||
|
@ -833,8 +833,12 @@ AcpiGetTagPathname (
|
||||
|
||||
/* Internalize the namepath to AML format */
|
||||
|
||||
AcpiNsInternalizeName (Pathname, &InternalPath);
|
||||
Status = AcpiNsInternalizeName (Pathname, &InternalPath);
|
||||
ACPI_FREE (Pathname);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Update the Op with the symbol */
|
||||
|
||||
|
@ -443,8 +443,8 @@ AdGetLocalTables (
|
||||
/* Get the DSDT via table override */
|
||||
|
||||
ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_DSDT);
|
||||
AcpiOsTableOverride (&TableHeader, &NewTable);
|
||||
if (!NewTable)
|
||||
Status = AcpiOsTableOverride (&TableHeader, &NewTable);
|
||||
if (ACPI_FAILURE (Status) || !NewTable)
|
||||
{
|
||||
fprintf (stderr, "Could not obtain DSDT\n");
|
||||
return (AE_NO_ACPI_TABLES);
|
||||
|
@ -871,7 +871,7 @@ AcpiDmDumpMcfg (
|
||||
if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length)
|
||||
{
|
||||
AcpiOsPrintf ("Warning: there are %u invalid trailing bytes\n",
|
||||
sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length));
|
||||
(UINT32) sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -421,7 +421,7 @@ UtDeleteLocalCaches (
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"%u ParseOps, Buffer size: %u ops (%u bytes), %u Buffers\n",
|
||||
AslGbl_ParseOpCount, ASL_PARSEOP_CACHE_SIZE,
|
||||
(sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE), BufferCount);
|
||||
((UINT32) sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE), BufferCount);
|
||||
|
||||
/* Reset cache globals */
|
||||
|
||||
@ -445,7 +445,7 @@ UtDeleteLocalCaches (
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"%u Fields, Buffer size: %u fields (%u bytes), %u Buffers\n",
|
||||
AslGbl_FieldCount, ASL_FIELD_CACHE_SIZE,
|
||||
(sizeof (DT_FIELD) * ASL_FIELD_CACHE_SIZE), BufferCount);
|
||||
((UINT32) sizeof (DT_FIELD) * ASL_FIELD_CACHE_SIZE), BufferCount);
|
||||
|
||||
/* Reset cache globals */
|
||||
|
||||
@ -468,7 +468,7 @@ UtDeleteLocalCaches (
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"%u Subtables, Buffer size: %u subtables (%u bytes), %u Buffers\n",
|
||||
AslGbl_SubtableCount, ASL_SUBTABLE_CACHE_SIZE,
|
||||
(sizeof (DT_SUBTABLE) * ASL_SUBTABLE_CACHE_SIZE), BufferCount);
|
||||
((UINT32) sizeof (DT_SUBTABLE) * ASL_SUBTABLE_CACHE_SIZE), BufferCount);
|
||||
|
||||
/* Reset cache globals */
|
||||
|
||||
|
@ -618,8 +618,8 @@ CgWriteTableHeader (
|
||||
Op->Asl.AmlSubtreeLength +=
|
||||
strlen (AslGbl_ParseTreeRoot->Asl.Filename) + 3;
|
||||
|
||||
CvDbgPrint (" Length: %lu\n",
|
||||
strlen (AslGbl_ParseTreeRoot->Asl.Filename) + 3);
|
||||
CvDbgPrint (" Length: %u\n",
|
||||
(UINT32) strlen (AslGbl_ParseTreeRoot->Asl.Filename) + 3);
|
||||
|
||||
if (Op->Asl.CommentList)
|
||||
{
|
||||
|
@ -853,10 +853,11 @@ CmDumpAllEvents (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
int
|
||||
CmCleanupAndExit (
|
||||
void)
|
||||
{
|
||||
int Status = 0;
|
||||
BOOLEAN DeleteAmlFile = FALSE;
|
||||
ASL_GLOBAL_FILE_NODE *CurrentFileNode = AslGbl_FilesList;
|
||||
|
||||
@ -915,20 +916,38 @@ CmCleanupAndExit (
|
||||
UtDisplaySummary (ASL_FILE_STDOUT);
|
||||
|
||||
/*
|
||||
* We will delete the AML file if there are errors and the
|
||||
* force AML output option has not been used.
|
||||
* Delete the AML file if there are errors and the force AML output option
|
||||
* (-f) has not been used.
|
||||
*
|
||||
* Return -1 as a status of the compiler if no AML files are generated. If
|
||||
* the AML file is generated in the presence of errors, return 0. In the
|
||||
* latter case, the errors were ignored by the user so the compilation is
|
||||
* considered successful.
|
||||
*/
|
||||
if (AslGbl_ParserErrorDetected || AslGbl_PreprocessOnly || ((AslGbl_ExceptionCount[ASL_ERROR] > 0) &&
|
||||
if (AslGbl_ParserErrorDetected || AslGbl_PreprocessOnly ||
|
||||
((AslGbl_ExceptionCount[ASL_ERROR] > 0) &&
|
||||
(!AslGbl_IgnoreErrors) &&
|
||||
AslGbl_Files[ASL_FILE_AML_OUTPUT].Handle))
|
||||
{
|
||||
DeleteAmlFile = TRUE;
|
||||
Status = -1;
|
||||
}
|
||||
|
||||
/* Close all open files */
|
||||
|
||||
while (CurrentFileNode)
|
||||
{
|
||||
/*
|
||||
* Set the program return status based on file errors. If there are any
|
||||
* errors and during compilation, the command is not considered
|
||||
* successful.
|
||||
*/
|
||||
if (Status != -1 && !AslGbl_IgnoreErrors &&
|
||||
CurrentFileNode->ParserErrorDetected)
|
||||
{
|
||||
Status = -1;
|
||||
}
|
||||
|
||||
switch (FlSwitchFileSet (CurrentFileNode->Files[ASL_FILE_INPUT].Filename))
|
||||
{
|
||||
case SWITCH_TO_SAME_FILE:
|
||||
@ -952,6 +971,8 @@ CmCleanupAndExit (
|
||||
{
|
||||
UtDeleteLocalCaches ();
|
||||
}
|
||||
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
|
@ -266,7 +266,7 @@ void
|
||||
CmDoOutputFiles (
|
||||
void);
|
||||
|
||||
void
|
||||
int
|
||||
CmCleanupAndExit (
|
||||
void);
|
||||
|
||||
@ -1052,6 +1052,7 @@ void
|
||||
FlCloseFile (
|
||||
UINT32 FileId);
|
||||
|
||||
ACPI_PRINTF_LIKE (2)
|
||||
void
|
||||
FlPrintFile (
|
||||
UINT32 FileId,
|
||||
@ -1195,6 +1196,7 @@ OtXrefWalkPart1 (
|
||||
/*
|
||||
* aslutils - common compiler utilities
|
||||
*/
|
||||
ACPI_PRINTF_LIKE(2)
|
||||
void
|
||||
DbgPrint (
|
||||
UINT32 Type,
|
||||
@ -1288,6 +1290,10 @@ UtInternalizeName (
|
||||
char *ExternalName,
|
||||
char **ConvertedName);
|
||||
|
||||
BOOLEAN
|
||||
UtNameContainsAllPrefix (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
UtAttachNamepathToOwner (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
@ -1303,6 +1309,15 @@ UINT64
|
||||
UtDoConstant (
|
||||
char *String);
|
||||
|
||||
char *
|
||||
AcpiUtStrdup (
|
||||
char *String);
|
||||
|
||||
char *
|
||||
AcpiUtStrcat (
|
||||
char *String1,
|
||||
char *String2);
|
||||
|
||||
|
||||
/*
|
||||
* asluuid - UUID support
|
||||
@ -1604,6 +1619,7 @@ DtCreateTemplates (
|
||||
/*
|
||||
* ASL/ASL+ converter debug
|
||||
*/
|
||||
ACPI_PRINTF_LIKE (1)
|
||||
void
|
||||
CvDbgPrint (
|
||||
char *Fmt,
|
||||
|
4921
source/compiler/aslcompiler.y
Normal file
4921
source/compiler/aslcompiler.y
Normal file
File diff suppressed because it is too large
Load Diff
@ -239,7 +239,7 @@ UtDumpIntegerOp (
|
||||
case 8: /* Dword */
|
||||
|
||||
DbgPrint (ASL_TREE_OUTPUT,
|
||||
"%*.*X", IntegerLength, IntegerLength, Op->Asl.Value.Integer);
|
||||
"%*.*X", IntegerLength, IntegerLength, (UINT32) Op->Asl.Value.Integer);
|
||||
break;
|
||||
|
||||
case 16: /* Qword and Integer */
|
||||
|
@ -290,7 +290,7 @@
|
||||
|
||||
#define ASL_PARSE_TREE_DEBUG2 \
|
||||
" %08X %04X %04X %01X %04X %04X %05X %05X "\
|
||||
"%08X %08X %08X %08X %08X %08X %04X %02d %5d %5d %5d %5d"
|
||||
"%8p %8p %8p %8p %08X %08X %04X %02d %5d %5d %5d %5d"
|
||||
|
||||
/*
|
||||
* Macros for ASL/ASL+ converter
|
||||
|
@ -244,7 +244,6 @@ extern const char *AslGbl_SpecialNamedObjects[MAX_SPECIAL_NAME
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Parser and other externals
|
||||
*/
|
||||
@ -254,6 +253,7 @@ extern int DtParserdebug;
|
||||
extern int PrParserdebug;
|
||||
extern const ASL_MAPPING_ENTRY AslKeywordMapping[];
|
||||
extern char *AslCompilertext;
|
||||
extern char *DtCompilerParsertext;
|
||||
|
||||
/*
|
||||
* Older versions of Bison won't emit this external in the generated header.
|
||||
|
@ -247,6 +247,7 @@ Usage (
|
||||
ACPI_OPTION ("", " (Original comments are passed through to ASL+ file)");
|
||||
|
||||
printf ("\nData Table Compiler:\n");
|
||||
ACPI_OPTION ("-tp", "Compile tables with flex/bison prototype");
|
||||
ACPI_OPTION ("-G", "Compile custom table that contains generic operators");
|
||||
ACPI_OPTION ("-T <sig list>|ALL", "Create ACPI table template/example files");
|
||||
ACPI_OPTION ("-T <count>", "Emit DSDT and <count> SSDTs to same file");
|
||||
|
@ -479,12 +479,13 @@ CgGenerateAmlLengths (
|
||||
Op->Asl.AmlLength = strlen (Buffer);
|
||||
|
||||
/*
|
||||
* Check for single backslash reference to root,
|
||||
* make it a null terminated string in the AML
|
||||
* Check for single backslash reference to root or reference to a name
|
||||
* consisting of only prefix (^) characters. Make it a null terminated
|
||||
* string in the AML.
|
||||
*/
|
||||
if (Op->Asl.AmlLength == 1)
|
||||
if (Op->Asl.AmlLength == 1 || UtNameContainsAllPrefix(Op))
|
||||
{
|
||||
Op->Asl.AmlLength = 2;
|
||||
Op->Asl.AmlLength++;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -241,7 +241,7 @@ LsDumpAsciiInComment (
|
||||
{
|
||||
/* Insert a space to break the sequence */
|
||||
|
||||
FlPrintFile (FileId, ".", BufChar);
|
||||
FlPrintFile (FileId, " ");
|
||||
}
|
||||
|
||||
FlPrintFile (FileId, "%c", BufChar);
|
||||
|
@ -275,7 +275,6 @@ LdLoadFieldElements (
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
|
||||
SourceRegion = UtGetArg (Op, 0);
|
||||
if (SourceRegion)
|
||||
{
|
||||
@ -1031,7 +1030,8 @@ LdNamespace1Begin (
|
||||
* DESCRIPTION: Check if certain named objects are declared in the incorrect
|
||||
* scope. Special named objects are listed in
|
||||
* AslGbl_SpecialNamedObjects and can only be declared at the root
|
||||
* scope.
|
||||
* scope. _UID inside of a processor declaration must not be a
|
||||
* string.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -1052,6 +1052,13 @@ LdCheckSpecialNames (
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (ACPI_COMPARE_NAMESEG (Node->Name.Ascii, "_UID") &&
|
||||
Node->Parent->Type == ACPI_TYPE_PROCESSOR &&
|
||||
Node->Type == ACPI_TYPE_STRING)
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_INVALID_PROCESSOR_UID , Op, "found a string");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -282,7 +282,6 @@ main (
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ReturnStatus = -1;
|
||||
goto CleanupAndExit;
|
||||
}
|
||||
|
||||
Index2++;
|
||||
@ -290,9 +289,10 @@ main (
|
||||
|
||||
/*
|
||||
* At this point, compilation of a data table or disassembly is complete.
|
||||
* However, if there is a parse tree, perform compiler analysis and
|
||||
* generate AML.
|
||||
*/
|
||||
if (AslGbl_PreprocessOnly || AcpiGbl_DisasmFlag ||
|
||||
AslGbl_FileType == ASL_INPUT_TYPE_ASCII_DATA)
|
||||
if (AslGbl_PreprocessOnly || AcpiGbl_DisasmFlag || !AslGbl_ParseTreeRoot)
|
||||
{
|
||||
goto CleanupAndExit;
|
||||
}
|
||||
@ -338,7 +338,6 @@ main (
|
||||
}
|
||||
|
||||
|
||||
|
||||
CleanupAndExit:
|
||||
|
||||
UtFreeLineBuffers ();
|
||||
@ -350,7 +349,7 @@ main (
|
||||
|
||||
if (!AcpiGbl_DisasmFlag)
|
||||
{
|
||||
CmCleanupAndExit ();
|
||||
ReturnStatus = CmCleanupAndExit ();
|
||||
}
|
||||
|
||||
|
||||
@ -400,6 +399,8 @@ AslSignalHandler (
|
||||
* Close all open files
|
||||
* Note: the .pre file is the same as the input source file
|
||||
*/
|
||||
if (AslGbl_Files)
|
||||
{
|
||||
AslGbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL;
|
||||
|
||||
for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++)
|
||||
@ -413,6 +414,7 @@ AslSignalHandler (
|
||||
{
|
||||
FlDeleteFile (i);
|
||||
}
|
||||
}
|
||||
|
||||
printf (ASL_PREFIX "Terminating\n");
|
||||
exit (0);
|
||||
|
@ -366,7 +366,9 @@ const char *AslCompilerMsgs [] =
|
||||
/* ASL_MSG_TEMPORARY_OBJECT */ "Object is created temporarily in another method and cannot be accessed",
|
||||
/* ASL_MSG_UNDEFINED_EXTERNAL */ "Named object was declared external but the actual definition does not exist",
|
||||
/* ASL_MSG_BUFFER_FIELD_OVERFLOW */ "Buffer field extends beyond end of target buffer",
|
||||
/* ASL_MSG_INVALID_SPECIAL_NAME */ "declaration of this named object outside root scope is illegal"
|
||||
/* ASL_MSG_INVALID_SPECIAL_NAME */ "declaration of this named object outside root scope is illegal",
|
||||
/* ASL_MSG_INVALID_PROCESSOR_UID */ "_UID inside processor declaration must be an integer",
|
||||
/* ASL_MSG_LEGACY_PROCESSOR_OP */ "Legacy Processor() keyword detected. Use Device() keyword instead."
|
||||
};
|
||||
|
||||
/* Table compiler */
|
||||
|
@ -369,6 +369,8 @@ typedef enum
|
||||
ASL_MSG_UNDEFINED_EXTERNAL,
|
||||
ASL_MSG_BUFFER_FIELD_OVERFLOW,
|
||||
ASL_MSG_INVALID_SPECIAL_NAME,
|
||||
ASL_MSG_INVALID_PROCESSOR_UID,
|
||||
ASL_MSG_LEGACY_PROCESSOR_OP,
|
||||
|
||||
/* These messages are used by the Data Table compiler only */
|
||||
|
||||
|
@ -276,7 +276,7 @@ NsDoOneNamespaceObject (
|
||||
|
||||
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%5u [%u] %*s %4.4s - %s",
|
||||
AslGbl_NumNamespaceObjects, Level, (Level * 3), " ",
|
||||
&Node->Name, AcpiUtGetTypeName (Node->Type));
|
||||
&Node->Name.Ascii[0], AcpiUtGetTypeName (Node->Type));
|
||||
|
||||
Op = Node->Op;
|
||||
ObjDesc = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Node->Object);
|
||||
@ -429,7 +429,7 @@ NsDoOneNamespaceObject (
|
||||
{
|
||||
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
|
||||
" [Initial Length 0x%.2X elements]",
|
||||
Op->Asl.Value.Integer);
|
||||
(UINT32) Op->Asl.Value.Integer);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -452,7 +452,7 @@ NsDoOneNamespaceObject (
|
||||
{
|
||||
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
|
||||
" [Initial Length 0x%.2X bytes]",
|
||||
Op->Asl.Value.Integer);
|
||||
(UINT32) Op->Asl.Value.Integer);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -531,7 +531,8 @@ NsDoOnePathname (
|
||||
return (Status);
|
||||
}
|
||||
|
||||
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%s\n", TargetPath.Pointer);
|
||||
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%s\n",
|
||||
ACPI_CAST_PTR (char, TargetPath.Pointer));
|
||||
ACPI_FREE (TargetPath.Pointer);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
@ -837,6 +837,11 @@ AslDoOptions (
|
||||
AslGbl_HexOutputFlag = HEX_OUTPUT_C;
|
||||
break;
|
||||
|
||||
case 'p': /* data table flex/bison prototype */
|
||||
|
||||
AslGbl_DtLexBisonPrototype = TRUE;
|
||||
break;
|
||||
|
||||
case 's':
|
||||
|
||||
AslGbl_HexOutputFlag = HEX_OUTPUT_ASL;
|
||||
|
@ -403,22 +403,22 @@ TrCreateValuedLeafOp (
|
||||
{
|
||||
case PARSEOP_STRING_LITERAL:
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "STRING->%s", Value);
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "STRING->%s", Op->Asl.Value.String);
|
||||
break;
|
||||
|
||||
case PARSEOP_NAMESEG:
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "NAMESEG->%s", Value);
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "NAMESEG->%s", Op->Asl.Value.String);
|
||||
break;
|
||||
|
||||
case PARSEOP_NAMESTRING:
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "NAMESTRING->%s", Value);
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "NAMESTRING->%s", Op->Asl.Value.String);
|
||||
break;
|
||||
|
||||
case PARSEOP_EISAID:
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "EISAID->%s", Value);
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "EISAID->%s", Op->Asl.Value.String);
|
||||
break;
|
||||
|
||||
case PARSEOP_METHOD:
|
||||
@ -693,7 +693,8 @@ TrCreateConstantLeafOp (
|
||||
time_t CurrentTime;
|
||||
char *StaticTimeString;
|
||||
char *TimeString;
|
||||
char *Filename;
|
||||
char *Filename = NULL;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
switch (ParseOpcode)
|
||||
@ -727,7 +728,12 @@ TrCreateConstantLeafOp (
|
||||
|
||||
/* Get the simple filename from the full path */
|
||||
|
||||
FlSplitInputPathname (Op->Asl.Filename, NULL, &Filename);
|
||||
Status = FlSplitInputPathname (Op->Asl.Filename, NULL, &Filename);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
Op->Asl.Value.String = Filename;
|
||||
break;
|
||||
|
||||
|
@ -467,6 +467,7 @@ AslDoOneFile (
|
||||
/* Determine input file type */
|
||||
|
||||
AslGbl_FileType = AslDetectSourceFileType (&AslGbl_Files[ASL_FILE_INPUT]);
|
||||
FileNode->FileType = AslGbl_FileType;
|
||||
if (AslGbl_FileType == ASL_INPUT_TYPE_BINARY)
|
||||
{
|
||||
return (AE_ERROR);
|
||||
|
@ -507,6 +507,12 @@ TrTransformSubtree (
|
||||
}
|
||||
break;
|
||||
|
||||
case PARSEOP_PROCESSOR:
|
||||
|
||||
AslError (ASL_WARNING, ASL_MSG_LEGACY_PROCESSOR_OP, Op, Op->Asl.ExternalName);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Nothing to do here for other opcodes */
|
||||
|
@ -505,9 +505,12 @@ typedef struct asl_files_node
|
||||
UINT32 TotalLineCount;
|
||||
UINT32 OriginalInputFileSize;
|
||||
UINT32 TotalKeywords;
|
||||
UINT32 TotalFields;
|
||||
UINT32 OutputByteLength;
|
||||
UINT32 TotalNamedObjects;
|
||||
UINT32 TotalExecutableOpcodes;
|
||||
BOOLEAN ParserErrorDetected;
|
||||
UINT8 FileType;
|
||||
|
||||
} ASL_GLOBAL_FILE_NODE;
|
||||
|
||||
|
@ -223,6 +223,7 @@ UtQueryForOverwrite (
|
||||
char *Pathname)
|
||||
{
|
||||
struct stat StatInfo;
|
||||
int InChar = 0x34;
|
||||
|
||||
|
||||
if (!stat (Pathname, &StatInfo))
|
||||
@ -230,7 +231,13 @@ UtQueryForOverwrite (
|
||||
fprintf (stderr, "Target file \"%s\" already exists, overwrite? [y|n] ",
|
||||
Pathname);
|
||||
|
||||
if (getchar () != 'y')
|
||||
InChar = fgetc (stdin);
|
||||
if (InChar == '\n')
|
||||
{
|
||||
InChar = fgetc (stdin);
|
||||
}
|
||||
|
||||
if ((InChar != 'y') && (InChar != 'Y'))
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
@ -559,37 +566,34 @@ UtDisplayOneSummary (
|
||||
|
||||
/* Summary of main input and output files */
|
||||
|
||||
if (AslGbl_FileType == ASL_INPUT_TYPE_ASCII_DATA)
|
||||
{
|
||||
FlPrintFile (FileId,
|
||||
"%-14s %s - %u lines, %u bytes, %u fields\n",
|
||||
"Table Input:",
|
||||
AslGbl_Files[ASL_FILE_INPUT].Filename, AslGbl_CurrentLineNumber,
|
||||
AslGbl_InputByteCount, AslGbl_InputFieldCount);
|
||||
|
||||
if ((AslGbl_ExceptionCount[ASL_ERROR] == 0) || (AslGbl_IgnoreErrors))
|
||||
{
|
||||
FlPrintFile (FileId,
|
||||
"%-14s %s - %u bytes\n",
|
||||
"Binary Output:",
|
||||
AslGbl_Files[ASL_FILE_AML_OUTPUT].Filename, AslGbl_TableLength);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FileNode = FlGetCurrentFileNode ();
|
||||
if (!FileNode)
|
||||
{
|
||||
fprintf (stderr, "Summary could not be generated");
|
||||
return;
|
||||
}
|
||||
|
||||
if (FileNode->ParserErrorDetected)
|
||||
{
|
||||
FlPrintFile (FileId,
|
||||
"%-14s %s - Compilation aborted due to parser-detected syntax error(s)\n",
|
||||
"ASL Input:", AslGbl_Files[ASL_FILE_INPUT].Filename);
|
||||
"Input file:", AslGbl_Files[ASL_FILE_INPUT].Filename);
|
||||
}
|
||||
else
|
||||
else if (FileNode->FileType == ASL_INPUT_TYPE_ASCII_DATA)
|
||||
{
|
||||
FlPrintFile (FileId,
|
||||
"%-14s %s - %7u bytes %6u fields %8u source lines\n",
|
||||
"Table Input:",
|
||||
AslGbl_Files[ASL_FILE_INPUT].Filename,
|
||||
FileNode->OriginalInputFileSize, FileNode->TotalFields,
|
||||
FileNode->TotalLineCount);
|
||||
|
||||
FlPrintFile (FileId,
|
||||
"%-14s %s - %7u bytes\n",
|
||||
"Binary Output:",
|
||||
AslGbl_Files[ASL_FILE_AML_OUTPUT].Filename, FileNode->OutputByteLength);
|
||||
}
|
||||
else if (FileNode->FileType == ASL_INPUT_TYPE_ASCII_ASL)
|
||||
{
|
||||
FlPrintFile (FileId,
|
||||
"%-14s %s - %7u bytes %6u keywords %6u source lines\n",
|
||||
@ -612,7 +616,6 @@ UtDisplayOneSummary (
|
||||
FileNode->TotalNamedObjects);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Display summary of any optional files */
|
||||
|
||||
@ -992,6 +995,37 @@ UtAttachNamepathToOwner (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: UtNameContainsAllPrefix
|
||||
*
|
||||
* PARAMETERS: Op - Op containing NameString
|
||||
*
|
||||
* RETURN: NameString consists of all ^ characters
|
||||
*
|
||||
* DESCRIPTION: Determine if this Op contains a name segment that consists of
|
||||
* all '^' characters.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
BOOLEAN
|
||||
UtNameContainsAllPrefix (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
UINT32 Length = Op->Asl.AmlLength;
|
||||
UINT32 i;
|
||||
|
||||
for (i = 0; i < Length; i++)
|
||||
{
|
||||
if (Op->Asl.Value.String[i] != '^')
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: UtDoConstant
|
||||
@ -1026,3 +1060,56 @@ UtDoConstant (
|
||||
|
||||
return (ConvertedInteger);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtStrdup
|
||||
*
|
||||
* PARAMETERS: String1 - string to duplicate
|
||||
*
|
||||
* RETURN: int that signifies string relationship. Zero means strings
|
||||
* are equal.
|
||||
*
|
||||
* DESCRIPTION: Duplicate the string using UtCacheAlloc to avoid manual memory
|
||||
* reclamation.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
char *
|
||||
AcpiUtStrdup (
|
||||
char *String)
|
||||
{
|
||||
char *NewString = (char *) UtLocalCalloc (strlen (String) + 1);
|
||||
|
||||
|
||||
strcpy (NewString, String);
|
||||
return (NewString);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtStrcat
|
||||
*
|
||||
* PARAMETERS: String1
|
||||
* String2
|
||||
*
|
||||
* RETURN: New string with String1 concatenated with String2
|
||||
*
|
||||
* DESCRIPTION: Concatenate string1 and string2
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
char *
|
||||
AcpiUtStrcat (
|
||||
char *String1,
|
||||
char *String2)
|
||||
{
|
||||
UINT32 String1Length = strlen (String1);
|
||||
char *NewString = (char *) UtLocalCalloc (strlen (String1) + strlen (String2) + 1);
|
||||
|
||||
strcpy (NewString, String1);
|
||||
strcpy (NewString + String1Length, String2);
|
||||
return (NewString);
|
||||
}
|
||||
|
@ -799,7 +799,7 @@ OtXrefWalkPart3 (
|
||||
else
|
||||
{
|
||||
FlPrintFile (ASL_FILE_XREF_OUTPUT,
|
||||
" %u references to this object in this module\n",
|
||||
" %u references to this object in this module [%s]\n",
|
||||
XrefInfo->ThisObjectReferences, ParentPath);
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ static char VersionString[9];
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
void
|
||||
DtInitialize (
|
||||
void);
|
||||
|
||||
@ -196,16 +196,12 @@ DtDoCompile (
|
||||
ACPI_STATUS Status;
|
||||
UINT8 Event;
|
||||
DT_FIELD *FieldList;
|
||||
ASL_GLOBAL_FILE_NODE *FileNode;
|
||||
|
||||
|
||||
/* Initialize globals */
|
||||
|
||||
Status = DtInitialize ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
printf ("Error during compiler initialization, 0x%X\n", Status);
|
||||
return (Status);
|
||||
}
|
||||
DtInitialize ();
|
||||
|
||||
/* Preprocessor */
|
||||
|
||||
@ -223,6 +219,21 @@ DtDoCompile (
|
||||
}
|
||||
}
|
||||
|
||||
/* Compile the parse tree */
|
||||
|
||||
if (AslGbl_DtLexBisonPrototype)
|
||||
{
|
||||
Event = UtBeginEvent ("Parse data table in prototype mode");
|
||||
|
||||
DtCompilerInitLexer (AslGbl_Files[ASL_FILE_INPUT].Handle);
|
||||
DtCompilerParserparse ();
|
||||
FieldList = AslGbl_FieldList;
|
||||
DtCompilerTerminateLexer ();
|
||||
|
||||
UtEndEvent (Event);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Scan the input file (file is already open) and
|
||||
* build the parse tree
|
||||
@ -230,6 +241,7 @@ DtDoCompile (
|
||||
Event = UtBeginEvent ("Scan and parse input file");
|
||||
FieldList = DtScanFile (AslGbl_Files[ASL_FILE_INPUT].Handle);
|
||||
UtEndEvent (Event);
|
||||
}
|
||||
|
||||
/* Did the parse tree get successfully constructed? */
|
||||
|
||||
@ -245,14 +257,27 @@ DtDoCompile (
|
||||
|
||||
Event = UtBeginEvent ("Compile parse tree");
|
||||
|
||||
/*
|
||||
* Compile the parse tree
|
||||
*/
|
||||
Status = DtCompileDataTable (&FieldList);
|
||||
UtEndEvent (Event);
|
||||
|
||||
FileNode = FlGetCurrentFileNode ();
|
||||
if (!FileNode)
|
||||
{
|
||||
fprintf (stderr, "Summary for %s could not be generated",
|
||||
AslGbl_Files[ASL_FILE_INPUT].Filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
FileNode->TotalLineCount = AslGbl_CurrentLineNumber;
|
||||
FileNode->OriginalInputFileSize = AslGbl_InputByteCount;
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "Line count: %u input file size: %u\n",
|
||||
FileNode->TotalLineCount, FileNode->OriginalInputFileSize);
|
||||
}
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
FileNode->ParserErrorDetected = TRUE;
|
||||
|
||||
/* TBD: temporary error message. Msgs should come from function above */
|
||||
|
||||
DtError (ASL_ERROR, ASL_MSG_SYNTAX, NULL,
|
||||
@ -276,6 +301,14 @@ DtDoCompile (
|
||||
HxDoHexOutput ();
|
||||
DtWriteTableToListing ();
|
||||
|
||||
/* Save the compile time statistics to the current file node */
|
||||
|
||||
if (FileNode)
|
||||
{
|
||||
FileNode->TotalFields = AslGbl_InputFieldCount;
|
||||
FileNode->OutputByteLength = AslGbl_TableLength;
|
||||
}
|
||||
|
||||
return (Status);
|
||||
}
|
||||
|
||||
@ -293,25 +326,12 @@ DtDoCompile (
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
void
|
||||
DtInitialize (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
Status = AcpiOsInitialize ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Status = AcpiUtInitGlobals ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
AcpiUtSetIntegerWidth (2); /* Set width to 64 bits */
|
||||
|
||||
AslGbl_FieldList = NULL;
|
||||
@ -319,7 +339,7 @@ DtInitialize (
|
||||
AslGbl_SubtableStack = NULL;
|
||||
|
||||
sprintf (VersionString, "%X", (UINT32) ACPI_CA_VERSION);
|
||||
return (AE_OK);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
@ -256,6 +256,10 @@ DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*AslGbl_LabelList, NULL);
|
||||
|
||||
DT_EXTERN UINT32 DT_INIT_GLOBAL (AslGbl_CurrentTableOffset, 0);
|
||||
|
||||
/* Data table compiler Flex/Bison prototype */
|
||||
|
||||
DT_EXTERN BOOLEAN DT_INIT_GLOBAL (AslGbl_DtLexBisonPrototype, FALSE);
|
||||
|
||||
/* Local caches */
|
||||
|
||||
DT_EXTERN UINT32 DT_INIT_GLOBAL (AslGbl_SubtableCount, 0);
|
||||
@ -288,6 +292,14 @@ DtCompilePadding (
|
||||
UINT32 Length,
|
||||
DT_SUBTABLE **RetSubtable);
|
||||
|
||||
void
|
||||
DtCreateField (
|
||||
char *Name,
|
||||
char *Value,
|
||||
UINT32 Line,
|
||||
UINT32 Offset,
|
||||
UINT32 Column,
|
||||
UINT32 NameColumn);
|
||||
|
||||
/* dtio - binary and text input/output */
|
||||
|
||||
@ -427,10 +439,23 @@ DtCompileFlag (
|
||||
|
||||
/* dtparser - lex/yacc files */
|
||||
|
||||
UINT64 DtCompilerParserResult; /* Expression return value */
|
||||
int
|
||||
DtCompilerParserparse (
|
||||
void);
|
||||
|
||||
UINT64
|
||||
DtEvaluateExpression (
|
||||
char *ExprString);
|
||||
|
||||
void
|
||||
DtCompilerInitLexer (
|
||||
FILE *inFile);
|
||||
|
||||
void
|
||||
DtCompilerTerminateLexer (
|
||||
void);
|
||||
|
||||
int
|
||||
DtInitLexer (
|
||||
char *String);
|
||||
|
288
source/compiler/dtcompilerparser.l
Normal file
288
source/compiler/dtcompilerparser.l
Normal file
@ -0,0 +1,288 @@
|
||||
%{
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dtcompilerparser.l - Flex input file for table compiler lexer
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2018, 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.
|
||||
*
|
||||
*****************************************************************************
|
||||
*
|
||||
* Alternatively, you may choose to be licensed under the terms of the
|
||||
* following license:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Alternatively, you may choose to be licensed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "dtcompilerparser.y.h"
|
||||
|
||||
YYSTYPE DtCompilerlval;
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("dtcompilerscanner")
|
||||
|
||||
/* handle locations */
|
||||
|
||||
int DtCompilerParsercolumn = 1;
|
||||
int DtCompilerParserByteOffset = 0;
|
||||
|
||||
#define YY_USER_ACTION \
|
||||
DtCompilerParserlloc.first_line = DtCompilerParserlloc.last_line = DtCompilerParserlineno; \
|
||||
DtCompilerParserlloc.first_column = DtCompilerParsercolumn; \
|
||||
DtCompilerParserlloc.first_byte_offset = DtCompilerParserByteOffset; \
|
||||
DtCompilerParserlloc.last_column = DtCompilerParsercolumn + DtCompilerParserleng-1; \
|
||||
DtCompilerParsercolumn += DtCompilerParserleng; \
|
||||
DtCompilerParserByteOffset += DtCompilerParserleng; \
|
||||
DbgPrint (ASL_PARSE_OUTPUT,\
|
||||
"user action occurred. DtCompilerParserlloc.first_line: %u offset: %u\n",\
|
||||
DtCompilerParserlloc.first_line, DtCompilerParserlloc.first_byte_offset);
|
||||
%}
|
||||
|
||||
%option nounput noinput yylineno
|
||||
|
||||
/* Indicates a state used for parsing multiline C comments */
|
||||
%x ML_COMMENT
|
||||
%x DATA_STATE
|
||||
|
||||
WhiteSpace [ \t\v\r]+
|
||||
NewLines [\n]+
|
||||
|
||||
/* Avoid ", \n, and [] as a part of label name. These are not valid characters of a label name */
|
||||
LabelName [^ ":\n\[\]]([^":\n\[\]]*[^" :\n\[\]])?
|
||||
|
||||
/* Avoid ", \n, \\, and [] as a part of data. These are not valid characters of data */
|
||||
Data [^ \\":\n\[\]]([^":\n\[\]\\]*[^" :\n\[\]\\])?
|
||||
|
||||
Text [^ ":\n][^":\n]*
|
||||
Comment \[[^\n\[\]]*\]
|
||||
CommentField {LabelName}{WhiteSpace}*:{WhiteSpace}{Comment}?$
|
||||
|
||||
|
||||
%%
|
||||
|
||||
<DATA_STATE>{WhiteSpace}"\\\n" {
|
||||
DbgPrint(ASL_PARSE_OUTPUT,"Continuation matched\n");
|
||||
return (DT_PARSEOP_LINE_CONTINUATION);
|
||||
}
|
||||
|
||||
":" {
|
||||
DbgPrint(ASL_PARSE_OUTPUT, ": Matched\n");
|
||||
BEGIN (DATA_STATE);
|
||||
return (':');
|
||||
}
|
||||
|
||||
<INITIAL,DATA_STATE>{WhiteSpace} { DbgPrint(ASL_PARSE_OUTPUT,"Whitespace matched\n"); }
|
||||
|
||||
<INITIAL,DATA_STATE>{Comment} { DbgPrint(ASL_PARSE_OUTPUT,"Comment matched\n"); }
|
||||
|
||||
"/*" { BEGIN (ML_COMMENT); }
|
||||
<ML_COMMENT>"*/" { BEGIN (INITIAL); }
|
||||
<ML_COMMENT>"*/\n" { BEGIN (INITIAL); }
|
||||
<ML_COMMENT>([^*]|\n)+|. /* Ignore */
|
||||
"//".* /* Ignore */
|
||||
|
||||
|
||||
<DATA_STATE>{Data} {
|
||||
char *s;
|
||||
int size = strlen (DtCompilerParsertext);
|
||||
s=UtLocalCacheCalloc (size + 1);
|
||||
AcpiUtSafeStrncpy (s, DtCompilerParsertext, size + 1);
|
||||
DtCompilerParserlval.s = s;
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "Data: %s\n", s);
|
||||
return (DT_PARSEOP_DATA);
|
||||
}
|
||||
|
||||
{CommentField} /* ignore */
|
||||
|
||||
{LabelName} {
|
||||
char *s;
|
||||
int size = strlen (DtCompilerParsertext);
|
||||
s=UtLocalCacheCalloc (size + 1);
|
||||
AcpiUtSafeStrncpy (s, DtCompilerParsertext, size + 1);
|
||||
DtCompilerParserlval.s = s;
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "Label: %s\n", s);
|
||||
return (DT_PARSEOP_LABEL);
|
||||
}
|
||||
|
||||
|
||||
<DATA_STATE>\"{Text}?\" { // remove outer quotes from the string, they are unnecessary
|
||||
char *s;
|
||||
int size = strlen (DtCompilerParsertext);
|
||||
s=UtLocalCacheCalloc (size - 1);
|
||||
AcpiUtSafeStrncpy (s, DtCompilerParsertext + 1, size - 1);
|
||||
DtCompilerParserlval.s = s;
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "String Data: %s\n", s);
|
||||
BEGIN (INITIAL);
|
||||
return (DT_PARSEOP_STRING_DATA);
|
||||
}
|
||||
|
||||
|
||||
<INITIAL,DATA_STATE>{NewLines} {
|
||||
DbgPrint(ASL_PARSE_OUTPUT,
|
||||
"Newline matched (data state). Current line number: %u\n",DtCompilerParserlineno);
|
||||
BEGIN (INITIAL); DtCompilerParsercolumn = 1;
|
||||
}
|
||||
|
||||
|
||||
%%
|
||||
|
||||
|
||||
/*
|
||||
* Local support functions
|
||||
*/
|
||||
|
||||
void
|
||||
DtCompilerInitLexer (
|
||||
FILE *inFile)
|
||||
{
|
||||
yyin = inFile;
|
||||
}
|
||||
|
||||
void
|
||||
DtCompilerTerminateLexer (
|
||||
void)
|
||||
{
|
||||
/*
|
||||
* Flex/Bison increments the lineno for the EOF so decrement by 1 to get
|
||||
* the correct number of lines.
|
||||
*/
|
||||
AslGbl_CurrentLineNumber = DtCompilerParserlineno - 1;
|
||||
AslGbl_InputByteCount = DtCompilerParserByteOffset;
|
||||
}
|
287
source/compiler/dtcompilerparser.y
Normal file
287
source/compiler/dtcompilerparser.y
Normal file
@ -0,0 +1,287 @@
|
||||
%{
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dtcompilerparser.y - Bison input file for table compiler parser
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2018, 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.
|
||||
*
|
||||
*****************************************************************************
|
||||
*
|
||||
* Alternatively, you may choose to be licensed under the terms of the
|
||||
* following license:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Alternatively, you may choose to be licensed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include "aslcompiler.h"
|
||||
|
||||
|
||||
#define _COMPONENT DT_COMPILER
|
||||
ACPI_MODULE_NAME ("dtcompilerparser")
|
||||
|
||||
void * AslLocalAllocate (unsigned int Size);
|
||||
|
||||
/* Bison/yacc configuration */
|
||||
|
||||
#undef alloca
|
||||
#define alloca AslLocalAllocate
|
||||
|
||||
int DtCompilerParserlex (void);
|
||||
int DtCompilerParserparse (void);
|
||||
void DtCompilerParsererror (char const *msg);
|
||||
extern char *DtCompilerParsertext;
|
||||
extern DT_FIELD *AslGbl_CurrentField;
|
||||
|
||||
extern UINT64 DtCompilerParserResult; /* Expression return value */
|
||||
extern UINT64 DtCompilerParserlineno; /* Current line number */
|
||||
|
||||
/* Bison/yacc configuration */
|
||||
|
||||
#define yytname DtCompilerParsername
|
||||
#define YYDEBUG 1 /* Enable debug output */
|
||||
#define YYERROR_VERBOSE 1 /* Verbose error messages */
|
||||
#define YYFLAG -32768
|
||||
|
||||
/* Define YYMALLOC/YYFREE to prevent redefinition errors */
|
||||
|
||||
#define YYMALLOC malloc
|
||||
#define YYFREE free
|
||||
|
||||
%}
|
||||
|
||||
%code requires {
|
||||
|
||||
typedef struct YYLTYPE {
|
||||
int first_line;
|
||||
int last_line;
|
||||
int first_column;
|
||||
int last_column;
|
||||
int first_byte_offset;
|
||||
} YYLTYPE;
|
||||
|
||||
#define YYLTYPE_IS_DECLARED 1
|
||||
}
|
||||
|
||||
|
||||
%union {
|
||||
char *s;
|
||||
DT_FIELD *f;
|
||||
}
|
||||
|
||||
|
||||
%type <f> Table
|
||||
%token <s> DT_PARSEOP_DATA
|
||||
%token <s> DT_PARSEOP_LABEL
|
||||
%token <s> DT_PARSEOP_STRING_DATA
|
||||
%token <s> DT_PARSEOP_LINE_CONTINUATION
|
||||
%type <s> Data
|
||||
%type <s> Datum
|
||||
%type <s> MultiLineData
|
||||
%type <s> MultiLineDataList
|
||||
|
||||
|
||||
%%
|
||||
|
||||
Table
|
||||
:
|
||||
FieldList { DtCompilerParserResult = 5;}
|
||||
;
|
||||
|
||||
FieldList
|
||||
: Field FieldList
|
||||
| Field
|
||||
;
|
||||
|
||||
Field
|
||||
: DT_PARSEOP_LABEL ':' Data { DtCreateField ($1, $3, (@3).first_line, (@1).first_byte_offset, (@1).first_column, (@3).first_column); }
|
||||
;
|
||||
|
||||
Data
|
||||
: MultiLineDataList { $$ = $1; }
|
||||
| Datum { $$ = $1; }
|
||||
| Datum MultiLineDataList { $$ = $1; } /* combine the string with strcat */
|
||||
;
|
||||
|
||||
MultiLineDataList
|
||||
: MultiLineDataList MultiLineData { $$ = AcpiUtStrcat(AcpiUtStrcat($1, " "), $2); } /* combine the strings with strcat */
|
||||
| MultiLineData { $$ = $1; }
|
||||
;
|
||||
|
||||
MultiLineData
|
||||
: DT_PARSEOP_LINE_CONTINUATION Datum { DbgPrint (ASL_PARSE_OUTPUT, "line continuation detected\n"); $$ = $2; }
|
||||
;
|
||||
|
||||
Datum
|
||||
: DT_PARSEOP_DATA { DbgPrint (ASL_PARSE_OUTPUT, "parser data: [%s]\n", DtCompilerParserlval.s); $$ = AcpiUtStrdup(DtCompilerParserlval.s); }
|
||||
| DT_PARSEOP_STRING_DATA { DbgPrint (ASL_PARSE_OUTPUT, "parser string data: [%s]\n", DtCompilerParserlval.s); $$ = AcpiUtStrdup(DtCompilerParserlval.s); }
|
||||
;
|
||||
|
||||
|
||||
%%
|
||||
|
||||
|
||||
/*
|
||||
* Local support functions, including parser entry point
|
||||
*/
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompilerParsererror
|
||||
*
|
||||
* PARAMETERS: Message - Parser-generated error message
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Handler for parser errors
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtCompilerParsererror (
|
||||
char const *Message)
|
||||
{
|
||||
DtError (ASL_ERROR, ASL_MSG_SYNTAX,
|
||||
AslGbl_CurrentField, (char *) Message);
|
||||
}
|
||||
|
||||
int
|
||||
DtCompilerParserwrap(void)
|
||||
{
|
||||
return (1);
|
||||
}
|
@ -280,7 +280,9 @@ DtCompileString (
|
||||
|
||||
if (Length > ByteLength)
|
||||
{
|
||||
sprintf (AslGbl_MsgBuffer, "Maximum %u characters", ByteLength);
|
||||
sprintf (AslGbl_MsgBuffer,
|
||||
"Maximum %u characters, found %u characters [%s]",
|
||||
ByteLength, Length, Field->Value);
|
||||
DtError (ASL_ERROR, ASL_MSG_STRING_LENGTH, Field, AslGbl_MsgBuffer);
|
||||
Length = ByteLength;
|
||||
}
|
||||
|
@ -493,6 +493,59 @@ DtParseLine (
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCreateField
|
||||
*
|
||||
* PARAMETERS: Name
|
||||
* Value
|
||||
* Line
|
||||
* Offset
|
||||
* Column
|
||||
* NameColumn
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Create a field
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtCreateField (
|
||||
char *Name,
|
||||
char *Value,
|
||||
UINT32 Line,
|
||||
UINT32 Offset,
|
||||
UINT32 Column,
|
||||
UINT32 NameColumn)
|
||||
{
|
||||
DT_FIELD *Field = UtFieldCacheCalloc ();
|
||||
|
||||
|
||||
Field->StringLength = 0;
|
||||
if (Name)
|
||||
{
|
||||
Field->Name =
|
||||
strcpy (UtLocalCacheCalloc (strlen (Name) + 1), Name);
|
||||
}
|
||||
|
||||
if (Value)
|
||||
{
|
||||
Field->StringLength = strlen (Value);
|
||||
Field->Value =
|
||||
strcpy (UtLocalCacheCalloc (Field->StringLength + 1), Value);
|
||||
}
|
||||
|
||||
Field->Line = Line;
|
||||
Field->ByteOffset = Offset;
|
||||
Field->NameColumn = NameColumn;
|
||||
Field->Column = Column;
|
||||
DtLinkField (Field);
|
||||
|
||||
DtDumpFieldList (AslGbl_FieldList);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtGetNextLine
|
||||
@ -1117,7 +1170,7 @@ DtDumpSubtableInfo (
|
||||
{
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"[%.04X] %24s %.08X %.08X %.08X %.08X %.08X %p %p %p\n",
|
||||
"[%.04X] %24s %.08X %.08X %.08X %.08X %p %p %p %p\n",
|
||||
Subtable->Depth, Subtable->Name, Subtable->Length, Subtable->TotalLength,
|
||||
Subtable->SizeOfLengthField, Subtable->Flags, Subtable,
|
||||
Subtable->Parent, Subtable->Child, Subtable->Peer);
|
||||
@ -1131,7 +1184,7 @@ DtDumpSubtableTree (
|
||||
{
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"[%.04X] %24s %*s%08X (%.02X) - (%.02X)\n",
|
||||
"[%.04X] %24s %*s%p (%.02X) - (%.02X)\n",
|
||||
Subtable->Depth, Subtable->Name, (4 * Subtable->Depth), " ",
|
||||
Subtable, Subtable->Length, Subtable->TotalLength);
|
||||
}
|
||||
@ -1225,7 +1278,7 @@ DtWriteFieldToListing (
|
||||
if (strlen (Field->Value) > 64)
|
||||
{
|
||||
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "...Additional data, length 0x%X\n",
|
||||
strlen (Field->Value));
|
||||
(UINT32) strlen (Field->Value));
|
||||
}
|
||||
|
||||
FlPrintFile (ASL_FILE_LISTING_OUTPUT, "\n");
|
||||
|
@ -227,7 +227,6 @@ int
|
||||
DtInitLexer (
|
||||
char *String)
|
||||
{
|
||||
|
||||
LexBuffer = yy_scan_string (String);
|
||||
return (LexBuffer == NULL);
|
||||
}
|
||||
@ -236,6 +235,5 @@ void
|
||||
DtTerminateLexer (
|
||||
void)
|
||||
{
|
||||
|
||||
yy_delete_buffer (LexBuffer);
|
||||
}
|
||||
|
@ -509,7 +509,7 @@ DtCreateOneTemplate (
|
||||
AcpiUtStrlwr (DisasmFilename);
|
||||
if (!UtQueryForOverwrite (DisasmFilename))
|
||||
{
|
||||
return (AE_ERROR);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
File = fopen (DisasmFilename, "w+");
|
||||
|
@ -223,7 +223,7 @@ PrAddDefine (
|
||||
DefineInfo = PrMatchDefine (Identifier);
|
||||
if (DefineInfo)
|
||||
{
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID,
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID
|
||||
"#define: name already exists: %s\n",
|
||||
AslGbl_CurrentLineNumber, Identifier);
|
||||
|
||||
|
@ -850,7 +850,7 @@ PrDoDirective (
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID
|
||||
"Start #include file \"%s\"\n", AslGbl_CurrentLineNumber,
|
||||
Token, AslGbl_CurrentLineNumber);
|
||||
Token);
|
||||
|
||||
PrDoIncludeFile (Token);
|
||||
break;
|
||||
@ -1356,7 +1356,7 @@ PrDoIncludeBuffer (
|
||||
{
|
||||
if (!(i % 8))
|
||||
{
|
||||
FlPrintFile (ASL_FILE_PREPROCESSOR, "\n ", c);
|
||||
FlPrintFile (ASL_FILE_PREPROCESSOR, "\n ");
|
||||
}
|
||||
|
||||
FlPrintFile (ASL_FILE_PREPROCESSOR, " 0x%2.2X,", c);
|
||||
@ -1369,6 +1369,6 @@ PrDoIncludeBuffer (
|
||||
|
||||
/* Close the Name() operator */
|
||||
|
||||
FlPrintFile (ASL_FILE_PREPROCESSOR, "\n})\n", BufferName);
|
||||
FlPrintFile (ASL_FILE_PREPROCESSOR, "\n})\n");
|
||||
fclose (BinaryBufferFile);
|
||||
}
|
||||
|
@ -284,7 +284,7 @@ AcpiDbDisplayHistory (
|
||||
{
|
||||
if (AcpiGbl_HistoryBuffer[HistoryIndex].Command)
|
||||
{
|
||||
AcpiOsPrintf ("%3ld %s\n",
|
||||
AcpiOsPrintf ("%3u %s\n",
|
||||
AcpiGbl_HistoryBuffer[HistoryIndex].CmdNum,
|
||||
AcpiGbl_HistoryBuffer[HistoryIndex].Command);
|
||||
}
|
||||
|
@ -785,7 +785,7 @@ AcpiDbGetLine (
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
"Buffer overflow while parsing input line (max %u characters)\n",
|
||||
sizeof (AcpiGbl_DbParsedBuf));
|
||||
(UINT32) sizeof (AcpiGbl_DbParsedBuf));
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -1060,10 +1060,10 @@ AcpiDbCommandDispatch (
|
||||
if (ParamCount == 0)
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
"Current debug level for file output is: %8.8lX\n",
|
||||
"Current debug level for file output is: %8.8X\n",
|
||||
AcpiGbl_DbDebugLevel);
|
||||
AcpiOsPrintf (
|
||||
"Current debug level for console output is: %8.8lX\n",
|
||||
"Current debug level for console output is: %8.8X\n",
|
||||
AcpiGbl_DbConsoleDebugLevel);
|
||||
}
|
||||
else if (ParamCount == 2)
|
||||
@ -1072,7 +1072,7 @@ AcpiDbCommandDispatch (
|
||||
AcpiGbl_DbConsoleDebugLevel =
|
||||
strtoul (AcpiGbl_DbArgs[1], NULL, 16);
|
||||
AcpiOsPrintf (
|
||||
"Debug Level for console output was %8.8lX, now %8.8lX\n",
|
||||
"Debug Level for console output was %8.8X, now %8.8X\n",
|
||||
Temp, AcpiGbl_DbConsoleDebugLevel);
|
||||
}
|
||||
else
|
||||
@ -1080,7 +1080,7 @@ AcpiDbCommandDispatch (
|
||||
Temp = AcpiGbl_DbDebugLevel;
|
||||
AcpiGbl_DbDebugLevel = strtoul (AcpiGbl_DbArgs[1], NULL, 16);
|
||||
AcpiOsPrintf (
|
||||
"Debug Level for file output was %8.8lX, now %8.8lX\n",
|
||||
"Debug Level for file output was %8.8X, now %8.8X\n",
|
||||
Temp, AcpiGbl_DbDebugLevel);
|
||||
}
|
||||
break;
|
||||
|
@ -493,6 +493,11 @@ AcpiDbDisassembleMethod (
|
||||
}
|
||||
|
||||
Status = AcpiUtAllocateOwnerId (&ObjDesc->Method.OwnerId);
|
||||
if (ACPI_FAILURE(Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
WalkState->OwnerId = ObjDesc->Method.OwnerId;
|
||||
|
||||
/* Push start scope on scope stack and make it current */
|
||||
|
@ -567,7 +567,6 @@ AcpiDbDecodeLocals (
|
||||
|
||||
|
||||
Node = WalkState->MethodNode;
|
||||
ObjDesc = WalkState->MethodDesc;
|
||||
|
||||
/* There are no locals for the module-level code case */
|
||||
|
||||
|
@ -544,14 +544,14 @@ AcpiDbDisplayStatistics (
|
||||
|
||||
for (i = 0; i < ACPI_TYPE_NS_NODE_MAX; i++)
|
||||
{
|
||||
AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", AcpiUtGetTypeName (i),
|
||||
AcpiOsPrintf ("%16.16s %10u %10u\n", AcpiUtGetTypeName (i),
|
||||
AcpiGbl_NodeTypeCount [i], AcpiGbl_ObjTypeCount [i]);
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", "Misc/Unknown",
|
||||
AcpiOsPrintf ("%16.16s %10u %10u\n", "Misc/Unknown",
|
||||
AcpiGbl_NodeTypeCountMisc, AcpiGbl_ObjTypeCountMisc);
|
||||
|
||||
AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", "TOTALS:",
|
||||
AcpiOsPrintf ("%16.16s %10u %10u\n", "TOTALS:",
|
||||
AcpiGbl_NumNodes, AcpiGbl_NumObjects);
|
||||
break;
|
||||
|
||||
@ -577,17 +577,15 @@ AcpiDbDisplayStatistics (
|
||||
case CMD_STAT_MISC:
|
||||
|
||||
AcpiOsPrintf ("\nMiscellaneous Statistics:\n\n");
|
||||
AcpiOsPrintf ("Calls to AcpiPsFind:.. ........% 7ld\n",
|
||||
AcpiOsPrintf ("%-28s: %7u\n", "Calls to AcpiPsFind",
|
||||
AcpiGbl_PsFindCount);
|
||||
AcpiOsPrintf ("Calls to AcpiNsLookup:..........% 7ld\n",
|
||||
AcpiOsPrintf ("%-28s: %7u\n", "Calls to AcpiNsLookup",
|
||||
AcpiGbl_NsLookupCount);
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
|
||||
AcpiOsPrintf ("Mutex usage:\n\n");
|
||||
AcpiOsPrintf ("\nMutex usage:\n\n");
|
||||
for (i = 0; i < ACPI_NUM_MUTEX; i++)
|
||||
{
|
||||
AcpiOsPrintf ("%-28s: % 7ld\n",
|
||||
AcpiOsPrintf ("%-28s: %7u\n",
|
||||
AcpiUtGetMutexName (i), AcpiGbl_MutexInfo[i].UseCount);
|
||||
}
|
||||
break;
|
||||
@ -596,50 +594,50 @@ AcpiDbDisplayStatistics (
|
||||
|
||||
AcpiOsPrintf ("\nInternal object sizes:\n\n");
|
||||
|
||||
AcpiOsPrintf ("Common %3d\n", sizeof (ACPI_OBJECT_COMMON));
|
||||
AcpiOsPrintf ("Number %3d\n", sizeof (ACPI_OBJECT_INTEGER));
|
||||
AcpiOsPrintf ("String %3d\n", sizeof (ACPI_OBJECT_STRING));
|
||||
AcpiOsPrintf ("Buffer %3d\n", sizeof (ACPI_OBJECT_BUFFER));
|
||||
AcpiOsPrintf ("Package %3d\n", sizeof (ACPI_OBJECT_PACKAGE));
|
||||
AcpiOsPrintf ("BufferField %3d\n", sizeof (ACPI_OBJECT_BUFFER_FIELD));
|
||||
AcpiOsPrintf ("Device %3d\n", sizeof (ACPI_OBJECT_DEVICE));
|
||||
AcpiOsPrintf ("Event %3d\n", sizeof (ACPI_OBJECT_EVENT));
|
||||
AcpiOsPrintf ("Method %3d\n", sizeof (ACPI_OBJECT_METHOD));
|
||||
AcpiOsPrintf ("Mutex %3d\n", sizeof (ACPI_OBJECT_MUTEX));
|
||||
AcpiOsPrintf ("Region %3d\n", sizeof (ACPI_OBJECT_REGION));
|
||||
AcpiOsPrintf ("PowerResource %3d\n", sizeof (ACPI_OBJECT_POWER_RESOURCE));
|
||||
AcpiOsPrintf ("Processor %3d\n", sizeof (ACPI_OBJECT_PROCESSOR));
|
||||
AcpiOsPrintf ("ThermalZone %3d\n", sizeof (ACPI_OBJECT_THERMAL_ZONE));
|
||||
AcpiOsPrintf ("RegionField %3d\n", sizeof (ACPI_OBJECT_REGION_FIELD));
|
||||
AcpiOsPrintf ("BankField %3d\n", sizeof (ACPI_OBJECT_BANK_FIELD));
|
||||
AcpiOsPrintf ("IndexField %3d\n", sizeof (ACPI_OBJECT_INDEX_FIELD));
|
||||
AcpiOsPrintf ("Reference %3d\n", sizeof (ACPI_OBJECT_REFERENCE));
|
||||
AcpiOsPrintf ("Notify %3d\n", sizeof (ACPI_OBJECT_NOTIFY_HANDLER));
|
||||
AcpiOsPrintf ("AddressSpace %3d\n", sizeof (ACPI_OBJECT_ADDR_HANDLER));
|
||||
AcpiOsPrintf ("Extra %3d\n", sizeof (ACPI_OBJECT_EXTRA));
|
||||
AcpiOsPrintf ("Data %3d\n", sizeof (ACPI_OBJECT_DATA));
|
||||
AcpiOsPrintf ("Common %3d\n", (UINT32) sizeof (ACPI_OBJECT_COMMON));
|
||||
AcpiOsPrintf ("Number %3d\n", (UINT32) sizeof (ACPI_OBJECT_INTEGER));
|
||||
AcpiOsPrintf ("String %3d\n", (UINT32) sizeof (ACPI_OBJECT_STRING));
|
||||
AcpiOsPrintf ("Buffer %3d\n", (UINT32) sizeof (ACPI_OBJECT_BUFFER));
|
||||
AcpiOsPrintf ("Package %3d\n", (UINT32) sizeof (ACPI_OBJECT_PACKAGE));
|
||||
AcpiOsPrintf ("BufferField %3d\n", (UINT32) sizeof (ACPI_OBJECT_BUFFER_FIELD));
|
||||
AcpiOsPrintf ("Device %3d\n", (UINT32) sizeof (ACPI_OBJECT_DEVICE));
|
||||
AcpiOsPrintf ("Event %3d\n", (UINT32) sizeof (ACPI_OBJECT_EVENT));
|
||||
AcpiOsPrintf ("Method %3d\n", (UINT32) sizeof (ACPI_OBJECT_METHOD));
|
||||
AcpiOsPrintf ("Mutex %3d\n", (UINT32) sizeof (ACPI_OBJECT_MUTEX));
|
||||
AcpiOsPrintf ("Region %3d\n", (UINT32) sizeof (ACPI_OBJECT_REGION));
|
||||
AcpiOsPrintf ("PowerResource %3d\n", (UINT32) sizeof (ACPI_OBJECT_POWER_RESOURCE));
|
||||
AcpiOsPrintf ("Processor %3d\n", (UINT32) sizeof (ACPI_OBJECT_PROCESSOR));
|
||||
AcpiOsPrintf ("ThermalZone %3d\n", (UINT32) sizeof (ACPI_OBJECT_THERMAL_ZONE));
|
||||
AcpiOsPrintf ("RegionField %3d\n", (UINT32) sizeof (ACPI_OBJECT_REGION_FIELD));
|
||||
AcpiOsPrintf ("BankField %3d\n", (UINT32) sizeof (ACPI_OBJECT_BANK_FIELD));
|
||||
AcpiOsPrintf ("IndexField %3d\n", (UINT32) sizeof (ACPI_OBJECT_INDEX_FIELD));
|
||||
AcpiOsPrintf ("Reference %3d\n", (UINT32) sizeof (ACPI_OBJECT_REFERENCE));
|
||||
AcpiOsPrintf ("Notify %3d\n", (UINT32) sizeof (ACPI_OBJECT_NOTIFY_HANDLER));
|
||||
AcpiOsPrintf ("AddressSpace %3d\n", (UINT32) sizeof (ACPI_OBJECT_ADDR_HANDLER));
|
||||
AcpiOsPrintf ("Extra %3d\n", (UINT32) sizeof (ACPI_OBJECT_EXTRA));
|
||||
AcpiOsPrintf ("Data %3d\n", (UINT32) sizeof (ACPI_OBJECT_DATA));
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
|
||||
AcpiOsPrintf ("ParseObject %3d\n", sizeof (ACPI_PARSE_OBJ_COMMON));
|
||||
AcpiOsPrintf ("ParseObjectNamed %3d\n", sizeof (ACPI_PARSE_OBJ_NAMED));
|
||||
AcpiOsPrintf ("ParseObjectAsl %3d\n", sizeof (ACPI_PARSE_OBJ_ASL));
|
||||
AcpiOsPrintf ("OperandObject %3d\n", sizeof (ACPI_OPERAND_OBJECT));
|
||||
AcpiOsPrintf ("NamespaceNode %3d\n", sizeof (ACPI_NAMESPACE_NODE));
|
||||
AcpiOsPrintf ("AcpiObject %3d\n", sizeof (ACPI_OBJECT));
|
||||
AcpiOsPrintf ("ParseObject %3d\n", (UINT32) sizeof (ACPI_PARSE_OBJ_COMMON));
|
||||
AcpiOsPrintf ("ParseObjectNamed %3d\n", (UINT32) sizeof (ACPI_PARSE_OBJ_NAMED));
|
||||
AcpiOsPrintf ("ParseObjectAsl %3d\n", (UINT32) sizeof (ACPI_PARSE_OBJ_ASL));
|
||||
AcpiOsPrintf ("OperandObject %3d\n", (UINT32) sizeof (ACPI_OPERAND_OBJECT));
|
||||
AcpiOsPrintf ("NamespaceNode %3d\n", (UINT32) sizeof (ACPI_NAMESPACE_NODE));
|
||||
AcpiOsPrintf ("AcpiObject %3d\n", (UINT32) sizeof (ACPI_OBJECT));
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
|
||||
AcpiOsPrintf ("Generic State %3d\n", sizeof (ACPI_GENERIC_STATE));
|
||||
AcpiOsPrintf ("Common State %3d\n", sizeof (ACPI_COMMON_STATE));
|
||||
AcpiOsPrintf ("Control State %3d\n", sizeof (ACPI_CONTROL_STATE));
|
||||
AcpiOsPrintf ("Update State %3d\n", sizeof (ACPI_UPDATE_STATE));
|
||||
AcpiOsPrintf ("Scope State %3d\n", sizeof (ACPI_SCOPE_STATE));
|
||||
AcpiOsPrintf ("Parse Scope %3d\n", sizeof (ACPI_PSCOPE_STATE));
|
||||
AcpiOsPrintf ("Package State %3d\n", sizeof (ACPI_PKG_STATE));
|
||||
AcpiOsPrintf ("Thread State %3d\n", sizeof (ACPI_THREAD_STATE));
|
||||
AcpiOsPrintf ("Result Values %3d\n", sizeof (ACPI_RESULT_VALUES));
|
||||
AcpiOsPrintf ("Notify Info %3d\n", sizeof (ACPI_NOTIFY_INFO));
|
||||
AcpiOsPrintf ("Generic State %3d\n", (UINT32) sizeof (ACPI_GENERIC_STATE));
|
||||
AcpiOsPrintf ("Common State %3d\n", (UINT32) sizeof (ACPI_COMMON_STATE));
|
||||
AcpiOsPrintf ("Control State %3d\n", (UINT32) sizeof (ACPI_CONTROL_STATE));
|
||||
AcpiOsPrintf ("Update State %3d\n", (UINT32) sizeof (ACPI_UPDATE_STATE));
|
||||
AcpiOsPrintf ("Scope State %3d\n", (UINT32) sizeof (ACPI_SCOPE_STATE));
|
||||
AcpiOsPrintf ("Parse Scope %3d\n", (UINT32) sizeof (ACPI_PSCOPE_STATE));
|
||||
AcpiOsPrintf ("Package State %3d\n", (UINT32) sizeof (ACPI_PKG_STATE));
|
||||
AcpiOsPrintf ("Thread State %3d\n", (UINT32) sizeof (ACPI_THREAD_STATE));
|
||||
AcpiOsPrintf ("Result Values %3d\n", (UINT32) sizeof (ACPI_RESULT_VALUES));
|
||||
AcpiOsPrintf ("Notify Info %3d\n", (UINT32) sizeof (ACPI_NOTIFY_INFO));
|
||||
break;
|
||||
|
||||
case CMD_STAT_STACK:
|
||||
|
@ -848,6 +848,15 @@ AcpiEvDetectGpe (
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
|
||||
|
||||
if (!GpeEventInfo)
|
||||
{
|
||||
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
|
||||
if (!GpeEventInfo)
|
||||
{
|
||||
goto ErrorExit;
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the info block for the entire GPE register */
|
||||
|
||||
GpeRegisterInfo = GpeEventInfo->RegisterInfo;
|
||||
|
@ -875,6 +875,33 @@ AcpiGetGpeStatus (
|
||||
ACPI_EXPORT_SYMBOL (AcpiGetGpeStatus)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDispatchGpe
|
||||
*
|
||||
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
|
||||
* GpeNumber - GPE level within the GPE block
|
||||
*
|
||||
* RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED
|
||||
*
|
||||
* DESCRIPTION: Detect and dispatch a General Purpose Event to either a function
|
||||
* (e.g. EC) or method (e.g. _Lxx/_Exx) handler.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
UINT32
|
||||
AcpiDispatchGpe(
|
||||
ACPI_HANDLE GpeDevice,
|
||||
UINT32 GpeNumber)
|
||||
{
|
||||
ACPI_FUNCTION_TRACE(acpi_dispatch_gpe);
|
||||
|
||||
return (AcpiEvDetectGpe (GpeDevice, NULL, GpeNumber));
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiDispatchGpe)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiFinishGpe
|
||||
|
@ -255,7 +255,7 @@ static ACPI_EXDUMP_INFO AcpiExDumpMethod[9] =
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.ParamCount), "Parameter Count"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.SyncLevel), "Sync Level"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Method.Mutex), "Mutex"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.OwnerId), "Owner Id"},
|
||||
{ACPI_EXD_UINT16, ACPI_EXD_OFFSET (Method.OwnerId), "Owner Id"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.ThreadCount), "Thread Count"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Method.AmlLength), "Aml Length"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Method.AmlStart), "Aml Start"}
|
||||
@ -422,8 +422,8 @@ static ACPI_EXDUMP_INFO AcpiExDumpFieldCommon[7] =
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpNode[7] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpNode), NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET (Flags), "Flags"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET (OwnerId), "Owner Id"},
|
||||
{ACPI_EXD_UINT16, ACPI_EXD_NSOFFSET (Flags), "Flags"},
|
||||
{ACPI_EXD_UINT16, ACPI_EXD_NSOFFSET (OwnerId), "Owner Id"},
|
||||
{ACPI_EXD_LIST, ACPI_EXD_NSOFFSET (Object), "Object List"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Parent), "Parent"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Child), "Child"},
|
||||
|
@ -767,7 +767,7 @@ AcpiNsLookup (
|
||||
if (Flags & ACPI_NS_PREFIX_MUST_EXIST)
|
||||
{
|
||||
AcpiOsPrintf (ACPI_MSG_BIOS_ERROR
|
||||
"Object does not exist: %4.4s\n", &SimpleName);
|
||||
"Object does not exist: %4.4s\n", (char *) &SimpleName);
|
||||
}
|
||||
#endif
|
||||
/* Name not found in ACPI namespace */
|
||||
|
@ -423,7 +423,7 @@ AcpiNsInstallNode (
|
||||
Node->Type = (UINT8) Type;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
|
||||
"%4.4s (%s) [Node %p Owner %X] added to %4.4s (%s) [Node %p]\n",
|
||||
"%4.4s (%s) [Node %p Owner %3.3X] added to %4.4s (%s) [Node %p]\n",
|
||||
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type), Node, OwnerId,
|
||||
AcpiUtGetNodeName (ParentNode), AcpiUtGetTypeName (ParentNode->Type),
|
||||
ParentNode));
|
||||
|
@ -381,7 +381,7 @@ AcpiNsDumpOneObject (
|
||||
|
||||
/* Now we can print out the pertinent information */
|
||||
|
||||
AcpiOsPrintf (" %-12s %p %2.2X ",
|
||||
AcpiOsPrintf (" %-12s %p %3.3X ",
|
||||
AcpiUtGetTypeName (Type), ThisNode, ThisNode->OwnerId);
|
||||
|
||||
DbgLevel = AcpiDbgLevel;
|
||||
|
@ -289,7 +289,7 @@ static const ACPI_REPAIR_INFO AcpiNsRepairableNames[] =
|
||||
|
||||
#define ACPI_FDE_FIELD_COUNT 5
|
||||
#define ACPI_FDE_BYTE_BUFFER_SIZE 5
|
||||
#define ACPI_FDE_DWORD_BUFFER_SIZE (ACPI_FDE_FIELD_COUNT * sizeof (UINT32))
|
||||
#define ACPI_FDE_DWORD_BUFFER_SIZE (ACPI_FDE_FIELD_COUNT * (UINT32) sizeof (UINT32))
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -973,6 +973,7 @@ AcpiTbDeleteNamespaceByOwner (
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
AcpiNsDeleteNamespaceByOwner (OwnerId);
|
||||
AcpiUtReleaseWriteLock (&AcpiGbl_NamespaceRwLock);
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -322,7 +322,7 @@ AcpiDebugPrint (
|
||||
* Display the module name, current line number, thread ID (if requested),
|
||||
* current procedure nesting level, and the current procedure name
|
||||
*/
|
||||
AcpiOsPrintf ("%9s-%04ld ", ModuleName, LineNumber);
|
||||
AcpiOsPrintf ("%9s-%04d ", ModuleName, LineNumber);
|
||||
|
||||
#ifdef ACPI_APPLICATION
|
||||
/*
|
||||
@ -343,7 +343,7 @@ AcpiDebugPrint (
|
||||
FillCount = 0;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("[%02ld] %*s",
|
||||
AcpiOsPrintf ("[%02d] %*s",
|
||||
AcpiGbl_NestingLevel, AcpiGbl_NestingLevel + 1, " ");
|
||||
AcpiOsPrintf ("%s%*s: ",
|
||||
AcpiUtTrimFunctionName (FunctionName), FillCount, " ");
|
||||
|
@ -188,7 +188,7 @@ AcpiUtPredefinedWarning (
|
||||
const char *ModuleName,
|
||||
UINT32 LineNumber,
|
||||
char *Pathname,
|
||||
UINT8 NodeFlags,
|
||||
UINT16 NodeFlags,
|
||||
const char *Format,
|
||||
...)
|
||||
{
|
||||
@ -237,7 +237,7 @@ AcpiUtPredefinedInfo (
|
||||
const char *ModuleName,
|
||||
UINT32 LineNumber,
|
||||
char *Pathname,
|
||||
UINT8 NodeFlags,
|
||||
UINT16 NodeFlags,
|
||||
const char *Format,
|
||||
...)
|
||||
{
|
||||
@ -286,7 +286,7 @@ AcpiUtPredefinedBiosError (
|
||||
const char *ModuleName,
|
||||
UINT32 LineNumber,
|
||||
char *Pathname,
|
||||
UINT8 NodeFlags,
|
||||
UINT16 NodeFlags,
|
||||
const char *Format,
|
||||
...)
|
||||
{
|
||||
|
@ -212,13 +212,14 @@ static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[] =
|
||||
{"Windows 2006 SP2", NULL, 0, ACPI_OSI_WIN_VISTA_SP2}, /* Windows Vista SP2 - Added 09/2010 */
|
||||
{"Windows 2009", NULL, 0, ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */
|
||||
{"Windows 2012", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8 and Server 2012 - Added 08/2012 */
|
||||
{"Windows 2013", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8.1 and Server 2012 R2 - Added 01/2014 */
|
||||
{"Windows 2013", NULL, 0, ACPI_OSI_WIN_8_1}, /* Windows 8.1 and Server 2012 R2 - Added 01/2014 */
|
||||
{"Windows 2015", NULL, 0, ACPI_OSI_WIN_10}, /* Windows 10 - Added 03/2015 */
|
||||
{"Windows 2016", NULL, 0, ACPI_OSI_WIN_10_RS1}, /* Windows 10 version 1607 - Added 12/2017 */
|
||||
{"Windows 2017", NULL, 0, ACPI_OSI_WIN_10_RS2}, /* Windows 10 version 1703 - Added 12/2017 */
|
||||
{"Windows 2017.2", NULL, 0, ACPI_OSI_WIN_10_RS3}, /* Windows 10 version 1709 - Added 02/2018 */
|
||||
{"Windows 2018", NULL, 0, ACPI_OSI_WIN_10_RS4}, /* Windows 10 version 1803 - Added 11/2018 */
|
||||
{"Windows 2018.2", NULL, 0, ACPI_OSI_WIN_10_RS5}, /* Windows 10 version 1809 - Added 11/2018 */
|
||||
{"Windows 2019", NULL, 0, ACPI_OSI_WIN_10_19H1}, /* Windows 10 version 1903 - Added 08/2019 */
|
||||
|
||||
/* Feature Group Strings */
|
||||
|
||||
|
@ -190,7 +190,7 @@ AcpiUtAllocateOwnerId (
|
||||
if (*OwnerId)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Owner ID [0x%2.2X] already exists", *OwnerId));
|
||||
"Owner ID [0x%3.3X] already exists", *OwnerId));
|
||||
return_ACPI_STATUS (AE_ALREADY_EXISTS);
|
||||
}
|
||||
|
||||
@ -246,13 +246,13 @@ AcpiUtAllocateOwnerId (
|
||||
/*
|
||||
* Construct encoded ID from the index and bit position
|
||||
*
|
||||
* Note: Last [j].k (bit 255) is never used and is marked
|
||||
* Note: Last [j].k (bit 4095) is never used and is marked
|
||||
* permanently allocated (prevents +1 overflow)
|
||||
*/
|
||||
*OwnerId = (ACPI_OWNER_ID) ((k + 1) + ACPI_MUL_32 (j));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_VALUES,
|
||||
"Allocated OwnerId: %2.2X\n", (unsigned int) *OwnerId));
|
||||
"Allocated OwnerId: 0x%3.3X\n", (unsigned int) *OwnerId));
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
@ -272,7 +272,7 @@ AcpiUtAllocateOwnerId (
|
||||
*/
|
||||
Status = AE_OWNER_ID_LIMIT;
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Could not allocate new OwnerId (255 max), AE_OWNER_ID_LIMIT"));
|
||||
"Could not allocate new OwnerId (4095 max), AE_OWNER_ID_LIMIT"));
|
||||
|
||||
Exit:
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_CACHES);
|
||||
@ -315,7 +315,7 @@ AcpiUtReleaseOwnerId (
|
||||
|
||||
if (OwnerId == 0)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Invalid OwnerId: 0x%2.2X", OwnerId));
|
||||
ACPI_ERROR ((AE_INFO, "Invalid OwnerId: 0x%3.3X", OwnerId));
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
@ -345,7 +345,7 @@ AcpiUtReleaseOwnerId (
|
||||
else
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Release of non-allocated OwnerId: 0x%2.2X", OwnerId + 1));
|
||||
"Attempted release of non-allocated OwnerId: 0x%3.3X", OwnerId + 1));
|
||||
}
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_CACHES);
|
||||
|
@ -239,9 +239,9 @@
|
||||
|
||||
#define ACPI_DEFAULT_PAGE_SIZE 4096 /* Must be power of 2 */
|
||||
|
||||
/* OwnerId tracking. 8 entries allows for 255 OwnerIds */
|
||||
/* OwnerId tracking. 128 entries allows for 4095 OwnerIds */
|
||||
|
||||
#define ACPI_NUM_OWNERID_MASKS 8
|
||||
#define ACPI_NUM_OWNERID_MASKS 128
|
||||
|
||||
/* Size of the root table array is increased by this increment */
|
||||
|
||||
|
@ -295,12 +295,12 @@ typedef struct acpi_namespace_node
|
||||
union acpi_operand_object *Object; /* Interpreter object */
|
||||
UINT8 DescriptorType; /* Differentiate object descriptor types */
|
||||
UINT8 Type; /* ACPI Type associated with this name */
|
||||
UINT8 Flags; /* Miscellaneous flags */
|
||||
ACPI_OWNER_ID OwnerId; /* Node creator */
|
||||
UINT16 Flags; /* Miscellaneous flags */
|
||||
ACPI_NAME_UNION Name; /* ACPI Name, always 4 chars per ACPI spec */
|
||||
struct acpi_namespace_node *Parent; /* Parent node */
|
||||
struct acpi_namespace_node *Child; /* First child */
|
||||
struct acpi_namespace_node *Peer; /* First peer */
|
||||
ACPI_OWNER_ID OwnerId; /* Node creator */
|
||||
|
||||
/*
|
||||
* The following fields are used by the ASL compiler and disassembler only
|
||||
|
@ -333,8 +333,8 @@ typedef struct acpi_object_method
|
||||
} Dispatch;
|
||||
|
||||
UINT32 AmlLength;
|
||||
UINT8 ThreadCount;
|
||||
ACPI_OWNER_ID OwnerId;
|
||||
UINT8 ThreadCount;
|
||||
|
||||
} ACPI_OBJECT_METHOD;
|
||||
|
||||
|
@ -577,6 +577,7 @@ AcpiOsEnterSleep (
|
||||
* Debug print routines
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPrintf
|
||||
ACPI_PRINTF_LIKE (1)
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
AcpiOsPrintf (
|
||||
const char *Format,
|
||||
|
@ -154,7 +154,7 @@
|
||||
|
||||
/* Current ACPICA subsystem version in YYYYMMDD format */
|
||||
|
||||
#define ACPI_CA_VERSION 0x20190703
|
||||
#define ACPI_CA_VERSION 0x20190816
|
||||
|
||||
#include "acconfig.h"
|
||||
#include "actypes.h"
|
||||
@ -446,6 +446,9 @@ ACPI_GLOBAL (BOOLEAN, AcpiGbl_SystemAwakeAndRunning);
|
||||
#define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \
|
||||
ACPI_EXTERNAL_RETURN_OK(Prototype)
|
||||
|
||||
#define ACPI_HW_DEPENDENT_RETURN_UINT32(prototype) \
|
||||
ACPI_EXTERNAL_RETURN_UINT32(prototype)
|
||||
|
||||
#define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
|
||||
ACPI_EXTERNAL_RETURN_VOID(Prototype)
|
||||
|
||||
@ -456,6 +459,9 @@ ACPI_GLOBAL (BOOLEAN, AcpiGbl_SystemAwakeAndRunning);
|
||||
#define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \
|
||||
static ACPI_INLINE Prototype {return(AE_OK);}
|
||||
|
||||
#define ACPI_HW_DEPENDENT_RETURN_UINT32(prototype) \
|
||||
static ACPI_INLINE prototype {return(0);}
|
||||
|
||||
#define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
|
||||
static ACPI_INLINE Prototype {return;}
|
||||
|
||||
@ -1076,6 +1082,12 @@ AcpiGetGpeStatus (
|
||||
UINT32 GpeNumber,
|
||||
ACPI_EVENT_STATUS *EventStatus))
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_UINT32 (
|
||||
UINT32
|
||||
AcpiDispatchGpe (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
UINT32 GpeNumber))
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS (
|
||||
ACPI_STATUS
|
||||
AcpiDisableAllGpes (
|
||||
|
@ -327,9 +327,9 @@ typedef struct acpi_evaluate_info
|
||||
UINT32 ReturnFlags; /* Used for return value analysis */
|
||||
UINT32 ReturnBtype; /* Bitmapped type of the returned object */
|
||||
UINT16 ParamCount; /* Count of the input argument list */
|
||||
UINT16 NodeFlags; /* Same as Node->Flags */
|
||||
UINT8 PassNumber; /* Parser pass number */
|
||||
UINT8 ReturnObjectType; /* Object type of the returned object */
|
||||
UINT8 NodeFlags; /* Same as Node->Flags */
|
||||
UINT8 Flags; /* General flags */
|
||||
|
||||
} ACPI_EVALUATE_INFO;
|
||||
|
@ -591,8 +591,8 @@ typedef void * ACPI_HANDLE; /* Actually a ptr to a N
|
||||
|
||||
/* Owner IDs are used to track namespace nodes for selective deletion */
|
||||
|
||||
typedef UINT8 ACPI_OWNER_ID;
|
||||
#define ACPI_OWNER_ID_MAX 0xFF
|
||||
typedef UINT16 ACPI_OWNER_ID;
|
||||
#define ACPI_OWNER_ID_MAX 0xFFF /* 4095 possible owner IDs */
|
||||
|
||||
|
||||
#define ACPI_INTEGER_BIT_SIZE 64
|
||||
@ -657,7 +657,7 @@ typedef UINT64 ACPI_INTEGER;
|
||||
|
||||
/* Pointer/Integer type conversions */
|
||||
|
||||
#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) 0, (ACPI_SIZE) (i))
|
||||
#define ACPI_TO_POINTER(i) ACPI_CAST_PTR (void, (ACPI_SIZE) (i))
|
||||
#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) 0)
|
||||
#define ACPI_OFFSET(d, f) ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) 0)
|
||||
#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
|
||||
@ -1513,12 +1513,14 @@ typedef enum
|
||||
#define ACPI_OSI_WIN_VISTA_SP2 0x0A
|
||||
#define ACPI_OSI_WIN_7 0x0B
|
||||
#define ACPI_OSI_WIN_8 0x0C
|
||||
#define ACPI_OSI_WIN_10 0x0D
|
||||
#define ACPI_OSI_WIN_10_RS1 0x0E
|
||||
#define ACPI_OSI_WIN_10_RS2 0x0F
|
||||
#define ACPI_OSI_WIN_10_RS3 0x10
|
||||
#define ACPI_OSI_WIN_10_RS4 0x11
|
||||
#define ACPI_OSI_WIN_10_RS5 0x12
|
||||
#define ACPI_OSI_WIN_8_1 0x0D
|
||||
#define ACPI_OSI_WIN_10 0x0E
|
||||
#define ACPI_OSI_WIN_10_RS1 0x0F
|
||||
#define ACPI_OSI_WIN_10_RS2 0x10
|
||||
#define ACPI_OSI_WIN_10_RS3 0x11
|
||||
#define ACPI_OSI_WIN_10_RS4 0x12
|
||||
#define ACPI_OSI_WIN_10_RS5 0x13
|
||||
#define ACPI_OSI_WIN_10_19H1 0x14
|
||||
|
||||
|
||||
/* Definitions of getopt */
|
||||
|
@ -1194,30 +1194,33 @@ AcpiUtDeleteAddressLists (
|
||||
/*
|
||||
* utxferror - various error/warning output functions
|
||||
*/
|
||||
ACPI_PRINTF_LIKE(5)
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
AcpiUtPredefinedWarning (
|
||||
const char *ModuleName,
|
||||
UINT32 LineNumber,
|
||||
char *Pathname,
|
||||
UINT8 NodeFlags,
|
||||
UINT16 NodeFlags,
|
||||
const char *Format,
|
||||
...);
|
||||
|
||||
ACPI_PRINTF_LIKE(5)
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
AcpiUtPredefinedInfo (
|
||||
const char *ModuleName,
|
||||
UINT32 LineNumber,
|
||||
char *Pathname,
|
||||
UINT8 NodeFlags,
|
||||
UINT16 NodeFlags,
|
||||
const char *Format,
|
||||
...);
|
||||
|
||||
ACPI_PRINTF_LIKE(5)
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
AcpiUtPredefinedBiosError (
|
||||
const char *ModuleName,
|
||||
UINT32 LineNumber,
|
||||
char *Pathname,
|
||||
UINT8 NodeFlags,
|
||||
UINT16 NodeFlags,
|
||||
const char *Format,
|
||||
...);
|
||||
|
||||
|
@ -287,7 +287,6 @@
|
||||
#pragma warning(disable:4459)
|
||||
|
||||
|
||||
|
||||
/* Debug support. */
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
@ -177,20 +177,27 @@ ApIsExistingFile (
|
||||
{
|
||||
#if !defined(_GNU_EFI) && !defined(_EDK2_EFI)
|
||||
struct stat StatInfo;
|
||||
int InChar;
|
||||
|
||||
|
||||
if (!stat (Pathname, &StatInfo))
|
||||
{
|
||||
fprintf (stderr, "Target path already exists, overwrite? [y|n] ");
|
||||
|
||||
if (getchar () != 'y')
|
||||
InChar = fgetc (stdin);
|
||||
if (InChar == '\n')
|
||||
{
|
||||
InChar = fgetc (stdin);
|
||||
}
|
||||
|
||||
if (InChar != 'y' && InChar != 'Y')
|
||||
{
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -452,7 +452,7 @@ ExecuteOSI (
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
"Return value from _OSI method too small, %.8X\n",
|
||||
ReturnValue.Length);
|
||||
(UINT32) ReturnValue.Length);
|
||||
goto ErrorExit;
|
||||
}
|
||||
|
||||
|
@ -576,7 +576,7 @@ ExecuteOSI (
|
||||
if (ReturnValue.Length < sizeof (ACPI_OBJECT))
|
||||
{
|
||||
AcpiOsPrintf ("Return value from _OSI method too small, %.8X\n",
|
||||
ReturnValue.Length);
|
||||
(UINT32) ReturnValue.Length);
|
||||
goto ErrorExit;
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,34 @@
|
||||
# Before running this file, we assume we have generated all tables by running
|
||||
# the command `iasl -T ALL`
|
||||
#
|
||||
# Note: the NAME flag is required when running the test
|
||||
|
||||
aml_obj=$(NAME).aml
|
||||
dsl_obj=$(NAME).dsl
|
||||
aml_obj2=$(NAME)_recomp.aml
|
||||
|
||||
|
||||
all: $(aml_obj2)
|
||||
|
||||
# recompile and binary compare
|
||||
$(aml_obj2): %_recomp.aml: %.dsl
|
||||
iasl -p `basename $@` $< > /dev/null 2> /dev/null
|
||||
acpibin -c $@ $(patsubst %_recomp.aml,%.aml,$@) > /dev/null 2> /dev/null
|
||||
printf "Data table %s PASS\n" $(basename $< .dsl)
|
||||
|
||||
# disassemble
|
||||
$(dsl_obj): %.dsl: %.aml
|
||||
iasl -d $< > /dev/null 2> /dev/null
|
||||
|
||||
# initial compile
|
||||
$(aml_obj): %.aml: %.asl
|
||||
iasl $< > /dev/null 2> /dev/null
|
||||
|
||||
PROG= templates
|
||||
|
||||
templates :
|
||||
sh templates.sh
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f *.asl *.aml *.dsl *.hex diff.log
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user