MFC r272444 (by jkim):

Merge ACPICA 20140926.

MFC r278970 (by jkim):

  Merge ACPICA 20141107 and 20150204.

Approved by:	jkim
Relnotes:	yes
This commit is contained in:
dim 2015-04-04 10:17:51 +00:00
parent a66c389283
commit 441da571d4
325 changed files with 22589 additions and 7733 deletions

View File

@ -255,6 +255,8 @@ contrib/altq/altq/altq_red.c optional altq
contrib/altq/altq/altq_rio.c optional altq
contrib/altq/altq/altq_rmclass.c optional altq
contrib/altq/altq/altq_subr.c optional altq
contrib/dev/acpica/common/ahids.c optional acpi acpi_debug
contrib/dev/acpica/common/ahuuids.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbcmds.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbconvert.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbdisply.c optional acpi acpi_debug
@ -265,9 +267,11 @@ contrib/dev/acpica/components/debugger/dbinput.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbmethod.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbnames.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbstats.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbtest.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbutils.c optional acpi acpi_debug
contrib/dev/acpica/components/debugger/dbxface.c optional acpi acpi_debug
contrib/dev/acpica/components/disassembler/dmbuffer.c optional acpi acpi_debug
contrib/dev/acpica/components/disassembler/dmcstyle.c optional acpi acpi_debug
contrib/dev/acpica/components/disassembler/dmdeferred.c optional acpi acpi_debug
contrib/dev/acpica/components/disassembler/dmnames.c optional acpi acpi_debug
contrib/dev/acpica/components/disassembler/dmopcode.c optional acpi acpi_debug
@ -387,6 +391,7 @@ contrib/dev/acpica/components/resources/rsmisc.c optional acpi
contrib/dev/acpica/components/resources/rsserial.c optional acpi
contrib/dev/acpica/components/resources/rsutils.c optional acpi
contrib/dev/acpica/components/resources/rsxface.c optional acpi
contrib/dev/acpica/components/tables/tbdata.c optional acpi
contrib/dev/acpica/components/tables/tbfadt.c optional acpi
contrib/dev/acpica/components/tables/tbfind.c optional acpi
contrib/dev/acpica/components/tables/tbinstal.c optional acpi
@ -407,6 +412,7 @@ contrib/dev/acpica/components/utilities/uterror.c optional acpi
contrib/dev/acpica/components/utilities/uteval.c optional acpi
contrib/dev/acpica/components/utilities/utexcep.c optional acpi
contrib/dev/acpica/components/utilities/utglobal.c optional acpi
contrib/dev/acpica/components/utilities/uthex.c optional acpi
contrib/dev/acpica/components/utilities/utids.c optional acpi
contrib/dev/acpica/components/utilities/utinit.c optional acpi
contrib/dev/acpica/components/utilities/utlock.c optional acpi
@ -420,6 +426,7 @@ contrib/dev/acpica/components/utilities/utpredef.c optional acpi
contrib/dev/acpica/components/utilities/utresrc.c optional acpi
contrib/dev/acpica/components/utilities/utstate.c optional acpi
contrib/dev/acpica/components/utilities/utstring.c optional acpi
contrib/dev/acpica/components/utilities/utuuid.c optional acpi acpi_debug
contrib/dev/acpica/components/utilities/utxface.c optional acpi
contrib/dev/acpica/components/utilities/utxferror.c optional acpi
contrib/dev/acpica/components/utilities/utxfinit.c optional acpi

View File

@ -19,9 +19,10 @@ fulldirs="common compiler components include os_specific"
# files to remove
stripdirs="generate libraries tests tools"
stripfiles="Makefile README accygwin.h acefi.h achaiku.h acintel.h \
aclinux.h acmacosx.h acmsvc.h acnetbsd.h acos2.h acwin.h \
acwin64.h new_table.txt osfreebsdtbl.c oslinuxtbl.c osunixdir.c \
osunixmap.c oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c"
aclinux.h aclinuxex.h acmacosx.h acmsvc.h acnetbsd.h acos2.h \
acwin.h acwin64.h new_table.txt osefitbl.c osefixf.c \
osfreebsdtbl.c oslinuxtbl.c osunixdir.c osunixmap.c oswindir.c \
oswintbl.c oswinxf.c readme.txt utclib.c"
# include files to canonify
src_headers="acapps.h acbuffer.h accommon.h acconfig.h acdebug.h \
@ -30,8 +31,8 @@ src_headers="acapps.h acbuffer.h accommon.h acconfig.h acdebug.h \
acopcode.h acoutput.h acparser.h acpi.h acpiosxf.h acpixf.h \
acpredef.h acresrc.h acrestyp.h acstruct.h actables.h actbl.h \
actbl1.h actbl2.h actbl3.h actypes.h acutils.h amlcode.h \
amlresrc.h platform/acenv.h platform/acfreebsd.h \
platform/acgcc.h"
amlresrc.h platform/acenv.h platform/acenvex.h \
platform/acfreebsd.h platform/acgcc.h"
comp_headers="aslcompiler.h asldefine.h aslglobal.h aslmessages.h \
aslsupport.l asltypes.h dtcompiler.h dttemplate.h preprocess.h"
platform_headers="acfreebsd.h acgcc.h"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,440 @@
/******************************************************************************
*
* Module Name: acgetline - local line editing
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/amlcode.h>
#include <contrib/dev/acpica/include/acparser.h>
#include <contrib/dev/acpica/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;
}
}
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acapps.h>
@ -199,20 +199,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)
NewFilename = UtStringCacheCalloc ((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 */
@ -247,7 +255,7 @@ FlStrdup (
char *NewString;
NewString = ACPI_ALLOCATE ((ACPI_SIZE) strlen (String) + 1);
NewString = UtStringCacheCalloc ((ACPI_SIZE) strlen (String) + 1);
if (!NewString)
{
return (NULL);
@ -288,7 +296,6 @@ FlSplitInputPathname (
*OutDirectoryPath = NULL;
*OutFilename = NULL;
if (!InputPath)
{
@ -334,6 +341,12 @@ FlSplitInputPathname (
}
*OutDirectoryPath = DirectoryPath;
*OutFilename = Filename;
if (OutFilename)
{
*OutFilename = Filename;
return (AE_OK);
}
return (AE_OK);
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,12 +41,9 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/include/acparser.h>
#include <contrib/dev/acpica/include/amlcode.h>
#include <contrib/dev/acpica/include/acdebug.h>
#include <contrib/dev/acpica/include/acdisasm.h>
#include <contrib/dev/acpica/include/acdispat.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@ -60,29 +57,8 @@
#define _COMPONENT ACPI_TOOLS
ACPI_MODULE_NAME ("adisasm")
/*
* Older versions of Bison won't emit this external in the generated header.
* Newer versions do emit the external, so we don't need to do it.
*/
#ifndef ASLCOMPILER_ASLCOMPILERPARSE_H
extern int AslCompilerdebug;
#endif
ACPI_STATUS
NsDisplayNamespace (
void);
void
NsSetupNamespaceListing (
void *Handle);
/* Local prototypes */
static UINT32
AdGetFileSize (
FILE *File);
static void
AdCreateTableHeader (
char *Filename,
@ -152,39 +128,7 @@ AcpiDsMethodDataInitArgs (
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);
}
ACPI_PARSE_OBJECT *AcpiGbl_ParseOpRoot;
/*******************************************************************************
@ -206,7 +150,7 @@ AdInitialize (
ACPI_STATUS Status;
/* ACPI CA subsystem initialization */
/* ACPICA subsystem initialization */
Status = AcpiOsInitialize ();
if (ACPI_FAILURE (Status))
@ -250,7 +194,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
*
@ -263,8 +206,7 @@ AdAmlDisassemble (
BOOLEAN OutToFile,
char *Filename,
char *Prefix,
char **OutFilename,
BOOLEAN GetAllTables)
char **OutFilename)
{
ACPI_STATUS Status;
char *DisasmFilename = NULL;
@ -348,7 +290,7 @@ AdAmlDisassemble (
}
else
{
Status = AdGetLocalTables (Filename, GetAllTables);
Status = AdGetLocalTables ();
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not get ACPI tables, %s\n",
@ -383,7 +325,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;
@ -395,6 +337,7 @@ AdAmlDisassemble (
{
fprintf (stderr, "Could not open output file %s\n", DisasmFilename);
Status = AE_ERROR;
ACPI_FREE (DisasmFilename);
goto Cleanup;
}
@ -414,8 +357,12 @@ AdAmlDisassemble (
AcpiDmDumpDataTable (Table);
fprintf (stderr, "Acpi Data Table [%4.4s] decoded\n",
Table->Signature);
fprintf (stderr, "Formatted output: %s - %u bytes\n",
DisasmFilename, AdGetFileSize (File));
if (File)
{
fprintf (stderr, "Formatted output: %s - %u bytes\n",
DisasmFilename, CmGetFileSize (File));
}
}
else
{
@ -433,8 +380,11 @@ AdAmlDisassemble (
{
AcpiOsPrintf ("/**** Before second load\n");
NsSetupNamespaceListing (File);
NsDisplayNamespace ();
if (File)
{
NsSetupNamespaceListing (File);
NsDisplayNamespace ();
}
AcpiOsPrintf ("*****/\n");
}
@ -471,9 +421,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;
@ -487,6 +438,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 */
@ -499,11 +453,22 @@ 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");
NsSetupNamespaceListing (File);
NsDisplayNamespace ();
if (File)
{
NsSetupNamespaceListing (File);
NsDisplayNamespace ();
}
AcpiOsPrintf ("*****/\n");
AcpiDmDumpTree (AcpiGbl_ParseOpRoot);
@ -532,8 +497,19 @@ AdAmlDisassemble (
AcpiDmDumpDataTable (Table);
fprintf (stderr, "Disassembly completed\n");
fprintf (stderr, "ASL Output: %s - %u bytes\n",
DisasmFilename, AdGetFileSize (File));
if (File)
{
fprintf (stderr, "ASL Output: %s - %u bytes\n",
DisasmFilename, CmGetFileSize (File));
}
if (Gbl_MapfileFlag)
{
fprintf (stderr, "%14s %s - %u bytes\n",
Gbl_Files[ASL_FILE_MAP_OUTPUT].ShortDescription,
Gbl_Files[ASL_FILE_MAP_OUTPUT].Filename,
FlGetFileSize (ASL_FILE_MAP_OUTPUT));
}
}
}
@ -544,7 +520,7 @@ Cleanup:
ACPI_FREE (Table);
}
if (OutToFile && File)
if (File)
{
if (AslCompilerdebug) /* Display final namespace, with transforms */
{
@ -570,7 +546,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.
*
*****************************************************************************/
@ -581,12 +557,26 @@ AdDisassemblerHeader (
{
time_t Timer;
time (&Timer);
/* Header and input table info */
AcpiOsPrintf ("/*\n");
AcpiOsPrintf (ACPI_COMMON_HEADER ("AML Disassembler", " * "));
AcpiOsPrintf (ACPI_COMMON_HEADER (AML_DISASSEMBLER_NAME, " * "));
if (AcpiGbl_CstyleDisassembly)
{
AcpiOsPrintf (
" * Disassembling to symbolic ASL+ operators\n"
" *\n");
}
else
{
AcpiOsPrintf (
" * Disassembling to non-symbolic legacy ASL operators\n"
" *\n");
}
AcpiOsPrintf (" * Disassembly of %s, %s", Filename, ctime (&Timer));
AcpiOsPrintf (" *\n");
@ -602,7 +592,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.
*
*****************************************************************************/
@ -679,9 +669,18 @@ AdCreateTableHeader (
}
else
{
NewFilename = ACPI_ALLOCATE_ZEROED (9);
strncat (NewFilename, Table->Signature, 4);
strcat (NewFilename, ".aml");
NewFilename = UtStringCacheCalloc (9);
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 */
@ -690,8 +689,6 @@ AdCreateTableHeader (
"DefinitionBlock (\"%s\", \"%4.4s\", %hu, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
NewFilename, Table->Signature, Table->Revision,
Table->OemId, Table->OemTableId, Table->OemRevision);
ACPI_FREE (NewFilename);
}
@ -726,6 +723,7 @@ AdDisplayTables (
}
AcpiDmDisassemble (NULL, AcpiGbl_ParseOpRoot, ACPI_UINT32_MAX);
MpEmitMappingInfo ();
if (AcpiGbl_DbOpt_verbose)
{
@ -746,8 +744,7 @@ AdDisplayTables (
*
* FUNCTION: AdGetLocalTables
*
* PARAMETERS: Filename - Not used
* GetAllTables - TRUE if all tables are desired
* PARAMETERS: None
*
* RETURN: Status
*
@ -757,105 +754,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);
}
@ -944,7 +872,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);
@ -979,9 +908,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");

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>
@ -469,8 +468,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;
@ -478,22 +478,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
@ -509,7 +513,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);
}
@ -518,11 +523,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;
@ -554,7 +561,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;
}
}
@ -564,8 +572,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;
@ -741,6 +749,7 @@ AcpiDmXrefDescendingOp (
ACPI_NAMESPACE_NODE *Node;
ACPI_OPERAND_OBJECT *Object;
UINT32 ParamCount = 0;
char *Pathname;
WalkState = Info->WalkState;
@ -750,11 +759,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)
@ -791,6 +802,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;
@ -808,11 +823,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;
}
@ -820,25 +838,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;
@ -852,7 +883,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

View File

@ -0,0 +1,240 @@
/******************************************************************************
*
* Module Name: ahids - Table of ACPI/PNP _HID/_CID values
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/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"},
{"80860F09", "Intel PWM Controller"},
{"80860F0A", "Intel Atom UART Controller"},
{"80860F0E", "Intel SPI 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"},
{"ADMA0F28", "Intel Audio DMA"},
{"AMCR0F28", "Intel Audio Machine Driver"},
{"ATK4001", "Asus Radio Control Button"},
{"ATML1000", "Atmel Touchscreen Controller"},
{"AUTH2750", "AuthenTec AES2750"},
{"BCM2E39", "Broadcom BT Serial Bus Driver over UART Bus Enumerator"},
{"BCM4752E", "Broadcom GPS Controller"},
{"BMG0160", "Bosch Gyro Sensor"},
{"CPLM3218", "Capella Micro CM3218x Ambient Light Sensor"},
{"DELLABCE", "Dell Airplane Mode Switch Driver"},
{"DLAC3002", "Qualcomm Atheros Bluetooth UART Transport"},
{"FTTH5506", "FocalTech 5506 Touch Controller"},
{"HAD0F28", "Intel HDMI Audio Driver"},
{"INBC0000", "GPIO Expander"},
{"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"},
{"INT33BE", "Camera Sensor OV5693"},
{"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"},
{"INT33F4", "XPOWER PMIC Controller"},
{"INT33F5", "TI PMIC Controller"},
{"INT33FB", "MIPI-CSI Camera Sensor OV2722"},
{"INT33FC", "Intel Baytrail GPIO Controller"},
{"INT33FD", "Intel Baytrail Power Management IC"},
{"INT33FE", "XPOWER Battery Device"},
{"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"},
{"MAX17047", "Fuel Gauge Controller"},
{"MSFT0101", "TPM 2.0 Security Device"},
{"NXP5442", "NXP 5442 Near Field Communications Controller"},
{"NXP5472", "NXP NFC"},
{"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"},
{"PNP0F13", "PS/2 Mouse"},
{"RTL8723", "Realtek Wireless Controller"},
{"SMB0349", "Charger"},
{"SMO91D0", "Sensor Hub"},
{"SMSC3750", "SMSC 3750 USB MUX"},
{"SSPX0000", "Intel SSP Device"},
{"TBQ24296", "Charger"},
{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);
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -44,6 +44,9 @@
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/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.
@ -94,6 +97,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"),
@ -118,6 +122,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"),
@ -169,6 +174,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"),
@ -321,3 +327,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);
}

View File

@ -0,0 +1,132 @@
/******************************************************************************
*
* Module Name: ahuuids - Table of known ACPI-related UUIDs
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/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"},
{"Device Properties for _DSD",
"daffd814-6eba-4d8c-8a91-bc9bbf4aa301"},
{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);
}

View File

@ -0,0 +1,113 @@
/******************************************************************************
*
* Module Name: cfsize - Common get file size function
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/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);
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -67,7 +67,7 @@
*/
static const char *AcpiGbl_DmTypeNames[] =
{
/* 00 */ "", /* Type ANY */
/* 00 */ ", UnknownObj", /* Type ANY */
/* 01 */ ", IntObj",
/* 02 */ ", StrObj",
/* 03 */ ", BuffObj",
@ -104,10 +104,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);
/*******************************************************************************
@ -279,48 +288,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);
}
@ -354,196 +356,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
@ -585,6 +397,7 @@ AcpiDmGetExternalsFromFile (
{
fprintf (stderr, "Could not open external reference file \"%s\"\n",
Gbl_ExternalRefFilename);
AslAbort ();
return;
}
@ -593,18 +406,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 */
@ -626,7 +458,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++;
}
@ -651,11 +484,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
*
@ -663,73 +498,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 */
@ -740,44 +827,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;
@ -795,7 +869,7 @@ AcpiDmAddToExternalListFromFile (
}
NewExternal->Next = NextExternal;
return;
return_ACPI_STATUS (AE_OK);
}
PrevExternal = NextExternal;
@ -810,6 +884,8 @@ AcpiDmAddToExternalListFromFile (
{
AcpiGbl_ExternalList = NewExternal;
}
return_ACPI_STATUS (AE_OK);
}
@ -985,7 +1061,7 @@ AcpiDmEmitExternals (
if (NextExternal->Type == ACPI_TYPE_METHOD)
{
AcpiGbl_NumExternalMethods++;
if (NextExternal->Resolved)
if (NextExternal->Flags & ACPI_EXT_RESOLVED_REFERENCE)
{
AcpiGbl_ResolvedExternalMethods++;
}
@ -1004,18 +1080,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;
@ -1036,7 +1111,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,
@ -1051,7 +1127,7 @@ AcpiDmEmitExternals (
{
AcpiOsPrintf (")\n");
}
NextExternal->Emitted = TRUE;
NextExternal->Flags |= ACPI_EXT_EXTERNAL_EMITTED;
}
NextExternal = NextExternal->Next;
@ -1065,7 +1141,7 @@ AcpiDmEmitExternals (
*/
while (AcpiGbl_ExternalList)
{
if (!AcpiGbl_ExternalList->Emitted)
if (!(AcpiGbl_ExternalList->Flags & ACPI_EXT_EXTERNAL_EMITTED))
{
AcpiOsPrintf (" External (%s%s",
AcpiGbl_ExternalList->Path,
@ -1087,7 +1163,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);
}
@ -1209,12 +1285,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)
{
@ -1223,10 +1311,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"),
@ -1245,10 +1344,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)
@ -1258,10 +1365,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));

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acparser.h>

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -87,9 +87,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",
@ -160,6 +172,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",
@ -189,20 +208,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[] =
@ -225,6 +253,7 @@ static const char *AcpiDmSratSubnames[] =
"Processor Local APIC/SAPIC Affinity",
"Memory Affinity",
"Processor Local x2APIC Affinity",
"GICC Affinity",
"Unknown SubTable Type" /* Reserved */
};
@ -235,6 +264,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
@ -286,7 +321,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"},
@ -294,17 +329,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"},
@ -650,6 +686,7 @@ AcpiDmDumpTable (
UINT32 ByteLength;
UINT8 Temp8;
UINT16 Temp16;
UINT64 Value;
ACPI_DMTABLE_DATA *TableData;
const char *Name;
BOOLEAN LastOutputBlankLine = FALSE;
@ -691,7 +728,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:
@ -701,6 +740,7 @@ AcpiDmDumpTable (
case ACPI_DMT_EINJINST:
case ACPI_DMT_ERSTACT:
case ACPI_DMT_ERSTINST:
case ACPI_DMT_DMAR_SCOPE:
ByteLength = 1;
break;
@ -721,6 +761,7 @@ AcpiDmDumpTable (
case ACPI_DMT_NAME4:
case ACPI_DMT_SIG:
case ACPI_DMT_SLIC:
case ACPI_DMT_LPIT:
ByteLength = 4;
break;
@ -863,10 +904,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;
@ -1022,6 +1072,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 */
@ -1074,6 +1137,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 */
@ -1122,6 +1198,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 */
@ -1202,6 +1291,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);

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -419,12 +419,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);
@ -479,7 +479,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;
}
@ -541,7 +541,7 @@ AcpiDmDumpAsf (
AcpiOsPrintf ("\n");
/* Point to next sub-table */
/* Point to next subtable */
if (!SubTable->Header.Length)
{
@ -586,7 +586,7 @@ AcpiDmDumpCpep (
return;
}
/* Sub-tables */
/* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset);
while (Offset < Table->Length)
@ -599,7 +599,7 @@ AcpiDmDumpCpep (
return;
}
/* Point to next sub-table */
/* Point to next subtable */
Offset += SubTable->Header.Length;
SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable,
@ -638,7 +638,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)
@ -702,7 +702,7 @@ AcpiDmDumpCsrt (
SubSubTable->Length);
}
/* Point to next sub-table */
/* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, SubTable,
@ -746,7 +746,7 @@ AcpiDmDumpDbg2 (
return;
}
/* Sub-tables */
/* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
while (Offset < Table->Length)
@ -809,10 +809,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,
@ -858,12 +861,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,
@ -888,21 +891,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;
}
@ -913,7 +922,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)
@ -953,7 +971,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);
@ -992,7 +1011,7 @@ AcpiDmDumpEinj (
return;
}
/* Sub-tables */
/* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
while (Offset < Table->Length)
@ -1005,7 +1024,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,
@ -1045,7 +1064,7 @@ AcpiDmDumpErst (
return;
}
/* Sub-tables */
/* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
while (Offset < Table->Length)
@ -1058,7 +1077,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,
@ -1093,12 +1112,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,
@ -1122,7 +1141,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 */
@ -1142,7 +1161,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);
@ -1150,6 +1169,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
@ -1185,7 +1321,7 @@ AcpiDmDumpHest (
return;
}
/* Sub-tables */
/* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
while (Offset < Table->Length)
@ -1243,7 +1379,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;
}
@ -1281,7 +1417,7 @@ AcpiDmDumpHest (
}
}
/* Point to next sub-table */
/* Point to next subtable */
SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, SubTable, SubTableLength);
}
@ -1324,12 +1460,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,
@ -1355,7 +1491,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 */
@ -1458,7 +1594,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);
@ -1466,6 +1602,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
@ -1498,12 +1713,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,
@ -1580,9 +1795,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 */
@ -1602,7 +1827,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);
@ -1639,7 +1864,7 @@ AcpiDmDumpMcfg (
return;
}
/* Sub-tables */
/* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset);
while (Offset < Table->Length)
@ -1659,7 +1884,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,
@ -1841,12 +2066,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,
@ -1856,7 +2081,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));
@ -1893,12 +2118,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,
@ -1908,7 +2133,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));
@ -1935,6 +2160,7 @@ AcpiDmDumpPcct (
{
ACPI_STATUS Status;
ACPI_PCCT_SUBSPACE *SubTable;
ACPI_DMTABLE_INFO *InfoTable;
UINT32 Length = Table->Length;
UINT32 Offset = sizeof (ACPI_TABLE_PCCT);
@ -1947,20 +2173,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,
@ -2108,8 +2364,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 */
@ -2209,7 +2464,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,
@ -2233,7 +2488,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 */
@ -2254,7 +2509,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);
@ -2291,7 +2546,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,
@ -2315,7 +2570,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 */
@ -2336,7 +2591,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);
@ -2452,12 +2707,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,
@ -2484,8 +2739,13 @@ AcpiDmDumpSrat (
InfoTable = AcpiDmTableInfoSrat2;
break;
case ACPI_SRAT_TYPE_GICC_AFFINITY:
InfoTable = AcpiDmTableInfoSrat3;
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 */
@ -2506,7 +2766,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);
@ -2543,12 +2803,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,
@ -2558,7 +2818,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));
@ -2595,12 +2855,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,
@ -2610,7 +2870,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));

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -137,11 +137,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)
@ -158,6 +163,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)
@ -171,6 +179,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)
@ -181,6 +191,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)
@ -196,6 +207,7 @@
#define ACPI_SRAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f)
#define ACPI_SRAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
#define ACPI_SRAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f)
#define ACPI_SRAT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_GICC_AFFINITY,f)
#define ACPI_VRTC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_VRTC_ENTRY,f)
#define ACPI_WDAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WDAT_ENTRY,f)
@ -212,7 +224,11 @@
#define ACPI_SRAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_CPU_AFFINITY,f,o)
#define ACPI_SRAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_MEM_AFFINITY,f,o)
#define ACPI_SRAT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f,o)
#define ACPI_SRAT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_GICC_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)
@ -223,9 +239,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)
@ -436,17 +454,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},
@ -720,12 +743,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},
@ -754,6 +777,12 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Name[] =
ACPI_DMT_TERMINATOR
};
ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2OemData[] =
{
{ACPI_DMT_BUFFER, 0, "OEM Data", DT_OPTIONAL},
ACPI_DMT_TERMINATOR
};
/*******************************************************************************
*
@ -797,7 +826,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},
@ -849,6 +878,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
};
/*******************************************************************************
*
@ -988,29 +1027,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
};
@ -1299,6 +1398,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
@ -1464,14 +1616,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
};
@ -1487,6 +1646,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
};
/*******************************************************************************
*
@ -1677,25 +1860,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
};
@ -1927,7 +2137,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},
@ -1978,7 +2188,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[] =
{ACPI_DMT_FLAG0, ACPI_SRAT0_FLAG_OFFSET (Flags,0), "Enabled", 0},
{ACPI_DMT_UINT8, ACPI_SRAT0_OFFSET (LocalSapicEid), "Local Sapic EID", 0},
{ACPI_DMT_UINT24, ACPI_SRAT0_OFFSET (ProximityDomainHi[0]), "Proximity Domain High(24)", 0},
{ACPI_DMT_UINT32, ACPI_SRAT0_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT32, ACPI_SRAT0_OFFSET (ClockDomain), "Clock Domain", 0},
ACPI_DMT_TERMINATOR
};
@ -2013,6 +2223,18 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[] =
ACPI_DMT_TERMINATOR
};
/* : GICC Affinity (ACPI 5.1) */
ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[] =
{
{ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (ProximityDomain), "Proximity Domain", 0},
{ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (AcpiProcessorUid), "Acpi Processor UID", 0},
{ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_SRAT3_FLAG_OFFSET (Flags,0), "Enabled", 0},
{ACPI_DMT_UINT32, ACPI_SRAT3_OFFSET (ClockDomain), "Clock Domain", 0},
ACPI_DMT_TERMINATOR
};
/*******************************************************************************
*

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -51,14 +51,12 @@
* "f|" - Option has required single-char sub-options
*/
#include <stdio.h>
#include <string.h>
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/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;
@ -123,7 +121,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
*
@ -145,12 +143,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);
}
}
@ -161,7 +159,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);

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <string.h>
@ -569,3 +568,51 @@ ApCheckRegMethod (
AslError (ASL_WARNING, ASL_MSG_NO_REGION, Op, NULL);
}
/*******************************************************************************
*
* FUNCTION: ApFindNameInScope
*
* PARAMETERS: Name - Name to search for
* Op - Current parse op
*
* RETURN: TRUE if name found in the same scope as Op.
*
* DESCRIPTION: Determine if a name appears in the same scope as Op, as either
* a Method() or a Name().
*
******************************************************************************/
BOOLEAN
ApFindNameInScope (
char *Name,
ACPI_PARSE_OBJECT *Op)
{
ACPI_PARSE_OBJECT *Next;
ACPI_PARSE_OBJECT *Parent;
/* Get the start of the current scope */
Parent = Op->Asl.Parent;
Next = Parent->Asl.Child;
/* Search entire scope for a match to the name */
while (Next)
{
if ((Next->Asl.ParseOpcode == PARSEOP_METHOD) ||
(Next->Asl.ParseOpcode == PARSEOP_NAME))
{
if (ACPI_COMPARE_NAME (Name, Next->Asl.NameSeg))
{
return (TRUE);
}
}
Next = Next->Asl.Next;
}
return (FALSE);
}

View File

@ -0,0 +1,349 @@
/******************************************************************************
*
* Module Name: aslascii - ASCII detection and support routines
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/include/acapps.h>
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslascii")
/* Local prototypes */
static void
FlConsumeAnsiComment (
FILE *Handle,
ASL_FILE_STATUS *Status);
static void
FlConsumeNewComment (
FILE *Handle,
ASL_FILE_STATUS *Status);
/*******************************************************************************
*
* FUNCTION: FlCheckForAcpiTable
*
* PARAMETERS: Handle - Open input file
*
* RETURN: Status
*
* DESCRIPTION: Determine if a file seems to be a binary ACPI table, via the
* following checks on what would be the table header:
* 0) File must be at least as long as an ACPI_TABLE_HEADER
* 1) The header length field must match the file size
* 2) Signature, OemId, OemTableId, AslCompilerId must be ASCII
*
******************************************************************************/
ACPI_STATUS
FlCheckForAcpiTable (
FILE *Handle)
{
ACPI_TABLE_HEADER Table;
UINT32 FileSize;
size_t Actual;
UINT32 i;
/* Read a potential table header */
Actual = fread (&Table, 1, sizeof (ACPI_TABLE_HEADER), Handle);
fseek (Handle, 0, SEEK_SET);
if (Actual < sizeof (ACPI_TABLE_HEADER))
{
return (AE_ERROR);
}
/* Header length field must match the file size */
FileSize = CmGetFileSize (Handle);
if (Table.Length != FileSize)
{
return (AE_ERROR);
}
/*
* These fields must be ASCII:
* Signature, OemId, OemTableId, AslCompilerId.
* We allow a NULL terminator in OemId and OemTableId.
*/
for (i = 0; i < ACPI_NAME_SIZE; i++)
{
if (!ACPI_IS_ASCII ((UINT8) Table.Signature[i]))
{
return (AE_ERROR);
}
if (!ACPI_IS_ASCII ((UINT8) Table.AslCompilerId[i]))
{
return (AE_ERROR);
}
}
for (i = 0; (i < ACPI_OEM_ID_SIZE) && (Table.OemId[i]); i++)
{
if (!ACPI_IS_ASCII ((UINT8) Table.OemId[i]))
{
return (AE_ERROR);
}
}
for (i = 0; (i < ACPI_OEM_TABLE_ID_SIZE) && (Table.OemTableId[i]); i++)
{
if (!ACPI_IS_ASCII ((UINT8) Table.OemTableId[i]))
{
return (AE_ERROR);
}
}
printf ("Binary file appears to be a valid ACPI table, disassembling\n");
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: FlCheckForAscii
*
* PARAMETERS: Handle - Open input file
* Filename - Input filename
* DisplayErrors - TRUE if error messages desired
*
* RETURN: Status
*
* DESCRIPTION: Verify that the input file is entirely ASCII. Ignores characters
* within comments. Note: does not handle nested comments and does
* not handle comment delimiters within string literals. However,
* on the rare chance this happens and an invalid character is
* missed, the parser will catch the error by failing in some
* spectactular manner.
*
******************************************************************************/
ACPI_STATUS
FlCheckForAscii (
FILE *Handle,
char *Filename,
BOOLEAN DisplayErrors)
{
UINT8 Byte;
ACPI_SIZE BadBytes = 0;
BOOLEAN OpeningComment = FALSE;
ASL_FILE_STATUS Status;
Status.Line = 1;
Status.Offset = 0;
/* Read the entire file */
while (fread (&Byte, 1, 1, Handle) == 1)
{
/* Ignore comment fields (allow non-ascii within) */
if (OpeningComment)
{
/* Check for second comment open delimiter */
if (Byte == '*')
{
FlConsumeAnsiComment (Handle, &Status);
}
if (Byte == '/')
{
FlConsumeNewComment (Handle, &Status);
}
/* Reset */
OpeningComment = FALSE;
}
else if (Byte == '/')
{
OpeningComment = TRUE;
}
/* Check for an ASCII character */
if (!ACPI_IS_ASCII (Byte))
{
if ((BadBytes < 10) && (DisplayErrors))
{
AcpiOsPrintf (
"Non-ASCII character [0x%2.2X] found in line %u, file offset 0x%.2X\n",
Byte, Status.Line, Status.Offset);
}
BadBytes++;
}
/* Update line counter */
else if (Byte == 0x0A)
{
Status.Line++;
}
Status.Offset++;
}
/* Seek back to the beginning of the source file */
fseek (Handle, 0, SEEK_SET);
/* Were there any non-ASCII characters in the file? */
if (BadBytes)
{
if (DisplayErrors)
{
AcpiOsPrintf (
"%u non-ASCII characters found in input source text, could be a binary file\n",
BadBytes);
AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, Filename);
}
return (AE_BAD_CHARACTER);
}
/* File is OK (100% ASCII) */
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: FlConsumeAnsiComment
*
* PARAMETERS: Handle - Open input file
* Status - File current status struct
*
* RETURN: Number of lines consumed
*
* DESCRIPTION: Step over a normal slash-star type comment
*
******************************************************************************/
static void
FlConsumeAnsiComment (
FILE *Handle,
ASL_FILE_STATUS *Status)
{
UINT8 Byte;
BOOLEAN ClosingComment = FALSE;
while (fread (&Byte, 1, 1, Handle) == 1)
{
/* Scan until comment close is found */
if (ClosingComment)
{
if (Byte == '/')
{
return;
}
if (Byte != '*')
{
/* Reset */
ClosingComment = FALSE;
}
}
else if (Byte == '*')
{
ClosingComment = TRUE;
}
/* Maintain line count */
if (Byte == 0x0A)
{
Status->Line++;
}
Status->Offset++;
}
}
/*******************************************************************************
*
* FUNCTION: FlConsumeNewComment
*
* PARAMETERS: Handle - Open input file
* Status - File current status struct
*
* RETURN: Number of lines consumed
*
* DESCRIPTION: Step over a slash-slash type of comment
*
******************************************************************************/
static void
FlConsumeNewComment (
FILE *Handle,
ASL_FILE_STATUS *Status)
{
UINT8 Byte;
while (fread (&Byte, 1, 1, Handle) == 1)
{
Status->Offset++;
/* Comment ends at newline */
if (Byte == 0x0A)
{
Status->Line++;
return;
}
}
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@ -243,7 +242,7 @@ AnMapEtypeToBtype (
return (ACPI_BTYPE_INTEGER | ACPI_BTYPE_DDB_HANDLE);
case ACPI_BTYPE_DEBUG_OBJECT:
case ACPI_TYPE_DEBUG_OBJECT:
/* Cannot be used as a source operand */
@ -375,6 +374,12 @@ AnGetBtype (
UINT32 ThisNodeBtype = 0;
if (!Op)
{
AcpiOsPrintf ("Null Op in AnGetBtype\n");
return (ACPI_UINT32_MAX);
}
if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG) ||
(Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) ||
(Op->Asl.ParseOpcode == PARSEOP_METHODCALL))

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@ -108,6 +107,12 @@ CgGenerateAmlOutput (
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
CgAmlWriteWalk, NULL, NULL);
DbgPrint (ASL_TREE_OUTPUT,
"%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr"
" Parent Child Next Flags AcTyp Final Col L\n",
76, " ");
CgCloseTable ();
}
@ -139,7 +144,8 @@ CgAmlWriteWalk (
DbgPrint (ASL_TREE_OUTPUT,
"Final parse tree used for AML output:\n");
DbgPrint (ASL_TREE_OUTPUT,
"%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr Child Parent Flags AcTyp Final Col L\n",
"%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr"
" Parent Child Next Flags AcTyp Final Col L\n",
76, " ");
}
@ -162,7 +168,8 @@ CgAmlWriteWalk (
}
DbgPrint (ASL_TREE_OUTPUT,
"%08X %04X %04X %01X %04X %04X %04X %04X %08X %08X %08X %08X %08X %04X %02d %02d\n",
"%08X %04X %04X %01X %04X %04X %04X %04X "
"%08X %08X %08X %08X %08X %08X %04X %02d %02d\n",
/* 1 */ (UINT32) Op->Asl.Value.Integer,
/* 2 */ Op->Asl.ParseOpcode,
/* 3 */ Op->Asl.AmlOpcode,
@ -172,13 +179,14 @@ CgAmlWriteWalk (
/* 7 */ Op->Asl.AmlSubtreeLength,
/* 8 */ Op->Asl.Parent ? Op->Asl.Parent->Asl.AmlSubtreeLength : 0,
/* 9 */ Op,
/* 10 */ Op->Asl.Child,
/* 11 */ Op->Asl.Parent,
/* 12 */ Op->Asl.CompileFlags,
/* 13 */ Op->Asl.AcpiBtype,
/* 14 */ Op->Asl.FinalAmlLength,
/* 15 */ Op->Asl.Column,
/* 16 */ Op->Asl.LineNumber);
/* 10 */ Op->Asl.Parent,
/* 11 */ Op->Asl.Child,
/* 12 */ Op->Asl.Next,
/* 13 */ Op->Asl.CompileFlags,
/* 14 */ Op->Asl.AcpiBtype,
/* 15 */ Op->Asl.FinalAmlLength,
/* 16 */ Op->Asl.Column,
/* 17 */ Op->Asl.LineNumber);
/* Generate the AML for this node */

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -43,6 +43,7 @@
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/compiler/dtcompiler.h>
#include <contrib/dev/acpica/include/acnamesp.h>
#include <stdio.h>
#include <time.h>
@ -66,21 +67,269 @@ static void
CmFlushSourceCode (
void);
static void
FlConsumeAnsiComment (
FILE *Handle,
ASL_FILE_STATUS *Status);
static void
FlConsumeNewComment (
FILE *Handle,
ASL_FILE_STATUS *Status);
static void
CmDumpAllEvents (
void);
/*******************************************************************************
*
* FUNCTION: CmDoCompile
*
* PARAMETERS: None
*
* RETURN: Status (0 = OK)
*
* DESCRIPTION: This procedure performs the entire compile
*
******************************************************************************/
int
CmDoCompile (
void)
{
ACPI_STATUS Status;
UINT8 FullCompile;
UINT8 Event;
FullCompile = UtBeginEvent ("*** Total Compile time ***");
Event = UtBeginEvent ("Open input and output files");
UtEndEvent (Event);
Event = UtBeginEvent ("Preprocess input file");
if (Gbl_PreprocessFlag)
{
/* Preprocessor */
PrDoPreprocess ();
if (Gbl_PreprocessOnly)
{
UtEndEvent (Event);
CmCleanupAndExit ();
return (0);
}
}
UtEndEvent (Event);
/* Build the parse tree */
Event = UtBeginEvent ("Parse source code and build parse tree");
AslCompilerparse();
UtEndEvent (Event);
/* Check for parser-detected syntax errors */
if (Gbl_SyntaxError)
{
fprintf (stderr, "Compiler aborting due to parser-detected syntax error(s)\n");
LsDumpParseTree ();
goto ErrorExit;
}
/* Did the parse tree get successfully constructed? */
if (!RootNode)
{
/*
* If there are no errors, then we have some sort of
* internal problem.
*/
AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL,
NULL, "- Could not resolve parse tree root node");
goto ErrorExit;
}
/* Flush out any remaining source after parse tree is complete */
Event = UtBeginEvent ("Flush source input");
CmFlushSourceCode ();
/* Prune the parse tree if requested (debug purposes only) */
if (Gbl_PruneParseTree)
{
AslPruneParseTree (Gbl_PruneDepth, Gbl_PruneType);
}
/* Optional parse tree dump, compiler debug output only */
LsDumpParseTree ();
OpcGetIntegerWidth (RootNode);
UtEndEvent (Event);
/* Pre-process parse tree for any operator transforms */
Event = UtBeginEvent ("Parse tree transforms");
DbgPrint (ASL_DEBUG_OUTPUT, "\nParse tree transforms\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
TrAmlTransformWalk, NULL, NULL);
UtEndEvent (Event);
/* Generate AML opcodes corresponding to the parse tokens */
Event = UtBeginEvent ("Generate AML opcodes");
DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating AML opcodes\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
OpcAmlOpcodeWalk, NULL);
UtEndEvent (Event);
/*
* Now that the input is parsed, we can open the AML output file.
* Note: by default, the name of this file comes from the table descriptor
* within the input file.
*/
Event = UtBeginEvent ("Open AML output file");
Status = FlOpenAmlOutputFile (Gbl_OutputFilenamePrefix);
UtEndEvent (Event);
if (ACPI_FAILURE (Status))
{
AePrintErrorLog (ASL_FILE_STDERR);
return (-1);
}
/* Interpret and generate all compile-time constants */
Event = UtBeginEvent ("Constant folding via AML interpreter");
DbgPrint (ASL_DEBUG_OUTPUT,
"\nInterpreting compile-time constant expressions\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
OpcAmlConstantWalk, NULL, NULL);
UtEndEvent (Event);
/* Update AML opcodes if necessary, after constant folding */
Event = UtBeginEvent ("Updating AML opcodes after constant folding");
DbgPrint (ASL_DEBUG_OUTPUT,
"\nUpdating AML opcodes after constant folding\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
NULL, OpcAmlOpcodeUpdateWalk, NULL);
UtEndEvent (Event);
/* Calculate all AML package lengths */
Event = UtBeginEvent ("Generate AML package lengths");
DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating Package lengths\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
LnPackageLengthWalk, NULL);
UtEndEvent (Event);
if (Gbl_ParseOnlyFlag)
{
AePrintErrorLog (ASL_FILE_STDERR);
UtDisplaySummary (ASL_FILE_STDERR);
if (Gbl_DebugFlag)
{
/* Print error summary to the stdout also */
AePrintErrorLog (ASL_FILE_STDOUT);
UtDisplaySummary (ASL_FILE_STDOUT);
}
UtEndEvent (FullCompile);
return (0);
}
/*
* Create an internal namespace and use it as a symbol table
*/
/* Namespace loading */
Event = UtBeginEvent ("Create ACPI Namespace");
Status = LdLoadNamespace (RootNode);
UtEndEvent (Event);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
/* Namespace cross-reference */
AslGbl_NamespaceEvent = UtBeginEvent ("Cross reference parse tree and Namespace");
Status = XfCrossReferenceNamespace ();
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
/* Namespace - Check for non-referenced objects */
LkFindUnreferencedObjects ();
UtEndEvent (AslGbl_NamespaceEvent);
/*
* Semantic analysis. This can happen only after the
* namespace has been loaded and cross-referenced.
*
* part one - check control methods
*/
Event = UtBeginEvent ("Analyze control method return types");
AnalysisWalkInfo.MethodStack = NULL;
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method analysis\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE,
MtMethodAnalysisWalkBegin,
MtMethodAnalysisWalkEnd, &AnalysisWalkInfo);
UtEndEvent (Event);
/* Semantic error checking part two - typing of method returns */
Event = UtBeginEvent ("Determine object types returned by methods");
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method typing\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
NULL, AnMethodTypingWalkEnd, NULL);
UtEndEvent (Event);
/* Semantic error checking part three - operand type checking */
Event = UtBeginEvent ("Analyze AML operand types");
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Operand type checking\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
NULL, AnOperandTypecheckWalkEnd, &AnalysisWalkInfo);
UtEndEvent (Event);
/* Semantic error checking part four - other miscellaneous checks */
Event = UtBeginEvent ("Miscellaneous analysis");
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - miscellaneous\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
AnOtherSemanticAnalysisWalkBegin,
NULL, &AnalysisWalkInfo);
UtEndEvent (Event);
/* Calculate all AML package lengths */
Event = UtBeginEvent ("Finish AML package length generation");
DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating Package lengths\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
LnInitLengthsWalk, NULL);
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
LnPackageLengthWalk, NULL);
UtEndEvent (Event);
/* Code generation - emit the AML */
Event = UtBeginEvent ("Generate AML code and write output files");
CgGenerateAmlOutput ();
UtEndEvent (Event);
Event = UtBeginEvent ("Write optional output files");
CmDoOutputFiles ();
UtEndEvent (Event);
UtEndEvent (FullCompile);
CmCleanupAndExit ();
return (0);
ErrorExit:
UtEndEvent (FullCompile);
CmCleanupAndExit ();
return (-1);
}
/*******************************************************************************
*
* FUNCTION: AslCompilerSignon
@ -272,534 +521,6 @@ CmFlushSourceCode (
}
/*******************************************************************************
*
* FUNCTION: FlConsume*
*
* PARAMETERS: Handle - Open input file
* Status - File current status struct
*
* RETURN: Number of lines consumed
*
* DESCRIPTION: Step over both types of comment during check for ascii chars
*
******************************************************************************/
static void
FlConsumeAnsiComment (
FILE *Handle,
ASL_FILE_STATUS *Status)
{
UINT8 Byte;
BOOLEAN ClosingComment = FALSE;
while (fread (&Byte, 1, 1, Handle) == 1)
{
/* Scan until comment close is found */
if (ClosingComment)
{
if (Byte == '/')
{
return;
}
if (Byte != '*')
{
/* Reset */
ClosingComment = FALSE;
}
}
else if (Byte == '*')
{
ClosingComment = TRUE;
}
/* Maintain line count */
if (Byte == 0x0A)
{
Status->Line++;
}
Status->Offset++;
}
}
static void
FlConsumeNewComment (
FILE *Handle,
ASL_FILE_STATUS *Status)
{
UINT8 Byte;
while (fread (&Byte, 1, 1, Handle) == 1)
{
Status->Offset++;
/* Comment ends at newline */
if (Byte == 0x0A)
{
Status->Line++;
return;
}
}
}
/*******************************************************************************
*
* FUNCTION: FlCheckForAcpiTable
*
* PARAMETERS: Handle - Open input file
*
* RETURN: Status
*
* DESCRIPTION: Determine if a file seems to be a binary ACPI table, via the
* following checks on what would be the table header:
* 0) File must be at least as long as an ACPI_TABLE_HEADER
* 1) The header length field must match the file size
* 2) Signature, OemId, OemTableId, AslCompilerId must be ASCII
*
******************************************************************************/
ACPI_STATUS
FlCheckForAcpiTable (
FILE *Handle)
{
ACPI_TABLE_HEADER Table;
UINT32 FileSize;
size_t Actual;
UINT32 i;
/* Read a potential table header */
Actual = fread (&Table, 1, sizeof (ACPI_TABLE_HEADER), Handle);
fseek (Handle, 0, SEEK_SET);
if (Actual < sizeof (ACPI_TABLE_HEADER))
{
return (AE_ERROR);
}
/* Header length field must match the file size */
FileSize = DtGetFileSize (Handle);
if (Table.Length != FileSize)
{
return (AE_ERROR);
}
/*
* These fields must be ASCII:
* Signature, OemId, OemTableId, AslCompilerId.
* We allow a NULL terminator in OemId and OemTableId.
*/
for (i = 0; i < ACPI_NAME_SIZE; i++)
{
if (!ACPI_IS_ASCII ((UINT8) Table.Signature[i]))
{
return (AE_ERROR);
}
if (!ACPI_IS_ASCII ((UINT8) Table.AslCompilerId[i]))
{
return (AE_ERROR);
}
}
for (i = 0; (i < ACPI_OEM_ID_SIZE) && (Table.OemId[i]); i++)
{
if (!ACPI_IS_ASCII ((UINT8) Table.OemId[i]))
{
return (AE_ERROR);
}
}
for (i = 0; (i < ACPI_OEM_TABLE_ID_SIZE) && (Table.OemTableId[i]); i++)
{
if (!ACPI_IS_ASCII ((UINT8) Table.OemTableId[i]))
{
return (AE_ERROR);
}
}
printf ("Binary file appears to be a valid ACPI table, disassembling\n");
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: FlCheckForAscii
*
* PARAMETERS: Handle - Open input file
* Filename - Input filename
* DisplayErrors - TRUE if error messages desired
*
* RETURN: Status
*
* DESCRIPTION: Verify that the input file is entirely ASCII. Ignores characters
* within comments. Note: does not handle nested comments and does
* not handle comment delimiters within string literals. However,
* on the rare chance this happens and an invalid character is
* missed, the parser will catch the error by failing in some
* spectactular manner.
*
******************************************************************************/
ACPI_STATUS
FlCheckForAscii (
FILE *Handle,
char *Filename,
BOOLEAN DisplayErrors)
{
UINT8 Byte;
ACPI_SIZE BadBytes = 0;
BOOLEAN OpeningComment = FALSE;
ASL_FILE_STATUS Status;
Status.Line = 1;
Status.Offset = 0;
/* Read the entire file */
while (fread (&Byte, 1, 1, Handle) == 1)
{
/* Ignore comment fields (allow non-ascii within) */
if (OpeningComment)
{
/* Check for second comment open delimiter */
if (Byte == '*')
{
FlConsumeAnsiComment (Handle, &Status);
}
if (Byte == '/')
{
FlConsumeNewComment (Handle, &Status);
}
/* Reset */
OpeningComment = FALSE;
}
else if (Byte == '/')
{
OpeningComment = TRUE;
}
/* Check for an ASCII character */
if (!ACPI_IS_ASCII (Byte))
{
if ((BadBytes < 10) && (DisplayErrors))
{
AcpiOsPrintf (
"Non-ASCII character [0x%2.2X] found in line %u, file offset 0x%.2X\n",
Byte, Status.Line, Status.Offset);
}
BadBytes++;
}
/* Update line counter */
else if (Byte == 0x0A)
{
Status.Line++;
}
Status.Offset++;
}
/* Seek back to the beginning of the source file */
fseek (Handle, 0, SEEK_SET);
/* Were there any non-ASCII characters in the file? */
if (BadBytes)
{
if (DisplayErrors)
{
AcpiOsPrintf (
"%u non-ASCII characters found in input source text, could be a binary file\n",
BadBytes);
AslError (ASL_ERROR, ASL_MSG_NON_ASCII, NULL, Filename);
}
return (AE_BAD_CHARACTER);
}
/* File is OK (100% ASCII) */
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: CmDoCompile
*
* PARAMETERS: None
*
* RETURN: Status (0 = OK)
*
* DESCRIPTION: This procedure performs the entire compile
*
******************************************************************************/
int
CmDoCompile (
void)
{
ACPI_STATUS Status;
UINT8 FullCompile;
UINT8 Event;
FullCompile = UtBeginEvent ("*** Total Compile time ***");
Event = UtBeginEvent ("Open input and output files");
UtEndEvent (Event);
Event = UtBeginEvent ("Preprocess input file");
if (Gbl_PreprocessFlag)
{
/* Preprocessor */
PrDoPreprocess ();
if (Gbl_PreprocessOnly)
{
UtEndEvent (Event);
CmCleanupAndExit ();
return (0);
}
}
UtEndEvent (Event);
/* Build the parse tree */
Event = UtBeginEvent ("Parse source code and build parse tree");
AslCompilerparse();
UtEndEvent (Event);
/* Check for parse errors */
Status = AslCheckForErrorExit ();
if (ACPI_FAILURE (Status))
{
fprintf (stderr, "Compiler aborting due to parser-detected syntax error(s)\n");
LsDumpParseTree ();
goto ErrorExit;
}
/* Did the parse tree get successfully constructed? */
if (!RootNode)
{
/*
* If there are no errors, then we have some sort of
* internal problem.
*/
AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL,
NULL, "- Could not resolve parse tree root node");
goto ErrorExit;
}
/* Flush out any remaining source after parse tree is complete */
Event = UtBeginEvent ("Flush source input");
CmFlushSourceCode ();
/* Optional parse tree dump, compiler debug output only */
LsDumpParseTree ();
OpcGetIntegerWidth (RootNode);
UtEndEvent (Event);
/* Pre-process parse tree for any operator transforms */
Event = UtBeginEvent ("Parse tree transforms");
DbgPrint (ASL_DEBUG_OUTPUT, "\nParse tree transforms\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
TrAmlTransformWalk, NULL, NULL);
UtEndEvent (Event);
/* Generate AML opcodes corresponding to the parse tokens */
Event = UtBeginEvent ("Generate AML opcodes");
DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating AML opcodes\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
OpcAmlOpcodeWalk, NULL);
UtEndEvent (Event);
/*
* Now that the input is parsed, we can open the AML output file.
* Note: by default, the name of this file comes from the table descriptor
* within the input file.
*/
Event = UtBeginEvent ("Open AML output file");
Status = FlOpenAmlOutputFile (Gbl_OutputFilenamePrefix);
UtEndEvent (Event);
if (ACPI_FAILURE (Status))
{
AePrintErrorLog (ASL_FILE_STDERR);
return (-1);
}
/* Interpret and generate all compile-time constants */
Event = UtBeginEvent ("Constant folding via AML interpreter");
DbgPrint (ASL_DEBUG_OUTPUT,
"\nInterpreting compile-time constant expressions\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
OpcAmlConstantWalk, NULL, NULL);
UtEndEvent (Event);
/* Update AML opcodes if necessary, after constant folding */
Event = UtBeginEvent ("Updating AML opcodes after constant folding");
DbgPrint (ASL_DEBUG_OUTPUT,
"\nUpdating AML opcodes after constant folding\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
NULL, OpcAmlOpcodeUpdateWalk, NULL);
UtEndEvent (Event);
/* Calculate all AML package lengths */
Event = UtBeginEvent ("Generate AML package lengths");
DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating Package lengths\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
LnPackageLengthWalk, NULL);
UtEndEvent (Event);
if (Gbl_ParseOnlyFlag)
{
AePrintErrorLog (ASL_FILE_STDERR);
UtDisplaySummary (ASL_FILE_STDERR);
if (Gbl_DebugFlag)
{
/* Print error summary to the stdout also */
AePrintErrorLog (ASL_FILE_STDOUT);
UtDisplaySummary (ASL_FILE_STDOUT);
}
UtEndEvent (FullCompile);
return (0);
}
/*
* Create an internal namespace and use it as a symbol table
*/
/* Namespace loading */
Event = UtBeginEvent ("Create ACPI Namespace");
Status = LdLoadNamespace (RootNode);
UtEndEvent (Event);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
/* Namespace cross-reference */
AslGbl_NamespaceEvent = UtBeginEvent ("Cross reference parse tree and Namespace");
Status = XfCrossReferenceNamespace ();
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
/* Namespace - Check for non-referenced objects */
LkFindUnreferencedObjects ();
UtEndEvent (AslGbl_NamespaceEvent);
/*
* Semantic analysis. This can happen only after the
* namespace has been loaded and cross-referenced.
*
* part one - check control methods
*/
Event = UtBeginEvent ("Analyze control method return types");
AnalysisWalkInfo.MethodStack = NULL;
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method analysis\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE,
MtMethodAnalysisWalkBegin,
MtMethodAnalysisWalkEnd, &AnalysisWalkInfo);
UtEndEvent (Event);
/* Semantic error checking part two - typing of method returns */
Event = UtBeginEvent ("Determine object types returned by methods");
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method typing\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
NULL, AnMethodTypingWalkEnd, NULL);
UtEndEvent (Event);
/* Semantic error checking part three - operand type checking */
Event = UtBeginEvent ("Analyze AML operand types");
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Operand type checking\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
NULL, AnOperandTypecheckWalkEnd, &AnalysisWalkInfo);
UtEndEvent (Event);
/* Semantic error checking part four - other miscellaneous checks */
Event = UtBeginEvent ("Miscellaneous analysis");
DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - miscellaneous\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
AnOtherSemanticAnalysisWalkBegin,
NULL, &AnalysisWalkInfo);
UtEndEvent (Event);
/* Calculate all AML package lengths */
Event = UtBeginEvent ("Finish AML package length generation");
DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating Package lengths\n\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
LnInitLengthsWalk, NULL);
TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
LnPackageLengthWalk, NULL);
UtEndEvent (Event);
/* Code generation - emit the AML */
Event = UtBeginEvent ("Generate AML code and write output files");
CgGenerateAmlOutput ();
UtEndEvent (Event);
Event = UtBeginEvent ("Write optional output files");
CmDoOutputFiles ();
UtEndEvent (Event);
UtEndEvent (FullCompile);
CmCleanupAndExit ();
return (0);
ErrorExit:
UtEndEvent (FullCompile);
CmCleanupAndExit ();
return (-1);
}
/*******************************************************************************
*
* FUNCTION: CmDoOutputFiles
@ -825,6 +546,10 @@ CmDoOutputFiles (
/* Dump the namespace to the .nsp file if requested */
(void) NsDisplayNamespace ();
/* Dump the device mapping file */
MpEmitMappingInfo ();
}
@ -965,7 +690,8 @@ CmCleanupAndExit (
* We will delete the AML file if there are errors and the
* force AML output option has not been used.
*/
if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors) &&
if ((Gbl_ExceptionCount[ASL_ERROR] > 0) &&
(!Gbl_IgnoreErrors) &&
Gbl_Files[ASL_FILE_AML_OUTPUT].Handle)
{
DeleteAmlFile = TRUE;
@ -1025,4 +751,71 @@ CmCleanupAndExit (
{
FlDeleteFile (ASL_FILE_SOURCE_OUTPUT);
}
/* Final cleanup after compiling one file */
CmDeleteCaches ();
}
/*******************************************************************************
*
* FUNCTION: CmDeleteCaches
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Delete all local cache buffer blocks
*
******************************************************************************/
void
CmDeleteCaches (
void)
{
UINT32 BufferCount;
ASL_CACHE_INFO *Next;
/* Parse Op cache */
BufferCount = 0;
while (Gbl_ParseOpCacheList)
{
Next = Gbl_ParseOpCacheList->Next;
ACPI_FREE (Gbl_ParseOpCacheList);
Gbl_ParseOpCacheList = Next;
BufferCount++;
}
DbgPrint (ASL_DEBUG_OUTPUT,
"%u ParseOps, Buffer size: %u ops (%u bytes), %u Buffers\n",
Gbl_ParseOpCount, ASL_PARSEOP_CACHE_SIZE,
(sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE), BufferCount);
Gbl_ParseOpCount = 0;
Gbl_ParseOpCacheNext = NULL;
Gbl_ParseOpCacheLast = NULL;
RootNode = NULL;
/* Generic string cache */
BufferCount = 0;
while (Gbl_StringCacheList)
{
Next = Gbl_StringCacheList->Next;
ACPI_FREE (Gbl_StringCacheList);
Gbl_StringCacheList = Next;
BufferCount++;
}
DbgPrint (ASL_DEBUG_OUTPUT,
"%u Strings (%u bytes), Buffer size: %u bytes, %u Buffers\n",
Gbl_StringCount, Gbl_StringSize, ASL_STRING_CACHE_SIZE, BufferCount);
Gbl_StringSize = 0;
Gbl_StringCount = 0;
Gbl_StringCacheNext = NULL;
Gbl_StringCacheLast = NULL;
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef __ASLCOMPILER_H
#define __ASLCOMPILER_H
@ -111,6 +110,11 @@ AslPushInputFileStack (
FILE *InputFile,
char *Filename);
void
AslParserCleanup (
void);
/*
* aslstartup - entered from main()
*/
@ -122,11 +126,6 @@ typedef
ACPI_STATUS (*ASL_PATHNAME_CALLBACK) (
char *);
ACPI_STATUS
AslDoOnePathname (
char *Pathname,
ASL_PATHNAME_CALLBACK Callback);
ACPI_STATUS
AslDoOneFile (
char *Filename);
@ -159,6 +158,14 @@ void
CmCleanupAndExit (
void);
void
CmDeleteCaches (
void);
/*
* aslascii - ascii support
*/
ACPI_STATUS
FlCheckForAcpiTable (
FILE *Handle);
@ -280,14 +287,23 @@ void
ApCheckRegMethod (
ACPI_PARSE_OBJECT *Op);
BOOLEAN
ApFindNameInScope (
char *Name,
ACPI_PARSE_OBJECT *Op);
/*
* aslerror - error handling/reporting
*/
void
AslAbort (
void);
void
AslError (
UINT8 Level,
UINT8 MessageId,
UINT16 MessageId,
ACPI_PARSE_OBJECT *Op,
char *ExtraMessage);
@ -298,7 +314,7 @@ AslDisableException (
BOOLEAN
AslIsExceptionDisabled (
UINT8 Level,
UINT8 MessageId);
UINT16 MessageId);
void
AslCoreSubsystemError (
@ -314,7 +330,7 @@ AslCompilererror(
void
AslCommonError (
UINT8 Level,
UINT8 MessageId,
UINT16 MessageId,
UINT32 CurrentLineNumber,
UINT32 LogicalLineNumber,
UINT32 LogicalByteOffset,
@ -325,7 +341,7 @@ AslCommonError (
void
AslCommonError2 (
UINT8 Level,
UINT8 MessageId,
UINT16 MessageId,
UINT32 LineNumber,
UINT32 Column,
char *SourceLine,
@ -346,10 +362,6 @@ void
AeClearErrorLog (
void);
ACPI_PHYSICAL_ADDRESS
AeLocalGetRootPointer (
void);
/*
* asllisting - generate all "listing" type files
@ -439,6 +451,22 @@ OpcAmlConstantWalk (
void *Context);
/*
* aslmessages - exception strings
*/
const char *
AeDecodeMessageId (
UINT16 MessageId);
const char *
AeDecodeExceptionLevel (
UINT8 Level);
UINT16
AeBuildFullExceptionCode (
UINT8 Level,
UINT16 MessageId);
/*
* asloffset - generate C offset file for BIOS support
*/
@ -514,6 +542,27 @@ OptOptimizeNamePath (
ACPI_NAMESPACE_NODE *TargetNode);
/*
* aslprintf - Printf/Fprintf macros
*/
void
OpcDoPrintf (
ACPI_PARSE_OBJECT *Op);
void
OpcDoFprintf (
ACPI_PARSE_OBJECT *Op);
/*
* aslprune - parse tree pruner
*/
void
AslPruneParseTree (
UINT32 PruneDepth,
UINT32 Type);
/*
* aslcodegen - code generation
*/
@ -655,6 +704,16 @@ ACPI_PARSE_OBJECT *
TrCreateLeafNode (
UINT32 ParseOpcode);
ACPI_PARSE_OBJECT *
TrCreateAssignmentNode (
ACPI_PARSE_OBJECT *Target,
ACPI_PARSE_OBJECT *Source);
ACPI_PARSE_OBJECT *
TrCreateTargetOperand (
ACPI_PARSE_OBJECT *OriginalOp,
ACPI_PARSE_OBJECT *ParentOp);
ACPI_PARSE_OBJECT *
TrCreateValuedLeafNode (
UINT32 ParseOpcode,
@ -708,10 +767,6 @@ TrLinkPeerNodes (
* aslfiles - File I/O support
*/
void
AslAbort (
void);
void
FlAddIncludeDirectory (
char *Dir);
@ -784,6 +839,13 @@ ACPI_STATUS
FlOpenMiscOutputFiles (
char *InputFilename);
/*
* aslhwmap - hardware map summary
*/
void
MpEmitMappingInfo (
void);
/*
* asload - load namespace in prep for cross reference
@ -883,10 +945,6 @@ void
UtDisplaySummary (
UINT32 FileId);
UINT8
UtHexCharToValue (
int HexChar);
void
UtConvertByteToHex (
UINT8 RawByte,
@ -906,13 +964,17 @@ UtSetParseOpName (
ACPI_PARSE_OBJECT *Op);
char *
UtGetStringBuffer (
UtStringCacheCalloc (
UINT32 Length);
void
UtExpandLineBuffers (
void);
void
UtFreeLineBuffers (
void);
ACPI_STATUS
UtInternalizeName (
char *ExternalName,
@ -947,11 +1009,6 @@ ACPI_STATUS
AuValidateUuid (
char *InString);
ACPI_STATUS
AuConvertStringToUuid (
char *InString,
char *UuIdBuffer);
ACPI_STATUS
AuConvertUuidToString (
char *UuIdBuffer,
@ -1026,8 +1083,7 @@ RsCheckListForDuplicates (
ASL_RESOURCE_NODE *
RsDoOneResourceDescriptor (
ACPI_PARSE_OBJECT *DescriptorTypeOp,
UINT32 CurrentByteOffset,
ASL_RESOURCE_INFO *Info,
UINT8 *State);
/* Values for State above */
@ -1051,43 +1107,35 @@ RsDoResourceTemplate (
*/
ASL_RESOURCE_NODE *
RsDoEndTagDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoEndDependentDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoMemory24Descriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoMemory32Descriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoMemory32FixedDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoStartDependentDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoStartDependentNoPriDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoVendorSmallDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
/*
@ -1095,33 +1143,27 @@ RsDoVendorSmallDescriptor (
*/
ASL_RESOURCE_NODE *
RsDoDmaDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoFixedDmaDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoFixedIoDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoIoDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoIrqDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoIrqNoFlagsDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
/*
@ -1129,61 +1171,50 @@ RsDoIrqNoFlagsDescriptor (
*/
ASL_RESOURCE_NODE *
RsDoInterruptDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoVendorLargeDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoGeneralRegisterDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoGpioIntDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoGpioIoDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoI2cSerialBusDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoSpiSerialBusDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoUartSerialBusDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
/*
* aslrestype2d - DWord address descriptors
*/
ASL_RESOURCE_NODE *
RsDoDwordIoDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoDwordMemoryDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoDwordSpaceDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
/*
@ -1191,18 +1222,15 @@ RsDoDwordSpaceDescriptor (
*/
ASL_RESOURCE_NODE *
RsDoExtendedIoDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoExtendedMemoryDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoExtendedSpaceDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
/*
@ -1210,18 +1238,15 @@ RsDoExtendedSpaceDescriptor (
*/
ASL_RESOURCE_NODE *
RsDoQwordIoDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoQwordMemoryDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoQwordSpaceDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
/*
@ -1229,18 +1254,16 @@ RsDoQwordSpaceDescriptor (
*/
ASL_RESOURCE_NODE *
RsDoWordIoDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoWordSpaceDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
ASL_RESOURCE_NODE *
RsDoWordBusNumberDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
ASL_RESOURCE_INFO *Info);
/*
* Entry to data table compiler subsystem

View File

@ -6,7 +6,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -110,13 +110,56 @@ NamePathTail [.]{NameSeg}
[ \t] { count (0); }
"/*" { if (!AslDoComment ()) yyterminate (); }
"//" { if (!AslDoCommentType2 ()) yyterminate (); }
"/*" { if (!AslDoComment ()) {yyterminate ();} }
"//" { if (!AslDoCommentType2 ()) {yyterminate ();} }
"\"" { if (AslDoStringLiteral ()) return (PARSEOP_STRING_LITERAL); else yyterminate (); }
"\"" { if (AslDoStringLiteral ()) {return (PARSEOP_STRING_LITERAL);}
else {yyterminate ();} }
";" { count (0); return(';'); }
/* ASL Extension: Standard C operators */
"~" { count (3); return (PARSEOP_EXP_NOT); }
"!" { count (3); return (PARSEOP_EXP_LOGICAL_NOT); }
"*" { count (3); return (PARSEOP_EXP_MULTIPLY); }
"/" { count (3); return (PARSEOP_EXP_DIVIDE); }
"%" { count (3); return (PARSEOP_EXP_MODULO); }
"+" { count (3); return (PARSEOP_EXP_ADD); }
"-" { count (3); return (PARSEOP_EXP_SUBTRACT); }
">>" { count (3); return (PARSEOP_EXP_SHIFT_RIGHT); }
"<<" { count (3); return (PARSEOP_EXP_SHIFT_LEFT); }
"<" { count (3); return (PARSEOP_EXP_LESS); }
">" { count (3); return (PARSEOP_EXP_GREATER); }
"&" { count (3); return (PARSEOP_EXP_AND); }
"<=" { count (3); return (PARSEOP_EXP_LESS_EQUAL); }
">=" { count (3); return (PARSEOP_EXP_GREATER_EQUAL); }
"==" { count (3); return (PARSEOP_EXP_EQUAL); }
"!=" { count (3); return (PARSEOP_EXP_NOT_EQUAL); }
"|" { count (3); return (PARSEOP_EXP_OR); }
"&&" { count (3); return (PARSEOP_EXP_LOGICAL_AND); }
"||" { count (3); return (PARSEOP_EXP_LOGICAL_OR); }
"++" { count (3); return (PARSEOP_EXP_INCREMENT); }
"--" { count (3); return (PARSEOP_EXP_DECREMENT); }
"^ " { count (3); return (PARSEOP_EXP_XOR); }
/* ASL Extension: Standard C assignment operators */
"=" { count (3); return (PARSEOP_EXP_EQUALS); }
"+=" { count (3); return (PARSEOP_EXP_ADD_EQ); }
"-=" { count (3); return (PARSEOP_EXP_SUB_EQ); }
"*=" { count (3); return (PARSEOP_EXP_MUL_EQ); }
"/=" { count (3); return (PARSEOP_EXP_DIV_EQ); }
"%=" { count (3); return (PARSEOP_EXP_MOD_EQ); }
"<<=" { count (3); return (PARSEOP_EXP_SHL_EQ); }
">>=" { count (3); return (PARSEOP_EXP_SHR_EQ); }
"&=" { count (3); return (PARSEOP_EXP_AND_EQ); }
"^=" { count (3); return (PARSEOP_EXP_XOR_EQ); }
"|=" { count (3); return (PARSEOP_EXP_OR_EQ); }
/*
* Begin standard ASL grammar
*/
0[xX]{HexDigitChar}+ |
{DigitChar}+ { AslCompilerlval.i = UtDoConstant ((char *) AslCompilertext);
count (1); return (PARSEOP_INTEGER); }
@ -591,6 +634,44 @@ NamePathTail [.]{NameSeg}
"Transfer8_16" { count (0); return (PARSEOP_XFERTYPE_8_16); }
"Transfer16" { count (0); return (PARSEOP_XFERTYPE_16); }
/* ToPld macro */
"ToPLD" { count (0); return (PARSEOP_TOPLD); }
"PLD_Revision" { count (0); return (PARSEOP_PLD_REVISION); }
"PLD_IgnoreColor" { count (0); return (PARSEOP_PLD_IGNORECOLOR); }
"PLD_Red" { count (0); return (PARSEOP_PLD_RED); }
"PLD_Green" { count (0); return (PARSEOP_PLD_GREEN); }
"PLD_Blue" { count (0); return (PARSEOP_PLD_BLUE); }
"PLD_Width" { count (0); return (PARSEOP_PLD_WIDTH); }
"PLD_Height" { count (0); return (PARSEOP_PLD_HEIGHT); }
"PLD_UserVisible" { count (0); return (PARSEOP_PLD_USERVISIBLE); }
"PLD_Dock" { count (0); return (PARSEOP_PLD_DOCK); }
"PLD_Lid" { count (0); return (PARSEOP_PLD_LID); }
"PLD_Panel" { count (0); return (PARSEOP_PLD_PANEL); }
"PLD_VerticalPosition" { count (0); return (PARSEOP_PLD_VERTICALPOSITION); }
"PLD_HorizontalPosition" { count (0); return (PARSEOP_PLD_HORIZONTALPOSITION); }
"PLD_Shape" { count (0); return (PARSEOP_PLD_SHAPE); }
"PLD_GroupOrientation" { count (0); return (PARSEOP_PLD_GROUPORIENTATION); }
"PLD_GroupToken" { count (0); return (PARSEOP_PLD_GROUPTOKEN); }
"PLD_GroupPosition" { count (0); return (PARSEOP_PLD_GROUPPOSITION); }
"PLD_Bay" { count (0); return (PARSEOP_PLD_BAY); }
"PLD_Ejectable" { count (0); return (PARSEOP_PLD_EJECTABLE); }
"PLD_EjectRequired" { count (0); return (PARSEOP_PLD_EJECTREQUIRED); }
"PLD_CabinetNumber" { count (0); return (PARSEOP_PLD_CABINETNUMBER); }
"PLD_CardCageNumber" { count (0); return (PARSEOP_PLD_CARDCAGENUMBER); }
"PLD_Reference" { count (0); return (PARSEOP_PLD_REFERENCE); }
"PLD_Rotation" { count (0); return (PARSEOP_PLD_ROTATION); }
"PLD_Order" { count (0); return (PARSEOP_PLD_ORDER); }
"PLD_Reserved" { count (0); return (PARSEOP_PLD_RESERVED); }
"PLD_VerticalOffset" { count (0); return (PARSEOP_PLD_VERTICALOFFSET); }
"PLD_HorizontalOffset" { count (0); return (PARSEOP_PLD_HORIZONTALOFFSET); }
/* printf debug macros */
"printf" { count (0); return (PARSEOP_PRINTF); }
"fprintf" { count (0); return (PARSEOP_FPRINTF); }
/* Predefined compiler names */
"__DATE__" { count (0); return (PARSEOP___DATE__); }
@ -607,7 +688,7 @@ NamePathTail [.]{NameSeg}
{NameSeg} { char *s;
count (0);
s=malloc (ACPI_NAME_SIZE + 1);
s=UtStringCacheCalloc (ACPI_NAME_SIZE + 1);
if (strcmp (AslCompilertext, "\\"))
{
strcpy (s, "____");
@ -620,18 +701,13 @@ NamePathTail [.]{NameSeg}
{NameString} { char *s;
count (0);
s=malloc (strlen (AslCompilertext)+1);
s=UtStringCacheCalloc (strlen (AslCompilertext)+1);
AcpiUtStrupr (AslCompilertext);
strcpy (s, AslCompilertext);
s[strlen (AslCompilertext)] = 0;
AslCompilerlval.s = s;
DbgPrint (ASL_PARSE_OUTPUT, "NameString: %s\n", s);
return (PARSEOP_NAMESTRING); }
"*" |
"/" { count (1);
AslCompilererror ("Parse error, expecting ASL keyword or name");}
. { count (1);
sprintf (MsgBuffer,
"Invalid character (0x%2.2X), expecting ASL keyword or name",
@ -639,9 +715,9 @@ NamePathTail [.]{NameSeg}
AslCompilererror (MsgBuffer);}
<<EOF>> { if (AslPopInputFileStack ())
yyterminate();
{yyterminate();}
else
return (PARSEOP_INCLUDE_END);};
{return (PARSEOP_INCLUDE_END);} };
%%

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef __ASLDEFINE_H
#define __ASLDEFINE_H
@ -50,19 +49,19 @@
* Compiler versions and names
*/
#define ASL_REVISION ACPI_CA_VERSION
#define ASL_COMPILER_NAME "ASL Optimizing Compiler"
#define AML_DISASSEMBLER_NAME "AML Disassembler"
#define ASL_COMPILER_NAME "ASL+ Optimizing Compiler"
#define AML_DISASSEMBLER_NAME "AML/ASL+ Disassembler"
#define ASL_INVOCATION_NAME "iasl"
#define ASL_CREATOR_ID "INTL"
#define ASL_COMPLIANCE "Supports ACPI Specification Revision 5.0"
#define ASL_COMPLIANCE "Supports ACPI Specification Revision 5.1"
/* Configuration constants */
#define ASL_MAX_ERROR_COUNT 200
#define ASL_NODE_CACHE_SIZE 1024
#define ASL_STRING_CACHE_SIZE 32768
#define ASL_PARSEOP_CACHE_SIZE (1024 * 16)
#define ASL_STRING_CACHE_SIZE (1024 * 64)
#define ASL_FIRST_PARSE_OPCODE PARSEOP_ACCESSAS
#define ASL_PARSE_OPCODE_BASE PARSEOP_ACCESSAS /* First Lex type */
@ -109,6 +108,7 @@
#define FILE_SUFFIX_PREPROCESSOR "i"
#define FILE_SUFFIX_AML_CODE "aml"
#define FILE_SUFFIX_MAP "map"
#define FILE_SUFFIX_LISTING "lst"
#define FILE_SUFFIX_HEX_DUMP "hex"
#define FILE_SUFFIX_DEBUG "txt"

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#define ASL_EXCEPTIONS
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#define _COMPONENT ACPI_COMPILER
@ -54,6 +53,36 @@ AeAddToErrorLog (
ASL_ERROR_MSG *Enode);
/*******************************************************************************
*
* FUNCTION: AslAbort
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Dump the error log and abort the compiler. Used for serious
* I/O errors.
*
******************************************************************************/
void
AslAbort (
void)
{
AePrintErrorLog (ASL_FILE_STDERR);
if (Gbl_DebugFlag)
{
/* Print error summary to stdout also */
AePrintErrorLog (ASL_FILE_STDOUT);
}
exit (1);
}
/*******************************************************************************
*
* FUNCTION: AeClearErrorLog
@ -174,7 +203,7 @@ AePrintException (
int Actual;
size_t RActual;
UINT32 MsgLength;
char *MainMessage;
const char *MainMessage;
char *ExtraMessage;
UINT32 SourceColumn;
UINT32 ErrorColumn;
@ -200,6 +229,16 @@ AePrintException (
switch (Enode->Level)
{
case ASL_WARNING:
case ASL_WARNING2:
case ASL_WARNING3:
if (!Gbl_DisplayWarnings)
{
return;
}
break;
case ASL_REMARK:
if (!Gbl_DisplayRemarks)
@ -222,11 +261,10 @@ AePrintException (
}
}
/* Get the file handles */
/* Get the various required file handles */
OutputFile = Gbl_Files[FileId].Handle;
if (!Enode->SourceLine)
{
/* Use the merged header/source file if present, otherwise use input file */
@ -360,110 +398,94 @@ AePrintException (
}
}
/* NULL message ID, just print the raw message */
/* If a NULL message ID, just print the raw message */
if (Enode->MessageId == 0)
{
fprintf (OutputFile, "%s\n", Enode->Message);
return;
}
else
/* Decode the message ID */
fprintf (OutputFile, "%s %4.4d -",
AeDecodeExceptionLevel (Enode->Level),
AeBuildFullExceptionCode (Enode->Level, Enode->MessageId));
MainMessage = AeDecodeMessageId (Enode->MessageId);
ExtraMessage = Enode->Message;
/* If a NULL line number, just print the decoded message */
if (!Enode->LineNumber)
{
/* Decode the message ID */
fprintf (OutputFile, " %s %s\n\n", MainMessage, ExtraMessage);
return;
}
if (Gbl_VerboseErrors)
MsgLength = strlen (MainMessage);
if (MsgLength == 0)
{
/* Use the secondary/extra message as main message */
MainMessage = Enode->Message;
if (!MainMessage)
{
fprintf (OutputFile, "%s %4.4d -",
AslErrorLevel[Enode->Level],
Enode->MessageId + ((Enode->Level+1) * 1000));
}
else /* IDE case */
{
fprintf (OutputFile, "%s %4.4d:",
AslErrorLevelIde[Enode->Level],
Enode->MessageId + ((Enode->Level+1) * 1000));
MainMessage = "";
}
MainMessage = AslMessages[Enode->MessageId];
ExtraMessage = Enode->Message;
MsgLength = strlen (MainMessage);
ExtraMessage = NULL;
}
if (Enode->LineNumber)
if (Gbl_VerboseErrors && !PrematureEOF)
{
if (Total >= 256)
{
/* Main message: try to use string from AslMessages first */
if (!MainMessage)
{
MainMessage = "";
}
MsgLength = strlen (MainMessage);
if (MsgLength == 0)
{
/* Use the secondary/extra message as main message */
MainMessage = Enode->Message;
if (!MainMessage)
{
MainMessage = "";
}
MsgLength = strlen (MainMessage);
ExtraMessage = NULL;
}
if (Gbl_VerboseErrors && !PrematureEOF)
{
if (Total >= 256)
{
fprintf (OutputFile, " %s",
MainMessage);
}
else
{
SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2;
ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1;
if ((MsgLength + ErrorColumn) < (SourceColumn - 1))
{
fprintf (OutputFile, "%*s%s",
(int) ((SourceColumn - 1) - ErrorColumn),
MainMessage, " ^ ");
}
else
{
fprintf (OutputFile, "%*s %s",
(int) ((SourceColumn - ErrorColumn) + 1), "^",
MainMessage);
}
}
}
else
{
fprintf (OutputFile, " %s", MainMessage);
}
/* Print the extra info message if present */
if (ExtraMessage)
{
fprintf (OutputFile, " (%s)", ExtraMessage);
}
if (PrematureEOF)
{
fprintf (OutputFile, " and premature End-Of-File");
}
fprintf (OutputFile, "\n");
if (Gbl_VerboseErrors)
{
fprintf (OutputFile, "\n");
}
fprintf (OutputFile, " %s",
MainMessage);
}
else
{
fprintf (OutputFile, " %s %s\n\n", MainMessage, ExtraMessage);
SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2;
ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1;
if ((MsgLength + ErrorColumn) < (SourceColumn - 1))
{
fprintf (OutputFile, "%*s%s",
(int) ((SourceColumn - 1) - ErrorColumn),
MainMessage, " ^ ");
}
else
{
fprintf (OutputFile, "%*s %s",
(int) ((SourceColumn - ErrorColumn) + 1), "^",
MainMessage);
}
}
}
else
{
fprintf (OutputFile, " %s", MainMessage);
}
/* Print the extra info message if present */
if (ExtraMessage)
{
fprintf (OutputFile, " (%s)", ExtraMessage);
}
if (PrematureEOF)
{
fprintf (OutputFile, " and premature End-Of-File");
}
fprintf (OutputFile, "\n");
if (Gbl_VerboseErrors)
{
fprintf (OutputFile, "\n");
}
}
@ -517,7 +539,7 @@ AePrintErrorLog (
void
AslCommonError2 (
UINT8 Level,
UINT8 MessageId,
UINT16 MessageId,
UINT32 LineNumber,
UINT32 Column,
char *SourceLine,
@ -535,7 +557,7 @@ AslCommonError2 (
{
/* Allocate a buffer for the message and a new error node */
MessageBuffer = UtLocalCalloc (strlen (ExtraMessage) + 1);
MessageBuffer = UtStringCacheCalloc (strlen (ExtraMessage) + 1);
/* Keep a copy of the extra message */
@ -549,7 +571,7 @@ AslCommonError2 (
if (Filename)
{
Enode->Filename = Filename;
Enode->Filename = Filename;
Enode->FilenameLength = strlen (Filename);
if (Enode->FilenameLength < 6)
{
@ -603,7 +625,7 @@ AslCommonError2 (
void
AslCommonError (
UINT8 Level,
UINT8 MessageId,
UINT16 MessageId,
UINT32 CurrentLineNumber,
UINT32 LogicalLineNumber,
UINT32 LogicalByteOffset,
@ -611,7 +633,6 @@ AslCommonError (
char *Filename,
char *ExtraMessage)
{
UINT32 MessageSize;
char *MessageBuffer = NULL;
ASL_ERROR_MSG *Enode;
@ -622,8 +643,7 @@ AslCommonError (
{
/* Allocate a buffer for the message and a new error node */
MessageSize = strlen (ExtraMessage) + 1;
MessageBuffer = UtLocalCalloc (MessageSize);
MessageBuffer = UtStringCacheCalloc (strlen (ExtraMessage) + 1);
/* Keep a copy of the extra message */
@ -634,7 +654,7 @@ AslCommonError (
if (Filename)
{
Enode->Filename = Filename;
Enode->Filename = Filename;
Enode->FilenameLength = strlen (Filename);
if (Enode->FilenameLength < 6)
{
@ -739,7 +759,7 @@ AslDisableException (
BOOLEAN
AslIsExceptionDisabled (
UINT8 Level,
UINT8 MessageId)
UINT16 MessageId)
{
UINT32 EncodedMessageId;
UINT32 i;
@ -764,7 +784,7 @@ AslIsExceptionDisabled (
* Ignore this warning/remark if it has been disabled by
* the user (-vw option)
*/
EncodedMessageId = MessageId + ((Level + 1) * 1000);
EncodedMessageId = AeBuildFullExceptionCode (Level, MessageId);
for (i = 0; i < Gbl_DisabledMessagesIndex; i++)
{
/* Simple implementation via fixed array */
@ -803,14 +823,15 @@ AslIsExceptionDisabled (
void
AslError (
UINT8 Level,
UINT8 MessageId,
UINT16 MessageId,
ACPI_PARSE_OBJECT *Op,
char *ExtraMessage)
{
/* Check if user wants to ignore this exception */
if (AslIsExceptionDisabled (Level, MessageId))
if (Gbl_AllExceptionsDisabled ||
AslIsExceptionDisabled (Level, MessageId))
{
return;
}
@ -836,14 +857,14 @@ AslError (
* FUNCTION: AslCoreSubsystemError
*
* PARAMETERS: Op - Parse node where error happened
* Status - The ACPI CA Exception
* Status - The ACPICA Exception
* ExtraMessage - additional error message
* Abort - TRUE -> Abort compilation
*
* RETURN: None
*
* DESCRIPTION: Error reporting routine for exceptions returned by the ACPI
* CA core subsystem.
* DESCRIPTION: Error reporting routine for exceptions returned by the ACPICA
* core subsystem.
*
******************************************************************************/
@ -897,6 +918,8 @@ AslCompilererror (
const char *CompilerMessage)
{
Gbl_SyntaxError++;
AslCommonError (ASL_ERROR, ASL_MSG_SYNTAX, Gbl_CurrentLineNumber,
Gbl_LogicalLineNumber, Gbl_CurrentLineOffset,
Gbl_CurrentColumn, Gbl_Files[ASL_FILE_INPUT].Filename,

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -42,41 +42,12 @@
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/include/acapps.h>
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslfileio")
/*******************************************************************************
*
* FUNCTION: AslAbort
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Dump the error log and abort the compiler. Used for serious
* I/O errors.
*
******************************************************************************/
void
AslAbort (
void)
{
AePrintErrorLog (ASL_FILE_STDERR);
if (Gbl_DebugFlag)
{
/* Print error summary to stdout also */
AePrintErrorLog (ASL_FILE_STDOUT);
}
exit (1);
}
/*******************************************************************************
*
* FUNCTION: FlFileError
@ -97,8 +68,8 @@ FlFileError (
UINT8 ErrorId)
{
sprintf (MsgBuffer, "\"%s\" (%s)", Gbl_Files[FileId].Filename,
strerror (errno));
sprintf (MsgBuffer, "\"%s\" (%s) - %s", Gbl_Files[FileId].Filename,
Gbl_Files[FileId].Description, strerror (errno));
AslCommonError (ASL_ERROR, ErrorId, 0, 0, 0, 0, NULL, MsgBuffer);
}
@ -127,6 +98,9 @@ FlOpenFile (
FILE *File;
Gbl_Files[FileId].Filename = Filename;
Gbl_Files[FileId].Handle = NULL;
File = fopen (Filename, Mode);
if (!File)
{
@ -134,8 +108,7 @@ FlOpenFile (
AslAbort ();
}
Gbl_Files[FileId].Filename = Filename;
Gbl_Files[FileId].Handle = File;
Gbl_Files[FileId].Handle = File;
}
@ -147,7 +120,8 @@ FlOpenFile (
*
* RETURN: File Size
*
* DESCRIPTION: Get current file size. Uses seek-to-EOF. File must be open.
* DESCRIPTION: Get current file size. Uses common seek-to-EOF function.
* File must be open. Aborts compiler on error.
*
******************************************************************************/
@ -155,20 +129,15 @@ UINT32
FlGetFileSize (
UINT32 FileId)
{
FILE *fp;
UINT32 FileSize;
long Offset;
fp = Gbl_Files[FileId].Handle;
Offset = ftell (fp);
FileSize = CmGetFileSize (Gbl_Files[FileId].Handle);
if (FileSize == ACPI_UINT32_MAX)
{
AslAbort();
}
fseek (fp, 0, SEEK_END);
FileSize = (UINT32) ftell (fp);
/* Restore file pointer */
fseek (fp, Offset, SEEK_SET);
return (FileSize);
}
@ -352,6 +321,8 @@ FlCloseFile (
AslAbort ();
}
/* Do not clear/free the filename string */
Gbl_Files[FileId].Handle = NULL;
return;
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -107,6 +107,8 @@ FlSetFilename (
DbgPrint (ASL_PARSE_OUTPUT, "\n#line: New filename %s (old %s)\n",
Filename, Gbl_Files[ASL_FILE_INPUT].Filename);
/* No need to free any existing filename */
Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
}
@ -216,14 +218,14 @@ FlMergePathnames (
(*FilePathname == '/') ||
(FilePathname[1] == ':'))
{
Pathname = ACPI_ALLOCATE (strlen (FilePathname) + 1);
Pathname = UtStringCacheCalloc (strlen (FilePathname) + 1);
strcpy (Pathname, FilePathname);
goto ConvertBackslashes;
}
/* Need a local copy of the prefix directory path */
CommonPath = ACPI_ALLOCATE (strlen (PrefixDir) + 1);
CommonPath = UtStringCacheCalloc (strlen (PrefixDir) + 1);
strcpy (CommonPath, PrefixDir);
/*
@ -259,14 +261,13 @@ FlMergePathnames (
/* Build the final merged pathname */
ConcatenatePaths:
Pathname = ACPI_ALLOCATE_ZEROED (strlen (CommonPath) + strlen (FilePathname) + 2);
Pathname = UtStringCacheCalloc (strlen (CommonPath) + strlen (FilePathname) + 2);
if (LastElement && *CommonPath)
{
strcpy (Pathname, CommonPath);
strcat (Pathname, "/");
}
strcat (Pathname, FilePathname);
ACPI_FREE (CommonPath);
/* Convert all backslashes to normal slashes */
@ -484,6 +485,8 @@ FlOpenAmlOutputFile (
0, 0, 0, 0, NULL, NULL);
return (AE_ERROR);
}
Gbl_Files[ASL_FILE_AML_OUTPUT].Filename = Filename;
}
/* Open the output AML file in binary mode */
@ -562,9 +565,14 @@ FlOpenMiscOutputFiles (
if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle)
{
AslCommonError (ASL_ERROR, ASL_MSG_DEBUG_FILENAME,
0, 0, 0, 0, NULL, NULL);
return (AE_ERROR);
/*
* A problem with freopen is that on error,
* we no longer have stderr.
*/
Gbl_DebugFlag = FALSE;
memcpy (stderr, stdout, sizeof (FILE));
FlFileError (ASL_FILE_DEBUG_OUTPUT, ASL_MSG_DEBUG_FILENAME);
AslAbort ();
}
AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT);
@ -757,6 +765,26 @@ FlOpenMiscOutputFiles (
AslCompilerFileHeader (ASL_FILE_NAMESPACE_OUTPUT);
}
/* Create/Open a map file if requested */
if (Gbl_MapfileFlag)
{
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_MAP);
if (!Filename)
{
AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
0, 0, 0, 0, NULL, NULL);
return (AE_ERROR);
}
/* Open the hex file, text mode (closed at compiler exit) */
FlOpenFile (ASL_FILE_MAP_OUTPUT, Filename, "w+t");
AslCompilerSignon (ASL_FILE_MAP_OUTPUT);
AslCompilerFileHeader (ASL_FILE_MAP_OUTPUT);
}
return (AE_OK);
}
@ -824,6 +852,7 @@ FlParseInputPathname (
*(Substring+1) = 0;
}
UtConvertBackslashes (Gbl_OutputFilenamePrefix);
return (AE_OK);
}
#endif

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef __ASLGLOBAL_H
#define __ASLGLOBAL_H
@ -63,11 +62,6 @@
#ifdef _DECLARE_GLOBALS
UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0};
char AslHexLookup[] =
{
'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
};
/* Table below must match ASL_FILE_TYPES in asltypes.h */
@ -87,12 +81,12 @@ ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES] =
{NULL, NULL, "C Source: ", "C Code Output"},
{NULL, NULL, "ASM Include: ", "Assembly Header Output"},
{NULL, NULL, "C Include: ", "C Header Output"},
{NULL, NULL, "Offset Table: ", "C Offset Table Output"}
{NULL, NULL, "Offset Table: ", "C Offset Table Output"},
{NULL, NULL, "Device Map: ", "Device Map Output"}
};
#else
extern UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS];
extern char AslHexLookup[];
extern ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES];
#endif
@ -102,12 +96,20 @@ extern ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES];
*/
extern int yydebug;
extern FILE *AslCompilerin;
extern int AslCompilerdebug;
extern int DtParserdebug;
extern int PrParserdebug;
extern const ASL_MAPPING_ENTRY AslKeywordMapping[];
extern char *AslCompilertext;
/*
* Older versions of Bison won't emit this external in the generated header.
* Newer versions do emit the external, so we don't need to do it.
*/
#ifndef ASLCOMPILER_ASLCOMPILERPARSE_H
extern int AslCompilerdebug;
#endif
#define ASL_DEFAULT_LINE_BUFFER_SIZE (1024 * 32) /* 32K */
#define ASL_MSG_BUFFER_SIZE 4096
#define ASL_MAX_DISABLED_MESSAGES 32
@ -125,6 +127,7 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_PreviousLineNumber, 0);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineNumber, 1);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_LogicalLineNumber, 1);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineOffset, 0);
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_SyntaxError, 0);
/* Exception reporting */
@ -140,6 +143,7 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessFlag, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisassembleAll, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseDefaultAmlFilename, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_MapfileFlag, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NsOutputFlag, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessorOutputFlag, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DebugFlag, FALSE);
@ -159,16 +163,18 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoErrors, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_WarningsAsErrors, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoResourceChecking, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisasmFlag, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_GetAllTables, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_IntegerOptimizationFlag, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ReferenceOptimizationFlag, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayRemarks, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayWarnings, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayOptimizations, FALSE);
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_WarningLevel, ASL_WARNING);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseOriginalCompilerId, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseTemplates, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoTemplates, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileGeneric, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AllExceptionsDisabled, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PruneParseTree, FALSE);
#define HEX_OUTPUT_NONE 0
@ -206,6 +212,25 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalAllocated, 0);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalFolds, 0);
/* Local caches */
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ParseOpCount, 0);
ASL_EXTERN ASL_CACHE_INFO ASL_INIT_GLOBAL (*Gbl_ParseOpCacheList, NULL);
ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_ParseOpCacheNext, NULL);
ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_ParseOpCacheLast, NULL);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_StringCount, 0);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_StringSize, 0);
ASL_EXTERN ASL_CACHE_INFO ASL_INIT_GLOBAL (*Gbl_StringCacheList, NULL);
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheNext, NULL);
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheLast, NULL);
/* Map file */
ASL_EXTERN ACPI_GPIO_INFO ASL_INIT_GLOBAL (*Gbl_GpioList, NULL);
ASL_EXTERN ACPI_SERIAL_INFO ASL_INIT_GLOBAL (*Gbl_SerialList, NULL);
/* Misc */
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_RevisionOverride, 0);
@ -214,10 +239,6 @@ ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*RootNode, NULL);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_TableLength, 0);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_SourceLine, 0);
ASL_EXTERN ASL_LISTING_NODE ASL_INIT_GLOBAL (*Gbl_ListingNode, NULL);
ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_NodeCacheNext, NULL);
ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_NodeCacheLast, NULL);
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheNext, NULL);
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheLast, NULL);
ASL_EXTERN ACPI_PARSE_OBJECT *Gbl_FirstLevelInsertionNode;
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_FileType, 0);
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_Signature, NULL);
@ -232,7 +253,8 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_NumNamespaceObjects, 0)
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ReservedMethods, 0);
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableSignature, "NO_SIG");
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableId, "NO_ID");
ASL_EXTERN FILE *AcpiGbl_DebugFile; /* Placeholder for oswinxf only */
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_PruneDepth, 0);
ASL_EXTERN UINT16 ASL_INIT_GLOBAL (Gbl_PruneType, 0);
/* Static structures */

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#define _COMPONENT ACPI_COMPILER

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#define __ASLLOAD_C__
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/include/amlcode.h>
#include <contrib/dev/acpica/include/acdispat.h>
@ -129,6 +127,7 @@ LdLoadNamespace (
/* Dump the namespace if debug is enabled */
AcpiNsDumpTables (ACPI_NS_ALL, ACPI_UINT32_MAX);
ACPI_FREE (WalkState);
return (AE_OK);
}
@ -359,7 +358,6 @@ LdNamespace1Begin (
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op %p [%s]\n",
Op, Op->Asl.ParseOpName));
/*
* We are only interested in opcodes that have an associated name
* (or multiple names)
@ -373,6 +371,34 @@ LdNamespace1Begin (
Status = LdLoadFieldElements (Op, WalkState);
return (Status);
case AML_INT_CONNECTION_OP:
if (Op->Asl.Child->Asl.AmlOpcode != AML_INT_NAMEPATH_OP)
{
break;
}
Arg = Op->Asl.Child;
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Asl.ExternalName,
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
WalkState, &Node);
if (ACPI_FAILURE (Status))
{
break;
}
if (Node->Type == ACPI_TYPE_BUFFER)
{
Arg->Asl.Node = Node;
Arg = Node->Op->Asl.Child; /* Get namepath */
Arg = Arg->Asl.Next; /* Get actual buffer */
Arg = Arg->Asl.Child; /* Buffer length */
Arg = Arg->Asl.Next; /* RAW_DATA buffer */
}
break;
default:
/* All other opcodes go below */
@ -466,7 +492,6 @@ LdNamespace1Begin (
ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
break;
case PARSEOP_SCOPE:
/*
* The name referenced by Scope(Name) must already exist at this point.

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acparser.h>
@ -105,7 +104,9 @@ LkFindUnreferencedObjects (
* DESCRIPTION: Check for an unreferenced namespace object and emit a warning.
* We have to be careful, because some types and names are
* typically or always unreferenced, we don't want to issue
* excessive warnings.
* excessive warnings. Note: Names that are declared within a
* control method are temporary, so we always issue a remark
* if they are not referenced.
*
******************************************************************************/
@ -117,6 +118,7 @@ LkIsObjectUsed (
void **ReturnValue)
{
ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
ACPI_NAMESPACE_NODE *Next;
/* Referenced flag is set during the namespace xref */
@ -126,23 +128,19 @@ LkIsObjectUsed (
return (AE_OK);
}
/*
* Ignore names that start with an underscore,
* these are the reserved ACPI names and are typically not referenced,
* they are called by the host OS.
*/
if (Node->Name.Ascii[0] == '_')
if (!Node->Op)
{
return (AE_OK);
}
/* There are some types that are typically not referenced, ignore them */
/* These types are typically never directly referenced, ignore them */
switch (Node->Type)
{
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_PROCESSOR:
case ACPI_TYPE_POWER:
case ACPI_TYPE_THERMAL:
case ACPI_TYPE_LOCAL_RESOURCE:
return (AE_OK);
@ -152,12 +150,47 @@ LkIsObjectUsed (
break;
}
/* All others are valid unreferenced namespace objects */
/* Determine if the name is within a control method */
if (Node->Op)
Next = Node->Parent;
while (Next)
{
AslError (ASL_WARNING2, ASL_MSG_NOT_REFERENCED, LkGetNameOp (Node->Op), NULL);
if (Next->Type == ACPI_TYPE_METHOD)
{
/*
* Name is within a method, therefore it is temporary.
* Issue a remark even if it is a reserved name (starts
* with an underscore).
*/
sprintf (MsgBuffer, "Name is within method [%4.4s]",
Next->Name.Ascii);
AslError (ASL_REMARK, ASL_MSG_NOT_REFERENCED,
LkGetNameOp (Node->Op), MsgBuffer);
return (AE_OK);
}
Next = Next->Parent;
}
/* The name is not within a control method */
/*
* Ignore names that start with an underscore. These are the reserved
* ACPI names and are typically not referenced since they are meant
* to be called by the host OS.
*/
if (Node->Name.Ascii[0] == '_')
{
return (AE_OK);
}
/*
* What remains is an unresolved user name that is not within a method.
* However, the object could be referenced via another table, so issue
* the warning at level 2.
*/
AslError (ASL_WARNING2, ASL_MSG_NOT_REFERENCED,
LkGetNameOp (Node->Op), NULL);
return (AE_OK);
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -51,6 +51,17 @@
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslmain")
/*
* Main routine for the iASL compiler.
*
* Portability note: The compiler depends upon the host for command-line
* wildcard support - it is not implemented locally. For example:
*
* Linux/Unix systems: Shell expands wildcards automatically.
*
* Windows: The setargv.obj module must be linked in to automatically
* expand wildcards.
*/
/* Local prototypes */
@ -62,6 +73,36 @@ static void
AslInitialize (
void);
UINT8
AcpiIsBigEndianMachine (
void);
/*******************************************************************************
*
* FUNCTION: AcpiIsBigEndianMachine
*
* PARAMETERS: None
*
* RETURN: TRUE if machine is big endian
* FALSE if machine is little endian
*
* DESCRIPTION: Detect whether machine is little endian or big endian.
*
******************************************************************************/
UINT8
AcpiIsBigEndianMachine (
void)
{
union {
UINT32 Integer;
UINT8 Bytes[4];
} Overlay = {0xFF000000};
return (Overlay.Bytes[0]); /* Returns 0xFF (TRUE) for big endian */
}
/*******************************************************************************
*
@ -83,11 +124,21 @@ Usage (
printf ("%s\n\n", ASL_COMPLIANCE);
ACPI_USAGE_HEADER ("iasl [Options] [Files]");
printf ("\nGlobal:\n");
printf ("\nGeneral:\n");
ACPI_OPTION ("-@ <file>", "Specify command file");
ACPI_OPTION ("-I <dir>", "Specify additional include directory");
ACPI_OPTION ("-T <sig>|ALL|*", "Create table template file for ACPI <Sig>");
ACPI_OPTION ("-p <prefix>", "Specify path/filename prefix for all output files");
ACPI_OPTION ("-v", "Display compiler version");
ACPI_OPTION ("-vo", "Enable optimization comments");
ACPI_OPTION ("-vs", "Disable signon");
printf ("\nHelp:\n");
ACPI_OPTION ("-h", "This message");
ACPI_OPTION ("-hc", "Display operators allowed in constant expressions");
ACPI_OPTION ("-hf", "Display help for output filename generation");
ACPI_OPTION ("-hr", "Display ACPI reserved method names");
ACPI_OPTION ("-ht", "Display currently supported ACPI table names");
printf ("\nPreprocessor:\n");
ACPI_OPTION ("-D <symbol>", "Define symbol for preprocessor use");
@ -95,13 +146,11 @@ Usage (
ACPI_OPTION ("-P", "Preprocess only and create preprocessor output file (*.i)");
ACPI_OPTION ("-Pn", "Disable preprocessor");
printf ("\nGeneral Processing:\n");
ACPI_OPTION ("-p <prefix>", "Specify path/filename prefix for all output files");
ACPI_OPTION ("-va", "Disable all errors and warnings (summary only)");
printf ("\nErrors, Warnings, and Remarks:\n");
ACPI_OPTION ("-va", "Disable all errors/warnings/remarks");
ACPI_OPTION ("-ve", "Report only errors (ignore warnings and remarks)");
ACPI_OPTION ("-vi", "Less verbose errors and warnings for use with IDEs");
ACPI_OPTION ("-vo", "Enable optimization comments");
ACPI_OPTION ("-vr", "Disable remarks");
ACPI_OPTION ("-vs", "Disable signon");
ACPI_OPTION ("-vw <messageid>", "Disable specific warning or remark");
ACPI_OPTION ("-w1 -w2 -w3", "Set warning reporting level");
ACPI_OPTION ("-we", "Report warnings as errors");
@ -123,6 +172,7 @@ Usage (
printf ("\nOptional Listing Files:\n");
ACPI_OPTION ("-l", "Create mixed listing file (ASL source and AML) (*.lst)");
ACPI_OPTION ("-lm", "Create hardware summary map file (*.map)");
ACPI_OPTION ("-ln", "Create namespace file (*.nsp)");
ACPI_OPTION ("-ls", "Create combined source file (expanded includes) (*.src)");
@ -131,27 +181,23 @@ Usage (
ACPI_OPTION ("-vt", "Create verbose template files (full disassembly)");
printf ("\nAML Disassembler:\n");
ACPI_OPTION ("-d <f1,f2>", "Disassemble or decode binary ACPI tables to file (*.dsl)");
ACPI_OPTION ("-d <f1 f2 ...>", "Disassemble or decode binary ACPI tables to file (*.dsl)");
ACPI_OPTION ("", " (Optional, file type is automatically detected)");
ACPI_OPTION ("-da <f1,f2>", "Disassemble multiple tables from single namespace");
ACPI_OPTION ("-da <f1 f2 ...>", "Disassemble multiple tables from single namespace");
ACPI_OPTION ("-db", "Do not translate Buffers to Resource Templates");
ACPI_OPTION ("-dc <f1,f2>", "Disassemble AML and immediately compile it");
ACPI_OPTION ("-dc <f1 f2 ...>", "Disassemble AML and immediately compile it");
ACPI_OPTION ("", " (Obtain DSDT from current system if no input file)");
ACPI_OPTION ("-e <f1,f2>", "Include ACPI table(s) for external symbol resolution");
ACPI_OPTION ("-dl", "Emit legacy ASL code only (no C-style operators)");
ACPI_OPTION ("-e <f1 f2 ...>", "Include ACPI table(s) for external symbol resolution");
ACPI_OPTION ("-fe <file>", "Specify external symbol declaration file");
ACPI_OPTION ("-g", "Get ACPI tables and write to files (*.dat)");
ACPI_OPTION ("-in", "Ignore NoOp opcodes");
ACPI_OPTION ("-vt", "Dump binary table data in hex format within output file");
printf ("\nHelp:\n");
ACPI_OPTION ("-h", "This message");
ACPI_OPTION ("-hc", "Display operators allowed in constant expressions");
ACPI_OPTION ("-hf", "Display help for output filename generation");
ACPI_OPTION ("-hr", "Display ACPI reserved method names");
ACPI_OPTION ("-ht", "Display currently supported ACPI table names");
printf ("\nDebug Options:\n");
ACPI_OPTION ("-bf -bt", "Create debug file (full or parse tree only) (*.txt)");
ACPI_OPTION ("-bf", "Create debug file (full output) (*.txt)");
ACPI_OPTION ("-bs", "Create debug file (parse tree only) (*.txt)");
ACPI_OPTION ("-bp <depth>", "Prune ASL parse tree");
ACPI_OPTION ("-bt <type>", "Object type to be pruned from the parse tree");
ACPI_OPTION ("-f", "Ignore errors, force creation of AML output file(s)");
ACPI_OPTION ("-m <size>", "Set internal line buffer size (in Kbytes)");
ACPI_OPTION ("-n", "Parse only, no output generation");
@ -286,8 +332,22 @@ main (
ACPI_STATUS Status;
int Index1;
int Index2;
int ReturnStatus = 0;
/*
* Big-endian machines are not currently supported. ACPI tables must
* be little-endian, and support for big-endian machines needs to
* be implemented.
*/
if (AcpiIsBigEndianMachine ())
{
fprintf (stderr,
"iASL is not currently supported on big-endian machines.\n");
return (-1);
}
AcpiOsInitialize ();
ACPI_DEBUG_INITIALIZE (); /* For debug version only */
/* Initialize preprocessor and compiler before command line processing */
@ -307,21 +367,11 @@ main (
/* Perform global actions first/only */
if (Gbl_GetAllTables)
{
Status = AslDoOneFile (NULL);
if (ACPI_FAILURE (Status))
{
return (-1);
}
return (0);
}
if (Gbl_DisassembleAll)
{
while (argv[Index1])
{
Status = AslDoOnePathname (argv[Index1], AcpiDmAddToExternalFileList);
Status = AcpiDmAddToExternalFileList (argv[Index1]);
if (ACPI_FAILURE (Status))
{
return (-1);
@ -335,19 +385,36 @@ main (
while (argv[Index2])
{
Status = AslDoOnePathname (argv[Index2], AslDoOneFile);
/*
* If -p not specified, we will use the input filename as the
* output filename prefix
*/
if (Gbl_UseDefaultAmlFilename)
{
Gbl_OutputFilenamePrefix = argv[Index2];
UtConvertBackslashes (Gbl_OutputFilenamePrefix);
}
Status = AslDoOneFile (argv[Index2]);
if (ACPI_FAILURE (Status))
{
return (-1);
ReturnStatus = -1;
goto CleanupAndExit;
}
Index2++;
}
CleanupAndExit:
UtFreeLineBuffers ();
AslParserCleanup ();
if (AcpiGbl_ExternalFileList)
{
AcpiDmClearExternalFileList();
}
return (0);
return (ReturnStatus);
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -446,7 +446,38 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
/* XFERTYPE_16 */ OP_TABLE_ENTRY (AML_BYTE_OP, 2, 0, 0),
/* XOR */ OP_TABLE_ENTRY (AML_BIT_XOR_OP, 0, 0, ACPI_BTYPE_INTEGER),
/* ZERO */ OP_TABLE_ENTRY (AML_ZERO_OP, 0, 0, ACPI_BTYPE_INTEGER),
/* TOPLD */ OP_TABLE_ENTRY (AML_DWORD_OP, 0, NODE_AML_PACKAGE, ACPI_BTYPE_INTEGER),
/* XFERSIZE_128 */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* REVISION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* IGNORECOLOR */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* RED */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* GREEN */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* BLUE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* WIDTH */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* HEIGHT */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* USERVISIBLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* DOCK */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* LID */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* PANEL */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* VERTICALPOSITION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* HORIZONTALPOSITION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* SHAPE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* GROUPORIENTATION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* GROUPTOKEN */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* GROUPPOSITION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* BAY */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* EJECTABLE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* EJECTREQUIRED */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* CABINETNUMBER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* CARDCAGENUMBER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* REFERENCE */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* ROTATION */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* ORDER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* RESERVED */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* VERTICALOFFSET */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* HORIZONTALOFFSET */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* PRINTF */ OP_TABLE_ENTRY (AML_STORE_OP, 0, 0, ACPI_BTYPE_DATA_REFERENCE),
/* FPRINTF */ OP_TABLE_ENTRY (AML_STORE_OP, 0, 0, ACPI_BTYPE_DATA_REFERENCE),
/*! [End] no source code translation !*/
};

View File

@ -0,0 +1,346 @@
/******************************************************************************
*
* Module Name: aslmapenter - Build resource descriptor/device maps
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acapps.h>
#include <contrib/dev/acpica/compiler/aslcompiler.h>
/* This module used for application-level code only */
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslmapenter")
/* Local prototypes */
static ACPI_GPIO_INFO *
MpCreateGpioInfo (
UINT16 PinNumber,
char *DeviceName);
static ACPI_SERIAL_INFO *
MpCreateSerialInfo (
char *DeviceName,
UINT16 Address);
/*******************************************************************************
*
* FUNCTION: MpSaveGpioInfo
*
* PARAMETERS: Resource - GPIO resource descriptor
* PinCount - From GPIO descriptor
* PinList - From GPIO descriptor
* DeviceName - The "ResourceSource" name
*
* RETURN: None
*
* DESCRIPTION: External Interface.
* Save GPIO resource descriptor information.
* Creates new GPIO info blocks, one for each pin defined by the
* GPIO descriptor.
*
******************************************************************************/
void
MpSaveGpioInfo (
ACPI_PARSE_OBJECT *Op,
AML_RESOURCE *Resource,
UINT32 PinCount,
UINT16 *PinList,
char *DeviceName)
{
ACPI_GPIO_INFO *Info;
UINT32 i;
/* Mapfile option enabled? */
if (!Gbl_MapfileFlag)
{
return;
}
/* Create an info block for each pin defined in the descriptor */
for (i = 0; i < PinCount; i++)
{
Info = MpCreateGpioInfo (PinList[i], DeviceName);
Info->Op = Op;
Info->DeviceName = DeviceName;
Info->PinCount = PinCount;
Info->PinIndex = i;
Info->PinNumber = PinList[i];
Info->Type = Resource->Gpio.ConnectionType;
Info->Direction = (UINT8) (Resource->Gpio.IntFlags & 0x0003); /* _IOR, for IO descriptor */
Info->Polarity = (UINT8) ((Resource->Gpio.IntFlags >> 1) & 0x0003); /* _POL, for INT descriptor */
}
}
/*******************************************************************************
*
* FUNCTION: MpSaveSerialInfo
*
* PARAMETERS: Resource - A Serial resource descriptor
* DeviceName - The "ResourceSource" name.
*
* RETURN: None
*
* DESCRIPTION: External Interface.
* Save serial resource descriptor information.
* Creates a new serial info block.
*
******************************************************************************/
void
MpSaveSerialInfo (
ACPI_PARSE_OBJECT *Op,
AML_RESOURCE *Resource,
char *DeviceName)
{
ACPI_SERIAL_INFO *Info;
UINT16 Address;
UINT32 Speed;
/* Mapfile option enabled? */
if (!Gbl_MapfileFlag)
{
return;
}
if (Resource->DescriptorType != ACPI_RESOURCE_NAME_SERIAL_BUS)
{
return;
}
/* Extract address and speed from the resource descriptor */
switch (Resource->CommonSerialBus.Type)
{
case AML_RESOURCE_I2C_SERIALBUSTYPE:
Address = Resource->I2cSerialBus.SlaveAddress;
Speed = Resource->I2cSerialBus.ConnectionSpeed;
break;
case AML_RESOURCE_SPI_SERIALBUSTYPE:
Address = Resource->SpiSerialBus.DeviceSelection;
Speed = Resource->SpiSerialBus.ConnectionSpeed;
break;
case AML_RESOURCE_UART_SERIALBUSTYPE:
Address = 0;
Speed = Resource->UartSerialBus.DefaultBaudRate;
break;
default: /* Invalid bus subtype */
return;
}
Info = MpCreateSerialInfo (DeviceName, Address);
Info->Op = Op;
Info->DeviceName = DeviceName;
Info->Resource = Resource;
Info->Address = Address;
Info->Speed = Speed;
}
/*******************************************************************************
*
* FUNCTION: MpCreateGpioInfo
*
* PARAMETERS: PinNumber - GPIO pin number
* DeviceName - The "ResourceSource" name
*
* RETURN: New GPIO info block.
*
* DESCRIPTION: Create a new GPIO info block and place it on the global list.
* The list is sorted by GPIO device names first, and pin numbers
* secondarily.
*
******************************************************************************/
static ACPI_GPIO_INFO *
MpCreateGpioInfo (
UINT16 PinNumber,
char *DeviceName)
{
ACPI_GPIO_INFO *Info;
ACPI_GPIO_INFO *NextGpio;
ACPI_GPIO_INFO *PrevGpio;
/*
* Allocate a new info block and insert it into the global GPIO list
* sorted by both source device name and then the pin number. There is
* one block per pin.
*/
Info = ACPI_CAST_PTR (ACPI_GPIO_INFO,
UtStringCacheCalloc (sizeof (ACPI_GPIO_INFO)));
NextGpio = Gbl_GpioList;
PrevGpio = NULL;
if (!Gbl_GpioList)
{
Gbl_GpioList = Info;
Info->Next = NULL;
return (Info);
}
/* Sort on source DeviceName first */
while (NextGpio &&
(ACPI_STRCMP (DeviceName, NextGpio->DeviceName) > 0))
{
PrevGpio = NextGpio;
NextGpio = NextGpio->Next;
}
/* Now sort on the PinNumber */
while (NextGpio &&
(NextGpio->PinNumber < PinNumber) &&
!ACPI_STRCMP (DeviceName, NextGpio->DeviceName))
{
PrevGpio = NextGpio;
NextGpio = NextGpio->Next;
}
/* Finish the list insertion */
if (PrevGpio)
{
PrevGpio->Next = Info;
}
else
{
Gbl_GpioList = Info;
}
Info->Next = NextGpio;
return (Info);
}
/*******************************************************************************
*
* FUNCTION: MpCreateSerialInfo
*
* PARAMETERS: DeviceName - The "ResourceSource" name.
* Address - Physical address for the device
*
* RETURN: New Serial info block.
*
* DESCRIPTION: Create a new Serial info block and place it on the global list.
* The list is sorted by Serial device names first, and addresses
* secondarily.
*
******************************************************************************/
static ACPI_SERIAL_INFO *
MpCreateSerialInfo (
char *DeviceName,
UINT16 Address)
{
ACPI_SERIAL_INFO *Info;
ACPI_SERIAL_INFO *NextSerial;
ACPI_SERIAL_INFO *PrevSerial;
/*
* Allocate a new info block and insert it into the global Serial list
* sorted by both source device name and then the address.
*/
Info = ACPI_CAST_PTR (ACPI_SERIAL_INFO,
UtStringCacheCalloc (sizeof (ACPI_SERIAL_INFO)));
NextSerial = Gbl_SerialList;
PrevSerial = NULL;
if (!Gbl_SerialList)
{
Gbl_SerialList = Info;
Info->Next = NULL;
return (Info);
}
/* Sort on source DeviceName */
while (NextSerial &&
(ACPI_STRCMP (DeviceName, NextSerial->DeviceName) > 0))
{
PrevSerial = NextSerial;
NextSerial = NextSerial->Next;
}
/* Now sort on the Address */
while (NextSerial &&
(NextSerial->Address < Address) &&
!ACPI_STRCMP (DeviceName, NextSerial->DeviceName))
{
PrevSerial = NextSerial;
NextSerial = NextSerial->Next;
}
/* Finish the list insertion */
if (PrevSerial)
{
PrevSerial->Next = Info;
}
else
{
Gbl_SerialList = Info;
}
Info->Next = NextSerial;
return (Info);
}

View File

@ -0,0 +1,642 @@
/******************************************************************************
*
* Module Name: aslmapoutput - Output/emit the resource descriptor/device maps
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acapps.h>
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acinterp.h>
#include <contrib/dev/acpica/include/acparser.h>
#include <contrib/dev/acpica/include/acnamesp.h>
#include <contrib/dev/acpica/include/amlcode.h>
/* This module used for application-level code only */
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslmapoutput")
/* Local prototypes */
static void
MpEmitGpioInfo (
void);
static void
MpEmitSerialInfo (
void);
static void
MpEmitDeviceTree (
void);
static ACPI_STATUS
MpEmitOneDevice (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue);
static void
MpXrefDevices (
ACPI_GPIO_INFO *Info);
static ACPI_STATUS
MpNamespaceXrefBegin (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context);
/* Strings used to decode flag bits */
const char *DirectionDecode[] =
{
"Both I/O ",
"InputOnly ",
"OutputOnly ",
"Preserve "
};
const char *PolarityDecode[] =
{
"ActiveHigh",
"ActiveLow ",
"ActiveBoth",
"Reserved "
};
/*******************************************************************************
*
* FUNCTION: MpEmitMappingInfo
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: External interface.
* Map file has already been opened. Emit all of the collected
* hardware mapping information. Includes: GPIO information,
* Serial information, and a dump of the entire ACPI device tree.
*
******************************************************************************/
void
MpEmitMappingInfo (
void)
{
/* Mapfile option enabled? */
if (!Gbl_MapfileFlag)
{
return;
}
if (!Gbl_GpioList)
{
FlPrintFile (ASL_FILE_MAP_OUTPUT,
"\nNo GPIO devices found\n");
}
if (!Gbl_SerialList)
{
FlPrintFile (ASL_FILE_MAP_OUTPUT,
"\nNo Serial devices found (I2C/SPI/UART)\n");
}
if (!Gbl_GpioList && !Gbl_SerialList)
{
return;
}
/* Headers */
FlPrintFile (ASL_FILE_MAP_OUTPUT, "\nResource Descriptor Connectivity Map\n");
FlPrintFile (ASL_FILE_MAP_OUTPUT, "------------------------------------\n");
/* Emit GPIO and Serial descriptors, then entire ACPI device tree */
MpEmitGpioInfo ();
MpEmitSerialInfo ();
MpEmitDeviceTree ();
/* Clear the lists - no need to free memory here */
Gbl_SerialList = NULL;
Gbl_GpioList = NULL;
}
/*******************************************************************************
*
* FUNCTION: MpEmitGpioInfo
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Emit the info about all GPIO devices found during the
* compile or disassembly.
*
******************************************************************************/
static void
MpEmitGpioInfo (
void)
{
ACPI_GPIO_INFO *Info;
char *Type;
char *PrevDeviceName = NULL;
const char *Direction;
const char *Polarity;
char *ParentPathname;
const char *Description;
char *HidString;
const AH_DEVICE_ID *HidInfo;
/* Walk the GPIO descriptor list */
Info = Gbl_GpioList;
while (Info)
{
HidString = MpGetHidViaNamestring (Info->DeviceName);
/* Print header info for the controller itself */
if (!PrevDeviceName ||
ACPI_STRCMP (PrevDeviceName, Info->DeviceName))
{
FlPrintFile (ASL_FILE_MAP_OUTPUT,
"\n\nGPIO Controller: %-8s %-28s",
HidString, Info->DeviceName);
HidInfo = AcpiAhMatchHardwareId (HidString);
if (HidInfo)
{
FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s",
HidInfo->Description);
}
FlPrintFile (ASL_FILE_MAP_OUTPUT,
"\n\nPin Type Direction Polarity"
" Dest _HID Destination\n");
}
PrevDeviceName = Info->DeviceName;
/* Setup various strings based upon the type (GpioInt or GpioIo) */
switch (Info->Type)
{
case AML_RESOURCE_GPIO_TYPE_INT:
Type = "GpioInt";
Direction = "-Interrupt-";
Polarity = PolarityDecode[Info->Polarity];
break;
case AML_RESOURCE_GPIO_TYPE_IO:
Type = "GpioIo ";
Direction = DirectionDecode[Info->Direction];
Polarity = " ";
break;
default:
continue;
}
/* Emit the GPIO info */
FlPrintFile (ASL_FILE_MAP_OUTPUT, "%4.4X %s %s %s ",
Info->PinNumber, Type, Direction, Polarity);
ParentPathname = NULL;
HidString = MpGetConnectionInfo (Info->Op, Info->PinIndex,
&Info->TargetNode, &ParentPathname);
if (HidString)
{
/*
* This is a Connection() field
* Attempt to find all references to the field.
*/
FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s %-28s",
HidString, ParentPathname);
MpXrefDevices (Info);
}
else
{
/*
* For Devices, attempt to get the _HID description string.
* Failing that (many _HIDs are not recognized), attempt to
* get the _DDN description string.
*/
HidString = MpGetParentDeviceHid (Info->Op, &Info->TargetNode,
&ParentPathname);
FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s %-28s",
HidString, ParentPathname);
/* Get the _HID description or _DDN string */
HidInfo = AcpiAhMatchHardwareId (HidString);
if (HidInfo)
{
FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s",
HidInfo->Description);
}
else if ((Description = MpGetDdnValue (ParentPathname)))
{
FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s (_DDN)",
Description);
}
}
FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n");
ACPI_FREE (ParentPathname);
Info = Info->Next;
}
}
/*******************************************************************************
*
* FUNCTION: MpEmitSerialInfo
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Emit the info about all Serial devices found during the
* compile or disassembly.
*
******************************************************************************/
static void
MpEmitSerialInfo (
void)
{
ACPI_SERIAL_INFO *Info;
char *Type;
char *ParentPathname;
char *PrevDeviceName = NULL;
char *HidString;
const AH_DEVICE_ID *HidInfo;
const char *Description;
AML_RESOURCE *Resource;
/* Walk the constructed serial descriptor list */
Info = Gbl_SerialList;
while (Info)
{
Resource = Info->Resource;
switch (Resource->CommonSerialBus.Type)
{
case AML_RESOURCE_I2C_SERIALBUSTYPE:
Type = "I2C ";
break;
case AML_RESOURCE_SPI_SERIALBUSTYPE:
Type = "SPI ";
break;
case AML_RESOURCE_UART_SERIALBUSTYPE:
Type = "UART";
break;
default:
Type = "UNKN";
break;
}
HidString = MpGetHidViaNamestring (Info->DeviceName);
/* Print header info for the controller itself */
if (!PrevDeviceName ||
ACPI_STRCMP (PrevDeviceName, Info->DeviceName))
{
FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\n%s Controller: ",
Type);
FlPrintFile (ASL_FILE_MAP_OUTPUT, "%-8s %-28s",
HidString, Info->DeviceName);
HidInfo = AcpiAhMatchHardwareId (HidString);
if (HidInfo)
{
FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s",
HidInfo->Description);
}
FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\n");
FlPrintFile (ASL_FILE_MAP_OUTPUT,
"Type Address Speed Dest _HID Destination\n");
}
PrevDeviceName = Info->DeviceName;
FlPrintFile (ASL_FILE_MAP_OUTPUT, "%s %4.4X %8.8X ",
Type, Info->Address, Info->Speed);
ParentPathname = NULL;
HidString = MpGetConnectionInfo (Info->Op, 0, &Info->TargetNode,
&ParentPathname);
if (HidString)
{
/*
* This is a Connection() field
* Attempt to find all references to the field.
*/
FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s %-28s",
HidString, ParentPathname);
}
else
{
/* Normal resource template */
HidString = MpGetParentDeviceHid (Info->Op, &Info->TargetNode,
&ParentPathname);
FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s %-28s",
HidString, ParentPathname);
/* Get the _HID description or _DDN string */
HidInfo = AcpiAhMatchHardwareId (HidString);
if (HidInfo)
{
FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s",
HidInfo->Description);
}
else if ((Description = MpGetDdnValue (ParentPathname)))
{
FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s (_DDN)",
Description);
}
}
FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n");
ACPI_FREE (ParentPathname);
Info = Info->Next;
}
}
/*******************************************************************************
*
* FUNCTION: MpEmitDeviceTree
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Emit information about all devices within the ACPI namespace.
*
******************************************************************************/
static void
MpEmitDeviceTree (
void)
{
FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\nACPI Device Tree\n");
FlPrintFile (ASL_FILE_MAP_OUTPUT, "----------------\n\n");
FlPrintFile (ASL_FILE_MAP_OUTPUT, "Device Pathname "
"_HID Description\n\n");
/* Walk the namespace from the root */
(void) AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, MpEmitOneDevice, NULL, NULL, NULL);
}
/*******************************************************************************
*
* FUNCTION: MpEmitOneDevice
*
* PARAMETERS: ACPI_NAMESPACE_WALK callback
*
* RETURN: Status
*
* DESCRIPTION: Emit information about one ACPI device in the namespace. Used
* during dump of all device objects within the namespace.
*
******************************************************************************/
static ACPI_STATUS
MpEmitOneDevice (
ACPI_HANDLE ObjHandle,
UINT32 NestingLevel,
void *Context,
void **ReturnValue)
{
char *DevicePathname;
char *DdnString;
char *HidString;
const AH_DEVICE_ID *HidInfo;
/* Device pathname */
DevicePathname = AcpiNsGetExternalPathname (
ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle));
FlPrintFile (ASL_FILE_MAP_OUTPUT, "%-32s", DevicePathname);
/* _HID or _DDN */
HidString = MpGetHidValue (
ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle));
FlPrintFile (ASL_FILE_MAP_OUTPUT, "%8s", HidString);
HidInfo = AcpiAhMatchHardwareId (HidString);
if (HidInfo)
{
FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s",
HidInfo->Description);
}
else if ((DdnString = MpGetDdnValue (DevicePathname)))
{
FlPrintFile (ASL_FILE_MAP_OUTPUT, " // %s (_DDN)", DdnString);
}
FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n");
ACPI_FREE (DevicePathname);
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: MpXrefDevices
*
* PARAMETERS: Info - A GPIO Info block
*
* RETURN: None
*
* DESCRIPTION: Cross-reference the parse tree and find all references to the
* specified GPIO device.
*
******************************************************************************/
static void
MpXrefDevices (
ACPI_GPIO_INFO *Info)
{
/* Walk the entire parse tree */
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
MpNamespaceXrefBegin, NULL, Info);
if (!Info->References)
{
FlPrintFile (ASL_FILE_MAP_OUTPUT, " // **** No references in table");
}
}
/*******************************************************************************
*
* FUNCTION: MpNamespaceXrefBegin
*
* PARAMETERS: WALK_PARSE_TREE callback
*
* RETURN: Status
*
* DESCRIPTION: Walk parse tree callback used to cross-reference GPIO pins.
*
******************************************************************************/
static ACPI_STATUS
MpNamespaceXrefBegin (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
ACPI_GPIO_INFO *Info = ACPI_CAST_PTR (ACPI_GPIO_INFO, Context);
const ACPI_OPCODE_INFO *OpInfo;
char *DevicePathname;
ACPI_PARSE_OBJECT *ParentOp;
char *HidString;
ACPI_FUNCTION_TRACE_PTR (MpNamespaceXrefBegin, Op);
/*
* If this node is the actual declaration of a name
* [such as the XXXX name in "Method (XXXX)"],
* we are not interested in it here. We only care about names that
* are references to other objects within the namespace and the
* parent objects of name declarations
*/
if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION)
{
return (AE_OK);
}
/* We are only interested in opcodes that have an associated name */
OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
if ((OpInfo->Flags & AML_NAMED) ||
(OpInfo->Flags & AML_CREATE))
{
return (AE_OK);
}
if ((Op->Asl.ParseOpcode != PARSEOP_NAMESTRING) &&
(Op->Asl.ParseOpcode != PARSEOP_NAMESEG) &&
(Op->Asl.ParseOpcode != PARSEOP_METHODCALL))
{
return (AE_OK);
}
if (!Op->Asl.Node)
{
return (AE_OK);
}
ParentOp = Op->Asl.Parent;
if (ParentOp->Asl.ParseOpcode == PARSEOP_FIELD)
{
return (AE_OK);
}
if (Op->Asl.Node == Info->TargetNode)
{
while (ParentOp && (!ParentOp->Asl.Node))
{
ParentOp = ParentOp->Asl.Parent;
}
if (ParentOp)
{
DevicePathname = AcpiNsGetExternalPathname (
ParentOp->Asl.Node);
if (!Info->References)
{
FlPrintFile (ASL_FILE_MAP_OUTPUT, " // References:");
}
HidString = MpGetHidViaNamestring (DevicePathname);
FlPrintFile (ASL_FILE_MAP_OUTPUT, " %s [%s]",
DevicePathname, HidString);
Info->References++;
ACPI_FREE (DevicePathname);
}
}
return (AE_OK);
}

View File

@ -0,0 +1,402 @@
/******************************************************************************
*
* Module Name: aslmaputils - Utilities for the resource descriptor/device maps
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acapps.h>
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acinterp.h>
#include <contrib/dev/acpica/include/acnamesp.h>
#include <contrib/dev/acpica/include/amlcode.h>
/* This module used for application-level code only */
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslmaputils")
/*******************************************************************************
*
* FUNCTION: MpGetHidFromParseTree
*
* PARAMETERS: HidNode - Node for a _HID object
*
* RETURN: An _HID string value. Automatically converts _HID integers
* to strings. Never NULL.
*
* DESCRIPTION: Extract a _HID value from the parse tree, not the namespace.
* Used when a fully initialized namespace is not available.
*
******************************************************************************/
char *
MpGetHidFromParseTree (
ACPI_NAMESPACE_NODE *HidNode)
{
ACPI_PARSE_OBJECT *Op;
ACPI_PARSE_OBJECT *Arg;
char *HidString;
Op = HidNode->Op;
switch (Op->Asl.ParseOpcode)
{
case PARSEOP_NAME:
Arg = Op->Asl.Child; /* Get the NameSeg/NameString node */
Arg = Arg->Asl.Next; /* First peer is the object to be associated with the name */
switch (Arg->Asl.ParseOpcode)
{
case PARSEOP_STRING_LITERAL:
return (Arg->Asl.Value.String);
case PARSEOP_INTEGER:
/* Convert EISAID to a string */
HidString = UtStringCacheCalloc (ACPI_EISAID_STRING_SIZE);
AcpiExEisaIdToString (HidString, Arg->Asl.Value.Integer);
return (HidString);
default:
return ("UNKNOWN");
}
default:
return ("-No HID-");
}
}
/*******************************************************************************
*
* FUNCTION: MpGetHidValue
*
* PARAMETERS: DeviceNode - Node for parent device
*
* RETURN: An _HID string value. Automatically converts _HID integers
* to strings. Never NULL.
*
* DESCRIPTION: Extract _HID value from within a device scope. Does not
* actually execute a method, just gets the string or integer
* value for the _HID.
*
******************************************************************************/
char *
MpGetHidValue (
ACPI_NAMESPACE_NODE *DeviceNode)
{
ACPI_NAMESPACE_NODE *HidNode;
char *HidString;
ACPI_STATUS Status;
Status = AcpiNsGetNode (DeviceNode, METHOD_NAME__HID,
ACPI_NS_NO_UPSEARCH, &HidNode);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
/* If only partial namespace, get the _HID from the parse tree */
if (!HidNode->Object)
{
return (MpGetHidFromParseTree (HidNode));
}
/* Handle the different _HID flavors */
switch (HidNode->Type)
{
case ACPI_TYPE_STRING:
return (HidNode->Object->String.Pointer);
case ACPI_TYPE_INTEGER:
/* Convert EISAID to a string */
HidString = UtStringCacheCalloc (ACPI_EISAID_STRING_SIZE);
AcpiExEisaIdToString (HidString, HidNode->Object->Integer.Value);
return (HidString);
case ACPI_TYPE_METHOD:
return ("-Method-");
default:
FlPrintFile (ASL_FILE_MAP_OUTPUT, "BAD HID TYPE: %u", HidNode->Type);
break;
}
ErrorExit:
return ("-No HID-");
}
/*******************************************************************************
*
* FUNCTION: MpGetHidViaNamestring
*
* PARAMETERS: DeviceName - Namepath for parent device
*
* RETURN: _HID string. Never NULL.
*
* DESCRIPTION: Get a _HID value via a device pathname (instead of just simply
* a device node.)
*
******************************************************************************/
char *
MpGetHidViaNamestring (
char *DeviceName)
{
ACPI_NAMESPACE_NODE *DeviceNode;
ACPI_STATUS Status;
Status = AcpiNsGetNode (NULL, DeviceName, ACPI_NS_NO_UPSEARCH,
&DeviceNode);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
return (MpGetHidValue (DeviceNode));
ErrorExit:
return ("-No HID-");
}
/*******************************************************************************
*
* FUNCTION: MpGetParentDeviceHid
*
* PARAMETERS: Op - Parse Op to be examined
* TargetNode - Where the field node is returned
* ParentDeviceName - Where the node path is returned
*
* RETURN: _HID string. Never NULL.
*
* DESCRIPTION: Find the parent Device or Scope Op, get the full pathname to
* the parent, and get the _HID associated with the parent.
*
******************************************************************************/
char *
MpGetParentDeviceHid (
ACPI_PARSE_OBJECT *Op,
ACPI_NAMESPACE_NODE **TargetNode,
char **ParentDeviceName)
{
ACPI_NAMESPACE_NODE *DeviceNode;
/* Find parent Device() or Scope() Op */
while (Op &&
(Op->Asl.AmlOpcode != AML_DEVICE_OP) &&
(Op->Asl.AmlOpcode != AML_SCOPE_OP))
{
Op = Op->Asl.Parent;
}
if (!Op)
{
FlPrintFile (ASL_FILE_MAP_OUTPUT, " No_Parent_Device ");
goto ErrorExit;
}
/* Get the full pathname to the device and the _HID */
DeviceNode = Op->Asl.Node;
if (!DeviceNode)
{
FlPrintFile (ASL_FILE_MAP_OUTPUT, " No_Device_Node ");
goto ErrorExit;
}
*ParentDeviceName = AcpiNsGetExternalPathname (DeviceNode);
return (MpGetHidValue (DeviceNode));
ErrorExit:
return ("-No HID-");
}
/*******************************************************************************
*
* FUNCTION: MpGetDdnValue
*
* PARAMETERS: DeviceName - Namepath for parent device
*
* RETURN: _DDN description string. NULL on failure.
*
* DESCRIPTION: Execute the _DDN method for the device.
*
******************************************************************************/
char *
MpGetDdnValue (
char *DeviceName)
{
ACPI_NAMESPACE_NODE *DeviceNode;
ACPI_NAMESPACE_NODE *DdnNode;
ACPI_STATUS Status;
Status = AcpiNsGetNode (NULL, DeviceName, ACPI_NS_NO_UPSEARCH,
&DeviceNode);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
Status = AcpiNsGetNode (DeviceNode, METHOD_NAME__DDN, ACPI_NS_NO_UPSEARCH,
&DdnNode);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
if ((DdnNode->Type != ACPI_TYPE_STRING) ||
!DdnNode->Object)
{
goto ErrorExit;
}
return (DdnNode->Object->String.Pointer);
ErrorExit:
return (NULL);
}
/*******************************************************************************
*
* FUNCTION: MpGetConnectionInfo
*
* PARAMETERS: Op - Parse Op to be examined
* PinIndex - Index into GPIO PinList
* TargetNode - Where the field node is returned
* TargetName - Where the node path is returned
*
* RETURN: A substitute _HID string, indicating that the name is actually
* a field. NULL if the Op does not refer to a Connection.
*
* DESCRIPTION: Get the Field Unit that corresponds to the PinIndex after
* a Connection() invocation.
*
******************************************************************************/
char *
MpGetConnectionInfo (
ACPI_PARSE_OBJECT *Op,
UINT32 PinIndex,
ACPI_NAMESPACE_NODE **TargetNode,
char **TargetName)
{
ACPI_PARSE_OBJECT *NextOp;
UINT32 i;
/*
* Handle Connection() here. Find the next named FieldUnit.
* Note: we look at the ParseOpcode for the compiler, look
* at the AmlOpcode for the disassembler.
*/
if ((Op->Asl.AmlOpcode == AML_INT_CONNECTION_OP) ||
(Op->Asl.ParseOpcode == PARSEOP_CONNECTION))
{
/* Find the correct field unit definition */
NextOp = Op;
for (i = 0; i <= PinIndex;)
{
NextOp = NextOp->Asl.Next;
while (NextOp &&
(NextOp->Asl.ParseOpcode != PARSEOP_NAMESEG) &&
(NextOp->Asl.AmlOpcode != AML_INT_NAMEDFIELD_OP))
{
NextOp = NextOp->Asl.Next;
}
if (!NextOp)
{
return ("UNKNOWN");
}
/* Add length of this field to the current pin index */
if (NextOp->Asl.ParseOpcode == PARSEOP_NAMESEG)
{
i += (UINT32) NextOp->Asl.Child->Asl.Value.Integer;
}
else /* AML_INT_NAMEDFIELD_OP */
{
i += (UINT32) NextOp->Asl.Value.Integer;
}
}
/* Return the node and pathname for the field unit */
*TargetNode = NextOp->Asl.Node;
*TargetName = AcpiNsGetExternalPathname (*TargetNode);
return ("-Field-");
}
return (NULL);
}

View File

@ -0,0 +1,409 @@
/******************************************************************************
*
* Module Name: aslmessages.c - Compiler error/warning message strings
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslmessages")
/*
* Strings for message reporting levels, must match error
* type string tables in aslmessages.c
*/
const char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = {
"Optimize",
"Remark ",
"Warning ",
"Warning ",
"Warning ",
"Error "
};
/* All lowercase versions for IDEs */
const char *AslErrorLevelIde [ASL_NUM_REPORT_LEVELS] = {
"optimize",
"remark ",
"warning ",
"warning ",
"warning ",
"error "
};
/*
* Actual message strings for each compiler message ID. There are currently
* three distinct blocks of error messages (so that they can be expanded
* individually):
* Main ASL compiler
* Data Table compiler
* Preprocessor
*
* NOTE1: These tables must match the enum list of message IDs in the file
* aslmessages.h exactly.
*
* NOTE2: With the introduction of the -vw option to disable specific messages,
* new messages should only be added to the end of this list, so that values
* for existing messages are not disturbed.
*/
/* ASL compiler */
const char *AslCompilerMsgs [] =
{
/* The zeroth message is reserved */ "",
/* ASL_MSG_ALIGNMENT */ "Must be a multiple of alignment/granularity value",
/* ASL_MSG_ALPHANUMERIC_STRING */ "String must be entirely alphanumeric",
/* ASL_MSG_AML_NOT_IMPLEMENTED */ "Opcode is not implemented in compiler AML code generator",
/* ASL_MSG_ARG_COUNT_HI */ "Too many arguments",
/* ASL_MSG_ARG_COUNT_LO */ "Too few arguments",
/* ASL_MSG_ARG_INIT */ "Method argument is not initialized",
/* ASL_MSG_BACKWARDS_OFFSET */ "Invalid backwards offset",
/* ASL_MSG_BUFFER_LENGTH */ "Effective AML buffer length is zero",
/* ASL_MSG_CLOSE */ "Could not close file",
/* ASL_MSG_COMPILER_INTERNAL */ "Internal compiler error",
/* ASL_MSG_COMPILER_RESERVED */ "Use of compiler reserved name",
/* ASL_MSG_CONNECTION_MISSING */ "A Connection operator is required for this field SpaceId",
/* ASL_MSG_CONNECTION_INVALID */ "Invalid OpRegion SpaceId for use of Connection operator",
/* ASL_MSG_CONSTANT_EVALUATION */ "Could not evaluate constant expression",
/* ASL_MSG_CONSTANT_FOLDED */ "Constant expression evaluated and reduced",
/* ASL_MSG_CORE_EXCEPTION */ "From ACPICA Subsystem",
/* ASL_MSG_DEBUG_FILE_OPEN */ "Could not open debug file",
/* ASL_MSG_DEBUG_FILENAME */ "Could not create debug filename",
/* ASL_MSG_DEPENDENT_NESTING */ "Dependent function macros cannot be nested",
/* ASL_MSG_DMA_CHANNEL */ "Invalid DMA channel (must be 0-7)",
/* ASL_MSG_DMA_LIST */ "Too many DMA channels (8 max)",
/* ASL_MSG_DUPLICATE_CASE */ "Case value already specified",
/* ASL_MSG_DUPLICATE_ITEM */ "Duplicate value in list",
/* ASL_MSG_EARLY_EOF */ "Premature end-of-file reached",
/* ASL_MSG_ENCODING_LENGTH */ "Package length too long to encode",
/* ASL_MSG_EX_INTERRUPT_LIST */ "Too many interrupts (255 max)",
/* ASL_MSG_EX_INTERRUPT_LIST_MIN */ "Too few interrupts (1 minimum required)",
/* ASL_MSG_EX_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 32 bits)",
/* ASL_MSG_FIELD_ACCESS_WIDTH */ "Access width is greater than region size",
/* ASL_MSG_FIELD_UNIT_ACCESS_WIDTH */ "Access width of Field Unit extends beyond region limit",
/* ASL_MSG_FIELD_UNIT_OFFSET */ "Field Unit extends beyond region limit",
/* ASL_MSG_GPE_NAME_CONFLICT */ "Name conflicts with a previous GPE method",
/* ASL_MSG_HID_LENGTH */ "_HID string must be exactly 7 or 8 characters",
/* ASL_MSG_HID_PREFIX */ "_HID prefix must be all uppercase or decimal digits",
/* ASL_MSG_HID_SUFFIX */ "_HID suffix must be all hex digits",
/* ASL_MSG_INCLUDE_FILE_OPEN */ "Could not open include file",
/* ASL_MSG_INPUT_FILE_OPEN */ "Could not open input file",
/* ASL_MSG_INTEGER_LENGTH */ "64-bit integer in 32-bit table, truncating (DSDT version < 2)",
/* ASL_MSG_INTEGER_OPTIMIZATION */ "Integer optimized to single-byte AML opcode",
/* ASL_MSG_INTERRUPT_LIST */ "Too many interrupts (16 max)",
/* ASL_MSG_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 0-15)",
/* ASL_MSG_INVALID_ACCESS_SIZE */ "Invalid AccessSize (Maximum is 4 - QWord access)",
/* ASL_MSG_INVALID_ADDR_FLAGS */ "Invalid combination of Length and Min/Max fixed flags",
/* ASL_MSG_INVALID_CONSTANT_OP */ "Invalid operator in constant expression (not type 3/4/5)",
/* ASL_MSG_INVALID_EISAID */ "EISAID string must be of the form \"UUUXXXX\" (3 uppercase, 4 hex digits)",
/* ASL_MSG_INVALID_ESCAPE */ "Invalid or unknown escape sequence",
/* ASL_MSG_INVALID_GRAN_FIXED */ "Granularity must be zero for fixed Min/Max",
/* ASL_MSG_INVALID_GRANULARITY */ "Granularity must be zero or a power of two minus one",
/* ASL_MSG_INVALID_LENGTH */ "Length is larger than Min/Max window",
/* ASL_MSG_INVALID_LENGTH_FIXED */ "Length is not equal to fixed Min/Max window",
/* ASL_MSG_INVALID_MIN_MAX */ "Address Min is greater than Address Max",
/* ASL_MSG_INVALID_OPERAND */ "Invalid operand",
/* ASL_MSG_INVALID_PERFORMANCE */ "Invalid performance/robustness value",
/* ASL_MSG_INVALID_PRIORITY */ "Invalid priority value",
/* ASL_MSG_INVALID_STRING */ "Invalid Hex/Octal Escape - Non-ASCII or NULL",
/* ASL_MSG_INVALID_TARGET */ "Target operand not allowed in constant expression",
/* ASL_MSG_INVALID_TIME */ "Time parameter too long (255 max)",
/* ASL_MSG_INVALID_TYPE */ "Invalid type",
/* ASL_MSG_INVALID_UUID */ "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"",
/* ASL_MSG_ISA_ADDRESS */ "Maximum 10-bit ISA address (0x3FF)",
/* ASL_MSG_LEADING_ASTERISK */ "Invalid leading asterisk",
/* ASL_MSG_LIST_LENGTH_LONG */ "Initializer list longer than declared package length",
/* ASL_MSG_LIST_LENGTH_SHORT */ "Initializer list shorter than declared package length",
/* ASL_MSG_LISTING_FILE_OPEN */ "Could not open listing file",
/* ASL_MSG_LISTING_FILENAME */ "Could not create listing filename",
/* ASL_MSG_LOCAL_INIT */ "Method local variable is not initialized",
/* ASL_MSG_LOCAL_OUTSIDE_METHOD */ "Local or Arg used outside a control method",
/* ASL_MSG_LONG_LINE */ "Splitting long input line",
/* ASL_MSG_MEMORY_ALLOCATION */ "Memory allocation failure",
/* ASL_MSG_MISSING_ENDDEPENDENT */ "Missing EndDependentFn() macro in dependent resource list",
/* ASL_MSG_MISSING_STARTDEPENDENT */ "Missing StartDependentFn() macro in dependent resource list",
/* ASL_MSG_MULTIPLE_DEFAULT */ "More than one Default statement within Switch construct",
/* ASL_MSG_MULTIPLE_TYPES */ "Multiple types",
/* ASL_MSG_NAME_EXISTS */ "Name already exists in scope",
/* ASL_MSG_NAME_OPTIMIZATION */ "NamePath optimized",
/* ASL_MSG_NAMED_OBJECT_IN_WHILE */ "Creating a named object in a While loop",
/* ASL_MSG_NESTED_COMMENT */ "Nested comment found",
/* ASL_MSG_NO_CASES */ "No Case statements under Switch",
/* ASL_MSG_NO_REGION */ "_REG has no corresponding Operation Region",
/* ASL_MSG_NO_RETVAL */ "Called method returns no value",
/* ASL_MSG_NO_WHILE */ "No enclosing While statement",
/* ASL_MSG_NON_ASCII */ "Invalid characters found in file",
/* ASL_MSG_NON_ZERO */ "Operand evaluates to zero",
/* ASL_MSG_NOT_EXIST */ "Object does not exist",
/* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from scope",
/* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke",
/* ASL_MSG_NOT_PARAMETER */ "Not a parameter, used as local only",
/* ASL_MSG_NOT_REACHABLE */ "Object is not accessible from this scope",
/* ASL_MSG_NOT_REFERENCED */ "Object is not referenced",
/* ASL_MSG_NULL_DESCRIPTOR */ "Min/Max/Length/Gran are all zero, but no resource tag",
/* ASL_MSG_NULL_STRING */ "Invalid zero-length (null) string",
/* ASL_MSG_OPEN */ "Could not open file",
/* ASL_MSG_OUTPUT_FILE_OPEN */ "Could not open output AML file",
/* ASL_MSG_OUTPUT_FILENAME */ "Could not create output filename",
/* ASL_MSG_PACKAGE_LENGTH */ "Effective AML package length is zero",
/* ASL_MSG_PREPROCESSOR_FILENAME */ "Could not create preprocessor filename",
/* ASL_MSG_READ */ "Could not read file",
/* ASL_MSG_RECURSION */ "Recursive method call",
/* ASL_MSG_REGION_BUFFER_ACCESS */ "Host Operation Region requires BufferAcc access",
/* ASL_MSG_REGION_BYTE_ACCESS */ "Host Operation Region requires ByteAcc access",
/* ASL_MSG_RESERVED_ARG_COUNT_HI */ "Reserved method has too many arguments",
/* ASL_MSG_RESERVED_ARG_COUNT_LO */ "Reserved method has too few arguments",
/* ASL_MSG_RESERVED_METHOD */ "Reserved name must be a control method",
/* ASL_MSG_RESERVED_NO_RETURN_VAL */ "Reserved method should not return a value",
/* ASL_MSG_RESERVED_OPERAND_TYPE */ "Invalid object type for reserved name",
/* ASL_MSG_RESERVED_PACKAGE_LENGTH */ "Invalid package length for reserved name",
/* ASL_MSG_RESERVED_RETURN_VALUE */ "Reserved method must return a value",
/* ASL_MSG_RESERVED_USE */ "Invalid use of reserved name",
/* ASL_MSG_RESERVED_WORD */ "Use of reserved name",
/* ASL_MSG_RESOURCE_FIELD */ "Resource field name cannot be used as a target",
/* ASL_MSG_RESOURCE_INDEX */ "Missing ResourceSourceIndex (required)",
/* ASL_MSG_RESOURCE_LIST */ "Too many resource items (internal error)",
/* ASL_MSG_RESOURCE_SOURCE */ "Missing ResourceSource string (required)",
/* ASL_MSG_RESULT_NOT_USED */ "Result is not used, operator has no effect",
/* ASL_MSG_RETURN_TYPES */ "Not all control paths return a value",
/* ASL_MSG_SCOPE_FWD_REF */ "Forward references from Scope operator not allowed",
/* ASL_MSG_SCOPE_TYPE */ "Existing object has invalid type for Scope operator",
/* ASL_MSG_SEEK */ "Could not seek file",
/* ASL_MSG_SERIALIZED */ "Control Method marked Serialized",
/* ASL_MSG_SERIALIZED_REQUIRED */ "Control Method should be made Serialized",
/* ASL_MSG_SINGLE_NAME_OPTIMIZATION */ "NamePath optimized to NameSeg (uses run-time search path)",
/* ASL_MSG_SOME_NO_RETVAL */ "Called method may not always return a value",
/* ASL_MSG_STRING_LENGTH */ "String literal too long",
/* ASL_MSG_SWITCH_TYPE */ "Switch expression is not a static Integer/Buffer/String data type, defaulting to Integer",
/* ASL_MSG_SYNC_LEVEL */ "SyncLevel must be in the range 0-15",
/* ASL_MSG_SYNTAX */ "",
/* ASL_MSG_TABLE_SIGNATURE */ "Invalid Table Signature",
/* ASL_MSG_TAG_LARGER */ "ResourceTag larger than Field",
/* ASL_MSG_TAG_SMALLER */ "ResourceTag smaller than Field",
/* ASL_MSG_TIMEOUT */ "Result is not used, possible operator timeout will be missed",
/* ASL_MSG_TOO_MANY_TEMPS */ "Method requires too many temporary variables (_T_x)",
/* ASL_MSG_TRUNCATION */ "64-bit return value will be truncated to 32 bits (DSDT version < 2)",
/* ASL_MSG_UNKNOWN_RESERVED_NAME */ "Unknown reserved name",
/* ASL_MSG_UNREACHABLE_CODE */ "Statement is unreachable",
/* ASL_MSG_UNSUPPORTED */ "Unsupported feature",
/* ASL_MSG_UPPER_CASE */ "Non-hex letters must be upper case",
/* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)",
/* ASL_MSG_WRITE */ "Could not write file",
/* ASL_MSG_RANGE */ "Constant out of range",
/* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer",
/* ASL_MSG_MISSING_DEPENDENCY */ "Missing dependency",
/* ASL_MSG_ILLEGAL_FORWARD_REF */ "Illegal forward reference within a method",
/* ASL_MSG_ILLEGAL_METHOD_REF */ "Illegal reference across two methods"
};
/* Table compiler */
const char *AslTableCompilerMsgs [] =
{
/* ASL_MSG_BUFFER_ELEMENT */ "Invalid element in buffer initializer list",
/* ASL_MSG_DIVIDE_BY_ZERO */ "Expression contains divide-by-zero",
/* ASL_MSG_FLAG_VALUE */ "Flag value is too large",
/* ASL_MSG_INTEGER_SIZE */ "Integer too large for target",
/* ASL_MSG_INVALID_EXPRESSION */ "Invalid expression",
/* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name",
/* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant",
/* ASL_MSG_OEM_TABLE */ "OEM table - unknown contents",
/* ASL_MSG_RESERVED_VALUE */ "Reserved field",
/* ASL_MSG_UNKNOWN_LABEL */ "Label is undefined",
/* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type",
/* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature",
/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero"
};
/* Preprocessor */
const char *AslPreprocessorMsgs [] =
{
/* ASL_MSG_DIRECTIVE_SYNTAX */ "Invalid directive syntax",
/* ASL_MSG_ENDIF_MISMATCH */ "Mismatched #endif",
/* ASL_MSG_ERROR_DIRECTIVE */ "#error",
/* ASL_MSG_EXISTING_NAME */ "Name is already defined",
/* ASL_MSG_INVALID_INVOCATION */ "Invalid macro invocation",
/* ASL_MSG_MACRO_SYNTAX */ "Invalid macro syntax",
/* ASL_MSG_TOO_MANY_ARGUMENTS */ "Too many macro arguments",
/* ASL_MSG_UNKNOWN_DIRECTIVE */ "Unknown directive",
/* ASL_MSG_UNKNOWN_PRAGMA */ "Unknown pragma",
/* ASL_MSG_WARNING_DIRECTIVE */ "#warning"
};
/*******************************************************************************
*
* FUNCTION: AeDecodeMessageId
*
* PARAMETERS: MessageId - ASL message ID (exception code) to be
* formatted. Possibly fully encoded.
*
* RETURN: A string containing the exception message text.
*
* DESCRIPTION: This function validates and translates an ASL message ID into
* an ASCII string.
*
******************************************************************************/
const char *
AeDecodeMessageId (
UINT16 MessageId)
{
UINT32 Index;
const char **MessageTable;
/* Main ASL Compiler messages */
if (MessageId <= ASL_MSG_MAIN_COMPILER_END)
{
MessageTable = AslCompilerMsgs;
Index = MessageId;
if (Index >= ACPI_ARRAY_LENGTH (AslCompilerMsgs))
{
return ("[Unknown ASL Compiler exception ID]");
}
}
/* Data Table Compiler messages */
else if (MessageId <= ASL_MSG_TABLE_COMPILER_END)
{
MessageTable = AslTableCompilerMsgs;
Index = MessageId - ASL_MSG_TABLE_COMPILER;
if (Index >= ACPI_ARRAY_LENGTH (AslTableCompilerMsgs))
{
return ("[Unknown Table Compiler exception ID]");
}
}
/* Preprocessor messages */
else if (MessageId <= ASL_MSG_PREPROCESSOR_END)
{
MessageTable = AslPreprocessorMsgs;
Index = MessageId - ASL_MSG_PREPROCESSOR;
if (Index >= ACPI_ARRAY_LENGTH (AslPreprocessorMsgs))
{
return ("[Unknown Preprocesor exception ID]");
}
}
/* Everything else is unknown */
else
{
return ("[Unknown exception/component ID]");
}
return (MessageTable[Index]);
}
/*******************************************************************************
*
* FUNCTION: AeDecodeExceptionLevel
*
* PARAMETERS: Level - The ASL error level to be decoded
*
* RETURN: A string containing the error level text
*
* DESCRIPTION: This function validates and translates an ASL error level into
* an ASCII string.
*
******************************************************************************/
const char *
AeDecodeExceptionLevel (
UINT8 Level)
{
/* Range check on Level */
if (Level >= ACPI_ARRAY_LENGTH (AslErrorLevel))
{
return ("Unknown exception level");
}
/* Differentiate the string type to be used (IDE is all lower case) */
if (Gbl_VerboseErrors)
{
return (AslErrorLevel[Level]);
}
return (AslErrorLevelIde[Level]);
}
/*******************************************************************************
*
* FUNCTION: AeBuildFullExceptionCode
*
* PARAMETERS: Level - ASL error level
* MessageId - ASL exception code to be formatted
*
* RETURN: Fully encoded exception code
*
* DESCRIPTION: Build the full exception code from the error level and the
* actual message ID.
*
******************************************************************************/
UINT16
AeBuildFullExceptionCode (
UINT8 Level,
UINT16 MessageId)
{
/*
* Error level is in the thousands slot (error/warning/remark, etc.)
* Error codes are 0 - 999
*/
return (((Level + 1) * 1000) + MessageId);
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,11 +41,12 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef __ASLMESSAGES_H
#define __ASLMESSAGES_H
/* These values must match error type string tables in aslmessages.c */
typedef enum
{
ASL_OPTIMIZATION = 0,
@ -58,43 +59,41 @@ typedef enum
} ASL_MESSAGE_TYPES;
#ifdef ASL_EXCEPTIONS
/* Strings for message reporting levels, must match values above */
const char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = {
"Optimize",
"Remark ",
"Warning ",
"Warning ",
"Warning ",
"Error "
};
/* All lowercase versions for IDEs */
const char *AslErrorLevelIde [ASL_NUM_REPORT_LEVELS] = {
"optimize",
"remark ",
"warning ",
"warning ",
"warning ",
"error "
};
#define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings above */
#endif
#define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings for types above */
/*
* Values for all compiler messages.
* Exception code blocks, 0 - 999
* Available for new exception blocks: 600 - 999
*/
#define ASL_MSG_MAIN_COMPILER 0 /* 0 - 299 */
#define ASL_MSG_MAIN_COMPILER_END 299
#define ASL_MSG_TABLE_COMPILER 300 /* 300 - 499 */
#define ASL_MSG_TABLE_COMPILER_END 499
#define ASL_MSG_PREPROCESSOR 500 /* 500 - 599 */
#define ASL_MSG_PREPROCESSOR_END 599
/*
* Values (message IDs) for all compiler messages. There are currently
* three distinct blocks of error messages (so that they can be expanded
* individually):
* Main ASL compiler
* Data Table compiler
* Preprocessor
*
* NOTE: With the introduction of the -vw option to disable specific messages,
* new messages should only be added to the end of this list, so that values
* for existing messages are not disturbed.
* NOTE1: This list must match the tables of message strings in the file
* aslmessages.c exactly.
*
* NOTE2: With the introduction of the -vw option to disable specific
* messages, new messages should only be added to the end of these
* lists, so that values for existing messages are not disturbed.
*/
typedef enum
{
ASL_MSG_RESERVED = 0,
ASL_MSG_RESERVED = ASL_MSG_MAIN_COMPILER,
ASL_MSG_ALIGNMENT,
ASL_MSG_ALPHANUMERIC_STRING,
@ -236,23 +235,13 @@ typedef enum
ASL_MSG_WRITE,
ASL_MSG_RANGE,
ASL_MSG_BUFFER_ALLOCATION,
ASL_MSG_MISSING_DEPENDENCY,
ASL_MSG_ILLEGAL_FORWARD_REF,
ASL_MSG_ILLEGAL_METHOD_REF,
/* These messages are used by the Preprocessor only */
/* These messages are used by the Data Table compiler only */
ASL_MSG_DIRECTIVE_SYNTAX,
ASL_MSG_ENDIF_MISMATCH,
ASL_MSG_ERROR_DIRECTIVE,
ASL_MSG_EXISTING_NAME,
ASL_MSG_INVALID_INVOCATION,
ASL_MSG_MACRO_SYNTAX,
ASL_MSG_TOO_MANY_ARGUMENTS,
ASL_MSG_UNKNOWN_DIRECTIVE,
ASL_MSG_UNKNOWN_PRAGMA,
ASL_MSG_WARNING_DIRECTIVE,
/* These messages are used by the data table compiler only */
ASL_MSG_BUFFER_ELEMENT,
ASL_MSG_BUFFER_ELEMENT = ASL_MSG_TABLE_COMPILER,
ASL_MSG_DIVIDE_BY_ZERO,
ASL_MSG_FLAG_VALUE,
ASL_MSG_INTEGER_SIZE,
@ -264,194 +253,22 @@ typedef enum
ASL_MSG_UNKNOWN_LABEL,
ASL_MSG_UNKNOWN_SUBTABLE,
ASL_MSG_UNKNOWN_TABLE,
ASL_MSG_ZERO_VALUE
ASL_MSG_ZERO_VALUE,
/* These messages are used by the Preprocessor only */
ASL_MSG_DIRECTIVE_SYNTAX = ASL_MSG_PREPROCESSOR,
ASL_MSG_ENDIF_MISMATCH,
ASL_MSG_ERROR_DIRECTIVE,
ASL_MSG_EXISTING_NAME,
ASL_MSG_INVALID_INVOCATION,
ASL_MSG_MACRO_SYNTAX,
ASL_MSG_TOO_MANY_ARGUMENTS,
ASL_MSG_UNKNOWN_DIRECTIVE,
ASL_MSG_UNKNOWN_PRAGMA,
ASL_MSG_WARNING_DIRECTIVE,
} ASL_MESSAGE_IDS;
#ifdef ASL_EXCEPTIONS
/*
* Actual message strings for each compiler message.
*
* NOTE: With the introduction of the -vw option to disable specific messages,
* new messages should only be added to the end of this list, so that values
* for existing messages are not disturbed.
*/
char *AslMessages [] =
{
/* The zeroth message is reserved */ "",
/* ASL_MSG_ALIGNMENT */ "Must be a multiple of alignment/granularity value",
/* ASL_MSG_ALPHANUMERIC_STRING */ "String must be entirely alphanumeric",
/* ASL_MSG_AML_NOT_IMPLEMENTED */ "Opcode is not implemented in compiler AML code generator",
/* ASL_MSG_ARG_COUNT_HI */ "Too many arguments",
/* ASL_MSG_ARG_COUNT_LO */ "Too few arguments",
/* ASL_MSG_ARG_INIT */ "Method argument is not initialized",
/* ASL_MSG_BACKWARDS_OFFSET */ "Invalid backwards offset",
/* ASL_MSG_BUFFER_LENGTH */ "Effective AML buffer length is zero",
/* ASL_MSG_CLOSE */ "Could not close file",
/* ASL_MSG_COMPILER_INTERNAL */ "Internal compiler error",
/* ASL_MSG_COMPILER_RESERVED */ "Use of compiler reserved name",
/* ASL_MSG_CONNECTION_MISSING */ "A Connection operator is required for this field SpaceId",
/* ASL_MSG_CONNECTION_INVALID */ "Invalid OpRegion SpaceId for use of Connection operator",
/* ASL_MSG_CONSTANT_EVALUATION */ "Could not evaluate constant expression",
/* ASL_MSG_CONSTANT_FOLDED */ "Constant expression evaluated and reduced",
/* ASL_MSG_CORE_EXCEPTION */ "From ACPI CA Subsystem",
/* ASL_MSG_DEBUG_FILE_OPEN */ "Could not open debug file",
/* ASL_MSG_DEBUG_FILENAME */ "Could not create debug filename",
/* ASL_MSG_DEPENDENT_NESTING */ "Dependent function macros cannot be nested",\
/* ASL_MSG_DMA_CHANNEL */ "Invalid DMA channel (must be 0-7)",
/* ASL_MSG_DMA_LIST */ "Too many DMA channels (8 max)",
/* ASL_MSG_DUPLICATE_CASE */ "Case value already specified",
/* ASL_MSG_DUPLICATE_ITEM */ "Duplicate value in list",
/* ASL_MSG_EARLY_EOF */ "Premature end-of-file reached",
/* ASL_MSG_ENCODING_LENGTH */ "Package length too long to encode",
/* ASL_MSG_EX_INTERRUPT_LIST */ "Too many interrupts (255 max)",
/* ASL_MSG_EX_INTERRUPT_LIST_MIN */ "Too few interrupts (1 minimum required)",
/* ASL_MSG_EX_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 32 bits)",
/* ASL_MSG_FIELD_ACCESS_WIDTH */ "Access width is greater than region size",
/* ASL_MSG_FIELD_UNIT_ACCESS_WIDTH */ "Access width of Field Unit extends beyond region limit",
/* ASL_MSG_FIELD_UNIT_OFFSET */ "Field Unit extends beyond region limit",
/* ASL_MSG_GPE_NAME_CONFLICT */ "Name conflicts with a previous GPE method",
/* ASL_MSG_HID_LENGTH */ "_HID string must be exactly 7 or 8 characters",
/* ASL_MSG_HID_PREFIX */ "_HID prefix must be all uppercase or decimal digits",
/* ASL_MSG_HID_SUFFIX */ "_HID suffix must be all hex digits",
/* ASL_MSG_INCLUDE_FILE_OPEN */ "Could not open include file",
/* ASL_MSG_INPUT_FILE_OPEN */ "Could not open input file",
/* ASL_MSG_INTEGER_LENGTH */ "64-bit integer in 32-bit table, truncating (DSDT version < 2)",
/* ASL_MSG_INTEGER_OPTIMIZATION */ "Integer optimized to single-byte AML opcode",
/* ASL_MSG_INTERRUPT_LIST */ "Too many interrupts (16 max)",
/* ASL_MSG_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 0-15)",
/* ASL_MSG_INVALID_ACCESS_SIZE */ "Invalid AccessSize (Maximum is 4 - QWord access)",
/* ASL_MSG_INVALID_ADDR_FLAGS */ "Invalid combination of Length and Min/Max fixed flags",
/* ASL_MSG_INVALID_CONSTANT_OP */ "Invalid operator in constant expression (not type 3/4/5)",
/* ASL_MSG_INVALID_EISAID */ "EISAID string must be of the form \"UUUXXXX\" (3 uppercase, 4 hex digits)",
/* ASL_MSG_INVALID_ESCAPE */ "Invalid or unknown escape sequence",
/* ASL_MSG_INVALID_GRAN_FIXED */ "Granularity must be zero for fixed Min/Max",
/* ASL_MSG_INVALID_GRANULARITY */ "Granularity must be zero or a power of two minus one",
/* ASL_MSG_INVALID_LENGTH */ "Length is larger than Min/Max window",
/* ASL_MSG_INVALID_LENGTH_FIXED */ "Length is not equal to fixed Min/Max window",
/* ASL_MSG_INVALID_MIN_MAX */ "Address Min is greater than Address Max",
/* ASL_MSG_INVALID_OPERAND */ "Invalid operand",
/* ASL_MSG_INVALID_PERFORMANCE */ "Invalid performance/robustness value",
/* ASL_MSG_INVALID_PRIORITY */ "Invalid priority value",
/* ASL_MSG_INVALID_STRING */ "Invalid Hex/Octal Escape - Non-ASCII or NULL",
/* ASL_MSG_INVALID_TARGET */ "Target operand not allowed in constant expression",
/* ASL_MSG_INVALID_TIME */ "Time parameter too long (255 max)",
/* ASL_MSG_INVALID_TYPE */ "Invalid type",
/* ASL_MSG_INVALID_UUID */ "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"",
/* ASL_MSG_ISA_ADDRESS */ "Maximum 10-bit ISA address (0x3FF)",
/* ASL_MSG_LEADING_ASTERISK */ "Invalid leading asterisk",
/* ASL_MSG_LIST_LENGTH_LONG */ "Initializer list longer than declared package length",
/* ASL_MSG_LIST_LENGTH_SHORT */ "Initializer list shorter than declared package length",
/* ASL_MSG_LISTING_FILE_OPEN */ "Could not open listing file",
/* ASL_MSG_LISTING_FILENAME */ "Could not create listing filename",
/* ASL_MSG_LOCAL_INIT */ "Method local variable is not initialized",
/* ASL_MSG_LOCAL_OUTSIDE_METHOD */ "Local or Arg used outside a control method",
/* ASL_MSG_LONG_LINE */ "Splitting long input line",
/* ASL_MSG_MEMORY_ALLOCATION */ "Memory allocation failure",
/* ASL_MSG_MISSING_ENDDEPENDENT */ "Missing EndDependentFn() macro in dependent resource list",
/* ASL_MSG_MISSING_STARTDEPENDENT */ "Missing StartDependentFn() macro in dependent resource list",
/* ASL_MSG_MULTIPLE_DEFAULT */ "More than one Default statement within Switch construct",
/* ASL_MSG_MULTIPLE_TYPES */ "Multiple types",
/* ASL_MSG_NAME_EXISTS */ "Name already exists in scope",
/* ASL_MSG_NAME_OPTIMIZATION */ "NamePath optimized",
/* ASL_MSG_NAMED_OBJECT_IN_WHILE */ "Creating a named object in a While loop",
/* ASL_MSG_NESTED_COMMENT */ "Nested comment found",
/* ASL_MSG_NO_CASES */ "No Case statements under Switch",
/* ASL_MSG_NO_REGION */ "_REG has no corresponding Operation Region",
/* ASL_MSG_NO_RETVAL */ "Called method returns no value",
/* ASL_MSG_NO_WHILE */ "No enclosing While statement",
/* ASL_MSG_NON_ASCII */ "Invalid characters found in file",
/* ASL_MSG_NON_ZERO */ "Operand evaluates to zero",
/* ASL_MSG_NOT_EXIST */ "Object does not exist",
/* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from scope",
/* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke",
/* ASL_MSG_NOT_PARAMETER */ "Not a parameter, used as local only",
/* ASL_MSG_NOT_REACHABLE */ "Object is not accessible from this scope",
/* ASL_MSG_NOT_REFERENCED */ "Namespace object is not referenced",
/* ASL_MSG_NULL_DESCRIPTOR */ "Min/Max/Length/Gran are all zero, but no resource tag",
/* ASL_MSG_NULL_STRING */ "Invalid zero-length (null) string",
/* ASL_MSG_OPEN */ "Could not open file",
/* ASL_MSG_OUTPUT_FILE_OPEN */ "Could not open output AML file",
/* ASL_MSG_OUTPUT_FILENAME */ "Could not create output filename",
/* ASL_MSG_PACKAGE_LENGTH */ "Effective AML package length is zero",
/* ASL_MSG_PREPROCESSOR_FILENAME */ "Could not create preprocessor filename",
/* ASL_MSG_READ */ "Could not read file",
/* ASL_MSG_RECURSION */ "Recursive method call",
/* ASL_MSG_REGION_BUFFER_ACCESS */ "Host Operation Region requires BufferAcc access",
/* ASL_MSG_REGION_BYTE_ACCESS */ "Host Operation Region requires ByteAcc access",
/* ASL_MSG_RESERVED_ARG_COUNT_HI */ "Reserved method has too many arguments",
/* ASL_MSG_RESERVED_ARG_COUNT_LO */ "Reserved method has too few arguments",
/* ASL_MSG_RESERVED_METHOD */ "Reserved name must be a control method",
/* ASL_MSG_RESERVED_NO_RETURN_VAL */ "Reserved method should not return a value",
/* ASL_MSG_RESERVED_OPERAND_TYPE */ "Invalid object type for reserved name",
/* ASL_MSG_RESERVED_PACKAGE_LENGTH */ "Invalid package length for reserved name",
/* ASL_MSG_RESERVED_RETURN_VALUE */ "Reserved method must return a value",
/* ASL_MSG_RESERVED_USE */ "Invalid use of reserved name",
/* ASL_MSG_RESERVED_WORD */ "Use of reserved name",
/* ASL_MSG_RESOURCE_FIELD */ "Resource field name cannot be used as a target",
/* ASL_MSG_RESOURCE_INDEX */ "Missing ResourceSourceIndex (required)",
/* ASL_MSG_RESOURCE_LIST */ "Too many resource items (internal error)",
/* ASL_MSG_RESOURCE_SOURCE */ "Missing ResourceSource string (required)",
/* ASL_MSG_RESULT_NOT_USED */ "Result is not used, operator has no effect",
/* ASL_MSG_RETURN_TYPES */ "Not all control paths return a value",
/* ASL_MSG_SCOPE_FWD_REF */ "Forward references from Scope operator not allowed",
/* ASL_MSG_SCOPE_TYPE */ "Existing object has invalid type for Scope operator",
/* ASL_MSG_SEEK */ "Could not seek file",
/* ASL_MSG_SERIALIZED */ "Control Method marked Serialized",
/* ASL_MSG_SERIALIZED_REQUIRED */ "Control Method should be made Serialized",
/* ASL_MSG_SINGLE_NAME_OPTIMIZATION */ "NamePath optimized to NameSeg (uses run-time search path)",
/* ASL_MSG_SOME_NO_RETVAL */ "Called method may not always return a value",
/* ASL_MSG_STRING_LENGTH */ "String literal too long",
/* ASL_MSG_SWITCH_TYPE */ "Switch expression is not a static Integer/Buffer/String data type, defaulting to Integer",
/* ASL_MSG_SYNC_LEVEL */ "SyncLevel must be in the range 0-15",
/* ASL_MSG_SYNTAX */ "",
/* ASL_MSG_TABLE_SIGNATURE */ "Invalid Table Signature",
/* ASL_MSG_TAG_LARGER */ "ResourceTag larger than Field",
/* ASL_MSG_TAG_SMALLER */ "ResourceTag smaller than Field",
/* ASL_MSG_TIMEOUT */ "Result is not used, possible operator timeout will be missed",
/* ASL_MSG_TOO_MANY_TEMPS */ "Method requires too many temporary variables (_T_x)",
/* ASL_MSG_TRUNCATION */ "64-bit return value will be truncated to 32 bits (DSDT version < 2)",
/* ASL_MSG_UNKNOWN_RESERVED_NAME */ "Unknown reserved name",
/* ASL_MSG_UNREACHABLE_CODE */ "Statement is unreachable",
/* ASL_MSG_UNSUPPORTED */ "Unsupported feature",
/* ASL_MSG_UPPER_CASE */ "Non-hex letters must be upper case",
/* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)",
/* ASL_MSG_WRITE */ "Could not write file",
/* ASL_MSG_RANGE */ "Constant out of range",
/* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer",
/* Preprocessor */
/* ASL_MSG_DIRECTIVE_SYNTAX */ "Invalid directive syntax",
/* ASL_MSG_ENDIF_MISMATCH */ "Mismatched #endif",
/* ASL_MSG_ERROR_DIRECTIVE */ "#error",
/* ASL_MSG_EXISTING_NAME */ "Name is already defined",
/* ASL_MSG_INVALID_INVOCATION */ "Invalid macro invocation",
/* ASL_MSG_MACRO_SYNTAX */ "Invalid macro syntax",
/* ASL_MSG_TOO_MANY_ARGUMENTS */ "Too many macro arguments",
/* ASL_MSG_UNKNOWN_DIRECTIVE */ "Unknown directive",
/* ASL_MSG_UNKNOWN_PRAGMA */ "Unknown pragma",
/* ASL_MSG_WARNING_DIRECTIVE */ "#warning",
/* Table compiler */
/* ASL_MSG_BUFFER_ELEMENT */ "Invalid element in buffer initializer list",
/* ASL_MSG_DIVIDE_BY_ZERO */ "Expression contains divide-by-zero",
/* ASL_MSG_FLAG_VALUE */ "Flag value is too large",
/* ASL_MSG_INTEGER_SIZE */ "Integer too large for target",
/* ASL_MSG_INVALID_EXPRESSION */ "Invalid expression",
/* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name",
/* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant",
/* ASL_MSG_OEM_TABLE */ "OEM table - unknown contents",
/* ASL_MSG_RESERVED_VALUE */ "Reserved field must be zero",
/* ASL_MSG_UNKNOWN_LABEL */ "Label is undefined",
/* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type",
/* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature",
/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero"
};
#endif /* ASL_EXCEPTIONS */
#endif /* __ASLMESSAGES_H */

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acparser.h>
@ -108,7 +107,42 @@ MtMethodAnalysisWalkBegin (
WalkInfo->MethodStack = MethodInfo;
/* Get the name node, ignored here */
/*
* Special handling for _PSx methods. Dependency rules (same scope):
*
* 1) _PS0 - One of these must exist: _PS1, _PS2, _PS3
* 2) _PS1/_PS2/_PS3: A _PS0 must exist
*/
if (ACPI_COMPARE_NAME (METHOD_NAME__PS0, Op->Asl.NameSeg))
{
/* For _PS0, one of _PS1/_PS2/_PS3 must exist */
if ((!ApFindNameInScope (METHOD_NAME__PS1, Op)) &&
(!ApFindNameInScope (METHOD_NAME__PS2, Op)) &&
(!ApFindNameInScope (METHOD_NAME__PS3, Op)))
{
AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
"_PS0 requires one of _PS1/_PS2/_PS3 in same scope");
}
}
else if (
ACPI_COMPARE_NAME (METHOD_NAME__PS1, Op->Asl.NameSeg) ||
ACPI_COMPARE_NAME (METHOD_NAME__PS2, Op->Asl.NameSeg) ||
ACPI_COMPARE_NAME (METHOD_NAME__PS3, Op->Asl.NameSeg))
{
/* For _PS1/_PS2/_PS3, a _PS0 must exist */
if (!ApFindNameInScope (METHOD_NAME__PS0, Op))
{
sprintf (MsgBuffer,
"%4.4s requires _PS0 in same scope", Op->Asl.NameSeg);
AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
MsgBuffer);
}
}
/* Get the name node */
Next = Op->Asl.Child;
@ -359,6 +393,17 @@ MtMethodAnalysisWalkBegin (
break;
case PARSEOP_DEVICE:
Next = Op->Asl.Child;
if (!ApFindNameInScope (METHOD_NAME__HID, Next) &&
!ApFindNameInScope (METHOD_NAME__ADR, Next))
{
AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
"Device object requires a _HID or _ADR in same scope");
}
break;
case PARSEOP_EVENT:
case PARSEOP_MUTEX:
case PARSEOP_OPERATIONREGION:
@ -412,6 +457,7 @@ MtMethodAnalysisWalkBegin (
AnCheckId (Next, ASL_TYPE_CID);
}
}
break;
default:

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acnamesp.h>

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@ -68,10 +67,63 @@ static void
OpcDoEisaId (
ACPI_PARSE_OBJECT *Op);
static void
OpcDoPld (
ACPI_PARSE_OBJECT *Op);
static void
OpcDoUuId (
ACPI_PARSE_OBJECT *Op);
static UINT8 *
OpcEncodePldBuffer (
ACPI_PLD_INFO *PldInfo);
/* ToPld strings */
static char *AslPldPanelList[] =
{
"TOP",
"BOTTOM",
"LEFT",
"RIGHT",
"FRONT",
"BACK",
"UNKNOWN",
NULL
};
static char *AslPldVerticalPositionList[] =
{
"UPPER",
"CENTER",
"LOWER",
NULL
};
static char *AslPldHorizontalPositionList[] =
{
"LEFT",
"CENTER",
"RIGHT",
NULL
};
static char *AslPldShapeList[] =
{
"ROUND",
"OVAL",
"SQUARE",
"VERTICALRECTANGLE",
"HORIZONTALRECTANGLE",
"VERTICALTRAPEZOID",
"HORIZONTALTRAPEZOID",
"UNKNOWN",
"CHAMFERED",
NULL
};
/*******************************************************************************
*
@ -403,6 +455,7 @@ OpcDoConnection (
ACPI_PARSE_OBJECT *BufferOp;
ACPI_PARSE_OBJECT *BufferLengthOp;
ACPI_PARSE_OBJECT *BufferDataOp;
ASL_RESOURCE_INFO Info;
UINT8 State;
@ -417,8 +470,10 @@ OpcDoConnection (
BufferLengthOp = BufferOp->Asl.Child;
BufferDataOp = BufferLengthOp->Asl.Next;
Info.DescriptorTypeOp = BufferDataOp->Asl.Next;
Info.CurrentByteOffset = 0;
State = ACPI_RSTATE_NORMAL;
Rnode = RsDoOneResourceDescriptor (BufferDataOp->Asl.Next, 0, &State);
Rnode = RsDoOneResourceDescriptor (&Info, &State);
if (!Rnode)
{
return; /* error */
@ -623,10 +678,10 @@ OpcDoEisaId (
(UINT32) ((UINT8) (InString[1] - 0x40)) << 21 |
(UINT32) ((UINT8) (InString[2] - 0x40)) << 16 |
(UtHexCharToValue (InString[3])) << 12 |
(UtHexCharToValue (InString[4])) << 8 |
(UtHexCharToValue (InString[5])) << 4 |
UtHexCharToValue (InString[6]);
(AcpiUtAsciiCharToHex (InString[3])) << 12 |
(AcpiUtAsciiCharToHex (InString[4])) << 8 |
(AcpiUtAsciiCharToHex (InString[5])) << 4 |
AcpiUtAsciiCharToHex (InString[6]);
/* Swap to little-endian to get final ID (see function header) */
@ -649,11 +704,700 @@ OpcDoEisaId (
}
/*******************************************************************************
*
* FUNCTION: OpcEncodePldBuffer
*
* PARAMETERS: PldInfo - _PLD buffer struct (Using local struct)
*
* RETURN: Encode _PLD buffer suitable for return value from _PLD
*
* DESCRIPTION: Bit-packs a _PLD buffer struct.
*
******************************************************************************/
static UINT8 *
OpcEncodePldBuffer (
ACPI_PLD_INFO *PldInfo)
{
UINT32 *Buffer;
UINT32 Dword;
Buffer = ACPI_ALLOCATE_ZEROED (ACPI_PLD_BUFFER_SIZE);
if (!Buffer)
{
return (NULL);
}
/* First 32 bits */
Dword = 0;
ACPI_PLD_SET_REVISION (&Dword, PldInfo->Revision);
ACPI_PLD_SET_IGNORE_COLOR (&Dword, PldInfo->IgnoreColor);
ACPI_PLD_SET_RED (&Dword, PldInfo->Red);
ACPI_PLD_SET_GREEN (&Dword, PldInfo->Green);
ACPI_PLD_SET_BLUE (&Dword, PldInfo->Blue);
ACPI_MOVE_32_TO_32 (&Buffer[0], &Dword);
/* Second 32 bits */
Dword = 0;
ACPI_PLD_SET_WIDTH (&Dword, PldInfo->Width);
ACPI_PLD_SET_HEIGHT (&Dword, PldInfo->Height);
ACPI_MOVE_32_TO_32 (&Buffer[1], &Dword);
/* Third 32 bits */
Dword = 0;
ACPI_PLD_SET_USER_VISIBLE (&Dword, PldInfo->UserVisible);
ACPI_PLD_SET_DOCK (&Dword, PldInfo->Dock);
ACPI_PLD_SET_LID (&Dword, PldInfo->Lid);
ACPI_PLD_SET_PANEL (&Dword, PldInfo->Panel);
ACPI_PLD_SET_VERTICAL (&Dword, PldInfo->VerticalPosition);
ACPI_PLD_SET_HORIZONTAL (&Dword, PldInfo->HorizontalPosition);
ACPI_PLD_SET_SHAPE (&Dword, PldInfo->Shape);
ACPI_PLD_SET_ORIENTATION (&Dword, PldInfo->GroupOrientation);
ACPI_PLD_SET_TOKEN (&Dword, PldInfo->GroupToken);
ACPI_PLD_SET_POSITION (&Dword, PldInfo->GroupPosition);
ACPI_PLD_SET_BAY (&Dword, PldInfo->Bay);
ACPI_MOVE_32_TO_32 (&Buffer[2], &Dword);
/* Fourth 32 bits */
Dword = 0;
ACPI_PLD_SET_EJECTABLE (&Dword, PldInfo->Ejectable);
ACPI_PLD_SET_OSPM_EJECT (&Dword, PldInfo->OspmEjectRequired);
ACPI_PLD_SET_CABINET (&Dword, PldInfo->CabinetNumber);
ACPI_PLD_SET_CARD_CAGE (&Dword, PldInfo->CardCageNumber);
ACPI_PLD_SET_REFERENCE (&Dword, PldInfo->Reference);
ACPI_PLD_SET_ROTATION (&Dword, PldInfo->Rotation);
ACPI_PLD_SET_ORDER (&Dword, PldInfo->Order);
ACPI_MOVE_32_TO_32 (&Buffer[3], &Dword);
if (PldInfo->Revision >= 2)
{
/* Fifth 32 bits */
Dword = 0;
ACPI_PLD_SET_VERT_OFFSET (&Dword, PldInfo->VerticalOffset);
ACPI_PLD_SET_HORIZ_OFFSET (&Dword, PldInfo->HorizontalOffset);
ACPI_MOVE_32_TO_32 (&Buffer[4], &Dword);
}
return (ACPI_CAST_PTR (UINT8, Buffer));
}
/*******************************************************************************
*
* FUNCTION: OpcStrupr (strupr)
*
* PARAMETERS: SrcString - The source string to convert
*
* RETURN: None
*
* DESCRIPTION: Convert string to uppercase
*
* NOTE: This is not a POSIX function, so it appears here, not in utclib.c
*
******************************************************************************/
static void
OpcStrupr (
char *SrcString)
{
char *String;
if (!SrcString)
{
return;
}
/* Walk entire string, uppercasing the letters */
for (String = SrcString; *String; String++)
{
*String = (char) toupper ((int) *String);
}
return;
}
/*******************************************************************************
*
* FUNCTION: OpcFindName
*
* PARAMETERS: List - Array of char strings to be searched
* Name - Char string to string for
* Index - Index value to set if found
*
* RETURN: TRUE if any names matched, FALSE otherwise
*
* DESCRIPTION: Match PLD name to value in lookup table. Sets Value to
* equivalent parameter value.
*
******************************************************************************/
static BOOLEAN
OpcFindName (
char **List,
char *Name,
UINT64 *Index)
{
char *Str;
UINT32 i;
OpcStrupr (Name);
for (i = 0, Str = List[0]; Str; i++, Str = List[i])
{
if (!(ACPI_STRNCMP (Str, Name, ACPI_STRLEN (Name))))
{
*Index = i;
return (TRUE);
}
}
return (FALSE);
}
/*******************************************************************************
*
* FUNCTION: OpcDoPld
*
* PARAMETERS: Op - Parse node
*
* RETURN: None
*
* DESCRIPTION: Convert ToPLD macro to 20-byte buffer
*
******************************************************************************/
static void
OpcDoPld (
ACPI_PARSE_OBJECT *Op)
{
UINT8 *Buffer;
ACPI_PARSE_OBJECT *Node;
ACPI_PLD_INFO PldInfo;
ACPI_PARSE_OBJECT *NewOp;
if (!Op)
{
AslError(ASL_ERROR, ASL_MSG_NOT_EXIST, Op, NULL);
return;
}
if (Op->Asl.ParseOpcode != PARSEOP_TOPLD)
{
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Op, NULL);
return;
}
Buffer = UtLocalCalloc (ACPI_PLD_BUFFER_SIZE);
if (!Buffer)
{
AslError(ASL_ERROR, ASL_MSG_BUFFER_ALLOCATION, Op, NULL);
return;
}
ACPI_MEMSET (&PldInfo, 0, sizeof (ACPI_PLD_INFO));
Node = Op->Asl.Child;
while (Node)
{
switch (Node->Asl.ParseOpcode)
{
case PARSEOP_PLD_REVISION:
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
{
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
break;
}
if (Node->Asl.Child->Asl.Value.Integer > 127)
{
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
break;
}
PldInfo.Revision = (UINT8) Node->Asl.Child->Asl.Value.Integer;
break;
case PARSEOP_PLD_IGNORECOLOR:
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
{
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
break;
}
if (Node->Asl.Child->Asl.Value.Integer > 1)
{
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
break;
}
PldInfo.IgnoreColor = (UINT8) Node->Asl.Child->Asl.Value.Integer;
break;
case PARSEOP_PLD_RED:
case PARSEOP_PLD_GREEN:
case PARSEOP_PLD_BLUE:
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
{
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
break;
}
if (Node->Asl.Child->Asl.Value.Integer > 255)
{
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
break;
}
if (Node->Asl.ParseOpcode == PARSEOP_PLD_RED)
{
PldInfo.Red = (UINT8) Node->Asl.Child->Asl.Value.Integer;
}
else if (Node->Asl.ParseOpcode == PARSEOP_PLD_GREEN)
{
PldInfo.Green = (UINT8) Node->Asl.Child->Asl.Value.Integer;
}
else /* PARSEOP_PLD_BLUE */
{
PldInfo.Blue = (UINT8) Node->Asl.Child->Asl.Value.Integer;
}
break;
case PARSEOP_PLD_WIDTH:
case PARSEOP_PLD_HEIGHT:
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
{
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
break;
}
if (Node->Asl.Child->Asl.Value.Integer > 65535)
{
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
break;
}
if (Node->Asl.ParseOpcode == PARSEOP_PLD_WIDTH)
{
PldInfo.Width = (UINT16) Node->Asl.Child->Asl.Value.Integer;
}
else /* PARSEOP_PLD_HEIGHT */
{
PldInfo.Height = (UINT16) Node->Asl.Child->Asl.Value.Integer;
}
break;
case PARSEOP_PLD_USERVISIBLE:
case PARSEOP_PLD_DOCK:
case PARSEOP_PLD_LID:
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
{
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
break;
}
if (Node->Asl.Child->Asl.Value.Integer > 1)
{
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
break;
}
if (Node->Asl.ParseOpcode == PARSEOP_PLD_USERVISIBLE)
{
PldInfo.UserVisible = (UINT8) Node->Asl.Child->Asl.Value.Integer;
}
else if (Node->Asl.ParseOpcode == PARSEOP_PLD_DOCK)
{
PldInfo.Dock = (UINT8) Node->Asl.Child->Asl.Value.Integer;
}
else
{
PldInfo.Lid = (UINT8) Node->Asl.Child->Asl.Value.Integer;
}
break;
case PARSEOP_PLD_PANEL:
if (Node->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER)
{
if (Node->Asl.Child->Asl.Value.Integer > 6)
{
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
break;
}
}
else /* PARSEOP_STRING */
{
if (!OpcFindName(AslPldPanelList,
Node->Asl.Child->Asl.Value.String,
&Node->Asl.Child->Asl.Value.Integer))
{
AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Node, NULL);
break;
}
}
PldInfo.Panel = (UINT8) Node->Asl.Child->Asl.Value.Integer;
break;
case PARSEOP_PLD_VERTICALPOSITION:
if (Node->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER)
{
if (Node->Asl.Child->Asl.Value.Integer > 2)
{
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
break;
}
}
else /* PARSEOP_STRING */
{
if (!OpcFindName(AslPldVerticalPositionList,
Node->Asl.Child->Asl.Value.String,
&Node->Asl.Child->Asl.Value.Integer))
{
AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Node, NULL);
break;
}
}
PldInfo.VerticalPosition = (UINT8) Node->Asl.Child->Asl.Value.Integer;
break;
case PARSEOP_PLD_HORIZONTALPOSITION:
if (Node->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER)
{
if (Node->Asl.Child->Asl.Value.Integer > 2)
{
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
break;
}
}
else /* PARSEOP_STRING */
{
if (!OpcFindName(AslPldHorizontalPositionList,
Node->Asl.Child->Asl.Value.String,
&Node->Asl.Child->Asl.Value.Integer))
{
AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Node, NULL);
break;
}
}
PldInfo.HorizontalPosition = (UINT8) Node->Asl.Child->Asl.Value.Integer;
break;
case PARSEOP_PLD_SHAPE:
if (Node->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER)
{
if (Node->Asl.Child->Asl.Value.Integer > 8)
{
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
break;
}
}
else /* PARSEOP_STRING */
{
if (!OpcFindName(AslPldShapeList,
Node->Asl.Child->Asl.Value.String,
&Node->Asl.Child->Asl.Value.Integer))
{
AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Node, NULL);
break;
}
}
PldInfo.Shape = (UINT8) Node->Asl.Child->Asl.Value.Integer;
break;
case PARSEOP_PLD_GROUPORIENTATION:
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
{
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
break;
}
if (Node->Asl.Child->Asl.Value.Integer > 1)
{
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
break;
}
PldInfo.GroupOrientation = (UINT8) Node->Asl.Child->Asl.Value.Integer;
break;
case PARSEOP_PLD_GROUPTOKEN:
case PARSEOP_PLD_GROUPPOSITION:
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
{
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
break;
}
if (Node->Asl.Child->Asl.Value.Integer > 255)
{
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
break;
}
if (Node->Asl.ParseOpcode == PARSEOP_PLD_GROUPTOKEN)
{
PldInfo.GroupToken = (UINT8) Node->Asl.Child->Asl.Value.Integer;
}
else /* PARSEOP_PLD_GROUPPOSITION */
{
PldInfo.GroupPosition = (UINT8) Node->Asl.Child->Asl.Value.Integer;
}
break;
case PARSEOP_PLD_BAY:
case PARSEOP_PLD_EJECTABLE:
case PARSEOP_PLD_EJECTREQUIRED:
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
{
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
break;
}
if (Node->Asl.Child->Asl.Value.Integer > 1)
{
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
break;
}
if (Node->Asl.ParseOpcode == PARSEOP_PLD_BAY)
{
PldInfo.Bay = (UINT8) Node->Asl.Child->Asl.Value.Integer;
}
else if (Node->Asl.ParseOpcode == PARSEOP_PLD_EJECTABLE)
{
PldInfo.Ejectable = (UINT8) Node->Asl.Child->Asl.Value.Integer;
}
else /* PARSEOP_PLD_EJECTREQUIRED */
{
PldInfo.OspmEjectRequired = (UINT8) Node->Asl.Child->Asl.Value.Integer;
}
break;
case PARSEOP_PLD_CABINETNUMBER:
case PARSEOP_PLD_CARDCAGENUMBER:
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
{
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
break;
}
if (Node->Asl.Child->Asl.Value.Integer > 255)
{
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
break;
}
if (Node->Asl.ParseOpcode == PARSEOP_PLD_CABINETNUMBER)
{
PldInfo.CabinetNumber = (UINT8) Node->Asl.Child->Asl.Value.Integer;
}
else /* PARSEOP_PLD_CARDCAGENUMBER */
{
PldInfo.CardCageNumber = (UINT8) Node->Asl.Child->Asl.Value.Integer;
}
break;
case PARSEOP_PLD_REFERENCE:
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
{
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
break;
}
if (Node->Asl.Child->Asl.Value.Integer > 1)
{
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
break;
}
PldInfo.Reference = (UINT8) Node->Asl.Child->Asl.Value.Integer;
break;
case PARSEOP_PLD_ROTATION:
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
{
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
break;
}
if (Node->Asl.Child->Asl.Value.Integer > 7)
{
switch (Node->Asl.Child->Asl.Value.Integer)
{
case 45:
Node->Asl.Child->Asl.Value.Integer = 1;
break;
case 90:
Node->Asl.Child->Asl.Value.Integer = 2;
break;
case 135:
Node->Asl.Child->Asl.Value.Integer = 3;
break;
case 180:
Node->Asl.Child->Asl.Value.Integer = 4;
break;
case 225:
Node->Asl.Child->Asl.Value.Integer = 5;
break;
case 270:
Node->Asl.Child->Asl.Value.Integer = 6;
break;
case 315:
Node->Asl.Child->Asl.Value.Integer = 7;
break;
default:
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
break;
}
}
PldInfo.Rotation = (UINT8) Node->Asl.Child->Asl.Value.Integer;
break;
case PARSEOP_PLD_ORDER:
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
{
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
break;
}
if (Node->Asl.Child->Asl.Value.Integer > 31)
{
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
break;
}
PldInfo.Order = (UINT8) Node->Asl.Child->Asl.Value.Integer;
break;
case PARSEOP_PLD_VERTICALOFFSET:
case PARSEOP_PLD_HORIZONTALOFFSET:
if (Node->Asl.Child->Asl.ParseOpcode != PARSEOP_INTEGER)
{
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
break;
}
if (Node->Asl.Child->Asl.Value.Integer > 65535)
{
AslError(ASL_ERROR, ASL_MSG_RANGE, Node, NULL);
break;
}
if (Node->Asl.ParseOpcode == PARSEOP_PLD_VERTICALOFFSET)
{
PldInfo.VerticalOffset = (UINT16) Node->Asl.Child->Asl.Value.Integer;
}
else /* PARSEOP_PLD_HORIZONTALOFFSET */
{
PldInfo.HorizontalOffset = (UINT16) Node->Asl.Child->Asl.Value.Integer;
}
break;
default:
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, Node, NULL);
break;
}
Node = Node->Asl.Next;
}
Buffer = OpcEncodePldBuffer(&PldInfo);
/* Change Op to a Buffer */
Op->Asl.ParseOpcode = PARSEOP_BUFFER;
Op->Common.AmlOpcode = AML_BUFFER_OP;
/* Disable further optimization */
Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
UtSetParseOpName (Op);
/* Child node is the buffer length */
NewOp = TrAllocateNode (PARSEOP_INTEGER);
NewOp->Asl.AmlOpcode = AML_BYTE_OP;
NewOp->Asl.Value.Integer = 20;
NewOp->Asl.Parent = Op;
Op->Asl.Child = NewOp;
Op = NewOp;
/* Peer to the child is the raw buffer data */
NewOp = TrAllocateNode (PARSEOP_RAW_DATA);
NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
NewOp->Asl.AmlLength = 20;
NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
NewOp->Asl.Parent = Op->Asl.Parent;
Op->Asl.Next = NewOp;
}
/*******************************************************************************
*
* FUNCTION: OpcDoUuId
*
* PARAMETERS: Op - Parse node
* PARAMETERS: Op - Parse node
*
* RETURN: None
*
@ -666,12 +1410,12 @@ OpcDoUuId (
ACPI_PARSE_OBJECT *Op)
{
char *InString;
char *Buffer;
UINT8 *Buffer;
ACPI_STATUS Status = AE_OK;
ACPI_PARSE_OBJECT *NewOp;
InString = (char *) Op->Asl.Value.String;
InString = ACPI_CAST_PTR (char, Op->Asl.Value.String);
Buffer = UtLocalCalloc (16);
Status = AuValidateUuid (InString);
@ -681,7 +1425,7 @@ OpcDoUuId (
}
else
{
(void) AuConvertStringToUuid (InString, Buffer);
AcpiUtConvertStringToUuid (InString, Buffer);
}
/* Change Op to a Buffer */
@ -710,7 +1454,7 @@ OpcDoUuId (
NewOp = TrAllocateNode (PARSEOP_RAW_DATA);
NewOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
NewOp->Asl.AmlLength = 16;
NewOp->Asl.Value.String = (char *) Buffer;
NewOp->Asl.Value.String = ACPI_CAST_PTR (char, Buffer);
NewOp->Asl.Parent = Op->Asl.Parent;
Op->Asl.Next = NewOp;
@ -721,7 +1465,7 @@ OpcDoUuId (
*
* FUNCTION: OpcGenerateAmlOpcode
*
* PARAMETERS: Op - Parse node
* PARAMETERS: Op - Parse node
*
* RETURN: None
*
@ -735,7 +1479,6 @@ void
OpcGenerateAmlOpcode (
ACPI_PARSE_OBJECT *Op)
{
UINT16 Index;
@ -781,6 +1524,21 @@ OpcGenerateAmlOpcode (
OpcDoEisaId (Op);
break;
case PARSEOP_PRINTF:
OpcDoPrintf (Op);
break;
case PARSEOP_FPRINTF:
OpcDoFprintf (Op);
break;
case PARSEOP_TOPLD:
OpcDoPld (Op);
break;
case PARSEOP_TOUUID:
OpcDoUuId (Op);

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@ -913,8 +912,8 @@ OpnDoDefinitionBlock (
* We will use the AML filename that is embedded in the source file
* for the output filename.
*/
Filename = ACPI_ALLOCATE (strlen (Gbl_DirectoryPath) +
strlen ((char *) Child->Asl.Value.Buffer) + 1);
Filename = UtStringCacheCalloc (strlen (Gbl_DirectoryPath) +
strlen ((char *) Child->Asl.Value.Buffer) + 1);
/* Prepend the current directory path */
@ -922,6 +921,7 @@ OpnDoDefinitionBlock (
strcat (Filename, (char *) Child->Asl.Value.Buffer);
Gbl_OutputFilenamePrefix = Filename;
UtConvertBackslashes (Gbl_OutputFilenamePrefix);
}
Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
@ -968,7 +968,7 @@ OpnDoDefinitionBlock (
if (Child->Asl.Value.String)
{
Length = ACPI_STRLEN (Child->Asl.Value.String);
Gbl_TableId = AcpiOsAllocate (Length + 1);
Gbl_TableId = UtStringCacheCalloc (Length + 1);
ACPI_STRCPY (Gbl_TableId, Child->Asl.Value.String);
/*

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@ -168,7 +167,7 @@ OptSearchToRoot (
/* We must allocate a new string for the name (TargetPath gets deleted) */
*NewPath = ACPI_ALLOCATE_ZEROED (ACPI_NAME_SIZE + 1);
*NewPath = UtStringCacheCalloc (ACPI_NAME_SIZE + 1);
ACPI_STRCPY (*NewPath, Path);
if (ACPI_STRNCMP (*NewPath, "_T_", 3))
@ -576,7 +575,8 @@ OptOptimizeNamePath (
return_VOID;
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "%5d [%12.12s] [%12.12s] ",
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
"PATH OPTIMIZE: Line %5d ParentOp [%12.12s] ThisOp [%12.12s] ",
Op->Asl.LogicalLineNumber,
AcpiPsGetOpcodeName (Op->Common.Parent->Common.AmlOpcode),
AcpiPsGetOpcodeName (Op->Common.AmlOpcode)));
@ -620,7 +620,7 @@ OptOptimizeNamePath (
{
/* This is the declaration of a new name */
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "NAME"));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "NAME\n"));
/*
* The node of interest is the parent of this node (the containing
@ -646,7 +646,7 @@ OptOptimizeNamePath (
{
/* This is a reference to an existing named object */
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "REF "));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "REFERENCE\n"));
}
/*
@ -688,9 +688,10 @@ OptOptimizeNamePath (
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
"%37s (%2u) ==> %-32s(%2u) %-32s",
(char *) CurrentPath.Pointer, (UINT32) CurrentPath.Length,
(char *) TargetPath.Pointer, (UINT32) TargetPath.Length, ExternalNameString));
"CURRENT SCOPE: (%2u) %-37s FULL PATH TO NAME: (%2u) %-32s ACTUAL AML:%-32s\n",
(UINT32) CurrentPath.Length, (char *) CurrentPath.Pointer,
(UINT32) TargetPath.Length, (char *) TargetPath.Pointer,
ExternalNameString));
ACPI_FREE (ExternalNameString);
@ -747,7 +748,8 @@ OptOptimizeNamePath (
HowMuchShorter = (AmlNameStringLength - ACPI_STRLEN (NewPath));
OptTotal += HowMuchShorter;
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, " REDUCED %2u (%u)",
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
" REDUCED BY %2u (TOTAL SAVED %2u)",
(UINT32) HowMuchShorter, OptTotal));
if (Flags & AML_NAMED)

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -118,8 +118,7 @@ AslCommandLine (
/* Next parameter must be the input filename */
if (!argv[AcpiGbl_Optind] &&
!Gbl_DisasmFlag &&
!Gbl_GetAllTables)
!Gbl_DisasmFlag)
{
printf ("Missing input filename\n");
BadCommandLine = TRUE;
@ -169,7 +168,7 @@ AslDoOptions (
/* Get the command line options */
while ((j = AcpiGetopt (argc, argv, ASL_SUPPORTED_OPTIONS)) != EOF) switch (j)
while ((j = AcpiGetopt (argc, argv, ASL_SUPPORTED_OPTIONS)) != ACPI_OPT_END) switch (j)
{
case '@': /* Begin a response file */
@ -185,7 +184,7 @@ AslDoOptions (
}
break;
case 'b': /* Debug output options */
case 'b': /* Debug options */
switch (AcpiGbl_Optarg[0])
{
@ -194,10 +193,37 @@ AslDoOptions (
AslCompilerdebug = 1; /* same as yydebug */
DtParserdebug = 1;
PrParserdebug = 1;
Gbl_DebugFlag = TRUE;
break;
case 'p': /* Prune ASL parse tree */
/* Get the required argument */
if (AcpiGetoptArgument (argc, argv))
{
return (-1);
}
Gbl_PruneParseTree = TRUE;
Gbl_PruneDepth = (UINT8) strtoul (AcpiGbl_Optarg, NULL, 0);
break;
case 's':
Gbl_DebugFlag = TRUE;
break;
case 't':
/* Get the required argument */
if (AcpiGetoptArgument (argc, argv))
{
return (-1);
}
Gbl_PruneType = (UINT8) strtoul (AcpiGbl_Optarg, NULL, 0);
break;
default:
@ -206,9 +232,6 @@ AslDoOptions (
return (-1);
}
/* Produce debug output file */
Gbl_DebugFlag = TRUE;
break;
case 'c':
@ -251,6 +274,12 @@ AslDoOptions (
break;
case 'l': /* Use legacy ASL code (not ASL+) for disassembly */
Gbl_DoCompile = FALSE;
AcpiGbl_CstyleDisassembly = FALSE;
break;
default:
printf ("Unknown option: -d%s\n", AcpiGbl_Optarg);
@ -267,11 +296,22 @@ AslDoOptions (
case 'e': /* External files for disassembler */
Status = AcpiDmAddToExternalFileList (AcpiGbl_Optarg);
if (ACPI_FAILURE (Status))
/* Get entire list of external files */
AcpiGbl_Optind--;
argv[AcpiGbl_Optind] = AcpiGbl_Optarg;
while (argv[AcpiGbl_Optind] &&
(argv[AcpiGbl_Optind][0] != '-'))
{
printf ("Could not add %s to external list\n", AcpiGbl_Optarg);
return (-1);
Status = AcpiDmAddToExternalFileList (argv[AcpiGbl_Optind]);
if (ACPI_FAILURE (Status))
{
printf ("Could not add %s to external list\n", argv[AcpiGbl_Optind]);
return (-1);
}
AcpiGbl_Optind++;
}
break;
@ -308,9 +348,8 @@ AslDoOptions (
case 'g': /* Get all ACPI tables */
Gbl_GetAllTables = TRUE;
Gbl_DoCompile = FALSE;
break;
printf ("-g option is deprecated, use acpidump utility instead\n");
exit (1);
case 'h':
@ -404,6 +443,13 @@ AslDoOptions (
Gbl_PreprocessorOutputFlag = TRUE;
break;
case 'm':
/* Produce hardware map summary file */
Gbl_MapfileFlag = TRUE;
break;
case 'n':
/* Produce namespace file */
@ -513,6 +559,7 @@ AslDoOptions (
case 'p': /* Override default AML output filename */
Gbl_OutputFilenamePrefix = AcpiGbl_Optarg;
UtConvertBackslashes (Gbl_OutputFilenamePrefix);
Gbl_UseDefaultAmlFilename = FALSE;
break;
@ -596,11 +643,19 @@ AslDoOptions (
case 'a':
/* Disable All error/warning messages */
/* Disable all error/warning/remark messages */
Gbl_NoErrors = TRUE;
break;
case 'e':
/* Disable all warning/remark messages (errors only) */
Gbl_DisplayRemarks = FALSE;
Gbl_DisplayWarnings = FALSE;
break;
case 'i':
/*
* Support for integrated development environment(s).

View File

@ -0,0 +1,131 @@
%{
/******************************************************************************
*
* Module Name: aslparser.y - Master Bison/Yacc input file for iASL
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslparse")
/*
* Global Notes:
*
* October 2005: The following list terms have been optimized (from the
* original ASL grammar in the ACPI specification) to force the immediate
* reduction of each list item so that the parse stack use doesn't increase on
* each list element and possibly overflow on very large lists (>4000 items).
* This dramatically reduces use of the parse stack overall.
*
* ArgList, TermList, Objectlist, ByteList, DWordList, PackageList,
* ResourceMacroList, and FieldUnitList
*/
void *
AslLocalAllocate (
unsigned int Size);
/* Bison/yacc configuration */
#define static
#undef malloc
#define malloc AslLocalAllocate
#undef alloca
#define alloca AslLocalAllocate
#define yytname AslCompilername
#define YYINITDEPTH 600 /* State stack depth */
#define YYDEBUG 1 /* Enable debug output */
#define YYERROR_VERBOSE 1 /* Verbose error messages */
#define YYFLAG -32768
/* Define YYMALLOC/YYFREE to prevent redefinition errors */
#define YYMALLOC AslLocalAllocate
#define YYFREE ACPI_FREE
%}
/*
* Declare the type of values in the grammar
*/
%union {
UINT64 i;
char *s;
ACPI_PARSE_OBJECT *n;
}
/*
* These shift/reduce conflicts are expected. There should be zero
* reduce/reduce conflicts.
*/
%expect 89
/*! [Begin] no source code translation */
/*
* The M4 macro processor is used to bring in the parser items,
* in order to keep this master file smaller, and to break up
* the various parser items.
*/
m4_define(NoEcho)
/* Token types */
m4_include(asltokens.y)
/* Production types/names */
m4_include(asltypes.y)
%%
/* Production rules */
m4_include(aslrules.y)
%%
/*! [End] no source code translation !*/
/* Local support functions in C */
m4_include(aslsupport.y)

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -251,10 +251,16 @@ ApCheckPredefinedReturnValue (
const ACPI_PREDEFINED_INFO *ThisName;
/* Check parent method for a match against the predefined name list */
/*
* Check parent method for a match against the predefined name list.
*
* Note: Disable compiler errors/warnings because any errors will be
* caught when analyzing the parent method. Eliminates duplicate errors.
*/
Gbl_AllExceptionsDisabled = TRUE;
Index = ApCheckForPredefinedName (MethodInfo->Op,
MethodInfo->Op->Asl.NameSeg);
Gbl_AllExceptionsDisabled = FALSE;
switch (Index)
{

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -169,7 +169,7 @@ ApCheckPackage (
{
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
@ -194,7 +194,7 @@ ApCheckPackage (
case ACPI_PTYPE1_VAR:
/*
* The package count is variable, there are no sub-packages,
* The package count is variable, there are no subpackages,
* and all elements must be of the same type
*/
for (i = 0; i < Count; i++)
@ -207,7 +207,7 @@ ApCheckPackage (
case ACPI_PTYPE1_OPTION:
/*
* The package count is variable, there are no sub-packages.
* The package count is variable, there are no subpackages.
* There are a fixed number of required elements, and a variable
* number of optional elements.
*
@ -251,7 +251,7 @@ ApCheckPackage (
Op = Op->Asl.Next;
Count--;
/* Examine the sub-packages */
/* Examine the subpackages */
ApCheckPackageList (Predefined->Info.Name, Op,
Package, 1, Count);
@ -259,7 +259,7 @@ ApCheckPackage (
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 = ApCheckObjectType (Predefined->Info.Name, Op,
ACPI_RTYPE_INTEGER, 0);
@ -283,12 +283,47 @@ ApCheckPackage (
Op = Op->Asl.Next;
/* Examine the sub-packages */
/* Examine the subpackages */
ApCheckPackageList (Predefined->Info.Name, Op,
Package, 1, Count);
break;
case ACPI_PTYPE2_UUID_PAIR:
/* The package contains a variable list of UUID Buffer/Package pairs */
/* The length of the package must be even */
if (Count & 1)
{
sprintf (MsgBuffer, "%4.4s: Package length, %d, must be even.",
Predefined->Info.Name, Count);
AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH,
ParentOp->Asl.Child, MsgBuffer);
}
/* Validate the alternating types */
for (i = 0; i < Count; ++i)
{
if (i & 1)
{
ApCheckObjectType (Predefined->Info.Name, Op,
Package->RetInfo.ObjectType2, i);
}
else
{
ApCheckObjectType (Predefined->Info.Name, Op,
Package->RetInfo.ObjectType1, i);
}
Op = Op->Asl.Next;
}
break;
case ACPI_PTYPE2:
case ACPI_PTYPE2_FIXED:
case ACPI_PTYPE2_MIN:
@ -296,10 +331,10 @@ ApCheckPackage (
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.
*/
/* Examine the sub-packages */
/* Examine the subpackages */
ApCheckPackageList (Predefined->Info.Name, Op,
Package, 0, Count);
@ -467,6 +502,12 @@ ApCheckPackageList (
Count, ExpectedCount);
break;
}
if (Count > ExpectedCount)
{
ApPackageTooLarge (PredefinedName, SubPackageOp,
Count, ExpectedCount);
break;
}
ApCheckPackageElements (PredefinedName, Op,
Package->RetInfo.ObjectType1, Package->RetInfo.Count1,
@ -494,7 +535,7 @@ ApCheckPackageList (
case ACPI_PTYPE2_FIXED:
/* Each sub-package has a fixed length */
/* Each subpackage has a fixed length */
ExpectedCount = Package->RetInfo2.Count;
if (Count < ExpectedCount)
@ -503,6 +544,12 @@ ApCheckPackageList (
Count, ExpectedCount);
break;
}
if (Count > ExpectedCount)
{
ApPackageTooLarge (PredefinedName, SubPackageOp,
Count, ExpectedCount);
break;
}
/* Check each object/type combination */
@ -517,7 +564,7 @@ ApCheckPackageList (
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 (Count < ExpectedCount)
@ -527,7 +574,7 @@ ApCheckPackageList (
break;
}
/* Check the type of each sub-package element */
/* Check the type of each subpackage element */
ApCheckPackageElements (PredefinedName, Op,
Package->RetInfo.ObjectType1, Count, 0, 0);
@ -576,7 +623,7 @@ ApCheckPackageList (
Count = ExpectedCount;
}
/* Check the type of each sub-package element */
/* Check the type of each subpackage element */
Op = Op->Asl.Next;
ApCheckPackageElements (PredefinedName, Op,

View File

@ -0,0 +1,380 @@
/******************************************************************************
*
* Module Name: aslprintf - ASL Printf/Fprintf macro support
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslprintf")
/* Local prototypes */
static void
OpcCreateConcatenateNode (
ACPI_PARSE_OBJECT *Op,
ACPI_PARSE_OBJECT *Node);
static void
OpcParsePrintf (
ACPI_PARSE_OBJECT *Op,
ACPI_PARSE_OBJECT *DestOp);
/*******************************************************************************
*
* FUNCTION: OpcDoPrintf
*
* PARAMETERS: Op - printf parse node
*
* RETURN: None
*
* DESCRIPTION: Convert printf macro to a Store(..., Debug) AML operation.
*
******************************************************************************/
void
OpcDoPrintf (
ACPI_PARSE_OBJECT *Op)
{
ACPI_PARSE_OBJECT *DestOp;
/* Store destination is the Debug op */
DestOp = TrAllocateNode (PARSEOP_DEBUG);
DestOp->Asl.AmlOpcode = AML_DEBUG_OP;
DestOp->Asl.Parent = Op;
DestOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
OpcParsePrintf (Op, DestOp);
}
/*******************************************************************************
*
* FUNCTION: OpcDoFprintf
*
* PARAMETERS: Op - fprintf parse node
*
* RETURN: None
*
* DESCRIPTION: Convert fprintf macro to a Store AML operation.
*
******************************************************************************/
void
OpcDoFprintf (
ACPI_PARSE_OBJECT *Op)
{
ACPI_PARSE_OBJECT *DestOp;
/* Store destination is the first argument of fprintf */
DestOp = Op->Asl.Child;
Op->Asl.Child = DestOp->Asl.Next;
DestOp->Asl.Next = NULL;
OpcParsePrintf (Op, DestOp);
}
/*******************************************************************************
*
* FUNCTION: OpcParsePrintf
*
* PARAMETERS: Op - Printf parse node
* DestOp - Destination of Store operation
*
* RETURN: None
*
* DESCRIPTION: Convert printf macro to a Store AML operation. The printf
* macro parse tree is layed out as follows:
*
* Op - printf parse op
* Op->Child - Format string
* Op->Next - Format string arguments
*
******************************************************************************/
static void
OpcParsePrintf (
ACPI_PARSE_OBJECT *Op,
ACPI_PARSE_OBJECT *DestOp)
{
char *Format;
char *StartPosition = NULL;
ACPI_PARSE_OBJECT *ArgNode;
ACPI_PARSE_OBJECT *NextNode;
UINT32 StringLength = 0;
char *NewString;
BOOLEAN StringToProcess = FALSE;
ACPI_PARSE_OBJECT *NewOp;
/* Get format string */
Format = ACPI_CAST_PTR (char, Op->Asl.Child->Asl.Value.String);
ArgNode = Op->Asl.Child->Asl.Next;
/*
* Detach argument list so that we can use a NULL check to distinguish
* the first concatenation operation we need to make
*/
Op->Asl.Child = NULL;
for (; *Format; ++Format)
{
if (*Format != '%')
{
if (!StringToProcess)
{
/* Mark the beginning of a string */
StartPosition = Format;
StringToProcess = TRUE;
}
++StringLength;
continue;
}
/* Save string, if any, to new string object and concat it */
if (StringToProcess)
{
NewString = UtStringCacheCalloc (StringLength + 1);
ACPI_STRNCPY (NewString, StartPosition, StringLength);
NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
NewOp->Asl.Value.String = NewString;
NewOp->Asl.AmlOpcode = AML_STRING_OP;
NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING;
NewOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
OpcCreateConcatenateNode(Op, NewOp);
StringLength = 0;
StringToProcess = FALSE;
}
++Format;
/*
* We have a format parameter and will need an argument to go
* with it
*/
if (!ArgNode ||
ArgNode->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
{
AslError(ASL_ERROR, ASL_MSG_ARG_COUNT_LO, Op, NULL);
return;
}
/*
* We do not support sub-specifiers of printf (flags, width,
* precision, length). For specifiers we only support %x/%X for
* hex or %s for strings. Also, %o for generic "acpi object".
*/
switch (*Format)
{
case 's':
if (ArgNode->Asl.ParseOpcode != PARSEOP_STRING_LITERAL)
{
AslError(ASL_ERROR, ASL_MSG_INVALID_TYPE, ArgNode,
"String required");
return;
}
NextNode = ArgNode->Asl.Next;
ArgNode->Asl.Next = NULL;
OpcCreateConcatenateNode(Op, ArgNode);
ArgNode = NextNode;
continue;
case 'X':
case 'x':
case 'o':
NextNode = ArgNode->Asl.Next;
ArgNode->Asl.Next = NULL;
/*
* Append an empty string if the first argument is
* not a string. This will implicitly conver the 2nd
* concat source to a string per the ACPI specification.
*/
if (!Op->Asl.Child)
{
NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
NewOp->Asl.Value.String = "";
NewOp->Asl.AmlOpcode = AML_STRING_OP;
NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING;
NewOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
OpcCreateConcatenateNode(Op, NewOp);
}
OpcCreateConcatenateNode(Op, ArgNode);
ArgNode = NextNode;
break;
default:
AslError(ASL_ERROR, ASL_MSG_INVALID_OPERAND, Op,
"Unrecognized format specifier");
continue;
}
}
/* Process any remaining string */
if (StringToProcess)
{
NewString = UtStringCacheCalloc (StringLength + 1);
ACPI_STRNCPY (NewString, StartPosition, StringLength);
NewOp = TrAllocateNode (PARSEOP_STRING_LITERAL);
NewOp->Asl.Value.String = NewString;
NewOp->Asl.AcpiBtype = ACPI_BTYPE_STRING;
NewOp->Asl.AmlOpcode = AML_STRING_OP;
NewOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
OpcCreateConcatenateNode(Op, NewOp);
}
/*
* If we get here and there's no child node then Format
* was an empty string. Just make a no op.
*/
if (!Op->Asl.Child)
{
Op->Asl.ParseOpcode = PARSEOP_NOOP;
AslError(ASL_WARNING, ASL_MSG_NULL_STRING, Op,
"Converted to NOOP");
return;
}
/* Check for erroneous extra arguments */
if (ArgNode &&
ArgNode->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
{
AslError(ASL_WARNING, ASL_MSG_ARG_COUNT_HI, ArgNode,
"Extra arguments ignored");
}
/* Change Op to a Store */
Op->Asl.ParseOpcode = PARSEOP_STORE;
Op->Common.AmlOpcode = AML_STORE_OP;
Op->Asl.CompileFlags = 0;
/* Disable further optimization */
Op->Asl.CompileFlags &= ~NODE_COMPILE_TIME_CONST;
UtSetParseOpName (Op);
/* Set Store destination */
Op->Asl.Child->Asl.Next = DestOp;
}
/*******************************************************************************
*
* FUNCTION: OpcCreateConcatenateNode
*
* PARAMETERS: Op - Parse node
* Node - Parse node to be concatenated
*
* RETURN: None
*
* DESCRIPTION: Make Node the child of Op. If child node already exists, then
* concat child with Node and makes concat node the child of Op.
*
******************************************************************************/
static void
OpcCreateConcatenateNode (
ACPI_PARSE_OBJECT *Op,
ACPI_PARSE_OBJECT *Node)
{
ACPI_PARSE_OBJECT *NewConcatOp;
if (!Op->Asl.Child)
{
Op->Asl.Child = Node;
Node->Asl.Parent = Op;
return;
}
NewConcatOp = TrAllocateNode (PARSEOP_CONCATENATE);
NewConcatOp->Asl.AmlOpcode = AML_CONCAT_OP;
NewConcatOp->Asl.AcpiBtype = 0x7;
NewConcatOp->Asl.LogicalLineNumber = Op->Asl.LogicalLineNumber;
/* First arg is child of Op*/
NewConcatOp->Asl.Child = Op->Asl.Child;
Op->Asl.Child->Asl.Parent = NewConcatOp;
/* Second arg is Node */
NewConcatOp->Asl.Child->Asl.Next = Node;
Node->Asl.Parent = NewConcatOp;
/* Third arg is Zero (not used) */
NewConcatOp->Asl.Child->Asl.Next->Asl.Next =
TrAllocateNode (PARSEOP_ZERO);
NewConcatOp->Asl.Child->Asl.Next->Asl.Next->Asl.Parent =
NewConcatOp;
Op->Asl.Child = NewConcatOp;
NewConcatOp->Asl.Parent = Op;
}

View File

@ -0,0 +1,239 @@
/******************************************************************************
*
* Module Name: aslprune - Parse tree prune utility
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acapps.h>
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslprune")
/* Local prototypes */
static ACPI_STATUS
PrTreePruneWalk (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context);
static void
PrPrintObjectAtLevel (
UINT32 Level,
const char *ObjectName);
typedef struct acpi_prune_info
{
UINT32 PruneLevel;
UINT16 ParseOpcode;
UINT16 Count;
} ACPI_PRUNE_INFO;
/*******************************************************************************
*
* FUNCTION: AslPruneParseTree
*
* PARAMETERS: PruneDepth - Number of levels to prune
* Type - Prune type (Device, Method, etc.)
*
* RETURN: None
*
* DESCRIPTION: Prune off one or more levels of the ASL parse tree
*
******************************************************************************/
void
AslPruneParseTree (
UINT32 PruneDepth,
UINT32 Type)
{
ACPI_PRUNE_INFO PruneObj;
PruneObj.PruneLevel = PruneDepth;
PruneObj.Count = 0;
switch (Type)
{
case 0:
PruneObj.ParseOpcode = (UINT16) PARSEOP_DEVICE;
break;
case 1:
PruneObj.ParseOpcode = (UINT16) PARSEOP_METHOD;
break;
case 2:
PruneObj.ParseOpcode = (UINT16) PARSEOP_IF;
break;
default:
AcpiOsPrintf ("Unsupported type: %u\n", Type);
return;
}
AcpiOsPrintf ("Pruning parse tree, from depth %u\n",
PruneDepth);
AcpiOsPrintf ("\nRemoving Objects:\n");
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
PrTreePruneWalk, NULL, ACPI_CAST_PTR (void, &PruneObj));
AcpiOsPrintf ("\n%u Total Objects Removed\n", PruneObj.Count);
}
/*******************************************************************************
*
* FUNCTION: PrPrintObjectAtLevel
*
* PARAMETERS: Level - Current nesting level
* ObjectName - ACPI name for the object
*
* RETURN: None
*
* DESCRIPTION: Print object name with indent
*
******************************************************************************/
static void
PrPrintObjectAtLevel (
UINT32 Level,
const char *ObjectName)
{
UINT32 i;
for (i = 0; i < Level; i++)
{
AcpiOsPrintf (" ");
}
AcpiOsPrintf ("[%s] at Level [%u]\n", ObjectName, Level);
}
/*******************************************************************************
*
* FUNCTION: PrTreePruneWalk
*
* PARAMETERS: Parse tree walk callback
*
* RETURN: Status
*
* DESCRIPTION: Prune off one or more levels of the ASL parse tree
*
* Current objects that can be pruned are: Devices, Methods, and If/Else
* blocks.
*
******************************************************************************/
static ACPI_STATUS
PrTreePruneWalk (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
ACPI_PRUNE_INFO *PruneObj = (ACPI_PRUNE_INFO *) Context;
/* We only care about objects below the Prune Level threshold */
if (Level <= PruneObj->PruneLevel)
{
return (AE_OK);
}
if ((Op->Asl.ParseOpcode != PruneObj->ParseOpcode) &&
!(Op->Asl.ParseOpcode == PARSEOP_ELSE &&
PruneObj->ParseOpcode == PARSEOP_IF))
{
return (AE_OK);
}
switch (Op->Asl.ParseOpcode)
{
case PARSEOP_METHOD:
AcpiOsPrintf ("Method");
PrPrintObjectAtLevel (Level, Op->Asl.Child->Asl.Value.Name);
Op->Asl.Child->Asl.Next->Asl.Next->Asl.Next->Asl.Next->Asl.Next->Asl.Next = NULL;
PruneObj->Count++;
break;
case PARSEOP_DEVICE:
AcpiOsPrintf ("Device");
PrPrintObjectAtLevel (Level, Op->Asl.Child->Asl.Value.Name);
Op->Asl.Child->Asl.Next = NULL;
PruneObj->Count++;
break;
case PARSEOP_IF:
case PARSEOP_ELSE:
if (Op->Asl.ParseOpcode == PARSEOP_ELSE)
{
PrPrintObjectAtLevel(Level, "Else");
Op->Asl.Child = NULL;
}
else
{
PrPrintObjectAtLevel(Level, "If");
Op->Asl.Child->Asl.Next = NULL;
}
PruneObj->Count++;
break;
default:
break;
}
return (AE_OK);
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@ -123,22 +122,10 @@ RsSmallAddressCheck (
return;
}
/* Special case for Memory24, values are compressed */
if (Type == ACPI_RESOURCE_NAME_MEMORY24)
{
if (!Alignment) /* Alignment==0 means 64K - no invalid alignment */
{
Alignment = ACPI_UINT16_MAX + 1;
}
Minimum <<= 8;
Maximum <<= 8;
Length *= 256;
}
/* IO descriptor has different definition of min/max, don't check */
/*
* Range checks for Memory24 and Memory32.
* IO descriptor has different definition of min/max, don't check.
*/
if (Type != ACPI_RESOURCE_NAME_IO)
{
/* Basic checks on Min/Max/Length */
@ -151,6 +138,19 @@ RsSmallAddressCheck (
{
AslError (ASL_ERROR, ASL_MSG_INVALID_LENGTH, LengthOp, NULL);
}
/* Special case for Memory24, min/max values are compressed */
if (Type == ACPI_RESOURCE_NAME_MEMORY24)
{
if (!Alignment) /* Alignment==0 means 64K alignment */
{
Alignment = ACPI_UINT16_MAX + 1;
}
Minimum <<= 8;
Maximum <<= 8;
}
}
/* Alignment of zero is not in ACPI spec, but is used to mean byte acc */
@ -645,8 +645,7 @@ RsCheckListForDuplicates (
ASL_RESOURCE_NODE *
RsDoOneResourceDescriptor (
ACPI_PARSE_OBJECT *DescriptorTypeOp,
UINT32 CurrentByteOffset,
ASL_RESOURCE_INFO *Info,
UINT8 *State)
{
ASL_RESOURCE_NODE *Rnode = NULL;
@ -654,36 +653,31 @@ RsDoOneResourceDescriptor (
/* Construct the resource */
switch (DescriptorTypeOp->Asl.ParseOpcode)
switch (Info->DescriptorTypeOp->Asl.ParseOpcode)
{
case PARSEOP_DMA:
Rnode = RsDoDmaDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoDmaDescriptor (Info);
break;
case PARSEOP_FIXEDDMA:
Rnode = RsDoFixedDmaDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoFixedDmaDescriptor (Info);
break;
case PARSEOP_DWORDIO:
Rnode = RsDoDwordIoDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoDwordIoDescriptor (Info);
break;
case PARSEOP_DWORDMEMORY:
Rnode = RsDoDwordMemoryDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoDwordMemoryDescriptor (Info);
break;
case PARSEOP_DWORDSPACE:
Rnode = RsDoDwordSpaceDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoDwordSpaceDescriptor (Info);
break;
case PARSEOP_ENDDEPENDENTFN:
@ -693,13 +687,13 @@ RsDoOneResourceDescriptor (
case ACPI_RSTATE_NORMAL:
AslError (ASL_ERROR, ASL_MSG_MISSING_STARTDEPENDENT,
DescriptorTypeOp, NULL);
Info->DescriptorTypeOp, NULL);
break;
case ACPI_RSTATE_START_DEPENDENT:
AslError (ASL_ERROR, ASL_MSG_DEPENDENT_NESTING,
DescriptorTypeOp, NULL);
Info->DescriptorTypeOp, NULL);
break;
case ACPI_RSTATE_DEPENDENT_LIST:
@ -709,104 +703,87 @@ RsDoOneResourceDescriptor (
}
*State = ACPI_RSTATE_NORMAL;
Rnode = RsDoEndDependentDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoEndDependentDescriptor (Info);
break;
case PARSEOP_ENDTAG:
Rnode = RsDoEndTagDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoEndTagDescriptor (Info);
break;
case PARSEOP_EXTENDEDIO:
Rnode = RsDoExtendedIoDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoExtendedIoDescriptor (Info);
break;
case PARSEOP_EXTENDEDMEMORY:
Rnode = RsDoExtendedMemoryDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoExtendedMemoryDescriptor (Info);
break;
case PARSEOP_EXTENDEDSPACE:
Rnode = RsDoExtendedSpaceDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoExtendedSpaceDescriptor (Info);
break;
case PARSEOP_FIXEDIO:
Rnode = RsDoFixedIoDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoFixedIoDescriptor (Info);
break;
case PARSEOP_INTERRUPT:
Rnode = RsDoInterruptDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoInterruptDescriptor (Info);
break;
case PARSEOP_IO:
Rnode = RsDoIoDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoIoDescriptor (Info);
break;
case PARSEOP_IRQ:
Rnode = RsDoIrqDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoIrqDescriptor (Info);
break;
case PARSEOP_IRQNOFLAGS:
Rnode = RsDoIrqNoFlagsDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoIrqNoFlagsDescriptor (Info);
break;
case PARSEOP_MEMORY24:
Rnode = RsDoMemory24Descriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoMemory24Descriptor (Info);
break;
case PARSEOP_MEMORY32:
Rnode = RsDoMemory32Descriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoMemory32Descriptor (Info);
break;
case PARSEOP_MEMORY32FIXED:
Rnode = RsDoMemory32FixedDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoMemory32FixedDescriptor (Info);
break;
case PARSEOP_QWORDIO:
Rnode = RsDoQwordIoDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoQwordIoDescriptor (Info);
break;
case PARSEOP_QWORDMEMORY:
Rnode = RsDoQwordMemoryDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoQwordMemoryDescriptor (Info);
break;
case PARSEOP_QWORDSPACE:
Rnode = RsDoQwordSpaceDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoQwordSpaceDescriptor (Info);
break;
case PARSEOP_REGISTER:
Rnode = RsDoGeneralRegisterDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoGeneralRegisterDescriptor (Info);
break;
case PARSEOP_STARTDEPENDENTFN:
@ -816,7 +793,7 @@ RsDoOneResourceDescriptor (
case ACPI_RSTATE_START_DEPENDENT:
AslError (ASL_ERROR, ASL_MSG_DEPENDENT_NESTING,
DescriptorTypeOp, NULL);
Info->DescriptorTypeOp, NULL);
break;
case ACPI_RSTATE_NORMAL:
@ -827,8 +804,7 @@ RsDoOneResourceDescriptor (
}
*State = ACPI_RSTATE_START_DEPENDENT;
Rnode = RsDoStartDependentDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoStartDependentDescriptor (Info);
*State = ACPI_RSTATE_DEPENDENT_LIST;
break;
@ -839,7 +815,7 @@ RsDoOneResourceDescriptor (
case ACPI_RSTATE_START_DEPENDENT:
AslError (ASL_ERROR, ASL_MSG_DEPENDENT_NESTING,
DescriptorTypeOp, NULL);
Info->DescriptorTypeOp, NULL);
break;
case ACPI_RSTATE_NORMAL:
@ -850,69 +826,58 @@ RsDoOneResourceDescriptor (
}
*State = ACPI_RSTATE_START_DEPENDENT;
Rnode = RsDoStartDependentNoPriDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoStartDependentNoPriDescriptor (Info);
*State = ACPI_RSTATE_DEPENDENT_LIST;
break;
case PARSEOP_VENDORLONG:
Rnode = RsDoVendorLargeDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoVendorLargeDescriptor (Info);
break;
case PARSEOP_VENDORSHORT:
Rnode = RsDoVendorSmallDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoVendorSmallDescriptor (Info);
break;
case PARSEOP_WORDBUSNUMBER:
Rnode = RsDoWordBusNumberDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoWordBusNumberDescriptor (Info);
break;
case PARSEOP_WORDIO:
Rnode = RsDoWordIoDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoWordIoDescriptor (Info);
break;
case PARSEOP_WORDSPACE:
Rnode = RsDoWordSpaceDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoWordSpaceDescriptor (Info);
break;
case PARSEOP_GPIO_INT:
Rnode = RsDoGpioIntDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoGpioIntDescriptor (Info);
break;
case PARSEOP_GPIO_IO:
Rnode = RsDoGpioIoDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoGpioIoDescriptor (Info);
break;
case PARSEOP_I2C_SERIALBUS:
Rnode = RsDoI2cSerialBusDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoI2cSerialBusDescriptor (Info);
break;
case PARSEOP_SPI_SERIALBUS:
Rnode = RsDoSpiSerialBusDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoSpiSerialBusDescriptor (Info);
break;
case PARSEOP_UART_SERIALBUS:
Rnode = RsDoUartSerialBusDescriptor (DescriptorTypeOp,
CurrentByteOffset);
Rnode = RsDoUartSerialBusDescriptor (Info);
break;
case PARSEOP_DEFAULT_ARG:
@ -923,7 +888,7 @@ RsDoOneResourceDescriptor (
default:
printf ("Unknown resource descriptor type [%s]\n",
DescriptorTypeOp->Asl.ParseOpName);
Info->DescriptorTypeOp->Asl.ParseOpName);
break;
}
@ -932,14 +897,14 @@ RsDoOneResourceDescriptor (
* This allows the resource to be installed in the namespace so that
* references to the descriptor can be resolved.
*/
DescriptorTypeOp->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
DescriptorTypeOp->Asl.CompileFlags = NODE_IS_RESOURCE_DESC;
DescriptorTypeOp->Asl.Value.Integer = CurrentByteOffset;
Info->DescriptorTypeOp->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
Info->DescriptorTypeOp->Asl.CompileFlags = NODE_IS_RESOURCE_DESC;
Info->DescriptorTypeOp->Asl.Value.Integer = Info->CurrentByteOffset;
if (Rnode)
{
DescriptorTypeOp->Asl.FinalAmlLength = Rnode->BufferLength;
DescriptorTypeOp->Asl.Extra = ((AML_RESOURCE *) Rnode->Buffer)->DescriptorType;
Info->DescriptorTypeOp->Asl.FinalAmlLength = Rnode->BufferLength;
Info->DescriptorTypeOp->Asl.Extra = ((AML_RESOURCE *) Rnode->Buffer)->DescriptorType;
}
return (Rnode);
@ -1023,6 +988,7 @@ RsDoResourceTemplate (
ASL_RESOURCE_NODE HeadRnode;
ASL_RESOURCE_NODE *PreviousRnode;
ASL_RESOURCE_NODE *Rnode;
ASL_RESOURCE_INFO Info;
UINT8 State;
@ -1055,9 +1021,22 @@ RsDoResourceTemplate (
PreviousRnode = &HeadRnode;
while (DescriptorTypeOp)
{
/* Save information for optional mapfile */
if (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONNECTION)
{
Info.MappingOp = Op->Asl.Parent;
}
else
{
Info.MappingOp = DescriptorTypeOp;
}
Info.DescriptorTypeOp = DescriptorTypeOp;
Info.CurrentByteOffset = CurrentByteOffset;
DescriptorTypeOp->Asl.CompileFlags |= NODE_IS_RESOURCE_DESC;
Rnode = RsDoOneResourceDescriptor (DescriptorTypeOp, CurrentByteOffset,
&State);
Rnode = RsDoOneResourceDescriptor (&Info, &State);
/*
* Update current byte offset to indicate the number of bytes from the

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@ -65,9 +64,7 @@
*
* FUNCTION: RsDoEndTagDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -77,8 +74,7 @@
ASL_RESOURCE_NODE *
RsDoEndTagDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ASL_RESOURCE_NODE *Rnode;
@ -99,9 +95,7 @@ RsDoEndTagDescriptor (
*
* FUNCTION: RsDoEndDependentDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -111,8 +105,7 @@ RsDoEndTagDescriptor (
ASL_RESOURCE_NODE *
RsDoEndDependentDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ASL_RESOURCE_NODE *Rnode;
@ -131,9 +124,7 @@ RsDoEndDependentDescriptor (
*
* FUNCTION: RsDoMemory24Descriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -143,8 +134,7 @@ RsDoEndDependentDescriptor (
ASL_RESOURCE_NODE *
RsDoMemory24Descriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -152,10 +142,12 @@ RsDoMemory24Descriptor (
ACPI_PARSE_OBJECT *MaxOp = NULL;
ACPI_PARSE_OBJECT *LengthOp = NULL;
ASL_RESOURCE_NODE *Rnode;
UINT32 CurrentByteOffset;
UINT32 i;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_MEMORY24));
Descriptor = Rnode->Buffer;
@ -208,7 +200,7 @@ RsDoMemory24Descriptor (
case 5: /* Name */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@ -227,7 +219,7 @@ RsDoMemory24Descriptor (
Descriptor->Memory24.Maximum,
Descriptor->Memory24.AddressLength,
Descriptor->Memory24.Alignment,
MinOp, MaxOp, LengthOp, NULL, Op);
MinOp, MaxOp, LengthOp, NULL, Info->DescriptorTypeOp);
return (Rnode);
}
@ -237,9 +229,7 @@ RsDoMemory24Descriptor (
*
* FUNCTION: RsDoMemory32Descriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -249,8 +239,7 @@ RsDoMemory24Descriptor (
ASL_RESOURCE_NODE *
RsDoMemory32Descriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -259,10 +248,12 @@ RsDoMemory32Descriptor (
ACPI_PARSE_OBJECT *LengthOp = NULL;
ACPI_PARSE_OBJECT *AlignOp = NULL;
ASL_RESOURCE_NODE *Rnode;
UINT32 CurrentByteOffset;
UINT32 i;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_MEMORY32));
Descriptor = Rnode->Buffer;
@ -316,7 +307,7 @@ RsDoMemory32Descriptor (
case 5: /* Name */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@ -335,7 +326,7 @@ RsDoMemory32Descriptor (
Descriptor->Memory32.Maximum,
Descriptor->Memory32.AddressLength,
Descriptor->Memory32.Alignment,
MinOp, MaxOp, LengthOp, AlignOp, Op);
MinOp, MaxOp, LengthOp, AlignOp, Info->DescriptorTypeOp);
return (Rnode);
}
@ -345,9 +336,7 @@ RsDoMemory32Descriptor (
*
* FUNCTION: RsDoMemory32FixedDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -357,16 +346,17 @@ RsDoMemory32Descriptor (
ASL_RESOURCE_NODE *
RsDoMemory32FixedDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
UINT32 CurrentByteOffset;
UINT32 i;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_MEMORY32));
Descriptor = Rnode->Buffer;
@ -402,7 +392,7 @@ RsDoMemory32FixedDescriptor (
case 3: /* Name */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@ -422,9 +412,7 @@ RsDoMemory32FixedDescriptor (
*
* FUNCTION: RsDoStartDependentDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -434,19 +422,21 @@ RsDoMemory32FixedDescriptor (
ASL_RESOURCE_NODE *
RsDoStartDependentDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
ASL_RESOURCE_NODE *PreviousRnode;
ASL_RESOURCE_NODE *NextRnode;
ASL_RESOURCE_INFO NextInfo;
UINT32 CurrentByteOffset;
UINT32 i;
UINT8 State;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_START_DEPENDENT));
PreviousRnode = Rnode;
@ -492,8 +482,10 @@ RsDoStartDependentDescriptor (
default:
NextRnode = RsDoOneResourceDescriptor (InitializerOp,
CurrentByteOffset, &State);
NextInfo.CurrentByteOffset = CurrentByteOffset;
NextInfo.DescriptorTypeOp = InitializerOp;
NextRnode = RsDoOneResourceDescriptor (&NextInfo, &State);
/*
* Update current byte offset to indicate the number of bytes from the
@ -517,9 +509,7 @@ RsDoStartDependentDescriptor (
*
* FUNCTION: RsDoStartDependentNoPriDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -529,18 +519,20 @@ RsDoStartDependentDescriptor (
ASL_RESOURCE_NODE *
RsDoStartDependentNoPriDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
ASL_RESOURCE_NODE *PreviousRnode;
ASL_RESOURCE_NODE *NextRnode;
ASL_RESOURCE_INFO NextInfo;
UINT32 CurrentByteOffset;
UINT8 State;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_START_DEPENDENT_NOPRIO));
Descriptor = Rnode->Buffer;
@ -557,8 +549,10 @@ RsDoStartDependentNoPriDescriptor (
State = ACPI_RSTATE_START_DEPENDENT;
while (InitializerOp)
{
NextRnode = RsDoOneResourceDescriptor (InitializerOp,
CurrentByteOffset, &State);
NextInfo.CurrentByteOffset = CurrentByteOffset;
NextInfo.DescriptorTypeOp = InitializerOp;
NextRnode = RsDoOneResourceDescriptor (&NextInfo, &State);
/*
* Update current byte offset to indicate the number of bytes from the
@ -579,9 +573,7 @@ RsDoStartDependentNoPriDescriptor (
*
* FUNCTION: RsDoVendorSmallDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -591,8 +583,7 @@ RsDoStartDependentNoPriDescriptor (
ASL_RESOURCE_NODE *
RsDoVendorSmallDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -601,7 +592,7 @@ RsDoVendorSmallDescriptor (
UINT32 i;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
/* Allocate worst case - 7 vendor bytes */

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@ -63,9 +62,7 @@
*
* FUNCTION: RsDoDmaDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -75,18 +72,19 @@
ASL_RESOURCE_NODE *
RsDoDmaDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
UINT32 CurrentByteOffset;
UINT32 i;
UINT8 DmaChannelMask = 0;
UINT8 DmaChannels = 0;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_DMA));
Descriptor = Rnode->Buffer;
@ -122,7 +120,7 @@ RsDoDmaDescriptor (
case 3: /* Name */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@ -184,9 +182,7 @@ RsDoDmaDescriptor (
*
* FUNCTION: RsDoFixedDmaDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -196,16 +192,17 @@ RsDoDmaDescriptor (
ASL_RESOURCE_NODE *
RsDoFixedDmaDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
UINT32 CurrentByteOffset;
UINT32 i;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_DMA));
Descriptor = Rnode->Buffer;
@ -241,7 +238,7 @@ RsDoFixedDmaDescriptor (
case 3: /* Descriptor Name (optional) */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default: /* Ignore any extra nodes */
@ -260,9 +257,7 @@ RsDoFixedDmaDescriptor (
*
* FUNCTION: RsDoFixedIoDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -272,17 +267,18 @@ RsDoFixedDmaDescriptor (
ASL_RESOURCE_NODE *
RsDoFixedIoDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ACPI_PARSE_OBJECT *AddressOp = NULL;
ASL_RESOURCE_NODE *Rnode;
UINT32 CurrentByteOffset;
UINT32 i;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_FIXED_IO));
Descriptor = Rnode->Buffer;
@ -314,7 +310,7 @@ RsDoFixedIoDescriptor (
case 2: /* Name */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@ -341,9 +337,7 @@ RsDoFixedIoDescriptor (
*
* FUNCTION: RsDoIoDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -353,8 +347,7 @@ RsDoFixedIoDescriptor (
ASL_RESOURCE_NODE *
RsDoIoDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -363,10 +356,12 @@ RsDoIoDescriptor (
ACPI_PARSE_OBJECT *LengthOp = NULL;
ACPI_PARSE_OBJECT *AlignOp = NULL;
ASL_RESOURCE_NODE *Rnode;
UINT32 CurrentByteOffset;
UINT32 i;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_IO));
Descriptor = Rnode->Buffer;
@ -424,7 +419,7 @@ RsDoIoDescriptor (
case 5: /* Name */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@ -443,7 +438,7 @@ RsDoIoDescriptor (
Descriptor->Io.Maximum,
Descriptor->Io.AddressLength,
Descriptor->Io.Alignment,
MinOp, MaxOp, LengthOp, AlignOp, Op);
MinOp, MaxOp, LengthOp, AlignOp, Info->DescriptorTypeOp);
return (Rnode);
}
@ -453,9 +448,7 @@ RsDoIoDescriptor (
*
* FUNCTION: RsDoIrqDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -465,18 +458,19 @@ RsDoIoDescriptor (
ASL_RESOURCE_NODE *
RsDoIrqDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
UINT32 Interrupts = 0;
UINT16 IrqMask = 0;
UINT32 CurrentByteOffset;
UINT32 i;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_IRQ));
/* Length = 3 (with flag byte) */
@ -514,7 +508,7 @@ RsDoIrqDescriptor (
case 3: /* Name */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@ -576,9 +570,7 @@ RsDoIrqDescriptor (
*
* FUNCTION: RsDoIrqNoFlagsDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -588,18 +580,19 @@ RsDoIrqDescriptor (
ASL_RESOURCE_NODE *
RsDoIrqNoFlagsDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
UINT16 IrqMask = 0;
UINT32 Interrupts = 0;
UINT32 CurrentByteOffset;
UINT32 i;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_IRQ_NOFLAGS));
Descriptor = Rnode->Buffer;
@ -614,7 +607,7 @@ RsDoIrqNoFlagsDescriptor (
{
case 0: /* Name */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@ -61,9 +60,7 @@
*
* FUNCTION: RsDoGeneralRegisterDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -73,16 +70,17 @@
ASL_RESOURCE_NODE *
RsDoGeneralRegisterDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
ASL_RESOURCE_NODE *Rnode;
UINT32 CurrentByteOffset;
UINT32 i;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_GENERIC_REGISTER));
Descriptor = Rnode->Buffer;
@ -138,7 +136,7 @@ RsDoGeneralRegisterDescriptor (
case 5: /* ResourceTag (ACPI 3.0b) */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@ -157,9 +155,7 @@ RsDoGeneralRegisterDescriptor (
*
* FUNCTION: RsDoInterruptDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -169,8 +165,7 @@ RsDoGeneralRegisterDescriptor (
ASL_RESOURCE_NODE *
RsDoInterruptDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
AML_RESOURCE *Rover = NULL;
@ -178,13 +173,15 @@ RsDoInterruptDescriptor (
ASL_RESOURCE_NODE *Rnode;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN HasResSourceIndex = FALSE;
UINT8 ResSourceIndex = 0;
UINT8 *ResSourceString = NULL;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
CurrentByteOffset = Info->CurrentByteOffset;
StringLength = RsGetStringDataLength (InitializerOp);
/* Count the interrupt numbers */
@ -211,9 +208,9 @@ RsDoInterruptDescriptor (
OptionIndex += 4;
}
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_EXTENDED_IRQ) +
1 + OptionIndex + StringLength);
1 + OptionIndex + StringLength);
Descriptor = Rnode->Buffer;
Descriptor->ExtendedIrq.DescriptorType = ACPI_RESOURCE_NAME_EXTENDED_IRQ;
@ -303,7 +300,7 @@ RsDoInterruptDescriptor (
case 6: /* ResourceTag */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@ -396,9 +393,7 @@ RsDoInterruptDescriptor (
*
* FUNCTION: RsDoVendorLargeDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -408,8 +403,7 @@ RsDoInterruptDescriptor (
ASL_RESOURCE_NODE *
RsDoVendorLargeDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -420,7 +414,7 @@ RsDoVendorLargeDescriptor (
/* Count the number of data bytes */
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
for (i = 0; InitializerOp; i++)
@ -432,7 +426,7 @@ RsDoVendorLargeDescriptor (
InitializerOp = InitializerOp->Asl.Next;
}
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_VENDOR_LARGE) + i);

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@ -60,9 +59,7 @@
*
* FUNCTION: RsDoDwordIoDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -72,8 +69,7 @@
ASL_RESOURCE_NODE *
RsDoDwordIoDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -85,12 +81,14 @@ RsDoDwordIoDescriptor (
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
UINT8 *OptionalFields;
UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
@ -245,7 +243,7 @@ RsDoDwordIoDescriptor (
case 12: /* ResourceTag */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 13: /* Type */
@ -279,10 +277,10 @@ RsDoDwordIoDescriptor (
(UINT64) Descriptor->Address32.AddressLength,
(UINT64) Descriptor->Address32.Granularity,
Descriptor->Address32.Flags,
MinOp, MaxOp, LengthOp, GranOp, Op);
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
OptionIndex + StringLength;
OptionIndex + StringLength;
return (Rnode);
}
@ -291,9 +289,7 @@ RsDoDwordIoDescriptor (
*
* FUNCTION: RsDoDwordMemoryDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -303,8 +299,7 @@ RsDoDwordIoDescriptor (
ASL_RESOURCE_NODE *
RsDoDwordMemoryDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -316,12 +311,14 @@ RsDoDwordMemoryDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
@ -480,7 +477,7 @@ RsDoDwordMemoryDescriptor (
case 13: /* ResourceTag */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
@ -515,10 +512,10 @@ RsDoDwordMemoryDescriptor (
(UINT64) Descriptor->Address32.AddressLength,
(UINT64) Descriptor->Address32.Granularity,
Descriptor->Address32.Flags,
MinOp, MaxOp, LengthOp, GranOp, Op);
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
OptionIndex + StringLength;
OptionIndex + StringLength;
return (Rnode);
}
@ -527,9 +524,7 @@ RsDoDwordMemoryDescriptor (
*
* FUNCTION: RsDoDwordSpaceDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -539,8 +534,7 @@ RsDoDwordMemoryDescriptor (
ASL_RESOURCE_NODE *
RsDoDwordSpaceDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -552,12 +546,14 @@ RsDoDwordSpaceDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS32) + 1 + StringLength);
@ -712,7 +708,7 @@ RsDoDwordSpaceDescriptor (
case 13: /* ResourceTag */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@ -733,9 +729,9 @@ RsDoDwordSpaceDescriptor (
(UINT64) Descriptor->Address32.AddressLength,
(UINT64) Descriptor->Address32.Granularity,
Descriptor->Address32.Flags,
MinOp, MaxOp, LengthOp, GranOp, Op);
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) +
OptionIndex + StringLength;
OptionIndex + StringLength;
return (Rnode);
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#define _COMPONENT ACPI_COMPILER
@ -59,9 +58,7 @@
*
* FUNCTION: RsDoExtendedIoDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -71,8 +68,7 @@
ASL_RESOURCE_NODE *
RsDoExtendedIoDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -82,11 +78,13 @@ RsDoExtendedIoDescriptor (
ACPI_PARSE_OBJECT *GranOp = NULL;
ASL_RESOURCE_NODE *Rnode;
UINT16 StringLength = 0;
UINT32 CurrentByteOffset;
UINT32 i;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
@ -187,7 +185,7 @@ RsDoExtendedIoDescriptor (
case 11: /* ResourceTag */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 12: /* Type */
@ -221,9 +219,10 @@ RsDoExtendedIoDescriptor (
Descriptor->ExtAddress64.AddressLength,
Descriptor->ExtAddress64.Granularity,
Descriptor->ExtAddress64.Flags,
MinOp, MaxOp, LengthOp, GranOp, Op);
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) +
StringLength;
return (Rnode);
}
@ -232,9 +231,7 @@ RsDoExtendedIoDescriptor (
*
* FUNCTION: RsDoExtendedMemoryDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -244,8 +241,7 @@ RsDoExtendedIoDescriptor (
ASL_RESOURCE_NODE *
RsDoExtendedMemoryDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -255,11 +251,13 @@ RsDoExtendedMemoryDescriptor (
ACPI_PARSE_OBJECT *GranOp = NULL;
ASL_RESOURCE_NODE *Rnode;
UINT16 StringLength = 0;
UINT32 CurrentByteOffset;
UINT32 i;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
@ -367,7 +365,7 @@ RsDoExtendedMemoryDescriptor (
case 12: /* ResourceTag */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
@ -402,9 +400,10 @@ RsDoExtendedMemoryDescriptor (
Descriptor->ExtAddress64.AddressLength,
Descriptor->ExtAddress64.Granularity,
Descriptor->ExtAddress64.Flags,
MinOp, MaxOp, LengthOp, GranOp, Op);
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) +
StringLength;
return (Rnode);
}
@ -413,9 +412,7 @@ RsDoExtendedMemoryDescriptor (
*
* FUNCTION: RsDoExtendedSpaceDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -425,8 +422,7 @@ RsDoExtendedMemoryDescriptor (
ASL_RESOURCE_NODE *
RsDoExtendedSpaceDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -436,11 +432,13 @@ RsDoExtendedSpaceDescriptor (
ACPI_PARSE_OBJECT *GranOp = NULL;
ASL_RESOURCE_NODE *Rnode;
UINT16 StringLength = 0;
UINT32 CurrentByteOffset;
UINT32 i;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + 1 + StringLength);
@ -545,7 +543,7 @@ RsDoExtendedSpaceDescriptor (
case 12: /* ResourceTag */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@ -565,8 +563,9 @@ RsDoExtendedSpaceDescriptor (
Descriptor->ExtAddress64.AddressLength,
Descriptor->ExtAddress64.Granularity,
Descriptor->ExtAddress64.Flags,
MinOp, MaxOp, LengthOp, GranOp, Op);
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength;
Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) +
StringLength;
return (Rnode);
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@ -60,9 +59,7 @@
*
* FUNCTION: RsDoQwordIoDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -72,8 +69,7 @@
ASL_RESOURCE_NODE *
RsDoQwordIoDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -85,12 +81,14 @@ RsDoQwordIoDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
@ -236,7 +234,7 @@ RsDoQwordIoDescriptor (
case 12: /* ResourceTag */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 13: /* Type */
@ -270,10 +268,10 @@ RsDoQwordIoDescriptor (
Descriptor->Address64.AddressLength,
Descriptor->Address64.Granularity,
Descriptor->Address64.Flags,
MinOp, MaxOp, LengthOp, GranOp, Op);
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
OptionIndex + StringLength;
OptionIndex + StringLength;
return (Rnode);
}
@ -282,9 +280,7 @@ RsDoQwordIoDescriptor (
*
* FUNCTION: RsDoQwordMemoryDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -294,8 +290,7 @@ RsDoQwordIoDescriptor (
ASL_RESOURCE_NODE *
RsDoQwordMemoryDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -307,12 +302,14 @@ RsDoQwordMemoryDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
@ -465,7 +462,7 @@ RsDoQwordMemoryDescriptor (
case 13: /* ResourceTag */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
@ -500,10 +497,10 @@ RsDoQwordMemoryDescriptor (
Descriptor->Address64.AddressLength,
Descriptor->Address64.Granularity,
Descriptor->Address64.Flags,
MinOp, MaxOp, LengthOp, GranOp, Op);
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
OptionIndex + StringLength;
OptionIndex + StringLength;
return (Rnode);
}
@ -512,9 +509,7 @@ RsDoQwordMemoryDescriptor (
*
* FUNCTION: RsDoQwordSpaceDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -524,8 +519,7 @@ RsDoQwordMemoryDescriptor (
ASL_RESOURCE_NODE *
RsDoQwordSpaceDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -537,12 +531,14 @@ RsDoQwordSpaceDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS64) + 1 + StringLength);
@ -692,7 +688,7 @@ RsDoQwordSpaceDescriptor (
case 13: /* ResourceTag */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@ -712,9 +708,9 @@ RsDoQwordSpaceDescriptor (
Descriptor->Address64.AddressLength,
Descriptor->Address64.Granularity,
Descriptor->Address64.Flags,
MinOp, MaxOp, LengthOp, GranOp, Op);
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS64) +
OptionIndex + StringLength;
OptionIndex + StringLength;
return (Rnode);
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/amlcode.h>
@ -268,9 +267,7 @@ RsGetVendorData (
*
* FUNCTION: RsDoGpioIntDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -280,8 +277,7 @@ RsGetVendorData (
ASL_RESOURCE_NODE *
RsDoGpioIntDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -289,14 +285,18 @@ RsDoGpioIntDescriptor (
char *ResourceSource = NULL;
UINT8 *VendorData = NULL;
UINT16 *InterruptList = NULL;
UINT16 *PinList = NULL;
UINT16 ResSourceLength;
UINT16 VendorLength;
UINT16 InterruptLength;
UINT16 DescriptorSize;
UINT32 CurrentByteOffset;
UINT32 PinCount = 0;
UINT32 i;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
CurrentByteOffset = Info->CurrentByteOffset;
/*
* Calculate lengths for fields that have variable length:
@ -324,6 +324,7 @@ RsDoGpioIntDescriptor (
/* Build pointers to optional areas */
InterruptList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_GPIO));
PinList = InterruptList;
ResourceSource = ACPI_ADD_PTR (char, InterruptList, InterruptLength);
VendorData = ACPI_ADD_PTR (UINT8, ResourceSource, ResSourceLength);
@ -407,7 +408,7 @@ RsDoGpioIntDescriptor (
case 8: /* Resource Tag (Descriptor Name) */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 9: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
@ -438,6 +439,7 @@ RsDoGpioIntDescriptor (
*/
*InterruptList = (UINT16) InitializerOp->Asl.Value.Integer;
InterruptList++;
PinCount++;
/* Case 10: First interrupt number in list */
@ -466,6 +468,7 @@ RsDoGpioIntDescriptor (
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
}
MpSaveGpioInfo (Info->MappingOp, Descriptor, PinCount, PinList, ResourceSource);
return (Rnode);
}
@ -474,9 +477,7 @@ RsDoGpioIntDescriptor (
*
* FUNCTION: RsDoGpioIoDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -486,8 +487,7 @@ RsDoGpioIntDescriptor (
ASL_RESOURCE_NODE *
RsDoGpioIoDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -495,14 +495,18 @@ RsDoGpioIoDescriptor (
char *ResourceSource = NULL;
UINT8 *VendorData = NULL;
UINT16 *InterruptList = NULL;
UINT16 *PinList = NULL;
UINT16 ResSourceLength;
UINT16 VendorLength;
UINT16 InterruptLength;
UINT16 DescriptorSize;
UINT32 CurrentByteOffset;
UINT32 PinCount = 0;
UINT32 i;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
CurrentByteOffset = Info->CurrentByteOffset;
/*
* Calculate lengths for fields that have variable length:
@ -513,6 +517,7 @@ RsDoGpioIoDescriptor (
ResSourceLength = RsGetStringDataLength (InitializerOp);
VendorLength = RsGetBufferDataLength (InitializerOp);
InterruptLength = RsGetInterruptDataLength (InitializerOp);
PinList = InterruptList;
DescriptorSize = ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO) +
ResSourceLength + VendorLength + InterruptLength;
@ -530,6 +535,7 @@ RsDoGpioIoDescriptor (
/* Build pointers to optional areas */
InterruptList = ACPI_ADD_PTR (UINT16, Descriptor, sizeof (AML_RESOURCE_GPIO));
PinList = InterruptList;
ResourceSource = ACPI_ADD_PTR (char, InterruptList, InterruptLength);
VendorData = ACPI_ADD_PTR (UINT8, ResourceSource, ResSourceLength);
@ -613,7 +619,7 @@ RsDoGpioIoDescriptor (
case 8: /* Resource Tag (Descriptor Name) */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 9: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
@ -643,6 +649,7 @@ RsDoGpioIoDescriptor (
*/
*InterruptList = (UINT16) InitializerOp->Asl.Value.Integer;
InterruptList++;
PinCount++;
/* Case 10: First interrupt number in list */
@ -671,6 +678,7 @@ RsDoGpioIoDescriptor (
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
}
MpSaveGpioInfo (Info->MappingOp, Descriptor, PinCount, PinList, ResourceSource);
return (Rnode);
}
@ -679,9 +687,7 @@ RsDoGpioIoDescriptor (
*
* FUNCTION: RsDoI2cSerialBusDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -691,8 +697,7 @@ RsDoGpioIoDescriptor (
ASL_RESOURCE_NODE *
RsDoI2cSerialBusDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -702,10 +707,12 @@ RsDoI2cSerialBusDescriptor (
UINT16 ResSourceLength;
UINT16 VendorLength;
UINT16 DescriptorSize;
UINT32 CurrentByteOffset;
UINT32 i;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
CurrentByteOffset = Info->CurrentByteOffset;
/*
* Calculate lengths for fields that have variable length:
@ -801,7 +808,7 @@ RsDoI2cSerialBusDescriptor (
case 7: /* Resource Tag (Descriptor Name) */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 8: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
@ -818,6 +825,7 @@ RsDoI2cSerialBusDescriptor (
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
}
MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
return (Rnode);
}
@ -826,9 +834,7 @@ RsDoI2cSerialBusDescriptor (
*
* FUNCTION: RsDoSpiSerialBusDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -838,8 +844,7 @@ RsDoI2cSerialBusDescriptor (
ASL_RESOURCE_NODE *
RsDoSpiSerialBusDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -849,10 +854,12 @@ RsDoSpiSerialBusDescriptor (
UINT16 ResSourceLength;
UINT16 VendorLength;
UINT16 DescriptorSize;
UINT32 CurrentByteOffset;
UINT32 i;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
CurrentByteOffset = Info->CurrentByteOffset;
/*
* Calculate lengths for fields that have variable length:
@ -976,7 +983,7 @@ RsDoSpiSerialBusDescriptor (
case 11: /* Resource Tag (Descriptor Name) */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 12: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
@ -993,6 +1000,7 @@ RsDoSpiSerialBusDescriptor (
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
}
MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
return (Rnode);
}
@ -1001,9 +1009,7 @@ RsDoSpiSerialBusDescriptor (
*
* FUNCTION: RsDoUartSerialBusDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -1013,8 +1019,7 @@ RsDoSpiSerialBusDescriptor (
ASL_RESOURCE_NODE *
RsDoUartSerialBusDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -1024,10 +1029,12 @@ RsDoUartSerialBusDescriptor (
UINT16 ResSourceLength;
UINT16 VendorLength;
UINT16 DescriptorSize;
UINT32 CurrentByteOffset;
UINT32 i;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
CurrentByteOffset = Info->CurrentByteOffset;
/*
* Calculate lengths for fields that have variable length:
@ -1168,7 +1175,7 @@ RsDoUartSerialBusDescriptor (
case 12: /* Resource Tag (Descriptor Name) */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 13: /* Vendor Data (Optional - Buffer of BYTEs) (_VEN) */
@ -1185,5 +1192,6 @@ RsDoUartSerialBusDescriptor (
InitializerOp = RsCompleteNodeAndGetNext (InitializerOp);
}
MpSaveSerialInfo (Info->MappingOp, Descriptor, ResourceSource);
return (Rnode);
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@ -60,9 +59,7 @@
*
* FUNCTION: RsDoWordIoDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -72,8 +69,7 @@
ASL_RESOURCE_NODE *
RsDoWordIoDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -85,12 +81,14 @@ RsDoWordIoDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
@ -236,7 +234,7 @@ RsDoWordIoDescriptor (
case 12: /* ResourceTag */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
case 13: /* Type */
@ -270,10 +268,10 @@ RsDoWordIoDescriptor (
(UINT64) Descriptor->Address16.AddressLength,
(UINT64) Descriptor->Address16.Granularity,
Descriptor->Address16.Flags,
MinOp, MaxOp, LengthOp, GranOp, Op);
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
OptionIndex + StringLength;
OptionIndex + StringLength;
return (Rnode);
}
@ -282,9 +280,7 @@ RsDoWordIoDescriptor (
*
* FUNCTION: RsDoWordBusNumberDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -294,8 +290,7 @@ RsDoWordIoDescriptor (
ASL_RESOURCE_NODE *
RsDoWordBusNumberDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -307,12 +302,14 @@ RsDoWordBusNumberDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
@ -456,7 +453,7 @@ RsDoWordBusNumberDescriptor (
case 11: /* ResourceTag */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@ -476,10 +473,10 @@ RsDoWordBusNumberDescriptor (
(UINT64) Descriptor->Address16.AddressLength,
(UINT64) Descriptor->Address16.Granularity,
Descriptor->Address16.Flags,
MinOp, MaxOp, LengthOp, GranOp, Op);
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
OptionIndex + StringLength;
OptionIndex + StringLength;
return (Rnode);
}
@ -488,9 +485,7 @@ RsDoWordBusNumberDescriptor (
*
* FUNCTION: RsDoWordSpaceDescriptor
*
* PARAMETERS: Op - Parent resource descriptor parse node
* CurrentByteOffset - Offset into the resource template AML
* buffer (to track references to the desc)
* PARAMETERS: Info - Parse Op and resource template offset
*
* RETURN: Completed resource node
*
@ -500,8 +495,7 @@ RsDoWordBusNumberDescriptor (
ASL_RESOURCE_NODE *
RsDoWordSpaceDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset)
ASL_RESOURCE_INFO *Info)
{
AML_RESOURCE *Descriptor;
ACPI_PARSE_OBJECT *InitializerOp;
@ -513,12 +507,14 @@ RsDoWordSpaceDescriptor (
UINT8 *OptionalFields;
UINT16 StringLength = 0;
UINT32 OptionIndex = 0;
UINT32 CurrentByteOffset;
UINT32 i;
BOOLEAN ResSourceIndex = FALSE;
InitializerOp = Op->Asl.Child;
InitializerOp = Info->DescriptorTypeOp->Asl.Child;
StringLength = RsGetStringDataLength (InitializerOp);
CurrentByteOffset = Info->CurrentByteOffset;
Rnode = RsAllocateResourceNode (
sizeof (AML_RESOURCE_ADDRESS16) + 1 + StringLength);
@ -673,7 +669,7 @@ RsDoWordSpaceDescriptor (
case 13: /* ResourceTag */
UtAttachNamepathToOwner (Op, InitializerOp);
UtAttachNamepathToOwner (Info->DescriptorTypeOp, InitializerOp);
break;
default:
@ -693,9 +689,9 @@ RsDoWordSpaceDescriptor (
(UINT64) Descriptor->Address16.AddressLength,
(UINT64) Descriptor->Address16.Granularity,
Descriptor->Address16.Flags,
MinOp, MaxOp, LengthOp, GranOp, Op);
MinOp, MaxOp, LengthOp, GranOp, Info->DescriptorTypeOp);
Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS16) +
OptionIndex + StringLength;
OptionIndex + StringLength;
return (Rnode);
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/include/actables.h>
#include <contrib/dev/acpica/include/acdisasm.h>
@ -51,18 +50,8 @@
ACPI_MODULE_NAME ("aslstartup")
#define ASL_MAX_FILES 256
static char *FileList[ASL_MAX_FILES];
static BOOLEAN AslToFile = TRUE;
/* Local prototypes */
static char **
AsDoWildcard (
char *DirectoryPathname,
char *FileSpecifier);
static UINT8
AslDetectSourceFileType (
ASL_FILE_INFO *Info);
@ -72,6 +61,11 @@ AslDoDisassembly (
void);
/* Globals */
static BOOLEAN AslToFile = TRUE;
/*******************************************************************************
*
* FUNCTION: AslInitializeGlobals
@ -94,6 +88,7 @@ AslInitializeGlobals (
/* Init compiler globals */
Gbl_SyntaxError = 0;
Gbl_CurrentColumn = 0;
Gbl_CurrentLineNumber = 1;
Gbl_LogicalLineNumber = 1;
@ -131,82 +126,6 @@ AslInitializeGlobals (
}
/******************************************************************************
*
* FUNCTION: AsDoWildcard
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Process files via wildcards. This function is for the Windows
* case only.
*
******************************************************************************/
static char **
AsDoWildcard (
char *DirectoryPathname,
char *FileSpecifier)
{
#ifdef WIN32
void *DirInfo;
char *Filename;
int FileCount;
FileCount = 0;
/* Open parent directory */
DirInfo = AcpiOsOpenDirectory (DirectoryPathname, FileSpecifier, REQUEST_FILE_ONLY);
if (!DirInfo)
{
/* Either the directory of file does not exist */
Gbl_Files[ASL_FILE_INPUT].Filename = FileSpecifier;
FlFileError (ASL_FILE_INPUT, ASL_MSG_OPEN);
AslAbort ();
}
/* Process each file that matches the wildcard specification */
while ((Filename = AcpiOsGetNextFilename (DirInfo)))
{
/* Add the filename to the file list */
FileList[FileCount] = AcpiOsAllocate (strlen (Filename) + 1);
strcpy (FileList[FileCount], Filename);
FileCount++;
if (FileCount >= ASL_MAX_FILES)
{
printf ("Max files reached\n");
FileList[0] = NULL;
return (FileList);
}
}
/* Cleanup */
AcpiOsCloseDirectory (DirInfo);
FileList[FileCount] = NULL;
return (FileList);
#else
/*
* Linux/Unix cases - Wildcards are expanded by the shell automatically.
* Just return the filename in a null terminated list
*/
FileList[0] = AcpiOsAllocate (strlen (FileSpecifier) + 1);
strcpy (FileList[0], FileSpecifier);
FileList[1] = NULL;
return (FileList);
#endif
}
/*******************************************************************************
*
* FUNCTION: AslDetectSourceFileType
@ -332,7 +251,7 @@ AslDoDisassembly (
AcpiGbl_DbOpt_disasm = TRUE;
Status = AdAmlDisassemble (AslToFile,
Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_OutputFilenamePrefix,
&Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_GetAllTables);
&Gbl_Files[ASL_FILE_INPUT].Filename);
if (ACPI_FAILURE (Status))
{
return (Status);
@ -365,8 +284,11 @@ AslDoDisassembly (
return (AE_CTRL_CONTINUE);
}
ACPI_FREE (Gbl_Files[ASL_FILE_INPUT].Filename);
/* No need to free the filename string */
Gbl_Files[ASL_FILE_INPUT].Filename = NULL;
CmDeleteCaches ();
return (AE_OK);
}
@ -395,12 +317,29 @@ AslDoOneFile (
AslInitializeGlobals ();
PrInitializeGlobals ();
Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
/*
* Extract the directory path. This path is used for possible include
* files and the optional AML filename embedded in the input file
* DefinitionBlock declaration.
*/
Status = FlSplitInputPathname (Filename, &Gbl_DirectoryPath, NULL);
if (ACPI_FAILURE (Status))
{
return (Status);
}
/* Take a copy of the input filename, convert any backslashes */
Gbl_Files[ASL_FILE_INPUT].Filename =
UtStringCacheCalloc (strlen (Filename) + 1);
strcpy (Gbl_Files[ASL_FILE_INPUT].Filename, Filename);
UtConvertBackslashes (Gbl_Files[ASL_FILE_INPUT].Filename);
/*
* AML Disassembly (Optional)
*/
if (Gbl_DisasmFlag || Gbl_GetAllTables)
if (Gbl_DisasmFlag)
{
Status = AslDoDisassembly ();
if (Status != AE_CTRL_CONTINUE)
@ -465,7 +404,6 @@ AslDoOneFile (
if (Gbl_Signature)
{
ACPI_FREE (Gbl_Signature);
Gbl_Signature = NULL;
}
@ -541,77 +479,6 @@ AslDoOneFile (
}
/*******************************************************************************
*
* FUNCTION: AslDoOnePathname
*
* PARAMETERS: Pathname - Full pathname, possibly with wildcards
*
* RETURN: Status
*
* DESCRIPTION: Process one pathname, possible terminated with a wildcard
* specification. If a wildcard, it is expanded and the multiple
* files are processed.
*
******************************************************************************/
ACPI_STATUS
AslDoOnePathname (
char *Pathname,
ASL_PATHNAME_CALLBACK PathCallback)
{
ACPI_STATUS Status = AE_OK;
char **WildcardList;
char *Filename;
char *FullPathname;
/* Split incoming path into a directory/filename combo */
Status = FlSplitInputPathname (Pathname, &Gbl_DirectoryPath, &Filename);
if (ACPI_FAILURE (Status))
{
return (Status);
}
/* Expand possible wildcard into a file list (Windows/DOS only) */
WildcardList = AsDoWildcard (Gbl_DirectoryPath, Filename);
while (*WildcardList)
{
FullPathname = ACPI_ALLOCATE (
strlen (Gbl_DirectoryPath) + strlen (*WildcardList) + 1);
/* Construct a full path to the file */
strcpy (FullPathname, Gbl_DirectoryPath);
strcat (FullPathname, *WildcardList);
/*
* If -p not specified, we will use the input filename as the
* output filename prefix
*/
if (Gbl_UseDefaultAmlFilename)
{
Gbl_OutputFilenamePrefix = FullPathname;
}
/* Save status from all compiles */
Status |= (*PathCallback) (FullPathname);
ACPI_FREE (FullPathname);
ACPI_FREE (*WildcardList);
*WildcardList = NULL;
WildcardList++;
}
ACPI_FREE (Gbl_DirectoryPath);
ACPI_FREE (Filename);
return (Status);
}
/*******************************************************************************
*
* FUNCTION: AslCheckForErrorExit

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -53,17 +53,10 @@
/*
* Stubs to simplify linkage to the ACPI CA core subsystem.
* Stubs to simplify linkage to the ACPICA core subsystem.
* Things like Events, Global Lock, etc. are not used
* by the compiler, so they are stubbed out here.
*/
ACPI_PHYSICAL_ADDRESS
AeLocalGetRootPointer (
void)
{
return (0);
}
void
AcpiNsExecModuleCodeList (
void)
@ -232,21 +225,3 @@ AcpiTbFindTable (
{
return (AE_SUPPORT);
}
/* OSL interfaces */
ACPI_THREAD_ID
AcpiOsGetThreadId (
void)
{
return (0xFFFF);
}
ACPI_STATUS
AcpiOsExecute (
ACPI_EXECUTE_TYPE Type,
ACPI_OSD_EXEC_CALLBACK Function,
void *Context)
{
return (AE_SUPPORT);
}

View File

@ -6,7 +6,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -42,7 +42,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
/* Configuration */
#define ASL_SPACES_PER_TAB 4
@ -70,6 +69,23 @@ typedef struct asl_file_node
ASL_FILE_NODE *Gbl_IncludeFileStack = NULL;
/*******************************************************************************
*
* FUNCTION: AslParserCleanup
*
* Used to delete the current buffer
*
******************************************************************************/
void
AslParserCleanup (
void)
{
yy_delete_buffer (YY_CURRENT_BUFFER);
}
/*******************************************************************************
*
* FUNCTION: AslDoLineDirective
@ -180,7 +196,8 @@ AslPopInputFileStack (
Fnode = Gbl_IncludeFileStack;
DbgPrint (ASL_PARSE_OUTPUT, "\nPop InputFile Stack, Fnode %p\n\n", Fnode);
DbgPrint (ASL_PARSE_OUTPUT,
"\nPop InputFile Stack, Fnode %p\n\n", Fnode);
if (!Fnode)
{
@ -240,11 +257,11 @@ AslPushInputFileStack (
Fnode = UtLocalCalloc (sizeof (ASL_FILE_NODE));
Fnode->File = yyin;
Fnode->Next = Gbl_IncludeFileStack;
Fnode->State = YY_CURRENT_BUFFER;
Fnode->CurrentLineNumber = Gbl_CurrentLineNumber;
Fnode->Filename = Gbl_Files[ASL_FILE_INPUT].Filename;
Fnode->File = yyin;
Fnode->Next = Gbl_IncludeFileStack;
Fnode->State = YY_CURRENT_BUFFER;
Fnode->Filename = Gbl_Files[ASL_FILE_INPUT].Filename;
Fnode->CurrentLineNumber = Gbl_CurrentLineNumber;
/* Push it on the stack */
@ -255,11 +272,16 @@ AslPushInputFileStack (
State = yy_create_buffer (InputFile, YY_BUF_SIZE);
yy_switch_to_buffer (State);
DbgPrint (ASL_PARSE_OUTPUT, "\nPush InputFile Stack, returning %p\n\n", InputFile);
DbgPrint (ASL_PARSE_OUTPUT,
"\nPush InputFile Stack, returning %p\n\n", InputFile);
/* Reset the global line count and filename */
Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
Gbl_Files[ASL_FILE_INPUT].Filename =
UtStringCacheCalloc (strlen (Filename) + 1);
strcpy (Gbl_Files[ASL_FILE_INPUT].Filename, Filename);
Gbl_CurrentLineNumber = 1;
yyin = InputFile;
}
@ -301,7 +323,7 @@ AslResetCurrentLineBuffer (
*
* FUNCTION: AslInsertLineBuffer
*
* PARAMETERS: SourceChar - One char from the input ASL source file
* PARAMETERS: SourceChar - One char from the input ASL source file
*
* RETURN: None
*
@ -342,7 +364,8 @@ AslInsertLineBuffer (
*Gbl_LineBufPtr = (UINT8) SourceChar;
Gbl_LineBufPtr++;
if (Gbl_LineBufPtr > (Gbl_CurrentLineBuffer + (Gbl_LineBufferSize - 1)))
if (Gbl_LineBufPtr >
(Gbl_CurrentLineBuffer + (Gbl_LineBufferSize - 1)))
{
#if 0
/*
@ -351,9 +374,9 @@ AslInsertLineBuffer (
*/
sprintf (MsgBuffer, "Max %u", Gbl_LineBufferSize);
AslCommonError (ASL_WARNING, ASL_MSG_LONG_LINE,
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, MsgBuffer);
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, MsgBuffer);
#endif
AslResetCurrentLineBuffer ();
@ -372,12 +395,12 @@ AslInsertLineBuffer (
*
* FUNCTION: count
*
* PARAMETERS: yytext - Contains the matched keyword.
* Type - Keyword/Character type:
* 0 = anything except a keyword
* 1 = pseudo-keywords
* 2 = non-executable ASL keywords
* 3 = executable ASL keywords
* PARAMETERS: yytext - Contains the matched keyword.
* Type - Keyword/Character type:
* 0 = anything except a keyword
* 1 = pseudo-keywords
* 2 = non-executable ASL keywords
* 3 = executable ASL keywords
*
* RETURN: None
*
@ -446,7 +469,7 @@ loop:
/* Eat chars until end-of-comment */
while ((c = input()) != '*' && c != EOF)
while (((c = input ()) != '*') && (c != EOF))
{
AslInsertLineBuffer (c);
c1 = c;
@ -464,16 +487,16 @@ loop:
if ((c1 == '/') && (c == '*'))
{
AslCommonError (ASL_WARNING, ASL_MSG_NESTED_COMMENT,
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_InputByteCount, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_InputByteCount, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
}
/* Comment is closed only if the NEXT character is a slash */
AslInsertLineBuffer (c);
if ((c1 = input()) != '/' && c1 != EOF)
if (((c1 = input ()) != '/') && (c1 != EOF))
{
unput(c1);
goto loop;
@ -493,9 +516,9 @@ EarlyEOF:
* Premature End-Of-File
*/
AslCommonError (ASL_ERROR, ASL_MSG_EARLY_EOF,
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
return (FALSE);
}
@ -522,7 +545,7 @@ AslDoCommentType2 (
AslInsertLineBuffer ('/');
AslInsertLineBuffer ('/');
while ((c = input()) != '\n' && c != EOF)
while (((c = input ()) != '\n') && (c != EOF))
{
AslInsertLineBuffer (c);
}
@ -670,9 +693,9 @@ DoCharacter:
/* Unknown escape sequence issue warning, but use the character */
AslCommonError (ASL_WARNING, ASL_MSG_INVALID_ESCAPE,
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
break;
}
break;
@ -697,9 +720,9 @@ DoCharacter:
if ((Digit == 0) || (Digit > ACPI_ASCII_MAX))
{
AslCommonError (ASL_WARNING, ASL_MSG_INVALID_STRING,
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
}
else
{
@ -741,9 +764,9 @@ DoCharacter:
if ((Digit == 0) || (Digit > ACPI_ASCII_MAX))
{
AslCommonError (ASL_WARNING, ASL_MSG_INVALID_STRING,
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
}
else
{
@ -785,9 +808,9 @@ DoCharacter:
* Premature End-Of-File
*/
AslCommonError (ASL_ERROR, ASL_MSG_EARLY_EOF,
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
return (FALSE);
@ -797,13 +820,13 @@ CompletedString:
*/
*StringBuffer = 0;
CleanString = UtGetStringBuffer (strlen (MsgBuffer) + 1);
CleanString = UtStringCacheCalloc (strlen (MsgBuffer) + 1);
if (!CleanString)
{
AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
return (FALSE);
}
@ -817,8 +840,8 @@ BufferOverflow:
/* Literal was too long */
AslCommonError (ASL_ERROR, ASL_MSG_STRING_LENGTH,
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, "Max length 4096");
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, "Max length 4096");
return (FALSE);
}

View File

@ -0,0 +1,120 @@
NoEcho('
/******************************************************************************
*
* Module Name: aslsupport.y - Bison/Yacc C support functions
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
')
/******************************************************************************
*
* Local support functions
*
*****************************************************************************/
/*! [Begin] no source code translation */
int
AslCompilerwrap(void)
{
return (1);
}
/*! [End] no source code translation !*/
void *
AslLocalAllocate (
unsigned int Size)
{
void *Mem;
DbgPrint (ASL_PARSE_OUTPUT,
"\nAslLocalAllocate: Expanding Stack to %u\n\n", Size);
Mem = ACPI_ALLOCATE_ZEROED (Size);
if (!Mem)
{
AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_InputByteCount, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
exit (1);
}
return (Mem);
}
ACPI_PARSE_OBJECT *
AslDoError (
void)
{
return (TrCreateLeafNode (PARSEOP_ERRORNODE));
}
/*******************************************************************************
*
* FUNCTION: UtGetOpName
*
* PARAMETERS: ParseOpcode - Parser keyword ID
*
* RETURN: Pointer to the opcode name
*
* DESCRIPTION: Get the ascii name of the parse opcode
*
******************************************************************************/
char *
UtGetOpName (
UINT32 ParseOpcode)
{
#ifdef ASL_YYTNAME_START
/*
* First entries (ASL_YYTNAME_START) in yytname are special reserved names.
* Ignore first 8 characters of the name
*/
return ((char *) yytname
[(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
#else
return ("[Unknown parser generator]");
#endif
}

View File

@ -0,0 +1,468 @@
NoEcho('
/******************************************************************************
*
* Module Name: asltokens.y - Bison/Yacc token types
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
')
/******************************************************************************
*
* Token types: These are returned by the lexer
*
* NOTE: This list MUST match the AslKeywordMapping table found
* in aslmap.c EXACTLY! Double check any changes!
*
*****************************************************************************/
%token <i> PARSEOP_ACCESSAS
%token <i> PARSEOP_ACCESSATTRIB_BLOCK
%token <i> PARSEOP_ACCESSATTRIB_BLOCK_CALL
%token <i> PARSEOP_ACCESSATTRIB_BYTE
%token <i> PARSEOP_ACCESSATTRIB_MULTIBYTE
%token <i> PARSEOP_ACCESSATTRIB_QUICK
%token <i> PARSEOP_ACCESSATTRIB_RAW_BYTES
%token <i> PARSEOP_ACCESSATTRIB_RAW_PROCESS
%token <i> PARSEOP_ACCESSATTRIB_SND_RCV
%token <i> PARSEOP_ACCESSATTRIB_WORD
%token <i> PARSEOP_ACCESSATTRIB_WORD_CALL
%token <i> PARSEOP_ACCESSTYPE_ANY
%token <i> PARSEOP_ACCESSTYPE_BUF
%token <i> PARSEOP_ACCESSTYPE_BYTE
%token <i> PARSEOP_ACCESSTYPE_DWORD
%token <i> PARSEOP_ACCESSTYPE_QWORD
%token <i> PARSEOP_ACCESSTYPE_WORD
%token <i> PARSEOP_ACQUIRE
%token <i> PARSEOP_ADD
%token <i> PARSEOP_ADDRESSINGMODE_7BIT
%token <i> PARSEOP_ADDRESSINGMODE_10BIT
%token <i> PARSEOP_ADDRESSTYPE_ACPI
%token <i> PARSEOP_ADDRESSTYPE_MEMORY
%token <i> PARSEOP_ADDRESSTYPE_NVS
%token <i> PARSEOP_ADDRESSTYPE_RESERVED
%token <i> PARSEOP_ALIAS
%token <i> PARSEOP_AND
%token <i> PARSEOP_ARG0
%token <i> PARSEOP_ARG1
%token <i> PARSEOP_ARG2
%token <i> PARSEOP_ARG3
%token <i> PARSEOP_ARG4
%token <i> PARSEOP_ARG5
%token <i> PARSEOP_ARG6
%token <i> PARSEOP_BANKFIELD
%token <i> PARSEOP_BITSPERBYTE_EIGHT
%token <i> PARSEOP_BITSPERBYTE_FIVE
%token <i> PARSEOP_BITSPERBYTE_NINE
%token <i> PARSEOP_BITSPERBYTE_SEVEN
%token <i> PARSEOP_BITSPERBYTE_SIX
%token <i> PARSEOP_BREAK
%token <i> PARSEOP_BREAKPOINT
%token <i> PARSEOP_BUFFER
%token <i> PARSEOP_BUSMASTERTYPE_MASTER
%token <i> PARSEOP_BUSMASTERTYPE_NOTMASTER
%token <i> PARSEOP_BYTECONST
%token <i> PARSEOP_CASE
%token <i> PARSEOP_CLOCKPHASE_FIRST
%token <i> PARSEOP_CLOCKPHASE_SECOND
%token <i> PARSEOP_CLOCKPOLARITY_HIGH
%token <i> PARSEOP_CLOCKPOLARITY_LOW
%token <i> PARSEOP_CONCATENATE
%token <i> PARSEOP_CONCATENATERESTEMPLATE
%token <i> PARSEOP_CONDREFOF
%token <i> PARSEOP_CONNECTION
%token <i> PARSEOP_CONTINUE
%token <i> PARSEOP_COPYOBJECT
%token <i> PARSEOP_CREATEBITFIELD
%token <i> PARSEOP_CREATEBYTEFIELD
%token <i> PARSEOP_CREATEDWORDFIELD
%token <i> PARSEOP_CREATEFIELD
%token <i> PARSEOP_CREATEQWORDFIELD
%token <i> PARSEOP_CREATEWORDFIELD
%token <i> PARSEOP_DATABUFFER
%token <i> PARSEOP_DATATABLEREGION
%token <i> PARSEOP_DEBUG
%token <i> PARSEOP_DECODETYPE_POS
%token <i> PARSEOP_DECODETYPE_SUB
%token <i> PARSEOP_DECREMENT
%token <i> PARSEOP_DEFAULT
%token <i> PARSEOP_DEFAULT_ARG
%token <i> PARSEOP_DEFINITIONBLOCK
%token <i> PARSEOP_DEREFOF
%token <i> PARSEOP_DEVICE
%token <i> PARSEOP_DEVICEPOLARITY_HIGH
%token <i> PARSEOP_DEVICEPOLARITY_LOW
%token <i> PARSEOP_DIVIDE
%token <i> PARSEOP_DMA
%token <i> PARSEOP_DMATYPE_A
%token <i> PARSEOP_DMATYPE_COMPATIBILITY
%token <i> PARSEOP_DMATYPE_B
%token <i> PARSEOP_DMATYPE_F
%token <i> PARSEOP_DWORDCONST
%token <i> PARSEOP_DWORDIO
%token <i> PARSEOP_DWORDMEMORY
%token <i> PARSEOP_DWORDSPACE
%token <i> PARSEOP_EISAID
%token <i> PARSEOP_ELSE
%token <i> PARSEOP_ELSEIF
%token <i> PARSEOP_ENDDEPENDENTFN
%token <i> PARSEOP_ENDIAN_BIG
%token <i> PARSEOP_ENDIAN_LITTLE
%token <i> PARSEOP_ENDTAG
%token <i> PARSEOP_ERRORNODE
%token <i> PARSEOP_EVENT
%token <i> PARSEOP_EXTENDEDIO
%token <i> PARSEOP_EXTENDEDMEMORY
%token <i> PARSEOP_EXTENDEDSPACE
%token <i> PARSEOP_EXTERNAL
%token <i> PARSEOP_FATAL
%token <i> PARSEOP_FIELD
%token <i> PARSEOP_FINDSETLEFTBIT
%token <i> PARSEOP_FINDSETRIGHTBIT
%token <i> PARSEOP_FIXEDDMA
%token <i> PARSEOP_FIXEDIO
%token <i> PARSEOP_FLOWCONTROL_HW
%token <i> PARSEOP_FLOWCONTROL_NONE
%token <i> PARSEOP_FLOWCONTROL_SW
%token <i> PARSEOP_FROMBCD
%token <i> PARSEOP_FUNCTION
%token <i> PARSEOP_GPIO_INT
%token <i> PARSEOP_GPIO_IO
%token <i> PARSEOP_I2C_SERIALBUS
%token <i> PARSEOP_IF
%token <i> PARSEOP_INCLUDE
%token <i> PARSEOP_INCLUDE_END
%token <i> PARSEOP_INCREMENT
%token <i> PARSEOP_INDEX
%token <i> PARSEOP_INDEXFIELD
%token <i> PARSEOP_INTEGER
%token <i> PARSEOP_INTERRUPT
%token <i> PARSEOP_INTLEVEL_ACTIVEBOTH
%token <i> PARSEOP_INTLEVEL_ACTIVEHIGH
%token <i> PARSEOP_INTLEVEL_ACTIVELOW
%token <i> PARSEOP_INTTYPE_EDGE
%token <i> PARSEOP_INTTYPE_LEVEL
%token <i> PARSEOP_IO
%token <i> PARSEOP_IODECODETYPE_10
%token <i> PARSEOP_IODECODETYPE_16
%token <i> PARSEOP_IORESTRICT_IN
%token <i> PARSEOP_IORESTRICT_NONE
%token <i> PARSEOP_IORESTRICT_OUT
%token <i> PARSEOP_IORESTRICT_PRESERVE
%token <i> PARSEOP_IRQ
%token <i> PARSEOP_IRQNOFLAGS
%token <i> PARSEOP_LAND
%token <i> PARSEOP_LEQUAL
%token <i> PARSEOP_LGREATER
%token <i> PARSEOP_LGREATEREQUAL
%token <i> PARSEOP_LLESS
%token <i> PARSEOP_LLESSEQUAL
%token <i> PARSEOP_LNOT
%token <i> PARSEOP_LNOTEQUAL
%token <i> PARSEOP_LOAD
%token <i> PARSEOP_LOADTABLE
%token <i> PARSEOP_LOCAL0
%token <i> PARSEOP_LOCAL1
%token <i> PARSEOP_LOCAL2
%token <i> PARSEOP_LOCAL3
%token <i> PARSEOP_LOCAL4
%token <i> PARSEOP_LOCAL5
%token <i> PARSEOP_LOCAL6
%token <i> PARSEOP_LOCAL7
%token <i> PARSEOP_LOCKRULE_LOCK
%token <i> PARSEOP_LOCKRULE_NOLOCK
%token <i> PARSEOP_LOR
%token <i> PARSEOP_MATCH
%token <i> PARSEOP_MATCHTYPE_MEQ
%token <i> PARSEOP_MATCHTYPE_MGE
%token <i> PARSEOP_MATCHTYPE_MGT
%token <i> PARSEOP_MATCHTYPE_MLE
%token <i> PARSEOP_MATCHTYPE_MLT
%token <i> PARSEOP_MATCHTYPE_MTR
%token <i> PARSEOP_MAXTYPE_FIXED
%token <i> PARSEOP_MAXTYPE_NOTFIXED
%token <i> PARSEOP_MEMORY24
%token <i> PARSEOP_MEMORY32
%token <i> PARSEOP_MEMORY32FIXED
%token <i> PARSEOP_MEMTYPE_CACHEABLE
%token <i> PARSEOP_MEMTYPE_NONCACHEABLE
%token <i> PARSEOP_MEMTYPE_PREFETCHABLE
%token <i> PARSEOP_MEMTYPE_WRITECOMBINING
%token <i> PARSEOP_METHOD
%token <i> PARSEOP_METHODCALL
%token <i> PARSEOP_MID
%token <i> PARSEOP_MINTYPE_FIXED
%token <i> PARSEOP_MINTYPE_NOTFIXED
%token <i> PARSEOP_MOD
%token <i> PARSEOP_MULTIPLY
%token <i> PARSEOP_MUTEX
%token <i> PARSEOP_NAME
%token <s> PARSEOP_NAMESEG
%token <s> PARSEOP_NAMESTRING
%token <i> PARSEOP_NAND
%token <i> PARSEOP_NOOP
%token <i> PARSEOP_NOR
%token <i> PARSEOP_NOT
%token <i> PARSEOP_NOTIFY
%token <i> PARSEOP_OBJECTTYPE
%token <i> PARSEOP_OBJECTTYPE_BFF
%token <i> PARSEOP_OBJECTTYPE_BUF
%token <i> PARSEOP_OBJECTTYPE_DDB
%token <i> PARSEOP_OBJECTTYPE_DEV
%token <i> PARSEOP_OBJECTTYPE_EVT
%token <i> PARSEOP_OBJECTTYPE_FLD
%token <i> PARSEOP_OBJECTTYPE_INT
%token <i> PARSEOP_OBJECTTYPE_MTH
%token <i> PARSEOP_OBJECTTYPE_MTX
%token <i> PARSEOP_OBJECTTYPE_OPR
%token <i> PARSEOP_OBJECTTYPE_PKG
%token <i> PARSEOP_OBJECTTYPE_POW
%token <i> PARSEOP_OBJECTTYPE_PRO
%token <i> PARSEOP_OBJECTTYPE_STR
%token <i> PARSEOP_OBJECTTYPE_THZ
%token <i> PARSEOP_OBJECTTYPE_UNK
%token <i> PARSEOP_OFFSET
%token <i> PARSEOP_ONE
%token <i> PARSEOP_ONES
%token <i> PARSEOP_OPERATIONREGION
%token <i> PARSEOP_OR
%token <i> PARSEOP_PACKAGE
%token <i> PARSEOP_PACKAGE_LENGTH
%token <i> PARSEOP_PARITYTYPE_EVEN
%token <i> PARSEOP_PARITYTYPE_MARK
%token <i> PARSEOP_PARITYTYPE_NONE
%token <i> PARSEOP_PARITYTYPE_ODD
%token <i> PARSEOP_PARITYTYPE_SPACE
%token <i> PARSEOP_PIN_NOPULL
%token <i> PARSEOP_PIN_PULLDEFAULT
%token <i> PARSEOP_PIN_PULLDOWN
%token <i> PARSEOP_PIN_PULLUP
%token <i> PARSEOP_POWERRESOURCE
%token <i> PARSEOP_PROCESSOR
%token <i> PARSEOP_QWORDCONST
%token <i> PARSEOP_QWORDIO
%token <i> PARSEOP_QWORDMEMORY
%token <i> PARSEOP_QWORDSPACE
%token <i> PARSEOP_RANGETYPE_ENTIRE
%token <i> PARSEOP_RANGETYPE_ISAONLY
%token <i> PARSEOP_RANGETYPE_NONISAONLY
%token <i> PARSEOP_RAW_DATA
%token <i> PARSEOP_READWRITETYPE_BOTH
%token <i> PARSEOP_READWRITETYPE_READONLY
%token <i> PARSEOP_REFOF
%token <i> PARSEOP_REGIONSPACE_CMOS
%token <i> PARSEOP_REGIONSPACE_EC
%token <i> PARSEOP_REGIONSPACE_FFIXEDHW
%token <i> PARSEOP_REGIONSPACE_GPIO
%token <i> PARSEOP_REGIONSPACE_GSBUS
%token <i> PARSEOP_REGIONSPACE_IO
%token <i> PARSEOP_REGIONSPACE_IPMI
%token <i> PARSEOP_REGIONSPACE_MEM
%token <i> PARSEOP_REGIONSPACE_PCC
%token <i> PARSEOP_REGIONSPACE_PCI
%token <i> PARSEOP_REGIONSPACE_PCIBAR
%token <i> PARSEOP_REGIONSPACE_SMBUS
%token <i> PARSEOP_REGISTER
%token <i> PARSEOP_RELEASE
%token <i> PARSEOP_RESERVED_BYTES
%token <i> PARSEOP_RESET
%token <i> PARSEOP_RESOURCETEMPLATE
%token <i> PARSEOP_RESOURCETYPE_CONSUMER
%token <i> PARSEOP_RESOURCETYPE_PRODUCER
%token <i> PARSEOP_RETURN
%token <i> PARSEOP_REVISION
%token <i> PARSEOP_SCOPE
%token <i> PARSEOP_SERIALIZERULE_NOTSERIAL
%token <i> PARSEOP_SERIALIZERULE_SERIAL
%token <i> PARSEOP_SHARETYPE_EXCLUSIVE
%token <i> PARSEOP_SHARETYPE_EXCLUSIVEWAKE
%token <i> PARSEOP_SHARETYPE_SHARED
%token <i> PARSEOP_SHARETYPE_SHAREDWAKE
%token <i> PARSEOP_SHIFTLEFT
%token <i> PARSEOP_SHIFTRIGHT
%token <i> PARSEOP_SIGNAL
%token <i> PARSEOP_SIZEOF
%token <i> PARSEOP_SLAVEMODE_CONTROLLERINIT
%token <i> PARSEOP_SLAVEMODE_DEVICEINIT
%token <i> PARSEOP_SLEEP
%token <i> PARSEOP_SPI_SERIALBUS
%token <i> PARSEOP_STALL
%token <i> PARSEOP_STARTDEPENDENTFN
%token <i> PARSEOP_STARTDEPENDENTFN_NOPRI
%token <i> PARSEOP_STOPBITS_ONE
%token <i> PARSEOP_STOPBITS_ONEPLUSHALF
%token <i> PARSEOP_STOPBITS_TWO
%token <i> PARSEOP_STOPBITS_ZERO
%token <i> PARSEOP_STORE
%token <s> PARSEOP_STRING_LITERAL
%token <i> PARSEOP_SUBTRACT
%token <i> PARSEOP_SWITCH
%token <i> PARSEOP_THERMALZONE
%token <i> PARSEOP_TIMER
%token <i> PARSEOP_TOBCD
%token <i> PARSEOP_TOBUFFER
%token <i> PARSEOP_TODECIMALSTRING
%token <i> PARSEOP_TOHEXSTRING
%token <i> PARSEOP_TOINTEGER
%token <i> PARSEOP_TOSTRING
%token <i> PARSEOP_TOUUID
%token <i> PARSEOP_TRANSLATIONTYPE_DENSE
%token <i> PARSEOP_TRANSLATIONTYPE_SPARSE
%token <i> PARSEOP_TYPE_STATIC
%token <i> PARSEOP_TYPE_TRANSLATION
%token <i> PARSEOP_UART_SERIALBUS
%token <i> PARSEOP_UNICODE
%token <i> PARSEOP_UNLOAD
%token <i> PARSEOP_UPDATERULE_ONES
%token <i> PARSEOP_UPDATERULE_PRESERVE
%token <i> PARSEOP_UPDATERULE_ZEROS
%token <i> PARSEOP_VAR_PACKAGE
%token <i> PARSEOP_VENDORLONG
%token <i> PARSEOP_VENDORSHORT
%token <i> PARSEOP_WAIT
%token <i> PARSEOP_WHILE
%token <i> PARSEOP_WIREMODE_FOUR
%token <i> PARSEOP_WIREMODE_THREE
%token <i> PARSEOP_WORDBUSNUMBER
%token <i> PARSEOP_WORDCONST
%token <i> PARSEOP_WORDIO
%token <i> PARSEOP_WORDSPACE
%token <i> PARSEOP_XFERSIZE_8
%token <i> PARSEOP_XFERSIZE_16
%token <i> PARSEOP_XFERSIZE_32
%token <i> PARSEOP_XFERSIZE_64
%token <i> PARSEOP_XFERSIZE_128
%token <i> PARSEOP_XFERSIZE_256
%token <i> PARSEOP_XFERTYPE_8
%token <i> PARSEOP_XFERTYPE_8_16
%token <i> PARSEOP_XFERTYPE_16
%token <i> PARSEOP_XOR
%token <i> PARSEOP_ZERO
/* ToPld macro */
%token <i> PARSEOP_TOPLD
%token <i> PARSEOP_PLD_REVISION
%token <i> PARSEOP_PLD_IGNORECOLOR
%token <i> PARSEOP_PLD_RED
%token <i> PARSEOP_PLD_GREEN
%token <i> PARSEOP_PLD_BLUE
%token <i> PARSEOP_PLD_WIDTH
%token <i> PARSEOP_PLD_HEIGHT
%token <i> PARSEOP_PLD_USERVISIBLE
%token <i> PARSEOP_PLD_DOCK
%token <i> PARSEOP_PLD_LID
%token <i> PARSEOP_PLD_PANEL
%token <i> PARSEOP_PLD_VERTICALPOSITION
%token <i> PARSEOP_PLD_HORIZONTALPOSITION
%token <i> PARSEOP_PLD_SHAPE
%token <i> PARSEOP_PLD_GROUPORIENTATION
%token <i> PARSEOP_PLD_GROUPTOKEN
%token <i> PARSEOP_PLD_GROUPPOSITION
%token <i> PARSEOP_PLD_BAY
%token <i> PARSEOP_PLD_EJECTABLE
%token <i> PARSEOP_PLD_EJECTREQUIRED
%token <i> PARSEOP_PLD_CABINETNUMBER
%token <i> PARSEOP_PLD_CARDCAGENUMBER
%token <i> PARSEOP_PLD_REFERENCE
%token <i> PARSEOP_PLD_ROTATION
%token <i> PARSEOP_PLD_ORDER
%token <i> PARSEOP_PLD_RESERVED
%token <i> PARSEOP_PLD_VERTICALOFFSET
%token <i> PARSEOP_PLD_HORIZONTALOFFSET
/*
* C-style expression parser. These must appear after all of the
* standard ASL operators and keywords.
*
* Note: The order of these tokens implements the precedence rules
* (low precedence to high). See aslrules.y for an exhaustive list.
*/
%right <i> PARSEOP_EXP_EQUALS
PARSEOP_EXP_ADD_EQ
PARSEOP_EXP_SUB_EQ
PARSEOP_EXP_MUL_EQ
PARSEOP_EXP_DIV_EQ
PARSEOP_EXP_MOD_EQ
PARSEOP_EXP_SHL_EQ
PARSEOP_EXP_SHR_EQ
PARSEOP_EXP_AND_EQ
PARSEOP_EXP_XOR_EQ
PARSEOP_EXP_OR_EQ
%left <i> PARSEOP_EXP_LOGICAL_OR
%left <i> PARSEOP_EXP_LOGICAL_AND
%left <i> PARSEOP_EXP_OR
%left <i> PARSEOP_EXP_XOR
%left <i> PARSEOP_EXP_AND
%left <i> PARSEOP_EXP_EQUAL
PARSEOP_EXP_NOT_EQUAL
%left <i> PARSEOP_EXP_GREATER
PARSEOP_EXP_LESS
PARSEOP_EXP_GREATER_EQUAL
PARSEOP_EXP_LESS_EQUAL
%left <i> PARSEOP_EXP_SHIFT_RIGHT
PARSEOP_EXP_SHIFT_LEFT
%left <i> PARSEOP_EXP_ADD
PARSEOP_EXP_SUBTRACT
%left <i> PARSEOP_EXP_MULTIPLY
PARSEOP_EXP_DIVIDE
PARSEOP_EXP_MODULO
%right <i> PARSEOP_EXP_NOT
PARSEOP_EXP_LOGICAL_NOT
%left <i> PARSEOP_EXP_INCREMENT
PARSEOP_EXP_DECREMENT
%token <i> PARSEOP_PRINTF
%token <i> PARSEOP_FPRINTF
/* Specific parentheses tokens are not used at this time */
/* PARSEOP_EXP_PAREN_OPEN */
/* PARSEOP_EXP_PAREN_CLOSE */
/*
* Special functions. These should probably stay at the end of this
* table.
*/
%token <i> PARSEOP___DATE__
%token <i> PARSEOP___FILE__
%token <i> PARSEOP___LINE__
%token <i> PARSEOP___PATH__

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
@ -377,7 +376,6 @@ TrDoDefinitionBlock (
*
* RETURN: None
*
*
* DESCRIPTION: Translate ASL SWITCH statement to if/else pairs. There is
* no actual AML opcode for SWITCH -- it must be simulated.
*
@ -450,10 +448,6 @@ TrDoSwitch (
{
/* Add an ELSE to complete the previous CASE */
if (!Conditional)
{
return;
}
NewOp = TrCreateLeafNode (PARSEOP_ELSE);
NewOp->Asl.Parent = Conditional->Asl.Parent;
TrAmlInitLineNumbers (NewOp, NewOp->Asl.Parent);
@ -620,11 +614,6 @@ TrDoSwitch (
{
/* Convert the DEFAULT node to an ELSE */
if (!Conditional)
{
return;
}
TrAmlInitNode (DefaultOp, PARSEOP_ELSE);
DefaultOp->Asl.Parent = Conditional->Asl.Parent;

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acapps.h>
@ -79,15 +78,29 @@ static ACPI_PARSE_OBJECT *
TrGetNextNode (
void)
{
ASL_CACHE_INFO *Cache;
if (Gbl_NodeCacheNext >= Gbl_NodeCacheLast)
if (Gbl_ParseOpCacheNext >= Gbl_ParseOpCacheLast)
{
Gbl_NodeCacheNext = UtLocalCalloc (sizeof (ACPI_PARSE_OBJECT) *
ASL_NODE_CACHE_SIZE);
Gbl_NodeCacheLast = Gbl_NodeCacheNext + ASL_NODE_CACHE_SIZE;
/* Allocate a new buffer */
Cache = UtLocalCalloc (sizeof (Cache->Next) +
(sizeof (ACPI_PARSE_OBJECT) * ASL_PARSEOP_CACHE_SIZE));
/* Link new cache buffer to head of list */
Cache->Next = Gbl_ParseOpCacheList;
Gbl_ParseOpCacheList = Cache;
/* Setup cache management pointers */
Gbl_ParseOpCacheNext = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Cache->Buffer);
Gbl_ParseOpCacheLast = Gbl_ParseOpCacheNext + ASL_PARSEOP_CACHE_SIZE;
}
return (Gbl_NodeCacheNext++);
Gbl_ParseOpCount++;
return (Gbl_ParseOpCacheNext++);
}
@ -433,6 +446,124 @@ TrSetEndLineNumber (
}
/*******************************************************************************
*
* FUNCTION: TrCreateAssignmentNode
*
* PARAMETERS: Target - Assignment target
* Source - Assignment source
*
* RETURN: Pointer to the new node. Aborts on allocation failure
*
* DESCRIPTION: Implements the C-style '=' operator. It changes the parse
* tree if possible to utilize the last argument of the math
* operators which is a target operand -- thus saving invocation
* of and additional Store() operator. An optimization.
*
******************************************************************************/
ACPI_PARSE_OBJECT *
TrCreateAssignmentNode (
ACPI_PARSE_OBJECT *Target,
ACPI_PARSE_OBJECT *Source)
{
ACPI_PARSE_OBJECT *TargetOp;
ACPI_PARSE_OBJECT *SourceOp1;
ACPI_PARSE_OBJECT *SourceOp2;
ACPI_PARSE_OBJECT *Operator;
DbgPrint (ASL_PARSE_OUTPUT,
"\nTrCreateAssignmentNode Line [%u to %u] Source %s Target %s\n",
Source->Asl.LineNumber, Source->Asl.EndLine,
UtGetOpName (Source->Asl.ParseOpcode),
UtGetOpName (Target->Asl.ParseOpcode));
TrSetNodeFlags (Target, NODE_IS_TARGET);
switch (Source->Asl.ParseOpcode)
{
/*
* Only these operators can be optimized because they have
* a target operand
*/
case PARSEOP_ADD:
case PARSEOP_AND:
case PARSEOP_DIVIDE:
case PARSEOP_MOD:
case PARSEOP_MULTIPLY:
case PARSEOP_NOT:
case PARSEOP_OR:
case PARSEOP_SHIFTLEFT:
case PARSEOP_SHIFTRIGHT:
case PARSEOP_SUBTRACT:
case PARSEOP_XOR:
break;
/* Otherwise, just create a normal Store operator */
default:
goto CannotOptimize;
}
/*
* Transform the parse tree such that the target is moved to the
* last operand of the operator
*/
SourceOp1 = Source->Asl.Child;
SourceOp2 = SourceOp1->Asl.Next;
/* NOT only has one operand, but has a target */
if (Source->Asl.ParseOpcode == PARSEOP_NOT)
{
SourceOp2 = SourceOp1;
}
/* DIVIDE has an extra target operand (remainder) */
if (Source->Asl.ParseOpcode == PARSEOP_DIVIDE)
{
SourceOp2 = SourceOp2->Asl.Next;
}
TargetOp = SourceOp2->Asl.Next;
/*
* Can't perform this optimization if there already is a target
* for the operator (ZERO is a "no target" placeholder).
*/
if (TargetOp->Asl.ParseOpcode != PARSEOP_ZERO)
{
goto CannotOptimize;
}
/* Link in the target as the final operand */
SourceOp2->Asl.Next = Target;
Target->Asl.Parent = Source;
return (Source);
CannotOptimize:
Operator = TrAllocateNode (PARSEOP_STORE);
TrLinkChildren (Operator, 2, Source, Target);
/* Set the appropriate line numbers for the new node */
Operator->Asl.LineNumber = Target->Asl.LineNumber;
Operator->Asl.LogicalLineNumber = Target->Asl.LogicalLineNumber;
Operator->Asl.LogicalByteOffset = Target->Asl.LogicalByteOffset;
Operator->Asl.Column = Target->Asl.Column;
return (Operator);
}
/*******************************************************************************
*
* FUNCTION: TrCreateLeafNode
@ -517,7 +648,6 @@ TrCreateConstantLeafNode (
/* Get the simple filename from the full path */
FlSplitInputPathname (Op->Asl.Filename, &Path, &Filename);
ACPI_FREE (Path);
Op->Asl.Value.String = Filename;
break;
@ -549,6 +679,81 @@ TrCreateConstantLeafNode (
}
/*******************************************************************************
*
* FUNCTION: TrCreateTargetOperand
*
* PARAMETERS: OriginalOp - Op to be copied
*
* RETURN: Pointer to the new node. Aborts on allocation failure
*
* DESCRIPTION: Copy an existing node (and subtree). Used in ASL+ (C-style)
* expressions where the target is the same as one of the
* operands. A new node and subtree must be created from the
* original so that the parse tree can be linked properly.
*
* NOTE: This code is specific to target operands that are the last
* operand in an ASL/AML operator. Meaning that the top-level
* parse Op in a possible subtree has a NULL Next pointer.
* This simplifies the recursion.
*
* Subtree example:
* DeRefOf (Local1) += 32
*
* This gets converted to:
* Add (DeRefOf (Local1), 32, DeRefOf (Local1))
*
* Each DeRefOf has a single child, Local1. Even more complex
* subtrees can be created via the Index and DeRefOf operators.
*
******************************************************************************/
ACPI_PARSE_OBJECT *
TrCreateTargetOperand (
ACPI_PARSE_OBJECT *OriginalOp,
ACPI_PARSE_OBJECT *ParentOp)
{
ACPI_PARSE_OBJECT *Op;
if (!OriginalOp)
{
return (NULL);
}
Op = TrGetNextNode ();
/* Copy the pertinent values (omit link pointer fields) */
Op->Asl.Value = OriginalOp->Asl.Value;
Op->Asl.Filename = OriginalOp->Asl.Filename;
Op->Asl.LineNumber = OriginalOp->Asl.LineNumber;
Op->Asl.LogicalLineNumber = OriginalOp->Asl.LogicalLineNumber;
Op->Asl.LogicalByteOffset = OriginalOp->Asl.LogicalByteOffset;
Op->Asl.Column = OriginalOp->Asl.Column;
Op->Asl.Flags = OriginalOp->Asl.Flags;
Op->Asl.CompileFlags = OriginalOp->Asl.CompileFlags;
Op->Asl.AmlOpcode = OriginalOp->Asl.AmlOpcode;
Op->Asl.ParseOpcode = OriginalOp->Asl.ParseOpcode;
Op->Asl.Parent = ParentOp;
UtSetParseOpName (Op);
/* Copy a possible subtree below this node */
if (OriginalOp->Asl.Child)
{
Op->Asl.Child = TrCreateTargetOperand (OriginalOp->Asl.Child, Op);
}
if (OriginalOp->Asl.Next) /* Null for top-level node */
{
Op->Asl.Next = TrCreateTargetOperand (OriginalOp->Asl.Next, ParentOp);
}
return (Op);
}
/*******************************************************************************
*
* FUNCTION: TrCreateValuedLeafNode

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef __ASLTYPES_H
#define __ASLTYPES_H
@ -166,15 +165,26 @@ typedef enum
ASL_FILE_C_SOURCE_OUTPUT,
ASL_FILE_ASM_INCLUDE_OUTPUT,
ASL_FILE_C_INCLUDE_OUTPUT,
ASL_FILE_C_OFFSET_OUTPUT
ASL_FILE_C_OFFSET_OUTPUT,
ASL_FILE_MAP_OUTPUT
} ASL_FILE_TYPES;
#define ASL_MAX_FILE_TYPE 14
#define ASL_MAX_FILE_TYPE 15
#define ASL_NUM_FILES (ASL_MAX_FILE_TYPE + 1)
/* Cache block structure for ParseOps and Strings */
typedef struct asl_cache_info
{
void *Next;
char Buffer[1];
} ASL_CACHE_INFO;
typedef struct asl_include_dir
{
char *Dir;
@ -196,7 +206,7 @@ typedef struct asl_error_msg
char *Filename;
char *SourceLine;
UINT32 FilenameLength;
UINT8 MessageId;
UINT16 MessageId;
UINT8 Level;
} ASL_ERROR_MSG;
@ -238,4 +248,35 @@ typedef struct asl_event_info
} ASL_EVENT_INFO;
/* Hardware mapping file structures */
typedef struct acpi_gpio_info
{
struct acpi_gpio_info *Next;
ACPI_PARSE_OBJECT *Op;
char *DeviceName;
ACPI_NAMESPACE_NODE *TargetNode;
UINT32 References;
UINT32 PinCount;
UINT32 PinIndex;
UINT16 PinNumber;
UINT8 Type;
UINT8 Direction;
UINT8 Polarity;
} ACPI_GPIO_INFO;
typedef struct acpi_serial_info
{
struct acpi_serial_info *Next;
ACPI_PARSE_OBJECT *Op;
char *DeviceName;
ACPI_NAMESPACE_NODE *TargetNode;
AML_RESOURCE *Resource;
UINT32 Speed;
UINT16 Address;
} ACPI_SERIAL_INFO;
#endif /* __ASLTYPES_H */

View File

@ -0,0 +1,393 @@
NoEcho('
/******************************************************************************
*
* Module Name: asltypes.y - Bison/Yacc production types/names
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
')
/******************************************************************************
*
* Production names
*
*****************************************************************************/
%type <n> ArgList
%type <n> ASLCode
%type <n> BufferData
%type <n> BufferTermData
%type <n> CompilerDirective
%type <n> DataObject
%type <n> DefinitionBlockTerm
%type <n> IntegerData
%type <n> NamedObject
%type <n> NameSpaceModifier
%type <n> Object
%type <n> ObjectList
%type <n> PackageData
%type <n> ParameterTypePackage
%type <n> ParameterTypePackageList
%type <n> ParameterTypesPackage
%type <n> ParameterTypesPackageList
%type <n> RequiredTarget
%type <n> SimpleTarget
%type <n> StringData
%type <n> Target
%type <n> Term
%type <n> TermArg
%type <n> TermList
%type <n> UserTerm
/* Type4Opcode is obsolete */
%type <n> Type1Opcode
%type <n> Type2BufferOpcode
%type <n> Type2BufferOrStringOpcode
%type <n> Type2IntegerOpcode
%type <n> Type2Opcode
%type <n> Type2StringOpcode
%type <n> Type3Opcode
%type <n> Type5Opcode
%type <n> Type6Opcode
%type <n> AccessAsTerm
%type <n> ExternalTerm
%type <n> FieldUnit
%type <n> FieldUnitEntry
%type <n> FieldUnitList
%type <n> IncludeTerm
%type <n> OffsetTerm
%type <n> OptionalAccessAttribTerm
/* Named Objects */
%type <n> BankFieldTerm
%type <n> CreateBitFieldTerm
%type <n> CreateByteFieldTerm
%type <n> CreateDWordFieldTerm
%type <n> CreateFieldTerm
%type <n> CreateQWordFieldTerm
%type <n> CreateWordFieldTerm
%type <n> DataRegionTerm
%type <n> DeviceTerm
%type <n> EventTerm
%type <n> FieldTerm
%type <n> FunctionTerm
%type <n> IndexFieldTerm
%type <n> MethodTerm
%type <n> MutexTerm
%type <n> OpRegionTerm
%type <n> OpRegionSpaceIdTerm
%type <n> PowerResTerm
%type <n> ProcessorTerm
%type <n> ThermalZoneTerm
/* Namespace modifiers */
%type <n> AliasTerm
%type <n> NameTerm
%type <n> ScopeTerm
/* Type 1 opcodes */
%type <n> BreakPointTerm
%type <n> BreakTerm
%type <n> CaseDefaultTermList
%type <n> CaseTerm
%type <n> ContinueTerm
%type <n> DefaultTerm
%type <n> ElseTerm
%type <n> FatalTerm
%type <n> IfElseTerm
%type <n> IfTerm
%type <n> LoadTerm
%type <n> NoOpTerm
%type <n> NotifyTerm
%type <n> ReleaseTerm
%type <n> ResetTerm
%type <n> ReturnTerm
%type <n> SignalTerm
%type <n> SleepTerm
%type <n> StallTerm
%type <n> SwitchTerm
%type <n> UnloadTerm
%type <n> WhileTerm
/* %type <n> CaseTermList */
/* Type 2 opcodes */
%type <n> AcquireTerm
%type <n> AddTerm
%type <n> AndTerm
%type <n> ConcatResTerm
%type <n> ConcatTerm
%type <n> CondRefOfTerm
%type <n> CopyObjectTerm
%type <n> DecTerm
%type <n> DerefOfTerm
%type <n> DivideTerm
%type <n> FindSetLeftBitTerm
%type <n> FindSetRightBitTerm
%type <n> FromBCDTerm
%type <n> IncTerm
%type <n> IndexTerm
%type <n> LAndTerm
%type <n> LEqualTerm
%type <n> LGreaterEqualTerm
%type <n> LGreaterTerm
%type <n> LLessEqualTerm
%type <n> LLessTerm
%type <n> LNotEqualTerm
%type <n> LNotTerm
%type <n> LoadTableTerm
%type <n> LOrTerm
%type <n> MatchTerm
%type <n> MidTerm
%type <n> ModTerm
%type <n> MultiplyTerm
%type <n> NAndTerm
%type <n> NOrTerm
%type <n> NotTerm
%type <n> ObjectTypeTerm
%type <n> OrTerm
%type <n> RefOfTerm
%type <n> ShiftLeftTerm
%type <n> ShiftRightTerm
%type <n> SizeOfTerm
%type <n> StoreTerm
%type <n> SubtractTerm
%type <n> TimerTerm
%type <n> ToBCDTerm
%type <n> ToBufferTerm
%type <n> ToDecimalStringTerm
%type <n> ToHexStringTerm
%type <n> ToIntegerTerm
%type <n> ToStringTerm
%type <n> WaitTerm
%type <n> XOrTerm
/* Keywords */
%type <n> AccessAttribKeyword
%type <n> AccessTypeKeyword
%type <n> AddressingModeKeyword
%type <n> AddressKeyword
%type <n> AddressSpaceKeyword
%type <n> BitsPerByteKeyword
%type <n> ClockPhaseKeyword
%type <n> ClockPolarityKeyword
%type <n> DecodeKeyword
%type <n> DevicePolarityKeyword
%type <n> DMATypeKeyword
%type <n> EndianKeyword
%type <n> FlowControlKeyword
%type <n> InterruptLevel
%type <n> InterruptTypeKeyword
%type <n> IODecodeKeyword
%type <n> IoRestrictionKeyword
%type <n> LockRuleKeyword
%type <n> MatchOpKeyword
%type <n> MaxKeyword
%type <n> MemTypeKeyword
%type <n> MinKeyword
%type <n> ObjectTypeKeyword
%type <n> OptionalBusMasterKeyword
%type <n> OptionalReadWriteKeyword
%type <n> ParityTypeKeyword
%type <n> PinConfigByte
%type <n> PinConfigKeyword
%type <n> RangeTypeKeyword
%type <n> RegionSpaceKeyword
%type <n> ResourceTypeKeyword
%type <n> SerializeRuleKeyword
%type <n> ShareTypeKeyword
%type <n> SlaveModeKeyword
%type <n> StopBitsKeyword
%type <n> TranslationKeyword
%type <n> TypeKeyword
%type <n> UpdateRuleKeyword
%type <n> WireModeKeyword
%type <n> XferSizeKeyword
%type <n> XferTypeKeyword
/* Types */
%type <n> SuperName
%type <n> ObjectTypeName
%type <n> ArgTerm
%type <n> LocalTerm
%type <n> DebugTerm
%type <n> Integer
%type <n> ByteConst
%type <n> WordConst
%type <n> DWordConst
%type <n> QWordConst
%type <n> String
%type <n> ConstTerm
%type <n> ConstExprTerm
%type <n> ByteConstExpr
%type <n> WordConstExpr
%type <n> DWordConstExpr
%type <n> QWordConstExpr
%type <n> DWordList
%type <n> BufferTerm
%type <n> ByteList
%type <n> PackageElement
%type <n> PackageList
%type <n> PackageTerm
%type <n> VarPackageLengthTerm
/* Macros */
%type <n> EISAIDTerm
%type <n> ResourceMacroList
%type <n> ResourceMacroTerm
%type <n> ResourceTemplateTerm
%type <n> PldKeyword
%type <n> PldKeywordList
%type <n> ToPLDTerm
%type <n> ToUUIDTerm
%type <n> UnicodeTerm
%type <n> PrintfArgList
%type <n> PrintfTerm
%type <n> FprintfTerm
/* Resource Descriptors */
%type <n> ConnectionTerm
%type <n> DataBufferTerm
%type <n> DMATerm
%type <n> DWordIOTerm
%type <n> DWordMemoryTerm
%type <n> DWordSpaceTerm
%type <n> EndDependentFnTerm
%type <n> ExtendedIOTerm
%type <n> ExtendedMemoryTerm
%type <n> ExtendedSpaceTerm
%type <n> FixedDmaTerm
%type <n> FixedIOTerm
%type <n> GpioIntTerm
%type <n> GpioIoTerm
%type <n> I2cSerialBusTerm
%type <n> InterruptTerm
%type <n> IOTerm
%type <n> IRQNoFlagsTerm
%type <n> IRQTerm
%type <n> Memory24Term
%type <n> Memory32FixedTerm
%type <n> Memory32Term
%type <n> NameSeg
%type <n> NameString
%type <n> QWordIOTerm
%type <n> QWordMemoryTerm
%type <n> QWordSpaceTerm
%type <n> RegisterTerm
%type <n> SpiSerialBusTerm
%type <n> StartDependentFnNoPriTerm
%type <n> StartDependentFnTerm
%type <n> UartSerialBusTerm
%type <n> VendorLongTerm
%type <n> VendorShortTerm
%type <n> WordBusNumberTerm
%type <n> WordIOTerm
%type <n> WordSpaceTerm
/* Local types that help construct the AML, not in ACPI spec */
%type <n> AmlPackageLengthTerm
%type <n> IncludeEndTerm
%type <n> NameStringItem
%type <n> TermArgItem
%type <n> OptionalAccessSize
%type <n> OptionalAddressingMode
%type <n> OptionalAddressRange
%type <n> OptionalBitsPerByte
%type <n> OptionalBuffer_Last
%type <n> OptionalByteConstExpr
%type <n> OptionalCount
%type <n> OptionalDecodeType
%type <n> OptionalDevicePolarity
%type <n> OptionalDWordConstExpr
%type <n> OptionalEndian
%type <n> OptionalFlowControl
%type <n> OptionalIoRestriction
%type <n> OptionalListString
%type <n> OptionalMaxType
%type <n> OptionalMemType
%type <n> OptionalMinType
%type <n> OptionalNameString
%type <n> OptionalNameString_First
%type <n> OptionalNameString_Last
%type <n> OptionalObjectTypeKeyword
%type <n> OptionalParameterTypePackage
%type <n> OptionalParameterTypesPackage
%type <n> OptionalParityType
%type <n> OptionalQWordConstExpr
%type <n> OptionalRangeType
%type <n> OptionalReference
%type <n> OptionalResourceType
%type <n> OptionalResourceType_First
%type <n> OptionalReturnArg
%type <n> OptionalSerializeRuleKeyword
%type <n> OptionalShareType
%type <n> OptionalShareType_First
%type <n> OptionalSlaveMode
%type <n> OptionalStopBits
%type <n> OptionalStringData
%type <n> OptionalTermArg
%type <n> OptionalTranslationType_Last
%type <n> OptionalType
%type <n> OptionalType_Last
%type <n> OptionalWireMode
%type <n> OptionalWordConst
%type <n> OptionalWordConstExpr
%type <n> OptionalXferSize
/*
* C-style expression parser
*/
%type <n> Expression
%type <n> EqualsTerm

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acdisasm.h>
@ -241,37 +240,6 @@ UtEndEvent (
}
/*******************************************************************************
*
* FUNCTION: UtHexCharToValue
*
* PARAMETERS: HexChar - Hex character in Ascii
*
* RETURN: The binary value of the hex character
*
* DESCRIPTION: Perform ascii-to-hex translation
*
******************************************************************************/
UINT8
UtHexCharToValue (
int HexChar)
{
if (HexChar <= 0x39)
{
return ((UINT8) (HexChar - 0x30));
}
if (HexChar <= 0x46)
{
return ((UINT8) (HexChar - 0x37));
}
return ((UINT8) (HexChar - 0x57));
}
/*******************************************************************************
*
* FUNCTION: UtConvertByteToHex
@ -296,8 +264,8 @@ UtConvertByteToHex (
Buffer[0] = '0';
Buffer[1] = 'x';
Buffer[2] = (UINT8) AslHexLookup[(RawByte >> 4) & 0xF];
Buffer[3] = (UINT8) AslHexLookup[RawByte & 0xF];
Buffer[2] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 4);
Buffer[3] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 0);
}
@ -312,7 +280,7 @@ UtConvertByteToHex (
* RETURN: Ascii hex byte is stored in Buffer.
*
* DESCRIPTION: Perform hex-to-ascii translation. The return data is prefixed
* with "0x"
* with '0', and a trailing 'h' is added.
*
******************************************************************************/
@ -323,8 +291,8 @@ UtConvertByteToAsmHex (
{
Buffer[0] = '0';
Buffer[1] = (UINT8) AslHexLookup[(RawByte >> 4) & 0xF];
Buffer[2] = (UINT8) AslHexLookup[RawByte & 0xF];
Buffer[1] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 4);
Buffer[2] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 0);
Buffer[3] = 'h';
}
@ -585,7 +553,7 @@ UtCheckIntegerRange (
/*******************************************************************************
*
* FUNCTION: UtGetStringBuffer
* FUNCTION: UtStringCacheCalloc
*
* PARAMETERS: Length - Size of buffer requested
*
@ -598,22 +566,58 @@ UtCheckIntegerRange (
******************************************************************************/
char *
UtGetStringBuffer (
UtStringCacheCalloc (
UINT32 Length)
{
char *Buffer;
ASL_CACHE_INFO *Cache;
UINT32 CacheSize = ASL_STRING_CACHE_SIZE;
if (Length > CacheSize)
{
CacheSize = Length;
if (Gbl_StringCacheList)
{
Cache = UtLocalCalloc (sizeof (Cache->Next) + CacheSize);
/* Link new cache buffer just following head of list */
Cache->Next = Gbl_StringCacheList->Next;
Gbl_StringCacheList->Next = Cache;
/* Leave cache management pointers alone as they pertain to head */
Gbl_StringCount++;
Gbl_StringSize += Length;
return (Cache->Buffer);
}
}
if ((Gbl_StringCacheNext + Length) >= Gbl_StringCacheLast)
{
Gbl_StringCacheNext = UtLocalCalloc (ASL_STRING_CACHE_SIZE + Length);
Gbl_StringCacheLast = Gbl_StringCacheNext + ASL_STRING_CACHE_SIZE +
Length;
/* Allocate a new buffer */
Cache = UtLocalCalloc (sizeof (Cache->Next) + CacheSize);
/* Link new cache buffer to head of list */
Cache->Next = Gbl_StringCacheList;
Gbl_StringCacheList = Cache;
/* Setup cache management pointers */
Gbl_StringCacheNext = Cache->Buffer;
Gbl_StringCacheLast = Gbl_StringCacheNext + CacheSize;
}
Gbl_StringCount++;
Gbl_StringSize += Length;
Buffer = Gbl_StringCacheNext;
Gbl_StringCacheNext += Length;
return (Buffer);
}
@ -646,7 +650,8 @@ UtExpandLineBuffers (
NewSize = Gbl_LineBufferSize * 2;
if (Gbl_CurrentLineBuffer)
{
DbgPrint (ASL_DEBUG_OUTPUT,"Increasing line buffer size from %u to %u\n",
DbgPrint (ASL_DEBUG_OUTPUT,
"Increasing line buffer size from %u to %u\n",
Gbl_LineBufferSize, NewSize);
}
@ -691,6 +696,30 @@ ErrorExit:
}
/******************************************************************************
*
* FUNCTION: UtFreeLineBuffers
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Free all line buffers
*
*****************************************************************************/
void
UtFreeLineBuffers (
void)
{
free (Gbl_CurrentLineBuffer);
free (Gbl_MainTokenBuffer);
free (Gbl_MacroTokenBuffer);
free (Gbl_ExpressionTokenBuffer);
}
/*******************************************************************************
*
* FUNCTION: UtInternalizeName
@ -723,9 +752,9 @@ UtInternalizeName (
Info.ExternalName = ExternalName;
AcpiNsGetInternalNameLength (&Info);
/* We need a segment to store the internal name */
/* We need a segment to store the internal name */
Info.InternalName = UtGetStringBuffer (Info.Length);
Info.InternalName = UtStringCacheCalloc (Info.Length);
if (!Info.InternalName)
{
return (AE_NO_MEMORY);
@ -918,7 +947,7 @@ UtDoConstant (
}
/* TBD: use version in ACPI CA main code base? */
/* TBD: use version in ACPICA main code base? */
/*******************************************************************************
*

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,42 +41,13 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("asluuid")
/*
* UUID support functions.
*
* This table is used to convert an input UUID ascii string to a 16 byte
* buffer and the reverse. The table maps a UUID buffer index 0-15 to
* the index within the 36-byte UUID string where the associated 2-byte
* hex value can be found.
*
* 36-byte UUID strings are of the form:
* aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
* Where aa-pp are one byte hex numbers, made up of two hex digits
*
* Note: This table is basically the inverse of the string-to-offset table
* found in the ACPI spec in the description of the ToUUID macro.
*/
static UINT8 Gbl_MapToUuidOffset[16] =
{
6,4,2,0,11,9,16,14,19,21,24,26,28,30,32,34
};
#define UUID_BUFFER_LENGTH 16
#define UUID_STRING_LENGTH 36
/* Positions for required hyphens (dashes) in UUID strings */
#define UUID_HYPHEN1_OFFSET 8
#define UUID_HYPHEN2_OFFSET 13
#define UUID_HYPHEN3_OFFSET 18
#define UUID_HYPHEN4_OFFSET 23
extern UINT8 AcpiGbl_MapToUuidOffset[UUID_BUFFER_LENGTH];
/*******************************************************************************
@ -135,42 +106,6 @@ AuValidateUuid (
}
/*******************************************************************************
*
* FUNCTION: AuConvertStringToUuid
*
* PARAMETERS: InString - 36-byte formatted UUID string
* UuidBuffer - 16-byte UUID buffer
*
* RETURN: Status
*
* DESCRIPTION: Convert 36-byte formatted UUID string to 16-byte UUID buffer
*
******************************************************************************/
ACPI_STATUS
AuConvertStringToUuid (
char *InString,
char *UuidBuffer)
{
UINT32 i;
if (!InString || !UuidBuffer)
{
return (AE_BAD_PARAMETER);
}
for (i = 0; i < UUID_BUFFER_LENGTH; i++)
{
UuidBuffer[i] = (char) (UtHexCharToValue (InString[Gbl_MapToUuidOffset[i]]) << 4);
UuidBuffer[i] |= (char) UtHexCharToValue (InString[Gbl_MapToUuidOffset[i] + 1]);
}
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AuConvertUuidToString
@ -200,8 +135,11 @@ AuConvertUuidToString (
for (i = 0; i < UUID_BUFFER_LENGTH; i++)
{
OutString[Gbl_MapToUuidOffset[i]] = (UINT8) AslHexLookup[(UuidBuffer[i] >> 4) & 0xF];
OutString[Gbl_MapToUuidOffset[i] + 1] = (UINT8) AslHexLookup[UuidBuffer[i] & 0xF];
OutString[AcpiGbl_MapToUuidOffset[i]] =
AcpiUtHexToAsciiChar (UuidBuffer[i], 4);
OutString[AcpiGbl_MapToUuidOffset[i] + 1] =
AcpiUtHexToAsciiChar (UuidBuffer[i], 0);
}
/* Insert required hyphens (dashes) */

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acparser.h>
@ -295,6 +294,13 @@ AnOperandTypecheckWalkEnd (
{
RequiredBtypes = AnMapArgTypeToBtype (ArgType);
if (!ArgOp)
{
AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, Op,
"Null ArgOp in argument loop");
AslAbort ();
}
ThisNodeBtype = AnGetBtype (ArgOp);
if (ThisNodeBtype == ACPI_UINT32_MAX)
{
@ -605,6 +611,10 @@ AnOtherSemanticAnalysisWalkBegin (
ArgNode = Op->Asl.Parent; /* Field definition */
ArgNode = ArgNode->Asl.Child; /* First child is the OpRegion Name */
Node = ArgNode->Asl.Node; /* OpRegion namespace node */
if (!Node)
{
break;
}
ArgNode = Node->Op; /* OpRegion definition */
ArgNode = ArgNode->Asl.Child; /* First child is the OpRegion Name */

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include "aslcompiler.y.h"
#include <contrib/dev/acpica/include/acparser.h>
@ -86,6 +85,22 @@ XfCheckFieldRange (
UINT32 FieldBitLength,
UINT32 AccessBitWidth);
#ifdef __UNDER_DEVELOPMENT
static ACPI_PARSE_OBJECT *
XfGetParentMethod (
ACPI_PARSE_OBJECT *Op);
static void
XfCheckIllegalReference (
ACPI_PARSE_OBJECT *Op,
ACPI_NAMESPACE_NODE *Node);
static BOOLEAN
XfIsObjectParental (
ACPI_PARSE_OBJECT *MethodOp1,
ACPI_PARSE_OBJECT *MethodOp2);
#endif
/*******************************************************************************
*
@ -130,6 +145,8 @@ XfCrossReferenceNamespace (
TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, XfNamespaceLocateBegin,
XfNamespaceLocateEnd, WalkState);
ACPI_FREE (WalkState);
return (AE_OK);
}
@ -262,6 +279,182 @@ XfCheckFieldRange (
}
}
#ifdef __UNDER_DEVELOPMENT
/*******************************************************************************
*
* FUNCTION: XfIsObjectParental
*
* PARAMETERS: ChildOp - Op to be checked
* PossibleParentOp - Determine if this op is in the family
*
* RETURN: TRUE if ChildOp is a descendent of PossibleParentOp
*
* DESCRIPTION: Determine if an Op is a descendent of another Op. Used to
* detect if a method is declared within another method.
*
******************************************************************************/
static BOOLEAN
XfIsObjectParental (
ACPI_PARSE_OBJECT *ChildOp,
ACPI_PARSE_OBJECT *PossibleParentOp)
{
ACPI_PARSE_OBJECT *ParentOp;
/* Search upwards through the tree for possible parent */
ParentOp = ChildOp;
while (ParentOp)
{
if (ParentOp == PossibleParentOp)
{
return (TRUE);
}
ParentOp = ParentOp->Asl.Parent;
}
return (FALSE);
}
/*******************************************************************************
*
* FUNCTION: XfGetParentMethod
*
* PARAMETERS: Op - Op to be checked
*
* RETURN: Op for parent method. NULL if object is not within a method.
*
* DESCRIPTION: Determine if an object is within a control method. Used to
* implement special rules for named references from within a
* control method.
*
* NOTE: It would be better to have the parser set a flag in the Op if possible.
*
******************************************************************************/
static ACPI_PARSE_OBJECT *
XfGetParentMethod (
ACPI_PARSE_OBJECT *Op)
{
ACPI_PARSE_OBJECT *ParentOp;
if (!Op)
{
return (NULL);
}
if (Op->Asl.ParseOpcode == PARSEOP_METHOD)
{
return (NULL);
}
/* Walk upwards through the parse tree, up to the root if necessary */
ParentOp = Op;
while (ParentOp)
{
if (ParentOp->Asl.ParseOpcode == PARSEOP_METHOD)
{
return (ParentOp);
}
ParentOp = ParentOp->Asl.Parent;
}
/* Object is not within a method */
return (NULL);
}
/*******************************************************************************
*
* FUNCTION: XfCheckIllegalReference
*
* PARAMETERS: Op - Op referring to the target
* TargetNode - Target of the reference
*
* RETURN: None. Emits error message for an illegal reference
*
* DESCRIPTION: Determine if a named reference is legal. A "named" reference
* is something like: Store(ABCD, ...), where ABCD is an AML
* Nameseg or Namepath.
*
* NOTE: Caller must ensure that the name Op is in fact a reference, and not
* an actual name declaration (creation of a named object).
*
******************************************************************************/
static void
XfCheckIllegalReference (
ACPI_PARSE_OBJECT *Op,
ACPI_NAMESPACE_NODE *TargetNode)
{
ACPI_PARSE_OBJECT *MethodOp1;
ACPI_PARSE_OBJECT *MethodOp2;
ACPI_PARSE_OBJECT *TargetOp;
/*
* Check for an illegal reference to a named object:
*
* 1) References from one control method to another, non-parent
* method are not allowed, they will fail at runtime.
*
* 2) Forward references within a control method are not allowed.
* AML interpreters use a one-pass parse of control methods
* so these forward references will fail at runtime.
*/
TargetOp = TargetNode->Op;
MethodOp1 = XfGetParentMethod (Op);
MethodOp2 = XfGetParentMethod (TargetOp);
/* Are both objects within control method(s)? */
if (!MethodOp1 || !MethodOp2)
{
return;
}
/* Objects not in the same method? */
if (MethodOp1 != MethodOp2)
{
/*
* 1) Cross-method named reference
*
* This is OK if and only if the target reference is within in a
* method that is a parent of current method
*/
if (!XfIsObjectParental (MethodOp1, MethodOp2))
{
AslError (ASL_ERROR, ASL_MSG_ILLEGAL_METHOD_REF, Op,
Op->Asl.ExternalName);
}
}
/*
* 2) Both reference and target are in the same method. Check if this is
* an (illegal) forward reference by examining the exact source code
* location of each (the referenced object and the object declaration).
* This is a bit nasty, yet effective.
*/
else if (Op->Asl.LogicalByteOffset < TargetOp->Asl.LogicalByteOffset)
{
AslError (ASL_ERROR, ASL_MSG_ILLEGAL_FORWARD_REF, Op,
Op->Asl.ExternalName);
}
}
#endif
/*******************************************************************************
*
* FUNCTION: XfNamespaceLocateBegin
@ -316,7 +509,7 @@ XfNamespaceLocateBegin (
*/
if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION)
{
return (AE_OK);
return_ACPI_STATUS (AE_OK);
}
/* We are only interested in opcodes that have an associated name */
@ -329,7 +522,7 @@ XfNamespaceLocateBegin (
(Op->Asl.ParseOpcode != PARSEOP_NAMESEG) &&
(Op->Asl.ParseOpcode != PARSEOP_METHODCALL))
{
return (AE_OK);
return_ACPI_STATUS (AE_OK);
}
/*
@ -340,7 +533,7 @@ XfNamespaceLocateBegin (
if ((Op->Asl.Parent) &&
(Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF))
{
return (AE_OK);
return_ACPI_STATUS (AE_OK);
}
/*
@ -459,7 +652,8 @@ XfNamespaceLocateBegin (
Status = AE_OK;
}
return (Status);
return_ACPI_STATUS (Status);
}
/* Check for a reference vs. name declaration */
@ -470,6 +664,13 @@ XfNamespaceLocateBegin (
/* This node has been referenced, mark it for reference check */
Node->Flags |= ANOBJ_IS_REFERENCED;
#ifdef __UNDER_DEVELOPMENT
/* Check for an illegal reference */
XfCheckIllegalReference (Op, Node);
#endif
}
/* Attempt to optimize the NamePath */
@ -624,7 +825,6 @@ XfNamespaceLocateBegin (
(Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
{
/*
* A reference to a method within one of these opcodes is not an
* invocation of the method, it is simply a reference to the method.
@ -632,9 +832,11 @@ XfNamespaceLocateBegin (
if ((Op->Asl.Parent) &&
((Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_REFOF) ||
(Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_DEREFOF) ||
(Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_PACKAGE) ||
(Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_VAR_PACKAGE)||
(Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_OBJECTTYPE)))
{
return (AE_OK);
return_ACPI_STATUS (AE_OK);
}
/*
* There are two types of method invocation:
@ -650,7 +852,7 @@ XfNamespaceLocateBegin (
Op->Asl.ExternalName, AcpiUtGetTypeName (Node->Type));
AslError (ASL_ERROR, ASL_MSG_NOT_METHOD, Op, MsgBuffer);
return (AE_OK);
return_ACPI_STATUS (AE_OK);
}
/* Save the method node in the caller's op */
@ -658,7 +860,7 @@ XfNamespaceLocateBegin (
Op->Asl.Node = Node;
if (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF)
{
return (AE_OK);
return_ACPI_STATUS (AE_OK);
}
/*
@ -822,8 +1024,16 @@ XfNamespaceLocateBegin (
}
}
/* 5) Check for a connection object */
#if 0
else if (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONNECTION)
{
return_ACPI_STATUS (Status);
}
#endif
Op->Asl.Node = Node;
return (Status);
return_ACPI_STATUS (Status);
}
@ -858,7 +1068,7 @@ XfNamespaceLocateEnd (
OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
if (!(OpInfo->Flags & AML_NAMED))
{
return (AE_OK);
return_ACPI_STATUS (AE_OK);
}
/* Not interested in name references, we did not open a scope for them */
@ -867,7 +1077,7 @@ XfNamespaceLocateEnd (
(Op->Asl.ParseOpcode == PARSEOP_NAMESEG) ||
(Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
{
return (AE_OK);
return_ACPI_STATUS (AE_OK);
}
/* Pop the scope stack if necessary */
@ -882,5 +1092,5 @@ XfNamespaceLocateEnd (
(void) AcpiDsScopeStackPop (WalkState);
}
return (AE_OK);
return_ACPI_STATUS (AE_OK);
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#define __DTCOMPILE_C__
#define _DECLARE_DT_GLOBALS
#include <contrib/dev/acpica/compiler/aslcompiler.h>
@ -141,8 +140,6 @@ DtDoCompile (
Status = DtCompileDataTable (&FieldList);
UtEndEvent (Event);
DtFreeFieldList ();
if (ACPI_FAILURE (Status))
{
/* TBD: temporary error message. Msgs should come from function above */
@ -170,6 +167,8 @@ DtDoCompile (
CleanupAndExit:
AcpiUtDeleteCaches ();
DtDeleteCaches ();
CmCleanupAndExit ();
return (Status);
}
@ -298,7 +297,7 @@ DtCompileDataTable (
return (AE_ERROR);
}
Gbl_Signature = UtLocalCalloc (ACPI_STRLEN (Signature) + 1);
Gbl_Signature = UtStringCacheCalloc (ACPI_STRLEN (Signature) + 1);
strcpy (Gbl_Signature, Signature);
/*
@ -437,6 +436,7 @@ DtCompileTable (
UINT8 FieldType;
UINT8 *Buffer;
UINT8 *FlagBuffer = NULL;
char *String;
UINT32 CurrentFlagByteOffset = 0;
ACPI_STATUS Status;
@ -446,18 +446,29 @@ DtCompileTable (
return (AE_BAD_PARAMETER);
}
/* Ignore optional subtable if name does not match */
if ((Info->Flags & DT_OPTIONAL) &&
ACPI_STRCMP ((*Field)->Name, Info->Name))
{
*RetSubtable = NULL;
return (AE_OK);
}
Length = DtGetSubtableLength (*Field, Info);
if (Length == ASL_EOF)
{
return (AE_ERROR);
}
Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE));
Subtable = UtSubtableCacheCalloc ();
if (Length > 0)
{
Subtable->Buffer = UtLocalCalloc (Length);
String = UtStringCacheCalloc (Length);
Subtable->Buffer = ACPI_CAST_PTR (UINT8, String);
}
Subtable->Length = Length;
Subtable->TotalLength = Length;
Buffer = Subtable->Buffer;
@ -558,8 +569,6 @@ DtCompileTable (
DtSetSubtableLength (InlineSubtable);
ACPI_MEMCPY (Buffer, InlineSubtable->Buffer, FieldLength);
ACPI_FREE (InlineSubtable->Buffer);
ACPI_FREE (InlineSubtable);
LocalField = *Field;
break;

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -50,6 +50,10 @@
#include <contrib/dev/acpica/include/acdisasm.h>
#define ASL_FIELD_CACHE_SIZE 512
#define ASL_SUBTABLE_CACHE_SIZE 128
#undef DT_EXTERN
#ifdef _DECLARE_DT_GLOBALS
@ -143,6 +147,18 @@ DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*Gbl_LabelList, NULL);
DT_EXTERN UINT32 DT_INIT_GLOBAL (Gbl_CurrentTableOffset, 0);
/* Local caches */
DT_EXTERN UINT32 DT_INIT_GLOBAL (Gbl_SubtableCount, 0);
DT_EXTERN ASL_CACHE_INFO DT_INIT_GLOBAL (*Gbl_SubtableCacheList, NULL);
DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*Gbl_SubtableCacheNext, NULL);
DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*Gbl_SubtableCacheLast, NULL);
DT_EXTERN UINT32 DT_INIT_GLOBAL (Gbl_FieldCount, 0);
DT_EXTERN ASL_CACHE_INFO DT_INIT_GLOBAL (*Gbl_FieldCacheList, NULL);
DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*Gbl_FieldCacheNext, NULL);
DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*Gbl_FieldCacheLast, NULL);
/* dtcompiler - main module */
@ -321,20 +337,20 @@ DtWalkTableTree (
void
DtError (
UINT8 Level,
UINT8 MessageId,
UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage);
void
DtNameError (
UINT8 Level,
UINT8 MessageId,
UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage);
void
DtFatal (
UINT8 MessageId,
UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage);
@ -343,10 +359,6 @@ DtStrtoul64 (
char *String,
UINT64 *ReturnInteger);
UINT32
DtGetFileSize (
FILE *Handle);
char*
DtGetFieldValue (
DT_FIELD *Field);
@ -372,8 +384,16 @@ void
DtSetTableLength(
void);
DT_SUBTABLE *
UtSubtableCacheCalloc (
void);
DT_FIELD *
UtFieldCacheCalloc (
void);
void
DtFreeFieldList (
DtDeleteCaches (
void);
@ -399,6 +419,10 @@ ACPI_STATUS
DtCompileCsrt (
void **PFieldList);
ACPI_STATUS
DtCompileDbg2 (
void **PFieldList);
ACPI_STATUS
DtCompileDmar (
void **PFieldList);
@ -419,6 +443,10 @@ ACPI_STATUS
DtCompileFpdt (
void **PFieldList);
ACPI_STATUS
DtCompileGtdt (
void **PFieldList);
ACPI_STATUS
DtCompileHest (
void **PFieldList);
@ -427,6 +455,10 @@ ACPI_STATUS
DtCompileIvrs (
void **PFieldList);
ACPI_STATUS
DtCompileLpit (
void **PFieldList);
ACPI_STATUS
DtCompileMadt (
void **PFieldList);
@ -451,6 +483,10 @@ ACPI_STATUS
DtCompilePmtt (
void **PFieldList);
ACPI_STATUS
DtCompilePcct (
void **PFieldList);
ACPI_STATUS
DtCompileRsdt (
void **PFieldList);
@ -503,6 +539,7 @@ extern const unsigned char TemplateBert[];
extern const unsigned char TemplateBgrt[];
extern const unsigned char TemplateCpep[];
extern const unsigned char TemplateCsrt[];
extern const unsigned char TemplateDbg2[];
extern const unsigned char TemplateDbgp[];
extern const unsigned char TemplateDmar[];
extern const unsigned char TemplateEcdt[];
@ -514,12 +551,14 @@ extern const unsigned char TemplateGtdt[];
extern const unsigned char TemplateHest[];
extern const unsigned char TemplateHpet[];
extern const unsigned char TemplateIvrs[];
extern const unsigned char TemplateLpit[];
extern const unsigned char TemplateMadt[];
extern const unsigned char TemplateMcfg[];
extern const unsigned char TemplateMchi[];
extern const unsigned char TemplateMpst[];
extern const unsigned char TemplateMsct[];
extern const unsigned char TemplateMtmr[];
extern const unsigned char TemplatePcct[];
extern const unsigned char TemplatePmtt[];
extern const unsigned char TemplateRsdt[];
extern const unsigned char TemplateS3pt[];

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#define __DTEXPRESS_C__
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/compiler/dtcompiler.h>
#include "dtparser.y.h"

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#define __DTFIELD_C__
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/compiler/dtcompiler.h>
@ -259,7 +257,7 @@ DtCompileUuid (
}
else
{
Status = AuConvertStringToUuid (InString, (char *) Buffer);
AcpiUtConvertStringToUuid (InString, Buffer);
}
return (Status);
@ -311,21 +309,37 @@ DtCompileInteger (
return;
}
/* Ensure that reserved fields are set to zero */
/* TBD: should we set to zero, or just make this an ERROR? */
/* TBD: Probably better to use a flag */
/*
* Ensure that reserved fields are set properly. Note: uses
* the DT_NON_ZERO flag to indicate that the reserved value
* must be exactly one. Otherwise, the value must be zero.
* This is sufficient for now.
*/
if (!ACPI_STRCMP (Field->Name, "Reserved") &&
(Value != 0))
/* TBD: Should use a flag rather than compare "Reserved" */
if (!ACPI_STRCMP (Field->Name, "Reserved"))
{
DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,
"Setting to zero");
Value = 0;
if (Flags & DT_NON_ZERO)
{
if (Value != 1)
{
DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,
"Must be one, setting to one");
Value = 1;
}
}
else if (Value != 0)
{
DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,
"Must be zero, setting to zero");
Value = 0;
}
}
/* Check if the value must be non-zero */
if ((Value == 0) && (Flags & DT_NON_ZERO))
else if ((Flags & DT_NON_ZERO) && (Value == 0))
{
DtError (ASL_ERROR, ASL_MSG_ZERO_VALUE, Field, NULL);
}
@ -340,7 +354,8 @@ DtCompileInteger (
if (Value > MaxValue)
{
sprintf (MsgBuffer, "%8.8X%8.8X", ACPI_FORMAT_UINT64 (Value));
sprintf (MsgBuffer, "%8.8X%8.8X - max %u bytes",
ACPI_FORMAT_UINT64 (Value), ByteLength);
DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, MsgBuffer);
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,10 +41,9 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#define __DTIO_C__
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/compiler/dtcompiler.h>
#include <contrib/dev/acpica/include/acapps.h>
#define _COMPONENT DT_COMPILER
ACPI_MODULE_NAME ("dtio")
@ -132,7 +131,7 @@ DtTrim (
if (!ACPI_STRCMP (String, " "))
{
ReturnString = UtLocalCalloc (1);
ReturnString = UtStringCacheCalloc (1);
return (ReturnString);
}
@ -180,7 +179,7 @@ DtTrim (
/* Create the trimmed return string */
Length = ACPI_PTR_DIFF (End, Start) + 1;
ReturnString = UtLocalCalloc (Length + 1);
ReturnString = UtStringCacheCalloc (Length + 1);
if (ACPI_STRLEN (Start))
{
ACPI_STRNCPY (ReturnString, Start, Length);
@ -369,7 +368,7 @@ DtParseLine (
if ((Value && *Value) || IsNullString)
{
Field = UtLocalCalloc (sizeof (DT_FIELD));
Field = UtFieldCacheCalloc ();
Field->Name = Name;
Field->Value = Value;
Field->Line = Line;
@ -379,11 +378,7 @@ DtParseLine (
DtLinkField (Field);
}
else /* Ignore this field, it has no valid data */
{
ACPI_FREE (Name);
ACPI_FREE (Value);
}
/* Else -- Ignore this field, it has no valid data */
return (AE_OK);
}
@ -737,7 +732,11 @@ DtScanFile (
/* Get the file size */
Gbl_InputByteCount = DtGetFileSize (Handle);
Gbl_InputByteCount = CmGetFileSize (Handle);
if (Gbl_InputByteCount == ACPI_UINT32_MAX)
{
AslAbort ();
}
Gbl_CurrentLineNumber = 0;
Gbl_CurrentLineOffset = 0;
@ -816,7 +815,12 @@ DtOutputBinary (
/* Walk the entire parse tree, emitting the binary data */
DtWalkTableTree (RootTable, DtWriteBinary, NULL, NULL);
Gbl_TableLength = DtGetFileSize (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
Gbl_TableLength = CmGetFileSize (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
if (Gbl_TableLength == ACPI_UINT32_MAX)
{
AslAbort ();
}
}
@ -1025,6 +1029,8 @@ DtDumpSubtableList (
DbgPrint (ASL_DEBUG_OUTPUT,
"\nSubtable Tree: (Depth, Subtable, Length, TotalLength)\n\n");
DtWalkTableTree (Gbl_RootTable, DtDumpSubtableTree, NULL, NULL);
DbgPrint (ASL_DEBUG_OUTPUT, "\n");
}

View File

@ -6,7 +6,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -6,7 +6,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#define __DTSUBTABLE_C__
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/compiler/dtcompiler.h>
@ -73,13 +71,15 @@ DtCreateSubtable (
DT_SUBTABLE **RetSubtable)
{
DT_SUBTABLE *Subtable;
char *String;
Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE));
Subtable = UtSubtableCacheCalloc ();
/* Create a new buffer for the subtable data */
Subtable->Buffer = UtLocalCalloc (Length);
String = UtStringCacheCalloc (Length);
Subtable->Buffer = ACPI_CAST_PTR (UINT8, String);
ACPI_MEMCPY (Subtable->Buffer, Buffer, Length);
Subtable->Length = Length;

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#define __DTTABLE_C__
/* Compile all complex data tables */
#include <contrib/dev/acpica/compiler/aslcompiler.h>
@ -454,7 +452,7 @@ DtCompileCsrt (
UINT32 GroupLength;
/* Sub-tables (Resource Groups) */
/* Subtables (Resource Groups) */
while (*PFieldList)
{
@ -518,6 +516,156 @@ DtCompileCsrt (
}
/******************************************************************************
*
* FUNCTION: DtCompileDbg2
*
* PARAMETERS: List - Current field list pointer
*
* RETURN: Status
*
* DESCRIPTION: Compile DBG2.
*
*****************************************************************************/
ACPI_STATUS
DtCompileDbg2 (
void **List)
{
ACPI_STATUS Status;
DT_SUBTABLE *Subtable;
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
UINT32 SubtableCount;
ACPI_DBG2_HEADER *Dbg2Header;
ACPI_DBG2_DEVICE *DeviceInfo;
UINT16 CurrentOffset;
UINT32 i;
/* Main table */
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2, &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
/* Main table fields */
Dbg2Header = ACPI_CAST_PTR (ACPI_DBG2_HEADER, Subtable->Buffer);
Dbg2Header->InfoOffset = sizeof (ACPI_TABLE_HEADER) + ACPI_PTR_DIFF (
ACPI_ADD_PTR (UINT8, Dbg2Header, sizeof (ACPI_DBG2_HEADER)), Dbg2Header);
SubtableCount = Dbg2Header->InfoCount;
DtPushSubtable (Subtable);
/* Process all Device Information subtables (Count = InfoCount) */
while (*PFieldList && SubtableCount)
{
/* Subtable: Debug Device Information */
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Device,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
DeviceInfo = ACPI_CAST_PTR (ACPI_DBG2_DEVICE, Subtable->Buffer);
CurrentOffset = (UINT16) sizeof (ACPI_DBG2_DEVICE);
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
ParentTable = DtPeekSubtable ();
/* BaseAddressRegister GAS array (Required, size is RegisterCount) */
DeviceInfo->BaseAddressOffset = CurrentOffset;
for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Addr,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
CurrentOffset += (UINT16) sizeof (ACPI_GENERIC_ADDRESS);
DtInsertSubtable (ParentTable, Subtable);
}
/* AddressSize array (Required, size = RegisterCount) */
DeviceInfo->AddressSizeOffset = CurrentOffset;
for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Size,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
CurrentOffset += (UINT16) sizeof (UINT32);
DtInsertSubtable (ParentTable, Subtable);
}
/* NamespaceString device identifier (Required, size = NamePathLength) */
DeviceInfo->NamepathOffset = CurrentOffset;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Name,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
/* Update the device info header */
DeviceInfo->NamepathLength = (UINT16) Subtable->Length;
CurrentOffset += (UINT16) DeviceInfo->NamepathLength;
DtInsertSubtable (ParentTable, Subtable);
/* OemData - Variable-length data (Optional, size = OemDataLength) */
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2OemData,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
/* Update the device info header (zeros if no OEM data present) */
DeviceInfo->OemDataOffset = 0;
DeviceInfo->OemDataLength = 0;
/* Optional subtable (OemData) */
if (Subtable && Subtable->Length)
{
DeviceInfo->OemDataOffset = CurrentOffset;
DeviceInfo->OemDataLength = (UINT16) Subtable->Length;
DtInsertSubtable (ParentTable, Subtable);
}
SubtableCount--;
DtPopSubtable (); /* Get next Device Information subtable */
}
DtPopSubtable ();
return (AE_OK);
}
/******************************************************************************
*
* FUNCTION: DtCompileDmar
@ -586,16 +734,21 @@ DtCompileDmar (
InfoTable = AcpiDmTableInfoDmar1;
break;
case ACPI_DMAR_TYPE_ATSR:
case ACPI_DMAR_TYPE_ROOT_ATS:
InfoTable = AcpiDmTableInfoDmar2;
break;
case ACPI_DMAR_HARDWARE_AFFINITY:
case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
InfoTable = AcpiDmTableInfoDmar3;
break;
case ACPI_DMAR_TYPE_NAMESPACE:
InfoTable = AcpiDmTableInfoDmar4;
break;
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "DMAR");
@ -612,10 +765,20 @@ DtCompileDmar (
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
/*
* Optional Device Scope subtables
*/
if ((DmarHeader->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
(DmarHeader->Type == ACPI_DMAR_TYPE_NAMESPACE))
{
/* These types do not support device scopes */
DtPopSubtable ();
continue;
}
DtPushSubtable (Subtable);
/* Optional Device Scope subtables */
DeviceScopeLength = DmarHeader->Length - Subtable->Length -
ParentTable->Length;
while (DeviceScopeLength)
@ -788,6 +951,125 @@ DtCompileFadt (
return (AE_OK);
}
/******************************************************************************
*
* FUNCTION: DtCompileGtdt
*
* PARAMETERS: List - Current field list pointer
*
* RETURN: Status
*
* DESCRIPTION: Compile GTDT.
*
*****************************************************************************/
ACPI_STATUS
DtCompileGtdt (
void **List)
{
ACPI_STATUS Status;
DT_SUBTABLE *Subtable;
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
DT_FIELD *SubtableStart;
ACPI_SUBTABLE_HEADER *GtdtHeader;
ACPI_DMTABLE_INFO *InfoTable;
UINT32 GtCount;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
while (*PFieldList)
{
SubtableStart = *PFieldList;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdtHdr,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
GtdtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
switch (GtdtHeader->Type)
{
case ACPI_GTDT_TYPE_TIMER_BLOCK:
InfoTable = AcpiDmTableInfoGtdt0;
break;
case ACPI_GTDT_TYPE_WATCHDOG:
InfoTable = AcpiDmTableInfoGtdt1;
break;
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "GTDT");
return (AE_ERROR);
}
Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
/*
* Additional GT block subtable data
*/
switch (GtdtHeader->Type)
{
case ACPI_GTDT_TYPE_TIMER_BLOCK:
DtPushSubtable (Subtable);
ParentTable = DtPeekSubtable ();
GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount;
while (GtCount)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt0a,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
DtInsertSubtable (ParentTable, Subtable);
GtCount--;
}
DtPopSubtable ();
break;
default:
break;
}
DtPopSubtable ();
}
return (AE_OK);
}
/******************************************************************************
*
@ -1152,6 +1434,87 @@ DtCompileIvrs (
}
/******************************************************************************
*
* FUNCTION: DtCompileLpit
*
* PARAMETERS: List - Current field list pointer
*
* RETURN: Status
*
* DESCRIPTION: Compile LPIT.
*
*****************************************************************************/
ACPI_STATUS
DtCompileLpit (
void **List)
{
ACPI_STATUS Status;
DT_SUBTABLE *Subtable;
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
DT_FIELD *SubtableStart;
ACPI_DMTABLE_INFO *InfoTable;
ACPI_LPIT_HEADER *LpitHeader;
/* Note: Main table consists only of the standard ACPI table header */
while (*PFieldList)
{
SubtableStart = *PFieldList;
/* LPIT Subtable header */
Status = DtCompileTable (PFieldList, AcpiDmTableInfoLpitHdr,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
LpitHeader = ACPI_CAST_PTR (ACPI_LPIT_HEADER, Subtable->Buffer);
switch (LpitHeader->Type)
{
case ACPI_LPIT_TYPE_NATIVE_CSTATE:
InfoTable = AcpiDmTableInfoLpit0;
break;
case ACPI_LPIT_TYPE_SIMPLE_IO:
InfoTable = AcpiDmTableInfoLpit1;
break;
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "LPIT");
return (AE_ERROR);
}
/* LPIT Subtable */
Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPopSubtable ();
}
return (AE_OK);
}
/******************************************************************************
*
* FUNCTION: DtCompileMadt
@ -1270,6 +1633,16 @@ DtCompileMadt (
InfoTable = AcpiDmTableInfoMadt12;
break;
case ACPI_MADT_TYPE_GENERIC_MSI_FRAME:
InfoTable = AcpiDmTableInfoMadt13;
break;
case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR:
InfoTable = AcpiDmTableInfoMadt14;
break;
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "MADT");
@ -1503,6 +1876,90 @@ DtCompileMtmr (
}
/******************************************************************************
*
* FUNCTION: DtCompilePcct
*
* PARAMETERS: List - Current field list pointer
*
* RETURN: Status
*
* DESCRIPTION: Compile PCCT.
*
*****************************************************************************/
ACPI_STATUS
DtCompilePcct (
void **List)
{
ACPI_STATUS Status;
DT_SUBTABLE *Subtable;
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
DT_FIELD *SubtableStart;
ACPI_SUBTABLE_HEADER *PcctHeader;
ACPI_DMTABLE_INFO *InfoTable;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcct,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
while (*PFieldList)
{
SubtableStart = *PFieldList;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcctHdr,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
PcctHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
switch (PcctHeader->Type)
{
case ACPI_PCCT_TYPE_GENERIC_SUBSPACE:
InfoTable = AcpiDmTableInfoPcct0;
break;
case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE:
InfoTable = AcpiDmTableInfoPcct1;
break;
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PCCT");
return (AE_ERROR);
}
Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPopSubtable ();
}
return (AE_OK);
}
/******************************************************************************
*
* FUNCTION: DtCompilePmtt
@ -1961,6 +2418,11 @@ DtCompileSrat (
InfoTable = AcpiDmTableInfoSrat2;
break;
case ACPI_SRAT_TYPE_GICC_AFFINITY:
InfoTable = AcpiDmTableInfoSrat3;
break;
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SRAT");

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -187,6 +187,12 @@ GetTemplate:
}
Status = DtCreateOneTemplate (Signature, TableData);
/* Shutdown ACPICA subsystem */
(void) AcpiTerminate ();
CmDeleteCaches ();
return (Status);
}
@ -397,6 +403,5 @@ DtCreateOneTemplate (
Cleanup:
fclose (File);
AcpiOsRedirectOutput (stdout);
ACPI_FREE (DisasmFilename);
return (Status);
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -174,6 +174,33 @@ const unsigned char TemplateCsrt[] =
0x43,0x48,0x41,0x37 /* 00000148 "CHA7" */
};
const unsigned char TemplateDbg2[] =
{
0x44,0x42,0x47,0x32,0xB2,0x00,0x00,0x00, /* 00000000 "DBG2...." */
0x01,0xBA,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
0x15,0x11,0x13,0x20,0x2C,0x00,0x00,0x00, /* 00000020 "... ,..." */
0x02,0x00,0x00,0x00,0xEE,0x3F,0x00,0x02, /* 00000028 ".....?.." */
0x09,0x00,0x36,0x00,0x00,0x00,0x00,0x00, /* 00000030 "..6....." */
0x00,0x80,0x00,0x00,0x00,0x00,0x16,0x00, /* 00000038 "........" */
0x2E,0x00,0x01,0x32,0x00,0x03,0x88,0x77, /* 00000040 "...2...w" */
0x66,0x55,0x44,0x33,0x22,0x11,0x01,0x64, /* 00000048 "fUD3"..d" */
0x00,0x04,0x11,0x00,0xFF,0xEE,0xDD,0xCC, /* 00000050 "........" */
0xBB,0xAA,0x10,0x32,0x54,0x76,0x98,0xBA, /* 00000058 "...2Tv.." */
0xDC,0xFE,0x4D,0x79,0x44,0x65,0x76,0x69, /* 00000060 "..MyDevi" */
0x63,0x65,0x00,0xEE,0x47,0x00,0x01,0x11, /* 00000068 "ce..G..." */
0x00,0x26,0x00,0x10,0x00,0x37,0x00,0x00, /* 00000070 ".&...7.." */
0x80,0x00,0x00,0x00,0x00,0x16,0x00,0x22, /* 00000078 "......."" */
0x00,0x01,0x64,0x00,0x04,0x11,0x00,0xFF, /* 00000080 "..d....." */
0xEE,0xDD,0xCC,0xBB,0xAA,0x98,0xBA,0xDC, /* 00000088 "........" */
0xFE,0x5C,0x5C,0x5F,0x53,0x42,0x5F,0x2E, /* 00000090 ".\\_SB_." */
0x50,0x43,0x49,0x30,0x2E,0x44,0x42,0x47, /* 00000098 "PCI0.DBG" */
0x50,0x00,0x41,0x42,0x43,0x44,0x45,0x46, /* 000000A0 "P.ABCDEF" */
0x47,0x48,0x49,0x50,0x51,0x52,0x53,0x54, /* 000000A8 "GHIPQRST" */
0x55,0x56 /* 000000B0 "UV" */
};
const unsigned char TemplateDbgp[] =
{
0x44,0x42,0x47,0x50,0x34,0x00,0x00,0x00, /* 00000000 "DBGP4..." */
@ -353,10 +380,10 @@ const unsigned char TemplateFacs[] =
const unsigned char TemplateFadt[] =
{
0x46,0x41,0x43,0x50,0x0C,0x01,0x00,0x00, /* 00000000 "FACP...." */
0x05,0x18,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
0x05,0x64,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".dINTEL " */
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
0x23,0x11,0x11,0x20,0x01,0x00,0x00,0x00, /* 00000020 "#.. ...." */
0x15,0x11,0x13,0x20,0x01,0x00,0x00,0x00, /* 00000020 "... ...." */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
@ -368,7 +395,7 @@ const unsigned char TemplateFadt[] =
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01, /* 00000070 "........" */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000080 "........" */
0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00, /* 00000080 "........" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000088 "........" */
0x00,0x00,0x00,0x00,0x01,0x20,0x00,0x02, /* 00000090 "..... .." */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
@ -379,7 +406,7 @@ const unsigned char TemplateFadt[] =
0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x00, /* 000000C0 "........" */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */
0x01,0x20,0x00,0x03,0x01,0x00,0x00,0x00, /* 000000D0 ". ......" */
0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x01, /* 000000D8 "........" */
0x00,0x00,0x00,0x00,0x01,0x40,0x00,0x01, /* 000000D8 ".....@.." */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */
0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01, /* 000000F0 "........" */
@ -407,16 +434,34 @@ const unsigned char TemplateFpdt[] =
const unsigned char TemplateGtdt[] =
{
0x47,0x54,0x44,0x54,0x50,0x00,0x00,0x00, /* 00000000 "GTDTP..." */
0x01,0xF1,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
0x23,0x06,0x11,0x20,0x00,0x00,0x00,0x00, /* 00000020 "#.. ...." */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000028 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000048 "........" */
0x47,0x54,0x44,0x54,0xe0,0x00,0x00,0x00, /* 00000000 "GTDT...." */
0x02,0xb0,0x4c,0x49,0x4e,0x41,0x52,0x4f, /* 00000008 "..LINARO" */
0x52,0x54,0x53,0x4d,0x56,0x45,0x56,0x38, /* 00000010 "RTSMVEV8" */
0x01,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c, /* 00000018 "....INTL" */
0x24,0x04,0x14,0x20,0x00,0x00,0x00,0x00, /* 00000020 "$.. ...." */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
0x1d,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */
0x1e,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000038 "........" */
0x1b,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000040 "........" */
0x1a,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000048 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
0x02,0x00,0x00,0x00,0x60,0x00,0x00,0x00, /* 00000058 "....`..." */
0x00,0x64,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 ".d......" */
0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00, /* 00000068 "........" */
0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000088 "........" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000090 "........" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000098 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000a0 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000a8 "........" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000b0 "........" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000b8 "........" */
0x00,0x00,0x00,0x00,0x01,0x1c,0x00,0x00, /* 000000c0 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000c8 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d0 "........" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000d8 "........" */
};
const unsigned char TemplateHest[] =
@ -521,41 +566,75 @@ const unsigned char TemplateIvrs[] =
0x00,0x00,0x00,0x00 /* 000000B8 "...." */
};
/* MADT with ACPI 5.0 subtables */
const unsigned char TemplateLpit[] =
{
0x4C,0x50,0x49,0x54,0xB4,0x00,0x00,0x00, /* 00000000 "LPIT...." */
0x01,0x20,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ". INTEL " */
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
0x25,0x03,0x14,0x20,0x00,0x00,0x00,0x00, /* 00000020 "%.. ...." */
0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "8......." */
0x00,0x00,0x00,0x00,0x7F,0x01,0x02,0x00, /* 00000030 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
0x00,0x20,0x00,0x03,0x00,0x00,0x00,0x00, /* 00000048 ". ......" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000058 "........" */
0x58,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000060 "X......." */
0x00,0x00,0x00,0x00,0x01,0x10,0x00,0x02, /* 00000068 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
0x00,0x00,0x00,0x00,0x01,0x10,0x00,0x02, /* 00000088 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
0x00,0x08,0x00,0x01,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */
0x00,0x00,0x00,0x00 /* 000000B0 "...." */
};
/* MADT with ACPI 5.1 subtables */
const unsigned char TemplateMadt[] =
{
0x41,0x50,0x49,0x43,0xF6,0x00,0x00,0x00, /* 00000000 "APIC...." */
0x01,0xB0,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
0x23,0x06,0x11,0x20,0x00,0x00,0x00,0x00, /* 00000020 "#.. ...." */
0x41,0x50,0x49,0x43,0x2a,0x01,0x00,0x00, /* 00000000 "APIC*..." */
0x04,0x34,0x49,0x4e,0x54,0x45,0x4c,0x20, /* 00000008 ".4INTEL " */
0x54,0x45,0x4d,0x50,0x4c,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x01,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c, /* 00000018 "....INTL" */
0x24,0x04,0x14,0x20,0x00,0x00,0x00,0x00, /* 00000020 "$.. ...." */
0x01,0x00,0x00,0x00,0x00,0x08,0x00,0x00, /* 00000028 "........" */
0x01,0x00,0x00,0x00,0x01,0x0C,0x01,0x00, /* 00000030 "........" */
0x01,0x00,0x00,0x00,0x01,0x0c,0x01,0x00, /* 00000030 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
0x02,0x0A,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
0x00,0x00,0x03,0x08,0x0D,0x00,0x01,0x00, /* 00000048 "........" */
0x02,0x0a,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
0x00,0x00,0x03,0x08,0x0d,0x00,0x01,0x00, /* 00000048 "........" */
0x00,0x00,0x04,0x06,0x00,0x05,0x00,0x01, /* 00000050 "........" */
0x05,0x0C,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
0x05,0x0c,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
0x00,0x00,0x00,0x00,0x06,0x10,0x00,0x00, /* 00000060 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
0x00,0x00,0x00,0x00,0x07,0x16,0x00,0x00, /* 00000070 "........" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000078 "........" */
0x00,0x00,0x00,0x00,0x5C,0x43,0x50,0x55, /* 00000080 "....\CPU" */
0x00,0x00,0x00,0x00,0x5c,0x43,0x50,0x55, /* 00000080 "....\CPU" */
0x30,0x00,0x08,0x10,0x05,0x00,0x00,0x00, /* 00000088 "0......." */
0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00, /* 00000090 "........" */
0x00,0x00,0x09,0x10,0x00,0x00,0x00,0x00, /* 00000098 "........" */
0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
0x00,0x00,0x0A,0x0C,0x05,0x00,0x00,0x00, /* 000000A8 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0x28, /* 000000B0 ".......(" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */
0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D0 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x18, /* 000000D8 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */
0x00,0x00,0x00,0x00,0x00,0x00 /* 000000F0 "......" */
0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000a0 "........" */
0x00,0x00,0x0a,0x0c,0x05,0x00,0x00,0x00, /* 000000a8 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x4c, /* 000000b0 ".......L" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000b8 "........" */
0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 000000c0 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000c8 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d0 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000d8 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000e0 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000e8 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000f0 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000f8 "........" */
0x00,0x00,0x0e,0x10,0x00,0x00,0x00,0x00, /* 00000100 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */
0x00,0x00,0x0c,0x18,0x00,0x00,0x00,0x00, /* 00000110 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */
0x00,0x00 /* 00000128 ".. " */
};
const unsigned char TemplateMcfg[] =
@ -646,6 +725,32 @@ const unsigned char TemplateMtmr[] =
0x00,0x00,0x00,0x00 /* 00000048 "...." */
};
const unsigned char TemplatePcct[] =
{
0x50,0x43,0x43,0x54,0xAC,0x00,0x00,0x00, /* 00000000 "PCCT...." */
0x01,0xCF,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
0x27,0x06,0x14,0x20,0x01,0x00,0x00,0x00, /* 00000020 "'.. ...." */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 ".>......" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
0x01,0x32,0x00,0x03,0x00,0x00,0x00,0x00, /* 00000048 ".2......" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF, /* 00000058 "........" */
0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x00,0x00, /* 00000060 "........" */
0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x3E, /* 00000068 ".......>" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000070 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00, /* 00000078 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x32, /* 00000080 ".......2" */
0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */
0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, /* 00000098 "........" */
0xFF,0xFF,0x01,0x00,0x00,0x00,0x01,0x00, /* 000000A0 "........" */
0x00,0x00,0x01,0x00 /* 000000A8 "...." */
};
const unsigned char TemplatePmtt[] =
{
0x50,0x4D,0x54,0x54,0xB4,0x00,0x00,0x00, /* 00000000 "PMTT...." */
@ -844,10 +949,10 @@ const unsigned char TemplateSpcr[] =
const unsigned char TemplateSpmi[] =
{
0x53,0x50,0x4D,0x49,0x41,0x00,0x00,0x00, /* 00000000 "SPMIA..." */
0x04,0xED,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
0x04,0x00,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00, /* 00000020 "(.. ...." */
0x14,0x01,0x14,0x20,0x00,0x01,0x00,0x00, /* 00000020 "... ...." */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
0x00,0x08,0x00,0x01,0x00,0x00,0x00,0x00, /* 00000030 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
@ -856,11 +961,11 @@ const unsigned char TemplateSpmi[] =
const unsigned char TemplateSrat[] =
{
0x53,0x52,0x41,0x54,0x80,0x00,0x00,0x00, /* 00000000 "SRAT...." */
0x03,0x5A,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".ZINTEL " */
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x53,0x52,0x41,0x54,0x92,0x00,0x00,0x00, /* 00000000 "SRAT...." */
0x03,0x50,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".PINTEL " */
0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
0x28,0x05,0x10,0x20,0x01,0x00,0x00,0x00, /* 00000020 "(.. ...." */
0x24,0x07,0x14,0x20,0x01,0x00,0x00,0x00, /* 00000020 "$.. ...." */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
0x00,0x10,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
@ -871,7 +976,10 @@ const unsigned char TemplateSrat[] =
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
0x02,0x18,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000070 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000078 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
0x03,0x12,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */
0x00,0x00 /* 00000090 ".." */
};
const unsigned char TemplateTcpa[] =

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#define __DTUTILS_C__
#include <contrib/dev/acpica/compiler/aslcompiler.h>
#include <contrib/dev/acpica/compiler/dtcompiler.h>
#include <contrib/dev/acpica/include/actables.h>
@ -77,7 +75,7 @@ DtSum (
void
DtError (
UINT8 Level,
UINT8 MessageId,
UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage)
{
@ -124,7 +122,7 @@ DtError (
void
DtNameError (
UINT8 Level,
UINT8 MessageId,
UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage)
{
@ -177,7 +175,7 @@ DtNameError (
void
DtFatal (
UINT8 MessageId,
UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage)
{
@ -284,36 +282,6 @@ DtStrtoul64 (
}
/******************************************************************************
*
* FUNCTION: DtGetFileSize
*
* PARAMETERS: Handle - Open file handler
*
* RETURN: Current file size
*
* DESCRIPTION: Get the current size of a file. Seek to the EOF and get the
* offset. Seek back to the original location.
*
*****************************************************************************/
UINT32
DtGetFileSize (
FILE *Handle)
{
int CurrentOffset;
int LastOffset;
CurrentOffset = ftell (Handle);
fseek (Handle, 0, SEEK_END);
LastOffset = ftell (Handle);
fseek (Handle, CurrentOffset, SEEK_SET);
return ((UINT32) LastOffset);
}
/******************************************************************************
*
* FUNCTION: DtGetFieldValue
@ -531,7 +499,9 @@ DtGetFieldLength (
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:
@ -541,6 +511,7 @@ DtGetFieldLength (
case ACPI_DMT_EINJINST:
case ACPI_DMT_ERSTACT:
case ACPI_DMT_ERSTINST:
case ACPI_DMT_DMAR_SCOPE:
ByteLength = 1;
break;
@ -562,6 +533,7 @@ DtGetFieldLength (
case ACPI_DMT_NAME4:
case ACPI_DMT_SLIC:
case ACPI_DMT_SIG:
case ACPI_DMT_LPIT:
ByteLength = 4;
break;
@ -871,39 +843,151 @@ DtWalkTableTree (
}
/******************************************************************************
/*******************************************************************************
*
* FUNCTION: DtFreeFieldList
* FUNCTION: UtSubtableCacheCalloc
*
* PARAMETERS: None
*
* RETURN: Pointer to the buffer. Aborts on allocation failure
*
* DESCRIPTION: Allocate a subtable object buffer. Bypass the local
* dynamic memory manager for performance reasons (This has a
* major impact on the speed of the compiler.)
*
******************************************************************************/
DT_SUBTABLE *
UtSubtableCacheCalloc (
void)
{
ASL_CACHE_INFO *Cache;
if (Gbl_SubtableCacheNext >= Gbl_SubtableCacheLast)
{
/* Allocate a new buffer */
Cache = UtLocalCalloc (sizeof (Cache->Next) +
(sizeof (DT_SUBTABLE) * ASL_SUBTABLE_CACHE_SIZE));
/* Link new cache buffer to head of list */
Cache->Next = Gbl_SubtableCacheList;
Gbl_SubtableCacheList = Cache;
/* Setup cache management pointers */
Gbl_SubtableCacheNext = ACPI_CAST_PTR (DT_SUBTABLE, Cache->Buffer);
Gbl_SubtableCacheLast = Gbl_SubtableCacheNext + ASL_SUBTABLE_CACHE_SIZE;
}
Gbl_SubtableCount++;
return (Gbl_SubtableCacheNext++);
}
/*******************************************************************************
*
* FUNCTION: UtFieldCacheCalloc
*
* PARAMETERS: None
*
* RETURN: Pointer to the buffer. Aborts on allocation failure
*
* DESCRIPTION: Allocate a field object buffer. Bypass the local
* dynamic memory manager for performance reasons (This has a
* major impact on the speed of the compiler.)
*
******************************************************************************/
DT_FIELD *
UtFieldCacheCalloc (
void)
{
ASL_CACHE_INFO *Cache;
if (Gbl_FieldCacheNext >= Gbl_FieldCacheLast)
{
/* Allocate a new buffer */
Cache = UtLocalCalloc (sizeof (Cache->Next) +
(sizeof (DT_FIELD) * ASL_FIELD_CACHE_SIZE));
/* Link new cache buffer to head of list */
Cache->Next = Gbl_FieldCacheList;
Gbl_FieldCacheList = Cache;
/* Setup cache management pointers */
Gbl_FieldCacheNext = ACPI_CAST_PTR (DT_FIELD, Cache->Buffer);
Gbl_FieldCacheLast = Gbl_FieldCacheNext + ASL_FIELD_CACHE_SIZE;
}
Gbl_FieldCount++;
return (Gbl_FieldCacheNext++);
}
/*******************************************************************************
*
* FUNCTION: DtDeleteCaches
*
* PARAMETERS: None
*
* RETURN: None
*
* DESCRIPTION: Free the field list
* DESCRIPTION: Delete all local cache buffer blocks
*
*****************************************************************************/
******************************************************************************/
void
DtFreeFieldList (
DtDeleteCaches (
void)
{
DT_FIELD *Field = Gbl_FieldList;
DT_FIELD *NextField;
UINT32 BufferCount;
ASL_CACHE_INFO *Next;
/* Walk and free entire field list */
/* Field cache */
while (Field)
BufferCount = 0;
while (Gbl_FieldCacheList)
{
NextField = Field->Next; /* Save link */
if (!(Field->Flags & DT_FIELD_NOT_ALLOCATED))
{
ACPI_FREE (Field->Name);
ACPI_FREE (Field->Value);
}
ACPI_FREE (Field);
Field = NextField;
Next = Gbl_FieldCacheList->Next;
ACPI_FREE (Gbl_FieldCacheList);
Gbl_FieldCacheList = Next;
BufferCount++;
}
DbgPrint (ASL_DEBUG_OUTPUT,
"%u Fields, Buffer size: %u fields (%u bytes), %u Buffers\n",
Gbl_FieldCount, ASL_FIELD_CACHE_SIZE,
(sizeof (DT_FIELD) * ASL_FIELD_CACHE_SIZE), BufferCount);
Gbl_FieldCount = 0;
Gbl_FieldCacheNext = NULL;
Gbl_FieldCacheLast = NULL;
/* Subtable cache */
BufferCount = 0;
while (Gbl_SubtableCacheList)
{
Next = Gbl_SubtableCacheList->Next;
ACPI_FREE (Gbl_SubtableCacheList);
Gbl_SubtableCacheList = Next;
BufferCount++;
}
DbgPrint (ASL_DEBUG_OUTPUT,
"%u Subtables, Buffer size: %u subtables (%u bytes), %u Buffers\n",
Gbl_SubtableCount, ASL_SUBTABLE_CACHE_SIZE,
(sizeof (DT_SUBTABLE) * ASL_SUBTABLE_CACHE_SIZE), BufferCount);
Gbl_SubtableCount = 0;
Gbl_SubtableCacheNext = NULL;
Gbl_SubtableCacheLast = NULL;
}

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -257,7 +257,7 @@ PrGetNextToken (
void
PrError (
UINT8 Level,
UINT8 MessageId,
UINT16 MessageId,
UINT32 Column);
void

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -360,7 +360,7 @@ PrAddMacro (
if (ArgCount >= PR_MAX_MACRO_ARGS)
{
PrError (ASL_ERROR, ASL_MSG_TOO_MANY_ARGUMENTS, TokenOffset);
return;
goto ErrorExit;
}
}
@ -400,7 +400,7 @@ PrAddMacro (
PrError (ASL_ERROR, ASL_MSG_TOO_MANY_ARGUMENTS,
THIS_TOKEN_OFFSET (Token));
return;
goto ErrorExit;
}
break;
}
@ -432,7 +432,7 @@ AddMacroToList:
THIS_TOKEN_OFFSET (Name));
}
return;
goto ErrorExit;
}
DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID
@ -451,6 +451,13 @@ AddMacroToList:
DefineInfo->Args = Args;
DefineInfo->ArgCount = ArgCount;
}
return;
ErrorExit:
ACPI_FREE (Args);
return;
}

View File

@ -6,7 +6,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -6,7 +6,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -149,7 +149,7 @@ PrGetNextToken (
void
PrError (
UINT8 Level,
UINT8 MessageId,
UINT16 MessageId,
UINT32 Column)
{
#if 0
@ -340,7 +340,6 @@ PrOpenIncludeWithPrefix (
if (!IncludeFile)
{
fprintf (stderr, "Could not open include file %s\n", Pathname);
ACPI_FREE (Pathname);
return (NULL);
}
@ -393,15 +392,17 @@ PrPushInputFileStack (
/* Reset the global line count and filename */
Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
Gbl_Files[ASL_FILE_INPUT].Filename =
UtStringCacheCalloc (strlen (Filename) + 1);
strcpy (Gbl_Files[ASL_FILE_INPUT].Filename, Filename);
Gbl_Files[ASL_FILE_INPUT].Handle = InputFile;
Gbl_PreviousLineNumber = 0;
Gbl_CurrentLineNumber = 0;
/* Emit a new #line directive for the include file */
FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\"\n",
1, Filename);
FlPrintFile (ASL_FILE_PREPROCESSOR, "#line %u \"%s\"\n", 1, Filename);
}

View File

@ -5,7 +5,7 @@
******************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acevents.h>
@ -116,7 +115,7 @@ AcpiDbConvertToNode (
Node = ACPI_TO_POINTER (Address);
if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
{
AcpiOsPrintf ("Address %p is invalid in this address space\n",
AcpiOsPrintf ("Address %p is invalid",
Node);
return (NULL);
}
@ -125,7 +124,7 @@ AcpiDbConvertToNode (
if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
{
AcpiOsPrintf ("Address %p is not a valid NS node [%s]\n",
AcpiOsPrintf ("Address %p is not a valid namespace node [%s]\n",
Node, AcpiUtGetDescriptorName (Node));
return (NULL);
}
@ -139,6 +138,8 @@ AcpiDbConvertToNode (
Node = AcpiDbLocalNsLookup (InString);
if (!Node)
{
AcpiOsPrintf ("Could not find [%s] in namespace, defaulting to root node\n",
InString);
Node = AcpiGbl_RootNode;
}
}
@ -337,7 +338,7 @@ AcpiDbDisplayTableInfo (
/* Header */
AcpiOsPrintf ("Idx ID Status Type Sig Address Len Header\n");
AcpiOsPrintf ("Idx ID Status Type TableHeader (Sig, Address, Length)\n");
/* Walk the entire root table list */
@ -362,35 +363,30 @@ AcpiDbDisplayTableInfo (
switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK)
{
case ACPI_TABLE_ORIGIN_UNKNOWN:
case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
AcpiOsPrintf ("Unknown ");
AcpiOsPrintf ("External/virtual ");
break;
case ACPI_TABLE_ORIGIN_MAPPED:
case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL:
AcpiOsPrintf ("Mapped ");
AcpiOsPrintf ("Internal/physical ");
break;
case ACPI_TABLE_ORIGIN_ALLOCATED:
case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
AcpiOsPrintf ("Allocated ");
break;
case ACPI_TABLE_ORIGIN_OVERRIDE:
AcpiOsPrintf ("Override ");
AcpiOsPrintf ("Internal/virtual ");
break;
default:
AcpiOsPrintf ("INVALID ");
AcpiOsPrintf ("INVALID TYPE ");
break;
}
/* Make sure that the table is mapped */
Status = AcpiTbVerifyTable (TableDesc);
Status = AcpiTbValidateTable (TableDesc);
if (ACPI_FAILURE (Status))
{
return;
@ -440,8 +436,6 @@ AcpiDbUnloadAcpiTable (
Node = AcpiDbConvertToNode (ObjectName);
if (!Node)
{
AcpiOsPrintf ("Could not find [%s] in namespace\n",
ObjectName);
return;
}
@ -830,7 +824,7 @@ AcpiDmTestResourceConversion (
/* Convert internal resource list to external AML resource template */
Status = AcpiRsCreateAmlResources (ResourceBuffer.Pointer, &NewAml);
Status = AcpiRsCreateAmlResources (&ResourceBuffer, &NewAml);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("AcpiRsCreateAmlResources failed: %s\n",
@ -842,8 +836,8 @@ AcpiDmTestResourceConversion (
OriginalAml = ReturnBuffer.Pointer;
AcpiDmCompareAmlResources (
OriginalAml->Buffer.Pointer, (ACPI_RSDESC_SIZE) OriginalAml->Buffer.Length,
AcpiDmCompareAmlResources (OriginalAml->Buffer.Pointer,
(ACPI_RSDESC_SIZE) OriginalAml->Buffer.Length,
NewAml.Pointer, (ACPI_RSDESC_SIZE) NewAml.Length);
/* Cleanup and exit */
@ -1042,7 +1036,7 @@ GetCrs:
}
EndCrs:
ACPI_FREE_BUFFER (ReturnBuffer);
ACPI_FREE (ReturnBuffer.Pointer);
}
@ -1192,14 +1186,25 @@ AcpiDbGenerateGpe (
char *GpeArg,
char *BlockArg)
{
UINT32 BlockNumber;
UINT32 BlockNumber = 0;
UINT32 GpeNumber;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
GpeNumber = ACPI_STRTOUL (GpeArg, NULL, 0);
BlockNumber = ACPI_STRTOUL (BlockArg, NULL, 0);
GpeNumber = ACPI_STRTOUL (GpeArg, NULL, 0);
/*
* If no block arg, or block arg == 0 or 1, use the FADT-defined
* GPE blocks.
*/
if (BlockArg)
{
BlockNumber = ACPI_STRTOUL (BlockArg, NULL, 0);
if (BlockNumber == 1)
{
BlockNumber = 0;
}
}
GpeEventInfo = AcpiEvGetGpeEventInfo (ACPI_TO_POINTER (BlockNumber),
GpeNumber);

View File

@ -5,7 +5,7 @@
******************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acdebug.h>
@ -362,7 +361,9 @@ AcpiDbEncodePldBuffer (
Dword = 0;
ACPI_PLD_SET_REVISION (&Dword, PldInfo->Revision);
ACPI_PLD_SET_IGNORE_COLOR (&Dword, PldInfo->IgnoreColor);
ACPI_PLD_SET_COLOR (&Dword, PldInfo->Color);
ACPI_PLD_SET_RED (&Dword, PldInfo->Red);
ACPI_PLD_SET_GREEN (&Dword, PldInfo->Green);
ACPI_PLD_SET_BLUE (&Dword, PldInfo->Blue);
ACPI_MOVE_32_TO_32 (&Buffer[0], &Dword);
/* Second 32 bits */
@ -481,45 +482,47 @@ AcpiDbDumpPldBuffer (
/* First 32-bit dword */
AcpiOsPrintf (ACPI_PLD_OUTPUT, "Revision", PldInfo->Revision);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "IgnoreColor", PldInfo->IgnoreColor);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "Color", PldInfo->Color);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Revision", PldInfo->Revision);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_IgnoreColor", PldInfo->IgnoreColor);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Red", PldInfo->Red);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Green", PldInfo->Green);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Blue", PldInfo->Blue);
/* Second 32-bit dword */
AcpiOsPrintf (ACPI_PLD_OUTPUT, "Width", PldInfo->Width);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "Height", PldInfo->Height);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Width", PldInfo->Width);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Height", PldInfo->Height);
/* Third 32-bit dword */
AcpiOsPrintf (ACPI_PLD_OUTPUT, "UserVisible", PldInfo->UserVisible);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "Dock", PldInfo->Dock);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "Lid", PldInfo->Lid);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "Panel", PldInfo->Panel);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "VerticalPosition", PldInfo->VerticalPosition);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "HorizontalPosition", PldInfo->HorizontalPosition);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "Shape", PldInfo->Shape);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupOrientation", PldInfo->GroupOrientation);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupToken", PldInfo->GroupToken);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "GroupPosition", PldInfo->GroupPosition);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "Bay", PldInfo->Bay);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_UserVisible", PldInfo->UserVisible);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Dock", PldInfo->Dock);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Lid", PldInfo->Lid);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Panel", PldInfo->Panel);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_VerticalPosition", PldInfo->VerticalPosition);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_HorizontalPosition", PldInfo->HorizontalPosition);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Shape", PldInfo->Shape);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_GroupOrientation", PldInfo->GroupOrientation);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_GroupToken", PldInfo->GroupToken);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_GroupPosition", PldInfo->GroupPosition);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Bay", PldInfo->Bay);
/* Fourth 32-bit dword */
AcpiOsPrintf (ACPI_PLD_OUTPUT, "Ejectable", PldInfo->Ejectable);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "OspmEjectRequired", PldInfo->OspmEjectRequired);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "CabinetNumber", PldInfo->CabinetNumber);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "CardCageNumber", PldInfo->CardCageNumber);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "Reference", PldInfo->Reference);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "Rotation", PldInfo->Rotation);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "Order", PldInfo->Order);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Ejectable", PldInfo->Ejectable);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_EjectRequired", PldInfo->OspmEjectRequired);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_CabinetNumber", PldInfo->CabinetNumber);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_CardCageNumber", PldInfo->CardCageNumber);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Reference", PldInfo->Reference);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Rotation", PldInfo->Rotation);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_Order", PldInfo->Order);
/* Fifth 32-bit dword */
if (BufferDesc->Buffer.Length > 16)
{
AcpiOsPrintf (ACPI_PLD_OUTPUT, "VerticalOffset", PldInfo->VerticalOffset);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "HorizontalOffset", PldInfo->HorizontalOffset);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_VerticalOffset", PldInfo->VerticalOffset);
AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_HorizontalOffset", PldInfo->HorizontalOffset);
}
ACPI_FREE (PldInfo);

View File

@ -5,7 +5,7 @@
******************************************************************************/
/*
* Copyright (C) 2000 - 2013, Intel Corp.
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/amlcode.h>
@ -303,6 +302,10 @@ AcpiDbDecodeAndDisplayObject (
/* Is not a recognizeable object */
AcpiOsPrintf (
"Not a known ACPI internal object, descriptor type %2.2X\n",
ACPI_GET_DESCRIPTOR_TYPE (ObjPtr));
Size = 16;
if (AcpiOsReadable (ObjPtr, 64))
{
@ -897,7 +900,7 @@ AcpiDbDisplayGpes (
GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j;
GpeEventInfo = &GpeBlock->EventInfo[GpeIndex];
if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
ACPI_GPE_DISPATCH_NONE)
{
/* This GPE is not used (no method or handler), ignore it */
@ -930,7 +933,7 @@ AcpiDbDisplayGpes (
AcpiOsPrintf ("RunOnly, ");
}
switch (GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK)
switch (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags))
{
case ACPI_GPE_DISPATCH_NONE:
@ -941,6 +944,7 @@ AcpiDbDisplayGpes (
AcpiOsPrintf ("Method");
break;
case ACPI_GPE_DISPATCH_HANDLER:
AcpiOsPrintf ("Handler");
@ -958,10 +962,15 @@ AcpiDbDisplayGpes (
AcpiOsPrintf ("Implicit Notify on %u devices", Count);
break;
case ACPI_GPE_DISPATCH_RAW_HANDLER:
AcpiOsPrintf ("RawHandler");
break;
default:
AcpiOsPrintf ("UNKNOWN: %X",
GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK);
ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags));
break;
}

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