mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
Import ACPICA 20140828.
This commit is contained in:
parent
e599b42ef5
commit
754171ae60
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor-sys/acpica/dist/; revision=271440 svn path=/vendor-sys/acpica/20140828/; revision=271441; tag=vendor/acpica/20140828
155
changes.txt
155
changes.txt
@ -1,3 +1,158 @@
|
||||
----------------------------------------
|
||||
28 August 2014. Summary of changes for version 20140828:
|
||||
|
||||
1) ACPICA kernel-resident subsystem:
|
||||
|
||||
Fixed a problem related to the internal use of the Timer() operator where
|
||||
a 64-bit divide could cause an attempted link to a double-precision math
|
||||
library. This divide is not actually necessary, so the code was
|
||||
restructured to eliminate it. Lv Zheng.
|
||||
|
||||
ACPI 5.1: Added support for the runtime validation of the _DSD package
|
||||
(similar to the iASL support).
|
||||
|
||||
ACPI 5.1/Headers: Added support for the GICC affinity subtable to the
|
||||
SRAT table. Hanjun Guo <hanjun.guo@linaro.org>.
|
||||
|
||||
Example Code and Data Size: These are the sizes for the OS-independent
|
||||
acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
|
||||
debug version of the code includes the debug output trace mechanism and
|
||||
has a much larger code and data size.
|
||||
|
||||
Current Release:
|
||||
Non-Debug Version: 98.8K Code, 27.3K Data, 126.1K Total
|
||||
Debug Version: 192.1K Code, 79.8K Data, 271.9K Total
|
||||
Previous Release:
|
||||
Non-Debug Version: 98.7K Code, 27.3K Data, 126.0K Total1
|
||||
Debug Version: 192.0K Code, 79.7K Data, 271.7K Total
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
AcpiExec: Fixed a problem on unix systems where the original terminal
|
||||
state was not always properly restored upon exit. Seen when using the -v
|
||||
option. ACPICA BZ 1104.
|
||||
|
||||
iASL: Fixed a problem with the validation of the ranges/length within the
|
||||
Memory24 resource descriptor. There was a boundary condition when the
|
||||
range was equal to the (length -1) caused by the fact that these values
|
||||
are defined in 256-byte blocks, not bytes. ACPICA BZ 1098
|
||||
|
||||
Disassembler: Fixed a problem with the GpioInt descriptor interrupt polarity
|
||||
flags. The flags are actually 2 bits, not 1, and the "ActiveBoth" keyword is
|
||||
now supported properly.
|
||||
|
||||
ACPI 5.1: Added the GICC affinity subtable to the SRAT table. Supported
|
||||
in the disassembler, data table compiler, and table template generator.
|
||||
|
||||
iASL: Added a requirement for Device() objects that one of either a _HID
|
||||
or _ADR must exist within the scope of a Device, as per the ACPI
|
||||
specification. Remove a similar requirement that was incorrectly in place
|
||||
for the _DSD object.
|
||||
|
||||
iASL: Added error detection for illegal named references within control
|
||||
methods that would cause runtime failures. Now trapped as errors are: 1)
|
||||
References to objects within a non-parent control method. 2) Forward
|
||||
references (within a method) -- for control methods, AML interpreters use
|
||||
a one-pass parse of control methods. ACPICA BZ 1008.
|
||||
|
||||
iASL: Added error checking for dependencies related to the _PSx power
|
||||
methods. ACPICA BZ 1029.
|
||||
1) For _PS0, one of these must exist within the same scope: _PS1, _PS2,
|
||||
_PS3.
|
||||
2) For _PS1, _PS2, and PS3: A _PS0 object must exist within the same
|
||||
scope.
|
||||
|
||||
iASL and table compiler: Cleanup miscellaneous memory leaks by fully
|
||||
deploying the existing object and string caches and adding new caches for
|
||||
the table compiler.
|
||||
|
||||
iASL: Split the huge parser source file into multiple subfiles to improve
|
||||
manageability. Generation now requires the M4 macro preprocessor, which
|
||||
is part of the Bison distribution on both unix and windows platforms.
|
||||
|
||||
AcpiSrc: Fixed and removed all extraneous warnings generated during
|
||||
entire ACPICA source code scan and/or conversion.
|
||||
|
||||
|
||||
----------------------------------------
|
||||
|
||||
24 July 2014. Summary of changes for version 20140724:
|
||||
|
||||
The ACPI 5.1 specification has been released and is available at:
|
||||
http://uefi.org/specs/access
|
||||
|
||||
|
||||
0) ACPI 5.1 support in ACPICA:
|
||||
|
||||
ACPI 5.1 is fully supported in ACPICA as of this release.
|
||||
|
||||
New predefined names. Support includes iASL and runtime ACPICA
|
||||
validation.
|
||||
_CCA (Cache Coherency Attribute).
|
||||
_DSD (Device-Specific Data). David Box.
|
||||
|
||||
Modifications to existing ACPI tables. Support includes headers, iASL
|
||||
Data Table compiler, disassembler, and the template generator.
|
||||
FADT - New fields and flags. Graeme Gregory.
|
||||
GTDT - One new subtable and new fields. Tomasz Nowicki.
|
||||
MADT - Two new subtables. Tomasz Nowicki.
|
||||
PCCT - One new subtable.
|
||||
|
||||
Miscellaneous.
|
||||
New notification type for System Resource Affinity change events.
|
||||
|
||||
|
||||
1) ACPICA kernel-resident subsystem:
|
||||
|
||||
Fixed a regression introduced in 20140627 where a fault can happen during
|
||||
the deletion of Alias AML namespace objects. The problem affected both
|
||||
the core ACPICA and the ACPICA tools including iASL and AcpiExec.
|
||||
|
||||
Implemented a new GPE public interface, AcpiMarkGpeForWake. Provides a
|
||||
simple mechanism to enable wake GPEs that have no associated handler or
|
||||
control method. Rafael Wysocki.
|
||||
|
||||
Updated the AcpiEnableGpe interface to disallow the enable if there is no
|
||||
handler or control method associated with the particular GPE. This will
|
||||
help avoid meaningless GPEs and even GPE floods. Rafael Wysocki.
|
||||
|
||||
Updated GPE handling and dispatch by disabling the GPE before clearing
|
||||
the status bit for edge-triggered GPEs. Lv Zheng.
|
||||
|
||||
Added Timer() support to the AML Debug object. The current timer value is
|
||||
now displayed with each invocation of (Store to) the debug object to
|
||||
enable simple generation of execution times for AML code (method
|
||||
execution for example.) ACPICA BZ 1093.
|
||||
|
||||
Example Code and Data Size: These are the sizes for the OS-independent
|
||||
acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
|
||||
debug version of the code includes the debug output trace mechanism and
|
||||
has a much larger code and data size.
|
||||
|
||||
Current Release:
|
||||
Non-Debug Version: 98.7K Code, 27.3K Data, 126.0K Total
|
||||
Debug Version: 192.0K Code, 79.7K Data, 271.7K Total
|
||||
Previous Release:
|
||||
Non-Debug Version: 98.7K Code, 27.2K Data, 125.9K Total
|
||||
Debug Version: 191.7K Code, 79.6K Data, 271.3K Total
|
||||
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
Fixed an issue with the recently added local printf implementation,
|
||||
concerning width/precision specifiers that could cause incorrect output.
|
||||
Lv Zheng. ACPICA BZ 1094.
|
||||
|
||||
Disassembler: Added support to detect buffers that contain UUIDs and
|
||||
disassemble them to an invocation of the ToUUID operator. Also emit
|
||||
commented descriptions of known ACPI-related UUIDs.
|
||||
|
||||
AcpiHelp: Added support to display known ACPI-related UUIDs. New option,
|
||||
-u. Adds three new files.
|
||||
|
||||
iASL: Update table compiler and disassembler for DMAR table changes that
|
||||
were introduced in September 2013. With assistance by David Woodhouse.
|
||||
|
||||
----------------------------------------
|
||||
27 June 2014. Summary of changes for version 20140627:
|
||||
|
||||
|
@ -206,6 +206,8 @@ endif
|
||||
# -Wconversion\
|
||||
# -Wshadow\
|
||||
|
||||
#
|
||||
# M4 macro processor is used to build the final parser file
|
||||
#
|
||||
# Bison/Flex configuration
|
||||
#
|
||||
@ -226,6 +228,9 @@ endif
|
||||
YACC= bison
|
||||
YFLAGS += -y
|
||||
|
||||
MACROPROC= m4
|
||||
MFLAGS= -P -I$(ASL_COMPILER)
|
||||
|
||||
LEX= flex
|
||||
LFLAGS += -i -s
|
||||
|
||||
|
@ -138,6 +138,7 @@ OBJECTS = \
|
||||
$(OBJDIR)/uteval.o\
|
||||
$(OBJDIR)/utexcep.o\
|
||||
$(OBJDIR)/utglobal.o\
|
||||
$(OBJDIR)/uthex.o\
|
||||
$(OBJDIR)/utids.o\
|
||||
$(OBJDIR)/utinit.o\
|
||||
$(OBJDIR)/utlock.o\
|
||||
|
@ -45,6 +45,7 @@ OBJECTS = \
|
||||
$(OBJDIR)/aemain.o\
|
||||
$(OBJDIR)/aetables.o\
|
||||
$(OBJDIR)/ahids.o\
|
||||
$(OBJDIR)/ahuuids.o\
|
||||
$(OBJDIR)/cmfsize.o\
|
||||
$(OBJDIR)/dbcmds.o\
|
||||
$(OBJDIR)/dbconvert.o\
|
||||
@ -204,6 +205,7 @@ OBJECTS = \
|
||||
$(OBJDIR)/utexcep.o\
|
||||
$(OBJDIR)/utfileio.o\
|
||||
$(OBJDIR)/utglobal.o\
|
||||
$(OBJDIR)/uthex.o\
|
||||
$(OBJDIR)/utids.o\
|
||||
$(OBJDIR)/utinit.o\
|
||||
$(OBJDIR)/utlock.o\
|
||||
@ -219,6 +221,7 @@ OBJECTS = \
|
||||
$(OBJDIR)/utstate.o\
|
||||
$(OBJDIR)/utstring.o\
|
||||
$(OBJDIR)/uttrack.o\
|
||||
$(OBJDIR)/utuuid.o\
|
||||
$(OBJDIR)/utxface.o\
|
||||
$(OBJDIR)/utxferror.o\
|
||||
$(OBJDIR)/utxfinit.o\
|
||||
|
@ -35,15 +35,18 @@ OBJECTS = \
|
||||
$(OBJDIR)/ahids.o\
|
||||
$(OBJDIR)/ahpredef.o\
|
||||
$(OBJDIR)/ahmain.o\
|
||||
$(OBJDIR)/ahuuids.o\
|
||||
$(OBJDIR)/getopt.o\
|
||||
$(OBJDIR)/oslibcfs.o\
|
||||
$(OBJDIR)/osunixxf.o\
|
||||
$(OBJDIR)/utdebug.o\
|
||||
$(OBJDIR)/utexcep.o\
|
||||
$(OBJDIR)/utglobal.o\
|
||||
$(OBJDIR)/uthex.o\
|
||||
$(OBJDIR)/utmath.o\
|
||||
$(OBJDIR)/utpredef.o\
|
||||
$(OBJDIR)/utprint.o
|
||||
$(OBJDIR)/utprint.o\
|
||||
$(OBJDIR)/utuuid.o
|
||||
|
||||
#
|
||||
# Flags specific to acpihelp
|
||||
|
@ -103,6 +103,7 @@ OBJECTS = \
|
||||
$(OBJDIR)/utexcep.o\
|
||||
$(OBJDIR)/utfileio.o\
|
||||
$(OBJDIR)/utglobal.o\
|
||||
$(OBJDIR)/uthex.o\
|
||||
$(OBJDIR)/utids.o\
|
||||
$(OBJDIR)/utinit.o\
|
||||
$(OBJDIR)/utlock.o\
|
||||
|
@ -48,7 +48,9 @@ OBJECTS = \
|
||||
$(OBJDIR)/adwalk.o\
|
||||
$(OBJDIR)/ahids.o\
|
||||
$(OBJDIR)/ahpredef.o\
|
||||
$(OBJDIR)/ahuuids.o\
|
||||
$(OBJDIR)/aslanalyze.o\
|
||||
$(OBJDIR)/aslascii.o\
|
||||
$(OBJDIR)/aslbtypes.o\
|
||||
$(OBJDIR)/aslcodegen.o\
|
||||
$(OBJDIR)/aslcompile.o\
|
||||
@ -193,6 +195,7 @@ OBJECTS = \
|
||||
$(OBJDIR)/utexcep.o\
|
||||
$(OBJDIR)/utfileio.o\
|
||||
$(OBJDIR)/utglobal.o\
|
||||
$(OBJDIR)/uthex.o\
|
||||
$(OBJDIR)/utinit.o\
|
||||
$(OBJDIR)/utlock.o\
|
||||
$(OBJDIR)/utmath.o\
|
||||
@ -205,10 +208,12 @@ OBJECTS = \
|
||||
$(OBJDIR)/utresrc.o\
|
||||
$(OBJDIR)/utstate.o\
|
||||
$(OBJDIR)/utstring.o\
|
||||
$(OBJDIR)/utuuid.o\
|
||||
$(OBJDIR)/utxface.o\
|
||||
$(OBJDIR)/utxferror.o
|
||||
|
||||
INTERMEDIATES = \
|
||||
$(OBJDIR)/aslcompiler.y\
|
||||
$(OBJDIR)/aslcompilerlex.c\
|
||||
$(OBJDIR)/aslcompilerparse.c\
|
||||
$(OBJDIR)/dtparserlex.c\
|
||||
@ -221,6 +226,18 @@ MISC = \
|
||||
$(OBJDIR)/dtparser.y.h\
|
||||
$(OBJDIR)/prparser.y.h
|
||||
|
||||
ASL_PARSER = \
|
||||
$(ASL_COMPILER)/aslparser.y\
|
||||
$(ASL_COMPILER)/asltokens.y\
|
||||
$(ASL_COMPILER)/asltypes.y\
|
||||
$(ASL_COMPILER)/aslrules.y
|
||||
|
||||
ASL_LEXER = \
|
||||
$(ASL_COMPILER)/aslcompiler.l\
|
||||
$(ASL_COMPILER)/aslsupport.l\
|
||||
$(OBJDIR)/aslcompiler.y.h
|
||||
|
||||
|
||||
#
|
||||
# Flags specific to iASL compiler
|
||||
#
|
||||
@ -234,17 +251,22 @@ CFLAGS += \
|
||||
#
|
||||
include ../Makefile.rules
|
||||
|
||||
#
|
||||
# Macro processing for iASL .y files
|
||||
#
|
||||
$(OBJDIR)/aslcompiler.y : $(ASL_PARSER)
|
||||
$(MACROPROC) $(MFLAGS) $(ASL_COMPILER)/aslparser.y > $(OBJDIR)/aslcompiler.y
|
||||
|
||||
#
|
||||
# Parser and Lexer - intermediate C files
|
||||
#
|
||||
$(OBJDIR)/aslcompilerlex.c : $(ASL_COMPILER)/aslcompiler.l $(ASL_COMPILER)/aslsupport.l $(OBJDIR)/aslcompiler.y.h
|
||||
$(OBJDIR)/aslcompilerlex.c : $(ASL_LEXER)
|
||||
$(LEX) $(LFLAGS) -PAslCompiler -o$@ $(ASL_COMPILER)/aslcompiler.l
|
||||
|
||||
$(OBJDIR)/aslcompiler.y.h : $(ASL_COMPILER)/aslcompiler.y
|
||||
$(OBJDIR)/aslcompiler.y.h : $(OBJDIR)/aslcompiler.y
|
||||
$(YACC) $(YFLAGS) -pAslCompiler -o/dev/null --defines=$@ $<
|
||||
|
||||
$(OBJDIR)/aslcompilerparse.c : $(ASL_COMPILER)/aslcompiler.y
|
||||
$(OBJDIR)/aslcompilerparse.c : $(OBJDIR)/aslcompiler.y
|
||||
$(YACC) $(YFLAGS) -pAslCompiler -o$@ --defines=/dev/null $<
|
||||
|
||||
$(OBJDIR)/dtparserlex.c : $(ASL_COMPILER)/dtparser.l $(OBJDIR)/dtparser.y.h
|
||||
|
@ -41,7 +41,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acapps.h"
|
||||
@ -206,7 +206,7 @@ FlGenerateFilename (
|
||||
* Copy the original filename to a new buffer. Leave room for the worst
|
||||
* case where we append the suffix, an added dot and the null terminator.
|
||||
*/
|
||||
NewFilename = ACPI_ALLOCATE_ZEROED ((ACPI_SIZE)
|
||||
NewFilename = UtStringCacheCalloc ((ACPI_SIZE)
|
||||
strlen (InputFilename) + strlen (Suffix) + 2);
|
||||
if (!NewFilename)
|
||||
{
|
||||
@ -255,7 +255,7 @@ FlStrdup (
|
||||
char *NewString;
|
||||
|
||||
|
||||
NewString = ACPI_ALLOCATE ((ACPI_SIZE) strlen (String) + 1);
|
||||
NewString = UtStringCacheCalloc ((ACPI_SIZE) strlen (String) + 1);
|
||||
if (!NewString)
|
||||
{
|
||||
return (NULL);
|
||||
@ -337,7 +337,6 @@ FlSplitInputPathname (
|
||||
|
||||
if (!Filename)
|
||||
{
|
||||
ACPI_FREE (DirectoryPath);
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
@ -349,6 +348,5 @@ FlSplitInputPathname (
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_FREE (Filename);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
@ -41,12 +41,9 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "aslcompiler.h"
|
||||
#include "acparser.h"
|
||||
#include "amlcode.h"
|
||||
#include "acdebug.h"
|
||||
#include "acdisasm.h"
|
||||
#include "acdispat.h"
|
||||
#include "acnamesp.h"
|
||||
@ -60,23 +57,6 @@
|
||||
#define _COMPONENT ACPI_TOOLS
|
||||
ACPI_MODULE_NAME ("adisasm")
|
||||
|
||||
/*
|
||||
* Older versions of Bison won't emit this external in the generated header.
|
||||
* Newer versions do emit the external, so we don't need to do it.
|
||||
*/
|
||||
#ifndef ASLCOMPILER_ASLCOMPILERPARSE_H
|
||||
extern int AslCompilerdebug;
|
||||
#endif
|
||||
|
||||
ACPI_STATUS
|
||||
NsDisplayNamespace (
|
||||
void);
|
||||
|
||||
void
|
||||
NsSetupNamespaceListing (
|
||||
void *Handle);
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
@ -654,7 +634,7 @@ AdCreateTableHeader (
|
||||
}
|
||||
else
|
||||
{
|
||||
NewFilename = ACPI_ALLOCATE_ZEROED (9);
|
||||
NewFilename = UtStringCacheCalloc (9);
|
||||
if (NewFilename)
|
||||
{
|
||||
strncat (NewFilename, Table->Signature, 4);
|
||||
@ -674,8 +654,6 @@ AdCreateTableHeader (
|
||||
"DefinitionBlock (\"%s\", \"%4.4s\", %hu, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
|
||||
NewFilename, Table->Signature, Table->Revision,
|
||||
Table->OemId, Table->OemTableId, Table->OemRevision);
|
||||
|
||||
ACPI_FREE (NewFilename);
|
||||
}
|
||||
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acparser.h"
|
||||
|
@ -174,7 +174,11 @@ const AH_DEVICE_ID AslDeviceIds[] =
|
||||
{"PNP0C60", "Display Sensor Device"},
|
||||
{"PNP0C70", "Dock Sensor Device"},
|
||||
{"PNP0C80", "Memory Device"},
|
||||
{"PNP0D40", "Standard Compliant SD Host Controller"},
|
||||
{"PNP0D10", "XHCI USB Controller with debug"},
|
||||
{"PNP0D15", "XHCI USB Controller without debug"},
|
||||
{"PNP0D20", "EHCI USB Controller without debug"},
|
||||
{"PNP0D25", "EHCI USB Controller with debug"},
|
||||
{"PNP0D40", "SDA Standard Compliant SD Host Controller"},
|
||||
{"PNP0D80", "Windows-compatible System Power Management Controller"},
|
||||
{"PNP0F03", "Microsoft PS/2-style Mouse"},
|
||||
{"SMO91D0", "Sensor Hub"},
|
||||
|
@ -97,6 +97,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
|
||||
AH_PREDEF ("_BTM", "Battery Time", "Returns the battery runtime"),
|
||||
AH_PREDEF ("_BTP", "Battery Trip Point", "Sets a Control Method Battery trip point"),
|
||||
AH_PREDEF ("_CBA", "Configuration Base Address", "Sets the base address for a PCI Express host bridge"),
|
||||
AH_PREDEF ("_CCA", "Cache Coherency Attribute", "Returns a device's support level for cache coherency"),
|
||||
AH_PREDEF ("_CDM", "Clock Domain", "Returns a logical processor's clock domain identifier"),
|
||||
AH_PREDEF ("_CID", "Compatible ID", "Returns a device's Plug and Play Compatible ID list"),
|
||||
AH_PREDEF ("_CLS", "Class Code", "Returns PCI class code and subclass"),
|
||||
@ -121,6 +122,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
|
||||
AH_PREDEF ("_DOS", "Disable Output Switching", "Sets the display output switching mode"),
|
||||
AH_PREDEF ("_DPL", "Device Selection Polarity", "Polarity of Device Selection signal, Resource Descriptor field"),
|
||||
AH_PREDEF ("_DRS", "Drive Strength", "Drive Strength setting for GPIO connection, Resource Descriptor field"),
|
||||
AH_PREDEF ("_DSD", "Device-Specific Data", "Returns a list of device property information"),
|
||||
AH_PREDEF ("_DSM", "Device-Specific Method", "Executes device-specific functions"),
|
||||
AH_PREDEF ("_DSS", "Device Set State", "Sets the display device state"),
|
||||
AH_PREDEF ("_DSW", "Device Sleep Wake", "Sets the sleep and wake transition states for a device"),
|
||||
|
132
source/common/ahuuids.c
Normal file
132
source/common/ahuuids.c
Normal file
@ -0,0 +1,132 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: ahuuids - Table of known ACPI-related UUIDs
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* NO WARRANTY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
|
||||
#define _COMPONENT ACPI_UTILITIES
|
||||
ACPI_MODULE_NAME ("ahuuids")
|
||||
|
||||
/*
|
||||
* Table of "known" (ACPI-related) UUIDs
|
||||
*/
|
||||
const AH_UUID AcpiUuids[] =
|
||||
{
|
||||
{"PCI Host Bridge Device",
|
||||
"33db4d5b-1ff7-401c-9657-7441c03dd766"},
|
||||
|
||||
{"Platform-wide Capabilities",
|
||||
"0811b06e-4a27-44f9-8d60-3cbbc22e7b48"},
|
||||
|
||||
{"Dynamic Enumeration",
|
||||
"d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf"},
|
||||
|
||||
{"GPIO Controller",
|
||||
"4f248f40-d5e2-499f-834c-27758ea1cd3f"},
|
||||
|
||||
{"Battery Thermal Limit",
|
||||
"4c2067e3-887d-475c-9720-4af1d3ed602e"},
|
||||
|
||||
{"Thermal Extensions",
|
||||
"14d399cd-7a27-4b18-8fb4-7cb7b9f4e500"},
|
||||
|
||||
{"USB Controller",
|
||||
"ce2ee385-00e6-48cb-9f05-2edb927c4899"},
|
||||
|
||||
{"HID I2C Device",
|
||||
"3cdff6f7-4267-4555-ad05-b30a3d8938de"},
|
||||
|
||||
{"Power Button Device",
|
||||
"dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c"},
|
||||
|
||||
{"Device Labeling Interface",
|
||||
"e5c937d0-3553-4d7a-9117-ea4d19c3434d"},
|
||||
|
||||
{"SATA Controller",
|
||||
"e4db149b-fcfe-425b-a6d8-92357d78fc7f"},
|
||||
|
||||
{"Physical Presence Interface",
|
||||
"3dddfaa6-361b-4eb4-a424-8d10089d1653"},
|
||||
|
||||
{"Device Properties for _DSD",
|
||||
"daffd814-6eba-4d8c-8a91-bc9bbf4aa301"},
|
||||
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiAhMatchUuid
|
||||
*
|
||||
* PARAMETERS: Data - Data buffer containing a UUID
|
||||
*
|
||||
* RETURN: ASCII description string for the UUID if it is found.
|
||||
*
|
||||
* DESCRIPTION: Returns a description string for "known" UUIDs, which are
|
||||
* are UUIDs that are related to ACPI in some way.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
const char *
|
||||
AcpiAhMatchUuid (
|
||||
UINT8 *Data)
|
||||
{
|
||||
const AH_UUID *Info;
|
||||
UINT8 UuidBuffer[UUID_BUFFER_LENGTH];
|
||||
|
||||
|
||||
/* Walk the table of known ACPI-related UUIDs */
|
||||
|
||||
for (Info = AcpiUuids; Info->Description; Info++)
|
||||
{
|
||||
AcpiUtConvertStringToUuid (Info->String, UuidBuffer);
|
||||
|
||||
if (!ACPI_MEMCMP (Data, UuidBuffer, UUID_BUFFER_LENGTH))
|
||||
{
|
||||
return (Info->Description);
|
||||
}
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
}
|
@ -406,18 +406,37 @@ AcpiDmGetExternalsFromFile (
|
||||
while (fgets (StringBuffer, ASL_MSG_BUFFER_SIZE, ExternalRefFile))
|
||||
{
|
||||
Token = strtok (StringBuffer, METHOD_SEPARATORS); /* "External" */
|
||||
if (!Token) continue;
|
||||
if (strcmp (Token, "External")) continue;
|
||||
if (!Token)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (strcmp (Token, "External"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
MethodName = strtok (NULL, METHOD_SEPARATORS); /* Method namepath */
|
||||
if (!MethodName) continue;
|
||||
if (!MethodName)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Token = strtok (NULL, METHOD_SEPARATORS); /* "MethodObj" */
|
||||
if (!Token) continue;
|
||||
if (strcmp (Token, "MethodObj")) continue;
|
||||
if (!Token)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strcmp (Token, "MethodObj"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Token = strtok (NULL, METHOD_SEPARATORS); /* Arg count */
|
||||
if (!Token) continue;
|
||||
if (!Token)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Convert arg count string to an integer */
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acparser.h"
|
||||
|
@ -87,9 +87,21 @@ static const char *AcpiDmDmarSubnames[] =
|
||||
"Reserved Memory Region",
|
||||
"Root Port ATS Capability",
|
||||
"Remapping Hardware Static Affinity",
|
||||
"ACPI Namespace Device Declaration",
|
||||
"Unknown SubTable Type" /* Reserved */
|
||||
};
|
||||
|
||||
static const char *AcpiDmDmarScope[] =
|
||||
{
|
||||
"Reserved value",
|
||||
"PCI Endpoint Device",
|
||||
"PCI Bridge Device",
|
||||
"IOAPIC Device",
|
||||
"Message-capable HPET Device",
|
||||
"Namespace Device",
|
||||
"Unknown Scope Type" /* Reserved */
|
||||
};
|
||||
|
||||
static const char *AcpiDmEinjActions[] =
|
||||
{
|
||||
"Begin Operation",
|
||||
@ -160,6 +172,13 @@ static const char *AcpiDmErstInstructions[] =
|
||||
"Unknown Instruction"
|
||||
};
|
||||
|
||||
static const char *AcpiDmGtdtSubnames[] =
|
||||
{
|
||||
"Generic Timer Block",
|
||||
"Generic Watchdog Timer",
|
||||
"Unknown SubTable Type" /* Reserved */
|
||||
};
|
||||
|
||||
static const char *AcpiDmHestSubnames[] =
|
||||
{
|
||||
"IA-32 Machine Check Exception",
|
||||
@ -189,25 +208,28 @@ static const char *AcpiDmHestNotifySubnames[] =
|
||||
|
||||
static const char *AcpiDmMadtSubnames[] =
|
||||
{
|
||||
"Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */
|
||||
"I/O APIC", /* ACPI_MADT_TYPE_IO_APIC */
|
||||
"Interrupt Source Override", /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */
|
||||
"NMI Source", /* ACPI_MADT_TYPE_NMI_SOURCE */
|
||||
"Local APIC NMI", /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */
|
||||
"Local APIC Address Override", /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */
|
||||
"I/O SAPIC", /* ACPI_MADT_TYPE_IO_SAPIC */
|
||||
"Local SAPIC", /* ACPI_MADT_TYPE_LOCAL_SAPIC */
|
||||
"Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */
|
||||
"Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */
|
||||
"Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */
|
||||
"Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */
|
||||
"Generic Interrupt Distributor",/* ACPI_MADT_GENERIC_DISTRIBUTOR */
|
||||
"Unknown SubTable Type" /* Reserved */
|
||||
"Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */
|
||||
"I/O APIC", /* ACPI_MADT_TYPE_IO_APIC */
|
||||
"Interrupt Source Override", /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */
|
||||
"NMI Source", /* ACPI_MADT_TYPE_NMI_SOURCE */
|
||||
"Local APIC NMI", /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */
|
||||
"Local APIC Address Override", /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */
|
||||
"I/O SAPIC", /* ACPI_MADT_TYPE_IO_SAPIC */
|
||||
"Local SAPIC", /* ACPI_MADT_TYPE_LOCAL_SAPIC */
|
||||
"Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */
|
||||
"Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */
|
||||
"Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */
|
||||
"Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */
|
||||
"Generic Interrupt Distributor", /* ACPI_MADT_GENERIC_DISTRIBUTOR */
|
||||
"Generic MSI Frame", /* ACPI_MADT_GENERIC_MSI_FRAME */
|
||||
"Generic Interrupt Redistributor", /* ACPI_MADT_GENERIC_REDISTRIBUTOR */
|
||||
"Unknown SubTable Type" /* Reserved */
|
||||
};
|
||||
|
||||
static const char *AcpiDmPcctSubnames[] =
|
||||
{
|
||||
"Generic Communications Subspace", /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */
|
||||
"HW-Reduced Communications Subspace",
|
||||
"Unknown SubTable Type" /* Reserved */
|
||||
};
|
||||
|
||||
@ -231,6 +253,7 @@ static const char *AcpiDmSratSubnames[] =
|
||||
"Processor Local APIC/SAPIC Affinity",
|
||||
"Memory Affinity",
|
||||
"Processor Local x2APIC Affinity",
|
||||
"GICC Affinity",
|
||||
"Unknown SubTable Type" /* Reserved */
|
||||
};
|
||||
|
||||
@ -306,7 +329,7 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] =
|
||||
{ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst, "Error Record Serialization Table"},
|
||||
{ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt, "Fixed ACPI Description Table (FADT)"},
|
||||
{ACPI_SIG_FPDT, NULL, AcpiDmDumpFpdt, DtCompileFpdt, TemplateFpdt, "Firmware Performance Data Table"},
|
||||
{ACPI_SIG_GTDT, AcpiDmTableInfoGtdt, NULL, NULL, TemplateGtdt, "Generic Timer Description Table"},
|
||||
{ACPI_SIG_GTDT, NULL, AcpiDmDumpGtdt, DtCompileGtdt, TemplateGtdt, "Generic Timer Description Table"},
|
||||
{ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest, "Hardware Error Source Table"},
|
||||
{ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet, "High Precision Event Timer table"},
|
||||
{ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs, "I/O Virtualization Reporting Structure"},
|
||||
@ -705,6 +728,7 @@ AcpiDmDumpTable (
|
||||
case ACPI_DMT_SPACEID:
|
||||
case ACPI_DMT_ACCWIDTH:
|
||||
case ACPI_DMT_IVRS:
|
||||
case ACPI_DMT_GTDT:
|
||||
case ACPI_DMT_MADT:
|
||||
case ACPI_DMT_PCCT:
|
||||
case ACPI_DMT_PMTT:
|
||||
@ -716,6 +740,7 @@ AcpiDmDumpTable (
|
||||
case ACPI_DMT_EINJINST:
|
||||
case ACPI_DMT_ERSTACT:
|
||||
case ACPI_DMT_ERSTINST:
|
||||
case ACPI_DMT_DMAR_SCOPE:
|
||||
|
||||
ByteLength = 1;
|
||||
break;
|
||||
@ -1047,6 +1072,19 @@ AcpiDmDumpTable (
|
||||
AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_DMAR_SCOPE:
|
||||
|
||||
/* DMAR device scope types */
|
||||
|
||||
Temp8 = *Target;
|
||||
if (Temp8 > ACPI_DMAR_SCOPE_TYPE_RESERVED)
|
||||
{
|
||||
Temp8 = ACPI_DMAR_SCOPE_TYPE_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmDmarScope[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_EINJACT:
|
||||
|
||||
/* EINJ Action types */
|
||||
@ -1099,6 +1137,19 @@ AcpiDmDumpTable (
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstInstructions[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_GTDT:
|
||||
|
||||
/* GTDT subtable types */
|
||||
|
||||
Temp8 = *Target;
|
||||
if (Temp8 > ACPI_GTDT_TYPE_RESERVED)
|
||||
{
|
||||
Temp8 = ACPI_GTDT_TYPE_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGtdtSubnames[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_HEST:
|
||||
|
||||
/* HEST subtable types */
|
||||
|
@ -891,18 +891,24 @@ AcpiDmDumpDmar (
|
||||
ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY);
|
||||
break;
|
||||
|
||||
case ACPI_DMAR_TYPE_ATSR:
|
||||
case ACPI_DMAR_TYPE_ROOT_ATS:
|
||||
|
||||
InfoTable = AcpiDmTableInfoDmar2;
|
||||
ScopeOffset = sizeof (ACPI_DMAR_ATSR);
|
||||
break;
|
||||
|
||||
case ACPI_DMAR_HARDWARE_AFFINITY:
|
||||
case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
|
||||
|
||||
InfoTable = AcpiDmTableInfoDmar3;
|
||||
ScopeOffset = sizeof (ACPI_DMAR_RHSA);
|
||||
break;
|
||||
|
||||
case ACPI_DMAR_TYPE_NAMESPACE:
|
||||
|
||||
InfoTable = AcpiDmTableInfoDmar4;
|
||||
ScopeOffset = sizeof (ACPI_DMAR_ANDD);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", SubTable->Type);
|
||||
@ -916,7 +922,16 @@ AcpiDmDumpDmar (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Dump the device scope entries (if any) */
|
||||
/*
|
||||
* Dump the optional device scope entries
|
||||
*/
|
||||
if ((SubTable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
|
||||
(SubTable->Type == ACPI_DMAR_TYPE_NAMESPACE))
|
||||
{
|
||||
/* These types do not support device scopes */
|
||||
|
||||
goto NextSubtable;
|
||||
}
|
||||
|
||||
ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset);
|
||||
while (ScopeOffset < SubTable->Length)
|
||||
@ -956,6 +971,7 @@ AcpiDmDumpDmar (
|
||||
ScopeTable, ScopeTable->Length);
|
||||
}
|
||||
|
||||
NextSubtable:
|
||||
/* Point to next subtable */
|
||||
|
||||
Offset += SubTable->Length;
|
||||
@ -1153,6 +1169,123 @@ AcpiDmDumpFpdt (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpGtdt
|
||||
*
|
||||
* PARAMETERS: Table - A GTDT table
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Format the contents of a GTDT. This table type consists
|
||||
* of an open-ended number of subtables.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDmDumpGtdt (
|
||||
ACPI_TABLE_HEADER *Table)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_GTDT_HEADER *SubTable;
|
||||
UINT32 Length = Table->Length;
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_GTDT);
|
||||
ACPI_DMTABLE_INFO *InfoTable;
|
||||
UINT32 SubTableLength;
|
||||
UINT32 GtCount;
|
||||
ACPI_GTDT_TIMER_ENTRY *GtxTable;
|
||||
|
||||
|
||||
/* Main table */
|
||||
|
||||
Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoGtdt);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Length, Offset, SubTable,
|
||||
SubTable->Length, AcpiDmTableInfoGtdtHdr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GtCount = 0;
|
||||
switch (SubTable->Type)
|
||||
{
|
||||
case ACPI_GTDT_TYPE_TIMER_BLOCK:
|
||||
|
||||
SubTableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
|
||||
GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
|
||||
SubTable))->TimerCount;
|
||||
|
||||
InfoTable = AcpiDmTableInfoGtdt0;
|
||||
break;
|
||||
|
||||
case ACPI_GTDT_TYPE_WATCHDOG:
|
||||
|
||||
SubTableLength = sizeof (ACPI_GTDT_WATCHDOG);
|
||||
|
||||
InfoTable = AcpiDmTableInfoGtdt1;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Cannot continue on unknown type - no length */
|
||||
|
||||
AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n", SubTable->Type);
|
||||
return;
|
||||
}
|
||||
|
||||
Status = AcpiDmDumpTable (Length, Offset, SubTable,
|
||||
SubTable->Length, InfoTable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Point to end of current subtable (each subtable above is of fixed length) */
|
||||
|
||||
Offset += SubTableLength;
|
||||
|
||||
/* If there are any Gt Timer Blocks from above, dump them now */
|
||||
|
||||
if (GtCount)
|
||||
{
|
||||
GtxTable = ACPI_ADD_PTR (ACPI_GTDT_TIMER_ENTRY, SubTable, SubTableLength);
|
||||
SubTableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY);
|
||||
|
||||
while (GtCount)
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Length, Offset, GtxTable,
|
||||
sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
Offset += sizeof (ACPI_GTDT_TIMER_ENTRY);
|
||||
GtxTable++;
|
||||
GtCount--;
|
||||
}
|
||||
}
|
||||
|
||||
/* Point to next subtable */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, SubTable, SubTableLength);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpHest
|
||||
@ -1662,6 +1795,16 @@ AcpiDmDumpMadt (
|
||||
InfoTable = AcpiDmTableInfoMadt12;
|
||||
break;
|
||||
|
||||
case ACPI_MADT_TYPE_GENERIC_MSI_FRAME:
|
||||
|
||||
InfoTable = AcpiDmTableInfoMadt13;
|
||||
break;
|
||||
|
||||
case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR:
|
||||
|
||||
InfoTable = AcpiDmTableInfoMadt14;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("\n**** Unknown MADT subtable type 0x%X\n\n", SubTable->Type);
|
||||
@ -2017,6 +2160,7 @@ AcpiDmDumpPcct (
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_PCCT_SUBSPACE *SubTable;
|
||||
ACPI_DMTABLE_INFO *InfoTable;
|
||||
UINT32 Length = Table->Length;
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_PCCT);
|
||||
|
||||
@ -2044,10 +2188,20 @@ AcpiDmDumpPcct (
|
||||
return;
|
||||
}
|
||||
|
||||
/* ACPI 5.0: Only one type of PCCT subtable is supported */
|
||||
|
||||
if (SubTable->Header.Type != ACPI_PCCT_TYPE_GENERIC_SUBSPACE)
|
||||
switch (SubTable->Header.Type)
|
||||
{
|
||||
case ACPI_PCCT_TYPE_GENERIC_SUBSPACE:
|
||||
|
||||
InfoTable = AcpiDmTableInfoPcct0;
|
||||
break;
|
||||
|
||||
case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE:
|
||||
|
||||
InfoTable = AcpiDmTableInfoPcct1;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
AcpiOsPrintf (
|
||||
"\n**** Unexpected or unknown PCCT subtable type 0x%X\n\n",
|
||||
SubTable->Header.Type);
|
||||
@ -2056,7 +2210,7 @@ AcpiDmDumpPcct (
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Length, Offset, SubTable,
|
||||
SubTable->Header.Length, AcpiDmTableInfoPcct0);
|
||||
SubTable->Header.Length, InfoTable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@ -2210,8 +2364,7 @@ AcpiDmDumpPmtt (
|
||||
if (DomainCount)
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
"\n**** DomainCount exceeds subtable length\n\n",
|
||||
MemSubTable->Type);
|
||||
"\n**** DomainCount exceeds subtable length\n\n");
|
||||
}
|
||||
|
||||
/* Walk the physical component (DIMM) subtables */
|
||||
@ -2586,6 +2739,11 @@ AcpiDmDumpSrat (
|
||||
InfoTable = AcpiDmTableInfoSrat2;
|
||||
break;
|
||||
|
||||
case ACPI_SRAT_TYPE_GICC_AFFINITY:
|
||||
|
||||
InfoTable = AcpiDmTableInfoSrat3;
|
||||
break;
|
||||
|
||||
default:
|
||||
AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n", SubTable->Type);
|
||||
|
||||
|
@ -137,11 +137,16 @@
|
||||
#define ACPI_DMAR1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f)
|
||||
#define ACPI_DMAR2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_ATSR,f)
|
||||
#define ACPI_DMAR3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RHSA,f)
|
||||
#define ACPI_DMAR4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_ANDD,f)
|
||||
#define ACPI_EINJ0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
|
||||
#define ACPI_ERST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
|
||||
#define ACPI_FPDTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_HEADER,f)
|
||||
#define ACPI_FPDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_BOOT,f)
|
||||
#define ACPI_FPDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_S3PT_PTR,f)
|
||||
#define ACPI_GTDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_TIMER_BLOCK,f)
|
||||
#define ACPI_GTDT0a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_TIMER_ENTRY,f)
|
||||
#define ACPI_GTDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_WATCHDOG,f)
|
||||
#define ACPI_GTDTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_HEADER,f)
|
||||
#define ACPI_HEST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f)
|
||||
#define ACPI_HEST1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f)
|
||||
#define ACPI_HEST2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_NMI,f)
|
||||
@ -174,6 +179,8 @@
|
||||
#define ACPI_MADT10_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f)
|
||||
#define ACPI_MADT11_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f)
|
||||
#define ACPI_MADT12_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_DISTRIBUTOR,f)
|
||||
#define ACPI_MADT13_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_MSI_FRAME,f)
|
||||
#define ACPI_MADT14_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_REDISTRIBUTOR,f)
|
||||
#define ACPI_MADTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
|
||||
#define ACPI_MCFG0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f)
|
||||
#define ACPI_MPST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_NODE,f)
|
||||
@ -184,6 +191,7 @@
|
||||
#define ACPI_MSCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f)
|
||||
#define ACPI_MTMR0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MTMR_ENTRY,f)
|
||||
#define ACPI_PCCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f)
|
||||
#define ACPI_PCCT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED,f)
|
||||
#define ACPI_PMTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_SOCKET,f)
|
||||
#define ACPI_PMTT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_CONTROLLER,f)
|
||||
#define ACPI_PMTT1A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_DOMAIN,f)
|
||||
@ -199,6 +207,7 @@
|
||||
#define ACPI_SRAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f)
|
||||
#define ACPI_SRAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
|
||||
#define ACPI_SRAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f)
|
||||
#define ACPI_SRAT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_GICC_AFFINITY,f)
|
||||
#define ACPI_VRTC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_VRTC_ENTRY,f)
|
||||
#define ACPI_WDAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WDAT_ENTRY,f)
|
||||
|
||||
@ -215,7 +224,10 @@
|
||||
#define ACPI_SRAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_CPU_AFFINITY,f,o)
|
||||
#define ACPI_SRAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_MEM_AFFINITY,f,o)
|
||||
#define ACPI_SRAT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f,o)
|
||||
#define ACPI_SRAT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_GICC_AFFINITY,f,o)
|
||||
#define ACPI_GTDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_GTDT,f,o)
|
||||
#define ACPI_GTDT0a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_TIMER_ENTRY,f,o)
|
||||
#define ACPI_GTDT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_WATCHDOG,f,o)
|
||||
#define ACPI_LPITH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_LPIT_HEADER,f,o)
|
||||
#define ACPI_MADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_MADT,f,o)
|
||||
#define ACPI_MADT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_APIC,f,o)
|
||||
@ -227,9 +239,11 @@
|
||||
#define ACPI_MADT9_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC,f,o)
|
||||
#define ACPI_MADT10_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f,o)
|
||||
#define ACPI_MADT11_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f,o)
|
||||
#define ACPI_MADT13_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_GENERIC_MSI_FRAME,f,o)
|
||||
#define ACPI_MPST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MPST_POWER_NODE,f,o)
|
||||
#define ACPI_MPST2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MPST_POWER_DATA,f,o)
|
||||
#define ACPI_PCCT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_PCCT,f,o)
|
||||
#define ACPI_PCCT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED,f,o)
|
||||
#define ACPI_PMTTH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PMTT_HEADER,f,o)
|
||||
#define ACPI_WDDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_WDDT,f,o)
|
||||
#define ACPI_EINJ0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o)
|
||||
@ -440,17 +454,22 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[] =
|
||||
{
|
||||
{ACPI_DMT_GAS, ACPI_FADT_OFFSET (ResetRegister), "Reset Register", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_FADT_OFFSET (ResetValue), "Value to cause reset", 0},
|
||||
{ACPI_DMT_UINT24, ACPI_FADT_OFFSET (Reserved4[0]), "Reserved", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_FADT_OFFSET (ArmBootFlags), "Reserved", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_FADT_OFFSET (MinorRevision), "Reserved", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* ACPI 2.0+ Extensions (FADT version 3 and 4) */
|
||||
/* ACPI 2.0+ Extensions (FADT version 3, 4, and 5) */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[] =
|
||||
{
|
||||
{ACPI_DMT_GAS, ACPI_FADT_OFFSET (ResetRegister), "Reset Register", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_FADT_OFFSET (ResetValue), "Value to cause reset", 0},
|
||||
{ACPI_DMT_UINT24, ACPI_FADT_OFFSET (Reserved4[0]), "Reserved", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_FADT_OFFSET (ArmBootFlags), "ARM Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_FADT_FLAG_OFFSET(ArmBootFlags,0), "PSCI Compliant", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_FADT_FLAG_OFFSET(ArmBootFlags,0), "Must use HVC for PSCI", 0},
|
||||
ACPI_DMT_NEW_LINE,
|
||||
{ACPI_DMT_UINT8, ACPI_FADT_OFFSET (MinorRevision), "FADT Minor Revision", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_FADT_OFFSET (XFacs), "FACS Address", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_FADT_OFFSET (XDsdt), "DSDT Address", 0},
|
||||
{ACPI_DMT_GAS, ACPI_FADT_OFFSET (XPm1aEventBlock), "PM1A Event Block", 0},
|
||||
@ -807,7 +826,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr[] =
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[] =
|
||||
{
|
||||
{ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (EntryType), "Device Scope Entry Type", 0},
|
||||
{ACPI_DMT_DMAR_SCOPE, ACPI_DMARS_OFFSET (EntryType), "Device Scope Type", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Length), "Entry Length", DT_LENGTH},
|
||||
{ACPI_DMT_UINT16, ACPI_DMARS_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (EnumerationId), "Enumeration ID", 0},
|
||||
@ -859,6 +878,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[] =
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* 4: ACPI Namespace Device Declaration Structure */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoDmar4[] =
|
||||
{
|
||||
{ACPI_DMT_UINT24, ACPI_DMAR4_OFFSET (Reserved[0]), "Reserved", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_DMAR4_OFFSET (DeviceNumber), "Device Number", 0},
|
||||
{ACPI_DMT_STRING, ACPI_DMAR4_OFFSET (DeviceName[0]), "Device Name", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -998,29 +1027,89 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt1[] =
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[] =
|
||||
{
|
||||
{ACPI_DMT_UINT64, ACPI_GTDT_OFFSET (Address), "Timer Address", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (Flags,0), "Memory Present", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_GTDT_OFFSET (CounterBlockAddresss), "Counter Block Address", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (Reserved), "Reserved", 0},
|
||||
ACPI_DMT_NEW_LINE,
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecurePl1Interrupt), "Secure PL1 Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecurePl1Flags), "SPL1 Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (SecurePl1Flags,0), "Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (SecurePl1Flags,0), "Polarity", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecureEl1Interrupt), "Secure EL1 Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecureEl1Flags), "EL1 Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (SecureEl1Flags,0), "Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (SecureEl1Flags,0), "Polarity", 0},
|
||||
{ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (SecureEl1Flags,0), "Always On", 0},
|
||||
ACPI_DMT_NEW_LINE,
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl1Interrupt), "Non-Secure PL1 Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl1Flags), "NSPL1 Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecurePl1Flags,0),"Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecurePl1Flags,0),"Polarity", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl1Interrupt), "Non-Secure EL1 Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl1Flags), "NEL1 Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecureEl1Flags,0),"Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecureEl1Flags,0),"Polarity", 0},
|
||||
{ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (NonSecureEl1Flags,0),"Always On", 0},
|
||||
ACPI_DMT_NEW_LINE,
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (VirtualTimerInterrupt), "Virtual Timer Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (VirtualTimerFlags), "VT Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Polarity", 0},
|
||||
{ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Always On", 0},
|
||||
ACPI_DMT_NEW_LINE,
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl2Interrupt), "Non-Secure PL2 Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl2Flags), "NSPL2 Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecurePl2Flags,0),"Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecurePl2Flags,0),"Polarity", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl2Interrupt), "Non-Secure EL2 Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl2Flags), "NEL2 Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecureEl2Flags,0),"Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecureEl2Flags,0),"Polarity", 0},
|
||||
{ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (NonSecureEl2Flags,0),"Always On", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_GTDT_OFFSET (CounterReadBlockAddress), "Counter Read Block Address", 0},
|
||||
ACPI_DMT_NEW_LINE,
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (PlatformTimerCount), "Platform Timer Count", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (PlatformTimerOffset), "Platform Timer Offset", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* GTDT Subtable header (one per Subtable) */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtHdr[] =
|
||||
{
|
||||
{ACPI_DMT_GTDT, ACPI_GTDTH_OFFSET (Type), "Subtable Type", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_GTDTH_OFFSET (Length), "Length", DT_LENGTH},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* GTDT Subtables */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0[] =
|
||||
{
|
||||
{ACPI_DMT_UINT8, ACPI_GTDT0_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_GTDT0_OFFSET (BlockAddress), "Block Address", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT0_OFFSET (TimerCount), "Timer Count", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT0_OFFSET (TimerOffset), "Timer Offset", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0a[] =
|
||||
{
|
||||
{ACPI_DMT_UINT8 , ACPI_GTDT0a_OFFSET (FrameNumber), "Frame Number", 0},
|
||||
{ACPI_DMT_UINT24, ACPI_GTDT0a_OFFSET (Reserved[0]), "Reserved", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_GTDT0a_OFFSET (BaseAddress), "Base Address", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_GTDT0a_OFFSET (El0BaseAddress), "EL0 Base Address", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (TimerInterrupt), "Timer Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (TimerFlags), "Timer Flags (decoded below)", 0},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT0a_FLAG_OFFSET (TimerFlags,0), "Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT0a_FLAG_OFFSET (TimerFlags,0), "Polarity", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (VirtualTimerInterrupt), "Virtual Timer Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (VirtualTimerFlags), "Virtual Timer Flags (decoded below)", 0},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT0a_FLAG_OFFSET (VirtualTimerFlags,0), "Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT0a_FLAG_OFFSET (VirtualTimerFlags,0), "Polarity", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (CommonFlags), "Common Flags (decoded below)", 0},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT0a_FLAG_OFFSET (CommonFlags,0), "Secure", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT0a_FLAG_OFFSET (CommonFlags,0), "Always On", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt1[] =
|
||||
{
|
||||
{ACPI_DMT_UINT8, ACPI_GTDT1_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_GTDT1_OFFSET (RefreshFrameAddress), "Refresh Frame Address", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_GTDT1_OFFSET (ControlFrameAddress), "Control Frame Address", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT1_OFFSET (TimerInterrupt), "Timer Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT1_OFFSET (TimerFlags), "Timer Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT1_FLAG_OFFSET (TimerFlags,0), "Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT1_FLAG_OFFSET (TimerFlags,0), "Polarity", 0},
|
||||
{ACPI_DMT_FLAG2, ACPI_GTDT1_FLAG_OFFSET (TimerFlags,0), "Security", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
@ -1527,14 +1616,21 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[] =
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[] =
|
||||
{
|
||||
{ACPI_DMT_UINT16, ACPI_MADT11_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (GicId), "Local GIC Hardware ID", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (CpuInterfaceNumber), "CPU Interface Number", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (Uid), "Processor UID", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_MADT11_FLAG_OFFSET (Flags,0), "Processor Enabled", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_MADT11_FLAG_OFFSET (Flags,0), "Performance Interrupt Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG2, ACPI_MADT11_FLAG_OFFSET (Flags,0), "Virtual GIC Interrupt Trigger Mode", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (ParkingVersion), "Parking Protocol Version", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (PerformanceInterrupt), "Performance Interrupt", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (ParkedAddress), "Parked Address", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (BaseAddress), "Base Address", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (GicvBaseAddress), "Virtual GIC Base Address", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (GichBaseAddress), "Hypervisor GIC Base Address", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (VgicInterrupt), "Virtual GIC Interrupt", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (GicrBaseAddress), "Redistributor Base Address", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (ArmMpidr), "ARM MPIDR", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
@ -1550,6 +1646,30 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[] =
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* 13: Generic MSI Frame (ACPI 5.1) */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt13[] =
|
||||
{
|
||||
{ACPI_DMT_UINT16, ACPI_MADT13_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT13_OFFSET (MsiFrameId), "MSI Frame ID", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_MADT13_OFFSET (BaseAddress), "Base Address", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT13_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_MADT13_FLAG_OFFSET (Flags,0), "Select SPI", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_MADT13_OFFSET (SpiCount), "SPI Count", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_MADT13_OFFSET (SpiBase), "SPI Base", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* 14: Generic Redistributor (ACPI 5.1) */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt14[] =
|
||||
{
|
||||
{ACPI_DMT_UINT16, ACPI_MADT14_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_MADT14_OFFSET (BaseAddress), "Base Address", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT14_OFFSET (Length), "Length", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -1769,6 +1889,26 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[] =
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* 1: HW-reduced Communications Subspace (ACPI 5.1) */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[] =
|
||||
{
|
||||
{ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (DoorbellInterrupt), "Doorbell Interrupt", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_PCCT1_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_PCCT1_FLAG_OFFSET (Flags,0), "Polarity", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_PCCT1_FLAG_OFFSET (Flags,0), "Mode", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_PCCT1_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (BaseAddress), "Base Address", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (Length), "Address Length", 0},
|
||||
{ACPI_DMT_GAS, ACPI_PCCT1_OFFSET (DoorbellRegister), "Doorbell Register", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (PreserveMask), "Preserve Mask", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (WriteMask), "Write Mask", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (Latency), "Command Latency", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (MaxAccessRate), "Maximum Access Rate", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_PCCT1_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -2048,7 +2188,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[] =
|
||||
{ACPI_DMT_FLAG0, ACPI_SRAT0_FLAG_OFFSET (Flags,0), "Enabled", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_SRAT0_OFFSET (LocalSapicEid), "Local Sapic EID", 0},
|
||||
{ACPI_DMT_UINT24, ACPI_SRAT0_OFFSET (ProximityDomainHi[0]), "Proximity Domain High(24)", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT0_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT0_OFFSET (ClockDomain), "Clock Domain", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
@ -2083,6 +2223,18 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[] =
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* : GICC Affinity (ACPI 5.1) */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[] =
|
||||
{
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (ProximityDomain), "Proximity Domain", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (AcpiProcessorUid), "Acpi Processor UID", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_SRAT3_FLAG_OFFSET (Flags,0), "Enabled", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (ClockDomain), "Clock Domain", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include <string.h>
|
||||
@ -569,3 +568,51 @@ ApCheckRegMethod (
|
||||
|
||||
AslError (ASL_WARNING, ASL_MSG_NO_REGION, Op, NULL);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: ApFindNameInScope
|
||||
*
|
||||
* PARAMETERS: Name - Name to search for
|
||||
* Op - Current parse op
|
||||
*
|
||||
* RETURN: TRUE if name found in the same scope as Op.
|
||||
*
|
||||
* DESCRIPTION: Determine if a name appears in the same scope as Op, as either
|
||||
* a Method() or a Name().
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
BOOLEAN
|
||||
ApFindNameInScope (
|
||||
char *Name,
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Next;
|
||||
ACPI_PARSE_OBJECT *Parent;
|
||||
|
||||
|
||||
/* Get the start of the current scope */
|
||||
|
||||
Parent = Op->Asl.Parent;
|
||||
Next = Parent->Asl.Child;
|
||||
|
||||
/* Search entire scope for a match to the name */
|
||||
|
||||
while (Next)
|
||||
{
|
||||
if ((Next->Asl.ParseOpcode == PARSEOP_METHOD) ||
|
||||
(Next->Asl.ParseOpcode == PARSEOP_NAME))
|
||||
{
|
||||
if (ACPI_COMPARE_NAME (Name, Next->Asl.NameSeg))
|
||||
{
|
||||
return (TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
Next = Next->Asl.Next;
|
||||
}
|
||||
|
||||
return (FALSE);
|
||||
}
|
||||
|
349
source/compiler/aslascii.c
Normal file
349
source/compiler/aslascii.c
Normal file
@ -0,0 +1,349 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslascii - ASCII detection and support routines
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* NO WARRANTY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include <acapps.h>
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("aslascii")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
FlConsumeAnsiComment (
|
||||
FILE *Handle,
|
||||
ASL_FILE_STATUS *Status);
|
||||
|
||||
static void
|
||||
FlConsumeNewComment (
|
||||
FILE *Handle,
|
||||
ASL_FILE_STATUS *Status);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: FlCheckForAcpiTable
|
||||
*
|
||||
* PARAMETERS: Handle - Open input file
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Determine if a file seems to be a binary ACPI table, via the
|
||||
* following checks on what would be the table header:
|
||||
* 0) File must be at least as long as an ACPI_TABLE_HEADER
|
||||
* 1) The header length field must match the file size
|
||||
* 2) Signature, OemId, OemTableId, AslCompilerId must be ASCII
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
FlCheckForAcpiTable (
|
||||
FILE *Handle)
|
||||
{
|
||||
ACPI_TABLE_HEADER Table;
|
||||
UINT32 FileSize;
|
||||
size_t Actual;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
/* Read a potential table header */
|
||||
|
||||
Actual = fread (&Table, 1, sizeof (ACPI_TABLE_HEADER), Handle);
|
||||
fseek (Handle, 0, SEEK_SET);
|
||||
|
||||
if (Actual < sizeof (ACPI_TABLE_HEADER))
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Header length field must match the file size */
|
||||
|
||||
FileSize = CmGetFileSize (Handle);
|
||||
if (Table.Length != FileSize)
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* These fields must be ASCII:
|
||||
* Signature, OemId, OemTableId, AslCompilerId.
|
||||
* We allow a NULL terminator in OemId and OemTableId.
|
||||
*/
|
||||
for (i = 0; i < ACPI_NAME_SIZE; i++)
|
||||
{
|
||||
if (!ACPI_IS_ASCII ((UINT8) Table.Signature[i]))
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
if (!ACPI_IS_ASCII ((UINT8) Table.AslCompilerId[i]))
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; (i < ACPI_OEM_ID_SIZE) && (Table.OemId[i]); i++)
|
||||
{
|
||||
if (!ACPI_IS_ASCII ((UINT8) Table.OemId[i]))
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; (i < ACPI_OEM_TABLE_ID_SIZE) && (Table.OemTableId[i]); i++)
|
||||
{
|
||||
if (!ACPI_IS_ASCII ((UINT8) Table.OemTableId[i]))
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
printf ("Binary file appears to be a valid ACPI table, disassembling\n");
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: FlCheckForAscii
|
||||
*
|
||||
* PARAMETERS: Handle - Open input file
|
||||
* Filename - Input filename
|
||||
* DisplayErrors - TRUE if error messages desired
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Verify that the input file is entirely ASCII. Ignores characters
|
||||
* within comments. Note: does not handle nested comments and does
|
||||
* not handle comment delimiters within string literals. However,
|
||||
* on the rare chance this happens and an invalid character is
|
||||
* missed, the parser will catch the error by failing in some
|
||||
* spectactular manner.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
FlCheckForAscii (
|
||||
FILE *Handle,
|
||||
char *Filename,
|
||||
BOOLEAN DisplayErrors)
|
||||
{
|
||||
UINT8 Byte;
|
||||
ACPI_SIZE BadBytes = 0;
|
||||
BOOLEAN OpeningComment = FALSE;
|
||||
ASL_FILE_STATUS Status;
|
||||
|
||||
|
||||
Status.Line = 1;
|
||||
Status.Offset = 0;
|
||||
|
||||
/* Read the entire file */
|
||||
|
||||
while (fread (&Byte, 1, 1, Handle) == 1)
|
||||
{
|
||||
/* Ignore comment fields (allow non-ascii within) */
|
||||
|
||||
if (OpeningComment)
|
||||
{
|
||||
/* Check for second comment open delimiter */
|
||||
|
||||
if (Byte == '*')
|
||||
{
|
||||
FlConsumeAnsiComment (Handle, &Status);
|
||||
}
|
||||
|
||||
if (Byte == '/')
|
||||
{
|
||||
FlConsumeNewComment (Handle, &Status);
|
||||
}
|
||||
|
||||
/* Reset */
|
||||
|
||||
OpeningComment = FALSE;
|
||||
}
|
||||
else if (Byte == '/')
|
||||
{
|
||||
OpeningComment = TRUE;
|
||||
}
|
||||
|
||||
/* Check for an ASCII character */
|
||||
|
||||
if (!ACPI_IS_ASCII (Byte))
|
||||
{
|
||||
if ((BadBytes < 10) && (DisplayErrors))
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
"Non-ASCII character [0x%2.2X] found in line %u, file offset 0x%.2X\n",
|
||||
Byte, Status.Line, Status.Offset);
|
||||
}
|
||||
|
||||
BadBytes++;
|
||||
}
|
||||
|
||||
/* Update line counter */
|
||||
|
||||
else if (Byte == 0x0A)
|
||||
{
|
||||
Status.Line++;
|
||||
}
|
||||
|
||||
Status.Offset++;
|
||||
}
|
||||
|
||||
/* Seek back to the beginning of the source file */
|
||||
|
||||
fseek (Handle, 0, SEEK_SET);
|
||||
|
||||
/* Were there any non-ASCII characters in the file? */
|
||||
|
||||
if (BadBytes)
|
||||
{
|
||||
if (DisplayErrors)
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
"%u non-ASCII characters found in input source text, could be a binary file\n",
|
||||
BadBytes);
|
||||
AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, Filename);
|
||||
}
|
||||
|
||||
return (AE_BAD_CHARACTER);
|
||||
}
|
||||
|
||||
/* File is OK (100% ASCII) */
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: FlConsumeAnsiComment
|
||||
*
|
||||
* PARAMETERS: Handle - Open input file
|
||||
* Status - File current status struct
|
||||
*
|
||||
* RETURN: Number of lines consumed
|
||||
*
|
||||
* DESCRIPTION: Step over a normal slash-star type comment
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
FlConsumeAnsiComment (
|
||||
FILE *Handle,
|
||||
ASL_FILE_STATUS *Status)
|
||||
{
|
||||
UINT8 Byte;
|
||||
BOOLEAN ClosingComment = FALSE;
|
||||
|
||||
|
||||
while (fread (&Byte, 1, 1, Handle) == 1)
|
||||
{
|
||||
/* Scan until comment close is found */
|
||||
|
||||
if (ClosingComment)
|
||||
{
|
||||
if (Byte == '/')
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Byte != '*')
|
||||
{
|
||||
/* Reset */
|
||||
|
||||
ClosingComment = FALSE;
|
||||
}
|
||||
}
|
||||
else if (Byte == '*')
|
||||
{
|
||||
ClosingComment = TRUE;
|
||||
}
|
||||
|
||||
/* Maintain line count */
|
||||
|
||||
if (Byte == 0x0A)
|
||||
{
|
||||
Status->Line++;
|
||||
}
|
||||
|
||||
Status->Offset++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: FlConsumeNewComment
|
||||
*
|
||||
* PARAMETERS: Handle - Open input file
|
||||
* Status - File current status struct
|
||||
*
|
||||
* RETURN: Number of lines consumed
|
||||
*
|
||||
* DESCRIPTION: Step over a slash-slash type of comment
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
FlConsumeNewComment (
|
||||
FILE *Handle,
|
||||
ASL_FILE_STATUS *Status)
|
||||
{
|
||||
UINT8 Byte;
|
||||
|
||||
|
||||
while (fread (&Byte, 1, 1, Handle) == 1)
|
||||
{
|
||||
Status->Offset++;
|
||||
|
||||
/* Comment ends at newline */
|
||||
|
||||
if (Byte == 0x0A)
|
||||
{
|
||||
Status->Line++;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "amlcode.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "amlcode.h"
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "dtcompiler.h"
|
||||
#include "acnamesp.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
@ -66,21 +67,263 @@ static void
|
||||
CmFlushSourceCode (
|
||||
void);
|
||||
|
||||
static void
|
||||
FlConsumeAnsiComment (
|
||||
FILE *Handle,
|
||||
ASL_FILE_STATUS *Status);
|
||||
|
||||
static void
|
||||
FlConsumeNewComment (
|
||||
FILE *Handle,
|
||||
ASL_FILE_STATUS *Status);
|
||||
|
||||
static void
|
||||
CmDumpAllEvents (
|
||||
void);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: CmDoCompile
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status (0 = OK)
|
||||
*
|
||||
* DESCRIPTION: This procedure performs the entire compile
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
int
|
||||
CmDoCompile (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
UINT8 FullCompile;
|
||||
UINT8 Event;
|
||||
|
||||
|
||||
FullCompile = UtBeginEvent ("*** Total Compile time ***");
|
||||
Event = UtBeginEvent ("Open input and output files");
|
||||
UtEndEvent (Event);
|
||||
|
||||
Event = UtBeginEvent ("Preprocess input file");
|
||||
if (Gbl_PreprocessFlag)
|
||||
{
|
||||
/* Preprocessor */
|
||||
|
||||
PrDoPreprocess ();
|
||||
if (Gbl_PreprocessOnly)
|
||||
{
|
||||
UtEndEvent (Event);
|
||||
CmCleanupAndExit ();
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Build the parse tree */
|
||||
|
||||
Event = UtBeginEvent ("Parse source code and build parse tree");
|
||||
AslCompilerparse();
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Check for parse errors */
|
||||
|
||||
Status = AslCheckForErrorExit ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
fprintf (stderr, "Compiler aborting due to parser-detected syntax error(s)\n");
|
||||
LsDumpParseTree ();
|
||||
goto ErrorExit;
|
||||
}
|
||||
|
||||
/* Did the parse tree get successfully constructed? */
|
||||
|
||||
if (!RootNode)
|
||||
{
|
||||
/*
|
||||
* If there are no errors, then we have some sort of
|
||||
* internal problem.
|
||||
*/
|
||||
AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL,
|
||||
NULL, "- Could not resolve parse tree root node");
|
||||
|
||||
goto ErrorExit;
|
||||
}
|
||||
|
||||
/* Flush out any remaining source after parse tree is complete */
|
||||
|
||||
Event = UtBeginEvent ("Flush source input");
|
||||
CmFlushSourceCode ();
|
||||
|
||||
/* Optional parse tree dump, compiler debug output only */
|
||||
|
||||
LsDumpParseTree ();
|
||||
|
||||
OpcGetIntegerWidth (RootNode);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Pre-process parse tree for any operator transforms */
|
||||
|
||||
Event = UtBeginEvent ("Parse tree transforms");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nParse tree transforms\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
|
||||
TrAmlTransformWalk, NULL, NULL);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Generate AML opcodes corresponding to the parse tokens */
|
||||
|
||||
Event = UtBeginEvent ("Generate AML opcodes");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating AML opcodes\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
|
||||
OpcAmlOpcodeWalk, NULL);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/*
|
||||
* Now that the input is parsed, we can open the AML output file.
|
||||
* Note: by default, the name of this file comes from the table descriptor
|
||||
* within the input file.
|
||||
*/
|
||||
Event = UtBeginEvent ("Open AML output file");
|
||||
Status = FlOpenAmlOutputFile (Gbl_OutputFilenamePrefix);
|
||||
UtEndEvent (Event);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AePrintErrorLog (ASL_FILE_STDERR);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Interpret and generate all compile-time constants */
|
||||
|
||||
Event = UtBeginEvent ("Constant folding via AML interpreter");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"\nInterpreting compile-time constant expressions\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
|
||||
OpcAmlConstantWalk, NULL, NULL);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Update AML opcodes if necessary, after constant folding */
|
||||
|
||||
Event = UtBeginEvent ("Updating AML opcodes after constant folding");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"\nUpdating AML opcodes after constant folding\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
|
||||
NULL, OpcAmlOpcodeUpdateWalk, NULL);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Calculate all AML package lengths */
|
||||
|
||||
Event = UtBeginEvent ("Generate AML package lengths");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating Package lengths\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
|
||||
LnPackageLengthWalk, NULL);
|
||||
UtEndEvent (Event);
|
||||
|
||||
if (Gbl_ParseOnlyFlag)
|
||||
{
|
||||
AePrintErrorLog (ASL_FILE_STDERR);
|
||||
UtDisplaySummary (ASL_FILE_STDERR);
|
||||
if (Gbl_DebugFlag)
|
||||
{
|
||||
/* Print error summary to the stdout also */
|
||||
|
||||
AePrintErrorLog (ASL_FILE_STDOUT);
|
||||
UtDisplaySummary (ASL_FILE_STDOUT);
|
||||
}
|
||||
UtEndEvent (FullCompile);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Create an internal namespace and use it as a symbol table
|
||||
*/
|
||||
|
||||
/* Namespace loading */
|
||||
|
||||
Event = UtBeginEvent ("Create ACPI Namespace");
|
||||
Status = LdLoadNamespace (RootNode);
|
||||
UtEndEvent (Event);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto ErrorExit;
|
||||
}
|
||||
|
||||
/* Namespace cross-reference */
|
||||
|
||||
AslGbl_NamespaceEvent = UtBeginEvent ("Cross reference parse tree and Namespace");
|
||||
Status = XfCrossReferenceNamespace ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto ErrorExit;
|
||||
}
|
||||
|
||||
/* Namespace - Check for non-referenced objects */
|
||||
|
||||
LkFindUnreferencedObjects ();
|
||||
UtEndEvent (AslGbl_NamespaceEvent);
|
||||
|
||||
/*
|
||||
* Semantic analysis. This can happen only after the
|
||||
* namespace has been loaded and cross-referenced.
|
||||
*
|
||||
* part one - check control methods
|
||||
*/
|
||||
Event = UtBeginEvent ("Analyze control method return types");
|
||||
AnalysisWalkInfo.MethodStack = NULL;
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method analysis\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE,
|
||||
MtMethodAnalysisWalkBegin,
|
||||
MtMethodAnalysisWalkEnd, &AnalysisWalkInfo);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Semantic error checking part two - typing of method returns */
|
||||
|
||||
Event = UtBeginEvent ("Determine object types returned by methods");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method typing\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
|
||||
NULL, AnMethodTypingWalkEnd, NULL);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Semantic error checking part three - operand type checking */
|
||||
|
||||
Event = UtBeginEvent ("Analyze AML operand types");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Operand type checking\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
|
||||
NULL, AnOperandTypecheckWalkEnd, &AnalysisWalkInfo);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Semantic error checking part four - other miscellaneous checks */
|
||||
|
||||
Event = UtBeginEvent ("Miscellaneous analysis");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - miscellaneous\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
|
||||
AnOtherSemanticAnalysisWalkBegin,
|
||||
NULL, &AnalysisWalkInfo);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Calculate all AML package lengths */
|
||||
|
||||
Event = UtBeginEvent ("Finish AML package length generation");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating Package lengths\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
|
||||
LnInitLengthsWalk, NULL);
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
|
||||
LnPackageLengthWalk, NULL);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Code generation - emit the AML */
|
||||
|
||||
Event = UtBeginEvent ("Generate AML code and write output files");
|
||||
CgGenerateAmlOutput ();
|
||||
UtEndEvent (Event);
|
||||
|
||||
Event = UtBeginEvent ("Write optional output files");
|
||||
CmDoOutputFiles ();
|
||||
UtEndEvent (Event);
|
||||
|
||||
UtEndEvent (FullCompile);
|
||||
CmCleanupAndExit ();
|
||||
return (0);
|
||||
|
||||
ErrorExit:
|
||||
UtEndEvent (FullCompile);
|
||||
CmCleanupAndExit ();
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslCompilerSignon
|
||||
@ -272,534 +515,6 @@ CmFlushSourceCode (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: FlConsume*
|
||||
*
|
||||
* PARAMETERS: Handle - Open input file
|
||||
* Status - File current status struct
|
||||
*
|
||||
* RETURN: Number of lines consumed
|
||||
*
|
||||
* DESCRIPTION: Step over both types of comment during check for ascii chars
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
FlConsumeAnsiComment (
|
||||
FILE *Handle,
|
||||
ASL_FILE_STATUS *Status)
|
||||
{
|
||||
UINT8 Byte;
|
||||
BOOLEAN ClosingComment = FALSE;
|
||||
|
||||
|
||||
while (fread (&Byte, 1, 1, Handle) == 1)
|
||||
{
|
||||
/* Scan until comment close is found */
|
||||
|
||||
if (ClosingComment)
|
||||
{
|
||||
if (Byte == '/')
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Byte != '*')
|
||||
{
|
||||
/* Reset */
|
||||
|
||||
ClosingComment = FALSE;
|
||||
}
|
||||
}
|
||||
else if (Byte == '*')
|
||||
{
|
||||
ClosingComment = TRUE;
|
||||
}
|
||||
|
||||
/* Maintain line count */
|
||||
|
||||
if (Byte == 0x0A)
|
||||
{
|
||||
Status->Line++;
|
||||
}
|
||||
|
||||
Status->Offset++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
FlConsumeNewComment (
|
||||
FILE *Handle,
|
||||
ASL_FILE_STATUS *Status)
|
||||
{
|
||||
UINT8 Byte;
|
||||
|
||||
|
||||
while (fread (&Byte, 1, 1, Handle) == 1)
|
||||
{
|
||||
Status->Offset++;
|
||||
|
||||
/* Comment ends at newline */
|
||||
|
||||
if (Byte == 0x0A)
|
||||
{
|
||||
Status->Line++;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: FlCheckForAcpiTable
|
||||
*
|
||||
* PARAMETERS: Handle - Open input file
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Determine if a file seems to be a binary ACPI table, via the
|
||||
* following checks on what would be the table header:
|
||||
* 0) File must be at least as long as an ACPI_TABLE_HEADER
|
||||
* 1) The header length field must match the file size
|
||||
* 2) Signature, OemId, OemTableId, AslCompilerId must be ASCII
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
FlCheckForAcpiTable (
|
||||
FILE *Handle)
|
||||
{
|
||||
ACPI_TABLE_HEADER Table;
|
||||
UINT32 FileSize;
|
||||
size_t Actual;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
/* Read a potential table header */
|
||||
|
||||
Actual = fread (&Table, 1, sizeof (ACPI_TABLE_HEADER), Handle);
|
||||
fseek (Handle, 0, SEEK_SET);
|
||||
|
||||
if (Actual < sizeof (ACPI_TABLE_HEADER))
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Header length field must match the file size */
|
||||
|
||||
FileSize = CmGetFileSize (Handle);
|
||||
if (Table.Length != FileSize)
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* These fields must be ASCII:
|
||||
* Signature, OemId, OemTableId, AslCompilerId.
|
||||
* We allow a NULL terminator in OemId and OemTableId.
|
||||
*/
|
||||
for (i = 0; i < ACPI_NAME_SIZE; i++)
|
||||
{
|
||||
if (!ACPI_IS_ASCII ((UINT8) Table.Signature[i]))
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
if (!ACPI_IS_ASCII ((UINT8) Table.AslCompilerId[i]))
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; (i < ACPI_OEM_ID_SIZE) && (Table.OemId[i]); i++)
|
||||
{
|
||||
if (!ACPI_IS_ASCII ((UINT8) Table.OemId[i]))
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; (i < ACPI_OEM_TABLE_ID_SIZE) && (Table.OemTableId[i]); i++)
|
||||
{
|
||||
if (!ACPI_IS_ASCII ((UINT8) Table.OemTableId[i]))
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
printf ("Binary file appears to be a valid ACPI table, disassembling\n");
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: FlCheckForAscii
|
||||
*
|
||||
* PARAMETERS: Handle - Open input file
|
||||
* Filename - Input filename
|
||||
* DisplayErrors - TRUE if error messages desired
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Verify that the input file is entirely ASCII. Ignores characters
|
||||
* within comments. Note: does not handle nested comments and does
|
||||
* not handle comment delimiters within string literals. However,
|
||||
* on the rare chance this happens and an invalid character is
|
||||
* missed, the parser will catch the error by failing in some
|
||||
* spectactular manner.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
FlCheckForAscii (
|
||||
FILE *Handle,
|
||||
char *Filename,
|
||||
BOOLEAN DisplayErrors)
|
||||
{
|
||||
UINT8 Byte;
|
||||
ACPI_SIZE BadBytes = 0;
|
||||
BOOLEAN OpeningComment = FALSE;
|
||||
ASL_FILE_STATUS Status;
|
||||
|
||||
|
||||
Status.Line = 1;
|
||||
Status.Offset = 0;
|
||||
|
||||
/* Read the entire file */
|
||||
|
||||
while (fread (&Byte, 1, 1, Handle) == 1)
|
||||
{
|
||||
/* Ignore comment fields (allow non-ascii within) */
|
||||
|
||||
if (OpeningComment)
|
||||
{
|
||||
/* Check for second comment open delimiter */
|
||||
|
||||
if (Byte == '*')
|
||||
{
|
||||
FlConsumeAnsiComment (Handle, &Status);
|
||||
}
|
||||
|
||||
if (Byte == '/')
|
||||
{
|
||||
FlConsumeNewComment (Handle, &Status);
|
||||
}
|
||||
|
||||
/* Reset */
|
||||
|
||||
OpeningComment = FALSE;
|
||||
}
|
||||
else if (Byte == '/')
|
||||
{
|
||||
OpeningComment = TRUE;
|
||||
}
|
||||
|
||||
/* Check for an ASCII character */
|
||||
|
||||
if (!ACPI_IS_ASCII (Byte))
|
||||
{
|
||||
if ((BadBytes < 10) && (DisplayErrors))
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
"Non-ASCII character [0x%2.2X] found in line %u, file offset 0x%.2X\n",
|
||||
Byte, Status.Line, Status.Offset);
|
||||
}
|
||||
|
||||
BadBytes++;
|
||||
}
|
||||
|
||||
/* Update line counter */
|
||||
|
||||
else if (Byte == 0x0A)
|
||||
{
|
||||
Status.Line++;
|
||||
}
|
||||
|
||||
Status.Offset++;
|
||||
}
|
||||
|
||||
/* Seek back to the beginning of the source file */
|
||||
|
||||
fseek (Handle, 0, SEEK_SET);
|
||||
|
||||
/* Were there any non-ASCII characters in the file? */
|
||||
|
||||
if (BadBytes)
|
||||
{
|
||||
if (DisplayErrors)
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
"%u non-ASCII characters found in input source text, could be a binary file\n",
|
||||
BadBytes);
|
||||
AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, Filename);
|
||||
}
|
||||
|
||||
return (AE_BAD_CHARACTER);
|
||||
}
|
||||
|
||||
/* File is OK (100% ASCII) */
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: CmDoCompile
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status (0 = OK)
|
||||
*
|
||||
* DESCRIPTION: This procedure performs the entire compile
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
int
|
||||
CmDoCompile (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
UINT8 FullCompile;
|
||||
UINT8 Event;
|
||||
|
||||
|
||||
FullCompile = UtBeginEvent ("*** Total Compile time ***");
|
||||
Event = UtBeginEvent ("Open input and output files");
|
||||
UtEndEvent (Event);
|
||||
|
||||
Event = UtBeginEvent ("Preprocess input file");
|
||||
if (Gbl_PreprocessFlag)
|
||||
{
|
||||
/* Preprocessor */
|
||||
|
||||
PrDoPreprocess ();
|
||||
if (Gbl_PreprocessOnly)
|
||||
{
|
||||
UtEndEvent (Event);
|
||||
CmCleanupAndExit ();
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Build the parse tree */
|
||||
|
||||
Event = UtBeginEvent ("Parse source code and build parse tree");
|
||||
AslCompilerparse();
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Check for parse errors */
|
||||
|
||||
Status = AslCheckForErrorExit ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
fprintf (stderr, "Compiler aborting due to parser-detected syntax error(s)\n");
|
||||
LsDumpParseTree ();
|
||||
goto ErrorExit;
|
||||
}
|
||||
|
||||
/* Did the parse tree get successfully constructed? */
|
||||
|
||||
if (!RootNode)
|
||||
{
|
||||
/*
|
||||
* If there are no errors, then we have some sort of
|
||||
* internal problem.
|
||||
*/
|
||||
AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL,
|
||||
NULL, "- Could not resolve parse tree root node");
|
||||
|
||||
goto ErrorExit;
|
||||
}
|
||||
|
||||
|
||||
/* Flush out any remaining source after parse tree is complete */
|
||||
|
||||
Event = UtBeginEvent ("Flush source input");
|
||||
CmFlushSourceCode ();
|
||||
|
||||
/* Optional parse tree dump, compiler debug output only */
|
||||
|
||||
LsDumpParseTree ();
|
||||
|
||||
OpcGetIntegerWidth (RootNode);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Pre-process parse tree for any operator transforms */
|
||||
|
||||
Event = UtBeginEvent ("Parse tree transforms");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nParse tree transforms\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
|
||||
TrAmlTransformWalk, NULL, NULL);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Generate AML opcodes corresponding to the parse tokens */
|
||||
|
||||
Event = UtBeginEvent ("Generate AML opcodes");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating AML opcodes\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
|
||||
OpcAmlOpcodeWalk, NULL);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/*
|
||||
* Now that the input is parsed, we can open the AML output file.
|
||||
* Note: by default, the name of this file comes from the table descriptor
|
||||
* within the input file.
|
||||
*/
|
||||
Event = UtBeginEvent ("Open AML output file");
|
||||
Status = FlOpenAmlOutputFile (Gbl_OutputFilenamePrefix);
|
||||
UtEndEvent (Event);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AePrintErrorLog (ASL_FILE_STDERR);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Interpret and generate all compile-time constants */
|
||||
|
||||
Event = UtBeginEvent ("Constant folding via AML interpreter");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"\nInterpreting compile-time constant expressions\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
|
||||
OpcAmlConstantWalk, NULL, NULL);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Update AML opcodes if necessary, after constant folding */
|
||||
|
||||
Event = UtBeginEvent ("Updating AML opcodes after constant folding");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"\nUpdating AML opcodes after constant folding\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
|
||||
NULL, OpcAmlOpcodeUpdateWalk, NULL);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Calculate all AML package lengths */
|
||||
|
||||
Event = UtBeginEvent ("Generate AML package lengths");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating Package lengths\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
|
||||
LnPackageLengthWalk, NULL);
|
||||
UtEndEvent (Event);
|
||||
|
||||
if (Gbl_ParseOnlyFlag)
|
||||
{
|
||||
AePrintErrorLog (ASL_FILE_STDERR);
|
||||
UtDisplaySummary (ASL_FILE_STDERR);
|
||||
if (Gbl_DebugFlag)
|
||||
{
|
||||
/* Print error summary to the stdout also */
|
||||
|
||||
AePrintErrorLog (ASL_FILE_STDOUT);
|
||||
UtDisplaySummary (ASL_FILE_STDOUT);
|
||||
}
|
||||
UtEndEvent (FullCompile);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Create an internal namespace and use it as a symbol table
|
||||
*/
|
||||
|
||||
/* Namespace loading */
|
||||
|
||||
Event = UtBeginEvent ("Create ACPI Namespace");
|
||||
Status = LdLoadNamespace (RootNode);
|
||||
UtEndEvent (Event);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto ErrorExit;
|
||||
}
|
||||
|
||||
/* Namespace cross-reference */
|
||||
|
||||
AslGbl_NamespaceEvent = UtBeginEvent ("Cross reference parse tree and Namespace");
|
||||
Status = XfCrossReferenceNamespace ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto ErrorExit;
|
||||
}
|
||||
|
||||
/* Namespace - Check for non-referenced objects */
|
||||
|
||||
LkFindUnreferencedObjects ();
|
||||
UtEndEvent (AslGbl_NamespaceEvent);
|
||||
|
||||
/*
|
||||
* Semantic analysis. This can happen only after the
|
||||
* namespace has been loaded and cross-referenced.
|
||||
*
|
||||
* part one - check control methods
|
||||
*/
|
||||
Event = UtBeginEvent ("Analyze control method return types");
|
||||
AnalysisWalkInfo.MethodStack = NULL;
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method analysis\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE,
|
||||
MtMethodAnalysisWalkBegin,
|
||||
MtMethodAnalysisWalkEnd, &AnalysisWalkInfo);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Semantic error checking part two - typing of method returns */
|
||||
|
||||
Event = UtBeginEvent ("Determine object types returned by methods");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method typing\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
|
||||
NULL, AnMethodTypingWalkEnd, NULL);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Semantic error checking part three - operand type checking */
|
||||
|
||||
Event = UtBeginEvent ("Analyze AML operand types");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Operand type checking\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
|
||||
NULL, AnOperandTypecheckWalkEnd, &AnalysisWalkInfo);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Semantic error checking part four - other miscellaneous checks */
|
||||
|
||||
Event = UtBeginEvent ("Miscellaneous analysis");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - miscellaneous\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
|
||||
AnOtherSemanticAnalysisWalkBegin,
|
||||
NULL, &AnalysisWalkInfo);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Calculate all AML package lengths */
|
||||
|
||||
Event = UtBeginEvent ("Finish AML package length generation");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating Package lengths\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
|
||||
LnInitLengthsWalk, NULL);
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
|
||||
LnPackageLengthWalk, NULL);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Code generation - emit the AML */
|
||||
|
||||
Event = UtBeginEvent ("Generate AML code and write output files");
|
||||
CgGenerateAmlOutput ();
|
||||
UtEndEvent (Event);
|
||||
|
||||
Event = UtBeginEvent ("Write optional output files");
|
||||
CmDoOutputFiles ();
|
||||
UtEndEvent (Event);
|
||||
|
||||
UtEndEvent (FullCompile);
|
||||
CmCleanupAndExit ();
|
||||
return (0);
|
||||
|
||||
ErrorExit:
|
||||
UtEndEvent (FullCompile);
|
||||
CmCleanupAndExit ();
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: CmDoOutputFiles
|
||||
@ -965,7 +680,8 @@ CmCleanupAndExit (
|
||||
* We will delete the AML file if there are errors and the
|
||||
* force AML output option has not been used.
|
||||
*/
|
||||
if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors) &&
|
||||
if ((Gbl_ExceptionCount[ASL_ERROR] > 0) &&
|
||||
(!Gbl_IgnoreErrors) &&
|
||||
Gbl_Files[ASL_FILE_AML_OUTPUT].Handle)
|
||||
{
|
||||
DeleteAmlFile = TRUE;
|
||||
@ -1025,4 +741,71 @@ CmCleanupAndExit (
|
||||
{
|
||||
FlDeleteFile (ASL_FILE_SOURCE_OUTPUT);
|
||||
}
|
||||
|
||||
/* Final cleanup after compiling one file */
|
||||
|
||||
CmDeleteCaches ();
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: CmDeleteCaches
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Delete all local cache buffer blocks
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
CmDeleteCaches (
|
||||
void)
|
||||
{
|
||||
UINT32 BufferCount;
|
||||
ASL_CACHE_INFO *Next;
|
||||
|
||||
|
||||
/* Parse Op cache */
|
||||
|
||||
BufferCount = 0;
|
||||
while (Gbl_ParseOpCacheList)
|
||||
{
|
||||
Next = Gbl_ParseOpCacheList->Next;
|
||||
ACPI_FREE (Gbl_ParseOpCacheList);
|
||||
Gbl_ParseOpCacheList = Next;
|
||||
BufferCount++;
|
||||
}
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"%u ParseOps, Buffer size: %u ops (%u bytes), %u Buffers\n",
|
||||
Gbl_ParseOpCount, ASL_PARSEOP_CACHE_SIZE,
|
||||
(sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE), BufferCount);
|
||||
|
||||
Gbl_ParseOpCount = 0;
|
||||
Gbl_ParseOpCacheNext = NULL;
|
||||
Gbl_ParseOpCacheLast = NULL;
|
||||
RootNode = NULL;
|
||||
|
||||
/* Generic string cache */
|
||||
|
||||
BufferCount = 0;
|
||||
while (Gbl_StringCacheList)
|
||||
{
|
||||
Next = Gbl_StringCacheList->Next;
|
||||
ACPI_FREE (Gbl_StringCacheList);
|
||||
Gbl_StringCacheList = Next;
|
||||
BufferCount++;
|
||||
}
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"%u Strings (%u bytes), Buffer size: %u bytes, %u Buffers\n",
|
||||
Gbl_StringCount, Gbl_StringSize, ASL_STRING_CACHE_SIZE, BufferCount);
|
||||
|
||||
Gbl_StringSize = 0;
|
||||
Gbl_StringCount = 0;
|
||||
Gbl_StringCacheNext = NULL;
|
||||
Gbl_StringCacheLast = NULL;
|
||||
}
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __ASLCOMPILER_H
|
||||
#define __ASLCOMPILER_H
|
||||
|
||||
@ -111,6 +110,11 @@ AslPushInputFileStack (
|
||||
FILE *InputFile,
|
||||
char *Filename);
|
||||
|
||||
void
|
||||
AslParserCleanup (
|
||||
void);
|
||||
|
||||
|
||||
/*
|
||||
* aslstartup - entered from main()
|
||||
*/
|
||||
@ -154,6 +158,14 @@ void
|
||||
CmCleanupAndExit (
|
||||
void);
|
||||
|
||||
void
|
||||
CmDeleteCaches (
|
||||
void);
|
||||
|
||||
|
||||
/*
|
||||
* aslascii - ascii support
|
||||
*/
|
||||
ACPI_STATUS
|
||||
FlCheckForAcpiTable (
|
||||
FILE *Handle);
|
||||
@ -275,6 +287,11 @@ void
|
||||
ApCheckRegMethod (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
BOOLEAN
|
||||
ApFindNameInScope (
|
||||
char *Name,
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
|
||||
/*
|
||||
* aslerror - error handling/reporting
|
||||
@ -890,10 +907,6 @@ void
|
||||
UtDisplaySummary (
|
||||
UINT32 FileId);
|
||||
|
||||
UINT8
|
||||
UtHexCharToValue (
|
||||
int HexChar);
|
||||
|
||||
void
|
||||
UtConvertByteToHex (
|
||||
UINT8 RawByte,
|
||||
@ -913,13 +926,17 @@ UtSetParseOpName (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
char *
|
||||
UtGetStringBuffer (
|
||||
UtStringCacheCalloc (
|
||||
UINT32 Length);
|
||||
|
||||
void
|
||||
UtExpandLineBuffers (
|
||||
void);
|
||||
|
||||
void
|
||||
UtFreeLineBuffers (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
UtInternalizeName (
|
||||
char *ExternalName,
|
||||
@ -954,11 +971,6 @@ ACPI_STATUS
|
||||
AuValidateUuid (
|
||||
char *InString);
|
||||
|
||||
ACPI_STATUS
|
||||
AuConvertStringToUuid (
|
||||
char *InString,
|
||||
char *UuIdBuffer);
|
||||
|
||||
ACPI_STATUS
|
||||
AuConvertUuidToString (
|
||||
char *UuIdBuffer,
|
||||
|
@ -110,10 +110,11 @@ NamePathTail [.]{NameSeg}
|
||||
[ \t] { count (0); }
|
||||
|
||||
|
||||
"/*" { if (!AslDoComment ()) yyterminate (); }
|
||||
"//" { if (!AslDoCommentType2 ()) yyterminate (); }
|
||||
"/*" { if (!AslDoComment ()) {yyterminate ();} }
|
||||
"//" { if (!AslDoCommentType2 ()) {yyterminate ();} }
|
||||
|
||||
"\"" { if (AslDoStringLiteral ()) return (PARSEOP_STRING_LITERAL); else yyterminate (); }
|
||||
"\"" { if (AslDoStringLiteral ()) {return (PARSEOP_STRING_LITERAL);}
|
||||
else {yyterminate ();} }
|
||||
";" { count (0); return(';'); }
|
||||
|
||||
|
||||
@ -607,7 +608,7 @@ NamePathTail [.]{NameSeg}
|
||||
|
||||
{NameSeg} { char *s;
|
||||
count (0);
|
||||
s=malloc (ACPI_NAME_SIZE + 1);
|
||||
s=UtStringCacheCalloc (ACPI_NAME_SIZE + 1);
|
||||
if (strcmp (AslCompilertext, "\\"))
|
||||
{
|
||||
strcpy (s, "____");
|
||||
@ -620,10 +621,9 @@ NamePathTail [.]{NameSeg}
|
||||
|
||||
{NameString} { char *s;
|
||||
count (0);
|
||||
s=malloc (strlen (AslCompilertext)+1);
|
||||
s=UtStringCacheCalloc (strlen (AslCompilertext)+1);
|
||||
AcpiUtStrupr (AslCompilertext);
|
||||
strcpy (s, AslCompilertext);
|
||||
s[strlen (AslCompilertext)] = 0;
|
||||
AslCompilerlval.s = s;
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "NameString: %s\n", s);
|
||||
return (PARSEOP_NAMESTRING); }
|
||||
@ -639,9 +639,9 @@ NamePathTail [.]{NameSeg}
|
||||
AslCompilererror (MsgBuffer);}
|
||||
|
||||
<<EOF>> { if (AslPopInputFileStack ())
|
||||
yyterminate();
|
||||
{yyterminate();}
|
||||
else
|
||||
return (PARSEOP_INCLUDE_END);};
|
||||
{return (PARSEOP_INCLUDE_END);} };
|
||||
|
||||
%%
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __ASLDEFINE_H
|
||||
#define __ASLDEFINE_H
|
||||
|
||||
@ -55,14 +54,14 @@
|
||||
#define ASL_INVOCATION_NAME "iasl"
|
||||
#define ASL_CREATOR_ID "INTL"
|
||||
|
||||
#define ASL_COMPLIANCE "Supports ACPI Specification Revision 5.0A"
|
||||
#define ASL_COMPLIANCE "Supports ACPI Specification Revision 5.1"
|
||||
|
||||
|
||||
/* Configuration constants */
|
||||
|
||||
#define ASL_MAX_ERROR_COUNT 200
|
||||
#define ASL_NODE_CACHE_SIZE 1024
|
||||
#define ASL_STRING_CACHE_SIZE 32768
|
||||
#define ASL_PARSEOP_CACHE_SIZE (1024 * 16)
|
||||
#define ASL_STRING_CACHE_SIZE (1024 * 64)
|
||||
|
||||
#define ASL_FIRST_PARSE_OPCODE PARSEOP_ACCESSAS
|
||||
#define ASL_PARSE_OPCODE_BASE PARSEOP_ACCESSAS /* First Lex type */
|
||||
|
@ -557,7 +557,7 @@ AslCommonError2 (
|
||||
{
|
||||
/* Allocate a buffer for the message and a new error node */
|
||||
|
||||
MessageBuffer = UtLocalCalloc (strlen (ExtraMessage) + 1);
|
||||
MessageBuffer = UtStringCacheCalloc (strlen (ExtraMessage) + 1);
|
||||
|
||||
/* Keep a copy of the extra message */
|
||||
|
||||
@ -571,7 +571,7 @@ AslCommonError2 (
|
||||
|
||||
if (Filename)
|
||||
{
|
||||
Enode->Filename = Filename;
|
||||
Enode->Filename = Filename;
|
||||
Enode->FilenameLength = strlen (Filename);
|
||||
if (Enode->FilenameLength < 6)
|
||||
{
|
||||
@ -643,7 +643,7 @@ AslCommonError (
|
||||
{
|
||||
/* Allocate a buffer for the message and a new error node */
|
||||
|
||||
MessageBuffer = UtLocalCalloc (strlen (ExtraMessage) + 1);
|
||||
MessageBuffer = UtStringCacheCalloc (strlen (ExtraMessage) + 1);
|
||||
|
||||
/* Keep a copy of the extra message */
|
||||
|
||||
@ -654,7 +654,7 @@ AslCommonError (
|
||||
|
||||
if (Filename)
|
||||
{
|
||||
Enode->Filename = Filename;
|
||||
Enode->Filename = Filename;
|
||||
Enode->FilenameLength = strlen (Filename);
|
||||
if (Enode->FilenameLength < 6)
|
||||
{
|
||||
|
@ -319,6 +319,8 @@ FlCloseFile (
|
||||
AslAbort ();
|
||||
}
|
||||
|
||||
/* Do not clear/free the filename string */
|
||||
|
||||
Gbl_Files[FileId].Handle = NULL;
|
||||
return;
|
||||
}
|
||||
|
@ -107,6 +107,8 @@ FlSetFilename (
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "\n#line: New filename %s (old %s)\n",
|
||||
Filename, Gbl_Files[ASL_FILE_INPUT].Filename);
|
||||
|
||||
/* No need to free any existing filename */
|
||||
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
|
||||
}
|
||||
|
||||
@ -216,14 +218,14 @@ FlMergePathnames (
|
||||
(*FilePathname == '/') ||
|
||||
(FilePathname[1] == ':'))
|
||||
{
|
||||
Pathname = ACPI_ALLOCATE (strlen (FilePathname) + 1);
|
||||
Pathname = UtStringCacheCalloc (strlen (FilePathname) + 1);
|
||||
strcpy (Pathname, FilePathname);
|
||||
goto ConvertBackslashes;
|
||||
}
|
||||
|
||||
/* Need a local copy of the prefix directory path */
|
||||
|
||||
CommonPath = ACPI_ALLOCATE (strlen (PrefixDir) + 1);
|
||||
CommonPath = UtStringCacheCalloc (strlen (PrefixDir) + 1);
|
||||
strcpy (CommonPath, PrefixDir);
|
||||
|
||||
/*
|
||||
@ -259,14 +261,13 @@ FlMergePathnames (
|
||||
/* Build the final merged pathname */
|
||||
|
||||
ConcatenatePaths:
|
||||
Pathname = ACPI_ALLOCATE_ZEROED (strlen (CommonPath) + strlen (FilePathname) + 2);
|
||||
Pathname = UtStringCacheCalloc (strlen (CommonPath) + strlen (FilePathname) + 2);
|
||||
if (LastElement && *CommonPath)
|
||||
{
|
||||
strcpy (Pathname, CommonPath);
|
||||
strcat (Pathname, "/");
|
||||
}
|
||||
strcat (Pathname, FilePathname);
|
||||
ACPI_FREE (CommonPath);
|
||||
|
||||
/* Convert all backslashes to normal slashes */
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "amlcode.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __ASLGLOBAL_H
|
||||
#define __ASLGLOBAL_H
|
||||
|
||||
@ -63,11 +62,6 @@
|
||||
|
||||
#ifdef _DECLARE_GLOBALS
|
||||
UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0};
|
||||
char AslHexLookup[] =
|
||||
{
|
||||
'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
|
||||
};
|
||||
|
||||
|
||||
/* Table below must match ASL_FILE_TYPES in asltypes.h */
|
||||
|
||||
@ -92,7 +86,6 @@ ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES] =
|
||||
|
||||
#else
|
||||
extern UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS];
|
||||
extern char AslHexLookup[];
|
||||
extern ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES];
|
||||
#endif
|
||||
|
||||
@ -102,12 +95,20 @@ extern ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES];
|
||||
*/
|
||||
extern int yydebug;
|
||||
extern FILE *AslCompilerin;
|
||||
extern int AslCompilerdebug;
|
||||
extern int DtParserdebug;
|
||||
extern int PrParserdebug;
|
||||
extern const ASL_MAPPING_ENTRY AslKeywordMapping[];
|
||||
extern char *AslCompilertext;
|
||||
|
||||
/*
|
||||
* Older versions of Bison won't emit this external in the generated header.
|
||||
* Newer versions do emit the external, so we don't need to do it.
|
||||
*/
|
||||
#ifndef ASLCOMPILER_ASLCOMPILERPARSE_H
|
||||
extern int AslCompilerdebug;
|
||||
#endif
|
||||
|
||||
|
||||
#define ASL_DEFAULT_LINE_BUFFER_SIZE (1024 * 32) /* 32K */
|
||||
#define ASL_MSG_BUFFER_SIZE 4096
|
||||
#define ASL_MAX_DISABLED_MESSAGES 32
|
||||
@ -207,6 +208,20 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalAllocated, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalFolds, 0);
|
||||
|
||||
|
||||
/* Local caches */
|
||||
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ParseOpCount, 0);
|
||||
ASL_EXTERN ASL_CACHE_INFO ASL_INIT_GLOBAL (*Gbl_ParseOpCacheList, NULL);
|
||||
ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_ParseOpCacheNext, NULL);
|
||||
ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_ParseOpCacheLast, NULL);
|
||||
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_StringCount, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_StringSize, 0);
|
||||
ASL_EXTERN ASL_CACHE_INFO ASL_INIT_GLOBAL (*Gbl_StringCacheList, NULL);
|
||||
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheNext, NULL);
|
||||
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheLast, NULL);
|
||||
|
||||
|
||||
/* Misc */
|
||||
|
||||
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_RevisionOverride, 0);
|
||||
@ -215,10 +230,6 @@ ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*RootNode, NULL);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_TableLength, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_SourceLine, 0);
|
||||
ASL_EXTERN ASL_LISTING_NODE ASL_INIT_GLOBAL (*Gbl_ListingNode, NULL);
|
||||
ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_NodeCacheNext, NULL);
|
||||
ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_NodeCacheLast, NULL);
|
||||
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheNext, NULL);
|
||||
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheLast, NULL);
|
||||
ASL_EXTERN ACPI_PARSE_OBJECT *Gbl_FirstLevelInsertionNode;
|
||||
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_FileType, 0);
|
||||
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_Signature, NULL);
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "amlcode.h"
|
||||
|
@ -129,6 +129,7 @@ LdLoadNamespace (
|
||||
/* Dump the namespace if debug is enabled */
|
||||
|
||||
AcpiNsDumpTables (ACPI_NS_ALL, ACPI_UINT32_MAX);
|
||||
ACPI_FREE (WalkState);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "acparser.h"
|
||||
|
@ -327,6 +327,7 @@ main (
|
||||
ACPI_STATUS Status;
|
||||
int Index1;
|
||||
int Index2;
|
||||
int ReturnStatus = 0;
|
||||
|
||||
|
||||
/*
|
||||
@ -392,16 +393,24 @@ main (
|
||||
Status = AslDoOneFile (argv[Index2]);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (-1);
|
||||
ReturnStatus = -1;
|
||||
goto CleanupAndExit;
|
||||
}
|
||||
|
||||
Index2++;
|
||||
}
|
||||
|
||||
|
||||
CleanupAndExit:
|
||||
|
||||
UtFreeLineBuffers ();
|
||||
|
||||
AslParserCleanup ();
|
||||
|
||||
if (AcpiGbl_ExternalFileList)
|
||||
{
|
||||
AcpiDmClearExternalFileList();
|
||||
}
|
||||
|
||||
return (0);
|
||||
return (ReturnStatus);
|
||||
}
|
||||
|
@ -233,6 +233,9 @@ const char *AslCompilerMsgs [] =
|
||||
/* ASL_MSG_WRITE */ "Could not write file",
|
||||
/* ASL_MSG_RANGE */ "Constant out of range",
|
||||
/* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer",
|
||||
/* ASL_MSG_MISSING_DEPENDENCY */ "Missing dependency",
|
||||
/* ASL_MSG_ILLEGAL_FORWARD_REF */ "Illegal forward reference within a method",
|
||||
/* ASL_MSG_ILLEGAL_METHOD_REF */ "Illegal reference across two methods"
|
||||
};
|
||||
|
||||
/* Table compiler */
|
||||
|
@ -235,6 +235,9 @@ typedef enum
|
||||
ASL_MSG_WRITE,
|
||||
ASL_MSG_RANGE,
|
||||
ASL_MSG_BUFFER_ALLOCATION,
|
||||
ASL_MSG_MISSING_DEPENDENCY,
|
||||
ASL_MSG_ILLEGAL_FORWARD_REF,
|
||||
ASL_MSG_ILLEGAL_METHOD_REF,
|
||||
|
||||
/* These messages are used by the Data Table compiler only */
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "acparser.h"
|
||||
@ -108,6 +107,41 @@ MtMethodAnalysisWalkBegin (
|
||||
|
||||
WalkInfo->MethodStack = MethodInfo;
|
||||
|
||||
/*
|
||||
* Special handling for _PSx methods. Dependency rules (same scope):
|
||||
*
|
||||
* 1) _PS0 - One of these must exist: _PS1, _PS2, _PS3
|
||||
* 2) _PS1/_PS2/_PS3: A _PS0 must exist
|
||||
*/
|
||||
if (ACPI_COMPARE_NAME (METHOD_NAME__PS0, Op->Asl.NameSeg))
|
||||
{
|
||||
/* For _PS0, one of _PS1/_PS2/_PS3 must exist */
|
||||
|
||||
if ((!ApFindNameInScope (METHOD_NAME__PS1, Op)) &&
|
||||
(!ApFindNameInScope (METHOD_NAME__PS2, Op)) &&
|
||||
(!ApFindNameInScope (METHOD_NAME__PS3, Op)))
|
||||
{
|
||||
AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
|
||||
"_PS0 requires one of _PS1/_PS2/_PS3 in same scope");
|
||||
}
|
||||
}
|
||||
else if (
|
||||
ACPI_COMPARE_NAME (METHOD_NAME__PS1, Op->Asl.NameSeg) ||
|
||||
ACPI_COMPARE_NAME (METHOD_NAME__PS2, Op->Asl.NameSeg) ||
|
||||
ACPI_COMPARE_NAME (METHOD_NAME__PS3, Op->Asl.NameSeg))
|
||||
{
|
||||
/* For _PS1/_PS2/_PS3, a _PS0 must exist */
|
||||
|
||||
if (!ApFindNameInScope (METHOD_NAME__PS0, Op))
|
||||
{
|
||||
sprintf (MsgBuffer,
|
||||
"%4.4s requires _PS0 in same scope", Op->Asl.NameSeg);
|
||||
|
||||
AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
|
||||
MsgBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the name node */
|
||||
|
||||
Next = Op->Asl.Child;
|
||||
@ -359,6 +393,17 @@ MtMethodAnalysisWalkBegin (
|
||||
break;
|
||||
|
||||
case PARSEOP_DEVICE:
|
||||
|
||||
Next = Op->Asl.Child;
|
||||
|
||||
if (!ApFindNameInScope (METHOD_NAME__HID, Next) &&
|
||||
!ApFindNameInScope (METHOD_NAME__ADR, Next))
|
||||
{
|
||||
AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
|
||||
"Device object requires a _HID or _ADR in same scope");
|
||||
}
|
||||
break;
|
||||
|
||||
case PARSEOP_EVENT:
|
||||
case PARSEOP_MUTEX:
|
||||
case PARSEOP_OPERATIONREGION:
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "acnamesp.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "amlcode.h"
|
||||
@ -623,10 +622,10 @@ OpcDoEisaId (
|
||||
(UINT32) ((UINT8) (InString[1] - 0x40)) << 21 |
|
||||
(UINT32) ((UINT8) (InString[2] - 0x40)) << 16 |
|
||||
|
||||
(UtHexCharToValue (InString[3])) << 12 |
|
||||
(UtHexCharToValue (InString[4])) << 8 |
|
||||
(UtHexCharToValue (InString[5])) << 4 |
|
||||
UtHexCharToValue (InString[6]);
|
||||
(AcpiUtAsciiCharToHex (InString[3])) << 12 |
|
||||
(AcpiUtAsciiCharToHex (InString[4])) << 8 |
|
||||
(AcpiUtAsciiCharToHex (InString[5])) << 4 |
|
||||
AcpiUtAsciiCharToHex (InString[6]);
|
||||
|
||||
/* Swap to little-endian to get final ID (see function header) */
|
||||
|
||||
@ -666,7 +665,7 @@ OpcDoUuId (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
char *InString;
|
||||
char *Buffer;
|
||||
UINT8 *Buffer;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_PARSE_OBJECT *NewOp;
|
||||
|
||||
@ -681,7 +680,7 @@ OpcDoUuId (
|
||||
}
|
||||
else
|
||||
{
|
||||
(void) AuConvertStringToUuid (InString, Buffer);
|
||||
AcpiUtConvertStringToUuid (InString, Buffer);
|
||||
}
|
||||
|
||||
/* Change Op to a Buffer */
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "amlcode.h"
|
||||
@ -913,8 +912,8 @@ OpnDoDefinitionBlock (
|
||||
* We will use the AML filename that is embedded in the source file
|
||||
* for the output filename.
|
||||
*/
|
||||
Filename = ACPI_ALLOCATE (strlen (Gbl_DirectoryPath) +
|
||||
strlen ((char *) Child->Asl.Value.Buffer) + 1);
|
||||
Filename = UtStringCacheCalloc (strlen (Gbl_DirectoryPath) +
|
||||
strlen ((char *) Child->Asl.Value.Buffer) + 1);
|
||||
|
||||
/* Prepend the current directory path */
|
||||
|
||||
@ -969,7 +968,7 @@ OpnDoDefinitionBlock (
|
||||
if (Child->Asl.Value.String)
|
||||
{
|
||||
Length = ACPI_STRLEN (Child->Asl.Value.String);
|
||||
Gbl_TableId = AcpiOsAllocate (Length + 1);
|
||||
Gbl_TableId = UtStringCacheCalloc (Length + 1);
|
||||
ACPI_STRCPY (Gbl_TableId, Child->Asl.Value.String);
|
||||
|
||||
/*
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
|
||||
@ -168,7 +167,7 @@ OptSearchToRoot (
|
||||
|
||||
/* We must allocate a new string for the name (TargetPath gets deleted) */
|
||||
|
||||
*NewPath = ACPI_ALLOCATE_ZEROED (ACPI_NAME_SIZE + 1);
|
||||
*NewPath = UtStringCacheCalloc (ACPI_NAME_SIZE + 1);
|
||||
ACPI_STRCPY (*NewPath, Path);
|
||||
|
||||
if (ACPI_STRNCMP (*NewPath, "_T_", 3))
|
||||
|
129
source/compiler/aslparser.y
Normal file
129
source/compiler/aslparser.y
Normal file
@ -0,0 +1,129 @@
|
||||
%{
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslparser.y - Master Bison/Yacc input file for iASL
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* NO WARRANTY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("aslparse")
|
||||
|
||||
/*
|
||||
* Global Notes:
|
||||
*
|
||||
* October 2005: The following list terms have been optimized (from the
|
||||
* original ASL grammar in the ACPI specification) to force the immediate
|
||||
* reduction of each list item so that the parse stack use doesn't increase on
|
||||
* each list element and possibly overflow on very large lists (>4000 items).
|
||||
* This dramatically reduces use of the parse stack overall.
|
||||
*
|
||||
* ArgList, TermList, Objectlist, ByteList, DWordList, PackageList,
|
||||
* ResourceMacroList, and FieldUnitList
|
||||
*/
|
||||
|
||||
void * AslLocalAllocate (unsigned int Size);
|
||||
|
||||
/* Bison/yacc configuration */
|
||||
|
||||
#define static
|
||||
#undef malloc
|
||||
#define malloc AslLocalAllocate
|
||||
#undef alloca
|
||||
#define alloca AslLocalAllocate
|
||||
#define yytname AslCompilername
|
||||
|
||||
#define YYINITDEPTH 600 /* State stack depth */
|
||||
#define YYDEBUG 1 /* Enable debug output */
|
||||
#define YYERROR_VERBOSE 1 /* Verbose error messages */
|
||||
#define YYFLAG -32768
|
||||
|
||||
/* Define YYMALLOC/YYFREE to prevent redefinition errors */
|
||||
|
||||
#define YYMALLOC malloc
|
||||
#define YYFREE free
|
||||
%}
|
||||
|
||||
/*
|
||||
* Declare the type of values in the grammar
|
||||
*/
|
||||
%union {
|
||||
UINT64 i;
|
||||
char *s;
|
||||
ACPI_PARSE_OBJECT *n;
|
||||
}
|
||||
|
||||
/*
|
||||
* These shift/reduce conflicts are expected. There should be zero
|
||||
* reduce/reduce conflicts.
|
||||
*/
|
||||
%expect 86
|
||||
|
||||
/*! [Begin] no source code translation */
|
||||
|
||||
/*
|
||||
* The M4 macro processor is used to bring in the parser items,
|
||||
* in order to keep this master file smaller, and to break up
|
||||
* the various parser items.
|
||||
*/
|
||||
m4_define(NoEcho)
|
||||
|
||||
/* Token types */
|
||||
|
||||
m4_include(asltokens.y)
|
||||
|
||||
/* Production types/names */
|
||||
|
||||
m4_include(asltypes.y)
|
||||
%%
|
||||
|
||||
/* Production rules */
|
||||
|
||||
m4_include(aslrules.y)
|
||||
%%
|
||||
|
||||
/*! [End] no source code translation !*/
|
||||
|
||||
/* Local support functions in C */
|
||||
|
||||
m4_include(aslsupport.y)
|
@ -289,6 +289,41 @@ ApCheckPackage (
|
||||
Package, 1, Count);
|
||||
break;
|
||||
|
||||
case ACPI_PTYPE2_UUID_PAIR:
|
||||
|
||||
/* The package contains a variable list of UUID Buffer/Package pairs */
|
||||
|
||||
/* The length of the package must be even */
|
||||
|
||||
if (Count & 1)
|
||||
{
|
||||
sprintf (MsgBuffer, "%4.4s: Package length, %d, must be even.",
|
||||
Predefined->Info.Name, Count);
|
||||
|
||||
AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH,
|
||||
ParentOp->Asl.Child, MsgBuffer);
|
||||
}
|
||||
|
||||
/* Validate the alternating types */
|
||||
|
||||
for (i = 0; i < Count; ++i)
|
||||
{
|
||||
if (i & 1)
|
||||
{
|
||||
ApCheckObjectType (Predefined->Info.Name, Op,
|
||||
Package->RetInfo.ObjectType2, i);
|
||||
}
|
||||
else
|
||||
{
|
||||
ApCheckObjectType (Predefined->Info.Name, Op,
|
||||
Package->RetInfo.ObjectType1, i);
|
||||
}
|
||||
|
||||
Op = Op->Asl.Next;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case ACPI_PTYPE2:
|
||||
case ACPI_PTYPE2_FIXED:
|
||||
case ACPI_PTYPE2_MIN:
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "amlcode.h"
|
||||
@ -123,22 +122,10 @@ RsSmallAddressCheck (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Special case for Memory24, values are compressed */
|
||||
|
||||
if (Type == ACPI_RESOURCE_NAME_MEMORY24)
|
||||
{
|
||||
if (!Alignment) /* Alignment==0 means 64K - no invalid alignment */
|
||||
{
|
||||
Alignment = ACPI_UINT16_MAX + 1;
|
||||
}
|
||||
|
||||
Minimum <<= 8;
|
||||
Maximum <<= 8;
|
||||
Length *= 256;
|
||||
}
|
||||
|
||||
/* IO descriptor has different definition of min/max, don't check */
|
||||
|
||||
/*
|
||||
* Range checks for Memory24 and Memory32.
|
||||
* IO descriptor has different definition of min/max, don't check.
|
||||
*/
|
||||
if (Type != ACPI_RESOURCE_NAME_IO)
|
||||
{
|
||||
/* Basic checks on Min/Max/Length */
|
||||
@ -151,6 +138,19 @@ RsSmallAddressCheck (
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_INVALID_LENGTH, LengthOp, NULL);
|
||||
}
|
||||
|
||||
/* Special case for Memory24, min/max values are compressed */
|
||||
|
||||
if (Type == ACPI_RESOURCE_NAME_MEMORY24)
|
||||
{
|
||||
if (!Alignment) /* Alignment==0 means 64K alignment */
|
||||
{
|
||||
Alignment = ACPI_UINT16_MAX + 1;
|
||||
}
|
||||
|
||||
Minimum <<= 8;
|
||||
Maximum <<= 8;
|
||||
}
|
||||
}
|
||||
|
||||
/* Alignment of zero is not in ACPI spec, but is used to mean byte acc */
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "amlcode.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "amlcode.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
%{
|
||||
NoEcho('
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslcompiler.y - Bison/Yacc input file (ASL grammar and actions)
|
||||
* Module Name: aslrules.y - Bison/Yacc production rules
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@ -42,755 +42,8 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
')
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("aslparse")
|
||||
|
||||
/*
|
||||
* Global Notes:
|
||||
*
|
||||
* October 2005: The following list terms have been optimized (from the
|
||||
* original ASL grammar in the ACPI specification) to force the immediate
|
||||
* reduction of each list item so that the parse stack use doesn't increase on
|
||||
* each list element and possibly overflow on very large lists (>4000 items).
|
||||
* This dramatically reduces use of the parse stack overall.
|
||||
*
|
||||
* ArgList, TermList, Objectlist, ByteList, DWordList, PackageList,
|
||||
* ResourceMacroList, and FieldUnitList
|
||||
*/
|
||||
|
||||
void * AslLocalAllocate (unsigned int Size);
|
||||
|
||||
/* Bison/yacc configuration */
|
||||
|
||||
#define static
|
||||
#undef alloca
|
||||
#define alloca AslLocalAllocate
|
||||
#define yytname AslCompilername
|
||||
|
||||
#define YYINITDEPTH 600 /* State stack depth */
|
||||
#define YYDEBUG 1 /* Enable debug output */
|
||||
#define YYERROR_VERBOSE 1 /* Verbose error messages */
|
||||
|
||||
/* Define YYMALLOC/YYFREE to prevent redefinition errors */
|
||||
|
||||
#define YYMALLOC malloc
|
||||
#define YYFREE free
|
||||
|
||||
/*
|
||||
* The windows version of bison defines this incorrectly as "32768" (Not negative).
|
||||
* We use a custom (edited binary) version of bison that defines YYFLAG as YYFBAD
|
||||
* instead (#define YYFBAD 32768), so we can define it correctly here.
|
||||
*
|
||||
* The problem is that if YYFLAG is positive, the extended syntax error messages
|
||||
* are disabled.
|
||||
*/
|
||||
#define YYFLAG -32768
|
||||
|
||||
%}
|
||||
|
||||
/*
|
||||
* Declare the type of values in the grammar
|
||||
*/
|
||||
%union {
|
||||
UINT64 i;
|
||||
char *s;
|
||||
ACPI_PARSE_OBJECT *n;
|
||||
}
|
||||
|
||||
/*! [Begin] no source code translation */
|
||||
|
||||
/*
|
||||
* These shift/reduce conflicts are expected. There should be zero
|
||||
* reduce/reduce conflicts.
|
||||
*/
|
||||
%expect 86
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Token types: These are returned by the lexer
|
||||
*
|
||||
* NOTE: This list MUST match the AslKeywordMapping table found
|
||||
* in aslmap.c EXACTLY! Double check any changes!
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
%token <i> PARSEOP_ACCESSAS
|
||||
%token <i> PARSEOP_ACCESSATTRIB_BLOCK
|
||||
%token <i> PARSEOP_ACCESSATTRIB_BLOCK_CALL
|
||||
%token <i> PARSEOP_ACCESSATTRIB_BYTE
|
||||
%token <i> PARSEOP_ACCESSATTRIB_MULTIBYTE
|
||||
%token <i> PARSEOP_ACCESSATTRIB_QUICK
|
||||
%token <i> PARSEOP_ACCESSATTRIB_RAW_BYTES
|
||||
%token <i> PARSEOP_ACCESSATTRIB_RAW_PROCESS
|
||||
%token <i> PARSEOP_ACCESSATTRIB_SND_RCV
|
||||
%token <i> PARSEOP_ACCESSATTRIB_WORD
|
||||
%token <i> PARSEOP_ACCESSATTRIB_WORD_CALL
|
||||
%token <i> PARSEOP_ACCESSTYPE_ANY
|
||||
%token <i> PARSEOP_ACCESSTYPE_BUF
|
||||
%token <i> PARSEOP_ACCESSTYPE_BYTE
|
||||
%token <i> PARSEOP_ACCESSTYPE_DWORD
|
||||
%token <i> PARSEOP_ACCESSTYPE_QWORD
|
||||
%token <i> PARSEOP_ACCESSTYPE_WORD
|
||||
%token <i> PARSEOP_ACQUIRE
|
||||
%token <i> PARSEOP_ADD
|
||||
%token <i> PARSEOP_ADDRESSINGMODE_7BIT
|
||||
%token <i> PARSEOP_ADDRESSINGMODE_10BIT
|
||||
%token <i> PARSEOP_ADDRESSTYPE_ACPI
|
||||
%token <i> PARSEOP_ADDRESSTYPE_MEMORY
|
||||
%token <i> PARSEOP_ADDRESSTYPE_NVS
|
||||
%token <i> PARSEOP_ADDRESSTYPE_RESERVED
|
||||
%token <i> PARSEOP_ALIAS
|
||||
%token <i> PARSEOP_AND
|
||||
%token <i> PARSEOP_ARG0
|
||||
%token <i> PARSEOP_ARG1
|
||||
%token <i> PARSEOP_ARG2
|
||||
%token <i> PARSEOP_ARG3
|
||||
%token <i> PARSEOP_ARG4
|
||||
%token <i> PARSEOP_ARG5
|
||||
%token <i> PARSEOP_ARG6
|
||||
%token <i> PARSEOP_BANKFIELD
|
||||
%token <i> PARSEOP_BITSPERBYTE_EIGHT
|
||||
%token <i> PARSEOP_BITSPERBYTE_FIVE
|
||||
%token <i> PARSEOP_BITSPERBYTE_NINE
|
||||
%token <i> PARSEOP_BITSPERBYTE_SEVEN
|
||||
%token <i> PARSEOP_BITSPERBYTE_SIX
|
||||
%token <i> PARSEOP_BREAK
|
||||
%token <i> PARSEOP_BREAKPOINT
|
||||
%token <i> PARSEOP_BUFFER
|
||||
%token <i> PARSEOP_BUSMASTERTYPE_MASTER
|
||||
%token <i> PARSEOP_BUSMASTERTYPE_NOTMASTER
|
||||
%token <i> PARSEOP_BYTECONST
|
||||
%token <i> PARSEOP_CASE
|
||||
%token <i> PARSEOP_CLOCKPHASE_FIRST
|
||||
%token <i> PARSEOP_CLOCKPHASE_SECOND
|
||||
%token <i> PARSEOP_CLOCKPOLARITY_HIGH
|
||||
%token <i> PARSEOP_CLOCKPOLARITY_LOW
|
||||
%token <i> PARSEOP_CONCATENATE
|
||||
%token <i> PARSEOP_CONCATENATERESTEMPLATE
|
||||
%token <i> PARSEOP_CONDREFOF
|
||||
%token <i> PARSEOP_CONNECTION
|
||||
%token <i> PARSEOP_CONTINUE
|
||||
%token <i> PARSEOP_COPYOBJECT
|
||||
%token <i> PARSEOP_CREATEBITFIELD
|
||||
%token <i> PARSEOP_CREATEBYTEFIELD
|
||||
%token <i> PARSEOP_CREATEDWORDFIELD
|
||||
%token <i> PARSEOP_CREATEFIELD
|
||||
%token <i> PARSEOP_CREATEQWORDFIELD
|
||||
%token <i> PARSEOP_CREATEWORDFIELD
|
||||
%token <i> PARSEOP_DATABUFFER
|
||||
%token <i> PARSEOP_DATATABLEREGION
|
||||
%token <i> PARSEOP_DEBUG
|
||||
%token <i> PARSEOP_DECODETYPE_POS
|
||||
%token <i> PARSEOP_DECODETYPE_SUB
|
||||
%token <i> PARSEOP_DECREMENT
|
||||
%token <i> PARSEOP_DEFAULT
|
||||
%token <i> PARSEOP_DEFAULT_ARG
|
||||
%token <i> PARSEOP_DEFINITIONBLOCK
|
||||
%token <i> PARSEOP_DEREFOF
|
||||
%token <i> PARSEOP_DEVICE
|
||||
%token <i> PARSEOP_DEVICEPOLARITY_HIGH
|
||||
%token <i> PARSEOP_DEVICEPOLARITY_LOW
|
||||
%token <i> PARSEOP_DIVIDE
|
||||
%token <i> PARSEOP_DMA
|
||||
%token <i> PARSEOP_DMATYPE_A
|
||||
%token <i> PARSEOP_DMATYPE_COMPATIBILITY
|
||||
%token <i> PARSEOP_DMATYPE_B
|
||||
%token <i> PARSEOP_DMATYPE_F
|
||||
%token <i> PARSEOP_DWORDCONST
|
||||
%token <i> PARSEOP_DWORDIO
|
||||
%token <i> PARSEOP_DWORDMEMORY
|
||||
%token <i> PARSEOP_DWORDSPACE
|
||||
%token <i> PARSEOP_EISAID
|
||||
%token <i> PARSEOP_ELSE
|
||||
%token <i> PARSEOP_ELSEIF
|
||||
%token <i> PARSEOP_ENDDEPENDENTFN
|
||||
%token <i> PARSEOP_ENDIAN_BIG
|
||||
%token <i> PARSEOP_ENDIAN_LITTLE
|
||||
%token <i> PARSEOP_ENDTAG
|
||||
%token <i> PARSEOP_ERRORNODE
|
||||
%token <i> PARSEOP_EVENT
|
||||
%token <i> PARSEOP_EXTENDEDIO
|
||||
%token <i> PARSEOP_EXTENDEDMEMORY
|
||||
%token <i> PARSEOP_EXTENDEDSPACE
|
||||
%token <i> PARSEOP_EXTERNAL
|
||||
%token <i> PARSEOP_FATAL
|
||||
%token <i> PARSEOP_FIELD
|
||||
%token <i> PARSEOP_FINDSETLEFTBIT
|
||||
%token <i> PARSEOP_FINDSETRIGHTBIT
|
||||
%token <i> PARSEOP_FIXEDDMA
|
||||
%token <i> PARSEOP_FIXEDIO
|
||||
%token <i> PARSEOP_FLOWCONTROL_HW
|
||||
%token <i> PARSEOP_FLOWCONTROL_NONE
|
||||
%token <i> PARSEOP_FLOWCONTROL_SW
|
||||
%token <i> PARSEOP_FROMBCD
|
||||
%token <i> PARSEOP_FUNCTION
|
||||
%token <i> PARSEOP_GPIO_INT
|
||||
%token <i> PARSEOP_GPIO_IO
|
||||
%token <i> PARSEOP_I2C_SERIALBUS
|
||||
%token <i> PARSEOP_IF
|
||||
%token <i> PARSEOP_INCLUDE
|
||||
%token <i> PARSEOP_INCLUDE_END
|
||||
%token <i> PARSEOP_INCREMENT
|
||||
%token <i> PARSEOP_INDEX
|
||||
%token <i> PARSEOP_INDEXFIELD
|
||||
%token <i> PARSEOP_INTEGER
|
||||
%token <i> PARSEOP_INTERRUPT
|
||||
%token <i> PARSEOP_INTLEVEL_ACTIVEBOTH
|
||||
%token <i> PARSEOP_INTLEVEL_ACTIVEHIGH
|
||||
%token <i> PARSEOP_INTLEVEL_ACTIVELOW
|
||||
%token <i> PARSEOP_INTTYPE_EDGE
|
||||
%token <i> PARSEOP_INTTYPE_LEVEL
|
||||
%token <i> PARSEOP_IO
|
||||
%token <i> PARSEOP_IODECODETYPE_10
|
||||
%token <i> PARSEOP_IODECODETYPE_16
|
||||
%token <i> PARSEOP_IORESTRICT_IN
|
||||
%token <i> PARSEOP_IORESTRICT_NONE
|
||||
%token <i> PARSEOP_IORESTRICT_OUT
|
||||
%token <i> PARSEOP_IORESTRICT_PRESERVE
|
||||
%token <i> PARSEOP_IRQ
|
||||
%token <i> PARSEOP_IRQNOFLAGS
|
||||
%token <i> PARSEOP_LAND
|
||||
%token <i> PARSEOP_LEQUAL
|
||||
%token <i> PARSEOP_LGREATER
|
||||
%token <i> PARSEOP_LGREATEREQUAL
|
||||
%token <i> PARSEOP_LLESS
|
||||
%token <i> PARSEOP_LLESSEQUAL
|
||||
%token <i> PARSEOP_LNOT
|
||||
%token <i> PARSEOP_LNOTEQUAL
|
||||
%token <i> PARSEOP_LOAD
|
||||
%token <i> PARSEOP_LOADTABLE
|
||||
%token <i> PARSEOP_LOCAL0
|
||||
%token <i> PARSEOP_LOCAL1
|
||||
%token <i> PARSEOP_LOCAL2
|
||||
%token <i> PARSEOP_LOCAL3
|
||||
%token <i> PARSEOP_LOCAL4
|
||||
%token <i> PARSEOP_LOCAL5
|
||||
%token <i> PARSEOP_LOCAL6
|
||||
%token <i> PARSEOP_LOCAL7
|
||||
%token <i> PARSEOP_LOCKRULE_LOCK
|
||||
%token <i> PARSEOP_LOCKRULE_NOLOCK
|
||||
%token <i> PARSEOP_LOR
|
||||
%token <i> PARSEOP_MATCH
|
||||
%token <i> PARSEOP_MATCHTYPE_MEQ
|
||||
%token <i> PARSEOP_MATCHTYPE_MGE
|
||||
%token <i> PARSEOP_MATCHTYPE_MGT
|
||||
%token <i> PARSEOP_MATCHTYPE_MLE
|
||||
%token <i> PARSEOP_MATCHTYPE_MLT
|
||||
%token <i> PARSEOP_MATCHTYPE_MTR
|
||||
%token <i> PARSEOP_MAXTYPE_FIXED
|
||||
%token <i> PARSEOP_MAXTYPE_NOTFIXED
|
||||
%token <i> PARSEOP_MEMORY24
|
||||
%token <i> PARSEOP_MEMORY32
|
||||
%token <i> PARSEOP_MEMORY32FIXED
|
||||
%token <i> PARSEOP_MEMTYPE_CACHEABLE
|
||||
%token <i> PARSEOP_MEMTYPE_NONCACHEABLE
|
||||
%token <i> PARSEOP_MEMTYPE_PREFETCHABLE
|
||||
%token <i> PARSEOP_MEMTYPE_WRITECOMBINING
|
||||
%token <i> PARSEOP_METHOD
|
||||
%token <i> PARSEOP_METHODCALL
|
||||
%token <i> PARSEOP_MID
|
||||
%token <i> PARSEOP_MINTYPE_FIXED
|
||||
%token <i> PARSEOP_MINTYPE_NOTFIXED
|
||||
%token <i> PARSEOP_MOD
|
||||
%token <i> PARSEOP_MULTIPLY
|
||||
%token <i> PARSEOP_MUTEX
|
||||
%token <i> PARSEOP_NAME
|
||||
%token <s> PARSEOP_NAMESEG
|
||||
%token <s> PARSEOP_NAMESTRING
|
||||
%token <i> PARSEOP_NAND
|
||||
%token <i> PARSEOP_NOOP
|
||||
%token <i> PARSEOP_NOR
|
||||
%token <i> PARSEOP_NOT
|
||||
%token <i> PARSEOP_NOTIFY
|
||||
%token <i> PARSEOP_OBJECTTYPE
|
||||
%token <i> PARSEOP_OBJECTTYPE_BFF
|
||||
%token <i> PARSEOP_OBJECTTYPE_BUF
|
||||
%token <i> PARSEOP_OBJECTTYPE_DDB
|
||||
%token <i> PARSEOP_OBJECTTYPE_DEV
|
||||
%token <i> PARSEOP_OBJECTTYPE_EVT
|
||||
%token <i> PARSEOP_OBJECTTYPE_FLD
|
||||
%token <i> PARSEOP_OBJECTTYPE_INT
|
||||
%token <i> PARSEOP_OBJECTTYPE_MTH
|
||||
%token <i> PARSEOP_OBJECTTYPE_MTX
|
||||
%token <i> PARSEOP_OBJECTTYPE_OPR
|
||||
%token <i> PARSEOP_OBJECTTYPE_PKG
|
||||
%token <i> PARSEOP_OBJECTTYPE_POW
|
||||
%token <i> PARSEOP_OBJECTTYPE_PRO
|
||||
%token <i> PARSEOP_OBJECTTYPE_STR
|
||||
%token <i> PARSEOP_OBJECTTYPE_THZ
|
||||
%token <i> PARSEOP_OBJECTTYPE_UNK
|
||||
%token <i> PARSEOP_OFFSET
|
||||
%token <i> PARSEOP_ONE
|
||||
%token <i> PARSEOP_ONES
|
||||
%token <i> PARSEOP_OPERATIONREGION
|
||||
%token <i> PARSEOP_OR
|
||||
%token <i> PARSEOP_PACKAGE
|
||||
%token <i> PARSEOP_PACKAGE_LENGTH
|
||||
%token <i> PARSEOP_PARITYTYPE_EVEN
|
||||
%token <i> PARSEOP_PARITYTYPE_MARK
|
||||
%token <i> PARSEOP_PARITYTYPE_NONE
|
||||
%token <i> PARSEOP_PARITYTYPE_ODD
|
||||
%token <i> PARSEOP_PARITYTYPE_SPACE
|
||||
%token <i> PARSEOP_PIN_NOPULL
|
||||
%token <i> PARSEOP_PIN_PULLDEFAULT
|
||||
%token <i> PARSEOP_PIN_PULLDOWN
|
||||
%token <i> PARSEOP_PIN_PULLUP
|
||||
%token <i> PARSEOP_POWERRESOURCE
|
||||
%token <i> PARSEOP_PROCESSOR
|
||||
%token <i> PARSEOP_QWORDCONST
|
||||
%token <i> PARSEOP_QWORDIO
|
||||
%token <i> PARSEOP_QWORDMEMORY
|
||||
%token <i> PARSEOP_QWORDSPACE
|
||||
%token <i> PARSEOP_RANGETYPE_ENTIRE
|
||||
%token <i> PARSEOP_RANGETYPE_ISAONLY
|
||||
%token <i> PARSEOP_RANGETYPE_NONISAONLY
|
||||
%token <i> PARSEOP_RAW_DATA
|
||||
%token <i> PARSEOP_READWRITETYPE_BOTH
|
||||
%token <i> PARSEOP_READWRITETYPE_READONLY
|
||||
%token <i> PARSEOP_REFOF
|
||||
%token <i> PARSEOP_REGIONSPACE_CMOS
|
||||
%token <i> PARSEOP_REGIONSPACE_EC
|
||||
%token <i> PARSEOP_REGIONSPACE_FFIXEDHW
|
||||
%token <i> PARSEOP_REGIONSPACE_GPIO
|
||||
%token <i> PARSEOP_REGIONSPACE_GSBUS
|
||||
%token <i> PARSEOP_REGIONSPACE_IO
|
||||
%token <i> PARSEOP_REGIONSPACE_IPMI
|
||||
%token <i> PARSEOP_REGIONSPACE_MEM
|
||||
%token <i> PARSEOP_REGIONSPACE_PCC
|
||||
%token <i> PARSEOP_REGIONSPACE_PCI
|
||||
%token <i> PARSEOP_REGIONSPACE_PCIBAR
|
||||
%token <i> PARSEOP_REGIONSPACE_SMBUS
|
||||
%token <i> PARSEOP_REGISTER
|
||||
%token <i> PARSEOP_RELEASE
|
||||
%token <i> PARSEOP_RESERVED_BYTES
|
||||
%token <i> PARSEOP_RESET
|
||||
%token <i> PARSEOP_RESOURCETEMPLATE
|
||||
%token <i> PARSEOP_RESOURCETYPE_CONSUMER
|
||||
%token <i> PARSEOP_RESOURCETYPE_PRODUCER
|
||||
%token <i> PARSEOP_RETURN
|
||||
%token <i> PARSEOP_REVISION
|
||||
%token <i> PARSEOP_SCOPE
|
||||
%token <i> PARSEOP_SERIALIZERULE_NOTSERIAL
|
||||
%token <i> PARSEOP_SERIALIZERULE_SERIAL
|
||||
%token <i> PARSEOP_SHARETYPE_EXCLUSIVE
|
||||
%token <i> PARSEOP_SHARETYPE_EXCLUSIVEWAKE
|
||||
%token <i> PARSEOP_SHARETYPE_SHARED
|
||||
%token <i> PARSEOP_SHARETYPE_SHAREDWAKE
|
||||
%token <i> PARSEOP_SHIFTLEFT
|
||||
%token <i> PARSEOP_SHIFTRIGHT
|
||||
%token <i> PARSEOP_SIGNAL
|
||||
%token <i> PARSEOP_SIZEOF
|
||||
%token <i> PARSEOP_SLAVEMODE_CONTROLLERINIT
|
||||
%token <i> PARSEOP_SLAVEMODE_DEVICEINIT
|
||||
%token <i> PARSEOP_SLEEP
|
||||
%token <i> PARSEOP_SPI_SERIALBUS
|
||||
%token <i> PARSEOP_STALL
|
||||
%token <i> PARSEOP_STARTDEPENDENTFN
|
||||
%token <i> PARSEOP_STARTDEPENDENTFN_NOPRI
|
||||
%token <i> PARSEOP_STOPBITS_ONE
|
||||
%token <i> PARSEOP_STOPBITS_ONEPLUSHALF
|
||||
%token <i> PARSEOP_STOPBITS_TWO
|
||||
%token <i> PARSEOP_STOPBITS_ZERO
|
||||
%token <i> PARSEOP_STORE
|
||||
%token <s> PARSEOP_STRING_LITERAL
|
||||
%token <i> PARSEOP_SUBTRACT
|
||||
%token <i> PARSEOP_SWITCH
|
||||
%token <i> PARSEOP_THERMALZONE
|
||||
%token <i> PARSEOP_TIMER
|
||||
%token <i> PARSEOP_TOBCD
|
||||
%token <i> PARSEOP_TOBUFFER
|
||||
%token <i> PARSEOP_TODECIMALSTRING
|
||||
%token <i> PARSEOP_TOHEXSTRING
|
||||
%token <i> PARSEOP_TOINTEGER
|
||||
%token <i> PARSEOP_TOSTRING
|
||||
%token <i> PARSEOP_TOUUID
|
||||
%token <i> PARSEOP_TRANSLATIONTYPE_DENSE
|
||||
%token <i> PARSEOP_TRANSLATIONTYPE_SPARSE
|
||||
%token <i> PARSEOP_TYPE_STATIC
|
||||
%token <i> PARSEOP_TYPE_TRANSLATION
|
||||
%token <i> PARSEOP_UART_SERIALBUS
|
||||
%token <i> PARSEOP_UNICODE
|
||||
%token <i> PARSEOP_UNLOAD
|
||||
%token <i> PARSEOP_UPDATERULE_ONES
|
||||
%token <i> PARSEOP_UPDATERULE_PRESERVE
|
||||
%token <i> PARSEOP_UPDATERULE_ZEROS
|
||||
%token <i> PARSEOP_VAR_PACKAGE
|
||||
%token <i> PARSEOP_VENDORLONG
|
||||
%token <i> PARSEOP_VENDORSHORT
|
||||
%token <i> PARSEOP_WAIT
|
||||
%token <i> PARSEOP_WHILE
|
||||
%token <i> PARSEOP_WIREMODE_FOUR
|
||||
%token <i> PARSEOP_WIREMODE_THREE
|
||||
%token <i> PARSEOP_WORDBUSNUMBER
|
||||
%token <i> PARSEOP_WORDCONST
|
||||
%token <i> PARSEOP_WORDIO
|
||||
%token <i> PARSEOP_WORDSPACE
|
||||
%token <i> PARSEOP_XFERSIZE_8
|
||||
%token <i> PARSEOP_XFERSIZE_16
|
||||
%token <i> PARSEOP_XFERSIZE_32
|
||||
%token <i> PARSEOP_XFERSIZE_64
|
||||
%token <i> PARSEOP_XFERSIZE_128
|
||||
%token <i> PARSEOP_XFERSIZE_256
|
||||
%token <i> PARSEOP_XFERTYPE_8
|
||||
%token <i> PARSEOP_XFERTYPE_8_16
|
||||
%token <i> PARSEOP_XFERTYPE_16
|
||||
%token <i> PARSEOP_XOR
|
||||
%token <i> PARSEOP_ZERO
|
||||
|
||||
/*
|
||||
* Special functions. These should probably stay at the end of this
|
||||
* table.
|
||||
*/
|
||||
%token <i> PARSEOP___DATE__
|
||||
%token <i> PARSEOP___FILE__
|
||||
%token <i> PARSEOP___LINE__
|
||||
%token <i> PARSEOP___PATH__
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Production names
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
%type <n> ArgList
|
||||
%type <n> ASLCode
|
||||
%type <n> BufferData
|
||||
%type <n> BufferTermData
|
||||
%type <n> CompilerDirective
|
||||
%type <n> DataObject
|
||||
%type <n> DefinitionBlockTerm
|
||||
%type <n> IntegerData
|
||||
%type <n> NamedObject
|
||||
%type <n> NameSpaceModifier
|
||||
%type <n> Object
|
||||
%type <n> ObjectList
|
||||
%type <n> PackageData
|
||||
%type <n> ParameterTypePackage
|
||||
%type <n> ParameterTypePackageList
|
||||
%type <n> ParameterTypesPackage
|
||||
%type <n> ParameterTypesPackageList
|
||||
%type <n> RequiredTarget
|
||||
%type <n> SimpleTarget
|
||||
%type <n> StringData
|
||||
%type <n> Target
|
||||
%type <n> Term
|
||||
%type <n> TermArg
|
||||
%type <n> TermList
|
||||
%type <n> UserTerm
|
||||
|
||||
/* Type4Opcode is obsolete */
|
||||
|
||||
%type <n> Type1Opcode
|
||||
%type <n> Type2BufferOpcode
|
||||
%type <n> Type2BufferOrStringOpcode
|
||||
%type <n> Type2IntegerOpcode
|
||||
%type <n> Type2Opcode
|
||||
%type <n> Type2StringOpcode
|
||||
%type <n> Type3Opcode
|
||||
%type <n> Type5Opcode
|
||||
%type <n> Type6Opcode
|
||||
|
||||
%type <n> AccessAsTerm
|
||||
%type <n> ExternalTerm
|
||||
%type <n> FieldUnit
|
||||
%type <n> FieldUnitEntry
|
||||
%type <n> FieldUnitList
|
||||
%type <n> IncludeTerm
|
||||
%type <n> OffsetTerm
|
||||
%type <n> OptionalAccessAttribTerm
|
||||
|
||||
/* Named Objects */
|
||||
|
||||
%type <n> BankFieldTerm
|
||||
%type <n> CreateBitFieldTerm
|
||||
%type <n> CreateByteFieldTerm
|
||||
%type <n> CreateDWordFieldTerm
|
||||
%type <n> CreateFieldTerm
|
||||
%type <n> CreateQWordFieldTerm
|
||||
%type <n> CreateWordFieldTerm
|
||||
%type <n> DataRegionTerm
|
||||
%type <n> DeviceTerm
|
||||
%type <n> EventTerm
|
||||
%type <n> FieldTerm
|
||||
%type <n> FunctionTerm
|
||||
%type <n> IndexFieldTerm
|
||||
%type <n> MethodTerm
|
||||
%type <n> MutexTerm
|
||||
%type <n> OpRegionTerm
|
||||
%type <n> OpRegionSpaceIdTerm
|
||||
%type <n> PowerResTerm
|
||||
%type <n> ProcessorTerm
|
||||
%type <n> ThermalZoneTerm
|
||||
|
||||
/* Namespace modifiers */
|
||||
|
||||
%type <n> AliasTerm
|
||||
%type <n> NameTerm
|
||||
%type <n> ScopeTerm
|
||||
|
||||
/* Type 1 opcodes */
|
||||
|
||||
%type <n> BreakPointTerm
|
||||
%type <n> BreakTerm
|
||||
%type <n> CaseDefaultTermList
|
||||
%type <n> CaseTerm
|
||||
%type <n> ContinueTerm
|
||||
%type <n> DefaultTerm
|
||||
%type <n> ElseTerm
|
||||
%type <n> FatalTerm
|
||||
%type <n> IfElseTerm
|
||||
%type <n> IfTerm
|
||||
%type <n> LoadTerm
|
||||
%type <n> NoOpTerm
|
||||
%type <n> NotifyTerm
|
||||
%type <n> ReleaseTerm
|
||||
%type <n> ResetTerm
|
||||
%type <n> ReturnTerm
|
||||
%type <n> SignalTerm
|
||||
%type <n> SleepTerm
|
||||
%type <n> StallTerm
|
||||
%type <n> SwitchTerm
|
||||
%type <n> UnloadTerm
|
||||
%type <n> WhileTerm
|
||||
/* %type <n> CaseTermList */
|
||||
|
||||
/* Type 2 opcodes */
|
||||
|
||||
%type <n> AcquireTerm
|
||||
%type <n> AddTerm
|
||||
%type <n> AndTerm
|
||||
%type <n> ConcatResTerm
|
||||
%type <n> ConcatTerm
|
||||
%type <n> CondRefOfTerm
|
||||
%type <n> CopyObjectTerm
|
||||
%type <n> DecTerm
|
||||
%type <n> DerefOfTerm
|
||||
%type <n> DivideTerm
|
||||
%type <n> FindSetLeftBitTerm
|
||||
%type <n> FindSetRightBitTerm
|
||||
%type <n> FromBCDTerm
|
||||
%type <n> IncTerm
|
||||
%type <n> IndexTerm
|
||||
%type <n> LAndTerm
|
||||
%type <n> LEqualTerm
|
||||
%type <n> LGreaterEqualTerm
|
||||
%type <n> LGreaterTerm
|
||||
%type <n> LLessEqualTerm
|
||||
%type <n> LLessTerm
|
||||
%type <n> LNotEqualTerm
|
||||
%type <n> LNotTerm
|
||||
%type <n> LoadTableTerm
|
||||
%type <n> LOrTerm
|
||||
%type <n> MatchTerm
|
||||
%type <n> MidTerm
|
||||
%type <n> ModTerm
|
||||
%type <n> MultiplyTerm
|
||||
%type <n> NAndTerm
|
||||
%type <n> NOrTerm
|
||||
%type <n> NotTerm
|
||||
%type <n> ObjectTypeTerm
|
||||
%type <n> OrTerm
|
||||
%type <n> RefOfTerm
|
||||
%type <n> ShiftLeftTerm
|
||||
%type <n> ShiftRightTerm
|
||||
%type <n> SizeOfTerm
|
||||
%type <n> StoreTerm
|
||||
%type <n> SubtractTerm
|
||||
%type <n> TimerTerm
|
||||
%type <n> ToBCDTerm
|
||||
%type <n> ToBufferTerm
|
||||
%type <n> ToDecimalStringTerm
|
||||
%type <n> ToHexStringTerm
|
||||
%type <n> ToIntegerTerm
|
||||
%type <n> ToStringTerm
|
||||
%type <n> WaitTerm
|
||||
%type <n> XOrTerm
|
||||
|
||||
/* Keywords */
|
||||
|
||||
%type <n> AccessAttribKeyword
|
||||
%type <n> AccessTypeKeyword
|
||||
%type <n> AddressingModeKeyword
|
||||
%type <n> AddressKeyword
|
||||
%type <n> AddressSpaceKeyword
|
||||
%type <n> BitsPerByteKeyword
|
||||
%type <n> ClockPhaseKeyword
|
||||
%type <n> ClockPolarityKeyword
|
||||
%type <n> DecodeKeyword
|
||||
%type <n> DevicePolarityKeyword
|
||||
%type <n> DMATypeKeyword
|
||||
%type <n> EndianKeyword
|
||||
%type <n> FlowControlKeyword
|
||||
%type <n> InterruptLevel
|
||||
%type <n> InterruptTypeKeyword
|
||||
%type <n> IODecodeKeyword
|
||||
%type <n> IoRestrictionKeyword
|
||||
%type <n> LockRuleKeyword
|
||||
%type <n> MatchOpKeyword
|
||||
%type <n> MaxKeyword
|
||||
%type <n> MemTypeKeyword
|
||||
%type <n> MinKeyword
|
||||
%type <n> ObjectTypeKeyword
|
||||
%type <n> OptionalBusMasterKeyword
|
||||
%type <n> OptionalReadWriteKeyword
|
||||
%type <n> ParityTypeKeyword
|
||||
%type <n> PinConfigByte
|
||||
%type <n> PinConfigKeyword
|
||||
%type <n> RangeTypeKeyword
|
||||
%type <n> RegionSpaceKeyword
|
||||
%type <n> ResourceTypeKeyword
|
||||
%type <n> SerializeRuleKeyword
|
||||
%type <n> ShareTypeKeyword
|
||||
%type <n> SlaveModeKeyword
|
||||
%type <n> StopBitsKeyword
|
||||
%type <n> TranslationKeyword
|
||||
%type <n> TypeKeyword
|
||||
%type <n> UpdateRuleKeyword
|
||||
%type <n> WireModeKeyword
|
||||
%type <n> XferSizeKeyword
|
||||
%type <n> XferTypeKeyword
|
||||
|
||||
/* Types */
|
||||
|
||||
%type <n> SuperName
|
||||
%type <n> ObjectTypeName
|
||||
%type <n> ArgTerm
|
||||
%type <n> LocalTerm
|
||||
%type <n> DebugTerm
|
||||
|
||||
%type <n> Integer
|
||||
%type <n> ByteConst
|
||||
%type <n> WordConst
|
||||
%type <n> DWordConst
|
||||
%type <n> QWordConst
|
||||
%type <n> String
|
||||
|
||||
%type <n> ConstTerm
|
||||
%type <n> ConstExprTerm
|
||||
%type <n> ByteConstExpr
|
||||
%type <n> WordConstExpr
|
||||
%type <n> DWordConstExpr
|
||||
%type <n> QWordConstExpr
|
||||
|
||||
%type <n> DWordList
|
||||
%type <n> BufferTerm
|
||||
%type <n> ByteList
|
||||
|
||||
%type <n> PackageElement
|
||||
%type <n> PackageList
|
||||
%type <n> PackageTerm
|
||||
%type <n> VarPackageLengthTerm
|
||||
|
||||
/* Macros */
|
||||
|
||||
%type <n> EISAIDTerm
|
||||
%type <n> ResourceMacroList
|
||||
%type <n> ResourceMacroTerm
|
||||
%type <n> ResourceTemplateTerm
|
||||
%type <n> ToUUIDTerm
|
||||
%type <n> UnicodeTerm
|
||||
|
||||
/* Resource Descriptors */
|
||||
|
||||
%type <n> ConnectionTerm
|
||||
%type <n> DataBufferTerm
|
||||
%type <n> DMATerm
|
||||
%type <n> DWordIOTerm
|
||||
%type <n> DWordMemoryTerm
|
||||
%type <n> DWordSpaceTerm
|
||||
%type <n> EndDependentFnTerm
|
||||
%type <n> ExtendedIOTerm
|
||||
%type <n> ExtendedMemoryTerm
|
||||
%type <n> ExtendedSpaceTerm
|
||||
%type <n> FixedDmaTerm
|
||||
%type <n> FixedIOTerm
|
||||
%type <n> GpioIntTerm
|
||||
%type <n> GpioIoTerm
|
||||
%type <n> I2cSerialBusTerm
|
||||
%type <n> InterruptTerm
|
||||
%type <n> IOTerm
|
||||
%type <n> IRQNoFlagsTerm
|
||||
%type <n> IRQTerm
|
||||
%type <n> Memory24Term
|
||||
%type <n> Memory32FixedTerm
|
||||
%type <n> Memory32Term
|
||||
%type <n> NameSeg
|
||||
%type <n> NameString
|
||||
%type <n> QWordIOTerm
|
||||
%type <n> QWordMemoryTerm
|
||||
%type <n> QWordSpaceTerm
|
||||
%type <n> RegisterTerm
|
||||
%type <n> SpiSerialBusTerm
|
||||
%type <n> StartDependentFnNoPriTerm
|
||||
%type <n> StartDependentFnTerm
|
||||
%type <n> UartSerialBusTerm
|
||||
%type <n> VendorLongTerm
|
||||
%type <n> VendorShortTerm
|
||||
%type <n> WordBusNumberTerm
|
||||
%type <n> WordIOTerm
|
||||
%type <n> WordSpaceTerm
|
||||
|
||||
/* Local types that help construct the AML, not in ACPI spec */
|
||||
|
||||
%type <n> AmlPackageLengthTerm
|
||||
%type <n> IncludeEndTerm
|
||||
%type <n> NameStringItem
|
||||
%type <n> TermArgItem
|
||||
|
||||
%type <n> OptionalAccessSize
|
||||
%type <n> OptionalAddressingMode
|
||||
%type <n> OptionalAddressRange
|
||||
%type <n> OptionalBitsPerByte
|
||||
%type <n> OptionalBuffer_Last
|
||||
%type <n> OptionalByteConstExpr
|
||||
%type <n> OptionalCount
|
||||
%type <n> OptionalDecodeType
|
||||
%type <n> OptionalDevicePolarity
|
||||
%type <n> OptionalDWordConstExpr
|
||||
%type <n> OptionalEndian
|
||||
%type <n> OptionalFlowControl
|
||||
%type <n> OptionalIoRestriction
|
||||
%type <n> OptionalListString
|
||||
%type <n> OptionalMaxType
|
||||
%type <n> OptionalMemType
|
||||
%type <n> OptionalMinType
|
||||
%type <n> OptionalNameString
|
||||
%type <n> OptionalNameString_First
|
||||
%type <n> OptionalNameString_Last
|
||||
%type <n> OptionalObjectTypeKeyword
|
||||
%type <n> OptionalParameterTypePackage
|
||||
%type <n> OptionalParameterTypesPackage
|
||||
%type <n> OptionalParityType
|
||||
%type <n> OptionalQWordConstExpr
|
||||
%type <n> OptionalRangeType
|
||||
%type <n> OptionalReference
|
||||
%type <n> OptionalResourceType
|
||||
%type <n> OptionalResourceType_First
|
||||
%type <n> OptionalReturnArg
|
||||
%type <n> OptionalSerializeRuleKeyword
|
||||
%type <n> OptionalShareType
|
||||
%type <n> OptionalShareType_First
|
||||
%type <n> OptionalSlaveMode
|
||||
%type <n> OptionalStopBits
|
||||
%type <n> OptionalStringData
|
||||
%type <n> OptionalTermArg
|
||||
%type <n> OptionalTranslationType_Last
|
||||
%type <n> OptionalType
|
||||
%type <n> OptionalType_Last
|
||||
%type <n> OptionalWireMode
|
||||
%type <n> OptionalWordConst
|
||||
%type <n> OptionalWordConstExpr
|
||||
%type <n> OptionalXferSize
|
||||
|
||||
%%
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Production rules start here
|
||||
@ -799,10 +52,7 @@ void * AslLocalAllocate (unsigned int Size);
|
||||
|
||||
/*
|
||||
* ASL Names
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Root rule. Allow multiple #line directives before the definition block
|
||||
* to handle output from preprocessors
|
||||
*/
|
||||
@ -3511,77 +2761,3 @@ OptionalXferSize
|
||||
| ',' {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);}
|
||||
| ',' XferSizeKeyword {$$ = $2;}
|
||||
;
|
||||
|
||||
%%
|
||||
/******************************************************************************
|
||||
*
|
||||
* Local support functions
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
int
|
||||
AslCompilerwrap(void)
|
||||
{
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*! [End] no source code translation !*/
|
||||
|
||||
void *
|
||||
AslLocalAllocate (unsigned int Size)
|
||||
{
|
||||
void *Mem;
|
||||
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "\nAslLocalAllocate: Expanding Stack to %u\n\n", Size);
|
||||
|
||||
Mem = ACPI_ALLOCATE_ZEROED (Size);
|
||||
if (!Mem)
|
||||
{
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_InputByteCount, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
return (Mem);
|
||||
}
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
AslDoError (void)
|
||||
{
|
||||
|
||||
|
||||
return (TrCreateLeafNode (PARSEOP_ERRORNODE));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: UtGetOpName
|
||||
*
|
||||
* PARAMETERS: ParseOpcode - Parser keyword ID
|
||||
*
|
||||
* RETURN: Pointer to the opcode name
|
||||
*
|
||||
* DESCRIPTION: Get the ascii name of the parse opcode
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
char *
|
||||
UtGetOpName (
|
||||
UINT32 ParseOpcode)
|
||||
{
|
||||
#ifdef ASL_YYTNAME_START
|
||||
/*
|
||||
* First entries (ASL_YYTNAME_START) in yytname are special reserved names.
|
||||
* Ignore first 8 characters of the name
|
||||
*/
|
||||
return ((char *) yytname
|
||||
[(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
|
||||
#else
|
||||
return ("[Unknown parser generator]");
|
||||
#endif
|
||||
}
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "actables.h"
|
||||
#include "acdisasm.h"
|
||||
@ -284,8 +283,11 @@ AslDoDisassembly (
|
||||
return (AE_CTRL_CONTINUE);
|
||||
}
|
||||
|
||||
ACPI_FREE (Gbl_Files[ASL_FILE_INPUT].Filename);
|
||||
/* No need to free the filename string */
|
||||
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename = NULL;
|
||||
|
||||
CmDeleteCaches ();
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
@ -325,8 +327,13 @@ AslDoOneFile (
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
|
||||
UtConvertBackslashes (Filename);
|
||||
/* Take a copy of the input filename, convert any backslashes */
|
||||
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename =
|
||||
UtStringCacheCalloc (strlen (Filename) + 1);
|
||||
|
||||
strcpy (Gbl_Files[ASL_FILE_INPUT].Filename, Filename);
|
||||
UtConvertBackslashes (Gbl_Files[ASL_FILE_INPUT].Filename);
|
||||
|
||||
/*
|
||||
* AML Disassembly (Optional)
|
||||
@ -396,7 +403,6 @@ AslDoOneFile (
|
||||
|
||||
if (Gbl_Signature)
|
||||
{
|
||||
ACPI_FREE (Gbl_Signature);
|
||||
Gbl_Signature = NULL;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
/* Configuration */
|
||||
|
||||
#define ASL_SPACES_PER_TAB 4
|
||||
@ -70,6 +69,15 @@ typedef struct asl_file_node
|
||||
ASL_FILE_NODE *Gbl_IncludeFileStack = NULL;
|
||||
|
||||
|
||||
void
|
||||
AslParserCleanup (
|
||||
void)
|
||||
{
|
||||
|
||||
yy_delete_buffer (YY_CURRENT_BUFFER);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslDoLineDirective
|
||||
@ -259,7 +267,11 @@ AslPushInputFileStack (
|
||||
|
||||
/* Reset the global line count and filename */
|
||||
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename =
|
||||
UtStringCacheCalloc (strlen (Filename) + 1);
|
||||
|
||||
strcpy (Gbl_Files[ASL_FILE_INPUT].Filename, Filename);
|
||||
|
||||
Gbl_CurrentLineNumber = 1;
|
||||
yyin = InputFile;
|
||||
}
|
||||
@ -797,7 +809,7 @@ CompletedString:
|
||||
*/
|
||||
*StringBuffer = 0;
|
||||
|
||||
CleanString = UtGetStringBuffer (strlen (MsgBuffer) + 1);
|
||||
CleanString = UtStringCacheCalloc (strlen (MsgBuffer) + 1);
|
||||
if (!CleanString)
|
||||
{
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
|
||||
|
119
source/compiler/aslsupport.y
Normal file
119
source/compiler/aslsupport.y
Normal file
@ -0,0 +1,119 @@
|
||||
NoEcho('
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslsupport.y - Bison/Yacc C support functions
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* NO WARRANTY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
')
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Local support functions
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*! [Begin] no source code translation */
|
||||
int
|
||||
AslCompilerwrap(void)
|
||||
{
|
||||
return (1);
|
||||
}
|
||||
/*! [End] no source code translation !*/
|
||||
|
||||
|
||||
void *
|
||||
AslLocalAllocate (unsigned int Size)
|
||||
{
|
||||
void *Mem;
|
||||
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "\nAslLocalAllocate: Expanding Stack to %u\n\n", Size);
|
||||
|
||||
Mem = UtStringCacheCalloc (Size);
|
||||
if (!Mem)
|
||||
{
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_InputByteCount, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
return (Mem);
|
||||
}
|
||||
|
||||
ACPI_PARSE_OBJECT *
|
||||
AslDoError (void)
|
||||
{
|
||||
|
||||
|
||||
return (TrCreateLeafNode (PARSEOP_ERRORNODE));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: UtGetOpName
|
||||
*
|
||||
* PARAMETERS: ParseOpcode - Parser keyword ID
|
||||
*
|
||||
* RETURN: Pointer to the opcode name
|
||||
*
|
||||
* DESCRIPTION: Get the ascii name of the parse opcode
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
char *
|
||||
UtGetOpName (
|
||||
UINT32 ParseOpcode)
|
||||
{
|
||||
#ifdef ASL_YYTNAME_START
|
||||
/*
|
||||
* First entries (ASL_YYTNAME_START) in yytname are special reserved names.
|
||||
* Ignore first 8 characters of the name
|
||||
*/
|
||||
return ((char *) yytname
|
||||
[(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
|
||||
#else
|
||||
return ("[Unknown parser generator]");
|
||||
#endif
|
||||
}
|
386
source/compiler/asltokens.y
Normal file
386
source/compiler/asltokens.y
Normal file
@ -0,0 +1,386 @@
|
||||
NoEcho('
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: asltokens.y - Bison/Yacc token types
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* NO WARRANTY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
')
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Token types: These are returned by the lexer
|
||||
*
|
||||
* NOTE: This list MUST match the AslKeywordMapping table found
|
||||
* in aslmap.c EXACTLY! Double check any changes!
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
%token <i> PARSEOP_ACCESSAS
|
||||
%token <i> PARSEOP_ACCESSATTRIB_BLOCK
|
||||
%token <i> PARSEOP_ACCESSATTRIB_BLOCK_CALL
|
||||
%token <i> PARSEOP_ACCESSATTRIB_BYTE
|
||||
%token <i> PARSEOP_ACCESSATTRIB_MULTIBYTE
|
||||
%token <i> PARSEOP_ACCESSATTRIB_QUICK
|
||||
%token <i> PARSEOP_ACCESSATTRIB_RAW_BYTES
|
||||
%token <i> PARSEOP_ACCESSATTRIB_RAW_PROCESS
|
||||
%token <i> PARSEOP_ACCESSATTRIB_SND_RCV
|
||||
%token <i> PARSEOP_ACCESSATTRIB_WORD
|
||||
%token <i> PARSEOP_ACCESSATTRIB_WORD_CALL
|
||||
%token <i> PARSEOP_ACCESSTYPE_ANY
|
||||
%token <i> PARSEOP_ACCESSTYPE_BUF
|
||||
%token <i> PARSEOP_ACCESSTYPE_BYTE
|
||||
%token <i> PARSEOP_ACCESSTYPE_DWORD
|
||||
%token <i> PARSEOP_ACCESSTYPE_QWORD
|
||||
%token <i> PARSEOP_ACCESSTYPE_WORD
|
||||
%token <i> PARSEOP_ACQUIRE
|
||||
%token <i> PARSEOP_ADD
|
||||
%token <i> PARSEOP_ADDRESSINGMODE_7BIT
|
||||
%token <i> PARSEOP_ADDRESSINGMODE_10BIT
|
||||
%token <i> PARSEOP_ADDRESSTYPE_ACPI
|
||||
%token <i> PARSEOP_ADDRESSTYPE_MEMORY
|
||||
%token <i> PARSEOP_ADDRESSTYPE_NVS
|
||||
%token <i> PARSEOP_ADDRESSTYPE_RESERVED
|
||||
%token <i> PARSEOP_ALIAS
|
||||
%token <i> PARSEOP_AND
|
||||
%token <i> PARSEOP_ARG0
|
||||
%token <i> PARSEOP_ARG1
|
||||
%token <i> PARSEOP_ARG2
|
||||
%token <i> PARSEOP_ARG3
|
||||
%token <i> PARSEOP_ARG4
|
||||
%token <i> PARSEOP_ARG5
|
||||
%token <i> PARSEOP_ARG6
|
||||
%token <i> PARSEOP_BANKFIELD
|
||||
%token <i> PARSEOP_BITSPERBYTE_EIGHT
|
||||
%token <i> PARSEOP_BITSPERBYTE_FIVE
|
||||
%token <i> PARSEOP_BITSPERBYTE_NINE
|
||||
%token <i> PARSEOP_BITSPERBYTE_SEVEN
|
||||
%token <i> PARSEOP_BITSPERBYTE_SIX
|
||||
%token <i> PARSEOP_BREAK
|
||||
%token <i> PARSEOP_BREAKPOINT
|
||||
%token <i> PARSEOP_BUFFER
|
||||
%token <i> PARSEOP_BUSMASTERTYPE_MASTER
|
||||
%token <i> PARSEOP_BUSMASTERTYPE_NOTMASTER
|
||||
%token <i> PARSEOP_BYTECONST
|
||||
%token <i> PARSEOP_CASE
|
||||
%token <i> PARSEOP_CLOCKPHASE_FIRST
|
||||
%token <i> PARSEOP_CLOCKPHASE_SECOND
|
||||
%token <i> PARSEOP_CLOCKPOLARITY_HIGH
|
||||
%token <i> PARSEOP_CLOCKPOLARITY_LOW
|
||||
%token <i> PARSEOP_CONCATENATE
|
||||
%token <i> PARSEOP_CONCATENATERESTEMPLATE
|
||||
%token <i> PARSEOP_CONDREFOF
|
||||
%token <i> PARSEOP_CONNECTION
|
||||
%token <i> PARSEOP_CONTINUE
|
||||
%token <i> PARSEOP_COPYOBJECT
|
||||
%token <i> PARSEOP_CREATEBITFIELD
|
||||
%token <i> PARSEOP_CREATEBYTEFIELD
|
||||
%token <i> PARSEOP_CREATEDWORDFIELD
|
||||
%token <i> PARSEOP_CREATEFIELD
|
||||
%token <i> PARSEOP_CREATEQWORDFIELD
|
||||
%token <i> PARSEOP_CREATEWORDFIELD
|
||||
%token <i> PARSEOP_DATABUFFER
|
||||
%token <i> PARSEOP_DATATABLEREGION
|
||||
%token <i> PARSEOP_DEBUG
|
||||
%token <i> PARSEOP_DECODETYPE_POS
|
||||
%token <i> PARSEOP_DECODETYPE_SUB
|
||||
%token <i> PARSEOP_DECREMENT
|
||||
%token <i> PARSEOP_DEFAULT
|
||||
%token <i> PARSEOP_DEFAULT_ARG
|
||||
%token <i> PARSEOP_DEFINITIONBLOCK
|
||||
%token <i> PARSEOP_DEREFOF
|
||||
%token <i> PARSEOP_DEVICE
|
||||
%token <i> PARSEOP_DEVICEPOLARITY_HIGH
|
||||
%token <i> PARSEOP_DEVICEPOLARITY_LOW
|
||||
%token <i> PARSEOP_DIVIDE
|
||||
%token <i> PARSEOP_DMA
|
||||
%token <i> PARSEOP_DMATYPE_A
|
||||
%token <i> PARSEOP_DMATYPE_COMPATIBILITY
|
||||
%token <i> PARSEOP_DMATYPE_B
|
||||
%token <i> PARSEOP_DMATYPE_F
|
||||
%token <i> PARSEOP_DWORDCONST
|
||||
%token <i> PARSEOP_DWORDIO
|
||||
%token <i> PARSEOP_DWORDMEMORY
|
||||
%token <i> PARSEOP_DWORDSPACE
|
||||
%token <i> PARSEOP_EISAID
|
||||
%token <i> PARSEOP_ELSE
|
||||
%token <i> PARSEOP_ELSEIF
|
||||
%token <i> PARSEOP_ENDDEPENDENTFN
|
||||
%token <i> PARSEOP_ENDIAN_BIG
|
||||
%token <i> PARSEOP_ENDIAN_LITTLE
|
||||
%token <i> PARSEOP_ENDTAG
|
||||
%token <i> PARSEOP_ERRORNODE
|
||||
%token <i> PARSEOP_EVENT
|
||||
%token <i> PARSEOP_EXTENDEDIO
|
||||
%token <i> PARSEOP_EXTENDEDMEMORY
|
||||
%token <i> PARSEOP_EXTENDEDSPACE
|
||||
%token <i> PARSEOP_EXTERNAL
|
||||
%token <i> PARSEOP_FATAL
|
||||
%token <i> PARSEOP_FIELD
|
||||
%token <i> PARSEOP_FINDSETLEFTBIT
|
||||
%token <i> PARSEOP_FINDSETRIGHTBIT
|
||||
%token <i> PARSEOP_FIXEDDMA
|
||||
%token <i> PARSEOP_FIXEDIO
|
||||
%token <i> PARSEOP_FLOWCONTROL_HW
|
||||
%token <i> PARSEOP_FLOWCONTROL_NONE
|
||||
%token <i> PARSEOP_FLOWCONTROL_SW
|
||||
%token <i> PARSEOP_FROMBCD
|
||||
%token <i> PARSEOP_FUNCTION
|
||||
%token <i> PARSEOP_GPIO_INT
|
||||
%token <i> PARSEOP_GPIO_IO
|
||||
%token <i> PARSEOP_I2C_SERIALBUS
|
||||
%token <i> PARSEOP_IF
|
||||
%token <i> PARSEOP_INCLUDE
|
||||
%token <i> PARSEOP_INCLUDE_END
|
||||
%token <i> PARSEOP_INCREMENT
|
||||
%token <i> PARSEOP_INDEX
|
||||
%token <i> PARSEOP_INDEXFIELD
|
||||
%token <i> PARSEOP_INTEGER
|
||||
%token <i> PARSEOP_INTERRUPT
|
||||
%token <i> PARSEOP_INTLEVEL_ACTIVEBOTH
|
||||
%token <i> PARSEOP_INTLEVEL_ACTIVEHIGH
|
||||
%token <i> PARSEOP_INTLEVEL_ACTIVELOW
|
||||
%token <i> PARSEOP_INTTYPE_EDGE
|
||||
%token <i> PARSEOP_INTTYPE_LEVEL
|
||||
%token <i> PARSEOP_IO
|
||||
%token <i> PARSEOP_IODECODETYPE_10
|
||||
%token <i> PARSEOP_IODECODETYPE_16
|
||||
%token <i> PARSEOP_IORESTRICT_IN
|
||||
%token <i> PARSEOP_IORESTRICT_NONE
|
||||
%token <i> PARSEOP_IORESTRICT_OUT
|
||||
%token <i> PARSEOP_IORESTRICT_PRESERVE
|
||||
%token <i> PARSEOP_IRQ
|
||||
%token <i> PARSEOP_IRQNOFLAGS
|
||||
%token <i> PARSEOP_LAND
|
||||
%token <i> PARSEOP_LEQUAL
|
||||
%token <i> PARSEOP_LGREATER
|
||||
%token <i> PARSEOP_LGREATEREQUAL
|
||||
%token <i> PARSEOP_LLESS
|
||||
%token <i> PARSEOP_LLESSEQUAL
|
||||
%token <i> PARSEOP_LNOT
|
||||
%token <i> PARSEOP_LNOTEQUAL
|
||||
%token <i> PARSEOP_LOAD
|
||||
%token <i> PARSEOP_LOADTABLE
|
||||
%token <i> PARSEOP_LOCAL0
|
||||
%token <i> PARSEOP_LOCAL1
|
||||
%token <i> PARSEOP_LOCAL2
|
||||
%token <i> PARSEOP_LOCAL3
|
||||
%token <i> PARSEOP_LOCAL4
|
||||
%token <i> PARSEOP_LOCAL5
|
||||
%token <i> PARSEOP_LOCAL6
|
||||
%token <i> PARSEOP_LOCAL7
|
||||
%token <i> PARSEOP_LOCKRULE_LOCK
|
||||
%token <i> PARSEOP_LOCKRULE_NOLOCK
|
||||
%token <i> PARSEOP_LOR
|
||||
%token <i> PARSEOP_MATCH
|
||||
%token <i> PARSEOP_MATCHTYPE_MEQ
|
||||
%token <i> PARSEOP_MATCHTYPE_MGE
|
||||
%token <i> PARSEOP_MATCHTYPE_MGT
|
||||
%token <i> PARSEOP_MATCHTYPE_MLE
|
||||
%token <i> PARSEOP_MATCHTYPE_MLT
|
||||
%token <i> PARSEOP_MATCHTYPE_MTR
|
||||
%token <i> PARSEOP_MAXTYPE_FIXED
|
||||
%token <i> PARSEOP_MAXTYPE_NOTFIXED
|
||||
%token <i> PARSEOP_MEMORY24
|
||||
%token <i> PARSEOP_MEMORY32
|
||||
%token <i> PARSEOP_MEMORY32FIXED
|
||||
%token <i> PARSEOP_MEMTYPE_CACHEABLE
|
||||
%token <i> PARSEOP_MEMTYPE_NONCACHEABLE
|
||||
%token <i> PARSEOP_MEMTYPE_PREFETCHABLE
|
||||
%token <i> PARSEOP_MEMTYPE_WRITECOMBINING
|
||||
%token <i> PARSEOP_METHOD
|
||||
%token <i> PARSEOP_METHODCALL
|
||||
%token <i> PARSEOP_MID
|
||||
%token <i> PARSEOP_MINTYPE_FIXED
|
||||
%token <i> PARSEOP_MINTYPE_NOTFIXED
|
||||
%token <i> PARSEOP_MOD
|
||||
%token <i> PARSEOP_MULTIPLY
|
||||
%token <i> PARSEOP_MUTEX
|
||||
%token <i> PARSEOP_NAME
|
||||
%token <s> PARSEOP_NAMESEG
|
||||
%token <s> PARSEOP_NAMESTRING
|
||||
%token <i> PARSEOP_NAND
|
||||
%token <i> PARSEOP_NOOP
|
||||
%token <i> PARSEOP_NOR
|
||||
%token <i> PARSEOP_NOT
|
||||
%token <i> PARSEOP_NOTIFY
|
||||
%token <i> PARSEOP_OBJECTTYPE
|
||||
%token <i> PARSEOP_OBJECTTYPE_BFF
|
||||
%token <i> PARSEOP_OBJECTTYPE_BUF
|
||||
%token <i> PARSEOP_OBJECTTYPE_DDB
|
||||
%token <i> PARSEOP_OBJECTTYPE_DEV
|
||||
%token <i> PARSEOP_OBJECTTYPE_EVT
|
||||
%token <i> PARSEOP_OBJECTTYPE_FLD
|
||||
%token <i> PARSEOP_OBJECTTYPE_INT
|
||||
%token <i> PARSEOP_OBJECTTYPE_MTH
|
||||
%token <i> PARSEOP_OBJECTTYPE_MTX
|
||||
%token <i> PARSEOP_OBJECTTYPE_OPR
|
||||
%token <i> PARSEOP_OBJECTTYPE_PKG
|
||||
%token <i> PARSEOP_OBJECTTYPE_POW
|
||||
%token <i> PARSEOP_OBJECTTYPE_PRO
|
||||
%token <i> PARSEOP_OBJECTTYPE_STR
|
||||
%token <i> PARSEOP_OBJECTTYPE_THZ
|
||||
%token <i> PARSEOP_OBJECTTYPE_UNK
|
||||
%token <i> PARSEOP_OFFSET
|
||||
%token <i> PARSEOP_ONE
|
||||
%token <i> PARSEOP_ONES
|
||||
%token <i> PARSEOP_OPERATIONREGION
|
||||
%token <i> PARSEOP_OR
|
||||
%token <i> PARSEOP_PACKAGE
|
||||
%token <i> PARSEOP_PACKAGE_LENGTH
|
||||
%token <i> PARSEOP_PARITYTYPE_EVEN
|
||||
%token <i> PARSEOP_PARITYTYPE_MARK
|
||||
%token <i> PARSEOP_PARITYTYPE_NONE
|
||||
%token <i> PARSEOP_PARITYTYPE_ODD
|
||||
%token <i> PARSEOP_PARITYTYPE_SPACE
|
||||
%token <i> PARSEOP_PIN_NOPULL
|
||||
%token <i> PARSEOP_PIN_PULLDEFAULT
|
||||
%token <i> PARSEOP_PIN_PULLDOWN
|
||||
%token <i> PARSEOP_PIN_PULLUP
|
||||
%token <i> PARSEOP_POWERRESOURCE
|
||||
%token <i> PARSEOP_PROCESSOR
|
||||
%token <i> PARSEOP_QWORDCONST
|
||||
%token <i> PARSEOP_QWORDIO
|
||||
%token <i> PARSEOP_QWORDMEMORY
|
||||
%token <i> PARSEOP_QWORDSPACE
|
||||
%token <i> PARSEOP_RANGETYPE_ENTIRE
|
||||
%token <i> PARSEOP_RANGETYPE_ISAONLY
|
||||
%token <i> PARSEOP_RANGETYPE_NONISAONLY
|
||||
%token <i> PARSEOP_RAW_DATA
|
||||
%token <i> PARSEOP_READWRITETYPE_BOTH
|
||||
%token <i> PARSEOP_READWRITETYPE_READONLY
|
||||
%token <i> PARSEOP_REFOF
|
||||
%token <i> PARSEOP_REGIONSPACE_CMOS
|
||||
%token <i> PARSEOP_REGIONSPACE_EC
|
||||
%token <i> PARSEOP_REGIONSPACE_FFIXEDHW
|
||||
%token <i> PARSEOP_REGIONSPACE_GPIO
|
||||
%token <i> PARSEOP_REGIONSPACE_GSBUS
|
||||
%token <i> PARSEOP_REGIONSPACE_IO
|
||||
%token <i> PARSEOP_REGIONSPACE_IPMI
|
||||
%token <i> PARSEOP_REGIONSPACE_MEM
|
||||
%token <i> PARSEOP_REGIONSPACE_PCC
|
||||
%token <i> PARSEOP_REGIONSPACE_PCI
|
||||
%token <i> PARSEOP_REGIONSPACE_PCIBAR
|
||||
%token <i> PARSEOP_REGIONSPACE_SMBUS
|
||||
%token <i> PARSEOP_REGISTER
|
||||
%token <i> PARSEOP_RELEASE
|
||||
%token <i> PARSEOP_RESERVED_BYTES
|
||||
%token <i> PARSEOP_RESET
|
||||
%token <i> PARSEOP_RESOURCETEMPLATE
|
||||
%token <i> PARSEOP_RESOURCETYPE_CONSUMER
|
||||
%token <i> PARSEOP_RESOURCETYPE_PRODUCER
|
||||
%token <i> PARSEOP_RETURN
|
||||
%token <i> PARSEOP_REVISION
|
||||
%token <i> PARSEOP_SCOPE
|
||||
%token <i> PARSEOP_SERIALIZERULE_NOTSERIAL
|
||||
%token <i> PARSEOP_SERIALIZERULE_SERIAL
|
||||
%token <i> PARSEOP_SHARETYPE_EXCLUSIVE
|
||||
%token <i> PARSEOP_SHARETYPE_EXCLUSIVEWAKE
|
||||
%token <i> PARSEOP_SHARETYPE_SHARED
|
||||
%token <i> PARSEOP_SHARETYPE_SHAREDWAKE
|
||||
%token <i> PARSEOP_SHIFTLEFT
|
||||
%token <i> PARSEOP_SHIFTRIGHT
|
||||
%token <i> PARSEOP_SIGNAL
|
||||
%token <i> PARSEOP_SIZEOF
|
||||
%token <i> PARSEOP_SLAVEMODE_CONTROLLERINIT
|
||||
%token <i> PARSEOP_SLAVEMODE_DEVICEINIT
|
||||
%token <i> PARSEOP_SLEEP
|
||||
%token <i> PARSEOP_SPI_SERIALBUS
|
||||
%token <i> PARSEOP_STALL
|
||||
%token <i> PARSEOP_STARTDEPENDENTFN
|
||||
%token <i> PARSEOP_STARTDEPENDENTFN_NOPRI
|
||||
%token <i> PARSEOP_STOPBITS_ONE
|
||||
%token <i> PARSEOP_STOPBITS_ONEPLUSHALF
|
||||
%token <i> PARSEOP_STOPBITS_TWO
|
||||
%token <i> PARSEOP_STOPBITS_ZERO
|
||||
%token <i> PARSEOP_STORE
|
||||
%token <s> PARSEOP_STRING_LITERAL
|
||||
%token <i> PARSEOP_SUBTRACT
|
||||
%token <i> PARSEOP_SWITCH
|
||||
%token <i> PARSEOP_THERMALZONE
|
||||
%token <i> PARSEOP_TIMER
|
||||
%token <i> PARSEOP_TOBCD
|
||||
%token <i> PARSEOP_TOBUFFER
|
||||
%token <i> PARSEOP_TODECIMALSTRING
|
||||
%token <i> PARSEOP_TOHEXSTRING
|
||||
%token <i> PARSEOP_TOINTEGER
|
||||
%token <i> PARSEOP_TOSTRING
|
||||
%token <i> PARSEOP_TOUUID
|
||||
%token <i> PARSEOP_TRANSLATIONTYPE_DENSE
|
||||
%token <i> PARSEOP_TRANSLATIONTYPE_SPARSE
|
||||
%token <i> PARSEOP_TYPE_STATIC
|
||||
%token <i> PARSEOP_TYPE_TRANSLATION
|
||||
%token <i> PARSEOP_UART_SERIALBUS
|
||||
%token <i> PARSEOP_UNICODE
|
||||
%token <i> PARSEOP_UNLOAD
|
||||
%token <i> PARSEOP_UPDATERULE_ONES
|
||||
%token <i> PARSEOP_UPDATERULE_PRESERVE
|
||||
%token <i> PARSEOP_UPDATERULE_ZEROS
|
||||
%token <i> PARSEOP_VAR_PACKAGE
|
||||
%token <i> PARSEOP_VENDORLONG
|
||||
%token <i> PARSEOP_VENDORSHORT
|
||||
%token <i> PARSEOP_WAIT
|
||||
%token <i> PARSEOP_WHILE
|
||||
%token <i> PARSEOP_WIREMODE_FOUR
|
||||
%token <i> PARSEOP_WIREMODE_THREE
|
||||
%token <i> PARSEOP_WORDBUSNUMBER
|
||||
%token <i> PARSEOP_WORDCONST
|
||||
%token <i> PARSEOP_WORDIO
|
||||
%token <i> PARSEOP_WORDSPACE
|
||||
%token <i> PARSEOP_XFERSIZE_8
|
||||
%token <i> PARSEOP_XFERSIZE_16
|
||||
%token <i> PARSEOP_XFERSIZE_32
|
||||
%token <i> PARSEOP_XFERSIZE_64
|
||||
%token <i> PARSEOP_XFERSIZE_128
|
||||
%token <i> PARSEOP_XFERSIZE_256
|
||||
%token <i> PARSEOP_XFERTYPE_8
|
||||
%token <i> PARSEOP_XFERTYPE_8_16
|
||||
%token <i> PARSEOP_XFERTYPE_16
|
||||
%token <i> PARSEOP_XOR
|
||||
%token <i> PARSEOP_ZERO
|
||||
|
||||
/*
|
||||
* Special functions. These should probably stay at the end of this
|
||||
* table.
|
||||
*/
|
||||
%token <i> PARSEOP___DATE__
|
||||
%token <i> PARSEOP___FILE__
|
||||
%token <i> PARSEOP___LINE__
|
||||
%token <i> PARSEOP___PATH__
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
|
||||
@ -377,7 +376,6 @@ TrDoDefinitionBlock (
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
*
|
||||
* DESCRIPTION: Translate ASL SWITCH statement to if/else pairs. There is
|
||||
* no actual AML opcode for SWITCH -- it must be simulated.
|
||||
*
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "acapps.h"
|
||||
@ -79,15 +78,29 @@ static ACPI_PARSE_OBJECT *
|
||||
TrGetNextNode (
|
||||
void)
|
||||
{
|
||||
ASL_CACHE_INFO *Cache;
|
||||
|
||||
if (Gbl_NodeCacheNext >= Gbl_NodeCacheLast)
|
||||
|
||||
if (Gbl_ParseOpCacheNext >= Gbl_ParseOpCacheLast)
|
||||
{
|
||||
Gbl_NodeCacheNext = UtLocalCalloc (sizeof (ACPI_PARSE_OBJECT) *
|
||||
ASL_NODE_CACHE_SIZE);
|
||||
Gbl_NodeCacheLast = Gbl_NodeCacheNext + ASL_NODE_CACHE_SIZE;
|
||||
/* Allocate a new buffer */
|
||||
|
||||
Cache = UtLocalCalloc (sizeof (Cache->Next) +
|
||||
(sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE));
|
||||
|
||||
/* Link new cache buffer to head of list */
|
||||
|
||||
Cache->Next = Gbl_ParseOpCacheList;
|
||||
Gbl_ParseOpCacheList = Cache;
|
||||
|
||||
/* Setup cache management pointers */
|
||||
|
||||
Gbl_ParseOpCacheNext = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Cache->Buffer);
|
||||
Gbl_ParseOpCacheLast = Gbl_ParseOpCacheNext + ASL_PARSEOP_CACHE_SIZE;
|
||||
}
|
||||
|
||||
return (Gbl_NodeCacheNext++);
|
||||
Gbl_ParseOpCount++;
|
||||
return (Gbl_ParseOpCacheNext++);
|
||||
}
|
||||
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __ASLTYPES_H
|
||||
#define __ASLTYPES_H
|
||||
|
||||
@ -175,6 +174,16 @@ typedef enum
|
||||
#define ASL_NUM_FILES (ASL_MAX_FILE_TYPE + 1)
|
||||
|
||||
|
||||
/* Cache block structure for ParseOps and Strings */
|
||||
|
||||
typedef struct asl_cache_info
|
||||
{
|
||||
void *Next;
|
||||
char Buffer[1];
|
||||
|
||||
} ASL_CACHE_INFO;
|
||||
|
||||
|
||||
typedef struct asl_include_dir
|
||||
{
|
||||
char *Dir;
|
||||
|
381
source/compiler/asltypes.y
Normal file
381
source/compiler/asltypes.y
Normal file
@ -0,0 +1,381 @@
|
||||
NoEcho('
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: asltypes.y - Bison/Yacc production types/names
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* NO WARRANTY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
')
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Production names
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
%type <n> ArgList
|
||||
%type <n> ASLCode
|
||||
%type <n> BufferData
|
||||
%type <n> BufferTermData
|
||||
%type <n> CompilerDirective
|
||||
%type <n> DataObject
|
||||
%type <n> DefinitionBlockTerm
|
||||
%type <n> IntegerData
|
||||
%type <n> NamedObject
|
||||
%type <n> NameSpaceModifier
|
||||
%type <n> Object
|
||||
%type <n> ObjectList
|
||||
%type <n> PackageData
|
||||
%type <n> ParameterTypePackage
|
||||
%type <n> ParameterTypePackageList
|
||||
%type <n> ParameterTypesPackage
|
||||
%type <n> ParameterTypesPackageList
|
||||
%type <n> RequiredTarget
|
||||
%type <n> SimpleTarget
|
||||
%type <n> StringData
|
||||
%type <n> Target
|
||||
%type <n> Term
|
||||
%type <n> TermArg
|
||||
%type <n> TermList
|
||||
%type <n> UserTerm
|
||||
|
||||
/* Type4Opcode is obsolete */
|
||||
|
||||
%type <n> Type1Opcode
|
||||
%type <n> Type2BufferOpcode
|
||||
%type <n> Type2BufferOrStringOpcode
|
||||
%type <n> Type2IntegerOpcode
|
||||
%type <n> Type2Opcode
|
||||
%type <n> Type2StringOpcode
|
||||
%type <n> Type3Opcode
|
||||
%type <n> Type5Opcode
|
||||
%type <n> Type6Opcode
|
||||
|
||||
%type <n> AccessAsTerm
|
||||
%type <n> ExternalTerm
|
||||
%type <n> FieldUnit
|
||||
%type <n> FieldUnitEntry
|
||||
%type <n> FieldUnitList
|
||||
%type <n> IncludeTerm
|
||||
%type <n> OffsetTerm
|
||||
%type <n> OptionalAccessAttribTerm
|
||||
|
||||
/* Named Objects */
|
||||
|
||||
%type <n> BankFieldTerm
|
||||
%type <n> CreateBitFieldTerm
|
||||
%type <n> CreateByteFieldTerm
|
||||
%type <n> CreateDWordFieldTerm
|
||||
%type <n> CreateFieldTerm
|
||||
%type <n> CreateQWordFieldTerm
|
||||
%type <n> CreateWordFieldTerm
|
||||
%type <n> DataRegionTerm
|
||||
%type <n> DeviceTerm
|
||||
%type <n> EventTerm
|
||||
%type <n> FieldTerm
|
||||
%type <n> FunctionTerm
|
||||
%type <n> IndexFieldTerm
|
||||
%type <n> MethodTerm
|
||||
%type <n> MutexTerm
|
||||
%type <n> OpRegionTerm
|
||||
%type <n> OpRegionSpaceIdTerm
|
||||
%type <n> PowerResTerm
|
||||
%type <n> ProcessorTerm
|
||||
%type <n> ThermalZoneTerm
|
||||
|
||||
/* Namespace modifiers */
|
||||
|
||||
%type <n> AliasTerm
|
||||
%type <n> NameTerm
|
||||
%type <n> ScopeTerm
|
||||
|
||||
/* Type 1 opcodes */
|
||||
|
||||
%type <n> BreakPointTerm
|
||||
%type <n> BreakTerm
|
||||
%type <n> CaseDefaultTermList
|
||||
%type <n> CaseTerm
|
||||
%type <n> ContinueTerm
|
||||
%type <n> DefaultTerm
|
||||
%type <n> ElseTerm
|
||||
%type <n> FatalTerm
|
||||
%type <n> IfElseTerm
|
||||
%type <n> IfTerm
|
||||
%type <n> LoadTerm
|
||||
%type <n> NoOpTerm
|
||||
%type <n> NotifyTerm
|
||||
%type <n> ReleaseTerm
|
||||
%type <n> ResetTerm
|
||||
%type <n> ReturnTerm
|
||||
%type <n> SignalTerm
|
||||
%type <n> SleepTerm
|
||||
%type <n> StallTerm
|
||||
%type <n> SwitchTerm
|
||||
%type <n> UnloadTerm
|
||||
%type <n> WhileTerm
|
||||
/* %type <n> CaseTermList */
|
||||
|
||||
/* Type 2 opcodes */
|
||||
|
||||
%type <n> AcquireTerm
|
||||
%type <n> AddTerm
|
||||
%type <n> AndTerm
|
||||
%type <n> ConcatResTerm
|
||||
%type <n> ConcatTerm
|
||||
%type <n> CondRefOfTerm
|
||||
%type <n> CopyObjectTerm
|
||||
%type <n> DecTerm
|
||||
%type <n> DerefOfTerm
|
||||
%type <n> DivideTerm
|
||||
%type <n> FindSetLeftBitTerm
|
||||
%type <n> FindSetRightBitTerm
|
||||
%type <n> FromBCDTerm
|
||||
%type <n> IncTerm
|
||||
%type <n> IndexTerm
|
||||
%type <n> LAndTerm
|
||||
%type <n> LEqualTerm
|
||||
%type <n> LGreaterEqualTerm
|
||||
%type <n> LGreaterTerm
|
||||
%type <n> LLessEqualTerm
|
||||
%type <n> LLessTerm
|
||||
%type <n> LNotEqualTerm
|
||||
%type <n> LNotTerm
|
||||
%type <n> LoadTableTerm
|
||||
%type <n> LOrTerm
|
||||
%type <n> MatchTerm
|
||||
%type <n> MidTerm
|
||||
%type <n> ModTerm
|
||||
%type <n> MultiplyTerm
|
||||
%type <n> NAndTerm
|
||||
%type <n> NOrTerm
|
||||
%type <n> NotTerm
|
||||
%type <n> ObjectTypeTerm
|
||||
%type <n> OrTerm
|
||||
%type <n> RefOfTerm
|
||||
%type <n> ShiftLeftTerm
|
||||
%type <n> ShiftRightTerm
|
||||
%type <n> SizeOfTerm
|
||||
%type <n> StoreTerm
|
||||
%type <n> SubtractTerm
|
||||
%type <n> TimerTerm
|
||||
%type <n> ToBCDTerm
|
||||
%type <n> ToBufferTerm
|
||||
%type <n> ToDecimalStringTerm
|
||||
%type <n> ToHexStringTerm
|
||||
%type <n> ToIntegerTerm
|
||||
%type <n> ToStringTerm
|
||||
%type <n> WaitTerm
|
||||
%type <n> XOrTerm
|
||||
|
||||
/* Keywords */
|
||||
|
||||
%type <n> AccessAttribKeyword
|
||||
%type <n> AccessTypeKeyword
|
||||
%type <n> AddressingModeKeyword
|
||||
%type <n> AddressKeyword
|
||||
%type <n> AddressSpaceKeyword
|
||||
%type <n> BitsPerByteKeyword
|
||||
%type <n> ClockPhaseKeyword
|
||||
%type <n> ClockPolarityKeyword
|
||||
%type <n> DecodeKeyword
|
||||
%type <n> DevicePolarityKeyword
|
||||
%type <n> DMATypeKeyword
|
||||
%type <n> EndianKeyword
|
||||
%type <n> FlowControlKeyword
|
||||
%type <n> InterruptLevel
|
||||
%type <n> InterruptTypeKeyword
|
||||
%type <n> IODecodeKeyword
|
||||
%type <n> IoRestrictionKeyword
|
||||
%type <n> LockRuleKeyword
|
||||
%type <n> MatchOpKeyword
|
||||
%type <n> MaxKeyword
|
||||
%type <n> MemTypeKeyword
|
||||
%type <n> MinKeyword
|
||||
%type <n> ObjectTypeKeyword
|
||||
%type <n> OptionalBusMasterKeyword
|
||||
%type <n> OptionalReadWriteKeyword
|
||||
%type <n> ParityTypeKeyword
|
||||
%type <n> PinConfigByte
|
||||
%type <n> PinConfigKeyword
|
||||
%type <n> RangeTypeKeyword
|
||||
%type <n> RegionSpaceKeyword
|
||||
%type <n> ResourceTypeKeyword
|
||||
%type <n> SerializeRuleKeyword
|
||||
%type <n> ShareTypeKeyword
|
||||
%type <n> SlaveModeKeyword
|
||||
%type <n> StopBitsKeyword
|
||||
%type <n> TranslationKeyword
|
||||
%type <n> TypeKeyword
|
||||
%type <n> UpdateRuleKeyword
|
||||
%type <n> WireModeKeyword
|
||||
%type <n> XferSizeKeyword
|
||||
%type <n> XferTypeKeyword
|
||||
|
||||
/* Types */
|
||||
|
||||
%type <n> SuperName
|
||||
%type <n> ObjectTypeName
|
||||
%type <n> ArgTerm
|
||||
%type <n> LocalTerm
|
||||
%type <n> DebugTerm
|
||||
|
||||
%type <n> Integer
|
||||
%type <n> ByteConst
|
||||
%type <n> WordConst
|
||||
%type <n> DWordConst
|
||||
%type <n> QWordConst
|
||||
%type <n> String
|
||||
|
||||
%type <n> ConstTerm
|
||||
%type <n> ConstExprTerm
|
||||
%type <n> ByteConstExpr
|
||||
%type <n> WordConstExpr
|
||||
%type <n> DWordConstExpr
|
||||
%type <n> QWordConstExpr
|
||||
|
||||
%type <n> DWordList
|
||||
%type <n> BufferTerm
|
||||
%type <n> ByteList
|
||||
|
||||
%type <n> PackageElement
|
||||
%type <n> PackageList
|
||||
%type <n> PackageTerm
|
||||
%type <n> VarPackageLengthTerm
|
||||
|
||||
/* Macros */
|
||||
|
||||
%type <n> EISAIDTerm
|
||||
%type <n> ResourceMacroList
|
||||
%type <n> ResourceMacroTerm
|
||||
%type <n> ResourceTemplateTerm
|
||||
%type <n> ToUUIDTerm
|
||||
%type <n> UnicodeTerm
|
||||
|
||||
/* Resource Descriptors */
|
||||
|
||||
%type <n> ConnectionTerm
|
||||
%type <n> DataBufferTerm
|
||||
%type <n> DMATerm
|
||||
%type <n> DWordIOTerm
|
||||
%type <n> DWordMemoryTerm
|
||||
%type <n> DWordSpaceTerm
|
||||
%type <n> EndDependentFnTerm
|
||||
%type <n> ExtendedIOTerm
|
||||
%type <n> ExtendedMemoryTerm
|
||||
%type <n> ExtendedSpaceTerm
|
||||
%type <n> FixedDmaTerm
|
||||
%type <n> FixedIOTerm
|
||||
%type <n> GpioIntTerm
|
||||
%type <n> GpioIoTerm
|
||||
%type <n> I2cSerialBusTerm
|
||||
%type <n> InterruptTerm
|
||||
%type <n> IOTerm
|
||||
%type <n> IRQNoFlagsTerm
|
||||
%type <n> IRQTerm
|
||||
%type <n> Memory24Term
|
||||
%type <n> Memory32FixedTerm
|
||||
%type <n> Memory32Term
|
||||
%type <n> NameSeg
|
||||
%type <n> NameString
|
||||
%type <n> QWordIOTerm
|
||||
%type <n> QWordMemoryTerm
|
||||
%type <n> QWordSpaceTerm
|
||||
%type <n> RegisterTerm
|
||||
%type <n> SpiSerialBusTerm
|
||||
%type <n> StartDependentFnNoPriTerm
|
||||
%type <n> StartDependentFnTerm
|
||||
%type <n> UartSerialBusTerm
|
||||
%type <n> VendorLongTerm
|
||||
%type <n> VendorShortTerm
|
||||
%type <n> WordBusNumberTerm
|
||||
%type <n> WordIOTerm
|
||||
%type <n> WordSpaceTerm
|
||||
|
||||
/* Local types that help construct the AML, not in ACPI spec */
|
||||
|
||||
%type <n> AmlPackageLengthTerm
|
||||
%type <n> IncludeEndTerm
|
||||
%type <n> NameStringItem
|
||||
%type <n> TermArgItem
|
||||
|
||||
%type <n> OptionalAccessSize
|
||||
%type <n> OptionalAddressingMode
|
||||
%type <n> OptionalAddressRange
|
||||
%type <n> OptionalBitsPerByte
|
||||
%type <n> OptionalBuffer_Last
|
||||
%type <n> OptionalByteConstExpr
|
||||
%type <n> OptionalCount
|
||||
%type <n> OptionalDecodeType
|
||||
%type <n> OptionalDevicePolarity
|
||||
%type <n> OptionalDWordConstExpr
|
||||
%type <n> OptionalEndian
|
||||
%type <n> OptionalFlowControl
|
||||
%type <n> OptionalIoRestriction
|
||||
%type <n> OptionalListString
|
||||
%type <n> OptionalMaxType
|
||||
%type <n> OptionalMemType
|
||||
%type <n> OptionalMinType
|
||||
%type <n> OptionalNameString
|
||||
%type <n> OptionalNameString_First
|
||||
%type <n> OptionalNameString_Last
|
||||
%type <n> OptionalObjectTypeKeyword
|
||||
%type <n> OptionalParameterTypePackage
|
||||
%type <n> OptionalParameterTypesPackage
|
||||
%type <n> OptionalParityType
|
||||
%type <n> OptionalQWordConstExpr
|
||||
%type <n> OptionalRangeType
|
||||
%type <n> OptionalReference
|
||||
%type <n> OptionalResourceType
|
||||
%type <n> OptionalResourceType_First
|
||||
%type <n> OptionalReturnArg
|
||||
%type <n> OptionalSerializeRuleKeyword
|
||||
%type <n> OptionalShareType
|
||||
%type <n> OptionalShareType_First
|
||||
%type <n> OptionalSlaveMode
|
||||
%type <n> OptionalStopBits
|
||||
%type <n> OptionalStringData
|
||||
%type <n> OptionalTermArg
|
||||
%type <n> OptionalTranslationType_Last
|
||||
%type <n> OptionalType
|
||||
%type <n> OptionalType_Last
|
||||
%type <n> OptionalWireMode
|
||||
%type <n> OptionalWordConst
|
||||
%type <n> OptionalWordConstExpr
|
||||
%type <n> OptionalXferSize
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "acdisasm.h"
|
||||
@ -241,37 +240,6 @@ UtEndEvent (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: UtHexCharToValue
|
||||
*
|
||||
* PARAMETERS: HexChar - Hex character in Ascii
|
||||
*
|
||||
* RETURN: The binary value of the hex character
|
||||
*
|
||||
* DESCRIPTION: Perform ascii-to-hex translation
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
UINT8
|
||||
UtHexCharToValue (
|
||||
int HexChar)
|
||||
{
|
||||
|
||||
if (HexChar <= 0x39)
|
||||
{
|
||||
return ((UINT8) (HexChar - 0x30));
|
||||
}
|
||||
|
||||
if (HexChar <= 0x46)
|
||||
{
|
||||
return ((UINT8) (HexChar - 0x37));
|
||||
}
|
||||
|
||||
return ((UINT8) (HexChar - 0x57));
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: UtConvertByteToHex
|
||||
@ -296,8 +264,8 @@ UtConvertByteToHex (
|
||||
Buffer[0] = '0';
|
||||
Buffer[1] = 'x';
|
||||
|
||||
Buffer[2] = (UINT8) AslHexLookup[(RawByte >> 4) & 0xF];
|
||||
Buffer[3] = (UINT8) AslHexLookup[RawByte & 0xF];
|
||||
Buffer[2] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 4);
|
||||
Buffer[3] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -312,7 +280,7 @@ UtConvertByteToHex (
|
||||
* RETURN: Ascii hex byte is stored in Buffer.
|
||||
*
|
||||
* DESCRIPTION: Perform hex-to-ascii translation. The return data is prefixed
|
||||
* with "0x"
|
||||
* with '0', and a trailing 'h' is added.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -323,8 +291,8 @@ UtConvertByteToAsmHex (
|
||||
{
|
||||
|
||||
Buffer[0] = '0';
|
||||
Buffer[1] = (UINT8) AslHexLookup[(RawByte >> 4) & 0xF];
|
||||
Buffer[2] = (UINT8) AslHexLookup[RawByte & 0xF];
|
||||
Buffer[1] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 4);
|
||||
Buffer[2] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 0);
|
||||
Buffer[3] = 'h';
|
||||
}
|
||||
|
||||
@ -585,7 +553,7 @@ UtCheckIntegerRange (
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: UtGetStringBuffer
|
||||
* FUNCTION: UtStringCacheCalloc
|
||||
*
|
||||
* PARAMETERS: Length - Size of buffer requested
|
||||
*
|
||||
@ -598,22 +566,42 @@ UtCheckIntegerRange (
|
||||
******************************************************************************/
|
||||
|
||||
char *
|
||||
UtGetStringBuffer (
|
||||
UtStringCacheCalloc (
|
||||
UINT32 Length)
|
||||
{
|
||||
char *Buffer;
|
||||
ASL_CACHE_INFO *Cache;
|
||||
|
||||
|
||||
if (Length > ASL_STRING_CACHE_SIZE)
|
||||
{
|
||||
Buffer = UtLocalCalloc (Length);
|
||||
return (Buffer);
|
||||
}
|
||||
|
||||
if ((Gbl_StringCacheNext + Length) >= Gbl_StringCacheLast)
|
||||
{
|
||||
Gbl_StringCacheNext = UtLocalCalloc (ASL_STRING_CACHE_SIZE + Length);
|
||||
Gbl_StringCacheLast = Gbl_StringCacheNext + ASL_STRING_CACHE_SIZE +
|
||||
Length;
|
||||
/* Allocate a new buffer */
|
||||
|
||||
Cache = UtLocalCalloc (sizeof (Cache->Next) +
|
||||
ASL_STRING_CACHE_SIZE);
|
||||
|
||||
/* Link new cache buffer to head of list */
|
||||
|
||||
Cache->Next = Gbl_StringCacheList;
|
||||
Gbl_StringCacheList = Cache;
|
||||
|
||||
/* Setup cache management pointers */
|
||||
|
||||
Gbl_StringCacheNext = Cache->Buffer;
|
||||
Gbl_StringCacheLast = Gbl_StringCacheNext + ASL_STRING_CACHE_SIZE;
|
||||
}
|
||||
|
||||
Gbl_StringCount++;
|
||||
Gbl_StringSize += Length;
|
||||
|
||||
Buffer = Gbl_StringCacheNext;
|
||||
Gbl_StringCacheNext += Length;
|
||||
|
||||
return (Buffer);
|
||||
}
|
||||
|
||||
@ -646,7 +634,8 @@ UtExpandLineBuffers (
|
||||
NewSize = Gbl_LineBufferSize * 2;
|
||||
if (Gbl_CurrentLineBuffer)
|
||||
{
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,"Increasing line buffer size from %u to %u\n",
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"Increasing line buffer size from %u to %u\n",
|
||||
Gbl_LineBufferSize, NewSize);
|
||||
}
|
||||
|
||||
@ -691,6 +680,30 @@ UtExpandLineBuffers (
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: UtFreeLineBuffers
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Free all line buffers
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
UtFreeLineBuffers (
|
||||
void)
|
||||
{
|
||||
|
||||
free (Gbl_CurrentLineBuffer);
|
||||
free (Gbl_MainTokenBuffer);
|
||||
free (Gbl_MacroTokenBuffer);
|
||||
free (Gbl_ExpressionTokenBuffer);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: UtInternalizeName
|
||||
@ -723,9 +736,9 @@ UtInternalizeName (
|
||||
Info.ExternalName = ExternalName;
|
||||
AcpiNsGetInternalNameLength (&Info);
|
||||
|
||||
/* We need a segment to store the internal name */
|
||||
/* We need a segment to store the internal name */
|
||||
|
||||
Info.InternalName = UtGetStringBuffer (Info.Length);
|
||||
Info.InternalName = UtStringCacheCalloc (Info.Length);
|
||||
if (!Info.InternalName)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
|
@ -41,42 +41,13 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("asluuid")
|
||||
|
||||
|
||||
/*
|
||||
* UUID support functions.
|
||||
*
|
||||
* This table is used to convert an input UUID ascii string to a 16 byte
|
||||
* buffer and the reverse. The table maps a UUID buffer index 0-15 to
|
||||
* the index within the 36-byte UUID string where the associated 2-byte
|
||||
* hex value can be found.
|
||||
*
|
||||
* 36-byte UUID strings are of the form:
|
||||
* aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
|
||||
* Where aa-pp are one byte hex numbers, made up of two hex digits
|
||||
*
|
||||
* Note: This table is basically the inverse of the string-to-offset table
|
||||
* found in the ACPI spec in the description of the ToUUID macro.
|
||||
*/
|
||||
static UINT8 Gbl_MapToUuidOffset[16] =
|
||||
{
|
||||
6,4,2,0,11,9,16,14,19,21,24,26,28,30,32,34
|
||||
};
|
||||
|
||||
#define UUID_BUFFER_LENGTH 16
|
||||
#define UUID_STRING_LENGTH 36
|
||||
|
||||
/* Positions for required hyphens (dashes) in UUID strings */
|
||||
|
||||
#define UUID_HYPHEN1_OFFSET 8
|
||||
#define UUID_HYPHEN2_OFFSET 13
|
||||
#define UUID_HYPHEN3_OFFSET 18
|
||||
#define UUID_HYPHEN4_OFFSET 23
|
||||
extern UINT8 AcpiGbl_MapToUuidOffset[UUID_BUFFER_LENGTH];
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
@ -135,42 +106,6 @@ AuValidateUuid (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AuConvertStringToUuid
|
||||
*
|
||||
* PARAMETERS: InString - 36-byte formatted UUID string
|
||||
* UuidBuffer - 16-byte UUID buffer
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Convert 36-byte formatted UUID string to 16-byte UUID buffer
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AuConvertStringToUuid (
|
||||
char *InString,
|
||||
char *UuidBuffer)
|
||||
{
|
||||
UINT32 i;
|
||||
|
||||
|
||||
if (!InString || !UuidBuffer)
|
||||
{
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
for (i = 0; i < UUID_BUFFER_LENGTH; i++)
|
||||
{
|
||||
UuidBuffer[i] = (char) (UtHexCharToValue (InString[Gbl_MapToUuidOffset[i]]) << 4);
|
||||
UuidBuffer[i] |= (char) UtHexCharToValue (InString[Gbl_MapToUuidOffset[i] + 1]);
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AuConvertUuidToString
|
||||
@ -200,8 +135,11 @@ AuConvertUuidToString (
|
||||
|
||||
for (i = 0; i < UUID_BUFFER_LENGTH; i++)
|
||||
{
|
||||
OutString[Gbl_MapToUuidOffset[i]] = (UINT8) AslHexLookup[(UuidBuffer[i] >> 4) & 0xF];
|
||||
OutString[Gbl_MapToUuidOffset[i] + 1] = (UINT8) AslHexLookup[UuidBuffer[i] & 0xF];
|
||||
OutString[AcpiGbl_MapToUuidOffset[i]] =
|
||||
AcpiUtHexToAsciiChar (UuidBuffer[i], 4);
|
||||
|
||||
OutString[AcpiGbl_MapToUuidOffset[i] + 1] =
|
||||
AcpiUtHexToAsciiChar (UuidBuffer[i], 0);
|
||||
}
|
||||
|
||||
/* Insert required hyphens (dashes) */
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "acparser.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "aslcompiler.h"
|
||||
#include "aslcompiler.y.h"
|
||||
#include "acparser.h"
|
||||
@ -86,6 +85,20 @@ XfCheckFieldRange (
|
||||
UINT32 FieldBitLength,
|
||||
UINT32 AccessBitWidth);
|
||||
|
||||
static BOOLEAN
|
||||
XfIsObjectParental (
|
||||
ACPI_PARSE_OBJECT *MethodOp1,
|
||||
ACPI_PARSE_OBJECT *MethodOp2);
|
||||
|
||||
static ACPI_PARSE_OBJECT *
|
||||
XfGetParentMethod (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
static void
|
||||
XfCheckIllegalReference (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_NAMESPACE_NODE *Node);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -130,6 +143,8 @@ XfCrossReferenceNamespace (
|
||||
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, XfNamespaceLocateBegin,
|
||||
XfNamespaceLocateEnd, WalkState);
|
||||
|
||||
ACPI_FREE (WalkState);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
@ -262,6 +277,178 @@ XfCheckFieldRange (
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: XfIsObjectParental
|
||||
*
|
||||
* PARAMETERS: ChildOp - Op to be checked
|
||||
* PossibleParentOp - Determine if this op is in the family
|
||||
*
|
||||
* RETURN: TRUE if ChildOp is a descendent of PossibleParentOp
|
||||
*
|
||||
* DESCRIPTION: Determine if an Op is a descendent of another Op. Used to
|
||||
* detect if a method is declared within another method.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static BOOLEAN
|
||||
XfIsObjectParental (
|
||||
ACPI_PARSE_OBJECT *ChildOp,
|
||||
ACPI_PARSE_OBJECT *PossibleParentOp)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *ParentOp;
|
||||
|
||||
|
||||
/* Search upwards through the tree for possible parent */
|
||||
|
||||
ParentOp = ChildOp;
|
||||
while (ParentOp)
|
||||
{
|
||||
if (ParentOp == PossibleParentOp)
|
||||
{
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
ParentOp = ParentOp->Asl.Parent;
|
||||
}
|
||||
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: XfGetParentMethod
|
||||
*
|
||||
* PARAMETERS: Op - Op to be checked
|
||||
*
|
||||
* RETURN: Op for parent method. NULL if object is not within a method.
|
||||
*
|
||||
* DESCRIPTION: Determine if an object is within a control method. Used to
|
||||
* implement special rules for named references from within a
|
||||
* control method.
|
||||
*
|
||||
* NOTE: It would be better to have the parser set a flag in the Op if possible.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_PARSE_OBJECT *
|
||||
XfGetParentMethod (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *ParentOp;
|
||||
|
||||
|
||||
if (!Op)
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (Op->Asl.ParseOpcode == PARSEOP_METHOD)
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Walk upwards through the parse tree, up to the root if necessary */
|
||||
|
||||
ParentOp = Op;
|
||||
while (ParentOp)
|
||||
{
|
||||
if (ParentOp->Asl.ParseOpcode == PARSEOP_METHOD)
|
||||
{
|
||||
return (ParentOp);
|
||||
}
|
||||
|
||||
ParentOp = ParentOp->Asl.Parent;
|
||||
}
|
||||
|
||||
/* Object is not within a method */
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: XfCheckIllegalReference
|
||||
*
|
||||
* PARAMETERS: Op - Op referring to the target
|
||||
* TargetNode - Target of the reference
|
||||
*
|
||||
* RETURN: None. Emits error message for an illegal reference
|
||||
*
|
||||
* DESCRIPTION: Determine if a named reference is legal. A "named" reference
|
||||
* is something like: Store(ABCD, ...), where ABCD is an AML
|
||||
* Nameseg or Namepath.
|
||||
*
|
||||
* NOTE: Caller must ensure that the name Op is in fact a reference, and not
|
||||
* an actual name declaration (creation of a named object).
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
XfCheckIllegalReference (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_NAMESPACE_NODE *TargetNode)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *MethodOp1;
|
||||
ACPI_PARSE_OBJECT *MethodOp2;
|
||||
ACPI_PARSE_OBJECT *TargetOp;
|
||||
|
||||
|
||||
/*
|
||||
* Check for an illegal reference to a named object:
|
||||
*
|
||||
* 1) References from one control method to another, non-parent
|
||||
* method are not allowed, they will fail at runtime.
|
||||
*
|
||||
* 2) Forward references within a control method are not allowed.
|
||||
* AML interpreters use a one-pass parse of control methods
|
||||
* so these forward references will fail at runtime.
|
||||
*/
|
||||
TargetOp = TargetNode->Op;
|
||||
|
||||
MethodOp1 = XfGetParentMethod (Op);
|
||||
MethodOp2 = XfGetParentMethod (TargetOp);
|
||||
|
||||
/* Are both objects within control method(s)? */
|
||||
|
||||
if (!MethodOp1 || !MethodOp2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Objects not in the same method? */
|
||||
|
||||
if (MethodOp1 != MethodOp2)
|
||||
{
|
||||
/*
|
||||
* 1) Cross-method named reference
|
||||
*
|
||||
* This is OK if and only if the target reference is within in a
|
||||
* method that is a parent of current method
|
||||
*/
|
||||
if (!XfIsObjectParental (MethodOp1, MethodOp2))
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_ILLEGAL_METHOD_REF, Op,
|
||||
Op->Asl.ExternalName);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 2) Both reference and target are in the same method. Check if this is
|
||||
* an (illegal) forward reference by examining the exact source code
|
||||
* location of each (the referenced object and the object declaration).
|
||||
* This is a bit nasty, yet effective.
|
||||
*/
|
||||
else if (Op->Asl.LogicalByteOffset < TargetOp->Asl.LogicalByteOffset)
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_ILLEGAL_FORWARD_REF, Op,
|
||||
Op->Asl.ExternalName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: XfNamespaceLocateBegin
|
||||
@ -471,6 +658,10 @@ XfNamespaceLocateBegin (
|
||||
/* This node has been referenced, mark it for reference check */
|
||||
|
||||
Node->Flags |= ANOBJ_IS_REFERENCED;
|
||||
|
||||
/* Check for an illegal reference */
|
||||
|
||||
XfCheckIllegalReference (Op, Node);
|
||||
}
|
||||
|
||||
/* Attempt to optimize the NamePath */
|
||||
|
@ -141,8 +141,6 @@ DtDoCompile (
|
||||
Status = DtCompileDataTable (&FieldList);
|
||||
UtEndEvent (Event);
|
||||
|
||||
DtFreeFieldList ();
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
/* TBD: temporary error message. Msgs should come from function above */
|
||||
@ -170,6 +168,8 @@ DtDoCompile (
|
||||
|
||||
CleanupAndExit:
|
||||
|
||||
AcpiUtDeleteCaches ();
|
||||
DtDeleteCaches ();
|
||||
CmCleanupAndExit ();
|
||||
return (Status);
|
||||
}
|
||||
@ -298,7 +298,7 @@ DtCompileDataTable (
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
Gbl_Signature = UtLocalCalloc (ACPI_STRLEN (Signature) + 1);
|
||||
Gbl_Signature = UtStringCacheCalloc (ACPI_STRLEN (Signature) + 1);
|
||||
strcpy (Gbl_Signature, Signature);
|
||||
|
||||
/*
|
||||
@ -461,11 +461,11 @@ DtCompileTable (
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE));
|
||||
Subtable = UtSubtableCacheCalloc ();
|
||||
|
||||
if (Length > 0)
|
||||
{
|
||||
Subtable->Buffer = UtLocalCalloc (Length);
|
||||
Subtable->Buffer = ACPI_CAST_PTR (UINT8, UtStringCacheCalloc (Length));
|
||||
}
|
||||
Subtable->Length = Length;
|
||||
Subtable->TotalLength = Length;
|
||||
@ -567,8 +567,6 @@ DtCompileTable (
|
||||
DtSetSubtableLength (InlineSubtable);
|
||||
|
||||
ACPI_MEMCPY (Buffer, InlineSubtable->Buffer, FieldLength);
|
||||
ACPI_FREE (InlineSubtable->Buffer);
|
||||
ACPI_FREE (InlineSubtable);
|
||||
LocalField = *Field;
|
||||
break;
|
||||
|
||||
|
@ -50,6 +50,10 @@
|
||||
#include "acdisasm.h"
|
||||
|
||||
|
||||
#define ASL_FIELD_CACHE_SIZE 512
|
||||
#define ASL_SUBTABLE_CACHE_SIZE 128
|
||||
|
||||
|
||||
#undef DT_EXTERN
|
||||
|
||||
#ifdef _DECLARE_DT_GLOBALS
|
||||
@ -143,6 +147,18 @@ DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*Gbl_LabelList, NULL);
|
||||
|
||||
DT_EXTERN UINT32 DT_INIT_GLOBAL (Gbl_CurrentTableOffset, 0);
|
||||
|
||||
/* Local caches */
|
||||
|
||||
DT_EXTERN UINT32 DT_INIT_GLOBAL (Gbl_SubtableCount, 0);
|
||||
DT_EXTERN ASL_CACHE_INFO DT_INIT_GLOBAL (*Gbl_SubtableCacheList, NULL);
|
||||
DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*Gbl_SubtableCacheNext, NULL);
|
||||
DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*Gbl_SubtableCacheLast, NULL);
|
||||
|
||||
DT_EXTERN UINT32 DT_INIT_GLOBAL (Gbl_FieldCount, 0);
|
||||
DT_EXTERN ASL_CACHE_INFO DT_INIT_GLOBAL (*Gbl_FieldCacheList, NULL);
|
||||
DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*Gbl_FieldCacheNext, NULL);
|
||||
DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*Gbl_FieldCacheLast, NULL);
|
||||
|
||||
|
||||
/* dtcompiler - main module */
|
||||
|
||||
@ -368,8 +384,16 @@ void
|
||||
DtSetTableLength(
|
||||
void);
|
||||
|
||||
DT_SUBTABLE *
|
||||
UtSubtableCacheCalloc (
|
||||
void);
|
||||
|
||||
DT_FIELD *
|
||||
UtFieldCacheCalloc (
|
||||
void);
|
||||
|
||||
void
|
||||
DtFreeFieldList (
|
||||
DtDeleteCaches (
|
||||
void);
|
||||
|
||||
|
||||
@ -419,6 +443,10 @@ ACPI_STATUS
|
||||
DtCompileFpdt (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileGtdt (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileHest (
|
||||
void **PFieldList);
|
||||
|
@ -259,7 +259,7 @@ DtCompileUuid (
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = AuConvertStringToUuid (InString, (char *) Buffer);
|
||||
AcpiUtConvertStringToUuid (InString, Buffer);
|
||||
}
|
||||
|
||||
return (Status);
|
||||
|
@ -133,7 +133,7 @@ DtTrim (
|
||||
|
||||
if (!ACPI_STRCMP (String, " "))
|
||||
{
|
||||
ReturnString = UtLocalCalloc (1);
|
||||
ReturnString = UtStringCacheCalloc (1);
|
||||
return (ReturnString);
|
||||
}
|
||||
|
||||
@ -181,7 +181,7 @@ DtTrim (
|
||||
/* Create the trimmed return string */
|
||||
|
||||
Length = ACPI_PTR_DIFF (End, Start) + 1;
|
||||
ReturnString = UtLocalCalloc (Length + 1);
|
||||
ReturnString = UtStringCacheCalloc (Length + 1);
|
||||
if (ACPI_STRLEN (Start))
|
||||
{
|
||||
ACPI_STRNCPY (ReturnString, Start, Length);
|
||||
@ -370,7 +370,7 @@ DtParseLine (
|
||||
|
||||
if ((Value && *Value) || IsNullString)
|
||||
{
|
||||
Field = UtLocalCalloc (sizeof (DT_FIELD));
|
||||
Field = UtFieldCacheCalloc ();
|
||||
Field->Name = Name;
|
||||
Field->Value = Value;
|
||||
Field->Line = Line;
|
||||
@ -380,11 +380,7 @@ DtParseLine (
|
||||
|
||||
DtLinkField (Field);
|
||||
}
|
||||
else /* Ignore this field, it has no valid data */
|
||||
{
|
||||
ACPI_FREE (Name);
|
||||
ACPI_FREE (Value);
|
||||
}
|
||||
/* Else -- Ignore this field, it has no valid data */
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
@ -1035,6 +1031,8 @@ DtDumpSubtableList (
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"\nSubtable Tree: (Depth, Subtable, Length, TotalLength)\n\n");
|
||||
DtWalkTableTree (Gbl_RootTable, DtDumpSubtableTree, NULL, NULL);
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\n");
|
||||
}
|
||||
|
||||
|
||||
|
@ -75,11 +75,11 @@ DtCreateSubtable (
|
||||
DT_SUBTABLE *Subtable;
|
||||
|
||||
|
||||
Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE));
|
||||
Subtable = UtSubtableCacheCalloc ();
|
||||
|
||||
/* Create a new buffer for the subtable data */
|
||||
|
||||
Subtable->Buffer = UtLocalCalloc (Length);
|
||||
Subtable->Buffer = ACPI_CAST_PTR (UINT8, UtStringCacheCalloc (Length));
|
||||
ACPI_MEMCPY (Subtable->Buffer, Buffer, Length);
|
||||
|
||||
Subtable->Length = Length;
|
||||
|
@ -736,16 +736,21 @@ DtCompileDmar (
|
||||
InfoTable = AcpiDmTableInfoDmar1;
|
||||
break;
|
||||
|
||||
case ACPI_DMAR_TYPE_ATSR:
|
||||
case ACPI_DMAR_TYPE_ROOT_ATS:
|
||||
|
||||
InfoTable = AcpiDmTableInfoDmar2;
|
||||
break;
|
||||
|
||||
case ACPI_DMAR_HARDWARE_AFFINITY:
|
||||
case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
|
||||
|
||||
InfoTable = AcpiDmTableInfoDmar3;
|
||||
break;
|
||||
|
||||
case ACPI_DMAR_TYPE_NAMESPACE:
|
||||
|
||||
InfoTable = AcpiDmTableInfoDmar4;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "DMAR");
|
||||
@ -762,10 +767,20 @@ DtCompileDmar (
|
||||
|
||||
ParentTable = DtPeekSubtable ();
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
|
||||
/*
|
||||
* Optional Device Scope subtables
|
||||
*/
|
||||
if ((DmarHeader->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
|
||||
(DmarHeader->Type == ACPI_DMAR_TYPE_NAMESPACE))
|
||||
{
|
||||
/* These types do not support device scopes */
|
||||
|
||||
DtPopSubtable ();
|
||||
continue;
|
||||
}
|
||||
|
||||
DtPushSubtable (Subtable);
|
||||
|
||||
/* Optional Device Scope subtables */
|
||||
|
||||
DeviceScopeLength = DmarHeader->Length - Subtable->Length -
|
||||
ParentTable->Length;
|
||||
while (DeviceScopeLength)
|
||||
@ -938,6 +953,125 @@ DtCompileFadt (
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileGtdt
|
||||
*
|
||||
* PARAMETERS: List - Current field list pointer
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Compile GTDT.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileGtdt (
|
||||
void **List)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
DT_SUBTABLE *Subtable;
|
||||
DT_SUBTABLE *ParentTable;
|
||||
DT_FIELD **PFieldList = (DT_FIELD **) List;
|
||||
DT_FIELD *SubtableStart;
|
||||
ACPI_SUBTABLE_HEADER *GtdtHeader;
|
||||
ACPI_DMTABLE_INFO *InfoTable;
|
||||
UINT32 GtCount;
|
||||
|
||||
|
||||
Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt,
|
||||
&Subtable, TRUE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
ParentTable = DtPeekSubtable ();
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
|
||||
while (*PFieldList)
|
||||
{
|
||||
SubtableStart = *PFieldList;
|
||||
Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdtHdr,
|
||||
&Subtable, TRUE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
ParentTable = DtPeekSubtable ();
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
DtPushSubtable (Subtable);
|
||||
|
||||
GtdtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
|
||||
|
||||
switch (GtdtHeader->Type)
|
||||
{
|
||||
case ACPI_GTDT_TYPE_TIMER_BLOCK:
|
||||
|
||||
InfoTable = AcpiDmTableInfoGtdt0;
|
||||
break;
|
||||
|
||||
case ACPI_GTDT_TYPE_WATCHDOG:
|
||||
|
||||
InfoTable = AcpiDmTableInfoGtdt1;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "GTDT");
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
ParentTable = DtPeekSubtable ();
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
|
||||
/*
|
||||
* Additional GT block subtable data
|
||||
*/
|
||||
|
||||
switch (GtdtHeader->Type)
|
||||
{
|
||||
case ACPI_GTDT_TYPE_TIMER_BLOCK:
|
||||
|
||||
DtPushSubtable (Subtable);
|
||||
ParentTable = DtPeekSubtable ();
|
||||
|
||||
GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
|
||||
Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount;
|
||||
while (GtCount)
|
||||
{
|
||||
Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt0a,
|
||||
&Subtable, TRUE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
DtInsertSubtable (ParentTable, Subtable);
|
||||
GtCount--;
|
||||
}
|
||||
DtPopSubtable ();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
DtPopSubtable ();
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
@ -1501,6 +1635,16 @@ DtCompileMadt (
|
||||
InfoTable = AcpiDmTableInfoMadt12;
|
||||
break;
|
||||
|
||||
case ACPI_MADT_TYPE_GENERIC_MSI_FRAME:
|
||||
|
||||
InfoTable = AcpiDmTableInfoMadt13;
|
||||
break;
|
||||
|
||||
case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR:
|
||||
|
||||
InfoTable = AcpiDmTableInfoMadt14;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "MADT");
|
||||
@ -1792,6 +1936,11 @@ DtCompilePcct (
|
||||
InfoTable = AcpiDmTableInfoPcct0;
|
||||
break;
|
||||
|
||||
case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE:
|
||||
|
||||
InfoTable = AcpiDmTableInfoPcct1;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PCCT");
|
||||
@ -2271,6 +2420,11 @@ DtCompileSrat (
|
||||
InfoTable = AcpiDmTableInfoSrat2;
|
||||
break;
|
||||
|
||||
case ACPI_SRAT_TYPE_GICC_AFFINITY:
|
||||
|
||||
InfoTable = AcpiDmTableInfoSrat3;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SRAT");
|
||||
|
@ -187,6 +187,12 @@ DtCreateTemplates (
|
||||
}
|
||||
|
||||
Status = DtCreateOneTemplate (Signature, TableData);
|
||||
|
||||
|
||||
/* Shutdown ACPICA subsystem */
|
||||
|
||||
(void) AcpiTerminate ();
|
||||
CmDeleteCaches ();
|
||||
return (Status);
|
||||
}
|
||||
|
||||
@ -397,6 +403,5 @@ DtCreateOneTemplate (
|
||||
Cleanup:
|
||||
fclose (File);
|
||||
AcpiOsRedirectOutput (stdout);
|
||||
ACPI_FREE (DisasmFilename);
|
||||
return (Status);
|
||||
}
|
||||
|
@ -395,7 +395,7 @@ const unsigned char TemplateFadt[] =
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01, /* 00000070 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000080 "........" */
|
||||
0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00, /* 00000080 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000088 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x20,0x00,0x02, /* 00000090 "..... .." */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
|
||||
@ -434,16 +434,34 @@ const unsigned char TemplateFpdt[] =
|
||||
|
||||
const unsigned char TemplateGtdt[] =
|
||||
{
|
||||
0x47,0x54,0x44,0x54,0x50,0x00,0x00,0x00, /* 00000000 "GTDTP..." */
|
||||
0x01,0xF1,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x23,0x06,0x11,0x20,0x00,0x00,0x00,0x00, /* 00000020 "#.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000048 "........" */
|
||||
0x47,0x54,0x44,0x54,0xe0,0x00,0x00,0x00, /* 00000000 "GTDT...." */
|
||||
0x02,0xb0,0x4c,0x49,0x4e,0x41,0x52,0x4f, /* 00000008 "..LINARO" */
|
||||
0x52,0x54,0x53,0x4d,0x56,0x45,0x56,0x38, /* 00000010 "RTSMVEV8" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c, /* 00000018 "....INTL" */
|
||||
0x24,0x04,0x14,0x20,0x00,0x00,0x00,0x00, /* 00000020 "$.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x1d,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x1e,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x1b,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x1a,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000048 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
|
||||
0x02,0x00,0x00,0x00,0x60,0x00,0x00,0x00, /* 00000058 "....`..." */
|
||||
0x00,0x64,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 ".d......" */
|
||||
0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000088 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000090 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000098 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000a0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000a8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000b0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000b8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x1c,0x00,0x00, /* 000000c0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000c8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000d8 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateHest[] =
|
||||
@ -575,41 +593,48 @@ const unsigned char TemplateLpit[] =
|
||||
0x00,0x00,0x00,0x00 /* 000000B0 "...." */
|
||||
};
|
||||
|
||||
/* MADT with ACPI 5.0 subtables */
|
||||
/* MADT with ACPI 5.1 subtables */
|
||||
|
||||
const unsigned char TemplateMadt[] =
|
||||
{
|
||||
0x41,0x50,0x49,0x43,0xF6,0x00,0x00,0x00, /* 00000000 "APIC...." */
|
||||
0x01,0xB0,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x23,0x06,0x11,0x20,0x00,0x00,0x00,0x00, /* 00000020 "#.. ...." */
|
||||
0x41,0x50,0x49,0x43,0x2a,0x01,0x00,0x00, /* 00000000 "APIC*..." */
|
||||
0x04,0x34,0x49,0x4e,0x54,0x45,0x4c,0x20, /* 00000008 ".4INTEL " */
|
||||
0x54,0x45,0x4d,0x50,0x4c,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c, /* 00000018 "....INTL" */
|
||||
0x24,0x04,0x14,0x20,0x00,0x00,0x00,0x00, /* 00000020 "$.. ...." */
|
||||
0x01,0x00,0x00,0x00,0x00,0x08,0x00,0x00, /* 00000028 "........" */
|
||||
0x01,0x00,0x00,0x00,0x01,0x0C,0x01,0x00, /* 00000030 "........" */
|
||||
0x01,0x00,0x00,0x00,0x01,0x0c,0x01,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x02,0x0A,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x00,0x00,0x03,0x08,0x0D,0x00,0x01,0x00, /* 00000048 "........" */
|
||||
0x02,0x0a,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x00,0x00,0x03,0x08,0x0d,0x00,0x01,0x00, /* 00000048 "........" */
|
||||
0x00,0x00,0x04,0x06,0x00,0x05,0x00,0x01, /* 00000050 "........" */
|
||||
0x05,0x0C,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x05,0x0c,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00,0x06,0x10,0x00,0x00, /* 00000060 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x00,0x00,0x00,0x00,0x07,0x16,0x00,0x00, /* 00000070 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x5C,0x43,0x50,0x55, /* 00000080 "....\CPU" */
|
||||
0x00,0x00,0x00,0x00,0x5c,0x43,0x50,0x55, /* 00000080 "....\CPU" */
|
||||
0x30,0x00,0x08,0x10,0x05,0x00,0x00,0x00, /* 00000088 "0......." */
|
||||
0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00, /* 00000090 "........" */
|
||||
0x00,0x00,0x09,0x10,0x00,0x00,0x00,0x00, /* 00000098 "........" */
|
||||
0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
|
||||
0x00,0x00,0x0A,0x0C,0x05,0x00,0x00,0x00, /* 000000A8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0x28, /* 000000B0 ".......(" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */
|
||||
0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x18, /* 000000D8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00 /* 000000F0 "......" */
|
||||
0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000a0 "........" */
|
||||
0x00,0x00,0x0a,0x0c,0x05,0x00,0x00,0x00, /* 000000a8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x4c, /* 000000b0 ".......L" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000b8 "........" */
|
||||
0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000c0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000c8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000e0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000e8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000f0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000f8 "........" */
|
||||
0x00,0x00,0x0e,0x10,0x00,0x00,0x00,0x00, /* 00000100 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */
|
||||
0x00,0x00,0x0c,0x18,0x00,0x00,0x00,0x00, /* 00000110 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */
|
||||
0x00,0x00 /* 00000128 ".. " */
|
||||
};
|
||||
|
||||
const unsigned char TemplateMcfg[] =
|
||||
@ -703,27 +728,27 @@ const unsigned char TemplateMtmr[] =
|
||||
const unsigned char TemplatePcct[] =
|
||||
{
|
||||
0x50,0x43,0x43,0x54,0xAC,0x00,0x00,0x00, /* 00000000 "PCCT...." */
|
||||
0x01,0x97,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0xCF,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x15,0x11,0x13,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */
|
||||
0x27,0x06,0x14,0x20,0x01,0x00,0x00,0x00, /* 00000020 "'.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 ".>......" */
|
||||
0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11, /* 00000038 "........" */
|
||||
0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22, /* 00000040 """""""""" */
|
||||
0x01,0x32,0x00,0x03,0x33,0x33,0x33,0x33, /* 00000048 ".2..3333" */
|
||||
0x33,0x33,0x33,0x33,0x44,0x44,0x44,0x44, /* 00000050 "3333DDDD" */
|
||||
0x44,0x44,0x44,0x44,0x55,0x55,0x55,0x55, /* 00000058 "DDDDUUUU" */
|
||||
0x55,0x55,0x55,0x55,0x66,0x66,0x66,0x66, /* 00000060 "UUUUffff" */
|
||||
0x77,0x77,0x77,0x77,0x88,0x88,0x00,0x3E, /* 00000068 "wwww...>" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF, /* 00000070 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEE,0xEE, /* 00000078 "........" */
|
||||
0xEE,0xEE,0xEE,0xEE,0xEE,0xEE,0x01,0x32, /* 00000080 ".......2" */
|
||||
0x00,0x03,0xDD,0xDD,0xDD,0xDD,0xDD,0xDD, /* 00000088 "........" */
|
||||
0xDD,0xDD,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC, /* 00000090 "........" */
|
||||
0xCC,0xCC,0xBB,0xBB,0xBB,0xBB,0xBB,0xBB, /* 00000098 "........" */
|
||||
0xBB,0xBB,0xAA,0xAA,0xAA,0xAA,0x99,0x99, /* 000000A0 "........" */
|
||||
0x99,0x99,0x88,0x88 /* 000000A8 "...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x01,0x32,0x00,0x03,0x00,0x00,0x00,0x00, /* 00000048 ".2......" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
|
||||
0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF, /* 00000058 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x00,0x00, /* 00000060 "........" */
|
||||
0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x3E, /* 00000068 ".......>" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000070 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x32, /* 00000080 ".......2" */
|
||||
0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */
|
||||
0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000098 "........" */
|
||||
0xFF,0xFF,0x01,0x00,0x00,0x00,0x01,0x00, /* 000000A0 "........" */
|
||||
0x00,0x00,0x01,0x00 /* 000000A8 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplatePmtt[] =
|
||||
@ -936,11 +961,11 @@ const unsigned char TemplateSpmi[] =
|
||||
|
||||
const unsigned char TemplateSrat[] =
|
||||
{
|
||||
0x53,0x52,0x41,0x54,0x80,0x00,0x00,0x00, /* 00000000 "SRAT...." */
|
||||
0x03,0x5A,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".ZINTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x53,0x52,0x41,0x54,0x92,0x00,0x00,0x00, /* 00000000 "SRAT...." */
|
||||
0x03,0x50,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".PINTEL " */
|
||||
0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x01,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x24,0x07,0x14,0x20,0x01,0x00,0x00,0x00, /* 00000020 "$.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x10,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
@ -951,7 +976,10 @@ const unsigned char TemplateSrat[] =
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
|
||||
0x02,0x18,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000070 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x03,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
|
||||
0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */
|
||||
0x00,0x00 /* 00000090 ".." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateTcpa[] =
|
||||
|
@ -501,6 +501,7 @@ DtGetFieldLength (
|
||||
case ACPI_DMT_SPACEID:
|
||||
case ACPI_DMT_ACCWIDTH:
|
||||
case ACPI_DMT_IVRS:
|
||||
case ACPI_DMT_GTDT:
|
||||
case ACPI_DMT_MADT:
|
||||
case ACPI_DMT_PCCT:
|
||||
case ACPI_DMT_PMTT:
|
||||
@ -512,6 +513,7 @@ DtGetFieldLength (
|
||||
case ACPI_DMT_EINJINST:
|
||||
case ACPI_DMT_ERSTACT:
|
||||
case ACPI_DMT_ERSTINST:
|
||||
case ACPI_DMT_DMAR_SCOPE:
|
||||
|
||||
ByteLength = 1;
|
||||
break;
|
||||
@ -843,39 +845,151 @@ DtWalkTableTree (
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtFreeFieldList
|
||||
* FUNCTION: UtSubtableCacheCalloc
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Pointer to the buffer. Aborts on allocation failure
|
||||
*
|
||||
* DESCRIPTION: Allocate a subtable object buffer. Bypass the local
|
||||
* dynamic memory manager for performance reasons (This has a
|
||||
* major impact on the speed of the compiler.)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
DT_SUBTABLE *
|
||||
UtSubtableCacheCalloc (
|
||||
void)
|
||||
{
|
||||
ASL_CACHE_INFO *Cache;
|
||||
|
||||
|
||||
if (Gbl_SubtableCacheNext >= Gbl_SubtableCacheLast)
|
||||
{
|
||||
/* Allocate a new buffer */
|
||||
|
||||
Cache = UtLocalCalloc (sizeof (Cache->Next) +
|
||||
(sizeof (DT_SUBTABLE) * ASL_SUBTABLE_CACHE_SIZE));
|
||||
|
||||
/* Link new cache buffer to head of list */
|
||||
|
||||
Cache->Next = Gbl_SubtableCacheList;
|
||||
Gbl_SubtableCacheList = Cache;
|
||||
|
||||
/* Setup cache management pointers */
|
||||
|
||||
Gbl_SubtableCacheNext = ACPI_CAST_PTR (DT_SUBTABLE, Cache->Buffer);
|
||||
Gbl_SubtableCacheLast = Gbl_SubtableCacheNext + ASL_SUBTABLE_CACHE_SIZE;
|
||||
}
|
||||
|
||||
Gbl_SubtableCount++;
|
||||
return (Gbl_SubtableCacheNext++);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: UtFieldCacheCalloc
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Pointer to the buffer. Aborts on allocation failure
|
||||
*
|
||||
* DESCRIPTION: Allocate a field object buffer. Bypass the local
|
||||
* dynamic memory manager for performance reasons (This has a
|
||||
* major impact on the speed of the compiler.)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
DT_FIELD *
|
||||
UtFieldCacheCalloc (
|
||||
void)
|
||||
{
|
||||
ASL_CACHE_INFO *Cache;
|
||||
|
||||
|
||||
if (Gbl_FieldCacheNext >= Gbl_FieldCacheLast)
|
||||
{
|
||||
/* Allocate a new buffer */
|
||||
|
||||
Cache = UtLocalCalloc (sizeof (Cache->Next) +
|
||||
(sizeof (DT_FIELD) * ASL_FIELD_CACHE_SIZE));
|
||||
|
||||
/* Link new cache buffer to head of list */
|
||||
|
||||
Cache->Next = Gbl_FieldCacheList;
|
||||
Gbl_FieldCacheList = Cache;
|
||||
|
||||
/* Setup cache management pointers */
|
||||
|
||||
Gbl_FieldCacheNext = ACPI_CAST_PTR (DT_FIELD, Cache->Buffer);
|
||||
Gbl_FieldCacheLast = Gbl_FieldCacheNext + ASL_FIELD_CACHE_SIZE;
|
||||
}
|
||||
|
||||
Gbl_FieldCount++;
|
||||
return (Gbl_FieldCacheNext++);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtDeleteCaches
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Free the field list
|
||||
* DESCRIPTION: Delete all local cache buffer blocks
|
||||
*
|
||||
*****************************************************************************/
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
DtFreeFieldList (
|
||||
DtDeleteCaches (
|
||||
void)
|
||||
{
|
||||
DT_FIELD *Field = Gbl_FieldList;
|
||||
DT_FIELD *NextField;
|
||||
UINT32 BufferCount;
|
||||
ASL_CACHE_INFO *Next;
|
||||
|
||||
|
||||
/* Walk and free entire field list */
|
||||
/* Field cache */
|
||||
|
||||
while (Field)
|
||||
BufferCount = 0;
|
||||
while (Gbl_FieldCacheList)
|
||||
{
|
||||
NextField = Field->Next; /* Save link */
|
||||
|
||||
if (!(Field->Flags & DT_FIELD_NOT_ALLOCATED))
|
||||
{
|
||||
ACPI_FREE (Field->Name);
|
||||
ACPI_FREE (Field->Value);
|
||||
}
|
||||
|
||||
ACPI_FREE (Field);
|
||||
Field = NextField;
|
||||
Next = Gbl_FieldCacheList->Next;
|
||||
ACPI_FREE (Gbl_FieldCacheList);
|
||||
Gbl_FieldCacheList = Next;
|
||||
BufferCount++;
|
||||
}
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"%u Fields, Buffer size: %u fields (%u bytes), %u Buffers\n",
|
||||
Gbl_FieldCount, ASL_FIELD_CACHE_SIZE,
|
||||
(sizeof (DT_FIELD) * ASL_FIELD_CACHE_SIZE), BufferCount);
|
||||
|
||||
Gbl_FieldCount = 0;
|
||||
Gbl_FieldCacheNext = NULL;
|
||||
Gbl_FieldCacheLast = NULL;
|
||||
|
||||
/* Subtable cache */
|
||||
|
||||
BufferCount = 0;
|
||||
while (Gbl_SubtableCacheList)
|
||||
{
|
||||
Next = Gbl_SubtableCacheList->Next;
|
||||
ACPI_FREE (Gbl_SubtableCacheList);
|
||||
Gbl_SubtableCacheList = Next;
|
||||
BufferCount++;
|
||||
}
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"%u Subtables, Buffer size: %u subtables (%u bytes), %u Buffers\n",
|
||||
Gbl_SubtableCount, ASL_SUBTABLE_CACHE_SIZE,
|
||||
(sizeof (DT_SUBTABLE) * ASL_SUBTABLE_CACHE_SIZE), BufferCount);
|
||||
|
||||
Gbl_SubtableCount = 0;
|
||||
Gbl_SubtableCacheNext = NULL;
|
||||
Gbl_SubtableCacheLast = NULL;
|
||||
}
|
||||
|
@ -340,7 +340,6 @@ PrOpenIncludeWithPrefix (
|
||||
if (!IncludeFile)
|
||||
{
|
||||
fprintf (stderr, "Could not open include file %s\n", Pathname);
|
||||
ACPI_FREE (Pathname);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@ -393,15 +392,17 @@ PrPushInputFileStack (
|
||||
|
||||
/* Reset the global line count and filename */
|
||||
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename =
|
||||
UtStringCacheCalloc (strlen (Filename) + 1);
|
||||
strcpy (Gbl_Files[ASL_FILE_INPUT].Filename, Filename);
|
||||
|
||||
Gbl_Files[ASL_FILE_INPUT].Handle = InputFile;
|
||||
Gbl_PreviousLineNumber = 0;
|
||||
Gbl_CurrentLineNumber = 0;
|
||||
|
||||
/* Emit a new #line directive for the include file */
|
||||
|
||||
FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\"\n",
|
||||
1, Filename);
|
||||
FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\"\n", 1, Filename);
|
||||
}
|
||||
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acevents.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acdebug.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "amlcode.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acdebug.h"
|
||||
|
@ -42,7 +42,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acdebug.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acdebug.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acdebug.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acdispat.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acnamesp.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acdebug.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acnamesp.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "amlcode.h"
|
||||
|
@ -41,9 +41,9 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acutils.h"
|
||||
#include "acdisasm.h"
|
||||
#include "acparser.h"
|
||||
#include "amlcode.h"
|
||||
@ -57,6 +57,10 @@
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
AcpiDmUuid (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
static void
|
||||
AcpiDmUnicode (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
@ -71,6 +75,7 @@ AcpiDmPldBuffer (
|
||||
UINT8 *ByteData,
|
||||
UINT32 ByteCount);
|
||||
|
||||
|
||||
#define ACPI_BUFFER_BYTES_PER_LINE 8
|
||||
|
||||
|
||||
@ -216,6 +221,11 @@ AcpiDmByteList (
|
||||
AcpiOsPrintf ("\n");
|
||||
break;
|
||||
|
||||
case ACPI_DASM_UUID:
|
||||
|
||||
AcpiDmUuid (Op);
|
||||
break;
|
||||
|
||||
case ACPI_DASM_UNICODE:
|
||||
|
||||
AcpiDmUnicode (Op);
|
||||
@ -239,6 +249,137 @@ AcpiDmByteList (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmIsUuidBuffer
|
||||
*
|
||||
* PARAMETERS: Op - Buffer Object to be examined
|
||||
*
|
||||
* RETURN: TRUE if buffer contains a UUID
|
||||
*
|
||||
* DESCRIPTION: Determine if a buffer Op contains a UUID
|
||||
*
|
||||
* To help determine whether the buffer is a UUID versus a raw data buffer,
|
||||
* there a are a couple bytes we can look at:
|
||||
*
|
||||
* xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
|
||||
*
|
||||
* The variant covered by the UUID specification is indicated by the two most
|
||||
* significant bits of N being 1 0 (i.e., the hexadecimal N will always be
|
||||
* 8, 9, A, or B).
|
||||
*
|
||||
* The variant covered by the UUID specification has five versions. For this
|
||||
* variant, the four bits of M indicates the UUID version (i.e., the
|
||||
* hexadecimal M will be either 1, 2, 3, 4, or 5).
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
BOOLEAN
|
||||
AcpiDmIsUuidBuffer (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
UINT8 *ByteData;
|
||||
UINT32 ByteCount;
|
||||
ACPI_PARSE_OBJECT *SizeOp;
|
||||
ACPI_PARSE_OBJECT *NextOp;
|
||||
|
||||
|
||||
/* Buffer size is the buffer argument */
|
||||
|
||||
SizeOp = Op->Common.Value.Arg;
|
||||
|
||||
/* Next, the initializer byte list to examine */
|
||||
|
||||
NextOp = SizeOp->Common.Next;
|
||||
if (!NextOp)
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/* Extract the byte list info */
|
||||
|
||||
ByteData = NextOp->Named.Data;
|
||||
ByteCount = (UINT32) NextOp->Common.Value.Integer;
|
||||
|
||||
/* Byte count must be exactly 16 */
|
||||
|
||||
if (ByteCount != UUID_BUFFER_LENGTH)
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/* Check for valid "M" and "N" values (see function header above) */
|
||||
|
||||
if (((ByteData[7] & 0xF0) == 0x00) || /* M={1,2,3,4,5} */
|
||||
((ByteData[7] & 0xF0) > 0x50) ||
|
||||
((ByteData[8] & 0xF0) < 0x80) || /* N={8,9,A,B} */
|
||||
((ByteData[8] & 0xF0) > 0xB0))
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/* Ignore the Size argument in the disassembly of this buffer op */
|
||||
|
||||
SizeOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmUuid
|
||||
*
|
||||
* PARAMETERS: Op - Byte List op containing a UUID
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Dump a buffer containing a UUID as a standard ASCII string.
|
||||
*
|
||||
* Output Format:
|
||||
* In its canonical form, the UUID is represented by a string containing 32
|
||||
* lowercase hexadecimal digits, displayed in 5 groups separated by hyphens.
|
||||
* The complete form is 8-4-4-4-12 for a total of 36 characters (32
|
||||
* alphanumeric characters representing hex digits and 4 hyphens). In bytes,
|
||||
* 4-2-2-2-6. Example:
|
||||
*
|
||||
* ToUUID ("107ededd-d381-4fd7-8da9-08e9a6c79644")
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
AcpiDmUuid (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
UINT8 *Data;
|
||||
const char *Description;
|
||||
|
||||
|
||||
Data = ACPI_CAST_PTR (UINT8, Op->Named.Data);
|
||||
|
||||
/* Emit the 36-byte UUID string in the proper format/order */
|
||||
|
||||
AcpiOsPrintf (
|
||||
"\"%2.2x%2.2x%2.2x%2.2x-"
|
||||
"%2.2x%2.2x-"
|
||||
"%2.2x%2.2x-"
|
||||
"%2.2x%2.2x-"
|
||||
"%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x\")",
|
||||
Data[3], Data[2], Data[1], Data[0],
|
||||
Data[5], Data[4],
|
||||
Data[7], Data[6],
|
||||
Data[8], Data[9],
|
||||
Data[10], Data[11], Data[12], Data[13], Data[14], Data[15]);
|
||||
|
||||
/* Dump the UUID description string if available */
|
||||
|
||||
Description = AcpiAhMatchUuid (Data);
|
||||
if (Description)
|
||||
{
|
||||
AcpiOsPrintf (" /* %s */", Description);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmIsUnicodeBuffer
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acdispat.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "amlcode.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acnamesp.h"
|
||||
|
@ -827,7 +827,12 @@ AcpiDmDisassembleOneOp (
|
||||
}
|
||||
}
|
||||
|
||||
if (AcpiDmIsUnicodeBuffer (Op))
|
||||
if (AcpiDmIsUuidBuffer (Op))
|
||||
{
|
||||
Op->Common.DisasmOpcode = ACPI_DASM_UUID;
|
||||
AcpiOsPrintf ("ToUUID (");
|
||||
}
|
||||
else if (AcpiDmIsUnicodeBuffer (Op))
|
||||
{
|
||||
Op->Common.DisasmOpcode = ACPI_DASM_UNICODE;
|
||||
AcpiOsPrintf ("Unicode (");
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "amlcode.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acdisasm.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acdisasm.h"
|
||||
@ -274,7 +273,7 @@ AcpiDmGpioIntDescriptor (
|
||||
AcpiDmIndent (Level);
|
||||
AcpiOsPrintf ("GpioInt (%s, %s, %s, ",
|
||||
AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.IntFlags)],
|
||||
AcpiGbl_LlDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->Gpio.IntFlags, 1)],
|
||||
AcpiGbl_LlDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 1)],
|
||||
AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
|
||||
|
||||
/* PinConfig, DebounceTimeout */
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acdisasm.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "amlcode.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acparser.h"
|
||||
@ -285,7 +284,8 @@ AcpiDmBlockType (
|
||||
|
||||
case AML_BUFFER_OP:
|
||||
|
||||
if (Op->Common.DisasmOpcode == ACPI_DASM_UNICODE)
|
||||
if ((Op->Common.DisasmOpcode == ACPI_DASM_UNICODE) ||
|
||||
(Op->Common.DisasmOpcode == ACPI_DASM_UUID))
|
||||
{
|
||||
return (BLOCK_NONE);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user