Update to ACPICA 20120711.

This is an update from 20110922 and A LOT has happened since then. See
https://acpica.org/download/changes.txt for all the changes.
One of the more interesting is some problems with shutdown in ACPICAhas been fixed.
There may still be problems on our side though.
This commit is contained in:
Fredrik Holmqvist
2012-07-12 18:32:55 +02:00
parent 778438b20b
commit 6822cda011
183 changed files with 9820 additions and 2201 deletions
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -370,20 +370,24 @@ FlSplitInputPathname (
return (AE_NO_MEMORY);
}
Substring = strrchr (DirectoryPath, '\\');
/* Convert backslashes to slashes in the entire path */
UtConvertBackslashes (DirectoryPath);
/* Backup to last slash or colon */
Substring = strrchr (DirectoryPath, '/');
if (!Substring)
{
Substring = strrchr (DirectoryPath, '/');
if (!Substring)
{
Substring = strrchr (DirectoryPath, ':');
}
Substring = strrchr (DirectoryPath, ':');
}
/* Extract the simple filename */
if (!Substring)
{
Filename = FlStrdup (DirectoryPath);
DirectoryPath[0] = 0;
Filename = FlStrdup (InputPath);
}
else
{
@@ -398,7 +402,6 @@ FlSplitInputPathname (
*OutDirectoryPath = DirectoryPath;
*OutFilename = Filename;
return (AE_OK);
}
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -147,6 +147,10 @@ LsSetupNsList (
/* Local prototypes */
static UINT32
AdGetFileSize (
FILE *File);
static void
AdCreateTableHeader (
char *Filename,
@@ -230,6 +234,38 @@ static ACPI_TABLE_DESC LocalTables[1];
static ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot;
/*******************************************************************************
*
* FUNCTION: AdGetFileSize
*
* PARAMETERS: File - Open file handle
*
* RETURN: File Size
*
* DESCRIPTION: Get current file size. Uses seek-to-EOF. File must be open.
*
******************************************************************************/
static UINT32
AdGetFileSize (
FILE *File)
{
UINT32 FileSize;
long Offset;
Offset = ftell (File);
fseek (File, 0, SEEK_END);
FileSize = (UINT32) ftell (File);
/* Restore file pointer */
fseek (File, Offset, SEEK_SET);
return (FileSize);
}
/*******************************************************************************
*
* FUNCTION: AdInitialize
@@ -448,11 +484,14 @@ AdAmlDisassemble (
AdDisassemblerHeader (Filename);
AcpiOsPrintf (" * ACPI Data Table [%4.4s]\n *\n",
Table->Signature);
AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue\n */\n\n");
AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength] "
"FieldName : FieldValue\n */\n\n");
AcpiDmDumpDataTable (Table);
fprintf (stderr, "Acpi Data Table [%4.4s] decoded, written to \"%s\"\n",
Table->Signature, DisasmFilename);
fprintf (stderr, "Acpi Data Table [%4.4s] decoded\n",
Table->Signature);
fprintf (stderr, "Formatted output: %s - %u bytes\n",
DisasmFilename, AdGetFileSize (File));
}
else
{
@@ -475,15 +514,17 @@ AdAmlDisassemble (
AcpiOsPrintf ("*****/\n");
}
/*
* Load namespace from names created within control methods
*/
AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode, OwnerId);
/* Load namespace from names created within control methods */
AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot,
AcpiGbl_RootNode, OwnerId);
/*
* Cross reference the namespace here, in order to generate External() statements
* Cross reference the namespace here, in order to
* generate External() statements
*/
AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode, OwnerId);
AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot,
AcpiGbl_RootNode, OwnerId);
if (AslCompilerdebug)
{
@@ -494,24 +535,20 @@ AdAmlDisassemble (
AcpiDmFindOrphanMethods (AcpiGbl_ParseOpRoot);
/* Convert fixed-offset references to resource descriptors to symbolic references */
AcpiDmConvertResourceIndexes (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode);
/*
* If we found any external control methods, we must reparse the entire
* tree with the new information (namely, the number of arguments per
* method)
* If we found any external control methods, we must reparse
* the entire tree with the new information (namely, the
* number of arguments per method)
*/
if (AcpiDmGetExternalMethodCount ())
{
fprintf (stderr,
"\nFound %u external control methods, reparsing with new information\n",
"\nFound %u external control methods, "
"reparsing with new information\n",
AcpiDmGetExternalMethodCount ());
/*
* Reparse, rebuild namespace. no need to xref namespace
*/
/* Reparse, rebuild namespace. no need to xref namespace */
AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot);
AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode);
@@ -528,7 +565,7 @@ AdAmlDisassemble (
Status = AcpiNsRootInitialize ();
AcpiDmAddExternalsToNamespace ();
/* Parse table. No need to reload it, however (FALSE) */
/* Parse the table again. No need to reload it, however */
Status = AdParseTable (Table, NULL, FALSE, FALSE);
if (ACPI_FAILURE (Status))
@@ -549,14 +586,23 @@ AdAmlDisassemble (
}
}
/*
* Now that the namespace is finalized, we can perform namespace
* transforms.
*
* 1) Convert fixed-offset references to resource descriptors
* to symbolic references (Note: modifies namespace)
*/
AcpiDmConvertResourceIndexes (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode);
/* Optional displays */
if (AcpiGbl_DbOpt_disasm)
{
AdDisplayTables (Filename, Table);
fprintf (stderr,
"Disassembly completed, written to \"%s\"\n",
DisasmFilename);
fprintf (stderr, "Disassembly completed\n");
fprintf (stderr, "ASL Output: %s - %u bytes\n",
DisasmFilename, AdGetFileSize (File));
}
}
@@ -574,11 +620,12 @@ Cleanup:
if (OutToFile && File)
{
if (AslCompilerdebug) /* Display final namespace, with transforms */
{
LsSetupNsList (File);
LsDisplayNamespace ();
}
#ifdef ASL_DISASM_DEBUG
LsSetupNsList (File);
LsDisplayNamespace ();
#endif
fclose (File);
AcpiOsRedirectOutput (stdout);
}
@@ -940,6 +987,7 @@ AdParseDeferredOps (
break;
case AML_REGION_OP:
case AML_DATA_REGION_OP:
case AML_CREATE_QWORD_FIELD_OP:
case AML_CREATE_DWORD_FIELD_OP:
case AML_CREATE_WORD_FIELD_OP:
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -450,6 +450,10 @@ AcpiDmDumpDescending (
AcpiOsPrintf ("%X", (UINT32) Op->Common.Value.Integer);
break;
case AML_QWORD_OP:
AcpiOsPrintf ("%8.8X%8.8X", ACPI_FORMAT_UINT64 (Op->Common.Value.Integer));
break;
case AML_INT_NAMEPATH_OP:
if (Op->Common.Value.String)
{
@@ -589,6 +593,7 @@ AcpiDmFindOrphanDescending (
if ((OpInfo->Class != AML_CLASS_EXECUTE) &&
(OpInfo->Class != AML_CLASS_CREATE) &&
(OpInfo->ObjectType != ACPI_TYPE_LOCAL_ALIAS) &&
(ParentOp->Common.AmlOpcode != AML_INT_METHODCALL_OP) &&
!Op->Common.Node)
{
@@ -811,13 +816,23 @@ AcpiDmXrefDescendingOp (
if (OpInfo->Flags & AML_NAMED)
{
if ((Op->Common.AmlOpcode == AML_ALIAS_OP) ||
(Op->Common.AmlOpcode == AML_SCOPE_OP))
/*
* Only these two operators (Alias, Scope) refer to an existing
* name, it is the first argument
*/
if (Op->Common.AmlOpcode == AML_ALIAS_OP)
{
ObjectType = ACPI_TYPE_ANY;
NextOp = Op->Common.Value.Arg;
NextOp = NextOp->Common.Value.Arg;
if (NextOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
{
Path = NextOp->Common.Value.String;
}
}
else if (Op->Common.AmlOpcode == AML_SCOPE_OP)
{
/*
* Only these two operators refer to an existing name,
* first argument
*/
Path = (char *) Op->Named.Path;
}
}
@@ -825,6 +840,8 @@ AcpiDmXrefDescendingOp (
{
/* Referenced Buffer Name is the first child */
ObjectType = ACPI_TYPE_BUFFER; /* Change from TYPE_BUFFER_FIELD */
NextOp = Op->Common.Value.Arg;
if (NextOp->Common.AmlOpcode == AML_INT_NAMEPATH_OP)
{
@@ -851,6 +868,11 @@ AcpiDmXrefDescendingOp (
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
WalkState, &Node);
if (ACPI_SUCCESS (Status) && (Node->Flags & ANOBJ_IS_EXTERNAL))
{
Status = AE_NOT_FOUND;
}
if (ACPI_FAILURE (Status))
{
if (Status == AE_NOT_FOUND)
@@ -0,0 +1,395 @@
/******************************************************************************
*
* Module Name: ahpredef - Table of all known ACPI predefined names
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
*
* 2.1. This is your license from Intel Corp. under its intellectual property
* rights. You may have additional license terms from the party that provided
* you this software, covering your right to use that party's intellectual
* property rights.
*
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
* copy of the source code appearing in this file ("Covered Code") an
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
* base code distributed originally by Intel ("Original Intel Code") to copy,
* make derivatives, distribute, use and display any portion of the Covered
* Code in any form, with the right to sublicense such rights; and
*
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
* license (with the right to sublicense), under only those claims of Intel
* patents that are infringed by the Original Intel Code, to make, use, sell,
* offer to sell, and import the Covered Code and derivative works thereof
* solely to the minimum extent necessary to exercise the above copyright
* license, and in no event shall the patent license extend to any additions
* to or modifications of the Original Intel Code. No other license or right
* is granted directly or by implication, estoppel or otherwise;
*
* The above copyright and patent license is granted only if the following
* conditions are met:
*
* 3. Conditions
*
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification with rights to further distribute source must include
* the above Copyright Notice, the above License, this list of Conditions,
* and the following Disclaimer and Export Compliance provision. In addition,
* Licensee must cause all Covered Code to which Licensee contributes to
* contain a file documenting the changes Licensee made to create that Covered
* Code and the date of any change. Licensee must include in that file the
* documentation of any changes made by any predecessor Licensee. Licensee
* must include a prominent statement that the modification is derived,
* directly or indirectly, from Original Intel Code.
*
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification without rights to further distribute source must
* include the following Disclaimer and Export Compliance provision in the
* documentation and/or other materials provided with distribution. In
* addition, Licensee may not authorize further sublicense of source of any
* portion of the Covered Code, and must include terms to the effect that the
* license from Licensee to its licensee is limited to the intellectual
* property embodied in the software Licensee provides to its licensee, and
* not to intellectual property embodied in modifications its licensee may
* make.
*
* 3.3. Redistribution of Executable. Redistribution in executable form of any
* substantial portion of the Covered Code or modification must reproduce the
* above Copyright Notice, and the following Disclaimer and Export Compliance
* provision in the documentation and/or other materials provided with the
* distribution.
*
* 3.4. Intel retains all right, title, and interest in and to the Original
* Intel Code.
*
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
* Intel shall be used in advertising or otherwise to promote the sale, use or
* other dealings in products derived from or relating to the Covered Code
* without prior written authorization from Intel.
*
* 4. Disclaimer and Export Compliance
*
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
* LIMITED REMEDY.
*
* 4.3. Licensee shall not export, either directly or indirectly, any of this
* software or system incorporating such software without first obtaining any
* required license or other approval from the U. S. Department of Commerce or
* any other agency or department of the United States Government. In the
* event Licensee exports any such software from the United States or
* re-exports any such software from a foreign destination, Licensee shall
* ensure that the distribution and export/re-export of the software is in
* compliance with all laws, regulations, orders, or other restrictions of the
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
* any of its subsidiaries will export/re-export any technical data, process,
* software, or service, directly or indirectly, to any country for which the
* United States government or any agency thereof requires an export license,
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************/
#include "acpi.h"
#include "accommon.h"
/*
* iASL only needs a partial table (short descriptions only).
* AcpiHelp needs the full table.
*/
#ifdef ACPI_ASL_COMPILER
#define AH_PREDEF(Name, ShortDesc, LongDesc) {Name, ShortDesc}
#else
#define AH_PREDEF(Name, ShortDesc, LongDesc) {Name, ShortDesc, LongDesc}
#endif
/*
* Predefined ACPI names, with short description and return value.
* This table was extracted directly from the ACPI specification.
*/
const AH_PREDEFINED_NAME AslPredefinedInfo[] =
{
AH_PREDEF ("_ACx", "Active Cooling", "Returns the active cooling policy threshold values"),
AH_PREDEF ("_ADR", "Address", "Returns the address of a device on its parent bus"),
AH_PREDEF ("_AEI", "ACPI Event Interrupts", "Returns a list of GPIO events to be used as ACPI events"),
AH_PREDEF ("_ALC", "Ambient Light Chromaticity", "Returns the ambient light color chromaticity"),
AH_PREDEF ("_ALI", "Ambient Light Illuminance", "Returns the ambient light brightness"),
AH_PREDEF ("_ALN", "Alignment", "Base alignment, Resource Descriptor field"),
AH_PREDEF ("_ALP", "Ambient Light Polling", "Returns the ambient light sensor polling frequency"),
AH_PREDEF ("_ALR", "Ambient Light Response", "Returns the ambient light brightness to display brightness mappings"),
AH_PREDEF ("_ALT", "Ambient Light Temperature", "Returns the ambient light color temperature"),
AH_PREDEF ("_ALx", "Active List", "Returns a list of active cooling device objects"),
AH_PREDEF ("_ART", "Active Cooling Relationship Table", "Returns thermal relationship information between platform devices and fan devices"),
AH_PREDEF ("_ASI", "Address Space Id", "Resource Descriptor field"),
AH_PREDEF ("_ASZ", "Access Size", "Resource Descriptor field"),
AH_PREDEF ("_ATT", "Type-Specific Attribute", "Resource Descriptor field"),
AH_PREDEF ("_BAS", "Base Address", "Range base address, Resource Descriptor field"),
AH_PREDEF ("_BBN", "BIOS Bus Number", "Returns the PCI bus number returned by the BIOS"),
AH_PREDEF ("_BCL", "Brightness Control Levels", "Returns a list of supported brightness control levels"),
AH_PREDEF ("_BCM", "Brightness Control Method", "Sets the brightness level of the display device"),
AH_PREDEF ("_BCT", "Battery Charge Time", "Returns time remaining to complete charging battery"),
AH_PREDEF ("_BDN", "BIOS Dock Name", "Returns the Dock ID returned by the BIOS"),
AH_PREDEF ("_BFS", "Back From Sleep", "Inform AML of a wake event"),
AH_PREDEF ("_BIF", "Battery Information", "Returns a Control Method Battery information block"),
AH_PREDEF ("_BIX", "Battery Information Extended", "Returns a Control Method Battery extended information block"),
AH_PREDEF ("_BLT", "Battery Level Threshold", "Set battery level threshold preferences"),
AH_PREDEF ("_BM_", "Bus Master", "Resource Descriptor field"),
AH_PREDEF ("_BMA", "Battery Measurement Averaging Interval", "Sets battery measurement averaging interval"),
AH_PREDEF ("_BMC", "Battery Maintenance Control", "Sets battery maintenance and control features"),
AH_PREDEF ("_BMD", "Battery Maintenance Data", "Returns battery maintenance, control, and state data"),
AH_PREDEF ("_BMS", "Battery Measurement Sampling Time", "Sets the battery measurement sampling time"),
AH_PREDEF ("_BQC", "Brightness Query Current", "Returns the current display brightness level"),
AH_PREDEF ("_BST", "Battery Status", "Returns a Control Method Battery status block"),
AH_PREDEF ("_BTM", "Battery Time", "Returns the battery runtime"),
AH_PREDEF ("_BTP", "Battery Trip Point", "Sets a Control Method Battery trip point"),
AH_PREDEF ("_CBA", "Configuration Base Address", "Sets the base address for a PCI Express host bridge"),
AH_PREDEF ("_CDM", "Clock Domain", "Returns a logical processor's clock domain identifier"),
AH_PREDEF ("_CID", "Compatible ID", "Returns a device's Plug and Play Compatible ID list"),
AH_PREDEF ("_CLS", "Class Code", "Returns PCI class code and subclass"),
AH_PREDEF ("_CPC", "Continuous Performance Control", "Returns a list of performance control interfaces"),
AH_PREDEF ("_CRS", "Current Resource Settings", "Returns the current resource settings for a device"),
AH_PREDEF ("_CRT", "Critical Temperature", "Returns the shutdown critical temperature"),
AH_PREDEF ("_CSD", "C-State Dependencies", "Returns a list of C-state dependencies"),
AH_PREDEF ("_CST", "C-States", "Returns a list of supported C-states"),
AH_PREDEF ("_CWS", "Clear Wake Alarm Status", "Clear the status of wake alarms"),
AH_PREDEF ("_DBT", "Debounce Timeout", "Timeout value, Resource Descriptor field"),
AH_PREDEF ("_DCK", "Dock Present", "Sets docking isolation. Presence indicates device is a docking station"),
AH_PREDEF ("_DCS", "Display Current Status", "Returns status of the display output device"),
AH_PREDEF ("_DDC", "Display Data Current", "Returns the EDID for the display output device"),
AH_PREDEF ("_DDN", "DOS Device Name", "Returns a device logical name"),
AH_PREDEF ("_DEC", "Decode", "Device decoding type, Resource Descriptor field"),
AH_PREDEF ("_DEP", "Dependencies", "Returns a list of operation region dependencies"),
AH_PREDEF ("_DGS", "Display Graphics State", "Return the current state of the output device"),
AH_PREDEF ("_DIS", "Disable Device", "Disables a device"),
AH_PREDEF ("_DLM", "Device Lock Mutex", "Defines mutex for OS/AML sharing"),
AH_PREDEF ("_DMA", "Direct Memory Access", "Returns a device's current resources for DMA transactions"),
AH_PREDEF ("_DOD", "Display Output Devices", "Enumerate all devices attached to the display adapter"),
AH_PREDEF ("_DOS", "Disable Output Switching", "Sets the display output switching mode"),
AH_PREDEF ("_DPL", "Device Selection Polarity", "Polarity of Device Selection signal, Resource Descriptor field"),
AH_PREDEF ("_DRS", "Drive Strength", "Drive Strength setting for GPIO connection, Resource Descriptor field"),
AH_PREDEF ("_DSM", "Device-Specific Method", "Executes device-specific functions"),
AH_PREDEF ("_DSS", "Device Set State", "Sets the display device state"),
AH_PREDEF ("_DSW", "Device Sleep Wake", "Sets the sleep and wake transition states for a device"),
AH_PREDEF ("_DTI", "Device Temperature Indication", "Conveys native device temperature to the platform"),
AH_PREDEF ("_Exx", "Edge-Triggered GPE", "Method executed as a result of a general-purpose event"),
AH_PREDEF ("_EC_", "Embedded Controller", "returns EC offset and query information"),
AH_PREDEF ("_EDL", "Eject Device List", "Returns a list of devices that are dependent on a device (docking)"),
AH_PREDEF ("_EJD", "Ejection Dependent Device", "Returns the name of dependent (parent) device (docking)"),
AH_PREDEF ("_EJx", "Eject Device", "Begin or cancel a device ejection request (docking)"),
AH_PREDEF ("_END", "Endianness", "Endian orientation, Resource Descriptor field"),
AH_PREDEF ("_EVT", "Event", "Event method for GPIO events"),
AH_PREDEF ("_FDE", "Floppy Disk Enumerate", "Returns floppy disk configuration information"),
AH_PREDEF ("_FDI", "Floppy Drive Information", "Returns a floppy drive information block"),
AH_PREDEF ("_FDM", "Floppy Drive Mode", "Sets a floppy drive speed"),
AH_PREDEF ("_FIF", "Fan Information", "Returns fan device information"),
AH_PREDEF ("_FIX", "Fixed Register Resource Provider", "Returns a list of devices that implement FADT register blocks"),
AH_PREDEF ("_FLC", "Flow Control", "Flow control, Resource Descriptor field"),
AH_PREDEF ("_FPS", "Fan Performance States", "Returns a list of supported fan performance states"),
AH_PREDEF ("_FSL", "Fan Set Level", "Control method that sets the fan device's speed level (performance state)"),
AH_PREDEF ("_FST", "Fan Status", "Returns current status information for a fan device"),
AH_PREDEF ("_GAI", "Get Averaging Interval", "Returns the power meter averaging interval"),
AH_PREDEF ("_GCP", "Get Capabilities", "Get device time capabilities"),
AH_PREDEF ("_GHL", "Get Hardware Limit", "Returns the hardware limit enforced by the power meter"),
AH_PREDEF ("_GL_", "Global Lock", "OS-defined Global Lock mutex object"),
AH_PREDEF ("_GLK", "Get Global Lock Requirement", "Returns a device's Global Lock requirement for device access"),
AH_PREDEF ("_GPD", "Get Post Data", "Returns the value of the VGA device that will be posted at boot"),
AH_PREDEF ("_GPE", "General Purpose Events", "Predefined scope (\\_GPE) or SCI number for EC"),
AH_PREDEF ("_GRA", "Granularity", "Address space granularity, Resource Descriptor field"),
AH_PREDEF ("_GRT", "Get Real Time", "Returns current time-of-day from a time/alarm device"),
AH_PREDEF ("_GSB", "Global System Interrupt Base", "Returns the GSB for a I/O APIC device"),
AH_PREDEF ("_GTF", "Get Task File", "Returns a list of ATA commands to restore a drive to default state"),
AH_PREDEF ("_GTM", "Get Timing Mode", "Returns a list of IDE controller timing information"),
AH_PREDEF ("_GTS", "Going To Sleep", "Inform AML of pending sleep"),
AH_PREDEF ("_GWS", "Get Wake Status", "Return status of wake alarms"),
AH_PREDEF ("_HE_", "High-Edge", "Interrupt triggering, Resource Descriptor field"),
AH_PREDEF ("_HID", "Hardware ID", "Returns a device's Plug and Play Hardware ID"),
AH_PREDEF ("_HOT", "Hot Temperature", "Returns the critical temperature for sleep (entry to S4)"),
AH_PREDEF ("_HPP", "Hot Plug Parameters", "Returns a list of hot-plug information for a PCI device"),
AH_PREDEF ("_HPX", "Hot Plug Parameter Extensions", "Returns a list of hot-plug information for a PCI device. Supersedes _HPP"),
AH_PREDEF ("_HRV", "Hardware Revision", "Returns a hardware revision value"),
AH_PREDEF ("_IFT", "IPMI Interface Type", "See the Intelligent Platform Management Interface Specification"),
AH_PREDEF ("_INI", "Initialize", "Performs device specific initialization"),
AH_PREDEF ("_INT", "Interrupts", "Interrupt mask bits, Resource Descriptor field"),
AH_PREDEF ("_IOR", "I/O Restriction", "Restriction type, Resource Descriptor field"),
AH_PREDEF ("_IRC", "Inrush Current", "Presence indicates that a device has a significant inrush current draw"),
AH_PREDEF ("_Lxx", "Level-Triggered GPE", "Control method executed as a result of a general-purpose event"),
AH_PREDEF ("_LCK", "Lock Device", "Locks or unlocks a device (docking)"),
AH_PREDEF ("_LEN", "Length", "Range length, Resource Descriptor field"),
AH_PREDEF ("_LID", "Lid Status", "Returns the open/closed status of the lid on a mobile system"),
AH_PREDEF ("_LIN", "Lines In Use", "Handshake lines, Resource Descriptor field"),
AH_PREDEF ("_LL_", "Low Level", "Interrupt polarity, Resource Descriptor field"),
AH_PREDEF ("_MAF", "Maximum Address Fixed", "Resource Descriptor field"),
AH_PREDEF ("_MAT", "Multiple APIC Table Entry", "Returns a list of MADT APIC structure entries"),
AH_PREDEF ("_MAX", "Maximum Base Address", "Resource Descriptor field"),
AH_PREDEF ("_MBM", "Memory Bandwidth Monitoring Data", "Returns bandwidth monitoring data for a memory device"),
AH_PREDEF ("_MEM", "Memory Attributes", "Resource Descriptor field"),
AH_PREDEF ("_MIF", "Minimum Address Fixed", "Resource Descriptor field"),
AH_PREDEF ("_MIN", "Minimum Base Address", "Resource Descriptor field"),
AH_PREDEF ("_MLS", "Multiple Language String", "Returns a device description in multiple languages"),
AH_PREDEF ("_MOD", "Mode", "Interrupt mode, Resource Descriptor field"),
AH_PREDEF ("_MSG", "Message", "Sets the system message waiting status indicator"),
AH_PREDEF ("_MSM", "Memory Set Monitoring", "Sets bandwidth monitoring parameters for a memory device"),
AH_PREDEF ("_MTP", "Memory Type", "Resource Descriptor field"),
AH_PREDEF ("_NTT", "Notification Temperature Threshold", "Returns a threshold for device temperature change that requires platform notification"),
AH_PREDEF ("_OFF", "Power Off", "Sets a power resource to the off state"),
AH_PREDEF ("_ON_", "Power On", "Sets a power resource to the on state"),
AH_PREDEF ("_OS_", "Operating System", "Returns a string that identifies the operating system"),
AH_PREDEF ("_OSC", "Operating System Capabilities", "Inform AML of host features and capabilities"),
AH_PREDEF ("_OSI", "Operating System Interfaces", "Returns supported interfaces, behaviors, and features"),
AH_PREDEF ("_OST", "OSPM Status Indication", "Inform AML of event processing status"),
AH_PREDEF ("_PAI", "Power Averaging Interval", "Sets the averaging interval for a power meter"),
AH_PREDEF ("_PAR", "Parity", "Parity bits, Resource Descriptor field"),
AH_PREDEF ("_PCL", "Power Consumer List", "Returns a list of devices powered by a power source"),
AH_PREDEF ("_PCT", "Performance Control", "Returns processor performance control and status registers"),
AH_PREDEF ("_PDC", "Processor Driver Capabilities", "Inform AML of processor driver capabilities"),
AH_PREDEF ("_PDL", "P-state Depth Limit", "Returns the lowest available performance P-state"),
AH_PREDEF ("_PHA", "Clock Phase", "Clock phase, Resource Descriptor field"),
AH_PREDEF ("_PIC", "Interrupt Model", "Inform AML of the interrupt model in use"),
AH_PREDEF ("_PIF", "Power Source Information", "Returns a Power Source information block"),
AH_PREDEF ("_PIN", "Pin List", "Pin list, Resource Descriptor field"),
AH_PREDEF ("_PLD", "Physical Device Location", "Returns a device's physical location information"),
AH_PREDEF ("_PMC", "Power Meter Capabilities", "Returns a list of Power Meter capabilities info"),
AH_PREDEF ("_PMD", "Power Metered Devices", "Returns a list of devices that are measured by the power meter device"),
AH_PREDEF ("_PMM", "Power Meter Measurement", "Returns the current value of the Power Meter"),
AH_PREDEF ("_POL", "Polarity", "Interrupt polarity, Resource Descriptor field"),
AH_PREDEF ("_PPC", "Performance Present Capabilites", "Returns a list of the performance states currently supported by the platform"),
AH_PREDEF ("_PPE", "Polling for Platform Error", "Returns the polling interval to retrieve Corrected Platform Error information"),
AH_PREDEF ("_PPI", "Pin Configuration", "Resource Descriptor field"),
AH_PREDEF ("_PR", "Processor", "Predefined scope for processor objects"),
AH_PREDEF ("_PR0", "Power Resources for D0", "Returns a list of dependent power resources to enter state D0 (fully on)"),
AH_PREDEF ("_PR1", "Power Resources for D1", "Returns a list of dependent power resources to enter state D1"),
AH_PREDEF ("_PR2", "Power Resources for D2", "Returns a list of dependent power resources to enter state D2"),
AH_PREDEF ("_PR3", "Power Resources for D3hot", "Returns a list of dependent power resources to enter state D3hot"),
AH_PREDEF ("_PRE", "Power Resources for Enumeration", "Returns a list of dependent power resources to enumerate devices on a bus"),
AH_PREDEF ("_PRL", "Power Source Redundancy List", "Returns a list of power source devices in the same redundancy grouping"),
AH_PREDEF ("_PRS", "Possible Resource Settings", "Returns a list of a device's possible resource settings"),
AH_PREDEF ("_PRT", "PCI Routing Table", "Returns a list of PCI interrupt mappings"),
AH_PREDEF ("_PRW", "Power Resources for Wake", "Returns a list of dependent power resources for waking"),
AH_PREDEF ("_PS0", "Power State 0", "Sets a device's power state to D0 (device fully on)"),
AH_PREDEF ("_PS1", "Power State 1", "Sets a device's power state to D1"),
AH_PREDEF ("_PS2", "Power State 2", "Sets a device's power state to D2"),
AH_PREDEF ("_PS3", "Power State 3", "Sets a device's power state to D3 (device off)"),
AH_PREDEF ("_PSC", "Power State Current", "Returns a device's current power state"),
AH_PREDEF ("_PSD", "Power State Dependencies", "Returns processor P-State dependencies"),
AH_PREDEF ("_PSE", "Power State for Enumeration", "Put a bus into enumeration power mode"),
AH_PREDEF ("_PSL", "Passive List", "Returns a list of passive cooling device objects"),
AH_PREDEF ("_PSR", "Power Source", "Returns the power source device currently in use"),
AH_PREDEF ("_PSS", "Performance Supported States", "Returns a list of supported processor performance states"),
AH_PREDEF ("_PSV", "Passive Temperature", "Returns the passive trip point temperature"),
AH_PREDEF ("_PSW", "Power State Wake", "Sets a device's wake function"),
AH_PREDEF ("_PTC", "Processor Throttling Control", "Returns throttling control and status registers"),
AH_PREDEF ("_PTP", "Power Trip Points", "Sets trip points for the Power Meter device"),
AH_PREDEF ("_PTS", "Prepare To Sleep", "Inform the platform of an impending sleep transition"),
AH_PREDEF ("_PUR", "Processor Utilization Request", "Returns the number of processors that the platform would like to idle"),
AH_PREDEF ("_PXM", "Device Proximity", "Returns a device's proximity domain identifier"),
AH_PREDEF ("_Qxx", "EC Query", "Embedded Controller query and SMBus Alarm control method"),
AH_PREDEF ("_RBO", "Register Bit Offset", "Resource Descriptor field"),
AH_PREDEF ("_RBW", "Register Bit Width", "Resource Descriptor field"),
AH_PREDEF ("_REG", "Region Availability", "Inform AML code of an operation region availability change"),
AH_PREDEF ("_REV", "Supported ACPI Revision", "Returns the revision of the ACPI specification that is implemented"),
AH_PREDEF ("_RMV", "Removal Status", "Returns a device's removal ability status (docking)"),
AH_PREDEF ("_RNG", "Range", "Memory range type, Resource Descriptor field"),
AH_PREDEF ("_ROM", "Read-Only Memory", "Returns a copy of the ROM data for a display device"),
AH_PREDEF ("_RT_", "Resource Type", "Resource Descriptor field"),
AH_PREDEF ("_RTV", "Relative Temperature Values", "Returns temperature value information"),
AH_PREDEF ("_RW_", "Read-Write Status", "Resource Descriptor field"),
AH_PREDEF ("_RXL", "Receive Buffer Size", "Serial channel buffer, Resource Descriptor field"),
AH_PREDEF ("_S0_", "S0 System State", "Returns values to enter the system into the S0 state"),
AH_PREDEF ("_S1_", "S1 System State", "Returns values to enter the system into the S1 state"),
AH_PREDEF ("_S2_", "S2 System State", "Returns values to enter the system into the S2 state"),
AH_PREDEF ("_S3_", "S3 System State", "Returns values to enter the system into the S3 state"),
AH_PREDEF ("_S4_", "S4 System State", "Returns values to enter the system into the S4 state"),
AH_PREDEF ("_S5_", "S5 System State", "Returns values to enter the system into the S5 state"),
AH_PREDEF ("_S1D", "S1 Device State", "Returns the highest D-state supported by a device when in the S1 state"),
AH_PREDEF ("_S2D", "S2 Device State", "Returns the highest D-state supported by a device when in the S2 state"),
AH_PREDEF ("_S3D", "S3 Device State", "Returns the highest D-state supported by a device when in the S3 state"),
AH_PREDEF ("_S4D", "S4 Device State", "Returns the highest D-state supported by a device when in the S4 state"),
AH_PREDEF ("_S0W", "S0 Device Wake State", "Returns the lowest D-state that the device can wake itself from S0"),
AH_PREDEF ("_S1W", "S1 Device Wake State", "Returns the lowest D-state for this device that can wake the system from S1"),
AH_PREDEF ("_S2W", "S2 Device Wake State", "Returns the lowest D-state for this device that can wake the system from S2"),
AH_PREDEF ("_S3W", "S3 Device Wake State", "Returns the lowest D-state for this device that can wake the system from S3"),
AH_PREDEF ("_S4W", "S4 Device Wake State", "Returns the lowest D-state for this device that can wake the system from S4"),
AH_PREDEF ("_SB_", "System Bus", "Predefined scope for device and bus objects"),
AH_PREDEF ("_SBS", "Smart Battery Subsystem", "Returns the subsystem configuration"),
AH_PREDEF ("_SCP", "Set Cooling Policy", "Sets the cooling policy (active or passive)"),
AH_PREDEF ("_SDD", "Set Device Data", "Sets data for a SATA device"),
AH_PREDEF ("_SEG", "PCI Segment", "Returns a device's PCI Segment Group number"),
AH_PREDEF ("_SHL", "Set Hardware Limit", "Sets the hardware limit enforced by the Power Meter"),
AH_PREDEF ("_SHR", "Sharable", "Interrupt share status, Resource Descriptor field"),
AH_PREDEF ("_SI_", "System Indicators", "Predefined scope"),
AH_PREDEF ("_SIZ", "Size", "DMA transfer size, Resource Descriptor field"),
AH_PREDEF ("_SLI", "System Locality Information", "Returns a list of NUMA system localities"),
AH_PREDEF ("_SLV", "Slave Mode", "Mode setting, Resource Descriptor field"),
AH_PREDEF ("_SPD", "Set Post Device", "Sets which video device will be posted at boot"),
AH_PREDEF ("_SPE", "Speed", "Connection speed, Resource Descriptor field"),
AH_PREDEF ("_SRS", "Set Resource Settings", "Sets a device's resource allocation"),
AH_PREDEF ("_SRT", "Set Real Time", "Sets the current time for a time/alarm device"),
AH_PREDEF ("_SRV", "IPMI Spec Revision", "See the Intelligent Platform Management Interface Specification"),
AH_PREDEF ("_SST", "System Status", "Sets the system status indicator"),
AH_PREDEF ("_STA", "Status", "Returns the current status of a Device or Power Resource"),
AH_PREDEF ("_STB", "Stop Bits", "Serial channel stop bits, Resource Descriptor field"),
AH_PREDEF ("_STM", "Set Timing Mode", "Sets an IDE controller transfer timings"),
AH_PREDEF ("_STP", "Set Expired Timer Wake Policy", "Sets expired timer policies of the wake alarm device"),
AH_PREDEF ("_STR", "Description String", "Returns a device's description string"),
AH_PREDEF ("_STV", "Set Timer Value", "Set timer values of the wake alarm device"),
AH_PREDEF ("_SUB", "Subsystem ID", "Returns the subsystem ID for a device"),
AH_PREDEF ("_SUN", "Slot User Number", "Returns the slot unique ID number"),
AH_PREDEF ("_SWS", "System Wake Source", "Returns the source event that caused the system to wake"),
AH_PREDEF ("_T_x", "Emitted by ASL Compiler", "Reserved for use by ASL compilers"),
AH_PREDEF ("_TC1", "Thermal Constant 1", "Returns TC1 for the passive cooling formula"),
AH_PREDEF ("_TC2", "Thermal Constant 2", "Returns TC2 for the passive cooling formula"),
AH_PREDEF ("_TDL", "T-State Depth Limit", "Returns the _TSS entry number of the lowest power throttling state"),
AH_PREDEF ("_TIP", "Expired Timer Wake Policy", "Returns timer policies of the wake alarm device"),
AH_PREDEF ("_TIV", "Timer Values", "Returns remaining time of the wake alarm device"),
AH_PREDEF ("_TMP", "Temperature", "Returns a thermal zone's current temperature"),
AH_PREDEF ("_TPC", "Throttling Present Capabilities", "Returns the current number of supported throttling states"),
AH_PREDEF ("_TPT", "Trip Point Temperature", "Inform AML that a device's embedded temperature sensor has crossed a temperature trip point"),
AH_PREDEF ("_TRA", "Translation", "Address translation offset, Resource Descriptor field"),
AH_PREDEF ("_TRS", "Translation Sparse", "Sparse/dense flag, Resource Descriptor field"),
AH_PREDEF ("_TRT", "Thermal Relationship Table", "Returns thermal relationships between platform devices"),
AH_PREDEF ("_TSD", "Throttling State Dependencies", "Returns a list of T-state dependencies"),
AH_PREDEF ("_TSF", "Type-Specific Flags", "Resource Descriptor field"),
AH_PREDEF ("_TSP", "Thermal Sampling Period", "Returns the thermal sampling period for passive cooling"),
AH_PREDEF ("_TSS", "Throttling Supported States", "Returns supported throttling state information"),
AH_PREDEF ("_TST", "Temperature Sensor Threshold", "Returns the minimum separation for a device's temperature trip points"),
AH_PREDEF ("_TTP", "Translation Type", "Translation/static flag, Resource Descriptor field"),
AH_PREDEF ("_TTS", "Transition To State", "Inform AML of an S-state transition"),
AH_PREDEF ("_TXL", "Transmit Buffer Size", "Serial Channel buffer, Resource Descriptor field"),
AH_PREDEF ("_TYP", "Type", "DMA channel type (speed), Resource Descriptor field"),
AH_PREDEF ("_TZ_", "Thermal Zone", "Predefined scope: ACPI 1.0"),
AH_PREDEF ("_TZD", "Thermal Zone Devices", "Returns a list of device names associated with a Thermal Zone"),
AH_PREDEF ("_TZM", "Thermal Zone Member", "Returns a reference to the thermal zone of which a device is a member"),
AH_PREDEF ("_TZP", "Thermal Zone Polling", "Returns a Thermal zone's polling frequency"),
AH_PREDEF ("_UID", "Unique ID", "Return a device's unique persistent ID"),
AH_PREDEF ("_UPC", "USB Port Capabilities", "Returns a list of USB port capabilities"),
AH_PREDEF ("_UPD", "User Presence Detect", "Returns user detection information"),
AH_PREDEF ("_UPP", "User Presence Polling", "Returns the recommended user presence polling interval"),
AH_PREDEF ("_VEN", "Vendor Data", "Resource Descriptor field"),
AH_PREDEF ("_VPO", "Video Post Options", "Returns the implemented video post options"),
AH_PREDEF ("_WAK", "Wake", "Inform AML that the system has just awakened"),
AH_PREDEF ("_Wxx", "Wake Event", "Method executed as a result of a wake event"),
AH_PREDEF (NULL, NULL, NULL)
};
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -293,8 +293,10 @@ AcpiDmNormalizeParentPrefix (
*/
ACPI_STRCAT (Fullpath, ParentPath);
/* Add dot separator (don't need dot if parent fullpath is a single "\") */
/*
* Add dot separator
* (don't need dot if parent fullpath is a single backslash)
*/
if (ParentPath[1])
{
ACPI_STRCAT (Fullpath, ".");
@@ -526,12 +528,12 @@ AcpiDmAddToExternalList (
NewExternal->InternalPath = Path;
/* Link the new descriptor into the global list, ordered by string length */
/* Link the new descriptor into the global list, alphabetically ordered */
NextExternal = AcpiGbl_ExternalList;
while (NextExternal)
{
if (NewExternal->Length <= NextExternal->Length)
if (AcpiUtStricmp (NewExternal->Path, NextExternal->Path) < 0)
{
if (PrevExternal)
{
@@ -580,7 +582,7 @@ AcpiDmAddExternalsToNamespace (
{
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node;
ACPI_OPERAND_OBJECT *MethodDesc;
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_EXTERNAL_LIST *External = AcpiGbl_ExternalList;
@@ -599,13 +601,29 @@ AcpiDmAddExternalsToNamespace (
"while adding external to namespace [%s]",
External->Path));
}
else if (External->Type == ACPI_TYPE_METHOD)
else switch (External->Type)
{
case ACPI_TYPE_METHOD:
/* For methods, we need to save the argument count */
MethodDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD);
MethodDesc->Method.ParamCount = (UINT8) External->Value;
Node->Object = MethodDesc;
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD);
ObjDesc->Method.ParamCount = (UINT8) External->Value;
Node->Object = ObjDesc;
break;
case ACPI_TYPE_REGION:
/* Regions require a region sub-object */
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION);
ObjDesc->Region.Node = Node;
Node->Object = ObjDesc;
break;
default:
break;
}
External = External->Next;
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -135,7 +135,7 @@ AcpiDmUpdateResourceName (
static char *
AcpiDmSearchTagList (
UINT32 BitIndex,
ACPI_RESOURCE_TAG *TagList);
const ACPI_RESOURCE_TAG *TagList);
static char *
AcpiDmGetResourceTag (
@@ -145,6 +145,7 @@ AcpiDmGetResourceTag (
static char *
AcpiGetTagPathname (
ACPI_PARSE_OBJECT *Op,
ACPI_NAMESPACE_NODE *BufferNode,
ACPI_NAMESPACE_NODE *ResourceNode,
UINT32 BitIndex);
@@ -180,7 +181,7 @@ AcpiDmAddResourcesToNamespace (
*
******************************************************************************/
static ACPI_RESOURCE_TAG AcpiDmIrqTags[] =
static const ACPI_RESOURCE_TAG AcpiDmIrqTags[] =
{
{( 1 * 8), ACPI_RESTAG_INTERRUPT},
{( 3 * 8) + 0, ACPI_RESTAG_INTERRUPTTYPE},
@@ -189,7 +190,7 @@ static ACPI_RESOURCE_TAG AcpiDmIrqTags[] =
{0, NULL}
};
static ACPI_RESOURCE_TAG AcpiDmDmaTags[] =
static const ACPI_RESOURCE_TAG AcpiDmDmaTags[] =
{
{( 1 * 8), ACPI_RESTAG_DMA},
{( 2 * 8) + 0, ACPI_RESTAG_XFERTYPE},
@@ -198,7 +199,7 @@ static ACPI_RESOURCE_TAG AcpiDmDmaTags[] =
{0, NULL}
};
static ACPI_RESOURCE_TAG AcpiDmIoTags[] =
static const ACPI_RESOURCE_TAG AcpiDmIoTags[] =
{
{( 1 * 8) + 0, ACPI_RESTAG_DECODE},
{( 2 * 8), ACPI_RESTAG_MINADDR},
@@ -208,14 +209,22 @@ static ACPI_RESOURCE_TAG AcpiDmIoTags[] =
{0, NULL}
};
static ACPI_RESOURCE_TAG AcpiDmFixedIoTags[] =
static const ACPI_RESOURCE_TAG AcpiDmFixedIoTags[] =
{
{( 1 * 8), ACPI_RESTAG_BASEADDRESS},
{( 3 * 8), ACPI_RESTAG_LENGTH},
{0, NULL}
};
static ACPI_RESOURCE_TAG AcpiDmMemory24Tags[] =
static const ACPI_RESOURCE_TAG AcpiDmFixedDmaTags[] =
{
{( 1 * 8), ACPI_RESTAG_DMA},
{( 3 * 8), ACPI_RESTAG_DMATYPE},
{( 5 * 8), ACPI_RESTAG_XFERTYPE},
{0, NULL}
};
static const ACPI_RESOURCE_TAG AcpiDmMemory24Tags[] =
{
{( 3 * 8) + 0, ACPI_RESTAG_READWRITETYPE},
{( 4 * 8), ACPI_RESTAG_MINADDR},
@@ -225,7 +234,7 @@ static ACPI_RESOURCE_TAG AcpiDmMemory24Tags[] =
{0, NULL}
};
static ACPI_RESOURCE_TAG AcpiDmRegisterTags[] =
static const ACPI_RESOURCE_TAG AcpiDmRegisterTags[] =
{
{( 3 * 8), ACPI_RESTAG_ADDRESSSPACE},
{( 4 * 8), ACPI_RESTAG_REGISTERBITWIDTH},
@@ -235,7 +244,7 @@ static ACPI_RESOURCE_TAG AcpiDmRegisterTags[] =
{0, NULL}
};
static ACPI_RESOURCE_TAG AcpiDmMemory32Tags[] =
static const ACPI_RESOURCE_TAG AcpiDmMemory32Tags[] =
{
{( 3 * 8) + 0, ACPI_RESTAG_READWRITETYPE},
{( 4 * 8), ACPI_RESTAG_MINADDR},
@@ -245,7 +254,7 @@ static ACPI_RESOURCE_TAG AcpiDmMemory32Tags[] =
{0, NULL}
};
static ACPI_RESOURCE_TAG AcpiDmFixedMemory32Tags[] =
static const ACPI_RESOURCE_TAG AcpiDmFixedMemory32Tags[] =
{
{( 3 * 8) + 0, ACPI_RESTAG_READWRITETYPE},
{( 4 * 8), ACPI_RESTAG_BASEADDRESS},
@@ -253,7 +262,7 @@ static ACPI_RESOURCE_TAG AcpiDmFixedMemory32Tags[] =
{0, NULL}
};
static ACPI_RESOURCE_TAG AcpiDmInterruptTags[] =
static const ACPI_RESOURCE_TAG AcpiDmInterruptTags[] =
{
{( 3 * 8) + 1, ACPI_RESTAG_INTERRUPTTYPE},
{( 3 * 8) + 2, ACPI_RESTAG_INTERRUPTLEVEL},
@@ -262,7 +271,7 @@ static ACPI_RESOURCE_TAG AcpiDmInterruptTags[] =
{0, NULL}
};
static ACPI_RESOURCE_TAG AcpiDmAddress16Tags[] =
static const ACPI_RESOURCE_TAG AcpiDmAddress16Tags[] =
{
{( 4 * 8) + 1, ACPI_RESTAG_DECODE},
{( 4 * 8) + 2, ACPI_RESTAG_MINTYPE},
@@ -275,7 +284,7 @@ static ACPI_RESOURCE_TAG AcpiDmAddress16Tags[] =
{0, NULL}
};
static ACPI_RESOURCE_TAG AcpiDmAddress32Tags[] =
static const ACPI_RESOURCE_TAG AcpiDmAddress32Tags[] =
{
{( 4 * 8) + 1, ACPI_RESTAG_DECODE},
{( 4 * 8) + 2, ACPI_RESTAG_MINTYPE},
@@ -288,7 +297,7 @@ static ACPI_RESOURCE_TAG AcpiDmAddress32Tags[] =
{0, NULL}
};
static ACPI_RESOURCE_TAG AcpiDmAddress64Tags[] =
static const ACPI_RESOURCE_TAG AcpiDmAddress64Tags[] =
{
{( 4 * 8) + 1, ACPI_RESTAG_DECODE},
{( 4 * 8) + 2, ACPI_RESTAG_MINTYPE},
@@ -301,7 +310,7 @@ static ACPI_RESOURCE_TAG AcpiDmAddress64Tags[] =
{0, NULL}
};
static ACPI_RESOURCE_TAG AcpiDmExtendedAddressTags[] =
static const ACPI_RESOURCE_TAG AcpiDmExtendedAddressTags[] =
{
{( 4 * 8) + 1, ACPI_RESTAG_DECODE},
{( 4 * 8) + 2, ACPI_RESTAG_MINTYPE},
@@ -315,9 +324,71 @@ static ACPI_RESOURCE_TAG AcpiDmExtendedAddressTags[] =
{0, NULL}
};
/* Special-case tables for the type-specific flags */
/* Subtype tables for GPIO descriptors */
static ACPI_RESOURCE_TAG AcpiDmMemoryFlagTags[] =
static const ACPI_RESOURCE_TAG AcpiDmGpioIntTags[] =
{
{( 7 * 8) + 0, ACPI_RESTAG_MODE},
{( 7 * 8) + 1, ACPI_RESTAG_POLARITY},
{( 7 * 8) + 3, ACPI_RESTAG_INTERRUPTSHARE},
{( 9 * 8), ACPI_RESTAG_PINCONFIG},
{(10 * 8), ACPI_RESTAG_DRIVESTRENGTH},
{(12 * 8), ACPI_RESTAG_DEBOUNCETIME},
{0, NULL}
};
static const ACPI_RESOURCE_TAG AcpiDmGpioIoTags[] =
{
{( 7 * 8) + 0, ACPI_RESTAG_IORESTRICTION},
{( 7 * 8) + 3, ACPI_RESTAG_INTERRUPTSHARE},
{( 9 * 8), ACPI_RESTAG_PINCONFIG},
{(10 * 8), ACPI_RESTAG_DRIVESTRENGTH},
{(12 * 8), ACPI_RESTAG_DEBOUNCETIME},
{0, NULL}
};
/* Subtype tables for SerialBus descriptors */
static const ACPI_RESOURCE_TAG AcpiDmI2cSerialBusTags[] =
{
{( 6 * 8) + 0, ACPI_RESTAG_SLAVEMODE},
{( 7 * 8) + 0, ACPI_RESTAG_MODE},
{(12 * 8), ACPI_RESTAG_SPEED},
{(16 * 8), ACPI_RESTAG_ADDRESS},
{0, NULL}
};
static const ACPI_RESOURCE_TAG AcpiDmSpiSerialBusTags[] =
{
{( 6 * 8) + 0, ACPI_RESTAG_SLAVEMODE},
{( 7 * 8) + 0, ACPI_RESTAG_MODE},
{( 7 * 8) + 1, ACPI_RESTAG_DEVICEPOLARITY},
{(12 * 8), ACPI_RESTAG_SPEED},
{(16 * 8), ACPI_RESTAG_LENGTH},
{(17 * 8), ACPI_RESTAG_PHASE},
{(18 * 8), ACPI_RESTAG_POLARITY},
{(19 * 8), ACPI_RESTAG_ADDRESS},
{0, NULL}
};
static const ACPI_RESOURCE_TAG AcpiDmUartSerialBusTags[] =
{
{( 6 * 8) + 0, ACPI_RESTAG_SLAVEMODE}, /* Note: not part of original macro */
{( 7 * 8) + 0, ACPI_RESTAG_FLOWCONTROL},
{( 7 * 8) + 2, ACPI_RESTAG_STOPBITS},
{( 7 * 8) + 4, ACPI_RESTAG_LENGTH},
{( 7 * 8) + 7, ACPI_RESTAG_ENDIANNESS},
{(12 * 8), ACPI_RESTAG_SPEED},
{(16 * 8), ACPI_RESTAG_LENGTH_RX},
{(18 * 8), ACPI_RESTAG_LENGTH_TX},
{(20 * 8), ACPI_RESTAG_PARITY},
{(21 * 8), ACPI_RESTAG_LINE},
{0, NULL}
};
/* Subtype tables for Address descriptor type-specific flags */
static const ACPI_RESOURCE_TAG AcpiDmMemoryFlagTags[] =
{
{( 5 * 8) + 0, ACPI_RESTAG_READWRITETYPE},
{( 5 * 8) + 1, ACPI_RESTAG_MEMTYPE},
@@ -326,7 +397,7 @@ static ACPI_RESOURCE_TAG AcpiDmMemoryFlagTags[] =
{0, NULL}
};
static ACPI_RESOURCE_TAG AcpiDmIoFlagTags[] =
static const ACPI_RESOURCE_TAG AcpiDmIoFlagTags[] =
{
{( 5 * 8) + 0, ACPI_RESTAG_RANGETYPE},
{( 5 * 8) + 4, ACPI_RESTAG_TYPE},
@@ -335,9 +406,15 @@ static ACPI_RESOURCE_TAG AcpiDmIoFlagTags[] =
};
/* Dispatch table used to obtain the correct tag table for a descriptor */
static ACPI_RESOURCE_TAG *AcpiGbl_ResourceTags [] =
/*
* Dispatch table used to obtain the correct tag table for a descriptor.
*
* A NULL in this table means one of three things:
* 1) The descriptor ID is reserved and invalid
* 2) The descriptor has no tags associated with it
* 3) The descriptor has subtypes and a separate table will be used.
*/
static const ACPI_RESOURCE_TAG *AcpiGbl_ResourceTags[] =
{
/* Small descriptors */
@@ -351,7 +428,7 @@ static ACPI_RESOURCE_TAG *AcpiGbl_ResourceTags [] =
NULL, /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */
AcpiDmIoTags, /* 0x08, ACPI_RESOURCE_NAME_IO_PORT */
AcpiDmFixedIoTags, /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO_PORT */
NULL, /* 0x0A, Reserved */
AcpiDmFixedDmaTags, /* 0x0A, ACPI_RESOURCE_NAME_FIXED_DMA */
NULL, /* 0x0B, Reserved */
NULL, /* 0x0C, Reserved */
NULL, /* 0x0D, Reserved */
@@ -371,9 +448,29 @@ static ACPI_RESOURCE_TAG *AcpiGbl_ResourceTags [] =
AcpiDmAddress16Tags, /* 0x08, ACPI_RESOURCE_NAME_WORD_ADDRESS_SPACE */
AcpiDmInterruptTags, /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_XRUPT */
AcpiDmAddress64Tags, /* 0x0A, ACPI_RESOURCE_NAME_QWORD_ADDRESS_SPACE */
AcpiDmExtendedAddressTags /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS_SPACE */
AcpiDmExtendedAddressTags, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS_SPACE */
NULL, /* 0x0C, ACPI_RESOURCE_NAME_GPIO - Use Subtype table below */
NULL, /* 0x0D, Reserved */
NULL /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use Subtype table below */
};
/* GPIO Subtypes */
static const ACPI_RESOURCE_TAG *AcpiGbl_GpioResourceTags[] =
{
AcpiDmGpioIntTags, /* 0x00 Interrupt Connection */
AcpiDmGpioIoTags /* 0x01 I/O Connection */
};
/* Serial Bus Subtypes */
static const ACPI_RESOURCE_TAG *AcpiGbl_SerialResourceTags[] =
{
NULL, /* 0x00 Reserved */
AcpiDmI2cSerialBusTags, /* 0x01 I2C SerialBus */
AcpiDmSpiSerialBusTags, /* 0x02 SPI SerialBus */
AcpiDmUartSerialBusTags /* 0x03 UART SerialBus */
};
/*
* Globals used to generate unique resource descriptor names. We use names that
@@ -419,7 +516,6 @@ AcpiDmCheckResourceReference (
ACPI_NAMESPACE_NODE *BufferNode;
ACPI_NAMESPACE_NODE *ResourceNode;
const ACPI_OPCODE_INFO *OpInfo;
char *Pathname;
UINT32 BitIndex;
@@ -495,14 +591,7 @@ AcpiDmCheckResourceReference (
/* Translate the Index to a resource tag pathname */
Pathname = AcpiGetTagPathname (BufferNode, ResourceNode, BitIndex);
if (Pathname)
{
/* Complete the conversion of the Index to a symbol */
IndexOp->Common.AmlOpcode = AML_INT_NAMEPATH_OP;
IndexOp->Common.Value.String = Pathname;
}
AcpiGetTagPathname (IndexOp, BufferNode, ResourceNode, BitIndex);
}
@@ -573,6 +662,7 @@ AcpiDmGetResourceNode (
static char *
AcpiGetTagPathname (
ACPI_PARSE_OBJECT *IndexOp,
ACPI_NAMESPACE_NODE *BufferNode,
ACPI_NAMESPACE_NODE *ResourceNode,
UINT32 BitIndex)
@@ -665,6 +755,15 @@ AcpiGetTagPathname (
AcpiNsInternalizeName (Pathname, &InternalPath);
ACPI_FREE (Pathname);
/* Update the Op with the symbol */
AcpiPsInitOp (IndexOp, AML_INT_NAMEPATH_OP);
IndexOp->Common.Value.String = InternalPath;
/* We will need the tag later. Cheat by putting it in the Node field */
IndexOp->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Tag);
return (InternalPath);
}
@@ -738,6 +837,9 @@ AcpiDmUpdateResourceName (
*
* DESCRIPTION: Convert a BitIndex into a symbolic resource tag.
*
* Note: ResourceIndex should be previously validated and guaranteed to ve
* valid.
*
******************************************************************************/
static char *
@@ -746,23 +848,16 @@ AcpiDmGetResourceTag (
AML_RESOURCE *Resource,
UINT8 ResourceIndex)
{
ACPI_RESOURCE_TAG *TagList;
const ACPI_RESOURCE_TAG *TagList;
char *Tag = NULL;
/* Get the tag list for this resource descriptor type */
TagList = AcpiGbl_ResourceTags[ResourceIndex];
if (!TagList)
{
/* There are no tags for this resource type */
return (NULL);
}
/*
* Handle the type-specific flags field for the address descriptors.
* Kindof brute force, but just blindly search for an index match.
* Handle descriptors that have multiple subtypes
*/
switch (Resource->DescriptorType)
{
@@ -771,6 +866,10 @@ AcpiDmGetResourceTag (
case ACPI_RESOURCE_NAME_ADDRESS64:
case ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64:
/*
* Subtype differentiation is the flags.
* Kindof brute force, but just blindly search for an index match
*/
if (Resource->Address.ResourceType == ACPI_ADDRESS_TYPE_MEMORY_RANGE)
{
Tag = AcpiDmSearchTagList (BitIndex, AcpiDmMemoryFlagTags);
@@ -788,13 +887,42 @@ AcpiDmGetResourceTag (
}
break;
case ACPI_RESOURCE_NAME_GPIO:
/* GPIO connection has 2 subtypes: Interrupt and I/O */
if (Resource->Gpio.ConnectionType > AML_RESOURCE_MAX_GPIOTYPE)
{
return (NULL);
}
TagList = AcpiGbl_GpioResourceTags[Resource->Gpio.ConnectionType];
break;
case ACPI_RESOURCE_NAME_SERIAL_BUS:
/* SerialBus has 3 subtypes: I2C, SPI, and UART */
if ((Resource->CommonSerialBus.Type == 0) ||
(Resource->CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE))
{
return (NULL);
}
TagList = AcpiGbl_SerialResourceTags[Resource->CommonSerialBus.Type];
break;
default:
break;
}
/* Search the tag list for this descriptor type */
/* Search for a match against the BitIndex */
if (TagList)
{
Tag = AcpiDmSearchTagList (BitIndex, TagList);
}
Tag = AcpiDmSearchTagList (BitIndex, TagList);
return (Tag);
}
@@ -816,7 +944,7 @@ AcpiDmGetResourceTag (
static char *
AcpiDmSearchTagList (
UINT32 BitIndex,
ACPI_RESOURCE_TAG *TagList)
const ACPI_RESOURCE_TAG *TagList)
{
/*
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -268,6 +268,16 @@ static const char *AcpiDmMadtSubnames[] =
"Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */
"Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */
"Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */
"Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */
"Generic Interrupt Distributor",/* ACPI_MADT_GENERIC_DISTRIBUTOR */
"Unknown SubTable Type" /* Reserved */
};
static const char *AcpiDmPmttSubnames[] =
{
"Socket", /* ACPI_PMTT_TYPE_SOCKET */
"Memory Controller", /* ACPI_PMTT_TYPE_CONTROLLER */
"Physical Component (DIMM)", /* ACPI_PMTT_TYPE_DIMM */
"Unknown SubTable Type" /* Reserved */
};
@@ -294,7 +304,7 @@ static const char *AcpiDmIvrsSubnames[] =
};
#define ACPI_FADT_PM_RESERVED 8
#define ACPI_FADT_PM_RESERVED 9
static const char *AcpiDmFadtProfiles[] =
{
@@ -306,6 +316,7 @@ static const char *AcpiDmFadtProfiles[] =
"SOHO Server",
"Appliance PC",
"Performance Server",
"Tablet",
"Unknown Profile Type"
};
@@ -340,6 +351,7 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, TemplateAsf, "Alert Standard Format table"},
{ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot, "Simple Boot Flag Table"},
{ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert, "Boot Error Record Table"},
{ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt, "Boot Graphics Resource Table"},
{ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep, "Corrected Platform Error Polling table"},
{ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp, "Debug Port table"},
{ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar, "DMA Remapping table"},
@@ -347,14 +359,20 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, TemplateEinj, "Error Injection table"},
{ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst, "Error Record Serialization Table"},
{ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt, "Fixed ACPI Description Table"},
{ACPI_SIG_FPDT, NULL, AcpiDmDumpFpdt, DtCompileFpdt, TemplateFpdt, "Firmware Performance Data Table"},
{ACPI_SIG_GTDT, AcpiDmTableInfoGtdt, NULL, NULL, TemplateGtdt, "Generic Timer Description Table"},
{ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest, "Hardware Error Source Table"},
{ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet, "High Precision Event Timer table"},
{ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs, "I/O Virtualization Reporting Structure"},
{ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt, "Multiple APIC Description Table"},
{ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg, "Memory Mapped Configuration table"},
{ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi, "Management Controller Host Interface table"},
{ACPI_SIG_MPST, AcpiDmTableInfoMpst, AcpiDmDumpMpst, DtCompileMpst, TemplateMpst, "Memory Power State Table"},
{ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct, "Maximum System Characteristics Table"},
{ACPI_SIG_PCCT, NULL, AcpiDmDumpPcct, NULL, NULL, "Platform Communications Channel Table"},
{ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt, "Platform Memory Topology Table"},
{ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt, "Root System Description Table"},
{ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt, "S3 Performance Table"},
{ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst, "Smart Battery Specification Table"},
{ACPI_SIG_SLIC, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateSlic, "Software Licensing Description Table"},
{ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit, "System Locality Information Table"},
@@ -472,7 +490,7 @@ AcpiDmDumpDataTable (
/*
* Handle tables that don't use the common ACPI table header structure.
* Currently, these are the FACS and RSDP.
* Currently, these are the FACS, RSDP, and S3PT.
*/
if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS))
{
@@ -483,6 +501,10 @@ AcpiDmDumpDataTable (
{
Length = AcpiDmDumpRsdp (Table);
}
else if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_S3PT))
{
Length = AcpiDmDumpS3pt (Table);
}
else
{
/*
@@ -718,6 +740,7 @@ AcpiDmDumpTable (
case ACPI_DMT_ACCWIDTH:
case ACPI_DMT_IVRS:
case ACPI_DMT_MADT:
case ACPI_DMT_PMTT:
case ACPI_DMT_SRAT:
case ACPI_DMT_ASF:
case ACPI_DMT_HESTNTYP:
@@ -742,6 +765,10 @@ AcpiDmDumpTable (
case ACPI_DMT_SLIC:
ByteLength = 4;
break;
case ACPI_DMT_UINT40:
ByteLength = 5;
break;
case ACPI_DMT_UINT48:
case ACPI_DMT_NAME6:
ByteLength = 6;
break;
@@ -790,6 +817,12 @@ AcpiDmDumpTable (
return (AE_BAD_DATA);
}
if (Info->Opcode == ACPI_DMT_EXTRA_TEXT)
{
AcpiOsPrintf ("%s", Info->Name);
continue;
}
/* Start a new line and decode the opcode */
AcpiDmLineHeader (CurrentOffset, ByteLength, Info->Name);
@@ -817,17 +850,29 @@ AcpiDmDumpTable (
AcpiOsPrintf ("%1.1X\n", *Target & 0x03);
break;
case ACPI_DMT_FLAGS1:
AcpiOsPrintf ("%1.1X\n", (*Target >> 1) & 0x03);
break;
case ACPI_DMT_FLAGS2:
AcpiOsPrintf ("%1.1X\n", (*Target >> 2) & 0x03);
break;
case ACPI_DMT_FLAGS4:
AcpiOsPrintf ("%1.1X\n", (*Target >> 4) & 0x03);
break;
/* Integer Data Types */
case ACPI_DMT_UINT8:
case ACPI_DMT_UINT16:
case ACPI_DMT_UINT24:
case ACPI_DMT_UINT32:
case ACPI_DMT_UINT40:
case ACPI_DMT_UINT48:
case ACPI_DMT_UINT56:
case ACPI_DMT_UINT64:
/*
@@ -1093,6 +1138,19 @@ AcpiDmDumpTable (
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmMadtSubnames[Temp8]);
break;
case ACPI_DMT_PMTT:
/* PMTT subtable types */
Temp8 = *Target;
if (Temp8 > ACPI_PMTT_TYPE_RESERVED)
{
Temp8 = ACPI_PMTT_TYPE_RESERVED;
}
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmPmttSubnames[Temp8]);
break;
case ACPI_DMT_SLIC:
/* SLIC subtable types */
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -302,11 +302,18 @@ AcpiDmDumpFadt (
AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt2);
}
/* Check for FADT revision 3 fields and up (ACPI 2.0+ extended data) */
/* Check for FADT revision 3/4 fields and up (ACPI 2.0+ extended data) */
else if (Table->Length > ACPI_FADT_V2_SIZE)
{
AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt3);
/* Check for FADT revision 5 fields and up (ACPI 5.0+) */
if (Table->Length > ACPI_FADT_V3_SIZE)
{
AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt5);
}
}
/* Validate various fields in the FADT, including length */
@@ -362,6 +369,10 @@ AcpiDmValidateFadtLength (
ExpectedLength = ACPI_FADT_V3_SIZE;
break;
case 5:
ExpectedLength = ACPI_FADT_V5_SIZE;
break;
default:
return;
}
@@ -821,6 +832,84 @@ AcpiDmDumpErst (
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpFpdt
*
* PARAMETERS: Table - A FPDT table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a FPDT. This table type consists
* of an open-ended number of subtables.
*
******************************************************************************/
void
AcpiDmDumpFpdt (
ACPI_TABLE_HEADER *Table)
{
ACPI_STATUS Status;
ACPI_FPDT_HEADER *SubTable;
UINT32 Length = Table->Length;
UINT32 Offset = sizeof (ACPI_TABLE_FPDT);
ACPI_DMTABLE_INFO *InfoTable;
/* There is no main table (other than the standard ACPI header) */
/* Sub-tables */
SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset);
while (Offset < Table->Length)
{
/* Common sub-table header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
SubTable->Length, AcpiDmTableInfoFpdtHdr);
if (ACPI_FAILURE (Status))
{
return;
}
switch (SubTable->Type)
{
case ACPI_FPDT_TYPE_BOOT:
InfoTable = AcpiDmTableInfoFpdt0;
break;
case ACPI_FPDT_TYPE_S3PERF:
InfoTable = AcpiDmTableInfoFpdt1;
break;
default:
AcpiOsPrintf ("\n**** Unknown FPDT sub-table type 0x%X\n\n", SubTable->Type);
/* Attempt to continue */
if (!SubTable->Length)
{
AcpiOsPrintf ("Invalid zero length subtable\n");
return;
}
goto NextSubTable;
}
Status = AcpiDmDumpTable (Length, Offset, SubTable,
SubTable->Length, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
}
NextSubTable:
/* Point to next sub-table */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable, SubTable->Length);
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpHest
@@ -1206,6 +1295,12 @@ AcpiDmDumpMadt (
case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI:
InfoTable = AcpiDmTableInfoMadt10;
break;
case ACPI_MADT_TYPE_GENERIC_INTERRUPT:
InfoTable = AcpiDmTableInfoMadt11;
break;
case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR:
InfoTable = AcpiDmTableInfoMadt12;
break;
default:
AcpiOsPrintf ("\n**** Unknown MADT sub-table type 0x%X\n\n", SubTable->Type);
@@ -1293,6 +1388,150 @@ AcpiDmDumpMcfg (
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpMpst
*
* PARAMETERS: Table - A MPST Table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a MPST table
*
******************************************************************************/
void
AcpiDmDumpMpst (
ACPI_TABLE_HEADER *Table)
{
ACPI_STATUS Status;
UINT32 Offset = sizeof (ACPI_TABLE_MPST);
ACPI_MPST_POWER_NODE *SubTable0;
ACPI_MPST_POWER_STATE *SubTable0A;
ACPI_MPST_COMPONENT *SubTable0B;
ACPI_MPST_DATA_HDR *SubTable1;
ACPI_MPST_POWER_DATA *SubTable2;
UINT16 SubtableCount;
UINT8 PowerStateCount;
UINT8 ComponentCount;
/* Main table */
Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMpst);
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtable: Memory Power Node(s) */
SubtableCount = (ACPI_CAST_PTR (ACPI_TABLE_MPST, Table))->PowerNodeCount;
SubTable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, Table, Offset);
while ((Offset < Table->Length) && SubtableCount)
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0,
sizeof (ACPI_MPST_POWER_NODE), AcpiDmTableInfoMpst0);
if (ACPI_FAILURE (Status))
{
return;
}
/* Extract the sub-subtable counts */
PowerStateCount = SubTable0->NumPowerStates;
ComponentCount = SubTable0->NumPhysicalComponents;
Offset += sizeof (ACPI_MPST_POWER_NODE);
/* Sub-subtables - Memory Power State Structure(s) */
SubTable0A = ACPI_ADD_PTR (ACPI_MPST_POWER_STATE, SubTable0,
sizeof (ACPI_MPST_POWER_NODE));
while (PowerStateCount)
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0A,
sizeof (ACPI_MPST_POWER_STATE), AcpiDmTableInfoMpst0A);
if (ACPI_FAILURE (Status))
{
return;
}
SubTable0A++;
PowerStateCount--;
Offset += sizeof (ACPI_MPST_POWER_STATE);
}
/* Sub-subtables - Physical Component ID Structure(s) */
SubTable0B = ACPI_CAST_PTR (ACPI_MPST_COMPONENT, SubTable0A);
if (ComponentCount)
{
AcpiOsPrintf ("\n");
}
while (ComponentCount)
{
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0B,
sizeof (ACPI_MPST_COMPONENT), AcpiDmTableInfoMpst0B);
if (ACPI_FAILURE (Status))
{
return;
}
SubTable0B++;
ComponentCount--;
Offset += sizeof (ACPI_MPST_COMPONENT);
}
/* Point to next Memory Power Node subtable */
SubtableCount--;
SubTable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, SubTable0,
sizeof (ACPI_MPST_POWER_NODE) +
(sizeof (ACPI_MPST_POWER_STATE) * SubTable0->NumPowerStates) +
(sizeof (ACPI_MPST_COMPONENT) * SubTable0->NumPhysicalComponents));
}
/* Subtable: Count of Memory Power State Characteristic structures */
AcpiOsPrintf ("\n");
SubTable1 = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, SubTable0);
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable1,
sizeof (ACPI_MPST_DATA_HDR), AcpiDmTableInfoMpst1);
if (ACPI_FAILURE (Status))
{
return;
}
SubtableCount = SubTable1->CharacteristicsCount;
Offset += sizeof (ACPI_MPST_DATA_HDR);
/* Subtable: Memory Power State Characteristics structure(s) */
SubTable2 = ACPI_ADD_PTR (ACPI_MPST_POWER_DATA, SubTable1, sizeof (ACPI_MPST_DATA_HDR));
while ((Offset < Table->Length) && SubtableCount)
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable2,
sizeof (ACPI_MPST_POWER_DATA), AcpiDmTableInfoMpst2);
if (ACPI_FAILURE (Status))
{
return;
}
SubTable2++;
SubtableCount--;
Offset += sizeof (ACPI_MPST_POWER_DATA);
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpMsct
@@ -1345,6 +1584,349 @@ AcpiDmDumpMsct (
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpPcct
*
* PARAMETERS: Table - A PCCT table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a PCCT. This table type consists
* of an open-ended number of subtables.
*
******************************************************************************/
void
AcpiDmDumpPcct (
ACPI_TABLE_HEADER *Table)
{
ACPI_STATUS Status;
ACPI_PCCT_SUBSPACE *SubTable;
UINT32 Length = Table->Length;
UINT32 Offset = sizeof (ACPI_TABLE_PCCT);
/* Main table */
Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPcct);
if (ACPI_FAILURE (Status))
{
return;
}
/* Sub-tables */
SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Table, Offset);
while (Offset < Table->Length)
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
SubTable->Header.Length, AcpiDmTableInfoPcct0);
if (ACPI_FAILURE (Status))
{
return;
}
/* Point to next sub-table */
Offset += SubTable->Header.Length;
SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, SubTable,
SubTable->Header.Length);
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpPmtt
*
* PARAMETERS: Table - A PMTT table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a PMTT. This table type consists
* of an open-ended number of subtables.
*
******************************************************************************/
void
AcpiDmDumpPmtt (
ACPI_TABLE_HEADER *Table)
{
ACPI_STATUS Status;
ACPI_PMTT_HEADER *SubTable;
ACPI_PMTT_HEADER *MemSubTable;
ACPI_PMTT_HEADER *DimmSubTable;
ACPI_PMTT_DOMAIN *DomainArray;
UINT32 Length = Table->Length;
UINT32 Offset = sizeof (ACPI_TABLE_PMTT);
UINT32 MemOffset;
UINT32 DimmOffset;
UINT32 DomainOffset;
UINT32 DomainCount;
/* Main table */
Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPmtt);
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Table, Offset);
while (Offset < Table->Length)
{
/* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
SubTable->Length, AcpiDmTableInfoPmttHdr);
if (ACPI_FAILURE (Status))
{
return;
}
/* Only Socket subtables are expected at this level */
if (SubTable->Type != ACPI_PMTT_TYPE_SOCKET)
{
AcpiOsPrintf (
"\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n",
SubTable->Type);
return;
}
/* Dump the fixed-length portion of the subtable */
Status = AcpiDmDumpTable (Length, Offset, SubTable,
SubTable->Length, AcpiDmTableInfoPmtt0);
if (ACPI_FAILURE (Status))
{
return;
}
/* Walk the memory controller subtables */
MemOffset = sizeof (ACPI_PMTT_SOCKET);
MemSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, SubTable,
sizeof (ACPI_PMTT_SOCKET));
while (((Offset + MemOffset) < Table->Length) &&
(MemOffset < SubTable->Length))
{
/* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length,
Offset + MemOffset, MemSubTable,
MemSubTable->Length, AcpiDmTableInfoPmttHdr);
if (ACPI_FAILURE (Status))
{
return;
}
/* Only memory controller subtables are expected at this level */
if (MemSubTable->Type != ACPI_PMTT_TYPE_CONTROLLER)
{
AcpiOsPrintf (
"\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n",
MemSubTable->Type);
return;
}
/* Dump the fixed-length portion of the controller subtable */
Status = AcpiDmDumpTable (Length,
Offset + MemOffset, MemSubTable,
MemSubTable->Length, AcpiDmTableInfoPmtt1);
if (ACPI_FAILURE (Status))
{
return;
}
/* Walk the variable count of proximity domains */
DomainCount = ((ACPI_PMTT_CONTROLLER *) MemSubTable)->DomainCount;
DomainOffset = sizeof (ACPI_PMTT_CONTROLLER);
DomainArray = ACPI_ADD_PTR (ACPI_PMTT_DOMAIN, MemSubTable,
sizeof (ACPI_PMTT_CONTROLLER));
while (((Offset + MemOffset + DomainOffset) < Table->Length) &&
((MemOffset + DomainOffset) < SubTable->Length) &&
DomainCount)
{
Status = AcpiDmDumpTable (Length,
Offset + MemOffset + DomainOffset, DomainArray,
sizeof (ACPI_PMTT_DOMAIN), AcpiDmTableInfoPmtt1a);
if (ACPI_FAILURE (Status))
{
return;
}
DomainOffset += sizeof (ACPI_PMTT_DOMAIN);
DomainArray++;
DomainCount--;
}
if (DomainCount)
{
AcpiOsPrintf (
"\n**** DomainCount exceeds subtable length\n\n",
MemSubTable->Type);
}
/* Walk the physical component (DIMM) subtables */
DimmOffset = DomainOffset;
DimmSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, MemSubTable,
DomainOffset);
while (((Offset + MemOffset + DimmOffset) < Table->Length) &&
(DimmOffset < MemSubTable->Length))
{
/* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length,
Offset + MemOffset + DimmOffset, DimmSubTable,
DimmSubTable->Length, AcpiDmTableInfoPmttHdr);
if (ACPI_FAILURE (Status))
{
return;
}
/* Only DIMM subtables are expected at this level */
if (DimmSubTable->Type != ACPI_PMTT_TYPE_DIMM)
{
AcpiOsPrintf (
"\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n",
DimmSubTable->Type);
return;
}
/* Dump the fixed-length DIMM subtable */
Status = AcpiDmDumpTable (Length,
Offset + MemOffset + DimmOffset, DimmSubTable,
DimmSubTable->Length, AcpiDmTableInfoPmtt2);
if (ACPI_FAILURE (Status))
{
return;
}
/* Point to next DIMM subtable */
DimmOffset += DimmSubTable->Length;
DimmSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
DimmSubTable, DimmSubTable->Length);
}
/* Point to next Controller subtable */
MemOffset += MemSubTable->Length;
MemSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
MemSubTable, MemSubTable->Length);
}
/* Point to next Socket subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
SubTable, SubTable->Length);
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpS3pt
*
* PARAMETERS: Table - A S3PT table
*
* RETURN: Length of the table
*
* DESCRIPTION: Format the contents of a S3PT
*
******************************************************************************/
UINT32
AcpiDmDumpS3pt (
ACPI_TABLE_HEADER *Tables)
{
ACPI_STATUS Status;
UINT32 Offset = sizeof (ACPI_TABLE_S3PT);
ACPI_S3PT_HEADER *SubTable;
ACPI_DMTABLE_INFO *InfoTable;
ACPI_TABLE_S3PT *S3ptTable = ACPI_CAST_PTR (ACPI_TABLE_S3PT, Tables);
/* Main table */
Status = AcpiDmDumpTable (Offset, 0, S3ptTable, 0, AcpiDmTableInfoS3pt);
if (ACPI_FAILURE (Status))
{
return 0;
}
SubTable = ACPI_ADD_PTR (ACPI_S3PT_HEADER, S3ptTable, Offset);
while (Offset < S3ptTable->Length)
{
/* Common sub-table header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable,
SubTable->Length, AcpiDmTableInfoS3ptHdr);
if (ACPI_FAILURE (Status))
{
return 0;
}
switch (SubTable->Type)
{
case ACPI_S3PT_TYPE_RESUME:
InfoTable = AcpiDmTableInfoS3pt0;
break;
case ACPI_S3PT_TYPE_SUSPEND:
InfoTable = AcpiDmTableInfoS3pt1;
break;
default:
AcpiOsPrintf ("\n**** Unknown S3PT sub-table type 0x%X\n", SubTable->Type);
/* Attempt to continue */
if (!SubTable->Length)
{
AcpiOsPrintf ("Invalid zero length subtable\n");
return 0;
}
goto NextSubTable;
}
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable,
SubTable->Length, InfoTable);
if (ACPI_FAILURE (Status))
{
return 0;
}
NextSubTable:
/* Point to next sub-table */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_S3PT_HEADER, SubTable, SubTable->Length);
}
return (S3ptTable->Length);
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpSlic
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -150,97 +150,123 @@
/*
* Macros used to generate offsets to specific table fields
*/
#define ACPI_FACS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_FACS,f)
#define ACPI_GAS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_GENERIC_ADDRESS,f)
#define ACPI_HDR_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_HEADER,f)
#define ACPI_RSDP_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_RSDP,f)
#define ACPI_BOOT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_BOOT,f)
#define ACPI_BERT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_BERT,f)
#define ACPI_CPEP_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_CPEP,f)
#define ACPI_DBGP_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_DBGP,f)
#define ACPI_DMAR_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_DMAR,f)
#define ACPI_ECDT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_ECDT,f)
#define ACPI_EINJ_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_EINJ,f)
#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_MCHI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MCHI,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_WDDT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDDT,f)
#define ACPI_WDRT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDRT,f)
#define ACPI_FACS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_FACS,f)
#define ACPI_GAS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GENERIC_ADDRESS,f)
#define ACPI_HDR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HEADER,f)
#define ACPI_RSDP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_RSDP,f)
#define ACPI_BERT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BERT,f)
#define ACPI_BGRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BGRT,f)
#define ACPI_BOOT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BOOT,f)
#define ACPI_CPEP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_CPEP,f)
#define ACPI_DBGP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DBGP,f)
#define ACPI_DMAR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DMAR,f)
#define ACPI_DRTM_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DRTM,f)
#define ACPI_ECDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_ECDT,f)
#define ACPI_EINJ_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_EINJ,f)
#define ACPI_ERST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_ERST,f)
#define ACPI_GTDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_GTDT,f)
#define ACPI_HEST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HEST,f)
#define ACPI_HPET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HPET,f)
#define ACPI_IVRS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_IVRS,f)
#define ACPI_MADT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MADT,f)
#define ACPI_MCFG_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MCFG,f)
#define ACPI_MCHI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MCHI,f)
#define ACPI_MPST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MPST,f)
#define ACPI_MSCT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MSCT,f)
#define ACPI_PCCT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_PCCT,f)
#define ACPI_PMTT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_PMTT,f)
#define ACPI_S3PT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_S3PT,f)
#define ACPI_SBST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SBST,f)
#define ACPI_SLIT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SLIT,f)
#define ACPI_SPCR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPCR,f)
#define ACPI_SPMI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPMI,f)
#define ACPI_SRAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SRAT,f)
#define ACPI_TCPA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA,f)
#define ACPI_UEFI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_UEFI,f)
#define ACPI_WAET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WAET,f)
#define ACPI_WDAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDAT,f)
#define ACPI_WDDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDDT,f)
#define ACPI_WDRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDRT,f)
/* Subtables */
#define ACPI_ASF0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_INFO,f)
#define ACPI_ASF1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_ALERT,f)
#define ACPI_ASF1a_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_ALERT_DATA,f)
#define ACPI_ASF2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_REMOTE,f)
#define ACPI_ASF2a_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_CONTROL_DATA,f)
#define ACPI_ASF3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_RMCP,f)
#define ACPI_ASF4_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_ADDRESS,f)
#define ACPI_CPEP0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_CPEP_POLLING,f)
#define ACPI_DMARS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_DEVICE_SCOPE,f)
#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_ERST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,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)
#define ACPI_MADT3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_NMI_SOURCE,f)
#define ACPI_MADT4_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC_NMI,f)
#define ACPI_MADT5_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC_OVERRIDE,f)
#define ACPI_MADT6_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_IO_SAPIC,f)
#define ACPI_MADT7_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_SAPIC,f)
#define ACPI_MADT8_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_INTERRUPT_SOURCE,f)
#define ACPI_MADT9_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC,f)
#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_SLICH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SLIC_HEADER,f)
#define ACPI_SLIC0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SLIC_KEY,f)
#define ACPI_SLIC1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SLIC_MARKER,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)
#define ACPI_ASF0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_INFO,f)
#define ACPI_ASF1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ALERT,f)
#define ACPI_ASF1a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ALERT_DATA,f)
#define ACPI_ASF2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_REMOTE,f)
#define ACPI_ASF2a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_CONTROL_DATA,f)
#define ACPI_ASF3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_RMCP,f)
#define ACPI_ASF4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f)
#define ACPI_CPEP0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CPEP_POLLING,f)
#define ACPI_DMARS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_DEVICE_SCOPE,f)
#define ACPI_DMAR0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_HARDWARE_UNIT,f)
#define ACPI_DMAR1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f)
#define ACPI_DMAR2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_ATSR,f)
#define ACPI_DMAR3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RHSA,f)
#define ACPI_EINJ0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
#define ACPI_ERST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
#define ACPI_FPDTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_HEADER,f)
#define ACPI_FPDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_BOOT,f)
#define ACPI_FPDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_S3PT_PTR,f)
#define ACPI_HEST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f)
#define ACPI_HEST1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f)
#define ACPI_HEST2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_NMI,f)
#define ACPI_HEST6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER_ROOT,f)
#define ACPI_HEST7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER,f)
#define ACPI_HEST8_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER_BRIDGE,f)
#define ACPI_HEST9_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_GENERIC,f)
#define ACPI_HESTN_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_NOTIFY,f)
#define ACPI_HESTB_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_ERROR_BANK,f)
#define ACPI_IVRSH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_HEADER,f)
#define ACPI_IVRS0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_HARDWARE,f)
#define ACPI_IVRS1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_MEMORY,f)
#define ACPI_IVRSD_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DE_HEADER,f)
#define ACPI_IVRS8A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8A,f)
#define ACPI_IVRS8B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8B,f)
#define ACPI_IVRS8C_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8C,f)
#define ACPI_MADT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC,f)
#define ACPI_MADT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_IO_APIC,f)
#define ACPI_MADT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f)
#define ACPI_MADT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_NMI_SOURCE,f)
#define ACPI_MADT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC_NMI,f)
#define ACPI_MADT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC_OVERRIDE,f)
#define ACPI_MADT6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_IO_SAPIC,f)
#define ACPI_MADT7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_SAPIC,f)
#define ACPI_MADT8_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_INTERRUPT_SOURCE,f)
#define ACPI_MADT9_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC,f)
#define ACPI_MADT10_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f)
#define ACPI_MADT11_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f)
#define ACPI_MADT12_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_DISTRIBUTOR,f)
#define ACPI_MADTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
#define ACPI_MCFG0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f)
#define ACPI_MPST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_NODE,f)
#define ACPI_MPST0A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_STATE,f)
#define ACPI_MPST0B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_COMPONENT,f)
#define ACPI_MPST1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_DATA_HDR,f)
#define ACPI_MPST2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_DATA,f)
#define ACPI_MSCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f)
#define ACPI_PCCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f)
#define ACPI_PMTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_SOCKET,f)
#define ACPI_PMTT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_CONTROLLER,f)
#define ACPI_PMTT1A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_DOMAIN,f)
#define ACPI_PMTT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_PHYSICAL_COMPONENT,f)
#define ACPI_PMTTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_HEADER,f)
#define ACPI_S3PTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_HEADER,f)
#define ACPI_S3PT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_RESUME,f)
#define ACPI_S3PT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_SUSPEND,f)
#define ACPI_SLICH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SLIC_HEADER,f)
#define ACPI_SLIC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SLIC_KEY,f)
#define ACPI_SLIC1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SLIC_MARKER,f)
#define ACPI_SRATH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
#define ACPI_SRAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f)
#define ACPI_SRAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
#define ACPI_SRAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f)
#define ACPI_WDAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WDAT_ENTRY,f)
/*
* Simplify access to flag fields by breaking them up into bytes
*/
#define ACPI_FLAG_OFFSET(d,f,o) (UINT8) (ACPI_OFFSET (d,f) + o)
#define ACPI_FLAG_OFFSET(d,f,o) (UINT16) (ACPI_OFFSET (d,f) + o)
/* Flags */
@@ -250,6 +276,7 @@
#define ACPI_SRAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_CPU_AFFINITY,f,o)
#define ACPI_SRAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_MEM_AFFINITY,f,o)
#define ACPI_SRAT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f,o)
#define ACPI_GTDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_GTDT,f,o)
#define ACPI_MADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_MADT,f,o)
#define ACPI_MADT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_APIC,f,o)
#define ACPI_MADT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f,o)
@@ -259,6 +286,11 @@
#define ACPI_MADT8_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_INTERRUPT_SOURCE,f,o)
#define ACPI_MADT9_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC,f,o)
#define ACPI_MADT10_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f,o)
#define ACPI_MADT11_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f,o)
#define ACPI_MPST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MPST_POWER_NODE,f,o)
#define ACPI_MPST2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MPST_POWER_DATA,f,o)
#define ACPI_PCCT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_PCCT,f,o)
#define ACPI_PMTTH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PMTT_HEADER,f,o)
#define ACPI_WDDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_WDDT,f,o)
#define ACPI_EINJ0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o)
#define ACPI_ERST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o)
@@ -270,6 +302,7 @@
* Required terminator for all tables below
*/
#define ACPI_DMT_TERMINATOR {ACPI_DMT_EXIT, 0, NULL, 0}
#define ACPI_DMT_NEW_LINE {ACPI_DMT_EXTRA_TEXT, 0, "\n", 0}
/*
@@ -423,6 +456,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[] =
{ACPI_DMT_FLAG2, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "VGA Not Present (V4)", 0},
{ACPI_DMT_FLAG3, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "MSI Not Supported (V4)", 0},
{ACPI_DMT_FLAG4, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "PCIe ASPM Not Supported (V4)", 0},
{ACPI_DMT_FLAG5, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "CMOS RTC Not Present (V5)", 0},
{ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
@@ -455,6 +489,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[] =
{ACPI_DMT_FLAG1, ACPI_FADT_FLAG_OFFSET (Flags,2), "Remote Power-on capable (V4)", 0},
{ACPI_DMT_FLAG2, ACPI_FADT_FLAG_OFFSET (Flags,2), "Use APIC Cluster Model (V4)", 0},
{ACPI_DMT_FLAG3, ACPI_FADT_FLAG_OFFSET (Flags,2), "Use APIC Physical Destination Mode (V4)", 0},
{ACPI_DMT_FLAG4, ACPI_FADT_FLAG_OFFSET (Flags,2), "Hardware Reduced (V5)", 0},
{ACPI_DMT_FLAG5, ACPI_FADT_FLAG_OFFSET (Flags,2), "Low Power S0 Idle (V5)", 0},
ACPI_DMT_TERMINATOR
};
@@ -468,7 +504,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[] =
ACPI_DMT_TERMINATOR
};
/* ACPI 2.0+ Extensions (FADT version 3+) */
/* ACPI 2.0+ Extensions (FADT version 3 and 4) */
ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[] =
{
@@ -488,6 +524,15 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[] =
ACPI_DMT_TERMINATOR
};
/* ACPI 5.0 Extensions (FADT version 5) */
ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[] =
{
{ACPI_DMT_GAS, ACPI_FADT_OFFSET (SleepControl), "Sleep Control Register", 0},
{ACPI_DMT_GAS, ACPI_FADT_OFFSET (SleepStatus), "Sleep Status Register", 0},
ACPI_DMT_TERMINATOR
};
/*
* Remaining tables are not consumed directly by the ACPICA subsystem
@@ -611,6 +656,24 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoBert[] =
};
/*******************************************************************************
*
* BGRT - Boot Graphics Resource Table (ACPI 5.0)
*
******************************************************************************/
ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[] =
{
{ACPI_DMT_UINT16, ACPI_BGRT_OFFSET (Version), "Version", 0},
{ACPI_DMT_UINT8, ACPI_BGRT_OFFSET (Status), "Status", 0},
{ACPI_DMT_UINT8, ACPI_BGRT_OFFSET (ImageType), "Image Type", 0},
{ACPI_DMT_UINT64, ACPI_BGRT_OFFSET (ImageAddress), "Image Address", 0},
{ACPI_DMT_UINT32, ACPI_BGRT_OFFSET (ImageOffsetX), "Image OffsetX", 0},
{ACPI_DMT_UINT32, ACPI_BGRT_OFFSET (ImageOffsetY), "Image OffsetY", 0},
ACPI_DMT_TERMINATOR
};
/*******************************************************************************
*
* BOOT - Simple Boot Flag Table
@@ -742,6 +805,19 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[] =
};
/*******************************************************************************
*
* DRTM - Dynamic Root of Trust for Measurement table
*
******************************************************************************/
ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm[] =
{
ACPI_DMT_TERMINATOR
};
/*******************************************************************************
*
* ECDT - Embedded Controller Boot Resources Table
@@ -818,6 +894,82 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoErst0[] =
};
/*******************************************************************************
*
* FPDT - Firmware Performance Data Table (ACPI 5.0)
*
******************************************************************************/
/* Main table consists of only the standard ACPI header - subtables follow */
/* FPDT subtable header */
ACPI_DMTABLE_INFO AcpiDmTableInfoFpdtHdr[] =
{
{ACPI_DMT_UINT16, ACPI_FPDTH_OFFSET (Type), "Subtable Type", 0},
{ACPI_DMT_UINT8, ACPI_FPDTH_OFFSET (Length), "Length", DT_LENGTH},
{ACPI_DMT_UINT8, ACPI_FPDTH_OFFSET (Revision), "Revision", 0},
ACPI_DMT_TERMINATOR
};
/* 0: Firmware Basic Boot Performance Record */
ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt0[] =
{
{ACPI_DMT_UINT32, ACPI_FPDT0_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT64, ACPI_FPDT0_OFFSET (ResetEnd), "Reset End", 0},
{ACPI_DMT_UINT64, ACPI_FPDT0_OFFSET (LoadStart), "Load Image Start", 0},
{ACPI_DMT_UINT64, ACPI_FPDT0_OFFSET (StartupStart), "Start Image Start", 0},
{ACPI_DMT_UINT64, ACPI_FPDT0_OFFSET (ExitServicesEntry), "Exit Services Entry", 0},
{ACPI_DMT_UINT64, ACPI_FPDT0_OFFSET (ExitServicesExit), "Exit Services Exit", 0},
ACPI_DMT_TERMINATOR
};
/* 1: S3 Performance Table Pointer Record */
ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt1[] =
{
{ACPI_DMT_UINT32, ACPI_FPDT1_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT64, ACPI_FPDT1_OFFSET (Address), "S3PT Address", 0},
ACPI_DMT_TERMINATOR
};
/*******************************************************************************
*
* GTDT - Generic Timer Description Table
*
******************************************************************************/
ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[] =
{
{ACPI_DMT_UINT64, ACPI_GTDT_OFFSET (Address), "Timer Address", 0},
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (Flags,0), "Memory Present", 0},
ACPI_DMT_NEW_LINE,
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecurePl1Interrupt), "Secure PL1 Interrupt", 0},
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecurePl1Flags), "SPL1 Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (SecurePl1Flags,0), "Trigger Mode", 0},
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (SecurePl1Flags,0), "Polarity", 0},
ACPI_DMT_NEW_LINE,
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl1Interrupt), "Non-Secure PL1 Interrupt", 0},
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl1Flags), "NSPL1 Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecurePl1Flags,0),"Trigger Mode", 0},
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecurePl1Flags,0),"Polarity", 0},
ACPI_DMT_NEW_LINE,
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (VirtualTimerInterrupt), "Virtual Timer Interrupt", 0},
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (VirtualTimerFlags), "VT Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Trigger Mode", 0},
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Polarity", 0},
ACPI_DMT_NEW_LINE,
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl2Interrupt), "Non-Secure PL2 Interrupt", 0},
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl2Flags), "NSPL2 Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecurePl2Flags,0),"Trigger Mode", 0},
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecurePl2Flags,0),"Polarity", 0},
ACPI_DMT_TERMINATOR
};
/*******************************************************************************
*
* HEST - Hardware Error Source table
@@ -1262,6 +1414,34 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[] =
ACPI_DMT_TERMINATOR
};
/* 11: Generic Interrupt Controller (ACPI 5.0) */
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[] =
{
{ACPI_DMT_UINT16, ACPI_MADT11_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (GicId), "Local GIC Hardware ID", 0},
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (Uid), "Processor UID", 0},
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_MADT11_FLAG_OFFSET (Flags,0), "Processor Enabled", 0},
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (ParkingVersion), "Parking Protocol Version", 0},
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (PerformanceInterrupt), "Performance Interrupt", 0},
{ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (ParkedAddress), "Parked Address", 0},
{ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (BaseAddress), "Base Address", 0},
ACPI_DMT_TERMINATOR
};
/* 12: Generic Interrupt Distributor (ACPI 5.0) */
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[] =
{
{ACPI_DMT_UINT16, ACPI_MADT12_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT32, ACPI_MADT12_OFFSET (GicId), "Local GIC Hardware ID", 0},
{ACPI_DMT_UINT64, ACPI_MADT12_OFFSET (BaseAddress), "Base Address", 0},
{ACPI_DMT_UINT32, ACPI_MADT12_OFFSET (GlobalIrqBase), "Interrupt Base", 0},
{ACPI_DMT_UINT32, ACPI_MADT12_OFFSET (Reserved2), "Reserved", 0},
ACPI_DMT_TERMINATOR
};
/*******************************************************************************
*
@@ -1310,6 +1490,87 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMchi[] =
};
/*******************************************************************************
*
* MPST - Memory Power State Table
*
******************************************************************************/
ACPI_DMTABLE_INFO AcpiDmTableInfoMpst[] =
{
{ACPI_DMT_UINT16, ACPI_MPST_OFFSET (Reserved1), "Reserved", 0},
{ACPI_DMT_UINT8, ACPI_MPST_OFFSET (ChannelId), "Channel ID", 0},
{ACPI_DMT_UINT8, ACPI_MPST_OFFSET (Reserved2), "Reserved", 0},
{ACPI_DMT_UINT16, ACPI_MPST_OFFSET (PowerNodeCount), "Power Node Count", 0},
ACPI_DMT_TERMINATOR
};
/* MPST subtables */
/* 0: Memory Power Node Structure */
ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0[] =
{
{ACPI_DMT_UINT8, ACPI_MPST0_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_MPST0_FLAG_OFFSET (Flags,0), "Node Enabled", 0},
{ACPI_DMT_FLAG1, ACPI_MPST0_FLAG_OFFSET (Flags,0), "Power Managed", 0},
{ACPI_DMT_FLAG2, ACPI_MPST0_FLAG_OFFSET (Flags,0), "Hot Plug Capable", 0},
{ACPI_DMT_UINT8, ACPI_MPST0_OFFSET (Reserved1), "Reserved", 0},
{ACPI_DMT_UINT16, ACPI_MPST0_OFFSET (NodeId), "Node ID", 0},
{ACPI_DMT_UINT32, ACPI_MPST0_OFFSET (Length), "Length", DT_LENGTH},
{ACPI_DMT_UINT64, ACPI_MPST0_OFFSET (RangeAddress), "Range Address", 0},
{ACPI_DMT_UINT64, ACPI_MPST0_OFFSET (RangeLength), "Range Length", 0},
{ACPI_DMT_UINT8, ACPI_MPST0_OFFSET (NumPowerStates), "Num Power States", 0},
{ACPI_DMT_UINT8, ACPI_MPST0_OFFSET (NumPhysicalComponents), "Num Physical Components", 0},
{ACPI_DMT_UINT16, ACPI_MPST0_OFFSET (Reserved2), "Reserved", 0},
ACPI_DMT_TERMINATOR
};
/* 0A: Sub-subtable - Memory Power State Structure (follows Memory Power Node above) */
ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0A[] =
{
{ACPI_DMT_UINT8, ACPI_MPST0A_OFFSET (PowerState), "Power State", 0},
{ACPI_DMT_UINT8, ACPI_MPST0A_OFFSET (InfoIndex), "InfoIndex", 0},
ACPI_DMT_TERMINATOR
};
/* 0B: Sub-subtable - Physical Component ID Structure (follows Memory Power State(s) above) */
ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0B[] =
{
{ACPI_DMT_UINT16, ACPI_MPST0B_OFFSET (ComponentId), "Component Id", 0},
ACPI_DMT_TERMINATOR
};
/* 01: Power Characteristics Count (follows all Power Node(s) above) */
ACPI_DMTABLE_INFO AcpiDmTableInfoMpst1[] =
{
{ACPI_DMT_UINT16, ACPI_MPST1_OFFSET (CharacteristicsCount), "Characteristics Count", 0},
ACPI_DMT_TERMINATOR
};
/* 02: Memory Power State Characteristics Structure */
ACPI_DMTABLE_INFO AcpiDmTableInfoMpst2[] =
{
{ACPI_DMT_UINT8, ACPI_MPST2_OFFSET (Revision), "Revision", 0},
{ACPI_DMT_UINT8, ACPI_MPST2_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_MPST2_FLAG_OFFSET (Flags,0), "Memory Preserved", 0},
{ACPI_DMT_FLAG1, ACPI_MPST2_FLAG_OFFSET (Flags,0), "Auto Entry", 0},
{ACPI_DMT_FLAG2, ACPI_MPST2_FLAG_OFFSET (Flags,0), "Auto Exit", 0},
{ACPI_DMT_UINT16, ACPI_MPST2_OFFSET (Reserved1), "Reserved", 0},
{ACPI_DMT_UINT32, ACPI_MPST2_OFFSET (AveragePower), "Average Power", 0},
{ACPI_DMT_UINT32, ACPI_MPST2_OFFSET (PowerSaving), "Power Saving", 0},
{ACPI_DMT_UINT64, ACPI_MPST2_OFFSET (ExitLatency), "Exit Latency", 0},
{ACPI_DMT_UINT64, ACPI_MPST2_OFFSET (Reserved2), "Reserved", 0},
ACPI_DMT_TERMINATOR
};
/*******************************************************************************
*
* MSCT - Maximum System Characteristics Table (ACPI 4.0)
@@ -1339,6 +1600,155 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[] =
};
/*******************************************************************************
*
* PCCT - Platform Communications Channel Table (ACPI 5.0)
*
******************************************************************************/
ACPI_DMTABLE_INFO AcpiDmTableInfoPcct[] =
{
{ACPI_DMT_UINT32, ACPI_PCCT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_PCCT_FLAG_OFFSET (Flags,0), "Doorbell", 0},
{ACPI_DMT_UINT32, ACPI_PCCT_OFFSET (Latency), "Command Latency", 0},
{ACPI_DMT_UINT32, ACPI_PCCT_OFFSET (Reserved), "Reserved", 0},
ACPI_DMT_TERMINATOR
};
/* PCCT subtables */
/* 0: Generic Communications Subspace */
ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[] =
{
{ACPI_DMT_UINT8, ACPI_PCCT0_OFFSET (Header.Type), "Subtable Type", 0},
{ACPI_DMT_UINT8, ACPI_PCCT0_OFFSET (Header.Length), "Length", DT_LENGTH},
{ACPI_DMT_UINT48, ACPI_PCCT0_OFFSET (Reserved[0]), "Reserved", 0},
{ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (BaseAddress), "Base Address", 0},
{ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (Length), "Address Length", 0},
{ACPI_DMT_GAS, ACPI_PCCT0_OFFSET (DoorbellRegister), "Doorbell Register", 0},
{ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (PreserveMask), "Preserve Mask", 0},
{ACPI_DMT_UINT64, ACPI_PCCT0_OFFSET (WriteMask), "Write Mask", 0},
ACPI_DMT_TERMINATOR
};
/*******************************************************************************
*
* PMTT - Platform Memory Topology Table
*
******************************************************************************/
ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt[] =
{
{ACPI_DMT_UINT32, ACPI_PMTT_OFFSET (Reserved), "Reserved", 0},
ACPI_DMT_TERMINATOR
};
/* Common Subtable header (one per Subtable) */
ACPI_DMTABLE_INFO AcpiDmTableInfoPmttHdr[] =
{
{ACPI_DMT_PMTT, ACPI_PMTTH_OFFSET (Type), "Subtable Type", 0},
{ACPI_DMT_UINT8, ACPI_PMTTH_OFFSET (Reserved1), "Reserved", 0},
{ACPI_DMT_UINT16, ACPI_PMTTH_OFFSET (Length), "Length", DT_LENGTH},
{ACPI_DMT_UINT16, ACPI_PMTTH_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_PMTTH_FLAG_OFFSET (Flags,0), "Top-level Device", 0},
{ACPI_DMT_FLAG1, ACPI_PMTTH_FLAG_OFFSET (Flags,0), "Physical Element", 0},
{ACPI_DMT_FLAGS2, ACPI_PMTTH_FLAG_OFFSET (Flags,0), "Memory Type", 0},
{ACPI_DMT_UINT16, ACPI_PMTTH_OFFSET (Reserved2), "Reserved", 0},
ACPI_DMT_TERMINATOR
};
/* PMTT Subtables */
/* 0: Socket */
ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt0[] =
{
{ACPI_DMT_UINT16, ACPI_PMTT0_OFFSET (SocketId), "Socket ID", 0},
{ACPI_DMT_UINT16, ACPI_PMTT0_OFFSET (Reserved), "Reserved", 0},
ACPI_DMT_TERMINATOR
};
/* 1: Memory Controller */
ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1[] =
{
{ACPI_DMT_UINT32, ACPI_PMTT1_OFFSET (ReadLatency), "Read Latency", 0},
{ACPI_DMT_UINT32, ACPI_PMTT1_OFFSET (WriteLatency), "Write Latency", 0},
{ACPI_DMT_UINT32, ACPI_PMTT1_OFFSET (ReadBandwidth), "Read Bandwidth", 0},
{ACPI_DMT_UINT32, ACPI_PMTT1_OFFSET (WriteBandwidth), "Write Bandwidth", 0},
{ACPI_DMT_UINT16, ACPI_PMTT1_OFFSET (AccessWidth), "Access Width", 0},
{ACPI_DMT_UINT16, ACPI_PMTT1_OFFSET (Alignment), "Alignment", 0},
{ACPI_DMT_UINT16, ACPI_PMTT1_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT16, ACPI_PMTT1_OFFSET (DomainCount), "Domain Count", 0},
ACPI_DMT_TERMINATOR
};
/* 1a: Proximity Domain */
ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1a[] =
{
{ACPI_DMT_UINT32, ACPI_PMTT1A_OFFSET (ProximityDomain), "Proximity Domain", 0},
ACPI_DMT_TERMINATOR
};
/* 2: Physical Component */
ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt2[] =
{
{ACPI_DMT_UINT16, ACPI_PMTT2_OFFSET (ComponentId), "Component ID", 0},
{ACPI_DMT_UINT16, ACPI_PMTT2_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT32, ACPI_PMTT2_OFFSET (MemorySize), "Memory Size", 0},
{ACPI_DMT_UINT32, ACPI_PMTT2_OFFSET (BiosHandle), "Bios Handle", 0},
ACPI_DMT_TERMINATOR
};
/*******************************************************************************
*
* S3PT - S3 Performance Table
*
******************************************************************************/
ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt[] =
{
{ACPI_DMT_SIG, ACPI_S3PT_OFFSET (Signature[0]), "Signature", 0},
{ACPI_DMT_UINT32, ACPI_S3PT_OFFSET (Length), "Length", DT_LENGTH},
ACPI_DMT_TERMINATOR
};
/* S3PT subtable header */
ACPI_DMTABLE_INFO AcpiDmTableInfoS3ptHdr[] =
{
{ACPI_DMT_UINT16, ACPI_S3PTH_OFFSET (Type), "Type", 0},
{ACPI_DMT_UINT8, ACPI_S3PTH_OFFSET (Length), "Length", DT_LENGTH},
{ACPI_DMT_UINT8, ACPI_S3PTH_OFFSET (Revision), "Revision", 0},
ACPI_DMT_TERMINATOR
};
/* 0: Basic S3 Resume Performance Record */
ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt0[] =
{
{ACPI_DMT_UINT32, ACPI_S3PT0_OFFSET (ResumeCount), "Resume Count", 0},
{ACPI_DMT_UINT64, ACPI_S3PT0_OFFSET (FullResume), "Full Resume", 0},
{ACPI_DMT_UINT64, ACPI_S3PT0_OFFSET (AverageResume), "Average Resume", 0},
ACPI_DMT_TERMINATOR
};
/* 1: Basic S3 Suspend Performance Record */
ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt1[] =
{
{ACPI_DMT_UINT64, ACPI_S3PT1_OFFSET (SuspendStart), "Suspend Start", 0},
{ACPI_DMT_UINT64, ACPI_S3PT1_OFFSET (SuspendEnd), "Suspend End", 0},
ACPI_DMT_TERMINATOR
};
/*******************************************************************************
*
* SBST - Smart Battery Specification Table
@@ -1681,8 +2091,10 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[] =
ACPI_DMT_TERMINATOR
};
/*! [Begin] no source code translation */
/*
* Generic types (used in UEFI)
* Generic types (used in UEFI and custom tables)
*
* Examples:
*
@@ -1701,7 +2113,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[] =
* DevicePath : "\PciRoot(0)\Pci(0x1f,1)\Usb(0,0)"
*/
#define ACPI_DM_GENERIC_ENTRY(FieldType, FieldName)\
#define ACPI_DM_GENERIC_ENTRY(FieldType, FieldName) \
{{FieldType, 0, FieldName, 0}, ACPI_DMT_TERMINATOR}
ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric[][2] =
@@ -1710,6 +2122,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric[][2] =
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT16, "UINT16"),
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT24, "UINT24"),
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT32, "UINT32"),
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT40, "UINT40"),
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT48, "UINT48"),
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT56, "UINT56"),
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_UINT64, "UINT64"),
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_STRING, "String"),
@@ -1720,3 +2134,4 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric[][2] =
ACPI_DM_GENERIC_ENTRY (ACPI_DMT_LABEL, "Label"),
{ACPI_DMT_TERMINATOR}
};
/*! [End] no source code translation !*/
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -121,7 +121,8 @@
#include "accommon.h"
#include "acapps.h"
#define ERR(szz,czz) if(AcpiGbl_Opterr){fprintf(stderr,"%s%s%c\n",argv[0],szz,czz);}
#define ACPI_OPTION_ERROR(msg, badchar) \
if (AcpiGbl_Opterr) {fprintf (stderr, "%s%c\n", msg, badchar);}
int AcpiGbl_Opterr = 1;
@@ -159,12 +160,12 @@ AcpiGetopt(
argv[AcpiGbl_Optind][0] != '-' ||
argv[AcpiGbl_Optind][1] == '\0')
{
return(EOF);
return (EOF);
}
else if (strcmp (argv[AcpiGbl_Optind], "--") == 0)
{
AcpiGbl_Optind++;
return(EOF);
return (EOF);
}
}
@@ -177,7 +178,7 @@ AcpiGetopt(
if (CurrentChar == ':' ||
(OptsPtr = strchr (opts, CurrentChar)) == NULL)
{
ERR (": illegal option -- ", CurrentChar);
ACPI_OPTION_ERROR ("Illegal option: -", CurrentChar);
if (argv[AcpiGbl_Optind][++CurrentCharPtr] == '\0')
{
@@ -198,7 +199,7 @@ AcpiGetopt(
}
else if (++AcpiGbl_Optind >= argc)
{
ERR (": option requires an argument -- ", CurrentChar);
ACPI_OPTION_ERROR ("Option requires an argument: -", CurrentChar);
CurrentCharPtr = 1;
return ('?');
@@ -228,6 +229,26 @@ AcpiGetopt(
CurrentCharPtr = 1;
}
/* Option has a required single-char argument? */
else if (*OptsPtr == '|')
{
if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '\0')
{
AcpiGbl_Optarg = &argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)];
}
else
{
ACPI_OPTION_ERROR ("Option requires a single-character suboption: -", CurrentChar);
CurrentCharPtr = 1;
return ('?');
}
AcpiGbl_Optind++;
CurrentCharPtr = 1;
}
/* Option with no arguments */
else
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -496,7 +496,15 @@ AcpiDsGetRegionArguments (
/* Execute the argument AML */
Status = AcpiDsExecuteArguments (Node, Node->Parent,
Status = AcpiDsExecuteArguments (Node, ExtraDesc->Extra.ScopeNode,
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
Status = AcpiUtAddAddressRange (ObjDesc->Region.SpaceId,
ObjDesc->Region.Address, ObjDesc->Region.Length,
Node);
return_ACPI_STATUS (Status);
}
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -129,6 +129,18 @@
/* Local prototypes */
#ifdef ACPI_ASL_COMPILER
#include "acdisasm.h"
static ACPI_STATUS
AcpiDsCreateExternalRegion (
ACPI_STATUS LookupStatus,
ACPI_PARSE_OBJECT *Op,
char *Path,
ACPI_WALK_STATE *WalkState,
ACPI_NAMESPACE_NODE **Node);
#endif
static ACPI_STATUS
AcpiDsGetFieldNames (
ACPI_CREATE_FIELD_INFO *Info,
@@ -136,6 +148,69 @@ AcpiDsGetFieldNames (
ACPI_PARSE_OBJECT *Arg);
#ifdef ACPI_ASL_COMPILER
/*******************************************************************************
*
* FUNCTION: AcpiDsCreateExternalRegion (iASL Disassembler only)
*
* PARAMETERS: LookupStatus - Status from NsLookup operation
* Op - Op containing the Field definition and args
* Path - Pathname of the region
* ` WalkState - Current method state
* Node - Where the new region node is returned
*
* RETURN: Status
*
* DESCRIPTION: Add region to the external list if NOT_FOUND. Create a new
* region node/object.
*
******************************************************************************/
static ACPI_STATUS
AcpiDsCreateExternalRegion (
ACPI_STATUS LookupStatus,
ACPI_PARSE_OBJECT *Op,
char *Path,
ACPI_WALK_STATE *WalkState,
ACPI_NAMESPACE_NODE **Node)
{
ACPI_STATUS Status;
ACPI_OPERAND_OBJECT *ObjDesc;
if (LookupStatus != AE_NOT_FOUND)
{
return (LookupStatus);
}
/*
* Table disassembly:
* OperationRegion not found. Generate an External for it, and
* insert the name into the namespace.
*/
AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_REGION, 0);
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_REGION,
ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, WalkState, Node);
if (ACPI_FAILURE (Status))
{
return (Status);
}
/* Must create and install a region object for the new node */
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION);
if (!ObjDesc)
{
return (AE_NO_MEMORY);
}
ObjDesc->Region.Node = *Node;
Status = AcpiNsAttachObject (*Node, ObjDesc, ACPI_TYPE_REGION);
return (Status);
}
#endif
/*******************************************************************************
*
* FUNCTION: AcpiDsCreateBufferField
@@ -149,8 +224,8 @@ AcpiDsGetFieldNames (
* CreateBitFieldOp,
* CreateByteFieldOp,
* CreateWordFieldOp,
* CreateDWordFieldOp,
* CreateQWordFieldOp,
* CreateDwordFieldOp,
* CreateQwordFieldOp,
* CreateFieldOp (all of which define a field in a buffer)
*
******************************************************************************/
@@ -315,6 +390,7 @@ AcpiDsGetFieldNames (
{
ACPI_STATUS Status;
UINT64 Position;
ACPI_PARSE_OBJECT *Child;
ACPI_FUNCTION_TRACE_PTR (DsGetFieldNames, Info);
@@ -329,10 +405,11 @@ AcpiDsGetFieldNames (
while (Arg)
{
/*
* Three types of field elements are handled:
* 1) Offset - specifies a bit offset
* 2) AccessAs - changes the access mode
* 3) Name - Enters a new named field into the namespace
* Four types of field elements are handled:
* 1) Name - Enters a new named field into the namespace
* 2) Offset - specifies a bit offset
* 3) AccessAs - changes the access mode/attributes
* 4) Connection - Associate a resource template with the field
*/
switch (Arg->Common.AmlOpcode)
{
@@ -351,24 +428,67 @@ AcpiDsGetFieldNames (
Info->FieldBitPosition = (UINT32) Position;
break;
case AML_INT_ACCESSFIELD_OP:
case AML_INT_EXTACCESSFIELD_OP:
/*
* Get a new AccessType and AccessAttribute -- to be used for all
* field units that follow, until field end or another AccessAs
* keyword.
* Get new AccessType, AccessAttribute, and AccessLength fields
* -- to be used for all field units that follow, until the
* end-of-field or another AccessAs keyword is encountered.
* NOTE. These three bytes are encoded in the integer value
* of the parseop for convenience.
*
* In FieldFlags, preserve the flag bits other than the
* ACCESS_TYPE bits
* ACCESS_TYPE bits.
*/
/* AccessType (ByteAcc, WordAcc, etc.) */
Info->FieldFlags = (UINT8)
((Info->FieldFlags & ~(AML_FIELD_ACCESS_TYPE_MASK)) |
((UINT8) ((UINT32) Arg->Common.Value.Integer >> 8)));
((UINT8) ((UINT32) (Arg->Common.Value.Integer & 0x07))));
Info->Attribute = (UINT8) (Arg->Common.Value.Integer);
/* AccessAttribute (AttribQuick, AttribByte, etc.) */
Info->Attribute = (UINT8) ((Arg->Common.Value.Integer >> 8) & 0xFF);
/* AccessLength (for serial/buffer protocols) */
Info->AccessLength = (UINT8) ((Arg->Common.Value.Integer >> 16) & 0xFF);
break;
case AML_INT_CONNECTION_OP:
/*
* Clear any previous connection. New connection is used for all
* fields that follow, similar to AccessAs
*/
Info->ResourceBuffer = NULL;
Info->ConnectionNode = NULL;
/*
* A Connection() is either an actual resource descriptor (buffer)
* or a named reference to a resource template
*/
Child = Arg->Common.Value.Arg;
if (Child->Common.AmlOpcode == AML_INT_BYTELIST_OP)
{
Info->ResourceBuffer = Child->Named.Data;
Info->ResourceLength = (UINT16) Child->Named.Value.Integer;
}
else
{
/* Lookup the Connection() namepath, it should already exist */
Status = AcpiNsLookup (WalkState->ScopeInfo,
Child->Common.Value.Name, ACPI_TYPE_ANY,
ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE,
WalkState, &Info->ConnectionNode);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Child->Common.Value.Name, Status);
return_ACPI_STATUS (Status);
}
}
break;
case AML_INT_NAMEDFIELD_OP:
@@ -420,7 +540,6 @@ AcpiDsGetFieldNames (
Info->FieldBitPosition += Info->FieldBitLength;
break;
default:
ACPI_ERROR ((AE_INFO,
@@ -466,11 +585,16 @@ AcpiDsCreateField (
/* First arg is the name of the parent OpRegion (must already exist) */
Arg = Op->Common.Value.Arg;
if (!RegionNode)
{
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name,
ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
#ifdef ACPI_ASL_COMPILER
Status = AcpiDsCreateExternalRegion (Status, Arg,
Arg->Common.Value.Name, WalkState, &RegionNode);
#endif
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status);
@@ -478,6 +602,8 @@ AcpiDsCreateField (
}
}
ACPI_MEMSET (&Info, 0, sizeof (ACPI_CREATE_FIELD_INFO));
/* Second arg is the field flags */
Arg = Arg->Common.Next;
@@ -490,7 +616,6 @@ AcpiDsCreateField (
Info.RegionNode = RegionNode;
Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next);
return_ACPI_STATUS (Status);
}
@@ -586,8 +711,8 @@ AcpiDsInitFieldObjects (
while (Arg)
{
/*
* Ignore OFFSET and ACCESSAS terms here; we are only interested in the
* field names in order to enter them into the namespace.
* Ignore OFFSET/ACCESSAS/CONNECTION terms here; we are only interested
* in the field names in order to enter them into the namespace.
*/
if (Arg->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)
{
@@ -655,6 +780,10 @@ AcpiDsCreateBankField (
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name,
ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
#ifdef ACPI_ASL_COMPILER
Status = AcpiDsCreateExternalRegion (Status, Arg,
Arg->Common.Value.Name, WalkState, &RegionNode);
#endif
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status);
@@ -769,7 +898,6 @@ AcpiDsCreateIndexField (
Info.RegionNode = RegionNode;
Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next);
return_ACPI_STATUS (Status);
}
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -595,18 +595,18 @@ AcpiDsEvalTableRegionOperands (
/*
* This is where we evaluate the SignatureString and OemIDString
* and OemTableIDString of the DataTableRegion declaration
* This is where we evaluate the Signature string, OemId string,
* and OemTableId string of the Data Table Region declaration
*/
Node = Op->Common.Node;
/* NextOp points to SignatureString op */
/* NextOp points to Signature string op */
NextOp = Op->Common.Value.Arg;
/*
* Evaluate/create the SignatureString and OemIDString
* and OemTableIDString operands
* Evaluate/create the Signature string, OemId string,
* and OemTableId string operands
*/
Status = AcpiDsCreateOperands (WalkState, NextOp);
if (ACPI_FAILURE (Status))
@@ -615,8 +615,8 @@ AcpiDsEvalTableRegionOperands (
}
/*
* Resolve the SignatureString and OemIDString
* and OemTableIDString operands
* Resolve the Signature string, OemId string,
* and OemTableId string operands
*/
Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
ACPI_WALK_OPERANDS, WalkState);
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -120,6 +120,8 @@
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evevent")
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/* Local prototypes */
static ACPI_STATUS
@@ -153,6 +155,13 @@ AcpiEvInitializeEvents (
ACPI_FUNCTION_TRACE (EvInitializeEvents);
/* If Hardware Reduced flag is set, there are no fixed events */
if (AcpiGbl_ReducedHardware)
{
return_ACPI_STATUS (AE_OK);
}
/*
* Initialize the Fixed and General Purpose Events. This is done prior to
* enabling SCIs to prevent interrupts from occurring before the handlers
@@ -200,6 +209,13 @@ AcpiEvInstallXruptHandlers (
ACPI_FUNCTION_TRACE (EvInstallXruptHandlers);
/* If Hardware Reduced flag is set, there is no ACPI h/w */
if (AcpiGbl_ReducedHardware)
{
return_ACPI_STATUS (AE_OK);
}
/* Install the SCI handler */
Status = AcpiEvInstallSciHandler ();
@@ -387,4 +403,6 @@ AcpiEvFixedEventDispatch (
AcpiGbl_FixedEventHandlers[Event].Context));
}
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -121,6 +121,7 @@
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evglock")
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/* Local prototypes */
@@ -151,6 +152,13 @@ AcpiEvInitGlobalLockHandler (
ACPI_FUNCTION_TRACE (EvInitGlobalLockHandler);
/* If Hardware Reduced flag is set, there is no global lock */
if (AcpiGbl_ReducedHardware)
{
return_ACPI_STATUS (AE_OK);
}
/* Attempt installation of the global lock handler */
Status = AcpiInstallFixedEventHandler (ACPI_EVENT_GLOBAL,
@@ -437,3 +445,5 @@ AcpiEvReleaseGlobalLock (
AcpiOsReleaseMutex (AcpiGbl_GlobalLockMutex->Mutex.OsMutex);
return_ACPI_STATUS (Status);
}
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -121,6 +121,8 @@
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evgpe")
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/* Local prototypes */
static void ACPI_SYSTEM_XFACE
@@ -588,6 +590,7 @@ AcpiEvAsynchExecuteGpeMethod (
ACPI_STATUS Status;
ACPI_GPE_EVENT_INFO *LocalGpeEventInfo;
ACPI_EVALUATE_INFO *Info;
ACPI_GPE_NOTIFY_INFO *Notify;
ACPI_FUNCTION_TRACE (EvAsynchExecuteGpeMethod);
@@ -643,10 +646,18 @@ AcpiEvAsynchExecuteGpeMethod (
* completes. The notify handlers are NOT invoked synchronously
* from this thread -- because handlers may in turn run other
* control methods.
*
* June 2012: Expand implicit notify mechanism to support
* notifies on multiple device objects.
*/
Status = AcpiEvQueueNotifyRequest (
LocalGpeEventInfo->Dispatch.DeviceNode,
ACPI_NOTIFY_DEVICE_WAKE);
Notify = LocalGpeEventInfo->Dispatch.NotifyList;
while (ACPI_SUCCESS (Status) && Notify)
{
Status = AcpiEvQueueNotifyRequest (Notify->DeviceNode,
ACPI_NOTIFY_DEVICE_WAKE);
Notify = Notify->Next;
}
break;
case ACPI_GPE_DISPATCH_METHOD:
@@ -898,3 +909,4 @@ AcpiEvGpeDispatch (
return_UINT32 (ACPI_INTERRUPT_HANDLED);
}
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -121,6 +121,8 @@
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evgpeblk")
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/* Local prototypes */
static ACPI_STATUS
@@ -617,3 +619,4 @@ AcpiEvInitializeGpeBlock (
return_ACPI_STATUS (AE_OK);
}
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -122,6 +122,7 @@
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evgpeinit")
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/*
* Note: History of _PRW support in ACPICA
@@ -529,3 +530,5 @@ AcpiEvMatchGpeMethod (
Name, GpeNumber));
return_ACPI_STATUS (AE_OK);
}
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -113,7 +113,6 @@
*
*****************************************************************************/
#include "acpi.h"
#include "accommon.h"
#include "acevents.h"
@@ -122,6 +121,7 @@
ACPI_MODULE_NAME ("evgpeutil")
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/*******************************************************************************
*
* FUNCTION: AcpiEvWalkGpeList
@@ -463,6 +463,8 @@ AcpiEvDeleteGpeHandlers (
void *Context)
{
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_GPE_NOTIFY_INFO *Notify;
ACPI_GPE_NOTIFY_INFO *Next;
UINT32 i;
UINT32 j;
@@ -484,13 +486,31 @@ AcpiEvDeleteGpeHandlers (
if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
ACPI_GPE_DISPATCH_HANDLER)
{
/* Delete an installed handler block */
ACPI_FREE (GpeEventInfo->Dispatch.Handler);
GpeEventInfo->Dispatch.Handler = NULL;
GpeEventInfo->Flags &= ~ACPI_GPE_DISPATCH_MASK;
}
else if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
ACPI_GPE_DISPATCH_NOTIFY)
{
/* Delete the implicit notification device list */
Notify = GpeEventInfo->Dispatch.NotifyList;
while (Notify)
{
Next = Notify->Next;
ACPI_FREE (Notify);
Notify = Next;
}
GpeEventInfo->Dispatch.NotifyList = NULL;
GpeEventInfo->Flags &= ~ACPI_GPE_DISPATCH_MASK;
}
}
}
return_ACPI_STATUS (AE_OK);
}
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -183,105 +183,82 @@ AcpiEvQueueNotifyRequest (
UINT32 NotifyValue)
{
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_OPERAND_OBJECT *HandlerObj = NULL;
ACPI_GENERIC_STATE *NotifyInfo;
ACPI_OPERAND_OBJECT *HandlerListHead = NULL;
ACPI_GENERIC_STATE *Info;
UINT8 HandlerListId = 0;
ACPI_STATUS Status = AE_OK;
ACPI_FUNCTION_NAME (EvQueueNotifyRequest);
/*
* For value 3 (Ejection Request), some device method may need to be run.
* For value 2 (Device Wake) if _PRW exists, the _PS0 method may need
* to be run.
* For value 0x80 (Status Change) on the power button or sleep button,
* initiate soft-off or sleep operation?
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Dispatching Notify on [%4.4s] Node %p Value 0x%2.2X (%s)\n",
AcpiUtGetNodeName (Node), Node, NotifyValue,
AcpiUtGetNotifyName (NotifyValue)));
/* Are Notifies allowed on this object? */
/* Get the notify object attached to the NS Node */
if (!AcpiEvIsNotifyObject (Node))
{
return (AE_TYPE);
}
/* Get the correct notify list type (System or Device) */
if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
{
HandlerListId = ACPI_SYSTEM_HANDLER_LIST;
}
else
{
HandlerListId = ACPI_DEVICE_HANDLER_LIST;
}
/* Get the notify object attached to the namespace Node */
ObjDesc = AcpiNsGetAttachedObject (Node);
if (ObjDesc)
{
/* We have the notify object, Get the right handler */
/* We have an attached object, Get the correct handler list */
switch (Node->Type)
{
/* Notify allowed only on these types */
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_THERMAL:
case ACPI_TYPE_PROCESSOR:
if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
{
HandlerObj = ObjDesc->CommonNotify.SystemNotify;
}
else
{
HandlerObj = ObjDesc->CommonNotify.DeviceNotify;
}
break;
default:
/* All other types are not supported */
return (AE_TYPE);
}
HandlerListHead = ObjDesc->CommonNotify.NotifyList[HandlerListId];
}
/*
* If there is any handler to run, schedule the dispatcher.
* Check for:
* 1) Global system notify handler
* 2) Global device notify handler
* 3) Per-device notify handler
* If there is no notify handler (Global or Local)
* for this object, just ignore the notify
*/
if ((AcpiGbl_SystemNotify.Handler &&
(NotifyValue <= ACPI_MAX_SYS_NOTIFY)) ||
(AcpiGbl_DeviceNotify.Handler &&
(NotifyValue > ACPI_MAX_SYS_NOTIFY)) ||
HandlerObj)
if (!AcpiGbl_GlobalNotify[HandlerListId].Handler && !HandlerListHead)
{
NotifyInfo = AcpiUtCreateGenericState ();
if (!NotifyInfo)
{
return (AE_NO_MEMORY);
}
if (!HandlerObj)
{
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Executing system notify handler for Notify (%4.4s, %X) "
"node %p\n",
AcpiUtGetNodeName (Node), NotifyValue, Node));
}
NotifyInfo->Common.DescriptorType = ACPI_DESC_TYPE_STATE_NOTIFY;
NotifyInfo->Notify.Node = Node;
NotifyInfo->Notify.Value = (UINT16) NotifyValue;
NotifyInfo->Notify.HandlerObj = HandlerObj;
Status = AcpiOsExecute (
OSL_NOTIFY_HANDLER, AcpiEvNotifyDispatch, NotifyInfo);
if (ACPI_FAILURE (Status))
{
AcpiUtDeleteGenericState (NotifyInfo);
}
}
else
{
/* There is no notify handler (per-device or system) for this device */
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"No notify handler for Notify (%4.4s, %X) node %p\n",
"No notify handler for Notify, ignoring (%4.4s, %X) node %p\n",
AcpiUtGetNodeName (Node), NotifyValue, Node));
return (AE_OK);
}
/* Setup notify info and schedule the notify dispatcher */
Info = AcpiUtCreateGenericState ();
if (!Info)
{
return (AE_NO_MEMORY);
}
Info->Common.DescriptorType = ACPI_DESC_TYPE_STATE_NOTIFY;
Info->Notify.Node = Node;
Info->Notify.Value = (UINT16) NotifyValue;
Info->Notify.HandlerListId = HandlerListId;
Info->Notify.HandlerListHead = HandlerListHead;
Info->Notify.Global = &AcpiGbl_GlobalNotify[HandlerListId];
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Dispatching Notify on [%4.4s] (%s) Value 0x%2.2X (%s) Node %p\n",
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type),
NotifyValue, AcpiUtGetNotifyName (NotifyValue), Node));
Status = AcpiOsExecute (OSL_NOTIFY_HANDLER, AcpiEvNotifyDispatch,
Info);
if (ACPI_FAILURE (Status))
{
AcpiUtDeleteGenericState (Info);
}
return (Status);
@@ -305,64 +282,41 @@ static void ACPI_SYSTEM_XFACE
AcpiEvNotifyDispatch (
void *Context)
{
ACPI_GENERIC_STATE *NotifyInfo = (ACPI_GENERIC_STATE *) Context;
ACPI_NOTIFY_HANDLER GlobalHandler = NULL;
void *GlobalContext = NULL;
ACPI_GENERIC_STATE *Info = (ACPI_GENERIC_STATE *) Context;
ACPI_OPERAND_OBJECT *HandlerObj;
ACPI_FUNCTION_ENTRY ();
/*
* We will invoke a global notify handler if installed. This is done
* _before_ we invoke the per-device handler attached to the device.
*/
if (NotifyInfo->Notify.Value <= ACPI_MAX_SYS_NOTIFY)
{
/* Global system notification handler */
/* Invoke a global notify handler if installed */
if (AcpiGbl_SystemNotify.Handler)
{
GlobalHandler = AcpiGbl_SystemNotify.Handler;
GlobalContext = AcpiGbl_SystemNotify.Context;
}
}
else
if (Info->Notify.Global->Handler)
{
/* Global driver notification handler */
if (AcpiGbl_DeviceNotify.Handler)
{
GlobalHandler = AcpiGbl_DeviceNotify.Handler;
GlobalContext = AcpiGbl_DeviceNotify.Context;
}
Info->Notify.Global->Handler (Info->Notify.Node,
Info->Notify.Value,
Info->Notify.Global->Context);
}
/* Invoke the system handler first, if present */
/* Now invoke the local notify handler(s) if any are installed */
if (GlobalHandler)
HandlerObj = Info->Notify.HandlerListHead;
while (HandlerObj)
{
GlobalHandler (NotifyInfo->Notify.Node, NotifyInfo->Notify.Value,
GlobalContext);
}
/* Now invoke the per-device handler, if present */
HandlerObj = NotifyInfo->Notify.HandlerObj;
if (HandlerObj)
{
HandlerObj->Notify.Handler (NotifyInfo->Notify.Node,
NotifyInfo->Notify.Value,
HandlerObj->Notify.Handler (Info->Notify.Node,
Info->Notify.Value,
HandlerObj->Notify.Context);
HandlerObj = HandlerObj->Notify.Next[Info->Notify.HandlerListId];
}
/* All done with the info object */
AcpiUtDeleteGenericState (NotifyInfo);
AcpiUtDeleteGenericState (Info);
}
#if (!ACPI_REDUCED_HARDWARE)
/******************************************************************************
*
* FUNCTION: AcpiEvTerminate
@@ -442,3 +396,5 @@ AcpiEvTerminate (
}
return_VOID;
}
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -444,6 +444,7 @@ Cleanup1:
* FUNCTION: AcpiEvAddressSpaceDispatch
*
* PARAMETERS: RegionObj - Internal region object
* FieldObj - Corresponding field. Can be NULL.
* Function - Read or Write operation
* RegionOffset - Where in the region to read or write
* BitWidth - Field width in bits (8, 16, 32, or 64)
@@ -460,6 +461,7 @@ Cleanup1:
ACPI_STATUS
AcpiEvAddressSpaceDispatch (
ACPI_OPERAND_OBJECT *RegionObj,
ACPI_OPERAND_OBJECT *FieldObj,
UINT32 Function,
UINT32 RegionOffset,
UINT32 BitWidth,
@@ -471,6 +473,7 @@ AcpiEvAddressSpaceDispatch (
ACPI_OPERAND_OBJECT *HandlerDesc;
ACPI_OPERAND_OBJECT *RegionObj2;
void *RegionContext = NULL;
ACPI_CONNECTION_INFO *Context;
ACPI_FUNCTION_TRACE (EvAddressSpaceDispatch);
@@ -495,6 +498,8 @@ AcpiEvAddressSpaceDispatch (
return_ACPI_STATUS (AE_NOT_EXIST);
}
Context = HandlerDesc->AddressSpace.Context;
/*
* It may be the case that the region has never been initialized.
* Some types of regions require special init code
@@ -522,7 +527,7 @@ AcpiEvAddressSpaceDispatch (
AcpiExExitInterpreter ();
Status = RegionSetup (RegionObj, ACPI_REGION_ACTIVATE,
HandlerDesc->AddressSpace.Context, &RegionContext);
Context, &RegionContext);
/* Re-enter the interpreter */
@@ -571,6 +576,27 @@ AcpiEvAddressSpaceDispatch (
ACPI_FORMAT_NATIVE_UINT (RegionObj->Region.Address + RegionOffset),
AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
/*
* Special handling for GenericSerialBus and GeneralPurposeIo:
* There are three extra parameters that must be passed to the
* handler via the context:
* 1) Connection buffer, a resource template from Connection() op.
* 2) Length of the above buffer.
* 3) Actual access length from the AccessAs() op.
*/
if (((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) ||
(RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO)) &&
Context &&
FieldObj)
{
/* Get the Connection (ResourceTemplate) buffer */
Context->Connection = FieldObj->Field.ResourceBuffer;
Context->Length = FieldObj->Field.ResourceLength;
Context->AccessLength = FieldObj->Field.AccessLength;
}
if (!(HandlerDesc->AddressSpace.HandlerFlags &
ACPI_ADDR_HANDLER_DEFAULT_INSTALLED))
{
@@ -586,7 +612,7 @@ AcpiEvAddressSpaceDispatch (
Status = Handler (Function,
(RegionObj->Region.Address + RegionOffset), BitWidth, Value,
HandlerDesc->AddressSpace.Context, RegionObj2->Extra.RegionContext);
Context, RegionObj2->Extra.RegionContext);
if (ACPI_FAILURE (Status))
{
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -123,6 +123,8 @@
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evsci")
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/* Local prototypes */
static UINT32 ACPI_SYSTEM_XFACE
@@ -277,4 +279,4 @@ AcpiEvRemoveSciHandler (
return_ACPI_STATUS (Status);
}
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -126,6 +126,335 @@
ACPI_MODULE_NAME ("evxface")
/*******************************************************************************
*
* FUNCTION: AcpiInstallNotifyHandler
*
* PARAMETERS: Device - The device for which notifies will be handled
* HandlerType - The type of handler:
* ACPI_SYSTEM_NOTIFY: System Handler (00-7F)
* ACPI_DEVICE_NOTIFY: Device Handler (80-FF)
* ACPI_ALL_NOTIFY: Both System and Device
* Handler - Address of the handler
* Context - Value passed to the handler on each GPE
*
* RETURN: Status
*
* DESCRIPTION: Install a handler for notifications on an ACPI Device,
* ThermalZone, or Processor object.
*
* NOTES: The Root namespace object may have only one handler for each
* type of notify (System/Device). Device/Thermal/Processor objects
* may have one device notify handler, and multiple system notify
* handlers.
*
******************************************************************************/
ACPI_STATUS
AcpiInstallNotifyHandler (
ACPI_HANDLE Device,
UINT32 HandlerType,
ACPI_NOTIFY_HANDLER Handler,
void *Context)
{
ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Device);
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_OPERAND_OBJECT *HandlerObj;
ACPI_STATUS Status;
UINT32 i;
ACPI_FUNCTION_TRACE (AcpiInstallNotifyHandler);
/* Parameter validation */
if ((!Device) || (!Handler) || (!HandlerType) ||
(HandlerType > ACPI_MAX_NOTIFY_HANDLER_TYPE))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/*
* Root Object:
* Registering a notify handler on the root object indicates that the
* caller wishes to receive notifications for all objects. Note that
* only one global handler can be registered per notify type.
* Ensure that a handler is not already installed.
*/
if (Device == ACPI_ROOT_OBJECT)
{
for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++)
{
if (HandlerType & (i+1))
{
if (AcpiGbl_GlobalNotify[i].Handler)
{
Status = AE_ALREADY_EXISTS;
goto UnlockAndExit;
}
AcpiGbl_GlobalNotify[i].Handler = Handler;
AcpiGbl_GlobalNotify[i].Context = Context;
}
}
goto UnlockAndExit; /* Global notify handler installed, all done */
}
/*
* All Other Objects:
* Caller will only receive notifications specific to the target
* object. Note that only certain object types are allowed to
* receive notifications.
*/
/* Are Notifies allowed on this object? */
if (!AcpiEvIsNotifyObject (Node))
{
Status = AE_TYPE;
goto UnlockAndExit;
}
/* Check for an existing internal object, might not exist */
ObjDesc = AcpiNsGetAttachedObject (Node);
if (!ObjDesc)
{
/* Create a new object */
ObjDesc = AcpiUtCreateInternalObject (Node->Type);
if (!ObjDesc)
{
Status = AE_NO_MEMORY;
goto UnlockAndExit;
}
/* Attach new object to the Node, remove local reference */
Status = AcpiNsAttachObject (Device, ObjDesc, Node->Type);
AcpiUtRemoveReference (ObjDesc);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
}
}
/* Ensure that the handler is not already installed in the lists */
for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++)
{
if (HandlerType & (i+1))
{
HandlerObj = ObjDesc->CommonNotify.NotifyList[i];
while (HandlerObj)
{
if (HandlerObj->Notify.Handler == Handler)
{
Status = AE_ALREADY_EXISTS;
goto UnlockAndExit;
}
HandlerObj = HandlerObj->Notify.Next[i];
}
}
}
/* Create and populate a new notify handler object */
HandlerObj = AcpiUtCreateInternalObject (ACPI_TYPE_LOCAL_NOTIFY);
if (!HandlerObj)
{
Status = AE_NO_MEMORY;
goto UnlockAndExit;
}
HandlerObj->Notify.Node = Node;
HandlerObj->Notify.HandlerType = HandlerType;
HandlerObj->Notify.Handler = Handler;
HandlerObj->Notify.Context = Context;
/* Install the handler at the list head(s) */
for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++)
{
if (HandlerType & (i+1))
{
HandlerObj->Notify.Next[i] =
ObjDesc->CommonNotify.NotifyList[i];
ObjDesc->CommonNotify.NotifyList[i] = HandlerObj;
}
}
/* Add an extra reference if handler was installed in both lists */
if (HandlerType == ACPI_ALL_NOTIFY)
{
AcpiUtAddReference (HandlerObj);
}
UnlockAndExit:
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (Status);
}
ACPI_EXPORT_SYMBOL (AcpiInstallNotifyHandler)
/*******************************************************************************
*
* FUNCTION: AcpiRemoveNotifyHandler
*
* PARAMETERS: Device - The device for which the handler is installed
* HandlerType - The type of handler:
* ACPI_SYSTEM_NOTIFY: System Handler (00-7F)
* ACPI_DEVICE_NOTIFY: Device Handler (80-FF)
* ACPI_ALL_NOTIFY: Both System and Device
* Handler - Address of the handler
*
* RETURN: Status
*
* DESCRIPTION: Remove a handler for notifies on an ACPI device
*
******************************************************************************/
ACPI_STATUS
AcpiRemoveNotifyHandler (
ACPI_HANDLE Device,
UINT32 HandlerType,
ACPI_NOTIFY_HANDLER Handler)
{
ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Device);
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_OPERAND_OBJECT *HandlerObj;
ACPI_OPERAND_OBJECT *PreviousHandlerObj;
ACPI_STATUS Status;
UINT32 i;
ACPI_FUNCTION_TRACE (AcpiRemoveNotifyHandler);
/* Parameter validation */
if ((!Device) || (!Handler) || (!HandlerType) ||
(HandlerType > ACPI_MAX_NOTIFY_HANDLER_TYPE))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/* Make sure all deferred notify tasks are completed */
AcpiOsWaitEventsComplete ();
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* Root Object. Global handlers are removed here */
if (Device == ACPI_ROOT_OBJECT)
{
for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++)
{
if (HandlerType & (i+1))
{
if (!AcpiGbl_GlobalNotify[i].Handler ||
(AcpiGbl_GlobalNotify[i].Handler != Handler))
{
Status = AE_NOT_EXIST;
goto UnlockAndExit;
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Removing global notify handler\n"));
AcpiGbl_GlobalNotify[i].Handler = NULL;
AcpiGbl_GlobalNotify[i].Context = NULL;
}
}
goto UnlockAndExit;
}
/* All other objects: Are Notifies allowed on this object? */
if (!AcpiEvIsNotifyObject (Node))
{
Status = AE_TYPE;
goto UnlockAndExit;
}
/* Must have an existing internal object */
ObjDesc = AcpiNsGetAttachedObject (Node);
if (!ObjDesc)
{
Status = AE_NOT_EXIST;
goto UnlockAndExit;
}
/* Internal object exists. Find the handler and remove it */
for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++)
{
if (HandlerType & (i+1))
{
HandlerObj = ObjDesc->CommonNotify.NotifyList[i];
PreviousHandlerObj = NULL;
/* Attempt to find the handler in the handler list */
while (HandlerObj &&
(HandlerObj->Notify.Handler != Handler))
{
PreviousHandlerObj = HandlerObj;
HandlerObj = HandlerObj->Notify.Next[i];
}
if (!HandlerObj)
{
Status = AE_NOT_EXIST;
goto UnlockAndExit;
}
/* Remove the handler object from the list */
if (PreviousHandlerObj) /* Handler is not at the list head */
{
PreviousHandlerObj->Notify.Next[i] =
HandlerObj->Notify.Next[i];
}
else /* Handler is at the list head */
{
ObjDesc->CommonNotify.NotifyList[i] =
HandlerObj->Notify.Next[i];
}
AcpiUtRemoveReference (HandlerObj);
}
}
UnlockAndExit:
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (Status);
}
ACPI_EXPORT_SYMBOL (AcpiRemoveNotifyHandler)
/*******************************************************************************
*
* FUNCTION: AcpiInstallExceptionHandler
@@ -175,6 +504,7 @@ Cleanup:
ACPI_EXPORT_SYMBOL (AcpiInstallExceptionHandler)
#if (!ACPI_REDUCED_HARDWARE)
/*******************************************************************************
*
* FUNCTION: AcpiInstallGlobalEventHandler
@@ -377,357 +707,6 @@ AcpiRemoveFixedEventHandler (
ACPI_EXPORT_SYMBOL (AcpiRemoveFixedEventHandler)
/*******************************************************************************
*
* FUNCTION: AcpiInstallNotifyHandler
*
* PARAMETERS: Device - The device for which notifies will be handled
* HandlerType - The type of handler:
* ACPI_SYSTEM_NOTIFY: SystemHandler (00-7f)
* ACPI_DEVICE_NOTIFY: DriverHandler (80-ff)
* ACPI_ALL_NOTIFY: both system and device
* Handler - Address of the handler
* Context - Value passed to the handler on each GPE
*
* RETURN: Status
*
* DESCRIPTION: Install a handler for notifies on an ACPI device
*
******************************************************************************/
ACPI_STATUS
AcpiInstallNotifyHandler (
ACPI_HANDLE Device,
UINT32 HandlerType,
ACPI_NOTIFY_HANDLER Handler,
void *Context)
{
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_OPERAND_OBJECT *NotifyObj;
ACPI_NAMESPACE_NODE *Node;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (AcpiInstallNotifyHandler);
/* Parameter validation */
if ((!Device) ||
(!Handler) ||
(HandlerType > ACPI_MAX_NOTIFY_HANDLER_TYPE))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* Convert and validate the device handle */
Node = AcpiNsValidateHandle (Device);
if (!Node)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
/*
* Root Object:
* Registering a notify handler on the root object indicates that the
* caller wishes to receive notifications for all objects. Note that
* only one <external> global handler can be regsitered (per notify type).
*/
if (Device == ACPI_ROOT_OBJECT)
{
/* Make sure the handler is not already installed */
if (((HandlerType & ACPI_SYSTEM_NOTIFY) &&
AcpiGbl_SystemNotify.Handler) ||
((HandlerType & ACPI_DEVICE_NOTIFY) &&
AcpiGbl_DeviceNotify.Handler))
{
Status = AE_ALREADY_EXISTS;
goto UnlockAndExit;
}
if (HandlerType & ACPI_SYSTEM_NOTIFY)
{
AcpiGbl_SystemNotify.Node = Node;
AcpiGbl_SystemNotify.Handler = Handler;
AcpiGbl_SystemNotify.Context = Context;
}
if (HandlerType & ACPI_DEVICE_NOTIFY)
{
AcpiGbl_DeviceNotify.Node = Node;
AcpiGbl_DeviceNotify.Handler = Handler;
AcpiGbl_DeviceNotify.Context = Context;
}
/* Global notify handler installed */
}
/*
* All Other Objects:
* Caller will only receive notifications specific to the target object.
* Note that only certain object types can receive notifications.
*/
else
{
/* Notifies allowed on this object? */
if (!AcpiEvIsNotifyObject (Node))
{
Status = AE_TYPE;
goto UnlockAndExit;
}
/* Check for an existing internal object */
ObjDesc = AcpiNsGetAttachedObject (Node);
if (ObjDesc)
{
/* Object exists - make sure there's no handler */
if (((HandlerType & ACPI_SYSTEM_NOTIFY) &&
ObjDesc->CommonNotify.SystemNotify) ||
((HandlerType & ACPI_DEVICE_NOTIFY) &&
ObjDesc->CommonNotify.DeviceNotify))
{
Status = AE_ALREADY_EXISTS;
goto UnlockAndExit;
}
}
else
{
/* Create a new object */
ObjDesc = AcpiUtCreateInternalObject (Node->Type);
if (!ObjDesc)
{
Status = AE_NO_MEMORY;
goto UnlockAndExit;
}
/* Attach new object to the Node */
Status = AcpiNsAttachObject (Device, ObjDesc, Node->Type);
/* Remove local reference to the object */
AcpiUtRemoveReference (ObjDesc);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
}
}
/* Install the handler */
NotifyObj = AcpiUtCreateInternalObject (ACPI_TYPE_LOCAL_NOTIFY);
if (!NotifyObj)
{
Status = AE_NO_MEMORY;
goto UnlockAndExit;
}
NotifyObj->Notify.Node = Node;
NotifyObj->Notify.Handler = Handler;
NotifyObj->Notify.Context = Context;
if (HandlerType & ACPI_SYSTEM_NOTIFY)
{
ObjDesc->CommonNotify.SystemNotify = NotifyObj;
}
if (HandlerType & ACPI_DEVICE_NOTIFY)
{
ObjDesc->CommonNotify.DeviceNotify = NotifyObj;
}
if (HandlerType == ACPI_ALL_NOTIFY)
{
/* Extra ref if installed in both */
AcpiUtAddReference (NotifyObj);
}
}
UnlockAndExit:
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (Status);
}
ACPI_EXPORT_SYMBOL (AcpiInstallNotifyHandler)
/*******************************************************************************
*
* FUNCTION: AcpiRemoveNotifyHandler
*
* PARAMETERS: Device - The device for which notifies will be handled
* HandlerType - The type of handler:
* ACPI_SYSTEM_NOTIFY: SystemHandler (00-7f)
* ACPI_DEVICE_NOTIFY: DriverHandler (80-ff)
* ACPI_ALL_NOTIFY: both system and device
* Handler - Address of the handler
*
* RETURN: Status
*
* DESCRIPTION: Remove a handler for notifies on an ACPI device
*
******************************************************************************/
ACPI_STATUS
AcpiRemoveNotifyHandler (
ACPI_HANDLE Device,
UINT32 HandlerType,
ACPI_NOTIFY_HANDLER Handler)
{
ACPI_OPERAND_OBJECT *NotifyObj;
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_NAMESPACE_NODE *Node;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (AcpiRemoveNotifyHandler);
/* Parameter validation */
if ((!Device) ||
(!Handler) ||
(HandlerType > ACPI_MAX_NOTIFY_HANDLER_TYPE))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* Convert and validate the device handle */
Node = AcpiNsValidateHandle (Device);
if (!Node)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
/* Root Object */
if (Device == ACPI_ROOT_OBJECT)
{
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Removing notify handler for namespace root object\n"));
if (((HandlerType & ACPI_SYSTEM_NOTIFY) &&
!AcpiGbl_SystemNotify.Handler) ||
((HandlerType & ACPI_DEVICE_NOTIFY) &&
!AcpiGbl_DeviceNotify.Handler))
{
Status = AE_NOT_EXIST;
goto UnlockAndExit;
}
if (HandlerType & ACPI_SYSTEM_NOTIFY)
{
AcpiGbl_SystemNotify.Node = NULL;
AcpiGbl_SystemNotify.Handler = NULL;
AcpiGbl_SystemNotify.Context = NULL;
}
if (HandlerType & ACPI_DEVICE_NOTIFY)
{
AcpiGbl_DeviceNotify.Node = NULL;
AcpiGbl_DeviceNotify.Handler = NULL;
AcpiGbl_DeviceNotify.Context = NULL;
}
}
/* All Other Objects */
else
{
/* Notifies allowed on this object? */
if (!AcpiEvIsNotifyObject (Node))
{
Status = AE_TYPE;
goto UnlockAndExit;
}
/* Check for an existing internal object */
ObjDesc = AcpiNsGetAttachedObject (Node);
if (!ObjDesc)
{
Status = AE_NOT_EXIST;
goto UnlockAndExit;
}
/* Object exists - make sure there's an existing handler */
if (HandlerType & ACPI_SYSTEM_NOTIFY)
{
NotifyObj = ObjDesc->CommonNotify.SystemNotify;
if (!NotifyObj)
{
Status = AE_NOT_EXIST;
goto UnlockAndExit;
}
if (NotifyObj->Notify.Handler != Handler)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
/* Remove the handler */
ObjDesc->CommonNotify.SystemNotify = NULL;
AcpiUtRemoveReference (NotifyObj);
}
if (HandlerType & ACPI_DEVICE_NOTIFY)
{
NotifyObj = ObjDesc->CommonNotify.DeviceNotify;
if (!NotifyObj)
{
Status = AE_NOT_EXIST;
goto UnlockAndExit;
}
if (NotifyObj->Notify.Handler != Handler)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
/* Remove the handler */
ObjDesc->CommonNotify.DeviceNotify = NULL;
AcpiUtRemoveReference (NotifyObj);
}
}
UnlockAndExit:
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (Status);
}
ACPI_EXPORT_SYMBOL (AcpiRemoveNotifyHandler)
/*******************************************************************************
*
* FUNCTION: AcpiInstallGpeHandler
@@ -893,6 +872,10 @@ AcpiRemoveGpeHandler (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/* Make sure all deferred GPE tasks are completed */
AcpiOsWaitEventsComplete ();
Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
if (ACPI_FAILURE (Status))
{
@@ -1047,3 +1030,4 @@ AcpiReleaseGlobalLock (
ACPI_EXPORT_SYMBOL (AcpiReleaseGlobalLock)
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -124,6 +124,7 @@
ACPI_MODULE_NAME ("evxfevnt")
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/*******************************************************************************
*
* FUNCTION: AcpiEnable
@@ -449,4 +450,4 @@ AcpiGetEventStatus (
ACPI_EXPORT_SYMBOL (AcpiGetEventStatus)
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -125,6 +125,7 @@
ACPI_MODULE_NAME ("evxfgpe")
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/*******************************************************************************
*
* FUNCTION: AcpiUpdateAllGpes
@@ -154,7 +155,7 @@ AcpiUpdateAllGpes (
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (AcpiUpdateGpes);
ACPI_FUNCTION_TRACE (AcpiUpdateAllGpes);
Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
@@ -366,9 +367,11 @@ AcpiSetupGpeForWake (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber)
{
ACPI_STATUS Status = AE_BAD_PARAMETER;
ACPI_STATUS Status;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_NAMESPACE_NODE *DeviceNode;
ACPI_GPE_NOTIFY_INFO *Notify;
ACPI_GPE_NOTIFY_INFO *NewNotify;
ACPI_CPU_FLAGS Flags;
@@ -404,32 +407,88 @@ AcpiSetupGpeForWake (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/*
* Allocate a new notify object up front, in case it is needed.
* Memory allocation while holding a spinlock is a big no-no
* on some hosts.
*/
NewNotify = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_NOTIFY_INFO));
if (!NewNotify)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
/* Ensure that we have a valid GPE number */
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (GpeEventInfo)
if (!GpeEventInfo)
{
/*
* If there is no method or handler for this GPE, then the
* WakeDevice will be notified whenever this GPE fires (aka
* "implicit notify") Note: The GPE is assumed to be
* level-triggered (for windows compatibility).
*/
if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
ACPI_GPE_DISPATCH_NONE)
{
GpeEventInfo->Flags =
(ACPI_GPE_DISPATCH_NOTIFY | ACPI_GPE_LEVEL_TRIGGERED);
GpeEventInfo->Dispatch.DeviceNode = DeviceNode;
}
GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE;
Status = AE_OK;
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
/*
* If there is no method or handler for this GPE, then the
* WakeDevice will be notified whenever this GPE fires. This is
* known as an "implicit notify". Note: The GPE is assumed to be
* level-triggered (for windows compatibility).
*/
if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
ACPI_GPE_DISPATCH_NONE)
{
/*
* This is the first device for implicit notify on this GPE.
* Just set the flags here, and enter the NOTIFY block below.
*/
GpeEventInfo->Flags =
(ACPI_GPE_DISPATCH_NOTIFY | ACPI_GPE_LEVEL_TRIGGERED);
}
/*
* If we already have an implicit notify on this GPE, add
* this device to the notify list.
*/
if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
ACPI_GPE_DISPATCH_NOTIFY)
{
/* Ensure that the device is not already in the list */
Notify = GpeEventInfo->Dispatch.NotifyList;
while (Notify)
{
if (Notify->DeviceNode == DeviceNode)
{
Status = AE_ALREADY_EXISTS;
goto UnlockAndExit;
}
Notify = Notify->Next;
}
/* Add this device to the notify list for this GPE */
NewNotify->DeviceNode = DeviceNode;
NewNotify->Next = GpeEventInfo->Dispatch.NotifyList;
GpeEventInfo->Dispatch.NotifyList = NewNotify;
NewNotify = NULL;
}
/* Mark the GPE as a possible wake event */
GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE;
Status = AE_OK;
UnlockAndExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
/* Delete the notify object if it was not used above */
if (NewNotify)
{
ACPI_FREE (NewNotify);
}
return_ACPI_STATUS (Status);
}
@@ -970,3 +1029,5 @@ AcpiGetGpeDevice (
}
ACPI_EXPORT_SYMBOL (AcpiGetGpeDevice)
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -252,7 +252,7 @@ AcpiExLoadTableOp (
ACPI_FUNCTION_TRACE (ExLoadTableOp);
/* Validate lengths for the SignatureString, OEMIDString, OEMTableID */
/* Validate lengths for the Signature, OemId, and OemTableId strings */
if ((Operand[0]->String.Length > ACPI_NAME_SIZE) ||
(Operand[1]->String.Length > ACPI_OEM_ID_SIZE) ||
@@ -407,7 +407,7 @@ AcpiExRegionRead (
for (i = 0; i < Length; i++)
{
Status = AcpiEvAddressSpaceDispatch (ObjDesc, ACPI_READ,
Status = AcpiEvAddressSpaceDispatch (ObjDesc, NULL, ACPI_READ,
RegionOffset, 8, &Value);
if (ACPI_FAILURE (Status))
{
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -357,7 +357,7 @@ Cleanup:
*
* PARAMETERS: AmlStart - Pointer to the region declaration AML
* AmlLength - Max length of the declaration AML
* RegionSpace - SpaceID for the region
* SpaceId - Address space ID for the region
* WalkState - Current state
*
* RETURN: Status
@@ -370,7 +370,7 @@ ACPI_STATUS
AcpiExCreateRegion (
UINT8 *AmlStart,
UINT32 AmlLength,
UINT8 RegionSpace,
UINT8 SpaceId,
ACPI_WALK_STATE *WalkState)
{
ACPI_STATUS Status;
@@ -399,16 +399,18 @@ AcpiExCreateRegion (
* Space ID must be one of the predefined IDs, or in the user-defined
* range
*/
if ((RegionSpace >= ACPI_NUM_PREDEFINED_REGIONS) &&
(RegionSpace < ACPI_USER_REGION_BEGIN) &&
(RegionSpace != ACPI_ADR_SPACE_DATA_TABLE))
if (!AcpiIsValidSpaceId (SpaceId))
{
ACPI_ERROR ((AE_INFO, "Invalid AddressSpace type 0x%X", RegionSpace));
return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID);
/*
* Print an error message, but continue. We don't want to abort
* a table load for this exception. Instead, if the region is
* actually used at runtime, abort the executing method.
*/
ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId));
}
ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Region Type - %s (0x%X)\n",
AcpiUtGetRegionName (RegionSpace), RegionSpace));
AcpiUtGetRegionName (SpaceId), SpaceId));
/* Create the region descriptor */
@@ -426,10 +428,18 @@ AcpiExCreateRegion (
RegionObj2 = ObjDesc->Common.NextObject;
RegionObj2->Extra.AmlStart = AmlStart;
RegionObj2->Extra.AmlLength = AmlLength;
if (WalkState->ScopeInfo)
{
RegionObj2->Extra.ScopeNode = WalkState->ScopeInfo->Scope.Node;
}
else
{
RegionObj2->Extra.ScopeNode = Node;
}
/* Init the region from the operands */
ObjDesc->Region.SpaceId = RegionSpace;
ObjDesc->Region.SpaceId = SpaceId;
ObjDesc->Region.Address = 0;
ObjDesc->Region.Length = 0;
ObjDesc->Region.Node = Node;
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -203,8 +203,8 @@ static ACPI_EXDUMP_INFO AcpiExDumpDevice[4] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpDevice), NULL},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.Handler), "Handler"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.SystemNotify), "System Notify"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.DeviceNotify), "Device Notify"}
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.NotifyList[0]), "System Notify"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.NotifyList[1]), "Device Notify"}
};
static ACPI_EXDUMP_INFO AcpiExDumpEvent[2] =
@@ -251,8 +251,8 @@ static ACPI_EXDUMP_INFO AcpiExDumpPower[5] =
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpPower), NULL},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (PowerResource.SystemLevel), "System Level"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (PowerResource.ResourceOrder), "Resource Order"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.SystemNotify), "System Notify"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.DeviceNotify), "Device Notify"}
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.NotifyList[0]), "System Notify"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.NotifyList[1]), "Device Notify"}
};
static ACPI_EXDUMP_INFO AcpiExDumpProcessor[7] =
@@ -261,16 +261,16 @@ static ACPI_EXDUMP_INFO AcpiExDumpProcessor[7] =
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Processor.ProcId), "Processor ID"},
{ACPI_EXD_UINT8 , ACPI_EXD_OFFSET (Processor.Length), "Length"},
{ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET (Processor.Address), "Address"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.SystemNotify), "System Notify"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.DeviceNotify), "Device Notify"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.NotifyList[0]), "System Notify"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.NotifyList[1]), "Device Notify"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.Handler), "Handler"}
};
static ACPI_EXDUMP_INFO AcpiExDumpThermal[4] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpThermal), NULL},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.SystemNotify), "System Notify"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.DeviceNotify), "Device Notify"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.NotifyList[0]), "System Notify"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.NotifyList[1]), "Device Notify"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.Handler), "Handler"}
};
@@ -281,11 +281,13 @@ static ACPI_EXDUMP_INFO AcpiExDumpBufferField[3] =
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (BufferField.BufferObj), "Buffer Object"}
};
static ACPI_EXDUMP_INFO AcpiExDumpRegionField[3] =
static ACPI_EXDUMP_INFO AcpiExDumpRegionField[5] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegionField), NULL},
{ACPI_EXD_FIELD, 0, NULL},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.RegionObj), "Region Object"}
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Field.AccessLength), "AccessLength"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.RegionObj), "Region Object"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.ResourceBuffer), "ResourceBuffer"}
};
static ACPI_EXDUMP_INFO AcpiExDumpBankField[5] =
@@ -328,11 +330,15 @@ static ACPI_EXDUMP_INFO AcpiExDumpAddressHandler[6] =
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.Context), "Context"}
};
static ACPI_EXDUMP_INFO AcpiExDumpNotify[3] =
static ACPI_EXDUMP_INFO AcpiExDumpNotify[7] =
{
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpNotify), NULL},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Node), "Node"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Context), "Context"}
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Notify.HandlerType), "Handler Type"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Handler), "Handler"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Context), "Context"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Next[0]), "Next System Notify"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Next[1]), "Next Device Notify"}
};
@@ -1071,10 +1077,7 @@ AcpiExDumpPackageObj (
case ACPI_TYPE_STRING:
AcpiOsPrintf ("[String] Value: ");
for (i = 0; i < ObjDesc->String.Length; i++)
{
AcpiOsPrintf ("%c", ObjDesc->String.Pointer[i]);
}
AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX);
AcpiOsPrintf ("\n");
break;
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -185,19 +185,25 @@ 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_GSBUS ||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI))
{
/*
* This is an SMBus or IPMI read. We must create a buffer to hold
* This is an SMBus, GSBus 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
* Note: SMBus and GSBus protocol value is passed in upper 16-bits of Function
*/
if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS)
{
Length = ACPI_SMBUS_BUFFER_SIZE;
Function = ACPI_READ | (ObjDesc->Field.Attribute << 16);
}
else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
{
Length = ACPI_GSBUS_BUFFER_SIZE;
Function = ACPI_READ | (ObjDesc->Field.Attribute << 16);
}
else /* IPMI */
{
Length = ACPI_IPMI_BUFFER_SIZE;
@@ -346,23 +352,24 @@ 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_GSBUS ||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI))
{
/*
* This is an SMBus or IPMI write. We will bypass the entire field
* This is an SMBus, GSBus 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 or ACPI_IPMI_BUFFER_SIZE.
* ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or ACPI_IPMI_BUFFER_SIZE.
*
* Note: SMBus protocol type is passed in upper 16-bits of Function
* Note: SMBus and GSBus protocol type is passed in upper 16-bits of Function
*/
if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER)
{
ACPI_ERROR ((AE_INFO,
"SMBus or IPMI write requires Buffer, found type %s",
"SMBus/IPMI/GenericSerialBus write requires Buffer, found type %s",
AcpiUtGetObjectTypeName (SourceDesc)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
@@ -373,6 +380,11 @@ AcpiExWriteDataToField (
Length = ACPI_SMBUS_BUFFER_SIZE;
Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16);
}
else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
{
Length = ACPI_GSBUS_BUFFER_SIZE;
Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16);
}
else /* IPMI */
{
Length = ACPI_IPMI_BUFFER_SIZE;
@@ -382,7 +394,7 @@ AcpiExWriteDataToField (
if (SourceDesc->Buffer.Length < Length)
{
ACPI_ERROR ((AE_INFO,
"SMBus or IPMI write requires Buffer of length %u, found length %u",
"SMBus/IPMI/GenericSerialBus write requires Buffer of length %u, found length %u",
Length, SourceDesc->Buffer.Length));
return_ACPI_STATUS (AE_AML_BUFFER_LIMIT);
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -170,6 +170,7 @@ AcpiExSetupRegion (
{
ACPI_STATUS Status = AE_OK;
ACPI_OPERAND_OBJECT *RgnDesc;
UINT8 SpaceId;
ACPI_FUNCTION_TRACE_U32 (ExSetupRegion, FieldDatumByteOffset);
@@ -188,6 +189,16 @@ AcpiExSetupRegion (
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
SpaceId = RgnDesc->Region.SpaceId;
/* Validate the Space ID */
if (!AcpiIsValidSpaceId (SpaceId))
{
ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId));
return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID);
}
/*
* If the Region Address and Length have not been previously evaluated,
* evaluate them now and save the results.
@@ -202,11 +213,12 @@ AcpiExSetupRegion (
}
/*
* Exit now for SMBus or IPMI address space, it has a non-linear
* Exit now for SMBus, GSBus 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 ||
RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_IPMI)
if (SpaceId == ACPI_ADR_SPACE_SMBUS ||
SpaceId == ACPI_ADR_SPACE_GSBUS ||
SpaceId == ACPI_ADR_SPACE_IPMI)
{
/* SMBus or IPMI has a non-linear address space */
@@ -362,7 +374,8 @@ AcpiExAccessRegion (
/* Invoke the appropriate AddressSpace/OpRegion handler */
Status = AcpiEvAddressSpaceDispatch (RgnDesc, Function, RegionOffset,
Status = AcpiEvAddressSpaceDispatch (RgnDesc, ObjDesc,
Function, RegionOffset,
ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth), Value);
if (ACPI_FAILURE (Status))
@@ -425,6 +438,11 @@ AcpiExRegisterOverflow (
* The Value is larger than the maximum value that can fit into
* the register.
*/
ACPI_ERROR ((AE_INFO,
"Index value 0x%8.8X%8.8X overflows field width 0x%X",
ACPI_FORMAT_UINT64 (Value),
ObjDesc->CommonField.BitLength));
return (TRUE);
}
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -121,6 +121,7 @@
#include "acinterp.h"
#include "amlcode.h"
#include "acnamesp.h"
#include "acdispat.h"
#define _COMPONENT ACPI_EXECUTER
@@ -489,8 +490,8 @@ AcpiExPrepCommonFieldObject (
*
* RETURN: Status
*
* DESCRIPTION: Construct an ACPI_OPERAND_OBJECT of type DefField and
* connect it to the parent Node.
* DESCRIPTION: Construct an object of type ACPI_OPERAND_OBJECT with a
* subtype of DefField and connect it to the parent Node.
*
******************************************************************************/
@@ -556,6 +557,32 @@ AcpiExPrepFieldValue (
ObjDesc->Field.RegionObj = AcpiNsGetAttachedObject (Info->RegionNode);
/* Fields specific to GenericSerialBus fields */
ObjDesc->Field.AccessLength = Info->AccessLength;
if (Info->ConnectionNode)
{
SecondDesc = Info->ConnectionNode->Object;
if (!(SecondDesc->Common.Flags & AOPOBJ_DATA_VALID))
{
Status = AcpiDsGetBufferArguments (SecondDesc);
if (ACPI_FAILURE (Status))
{
AcpiUtDeleteObjectDesc (ObjDesc);
return_ACPI_STATUS (Status);
}
}
ObjDesc->Field.ResourceBuffer = SecondDesc->Buffer.Pointer;
ObjDesc->Field.ResourceLength = (UINT16) SecondDesc->Buffer.Length;
}
else if (Info->ResourceBuffer)
{
ObjDesc->Field.ResourceBuffer = Info->ResourceBuffer;
ObjDesc->Field.ResourceLength = Info->ResourceLength;
}
/* Allow full data read from EC address space */
if ((ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) &&
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -237,7 +237,7 @@ AcpiExResolveObjectToValue (
StackDesc = *StackPtr;
/* This is an ACPI_OPERAND_OBJECT */
/* This is an object of type ACPI_OPERAND_OBJECT */
switch (StackDesc->Common.Type)
{
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -140,15 +140,15 @@ AcpiExStoreObjectToIndex (
* FUNCTION: AcpiExStore
*
* PARAMETERS: *SourceDesc - Value to be stored
* *DestDesc - Where to store it. Must be an NS node
* or an ACPI_OPERAND_OBJECT of type
* *DestDesc - Where to store it. Must be an NS node
* or ACPI_OPERAND_OBJECT of type
* Reference;
* WalkState - Current walk state
*
* RETURN: Status
*
* DESCRIPTION: Store the value described by SourceDesc into the location
* described by DestDesc. Called by various interpreter
* described by DestDesc. Called by various interpreter
* functions to store the result of an operation into
* the destination operand -- not just simply the actual "Store"
* ASL operator.
@@ -10,7 +10,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -193,7 +193,7 @@ AcpiExEnterInterpreter (
*
* DESCRIPTION: Reacquire the interpreter execution region from within the
* interpreter code. Failure to enter the interpreter region is a
* fatal system error. Used in conjuction with
* fatal system error. Used in conjunction with
* RelinquishInterpreter
*
******************************************************************************/
@@ -571,4 +571,34 @@ AcpiExIntegerToString (
}
}
/*******************************************************************************
*
* FUNCTION: AcpiIsValidSpaceId
*
* PARAMETERS: SpaceId - ID to be validated
*
* RETURN: TRUE if valid/supported ID.
*
* DESCRIPTION: Validate an operation region SpaceID.
*
******************************************************************************/
BOOLEAN
AcpiIsValidSpaceId (
UINT8 SpaceId)
{
if ((SpaceId >= ACPI_NUM_PREDEFINED_REGIONS) &&
(SpaceId < ACPI_USER_REGION_BEGIN) &&
(SpaceId != ACPI_ADR_SPACE_DATA_TABLE) &&
(SpaceId != ACPI_ADR_SPACE_FIXED_HARDWARE))
{
return (FALSE);
}
return (TRUE);
}
#endif
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -124,6 +124,7 @@
ACPI_MODULE_NAME ("hwacpi")
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/******************************************************************************
*
* FUNCTION: AcpiHwSetMode
@@ -276,3 +277,5 @@ AcpiHwGetMode (
return_UINT32 (ACPI_SYS_MODE_LEGACY);
}
}
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -0,0 +1,349 @@
/******************************************************************************
*
* Name: hwesleep.c - ACPI Hardware Sleep/Wake Support functions for the
* extended FADT-V5 sleep registers.
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
*
* 2.1. This is your license from Intel Corp. under its intellectual property
* rights. You may have additional license terms from the party that provided
* you this software, covering your right to use that party's intellectual
* property rights.
*
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
* copy of the source code appearing in this file ("Covered Code") an
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
* base code distributed originally by Intel ("Original Intel Code") to copy,
* make derivatives, distribute, use and display any portion of the Covered
* Code in any form, with the right to sublicense such rights; and
*
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
* license (with the right to sublicense), under only those claims of Intel
* patents that are infringed by the Original Intel Code, to make, use, sell,
* offer to sell, and import the Covered Code and derivative works thereof
* solely to the minimum extent necessary to exercise the above copyright
* license, and in no event shall the patent license extend to any additions
* to or modifications of the Original Intel Code. No other license or right
* is granted directly or by implication, estoppel or otherwise;
*
* The above copyright and patent license is granted only if the following
* conditions are met:
*
* 3. Conditions
*
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification with rights to further distribute source must include
* the above Copyright Notice, the above License, this list of Conditions,
* and the following Disclaimer and Export Compliance provision. In addition,
* Licensee must cause all Covered Code to which Licensee contributes to
* contain a file documenting the changes Licensee made to create that Covered
* Code and the date of any change. Licensee must include in that file the
* documentation of any changes made by any predecessor Licensee. Licensee
* must include a prominent statement that the modification is derived,
* directly or indirectly, from Original Intel Code.
*
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification without rights to further distribute source must
* include the following Disclaimer and Export Compliance provision in the
* documentation and/or other materials provided with distribution. In
* addition, Licensee may not authorize further sublicense of source of any
* portion of the Covered Code, and must include terms to the effect that the
* license from Licensee to its licensee is limited to the intellectual
* property embodied in the software Licensee provides to its licensee, and
* not to intellectual property embodied in modifications its licensee may
* make.
*
* 3.3. Redistribution of Executable. Redistribution in executable form of any
* substantial portion of the Covered Code or modification must reproduce the
* above Copyright Notice, and the following Disclaimer and Export Compliance
* provision in the documentation and/or other materials provided with the
* distribution.
*
* 3.4. Intel retains all right, title, and interest in and to the Original
* Intel Code.
*
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
* Intel shall be used in advertising or otherwise to promote the sale, use or
* other dealings in products derived from or relating to the Covered Code
* without prior written authorization from Intel.
*
* 4. Disclaimer and Export Compliance
*
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
* LIMITED REMEDY.
*
* 4.3. Licensee shall not export, either directly or indirectly, any of this
* software or system incorporating such software without first obtaining any
* required license or other approval from the U. S. Department of Commerce or
* any other agency or department of the United States Government. In the
* event Licensee exports any such software from the United States or
* re-exports any such software from a foreign destination, Licensee shall
* ensure that the distribution and export/re-export of the software is in
* compliance with all laws, regulations, orders, or other restrictions of the
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
* any of its subsidiaries will export/re-export any technical data, process,
* software, or service, directly or indirectly, to any country for which the
* United States government or any agency thereof requires an export license,
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************/
#include "acpi.h"
#include "accommon.h"
#define _COMPONENT ACPI_HARDWARE
ACPI_MODULE_NAME ("hwesleep")
/*******************************************************************************
*
* FUNCTION: AcpiHwExecuteSleepMethod
*
* PARAMETERS: MethodPathname - Pathname of method to execute
* IntegerArgument - Argument to pass to the method
*
* RETURN: None
*
* DESCRIPTION: Execute a sleep/wake related method with one integer argument
* and no return value.
*
******************************************************************************/
void
AcpiHwExecuteSleepMethod (
char *MethodPathname,
UINT32 IntegerArgument)
{
ACPI_OBJECT_LIST ArgList;
ACPI_OBJECT Arg;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (HwExecuteSleepMethod);
/* One argument, IntegerArgument; No return value expected */
ArgList.Count = 1;
ArgList.Pointer = &Arg;
Arg.Type = ACPI_TYPE_INTEGER;
Arg.Integer.Value = (UINT64) IntegerArgument;
Status = AcpiEvaluateObject (NULL, MethodPathname, &ArgList, NULL);
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
{
ACPI_EXCEPTION ((AE_INFO, Status, "While executing method %s",
MethodPathname));
}
return_VOID;
}
/*******************************************************************************
*
* FUNCTION: AcpiHwExtendedSleep
*
* PARAMETERS: SleepState - Which sleep state to enter
* Flags - ACPI_EXECUTE_GTS to run optional method
*
* RETURN: Status
*
* DESCRIPTION: Enter a system sleep state via the extended FADT sleep
* registers (V5 FADT).
* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
*
******************************************************************************/
ACPI_STATUS
AcpiHwExtendedSleep (
UINT8 SleepState,
UINT8 Flags)
{
ACPI_STATUS Status;
UINT8 SleepTypeValue;
UINT64 SleepStatus;
ACPI_FUNCTION_TRACE (HwExtendedSleep);
/* Extended sleep registers must be valid */
if (!AcpiGbl_FADT.SleepControl.Address ||
!AcpiGbl_FADT.SleepStatus.Address)
{
return_ACPI_STATUS (AE_NOT_EXIST);
}
/* Clear wake status (WAK_STS) */
Status = AcpiWrite ((UINT64) ACPI_X_WAKE_STATUS, &AcpiGbl_FADT.SleepStatus);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
AcpiGbl_SystemAwakeAndRunning = FALSE;
/* Optionally execute _GTS (Going To Sleep) */
if (Flags & ACPI_EXECUTE_GTS)
{
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__GTS, SleepState);
}
/* Flush caches, as per ACPI specification */
ACPI_FLUSH_CPU_CACHE ();
/*
* Set the SLP_TYP and SLP_EN bits.
*
* Note: We only use the first value returned by the \_Sx method
* (AcpiGbl_SleepTypeA) - As per ACPI specification.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
"Entering sleep state [S%u]\n", SleepState));
SleepTypeValue = ((AcpiGbl_SleepTypeA << ACPI_X_SLEEP_TYPE_POSITION) &
ACPI_X_SLEEP_TYPE_MASK);
Status = AcpiWrite ((UINT64) (SleepTypeValue | ACPI_X_SLEEP_ENABLE),
&AcpiGbl_FADT.SleepControl);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* Wait for transition back to Working State */
do
{
Status = AcpiRead (&SleepStatus, &AcpiGbl_FADT.SleepStatus);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
} while (!(((UINT8) SleepStatus) & ACPI_X_WAKE_STATUS));
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiHwExtendedWakePrep
*
* PARAMETERS: SleepState - Which sleep state we just exited
* Flags - ACPI_EXECUTE_BFS to run optional method
*
* RETURN: Status
*
* DESCRIPTION: Perform first part of OS-independent ACPI cleanup after
* a sleep. Called with interrupts ENABLED.
*
******************************************************************************/
ACPI_STATUS
AcpiHwExtendedWakePrep (
UINT8 SleepState,
UINT8 Flags)
{
ACPI_STATUS Status;
UINT8 SleepTypeValue;
ACPI_FUNCTION_TRACE (HwExtendedWakePrep);
Status = AcpiGetSleepTypeData (ACPI_STATE_S0,
&AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
if (ACPI_SUCCESS (Status))
{
SleepTypeValue = ((AcpiGbl_SleepTypeA << ACPI_X_SLEEP_TYPE_POSITION) &
ACPI_X_SLEEP_TYPE_MASK);
(void) AcpiWrite ((UINT64) (SleepTypeValue | ACPI_X_SLEEP_ENABLE),
&AcpiGbl_FADT.SleepControl);
}
/* Optionally execute _BFS (Back From Sleep) */
if (Flags & ACPI_EXECUTE_BFS)
{
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__BFS, SleepState);
}
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiHwExtendedWake
*
* PARAMETERS: SleepState - Which sleep state we just exited
* Flags - Reserved, set to zero
*
* RETURN: Status
*
* DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
* Called with interrupts ENABLED.
*
******************************************************************************/
ACPI_STATUS
AcpiHwExtendedWake (
UINT8 SleepState,
UINT8 Flags)
{
ACPI_FUNCTION_TRACE (HwExtendedWake);
/* Ensure EnterSleepStatePrep -> EnterSleepState ordering */
AcpiGbl_SleepTypeA = ACPI_SLEEP_TYPE_INVALID;
/* Execute the wake methods */
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WAKING);
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__WAK, SleepState);
/*
* Some BIOS code assumes that WAK_STS will be cleared on resume
* and use it to determine whether the system is rebooting or
* resuming. Clear WAK_STS for compatibility.
*/
(void) AcpiWrite ((UINT64) ACPI_X_WAKE_STATUS, &AcpiGbl_FADT.SleepStatus);
AcpiGbl_SystemAwakeAndRunning = TRUE;
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING);
return_ACPI_STATUS (AE_OK);
}
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -121,6 +121,8 @@
#define _COMPONENT ACPI_HARDWARE
ACPI_MODULE_NAME ("hwgpe")
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/* Local prototypes */
static ACPI_STATUS
@@ -610,3 +612,4 @@ AcpiHwEnableAllWakeupGpes (
return_ACPI_STATUS (Status);
}
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -10,7 +10,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -125,6 +125,8 @@
ACPI_MODULE_NAME ("hwregs")
#if (!ACPI_REDUCED_HARDWARE)
/* Local Prototypes */
static ACPI_STATUS
@@ -139,6 +141,7 @@ AcpiHwWriteMultiple (
ACPI_GENERIC_ADDRESS *RegisterA,
ACPI_GENERIC_ADDRESS *RegisterB);
#endif /* !ACPI_REDUCED_HARDWARE */
/******************************************************************************
*
@@ -242,6 +245,7 @@ AcpiHwRead (
ACPI_GENERIC_ADDRESS *Reg)
{
UINT64 Address;
UINT64 Value64;
ACPI_STATUS Status;
@@ -267,7 +271,9 @@ AcpiHwRead (
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
Address, Value, Reg->BitWidth);
Address, &Value64, Reg->BitWidth);
*Value = (UINT32) Value64;
}
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
{
@@ -326,7 +332,7 @@ AcpiHwWrite (
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
Address, Value, Reg->BitWidth);
Address, (UINT64) Value, Reg->BitWidth);
}
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
{
@@ -343,6 +349,7 @@ AcpiHwWrite (
}
#if (!ACPI_REDUCED_HARDWARE)
/*******************************************************************************
*
* FUNCTION: AcpiHwClearAcpiStatus
@@ -393,7 +400,7 @@ UnlockAndExit:
/*******************************************************************************
*
* FUNCTION: AcpiHwGetRegisterBitMask
* FUNCTION: AcpiHwGetBitRegisterInfo
*
* PARAMETERS: RegisterId - Index of ACPI Register to access
*
@@ -803,3 +810,4 @@ AcpiHwWriteMultiple (
return (Status);
}
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface
* Name: hwsleep.c - ACPI Hardware Sleep/Wake Support functions for the
* original/legacy sleep/PM registers.
*
*****************************************************************************/
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -121,210 +121,38 @@
ACPI_MODULE_NAME ("hwsleep")
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/*******************************************************************************
*
* FUNCTION: AcpiSetFirmwareWakingVector
*
* PARAMETERS: PhysicalAddress - 32-bit physical address of ACPI real mode
* entry point.
*
* RETURN: Status
*
* DESCRIPTION: Sets the 32-bit FirmwareWakingVector field of the FACS
*
******************************************************************************/
ACPI_STATUS
AcpiSetFirmwareWakingVector (
UINT32 PhysicalAddress)
{
ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector);
/* Set the 32-bit vector */
AcpiGbl_FACS->FirmwareWakingVector = PhysicalAddress;
/* Clear the 64-bit vector if it exists */
if ((AcpiGbl_FACS->Length > 32) && (AcpiGbl_FACS->Version >= 1))
{
AcpiGbl_FACS->XFirmwareWakingVector = 0;
}
return_ACPI_STATUS (AE_OK);
}
ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector)
#if ACPI_MACHINE_WIDTH == 64
/*******************************************************************************
*
* FUNCTION: AcpiSetFirmwareWakingVector64
*
* PARAMETERS: PhysicalAddress - 64-bit physical address of ACPI protected
* mode entry point.
*
* RETURN: Status
*
* DESCRIPTION: Sets the 64-bit X_FirmwareWakingVector field of the FACS, if
* it exists in the table. This function is intended for use with
* 64-bit host operating systems.
*
******************************************************************************/
ACPI_STATUS
AcpiSetFirmwareWakingVector64 (
UINT64 PhysicalAddress)
{
ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector64);
/* Determine if the 64-bit vector actually exists */
if ((AcpiGbl_FACS->Length <= 32) || (AcpiGbl_FACS->Version < 1))
{
return_ACPI_STATUS (AE_NOT_EXIST);
}
/* Clear 32-bit vector, set the 64-bit X_ vector */
AcpiGbl_FACS->FirmwareWakingVector = 0;
AcpiGbl_FACS->XFirmwareWakingVector = PhysicalAddress;
return_ACPI_STATUS (AE_OK);
}
ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector64)
#endif
/*******************************************************************************
*
* FUNCTION: AcpiEnterSleepStatePrep
* FUNCTION: AcpiHwLegacySleep
*
* PARAMETERS: SleepState - Which sleep state to enter
* Flags - ACPI_EXECUTE_GTS to run optional method
*
* RETURN: Status
*
* DESCRIPTION: Prepare to enter a system sleep state (see ACPI 2.0 spec p 231)
* This function must execute with interrupts enabled.
* We break sleeping into 2 stages so that OSPM can handle
* various OS-specific tasks between the two steps.
*
******************************************************************************/
ACPI_STATUS
AcpiEnterSleepStatePrep (
UINT8 SleepState)
{
ACPI_STATUS Status;
ACPI_OBJECT_LIST ArgList;
ACPI_OBJECT Arg;
ACPI_FUNCTION_TRACE (AcpiEnterSleepStatePrep);
/* _PSW methods could be run here to enable wake-on keyboard, LAN, etc. */
Status = AcpiGetSleepTypeData (SleepState,
&AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* Execute the _PTS method (Prepare To Sleep) */
ArgList.Count = 1;
ArgList.Pointer = &Arg;
Arg.Type = ACPI_TYPE_INTEGER;
Arg.Integer.Value = SleepState;
Status = AcpiEvaluateObject (NULL, METHOD_NAME__PTS, &ArgList, NULL);
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
{
return_ACPI_STATUS (Status);
}
/* Setup the argument to the _SST method (System STatus) */
switch (SleepState)
{
case ACPI_STATE_S0:
Arg.Integer.Value = ACPI_SST_WORKING;
break;
case ACPI_STATE_S1:
case ACPI_STATE_S2:
case ACPI_STATE_S3:
Arg.Integer.Value = ACPI_SST_SLEEPING;
break;
case ACPI_STATE_S4:
Arg.Integer.Value = ACPI_SST_SLEEP_CONTEXT;
break;
default:
Arg.Integer.Value = ACPI_SST_INDICATOR_OFF; /* Default is off */
break;
}
/*
* Set the system indicators to show the desired sleep state.
* _SST is an optional method (return no error if not found)
*/
Status = AcpiEvaluateObject (NULL, METHOD_NAME__SST, &ArgList, NULL);
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
{
ACPI_EXCEPTION ((AE_INFO, Status, "While executing method _SST"));
}
return_ACPI_STATUS (AE_OK);
}
ACPI_EXPORT_SYMBOL (AcpiEnterSleepStatePrep)
/*******************************************************************************
*
* FUNCTION: AcpiEnterSleepState
*
* PARAMETERS: SleepState - Which sleep state to enter
*
* RETURN: Status
*
* DESCRIPTION: Enter a system sleep state
* DESCRIPTION: Enter a system sleep state via the legacy FADT PM registers
* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
*
******************************************************************************/
ACPI_STATUS
AcpiEnterSleepState (
UINT8 SleepState)
AcpiHwLegacySleep (
UINT8 SleepState,
UINT8 Flags)
{
UINT32 Pm1aControl;
UINT32 Pm1bControl;
ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo;
ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo;
UINT32 Pm1aControl;
UINT32 Pm1bControl;
UINT32 InValue;
ACPI_OBJECT_LIST ArgList;
ACPI_OBJECT Arg;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (AcpiEnterSleepState);
ACPI_FUNCTION_TRACE (HwLegacySleep);
if ((AcpiGbl_SleepTypeA > ACPI_SLEEP_TYPE_MAX) ||
(AcpiGbl_SleepTypeB > ACPI_SLEEP_TYPE_MAX))
{
ACPI_ERROR ((AE_INFO, "Sleep values out of range: A=0x%X B=0x%X",
AcpiGbl_SleepTypeA, AcpiGbl_SleepTypeB));
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
}
SleepTypeRegInfo = AcpiHwGetBitRegisterInfo (ACPI_BITREG_SLEEP_TYPE);
SleepTypeRegInfo = AcpiHwGetBitRegisterInfo (ACPI_BITREG_SLEEP_TYPE);
SleepEnableRegInfo = AcpiHwGetBitRegisterInfo (ACPI_BITREG_SLEEP_ENABLE);
/* Clear wake status */
@@ -343,20 +171,6 @@ AcpiEnterSleepState (
return_ACPI_STATUS (Status);
}
if (SleepState != ACPI_STATE_S5)
{
/*
* 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) && (Status != AE_BAD_ADDRESS))
{
return_ACPI_STATUS (Status);
}
}
/*
* 1) Disable/Clear all GPEs
* 2) Enable all wakeup GPEs
@@ -374,17 +188,11 @@ AcpiEnterSleepState (
return_ACPI_STATUS (Status);
}
/* Execute the _GTS method (Going To Sleep) */
/* Optionally execute _GTS (Going To Sleep) */
ArgList.Count = 1;
ArgList.Pointer = &Arg;
Arg.Type = ACPI_TYPE_INTEGER;
Arg.Integer.Value = SleepState;
Status = AcpiEvaluateObject (NULL, METHOD_NAME__GTS, &ArgList, NULL);
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
if (Flags & ACPI_EXECUTE_GTS)
{
return_ACPI_STATUS (Status);
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__GTS, SleepState);
}
/* Get current value of PM1A control */
@@ -462,7 +270,7 @@ AcpiEnterSleepState (
}
}
/* Wait until we enter sleep state */
/* Wait for transition back to Working State */
do
{
@@ -472,110 +280,32 @@ AcpiEnterSleepState (
return_ACPI_STATUS (Status);
}
/* Spin until we wake */
} while (!InValue);
return_ACPI_STATUS (AE_OK);
}
ACPI_EXPORT_SYMBOL (AcpiEnterSleepState)
/*******************************************************************************
*
* FUNCTION: AcpiEnterSleepStateS4bios
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Perform a S4 bios request.
* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
*
******************************************************************************/
ACPI_STATUS
AcpiEnterSleepStateS4bios (
void)
{
UINT32 InValue;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (AcpiEnterSleepStateS4bios);
/* Clear the wake status bit (PM1) */
Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
Status = AcpiHwClearAcpiStatus ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/*
* 1) Disable/Clear all GPEs
* 2) Enable all wakeup GPEs
*/
Status = AcpiHwDisableAllGpes ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
AcpiGbl_SystemAwakeAndRunning = FALSE;
Status = AcpiHwEnableAllWakeupGpes ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
ACPI_FLUSH_CPU_CACHE ();
Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand,
(UINT32) AcpiGbl_FADT.S4BiosRequest, 8);
do {
AcpiOsStall(1000);
Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &InValue);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
} while (!InValue);
return_ACPI_STATUS (AE_OK);
}
ACPI_EXPORT_SYMBOL (AcpiEnterSleepStateS4bios)
/*******************************************************************************
*
* FUNCTION: AcpiLeaveSleepState
* FUNCTION: AcpiHwLegacyWakePrep
*
* PARAMETERS: SleepState - Which sleep state we just exited
* Flags - ACPI_EXECUTE_BFS to run optional method
*
* RETURN: Status
*
* DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
* DESCRIPTION: Perform the first state of OS-independent ACPI cleanup after a
* sleep.
* Called with interrupts ENABLED.
*
******************************************************************************/
ACPI_STATUS
AcpiLeaveSleepState (
UINT8 SleepState)
AcpiHwLegacyWakePrep (
UINT8 SleepState,
UINT8 Flags)
{
ACPI_OBJECT_LIST ArgList;
ACPI_OBJECT Arg;
ACPI_STATUS Status;
ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo;
ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo;
@@ -583,8 +313,7 @@ AcpiLeaveSleepState (
UINT32 Pm1bControl;
ACPI_FUNCTION_TRACE (AcpiLeaveSleepState);
ACPI_FUNCTION_TRACE (HwLegacyWakePrep);
/*
* Set SLP_TYPE and SLP_EN to state S0.
@@ -625,40 +354,50 @@ AcpiLeaveSleepState (
}
}
/* Optionally execute _BFS (Back From Sleep) */
if (Flags & ACPI_EXECUTE_BFS)
{
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__BFS, SleepState);
}
return_ACPI_STATUS (Status);
}
/*******************************************************************************
*
* FUNCTION: AcpiHwLegacyWake
*
* PARAMETERS: SleepState - Which sleep state we just exited
* Flags - Reserved, set to zero
*
* RETURN: Status
*
* DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
* Called with interrupts ENABLED.
*
******************************************************************************/
ACPI_STATUS
AcpiHwLegacyWake (
UINT8 SleepState,
UINT8 Flags)
{
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (HwLegacyWake);
/* Ensure EnterSleepStatePrep -> EnterSleepState ordering */
AcpiGbl_SleepTypeA = ACPI_SLEEP_TYPE_INVALID;
/* Setup parameter object */
ArgList.Count = 1;
ArgList.Pointer = &Arg;
Arg.Type = ACPI_TYPE_INTEGER;
/* Ignore any errors from these methods */
Arg.Integer.Value = ACPI_SST_WAKING;
Status = AcpiEvaluateObject (NULL, METHOD_NAME__SST, &ArgList, NULL);
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
{
ACPI_EXCEPTION ((AE_INFO, Status, "During Method _SST"));
}
Arg.Integer.Value = SleepState;
Status = AcpiEvaluateObject (NULL, METHOD_NAME__BFS, &ArgList, NULL);
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
{
ACPI_EXCEPTION ((AE_INFO, Status, "During Method _BFS"));
}
Status = AcpiEvaluateObject (NULL, METHOD_NAME__WAK, &ArgList, NULL);
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
{
ACPI_EXCEPTION ((AE_INFO, Status, "During Method _WAK"));
}
/* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WAKING);
/*
* GPEs must be enabled before _WAK is called as GPEs
* might get fired there
*
* Restore the GPEs:
* 1) Disable/Clear all GPEs
* 2) Enable all runtime GPEs
@@ -668,7 +407,6 @@ AcpiLeaveSleepState (
{
return_ACPI_STATUS (Status);
}
AcpiGbl_SystemAwakeAndRunning = TRUE;
Status = AcpiHwEnableAllRuntimeGpes ();
if (ACPI_FAILURE (Status))
@@ -676,6 +414,20 @@ AcpiLeaveSleepState (
return_ACPI_STATUS (Status);
}
/*
* Now we can execute _WAK, etc. Some machines require that the GPEs
* are enabled before the wake methods are executed.
*/
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__WAK, SleepState);
/*
* Some BIOS code assumes that WAK_STS will be cleared on resume
* and use it to determine whether the system is rebooting or
* resuming. Clear WAK_STS for compatibility.
*/
(void) AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
AcpiGbl_SystemAwakeAndRunning = TRUE;
/* Enable power button */
(void) AcpiWriteBitRegister(
@@ -686,26 +438,8 @@ AcpiLeaveSleepState (
AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].StatusRegisterId,
ACPI_CLEAR_STATUS);
/*
* 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) && (Status != AE_BAD_ADDRESS))
{
return_ACPI_STATUS (Status);
}
Arg.Integer.Value = ACPI_SST_WORKING;
Status = AcpiEvaluateObject (NULL, METHOD_NAME__SST, &ArgList, NULL);
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
{
ACPI_EXCEPTION ((AE_INFO, Status, "During Method _SST"));
}
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING);
return_ACPI_STATUS (Status);
}
ACPI_EXPORT_SYMBOL (AcpiLeaveSleepState)
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -121,6 +121,7 @@
ACPI_MODULE_NAME ("hwtimer")
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
/******************************************************************************
*
* FUNCTION: AcpiGetTimerResolution
@@ -286,3 +287,4 @@ AcpiGetTimerDuration (
ACPI_EXPORT_SYMBOL (AcpiGetTimerDuration)
#endif /* !ACPI_REDUCED_HARDWARE */
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -221,6 +221,8 @@ AcpiHwValidateIoRequest (
(BitWidth != 16) &&
(BitWidth != 32))
{
ACPI_ERROR ((AE_INFO,
"Bad BitWidth parameter: %8.8X", BitWidth));
return (AE_BAD_PARAMETER);
}
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -226,12 +226,6 @@ AcpiRead (
return (Status);
}
Width = Reg->BitWidth;
if (Width == 64)
{
Width = 32; /* Break into two 32-bit transfers */
}
/* Initialize entire 64-bit return value to zero */
*ReturnValue = 0;
@@ -244,28 +238,20 @@ AcpiRead (
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
Address, &Value, Width);
Address, ReturnValue, Reg->BitWidth);
if (ACPI_FAILURE (Status))
{
return (Status);
}
*ReturnValue = Value;
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 */
{
Width = Reg->BitWidth;
if (Width == 64)
{
Width = 32; /* Break into two 32-bit transfers */
}
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
Address, &Value, Width);
if (ACPI_FAILURE (Status))
@@ -334,12 +320,6 @@ AcpiWrite (
return (Status);
}
Width = Reg->BitWidth;
if (Width == 64)
{
Width = 32; /* Break into two 32-bit transfers */
}
/*
* Two address spaces supported: Memory or IO. PCI_Config is
* not supported here because the GAS structure is insufficient
@@ -347,24 +327,20 @@ AcpiWrite (
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
Address, ACPI_LODWORD (Value), Width);
Address, Value, Reg->BitWidth);
if (ACPI_FAILURE (Status))
{
return (Status);
}
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 */
{
Width = Reg->BitWidth;
if (Width == 64)
{
Width = 32; /* Break into two 32-bit transfers */
}
Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
Address, ACPI_LODWORD (Value), Width);
if (ACPI_FAILURE (Status))
@@ -395,6 +371,7 @@ AcpiWrite (
ACPI_EXPORT_SYMBOL (AcpiWrite)
#if (!ACPI_REDUCED_HARDWARE)
/*******************************************************************************
*
* FUNCTION: AcpiReadBitRegister
@@ -577,6 +554,8 @@ UnlockAndExit:
ACPI_EXPORT_SYMBOL (AcpiWriteBitRegister)
#endif /* !ACPI_REDUCED_HARDWARE */
/*******************************************************************************
*
@@ -0,0 +1,558 @@
/******************************************************************************
*
* Name: hwxfsleep.c - ACPI Hardware Sleep/Wake External Interfaces
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
*
* 2.1. This is your license from Intel Corp. under its intellectual property
* rights. You may have additional license terms from the party that provided
* you this software, covering your right to use that party's intellectual
* property rights.
*
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
* copy of the source code appearing in this file ("Covered Code") an
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
* base code distributed originally by Intel ("Original Intel Code") to copy,
* make derivatives, distribute, use and display any portion of the Covered
* Code in any form, with the right to sublicense such rights; and
*
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
* license (with the right to sublicense), under only those claims of Intel
* patents that are infringed by the Original Intel Code, to make, use, sell,
* offer to sell, and import the Covered Code and derivative works thereof
* solely to the minimum extent necessary to exercise the above copyright
* license, and in no event shall the patent license extend to any additions
* to or modifications of the Original Intel Code. No other license or right
* is granted directly or by implication, estoppel or otherwise;
*
* The above copyright and patent license is granted only if the following
* conditions are met:
*
* 3. Conditions
*
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification with rights to further distribute source must include
* the above Copyright Notice, the above License, this list of Conditions,
* and the following Disclaimer and Export Compliance provision. In addition,
* Licensee must cause all Covered Code to which Licensee contributes to
* contain a file documenting the changes Licensee made to create that Covered
* Code and the date of any change. Licensee must include in that file the
* documentation of any changes made by any predecessor Licensee. Licensee
* must include a prominent statement that the modification is derived,
* directly or indirectly, from Original Intel Code.
*
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification without rights to further distribute source must
* include the following Disclaimer and Export Compliance provision in the
* documentation and/or other materials provided with distribution. In
* addition, Licensee may not authorize further sublicense of source of any
* portion of the Covered Code, and must include terms to the effect that the
* license from Licensee to its licensee is limited to the intellectual
* property embodied in the software Licensee provides to its licensee, and
* not to intellectual property embodied in modifications its licensee may
* make.
*
* 3.3. Redistribution of Executable. Redistribution in executable form of any
* substantial portion of the Covered Code or modification must reproduce the
* above Copyright Notice, and the following Disclaimer and Export Compliance
* provision in the documentation and/or other materials provided with the
* distribution.
*
* 3.4. Intel retains all right, title, and interest in and to the Original
* Intel Code.
*
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
* Intel shall be used in advertising or otherwise to promote the sale, use or
* other dealings in products derived from or relating to the Covered Code
* without prior written authorization from Intel.
*
* 4. Disclaimer and Export Compliance
*
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
* LIMITED REMEDY.
*
* 4.3. Licensee shall not export, either directly or indirectly, any of this
* software or system incorporating such software without first obtaining any
* required license or other approval from the U. S. Department of Commerce or
* any other agency or department of the United States Government. In the
* event Licensee exports any such software from the United States or
* re-exports any such software from a foreign destination, Licensee shall
* ensure that the distribution and export/re-export of the software is in
* compliance with all laws, regulations, orders, or other restrictions of the
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
* any of its subsidiaries will export/re-export any technical data, process,
* software, or service, directly or indirectly, to any country for which the
* United States government or any agency thereof requires an export license,
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************/
#include "acpi.h"
#include "accommon.h"
#define _COMPONENT ACPI_HARDWARE
ACPI_MODULE_NAME ("hwxfsleep")
/* Local prototypes */
static ACPI_STATUS
AcpiHwSleepDispatch (
UINT8 SleepState,
UINT8 Flags,
UINT32 FunctionId);
/*
* Dispatch table used to efficiently branch to the various sleep
* functions.
*/
#define ACPI_SLEEP_FUNCTION_ID 0
#define ACPI_WAKE_PREP_FUNCTION_ID 1
#define ACPI_WAKE_FUNCTION_ID 2
/* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[] =
{
{ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacySleep), AcpiHwExtendedSleep},
{ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep), AcpiHwExtendedWakePrep},
{ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake), AcpiHwExtendedWake}
};
/*
* These functions are removed for the ACPI_REDUCED_HARDWARE case:
* AcpiSetFirmwareWakingVector
* AcpiSetFirmwareWakingVector64
* AcpiEnterSleepStateS4bios
*/
#if (!ACPI_REDUCED_HARDWARE)
/*******************************************************************************
*
* FUNCTION: AcpiSetFirmwareWakingVector
*
* PARAMETERS: PhysicalAddress - 32-bit physical address of ACPI real mode
* entry point.
*
* RETURN: Status
*
* DESCRIPTION: Sets the 32-bit FirmwareWakingVector field of the FACS
*
******************************************************************************/
ACPI_STATUS
AcpiSetFirmwareWakingVector (
UINT32 PhysicalAddress)
{
ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector);
/*
* According to the ACPI specification 2.0c and later, the 64-bit
* waking vector should be cleared and the 32-bit waking vector should
* be used, unless we want the wake-up code to be called by the BIOS in
* Protected Mode. Some systems (for example HP dv5-1004nr) are known
* to fail to resume if the 64-bit vector is used.
*/
/* Set the 32-bit vector */
AcpiGbl_FACS->FirmwareWakingVector = PhysicalAddress;
/* Clear the 64-bit vector if it exists */
if ((AcpiGbl_FACS->Length > 32) && (AcpiGbl_FACS->Version >= 1))
{
AcpiGbl_FACS->XFirmwareWakingVector = 0;
}
return_ACPI_STATUS (AE_OK);
}
ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector)
#if ACPI_MACHINE_WIDTH == 64
/*******************************************************************************
*
* FUNCTION: AcpiSetFirmwareWakingVector64
*
* PARAMETERS: PhysicalAddress - 64-bit physical address of ACPI protected
* mode entry point.
*
* RETURN: Status
*
* DESCRIPTION: Sets the 64-bit X_FirmwareWakingVector field of the FACS, if
* it exists in the table. This function is intended for use with
* 64-bit host operating systems.
*
******************************************************************************/
ACPI_STATUS
AcpiSetFirmwareWakingVector64 (
UINT64 PhysicalAddress)
{
ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector64);
/* Determine if the 64-bit vector actually exists */
if ((AcpiGbl_FACS->Length <= 32) || (AcpiGbl_FACS->Version < 1))
{
return_ACPI_STATUS (AE_NOT_EXIST);
}
/* Clear 32-bit vector, set the 64-bit X_ vector */
AcpiGbl_FACS->FirmwareWakingVector = 0;
AcpiGbl_FACS->XFirmwareWakingVector = PhysicalAddress;
return_ACPI_STATUS (AE_OK);
}
ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector64)
#endif
/*******************************************************************************
*
* FUNCTION: AcpiEnterSleepStateS4bios
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Perform a S4 bios request.
* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
*
******************************************************************************/
ACPI_STATUS
AcpiEnterSleepStateS4bios (
void)
{
UINT32 InValue;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (AcpiEnterSleepStateS4bios);
/* Clear the wake status bit (PM1) */
Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
Status = AcpiHwClearAcpiStatus ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/*
* 1) Disable/Clear all GPEs
* 2) Enable all wakeup GPEs
*/
Status = AcpiHwDisableAllGpes ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
AcpiGbl_SystemAwakeAndRunning = FALSE;
Status = AcpiHwEnableAllWakeupGpes ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
ACPI_FLUSH_CPU_CACHE ();
Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand,
(UINT32) AcpiGbl_FADT.S4BiosRequest, 8);
do {
AcpiOsStall(1000);
Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &InValue);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
} while (!InValue);
return_ACPI_STATUS (AE_OK);
}
ACPI_EXPORT_SYMBOL (AcpiEnterSleepStateS4bios)
#endif /* !ACPI_REDUCED_HARDWARE */
/*******************************************************************************
*
* FUNCTION: AcpiHwSleepDispatch
*
* PARAMETERS: SleepState - Which sleep state to enter/exit
* FunctionId - Sleep, WakePrep, or Wake
*
* RETURN: Status from the invoked sleep handling function.
*
* DESCRIPTION: Dispatch a sleep/wake request to the appropriate handling
* function.
*
******************************************************************************/
static ACPI_STATUS
AcpiHwSleepDispatch (
UINT8 SleepState,
UINT8 Flags,
UINT32 FunctionId)
{
ACPI_STATUS Status;
ACPI_SLEEP_FUNCTIONS *SleepFunctions = &AcpiSleepDispatch[FunctionId];
#if (!ACPI_REDUCED_HARDWARE)
/*
* If the Hardware Reduced flag is set (from the FADT), we must
* use the extended sleep registers
*/
if (AcpiGbl_ReducedHardware ||
AcpiGbl_FADT.SleepControl.Address)
{
Status = SleepFunctions->ExtendedFunction (SleepState, Flags);
}
else
{
/* Legacy sleep */
Status = SleepFunctions->LegacyFunction (SleepState, Flags);
}
return (Status);
#else
/*
* For the case where reduced-hardware-only code is being generated,
* we know that only the extended sleep registers are available
*/
Status = SleepFunctions->ExtendedFunction (SleepState, Flags);
return (Status);
#endif /* !ACPI_REDUCED_HARDWARE */
}
/*******************************************************************************
*
* FUNCTION: AcpiEnterSleepStatePrep
*
* PARAMETERS: SleepState - Which sleep state to enter
*
* RETURN: Status
*
* DESCRIPTION: Prepare to enter a system sleep state.
* This function must execute with interrupts enabled.
* We break sleeping into 2 stages so that OSPM can handle
* various OS-specific tasks between the two steps.
*
******************************************************************************/
ACPI_STATUS
AcpiEnterSleepStatePrep (
UINT8 SleepState)
{
ACPI_STATUS Status;
ACPI_OBJECT_LIST ArgList;
ACPI_OBJECT Arg;
UINT32 SstValue;
ACPI_FUNCTION_TRACE (AcpiEnterSleepStatePrep);
Status = AcpiGetSleepTypeData (SleepState,
&AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* Execute the _PTS method (Prepare To Sleep) */
ArgList.Count = 1;
ArgList.Pointer = &Arg;
Arg.Type = ACPI_TYPE_INTEGER;
Arg.Integer.Value = SleepState;
Status = AcpiEvaluateObject (NULL, METHOD_PATHNAME__PTS, &ArgList, NULL);
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
{
return_ACPI_STATUS (Status);
}
/* Setup the argument to the _SST method (System STatus) */
switch (SleepState)
{
case ACPI_STATE_S0:
SstValue = ACPI_SST_WORKING;
break;
case ACPI_STATE_S1:
case ACPI_STATE_S2:
case ACPI_STATE_S3:
SstValue = ACPI_SST_SLEEPING;
break;
case ACPI_STATE_S4:
SstValue = ACPI_SST_SLEEP_CONTEXT;
break;
default:
SstValue = ACPI_SST_INDICATOR_OFF; /* Default is off */
break;
}
/*
* Set the system indicators to show the desired sleep state.
* _SST is an optional method (return no error if not found)
*/
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, SstValue);
return_ACPI_STATUS (AE_OK);
}
ACPI_EXPORT_SYMBOL (AcpiEnterSleepStatePrep)
/*******************************************************************************
*
* FUNCTION: AcpiEnterSleepState
*
* PARAMETERS: SleepState - Which sleep state to enter
* Flags - ACPI_EXECUTE_GTS to run optional method
*
* RETURN: Status
*
* DESCRIPTION: Enter a system sleep state
* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
*
******************************************************************************/
ACPI_STATUS
AcpiEnterSleepState (
UINT8 SleepState,
UINT8 Flags)
{
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (AcpiEnterSleepState);
if ((AcpiGbl_SleepTypeA > ACPI_SLEEP_TYPE_MAX) ||
(AcpiGbl_SleepTypeB > ACPI_SLEEP_TYPE_MAX))
{
ACPI_ERROR ((AE_INFO, "Sleep values out of range: A=0x%X B=0x%X",
AcpiGbl_SleepTypeA, AcpiGbl_SleepTypeB));
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
}
Status = AcpiHwSleepDispatch (SleepState, Flags, ACPI_SLEEP_FUNCTION_ID);
return_ACPI_STATUS (Status);
}
ACPI_EXPORT_SYMBOL (AcpiEnterSleepState)
/*******************************************************************************
*
* FUNCTION: AcpiLeaveSleepStatePrep
*
* PARAMETERS: SleepState - Which sleep state we are exiting
* Flags - ACPI_EXECUTE_BFS to run optional method
*
* RETURN: Status
*
* DESCRIPTION: Perform the first state of OS-independent ACPI cleanup after a
* sleep. Called with interrupts DISABLED.
* We break wake/resume into 2 stages so that OSPM can handle
* various OS-specific tasks between the two steps.
*
******************************************************************************/
ACPI_STATUS
AcpiLeaveSleepStatePrep (
UINT8 SleepState,
UINT8 Flags)
{
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (AcpiLeaveSleepStatePrep);
Status = AcpiHwSleepDispatch (SleepState, Flags, ACPI_WAKE_PREP_FUNCTION_ID);
return_ACPI_STATUS (Status);
}
ACPI_EXPORT_SYMBOL (AcpiLeaveSleepStatePrep)
/*******************************************************************************
*
* FUNCTION: AcpiLeaveSleepState
*
* PARAMETERS: SleepState - Which sleep state we are exiting
*
* RETURN: Status
*
* DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
* Called with interrupts ENABLED.
*
******************************************************************************/
ACPI_STATUS
AcpiLeaveSleepState (
UINT8 SleepState)
{
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (AcpiLeaveSleepState);
Status = AcpiHwSleepDispatch (SleepState, 0, ACPI_WAKE_FUNCTION_ID);
return_ACPI_STATUS (Status);
}
ACPI_EXPORT_SYMBOL (AcpiLeaveSleepState)
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -343,7 +343,21 @@ AcpiNsDumpOneObject (
if (!ObjDesc)
{
/* No attached object, we are done */
/* No attached object. Some types should always have an object */
switch (Type)
{
case ACPI_TYPE_INTEGER:
case ACPI_TYPE_PACKAGE:
case ACPI_TYPE_BUFFER:
case ACPI_TYPE_STRING:
case ACPI_TYPE_METHOD:
AcpiOsPrintf ("<No attached object>");
break;
default:
break;
}
AcpiOsPrintf ("\n");
return (AE_OK);
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -214,7 +214,7 @@ AcpiNsDumpRootDevices (
return;
}
Status = AcpiGetHandle (NULL, ACPI_NS_SYSTEM_BUS, &SysBusHandle);
Status = AcpiGetHandle (NULL, METHOD_NAME__SB_, &SysBusHandle);
if (ACPI_FAILURE (Status))
{
return;
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -737,6 +737,7 @@ AcpiNsCheckPackage (
case ACPI_PTYPE2_FIXED:
case ACPI_PTYPE2_MIN:
case ACPI_PTYPE2_COUNT:
case ACPI_PTYPE2_FIX_VAR:
/*
* These types all return a single Package that consists of a
@@ -752,7 +753,7 @@ AcpiNsCheckPackage (
{
/* Create the new outer package and populate it */
Status = AcpiNsRepairPackageList (Data, ReturnObjectPtr);
Status = AcpiNsWrapWithPackage (Data, ReturnObject, ReturnObjectPtr);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -879,6 +880,29 @@ AcpiNsCheckPackageList (
break;
case ACPI_PTYPE2_FIX_VAR:
/*
* Each subpackage has a fixed number of elements and an
* optional element
*/
ExpectedCount = Package->RetInfo.Count1 + Package->RetInfo.Count2;
if (SubPackage->Package.Count < ExpectedCount)
{
goto PackageTooSmall;
}
Status = AcpiNsCheckPackageElements (Data, SubElements,
Package->RetInfo.ObjectType1,
Package->RetInfo.Count1,
Package->RetInfo.ObjectType2,
SubPackage->Package.Count - Package->RetInfo.Count1, 0);
if (ACPI_FAILURE (Status))
{
return (Status);
}
break;
case ACPI_PTYPE2_FIXED:
/* Each sub-package has a fixed length */
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -146,11 +146,10 @@
* Buffer -> String
* Buffer -> Package of Integers
* Package -> Package of one Package
* An incorrect standalone object is wrapped with required outer package
*
* Additional possible repairs:
*
* Required package elements that are NULL replaced by Integer/String/Buffer
* Incorrect standalone package wrapped with required outer package
*
******************************************************************************/
@@ -172,11 +171,6 @@ AcpiNsConvertToBuffer (
ACPI_OPERAND_OBJECT *OriginalObject,
ACPI_OPERAND_OBJECT **ReturnObject);
static ACPI_STATUS
AcpiNsConvertToPackage (
ACPI_OPERAND_OBJECT *OriginalObject,
ACPI_OPERAND_OBJECT **ReturnObject);
/*******************************************************************************
*
@@ -244,10 +238,24 @@ AcpiNsRepairObject (
}
if (ExpectedBtypes & ACPI_RTYPE_PACKAGE)
{
Status = AcpiNsConvertToPackage (ReturnObject, &NewObject);
/*
* A package is expected. We will wrap the existing object with a
* new package object. It is often the case that if a variable-length
* package is required, but there is only a single object needed, the
* BIOS will return that object instead of wrapping it with a Package
* object. Note: after the wrapping, the package will be validated
* for correct contents (expected object type or types).
*/
Status = AcpiNsWrapWithPackage (Data, ReturnObject, &NewObject);
if (ACPI_SUCCESS (Status))
{
goto ObjectRepaired;
/*
* The original object just had its reference count
* incremented for being inserted into the new package.
*/
*ReturnObjectPtr = NewObject; /* New Package object */
Data->Flags |= ACPI_OBJECT_REPAIRED;
return (AE_OK);
}
}
@@ -260,24 +268,30 @@ ObjectRepaired:
/* Object was successfully repaired */
/*
* 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)
/*
* The original object is a package element. We need to
* decrement the reference count of the original object,
* for removing it from the package.
*
* However, if the original object was just wrapped with a
* package object as part of the repair, we don't need to
* change the reference count.
*/
if (!(Data->Flags & ACPI_OBJECT_WRAPPED))
{
ReturnObject->Common.ReferenceCount--;
NewObject->Common.ReferenceCount =
ReturnObject->Common.ReferenceCount;
if (ReturnObject->Common.ReferenceCount > 1)
{
ReturnObject->Common.ReferenceCount--;
}
}
ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR,
"%s: Converted %s to expected %s at index %u\n",
"%s: Converted %s to expected %s at Package index %u\n",
Data->Pathname, AcpiUtGetObjectTypeName (ReturnObject),
AcpiUtGetObjectTypeName (NewObject), PackageIndex));
}
@@ -568,71 +582,6 @@ AcpiNsConvertToBuffer (
}
/*******************************************************************************
*
* FUNCTION: AcpiNsConvertToPackage
*
* PARAMETERS: OriginalObject - Object to be converted
* ReturnObject - Where the new converted object is returned
*
* RETURN: Status. AE_OK if conversion was successful.
*
* DESCRIPTION: Attempt to convert a Buffer object to a Package. Each byte of
* the buffer is converted to a single integer package element.
*
******************************************************************************/
static ACPI_STATUS
AcpiNsConvertToPackage (
ACPI_OPERAND_OBJECT *OriginalObject,
ACPI_OPERAND_OBJECT **ReturnObject)
{
ACPI_OPERAND_OBJECT *NewObject;
ACPI_OPERAND_OBJECT **Elements;
UINT32 Length;
UINT8 *Buffer;
switch (OriginalObject->Common.Type)
{
case ACPI_TYPE_BUFFER:
/* Buffer-to-Package conversion */
Length = OriginalObject->Buffer.Length;
NewObject = AcpiUtCreatePackageObject (Length);
if (!NewObject)
{
return (AE_NO_MEMORY);
}
/* Convert each buffer byte to an integer package element */
Elements = NewObject->Package.Elements;
Buffer = OriginalObject->Buffer.Pointer;
while (Length--)
{
*Elements = AcpiUtCreateIntegerObject ((UINT64) *Buffer);
if (!*Elements)
{
AcpiUtRemoveReference (NewObject);
return (AE_NO_MEMORY);
}
Elements++;
Buffer++;
}
break;
default:
return (AE_AML_OPERAND_TYPE);
}
*ReturnObject = NewObject;
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiNsRepairNullElement
@@ -768,6 +717,7 @@ AcpiNsRemoveNullElements (
case ACPI_PTYPE2_FIXED:
case ACPI_PTYPE2_MIN:
case ACPI_PTYPE2_REV_FIXED:
case ACPI_PTYPE2_FIX_VAR:
break;
default:
@@ -816,42 +766,43 @@ AcpiNsRemoveNullElements (
/*******************************************************************************
*
* FUNCTION: AcpiNsRepairPackageList
* FUNCTION: AcpiNsWrapWithPackage
*
* 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.
* OriginalObject - Pointer to the object to repair.
* ObjDescPtr - The new package object is returned here
*
* 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.
* DESCRIPTION: Repair a common problem with objects that are defined to
* return a variable-length Package of sub-objects. If there is
* only one sub-object, some BIOS code mistakenly simply declares
* the single object instead of a Package with one sub-object.
* This function attempts to repair this error by wrapping a
* Package object around the original object, creating the
* correct and expected Package with one sub-object.
*
* Names that can be repaired in this manner include:
* _ALR, _CSD, _HPX, _MLS, _PRT, _PSS, _TRT, TSS
* _ALR, _CSD, _HPX, _MLS, _PLD, _PRT, _PSS, _TRT, _TSS,
* _BCL, _DOD, _FIX, _Sx
*
******************************************************************************/
ACPI_STATUS
AcpiNsRepairPackageList (
AcpiNsWrapWithPackage (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT *OriginalObject,
ACPI_OPERAND_OBJECT **ObjDescPtr)
{
ACPI_OPERAND_OBJECT *PkgObjDesc;
ACPI_FUNCTION_NAME (NsRepairPackageList);
ACPI_FUNCTION_NAME (NsWrapWithPackage);
/*
* Create the new outer package and populate it. The new package will
* have a single element, the lone subpackage.
* have a single element, the lone sub-object.
*/
PkgObjDesc = AcpiUtCreatePackageObject (1);
if (!PkgObjDesc)
@@ -859,15 +810,15 @@ AcpiNsRepairPackageList (
return (AE_NO_MEMORY);
}
PkgObjDesc->Package.Elements[0] = *ObjDescPtr;
PkgObjDesc->Package.Elements[0] = OriginalObject;
ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR,
"%s: Wrapped %s with expected Package object\n",
Data->Pathname, AcpiUtGetObjectTypeName (OriginalObject)));
/* Return the new object in the object pointer */
*ObjDescPtr = PkgObjDesc;
Data->Flags |= ACPI_OBJECT_REPAIRED;
ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR,
"%s: Repaired incorrectly formed Package\n", Data->Pathname));
Data->Flags |= ACPI_OBJECT_REPAIRED | ACPI_OBJECT_WRAPPED;
return (AE_OK);
}
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -588,11 +588,12 @@ AcpiNsRepair_HID (
}
/*
* Copy and uppercase the string. From the ACPI specification:
* Copy and uppercase the string. From the ACPI 5.0 specification:
*
* A valid PNP ID must be of the form "AAA####" where A is an uppercase
* letter and # is a hex digit. A valid ACPI ID must be of the form
* "ACPI####" where # is a hex digit.
* "NNNN####" where N is an uppercase letter or decimal digit, and
* # is a hex digit.
*/
for (Dest = NewString->String.Pointer; *Source; Dest++, Source++)
{
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -477,7 +477,7 @@ AcpiNsBuildInternalName (
if (!AcpiNsValidPathSeparator (*ExternalName) &&
(*ExternalName != 0))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
return_ACPI_STATUS (AE_BAD_PATHNAME);
}
/* Move on the next segment */
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -603,37 +603,57 @@ static ACPI_PARSE_OBJECT *
AcpiPsGetNextField (
ACPI_PARSE_STATE *ParserState)
{
UINT32 AmlOffset = (UINT32)
ACPI_PTR_DIFF (ParserState->Aml,
ParserState->AmlStart);
UINT32 AmlOffset;
ACPI_PARSE_OBJECT *Field;
ACPI_PARSE_OBJECT *Arg = NULL;
UINT16 Opcode;
UINT32 Name;
UINT8 AccessType;
UINT8 AccessAttribute;
UINT8 AccessLength;
UINT32 PkgLength;
UINT8 *PkgEnd;
UINT32 BufferLength;
ACPI_FUNCTION_TRACE (PsGetNextField);
AmlOffset = (UINT32) ACPI_PTR_DIFF (
ParserState->Aml, ParserState->AmlStart);
/* Determine field type */
switch (ACPI_GET8 (ParserState->Aml))
{
default:
Opcode = AML_INT_NAMEDFIELD_OP;
break;
case 0x00:
case AML_FIELD_OFFSET_OP:
Opcode = AML_INT_RESERVEDFIELD_OP;
ParserState->Aml++;
break;
case 0x01:
case AML_FIELD_ACCESS_OP:
Opcode = AML_INT_ACCESSFIELD_OP;
ParserState->Aml++;
break;
case AML_FIELD_CONNECTION_OP:
Opcode = AML_INT_CONNECTION_OP;
ParserState->Aml++;
break;
case AML_FIELD_EXT_ACCESS_OP:
Opcode = AML_INT_EXTACCESSFIELD_OP;
ParserState->Aml++;
break;
default:
Opcode = AML_INT_NAMEDFIELD_OP;
break;
}
/* Allocate a new field op */
@@ -673,17 +693,118 @@ AcpiPsGetNextField (
case AML_INT_ACCESSFIELD_OP:
case AML_INT_EXTACCESSFIELD_OP:
/*
* Get AccessType and AccessAttrib and merge into the field Op
* AccessType is first operand, AccessAttribute is second
* AccessType is first operand, AccessAttribute is second. stuff
* these bytes into the node integer value for convenience.
*/
Field->Common.Value.Integer = (((UINT32) ACPI_GET8 (ParserState->Aml) << 8));
/* Get the two bytes (Type/Attribute) */
AccessType = ACPI_GET8 (ParserState->Aml);
ParserState->Aml++;
Field->Common.Value.Integer |= ACPI_GET8 (ParserState->Aml);
AccessAttribute = ACPI_GET8 (ParserState->Aml);
ParserState->Aml++;
Field->Common.Value.Integer = (UINT8) AccessType;
Field->Common.Value.Integer |= (UINT16) (AccessAttribute << 8);
/* This opcode has a third byte, AccessLength */
if (Opcode == AML_INT_EXTACCESSFIELD_OP)
{
AccessLength = ACPI_GET8 (ParserState->Aml);
ParserState->Aml++;
Field->Common.Value.Integer |= (UINT32) (AccessLength << 16);
}
break;
case AML_INT_CONNECTION_OP:
/*
* Argument for Connection operator can be either a Buffer
* (resource descriptor), or a NameString.
*/
if (ACPI_GET8 (ParserState->Aml) == AML_BUFFER_OP)
{
ParserState->Aml++;
PkgEnd = ParserState->Aml;
PkgLength = AcpiPsGetNextPackageLength (ParserState);
PkgEnd += PkgLength;
if (ParserState->Aml < PkgEnd)
{
/* Non-empty list */
Arg = AcpiPsAllocOp (AML_INT_BYTELIST_OP);
if (!Arg)
{
AcpiPsFreeOp (Field);
return_PTR (NULL);
}
/* Get the actual buffer length argument */
Opcode = ACPI_GET8 (ParserState->Aml);
ParserState->Aml++;
switch (Opcode)
{
case AML_BYTE_OP: /* AML_BYTEDATA_ARG */
BufferLength = ACPI_GET8 (ParserState->Aml);
ParserState->Aml += 1;
break;
case AML_WORD_OP: /* AML_WORDDATA_ARG */
BufferLength = ACPI_GET16 (ParserState->Aml);
ParserState->Aml += 2;
break;
case AML_DWORD_OP: /* AML_DWORDATA_ARG */
BufferLength = ACPI_GET32 (ParserState->Aml);
ParserState->Aml += 4;
break;
default:
BufferLength = 0;
break;
}
/* Fill in bytelist data */
Arg->Named.Value.Size = BufferLength;
Arg->Named.Data = ParserState->Aml;
}
/* Skip to End of byte data */
ParserState->Aml = PkgEnd;
}
else
{
Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP);
if (!Arg)
{
AcpiPsFreeOp (Field);
return_PTR (NULL);
}
/* Get the Namestring argument */
Arg->Common.Value.Name = AcpiPsGetNextNamestring (ParserState);
}
/* Link the buffer/namestring to parent (CONNECTION_OP) */
AcpiPsAppendArg (Field, Arg);
break;
default:
/* Opcode was set in previous switch */
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -400,12 +400,17 @@ const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES] =
/* 79 */ ACPI_OP ("Mid", ARGP_MID_OP, ARGI_MID_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_1T_1R, AML_FLAGS_EXEC_3A_1T_1R | AML_CONSTANT),
/* 7A */ ACPI_OP ("Continue", ARGP_CONTINUE_OP, ARGI_CONTINUE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
/* 7B */ ACPI_OP ("LoadTable", ARGP_LOAD_TABLE_OP, ARGI_LOAD_TABLE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R),
/* 7C */ ACPI_OP ("DataTableRegion", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER),
/* 7C */ ACPI_OP ("DataTableRegion", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER),
/* 7D */ ACPI_OP ("[EvalSubTree]", ARGP_SCOPE_OP, ARGI_SCOPE_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE),
/* ACPI 3.0 opcodes */
/* 7E */ ACPI_OP ("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_0A_0T_1R, AML_FLAGS_EXEC_0A_0T_1R)
/* 7E */ ACPI_OP ("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_0A_0T_1R, AML_FLAGS_EXEC_0A_0T_1R),
/* ACPI 5.0 opcodes */
/* 7F */ ACPI_OP ("-ConnectField-", ARGP_CONNECTFIELD_OP, ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS),
/* 80 */ ACPI_OP ("-ExtAccessField-", ARGP_CONNECTFIELD_OP, ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0)
/*! [End] no source code translation !*/
};
@@ -425,7 +430,7 @@ static const UINT8 AcpiGbl_ShortOpIndex[256] =
/* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
/* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX,
/* 0x30 */ 0x67, 0x66, 0x68, 0x65, 0x69, 0x64, 0x6A, 0x7D,
/* 0x38 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
/* 0x38 */ 0x7F, 0x80, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
/* 0x40 */ _UNK, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC,
/* 0x48 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC,
/* 0x50 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC,
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -157,7 +157,12 @@ AcpiPsGetArg (
ACPI_FUNCTION_ENTRY ();
/*
if (Op->Common.AmlOpcode == AML_INT_CONNECTION_OP)
{
return (Op->Common.Value.Arg);
}
*/
/* Get the info structure for this opcode */
OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -420,8 +420,8 @@ AcpiPsExecuteMethod (
}
/*
* Start method evaluation with an implicit return of zero. This is done
* for Windows compatibility.
* Start method evaluation with an implicit return of zero.
* This is done for Windows compatibility.
*/
if (AcpiGbl_EnableInterpreterSlack)
{

Some files were not shown because too many files have changed in this diff Show More