MFV: r196804
Import ACPICA 20090903
This commit is contained in:
commit
d6dd1baec0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=197104
@ -21,7 +21,7 @@ fulldirs="common compiler debugger disassembler dispatcher events \
|
||||
# files to remove
|
||||
stripdirs="acpisrc acpixtract examples generate os_specific"
|
||||
stripfiles="Makefile README acintel.h aclinux.h acmsvc.h acnetbsd.h \
|
||||
acos2.h accygwin.h acefi.h actbl2.h acwin.h acwin64.h aeexec.c \
|
||||
acos2.h accygwin.h acefi.h acwin.h acwin64.h aeexec.c \
|
||||
aehandlers.c aemain.c aetables.c osunixdir.c readme.txt \
|
||||
utclib.c"
|
||||
|
||||
@ -31,8 +31,8 @@ src_headers="acapps.h accommon.h acconfig.h acdebug.h acdisasm.h \
|
||||
aclocal.h acmacros.h acnames.h acnamesp.h acobject.h acopcode.h \
|
||||
acoutput.h acparser.h acpi.h acpiosxf.h acpixf.h acpredef.h \
|
||||
acresrc.h acrestyp.h acstruct.h actables.h actbl.h actbl1.h \
|
||||
actypes.h acutils.h amlcode.h amlresrc.h platform/acenv.h \
|
||||
platform/acfreebsd.h platform/acgcc.h"
|
||||
actbl2.h actypes.h acutils.h amlcode.h amlresrc.h \
|
||||
platform/acenv.h platform/acfreebsd.h platform/acgcc.h"
|
||||
comp_headers="aslcompiler.h asldefine.h aslglobal.h asltypes.h"
|
||||
platform_headers="acfreebsd.h acgcc.h"
|
||||
|
||||
|
@ -1,3 +1,226 @@
|
||||
----------------------------------------
|
||||
03 September 2009. Summary of changes for version 20090903:
|
||||
|
||||
This release is available at www.acpica.org/downloads
|
||||
|
||||
1) ACPI CA Core Subsystem:
|
||||
|
||||
For Windows Vista compatibility, added the automatic execution of an _INI
|
||||
method located at the namespace root (\_INI). This method is executed at
|
||||
table load time. This support is in addition to the automatic execution of
|
||||
\_SB._INI. Lin Ming.
|
||||
|
||||
Fixed a possible memory leak in the interpreter for AML package objects if
|
||||
the package initializer list is longer than the defined size of the package.
|
||||
This apparently can only happen if the BIOS changes the package size on the
|
||||
fly (seen in a _PSS object), as ASL compilers do not allow this. The
|
||||
interpreter will truncate the package to the defined size (and issue an error
|
||||
message), but previously could leave the extra objects undeleted if they were
|
||||
pre-created during the argument processing (such is the case if the package
|
||||
consists of a number of sub-packages as in the _PSS.) ACPICA BZ 805.
|
||||
|
||||
Fixed a problem seen when a Buffer or String is stored to itself via ASL.
|
||||
This has been reported in the field. Previously, ACPICA would zero out the
|
||||
buffer/string. Now, the operation is treated as a noop. Provides Windows
|
||||
compatibility. ACPICA BZ 803. Lin Ming.
|
||||
|
||||
Removed an extraneous error message for ASL constructs of the form
|
||||
Store(LocalX,LocalX) when LocalX is uninitialized. These curious statements
|
||||
are seen in many BIOSs and are once again treated as NOOPs and no error is
|
||||
emitted when they are encountered. ACPICA BZ 785.
|
||||
|
||||
Fixed an extraneous warning message if a _DSM reserved method returns a
|
||||
Package object. _DSM can return any type of object, so validation on the
|
||||
return type cannot be performed. ACPICA BZ 802.
|
||||
|
||||
Example Code and Data Size: These are the sizes for the OS-independent
|
||||
acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The
|
||||
debug version of the code includes the debug output trace mechanism and has a
|
||||
much larger code and data size.
|
||||
|
||||
Previous Release:
|
||||
Non-Debug Version: 85.5K Code, 18.0K Data, 103.5K Total
|
||||
Debug Version: 161.6K Code, 50.9K Data, 212.5K Total
|
||||
Current Release:
|
||||
Non-Debug Version: 85.6K Code, 18.0K Data, 103.6K Total
|
||||
Debug Version: 161.7K Code, 50.9K Data, 212.6K Total
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
iASL: Fixed a problem with the use of the Alias operator and Resource
|
||||
Templates. The correct alias is now constructed and no error is emitted.
|
||||
ACPICA BZ 738.
|
||||
|
||||
iASL: Implemented the -I option to specify additional search directories for
|
||||
include files. Allows multiple additional search paths for include files.
|
||||
Directories are searched in the order specified on the command line (after
|
||||
the local directory is searched.) ACPICA BZ 800.
|
||||
|
||||
iASL: Fixed a problem where the full pathname for include files was not
|
||||
emitted for warnings/errors. This caused the IDE support to not work
|
||||
properly. ACPICA BZ 765.
|
||||
|
||||
iASL: Implemented the -@ option to specify a Windows-style response file
|
||||
containing additional command line options. ACPICA BZ 801.
|
||||
|
||||
AcpiExec: Added support to load multiple AML files simultaneously (such as a
|
||||
DSDT and multiple SSDTs). Also added support for wildcards within the AML
|
||||
pathname. These features allow all machine tables to be easily loaded and
|
||||
debugged together. ACPICA BZ 804.
|
||||
|
||||
Disassembler: Added missing support for disassembly of HEST table Error Bank
|
||||
subtables.
|
||||
|
||||
----------------------------------------
|
||||
30 July 2009. Summary of changes for version 20090730:
|
||||
|
||||
This release is available at www.acpica.org/downloads
|
||||
|
||||
The ACPI 4.0 implementation for ACPICA is complete with this release.
|
||||
|
||||
1) ACPI CA Core Subsystem:
|
||||
|
||||
ACPI 4.0: Added header file support for all new and changed ACPI tables.
|
||||
Completely new tables are: IBFT, IVRS, MSCT, and WAET. Tables that are new
|
||||
for ACPI 4.0, but have previously been supported in ACPICA are: CPEP, BERT,
|
||||
EINJ, ERST, and HEST. Other newly supported tables are: UEFI and WDAT. There
|
||||
have been some ACPI 4.0 changes to other existing tables. Split the large
|
||||
actbl1.h header into the existing actbl2.h header. ACPICA BZ 774.
|
||||
|
||||
ACPI 4.0: Implemented predefined name validation for all new names. There are
|
||||
31 new names in ACPI 4.0. The predefined validation module was split into two
|
||||
files. The new file is namespace/nsrepair.c. ACPICA BZ 770.
|
||||
|
||||
Implemented support for so-called "module-level executable code". This is
|
||||
executable AML code that exists outside of any control method and is intended
|
||||
to be executed at table load time. Although illegal since ACPI 2.0, this type
|
||||
of code still exists and is apparently still being created. Blocks of this
|
||||
code are now detected and executed as intended. Currently, the code blocks
|
||||
must exist under either an If, Else, or While construct; these are the
|
||||
typical cases seen in the field. ACPICA BZ 762. Lin Ming.
|
||||
|
||||
Implemented an automatic dynamic repair for predefined names that return
|
||||
nested Package objects. This applies to predefined names that are defined to
|
||||
return a variable-length Package of sub-packages. If the number of sub-
|
||||
packages is one, BIOS code is occasionally seen that creates a simple single
|
||||
package with no sub-packages. This code attempts to fix the problem by
|
||||
wrapping a new package object around the existing package. These methods can
|
||||
be repaired: _ALR, _CSD, _HPX, _MLS, _PRT, _PSS, _TRT, and _TSS. ACPICA BZ
|
||||
790.
|
||||
|
||||
Fixed a regression introduced in 20090625 for the AcpiGetDevices interface.
|
||||
The _HID/_CID matching was broken and no longer matched IDs correctly. ACPICA
|
||||
BZ 793.
|
||||
|
||||
Fixed a problem with AcpiReset where the reset would silently fail if the
|
||||
register was one of the protected I/O ports. AcpiReset now bypasses the port
|
||||
validation mechanism. This may eventually be driven into the AcpiRead/Write
|
||||
interfaces.
|
||||
|
||||
Fixed a regression related to the recent update of the AcpiRead/Write
|
||||
interfaces. A sleep/suspend could fail if the optional PM2 Control register
|
||||
does not exist during an attempt to write the Bus Master Arbitration bit.
|
||||
(However, some hosts already delete the code that writes this bit, and the
|
||||
code may in fact be obsolete at this date.) ACPICA BZ 799.
|
||||
|
||||
Fixed a problem where AcpiTerminate could fault if inadvertently called twice
|
||||
in succession. ACPICA BZ 795.
|
||||
|
||||
Example Code and Data Size: These are the sizes for the OS-independent
|
||||
acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The
|
||||
debug version of the code includes the debug output trace mechanism and has a
|
||||
much larger code and data size.
|
||||
|
||||
Previous Release:
|
||||
Non-Debug Version: 84.7K Code, 17.8K Data, 102.5K Total
|
||||
Debug Version: 160.5K Code, 50.6K Data, 211.1K Total
|
||||
Current Release:
|
||||
Non-Debug Version: 85.5K Code, 18.0K Data, 103.5K Total
|
||||
Debug Version: 161.6K Code, 50.9K Data, 212.5K Total
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
ACPI 4.0: Implemented disassembler support for all new ACPI tables and
|
||||
changes to existing tables. ACPICA BZ 775.
|
||||
|
||||
----------------------------------------
|
||||
25 June 2009. Summary of changes for version 20090625:
|
||||
|
||||
This release is available at www.acpica.org/downloads
|
||||
|
||||
The ACPI 4.0 Specification was released on June 16 and is available at
|
||||
www.acpi.info. ACPICA implementation of ACPI 4.0 is underway and will
|
||||
continue for the next few releases.
|
||||
|
||||
1) ACPI CA Core Subsystem:
|
||||
|
||||
ACPI 4.0: Implemented interpreter support for the IPMI operation region
|
||||
address space. Includes support for bi-directional data buffers and an IPMI
|
||||
address space handler (to be installed by an IPMI device driver.) ACPICA BZ
|
||||
773. Lin Ming.
|
||||
|
||||
ACPI 4.0: Added changes for existing ACPI tables - FACS and SRAT. Includes
|
||||
support in both the header files and the disassembler.
|
||||
|
||||
Completed a major update for the AcpiGetObjectInfo external interface.
|
||||
Changes include:
|
||||
- Support for variable, unlimited length HID, UID, and CID strings.
|
||||
- Support Processor objects the same as Devices (HID,UID,CID,ADR,STA, etc.)
|
||||
- Call the _SxW power methods on behalf of a device object.
|
||||
- Determine if a device is a PCI root bridge.
|
||||
- Change the ACPI_BUFFER parameter to ACPI_DEVICE_INFO.
|
||||
These changes will require an update to all callers of this interface. See
|
||||
the updated ACPICA Programmer Reference for details. One new source file has
|
||||
been added - utilities/utids.c. ACPICA BZ 368, 780.
|
||||
|
||||
Updated the AcpiRead and AcpiWrite external interfaces to support 64-bit
|
||||
transfers. The Value parameter has been extended from 32 bits to 64 bits in
|
||||
order to support new ACPI 4.0 tables. These changes will require an update to
|
||||
all callers of these interfaces. See the ACPICA Programmer Reference for
|
||||
details. ACPICA BZ 768.
|
||||
|
||||
Fixed several problems with AcpiAttachData. The handler was not invoked when
|
||||
the host node was deleted. The data sub-object was not automatically deleted
|
||||
when the host node was deleted. The interface to the handler had an unused
|
||||
parameter, this was removed. ACPICA BZ 778.
|
||||
|
||||
Enhanced the function that dumps ACPI table headers. All non-printable
|
||||
characters in the string fields are now replaced with '?' (Signature, OemId,
|
||||
OemTableId, and CompilerId.) ACPI tables with non-printable characters in
|
||||
these fields are occasionally seen in the field. ACPICA BZ 788.
|
||||
|
||||
Fixed a problem with predefined method repair code where the code that
|
||||
attempts to repair/convert an object of incorrect type is only executed on
|
||||
the first time the predefined method is called. The mechanism that disables
|
||||
warnings on subsequent calls was interfering with the repair mechanism.
|
||||
ACPICA BZ 781.
|
||||
|
||||
Fixed a possible memory leak in the predefined validation/repair code when a
|
||||
buffer is automatically converted to an expected string object.
|
||||
|
||||
Removed obsolete 16-bit files from the distribution and from the current git
|
||||
tree head. ACPICA BZ 776.
|
||||
|
||||
Example Code and Data Size: These are the sizes for the OS-independent
|
||||
acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The
|
||||
debug version of the code includes the debug output trace mechanism and has a
|
||||
much larger code and data size.
|
||||
|
||||
Previous Release:
|
||||
Non-Debug Version: 83.4K Code, 17.5K Data, 100.9K Total
|
||||
Debug Version: 158.9K Code, 50.0K Data, 208.9K Total
|
||||
Current Release:
|
||||
Non-Debug Version: 84.7K Code, 17.8K Data, 102.5K Total
|
||||
Debug Version: 160.5K Code, 50.6K Data, 211.1K Total
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
ACPI 4.0: iASL and Disassembler - implemented support for the new IPMI
|
||||
operation region keyword. ACPICA BZ 771, 772. Lin Ming.
|
||||
|
||||
ACPI 4.0: iASL - implemented compile-time validation support for all new
|
||||
predefined names and control methods (31 total). ACPICA BZ 769.
|
||||
|
||||
----------------------------------------
|
||||
21 May 2009. Summary of changes for version 20090521:
|
||||
|
||||
|
@ -387,7 +387,7 @@ static ACPI_RESOURCE_TAG *AcpiGbl_ResourceTags [] =
|
||||
|
||||
static UINT32 AcpiGbl_NextResourceId = 0;
|
||||
static UINT8 AcpiGbl_NextPrefix = 0;
|
||||
static UINT8 AcpiGbl_Prefix[ACPI_NUM_RES_PREFIX] =
|
||||
static char AcpiGbl_Prefix[ACPI_NUM_RES_PREFIX] =
|
||||
{'Y','Z','J','K','X'};
|
||||
|
||||
|
||||
|
@ -132,6 +132,7 @@ AcpiDmGetTableData (
|
||||
static void
|
||||
AcpiDmCheckAscii (
|
||||
UINT8 *Target,
|
||||
char *RepairedName,
|
||||
UINT32 Count);
|
||||
|
||||
UINT8
|
||||
@ -156,17 +157,18 @@ static const char *AcpiDmDmarSubnames[] =
|
||||
"Hardware Unit Definition",
|
||||
"Reserved Memory Region",
|
||||
"Root Port ATS Capability",
|
||||
"Remapping Hardware Static Affinity",
|
||||
"Unknown SubTable Type" /* Reserved */
|
||||
};
|
||||
|
||||
static const char *AcpiDmHestSubnames[] =
|
||||
{
|
||||
"XPF Machine Check Exception",
|
||||
"XPF Corrected Machine Check",
|
||||
"NOT USED???",
|
||||
"XPF Non-Maskable Interrupt",
|
||||
"IPF Corrected Machine Check",
|
||||
"IPF Corrected Platform Error",
|
||||
"IA-32 Machine Check Exception",
|
||||
"IA-32 Corrected Machine Check",
|
||||
"IA-32 Non-Maskable Interrupt",
|
||||
"Unknown SubTable Type", /* 3 - Reserved */
|
||||
"Unknown SubTable Type", /* 4 - Reserved */
|
||||
"Unknown SubTable Type", /* 5 - Reserved */
|
||||
"PCI Express Root Port AER",
|
||||
"PCI Express AER (AER Endpoint)",
|
||||
"PCI Express/PCI-X Bridge AER",
|
||||
@ -208,6 +210,14 @@ static const char *AcpiDmSratSubnames[] =
|
||||
"Unknown SubTable Type" /* Reserved */
|
||||
};
|
||||
|
||||
static const char *AcpiDmIvrsSubnames[] =
|
||||
{
|
||||
"Hardware Definition Block",
|
||||
"Memory Definition Block",
|
||||
"Unknown SubTable Type" /* Reserved */
|
||||
};
|
||||
|
||||
|
||||
|
||||
#define ACPI_FADT_PM_RESERVED 8
|
||||
|
||||
@ -224,11 +234,12 @@ static const char *AcpiDmFadtProfiles[] =
|
||||
"Unknown Profile Type"
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* ACPI Table Data, indexed by signature.
|
||||
*
|
||||
* Each entry contains: Signature, Table Info, Handler, Description
|
||||
*
|
||||
* Simple tables have only a TableInfo structure, complex tables have a handler.
|
||||
* This table must be NULL terminated. RSDP and FACS are special-cased
|
||||
* elsewhere.
|
||||
@ -249,8 +260,10 @@ static ACPI_DMTABLE_DATA AcpiDmTableData[] =
|
||||
{ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, "Fixed ACPI Description Table"},
|
||||
{ACPI_SIG_HEST, NULL, AcpiDmDumpHest, "Hardware Error Source Table"},
|
||||
{ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, "High Precision Event Timer table"},
|
||||
{ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, "I/O Virtualization Reporting Structure"},
|
||||
{ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, "Multiple APIC Description Table"},
|
||||
{ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, "Memory Mapped Configuration table"},
|
||||
{ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, "Maximum System Characteristics Table"},
|
||||
{ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, "Root System Description Table"},
|
||||
{ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, "Smart Battery Specification Table"},
|
||||
{ACPI_SIG_SLIC, AcpiDmTableInfoSlic, NULL, "Software Licensing Description Table"},
|
||||
@ -259,6 +272,9 @@ static ACPI_DMTABLE_DATA AcpiDmTableData[] =
|
||||
{ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, "Server Platform Management Interface table"},
|
||||
{ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, "System Resource Affinity Table"},
|
||||
{ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, "Trusted Computing Platform Alliance table"},
|
||||
{ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, "UEFI Boot Optimization Table"},
|
||||
{ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, "Windows ACPI Emulated Devices Table"},
|
||||
{ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, "Watchdog Action Table"},
|
||||
{ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, "Watchdog Resource Table"},
|
||||
{ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, "Extended System Description Table"},
|
||||
{NULL, NULL, NULL, NULL}
|
||||
@ -511,7 +527,9 @@ AcpiDmDumpTable (
|
||||
UINT8 Temp8;
|
||||
UINT16 Temp16;
|
||||
ACPI_DMTABLE_DATA *TableData;
|
||||
const char *Name;
|
||||
BOOLEAN LastOutputBlankLine = FALSE;
|
||||
char RepairedName[8];
|
||||
|
||||
|
||||
if (!Info)
|
||||
@ -547,6 +565,7 @@ AcpiDmDumpTable (
|
||||
case ACPI_DMT_UINT8:
|
||||
case ACPI_DMT_CHKSUM:
|
||||
case ACPI_DMT_SPACEID:
|
||||
case ACPI_DMT_IVRS:
|
||||
case ACPI_DMT_MADT:
|
||||
case ACPI_DMT_SRAT:
|
||||
case ACPI_DMT_ASF:
|
||||
@ -577,6 +596,9 @@ AcpiDmDumpTable (
|
||||
case ACPI_DMT_NAME8:
|
||||
ByteLength = 8;
|
||||
break;
|
||||
case ACPI_DMT_BUF16:
|
||||
ByteLength = 16;
|
||||
break;
|
||||
case ACPI_DMT_STRING:
|
||||
ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1;
|
||||
break;
|
||||
@ -677,17 +699,28 @@ AcpiDmDumpTable (
|
||||
ACPI_FORMAT_UINT64 (ACPI_GET64 (Target)));
|
||||
break;
|
||||
|
||||
case ACPI_DMT_BUF16:
|
||||
|
||||
/* Buffer of length 16 */
|
||||
|
||||
for (Temp8 = 0; Temp8 < 16; Temp8++)
|
||||
{
|
||||
AcpiOsPrintf ("%2.2X,", Target[Temp8]);
|
||||
}
|
||||
AcpiOsPrintf ("\n");
|
||||
break;
|
||||
|
||||
case ACPI_DMT_STRING:
|
||||
|
||||
AcpiOsPrintf ("%s\n", ACPI_CAST_PTR (char, Target));
|
||||
AcpiOsPrintf ("\"%s\"\n", ACPI_CAST_PTR (char, Target));
|
||||
break;
|
||||
|
||||
/* Fixed length ASCII name fields */
|
||||
|
||||
case ACPI_DMT_SIG:
|
||||
|
||||
AcpiDmCheckAscii (Target, 4);
|
||||
AcpiOsPrintf ("\"%4.4s\" ", Target);
|
||||
AcpiDmCheckAscii (Target, RepairedName, 4);
|
||||
AcpiOsPrintf ("\"%.4s\" ", RepairedName);
|
||||
TableData = AcpiDmGetTableData (ACPI_CAST_PTR (char, Target));
|
||||
if (TableData)
|
||||
{
|
||||
@ -698,20 +731,20 @@ AcpiDmDumpTable (
|
||||
|
||||
case ACPI_DMT_NAME4:
|
||||
|
||||
AcpiDmCheckAscii (Target, 4);
|
||||
AcpiOsPrintf ("\"%4.4s\"\n", Target);
|
||||
AcpiDmCheckAscii (Target, RepairedName, 4);
|
||||
AcpiOsPrintf ("\"%.4s\"\n", RepairedName);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_NAME6:
|
||||
|
||||
AcpiDmCheckAscii (Target, 6);
|
||||
AcpiOsPrintf ("\"%6.6s\"\n", Target);
|
||||
AcpiDmCheckAscii (Target, RepairedName, 6);
|
||||
AcpiOsPrintf ("\"%.6s\"\n", RepairedName);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_NAME8:
|
||||
|
||||
AcpiDmCheckAscii (Target, 8);
|
||||
AcpiOsPrintf ("\"%8.8s\"\n", Target);
|
||||
AcpiDmCheckAscii (Target, RepairedName, 8);
|
||||
AcpiOsPrintf ("\"%.8s\"\n", RepairedName);
|
||||
break;
|
||||
|
||||
/* Special Data Types */
|
||||
@ -742,8 +775,8 @@ AcpiDmDumpTable (
|
||||
/* Generic Address Structure */
|
||||
|
||||
AcpiOsPrintf ("<Generic Address Structure>\n");
|
||||
AcpiDmDumpTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,
|
||||
CurrentOffset, Target, sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas);
|
||||
AcpiDmDumpTable (TableLength, CurrentOffset, Target,
|
||||
sizeof (ACPI_GENERIC_ADDRESS), AcpiDmTableInfoGas);
|
||||
AcpiOsPrintf ("\n");
|
||||
LastOutputBlankLine = TRUE;
|
||||
break;
|
||||
@ -790,8 +823,8 @@ AcpiDmDumpTable (
|
||||
case ACPI_DMT_HESTNTFY:
|
||||
|
||||
AcpiOsPrintf ("<Hardware Error Notification Structure>\n");
|
||||
AcpiDmDumpTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,
|
||||
CurrentOffset, Target, sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify);
|
||||
AcpiDmDumpTable (TableLength, CurrentOffset, Target,
|
||||
sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify);
|
||||
AcpiOsPrintf ("\n");
|
||||
LastOutputBlankLine = TRUE;
|
||||
break;
|
||||
@ -849,6 +882,31 @@ AcpiDmDumpTable (
|
||||
AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmFadtProfiles[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_IVRS:
|
||||
|
||||
/* IVRS subtable types */
|
||||
|
||||
Temp8 = *Target;
|
||||
switch (Temp8)
|
||||
{
|
||||
case ACPI_IVRS_TYPE_HARDWARE:
|
||||
Name = AcpiDmIvrsSubnames[0];
|
||||
break;
|
||||
|
||||
case ACPI_IVRS_TYPE_MEMORY1:
|
||||
case ACPI_IVRS_TYPE_MEMORY2:
|
||||
case ACPI_IVRS_TYPE_MEMORY3:
|
||||
Name = AcpiDmIvrsSubnames[1];
|
||||
break;
|
||||
|
||||
default:
|
||||
Name = AcpiDmIvrsSubnames[2];
|
||||
break;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%2.2X <%s>\n", *Target, Name);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_EXIT:
|
||||
return (AE_OK);
|
||||
|
||||
@ -888,6 +946,7 @@ AcpiDmDumpTable (
|
||||
static void
|
||||
AcpiDmCheckAscii (
|
||||
UINT8 *Name,
|
||||
char *RepairedName,
|
||||
UINT32 Count)
|
||||
{
|
||||
UINT32 i;
|
||||
@ -895,9 +954,15 @@ AcpiDmCheckAscii (
|
||||
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
if (!Name[i] || !isprint (Name[i]))
|
||||
RepairedName[i] = Name[i];
|
||||
|
||||
if (!Name[i])
|
||||
{
|
||||
Name[i] = ' ';
|
||||
return;
|
||||
}
|
||||
if (!isprint (Name[i]))
|
||||
{
|
||||
RepairedName[i] = ' ';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -306,6 +306,7 @@ AcpiDmDumpAsf (
|
||||
UINT32 DataLength = 0;
|
||||
UINT32 DataOffset = 0;
|
||||
UINT32 i;
|
||||
UINT8 Type;
|
||||
|
||||
|
||||
/* No main table, only sub-tables */
|
||||
@ -322,7 +323,11 @@ AcpiDmDumpAsf (
|
||||
return;
|
||||
}
|
||||
|
||||
switch (SubTable->Header.Type & 0x7F) /* Mask off top bit */
|
||||
/* The actual type is the lower 7 bits of Type */
|
||||
|
||||
Type = (UINT8) (SubTable->Header.Type & 0x7F);
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
case ACPI_ASF_TYPE_INFO:
|
||||
InfoTable = AcpiDmTableInfoAsf0;
|
||||
@ -332,8 +337,8 @@ AcpiDmDumpAsf (
|
||||
InfoTable = AcpiDmTableInfoAsf1;
|
||||
DataInfoTable = AcpiDmTableInfoAsf1a;
|
||||
DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ALERT));
|
||||
DataCount = ((ACPI_ASF_ALERT *) SubTable)->Alerts;
|
||||
DataLength = ((ACPI_ASF_ALERT *) SubTable)->DataLength;
|
||||
DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->Alerts;
|
||||
DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->DataLength;
|
||||
DataOffset = Offset + sizeof (ACPI_ASF_ALERT);
|
||||
break;
|
||||
|
||||
@ -341,8 +346,8 @@ AcpiDmDumpAsf (
|
||||
InfoTable = AcpiDmTableInfoAsf2;
|
||||
DataInfoTable = AcpiDmTableInfoAsf2a;
|
||||
DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_REMOTE));
|
||||
DataCount = ((ACPI_ASF_REMOTE *) SubTable)->Controls;
|
||||
DataLength = ((ACPI_ASF_REMOTE *) SubTable)->DataLength;
|
||||
DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->Controls;
|
||||
DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->DataLength;
|
||||
DataOffset = Offset + sizeof (ACPI_ASF_REMOTE);
|
||||
break;
|
||||
|
||||
@ -353,7 +358,7 @@ AcpiDmDumpAsf (
|
||||
case ACPI_ASF_TYPE_ADDRESS:
|
||||
InfoTable = AcpiDmTableInfoAsf4;
|
||||
DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ADDRESS));
|
||||
DataLength = ((ACPI_ASF_ADDRESS *) SubTable)->Devices;
|
||||
DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, SubTable)->Devices;
|
||||
DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS);
|
||||
break;
|
||||
|
||||
@ -371,7 +376,7 @@ AcpiDmDumpAsf (
|
||||
|
||||
/* Dump variable-length extra data */
|
||||
|
||||
switch (SubTable->Header.Type & 0x7F) /* Mask off top bit */
|
||||
switch (Type)
|
||||
{
|
||||
case ACPI_ASF_TYPE_ALERT:
|
||||
case ACPI_ASF_TYPE_CONTROL:
|
||||
@ -471,7 +476,7 @@ AcpiDmDumpCpep (
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Length, Offset, SubTable,
|
||||
SubTable->Length, AcpiDmTableInfoCpep0);
|
||||
SubTable->Header.Length, AcpiDmTableInfoCpep0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
@ -479,8 +484,9 @@ AcpiDmDumpCpep (
|
||||
|
||||
/* Point to next sub-table */
|
||||
|
||||
Offset += SubTable->Length;
|
||||
SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable, SubTable->Length);
|
||||
Offset += SubTable->Header.Length;
|
||||
SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable,
|
||||
SubTable->Header.Length);
|
||||
}
|
||||
}
|
||||
|
||||
@ -550,6 +556,10 @@ AcpiDmDumpDmar (
|
||||
InfoTable = AcpiDmTableInfoDmar2;
|
||||
ScopeOffset = sizeof (ACPI_DMAR_ATSR);
|
||||
break;
|
||||
case ACPI_DMAR_HARDWARE_AFFINITY:
|
||||
InfoTable = AcpiDmTableInfoDmar3;
|
||||
ScopeOffset = sizeof (ACPI_DMAR_RHSA);
|
||||
break;
|
||||
default:
|
||||
AcpiOsPrintf ("\n**** Unknown DMAR sub-table type %X\n\n", SubTable->Type);
|
||||
return;
|
||||
@ -737,6 +747,8 @@ AcpiDmDumpHest (
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_HEST);
|
||||
ACPI_DMTABLE_INFO *InfoTable;
|
||||
UINT32 SubTableLength;
|
||||
UINT32 BankCount;
|
||||
ACPI_HEST_IA_ERROR_BANK *BankTable;
|
||||
|
||||
|
||||
/* Main table */
|
||||
@ -752,31 +764,26 @@ AcpiDmDumpHest (
|
||||
SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
BankCount = 0;
|
||||
switch (SubTable->Type)
|
||||
{
|
||||
case ACPI_HEST_TYPE_XPF_MACHINE_CHECK:
|
||||
case ACPI_HEST_TYPE_IA32_CHECK:
|
||||
InfoTable = AcpiDmTableInfoHest0;
|
||||
SubTableLength = sizeof (ACPI_HEST_XPF_MACHINE_CHECK);
|
||||
SubTableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK);
|
||||
BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
|
||||
SubTable))->NumHardwareBanks;
|
||||
break;
|
||||
|
||||
case ACPI_HEST_TYPE_XPF_CORRECTED_MACHINE_CHECK:
|
||||
case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
|
||||
InfoTable = AcpiDmTableInfoHest1;
|
||||
SubTableLength = sizeof (ACPI_HEST_XPF_CORRECTED);
|
||||
SubTableLength = sizeof (ACPI_HEST_IA_CORRECTED);
|
||||
BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
|
||||
SubTable))->NumHardwareBanks;
|
||||
break;
|
||||
|
||||
case ACPI_HEST_TYPE_XPF_NON_MASKABLE_INTERRUPT:
|
||||
InfoTable = AcpiDmTableInfoHest3;
|
||||
SubTableLength = sizeof (ACPI_HEST_XPF_NMI);
|
||||
break;
|
||||
|
||||
case ACPI_HEST_TYPE_IPF_CORRECTED_MACHINE_CHECK:
|
||||
InfoTable = AcpiDmTableInfoHest4;
|
||||
SubTableLength = sizeof (ACPI_HEST_IPF_CORRECTED);
|
||||
break;
|
||||
|
||||
case ACPI_HEST_TYPE_IPF_CORRECTED_PLATFORM_ERROR:
|
||||
InfoTable = AcpiDmTableInfoHest5;
|
||||
SubTableLength = sizeof (ACPI_HEST_IPF_CORRECTED_PLATFORM);
|
||||
case ACPI_HEST_TYPE_IA32_NMI:
|
||||
InfoTable = AcpiDmTableInfoHest2;
|
||||
SubTableLength = sizeof (ACPI_HEST_IA_NMI);
|
||||
break;
|
||||
|
||||
case ACPI_HEST_TYPE_AER_ROOT_PORT:
|
||||
@ -794,7 +801,7 @@ AcpiDmDumpHest (
|
||||
SubTableLength = sizeof (ACPI_HEST_AER_BRIDGE);
|
||||
break;
|
||||
|
||||
case ACPI_HEST_TYPE_GENERIC_HARDWARE_ERROR_SOURCE:
|
||||
case ACPI_HEST_TYPE_GENERIC_ERROR:
|
||||
InfoTable = AcpiDmTableInfoHest9;
|
||||
SubTableLength = sizeof (ACPI_HEST_GENERIC);
|
||||
break;
|
||||
@ -814,14 +821,212 @@ AcpiDmDumpHest (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Point to next sub-table (each subtable is of fixed length) */
|
||||
/* Point to end of current subtable (each subtable above is of fixed length) */
|
||||
|
||||
Offset += SubTableLength;
|
||||
|
||||
/* If there are any (fixed-length) Error Banks from above, dump them now */
|
||||
|
||||
if (BankCount)
|
||||
{
|
||||
BankTable = ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK, SubTable, SubTableLength);
|
||||
SubTableLength += BankCount * sizeof (ACPI_HEST_IA_ERROR_BANK);
|
||||
|
||||
while (BankCount)
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Length, Offset, BankTable,
|
||||
sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
Offset += sizeof (ACPI_HEST_IA_ERROR_BANK);
|
||||
BankTable++;
|
||||
BankCount--;
|
||||
}
|
||||
}
|
||||
|
||||
/* Point to next sub-table */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, SubTable, SubTableLength);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpIvrs
|
||||
*
|
||||
* PARAMETERS: Table - A IVRS table
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Format the contents of a IVRS
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static UINT8 EntrySizes[] = {4,8,16,32};
|
||||
|
||||
void
|
||||
AcpiDmDumpIvrs (
|
||||
ACPI_TABLE_HEADER *Table)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_IVRS);
|
||||
UINT32 EntryOffset;
|
||||
UINT32 EntryLength;
|
||||
UINT32 EntryType;
|
||||
ACPI_IVRS_DE_HEADER *DeviceEntry;
|
||||
ACPI_IVRS_HEADER *SubTable;
|
||||
ACPI_DMTABLE_INFO *InfoTable;
|
||||
|
||||
|
||||
/* Main table */
|
||||
|
||||
Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIvrs);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common sub-table header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
|
||||
SubTable->Length, AcpiDmTableInfoIvrsHdr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (SubTable->Type)
|
||||
{
|
||||
case ACPI_IVRS_TYPE_HARDWARE:
|
||||
InfoTable = AcpiDmTableInfoIvrs0;
|
||||
break;
|
||||
case ACPI_IVRS_TYPE_MEMORY1:
|
||||
case ACPI_IVRS_TYPE_MEMORY2:
|
||||
case ACPI_IVRS_TYPE_MEMORY3:
|
||||
InfoTable = AcpiDmTableInfoIvrs1;
|
||||
break;
|
||||
default:
|
||||
AcpiOsPrintf ("\n**** Unknown IVRS sub-table type %X\n",
|
||||
SubTable->Type);
|
||||
|
||||
/* Attempt to continue */
|
||||
|
||||
if (!SubTable->Length)
|
||||
{
|
||||
AcpiOsPrintf ("Invalid zero length subtable\n");
|
||||
return;
|
||||
}
|
||||
goto NextSubTable;
|
||||
}
|
||||
|
||||
/* Dump the subtable */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
|
||||
SubTable->Length, InfoTable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* The hardware subtable can contain multiple device entries */
|
||||
|
||||
if (SubTable->Type == ACPI_IVRS_TYPE_HARDWARE)
|
||||
{
|
||||
EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE);
|
||||
DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, SubTable,
|
||||
sizeof (ACPI_IVRS_HARDWARE));
|
||||
|
||||
while (EntryOffset < (Offset + SubTable->Length))
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
/*
|
||||
* Upper 2 bits of Type encode the length of the device entry
|
||||
*
|
||||
* 00 = 4 byte
|
||||
* 01 = 8 byte
|
||||
* 10 = 16 byte - currently no entries defined
|
||||
* 11 = 32 byte - currently no entries defined
|
||||
*/
|
||||
EntryType = DeviceEntry->Type;
|
||||
EntryLength = EntrySizes [EntryType >> 6];
|
||||
|
||||
switch (EntryType)
|
||||
{
|
||||
/* 4-byte device entries */
|
||||
|
||||
case ACPI_IVRS_TYPE_PAD4:
|
||||
case ACPI_IVRS_TYPE_ALL:
|
||||
case ACPI_IVRS_TYPE_SELECT:
|
||||
case ACPI_IVRS_TYPE_START:
|
||||
case ACPI_IVRS_TYPE_END:
|
||||
|
||||
InfoTable = AcpiDmTableInfoIvrs4;
|
||||
break;
|
||||
|
||||
/* 8-byte entries, type A */
|
||||
|
||||
case ACPI_IVRS_TYPE_ALIAS_SELECT:
|
||||
case ACPI_IVRS_TYPE_ALIAS_START:
|
||||
|
||||
InfoTable = AcpiDmTableInfoIvrs8a;
|
||||
break;
|
||||
|
||||
/* 8-byte entries, type B */
|
||||
|
||||
case ACPI_IVRS_TYPE_PAD8:
|
||||
case ACPI_IVRS_TYPE_EXT_SELECT:
|
||||
case ACPI_IVRS_TYPE_EXT_START:
|
||||
|
||||
InfoTable = AcpiDmTableInfoIvrs8b;
|
||||
break;
|
||||
|
||||
/* 8-byte entries, type C */
|
||||
|
||||
case ACPI_IVRS_TYPE_SPECIAL:
|
||||
|
||||
InfoTable = AcpiDmTableInfoIvrs8c;
|
||||
break;
|
||||
|
||||
default:
|
||||
InfoTable = AcpiDmTableInfoIvrs4;
|
||||
AcpiOsPrintf (
|
||||
"\n**** Unknown IVRS device entry type/length: "
|
||||
"%.2X/%X at offset %.4X: (header below)\n",
|
||||
EntryType, EntryLength, EntryOffset);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Dump the Device Entry */
|
||||
|
||||
Status = AcpiDmDumpTable (Table->Length, EntryOffset,
|
||||
DeviceEntry, EntryLength, InfoTable);
|
||||
|
||||
EntryOffset += EntryLength;
|
||||
DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, DeviceEntry,
|
||||
EntryLength);
|
||||
}
|
||||
}
|
||||
|
||||
NextSubTable:
|
||||
/* Point to next sub-table */
|
||||
|
||||
Offset += SubTable->Length;
|
||||
SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, SubTable, SubTable->Length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpMadt
|
||||
@ -991,6 +1196,58 @@ AcpiDmDumpMcfg (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpMsct
|
||||
*
|
||||
* PARAMETERS: Table - A MSCT table
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Format the contents of a MSCT
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDmDumpMsct (
|
||||
ACPI_TABLE_HEADER *Table)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_MSCT);
|
||||
ACPI_MSCT_PROXIMITY *SubTable;
|
||||
|
||||
|
||||
/* Main table */
|
||||
|
||||
Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMsct);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common sub-table header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
|
||||
sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Point to next sub-table */
|
||||
|
||||
Offset += sizeof (ACPI_MSCT_PROXIMITY);
|
||||
SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, SubTable, sizeof (ACPI_MSCT_PROXIMITY));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpSlit
|
||||
@ -1149,3 +1406,54 @@ AcpiDmDumpSrat (
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpWdat
|
||||
*
|
||||
* PARAMETERS: Table - A WDAT table
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Format the contents of a WDAT
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDmDumpWdat (
|
||||
ACPI_TABLE_HEADER *Table)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_WDAT);
|
||||
ACPI_WDAT_ENTRY *SubTable;
|
||||
|
||||
|
||||
/* Main table */
|
||||
|
||||
Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoWdat);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common sub-table header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
|
||||
sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Point to next sub-table */
|
||||
|
||||
Offset += sizeof (ACPI_WDAT_ENTRY);
|
||||
SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, SubTable, sizeof (ACPI_WDAT_ENTRY));
|
||||
}
|
||||
}
|
||||
|
@ -139,14 +139,19 @@
|
||||
#define ACPI_ERST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_ERST,f)
|
||||
#define ACPI_HEST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_HEST,f)
|
||||
#define ACPI_HPET_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_HPET,f)
|
||||
#define ACPI_IVRS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_IVRS,f)
|
||||
#define ACPI_MADT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MADT,f)
|
||||
#define ACPI_MCFG_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MCFG,f)
|
||||
#define ACPI_MSCT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MSCT,f)
|
||||
#define ACPI_SBST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SBST,f)
|
||||
#define ACPI_SLIT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SLIT,f)
|
||||
#define ACPI_SPCR_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SPCR,f)
|
||||
#define ACPI_SPMI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SPMI,f)
|
||||
#define ACPI_SRAT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SRAT,f)
|
||||
#define ACPI_TCPA_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_TCPA,f)
|
||||
#define ACPI_UEFI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_UEFI,f)
|
||||
#define ACPI_WAET_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WAET,f)
|
||||
#define ACPI_WDAT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDAT,f)
|
||||
#define ACPI_WDRT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDRT,f)
|
||||
|
||||
/* Subtables */
|
||||
@ -163,17 +168,24 @@
|
||||
#define ACPI_DMAR0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_HARDWARE_UNIT,f)
|
||||
#define ACPI_DMAR1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f)
|
||||
#define ACPI_DMAR2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_ATSR,f)
|
||||
#define ACPI_DMAR3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_RHSA,f)
|
||||
#define ACPI_EINJ0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
|
||||
#define ACPI_HEST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_XPF_MACHINE_CHECK,f)
|
||||
#define ACPI_HEST1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_XPF_CORRECTED,f)
|
||||
#define ACPI_HEST3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_XPF_NMI,f)
|
||||
#define ACPI_HEST4_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IPF_CORRECTED,f)
|
||||
#define ACPI_HEST5_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IPF_CORRECTED_PLATFORM,f)
|
||||
#define ACPI_HEST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f)
|
||||
#define ACPI_HEST1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f)
|
||||
#define ACPI_HEST2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_NMI,f)
|
||||
#define ACPI_HEST6_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_AER_ROOT,f)
|
||||
#define ACPI_HEST7_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_AER,f)
|
||||
#define ACPI_HEST8_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_AER_BRIDGE,f)
|
||||
#define ACPI_HEST9_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_GENERIC,f)
|
||||
#define ACPI_HESTN_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_NOTIFY,f)
|
||||
#define ACPI_HESTB_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_ERROR_BANK,f)
|
||||
#define ACPI_IVRSH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_HEADER,f)
|
||||
#define ACPI_IVRS0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_HARDWARE,f)
|
||||
#define ACPI_IVRS1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_MEMORY,f)
|
||||
#define ACPI_IVRSD_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DE_HEADER,f)
|
||||
#define ACPI_IVRS8A_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DEVICE8A,f)
|
||||
#define ACPI_IVRS8B_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DEVICE8B,f)
|
||||
#define ACPI_IVRS8C_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DEVICE8C,f)
|
||||
#define ACPI_MADT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC,f)
|
||||
#define ACPI_MADT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_IO_APIC,f)
|
||||
#define ACPI_MADT2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f)
|
||||
@ -187,10 +199,12 @@
|
||||
#define ACPI_MADT10_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f)
|
||||
#define ACPI_MADTH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
|
||||
#define ACPI_MCFG0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f)
|
||||
#define ACPI_MSCT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f)
|
||||
#define ACPI_SRATH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
|
||||
#define ACPI_SRAT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f)
|
||||
#define ACPI_SRAT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
|
||||
#define ACPI_SRAT2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f)
|
||||
#define ACPI_WDAT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WDAT_ENTRY,f)
|
||||
|
||||
/*
|
||||
* Simplify access to flag fields by breaking them up into bytes
|
||||
@ -299,12 +313,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFacs[] =
|
||||
{ACPI_DMT_NAME4, ACPI_FACS_OFFSET (Signature[0]), "Signature"},
|
||||
{ACPI_DMT_UINT32, ACPI_FACS_OFFSET (Length), "Length"},
|
||||
{ACPI_DMT_UINT32, ACPI_FACS_OFFSET (HardwareSignature), "Hardware Signature"},
|
||||
{ACPI_DMT_UINT32, ACPI_FACS_OFFSET (FirmwareWakingVector), "Firmware Waking Vector(32)"},
|
||||
{ACPI_DMT_UINT32, ACPI_FACS_OFFSET (FirmwareWakingVector), "32 Firmware Waking Vector"},
|
||||
{ACPI_DMT_UINT32, ACPI_FACS_OFFSET (GlobalLock), "Global Lock"},
|
||||
{ACPI_DMT_UINT32, ACPI_FACS_OFFSET (Flags), "Flags (decoded below)"},
|
||||
{ACPI_DMT_FLAG0, ACPI_FACS_FLAG_OFFSET (Flags,0), "S4BIOS Support Present"},
|
||||
{ACPI_DMT_UINT64, ACPI_FACS_OFFSET (XFirmwareWakingVector), "Firmware Waking Vector(64)"},
|
||||
{ACPI_DMT_FLAG1, ACPI_FACS_FLAG_OFFSET (Flags,0), "64-bit Wake Supported (V2)"},
|
||||
{ACPI_DMT_UINT64, ACPI_FACS_OFFSET (XFirmwareWakingVector), "64 Firmware Waking Vector"},
|
||||
{ACPI_DMT_UINT8, ACPI_FACS_OFFSET (Version), "Version"},
|
||||
{ACPI_DMT_UINT24, ACPI_FACS_OFFSET (Reserved[0]), "Reserved"},
|
||||
{ACPI_DMT_UINT32, ACPI_FACS_OFFSET (OspmFlags), "OspmFlags (decoded below)"},
|
||||
{ACPI_DMT_FLAG0, ACPI_FACS_FLAG_OFFSET (OspmFlags,0), "64-bit Wake Env Required (V2)"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
@ -454,9 +472,9 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoAsfHdr[] =
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoAsf0[] =
|
||||
{
|
||||
{ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (MinResetValue), "Minimum Reset Value"},
|
||||
{ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (MinResetValue), "Minimum Polling Interval"},
|
||||
{ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (MinPollInterval), "Minimum Polling Interval"},
|
||||
{ACPI_DMT_UINT16, ACPI_ASF0_OFFSET (SystemId), "System ID"},
|
||||
{ACPI_DMT_UINT32, ACPI_ASF0_OFFSET (SystemId), "Manufacturer ID"},
|
||||
{ACPI_DMT_UINT32, ACPI_ASF0_OFFSET (MfgId), "Manufacturer ID"},
|
||||
{ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (Flags), "Flags"},
|
||||
{ACPI_DMT_UINT24, ACPI_ASF0_OFFSET (Reserved2[0]), "Reserved"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
@ -579,8 +597,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[] =
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[] =
|
||||
{
|
||||
{ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Type), "Subtable Type"},
|
||||
{ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Length), "Length"},
|
||||
{ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Header.Type), "Subtable Type"},
|
||||
{ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Header.Length), "Length"},
|
||||
{ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Id), "Processor ID"},
|
||||
{ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Eid), "Processor EID"},
|
||||
{ACPI_DMT_UINT32, ACPI_CPEP0_OFFSET (Interval), "Polling Interval"},
|
||||
@ -671,6 +689,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[] =
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* 3: Remapping Hardware Static Affinity Structure */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[] =
|
||||
{
|
||||
{ACPI_DMT_UINT32, ACPI_DMAR3_OFFSET (Reserved), "Reserved"},
|
||||
{ACPI_DMT_UINT64, ACPI_DMAR3_OFFSET (BaseAddress), "Base Address"},
|
||||
{ACPI_DMT_UINT32, ACPI_DMAR3_OFFSET (ProximityDomain), "Proximity Domain"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -698,7 +726,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[] =
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[] =
|
||||
{
|
||||
{ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (HeaderLength), "Injection Header Length"},
|
||||
{ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (Reserved), "Reserved"},
|
||||
{ACPI_DMT_UINT8, ACPI_EINJ_OFFSET (Flags), "Flags"},
|
||||
{ACPI_DMT_UINT24, ACPI_EINJ_OFFSET (Reserved[0]), "Reserved"},
|
||||
{ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (Entries), "Injection Entry Count"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
@ -743,97 +772,84 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest[] =
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* Common HEST structures for subtables */
|
||||
|
||||
#define ACPI_DM_HEST_HEADER \
|
||||
{ACPI_DMT_HEST, ACPI_HEST0_OFFSET (Header.Type), "Subtable Type"}, \
|
||||
{ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Header.SourceId), "Source Id"}
|
||||
|
||||
#define ACPI_DM_HEST_AER \
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved1), "Reserved"}, \
|
||||
{ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags"}, \
|
||||
{ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Enabled), "Enabled"}, \
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.RecordsToPreallocate), "Records To Preallocate"}, \
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.MaxSectionsPerRecord), "Max Sections Per Record"}, \
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.Bus), "Bus"}, \
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Device), "Device"}, \
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Function), "Function"}, \
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.DeviceControl), "DeviceControl"}, \
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved2), "Reserved"}, \
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableMask), "Uncorrectable Mask"}, \
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableSeverity), "Uncorrectable Severity"}, \
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.CorrectableMask), "Correctable Mask"}, \
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.AdvancedCapabilities), "Advanced Capabilities"}
|
||||
|
||||
|
||||
/* HEST Subtables */
|
||||
|
||||
/* 0: XPF Machine Check Exception */
|
||||
/* 0: IA32 Machine Check Exception */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[] =
|
||||
{
|
||||
{ACPI_DMT_HEST, ACPI_HEST0_OFFSET (Header.Type), "Subtable Type"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (SourceId), "Source Id"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (ConfigWriteEnable), "Configuration Write Enable"},
|
||||
ACPI_DM_HEST_HEADER,
|
||||
{ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Reserved1), "Reserved"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Flags), "Flags"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Reserved1), "Reserved"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (RecordsToPreAllocate), "Records To Preallocate"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Enabled), "Enabled"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (RecordsToPreallocate), "Records To Preallocate"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"},
|
||||
{ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalCapabilityData), "Global Capability Data"},
|
||||
{ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalControlData), "Global Control Data"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (NumHardwareBanks), "Num Hardware Banks"},
|
||||
{ACPI_DMT_UINT56, ACPI_HEST0_OFFSET (Reserved2), "Reserved"},
|
||||
{ACPI_DMT_UINT56, ACPI_HEST0_OFFSET (Reserved3[0]), "Reserved"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* 1: XPF Corrected Machine Check */
|
||||
/* 1: IA32 Corrected Machine Check */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoHest1[] =
|
||||
{
|
||||
{ACPI_DMT_HEST, ACPI_HEST1_OFFSET (Header.Type), "Subtable Type"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (SourceId), "Source Id"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (ConfigWriteEnable), "Configuration Write Enable"},
|
||||
ACPI_DM_HEST_HEADER,
|
||||
{ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (Reserved1), "Reserved"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Flags), "Flags"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Enabled), "Enabled"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (RecordsToPreAllocate), "Records To Preallocate"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (RecordsToPreallocate), "Records To Preallocate"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"},
|
||||
{ACPI_DMT_HESTNTFY, ACPI_HEST1_OFFSET (Notify), "Notify"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (NumHardwareBanks), "Num Hardware Banks"},
|
||||
{ACPI_DMT_UINT24, ACPI_HEST1_OFFSET (Reserved), "Reserved"},
|
||||
{ACPI_DMT_UINT24, ACPI_HEST1_OFFSET (Reserved2[0]), "Reserved"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* 3: XPF Non-Maskable Interrupt */
|
||||
/* 2: IA32 Non-Maskable Interrupt */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoHest3[] =
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoHest2[] =
|
||||
{
|
||||
{ACPI_DMT_HEST, ACPI_HEST3_OFFSET (Header.Type), "Subtable Type"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST3_OFFSET (SourceId), "Source Id"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST3_OFFSET (Reserved), "Reserved"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST3_OFFSET (RecordsToPreAllocate), "Records To Preallocate"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST3_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST3_OFFSET (MaxRawDataLength), "Max Raw Data Length"},
|
||||
ACPI_DM_HEST_HEADER,
|
||||
{ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (Reserved), "Reserved"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (RecordsToPreallocate), "Records To Preallocate"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (MaxRawDataLength), "Max Raw Data Length"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* 4: IPF Corrected Machine Check */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoHest4[] =
|
||||
{
|
||||
{ACPI_DMT_HEST, ACPI_HEST4_OFFSET (Header.Type), "Subtable Type"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST4_OFFSET (Enabled), "Enabled"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST4_OFFSET (Reserved), "Reserved"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* 5: IPF Corrected Platform Error */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoHest5[] =
|
||||
{
|
||||
{ACPI_DMT_HEST, ACPI_HEST5_OFFSET (Header.Type), "Subtable Type"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST5_OFFSET (Enabled), "Enabled"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST5_OFFSET (Reserved), "Reserved"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* 6: PCI Express Root Port AER */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoHest6[] =
|
||||
{
|
||||
{ACPI_DMT_HEST, ACPI_HEST6_OFFSET (Header.Type), "Subtable Type"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.SourceId), "Source Id"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.ConfigWriteEnable), "Configuration Write Enable"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Enabled), "Enabled"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.RecordsToPreAllocate), "Records To Preallocate"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.MaxSectionsPerRecord), "Max Sections Per Record"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.Bus), "Bus"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Device), "Device"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Function), "Function"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.DeviceControl), "DeviceControl"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved), "Reserved"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableErrorMask), "Uncorrectable Error Mask"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableErrorSeverity), "Uncorrectable Error Severity"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.CorrectableErrorMask), "Correctable Error Mask"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.AdvancedErrorCapabilities), "Advanced Error Capabilities"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (RootErrorCommand), "Root Error Command"},
|
||||
ACPI_DM_HEST_HEADER,
|
||||
ACPI_DM_HEST_AER,
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (RootErrorCommand), "Root Error Command"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
@ -841,22 +857,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest6[] =
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoHest7[] =
|
||||
{
|
||||
{ACPI_DMT_HEST, ACPI_HEST6_OFFSET (Header.Type), "Subtable Type"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.SourceId), "Source Id"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.ConfigWriteEnable), "Configuration Write Enable"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Enabled), "Enabled"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.RecordsToPreAllocate), "Records To Preallocate"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.MaxSectionsPerRecord), "Max Sections Per Record"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.Bus), "Bus"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Device), "Device"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Function), "Function"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.DeviceControl), "DeviceControl"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved), "Reserved"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableErrorMask), "Uncorrectable Error Mask"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableErrorSeverity), "Uncorrectable Error Severity"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.CorrectableErrorMask), "Correctable Error Mask"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.AdvancedErrorCapabilities), "Advanced Error Capabilities"},
|
||||
ACPI_DM_HEST_HEADER,
|
||||
ACPI_DM_HEST_AER,
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
@ -864,25 +866,11 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest7[] =
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoHest8[] =
|
||||
{
|
||||
{ACPI_DMT_HEST, ACPI_HEST6_OFFSET (Header.Type), "Subtable Type"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.SourceId), "Source Id"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.ConfigWriteEnable), "Configuration Write Enable"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Enabled), "Enabled"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.RecordsToPreAllocate), "Records To Preallocate"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.MaxSectionsPerRecord), "Max Sections Per Record"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.Bus), "Bus"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Device), "Device"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Function), "Function"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.DeviceControl), "DeviceControl"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved), "Reserved"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableErrorMask), "Uncorrectable Error Mask"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableErrorSeverity), "Uncorrectable Error Severity"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.CorrectableErrorMask), "Correctable Error Mask"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.AdvancedErrorCapabilities), "Advanced Error Capabilities"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (SecondaryUncorrectableErrorMask), "2nd Uncorrectable Err Mask"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (SecondaryUncorrectableErrorSeverity), "2nd Uncorrectable Err Severity"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (SecondaryAdvancedCapabilities), "2nd Advanced Capabilities"},
|
||||
ACPI_DM_HEST_HEADER,
|
||||
ACPI_DM_HEST_AER,
|
||||
{ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (UncorrectableMask2), "2nd Uncorrectable Mask"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (UncorrectableSeverity2), "2nd Uncorrectable Severity"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (AdvancedCapabilities2), "2nd Advanced Capabilities"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
@ -890,21 +878,20 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest8[] =
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoHest9[] =
|
||||
{
|
||||
{ACPI_DMT_HEST, ACPI_HEST9_OFFSET (Header.Type), "Subtable Type"},
|
||||
{ACPI_DMT_UINT16, ACPI_HEST9_OFFSET (SourceId), "Source Id"},
|
||||
ACPI_DM_HEST_HEADER,
|
||||
{ACPI_DMT_UINT16, ACPI_HEST9_OFFSET (RelatedSourceId), "Related Source Id"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST9_OFFSET (ConfigWriteEnable), "Configuration Write Enable"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST9_OFFSET (Reserved), "Reserved"},
|
||||
{ACPI_DMT_UINT8, ACPI_HEST9_OFFSET (Enabled), "Enabled"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (RecordsToPreAllocate), "Records To Preallocate"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (RecordsToPreallocate), "Records To Preallocate"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (MaxRawDataLength), "Max Raw Data Length"},
|
||||
{ACPI_DMT_GAS, ACPI_HEST9_OFFSET (ErrorStatusAddress), "Error Status Address"},
|
||||
{ACPI_DMT_HESTNTFY, ACPI_HEST9_OFFSET (Notify), "Notify"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (ErrorStatusBlockLength), "Error Status Block Length"},
|
||||
{ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (ErrorBlockLength), "Error Status Block Length"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[10] =
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[] =
|
||||
{
|
||||
{ACPI_DMT_HESTNTYP, ACPI_HESTN_OFFSET (Type), "Notify Type"},
|
||||
{ACPI_DMT_UINT8, ACPI_HESTN_OFFSET (Length), "Notify Length"},
|
||||
@ -919,6 +906,25 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[10] =
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and
|
||||
* ACPI_HEST_IA_CORRECTED structures.
|
||||
*/
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank[] =
|
||||
{
|
||||
{ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (BankNumber), "Bank Number"},
|
||||
{ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (ClearStatusOnInit), "Clear Status On Init"},
|
||||
{ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (StatusFormat), "Status Format"},
|
||||
{ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (Reserved), "Reserved"},
|
||||
{ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (ControlRegister), "Control Register"},
|
||||
{ACPI_DMT_UINT64, ACPI_HESTB_OFFSET (ControlData), "Control Data"},
|
||||
{ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (StatusRegister), "Status Register"},
|
||||
{ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (AddressRegister), "Address Register"},
|
||||
{ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (MiscRegister), "Misc Register"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* HPET - High Precision Event Timer table
|
||||
@ -932,9 +938,104 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[] =
|
||||
{ACPI_DMT_UINT8, ACPI_HPET_OFFSET (Sequence), "Sequence Number"},
|
||||
{ACPI_DMT_UINT16, ACPI_HPET_OFFSET (MinimumTick), "Minimum Clock Ticks"},
|
||||
{ACPI_DMT_UINT8, ACPI_HPET_OFFSET (Flags), "Flags (decoded below)"},
|
||||
{ACPI_DMT_FLAG0, ACPI_HPET_FLAG_OFFSET (Flags,0), "Page Protect"},
|
||||
{ACPI_DMT_FLAG1, ACPI_HPET_FLAG_OFFSET (Flags,0), "4K Page Protect"},
|
||||
{ACPI_DMT_FLAG2, ACPI_HPET_FLAG_OFFSET (Flags,0), "64K Page Protect"},
|
||||
{ACPI_DMT_FLAG0, ACPI_HPET_FLAG_OFFSET (Flags,0), "4K Page Protect"},
|
||||
{ACPI_DMT_FLAG1, ACPI_HPET_FLAG_OFFSET (Flags,0), "64K Page Protect"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* IVRS - I/O Virtualization Reporting Structure
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs[] =
|
||||
{
|
||||
{ACPI_DMT_UINT32, ACPI_IVRS_OFFSET (Info), "Virtualization Info"},
|
||||
{ACPI_DMT_UINT64, ACPI_IVRS_OFFSET (Reserved), "Reserved"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* Common Subtable header (one per Subtable) */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHdr[] =
|
||||
{
|
||||
{ACPI_DMT_IVRS, ACPI_IVRSH_OFFSET (Type), "Subtable Type"},
|
||||
{ACPI_DMT_UINT8, ACPI_IVRSH_OFFSET (Flags), "Flags"},
|
||||
{ACPI_DMT_UINT16, ACPI_IVRSH_OFFSET (Length), "Length"},
|
||||
{ACPI_DMT_UINT16, ACPI_IVRSH_OFFSET (DeviceId), "DeviceId"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* IVRS subtables */
|
||||
|
||||
/* 0x10: I/O Virtualization Hardware Definition (IVHD) Block */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs0[] =
|
||||
{
|
||||
{ACPI_DMT_UINT16, ACPI_IVRS0_OFFSET (CapabilityOffset), "Capability Offset"},
|
||||
{ACPI_DMT_UINT64, ACPI_IVRS0_OFFSET (BaseAddress), "Base Address"},
|
||||
{ACPI_DMT_UINT16, ACPI_IVRS0_OFFSET (PciSegmentGroup), "PCI Segment Group"},
|
||||
{ACPI_DMT_UINT16, ACPI_IVRS0_OFFSET (Info), "Virtualization Info"},
|
||||
{ACPI_DMT_UINT32, ACPI_IVRS0_OFFSET (Reserved), "Reserved"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition (IVMD) Block */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs1[] =
|
||||
{
|
||||
{ACPI_DMT_UINT16, ACPI_IVRS1_OFFSET (AuxData), "Auxiliary Data"},
|
||||
{ACPI_DMT_UINT64, ACPI_IVRS1_OFFSET (Reserved), "Reserved"},
|
||||
{ACPI_DMT_UINT64, ACPI_IVRS1_OFFSET (StartAddress), "Start Address"},
|
||||
{ACPI_DMT_UINT64, ACPI_IVRS1_OFFSET (MemoryLength), "Memory Length"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* Device entry header for IVHD block */
|
||||
|
||||
#define ACPI_DMT_IVRS_DE_HEADER \
|
||||
{ACPI_DMT_UINT8, ACPI_IVRSD_OFFSET (Type), "Entry Type"}, \
|
||||
{ACPI_DMT_UINT16, ACPI_IVRSD_OFFSET (Id), "Device ID"}, \
|
||||
{ACPI_DMT_UINT8, ACPI_IVRSD_OFFSET (DataSetting), "Data Setting"}
|
||||
|
||||
/* 4-byte device entry */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs4[] =
|
||||
{
|
||||
ACPI_DMT_IVRS_DE_HEADER,
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* 8-byte device entry */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8a[] =
|
||||
{
|
||||
ACPI_DMT_IVRS_DE_HEADER,
|
||||
{ACPI_DMT_UINT8, ACPI_IVRS8A_OFFSET (Reserved1), "Reserved"},
|
||||
{ACPI_DMT_UINT16, ACPI_IVRS8A_OFFSET (UsedId), "Source Used Device ID"},
|
||||
{ACPI_DMT_UINT8, ACPI_IVRS8A_OFFSET (Reserved2), "Reserved"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* 8-byte device entry */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8b[] =
|
||||
{
|
||||
ACPI_DMT_IVRS_DE_HEADER,
|
||||
{ACPI_DMT_UINT32, ACPI_IVRS8B_OFFSET (ExtendedData), "Extended Data"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* 8-byte device entry */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8c[] =
|
||||
{
|
||||
ACPI_DMT_IVRS_DE_HEADER,
|
||||
{ACPI_DMT_UINT8, ACPI_IVRS8C_OFFSET (Handle), "Handle"},
|
||||
{ACPI_DMT_UINT16, ACPI_IVRS8C_OFFSET (UsedId), "Source Used Device ID"},
|
||||
{ACPI_DMT_UINT8, ACPI_IVRS8C_OFFSET (Variety), "Variety"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
@ -1074,7 +1175,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt8[] =
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* 9: Processor Local X2_APIC (07/2008) */
|
||||
/* 9: Processor Local X2_APIC (ACPI 4.0) */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt9[] =
|
||||
{
|
||||
@ -1086,7 +1187,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt9[] =
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* 10: Local X2_APIC NMI (07/2008) */
|
||||
/* 10: Local X2_APIC NMI (ACPI 4.0) */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[] =
|
||||
{
|
||||
@ -1123,6 +1224,35 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[] =
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* MSCT - Maximum System Characteristics Table (ACPI 4.0)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoMsct[] =
|
||||
{
|
||||
{ACPI_DMT_UINT32, ACPI_MSCT_OFFSET (ProximityOffset), "Proximity Offset"},
|
||||
{ACPI_DMT_UINT32, ACPI_MSCT_OFFSET (MaxProximityDomains), "Max Proximity Domains"},
|
||||
{ACPI_DMT_UINT32, ACPI_MSCT_OFFSET (MaxClockDomains), "Max Clock Domains"},
|
||||
{ACPI_DMT_UINT64, ACPI_MSCT_OFFSET (MaxAddress), "Max Physical Address"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* Subtable - Maximum Proximity Domain Information. Version 1 */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[] =
|
||||
{
|
||||
{ACPI_DMT_UINT8, ACPI_MSCT0_OFFSET (Revision), "Revision"},
|
||||
{ACPI_DMT_UINT8, ACPI_MSCT0_OFFSET (Length), "Length"},
|
||||
{ACPI_DMT_UINT32, ACPI_MSCT0_OFFSET (RangeStart), "Domain Range Start"},
|
||||
{ACPI_DMT_UINT32, ACPI_MSCT0_OFFSET (RangeEnd), "Domain Range End"},
|
||||
{ACPI_DMT_UINT32, ACPI_MSCT0_OFFSET (ProcessorCapacity), "Processor Capacity"},
|
||||
{ACPI_DMT_UINT64, ACPI_MSCT0_OFFSET (MemoryCapacity), "Memory Capacity"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* SBST - Smart Battery Specification Table
|
||||
@ -1203,8 +1333,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[] =
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[] =
|
||||
{
|
||||
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved), "Reserved"},
|
||||
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterfaceType), "Interface Type"},
|
||||
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved), "Reserved"},
|
||||
{ACPI_DMT_UINT16, ACPI_SPMI_OFFSET (SpecRevision), "IPMI Spec Version"},
|
||||
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterruptType), "Interrupt Type"},
|
||||
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (GpeNumber), "GPE Number"},
|
||||
@ -1216,6 +1346,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[] =
|
||||
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciBus), "PCI Bus"},
|
||||
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciDevice), "PCI Device"},
|
||||
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciFunction), "PCI Function"},
|
||||
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved2), "Reserved"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
@ -1275,7 +1406,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[] =
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* 2: Processor Local X2_APIC Affinity (07/2008) */
|
||||
/* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[] =
|
||||
{
|
||||
@ -1284,6 +1415,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[] =
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ApicId), "Apic ID"},
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Flags), "Flags (decoded below)"},
|
||||
{ACPI_DMT_FLAG0, ACPI_SRAT2_FLAG_OFFSET (Flags,0), "Enabled"},
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ClockDomain), "Clock Domain"},
|
||||
{ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Reserved2), "Reserved"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
@ -1303,6 +1436,74 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[] =
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* UEFI - UEFI Boot optimization Table
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[] =
|
||||
{
|
||||
{ACPI_DMT_BUF16, ACPI_UEFI_OFFSET (Identifier[0]), "UUID Identifier"},
|
||||
{ACPI_DMT_UINT16, ACPI_UEFI_OFFSET (DataOffset), "Data Offset"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* WAET - Windows ACPI Emulated devices Table
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoWaet[] =
|
||||
{
|
||||
{ACPI_DMT_UINT32, ACPI_WAET_OFFSET (Flags), "Flags (decoded below)"},
|
||||
{ACPI_DMT_FLAG0, ACPI_WAET_OFFSET (Flags), "RTC needs no INT ack"},
|
||||
{ACPI_DMT_FLAG1, ACPI_WAET_OFFSET (Flags), "PM timer, one read only"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* WDAT - Watchdog Action Table
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoWdat[] =
|
||||
{
|
||||
{ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (HeaderLength), "Header Length"},
|
||||
{ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (PciSegment), "PCI Segment"},
|
||||
{ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (PciBus), "PCI Bus"},
|
||||
{ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (PciDevice), "PCI Device"},
|
||||
{ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (PciFunction), "PCI Function"},
|
||||
{ACPI_DMT_UINT24, ACPI_WDAT_OFFSET (Reserved[0]), "Reserved"},
|
||||
{ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (TimerPeriod), "Timer Period"},
|
||||
{ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (MaxCount), "Max Count"},
|
||||
{ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (MinCount), "Min Count"},
|
||||
{ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (Flags), "Flags (decoded below)"},
|
||||
{ACPI_DMT_FLAG0, ACPI_WDAT_OFFSET (Flags), "Enabled"},
|
||||
{ACPI_DMT_FLAG7, ACPI_WDAT_OFFSET (Flags), "Stopped When Asleep"},
|
||||
{ACPI_DMT_UINT24, ACPI_WDAT_OFFSET (Reserved2[0]), "Reserved"},
|
||||
{ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (Entries), "Watchdog Entry Count"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
/* WDAT Subtables - Watchdog Instruction Entries */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoWdat0[] =
|
||||
{
|
||||
{ACPI_DMT_UINT8, ACPI_WDAT0_OFFSET (Action), "Watchdog Action"},
|
||||
{ACPI_DMT_UINT8, ACPI_WDAT0_OFFSET (Instruction), "Instruction"},
|
||||
{ACPI_DMT_UINT16, ACPI_WDAT0_OFFSET (Reserved), "Reserved"},
|
||||
{ACPI_DMT_GAS, ACPI_WDAT0_OFFSET (RegisterRegion), "Register Region"},
|
||||
{ACPI_DMT_UINT32, ACPI_WDAT0_OFFSET (Value), "Value"},
|
||||
{ACPI_DMT_UINT32, ACPI_WDAT0_OFFSET (Mask), "Register Mask"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* WDRT - Watchdog Resource Table
|
||||
@ -1311,19 +1512,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[] =
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[] =
|
||||
{
|
||||
{ACPI_DMT_UINT32, ACPI_WDRT_OFFSET (HeaderLength), "Header Length"},
|
||||
{ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciSegment), "PCI Segment"},
|
||||
{ACPI_DMT_GAS, ACPI_WDRT_OFFSET (ControlRegister), "Control Register"},
|
||||
{ACPI_DMT_GAS, ACPI_WDRT_OFFSET (CountRegister), "Count Register"},
|
||||
{ACPI_DMT_UINT16, ACPI_WDRT_OFFSET (PciDeviceId), "PCI Device ID"},
|
||||
{ACPI_DMT_UINT16, ACPI_WDRT_OFFSET (PciVendorId), "PCI Vendor ID"},
|
||||
{ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciBus), "PCI Bus"},
|
||||
{ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciDevice), "PCI Device"},
|
||||
{ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciFunction), "PCI Function"},
|
||||
{ACPI_DMT_UINT32, ACPI_WDRT_OFFSET (TimerPeriod), "Timer Period"},
|
||||
{ACPI_DMT_UINT32, ACPI_WDRT_OFFSET (MaxCount), "Max Count"},
|
||||
{ACPI_DMT_UINT32, ACPI_WDRT_OFFSET (MinCount), "Min Count"},
|
||||
{ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (Flags), "Flags (decoded below)"},
|
||||
{ACPI_DMT_FLAG0, ACPI_WDRT_OFFSET (Flags), "Enabled"},
|
||||
{ACPI_DMT_FLAG7, ACPI_WDRT_OFFSET (Flags), "Stopped When Asleep"},
|
||||
{ACPI_DMT_UINT24, ACPI_WDRT_OFFSET (Reserved[0]), "Reserved"},
|
||||
{ACPI_DMT_UINT32, ACPI_WDRT_OFFSET (Entries), "Watchdog Entries"},
|
||||
{ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciSegment), "PCI Segment"},
|
||||
{ACPI_DMT_UINT16, ACPI_WDRT_OFFSET (MaxCount), "Max Count"},
|
||||
{ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (Units), "Counter Units"},
|
||||
{ACPI_DMT_EXIT, 0, NULL}
|
||||
};
|
||||
|
||||
|
@ -555,6 +555,10 @@ void
|
||||
AslAbort (
|
||||
void);
|
||||
|
||||
void
|
||||
FlAddIncludeDirectory (
|
||||
char *Dir);
|
||||
|
||||
void
|
||||
FlOpenIncludeFile (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
@ -386,6 +386,7 @@ NamePathTail [.]{NameSeg}
|
||||
"SMBus" { count (0); return (PARSEOP_REGIONSPACE_SMBUS); }
|
||||
"SystemCMOS" { count (0); return (PARSEOP_REGIONSPACE_CMOS); }
|
||||
"PciBarTarget" { count (0); return (PARSEOP_REGIONSPACE_PCIBAR); }
|
||||
"IPMI" { count (0); return (PARSEOP_REGIONSPACE_IPMI); }
|
||||
|
||||
"FFixedHW" { count (0); return (PARSEOP_ADDRESSSPACE_FFIXEDHW); }
|
||||
|
||||
|
@ -400,6 +400,7 @@ AslLocalAllocate (unsigned int Size);
|
||||
%token <i> PARSEOP_REGIONSPACE_CMOS
|
||||
%token <i> PARSEOP_REGIONSPACE_EC
|
||||
%token <i> PARSEOP_REGIONSPACE_IO
|
||||
%token <i> PARSEOP_REGIONSPACE_IPMI
|
||||
%token <i> PARSEOP_REGIONSPACE_MEM
|
||||
%token <i> PARSEOP_REGIONSPACE_PCI
|
||||
%token <i> PARSEOP_REGIONSPACE_PCIBAR
|
||||
@ -2175,6 +2176,7 @@ RegionSpaceKeyword
|
||||
| PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_SMBUS);}
|
||||
| PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_CMOS);}
|
||||
| PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCIBAR);}
|
||||
| PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);}
|
||||
;
|
||||
|
||||
AddressSpaceKeyword
|
||||
|
@ -128,7 +128,7 @@
|
||||
#define CompilerId "ASL Optimizing Compiler"
|
||||
#define DisassemblerId "AML Disassembler"
|
||||
#define CompilerCopyright "Copyright (C) 2000 - 2009 Intel Corporation"
|
||||
#define CompilerCompliance "Supports ACPI Specification Revision 3.0a"
|
||||
#define CompilerCompliance "Supports ACPI Specification Revision 4.0"
|
||||
#define CompilerName "iasl"
|
||||
#define CompilerCreatorId "INTL"
|
||||
|
||||
|
@ -128,10 +128,11 @@ FlOpenFile (
|
||||
char *Filename,
|
||||
char *Mode);
|
||||
|
||||
static FILE *
|
||||
FlOpenLocalFile (
|
||||
char *LocalName,
|
||||
char *Mode);
|
||||
FILE *
|
||||
FlOpenIncludeWithPrefix (
|
||||
char *PrefixDir,
|
||||
char *Filename);
|
||||
|
||||
|
||||
#ifdef ACPI_OBSOLETE_FUNCTIONS
|
||||
ACPI_STATUS
|
||||
@ -170,45 +171,6 @@ AslAbort (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: FlOpenLocalFile
|
||||
*
|
||||
* PARAMETERS: LocalName - Single filename (not a pathname)
|
||||
* Mode - Open mode for fopen
|
||||
*
|
||||
* RETURN: File descriptor
|
||||
*
|
||||
* DESCRIPTION: Build a complete pathname for the input filename and open
|
||||
* the file.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static FILE *
|
||||
FlOpenLocalFile (
|
||||
char *LocalName,
|
||||
char *Mode)
|
||||
{
|
||||
|
||||
StringBuffer[0] = 0;
|
||||
|
||||
/* Check for an absolute pathname */
|
||||
|
||||
if ((LocalName[0] != '/') && /* Forward slash */
|
||||
(LocalName[0] != '\\') && /* backslash (Win) */
|
||||
(LocalName[1] != ':')) /* Device name (Win) */
|
||||
{
|
||||
/* The include file path is relative, prepend the directory path */
|
||||
|
||||
strcat (StringBuffer, Gbl_DirectoryPath);
|
||||
}
|
||||
strcat (StringBuffer, LocalName);
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "FlOpenLocalFile: %s\n", StringBuffer);
|
||||
return (fopen (StringBuffer, (const char *) Mode));
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: FlFileError
|
||||
@ -479,6 +441,122 @@ FlSetLineNumber (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: FlAddIncludeDirectory
|
||||
*
|
||||
* PARAMETERS: Dir - Directory pathname string
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Add a directory the list of include prefix directories.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
FlAddIncludeDirectory (
|
||||
char *Dir)
|
||||
{
|
||||
ASL_INCLUDE_DIR *NewDir;
|
||||
ASL_INCLUDE_DIR *NextDir;
|
||||
ASL_INCLUDE_DIR *PrevDir = NULL;
|
||||
UINT32 NeedsSeparator = 0;
|
||||
size_t DirLength;
|
||||
|
||||
|
||||
DirLength = strlen (Dir);
|
||||
if (!DirLength)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Make sure that the pathname ends with a path separator */
|
||||
|
||||
if ((Dir[DirLength-1] != '/') &&
|
||||
(Dir[DirLength-1] != '\\'))
|
||||
{
|
||||
NeedsSeparator = 1;
|
||||
}
|
||||
|
||||
NewDir = ACPI_ALLOCATE_ZEROED (sizeof (ASL_INCLUDE_DIR));
|
||||
NewDir->Dir = ACPI_ALLOCATE (DirLength + 1 + NeedsSeparator);
|
||||
strcpy (NewDir->Dir, Dir);
|
||||
if (NeedsSeparator)
|
||||
{
|
||||
strcat (NewDir->Dir, "/");
|
||||
}
|
||||
|
||||
/*
|
||||
* Preserve command line ordering of -I options by adding new elements
|
||||
* at the end of the list
|
||||
*/
|
||||
NextDir = Gbl_IncludeDirList;
|
||||
while (NextDir)
|
||||
{
|
||||
PrevDir = NextDir;
|
||||
NextDir = NextDir->Next;
|
||||
}
|
||||
|
||||
if (PrevDir)
|
||||
{
|
||||
PrevDir->Next = NewDir;
|
||||
}
|
||||
else
|
||||
{
|
||||
Gbl_IncludeDirList = NewDir;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: FlOpenIncludeWithPrefix
|
||||
*
|
||||
* PARAMETERS: PrefixDir - Prefix directory pathname. Can be a zero
|
||||
* length string.
|
||||
* Filename - The include filename from the source ASL.
|
||||
*
|
||||
* RETURN: Valid file descriptor if successful. Null otherwise.
|
||||
*
|
||||
* DESCRIPTION: Open an include file and push it on the input file stack.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
FILE *
|
||||
FlOpenIncludeWithPrefix (
|
||||
char *PrefixDir,
|
||||
char *Filename)
|
||||
{
|
||||
FILE *IncludeFile;
|
||||
char *Pathname;
|
||||
|
||||
|
||||
/* Build the full pathname to the file */
|
||||
|
||||
Pathname = ACPI_ALLOCATE (strlen (PrefixDir) + strlen (Filename) + 1);
|
||||
|
||||
strcpy (Pathname, PrefixDir);
|
||||
strcat (Pathname, Filename);
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "\nAttempt to open include file: path %s\n\n",
|
||||
Pathname);
|
||||
|
||||
/* Attempt to open the file, push if successful */
|
||||
|
||||
IncludeFile = fopen (Pathname, "r");
|
||||
if (IncludeFile)
|
||||
{
|
||||
/* Push the include file on the open input file stack */
|
||||
|
||||
AslPushInputFileStack (IncludeFile, Pathname);
|
||||
return (IncludeFile);
|
||||
}
|
||||
|
||||
ACPI_FREE (Pathname);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: FlOpenIncludeFile
|
||||
@ -495,7 +573,8 @@ void
|
||||
FlOpenIncludeFile (
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
FILE *IncFile;
|
||||
FILE *IncludeFile;
|
||||
ASL_INCLUDE_DIR *NextDir;
|
||||
|
||||
|
||||
/* Op must be valid */
|
||||
@ -518,21 +597,58 @@ FlOpenIncludeFile (
|
||||
FlPrintFile (ASL_FILE_SOURCE_OUTPUT, "\n");
|
||||
Gbl_CurrentLineOffset++;
|
||||
|
||||
/* Prepend the directory pathname and open the include file */
|
||||
|
||||
DbgPrint (ASL_PARSE_OUTPUT, "\nOpen include file: path %s\n\n",
|
||||
Op->Asl.Value.String);
|
||||
IncFile = FlOpenLocalFile (Op->Asl.Value.String, "r");
|
||||
if (!IncFile)
|
||||
/* Attempt to open the include file */
|
||||
|
||||
/* If the file specifies an absolute path, just open it */
|
||||
|
||||
if ((Op->Asl.Value.String[0] == '/') ||
|
||||
(Op->Asl.Value.String[0] == '\\') ||
|
||||
(Op->Asl.Value.String[1] == ':'))
|
||||
{
|
||||
sprintf (MsgBuffer, "%s (%s)", Op->Asl.Value.String, strerror (errno));
|
||||
AslError (ASL_ERROR, ASL_MSG_INCLUDE_FILE_OPEN, Op, MsgBuffer);
|
||||
IncludeFile = FlOpenIncludeWithPrefix ("", Op->Asl.Value.String);
|
||||
if (!IncludeFile)
|
||||
{
|
||||
goto ErrorExit;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Push the include file on the open input file stack */
|
||||
/*
|
||||
* The include filename is not an absolute path.
|
||||
*
|
||||
* First, search for the file within the "local" directory -- meaning
|
||||
* the same directory that contains the source file.
|
||||
*
|
||||
* Construct the file pathname from the global directory name.
|
||||
*/
|
||||
IncludeFile = FlOpenIncludeWithPrefix (Gbl_DirectoryPath, Op->Asl.Value.String);
|
||||
if (IncludeFile)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AslPushInputFileStack (IncFile, Op->Asl.Value.String);
|
||||
/*
|
||||
* Second, search for the file within the (possibly multiple) directories
|
||||
* specified by the -I option on the command line.
|
||||
*/
|
||||
NextDir = Gbl_IncludeDirList;
|
||||
while (NextDir)
|
||||
{
|
||||
IncludeFile = FlOpenIncludeWithPrefix (NextDir->Dir, Op->Asl.Value.String);
|
||||
if (IncludeFile)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
NextDir = NextDir->Next;
|
||||
}
|
||||
|
||||
/* We could not open the include file after trying very hard */
|
||||
|
||||
ErrorExit:
|
||||
sprintf (MsgBuffer, "%s, %s", Op->Asl.Value.String, strerror (errno));
|
||||
AslError (ASL_ERROR, ASL_MSG_INCLUDE_FILE_OPEN, Op, MsgBuffer);
|
||||
}
|
||||
|
||||
|
||||
|
@ -148,7 +148,7 @@ extern char HexLookup[];
|
||||
#define ASL_LINE_BUFFER_SIZE 512
|
||||
#define ASL_MSG_BUFFER_SIZE 4096
|
||||
#define HEX_TABLE_LINE_SIZE 8
|
||||
#define HEX_LISTING_LINE_SIZE 16
|
||||
#define HEX_LISTING_LINE_SIZE 8
|
||||
|
||||
|
||||
/* Source code buffers and pointers for error reporting */
|
||||
@ -212,6 +212,7 @@ ASL_EXTERN char *Gbl_DirectoryPath;
|
||||
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_ExternalFilename, NULL);
|
||||
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_IncludeFilename, NULL);
|
||||
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_OutputFilenamePrefix, NULL);
|
||||
ASL_EXTERN ASL_INCLUDE_DIR ASL_INIT_GLOBAL (*Gbl_IncludeDirList, NULL);
|
||||
ASL_EXTERN char *Gbl_CurrentInputFilename;
|
||||
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_HasIncludeFiles, FALSE);
|
||||
|
@ -353,6 +353,7 @@ LdLoadResourceElements (
|
||||
|
||||
Node->Value = (UINT32) Op->Asl.Value.Integer;
|
||||
Node->Op = Op;
|
||||
Op->Asl.Node = Node;
|
||||
|
||||
/*
|
||||
* Now enter the predefined fields, for easy lookup when referenced
|
||||
|
@ -1337,6 +1337,7 @@ LkNamespaceLocateBegin (
|
||||
break;
|
||||
|
||||
case REGION_SMBUS:
|
||||
case REGION_IPMI:
|
||||
|
||||
if ((UINT8) Op->Asl.Parent->Asl.Value.Integer != AML_FIELD_ACCESS_BUFFER)
|
||||
{
|
||||
|
@ -150,6 +150,28 @@ AslCommandLine (
|
||||
int argc,
|
||||
char **argv);
|
||||
|
||||
static int
|
||||
AslDoOptions (
|
||||
int argc,
|
||||
char **argv,
|
||||
BOOLEAN IsResponseFile);
|
||||
|
||||
static void
|
||||
AslMergeOptionTokens (
|
||||
char *InBuffer,
|
||||
char *OutBuffer);
|
||||
|
||||
static int
|
||||
AslDoResponseFile (
|
||||
char *Filename);
|
||||
|
||||
extern int AcpiGbl_Opterr;
|
||||
extern int AcpiGbl_Optind;
|
||||
|
||||
|
||||
#define ASL_TOKEN_SEPARATORS " \t\n"
|
||||
#define ASL_SUPPORTED_OPTIONS "@:2b:cd^e:fgh^i^I:l^o:p:r:s:t:v:w:x:"
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -168,8 +190,12 @@ Options (
|
||||
void)
|
||||
{
|
||||
|
||||
printf ("General Output:\n");
|
||||
printf (" -p <prefix> Specify path/filename prefix for all output files\n");
|
||||
printf ("Global:\n");
|
||||
printf (" -@<file> Specify command file\n");
|
||||
printf (" -I<dir> Specify additional include directory\n");
|
||||
|
||||
printf ("\nGeneral Output:\n");
|
||||
printf (" -p<prefix> Specify path/filename prefix for all output files\n");
|
||||
printf (" -va Disable all errors and warnings (summary only)\n");
|
||||
printf (" -vi Less verbose errors and warnings for use with IDEs\n");
|
||||
printf (" -vo Enable optimization comments\n");
|
||||
@ -310,39 +336,149 @@ AslInitialize (
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslCommandLine
|
||||
* FUNCTION: AslMergeOptionTokens
|
||||
*
|
||||
* PARAMETERS: argc/argv
|
||||
* PARAMETERS: InBuffer - Input containing an option string
|
||||
* OutBuffer - Merged output buffer
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Command line processing
|
||||
* DESCRIPTION: Remove all whitespace from an option string.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
AslMergeOptionTokens (
|
||||
char *InBuffer,
|
||||
char *OutBuffer)
|
||||
{
|
||||
char *Token;
|
||||
|
||||
|
||||
*OutBuffer = 0;
|
||||
|
||||
Token = strtok (InBuffer, ASL_TOKEN_SEPARATORS);
|
||||
while (Token)
|
||||
{
|
||||
strcat (OutBuffer, Token);
|
||||
Token = strtok (NULL, ASL_TOKEN_SEPARATORS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslDoResponseFile
|
||||
*
|
||||
* PARAMETERS: Filename - Name of the response file
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Open a response file and process all options within.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static int
|
||||
AslCommandLine (
|
||||
int argc,
|
||||
char **argv)
|
||||
AslDoResponseFile (
|
||||
char *Filename)
|
||||
{
|
||||
char *argv = StringBuffer2;
|
||||
FILE *ResponseFile;
|
||||
int OptStatus = 0;
|
||||
int Opterr;
|
||||
int Optind;
|
||||
|
||||
|
||||
ResponseFile = fopen (Filename, "r");
|
||||
if (!ResponseFile)
|
||||
{
|
||||
printf ("Could not open command file %s, %s\n",
|
||||
Filename, strerror (errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Must save the current GetOpt globals */
|
||||
|
||||
Opterr = AcpiGbl_Opterr;
|
||||
Optind = AcpiGbl_Optind;
|
||||
|
||||
/*
|
||||
* Process all lines in the response file. There must be one complete
|
||||
* option per line
|
||||
*/
|
||||
while (fgets (StringBuffer, ASL_MSG_BUFFER_SIZE, ResponseFile))
|
||||
{
|
||||
/* Compress all tokens, allowing us to use a single argv entry */
|
||||
|
||||
AslMergeOptionTokens (StringBuffer, StringBuffer2);
|
||||
|
||||
/* Process the option */
|
||||
|
||||
AcpiGbl_Opterr = 0;
|
||||
AcpiGbl_Optind = 0;
|
||||
|
||||
OptStatus = AslDoOptions (1, &argv, TRUE);
|
||||
if (OptStatus)
|
||||
{
|
||||
printf ("Invalid option in command file %s: %s\n",
|
||||
Filename, StringBuffer);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Restore the GetOpt globals */
|
||||
|
||||
AcpiGbl_Opterr = Opterr;
|
||||
AcpiGbl_Optind = Optind;
|
||||
|
||||
fclose (ResponseFile);
|
||||
return (OptStatus);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslDoOptions
|
||||
*
|
||||
* PARAMETERS: argc/argv - Standard argc/argv
|
||||
* IsResponseFile - TRUE if executing a response file.
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Command line option processing
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static int
|
||||
AslDoOptions (
|
||||
int argc,
|
||||
char **argv,
|
||||
BOOLEAN IsResponseFile)
|
||||
{
|
||||
BOOLEAN BadCommandLine = FALSE;
|
||||
int j;
|
||||
|
||||
|
||||
/* Minimum command line contains at least one option or an input file */
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
AslCompilerSignon (ASL_FILE_STDOUT);
|
||||
Usage ();
|
||||
exit (1);
|
||||
}
|
||||
|
||||
/* Get the command line options */
|
||||
|
||||
while ((j = AcpiGetopt (argc, argv, "2b:cd^e:fgh^i^l^o:p:r:s:t:v:w:x:")) != EOF) switch (j)
|
||||
while ((j = AcpiGetopt (argc, argv, ASL_SUPPORTED_OPTIONS)) != EOF) switch (j)
|
||||
{
|
||||
case '@': /* Begin a response file */
|
||||
|
||||
if (IsResponseFile)
|
||||
{
|
||||
printf ("Nested command files are not supported\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (AslDoResponseFile (AcpiGbl_Optarg))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case '2':
|
||||
|
||||
Gbl_Acpi2 = TRUE;
|
||||
break;
|
||||
|
||||
@ -364,8 +500,7 @@ AslCommandLine (
|
||||
|
||||
default:
|
||||
printf ("Unknown option: -b%s\n", AcpiGbl_Optarg);
|
||||
BadCommandLine = TRUE;
|
||||
break;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Produce debug output file */
|
||||
@ -394,8 +529,7 @@ AslCommandLine (
|
||||
|
||||
default:
|
||||
printf ("Unknown option: -d%s\n", AcpiGbl_Optarg);
|
||||
BadCommandLine = TRUE;
|
||||
break;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
Gbl_DisasmFlag = TRUE;
|
||||
@ -444,12 +578,17 @@ AslCommandLine (
|
||||
|
||||
default:
|
||||
printf ("Unknown option: -h%s\n", AcpiGbl_Optarg);
|
||||
BadCommandLine = TRUE;
|
||||
break;
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'I': /* Add an include file search directory */
|
||||
|
||||
FlAddIncludeDirectory (AcpiGbl_Optarg);
|
||||
break;
|
||||
|
||||
|
||||
case 'i':
|
||||
|
||||
switch (AcpiGbl_Optarg[0])
|
||||
@ -470,8 +609,7 @@ AslCommandLine (
|
||||
|
||||
default:
|
||||
printf ("Unknown option: -s%s\n", AcpiGbl_Optarg);
|
||||
BadCommandLine = TRUE;
|
||||
break;
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -500,8 +638,7 @@ AslCommandLine (
|
||||
|
||||
default:
|
||||
printf ("Unknown option: -l%s\n", AcpiGbl_Optarg);
|
||||
BadCommandLine = TRUE;
|
||||
break;
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -549,8 +686,7 @@ AslCommandLine (
|
||||
|
||||
default:
|
||||
printf ("Unknown option: -c%s\n", AcpiGbl_Optarg);
|
||||
BadCommandLine = TRUE;
|
||||
break;
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -589,8 +725,7 @@ AslCommandLine (
|
||||
|
||||
default:
|
||||
printf ("Unknown option: -s%s\n", AcpiGbl_Optarg);
|
||||
BadCommandLine = TRUE;
|
||||
break;
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -611,8 +746,7 @@ AslCommandLine (
|
||||
|
||||
default:
|
||||
printf ("Unknown option: -t%s\n", AcpiGbl_Optarg);
|
||||
BadCommandLine = TRUE;
|
||||
break;
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -647,8 +781,7 @@ AslCommandLine (
|
||||
|
||||
default:
|
||||
printf ("Unknown option: -v%s\n", AcpiGbl_Optarg);
|
||||
BadCommandLine = TRUE;
|
||||
break;
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -671,8 +804,7 @@ AslCommandLine (
|
||||
|
||||
default:
|
||||
printf ("Unknown option: -w%s\n", AcpiGbl_Optarg);
|
||||
BadCommandLine = TRUE;
|
||||
break;
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -685,10 +817,46 @@ AslCommandLine (
|
||||
|
||||
default:
|
||||
|
||||
BadCommandLine = TRUE;
|
||||
break;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslCommandLine
|
||||
*
|
||||
* PARAMETERS: argc/argv
|
||||
*
|
||||
* RETURN: Last argv index
|
||||
*
|
||||
* DESCRIPTION: Command line processing
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static int
|
||||
AslCommandLine (
|
||||
int argc,
|
||||
char **argv)
|
||||
{
|
||||
int BadCommandLine = 0;
|
||||
|
||||
|
||||
/* Minimum command line contains at least the command and an input file */
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
AslCompilerSignon (ASL_FILE_STDOUT);
|
||||
Usage ();
|
||||
exit (1);
|
||||
}
|
||||
|
||||
/* Process all command line options */
|
||||
|
||||
BadCommandLine = AslDoOptions (argc, argv, FALSE);
|
||||
|
||||
/* Next parameter must be the input filename */
|
||||
|
||||
if (!argv[AcpiGbl_Optind] &&
|
||||
|
@ -232,7 +232,8 @@ MpDisplayReservedNames (
|
||||
*
|
||||
* Name - The ACPI reserved name
|
||||
* Args - Number of arguments to the method
|
||||
* Flags - Whether this method must return a value or not
|
||||
* Flags - Whether this method must return a value or not. Or if the
|
||||
* name is a resource descriptor label.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -264,24 +265,30 @@ const ASL_RESERVED_INFO ReservedMethods[] = {
|
||||
{"_ALP", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */
|
||||
{"_ALR", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */
|
||||
{"_ALT", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */
|
||||
{"_ART", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_ASI", 0, ASL_RSVD_RESOURCE_NAME},
|
||||
{"_ASZ", 0, ASL_RSVD_RESOURCE_NAME},
|
||||
{"_BAS", 0, ASL_RSVD_RESOURCE_NAME},
|
||||
{"_BBN", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_BCL", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_BCM", 1, 0},
|
||||
{"_BCT", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_BDN", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_BFS", 1, 0},
|
||||
{"_BIF", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_BIX", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_BLT", 3, 0}, /* Acpi 3.0 */
|
||||
{"_BM_", 0, ASL_RSVD_RESOURCE_NAME},
|
||||
{"_BMA", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_BMC", 1, 0}, /* Acpi 3.0 */
|
||||
{"_BMD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */
|
||||
{"_BMS", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_BQC", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */
|
||||
{"_BST", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_BTM", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */
|
||||
{"_BTP", 1, 0},
|
||||
{"_CBA", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */
|
||||
{"_CDM", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_CID", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_CRS", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_CRT", 0, ASL_RSVD_RETURN_VALUE},
|
||||
@ -300,6 +307,7 @@ const ASL_RESERVED_INFO ReservedMethods[] = {
|
||||
{"_DSM", 4, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */
|
||||
{"_DSS", 1, 0},
|
||||
{"_DSW", 3, 0}, /* Acpi 3.0 */
|
||||
{"_DTI", 1, 0}, /* Acpi 4.0 */
|
||||
{"_EC_", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_EDL", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_EJ0", 1, 0},
|
||||
@ -312,7 +320,13 @@ const ASL_RESERVED_INFO ReservedMethods[] = {
|
||||
{"_FDE", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_FDI", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_FDM", 1, 0},
|
||||
{"_FIF", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_FIX", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_FPS", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_FSL", 1, 0}, /* Acpi 4.0 */
|
||||
{"_FST", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_GAI", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_GHL", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_GL_", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_GLK", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_GPD", 0, ASL_RSVD_RETURN_VALUE},
|
||||
@ -338,28 +352,39 @@ const ASL_RESERVED_INFO ReservedMethods[] = {
|
||||
{"_MAF", 0, ASL_RSVD_RESOURCE_NAME},
|
||||
{"_MAT", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_MAX", 0, ASL_RSVD_RESOURCE_NAME},
|
||||
{"_MBM", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_MEM", 0, ASL_RSVD_RESOURCE_NAME},
|
||||
{"_MIF", 0, ASL_RSVD_RESOURCE_NAME},
|
||||
{"_MIN", 0, ASL_RSVD_RESOURCE_NAME},
|
||||
{"_MLS", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */
|
||||
{"_MSG", 1, 0},
|
||||
{"_MSM", 4, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_MTP", 0, ASL_RSVD_RESOURCE_NAME},
|
||||
{"_NTT", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_OFF", 0, 0},
|
||||
{"_ON_", 0, 0},
|
||||
{"_OS_", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_OSC", 4, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */
|
||||
{"_OSI", 1, ASL_RSVD_RETURN_VALUE},
|
||||
{"_OST", 3, 0}, /* Acpi 3.0 */
|
||||
{"_PAI", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_PCL", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_PCT", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_PDC", 1, 0},
|
||||
{"_PDL", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_PIC", 1, 0},
|
||||
{"_PIF", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_PLD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */
|
||||
{"_PMC", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_PMD", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_PMM", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_PPC", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_PPE", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */
|
||||
{"_PR0", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_PR1", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_PR2", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_PR3", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_PRL", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_PRS", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_PRT", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_PRW", 0, ASL_RSVD_RETURN_VALUE},
|
||||
@ -375,7 +400,9 @@ const ASL_RESERVED_INFO ReservedMethods[] = {
|
||||
{"_PSV", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_PSW", 1, 0},
|
||||
{"_PTC", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_PTP", 2, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_PTS", 1, 0},
|
||||
{"_PUR", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_PXM", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_RBO", 0, ASL_RSVD_RESOURCE_NAME},
|
||||
{"_RBW", 0, ASL_RSVD_RESOURCE_NAME},
|
||||
@ -407,6 +434,7 @@ const ASL_RESERVED_INFO ReservedMethods[] = {
|
||||
{"_SCP", 0x13, 0}, /* Acpi 1.0 - one arg; Acpi 3.0 - three args */
|
||||
{"_SDD", 1, 0}, /* Acpi 3.0 */
|
||||
{"_SEG", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_SHL", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_SHR", 0, ASL_RSVD_RESOURCE_NAME},
|
||||
{"_SI_", 0, ASL_RSVD_SCOPE},
|
||||
{"_SIZ", 0, ASL_RSVD_RESOURCE_NAME},
|
||||
@ -417,12 +445,16 @@ const ASL_RESERVED_INFO ReservedMethods[] = {
|
||||
{"_SST", 1, 0},
|
||||
{"_STA", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_STM", 3, 0},
|
||||
{"_STP", 2, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_STR", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_STV", 2, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_SUN", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_SWS", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */
|
||||
{"_TC1", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_TC2", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_TDL", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0b */
|
||||
{"_TIP", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_TIV", 1, ASL_RSVD_RETURN_VALUE}, /* Acpi 4.0 */
|
||||
{"_TMP", 0, ASL_RSVD_RETURN_VALUE},
|
||||
{"_TPC", 0, ASL_RSVD_RETURN_VALUE}, /* Acpi 3.0 */
|
||||
{"_TPT", 1, 0}, /* Acpi 3.0 */
|
||||
@ -681,6 +713,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
|
||||
/* REGIONSPACE_CMOS */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_CMOS, 0, 0),
|
||||
/* REGIONSPACE_EC */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_EC, 0, 0),
|
||||
/* REGIONSPACE_IO */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_IO, 0, 0),
|
||||
/* REGIONSPACE_IPMI */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_IPMI, 0, 0),
|
||||
/* REGIONSPACE_MEM */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_MEMORY, 0, 0),
|
||||
/* REGIONSPACE_PCI */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_PCI_CONFIG, 0, 0),
|
||||
/* REGIONSPACE_PCIBAR */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, REGION_PCI_BAR, 0, 0),
|
||||
|
@ -119,6 +119,7 @@
|
||||
#include <contrib/dev/acpica/include/actables.h>
|
||||
#include <contrib/dev/acpica/include/acevents.h>
|
||||
#include <contrib/dev/acpica/include/acinterp.h>
|
||||
#include "acnamesp.h"
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("aslstubs")
|
||||
@ -136,6 +137,12 @@ AeLocalGetRootPointer (
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
AcpiNsExecModuleCodeList (
|
||||
void)
|
||||
{
|
||||
}
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwReadPort (
|
||||
ACPI_IO_ADDRESS Address,
|
||||
|
@ -255,6 +255,14 @@ typedef enum
|
||||
#define ASL_NUM_FILES (ASL_MAX_FILE_TYPE + 1)
|
||||
|
||||
|
||||
typedef struct asl_include_dir
|
||||
{
|
||||
char *Dir;
|
||||
struct asl_include_dir *Next;
|
||||
|
||||
} ASL_INCLUDE_DIR;
|
||||
|
||||
|
||||
/* An entry in the exception list, one for each error/warning */
|
||||
|
||||
typedef struct asl_error_msg
|
||||
|
@ -500,17 +500,16 @@ AcpiDbWalkForExecute (
|
||||
void *Context,
|
||||
void **ReturnValue)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
|
||||
UINT32 *Count = (UINT32 *) Context;
|
||||
const ACPI_PREDEFINED_INFO *Predefined;
|
||||
ACPI_BUFFER ReturnObj;
|
||||
ACPI_STATUS Status;
|
||||
char *Pathname;
|
||||
ACPI_BUFFER Buffer;
|
||||
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
|
||||
UINT32 *Count = (UINT32 *) Context;
|
||||
ACPI_BUFFER ReturnObj;
|
||||
ACPI_STATUS Status;
|
||||
char *Pathname;
|
||||
UINT32 i;
|
||||
ACPI_DEVICE_INFO *ObjInfo;
|
||||
ACPI_OBJECT_LIST ParamObjects;
|
||||
ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS];
|
||||
const ACPI_PREDEFINED_INFO *Predefined;
|
||||
|
||||
|
||||
Predefined = AcpiNsCheckForPredefinedName (Node);
|
||||
@ -532,8 +531,7 @@ AcpiDbWalkForExecute (
|
||||
|
||||
/* Get the object info for number of method parameters */
|
||||
|
||||
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
|
||||
Status = AcpiGetObjectInfo (ObjHandle, &Buffer);
|
||||
Status = AcpiGetObjectInfo (ObjHandle, &ObjInfo);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
@ -542,7 +540,6 @@ AcpiDbWalkForExecute (
|
||||
ParamObjects.Pointer = NULL;
|
||||
ParamObjects.Count = 0;
|
||||
|
||||
ObjInfo = Buffer.Pointer;
|
||||
if (ObjInfo->Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
|
||||
@ -558,7 +555,7 @@ AcpiDbWalkForExecute (
|
||||
ParamObjects.Count = ObjInfo->ParamCount;
|
||||
}
|
||||
|
||||
ACPI_FREE (Buffer.Pointer);
|
||||
ACPI_FREE (ObjInfo);
|
||||
|
||||
ReturnObj.Pointer = NULL;
|
||||
ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
|
||||
@ -1997,12 +1994,17 @@ AcpiDbBusWalk (
|
||||
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_BUFFER Buffer;
|
||||
ACPI_INTEGER ADR;
|
||||
ACPI_DEVICE_ID Id;
|
||||
ACPI_COMPATIBLE_ID_LIST *Cid;
|
||||
ACPI_NAMESPACE_NODE *TempNode;
|
||||
ACPI_DEVICE_INFO *Info;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
if ((Node->Type != ACPI_TYPE_DEVICE) &&
|
||||
(Node->Type != ACPI_TYPE_PROCESSOR))
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* Exit if there is no _PRT under this device */
|
||||
|
||||
Status = AcpiGetHandle (Node, METHOD_NAME__PRT,
|
||||
@ -2022,57 +2024,70 @@ AcpiDbBusWalk (
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
Status = AcpiGetObjectInfo (ObjHandle, &Info);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* Display the full path */
|
||||
|
||||
AcpiOsPrintf ("%-32s", (char *) Buffer.Pointer);
|
||||
AcpiOsPrintf ("%-32s Type %X", (char *) Buffer.Pointer, Node->Type);
|
||||
ACPI_FREE (Buffer.Pointer);
|
||||
|
||||
if (Info->Flags & ACPI_PCI_ROOT_BRIDGE)
|
||||
{
|
||||
AcpiOsPrintf (" - Is PCI Root Bridge");
|
||||
}
|
||||
AcpiOsPrintf ("\n");
|
||||
|
||||
/* _PRT info */
|
||||
|
||||
AcpiOsPrintf ("_PRT=%p", TempNode);
|
||||
AcpiOsPrintf ("_PRT: %p\n", TempNode);
|
||||
|
||||
/* Get the _ADR value */
|
||||
/* Dump _ADR, _HID, _UID, _CID */
|
||||
|
||||
Status = AcpiUtEvaluateNumericObject (METHOD_NAME__ADR, Node, &ADR);
|
||||
if (ACPI_FAILURE (Status))
|
||||
if (Info->Valid & ACPI_VALID_ADR)
|
||||
{
|
||||
AcpiOsPrintf (" No _ADR ");
|
||||
AcpiOsPrintf ("_ADR: %8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Info->Address));
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf (" _ADR=%8.8X", (UINT32) ADR);
|
||||
AcpiOsPrintf ("_ADR: <Not Present>\n");
|
||||
}
|
||||
|
||||
/* Get the _HID if present */
|
||||
|
||||
Status = AcpiUtExecute_HID (Node, &Id);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
if (Info->Valid & ACPI_VALID_HID)
|
||||
{
|
||||
AcpiOsPrintf (" _HID=%s", Id.Value);
|
||||
AcpiOsPrintf ("_HID: %s\n", Info->HardwareId.String);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf (" ");
|
||||
AcpiOsPrintf ("_HID: <Not Present>\n");
|
||||
}
|
||||
|
||||
/* Get the _UID if present */
|
||||
|
||||
Status = AcpiUtExecute_UID (Node, &Id);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
if (Info->Valid & ACPI_VALID_UID)
|
||||
{
|
||||
AcpiOsPrintf (" _UID=%s", Id.Value);
|
||||
AcpiOsPrintf ("_UID: %s\n", Info->UniqueId.String);
|
||||
}
|
||||
|
||||
/* Get the _CID if present */
|
||||
|
||||
Status = AcpiUtExecute_CID (Node, &Cid);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf (" _CID=%s", Cid->Id[0].Value);
|
||||
ACPI_FREE (Cid);
|
||||
AcpiOsPrintf ("_UID: <Not Present>\n");
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
if (Info->Valid & ACPI_VALID_CID)
|
||||
{
|
||||
for (i = 0; i < Info->CompatibleIdList.Count; i++)
|
||||
{
|
||||
AcpiOsPrintf ("_CID: %s\n",
|
||||
Info->CompatibleIdList.Ids[i].String);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("_CID: <Not Present>\n");
|
||||
}
|
||||
|
||||
ACPI_FREE (Info);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
@ -2095,7 +2110,7 @@ AcpiDbGetBusInfo (
|
||||
{
|
||||
/* Search all nodes in namespace */
|
||||
|
||||
(void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
|
||||
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
|
||||
AcpiDbBusWalk, NULL, NULL);
|
||||
}
|
||||
|
||||
|
@ -682,42 +682,52 @@ AcpiDbDisplayObjectType (
|
||||
char *ObjectArg)
|
||||
{
|
||||
ACPI_HANDLE Handle;
|
||||
ACPI_BUFFER Buffer;
|
||||
ACPI_DEVICE_INFO *Info;
|
||||
ACPI_STATUS Status;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
Handle = ACPI_TO_POINTER (ACPI_STRTOUL (ObjectArg, NULL, 16));
|
||||
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
|
||||
|
||||
Status = AcpiGetObjectInfo (Handle, &Buffer);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
Status = AcpiGetObjectInfo (Handle, &Info);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
Info = Buffer.Pointer;
|
||||
AcpiOsPrintf (
|
||||
"S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X HID: %s, ADR: %8.8X%8.8X, Status %8.8X\n",
|
||||
Info->HighestDstates[0], Info->HighestDstates[1],
|
||||
Info->HighestDstates[2], Info->HighestDstates[3],
|
||||
Info->HardwareId.Value,
|
||||
ACPI_FORMAT_UINT64 (Info->Address),
|
||||
Info->CurrentStatus);
|
||||
AcpiOsPrintf ("Could not get object info, %s\n",
|
||||
AcpiFormatException (Status));
|
||||
return;
|
||||
}
|
||||
|
||||
if (Info->Valid & ACPI_VALID_CID)
|
||||
AcpiOsPrintf ("ADR: %8.8X%8.8X, STA: %8.8X, Flags: %X\n",
|
||||
ACPI_FORMAT_UINT64 (Info->Address),
|
||||
Info->CurrentStatus, Info->Flags);
|
||||
|
||||
AcpiOsPrintf ("S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X\n",
|
||||
Info->HighestDstates[0], Info->HighestDstates[1],
|
||||
Info->HighestDstates[2], Info->HighestDstates[3]);
|
||||
|
||||
AcpiOsPrintf ("S0W-%2.2X S1W-%2.2X S2W-%2.2X S3W-%2.2X S4W-%2.2X\n",
|
||||
Info->LowestDstates[0], Info->LowestDstates[1],
|
||||
Info->LowestDstates[2], Info->LowestDstates[3],
|
||||
Info->LowestDstates[4]);
|
||||
|
||||
if (Info->Valid & ACPI_VALID_HID)
|
||||
{
|
||||
AcpiOsPrintf ("HID: %s\n", Info->HardwareId.String);
|
||||
}
|
||||
if (Info->Valid & ACPI_VALID_UID)
|
||||
{
|
||||
AcpiOsPrintf ("UID: %s\n", Info->UniqueId.String);
|
||||
}
|
||||
if (Info->Valid & ACPI_VALID_CID)
|
||||
{
|
||||
for (i = 0; i < Info->CompatibleIdList.Count; i++)
|
||||
{
|
||||
for (i = 0; i < Info->CompatibilityId.Count; i++)
|
||||
{
|
||||
AcpiOsPrintf ("CID #%d: %s\n", i,
|
||||
Info->CompatibilityId.Id[i].Value);
|
||||
}
|
||||
AcpiOsPrintf ("CID %d: %s\n", i,
|
||||
Info->CompatibleIdList.Ids[i].String);
|
||||
}
|
||||
}
|
||||
|
||||
ACPI_FREE (Info);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("%s\n", AcpiFormatException (Status));
|
||||
}
|
||||
ACPI_FREE (Info);
|
||||
}
|
||||
|
||||
|
||||
|
@ -176,7 +176,6 @@ AcpiDbExecuteMethod (
|
||||
ACPI_OBJECT_LIST ParamObjects;
|
||||
ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS];
|
||||
ACPI_HANDLE Handle;
|
||||
ACPI_BUFFER Buffer;
|
||||
UINT32 i;
|
||||
ACPI_DEVICE_INFO *ObjInfo;
|
||||
|
||||
@ -196,8 +195,7 @@ AcpiDbExecuteMethod (
|
||||
|
||||
/* Get the object info for number of method parameters */
|
||||
|
||||
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
|
||||
Status = AcpiGetObjectInfo (Handle, &Buffer);
|
||||
Status = AcpiGetObjectInfo (Handle, &ObjInfo);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
@ -206,7 +204,6 @@ AcpiDbExecuteMethod (
|
||||
ParamObjects.Pointer = NULL;
|
||||
ParamObjects.Count = 0;
|
||||
|
||||
ObjInfo = Buffer.Pointer;
|
||||
if (ObjInfo->Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
/* Are there arguments to the method? */
|
||||
@ -256,7 +253,7 @@ AcpiDbExecuteMethod (
|
||||
}
|
||||
}
|
||||
|
||||
ACPI_FREE (Buffer.Pointer);
|
||||
ACPI_FREE (ObjInfo);
|
||||
|
||||
/* Prepare for a return object of arbitrary size */
|
||||
|
||||
|
@ -211,9 +211,12 @@ AcpiDsCreateBufferField (
|
||||
Flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
|
||||
ACPI_NS_ERROR_IF_FOUND;
|
||||
|
||||
/* Mark node temporary if we are executing a method */
|
||||
|
||||
if (WalkState->MethodNode)
|
||||
/*
|
||||
* Mark node temporary if we are executing a normal control
|
||||
* method. (Don't mark if this is a module-level code method)
|
||||
*/
|
||||
if (WalkState->MethodNode &&
|
||||
!(WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL))
|
||||
{
|
||||
Flags |= ACPI_NS_TEMPORARY;
|
||||
}
|
||||
@ -566,9 +569,12 @@ AcpiDsInitFieldObjects (
|
||||
Flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
|
||||
ACPI_NS_ERROR_IF_FOUND;
|
||||
|
||||
/* Mark node(s) temporary if we are executing a method */
|
||||
|
||||
if (WalkState->MethodNode)
|
||||
/*
|
||||
* Mark node(s) temporary if we are executing a normal control
|
||||
* method. (Don't mark if this is a module-level code method)
|
||||
*/
|
||||
if (WalkState->MethodNode &&
|
||||
!(WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL))
|
||||
{
|
||||
Flags |= ACPI_NS_TEMPORARY;
|
||||
}
|
||||
|
@ -693,10 +693,15 @@ AcpiDsTerminateControlMethod (
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete any namespace objects created anywhere within
|
||||
* the namespace by the execution of this method
|
||||
* Delete any namespace objects created anywhere within the
|
||||
* namespace by the execution of this method. Unless this method
|
||||
* is a module-level executable code method, in which case we
|
||||
* want make the objects permanent.
|
||||
*/
|
||||
AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId);
|
||||
if (!(MethodDesc->Method.Flags & AOPOBJ_MODULE_LEVEL))
|
||||
{
|
||||
AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId);
|
||||
}
|
||||
}
|
||||
|
||||
/* Decrement the thread count on the method */
|
||||
@ -745,7 +750,10 @@ AcpiDsTerminateControlMethod (
|
||||
|
||||
/* No more threads, we can free the OwnerId */
|
||||
|
||||
AcpiUtReleaseOwnerId (&MethodDesc->Method.OwnerId);
|
||||
if (!(MethodDesc->Method.Flags & AOPOBJ_MODULE_LEVEL))
|
||||
{
|
||||
AcpiUtReleaseOwnerId (&MethodDesc->Method.OwnerId);
|
||||
}
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
|
@ -548,9 +548,10 @@ AcpiDsMethodDataGetValue (
|
||||
|
||||
case ACPI_REFCLASS_LOCAL:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Uninitialized Local[%d] at node %p", Index, Node));
|
||||
|
||||
/*
|
||||
* No error message for this case, will be trapped again later to
|
||||
* detect and ignore cases of Store(LocalX,LocalX)
|
||||
*/
|
||||
return_ACPI_STATUS (AE_AML_UNINITIALIZED_LOCAL);
|
||||
|
||||
default:
|
||||
|
@ -570,15 +570,28 @@ AcpiDsBuildInternalPackageObj (
|
||||
{
|
||||
/*
|
||||
* NumElements was exhausted, but there are remaining elements in the
|
||||
* PackageList.
|
||||
* PackageList. Truncate the package to NumElements.
|
||||
*
|
||||
* Note: technically, this is an error, from ACPI spec: "It is an error
|
||||
* for NumElements to be less than the number of elements in the
|
||||
* PackageList". However, for now, we just print an error message and
|
||||
* no exception is returned.
|
||||
* PackageList". However, we just print an error message and
|
||||
* no exception is returned. This provides Windows compatibility. Some
|
||||
* BIOSs will alter the NumElements on the fly, creating this type
|
||||
* of ill-formed package object.
|
||||
*/
|
||||
while (Arg)
|
||||
{
|
||||
/*
|
||||
* We must delete any package elements that were created earlier
|
||||
* and are not going to be used because of the package truncation.
|
||||
*/
|
||||
if (Arg->Common.Node)
|
||||
{
|
||||
AcpiUtRemoveReference (
|
||||
ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node));
|
||||
Arg->Common.Node = NULL;
|
||||
}
|
||||
|
||||
/* Find out how many elements there really are */
|
||||
|
||||
i++;
|
||||
@ -586,7 +599,7 @@ AcpiDsBuildInternalPackageObj (
|
||||
}
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Package List length (%X) larger than NumElements count (%X), truncated\n",
|
||||
"Package List length (0x%X) larger than NumElements count (0x%X), truncated\n",
|
||||
i, ElementCount));
|
||||
}
|
||||
else if (i < ElementCount)
|
||||
@ -596,7 +609,7 @@ AcpiDsBuildInternalPackageObj (
|
||||
* Note: this is not an error, the package is padded out with NULLs.
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Package List length (%X) smaller than NumElements count (%X), padded with null elements\n",
|
||||
"Package List length (0x%X) smaller than NumElements count (0x%X), padded with null elements\n",
|
||||
i, ElementCount));
|
||||
}
|
||||
|
||||
|
@ -672,20 +672,6 @@ AcpiDsLoad2BeginOp (
|
||||
(WalkState->Opcode != AML_INT_NAMEPATH_OP)) ||
|
||||
(!(WalkState->OpInfo->Flags & AML_NAMED)))
|
||||
{
|
||||
#ifdef ACPI_ENABLE_MODULE_LEVEL_CODE
|
||||
if ((WalkState->OpInfo->Class == AML_CLASS_EXECUTE) ||
|
||||
(WalkState->OpInfo->Class == AML_CLASS_CONTROL))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Begin/EXEC: %s (fl %8.8X)\n", WalkState->OpInfo->Name,
|
||||
WalkState->OpInfo->Flags));
|
||||
|
||||
/* Executing a type1 or type2 opcode outside of a method */
|
||||
|
||||
Status = AcpiDsExecBeginOp (WalkState, OutOp);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
#endif
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
@ -862,7 +848,12 @@ AcpiDsLoad2BeginOp (
|
||||
{
|
||||
/* Execution mode, node cannot already exist, node is temporary */
|
||||
|
||||
Flags |= (ACPI_NS_ERROR_IF_FOUND | ACPI_NS_TEMPORARY);
|
||||
Flags |= ACPI_NS_ERROR_IF_FOUND;
|
||||
|
||||
if (!(WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL))
|
||||
{
|
||||
Flags |= ACPI_NS_TEMPORARY;
|
||||
}
|
||||
}
|
||||
|
||||
/* Add new entry or lookup existing entry */
|
||||
@ -952,24 +943,6 @@ AcpiDsLoad2EndOp (
|
||||
|
||||
if (!(WalkState->OpInfo->Flags & AML_NSOBJECT))
|
||||
{
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
#ifdef ACPI_ENABLE_MODULE_LEVEL_CODE
|
||||
/* No namespace object. Executable opcode? */
|
||||
|
||||
if ((WalkState->OpInfo->Class == AML_CLASS_EXECUTE) ||
|
||||
(WalkState->OpInfo->Class == AML_CLASS_CONTROL))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"End/EXEC: %s (fl %8.8X)\n", WalkState->OpInfo->Name,
|
||||
WalkState->OpInfo->Flags));
|
||||
|
||||
/* Executing a type1 or type2 opcode outside of a method */
|
||||
|
||||
Status = AcpiDsExecEndOp (WalkState);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
@ -543,7 +543,7 @@ AcpiEvGpeDetect (
|
||||
|
||||
/* Read the Status Register */
|
||||
|
||||
Status = AcpiRead (&StatusReg, &GpeRegisterInfo->StatusAddress);
|
||||
Status = AcpiHwRead (&StatusReg, &GpeRegisterInfo->StatusAddress);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto UnlockAndExit;
|
||||
@ -551,7 +551,7 @@ AcpiEvGpeDetect (
|
||||
|
||||
/* Read the Enable Register */
|
||||
|
||||
Status = AcpiRead (&EnableReg, &GpeRegisterInfo->EnableAddress);
|
||||
Status = AcpiHwRead (&EnableReg, &GpeRegisterInfo->EnableAddress);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto UnlockAndExit;
|
||||
|
@ -995,7 +995,7 @@ AcpiEvCreateGpeInfoBlocks (
|
||||
|
||||
/* Disable all GPEs within this register */
|
||||
|
||||
Status = AcpiWrite (0x00, &ThisRegister->EnableAddress);
|
||||
Status = AcpiHwWrite (0x00, &ThisRegister->EnableAddress);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto ErrorExit;
|
||||
@ -1003,7 +1003,7 @@ AcpiEvCreateGpeInfoBlocks (
|
||||
|
||||
/* Clear any pending GPE events within this register */
|
||||
|
||||
Status = AcpiWrite (0xFF, &ThisRegister->StatusAddress);
|
||||
Status = AcpiHwWrite (0xFF, &ThisRegister->StatusAddress);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto ErrorExit;
|
||||
|
@ -126,10 +126,6 @@
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static BOOLEAN
|
||||
AcpiEvMatchPciRootBridge (
|
||||
char *Id);
|
||||
|
||||
static BOOLEAN
|
||||
AcpiEvIsPciRootBridge (
|
||||
ACPI_NAMESPACE_NODE *Node);
|
||||
@ -442,42 +438,6 @@ AcpiEvPciConfigRegionSetup (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvMatchPciRootBridge
|
||||
*
|
||||
* PARAMETERS: Id - The HID/CID in string format
|
||||
*
|
||||
* RETURN: TRUE if the Id is a match for a PCI/PCI-Express Root Bridge
|
||||
*
|
||||
* DESCRIPTION: Determine if the input ID is a PCI Root Bridge ID.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static BOOLEAN
|
||||
AcpiEvMatchPciRootBridge (
|
||||
char *Id)
|
||||
{
|
||||
|
||||
/*
|
||||
* Check if this is a PCI root.
|
||||
* ACPI 3.0+: check for a PCI Express root also.
|
||||
*/
|
||||
if (!(ACPI_STRNCMP (Id,
|
||||
PCI_ROOT_HID_STRING,
|
||||
sizeof (PCI_ROOT_HID_STRING))) ||
|
||||
|
||||
!(ACPI_STRNCMP (Id,
|
||||
PCI_EXPRESS_ROOT_HID_STRING,
|
||||
sizeof (PCI_EXPRESS_ROOT_HID_STRING))))
|
||||
{
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvIsPciRootBridge
|
||||
@ -496,9 +456,10 @@ AcpiEvIsPciRootBridge (
|
||||
ACPI_NAMESPACE_NODE *Node)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_DEVICE_ID Hid;
|
||||
ACPI_COMPATIBLE_ID_LIST *Cid;
|
||||
ACPI_DEVICE_ID *Hid;
|
||||
ACPI_DEVICE_ID_LIST *Cid;
|
||||
UINT32 i;
|
||||
BOOLEAN Match;
|
||||
|
||||
|
||||
/* Get the _HID and check for a PCI Root Bridge */
|
||||
@ -509,7 +470,10 @@ AcpiEvIsPciRootBridge (
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
if (AcpiEvMatchPciRootBridge (Hid.Value))
|
||||
Match = AcpiUtIsPciRootBridge (Hid->String);
|
||||
ACPI_FREE (Hid);
|
||||
|
||||
if (Match)
|
||||
{
|
||||
return (TRUE);
|
||||
}
|
||||
@ -526,7 +490,7 @@ AcpiEvIsPciRootBridge (
|
||||
|
||||
for (i = 0; i < Cid->Count; i++)
|
||||
{
|
||||
if (AcpiEvMatchPciRootBridge (Cid->Id[i].Value))
|
||||
if (AcpiUtIsPciRootBridge (Cid->Ids[i].String))
|
||||
{
|
||||
ACPI_FREE (Cid);
|
||||
return (TRUE);
|
||||
|
@ -196,8 +196,15 @@ AcpiExAddTable (
|
||||
{
|
||||
AcpiUtRemoveReference (ObjDesc);
|
||||
*DdbHandle = NULL;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Execute any module-level code that was found in the table */
|
||||
|
||||
AcpiExExitInterpreter ();
|
||||
AcpiNsExecModuleCodeList ();
|
||||
AcpiExEnterInterpreter ();
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
@ -151,6 +151,7 @@ AcpiExReadDataFromField (
|
||||
ACPI_OPERAND_OBJECT *BufferDesc;
|
||||
ACPI_SIZE Length;
|
||||
void *Buffer;
|
||||
UINT32 Function;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (ExReadDataFromField, ObjDesc);
|
||||
@ -183,13 +184,27 @@ AcpiExReadDataFromField (
|
||||
}
|
||||
}
|
||||
else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
|
||||
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS))
|
||||
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS ||
|
||||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI))
|
||||
{
|
||||
/*
|
||||
* This is an SMBus read. We must create a buffer to hold the data
|
||||
* and directly access the region handler.
|
||||
* This is an SMBus or IPMI read. We must create a buffer to hold
|
||||
* the data and then directly access the region handler.
|
||||
*
|
||||
* Note: Smbus protocol value is passed in upper 16-bits of Function
|
||||
*/
|
||||
BufferDesc = AcpiUtCreateBufferObject (ACPI_SMBUS_BUFFER_SIZE);
|
||||
if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS)
|
||||
{
|
||||
Length = ACPI_SMBUS_BUFFER_SIZE;
|
||||
Function = ACPI_READ | (ObjDesc->Field.Attribute << 16);
|
||||
}
|
||||
else /* IPMI */
|
||||
{
|
||||
Length = ACPI_IPMI_BUFFER_SIZE;
|
||||
Function = ACPI_READ;
|
||||
}
|
||||
|
||||
BufferDesc = AcpiUtCreateBufferObject (Length);
|
||||
if (!BufferDesc)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
@ -199,13 +214,11 @@ AcpiExReadDataFromField (
|
||||
|
||||
AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
|
||||
|
||||
/*
|
||||
* Perform the read.
|
||||
* Note: Smbus protocol value is passed in upper 16-bits of Function
|
||||
*/
|
||||
/* Call the region handler for the read */
|
||||
|
||||
Status = AcpiExAccessRegion (ObjDesc, 0,
|
||||
ACPI_CAST_PTR (ACPI_INTEGER, BufferDesc->Buffer.Pointer),
|
||||
ACPI_READ | (ObjDesc->Field.Attribute << 16));
|
||||
Function);
|
||||
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
|
||||
goto Exit;
|
||||
}
|
||||
@ -304,6 +317,7 @@ AcpiExWriteDataToField (
|
||||
UINT32 Length;
|
||||
void *Buffer;
|
||||
ACPI_OPERAND_OBJECT *BufferDesc;
|
||||
UINT32 Function;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (ExWriteDataToField, ObjDesc);
|
||||
@ -332,40 +346,59 @@ AcpiExWriteDataToField (
|
||||
}
|
||||
}
|
||||
else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
|
||||
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS))
|
||||
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS ||
|
||||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI))
|
||||
{
|
||||
/*
|
||||
* This is an SMBus write. We will bypass the entire field mechanism
|
||||
* and handoff the buffer directly to the handler.
|
||||
* This is an SMBus or IPMI write. We will bypass the entire field
|
||||
* mechanism and handoff the buffer directly to the handler. For
|
||||
* these address spaces, the buffer is bi-directional; on a write,
|
||||
* return data is returned in the same buffer.
|
||||
*
|
||||
* Source must be a buffer of sufficient size (ACPI_SMBUS_BUFFER_SIZE).
|
||||
* Source must be a buffer of sufficient size:
|
||||
* ACPI_SMBUS_BUFFER_SIZE or ACPI_IPMI_BUFFER_SIZE.
|
||||
*
|
||||
* Note: SMBus protocol type is passed in upper 16-bits of Function
|
||||
*/
|
||||
if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "SMBus write requires Buffer, found type %s",
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"SMBus or IPMI write requires Buffer, found type %s",
|
||||
AcpiUtGetObjectTypeName (SourceDesc)));
|
||||
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
if (SourceDesc->Buffer.Length < ACPI_SMBUS_BUFFER_SIZE)
|
||||
if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS)
|
||||
{
|
||||
Length = ACPI_SMBUS_BUFFER_SIZE;
|
||||
Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16);
|
||||
}
|
||||
else /* IPMI */
|
||||
{
|
||||
Length = ACPI_IPMI_BUFFER_SIZE;
|
||||
Function = ACPI_WRITE;
|
||||
}
|
||||
|
||||
if (SourceDesc->Buffer.Length < Length)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"SMBus write requires Buffer of length %X, found length %X",
|
||||
ACPI_SMBUS_BUFFER_SIZE, SourceDesc->Buffer.Length));
|
||||
"SMBus or IPMI write requires Buffer of length %X, found length %X",
|
||||
Length, SourceDesc->Buffer.Length));
|
||||
|
||||
return_ACPI_STATUS (AE_AML_BUFFER_LIMIT);
|
||||
}
|
||||
|
||||
BufferDesc = AcpiUtCreateBufferObject (ACPI_SMBUS_BUFFER_SIZE);
|
||||
/* Create the bi-directional buffer */
|
||||
|
||||
BufferDesc = AcpiUtCreateBufferObject (Length);
|
||||
if (!BufferDesc)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
Buffer = BufferDesc->Buffer.Pointer;
|
||||
ACPI_MEMCPY (Buffer, SourceDesc->Buffer.Pointer,
|
||||
ACPI_SMBUS_BUFFER_SIZE);
|
||||
ACPI_MEMCPY (Buffer, SourceDesc->Buffer.Pointer, Length);
|
||||
|
||||
/* Lock entire transaction if requested */
|
||||
|
||||
@ -374,11 +407,9 @@ AcpiExWriteDataToField (
|
||||
/*
|
||||
* Perform the write (returns status and perhaps data in the
|
||||
* same buffer)
|
||||
* Note: SMBus protocol type is passed in upper 16-bits of Function.
|
||||
*/
|
||||
Status = AcpiExAccessRegion (ObjDesc, 0,
|
||||
(ACPI_INTEGER *) Buffer,
|
||||
ACPI_WRITE | (ObjDesc->Field.Attribute << 16));
|
||||
(ACPI_INTEGER *) Buffer, Function);
|
||||
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
|
||||
|
||||
*ResultDesc = BufferDesc;
|
||||
|
@ -202,12 +202,13 @@ AcpiExSetupRegion (
|
||||
}
|
||||
|
||||
/*
|
||||
* Exit now for SMBus address space, it has a non-linear address space
|
||||
* Exit now for SMBus or IPMI address space, it has a non-linear address space
|
||||
* and the request cannot be directly validated
|
||||
*/
|
||||
if (RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_SMBUS)
|
||||
if (RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_SMBUS ||
|
||||
RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_IPMI)
|
||||
{
|
||||
/* SMBus has a non-linear address space */
|
||||
/* SMBus or IPMI has a non-linear address space */
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
@ -150,6 +150,13 @@ AcpiExStoreBufferToBuffer (
|
||||
ACPI_FUNCTION_TRACE_PTR (ExStoreBufferToBuffer, SourceDesc);
|
||||
|
||||
|
||||
/* If Source and Target are the same, just return */
|
||||
|
||||
if (SourceDesc == TargetDesc)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* We know that SourceDesc is a buffer by now */
|
||||
|
||||
Buffer = ACPI_CAST_PTR (UINT8, SourceDesc->Buffer.Pointer);
|
||||
@ -248,6 +255,13 @@ AcpiExStoreStringToString (
|
||||
ACPI_FUNCTION_TRACE_PTR (ExStoreStringToString, SourceDesc);
|
||||
|
||||
|
||||
/* If Source and Target are the same, just return */
|
||||
|
||||
if (SourceDesc == TargetDesc)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* We know that SourceDesc is a string by now */
|
||||
|
||||
Buffer = ACPI_CAST_PTR (UINT8, SourceDesc->String.Pointer);
|
||||
|
@ -482,59 +482,76 @@ AcpiExDigitsNeeded (
|
||||
*
|
||||
* FUNCTION: AcpiExEisaIdToString
|
||||
*
|
||||
* PARAMETERS: NumericId - EISA ID to be converted
|
||||
* PARAMETERS: CompressedId - EISAID to be converted
|
||||
* OutString - Where to put the converted string (8 bytes)
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Convert a numeric EISA ID to string representation
|
||||
* DESCRIPTION: Convert a numeric EISAID to string representation. Return
|
||||
* buffer must be large enough to hold the string. The string
|
||||
* returned is always exactly of length ACPI_EISAID_STRING_SIZE
|
||||
* (includes null terminator). The EISAID is always 32 bits.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExEisaIdToString (
|
||||
UINT32 NumericId,
|
||||
char *OutString)
|
||||
char *OutString,
|
||||
ACPI_INTEGER CompressedId)
|
||||
{
|
||||
UINT32 EisaId;
|
||||
UINT32 SwappedId;
|
||||
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
|
||||
|
||||
/* The EISAID should be a 32-bit integer */
|
||||
|
||||
if (CompressedId > ACPI_UINT32_MAX)
|
||||
{
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Expected EISAID is larger than 32 bits: 0x%8.8X%8.8X, truncating",
|
||||
ACPI_FORMAT_UINT64 (CompressedId)));
|
||||
}
|
||||
|
||||
/* Swap ID to big-endian to get contiguous bits */
|
||||
|
||||
EisaId = AcpiUtDwordByteSwap (NumericId);
|
||||
SwappedId = AcpiUtDwordByteSwap ((UINT32) CompressedId);
|
||||
|
||||
OutString[0] = (char) ('@' + (((unsigned long) EisaId >> 26) & 0x1f));
|
||||
OutString[1] = (char) ('@' + ((EisaId >> 21) & 0x1f));
|
||||
OutString[2] = (char) ('@' + ((EisaId >> 16) & 0x1f));
|
||||
OutString[3] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) EisaId, 12);
|
||||
OutString[4] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) EisaId, 8);
|
||||
OutString[5] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) EisaId, 4);
|
||||
OutString[6] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) EisaId, 0);
|
||||
/* First 3 bytes are uppercase letters. Next 4 bytes are hexadecimal */
|
||||
|
||||
OutString[0] = (char) (0x40 + (((unsigned long) SwappedId >> 26) & 0x1F));
|
||||
OutString[1] = (char) (0x40 + ((SwappedId >> 21) & 0x1F));
|
||||
OutString[2] = (char) (0x40 + ((SwappedId >> 16) & 0x1F));
|
||||
OutString[3] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) SwappedId, 12);
|
||||
OutString[4] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) SwappedId, 8);
|
||||
OutString[5] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) SwappedId, 4);
|
||||
OutString[6] = AcpiUtHexToAsciiChar ((ACPI_INTEGER) SwappedId, 0);
|
||||
OutString[7] = 0;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExUnsignedIntegerToString
|
||||
* FUNCTION: AcpiExIntegerToString
|
||||
*
|
||||
* PARAMETERS: Value - Value to be converted
|
||||
* OutString - Where to put the converted string (8 bytes)
|
||||
* PARAMETERS: OutString - Where to put the converted string. At least
|
||||
* 21 bytes are needed to hold the largest
|
||||
* possible 64-bit integer.
|
||||
* Value - Value to be converted
|
||||
*
|
||||
* RETURN: None, string
|
||||
*
|
||||
* DESCRIPTION: Convert a number to string representation. Assumes string
|
||||
* buffer is large enough to hold the string.
|
||||
* DESCRIPTION: Convert a 64-bit integer to decimal string representation.
|
||||
* Assumes string buffer is large enough to hold the string. The
|
||||
* largest string is (ACPI_MAX64_DECIMAL_DIGITS + 1).
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExUnsignedIntegerToString (
|
||||
ACPI_INTEGER Value,
|
||||
char *OutString)
|
||||
AcpiExIntegerToString (
|
||||
char *OutString,
|
||||
ACPI_INTEGER Value)
|
||||
{
|
||||
UINT32 Count;
|
||||
UINT32 DigitsNeeded;
|
||||
|
@ -161,7 +161,7 @@ AcpiHwLowDisableGpe (
|
||||
|
||||
/* Get current value of the enable register that contains this GPE */
|
||||
|
||||
Status = AcpiRead (&EnableMask, &GpeRegisterInfo->EnableAddress);
|
||||
Status = AcpiHwRead (&EnableMask, &GpeRegisterInfo->EnableAddress);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
@ -175,7 +175,7 @@ AcpiHwLowDisableGpe (
|
||||
|
||||
/* Write the updated enable mask */
|
||||
|
||||
Status = AcpiWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
|
||||
Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
@ -215,7 +215,7 @@ AcpiHwWriteGpeEnableReg (
|
||||
|
||||
/* Write the entire GPE (runtime) enable register */
|
||||
|
||||
Status = AcpiWrite (GpeRegisterInfo->EnableForRun,
|
||||
Status = AcpiHwWrite (GpeRegisterInfo->EnableForRun,
|
||||
&GpeRegisterInfo->EnableAddress);
|
||||
|
||||
return (Status);
|
||||
@ -252,7 +252,7 @@ AcpiHwClearGpe (
|
||||
* Write a one to the appropriate bit in the status register to
|
||||
* clear this GPE.
|
||||
*/
|
||||
Status = AcpiWrite (RegisterBit,
|
||||
Status = AcpiHwWrite (RegisterBit,
|
||||
&GpeEventInfo->RegisterInfo->StatusAddress);
|
||||
|
||||
return (Status);
|
||||
@ -317,7 +317,7 @@ AcpiHwGetGpeStatus (
|
||||
|
||||
/* GPE currently active (status bit == 1)? */
|
||||
|
||||
Status = AcpiRead (&InByte, &GpeRegisterInfo->StatusAddress);
|
||||
Status = AcpiHwRead (&InByte, &GpeRegisterInfo->StatusAddress);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto UnlockAndExit;
|
||||
@ -367,7 +367,7 @@ AcpiHwDisableGpeBlock (
|
||||
{
|
||||
/* Disable all GPEs in this register */
|
||||
|
||||
Status = AcpiWrite (0x00, &GpeBlock->RegisterInfo[i].EnableAddress);
|
||||
Status = AcpiHwWrite (0x00, &GpeBlock->RegisterInfo[i].EnableAddress);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
@ -407,7 +407,7 @@ AcpiHwClearGpeBlock (
|
||||
{
|
||||
/* Clear status on all GPEs in this register */
|
||||
|
||||
Status = AcpiWrite (0xFF, &GpeBlock->RegisterInfo[i].StatusAddress);
|
||||
Status = AcpiHwWrite (0xFF, &GpeBlock->RegisterInfo[i].StatusAddress);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
@ -455,7 +455,7 @@ AcpiHwEnableRuntimeGpeBlock (
|
||||
|
||||
/* Enable all "runtime" GPEs in this register */
|
||||
|
||||
Status = AcpiWrite (GpeBlock->RegisterInfo[i].EnableForRun,
|
||||
Status = AcpiHwWrite (GpeBlock->RegisterInfo[i].EnableForRun,
|
||||
&GpeBlock->RegisterInfo[i].EnableAddress);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@ -502,7 +502,7 @@ AcpiHwEnableWakeupGpeBlock (
|
||||
|
||||
/* Enable all "wake" GPEs in this register */
|
||||
|
||||
Status = AcpiWrite (GpeBlock->RegisterInfo[i].EnableForWake,
|
||||
Status = AcpiHwWrite (GpeBlock->RegisterInfo[i].EnableForWake,
|
||||
&GpeBlock->RegisterInfo[i].EnableAddress);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
|
@ -140,6 +140,209 @@ AcpiHwWriteMultiple (
|
||||
ACPI_GENERIC_ADDRESS *RegisterB);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwValidateRegister
|
||||
*
|
||||
* PARAMETERS: Reg - GAS register structure
|
||||
* MaxBitWidth - Max BitWidth supported (32 or 64)
|
||||
* Address - Pointer to where the gas->address
|
||||
* is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Validate the contents of a GAS register. Checks the GAS
|
||||
* pointer, Address, SpaceId, BitWidth, and BitOffset.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwValidateRegister (
|
||||
ACPI_GENERIC_ADDRESS *Reg,
|
||||
UINT8 MaxBitWidth,
|
||||
UINT64 *Address)
|
||||
{
|
||||
|
||||
/* Must have a valid pointer to a GAS structure */
|
||||
|
||||
if (!Reg)
|
||||
{
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy the target address. This handles possible alignment issues.
|
||||
* Address must not be null. A null address also indicates an optional
|
||||
* ACPI register that is not supported, so no error message.
|
||||
*/
|
||||
ACPI_MOVE_64_TO_64 (Address, &Reg->Address);
|
||||
if (!(*Address))
|
||||
{
|
||||
return (AE_BAD_ADDRESS);
|
||||
}
|
||||
|
||||
/* Validate the SpaceID */
|
||||
|
||||
if ((Reg->SpaceId != ACPI_ADR_SPACE_SYSTEM_MEMORY) &&
|
||||
(Reg->SpaceId != ACPI_ADR_SPACE_SYSTEM_IO))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Unsupported address space: 0x%X", Reg->SpaceId));
|
||||
return (AE_SUPPORT);
|
||||
}
|
||||
|
||||
/* Validate the BitWidth */
|
||||
|
||||
if ((Reg->BitWidth != 8) &&
|
||||
(Reg->BitWidth != 16) &&
|
||||
(Reg->BitWidth != 32) &&
|
||||
(Reg->BitWidth != MaxBitWidth))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Unsupported register bit width: 0x%X", Reg->BitWidth));
|
||||
return (AE_SUPPORT);
|
||||
}
|
||||
|
||||
/* Validate the BitOffset. Just a warning for now. */
|
||||
|
||||
if (Reg->BitOffset != 0)
|
||||
{
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Unsupported register bit offset: 0x%X", Reg->BitOffset));
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwRead
|
||||
*
|
||||
* PARAMETERS: Value - Where the value is returned
|
||||
* Reg - GAS register structure
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Read from either memory or IO space. This is a 32-bit max
|
||||
* version of AcpiRead, used internally since the overhead of
|
||||
* 64-bit values is not needed.
|
||||
*
|
||||
* LIMITATIONS: <These limitations also apply to AcpiHwWrite>
|
||||
* BitWidth must be exactly 8, 16, or 32.
|
||||
* SpaceID must be SystemMemory or SystemIO.
|
||||
* BitOffset and AccessWidth are currently ignored, as there has
|
||||
* not been a need to implement these.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwRead (
|
||||
UINT32 *Value,
|
||||
ACPI_GENERIC_ADDRESS *Reg)
|
||||
{
|
||||
UINT64 Address;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (HwRead);
|
||||
|
||||
|
||||
/* Validate contents of the GAS register */
|
||||
|
||||
Status = AcpiHwValidateRegister (Reg, 32, &Address);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* Initialize entire 32-bit return value to zero */
|
||||
|
||||
*Value = 0;
|
||||
|
||||
/*
|
||||
* Two address spaces supported: Memory or IO. PCI_Config is
|
||||
* not supported here because the GAS structure is insufficient
|
||||
*/
|
||||
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
|
||||
{
|
||||
Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
|
||||
Address, Value, Reg->BitWidth);
|
||||
}
|
||||
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
|
||||
{
|
||||
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
|
||||
Address, Value, Reg->BitWidth);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
|
||||
"Read: %8.8X width %2d from %8.8X%8.8X (%s)\n",
|
||||
*Value, Reg->BitWidth, ACPI_FORMAT_UINT64 (Address),
|
||||
AcpiUtGetRegionName (Reg->SpaceId)));
|
||||
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwWrite
|
||||
*
|
||||
* PARAMETERS: Value - Value to be written
|
||||
* Reg - GAS register structure
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Write to either memory or IO space. This is a 32-bit max
|
||||
* version of AcpiWrite, used internally since the overhead of
|
||||
* 64-bit values is not needed.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwWrite (
|
||||
UINT32 Value,
|
||||
ACPI_GENERIC_ADDRESS *Reg)
|
||||
{
|
||||
UINT64 Address;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (HwWrite);
|
||||
|
||||
|
||||
/* Validate contents of the GAS register */
|
||||
|
||||
Status = AcpiHwValidateRegister (Reg, 32, &Address);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Two address spaces supported: Memory or IO. PCI_Config is
|
||||
* not supported here because the GAS structure is insufficient
|
||||
*/
|
||||
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
|
||||
{
|
||||
Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
|
||||
Address, Value, Reg->BitWidth);
|
||||
}
|
||||
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
|
||||
{
|
||||
Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
|
||||
Address, Value, Reg->BitWidth);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
|
||||
"Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n",
|
||||
Value, Reg->BitWidth, ACPI_FORMAT_UINT64 (Address),
|
||||
AcpiUtGetRegionName (Reg->SpaceId)));
|
||||
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwClearAcpiStatus
|
||||
@ -245,7 +448,7 @@ AcpiHwWritePm1Control (
|
||||
ACPI_FUNCTION_TRACE (HwWritePm1Control);
|
||||
|
||||
|
||||
Status = AcpiWrite (Pm1aControl, &AcpiGbl_FADT.XPm1aControlBlock);
|
||||
Status = AcpiHwWrite (Pm1aControl, &AcpiGbl_FADT.XPm1aControlBlock);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
@ -253,7 +456,7 @@ AcpiHwWritePm1Control (
|
||||
|
||||
if (AcpiGbl_FADT.XPm1bControlBlock.Address)
|
||||
{
|
||||
Status = AcpiWrite (Pm1bControl, &AcpiGbl_FADT.XPm1bControlBlock);
|
||||
Status = AcpiHwWrite (Pm1bControl, &AcpiGbl_FADT.XPm1bControlBlock);
|
||||
}
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
@ -319,13 +522,13 @@ AcpiHwRegisterRead (
|
||||
|
||||
case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
|
||||
|
||||
Status = AcpiRead (&Value, &AcpiGbl_FADT.XPm2ControlBlock);
|
||||
Status = AcpiHwRead (&Value, &AcpiGbl_FADT.XPm2ControlBlock);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
|
||||
|
||||
Status = AcpiRead (&Value, &AcpiGbl_FADT.XPmTimerBlock);
|
||||
Status = AcpiHwRead (&Value, &AcpiGbl_FADT.XPmTimerBlock);
|
||||
break;
|
||||
|
||||
|
||||
@ -450,7 +653,7 @@ AcpiHwRegisterWrite (
|
||||
* For control registers, all reserved bits must be preserved,
|
||||
* as per the ACPI spec.
|
||||
*/
|
||||
Status = AcpiRead (&ReadValue, &AcpiGbl_FADT.XPm2ControlBlock);
|
||||
Status = AcpiHwRead (&ReadValue, &AcpiGbl_FADT.XPm2ControlBlock);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Exit;
|
||||
@ -460,13 +663,13 @@ AcpiHwRegisterWrite (
|
||||
|
||||
ACPI_INSERT_BITS (Value, ACPI_PM2_CONTROL_PRESERVED_BITS, ReadValue);
|
||||
|
||||
Status = AcpiWrite (Value, &AcpiGbl_FADT.XPm2ControlBlock);
|
||||
Status = AcpiHwWrite (Value, &AcpiGbl_FADT.XPm2ControlBlock);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
|
||||
|
||||
Status = AcpiWrite (Value, &AcpiGbl_FADT.XPmTimerBlock);
|
||||
Status = AcpiHwWrite (Value, &AcpiGbl_FADT.XPmTimerBlock);
|
||||
break;
|
||||
|
||||
|
||||
@ -517,7 +720,7 @@ AcpiHwReadMultiple (
|
||||
|
||||
/* The first register is always required */
|
||||
|
||||
Status = AcpiRead (&ValueA, RegisterA);
|
||||
Status = AcpiHwRead (&ValueA, RegisterA);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
@ -527,7 +730,7 @@ AcpiHwReadMultiple (
|
||||
|
||||
if (RegisterB->Address)
|
||||
{
|
||||
Status = AcpiRead (&ValueB, RegisterB);
|
||||
Status = AcpiHwRead (&ValueB, RegisterB);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
@ -574,7 +777,7 @@ AcpiHwWriteMultiple (
|
||||
|
||||
/* The first register is always required */
|
||||
|
||||
Status = AcpiWrite (Value, RegisterA);
|
||||
Status = AcpiHwWrite (Value, RegisterA);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
@ -594,7 +797,7 @@ AcpiHwWriteMultiple (
|
||||
*/
|
||||
if (RegisterB->Address)
|
||||
{
|
||||
Status = AcpiWrite (Value, RegisterB);
|
||||
Status = AcpiHwWrite (Value, RegisterB);
|
||||
}
|
||||
|
||||
return (Status);
|
||||
|
@ -346,10 +346,13 @@ AcpiEnterSleepState (
|
||||
|
||||
if (SleepState != ACPI_STATE_S5)
|
||||
{
|
||||
/* Disable BM arbitration */
|
||||
|
||||
/*
|
||||
* Disable BM arbitration. This feature is contained within an
|
||||
* optional register (PM2 Control), so ignore a BAD_ADDRESS
|
||||
* exception.
|
||||
*/
|
||||
Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 1);
|
||||
if (ACPI_FAILURE (Status))
|
||||
if (ACPI_FAILURE (Status) && (Status != AE_BAD_ADDRESS))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
@ -694,10 +697,13 @@ AcpiLeaveSleepState (
|
||||
AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].StatusRegisterId,
|
||||
ACPI_CLEAR_STATUS);
|
||||
|
||||
/* Enable BM arbitration */
|
||||
|
||||
/*
|
||||
* Enable BM arbitration. This feature is contained within an
|
||||
* optional register (PM2 Control), so ignore a BAD_ADDRESS
|
||||
* exception.
|
||||
*/
|
||||
Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
if (ACPI_FAILURE (Status) && (Status != AE_BAD_ADDRESS))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ AcpiGetTimer (
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
Status = AcpiRead (Ticks, &AcpiGbl_FADT.XPmTimerBlock);
|
||||
Status = AcpiHwRead (Ticks, &AcpiGbl_FADT.XPmTimerBlock);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
@ -157,9 +157,23 @@ AcpiReset (
|
||||
return_ACPI_STATUS (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
/* Write the reset value to the reset register */
|
||||
if (ResetReg->SpaceId == ACPI_ADR_SPACE_SYSTEM_IO)
|
||||
{
|
||||
/*
|
||||
* For I/O space, write directly to the OSL. This bypasses the port
|
||||
* validation mechanism, which may block a valid write to the reset
|
||||
* register.
|
||||
*/
|
||||
Status = AcpiOsWritePort ((ACPI_IO_ADDRESS) ResetReg->Address,
|
||||
AcpiGbl_FADT.ResetValue, ResetReg->BitWidth);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Write the reset value to the reset register */
|
||||
|
||||
Status = AcpiHwWrite (AcpiGbl_FADT.ResetValue, ResetReg);
|
||||
}
|
||||
|
||||
Status = AcpiWrite (AcpiGbl_FADT.ResetValue, ResetReg);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@ -177,13 +191,20 @@ ACPI_EXPORT_SYMBOL (AcpiReset)
|
||||
*
|
||||
* DESCRIPTION: Read from either memory or IO space.
|
||||
*
|
||||
* LIMITATIONS: <These limitations also apply to AcpiWrite>
|
||||
* BitWidth must be exactly 8, 16, 32, or 64.
|
||||
* SpaceID must be SystemMemory or SystemIO.
|
||||
* BitOffset and AccessWidth are currently ignored, as there has
|
||||
* not been a need to implement these.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiRead (
|
||||
UINT32 *Value,
|
||||
UINT64 *ReturnValue,
|
||||
ACPI_GENERIC_ADDRESS *Reg)
|
||||
{
|
||||
UINT32 Value;
|
||||
UINT32 Width;
|
||||
UINT64 Address;
|
||||
ACPI_STATUS Status;
|
||||
@ -192,63 +213,85 @@ AcpiRead (
|
||||
ACPI_FUNCTION_NAME (AcpiRead);
|
||||
|
||||
|
||||
/*
|
||||
* Must have a valid pointer to a GAS structure, and a non-zero address
|
||||
* within.
|
||||
*/
|
||||
if (!Reg)
|
||||
if (!ReturnValue)
|
||||
{
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/* Get a local copy of the address. Handles possible alignment issues */
|
||||
/* Validate contents of the GAS register. Allow 64-bit transfers */
|
||||
|
||||
ACPI_MOVE_64_TO_64 (&Address, &Reg->Address);
|
||||
if (!Address)
|
||||
Status = AcpiHwValidateRegister (Reg, 64, &Address);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (AE_BAD_ADDRESS);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* Supported widths are 8/16/32 */
|
||||
|
||||
Width = Reg->BitWidth;
|
||||
if ((Width != 8) && (Width != 16) && (Width != 32))
|
||||
if (Width == 64)
|
||||
{
|
||||
return (AE_SUPPORT);
|
||||
Width = 32; /* Break into two 32-bit transfers */
|
||||
}
|
||||
|
||||
/* Initialize entire 32-bit return value to zero */
|
||||
/* Initialize entire 64-bit return value to zero */
|
||||
|
||||
*Value = 0;
|
||||
*ReturnValue = 0;
|
||||
Value = 0;
|
||||
|
||||
/*
|
||||
* Two address spaces supported: Memory or IO. PCI_Config is
|
||||
* not supported here because the GAS structure is insufficient
|
||||
*/
|
||||
switch (Reg->SpaceId)
|
||||
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
|
||||
{
|
||||
case ACPI_ADR_SPACE_SYSTEM_MEMORY:
|
||||
Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
|
||||
Address, &Value, Width);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
*ReturnValue = Value;
|
||||
|
||||
Status = AcpiOsReadMemory (
|
||||
(ACPI_PHYSICAL_ADDRESS) Address, Value, Width);
|
||||
break;
|
||||
if (Reg->BitWidth == 64)
|
||||
{
|
||||
/* Read the top 32 bits */
|
||||
|
||||
Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
|
||||
(Address + 4), &Value, 32);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
*ReturnValue |= ((UINT64) Value << 32);
|
||||
}
|
||||
}
|
||||
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
|
||||
{
|
||||
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
|
||||
Address, &Value, Width);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
*ReturnValue = Value;
|
||||
|
||||
case ACPI_ADR_SPACE_SYSTEM_IO:
|
||||
if (Reg->BitWidth == 64)
|
||||
{
|
||||
/* Read the top 32 bits */
|
||||
|
||||
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS) Address, Value, Width);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Unsupported address space: %X", Reg->SpaceId));
|
||||
return (AE_BAD_PARAMETER);
|
||||
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
|
||||
(Address + 4), &Value, 32);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
*ReturnValue |= ((UINT64) Value << 32);
|
||||
}
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
|
||||
"Read: %8.8X width %2d from %8.8X%8.8X (%s)\n",
|
||||
*Value, Width, ACPI_FORMAT_UINT64 (Address),
|
||||
"Read: %8.8X%8.8X width %2d from %8.8X%8.8X (%s)\n",
|
||||
ACPI_FORMAT_UINT64 (*ReturnValue), Reg->BitWidth,
|
||||
ACPI_FORMAT_UINT64 (Address),
|
||||
AcpiUtGetRegionName (Reg->SpaceId)));
|
||||
|
||||
return (Status);
|
||||
@ -261,7 +304,7 @@ ACPI_EXPORT_SYMBOL (AcpiRead)
|
||||
*
|
||||
* FUNCTION: AcpiWrite
|
||||
*
|
||||
* PARAMETERS: Value - To be written
|
||||
* PARAMETERS: Value - Value to be written
|
||||
* Reg - GAS register structure
|
||||
*
|
||||
* RETURN: Status
|
||||
@ -272,7 +315,7 @@ ACPI_EXPORT_SYMBOL (AcpiRead)
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiWrite (
|
||||
UINT32 Value,
|
||||
UINT64 Value,
|
||||
ACPI_GENERIC_ADDRESS *Reg)
|
||||
{
|
||||
UINT32 Width;
|
||||
@ -283,60 +326,67 @@ AcpiWrite (
|
||||
ACPI_FUNCTION_NAME (AcpiWrite);
|
||||
|
||||
|
||||
/*
|
||||
* Must have a valid pointer to a GAS structure, and a non-zero address
|
||||
* within.
|
||||
*/
|
||||
if (!Reg)
|
||||
/* Validate contents of the GAS register. Allow 64-bit transfers */
|
||||
|
||||
Status = AcpiHwValidateRegister (Reg, 64, &Address);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (AE_BAD_PARAMETER);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* Get a local copy of the address. Handles possible alignment issues */
|
||||
|
||||
ACPI_MOVE_64_TO_64 (&Address, &Reg->Address);
|
||||
if (!Address)
|
||||
{
|
||||
return (AE_BAD_ADDRESS);
|
||||
}
|
||||
|
||||
/* Supported widths are 8/16/32 */
|
||||
|
||||
Width = Reg->BitWidth;
|
||||
if ((Width != 8) && (Width != 16) && (Width != 32))
|
||||
if (Width == 64)
|
||||
{
|
||||
return (AE_SUPPORT);
|
||||
Width = 32; /* Break into two 32-bit transfers */
|
||||
}
|
||||
|
||||
/*
|
||||
* Two address spaces supported: Memory or IO.
|
||||
* PCI_Config is not supported here because the GAS struct is insufficient
|
||||
* Two address spaces supported: Memory or IO. PCI_Config is
|
||||
* not supported here because the GAS structure is insufficient
|
||||
*/
|
||||
switch (Reg->SpaceId)
|
||||
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
|
||||
{
|
||||
case ACPI_ADR_SPACE_SYSTEM_MEMORY:
|
||||
Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
|
||||
Address, ACPI_LODWORD (Value), Width);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Status = AcpiOsWriteMemory (
|
||||
(ACPI_PHYSICAL_ADDRESS) Address, Value, Width);
|
||||
break;
|
||||
if (Reg->BitWidth == 64)
|
||||
{
|
||||
Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
|
||||
(Address + 4), ACPI_HIDWORD (Value), 32);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
}
|
||||
}
|
||||
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
|
||||
{
|
||||
Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
|
||||
Address, ACPI_LODWORD (Value), Width);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
case ACPI_ADR_SPACE_SYSTEM_IO:
|
||||
|
||||
Status = AcpiHwWritePort (
|
||||
(ACPI_IO_ADDRESS) Address, Value, Width);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Unsupported address space: %X", Reg->SpaceId));
|
||||
return (AE_BAD_PARAMETER);
|
||||
if (Reg->BitWidth == 64)
|
||||
{
|
||||
Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
|
||||
(Address + 4), ACPI_HIDWORD (Value), 32);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
|
||||
"Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n",
|
||||
Value, Width, ACPI_FORMAT_UINT64 (Address),
|
||||
"Wrote: %8.8X%8.8X width %2d to %8.8X%8.8X (%s)\n",
|
||||
ACPI_FORMAT_UINT64 (Value), Reg->BitWidth,
|
||||
ACPI_FORMAT_UINT64 (Address),
|
||||
AcpiUtGetRegionName (Reg->SpaceId)));
|
||||
|
||||
return (Status);
|
||||
|
@ -236,7 +236,7 @@
|
||||
|
||||
/* Operation regions */
|
||||
|
||||
#define ACPI_NUM_PREDEFINED_REGIONS 8
|
||||
#define ACPI_NUM_PREDEFINED_REGIONS 9
|
||||
#define ACPI_USER_REGION_BEGIN 0x80
|
||||
|
||||
/* Maximum SpaceIds for Operation Regions */
|
||||
@ -252,9 +252,15 @@
|
||||
#define ACPI_RSDP_CHECKSUM_LENGTH 20
|
||||
#define ACPI_RSDP_XCHECKSUM_LENGTH 36
|
||||
|
||||
/* SMBus bidirectional buffer size */
|
||||
/* SMBus and IPMI bidirectional buffer size */
|
||||
|
||||
#define ACPI_SMBUS_BUFFER_SIZE 34
|
||||
#define ACPI_IPMI_BUFFER_SIZE 66
|
||||
|
||||
/* _SxD and _SxW control methods */
|
||||
|
||||
#define ACPI_NUM_SxD_METHODS 4
|
||||
#define ACPI_NUM_SxW_METHODS 5
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -313,6 +313,7 @@ AcpiDbDisplayArgumentObject (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
|
||||
/*
|
||||
* dbexec - debugger control method execution
|
||||
*/
|
||||
|
@ -183,6 +183,9 @@ typedef const struct acpi_dmtable_info
|
||||
#define ACPI_DMT_EXIT 30
|
||||
#define ACPI_DMT_SIG 31
|
||||
#define ACPI_DMT_FADTPM 32
|
||||
#define ACPI_DMT_BUF16 33
|
||||
#define ACPI_DMT_IVRS 34
|
||||
|
||||
|
||||
typedef
|
||||
void (*ACPI_DMTABLE_HANDLER) (
|
||||
@ -250,6 +253,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[];
|
||||
@ -263,15 +267,22 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoHeader[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest3[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest4[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest5[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest6[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest7[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest8[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest9[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs4[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8a[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8b[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8c[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt1[];
|
||||
@ -287,6 +298,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[];
|
||||
@ -300,6 +313,10 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWaet[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[];
|
||||
|
||||
|
||||
@ -363,6 +380,10 @@ void
|
||||
AcpiDmDumpHest (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpIvrs (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpMcfg (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
@ -371,6 +392,10 @@ void
|
||||
AcpiDmDumpMadt (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpMsct (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
UINT32
|
||||
AcpiDmDumpRsdp (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
@ -387,6 +412,10 @@ void
|
||||
AcpiDmDumpSrat (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpWdat (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpXsdt (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
@ -324,7 +324,8 @@ extern char const *AcpiGbl_ExceptionNames_Ctrl[];
|
||||
extern BOOLEAN AcpiGbl_Shutdown;
|
||||
extern UINT32 AcpiGbl_StartupFlags;
|
||||
extern const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT];
|
||||
extern const char *AcpiGbl_HighestDstateNames[4];
|
||||
extern const char *AcpiGbl_LowestDstateNames[ACPI_NUM_SxW_METHODS];
|
||||
extern const char *AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS];
|
||||
extern const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES];
|
||||
extern const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS];
|
||||
#endif
|
||||
@ -355,6 +356,8 @@ ACPI_EXTERN BOOLEAN AcpiGbl_DisplayFinalMemStats;
|
||||
ACPI_EXTERN ACPI_NAMESPACE_NODE AcpiGbl_RootNodeStruct;
|
||||
ACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_RootNode;
|
||||
ACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_FadtGpeDevice;
|
||||
ACPI_EXTERN ACPI_OPERAND_OBJECT *AcpiGbl_ModuleCodeList;
|
||||
|
||||
|
||||
extern const UINT8 AcpiGbl_NsProperties [ACPI_NUM_NS_TYPES];
|
||||
extern const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames [NUM_PREDEFINED_NAMES];
|
||||
|
@ -141,6 +141,22 @@ AcpiHwGetMode (
|
||||
/*
|
||||
* hwregs - ACPI Register I/O
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiHwValidateRegister (
|
||||
ACPI_GENERIC_ADDRESS *Reg,
|
||||
UINT8 MaxBitWidth,
|
||||
UINT64 *Address);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwRead (
|
||||
UINT32 *Value,
|
||||
ACPI_GENERIC_ADDRESS *Reg);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwWrite (
|
||||
UINT32 Value,
|
||||
ACPI_GENERIC_ADDRESS *Reg);
|
||||
|
||||
ACPI_BIT_REGISTER_INFO *
|
||||
AcpiHwGetBitRegisterInfo (
|
||||
UINT32 RegisterId);
|
||||
|
@ -696,13 +696,13 @@ AcpiExReleaseGlobalLock (
|
||||
|
||||
void
|
||||
AcpiExEisaIdToString (
|
||||
UINT32 NumericId,
|
||||
char *OutString);
|
||||
char *Dest,
|
||||
ACPI_INTEGER CompressedId);
|
||||
|
||||
void
|
||||
AcpiExUnsignedIntegerToString (
|
||||
ACPI_INTEGER Value,
|
||||
char *OutString);
|
||||
AcpiExIntegerToString (
|
||||
char *Dest,
|
||||
ACPI_INTEGER Value);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -493,6 +493,23 @@ typedef union acpi_predefined_info
|
||||
|
||||
} ACPI_PREDEFINED_INFO;
|
||||
|
||||
|
||||
/* Data block used during object validation */
|
||||
|
||||
typedef struct acpi_predefined_data
|
||||
{
|
||||
char *Pathname;
|
||||
const ACPI_PREDEFINED_INFO *Predefined;
|
||||
UINT32 Flags;
|
||||
UINT8 NodeFlags;
|
||||
|
||||
} ACPI_PREDEFINED_DATA;
|
||||
|
||||
/* Defines for Flags field above */
|
||||
|
||||
#define ACPI_OBJECT_REPAIRED 1
|
||||
|
||||
|
||||
/*
|
||||
* Bitmapped return value types
|
||||
* Note: the actual data types must be contiguous, a loop in nspredef.c
|
||||
@ -1110,6 +1127,9 @@ typedef struct acpi_bit_register_info
|
||||
#define ACPI_OSI_WIN_XP_SP2 0x05
|
||||
#define ACPI_OSI_WINSRV_2003_SP1 0x06
|
||||
#define ACPI_OSI_WIN_VISTA 0x07
|
||||
#define ACPI_OSI_WINSRV_2008 0x08
|
||||
#define ACPI_OSI_WIN_VISTA_SP1 0x09
|
||||
#define ACPI_OSI_WIN_7 0x0A
|
||||
|
||||
#define ACPI_ALWAYS_ILLEGAL 0x00
|
||||
|
||||
|
@ -402,6 +402,7 @@
|
||||
*/
|
||||
#define ACPI_ERROR_NAMESPACE(s, e) AcpiNsReportError (AE_INFO, s, e);
|
||||
#define ACPI_ERROR_METHOD(s, n, p, e) AcpiNsReportMethodError (AE_INFO, s, n, p, e);
|
||||
#define ACPI_WARN_PREDEFINED(plist) AcpiUtPredefinedWarning plist
|
||||
|
||||
#else
|
||||
|
||||
@ -409,6 +410,7 @@
|
||||
|
||||
#define ACPI_ERROR_NAMESPACE(s, e)
|
||||
#define ACPI_ERROR_METHOD(s, n, p, e)
|
||||
#define ACPI_WARN_PREDEFINED(plist)
|
||||
|
||||
#endif /* ACPI_NO_ERROR_MESSAGES */
|
||||
|
||||
|
@ -146,6 +146,14 @@
|
||||
#define ACPI_NS_WALK_UNLOCK 0x01
|
||||
#define ACPI_NS_WALK_TEMP_NODES 0x02
|
||||
|
||||
/* Object is not a package element */
|
||||
|
||||
#define ACPI_NOT_PACKAGE_ELEMENT ACPI_UINT32_MAX
|
||||
|
||||
/* Always emit warning message, not dependent on node flags */
|
||||
|
||||
#define ACPI_WARN_ALWAYS 0
|
||||
|
||||
|
||||
/*
|
||||
* nsinit - Namespace initialization
|
||||
@ -240,6 +248,10 @@ void
|
||||
AcpiNsDeleteNode (
|
||||
ACPI_NAMESPACE_NODE *Node);
|
||||
|
||||
void
|
||||
AcpiNsRemoveNode (
|
||||
ACPI_NAMESPACE_NODE *Node);
|
||||
|
||||
void
|
||||
AcpiNsDeleteNamespaceSubtree (
|
||||
ACPI_NAMESPACE_NODE *ParentHandle);
|
||||
@ -310,6 +322,10 @@ ACPI_STATUS
|
||||
AcpiNsEvaluate (
|
||||
ACPI_EVALUATE_INFO *Info);
|
||||
|
||||
void
|
||||
AcpiNsExecModuleCodeList (
|
||||
void);
|
||||
|
||||
|
||||
/*
|
||||
* nspredef - Support for predefined/reserved names
|
||||
@ -411,6 +427,22 @@ AcpiNsGetAttachedData (
|
||||
void **Data);
|
||||
|
||||
|
||||
/*
|
||||
* nsrepair - return object repair for predefined methods/objects
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiNsRepairObject (
|
||||
ACPI_PREDEFINED_DATA *Data,
|
||||
UINT32 ExpectedBtypes,
|
||||
UINT32 PackageIndex,
|
||||
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsRepairPackageList (
|
||||
ACPI_PREDEFINED_DATA *Data,
|
||||
ACPI_OPERAND_OBJECT **ObjDescPtr);
|
||||
|
||||
|
||||
/*
|
||||
* nssearch - Namespace searching and entry
|
||||
*/
|
||||
|
@ -170,6 +170,7 @@
|
||||
#define AOPOBJ_OBJECT_INITIALIZED 0x08
|
||||
#define AOPOBJ_SETUP_COMPLETE 0x10
|
||||
#define AOPOBJ_SINGLE_DATUM 0x20
|
||||
#define AOPOBJ_MODULE_LEVEL 0x40
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -137,6 +137,7 @@
|
||||
#define ACPI_PARSE_DEFERRED_OP 0x0100
|
||||
#define ACPI_PARSE_DISASSEMBLE 0x0200
|
||||
|
||||
#define ACPI_PARSE_MODULE_LEVEL 0x0400
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
|
@ -120,7 +120,7 @@
|
||||
|
||||
/* Current ACPICA subsystem version in YYYYMMDD format */
|
||||
|
||||
#define ACPI_CA_VERSION 0x20090521
|
||||
#define ACPI_CA_VERSION 0x20090903
|
||||
|
||||
#include <contrib/dev/acpica/include/actypes.h>
|
||||
#include <contrib/dev/acpica/include/actbl.h>
|
||||
@ -336,7 +336,7 @@ AcpiEvaluateObjectTyped (
|
||||
ACPI_STATUS
|
||||
AcpiGetObjectInfo (
|
||||
ACPI_HANDLE Handle,
|
||||
ACPI_BUFFER *ReturnBuffer);
|
||||
ACPI_DEVICE_INFO **ReturnBuffer);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiInstallMethod (
|
||||
@ -573,12 +573,12 @@ AcpiReset (
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiRead (
|
||||
UINT32 *Value,
|
||||
UINT64 *Value,
|
||||
ACPI_GENERIC_ADDRESS *Reg);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiWrite (
|
||||
UINT32 Value,
|
||||
UINT64 Value,
|
||||
ACPI_GENERIC_ADDRESS *Reg);
|
||||
|
||||
ACPI_STATUS
|
||||
|
@ -136,8 +136,8 @@
|
||||
* (Used for _PRW)
|
||||
*
|
||||
*
|
||||
* 2) PTYPE2 packages contain a Variable-length number of sub-packages. Each of the
|
||||
* different types describe the contents of each of the sub-packages.
|
||||
* 2) PTYPE2 packages contain a Variable-length number of sub-packages. Each
|
||||
* of the different types describe the contents of each of the sub-packages.
|
||||
*
|
||||
* ACPI_PTYPE2: Each subpackage contains 1 or 2 object types:
|
||||
* object type
|
||||
@ -157,12 +157,15 @@
|
||||
* count
|
||||
* (Used for _CST)
|
||||
*
|
||||
* ACPI_PTYPE2_Fixed-length: Each subpackage is of Fixed-length length
|
||||
* ACPI_PTYPE2_FIXED: Each subpackage is of Fixed-length
|
||||
* (Used for _PRT)
|
||||
*
|
||||
* ACPI_PTYPE2_MIN: Each subpackage has a Variable-length but minimum length
|
||||
* (Used for _HPX)
|
||||
*
|
||||
* ACPI_PTYPE2_REV_FIXED: Revision at start, each subpackage is Fixed-length
|
||||
* (Used for _ART, _FPS)
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
enum AcpiReturnPackageTypes
|
||||
@ -174,10 +177,12 @@ enum AcpiReturnPackageTypes
|
||||
ACPI_PTYPE2_COUNT = 5,
|
||||
ACPI_PTYPE2_PKG_COUNT = 6,
|
||||
ACPI_PTYPE2_FIXED = 7,
|
||||
ACPI_PTYPE2_MIN = 8
|
||||
ACPI_PTYPE2_MIN = 8,
|
||||
ACPI_PTYPE2_REV_FIXED = 9
|
||||
};
|
||||
|
||||
|
||||
#ifdef ACPI_CREATE_PREDEFINED_TABLE
|
||||
/*
|
||||
* Predefined method/object information table.
|
||||
*
|
||||
@ -188,7 +193,7 @@ enum AcpiReturnPackageTypes
|
||||
* AcpiEvaluateObject:
|
||||
* _Lxx and _Exx GPE methods
|
||||
* _Qxx EC methods
|
||||
* _T_x compiler temporary Variable-lengths
|
||||
* _T_x compiler temporary variables
|
||||
*
|
||||
* 2) Predefined names that never actually exist within the AML code:
|
||||
* Predefined resource descriptor field names
|
||||
@ -263,21 +268,30 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
|
||||
{{{ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 2,0}, 0,0}},
|
||||
|
||||
{{"_ALT", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_ART", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (1 Int(rev), n Pkg (2 Ref/11 Int) */
|
||||
{{{ACPI_PTYPE2_REV_FIXED,ACPI_RTYPE_REFERENCE, 2, ACPI_RTYPE_INTEGER}, 11,0}},
|
||||
|
||||
{{"_BBN", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_BCL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints) */
|
||||
{{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0}, 0,0}},
|
||||
|
||||
{{"_BCM", 1, 0}},
|
||||
{{"_BCT", 1, ACPI_RTYPE_INTEGER}},
|
||||
{{"_BDN", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_BFS", 1, 0}},
|
||||
{{"_BIF", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (9 Int),(4 Str) */
|
||||
{{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 9, ACPI_RTYPE_STRING}, 4,0}},
|
||||
|
||||
{{"_BIX", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (16 Int),(4 Str) */
|
||||
{{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16, ACPI_RTYPE_STRING}, 4,0}},
|
||||
|
||||
{{"_BLT", 3, 0}},
|
||||
{{"_BMA", 1, ACPI_RTYPE_INTEGER}},
|
||||
{{"_BMC", 1, 0}},
|
||||
{{"_BMD", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (5 Int) */
|
||||
{{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 5,0}, 0,0}},
|
||||
|
||||
{{"_BMS", 1, ACPI_RTYPE_INTEGER}},
|
||||
{{"_BQC", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_BST", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (4 Int) */
|
||||
{{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0}, 0,0}},
|
||||
@ -285,6 +299,7 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
|
||||
{{"_BTM", 1, ACPI_RTYPE_INTEGER}},
|
||||
{{"_BTP", 1, 0}},
|
||||
{{"_CBA", 0, ACPI_RTYPE_INTEGER}}, /* See PCI firmware spec 3.0 */
|
||||
{{"_CDM", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_CID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints/Strs) */
|
||||
{{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING, 0,0}, 0,0}},
|
||||
|
||||
@ -310,6 +325,7 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
|
||||
{{"_DSM", 4, ACPI_RTYPE_ALL}}, /* Must return a type, but it can be of any type */
|
||||
{{"_DSS", 1, 0}},
|
||||
{{"_DSW", 3, 0}},
|
||||
{{"_DTI", 1, 0}},
|
||||
{{"_EC_", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_EDL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs)*/
|
||||
{{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}},
|
||||
@ -325,9 +341,22 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
|
||||
{{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16,0}, 0,0}},
|
||||
|
||||
{{"_FDM", 1, 0}},
|
||||
{{"_FIF", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (4 Int) */
|
||||
{{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0}, 0,0}},
|
||||
|
||||
{{"_FIX", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints) */
|
||||
{{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0}, 0,0}},
|
||||
|
||||
{{"_FPS", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (1 Int(rev), n Pkg (5 Int) */
|
||||
{{{ACPI_PTYPE2_REV_FIXED,ACPI_RTYPE_INTEGER, 5, 0}, 0,0}},
|
||||
|
||||
{{"_FSL", 1, 0}},
|
||||
{{"_FST", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (3 Int) */
|
||||
{{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3,0}, 0,0}},
|
||||
|
||||
|
||||
{{"_GAI", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_GHL", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_GLK", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_GPD", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_GPE", 0, ACPI_RTYPE_INTEGER}}, /* _GPE method, not _GPE scope */
|
||||
@ -355,15 +384,21 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
|
||||
{{"_LCK", 1, 0}},
|
||||
{{"_LID", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_MAT", 0, ACPI_RTYPE_BUFFER}},
|
||||
{{"_MBM", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (8 Int) */
|
||||
{{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 8,0}, 0,0}},
|
||||
|
||||
{{"_MLS", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (2 Str) */
|
||||
{{{ACPI_PTYPE2, ACPI_RTYPE_STRING, 2,0}, 0,0}},
|
||||
|
||||
{{"_MSG", 1, 0}},
|
||||
{{"_MSM", 4, ACPI_RTYPE_INTEGER}},
|
||||
{{"_NTT", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_OFF", 0, 0}},
|
||||
{{"_ON_", 0, 0}},
|
||||
{{"_OS_", 0, ACPI_RTYPE_STRING}},
|
||||
{{"_OSC", 4, ACPI_RTYPE_BUFFER}},
|
||||
{{"_OST", 3, 0}},
|
||||
{{"_PAI", 1, ACPI_RTYPE_INTEGER}},
|
||||
{{"_PCL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */
|
||||
{{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}},
|
||||
|
||||
@ -371,10 +406,21 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
|
||||
{{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_BUFFER, 2,0}, 0,0}},
|
||||
|
||||
{{"_PDC", 1, 0}},
|
||||
{{"_PDL", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_PIC", 1, 0}},
|
||||
{{"_PIF", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (3 Int),(3 Str) */
|
||||
{{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3, ACPI_RTYPE_STRING}, 3,0}},
|
||||
|
||||
{{"_PLD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Bufs) */
|
||||
{{{ACPI_PTYPE1_VAR, ACPI_RTYPE_BUFFER, 0,0}, 0,0}},
|
||||
|
||||
{{"_PMC", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (11 Int),(3 Str) */
|
||||
{{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 11, ACPI_RTYPE_STRING}, 3,0}},
|
||||
|
||||
{{"_PMD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */
|
||||
{{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}},
|
||||
|
||||
{{"_PMM", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_PPC", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_PPE", 0, ACPI_RTYPE_INTEGER}}, /* See dig64 spec */
|
||||
{{"_PR0", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */
|
||||
@ -386,17 +432,26 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
|
||||
{{"_PR2", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */
|
||||
{{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}},
|
||||
|
||||
{{"_PR3", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */
|
||||
{{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}},
|
||||
|
||||
{{"_PRL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */
|
||||
{{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}},
|
||||
|
||||
{{"_PRS", 0, ACPI_RTYPE_BUFFER}},
|
||||
|
||||
/*
|
||||
* For _PRT, many BIOSs reverse the 2nd and 3rd Package elements. This bug is so prevalent that there
|
||||
* is code in the ACPICA Resource Manager to detect this and switch them back. For now, do not allow
|
||||
* and issue a warning. To allow this and eliminate the warning, add the ACPI_RTYPE_REFERENCE
|
||||
* type to the 2nd element (index 1) in the statement below.
|
||||
* For _PRT, many BIOSs reverse the 3rd and 4th Package elements (Source
|
||||
* and SourceIndex). This bug is so prevalent that there is code in the
|
||||
* ACPICA Resource Manager to detect this and switch them back. For now,
|
||||
* do not allow and issue a warning. To allow this and eliminate the
|
||||
* warning, add the ACPI_RTYPE_REFERENCE type to the 4th element (index 3)
|
||||
* in the statement below.
|
||||
*/
|
||||
{{"_PRT", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (4): Int,Int,Int/Ref,Int */
|
||||
{{{ACPI_PTYPE2_FIXED, 4, ACPI_RTYPE_INTEGER,ACPI_RTYPE_INTEGER},
|
||||
ACPI_RTYPE_INTEGER | ACPI_RTYPE_REFERENCE,ACPI_RTYPE_INTEGER}},
|
||||
ACPI_RTYPE_INTEGER | ACPI_RTYPE_REFERENCE,
|
||||
ACPI_RTYPE_INTEGER}},
|
||||
|
||||
{{"_PRW", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each: Pkg/Int,Int,[Variable-length Refs] (Pkg is Ref/Int) */
|
||||
{{{ACPI_PTYPE1_OPTION, 2, ACPI_RTYPE_INTEGER | ACPI_RTYPE_PACKAGE,
|
||||
@ -422,7 +477,11 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
|
||||
{{"_PTC", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (2 Buf) */
|
||||
{{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_BUFFER, 2,0}, 0,0}},
|
||||
|
||||
{{"_PTP", 2, ACPI_RTYPE_INTEGER}},
|
||||
{{"_PTS", 1, 0}},
|
||||
{{"_PUR", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (2 Int) */
|
||||
{{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 2,0}, 0,0}},
|
||||
|
||||
{{"_PXM", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_REG", 2, 0}},
|
||||
{{"_REV", 0, ACPI_RTYPE_INTEGER}},
|
||||
@ -468,6 +527,7 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
|
||||
/* Note: the 3-arg definition may be removed for ACPI 4.0 */
|
||||
{{"_SDD", 1, 0}},
|
||||
{{"_SEG", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_SHL", 1, ACPI_RTYPE_INTEGER}},
|
||||
{{"_SLI", 0, ACPI_RTYPE_BUFFER}},
|
||||
{{"_SPD", 1, ACPI_RTYPE_INTEGER}},
|
||||
{{"_SRS", 1, 0}},
|
||||
@ -475,11 +535,15 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
|
||||
{{"_SST", 1, 0}},
|
||||
{{"_STA", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_STM", 3, 0}},
|
||||
{{"_STP", 2, ACPI_RTYPE_INTEGER}},
|
||||
{{"_STR", 0, ACPI_RTYPE_BUFFER}},
|
||||
{{"_STV", 2, ACPI_RTYPE_INTEGER}},
|
||||
{{"_SUN", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_SWS", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_TC1", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_TC2", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_TIP", 1, ACPI_RTYPE_INTEGER}},
|
||||
{{"_TIV", 1, ACPI_RTYPE_INTEGER}},
|
||||
{{"_TMP", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_TPC", 0, ACPI_RTYPE_INTEGER}},
|
||||
{{"_TPT", 1, 0}},
|
||||
@ -530,5 +594,5 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
|
||||
_PRT - currently ignore reversed entries. Attempt to fix here?
|
||||
Think about possibly fixing package elements like _BIF, etc.
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -116,9 +116,25 @@
|
||||
#ifndef __ACTBL_H__
|
||||
#define __ACTBL_H__
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Fundamental ACPI tables
|
||||
*
|
||||
* This file contains definitions for the ACPI tables that are directly consumed
|
||||
* by ACPICA. All other tables are consumed by the OS-dependent ACPI-related
|
||||
* device drivers and other OS support code.
|
||||
*
|
||||
* The RSDP and FACS do not use the common ACPI table header. All other ACPI
|
||||
* tables use the header.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* Values for description table header signatures. Useful because they make
|
||||
* it more difficult to inadvertently type in the wrong signature.
|
||||
* Values for description table header signatures for tables defined in this
|
||||
* file. Useful because they make it more difficult to inadvertently type in
|
||||
* the wrong signature.
|
||||
*/
|
||||
#define ACPI_SIG_DSDT "DSDT" /* Differentiated System Description Table */
|
||||
#define ACPI_SIG_FADT "FACP" /* Fixed ACPI Description Table */
|
||||
@ -137,23 +153,17 @@
|
||||
*/
|
||||
#pragma pack(1)
|
||||
|
||||
|
||||
/*
|
||||
* These are the ACPI tables that are directly consumed by the subsystem.
|
||||
*
|
||||
* The RSDP and FACS do not use the common ACPI table header. All other ACPI
|
||||
* tables use the header.
|
||||
*
|
||||
* Note about bitfields: The UINT8 type is used for bitfields in ACPI tables.
|
||||
* This is the only type that is even remotely portable. Anything else is not
|
||||
* portable, so do not use any other bitfield types.
|
||||
*/
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* ACPI Table Header. This common header is used by all tables except the
|
||||
* RSDP and FACS. The define is used for direct inclusion of header into
|
||||
* other ACPI tables
|
||||
* Master ACPI Table Header. This common header is used by all ACPI tables
|
||||
* except the RSDP and FACS.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -172,13 +182,16 @@ typedef struct acpi_table_header
|
||||
} ACPI_TABLE_HEADER;
|
||||
|
||||
|
||||
/*
|
||||
/*******************************************************************************
|
||||
*
|
||||
* GAS - Generic Address Structure (ACPI 2.0+)
|
||||
*
|
||||
* Note: Since this structure is used in the ACPI tables, it is byte aligned.
|
||||
* If misalignment is not supported, access to the Address field must be
|
||||
* performed with care.
|
||||
*/
|
||||
* If misaliged access is not supported by the hardware, accesses to the
|
||||
* 64-bit Address field must be performed with care.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_generic_address
|
||||
{
|
||||
UINT8 SpaceId; /* Address space where struct or register exists */
|
||||
@ -193,6 +206,7 @@ typedef struct acpi_generic_address
|
||||
/*******************************************************************************
|
||||
*
|
||||
* RSDP - Root System Description Pointer (Signature is "RSD PTR ")
|
||||
* Version 2
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -216,6 +230,7 @@ typedef struct acpi_table_rsdp
|
||||
/*******************************************************************************
|
||||
*
|
||||
* RSDT/XSDT - Root System Description Tables
|
||||
* Version 1 (both)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -250,23 +265,31 @@ typedef struct acpi_table_facs
|
||||
UINT32 Flags;
|
||||
UINT64 XFirmwareWakingVector; /* 64-bit version of the Firmware Waking Vector (ACPI 2.0+) */
|
||||
UINT8 Version; /* Version of this table (ACPI 2.0+) */
|
||||
UINT8 Reserved[31]; /* Reserved, must be zero */
|
||||
UINT8 Reserved[3]; /* Reserved, must be zero */
|
||||
UINT32 OspmFlags; /* Flags to be set by OSPM (ACPI 4.0) */
|
||||
UINT8 Reserved1[24]; /* Reserved, must be zero */
|
||||
|
||||
} ACPI_TABLE_FACS;
|
||||
|
||||
/* Flag macros */
|
||||
/* Masks for GlobalLock flag field above */
|
||||
|
||||
#define ACPI_FACS_S4_BIOS_PRESENT (1) /* 00: S4BIOS support is present */
|
||||
#define ACPI_GLOCK_PENDING (1) /* 00: Pending global lock ownership */
|
||||
#define ACPI_GLOCK_OWNED (1<<1) /* 01: Global lock is owned */
|
||||
|
||||
/* Global lock flags */
|
||||
/* Masks for Flags field above */
|
||||
|
||||
#define ACPI_GLOCK_PENDING 0x01 /* 00: Pending global lock ownership */
|
||||
#define ACPI_GLOCK_OWNED 0x02 /* 01: Global lock is owned */
|
||||
#define ACPI_FACS_S4_BIOS_PRESENT (1) /* 00: S4BIOS support is present */
|
||||
#define ACPI_FACS_64BIT_WAKE (1<<1) /* 01: 64-bit wake vector supported (ACPI 4.0) */
|
||||
|
||||
/* Masks for OspmFlags field above */
|
||||
|
||||
#define ACPI_FACS_64BIT_ENVIRONMENT (1) /* 00: 64-bit wake environment is required (ACPI 4.0) */
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FADT - Fixed ACPI Description Table (Signature "FACP")
|
||||
* Version 4
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -330,7 +353,7 @@ typedef struct acpi_table_fadt
|
||||
} ACPI_TABLE_FADT;
|
||||
|
||||
|
||||
/* FADT Boot Architecture Flags (BootFlags) */
|
||||
/* Masks for FADT Boot Architecture Flags (BootFlags) */
|
||||
|
||||
#define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */
|
||||
#define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */
|
||||
@ -338,7 +361,7 @@ typedef struct acpi_table_fadt
|
||||
#define ACPI_FADT_NO_MSI (1<<3) /* 03: [V4] Message Signaled Interrupts (MSI) must not be enabled */
|
||||
#define ACPI_FADT_NO_ASPM (1<<4) /* 04: [V4] PCIe ASPM control must not be enabled */
|
||||
|
||||
/* FADT flags */
|
||||
/* Masks for FADT flags */
|
||||
|
||||
#define ACPI_FADT_WBINVD (1) /* 00: [V1] The wbinvd instruction works properly */
|
||||
#define ACPI_FADT_WBINVD_FLUSH (1<<1) /* 01: [V1] wbinvd flushes but does not invalidate caches */
|
||||
@ -362,7 +385,7 @@ typedef struct acpi_table_fadt
|
||||
#define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local xAPICs must use physical dest mode (ACPI 3.0) */
|
||||
|
||||
|
||||
/* FADT Prefered Power Management Profiles */
|
||||
/* Values for PreferredProfile (Prefered Power Management Profiles) */
|
||||
|
||||
enum AcpiPreferedPmProfiles
|
||||
{
|
||||
@ -381,6 +404,9 @@ enum AcpiPreferedPmProfiles
|
||||
#pragma pack()
|
||||
|
||||
|
||||
/*
|
||||
* Internal table-related structures
|
||||
*/
|
||||
typedef union acpi_name_union
|
||||
{
|
||||
UINT32 Integer;
|
||||
@ -388,9 +414,9 @@ typedef union acpi_name_union
|
||||
|
||||
} ACPI_NAME_UNION;
|
||||
|
||||
/*
|
||||
* Internal ACPI Table Descriptor. One per ACPI table
|
||||
*/
|
||||
|
||||
/* Internal ACPI Table Descriptor. One per ACPI table. */
|
||||
|
||||
typedef struct acpi_table_desc
|
||||
{
|
||||
ACPI_PHYSICAL_ADDRESS Address;
|
||||
@ -402,7 +428,7 @@ typedef struct acpi_table_desc
|
||||
|
||||
} ACPI_TABLE_DESC;
|
||||
|
||||
/* Flags for above */
|
||||
/* Masks for Flags field above */
|
||||
|
||||
#define ACPI_TABLE_ORIGIN_UNKNOWN (0)
|
||||
#define ACPI_TABLE_ORIGIN_MAPPED (1)
|
||||
@ -416,6 +442,7 @@ typedef struct acpi_table_desc
|
||||
* Get the remaining ACPI tables
|
||||
*/
|
||||
#include <contrib/dev/acpica/include/actbl1.h>
|
||||
#include "actbl2.h"
|
||||
|
||||
/* Macros used to generate offsets to specific table fields */
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
1124
sys/contrib/dev/acpica/include/actbl2.h
Normal file
1124
sys/contrib/dev/acpica/include/actbl2.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -415,7 +415,7 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS;
|
||||
|
||||
/* PM Timer ticks per second (HZ) */
|
||||
|
||||
#define PM_TIMER_FREQUENCY 3579545
|
||||
#define PM_TIMER_FREQUENCY 3579545
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
@ -816,7 +816,8 @@ typedef UINT8 ACPI_ADR_SPACE_TYPE;
|
||||
#define ACPI_ADR_SPACE_SMBUS (ACPI_ADR_SPACE_TYPE) 4
|
||||
#define ACPI_ADR_SPACE_CMOS (ACPI_ADR_SPACE_TYPE) 5
|
||||
#define ACPI_ADR_SPACE_PCI_BAR_TARGET (ACPI_ADR_SPACE_TYPE) 6
|
||||
#define ACPI_ADR_SPACE_DATA_TABLE (ACPI_ADR_SPACE_TYPE) 7
|
||||
#define ACPI_ADR_SPACE_IPMI (ACPI_ADR_SPACE_TYPE) 7
|
||||
#define ACPI_ADR_SPACE_DATA_TABLE (ACPI_ADR_SPACE_TYPE) 8
|
||||
#define ACPI_ADR_SPACE_FIXED_HARDWARE (ACPI_ADR_SPACE_TYPE) 127
|
||||
|
||||
|
||||
@ -1056,7 +1057,6 @@ void (*ACPI_NOTIFY_HANDLER) (
|
||||
typedef
|
||||
void (*ACPI_OBJECT_HANDLER) (
|
||||
ACPI_HANDLE Object,
|
||||
UINT32 Function,
|
||||
void *Data);
|
||||
|
||||
typedef
|
||||
@ -1123,46 +1123,67 @@ ACPI_STATUS (*ACPI_WALK_CALLBACK) (
|
||||
#define ACPI_INTERRUPT_NOT_HANDLED 0x00
|
||||
#define ACPI_INTERRUPT_HANDLED 0x01
|
||||
|
||||
/* Length of 32-bit EISAID values when converted back to a string */
|
||||
|
||||
/* Length of _HID, _UID, _CID, and UUID values */
|
||||
#define ACPI_EISAID_STRING_SIZE 8 /* Includes null terminator */
|
||||
|
||||
/* Length of UUID (string) values */
|
||||
|
||||
#define ACPI_DEVICE_ID_LENGTH 0x09
|
||||
#define ACPI_MAX_CID_LENGTH 48
|
||||
#define ACPI_UUID_LENGTH 16
|
||||
|
||||
/* Common string version of device HIDs and UIDs */
|
||||
|
||||
/* Structures used for device/processor HID, UID, CID */
|
||||
|
||||
typedef struct acpi_device_id
|
||||
{
|
||||
char Value[ACPI_DEVICE_ID_LENGTH];
|
||||
UINT32 Length; /* Length of string + null */
|
||||
char *String;
|
||||
|
||||
} ACPI_DEVICE_ID;
|
||||
|
||||
/* Common string version of device CIDs */
|
||||
|
||||
typedef struct acpi_compatible_id
|
||||
typedef struct acpi_device_id_list
|
||||
{
|
||||
char Value[ACPI_MAX_CID_LENGTH];
|
||||
UINT32 Count; /* Number of IDs in Ids array */
|
||||
UINT32 ListSize; /* Size of list, including ID strings */
|
||||
ACPI_DEVICE_ID Ids[1]; /* ID array */
|
||||
|
||||
} ACPI_COMPATIBLE_ID;
|
||||
} ACPI_DEVICE_ID_LIST;
|
||||
|
||||
typedef struct acpi_compatible_id_list
|
||||
/*
|
||||
* Structure returned from AcpiGetObjectInfo.
|
||||
* Optimized for both 32- and 64-bit builds
|
||||
*/
|
||||
typedef struct acpi_device_info
|
||||
{
|
||||
UINT32 Count;
|
||||
UINT32 Size;
|
||||
ACPI_COMPATIBLE_ID Id[1];
|
||||
UINT32 InfoSize; /* Size of info, including ID strings */
|
||||
UINT32 Name; /* ACPI object Name */
|
||||
ACPI_OBJECT_TYPE Type; /* ACPI object Type */
|
||||
UINT8 ParamCount; /* If a method, required parameter count */
|
||||
UINT8 Valid; /* Indicates which optional fields are valid */
|
||||
UINT8 Flags; /* Miscellaneous info */
|
||||
UINT8 HighestDstates[4]; /* _SxD values: 0xFF indicates not valid */
|
||||
UINT8 LowestDstates[5]; /* _SxW values: 0xFF indicates not valid */
|
||||
UINT32 CurrentStatus; /* _STA value */
|
||||
ACPI_INTEGER Address; /* _ADR value */
|
||||
ACPI_DEVICE_ID HardwareId; /* _HID value */
|
||||
ACPI_DEVICE_ID UniqueId; /* _UID value */
|
||||
ACPI_DEVICE_ID_LIST CompatibleIdList; /* _CID list <must be last> */
|
||||
|
||||
} ACPI_COMPATIBLE_ID_LIST;
|
||||
} ACPI_DEVICE_INFO;
|
||||
|
||||
/* Values for Flags field above (AcpiGetObjectInfo) */
|
||||
|
||||
/* Structure and flags for AcpiGetObjectInfo */
|
||||
#define ACPI_PCI_ROOT_BRIDGE 0x01
|
||||
|
||||
#define ACPI_VALID_STA 0x0001
|
||||
#define ACPI_VALID_ADR 0x0002
|
||||
#define ACPI_VALID_HID 0x0004
|
||||
#define ACPI_VALID_UID 0x0008
|
||||
#define ACPI_VALID_CID 0x0010
|
||||
#define ACPI_VALID_SXDS 0x0020
|
||||
/* Flags for Valid field above (AcpiGetObjectInfo) */
|
||||
|
||||
#define ACPI_VALID_STA 0x01
|
||||
#define ACPI_VALID_ADR 0x02
|
||||
#define ACPI_VALID_HID 0x04
|
||||
#define ACPI_VALID_UID 0x08
|
||||
#define ACPI_VALID_CID 0x10
|
||||
#define ACPI_VALID_SXDS 0x20
|
||||
#define ACPI_VALID_SXWS 0x40
|
||||
|
||||
/* Flags for _STA method */
|
||||
|
||||
@ -1174,36 +1195,6 @@ typedef struct acpi_compatible_id_list
|
||||
#define ACPI_STA_BATTERY_PRESENT 0x10
|
||||
|
||||
|
||||
#define ACPI_COMMON_OBJ_INFO \
|
||||
ACPI_OBJECT_TYPE Type; /* ACPI object type */ \
|
||||
ACPI_NAME Name /* ACPI object Name */
|
||||
|
||||
|
||||
typedef struct acpi_obj_info_header
|
||||
{
|
||||
ACPI_COMMON_OBJ_INFO;
|
||||
|
||||
} ACPI_OBJ_INFO_HEADER;
|
||||
|
||||
|
||||
/* Structure returned from Get Object Info */
|
||||
|
||||
typedef struct acpi_device_info
|
||||
{
|
||||
ACPI_COMMON_OBJ_INFO;
|
||||
|
||||
UINT32 ParamCount; /* If a method, required parameter count */
|
||||
UINT32 Valid; /* Indicates which fields below are valid */
|
||||
UINT32 CurrentStatus; /* _STA value */
|
||||
ACPI_INTEGER Address; /* _ADR value if any */
|
||||
ACPI_DEVICE_ID HardwareId; /* _HID value if any */
|
||||
ACPI_DEVICE_ID UniqueId; /* _UID value if any */
|
||||
UINT8 HighestDstates[4]; /* _SxD values: 0xFF indicates not valid */
|
||||
ACPI_COMPATIBLE_ID_LIST CompatibilityId; /* List of _CIDs if any */
|
||||
|
||||
} ACPI_DEVICE_INFO;
|
||||
|
||||
|
||||
/* Context structs for address space handlers */
|
||||
|
||||
typedef struct acpi_pci_id
|
||||
@ -1215,7 +1206,6 @@ typedef struct acpi_pci_id
|
||||
|
||||
} ACPI_PCI_ID;
|
||||
|
||||
|
||||
typedef struct acpi_mem_space_context
|
||||
{
|
||||
UINT32 Length;
|
||||
|
@ -550,17 +550,7 @@ ACPI_STATUS
|
||||
AcpiUtEvaluateNumericObject (
|
||||
char *ObjectName,
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_INTEGER *Address);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_HID (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_DEVICE_ID *Hid);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_CID (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_COMPATIBLE_ID_LIST **ReturnCidList);
|
||||
ACPI_INTEGER *Value);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_STA (
|
||||
@ -568,14 +558,31 @@ AcpiUtExecute_STA (
|
||||
UINT32 *StatusFlags);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_UID (
|
||||
AcpiUtExecutePowerMethods (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_DEVICE_ID *Uid);
|
||||
const char **MethodNames,
|
||||
UINT8 MethodCount,
|
||||
UINT8 *OutValues);
|
||||
|
||||
|
||||
/*
|
||||
* utids - device ID support
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_HID (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_DEVICE_ID **ReturnId);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_Sxds (
|
||||
AcpiUtExecute_UID (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
UINT8 *Highest);
|
||||
ACPI_DEVICE_ID **ReturnId);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_CID (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_DEVICE_ID_LIST **ReturnCidList);
|
||||
|
||||
|
||||
/*
|
||||
* utlock - reader/writer locks
|
||||
@ -728,6 +735,10 @@ const char *
|
||||
AcpiUtValidateException (
|
||||
ACPI_STATUS Status);
|
||||
|
||||
BOOLEAN
|
||||
AcpiUtIsPciRootBridge (
|
||||
char *Id);
|
||||
|
||||
BOOLEAN
|
||||
AcpiUtIsAmlTable (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
@ -775,6 +786,15 @@ AcpiUtStrtoul64 (
|
||||
UINT32 Base,
|
||||
ACPI_INTEGER *RetInteger);
|
||||
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
AcpiUtPredefinedWarning (
|
||||
const char *ModuleName,
|
||||
UINT32 LineNumber,
|
||||
char *Pathname,
|
||||
UINT8 NodeFlags,
|
||||
const char *Format,
|
||||
...);
|
||||
|
||||
/* Values for Base above (16=Hex, 10=Decimal) */
|
||||
|
||||
#define ACPI_ANY_BASE 0
|
||||
|
@ -485,6 +485,7 @@ typedef enum
|
||||
REGION_SMBUS,
|
||||
REGION_CMOS,
|
||||
REGION_PCI_BAR,
|
||||
REGION_IPMI,
|
||||
REGION_DATA_TABLE, /* Internal use only */
|
||||
REGION_FIXED_HW = 0x7F
|
||||
|
||||
|
@ -181,20 +181,78 @@ AcpiNsCreateNode (
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Delete a namespace node
|
||||
* DESCRIPTION: Delete a namespace node. All node deletions must come through
|
||||
* here. Detaches any attached objects, including any attached
|
||||
* data. If a handler is associated with attached data, it is
|
||||
* invoked before the node is deleted.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiNsDeleteNode (
|
||||
ACPI_NAMESPACE_NODE *Node)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (NsDeleteNode);
|
||||
|
||||
|
||||
/* Detach an object if there is one */
|
||||
|
||||
AcpiNsDetachObject (Node);
|
||||
|
||||
/*
|
||||
* Delete an attached data object if present (an object that was created
|
||||
* and attached via AcpiAttachData). Note: After any normal object is
|
||||
* detached above, the only possible remaining object is a data object.
|
||||
*/
|
||||
ObjDesc = Node->Object;
|
||||
if (ObjDesc &&
|
||||
(ObjDesc->Common.Type == ACPI_TYPE_LOCAL_DATA))
|
||||
{
|
||||
/* Invoke the attached data deletion handler if present */
|
||||
|
||||
if (ObjDesc->Data.Handler)
|
||||
{
|
||||
ObjDesc->Data.Handler (Node, ObjDesc->Data.Pointer);
|
||||
}
|
||||
|
||||
AcpiUtRemoveReference (ObjDesc);
|
||||
}
|
||||
|
||||
/* Now we can delete the node */
|
||||
|
||||
(void) AcpiOsReleaseObject (AcpiGbl_NamespaceCache, Node);
|
||||
|
||||
ACPI_MEM_TRACKING (AcpiGbl_NsNodeList->TotalFreed++);
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Node %p, Remaining %X\n",
|
||||
Node, AcpiGbl_CurrentNodeCount));
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsRemoveNode
|
||||
*
|
||||
* PARAMETERS: Node - Node to be removed/deleted
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Remove (unlink) and delete a namespace node
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiNsRemoveNode (
|
||||
ACPI_NAMESPACE_NODE *Node)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *ParentNode;
|
||||
ACPI_NAMESPACE_NODE *PrevNode;
|
||||
ACPI_NAMESPACE_NODE *NextNode;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (NsDeleteNode, Node);
|
||||
ACPI_FUNCTION_TRACE_PTR (NsRemoveNode, Node);
|
||||
|
||||
|
||||
ParentNode = AcpiNsGetParentNode (Node);
|
||||
@ -237,12 +295,9 @@ AcpiNsDeleteNode (
|
||||
}
|
||||
}
|
||||
|
||||
ACPI_MEM_TRACKING (AcpiGbl_NsNodeList->TotalFreed++);
|
||||
/* Delete the node and any attached objects */
|
||||
|
||||
/* Detach an object if there is one, then delete the node */
|
||||
|
||||
AcpiNsDetachObject (Node);
|
||||
(void) AcpiOsReleaseObject (AcpiGbl_NamespaceCache, Node);
|
||||
AcpiNsDeleteNode (Node);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
@ -385,23 +440,11 @@ AcpiNsDeleteChildren (
|
||||
ParentNode, ChildNode));
|
||||
}
|
||||
|
||||
/* Now we can free this child object */
|
||||
|
||||
ACPI_MEM_TRACKING (AcpiGbl_NsNodeList->TotalFreed++);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Object %p, Remaining %X\n",
|
||||
ChildNode, AcpiGbl_CurrentNodeCount));
|
||||
|
||||
/* Detach an object if there is one, then free the child node */
|
||||
|
||||
AcpiNsDetachObject (ChildNode);
|
||||
|
||||
/* Now we can delete the node */
|
||||
|
||||
(void) AcpiOsReleaseObject (AcpiGbl_NamespaceCache, ChildNode);
|
||||
|
||||
/* And move on to the next child in the list */
|
||||
|
||||
/*
|
||||
* Delete this child node and move on to the next child in the list.
|
||||
* No need to unlink the node since we are deleting the entire branch.
|
||||
*/
|
||||
AcpiNsDeleteNode (ChildNode);
|
||||
ChildNode = NextNode;
|
||||
|
||||
} while (!(Flags & ANOBJ_END_OF_PEER_LIST));
|
||||
@ -561,7 +604,7 @@ AcpiNsDeleteNamespaceByOwner (
|
||||
if (DeletionNode)
|
||||
{
|
||||
AcpiNsDeleteChildren (DeletionNode);
|
||||
AcpiNsDeleteNode (DeletionNode);
|
||||
AcpiNsRemoveNode (DeletionNode);
|
||||
DeletionNode = NULL;
|
||||
}
|
||||
|
||||
|
@ -126,6 +126,13 @@
|
||||
#define _COMPONENT ACPI_NAMESPACE
|
||||
ACPI_MODULE_NAME ("nseval")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
AcpiNsExecModuleCode (
|
||||
ACPI_OPERAND_OBJECT *MethodObj,
|
||||
ACPI_EVALUATE_INFO *Info);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -360,3 +367,145 @@ AcpiNsEvaluate (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsExecModuleCodeList
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None. Exceptions during method execution are ignored, since
|
||||
* we cannot abort a table load.
|
||||
*
|
||||
* DESCRIPTION: Execute all elements of the global module-level code list.
|
||||
* Each element is executed as a single control method.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiNsExecModuleCodeList (
|
||||
void)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *Prev;
|
||||
ACPI_OPERAND_OBJECT *Next;
|
||||
ACPI_EVALUATE_INFO *Info;
|
||||
UINT32 MethodCount = 0;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (NsExecModuleCodeList);
|
||||
|
||||
|
||||
/* Exit now if the list is empty */
|
||||
|
||||
Next = AcpiGbl_ModuleCodeList;
|
||||
if (!Next)
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* Allocate the evaluation information block */
|
||||
|
||||
Info = ACPI_ALLOCATE (sizeof (ACPI_EVALUATE_INFO));
|
||||
if (!Info)
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* Walk the list, executing each "method" */
|
||||
|
||||
while (Next)
|
||||
{
|
||||
Prev = Next;
|
||||
Next = Next->Method.Mutex;
|
||||
|
||||
/* Clear the link field and execute the method */
|
||||
|
||||
Prev->Method.Mutex = NULL;
|
||||
AcpiNsExecModuleCode (Prev, Info);
|
||||
MethodCount++;
|
||||
|
||||
/* Delete the (temporary) method object */
|
||||
|
||||
AcpiUtRemoveReference (Prev);
|
||||
}
|
||||
|
||||
ACPI_INFO ((AE_INFO,
|
||||
"Executed %u blocks of module-level executable AML code",
|
||||
MethodCount));
|
||||
|
||||
ACPI_FREE (Info);
|
||||
AcpiGbl_ModuleCodeList = NULL;
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsExecModuleCode
|
||||
*
|
||||
* PARAMETERS: MethodObj - Object container for the module-level code
|
||||
* Info - Info block for method evaluation
|
||||
*
|
||||
* RETURN: None. Exceptions during method execution are ignored, since
|
||||
* we cannot abort a table load.
|
||||
*
|
||||
* DESCRIPTION: Execute a control method containing a block of module-level
|
||||
* executable AML code. The control method is temporarily
|
||||
* installed to the root node, then evaluated.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
AcpiNsExecModuleCode (
|
||||
ACPI_OPERAND_OBJECT *MethodObj,
|
||||
ACPI_EVALUATE_INFO *Info)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *RootObj;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (NsExecModuleCode);
|
||||
|
||||
|
||||
/* Initialize the evaluation information block */
|
||||
|
||||
ACPI_MEMSET (Info, 0, sizeof (ACPI_EVALUATE_INFO));
|
||||
Info->PrefixNode = AcpiGbl_RootNode;
|
||||
|
||||
/*
|
||||
* Get the currently attached root object. Add a reference, because the
|
||||
* ref count will be decreased when the method object is installed to
|
||||
* the root node.
|
||||
*/
|
||||
RootObj = AcpiNsGetAttachedObject (AcpiGbl_RootNode);
|
||||
AcpiUtAddReference (RootObj);
|
||||
|
||||
/* Install the method (module-level code) in the root node */
|
||||
|
||||
Status = AcpiNsAttachObject (AcpiGbl_RootNode, MethodObj,
|
||||
ACPI_TYPE_METHOD);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
/* Execute the root node as a control method */
|
||||
|
||||
Status = AcpiNsEvaluate (Info);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "Executed module-level code at %p\n",
|
||||
MethodObj->Method.AmlStart));
|
||||
|
||||
/* Detach the temporary method object */
|
||||
|
||||
AcpiNsDetachObject (AcpiGbl_RootNode);
|
||||
|
||||
/* Restore the original root object */
|
||||
|
||||
Status = AcpiNsAttachObject (AcpiGbl_RootNode, RootObj, ACPI_TYPE_DEVICE);
|
||||
|
||||
Exit:
|
||||
AcpiUtRemoveReference (RootObj);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
@ -264,6 +264,22 @@ AcpiNsInitializeDevices (
|
||||
goto ErrorExit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Execute the "global" _INI method that may appear at the root. This
|
||||
* support is provided for Windows compatibility (Vista+) and is not
|
||||
* part of the ACPI specification.
|
||||
*/
|
||||
Info.EvaluateInfo->PrefixNode = AcpiGbl_RootNode;
|
||||
Info.EvaluateInfo->Pathname = METHOD_NAME__INI;
|
||||
Info.EvaluateInfo->Parameters = NULL;
|
||||
Info.EvaluateInfo->Flags = ACPI_IGNORE_RETURN_VALUE;
|
||||
|
||||
Status = AcpiNsEvaluate (Info.EvaluateInfo);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Info.Num_INI++;
|
||||
}
|
||||
|
||||
/* Walk namespace to execute all _INIs on present devices */
|
||||
|
||||
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
|
||||
|
@ -376,8 +376,7 @@ AcpiNsDeleteSubtree (
|
||||
|
||||
/* Now delete the starting object, and we are done */
|
||||
|
||||
AcpiNsDeleteNode (ChildHandle);
|
||||
|
||||
AcpiNsRemoveNode (ChildHandle);
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
291
sys/contrib/dev/acpica/namespace/nsrepair.c
Normal file
291
sys/contrib/dev/acpica/namespace/nsrepair.c
Normal file
@ -0,0 +1,291 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: nsrepair - Repair for objects returned by predefined methods
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __NSREPAIR_C__
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acpredef.h"
|
||||
|
||||
#define _COMPONENT ACPI_NAMESPACE
|
||||
ACPI_MODULE_NAME ("nsrepair")
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsRepairObject
|
||||
*
|
||||
* PARAMETERS: Data - Pointer to validation data structure
|
||||
* ExpectedBtypes - Object types expected
|
||||
* PackageIndex - Index of object within parent package (if
|
||||
* applicable - ACPI_NOT_PACKAGE_ELEMENT
|
||||
* otherwise)
|
||||
* ReturnObjectPtr - Pointer to the object returned from the
|
||||
* evaluation of a method or object
|
||||
*
|
||||
* RETURN: Status. AE_OK if repair was successful.
|
||||
*
|
||||
* DESCRIPTION: Attempt to repair/convert a return object of a type that was
|
||||
* not expected.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsRepairObject (
|
||||
ACPI_PREDEFINED_DATA *Data,
|
||||
UINT32 ExpectedBtypes,
|
||||
UINT32 PackageIndex,
|
||||
ACPI_OPERAND_OBJECT **ReturnObjectPtr)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr;
|
||||
ACPI_OPERAND_OBJECT *NewObject;
|
||||
ACPI_SIZE Length;
|
||||
|
||||
|
||||
switch (ReturnObject->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
/* Does the method/object legally return a string? */
|
||||
|
||||
if (!(ExpectedBtypes & ACPI_RTYPE_STRING))
|
||||
{
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Have a Buffer, expected a String, convert. 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 < ReturnObject->Buffer.Length) &&
|
||||
(ReturnObject->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,
|
||||
ReturnObject->Buffer.Pointer, Length);
|
||||
|
||||
/*
|
||||
* If the original object is a package element, we need to:
|
||||
* 1. Set the reference count of the new object to match the
|
||||
* reference count of the old object.
|
||||
* 2. Decrement the reference count of the original object.
|
||||
*/
|
||||
if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT)
|
||||
{
|
||||
NewObject->Common.ReferenceCount =
|
||||
ReturnObject->Common.ReferenceCount;
|
||||
|
||||
if (ReturnObject->Common.ReferenceCount > 1)
|
||||
{
|
||||
ReturnObject->Common.ReferenceCount--;
|
||||
}
|
||||
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags,
|
||||
"Converted Buffer to expected String at index %u",
|
||||
PackageIndex));
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags,
|
||||
"Converted Buffer to expected String"));
|
||||
}
|
||||
|
||||
/* Delete old object, install the new return object */
|
||||
|
||||
AcpiUtRemoveReference (ReturnObject);
|
||||
*ReturnObjectPtr = NewObject;
|
||||
Data->Flags |= ACPI_OBJECT_REPAIRED;
|
||||
return (AE_OK);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsRepairPackageList
|
||||
*
|
||||
* PARAMETERS: Data - Pointer to validation data structure
|
||||
* ObjDescPtr - Pointer to the object to repair. The new
|
||||
* package object is returned here,
|
||||
* overwriting the old object.
|
||||
*
|
||||
* RETURN: Status, new object in *ObjDescPtr
|
||||
*
|
||||
* DESCRIPTION: Repair a common problem with objects that are defined to return
|
||||
* a variable-length Package of Packages. If the variable-length
|
||||
* is one, some BIOS code mistakenly simply declares a single
|
||||
* Package instead of a Package with one sub-Package. This
|
||||
* function attempts to repair this error by wrapping a Package
|
||||
* object around the original Package, creating the correct
|
||||
* Package with one sub-Package.
|
||||
*
|
||||
* Names that can be repaired in this manner include:
|
||||
* _ALR, _CSD, _HPX, _MLS, _PRT, _PSS, _TRT, TSS
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsRepairPackageList (
|
||||
ACPI_PREDEFINED_DATA *Data,
|
||||
ACPI_OPERAND_OBJECT **ObjDescPtr)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *PkgObjDesc;
|
||||
|
||||
|
||||
/*
|
||||
* Create the new outer package and populate it. The new package will
|
||||
* have a single element, the lone subpackage.
|
||||
*/
|
||||
PkgObjDesc = AcpiUtCreatePackageObject (1);
|
||||
if (!PkgObjDesc)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
PkgObjDesc->Package.Elements[0] = *ObjDescPtr;
|
||||
|
||||
/* Return the new object in the object pointer */
|
||||
|
||||
*ObjDescPtr = PkgObjDesc;
|
||||
Data->Flags |= ACPI_OBJECT_REPAIRED;
|
||||
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags,
|
||||
"Incorrectly formed Package, attempting repair"));
|
||||
|
||||
return (AE_OK);
|
||||
}
|
@ -658,10 +658,11 @@ AcpiNsGetDeviceCallback (
|
||||
ACPI_STATUS Status;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
UINT32 Flags;
|
||||
ACPI_DEVICE_ID Hid;
|
||||
ACPI_COMPATIBLE_ID_LIST *Cid;
|
||||
ACPI_DEVICE_ID *Hid;
|
||||
ACPI_DEVICE_ID_LIST *Cid;
|
||||
UINT32 i;
|
||||
BOOLEAN Found;
|
||||
int NoMatch;
|
||||
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
@ -715,7 +716,10 @@ AcpiNsGetDeviceCallback (
|
||||
return (AE_CTRL_DEPTH);
|
||||
}
|
||||
|
||||
if (ACPI_STRNCMP (Hid.Value, Info->Hid, sizeof (Hid.Value)) != 0)
|
||||
NoMatch = ACPI_STRCMP (Hid->String, Info->Hid);
|
||||
ACPI_FREE (Hid);
|
||||
|
||||
if (NoMatch)
|
||||
{
|
||||
/*
|
||||
* HID does not match, attempt match within the
|
||||
@ -736,8 +740,7 @@ AcpiNsGetDeviceCallback (
|
||||
Found = FALSE;
|
||||
for (i = 0; i < Cid->Count; i++)
|
||||
{
|
||||
if (ACPI_STRNCMP (Cid->Id[i].Value, Info->Hid,
|
||||
sizeof (ACPI_COMPATIBLE_ID)) == 0)
|
||||
if (ACPI_STRCMP (Cid->Ids[i].String, Info->Hid) == 0)
|
||||
{
|
||||
/* Found a matching CID */
|
||||
|
||||
|
@ -126,6 +126,14 @@
|
||||
#define _COMPONENT ACPI_NAMESPACE
|
||||
ACPI_MODULE_NAME ("nsxfname")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static char *
|
||||
AcpiNsCopyDeviceId (
|
||||
ACPI_DEVICE_ID *Dest,
|
||||
ACPI_DEVICE_ID *Source,
|
||||
char *StringArea);
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
@ -306,12 +314,44 @@ AcpiGetName (
|
||||
ACPI_EXPORT_SYMBOL (AcpiGetName)
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsCopyDeviceId
|
||||
*
|
||||
* PARAMETERS: Dest - Pointer to the destination DEVICE_ID
|
||||
* Source - Pointer to the source DEVICE_ID
|
||||
* StringArea - Pointer to where to copy the dest string
|
||||
*
|
||||
* RETURN: Pointer to the next string area
|
||||
*
|
||||
* DESCRIPTION: Copy a single DEVICE_ID, including the string data.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static char *
|
||||
AcpiNsCopyDeviceId (
|
||||
ACPI_DEVICE_ID *Dest,
|
||||
ACPI_DEVICE_ID *Source,
|
||||
char *StringArea)
|
||||
{
|
||||
/* Create the destination DEVICE_ID */
|
||||
|
||||
Dest->String = StringArea;
|
||||
Dest->Length = Source->Length;
|
||||
|
||||
/* Copy actual string and return a pointer to the next string area */
|
||||
|
||||
ACPI_MEMCPY (StringArea, Source->String, Source->Length);
|
||||
return (StringArea + Source->Length);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiGetObjectInfo
|
||||
*
|
||||
* PARAMETERS: Handle - Object Handle
|
||||
* Buffer - Where the info is returned
|
||||
* PARAMETERS: Handle - Object Handle
|
||||
* ReturnBuffer - Where the info is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
@ -319,40 +359,40 @@ ACPI_EXPORT_SYMBOL (AcpiGetName)
|
||||
* namespace node and possibly by running several standard
|
||||
* control methods (Such as in the case of a device.)
|
||||
*
|
||||
* For Device and Processor objects, run the Device _HID, _UID, _CID, _STA,
|
||||
* _ADR, _SxW, and _SxD methods.
|
||||
*
|
||||
* Note: Allocates the return buffer, must be freed by the caller.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiGetObjectInfo (
|
||||
ACPI_HANDLE Handle,
|
||||
ACPI_BUFFER *Buffer)
|
||||
ACPI_DEVICE_INFO **ReturnBuffer)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_DEVICE_INFO *Info;
|
||||
ACPI_DEVICE_INFO *ReturnInfo;
|
||||
ACPI_COMPATIBLE_ID_LIST *CidList = NULL;
|
||||
ACPI_SIZE Size;
|
||||
ACPI_DEVICE_ID_LIST *CidList = NULL;
|
||||
ACPI_DEVICE_ID *Hid = NULL;
|
||||
ACPI_DEVICE_ID *Uid = NULL;
|
||||
char *NextIdString;
|
||||
ACPI_OBJECT_TYPE Type;
|
||||
ACPI_NAME Name;
|
||||
UINT8 ParamCount= 0;
|
||||
UINT8 Valid = 0;
|
||||
UINT32 InfoSize;
|
||||
UINT32 i;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
/* Parameter validation */
|
||||
|
||||
if (!Handle || !Buffer)
|
||||
if (!Handle || !ReturnBuffer)
|
||||
{
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
Status = AcpiUtValidateBuffer (Buffer);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_DEVICE_INFO));
|
||||
if (!Info)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@ -363,56 +403,54 @@ AcpiGetObjectInfo (
|
||||
if (!Node)
|
||||
{
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
Status = AE_BAD_PARAMETER;
|
||||
goto Cleanup;
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/* Init return structure */
|
||||
/* Get the namespace node data while the namespace is locked */
|
||||
|
||||
Size = sizeof (ACPI_DEVICE_INFO);
|
||||
|
||||
Info->Type = Node->Type;
|
||||
Info->Name = Node->Name.Integer;
|
||||
Info->Valid = 0;
|
||||
InfoSize = sizeof (ACPI_DEVICE_INFO);
|
||||
Type = Node->Type;
|
||||
Name = Node->Name.Integer;
|
||||
|
||||
if (Node->Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
Info->ParamCount = Node->Object->Method.ParamCount;
|
||||
ParamCount = Node->Object->Method.ParamCount;
|
||||
}
|
||||
|
||||
Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* If not a device, we are all done */
|
||||
|
||||
if (Info->Type == ACPI_TYPE_DEVICE)
|
||||
if ((Type == ACPI_TYPE_DEVICE) ||
|
||||
(Type == ACPI_TYPE_PROCESSOR))
|
||||
{
|
||||
/*
|
||||
* Get extra info for ACPI Devices objects only:
|
||||
* Run the Device _HID, _UID, _CID, _STA, _ADR and _SxD methods.
|
||||
* Get extra info for ACPI Device/Processor objects only:
|
||||
* Run the Device _HID, _UID, and _CID methods.
|
||||
*
|
||||
* Note: none of these methods are required, so they may or may
|
||||
* not be present for this device. The Info->Valid bitfield is used
|
||||
* to indicate which methods were found and ran successfully.
|
||||
* not be present for this device. The Info->Valid bitfield is used
|
||||
* to indicate which methods were found and run successfully.
|
||||
*/
|
||||
|
||||
/* Execute the Device._HID method */
|
||||
|
||||
Status = AcpiUtExecute_HID (Node, &Info->HardwareId);
|
||||
Status = AcpiUtExecute_HID (Node, &Hid);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Info->Valid |= ACPI_VALID_HID;
|
||||
InfoSize += Hid->Length;
|
||||
Valid |= ACPI_VALID_HID;
|
||||
}
|
||||
|
||||
/* Execute the Device._UID method */
|
||||
|
||||
Status = AcpiUtExecute_UID (Node, &Info->UniqueId);
|
||||
Status = AcpiUtExecute_UID (Node, &Uid);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Info->Valid |= ACPI_VALID_UID;
|
||||
InfoSize += Uid->Length;
|
||||
Valid |= ACPI_VALID_UID;
|
||||
}
|
||||
|
||||
/* Execute the Device._CID method */
|
||||
@ -420,57 +458,151 @@ AcpiGetObjectInfo (
|
||||
Status = AcpiUtExecute_CID (Node, &CidList);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Size += CidList->Size;
|
||||
Info->Valid |= ACPI_VALID_CID;
|
||||
/* Add size of CID strings and CID pointer array */
|
||||
|
||||
InfoSize += (CidList->ListSize - sizeof (ACPI_DEVICE_ID_LIST));
|
||||
Valid |= ACPI_VALID_CID;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Now that we have the variable-length data, we can allocate the
|
||||
* return buffer
|
||||
*/
|
||||
Info = ACPI_ALLOCATE_ZEROED (InfoSize);
|
||||
if (!Info)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Get the fixed-length data */
|
||||
|
||||
if ((Type == ACPI_TYPE_DEVICE) ||
|
||||
(Type == ACPI_TYPE_PROCESSOR))
|
||||
{
|
||||
/*
|
||||
* Get extra info for ACPI Device/Processor objects only:
|
||||
* Run the _STA, _ADR and, SxW, and _SxD methods.
|
||||
*
|
||||
* Note: none of these methods are required, so they may or may
|
||||
* not be present for this device. The Info->Valid bitfield is used
|
||||
* to indicate which methods were found and run successfully.
|
||||
*/
|
||||
|
||||
/* Execute the Device._STA method */
|
||||
|
||||
Status = AcpiUtExecute_STA (Node, &Info->CurrentStatus);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Info->Valid |= ACPI_VALID_STA;
|
||||
Valid |= ACPI_VALID_STA;
|
||||
}
|
||||
|
||||
/* Execute the Device._ADR method */
|
||||
|
||||
Status = AcpiUtEvaluateNumericObject (METHOD_NAME__ADR, Node,
|
||||
&Info->Address);
|
||||
&Info->Address);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Info->Valid |= ACPI_VALID_ADR;
|
||||
Valid |= ACPI_VALID_ADR;
|
||||
}
|
||||
|
||||
/* Execute the Device._SxW methods */
|
||||
|
||||
Status = AcpiUtExecutePowerMethods (Node,
|
||||
AcpiGbl_LowestDstateNames, ACPI_NUM_SxW_METHODS,
|
||||
Info->LowestDstates);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Valid |= ACPI_VALID_SXWS;
|
||||
}
|
||||
|
||||
/* Execute the Device._SxD methods */
|
||||
|
||||
Status = AcpiUtExecute_Sxds (Node, Info->HighestDstates);
|
||||
Status = AcpiUtExecutePowerMethods (Node,
|
||||
AcpiGbl_HighestDstateNames, ACPI_NUM_SxD_METHODS,
|
||||
Info->HighestDstates);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Info->Valid |= ACPI_VALID_SXDS;
|
||||
Valid |= ACPI_VALID_SXDS;
|
||||
}
|
||||
}
|
||||
|
||||
/* Validate/Allocate/Clear caller buffer */
|
||||
|
||||
Status = AcpiUtInitializeBuffer (Buffer, Size);
|
||||
if (ACPI_FAILURE (Status))
|
||||
/*
|
||||
* Create a pointer to the string area of the return buffer.
|
||||
* Point to the end of the base ACPI_DEVICE_INFO structure.
|
||||
*/
|
||||
NextIdString = ACPI_CAST_PTR (char, Info->CompatibleIdList.Ids);
|
||||
if (CidList)
|
||||
{
|
||||
goto Cleanup;
|
||||
/* Point past the CID DEVICE_ID array */
|
||||
|
||||
NextIdString += ((ACPI_SIZE) CidList->Count * sizeof (ACPI_DEVICE_ID));
|
||||
}
|
||||
|
||||
/* Populate the return buffer */
|
||||
/*
|
||||
* Copy the HID, UID, and CIDs to the return buffer. The variable-length
|
||||
* strings are copied to the reserved area at the end of the buffer.
|
||||
*
|
||||
* For HID and CID, check if the ID is a PCI Root Bridge.
|
||||
*/
|
||||
if (Hid)
|
||||
{
|
||||
NextIdString = AcpiNsCopyDeviceId (&Info->HardwareId,
|
||||
Hid, NextIdString);
|
||||
|
||||
ReturnInfo = Buffer->Pointer;
|
||||
ACPI_MEMCPY (ReturnInfo, Info, sizeof (ACPI_DEVICE_INFO));
|
||||
if (AcpiUtIsPciRootBridge (Hid->String))
|
||||
{
|
||||
Info->Flags |= ACPI_PCI_ROOT_BRIDGE;
|
||||
}
|
||||
}
|
||||
|
||||
if (Uid)
|
||||
{
|
||||
NextIdString = AcpiNsCopyDeviceId (&Info->UniqueId,
|
||||
Uid, NextIdString);
|
||||
}
|
||||
|
||||
if (CidList)
|
||||
{
|
||||
ACPI_MEMCPY (&ReturnInfo->CompatibilityId, CidList, CidList->Size);
|
||||
Info->CompatibleIdList.Count = CidList->Count;
|
||||
Info->CompatibleIdList.ListSize = CidList->ListSize;
|
||||
|
||||
/* Copy each CID */
|
||||
|
||||
for (i = 0; i < CidList->Count; i++)
|
||||
{
|
||||
NextIdString = AcpiNsCopyDeviceId (&Info->CompatibleIdList.Ids[i],
|
||||
&CidList->Ids[i], NextIdString);
|
||||
|
||||
if (AcpiUtIsPciRootBridge (CidList->Ids[i].String))
|
||||
{
|
||||
Info->Flags |= ACPI_PCI_ROOT_BRIDGE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Copy the fixed-length data */
|
||||
|
||||
Info->InfoSize = InfoSize;
|
||||
Info->Type = Type;
|
||||
Info->Name = Name;
|
||||
Info->ParamCount = ParamCount;
|
||||
Info->Valid = Valid;
|
||||
|
||||
*ReturnBuffer = Info;
|
||||
Status = AE_OK;
|
||||
|
||||
|
||||
Cleanup:
|
||||
ACPI_FREE (Info);
|
||||
if (Hid)
|
||||
{
|
||||
ACPI_FREE (Hid);
|
||||
}
|
||||
if (Uid)
|
||||
{
|
||||
ACPI_FREE (Uid);
|
||||
}
|
||||
if (CidList)
|
||||
{
|
||||
ACPI_FREE (CidList);
|
||||
|
@ -171,6 +171,12 @@ AcpiPsCompleteFinalOp (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_STATUS Status);
|
||||
|
||||
static void
|
||||
AcpiPsLinkModuleCode (
|
||||
UINT8 *AmlStart,
|
||||
UINT32 AmlLength,
|
||||
ACPI_OWNER_ID OwnerId);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -502,6 +508,7 @@ AcpiPsGetArguments (
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_PARSE_OBJECT *Arg = NULL;
|
||||
const ACPI_OPCODE_INFO *OpInfo;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (PsGetArguments, WalkState);
|
||||
@ -558,13 +565,11 @@ AcpiPsGetArguments (
|
||||
}
|
||||
|
||||
|
||||
/* Special processing for certain opcodes */
|
||||
|
||||
/* TBD (remove): Temporary mechanism to disable this code if needed */
|
||||
|
||||
#ifdef ACPI_ENABLE_MODULE_LEVEL_CODE
|
||||
|
||||
if ((WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS1) &&
|
||||
/*
|
||||
* Handle executable code at "module-level". This refers to
|
||||
* executable opcodes that appear outside of any control method.
|
||||
*/
|
||||
if ((WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS2) &&
|
||||
((WalkState->ParseFlags & ACPI_PARSE_DISASSEMBLE) == 0))
|
||||
{
|
||||
/*
|
||||
@ -580,6 +585,19 @@ AcpiPsGetArguments (
|
||||
case AML_ELSE_OP:
|
||||
case AML_WHILE_OP:
|
||||
|
||||
/*
|
||||
* Currently supported module-level opcodes are:
|
||||
* IF/ELSE/WHILE. These appear to be the most common,
|
||||
* and easiest to support since they open an AML
|
||||
* package.
|
||||
*/
|
||||
if (WalkState->PassNumber == ACPI_IMODE_LOAD_PASS1)
|
||||
{
|
||||
AcpiPsLinkModuleCode (AmlOpStart,
|
||||
(UINT32) (WalkState->ParserState.PkgEnd - AmlOpStart),
|
||||
WalkState->OwnerId);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
|
||||
"Pass1: Skipping an If/Else/While body\n"));
|
||||
|
||||
@ -590,10 +608,33 @@ AcpiPsGetArguments (
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
* Check for an unsupported executable opcode at module
|
||||
* level. We must be in PASS1, the parent must be a SCOPE,
|
||||
* The opcode class must be EXECUTE, and the opcode must
|
||||
* not be an argument to another opcode.
|
||||
*/
|
||||
if ((WalkState->PassNumber == ACPI_IMODE_LOAD_PASS1) &&
|
||||
(Op->Common.Parent->Common.AmlOpcode == AML_SCOPE_OP))
|
||||
{
|
||||
OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
|
||||
if ((OpInfo->Class == AML_CLASS_EXECUTE) &&
|
||||
(!Arg))
|
||||
{
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Detected an unsupported executable opcode "
|
||||
"at module-level: [0x%.4X] at table offset 0x%.4X",
|
||||
Op->Common.AmlOpcode,
|
||||
(UINT32) (ACPI_PTR_DIFF (AmlOpStart,
|
||||
WalkState->ParserState.AmlStart) +
|
||||
sizeof (ACPI_TABLE_HEADER))));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Special processing for certain opcodes */
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
@ -659,6 +700,78 @@ AcpiPsGetArguments (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiPsLinkModuleCode
|
||||
*
|
||||
* PARAMETERS: AmlStart - Pointer to the AML
|
||||
* AmlLength - Length of executable AML
|
||||
* OwnerId - OwnerId of module level code
|
||||
*
|
||||
* RETURN: None.
|
||||
*
|
||||
* DESCRIPTION: Wrap the module-level code with a method object and link the
|
||||
* object to the global list. Note, the mutex field of the method
|
||||
* object is used to link multiple module-level code objects.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
AcpiPsLinkModuleCode (
|
||||
UINT8 *AmlStart,
|
||||
UINT32 AmlLength,
|
||||
ACPI_OWNER_ID OwnerId)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *Prev;
|
||||
ACPI_OPERAND_OBJECT *Next;
|
||||
ACPI_OPERAND_OBJECT *MethodObj;
|
||||
|
||||
|
||||
/* Get the tail of the list */
|
||||
|
||||
Prev = Next = AcpiGbl_ModuleCodeList;
|
||||
while (Next)
|
||||
{
|
||||
Prev = Next;
|
||||
Next = Next->Method.Mutex;
|
||||
}
|
||||
|
||||
/*
|
||||
* Insert the module level code into the list. Merge it if it is
|
||||
* adjacent to the previous element.
|
||||
*/
|
||||
if (!Prev ||
|
||||
((Prev->Method.AmlStart + Prev->Method.AmlLength) != AmlStart))
|
||||
{
|
||||
/* Create, initialize, and link a new temporary method object */
|
||||
|
||||
MethodObj = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD);
|
||||
if (!MethodObj)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MethodObj->Method.AmlStart = AmlStart;
|
||||
MethodObj->Method.AmlLength = AmlLength;
|
||||
MethodObj->Method.OwnerId = OwnerId;
|
||||
MethodObj->Method.Flags |= AOPOBJ_MODULE_LEVEL;
|
||||
|
||||
if (!Prev)
|
||||
{
|
||||
AcpiGbl_ModuleCodeList = MethodObj;
|
||||
}
|
||||
else
|
||||
{
|
||||
Prev->Method.Mutex = MethodObj;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Prev->Method.AmlLength += AmlLength;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiPsCompleteOp
|
||||
|
@ -394,6 +394,11 @@ AcpiPsExecuteMethod (
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
if (Info->ObjDesc->Method.Flags & AOPOBJ_MODULE_LEVEL)
|
||||
{
|
||||
WalkState->ParseFlags |= ACPI_PARSE_MODULE_LEVEL;
|
||||
}
|
||||
|
||||
/* Invoke an internal method if necessary */
|
||||
|
||||
if (Info->ObjDesc->Method.MethodFlags & AML_METHOD_INTERNAL_ONLY)
|
||||
|
@ -124,6 +124,16 @@
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
AcpiTbFixString (
|
||||
char *String,
|
||||
ACPI_SIZE Length);
|
||||
|
||||
static void
|
||||
AcpiTbCleanupTableHeader (
|
||||
ACPI_TABLE_HEADER *OutHeader,
|
||||
ACPI_TABLE_HEADER *Header);
|
||||
|
||||
static ACPI_PHYSICAL_ADDRESS
|
||||
AcpiTbGetRootTableEntry (
|
||||
UINT8 *TableEntry,
|
||||
@ -183,6 +193,67 @@ AcpiTbTablesLoaded (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiTbFixString
|
||||
*
|
||||
* PARAMETERS: String - String to be repaired
|
||||
* Length - Maximum length
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Replace every non-printable or non-ascii byte in the string
|
||||
* with a question mark '?'.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
AcpiTbFixString (
|
||||
char *String,
|
||||
ACPI_SIZE Length)
|
||||
{
|
||||
|
||||
while (Length && *String)
|
||||
{
|
||||
if (!ACPI_IS_PRINT (*String))
|
||||
{
|
||||
*String = '?';
|
||||
}
|
||||
String++;
|
||||
Length--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiTbCleanupTableHeader
|
||||
*
|
||||
* PARAMETERS: OutHeader - Where the cleaned header is returned
|
||||
* Header - Input ACPI table header
|
||||
*
|
||||
* RETURN: Returns the cleaned header in OutHeader
|
||||
*
|
||||
* DESCRIPTION: Copy the table header and ensure that all "string" fields in
|
||||
* the header consist of printable characters.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
AcpiTbCleanupTableHeader (
|
||||
ACPI_TABLE_HEADER *OutHeader,
|
||||
ACPI_TABLE_HEADER *Header)
|
||||
{
|
||||
|
||||
ACPI_MEMCPY (OutHeader, Header, sizeof (ACPI_TABLE_HEADER));
|
||||
|
||||
AcpiTbFixString (OutHeader->Signature, ACPI_NAME_SIZE);
|
||||
AcpiTbFixString (OutHeader->OemId, ACPI_OEM_ID_SIZE);
|
||||
AcpiTbFixString (OutHeader->OemTableId, ACPI_OEM_TABLE_ID_SIZE);
|
||||
AcpiTbFixString (OutHeader->AslCompilerId, ACPI_NAME_SIZE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiTbPrintTableHeader
|
||||
@ -201,6 +272,8 @@ AcpiTbPrintTableHeader (
|
||||
ACPI_PHYSICAL_ADDRESS Address,
|
||||
ACPI_TABLE_HEADER *Header)
|
||||
{
|
||||
ACPI_TABLE_HEADER LocalHeader;
|
||||
|
||||
|
||||
/*
|
||||
* The reason that the Address is cast to a void pointer is so that we
|
||||
@ -218,23 +291,29 @@ AcpiTbPrintTableHeader (
|
||||
{
|
||||
/* RSDP has no common fields */
|
||||
|
||||
ACPI_MEMCPY (LocalHeader.OemId,
|
||||
ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->OemId, ACPI_OEM_ID_SIZE);
|
||||
AcpiTbFixString (LocalHeader.OemId, ACPI_OEM_ID_SIZE);
|
||||
|
||||
ACPI_INFO ((AE_INFO, "RSDP %p %05X (v%.2d %6.6s)",
|
||||
ACPI_CAST_PTR (void, Address),
|
||||
(ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision > 0) ?
|
||||
ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Length : 20,
|
||||
ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision,
|
||||
ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->OemId));
|
||||
LocalHeader.OemId));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Standard ACPI table with full common header */
|
||||
|
||||
AcpiTbCleanupTableHeader (&LocalHeader, Header);
|
||||
|
||||
ACPI_INFO ((AE_INFO,
|
||||
"%4.4s %p %05X (v%.2d %6.6s %8.8s %08X %4.4s %08X)",
|
||||
Header->Signature, ACPI_CAST_PTR (void, Address),
|
||||
Header->Length, Header->Revision, Header->OemId,
|
||||
Header->OemTableId, Header->OemRevision, Header->AslCompilerId,
|
||||
Header->AslCompilerRevision));
|
||||
LocalHeader.Signature, ACPI_CAST_PTR (void, Address),
|
||||
LocalHeader.Length, LocalHeader.Revision, LocalHeader.OemId,
|
||||
LocalHeader.OemTableId, LocalHeader.OemRevision,
|
||||
LocalHeader.AslCompilerId, LocalHeader.AslCompilerRevision));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -138,6 +138,14 @@
|
||||
extern FILE *AcpiGbl_DebugFile;
|
||||
extern BOOLEAN AcpiGbl_IgnoreErrors;
|
||||
|
||||
|
||||
typedef struct ae_table_desc
|
||||
{
|
||||
ACPI_TABLE_HEADER *Table;
|
||||
struct ae_table_desc *Next;
|
||||
|
||||
} AE_TABLE_DESC;
|
||||
|
||||
/*
|
||||
* Debug Regions
|
||||
*/
|
||||
@ -170,7 +178,8 @@ AeCtrlCHandler (
|
||||
|
||||
ACPI_STATUS
|
||||
AeBuildLocalTables (
|
||||
ACPI_TABLE_HEADER *UserTable);
|
||||
UINT32 TableCount,
|
||||
AE_TABLE_DESC *TableList);
|
||||
|
||||
ACPI_STATUS
|
||||
AeInstallTables (
|
||||
|
@ -118,32 +118,18 @@
|
||||
#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>
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_UTILITIES
|
||||
ACPI_MODULE_NAME ("uteval")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
AcpiUtCopyIdString (
|
||||
char *Destination,
|
||||
char *Source,
|
||||
ACPI_SIZE MaxLength);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiUtTranslateOneCid (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_COMPATIBLE_ID *OneCid);
|
||||
|
||||
|
||||
/*
|
||||
* Strings supported by the _OSI predefined (internal) method.
|
||||
*
|
||||
* March 2009: Removed "Linux" as this host no longer wants to respond true
|
||||
* for this string. Basically, the only safe OS strings are windows-related
|
||||
* and in many or most cases represent the only test path within the
|
||||
* and in many or most cases represent the only test path within the
|
||||
* BIOS-provided ASL code.
|
||||
*
|
||||
* The second element of each entry is used to track the newest version of
|
||||
@ -160,6 +146,9 @@ static const ACPI_INTERFACE_INFO AcpiInterfacesSupported[] =
|
||||
{"Windows 2001 SP2", ACPI_OSI_WIN_XP_SP2}, /* Windows XP SP2 */
|
||||
{"Windows 2001.1 SP1", ACPI_OSI_WINSRV_2003_SP1}, /* Windows Server 2003 SP1 - Added 03/2006 */
|
||||
{"Windows 2006", ACPI_OSI_WIN_VISTA}, /* Windows Vista - Added 03/2006 */
|
||||
{"Windows 2006.1", ACPI_OSI_WINSRV_2008}, /* Windows Server 2008 - Added 09/2009 */
|
||||
{"Windows 2006 SP1", ACPI_OSI_WIN_VISTA_SP1}, /* Windows Vista SP1 - Added 09/2009 */
|
||||
{"Windows 2009", ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */
|
||||
|
||||
/* Feature Group Strings */
|
||||
|
||||
@ -280,7 +269,7 @@ AcpiUtOsiImplementation (
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Evaluates a namespace object and verifies the type of the
|
||||
* return object. Common code that simplifies accessing objects
|
||||
* return object. Common code that simplifies accessing objects
|
||||
* that have required return objects of fixed types.
|
||||
*
|
||||
* NOTE: Internal function, no parameter validation
|
||||
@ -376,7 +365,7 @@ AcpiUtEvaluateObject (
|
||||
(!ExpectedReturnBtypes))
|
||||
{
|
||||
/*
|
||||
* We received a return object, but one was not expected. This can
|
||||
* We received a return object, but one was not expected. This can
|
||||
* happen frequently if the "implicit return" feature is enabled.
|
||||
* Just delete the return object and return AE_OK.
|
||||
*/
|
||||
@ -419,12 +408,12 @@ AcpiUtEvaluateObject (
|
||||
*
|
||||
* PARAMETERS: ObjectName - Object name to be evaluated
|
||||
* DeviceNode - Node for the device
|
||||
* Address - Where the value is returned
|
||||
* Value - Where the value is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Evaluates a numeric namespace object for a selected device
|
||||
* and stores result in *Address.
|
||||
* and stores result in *Value.
|
||||
*
|
||||
* NOTE: Internal function, no parameter validation
|
||||
*
|
||||
@ -434,7 +423,7 @@ ACPI_STATUS
|
||||
AcpiUtEvaluateNumericObject (
|
||||
char *ObjectName,
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_INTEGER *Address)
|
||||
ACPI_INTEGER *Value)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_STATUS Status;
|
||||
@ -452,326 +441,7 @@ AcpiUtEvaluateNumericObject (
|
||||
|
||||
/* Get the returned Integer */
|
||||
|
||||
*Address = ObjDesc->Integer.Value;
|
||||
|
||||
/* On exit, we must delete the return object */
|
||||
|
||||
AcpiUtRemoveReference (ObjDesc);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtCopyIdString
|
||||
*
|
||||
* PARAMETERS: Destination - Where to copy the string
|
||||
* Source - Source string
|
||||
* MaxLength - Length of the destination buffer
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Copies an ID string for the _HID, _CID, and _UID methods.
|
||||
* Performs removal of a leading asterisk if present -- workaround
|
||||
* for a known issue on a bunch of machines.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
AcpiUtCopyIdString (
|
||||
char *Destination,
|
||||
char *Source,
|
||||
ACPI_SIZE MaxLength)
|
||||
{
|
||||
|
||||
/*
|
||||
* Workaround for ID strings that have a leading asterisk. This construct
|
||||
* is not allowed by the ACPI specification (ID strings must be
|
||||
* alphanumeric), but enough existing machines have this embedded in their
|
||||
* ID strings that the following code is useful.
|
||||
*/
|
||||
if (*Source == '*')
|
||||
{
|
||||
Source++;
|
||||
}
|
||||
|
||||
/* Do the actual copy */
|
||||
|
||||
ACPI_STRNCPY (Destination, Source, MaxLength);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtExecute_HID
|
||||
*
|
||||
* PARAMETERS: DeviceNode - Node for the device
|
||||
* Hid - Where the HID is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Executes the _HID control method that returns the hardware
|
||||
* ID of the device.
|
||||
*
|
||||
* NOTE: Internal function, no parameter validation
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_HID (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_DEVICE_ID *Hid)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (UtExecute_HID);
|
||||
|
||||
|
||||
Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__HID,
|
||||
ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER)
|
||||
{
|
||||
/* Convert the Numeric HID to string */
|
||||
|
||||
AcpiExEisaIdToString ((UINT32) ObjDesc->Integer.Value, Hid->Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Copy the String HID from the returned object */
|
||||
|
||||
AcpiUtCopyIdString (Hid->Value, ObjDesc->String.Pointer,
|
||||
sizeof (Hid->Value));
|
||||
}
|
||||
|
||||
/* On exit, we must delete the return object */
|
||||
|
||||
AcpiUtRemoveReference (ObjDesc);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtTranslateOneCid
|
||||
*
|
||||
* PARAMETERS: ObjDesc - _CID object, must be integer or string
|
||||
* OneCid - Where the CID string is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Return a numeric or string _CID value as a string.
|
||||
* (Compatible ID)
|
||||
*
|
||||
* NOTE: Assumes a maximum _CID string length of
|
||||
* ACPI_MAX_CID_LENGTH.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiUtTranslateOneCid (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_COMPATIBLE_ID *OneCid)
|
||||
{
|
||||
|
||||
|
||||
switch (ObjDesc->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_INTEGER:
|
||||
|
||||
/* Convert the Numeric CID to string */
|
||||
|
||||
AcpiExEisaIdToString ((UINT32) ObjDesc->Integer.Value, OneCid->Value);
|
||||
return (AE_OK);
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
if (ObjDesc->String.Length > ACPI_MAX_CID_LENGTH)
|
||||
{
|
||||
return (AE_AML_STRING_LIMIT);
|
||||
}
|
||||
|
||||
/* Copy the String CID from the returned object */
|
||||
|
||||
AcpiUtCopyIdString (OneCid->Value, ObjDesc->String.Pointer,
|
||||
ACPI_MAX_CID_LENGTH);
|
||||
return (AE_OK);
|
||||
|
||||
default:
|
||||
|
||||
return (AE_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtExecute_CID
|
||||
*
|
||||
* PARAMETERS: DeviceNode - Node for the device
|
||||
* ReturnCidList - Where the CID list is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Executes the _CID control method that returns one or more
|
||||
* compatible hardware IDs for the device.
|
||||
*
|
||||
* NOTE: Internal function, no parameter validation
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_CID (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_COMPATIBLE_ID_LIST **ReturnCidList)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_STATUS Status;
|
||||
UINT32 Count;
|
||||
UINT32 Size;
|
||||
ACPI_COMPATIBLE_ID_LIST *CidList;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (UtExecute_CID);
|
||||
|
||||
|
||||
/* Evaluate the _CID method for this device */
|
||||
|
||||
Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__CID,
|
||||
ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_PACKAGE,
|
||||
&ObjDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Get the number of _CIDs returned */
|
||||
|
||||
Count = 1;
|
||||
if (ObjDesc->Common.Type == ACPI_TYPE_PACKAGE)
|
||||
{
|
||||
Count = ObjDesc->Package.Count;
|
||||
}
|
||||
|
||||
/* Allocate a worst-case buffer for the _CIDs */
|
||||
|
||||
Size = (((Count - 1) * sizeof (ACPI_COMPATIBLE_ID)) +
|
||||
sizeof (ACPI_COMPATIBLE_ID_LIST));
|
||||
|
||||
CidList = ACPI_ALLOCATE_ZEROED ((ACPI_SIZE) Size);
|
||||
if (!CidList)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Init CID list */
|
||||
|
||||
CidList->Count = Count;
|
||||
CidList->Size = Size;
|
||||
|
||||
/*
|
||||
* A _CID can return either a single compatible ID or a package of
|
||||
* compatible IDs. Each compatible ID can be one of the following:
|
||||
* 1) Integer (32 bit compressed EISA ID) or
|
||||
* 2) String (PCI ID format, e.g. "PCI\VEN_vvvv&DEV_dddd&SUBSYS_ssssssss")
|
||||
*/
|
||||
|
||||
/* The _CID object can be either a single CID or a package (list) of CIDs */
|
||||
|
||||
if (ObjDesc->Common.Type == ACPI_TYPE_PACKAGE)
|
||||
{
|
||||
/* Translate each package element */
|
||||
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
Status = AcpiUtTranslateOneCid (ObjDesc->Package.Elements[i],
|
||||
&CidList->Id[i]);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Only one CID, translate to a string */
|
||||
|
||||
Status = AcpiUtTranslateOneCid (ObjDesc, CidList->Id);
|
||||
}
|
||||
|
||||
/* Cleanup on error */
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (CidList);
|
||||
}
|
||||
else
|
||||
{
|
||||
*ReturnCidList = CidList;
|
||||
}
|
||||
|
||||
/* On exit, we must delete the _CID return object */
|
||||
|
||||
AcpiUtRemoveReference (ObjDesc);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtExecute_UID
|
||||
*
|
||||
* PARAMETERS: DeviceNode - Node for the device
|
||||
* Uid - Where the UID is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Executes the _UID control method that returns the hardware
|
||||
* ID of the device.
|
||||
*
|
||||
* NOTE: Internal function, no parameter validation
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_UID (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_DEVICE_ID *Uid)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (UtExecute_UID);
|
||||
|
||||
|
||||
Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__UID,
|
||||
ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER)
|
||||
{
|
||||
/* Convert the Numeric UID to string */
|
||||
|
||||
AcpiExUnsignedIntegerToString (ObjDesc->Integer.Value, Uid->Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Copy the String UID from the returned object */
|
||||
|
||||
AcpiUtCopyIdString (Uid->Value, ObjDesc->String.Pointer,
|
||||
sizeof (Uid->Value));
|
||||
}
|
||||
*Value = ObjDesc->Integer.Value;
|
||||
|
||||
/* On exit, we must delete the return object */
|
||||
|
||||
@ -838,63 +508,68 @@ AcpiUtExecute_STA (
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtExecute_Sxds
|
||||
* FUNCTION: AcpiUtExecutePowerMethods
|
||||
*
|
||||
* PARAMETERS: DeviceNode - Node for the device
|
||||
* Flags - Where the status flags are returned
|
||||
* MethodNames - Array of power method names
|
||||
* MethodCount - Number of methods to execute
|
||||
* OutValues - Where the power method values are returned
|
||||
*
|
||||
* RETURN: Status
|
||||
* RETURN: Status, OutValues
|
||||
*
|
||||
* DESCRIPTION: Executes _STA for selected device and stores results in
|
||||
* *Flags.
|
||||
* DESCRIPTION: Executes the specified power methods for the device and returns
|
||||
* the result(s).
|
||||
*
|
||||
* NOTE: Internal function, no parameter validation
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_Sxds (
|
||||
AcpiUtExecutePowerMethods (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
UINT8 *Highest)
|
||||
const char **MethodNames,
|
||||
UINT8 MethodCount,
|
||||
UINT8 *OutValues)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_STATUS FinalStatus = AE_NOT_FOUND;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (UtExecute_Sxds);
|
||||
ACPI_FUNCTION_TRACE (UtExecutePowerMethods);
|
||||
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
for (i = 0; i < MethodCount; i++)
|
||||
{
|
||||
Highest[i] = 0xFF;
|
||||
/*
|
||||
* Execute the power method (_SxD or _SxW). The only allowable
|
||||
* return type is an Integer.
|
||||
*/
|
||||
Status = AcpiUtEvaluateObject (DeviceNode,
|
||||
ACPI_CAST_PTR (char, AcpiGbl_HighestDstateNames[i]),
|
||||
ACPI_CAST_PTR (char, MethodNames[i]),
|
||||
ACPI_BTYPE_INTEGER, &ObjDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
if (Status != AE_NOT_FOUND)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"%s on Device %4.4s, %s\n",
|
||||
ACPI_CAST_PTR (char, AcpiGbl_HighestDstateNames[i]),
|
||||
AcpiUtGetNodeName (DeviceNode),
|
||||
AcpiFormatException (Status)));
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Extract the Dstate value */
|
||||
|
||||
Highest[i] = (UINT8) ObjDesc->Integer.Value;
|
||||
OutValues[i] = (UINT8) ObjDesc->Integer.Value;
|
||||
|
||||
/* Delete the return object */
|
||||
|
||||
AcpiUtRemoveReference (ObjDesc);
|
||||
FinalStatus = AE_OK; /* At least one value is valid */
|
||||
continue;
|
||||
}
|
||||
|
||||
OutValues[i] = ACPI_UINT8_MAX;
|
||||
if (Status == AE_NOT_FOUND)
|
||||
{
|
||||
continue; /* Ignore if not found */
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Failed %s on Device %4.4s, %s\n",
|
||||
ACPI_CAST_PTR (char, MethodNames[i]),
|
||||
AcpiUtGetNodeName (DeviceNode), AcpiFormatException (Status)));
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
return_ACPI_STATUS (FinalStatus);
|
||||
}
|
||||
|
@ -172,7 +172,16 @@ const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT] =
|
||||
"\\_S5_"
|
||||
};
|
||||
|
||||
const char *AcpiGbl_HighestDstateNames[4] =
|
||||
const char *AcpiGbl_LowestDstateNames[ACPI_NUM_SxW_METHODS] =
|
||||
{
|
||||
"_S0W",
|
||||
"_S1W",
|
||||
"_S2W",
|
||||
"_S3W",
|
||||
"_S4W"
|
||||
};
|
||||
|
||||
const char *AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS] =
|
||||
{
|
||||
"_S1D",
|
||||
"_S2D",
|
||||
@ -398,6 +407,7 @@ const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] =
|
||||
"SMBus",
|
||||
"SystemCMOS",
|
||||
"PCIBARTarget",
|
||||
"IPMI",
|
||||
"DataTable"
|
||||
};
|
||||
|
||||
@ -928,6 +938,7 @@ AcpiUtInitGlobals (
|
||||
|
||||
/* Namespace */
|
||||
|
||||
AcpiGbl_ModuleCodeList = NULL;
|
||||
AcpiGbl_RootNode = NULL;
|
||||
AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
|
||||
AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
|
||||
|
497
sys/contrib/dev/acpica/utilities/utids.c
Normal file
497
sys/contrib/dev/acpica/utilities/utids.c
Normal file
@ -0,0 +1,497 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: utids - support for device IDs - HID, UID, CID
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __UTIDS_C__
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acinterp.h"
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_UTILITIES
|
||||
ACPI_MODULE_NAME ("utids")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
AcpiUtCopyIdString (
|
||||
char *Destination,
|
||||
char *Source);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtCopyIdString
|
||||
*
|
||||
* PARAMETERS: Destination - Where to copy the string
|
||||
* Source - Source string
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Copies an ID string for the _HID, _CID, and _UID methods.
|
||||
* Performs removal of a leading asterisk if present -- workaround
|
||||
* for a known issue on a bunch of machines.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
AcpiUtCopyIdString (
|
||||
char *Destination,
|
||||
char *Source)
|
||||
{
|
||||
|
||||
/*
|
||||
* Workaround for ID strings that have a leading asterisk. This construct
|
||||
* is not allowed by the ACPI specification (ID strings must be
|
||||
* alphanumeric), but enough existing machines have this embedded in their
|
||||
* ID strings that the following code is useful.
|
||||
*/
|
||||
if (*Source == '*')
|
||||
{
|
||||
Source++;
|
||||
}
|
||||
|
||||
/* Do the actual copy */
|
||||
|
||||
ACPI_STRCPY (Destination, Source);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtExecute_HID
|
||||
*
|
||||
* PARAMETERS: DeviceNode - Node for the device
|
||||
* ReturnId - Where the string HID is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Executes the _HID control method that returns the hardware
|
||||
* ID of the device. The HID is either an 32-bit encoded EISAID
|
||||
* Integer or a String. A string is always returned. An EISAID
|
||||
* is converted to a string.
|
||||
*
|
||||
* NOTE: Internal function, no parameter validation
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_HID (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_DEVICE_ID **ReturnId)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_DEVICE_ID *Hid;
|
||||
UINT32 Length;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (UtExecute_HID);
|
||||
|
||||
|
||||
Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__HID,
|
||||
ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Get the size of the String to be returned, includes null terminator */
|
||||
|
||||
if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER)
|
||||
{
|
||||
Length = ACPI_EISAID_STRING_SIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
Length = ObjDesc->String.Length + 1;
|
||||
}
|
||||
|
||||
/* Allocate a buffer for the HID */
|
||||
|
||||
Hid = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_DEVICE_ID) + (ACPI_SIZE) Length);
|
||||
if (!Hid)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Area for the string starts after DEVICE_ID struct */
|
||||
|
||||
Hid->String = ACPI_ADD_PTR (char, Hid, sizeof (ACPI_DEVICE_ID));
|
||||
|
||||
/* Convert EISAID to a string or simply copy existing string */
|
||||
|
||||
if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER)
|
||||
{
|
||||
AcpiExEisaIdToString (Hid->String, ObjDesc->Integer.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiUtCopyIdString (Hid->String, ObjDesc->String.Pointer);
|
||||
}
|
||||
|
||||
Hid->Length = Length;
|
||||
*ReturnId = Hid;
|
||||
|
||||
|
||||
Cleanup:
|
||||
|
||||
/* On exit, we must delete the return object */
|
||||
|
||||
AcpiUtRemoveReference (ObjDesc);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtExecute_UID
|
||||
*
|
||||
* PARAMETERS: DeviceNode - Node for the device
|
||||
* ReturnId - Where the string UID is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Executes the _UID control method that returns the unique
|
||||
* ID of the device. The UID is either a 64-bit Integer (NOT an
|
||||
* EISAID) or a string. Always returns a string. A 64-bit integer
|
||||
* is converted to a decimal string.
|
||||
*
|
||||
* NOTE: Internal function, no parameter validation
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_UID (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_DEVICE_ID **ReturnId)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_DEVICE_ID *Uid;
|
||||
UINT32 Length;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (UtExecute_UID);
|
||||
|
||||
|
||||
Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__UID,
|
||||
ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Get the size of the String to be returned, includes null terminator */
|
||||
|
||||
if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER)
|
||||
{
|
||||
Length = ACPI_MAX64_DECIMAL_DIGITS + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Length = ObjDesc->String.Length + 1;
|
||||
}
|
||||
|
||||
/* Allocate a buffer for the UID */
|
||||
|
||||
Uid = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_DEVICE_ID) + (ACPI_SIZE) Length);
|
||||
if (!Uid)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Area for the string starts after DEVICE_ID struct */
|
||||
|
||||
Uid->String = ACPI_ADD_PTR (char, Uid, sizeof (ACPI_DEVICE_ID));
|
||||
|
||||
/* Convert an Integer to string, or just copy an existing string */
|
||||
|
||||
if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER)
|
||||
{
|
||||
AcpiExIntegerToString (Uid->String, ObjDesc->Integer.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiUtCopyIdString (Uid->String, ObjDesc->String.Pointer);
|
||||
}
|
||||
|
||||
Uid->Length = Length;
|
||||
*ReturnId = Uid;
|
||||
|
||||
|
||||
Cleanup:
|
||||
|
||||
/* On exit, we must delete the return object */
|
||||
|
||||
AcpiUtRemoveReference (ObjDesc);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtExecute_CID
|
||||
*
|
||||
* PARAMETERS: DeviceNode - Node for the device
|
||||
* ReturnCidList - Where the CID list is returned
|
||||
*
|
||||
* RETURN: Status, list of CID strings
|
||||
*
|
||||
* DESCRIPTION: Executes the _CID control method that returns one or more
|
||||
* compatible hardware IDs for the device.
|
||||
*
|
||||
* NOTE: Internal function, no parameter validation
|
||||
*
|
||||
* A _CID method can return either a single compatible ID or a package of
|
||||
* compatible IDs. Each compatible ID can be one of the following:
|
||||
* 1) Integer (32 bit compressed EISA ID) or
|
||||
* 2) String (PCI ID format, e.g. "PCI\VEN_vvvv&DEV_dddd&SUBSYS_ssssssss")
|
||||
*
|
||||
* The Integer CIDs are converted to string format by this function.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_CID (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_DEVICE_ID_LIST **ReturnCidList)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT **CidObjects;
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_DEVICE_ID_LIST *CidList;
|
||||
char *NextIdString;
|
||||
UINT32 StringAreaSize;
|
||||
UINT32 Length;
|
||||
UINT32 CidListSize;
|
||||
ACPI_STATUS Status;
|
||||
UINT32 Count;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (UtExecute_CID);
|
||||
|
||||
|
||||
/* Evaluate the _CID method for this device */
|
||||
|
||||
Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__CID,
|
||||
ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_PACKAGE,
|
||||
&ObjDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the count and size of the returned _CIDs. _CID can return either
|
||||
* a Package of Integers/Strings or a single Integer or String.
|
||||
* Note: This section also validates that all CID elements are of the
|
||||
* correct type (Integer or String).
|
||||
*/
|
||||
if (ObjDesc->Common.Type == ACPI_TYPE_PACKAGE)
|
||||
{
|
||||
Count = ObjDesc->Package.Count;
|
||||
CidObjects = ObjDesc->Package.Elements;
|
||||
}
|
||||
else /* Single Integer or String CID */
|
||||
{
|
||||
Count = 1;
|
||||
CidObjects = &ObjDesc;
|
||||
}
|
||||
|
||||
StringAreaSize = 0;
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
/* String lengths include null terminator */
|
||||
|
||||
switch (CidObjects[i]->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_INTEGER:
|
||||
StringAreaSize += ACPI_EISAID_STRING_SIZE;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
StringAreaSize += CidObjects[i]->String.Length + 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
Status = AE_TYPE;
|
||||
goto Cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Now that we know the length of the CIDs, allocate return buffer:
|
||||
* 1) Size of the base structure +
|
||||
* 2) Size of the CID DEVICE_ID array +
|
||||
* 3) Size of the actual CID strings
|
||||
*/
|
||||
CidListSize = sizeof (ACPI_DEVICE_ID_LIST) +
|
||||
((Count - 1) * sizeof (ACPI_DEVICE_ID)) +
|
||||
StringAreaSize;
|
||||
|
||||
CidList = ACPI_ALLOCATE_ZEROED (CidListSize);
|
||||
if (!CidList)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Area for CID strings starts after the CID DEVICE_ID array */
|
||||
|
||||
NextIdString = ACPI_CAST_PTR (char, CidList->Ids) +
|
||||
((ACPI_SIZE) Count * sizeof (ACPI_DEVICE_ID));
|
||||
|
||||
/* Copy/convert the CIDs to the return buffer */
|
||||
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
if (CidObjects[i]->Common.Type == ACPI_TYPE_INTEGER)
|
||||
{
|
||||
/* Convert the Integer (EISAID) CID to a string */
|
||||
|
||||
AcpiExEisaIdToString (NextIdString, CidObjects[i]->Integer.Value);
|
||||
Length = ACPI_EISAID_STRING_SIZE;
|
||||
}
|
||||
else /* ACPI_TYPE_STRING */
|
||||
{
|
||||
/* Copy the String CID from the returned object */
|
||||
|
||||
AcpiUtCopyIdString (NextIdString, CidObjects[i]->String.Pointer);
|
||||
Length = CidObjects[i]->String.Length + 1;
|
||||
}
|
||||
|
||||
CidList->Ids[i].String = NextIdString;
|
||||
CidList->Ids[i].Length = Length;
|
||||
NextIdString += Length;
|
||||
}
|
||||
|
||||
/* Finish the CID list */
|
||||
|
||||
CidList->Count = Count;
|
||||
CidList->ListSize = CidListSize;
|
||||
*ReturnCidList = CidList;
|
||||
|
||||
|
||||
Cleanup:
|
||||
|
||||
/* On exit, we must delete the _CID return object */
|
||||
|
||||
AcpiUtRemoveReference (ObjDesc);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
@ -184,12 +184,12 @@ AcpiUtTerminate (
|
||||
*
|
||||
* FUNCTION: AcpiUtSubsystemShutdown
|
||||
*
|
||||
* PARAMETERS: none
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: none
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Shutdown the various subsystems. Don't delete the mutex
|
||||
* objects here -- because the AML debugger may be still running.
|
||||
* DESCRIPTION: Shutdown the various components. Do not delete the mutex
|
||||
* objects here, because the AML debugger may be still running.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -197,24 +197,8 @@ void
|
||||
AcpiUtSubsystemShutdown (
|
||||
void)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_TRACE (UtSubsystemShutdown);
|
||||
|
||||
/* Just exit if subsystem is already shutdown */
|
||||
|
||||
if (AcpiGbl_Shutdown)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"ACPI Subsystem is already terminated"));
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* Subsystem appears active, go ahead and shut it down */
|
||||
|
||||
AcpiGbl_Shutdown = TRUE;
|
||||
AcpiGbl_StartupFlags = 0;
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Shutting down ACPI Subsystem\n"));
|
||||
|
||||
#ifndef ACPI_ASL_COMPILER
|
||||
|
||||
|
@ -124,6 +124,12 @@
|
||||
#define _COMPONENT ACPI_UTILITIES
|
||||
ACPI_MODULE_NAME ("utmisc")
|
||||
|
||||
/*
|
||||
* Common suffix for messages
|
||||
*/
|
||||
#define ACPI_COMMON_MSG_SUFFIX \
|
||||
AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -205,6 +211,40 @@ AcpiUtValidateException (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtIsPciRootBridge
|
||||
*
|
||||
* PARAMETERS: Id - The HID/CID in string format
|
||||
*
|
||||
* RETURN: TRUE if the Id is a match for a PCI/PCI-Express Root Bridge
|
||||
*
|
||||
* DESCRIPTION: Determine if the input ID is a PCI Root Bridge ID.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
BOOLEAN
|
||||
AcpiUtIsPciRootBridge (
|
||||
char *Id)
|
||||
{
|
||||
|
||||
/*
|
||||
* Check if this is a PCI root bridge.
|
||||
* ACPI 3.0+: check for a PCI Express root also.
|
||||
*/
|
||||
if (!(ACPI_STRCMP (Id,
|
||||
PCI_ROOT_HID_STRING)) ||
|
||||
|
||||
!(ACPI_STRCMP (Id,
|
||||
PCI_EXPRESS_ROOT_HID_STRING)))
|
||||
{
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtIsAmlTable
|
||||
@ -1283,7 +1323,7 @@ AcpiError (
|
||||
|
||||
va_start (args, Format);
|
||||
AcpiOsVprintf (Format, args);
|
||||
AcpiOsPrintf (" %8.8X %s-%u\n", ACPI_CA_VERSION, ModuleName, LineNumber);
|
||||
ACPI_COMMON_MSG_SUFFIX;
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
@ -1302,7 +1342,7 @@ AcpiException (
|
||||
|
||||
va_start (args, Format);
|
||||
AcpiOsVprintf (Format, args);
|
||||
AcpiOsPrintf (" %8.8X %s-%u\n", ACPI_CA_VERSION, ModuleName, LineNumber);
|
||||
ACPI_COMMON_MSG_SUFFIX;
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
@ -1320,7 +1360,7 @@ AcpiWarning (
|
||||
|
||||
va_start (args, Format);
|
||||
AcpiOsVprintf (Format, args);
|
||||
AcpiOsPrintf (" %8.8X %s-%u\n", ACPI_CA_VERSION, ModuleName, LineNumber);
|
||||
ACPI_COMMON_MSG_SUFFIX;
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
@ -1353,3 +1393,50 @@ ACPI_EXPORT_SYMBOL (AcpiWarning)
|
||||
ACPI_EXPORT_SYMBOL (AcpiInfo)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtPredefinedWarning
|
||||
*
|
||||
* PARAMETERS: ModuleName - Caller's module name (for error output)
|
||||
* LineNumber - Caller's line number (for error output)
|
||||
* Pathname - Full pathname to the node
|
||||
* NodeFlags - From Namespace node for the method/object
|
||||
* Format - Printf format string + additional args
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Warnings for the predefined validation module. Messages are
|
||||
* only emitted the first time a problem with a particular
|
||||
* method/object is detected. This prevents a flood of error
|
||||
* messages for methods that are repeatedly evaluated.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
AcpiUtPredefinedWarning (
|
||||
const char *ModuleName,
|
||||
UINT32 LineNumber,
|
||||
char *Pathname,
|
||||
UINT8 NodeFlags,
|
||||
const char *Format,
|
||||
...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
|
||||
/*
|
||||
* Warning messages for this method/object will be disabled after the
|
||||
* first time a validation fails or an object is successfully repaired.
|
||||
*/
|
||||
if (NodeFlags & ANOBJ_EVALUATED)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("ACPI Warning for %s: ", Pathname);
|
||||
|
||||
va_start (args, Format);
|
||||
AcpiOsVprintf (Format, args);
|
||||
ACPI_COMMON_MSG_SUFFIX;
|
||||
va_end (args);
|
||||
}
|
||||
|
@ -359,6 +359,16 @@ AcpiInitializeObjects (
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Execute any module-level code that was detected during the table load
|
||||
* phase. Although illegal since ACPI 2.0, there are many machines that
|
||||
* contain this type of code. Each block of detected executable AML code
|
||||
* outside of any control method is wrapped with a temporary control
|
||||
* method object and placed on a global list. The methods on this list
|
||||
* are executed below.
|
||||
*/
|
||||
AcpiNsExecModuleCodeList ();
|
||||
|
||||
/*
|
||||
* Initialize the objects that remain uninitialized. This runs the
|
||||
* executable AML that may be part of the declaration of these objects:
|
||||
@ -437,7 +447,7 @@ ACPI_EXPORT_SYMBOL (AcpiInitializeObjects)
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Shutdown the ACPI subsystem. Release all resources.
|
||||
* DESCRIPTION: Shutdown the ACPICA subsystem and release all resources.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -451,15 +461,28 @@ AcpiTerminate (
|
||||
ACPI_FUNCTION_TRACE (AcpiTerminate);
|
||||
|
||||
|
||||
/* Just exit if subsystem is already shutdown */
|
||||
|
||||
if (AcpiGbl_Shutdown)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "ACPI Subsystem is already terminated"));
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Subsystem appears active, go ahead and shut it down */
|
||||
|
||||
AcpiGbl_Shutdown = TRUE;
|
||||
AcpiGbl_StartupFlags = 0;
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Shutting down ACPI Subsystem\n"));
|
||||
|
||||
/* Terminate the AML Debugger if present */
|
||||
|
||||
ACPI_DEBUGGER_EXEC(AcpiGbl_DbTerminateThreads = TRUE);
|
||||
ACPI_DEBUGGER_EXEC (AcpiGbl_DbTerminateThreads = TRUE);
|
||||
|
||||
/* Shutdown and free all resources */
|
||||
|
||||
AcpiUtSubsystemShutdown ();
|
||||
|
||||
|
||||
/* Free the mutex objects */
|
||||
|
||||
AcpiUtMutexTerminate ();
|
||||
@ -480,8 +503,8 @@ AcpiTerminate (
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiTerminate)
|
||||
|
||||
#ifndef ACPI_ASL_COMPILER
|
||||
|
||||
#ifndef ACPI_ASL_COMPILER
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiSubsystemStatus
|
||||
|
Loading…
Reference in New Issue
Block a user