Merge ACPICA 20100702.
This commit is contained in:
commit
a88e22b7ad
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=209746
@ -33,7 +33,8 @@ src_headers="acapps.h accommon.h acconfig.h acdebug.h acdisasm.h \
|
||||
acresrc.h acrestyp.h acstruct.h actables.h actbl.h actbl1.h \
|
||||
actbl2.h actypes.h acutils.h amlcode.h amlresrc.h \
|
||||
platform/acenv.h platform/acfreebsd.h platform/acgcc.h"
|
||||
comp_headers="aslcompiler.h asldefine.h aslglobal.h asltypes.h"
|
||||
comp_headers="aslcompiler.h asldefine.h aslglobal.h asltypes.h \
|
||||
dtcompiler.h dttemplate.h"
|
||||
platform_headers="acfreebsd.h acgcc.h"
|
||||
|
||||
# pre-clean
|
||||
@ -49,7 +50,7 @@ tar -x -z -f ${src} -C ${wrk}
|
||||
# strip files
|
||||
echo strip
|
||||
for i in ${stripdirs}; do
|
||||
find ${wrk} -name ${i} -type d | xargs rm -r
|
||||
find ${wrk} -name ${i} -type d -print | xargs rm -r
|
||||
done
|
||||
for i in ${stripfiles}; do
|
||||
find ${wrk} -name ${i} -type f -delete
|
||||
@ -58,22 +59,22 @@ done
|
||||
# copy files
|
||||
echo copying full dirs
|
||||
for i in ${fulldirs}; do
|
||||
find ${wrk} -name ${i} -type d | xargs -J % mv % ${dst}
|
||||
find ${wrk} -name ${i} -type d -print | xargs -J % mv % ${dst}
|
||||
done
|
||||
echo copying remaining files
|
||||
find ${wrk} -type f | xargs -J % mv % ${dst}
|
||||
find ${wrk} -type f -print | xargs -J % mv % ${dst}
|
||||
|
||||
# canonify include paths
|
||||
for H in ${src_headers}; do
|
||||
find ${dst} -name "*.[chy]" -type f | \
|
||||
find ${dst} -name "*.[chy]" -type f -print | \
|
||||
xargs sed -i "" -e "s|[\"<]$H[\">]|\<contrib/dev/acpica/include/$H\>|g"
|
||||
done
|
||||
for H in ${comp_headers}; do
|
||||
find ${dst}/compiler -name "*.[chly]" -type f | \
|
||||
find ${dst}/common ${dst}/compiler -name "*.[chly]" -type f | \
|
||||
xargs sed -i "" -e "s|[\"<]$H[\">]|\<contrib/dev/acpica/compiler/$H\>|g"
|
||||
done
|
||||
for H in ${platform_headers}; do
|
||||
find ${dst}/include/platform -name "*.h" -type f | \
|
||||
find ${dst}/include/platform -name "*.h" -type f -print | \
|
||||
xargs sed -i "" -e "s|[\"<]$H[\">]|\<contrib/dev/acpica/include/platform/$H\>|g"
|
||||
done
|
||||
|
||||
|
@ -1,3 +1,166 @@
|
||||
----------------------------------------
|
||||
02 July 2010. Summary of changes for version 20100702:
|
||||
|
||||
This release is available at www.acpica.org/downloads
|
||||
|
||||
1) ACPI CA Core Subsystem:
|
||||
|
||||
Implemented several updates to the recently added GPE reference count
|
||||
support. The model for "wake" GPEs is changing to give the host OS complete
|
||||
control of these GPEs. Eventually, the ACPICA core will not execute any _PRW
|
||||
methods, since the host already must execute them. Also, additional changes
|
||||
were made to help ensure that the reference counts are kept in proper
|
||||
synchronization with reality. Rafael J. Wysocki.
|
||||
|
||||
1) Ensure that GPEs are not enabled twice during initialization.
|
||||
2) Ensure that GPE enable masks stay in sync with the reference count.
|
||||
3) Do not inadvertently enable GPEs when writing GPE registers.
|
||||
4) Remove the internal wake reference counter and add new AcpiGpeWakeup
|
||||
interface. This interface will set or clear individual GPEs for wakeup.
|
||||
5) Remove GpeType argument from AcpiEnable and AcpiDisable. These interfaces
|
||||
are now used for "runtime" GPEs only.
|
||||
|
||||
Changed the behavior of the GPE install/remove handler interfaces. The GPE is
|
||||
no longer disabled during this process, as it was found to cause problems on
|
||||
some machines. Rafael J. Wysocki.
|
||||
|
||||
Reverted a change introduced in version 20100528 to enable Embedded
|
||||
Controller multi-byte transfers. This change was found to cause problems with
|
||||
Index Fields and possibly Bank Fields. It will be reintroduced when these
|
||||
problems have been resolved.
|
||||
|
||||
Fixed a problem with references to Alias objects within Package Objects. A
|
||||
reference to an Alias within the definition of a Package was not always
|
||||
resolved properly. Aliases to objects like Processors, Thermal zones, etc.
|
||||
were resolved to the actual object instead of a reference to the object as it
|
||||
should be. Package objects are only allowed to contain integer, string,
|
||||
buffer, package, and reference objects. Redhat bugzilla 608648.
|
||||
|
||||
Example Code and Data Size: These are the sizes for the OS-independent
|
||||
acpica.lib produced by the Microsoft Visual C++ 6.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.
|
||||
|
||||
Previous Release:
|
||||
Non-Debug Version: 88.3K Code, 18.8K Data, 107.1K Total
|
||||
Debug Version: 164.1K Code, 51.5K Data, 215.6K Total
|
||||
Current Release:
|
||||
Non-Debug Version: 88.3K Code, 18.8K Data, 107.1K Total
|
||||
Debug Version: 164.0K Code, 51.5K Data, 215.5K Total
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
iASL: Implemented a new compiler subsystem to allow definition and
|
||||
compilation of the non-AML ACPI tables such as FADT, MADT, SRAT, etc. These
|
||||
are called "ACPI Data Tables", and the new compiler is the "Data Table
|
||||
Compiler". This compiler is intended to simplify the existing error-prone
|
||||
process of creating these tables for the BIOS, as well as allowing the
|
||||
disassembly, modification, recompilation, and override of existing ACPI data
|
||||
tables. See the iASL User Guide for detailed information.
|
||||
|
||||
iASL: Implemented a new Template Generator option in support of the new Data
|
||||
Table Compiler. This option will create examples of all known ACPI tables
|
||||
that can be used as the basis for table development. See the iASL
|
||||
documentation and the -T option.
|
||||
|
||||
Disassembler and headers: Added support for the WDDT ACPI table (Watchdog
|
||||
Descriptor Table).
|
||||
|
||||
Updated the Linux makefiles for iASL and AcpiExec to place the generated
|
||||
object files in the local directory so that there can be no collisions
|
||||
between the shared files between them that are generated with different
|
||||
options.
|
||||
|
||||
Added support for Mac OS X in the Unix OSL used for iASL and AcpiExec. Use
|
||||
the #define __APPLE__ to enable this support.
|
||||
|
||||
----------------------------------------
|
||||
28 May 2010. Summary of changes for version 20100528:
|
||||
|
||||
This release is available at www.acpica.org/downloads
|
||||
|
||||
Note: The ACPI 4.0a specification was released on April 5, 2010 and is
|
||||
available at www.acpi.info. This is primarily an errata release.
|
||||
|
||||
1) ACPI CA Core Subsystem:
|
||||
|
||||
Undefined ACPI tables: We are looking for the definitions for the following
|
||||
ACPI tables that have been seen in the field: ATKG, IEIT, GSCI.
|
||||
|
||||
Implemented support to enable multi-byte transfers for Embedded Controller
|
||||
(EC) operation regions. Previously, the maximum data size passed to the EC
|
||||
operation region handler was a single byte. There are often EC Fields larger
|
||||
than one byte that need to be transferred, and it is useful for the EC driver
|
||||
to lock these as a single transaction. This change enables single transfers
|
||||
larger than 8 bits. This effectively changes the access to the EC space from
|
||||
ByteAcc to AnyAcc, and will probably require changes to the host OS Embedded
|
||||
Controller driver to enable 16/32/64/256-bit transfers in addition to 8-bit
|
||||
transfers. Alexey Starikovskiy, Lin Ming
|
||||
|
||||
Implemented a performance enhancement for namespace search and access. This
|
||||
change enhances the performance of namespace searches and walks by adding a
|
||||
backpointer to the parent in each namespace node. On large namespaces, this
|
||||
change can improve overall ACPI performance by up to 9X. Adding a pointer to
|
||||
each namespace node increases the overall size of the internal namespace by
|
||||
about 5%, since each namespace entry usually consists of both a namespace
|
||||
node and an ACPI operand object. However, this is the first growth of the
|
||||
namespace in ten years. ACPICA bugzilla 817. Alexey Starikovskiy.
|
||||
|
||||
Implemented a performance optimization that reduces the number of namespace
|
||||
walks. On control method exit, only walk the namespace if the method is known
|
||||
to have created namespace objects outside of its local scope. Previously, the
|
||||
entire namespace was traversed on each control method exit. This change can
|
||||
improve overall ACPI performance by up to 3X. Alexey Starikovskiy, Bob Moore.
|
||||
|
||||
Added support to truncate I/O addresses to 16 bits for Windows compatibility.
|
||||
Some ASL code has been seen in the field that inadvertently has bits set
|
||||
above bit 15. This feature is optional and is enabled if the BIOS requests
|
||||
any Windows OSI strings. It can also be enabled by the host OS. Matthew
|
||||
Garrett, Bob Moore.
|
||||
|
||||
Added support to limit the maximum time for the ASL Sleep() operator. To
|
||||
prevent accidental deep sleeps, limit the maximum time that Sleep() will
|
||||
actually sleep. Configurable, the default maximum is two seconds. ACPICA
|
||||
bugzilla 854.
|
||||
|
||||
Added run-time validation support for the _WDG and_WED Microsoft predefined
|
||||
methods. These objects are defined by "Windows Instrumentation", and are not
|
||||
part of the ACPI spec. ACPICA BZ 860.
|
||||
|
||||
Expanded all statistic counters used during namespace and device
|
||||
initialization from 16 to 32 bits in order to support very large namespaces.
|
||||
|
||||
Replaced all instances of %d in printf format specifiers with %u since nearly
|
||||
all integers in ACPICA are unsigned.
|
||||
|
||||
Fixed the exception namestring for AE_WAKE_ONLY_GPE. Was incorrectly returned
|
||||
as AE_NO_HANDLER.
|
||||
|
||||
Example Code and Data Size: These are the sizes for the OS-independent
|
||||
acpica.lib produced by the Microsoft Visual C++ 6.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.
|
||||
|
||||
Previous Release:
|
||||
Non-Debug Version: 88.4K Code, 18.8K Data, 107.2K Total
|
||||
Debug Version: 164.2K Code, 51.5K Data, 215.7K Total
|
||||
Current Release:
|
||||
Non-Debug Version: 88.3K Code, 18.8K Data, 107.1K Total
|
||||
Debug Version: 164.1K Code, 51.5K Data, 215.6K Total
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
iASL: Added compiler support for the _WDG and_WED Microsoft predefined
|
||||
methods. These objects are defined by "Windows Instrumentation", and are not
|
||||
part of the ACPI spec. ACPICA BZ 860.
|
||||
|
||||
AcpiExec: added option to disable the memory tracking mechanism. The -dt
|
||||
option will disable the tracking mechanism, which improves performance
|
||||
considerably.
|
||||
|
||||
AcpiExec: Restructured the command line options into -d (disable) and -e
|
||||
(enable) options.
|
||||
|
||||
----------------------------------------
|
||||
28 April 2010. Summary of changes for version 20100428:
|
||||
|
||||
|
@ -153,10 +153,6 @@ AdCreateTableHeader (
|
||||
char *Filename,
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AdDisassemblerHeader (
|
||||
char *Filename);
|
||||
|
||||
ACPI_STATUS
|
||||
AdDeferredParse (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
@ -502,7 +498,7 @@ AdAmlDisassemble (
|
||||
if (AcpiDmGetExternalMethodCount ())
|
||||
{
|
||||
fprintf (stderr,
|
||||
"\nFound %d external control methods, reparsing with new information\n",
|
||||
"\nFound %u external control methods, reparsing with new information\n",
|
||||
AcpiDmGetExternalMethodCount ());
|
||||
|
||||
/*
|
||||
@ -515,10 +511,11 @@ AdAmlDisassemble (
|
||||
AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
|
||||
AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
|
||||
AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE;
|
||||
AcpiGbl_RootNodeStruct.Parent = NULL;
|
||||
AcpiGbl_RootNodeStruct.Child = NULL;
|
||||
AcpiGbl_RootNodeStruct.Peer = NULL;
|
||||
AcpiGbl_RootNodeStruct.Object = NULL;
|
||||
AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST;
|
||||
AcpiGbl_RootNodeStruct.Flags = 0;
|
||||
|
||||
Status = AcpiNsRootInitialize ();
|
||||
AcpiDmAddExternalsToNamespace ();
|
||||
@ -643,7 +640,7 @@ AdCreateTableHeader (
|
||||
*/
|
||||
AdDisassemblerHeader (Filename);
|
||||
|
||||
AcpiOsPrintf (" *\n * Original Table Header:\n");
|
||||
AcpiOsPrintf (" * Original Table Header:\n");
|
||||
AcpiOsPrintf (" * Signature \"%4.4s\"\n", Table->Signature);
|
||||
AcpiOsPrintf (" * Length 0x%8.8X (%u)\n", Table->Length, Table->Length);
|
||||
|
||||
@ -688,7 +685,7 @@ AdCreateTableHeader (
|
||||
AcpiOsPrintf (" * OEM Revision 0x%8.8X (%u)\n", Table->OemRevision, Table->OemRevision);
|
||||
AcpiOsPrintf (" * Compiler ID \"%.4s\"\n", Table->AslCompilerId);
|
||||
AcpiOsPrintf (" * Compiler Version 0x%8.8X (%u)\n", Table->AslCompilerRevision, Table->AslCompilerRevision);
|
||||
AcpiOsPrintf (" */\n");
|
||||
AcpiOsPrintf (" */\n\n");
|
||||
|
||||
/* Create AML output filename based on input filename */
|
||||
|
||||
@ -706,7 +703,7 @@ AdCreateTableHeader (
|
||||
/* Open the ASL definition block */
|
||||
|
||||
AcpiOsPrintf (
|
||||
"DefinitionBlock (\"%s\", \"%4.4s\", %hd, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
|
||||
"DefinitionBlock (\"%s\", \"%4.4s\", %hu, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
|
||||
NewFilename, Table->Signature, Table->Revision,
|
||||
Table->OemId, Table->OemTableId, Table->OemRevision);
|
||||
|
||||
@ -1018,7 +1015,7 @@ AdGetLocalTables (
|
||||
* is architecture-dependent.
|
||||
*/
|
||||
NumTables = (NewTable->Length - sizeof (ACPI_TABLE_HEADER)) / PointerSize;
|
||||
AcpiOsPrintf ("There are %d tables defined in the %4.4s\n\n",
|
||||
AcpiOsPrintf ("There are %u tables defined in the %4.4s\n\n",
|
||||
NumTables, NewTable->Signature);
|
||||
|
||||
/* Get the FADT */
|
||||
|
@ -537,7 +537,7 @@ AcpiDmFindOrphanDescending (
|
||||
}
|
||||
|
||||
ArgCount = AcpiDmInspectPossibleArgs (3, 1, NextOp);
|
||||
AcpiOsPrintf ("/* A-CHILDREN: %d Actual %d */\n", ArgCount, AcpiDmCountChildren (Op));
|
||||
AcpiOsPrintf ("/* A-CHILDREN: %u Actual %u */\n", ArgCount, AcpiDmCountChildren (Op));
|
||||
|
||||
if (ArgCount < 1)
|
||||
{
|
||||
|
@ -252,7 +252,7 @@ AcpiDmNormalizeParentPrefix (
|
||||
Node = Op->Common.Node;
|
||||
while (Node && (*Path == (UINT8) AML_PARENT_PREFIX))
|
||||
{
|
||||
Node = AcpiNsGetParentNode (Node);
|
||||
Node = Node->Parent;
|
||||
Path++;
|
||||
}
|
||||
|
||||
@ -629,7 +629,7 @@ AcpiDmEmitExternals (
|
||||
|
||||
if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
AcpiOsPrintf (") // %d Arguments\n",
|
||||
AcpiOsPrintf (") // %u Arguments\n",
|
||||
AcpiGbl_ExternalList->Value);
|
||||
}
|
||||
else
|
||||
|
@ -549,13 +549,6 @@ AcpiDmGetResourceNode (
|
||||
return (Node);
|
||||
}
|
||||
|
||||
/* List is circular, this flag marks the end */
|
||||
|
||||
if (Node->Flags & ANOBJ_END_OF_PEER_LIST)
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
Node = Node->Peer;
|
||||
}
|
||||
|
||||
|
@ -117,6 +117,8 @@
|
||||
#include <contrib/dev/acpica/include/accommon.h>
|
||||
#include <contrib/dev/acpica/include/acdisasm.h>
|
||||
#include <contrib/dev/acpica/include/actables.h>
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include <contrib/dev/acpica/compiler/dtcompiler.h>
|
||||
|
||||
/* This module used for application-level code only */
|
||||
|
||||
@ -125,20 +127,12 @@
|
||||
|
||||
/* Local Prototypes */
|
||||
|
||||
static ACPI_DMTABLE_DATA *
|
||||
AcpiDmGetTableData (
|
||||
char *Signature);
|
||||
|
||||
static void
|
||||
AcpiDmCheckAscii (
|
||||
UINT8 *Target,
|
||||
char *RepairedName,
|
||||
UINT32 Count);
|
||||
|
||||
UINT8
|
||||
AcpiTbGenerateChecksum (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
|
||||
/* These tables map a subtable type to a description string */
|
||||
|
||||
@ -161,6 +155,74 @@ static const char *AcpiDmDmarSubnames[] =
|
||||
"Unknown SubTable Type" /* Reserved */
|
||||
};
|
||||
|
||||
static const char *AcpiDmEinjActions[] =
|
||||
{
|
||||
"Begin Operation",
|
||||
"Get Trigger Table",
|
||||
"Set Error Type",
|
||||
"Get Error Type",
|
||||
"End Operation",
|
||||
"Execute Operation",
|
||||
"Check Busy Status",
|
||||
"Get Command Status",
|
||||
"Unknown Action"
|
||||
};
|
||||
|
||||
static const char *AcpiDmEinjInstructions[] =
|
||||
{
|
||||
"Read Register",
|
||||
"Read Register Value",
|
||||
"Write Register",
|
||||
"Write Register Value",
|
||||
"Noop",
|
||||
"Unknown Instruction"
|
||||
};
|
||||
|
||||
static const char *AcpiDmErstActions[] =
|
||||
{
|
||||
"Begin Write Operation",
|
||||
"Begin Read Operation",
|
||||
"Begin Clear Operation",
|
||||
"End Operation",
|
||||
"Set Record Offset",
|
||||
"Execute Operation",
|
||||
"Check Busy Status",
|
||||
"Get Command Status",
|
||||
"Get Record Identifier",
|
||||
"Set Record Identifier",
|
||||
"Get Record Count",
|
||||
"Begin Dummy Write",
|
||||
"Unused/Unknown Action",
|
||||
"Get Error Address Range",
|
||||
"Get Error Address Length",
|
||||
"Get Error Attributes",
|
||||
"Unknown Action"
|
||||
};
|
||||
|
||||
static const char *AcpiDmErstInstructions[] =
|
||||
{
|
||||
"Read Register",
|
||||
"Read Register Value",
|
||||
"Write Register",
|
||||
"Write Register Value",
|
||||
"Noop",
|
||||
"Load Var1",
|
||||
"Load Var2",
|
||||
"Store Var1",
|
||||
"Add",
|
||||
"Subtract",
|
||||
"Add Value",
|
||||
"Subtract Value",
|
||||
"Stall",
|
||||
"Stall While True",
|
||||
"Skip Next If True",
|
||||
"GoTo",
|
||||
"Set Source Address",
|
||||
"Set Destination Address",
|
||||
"Move Data",
|
||||
"Unknown Instruction"
|
||||
};
|
||||
|
||||
static const char *AcpiDmHestSubnames[] =
|
||||
{
|
||||
"IA-32 Machine Check Exception",
|
||||
@ -237,56 +299,59 @@ static const char *AcpiDmFadtProfiles[] =
|
||||
*
|
||||
* ACPI Table Data, indexed by signature.
|
||||
*
|
||||
* Each entry contains: Signature, Table Info, Handler, Description
|
||||
* Each entry contains: Signature, Table Info, Handler, DtHandler,
|
||||
* Template, Description
|
||||
*
|
||||
* Simple tables have only a TableInfo structure, complex tables have a handler.
|
||||
* This table must be NULL terminated. RSDP and FACS are special-cased
|
||||
* elsewhere.
|
||||
* Simple tables have only a TableInfo structure, complex tables have a
|
||||
* handler. This table must be NULL terminated. RSDP and FACS are
|
||||
* special-cased elsewhere.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_DMTABLE_DATA AcpiDmTableData[] =
|
||||
ACPI_DMTABLE_DATA AcpiDmTableData[] =
|
||||
{
|
||||
{ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, "Alert Standard Format table"},
|
||||
{ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, "Simple Boot Flag Table"},
|
||||
{ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, "Boot Error Record Table"},
|
||||
{ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, "Corrected Platform Error Polling table"},
|
||||
{ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, "Debug Port table"},
|
||||
{ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, "DMA Remapping table"},
|
||||
{ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, "Embedded Controller Boot Resources Table"},
|
||||
{ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, "Error Injection table"},
|
||||
{ACPI_SIG_ERST, NULL, AcpiDmDumpErst, "Error Record Serialization Table"},
|
||||
{ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, "Fixed ACPI Description Table"},
|
||||
{ACPI_SIG_HEST, NULL, AcpiDmDumpHest, "Hardware Error Source Table"},
|
||||
{ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, "High Precision Event Timer table"},
|
||||
{ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, "I/O Virtualization Reporting Structure"},
|
||||
{ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, "Multiple APIC Description Table"},
|
||||
{ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, "Memory Mapped Configuration table"},
|
||||
{ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, "Management Controller Host Interface table"},
|
||||
{ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, "Maximum System Characteristics Table"},
|
||||
{ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, "Root System Description Table"},
|
||||
{ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, "Smart Battery Specification Table"},
|
||||
{ACPI_SIG_SLIC, AcpiDmTableInfoSlic, NULL, "Software Licensing Description Table"},
|
||||
{ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, "System Locality Information Table"},
|
||||
{ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, "Serial Port Console Redirection table"},
|
||||
{ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, "Server Platform Management Interface table"},
|
||||
{ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, "System Resource Affinity Table"},
|
||||
{ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, "Trusted Computing Platform Alliance table"},
|
||||
{ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, "UEFI Boot Optimization Table"},
|
||||
{ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, "Windows ACPI Emulated Devices Table"},
|
||||
{ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, "Watchdog Action Table"},
|
||||
{ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, "Watchdog Resource Table"},
|
||||
{ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, "Extended System Description Table"},
|
||||
{NULL, NULL, NULL, NULL}
|
||||
{ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, TemplateAsf, "Alert Standard Format table"},
|
||||
{ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot, "Simple Boot Flag Table"},
|
||||
{ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert, "Boot Error Record Table"},
|
||||
{ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep, "Corrected Platform Error Polling table"},
|
||||
{ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp, "Debug Port table"},
|
||||
{ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar, "DMA Remapping table"},
|
||||
{ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, TemplateEcdt, "Embedded Controller Boot Resources Table"},
|
||||
{ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, TemplateEinj, "Error Injection table"},
|
||||
{ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst, "Error Record Serialization Table"},
|
||||
{ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt, "Fixed ACPI Description Table"},
|
||||
{ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest, "Hardware Error Source Table"},
|
||||
{ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet, "High Precision Event Timer table"},
|
||||
{ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs, "I/O Virtualization Reporting Structure"},
|
||||
{ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt, "Multiple APIC Description Table"},
|
||||
{ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg, "Memory Mapped Configuration table"},
|
||||
{ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi, "Management Controller Host Interface table"},
|
||||
{ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct, "Maximum System Characteristics Table"},
|
||||
{ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt, "Root System Description Table"},
|
||||
{ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst, "Smart Battery Specification Table"},
|
||||
{ACPI_SIG_SLIC, AcpiDmTableInfoSlic, NULL, NULL, NULL, "Software Licensing Description Table"},
|
||||
{ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit, "System Locality Information Table"},
|
||||
{ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr, "Serial Port Console Redirection table"},
|
||||
{ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, TemplateSpmi, "Server Platform Management Interface table"},
|
||||
{ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat, "System Resource Affinity Table"},
|
||||
{ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, NULL, TemplateTcpa, "Trusted Computing Platform Alliance table"},
|
||||
{ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, NULL, TemplateUefi, "UEFI Boot Optimization Table"},
|
||||
{ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, TemplateWaet, "Windows ACPI Emulated Devices Table"},
|
||||
{ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, DtCompileWdat, TemplateWdat, "Watchdog Action Table"},
|
||||
{ACPI_SIG_WDDT, AcpiDmTableInfoWddt, NULL, NULL, TemplateWddt, "Watchdog Description Table"},
|
||||
{ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, NULL, TemplateWdrt, "Watchdog Resource Table"},
|
||||
{ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, DtCompileXsdt, TemplateXsdt, "Extended System Description Table"},
|
||||
{NULL, NULL, NULL, NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiTbGenerateChecksum
|
||||
* FUNCTION: AcpiDmGenerateChecksum
|
||||
*
|
||||
* PARAMETERS: Table - Pointer to a valid ACPI table (with a
|
||||
* standard ACPI header)
|
||||
* PARAMETERS: Table - Pointer to table to be checksummed
|
||||
* Length - Length of the table
|
||||
* OriginalChecksum - Value of the checksum field
|
||||
*
|
||||
* RETURN: 8 bit checksum of buffer
|
||||
*
|
||||
@ -295,19 +360,21 @@ static ACPI_DMTABLE_DATA AcpiDmTableData[] =
|
||||
******************************************************************************/
|
||||
|
||||
UINT8
|
||||
AcpiTbGenerateChecksum (
|
||||
ACPI_TABLE_HEADER *Table)
|
||||
AcpiDmGenerateChecksum (
|
||||
void *Table,
|
||||
UINT32 Length,
|
||||
UINT8 OriginalChecksum)
|
||||
{
|
||||
UINT8 Checksum;
|
||||
|
||||
|
||||
/* Sum the entire table as-is */
|
||||
|
||||
Checksum = AcpiTbChecksum ((UINT8 *) Table, Table->Length);
|
||||
Checksum = AcpiTbChecksum ((UINT8 *) Table, Length);
|
||||
|
||||
/* Subtract off the existing checksum value in the table */
|
||||
|
||||
Checksum = (UINT8) (Checksum - Table->Checksum);
|
||||
Checksum = (UINT8) (Checksum - OriginalChecksum);
|
||||
|
||||
/* Compute the final checksum */
|
||||
|
||||
@ -328,7 +395,7 @@ AcpiTbGenerateChecksum (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_DMTABLE_DATA *
|
||||
ACPI_DMTABLE_DATA *
|
||||
AcpiDmGetTableData (
|
||||
char *Signature)
|
||||
{
|
||||
@ -432,10 +499,13 @@ AcpiDmDumpDataTable (
|
||||
}
|
||||
}
|
||||
|
||||
/* Always dump the raw table data */
|
||||
if (!Gbl_DoTemplates || Gbl_VerboseTemplates)
|
||||
{
|
||||
/* Dump the raw table data */
|
||||
|
||||
AcpiOsPrintf ("\nRaw Table Data\n\n");
|
||||
AcpiUtDumpBuffer2 (ACPI_CAST_PTR (UINT8, Table), Length, DB_BYTE_DISPLAY);
|
||||
AcpiOsPrintf ("\nRaw Table Data\n\n");
|
||||
AcpiUtDumpBuffer2 (ACPI_CAST_PTR (UINT8, Table), Length, DB_BYTE_DISPLAY);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -463,15 +533,31 @@ AcpiDmLineHeader (
|
||||
char *Name)
|
||||
{
|
||||
|
||||
if (ByteLength)
|
||||
if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */
|
||||
{
|
||||
AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %28s : ",
|
||||
Offset, Offset, ByteLength, Name);
|
||||
if (ByteLength)
|
||||
{
|
||||
AcpiOsPrintf ("[%.3d] %34s : ",
|
||||
ByteLength, Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("%40s : ",
|
||||
Name);
|
||||
}
|
||||
}
|
||||
else
|
||||
else /* Normal disassembler or verbose template */
|
||||
{
|
||||
AcpiOsPrintf ("%43s : ",
|
||||
Name);
|
||||
if (ByteLength)
|
||||
{
|
||||
AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %28s : ",
|
||||
Offset, Offset, ByteLength, Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("%43s : ",
|
||||
Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -483,15 +569,31 @@ AcpiDmLineHeader2 (
|
||||
UINT32 Value)
|
||||
{
|
||||
|
||||
if (ByteLength)
|
||||
if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */
|
||||
{
|
||||
AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %24s % 3d : ",
|
||||
Offset, Offset, ByteLength, Name, Value);
|
||||
if (ByteLength)
|
||||
{
|
||||
AcpiOsPrintf ("[%.3d] %30s % 3d : ",
|
||||
ByteLength, Name, Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("%36s % 3d : ",
|
||||
Name, Value);
|
||||
}
|
||||
}
|
||||
else
|
||||
else /* Normal disassembler or verbose template */
|
||||
{
|
||||
AcpiOsPrintf ("[%3.3Xh %4.4d ] %24s % 3d : ",
|
||||
Offset, Offset, Name, Value);
|
||||
if (ByteLength)
|
||||
{
|
||||
AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %24s % 3d : ",
|
||||
Offset, Offset, ByteLength, Name, Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("[%3.3Xh %4.4d ] %24s % 3d : ",
|
||||
Offset, Offset, Name, Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -511,6 +613,8 @@ AcpiDmLineHeader2 (
|
||||
*
|
||||
* DESCRIPTION: Display ACPI table contents by walking the Info table.
|
||||
*
|
||||
* Note: This function must remain in sync with DtGetFieldLength.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
@ -571,6 +675,10 @@ AcpiDmDumpTable (
|
||||
case ACPI_DMT_ASF:
|
||||
case ACPI_DMT_HESTNTYP:
|
||||
case ACPI_DMT_FADTPM:
|
||||
case ACPI_DMT_EINJACT:
|
||||
case ACPI_DMT_EINJINST:
|
||||
case ACPI_DMT_ERSTACT:
|
||||
case ACPI_DMT_ERSTINST:
|
||||
ByteLength = 1;
|
||||
break;
|
||||
case ACPI_DMT_UINT16:
|
||||
@ -705,7 +813,11 @@ AcpiDmDumpTable (
|
||||
|
||||
for (Temp8 = 0; Temp8 < 16; Temp8++)
|
||||
{
|
||||
AcpiOsPrintf ("%2.2X,", Target[Temp8]);
|
||||
AcpiOsPrintf ("%2.2X", Target[Temp8]);
|
||||
if ((Temp8 + 1) < 16)
|
||||
{
|
||||
AcpiOsPrintf (",");
|
||||
}
|
||||
}
|
||||
AcpiOsPrintf ("\n");
|
||||
break;
|
||||
@ -754,7 +866,9 @@ AcpiDmDumpTable (
|
||||
/* Checksum, display and validate */
|
||||
|
||||
AcpiOsPrintf ("%2.2X", *Target);
|
||||
Temp8 = AcpiTbGenerateChecksum (Table);
|
||||
Temp8 = AcpiDmGenerateChecksum (Table,
|
||||
ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,
|
||||
ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum);
|
||||
if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum)
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
@ -807,6 +921,58 @@ AcpiDmDumpTable (
|
||||
AcpiOsPrintf ("%4.4X <%s>\n", ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_EINJACT:
|
||||
|
||||
/* EINJ Action types */
|
||||
|
||||
Temp8 = *Target;
|
||||
if (Temp8 > ACPI_EINJ_ACTION_RESERVED)
|
||||
{
|
||||
Temp8 = ACPI_EINJ_ACTION_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmEinjActions[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_EINJINST:
|
||||
|
||||
/* EINJ Instruction types */
|
||||
|
||||
Temp8 = *Target;
|
||||
if (Temp8 > ACPI_EINJ_INSTRUCTION_RESERVED)
|
||||
{
|
||||
Temp8 = ACPI_EINJ_INSTRUCTION_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmEinjInstructions[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_ERSTACT:
|
||||
|
||||
/* ERST Action types */
|
||||
|
||||
Temp8 = *Target;
|
||||
if (Temp8 > ACPI_ERST_ACTION_RESERVED)
|
||||
{
|
||||
Temp8 = ACPI_ERST_ACTION_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmErstActions[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_ERSTINST:
|
||||
|
||||
/* ERST Instruction types */
|
||||
|
||||
Temp8 = *Target;
|
||||
if (Temp8 > ACPI_ERST_INSTRUCTION_RESERVED)
|
||||
{
|
||||
Temp8 = ACPI_ERST_INSTRUCTION_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmErstInstructions[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_HEST:
|
||||
|
||||
/* HEST subtable types */
|
||||
@ -842,7 +1008,6 @@ AcpiDmDumpTable (
|
||||
AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmHestNotifySubnames[Temp8]);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_DMT_MADT:
|
||||
|
||||
/* MADT subtable types */
|
||||
|
@ -130,7 +130,8 @@
|
||||
*
|
||||
* PARAMETERS: Table - A RSDP
|
||||
*
|
||||
* RETURN: Length of the table (there is no length field, use revision)
|
||||
* RETURN: Length of the table (there is not always a length field,
|
||||
* use revision or length if available (ACPI 2.0+))
|
||||
*
|
||||
* DESCRIPTION: Format the contents of a RSDP
|
||||
*
|
||||
@ -140,19 +141,42 @@ UINT32
|
||||
AcpiDmDumpRsdp (
|
||||
ACPI_TABLE_HEADER *Table)
|
||||
{
|
||||
UINT32 Length = ACPI_RSDP_REV0_SIZE;
|
||||
ACPI_TABLE_RSDP *Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table);
|
||||
UINT32 Length = sizeof (ACPI_RSDP_COMMON);
|
||||
UINT8 Checksum;
|
||||
|
||||
|
||||
/* Dump the common ACPI 1.0 portion */
|
||||
|
||||
AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp1);
|
||||
|
||||
/* ACPI 2.0+ contains more data and has a Length field */
|
||||
/* Validate the first checksum */
|
||||
|
||||
if (ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table)->Revision > 0)
|
||||
Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_RSDP_COMMON),
|
||||
Rsdp->Checksum);
|
||||
if (Checksum != Rsdp->Checksum)
|
||||
{
|
||||
Length = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table)->Length;
|
||||
AcpiOsPrintf ("/* Incorrect Checksum above, should be 0x%2.2X */\n",
|
||||
Checksum);
|
||||
}
|
||||
|
||||
/* The RSDP for ACPI 2.0+ contains more data and has a Length field */
|
||||
|
||||
if (Rsdp->Revision > 0)
|
||||
{
|
||||
Length = Rsdp->Length;
|
||||
AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp2);
|
||||
|
||||
/* Validate the extended checksum over entire RSDP */
|
||||
|
||||
Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_TABLE_RSDP),
|
||||
Rsdp->ExtendedChecksum);
|
||||
if (Checksum != Rsdp->ExtendedChecksum)
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
"/* Incorrect Extended Checksum above, should be 0x%2.2X */\n",
|
||||
Checksum);
|
||||
}
|
||||
}
|
||||
|
||||
return (Length);
|
||||
@ -595,7 +619,7 @@ AcpiDmDumpDmar (
|
||||
while (PathOffset < ScopeTable->Length)
|
||||
{
|
||||
AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, "PCI Path");
|
||||
AcpiOsPrintf ("[%2.2X, %2.2X]\n", PciPath[0], PciPath[1]);
|
||||
AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath[0], PciPath[1]);
|
||||
|
||||
/* Point to next PCI Path entry */
|
||||
|
||||
@ -709,7 +733,7 @@ AcpiDmDumpErst (
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Length, Offset, SubTable,
|
||||
sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
|
||||
sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@ -1174,7 +1198,7 @@ AcpiDmDumpMcfg (
|
||||
{
|
||||
if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length)
|
||||
{
|
||||
AcpiOsPrintf ("Warning: there are %d invalid trailing bytes\n",
|
||||
AcpiOsPrintf ("Warning: there are %u invalid trailing bytes\n",
|
||||
sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length));
|
||||
return;
|
||||
}
|
||||
@ -1301,15 +1325,20 @@ AcpiDmDumpSlit (
|
||||
return;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%2.2X ", Row[j]);
|
||||
AcpiOsPrintf ("%2.2X", Row[j]);
|
||||
Offset++;
|
||||
|
||||
/* Display up to 16 bytes per output row */
|
||||
|
||||
if (j && (((j+1) % 16) == 0) && ((j+1) < Localities))
|
||||
if ((j+1) < Localities)
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
AcpiDmLineHeader (Offset, 0, "");
|
||||
AcpiOsPrintf (",");
|
||||
|
||||
if (j && (((j+1) % 16) == 0))
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
AcpiDmLineHeader (Offset, 0, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -531,7 +531,7 @@ AnGetBtype (
|
||||
if (!Node)
|
||||
{
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"No attached Nsnode: [%s] at line %d name [%s], ignoring typecheck\n",
|
||||
"No attached Nsnode: [%s] at line %u name [%s], ignoring typecheck\n",
|
||||
Op->Asl.ParseOpName, Op->Asl.LineNumber,
|
||||
Op->Asl.ExternalName);
|
||||
return ACPI_UINT32_MAX;
|
||||
|
@ -127,10 +127,6 @@ static void
|
||||
CmFlushSourceCode (
|
||||
void);
|
||||
|
||||
static ACPI_STATUS
|
||||
FlCheckForAscii (
|
||||
ASL_FILE_INFO *FileInfo);
|
||||
|
||||
void
|
||||
FlConsumeAnsiComment (
|
||||
ASL_FILE_INFO *FileInfo,
|
||||
@ -433,7 +429,7 @@ FlConsumeNewComment (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
ACPI_STATUS
|
||||
FlCheckForAscii (
|
||||
ASL_FILE_INFO *FileInfo)
|
||||
{
|
||||
@ -543,31 +539,6 @@ CmDoCompile (
|
||||
|
||||
FullCompile = UtBeginEvent ("*** Total Compile time ***");
|
||||
Event = UtBeginEvent ("Open input and output files");
|
||||
|
||||
/* Open the required input and output files */
|
||||
|
||||
Status = FlOpenInputFile (Gbl_Files[ASL_FILE_INPUT].Filename);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AePrintErrorLog (ASL_FILE_STDERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Check for 100% ASCII source file (comments are ignored) */
|
||||
|
||||
Status = FlCheckForAscii (&Gbl_Files[ASL_FILE_INPUT]);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AePrintErrorLog (ASL_FILE_STDERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Status = FlOpenMiscOutputFiles (Gbl_OutputFilenamePrefix);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AePrintErrorLog (ASL_FILE_STDERR);
|
||||
return -1;
|
||||
}
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Build the parse tree */
|
||||
@ -888,19 +859,24 @@ CmCleanupAndExit (
|
||||
|
||||
if (Gbl_NsLookupCount)
|
||||
{
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\n\nMiscellaneous compile statistics\n\n");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "%32s : %d\n", "Total Namespace searches",
|
||||
Gbl_NsLookupCount);
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "%32s : %d usec\n", "Time per search",
|
||||
((UINT32) (AslGbl_Events[AslGbl_NamespaceEvent].EndTime -
|
||||
AslGbl_Events[AslGbl_NamespaceEvent].StartTime) /
|
||||
10) / Gbl_NsLookupCount);
|
||||
}
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"\n\nMiscellaneous compile statistics\n\n");
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"%32s : %u\n", "Total Namespace searches",
|
||||
Gbl_NsLookupCount);
|
||||
|
||||
DbgPrint (ASL_DEBUG_OUTPUT,
|
||||
"%32s : %u usec\n", "Time per search", ((UINT32)
|
||||
(AslGbl_Events[AslGbl_NamespaceEvent].EndTime -
|
||||
AslGbl_Events[AslGbl_NamespaceEvent].StartTime) / 10) /
|
||||
Gbl_NsLookupCount);
|
||||
}
|
||||
|
||||
if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT)
|
||||
{
|
||||
printf ("\nMaximum error count (%d) exceeded\n", ASL_MAX_ERROR_COUNT);
|
||||
printf ("\nMaximum error count (%u) exceeded\n",
|
||||
ASL_MAX_ERROR_COUNT);
|
||||
}
|
||||
|
||||
UtDisplaySummary (ASL_FILE_STDOUT);
|
||||
@ -914,22 +890,38 @@ CmCleanupAndExit (
|
||||
|
||||
/* Delete AML file if there are errors */
|
||||
|
||||
if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors))
|
||||
if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors) &&
|
||||
Gbl_Files[ASL_FILE_AML_OUTPUT].Handle)
|
||||
{
|
||||
remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename);
|
||||
if (remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename))
|
||||
{
|
||||
printf ("%s: ",
|
||||
Gbl_Files[ASL_FILE_AML_OUTPUT].Filename);
|
||||
perror ("Could not delete AML file");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete intermediate ("combined") source file (if -ls flag not set)
|
||||
* This file is created during normal ASL/AML compiles. It is not
|
||||
* created by the data table compiler.
|
||||
*
|
||||
* If the -ls flag is set, then the .SRC file should not be deleted.
|
||||
* In this case, Gbl_SourceOutputFlag is set to TRUE.
|
||||
*
|
||||
* Note: Handles are cleared by FlCloseFile above, so we look at the
|
||||
* filename instead, to determine if the .SRC file was actually
|
||||
* created.
|
||||
*
|
||||
* TBD: SourceOutput should be .TMP, then rename if we want to keep it?
|
||||
*/
|
||||
if (!Gbl_SourceOutputFlag)
|
||||
if (!Gbl_SourceOutputFlag && Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename)
|
||||
{
|
||||
if (remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename))
|
||||
{
|
||||
printf ("Could not remove SRC file, %s\n",
|
||||
printf ("%s: ",
|
||||
Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename);
|
||||
perror ("Could not delete SRC file");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -189,8 +189,12 @@ AslPushInputFileStack (
|
||||
char *Filename);
|
||||
|
||||
/*
|
||||
* aslstartup - called from main
|
||||
* aslstartup - entered from main()
|
||||
*/
|
||||
void
|
||||
AslInitializeGlobals (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AslDoOnePathname (
|
||||
char *Pathname);
|
||||
@ -222,6 +226,10 @@ void
|
||||
CmCleanupAndExit (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
FlCheckForAscii (
|
||||
ASL_FILE_INFO *FileInfo);
|
||||
|
||||
|
||||
/*
|
||||
* aslanalyze - semantic analysis
|
||||
@ -425,6 +433,16 @@ CgGenerateAmlOutput (
|
||||
void);
|
||||
|
||||
|
||||
/*
|
||||
* aslfile
|
||||
*/
|
||||
void
|
||||
FlOpenFile (
|
||||
UINT32 FileId,
|
||||
char *Filename,
|
||||
char *Mode);
|
||||
|
||||
|
||||
/*
|
||||
* asllength - calculate/adjust AML package lengths
|
||||
*/
|
||||
@ -679,6 +697,10 @@ DbgPrint (
|
||||
#define ASL_PARSE_OUTPUT 1
|
||||
#define ASL_TREE_OUTPUT 2
|
||||
|
||||
void
|
||||
UtDisplaySupportedTables (
|
||||
void);
|
||||
|
||||
void
|
||||
UtDisplayConstantOpcodes (
|
||||
void);
|
||||
@ -1003,5 +1025,16 @@ RsDoWordBusNumberDescriptor (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 CurrentByteOffset);
|
||||
|
||||
/*
|
||||
* Entry to data table compiler subsystem
|
||||
*/
|
||||
ACPI_STATUS
|
||||
DtDoCompile(
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCreateTemplates (
|
||||
char *Signature);
|
||||
|
||||
#endif /* __ASLCOMPILER_H */
|
||||
|
||||
|
@ -725,7 +725,7 @@ InsertLineBuffer (
|
||||
* Warning if we have split a long source line.
|
||||
* <Probably overkill>
|
||||
*/
|
||||
sprintf (MsgBuffer, "Max %d", ASL_LINE_BUFFER_SIZE);
|
||||
sprintf (MsgBuffer, "Max %u", ASL_LINE_BUFFER_SIZE);
|
||||
AslCommonError (ASL_WARNING, ASL_MSG_LONG_LINE,
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
|
||||
|
@ -3164,7 +3164,7 @@ AslLocalAllocate (unsigned int Size)
|
||||
void *Mem;
|
||||
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "\nAslLocalAllocate: Expanding Stack to %d\n\n", Size);
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "\nAslLocalAllocate: Expanding Stack to %u\n\n", Size);
|
||||
|
||||
Mem = ACPI_ALLOCATE_ZEROED (Size);
|
||||
if (!Mem)
|
||||
|
@ -182,6 +182,14 @@
|
||||
#define FILE_SUFFIX_DISASSEMBLY "dsl"
|
||||
#define FILE_SUFFIX_ASM_INCLUDE "inc"
|
||||
#define FILE_SUFFIX_C_INCLUDE "h"
|
||||
#define FILE_SUFFIX_ASL_CODE "asl"
|
||||
|
||||
|
||||
/* Types for input files */
|
||||
|
||||
#define ASL_INPUT_TYPE_BINARY 0
|
||||
#define ASL_INPUT_TYPE_ASCII_ASL 1
|
||||
#define ASL_INPUT_TYPE_ASCII_DATA 2
|
||||
|
||||
|
||||
/* Misc */
|
||||
|
@ -280,7 +280,14 @@ AePrintException (
|
||||
/* Get the file handles */
|
||||
|
||||
OutputFile = Gbl_Files[FileId].Handle;
|
||||
|
||||
/* Use the merged header/source file if present, otherwise use input file */
|
||||
|
||||
SourceFile = Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle;
|
||||
if (!SourceFile)
|
||||
{
|
||||
SourceFile = Gbl_Files[ASL_FILE_INPUT].Handle;
|
||||
}
|
||||
|
||||
if (Header)
|
||||
{
|
||||
@ -525,7 +532,7 @@ AslCommonError (
|
||||
Gbl_ExceptionCount[Level]++;
|
||||
if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT)
|
||||
{
|
||||
printf ("\nMaximum error count (%d) exceeded\n", ASL_MAX_ERROR_COUNT);
|
||||
printf ("\nMaximum error count (%u) exceeded\n", ASL_MAX_ERROR_COUNT);
|
||||
|
||||
Gbl_SourceLine = 0;
|
||||
Gbl_NextError = Gbl_ErrorLog;
|
||||
|
@ -122,12 +122,6 @@
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
FlOpenFile (
|
||||
UINT32 FileId,
|
||||
char *Filename,
|
||||
char *Mode);
|
||||
|
||||
FILE *
|
||||
FlOpenIncludeWithPrefix (
|
||||
char *PrefixDir,
|
||||
@ -212,7 +206,7 @@ FlFileError (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
void
|
||||
FlOpenFile (
|
||||
UINT32 FileId,
|
||||
char *Filename,
|
||||
@ -774,6 +768,55 @@ FlOpenMiscOutputFiles (
|
||||
char *Filename;
|
||||
|
||||
|
||||
/* Create/Open a hex output file if asked */
|
||||
|
||||
if (Gbl_HexOutputFlag)
|
||||
{
|
||||
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_HEX_DUMP);
|
||||
if (!Filename)
|
||||
{
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
|
||||
0, 0, 0, 0, NULL, NULL);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Open the hex file, text mode */
|
||||
|
||||
FlOpenFile (ASL_FILE_HEX_OUTPUT, Filename, "w+");
|
||||
|
||||
AslCompilerSignon (ASL_FILE_HEX_OUTPUT);
|
||||
AslCompilerFileHeader (ASL_FILE_HEX_OUTPUT);
|
||||
}
|
||||
|
||||
/* Create/Open a debug output file if asked */
|
||||
|
||||
if (Gbl_DebugFlag)
|
||||
{
|
||||
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_DEBUG);
|
||||
if (!Filename)
|
||||
{
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_DEBUG_FILENAME,
|
||||
0, 0, 0, 0, NULL, NULL);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Open the debug file as STDERR, text mode */
|
||||
|
||||
/* TBD: hide this behind a FlReopenFile function */
|
||||
|
||||
Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename;
|
||||
Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle =
|
||||
freopen (Filename, "w+t", stderr);
|
||||
|
||||
AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT);
|
||||
AslCompilerFileHeader (ASL_FILE_DEBUG_OUTPUT);
|
||||
}
|
||||
|
||||
if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA)
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* Create/Open a combined source output file */
|
||||
|
||||
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_SOURCE);
|
||||
@ -893,26 +936,6 @@ FlOpenMiscOutputFiles (
|
||||
AslCompilerFileHeader (ASL_FILE_C_INCLUDE_OUTPUT);
|
||||
}
|
||||
|
||||
/* Create/Open a hex output file if asked */
|
||||
|
||||
if (Gbl_HexOutputFlag)
|
||||
{
|
||||
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_HEX_DUMP);
|
||||
if (!Filename)
|
||||
{
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
|
||||
0, 0, 0, 0, NULL, NULL);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Open the hex file, text mode */
|
||||
|
||||
FlOpenFile (ASL_FILE_HEX_OUTPUT, Filename, "w+");
|
||||
|
||||
AslCompilerSignon (ASL_FILE_HEX_OUTPUT);
|
||||
AslCompilerFileHeader (ASL_FILE_HEX_OUTPUT);
|
||||
}
|
||||
|
||||
/* Create a namespace output file if asked */
|
||||
|
||||
if (Gbl_NsOutputFlag)
|
||||
@ -933,30 +956,6 @@ FlOpenMiscOutputFiles (
|
||||
AslCompilerFileHeader (ASL_FILE_NAMESPACE_OUTPUT);
|
||||
}
|
||||
|
||||
/* Create/Open a debug output file if asked */
|
||||
|
||||
if (Gbl_DebugFlag)
|
||||
{
|
||||
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_DEBUG);
|
||||
if (!Filename)
|
||||
{
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_DEBUG_FILENAME,
|
||||
0, 0, 0, 0, NULL, NULL);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Open the debug file as STDERR, text mode */
|
||||
|
||||
/* TBD: hide this behind a FlReopenFile function */
|
||||
|
||||
Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename;
|
||||
Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle =
|
||||
freopen (Filename, "w+t", stderr);
|
||||
|
||||
AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT);
|
||||
AslCompilerFileHeader (ASL_FILE_DEBUG_OUTPUT);
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ extern const ASL_MAPPING_ENTRY AslKeywordMapping[];
|
||||
extern char *AslCompilertext;
|
||||
extern char HexLookup[];
|
||||
|
||||
#define ASL_LINE_BUFFER_SIZE 512
|
||||
#define ASL_LINE_BUFFER_SIZE 1024
|
||||
#define ASL_MSG_BUFFER_SIZE 4096
|
||||
#define HEX_TABLE_LINE_SIZE 8
|
||||
#define HEX_LISTING_LINE_SIZE 8
|
||||
@ -196,6 +196,9 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ReferenceOptimizationFl
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayRemarks, TRUE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayOptimizations, FALSE);
|
||||
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_WarningLevel, ASL_WARNING);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseOriginalCompilerId, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseTemplates, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoTemplates, FALSE);
|
||||
|
||||
|
||||
#define HEX_OUTPUT_NONE 0
|
||||
@ -223,6 +226,7 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_HasIncludeFiles, FALSE)
|
||||
/* Statistics */
|
||||
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_InputByteCount, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_InputFieldCount, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_NsLookupCount, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalKeywords, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalNamedObjects, 0);
|
||||
@ -247,7 +251,9 @@ 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);
|
||||
ASL_EXTERN char *Gbl_TemplateSignature;
|
||||
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentHexColumn, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentAmlOffset, 0);
|
||||
|
@ -216,7 +216,7 @@ LsDoOneNamespaceObject (
|
||||
|
||||
Gbl_NumNamespaceObjects++;
|
||||
|
||||
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%5d [%d] %*s %4.4s - %s",
|
||||
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%5u [%u] %*s %4.4s - %s",
|
||||
Gbl_NumNamespaceObjects, Level, (Level * 3), " ",
|
||||
&Node->Name,
|
||||
AcpiUtGetTypeName (Node->Type));
|
||||
@ -1245,7 +1245,7 @@ LkNamespaceLocateBegin (
|
||||
*/
|
||||
if (PassedArgs != Node->Value)
|
||||
{
|
||||
sprintf (MsgBuffer, "%s requires %d", Op->Asl.ExternalName,
|
||||
sprintf (MsgBuffer, "%s requires %u", Op->Asl.ExternalName,
|
||||
Node->Value);
|
||||
|
||||
if (PassedArgs < Node->Value)
|
||||
|
@ -167,7 +167,7 @@ AslDoResponseFile (
|
||||
|
||||
|
||||
#define ASL_TOKEN_SEPARATORS " \t\n"
|
||||
#define ASL_SUPPORTED_OPTIONS "@:2b:c:d^e:fgh^i^I:l^no:p:r:s:t:v:w:x:"
|
||||
#define ASL_SUPPORTED_OPTIONS "@:2b:c:d^e:fgh^i^I:l^no:p:r:s:t:T:v:w:x:z"
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
@ -218,6 +218,10 @@ Options (
|
||||
printf (" -ln Create namespace file (*.nsp)\n");
|
||||
printf (" -ls Create combined source file (expanded includes) (*.src)\n");
|
||||
|
||||
printf ("\nACPI Data Tables:\n");
|
||||
printf (" -T <Sig> Create table template file for <Sig> (or \"ALL\")\n");
|
||||
printf (" -vt Create verbose templates (full disassembly)\n");
|
||||
|
||||
printf ("\nAML Disassembler:\n");
|
||||
printf (" -d [file] Disassemble or decode binary ACPI table to file (*.dsl)\n");
|
||||
printf (" -dc [file] Disassemble AML and immediately compile it\n");
|
||||
@ -230,6 +234,7 @@ Options (
|
||||
printf (" -h Additional help and compiler debug options\n");
|
||||
printf (" -hc Display operators allowed in constant expressions\n");
|
||||
printf (" -hr Display ACPI reserved method names\n");
|
||||
printf (" -ht Display currently supported ACPI table names\n");
|
||||
}
|
||||
|
||||
|
||||
@ -268,6 +273,7 @@ HelpMessage (
|
||||
printf (" -n Parse only, no output generation\n");
|
||||
printf (" -ot Display compile times\n");
|
||||
printf (" -x<level> Set debug level for trace output\n");
|
||||
printf (" -z Do not insert new compiler ID for DataTables\n");
|
||||
}
|
||||
|
||||
|
||||
@ -580,6 +586,10 @@ AslDoOptions (
|
||||
ApDisplayReservedNames ();
|
||||
exit (0);
|
||||
|
||||
case 't':
|
||||
UtDisplaySupportedTables ();
|
||||
exit (0);
|
||||
|
||||
default:
|
||||
printf ("Unknown option: -h%s\n", AcpiGbl_Optarg);
|
||||
return (-1);
|
||||
@ -767,6 +777,12 @@ AslDoOptions (
|
||||
break;
|
||||
|
||||
|
||||
case 'T':
|
||||
Gbl_DoTemplates = TRUE;
|
||||
Gbl_TemplateSignature = AcpiGbl_Optarg;
|
||||
break;
|
||||
|
||||
|
||||
case 'v':
|
||||
|
||||
switch (AcpiGbl_Optarg[0])
|
||||
@ -795,6 +811,10 @@ AslDoOptions (
|
||||
Gbl_DoSignon = FALSE;
|
||||
break;
|
||||
|
||||
case 't':
|
||||
Gbl_VerboseTemplates = TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
printf ("Unknown option: -v%s\n", AcpiGbl_Optarg);
|
||||
return (-1);
|
||||
@ -831,6 +851,12 @@ AslDoOptions (
|
||||
break;
|
||||
|
||||
|
||||
case 'z':
|
||||
|
||||
Gbl_UseOriginalCompilerId = TRUE;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
return (-1);
|
||||
@ -873,6 +899,12 @@ AslCommandLine (
|
||||
|
||||
BadCommandLine = AslDoOptions (argc, argv, FALSE);
|
||||
|
||||
if (Gbl_DoTemplates)
|
||||
{
|
||||
DtCreateTemplates (Gbl_TemplateSignature);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
/* Next parameter must be the input filename */
|
||||
|
||||
if (!argv[AcpiGbl_Optind] &&
|
||||
|
@ -339,7 +339,7 @@ OptBuildShortestPath (
|
||||
}
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, " COMMON: %d",
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, " COMMON: %u",
|
||||
NumCommonSegments));
|
||||
|
||||
/* There must be at least 1 common NameSeg in order to optimize */
|
||||
|
@ -251,7 +251,7 @@ ApCheckForPredefinedMethod (
|
||||
|
||||
if (MethodInfo->NumArguments != 0)
|
||||
{
|
||||
sprintf (MsgBuffer, "%s requires %d", Op->Asl.ExternalName, 0);
|
||||
sprintf (MsgBuffer, "%s requires %u", Op->Asl.ExternalName, 0);
|
||||
|
||||
AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op,
|
||||
MsgBuffer);
|
||||
@ -274,7 +274,7 @@ ApCheckForPredefinedMethod (
|
||||
if ((MethodInfo->NumArguments != RequiredArgsCurrent) &&
|
||||
(MethodInfo->NumArguments != RequiredArgsOld))
|
||||
{
|
||||
sprintf (MsgBuffer, "%4.4s requires %d",
|
||||
sprintf (MsgBuffer, "%4.4s requires %u",
|
||||
PredefinedNames[Index].Info.Name, RequiredArgsCurrent);
|
||||
|
||||
if (MethodInfo->NumArguments > RequiredArgsCurrent)
|
||||
@ -731,7 +731,7 @@ ApDisplayReservedNames (
|
||||
ThisName = PredefinedNames;
|
||||
while (ThisName->Info.Name[0])
|
||||
{
|
||||
printf ("%4.4s Requires %d arguments, ",
|
||||
printf ("%4.4s Requires %u arguments, ",
|
||||
ThisName->Info.Name, ThisName->Info.ParamCount & 0x0F);
|
||||
|
||||
if (ThisName->Info.ExpectedBtypes)
|
||||
|
@ -131,15 +131,15 @@ BOOLEAN AslToFile = TRUE;
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
AslInitializeGlobals (
|
||||
void);
|
||||
|
||||
static char **
|
||||
AsDoWildcard (
|
||||
char *DirectoryPathname,
|
||||
char *FileSpecifier);
|
||||
|
||||
UINT8
|
||||
AslDetectSourceFileType (
|
||||
ASL_FILE_INFO *Info);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -154,7 +154,7 @@ AsDoWildcard (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
void
|
||||
AslInitializeGlobals (
|
||||
void)
|
||||
{
|
||||
@ -167,10 +167,13 @@ AslInitializeGlobals (
|
||||
Gbl_CurrentLineNumber = 1;
|
||||
Gbl_LogicalLineNumber = 1;
|
||||
Gbl_CurrentLineOffset = 0;
|
||||
Gbl_InputFieldCount = 0;
|
||||
Gbl_LineBufPtr = Gbl_CurrentLineBuffer;
|
||||
|
||||
Gbl_ErrorLog = NULL;
|
||||
Gbl_NextError = NULL;
|
||||
Gbl_Signature = NULL;
|
||||
Gbl_FileType = 0;
|
||||
|
||||
AslGbl_NextEvent = 0;
|
||||
for (i = 0; i < ASL_NUM_REPORT_LEVELS; i++)
|
||||
@ -179,6 +182,10 @@ AslInitializeGlobals (
|
||||
}
|
||||
|
||||
Gbl_Files[ASL_FILE_AML_OUTPUT].Filename = NULL;
|
||||
Gbl_Files[ASL_FILE_AML_OUTPUT].Handle = NULL;
|
||||
|
||||
Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename = NULL;
|
||||
Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle = NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -257,6 +264,77 @@ AsDoWildcard (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslDetectSourceFileType
|
||||
*
|
||||
* PARAMETERS: Info - Name/Handle for the file (must be open)
|
||||
*
|
||||
* RETURN: File Type
|
||||
*
|
||||
* DESCRIPTION: Determine the type of the input file. Either binary (contains
|
||||
* non-ASCII characters), ASL file, or an ACPI Data Table file.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
UINT8
|
||||
AslDetectSourceFileType (
|
||||
ASL_FILE_INFO *Info)
|
||||
{
|
||||
char *FileChar;
|
||||
UINT8 Type;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
/* Check for 100% ASCII source file (comments are ignored) */
|
||||
|
||||
Status = FlCheckForAscii (Info);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
printf ("Non-ascii input file - %s\n", Info->Filename);
|
||||
Type = ASL_INPUT_TYPE_BINARY;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/*
|
||||
* File is ASCII. Determine if this is an ASL file or an ACPI data
|
||||
* table file.
|
||||
*/
|
||||
while (fgets (Gbl_CurrentLineBuffer, ASL_LINE_BUFFER_SIZE, Info->Handle))
|
||||
{
|
||||
/* Uppercase the buffer for caseless compare */
|
||||
|
||||
FileChar = Gbl_CurrentLineBuffer;
|
||||
while (*FileChar)
|
||||
{
|
||||
*FileChar = (char) toupper ((int) *FileChar);
|
||||
FileChar++;
|
||||
}
|
||||
|
||||
/* Presence of "DefinitionBlock" indicates actual ASL code */
|
||||
|
||||
if (strstr (Gbl_CurrentLineBuffer, "DEFINITIONBLOCK"))
|
||||
{
|
||||
/* Appears to be an ASL file */
|
||||
|
||||
Type = ASL_INPUT_TYPE_ASCII_ASL;
|
||||
goto Cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
/* Not an ASL source file, default to a data table source file */
|
||||
|
||||
Type = ASL_INPUT_TYPE_ASCII_DATA;
|
||||
|
||||
Cleanup:
|
||||
|
||||
/* Must seek back to the start of the file */
|
||||
|
||||
fseek (Info->Handle, 0, SEEK_SET);
|
||||
return (Type);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslDoOneFile
|
||||
@ -287,7 +365,7 @@ AslDoOneFile (
|
||||
*/
|
||||
if (Gbl_DisasmFlag || Gbl_GetAllTables)
|
||||
{
|
||||
/* ACPI CA subsystem initialization */
|
||||
/* ACPICA subsystem initialization */
|
||||
|
||||
Status = AdInitialize ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
@ -330,23 +408,77 @@ AslDoOneFile (
|
||||
AcpiOsPrintf ("\nCompiling \"%s\"\n",
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename = NULL;
|
||||
return (AE_OK);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Open the input file. Here, this should be an ASCII source file,
|
||||
* either an ASL file or a Data Table file
|
||||
*/
|
||||
Status = FlOpenInputFile (Gbl_Files[ASL_FILE_INPUT].Filename);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AePrintErrorLog (ASL_FILE_STDERR);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Determine input file type */
|
||||
|
||||
Gbl_FileType = AslDetectSourceFileType (&Gbl_Files[ASL_FILE_INPUT]);
|
||||
if (Gbl_FileType == ASL_INPUT_TYPE_BINARY)
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* If -p not specified, we will use the input filename as the
|
||||
* output filename prefix
|
||||
*/
|
||||
if (Gbl_UseDefaultAmlFilename)
|
||||
{
|
||||
Gbl_OutputFilenamePrefix = Gbl_Files[ASL_FILE_INPUT].Filename;
|
||||
}
|
||||
|
||||
/* Open the optional output files (listings, etc.) */
|
||||
|
||||
Status = FlOpenMiscOutputFiles (Gbl_OutputFilenamePrefix);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AePrintErrorLog (ASL_FILE_STDERR);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* Compilation of ASL source versus DataTable source uses different
|
||||
* compiler subsystems
|
||||
*/
|
||||
switch (Gbl_FileType)
|
||||
{
|
||||
/*
|
||||
* Data Table Compilation
|
||||
*/
|
||||
case ASL_INPUT_TYPE_ASCII_DATA:
|
||||
|
||||
Status = DtDoCompile ();
|
||||
|
||||
if (Gbl_Signature)
|
||||
{
|
||||
ACPI_FREE (Gbl_Signature);
|
||||
Gbl_Signature = NULL;
|
||||
}
|
||||
AeClearErrorLog ();
|
||||
return (Status);
|
||||
|
||||
/*
|
||||
* ASL Compilation (Optional)
|
||||
*/
|
||||
if (Gbl_DoCompile)
|
||||
{
|
||||
/*
|
||||
* If -p not specified, we will use the input filename as the
|
||||
* output filename prefix
|
||||
*/
|
||||
if (Gbl_UseDefaultAmlFilename)
|
||||
{
|
||||
Gbl_OutputFilenamePrefix = Gbl_Files[ASL_FILE_INPUT].Filename;
|
||||
}
|
||||
case ASL_INPUT_TYPE_ASCII_ASL:
|
||||
|
||||
/* ACPI CA subsystem initialization (Must be re-initialized) */
|
||||
/* ACPICA subsystem initialization */
|
||||
|
||||
Status = AdInitialize ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
@ -367,9 +499,17 @@ AslDoOneFile (
|
||||
}
|
||||
|
||||
AeClearErrorLog ();
|
||||
}
|
||||
return (AE_OK);
|
||||
|
||||
return (AE_OK);
|
||||
case ASL_INPUT_TYPE_BINARY:
|
||||
|
||||
AePrintErrorLog (ASL_FILE_STDERR);
|
||||
return (AE_ERROR);
|
||||
|
||||
default:
|
||||
printf ("Unknown file type %X\n", Gbl_FileType);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -391,7 +531,7 @@ ACPI_STATUS
|
||||
AslDoOnePathname (
|
||||
char *Pathname)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
char **FileList;
|
||||
char *Filename;
|
||||
char *FullPathname;
|
||||
@ -427,11 +567,9 @@ AslDoOnePathname (
|
||||
Gbl_OutputFilenamePrefix = FullPathname;
|
||||
}
|
||||
|
||||
Status = AslDoOneFile (FullPathname);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
/* Save status from all compiles */
|
||||
|
||||
Status |= AslDoOneFile (FullPathname);
|
||||
|
||||
ACPI_FREE (FullPathname);
|
||||
ACPI_FREE (*FileList);
|
||||
@ -441,6 +579,6 @@ AslDoOnePathname (
|
||||
|
||||
ACPI_FREE (Gbl_DirectoryPath);
|
||||
ACPI_FREE (Filename);
|
||||
return (AE_OK);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
@ -674,7 +674,7 @@ TrDoSwitch (
|
||||
{
|
||||
/* Unknown peer opcode */
|
||||
|
||||
AcpiOsPrintf ("Unknown parse opcode for switch statement: %s (%d)\n",
|
||||
AcpiOsPrintf ("Unknown parse opcode for switch statement: %s (%u)\n",
|
||||
Next->Asl.ParseOpName, Next->Asl.ParseOpcode);
|
||||
}
|
||||
}
|
||||
|
@ -466,7 +466,7 @@ TrCreateLeafNode (
|
||||
Op = TrAllocateNode (ParseOpcode);
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT,
|
||||
"\nCreateLeafNode Ln/Col %d/%d NewNode %p Op %s\n\n",
|
||||
"\nCreateLeafNode Ln/Col %u/%u NewNode %p Op %s\n\n",
|
||||
Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode));
|
||||
|
||||
return Op;
|
||||
@ -498,7 +498,7 @@ TrCreateValuedLeafNode (
|
||||
Op = TrAllocateNode (ParseOpcode);
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT,
|
||||
"\nCreateValuedLeafNode Ln/Col %d/%d NewNode %p Op %s Value %8.8X%8.8X ",
|
||||
"\nCreateValuedLeafNode Ln/Col %u/%u NewNode %p Op %s Value %8.8X%8.8X ",
|
||||
Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode),
|
||||
ACPI_FORMAT_UINT64 (Value));
|
||||
Op->Asl.Value.Integer = Value;
|
||||
@ -575,7 +575,7 @@ TrCreateNode (
|
||||
Op = TrAllocateNode (ParseOpcode);
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT,
|
||||
"\nCreateNode Ln/Col %d/%d NewParent %p Child %d Op %s ",
|
||||
"\nCreateNode Ln/Col %u/%u NewParent %p Child %u Op %s ",
|
||||
Op->Asl.LineNumber, Op->Asl.Column, Op, NumChildren, UtGetOpName(ParseOpcode));
|
||||
|
||||
/* Some extra debug output based on the parse opcode */
|
||||
@ -694,7 +694,7 @@ TrLinkChildren (
|
||||
TrSetEndLineNumber (Op);
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT,
|
||||
"\nLinkChildren Line [%d to %d] NewParent %p Child %d Op %s ",
|
||||
"\nLinkChildren Line [%u to %u] NewParent %p Child %u Op %s ",
|
||||
Op->Asl.LineNumber, Op->Asl.EndLine,
|
||||
Op, NumChildren, UtGetOpName(Op->Asl.ParseOpcode));
|
||||
|
||||
@ -882,7 +882,7 @@ TrLinkPeerNodes (
|
||||
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT,
|
||||
"\nLinkPeerNodes: (%d) ", NumPeers);
|
||||
"\nLinkPeerNodes: (%u) ", NumPeers);
|
||||
|
||||
va_start (ap, NumPeers);
|
||||
This = va_arg (ap, ACPI_PARSE_OBJECT *);
|
||||
@ -893,7 +893,7 @@ TrLinkPeerNodes (
|
||||
*/
|
||||
for (i = 0; i < (NumPeers -1); i++)
|
||||
{
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "%d=%p ", (i+1), This);
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "%u=%p ", (i+1), This);
|
||||
|
||||
while (This->Asl.Next)
|
||||
{
|
||||
|
@ -279,11 +279,17 @@ typedef struct asl_listing_node
|
||||
|
||||
/* Callback interface for a parse tree walk */
|
||||
|
||||
/*
|
||||
* TBD - another copy of this is in adisasm.h, fix
|
||||
*/
|
||||
#ifndef ASL_WALK_CALLBACK_DEFINED
|
||||
typedef
|
||||
ACPI_STATUS (*ASL_WALK_CALLBACK) (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Level,
|
||||
void *Context);
|
||||
#define ASL_WALK_CALLBACK_DEFINED
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct asl_event_info
|
||||
@ -429,14 +435,24 @@ typedef enum
|
||||
ASL_MSG_INVALID_GRANULARITY,
|
||||
ASL_MSG_INVALID_GRAN_FIXED,
|
||||
ASL_MSG_INVALID_ACCESS_SIZE,
|
||||
ASL_MSG_INVALID_ADDR_FLAGS
|
||||
ASL_MSG_INVALID_ADDR_FLAGS,
|
||||
ASL_MSG_INVALID_FIELD_NAME,
|
||||
ASL_MSG_INTEGER_SIZE,
|
||||
ASL_MSG_INVALID_HEX_INTEGER,
|
||||
ASL_MSG_BUFFER_ELEMENT,
|
||||
ASL_MSG_RESERVED_VALUE,
|
||||
ASL_MSG_FLAG_VALUE,
|
||||
ASL_MSG_ZERO_VALUE,
|
||||
ASL_MSG_UNKNOWN_TABLE,
|
||||
ASL_MSG_UNKNOWN_SUBTABLE,
|
||||
ASL_MSG_OEM_TABLE
|
||||
|
||||
} ASL_MESSAGE_IDS;
|
||||
|
||||
#ifdef ASL_EXCEPTIONS
|
||||
|
||||
char *AslMessages [] = {
|
||||
/* The zeroth message is resesrved */ "",
|
||||
/* The zeroth message is reserved */ "",
|
||||
/* ASL_MSG_ALPHANUMERIC_STRING */ "String must be entirely alphanumeric",
|
||||
/* ASL_MSG_AML_NOT_IMPLEMENTED */ "Opcode is not implemented in compiler AML code generator",
|
||||
/* ASL_MSG_ARG_COUNT_HI */ "Too many arguments",
|
||||
@ -558,7 +574,20 @@ char *AslMessages [] = {
|
||||
/* ASL_MSG_INVALID_GRANULARITY */ "Granularity must be zero or a power of two minus one",
|
||||
/* ASL_MSG_INVALID_GRAN_FIXED */ "Granularity must be zero for fixed Min/Max",
|
||||
/* ASL_MSG_INVALID_ACCESS_SIZE */ "Invalid AccessSize (Maximum is 4 - QWord access)",
|
||||
/* ASL_MSG_INVALID_ADDR_FLAGS */ "Invalid combination of Length and Min/Max fixed flags"
|
||||
/* ASL_MSG_INVALID_ADDR_FLAGS */ "Invalid combination of Length and Min/Max fixed flags",
|
||||
|
||||
/* These messages are used by the data table compiler only */
|
||||
|
||||
/* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name",
|
||||
/* ASL_MSG_INTEGER_SIZE */ "Integer too large for target",
|
||||
/* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant",
|
||||
/* ASL_MSG_BUFFER_ELEMENT */ "Invalid element in buffer initializer list",
|
||||
/* ASL_MSG_RESERVED_VALUE */ "Reserved field must be zero",
|
||||
/* ASL_MSG_FLAG_VALUE */ "Flag value is too large",
|
||||
/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero",
|
||||
/* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature",
|
||||
/* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type",
|
||||
/* ASL_MSG_OEM_TABLE */ "OEM table - unknown contents"
|
||||
|
||||
};
|
||||
|
||||
|
@ -117,6 +117,7 @@
|
||||
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include "aslcompiler.y.h"
|
||||
#include <contrib/dev/acpica/include/acdisasm.h>
|
||||
#include <contrib/dev/acpica/include/acnamesp.h>
|
||||
#include <contrib/dev/acpica/include/amlcode.h>
|
||||
|
||||
@ -155,6 +156,50 @@ UtAttachNameseg (
|
||||
char *Name);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: UtDisplaySupportedTables
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Print all supported ACPI table names.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
UtDisplaySupportedTables (
|
||||
void)
|
||||
{
|
||||
ACPI_DMTABLE_DATA *TableData;
|
||||
UINT32 i = 6;
|
||||
|
||||
|
||||
printf ("\nACPI tables supported by iASL subsystems in "
|
||||
"version %8.8X:\n"
|
||||
" ASL and Data Table compilers\n"
|
||||
" AML and Data Table disassemblers\n"
|
||||
" ACPI table template generator\n\n", ACPI_CA_VERSION);
|
||||
|
||||
/* Special tables */
|
||||
|
||||
printf ("%8u) %s %s\n", 1, ACPI_SIG_DSDT, "Differentiated System Description Table");
|
||||
printf ("%8u) %s %s\n", 2, ACPI_SIG_SSDT, "Secondary System Description Table");
|
||||
printf ("%8u) %s %s\n", 3, ACPI_SIG_FADT, "Fixed ACPI Description Table (FADT)");
|
||||
printf ("%8u) %s %s\n", 4, ACPI_SIG_FACS, "Firmware ACPI Control Structure");
|
||||
printf ("%8u) %s %s\n", 5, ACPI_RSDP_NAME, "Root System Description Pointer");
|
||||
|
||||
/* All data tables with common table header */
|
||||
|
||||
for (TableData = AcpiDmTableData; TableData->Signature; TableData++)
|
||||
{
|
||||
printf ("%8u) %s %s\n", i, TableData->Signature, TableData->Name);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiPsDisplayConstantOpcodes
|
||||
@ -214,6 +259,8 @@ UtLocalCalloc (
|
||||
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
|
||||
Gbl_InputByteCount, Gbl_CurrentColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
|
||||
|
||||
CmCleanupAndExit ();
|
||||
exit (1);
|
||||
}
|
||||
|
||||
@ -523,33 +570,57 @@ UtDisplaySummary (
|
||||
CompilerId, (UINT32) ACPI_CA_VERSION);
|
||||
}
|
||||
|
||||
/* Input/Output summary */
|
||||
|
||||
FlPrintFile (FileId,
|
||||
"ASL Input: %s - %d lines, %d bytes, %d keywords\n",
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_CurrentLineNumber,
|
||||
Gbl_InputByteCount, TotalKeywords);
|
||||
|
||||
/* AML summary */
|
||||
|
||||
if ((Gbl_ExceptionCount[ASL_ERROR] == 0) || (Gbl_IgnoreErrors))
|
||||
if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA)
|
||||
{
|
||||
FlPrintFile (FileId,
|
||||
"AML Output: %s - %d bytes, %d named objects, %d executable opcodes\n\n",
|
||||
Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength,
|
||||
TotalNamedObjects, TotalExecutableOpcodes);
|
||||
"Table Input: %s - %u lines, %u bytes, %u fields\n",
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_CurrentLineNumber,
|
||||
Gbl_InputByteCount, Gbl_InputFieldCount);
|
||||
|
||||
if ((Gbl_ExceptionCount[ASL_ERROR] == 0) || (Gbl_IgnoreErrors))
|
||||
{
|
||||
FlPrintFile (FileId,
|
||||
"Binary Output: %s - %u bytes\n\n",
|
||||
Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Input/Output summary */
|
||||
|
||||
FlPrintFile (FileId,
|
||||
"ASL Input: %s - %u lines, %u bytes, %u keywords\n",
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_CurrentLineNumber,
|
||||
Gbl_InputByteCount, TotalKeywords);
|
||||
|
||||
/* AML summary */
|
||||
|
||||
if ((Gbl_ExceptionCount[ASL_ERROR] == 0) || (Gbl_IgnoreErrors))
|
||||
{
|
||||
FlPrintFile (FileId,
|
||||
"AML Output: %s - %u bytes, %u named objects, %u executable opcodes\n\n",
|
||||
Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength,
|
||||
TotalNamedObjects, TotalExecutableOpcodes);
|
||||
}
|
||||
}
|
||||
|
||||
/* Error summary */
|
||||
|
||||
FlPrintFile (FileId,
|
||||
"Compilation complete. %d Errors, %d Warnings, %d Remarks, %d Optimizations\n",
|
||||
"Compilation complete. %u Errors, %u Warnings, %u Remarks",
|
||||
Gbl_ExceptionCount[ASL_ERROR],
|
||||
Gbl_ExceptionCount[ASL_WARNING] +
|
||||
Gbl_ExceptionCount[ASL_WARNING2] +
|
||||
Gbl_ExceptionCount[ASL_WARNING3],
|
||||
Gbl_ExceptionCount[ASL_REMARK],
|
||||
Gbl_ExceptionCount[ASL_OPTIMIZATION]);
|
||||
Gbl_ExceptionCount[ASL_REMARK]);
|
||||
|
||||
if (Gbl_FileType != ASL_INPUT_TYPE_ASCII_DATA)
|
||||
{
|
||||
FlPrintFile (FileId,
|
||||
", %u Optimizations", Gbl_ExceptionCount[ASL_OPTIMIZATION]);
|
||||
}
|
||||
|
||||
FlPrintFile (FileId, "\n");
|
||||
}
|
||||
|
||||
|
||||
|
623
sys/contrib/dev/acpica/compiler/dtcompile.c
Normal file
623
sys/contrib/dev/acpica/compiler/dtcompile.c
Normal file
@ -0,0 +1,623 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dtcompile.c - Front-end for data table compiler
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DTCOMPILE_C__
|
||||
#define _DECLARE_DT_GLOBALS
|
||||
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include <contrib/dev/acpica/compiler/dtcompiler.h>
|
||||
|
||||
#define _COMPONENT DT_COMPILER
|
||||
ACPI_MODULE_NAME ("dtcompile")
|
||||
|
||||
static char VersionString[9];
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
DtInitialize (
|
||||
void);
|
||||
|
||||
static ACPI_STATUS
|
||||
DtCompileDataTable (
|
||||
DT_FIELD **Field);
|
||||
|
||||
static void
|
||||
DtInsertCompilerIds (
|
||||
DT_FIELD *FieldList);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtDoCompile
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Main entry point for the data table compiler.
|
||||
*
|
||||
* Note: Assumes Gbl_Files[ASL_FILE_INPUT] is initialized and the file is
|
||||
* open at seek offset zero.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
DtDoCompile (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
UINT8 Event;
|
||||
DT_FIELD *FieldList;
|
||||
|
||||
|
||||
/* Initialize globals */
|
||||
|
||||
DtInitialize ();
|
||||
|
||||
/*
|
||||
* Scan the input file (file is already open) and
|
||||
* build the parse tree
|
||||
*/
|
||||
Event = UtBeginEvent ("Scan and parse input file");
|
||||
FieldList = DtScanFile (Gbl_Files[ASL_FILE_INPUT].Handle);
|
||||
UtEndEvent (Event);
|
||||
|
||||
/* Did the parse tree get successfully constructed? */
|
||||
|
||||
if (!FieldList)
|
||||
{
|
||||
/* TBD: temporary error message. Msgs should come from function above */
|
||||
|
||||
DtError (ASL_ERROR, ASL_MSG_SYNTAX, NULL,
|
||||
"Input file does not appear to be an ASL or data table source file");
|
||||
|
||||
Status = AE_ERROR;
|
||||
goto CleanupAndExit;
|
||||
}
|
||||
|
||||
Event = UtBeginEvent ("Compile parse tree");
|
||||
|
||||
/*
|
||||
* Compile the parse tree
|
||||
*/
|
||||
Status = DtCompileDataTable (&FieldList);
|
||||
UtEndEvent (Event);
|
||||
|
||||
DtFreeFieldList ();
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
/* TBD: temporary error message. Msgs should come from function above */
|
||||
|
||||
DtError (ASL_ERROR, ASL_MSG_SYNTAX, NULL,
|
||||
"Could not compile input file");
|
||||
|
||||
goto CleanupAndExit;
|
||||
}
|
||||
|
||||
/* Create/open the binary output file */
|
||||
|
||||
Gbl_Files[ASL_FILE_AML_OUTPUT].Filename = NULL;
|
||||
Status = FlOpenAmlOutputFile (Gbl_OutputFilenamePrefix);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto CleanupAndExit;
|
||||
}
|
||||
|
||||
/* Write the binary, then the optional hex file */
|
||||
|
||||
DtOutputBinary (Gbl_RootTable);
|
||||
LsDoHexOutput ();
|
||||
|
||||
CleanupAndExit:
|
||||
|
||||
CmCleanupAndExit ();
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtInitialize
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Initialize data table compiler globals. Enables multiple
|
||||
* compiles per invocation.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static void
|
||||
DtInitialize (
|
||||
void)
|
||||
{
|
||||
|
||||
AcpiOsInitialize ();
|
||||
AcpiUtInitGlobals ();
|
||||
|
||||
Gbl_FieldList = NULL;
|
||||
Gbl_RootTable = NULL;
|
||||
Gbl_SubtableStack = NULL;
|
||||
|
||||
sprintf (VersionString, "%X", (UINT32) ACPI_CA_VERSION);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtInsertCompilerIds
|
||||
*
|
||||
* PARAMETERS: FieldList - Current field list pointer
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Insert the IDs (Name, Version) of the current compiler into
|
||||
* the original ACPI table header.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static void
|
||||
DtInsertCompilerIds (
|
||||
DT_FIELD *FieldList)
|
||||
{
|
||||
DT_FIELD *Next;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
/*
|
||||
* Don't insert current compiler ID if requested. Used for compiler
|
||||
* debug/validation only.
|
||||
*/
|
||||
if (Gbl_UseOriginalCompilerId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Walk to the Compiler fields at the end of the header */
|
||||
|
||||
Next = FieldList;
|
||||
for (i = 0; i < 7; i++)
|
||||
{
|
||||
Next = Next->Next;
|
||||
}
|
||||
|
||||
Next->Value = CompilerCreatorId;
|
||||
Next->Flags = DT_FIELD_NOT_ALLOCATED;
|
||||
|
||||
Next = Next->Next;
|
||||
Next->Value = VersionString;
|
||||
Next->Flags = DT_FIELD_NOT_ALLOCATED;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileDataTable
|
||||
*
|
||||
* PARAMETERS: FieldList - Current field list pointer
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Entry point to compile one data table
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
DtCompileDataTable (
|
||||
DT_FIELD **FieldList)
|
||||
{
|
||||
ACPI_DMTABLE_DATA *TableData;
|
||||
DT_SUBTABLE *Subtable;
|
||||
char *Signature;
|
||||
ACPI_TABLE_HEADER *AcpiTableHeader;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
/* Verify that we at least have a table signature and save it */
|
||||
|
||||
Signature = DtGetFieldValue (*FieldList, "Signature");
|
||||
if (!Signature)
|
||||
{
|
||||
sprintf (MsgBuffer, "Expected \"%s\"", "Signature");
|
||||
DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME,
|
||||
*FieldList, MsgBuffer);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
Gbl_Signature = UtLocalCalloc (ACPI_STRLEN (Signature) + 1);
|
||||
strcpy (Gbl_Signature, Signature);
|
||||
|
||||
/*
|
||||
* Handle tables that don't use the common ACPI table header structure.
|
||||
* Currently, these are the FACS and RSDP. Also check for an OEMx table,
|
||||
* these tables have user-defined contents.
|
||||
*/
|
||||
if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS))
|
||||
{
|
||||
Status = DtCompileFacs (FieldList);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
DtSetTableLength ();
|
||||
return (Status);
|
||||
}
|
||||
else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_RSDP))
|
||||
{
|
||||
Status = DtCompileRsdp (FieldList);
|
||||
return (Status);
|
||||
}
|
||||
else if (!ACPI_STRNCMP (Signature, "OEM", 3))
|
||||
{
|
||||
DtFatal (ASL_MSG_OEM_TABLE, *FieldList, Signature);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Validate the signature via the ACPI table list */
|
||||
|
||||
TableData = AcpiDmGetTableData (Signature);
|
||||
if (!TableData)
|
||||
{
|
||||
DtFatal (ASL_MSG_UNKNOWN_TABLE, *FieldList, Signature);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* All other tables must use the common ACPI table header. Insert the
|
||||
* current iASL IDs (name, version), and compile the header now.
|
||||
*/
|
||||
DtInsertCompilerIds (*FieldList);
|
||||
|
||||
Status = DtCompileTable (FieldList, AcpiDmTableInfoHeader,
|
||||
&Gbl_RootTable, TRUE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
DtPushSubtable (Gbl_RootTable);
|
||||
|
||||
/* Dispatch to per-table compile */
|
||||
|
||||
if (TableData->CmTableHandler)
|
||||
{
|
||||
/* Complex table, has a handler */
|
||||
|
||||
Status = TableData->CmTableHandler ((void **) FieldList);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
}
|
||||
else if (TableData->TableInfo)
|
||||
{
|
||||
/* Simple table, just walk the info table */
|
||||
|
||||
Subtable = NULL;
|
||||
Status = DtCompileTable (FieldList, TableData->TableInfo,
|
||||
&Subtable, TRUE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
DtInsertSubtable (Gbl_RootTable, Subtable);
|
||||
DtPopSubtable ();
|
||||
}
|
||||
else
|
||||
{
|
||||
DtFatal (ASL_MSG_COMPILER_INTERNAL, *FieldList,
|
||||
"Missing table dispatch info");
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Set the final table length and then the checksum */
|
||||
|
||||
DtSetTableLength ();
|
||||
AcpiTableHeader = ACPI_CAST_PTR (
|
||||
ACPI_TABLE_HEADER, Gbl_RootTable->Buffer);
|
||||
DtSetTableChecksum (&AcpiTableHeader->Checksum);
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileTable
|
||||
*
|
||||
* PARAMETERS: Field - Current field list pointer
|
||||
* Info - Info table for this ACPI table
|
||||
* RetSubtable - Compile result of table
|
||||
* Required - If this subtable must exist
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Compile a subtable
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileTable (
|
||||
DT_FIELD **Field,
|
||||
ACPI_DMTABLE_INFO *Info,
|
||||
DT_SUBTABLE **RetSubtable,
|
||||
BOOLEAN Required)
|
||||
{
|
||||
DT_FIELD *LocalField;
|
||||
UINT32 Length;
|
||||
DT_SUBTABLE *Subtable;
|
||||
DT_SUBTABLE *InlineSubtable;
|
||||
UINT32 FieldLength = 0;
|
||||
UINT8 FieldType;
|
||||
UINT8 *Buffer;
|
||||
UINT8 *FlagBuffer = NULL;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
if (!Field || !*Field)
|
||||
{
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
Length = DtGetSubtableLength (*Field, Info);
|
||||
Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE));
|
||||
|
||||
Subtable->Buffer = UtLocalCalloc (Length);
|
||||
Subtable->Length = Length;
|
||||
Subtable->TotalLength = Length;
|
||||
Buffer = Subtable->Buffer;
|
||||
|
||||
LocalField = *Field;
|
||||
|
||||
/*
|
||||
* Main loop walks the info table for this ACPI table or subtable
|
||||
*/
|
||||
for (; Info->Name; Info++)
|
||||
{
|
||||
if (!LocalField)
|
||||
{
|
||||
sprintf (MsgBuffer, "Found NULL field - Field name \"%s\" needed",
|
||||
Info->Name);
|
||||
DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer);
|
||||
Status = AE_BAD_DATA;
|
||||
goto Error;
|
||||
}
|
||||
|
||||
/* Does input field name match what is expected? */
|
||||
|
||||
if (ACPI_STRCMP (LocalField->Name, Info->Name))
|
||||
{
|
||||
/*
|
||||
* If Required = TRUE, the subtable must exist.
|
||||
* If Required = FALSE, the subtable is optional
|
||||
* (For example, AcpiDmTableInfoDmarScope in DMAR table is
|
||||
* optional)
|
||||
*/
|
||||
if (Required)
|
||||
{
|
||||
sprintf (MsgBuffer, "Expected \"%s\"", Info->Name);
|
||||
DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME,
|
||||
LocalField, MsgBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = AE_NOT_FOUND;
|
||||
goto Error;
|
||||
}
|
||||
}
|
||||
|
||||
FieldLength = DtGetFieldLength (LocalField, Info);
|
||||
FieldType = DtGetFieldType (Info);
|
||||
Gbl_InputFieldCount++;
|
||||
|
||||
switch (FieldType)
|
||||
{
|
||||
case DT_FIELD_TYPE_FLAGS_INTEGER:
|
||||
/*
|
||||
* Start of the definition of a flags field.
|
||||
* This master flags integer starts at value zero, in preparation
|
||||
* to compile and insert the flag fields from the individual bits
|
||||
*/
|
||||
LocalField = LocalField->Next;
|
||||
*Field = LocalField;
|
||||
|
||||
FlagBuffer = Buffer;
|
||||
break;
|
||||
|
||||
case DT_FIELD_TYPE_FLAG:
|
||||
|
||||
/* Individual Flag field, can be multiple bits */
|
||||
|
||||
if (FlagBuffer)
|
||||
{
|
||||
DtCompileFlag (FlagBuffer, LocalField, Info);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* TBD - this is an internal error */
|
||||
}
|
||||
|
||||
LocalField = LocalField->Next;
|
||||
*Field = LocalField;
|
||||
break;
|
||||
|
||||
case DT_FIELD_TYPE_INLINE_SUBTABLE:
|
||||
/*
|
||||
* Recursion (one level max): compile GAS (Generic Address)
|
||||
* or Notify in-line subtable
|
||||
*/
|
||||
LocalField = LocalField->Next;
|
||||
*Field = LocalField;
|
||||
|
||||
if (Info->Opcode == ACPI_DMT_GAS)
|
||||
{
|
||||
Status = DtCompileTable (Field, AcpiDmTableInfoGas,
|
||||
&InlineSubtable, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = DtCompileTable (Field, AcpiDmTableInfoHestNotify,
|
||||
&InlineSubtable, TRUE);
|
||||
}
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Error;
|
||||
}
|
||||
|
||||
DtSetSubtableLength (InlineSubtable);
|
||||
|
||||
ACPI_MEMCPY (Buffer, InlineSubtable->Buffer, FieldLength);
|
||||
ACPI_FREE (InlineSubtable->Buffer);
|
||||
ACPI_FREE (InlineSubtable);
|
||||
LocalField = *Field;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Normal case for most field types (Integer, String, etc.) */
|
||||
|
||||
DtCompileOneField (Buffer, LocalField,
|
||||
FieldLength, FieldType, Info->Flags);
|
||||
LocalField = LocalField->Next;
|
||||
|
||||
if (Info->Flags & DT_LENGTH)
|
||||
{
|
||||
/* Field is an Integer that will contain a subtable length */
|
||||
|
||||
Subtable->LengthField = Buffer;
|
||||
Subtable->SizeOfLengthField = FieldLength;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Buffer += FieldLength;
|
||||
}
|
||||
|
||||
*Field = LocalField;
|
||||
*RetSubtable = Subtable;
|
||||
return (AE_OK);
|
||||
|
||||
Error:
|
||||
ACPI_FREE (Subtable->Buffer);
|
||||
ACPI_FREE (Subtable);
|
||||
return (Status);
|
||||
}
|
487
sys/contrib/dev/acpica/compiler/dtcompiler.h
Normal file
487
sys/contrib/dev/acpica/compiler/dtcompiler.h
Normal file
@ -0,0 +1,487 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dtcompiler.h - header for data table compiler
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DTCOMPILER_H__
|
||||
|
||||
#ifndef _DTCOMPILER
|
||||
#define _DTCOMPILER
|
||||
|
||||
#include <stdio.h>
|
||||
#include <contrib/dev/acpica/include/acdisasm.h>
|
||||
|
||||
|
||||
#undef DT_EXTERN
|
||||
|
||||
#ifdef _DECLARE_DT_GLOBALS
|
||||
#define DT_EXTERN
|
||||
#define DT_INIT_GLOBAL(a,b) (a)=(b)
|
||||
#else
|
||||
#define DT_EXTERN extern
|
||||
#define DT_INIT_GLOBAL(a,b) (a)
|
||||
#endif
|
||||
|
||||
|
||||
/* Types for individual fields (one per input line) */
|
||||
|
||||
#define DT_FIELD_TYPE_STRING 0
|
||||
#define DT_FIELD_TYPE_INTEGER 1
|
||||
#define DT_FIELD_TYPE_BUFFER 2
|
||||
#define DT_FIELD_TYPE_PCI_PATH 3
|
||||
#define DT_FIELD_TYPE_FLAG 4
|
||||
#define DT_FIELD_TYPE_FLAGS_INTEGER 5
|
||||
#define DT_FIELD_TYPE_INLINE_SUBTABLE 6
|
||||
|
||||
|
||||
/*
|
||||
* Structure used for each individual field within an ACPI table
|
||||
*/
|
||||
typedef struct dt_field
|
||||
{
|
||||
char *Name;
|
||||
char *Value;
|
||||
struct dt_field *Next;
|
||||
UINT32 Line; /* Line number for this field */
|
||||
UINT32 ByteOffset; /* Offset in source file for field */
|
||||
UINT32 NameColumn; /* Start column for field name */
|
||||
UINT32 Column; /* Start column for field value */
|
||||
UINT8 Flags;
|
||||
|
||||
} DT_FIELD;
|
||||
|
||||
/* Flags for above */
|
||||
|
||||
#define DT_FIELD_NOT_ALLOCATED 1
|
||||
|
||||
|
||||
/*
|
||||
* Structure used for individual subtables within an ACPI table
|
||||
*/
|
||||
typedef struct dt_subtable
|
||||
{
|
||||
struct dt_subtable *Parent;
|
||||
struct dt_subtable *Child;
|
||||
struct dt_subtable *Peer;
|
||||
struct dt_subtable *StackTop;
|
||||
UINT8 *Buffer;
|
||||
UINT8 *LengthField;
|
||||
UINT32 Length;
|
||||
UINT32 TotalLength;
|
||||
UINT32 SizeOfLengthField;
|
||||
UINT8 Flags;
|
||||
|
||||
} DT_SUBTABLE;
|
||||
|
||||
|
||||
/*
|
||||
* Globals
|
||||
*/
|
||||
|
||||
/* List of all field names and values from the input source */
|
||||
|
||||
DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*Gbl_FieldList, NULL);
|
||||
|
||||
/* List of all compiled tables and subtables */
|
||||
|
||||
DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*Gbl_RootTable, NULL);
|
||||
|
||||
/* Stack for subtables */
|
||||
|
||||
DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*Gbl_SubtableStack, NULL);
|
||||
|
||||
|
||||
/* dtcompiler - main module */
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileTable (
|
||||
DT_FIELD **Field,
|
||||
ACPI_DMTABLE_INFO *Info,
|
||||
DT_SUBTABLE **RetSubtable,
|
||||
BOOLEAN Required);
|
||||
|
||||
|
||||
/* dtio - binary and text input/output */
|
||||
|
||||
DT_FIELD *
|
||||
DtScanFile (
|
||||
FILE *Handle);
|
||||
|
||||
void
|
||||
DtOutputBinary (
|
||||
DT_SUBTABLE *RootTable);
|
||||
|
||||
|
||||
/* dtsubtable - compile subtables */
|
||||
|
||||
void
|
||||
DtCreateSubtable (
|
||||
UINT8 *Buffer,
|
||||
UINT32 Length,
|
||||
DT_SUBTABLE **RetSubtable);
|
||||
|
||||
UINT32
|
||||
DtGetSubtableLength (
|
||||
DT_FIELD *Field,
|
||||
ACPI_DMTABLE_INFO *Info);
|
||||
|
||||
void
|
||||
DtSetSubtableLength (
|
||||
DT_SUBTABLE *Subtable);
|
||||
|
||||
void
|
||||
DtPushSubtable (
|
||||
DT_SUBTABLE *Subtable);
|
||||
|
||||
void
|
||||
DtPopSubtable (
|
||||
void);
|
||||
|
||||
DT_SUBTABLE *
|
||||
DtPeekSubtable (
|
||||
void);
|
||||
|
||||
void
|
||||
DtInsertSubtable (
|
||||
DT_SUBTABLE *ParentTable,
|
||||
DT_SUBTABLE *Subtable);
|
||||
|
||||
DT_SUBTABLE *
|
||||
DtGetNextSubtable (
|
||||
DT_SUBTABLE *ParentTable,
|
||||
DT_SUBTABLE *ChildTable);
|
||||
|
||||
DT_SUBTABLE *
|
||||
DtGetParentSubtable (
|
||||
DT_SUBTABLE *Subtable);
|
||||
|
||||
|
||||
/* dtfield - Compile individual fields within a table */
|
||||
|
||||
void
|
||||
DtCompileOneField (
|
||||
UINT8 *Buffer,
|
||||
DT_FIELD *Field,
|
||||
UINT32 ByteLength,
|
||||
UINT8 Type,
|
||||
UINT8 Flags);
|
||||
|
||||
void
|
||||
DtCompileInteger (
|
||||
UINT8 *Buffer,
|
||||
DT_FIELD *Field,
|
||||
UINT32 ByteLength,
|
||||
UINT8 Flags);
|
||||
|
||||
UINT32
|
||||
DtCompileBuffer (
|
||||
UINT8 *Buffer,
|
||||
char *Value,
|
||||
DT_FIELD *Field,
|
||||
UINT32 ByteLength);
|
||||
|
||||
void
|
||||
DtCompileFlag (
|
||||
UINT8 *Buffer,
|
||||
DT_FIELD *Field,
|
||||
ACPI_DMTABLE_INFO *Info);
|
||||
|
||||
|
||||
/* dtutils - Miscellaneous utilities */
|
||||
|
||||
typedef
|
||||
void (*DT_WALK_CALLBACK) (
|
||||
DT_SUBTABLE *Subtable,
|
||||
void *Context,
|
||||
void *ReturnValue);
|
||||
|
||||
void
|
||||
DtWalkTableTree (
|
||||
DT_SUBTABLE *StartTable,
|
||||
DT_WALK_CALLBACK UserFunction,
|
||||
void *Context,
|
||||
void *ReturnValue);
|
||||
|
||||
void
|
||||
DtError (
|
||||
UINT8 Level,
|
||||
UINT8 MessageId,
|
||||
DT_FIELD *FieldObject,
|
||||
char *ExtraMessage);
|
||||
|
||||
void
|
||||
DtNameError (
|
||||
UINT8 Level,
|
||||
UINT8 MessageId,
|
||||
DT_FIELD *FieldObject,
|
||||
char *ExtraMessage);
|
||||
|
||||
void
|
||||
DtFatal (
|
||||
UINT8 MessageId,
|
||||
DT_FIELD *FieldObject,
|
||||
char *ExtraMessage);
|
||||
|
||||
ACPI_STATUS
|
||||
DtStrtoul64 (
|
||||
char *String,
|
||||
UINT64 *ReturnInteger);
|
||||
|
||||
UINT32
|
||||
DtGetFileSize (
|
||||
FILE *Handle);
|
||||
|
||||
char*
|
||||
DtGetFieldValue (
|
||||
DT_FIELD *Field,
|
||||
char *Name);
|
||||
|
||||
UINT8
|
||||
DtGetFieldType (
|
||||
ACPI_DMTABLE_INFO *Info);
|
||||
|
||||
UINT32
|
||||
DtGetBufferLength (
|
||||
char *Buffer);
|
||||
|
||||
UINT32
|
||||
DtGetFieldLength (
|
||||
DT_FIELD *Field,
|
||||
ACPI_DMTABLE_INFO *Info);
|
||||
|
||||
void
|
||||
DtSetTableChecksum (
|
||||
UINT8 *ChecksumPointer);
|
||||
|
||||
void
|
||||
DtSetTableLength(
|
||||
void);
|
||||
|
||||
void
|
||||
DtFreeFieldList (
|
||||
void);
|
||||
|
||||
|
||||
/* dttable - individual table compilation */
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileFacs (
|
||||
DT_FIELD **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileRsdp (
|
||||
DT_FIELD **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileAsf (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileCpep (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileDmar (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileEinj (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileErst (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileFadt (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileHest (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileIvrs (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileMadt (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileMcfg (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileMsct (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileRsdt (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileSlit (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileSrat (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileWdat (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileXsdt (
|
||||
void **PFieldList);
|
||||
|
||||
/* ACPI Table templates */
|
||||
|
||||
extern const unsigned char TemplateAsf[];
|
||||
extern const unsigned char TemplateBoot[];
|
||||
extern const unsigned char TemplateBert[];
|
||||
extern const unsigned char TemplateCpep[];
|
||||
extern const unsigned char TemplateDbgp[];
|
||||
extern const unsigned char TemplateDmar[];
|
||||
extern const unsigned char TemplateEcdt[];
|
||||
extern const unsigned char TemplateEinj[];
|
||||
extern const unsigned char TemplateErst[];
|
||||
extern const unsigned char TemplateFadt[];
|
||||
extern const unsigned char TemplateHest[];
|
||||
extern const unsigned char TemplateHpet[];
|
||||
extern const unsigned char TemplateIvrs[];
|
||||
extern const unsigned char TemplateMadt[];
|
||||
extern const unsigned char TemplateMcfg[];
|
||||
extern const unsigned char TemplateMchi[];
|
||||
extern const unsigned char TemplateMsct[];
|
||||
extern const unsigned char TemplateRsdt[];
|
||||
extern const unsigned char TemplateSbst[];
|
||||
extern const unsigned char TemplateSlic[];
|
||||
extern const unsigned char TemplateSlit[];
|
||||
extern const unsigned char TemplateSpcr[];
|
||||
extern const unsigned char TemplateSpmi[];
|
||||
extern const unsigned char TemplateSrat[];
|
||||
extern const unsigned char TemplateTcpa[];
|
||||
extern const unsigned char TemplateUefi[];
|
||||
extern const unsigned char TemplateWaet[];
|
||||
extern const unsigned char TemplateWdat[];
|
||||
extern const unsigned char TemplateWddt[];
|
||||
extern const unsigned char TemplateWdrt[];
|
||||
extern const unsigned char TemplateXsdt[];
|
||||
|
||||
/* Debug */
|
||||
|
||||
#define MYDEBUG printf
|
||||
|
||||
#endif
|
538
sys/contrib/dev/acpica/compiler/dtfield.c
Normal file
538
sys/contrib/dev/acpica/compiler/dtfield.c
Normal file
@ -0,0 +1,538 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dtfield.c - Code generation for individual source fields
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DTFIELD_C__
|
||||
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include <contrib/dev/acpica/compiler/dtcompiler.h>
|
||||
|
||||
#define _COMPONENT DT_COMPILER
|
||||
ACPI_MODULE_NAME ("dtfield")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
DtCompileString (
|
||||
UINT8 *Buffer,
|
||||
DT_FIELD *Field,
|
||||
UINT32 ByteLength);
|
||||
|
||||
static char *
|
||||
DtNormalizeBuffer (
|
||||
char *Buffer,
|
||||
UINT32 *Count);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileOneField
|
||||
*
|
||||
* PARAMETERS: Buffer - Output buffer
|
||||
* Field - Field to be compiled
|
||||
* ByteLength - Byte length of the field
|
||||
* Type - Field type
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Compile a field value to binary
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtCompileOneField (
|
||||
UINT8 *Buffer,
|
||||
DT_FIELD *Field,
|
||||
UINT32 ByteLength,
|
||||
UINT8 Type,
|
||||
UINT8 Flags)
|
||||
{
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
case DT_FIELD_TYPE_INTEGER:
|
||||
DtCompileInteger (Buffer, Field, ByteLength, Flags);
|
||||
break;
|
||||
|
||||
case DT_FIELD_TYPE_STRING:
|
||||
DtCompileString (Buffer, Field, ByteLength);
|
||||
break;
|
||||
|
||||
case DT_FIELD_TYPE_BUFFER:
|
||||
DtCompileBuffer (Buffer, Field->Value, Field, ByteLength);
|
||||
break;
|
||||
|
||||
default:
|
||||
DtFatal (ASL_MSG_COMPILER_INTERNAL, Field, "Invalid field type");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileString
|
||||
*
|
||||
* PARAMETERS: Buffer - Output buffer
|
||||
* Field - String to be copied to buffer
|
||||
* ByteLength - Maximum length of string
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Copy string to the buffer
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static void
|
||||
DtCompileString (
|
||||
UINT8 *Buffer,
|
||||
DT_FIELD *Field,
|
||||
UINT32 ByteLength)
|
||||
{
|
||||
UINT32 Length;
|
||||
|
||||
|
||||
Length = ACPI_STRLEN (Field->Value);
|
||||
|
||||
/* Check if the string is too long for the field */
|
||||
|
||||
if (Length > ByteLength)
|
||||
{
|
||||
sprintf (MsgBuffer, "Maximum %u characters", ByteLength);
|
||||
DtError (ASL_ERROR, ASL_MSG_STRING_LENGTH, Field, MsgBuffer);
|
||||
Length = ByteLength;
|
||||
}
|
||||
|
||||
ACPI_MEMCPY (Buffer, Field->Value, Length);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileInteger
|
||||
*
|
||||
* PARAMETERS: Buffer - Output buffer
|
||||
* Field - Field obj with Integer to be compiled
|
||||
* ByteLength - Byte length of the integer
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Compile an integer
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtCompileInteger (
|
||||
UINT8 *Buffer,
|
||||
DT_FIELD *Field,
|
||||
UINT32 ByteLength,
|
||||
UINT8 Flags)
|
||||
{
|
||||
UINT64 Value = 0;
|
||||
UINT64 MaxValue;
|
||||
UINT8 *Hex;
|
||||
char *Message = NULL;
|
||||
ACPI_STATUS Status;
|
||||
int i;
|
||||
|
||||
|
||||
/* Byte length must be in range 1-8 */
|
||||
|
||||
if ((ByteLength > 8) || (ByteLength == 0))
|
||||
{
|
||||
DtFatal (ASL_MSG_COMPILER_INTERNAL, Field,
|
||||
"Invalid internal Byte length");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Convert string to an actual integer */
|
||||
|
||||
Status = DtStrtoul64 (Field->Value, &Value);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
if (Status == AE_LIMIT)
|
||||
{
|
||||
Message = "Constant larger than 64 bits";
|
||||
}
|
||||
else if (Status == AE_BAD_CHARACTER)
|
||||
{
|
||||
Message = "Invalid character in constant";
|
||||
}
|
||||
|
||||
DtError (ASL_ERROR, ASL_MSG_INVALID_HEX_INTEGER, Field, Message);
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
/* Ensure that reserved fields are set to zero */
|
||||
/* TBD: should we set to zero, or just make this an ERROR? */
|
||||
/* TBD: Probably better to use a flag */
|
||||
|
||||
if (!ACPI_STRCMP (Field->Name, "Reserved") &&
|
||||
(Value != 0))
|
||||
{
|
||||
DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,
|
||||
"Setting to zero");
|
||||
Value = 0;
|
||||
}
|
||||
|
||||
/* Check if the value must be non-zero */
|
||||
|
||||
if ((Value == 0) && (Flags & DT_NON_ZERO))
|
||||
{
|
||||
DtError (ASL_ERROR, ASL_MSG_ZERO_VALUE, Field, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate the maximum value for the data type (ByteLength)
|
||||
* Note: construct chosen for maximum portability
|
||||
*/
|
||||
MaxValue = ((UINT64) (-1)) >> (64 - (ByteLength * 8));
|
||||
|
||||
/* Validate that the input value is within range of the target */
|
||||
|
||||
if (Value > MaxValue)
|
||||
{
|
||||
sprintf (MsgBuffer, "Maximum %u bytes", ByteLength);
|
||||
DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, MsgBuffer);
|
||||
}
|
||||
|
||||
/*
|
||||
* TBD: hard code for ASF! Capabilites field.
|
||||
*
|
||||
* This field is actually a buffer, not a 56-bit integer --
|
||||
* so, the ordering is reversed. Something should be fixed
|
||||
* so we don't need this code.
|
||||
*/
|
||||
if (ByteLength == 7)
|
||||
{
|
||||
Hex = ACPI_CAST_PTR (UINT8, &Value);
|
||||
for (i = 6; i >= 0; i--)
|
||||
{
|
||||
Buffer[i] = *Hex;
|
||||
Hex++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Exit:
|
||||
ACPI_MEMCPY (Buffer, &Value, ByteLength);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtNormalizeBuffer
|
||||
*
|
||||
* PARAMETERS: Buffer - Input buffer
|
||||
* Count - Output the count of hex number in
|
||||
* the Buffer
|
||||
*
|
||||
* RETURN: The normalized buffer, freed by caller
|
||||
*
|
||||
* DESCRIPTION: [1A,2B,3C,4D] or 1A, 2B, 3C, 4D will be normalized
|
||||
* to 1A 2B 3C 4D
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static char *
|
||||
DtNormalizeBuffer (
|
||||
char *Buffer,
|
||||
UINT32 *Count)
|
||||
{
|
||||
char *NewBuffer;
|
||||
char *TmpBuffer;
|
||||
UINT32 BufferCount = 0;
|
||||
BOOLEAN Separator = TRUE;
|
||||
char c;
|
||||
|
||||
|
||||
NewBuffer = UtLocalCalloc (ACPI_STRLEN (Buffer) + 1);
|
||||
TmpBuffer = NewBuffer;
|
||||
|
||||
while ((c = *Buffer++))
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
/* Valid separators */
|
||||
|
||||
case '[':
|
||||
case ']':
|
||||
case ' ':
|
||||
case ',':
|
||||
Separator = TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (Separator)
|
||||
{
|
||||
/* Insert blank as the standard separator */
|
||||
|
||||
if (NewBuffer[0])
|
||||
{
|
||||
*TmpBuffer++ = ' ';
|
||||
BufferCount++;
|
||||
}
|
||||
|
||||
Separator = FALSE;
|
||||
}
|
||||
|
||||
*TmpBuffer++ = c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
*Count = BufferCount + 1;
|
||||
return (NewBuffer);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileBuffer
|
||||
*
|
||||
* PARAMETERS: Buffer - Output buffer
|
||||
* StringValue - Integer list to be compiled
|
||||
* Field - Current field object
|
||||
* ByteLength - Byte length of the integer list
|
||||
*
|
||||
* RETURN: Count of remaining data in the input list
|
||||
*
|
||||
* DESCRIPTION: Compile and pack an integer list, for example
|
||||
* "AA 1F 20 3B" ==> Buffer[] = {0xAA,0x1F,0x20,0x3B}
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
UINT32
|
||||
DtCompileBuffer (
|
||||
UINT8 *Buffer,
|
||||
char *StringValue,
|
||||
DT_FIELD *Field,
|
||||
UINT32 ByteLength)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
char Hex[3];
|
||||
UINT64 Value;
|
||||
UINT32 i;
|
||||
UINT32 Count;
|
||||
|
||||
|
||||
/* Allow several different types of value separators */
|
||||
|
||||
StringValue = DtNormalizeBuffer (StringValue, &Count);
|
||||
|
||||
Hex[2] = 0;
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
/* Each element of StringValue is three chars */
|
||||
|
||||
Hex[0] = StringValue[(3 * i)];
|
||||
Hex[1] = StringValue[(3 * i) + 1];
|
||||
|
||||
/* Convert one hex byte */
|
||||
|
||||
Value = 0;
|
||||
Status = DtStrtoul64 (Hex, &Value);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
DtError (ASL_ERROR, ASL_MSG_BUFFER_ELEMENT, Field, MsgBuffer);
|
||||
return (ByteLength - Count);
|
||||
}
|
||||
|
||||
Buffer[i] = (UINT8) Value;
|
||||
}
|
||||
|
||||
ACPI_FREE (StringValue);
|
||||
return (ByteLength - Count);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileFlag
|
||||
*
|
||||
* PARAMETERS: Buffer - Output buffer
|
||||
* Field - Field to be compiled
|
||||
* Info - Flag info
|
||||
*
|
||||
* RETURN:
|
||||
*
|
||||
* DESCRIPTION: Compile a flag
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtCompileFlag (
|
||||
UINT8 *Buffer,
|
||||
DT_FIELD *Field,
|
||||
ACPI_DMTABLE_INFO *Info)
|
||||
{
|
||||
UINT64 Value = 0;
|
||||
UINT32 BitLength = 1;
|
||||
UINT8 BitPosition = 0;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
Status = DtStrtoul64 (Field->Value, &Value);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
DtError (ASL_ERROR, ASL_MSG_INVALID_HEX_INTEGER, Field, NULL);
|
||||
}
|
||||
|
||||
switch (Info->Opcode)
|
||||
{
|
||||
case ACPI_DMT_FLAG0:
|
||||
case ACPI_DMT_FLAG1:
|
||||
case ACPI_DMT_FLAG2:
|
||||
case ACPI_DMT_FLAG3:
|
||||
case ACPI_DMT_FLAG4:
|
||||
case ACPI_DMT_FLAG5:
|
||||
case ACPI_DMT_FLAG6:
|
||||
case ACPI_DMT_FLAG7:
|
||||
|
||||
BitPosition = Info->Opcode;
|
||||
BitLength = 1;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_FLAGS0:
|
||||
|
||||
BitPosition = 0;
|
||||
BitLength = 2;
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_DMT_FLAGS2:
|
||||
|
||||
BitPosition = 2;
|
||||
BitLength = 2;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
DtFatal (ASL_MSG_COMPILER_INTERNAL, Field, "Invalid flag opcode");
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check range of the input flag value */
|
||||
|
||||
if (Value >= ((UINT64) 1 << BitLength))
|
||||
{
|
||||
sprintf (MsgBuffer, "Maximum %u bit", BitLength);
|
||||
DtError (ASL_ERROR, ASL_MSG_FLAG_VALUE, Field, MsgBuffer);
|
||||
Value = 0;
|
||||
}
|
||||
|
||||
*Buffer |= (UINT8) (Value << BitPosition);
|
||||
}
|
698
sys/contrib/dev/acpica/compiler/dtio.c
Normal file
698
sys/contrib/dev/acpica/compiler/dtio.c
Normal file
@ -0,0 +1,698 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dtio.c - File I/O support for data table compiler
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DTIO_C__
|
||||
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include <contrib/dev/acpica/compiler/dtcompiler.h>
|
||||
|
||||
#define _COMPONENT DT_COMPILER
|
||||
ACPI_MODULE_NAME ("dtio")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static char *
|
||||
DtTrim (
|
||||
char *String);
|
||||
|
||||
static void
|
||||
DtLinkField (
|
||||
DT_FIELD *Field);
|
||||
|
||||
static void
|
||||
DtParseLine (
|
||||
char *LineBuffer,
|
||||
UINT32 Line,
|
||||
UINT32 Offset);
|
||||
|
||||
static UINT32
|
||||
DtGetNextLine (
|
||||
FILE *Handle);
|
||||
|
||||
static void
|
||||
DtWriteBinary (
|
||||
DT_SUBTABLE *Subtable,
|
||||
void *Context,
|
||||
void *ReturnValue);
|
||||
|
||||
|
||||
/* States for DtGetNextLine */
|
||||
|
||||
#define DT_NORMAL_TEXT 0
|
||||
#define DT_START_QUOTED_STRING 1
|
||||
#define DT_START_COMMENT 2
|
||||
#define DT_SLASH_ASTERISK_COMMENT 3
|
||||
#define DT_SLASH_SLASH_COMMENT 4
|
||||
#define DT_END_COMMENT 5
|
||||
|
||||
UINT32 Gbl_NextLineOffset;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtTrim
|
||||
*
|
||||
* PARAMETERS: String - Current source code line to trim
|
||||
*
|
||||
* RETURN: Trimmed line. Must be freed by caller.
|
||||
*
|
||||
* DESCRIPTION: Trim left and right spaces
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static char *
|
||||
DtTrim (
|
||||
char *String)
|
||||
{
|
||||
char *Start;
|
||||
char *End;
|
||||
char *ReturnString;
|
||||
ACPI_SIZE Length;
|
||||
|
||||
|
||||
/* Skip lines that start with a space */
|
||||
|
||||
if (!ACPI_STRCMP (String, " "))
|
||||
{
|
||||
ReturnString = UtLocalCalloc (1);
|
||||
return (ReturnString);
|
||||
}
|
||||
|
||||
/* Setup pointers to start and end of input string */
|
||||
|
||||
Start = String;
|
||||
End = String + ACPI_STRLEN (String) - 1;
|
||||
|
||||
/* Find first non-whitespace character */
|
||||
|
||||
while ((Start <= End) && ((*Start == ' ') || (*Start == '\t')))
|
||||
{
|
||||
Start++;
|
||||
}
|
||||
|
||||
/* Find last non-space character */
|
||||
|
||||
while (End >= Start)
|
||||
{
|
||||
if (*End == '\r' || *End == '\n')
|
||||
{
|
||||
End--;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (*End != ' ')
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
End--;
|
||||
}
|
||||
|
||||
/* Remove any quotes around the string */
|
||||
|
||||
if (*Start == '\"')
|
||||
{
|
||||
Start++;
|
||||
}
|
||||
if (*End == '\"')
|
||||
{
|
||||
End--;
|
||||
}
|
||||
|
||||
/* Create the trimmed return string */
|
||||
|
||||
Length = ACPI_PTR_DIFF (End, Start) + 1;
|
||||
ReturnString = UtLocalCalloc (Length + 1);
|
||||
if (ACPI_STRLEN (Start))
|
||||
{
|
||||
ACPI_STRNCPY (ReturnString, Start, Length);
|
||||
}
|
||||
|
||||
ReturnString[Length] = 0;
|
||||
return (ReturnString);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtLinkField
|
||||
*
|
||||
* PARAMETERS: Field - New field object to link
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Link one field name and value to the list
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static void
|
||||
DtLinkField (
|
||||
DT_FIELD *Field)
|
||||
{
|
||||
DT_FIELD *Prev;
|
||||
DT_FIELD *Next;
|
||||
|
||||
|
||||
Prev = Next = Gbl_FieldList;
|
||||
|
||||
while (Next)
|
||||
{
|
||||
Prev = Next;
|
||||
Next = Next->Next;
|
||||
}
|
||||
|
||||
if (Prev)
|
||||
{
|
||||
Prev->Next = Field;
|
||||
}
|
||||
else
|
||||
{
|
||||
Gbl_FieldList = Field;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtParseLine
|
||||
*
|
||||
* PARAMETERS: LineBuffer - Current source code line
|
||||
* Line - Current line number in the source
|
||||
* Offset - Current byte offset of the line
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Parse one source line
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static void
|
||||
DtParseLine (
|
||||
char *LineBuffer,
|
||||
UINT32 Line,
|
||||
UINT32 Offset)
|
||||
{
|
||||
char *Start;
|
||||
char *End;
|
||||
char *TmpName;
|
||||
char *TmpValue;
|
||||
char *Name;
|
||||
char *Value;
|
||||
char *Colon;
|
||||
UINT32 Length;
|
||||
DT_FIELD *Field;
|
||||
UINT32 Column;
|
||||
UINT32 NameColumn;
|
||||
|
||||
|
||||
if (!LineBuffer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Colon = strchr (LineBuffer, ':');
|
||||
if (!Colon || *(Colon - 1) != ' ')
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Start = LineBuffer;
|
||||
End = Colon;
|
||||
|
||||
while (Start < Colon)
|
||||
{
|
||||
if (*Start == ' ')
|
||||
{
|
||||
Start++;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Found left bracket, go to the right bracket */
|
||||
|
||||
if (*Start == '[')
|
||||
{
|
||||
while (Start < Colon && *Start != ']')
|
||||
{
|
||||
Start++;
|
||||
}
|
||||
|
||||
if (Start == Colon)
|
||||
{
|
||||
MYDEBUG ("ERROR: right bracket reaches colon position\n");
|
||||
break;
|
||||
}
|
||||
|
||||
Start++;
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* There are two column values. One for the field name,
|
||||
* and one for the field value.
|
||||
*/
|
||||
Column = ACPI_PTR_DIFF (Colon, LineBuffer) + 3;
|
||||
NameColumn = ACPI_PTR_DIFF (Start, LineBuffer) + 1;
|
||||
|
||||
Length = ACPI_PTR_DIFF (End, Start);
|
||||
|
||||
TmpName = UtLocalCalloc (Length + 1);
|
||||
ACPI_STRNCPY (TmpName, Start, Length);
|
||||
Name = DtTrim (TmpName);
|
||||
ACPI_FREE (TmpName);
|
||||
|
||||
Start = End = (Colon + 1);
|
||||
|
||||
while (*End)
|
||||
{
|
||||
/* Found left quotation, go to the right quotation and break */
|
||||
|
||||
if (*End == '"')
|
||||
{
|
||||
End++;
|
||||
while (*End && *End != '"')
|
||||
{
|
||||
End++;
|
||||
}
|
||||
|
||||
End++;
|
||||
break;
|
||||
}
|
||||
|
||||
if (*End == '(' ||
|
||||
*End == '<' ||
|
||||
*End == '/')
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
End++;
|
||||
}
|
||||
|
||||
Length = ACPI_PTR_DIFF (End, Start);
|
||||
TmpValue = UtLocalCalloc (Length + 1);
|
||||
ACPI_STRNCPY (TmpValue, Start, Length);
|
||||
Value = DtTrim (TmpValue);
|
||||
ACPI_FREE (TmpValue);
|
||||
|
||||
if (Name && Value)
|
||||
{
|
||||
Field = UtLocalCalloc (sizeof (DT_FIELD));
|
||||
Field->Name = Name;
|
||||
Field->Value = Value;
|
||||
Field->Line = Line;
|
||||
Field->ByteOffset = Offset;
|
||||
Field->NameColumn = NameColumn;
|
||||
Field->Column = Column;
|
||||
|
||||
DtLinkField (Field);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtGetNextLine
|
||||
*
|
||||
* PARAMETERS: Handle - Open file handle for the source file
|
||||
*
|
||||
* RETURN: Filled line buffer and offset of start-of-line (zero on EOF)
|
||||
*
|
||||
* DESCRIPTION: Get the next valid source line. Removes all comments.
|
||||
* Ignores empty lines.
|
||||
*
|
||||
* Handles both slash-asterisk and slash-slash comments.
|
||||
* Also, quoted strings, but no escapes within.
|
||||
*
|
||||
* Line is returned in Gbl_CurrentLineBuffer.
|
||||
* Line number in original file is returned in Gbl_CurrentLineNumber.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static UINT32
|
||||
DtGetNextLine (
|
||||
FILE *Handle)
|
||||
{
|
||||
UINT32 State = DT_NORMAL_TEXT;
|
||||
UINT32 CurrentLineOffset;
|
||||
UINT32 i;
|
||||
char c;
|
||||
|
||||
|
||||
for (i = 0; i < ASL_LINE_BUFFER_SIZE;)
|
||||
{
|
||||
c = (char) getc (Handle);
|
||||
if (c == EOF)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
switch (State)
|
||||
{
|
||||
case DT_NORMAL_TEXT:
|
||||
|
||||
/* Normal text, insert char into line buffer */
|
||||
|
||||
Gbl_CurrentLineBuffer[i] = c;
|
||||
switch (c)
|
||||
{
|
||||
case '/':
|
||||
State = DT_START_COMMENT;
|
||||
break;
|
||||
|
||||
case '"':
|
||||
State = DT_START_QUOTED_STRING;
|
||||
i++;
|
||||
break;
|
||||
|
||||
case '\n':
|
||||
CurrentLineOffset = Gbl_NextLineOffset;
|
||||
Gbl_NextLineOffset = (UINT32) ftell (Handle);
|
||||
Gbl_CurrentLineNumber++;
|
||||
|
||||
/* Exit if line is complete. Ignore blank lines */
|
||||
|
||||
if (i != 0)
|
||||
{
|
||||
Gbl_CurrentLineBuffer[i+1] = 0; /* Terminate line */
|
||||
return (CurrentLineOffset);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case DT_START_QUOTED_STRING:
|
||||
|
||||
/* Insert raw chars until end of quoted string */
|
||||
|
||||
Gbl_CurrentLineBuffer[i] = c;
|
||||
i++;
|
||||
|
||||
if (c == '"')
|
||||
{
|
||||
State = DT_NORMAL_TEXT;
|
||||
}
|
||||
break;
|
||||
|
||||
case DT_START_COMMENT:
|
||||
|
||||
/* Open comment if this character is an asterisk or slash */
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '*':
|
||||
State = DT_SLASH_ASTERISK_COMMENT;
|
||||
break;
|
||||
|
||||
case '/':
|
||||
State = DT_SLASH_SLASH_COMMENT;
|
||||
break;
|
||||
|
||||
default: /* Not a comment */
|
||||
i++; /* Save the preceeding slash */
|
||||
Gbl_CurrentLineBuffer[i] = c;
|
||||
i++;
|
||||
State = DT_NORMAL_TEXT;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case DT_SLASH_ASTERISK_COMMENT:
|
||||
|
||||
/* Ignore chars until an asterisk-slash is found */
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '\n':
|
||||
Gbl_NextLineOffset = (UINT32) ftell (Handle);
|
||||
Gbl_CurrentLineNumber++;
|
||||
break;
|
||||
|
||||
case '*':
|
||||
State = DT_END_COMMENT;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case DT_SLASH_SLASH_COMMENT:
|
||||
|
||||
/* Ignore chars until end-of-line */
|
||||
|
||||
if (c == '\n')
|
||||
{
|
||||
/* We will exit via the NORMAL_TEXT path */
|
||||
|
||||
ungetc (c, Handle);
|
||||
State = DT_NORMAL_TEXT;
|
||||
}
|
||||
break;
|
||||
|
||||
case DT_END_COMMENT:
|
||||
|
||||
/* End comment if this char is a slash */
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '/':
|
||||
State = DT_NORMAL_TEXT;
|
||||
break;
|
||||
|
||||
default:
|
||||
State = DT_SLASH_ASTERISK_COMMENT;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, "Unknown input state");
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
printf ("ERROR - Input line is too long (max %u)\n", ASL_LINE_BUFFER_SIZE);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtScanFile
|
||||
*
|
||||
* PARAMETERS: Handle - Open file handle for the source file
|
||||
*
|
||||
* RETURN: Pointer to start of the constructed parse tree.
|
||||
*
|
||||
* DESCRIPTION: Scan source file, link all field names and values
|
||||
* to the global parse tree: Gbl_FieldList
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
DT_FIELD *
|
||||
DtScanFile (
|
||||
FILE *Handle)
|
||||
{
|
||||
UINT32 Offset;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (DtScanFile);
|
||||
|
||||
|
||||
/* Get the file size */
|
||||
|
||||
Gbl_InputByteCount = DtGetFileSize (Handle);
|
||||
|
||||
Gbl_CurrentLineNumber = 0;
|
||||
Gbl_CurrentLineOffset = 0;
|
||||
Gbl_NextLineOffset = 0;
|
||||
|
||||
/* Scan line-by-line */
|
||||
|
||||
while ((Offset = DtGetNextLine (Handle)))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Line %2.2u/%4.4X - %s",
|
||||
Gbl_CurrentLineNumber, Offset, Gbl_CurrentLineBuffer));
|
||||
|
||||
DtParseLine (Gbl_CurrentLineBuffer, Gbl_CurrentLineNumber, Offset);
|
||||
}
|
||||
|
||||
return (Gbl_FieldList);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Output functions
|
||||
*/
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtWriteBinary
|
||||
*
|
||||
* PARAMETERS: DT_WALK_CALLBACK
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Write one subtable of a binary ACPI table
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static void
|
||||
DtWriteBinary (
|
||||
DT_SUBTABLE *Subtable,
|
||||
void *Context,
|
||||
void *ReturnValue)
|
||||
{
|
||||
|
||||
FlWriteFile (ASL_FILE_AML_OUTPUT, Subtable->Buffer, Subtable->Length);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtOutputBinary
|
||||
*
|
||||
* PARAMETERS:
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Write entire binary ACPI table (result of compilation)
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtOutputBinary (
|
||||
DT_SUBTABLE *RootTable)
|
||||
{
|
||||
|
||||
if (!RootTable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Walk the entire parse tree, emitting the binary data */
|
||||
|
||||
DtWalkTableTree (RootTable, DtWriteBinary, NULL, NULL);
|
||||
Gbl_TableLength = DtGetFileSize (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
|
||||
}
|
400
sys/contrib/dev/acpica/compiler/dtsubtable.c
Normal file
400
sys/contrib/dev/acpica/compiler/dtsubtable.c
Normal file
@ -0,0 +1,400 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dtsubtable.c - handling of subtables within ACPI tables
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DTSUBTABLE_C__
|
||||
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include <contrib/dev/acpica/compiler/dtcompiler.h>
|
||||
|
||||
#define _COMPONENT DT_COMPILER
|
||||
ACPI_MODULE_NAME ("dtsubtable")
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCreateSubtable
|
||||
*
|
||||
* PARAMETERS: Buffer - Input buffer
|
||||
* Length - Buffer length
|
||||
* RetSubtable - Returned newly created subtable
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Create a subtable that is not listed with ACPI_DMTABLE_INFO
|
||||
* For example, FACS has 24 bytes reserved at the end
|
||||
* and it's not listed at AcpiDmTableInfoFacs
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtCreateSubtable (
|
||||
UINT8 *Buffer,
|
||||
UINT32 Length,
|
||||
DT_SUBTABLE **RetSubtable)
|
||||
{
|
||||
DT_SUBTABLE *Subtable;
|
||||
|
||||
|
||||
Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE));
|
||||
|
||||
/* Create a new buffer for the subtable data */
|
||||
|
||||
Subtable->Buffer = UtLocalCalloc (Length);
|
||||
ACPI_MEMCPY (Subtable->Buffer, Buffer, Length);
|
||||
|
||||
Subtable->Length = Length;
|
||||
Subtable->TotalLength = Length;
|
||||
|
||||
*RetSubtable = Subtable;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtInsertSubtable
|
||||
*
|
||||
* PARAMETERS: ParentTable - The Parent of the new subtable
|
||||
* Subtable - The new subtable to insert
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Insert the new subtable to the parent table
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtInsertSubtable (
|
||||
DT_SUBTABLE *ParentTable,
|
||||
DT_SUBTABLE *Subtable)
|
||||
{
|
||||
DT_SUBTABLE *ChildTable;
|
||||
|
||||
|
||||
Subtable->Peer = NULL;
|
||||
Subtable->Parent = ParentTable;
|
||||
|
||||
/* Link the new entry into the child list */
|
||||
|
||||
if (!ParentTable->Child)
|
||||
{
|
||||
ParentTable->Child = Subtable;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Walk to the end of the child list */
|
||||
|
||||
ChildTable = ParentTable->Child;
|
||||
while (ChildTable->Peer)
|
||||
{
|
||||
ChildTable = ChildTable->Peer;
|
||||
}
|
||||
|
||||
/* Add new subtable at the end of the child list */
|
||||
|
||||
ChildTable->Peer = Subtable;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtPushSubtable
|
||||
*
|
||||
* PARAMETERS: Subtable - Subtable to push
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Push a subtable onto a subtable stack
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtPushSubtable (
|
||||
DT_SUBTABLE *Subtable)
|
||||
{
|
||||
|
||||
Subtable->StackTop = Gbl_SubtableStack;
|
||||
Gbl_SubtableStack = Subtable;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtPopSubtable
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Pop a subtable from a subtable stack. Uses global SubtableStack
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtPopSubtable (
|
||||
void)
|
||||
{
|
||||
DT_SUBTABLE *Subtable;
|
||||
|
||||
|
||||
Subtable = Gbl_SubtableStack;
|
||||
|
||||
if (Subtable)
|
||||
{
|
||||
Gbl_SubtableStack = Subtable->StackTop;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtPeekSubtable
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: The subtable on top of stack
|
||||
*
|
||||
* DESCRIPTION: Get the subtable on top of stack
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
DT_SUBTABLE *
|
||||
DtPeekSubtable (
|
||||
void)
|
||||
{
|
||||
|
||||
return (Gbl_SubtableStack);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtGetNextSubtable
|
||||
*
|
||||
* PARAMETERS: ParentTable - Parent table whose children we are
|
||||
* getting
|
||||
* ChildTable - Previous child that was found.
|
||||
* The NEXT child will be returned
|
||||
*
|
||||
* RETURN: Pointer to the NEXT child or NULL if none is found.
|
||||
*
|
||||
* DESCRIPTION: Return the next peer subtable within the tree.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
DT_SUBTABLE *
|
||||
DtGetNextSubtable (
|
||||
DT_SUBTABLE *ParentTable,
|
||||
DT_SUBTABLE *ChildTable)
|
||||
{
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
|
||||
|
||||
if (!ChildTable)
|
||||
{
|
||||
/* It's really the parent's _scope_ that we want */
|
||||
|
||||
return (ParentTable->Child);
|
||||
}
|
||||
|
||||
/* Otherwise just return the next peer (NULL if at end-of-list) */
|
||||
|
||||
return (ChildTable->Peer);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtGetParentSubtable
|
||||
*
|
||||
* PARAMETERS: Subtable - Current subtable
|
||||
*
|
||||
* RETURN: Parent of the given subtable
|
||||
*
|
||||
* DESCRIPTION: Get the parent of the given subtable in the tree
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
DT_SUBTABLE *
|
||||
DtGetParentSubtable (
|
||||
DT_SUBTABLE *Subtable)
|
||||
{
|
||||
|
||||
if (!Subtable)
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
return (Subtable->Parent);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtGetSubtableLength
|
||||
*
|
||||
* PARAMETERS: Field - Current field list pointer
|
||||
* Info - Data table info
|
||||
*
|
||||
* RETURN: Subtable length
|
||||
*
|
||||
* DESCRIPTION: Get length of bytes needed to compile the subtable
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
UINT32
|
||||
DtGetSubtableLength (
|
||||
DT_FIELD *Field,
|
||||
ACPI_DMTABLE_INFO *Info)
|
||||
{
|
||||
UINT32 ByteLength = 0;
|
||||
|
||||
|
||||
/* Walk entire Info table; Null name terminates */
|
||||
|
||||
for (; Info->Name; Info++)
|
||||
{
|
||||
ByteLength += DtGetFieldLength (Field, Info);
|
||||
}
|
||||
|
||||
return (ByteLength);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtSetSubtableLength
|
||||
*
|
||||
* PARAMETERS: Subtable - Subtable
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Set length of the subtable into its length field
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtSetSubtableLength (
|
||||
DT_SUBTABLE *Subtable)
|
||||
{
|
||||
|
||||
if (!Subtable->LengthField)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ACPI_MEMCPY (Subtable->LengthField, &Subtable->TotalLength,
|
||||
Subtable->SizeOfLengthField);
|
||||
}
|
1409
sys/contrib/dev/acpica/compiler/dttable.c
Normal file
1409
sys/contrib/dev/acpica/compiler/dttable.c
Normal file
File diff suppressed because it is too large
Load Diff
445
sys/contrib/dev/acpica/compiler/dttemplate.c
Normal file
445
sys/contrib/dev/acpica/compiler/dttemplate.c
Normal file
@ -0,0 +1,445 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dttemplate - ACPI table template generation
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include <contrib/dev/acpica/include/acapps.h>
|
||||
#include <contrib/dev/acpica/compiler/dtcompiler.h>
|
||||
#include <contrib/dev/acpica/compiler/dttemplate.h> /* Contains the hex ACPI table templates */
|
||||
|
||||
#define _COMPONENT DT_COMPILER
|
||||
ACPI_MODULE_NAME ("dttemplate")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static BOOLEAN
|
||||
AcpiUtIsSpecialTable (
|
||||
char *Signature);
|
||||
|
||||
static ACPI_STATUS
|
||||
DtCreateOneTemplate (
|
||||
char *Signature,
|
||||
ACPI_DMTABLE_DATA *TableData);
|
||||
|
||||
static ACPI_STATUS
|
||||
DtCreateAllTemplates (
|
||||
void);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtIsSpecialTable
|
||||
*
|
||||
* PARAMETERS: Signature - ACPI table signature
|
||||
*
|
||||
* RETURN: TRUE if signature is a special ACPI table
|
||||
*
|
||||
* DESCRIPTION: Check for valid ACPI tables that are not in the main ACPI
|
||||
* table data structure (AcpiDmTableData).
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static BOOLEAN
|
||||
AcpiUtIsSpecialTable (
|
||||
char *Signature)
|
||||
{
|
||||
|
||||
if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_DSDT) ||
|
||||
ACPI_COMPARE_NAME (Signature, ACPI_SIG_SSDT) ||
|
||||
ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS) ||
|
||||
ACPI_COMPARE_NAME (Signature, ACPI_RSDP_NAME))
|
||||
{
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCreateTemplates
|
||||
*
|
||||
* PARAMETERS: Signature - ACPI table signature
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Create one or more template files.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
DtCreateTemplates (
|
||||
char *Signature)
|
||||
{
|
||||
ACPI_DMTABLE_DATA *TableData;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
AslInitializeGlobals ();
|
||||
AcpiUtStrupr (Signature);
|
||||
|
||||
/* Create all known templates if requested */
|
||||
|
||||
if (!ACPI_STRNCMP (Signature, "ALL", 3))
|
||||
{
|
||||
Status = DtCreateAllTemplates ();
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Validate signature and get the template data:
|
||||
* 1) Signature must be 4 characters
|
||||
* 2) Signature must be a recognized ACPI table
|
||||
* 3) There must be a template associated with the signature
|
||||
*/
|
||||
if (strlen (Signature) != ACPI_NAME_SIZE)
|
||||
{
|
||||
fprintf (stderr, "%s, Invalid ACPI table signature\n", Signature);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* Some slack for the two strange tables whose name is different than
|
||||
* their signatures: MADT->APIC and FADT->FACP.
|
||||
*/
|
||||
if (!strcmp (Signature, "MADT"))
|
||||
{
|
||||
Signature = "APIC";
|
||||
}
|
||||
else if (!strcmp (Signature, "FADT"))
|
||||
{
|
||||
Signature = "FACP";
|
||||
}
|
||||
|
||||
TableData = AcpiDmGetTableData (Signature);
|
||||
if (TableData)
|
||||
{
|
||||
if (!TableData->Template)
|
||||
{
|
||||
fprintf (stderr, "%4.4s, No template available\n", Signature);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
}
|
||||
else if (!AcpiUtIsSpecialTable (Signature))
|
||||
{
|
||||
fprintf (stderr,
|
||||
"%4.4s, Unrecognized ACPI table signature\n", Signature);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
Status = AdInitialize ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Status = DtCreateOneTemplate (Signature, TableData);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCreateAllTemplates
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Create all currently defined template files
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
DtCreateAllTemplates (
|
||||
void)
|
||||
{
|
||||
ACPI_DMTABLE_DATA *TableData;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
Status = AdInitialize ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
fprintf (stderr, "Creating all supported Template files\n");
|
||||
|
||||
/* Walk entire ACPI table data structure */
|
||||
|
||||
for (TableData = AcpiDmTableData; TableData->Signature; TableData++)
|
||||
{
|
||||
/* If table has a template, create the template file */
|
||||
|
||||
if (TableData->Template)
|
||||
{
|
||||
Status = DtCreateOneTemplate (TableData->Signature,
|
||||
TableData);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Create the "special ACPI tables:
|
||||
* 1) DSDT/SSDT are AML tables, not data tables
|
||||
* 2) FACS and RSDP have non-standard headers
|
||||
*/
|
||||
Status = DtCreateOneTemplate (ACPI_SIG_DSDT, NULL);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Status = DtCreateOneTemplate (ACPI_SIG_SSDT, NULL);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Status = DtCreateOneTemplate (ACPI_SIG_FACS, NULL);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Status = DtCreateOneTemplate (ACPI_RSDP_NAME, NULL);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCreateOneTemplate
|
||||
*
|
||||
* PARAMETERS: Signature - ACPI signature, NULL terminated.
|
||||
* TableData - Entry in ACPI table data structure.
|
||||
* NULL if a special ACPI table.
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Create one template source file for the requested ACPI table.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
DtCreateOneTemplate (
|
||||
char *Signature,
|
||||
ACPI_DMTABLE_DATA *TableData)
|
||||
{
|
||||
char *DisasmFilename;
|
||||
FILE *File;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
|
||||
|
||||
/* New file will have a .asl suffix */
|
||||
|
||||
DisasmFilename = FlGenerateFilename (
|
||||
Signature, FILE_SUFFIX_ASL_CODE);
|
||||
if (!DisasmFilename)
|
||||
{
|
||||
fprintf (stderr, "Could not generate output filename\n");
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Probably should prompt to overwrite the file */
|
||||
|
||||
AcpiUtStrlwr (DisasmFilename);
|
||||
File = fopen (DisasmFilename, "w+");
|
||||
if (!File)
|
||||
{
|
||||
fprintf (stderr, "Could not open output file %s\n", DisasmFilename);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Emit the common file header */
|
||||
|
||||
AcpiOsRedirectOutput (File);
|
||||
|
||||
AcpiOsPrintf ("/*\n * %s\n", IntelAcpiCA);
|
||||
AcpiOsPrintf (" * iASL Compiler/Disassembler version %8.8X\n *\n",
|
||||
ACPI_CA_VERSION);
|
||||
AcpiOsPrintf (" * Template for [%4.4s] ACPI Table\n",
|
||||
Signature);
|
||||
|
||||
/* Dump the actual ACPI table */
|
||||
|
||||
if (TableData)
|
||||
{
|
||||
/* Normal case, tables that appear in AcpiDmTableData */
|
||||
|
||||
if (Gbl_VerboseTemplates)
|
||||
{
|
||||
AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength]"
|
||||
" FieldName : HexFieldValue\n */\n\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf (" * Format: [ByteLength]"
|
||||
" FieldName : HexFieldValue\n */\n\n");
|
||||
}
|
||||
|
||||
AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER,
|
||||
TableData->Template));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Special ACPI tables - DSDT, SSDT, FACS, RSDP */
|
||||
|
||||
AcpiOsPrintf (" */\n\n");
|
||||
if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_DSDT))
|
||||
{
|
||||
fwrite (TemplateDsdt, sizeof (TemplateDsdt) -1, 1, File);
|
||||
}
|
||||
else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_SSDT))
|
||||
{
|
||||
fwrite (TemplateSsdt, sizeof (TemplateSsdt) -1, 1, File);
|
||||
}
|
||||
else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS))
|
||||
{
|
||||
AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER,
|
||||
TemplateFacs));
|
||||
}
|
||||
else if (ACPI_COMPARE_NAME (Signature, ACPI_RSDP_NAME))
|
||||
{
|
||||
AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER,
|
||||
TemplateRsdp));
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf (stderr,
|
||||
"%4.4s, Unrecognized ACPI table signature\n", Signature);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
fprintf (stderr,
|
||||
"Created ACPI table template for [%4.4s], written to \"%s\"\n",
|
||||
Signature, DisasmFilename);
|
||||
|
||||
fclose (File);
|
||||
AcpiOsRedirectOutput (stdout);
|
||||
ACPI_FREE (DisasmFilename);
|
||||
return (Status);
|
||||
}
|
757
sys/contrib/dev/acpica/compiler/dttemplate.h
Normal file
757
sys/contrib/dev/acpica/compiler/dttemplate.h
Normal file
@ -0,0 +1,757 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dttemplate.h - ACPI table template definitions
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __DTTEMPLATE_H
|
||||
#define __DTTEMPLATE_H
|
||||
|
||||
|
||||
/* Special templates for DSDT and SSDT (AML byte-code tables) */
|
||||
|
||||
const char TemplateDsdt[] =
|
||||
"DefinitionBlock (\"dsdt.aml\", \"DSDT\", 2, \"Intel\", \"Template\", 0x00000001)\n"
|
||||
"{\n"
|
||||
" Method (MAIN, 0, NotSerialized)\n"
|
||||
" {\n"
|
||||
" Return (Zero)\n"
|
||||
" }\n"
|
||||
"}\n\n";
|
||||
|
||||
const char TemplateSsdt[] =
|
||||
"DefinitionBlock (\"ssdt.aml\", \"SSDT\", 2, \"Intel\", \"Template\", 0x00000001)\n"
|
||||
"{\n"
|
||||
" Method (MAIN, 0, NotSerialized)\n"
|
||||
" {\n"
|
||||
" Return (Zero)\n"
|
||||
" }\n"
|
||||
"}\n\n";
|
||||
|
||||
|
||||
/* Templates for ACPI data tables */
|
||||
|
||||
const unsigned char TemplateAsf[] =
|
||||
{
|
||||
0x41,0x53,0x46,0x21,0x72,0x00,0x00,0x00, /* 00000000 "ASF!r..." */
|
||||
0x10,0x0B,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x10,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x14,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x01,0x0C,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x02,0x00,0x0C,0x00,0x01,0x04,0x00,0x00, /* 00000048 "........" */
|
||||
0x00,0x00,0x00,0x00,0x03,0x00,0x17,0x00, /* 00000050 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
|
||||
0x00,0x00,0x00,0x84,0x00,0x07,0x00,0x00, /* 00000068 "........" */
|
||||
0x01,0x00 /* 00000070 ".." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateBert[] =
|
||||
{
|
||||
0x42,0x45,0x52,0x54,0x30,0x00,0x00,0x00, /* 00000000 "BERT0..." */
|
||||
0x01,0x15,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000028 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateBoot[] =
|
||||
{
|
||||
0x42,0x4F,0x4F,0x54,0x28,0x00,0x00,0x00, /* 00000000 "BOOT(..." */
|
||||
0x01,0x0D,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x00,0x00,0x04,0x06,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00 /* 00000020 "(.. ...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateCpep[] =
|
||||
{
|
||||
0x43,0x50,0x45,0x50,0x34,0x00,0x00,0x00, /* 00000000 "CPEP4..." */
|
||||
0x01,0x0F,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00 /* 00000030 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateDbgp[] =
|
||||
{
|
||||
0x44,0x42,0x47,0x50,0x34,0x00,0x00,0x00, /* 00000000 "DBGP4..." */
|
||||
0x01,0x1A,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00 /* 00000030 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateDmar[] =
|
||||
{
|
||||
0x44,0x4D,0x41,0x52,0x8C,0x00,0x00,0x00, /* 00000000 "DMAR...." */
|
||||
0x01,0x15,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x2F,0x01,0x00,0x00, /* 00000020 "(.. /..." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x18,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x02,0xFD,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x03,0x08,0x00,0x00,0x08,0xF0,0x1F,0x07, /* 00000040 "........" */
|
||||
0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* 00000048 ".. ....." */
|
||||
0x00,0x10,0xC2,0x78,0x00,0x00,0x00,0x00, /* 00000050 "...x...." */
|
||||
0xFF,0x3F,0xC2,0x78,0x00,0x00,0x00,0x00, /* 00000058 ".?.x...." */
|
||||
0x01,0x08,0x00,0x00,0x00,0x00,0x1D,0x00, /* 00000060 "........" */
|
||||
0x02,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x02,0x08,0x00,0x00,0x00,0x00,0x01,0x00, /* 00000070 "........" */
|
||||
0x03,0x00,0x14,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x02,0xFD,0x00,0x00,0x00,0x00, /* 00000080 "........" */
|
||||
0x00,0x00,0x00,0x00 /* 00000088 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateEcdt[] =
|
||||
{
|
||||
0x45,0x43,0x44,0x54,0x42,0x00,0x00,0x00, /* 00000000 "ECDTB..." */
|
||||
0x01,0x2D,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".-INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x01,0x08,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x66,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "f......." */
|
||||
0x01,0x08,0x00,0x00,0x62,0x00,0x00,0x00, /* 00000030 "....b..." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x09,0x00 /* 00000040 ".." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateEinj[] =
|
||||
{
|
||||
0x45,0x49,0x4E,0x4A,0x30,0x01,0x00,0x00, /* 00000000 "EINJ0..." */
|
||||
0x01,0x09,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x30,0x00,0x00,0x00, /* 00000020 "(.. 0..." */
|
||||
0x00,0x00,0x00,0x00,0x0A,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000030 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000048 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000050 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000068 "........" */
|
||||
0x02,0x02,0x01,0x00,0x00,0x40,0x00,0x04, /* 00000070 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000088 "........" */
|
||||
0x03,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000090 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000A8 "........" */
|
||||
0x04,0x03,0x01,0x00,0x00,0x40,0x00,0x04, /* 000000B0 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000C8 "........" */
|
||||
0x05,0x03,0x01,0x00,0x01,0x10,0x00,0x02, /* 000000D0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000E8 "........" */
|
||||
0x06,0x01,0x00,0x00,0x00,0x40,0x00,0x04, /* 000000F0 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000108 "........" */
|
||||
0x07,0x00,0x01,0x00,0x00,0x40,0x00,0x04, /* 00000110 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF /* 00000128 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateErst[] =
|
||||
{
|
||||
0x45,0x52,0x53,0x54,0x30,0x02,0x00,0x00, /* 00000000 "ERST0..." */
|
||||
0x01,0xAB,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x30,0x00,0x00,0x00, /* 00000020 "(.. 0..." */
|
||||
0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x03,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000030 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000048 "........" */
|
||||
0x01,0x03,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000050 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000068 "........" */
|
||||
0x02,0x03,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000070 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000088 "........" */
|
||||
0x03,0x04,0x01,0x00,0x00,0x40,0x00,0x04, /* 00000090 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000A8 "........" */
|
||||
0x04,0x02,0x00,0x00,0x00,0x40,0x00,0x04, /* 000000B0 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000C8 "........" */
|
||||
0x05,0x03,0x00,0x00,0x01,0x08,0x00,0x01, /* 000000D0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000000E8 "........" */
|
||||
0x06,0x01,0x00,0x00,0x00,0x40,0x00,0x04, /* 000000F0 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000108 "........" */
|
||||
0x07,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000110 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000128 "........" */
|
||||
0x08,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000130 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000148 "........" */
|
||||
0x09,0x02,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000150 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000168 "........" */
|
||||
0x0A,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000170 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000178 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000180 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000188 "........" */
|
||||
0x0B,0x03,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000190 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000198 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001A0 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000001A8 "........" */
|
||||
0x0C,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 000001B0 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001B8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C0 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000001C8 "........" */
|
||||
0x0D,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 000001D0 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001D8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001E0 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 000001E8 "........" */
|
||||
0x0E,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 000001F0 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001F8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000200 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000208 "........" */
|
||||
0x0F,0x00,0x00,0x00,0x00,0x40,0x00,0x04, /* 00000210 ".....@.." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000218 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000220 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF /* 00000228 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateFacs[] =
|
||||
{
|
||||
0x46,0x41,0x43,0x53,0x40,0x00,0x00,0x00, /* 00000000 "FACS@..." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000008 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000010 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000018 "........" */
|
||||
0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000020 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000038 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateFadt[] =
|
||||
{
|
||||
0x46,0x41,0x43,0x50,0xF4,0x00,0x00,0x00, /* 00000000 "FACP...." */
|
||||
0x04,0x4E,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".NINTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x01,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000048 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
|
||||
0x04,0x02,0x01,0x04,0x08,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01, /* 00000070 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000080 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000088 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x20,0x00,0x02, /* 00000090 "..... .." */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x10,0x00,0x02, /* 000000A8 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x00, /* 000000C0 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */
|
||||
0x01,0x20,0x00,0x03,0x01,0x00,0x00,0x00, /* 000000D0 ". ......" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x01, /* 000000D8 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */
|
||||
0x00,0x00,0x00,0x00 /* 000000F0 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateHest[] =
|
||||
{
|
||||
0x48,0x45,0x53,0x54,0xD4,0x01,0x00,0x00, /* 00000000 "HEST...." */
|
||||
0x01,0x20,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ". INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x04,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, /* 00000028 "........" */
|
||||
0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
|
||||
0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x01, /* 00000088 "........" */
|
||||
0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000090 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 000000B0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000D0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */
|
||||
0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x01, /* 000000F0 "........" */
|
||||
0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000F8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "........" */
|
||||
0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00, /* 00000118 "........" */
|
||||
0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00, /* 00000120 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */
|
||||
0x00,0x00,0x00,0x00,0x09,0x00,0x02,0x00, /* 00000150 "........" */
|
||||
0xFF,0xFF,0x00,0x01,0x01,0x00,0x00,0x00, /* 00000158 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x10,0x00,0x00, /* 00000160 "........" */
|
||||
0x00,0x40,0x00,0x04,0x00,0x00,0x00,0x00, /* 00000168 ".@......" */
|
||||
0x00,0x00,0x00,0x00,0x03,0x1C,0x00,0x00, /* 00000170 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000178 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000180 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000188 "........" */
|
||||
0x00,0x10,0x00,0x00,0x09,0x00,0x03,0x00, /* 00000190 "........" */
|
||||
0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00, /* 00000198 "........" */
|
||||
0x01,0x00,0x00,0x00,0x00,0x10,0x00,0x00, /* 000001A0 "........" */
|
||||
0x00,0x40,0x00,0x04,0x00,0x00,0x00,0x00, /* 000001A8 ".@......" */
|
||||
0x00,0x00,0x00,0x00,0x04,0x1C,0x00,0x00, /* 000001B0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001B8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000001C8 "........" */
|
||||
0x00,0x10,0x00,0x00 /* 000001D0 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateHpet[] =
|
||||
{
|
||||
0x48,0x50,0x45,0x54,0x38,0x00,0x00,0x00, /* 00000000 "HPET8..." */
|
||||
0x01,0x09,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000030 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateIvrs[] =
|
||||
{
|
||||
0x49,0x56,0x52,0x53,0xBC,0x00,0x00,0x00, /* 00000000 "IVRS...." */
|
||||
0x01,0x87,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x10,0x14,0x34,0x00,0x00,0x00,0x00,0x00, /* 00000030 "..4....." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00, /* 00000048 "....@..." */
|
||||
0x00,0x00,0x00,0x00,0x42,0x00,0x00,0x00, /* 00000050 "....B..." */
|
||||
0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00, /* 00000058 "....H..." */
|
||||
0x00,0x00,0x00,0x00,0x20,0x08,0x20,0x00, /* 00000060 ".... . ." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x21,0x04,0x20,0x00, /* 00000080 "....!. ." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
|
||||
0x00,0x00,0x00,0x00,0x10,0x14,0x18,0x00, /* 000000A0 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */
|
||||
0x00,0x00,0x00,0x00 /* 000000B8 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateMadt[] =
|
||||
{
|
||||
0x41,0x50,0x49,0x43,0xB6,0x00,0x00,0x00, /* 00000000 "APIC...." */
|
||||
0x01,0x45,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".EINTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x01,0x00,0x00,0x00,0x00,0x08,0x00,0x00, /* 00000028 "........" */
|
||||
0x01,0x00,0x00,0x00,0x01,0x0C,0x01,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x02,0x0A,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x00,0x00,0x03,0x08,0x0D,0x00,0x01,0x00, /* 00000048 "........" */
|
||||
0x00,0x00,0x04,0x06,0x00,0x05,0x00,0x01, /* 00000050 "........" */
|
||||
0x05,0x0C,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00,0x06,0x10,0x00,0x00, /* 00000060 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x00,0x00,0x00,0x00,0x07,0x16,0x00,0x00, /* 00000070 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x5C,0x43,0x50,0x55, /* 00000080 "....\CPU" */
|
||||
0x30,0x00,0x08,0x10,0x05,0x00,0x00,0x00, /* 00000088 "0......." */
|
||||
0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00, /* 00000090 "........" */
|
||||
0x00,0x00,0x09,0x10,0x00,0x00,0x00,0x00, /* 00000098 "........" */
|
||||
0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
|
||||
0x00,0x00,0x0A,0x0C,0x05,0x00,0x00,0x00, /* 000000A8 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00 /* 000000B0 "......" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateMcfg[] =
|
||||
{
|
||||
0x4D,0x43,0x46,0x47,0x3C,0x00,0x00,0x00, /* 00000000 "MCFG<..." */
|
||||
0x01,0x19,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00 /* 00000038 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateMchi[] =
|
||||
{
|
||||
0x4D,0x43,0x48,0x49,0x45,0x00,0x00,0x00, /* 00000000 "MCHIE..." */
|
||||
0x01,0xE4,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x15,0x07,0x00,0x02,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x01,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x02,0x08,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00 /* 00000040 "....." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateMsct[] =
|
||||
{
|
||||
0x4D,0x53,0x43,0x54,0x90,0x00,0x00,0x00, /* 00000000 "MSCT...." */
|
||||
0x01,0xB7,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x38,0x00,0x00,0x00, /* 00000020 "(.. 8..." */
|
||||
0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0x00,0x00, /* 00000030 "........" */
|
||||
0x01,0x16,0x00,0x00,0x00,0x00,0x03,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x00,0x00,0x40,0x00,0x00,0x00,0x01,0x16, /* 00000048 "..@....." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x16,0x00,0x00, /* 00000060 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
|
||||
0x00,0x00,0x01,0x16,0x00,0x00,0x00,0x00, /* 00000078 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000088 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateRsdp[] =
|
||||
{
|
||||
0x52,0x53,0x44,0x20,0x50,0x54,0x52,0x20, /* 00000000 "RSD PTR " */
|
||||
0x43,0x49,0x4E,0x54,0x45,0x4C,0x20,0x02, /* 00000008 "CINTEL ." */
|
||||
0x00,0x00,0x00,0x00,0x24,0x00,0x00,0x00, /* 00000010 "....$..." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000018 "........" */
|
||||
0xDC,0x00,0x00,0x00 /* 00000020 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateRsdt[] =
|
||||
{
|
||||
0x52,0x53,0x44,0x54,0x44,0x00,0x00,0x00, /* 00000000 "RSDTD..." */
|
||||
0x01,0xB1,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x10,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x20,0x00,0x00,0x00,0x30,0x00,0x00,0x00, /* 00000028 " ...0..." */
|
||||
0x40,0x00,0x00,0x00,0x50,0x00,0x00,0x00, /* 00000030 "@...P..." */
|
||||
0x60,0x00,0x00,0x00,0x70,0x00,0x00,0x00, /* 00000038 "`...p..." */
|
||||
0x80,0x00,0x00,0x00 /* 00000040 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateSbst[] =
|
||||
{
|
||||
0x53,0x42,0x53,0x54,0x30,0x00,0x00,0x00, /* 00000000 "SBST0..." */
|
||||
0x01,0x06,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000028 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateSlit[] =
|
||||
{
|
||||
0x53,0x4C,0x49,0x54,0x3C,0x00,0x00,0x00, /* 00000000 "SLIT<..." */
|
||||
0x01,0x1B,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x04,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x0A,0x0F,0x0F,0x0F, /* 00000028 "........" */
|
||||
0x0F,0x0A,0x0F,0x0F,0x0F,0x0F,0x0A,0x0F, /* 00000030 "........" */
|
||||
0x0F,0x0F,0x0F,0x0A /* 00000038 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateSpcr[] =
|
||||
{
|
||||
0x53,0x50,0x43,0x52,0x50,0x00,0x00,0x00, /* 00000000 "SPCRP..." */
|
||||
0x01,0xE3,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000048 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateSpmi[] =
|
||||
{
|
||||
0x53,0x50,0x4D,0x49,0x41,0x00,0x00,0x00, /* 00000000 "SPMIA..." */
|
||||
0x04,0xED,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x08,0x00,0x01,0x00,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00 /* 00000040 "." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateSrat[] =
|
||||
{
|
||||
0x53,0x52,0x41,0x54,0x80,0x00,0x00,0x00, /* 00000000 "SRAT...." */
|
||||
0x03,0x5A,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".ZINTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x01,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x10,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x01,0x28,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 ".(......" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */
|
||||
0x00,0xFC,0x09,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
|
||||
0x02,0x18,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000070 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000078 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateTcpa[] =
|
||||
{
|
||||
0x54,0x43,0x50,0x41,0x32,0x00,0x00,0x00, /* 00000000 "TCPA2..." */
|
||||
0x01,0x67,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".gINTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x80,0x31,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 ".1..INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00 /* 00000030 ".." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateUefi[] =
|
||||
{
|
||||
0x55,0x45,0x46,0x49,0x36,0x00,0x00,0x00, /* 00000000 "UEFI6..." */
|
||||
0x01,0x9B,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x01,0x02,0x03, /* 00000020 "(.. ...." */
|
||||
0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B, /* 00000028 "........" */
|
||||
0x0C,0x0D,0x0E,0x0F,0x00,0x00 /* 00000030 "......" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateWaet[] =
|
||||
{
|
||||
0x57,0x41,0x45,0x54,0x28,0x00,0x00,0x00, /* 00000000 "WAET(..." */
|
||||
0x01,0x19,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00 /* 00000020 "(.. ...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateWdat[] =
|
||||
{
|
||||
0x57,0x44,0x41,0x54,0x5C,0x00,0x00,0x00, /* 00000000 "WDAT\..." */
|
||||
0x01,0xE3,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x20,0x00,0x00,0x00, /* 00000020 "(.. ..." */
|
||||
0xFF,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x58,0x02,0x00,0x00,0xFF,0x03,0x00,0x00, /* 00000030 "X......." */
|
||||
0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x0E,0x00,0x00,0x00,0x01,0x02,0x00,0x00, /* 00000040 "........" */
|
||||
0x01,0x10,0x00,0x02,0x60,0x04,0x00,0x00, /* 00000048 "....`..." */
|
||||
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000050 "........" */
|
||||
0x01,0x00,0x00,0x00 /* 00000058 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateWddt[] =
|
||||
{
|
||||
0x57,0x44,0x44,0x54,0x40,0x00,0x00,0x00, /* 00000000 "WDDT@..." */
|
||||
0x01,0x00,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x01,0xFF,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000038 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateWdrt[] =
|
||||
{
|
||||
0x57,0x44,0x52,0x54,0x47,0x00,0x00,0x00, /* 00000000 "WDRTG..." */
|
||||
0x01,0xB0,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x00,0x20,0x00,0x00, /* 00000020 "(.. . .." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 ". ......" */
|
||||
0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00,0xFF,0xFF,0x00 /* 00000040 "......." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateXsdt[] =
|
||||
{
|
||||
0x58,0x53,0x44,0x54,0x64,0x00,0x00,0x00, /* 00000000 "XSDTd..." */
|
||||
0x01,0x8B,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x28,0x05,0x10,0x20,0x10,0x00,0x00,0x00, /* 00000020 "(.. ...." */
|
||||
0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00, /* 00000028 ".... ..." */
|
||||
0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00, /* 00000030 "....0..." */
|
||||
0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00, /* 00000038 "....@..." */
|
||||
0x00,0x00,0x00,0x00,0x50,0x00,0x00,0x00, /* 00000040 "....P..." */
|
||||
0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00, /* 00000048 "....`..." */
|
||||
0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00, /* 00000050 "....p..." */
|
||||
0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00, /* 00000058 "........" */
|
||||
0x00,0x00,0x00,0x00 /* 00000060 "...." */
|
||||
};
|
||||
|
||||
#endif
|
902
sys/contrib/dev/acpica/compiler/dtutils.c
Normal file
902
sys/contrib/dev/acpica/compiler/dtutils.c
Normal file
@ -0,0 +1,902 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dtutils.c - Utility routines for the data table compiler
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DTUTILS_C__
|
||||
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include <contrib/dev/acpica/compiler/dtcompiler.h>
|
||||
#include <contrib/dev/acpica/include/actables.h>
|
||||
|
||||
#define _COMPONENT DT_COMPILER
|
||||
ACPI_MODULE_NAME ("dtutils")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
DtSum (
|
||||
DT_SUBTABLE *Subtable,
|
||||
void *Context,
|
||||
void *ReturnValue);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtError
|
||||
*
|
||||
* PARAMETERS: Level - Seriousness (Warning/error, etc.)
|
||||
* MessageId - Index into global message buffer
|
||||
* Op - Parse node where error happened
|
||||
* ExtraMessage - additional error message
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Common error interface for data table compiler
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtError (
|
||||
UINT8 Level,
|
||||
UINT8 MessageId,
|
||||
DT_FIELD *FieldObject,
|
||||
char *ExtraMessage)
|
||||
{
|
||||
|
||||
switch (Level)
|
||||
{
|
||||
case ASL_WARNING2:
|
||||
case ASL_WARNING3:
|
||||
if (Gbl_WarningLevel < Level)
|
||||
{
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (FieldObject)
|
||||
{
|
||||
AslCommonError (Level, MessageId,
|
||||
FieldObject->Line,
|
||||
FieldObject->Line,
|
||||
FieldObject->ByteOffset,
|
||||
FieldObject->Column,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, ExtraMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
AslCommonError (Level, MessageId, 0,
|
||||
0, 0, 0, 0, ExtraMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtNameError
|
||||
*
|
||||
* PARAMETERS: Level - Seriousness (Warning/error, etc.)
|
||||
* MessageId - Index into global message buffer
|
||||
* Op - Parse node where error happened
|
||||
* ExtraMessage - additional error message
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Error interface for named objects
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtNameError (
|
||||
UINT8 Level,
|
||||
UINT8 MessageId,
|
||||
DT_FIELD *FieldObject,
|
||||
char *ExtraMessage)
|
||||
{
|
||||
|
||||
switch (Level)
|
||||
{
|
||||
case ASL_WARNING2:
|
||||
case ASL_WARNING3:
|
||||
if (Gbl_WarningLevel < Level)
|
||||
{
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (FieldObject)
|
||||
{
|
||||
AslCommonError (Level, MessageId,
|
||||
FieldObject->Line,
|
||||
FieldObject->Line,
|
||||
FieldObject->ByteOffset,
|
||||
FieldObject->NameColumn,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, ExtraMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
AslCommonError (Level, MessageId, 0,
|
||||
0, 0, 0, 0, ExtraMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtFatal
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Dump the error log and abort the compiler. Used for serious
|
||||
* compile or I/O errors
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
DtFatal (
|
||||
UINT8 MessageId,
|
||||
DT_FIELD *FieldObject,
|
||||
char *ExtraMessage)
|
||||
{
|
||||
|
||||
DtError (ASL_ERROR, MessageId, FieldObject, ExtraMessage);
|
||||
|
||||
CmCleanupAndExit ();
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtStrtoul64
|
||||
*
|
||||
* PARAMETERS: String - Null terminated string
|
||||
* ReturnInteger - Where the converted integer is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Simple conversion of a string hex integer constant to unsigned
|
||||
* value. Assumes no leading "0x" for the constant.
|
||||
*
|
||||
* Portability note: The reason this function exists is because a 64-bit
|
||||
* sscanf is not available in all environments.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
DtStrtoul64 (
|
||||
char *String,
|
||||
UINT64 *ReturnInteger)
|
||||
{
|
||||
char *ThisChar = String;
|
||||
UINT32 ThisDigit;
|
||||
UINT64 ReturnValue = 0;
|
||||
int DigitCount = 0;
|
||||
|
||||
|
||||
/* Skip over any white space in the buffer */
|
||||
|
||||
while ((*ThisChar == ' ') || (*ThisChar == '\t'))
|
||||
{
|
||||
ThisChar++;
|
||||
}
|
||||
|
||||
/* Skip leading zeros */
|
||||
|
||||
while ((*ThisChar) == '0')
|
||||
{
|
||||
ThisChar++;
|
||||
}
|
||||
|
||||
/* Convert character-by-character */
|
||||
|
||||
while (*ThisChar)
|
||||
{
|
||||
if (ACPI_IS_DIGIT (*ThisChar))
|
||||
{
|
||||
/* Convert ASCII 0-9 to Decimal value */
|
||||
|
||||
ThisDigit = ((UINT8) *ThisChar) - '0';
|
||||
}
|
||||
else /* Letter */
|
||||
{
|
||||
ThisDigit = (UINT32) ACPI_TOUPPER (*ThisChar);
|
||||
if (!ACPI_IS_XDIGIT ((char) ThisDigit))
|
||||
{
|
||||
/* Not A-F */
|
||||
|
||||
return (AE_BAD_CHARACTER);
|
||||
}
|
||||
|
||||
/* Convert ASCII Hex char (A-F) to value */
|
||||
|
||||
ThisDigit = (ThisDigit - 'A') + 10;
|
||||
}
|
||||
|
||||
/* Insert the 4-bit hex digit */
|
||||
|
||||
ReturnValue <<= 4;
|
||||
ReturnValue += ThisDigit;
|
||||
|
||||
ThisChar++;
|
||||
DigitCount++;
|
||||
if (DigitCount > 16)
|
||||
{
|
||||
/* Value is too large (> 64 bits/8 bytes/16 hex digits) */
|
||||
|
||||
return (AE_LIMIT);
|
||||
}
|
||||
}
|
||||
|
||||
*ReturnInteger = ReturnValue;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtGetFileSize
|
||||
*
|
||||
* PARAMETERS: Handle - Open file handler
|
||||
*
|
||||
* RETURN: Current file size
|
||||
*
|
||||
* DESCRIPTION: Get the current size of a file. Seek to the EOF and get the
|
||||
* offset. Seek back to the original location.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
UINT32
|
||||
DtGetFileSize (
|
||||
FILE *Handle)
|
||||
{
|
||||
int CurrentOffset;
|
||||
int LastOffset;
|
||||
|
||||
|
||||
CurrentOffset = ftell (Handle);
|
||||
fseek (Handle, 0, SEEK_END);
|
||||
LastOffset = ftell (Handle);
|
||||
fseek (Handle, CurrentOffset, SEEK_SET);
|
||||
|
||||
return ((UINT32) LastOffset);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtGetFieldValue
|
||||
*
|
||||
* PARAMETERS: Field - Current field list pointer
|
||||
* Name - Field name
|
||||
*
|
||||
* RETURN: Field value
|
||||
*
|
||||
* DESCRIPTION: Get field value
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
char *
|
||||
DtGetFieldValue (
|
||||
DT_FIELD *Field,
|
||||
char *Name)
|
||||
{
|
||||
|
||||
/* Search the field list for the name */
|
||||
|
||||
while (Field)
|
||||
{
|
||||
if (!ACPI_STRCMP (Name, Field->Name))
|
||||
{
|
||||
return (Field->Value);
|
||||
}
|
||||
|
||||
Field = Field->Next;
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtGetFieldType
|
||||
*
|
||||
* PARAMETERS: Info - Data table info
|
||||
*
|
||||
* RETURN: Field type
|
||||
*
|
||||
* DESCRIPTION: Get field type
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
UINT8
|
||||
DtGetFieldType (
|
||||
ACPI_DMTABLE_INFO *Info)
|
||||
{
|
||||
UINT8 Type;
|
||||
|
||||
|
||||
/* DT_FLAG means that this is the start of a block of flag bits */
|
||||
/* TBD - we can make these a separate opcode later */
|
||||
|
||||
if (Info->Flags & DT_FLAG)
|
||||
{
|
||||
return (DT_FIELD_TYPE_FLAGS_INTEGER);
|
||||
}
|
||||
|
||||
/* Type is based upon the opcode for this field in the info table */
|
||||
|
||||
switch (Info->Opcode)
|
||||
{
|
||||
case ACPI_DMT_FLAG0:
|
||||
case ACPI_DMT_FLAG1:
|
||||
case ACPI_DMT_FLAG2:
|
||||
case ACPI_DMT_FLAG3:
|
||||
case ACPI_DMT_FLAG4:
|
||||
case ACPI_DMT_FLAG5:
|
||||
case ACPI_DMT_FLAG6:
|
||||
case ACPI_DMT_FLAG7:
|
||||
case ACPI_DMT_FLAGS0:
|
||||
case ACPI_DMT_FLAGS2:
|
||||
Type = DT_FIELD_TYPE_FLAG;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_NAME4:
|
||||
case ACPI_DMT_SIG:
|
||||
case ACPI_DMT_NAME6:
|
||||
case ACPI_DMT_NAME8:
|
||||
case ACPI_DMT_STRING:
|
||||
Type = DT_FIELD_TYPE_STRING;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_BUFFER:
|
||||
case ACPI_DMT_BUF16:
|
||||
case ACPI_DMT_PCI_PATH:
|
||||
Type = DT_FIELD_TYPE_BUFFER;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_GAS:
|
||||
case ACPI_DMT_HESTNTFY:
|
||||
Type = DT_FIELD_TYPE_INLINE_SUBTABLE;
|
||||
break;
|
||||
|
||||
default:
|
||||
Type = DT_FIELD_TYPE_INTEGER;
|
||||
break;
|
||||
}
|
||||
|
||||
return (Type);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtGetBufferLength
|
||||
*
|
||||
* PARAMETERS: Buffer - List of integers,
|
||||
* for example "10 3A 4F 2E"
|
||||
*
|
||||
* RETURN: Count of integer
|
||||
*
|
||||
* DESCRIPTION: Get length of bytes needed to store the integers
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
UINT32
|
||||
DtGetBufferLength (
|
||||
char *Buffer)
|
||||
{
|
||||
UINT32 ByteLength = 0;
|
||||
|
||||
|
||||
while (*Buffer)
|
||||
{
|
||||
if (*Buffer == ' ')
|
||||
{
|
||||
ByteLength++;
|
||||
|
||||
while (*Buffer == ' ')
|
||||
{
|
||||
Buffer++;
|
||||
}
|
||||
}
|
||||
|
||||
Buffer++;
|
||||
}
|
||||
|
||||
return (++ByteLength);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtGetFieldLength
|
||||
*
|
||||
* PARAMETERS: Field - Current field list pointer
|
||||
* Info - Data table info
|
||||
*
|
||||
* RETURN: Field length
|
||||
*
|
||||
* DESCRIPTION: Get length of bytes needed to compile the field
|
||||
*
|
||||
* Note: This function must remain in sync with AcpiDmDumpTable.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
UINT32
|
||||
DtGetFieldLength (
|
||||
DT_FIELD *Field,
|
||||
ACPI_DMTABLE_INFO *Info)
|
||||
{
|
||||
UINT32 ByteLength = 0;
|
||||
char *Value;
|
||||
|
||||
|
||||
/* Length is based upon the opcode for this field in the info table */
|
||||
|
||||
switch (Info->Opcode)
|
||||
{
|
||||
case ACPI_DMT_FLAG0:
|
||||
case ACPI_DMT_FLAG1:
|
||||
case ACPI_DMT_FLAG2:
|
||||
case ACPI_DMT_FLAG3:
|
||||
case ACPI_DMT_FLAG4:
|
||||
case ACPI_DMT_FLAG5:
|
||||
case ACPI_DMT_FLAG6:
|
||||
case ACPI_DMT_FLAG7:
|
||||
case ACPI_DMT_FLAGS0:
|
||||
case ACPI_DMT_FLAGS2:
|
||||
ByteLength = 0;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_UINT8:
|
||||
case ACPI_DMT_CHKSUM:
|
||||
case ACPI_DMT_SPACEID:
|
||||
case ACPI_DMT_IVRS:
|
||||
case ACPI_DMT_MADT:
|
||||
case ACPI_DMT_SRAT:
|
||||
case ACPI_DMT_ASF:
|
||||
case ACPI_DMT_HESTNTYP:
|
||||
case ACPI_DMT_FADTPM:
|
||||
case ACPI_DMT_EINJACT:
|
||||
case ACPI_DMT_EINJINST:
|
||||
case ACPI_DMT_ERSTACT:
|
||||
case ACPI_DMT_ERSTINST:
|
||||
ByteLength = 1;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_UINT16:
|
||||
case ACPI_DMT_DMAR:
|
||||
case ACPI_DMT_HEST:
|
||||
case ACPI_DMT_PCI_PATH:
|
||||
ByteLength = 2;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_UINT24:
|
||||
ByteLength = 3;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_UINT32:
|
||||
case ACPI_DMT_NAME4:
|
||||
case ACPI_DMT_SIG:
|
||||
ByteLength = 4;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_NAME6:
|
||||
ByteLength = 6;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_UINT56:
|
||||
ByteLength = 7;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_UINT64:
|
||||
case ACPI_DMT_NAME8:
|
||||
ByteLength = 8;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_STRING:
|
||||
Value = DtGetFieldValue (Field, Info->Name);
|
||||
|
||||
/* TBD: error if Value is NULL? (as below?) */
|
||||
|
||||
ByteLength = ACPI_STRLEN (Value) + 1;
|
||||
break;
|
||||
|
||||
case ACPI_DMT_GAS:
|
||||
ByteLength = sizeof (ACPI_GENERIC_ADDRESS);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_HESTNTFY:
|
||||
ByteLength = sizeof (ACPI_HEST_NOTIFY);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_BUFFER:
|
||||
Value = DtGetFieldValue (Field, Info->Name);
|
||||
if (Value)
|
||||
{
|
||||
ByteLength = DtGetBufferLength (Value);
|
||||
}
|
||||
else
|
||||
{ /* At this point, this is a fatal error */
|
||||
|
||||
sprintf (MsgBuffer, "Expected \"%s\"", Info->Name);
|
||||
DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_DMT_BUF16:
|
||||
ByteLength = 16;
|
||||
break;
|
||||
|
||||
default:
|
||||
DtFatal (ASL_MSG_COMPILER_INTERNAL, Field, "Invalid table opcode");
|
||||
break;
|
||||
}
|
||||
|
||||
return (ByteLength);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtSum
|
||||
*
|
||||
* PARAMETERS: DT_WALK_CALLBACK:
|
||||
* Subtable - Subtable
|
||||
* Context - Unused
|
||||
* ReturnValue - Store the checksum of subtable
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Get the checksum of subtable
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static void
|
||||
DtSum (
|
||||
DT_SUBTABLE *Subtable,
|
||||
void *Context,
|
||||
void *ReturnValue)
|
||||
{
|
||||
UINT8 Checksum;
|
||||
UINT8 *Sum = ReturnValue;
|
||||
|
||||
|
||||
Checksum = AcpiTbChecksum (Subtable->Buffer, Subtable->Length);
|
||||
*Sum = (UINT8) (*Sum + Checksum);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtSetTableChecksum
|
||||
*
|
||||
* PARAMETERS: ChecksumPointer - Where to return the checksum
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Set checksum of the whole data table into the checksum field
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtSetTableChecksum (
|
||||
UINT8 *ChecksumPointer)
|
||||
{
|
||||
UINT8 Checksum = 0;
|
||||
UINT8 OldSum;
|
||||
|
||||
|
||||
DtWalkTableTree (Gbl_RootTable, DtSum, NULL, &Checksum);
|
||||
|
||||
OldSum = *ChecksumPointer;
|
||||
Checksum = (UINT8) (Checksum - OldSum);
|
||||
|
||||
/* Compute the final checksum */
|
||||
|
||||
Checksum = (UINT8) (0 - Checksum);
|
||||
*ChecksumPointer = Checksum;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtSetTableLength
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Walk the subtables and set all the length fields
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtSetTableLength (
|
||||
void)
|
||||
{
|
||||
DT_SUBTABLE *ParentTable;
|
||||
DT_SUBTABLE *ChildTable;
|
||||
|
||||
|
||||
ParentTable = Gbl_RootTable;
|
||||
ChildTable = NULL;
|
||||
|
||||
if (!ParentTable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DtSetSubtableLength (ParentTable);
|
||||
|
||||
while (1)
|
||||
{
|
||||
ChildTable = DtGetNextSubtable (ParentTable, ChildTable);
|
||||
if (ChildTable)
|
||||
{
|
||||
if (ChildTable->LengthField)
|
||||
{
|
||||
DtSetSubtableLength (ChildTable);
|
||||
}
|
||||
|
||||
if (ChildTable->Child)
|
||||
{
|
||||
ParentTable = ChildTable;
|
||||
ChildTable = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
ParentTable->TotalLength += ChildTable->TotalLength;
|
||||
if (ParentTable->LengthField)
|
||||
{
|
||||
DtSetSubtableLength (ParentTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ChildTable = ParentTable;
|
||||
|
||||
if (ChildTable == Gbl_RootTable)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
ParentTable = DtGetParentSubtable (ParentTable);
|
||||
|
||||
ParentTable->TotalLength += ChildTable->TotalLength;
|
||||
if (ParentTable->LengthField)
|
||||
{
|
||||
DtSetSubtableLength (ParentTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtWalkTableTree
|
||||
*
|
||||
* PARAMETERS: StartTable - Subtable in the tree where walking begins
|
||||
* UserFunction - Called during the walk
|
||||
* Context - Passed to user function
|
||||
* ReturnValue - The return value of UserFunction
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Performs a depth-first walk of the subtable tree
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtWalkTableTree (
|
||||
DT_SUBTABLE *StartTable,
|
||||
DT_WALK_CALLBACK UserFunction,
|
||||
void *Context,
|
||||
void *ReturnValue)
|
||||
{
|
||||
DT_SUBTABLE *ParentTable;
|
||||
DT_SUBTABLE *ChildTable;
|
||||
|
||||
|
||||
ParentTable = StartTable;
|
||||
ChildTable = NULL;
|
||||
|
||||
if (!ParentTable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UserFunction (ParentTable, Context, ReturnValue);
|
||||
|
||||
while (1)
|
||||
{
|
||||
ChildTable = DtGetNextSubtable (ParentTable, ChildTable);
|
||||
if (ChildTable)
|
||||
{
|
||||
UserFunction (ChildTable, Context, ReturnValue);
|
||||
|
||||
if (ChildTable->Child)
|
||||
{
|
||||
ParentTable = ChildTable;
|
||||
ChildTable = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ChildTable = ParentTable;
|
||||
if (ChildTable == Gbl_RootTable)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
ParentTable = DtGetParentSubtable (ParentTable);
|
||||
|
||||
if (ChildTable->Peer == StartTable)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtFreeFieldList
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Free the field list
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
void
|
||||
DtFreeFieldList (
|
||||
void)
|
||||
{
|
||||
DT_FIELD *Field = Gbl_FieldList;
|
||||
DT_FIELD *NextField;
|
||||
|
||||
|
||||
/* Walk and free entire field list */
|
||||
|
||||
while (Field)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
@ -477,7 +477,7 @@ AcpiDbCheckPredefinedNames (
|
||||
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
|
||||
AcpiDbWalkForPredefinedNames, NULL, (void *) &Count, NULL);
|
||||
|
||||
AcpiOsPrintf ("Found %d predefined names in the namespace\n", Count);
|
||||
AcpiOsPrintf ("Found %u predefined names in the namespace\n", Count);
|
||||
}
|
||||
|
||||
|
||||
@ -619,7 +619,7 @@ AcpiDbBatchExecute (
|
||||
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
|
||||
AcpiDbWalkForExecute, NULL, (void *) &Info, NULL);
|
||||
|
||||
AcpiOsPrintf ("Executed %d predefined names in the namespace\n", Info.Count);
|
||||
AcpiOsPrintf ("Executed %u predefined names in the namespace\n", Info.Count);
|
||||
}
|
||||
|
||||
|
||||
@ -678,7 +678,7 @@ AcpiDbDisplayTableInfo (
|
||||
for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
|
||||
{
|
||||
TableDesc = &AcpiGbl_RootTableList.Tables[i];
|
||||
AcpiOsPrintf ("%d ", i);
|
||||
AcpiOsPrintf ("%u ", i);
|
||||
|
||||
/* Make sure that the table is mapped */
|
||||
|
||||
@ -1182,7 +1182,7 @@ AcpiDbSetMethodData (
|
||||
|
||||
if (Index > ACPI_METHOD_MAX_ARG)
|
||||
{
|
||||
AcpiOsPrintf ("Arg%d - Invalid argument name\n", Index);
|
||||
AcpiOsPrintf ("Arg%u - Invalid argument name\n", Index);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
@ -1195,7 +1195,7 @@ AcpiDbSetMethodData (
|
||||
|
||||
ObjDesc = WalkState->Arguments[Index].Object;
|
||||
|
||||
AcpiOsPrintf ("Arg%d: ", Index);
|
||||
AcpiOsPrintf ("Arg%u: ", Index);
|
||||
AcpiDmDisplayInternalObject (ObjDesc, WalkState);
|
||||
break;
|
||||
|
||||
@ -1205,7 +1205,7 @@ AcpiDbSetMethodData (
|
||||
|
||||
if (Index > ACPI_METHOD_MAX_LOCAL)
|
||||
{
|
||||
AcpiOsPrintf ("Local%d - Invalid local variable name\n", Index);
|
||||
AcpiOsPrintf ("Local%u - Invalid local variable name\n", Index);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
@ -1218,7 +1218,7 @@ AcpiDbSetMethodData (
|
||||
|
||||
ObjDesc = WalkState->LocalVariables[Index].Object;
|
||||
|
||||
AcpiOsPrintf ("Local%d: ", Index);
|
||||
AcpiOsPrintf ("Local%u: ", Index);
|
||||
AcpiDmDisplayInternalObject (ObjDesc, WalkState);
|
||||
break;
|
||||
|
||||
@ -1942,7 +1942,7 @@ AcpiDbCheckIntegrity (
|
||||
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
|
||||
AcpiDbIntegrityWalk, NULL, (void *) &Info, NULL);
|
||||
|
||||
AcpiOsPrintf ("Verified %d namespace nodes with %d Objects\n",
|
||||
AcpiOsPrintf ("Verified %u namespace nodes with %u Objects\n",
|
||||
Info.Nodes, Info.Objects);
|
||||
}
|
||||
|
||||
|
@ -612,7 +612,7 @@ AcpiDbDisplayResults (
|
||||
for (i = 0; i < ResultCount; i++)
|
||||
{
|
||||
ObjDesc = Frame->Results.ObjDesc[Index];
|
||||
AcpiOsPrintf ("Result%d: ", i);
|
||||
AcpiOsPrintf ("Result%u: ", i);
|
||||
AcpiDmDisplayInternalObject (ObjDesc, WalkState);
|
||||
if (Index == 0)
|
||||
{
|
||||
@ -722,7 +722,7 @@ AcpiDbDisplayObjectType (
|
||||
{
|
||||
for (i = 0; i < Info->CompatibleIdList.Count; i++)
|
||||
{
|
||||
AcpiOsPrintf ("CID %d: %s\n", i,
|
||||
AcpiOsPrintf ("CID %u: %s\n", i,
|
||||
Info->CompatibleIdList.Ids[i].String);
|
||||
}
|
||||
}
|
||||
@ -854,7 +854,7 @@ AcpiDbDisplayGpes (
|
||||
GpeType = "GPE Block Device";
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\nBlock %d - Info %p DeviceNode %p [%s] - %s\n",
|
||||
AcpiOsPrintf ("\nBlock %u - Info %p DeviceNode %p [%s] - %s\n",
|
||||
Block, GpeBlock, GpeBlock->Node, Buffer, GpeType);
|
||||
|
||||
AcpiOsPrintf (" Registers: %u (%u GPEs)\n",
|
||||
@ -904,9 +904,9 @@ AcpiDbDisplayGpes (
|
||||
}
|
||||
|
||||
AcpiOsPrintf (
|
||||
" GPE %.2X: %p RunRefs %2.2X WakeRefs %2.2X Flags %2.2X (",
|
||||
" GPE %.2X: %p RunRefs %2.2X Flags %2.2X (",
|
||||
GpeBlock->BlockBaseNumber + GpeIndex, GpeEventInfo,
|
||||
GpeEventInfo->RuntimeCount, GpeEventInfo->WakeupCount,
|
||||
GpeEventInfo->RuntimeCount,
|
||||
GpeEventInfo->Flags);
|
||||
|
||||
/* Decode the flags byte */
|
||||
|
@ -602,7 +602,7 @@ AcpiDbMethodThread (
|
||||
#if 0
|
||||
if ((i % 100) == 0)
|
||||
{
|
||||
AcpiOsPrintf ("%d executions, Thread 0x%x\n", i, AcpiOsGetThreadId ());
|
||||
AcpiOsPrintf ("%u executions, Thread 0x%x\n", i, AcpiOsGetThreadId ());
|
||||
}
|
||||
|
||||
if (ReturnObj.Length)
|
||||
|
@ -289,7 +289,7 @@ AcpiDbCheckTextModeCorruption (
|
||||
* meaning that we cannot simply replace CR/LF pairs with LFs.
|
||||
*/
|
||||
AcpiOsPrintf ("Table has been corrupted by text mode conversion\n");
|
||||
AcpiOsPrintf ("All LFs (%d) were changed to CR/LF pairs\n", Pairs);
|
||||
AcpiOsPrintf ("All LFs (%u) were changed to CR/LF pairs\n", Pairs);
|
||||
AcpiOsPrintf ("Table cannot be repaired!\n");
|
||||
return (AE_BAD_VALUE);
|
||||
}
|
||||
|
@ -284,7 +284,7 @@ AcpiDbGetFromHistory (
|
||||
}
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("Invalid history number: %d\n", HistoryIndex);
|
||||
AcpiOsPrintf ("Invalid history number: %u\n", HistoryIndex);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
@ -613,7 +613,7 @@ AcpiDbCommandDispatch (
|
||||
|
||||
if (ParamCount < AcpiGbl_DbCommands[CommandIndex].MinArgs)
|
||||
{
|
||||
AcpiOsPrintf ("%d parameters entered, [%s] requires %d parameters\n",
|
||||
AcpiOsPrintf ("%u parameters entered, [%s] requires %u parameters\n",
|
||||
ParamCount, AcpiGbl_DbCommands[CommandIndex].Name,
|
||||
AcpiGbl_DbCommands[CommandIndex].MinArgs);
|
||||
|
||||
|
@ -291,7 +291,7 @@ AcpiDbDumpExternalObject (
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
|
||||
AcpiOsPrintf ("[Package] Contains %d Elements:\n",
|
||||
AcpiOsPrintf ("[Package] Contains %u Elements:\n",
|
||||
ObjDesc->Package.Count);
|
||||
|
||||
for (i = 0; i < ObjDesc->Package.Count; i++)
|
||||
|
@ -289,7 +289,7 @@ AcpiDmDecodeInternalObject (
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
AcpiOsPrintf ("(%d) \"%.24s",
|
||||
AcpiOsPrintf ("(%u) \"%.24s",
|
||||
ObjDesc->String.Length, ObjDesc->String.Pointer);
|
||||
|
||||
if (ObjDesc->String.Length > 24)
|
||||
@ -305,7 +305,7 @@ AcpiDmDecodeInternalObject (
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
AcpiOsPrintf ("(%d)", ObjDesc->Buffer.Length);
|
||||
AcpiOsPrintf ("(%u)", ObjDesc->Buffer.Length);
|
||||
for (i = 0; (i < 8) && (i < ObjDesc->Buffer.Length); i++)
|
||||
{
|
||||
AcpiOsPrintf (" %2.2X", ObjDesc->Buffer.Pointer[i]);
|
||||
@ -651,7 +651,7 @@ AcpiDmDisplayArguments (
|
||||
for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++)
|
||||
{
|
||||
ObjDesc = WalkState->Arguments[i].Object;
|
||||
AcpiOsPrintf (" Arg%d: ", i);
|
||||
AcpiOsPrintf (" Arg%u: ", i);
|
||||
AcpiDmDisplayInternalObject (ObjDesc, WalkState);
|
||||
}
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ AcpiDmMethodFlags (
|
||||
|
||||
/* 1) Method argument count */
|
||||
|
||||
AcpiOsPrintf (", %d, ", Args);
|
||||
AcpiOsPrintf (", %u, ", Args);
|
||||
|
||||
/* 2) Serialize rule */
|
||||
|
||||
@ -178,7 +178,7 @@ AcpiDmMethodFlags (
|
||||
|
||||
if (Flags & 0xF0)
|
||||
{
|
||||
AcpiOsPrintf (", %d", Flags >> 4);
|
||||
AcpiOsPrintf (", %u", Flags >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
@ -550,7 +550,7 @@ AcpiDmDisassembleOneOp (
|
||||
case AML_INT_NAMEDFIELD_OP:
|
||||
|
||||
Length = AcpiDmDumpName (Op->Named.Name);
|
||||
AcpiOsPrintf (",%*.s %d", (int) (5 - Length), " ",
|
||||
AcpiOsPrintf (",%*.s %u", (unsigned) (5 - Length), " ",
|
||||
(UINT32) Op->Common.Value.Integer);
|
||||
AcpiDmCommaIfFieldMember (Op);
|
||||
|
||||
@ -571,7 +571,7 @@ AcpiDmDisassembleOneOp (
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf (" , %d", Offset);
|
||||
AcpiOsPrintf (" , %u", Offset);
|
||||
}
|
||||
|
||||
AcpiDmCommaIfFieldMember (Op);
|
||||
|
@ -290,7 +290,7 @@ AcpiDmBitList (
|
||||
AcpiOsPrintf (",");
|
||||
}
|
||||
Previous = TRUE;
|
||||
AcpiOsPrintf ("%d", i);
|
||||
AcpiOsPrintf ("%u", i);
|
||||
}
|
||||
|
||||
Mask >>= 1;
|
||||
|
@ -263,12 +263,12 @@ AcpiDsInitializeObjects (
|
||||
"**** Starting initialization of namespace objects ****\n"));
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Parsing all Control Methods:"));
|
||||
|
||||
Info.MethodCount = 0;
|
||||
Info.OpRegionCount = 0;
|
||||
Info.ObjectCount = 0;
|
||||
Info.DeviceCount = 0;
|
||||
Info.TableIndex = TableIndex;
|
||||
Info.OwnerId = OwnerId;
|
||||
/* Set all init info to zero */
|
||||
|
||||
ACPI_MEMSET (&Info, 0, sizeof (ACPI_INIT_WALK_INFO));
|
||||
|
||||
Info.OwnerId = OwnerId;
|
||||
Info.TableIndex = TableIndex;
|
||||
|
||||
/* Walk entire namespace from the supplied root */
|
||||
|
||||
@ -297,12 +297,12 @@ AcpiDsInitializeObjects (
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
|
||||
"\nTable [%4.4s](id %4.4X) - %hd Objects with %hd Devices %hd Methods %hd Regions\n",
|
||||
"\nTable [%4.4s](id %4.4X) - %u Objects with %u Devices %u Methods %u Regions\n",
|
||||
Table->Signature, OwnerId, Info.ObjectCount,
|
||||
Info.DeviceCount, Info.MethodCount, Info.OpRegionCount));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"%hd Methods, %hd Regions\n", Info.MethodCount, Info.OpRegionCount));
|
||||
"%u Methods, %u Regions\n", Info.MethodCount, Info.OpRegionCount));
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
@ -700,7 +700,18 @@ AcpiDsTerminateControlMethod (
|
||||
*/
|
||||
if (!(MethodDesc->Method.Flags & AOPOBJ_MODULE_LEVEL))
|
||||
{
|
||||
AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId);
|
||||
/* Delete any direct children of (created by) this method */
|
||||
|
||||
AcpiNsDeleteNamespaceSubtree (WalkState->MethodNode);
|
||||
|
||||
/*
|
||||
* Delete any objects that were created by this method
|
||||
* elsewhere in the namespace (if any were created).
|
||||
*/
|
||||
if (MethodDesc->Method.Flags & AOPOBJ_MODIFIED_NAMESPACE)
|
||||
{
|
||||
AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -725,7 +736,7 @@ AcpiDsTerminateControlMethod (
|
||||
* we immediately reuse it for the next thread executing this method
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"*** Completed execution of one thread, %d threads remaining\n",
|
||||
"*** Completed execution of one thread, %u threads remaining\n",
|
||||
MethodDesc->Method.ThreadCount));
|
||||
}
|
||||
else
|
||||
|
@ -188,8 +188,7 @@ AcpiDsMethodDataInit (
|
||||
WalkState->Arguments[i].Name.Integer |= (i << 24);
|
||||
WalkState->Arguments[i].DescriptorType = ACPI_DESC_TYPE_NAMED;
|
||||
WalkState->Arguments[i].Type = ACPI_TYPE_ANY;
|
||||
WalkState->Arguments[i].Flags =
|
||||
ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_ARG;
|
||||
WalkState->Arguments[i].Flags = ANOBJ_METHOD_ARG;
|
||||
}
|
||||
|
||||
/* Init the method locals */
|
||||
@ -201,8 +200,7 @@ AcpiDsMethodDataInit (
|
||||
WalkState->LocalVariables[i].Name.Integer |= (i << 24);
|
||||
WalkState->LocalVariables[i].DescriptorType = ACPI_DESC_TYPE_NAMED;
|
||||
WalkState->LocalVariables[i].Type = ACPI_TYPE_ANY;
|
||||
WalkState->LocalVariables[i].Flags =
|
||||
ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_LOCAL;
|
||||
WalkState->LocalVariables[i].Flags = ANOBJ_METHOD_LOCAL;
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
@ -238,7 +236,7 @@ AcpiDsMethodDataDeleteAll (
|
||||
{
|
||||
if (WalkState->LocalVariables[Index].Object)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Local%d=%p\n",
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Local%u=%p\n",
|
||||
Index, WalkState->LocalVariables[Index].Object));
|
||||
|
||||
/* Detach object (if present) and remove a reference */
|
||||
@ -253,7 +251,7 @@ AcpiDsMethodDataDeleteAll (
|
||||
{
|
||||
if (WalkState->Arguments[Index].Object)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Arg%d=%p\n",
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Arg%u=%p\n",
|
||||
Index, WalkState->Arguments[Index].Object));
|
||||
|
||||
/* Detach object (if present) and remove a reference */
|
||||
@ -322,7 +320,7 @@ AcpiDsMethodDataInitArgs (
|
||||
Index++;
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%d args passed to method\n", Index));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%u args passed to method\n", Index));
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
@ -429,7 +427,7 @@ AcpiDsMethodDataSetValue (
|
||||
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"NewObj %p Type %2.2X, Refs=%d [%s]\n", Object,
|
||||
"NewObj %p Type %2.2X, Refs=%u [%s]\n", Object,
|
||||
Type, Object->Common.ReferenceCount,
|
||||
AcpiUtGetTypeName (Object->Common.Type)));
|
||||
|
||||
@ -667,7 +665,7 @@ AcpiDsStoreObjectToLocal (
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsStoreObjectToLocal);
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Type=%2.2X Index=%d Obj=%p\n",
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Type=%2.2X Index=%u Obj=%p\n",
|
||||
Type, Index, ObjDesc));
|
||||
|
||||
/* Parameter validation */
|
||||
|
@ -159,6 +159,7 @@ AcpiDsBuildInternalObject (
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OBJECT_TYPE Type;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsBuildInternalObject);
|
||||
@ -241,7 +242,20 @@ AcpiDsBuildInternalObject (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
switch (Op->Common.Node->Type)
|
||||
/*
|
||||
* Special handling for Alias objects. We need to setup the type
|
||||
* and the Op->Common.Node to point to the Alias target. Note,
|
||||
* Alias has at most one level of indirection internally.
|
||||
*/
|
||||
Type = Op->Common.Node->Type;
|
||||
if (Type == ACPI_TYPE_LOCAL_ALIAS)
|
||||
{
|
||||
Type = ObjDesc->Common.Type;
|
||||
Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
|
||||
Op->Common.Node->Object);
|
||||
}
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
/*
|
||||
* For these types, we need the actual node, not the subobject.
|
||||
|
@ -307,7 +307,7 @@ AcpiDsGetBufferFieldArguments (
|
||||
|
||||
/* Execute the AML code for the TermArg arguments */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, AcpiNsGetParentNode (Node),
|
||||
Status = AcpiDsExecuteArguments (Node, Node->Parent,
|
||||
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
@ -354,7 +354,7 @@ AcpiDsGetBankFieldArguments (
|
||||
|
||||
/* Execute the AML code for the TermArg arguments */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, AcpiNsGetParentNode (Node),
|
||||
Status = AcpiDsExecuteArguments (Node, Node->Parent,
|
||||
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
@ -505,7 +505,7 @@ AcpiDsGetRegionArguments (
|
||||
|
||||
/* Execute the argument AML */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, AcpiNsGetParentNode (Node),
|
||||
Status = AcpiDsExecuteArguments (Node, Node->Parent,
|
||||
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
@ -875,7 +875,7 @@ AcpiDsCreateOperands (
|
||||
|
||||
Index--;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Arg #%d (%p) done, Arg1=%p\n",
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Arg #%u (%p) done, Arg1=%p\n",
|
||||
Index, Arg, FirstArg));
|
||||
}
|
||||
|
||||
@ -890,7 +890,7 @@ AcpiDsCreateOperands (
|
||||
*/
|
||||
AcpiDsObjStackPopAndDelete (ArgCount, WalkState);
|
||||
|
||||
ACPI_EXCEPTION ((AE_INFO, Status, "While creating Arg %d", Index));
|
||||
ACPI_EXCEPTION ((AE_INFO, Status, "While creating Arg %u", Index));
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
@ -134,26 +134,26 @@ AcpiEvAsynchEnableGpe (
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvUpdateGpeEnableMasks
|
||||
* FUNCTION: AcpiEvUpdateGpeEnableMask
|
||||
*
|
||||
* PARAMETERS: GpeEventInfo - GPE to update
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Updates GPE register enable masks based upon whether there are
|
||||
* references (either wake or run) to this GPE
|
||||
* DESCRIPTION: Updates GPE register enable mask based upon whether there are
|
||||
* runtime references to this GPE
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvUpdateGpeEnableMasks (
|
||||
AcpiEvUpdateGpeEnableMask (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo)
|
||||
{
|
||||
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
|
||||
UINT8 RegisterBit;
|
||||
UINT32 RegisterBit;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvUpdateGpeEnableMasks);
|
||||
ACPI_FUNCTION_TRACE (EvUpdateGpeEnableMask);
|
||||
|
||||
|
||||
GpeRegisterInfo = GpeEventInfo->RegisterInfo;
|
||||
@ -162,24 +162,17 @@ AcpiEvUpdateGpeEnableMasks (
|
||||
return_ACPI_STATUS (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
RegisterBit = (UINT8)
|
||||
(1 << (GpeEventInfo->GpeNumber - GpeRegisterInfo->BaseGpeNumber));
|
||||
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
|
||||
|
||||
/* Clear the wake/run bits up front */
|
||||
/* Clear the run bit up front */
|
||||
|
||||
ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForWake, RegisterBit);
|
||||
ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForRun, RegisterBit);
|
||||
|
||||
/* Set the mask bits only if there are references to this GPE */
|
||||
/* Set the mask bit only if there are references to this GPE */
|
||||
|
||||
if (GpeEventInfo->RuntimeCount)
|
||||
{
|
||||
ACPI_SET_BIT (GpeRegisterInfo->EnableForRun, RegisterBit);
|
||||
}
|
||||
|
||||
if (GpeEventInfo->WakeupCount)
|
||||
{
|
||||
ACPI_SET_BIT (GpeRegisterInfo->EnableForWake, RegisterBit);
|
||||
ACPI_SET_BIT (GpeRegisterInfo->EnableForRun, (UINT8) RegisterBit);
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
@ -194,10 +187,7 @@ AcpiEvUpdateGpeEnableMasks (
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Hardware-enable a GPE. Always enables the GPE, regardless
|
||||
* of type or number of references.
|
||||
*
|
||||
* Note: The GPE lock should be already acquired when this function is called.
|
||||
* DESCRIPTION: Clear a GPE of stale events and enable it.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -222,14 +212,6 @@ AcpiEvEnableGpe (
|
||||
return_ACPI_STATUS (AE_NO_HANDLER);
|
||||
}
|
||||
|
||||
/* Ensure the HW enable masks are current */
|
||||
|
||||
Status = AcpiEvUpdateGpeEnableMasks (GpeEventInfo);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Clear the GPE (of stale events) */
|
||||
|
||||
Status = AcpiHwClearGpe (GpeEventInfo);
|
||||
@ -240,59 +222,7 @@ AcpiEvEnableGpe (
|
||||
|
||||
/* Enable the requested GPE */
|
||||
|
||||
Status = AcpiHwWriteGpeEnableReg (GpeEventInfo);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvDisableGpe
|
||||
*
|
||||
* PARAMETERS: GpeEventInfo - GPE to disable
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Hardware-disable a GPE. Always disables the requested GPE,
|
||||
* regardless of the type or number of references.
|
||||
*
|
||||
* Note: The GPE lock should be already acquired when this function is called.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvDisableGpe (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvDisableGpe);
|
||||
|
||||
|
||||
/*
|
||||
* Note: Always disable the GPE, even if we think that that it is already
|
||||
* disabled. It is possible that the AML or some other code has enabled
|
||||
* the GPE behind our back.
|
||||
*/
|
||||
|
||||
/* Ensure the HW enable masks are current */
|
||||
|
||||
Status = AcpiEvUpdateGpeEnableMasks (GpeEventInfo);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Always H/W disable this GPE, even if we don't know the GPE type.
|
||||
* Simply clear the enable bit for this particular GPE, but do not
|
||||
* write out the current GPE enable mask since this may inadvertently
|
||||
* enable GPEs too early. An example is a rogue GPE that has arrived
|
||||
* during ACPICA initialization - possibly because AML or other code
|
||||
* has enabled the GPE.
|
||||
*/
|
||||
Status = AcpiHwLowDisableGpe (GpeEventInfo);
|
||||
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@ -578,10 +508,6 @@ AcpiEvAsynchExecuteGpeMethod (
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* Update the GPE register masks for return to enabled state */
|
||||
|
||||
(void) AcpiEvUpdateGpeEnableMasks (GpeEventInfo);
|
||||
|
||||
/*
|
||||
* Take a snapshot of the GPE info for this level - we copy the info to
|
||||
* prevent a race condition with RemoveHandler/RemoveBlock.
|
||||
@ -677,9 +603,11 @@ AcpiEvAsynchEnableGpe (
|
||||
}
|
||||
}
|
||||
|
||||
/* Enable this GPE */
|
||||
|
||||
(void) AcpiHwWriteGpeEnableReg (GpeEventInfo);
|
||||
/*
|
||||
* Enable this GPE, conditionally. This means that the GPE will only be
|
||||
* physically enabled if the EnableForRun bit is set in the EventInfo
|
||||
*/
|
||||
(void) AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_CONDITIONAL_ENABLE);
|
||||
|
||||
Exit:
|
||||
ACPI_FREE (GpeEventInfo);
|
||||
@ -772,7 +700,7 @@ AcpiEvGpeDispatch (
|
||||
* Disable the GPE, so it doesn't keep firing before the method has a
|
||||
* chance to run (it runs asynchronously with interrupts enabled).
|
||||
*/
|
||||
Status = AcpiEvDisableGpe (GpeEventInfo);
|
||||
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
@ -806,10 +734,10 @@ AcpiEvGpeDispatch (
|
||||
GpeNumber));
|
||||
|
||||
/*
|
||||
* Disable the GPE. The GPE will remain disabled a handler
|
||||
* Disable the GPE. The GPE will remain disabled until a handler
|
||||
* is installed or ACPICA is restarted.
|
||||
*/
|
||||
Status = AcpiEvDisableGpe (GpeEventInfo);
|
||||
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
|
@ -613,6 +613,18 @@ AcpiEvInitializeGpeBlock (
|
||||
|
||||
GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j;
|
||||
GpeEventInfo = &GpeBlock->EventInfo[GpeIndex];
|
||||
GpeNumber = GpeIndex + GpeBlock->BlockBaseNumber;
|
||||
|
||||
/*
|
||||
* If the GPE has already been enabled for runtime
|
||||
* signalling, make sure that it remains enabled, but
|
||||
* do not increment its reference count.
|
||||
*/
|
||||
if (GpeEventInfo->RuntimeCount)
|
||||
{
|
||||
Status = AcpiEvEnableGpe (GpeEventInfo);
|
||||
goto Enabled;
|
||||
}
|
||||
|
||||
/* Ignore GPEs that can wake the system */
|
||||
|
||||
@ -634,9 +646,8 @@ AcpiEvInitializeGpeBlock (
|
||||
|
||||
/* Enable this GPE */
|
||||
|
||||
GpeNumber = GpeIndex + GpeBlock->BlockBaseNumber;
|
||||
Status = AcpiEnableGpe (GpeDevice, GpeNumber,
|
||||
ACPI_GPE_TYPE_RUNTIME);
|
||||
Status = AcpiEnableGpe (GpeDevice, GpeNumber);
|
||||
Enabled:
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
|
@ -575,8 +575,7 @@ AcpiEvMatchGpeMethod (
|
||||
GpeDevice = NULL;
|
||||
}
|
||||
|
||||
Status = AcpiEnableGpe (GpeDevice, GpeNumber,
|
||||
ACPI_GPE_TYPE_RUNTIME);
|
||||
Status = AcpiEnableGpe (GpeDevice, GpeNumber);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
|
@ -114,7 +114,6 @@
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
#include <contrib/dev/acpica/include/acpi.h>
|
||||
#include <contrib/dev/acpica/include/accommon.h>
|
||||
#include <contrib/dev/acpica/include/acevents.h>
|
||||
|
@ -294,7 +294,7 @@ AcpiEvPciConfigRegionSetup (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ParentNode = AcpiNsGetParentNode (RegionObj->Region.Node);
|
||||
ParentNode = RegionObj->Region.Node->Parent;
|
||||
|
||||
/*
|
||||
* Get the _SEG and _BBN values from the device upon which the handler
|
||||
@ -348,7 +348,7 @@ AcpiEvPciConfigRegionSetup (
|
||||
break;
|
||||
}
|
||||
|
||||
PciRootNode = AcpiNsGetParentNode (PciRootNode);
|
||||
PciRootNode = PciRootNode->Parent;
|
||||
}
|
||||
|
||||
/* PCI root bridge not found, use namespace root node */
|
||||
@ -385,7 +385,7 @@ AcpiEvPciConfigRegionSetup (
|
||||
PciDeviceNode = RegionObj->Region.Node;
|
||||
while (PciDeviceNode && (PciDeviceNode->Type != ACPI_TYPE_DEVICE))
|
||||
{
|
||||
PciDeviceNode = AcpiNsGetParentNode (PciDeviceNode);
|
||||
PciDeviceNode = PciDeviceNode->Parent;
|
||||
}
|
||||
|
||||
if (!PciDeviceNode)
|
||||
@ -661,7 +661,7 @@ AcpiEvInitializeRegion (
|
||||
return_ACPI_STATUS (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
Node = AcpiNsGetParentNode (RegionObj->Region.Node);
|
||||
Node = RegionObj->Region.Node->Parent;
|
||||
SpaceId = RegionObj->Region.SpaceId;
|
||||
|
||||
/* Setup defaults */
|
||||
@ -785,7 +785,7 @@ AcpiEvInitializeRegion (
|
||||
|
||||
/* This node does not have the handler we need; Pop up one level */
|
||||
|
||||
Node = AcpiNsGetParentNode (Node);
|
||||
Node = Node->Parent;
|
||||
}
|
||||
|
||||
/* If we get here, there is no handler for this region */
|
||||
|
@ -747,14 +747,6 @@ AcpiInstallGpeHandler (
|
||||
Handler->Context = Context;
|
||||
Handler->MethodNode = GpeEventInfo->Dispatch.MethodNode;
|
||||
|
||||
/* Disable the GPE before installing the handler */
|
||||
|
||||
Status = AcpiEvDisableGpe (GpeEventInfo);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/* Install the handler */
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
|
||||
@ -845,14 +837,6 @@ AcpiRemoveGpeHandler (
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/* Disable the GPE before removing the handler */
|
||||
|
||||
Status = AcpiEvDisableGpe (GpeEventInfo);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/* Remove the handler */
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
|
||||
|
@ -305,44 +305,37 @@ AcpiEnableEvent (
|
||||
ACPI_EXPORT_SYMBOL (AcpiEnableEvent)
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEnableGpe
|
||||
* FUNCTION: AcpiGpeWakeup
|
||||
*
|
||||
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
|
||||
* GpeNumber - GPE level within the GPE block
|
||||
* GpeType - ACPI_GPE_TYPE_RUNTIME or ACPI_GPE_TYPE_WAKE
|
||||
* or both
|
||||
* Action - Enable or Disable
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Add a reference to a GPE. On the first reference, the GPE is
|
||||
* hardware-enabled (for runtime GPEs), or the GPE register mask
|
||||
* is updated (for wake GPEs).
|
||||
* DESCRIPTION: Set or clear the GPE's wakeup enable mask bit.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEnableGpe (
|
||||
AcpiGpeWakeup (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
UINT32 GpeNumber,
|
||||
UINT8 GpeType)
|
||||
UINT8 Action)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo;
|
||||
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
|
||||
ACPI_CPU_FLAGS Flags;
|
||||
UINT32 RegisterBit;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiEnableGpe);
|
||||
ACPI_FUNCTION_TRACE (AcpiGpeWakeup);
|
||||
|
||||
|
||||
/* Parameter validation */
|
||||
|
||||
if (!GpeType || (GpeType & ~ACPI_GPE_TYPE_WAKE_RUN))
|
||||
{
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
|
||||
|
||||
/* Ensure that we have a valid GPE number */
|
||||
@ -354,50 +347,96 @@ AcpiEnableGpe (
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
if (GpeType & ACPI_GPE_TYPE_RUNTIME)
|
||||
GpeRegisterInfo = GpeEventInfo->RegisterInfo;
|
||||
if (!GpeRegisterInfo)
|
||||
{
|
||||
if (GpeEventInfo->RuntimeCount == ACPI_UINT8_MAX)
|
||||
{
|
||||
Status = AE_LIMIT; /* Too many references */
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
GpeEventInfo->RuntimeCount++;
|
||||
if (GpeEventInfo->RuntimeCount == 1)
|
||||
{
|
||||
Status = AcpiEvEnableGpe (GpeEventInfo);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
GpeEventInfo->RuntimeCount--;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
}
|
||||
Status = AE_NOT_EXIST;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
if (GpeType & ACPI_GPE_TYPE_WAKE)
|
||||
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
|
||||
|
||||
/* Perform the action */
|
||||
|
||||
switch (Action)
|
||||
{
|
||||
/* The GPE must have the ability to wake the system */
|
||||
case ACPI_GPE_ENABLE:
|
||||
ACPI_SET_BIT (GpeRegisterInfo->EnableForWake, (UINT8) RegisterBit);
|
||||
break;
|
||||
|
||||
if (!(GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE))
|
||||
case ACPI_GPE_DISABLE:
|
||||
ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForWake, (UINT8) RegisterBit);
|
||||
break;
|
||||
|
||||
default:
|
||||
ACPI_ERROR ((AE_INFO, "%u, Invalid action", Action));
|
||||
Status = AE_BAD_PARAMETER;
|
||||
break;
|
||||
}
|
||||
|
||||
UnlockAndExit:
|
||||
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiGpeWakeup)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEnableGpe
|
||||
*
|
||||
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
|
||||
* GpeNumber - GPE level within the GPE block
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Add a reference to a GPE. On the first reference, the GPE is
|
||||
* hardware-enabled.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEnableGpe (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
UINT32 GpeNumber)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo;
|
||||
ACPI_CPU_FLAGS Flags;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiEnableGpe);
|
||||
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
|
||||
|
||||
/* Ensure that we have a valid GPE number */
|
||||
|
||||
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
|
||||
if (!GpeEventInfo)
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
if (GpeEventInfo->RuntimeCount == ACPI_UINT8_MAX)
|
||||
{
|
||||
Status = AE_LIMIT; /* Too many references */
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
GpeEventInfo->RuntimeCount++;
|
||||
if (GpeEventInfo->RuntimeCount == 1)
|
||||
{
|
||||
Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Status = AE_TYPE;
|
||||
goto UnlockAndExit;
|
||||
Status = AcpiEvEnableGpe (GpeEventInfo);
|
||||
}
|
||||
|
||||
if (GpeEventInfo->WakeupCount == ACPI_UINT8_MAX)
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
Status = AE_LIMIT; /* Too many references */
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Update the enable mask on the first wakeup reference. Wake GPEs
|
||||
* are only hardware-enabled just before sleeping.
|
||||
*/
|
||||
GpeEventInfo->WakeupCount++;
|
||||
if (GpeEventInfo->WakeupCount == 1)
|
||||
{
|
||||
(void) AcpiEvUpdateGpeEnableMasks (GpeEventInfo);
|
||||
GpeEventInfo->RuntimeCount--;
|
||||
}
|
||||
}
|
||||
|
||||
@ -415,8 +454,6 @@ ACPI_EXPORT_SYMBOL (AcpiEnableGpe)
|
||||
*
|
||||
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
|
||||
* GpeNumber - GPE level within the GPE block
|
||||
* GpeType - ACPI_GPE_TYPE_RUNTIME or ACPI_GPE_TYPE_WAKE
|
||||
* or both
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
@ -429,8 +466,7 @@ ACPI_EXPORT_SYMBOL (AcpiEnableGpe)
|
||||
ACPI_STATUS
|
||||
AcpiDisableGpe (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
UINT32 GpeNumber,
|
||||
UINT8 GpeType)
|
||||
UINT32 GpeNumber)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo;
|
||||
@ -440,13 +476,6 @@ AcpiDisableGpe (
|
||||
ACPI_FUNCTION_TRACE (AcpiDisableGpe);
|
||||
|
||||
|
||||
/* Parameter validation */
|
||||
|
||||
if (!GpeType || (GpeType & ~ACPI_GPE_TYPE_WAKE_RUN))
|
||||
{
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
|
||||
|
||||
/* Ensure that we have a valid GPE number */
|
||||
@ -460,47 +489,26 @@ AcpiDisableGpe (
|
||||
|
||||
/* Hardware-disable a runtime GPE on removal of the last reference */
|
||||
|
||||
if (GpeType & ACPI_GPE_TYPE_RUNTIME)
|
||||
if (!GpeEventInfo->RuntimeCount)
|
||||
{
|
||||
if (!GpeEventInfo->RuntimeCount)
|
||||
{
|
||||
Status = AE_LIMIT; /* There are no references to remove */
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
GpeEventInfo->RuntimeCount--;
|
||||
if (!GpeEventInfo->RuntimeCount)
|
||||
{
|
||||
Status = AcpiEvDisableGpe (GpeEventInfo);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
GpeEventInfo->RuntimeCount++;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
}
|
||||
Status = AE_LIMIT; /* There are no references to remove */
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Update masks for wake GPE on removal of the last reference.
|
||||
* No need to hardware-disable wake GPEs here, they are not currently
|
||||
* enabled.
|
||||
*/
|
||||
if (GpeType & ACPI_GPE_TYPE_WAKE)
|
||||
GpeEventInfo->RuntimeCount--;
|
||||
if (!GpeEventInfo->RuntimeCount)
|
||||
{
|
||||
if (!GpeEventInfo->WakeupCount)
|
||||
Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Status = AE_LIMIT; /* There are no references to remove */
|
||||
goto UnlockAndExit;
|
||||
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
|
||||
}
|
||||
|
||||
GpeEventInfo->WakeupCount--;
|
||||
if (!GpeEventInfo->WakeupCount)
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
(void) AcpiEvUpdateGpeEnableMasks (GpeEventInfo);
|
||||
GpeEventInfo->RuntimeCount++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
UnlockAndExit:
|
||||
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
|
||||
return_ACPI_STATUS (Status);
|
||||
@ -563,7 +571,7 @@ AcpiSetGpe (
|
||||
break;
|
||||
|
||||
case ACPI_GPE_DISABLE:
|
||||
Status = AcpiEvDisableGpe (GpeEventInfo);
|
||||
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -864,7 +864,7 @@ AcpiExDumpOperands (
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"**** Start operand dump for opcode [%s], %d operands\n",
|
||||
"**** Start operand dump for opcode [%s], %u operands\n",
|
||||
OpcodeName, NumOperands));
|
||||
|
||||
if (NumOperands == 0)
|
||||
@ -948,7 +948,7 @@ AcpiExDumpNamespaceNode (
|
||||
AcpiOsPrintf ("%20s : %4.4s\n", "Name", AcpiUtGetNodeName (Node));
|
||||
AcpiExOutString ("Type", AcpiUtGetTypeName (Node->Type));
|
||||
AcpiExOutPointer ("Attached Object", AcpiNsGetAttachedObject (Node));
|
||||
AcpiExOutPointer ("Parent", AcpiNsGetParentNode (Node));
|
||||
AcpiExOutPointer ("Parent", Node->Parent);
|
||||
|
||||
AcpiExDumpObject (ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Node),
|
||||
AcpiExDumpNode);
|
||||
@ -1096,7 +1096,7 @@ AcpiExDumpPackageObj (
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
|
||||
AcpiOsPrintf ("[Package] Contains %d Elements:\n",
|
||||
AcpiOsPrintf ("[Package] Contains %u Elements:\n",
|
||||
ObjDesc->Package.Count);
|
||||
|
||||
for (i = 0; i < ObjDesc->Package.Count; i++)
|
||||
|
@ -644,14 +644,14 @@ AcpiExFieldDatumIo (
|
||||
if (ReadWrite == ACPI_READ)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Value Read %8.8X%8.8X, Width %d\n",
|
||||
"Value Read %8.8X%8.8X, Width %u\n",
|
||||
ACPI_FORMAT_UINT64 (*Value),
|
||||
ObjDesc->CommonField.AccessByteWidth));
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Value Written %8.8X%8.8X, Width %d\n",
|
||||
"Value Written %8.8X%8.8X, Width %u\n",
|
||||
ACPI_FORMAT_UINT64 (*Value),
|
||||
ObjDesc->CommonField.AccessByteWidth));
|
||||
}
|
||||
|
@ -193,11 +193,11 @@ AcpiExGenerateAccess (
|
||||
FieldByteLength = FieldByteEndOffset - FieldByteOffset;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Bit length %d, Bit offset %d\n",
|
||||
"Bit length %u, Bit offset %u\n",
|
||||
FieldBitLength, FieldBitOffset));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Byte Length %d, Byte Offset %d, End Offset %d\n",
|
||||
"Byte Length %u, Byte Offset %u, End Offset %u\n",
|
||||
FieldByteLength, FieldByteOffset, FieldByteEndOffset));
|
||||
|
||||
/*
|
||||
@ -228,10 +228,10 @@ AcpiExGenerateAccess (
|
||||
Accesses = FieldEndOffset - FieldStartOffset;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"AccessWidth %d end is within region\n", AccessByteWidth));
|
||||
"AccessWidth %u end is within region\n", AccessByteWidth));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Field Start %d, Field End %d -- requires %d accesses\n",
|
||||
"Field Start %u, Field End %u -- requires %u accesses\n",
|
||||
FieldStartOffset, FieldEndOffset, Accesses));
|
||||
|
||||
/* Single access is optimal */
|
||||
@ -239,7 +239,7 @@ AcpiExGenerateAccess (
|
||||
if (Accesses <= 1)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Entire field can be accessed with one operation of size %d\n",
|
||||
"Entire field can be accessed with one operation of size %u\n",
|
||||
AccessByteWidth));
|
||||
return_VALUE (AccessByteWidth);
|
||||
}
|
||||
@ -257,7 +257,7 @@ AcpiExGenerateAccess (
|
||||
else
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"AccessWidth %d end is NOT within region\n", AccessByteWidth));
|
||||
"AccessWidth %u end is NOT within region\n", AccessByteWidth));
|
||||
if (AccessByteWidth == 1)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
@ -273,7 +273,7 @@ AcpiExGenerateAccess (
|
||||
* previous access
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Backing off to previous optimal access width of %d\n",
|
||||
"Backing off to previous optimal access width of %u\n",
|
||||
MinimumAccessWidth));
|
||||
return_VALUE (MinimumAccessWidth);
|
||||
}
|
||||
@ -479,16 +479,6 @@ AcpiExPrepCommonFieldObject (
|
||||
ObjDesc->CommonField.StartFieldBitOffset = (UINT8)
|
||||
(FieldBitPosition - ACPI_MUL_8 (ObjDesc->CommonField.BaseByteOffset));
|
||||
|
||||
/*
|
||||
* Does the entire field fit within a single field access element? (datum)
|
||||
* (i.e., without crossing a datum boundary)
|
||||
*/
|
||||
if ((ObjDesc->CommonField.StartFieldBitOffset + FieldBitLength) <=
|
||||
(UINT16) AccessBitWidth)
|
||||
{
|
||||
ObjDesc->Common.Flags |= AOPOBJ_SINGLE_DATUM;
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
@ -285,7 +285,7 @@ AcpiExSystemMemorySpaceHandler (
|
||||
((UINT64) Address - (UINT64) MemInfo->MappedPhysicalAddress);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"System-Memory (width %d) R/W %d Address=%8.8X%8.8X\n",
|
||||
"System-Memory (width %u) R/W %u Address=%8.8X%8.8X\n",
|
||||
BitWidth, Function, ACPI_FORMAT_NATIVE_UINT (Address)));
|
||||
|
||||
/*
|
||||
@ -395,7 +395,7 @@ AcpiExSystemIoSpaceHandler (
|
||||
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"System-IO (width %d) R/W %d Address=%8.8X%8.8X\n",
|
||||
"System-IO (width %u) R/W %u Address=%8.8X%8.8X\n",
|
||||
BitWidth, Function, ACPI_FORMAT_NATIVE_UINT (Address)));
|
||||
|
||||
/* Decode the function parameter */
|
||||
@ -475,7 +475,7 @@ AcpiExPciConfigSpaceHandler (
|
||||
PciRegister = (UINT16) (UINT32) Address;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Pci-Config %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
|
||||
"Pci-Config %u (%u) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
|
||||
Function, BitWidth, PciId->Segment, PciId->Bus, PciId->Device,
|
||||
PciId->Function, PciRegister));
|
||||
|
||||
|
@ -302,6 +302,15 @@ AcpiExSystemDoSleep (
|
||||
|
||||
AcpiExRelinquishInterpreter ();
|
||||
|
||||
/*
|
||||
* For compatibility with other ACPI implementations and to prevent
|
||||
* accidental deep sleeps, limit the sleep time to something reasonable.
|
||||
*/
|
||||
if (HowLong > ACPI_MAX_SLEEP)
|
||||
{
|
||||
HowLong = ACPI_MAX_SLEEP;
|
||||
}
|
||||
|
||||
AcpiOsSleep (HowLong);
|
||||
|
||||
/* And now we must get the interpreter again */
|
||||
|
@ -132,23 +132,54 @@ AcpiHwEnableWakeupGpeBlock (
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwLowDisableGpe
|
||||
* FUNCTION: AcpiHwGetGpeRegisterBit
|
||||
*
|
||||
* PARAMETERS: GpeEventInfo - Info block for the GPE
|
||||
* GpeRegisterInfo - Info block for the GPE register
|
||||
*
|
||||
* RETURN: Register mask with a one in the GPE bit position
|
||||
*
|
||||
* DESCRIPTION: Compute the register mask for this GPE. One bit is set in the
|
||||
* correct position for the input GPE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
UINT32
|
||||
AcpiHwGetGpeRegisterBit (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo,
|
||||
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo)
|
||||
{
|
||||
|
||||
return ((UINT32) 1 <<
|
||||
(GpeEventInfo->GpeNumber - GpeRegisterInfo->BaseGpeNumber));
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwLowSetGpe
|
||||
*
|
||||
* PARAMETERS: GpeEventInfo - Info block for the GPE to be disabled
|
||||
* Action - Enable or disable
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Disable a single GPE in the enable register.
|
||||
* DESCRIPTION: Enable or disable a single GPE in the parent enable register.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwLowDisableGpe (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo)
|
||||
AcpiHwLowSetGpe (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo,
|
||||
UINT32 Action)
|
||||
{
|
||||
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
|
||||
ACPI_STATUS Status;
|
||||
UINT32 EnableMask;
|
||||
UINT32 RegisterBit;
|
||||
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
|
||||
|
||||
/* Get the info block for the entire GPE register */
|
||||
@ -167,11 +198,34 @@ AcpiHwLowDisableGpe (
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* Clear just the bit that corresponds to this GPE */
|
||||
/* Set or clear just the bit that corresponds to this GPE */
|
||||
|
||||
ACPI_CLEAR_BIT (EnableMask, ((UINT32) 1 <<
|
||||
(GpeEventInfo->GpeNumber - GpeRegisterInfo->BaseGpeNumber)));
|
||||
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
|
||||
switch (Action)
|
||||
{
|
||||
case ACPI_GPE_CONDITIONAL_ENABLE:
|
||||
|
||||
/* Only enable if the EnableForRun bit is set */
|
||||
|
||||
if (!(RegisterBit & GpeRegisterInfo->EnableForRun))
|
||||
{
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/*lint -fallthrough */
|
||||
|
||||
case ACPI_GPE_ENABLE:
|
||||
ACPI_SET_BIT (EnableMask, RegisterBit);
|
||||
break;
|
||||
|
||||
case ACPI_GPE_DISABLE:
|
||||
ACPI_CLEAR_BIT (EnableMask, RegisterBit);
|
||||
break;
|
||||
|
||||
default:
|
||||
ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u\n", Action));
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/* Write the updated enable mask */
|
||||
|
||||
@ -180,48 +234,6 @@ AcpiHwLowDisableGpe (
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwWriteGpeEnableReg
|
||||
*
|
||||
* PARAMETERS: GpeEventInfo - Info block for the GPE to be enabled
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Write a GPE enable register. Note: The bit for this GPE must
|
||||
* already be cleared or set in the parent register
|
||||
* EnableForRun mask.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwWriteGpeEnableReg (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo)
|
||||
{
|
||||
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
|
||||
|
||||
/* Get the info block for the entire GPE register */
|
||||
|
||||
GpeRegisterInfo = GpeEventInfo->RegisterInfo;
|
||||
if (!GpeRegisterInfo)
|
||||
{
|
||||
return (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
/* Write the entire GPE (runtime) enable register */
|
||||
|
||||
Status = AcpiHwWrite (GpeRegisterInfo->EnableForRun,
|
||||
&GpeRegisterInfo->EnableAddress);
|
||||
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwClearGpe
|
||||
@ -238,22 +250,29 @@ ACPI_STATUS
|
||||
AcpiHwClearGpe (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo)
|
||||
{
|
||||
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
|
||||
ACPI_STATUS Status;
|
||||
UINT8 RegisterBit;
|
||||
UINT32 RegisterBit;
|
||||
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
|
||||
/* Get the info block for the entire GPE register */
|
||||
|
||||
RegisterBit = (UINT8) (1 <<
|
||||
(GpeEventInfo->GpeNumber - GpeEventInfo->RegisterInfo->BaseGpeNumber));
|
||||
GpeRegisterInfo = GpeEventInfo->RegisterInfo;
|
||||
if (!GpeRegisterInfo)
|
||||
{
|
||||
return (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
/*
|
||||
* Write a one to the appropriate bit in the status register to
|
||||
* clear this GPE.
|
||||
*/
|
||||
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
|
||||
|
||||
Status = AcpiHwWrite (RegisterBit,
|
||||
&GpeEventInfo->RegisterInfo->StatusAddress);
|
||||
&GpeRegisterInfo->StatusAddress);
|
||||
|
||||
return (Status);
|
||||
}
|
||||
@ -278,10 +297,10 @@ AcpiHwGetGpeStatus (
|
||||
ACPI_EVENT_STATUS *EventStatus)
|
||||
{
|
||||
UINT32 InByte;
|
||||
UINT8 RegisterBit;
|
||||
UINT32 RegisterBit;
|
||||
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_EVENT_STATUS LocalEventStatus = 0;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
@ -298,8 +317,7 @@ AcpiHwGetGpeStatus (
|
||||
|
||||
/* Get the register bitmask for this GPE */
|
||||
|
||||
RegisterBit = (UINT8) (1 <<
|
||||
(GpeEventInfo->GpeNumber - GpeEventInfo->RegisterInfo->BaseGpeNumber));
|
||||
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
|
||||
|
||||
/* GPE currently enabled? (enabled for runtime?) */
|
||||
|
||||
|
@ -397,7 +397,7 @@ AcpiEnterSleepState (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
|
||||
"Entering sleep state [S%d]\n", SleepState));
|
||||
"Entering sleep state [S%u]\n", SleepState));
|
||||
|
||||
/* Clear the SLP_EN and SLP_TYP fields */
|
||||
|
||||
|
@ -316,6 +316,13 @@ AcpiHwReadPort (
|
||||
UINT32 i;
|
||||
|
||||
|
||||
/* Truncate address to 16 bits if requested */
|
||||
|
||||
if (AcpiGbl_TruncateIoAddresses)
|
||||
{
|
||||
Address &= ACPI_UINT16_MAX;
|
||||
}
|
||||
|
||||
/* Validate the entire request and perform the I/O */
|
||||
|
||||
Status = AcpiHwValidateIoRequest (Address, Width);
|
||||
@ -383,6 +390,13 @@ AcpiHwWritePort (
|
||||
UINT32 i;
|
||||
|
||||
|
||||
/* Truncate address to 16 bits if requested */
|
||||
|
||||
if (AcpiGbl_TruncateIoAddresses)
|
||||
{
|
||||
Address &= ACPI_UINT16_MAX;
|
||||
}
|
||||
|
||||
/* Validate the entire request and perform the I/O */
|
||||
|
||||
Status = AcpiHwValidateIoRequest (Address, Width);
|
||||
|
@ -193,6 +193,10 @@
|
||||
|
||||
#define ACPI_MAX_LOOP_ITERATIONS 0xFFFF
|
||||
|
||||
/* Maximum sleep allowed via Sleep() operator */
|
||||
|
||||
#define ACPI_MAX_SLEEP 20000 /* Two seconds */
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
|
@ -131,9 +131,19 @@ typedef const struct acpi_dmtable_info
|
||||
UINT8 Opcode;
|
||||
UINT8 Offset;
|
||||
char *Name;
|
||||
UINT8 Flags;
|
||||
|
||||
} ACPI_DMTABLE_INFO;
|
||||
|
||||
#define DT_LENGTH 0x01 /* Field is a subtable length */
|
||||
#define DT_FLAG 0x02 /* Field is a flag value */
|
||||
#define DT_NON_ZERO 0x04 /* Field must be non-zero */
|
||||
|
||||
/* TBD: Not used at this time */
|
||||
|
||||
#define DT_OPTIONAL 0x08
|
||||
#define DT_COUNT 0x10
|
||||
|
||||
/*
|
||||
* Values for Opcode above.
|
||||
* Note: 0-7 must not change, used as a flag shift value
|
||||
@ -173,17 +183,29 @@ typedef const struct acpi_dmtable_info
|
||||
#define ACPI_DMT_FADTPM 32
|
||||
#define ACPI_DMT_BUF16 33
|
||||
#define ACPI_DMT_IVRS 34
|
||||
#define ACPI_DMT_BUFFER 35
|
||||
#define ACPI_DMT_PCI_PATH 36
|
||||
#define ACPI_DMT_EINJACT 37
|
||||
#define ACPI_DMT_EINJINST 38
|
||||
#define ACPI_DMT_ERSTACT 39
|
||||
#define ACPI_DMT_ERSTINST 40
|
||||
|
||||
|
||||
typedef
|
||||
void (*ACPI_DMTABLE_HANDLER) (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
typedef
|
||||
ACPI_STATUS (*ACPI_CMTABLE_HANDLER) (
|
||||
void **PFieldList);
|
||||
|
||||
typedef struct acpi_dmtable_data
|
||||
{
|
||||
char *Signature;
|
||||
ACPI_DMTABLE_INFO *TableInfo;
|
||||
ACPI_DMTABLE_HANDLER TableHandler;
|
||||
ACPI_CMTABLE_HANDLER CmTableHandler;
|
||||
const unsigned char *Template;
|
||||
char *Name;
|
||||
|
||||
} ACPI_DMTABLE_DATA;
|
||||
@ -200,11 +222,18 @@ typedef struct acpi_op_walk_info
|
||||
|
||||
} ACPI_OP_WALK_INFO;
|
||||
|
||||
/*
|
||||
* TBD - another copy of this is in asltypes.h, fix
|
||||
*/
|
||||
#ifndef ASL_WALK_CALLBACK_DEFINED
|
||||
typedef
|
||||
ACPI_STATUS (*ASL_WALK_CALLBACK) (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Level,
|
||||
void *Context);
|
||||
#define ASL_WALK_CALLBACK_DEFINED
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct acpi_resource_tag
|
||||
{
|
||||
@ -246,6 +275,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoErst[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoErst0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFacs[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[];
|
||||
@ -306,12 +336,25 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWaet[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWddt[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[];
|
||||
|
||||
|
||||
/*
|
||||
* dmtable
|
||||
*/
|
||||
extern ACPI_DMTABLE_DATA AcpiDmTableData[];
|
||||
|
||||
UINT8
|
||||
AcpiDmGenerateChecksum (
|
||||
void *Table,
|
||||
UINT32 Length,
|
||||
UINT8 OriginalChecksum);
|
||||
|
||||
ACPI_DMTABLE_DATA *
|
||||
AcpiDmGetTableData (
|
||||
char *Signature);
|
||||
|
||||
void
|
||||
AcpiDmDumpDataTable (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
@ -755,4 +798,13 @@ AcpiDmCheckResourceReference (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
|
||||
/*
|
||||
* acdisasm
|
||||
*/
|
||||
void
|
||||
AdDisassemblerHeader (
|
||||
char *Filename);
|
||||
|
||||
|
||||
#endif /* __ACDISASM_H__ */
|
||||
|
@ -174,17 +174,13 @@ AcpiEvGpeDetect (
|
||||
ACPI_GPE_XRUPT_INFO *GpeXruptList);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvUpdateGpeEnableMasks (
|
||||
AcpiEvUpdateGpeEnableMask (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvEnableGpe (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvDisableGpe (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo);
|
||||
|
||||
ACPI_GPE_EVENT_INFO *
|
||||
AcpiEvGetGpeEventInfo (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
|
@ -293,7 +293,7 @@ char const *AcpiGbl_ExceptionNames_Env[] =
|
||||
"AE_NO_GLOBAL_LOCK",
|
||||
"AE_ABORT_METHOD",
|
||||
"AE_SAME_HANDLER",
|
||||
"AE_WAKE_ONLY_GPE",
|
||||
"AE_NO_HANDLER",
|
||||
"AE_OWNER_ID_LIMIT"
|
||||
};
|
||||
|
||||
|
@ -199,6 +199,14 @@ UINT8 ACPI_INIT_GLOBAL (AcpiGbl_EnableAmlDebugObject, FALSE);
|
||||
*/
|
||||
UINT8 ACPI_INIT_GLOBAL (AcpiGbl_CopyDsdtLocally, FALSE);
|
||||
|
||||
/*
|
||||
* Optionally truncate I/O addresses to 16 bits. Provides compatibility
|
||||
* with other ACPI implementations. NOTE: During ACPICA initialization,
|
||||
* this value is set to TRUE if any Windows OSI strings have been
|
||||
* requested by the BIOS.
|
||||
*/
|
||||
UINT8 ACPI_INIT_GLOBAL (AcpiGbl_TruncateIoAddresses, FALSE);
|
||||
|
||||
|
||||
/* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */
|
||||
|
||||
@ -355,6 +363,7 @@ extern const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_
|
||||
ACPI_EXTERN ACPI_MEMORY_LIST *AcpiGbl_GlobalList;
|
||||
ACPI_EXTERN ACPI_MEMORY_LIST *AcpiGbl_NsNodeList;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_DisplayFinalMemStats;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_DisableMemTracking;
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -200,13 +200,15 @@ AcpiHwWritePort (
|
||||
/*
|
||||
* hwgpe - GPE support
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiHwLowDisableGpe (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo);
|
||||
UINT32
|
||||
AcpiHwGetGpeRegisterBit (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo,
|
||||
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwWriteGpeEnableReg (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo);
|
||||
AcpiHwLowSetGpe (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo,
|
||||
UINT32 Action);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwDisableGpeBlock (
|
||||
|
@ -275,8 +275,9 @@ typedef struct acpi_namespace_node
|
||||
UINT8 Flags; /* Miscellaneous flags */
|
||||
ACPI_OWNER_ID OwnerId; /* Node creator */
|
||||
ACPI_NAME_UNION Name; /* ACPI Name, always 4 chars per ACPI spec */
|
||||
struct acpi_namespace_node *Parent; /* Parent node */
|
||||
struct acpi_namespace_node *Child; /* First child */
|
||||
struct acpi_namespace_node *Peer; /* Peer. Parent if ANOBJ_END_OF_PEER_LIST set */
|
||||
struct acpi_namespace_node *Peer; /* First peer */
|
||||
|
||||
/*
|
||||
* The following fields are used by the ASL compiler and disassembler only
|
||||
@ -292,7 +293,7 @@ typedef struct acpi_namespace_node
|
||||
|
||||
/* Namespace Node flags */
|
||||
|
||||
#define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */
|
||||
#define ANOBJ_RESERVED 0x01 /* Available for use */
|
||||
#define ANOBJ_TEMPORARY 0x02 /* Node is create by a method and is temporary */
|
||||
#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */
|
||||
#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */
|
||||
@ -562,7 +563,6 @@ typedef struct acpi_gpe_event_info
|
||||
UINT8 Flags; /* Misc info about this GPE */
|
||||
UINT8 GpeNumber; /* This GPE */
|
||||
UINT8 RuntimeCount; /* References to a run GPE */
|
||||
UINT8 WakeupCount; /* References to a wake GPE */
|
||||
|
||||
} ACPI_GPE_EVENT_INFO;
|
||||
|
||||
|
@ -562,13 +562,4 @@ void
|
||||
AcpiNsTerminate (
|
||||
void);
|
||||
|
||||
ACPI_NAMESPACE_NODE *
|
||||
AcpiNsGetParentNode (
|
||||
ACPI_NAMESPACE_NODE *Node);
|
||||
|
||||
|
||||
ACPI_NAMESPACE_NODE *
|
||||
AcpiNsGetNextValidNode (
|
||||
ACPI_NAMESPACE_NODE *Node);
|
||||
|
||||
#endif /* __ACNAMESP_H__ */
|
||||
|
@ -164,13 +164,14 @@
|
||||
|
||||
/* Values for Flag byte above */
|
||||
|
||||
#define AOPOBJ_AML_CONSTANT 0x01
|
||||
#define AOPOBJ_STATIC_POINTER 0x02
|
||||
#define AOPOBJ_DATA_VALID 0x04
|
||||
#define AOPOBJ_OBJECT_INITIALIZED 0x08
|
||||
#define AOPOBJ_SETUP_COMPLETE 0x10
|
||||
#define AOPOBJ_SINGLE_DATUM 0x20
|
||||
#define AOPOBJ_MODULE_LEVEL 0x40
|
||||
#define AOPOBJ_AML_CONSTANT 0x01 /* Integer is an AML constant */
|
||||
#define AOPOBJ_STATIC_POINTER 0x02 /* Data is part of an ACPI table, don't delete */
|
||||
#define AOPOBJ_DATA_VALID 0x04 /* Object is intialized and data is valid */
|
||||
#define AOPOBJ_OBJECT_INITIALIZED 0x08 /* Region is initialized, _REG was run */
|
||||
#define AOPOBJ_SETUP_COMPLETE 0x10 /* Region setup is complete */
|
||||
#define AOPOBJ_INVALID 0x20 /* Host OS won't allow a Region address */
|
||||
#define AOPOBJ_MODULE_LEVEL 0x40 /* Method is actually module-level code */
|
||||
#define AOPOBJ_MODIFIED_NAMESPACE 0x80 /* Method modified the namespace */
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -143,8 +143,9 @@
|
||||
#define ACPI_TOOLS 0x00002000
|
||||
#define ACPI_EXAMPLE 0x00004000
|
||||
#define ACPI_DRIVER 0x00008000
|
||||
#define DT_COMPILER 0x00010000
|
||||
|
||||
#define ACPI_ALL_COMPONENTS 0x0000FFFF
|
||||
#define ACPI_ALL_COMPONENTS 0x0001FFFF
|
||||
#define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS)
|
||||
|
||||
/* Component IDs reserved for ACPI drivers */
|
||||
|
@ -120,7 +120,7 @@
|
||||
|
||||
/* Current ACPICA subsystem version in YYYYMMDD format */
|
||||
|
||||
#define ACPI_CA_VERSION 0x20100428
|
||||
#define ACPI_CA_VERSION 0x20100702
|
||||
|
||||
#include <contrib/dev/acpica/include/actypes.h>
|
||||
#include <contrib/dev/acpica/include/actbl.h>
|
||||
@ -147,6 +147,7 @@ extern ACPI_NAME AcpiGbl_TraceMethodName;
|
||||
extern UINT32 AcpiGbl_TraceFlags;
|
||||
extern UINT8 AcpiGbl_EnableAmlDebugObject;
|
||||
extern UINT8 AcpiGbl_CopyDsdtLocally;
|
||||
extern UINT8 AcpiGbl_TruncateIoAddresses;
|
||||
|
||||
|
||||
/*
|
||||
@ -472,20 +473,24 @@ AcpiSetGpe (
|
||||
ACPI_STATUS
|
||||
AcpiEnableGpe (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
UINT32 GpeNumber,
|
||||
UINT8 GpeType);
|
||||
UINT32 GpeNumber);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDisableGpe (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
UINT32 GpeNumber,
|
||||
UINT8 GpeType);
|
||||
UINT32 GpeNumber);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiClearGpe (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
UINT32 GpeNumber);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiGpeWakeup (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
UINT32 GpeNumber,
|
||||
UINT8 Action);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiGetGpeStatus (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
|
@ -577,14 +577,15 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
|
||||
{{"_WAK", 1, ACPI_RTYPE_NONE | ACPI_RTYPE_INTEGER | ACPI_RTYPE_PACKAGE}},
|
||||
{{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 2,0}, 0,0}}, /* Fixed-length (2 Int), but is optional */
|
||||
|
||||
/* _WDG/_WED are MS extensions defined by "Windows Instrumentation" */
|
||||
|
||||
{{"_WDG", 0, ACPI_RTYPE_BUFFER}},
|
||||
{{"_WED", 1, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER}},
|
||||
|
||||
{{{0,0,0,0}, 0,0}} /* Table terminator */
|
||||
};
|
||||
|
||||
#if 0
|
||||
/* Not implemented */
|
||||
|
||||
{{"_WDG", 0, ACPI_RTYPE_BUFFER}}, /* MS Extension */
|
||||
{{"_WED", 1, ACPI_RTYPE_PACKAGE}}, /* MS Extension */
|
||||
|
||||
/* This is an internally implemented control method, no need to check */
|
||||
{{"_OSI", 1, ACPI_RTYPE_INTEGER}},
|
||||
|
@ -204,23 +204,23 @@ typedef struct acpi_walk_state
|
||||
} ACPI_WALK_STATE;
|
||||
|
||||
|
||||
/* Info used by AcpiPsInitObjects */
|
||||
/* Info used by AcpiNsInitializeObjects and AcpiDsInitializeObjects */
|
||||
|
||||
typedef struct acpi_init_walk_info
|
||||
{
|
||||
UINT16 MethodCount;
|
||||
UINT16 DeviceCount;
|
||||
UINT16 OpRegionCount;
|
||||
UINT16 FieldCount;
|
||||
UINT16 BufferCount;
|
||||
UINT16 PackageCount;
|
||||
UINT16 OpRegionInit;
|
||||
UINT16 FieldInit;
|
||||
UINT16 BufferInit;
|
||||
UINT16 PackageInit;
|
||||
UINT16 ObjectCount;
|
||||
ACPI_OWNER_ID OwnerId;
|
||||
UINT32 TableIndex;
|
||||
UINT32 ObjectCount;
|
||||
UINT32 MethodCount;
|
||||
UINT32 DeviceCount;
|
||||
UINT32 OpRegionCount;
|
||||
UINT32 FieldCount;
|
||||
UINT32 BufferCount;
|
||||
UINT32 PackageCount;
|
||||
UINT32 OpRegionInit;
|
||||
UINT32 FieldInit;
|
||||
UINT32 BufferInit;
|
||||
UINT32 PackageInit;
|
||||
ACPI_OWNER_ID OwnerId;
|
||||
|
||||
} ACPI_INIT_WALK_INFO;
|
||||
|
||||
@ -294,11 +294,11 @@ typedef struct acpi_evaluate_info
|
||||
|
||||
typedef struct acpi_device_walk_info
|
||||
{
|
||||
UINT16 DeviceCount;
|
||||
UINT16 Num_STA;
|
||||
UINT16 Num_INI;
|
||||
ACPI_TABLE_DESC *TableDesc;
|
||||
ACPI_EVALUATE_INFO *EvaluateInfo;
|
||||
UINT32 DeviceCount;
|
||||
UINT32 Num_STA;
|
||||
UINT32 Num_INI;
|
||||
|
||||
} ACPI_DEVICE_WALK_INFO;
|
||||
|
||||
|
@ -224,7 +224,28 @@ typedef struct acpi_table_rsdp
|
||||
|
||||
} ACPI_TABLE_RSDP;
|
||||
|
||||
#define ACPI_RSDP_REV0_SIZE 20 /* Size of original ACPI 1.0 RSDP */
|
||||
/* Standalone struct for the ACPI 1.0 RSDP */
|
||||
|
||||
typedef struct acpi_rsdp_common
|
||||
{
|
||||
char Signature[8];
|
||||
UINT8 Checksum;
|
||||
char OemId[ACPI_OEM_ID_SIZE];
|
||||
UINT8 Revision;
|
||||
UINT32 RsdtPhysicalAddress;
|
||||
|
||||
} ACPI_RSDP_COMMON;
|
||||
|
||||
/* Standalone struct for the extended part of the RSDP (ACPI 2.0+) */
|
||||
|
||||
typedef struct acpi_rsdp_extension
|
||||
{
|
||||
UINT32 Length;
|
||||
UINT64 XsdtPhysicalAddress;
|
||||
UINT8 ExtendedChecksum;
|
||||
UINT8 Reserved[3];
|
||||
|
||||
} ACPI_RSDP_EXTENSION;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -151,8 +151,17 @@
|
||||
#define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */
|
||||
#define ACPI_SIG_WAET "WAET" /* Windows ACPI Emulated devices Table */
|
||||
#define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */
|
||||
#define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */
|
||||
#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
|
||||
|
||||
#ifdef ACPI_UNDEFINED_TABLES
|
||||
/*
|
||||
* These tables have been seen in the field, but no definition has been found
|
||||
*/
|
||||
#define ACPI_SIG_ATKG "ATKG"
|
||||
#define ACPI_SIG_GSCI "GSCI" /* GMCH SCI table */
|
||||
#define ACPI_SIG_IEIT "IEIT"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* All tables must be byte-packed to match the ACPI specification, since
|
||||
@ -1119,6 +1128,47 @@ enum AcpiWdatInstructions
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* WDDT - Watchdog Descriptor Table
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "Using the Intel ICH Family Watchdog Timer (WDT)",
|
||||
* Version 001, September 2002
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_wddt
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
UINT16 SpecVersion;
|
||||
UINT16 TableVersion;
|
||||
UINT16 PciVendorId;
|
||||
ACPI_GENERIC_ADDRESS Address;
|
||||
UINT16 MaxCount; /* Maximum counter value supported */
|
||||
UINT16 MinCount; /* Minimum counter value supported */
|
||||
UINT16 Period;
|
||||
UINT16 Status;
|
||||
UINT16 Capability;
|
||||
|
||||
} ACPI_TABLE_WDDT;
|
||||
|
||||
/* Flags for Status field above */
|
||||
|
||||
#define ACPI_WDDT_AVAILABLE (1)
|
||||
#define ACPI_WDDT_ACTIVE (1<<1)
|
||||
#define ACPI_WDDT_TCO_OS_OWNED (1<<2)
|
||||
#define ACPI_WDDT_USER_RESET (1<<11)
|
||||
#define ACPI_WDDT_WDT_RESET (1<<12)
|
||||
#define ACPI_WDDT_POWER_FAIL (1<<13)
|
||||
#define ACPI_WDDT_UNKNOWN_RESET (1<<14)
|
||||
|
||||
/* Flags for Capability field above */
|
||||
|
||||
#define ACPI_WDDT_AUTO_RESET (1)
|
||||
#define ACPI_WDDT_ALERT_SUPPORT (1<<1)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* WDRT - Watchdog Resource Table
|
||||
|
@ -742,16 +742,11 @@ typedef UINT32 ACPI_EVENT_STATUS;
|
||||
#define ACPI_GPE_MAX 0xFF
|
||||
#define ACPI_NUM_GPE 256
|
||||
|
||||
/* Actions for AcpiSetGpe */
|
||||
/* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */
|
||||
|
||||
#define ACPI_GPE_ENABLE 0
|
||||
#define ACPI_GPE_DISABLE 1
|
||||
|
||||
/* GpeTypes for AcpiEnableGpe and AcpiDisableGpe */
|
||||
|
||||
#define ACPI_GPE_TYPE_WAKE (UINT8) 0x01
|
||||
#define ACPI_GPE_TYPE_RUNTIME (UINT8) 0x02
|
||||
#define ACPI_GPE_TYPE_WAKE_RUN (UINT8) 0x03
|
||||
#define ACPI_GPE_CONDITIONAL_ENABLE 2
|
||||
|
||||
/*
|
||||
* GPE info flags - Per GPE
|
||||
|
@ -766,6 +766,10 @@ void
|
||||
AcpiUtStrupr (
|
||||
char *SrcString);
|
||||
|
||||
void
|
||||
AcpiUtStrlwr (
|
||||
char *SrcString);
|
||||
|
||||
void
|
||||
AcpiUtPrintString (
|
||||
char *String,
|
||||
|
@ -435,7 +435,7 @@ AcpiNsLookup (
|
||||
while (!AcpiNsOpensScope (PrefixNode->Type) &&
|
||||
PrefixNode->Type != ACPI_TYPE_ANY)
|
||||
{
|
||||
PrefixNode = AcpiNsGetParentNode (PrefixNode);
|
||||
PrefixNode = PrefixNode->Parent;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -516,7 +516,7 @@ AcpiNsLookup (
|
||||
/* Backup to the parent node */
|
||||
|
||||
NumCarats++;
|
||||
ThisNode = AcpiNsGetParentNode (ThisNode);
|
||||
ThisNode = ThisNode->Parent;
|
||||
if (!ThisNode)
|
||||
{
|
||||
/* Current scope has no parent scope */
|
||||
@ -531,7 +531,7 @@ AcpiNsLookup (
|
||||
if (SearchParentFlag == ACPI_NS_NO_UPSEARCH)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
|
||||
"Search scope is [%4.4s], path has %d carat(s)\n",
|
||||
"Search scope is [%4.4s], path has %u carat(s)\n",
|
||||
AcpiUtGetNodeName (ThisNode), NumCarats));
|
||||
}
|
||||
}
|
||||
@ -592,7 +592,7 @@ AcpiNsLookup (
|
||||
Path++;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
|
||||
"Multi Pathname (%d Segments, Flags=%X)\n",
|
||||
"Multi Pathname (%u Segments, Flags=%X)\n",
|
||||
NumSegments, Flags));
|
||||
break;
|
||||
|
||||
|
@ -255,7 +255,7 @@ AcpiNsRemoveNode (
|
||||
ACPI_FUNCTION_TRACE_PTR (NsRemoveNode, Node);
|
||||
|
||||
|
||||
ParentNode = AcpiNsGetParentNode (Node);
|
||||
ParentNode = Node->Parent;
|
||||
|
||||
PrevNode = NULL;
|
||||
NextNode = ParentNode->Child;
|
||||
@ -265,34 +265,22 @@ AcpiNsRemoveNode (
|
||||
while (NextNode != Node)
|
||||
{
|
||||
PrevNode = NextNode;
|
||||
NextNode = PrevNode->Peer;
|
||||
NextNode = NextNode->Peer;
|
||||
}
|
||||
|
||||
if (PrevNode)
|
||||
{
|
||||
/* Node is not first child, unlink it */
|
||||
|
||||
PrevNode->Peer = NextNode->Peer;
|
||||
if (NextNode->Flags & ANOBJ_END_OF_PEER_LIST)
|
||||
{
|
||||
PrevNode->Flags |= ANOBJ_END_OF_PEER_LIST;
|
||||
}
|
||||
PrevNode->Peer = Node->Peer;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Node is first child (has no previous peer) */
|
||||
|
||||
if (NextNode->Flags & ANOBJ_END_OF_PEER_LIST)
|
||||
{
|
||||
/* No peers at all */
|
||||
|
||||
ParentNode->Child = NULL;
|
||||
}
|
||||
else
|
||||
{ /* Link peer list to parent */
|
||||
|
||||
ParentNode->Child = NextNode->Peer;
|
||||
}
|
||||
/*
|
||||
* Node is first child (has no previous peer).
|
||||
* Link peer list to parent
|
||||
*/
|
||||
ParentNode->Child = Node->Peer;
|
||||
}
|
||||
|
||||
/* Delete the node and any attached objects */
|
||||
@ -336,38 +324,47 @@ AcpiNsInstallNode (
|
||||
ACPI_FUNCTION_TRACE (NsInstallNode);
|
||||
|
||||
|
||||
/*
|
||||
* Get the owner ID from the Walk state. The owner ID is used to track
|
||||
* table deletion and deletion of objects created by methods.
|
||||
*/
|
||||
if (WalkState)
|
||||
{
|
||||
/*
|
||||
* Get the owner ID from the Walk state. The owner ID is used to
|
||||
* track table deletion and deletion of objects created by methods.
|
||||
*/
|
||||
OwnerId = WalkState->OwnerId;
|
||||
|
||||
if ((WalkState->MethodDesc) &&
|
||||
(ParentNode != WalkState->MethodNode))
|
||||
{
|
||||
/*
|
||||
* A method is creating a new node that is not a child of the
|
||||
* method (it is non-local). Mark the executing method as having
|
||||
* modified the namespace. This is used for cleanup when the
|
||||
* method exits.
|
||||
*/
|
||||
WalkState->MethodDesc->Method.Flags |= AOPOBJ_MODIFIED_NAMESPACE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Link the new entry into the parent and existing children */
|
||||
|
||||
Node->Peer = NULL;
|
||||
Node->Parent = ParentNode;
|
||||
ChildNode = ParentNode->Child;
|
||||
|
||||
if (!ChildNode)
|
||||
{
|
||||
ParentNode->Child = Node;
|
||||
Node->Flags |= ANOBJ_END_OF_PEER_LIST;
|
||||
Node->Peer = ParentNode;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (!(ChildNode->Flags & ANOBJ_END_OF_PEER_LIST))
|
||||
/* Add node to the end of the peer list */
|
||||
|
||||
while (ChildNode->Peer)
|
||||
{
|
||||
ChildNode = ChildNode->Peer;
|
||||
}
|
||||
|
||||
ChildNode->Peer = Node;
|
||||
|
||||
/* Clear end-of-list flag */
|
||||
|
||||
ChildNode->Flags &= ~ANOBJ_END_OF_PEER_LIST;
|
||||
Node->Flags |= ANOBJ_END_OF_PEER_LIST;
|
||||
Node->Peer = ParentNode;
|
||||
}
|
||||
|
||||
/* Init the new entry */
|
||||
@ -402,9 +399,8 @@ void
|
||||
AcpiNsDeleteChildren (
|
||||
ACPI_NAMESPACE_NODE *ParentNode)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *ChildNode;
|
||||
ACPI_NAMESPACE_NODE *NextNode;
|
||||
UINT8 Flags;
|
||||
ACPI_NAMESPACE_NODE *NodeToDelete;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (NsDeleteChildren, ParentNode);
|
||||
@ -415,39 +411,27 @@ AcpiNsDeleteChildren (
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* If no children, all done! */
|
||||
|
||||
ChildNode = ParentNode->Child;
|
||||
if (!ChildNode)
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* Deallocate all children at this level */
|
||||
|
||||
do
|
||||
NextNode = ParentNode->Child;
|
||||
while (NextNode)
|
||||
{
|
||||
/* Get the things we need */
|
||||
|
||||
NextNode = ChildNode->Peer;
|
||||
Flags = ChildNode->Flags;
|
||||
|
||||
/* Grandchildren should have all been deleted already */
|
||||
|
||||
if (ChildNode->Child)
|
||||
if (NextNode->Child)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Found a grandchild! P=%p C=%p",
|
||||
ParentNode, ChildNode));
|
||||
ParentNode, NextNode));
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete this child node and move on to the next child in the list.
|
||||
* No need to unlink the node since we are deleting the entire branch.
|
||||
*/
|
||||
AcpiNsDeleteNode (ChildNode);
|
||||
ChildNode = NextNode;
|
||||
|
||||
} while (!(Flags & ANOBJ_END_OF_PEER_LIST));
|
||||
NodeToDelete = NextNode;
|
||||
NextNode = NextNode->Peer;
|
||||
AcpiNsDeleteNode (NodeToDelete);
|
||||
};
|
||||
|
||||
/* Clear the parent's child pointer */
|
||||
|
||||
@ -533,7 +517,7 @@ AcpiNsDeleteNamespaceSubtree (
|
||||
|
||||
/* Move up the tree to the grandparent */
|
||||
|
||||
ParentNode = AcpiNsGetParentNode (ParentNode);
|
||||
ParentNode = ParentNode->Parent;
|
||||
}
|
||||
}
|
||||
|
||||
@ -655,7 +639,7 @@ AcpiNsDeleteNamespaceByOwner (
|
||||
|
||||
/* Move up the tree to the grandparent */
|
||||
|
||||
ParentNode = AcpiNsGetParentNode (ParentNode);
|
||||
ParentNode = ParentNode->Parent;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -537,7 +537,7 @@ AcpiNsDumpOneObject (
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("(R%d)", ObjDesc->Common.ReferenceCount);
|
||||
AcpiOsPrintf ("(R%u)", ObjDesc->Common.ReferenceCount);
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
|
@ -185,25 +185,25 @@ AcpiNsInitializeObjects (
|
||||
/* Walk entire namespace from the supplied root */
|
||||
|
||||
Status = AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
|
||||
ACPI_UINT32_MAX, AcpiNsInitOneObject, NULL,
|
||||
&Info, NULL);
|
||||
ACPI_UINT32_MAX, AcpiNsInitOneObject, NULL,
|
||||
&Info, NULL);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace"));
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
|
||||
"\nInitialized %hd/%hd Regions %hd/%hd Fields %hd/%hd "
|
||||
"Buffers %hd/%hd Packages (%hd nodes)\n",
|
||||
"\nInitialized %u/%u Regions %u/%u Fields %u/%u "
|
||||
"Buffers %u/%u Packages (%u nodes)\n",
|
||||
Info.OpRegionInit, Info.OpRegionCount,
|
||||
Info.FieldInit, Info.FieldCount,
|
||||
Info.BufferInit, Info.BufferCount,
|
||||
Info.PackageInit, Info.PackageCount, Info.ObjectCount));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"%hd Control Methods found\n", Info.MethodCount));
|
||||
"%u Control Methods found\n", Info.MethodCount));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"%hd Op Regions found\n", Info.OpRegionCount));
|
||||
"%u Op Regions found\n", Info.OpRegionCount));
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
@ -285,6 +285,16 @@ AcpiNsInitializeDevices (
|
||||
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
|
||||
ACPI_UINT32_MAX, FALSE, AcpiNsInitOneDevice, NULL, &Info, NULL);
|
||||
|
||||
/*
|
||||
* Any _OSI requests should be completed by now. If the BIOS has
|
||||
* requested any Windows OSI strings, we will always truncate
|
||||
* I/O addresses to 16 bits -- for Windows compatibility.
|
||||
*/
|
||||
if (AcpiGbl_OsiData >= ACPI_OSI_WIN_2000)
|
||||
{
|
||||
AcpiGbl_TruncateIoAddresses = TRUE;
|
||||
}
|
||||
|
||||
ACPI_FREE (Info.EvaluateInfo);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@ -292,8 +302,8 @@ AcpiNsInitializeDevices (
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
|
||||
"\nExecuted %hd _INI methods requiring %hd _STA executions "
|
||||
"(examined %hd objects)\n",
|
||||
"\nExecuted %u _INI methods requiring %u _STA executions "
|
||||
"(examined %u objects)\n",
|
||||
Info.Num_INI, Info.Num_STA, Info.DeviceCount));
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
@ -510,7 +520,7 @@ AcpiNsFindIniMethods (
|
||||
* The only _INI methods that we care about are those that are
|
||||
* present under Device, Processor, and Thermal objects.
|
||||
*/
|
||||
ParentNode = AcpiNsGetParentNode (Node);
|
||||
ParentNode = Node->Parent;
|
||||
switch (ParentNode->Type)
|
||||
{
|
||||
case ACPI_TYPE_DEVICE:
|
||||
@ -522,7 +532,7 @@ AcpiNsFindIniMethods (
|
||||
while (ParentNode)
|
||||
{
|
||||
ParentNode->Flags |= ANOBJ_SUBTREE_HAS_INI;
|
||||
ParentNode = AcpiNsGetParentNode (ParentNode);
|
||||
ParentNode = ParentNode->Parent;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -176,7 +176,7 @@ AcpiNsBuildExternalPath (
|
||||
/* Put the name into the buffer */
|
||||
|
||||
ACPI_MOVE_32_TO_32 ((NameBuffer + Index), &ParentNode->Name);
|
||||
ParentNode = AcpiNsGetParentNode (ParentNode);
|
||||
ParentNode = ParentNode->Parent;
|
||||
|
||||
/* Prefix name with the path separator */
|
||||
|
||||
@ -298,7 +298,7 @@ AcpiNsGetPathnameLength (
|
||||
return 0;
|
||||
}
|
||||
Size += ACPI_PATH_SEGMENT_LENGTH;
|
||||
NextNode = AcpiNsGetParentNode (NextNode);
|
||||
NextNode = NextNode->Parent;
|
||||
}
|
||||
|
||||
if (!Size)
|
||||
|
@ -223,7 +223,7 @@ AcpiNsOneCompleteParse (
|
||||
|
||||
/* Parse the AML */
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "*PARSE* pass %d parse\n", PassNumber));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "*PARSE* pass %u parse\n", PassNumber));
|
||||
Status = AcpiPsParseAml (WalkState);
|
||||
|
||||
Cleanup:
|
||||
|
@ -683,7 +683,7 @@ AcpiNsRepairNullElement (
|
||||
{
|
||||
/* Need an Integer - create a zero-value integer */
|
||||
|
||||
NewObject = AcpiUtCreateIntegerObject (0);
|
||||
NewObject = AcpiUtCreateIntegerObject ((UINT64) 0);
|
||||
}
|
||||
else if (ExpectedBtypes & ACPI_RTYPE_STRING)
|
||||
{
|
||||
|
@ -200,6 +200,13 @@ AcpiNsSortList (
|
||||
* _GTM: Convert Buffer of BYTEs to a Buffer of DWORDs
|
||||
* _PSS: Sort the list descending by Power
|
||||
* _TSS: Sort the list descending by Power
|
||||
*
|
||||
* Names that must be packages, but cannot be sorted:
|
||||
*
|
||||
* _BCL: Values are tied to the Package index where they appear, and cannot
|
||||
* be moved or sorted. These index values are used for _BQC and _BCM.
|
||||
* However, we can fix the case where a buffer is returned, by converting
|
||||
* it to a Package of integers.
|
||||
*/
|
||||
static const ACPI_REPAIR_INFO AcpiNsRepairableNames[] =
|
||||
{
|
||||
|
@ -229,17 +229,6 @@ AcpiNsSearchOneScope (
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* The last entry in the list points back to the parent,
|
||||
* so a flag is used to indicate the end-of-list
|
||||
*/
|
||||
if (Node->Flags & ANOBJ_END_OF_PEER_LIST)
|
||||
{
|
||||
/* Searched entire list, we are done */
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/* Didn't match name, move on to the next peer object */
|
||||
|
||||
Node = Node->Peer;
|
||||
@ -296,7 +285,7 @@ AcpiNsSearchParentTree (
|
||||
ACPI_FUNCTION_TRACE (NsSearchParentTree);
|
||||
|
||||
|
||||
ParentNode = AcpiNsGetParentNode (Node);
|
||||
ParentNode = Node->Parent;
|
||||
|
||||
/*
|
||||
* If there is no parent (i.e., we are at the root) or type is "local",
|
||||
@ -341,7 +330,7 @@ AcpiNsSearchParentTree (
|
||||
|
||||
/* Not found here, go up another level (until we reach the root) */
|
||||
|
||||
ParentNode = AcpiNsGetParentNode (ParentNode);
|
||||
ParentNode = ParentNode->Parent;
|
||||
}
|
||||
|
||||
/* Not found in parent tree */
|
||||
|
@ -1057,128 +1057,3 @@ AcpiNsGetNode (
|
||||
ACPI_FREE (InternalPath);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsGetParentNode
|
||||
*
|
||||
* PARAMETERS: Node - Current table entry
|
||||
*
|
||||
* RETURN: Parent entry of the given entry
|
||||
*
|
||||
* DESCRIPTION: Obtain the parent entry for a given entry in the namespace.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_NAMESPACE_NODE *
|
||||
AcpiNsGetParentNode (
|
||||
ACPI_NAMESPACE_NODE *Node)
|
||||
{
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
|
||||
|
||||
if (!Node)
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Walk to the end of this peer list. The last entry is marked with a flag
|
||||
* and the peer pointer is really a pointer back to the parent. This saves
|
||||
* putting a parent back pointer in each and every named object!
|
||||
*/
|
||||
while (!(Node->Flags & ANOBJ_END_OF_PEER_LIST))
|
||||
{
|
||||
Node = Node->Peer;
|
||||
}
|
||||
|
||||
return (Node->Peer);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsGetNextValidNode
|
||||
*
|
||||
* PARAMETERS: Node - Current table entry
|
||||
*
|
||||
* RETURN: Next valid Node in the linked node list. NULL if no more valid
|
||||
* nodes.
|
||||
*
|
||||
* DESCRIPTION: Find the next valid node within a name table.
|
||||
* Useful for implementing NULL-end-of-list loops.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_NAMESPACE_NODE *
|
||||
AcpiNsGetNextValidNode (
|
||||
ACPI_NAMESPACE_NODE *Node)
|
||||
{
|
||||
|
||||
/* If we are at the end of this peer list, return NULL */
|
||||
|
||||
if (Node->Flags & ANOBJ_END_OF_PEER_LIST)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Otherwise just return the next peer */
|
||||
|
||||
return (Node->Peer);
|
||||
}
|
||||
|
||||
|
||||
#ifdef ACPI_OBSOLETE_FUNCTIONS
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsFindParentName
|
||||
*
|
||||
* PARAMETERS: *ChildNode - Named Obj whose name is to be found
|
||||
*
|
||||
* RETURN: The ACPI name
|
||||
*
|
||||
* DESCRIPTION: Search for the given obj in its parent scope and return the
|
||||
* name segment, or "????" if the parent name can't be found
|
||||
* (which "should not happen").
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_NAME
|
||||
AcpiNsFindParentName (
|
||||
ACPI_NAMESPACE_NODE *ChildNode)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *ParentNode;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (NsFindParentName);
|
||||
|
||||
|
||||
if (ChildNode)
|
||||
{
|
||||
/* Valid entry. Get the parent Node */
|
||||
|
||||
ParentNode = AcpiNsGetParentNode (ChildNode);
|
||||
if (ParentNode)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Parent of %p [%4.4s] is %p [%4.4s]\n",
|
||||
ChildNode, AcpiUtGetNodeName (ChildNode),
|
||||
ParentNode, AcpiUtGetNodeName (ParentNode)));
|
||||
|
||||
if (ParentNode->Name.Integer)
|
||||
{
|
||||
return_VALUE ((ACPI_NAME) ParentNode->Name.Integer);
|
||||
}
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Unable to find parent of %p (%4.4s)\n",
|
||||
ChildNode, AcpiUtGetNodeName (ChildNode)));
|
||||
}
|
||||
|
||||
return_VALUE (ACPI_UNKNOWN_NAME);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -158,16 +158,6 @@ AcpiNsGetNextNode (
|
||||
return (ParentNode->Child);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the next node.
|
||||
*
|
||||
* If we are at the end of this peer list, return NULL
|
||||
*/
|
||||
if (ChildNode->Flags & ANOBJ_END_OF_PEER_LIST)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Otherwise just return the next peer */
|
||||
|
||||
return (ChildNode->Peer);
|
||||
@ -227,9 +217,9 @@ AcpiNsGetNextNodeTyped (
|
||||
return (NextNode);
|
||||
}
|
||||
|
||||
/* Otherwise, move on to the next node */
|
||||
/* Otherwise, move on to the next peer node */
|
||||
|
||||
NextNode = AcpiNsGetNextValidNode (NextNode);
|
||||
NextNode = NextNode->Peer;
|
||||
}
|
||||
|
||||
/* Not found */
|
||||
@ -454,7 +444,7 @@ AcpiNsWalkNamespace (
|
||||
*/
|
||||
Level--;
|
||||
ChildNode = ParentNode;
|
||||
ParentNode = AcpiNsGetParentNode (ParentNode);
|
||||
ParentNode = ParentNode->Parent;
|
||||
|
||||
NodePreviouslyVisited = TRUE;
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ AcpiGetParent (
|
||||
|
||||
/* Get the parent entry */
|
||||
|
||||
ParentNode = AcpiNsGetParentNode (Node);
|
||||
ParentNode = Node->Parent;
|
||||
*RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, ParentNode);
|
||||
|
||||
/* Return exception if parent is null */
|
||||
|
@ -117,6 +117,8 @@
|
||||
/*
|
||||
* These interfaces are required in order to compile the ASL compiler under
|
||||
* Linux or other Unix-like system.
|
||||
*
|
||||
* Note: Use #define __APPLE__ for OS X generation.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@ -126,6 +128,7 @@
|
||||
#include <sys/time.h>
|
||||
#include <semaphore.h>
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <contrib/dev/acpica/include/acpi.h>
|
||||
#include <contrib/dev/acpica/include/accommon.h>
|
||||
@ -528,8 +531,15 @@ AcpiOsCreateSemaphore (
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
Sem = AcpiOsAllocate (sizeof (sem_t));
|
||||
#ifdef __APPLE__
|
||||
Sem = sem_open (tmpnam (NULL), O_EXCL|O_CREAT, 0755, InitialUnits);
|
||||
if (!Sem)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
#else
|
||||
Sem = AcpiOsAllocate (sizeof (sem_t));
|
||||
if (!Sem)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
@ -540,6 +550,7 @@ AcpiOsCreateSemaphore (
|
||||
AcpiOsFree (Sem);
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
#endif
|
||||
|
||||
*OutHandle = (ACPI_HANDLE) Sem;
|
||||
return (AE_OK);
|
||||
|
@ -944,10 +944,10 @@ AcpiUtInitGlobals (
|
||||
AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
|
||||
AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
|
||||
AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE;
|
||||
AcpiGbl_RootNodeStruct.Parent = NULL;
|
||||
AcpiGbl_RootNodeStruct.Child = NULL;
|
||||
AcpiGbl_RootNodeStruct.Peer = NULL;
|
||||
AcpiGbl_RootNodeStruct.Object = NULL;
|
||||
AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST;
|
||||
|
||||
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
@ -960,6 +960,7 @@ AcpiUtInitGlobals (
|
||||
|
||||
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
|
||||
AcpiGbl_DisplayFinalMemStats = FALSE;
|
||||
AcpiGbl_DisableMemTracking = FALSE;
|
||||
#endif
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
|
@ -505,6 +505,48 @@ AcpiUtStrupr (
|
||||
}
|
||||
|
||||
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtStrlwr (strlwr)
|
||||
*
|
||||
* PARAMETERS: SrcString - The source string to convert
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Convert string to lowercase
|
||||
*
|
||||
* NOTE: This is not a POSIX function, so it appears here, not in utclib.c
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiUtStrlwr (
|
||||
char *SrcString)
|
||||
{
|
||||
char *String;
|
||||
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
|
||||
|
||||
if (!SrcString)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Walk entire string, lowercasing the letters */
|
||||
|
||||
for (String = SrcString; *String; String++)
|
||||
{
|
||||
*String = (char) ACPI_TOLOWER (*String);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtPrintString
|
||||
|
@ -436,6 +436,11 @@ AcpiUtTrackAllocation (
|
||||
ACPI_FUNCTION_TRACE_PTR (UtTrackAllocation, Allocation);
|
||||
|
||||
|
||||
if (AcpiGbl_DisableMemTracking)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
MemList = AcpiGbl_GlobalList;
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_MEMORY);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@ -518,6 +523,11 @@ AcpiUtRemoveAllocation (
|
||||
ACPI_FUNCTION_TRACE (UtRemoveAllocation);
|
||||
|
||||
|
||||
if (AcpiGbl_DisableMemTracking)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
MemList = AcpiGbl_GlobalList;
|
||||
if (NULL == MemList->ListHead)
|
||||
{
|
||||
@ -650,6 +660,11 @@ AcpiUtDumpAllocations (
|
||||
ACPI_FUNCTION_TRACE (UtDumpAllocations);
|
||||
|
||||
|
||||
if (AcpiGbl_DisableMemTracking)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Walk the allocation list.
|
||||
*/
|
||||
@ -668,7 +683,7 @@ AcpiUtDumpAllocations (
|
||||
|
||||
if (Element->Size < sizeof (ACPI_COMMON_DESCRIPTOR))
|
||||
{
|
||||
AcpiOsPrintf ("%p Length 0x%04X %9.9s-%d "
|
||||
AcpiOsPrintf ("%p Length 0x%04X %9.9s-%u "
|
||||
"[Not a Descriptor - too small]\n",
|
||||
Descriptor, Element->Size, Element->Module,
|
||||
Element->Line);
|
||||
@ -679,7 +694,7 @@ AcpiUtDumpAllocations (
|
||||
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE (Descriptor) != ACPI_DESC_TYPE_CACHED)
|
||||
{
|
||||
AcpiOsPrintf ("%p Length 0x%04X %9.9s-%d [%s] ",
|
||||
AcpiOsPrintf ("%p Length 0x%04X %9.9s-%u [%s] ",
|
||||
Descriptor, Element->Size, Element->Module,
|
||||
Element->Line, AcpiUtGetDescriptorName (Descriptor));
|
||||
|
||||
@ -757,7 +772,7 @@ AcpiUtDumpAllocations (
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "%d(0x%X) Outstanding allocations",
|
||||
ACPI_ERROR ((AE_INFO, "%u(0x%X) Outstanding allocations",
|
||||
NumOutstanding, NumOutstanding));
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user