Update ACPICA to 20140724.
Previous update was 20121018. So it was about time don't you think? I think so :) * ACPI 5.1 is fully supported in ACPICA as of this release. Changes are so many that I can just point to the Changelog: https://acpica.org/sites/acpica/files/changes_13.txt Here is the work in progress: http://instagram.com/p/sCxrHnh2sU/
This commit is contained in:
@@ -6,3 +6,5 @@ build/user_config_headers
|
||||
*~
|
||||
# Vim swp files
|
||||
.*.swp
|
||||
|
||||
conf.sh
|
||||
|
||||
@@ -8,6 +8,10 @@ SubDirCcFlags -D_KERNEL_MODE ;
|
||||
|
||||
|
||||
local common_src =
|
||||
acgetline.c
|
||||
ahids.c
|
||||
ahuuids.c
|
||||
cmfsize.c
|
||||
dmtbdump.c
|
||||
dmtbinfo.c
|
||||
;
|
||||
@@ -143,6 +147,7 @@ local resources_src =
|
||||
;
|
||||
|
||||
local tables_src =
|
||||
tbdata.c
|
||||
tbfadt.c
|
||||
tbfind.c
|
||||
tbinstal.c
|
||||
@@ -166,7 +171,9 @@ local utilities_src =
|
||||
uterror.c
|
||||
uteval.c
|
||||
utexcep.c
|
||||
utfileio.c
|
||||
utglobal.c
|
||||
uthex.c
|
||||
utids.c
|
||||
utinit.c
|
||||
utlock.c
|
||||
@@ -177,10 +184,12 @@ local utilities_src =
|
||||
utosi.c
|
||||
utownerid.c
|
||||
utpredef.c
|
||||
utprint.c
|
||||
utresrc.c
|
||||
utstate.c
|
||||
utstring.c
|
||||
uttrack.c
|
||||
utuuid.c
|
||||
utxface.c
|
||||
utxferror.c
|
||||
utxfinit.c
|
||||
|
||||
@@ -0,0 +1,512 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: acgetline - local line editing
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, 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"
|
||||
#include "amlcode.h"
|
||||
#include "acparser.h"
|
||||
#include "acdebug.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
* This is an os-independent implementation of line-editing services needed
|
||||
* by the AcpiExec utility. It uses getchar() and putchar() and the existing
|
||||
* history support provided by the AML debugger. It assumes that the terminal
|
||||
* is in the correct line-editing mode such as raw and noecho. The OSL
|
||||
* interface AcpiOsInitialize should do this. AcpiOsTerminate should put the
|
||||
* terminal back into the original mode.
|
||||
*/
|
||||
#define _COMPONENT ACPI_OS_SERVICES
|
||||
ACPI_MODULE_NAME ("acgetline")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
AcpiAcClearLine (
|
||||
UINT32 EndOfLine,
|
||||
UINT32 CursorPosition);
|
||||
|
||||
/* Various ASCII constants */
|
||||
|
||||
#define _ASCII_NUL 0
|
||||
#define _ASCII_BACKSPACE 0x08
|
||||
#define _ASCII_TAB 0x09
|
||||
#define _ASCII_ESCAPE 0x1B
|
||||
#define _ASCII_SPACE 0x20
|
||||
#define _ASCII_LEFT_BRACKET 0x5B
|
||||
#define _ASCII_DEL 0x7F
|
||||
#define _ASCII_UP_ARROW 'A'
|
||||
#define _ASCII_DOWN_ARROW 'B'
|
||||
#define _ASCII_RIGHT_ARROW 'C'
|
||||
#define _ASCII_LEFT_ARROW 'D'
|
||||
#define _ASCII_NEWLINE '\n'
|
||||
|
||||
extern UINT32 AcpiGbl_NextCmdNum;
|
||||
|
||||
/* Erase a single character on the input command line */
|
||||
|
||||
#define ACPI_CLEAR_CHAR() \
|
||||
putchar (_ASCII_BACKSPACE); \
|
||||
putchar (_ASCII_SPACE); \
|
||||
putchar (_ASCII_BACKSPACE);
|
||||
|
||||
/* Backup cursor by Count positions */
|
||||
|
||||
#define ACPI_BACKUP_CURSOR(i, Count) \
|
||||
for (i = 0; i < (Count); i++) \
|
||||
{putchar (_ASCII_BACKSPACE);}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiAcClearLine
|
||||
*
|
||||
* PARAMETERS: EndOfLine - Current end-of-line index
|
||||
* CursorPosition - Current cursor position within line
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Clear the entire command line the hard way, but probably the
|
||||
* most portable.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
static void
|
||||
AcpiAcClearLine (
|
||||
UINT32 EndOfLine,
|
||||
UINT32 CursorPosition)
|
||||
{
|
||||
UINT32 i;
|
||||
|
||||
|
||||
if (CursorPosition < EndOfLine)
|
||||
{
|
||||
/* Clear line from current position to end of line */
|
||||
|
||||
for (i = 0; i < (EndOfLine - CursorPosition); i++)
|
||||
{
|
||||
putchar (' ');
|
||||
}
|
||||
}
|
||||
|
||||
/* Clear the entire line */
|
||||
|
||||
for (; EndOfLine > 0; EndOfLine--)
|
||||
{
|
||||
ACPI_CLEAR_CHAR ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiOsGetLine
|
||||
*
|
||||
* PARAMETERS: Buffer - Where to return the command line
|
||||
* BufferLength - Maximum length of Buffer
|
||||
* BytesRead - Where the actual byte count is returned
|
||||
*
|
||||
* RETURN: Status and actual bytes read
|
||||
*
|
||||
* DESCRIPTION: Get the next input line from the terminal. NOTE: terminal
|
||||
* is expected to be in a mode that supports line-editing (raw,
|
||||
* noecho). This function is intended to be very portable. Also,
|
||||
* it uses the history support implemented in the AML debugger.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiOsGetLine (
|
||||
char *Buffer,
|
||||
UINT32 BufferLength,
|
||||
UINT32 *BytesRead)
|
||||
{
|
||||
char *NextCommand;
|
||||
UINT32 MaxCommandIndex = AcpiGbl_NextCmdNum - 1;
|
||||
UINT32 CurrentCommandIndex = MaxCommandIndex;
|
||||
UINT32 PreviousCommandIndex = MaxCommandIndex;
|
||||
int InputChar;
|
||||
UINT32 CursorPosition = 0;
|
||||
UINT32 EndOfLine = 0;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
/* Always clear the line buffer before we read a new line */
|
||||
|
||||
memset (Buffer, 0, BufferLength);
|
||||
|
||||
/*
|
||||
* This loop gets one character at a time (except for esc sequences)
|
||||
* until a newline or error is detected.
|
||||
*
|
||||
* Note: Don't attempt to write terminal control ESC sequences, even
|
||||
* though it makes certain things more difficult.
|
||||
*/
|
||||
while (1)
|
||||
{
|
||||
if (EndOfLine >= (BufferLength - 1))
|
||||
{
|
||||
return (AE_BUFFER_OVERFLOW);
|
||||
}
|
||||
|
||||
InputChar = getchar ();
|
||||
switch (InputChar)
|
||||
{
|
||||
default: /* This is the normal character case */
|
||||
|
||||
/* Echo the character (at EOL) and copy it to the line buffer */
|
||||
|
||||
if (EndOfLine == CursorPosition)
|
||||
{
|
||||
putchar (InputChar);
|
||||
Buffer[EndOfLine] = (char) InputChar;
|
||||
|
||||
EndOfLine++;
|
||||
CursorPosition++;
|
||||
Buffer[EndOfLine] = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Insert character into the middle of the buffer */
|
||||
|
||||
memmove (&Buffer[CursorPosition + 1], &Buffer[CursorPosition],
|
||||
(EndOfLine - CursorPosition + 1));
|
||||
|
||||
Buffer [CursorPosition] = (char) InputChar;
|
||||
Buffer [EndOfLine + 1] = 0;
|
||||
|
||||
/* Display the new part of line starting at the new character */
|
||||
|
||||
fprintf (stdout, "%s", &Buffer[CursorPosition]);
|
||||
|
||||
/* Restore cursor */
|
||||
|
||||
ACPI_BACKUP_CURSOR (i, EndOfLine - CursorPosition);
|
||||
CursorPosition++;
|
||||
EndOfLine++;
|
||||
continue;
|
||||
|
||||
case _ASCII_DEL: /* Backspace key */
|
||||
|
||||
if (!EndOfLine) /* Any characters on the command line? */
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (EndOfLine == CursorPosition) /* Erase the final character */
|
||||
{
|
||||
ACPI_CLEAR_CHAR ();
|
||||
EndOfLine--;
|
||||
CursorPosition--;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!CursorPosition) /* Do not backup beyond start of line */
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Remove the character from the line */
|
||||
|
||||
memmove (&Buffer[CursorPosition - 1], &Buffer[CursorPosition],
|
||||
(EndOfLine - CursorPosition + 1));
|
||||
|
||||
/* Display the new part of line starting at the new character */
|
||||
|
||||
putchar (_ASCII_BACKSPACE);
|
||||
fprintf (stdout, "%s ", &Buffer[CursorPosition - 1]);
|
||||
|
||||
/* Restore cursor */
|
||||
|
||||
ACPI_BACKUP_CURSOR (i, EndOfLine - CursorPosition + 1);
|
||||
EndOfLine--;
|
||||
if (CursorPosition > 0)
|
||||
{
|
||||
CursorPosition--;
|
||||
}
|
||||
continue;
|
||||
|
||||
case _ASCII_NEWLINE: /* Normal exit case at end of command line */
|
||||
case _ASCII_NUL:
|
||||
|
||||
/* Return the number of bytes in the command line string */
|
||||
|
||||
if (BytesRead)
|
||||
{
|
||||
*BytesRead = EndOfLine;
|
||||
}
|
||||
|
||||
/* Echo, terminate string buffer, and exit */
|
||||
|
||||
putchar (InputChar);
|
||||
Buffer[EndOfLine] = 0;
|
||||
return (AE_OK);
|
||||
|
||||
case _ASCII_TAB:
|
||||
|
||||
/* Ignore */
|
||||
|
||||
continue;
|
||||
|
||||
case EOF:
|
||||
|
||||
return (AE_ERROR);
|
||||
|
||||
case _ASCII_ESCAPE:
|
||||
|
||||
/* Check for escape sequences of the form "ESC[x" */
|
||||
|
||||
InputChar = getchar ();
|
||||
if (InputChar != _ASCII_LEFT_BRACKET)
|
||||
{
|
||||
continue; /* Ignore this ESC, does not have the '[' */
|
||||
}
|
||||
|
||||
/* Get the code following the ESC [ */
|
||||
|
||||
InputChar = getchar (); /* Backup one character */
|
||||
switch (InputChar)
|
||||
{
|
||||
case _ASCII_LEFT_ARROW:
|
||||
|
||||
if (CursorPosition > 0)
|
||||
{
|
||||
putchar (_ASCII_BACKSPACE);
|
||||
CursorPosition--;
|
||||
}
|
||||
continue;
|
||||
|
||||
case _ASCII_RIGHT_ARROW:
|
||||
/*
|
||||
* Move one character forward. Do this without sending
|
||||
* ESC sequence to the terminal for max portability.
|
||||
*/
|
||||
if (CursorPosition < EndOfLine)
|
||||
{
|
||||
/* Backup to start of line and print the entire line */
|
||||
|
||||
ACPI_BACKUP_CURSOR (i, CursorPosition);
|
||||
fprintf (stdout, "%s", Buffer);
|
||||
|
||||
/* Backup to where the cursor should be */
|
||||
|
||||
CursorPosition++;
|
||||
ACPI_BACKUP_CURSOR (i, EndOfLine - CursorPosition);
|
||||
}
|
||||
continue;
|
||||
|
||||
case _ASCII_UP_ARROW:
|
||||
|
||||
/* If no commands available or at start of history list, ignore */
|
||||
|
||||
if (!CurrentCommandIndex)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Manage our up/down progress */
|
||||
|
||||
if (CurrentCommandIndex > PreviousCommandIndex)
|
||||
{
|
||||
CurrentCommandIndex = PreviousCommandIndex;
|
||||
}
|
||||
|
||||
/* Get the historical command from the debugger */
|
||||
|
||||
NextCommand = AcpiDbGetHistoryByIndex (CurrentCommandIndex);
|
||||
if (!NextCommand)
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Make this the active command and echo it */
|
||||
|
||||
AcpiAcClearLine (EndOfLine, CursorPosition);
|
||||
strcpy (Buffer, NextCommand);
|
||||
fprintf (stdout, "%s", Buffer);
|
||||
EndOfLine = CursorPosition = strlen (Buffer);
|
||||
|
||||
PreviousCommandIndex = CurrentCommandIndex;
|
||||
CurrentCommandIndex--;
|
||||
continue;
|
||||
|
||||
case _ASCII_DOWN_ARROW:
|
||||
|
||||
if (!MaxCommandIndex) /* Any commands available? */
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Manage our up/down progress */
|
||||
|
||||
if (CurrentCommandIndex < PreviousCommandIndex)
|
||||
{
|
||||
CurrentCommandIndex = PreviousCommandIndex;
|
||||
}
|
||||
|
||||
/* If we are the end of the history list, output a clear new line */
|
||||
|
||||
if ((CurrentCommandIndex + 1) > MaxCommandIndex)
|
||||
{
|
||||
AcpiAcClearLine (EndOfLine, CursorPosition);
|
||||
EndOfLine = CursorPosition = 0;
|
||||
PreviousCommandIndex = CurrentCommandIndex;
|
||||
continue;
|
||||
}
|
||||
|
||||
PreviousCommandIndex = CurrentCommandIndex;
|
||||
CurrentCommandIndex++;
|
||||
|
||||
/* Get the historical command from the debugger */
|
||||
|
||||
NextCommand = AcpiDbGetHistoryByIndex (CurrentCommandIndex);
|
||||
if (!NextCommand)
|
||||
{
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Make this the active command and echo it */
|
||||
|
||||
AcpiAcClearLine (EndOfLine, CursorPosition);
|
||||
strcpy (Buffer, NextCommand);
|
||||
fprintf (stdout, "%s", Buffer);
|
||||
EndOfLine = CursorPosition = strlen (Buffer);
|
||||
continue;
|
||||
|
||||
case 0x31:
|
||||
case 0x32:
|
||||
case 0x33:
|
||||
case 0x34:
|
||||
case 0x35:
|
||||
case 0x36:
|
||||
/*
|
||||
* Ignore the various keys like insert/delete/home/end, etc.
|
||||
* But we must eat the final character of the ESC sequence.
|
||||
*/
|
||||
InputChar = getchar ();
|
||||
continue;
|
||||
|
||||
default:
|
||||
|
||||
/* Ignore random escape sequences that we don't care about */
|
||||
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -271,20 +271,28 @@ FlGenerateFilename (
|
||||
{
|
||||
char *Position;
|
||||
char *NewFilename;
|
||||
char *DirectoryPosition;
|
||||
|
||||
|
||||
/*
|
||||
* Copy the original filename to a new buffer. Leave room for the worst case
|
||||
* where we append the suffix, an added dot and the null terminator.
|
||||
* Copy the original filename to a new buffer. Leave room for the worst
|
||||
* case where we append the suffix, an added dot and the null terminator.
|
||||
*/
|
||||
NewFilename = ACPI_ALLOCATE_ZEROED ((ACPI_SIZE)
|
||||
strlen (InputFilename) + strlen (Suffix) + 2);
|
||||
if (!NewFilename)
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
strcpy (NewFilename, InputFilename);
|
||||
|
||||
/* Try to find the last dot in the filename */
|
||||
|
||||
DirectoryPosition = strrchr (NewFilename, '/');
|
||||
Position = strrchr (NewFilename, '.');
|
||||
if (Position)
|
||||
|
||||
if (Position && (Position > DirectoryPosition))
|
||||
{
|
||||
/* Tack on the new suffix */
|
||||
|
||||
@@ -360,7 +368,6 @@ FlSplitInputPathname (
|
||||
|
||||
|
||||
*OutDirectoryPath = NULL;
|
||||
*OutFilename = NULL;
|
||||
|
||||
if (!InputPath)
|
||||
{
|
||||
@@ -402,10 +409,18 @@ FlSplitInputPathname (
|
||||
|
||||
if (!Filename)
|
||||
{
|
||||
ACPI_FREE (DirectoryPath);
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
*OutDirectoryPath = DirectoryPath;
|
||||
*OutFilename = Filename;
|
||||
|
||||
if (OutFilename)
|
||||
{
|
||||
*OutFilename = Filename;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_FREE (Filename);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -151,10 +151,6 @@ NsSetupNamespaceListing (
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static UINT32
|
||||
AdGetFileSize (
|
||||
FILE *File);
|
||||
|
||||
static void
|
||||
AdCreateTableHeader (
|
||||
char *Filename,
|
||||
@@ -227,38 +223,6 @@ 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
|
||||
@@ -278,7 +242,7 @@ AdInitialize (
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
/* ACPI CA subsystem initialization */
|
||||
/* ACPICA subsystem initialization */
|
||||
|
||||
Status = AcpiOsInitialize ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -322,7 +286,6 @@ AdInitialize (
|
||||
* OutToFile - TRUE if output should go to a file
|
||||
* Prefix - Path prefix for output
|
||||
* OutFilename - where the filename is returned
|
||||
* GetAllTables - TRUE if all tables are desired
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
@@ -335,8 +298,7 @@ AdAmlDisassemble (
|
||||
BOOLEAN OutToFile,
|
||||
char *Filename,
|
||||
char *Prefix,
|
||||
char **OutFilename,
|
||||
BOOLEAN GetAllTables)
|
||||
char **OutFilename)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
char *DisasmFilename = NULL;
|
||||
@@ -420,7 +382,7 @@ AdAmlDisassemble (
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = AdGetLocalTables (Filename, GetAllTables);
|
||||
Status = AdGetLocalTables ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiOsPrintf ("Could not get ACPI tables, %s\n",
|
||||
@@ -455,7 +417,7 @@ AdAmlDisassemble (
|
||||
/* Create/Open a disassembly output file */
|
||||
|
||||
DisasmFilename = FlGenerateFilename (Prefix, FILE_SUFFIX_DISASSEMBLY);
|
||||
if (!OutFilename)
|
||||
if (!DisasmFilename)
|
||||
{
|
||||
fprintf (stderr, "Could not generate output filename\n");
|
||||
Status = AE_ERROR;
|
||||
@@ -467,6 +429,7 @@ AdAmlDisassemble (
|
||||
{
|
||||
fprintf (stderr, "Could not open output file %s\n", DisasmFilename);
|
||||
Status = AE_ERROR;
|
||||
ACPI_FREE (DisasmFilename);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
@@ -487,7 +450,7 @@ AdAmlDisassemble (
|
||||
fprintf (stderr, "Acpi Data Table [%4.4s] decoded\n",
|
||||
Table->Signature);
|
||||
fprintf (stderr, "Formatted output: %s - %u bytes\n",
|
||||
DisasmFilename, AdGetFileSize (File));
|
||||
DisasmFilename, CmGetFileSize (File));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -543,9 +506,10 @@ AdAmlDisassemble (
|
||||
"reparsing with new information\n",
|
||||
AcpiDmGetExternalMethodCount ());
|
||||
|
||||
/* Reparse, rebuild namespace. no need to xref namespace */
|
||||
/* Reparse, rebuild namespace */
|
||||
|
||||
AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot);
|
||||
AcpiGbl_ParseOpRoot = NULL;
|
||||
AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode);
|
||||
|
||||
AcpiGbl_RootNode = NULL;
|
||||
@@ -559,6 +523,9 @@ AdAmlDisassemble (
|
||||
AcpiGbl_RootNodeStruct.Flags = 0;
|
||||
|
||||
Status = AcpiNsRootInitialize ();
|
||||
|
||||
/* New namespace, add the external definitions first */
|
||||
|
||||
AcpiDmAddExternalsToNamespace ();
|
||||
|
||||
/* Parse the table again. No need to reload it, however */
|
||||
@@ -571,6 +538,14 @@ AdAmlDisassemble (
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Cross reference the namespace again */
|
||||
|
||||
AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot,
|
||||
AcpiGbl_RootNode, OwnerId);
|
||||
|
||||
AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot,
|
||||
AcpiGbl_RootNode, OwnerId);
|
||||
|
||||
if (AslCompilerdebug)
|
||||
{
|
||||
AcpiOsPrintf ("/**** After second load and resource conversion\n");
|
||||
@@ -605,7 +580,7 @@ AdAmlDisassemble (
|
||||
|
||||
fprintf (stderr, "Disassembly completed\n");
|
||||
fprintf (stderr, "ASL Output: %s - %u bytes\n",
|
||||
DisasmFilename, AdGetFileSize (File));
|
||||
DisasmFilename, CmGetFileSize (File));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -642,7 +617,7 @@ Cleanup:
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Create the disassembler header, including ACPI CA signon with
|
||||
* DESCRIPTION: Create the disassembler header, including ACPICA signon with
|
||||
* current time and date.
|
||||
*
|
||||
*****************************************************************************/
|
||||
@@ -674,7 +649,7 @@ AdDisassemblerHeader (
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Create the ASL table header, including ACPI CA signon with
|
||||
* DESCRIPTION: Create the ASL table header, including ACPICA signon with
|
||||
* current time and date.
|
||||
*
|
||||
*****************************************************************************/
|
||||
@@ -752,8 +727,17 @@ AdCreateTableHeader (
|
||||
else
|
||||
{
|
||||
NewFilename = ACPI_ALLOCATE_ZEROED (9);
|
||||
strncat (NewFilename, Table->Signature, 4);
|
||||
strcat (NewFilename, ".aml");
|
||||
if (NewFilename)
|
||||
{
|
||||
strncat (NewFilename, Table->Signature, 4);
|
||||
strcat (NewFilename, ".aml");
|
||||
}
|
||||
}
|
||||
|
||||
if (!NewFilename)
|
||||
{
|
||||
AcpiOsPrintf (" **** Could not generate AML output filename\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Open the ASL definition block */
|
||||
@@ -818,8 +802,7 @@ AdDisplayTables (
|
||||
*
|
||||
* FUNCTION: AdGetLocalTables
|
||||
*
|
||||
* PARAMETERS: Filename - Not used
|
||||
* GetAllTables - TRUE if all tables are desired
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
@@ -829,105 +812,36 @@ AdDisplayTables (
|
||||
|
||||
ACPI_STATUS
|
||||
AdGetLocalTables (
|
||||
char *Filename,
|
||||
BOOLEAN GetAllTables)
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_TABLE_HEADER TableHeader;
|
||||
ACPI_TABLE_HEADER *NewTable;
|
||||
UINT32 NumTables;
|
||||
UINT32 PointerSize;
|
||||
UINT32 TableIndex;
|
||||
|
||||
|
||||
if (GetAllTables)
|
||||
{
|
||||
ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_RSDT);
|
||||
AcpiOsTableOverride (&TableHeader, &NewTable);
|
||||
if (!NewTable)
|
||||
{
|
||||
fprintf (stderr, "Could not obtain RSDT\n");
|
||||
return (AE_NO_ACPI_TABLES);
|
||||
}
|
||||
else
|
||||
{
|
||||
AdWriteTable (NewTable, NewTable->Length,
|
||||
ACPI_SIG_RSDT, NewTable->OemTableId);
|
||||
}
|
||||
|
||||
if (ACPI_COMPARE_NAME (NewTable->Signature, ACPI_SIG_RSDT))
|
||||
{
|
||||
PointerSize = sizeof (UINT32);
|
||||
}
|
||||
else
|
||||
{
|
||||
PointerSize = sizeof (UINT64);
|
||||
}
|
||||
|
||||
/*
|
||||
* Determine the number of tables pointed to by the RSDT/XSDT.
|
||||
* This is defined by the ACPI Specification to be the number of
|
||||
* pointers contained within the RSDT/XSDT. The size of the pointers
|
||||
* is architecture-dependent.
|
||||
*/
|
||||
NumTables = (NewTable->Length - sizeof (ACPI_TABLE_HEADER)) / PointerSize;
|
||||
AcpiOsPrintf ("There are %u tables defined in the %4.4s\n\n",
|
||||
NumTables, NewTable->Signature);
|
||||
|
||||
/* Get the FADT */
|
||||
|
||||
ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_FADT);
|
||||
AcpiOsTableOverride (&TableHeader, &NewTable);
|
||||
if (NewTable)
|
||||
{
|
||||
AdWriteTable (NewTable, NewTable->Length,
|
||||
ACPI_SIG_FADT, NewTable->OemTableId);
|
||||
}
|
||||
AcpiOsPrintf ("\n");
|
||||
|
||||
/* Don't bother with FACS, it is usually all zeros */
|
||||
}
|
||||
|
||||
/* Always get the DSDT */
|
||||
/* Get the DSDT via table override */
|
||||
|
||||
ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_DSDT);
|
||||
AcpiOsTableOverride (&TableHeader, &NewTable);
|
||||
if (NewTable)
|
||||
{
|
||||
AdWriteTable (NewTable, NewTable->Length,
|
||||
ACPI_SIG_DSDT, NewTable->OemTableId);
|
||||
|
||||
/* Store DSDT in the Table Manager */
|
||||
|
||||
Status = AcpiTbStoreTable (0, NewTable, NewTable->Length,
|
||||
0, &TableIndex);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
fprintf (stderr, "Could not store DSDT\n");
|
||||
return (AE_NO_ACPI_TABLES);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!NewTable)
|
||||
{
|
||||
fprintf (stderr, "Could not obtain DSDT\n");
|
||||
return (AE_NO_ACPI_TABLES);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* TBD: Future implementation */
|
||||
AdWriteTable (NewTable, NewTable->Length,
|
||||
ACPI_SIG_DSDT, NewTable->OemTableId);
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
/* Store DSDT in the Table Manager */
|
||||
|
||||
/* Get all SSDTs */
|
||||
|
||||
ACPI_MOVE_32_TO_32 (TableHeader.Signature, ACPI_SIG_SSDT);
|
||||
do
|
||||
Status = AcpiTbStoreTable (0, NewTable, NewTable->Length,
|
||||
0, &TableIndex);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
NewTable = NULL;
|
||||
Status = AcpiOsTableOverride (&TableHeader, &NewTable);
|
||||
|
||||
} while (NewTable);
|
||||
#endif
|
||||
fprintf (stderr, "Could not store DSDT\n");
|
||||
return (AE_NO_ACPI_TABLES);
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
@@ -1016,7 +930,8 @@ AdParseTable (
|
||||
if (LoadTable)
|
||||
{
|
||||
Status = AcpiTbStoreTable ((ACPI_PHYSICAL_ADDRESS) Table, Table,
|
||||
Table->Length, ACPI_TABLE_ORIGIN_ALLOCATED, &TableIndex);
|
||||
Table->Length, ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL,
|
||||
&TableIndex);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
@@ -1051,9 +966,12 @@ AdParseTable (
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* Pass 3: Parse control methods and link their parse trees into the main parse tree */
|
||||
|
||||
fprintf (stderr, "Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)\n");
|
||||
/*
|
||||
* Pass 3: Parse control methods and link their parse trees
|
||||
* into the main parse tree
|
||||
*/
|
||||
fprintf (stderr,
|
||||
"Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)\n");
|
||||
Status = AcpiDmParseDeferredOps (AcpiGbl_ParseOpRoot);
|
||||
fprintf (stderr, "\n");
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -541,8 +541,9 @@ AcpiDmFindOrphanDescending (
|
||||
!ChildOp->Common.Node)
|
||||
{
|
||||
AcpiNsExternalizeName (ACPI_UINT32_MAX, ChildOp->Common.Value.String,
|
||||
NULL, &Path);
|
||||
AcpiOsPrintf ("/* %-16s A-NAMEPATH: %s */\n", Op->Common.AmlOpName, Path);
|
||||
NULL, &Path);
|
||||
AcpiOsPrintf ("/* %-16s A-NAMEPATH: %s */\n",
|
||||
Op->Common.AmlOpName, Path);
|
||||
ACPI_FREE (Path);
|
||||
|
||||
NextOp = Op->Common.Next;
|
||||
@@ -550,22 +551,26 @@ AcpiDmFindOrphanDescending (
|
||||
{
|
||||
/* This NamePath has no args, assume it is an integer */
|
||||
|
||||
AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
|
||||
AcpiDmAddOpToExternalList (ChildOp,
|
||||
ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
ArgCount = AcpiDmInspectPossibleArgs (3, 1, NextOp);
|
||||
AcpiOsPrintf ("/* A-CHILDREN: %u Actual %u */\n", ArgCount, AcpiDmCountChildren (Op));
|
||||
AcpiOsPrintf ("/* A-CHILDREN: %u Actual %u */\n",
|
||||
ArgCount, AcpiDmCountChildren (Op));
|
||||
|
||||
if (ArgCount < 1)
|
||||
{
|
||||
/* One Arg means this is just a Store(Name,Target) */
|
||||
|
||||
AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
|
||||
AcpiDmAddOpToExternalList (ChildOp,
|
||||
ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
|
||||
AcpiDmAddOpToExternalList (ChildOp,
|
||||
ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
@@ -581,7 +586,8 @@ AcpiDmFindOrphanDescending (
|
||||
{
|
||||
/* This NamePath has no args, assume it is an integer */
|
||||
|
||||
AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
|
||||
AcpiDmAddOpToExternalList (ChildOp,
|
||||
ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
@@ -590,11 +596,13 @@ AcpiDmFindOrphanDescending (
|
||||
{
|
||||
/* One Arg means this is just a Store(Name,Target) */
|
||||
|
||||
AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
|
||||
AcpiDmAddOpToExternalList (ChildOp,
|
||||
ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
|
||||
AcpiDmAddOpToExternalList (ChildOp,
|
||||
ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -626,7 +634,8 @@ AcpiDmFindOrphanDescending (
|
||||
/* And namepath is the first argument */
|
||||
(ParentOp->Common.Value.Arg == Op))
|
||||
{
|
||||
AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_INTEGER, 0);
|
||||
AcpiDmAddOpToExternalList (Op,
|
||||
Op->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -636,8 +645,8 @@ AcpiDmFindOrphanDescending (
|
||||
* operator) - it *must* be a method invocation, nothing else is
|
||||
* grammatically possible.
|
||||
*/
|
||||
AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
|
||||
|
||||
AcpiDmAddOpToExternalList (Op,
|
||||
Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -813,6 +822,7 @@ AcpiDmXrefDescendingOp (
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_OPERAND_OBJECT *Object;
|
||||
UINT32 ParamCount = 0;
|
||||
char *Pathname;
|
||||
|
||||
|
||||
WalkState = Info->WalkState;
|
||||
@@ -822,11 +832,13 @@ AcpiDmXrefDescendingOp (
|
||||
|
||||
if ((!(OpInfo->Flags & AML_NAMED)) &&
|
||||
(!(OpInfo->Flags & AML_CREATE)) &&
|
||||
(Op->Common.AmlOpcode != AML_INT_NAMEPATH_OP))
|
||||
(Op->Common.AmlOpcode != AML_INT_NAMEPATH_OP) &&
|
||||
(Op->Common.AmlOpcode != AML_NOTIFY_OP))
|
||||
{
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
||||
/* Get the NamePath from the appropriate place */
|
||||
|
||||
if (OpInfo->Flags & AML_NAMED)
|
||||
@@ -863,6 +875,10 @@ AcpiDmXrefDescendingOp (
|
||||
Path = NextOp->Common.Value.String;
|
||||
}
|
||||
}
|
||||
else if (Op->Common.AmlOpcode == AML_NOTIFY_OP)
|
||||
{
|
||||
Path = Op->Common.Value.Arg->Asl.Value.String;
|
||||
}
|
||||
else
|
||||
{
|
||||
Path = Op->Common.Value.String;
|
||||
@@ -880,11 +896,14 @@ AcpiDmXrefDescendingOp (
|
||||
* The namespace is also used as a lookup table for references to resource
|
||||
* descriptors and the fields within them.
|
||||
*/
|
||||
Node = NULL;
|
||||
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))
|
||||
{
|
||||
/* Node was created by an External() statement */
|
||||
|
||||
Status = AE_NOT_FOUND;
|
||||
}
|
||||
|
||||
@@ -892,25 +911,38 @@ AcpiDmXrefDescendingOp (
|
||||
{
|
||||
if (Status == AE_NOT_FOUND)
|
||||
{
|
||||
AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType, 0);
|
||||
|
||||
/*
|
||||
* We could install this into the namespace, but we catch duplicate
|
||||
* externals when they are added to the list.
|
||||
* Add this symbol as an external declaration, except if the
|
||||
* parent is a CondRefOf operator. For this operator, we do not
|
||||
* need an external, nor do we want one, since this can cause
|
||||
* disassembly problems if the symbol is actually a control
|
||||
* method.
|
||||
*/
|
||||
#if 0
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
|
||||
ACPI_IMODE_LOAD_PASS1, ACPI_NS_DONT_OPEN_SCOPE,
|
||||
WalkState, &Node);
|
||||
#endif
|
||||
if (!(Op->Asl.Parent &&
|
||||
(Op->Asl.Parent->Asl.AmlOpcode == AML_COND_REF_OF_OP)))
|
||||
{
|
||||
if (Node)
|
||||
{
|
||||
AcpiDmAddNodeToExternalList (Node,
|
||||
(UINT8) ObjectType, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiDmAddOpToExternalList (Op, Path,
|
||||
(UINT8) ObjectType, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Found the node in external table, add it to external list
|
||||
* Node->OwnerId == 0 indicates built-in ACPI Names, _OS_ etc
|
||||
* Found the node, but check if it came from an external table.
|
||||
* Add it to external list. Note: Node->OwnerId == 0 indicates
|
||||
* one of the built-in ACPI Names (_OS_ etc.) which can safely
|
||||
* be ignored.
|
||||
*/
|
||||
else if (Node->OwnerId && WalkState->OwnerId != Node->OwnerId)
|
||||
else if (Node->OwnerId &&
|
||||
(WalkState->OwnerId != Node->OwnerId))
|
||||
{
|
||||
ObjectType2 = ObjectType;
|
||||
|
||||
@@ -924,7 +956,16 @@ AcpiDmXrefDescendingOp (
|
||||
}
|
||||
}
|
||||
|
||||
AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, ParamCount | 0x80);
|
||||
Pathname = AcpiNsGetExternalPathname (Node);
|
||||
if (!Pathname)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
AcpiDmAddNodeToExternalList (Node, (UINT8) ObjectType2,
|
||||
ParamCount, ACPI_EXT_RESOLVED_REFERENCE);
|
||||
|
||||
ACPI_FREE (Pathname);
|
||||
Op->Common.Node = Node;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -0,0 +1,290 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: ahids - Table of ACPI/PNP _HID/_CID values
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, 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_UTILITIES
|
||||
ACPI_MODULE_NAME ("ahids")
|
||||
|
||||
|
||||
/*
|
||||
* ACPI/PNP Device IDs with description strings
|
||||
*/
|
||||
const AH_DEVICE_ID AslDeviceIds[] =
|
||||
{
|
||||
{"10EC5640", "Realtek I2S Audio Codec"},
|
||||
{"80860F0A", "Intel Atom UART Controller"},
|
||||
{"80860F14", "Intel Baytrail SDIO/MMC Host Controller"},
|
||||
{"80860F28", "Intel SST Audio DSP"},
|
||||
{"80860F41", "Intel Baytrail I2C Host Controller"},
|
||||
{"ACPI0001", "SMBus 1.0 Host Controller"},
|
||||
{"ACPI0002", "Smart Battery Subsystem"},
|
||||
{"ACPI0003", "Power Source Device"},
|
||||
{"ACPI0004", "Module Device"},
|
||||
{"ACPI0005", "SMBus 2.0 Host Controller"},
|
||||
{"ACPI0006", "GPE Block Device"},
|
||||
{"ACPI0007", "Processor Device"},
|
||||
{"ACPI0008", "Ambient Light Sensor Device"},
|
||||
{"ACPI0009", "I/O xAPIC Device"},
|
||||
{"ACPI000A", "I/O APIC Device"},
|
||||
{"ACPI000B", "I/O SAPIC Device"},
|
||||
{"ACPI000C", "Processor Aggregator Device"},
|
||||
{"ACPI000D", "Power Meter Device"},
|
||||
{"ACPI000E", "Time and Alarm Device"},
|
||||
{"ACPI000F", "User Presence Detection Device"},
|
||||
{"ATK4001", "Asus Radio Control Button"},
|
||||
{"ATML1000", "Atmel Touchscreen Controller"},
|
||||
{"BCM2E39", "Broadcom BT Serial Bus Driver over UART Bus Enumerator"},
|
||||
{"CPLM3218", "Capella Micro CM3218x Ambient Light Sensor"},
|
||||
{"DELLABCE", "Dell Airplane Mode Switch Driver"},
|
||||
{"DLAC3002", "Qualcomm Atheros Bluetooth UART Transport"},
|
||||
{"INT0002", "Virtual GPIO Controller"},
|
||||
{"INT0800", "Intel 82802 Firmware Hub Device"},
|
||||
{"INT3394", "ACPI System Fan"},
|
||||
{"INT3396", "Standard Power Management Controller"},
|
||||
{"INT33A0", "Intel Smart Connect Technology Device"},
|
||||
{"INT33A1", "Intel Power Engine"},
|
||||
{"INT33BB", "Intel Baytrail SD Host Controller"},
|
||||
{"INT33BD", "Intel Baytrail Mailbox Device"},
|
||||
{"INT33C0", "Intel Serial I/O SPI Host Controller"},
|
||||
{"INT33C1", "Intel Serial I/O SPI Host Controller"},
|
||||
{"INT33C2", "Intel Serial I/O I2C Host Controller"},
|
||||
{"INT33C3", "Intel Serial I/O I2C Host Controller"},
|
||||
{"INT33C4", "Intel Serial I/O UART Host Controller"},
|
||||
{"INT33C5", "Intel Serial I/O UART Host Controller"},
|
||||
{"INT33C6", "Intel SD Host Controller"},
|
||||
{"INT33C7", "Intel Serial I/O GPIO Host Controller"},
|
||||
{"INT33C8", "Intel Smart Sound Technology Host Controller"},
|
||||
{"INT33C9", "Wolfson Microelectronics Audio WM5102"},
|
||||
{"INT33CA", "Intel SPB Peripheral"},
|
||||
{"INT33CB", "Intel Smart Sound Technology Audio Codec"},
|
||||
{"INT33D1", "Intel GPIO Buttons"},
|
||||
{"INT33D2", "Intel GPIO Buttons"},
|
||||
{"INT33D3", "Intel GPIO Buttons"},
|
||||
{"INT33D4", "Intel GPIO Buttons"},
|
||||
{"INT33D6", "Intel Virtual Buttons Device"},
|
||||
{"INT33F0", "Camera Sensor MT9M114"},
|
||||
{"INT33FB", "MIPI-CSI Camera Sensor OV2722"},
|
||||
{"INT33FC", "Intel Baytrail GPIO Controller"},
|
||||
{"INT33FD", "Intel Baytrail Power Management IC"},
|
||||
{"INT3400", "Intel Dynamic Power Performance Management"},
|
||||
{"INT3401", "Intel Extended Thermal Model CPU"},
|
||||
{"INT3403", "DPTF Temperature Sensor"},
|
||||
{"INT3406", "Intel Dynamic Platform & Thermal Framework Display Participant"},
|
||||
{"INT3407", "DPTF Platform Power Meter"},
|
||||
{"INT340E", "Motherboard Resources"},
|
||||
{"INT3420", "Intel Bluetooth RF Kill"},
|
||||
{"INT3F0D", "ACPI Motherboard Resources"},
|
||||
{"INTCF1A", "Sony IMX175 Camera Sensor"},
|
||||
{"INTCFD9", "Intel Baytrail SOC GPIO Controller"},
|
||||
{"INTL9C60", "Intel Baytrail SOC DMA Controller"},
|
||||
{"INVN6500", "InvenSense MPU-6500 Six Axis Gyroscope and Accelerometer"},
|
||||
{"LNXCPU", "Linux Logical CPU"},
|
||||
{"LNXPOWER", "ACPI Power Resource (power gating)"},
|
||||
{"LNXPWRBN", "System Power Button"},
|
||||
{"LNXSYBUS", "System Bus"},
|
||||
{"LNXSYSTM", "ACPI Root Node"},
|
||||
{"LNXTHERM", "ACPI Thermal Zone"},
|
||||
{"LNXVIDEO", "ACPI Video Controller"},
|
||||
{"MSFT0101", "TPM 2.0 Security Device"},
|
||||
{"NXP5442", "NXP 5442 Near Field Communications Controller"},
|
||||
{"PNP0000", "8259-compatible Programmable Interrupt Controller"},
|
||||
{"PNP0001", "EISA Interrupt Controller"},
|
||||
{"PNP0002", "MCA Interrupt Controller"},
|
||||
{"PNP0003", "IO-APIC Interrupt Controller"},
|
||||
{"PNP0100", "PC-class System Timer"},
|
||||
{"PNP0103", "HPET System Timer"},
|
||||
{"PNP0200", "PC-class DMA Controller"},
|
||||
{"PNP0300", "IBM PC/XT Keyboard Controller (83 key)"},
|
||||
{"PNP0301", "IBM PC/XT Keyboard Controller (86 key)"},
|
||||
{"PNP0302", "IBM PC/XT Keyboard Controller (84 key)"},
|
||||
{"PNP0303", "IBM Enhanced Keyboard (101/102-key, PS/2 Mouse)"},
|
||||
{"PNP0400", "Standard LPT Parallel Port"},
|
||||
{"PNP0401", "ECP Parallel Port"},
|
||||
{"PNP0500", "Standard PC COM Serial Port"},
|
||||
{"PNP0501", "16550A-compatible COM Serial Port"},
|
||||
{"PNP0510", "Generic IRDA-compatible Device"},
|
||||
{"PNP0800", "Microsoft Sound System Compatible Device"},
|
||||
{"PNP0A03", "PCI Bus"},
|
||||
{"PNP0A05", "Generic Container Device"},
|
||||
{"PNP0A06", "Generic Container Device"},
|
||||
{"PNP0A08", "PCI Express Bus"},
|
||||
{"PNP0B00", "AT Real-Time Clock"},
|
||||
{"PNP0B01", "Intel PIIX4-compatible RTC/CMOS Device"},
|
||||
{"PNP0B02", "Dallas Semiconductor-compatible RTC/CMOS Device"},
|
||||
{"PNP0C01", "System Board"},
|
||||
{"PNP0C02", "PNP Motherboard Resources"},
|
||||
{"PNP0C04", "x87-compatible Floating Point Processing Unit"},
|
||||
{"PNP0C08", "ACPI Core Hardware"},
|
||||
{"PNP0C09", "Embedded Controller Device"},
|
||||
{"PNP0C0A", "Control Method Battery"},
|
||||
{"PNP0C0B", "Fan (Thermal Solution)"},
|
||||
{"PNP0C0C", "Power Button Device"},
|
||||
{"PNP0C0D", "Lid Device"},
|
||||
{"PNP0C0E", "Sleep Button Device"},
|
||||
{"PNP0C0F", "PCI Interrupt Link Device"},
|
||||
{"PNP0C10", "System Indicator Device"},
|
||||
{"PNP0C11", "Thermal Zone"},
|
||||
{"PNP0C12", "Device Bay Controller"},
|
||||
{"PNP0C14", "Windows Management Instrumentation Device"},
|
||||
{"PNP0C15", "Docking Station"},
|
||||
{"PNP0C40", "Standard Button Controller"},
|
||||
{"PNP0C50", "HID Protocol Device (I2C bus)"},
|
||||
{"PNP0C60", "Display Sensor Device"},
|
||||
{"PNP0C70", "Dock Sensor Device"},
|
||||
{"PNP0C80", "Memory Device"},
|
||||
{"PNP0D10", "XHCI USB Controller with debug"},
|
||||
{"PNP0D15", "XHCI USB Controller without debug"},
|
||||
{"PNP0D20", "EHCI USB Controller without debug"},
|
||||
{"PNP0D25", "EHCI USB Controller with debug"},
|
||||
{"PNP0D40", "SDA Standard Compliant SD Host Controller"},
|
||||
{"PNP0D80", "Windows-compatible System Power Management Controller"},
|
||||
{"PNP0F03", "Microsoft PS/2-style Mouse"},
|
||||
{"SMO91D0", "Sensor Hub"},
|
||||
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiAhMatchHardwareId
|
||||
*
|
||||
* PARAMETERS: HardwareId - String representation of an _HID or _CID
|
||||
*
|
||||
* RETURN: ID info struct. NULL if HardwareId is not found
|
||||
*
|
||||
* DESCRIPTION: Lookup an _HID/_CID in the device ID table
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
const AH_DEVICE_ID *
|
||||
AcpiAhMatchHardwareId (
|
||||
char *HardwareId)
|
||||
{
|
||||
const AH_DEVICE_ID *Info;
|
||||
|
||||
|
||||
for (Info = AslDeviceIds; Info->Name; Info++)
|
||||
{
|
||||
if (!ACPI_STRCMP (HardwareId, Info->Name))
|
||||
{
|
||||
return (Info);
|
||||
}
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -116,6 +116,9 @@
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
|
||||
#define _COMPONENT ACPI_UTILITIES
|
||||
ACPI_MODULE_NAME ("ahpredef")
|
||||
|
||||
/*
|
||||
* iASL only needs a partial table (short descriptions only).
|
||||
* AcpiHelp needs the full table.
|
||||
@@ -166,6 +169,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
|
||||
AH_PREDEF ("_BTM", "Battery Time", "Returns the battery runtime"),
|
||||
AH_PREDEF ("_BTP", "Battery Trip Point", "Sets a Control Method Battery trip point"),
|
||||
AH_PREDEF ("_CBA", "Configuration Base Address", "Sets the base address for a PCI Express host bridge"),
|
||||
AH_PREDEF ("_CCA", "Cache Coherency Attribute", "Returns a device's support level for cache coherency"),
|
||||
AH_PREDEF ("_CDM", "Clock Domain", "Returns a logical processor's clock domain identifier"),
|
||||
AH_PREDEF ("_CID", "Compatible ID", "Returns a device's Plug and Play Compatible ID list"),
|
||||
AH_PREDEF ("_CLS", "Class Code", "Returns PCI class code and subclass"),
|
||||
@@ -190,6 +194,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
|
||||
AH_PREDEF ("_DOS", "Disable Output Switching", "Sets the display output switching mode"),
|
||||
AH_PREDEF ("_DPL", "Device Selection Polarity", "Polarity of Device Selection signal, Resource Descriptor field"),
|
||||
AH_PREDEF ("_DRS", "Drive Strength", "Drive Strength setting for GPIO connection, Resource Descriptor field"),
|
||||
AH_PREDEF ("_DSD", "Device-Specific Data", "Returns a list of device property information"),
|
||||
AH_PREDEF ("_DSM", "Device-Specific Method", "Executes device-specific functions"),
|
||||
AH_PREDEF ("_DSS", "Device Set State", "Sets the display device state"),
|
||||
AH_PREDEF ("_DSW", "Device Sleep Wake", "Sets the sleep and wake transition states for a device"),
|
||||
@@ -241,6 +246,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
|
||||
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 ("_LPD", "Low Power Dependencies", "Returns a list of dependencies for low power idle entry"),
|
||||
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"),
|
||||
@@ -393,3 +399,34 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
|
||||
AH_PREDEF ("_Wxx", "Wake Event", "Method executed as a result of a wake event"),
|
||||
AH_PREDEF (NULL, NULL, NULL)
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiAhMatchPredefinedName
|
||||
*
|
||||
* PARAMETERS: Nameseg - Predefined name string
|
||||
*
|
||||
* RETURN: ID info struct. NULL if Nameseg not found
|
||||
*
|
||||
* DESCRIPTION: Lookup a predefined name.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
const AH_PREDEFINED_NAME *
|
||||
AcpiAhMatchPredefinedName (
|
||||
char *Nameseg)
|
||||
{
|
||||
const AH_PREDEFINED_NAME *Info;
|
||||
|
||||
|
||||
for (Info = AslPredefinedInfo; Info->Name; Info++)
|
||||
{
|
||||
if (ACPI_COMPARE_NAME (Nameseg, Info->Name))
|
||||
{
|
||||
return (Info);
|
||||
}
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: ahuuids - Table of known ACPI-related UUIDs
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, 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_UTILITIES
|
||||
ACPI_MODULE_NAME ("ahuuids")
|
||||
|
||||
/*
|
||||
* Table of "known" (ACPI-related) UUIDs
|
||||
*/
|
||||
const AH_UUID AcpiUuids[] =
|
||||
{
|
||||
{"PCI Host Bridge Device",
|
||||
"33db4d5b-1ff7-401c-9657-7441c03dd766"},
|
||||
|
||||
{"Platform-wide Capabilities",
|
||||
"0811b06e-4a27-44f9-8d60-3cbbc22e7b48"},
|
||||
|
||||
{"Dynamic Enumeration",
|
||||
"d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf"},
|
||||
|
||||
{"GPIO Controller",
|
||||
"4f248f40-d5e2-499f-834c-27758ea1cd3f"},
|
||||
|
||||
{"Battery Thermal Limit",
|
||||
"4c2067e3-887d-475c-9720-4af1d3ed602e"},
|
||||
|
||||
{"Thermal Extensions",
|
||||
"14d399cd-7a27-4b18-8fb4-7cb7b9f4e500"},
|
||||
|
||||
{"USB Controller",
|
||||
"ce2ee385-00e6-48cb-9f05-2edb927c4899"},
|
||||
|
||||
{"HID I2C Device",
|
||||
"3cdff6f7-4267-4555-ad05-b30a3d8938de"},
|
||||
|
||||
{"Power Button Device",
|
||||
"dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c"},
|
||||
|
||||
{"Device Labeling Interface",
|
||||
"e5c937d0-3553-4d7a-9117-ea4d19c3434d"},
|
||||
|
||||
{"SATA Controller",
|
||||
"e4db149b-fcfe-425b-a6d8-92357d78fc7f"},
|
||||
|
||||
{"Physical Presence Interface",
|
||||
"3dddfaa6-361b-4eb4-a424-8d10089d1653"},
|
||||
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiAhMatchUuid
|
||||
*
|
||||
* PARAMETERS: Data - Data buffer containing a UUID
|
||||
*
|
||||
* RETURN: ASCII description string for the UUID if it is found.
|
||||
*
|
||||
* DESCRIPTION: Returns a description string for "known" UUIDs, which are
|
||||
* are UUIDs that are related to ACPI in some way.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
const char *
|
||||
AcpiAhMatchUuid (
|
||||
UINT8 *Data)
|
||||
{
|
||||
const AH_UUID *Info;
|
||||
UINT8 UuidBuffer[UUID_BUFFER_LENGTH];
|
||||
|
||||
|
||||
/* Walk the table of known ACPI-related UUIDs */
|
||||
|
||||
for (Info = AcpiUuids; Info->Description; Info++)
|
||||
{
|
||||
AcpiUtConvertStringToUuid (Info->String, UuidBuffer);
|
||||
|
||||
if (!ACPI_MEMCMP (Data, UuidBuffer, UUID_BUFFER_LENGTH))
|
||||
{
|
||||
return (Info->Description);
|
||||
}
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: cfsize - Common get file size function
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, 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"
|
||||
#include "acapps.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define _COMPONENT ACPI_TOOLS
|
||||
ACPI_MODULE_NAME ("cmfsize")
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: CmGetFileSize
|
||||
*
|
||||
* PARAMETERS: File - Open file descriptor
|
||||
*
|
||||
* RETURN: File Size. On error, -1 (ACPI_UINT32_MAX)
|
||||
*
|
||||
* DESCRIPTION: Get the size of a file. Uses seek-to-EOF. File must be open.
|
||||
* Does not disturb the current file pointer.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
UINT32
|
||||
CmGetFileSize (
|
||||
ACPI_FILE File)
|
||||
{
|
||||
long FileSize;
|
||||
long CurrentOffset;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
/* Save the current file pointer, seek to EOF to obtain file size */
|
||||
|
||||
CurrentOffset = AcpiOsGetFileOffset (File);
|
||||
if (CurrentOffset < 0)
|
||||
{
|
||||
goto OffsetError;
|
||||
}
|
||||
|
||||
Status = AcpiOsSetFileOffset (File, 0, ACPI_FILE_END);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto SeekError;
|
||||
}
|
||||
|
||||
FileSize = AcpiOsGetFileOffset (File);
|
||||
if (FileSize < 0)
|
||||
{
|
||||
goto OffsetError;
|
||||
}
|
||||
|
||||
/* Restore original file pointer */
|
||||
|
||||
Status = AcpiOsSetFileOffset (File, CurrentOffset, ACPI_FILE_BEGIN);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto SeekError;
|
||||
}
|
||||
|
||||
return ((UINT32) FileSize);
|
||||
|
||||
|
||||
OffsetError:
|
||||
AcpiLogError ("Could not get file offset");
|
||||
return (ACPI_UINT32_MAX);
|
||||
|
||||
SeekError:
|
||||
AcpiLogError ("Could not set file offset");
|
||||
return (ACPI_UINT32_MAX);
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -139,7 +139,7 @@
|
||||
*/
|
||||
static const char *AcpiGbl_DmTypeNames[] =
|
||||
{
|
||||
/* 00 */ "", /* Type ANY */
|
||||
/* 00 */ ", UnknownObj", /* Type ANY */
|
||||
/* 01 */ ", IntObj",
|
||||
/* 02 */ ", StrObj",
|
||||
/* 03 */ ", BuffObj",
|
||||
@@ -176,10 +176,19 @@ AcpiDmNormalizeParentPrefix (
|
||||
char *Path);
|
||||
|
||||
static void
|
||||
AcpiDmAddToExternalListFromFile (
|
||||
AcpiDmAddPathToExternalList (
|
||||
char *Path,
|
||||
UINT8 Type,
|
||||
UINT32 Value);
|
||||
UINT32 Value,
|
||||
UINT16 Flags);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDmCreateNewExternal (
|
||||
char *ExternalPath,
|
||||
char *InternalPath,
|
||||
UINT8 Type,
|
||||
UINT32 Value,
|
||||
UINT16 Flags);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -351,48 +360,41 @@ Cleanup:
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDmAddToExternalFileList (
|
||||
char *PathList)
|
||||
char *Pathname)
|
||||
{
|
||||
ACPI_EXTERNAL_FILE *ExternalFile;
|
||||
char *Path;
|
||||
char *TmpPath;
|
||||
char *LocalPathname;
|
||||
|
||||
|
||||
if (!PathList)
|
||||
if (!Pathname)
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
Path = strtok (PathList, ",");
|
||||
|
||||
while (Path)
|
||||
LocalPathname = ACPI_ALLOCATE (strlen (Pathname) + 1);
|
||||
if (!LocalPathname)
|
||||
{
|
||||
TmpPath = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (Path) + 1);
|
||||
if (!TmpPath)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
ACPI_STRCPY (TmpPath, Path);
|
||||
|
||||
ExternalFile = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_FILE));
|
||||
if (!ExternalFile)
|
||||
{
|
||||
ACPI_FREE (TmpPath);
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
ExternalFile->Path = TmpPath;
|
||||
|
||||
if (AcpiGbl_ExternalFileList)
|
||||
{
|
||||
ExternalFile->Next = AcpiGbl_ExternalFileList;
|
||||
}
|
||||
|
||||
AcpiGbl_ExternalFileList = ExternalFile;
|
||||
Path = strtok (NULL, ",");
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
ExternalFile = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_FILE));
|
||||
if (!ExternalFile)
|
||||
{
|
||||
ACPI_FREE (LocalPathname);
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Take a copy of the file pathname */
|
||||
|
||||
strcpy (LocalPathname, Pathname);
|
||||
ExternalFile->Path = LocalPathname;
|
||||
|
||||
if (AcpiGbl_ExternalFileList)
|
||||
{
|
||||
ExternalFile->Next = AcpiGbl_ExternalFileList;
|
||||
}
|
||||
|
||||
AcpiGbl_ExternalFileList = ExternalFile;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
@@ -426,196 +428,6 @@ AcpiDmClearExternalFileList (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmAddToExternalList
|
||||
*
|
||||
* PARAMETERS: Op - Current parser Op
|
||||
* Path - Internal (AML) path to the object
|
||||
* Type - ACPI object type to be added
|
||||
* Value - Arg count if adding a Method object
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Insert a new name into the global list of Externals which
|
||||
* will in turn be later emitted as an External() declaration
|
||||
* in the disassembled output.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDmAddToExternalList (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
char *Path,
|
||||
UINT8 Type,
|
||||
UINT32 Value)
|
||||
{
|
||||
char *ExternalPath;
|
||||
char *Fullpath = NULL;
|
||||
ACPI_EXTERNAL_LIST *NewExternal;
|
||||
ACPI_EXTERNAL_LIST *NextExternal;
|
||||
ACPI_EXTERNAL_LIST *PrevExternal = NULL;
|
||||
ACPI_STATUS Status;
|
||||
BOOLEAN Resolved = FALSE;
|
||||
|
||||
|
||||
if (!Path)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
if (Value & 0x80)
|
||||
{
|
||||
Resolved = TRUE;
|
||||
}
|
||||
Value &= 0x07;
|
||||
}
|
||||
|
||||
/*
|
||||
* We don't want External() statements to contain a leading '\'.
|
||||
* This prevents duplicate external statements of the form:
|
||||
*
|
||||
* External (\ABCD)
|
||||
* External (ABCD)
|
||||
*
|
||||
* This would cause a compile time error when the disassembled
|
||||
* output file is recompiled.
|
||||
*/
|
||||
if ((*Path == AML_ROOT_PREFIX) && (Path[1]))
|
||||
{
|
||||
Path++;
|
||||
}
|
||||
|
||||
/* Externalize the ACPI pathname */
|
||||
|
||||
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path,
|
||||
NULL, &ExternalPath);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the full pathname from the root if "Path" has one or more
|
||||
* parent prefixes (^). Note: path will not contain a leading '\'.
|
||||
*/
|
||||
if (*Path == (UINT8) AML_PARENT_PREFIX)
|
||||
{
|
||||
Fullpath = AcpiDmNormalizeParentPrefix (Op, ExternalPath);
|
||||
if (Fullpath)
|
||||
{
|
||||
/* Set new external path */
|
||||
|
||||
ACPI_FREE (ExternalPath);
|
||||
ExternalPath = Fullpath;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check all existing externals to ensure no duplicates */
|
||||
|
||||
NextExternal = AcpiGbl_ExternalList;
|
||||
while (NextExternal)
|
||||
{
|
||||
if (!ACPI_STRCMP (ExternalPath, NextExternal->Path))
|
||||
{
|
||||
/* Duplicate method, check that the Value (ArgCount) is the same */
|
||||
|
||||
if ((NextExternal->Type == ACPI_TYPE_METHOD) &&
|
||||
(NextExternal->Value != Value))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"External method arg count mismatch %s: Current %u, attempted %u",
|
||||
NextExternal->Path, NextExternal->Value, Value));
|
||||
}
|
||||
|
||||
/* Allow upgrade of type from ANY */
|
||||
|
||||
else if (NextExternal->Type == ACPI_TYPE_ANY)
|
||||
{
|
||||
NextExternal->Type = Type;
|
||||
NextExternal->Value = Value;
|
||||
}
|
||||
|
||||
ACPI_FREE (ExternalPath);
|
||||
return;
|
||||
}
|
||||
|
||||
NextExternal = NextExternal->Next;
|
||||
}
|
||||
|
||||
/* Allocate and init a new External() descriptor */
|
||||
|
||||
NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST));
|
||||
if (!NewExternal)
|
||||
{
|
||||
ACPI_FREE (ExternalPath);
|
||||
return;
|
||||
}
|
||||
|
||||
NewExternal->Path = ExternalPath;
|
||||
NewExternal->Type = Type;
|
||||
NewExternal->Value = Value;
|
||||
NewExternal->Resolved = Resolved;
|
||||
NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath);
|
||||
|
||||
/* Was the external path with parent prefix normalized to a fullpath? */
|
||||
|
||||
if (Fullpath == ExternalPath)
|
||||
{
|
||||
/* Get new internal path */
|
||||
|
||||
Status = AcpiNsInternalizeName (ExternalPath, &Path);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (ExternalPath);
|
||||
ACPI_FREE (NewExternal);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Set flag to indicate External->InternalPath need to be freed */
|
||||
|
||||
NewExternal->Flags |= ACPI_IPATH_ALLOCATED;
|
||||
}
|
||||
|
||||
NewExternal->InternalPath = Path;
|
||||
|
||||
/* Link the new descriptor into the global list, alphabetically ordered */
|
||||
|
||||
NextExternal = AcpiGbl_ExternalList;
|
||||
while (NextExternal)
|
||||
{
|
||||
if (AcpiUtStricmp (NewExternal->Path, NextExternal->Path) < 0)
|
||||
{
|
||||
if (PrevExternal)
|
||||
{
|
||||
PrevExternal->Next = NewExternal;
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiGbl_ExternalList = NewExternal;
|
||||
}
|
||||
|
||||
NewExternal->Next = NextExternal;
|
||||
return;
|
||||
}
|
||||
|
||||
PrevExternal = NextExternal;
|
||||
NextExternal = NextExternal->Next;
|
||||
}
|
||||
|
||||
if (PrevExternal)
|
||||
{
|
||||
PrevExternal->Next = NewExternal;
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiGbl_ExternalList = NewExternal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmGetExternalsFromFile
|
||||
@@ -657,6 +469,7 @@ AcpiDmGetExternalsFromFile (
|
||||
{
|
||||
fprintf (stderr, "Could not open external reference file \"%s\"\n",
|
||||
Gbl_ExternalRefFilename);
|
||||
AslAbort ();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -665,18 +478,37 @@ AcpiDmGetExternalsFromFile (
|
||||
while (fgets (StringBuffer, ASL_MSG_BUFFER_SIZE, ExternalRefFile))
|
||||
{
|
||||
Token = strtok (StringBuffer, METHOD_SEPARATORS); /* "External" */
|
||||
if (!Token) continue;
|
||||
if (strcmp (Token, "External")) continue;
|
||||
if (!Token)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (strcmp (Token, "External"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
MethodName = strtok (NULL, METHOD_SEPARATORS); /* Method namepath */
|
||||
if (!MethodName) continue;
|
||||
if (!MethodName)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Token = strtok (NULL, METHOD_SEPARATORS); /* "MethodObj" */
|
||||
if (!Token) continue;
|
||||
if (strcmp (Token, "MethodObj")) continue;
|
||||
if (!Token)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strcmp (Token, "MethodObj"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Token = strtok (NULL, METHOD_SEPARATORS); /* Arg count */
|
||||
if (!Token) continue;
|
||||
if (!Token)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Convert arg count string to an integer */
|
||||
|
||||
@@ -698,7 +530,8 @@ AcpiDmGetExternalsFromFile (
|
||||
AcpiOsPrintf ("%s: Importing method external (%u arguments) %s\n",
|
||||
Gbl_ExternalRefFilename, ArgCount, MethodName);
|
||||
|
||||
AcpiDmAddToExternalListFromFile (MethodName, ACPI_TYPE_METHOD, ArgCount | 0x80);
|
||||
AcpiDmAddPathToExternalList (MethodName, ACPI_TYPE_METHOD,
|
||||
ArgCount, (ACPI_EXT_RESOLVED_REFERENCE | ACPI_EXT_ORIGIN_FROM_FILE));
|
||||
ImportCount++;
|
||||
}
|
||||
|
||||
@@ -723,11 +556,13 @@ AcpiDmGetExternalsFromFile (
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmAddToExternalListFromFile
|
||||
* FUNCTION: AcpiDmAddOpToExternalList
|
||||
*
|
||||
* PARAMETERS: Path - Internal (AML) path to the object
|
||||
* PARAMETERS: Op - Current parser Op
|
||||
* Path - Internal (AML) path to the object
|
||||
* Type - ACPI object type to be added
|
||||
* Value - Arg count if adding a Method object
|
||||
* Flags - To be passed to the external object
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
@@ -735,73 +570,325 @@ AcpiDmGetExternalsFromFile (
|
||||
* will in turn be later emitted as an External() declaration
|
||||
* in the disassembled output.
|
||||
*
|
||||
* This function handles the most common case where the referenced
|
||||
* name is simply not found in the constructed namespace.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
AcpiDmAddToExternalListFromFile (
|
||||
void
|
||||
AcpiDmAddOpToExternalList (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
char *Path,
|
||||
UINT8 Type,
|
||||
UINT32 Value)
|
||||
UINT32 Value,
|
||||
UINT16 Flags)
|
||||
{
|
||||
char *InternalPath;
|
||||
char *ExternalPath;
|
||||
ACPI_EXTERNAL_LIST *NewExternal;
|
||||
ACPI_EXTERNAL_LIST *NextExternal;
|
||||
ACPI_EXTERNAL_LIST *PrevExternal = NULL;
|
||||
char *InternalPath = Path;
|
||||
char *Temp;
|
||||
ACPI_STATUS Status;
|
||||
BOOLEAN Resolved = FALSE;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DmAddOpToExternalList);
|
||||
|
||||
|
||||
if (!Path)
|
||||
{
|
||||
return;
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* TBD: Add a flags parameter */
|
||||
/* Remove a root backslash if present */
|
||||
|
||||
if (Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
if (Value & 0x80)
|
||||
{
|
||||
Resolved = TRUE;
|
||||
}
|
||||
Value &= 0x07;
|
||||
}
|
||||
|
||||
/*
|
||||
* We don't want External() statements to contain a leading '\'.
|
||||
* This prevents duplicate external statements of the form:
|
||||
*
|
||||
* External (\ABCD)
|
||||
* External (ABCD)
|
||||
*
|
||||
* This would cause a compile time error when the disassembled
|
||||
* output file is recompiled.
|
||||
*/
|
||||
if ((*Path == AML_ROOT_PREFIX) && (Path[1]))
|
||||
{
|
||||
Path++;
|
||||
}
|
||||
|
||||
/* Externalize the pathname */
|
||||
|
||||
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path,
|
||||
NULL, &ExternalPath);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the full pathname from the root if "Path" has one or more
|
||||
* parent prefixes (^). Note: path will not contain a leading '\'.
|
||||
*/
|
||||
if (*Path == (UINT8) AML_PARENT_PREFIX)
|
||||
{
|
||||
Temp = AcpiDmNormalizeParentPrefix (Op, ExternalPath);
|
||||
|
||||
/* Set new external path */
|
||||
|
||||
ACPI_FREE (ExternalPath);
|
||||
ExternalPath = Temp;
|
||||
if (!Temp)
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* Create the new internal pathname */
|
||||
|
||||
Flags |= ACPI_EXT_INTERNAL_PATH_ALLOCATED;
|
||||
Status = AcpiNsInternalizeName (ExternalPath, &InternalPath);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (ExternalPath);
|
||||
return_VOID;
|
||||
}
|
||||
}
|
||||
|
||||
/* Create the new External() declaration node */
|
||||
|
||||
Status = AcpiDmCreateNewExternal (ExternalPath, InternalPath,
|
||||
Type, Value, Flags);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (ExternalPath);
|
||||
if (Flags & ACPI_EXT_INTERNAL_PATH_ALLOCATED)
|
||||
{
|
||||
ACPI_FREE (InternalPath);
|
||||
}
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmAddNodeToExternalList
|
||||
*
|
||||
* PARAMETERS: Node - Namespace node for object to be added
|
||||
* Type - ACPI object type to be added
|
||||
* Value - Arg count if adding a Method object
|
||||
* Flags - To be passed to the external object
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Insert a new name into the global list of Externals which
|
||||
* will in turn be later emitted as an External() declaration
|
||||
* in the disassembled output.
|
||||
*
|
||||
* This function handles the case where the referenced name has
|
||||
* been found in the namespace, but the name originated in a
|
||||
* table other than the one that is being disassembled (such
|
||||
* as a table that is added via the iASL -e option).
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDmAddNodeToExternalList (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
UINT8 Type,
|
||||
UINT32 Value,
|
||||
UINT16 Flags)
|
||||
{
|
||||
char *ExternalPath;
|
||||
char *InternalPath;
|
||||
char *Temp;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DmAddNodeToExternalList);
|
||||
|
||||
|
||||
if (!Node)
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* Get the full external and internal pathnames to the node */
|
||||
|
||||
ExternalPath = AcpiNsGetExternalPathname (Node);
|
||||
if (!ExternalPath)
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
Status = AcpiNsInternalizeName (ExternalPath, &InternalPath);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (ExternalPath);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* Remove the root backslash */
|
||||
|
||||
if ((*ExternalPath == AML_ROOT_PREFIX) && (ExternalPath[1]))
|
||||
{
|
||||
Temp = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (ExternalPath) + 1);
|
||||
if (!Temp)
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
ACPI_STRCPY (Temp, &ExternalPath[1]);
|
||||
ACPI_FREE (ExternalPath);
|
||||
ExternalPath = Temp;
|
||||
}
|
||||
|
||||
/* Create the new External() declaration node */
|
||||
|
||||
Status = AcpiDmCreateNewExternal (ExternalPath, InternalPath, Type,
|
||||
Value, (Flags | ACPI_EXT_INTERNAL_PATH_ALLOCATED));
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (ExternalPath);
|
||||
ACPI_FREE (InternalPath);
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmAddPathToExternalList
|
||||
*
|
||||
* PARAMETERS: Path - External name of the object to be added
|
||||
* Type - ACPI object type to be added
|
||||
* Value - Arg count if adding a Method object
|
||||
* Flags - To be passed to the external object
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Insert a new name into the global list of Externals which
|
||||
* will in turn be later emitted as an External() declaration
|
||||
* in the disassembled output.
|
||||
*
|
||||
* This function currently is used to add externals via a
|
||||
* reference file (via the -fe iASL option).
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
AcpiDmAddPathToExternalList (
|
||||
char *Path,
|
||||
UINT8 Type,
|
||||
UINT32 Value,
|
||||
UINT16 Flags)
|
||||
{
|
||||
char *InternalPath;
|
||||
char *ExternalPath;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DmAddPathToExternalList);
|
||||
|
||||
|
||||
if (!Path)
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* Remove a root backslash if present */
|
||||
|
||||
if ((*Path == AML_ROOT_PREFIX) && (Path[1]))
|
||||
{
|
||||
Path++;
|
||||
}
|
||||
|
||||
/* Create the internal and external pathnames */
|
||||
|
||||
Status = AcpiNsInternalizeName (Path, &InternalPath);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, InternalPath,
|
||||
NULL, &ExternalPath);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (InternalPath);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* Create the new External() declaration node */
|
||||
|
||||
Status = AcpiDmCreateNewExternal (ExternalPath, InternalPath,
|
||||
Type, Value, (Flags | ACPI_EXT_INTERNAL_PATH_ALLOCATED));
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (ExternalPath);
|
||||
ACPI_FREE (InternalPath);
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmCreateNewExternal
|
||||
*
|
||||
* PARAMETERS: ExternalPath - External path to the object
|
||||
* InternalPath - Internal (AML) path to the object
|
||||
* Type - ACPI object type to be added
|
||||
* Value - Arg count if adding a Method object
|
||||
* Flags - To be passed to the external object
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Common low-level function to insert a new name into the global
|
||||
* list of Externals which will in turn be later emitted as
|
||||
* External() declarations in the disassembled output.
|
||||
*
|
||||
* Note: The external name should not include a root prefix
|
||||
* (backslash). We do not want External() statements to contain
|
||||
* a leading '\', as this prevents duplicate external statements
|
||||
* of the form:
|
||||
*
|
||||
* External (\ABCD)
|
||||
* External (ABCD)
|
||||
*
|
||||
* This would cause a compile time error when the disassembled
|
||||
* output file is recompiled.
|
||||
*
|
||||
* There are two cases that are handled here. For both, we emit
|
||||
* an External() statement:
|
||||
* 1) The name was simply not found in the namespace.
|
||||
* 2) The name was found, but it originated in a table other than
|
||||
* the table that is being disassembled.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDmCreateNewExternal (
|
||||
char *ExternalPath,
|
||||
char *InternalPath,
|
||||
UINT8 Type,
|
||||
UINT32 Value,
|
||||
UINT16 Flags)
|
||||
{
|
||||
ACPI_EXTERNAL_LIST *NewExternal;
|
||||
ACPI_EXTERNAL_LIST *NextExternal;
|
||||
ACPI_EXTERNAL_LIST *PrevExternal = NULL;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DmCreateNewExternal);
|
||||
|
||||
|
||||
/* Check all existing externals to ensure no duplicates */
|
||||
|
||||
NextExternal = AcpiGbl_ExternalList;
|
||||
while (NextExternal)
|
||||
{
|
||||
if (!ACPI_STRCMP (Path, NextExternal->Path))
|
||||
if (!ACPI_STRCMP (ExternalPath, NextExternal->Path))
|
||||
{
|
||||
/* Duplicate method, check that the Value (ArgCount) is the same */
|
||||
|
||||
if ((NextExternal->Type == ACPI_TYPE_METHOD) &&
|
||||
(NextExternal->Value != Value))
|
||||
(NextExternal->Value != Value) &&
|
||||
(Value > 0))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"(File) External method arg count mismatch %s: Current %u, override to %u",
|
||||
"External method arg count mismatch %s: Current %u, attempted %u",
|
||||
NextExternal->Path, NextExternal->Value, Value));
|
||||
|
||||
/* Override, since new value came from external reference file */
|
||||
|
||||
NextExternal->Value = Value;
|
||||
}
|
||||
|
||||
/* Allow upgrade of type from ANY */
|
||||
@@ -812,44 +899,31 @@ AcpiDmAddToExternalListFromFile (
|
||||
NextExternal->Value = Value;
|
||||
}
|
||||
|
||||
return;
|
||||
return_ACPI_STATUS (AE_ALREADY_EXISTS);
|
||||
}
|
||||
|
||||
NextExternal = NextExternal->Next;
|
||||
}
|
||||
|
||||
/* Get the internal pathname (AML format) */
|
||||
|
||||
Status = AcpiNsInternalizeName (Path, &InternalPath);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Allocate and init a new External() descriptor */
|
||||
|
||||
NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST));
|
||||
if (!NewExternal)
|
||||
{
|
||||
ACPI_FREE (InternalPath);
|
||||
return;
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Must copy and normalize the input path */
|
||||
|
||||
AcpiNsExternalizeName (ACPI_UINT32_MAX, InternalPath, NULL, &ExternalPath);
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
|
||||
"Adding external reference node (%s) type [%s]\n",
|
||||
ExternalPath, AcpiUtGetTypeName (Type)));
|
||||
|
||||
NewExternal->Flags = Flags;
|
||||
NewExternal->Value = Value;
|
||||
NewExternal->Path = ExternalPath;
|
||||
NewExternal->Type = Type;
|
||||
NewExternal->Value = Value;
|
||||
NewExternal->Resolved = Resolved;
|
||||
NewExternal->Length = (UINT16) ACPI_STRLEN (Path);
|
||||
NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath);
|
||||
NewExternal->InternalPath = InternalPath;
|
||||
|
||||
/* Set flag to indicate External->InternalPath needs to be freed */
|
||||
|
||||
NewExternal->Flags |= ACPI_IPATH_ALLOCATED | ACPI_FROM_REFERENCE_FILE;
|
||||
|
||||
/* Link the new descriptor into the global list, alphabetically ordered */
|
||||
|
||||
NextExternal = AcpiGbl_ExternalList;
|
||||
@@ -867,7 +941,7 @@ AcpiDmAddToExternalListFromFile (
|
||||
}
|
||||
|
||||
NewExternal->Next = NextExternal;
|
||||
return;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
PrevExternal = NextExternal;
|
||||
@@ -882,6 +956,8 @@ AcpiDmAddToExternalListFromFile (
|
||||
{
|
||||
AcpiGbl_ExternalList = NewExternal;
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -1057,7 +1133,7 @@ AcpiDmEmitExternals (
|
||||
if (NextExternal->Type == ACPI_TYPE_METHOD)
|
||||
{
|
||||
AcpiGbl_NumExternalMethods++;
|
||||
if (NextExternal->Resolved)
|
||||
if (NextExternal->Flags & ACPI_EXT_RESOLVED_REFERENCE)
|
||||
{
|
||||
AcpiGbl_ResolvedExternalMethods++;
|
||||
}
|
||||
@@ -1076,18 +1152,17 @@ AcpiDmEmitExternals (
|
||||
while (NextExternal)
|
||||
{
|
||||
if ((NextExternal->Type == ACPI_TYPE_METHOD) &&
|
||||
(!NextExternal->Resolved))
|
||||
(!(NextExternal->Flags & ACPI_EXT_RESOLVED_REFERENCE)))
|
||||
{
|
||||
AcpiOsPrintf (" External (%s%s",
|
||||
NextExternal->Path,
|
||||
AcpiDmGetObjectTypeName (NextExternal->Type));
|
||||
|
||||
AcpiOsPrintf (
|
||||
") // Warning: Unresolved Method, "
|
||||
"guessing %u arguments (may be incorrect, see warning above)\n",
|
||||
AcpiOsPrintf (") // Warning: Unresolved method, "
|
||||
"guessing %u arguments\n",
|
||||
NextExternal->Value);
|
||||
|
||||
NextExternal->Emitted = TRUE;
|
||||
NextExternal->Flags |= ACPI_EXT_EXTERNAL_EMITTED;
|
||||
}
|
||||
|
||||
NextExternal = NextExternal->Next;
|
||||
@@ -1108,7 +1183,8 @@ AcpiDmEmitExternals (
|
||||
NextExternal = AcpiGbl_ExternalList;
|
||||
while (NextExternal)
|
||||
{
|
||||
if (!NextExternal->Emitted && (NextExternal->Flags & ACPI_FROM_REFERENCE_FILE))
|
||||
if (!(NextExternal->Flags & ACPI_EXT_EXTERNAL_EMITTED) &&
|
||||
(NextExternal->Flags & ACPI_EXT_ORIGIN_FROM_FILE))
|
||||
{
|
||||
AcpiOsPrintf (" External (%s%s",
|
||||
NextExternal->Path,
|
||||
@@ -1123,7 +1199,7 @@ AcpiDmEmitExternals (
|
||||
{
|
||||
AcpiOsPrintf (")\n");
|
||||
}
|
||||
NextExternal->Emitted = TRUE;
|
||||
NextExternal->Flags |= ACPI_EXT_EXTERNAL_EMITTED;
|
||||
}
|
||||
|
||||
NextExternal = NextExternal->Next;
|
||||
@@ -1137,7 +1213,7 @@ AcpiDmEmitExternals (
|
||||
*/
|
||||
while (AcpiGbl_ExternalList)
|
||||
{
|
||||
if (!AcpiGbl_ExternalList->Emitted)
|
||||
if (!(AcpiGbl_ExternalList->Flags & ACPI_EXT_EXTERNAL_EMITTED))
|
||||
{
|
||||
AcpiOsPrintf (" External (%s%s",
|
||||
AcpiGbl_ExternalList->Path,
|
||||
@@ -1159,7 +1235,7 @@ AcpiDmEmitExternals (
|
||||
/* Free this external info block and move on to next external */
|
||||
|
||||
NextExternal = AcpiGbl_ExternalList->Next;
|
||||
if (AcpiGbl_ExternalList->Flags & ACPI_IPATH_ALLOCATED)
|
||||
if (AcpiGbl_ExternalList->Flags & ACPI_EXT_INTERNAL_PATH_ALLOCATED)
|
||||
{
|
||||
ACPI_FREE (AcpiGbl_ExternalList->InternalPath);
|
||||
}
|
||||
@@ -1281,12 +1357,24 @@ AcpiDmUnresolvedWarning (
|
||||
" * were not specified. This resulting disassembler output file may not\n"
|
||||
" * compile because the disassembler did not know how many arguments\n"
|
||||
" * to assign to these methods. To specify the tables needed to resolve\n"
|
||||
" * external control method references, use the one of the following\n"
|
||||
" * example iASL invocations:\n"
|
||||
" * iasl -e <ssdt1.aml,ssdt2.aml...> -d <dsdt.aml>\n"
|
||||
" * iasl -e <dsdt.aml,ssdt2.aml...> -d <ssdt1.aml>\n"
|
||||
" * external control method references, the -e option can be used to\n"
|
||||
" * specify the filenames. Example iASL invocations:\n"
|
||||
" * iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n"
|
||||
" * iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n"
|
||||
" * iasl -e ssdt*.aml -d dsdt.aml\n"
|
||||
" *\n"
|
||||
" * In addition, the -fe option can be used to specify a file containing\n"
|
||||
" * control method external declarations with the associated method\n"
|
||||
" * argument counts. Each line of the file must be of the form:\n"
|
||||
" * External (<method pathname>, MethodObj, <argument count>)\n"
|
||||
" * Invocation:\n"
|
||||
" * iasl -fe refs.txt -d dsdt.aml\n"
|
||||
" *\n"
|
||||
" * The following methods were unresolved and many not compile properly\n"
|
||||
" * because the disassembler had to guess at the number of arguments\n"
|
||||
" * required for each:\n"
|
||||
" */\n",
|
||||
AcpiGbl_NumExternalMethods);
|
||||
AcpiGbl_NumExternalMethods);
|
||||
}
|
||||
else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods)
|
||||
{
|
||||
@@ -1295,10 +1383,21 @@ AcpiDmUnresolvedWarning (
|
||||
AcpiOsPrintf (" /*\n"
|
||||
" * iASL Warning: There were %u external control methods found during\n"
|
||||
" * disassembly, but only %u %s resolved (%u unresolved). Additional\n"
|
||||
" * ACPI tables are required to properly disassemble the code. This\n"
|
||||
" * ACPI tables may be required to properly disassemble the code. This\n"
|
||||
" * resulting disassembler output file may not compile because the\n"
|
||||
" * disassembler did not know how many arguments to assign to the\n"
|
||||
" * unresolved methods.\n"
|
||||
" *\n"
|
||||
" * If necessary, the -fe option can be used to specify a file containing\n"
|
||||
" * control method external declarations with the associated method\n"
|
||||
" * argument counts. Each line of the file must be of the form:\n"
|
||||
" * External (<method pathname>, MethodObj, <argument count>)\n"
|
||||
" * Invocation:\n"
|
||||
" * iasl -fe refs.txt -d dsdt.aml\n"
|
||||
" *\n"
|
||||
" * The following methods were unresolved and many not compile properly\n"
|
||||
" * because the disassembler had to guess at the number of arguments\n"
|
||||
" * required for each:\n"
|
||||
" */\n",
|
||||
AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods,
|
||||
(AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"),
|
||||
@@ -1317,10 +1416,18 @@ AcpiDmUnresolvedWarning (
|
||||
"were not specified. The resulting disassembler output file may not\n"
|
||||
"compile because the disassembler did not know how many arguments\n"
|
||||
"to assign to these methods. To specify the tables needed to resolve\n"
|
||||
"external control method references, use the one of the following\n"
|
||||
"example iASL invocations:\n"
|
||||
" iasl -e <ssdt1.aml,ssdt2.aml...> -d <dsdt.aml>\n"
|
||||
" iasl -e <dsdt.aml,ssdt2.aml...> -d <ssdt1.aml>\n",
|
||||
"external control method references, the -e option can be used to\n"
|
||||
"specify the filenames. Example iASL invocations:\n"
|
||||
" iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n"
|
||||
" iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n"
|
||||
" iasl -e ssdt*.aml -d dsdt.aml\n"
|
||||
"\n"
|
||||
"In addition, the -fe option can be used to specify a file containing\n"
|
||||
"control method external declarations with the associated method\n"
|
||||
"argument counts. Each line of the file must be of the form:\n"
|
||||
" External (<method pathname>, MethodObj, <argument count>)\n"
|
||||
"Invocation:\n"
|
||||
" iasl -fe refs.txt -d dsdt.aml\n",
|
||||
AcpiGbl_NumExternalMethods);
|
||||
}
|
||||
else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods)
|
||||
@@ -1330,10 +1437,17 @@ AcpiDmUnresolvedWarning (
|
||||
fprintf (stderr, "\n"
|
||||
"iASL Warning: There were %u external control methods found during\n"
|
||||
"disassembly, but only %u %s resolved (%u unresolved). Additional\n"
|
||||
"ACPI tables are required to properly disassemble the code. The\n"
|
||||
"ACPI tables may be required to properly disassemble the code. The\n"
|
||||
"resulting disassembler output file may not compile because the\n"
|
||||
"disassembler did not know how many arguments to assign to the\n"
|
||||
"unresolved methods.\n",
|
||||
"unresolved methods.\n"
|
||||
"\n"
|
||||
"If necessary, the -fe option can be used to specify a file containing\n"
|
||||
"control method external declarations with the associated method\n"
|
||||
"argument counts. Each line of the file must be of the form:\n"
|
||||
" External (<method pathname>, MethodObj, <argument count>)\n"
|
||||
"Invocation:\n"
|
||||
" iasl -fe refs.txt -d dsdt.aml\n",
|
||||
AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods,
|
||||
(AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"),
|
||||
(AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods));
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -159,9 +159,21 @@ static const char *AcpiDmDmarSubnames[] =
|
||||
"Reserved Memory Region",
|
||||
"Root Port ATS Capability",
|
||||
"Remapping Hardware Static Affinity",
|
||||
"ACPI Namespace Device Declaration",
|
||||
"Unknown SubTable Type" /* Reserved */
|
||||
};
|
||||
|
||||
static const char *AcpiDmDmarScope[] =
|
||||
{
|
||||
"Reserved value",
|
||||
"PCI Endpoint Device",
|
||||
"PCI Bridge Device",
|
||||
"IOAPIC Device",
|
||||
"Message-capable HPET Device",
|
||||
"Namespace Device",
|
||||
"Unknown Scope Type" /* Reserved */
|
||||
};
|
||||
|
||||
static const char *AcpiDmEinjActions[] =
|
||||
{
|
||||
"Begin Operation",
|
||||
@@ -232,6 +244,13 @@ static const char *AcpiDmErstInstructions[] =
|
||||
"Unknown Instruction"
|
||||
};
|
||||
|
||||
static const char *AcpiDmGtdtSubnames[] =
|
||||
{
|
||||
"Generic Timer Block",
|
||||
"Generic Watchdog Timer",
|
||||
"Unknown SubTable Type" /* Reserved */
|
||||
};
|
||||
|
||||
static const char *AcpiDmHestSubnames[] =
|
||||
{
|
||||
"IA-32 Machine Check Exception",
|
||||
@@ -261,20 +280,29 @@ static const char *AcpiDmHestNotifySubnames[] =
|
||||
|
||||
static const char *AcpiDmMadtSubnames[] =
|
||||
{
|
||||
"Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */
|
||||
"I/O APIC", /* ACPI_MADT_TYPE_IO_APIC */
|
||||
"Interrupt Source Override", /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */
|
||||
"NMI Source", /* ACPI_MADT_TYPE_NMI_SOURCE */
|
||||
"Local APIC NMI", /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */
|
||||
"Local APIC Address Override", /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */
|
||||
"I/O SAPIC", /* ACPI_MADT_TYPE_IO_SAPIC */
|
||||
"Local SAPIC", /* ACPI_MADT_TYPE_LOCAL_SAPIC */
|
||||
"Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */
|
||||
"Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */
|
||||
"Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */
|
||||
"Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */
|
||||
"Generic Interrupt Distributor",/* ACPI_MADT_GENERIC_DISTRIBUTOR */
|
||||
"Unknown SubTable Type" /* Reserved */
|
||||
"Processor Local APIC", /* ACPI_MADT_TYPE_LOCAL_APIC */
|
||||
"I/O APIC", /* ACPI_MADT_TYPE_IO_APIC */
|
||||
"Interrupt Source Override", /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */
|
||||
"NMI Source", /* ACPI_MADT_TYPE_NMI_SOURCE */
|
||||
"Local APIC NMI", /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */
|
||||
"Local APIC Address Override", /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */
|
||||
"I/O SAPIC", /* ACPI_MADT_TYPE_IO_SAPIC */
|
||||
"Local SAPIC", /* ACPI_MADT_TYPE_LOCAL_SAPIC */
|
||||
"Platform Interrupt Sources", /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */
|
||||
"Processor Local x2APIC", /* ACPI_MADT_TYPE_LOCAL_X2APIC */
|
||||
"Local x2APIC NMI", /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */
|
||||
"Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */
|
||||
"Generic Interrupt Distributor", /* ACPI_MADT_GENERIC_DISTRIBUTOR */
|
||||
"Generic MSI Frame", /* ACPI_MADT_GENERIC_MSI_FRAME */
|
||||
"Generic Interrupt Redistributor", /* ACPI_MADT_GENERIC_REDISTRIBUTOR */
|
||||
"Unknown SubTable Type" /* Reserved */
|
||||
};
|
||||
|
||||
static const char *AcpiDmPcctSubnames[] =
|
||||
{
|
||||
"Generic Communications Subspace", /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */
|
||||
"HW-Reduced Communications Subspace",
|
||||
"Unknown SubTable Type" /* Reserved */
|
||||
};
|
||||
|
||||
static const char *AcpiDmPmttSubnames[] =
|
||||
@@ -307,6 +335,12 @@ static const char *AcpiDmIvrsSubnames[] =
|
||||
"Unknown SubTable Type" /* Reserved */
|
||||
};
|
||||
|
||||
static const char *AcpiDmLpitSubnames[] =
|
||||
{
|
||||
"Native C-state Idle Structure",
|
||||
"Simple I/O Idle Structure",
|
||||
"Unknown SubTable Type" /* Reserved */
|
||||
};
|
||||
|
||||
#define ACPI_FADT_PM_RESERVED 9
|
||||
|
||||
@@ -358,7 +392,7 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] =
|
||||
{ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot, "Simple Boot Flag Table"},
|
||||
{ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep, "Corrected Platform Error Polling table"},
|
||||
{ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt, "Core System Resource Table"},
|
||||
{ACPI_SIG_DBG2, NULL, AcpiDmDumpDbg2, NULL, NULL, "Debug Port table type 2"},
|
||||
{ACPI_SIG_DBG2, AcpiDmTableInfoDbg2, AcpiDmDumpDbg2, DtCompileDbg2, TemplateDbg2, "Debug Port table type 2"},
|
||||
{ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp, "Debug Port table"},
|
||||
{ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar, "DMA Remapping table"},
|
||||
{ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, TemplateEcdt, "Embedded Controller Boot Resources Table"},
|
||||
@@ -366,17 +400,18 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] =
|
||||
{ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst, "Error Record Serialization Table"},
|
||||
{ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt, "Fixed ACPI Description Table (FADT)"},
|
||||
{ACPI_SIG_FPDT, NULL, AcpiDmDumpFpdt, DtCompileFpdt, TemplateFpdt, "Firmware Performance Data Table"},
|
||||
{ACPI_SIG_GTDT, AcpiDmTableInfoGtdt, NULL, NULL, TemplateGtdt, "Generic Timer Description Table"},
|
||||
{ACPI_SIG_GTDT, NULL, AcpiDmDumpGtdt, DtCompileGtdt, TemplateGtdt, "Generic Timer Description Table"},
|
||||
{ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest, "Hardware Error Source Table"},
|
||||
{ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet, "High Precision Event Timer table"},
|
||||
{ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs, "I/O Virtualization Reporting Structure"},
|
||||
{ACPI_SIG_LPIT, NULL, AcpiDmDumpLpit, DtCompileLpit, TemplateLpit, "Low Power Idle Table"},
|
||||
{ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt, "Multiple APIC Description Table (MADT)"},
|
||||
{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_MTMR, NULL, AcpiDmDumpMtmr, DtCompileMtmr, TemplateMtmr, "MID Timer Table"},
|
||||
{ACPI_SIG_PCCT, NULL, AcpiDmDumpPcct, NULL, NULL, "Platform Communications Channel Table"},
|
||||
{ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct, "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"},
|
||||
@@ -722,6 +757,7 @@ AcpiDmDumpTable (
|
||||
UINT32 ByteLength;
|
||||
UINT8 Temp8;
|
||||
UINT16 Temp16;
|
||||
UINT64 Value;
|
||||
ACPI_DMTABLE_DATA *TableData;
|
||||
const char *Name;
|
||||
BOOLEAN LastOutputBlankLine = FALSE;
|
||||
@@ -763,7 +799,9 @@ AcpiDmDumpTable (
|
||||
case ACPI_DMT_SPACEID:
|
||||
case ACPI_DMT_ACCWIDTH:
|
||||
case ACPI_DMT_IVRS:
|
||||
case ACPI_DMT_GTDT:
|
||||
case ACPI_DMT_MADT:
|
||||
case ACPI_DMT_PCCT:
|
||||
case ACPI_DMT_PMTT:
|
||||
case ACPI_DMT_SRAT:
|
||||
case ACPI_DMT_ASF:
|
||||
@@ -773,6 +811,7 @@ AcpiDmDumpTable (
|
||||
case ACPI_DMT_EINJINST:
|
||||
case ACPI_DMT_ERSTACT:
|
||||
case ACPI_DMT_ERSTINST:
|
||||
case ACPI_DMT_DMAR_SCOPE:
|
||||
|
||||
ByteLength = 1;
|
||||
break;
|
||||
@@ -793,6 +832,7 @@ AcpiDmDumpTable (
|
||||
case ACPI_DMT_NAME4:
|
||||
case ACPI_DMT_SIG:
|
||||
case ACPI_DMT_SLIC:
|
||||
case ACPI_DMT_LPIT:
|
||||
|
||||
ByteLength = 4;
|
||||
break;
|
||||
@@ -935,10 +975,19 @@ AcpiDmDumpTable (
|
||||
* Dump bytes - high byte first, low byte last.
|
||||
* Note: All ACPI tables are little-endian.
|
||||
*/
|
||||
Value = 0;
|
||||
for (Temp8 = (UINT8) ByteLength; Temp8 > 0; Temp8--)
|
||||
{
|
||||
AcpiOsPrintf ("%2.2X", Target[Temp8 - 1]);
|
||||
Value |= Target[Temp8 - 1];
|
||||
Value <<= 8;
|
||||
}
|
||||
|
||||
if (!Value && (Info->Flags & DT_DESCRIBES_OPTIONAL))
|
||||
{
|
||||
AcpiOsPrintf (" [Optional field not present]");
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
break;
|
||||
|
||||
@@ -1094,6 +1143,19 @@ AcpiDmDumpTable (
|
||||
AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_DMAR_SCOPE:
|
||||
|
||||
/* DMAR device scope types */
|
||||
|
||||
Temp8 = *Target;
|
||||
if (Temp8 > ACPI_DMAR_SCOPE_TYPE_RESERVED)
|
||||
{
|
||||
Temp8 = ACPI_DMAR_SCOPE_TYPE_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmDmarScope[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_EINJACT:
|
||||
|
||||
/* EINJ Action types */
|
||||
@@ -1146,6 +1208,19 @@ AcpiDmDumpTable (
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstInstructions[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_GTDT:
|
||||
|
||||
/* GTDT subtable types */
|
||||
|
||||
Temp8 = *Target;
|
||||
if (Temp8 > ACPI_GTDT_TYPE_RESERVED)
|
||||
{
|
||||
Temp8 = ACPI_GTDT_TYPE_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGtdtSubnames[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_HEST:
|
||||
|
||||
/* HEST subtable types */
|
||||
@@ -1194,6 +1269,19 @@ AcpiDmDumpTable (
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmMadtSubnames[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_PCCT:
|
||||
|
||||
/* PCCT subtable types */
|
||||
|
||||
Temp8 = *Target;
|
||||
if (Temp8 > ACPI_PCCT_TYPE_RESERVED)
|
||||
{
|
||||
Temp8 = ACPI_PCCT_TYPE_RESERVED;
|
||||
}
|
||||
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmPcctSubnames[Temp8]);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_PMTT:
|
||||
|
||||
/* PMTT subtable types */
|
||||
@@ -1274,6 +1362,32 @@ AcpiDmDumpTable (
|
||||
AcpiOsPrintf (UINT8_FORMAT, *Target, Name);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_LPIT:
|
||||
|
||||
/* LPIT subtable types */
|
||||
|
||||
Temp8 = *Target;
|
||||
switch (Temp8)
|
||||
{
|
||||
case ACPI_LPIT_TYPE_NATIVE_CSTATE:
|
||||
|
||||
Name = AcpiDmLpitSubnames[0];
|
||||
break;
|
||||
|
||||
case ACPI_LPIT_TYPE_SIMPLE_IO:
|
||||
|
||||
Name = AcpiDmLpitSubnames[1];
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Name = AcpiDmLpitSubnames[2];
|
||||
break;
|
||||
}
|
||||
|
||||
AcpiOsPrintf (UINT32_FORMAT, *Target, Name);
|
||||
break;
|
||||
|
||||
case ACPI_DMT_EXIT:
|
||||
|
||||
return (AE_OK);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -491,12 +491,12 @@ AcpiDmDumpAsf (
|
||||
UINT8 Type;
|
||||
|
||||
|
||||
/* No main table, only sub-tables */
|
||||
/* No main table, only subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common sub-table header */
|
||||
/* Common subtable header */
|
||||
|
||||
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
|
||||
SubTable->Header.Length, AcpiDmTableInfoAsfHdr);
|
||||
@@ -551,7 +551,7 @@ AcpiDmDumpAsf (
|
||||
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("\n**** Unknown ASF sub-table type 0x%X\n", SubTable->Header.Type);
|
||||
AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n", SubTable->Header.Type);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -613,7 +613,7 @@ AcpiDmDumpAsf (
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
|
||||
/* Point to next sub-table */
|
||||
/* Point to next subtable */
|
||||
|
||||
if (!SubTable->Header.Length)
|
||||
{
|
||||
@@ -658,7 +658,7 @@ AcpiDmDumpCpep (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
@@ -671,7 +671,7 @@ AcpiDmDumpCpep (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Point to next sub-table */
|
||||
/* Point to next subtable */
|
||||
|
||||
Offset += SubTable->Header.Length;
|
||||
SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable,
|
||||
@@ -710,7 +710,7 @@ AcpiDmDumpCsrt (
|
||||
|
||||
/* The main table only contains the ACPI header, thus already handled */
|
||||
|
||||
/* Sub-tables (Resource Groups) */
|
||||
/* Subtables (Resource Groups) */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
@@ -774,7 +774,7 @@ AcpiDmDumpCsrt (
|
||||
SubSubTable->Length);
|
||||
}
|
||||
|
||||
/* Point to next sub-table */
|
||||
/* Point to next subtable */
|
||||
|
||||
Offset += SubTable->Length;
|
||||
SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, SubTable,
|
||||
@@ -818,7 +818,7 @@ AcpiDmDumpDbg2 (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
@@ -881,10 +881,13 @@ AcpiDmDumpDbg2 (
|
||||
|
||||
/* Dump the OemData (optional) */
|
||||
|
||||
AcpiDmDumpBuffer (SubTable, SubTable->OemDataOffset, SubTable->OemDataLength,
|
||||
Offset + SubTable->OemDataOffset, "OEM Data");
|
||||
if (SubTable->OemDataOffset)
|
||||
{
|
||||
AcpiDmDumpBuffer (SubTable, SubTable->OemDataOffset, SubTable->OemDataLength,
|
||||
Offset + SubTable->OemDataOffset, "OEM Data");
|
||||
}
|
||||
|
||||
/* Point to next sub-table */
|
||||
/* Point to next subtable */
|
||||
|
||||
Offset += SubTable->Length;
|
||||
SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, SubTable,
|
||||
@@ -930,12 +933,12 @@ AcpiDmDumpDmar (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common sub-table header */
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Length, Offset, SubTable,
|
||||
@@ -960,21 +963,27 @@ AcpiDmDumpDmar (
|
||||
ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY);
|
||||
break;
|
||||
|
||||
case ACPI_DMAR_TYPE_ATSR:
|
||||
case ACPI_DMAR_TYPE_ROOT_ATS:
|
||||
|
||||
InfoTable = AcpiDmTableInfoDmar2;
|
||||
ScopeOffset = sizeof (ACPI_DMAR_ATSR);
|
||||
break;
|
||||
|
||||
case ACPI_DMAR_HARDWARE_AFFINITY:
|
||||
case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
|
||||
|
||||
InfoTable = AcpiDmTableInfoDmar3;
|
||||
ScopeOffset = sizeof (ACPI_DMAR_RHSA);
|
||||
break;
|
||||
|
||||
case ACPI_DMAR_TYPE_NAMESPACE:
|
||||
|
||||
InfoTable = AcpiDmTableInfoDmar4;
|
||||
ScopeOffset = sizeof (ACPI_DMAR_ANDD);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("\n**** Unknown DMAR sub-table type 0x%X\n\n", SubTable->Type);
|
||||
AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", SubTable->Type);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -985,7 +994,16 @@ AcpiDmDumpDmar (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Dump the device scope entries (if any) */
|
||||
/*
|
||||
* Dump the optional device scope entries
|
||||
*/
|
||||
if ((SubTable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
|
||||
(SubTable->Type == ACPI_DMAR_TYPE_NAMESPACE))
|
||||
{
|
||||
/* These types do not support device scopes */
|
||||
|
||||
goto NextSubtable;
|
||||
}
|
||||
|
||||
ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset);
|
||||
while (ScopeOffset < SubTable->Length)
|
||||
@@ -1025,7 +1043,8 @@ AcpiDmDumpDmar (
|
||||
ScopeTable, ScopeTable->Length);
|
||||
}
|
||||
|
||||
/* Point to next sub-table */
|
||||
NextSubtable:
|
||||
/* Point to next subtable */
|
||||
|
||||
Offset += SubTable->Length;
|
||||
SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable, SubTable->Length);
|
||||
@@ -1064,7 +1083,7 @@ AcpiDmDumpEinj (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
@@ -1077,7 +1096,7 @@ AcpiDmDumpEinj (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Point to next sub-table (each subtable is of fixed length) */
|
||||
/* Point to next subtable (each subtable is of fixed length) */
|
||||
|
||||
Offset += sizeof (ACPI_WHEA_HEADER);
|
||||
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
|
||||
@@ -1117,7 +1136,7 @@ AcpiDmDumpErst (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
@@ -1130,7 +1149,7 @@ AcpiDmDumpErst (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Point to next sub-table (each subtable is of fixed length) */
|
||||
/* Point to next subtable (each subtable is of fixed length) */
|
||||
|
||||
Offset += sizeof (ACPI_WHEA_HEADER);
|
||||
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
|
||||
@@ -1165,12 +1184,12 @@ AcpiDmDumpFpdt (
|
||||
|
||||
/* There is no main table (other than the standard ACPI header) */
|
||||
|
||||
/* Sub-tables */
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common sub-table header */
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Length, Offset, SubTable,
|
||||
@@ -1194,7 +1213,7 @@ AcpiDmDumpFpdt (
|
||||
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("\n**** Unknown FPDT sub-table type 0x%X\n\n", SubTable->Type);
|
||||
AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n", SubTable->Type);
|
||||
|
||||
/* Attempt to continue */
|
||||
|
||||
@@ -1214,7 +1233,7 @@ AcpiDmDumpFpdt (
|
||||
}
|
||||
|
||||
NextSubTable:
|
||||
/* Point to next sub-table */
|
||||
/* Point to next subtable */
|
||||
|
||||
Offset += SubTable->Length;
|
||||
SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable, SubTable->Length);
|
||||
@@ -1222,6 +1241,123 @@ NextSubTable:
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpGtdt
|
||||
*
|
||||
* PARAMETERS: Table - A GTDT table
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Format the contents of a GTDT. This table type consists
|
||||
* of an open-ended number of subtables.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDmDumpGtdt (
|
||||
ACPI_TABLE_HEADER *Table)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_GTDT_HEADER *SubTable;
|
||||
UINT32 Length = Table->Length;
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_GTDT);
|
||||
ACPI_DMTABLE_INFO *InfoTable;
|
||||
UINT32 SubTableLength;
|
||||
UINT32 GtCount;
|
||||
ACPI_GTDT_TIMER_ENTRY *GtxTable;
|
||||
|
||||
|
||||
/* Main table */
|
||||
|
||||
Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoGtdt);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Length, Offset, SubTable,
|
||||
SubTable->Length, AcpiDmTableInfoGtdtHdr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GtCount = 0;
|
||||
switch (SubTable->Type)
|
||||
{
|
||||
case ACPI_GTDT_TYPE_TIMER_BLOCK:
|
||||
|
||||
SubTableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
|
||||
GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
|
||||
SubTable))->TimerCount;
|
||||
|
||||
InfoTable = AcpiDmTableInfoGtdt0;
|
||||
break;
|
||||
|
||||
case ACPI_GTDT_TYPE_WATCHDOG:
|
||||
|
||||
SubTableLength = sizeof (ACPI_GTDT_WATCHDOG);
|
||||
|
||||
InfoTable = AcpiDmTableInfoGtdt1;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Cannot continue on unknown type - no length */
|
||||
|
||||
AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n", SubTable->Type);
|
||||
return;
|
||||
}
|
||||
|
||||
Status = AcpiDmDumpTable (Length, Offset, SubTable,
|
||||
SubTable->Length, InfoTable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Point to end of current subtable (each subtable above is of fixed length) */
|
||||
|
||||
Offset += SubTableLength;
|
||||
|
||||
/* If there are any Gt Timer Blocks from above, dump them now */
|
||||
|
||||
if (GtCount)
|
||||
{
|
||||
GtxTable = ACPI_ADD_PTR (ACPI_GTDT_TIMER_ENTRY, SubTable, SubTableLength);
|
||||
SubTableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY);
|
||||
|
||||
while (GtCount)
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Length, Offset, GtxTable,
|
||||
sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
Offset += sizeof (ACPI_GTDT_TIMER_ENTRY);
|
||||
GtxTable++;
|
||||
GtCount--;
|
||||
}
|
||||
}
|
||||
|
||||
/* Point to next subtable */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, SubTable, SubTableLength);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpHest
|
||||
@@ -1257,7 +1393,7 @@ AcpiDmDumpHest (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
@@ -1315,7 +1451,7 @@ AcpiDmDumpHest (
|
||||
|
||||
/* Cannot continue on unknown type - no length */
|
||||
|
||||
AcpiOsPrintf ("\n**** Unknown HEST sub-table type 0x%X\n", SubTable->Type);
|
||||
AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n", SubTable->Type);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1353,7 +1489,7 @@ AcpiDmDumpHest (
|
||||
}
|
||||
}
|
||||
|
||||
/* Point to next sub-table */
|
||||
/* Point to next subtable */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, SubTable, SubTableLength);
|
||||
}
|
||||
@@ -1396,12 +1532,12 @@ AcpiDmDumpIvrs (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common sub-table header */
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
|
||||
@@ -1427,7 +1563,7 @@ AcpiDmDumpIvrs (
|
||||
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("\n**** Unknown IVRS sub-table type 0x%X\n",
|
||||
AcpiOsPrintf ("\n**** Unknown IVRS subtable type 0x%X\n",
|
||||
SubTable->Type);
|
||||
|
||||
/* Attempt to continue */
|
||||
@@ -1530,7 +1666,7 @@ AcpiDmDumpIvrs (
|
||||
}
|
||||
|
||||
NextSubTable:
|
||||
/* Point to next sub-table */
|
||||
/* Point to next subtable */
|
||||
|
||||
Offset += SubTable->Length;
|
||||
SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, SubTable, SubTable->Length);
|
||||
@@ -1538,6 +1674,85 @@ NextSubTable:
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpLpit
|
||||
*
|
||||
* PARAMETERS: Table - A LPIT table
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Format the contents of a LPIT. This table type consists
|
||||
* of an open-ended number of subtables. Note: There are no
|
||||
* entries in the main table. An LPIT consists of the table
|
||||
* header and then subtables only.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDmDumpLpit (
|
||||
ACPI_TABLE_HEADER *Table)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_LPIT_HEADER *SubTable;
|
||||
UINT32 Length = Table->Length;
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_LPIT);
|
||||
ACPI_DMTABLE_INFO *InfoTable;
|
||||
UINT32 SubTableLength;
|
||||
|
||||
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common subtable header */
|
||||
|
||||
Status = AcpiDmDumpTable (Length, Offset, SubTable,
|
||||
sizeof (ACPI_LPIT_HEADER), AcpiDmTableInfoLpitHdr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (SubTable->Type)
|
||||
{
|
||||
case ACPI_LPIT_TYPE_NATIVE_CSTATE:
|
||||
|
||||
InfoTable = AcpiDmTableInfoLpit0;
|
||||
SubTableLength = sizeof (ACPI_LPIT_NATIVE);
|
||||
break;
|
||||
|
||||
case ACPI_LPIT_TYPE_SIMPLE_IO:
|
||||
|
||||
InfoTable = AcpiDmTableInfoLpit1;
|
||||
SubTableLength = sizeof (ACPI_LPIT_IO);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Cannot continue on unknown type - no length */
|
||||
|
||||
AcpiOsPrintf ("\n**** Unknown LPIT subtable type 0x%X\n", SubTable->Type);
|
||||
return;
|
||||
}
|
||||
|
||||
Status = AcpiDmDumpTable (Length, Offset, SubTable,
|
||||
SubTableLength, InfoTable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
AcpiOsPrintf ("\n");
|
||||
|
||||
/* Point to next subtable */
|
||||
|
||||
Offset += SubTableLength;
|
||||
SubTable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, SubTable, SubTableLength);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDmDumpMadt
|
||||
@@ -1570,12 +1785,12 @@ AcpiDmDumpMadt (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common sub-table header */
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Length, Offset, SubTable,
|
||||
@@ -1652,9 +1867,19 @@ AcpiDmDumpMadt (
|
||||
InfoTable = AcpiDmTableInfoMadt12;
|
||||
break;
|
||||
|
||||
case ACPI_MADT_TYPE_GENERIC_MSI_FRAME:
|
||||
|
||||
InfoTable = AcpiDmTableInfoMadt13;
|
||||
break;
|
||||
|
||||
case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR:
|
||||
|
||||
InfoTable = AcpiDmTableInfoMadt14;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("\n**** Unknown MADT sub-table type 0x%X\n\n", SubTable->Type);
|
||||
AcpiOsPrintf ("\n**** Unknown MADT subtable type 0x%X\n\n", SubTable->Type);
|
||||
|
||||
/* Attempt to continue */
|
||||
|
||||
@@ -1674,7 +1899,7 @@ AcpiDmDumpMadt (
|
||||
}
|
||||
|
||||
NextSubTable:
|
||||
/* Point to next sub-table */
|
||||
/* Point to next subtable */
|
||||
|
||||
Offset += SubTable->Length;
|
||||
SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
|
||||
@@ -1711,7 +1936,7 @@ AcpiDmDumpMcfg (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
@@ -1731,7 +1956,7 @@ AcpiDmDumpMcfg (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Point to next sub-table (each subtable is of fixed length) */
|
||||
/* Point to next subtable (each subtable is of fixed length) */
|
||||
|
||||
Offset += sizeof (ACPI_MCFG_ALLOCATION);
|
||||
SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, SubTable,
|
||||
@@ -1913,12 +2138,12 @@ AcpiDmDumpMsct (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common sub-table header */
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
|
||||
@@ -1928,7 +2153,7 @@ AcpiDmDumpMsct (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Point to next sub-table */
|
||||
/* Point to next subtable */
|
||||
|
||||
Offset += sizeof (ACPI_MSCT_PROXIMITY);
|
||||
SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, SubTable, sizeof (ACPI_MSCT_PROXIMITY));
|
||||
@@ -1965,12 +2190,12 @@ AcpiDmDumpMtmr (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common sub-table header */
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
|
||||
@@ -1980,7 +2205,7 @@ AcpiDmDumpMtmr (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Point to next sub-table */
|
||||
/* Point to next subtable */
|
||||
|
||||
Offset += sizeof (ACPI_MTMR_ENTRY);
|
||||
SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, SubTable, sizeof (ACPI_MTMR_ENTRY));
|
||||
@@ -2007,6 +2232,7 @@ AcpiDmDumpPcct (
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_PCCT_SUBSPACE *SubTable;
|
||||
ACPI_DMTABLE_INFO *InfoTable;
|
||||
UINT32 Length = Table->Length;
|
||||
UINT32 Offset = sizeof (ACPI_TABLE_PCCT);
|
||||
|
||||
@@ -2019,20 +2245,50 @@ AcpiDmDumpPcct (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Length, Offset, SubTable,
|
||||
SubTable->Header.Length, AcpiDmTableInfoPcct0);
|
||||
SubTable->Header.Length, AcpiDmTableInfoPcctHdr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Point to next sub-table */
|
||||
switch (SubTable->Header.Type)
|
||||
{
|
||||
case ACPI_PCCT_TYPE_GENERIC_SUBSPACE:
|
||||
|
||||
InfoTable = AcpiDmTableInfoPcct0;
|
||||
break;
|
||||
|
||||
case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE:
|
||||
|
||||
InfoTable = AcpiDmTableInfoPcct1;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
AcpiOsPrintf (
|
||||
"\n**** Unexpected or unknown PCCT subtable type 0x%X\n\n",
|
||||
SubTable->Header.Type);
|
||||
return;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Length, Offset, SubTable,
|
||||
SubTable->Header.Length, InfoTable);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Point to next subtable */
|
||||
|
||||
Offset += SubTable->Header.Length;
|
||||
SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, SubTable,
|
||||
@@ -2180,8 +2436,7 @@ AcpiDmDumpPmtt (
|
||||
if (DomainCount)
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
"\n**** DomainCount exceeds subtable length\n\n",
|
||||
MemSubTable->Type);
|
||||
"\n**** DomainCount exceeds subtable length\n\n");
|
||||
}
|
||||
|
||||
/* Walk the physical component (DIMM) subtables */
|
||||
@@ -2281,7 +2536,7 @@ AcpiDmDumpS3pt (
|
||||
SubTable = ACPI_ADD_PTR (ACPI_S3PT_HEADER, S3ptTable, Offset);
|
||||
while (Offset < S3ptTable->Length)
|
||||
{
|
||||
/* Common sub-table header */
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable,
|
||||
@@ -2305,7 +2560,7 @@ AcpiDmDumpS3pt (
|
||||
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("\n**** Unknown S3PT sub-table type 0x%X\n", SubTable->Type);
|
||||
AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n", SubTable->Type);
|
||||
|
||||
/* Attempt to continue */
|
||||
|
||||
@@ -2326,7 +2581,7 @@ AcpiDmDumpS3pt (
|
||||
}
|
||||
|
||||
NextSubTable:
|
||||
/* Point to next sub-table */
|
||||
/* Point to next subtable */
|
||||
|
||||
Offset += SubTable->Length;
|
||||
SubTable = ACPI_ADD_PTR (ACPI_S3PT_HEADER, SubTable, SubTable->Length);
|
||||
@@ -2363,7 +2618,7 @@ AcpiDmDumpSlic (
|
||||
SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common sub-table header */
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
|
||||
@@ -2387,7 +2642,7 @@ AcpiDmDumpSlic (
|
||||
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("\n**** Unknown SLIC sub-table type 0x%X\n", SubTable->Type);
|
||||
AcpiOsPrintf ("\n**** Unknown SLIC subtable type 0x%X\n", SubTable->Type);
|
||||
|
||||
/* Attempt to continue */
|
||||
|
||||
@@ -2408,7 +2663,7 @@ AcpiDmDumpSlic (
|
||||
}
|
||||
|
||||
NextSubTable:
|
||||
/* Point to next sub-table */
|
||||
/* Point to next subtable */
|
||||
|
||||
Offset += SubTable->Length;
|
||||
SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, SubTable, SubTable->Length);
|
||||
@@ -2524,12 +2779,12 @@ AcpiDmDumpSrat (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common sub-table header */
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
|
||||
@@ -2557,7 +2812,7 @@ AcpiDmDumpSrat (
|
||||
break;
|
||||
|
||||
default:
|
||||
AcpiOsPrintf ("\n**** Unknown SRAT sub-table type 0x%X\n", SubTable->Type);
|
||||
AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n", SubTable->Type);
|
||||
|
||||
/* Attempt to continue */
|
||||
|
||||
@@ -2578,7 +2833,7 @@ AcpiDmDumpSrat (
|
||||
}
|
||||
|
||||
NextSubTable:
|
||||
/* Point to next sub-table */
|
||||
/* Point to next subtable */
|
||||
|
||||
Offset += SubTable->Length;
|
||||
SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
|
||||
@@ -2615,12 +2870,12 @@ AcpiDmDumpVrtc (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common sub-table header */
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
|
||||
@@ -2630,7 +2885,7 @@ AcpiDmDumpVrtc (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Point to next sub-table */
|
||||
/* Point to next subtable */
|
||||
|
||||
Offset += sizeof (ACPI_VRTC_ENTRY);
|
||||
SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, SubTable, sizeof (ACPI_VRTC_ENTRY));
|
||||
@@ -2667,12 +2922,12 @@ AcpiDmDumpWdat (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Sub-tables */
|
||||
/* Subtables */
|
||||
|
||||
SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset);
|
||||
while (Offset < Table->Length)
|
||||
{
|
||||
/* Common sub-table header */
|
||||
/* Common subtable header */
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
|
||||
@@ -2682,7 +2937,7 @@ AcpiDmDumpWdat (
|
||||
return;
|
||||
}
|
||||
|
||||
/* Point to next sub-table */
|
||||
/* Point to next subtable */
|
||||
|
||||
Offset += sizeof (ACPI_WDAT_ENTRY);
|
||||
SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, SubTable, sizeof (ACPI_WDAT_ENTRY));
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -209,11 +209,16 @@
|
||||
#define ACPI_DMAR1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f)
|
||||
#define ACPI_DMAR2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_ATSR,f)
|
||||
#define ACPI_DMAR3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RHSA,f)
|
||||
#define ACPI_DMAR4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_ANDD,f)
|
||||
#define ACPI_EINJ0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
|
||||
#define ACPI_ERST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
|
||||
#define ACPI_FPDTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_HEADER,f)
|
||||
#define ACPI_FPDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_BOOT,f)
|
||||
#define ACPI_FPDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_S3PT_PTR,f)
|
||||
#define ACPI_GTDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_TIMER_BLOCK,f)
|
||||
#define ACPI_GTDT0a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_TIMER_ENTRY,f)
|
||||
#define ACPI_GTDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_WATCHDOG,f)
|
||||
#define ACPI_GTDTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_HEADER,f)
|
||||
#define ACPI_HEST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f)
|
||||
#define ACPI_HEST1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f)
|
||||
#define ACPI_HEST2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_NMI,f)
|
||||
@@ -230,6 +235,9 @@
|
||||
#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_LPITH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_LPIT_HEADER,f)
|
||||
#define ACPI_LPIT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_LPIT_NATIVE,f)
|
||||
#define ACPI_LPIT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_LPIT_IO,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)
|
||||
@@ -243,6 +251,8 @@
|
||||
#define ACPI_MADT10_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f)
|
||||
#define ACPI_MADT11_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f)
|
||||
#define ACPI_MADT12_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_DISTRIBUTOR,f)
|
||||
#define ACPI_MADT13_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_MSI_FRAME,f)
|
||||
#define ACPI_MADT14_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_REDISTRIBUTOR,f)
|
||||
#define ACPI_MADTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
|
||||
#define ACPI_MCFG0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f)
|
||||
#define ACPI_MPST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_NODE,f)
|
||||
@@ -253,6 +263,7 @@
|
||||
#define ACPI_MSCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f)
|
||||
#define ACPI_MTMR0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MTMR_ENTRY,f)
|
||||
#define ACPI_PCCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f)
|
||||
#define ACPI_PCCT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED,f)
|
||||
#define ACPI_PMTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_SOCKET,f)
|
||||
#define ACPI_PMTT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_CONTROLLER,f)
|
||||
#define ACPI_PMTT1A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_DOMAIN,f)
|
||||
@@ -285,6 +296,9 @@
|
||||
#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_GTDT0a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_TIMER_ENTRY,f,o)
|
||||
#define ACPI_GTDT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_WATCHDOG,f,o)
|
||||
#define ACPI_LPITH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_LPIT_HEADER,f,o)
|
||||
#define ACPI_MADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_MADT,f,o)
|
||||
#define ACPI_MADT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_APIC,f,o)
|
||||
#define ACPI_MADT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f,o)
|
||||
@@ -295,9 +309,11 @@
|
||||
#define ACPI_MADT9_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC,f,o)
|
||||
#define ACPI_MADT10_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f,o)
|
||||
#define ACPI_MADT11_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f,o)
|
||||
#define ACPI_MADT13_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_GENERIC_MSI_FRAME,f,o)
|
||||
#define ACPI_MPST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MPST_POWER_NODE,f,o)
|
||||
#define ACPI_MPST2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MPST_POWER_DATA,f,o)
|
||||
#define ACPI_PCCT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_PCCT,f,o)
|
||||
#define ACPI_PCCT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED,f,o)
|
||||
#define ACPI_PMTTH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PMTT_HEADER,f,o)
|
||||
#define ACPI_WDDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_WDDT,f,o)
|
||||
#define ACPI_EINJ0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o)
|
||||
@@ -508,17 +524,22 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[] =
|
||||
{
|
||||
{ACPI_DMT_GAS, ACPI_FADT_OFFSET (ResetRegister), "Reset Register", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_FADT_OFFSET (ResetValue), "Value to cause reset", 0},
|
||||
{ACPI_DMT_UINT24, ACPI_FADT_OFFSET (Reserved4[0]), "Reserved", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_FADT_OFFSET (ArmBootFlags), "Reserved", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_FADT_OFFSET (MinorRevision), "Reserved", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* ACPI 2.0+ Extensions (FADT version 3 and 4) */
|
||||
/* ACPI 2.0+ Extensions (FADT version 3, 4, and 5) */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[] =
|
||||
{
|
||||
{ACPI_DMT_GAS, ACPI_FADT_OFFSET (ResetRegister), "Reset Register", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_FADT_OFFSET (ResetValue), "Value to cause reset", 0},
|
||||
{ACPI_DMT_UINT24, ACPI_FADT_OFFSET (Reserved4[0]), "Reserved", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_FADT_OFFSET (ArmBootFlags), "ARM Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_FADT_FLAG_OFFSET(ArmBootFlags,0), "PSCI Compliant", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_FADT_FLAG_OFFSET(ArmBootFlags,0), "Must use HVC for PSCI", 0},
|
||||
ACPI_DMT_NEW_LINE,
|
||||
{ACPI_DMT_UINT8, ACPI_FADT_OFFSET (MinorRevision), "FADT Minor Revision", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_FADT_OFFSET (XFacs), "FACS Address", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_FADT_OFFSET (XDsdt), "DSDT Address", 0},
|
||||
{ACPI_DMT_GAS, ACPI_FADT_OFFSET (XPm1aEventBlock), "PM1A Event Block", 0},
|
||||
@@ -792,12 +813,12 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2[] =
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Device[] =
|
||||
{
|
||||
{ACPI_DMT_UINT8, ACPI_DBG20_OFFSET (Revision), "Revision", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (Length), "Length", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (Length), "Length", DT_LENGTH},
|
||||
{ACPI_DMT_UINT8, ACPI_DBG20_OFFSET (RegisterCount), "Register Count", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (NamepathLength), "Namepath Length", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (NamepathOffset), "Namepath Offset", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (OemDataLength), "OEM Data Length", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (OemDataOffset), "OEM Data Offset", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (OemDataLength), "OEM Data Length", DT_DESCRIBES_OPTIONAL},
|
||||
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (OemDataOffset), "OEM Data Offset", DT_DESCRIBES_OPTIONAL},
|
||||
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (PortType), "Port Type", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (PortSubtype), "Port Subtype", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_DBG20_OFFSET (Reserved), "Reserved", 0},
|
||||
@@ -826,6 +847,12 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Name[] =
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2OemData[] =
|
||||
{
|
||||
{ACPI_DMT_BUFFER, 0, "OEM Data", DT_OPTIONAL},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@@ -869,7 +896,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr[] =
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[] =
|
||||
{
|
||||
{ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (EntryType), "Device Scope Entry Type", 0},
|
||||
{ACPI_DMT_DMAR_SCOPE, ACPI_DMARS_OFFSET (EntryType), "Device Scope Type", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Length), "Entry Length", DT_LENGTH},
|
||||
{ACPI_DMT_UINT16, ACPI_DMARS_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (EnumerationId), "Enumeration ID", 0},
|
||||
@@ -921,6 +948,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[] =
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* 4: ACPI Namespace Device Declaration Structure */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoDmar4[] =
|
||||
{
|
||||
{ACPI_DMT_UINT24, ACPI_DMAR4_OFFSET (Reserved[0]), "Reserved", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_DMAR4_OFFSET (DeviceNumber), "Device Number", 0},
|
||||
{ACPI_DMT_STRING, ACPI_DMAR4_OFFSET (DeviceName[0]), "Device Name", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@@ -1060,29 +1097,89 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt1[] =
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[] =
|
||||
{
|
||||
{ACPI_DMT_UINT64, ACPI_GTDT_OFFSET (Address), "Timer Address", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (Flags,0), "Memory Present", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_GTDT_OFFSET (CounterBlockAddresss), "Counter Block Address", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (Reserved), "Reserved", 0},
|
||||
ACPI_DMT_NEW_LINE,
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecurePl1Interrupt), "Secure PL1 Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecurePl1Flags), "SPL1 Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (SecurePl1Flags,0), "Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (SecurePl1Flags,0), "Polarity", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecureEl1Interrupt), "Secure EL1 Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (SecureEl1Flags), "EL1 Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (SecureEl1Flags,0), "Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (SecureEl1Flags,0), "Polarity", 0},
|
||||
{ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (SecureEl1Flags,0), "Always On", 0},
|
||||
ACPI_DMT_NEW_LINE,
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl1Interrupt), "Non-Secure PL1 Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl1Flags), "NSPL1 Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecurePl1Flags,0),"Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecurePl1Flags,0),"Polarity", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl1Interrupt), "Non-Secure EL1 Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl1Flags), "NEL1 Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecureEl1Flags,0),"Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecureEl1Flags,0),"Polarity", 0},
|
||||
{ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (NonSecureEl1Flags,0),"Always On", 0},
|
||||
ACPI_DMT_NEW_LINE,
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (VirtualTimerInterrupt), "Virtual Timer Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (VirtualTimerFlags), "VT Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Polarity", 0},
|
||||
{ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Always On", 0},
|
||||
ACPI_DMT_NEW_LINE,
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl2Interrupt), "Non-Secure PL2 Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecurePl2Flags), "NSPL2 Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecurePl2Flags,0),"Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecurePl2Flags,0),"Polarity", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl2Interrupt), "Non-Secure EL2 Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (NonSecureEl2Flags), "NEL2 Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT_FLAG_OFFSET (NonSecureEl2Flags,0),"Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT_FLAG_OFFSET (NonSecureEl2Flags,0),"Polarity", 0},
|
||||
{ACPI_DMT_FLAG2, ACPI_GTDT_FLAG_OFFSET (NonSecureEl2Flags,0),"Always On", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_GTDT_OFFSET (CounterReadBlockAddress), "Counter Read Block Address", 0},
|
||||
ACPI_DMT_NEW_LINE,
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (PlatformTimerCount), "Platform Timer Count", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT_OFFSET (PlatformTimerOffset), "Platform Timer Offset", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* GTDT Subtable header (one per Subtable) */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtHdr[] =
|
||||
{
|
||||
{ACPI_DMT_GTDT, ACPI_GTDTH_OFFSET (Type), "Subtable Type", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_GTDTH_OFFSET (Length), "Length", DT_LENGTH},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* GTDT Subtables */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0[] =
|
||||
{
|
||||
{ACPI_DMT_UINT8, ACPI_GTDT0_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_GTDT0_OFFSET (BlockAddress), "Block Address", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT0_OFFSET (TimerCount), "Timer Count", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT0_OFFSET (TimerOffset), "Timer Offset", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0a[] =
|
||||
{
|
||||
{ACPI_DMT_UINT8 , ACPI_GTDT0a_OFFSET (FrameNumber), "Frame Number", 0},
|
||||
{ACPI_DMT_UINT24, ACPI_GTDT0a_OFFSET (Reserved[0]), "Reserved", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_GTDT0a_OFFSET (BaseAddress), "Base Address", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_GTDT0a_OFFSET (El0BaseAddress), "EL0 Base Address", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (TimerInterrupt), "Timer Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (TimerFlags), "Timer Flags (decoded below)", 0},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT0a_FLAG_OFFSET (TimerFlags,0), "Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT0a_FLAG_OFFSET (TimerFlags,0), "Polarity", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (VirtualTimerInterrupt), "Virtual Timer Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (VirtualTimerFlags), "Virtual Timer Flags (decoded below)", 0},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT0a_FLAG_OFFSET (VirtualTimerFlags,0), "Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT0a_FLAG_OFFSET (VirtualTimerFlags,0), "Polarity", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT0a_OFFSET (CommonFlags), "Common Flags (decoded below)", 0},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT0a_FLAG_OFFSET (CommonFlags,0), "Secure", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT0a_FLAG_OFFSET (CommonFlags,0), "Always On", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt1[] =
|
||||
{
|
||||
{ACPI_DMT_UINT8, ACPI_GTDT1_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_GTDT1_OFFSET (RefreshFrameAddress), "Refresh Frame Address", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_GTDT1_OFFSET (ControlFrameAddress), "Control Frame Address", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT1_OFFSET (TimerInterrupt), "Timer Interrupt", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_GTDT1_OFFSET (TimerFlags), "Timer Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_GTDT1_FLAG_OFFSET (TimerFlags,0), "Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_GTDT1_FLAG_OFFSET (TimerFlags,0), "Polarity", 0},
|
||||
{ACPI_DMT_FLAG2, ACPI_GTDT1_FLAG_OFFSET (TimerFlags,0), "Security", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
@@ -1371,6 +1468,59 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8c[] =
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* LPIT - Low Power Idle Table
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/* Main table consists only of the standard ACPI table header */
|
||||
|
||||
/* Common Subtable header (one per Subtable) */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoLpitHdr[] =
|
||||
{
|
||||
{ACPI_DMT_LPIT, ACPI_LPITH_OFFSET (Type), "Subtable Type", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_LPITH_OFFSET (Length), "Length", DT_LENGTH},
|
||||
{ACPI_DMT_UINT16, ACPI_LPITH_OFFSET (UniqueId), "Unique ID", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_LPITH_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_LPITH_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_LPITH_FLAG_OFFSET (Flags, 0), "State Disabled", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_LPITH_FLAG_OFFSET (Flags, 0), "No Counter", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* LPIT Subtables */
|
||||
|
||||
/* 0: Native C-state */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[] =
|
||||
{
|
||||
{ACPI_DMT_GAS, ACPI_LPIT0_OFFSET (EntryTrigger), "Entry Trigger", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_LPIT0_OFFSET (Residency), "Residency", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_LPIT0_OFFSET (Latency), "Latency", 0},
|
||||
{ACPI_DMT_GAS, ACPI_LPIT0_OFFSET (ResidencyCounter), "Residency Counter", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_LPIT0_OFFSET (CounterFrequency), "Counter Frequency", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* 1: Simple I/O */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoLpit1[] =
|
||||
{
|
||||
{ACPI_DMT_GAS, ACPI_LPIT1_OFFSET (EntryTrigger), "Entry Trigger", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_LPIT1_OFFSET (TriggerAction), "Trigger Action", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_LPIT1_OFFSET (TriggerValue), "Trigger Value", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_LPIT1_OFFSET (TriggerMask), "Trigger Mask", 0},
|
||||
{ACPI_DMT_GAS, ACPI_LPIT1_OFFSET (MinimumIdleState), "Minimum Idle State", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_LPIT1_OFFSET (Residency), "Residency", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_LPIT1_OFFSET (Latency), "Latency", 0},
|
||||
{ACPI_DMT_GAS, ACPI_LPIT1_OFFSET (ResidencyCounter), "Residency Counter", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_LPIT1_OFFSET (CounterFrequency), "Counter Frequency", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* MADT - Multiple APIC Description Table and subtables
|
||||
@@ -1536,14 +1686,21 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[] =
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[] =
|
||||
{
|
||||
{ACPI_DMT_UINT16, ACPI_MADT11_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (GicId), "Local GIC Hardware ID", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (CpuInterfaceNumber), "CPU Interface Number", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (Uid), "Processor UID", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_MADT11_FLAG_OFFSET (Flags,0), "Processor Enabled", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_MADT11_FLAG_OFFSET (Flags,0), "Performance Interrupt Trigger Mode", 0},
|
||||
{ACPI_DMT_FLAG2, ACPI_MADT11_FLAG_OFFSET (Flags,0), "Virtual GIC Interrupt Trigger Mode", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (ParkingVersion), "Parking Protocol Version", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (PerformanceInterrupt), "Performance Interrupt", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (ParkedAddress), "Parked Address", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (BaseAddress), "Base Address", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (GicvBaseAddress), "Virtual GIC Base Address", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (GichBaseAddress), "Hypervisor GIC Base Address", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT11_OFFSET (VgicInterrupt), "Virtual GIC Interrupt", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (GicrBaseAddress), "Redistributor Base Address", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_MADT11_OFFSET (ArmMpidr), "ARM MPIDR", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
@@ -1559,6 +1716,30 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[] =
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* 13: Generic MSI Frame (ACPI 5.1) */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt13[] =
|
||||
{
|
||||
{ACPI_DMT_UINT16, ACPI_MADT13_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT13_OFFSET (MsiFrameId), "MSI Frame ID", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_MADT13_OFFSET (BaseAddress), "Base Address", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT13_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_MADT13_FLAG_OFFSET (Flags,0), "Select SPI", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_MADT13_OFFSET (SpiCount), "SPI Count", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_MADT13_OFFSET (SpiBase), "SPI Base", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* 14: Generic Redistributor (ACPI 5.1) */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt14[] =
|
||||
{
|
||||
{ACPI_DMT_UINT16, ACPI_MADT14_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_MADT14_OFFSET (BaseAddress), "Base Address", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_MADT14_OFFSET (Length), "Length", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@@ -1749,25 +1930,52 @@ 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_UINT64, ACPI_PCCT_OFFSET (Reserved), "Reserved", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* PCCT subtables */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoPcctHdr[] =
|
||||
{
|
||||
{ACPI_DMT_PCCT, ACPI_PCCT0_OFFSET (Header.Type), "Subtable Type", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_PCCT0_OFFSET (Header.Length), "Length", DT_LENGTH},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* 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_UINT32, ACPI_PCCT0_OFFSET (Latency), "Command Latency", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_PCCT0_OFFSET (MaxAccessRate), "Maximum Access Rate", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_PCCT0_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
/* 1: HW-reduced Communications Subspace (ACPI 5.1) */
|
||||
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[] =
|
||||
{
|
||||
{ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (DoorbellInterrupt), "Doorbell Interrupt", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_PCCT1_OFFSET (Flags), "Flags (Decoded Below)", DT_FLAG},
|
||||
{ACPI_DMT_FLAG0, ACPI_PCCT1_FLAG_OFFSET (Flags,0), "Polarity", 0},
|
||||
{ACPI_DMT_FLAG1, ACPI_PCCT1_FLAG_OFFSET (Flags,0), "Mode", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_PCCT1_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (BaseAddress), "Base Address", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (Length), "Address Length", 0},
|
||||
{ACPI_DMT_GAS, ACPI_PCCT1_OFFSET (DoorbellRegister), "Doorbell Register", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (PreserveMask), "Preserve Mask", 0},
|
||||
{ACPI_DMT_UINT64, ACPI_PCCT1_OFFSET (WriteMask), "Write Mask", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (Latency), "Command Latency", 0},
|
||||
{ACPI_DMT_UINT32, ACPI_PCCT1_OFFSET (MaxAccessRate), "Maximum Access Rate", 0},
|
||||
{ACPI_DMT_UINT16, ACPI_PCCT1_OFFSET (MinTurnaroundTime), "Minimum Turnaround Time", 0},
|
||||
ACPI_DMT_TERMINATOR
|
||||
};
|
||||
|
||||
@@ -1999,7 +2207,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[] =
|
||||
ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[] =
|
||||
{
|
||||
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterfaceType), "Interface Type", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved), "Reserved", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved), "Reserved", DT_NON_ZERO}, /* Value must be 1 */
|
||||
{ACPI_DMT_UINT16, ACPI_SPMI_OFFSET (SpecRevision), "IPMI Spec Version", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterruptType), "Interrupt Type", 0},
|
||||
{ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (GpeNumber), "GPE Number", 0},
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -123,14 +123,12 @@
|
||||
* "f|" - Option has required single-char sub-options
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acapps.h"
|
||||
|
||||
#define ACPI_OPTION_ERROR(msg, badchar) \
|
||||
if (AcpiGbl_Opterr) {fprintf (stderr, "%s%c\n", msg, badchar);}
|
||||
if (AcpiGbl_Opterr) {AcpiLogError ("%s%c\n", msg, badchar);}
|
||||
|
||||
|
||||
int AcpiGbl_Opterr = 1;
|
||||
@@ -195,7 +193,7 @@ AcpiGetoptArgument (
|
||||
* PARAMETERS: argc, argv - from main
|
||||
* opts - options info list
|
||||
*
|
||||
* RETURN: Option character or EOF
|
||||
* RETURN: Option character or ACPI_OPT_END
|
||||
*
|
||||
* DESCRIPTION: Get the next option
|
||||
*
|
||||
@@ -217,12 +215,12 @@ AcpiGetopt(
|
||||
argv[AcpiGbl_Optind][0] != '-' ||
|
||||
argv[AcpiGbl_Optind][1] == '\0')
|
||||
{
|
||||
return (EOF);
|
||||
return (ACPI_OPT_END);
|
||||
}
|
||||
else if (strcmp (argv[AcpiGbl_Optind], "--") == 0)
|
||||
else if (ACPI_STRCMP (argv[AcpiGbl_Optind], "--") == 0)
|
||||
{
|
||||
AcpiGbl_Optind++;
|
||||
return (EOF);
|
||||
return (ACPI_OPT_END);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,7 +231,7 @@ AcpiGetopt(
|
||||
/* Make sure that the option is legal */
|
||||
|
||||
if (CurrentChar == ':' ||
|
||||
(OptsPtr = strchr (opts, CurrentChar)) == NULL)
|
||||
(OptsPtr = ACPI_STRCHR (opts, CurrentChar)) == NULL)
|
||||
{
|
||||
ACPI_OPTION_ERROR ("Illegal option: -", CurrentChar);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -188,7 +188,7 @@ AcpiDsCreateExternalRegion (
|
||||
* OperationRegion not found. Generate an External for it, and
|
||||
* insert the name into the namespace.
|
||||
*/
|
||||
AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_REGION, 0);
|
||||
AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_REGION, 0, 0);
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_REGION,
|
||||
ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, WalkState, Node);
|
||||
if (ACPI_FAILURE (Status))
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -124,6 +124,7 @@
|
||||
#define _COMPONENT ACPI_DISPATCHER
|
||||
ACPI_MODULE_NAME ("dsinit")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
@@ -163,8 +164,8 @@ AcpiDsInitOneObject (
|
||||
{
|
||||
ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context;
|
||||
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
|
||||
ACPI_OBJECT_TYPE Type;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
@@ -183,9 +184,7 @@ AcpiDsInitOneObject (
|
||||
|
||||
/* And even then, we are only interested in a few object types */
|
||||
|
||||
Type = AcpiNsGetType (ObjHandle);
|
||||
|
||||
switch (Type)
|
||||
switch (AcpiNsGetType (ObjHandle))
|
||||
{
|
||||
case ACPI_TYPE_REGION:
|
||||
|
||||
@@ -201,8 +200,45 @@ AcpiDsInitOneObject (
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_METHOD:
|
||||
|
||||
/*
|
||||
* Auto-serialization support. We will examine each method that is
|
||||
* NotSerialized to determine if it creates any Named objects. If
|
||||
* it does, it will be marked serialized to prevent problems if
|
||||
* the method is entered by two or more threads and an attempt is
|
||||
* made to create the same named object twice -- which results in
|
||||
* an AE_ALREADY_EXISTS exception and method abort.
|
||||
*/
|
||||
Info->MethodCount++;
|
||||
ObjDesc = AcpiNsGetAttachedObject (Node);
|
||||
if (!ObjDesc)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/* Ignore if already serialized */
|
||||
|
||||
if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED)
|
||||
{
|
||||
Info->SerialMethodCount++;
|
||||
break;
|
||||
}
|
||||
|
||||
if (AcpiGbl_AutoSerializeMethods)
|
||||
{
|
||||
/* Parse/scan method and serialize it if necessary */
|
||||
|
||||
AcpiDsAutoSerializeMethod (Node, ObjDesc);
|
||||
if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED)
|
||||
{
|
||||
/* Method was just converted to Serialized */
|
||||
|
||||
Info->SerialMethodCount++;
|
||||
Info->SerializedMethodCount++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Info->NonSerialMethodCount++;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_DEVICE:
|
||||
@@ -259,7 +295,6 @@ AcpiDsInitializeObjects (
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"**** Starting initialization of namespace objects ****\n"));
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Parsing all Control Methods:"));
|
||||
|
||||
/* Set all init info to zero */
|
||||
|
||||
@@ -295,12 +330,14 @@ AcpiDsInitializeObjects (
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
|
||||
"\nTable [%4.4s](id %4.4X) - %u Objects with %u Devices %u Methods %u Regions\n",
|
||||
Table->Signature, OwnerId, Info.ObjectCount,
|
||||
Info.DeviceCount, Info.MethodCount, Info.OpRegionCount));
|
||||
"Table [%4.4s] (id %4.4X) - %4u Objects with %3u Devices, "
|
||||
"%3u Regions, %3u Methods (%u/%u/%u Serial/Non/Cvt)\n",
|
||||
Table->Signature, OwnerId, Info.ObjectCount, Info.DeviceCount,
|
||||
Info.OpRegionCount, Info.MethodCount, Info.SerialMethodCount,
|
||||
Info.NonSerialMethodCount, Info.SerializedMethodCount));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"%u Methods, %u Regions\n", Info.MethodCount, Info.OpRegionCount));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "%u Methods, %u Regions\n",
|
||||
Info.MethodCount, Info.OpRegionCount));
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -121,6 +121,8 @@
|
||||
#include "acinterp.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acdisasm.h"
|
||||
#include "acparser.h"
|
||||
#include "amlcode.h"
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_DISPATCHER
|
||||
@@ -128,11 +130,155 @@
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsDetectNamedOpcodes (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT **OutOp);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsCreateMethodMutex (
|
||||
ACPI_OPERAND_OBJECT *MethodDesc);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsAutoSerializeMethod
|
||||
*
|
||||
* PARAMETERS: Node - Namespace Node of the method
|
||||
* ObjDesc - Method object attached to node
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Parse a control method AML to scan for control methods that
|
||||
* need serialization due to the creation of named objects.
|
||||
*
|
||||
* NOTE: It is a bit of overkill to mark all such methods serialized, since
|
||||
* there is only a problem if the method actually blocks during execution.
|
||||
* A blocking operation is, for example, a Sleep() operation, or any access
|
||||
* to an operation region. However, it is probably not possible to easily
|
||||
* detect whether a method will block or not, so we simply mark all suspicious
|
||||
* methods as serialized.
|
||||
*
|
||||
* NOTE2: This code is essentially a generic routine for parsing a single
|
||||
* control method.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsAutoSerializeMethod (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_PARSE_OBJECT *Op = NULL;
|
||||
ACPI_WALK_STATE *WalkState;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsAutoSerializeMethod, Node);
|
||||
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
|
||||
"Method auto-serialization parse [%4.4s] %p\n",
|
||||
AcpiUtGetNodeName (Node), Node));
|
||||
|
||||
/* Create/Init a root op for the method parse tree */
|
||||
|
||||
Op = AcpiPsAllocOp (AML_METHOD_OP);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
AcpiPsSetName (Op, Node->Name.Integer);
|
||||
Op->Common.Node = Node;
|
||||
|
||||
/* Create and initialize a new walk state */
|
||||
|
||||
WalkState = AcpiDsCreateWalkState (Node->OwnerId, NULL, NULL, NULL);
|
||||
if (!WalkState)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
Status = AcpiDsInitAmlWalk (WalkState, Op, Node, ObjDesc->Method.AmlStart,
|
||||
ObjDesc->Method.AmlLength, NULL, 0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiDsDeleteWalkState (WalkState);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
WalkState->DescendingCallback = AcpiDsDetectNamedOpcodes;
|
||||
|
||||
/* Parse the method, scan for creation of named objects */
|
||||
|
||||
Status = AcpiPsParseAml (WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
AcpiPsDeleteParseTree (Op);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsDetectNamedOpcodes
|
||||
*
|
||||
* PARAMETERS: WalkState - Current state of the parse tree walk
|
||||
* OutOp - Unused, required for parser interface
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Descending callback used during the loading of ACPI tables.
|
||||
* Currently used to detect methods that must be marked serialized
|
||||
* in order to avoid problems with the creation of named objects.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsDetectNamedOpcodes (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT **OutOp)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_NAME (AcpiDsDetectNamedOpcodes);
|
||||
|
||||
|
||||
/* We are only interested in opcodes that create a new name */
|
||||
|
||||
if (!(WalkState->OpInfo->Flags & (AML_NAMED | AML_CREATE | AML_FIELD)))
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* At this point, we know we have a Named object opcode.
|
||||
* Mark the method as serialized. Later code will create a mutex for
|
||||
* this method to enforce serialization.
|
||||
*
|
||||
* Note, ACPI_METHOD_IGNORE_SYNC_LEVEL flag means that we will ignore the
|
||||
* Sync Level mechanism for this method, even though it is now serialized.
|
||||
* Otherwise, there can be conflicts with existing ASL code that actually
|
||||
* uses sync levels.
|
||||
*/
|
||||
WalkState->MethodDesc->Method.SyncLevel = 0;
|
||||
WalkState->MethodDesc->Method.InfoFlags |=
|
||||
(ACPI_METHOD_SERIALIZED | ACPI_METHOD_IGNORE_SYNC_LEVEL);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Method serialized [%4.4s] %p - [%s] (%4.4X)\n",
|
||||
WalkState->MethodNode->Name.Ascii, WalkState->MethodNode,
|
||||
WalkState->OpInfo->Name, WalkState->Opcode));
|
||||
|
||||
/* Abort the parse, no need to examine this method any further */
|
||||
|
||||
return (AE_CTRL_TERMINATE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsMethodError
|
||||
@@ -310,11 +456,16 @@ AcpiDsBeginMethodExecution (
|
||||
/*
|
||||
* The CurrentSyncLevel (per-thread) must be less than or equal to
|
||||
* the sync level of the method. This mechanism provides some
|
||||
* deadlock prevention
|
||||
* deadlock prevention.
|
||||
*
|
||||
* If the method was auto-serialized, we just ignore the sync level
|
||||
* mechanism, because auto-serialization of methods can interfere
|
||||
* with ASL code that actually uses sync levels.
|
||||
*
|
||||
* Top-level method invocation has no walk state at this point
|
||||
*/
|
||||
if (WalkState &&
|
||||
(!(ObjDesc->Method.InfoFlags & ACPI_METHOD_IGNORE_SYNC_LEVEL)) &&
|
||||
(WalkState->Thread->CurrentSyncLevel > ObjDesc->Method.Mutex->Mutex.SyncLevel))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
@@ -782,7 +933,8 @@ AcpiDsTerminateControlMethod (
|
||||
* thread exits here.
|
||||
*/
|
||||
MethodDesc->Method.InfoFlags &= ~ACPI_METHOD_SERIALIZED_PENDING;
|
||||
MethodDesc->Method.InfoFlags |= ACPI_METHOD_SERIALIZED;
|
||||
MethodDesc->Method.InfoFlags |=
|
||||
(ACPI_METHOD_SERIALIZED | ACPI_METHOD_IGNORE_SYNC_LEVEL);
|
||||
MethodDesc->Method.SyncLevel = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -851,16 +851,16 @@ AcpiDsCreateOperands (
|
||||
Index++;
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"NumOperands %d, ArgCount %d, Index %d\n",
|
||||
WalkState->NumOperands, ArgCount, Index));
|
||||
|
||||
/* Create the interpreter arguments, in reverse order */
|
||||
|
||||
Index--;
|
||||
|
||||
/* It is the appropriate order to get objects from the Result stack */
|
||||
|
||||
for (i = 0; i < ArgCount; i++)
|
||||
{
|
||||
Arg = Arguments[Index];
|
||||
|
||||
/* Force the filling of the operand stack in inverse order */
|
||||
|
||||
WalkState->OperandIndex = (UINT8) Index;
|
||||
|
||||
Status = AcpiDsCreateOperand (WalkState, Arg, Index);
|
||||
@@ -869,10 +869,10 @@ AcpiDsCreateOperands (
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Created Arg #%u (%p) %u args total\n",
|
||||
Index, Arg, ArgCount));
|
||||
Index--;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Arg #%u (%p) done, Arg1=%p\n",
|
||||
Index, Arg, FirstArg));
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -613,7 +613,8 @@ AcpiDsExecEndOp (
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%p\n", Op));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Method invocation, Op=%p\n", Op));
|
||||
|
||||
/*
|
||||
* (AML_METHODCALL) Op->Asl.Value.Arg->Asl.Node contains
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -152,8 +152,21 @@ AcpiDsInitCallbacks (
|
||||
|
||||
switch (PassNumber)
|
||||
{
|
||||
case 0:
|
||||
|
||||
/* Parse only - caller will setup callbacks */
|
||||
|
||||
WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 |
|
||||
ACPI_PARSE_DELETE_TREE |
|
||||
ACPI_PARSE_DISASSEMBLE;
|
||||
WalkState->DescendingCallback = NULL;
|
||||
WalkState->AscendingCallback = NULL;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
|
||||
/* Load pass 1 */
|
||||
|
||||
WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 |
|
||||
ACPI_PARSE_DELETE_TREE;
|
||||
WalkState->DescendingCallback = AcpiDsLoad1BeginOp;
|
||||
@@ -162,6 +175,8 @@ AcpiDsInitCallbacks (
|
||||
|
||||
case 2:
|
||||
|
||||
/* Load pass 2 */
|
||||
|
||||
WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 |
|
||||
ACPI_PARSE_DELETE_TREE;
|
||||
WalkState->DescendingCallback = AcpiDsLoad2BeginOp;
|
||||
@@ -170,6 +185,8 @@ AcpiDsInitCallbacks (
|
||||
|
||||
case 3:
|
||||
|
||||
/* Execution pass */
|
||||
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
WalkState->ParseFlags |= ACPI_PARSE_EXECUTE |
|
||||
ACPI_PARSE_DELETE_TREE;
|
||||
@@ -265,7 +282,7 @@ AcpiDsLoad1BeginOp (
|
||||
* Target of Scope() not found. Generate an External for it, and
|
||||
* insert the name into the namespace.
|
||||
*/
|
||||
AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_DEVICE, 0);
|
||||
AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_DEVICE, 0, 0);
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
|
||||
ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT,
|
||||
WalkState, &Node);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -504,7 +504,7 @@ AcpiEvGpeDetect (
|
||||
GpeRegisterInfo->EnableForWake))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
|
||||
"Ignore disabled registers for GPE%02X-GPE%02X: "
|
||||
"Ignore disabled registers for GPE %02X-%02X: "
|
||||
"RunEnable=%02X, WakeEnable=%02X\n",
|
||||
GpeRegisterInfo->BaseGpeNumber,
|
||||
GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
|
||||
@@ -530,7 +530,7 @@ AcpiEvGpeDetect (
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
|
||||
"Read registers for GPE%02X-GPE%02X: Status=%02X, Enable=%02X, "
|
||||
"Read registers for GPE %02X-%02X: Status=%02X, Enable=%02X, "
|
||||
"RunEnable=%02X, WakeEnable=%02X\n",
|
||||
GpeRegisterInfo->BaseGpeNumber,
|
||||
GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
|
||||
@@ -621,6 +621,7 @@ AcpiEvAsynchExecuteGpeMethod (
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (LocalGpeEventInfo);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
@@ -629,6 +630,7 @@ AcpiEvAsynchExecuteGpeMethod (
|
||||
if (!AcpiEvValidGpeEvent (GpeEventInfo))
|
||||
{
|
||||
Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
|
||||
ACPI_FREE (LocalGpeEventInfo);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
@@ -642,6 +644,7 @@ AcpiEvAsynchExecuteGpeMethod (
|
||||
Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (LocalGpeEventInfo);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
@@ -829,22 +832,6 @@ AcpiEvGpeDispatch (
|
||||
GpeNumber, AcpiGbl_GlobalEventHandlerContext);
|
||||
}
|
||||
|
||||
/*
|
||||
* If edge-triggered, clear the GPE status bit now. Note that
|
||||
* level-triggered events are cleared after the GPE is serviced.
|
||||
*/
|
||||
if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
|
||||
ACPI_GPE_EDGE_TRIGGERED)
|
||||
{
|
||||
Status = AcpiHwClearGpe (GpeEventInfo);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Unable to clear GPE%02X", GpeNumber));
|
||||
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Always disable the GPE so that it does not keep firing before
|
||||
* any asynchronous activity completes (either from the execution
|
||||
@@ -858,10 +845,28 @@ AcpiEvGpeDispatch (
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Unable to disable GPE%02X", GpeNumber));
|
||||
"Unable to disable GPE %02X", GpeNumber));
|
||||
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
|
||||
}
|
||||
|
||||
/*
|
||||
* If edge-triggered, clear the GPE status bit now. Note that
|
||||
* level-triggered events are cleared after the GPE is serviced.
|
||||
*/
|
||||
if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
|
||||
ACPI_GPE_EDGE_TRIGGERED)
|
||||
{
|
||||
Status = AcpiHwClearGpe (GpeEventInfo);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Unable to clear GPE %02X", GpeNumber));
|
||||
(void) AcpiHwLowSetGpe (GpeEventInfo,
|
||||
ACPI_GPE_CONDITIONAL_ENABLE);
|
||||
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Dispatch the GPE to either an installed handler or the control
|
||||
* method associated with this GPE (_Lxx or _Exx). If a handler
|
||||
@@ -898,7 +903,7 @@ AcpiEvGpeDispatch (
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Unable to queue handler for GPE%02X - event disabled",
|
||||
"Unable to queue handler for GPE %02X - event disabled",
|
||||
GpeNumber));
|
||||
}
|
||||
break;
|
||||
@@ -910,7 +915,7 @@ AcpiEvGpeDispatch (
|
||||
* a GPE to be enabled if it has no handler or method.
|
||||
*/
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"No handler or method for GPE%02X, disabling event",
|
||||
"No handler or method for GPE %02X, disabling event",
|
||||
GpeNumber));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -169,10 +169,9 @@ AcpiEvInstallGpeBlock (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
GpeXruptBlock = AcpiEvGetGpeXruptBlock (InterruptNumber);
|
||||
if (!GpeXruptBlock)
|
||||
Status = AcpiEvGetGpeXruptBlock (InterruptNumber, &GpeXruptBlock);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
@@ -200,7 +199,7 @@ AcpiEvInstallGpeBlock (
|
||||
|
||||
|
||||
UnlockAndExit:
|
||||
Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@@ -355,17 +354,17 @@ AcpiEvCreateGpeInfoBlocks (
|
||||
{
|
||||
/* Init the RegisterInfo for this GPE register (8 GPEs) */
|
||||
|
||||
ThisRegister->BaseGpeNumber = (UINT8) (GpeBlock->BlockBaseNumber +
|
||||
(i * ACPI_GPE_REGISTER_WIDTH));
|
||||
ThisRegister->BaseGpeNumber = (UINT16)
|
||||
(GpeBlock->BlockBaseNumber + (i * ACPI_GPE_REGISTER_WIDTH));
|
||||
|
||||
ThisRegister->StatusAddress.Address =
|
||||
GpeBlock->BlockAddress.Address + i;
|
||||
GpeBlock->Address + i;
|
||||
|
||||
ThisRegister->EnableAddress.Address =
|
||||
GpeBlock->BlockAddress.Address + i + GpeBlock->RegisterCount;
|
||||
GpeBlock->Address + i + GpeBlock->RegisterCount;
|
||||
|
||||
ThisRegister->StatusAddress.SpaceId = GpeBlock->BlockAddress.SpaceId;
|
||||
ThisRegister->EnableAddress.SpaceId = GpeBlock->BlockAddress.SpaceId;
|
||||
ThisRegister->StatusAddress.SpaceId = GpeBlock->SpaceId;
|
||||
ThisRegister->EnableAddress.SpaceId = GpeBlock->SpaceId;
|
||||
ThisRegister->StatusAddress.BitWidth = ACPI_GPE_REGISTER_WIDTH;
|
||||
ThisRegister->EnableAddress.BitWidth = ACPI_GPE_REGISTER_WIDTH;
|
||||
ThisRegister->StatusAddress.BitOffset = 0;
|
||||
@@ -438,9 +437,10 @@ ErrorExit:
|
||||
ACPI_STATUS
|
||||
AcpiEvCreateGpeBlock (
|
||||
ACPI_NAMESPACE_NODE *GpeDevice,
|
||||
ACPI_GENERIC_ADDRESS *GpeBlockAddress,
|
||||
UINT64 Address,
|
||||
UINT8 SpaceId,
|
||||
UINT32 RegisterCount,
|
||||
UINT8 GpeBlockBaseNumber,
|
||||
UINT16 GpeBlockBaseNumber,
|
||||
UINT32 InterruptNumber,
|
||||
ACPI_GPE_BLOCK_INFO **ReturnGpeBlock)
|
||||
{
|
||||
@@ -467,15 +467,14 @@ AcpiEvCreateGpeBlock (
|
||||
|
||||
/* Initialize the new GPE block */
|
||||
|
||||
GpeBlock->Address = Address;
|
||||
GpeBlock->SpaceId = SpaceId;
|
||||
GpeBlock->Node = GpeDevice;
|
||||
GpeBlock->GpeCount = (UINT16) (RegisterCount * ACPI_GPE_REGISTER_WIDTH);
|
||||
GpeBlock->Initialized = FALSE;
|
||||
GpeBlock->RegisterCount = RegisterCount;
|
||||
GpeBlock->BlockBaseNumber = GpeBlockBaseNumber;
|
||||
|
||||
ACPI_MEMCPY (&GpeBlock->BlockAddress, GpeBlockAddress,
|
||||
sizeof (ACPI_GENERIC_ADDRESS));
|
||||
|
||||
/*
|
||||
* Create the RegisterInfo and EventInfo sub-structures
|
||||
* Note: disables and clears all GPEs in the block
|
||||
@@ -518,11 +517,11 @@ AcpiEvCreateGpeBlock (
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
|
||||
" Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X\n",
|
||||
" Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X%s\n",
|
||||
(UINT32) GpeBlock->BlockBaseNumber,
|
||||
(UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1)),
|
||||
GpeDevice->Name.Ascii, GpeBlock->RegisterCount,
|
||||
InterruptNumber));
|
||||
GpeDevice->Name.Ascii, GpeBlock->RegisterCount, InterruptNumber,
|
||||
InterruptNumber == AcpiGbl_FADT.SciInterrupt ? " (SCI)" : ""));
|
||||
|
||||
/* Update global count of currently available GPEs */
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -211,7 +211,9 @@ AcpiEvGpeInitialize (
|
||||
/* Install GPE Block 0 */
|
||||
|
||||
Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
|
||||
&AcpiGbl_FADT.XGpe0Block, RegisterCount0, 0,
|
||||
AcpiGbl_FADT.XGpe0Block.Address,
|
||||
AcpiGbl_FADT.XGpe0Block.SpaceId,
|
||||
RegisterCount0, 0,
|
||||
AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[0]);
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -249,7 +251,9 @@ AcpiEvGpeInitialize (
|
||||
/* Install GPE Block 1 */
|
||||
|
||||
Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
|
||||
&AcpiGbl_FADT.XGpe1Block, RegisterCount1,
|
||||
AcpiGbl_FADT.XGpe1Block.Address,
|
||||
AcpiGbl_FADT.XGpe1Block.SpaceId,
|
||||
RegisterCount1,
|
||||
AcpiGbl_FADT.Gpe1Base,
|
||||
AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[1]);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -289,8 +289,9 @@ AcpiEvGetGpeDevice (
|
||||
* FUNCTION: AcpiEvGetGpeXruptBlock
|
||||
*
|
||||
* PARAMETERS: InterruptNumber - Interrupt for a GPE block
|
||||
* GpeXruptBlock - Where the block is returned
|
||||
*
|
||||
* RETURN: A GPE interrupt block
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt
|
||||
* block per unique interrupt level used for GPEs. Should be
|
||||
@@ -299,9 +300,10 @@ AcpiEvGetGpeDevice (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_GPE_XRUPT_INFO *
|
||||
ACPI_STATUS
|
||||
AcpiEvGetGpeXruptBlock (
|
||||
UINT32 InterruptNumber)
|
||||
UINT32 InterruptNumber,
|
||||
ACPI_GPE_XRUPT_INFO **GpeXruptBlock)
|
||||
{
|
||||
ACPI_GPE_XRUPT_INFO *NextGpeXrupt;
|
||||
ACPI_GPE_XRUPT_INFO *GpeXrupt;
|
||||
@@ -319,7 +321,8 @@ AcpiEvGetGpeXruptBlock (
|
||||
{
|
||||
if (NextGpeXrupt->InterruptNumber == InterruptNumber)
|
||||
{
|
||||
return_PTR (NextGpeXrupt);
|
||||
*GpeXruptBlock = NextGpeXrupt;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
NextGpeXrupt = NextGpeXrupt->Next;
|
||||
@@ -330,7 +333,7 @@ AcpiEvGetGpeXruptBlock (
|
||||
GpeXrupt = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_XRUPT_INFO));
|
||||
if (!GpeXrupt)
|
||||
{
|
||||
return_PTR (NULL);
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
GpeXrupt->InterruptNumber = InterruptNumber;
|
||||
@@ -353,6 +356,7 @@ AcpiEvGetGpeXruptBlock (
|
||||
{
|
||||
AcpiGbl_GpeXruptListHead = GpeXrupt;
|
||||
}
|
||||
|
||||
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
|
||||
|
||||
/* Install new interrupt handler if not SCI_INT */
|
||||
@@ -363,14 +367,15 @@ AcpiEvGetGpeXruptBlock (
|
||||
AcpiEvGpeXruptHandler, GpeXrupt);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Could not install GPE interrupt handler at level 0x%X",
|
||||
InterruptNumber));
|
||||
return_PTR (NULL);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
|
||||
return_PTR (GpeXrupt);
|
||||
*GpeXruptBlock = GpeXrupt;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -253,7 +253,7 @@ AcpiEvQueueNotifyRequest (
|
||||
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));
|
||||
NotifyValue, AcpiUtGetNotifyName (NotifyValue, ACPI_TYPE_ANY), Node));
|
||||
|
||||
Status = AcpiOsExecute (OSL_NOTIFY_HANDLER, AcpiEvNotifyDispatch,
|
||||
Info);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -405,6 +405,7 @@ AcpiEvDetachRegion(
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *HandlerObj;
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_OPERAND_OBJECT *StartDesc;
|
||||
ACPI_OPERAND_OBJECT **LastObjPtr;
|
||||
ACPI_ADR_SPACE_SETUP RegionSetup;
|
||||
void **RegionContext;
|
||||
@@ -435,6 +436,7 @@ AcpiEvDetachRegion(
|
||||
/* Find this region in the handler's list */
|
||||
|
||||
ObjDesc = HandlerObj->AddressSpace.RegionList;
|
||||
StartDesc = ObjDesc;
|
||||
LastObjPtr = &HandlerObj->AddressSpace.RegionList;
|
||||
|
||||
while (ObjDesc)
|
||||
@@ -529,6 +531,16 @@ AcpiEvDetachRegion(
|
||||
|
||||
LastObjPtr = &ObjDesc->Region.Next;
|
||||
ObjDesc = ObjDesc->Region.Next;
|
||||
|
||||
/* Prevent infinite loop if list is corrupted */
|
||||
|
||||
if (ObjDesc == StartDesc)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Circular handler list in region object %p",
|
||||
RegionObj));
|
||||
return_VOID;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we get here, the region was not in the handler's region list */
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -208,7 +208,7 @@ AcpiEvSciXruptHandler (
|
||||
|
||||
|
||||
/*
|
||||
* We are guaranteed by the ACPI CA initialization/shutdown code that
|
||||
* We are guaranteed by the ACPICA initialization/shutdown code that
|
||||
* if this interrupt handler is installed, ACPI is enabled.
|
||||
*/
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -115,6 +115,7 @@
|
||||
|
||||
|
||||
#define __EVXFACE_C__
|
||||
#define EXPORT_ACPI_INTERFACES
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -337,7 +338,7 @@ AcpiRemoveNotifyHandler (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_OPERAND_OBJECT *HandlerObj;
|
||||
ACPI_OPERAND_OBJECT *PreviousHandlerObj;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
@@ -352,16 +353,6 @@ AcpiRemoveNotifyHandler (
|
||||
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)
|
||||
@@ -370,6 +361,12 @@ AcpiRemoveNotifyHandler (
|
||||
{
|
||||
if (HandlerType & (i+1))
|
||||
{
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
if (!AcpiGbl_GlobalNotify[i].Handler ||
|
||||
(AcpiGbl_GlobalNotify[i].Handler != Handler))
|
||||
{
|
||||
@@ -382,18 +379,23 @@ AcpiRemoveNotifyHandler (
|
||||
|
||||
AcpiGbl_GlobalNotify[i].Handler = NULL;
|
||||
AcpiGbl_GlobalNotify[i].Context = NULL;
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
|
||||
/* Make sure all deferred notify tasks are completed */
|
||||
|
||||
AcpiOsWaitEventsComplete ();
|
||||
}
|
||||
}
|
||||
|
||||
goto UnlockAndExit;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* All other objects: Are Notifies allowed on this object? */
|
||||
|
||||
if (!AcpiEvIsNotifyObject (Node))
|
||||
{
|
||||
Status = AE_TYPE;
|
||||
goto UnlockAndExit;
|
||||
return_ACPI_STATUS (AE_TYPE);
|
||||
}
|
||||
|
||||
/* Must have an existing internal object */
|
||||
@@ -401,8 +403,7 @@ AcpiRemoveNotifyHandler (
|
||||
ObjDesc = AcpiNsGetAttachedObject (Node);
|
||||
if (!ObjDesc)
|
||||
{
|
||||
Status = AE_NOT_EXIST;
|
||||
goto UnlockAndExit;
|
||||
return_ACPI_STATUS (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
/* Internal object exists. Find the handler and remove it */
|
||||
@@ -411,6 +412,12 @@ AcpiRemoveNotifyHandler (
|
||||
{
|
||||
if (HandlerType & (i+1))
|
||||
{
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
HandlerObj = ObjDesc->CommonNotify.NotifyList[i];
|
||||
PreviousHandlerObj = NULL;
|
||||
|
||||
@@ -442,10 +449,17 @@ AcpiRemoveNotifyHandler (
|
||||
HandlerObj->Notify.Next[i];
|
||||
}
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
|
||||
/* Make sure all deferred notify tasks are completed */
|
||||
|
||||
AcpiOsWaitEventsComplete ();
|
||||
AcpiUtRemoveReference (HandlerObj);
|
||||
}
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
|
||||
|
||||
UnlockAndExit:
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
@@ -591,6 +605,8 @@ Exit:
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiInstallSciHandler)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@@ -667,6 +683,8 @@ UnlockAndExit:
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiRemoveSciHandler)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@@ -1041,10 +1059,6 @@ 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))
|
||||
{
|
||||
@@ -1101,10 +1115,17 @@ AcpiRemoveGpeHandler (
|
||||
(void) AcpiEvAddGpeReference (GpeEventInfo);
|
||||
}
|
||||
|
||||
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
|
||||
|
||||
/* Make sure all deferred GPE tasks are completed */
|
||||
|
||||
AcpiOsWaitEventsComplete ();
|
||||
|
||||
/* Now we can free the handler object */
|
||||
|
||||
ACPI_FREE (Handler);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
|
||||
UnlockAndExit:
|
||||
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -115,6 +115,7 @@
|
||||
|
||||
|
||||
#define __EVXFEVNT_C__
|
||||
#define EXPORT_ACPI_INTERFACES
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -115,6 +115,7 @@
|
||||
|
||||
|
||||
#define __EVXFGPE_C__
|
||||
#define EXPORT_ACPI_INTERFACES
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -212,12 +213,23 @@ AcpiEnableGpe (
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
|
||||
|
||||
/* Ensure that we have a valid GPE number */
|
||||
|
||||
/*
|
||||
* Ensure that we have a valid GPE number and that there is some way
|
||||
* of handling the GPE (handler or a GPE method). In other words, we
|
||||
* won't allow a valid GPE to be enabled if there is no way to handle it.
|
||||
*/
|
||||
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
|
||||
if (GpeEventInfo)
|
||||
{
|
||||
Status = AcpiEvAddGpeReference (GpeEventInfo);
|
||||
if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) !=
|
||||
ACPI_GPE_DISPATCH_NONE)
|
||||
{
|
||||
Status = AcpiEvAddGpeReference (GpeEventInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = AE_NO_HANDLER;
|
||||
}
|
||||
}
|
||||
|
||||
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
|
||||
@@ -345,6 +357,60 @@ UnlockAndExit:
|
||||
ACPI_EXPORT_SYMBOL (AcpiSetGpe)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiMarkGpeForWake
|
||||
*
|
||||
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
|
||||
* GpeNumber - GPE level within the GPE block
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Mark a GPE as having the ability to wake the system. Simply
|
||||
* sets the ACPI_GPE_CAN_WAKE flag.
|
||||
*
|
||||
* Some potential callers of AcpiSetupGpeForWake may know in advance that
|
||||
* there won't be any notify handlers installed for device wake notifications
|
||||
* from the given GPE (one example is a button GPE in Linux). For these cases,
|
||||
* AcpiMarkGpeForWake should be used instead of AcpiSetupGpeForWake.
|
||||
* This will set the ACPI_GPE_CAN_WAKE flag for the GPE without trying to
|
||||
* setup implicit wake notification for it (since there's no handler method).
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiMarkGpeForWake (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
UINT32 GpeNumber)
|
||||
{
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo;
|
||||
ACPI_STATUS Status = AE_BAD_PARAMETER;
|
||||
ACPI_CPU_FLAGS Flags;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiMarkGpeForWake);
|
||||
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
|
||||
|
||||
/* Ensure that we have a valid GPE number */
|
||||
|
||||
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
|
||||
if (GpeEventInfo)
|
||||
{
|
||||
/* Mark the GPE as a possible wake event */
|
||||
|
||||
GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE;
|
||||
Status = AE_OK;
|
||||
}
|
||||
|
||||
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiMarkGpeForWake)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiSetupGpeForWake
|
||||
@@ -862,11 +928,26 @@ AcpiInstallGpeBlock (
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/* Validate the parent device */
|
||||
|
||||
if (Node->Type != ACPI_TYPE_DEVICE)
|
||||
{
|
||||
Status = AE_TYPE;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
if (Node->Object)
|
||||
{
|
||||
Status = AE_ALREADY_EXISTS;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/*
|
||||
* For user-installed GPE Block Devices, the GpeBlockBaseNumber
|
||||
* is always zero
|
||||
*/
|
||||
Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress, RegisterCount,
|
||||
Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress->Address,
|
||||
GpeBlockAddress->SpaceId, RegisterCount,
|
||||
0, InterruptNumber, &GpeBlock);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -955,6 +1036,14 @@ AcpiRemoveGpeBlock (
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/* Validate the parent device */
|
||||
|
||||
if (Node->Type != ACPI_TYPE_DEVICE)
|
||||
{
|
||||
Status = AE_TYPE;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/* Get the DeviceObject attached to the node */
|
||||
|
||||
ObjDesc = AcpiNsGetAttachedObject (Node);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -115,6 +115,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EVXFREGN_C__
|
||||
#define EXPORT_ACPI_INTERFACES
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -453,8 +453,8 @@ AcpiExLoadOp (
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *DdbHandle;
|
||||
ACPI_TABLE_HEADER *TableHeader;
|
||||
ACPI_TABLE_HEADER *Table;
|
||||
ACPI_TABLE_DESC TableDesc;
|
||||
UINT32 TableIndex;
|
||||
ACPI_STATUS Status;
|
||||
UINT32 Length;
|
||||
@@ -463,8 +463,6 @@ AcpiExLoadOp (
|
||||
ACPI_FUNCTION_TRACE (ExLoadOp);
|
||||
|
||||
|
||||
ACPI_MEMSET (&TableDesc, 0, sizeof (ACPI_TABLE_DESC));
|
||||
|
||||
/* Source Object can be either an OpRegion or a Buffer/Field */
|
||||
|
||||
switch (ObjDesc->Common.Type)
|
||||
@@ -496,16 +494,16 @@ AcpiExLoadOp (
|
||||
|
||||
/* Get the table header first so we can get the table length */
|
||||
|
||||
Table = ACPI_ALLOCATE (sizeof (ACPI_TABLE_HEADER));
|
||||
if (!Table)
|
||||
TableHeader = ACPI_ALLOCATE (sizeof (ACPI_TABLE_HEADER));
|
||||
if (!TableHeader)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
Status = AcpiExRegionRead (ObjDesc, sizeof (ACPI_TABLE_HEADER),
|
||||
ACPI_CAST_PTR (UINT8, Table));
|
||||
Length = Table->Length;
|
||||
ACPI_FREE (Table);
|
||||
ACPI_CAST_PTR (UINT8, TableHeader));
|
||||
Length = TableHeader->Length;
|
||||
ACPI_FREE (TableHeader);
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -537,8 +535,8 @@ AcpiExLoadOp (
|
||||
|
||||
/* Allocate a buffer for the table */
|
||||
|
||||
TableDesc.Pointer = ACPI_ALLOCATE (Length);
|
||||
if (!TableDesc.Pointer)
|
||||
Table = ACPI_ALLOCATE (Length);
|
||||
if (!Table)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
@@ -546,14 +544,12 @@ AcpiExLoadOp (
|
||||
/* Read the entire table */
|
||||
|
||||
Status = AcpiExRegionRead (ObjDesc, Length,
|
||||
ACPI_CAST_PTR (UINT8, TableDesc.Pointer));
|
||||
ACPI_CAST_PTR (UINT8, Table));
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (TableDesc.Pointer);
|
||||
ACPI_FREE (Table);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
TableDesc.Address = ObjDesc->Region.Address;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER: /* Buffer or resolved RegionField */
|
||||
@@ -570,8 +566,8 @@ AcpiExLoadOp (
|
||||
|
||||
/* Get the actual table length from the table header */
|
||||
|
||||
Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ObjDesc->Buffer.Pointer);
|
||||
Length = Table->Length;
|
||||
TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ObjDesc->Buffer.Pointer);
|
||||
Length = TableHeader->Length;
|
||||
|
||||
/* Table cannot extend beyond the buffer */
|
||||
|
||||
@@ -588,14 +584,13 @@ AcpiExLoadOp (
|
||||
* Copy the table from the buffer because the buffer could be modified
|
||||
* or even deleted in the future
|
||||
*/
|
||||
TableDesc.Pointer = ACPI_ALLOCATE (Length);
|
||||
if (!TableDesc.Pointer)
|
||||
Table = ACPI_ALLOCATE (Length);
|
||||
if (!Table)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
ACPI_MEMCPY (TableDesc.Pointer, Table, Length);
|
||||
TableDesc.Address = ACPI_TO_INTEGER (TableDesc.Pointer);
|
||||
ACPI_MEMCPY (Table, TableHeader, Length);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -603,28 +598,31 @@ AcpiExLoadOp (
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
/* Validate table checksum (will not get validated in TbAddTable) */
|
||||
|
||||
Status = AcpiTbVerifyChecksum (TableDesc.Pointer, Length);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (TableDesc.Pointer);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Complete the table descriptor */
|
||||
|
||||
TableDesc.Length = Length;
|
||||
TableDesc.Flags = ACPI_TABLE_ORIGIN_ALLOCATED;
|
||||
|
||||
/* Install the new table into the local data structures */
|
||||
|
||||
Status = AcpiTbAddTable (&TableDesc, &TableIndex);
|
||||
ACPI_INFO ((AE_INFO, "Dynamic OEM Table Load:"));
|
||||
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
|
||||
|
||||
Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table),
|
||||
ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, TRUE, TRUE,
|
||||
&TableIndex);
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
/* Delete allocated table buffer */
|
||||
|
||||
AcpiTbDeleteTable (&TableDesc);
|
||||
ACPI_FREE (Table);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Note: Now table is "INSTALLED", it must be validated before
|
||||
* loading.
|
||||
*/
|
||||
Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[TableIndex]);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@@ -656,9 +654,6 @@ AcpiExLoadOp (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_INFO ((AE_INFO, "Dynamic OEM Table Load:"));
|
||||
AcpiTbPrintTableHeader (0, TableDesc.Pointer);
|
||||
|
||||
/* Remove the reference by added by AcpiExStore above */
|
||||
|
||||
AcpiUtRemoveReference (DdbHandle);
|
||||
@@ -667,7 +662,7 @@ AcpiExLoadOp (
|
||||
|
||||
if (AcpiGbl_TableHandler)
|
||||
{
|
||||
(void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, TableDesc.Pointer,
|
||||
(void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,
|
||||
AcpiGbl_TableHandlerContext);
|
||||
}
|
||||
|
||||
@@ -700,6 +695,14 @@ AcpiExUnloadTable (
|
||||
ACPI_FUNCTION_TRACE (ExUnloadTable);
|
||||
|
||||
|
||||
/*
|
||||
* Temporarily emit a warning so that the ASL for the machine can be
|
||||
* hopefully obtained. This is to say that the Unload() operator is
|
||||
* extremely rare if not completely unused.
|
||||
*/
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Received request to unload an ACPI table"));
|
||||
|
||||
/*
|
||||
* Validate the handle
|
||||
* Although the handle is partially validated in AcpiExReconfiguration()
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -154,6 +154,7 @@ AcpiExDoDebugObject (
|
||||
UINT32 Index)
|
||||
{
|
||||
UINT32 i;
|
||||
UINT32 Timer;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (ExDoDebugObject, SourceDesc);
|
||||
@@ -167,13 +168,21 @@ AcpiExDoDebugObject (
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/*
|
||||
* We will emit the current timer value (in microseconds) with each
|
||||
* debug output. Only need the lower 26 bits. This allows for 67
|
||||
* million microseconds or 67 seconds before rollover.
|
||||
*/
|
||||
Timer = (UINT32) (AcpiOsGetTimer () / 10); /* (100 nanoseconds to microseconds) */
|
||||
Timer &= 0x03FFFFFF;
|
||||
|
||||
/*
|
||||
* Print line header as long as we are not in the middle of an
|
||||
* object display
|
||||
*/
|
||||
if (!((Level > 0) && Index == 0))
|
||||
{
|
||||
AcpiOsPrintf ("[ACPI Debug] %*s", Level, " ");
|
||||
AcpiOsPrintf ("[ACPI Debug %.8u] %*s", Timer, Level, " ");
|
||||
}
|
||||
|
||||
/* Display the index for package output only */
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -186,13 +186,14 @@ static ACPI_EXDUMP_INFO AcpiExDumpBuffer[5] =
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpBuffer), NULL},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Buffer.Length), "Length"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Buffer.Pointer), "Pointer"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Buffer.Node), "Parent Node"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Buffer.Node), "Parent Node"},
|
||||
{ACPI_EXD_BUFFER, 0, NULL}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpPackage[5] =
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpPackage[6] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpPackage), NULL},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Package.Node), "Parent Node"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Package.Flags), "Flags"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Package.Count), "Elements"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Package.Elements), "Element List"},
|
||||
@@ -202,9 +203,9 @@ static ACPI_EXDUMP_INFO AcpiExDumpPackage[5] =
|
||||
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.NotifyList[0]), "System Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.NotifyList[1]), "Device Notify"}
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.NotifyList[1]), "Device Notify"},
|
||||
{ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (Device.Handler), "Handler"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpEvent[2] =
|
||||
@@ -226,33 +227,36 @@ static ACPI_EXDUMP_INFO AcpiExDumpMethod[9] =
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Method.AmlStart), "Aml Start"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpMutex[5] =
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpMutex[6] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpMutex), NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Mutex.SyncLevel), "Sync Level"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Mutex.OriginalSyncLevel), "Original Sync Level"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Mutex.OwnerThread), "Owner Thread"},
|
||||
{ACPI_EXD_UINT16, ACPI_EXD_OFFSET (Mutex.AcquisitionDepth), "Acquire Depth"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Mutex.OsMutex), "OsMutex"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpRegion[7] =
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpRegion[8] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegion), NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Region.SpaceId), "Space Id"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Region.Flags), "Flags"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Region.Node), "Parent Node"},
|
||||
{ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET (Region.Address), "Address"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Region.Length), "Length"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Region.Handler), "Handler"},
|
||||
{ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (Region.Handler), "Handler"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Region.Next), "Next"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpPower[5] =
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpPower[6] =
|
||||
{
|
||||
{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.NotifyList[0]), "System Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.NotifyList[1]), "Device Notify"}
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.NotifyList[1]), "Device Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.Handler), "Handler"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpProcessor[7] =
|
||||
@@ -315,7 +319,7 @@ static ACPI_EXDUMP_INFO AcpiExDumpReference[8] =
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Reference.TargetType), "Target Type"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Reference.Value), "Value"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Object), "Object Desc"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Node), "Node"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Reference.Node), "Node"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Where), "Where"},
|
||||
{ACPI_EXD_REFERENCE,0, NULL}
|
||||
};
|
||||
@@ -324,16 +328,16 @@ static ACPI_EXDUMP_INFO AcpiExDumpAddressHandler[6] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpAddressHandler), NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (AddressSpace.SpaceId), "Space Id"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.Next), "Next"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.RegionList), "Region List"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.Node), "Node"},
|
||||
{ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (AddressSpace.Next), "Next"},
|
||||
{ACPI_EXD_RGN_LIST, ACPI_EXD_OFFSET (AddressSpace.RegionList), "Region List"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (AddressSpace.Node), "Node"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.Context), "Context"}
|
||||
};
|
||||
|
||||
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_NODE, ACPI_EXD_OFFSET (Notify.Node), "Node"},
|
||||
{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"},
|
||||
@@ -341,15 +345,32 @@ static ACPI_EXDUMP_INFO AcpiExDumpNotify[7] =
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Next[1]), "Next Device Notify"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpExtra[6] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpExtra), NULL},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Extra.Method_REG), "_REG Method"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Extra.ScopeNode), "Scope Node"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Extra.RegionContext), "Region Context"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Extra.AmlStart), "Aml Start"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Extra.AmlLength), "Aml Length"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpData[3] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpData), NULL},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Data.Handler), "Handler"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Data.Pointer), "Raw Data"}
|
||||
};
|
||||
|
||||
/* Miscellaneous tables */
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpCommon[4] =
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpCommon[5] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpCommon), NULL},
|
||||
{ACPI_EXD_TYPE , 0, NULL},
|
||||
{ACPI_EXD_UINT16, ACPI_EXD_OFFSET (Common.ReferenceCount), "Reference Count"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Common.Flags), "Flags"}
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Common.Flags), "Flags"},
|
||||
{ACPI_EXD_LIST, ACPI_EXD_OFFSET (Common.NextObject), "Object List"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpFieldCommon[7] =
|
||||
@@ -360,16 +381,18 @@ static ACPI_EXDUMP_INFO AcpiExDumpFieldCommon[7] =
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (CommonField.BitLength), "Bit Length"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (CommonField.StartFieldBitOffset),"Field Bit Offset"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (CommonField.BaseByteOffset), "Base Byte Offset"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (CommonField.Node), "Parent Node"}
|
||||
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (CommonField.Node), "Parent Node"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpNode[5] =
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpNode[7] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpNode), NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET (Flags), "Flags"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET (OwnerId), "Owner Id"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET (Child), "Child List"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET (Peer), "Next Peer"}
|
||||
{ACPI_EXD_LIST, ACPI_EXD_NSOFFSET (Object), "Object List"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Parent), "Parent"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Child), "Child"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Peer), "Peer"}
|
||||
};
|
||||
|
||||
|
||||
@@ -404,7 +427,9 @@ static ACPI_EXDUMP_INFO *AcpiExDumpInfo[] =
|
||||
AcpiExDumpAddressHandler,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
NULL,
|
||||
AcpiExDumpExtra,
|
||||
AcpiExDumpData
|
||||
};
|
||||
|
||||
|
||||
@@ -431,6 +456,10 @@ AcpiExDumpObject (
|
||||
char *Name;
|
||||
const char *ReferenceName;
|
||||
UINT8 Count;
|
||||
ACPI_OPERAND_OBJECT *Start;
|
||||
ACPI_OPERAND_OBJECT *Data = NULL;
|
||||
ACPI_OPERAND_OBJECT *Next;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
|
||||
|
||||
if (!Info)
|
||||
@@ -458,7 +487,8 @@ AcpiExDumpObject (
|
||||
|
||||
case ACPI_EXD_TYPE:
|
||||
|
||||
AcpiExOutString ("Type", AcpiUtGetObjectTypeName (ObjDesc));
|
||||
AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
|
||||
ObjDesc->Common.Type, AcpiUtGetObjectTypeName (ObjDesc));
|
||||
break;
|
||||
|
||||
case ACPI_EXD_UINT8:
|
||||
@@ -519,6 +549,120 @@ AcpiExDumpObject (
|
||||
AcpiExDumpReferenceObj (ObjDesc);
|
||||
break;
|
||||
|
||||
case ACPI_EXD_LIST:
|
||||
|
||||
Start = *ACPI_CAST_PTR (void *, Target);
|
||||
Next = Start;
|
||||
|
||||
AcpiOsPrintf ("%20s : %p", Name, Next);
|
||||
if (Next)
|
||||
{
|
||||
AcpiOsPrintf ("(%s %2.2X)",
|
||||
AcpiUtGetObjectTypeName (Next), Next->Common.Type);
|
||||
|
||||
while (Next->Common.NextObject)
|
||||
{
|
||||
if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) &&
|
||||
!Data)
|
||||
{
|
||||
Data = Next;
|
||||
}
|
||||
|
||||
Next = Next->Common.NextObject;
|
||||
AcpiOsPrintf ("->%p(%s %2.2X)", Next,
|
||||
AcpiUtGetObjectTypeName (Next), Next->Common.Type);
|
||||
|
||||
if ((Next == Start) || (Next == Data))
|
||||
{
|
||||
AcpiOsPrintf ("\n**** Error: Object list appears to be circular linked");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
break;
|
||||
|
||||
case ACPI_EXD_HDLR_LIST:
|
||||
|
||||
Start = *ACPI_CAST_PTR (void *, Target);
|
||||
Next = Start;
|
||||
|
||||
AcpiOsPrintf ("%20s : %p", Name, Next);
|
||||
if (Next)
|
||||
{
|
||||
AcpiOsPrintf ("(%s %2.2X)",
|
||||
AcpiUtGetObjectTypeName (Next), Next->Common.Type);
|
||||
|
||||
while (Next->AddressSpace.Next)
|
||||
{
|
||||
if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) &&
|
||||
!Data)
|
||||
{
|
||||
Data = Next;
|
||||
}
|
||||
|
||||
Next = Next->AddressSpace.Next;
|
||||
AcpiOsPrintf ("->%p(%s %2.2X)", Next,
|
||||
AcpiUtGetObjectTypeName (Next), Next->Common.Type);
|
||||
|
||||
if ((Next == Start) || (Next == Data))
|
||||
{
|
||||
AcpiOsPrintf ("\n**** Error: Handler list appears to be circular linked");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
break;
|
||||
|
||||
case ACPI_EXD_RGN_LIST:
|
||||
|
||||
Start = *ACPI_CAST_PTR (void *, Target);
|
||||
Next = Start;
|
||||
|
||||
AcpiOsPrintf ("%20s : %p", Name, Next);
|
||||
if (Next)
|
||||
{
|
||||
AcpiOsPrintf ("(%s %2.2X)",
|
||||
AcpiUtGetObjectTypeName (Next), Next->Common.Type);
|
||||
|
||||
while (Next->Region.Next)
|
||||
{
|
||||
if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) &&
|
||||
!Data)
|
||||
{
|
||||
Data = Next;
|
||||
}
|
||||
|
||||
Next = Next->Region.Next;
|
||||
AcpiOsPrintf ("->%p(%s %2.2X)", Next,
|
||||
AcpiUtGetObjectTypeName (Next), Next->Common.Type);
|
||||
|
||||
if ((Next == Start) || (Next == Data))
|
||||
{
|
||||
AcpiOsPrintf ("\n**** Error: Region list appears to be circular linked");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
break;
|
||||
|
||||
case ACPI_EXD_NODE:
|
||||
|
||||
Node = *ACPI_CAST_PTR (ACPI_NAMESPACE_NODE *, Target);
|
||||
|
||||
AcpiOsPrintf ("%20s : %p", Name, Node);
|
||||
if (Node)
|
||||
{
|
||||
AcpiOsPrintf (" [%4.4s]", Node->Name.Ascii);
|
||||
}
|
||||
AcpiOsPrintf ("\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",
|
||||
@@ -936,9 +1080,8 @@ AcpiExDumpNamespaceNode (
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%20s : %4.4s\n", "Name", AcpiUtGetNodeName (Node));
|
||||
AcpiExOutString ("Type", AcpiUtGetTypeName (Node->Type));
|
||||
AcpiExOutPointer ("Attached Object", AcpiNsGetAttachedObject (Node));
|
||||
AcpiExOutPointer ("Parent", Node->Parent);
|
||||
AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
|
||||
Node->Type, AcpiUtGetTypeName (Node->Type));
|
||||
|
||||
AcpiExDumpObject (ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Node),
|
||||
AcpiExDumpNode);
|
||||
@@ -1146,24 +1289,30 @@ AcpiExDumpObjectDescriptor (
|
||||
AcpiOsPrintf ("\nAttached Object (%p):\n",
|
||||
((ACPI_NAMESPACE_NODE *) ObjDesc)->Object);
|
||||
|
||||
AcpiExDumpObjectDescriptor (
|
||||
((ACPI_NAMESPACE_NODE *) ObjDesc)->Object, Flags);
|
||||
return_VOID;
|
||||
ObjDesc = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object;
|
||||
goto DumpObject;
|
||||
}
|
||||
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
"ExDumpObjectDescriptor: %p is not an ACPI operand object: [%s]\n",
|
||||
"%p is not an ACPI operand object: [%s]\n",
|
||||
ObjDesc, AcpiUtGetDescriptorName (ObjDesc));
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
if (ObjDesc->Common.Type > ACPI_TYPE_NS_NODE_MAX)
|
||||
/* Validate the object type */
|
||||
|
||||
if (ObjDesc->Common.Type > ACPI_TYPE_LOCAL_MAX)
|
||||
{
|
||||
AcpiOsPrintf ("Not a known object type: %2.2X\n",
|
||||
ObjDesc->Common.Type);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
||||
DumpObject:
|
||||
|
||||
/* Common Fields */
|
||||
|
||||
AcpiExDumpObject (ObjDesc, AcpiExDumpCommon);
|
||||
@@ -1171,6 +1320,22 @@ AcpiExDumpObjectDescriptor (
|
||||
/* Object-specific fields */
|
||||
|
||||
AcpiExDumpObject (ObjDesc, AcpiExDumpInfo[ObjDesc->Common.Type]);
|
||||
|
||||
if (ObjDesc->Common.Type == ACPI_TYPE_REGION)
|
||||
{
|
||||
ObjDesc = ObjDesc->Common.NextObject;
|
||||
if (ObjDesc->Common.Type > ACPI_TYPE_LOCAL_MAX)
|
||||
{
|
||||
AcpiOsPrintf ("Secondary object is not a known object type: %2.2X\n",
|
||||
ObjDesc->Common.Type);
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\nExtra attached Object (%p):\n", ObjDesc);
|
||||
AcpiExDumpObject (ObjDesc, AcpiExDumpInfo[ObjDesc->Common.Type]);
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -120,11 +120,80 @@
|
||||
#include "accommon.h"
|
||||
#include "acdispat.h"
|
||||
#include "acinterp.h"
|
||||
#include "amlcode.h"
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_EXECUTER
|
||||
ACPI_MODULE_NAME ("exfield")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static UINT32
|
||||
AcpiExGetSerialAccessLength (
|
||||
UINT32 AccessorType,
|
||||
UINT32 AccessLength);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExGetSerialAccessLength
|
||||
*
|
||||
* PARAMETERS: AccessorType - The type of the protocol indicated by region
|
||||
* field access attributes
|
||||
* AccessLength - The access length of the region field
|
||||
*
|
||||
* RETURN: Decoded access length
|
||||
*
|
||||
* DESCRIPTION: This routine returns the length of the GenericSerialBus
|
||||
* protocol bytes
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static UINT32
|
||||
AcpiExGetSerialAccessLength (
|
||||
UINT32 AccessorType,
|
||||
UINT32 AccessLength)
|
||||
{
|
||||
UINT32 Length;
|
||||
|
||||
|
||||
switch (AccessorType)
|
||||
{
|
||||
case AML_FIELD_ATTRIB_QUICK:
|
||||
|
||||
Length = 0;
|
||||
break;
|
||||
|
||||
case AML_FIELD_ATTRIB_SEND_RCV:
|
||||
case AML_FIELD_ATTRIB_BYTE:
|
||||
|
||||
Length = 1;
|
||||
break;
|
||||
|
||||
case AML_FIELD_ATTRIB_WORD:
|
||||
case AML_FIELD_ATTRIB_WORD_CALL:
|
||||
|
||||
Length = 2;
|
||||
break;
|
||||
|
||||
case AML_FIELD_ATTRIB_MULTIBYTE:
|
||||
case AML_FIELD_ATTRIB_RAW_BYTES:
|
||||
case AML_FIELD_ATTRIB_RAW_PROCESS:
|
||||
|
||||
Length = AccessLength;
|
||||
break;
|
||||
|
||||
case AML_FIELD_ATTRIB_BLOCK:
|
||||
case AML_FIELD_ATTRIB_BLOCK_CALL:
|
||||
default:
|
||||
|
||||
Length = ACPI_GSBUS_BUFFER_SIZE - 2;
|
||||
break;
|
||||
}
|
||||
|
||||
return (Length);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@@ -152,6 +221,7 @@ AcpiExReadDataFromField (
|
||||
ACPI_SIZE Length;
|
||||
void *Buffer;
|
||||
UINT32 Function;
|
||||
UINT16 AccessorType;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (ExReadDataFromField, ObjDesc);
|
||||
@@ -201,8 +271,19 @@ AcpiExReadDataFromField (
|
||||
}
|
||||
else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
|
||||
{
|
||||
Length = ACPI_GSBUS_BUFFER_SIZE;
|
||||
Function = ACPI_READ | (ObjDesc->Field.Attribute << 16);
|
||||
AccessorType = ObjDesc->Field.Attribute;
|
||||
Length = AcpiExGetSerialAccessLength (AccessorType,
|
||||
ObjDesc->Field.AccessLength);
|
||||
|
||||
/*
|
||||
* Add additional 2 bytes for the GenericSerialBus data buffer:
|
||||
*
|
||||
* Status; (Byte 0 of the data buffer)
|
||||
* Length; (Byte 1 of the data buffer)
|
||||
* Data[x-1]; (Bytes 2-x of the arbitrary length data buffer)
|
||||
*/
|
||||
Length += 2;
|
||||
Function = ACPI_READ | (AccessorType << 16);
|
||||
}
|
||||
else /* IPMI */
|
||||
{
|
||||
@@ -323,6 +404,7 @@ AcpiExWriteDataToField (
|
||||
void *Buffer;
|
||||
ACPI_OPERAND_OBJECT *BufferDesc;
|
||||
UINT32 Function;
|
||||
UINT16 AccessorType;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (ExWriteDataToField, ObjDesc);
|
||||
@@ -382,8 +464,19 @@ AcpiExWriteDataToField (
|
||||
}
|
||||
else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
|
||||
{
|
||||
Length = ACPI_GSBUS_BUFFER_SIZE;
|
||||
Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16);
|
||||
AccessorType = ObjDesc->Field.Attribute;
|
||||
Length = AcpiExGetSerialAccessLength (AccessorType,
|
||||
ObjDesc->Field.AccessLength);
|
||||
|
||||
/*
|
||||
* Add additional 2 bytes for the GenericSerialBus data buffer:
|
||||
*
|
||||
* Status; (Byte 0 of the data buffer)
|
||||
* Length; (Byte 1 of the data buffer)
|
||||
* Data[x-1]; (Bytes 2-x of the arbitrary length data buffer)
|
||||
*/
|
||||
Length += 2;
|
||||
Function = ACPI_WRITE | (AccessorType << 16);
|
||||
}
|
||||
else /* IPMI */
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -206,8 +206,8 @@ AcpiExResolveNodeToValue (
|
||||
|
||||
if (!SourceDesc)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "No object attached to node %p",
|
||||
Node));
|
||||
ACPI_ERROR ((AE_INFO, "No object attached to node [%4.4s] %p",
|
||||
Node->Name.Ascii, Node));
|
||||
return_ACPI_STATUS (AE_AML_NO_OPERAND);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -134,6 +134,12 @@ AcpiExStoreObjectToIndex (
|
||||
ACPI_OPERAND_OBJECT *DestDesc,
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiExStoreDirectToNode (
|
||||
ACPI_OPERAND_OBJECT *SourceDesc,
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@@ -465,7 +471,11 @@ AcpiExStoreObjectToIndex (
|
||||
* When storing into an object the data is converted to the
|
||||
* target object type then stored in the object. This means
|
||||
* that the target object type (for an initialized target) will
|
||||
* not be changed by a store operation.
|
||||
* not be changed by a store operation. A CopyObject can change
|
||||
* the target type, however.
|
||||
*
|
||||
* The ImplicitConversion flag is set to NO/FALSE only when
|
||||
* storing to an ArgX -- as per the rules of the ACPI spec.
|
||||
*
|
||||
* Assumes parameters are already validated.
|
||||
*
|
||||
@@ -492,7 +502,7 @@ AcpiExStoreObjectToNode (
|
||||
TargetType = AcpiNsGetType (Node);
|
||||
TargetDesc = AcpiNsGetAttachedObject (Node);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p(%s) into node %p(%s)\n",
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p (%s) to node %p (%s)\n",
|
||||
SourceDesc, AcpiUtGetObjectTypeName (SourceDesc),
|
||||
Node, AcpiUtGetTypeName (TargetType)));
|
||||
|
||||
@@ -506,49 +516,35 @@ AcpiExStoreObjectToNode (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* If no implicit conversion, drop into the default case below */
|
||||
|
||||
if ((!ImplicitConversion) ||
|
||||
((WalkState->Opcode == AML_COPY_OP) &&
|
||||
(TargetType != ACPI_TYPE_LOCAL_REGION_FIELD) &&
|
||||
(TargetType != ACPI_TYPE_LOCAL_BANK_FIELD) &&
|
||||
(TargetType != ACPI_TYPE_LOCAL_INDEX_FIELD)))
|
||||
{
|
||||
/*
|
||||
* Force execution of default (no implicit conversion). Note:
|
||||
* CopyObject does not perform an implicit conversion, as per the ACPI
|
||||
* spec -- except in case of region/bank/index fields -- because these
|
||||
* objects must retain their original type permanently.
|
||||
*/
|
||||
TargetType = ACPI_TYPE_ANY;
|
||||
}
|
||||
|
||||
/* Do the actual store operation */
|
||||
|
||||
switch (TargetType)
|
||||
{
|
||||
case ACPI_TYPE_BUFFER_FIELD:
|
||||
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
||||
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
||||
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
||||
|
||||
/* For fields, copy the source data to the target field. */
|
||||
|
||||
Status = AcpiExWriteDataToField (SourceDesc, TargetDesc,
|
||||
&WalkState->ResultObj);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_INTEGER:
|
||||
case ACPI_TYPE_STRING:
|
||||
case ACPI_TYPE_BUFFER:
|
||||
/*
|
||||
* These target types are all of type Integer/String/Buffer, and
|
||||
* therefore support implicit conversion before the store.
|
||||
*
|
||||
* Copy and/or convert the source object to a new target object
|
||||
* The simple data types all support implicit source operand
|
||||
* conversion before the store.
|
||||
*/
|
||||
|
||||
if ((WalkState->Opcode == AML_COPY_OP) ||
|
||||
!ImplicitConversion)
|
||||
{
|
||||
/*
|
||||
* However, CopyObject and Stores to ArgX do not perform
|
||||
* an implicit conversion, as per the ACPI specification.
|
||||
* A direct store is performed instead.
|
||||
*/
|
||||
Status = AcpiExStoreDirectToNode (SourceDesc, Node,
|
||||
WalkState);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Store with implicit source operand conversion support */
|
||||
|
||||
Status = AcpiExStoreObjectToObject (SourceDesc, TargetDesc,
|
||||
&NewDesc, WalkState);
|
||||
&NewDesc, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
@@ -561,11 +557,12 @@ AcpiExStoreObjectToNode (
|
||||
* the Name's type to that of the value being stored in it.
|
||||
* SourceDesc reference count is incremented by AttachObject.
|
||||
*
|
||||
* Note: This may change the type of the node if an explicit store
|
||||
* has been performed such that the node/object type has been
|
||||
* changed.
|
||||
* Note: This may change the type of the node if an explicit
|
||||
* store has been performed such that the node/object type
|
||||
* has been changed.
|
||||
*/
|
||||
Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type);
|
||||
Status = AcpiNsAttachObject (Node, NewDesc,
|
||||
NewDesc->Common.Type);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Store %s into %s via Convert/Attach\n",
|
||||
@@ -574,33 +571,86 @@ AcpiExStoreObjectToNode (
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER_FIELD:
|
||||
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
||||
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
||||
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
||||
/*
|
||||
* For all fields, always write the source data to the target
|
||||
* field. Any required implicit source operand conversion is
|
||||
* performed in the function below as necessary. Note, field
|
||||
* objects must retain their original type permanently.
|
||||
*/
|
||||
Status = AcpiExWriteDataToField (SourceDesc, TargetDesc,
|
||||
&WalkState->ResultObj);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Storing [%s] (%p) directly into node [%s] (%p)"
|
||||
" with no implicit conversion\n",
|
||||
AcpiUtGetObjectTypeName (SourceDesc), SourceDesc,
|
||||
AcpiUtGetObjectTypeName (TargetDesc), Node));
|
||||
|
||||
/*
|
||||
* No conversions for all other types. Directly store a copy of
|
||||
* the source object. NOTE: This is a departure from the ACPI
|
||||
* spec, which states "If conversion is impossible, abort the
|
||||
* running control method".
|
||||
* the source object. This is the ACPI spec-defined behavior for
|
||||
* the CopyObject operator.
|
||||
*
|
||||
* This code implements "If conversion is impossible, treat the
|
||||
* Store operation as a CopyObject".
|
||||
* NOTE: For the Store operator, this is a departure from the
|
||||
* ACPI spec, which states "If conversion is impossible, abort
|
||||
* the running control method". Instead, this code implements
|
||||
* "If conversion is impossible, treat the Store operation as
|
||||
* a CopyObject".
|
||||
*/
|
||||
Status = AcpiUtCopyIobjectToIobject (SourceDesc, &NewDesc, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type);
|
||||
AcpiUtRemoveReference (NewDesc);
|
||||
Status = AcpiExStoreDirectToNode (SourceDesc, Node,
|
||||
WalkState);
|
||||
break;
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExStoreDirectToNode
|
||||
*
|
||||
* PARAMETERS: SourceDesc - Value to be stored
|
||||
* Node - Named object to receive the value
|
||||
* WalkState - Current walk state
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: "Store" an object directly to a node. This involves a copy
|
||||
* and an attach.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiExStoreDirectToNode (
|
||||
ACPI_OPERAND_OBJECT *SourceDesc,
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OPERAND_OBJECT *NewDesc;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (ExStoreDirectToNode);
|
||||
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Storing [%s] (%p) directly into node [%s] (%p)"
|
||||
" with no implicit conversion\n",
|
||||
AcpiUtGetObjectTypeName (SourceDesc), SourceDesc,
|
||||
AcpiUtGetTypeName (Node->Type), Node));
|
||||
|
||||
/* Copy the source object to a new object */
|
||||
|
||||
Status = AcpiUtCopyIobjectToIobject (SourceDesc, &NewDesc, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Attach the new object to the node */
|
||||
|
||||
Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type);
|
||||
AcpiUtRemoveReference (NewDesc);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -159,7 +159,7 @@ AcpiExSystemWaitSemaphore (
|
||||
{
|
||||
/* We must wait, so unlock the interpreter */
|
||||
|
||||
AcpiExRelinquishInterpreter ();
|
||||
AcpiExExitInterpreter ();
|
||||
|
||||
Status = AcpiOsWaitSemaphore (Semaphore, 1, Timeout);
|
||||
|
||||
@@ -169,7 +169,7 @@ AcpiExSystemWaitSemaphore (
|
||||
|
||||
/* Reacquire the interpreter */
|
||||
|
||||
AcpiExReacquireInterpreter ();
|
||||
AcpiExEnterInterpreter ();
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
@@ -212,7 +212,7 @@ AcpiExSystemWaitMutex (
|
||||
{
|
||||
/* We must wait, so unlock the interpreter */
|
||||
|
||||
AcpiExRelinquishInterpreter ();
|
||||
AcpiExExitInterpreter ();
|
||||
|
||||
Status = AcpiOsAcquireMutex (Mutex, Timeout);
|
||||
|
||||
@@ -222,7 +222,7 @@ AcpiExSystemWaitMutex (
|
||||
|
||||
/* Reacquire the interpreter */
|
||||
|
||||
AcpiExReacquireInterpreter ();
|
||||
AcpiExEnterInterpreter ();
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
@@ -299,7 +299,7 @@ AcpiExSystemDoSleep (
|
||||
|
||||
/* Since this thread will sleep, we must release the interpreter */
|
||||
|
||||
AcpiExRelinquishInterpreter ();
|
||||
AcpiExExitInterpreter ();
|
||||
|
||||
/*
|
||||
* For compatibility with other ACPI implementations and to prevent
|
||||
@@ -314,7 +314,7 @@ AcpiExSystemDoSleep (
|
||||
|
||||
/* And now we must get the interpreter again */
|
||||
|
||||
AcpiExReacquireInterpreter ();
|
||||
AcpiExEnterInterpreter ();
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -182,42 +182,6 @@ AcpiExEnterInterpreter (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExReacquireInterpreter
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Reacquire the interpreter execution region from within the
|
||||
* interpreter code. Failure to enter the interpreter region is a
|
||||
* fatal system error. Used in conjunction with
|
||||
* RelinquishInterpreter
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExReacquireInterpreter (
|
||||
void)
|
||||
{
|
||||
ACPI_FUNCTION_TRACE (ExReacquireInterpreter);
|
||||
|
||||
|
||||
/*
|
||||
* If the global serialized flag is set, do not release the interpreter,
|
||||
* since it was not actually released by AcpiExRelinquishInterpreter.
|
||||
* This forces the interpreter to be single threaded.
|
||||
*/
|
||||
if (!AcpiGbl_AllMethodsSerialized)
|
||||
{
|
||||
AcpiExEnterInterpreter ();
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExExitInterpreter
|
||||
@@ -228,7 +192,16 @@ AcpiExReacquireInterpreter (
|
||||
*
|
||||
* DESCRIPTION: Exit the interpreter execution region. This is the top level
|
||||
* routine used to exit the interpreter when all processing has
|
||||
* been completed.
|
||||
* been completed, or when the method blocks.
|
||||
*
|
||||
* Cases where the interpreter is unlocked internally:
|
||||
* 1) Method will be blocked on a Sleep() AML opcode
|
||||
* 2) Method will be blocked on an Acquire() AML opcode
|
||||
* 3) Method will be blocked on a Wait() AML opcode
|
||||
* 4) Method will be blocked to acquire the global lock
|
||||
* 5) Method will be blocked waiting to execute a serialized control
|
||||
* method that is currently executing
|
||||
* 6) About to invoke a user-installed opregion handler
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@@ -252,49 +225,6 @@ AcpiExExitInterpreter (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExRelinquishInterpreter
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Exit the interpreter execution region, from within the
|
||||
* interpreter - before attempting an operation that will possibly
|
||||
* block the running thread.
|
||||
*
|
||||
* Cases where the interpreter is unlocked internally
|
||||
* 1) Method to be blocked on a Sleep() AML opcode
|
||||
* 2) Method to be blocked on an Acquire() AML opcode
|
||||
* 3) Method to be blocked on a Wait() AML opcode
|
||||
* 4) Method to be blocked to acquire the global lock
|
||||
* 5) Method to be blocked waiting to execute a serialized control method
|
||||
* that is currently executing
|
||||
* 6) About to invoke a user-installed opregion handler
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExRelinquishInterpreter (
|
||||
void)
|
||||
{
|
||||
ACPI_FUNCTION_TRACE (ExRelinquishInterpreter);
|
||||
|
||||
|
||||
/*
|
||||
* If the global serialized flag is set, do not release the interpreter.
|
||||
* This forces the interpreter to be single threaded.
|
||||
*/
|
||||
if (!AcpiGbl_AllMethodsSerialized)
|
||||
{
|
||||
AcpiExExitInterpreter ();
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExTruncateFor32bitTable
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -233,11 +233,12 @@ AcpiHwDerivePciId (
|
||||
/* Walk the list, updating the PCI device/function/bus numbers */
|
||||
|
||||
Status = AcpiHwProcessPciList (PciId, ListHead);
|
||||
|
||||
/* Delete the list */
|
||||
|
||||
AcpiHwDeletePciList (ListHead);
|
||||
}
|
||||
|
||||
/* Always delete the list */
|
||||
|
||||
AcpiHwDeletePciList (ListHead);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@@ -285,6 +286,9 @@ AcpiHwBuildPciList (
|
||||
Status = AcpiGetParent (CurrentDevice, &ParentDevice);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
/* Must delete the list before exit */
|
||||
|
||||
AcpiHwDeletePciList (*ReturnListHead);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
@@ -299,6 +303,9 @@ AcpiHwBuildPciList (
|
||||
ListElement = ACPI_ALLOCATE (sizeof (ACPI_PCI_DEVICE));
|
||||
if (!ListElement)
|
||||
{
|
||||
/* Must delete the list before exit */
|
||||
|
||||
AcpiHwDeletePciList (*ReturnListHead);
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -382,17 +382,19 @@ AcpiHwClearAcpiStatus (
|
||||
|
||||
Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_STATUS,
|
||||
ACPI_BITMASK_ALL_FIXED_STATUS);
|
||||
|
||||
AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags);
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto UnlockAndExit;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
/* Clear the GPE Bits in all GPE registers in all GPE blocks */
|
||||
|
||||
Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock, NULL);
|
||||
|
||||
UnlockAndExit:
|
||||
AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags);
|
||||
Exit:
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -113,6 +113,8 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define EXPORT_ACPI_INTERFACES
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -113,6 +113,8 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define EXPORT_ACPI_INTERFACES
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acnamesp.h"
|
||||
@@ -162,9 +164,15 @@ AcpiReset (
|
||||
* For I/O space, write directly to the OSL. This bypasses the port
|
||||
* validation mechanism, which may block a valid write to the reset
|
||||
* register.
|
||||
*
|
||||
* NOTE:
|
||||
* The ACPI spec requires the reset register width to be 8, so we
|
||||
* hardcode it here and ignore the FADT value. This maintains
|
||||
* compatibility with other ACPI implementations that have allowed
|
||||
* BIOS code with bad register width values to go unnoticed.
|
||||
*/
|
||||
Status = AcpiOsWritePort ((ACPI_IO_ADDRESS) ResetReg->Address,
|
||||
AcpiGbl_FADT.ResetValue, ResetReg->BitWidth);
|
||||
AcpiGbl_FADT.ResetValue, ACPI_RESET_REGISTER_WIDTH);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -113,6 +113,8 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define EXPORT_ACPI_INTERFACES
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -193,6 +193,7 @@ AcpiNsDeleteNode (
|
||||
ACPI_NAMESPACE_NODE *Node)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_OPERAND_OBJECT *NextDesc;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (NsDeleteNode);
|
||||
@@ -203,12 +204,13 @@ AcpiNsDeleteNode (
|
||||
AcpiNsDetachObject (Node);
|
||||
|
||||
/*
|
||||
* Delete an attached data object if present (an object that was created
|
||||
* and attached via AcpiAttachData). Note: After any normal object is
|
||||
* detached above, the only possible remaining object is a data object.
|
||||
* Delete an attached data object list if present (objects that were
|
||||
* attached via AcpiAttachData). Note: After any normal object is
|
||||
* detached above, the only possible remaining object(s) are data
|
||||
* objects, in a linked list.
|
||||
*/
|
||||
ObjDesc = Node->Object;
|
||||
if (ObjDesc &&
|
||||
while (ObjDesc &&
|
||||
(ObjDesc->Common.Type == ACPI_TYPE_LOCAL_DATA))
|
||||
{
|
||||
/* Invoke the attached data deletion handler if present */
|
||||
@@ -218,7 +220,16 @@ AcpiNsDeleteNode (
|
||||
ObjDesc->Data.Handler (Node, ObjDesc->Data.Pointer);
|
||||
}
|
||||
|
||||
NextDesc = ObjDesc->Common.NextObject;
|
||||
AcpiUtRemoveReference (ObjDesc);
|
||||
ObjDesc = NextDesc;
|
||||
}
|
||||
|
||||
/* Special case for the statically allocated root node */
|
||||
|
||||
if (Node == AcpiGbl_RootNode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Now we can delete the node */
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -821,6 +821,13 @@ AcpiNsDumpOneObjectPath (
|
||||
}
|
||||
|
||||
Node = AcpiNsValidateHandle (ObjHandle);
|
||||
if (!Node)
|
||||
{
|
||||
/* Ignore bad node during namespace walk */
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
Pathname = AcpiNsGetExternalPathname (Node);
|
||||
|
||||
PathIndent = 1;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -201,9 +201,8 @@ AcpiNsInitializeObjects (
|
||||
Info.PackageInit, Info.PackageCount, Info.ObjectCount));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"%u Control Methods found\n", Info.MethodCount));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"%u Op Regions found\n", Info.OpRegionCount));
|
||||
"%u Control Methods found\n%u Op Regions found\n",
|
||||
Info.MethodCount, Info.OpRegionCount));
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -220,12 +220,12 @@ Unlock:
|
||||
* parse trees.
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"**** Begin Table Method Parsing and Object Initialization\n"));
|
||||
"**** Begin Table Object Initialization\n"));
|
||||
|
||||
Status = AcpiDsInitializeObjects (TableIndex, Node);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"**** Completed Table Method Parsing and Object Initialization\n"));
|
||||
"**** Completed Table Object Initialization\n"));
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -319,17 +319,32 @@ AcpiNsDetachObject (
|
||||
}
|
||||
}
|
||||
|
||||
/* Clear the entry in all cases */
|
||||
/* Clear the Node entry in all cases */
|
||||
|
||||
Node->Object = NULL;
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_OPERAND)
|
||||
{
|
||||
/* Unlink object from front of possible object list */
|
||||
|
||||
Node->Object = ObjDesc->Common.NextObject;
|
||||
|
||||
/* Handle possible 2-descriptor object */
|
||||
|
||||
if (Node->Object &&
|
||||
((Node->Object)->Common.Type != ACPI_TYPE_LOCAL_DATA))
|
||||
(Node->Object->Common.Type != ACPI_TYPE_LOCAL_DATA))
|
||||
{
|
||||
Node->Object = Node->Object->Common.NextObject;
|
||||
}
|
||||
|
||||
/*
|
||||
* Detach the object from any data objects (which are still held by
|
||||
* the namespace node)
|
||||
*/
|
||||
if (ObjDesc->Common.NextObject &&
|
||||
((ObjDesc->Common.NextObject)->Common.Type == ACPI_TYPE_LOCAL_DATA))
|
||||
{
|
||||
ObjDesc->Common.NextObject = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Reset the node type to untyped */
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -216,13 +216,13 @@ AcpiNsCheckPackage (
|
||||
* Decode the type of the expected package contents
|
||||
*
|
||||
* PTYPE1 packages contain no subpackages
|
||||
* PTYPE2 packages contain sub-packages
|
||||
* PTYPE2 packages contain subpackages
|
||||
*/
|
||||
switch (Package->RetInfo.Type)
|
||||
{
|
||||
case ACPI_PTYPE1_FIXED:
|
||||
/*
|
||||
* The package count is fixed and there are no sub-packages
|
||||
* The package count is fixed and there are no subpackages
|
||||
*
|
||||
* If package is too small, exit.
|
||||
* If package is larger than expected, issue warning but continue
|
||||
@@ -249,7 +249,7 @@ AcpiNsCheckPackage (
|
||||
|
||||
case ACPI_PTYPE1_VAR:
|
||||
/*
|
||||
* The package count is variable, there are no sub-packages, and all
|
||||
* The package count is variable, there are no subpackages, and all
|
||||
* elements must be of the same type
|
||||
*/
|
||||
for (i = 0; i < Count; i++)
|
||||
@@ -266,7 +266,7 @@ AcpiNsCheckPackage (
|
||||
|
||||
case ACPI_PTYPE1_OPTION:
|
||||
/*
|
||||
* The package count is variable, there are no sub-packages. There are
|
||||
* The package count is variable, there are no subpackages. There are
|
||||
* a fixed number of required elements, and a variable number of
|
||||
* optional elements.
|
||||
*
|
||||
@@ -322,14 +322,14 @@ AcpiNsCheckPackage (
|
||||
Elements++;
|
||||
Count--;
|
||||
|
||||
/* Examine the sub-packages */
|
||||
/* Examine the subpackages */
|
||||
|
||||
Status = AcpiNsCheckPackageList (Info, Package, Elements, Count);
|
||||
break;
|
||||
|
||||
case ACPI_PTYPE2_PKG_COUNT:
|
||||
|
||||
/* First element is the (Integer) count of sub-packages to follow */
|
||||
/* First element is the (Integer) count of subpackages to follow */
|
||||
|
||||
Status = AcpiNsCheckObjectType (Info, Elements,
|
||||
ACPI_RTYPE_INTEGER, 0);
|
||||
@@ -351,7 +351,7 @@ AcpiNsCheckPackage (
|
||||
Count = ExpectedCount;
|
||||
Elements++;
|
||||
|
||||
/* Examine the sub-packages */
|
||||
/* Examine the subpackages */
|
||||
|
||||
Status = AcpiNsCheckPackageList (Info, Package, Elements, Count);
|
||||
break;
|
||||
@@ -363,9 +363,9 @@ AcpiNsCheckPackage (
|
||||
case ACPI_PTYPE2_FIX_VAR:
|
||||
/*
|
||||
* These types all return a single Package that consists of a
|
||||
* variable number of sub-Packages.
|
||||
* variable number of subpackages.
|
||||
*
|
||||
* First, ensure that the first element is a sub-Package. If not,
|
||||
* First, ensure that the first element is a subpackage. If not,
|
||||
* the BIOS may have incorrectly returned the object as a single
|
||||
* package instead of a Package of Packages (a common error if
|
||||
* there is only one entry). We may be able to repair this by
|
||||
@@ -388,7 +388,7 @@ AcpiNsCheckPackage (
|
||||
Count = 1;
|
||||
}
|
||||
|
||||
/* Examine the sub-packages */
|
||||
/* Examine the subpackages */
|
||||
|
||||
Status = AcpiNsCheckPackageList (Info, Package, Elements, Count);
|
||||
break;
|
||||
@@ -451,9 +451,9 @@ AcpiNsCheckPackageList (
|
||||
|
||||
|
||||
/*
|
||||
* Validate each sub-Package in the parent Package
|
||||
* Validate each subpackage in the parent Package
|
||||
*
|
||||
* NOTE: assumes list of sub-packages contains no NULL elements.
|
||||
* NOTE: assumes list of subpackages contains no NULL elements.
|
||||
* Any NULL elements should have been removed by earlier call
|
||||
* to AcpiNsRemoveNullElements.
|
||||
*/
|
||||
@@ -472,7 +472,7 @@ AcpiNsCheckPackageList (
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* Examine the different types of expected sub-packages */
|
||||
/* Examine the different types of expected subpackages */
|
||||
|
||||
Info->ParentPackage = SubPackage;
|
||||
switch (Package->RetInfo.Type)
|
||||
@@ -524,7 +524,7 @@ AcpiNsCheckPackageList (
|
||||
|
||||
case ACPI_PTYPE2_FIXED:
|
||||
|
||||
/* Each sub-package has a fixed length */
|
||||
/* Each subpackage has a fixed length */
|
||||
|
||||
ExpectedCount = Package->RetInfo2.Count;
|
||||
if (SubPackage->Package.Count < ExpectedCount)
|
||||
@@ -532,7 +532,7 @@ AcpiNsCheckPackageList (
|
||||
goto PackageTooSmall;
|
||||
}
|
||||
|
||||
/* Check the type of each sub-package element */
|
||||
/* Check the type of each subpackage element */
|
||||
|
||||
for (j = 0; j < ExpectedCount; j++)
|
||||
{
|
||||
@@ -547,7 +547,7 @@ AcpiNsCheckPackageList (
|
||||
|
||||
case ACPI_PTYPE2_MIN:
|
||||
|
||||
/* Each sub-package has a variable but minimum length */
|
||||
/* Each subpackage has a variable but minimum length */
|
||||
|
||||
ExpectedCount = Package->RetInfo.Count1;
|
||||
if (SubPackage->Package.Count < ExpectedCount)
|
||||
@@ -555,7 +555,7 @@ AcpiNsCheckPackageList (
|
||||
goto PackageTooSmall;
|
||||
}
|
||||
|
||||
/* Check the type of each sub-package element */
|
||||
/* Check the type of each subpackage element */
|
||||
|
||||
Status = AcpiNsCheckPackageElements (Info, SubElements,
|
||||
Package->RetInfo.ObjectType1,
|
||||
@@ -604,7 +604,7 @@ AcpiNsCheckPackageList (
|
||||
(*SubElements)->Integer.Value = ExpectedCount;
|
||||
}
|
||||
|
||||
/* Check the type of each sub-package element */
|
||||
/* Check the type of each subpackage element */
|
||||
|
||||
Status = AcpiNsCheckPackageElements (Info, (SubElements + 1),
|
||||
Package->RetInfo.ObjectType1,
|
||||
@@ -628,10 +628,10 @@ AcpiNsCheckPackageList (
|
||||
|
||||
PackageTooSmall:
|
||||
|
||||
/* The sub-package count was smaller than required */
|
||||
/* The subpackage count was smaller than required */
|
||||
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
|
||||
"Return Sub-Package[%u] is too small - found %u elements, expected %u",
|
||||
"Return SubPackage[%u] is too small - found %u elements, expected %u",
|
||||
i, SubPackage->Package.Count, ExpectedCount));
|
||||
|
||||
return (AE_AML_OPERAND_VALUE);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -284,14 +284,29 @@ AcpiNsSimpleRepair (
|
||||
* this predefined name. Either one return value is expected, or none,
|
||||
* for both methods and other objects.
|
||||
*
|
||||
* Exit now if there is no return object. Warning if one was expected.
|
||||
* Try to fix if there was no return object. Warning if failed to fix.
|
||||
*/
|
||||
if (!ReturnObject)
|
||||
{
|
||||
if (ExpectedBtypes && (!(ExpectedBtypes & ACPI_RTYPE_NONE)))
|
||||
{
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname,
|
||||
ACPI_WARN_ALWAYS, "Missing expected return value"));
|
||||
if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT)
|
||||
{
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname,
|
||||
ACPI_WARN_ALWAYS, "Found unexpected NULL package element"));
|
||||
|
||||
Status = AcpiNsRepairNullElement (Info, ExpectedBtypes,
|
||||
PackageIndex, ReturnObjectPtr);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
return (AE_OK); /* Repair was successful */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname,
|
||||
ACPI_WARN_ALWAYS, "Missing expected return value"));
|
||||
}
|
||||
|
||||
return (AE_AML_NO_RETURN_VALUE);
|
||||
}
|
||||
@@ -546,7 +561,7 @@ AcpiNsRepairNullElement (
|
||||
* RETURN: None.
|
||||
*
|
||||
* DESCRIPTION: Remove all NULL package elements from packages that contain
|
||||
* a variable number of sub-packages. For these types of
|
||||
* a variable number of subpackages. For these types of
|
||||
* packages, NULL elements can be safely removed.
|
||||
*
|
||||
*****************************************************************************/
|
||||
@@ -570,7 +585,7 @@ AcpiNsRemoveNullElements (
|
||||
/*
|
||||
* We can safely remove all NULL elements from these package types:
|
||||
* PTYPE1_VAR packages contain a variable number of simple data types.
|
||||
* PTYPE2 packages contain a variable number of sub-packages.
|
||||
* PTYPE2 packages contain a variable number of subpackages.
|
||||
*/
|
||||
switch (PackageType)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -550,8 +550,8 @@ AcpiNsRepair_CID (
|
||||
* DESCRIPTION: Repair for the _CST object:
|
||||
* 1. Sort the list ascending by C state type
|
||||
* 2. Ensure type cannot be zero
|
||||
* 3. A sub-package count of zero means _CST is meaningless
|
||||
* 4. Count must match the number of C state sub-packages
|
||||
* 3. A subpackage count of zero means _CST is meaningless
|
||||
* 4. Count must match the number of C state subpackages
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@@ -744,6 +744,7 @@ AcpiNsRepair_PRT (
|
||||
ACPI_OPERAND_OBJECT **TopObjectList;
|
||||
ACPI_OPERAND_OBJECT **SubObjectList;
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_OPERAND_OBJECT *SubPackage;
|
||||
UINT32 ElementCount;
|
||||
UINT32 Index;
|
||||
|
||||
@@ -753,9 +754,19 @@ AcpiNsRepair_PRT (
|
||||
TopObjectList = PackageObject->Package.Elements;
|
||||
ElementCount = PackageObject->Package.Count;
|
||||
|
||||
for (Index = 0; Index < ElementCount; Index++)
|
||||
/* Examine each subpackage */
|
||||
|
||||
for (Index = 0; Index < ElementCount; Index++, TopObjectList++)
|
||||
{
|
||||
SubObjectList = (*TopObjectList)->Package.Elements;
|
||||
SubPackage = *TopObjectList;
|
||||
SubObjectList = SubPackage->Package.Elements;
|
||||
|
||||
/* Check for minimum required element count */
|
||||
|
||||
if (SubPackage->Package.Count < 4)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the BIOS has erroneously reversed the _PRT SourceName (index 2)
|
||||
@@ -770,14 +781,11 @@ AcpiNsRepair_PRT (
|
||||
SubObjectList[2] = ObjDesc;
|
||||
Info->ReturnFlags |= ACPI_OBJECT_REPAIRED;
|
||||
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO,
|
||||
Info->FullPathname, Info->NodeFlags,
|
||||
"PRT[%X]: Fixed reversed SourceName and SourceIndex",
|
||||
Index));
|
||||
}
|
||||
|
||||
/* Point to the next ACPI_OPERAND_OBJECT in the top level package */
|
||||
|
||||
TopObjectList++;
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
@@ -817,7 +825,7 @@ AcpiNsRepair_PSS (
|
||||
|
||||
|
||||
/*
|
||||
* Entries (sub-packages) in the _PSS Package must be sorted by power
|
||||
* Entries (subpackages) in the _PSS Package must be sorted by power
|
||||
* dissipation, in descending order. If it appears that the list is
|
||||
* incorrectly sorted, sort it. We sort by CpuFrequency, since this
|
||||
* should be proportional to the power.
|
||||
@@ -910,9 +918,9 @@ AcpiNsRepair_TSS (
|
||||
*
|
||||
* PARAMETERS: Info - Method execution information block
|
||||
* ReturnObject - Pointer to the top-level returned object
|
||||
* StartIndex - Index of the first sub-package
|
||||
* ExpectedCount - Minimum length of each sub-package
|
||||
* SortIndex - Sub-package entry to sort on
|
||||
* StartIndex - Index of the first subpackage
|
||||
* ExpectedCount - Minimum length of each subpackage
|
||||
* SortIndex - Subpackage entry to sort on
|
||||
* SortDirection - Ascending or descending
|
||||
* SortKeyName - Name of the SortIndex field
|
||||
*
|
||||
@@ -953,7 +961,7 @@ AcpiNsCheckSortedList (
|
||||
}
|
||||
|
||||
/*
|
||||
* NOTE: assumes list of sub-packages contains no NULL elements.
|
||||
* NOTE: assumes list of subpackages contains no NULL elements.
|
||||
* Any NULL elements should have been removed by earlier call
|
||||
* to AcpiNsRemoveNullElements.
|
||||
*/
|
||||
@@ -983,7 +991,7 @@ AcpiNsCheckSortedList (
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
/* Each sub-package must have the minimum length */
|
||||
/* Each subpackage must have the minimum length */
|
||||
|
||||
if ((*OuterElements)->Package.Count < ExpectedCount)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -765,27 +765,29 @@ void
|
||||
AcpiNsTerminate (
|
||||
void)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (NsTerminate);
|
||||
|
||||
|
||||
/*
|
||||
* 1) Free the entire namespace -- all nodes and objects
|
||||
*
|
||||
* Delete all object descriptors attached to namepsace nodes
|
||||
* Free the entire namespace -- all nodes and all objects
|
||||
* attached to the nodes
|
||||
*/
|
||||
AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode);
|
||||
|
||||
/* Detach any objects attached to the root */
|
||||
/* Delete any objects attached to the root node */
|
||||
|
||||
ObjDesc = AcpiNsGetAttachedObject (AcpiGbl_RootNode);
|
||||
if (ObjDesc)
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiNsDetachObject (AcpiGbl_RootNode);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
AcpiNsDeleteNode (AcpiGbl_RootNode);
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Namespace freed\n"));
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -116,6 +116,7 @@
|
||||
|
||||
|
||||
#define __NSXFEVAL_C__
|
||||
#define EXPORT_ACPI_INTERFACES
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -163,7 +164,7 @@ AcpiEvaluateObjectTyped (
|
||||
ACPI_OBJECT_TYPE ReturnType)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
BOOLEAN MustFree = FALSE;
|
||||
BOOLEAN FreeBufferOnError = FALSE;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiEvaluateObjectTyped);
|
||||
@@ -178,12 +179,13 @@ AcpiEvaluateObjectTyped (
|
||||
|
||||
if (ReturnBuffer->Length == ACPI_ALLOCATE_BUFFER)
|
||||
{
|
||||
MustFree = TRUE;
|
||||
FreeBufferOnError = TRUE;
|
||||
}
|
||||
|
||||
/* Evaluate the object */
|
||||
|
||||
Status = AcpiEvaluateObject (Handle, Pathname, ExternalParams, ReturnBuffer);
|
||||
Status = AcpiEvaluateObject (Handle, Pathname,
|
||||
ExternalParams, ReturnBuffer);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
@@ -218,10 +220,15 @@ AcpiEvaluateObjectTyped (
|
||||
AcpiUtGetTypeName (((ACPI_OBJECT *) ReturnBuffer->Pointer)->Type),
|
||||
AcpiUtGetTypeName (ReturnType)));
|
||||
|
||||
if (MustFree)
|
||||
if (FreeBufferOnError)
|
||||
{
|
||||
/* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */
|
||||
|
||||
/*
|
||||
* Free a buffer created via ACPI_ALLOCATE_BUFFER.
|
||||
* Note: We use AcpiOsFree here because AcpiOsAllocate was used
|
||||
* to allocate the buffer. This purposefully bypasses the
|
||||
* (optionally enabled) allocation tracking mechanism since we
|
||||
* only want to track internal allocations.
|
||||
*/
|
||||
AcpiOsFree (ReturnBuffer->Pointer);
|
||||
ReturnBuffer->Pointer = NULL;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2013, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@@ -115,6 +115,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#define __NSXFNAME_C__
|
||||
#define EXPORT_ACPI_INTERFACES
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user