Merge ACPICA 20130214.
This commit is contained in:
commit
9c48c75ed6
@ -371,6 +371,7 @@ contrib/dev/acpica/components/hardware/hwxface.c optional acpi
|
||||
contrib/dev/acpica/components/hardware/hwxfsleep.c optional acpi
|
||||
contrib/dev/acpica/components/namespace/nsaccess.c optional acpi
|
||||
contrib/dev/acpica/components/namespace/nsalloc.c optional acpi
|
||||
contrib/dev/acpica/components/namespace/nsconvert.c optional acpi
|
||||
contrib/dev/acpica/components/namespace/nsdump.c optional acpi
|
||||
contrib/dev/acpica/components/namespace/nseval.c optional acpi
|
||||
contrib/dev/acpica/components/namespace/nsinit.c optional acpi
|
||||
|
@ -1,7 +1,101 @@
|
||||
----------------------------------------
|
||||
14 February 2013. Summary of changes for version 20130214:
|
||||
|
||||
1) ACPICA Kernel-resident Subsystem:
|
||||
|
||||
Fixed a possible regression on some hosts: Reinstated the safe return
|
||||
macros (return_ACPI_STATUS, etc.) that ensure that the argument is
|
||||
evaluated only once. Although these macros are not needed for the ACPICA
|
||||
code itself, they are often used by ACPI-related host device drivers where
|
||||
the safe feature may be necessary.
|
||||
|
||||
Fixed several issues related to the ACPI 5.0 reduced hardware support
|
||||
(SOC): Now ensure that if the platform declares itself as hardware-reduced
|
||||
via the FADT, the following functions become NOOPs (and always return
|
||||
AE_OK) because ACPI is always enabled by definition on these machines:
|
||||
AcpiEnable
|
||||
AcpiDisable
|
||||
AcpiHwGetMode
|
||||
AcpiHwSetMode
|
||||
|
||||
Dynamic Object Repair: Implemented additional runtime repairs for
|
||||
predefined name return values. Both of these repairs can simplify code in
|
||||
the related device drivers that invoke these methods:
|
||||
1) For the _STR and _MLS names, automatically repair/convert an ASCII
|
||||
string to a Unicode buffer.
|
||||
2) For the _CRS, _PRS, and _DMA names, return a resource descriptor with a
|
||||
lone end tag descriptor in the following cases: A Return(0) was executed,
|
||||
a null buffer was returned, or no object at all was returned (non-slack
|
||||
mode only). Adds a new file, nsconvert.c
|
||||
ACPICA BZ 998. Bob Moore, Lv Zheng.
|
||||
|
||||
Resource Manager: Added additional code to prevent possible infinite loops
|
||||
while traversing corrupted or ill-formed resource template buffers. Check
|
||||
for zero-length resource descriptors in all code that loops through
|
||||
resource templates (the length field is used to index through the
|
||||
template). This change also hardens the external AcpiWalkResources and
|
||||
AcpiWalkResourceBuffer interfaces.
|
||||
|
||||
Local Cache Manager: Enhanced the main data structure to eliminate an
|
||||
unnecessary mechanism to access the next object in the list. Actually
|
||||
provides a small performance enhancement for hosts that use the local
|
||||
ACPICA cache manager. Jung-uk Kim.
|
||||
|
||||
Example Code and Data Size: These are the sizes for the OS-independent
|
||||
acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
|
||||
debug version of the code includes the debug output trace mechanism and
|
||||
has a much larger code and data size.
|
||||
|
||||
Previous Release:
|
||||
Non-Debug Version: 94.5K Code, 25.4K Data, 119.9K Total
|
||||
Debug Version: 182.3K Code, 75.0K Data, 257.3K Total
|
||||
Current Release:
|
||||
Non-Debug Version: 95.0K Code, 25.9K Data, 120.9K Total
|
||||
Debug Version: 182.9K Code, 75.6K Data, 258.5K Total
|
||||
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
iASL/Disassembler: Fixed several issues with the definition of the ACPI
|
||||
5.0 RASF table (RAS Feature Table). This change incorporates late changes
|
||||
that were made to the ACPI 5.0 specification.
|
||||
|
||||
iASL/Disassembler: Added full support for the following new ACPI tables:
|
||||
1) The MTMR table (MID Timer Table)
|
||||
2) The VRTC table (Virtual Real Time Clock Table).
|
||||
Includes header file, disassembler, table compiler, and template support
|
||||
for both tables.
|
||||
|
||||
iASL: Implemented compile-time validation of package objects returned by
|
||||
predefined names. This new feature validates static package objects
|
||||
returned by the various predefined names defined to return packages. Both
|
||||
object types and package lengths are validated, for both parent packages
|
||||
and sub-packages, if any. The code is similar in structure and behavior to
|
||||
the runtime repair mechanism within the AML interpreter and uses the
|
||||
existing predefined name information table. Adds a new file, aslprepkg.c.
|
||||
ACPICA BZ 938.
|
||||
|
||||
iASL: Implemented auto-detection of binary ACPI tables for disassembly.
|
||||
This feature detects a binary file with a valid ACPI table header and
|
||||
invokes the disassembler automatically. Eliminates the need to
|
||||
specifically invoke the disassembler with the -d option. ACPICA BZ 862.
|
||||
|
||||
iASL/Disassembler: Added several warnings for the case where there are
|
||||
unresolved control methods during the disassembly. This can potentially
|
||||
cause errors when the output file is compiled, because the disassembler
|
||||
assumes zero method arguments in these cases (it cannot determine the
|
||||
actual number of arguments without resolution/definition of the method).
|
||||
|
||||
Debugger: Added support to display all resources with a single command.
|
||||
Invocation of the resources command with no arguments will now display all
|
||||
resources within the current namespace.
|
||||
|
||||
AcpiHelp: Added descriptive text for each ACPICA exception code displayed
|
||||
via the -e option.
|
||||
|
||||
----------------------------------------
|
||||
17 January 2013. Summary of changes for version 20130117:
|
||||
|
||||
|
||||
1) ACPICA Kernel-resident Subsystem:
|
||||
|
||||
Updated the AcpiGetSleepTypeData interface: Allow the \_Sx methods to
|
||||
|
@ -372,7 +372,7 @@ AdAmlDisassemble (
|
||||
}
|
||||
|
||||
/*
|
||||
* Output: ASL code. Redirect to a file if requested
|
||||
* Output: ASL code. Redirect to a file if requested
|
||||
*/
|
||||
if (OutToFile)
|
||||
{
|
||||
@ -540,11 +540,6 @@ Cleanup:
|
||||
ACPI_FREE (Table);
|
||||
}
|
||||
|
||||
if (DisasmFilename)
|
||||
{
|
||||
ACPI_FREE (DisasmFilename);
|
||||
}
|
||||
|
||||
if (OutToFile && File)
|
||||
{
|
||||
if (AslCompilerdebug) /* Display final namespace, with transforms */
|
||||
@ -667,7 +662,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\n");
|
||||
AcpiOsPrintf (" */\n");
|
||||
|
||||
/* Create AML output filename based on input filename */
|
||||
|
||||
|
@ -837,7 +837,7 @@ AcpiDmXrefDescendingOp (
|
||||
}
|
||||
}
|
||||
|
||||
AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, ParamCount);
|
||||
AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, ParamCount | 0x80);
|
||||
Op->Common.Node = Node;
|
||||
}
|
||||
else
|
||||
|
@ -46,6 +46,7 @@
|
||||
#include <contrib/dev/acpica/include/amlcode.h>
|
||||
#include <contrib/dev/acpica/include/acnamesp.h>
|
||||
#include <contrib/dev/acpica/include/acdisasm.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
/*
|
||||
@ -373,6 +374,7 @@ AcpiDmAddToExternalList (
|
||||
ACPI_EXTERNAL_LIST *NextExternal;
|
||||
ACPI_EXTERNAL_LIST *PrevExternal = NULL;
|
||||
ACPI_STATUS Status;
|
||||
BOOLEAN Resolved = FALSE;
|
||||
|
||||
|
||||
if (!Path)
|
||||
@ -380,6 +382,15 @@ AcpiDmAddToExternalList (
|
||||
return;
|
||||
}
|
||||
|
||||
if (Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
if (Value & 0x80)
|
||||
{
|
||||
Resolved = TRUE;
|
||||
}
|
||||
Value &= 0x07;
|
||||
}
|
||||
|
||||
/*
|
||||
* We don't want External() statements to contain a leading '\'.
|
||||
* This prevents duplicate external statements of the form:
|
||||
@ -464,6 +475,7 @@ AcpiDmAddToExternalList (
|
||||
NewExternal->Path = ExternalPath;
|
||||
NewExternal->Type = Type;
|
||||
NewExternal->Value = Value;
|
||||
NewExternal->Resolved = Resolved;
|
||||
NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath);
|
||||
|
||||
/* Was the external path with parent prefix normalized to a fullpath? */
|
||||
@ -683,6 +695,29 @@ AcpiDmEmitExternals (
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Determine the number of control methods in the external list, and
|
||||
* also how many of those externals were resolved via the namespace.
|
||||
*/
|
||||
NextExternal = AcpiGbl_ExternalList;
|
||||
while (NextExternal)
|
||||
{
|
||||
if (NextExternal->Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
AcpiGbl_NumExternalMethods++;
|
||||
if (NextExternal->Resolved)
|
||||
{
|
||||
AcpiGbl_ResolvedExternalMethods++;
|
||||
}
|
||||
}
|
||||
|
||||
NextExternal = NextExternal->Next;
|
||||
}
|
||||
|
||||
/* Check if any control methods were unresolved */
|
||||
|
||||
AcpiDmUnresolvedWarning (1);
|
||||
|
||||
/*
|
||||
* Walk the list of externals (unresolved references)
|
||||
* found during the AML parsing
|
||||
@ -695,8 +730,17 @@ AcpiDmEmitExternals (
|
||||
|
||||
if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
AcpiOsPrintf (") // %u Arguments\n",
|
||||
AcpiGbl_ExternalList->Value);
|
||||
if (AcpiGbl_ExternalList->Resolved)
|
||||
{
|
||||
AcpiOsPrintf (") // %u Arguments\n",
|
||||
AcpiGbl_ExternalList->Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf (") // Warning: unresolved Method, "
|
||||
"assuming %u arguments (may be incorrect, see warning above)\n",
|
||||
AcpiGbl_ExternalList->Value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -718,3 +762,173 @@ AcpiDmEmitExternals (
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmUnresolvedWarning
|
||||
*
|
||||
* PARAMETERS: Type - Where to output the warning.
|
||||
* 0 means write to stderr
|
||||
* 1 means write to AcpiOsPrintf
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Issue warning message if there are unresolved external control
|
||||
* methods within the disassembly.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#if 0
|
||||
Summary of the external control method problem:
|
||||
|
||||
When the -e option is used with disassembly, the various SSDTs are simply
|
||||
loaded into a global namespace for the disassembler to use in order to
|
||||
resolve control method references (invocations).
|
||||
|
||||
The disassembler tracks any such references, and will emit an External()
|
||||
statement for these types of methods, with the proper number of arguments .
|
||||
|
||||
Without the SSDTs, the AML does not contain enough information to properly
|
||||
disassemble the control method invocation -- because the disassembler does
|
||||
not know how many arguments to parse.
|
||||
|
||||
An example: Assume we have two control methods. ABCD has one argument, and
|
||||
EFGH has zero arguments. Further, we have two additional control methods
|
||||
that invoke ABCD and EFGH, named T1 and T2:
|
||||
|
||||
Method (ABCD, 1)
|
||||
{
|
||||
}
|
||||
Method (EFGH, 0)
|
||||
{
|
||||
}
|
||||
Method (T1)
|
||||
{
|
||||
ABCD (Add (2, 7, Local0))
|
||||
}
|
||||
Method (T2)
|
||||
{
|
||||
EFGH ()
|
||||
Add (2, 7, Local0)
|
||||
}
|
||||
|
||||
Here is the AML code that is generated for T1 and T2:
|
||||
|
||||
185: Method (T1)
|
||||
|
||||
0000034C: 14 10 54 31 5F 5F 00 ... "..T1__."
|
||||
|
||||
186: {
|
||||
187: ABCD (Add (2, 7, Local0))
|
||||
|
||||
00000353: 41 42 43 44 ............ "ABCD"
|
||||
00000357: 72 0A 02 0A 07 60 ...... "r....`"
|
||||
|
||||
188: }
|
||||
|
||||
190: Method (T2)
|
||||
|
||||
0000035D: 14 10 54 32 5F 5F 00 ... "..T2__."
|
||||
|
||||
191: {
|
||||
192: EFGH ()
|
||||
|
||||
00000364: 45 46 47 48 ............ "EFGH"
|
||||
|
||||
193: Add (2, 7, Local0)
|
||||
|
||||
00000368: 72 0A 02 0A 07 60 ...... "r....`"
|
||||
194: }
|
||||
|
||||
Note that the AML code for T1 and T2 is essentially identical. When
|
||||
disassembling this code, the methods ABCD and EFGH must be known to the
|
||||
disassembler, otherwise it does not know how to handle the method invocations.
|
||||
|
||||
In other words, if ABCD and EFGH are actually external control methods
|
||||
appearing in an SSDT, the disassembler does not know what to do unless
|
||||
the owning SSDT has been loaded via the -e option.
|
||||
#endif
|
||||
|
||||
void
|
||||
AcpiDmUnresolvedWarning (
|
||||
UINT8 Type)
|
||||
{
|
||||
|
||||
if (!AcpiGbl_NumExternalMethods)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Type)
|
||||
{
|
||||
if (!AcpiGbl_ExternalFileList)
|
||||
{
|
||||
/* The -e option was not specified */
|
||||
|
||||
AcpiOsPrintf (" /*\n"
|
||||
" * iASL Warning: There were %u external control methods found during\n"
|
||||
" * disassembly, but additional ACPI tables to resolve these externals\n"
|
||||
" * were not specified. This resulting disassembler output file may not\n"
|
||||
" * compile because the disassembler did not know how many arguments\n"
|
||||
" * to assign to these methods. To specify the tables needed to resolve\n"
|
||||
" * external control method references, use the one of the following\n"
|
||||
" * example iASL invocations:\n"
|
||||
" * iasl -e <ssdt1.aml,ssdt2.aml...> -d <dsdt.aml>\n"
|
||||
" * iasl -e <dsdt.aml,ssdt2.aml...> -d <ssdt1.aml>\n"
|
||||
" */\n",
|
||||
AcpiGbl_NumExternalMethods);
|
||||
}
|
||||
else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods)
|
||||
{
|
||||
/* The -e option was specified, but there are still some unresolved externals */
|
||||
|
||||
AcpiOsPrintf (" /*\n"
|
||||
" * iASL Warning: There were %u external control methods found during\n"
|
||||
" * disassembly, but only %u %s resolved (%u unresolved). Additional\n"
|
||||
" * ACPI tables are required to properly disassemble the code. This\n"
|
||||
" * resulting disassembler output file may not compile because the\n"
|
||||
" * disassembler did not know how many arguments to assign to the\n"
|
||||
" * unresolved methods.\n"
|
||||
" */\n",
|
||||
AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods,
|
||||
(AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"),
|
||||
(AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!AcpiGbl_ExternalFileList)
|
||||
{
|
||||
/* The -e option was not specified */
|
||||
|
||||
fprintf (stderr, "\n"
|
||||
"iASL Warning: There were %u external control methods found during\n"
|
||||
"disassembly, but additional ACPI tables to resolve these externals\n"
|
||||
"were not specified. The resulting disassembler output file may not\n"
|
||||
"compile because the disassembler did not know how many arguments\n"
|
||||
"to assign to these methods. To specify the tables needed to resolve\n"
|
||||
"external control method references, use the one of the following\n"
|
||||
"example iASL invocations:\n"
|
||||
" iasl -e <ssdt1.aml,ssdt2.aml...> -d <dsdt.aml>\n"
|
||||
" iasl -e <dsdt.aml,ssdt2.aml...> -d <ssdt1.aml>\n",
|
||||
AcpiGbl_NumExternalMethods);
|
||||
}
|
||||
else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods)
|
||||
{
|
||||
/* The -e option was specified, but there are still some unresolved externals */
|
||||
|
||||
fprintf (stderr, "\n"
|
||||
"iASL Warning: There were %u external control methods found during\n"
|
||||
"disassembly, but only %u %s resolved (%u unresolved). Additional\n"
|
||||
"ACPI tables are required to properly disassemble the code. The\n"
|
||||
"resulting disassembler output file may not compile because the\n"
|
||||
"disassembler did not know how many arguments to assign to the\n"
|
||||
"unresolved methods.\n",
|
||||
AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods,
|
||||
(AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"),
|
||||
(AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -299,6 +299,7 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] =
|
||||
{ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi, "Management Controller Host Interface table"},
|
||||
{ACPI_SIG_MPST, AcpiDmTableInfoMpst, AcpiDmDumpMpst, DtCompileMpst, TemplateMpst, "Memory Power State Table"},
|
||||
{ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct, "Maximum System Characteristics Table"},
|
||||
{ACPI_SIG_MTMR, NULL, AcpiDmDumpMtmr, DtCompileMtmr, TemplateMtmr, "MID Timer Table"},
|
||||
{ACPI_SIG_PCCT, NULL, AcpiDmDumpPcct, NULL, NULL, "Platform Communications Channel Table"},
|
||||
{ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt, "Platform Memory Topology Table"},
|
||||
{ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt, "Root System Description Table"},
|
||||
@ -312,6 +313,7 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] =
|
||||
{ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, NULL, TemplateTcpa, "Trusted Computing Platform Alliance table"},
|
||||
{ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, NULL, NULL, TemplateTpm2, "Trusted Platform Module hardware interface table"},
|
||||
{ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, DtCompileUefi, TemplateUefi, "UEFI Boot Optimization Table"},
|
||||
{ACPI_SIG_VRTC, AcpiDmTableInfoVrtc, AcpiDmDumpVrtc, DtCompileVrtc, TemplateVrtc, "Virtual Real-Time Clock 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"},
|
||||
@ -475,6 +477,8 @@ AcpiDmDumpDataTable (
|
||||
{
|
||||
AcpiOsPrintf ("\n**** Unknown ACPI table type [%4.4s]\n\n",
|
||||
Table->Signature);
|
||||
fprintf (stderr, "Unknown ACPI table signature [%4.4s], decoding header only\n",
|
||||
Table->Signature);
|
||||
}
|
||||
}
|
||||
else if (TableData->TableHandler)
|
||||
|
@ -1794,6 +1794,58 @@ AcpiDmDumpMsct (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpMtmr
|
||||
*
|
||||
* PARAMETERS: Table - A MTMR table
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Format the contents of a MTMR
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDmDumpMtmr (
|
||||
ACPI_TABLE_HEADER *Table)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_MTMR);
|
||||
ACPI_MTMR_ENTRY *SubTable;
|
||||
|
||||
|
||||
/* Main table */
|
||||
|
||||
Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMtmr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common sub-table header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
|
||||
sizeof (ACPI_MTMR_ENTRY), AcpiDmTableInfoMtmr0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Point to next sub-table */
|
||||
|
||||
Offset += sizeof (ACPI_MTMR_ENTRY);
|
||||
SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, SubTable, sizeof (ACPI_MTMR_ENTRY));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpPcct
|
||||
@ -2376,6 +2428,58 @@ NextSubTable:
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpVrtc
|
||||
*
|
||||
* PARAMETERS: Table - A VRTC table
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Format the contents of a VRTC
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDmDumpVrtc (
|
||||
ACPI_TABLE_HEADER *Table)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_VRTC);
|
||||
ACPI_VRTC_ENTRY *SubTable;
|
||||
|
||||
|
||||
/* Main table */
|
||||
|
||||
Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoVrtc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common sub-table header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
|
||||
sizeof (ACPI_VRTC_ENTRY), AcpiDmTableInfoVrtc0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Point to next sub-table */
|
||||
|
||||
Offset += sizeof (ACPI_VRTC_ENTRY);
|
||||
SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, SubTable, sizeof (ACPI_VRTC_ENTRY));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpWdat
|
||||
|
@ -179,6 +179,7 @@
|
||||
#define ACPI_MPST1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_DATA_HDR,f)
|
||||
#define ACPI_MPST2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_DATA,f)
|
||||
#define ACPI_MSCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f)
|
||||
#define ACPI_MTMR0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MTMR_ENTRY,f)
|
||||
#define ACPI_PCCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f)
|
||||
#define ACPI_PMTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_SOCKET,f)
|
||||
#define ACPI_PMTT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_CONTROLLER,f)
|
||||
@ -195,6 +196,7 @@
|
||||
#define ACPI_SRAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f)
|
||||
#define ACPI_SRAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
|
||||
#define ACPI_SRAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f)
|
||||
#define ACPI_VRTC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_VRTC_ENTRY,f)
|
||||
#define ACPI_WDAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WDAT_ENTRY,f)
|
||||
|
||||
/*
|
||||
@ -1642,6 +1644,28 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[] =
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* MTMR - MID Timer Table
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr[] =
|
||||
{
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* MTMR Subtables - MTMR Entry */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr0[] =
|
||||
{
|
||||
{ACPI_DMT_GAS, ACPI_MTMR0_OFFSET (PhysicalAddress), "PhysicalAddress", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MTMR0_OFFSET (Frequency), "Frequency", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MTMR0_OFFSET (Irq), "IRQ", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* PCCT - Platform Communications Channel Table (ACPI 5.0)
|
||||
@ -2033,6 +2057,27 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[] =
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* VRTC - Virtual Real Time Clock Table
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc[] =
|
||||
{
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* VRTC Subtables - VRTC Entry */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc0[] =
|
||||
{
|
||||
{ACPI_DMT_GAS, ACPI_VRTC0_OFFSET (PhysicalAddress), "PhysicalAddress", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_VRTC0_OFFSET (Irq), "IRQ", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* WAET - Windows ACPI Emulated devices Table
|
||||
|
@ -42,6 +42,7 @@
|
||||
*/
|
||||
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include <contrib/dev/acpica/compiler/dtcompiler.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
@ -341,6 +342,89 @@ FlConsumeNewComment (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: FlCheckForAcpiTable
|
||||
*
|
||||
* PARAMETERS: Handle - Open input file
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Determine if a file seems to be a binary ACPI table, via the
|
||||
* following checks on what would be the table header:
|
||||
* 0) File must be at least as long as an ACPI_TABLE_HEADER
|
||||
* 1) The header length field must match the file size
|
||||
* 2) Signature, OemId, OemTableId, AslCompilerId must be ASCII
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
FlCheckForAcpiTable (
|
||||
FILE *Handle)
|
||||
{
|
||||
ACPI_TABLE_HEADER Table;
|
||||
UINT32 FileSize;
|
||||
size_t Actual;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
/* Read a potential table header */
|
||||
|
||||
Actual = fread (&Table, 1, sizeof (ACPI_TABLE_HEADER), Handle);
|
||||
fseek (Handle, 0, SEEK_SET);
|
||||
|
||||
if (Actual < sizeof (ACPI_TABLE_HEADER))
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Header length field must match the file size */
|
||||
|
||||
FileSize = DtGetFileSize (Handle);
|
||||
if (Table.Length != FileSize)
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* These fields must be ASCII:
|
||||
* Signature, OemId, OemTableId, AslCompilerId.
|
||||
* We allow a NULL terminator in OemId and OemTableId.
|
||||
*/
|
||||
for (i = 0; i < ACPI_NAME_SIZE; i++)
|
||||
{
|
||||
if (!ACPI_IS_ASCII ((UINT8) Table.Signature[i]))
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
if (!ACPI_IS_ASCII ((UINT8) Table.AslCompilerId[i]))
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; (i < ACPI_OEM_ID_SIZE) && (Table.OemId[i]); i++)
|
||||
{
|
||||
if (!ACPI_IS_ASCII ((UINT8) Table.OemId[i]))
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; (i < ACPI_OEM_TABLE_ID_SIZE) && (Table.OemTableId[i]); i++)
|
||||
{
|
||||
if (!ACPI_IS_ASCII ((UINT8) Table.OemTableId[i]))
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
printf ("Binary file appears to be a valid ACPI table, disassembling\n");
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: FlCheckForAscii
|
||||
|
@ -159,6 +159,10 @@ void
|
||||
CmCleanupAndExit (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
FlCheckForAcpiTable (
|
||||
FILE *Handle);
|
||||
|
||||
ACPI_STATUS
|
||||
FlCheckForAscii (
|
||||
FILE *Handle,
|
||||
@ -509,11 +513,27 @@ ApCheckForPredefinedObject (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
char *Name);
|
||||
|
||||
ACPI_STATUS
|
||||
ApCheckObjectType (
|
||||
const char *PredefinedName,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 ExpectedBtypes,
|
||||
UINT32 PackageIndex);
|
||||
|
||||
void
|
||||
ApDisplayReservedNames (
|
||||
void);
|
||||
|
||||
|
||||
/*
|
||||
* aslprepkg - ACPI predefined names support for packages
|
||||
*/
|
||||
void
|
||||
ApCheckPackage (
|
||||
ACPI_PARSE_OBJECT *ParentOp,
|
||||
const ACPI_PREDEFINED_INFO *Predefined);
|
||||
|
||||
|
||||
/*
|
||||
* asltransform - parse tree transformations
|
||||
*/
|
||||
|
@ -125,8 +125,9 @@
|
||||
/* Types for input files */
|
||||
|
||||
#define ASL_INPUT_TYPE_BINARY 0
|
||||
#define ASL_INPUT_TYPE_ASCII_ASL 1
|
||||
#define ASL_INPUT_TYPE_ASCII_DATA 2
|
||||
#define ASL_INPUT_TYPE_ACPI_TABLE 1
|
||||
#define ASL_INPUT_TYPE_ASCII_ASL 2
|
||||
#define ASL_INPUT_TYPE_ASCII_DATA 3
|
||||
|
||||
|
||||
/* Misc */
|
||||
|
@ -513,6 +513,13 @@ FlOpenMiscOutputFiles (
|
||||
char *Filename;
|
||||
|
||||
|
||||
/* All done for disassembler */
|
||||
|
||||
if (Gbl_FileType == ASL_INPUT_TYPE_ACPI_TABLE)
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* Create/Open a hex output file if asked */
|
||||
|
||||
if (Gbl_HexOutputFlag)
|
||||
|
@ -111,7 +111,8 @@ AslDoResponseFile (
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Display option help message
|
||||
* DESCRIPTION: Display option help message.
|
||||
* Optional items in square brackets.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -132,7 +133,7 @@ Options (
|
||||
ACPI_OPTION ("-P", "Preprocess only and create preprocessor output file (*.i)");
|
||||
ACPI_OPTION ("-Pn", "Disable preprocessor");
|
||||
|
||||
printf ("\nGeneral Output:\n");
|
||||
printf ("\nGeneral Processing:\n");
|
||||
ACPI_OPTION ("-p <prefix>", "Specify path/filename prefix for all output files");
|
||||
ACPI_OPTION ("-va", "Disable all errors and warnings (summary only)");
|
||||
ACPI_OPTION ("-vi", "Less verbose errors and warnings for use with IDEs");
|
||||
@ -142,12 +143,7 @@ Options (
|
||||
ACPI_OPTION ("-w1 -w2 -w3", "Set warning reporting level");
|
||||
ACPI_OPTION ("-we", "Report warnings as errors");
|
||||
|
||||
printf ("\nAML and Data Output Files:\n");
|
||||
ACPI_OPTION ("-sa -sc", "Create assembler or C source file (*.asm or *.c)");
|
||||
ACPI_OPTION ("-ia -ic", "Create assembler or C include file (*.inc or *.h)");
|
||||
ACPI_OPTION ("-ta -tc -ts", "Create assembler, C, or ASL hex table (*.hex)");
|
||||
|
||||
printf ("\nAML Code Generation:\n");
|
||||
printf ("\nAML Code Generation (*.aml):\n");
|
||||
ACPI_OPTION ("-oa", "Disable all optimizations (compatibility mode)");
|
||||
ACPI_OPTION ("-of", "Disable constant folding");
|
||||
ACPI_OPTION ("-oi", "Disable integer optimization to Zero/One/Ones");
|
||||
@ -156,22 +152,28 @@ Options (
|
||||
ACPI_OPTION ("-in", "Ignore NoOp operators");
|
||||
ACPI_OPTION ("-r <revision>", "Override table header Revision (1-255)");
|
||||
|
||||
printf ("\nASL Listing Files:\n");
|
||||
printf ("\nOptional Source Code Output Files:\n");
|
||||
ACPI_OPTION ("-sc -sa", "Create source file in C or assembler (*.c or *.asm)");
|
||||
ACPI_OPTION ("-ic -ia", "Create include file in C or assembler (*.h or *.inc)");
|
||||
ACPI_OPTION ("-tc -ta -ts", "Create hex AML table in C, assembler, or ASL (*.hex)");
|
||||
|
||||
printf ("\nOptional Listing Files:\n");
|
||||
ACPI_OPTION ("-l", "Create mixed listing file (ASL source and AML) (*.lst)");
|
||||
ACPI_OPTION ("-ln", "Create namespace file (*.nsp)");
|
||||
ACPI_OPTION ("-ls", "Create combined source file (expanded includes) (*.src)");
|
||||
|
||||
printf ("\nACPI Data Tables:\n");
|
||||
ACPI_OPTION ("-G", "Compile custom table containing generic operators");
|
||||
ACPI_OPTION ("-vt", "Create verbose templates (full disassembly)");
|
||||
printf ("\nData Table Compiler:\n");
|
||||
ACPI_OPTION ("-G", "Compile custom table that contains generic operators");
|
||||
ACPI_OPTION ("-vt", "Create verbose template files (full disassembly)");
|
||||
|
||||
printf ("\nAML Disassembler:\n");
|
||||
ACPI_OPTION ("-d [file]", "Disassemble or decode binary ACPI table to file (*.dsl)");
|
||||
ACPI_OPTION ("-da [f1,f2]", "Disassemble multiple tables from single namespace");
|
||||
ACPI_OPTION ("-d <f1,f2>", "Disassemble or decode binary ACPI tables to file (*.dsl)");
|
||||
ACPI_OPTION ("", " (Optional, file type is automatically detected)");
|
||||
ACPI_OPTION ("-da <f1,f2>", "Disassemble multiple tables from single namespace");
|
||||
ACPI_OPTION ("-db", "Do not translate Buffers to Resource Templates");
|
||||
ACPI_OPTION ("-dc [file]", "Disassemble AML and immediately compile it");
|
||||
ACPI_OPTION ("", "(Obtain DSDT from current system if no input file)");
|
||||
ACPI_OPTION ("-e [f1,f2]", "Include ACPI table(s) for external symbol resolution");
|
||||
ACPI_OPTION ("-dc <f1,f2>", "Disassemble AML and immediately compile it");
|
||||
ACPI_OPTION ("", " (Obtain DSDT from current system if no input file)");
|
||||
ACPI_OPTION ("-e <f1,f2>", "Include ACPI table(s) for external symbol resolution");
|
||||
ACPI_OPTION ("-g", "Get ACPI tables and write to files (*.dat)");
|
||||
ACPI_OPTION ("-in", "Ignore NoOp opcodes");
|
||||
ACPI_OPTION ("-vt", "Dump binary table data in hex format within output file");
|
||||
@ -186,6 +188,7 @@ Options (
|
||||
printf ("\nDebug Options:\n");
|
||||
ACPI_OPTION ("-bf -bt", "Create debug file (full or parse tree only) (*.txt)");
|
||||
ACPI_OPTION ("-f", "Ignore errors, force creation of AML output file(s)");
|
||||
ACPI_OPTION ("-m <size>", "Set internal line buffer size (in Kbytes)");
|
||||
ACPI_OPTION ("-n", "Parse only, no output generation");
|
||||
ACPI_OPTION ("-ot", "Display compile times and statistics");
|
||||
ACPI_OPTION ("-x <level>", "Set debug level for trace output");
|
||||
|
@ -166,6 +166,7 @@ typedef enum
|
||||
ASL_MSG_RESERVED_METHOD,
|
||||
ASL_MSG_RESERVED_NO_RETURN_VAL,
|
||||
ASL_MSG_RESERVED_OPERAND_TYPE,
|
||||
ASL_MSG_RESERVED_PACKAGE_LENGTH,
|
||||
ASL_MSG_RESERVED_RETURN_VALUE,
|
||||
ASL_MSG_RESERVED_USE,
|
||||
ASL_MSG_RESERVED_WORD,
|
||||
@ -343,6 +344,7 @@ char *AslMessages [] = {
|
||||
/* ASL_MSG_RESERVED_METHOD */ "Reserved name must be a control method",
|
||||
/* ASL_MSG_RESERVED_NO_RETURN_VAL */ "Reserved method should not return a value",
|
||||
/* ASL_MSG_RESERVED_OPERAND_TYPE */ "Invalid object type for reserved name",
|
||||
/* ASL_MSG_RESERVED_PACKAGE_LENGTH */ "Invalid package length for reserved name",
|
||||
/* ASL_MSG_RESERVED_RETURN_VALUE */ "Reserved method must return a value",
|
||||
/* ASL_MSG_RESERVED_USE */ "Invalid use of reserved name",
|
||||
/* ASL_MSG_RESERVED_WORD */ "Use of reserved name",
|
||||
|
@ -46,6 +46,7 @@
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include "aslcompiler.y.h"
|
||||
#include <contrib/dev/acpica/include/acpredef.h>
|
||||
#include <contrib/dev/acpica/include/acnamesp.h>
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
@ -64,12 +65,6 @@ ApCheckForSpecialName (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
char *Name);
|
||||
|
||||
static void
|
||||
ApCheckObjectType (
|
||||
const char *PredefinedName,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 ExpectedBtypes);
|
||||
|
||||
static void
|
||||
ApGetExpectedTypes (
|
||||
char *Buffer,
|
||||
@ -386,7 +381,15 @@ ApCheckPredefinedReturnValue (
|
||||
|
||||
ApCheckObjectType (PredefinedNames[Index].Info.Name,
|
||||
ReturnValueOp,
|
||||
PredefinedNames[Index].Info.ExpectedBtypes);
|
||||
PredefinedNames[Index].Info.ExpectedBtypes,
|
||||
ACPI_NOT_PACKAGE_ELEMENT);
|
||||
|
||||
/* For packages, check the individual package elements */
|
||||
|
||||
if (ReturnValueOp->Asl.ParseOpcode == PARSEOP_PACKAGE)
|
||||
{
|
||||
ApCheckPackage (ReturnValueOp, &PredefinedNames[Index]);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -428,6 +431,7 @@ ApCheckForPredefinedObject (
|
||||
char *Name)
|
||||
{
|
||||
UINT32 Index;
|
||||
ACPI_PARSE_OBJECT *ObjectOp;
|
||||
|
||||
|
||||
/*
|
||||
@ -456,39 +460,50 @@ ApCheckForPredefinedObject (
|
||||
"with zero arguments");
|
||||
return;
|
||||
|
||||
default: /* A standard predefined ACPI name */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* If this predefined name requires input arguments, then
|
||||
* it must be implemented as a control method
|
||||
*/
|
||||
if (PredefinedNames[Index].Info.ParamCount > 0)
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
|
||||
"with arguments");
|
||||
return;
|
||||
}
|
||||
/* A standard predefined ACPI name */
|
||||
|
||||
/*
|
||||
* If no return value is expected from this predefined name, then
|
||||
* it follows that it must be implemented as a control method
|
||||
* (with zero args, because the args > 0 case was handled above)
|
||||
* Examples are: _DIS, _INI, _IRC, _OFF, _ON, _PSx
|
||||
*/
|
||||
if (!PredefinedNames[Index].Info.ExpectedBtypes)
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
|
||||
"with zero arguments");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Typecheck the actual object, it is the next argument */
|
||||
|
||||
ApCheckObjectType (PredefinedNames[Index].Info.Name,
|
||||
Op->Asl.Child->Asl.Next,
|
||||
PredefinedNames[Index].Info.ExpectedBtypes);
|
||||
/*
|
||||
* If this predefined name requires input arguments, then
|
||||
* it must be implemented as a control method
|
||||
*/
|
||||
if (PredefinedNames[Index].Info.ParamCount > 0)
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
|
||||
"with arguments");
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* If no return value is expected from this predefined name, then
|
||||
* it follows that it must be implemented as a control method
|
||||
* (with zero args, because the args > 0 case was handled above)
|
||||
* Examples are: _DIS, _INI, _IRC, _OFF, _ON, _PSx
|
||||
*/
|
||||
if (!PredefinedNames[Index].Info.ExpectedBtypes)
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
|
||||
"with zero arguments");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Typecheck the actual object, it is the next argument */
|
||||
|
||||
ObjectOp = Op->Asl.Child->Asl.Next;
|
||||
ApCheckObjectType (PredefinedNames[Index].Info.Name,
|
||||
Op->Asl.Child->Asl.Next,
|
||||
PredefinedNames[Index].Info.ExpectedBtypes,
|
||||
ACPI_NOT_PACKAGE_ELEMENT);
|
||||
|
||||
/* For packages, check the individual package elements */
|
||||
|
||||
if (ObjectOp->Asl.ParseOpcode == PARSEOP_PACKAGE)
|
||||
{
|
||||
ApCheckPackage (ObjectOp, &PredefinedNames[Index]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -646,6 +661,9 @@ ApCheckForSpecialName (
|
||||
* PARAMETERS: PredefinedName - Name of the predefined object we are checking
|
||||
* Op - Current parse node
|
||||
* ExpectedBtypes - Bitmap of expected return type(s)
|
||||
* PackageIndex - Index of object within parent package (if
|
||||
* applicable - ACPI_NOT_PACKAGE_ELEMENT
|
||||
* otherwise)
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
@ -655,15 +673,24 @@ ApCheckForSpecialName (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
ACPI_STATUS
|
||||
ApCheckObjectType (
|
||||
const char *PredefinedName,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 ExpectedBtypes)
|
||||
UINT32 ExpectedBtypes,
|
||||
UINT32 PackageIndex)
|
||||
{
|
||||
UINT32 ReturnBtype;
|
||||
char *TypeName;
|
||||
|
||||
|
||||
if (!Op)
|
||||
{
|
||||
return (AE_TYPE);
|
||||
}
|
||||
|
||||
/* Map the parse opcode to a bitmapped return type (RTYPE) */
|
||||
|
||||
switch (Op->Asl.ParseOpcode)
|
||||
{
|
||||
case PARSEOP_ZERO:
|
||||
@ -671,24 +698,35 @@ ApCheckObjectType (
|
||||
case PARSEOP_ONES:
|
||||
case PARSEOP_INTEGER:
|
||||
ReturnBtype = ACPI_RTYPE_INTEGER;
|
||||
break;
|
||||
|
||||
case PARSEOP_BUFFER:
|
||||
ReturnBtype = ACPI_RTYPE_BUFFER;
|
||||
TypeName = "Integer";
|
||||
break;
|
||||
|
||||
case PARSEOP_STRING_LITERAL:
|
||||
ReturnBtype = ACPI_RTYPE_STRING;
|
||||
TypeName = "String";
|
||||
break;
|
||||
|
||||
case PARSEOP_BUFFER:
|
||||
ReturnBtype = ACPI_RTYPE_BUFFER;
|
||||
TypeName = "Buffer";
|
||||
break;
|
||||
|
||||
case PARSEOP_PACKAGE:
|
||||
case PARSEOP_VAR_PACKAGE:
|
||||
ReturnBtype = ACPI_RTYPE_PACKAGE;
|
||||
TypeName = "Package";
|
||||
break;
|
||||
|
||||
case PARSEOP_NAMESEG:
|
||||
case PARSEOP_NAMESTRING:
|
||||
ReturnBtype = ACPI_RTYPE_REFERENCE;
|
||||
TypeName = "Reference";
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Not one of the supported object types */
|
||||
|
||||
TypeName = UtGetOpName (Op->Asl.ParseOpcode);
|
||||
goto TypeErrorExit;
|
||||
}
|
||||
|
||||
@ -696,7 +734,7 @@ ApCheckObjectType (
|
||||
|
||||
if (ReturnBtype & ExpectedBtypes)
|
||||
{
|
||||
return;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
@ -706,11 +744,19 @@ TypeErrorExit:
|
||||
|
||||
ApGetExpectedTypes (StringBuffer, ExpectedBtypes);
|
||||
|
||||
sprintf (MsgBuffer, "%s: found %s, requires %s",
|
||||
PredefinedName, UtGetOpName (Op->Asl.ParseOpcode), StringBuffer);
|
||||
if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
|
||||
{
|
||||
sprintf (MsgBuffer, "%s: found %s, %s required",
|
||||
PredefinedName, TypeName, StringBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf (MsgBuffer, "%s: found %s at index %u, %s required",
|
||||
PredefinedName, TypeName, PackageIndex, StringBuffer);
|
||||
}
|
||||
|
||||
AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Op,
|
||||
MsgBuffer);
|
||||
AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Op, MsgBuffer);
|
||||
return (AE_TYPE);
|
||||
}
|
||||
|
||||
|
||||
|
661
sys/contrib/dev/acpica/compiler/aslprepkg.c
Normal file
661
sys/contrib/dev/acpica/compiler/aslprepkg.c
Normal file
@ -0,0 +1,661 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: aslprepkg - support for ACPI predefined name package objects
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2013, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* NO WARRANTY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include "aslcompiler.y.h"
|
||||
#include <contrib/dev/acpica/include/acpredef.h>
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("aslprepkg")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
ApCheckPackageElements (
|
||||
const char *PredefinedName,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT8 Type1,
|
||||
UINT32 Count1,
|
||||
UINT8 Type2,
|
||||
UINT32 Count2);
|
||||
|
||||
static void
|
||||
ApCheckPackageList (
|
||||
const char *PredefinedName,
|
||||
ACPI_PARSE_OBJECT *ParentOp,
|
||||
const ACPI_PREDEFINED_INFO *Package,
|
||||
UINT32 StartIndex,
|
||||
UINT32 Count);
|
||||
|
||||
static void
|
||||
ApPackageTooSmall (
|
||||
const char *PredefinedName,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Count,
|
||||
UINT32 ExpectedCount);
|
||||
|
||||
static void
|
||||
ApZeroLengthPackage (
|
||||
const char *PredefinedName,
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
static void
|
||||
ApPackageTooLarge (
|
||||
const char *PredefinedName,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Count,
|
||||
UINT32 ExpectedCount);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: ApCheckPackage
|
||||
*
|
||||
* PARAMETERS: ParentOp - Parser op for the package
|
||||
* Predefined - Pointer to package-specific info for method
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Top-level validation for predefined name return package
|
||||
* objects.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ApCheckPackage (
|
||||
ACPI_PARSE_OBJECT *ParentOp,
|
||||
const ACPI_PREDEFINED_INFO *Predefined)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
const ACPI_PREDEFINED_INFO *Package;
|
||||
ACPI_STATUS Status;
|
||||
UINT32 ExpectedCount;
|
||||
UINT32 Count;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
/* The package info for this name is in the next table entry */
|
||||
|
||||
Package = Predefined + 1;
|
||||
|
||||
/* First child is the package length */
|
||||
|
||||
Op = ParentOp->Asl.Child;
|
||||
Count = (UINT32) Op->Asl.Value.Integer;
|
||||
|
||||
/*
|
||||
* Most packages must have at least one element. The only exception
|
||||
* is the variable-length package (ACPI_PTYPE1_VAR).
|
||||
*/
|
||||
if (!Count)
|
||||
{
|
||||
if (Package->RetInfo.Type != ACPI_PTYPE1_VAR)
|
||||
{
|
||||
ApZeroLengthPackage (Predefined->Info.Name, ParentOp);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Get the first element of the package */
|
||||
|
||||
Op = Op->Asl.Next;
|
||||
|
||||
/* Decode the package type */
|
||||
|
||||
switch (Package->RetInfo.Type)
|
||||
{
|
||||
case ACPI_PTYPE1_FIXED:
|
||||
/*
|
||||
* The package count is fixed and there are no sub-packages
|
||||
*
|
||||
* If package is too small, exit.
|
||||
* If package is larger than expected, issue warning but continue
|
||||
*/
|
||||
ExpectedCount = Package->RetInfo.Count1 + Package->RetInfo.Count2;
|
||||
if (Count < ExpectedCount)
|
||||
{
|
||||
goto PackageTooSmall;
|
||||
}
|
||||
else if (Count > ExpectedCount)
|
||||
{
|
||||
ApPackageTooLarge (Predefined->Info.Name, ParentOp,
|
||||
Count, ExpectedCount);
|
||||
}
|
||||
|
||||
/* Validate all elements of the package */
|
||||
|
||||
ApCheckPackageElements (Predefined->Info.Name, Op,
|
||||
Package->RetInfo.ObjectType1, Package->RetInfo.Count1,
|
||||
Package->RetInfo.ObjectType2, Package->RetInfo.Count2);
|
||||
break;
|
||||
|
||||
case ACPI_PTYPE1_VAR:
|
||||
/*
|
||||
* The package count is variable, there are no sub-packages, and all
|
||||
* elements must be of the same type
|
||||
*/
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
ApCheckObjectType (Predefined->Info.Name, Op,
|
||||
Package->RetInfo.ObjectType1, i);
|
||||
Op = Op->Asl.Next;
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_PTYPE1_OPTION:
|
||||
/*
|
||||
* The package count is variable, there are no sub-packages. There are
|
||||
* a fixed number of required elements, and a variable number of
|
||||
* optional elements.
|
||||
*
|
||||
* Check if package is at least as large as the minimum required
|
||||
*/
|
||||
ExpectedCount = Package->RetInfo3.Count;
|
||||
if (Count < ExpectedCount)
|
||||
{
|
||||
goto PackageTooSmall;
|
||||
}
|
||||
|
||||
/* Variable number of sub-objects */
|
||||
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
if (i < Package->RetInfo3.Count)
|
||||
{
|
||||
/* These are the required package elements (0, 1, or 2) */
|
||||
|
||||
ApCheckObjectType (Predefined->Info.Name, Op,
|
||||
Package->RetInfo3.ObjectType[i], i);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* These are the optional package elements */
|
||||
|
||||
ApCheckObjectType (Predefined->Info.Name, Op,
|
||||
Package->RetInfo3.TailObjectType, i);
|
||||
}
|
||||
Op = Op->Asl.Next;
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_PTYPE2_REV_FIXED:
|
||||
|
||||
/* First element is the (Integer) revision */
|
||||
|
||||
ApCheckObjectType (Predefined->Info.Name, Op,
|
||||
ACPI_RTYPE_INTEGER, 0);
|
||||
|
||||
Op = Op->Asl.Next;
|
||||
Count--;
|
||||
|
||||
/* Examine the sub-packages */
|
||||
|
||||
ApCheckPackageList (Predefined->Info.Name, Op,
|
||||
Package, 1, Count);
|
||||
break;
|
||||
|
||||
case ACPI_PTYPE2_PKG_COUNT:
|
||||
|
||||
/* First element is the (Integer) count of sub-packages to follow */
|
||||
|
||||
Status = ApCheckObjectType (Predefined->Info.Name, Op,
|
||||
ACPI_RTYPE_INTEGER, 0);
|
||||
|
||||
/* We must have an integer count from above (otherwise, use Count) */
|
||||
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
/*
|
||||
* Count cannot be larger than the parent package length, but allow it
|
||||
* to be smaller. The >= accounts for the Integer above.
|
||||
*/
|
||||
ExpectedCount = (UINT32) Op->Asl.Value.Integer;
|
||||
if (ExpectedCount >= Count)
|
||||
{
|
||||
goto PackageTooSmall;
|
||||
}
|
||||
|
||||
Count = ExpectedCount;
|
||||
}
|
||||
|
||||
Op = Op->Asl.Next;
|
||||
|
||||
/* Examine the sub-packages */
|
||||
|
||||
ApCheckPackageList (Predefined->Info.Name, Op,
|
||||
Package, 1, Count);
|
||||
break;
|
||||
|
||||
case ACPI_PTYPE2:
|
||||
case ACPI_PTYPE2_FIXED:
|
||||
case ACPI_PTYPE2_MIN:
|
||||
case ACPI_PTYPE2_COUNT:
|
||||
case ACPI_PTYPE2_FIX_VAR:
|
||||
/*
|
||||
* These types all return a single Package that consists of a
|
||||
* variable number of sub-Packages.
|
||||
*/
|
||||
|
||||
/* Examine the sub-packages */
|
||||
|
||||
ApCheckPackageList (Predefined->Info.Name, Op,
|
||||
Package, 0, Count);
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
PackageTooSmall:
|
||||
ApPackageTooSmall (Predefined->Info.Name, ParentOp,
|
||||
Count, ExpectedCount);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: ApCheckPackageElements
|
||||
*
|
||||
* PARAMETERS: PredefinedName - Pointer to validation data structure
|
||||
* Op - Parser op for the package
|
||||
* Type1 - Object type for first group
|
||||
* Count1 - Count for first group
|
||||
* Type2 - Object type for second group
|
||||
* Count2 - Count for second group
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Validate all elements of a package. Works with packages that
|
||||
* are defined to contain up to two groups of different object
|
||||
* types.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
ApCheckPackageElements (
|
||||
const char *PredefinedName,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT8 Type1,
|
||||
UINT32 Count1,
|
||||
UINT8 Type2,
|
||||
UINT32 Count2)
|
||||
{
|
||||
UINT32 i;
|
||||
|
||||
|
||||
/*
|
||||
* Up to two groups of package elements are supported by the data
|
||||
* structure. All elements in each group must be of the same type.
|
||||
* The second group can have a count of zero.
|
||||
*
|
||||
* Aborts check upon a NULL package element, as this means (at compile
|
||||
* time) that the remainder of the package elements are also NULL
|
||||
* (This is the only way to create NULL package elements.)
|
||||
*/
|
||||
for (i = 0; (i < Count1) && Op; i++)
|
||||
{
|
||||
ApCheckObjectType (PredefinedName, Op, Type1, i);
|
||||
Op = Op->Asl.Next;
|
||||
}
|
||||
|
||||
for (i = 0; (i < Count2) && Op; i++)
|
||||
{
|
||||
ApCheckObjectType (PredefinedName, Op, Type2, (i + Count1));
|
||||
Op = Op->Asl.Next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: ApCheckPackageList
|
||||
*
|
||||
* PARAMETERS: PredefinedName - Name of the predefined object
|
||||
* ParentOp - Parser op of the parent package
|
||||
* Package - Package info for this predefined name
|
||||
* StartIndex - Index in parent package where list begins
|
||||
* ParentCount - Element count of parent package
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Validate the individual package elements for a predefined name.
|
||||
* Handles the cases where the predefined name is defined as a
|
||||
* Package of Packages (subpackages). These are the types:
|
||||
*
|
||||
* ACPI_PTYPE2
|
||||
* ACPI_PTYPE2_FIXED
|
||||
* ACPI_PTYPE2_MIN
|
||||
* ACPI_PTYPE2_COUNT
|
||||
* ACPI_PTYPE2_FIX_VAR
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
ApCheckPackageList (
|
||||
const char *PredefinedName,
|
||||
ACPI_PARSE_OBJECT *ParentOp,
|
||||
const ACPI_PREDEFINED_INFO *Package,
|
||||
UINT32 StartIndex,
|
||||
UINT32 ParentCount)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *SubPackageOp = ParentOp;
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
ACPI_STATUS Status;
|
||||
UINT32 Count;
|
||||
UINT32 ExpectedCount;
|
||||
UINT32 i;
|
||||
UINT32 j;
|
||||
|
||||
|
||||
/*
|
||||
* Validate each subpackage in the parent Package
|
||||
*
|
||||
* Note: We ignore NULL package elements on the assumption that
|
||||
* they will be initialized by the BIOS or other ASL code.
|
||||
*/
|
||||
for (i = 0; (i < ParentCount) && SubPackageOp; i++)
|
||||
{
|
||||
/* Each object in the list must be of type Package */
|
||||
|
||||
Status = ApCheckObjectType (PredefinedName, SubPackageOp,
|
||||
ACPI_RTYPE_PACKAGE, i + StartIndex);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto NextSubpackage;
|
||||
}
|
||||
|
||||
/* Examine the different types of expected subpackages */
|
||||
|
||||
Op = SubPackageOp->Asl.Child;
|
||||
|
||||
/* First child is the package length */
|
||||
|
||||
Count = (UINT32) Op->Asl.Value.Integer;
|
||||
Op = Op->Asl.Next;
|
||||
|
||||
/* The subpackage must have at least one element */
|
||||
|
||||
if (!Count)
|
||||
{
|
||||
ApZeroLengthPackage (PredefinedName, SubPackageOp);
|
||||
goto NextSubpackage;
|
||||
}
|
||||
|
||||
/*
|
||||
* Decode the package type.
|
||||
* PTYPE2 indicates that a "package of packages" is expected for
|
||||
* this name. The various flavors of PTYPE2 indicate the number
|
||||
* and format of the subpackages.
|
||||
*/
|
||||
switch (Package->RetInfo.Type)
|
||||
{
|
||||
case ACPI_PTYPE2:
|
||||
case ACPI_PTYPE2_PKG_COUNT:
|
||||
case ACPI_PTYPE2_REV_FIXED:
|
||||
|
||||
/* Each subpackage has a fixed number of elements */
|
||||
|
||||
ExpectedCount = Package->RetInfo.Count1 + Package->RetInfo.Count2;
|
||||
if (Count < ExpectedCount)
|
||||
{
|
||||
ApPackageTooSmall (PredefinedName, SubPackageOp,
|
||||
Count, ExpectedCount);
|
||||
break;
|
||||
}
|
||||
|
||||
ApCheckPackageElements (PredefinedName, Op,
|
||||
Package->RetInfo.ObjectType1, Package->RetInfo.Count1,
|
||||
Package->RetInfo.ObjectType2, Package->RetInfo.Count2);
|
||||
break;
|
||||
|
||||
case ACPI_PTYPE2_FIX_VAR:
|
||||
/*
|
||||
* Each subpackage has a fixed number of elements and an
|
||||
* optional element
|
||||
*/
|
||||
ExpectedCount = Package->RetInfo.Count1 + Package->RetInfo.Count2;
|
||||
if (Count < ExpectedCount)
|
||||
{
|
||||
ApPackageTooSmall (PredefinedName, SubPackageOp,
|
||||
Count, ExpectedCount);
|
||||
break;
|
||||
}
|
||||
|
||||
ApCheckPackageElements (PredefinedName, Op,
|
||||
Package->RetInfo.ObjectType1, Package->RetInfo.Count1,
|
||||
Package->RetInfo.ObjectType2,
|
||||
Count - Package->RetInfo.Count1);
|
||||
break;
|
||||
|
||||
case ACPI_PTYPE2_FIXED:
|
||||
|
||||
/* Each sub-package has a fixed length */
|
||||
|
||||
ExpectedCount = Package->RetInfo2.Count;
|
||||
if (Count < ExpectedCount)
|
||||
{
|
||||
ApPackageTooSmall (PredefinedName, SubPackageOp,
|
||||
Count, ExpectedCount);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check each object/type combination */
|
||||
|
||||
for (j = 0; j < ExpectedCount; j++)
|
||||
{
|
||||
ApCheckObjectType (PredefinedName, Op,
|
||||
Package->RetInfo2.ObjectType[j], j);
|
||||
|
||||
Op = Op->Asl.Next;
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_PTYPE2_MIN:
|
||||
|
||||
/* Each sub-package has a variable but minimum length */
|
||||
|
||||
ExpectedCount = Package->RetInfo.Count1;
|
||||
if (Count < ExpectedCount)
|
||||
{
|
||||
ApPackageTooSmall (PredefinedName, SubPackageOp,
|
||||
Count, ExpectedCount);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check the type of each sub-package element */
|
||||
|
||||
ApCheckPackageElements (PredefinedName, Op,
|
||||
Package->RetInfo.ObjectType1, Count, 0, 0);
|
||||
break;
|
||||
|
||||
case ACPI_PTYPE2_COUNT:
|
||||
/*
|
||||
* First element is the (Integer) count of elements, including
|
||||
* the count field (the ACPI name is NumElements)
|
||||
*/
|
||||
Status = ApCheckObjectType (PredefinedName, Op,
|
||||
ACPI_RTYPE_INTEGER, 0);
|
||||
|
||||
/* We must have an integer count from above (otherwise, use Count) */
|
||||
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
/*
|
||||
* Make sure package is large enough for the Count and is
|
||||
* is as large as the minimum size
|
||||
*/
|
||||
ExpectedCount = (UINT32) Op->Asl.Value.Integer;
|
||||
|
||||
if (Count < ExpectedCount)
|
||||
{
|
||||
ApPackageTooSmall (PredefinedName, SubPackageOp,
|
||||
Count, ExpectedCount);
|
||||
break;
|
||||
}
|
||||
else if (Count > ExpectedCount)
|
||||
{
|
||||
ApPackageTooLarge (PredefinedName, SubPackageOp,
|
||||
Count, ExpectedCount);
|
||||
}
|
||||
|
||||
/* Some names of this type have a minimum length */
|
||||
|
||||
if (Count < Package->RetInfo.Count1)
|
||||
{
|
||||
ExpectedCount = Package->RetInfo.Count1;
|
||||
ApPackageTooSmall (PredefinedName, SubPackageOp,
|
||||
Count, ExpectedCount);
|
||||
break;
|
||||
}
|
||||
|
||||
Count = ExpectedCount;
|
||||
}
|
||||
|
||||
/* Check the type of each sub-package element */
|
||||
|
||||
Op = Op->Asl.Next;
|
||||
ApCheckPackageElements (PredefinedName, Op,
|
||||
Package->RetInfo.ObjectType1, (Count - 1), 0, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
NextSubpackage:
|
||||
SubPackageOp = SubPackageOp->Asl.Next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: ApPackageTooSmall
|
||||
*
|
||||
* PARAMETERS: PredefinedName - Name of the predefined object
|
||||
* Op - Current parser op
|
||||
* Count - Actual package element count
|
||||
* ExpectedCount - Expected package element count
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Issue error message for a package that is smaller than
|
||||
* required.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
ApPackageTooSmall (
|
||||
const char *PredefinedName,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Count,
|
||||
UINT32 ExpectedCount)
|
||||
{
|
||||
|
||||
sprintf (MsgBuffer, "%s: length %u, required minimum is %u",
|
||||
PredefinedName, Count, ExpectedCount);
|
||||
|
||||
AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH, Op, MsgBuffer);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: ApZeroLengthPackage
|
||||
*
|
||||
* PARAMETERS: PredefinedName - Name of the predefined object
|
||||
* Op - Current parser op
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Issue error message for a zero-length package (a package that
|
||||
* is required to have a non-zero length). Variable length
|
||||
* packages seem to be allowed to have zero length, however.
|
||||
* Even if not allowed, BIOS code does it.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
ApZeroLengthPackage (
|
||||
const char *PredefinedName,
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
|
||||
sprintf (MsgBuffer, "%s: length is zero", PredefinedName);
|
||||
|
||||
AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH, Op, MsgBuffer);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: ApPackageTooLarge
|
||||
*
|
||||
* PARAMETERS: PredefinedName - Name of the predefined object
|
||||
* Op - Current parser op
|
||||
* Count - Actual package element count
|
||||
* ExpectedCount - Expected package element count
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Issue a remark for a package that is larger than expected.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
ApPackageTooLarge (
|
||||
const char *PredefinedName,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Count,
|
||||
UINT32 ExpectedCount)
|
||||
{
|
||||
|
||||
sprintf (MsgBuffer, "%s: length is %u, only %u required",
|
||||
PredefinedName, Count, ExpectedCount);
|
||||
|
||||
AslError (ASL_REMARK, ASL_MSG_RESERVED_PACKAGE_LENGTH, Op, MsgBuffer);
|
||||
}
|
@ -44,6 +44,7 @@
|
||||
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include <contrib/dev/acpica/include/actables.h>
|
||||
#include <contrib/dev/acpica/include/acdisasm.h>
|
||||
#include <contrib/dev/acpica/include/acapps.h>
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
@ -66,6 +67,10 @@ static UINT8
|
||||
AslDetectSourceFileType (
|
||||
ASL_FILE_INFO *Info);
|
||||
|
||||
static ACPI_STATUS
|
||||
AslDoDisassembly (
|
||||
void);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -224,6 +229,15 @@ AslDetectSourceFileType (
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
/* Check for a valid binary ACPI table */
|
||||
|
||||
Status = FlCheckForAcpiTable (Info->Handle);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Type = ASL_INPUT_TYPE_ACPI_TABLE;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Check for 100% ASCII source file (comments are ignored) */
|
||||
|
||||
Status = FlCheckForAscii (Info->Handle, Info->Filename, TRUE);
|
||||
@ -277,6 +291,86 @@ Cleanup:
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslDoDisassembly
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Initiate AML file disassembly. Uses ACPICA subsystem to build
|
||||
* namespace.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AslDoDisassembly (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
/* ACPICA subsystem initialization */
|
||||
|
||||
Status = AdInitialize ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Status = AcpiAllocateRootTable (4);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiOsPrintf ("Could not initialize ACPI Table Manager, %s\n",
|
||||
AcpiFormatException (Status));
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* This is where the disassembly happens */
|
||||
|
||||
AcpiGbl_DbOpt_disasm = TRUE;
|
||||
Status = AdAmlDisassemble (AslToFile,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_OutputFilenamePrefix,
|
||||
&Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_GetAllTables);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* Check if any control methods were unresolved */
|
||||
|
||||
AcpiDmUnresolvedWarning (0);
|
||||
|
||||
#if 0
|
||||
/* TBD: Handle additional output files for disassembler */
|
||||
|
||||
Status = FlOpenMiscOutputFiles (Gbl_OutputFilenamePrefix);
|
||||
NsDisplayNamespace ();
|
||||
#endif
|
||||
|
||||
/* Shutdown compiler and ACPICA subsystem */
|
||||
|
||||
AeClearErrorLog ();
|
||||
(void) AcpiTerminate ();
|
||||
|
||||
/*
|
||||
* Gbl_Files[ASL_FILE_INPUT].Filename was replaced with the
|
||||
* .DSL disassembly file, which can now be compiled if requested
|
||||
*/
|
||||
if (Gbl_DoCompile)
|
||||
{
|
||||
AcpiOsPrintf ("\nCompiling \"%s\"\n",
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename);
|
||||
return (AE_CTRL_CONTINUE);
|
||||
}
|
||||
|
||||
ACPI_FREE (Gbl_Files[ASL_FILE_INPUT].Filename);
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename = NULL;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslDoOneFile
|
||||
@ -308,61 +402,11 @@ AslDoOneFile (
|
||||
*/
|
||||
if (Gbl_DisasmFlag || Gbl_GetAllTables)
|
||||
{
|
||||
/* ACPICA subsystem initialization */
|
||||
|
||||
Status = AdInitialize ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
Status = AslDoDisassembly ();
|
||||
if (Status != AE_CTRL_CONTINUE)
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Status = AcpiAllocateRootTable (4);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiOsPrintf ("Could not initialize ACPI Table Manager, %s\n",
|
||||
AcpiFormatException (Status));
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* This is where the disassembly happens */
|
||||
|
||||
AcpiGbl_DbOpt_disasm = TRUE;
|
||||
Status = AdAmlDisassemble (AslToFile,
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename,
|
||||
Gbl_OutputFilenamePrefix,
|
||||
&Gbl_Files[ASL_FILE_INPUT].Filename,
|
||||
Gbl_GetAllTables);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* TBD: Handle additional output files for disassembler */
|
||||
|
||||
Status = FlOpenMiscOutputFiles (Gbl_OutputFilenamePrefix);
|
||||
NsDisplayNamespace ();
|
||||
#endif
|
||||
|
||||
/* Shutdown compiler and ACPICA subsystem */
|
||||
|
||||
AeClearErrorLog ();
|
||||
(void) AcpiTerminate ();
|
||||
|
||||
/*
|
||||
* Gbl_Files[ASL_FILE_INPUT].Filename was replaced with the
|
||||
* .DSL disassembly file, which can now be compiled if requested
|
||||
*/
|
||||
if (Gbl_DoCompile)
|
||||
{
|
||||
AcpiOsPrintf ("\nCompiling \"%s\"\n",
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
Gbl_Files[ASL_FILE_INPUT].Filename = NULL;
|
||||
return (AE_OK);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -469,6 +513,21 @@ AslDoOneFile (
|
||||
PrTerminatePreprocessor ();
|
||||
return (AE_OK);
|
||||
|
||||
/*
|
||||
* Binary ACPI table was auto-detected, disassemble it
|
||||
*/
|
||||
case ASL_INPUT_TYPE_ACPI_TABLE:
|
||||
|
||||
/* We have what appears to be an ACPI table, disassemble it */
|
||||
|
||||
FlCloseFile (ASL_FILE_INPUT);
|
||||
Gbl_DoCompile = FALSE;
|
||||
Gbl_DisasmFlag = TRUE;
|
||||
Status = AslDoDisassembly ();
|
||||
return (Status);
|
||||
|
||||
/* Unknown binary table */
|
||||
|
||||
case ASL_INPUT_TYPE_BINARY:
|
||||
|
||||
AePrintErrorLog (ASL_FILE_STDERR);
|
||||
|
@ -403,6 +403,9 @@ count (
|
||||
TotalKeywords++;
|
||||
TotalExecutableOpcodes++;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; (yytext[i] != 0) && (yytext[i] != EOF); i++)
|
||||
@ -570,7 +573,6 @@ AslDoStringLiteral (
|
||||
AslInsertLineBuffer (StringChar);
|
||||
|
||||
DoCharacter:
|
||||
|
||||
switch (State)
|
||||
{
|
||||
case ASL_NORMAL_CHAR:
|
||||
@ -590,6 +592,9 @@ DoCharacter:
|
||||
/* String terminator */
|
||||
|
||||
goto CompletedString;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -748,6 +753,9 @@ DoCharacter:
|
||||
ConvertBuffer[i] = StringChar;
|
||||
i++;
|
||||
continue;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Save the finished character */
|
||||
|
@ -443,6 +443,10 @@ ACPI_STATUS
|
||||
DtCompileMsct (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileMtmr (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompilePmtt (
|
||||
void **PFieldList);
|
||||
@ -471,6 +475,10 @@ ACPI_STATUS
|
||||
DtCompileUefi (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileVrtc (
|
||||
void **PFieldList);
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileWdat (
|
||||
void **PFieldList);
|
||||
@ -511,6 +519,7 @@ extern const unsigned char TemplateMcfg[];
|
||||
extern const unsigned char TemplateMchi[];
|
||||
extern const unsigned char TemplateMpst[];
|
||||
extern const unsigned char TemplateMsct[];
|
||||
extern const unsigned char TemplateMtmr[];
|
||||
extern const unsigned char TemplatePmtt[];
|
||||
extern const unsigned char TemplateRsdt[];
|
||||
extern const unsigned char TemplateS3pt[];
|
||||
@ -523,6 +532,7 @@ extern const unsigned char TemplateSrat[];
|
||||
extern const unsigned char TemplateTcpa[];
|
||||
extern const unsigned char TemplateTpm2[];
|
||||
extern const unsigned char TemplateUefi[];
|
||||
extern const unsigned char TemplateVrtc[];
|
||||
extern const unsigned char TemplateWaet[];
|
||||
extern const unsigned char TemplateWdat[];
|
||||
extern const unsigned char TemplateWddt[];
|
||||
|
@ -1410,6 +1410,31 @@ DtCompileMsct (
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileMtmr
|
||||
*
|
||||
* PARAMETERS: List - Current field list pointer
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Compile MTMR.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileMtmr (
|
||||
void **List)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
Status = DtCompileTwoSubtables (List,
|
||||
AcpiDmTableInfoMtmr, AcpiDmTableInfoMtmr0);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompilePmtt
|
||||
@ -1972,6 +1997,31 @@ DtCompileUefi (
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileVrtc
|
||||
*
|
||||
* PARAMETERS: List - Current field list pointer
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Compile VRTC.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
DtCompileVrtc (
|
||||
void **List)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
Status = DtCompileTwoSubtables (List,
|
||||
AcpiDmTableInfoVrtc, AcpiDmTableInfoVrtc0);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: DtCompileWdat
|
||||
|
@ -632,6 +632,20 @@ const unsigned char TemplateMsct[] =
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000088 "........" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateMtmr[] =
|
||||
{
|
||||
0x4D,0x54,0x4D,0x52,0x4C,0x00,0x00,0x00, /* 00000000 "MTMRL..." */
|
||||
0x01,0xB0,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x03,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x17,0x01,0x13,0x20,0x00,0x20,0x00,0x03, /* 00000020 "... . .." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x20,0x00,0x03,0x00,0x00,0x00,0x00, /* 00000038 ". ......" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
|
||||
0x00,0x00,0x00,0x00 /* 00000048 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplatePmtt[] =
|
||||
{
|
||||
0x50,0x4D,0x54,0x54,0xB4,0x00,0x00,0x00, /* 00000000 "PMTT...." */
|
||||
@ -893,6 +907,19 @@ const unsigned char TemplateUefi[] =
|
||||
0x0C,0x0D,0x0E,0x0F,0x00,0x00 /* 00000030 "......" */
|
||||
};
|
||||
|
||||
const unsigned char TemplateVrtc[] =
|
||||
{
|
||||
0x56,0x52,0x54,0x43,0x44,0x00,0x00,0x00, /* 00000000 "VRTCD..." */
|
||||
0x01,0xEF,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
|
||||
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
|
||||
0x03,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
|
||||
0x17,0x01,0x13,0x20,0x00,0x08,0x00,0x00, /* 00000020 "... ...." */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00, /* 00000030 "........" */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
|
||||
0x00,0x00,0x00,0x00 /* 00000040 "...." */
|
||||
};
|
||||
|
||||
const unsigned char TemplateWaet[] =
|
||||
{
|
||||
0x57,0x41,0x45,0x54,0x28,0x00,0x00,0x00, /* 00000000 "WAET(..." */
|
||||
|
@ -1024,6 +1024,8 @@ GetCrs:
|
||||
|
||||
/* Execute _SRS with the resource list */
|
||||
|
||||
AcpiOsPrintf ("Evaluating _SRS\n");
|
||||
|
||||
Status = AcpiSetCurrentResources (Node, &ReturnBuffer);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@ -1114,8 +1116,8 @@ Cleanup:
|
||||
* FUNCTION: AcpiDbDisplayResources
|
||||
*
|
||||
* PARAMETERS: ObjectArg - String object name or object pointer.
|
||||
* "*" means "display resources for all
|
||||
* devices"
|
||||
* NULL or "*" means "display resources for
|
||||
* all devices"
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
@ -1135,7 +1137,7 @@ AcpiDbDisplayResources (
|
||||
|
||||
/* Asterisk means "display resources for all devices" */
|
||||
|
||||
if (!ACPI_STRCMP (ObjectArg, "*"))
|
||||
if (!ObjectArg || (!ACPI_STRCMP (ObjectArg, "*")))
|
||||
{
|
||||
(void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
|
||||
ACPI_UINT32_MAX, AcpiDbDeviceResources, NULL, NULL, NULL);
|
||||
|
@ -207,7 +207,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] =
|
||||
{"PREFIX", 0},
|
||||
{"QUIT", 0},
|
||||
{"REFERENCES", 1},
|
||||
{"RESOURCES", 1},
|
||||
{"RESOURCES", 0},
|
||||
{"RESULTS", 0},
|
||||
{"SET", 3},
|
||||
{"SLEEP", 0},
|
||||
@ -272,7 +272,7 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] =
|
||||
{1, " Predefined", "Check all predefined names\n"},
|
||||
{1, " Prefix [<NamePath>]", "Set or Get current execution prefix\n"},
|
||||
{1, " References <Addr>", "Find all references to object at addr\n"},
|
||||
{1, " Resources <DeviceName | *>", "Display Device resources (* = all devices)\n"},
|
||||
{1, " Resources [DeviceName]", "Display Device resources (no arg = all devices)\n"},
|
||||
{1, " Set N <NamedObject> <Value>", "Set value for named integer\n"},
|
||||
{1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"},
|
||||
{1, " Template <Object>", "Format/dump a Buffer/ResourceTemplate\n"},
|
||||
|
@ -201,7 +201,7 @@ AcpiDsIsResultUsed (
|
||||
if (!Op)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Null Op"));
|
||||
return_VALUE (TRUE);
|
||||
return_UINT8 (TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -231,7 +231,7 @@ AcpiDsIsResultUsed (
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"At Method level, result of [%s] not used\n",
|
||||
AcpiPsGetOpcodeName (Op->Common.AmlOpcode)));
|
||||
return_VALUE (FALSE);
|
||||
return_UINT8 (FALSE);
|
||||
}
|
||||
|
||||
/* Get info on the parent. The RootOp is AML_SCOPE */
|
||||
@ -241,7 +241,7 @@ AcpiDsIsResultUsed (
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Unknown parent opcode Op=%p", Op));
|
||||
return_VALUE (FALSE);
|
||||
return_UINT8 (FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -331,7 +331,7 @@ ResultUsed:
|
||||
AcpiPsGetOpcodeName (Op->Common.AmlOpcode),
|
||||
AcpiPsGetOpcodeName (Op->Common.Parent->Common.AmlOpcode), Op));
|
||||
|
||||
return_VALUE (TRUE);
|
||||
return_UINT8 (TRUE);
|
||||
|
||||
|
||||
ResultNotUsed:
|
||||
@ -340,7 +340,7 @@ ResultNotUsed:
|
||||
AcpiPsGetOpcodeName (Op->Common.AmlOpcode),
|
||||
AcpiPsGetOpcodeName (Op->Common.Parent->Common.AmlOpcode), Op));
|
||||
|
||||
return_VALUE (FALSE);
|
||||
return_UINT8 (FALSE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -291,6 +291,8 @@ AcpiEvFixedEventDetect (
|
||||
*
|
||||
* DESCRIPTION: Clears the status bit for the requested event, calls the
|
||||
* handler that previously registered for the event.
|
||||
* NOTE: If there is no handler for the event, the event is
|
||||
* disabled to prevent futher interrupts.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -309,18 +311,18 @@ AcpiEvFixedEventDispatch (
|
||||
ACPI_CLEAR_STATUS);
|
||||
|
||||
/*
|
||||
* Make sure we've got a handler. If not, report an error. The event is
|
||||
* disabled to prevent further interrupts.
|
||||
* Make sure that a handler exists. If not, report an error
|
||||
* and disable the event to prevent further interrupts.
|
||||
*/
|
||||
if (NULL == AcpiGbl_FixedEventHandlers[Event].Handler)
|
||||
if (!AcpiGbl_FixedEventHandlers[Event].Handler)
|
||||
{
|
||||
(void) AcpiWriteBitRegister (
|
||||
AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
|
||||
ACPI_DISABLE_EVENT);
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"No installed handler for fixed event [0x%08X]",
|
||||
Event));
|
||||
"No installed handler for fixed event - %s (%u), disabling",
|
||||
AcpiUtGetEventName (Event), Event));
|
||||
|
||||
return (ACPI_INTERRUPT_NOT_HANDLED);
|
||||
}
|
||||
|
@ -770,7 +770,7 @@ AcpiEvGpeDispatch (
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Unable to clear GPE%02X", GpeNumber));
|
||||
return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
|
||||
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
|
||||
}
|
||||
}
|
||||
|
||||
@ -788,7 +788,7 @@ AcpiEvGpeDispatch (
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Unable to disable GPE%02X", GpeNumber));
|
||||
return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
|
||||
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -846,7 +846,7 @@ AcpiEvGpeDispatch (
|
||||
break;
|
||||
}
|
||||
|
||||
return_VALUE (ACPI_INTERRUPT_HANDLED);
|
||||
return_UINT32 (ACPI_INTERRUPT_HANDLED);
|
||||
}
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
@ -101,7 +101,7 @@ AcpiEvSciXruptHandler (
|
||||
InterruptHandled |= AcpiEvGpeDetect (GpeXruptList);
|
||||
|
||||
AcpiSciCount++;
|
||||
return_VALUE (InterruptHandled);
|
||||
return_UINT32 (InterruptHandled);
|
||||
}
|
||||
|
||||
|
||||
@ -137,7 +137,7 @@ AcpiEvGpeXruptHandler (
|
||||
|
||||
InterruptHandled |= AcpiEvGpeDetect (GpeXruptList);
|
||||
|
||||
return_VALUE (InterruptHandled);
|
||||
return_UINT32 (InterruptHandled);
|
||||
}
|
||||
|
||||
|
||||
|
@ -534,9 +534,9 @@ AcpiInstallFixedEventHandler (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Don't allow two handlers. */
|
||||
/* Do not allow multiple handlers */
|
||||
|
||||
if (NULL != AcpiGbl_FixedEventHandlers[Event].Handler)
|
||||
if (AcpiGbl_FixedEventHandlers[Event].Handler)
|
||||
{
|
||||
Status = AE_ALREADY_EXISTS;
|
||||
goto Cleanup;
|
||||
@ -550,7 +550,9 @@ AcpiInstallFixedEventHandler (
|
||||
Status = AcpiEnableEvent (Event, 0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_WARNING ((AE_INFO, "Could not enable fixed event 0x%X", Event));
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Could not enable fixed event - %s (%u)",
|
||||
AcpiUtGetEventName (Event), Event));
|
||||
|
||||
/* Remove the handler */
|
||||
|
||||
@ -560,7 +562,8 @@ AcpiInstallFixedEventHandler (
|
||||
else
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Enabled fixed event %X, Handler=%p\n", Event, Handler));
|
||||
"Enabled fixed event %s (%X), Handler=%p\n",
|
||||
AcpiUtGetEventName (Event), Event, Handler));
|
||||
}
|
||||
|
||||
|
||||
@ -621,11 +624,14 @@ AcpiRemoveFixedEventHandler (
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Could not write to fixed event enable register 0x%X", Event));
|
||||
"Could not disable fixed event - %s (%u)",
|
||||
AcpiUtGetEventName (Event), Event));
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Disabled fixed event %X\n", Event));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Disabled fixed event - %s (%X)\n",
|
||||
AcpiUtGetEventName (Event), Event));
|
||||
}
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
|
||||
|
@ -82,6 +82,13 @@ AcpiEnable (
|
||||
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
|
||||
}
|
||||
|
||||
/* If the Hardware Reduced flag is set, machine is always in acpi mode */
|
||||
|
||||
if (AcpiGbl_ReducedHardware)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Check current mode */
|
||||
|
||||
if (AcpiHwGetMode() == ACPI_SYS_MODE_ACPI)
|
||||
@ -131,6 +138,13 @@ AcpiDisable (
|
||||
ACPI_FUNCTION_TRACE (AcpiDisable);
|
||||
|
||||
|
||||
/* If the Hardware Reduced flag is set, machine is always in acpi mode */
|
||||
|
||||
if (AcpiGbl_ReducedHardware)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
if (AcpiHwGetMode() == ACPI_SYS_MODE_LEGACY)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
|
||||
|
@ -292,7 +292,7 @@ AcpiExDecodeFieldAccess (
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Unknown field access type 0x%X",
|
||||
Access));
|
||||
return_VALUE (0);
|
||||
return_UINT32 (0);
|
||||
}
|
||||
|
||||
if (ObjDesc->Common.Type == ACPI_TYPE_BUFFER_FIELD)
|
||||
@ -306,7 +306,7 @@ AcpiExDecodeFieldAccess (
|
||||
}
|
||||
|
||||
*ReturnByteAlignment = ByteAlignment;
|
||||
return_VALUE (BitLength);
|
||||
return_UINT32 (BitLength);
|
||||
}
|
||||
|
||||
|
||||
|
@ -391,7 +391,7 @@ AcpiExDigitsNeeded (
|
||||
|
||||
if (Value == 0)
|
||||
{
|
||||
return_VALUE (1);
|
||||
return_UINT32 (1);
|
||||
}
|
||||
|
||||
CurrentValue = Value;
|
||||
@ -405,7 +405,7 @@ AcpiExDigitsNeeded (
|
||||
NumDigits++;
|
||||
}
|
||||
|
||||
return_VALUE (NumDigits);
|
||||
return_UINT32 (NumDigits);
|
||||
}
|
||||
|
||||
|
||||
|
@ -75,6 +75,14 @@ AcpiHwSetMode (
|
||||
|
||||
ACPI_FUNCTION_TRACE (HwSetMode);
|
||||
|
||||
|
||||
/* If the Hardware Reduced flag is set, machine is always in acpi mode */
|
||||
|
||||
if (AcpiGbl_ReducedHardware)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* ACPI 2.0 clarified that if SMI_CMD in FADT is zero,
|
||||
* system does not support mode transition.
|
||||
@ -180,28 +188,35 @@ AcpiHwGetMode (
|
||||
ACPI_FUNCTION_TRACE (HwGetMode);
|
||||
|
||||
|
||||
/* If the Hardware Reduced flag is set, machine is always in acpi mode */
|
||||
|
||||
if (AcpiGbl_ReducedHardware)
|
||||
{
|
||||
return_UINT32 (ACPI_SYS_MODE_ACPI);
|
||||
}
|
||||
|
||||
/*
|
||||
* ACPI 2.0 clarified that if SMI_CMD in FADT is zero,
|
||||
* system does not support mode transition.
|
||||
*/
|
||||
if (!AcpiGbl_FADT.SmiCommand)
|
||||
{
|
||||
return_VALUE (ACPI_SYS_MODE_ACPI);
|
||||
return_UINT32 (ACPI_SYS_MODE_ACPI);
|
||||
}
|
||||
|
||||
Status = AcpiReadBitRegister (ACPI_BITREG_SCI_ENABLE, &Value);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_VALUE (ACPI_SYS_MODE_LEGACY);
|
||||
return_UINT32 (ACPI_SYS_MODE_LEGACY);
|
||||
}
|
||||
|
||||
if (Value)
|
||||
{
|
||||
return_VALUE (ACPI_SYS_MODE_ACPI);
|
||||
return_UINT32 (ACPI_SYS_MODE_ACPI);
|
||||
}
|
||||
else
|
||||
{
|
||||
return_VALUE (ACPI_SYS_MODE_LEGACY);
|
||||
return_UINT32 (ACPI_SYS_MODE_LEGACY);
|
||||
}
|
||||
}
|
||||
|
||||
|
481
sys/contrib/dev/acpica/components/namespace/nsconvert.c
Normal file
481
sys/contrib/dev/acpica/components/namespace/nsconvert.c
Normal file
@ -0,0 +1,481 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: nsconvert - Object conversions for objects returned by
|
||||
* predefined methods
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2013, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* NO WARRANTY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#define __NSCONVERT_C__
|
||||
|
||||
#include <contrib/dev/acpica/include/acpi.h>
|
||||
#include <contrib/dev/acpica/include/accommon.h>
|
||||
#include <contrib/dev/acpica/include/acnamesp.h>
|
||||
#include <contrib/dev/acpica/include/acinterp.h>
|
||||
#include <contrib/dev/acpica/include/acpredef.h>
|
||||
#include <contrib/dev/acpica/include/amlresrc.h>
|
||||
|
||||
#define _COMPONENT ACPI_NAMESPACE
|
||||
ACPI_MODULE_NAME ("nsconvert")
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsConvertToInteger
|
||||
*
|
||||
* PARAMETERS: OriginalObject - Object to be converted
|
||||
* ReturnObject - Where the new converted object is returned
|
||||
*
|
||||
* RETURN: Status. AE_OK if conversion was successful.
|
||||
*
|
||||
* DESCRIPTION: Attempt to convert a String/Buffer object to an Integer.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToInteger (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *NewObject;
|
||||
ACPI_STATUS Status;
|
||||
UINT64 Value = 0;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
switch (OriginalObject->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
/* String-to-Integer conversion */
|
||||
|
||||
Status = AcpiUtStrtoul64 (OriginalObject->String.Pointer,
|
||||
ACPI_ANY_BASE, &Value);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
/* Buffer-to-Integer conversion. Max buffer size is 64 bits. */
|
||||
|
||||
if (OriginalObject->Buffer.Length > 8)
|
||||
{
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
/* Extract each buffer byte to create the integer */
|
||||
|
||||
for (i = 0; i < OriginalObject->Buffer.Length; i++)
|
||||
{
|
||||
Value |= ((UINT64) OriginalObject->Buffer.Pointer[i] << (i * 8));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
NewObject = AcpiUtCreateIntegerObject (Value);
|
||||
if (!NewObject)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
*ReturnObject = NewObject;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsConvertToString
|
||||
*
|
||||
* PARAMETERS: OriginalObject - Object to be converted
|
||||
* ReturnObject - Where the new converted object is returned
|
||||
*
|
||||
* RETURN: Status. AE_OK if conversion was successful.
|
||||
*
|
||||
* DESCRIPTION: Attempt to convert a Integer/Buffer object to a String.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToString (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *NewObject;
|
||||
ACPI_SIZE Length;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
switch (OriginalObject->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_INTEGER:
|
||||
/*
|
||||
* Integer-to-String conversion. Commonly, convert
|
||||
* an integer of value 0 to a NULL string. The last element of
|
||||
* _BIF and _BIX packages occasionally need this fix.
|
||||
*/
|
||||
if (OriginalObject->Integer.Value == 0)
|
||||
{
|
||||
/* Allocate a new NULL string object */
|
||||
|
||||
NewObject = AcpiUtCreateStringObject (0);
|
||||
if (!NewObject)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = AcpiExConvertToString (OriginalObject, &NewObject,
|
||||
ACPI_IMPLICIT_CONVERT_HEX);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
/*
|
||||
* Buffer-to-String conversion. Use a ToString
|
||||
* conversion, no transform performed on the buffer data. The best
|
||||
* example of this is the _BIF method, where the string data from
|
||||
* the battery is often (incorrectly) returned as buffer object(s).
|
||||
*/
|
||||
Length = 0;
|
||||
while ((Length < OriginalObject->Buffer.Length) &&
|
||||
(OriginalObject->Buffer.Pointer[Length]))
|
||||
{
|
||||
Length++;
|
||||
}
|
||||
|
||||
/* Allocate a new string object */
|
||||
|
||||
NewObject = AcpiUtCreateStringObject (Length);
|
||||
if (!NewObject)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy the raw buffer data with no transform. String is already NULL
|
||||
* terminated at Length+1.
|
||||
*/
|
||||
ACPI_MEMCPY (NewObject->String.Pointer,
|
||||
OriginalObject->Buffer.Pointer, Length);
|
||||
break;
|
||||
|
||||
default:
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
*ReturnObject = NewObject;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsConvertToBuffer
|
||||
*
|
||||
* PARAMETERS: OriginalObject - Object to be converted
|
||||
* ReturnObject - Where the new converted object is returned
|
||||
*
|
||||
* RETURN: Status. AE_OK if conversion was successful.
|
||||
*
|
||||
* DESCRIPTION: Attempt to convert a Integer/String/Package object to a Buffer.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToBuffer (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *NewObject;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OPERAND_OBJECT **Elements;
|
||||
UINT32 *DwordBuffer;
|
||||
UINT32 Count;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
switch (OriginalObject->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_INTEGER:
|
||||
/*
|
||||
* Integer-to-Buffer conversion.
|
||||
* Convert the Integer to a packed-byte buffer. _MAT and other
|
||||
* objects need this sometimes, if a read has been performed on a
|
||||
* Field object that is less than or equal to the global integer
|
||||
* size (32 or 64 bits).
|
||||
*/
|
||||
Status = AcpiExConvertToBuffer (OriginalObject, &NewObject);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
/* String-to-Buffer conversion. Simple data copy */
|
||||
|
||||
NewObject = AcpiUtCreateBufferObject (OriginalObject->String.Length);
|
||||
if (!NewObject)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
ACPI_MEMCPY (NewObject->Buffer.Pointer,
|
||||
OriginalObject->String.Pointer, OriginalObject->String.Length);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
/*
|
||||
* This case is often seen for predefined names that must return a
|
||||
* Buffer object with multiple DWORD integers within. For example,
|
||||
* _FDE and _GTM. The Package can be converted to a Buffer.
|
||||
*/
|
||||
|
||||
/* All elements of the Package must be integers */
|
||||
|
||||
Elements = OriginalObject->Package.Elements;
|
||||
Count = OriginalObject->Package.Count;
|
||||
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
if ((!*Elements) ||
|
||||
((*Elements)->Common.Type != ACPI_TYPE_INTEGER))
|
||||
{
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
Elements++;
|
||||
}
|
||||
|
||||
/* Create the new buffer object to replace the Package */
|
||||
|
||||
NewObject = AcpiUtCreateBufferObject (ACPI_MUL_4 (Count));
|
||||
if (!NewObject)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Copy the package elements (integers) to the buffer as DWORDs */
|
||||
|
||||
Elements = OriginalObject->Package.Elements;
|
||||
DwordBuffer = ACPI_CAST_PTR (UINT32, NewObject->Buffer.Pointer);
|
||||
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
*DwordBuffer = (UINT32) (*Elements)->Integer.Value;
|
||||
DwordBuffer++;
|
||||
Elements++;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
*ReturnObject = NewObject;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsConvertToUnicode
|
||||
*
|
||||
* PARAMETERS: OriginalObject - ASCII String Object to be converted
|
||||
* ReturnObject - Where the new converted object is returned
|
||||
*
|
||||
* RETURN: Status. AE_OK if conversion was successful.
|
||||
*
|
||||
* DESCRIPTION: Attempt to convert a String object to a Unicode string Buffer.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToUnicode (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *NewObject;
|
||||
char *AsciiString;
|
||||
UINT16 *UnicodeBuffer;
|
||||
UINT32 UnicodeLength;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
if (!OriginalObject)
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* If a Buffer was returned, it must be at least two bytes long */
|
||||
|
||||
if (OriginalObject->Common.Type == ACPI_TYPE_BUFFER)
|
||||
{
|
||||
if (OriginalObject->Buffer.Length < 2)
|
||||
{
|
||||
return (AE_AML_OPERAND_VALUE);
|
||||
}
|
||||
|
||||
*ReturnObject = NULL;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* The original object is an ASCII string. Convert this string to
|
||||
* a unicode buffer.
|
||||
*/
|
||||
AsciiString = OriginalObject->String.Pointer;
|
||||
UnicodeLength = (OriginalObject->String.Length * 2) + 2;
|
||||
|
||||
/* Create a new buffer object for the Unicode data */
|
||||
|
||||
NewObject = AcpiUtCreateBufferObject (UnicodeLength);
|
||||
if (!NewObject)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
UnicodeBuffer = ACPI_CAST_PTR (UINT16, NewObject->Buffer.Pointer);
|
||||
|
||||
/* Convert ASCII to Unicode */
|
||||
|
||||
for (i = 0; i < OriginalObject->String.Length; i++)
|
||||
{
|
||||
UnicodeBuffer[i] = (UINT16) AsciiString[i];
|
||||
}
|
||||
|
||||
*ReturnObject = NewObject;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsConvertToResource
|
||||
*
|
||||
* PARAMETERS: OriginalObject - Object to be converted
|
||||
* ReturnObject - Where the new converted object is returned
|
||||
*
|
||||
* RETURN: Status. AE_OK if conversion was successful
|
||||
*
|
||||
* DESCRIPTION: Attempt to convert a Integer object to a ResourceTemplate
|
||||
* Buffer.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToResource (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *NewObject;
|
||||
UINT8 *Buffer;
|
||||
|
||||
|
||||
/*
|
||||
* We can fix the following cases for an expected resource template:
|
||||
* 1. No return value (interpreter slack mode is disabled)
|
||||
* 2. A "Return (Zero)" statement
|
||||
* 3. A "Return empty buffer" statement
|
||||
*
|
||||
* We will return a buffer containing a single EndTag
|
||||
* resource descriptor.
|
||||
*/
|
||||
if (OriginalObject)
|
||||
{
|
||||
switch (OriginalObject->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_INTEGER:
|
||||
|
||||
/* We can only repair an Integer==0 */
|
||||
|
||||
if (OriginalObject->Integer.Value)
|
||||
{
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
if (OriginalObject->Buffer.Length)
|
||||
{
|
||||
/* Additional checks can be added in the future */
|
||||
|
||||
*ReturnObject = NULL;
|
||||
return (AE_OK);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
default:
|
||||
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Create the new buffer object for the resource descriptor */
|
||||
|
||||
NewObject = AcpiUtCreateBufferObject (2);
|
||||
if (!NewObject)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
Buffer = ACPI_CAST_PTR (UINT8, NewObject->Buffer.Pointer);
|
||||
|
||||
/* Initialize the Buffer with a single EndTag descriptor */
|
||||
|
||||
Buffer[0] = (ACPI_RESOURCE_NAME_END_TAG | ASL_RDESC_END_TAG_SIZE);
|
||||
Buffer[1] = 0x00;
|
||||
|
||||
*ReturnObject = NewObject;
|
||||
return (AE_OK);
|
||||
}
|
@ -87,6 +87,11 @@ AcpiNsGetExpectedTypes (
|
||||
char *Buffer,
|
||||
UINT32 ExpectedBtypes);
|
||||
|
||||
static UINT32
|
||||
AcpiNsGetBitmappedType (
|
||||
ACPI_OPERAND_OBJECT *ReturnObject);
|
||||
|
||||
|
||||
/*
|
||||
* Names for the types that can be returned by the predefined objects.
|
||||
* Used for warning messages. Must be in the same order as the ACPI_RTYPEs
|
||||
@ -124,7 +129,6 @@ AcpiNsCheckPredefinedNames (
|
||||
ACPI_STATUS ReturnStatus,
|
||||
ACPI_OPERAND_OBJECT **ReturnObjectPtr)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
const ACPI_PREDEFINED_INFO *Predefined;
|
||||
char *Pathname;
|
||||
@ -166,26 +170,6 @@ AcpiNsCheckPredefinedNames (
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/*
|
||||
* If there is no return value, check if we require a return value for
|
||||
* this predefined name. Either one return value is expected, or none,
|
||||
* for both methods and other objects.
|
||||
*
|
||||
* Exit now if there is no return object. Warning if one was expected.
|
||||
*/
|
||||
if (!ReturnObject)
|
||||
{
|
||||
if ((Predefined->Info.ExpectedBtypes) &&
|
||||
(!(Predefined->Info.ExpectedBtypes & ACPI_RTYPE_NONE)))
|
||||
{
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS,
|
||||
"Missing expected return value"));
|
||||
|
||||
Status = AE_AML_NO_RETURN_VALUE;
|
||||
}
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return value validation and possible repair.
|
||||
*
|
||||
@ -447,30 +431,13 @@ AcpiNsCheckObjectType (
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
UINT32 ReturnBtype;
|
||||
char TypeBuffer[48]; /* Room for 5 types */
|
||||
|
||||
|
||||
/*
|
||||
* If we get a NULL ReturnObject here, it is a NULL package element.
|
||||
* Since all extraneous NULL package elements were removed earlier by a
|
||||
* call to AcpiNsRemoveNullElements, this is an unexpected NULL element.
|
||||
* We will attempt to repair it.
|
||||
*/
|
||||
if (!ReturnObject)
|
||||
{
|
||||
Status = AcpiNsRepairNullElement (Data, ExpectedBtypes,
|
||||
PackageIndex, ReturnObjectPtr);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
return (AE_OK); /* Repair was successful */
|
||||
}
|
||||
goto TypeErrorExit;
|
||||
}
|
||||
|
||||
/* A Namespace node should not get here, but make sure */
|
||||
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE (ReturnObject) == ACPI_DESC_TYPE_NAMED)
|
||||
if (ReturnObject &&
|
||||
ACPI_GET_DESCRIPTOR_TYPE (ReturnObject) == ACPI_DESC_TYPE_NAMED)
|
||||
{
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags,
|
||||
"Invalid return type - Found a Namespace node [%4.4s] type %s",
|
||||
@ -487,56 +454,26 @@ AcpiNsCheckObjectType (
|
||||
* from all of the predefined names (including elements of returned
|
||||
* packages)
|
||||
*/
|
||||
switch (ReturnObject->Common.Type)
|
||||
Data->ReturnBtype = AcpiNsGetBitmappedType (ReturnObject);
|
||||
if (Data->ReturnBtype == ACPI_RTYPE_ANY)
|
||||
{
|
||||
case ACPI_TYPE_INTEGER:
|
||||
ReturnBtype = ACPI_RTYPE_INTEGER;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
ReturnBtype = ACPI_RTYPE_BUFFER;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
ReturnBtype = ACPI_RTYPE_STRING;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
ReturnBtype = ACPI_RTYPE_PACKAGE;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_LOCAL_REFERENCE:
|
||||
ReturnBtype = ACPI_RTYPE_REFERENCE;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Not one of the supported objects, must be incorrect */
|
||||
|
||||
goto TypeErrorExit;
|
||||
}
|
||||
|
||||
/* Is the object one of the expected types? */
|
||||
/* For reference objects, check that the reference type is correct */
|
||||
|
||||
if (ReturnBtype & ExpectedBtypes)
|
||||
if ((Data->ReturnBtype & ExpectedBtypes) == ACPI_RTYPE_REFERENCE)
|
||||
{
|
||||
/* For reference objects, check that the reference type is correct */
|
||||
|
||||
if (ReturnObject->Common.Type == ACPI_TYPE_LOCAL_REFERENCE)
|
||||
{
|
||||
Status = AcpiNsCheckReference (Data, ReturnObject);
|
||||
}
|
||||
|
||||
Status = AcpiNsCheckReference (Data, ReturnObject);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* Type mismatch -- attempt repair of the returned object */
|
||||
/* Attempt simple repair of the returned object if necessary */
|
||||
|
||||
Status = AcpiNsRepairObject (Data, ExpectedBtypes,
|
||||
Status = AcpiNsSimpleRepair (Data, ExpectedBtypes,
|
||||
PackageIndex, ReturnObjectPtr);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
return (AE_OK); /* Repair was successful */
|
||||
}
|
||||
return (Status);
|
||||
|
||||
|
||||
TypeErrorExit:
|
||||
@ -604,6 +541,67 @@ AcpiNsCheckReference (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsGetBitmappedType
|
||||
*
|
||||
* PARAMETERS: ReturnObject - Object returned from method/obj evaluation
|
||||
*
|
||||
* RETURN: Object return type. ACPI_RTYPE_ANY indicates that the object
|
||||
* type is not supported. ACPI_RTYPE_NONE indicates that no
|
||||
* object was returned (ReturnObject is NULL).
|
||||
*
|
||||
* DESCRIPTION: Convert object type into a bitmapped object return type.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static UINT32
|
||||
AcpiNsGetBitmappedType (
|
||||
ACPI_OPERAND_OBJECT *ReturnObject)
|
||||
{
|
||||
UINT32 ReturnBtype;
|
||||
|
||||
|
||||
if (!ReturnObject)
|
||||
{
|
||||
return (ACPI_RTYPE_NONE);
|
||||
}
|
||||
|
||||
/* Map ACPI_OBJECT_TYPE to internal bitmapped type */
|
||||
|
||||
switch (ReturnObject->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_INTEGER:
|
||||
ReturnBtype = ACPI_RTYPE_INTEGER;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
ReturnBtype = ACPI_RTYPE_BUFFER;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
ReturnBtype = ACPI_RTYPE_STRING;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
ReturnBtype = ACPI_RTYPE_PACKAGE;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_LOCAL_REFERENCE:
|
||||
ReturnBtype = ACPI_RTYPE_REFERENCE;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Not one of the supported objects, must be incorrect */
|
||||
|
||||
ReturnBtype = ACPI_RTYPE_ANY;
|
||||
break;
|
||||
}
|
||||
|
||||
return (ReturnBtype);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsGetExpectedTypes
|
||||
|
@ -122,10 +122,17 @@ AcpiNsCheckPackage (
|
||||
Elements = ReturnObject->Package.Elements;
|
||||
Count = ReturnObject->Package.Count;
|
||||
|
||||
/* The package must have at least one element, else invalid */
|
||||
|
||||
/*
|
||||
* Most packages must have at least one element. The only exception
|
||||
* is the variable-length package (ACPI_PTYPE1_VAR).
|
||||
*/
|
||||
if (!Count)
|
||||
{
|
||||
if (Package->RetInfo.Type == ACPI_PTYPE1_VAR)
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags,
|
||||
"Return Package has no elements (empty)"));
|
||||
|
||||
|
@ -48,6 +48,7 @@
|
||||
#include <contrib/dev/acpica/include/acnamesp.h>
|
||||
#include <contrib/dev/acpica/include/acinterp.h>
|
||||
#include <contrib/dev/acpica/include/acpredef.h>
|
||||
#include <contrib/dev/acpica/include/amlresrc.h>
|
||||
|
||||
#define _COMPONENT ACPI_NAMESPACE
|
||||
ACPI_MODULE_NAME ("nsrepair")
|
||||
@ -74,6 +75,11 @@
|
||||
* Buffer -> String
|
||||
* Buffer -> Package of Integers
|
||||
* Package -> Package of one Package
|
||||
*
|
||||
* Additional conversions that are available:
|
||||
* Convert a null return or zero return value to an EndTag descriptor
|
||||
* Convert an ASCII string to a Unicode buffer
|
||||
*
|
||||
* An incorrect standalone object is wrapped with required outer package
|
||||
*
|
||||
* Additional possible repairs:
|
||||
@ -84,25 +90,46 @@
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiNsConvertToInteger (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
static const ACPI_SIMPLE_REPAIR_INFO *
|
||||
AcpiNsMatchSimpleRepair (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
UINT32 ReturnBtype,
|
||||
UINT32 PackageIndex);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiNsConvertToString (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiNsConvertToBuffer (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
/*
|
||||
* Special but simple repairs for some names.
|
||||
*
|
||||
* 2nd argument: Unexpected types that can be repaired
|
||||
*/
|
||||
static const ACPI_SIMPLE_REPAIR_INFO AcpiObjectRepairInfo[] =
|
||||
{
|
||||
/* Resource descriptor conversions */
|
||||
|
||||
{ "_CRS", ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER | ACPI_RTYPE_NONE,
|
||||
ACPI_NOT_PACKAGE_ELEMENT,
|
||||
AcpiNsConvertToResource },
|
||||
{ "_DMA", ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER | ACPI_RTYPE_NONE,
|
||||
ACPI_NOT_PACKAGE_ELEMENT,
|
||||
AcpiNsConvertToResource },
|
||||
{ "_PRS", ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER | ACPI_RTYPE_NONE,
|
||||
ACPI_NOT_PACKAGE_ELEMENT,
|
||||
AcpiNsConvertToResource },
|
||||
|
||||
/* Unicode conversions */
|
||||
|
||||
{ "_MLS", ACPI_RTYPE_STRING, 1,
|
||||
AcpiNsConvertToUnicode },
|
||||
{ "_STR", ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER,
|
||||
ACPI_NOT_PACKAGE_ELEMENT,
|
||||
AcpiNsConvertToUnicode },
|
||||
{ {0,0,0,0}, 0, 0, NULL } /* Table terminator */
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsRepairObject
|
||||
* FUNCTION: AcpiNsSimpleRepair
|
||||
*
|
||||
* PARAMETERS: Data - Pointer to validation data structure
|
||||
* ExpectedBtypes - Object types expected
|
||||
@ -120,26 +147,84 @@ AcpiNsConvertToBuffer (
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsRepairObject (
|
||||
AcpiNsSimpleRepair (
|
||||
ACPI_PREDEFINED_DATA *Data,
|
||||
UINT32 ExpectedBtypes,
|
||||
UINT32 PackageIndex,
|
||||
ACPI_OPERAND_OBJECT **ReturnObjectPtr)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr;
|
||||
ACPI_OPERAND_OBJECT *NewObject;
|
||||
ACPI_OPERAND_OBJECT *NewObject = NULL;
|
||||
ACPI_STATUS Status;
|
||||
const ACPI_SIMPLE_REPAIR_INFO *Predefined;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (NsRepairObject);
|
||||
ACPI_FUNCTION_NAME (NsSimpleRepair);
|
||||
|
||||
|
||||
/*
|
||||
* Special repairs for certain names that are in the repair table.
|
||||
* Check if this name is in the list of repairable names.
|
||||
*/
|
||||
Predefined = AcpiNsMatchSimpleRepair (Data->Node,
|
||||
Data->ReturnBtype, PackageIndex);
|
||||
if (Predefined)
|
||||
{
|
||||
if (!ReturnObject)
|
||||
{
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname,
|
||||
ACPI_WARN_ALWAYS, "Missing expected return value"));
|
||||
}
|
||||
|
||||
Status = Predefined->ObjectConverter (ReturnObject, &NewObject);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
/* A fatal error occurred during a conversion */
|
||||
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"During return object analysis"));
|
||||
return (Status);
|
||||
}
|
||||
if (NewObject)
|
||||
{
|
||||
goto ObjectRepaired;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Do not perform simple object repair unless the return type is not
|
||||
* expected.
|
||||
*/
|
||||
if (Data->ReturnBtype & ExpectedBtypes)
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* At this point, we know that the type of the returned object was not
|
||||
* one of the expected types for this predefined name. Attempt to
|
||||
* repair the object by converting it to one of the expected object
|
||||
* types for this predefined name.
|
||||
*/
|
||||
|
||||
/*
|
||||
* If there is no return value, check if we require a return value for
|
||||
* this predefined name. Either one return value is expected, or none,
|
||||
* for both methods and other objects.
|
||||
*
|
||||
* Exit now if there is no return object. Warning if one was expected.
|
||||
*/
|
||||
if (!ReturnObject)
|
||||
{
|
||||
if (ExpectedBtypes && (!(ExpectedBtypes & ACPI_RTYPE_NONE)))
|
||||
{
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname,
|
||||
ACPI_WARN_ALWAYS, "Missing expected return value"));
|
||||
|
||||
return (AE_AML_NO_RETURN_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
if (ExpectedBtypes & ACPI_RTYPE_INTEGER)
|
||||
{
|
||||
Status = AcpiNsConvertToInteger (ReturnObject, &NewObject);
|
||||
@ -240,273 +325,52 @@ ObjectRepaired:
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsConvertToInteger
|
||||
* FUNCTION: AcpiNsMatchSimpleRepair
|
||||
*
|
||||
* PARAMETERS: OriginalObject - Object to be converted
|
||||
* ReturnObject - Where the new converted object is returned
|
||||
* PARAMETERS: Node - Namespace node for the method/object
|
||||
* ReturnBtype - Object type that was returned
|
||||
* PackageIndex - Index of object within parent package (if
|
||||
* applicable - ACPI_NOT_PACKAGE_ELEMENT
|
||||
* otherwise)
|
||||
*
|
||||
* RETURN: Status. AE_OK if conversion was successful.
|
||||
* RETURN: Pointer to entry in repair table. NULL indicates not found.
|
||||
*
|
||||
* DESCRIPTION: Attempt to convert a String/Buffer object to an Integer.
|
||||
* DESCRIPTION: Check an object name against the repairable object list.
|
||||
*
|
||||
******************************************************************************/
|
||||
*****************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiNsConvertToInteger (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject)
|
||||
static const ACPI_SIMPLE_REPAIR_INFO *
|
||||
AcpiNsMatchSimpleRepair (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
UINT32 ReturnBtype,
|
||||
UINT32 PackageIndex)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *NewObject;
|
||||
ACPI_STATUS Status;
|
||||
UINT64 Value = 0;
|
||||
UINT32 i;
|
||||
const ACPI_SIMPLE_REPAIR_INFO *ThisName;
|
||||
|
||||
|
||||
switch (OriginalObject->Common.Type)
|
||||
/* Search info table for a repairable predefined method/object name */
|
||||
|
||||
ThisName = AcpiObjectRepairInfo;
|
||||
while (ThisName->ObjectConverter)
|
||||
{
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
/* String-to-Integer conversion */
|
||||
|
||||
Status = AcpiUtStrtoul64 (OriginalObject->String.Pointer,
|
||||
ACPI_ANY_BASE, &Value);
|
||||
if (ACPI_FAILURE (Status))
|
||||
if (ACPI_COMPARE_NAME (Node->Name.Ascii, ThisName->Name))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
break;
|
||||
/* Check if we can actually repair this name/type combination */
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
/* Buffer-to-Integer conversion. Max buffer size is 64 bits. */
|
||||
|
||||
if (OriginalObject->Buffer.Length > 8)
|
||||
{
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
/* Extract each buffer byte to create the integer */
|
||||
|
||||
for (i = 0; i < OriginalObject->Buffer.Length; i++)
|
||||
{
|
||||
Value |= ((UINT64) OriginalObject->Buffer.Pointer[i] << (i * 8));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
NewObject = AcpiUtCreateIntegerObject (Value);
|
||||
if (!NewObject)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
*ReturnObject = NewObject;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsConvertToString
|
||||
*
|
||||
* PARAMETERS: OriginalObject - Object to be converted
|
||||
* ReturnObject - Where the new converted object is returned
|
||||
*
|
||||
* RETURN: Status. AE_OK if conversion was successful.
|
||||
*
|
||||
* DESCRIPTION: Attempt to convert a Integer/Buffer object to a String.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiNsConvertToString (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *NewObject;
|
||||
ACPI_SIZE Length;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
switch (OriginalObject->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_INTEGER:
|
||||
/*
|
||||
* Integer-to-String conversion. Commonly, convert
|
||||
* an integer of value 0 to a NULL string. The last element of
|
||||
* _BIF and _BIX packages occasionally need this fix.
|
||||
*/
|
||||
if (OriginalObject->Integer.Value == 0)
|
||||
{
|
||||
/* Allocate a new NULL string object */
|
||||
|
||||
NewObject = AcpiUtCreateStringObject (0);
|
||||
if (!NewObject)
|
||||
if ((ReturnBtype & ThisName->UnexpectedBtypes) &&
|
||||
(PackageIndex == ThisName->PackageIndex))
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
return (ThisName);
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = AcpiExConvertToString (OriginalObject, &NewObject,
|
||||
ACPI_IMPLICIT_CONVERT_HEX);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
/*
|
||||
* Buffer-to-String conversion. Use a ToString
|
||||
* conversion, no transform performed on the buffer data. The best
|
||||
* example of this is the _BIF method, where the string data from
|
||||
* the battery is often (incorrectly) returned as buffer object(s).
|
||||
*/
|
||||
Length = 0;
|
||||
while ((Length < OriginalObject->Buffer.Length) &&
|
||||
(OriginalObject->Buffer.Pointer[Length]))
|
||||
{
|
||||
Length++;
|
||||
}
|
||||
|
||||
/* Allocate a new string object */
|
||||
|
||||
NewObject = AcpiUtCreateStringObject (Length);
|
||||
if (!NewObject)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy the raw buffer data with no transform. String is already NULL
|
||||
* terminated at Length+1.
|
||||
*/
|
||||
ACPI_MEMCPY (NewObject->String.Pointer,
|
||||
OriginalObject->Buffer.Pointer, Length);
|
||||
break;
|
||||
|
||||
default:
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
ThisName++;
|
||||
}
|
||||
|
||||
*ReturnObject = NewObject;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsConvertToBuffer
|
||||
*
|
||||
* PARAMETERS: OriginalObject - Object to be converted
|
||||
* ReturnObject - Where the new converted object is returned
|
||||
*
|
||||
* RETURN: Status. AE_OK if conversion was successful.
|
||||
*
|
||||
* DESCRIPTION: Attempt to convert a Integer/String/Package object to a Buffer.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiNsConvertToBuffer (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *NewObject;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OPERAND_OBJECT **Elements;
|
||||
UINT32 *DwordBuffer;
|
||||
UINT32 Count;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
switch (OriginalObject->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_INTEGER:
|
||||
/*
|
||||
* Integer-to-Buffer conversion.
|
||||
* Convert the Integer to a packed-byte buffer. _MAT and other
|
||||
* objects need this sometimes, if a read has been performed on a
|
||||
* Field object that is less than or equal to the global integer
|
||||
* size (32 or 64 bits).
|
||||
*/
|
||||
Status = AcpiExConvertToBuffer (OriginalObject, &NewObject);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
/* String-to-Buffer conversion. Simple data copy */
|
||||
|
||||
NewObject = AcpiUtCreateBufferObject (OriginalObject->String.Length);
|
||||
if (!NewObject)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
ACPI_MEMCPY (NewObject->Buffer.Pointer,
|
||||
OriginalObject->String.Pointer, OriginalObject->String.Length);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
/*
|
||||
* This case is often seen for predefined names that must return a
|
||||
* Buffer object with multiple DWORD integers within. For example,
|
||||
* _FDE and _GTM. The Package can be converted to a Buffer.
|
||||
*/
|
||||
|
||||
/* All elements of the Package must be integers */
|
||||
|
||||
Elements = OriginalObject->Package.Elements;
|
||||
Count = OriginalObject->Package.Count;
|
||||
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
if ((!*Elements) ||
|
||||
((*Elements)->Common.Type != ACPI_TYPE_INTEGER))
|
||||
{
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
Elements++;
|
||||
}
|
||||
|
||||
/* Create the new buffer object to replace the Package */
|
||||
|
||||
NewObject = AcpiUtCreateBufferObject (ACPI_MUL_4 (Count));
|
||||
if (!NewObject)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Copy the package elements (integers) to the buffer as DWORDs */
|
||||
|
||||
Elements = OriginalObject->Package.Elements;
|
||||
DwordBuffer = ACPI_CAST_PTR (UINT32, NewObject->Buffer.Pointer);
|
||||
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
*DwordBuffer = (UINT32) (*Elements)->Integer.Value;
|
||||
DwordBuffer++;
|
||||
Elements++;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
*ReturnObject = NewObject;
|
||||
return (AE_OK);
|
||||
return (NULL); /* Name was not found in the repair table */
|
||||
}
|
||||
|
||||
|
||||
|
@ -72,7 +72,7 @@ typedef struct acpi_repair_info
|
||||
/* Local prototypes */
|
||||
|
||||
static const ACPI_REPAIR_INFO *
|
||||
AcpiNsMatchRepairableName (
|
||||
AcpiNsMatchComplexRepair (
|
||||
ACPI_NAMESPACE_NODE *Node);
|
||||
|
||||
static ACPI_STATUS
|
||||
@ -197,7 +197,7 @@ AcpiNsComplexRepairs (
|
||||
|
||||
/* Check if this name is in the list of repairable names */
|
||||
|
||||
Predefined = AcpiNsMatchRepairableName (Node);
|
||||
Predefined = AcpiNsMatchComplexRepair (Node);
|
||||
if (!Predefined)
|
||||
{
|
||||
return (ValidateStatus);
|
||||
@ -210,7 +210,7 @@ AcpiNsComplexRepairs (
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsMatchRepairableName
|
||||
* FUNCTION: AcpiNsMatchComplexRepair
|
||||
*
|
||||
* PARAMETERS: Node - Namespace node for the method/object
|
||||
*
|
||||
@ -221,7 +221,7 @@ AcpiNsComplexRepairs (
|
||||
*****************************************************************************/
|
||||
|
||||
static const ACPI_REPAIR_INFO *
|
||||
AcpiNsMatchRepairableName (
|
||||
AcpiNsMatchComplexRepair (
|
||||
ACPI_NAMESPACE_NODE *Node)
|
||||
{
|
||||
const ACPI_REPAIR_INFO *ThisName;
|
||||
|
@ -128,10 +128,10 @@ AcpiNsGetType (
|
||||
if (!Node)
|
||||
{
|
||||
ACPI_WARNING ((AE_INFO, "Null Node parameter"));
|
||||
return_VALUE (ACPI_TYPE_ANY);
|
||||
return_UINT8 (ACPI_TYPE_ANY);
|
||||
}
|
||||
|
||||
return_VALUE (Node->Type);
|
||||
return_UINT8 (Node->Type);
|
||||
}
|
||||
|
||||
|
||||
@ -160,10 +160,10 @@ AcpiNsLocal (
|
||||
/* Type code out of range */
|
||||
|
||||
ACPI_WARNING ((AE_INFO, "Invalid Object Type 0x%X", Type));
|
||||
return_VALUE (ACPI_NS_NORMAL);
|
||||
return_UINT32 (ACPI_NS_NORMAL);
|
||||
}
|
||||
|
||||
return_VALUE (AcpiGbl_NsProperties[Type] & ACPI_NS_LOCAL);
|
||||
return_UINT32 (AcpiGbl_NsProperties[Type] & ACPI_NS_LOCAL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -118,7 +118,7 @@ AcpiPsGetNextPackageLength (
|
||||
/* Byte 0 is a special case, either bits [0:3] or [0:5] are used */
|
||||
|
||||
PackageLength |= (Aml[0] & ByteZeroMask);
|
||||
return_VALUE (PackageLength);
|
||||
return_UINT32 (PackageLength);
|
||||
}
|
||||
|
||||
|
||||
|
@ -230,6 +230,13 @@ AcpiRsGetAmlLength (
|
||||
return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE);
|
||||
}
|
||||
|
||||
/* Sanity check the length. It must not be zero, or we loop forever */
|
||||
|
||||
if (!Resource->Length)
|
||||
{
|
||||
return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH);
|
||||
}
|
||||
|
||||
/* Get the base size of the (external stream) resource descriptor */
|
||||
|
||||
TotalSize = AcpiGbl_AmlResourceSizes [Resource->Type];
|
||||
|
@ -438,6 +438,15 @@ AcpiRsDumpResourceList (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sanity check the length. It must not be zero, or we loop forever */
|
||||
|
||||
if (!ResourceList->Length)
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
"Invalid zero length descriptor in resource list\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Dump the resource descriptor */
|
||||
|
||||
if (Type == ACPI_RESOURCE_TYPE_SERIAL_BUS)
|
||||
|
@ -199,6 +199,15 @@ AcpiRsConvertResourcesToAml (
|
||||
return_ACPI_STATUS (AE_BAD_DATA);
|
||||
}
|
||||
|
||||
/* Sanity check the length. It must not be zero, or we loop forever */
|
||||
|
||||
if (!Resource->Length)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Invalid zero length descriptor in resource list\n"));
|
||||
return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH);
|
||||
}
|
||||
|
||||
/* Perform the conversion */
|
||||
|
||||
if (Resource->Type == ACPI_RESOURCE_TYPE_SERIAL_BUS)
|
||||
|
@ -630,7 +630,7 @@ AcpiWalkResourceBuffer (
|
||||
|
||||
while (Resource < ResourceEnd)
|
||||
{
|
||||
/* Sanity check the resource */
|
||||
/* Sanity check the resource type */
|
||||
|
||||
if (Resource->Type > ACPI_RESOURCE_TYPE_MAX)
|
||||
{
|
||||
@ -638,6 +638,13 @@ AcpiWalkResourceBuffer (
|
||||
break;
|
||||
}
|
||||
|
||||
/* Sanity check the length. It must not be zero, or we loop forever */
|
||||
|
||||
if (!Resource->Length)
|
||||
{
|
||||
return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH);
|
||||
}
|
||||
|
||||
/* Invoke the user function, abort on any error returned */
|
||||
|
||||
Status = UserFunction (Resource, Context);
|
||||
|
@ -237,7 +237,7 @@ AcpiUtCheckAddressRange (
|
||||
if ((SpaceId != ACPI_ADR_SPACE_SYSTEM_MEMORY) &&
|
||||
(SpaceId != ACPI_ADR_SPACE_SYSTEM_IO))
|
||||
{
|
||||
return_VALUE (0);
|
||||
return_UINT32 (0);
|
||||
}
|
||||
|
||||
RangeInfo = AcpiGbl_AddressRangeList[SpaceId];
|
||||
@ -278,7 +278,7 @@ AcpiUtCheckAddressRange (
|
||||
RangeInfo = RangeInfo->Next;
|
||||
}
|
||||
|
||||
return_VALUE (OverlapCount);
|
||||
return_UINT32 (OverlapCount);
|
||||
}
|
||||
|
||||
|
||||
|
@ -71,7 +71,7 @@ const char *
|
||||
AcpiFormatException (
|
||||
ACPI_STATUS Status)
|
||||
{
|
||||
const char *Exception = NULL;
|
||||
const ACPI_EXCEPTION_INFO *Exception;
|
||||
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
@ -85,10 +85,10 @@ AcpiFormatException (
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Unknown exception code: 0x%8.8X", Status));
|
||||
|
||||
Exception = "UNKNOWN_STATUS_CODE";
|
||||
return ("UNKNOWN_STATUS_CODE");
|
||||
}
|
||||
|
||||
return (ACPI_CAST_PTR (const char, Exception));
|
||||
return (Exception->Name);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiFormatException)
|
||||
@ -108,12 +108,12 @@ ACPI_EXPORT_SYMBOL (AcpiFormatException)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
const char *
|
||||
const ACPI_EXCEPTION_INFO *
|
||||
AcpiUtValidateException (
|
||||
ACPI_STATUS Status)
|
||||
{
|
||||
UINT32 SubStatus;
|
||||
const char *Exception = NULL;
|
||||
UINT32 SubStatus;
|
||||
const ACPI_EXCEPTION_INFO *Exception = NULL;
|
||||
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
@ -130,7 +130,7 @@ AcpiUtValidateException (
|
||||
|
||||
if (SubStatus <= AE_CODE_ENV_MAX)
|
||||
{
|
||||
Exception = AcpiGbl_ExceptionNames_Env [SubStatus];
|
||||
Exception = &AcpiGbl_ExceptionNames_Env [SubStatus];
|
||||
}
|
||||
break;
|
||||
|
||||
@ -138,7 +138,7 @@ AcpiUtValidateException (
|
||||
|
||||
if (SubStatus <= AE_CODE_PGM_MAX)
|
||||
{
|
||||
Exception = AcpiGbl_ExceptionNames_Pgm [SubStatus];
|
||||
Exception = &AcpiGbl_ExceptionNames_Pgm [SubStatus];
|
||||
}
|
||||
break;
|
||||
|
||||
@ -146,7 +146,7 @@ AcpiUtValidateException (
|
||||
|
||||
if (SubStatus <= AE_CODE_TBL_MAX)
|
||||
{
|
||||
Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus];
|
||||
Exception = &AcpiGbl_ExceptionNames_Tbl [SubStatus];
|
||||
}
|
||||
break;
|
||||
|
||||
@ -154,7 +154,7 @@ AcpiUtValidateException (
|
||||
|
||||
if (SubStatus <= AE_CODE_AML_MAX)
|
||||
{
|
||||
Exception = AcpiGbl_ExceptionNames_Aml [SubStatus];
|
||||
Exception = &AcpiGbl_ExceptionNames_Aml [SubStatus];
|
||||
}
|
||||
break;
|
||||
|
||||
@ -162,7 +162,7 @@ AcpiUtValidateException (
|
||||
|
||||
if (SubStatus <= AE_CODE_CTRL_MAX)
|
||||
{
|
||||
Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus];
|
||||
Exception = &AcpiGbl_ExceptionNames_Ctrl [SubStatus];
|
||||
}
|
||||
break;
|
||||
|
||||
@ -170,5 +170,10 @@ AcpiUtValidateException (
|
||||
break;
|
||||
}
|
||||
|
||||
return (ACPI_CAST_PTR (const char, Exception));
|
||||
if (!Exception || !Exception->Name)
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
return (Exception);
|
||||
}
|
||||
|
@ -343,6 +343,8 @@ AcpiUtInitGlobals (
|
||||
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
AcpiGbl_ExternalList = NULL;
|
||||
AcpiGbl_NumExternalMethods = 0;
|
||||
AcpiGbl_ResolvedExternalMethods = 0;
|
||||
#endif
|
||||
|
||||
#ifdef ACPI_DEBUG_OUTPUT
|
||||
|
@ -314,6 +314,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1[];
|
||||
@ -343,6 +345,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWaet[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat0[];
|
||||
@ -456,6 +460,10 @@ void
|
||||
AcpiDmDumpMsct (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpMtmr (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpPcct (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
@ -488,6 +496,10 @@ void
|
||||
AcpiDmDumpSrat (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpVrtc (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpWdat (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
@ -677,6 +689,10 @@ void
|
||||
AcpiDmEmitExternals (
|
||||
void);
|
||||
|
||||
void
|
||||
AcpiDmUnresolvedWarning (
|
||||
UINT8 Type);
|
||||
|
||||
|
||||
/*
|
||||
* dmresrc
|
||||
|
@ -45,55 +45,88 @@
|
||||
#define __ACEXCEP_H__
|
||||
|
||||
|
||||
/* This module contains all possible exception codes for ACPI_STATUS */
|
||||
|
||||
/*
|
||||
* Exceptions returned by external ACPI interfaces
|
||||
* Exception code classes
|
||||
*/
|
||||
#define AE_CODE_ENVIRONMENTAL 0x0000
|
||||
#define AE_CODE_PROGRAMMER 0x1000
|
||||
#define AE_CODE_ACPI_TABLES 0x2000
|
||||
#define AE_CODE_AML 0x3000
|
||||
#define AE_CODE_CONTROL 0x4000
|
||||
#define AE_CODE_ENVIRONMENTAL 0x0000 /* General ACPICA environment */
|
||||
#define AE_CODE_PROGRAMMER 0x1000 /* External ACPICA interface caller */
|
||||
#define AE_CODE_ACPI_TABLES 0x2000 /* ACPI tables */
|
||||
#define AE_CODE_AML 0x3000 /* From executing AML code */
|
||||
#define AE_CODE_CONTROL 0x4000 /* Internal control codes */
|
||||
|
||||
#define AE_CODE_MAX 0x4000
|
||||
#define AE_CODE_MASK 0xF000
|
||||
|
||||
/*
|
||||
* Macros to insert the exception code classes
|
||||
*/
|
||||
#define EXCEP_ENV(code) ((ACPI_STATUS) (code | AE_CODE_ENVIRONMENTAL))
|
||||
#define EXCEP_PGM(code) ((ACPI_STATUS) (code | AE_CODE_PROGRAMMER))
|
||||
#define EXCEP_TBL(code) ((ACPI_STATUS) (code | AE_CODE_ACPI_TABLES))
|
||||
#define EXCEP_AML(code) ((ACPI_STATUS) (code | AE_CODE_AML))
|
||||
#define EXCEP_CTL(code) ((ACPI_STATUS) (code | AE_CODE_CONTROL))
|
||||
|
||||
/*
|
||||
* Exception info table. The "Description" field is used only by the
|
||||
* ACPICA help application (acpihelp).
|
||||
*/
|
||||
typedef struct acpi_exception_info
|
||||
{
|
||||
char *Name;
|
||||
|
||||
#ifdef ACPI_HELP_APP
|
||||
char *Description;
|
||||
#endif
|
||||
} ACPI_EXCEPTION_INFO;
|
||||
|
||||
#ifdef ACPI_HELP_APP
|
||||
#define EXCEP_TXT(Name,Description) {Name, Description}
|
||||
#else
|
||||
#define EXCEP_TXT(Name,Description) {Name}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Success is always zero, failure is non-zero
|
||||
*/
|
||||
#define ACPI_SUCCESS(a) (!(a))
|
||||
#define ACPI_FAILURE(a) (a)
|
||||
|
||||
|
||||
#define AE_OK (ACPI_STATUS) 0x0000
|
||||
|
||||
/*
|
||||
* Environmental exceptions
|
||||
*/
|
||||
#define AE_ERROR (ACPI_STATUS) (0x0001 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NO_ACPI_TABLES (ACPI_STATUS) (0x0002 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NO_NAMESPACE (ACPI_STATUS) (0x0003 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NO_MEMORY (ACPI_STATUS) (0x0004 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NOT_FOUND (ACPI_STATUS) (0x0005 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NOT_EXIST (ACPI_STATUS) (0x0006 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_ALREADY_EXISTS (ACPI_STATUS) (0x0007 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_TYPE (ACPI_STATUS) (0x0008 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NULL_OBJECT (ACPI_STATUS) (0x0009 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NULL_ENTRY (ACPI_STATUS) (0x000A | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_BUFFER_OVERFLOW (ACPI_STATUS) (0x000B | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_STACK_OVERFLOW (ACPI_STATUS) (0x000C | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_STACK_UNDERFLOW (ACPI_STATUS) (0x000D | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NOT_IMPLEMENTED (ACPI_STATUS) (0x000E | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_SUPPORT (ACPI_STATUS) (0x000F | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_LIMIT (ACPI_STATUS) (0x0010 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_TIME (ACPI_STATUS) (0x0011 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_ACQUIRE_DEADLOCK (ACPI_STATUS) (0x0012 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_RELEASE_DEADLOCK (ACPI_STATUS) (0x0013 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NOT_ACQUIRED (ACPI_STATUS) (0x0014 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_ALREADY_ACQUIRED (ACPI_STATUS) (0x0015 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NO_HARDWARE_RESPONSE (ACPI_STATUS) (0x0016 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NO_GLOBAL_LOCK (ACPI_STATUS) (0x0017 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_ABORT_METHOD (ACPI_STATUS) (0x0018 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_SAME_HANDLER (ACPI_STATUS) (0x0019 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NO_HANDLER (ACPI_STATUS) (0x001A | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_OWNER_ID_LIMIT (ACPI_STATUS) (0x001B | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NOT_CONFIGURED (ACPI_STATUS) (0x001C | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_ERROR EXCEP_ENV (0x0001)
|
||||
#define AE_NO_ACPI_TABLES EXCEP_ENV (0x0002)
|
||||
#define AE_NO_NAMESPACE EXCEP_ENV (0x0003)
|
||||
#define AE_NO_MEMORY EXCEP_ENV (0x0004)
|
||||
#define AE_NOT_FOUND EXCEP_ENV (0x0005)
|
||||
#define AE_NOT_EXIST EXCEP_ENV (0x0006)
|
||||
#define AE_ALREADY_EXISTS EXCEP_ENV (0x0007)
|
||||
#define AE_TYPE EXCEP_ENV (0x0008)
|
||||
#define AE_NULL_OBJECT EXCEP_ENV (0x0009)
|
||||
#define AE_NULL_ENTRY EXCEP_ENV (0x000A)
|
||||
#define AE_BUFFER_OVERFLOW EXCEP_ENV (0x000B)
|
||||
#define AE_STACK_OVERFLOW EXCEP_ENV (0x000C)
|
||||
#define AE_STACK_UNDERFLOW EXCEP_ENV (0x000D)
|
||||
#define AE_NOT_IMPLEMENTED EXCEP_ENV (0x000E)
|
||||
#define AE_SUPPORT EXCEP_ENV (0x000F)
|
||||
#define AE_LIMIT EXCEP_ENV (0x0010)
|
||||
#define AE_TIME EXCEP_ENV (0x0011)
|
||||
#define AE_ACQUIRE_DEADLOCK EXCEP_ENV (0x0012)
|
||||
#define AE_RELEASE_DEADLOCK EXCEP_ENV (0x0013)
|
||||
#define AE_NOT_ACQUIRED EXCEP_ENV (0x0014)
|
||||
#define AE_ALREADY_ACQUIRED EXCEP_ENV (0x0015)
|
||||
#define AE_NO_HARDWARE_RESPONSE EXCEP_ENV (0x0016)
|
||||
#define AE_NO_GLOBAL_LOCK EXCEP_ENV (0x0017)
|
||||
#define AE_ABORT_METHOD EXCEP_ENV (0x0018)
|
||||
#define AE_SAME_HANDLER EXCEP_ENV (0x0019)
|
||||
#define AE_NO_HANDLER EXCEP_ENV (0x001A)
|
||||
#define AE_OWNER_ID_LIMIT EXCEP_ENV (0x001B)
|
||||
#define AE_NOT_CONFIGURED EXCEP_ENV (0x001C)
|
||||
|
||||
#define AE_CODE_ENV_MAX 0x001C
|
||||
|
||||
@ -101,15 +134,15 @@
|
||||
/*
|
||||
* Programmer exceptions
|
||||
*/
|
||||
#define AE_BAD_PARAMETER (ACPI_STATUS) (0x0001 | AE_CODE_PROGRAMMER)
|
||||
#define AE_BAD_CHARACTER (ACPI_STATUS) (0x0002 | AE_CODE_PROGRAMMER)
|
||||
#define AE_BAD_PATHNAME (ACPI_STATUS) (0x0003 | AE_CODE_PROGRAMMER)
|
||||
#define AE_BAD_DATA (ACPI_STATUS) (0x0004 | AE_CODE_PROGRAMMER)
|
||||
#define AE_BAD_HEX_CONSTANT (ACPI_STATUS) (0x0005 | AE_CODE_PROGRAMMER)
|
||||
#define AE_BAD_OCTAL_CONSTANT (ACPI_STATUS) (0x0006 | AE_CODE_PROGRAMMER)
|
||||
#define AE_BAD_DECIMAL_CONSTANT (ACPI_STATUS) (0x0007 | AE_CODE_PROGRAMMER)
|
||||
#define AE_MISSING_ARGUMENTS (ACPI_STATUS) (0x0008 | AE_CODE_PROGRAMMER)
|
||||
#define AE_BAD_ADDRESS (ACPI_STATUS) (0x0009 | AE_CODE_PROGRAMMER)
|
||||
#define AE_BAD_PARAMETER EXCEP_PGM (0x0001)
|
||||
#define AE_BAD_CHARACTER EXCEP_PGM (0x0002)
|
||||
#define AE_BAD_PATHNAME EXCEP_PGM (0x0003)
|
||||
#define AE_BAD_DATA EXCEP_PGM (0x0004)
|
||||
#define AE_BAD_HEX_CONSTANT EXCEP_PGM (0x0005)
|
||||
#define AE_BAD_OCTAL_CONSTANT EXCEP_PGM (0x0006)
|
||||
#define AE_BAD_DECIMAL_CONSTANT EXCEP_PGM (0x0007)
|
||||
#define AE_MISSING_ARGUMENTS EXCEP_PGM (0x0008)
|
||||
#define AE_BAD_ADDRESS EXCEP_PGM (0x0009)
|
||||
|
||||
#define AE_CODE_PGM_MAX 0x0009
|
||||
|
||||
@ -117,11 +150,11 @@
|
||||
/*
|
||||
* Acpi table exceptions
|
||||
*/
|
||||
#define AE_BAD_SIGNATURE (ACPI_STATUS) (0x0001 | AE_CODE_ACPI_TABLES)
|
||||
#define AE_BAD_HEADER (ACPI_STATUS) (0x0002 | AE_CODE_ACPI_TABLES)
|
||||
#define AE_BAD_CHECKSUM (ACPI_STATUS) (0x0003 | AE_CODE_ACPI_TABLES)
|
||||
#define AE_BAD_VALUE (ACPI_STATUS) (0x0004 | AE_CODE_ACPI_TABLES)
|
||||
#define AE_INVALID_TABLE_LENGTH (ACPI_STATUS) (0x0005 | AE_CODE_ACPI_TABLES)
|
||||
#define AE_BAD_SIGNATURE EXCEP_TBL (0x0001)
|
||||
#define AE_BAD_HEADER EXCEP_TBL (0x0002)
|
||||
#define AE_BAD_CHECKSUM EXCEP_TBL (0x0003)
|
||||
#define AE_BAD_VALUE EXCEP_TBL (0x0004)
|
||||
#define AE_INVALID_TABLE_LENGTH EXCEP_TBL (0x0005)
|
||||
|
||||
#define AE_CODE_TBL_MAX 0x0005
|
||||
|
||||
@ -130,39 +163,39 @@
|
||||
* AML exceptions. These are caused by problems with
|
||||
* the actual AML byte stream
|
||||
*/
|
||||
#define AE_AML_BAD_OPCODE (ACPI_STATUS) (0x0001 | AE_CODE_AML)
|
||||
#define AE_AML_NO_OPERAND (ACPI_STATUS) (0x0002 | AE_CODE_AML)
|
||||
#define AE_AML_OPERAND_TYPE (ACPI_STATUS) (0x0003 | AE_CODE_AML)
|
||||
#define AE_AML_OPERAND_VALUE (ACPI_STATUS) (0x0004 | AE_CODE_AML)
|
||||
#define AE_AML_UNINITIALIZED_LOCAL (ACPI_STATUS) (0x0005 | AE_CODE_AML)
|
||||
#define AE_AML_UNINITIALIZED_ARG (ACPI_STATUS) (0x0006 | AE_CODE_AML)
|
||||
#define AE_AML_UNINITIALIZED_ELEMENT (ACPI_STATUS) (0x0007 | AE_CODE_AML)
|
||||
#define AE_AML_NUMERIC_OVERFLOW (ACPI_STATUS) (0x0008 | AE_CODE_AML)
|
||||
#define AE_AML_REGION_LIMIT (ACPI_STATUS) (0x0009 | AE_CODE_AML)
|
||||
#define AE_AML_BUFFER_LIMIT (ACPI_STATUS) (0x000A | AE_CODE_AML)
|
||||
#define AE_AML_PACKAGE_LIMIT (ACPI_STATUS) (0x000B | AE_CODE_AML)
|
||||
#define AE_AML_DIVIDE_BY_ZERO (ACPI_STATUS) (0x000C | AE_CODE_AML)
|
||||
#define AE_AML_BAD_NAME (ACPI_STATUS) (0x000D | AE_CODE_AML)
|
||||
#define AE_AML_NAME_NOT_FOUND (ACPI_STATUS) (0x000E | AE_CODE_AML)
|
||||
#define AE_AML_INTERNAL (ACPI_STATUS) (0x000F | AE_CODE_AML)
|
||||
#define AE_AML_INVALID_SPACE_ID (ACPI_STATUS) (0x0010 | AE_CODE_AML)
|
||||
#define AE_AML_STRING_LIMIT (ACPI_STATUS) (0x0011 | AE_CODE_AML)
|
||||
#define AE_AML_NO_RETURN_VALUE (ACPI_STATUS) (0x0012 | AE_CODE_AML)
|
||||
#define AE_AML_METHOD_LIMIT (ACPI_STATUS) (0x0013 | AE_CODE_AML)
|
||||
#define AE_AML_NOT_OWNER (ACPI_STATUS) (0x0014 | AE_CODE_AML)
|
||||
#define AE_AML_MUTEX_ORDER (ACPI_STATUS) (0x0015 | AE_CODE_AML)
|
||||
#define AE_AML_MUTEX_NOT_ACQUIRED (ACPI_STATUS) (0x0016 | AE_CODE_AML)
|
||||
#define AE_AML_INVALID_RESOURCE_TYPE (ACPI_STATUS) (0x0017 | AE_CODE_AML)
|
||||
#define AE_AML_INVALID_INDEX (ACPI_STATUS) (0x0018 | AE_CODE_AML)
|
||||
#define AE_AML_REGISTER_LIMIT (ACPI_STATUS) (0x0019 | AE_CODE_AML)
|
||||
#define AE_AML_NO_WHILE (ACPI_STATUS) (0x001A | AE_CODE_AML)
|
||||
#define AE_AML_ALIGNMENT (ACPI_STATUS) (0x001B | AE_CODE_AML)
|
||||
#define AE_AML_NO_RESOURCE_END_TAG (ACPI_STATUS) (0x001C | AE_CODE_AML)
|
||||
#define AE_AML_BAD_RESOURCE_VALUE (ACPI_STATUS) (0x001D | AE_CODE_AML)
|
||||
#define AE_AML_CIRCULAR_REFERENCE (ACPI_STATUS) (0x001E | AE_CODE_AML)
|
||||
#define AE_AML_BAD_RESOURCE_LENGTH (ACPI_STATUS) (0x001F | AE_CODE_AML)
|
||||
#define AE_AML_ILLEGAL_ADDRESS (ACPI_STATUS) (0x0020 | AE_CODE_AML)
|
||||
#define AE_AML_INFINITE_LOOP (ACPI_STATUS) (0x0021 | AE_CODE_AML)
|
||||
#define AE_AML_BAD_OPCODE EXCEP_AML (0x0001)
|
||||
#define AE_AML_NO_OPERAND EXCEP_AML (0x0002)
|
||||
#define AE_AML_OPERAND_TYPE EXCEP_AML (0x0003)
|
||||
#define AE_AML_OPERAND_VALUE EXCEP_AML (0x0004)
|
||||
#define AE_AML_UNINITIALIZED_LOCAL EXCEP_AML (0x0005)
|
||||
#define AE_AML_UNINITIALIZED_ARG EXCEP_AML (0x0006)
|
||||
#define AE_AML_UNINITIALIZED_ELEMENT EXCEP_AML (0x0007)
|
||||
#define AE_AML_NUMERIC_OVERFLOW EXCEP_AML (0x0008)
|
||||
#define AE_AML_REGION_LIMIT EXCEP_AML (0x0009)
|
||||
#define AE_AML_BUFFER_LIMIT EXCEP_AML (0x000A)
|
||||
#define AE_AML_PACKAGE_LIMIT EXCEP_AML (0x000B)
|
||||
#define AE_AML_DIVIDE_BY_ZERO EXCEP_AML (0x000C)
|
||||
#define AE_AML_BAD_NAME EXCEP_AML (0x000D)
|
||||
#define AE_AML_NAME_NOT_FOUND EXCEP_AML (0x000E)
|
||||
#define AE_AML_INTERNAL EXCEP_AML (0x000F)
|
||||
#define AE_AML_INVALID_SPACE_ID EXCEP_AML (0x0010)
|
||||
#define AE_AML_STRING_LIMIT EXCEP_AML (0x0011)
|
||||
#define AE_AML_NO_RETURN_VALUE EXCEP_AML (0x0012)
|
||||
#define AE_AML_METHOD_LIMIT EXCEP_AML (0x0013)
|
||||
#define AE_AML_NOT_OWNER EXCEP_AML (0x0014)
|
||||
#define AE_AML_MUTEX_ORDER EXCEP_AML (0x0015)
|
||||
#define AE_AML_MUTEX_NOT_ACQUIRED EXCEP_AML (0x0016)
|
||||
#define AE_AML_INVALID_RESOURCE_TYPE EXCEP_AML (0x0017)
|
||||
#define AE_AML_INVALID_INDEX EXCEP_AML (0x0018)
|
||||
#define AE_AML_REGISTER_LIMIT EXCEP_AML (0x0019)
|
||||
#define AE_AML_NO_WHILE EXCEP_AML (0x001A)
|
||||
#define AE_AML_ALIGNMENT EXCEP_AML (0x001B)
|
||||
#define AE_AML_NO_RESOURCE_END_TAG EXCEP_AML (0x001C)
|
||||
#define AE_AML_BAD_RESOURCE_VALUE EXCEP_AML (0x001D)
|
||||
#define AE_AML_CIRCULAR_REFERENCE EXCEP_AML (0x001E)
|
||||
#define AE_AML_BAD_RESOURCE_LENGTH EXCEP_AML (0x001F)
|
||||
#define AE_AML_ILLEGAL_ADDRESS EXCEP_AML (0x0020)
|
||||
#define AE_AML_INFINITE_LOOP EXCEP_AML (0x0021)
|
||||
|
||||
#define AE_CODE_AML_MAX 0x0021
|
||||
|
||||
@ -170,19 +203,19 @@
|
||||
/*
|
||||
* Internal exceptions used for control
|
||||
*/
|
||||
#define AE_CTRL_RETURN_VALUE (ACPI_STATUS) (0x0001 | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_PENDING (ACPI_STATUS) (0x0002 | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_TERMINATE (ACPI_STATUS) (0x0003 | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_TRUE (ACPI_STATUS) (0x0004 | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_FALSE (ACPI_STATUS) (0x0005 | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_DEPTH (ACPI_STATUS) (0x0006 | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_END (ACPI_STATUS) (0x0007 | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_TRANSFER (ACPI_STATUS) (0x0008 | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_BREAK (ACPI_STATUS) (0x0009 | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_CONTINUE (ACPI_STATUS) (0x000A | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_SKIP (ACPI_STATUS) (0x000B | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_PARSE_CONTINUE (ACPI_STATUS) (0x000C | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_PARSE_PENDING (ACPI_STATUS) (0x000D | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_RETURN_VALUE EXCEP_CTL (0x0001)
|
||||
#define AE_CTRL_PENDING EXCEP_CTL (0x0002)
|
||||
#define AE_CTRL_TERMINATE EXCEP_CTL (0x0003)
|
||||
#define AE_CTRL_TRUE EXCEP_CTL (0x0004)
|
||||
#define AE_CTRL_FALSE EXCEP_CTL (0x0005)
|
||||
#define AE_CTRL_DEPTH EXCEP_CTL (0x0006)
|
||||
#define AE_CTRL_END EXCEP_CTL (0x0007)
|
||||
#define AE_CTRL_TRANSFER EXCEP_CTL (0x0008)
|
||||
#define AE_CTRL_BREAK EXCEP_CTL (0x0009)
|
||||
#define AE_CTRL_CONTINUE EXCEP_CTL (0x000A)
|
||||
#define AE_CTRL_SKIP EXCEP_CTL (0x000B)
|
||||
#define AE_CTRL_PARSE_CONTINUE EXCEP_CTL (0x000C)
|
||||
#define AE_CTRL_PARSE_PENDING EXCEP_CTL (0x000D)
|
||||
|
||||
#define AE_CODE_CTRL_MAX 0x000D
|
||||
|
||||
@ -195,117 +228,117 @@
|
||||
* String versions of the exception codes above
|
||||
* These strings must match the corresponding defines exactly
|
||||
*/
|
||||
char const *AcpiGbl_ExceptionNames_Env[] =
|
||||
static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Env[] =
|
||||
{
|
||||
"AE_OK",
|
||||
"AE_ERROR",
|
||||
"AE_NO_ACPI_TABLES",
|
||||
"AE_NO_NAMESPACE",
|
||||
"AE_NO_MEMORY",
|
||||
"AE_NOT_FOUND",
|
||||
"AE_NOT_EXIST",
|
||||
"AE_ALREADY_EXISTS",
|
||||
"AE_TYPE",
|
||||
"AE_NULL_OBJECT",
|
||||
"AE_NULL_ENTRY",
|
||||
"AE_BUFFER_OVERFLOW",
|
||||
"AE_STACK_OVERFLOW",
|
||||
"AE_STACK_UNDERFLOW",
|
||||
"AE_NOT_IMPLEMENTED",
|
||||
"AE_SUPPORT",
|
||||
"AE_LIMIT",
|
||||
"AE_TIME",
|
||||
"AE_ACQUIRE_DEADLOCK",
|
||||
"AE_RELEASE_DEADLOCK",
|
||||
"AE_NOT_ACQUIRED",
|
||||
"AE_ALREADY_ACQUIRED",
|
||||
"AE_NO_HARDWARE_RESPONSE",
|
||||
"AE_NO_GLOBAL_LOCK",
|
||||
"AE_ABORT_METHOD",
|
||||
"AE_SAME_HANDLER",
|
||||
"AE_NO_HANDLER",
|
||||
"AE_OWNER_ID_LIMIT",
|
||||
"AE_NOT_CONFIGURED"
|
||||
EXCEP_TXT ("AE_OK", "No error"),
|
||||
EXCEP_TXT ("AE_ERROR", "Unspecified error"),
|
||||
EXCEP_TXT ("AE_NO_ACPI_TABLES", "ACPI tables could not be found"),
|
||||
EXCEP_TXT ("AE_NO_NAMESPACE", "A namespace has not been loaded"),
|
||||
EXCEP_TXT ("AE_NO_MEMORY", "Insufficient dynamic memory"),
|
||||
EXCEP_TXT ("AE_NOT_FOUND", "The name was not found in the namespace"),
|
||||
EXCEP_TXT ("AE_NOT_EXIST", "A required entity does not exist"),
|
||||
EXCEP_TXT ("AE_ALREADY_EXISTS", "An entity already exists"),
|
||||
EXCEP_TXT ("AE_TYPE", "The object type is incorrect"),
|
||||
EXCEP_TXT ("AE_NULL_OBJECT", "A required object was missing"),
|
||||
EXCEP_TXT ("AE_NULL_ENTRY", "The requested object does not exist"),
|
||||
EXCEP_TXT ("AE_BUFFER_OVERFLOW", "The buffer provided is too small"),
|
||||
EXCEP_TXT ("AE_STACK_OVERFLOW", "An internal stack overflowed"),
|
||||
EXCEP_TXT ("AE_STACK_UNDERFLOW", "An internal stack underflowed"),
|
||||
EXCEP_TXT ("AE_NOT_IMPLEMENTED", "The feature is not implemented"),
|
||||
EXCEP_TXT ("AE_SUPPORT", "The feature is not supported"),
|
||||
EXCEP_TXT ("AE_LIMIT", "A predefined limit was exceeded"),
|
||||
EXCEP_TXT ("AE_TIME", "A time limit or timeout expired"),
|
||||
EXCEP_TXT ("AE_ACQUIRE_DEADLOCK", "Internal error, attempt was made to acquire a mutex in improper order"),
|
||||
EXCEP_TXT ("AE_RELEASE_DEADLOCK", "Internal error, attempt was made to release a mutex in improper order"),
|
||||
EXCEP_TXT ("AE_NOT_ACQUIRED", "An attempt to release a mutex or Global Lock without a previous acquire"),
|
||||
EXCEP_TXT ("AE_ALREADY_ACQUIRED", "Internal error, attempt was made to acquire a mutex twice"),
|
||||
EXCEP_TXT ("AE_NO_HARDWARE_RESPONSE", "Hardware did not respond after an I/O operation"),
|
||||
EXCEP_TXT ("AE_NO_GLOBAL_LOCK", "There is no FACS Global Lock"),
|
||||
EXCEP_TXT ("AE_ABORT_METHOD", "A control method was aborted"),
|
||||
EXCEP_TXT ("AE_SAME_HANDLER", "Attempt was made to install the same handler that is already installed"),
|
||||
EXCEP_TXT ("AE_NO_HANDLER", "A handler for the operation is not installed"),
|
||||
EXCEP_TXT ("AE_OWNER_ID_LIMIT", "There are no more Owner IDs available for ACPI tables or control methods"),
|
||||
EXCEP_TXT ("AE_NOT_CONFIGURED", "The interface is not part of the current subsystem configuration")
|
||||
};
|
||||
|
||||
char const *AcpiGbl_ExceptionNames_Pgm[] =
|
||||
static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Pgm[] =
|
||||
{
|
||||
NULL,
|
||||
"AE_BAD_PARAMETER",
|
||||
"AE_BAD_CHARACTER",
|
||||
"AE_BAD_PATHNAME",
|
||||
"AE_BAD_DATA",
|
||||
"AE_BAD_HEX_CONSTANT",
|
||||
"AE_BAD_OCTAL_CONSTANT",
|
||||
"AE_BAD_DECIMAL_CONSTANT",
|
||||
"AE_MISSING_ARGUMENTS",
|
||||
"AE_BAD_ADDRESS"
|
||||
EXCEP_TXT (NULL, NULL),
|
||||
EXCEP_TXT ("AE_BAD_PARAMETER", "A parameter is out of range or invalid"),
|
||||
EXCEP_TXT ("AE_BAD_CHARACTER", "An invalid character was found in a name"),
|
||||
EXCEP_TXT ("AE_BAD_PATHNAME", "An invalid character was found in a pathname"),
|
||||
EXCEP_TXT ("AE_BAD_DATA", "A package or buffer contained incorrect data"),
|
||||
EXCEP_TXT ("AE_BAD_HEX_CONSTANT", "Invalid character in a Hex constant"),
|
||||
EXCEP_TXT ("AE_BAD_OCTAL_CONSTANT", "Invalid character in an Octal constant"),
|
||||
EXCEP_TXT ("AE_BAD_DECIMAL_CONSTANT", "Invalid character in a Decimal constant"),
|
||||
EXCEP_TXT ("AE_MISSING_ARGUMENTS", "Too few arguments were passed to a control method"),
|
||||
EXCEP_TXT ("AE_BAD_ADDRESS", "An illegal null I/O address")
|
||||
};
|
||||
|
||||
char const *AcpiGbl_ExceptionNames_Tbl[] =
|
||||
static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Tbl[] =
|
||||
{
|
||||
NULL,
|
||||
"AE_BAD_SIGNATURE",
|
||||
"AE_BAD_HEADER",
|
||||
"AE_BAD_CHECKSUM",
|
||||
"AE_BAD_VALUE",
|
||||
"AE_INVALID_TABLE_LENGTH"
|
||||
EXCEP_TXT (NULL, NULL),
|
||||
EXCEP_TXT ("AE_BAD_SIGNATURE", "An ACPI table has an invalid signature"),
|
||||
EXCEP_TXT ("AE_BAD_HEADER", "Invalid field in an ACPI table header"),
|
||||
EXCEP_TXT ("AE_BAD_CHECKSUM", "An ACPI table checksum is not correct"),
|
||||
EXCEP_TXT ("AE_BAD_VALUE", "An invalid value was found in a table"),
|
||||
EXCEP_TXT ("AE_INVALID_TABLE_LENGTH", "The FADT or FACS has improper length")
|
||||
};
|
||||
|
||||
char const *AcpiGbl_ExceptionNames_Aml[] =
|
||||
static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Aml[] =
|
||||
{
|
||||
NULL,
|
||||
"AE_AML_BAD_OPCODE",
|
||||
"AE_AML_NO_OPERAND",
|
||||
"AE_AML_OPERAND_TYPE",
|
||||
"AE_AML_OPERAND_VALUE",
|
||||
"AE_AML_UNINITIALIZED_LOCAL",
|
||||
"AE_AML_UNINITIALIZED_ARG",
|
||||
"AE_AML_UNINITIALIZED_ELEMENT",
|
||||
"AE_AML_NUMERIC_OVERFLOW",
|
||||
"AE_AML_REGION_LIMIT",
|
||||
"AE_AML_BUFFER_LIMIT",
|
||||
"AE_AML_PACKAGE_LIMIT",
|
||||
"AE_AML_DIVIDE_BY_ZERO",
|
||||
"AE_AML_BAD_NAME",
|
||||
"AE_AML_NAME_NOT_FOUND",
|
||||
"AE_AML_INTERNAL",
|
||||
"AE_AML_INVALID_SPACE_ID",
|
||||
"AE_AML_STRING_LIMIT",
|
||||
"AE_AML_NO_RETURN_VALUE",
|
||||
"AE_AML_METHOD_LIMIT",
|
||||
"AE_AML_NOT_OWNER",
|
||||
"AE_AML_MUTEX_ORDER",
|
||||
"AE_AML_MUTEX_NOT_ACQUIRED",
|
||||
"AE_AML_INVALID_RESOURCE_TYPE",
|
||||
"AE_AML_INVALID_INDEX",
|
||||
"AE_AML_REGISTER_LIMIT",
|
||||
"AE_AML_NO_WHILE",
|
||||
"AE_AML_ALIGNMENT",
|
||||
"AE_AML_NO_RESOURCE_END_TAG",
|
||||
"AE_AML_BAD_RESOURCE_VALUE",
|
||||
"AE_AML_CIRCULAR_REFERENCE",
|
||||
"AE_AML_BAD_RESOURCE_LENGTH",
|
||||
"AE_AML_ILLEGAL_ADDRESS",
|
||||
"AE_AML_INFINITE_LOOP"
|
||||
EXCEP_TXT (NULL, NULL),
|
||||
EXCEP_TXT ("AE_AML_BAD_OPCODE", "Invalid AML opcode encountered"),
|
||||
EXCEP_TXT ("AE_AML_NO_OPERAND", "A required operand is missing"),
|
||||
EXCEP_TXT ("AE_AML_OPERAND_TYPE", "An operand of an incorrect type was encountered"),
|
||||
EXCEP_TXT ("AE_AML_OPERAND_VALUE", "The operand had an inappropriate or invalid value"),
|
||||
EXCEP_TXT ("AE_AML_UNINITIALIZED_LOCAL", "Method tried to use an uninitialized local variable"),
|
||||
EXCEP_TXT ("AE_AML_UNINITIALIZED_ARG", "Method tried to use an uninitialized argument"),
|
||||
EXCEP_TXT ("AE_AML_UNINITIALIZED_ELEMENT", "Method tried to use an empty package element"),
|
||||
EXCEP_TXT ("AE_AML_NUMERIC_OVERFLOW", "Overflow during BCD conversion or other"),
|
||||
EXCEP_TXT ("AE_AML_REGION_LIMIT", "Tried to access beyond the end of an Operation Region"),
|
||||
EXCEP_TXT ("AE_AML_BUFFER_LIMIT", "Tried to access beyond the end of a buffer"),
|
||||
EXCEP_TXT ("AE_AML_PACKAGE_LIMIT", "Tried to access beyond the end of a package"),
|
||||
EXCEP_TXT ("AE_AML_DIVIDE_BY_ZERO", "During execution of AML Divide operator"),
|
||||
EXCEP_TXT ("AE_AML_BAD_NAME", "An ACPI name contains invalid character(s)"),
|
||||
EXCEP_TXT ("AE_AML_NAME_NOT_FOUND", "Could not resolve a named reference"),
|
||||
EXCEP_TXT ("AE_AML_INTERNAL", "An internal error within the interprete"),
|
||||
EXCEP_TXT ("AE_AML_INVALID_SPACE_ID", "An Operation Region SpaceID is invalid"),
|
||||
EXCEP_TXT ("AE_AML_STRING_LIMIT", "String is longer than 200 characters"),
|
||||
EXCEP_TXT ("AE_AML_NO_RETURN_VALUE", "A method did not return a required value"),
|
||||
EXCEP_TXT ("AE_AML_METHOD_LIMIT", "A control method reached the maximum reentrancy limit of 255"),
|
||||
EXCEP_TXT ("AE_AML_NOT_OWNER", "A thread tried to release a mutex that it does not own"),
|
||||
EXCEP_TXT ("AE_AML_MUTEX_ORDER", "Mutex SyncLevel release mismatch"),
|
||||
EXCEP_TXT ("AE_AML_MUTEX_NOT_ACQUIRED", "Attempt to release a mutex that was not previously acquired"),
|
||||
EXCEP_TXT ("AE_AML_INVALID_RESOURCE_TYPE", "Invalid resource type in resource list"),
|
||||
EXCEP_TXT ("AE_AML_INVALID_INDEX", "Invalid Argx or Localx (x too large)"),
|
||||
EXCEP_TXT ("AE_AML_REGISTER_LIMIT", "Bank value or Index value beyond range of register"),
|
||||
EXCEP_TXT ("AE_AML_NO_WHILE", "Break or Continue without a While"),
|
||||
EXCEP_TXT ("AE_AML_ALIGNMENT", "Non-aligned memory transfer on platform that does not support this"),
|
||||
EXCEP_TXT ("AE_AML_NO_RESOURCE_END_TAG", "No End Tag in a resource list"),
|
||||
EXCEP_TXT ("AE_AML_BAD_RESOURCE_VALUE", "Invalid value of a resource element"),
|
||||
EXCEP_TXT ("AE_AML_CIRCULAR_REFERENCE", "Two references refer to each other"),
|
||||
EXCEP_TXT ("AE_AML_BAD_RESOURCE_LENGTH", "The length of a Resource Descriptor in the AML is incorrect"),
|
||||
EXCEP_TXT ("AE_AML_ILLEGAL_ADDRESS", "A memory, I/O, or PCI configuration address is invalid"),
|
||||
EXCEP_TXT ("AE_AML_INFINITE_LOOP", "An apparent infinite AML While loop, method was aborted")
|
||||
};
|
||||
|
||||
char const *AcpiGbl_ExceptionNames_Ctrl[] =
|
||||
static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Ctrl[] =
|
||||
{
|
||||
NULL,
|
||||
"AE_CTRL_RETURN_VALUE",
|
||||
"AE_CTRL_PENDING",
|
||||
"AE_CTRL_TERMINATE",
|
||||
"AE_CTRL_TRUE",
|
||||
"AE_CTRL_FALSE",
|
||||
"AE_CTRL_DEPTH",
|
||||
"AE_CTRL_END",
|
||||
"AE_CTRL_TRANSFER",
|
||||
"AE_CTRL_BREAK",
|
||||
"AE_CTRL_CONTINUE",
|
||||
"AE_CTRL_SKIP",
|
||||
"AE_CTRL_PARSE_CONTINUE",
|
||||
"AE_CTRL_PARSE_PENDING"
|
||||
EXCEP_TXT (NULL, NULL),
|
||||
EXCEP_TXT ("AE_CTRL_RETURN_VALUE", "A Method returned a value"),
|
||||
EXCEP_TXT ("AE_CTRL_PENDING", "Method is calling another method"),
|
||||
EXCEP_TXT ("AE_CTRL_TERMINATE", "Terminate the executing method"),
|
||||
EXCEP_TXT ("AE_CTRL_TRUE", "An If or While predicate result"),
|
||||
EXCEP_TXT ("AE_CTRL_FALSE", "An If or While predicate result"),
|
||||
EXCEP_TXT ("AE_CTRL_DEPTH", "Maximum search depth has been reached"),
|
||||
EXCEP_TXT ("AE_CTRL_END", "An If or While predicate is false"),
|
||||
EXCEP_TXT ("AE_CTRL_TRANSFER", "Transfer control to called method"),
|
||||
EXCEP_TXT ("AE_CTRL_BREAK", "A Break has been executed"),
|
||||
EXCEP_TXT ("AE_CTRL_CONTINUE", "A Continue has been executed"),
|
||||
EXCEP_TXT ("AE_CTRL_SKIP", "Not currently used"),
|
||||
EXCEP_TXT ("AE_CTRL_PARSE_CONTINUE", "Used to skip over bad opcodes"),
|
||||
EXCEP_TXT ("AE_CTRL_PARSE_PENDING", "Used to implement AML While loops")
|
||||
};
|
||||
|
||||
#endif /* EXCEPTION_TABLE */
|
||||
|
@ -420,10 +420,12 @@ ACPI_EXTERN UINT8 AcpiGbl_DbOutputFlags;
|
||||
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
|
||||
ACPI_EXTERN BOOLEAN ACPI_INIT_GLOBAL (AcpiGbl_IgnoreNoopOperator, FALSE);
|
||||
ACPI_EXTERN BOOLEAN ACPI_INIT_GLOBAL (AcpiGbl_IgnoreNoopOperator, FALSE);
|
||||
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_disasm;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_verbose;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_NumExternalMethods;
|
||||
ACPI_EXTERN UINT32 AcpiGbl_ResolvedExternalMethods;
|
||||
ACPI_EXTERN ACPI_EXTERNAL_LIST *AcpiGbl_ExternalList;
|
||||
ACPI_EXTERN ACPI_EXTERNAL_FILE *AcpiGbl_ExternalFileList;
|
||||
#endif
|
||||
|
@ -417,6 +417,7 @@ typedef struct acpi_predefined_data
|
||||
union acpi_operand_object *ParentPackage;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
UINT32 Flags;
|
||||
UINT32 ReturnBtype;
|
||||
UINT8 NodeFlags;
|
||||
|
||||
} ACPI_PREDEFINED_DATA;
|
||||
@ -427,6 +428,22 @@ typedef struct acpi_predefined_data
|
||||
#define ACPI_OBJECT_WRAPPED 2
|
||||
|
||||
|
||||
/* Return object auto-repair info */
|
||||
|
||||
typedef ACPI_STATUS (*ACPI_OBJECT_CONVERTER) (
|
||||
union acpi_operand_object *OriginalObject,
|
||||
union acpi_operand_object **ConvertedObject);
|
||||
|
||||
typedef struct acpi_simple_repair_info
|
||||
{
|
||||
char Name[ACPI_NAME_SIZE];
|
||||
UINT32 UnexpectedBtypes;
|
||||
UINT32 PackageIndex;
|
||||
ACPI_OBJECT_CONVERTER ObjectConverter;
|
||||
|
||||
} ACPI_SIMPLE_REPAIR_INFO;
|
||||
|
||||
|
||||
/*
|
||||
* Bitmapped return value types
|
||||
* Note: the actual data types must be contiguous, a loop in nspredef.c
|
||||
@ -1217,6 +1234,7 @@ typedef struct acpi_external_list
|
||||
UINT16 Length;
|
||||
UINT8 Type;
|
||||
UINT8 Flags;
|
||||
BOOLEAN Resolved;
|
||||
|
||||
} ACPI_EXTERNAL_LIST;
|
||||
|
||||
|
@ -203,6 +203,35 @@ AcpiNsCompareNames (
|
||||
char *Name2);
|
||||
|
||||
|
||||
/*
|
||||
* nsconvert - Dynamic object conversion routines
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToInteger (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToString (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToBuffer (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToUnicode (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToResource (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
|
||||
|
||||
/*
|
||||
* nsdump - Namespace dump/print utilities
|
||||
*/
|
||||
@ -377,7 +406,7 @@ AcpiNsGetAttachedData (
|
||||
* predefined methods/objects
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiNsRepairObject (
|
||||
AcpiNsSimpleRepair (
|
||||
ACPI_PREDEFINED_DATA *Data,
|
||||
UINT32 ExpectedBtypes,
|
||||
UINT32 PackageIndex,
|
||||
|
@ -409,6 +409,11 @@
|
||||
#define return_VALUE(Value) \
|
||||
ACPI_TRACE_EXIT (AcpiUtValueExit, UINT64, Value)
|
||||
|
||||
#define return_UINT32(Value) \
|
||||
ACPI_TRACE_EXIT (AcpiUtValueExit, UINT32, Value)
|
||||
|
||||
#define return_UINT8(Value) \
|
||||
ACPI_TRACE_EXIT (AcpiUtValueExit, UINT8, Value)
|
||||
|
||||
/* Conditional execution */
|
||||
|
||||
@ -457,8 +462,10 @@
|
||||
|
||||
#define return_VOID return
|
||||
#define return_ACPI_STATUS(s) return(s)
|
||||
#define return_VALUE(s) return(s)
|
||||
#define return_PTR(s) return(s)
|
||||
#define return_VALUE(s) return(s)
|
||||
#define return_UINT8(s) return(s)
|
||||
#define return_UINT32(s) return(s)
|
||||
|
||||
#endif /* ACPI_DEBUG_OUTPUT */
|
||||
|
||||
|
@ -47,7 +47,7 @@
|
||||
|
||||
/* Current ACPICA subsystem version in YYYYMMDD format */
|
||||
|
||||
#define ACPI_CA_VERSION 0x20130117
|
||||
#define ACPI_CA_VERSION 0x20130214
|
||||
|
||||
#include <contrib/dev/acpica/include/acconfig.h>
|
||||
#include <contrib/dev/acpica/include/actypes.h>
|
||||
|
@ -74,11 +74,13 @@
|
||||
#define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */
|
||||
#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
|
||||
#define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */
|
||||
#define ACPI_SIG_MTMR "MTMR" /* MID Timer table */
|
||||
#define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */
|
||||
#define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */
|
||||
#define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */
|
||||
#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */
|
||||
#define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */
|
||||
#define ACPI_SIG_VRTC "VRTC" /* Virtual Real Time Clock 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 */
|
||||
@ -981,6 +983,34 @@ typedef struct acpi_table_mchi
|
||||
} ACPI_TABLE_MCHI;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* MTMR - MID Timer Table
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "Simple Firmware Interface Specification",
|
||||
* Draft 0.8.2, Oct 19, 2010
|
||||
* NOTE: The ACPI MTMR is equivalent to the SFI MTMR table.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_mtmr
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
|
||||
} ACPI_TABLE_MTMR;
|
||||
|
||||
/* MTMR entry */
|
||||
|
||||
typedef struct acpi_mtmr_entry
|
||||
{
|
||||
ACPI_GENERIC_ADDRESS PhysicalAddress;
|
||||
UINT32 Frequency;
|
||||
UINT32 Irq;
|
||||
|
||||
} ACPI_MTMR_ENTRY;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* SLIC - Software Licensing Description Table
|
||||
@ -1180,6 +1210,33 @@ typedef struct acpi_table_uefi
|
||||
} ACPI_TABLE_UEFI;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* VRTC - Virtual Real Time Clock Table
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "Simple Firmware Interface Specification",
|
||||
* Draft 0.8.2, Oct 19, 2010
|
||||
* NOTE: The ACPI VRTC is equivalent to The SFI MRTC table.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_vrtc
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
|
||||
} ACPI_TABLE_VRTC;
|
||||
|
||||
/* VRTC entry */
|
||||
|
||||
typedef struct acpi_vrtc_entry
|
||||
{
|
||||
ACPI_GENERIC_ADDRESS PhysicalAddress;
|
||||
UINT32 Irq;
|
||||
|
||||
} ACPI_VRTC_ENTRY;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* WAET - Windows ACPI Emulated devices Table
|
||||
|
@ -195,7 +195,7 @@ typedef struct acpi_fpdt_header
|
||||
enum AcpiFpdtType
|
||||
{
|
||||
ACPI_FPDT_TYPE_BOOT = 0,
|
||||
ACPI_FPDT_TYPE_S3PERF = 1,
|
||||
ACPI_FPDT_TYPE_S3PERF = 1
|
||||
};
|
||||
|
||||
|
||||
@ -257,7 +257,7 @@ typedef struct acpi_s3pt_header
|
||||
enum AcpiS3ptType
|
||||
{
|
||||
ACPI_S3PT_TYPE_RESUME = 0,
|
||||
ACPI_S3PT_TYPE_SUSPEND = 1,
|
||||
ACPI_S3PT_TYPE_SUSPEND = 1
|
||||
};
|
||||
|
||||
typedef struct acpi_s3pt_resume
|
||||
@ -599,28 +599,67 @@ typedef struct acpi_rasf_shared_memory
|
||||
UINT32 Signature;
|
||||
UINT16 Command;
|
||||
UINT16 Status;
|
||||
UINT64 RequestedAddress;
|
||||
UINT64 RequestedLength;
|
||||
UINT64 ActualAddress;
|
||||
UINT64 ActualLength;
|
||||
UINT16 Flags;
|
||||
UINT8 Speed;
|
||||
UINT16 Version;
|
||||
UINT8 Capabilities[16];
|
||||
UINT8 SetCapabilities[16];
|
||||
UINT16 NumParameterBlocks;
|
||||
UINT32 SetCapabilitiesStatus;
|
||||
|
||||
} ACPI_RASF_SHARED_MEMORY;
|
||||
|
||||
/* RASF Parameter Block Structure Header */
|
||||
|
||||
typedef struct acpi_rasf_parameter_block
|
||||
{
|
||||
UINT16 Type;
|
||||
UINT16 Version;
|
||||
UINT16 Length;
|
||||
|
||||
} ACPI_RASF_PARAMETER_BLOCK;
|
||||
|
||||
/* RASF Parameter Block Structure for PATROL_SCRUB */
|
||||
|
||||
typedef struct acpi_rasf_patrol_scrub_parameter
|
||||
{
|
||||
ACPI_RASF_PARAMETER_BLOCK Header;
|
||||
UINT16 PatrolScrubCommand;
|
||||
UINT64 RequestedAddressRange[2];
|
||||
UINT64 ActualAddressRange[2];
|
||||
UINT16 Flags;
|
||||
UINT8 RequestedSpeed;
|
||||
|
||||
} ACPI_RASF_PATROL_SCRUB_PARAMETER;
|
||||
|
||||
/* Masks for Flags and Speed fields above */
|
||||
|
||||
#define ACPI_RASF_SCRUBBER_RUNNING 1
|
||||
#define ACPI_RASF_SPEED (7<<1)
|
||||
#define ACPI_RASF_SPEED_SLOW (0<<1)
|
||||
#define ACPI_RASF_SPEED_MEDIUM (4<<1)
|
||||
#define ACPI_RASF_SPEED_FAST (7<<1)
|
||||
|
||||
/* Channel Commands */
|
||||
|
||||
enum AcpiRasfCommands
|
||||
{
|
||||
ACPI_RASF_GET_RAS_CAPABILITIES = 1,
|
||||
ACPI_RASF_GET_PATROL_PARAMETERS = 2,
|
||||
ACPI_RASF_START_PATROL_SCRUBBER = 3,
|
||||
ACPI_RASF_STOP_PATROL_SCRUBBER = 4
|
||||
ACPI_RASF_EXECUTE_RASF_COMMAND = 1
|
||||
};
|
||||
|
||||
/* Platform RAS Capabilities */
|
||||
|
||||
enum AcpiRasfCapabiliities
|
||||
{
|
||||
ACPI_HW_PATROL_SCRUB_SUPPORTED = 0,
|
||||
ACPI_SW_PATROL_SCRUB_EXPOSED = 1
|
||||
};
|
||||
|
||||
/* Patrol Scrub Commands */
|
||||
|
||||
enum AcpiRasfPatrolScrubCommands
|
||||
{
|
||||
ACPI_RASF_GET_PATROL_PARAMETERS = 1,
|
||||
ACPI_RASF_START_PATROL_SCRUBBER = 2,
|
||||
ACPI_RASF_STOP_PATROL_SCRUBBER = 3
|
||||
};
|
||||
|
||||
/* Channel Command flags */
|
||||
|
@ -706,10 +706,11 @@ AcpiUtShortDivide (
|
||||
UINT64 *OutQuotient,
|
||||
UINT32 *OutRemainder);
|
||||
|
||||
|
||||
/*
|
||||
* utmisc
|
||||
*/
|
||||
const char *
|
||||
const ACPI_EXCEPTION_INFO *
|
||||
AcpiUtValidateException (
|
||||
ACPI_STATUS Status);
|
||||
|
||||
|
@ -32,33 +32,35 @@
|
||||
KMOD= acpi
|
||||
|
||||
# ACPI CA sources
|
||||
SRCS+= dbcmds.c dbdisply.c dbexec.c dbfileio.c dbhistry.c dbinput.c dbmethod.c
|
||||
SRCS+= dbnames.c dbstats.c dbutils.c dbxface.c
|
||||
SRCS+= dbcmds.c dbconvert.c dbdisply.c dbexec.c dbfileio.c dbhistry.c
|
||||
SRCS+= dbinput.c dbmethod.c dbnames.c dbstats.c dbutils.c dbxface.c
|
||||
SRCS+= dmbuffer.c dmdeferred.c dmnames.c dmopcode.c dmobject.c dmresrc.c
|
||||
SRCS+= dmresrcl.c dmresrcl2.c dmresrcs.c dmutils.c dmwalk.c
|
||||
SRCS+= dsargs.c dscontrol.c dsfield.c dsinit.c dsmethod.c dsmthdat.c
|
||||
SRCS+= dsobject.c dsopcode.c dsutils.c dswexec.c dswload.c dswload2.c
|
||||
SRCS+= dswscope.c dswstate.c
|
||||
SRCS+= evevent.c evglock.c evgpe.c evgpeblk.c evgpeinit.c evgpeutil.c evmisc.c
|
||||
SRCS+= evregion.c evrgnini.c evsci.c evxface.c evxfevnt.c evxfgpe.c evxfregn.c
|
||||
SRCS+= evevent.c evglock.c evgpe.c evgpeblk.c evgpeinit.c evgpeutil.c
|
||||
SRCS+= evhandler.c evmisc.c evregion.c evrgnini.c evsci.c evxface.c
|
||||
SRCS+= evxfevnt.c evxfgpe.c evxfregn.c
|
||||
SRCS+= exconfig.c exconvrt.c excreate.c exdebug.c exdump.c exfield.c
|
||||
SRCS+= exfldio.c exmisc.c exmutex.c exnames.c exoparg1.c exoparg2.c
|
||||
SRCS+= exoparg3.c exoparg6.c exprep.c exregion.c exresnte.c exresolv.c
|
||||
SRCS+= exresop.c exstore.c exstoren.c exstorob.c exsystem.c exutils.c
|
||||
SRCS+= hwacpi.c hwesleep.c hwgpe.c hwpci.c hwregs.c hwsleep.c hwtimer.c
|
||||
SRCS+= hwvalid.c hwxface.c hwxfsleep.c
|
||||
SRCS+= nsaccess.c nsalloc.c nsdump.c nseval.c nsinit.c nsload.c nsnames.c
|
||||
SRCS+= nsobject.c nsparse.c nspredef.c nsrepair.c nsrepair2.c nssearch.c
|
||||
SRCS+= nsutils.c nswalk.c nsxfeval.c nsxfname.c nsxfobj.c
|
||||
SRCS+= psargs.c psloop.c psopcode.c psparse.c psscope.c pstree.c psutils.c
|
||||
SRCS+= pswalk.c psxface.c
|
||||
SRCS+= rsaddr.c rscalc.c rscreate.c rsdump.c rsinfo.c rsio.c rsirq.c rslist.c
|
||||
SRCS+= rsmemory.c rsmisc.c rsserial.c rsutils.c rsxface.c
|
||||
SRCS+= nsaccess.c nsalloc.c nsconvert.c nsdump.c nseval.c nsinit.c nsload.c
|
||||
SRCS+= nsnames.c nsobject.c nsparse.c nspredef.c nsprepkg.c nsrepair.c
|
||||
SRCS+= nsrepair2.c nssearch.c nsutils.c nswalk.c nsxfeval.c nsxfname.c
|
||||
SRCS+= nsxfobj.c
|
||||
SRCS+= psargs.c psloop.c psobject.c psopcode.c psopinfo.c psparse.c
|
||||
SRCS+= psscope.c pstree.c psutils.c pswalk.c psxface.c
|
||||
SRCS+= rsaddr.c rscalc.c rscreate.c rsdump.c rsdumpinfo.c rsinfo.c rsio.c
|
||||
SRCS+= rsirq.c rslist.c rsmemory.c rsmisc.c rsserial.c rsutils.c rsxface.c
|
||||
SRCS+= tbfadt.c tbfind.c tbinstal.c tbutils.c tbxface.c tbxfload.c tbxfroot.c
|
||||
SRCS+= utaddress.c utalloc.c utcache.c utcopy.c utdebug.c utdecode.c
|
||||
SRCS+= utdelete.c uteval.c utexcep.c utglobal.c utids.c utinit.c utlock.c
|
||||
SRCS+= utmath.c utmisc.c utmutex.c utobject.c utosi.c utresrc.c utstate.c
|
||||
SRCS+= utxface.c utxferror.c utxfinit.c
|
||||
SRCS+= utmath.c utmisc.c utmutex.c utobject.c utosi.c utownerid.c utresrc.c
|
||||
SRCS+= utstate.c utstring.c utxface.c utxferror.c utxfinit.c
|
||||
#SRCS+= utxfmutex.c
|
||||
|
||||
# OSPM layer and core hardware drivers
|
||||
|
@ -35,10 +35,10 @@ SRCS+= hwacpi.c hwesleep.c hwgpe.c hwpci.c hwregs.c hwsleep.c \
|
||||
hwvalid.c hwxface.c hwxfsleep.c
|
||||
|
||||
# components/namespace
|
||||
SRCS+= nsaccess.c nsalloc.c nsdump.c nseval.c nsinit.c \
|
||||
nsload.c nsnames.c nsobject.c nsparse.c nspredef.c \
|
||||
nsprepkg.c nsrepair.c nsrepair2.c nssearch.c nsutils.c \
|
||||
nswalk.c nsxfeval.c nsxfname.c nsxfobj.c
|
||||
SRCS+= nsaccess.c nsalloc.c nsconvert.c nsdump.c nseval.c \
|
||||
nsinit.c nsload.c nsnames.c nsobject.c nsparse.c \
|
||||
nspredef.c nsprepkg.c nsrepair.c nsrepair2.c nssearch.c \
|
||||
nsutils.c nswalk.c nsxfeval.c nsxfname.c nsxfobj.c
|
||||
|
||||
# components/parser
|
||||
SRCS+= psargs.c psloop.c psobject.c psopcode.c psopinfo.c \
|
||||
|
@ -13,16 +13,16 @@ SRCS+= aslanalyze.c aslbtypes.c aslcodegen.c aslcompile.c \
|
||||
aslerror.c aslfileio.c aslfiles.c aslfold.c aslhex.c \
|
||||
asllength.c asllisting.c aslload.c asllookup.c \
|
||||
aslmain.c aslmap.c aslmethod.c aslnamesp.c aslopcodes.c \
|
||||
asloperands.c aslopt.c aslpredef.c aslresource.c \
|
||||
aslrestype1.c aslrestype1i.c aslrestype2.c \
|
||||
aslrestype2d.c aslrestype2e.c aslrestype2q.c \
|
||||
aslrestype2s.c aslrestype2w.c aslstartup.c aslstubs.c \
|
||||
asltransform.c asltree.c aslutils.c asluuid.c \
|
||||
aslwalks.c aslxref.c dtcompile.c dtexpress.c dtfield.c \
|
||||
dtio.c dtparser.y.h dtparserlex.c dtparserparse.c \
|
||||
dtsubtable.c dttable.c dttemplate.c dtutils.c \
|
||||
prexpress.c prmacros.c prparser.y.h prparserlex.c \
|
||||
prparserparse.c prscan.c prutils.c
|
||||
asloperands.c aslopt.c aslpredef.c aslprepkg.c \
|
||||
aslresource.c aslrestype1.c aslrestype1i.c \
|
||||
aslrestype2.c aslrestype2d.c aslrestype2e.c \
|
||||
aslrestype2q.c aslrestype2s.c aslrestype2w.c \
|
||||
aslstartup.c aslstubs.c asltransform.c asltree.c \
|
||||
aslutils.c asluuid.c aslwalks.c aslxref.c dtcompile.c \
|
||||
dtexpress.c dtfield.c dtio.c dtparser.y.h dtparserlex.c \
|
||||
dtparserparse.c dtsubtable.c dttable.c dttemplate.c \
|
||||
dtutils.c prexpress.c prmacros.c prparser.y.h \
|
||||
prparserlex.c prparserparse.c prscan.c prutils.c
|
||||
|
||||
# components/debugger
|
||||
SRCS+= dbfileio.c
|
||||
|
Loading…
x
Reference in New Issue
Block a user