Merge ACPICA 20130328.
This commit is contained in:
commit
9c7c683c56
@ -443,6 +443,7 @@ contrib/dev/acpica/components/utilities/utmutex.c optional acpi
|
||||
contrib/dev/acpica/components/utilities/utobject.c optional acpi
|
||||
contrib/dev/acpica/components/utilities/utosi.c optional acpi
|
||||
contrib/dev/acpica/components/utilities/utownerid.c optional acpi
|
||||
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
|
||||
|
@ -1,3 +1,78 @@
|
||||
----------------------------------------
|
||||
28 March 2013. Summary of changes for version 20130328:
|
||||
|
||||
1) ACPICA kernel-resident subsystem:
|
||||
|
||||
Fixed several possible race conditions with the internal object reference
|
||||
counting mechanism. Some of the external ACPICA interfaces update object
|
||||
reference counts without holding the interpreter or namespace lock. This
|
||||
change adds a spinlock to protect reference count updates on the internal
|
||||
ACPICA objects. Reported by and with assistance from Andriy Gapon
|
||||
(avg@FreeBSD.org).
|
||||
|
||||
FADT support: Removed an extraneous warning for very large GPE register
|
||||
sets. This change removes a size mismatch warning if the legacy length
|
||||
field for a GPE register set is larger than the 64-bit GAS structure can
|
||||
accommodate. GPE register sets can be larger than the 255-bit width
|
||||
limitation of the GAS structure. Linn Crosetto (linn@hp.com).
|
||||
|
||||
_OSI Support: handle any errors from AcpiOsAcquireMutex. Check for error
|
||||
return from this interface. Handles a possible timeout case if
|
||||
ACPI_WAIT_FOREVER is modified by the host to be a value less than
|
||||
"forever". Jung-uk Kim.
|
||||
|
||||
Predefined name support: Add allowed/required argument type information to
|
||||
the master predefined info table. This change adds the infrastructure to
|
||||
enable typechecking on incoming arguments for all predefined
|
||||
methods/objects. It does not actually contain the code that will fully
|
||||
utilize this information, this is still under development. Also condenses
|
||||
some duplicate code for the predefined names into a new module,
|
||||
utilities/utpredef.c
|
||||
|
||||
Example Code and Data Size: These are the sizes for the OS-independent
|
||||
acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
|
||||
debug version of the code includes the debug output trace mechanism and
|
||||
has a much larger code and data size.
|
||||
|
||||
Previous Release:
|
||||
Non-Debug Version: 95.0K Code, 25.9K Data, 120.9K Total
|
||||
Debug Version: 182.9K Code, 75.6K Data, 258.5K Total
|
||||
Current Release:
|
||||
Non-Debug Version: 95.2K Code, 26.4K Data, 121.6K Total
|
||||
Debug Version: 183.0K Code, 76.0K Data, 259.0K Total
|
||||
|
||||
|
||||
2) iASL Compiler/Disassembler and Tools:
|
||||
|
||||
iASL: Implemented a new option to simplify the development of ACPI-related
|
||||
BIOS code. Adds support for a new "offset table" output file. The -so
|
||||
option will create a C table containing the AML table offsets of various
|
||||
named objects in the namespace so that BIOS code can modify them easily at
|
||||
boot time. This can simplify BIOS runtime code by eliminating expensive
|
||||
searches for "magic values", enhancing boot times and adding greater
|
||||
reliability. With assistance from Lee Hamel.
|
||||
|
||||
iASL: Allow additional predefined names to return zero-length packages.
|
||||
Now, all predefined names that are defined by the ACPI specification to
|
||||
return a "variable-length package of packages" are allowed to return a
|
||||
zero length top-level package. This allows the BIOS to tell the host that
|
||||
the requested feature is not supported, and supports existing BIOS/ASL
|
||||
code and practices.
|
||||
|
||||
iASL: Changed the "result not used" warning to an error. This is the case
|
||||
where an ASL operator is effectively a NOOP because the result of the
|
||||
operation is not stored anywhere. For example:
|
||||
Add (4, Local0)
|
||||
There is no target (missing 3rd argument), nor is the function return
|
||||
value used. This is potentially a very serious problem -- since the code
|
||||
was probably intended to do something, but for whatever reason, the value
|
||||
was not stored. Therefore, this issue has been upgraded from a warning to
|
||||
an error.
|
||||
|
||||
AcpiHelp: Added allowable/required argument types to the predefined names
|
||||
info display. This feature utilizes the recent update to the predefined
|
||||
names table (above).
|
||||
|
||||
----------------------------------------
|
||||
14 February 2013. Summary of changes for version 20130214:
|
||||
|
||||
|
@ -61,7 +61,7 @@
|
||||
const AH_PREDEFINED_NAME AslPredefinedInfo[] =
|
||||
{
|
||||
AH_PREDEF ("_ACx", "Active Cooling", "Returns the active cooling policy threshold values"),
|
||||
AH_PREDEF ("_ADR", "Address", "Returns the address of a device on its parent bus"),
|
||||
AH_PREDEF ("_ADR", "Address", "Returns address of a device on parent bus, and resource field"),
|
||||
AH_PREDEF ("_AEI", "ACPI Event Interrupts", "Returns a list of GPIO events to be used as ACPI events"),
|
||||
AH_PREDEF ("_ALC", "Ambient Light Chromaticity", "Returns the ambient light color chromaticity"),
|
||||
AH_PREDEF ("_ALI", "Ambient Light Illuminance", "Returns the ambient light brightness"),
|
||||
@ -113,7 +113,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
|
||||
AH_PREDEF ("_DGS", "Display Graphics State", "Return the current state of the output device"),
|
||||
AH_PREDEF ("_DIS", "Disable Device", "Disables a device"),
|
||||
AH_PREDEF ("_DLM", "Device Lock Mutex", "Defines mutex for OS/AML sharing"),
|
||||
AH_PREDEF ("_DMA", "Direct Memory Access", "Returns a device's current resources for DMA transactions"),
|
||||
AH_PREDEF ("_DMA", "Direct Memory Access", "Returns device current resources for DMA transactions, and resource field"),
|
||||
AH_PREDEF ("_DOD", "Display Output Devices", "Enumerate all devices attached to the display adapter"),
|
||||
AH_PREDEF ("_DOS", "Disable Output Switching", "Sets the display output switching mode"),
|
||||
AH_PREDEF ("_DPL", "Device Selection Polarity", "Polarity of Device Selection signal, Resource Descriptor field"),
|
||||
|
@ -126,6 +126,7 @@ AslCompilerSignon (
|
||||
break;
|
||||
|
||||
case ASL_FILE_C_SOURCE_OUTPUT:
|
||||
case ASL_FILE_C_OFFSET_OUTPUT:
|
||||
case ASL_FILE_C_INCLUDE_OUTPUT:
|
||||
|
||||
Prefix = " * ";
|
||||
@ -199,6 +200,7 @@ AslCompilerFileHeader (
|
||||
break;
|
||||
|
||||
case ASL_FILE_C_SOURCE_OUTPUT:
|
||||
case ASL_FILE_C_OFFSET_OUTPUT:
|
||||
case ASL_FILE_C_INCLUDE_OUTPUT:
|
||||
|
||||
Prefix = " * ";
|
||||
@ -222,6 +224,7 @@ AslCompilerFileHeader (
|
||||
switch (FileId)
|
||||
{
|
||||
case ASL_FILE_C_SOURCE_OUTPUT:
|
||||
case ASL_FILE_C_OFFSET_OUTPUT:
|
||||
case ASL_FILE_C_INCLUDE_OUTPUT:
|
||||
FlPrintFile (FileId, " */\n");
|
||||
break;
|
||||
|
@ -349,12 +349,6 @@ void
|
||||
LsDoListings (
|
||||
void);
|
||||
|
||||
void
|
||||
LsDumpAsciiInComment (
|
||||
UINT32 FileId,
|
||||
UINT32 Count,
|
||||
UINT8 *Buffer);
|
||||
|
||||
void
|
||||
LsWriteNodeToAsmListing (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
@ -369,6 +363,55 @@ LsDumpParseTree (
|
||||
void);
|
||||
|
||||
|
||||
/*
|
||||
* asllistsup - Listing file support utilities
|
||||
*/
|
||||
void
|
||||
LsDumpAscii (
|
||||
UINT32 FileId,
|
||||
UINT32 Count,
|
||||
UINT8 *Buffer);
|
||||
|
||||
void
|
||||
LsDumpAsciiInComment (
|
||||
UINT32 FileId,
|
||||
UINT32 Count,
|
||||
UINT8 *Buffer);
|
||||
|
||||
void
|
||||
LsCheckException (
|
||||
UINT32 LineNumber,
|
||||
UINT32 FileId);
|
||||
|
||||
void
|
||||
LsFlushListingBuffer (
|
||||
UINT32 FileId);
|
||||
|
||||
void
|
||||
LsWriteListingHexBytes (
|
||||
UINT8 *Buffer,
|
||||
UINT32 Length,
|
||||
UINT32 FileId);
|
||||
|
||||
void
|
||||
LsWriteSourceLines (
|
||||
UINT32 ToLineNumber,
|
||||
UINT32 ToLogicalLineNumber,
|
||||
UINT32 FileId);
|
||||
|
||||
UINT32
|
||||
LsWriteOneSourceLine (
|
||||
UINT32 FileId);
|
||||
|
||||
void
|
||||
LsPushNode (
|
||||
char *Filename);
|
||||
|
||||
ASL_LISTING_NODE *
|
||||
LsPopNode (
|
||||
void);
|
||||
|
||||
|
||||
/*
|
||||
* aslhex - generate all "hex" output files (C, ASM, ASL)
|
||||
*/
|
||||
@ -387,6 +430,24 @@ OpcAmlConstantWalk (
|
||||
void *Context);
|
||||
|
||||
|
||||
/*
|
||||
* asloffset - generate C offset file for BIOS support
|
||||
*/
|
||||
ACPI_STATUS
|
||||
LsAmlOffsetWalk (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Level,
|
||||
void *Context);
|
||||
|
||||
void
|
||||
LsDoOffsetTableHeader (
|
||||
UINT32 FileId);
|
||||
|
||||
void
|
||||
LsDoOffsetTableFooter (
|
||||
UINT32 FileId);
|
||||
|
||||
|
||||
/*
|
||||
* aslopcodes - generate AML opcodes
|
||||
*/
|
||||
|
@ -120,6 +120,7 @@
|
||||
#define FILE_SUFFIX_ASM_INCLUDE "inc"
|
||||
#define FILE_SUFFIX_C_INCLUDE "h"
|
||||
#define FILE_SUFFIX_ASL_CODE "asl"
|
||||
#define FILE_SUFFIX_C_OFFSET "offset.h"
|
||||
|
||||
|
||||
/* Types for input files */
|
||||
@ -138,6 +139,11 @@
|
||||
#define ASL_EOF ACPI_UINT32_MAX
|
||||
|
||||
|
||||
/* Listings */
|
||||
|
||||
#define ASL_LISTING_LINE_PREFIX ": "
|
||||
|
||||
|
||||
/* Support for reserved method names */
|
||||
|
||||
#define ACPI_VALID_RESERVED_NAME_MAX 0x80000000
|
||||
|
@ -302,12 +302,25 @@ AePrintException (
|
||||
}
|
||||
else
|
||||
{
|
||||
while (RActual && SourceByte && (SourceByte != '\n') && (Total < 256))
|
||||
/* Read/write the source line, up to the maximum line length */
|
||||
|
||||
while (RActual && SourceByte && (SourceByte != '\n'))
|
||||
{
|
||||
if (fwrite (&SourceByte, 1, 1, OutputFile) != 1)
|
||||
if (Total < 256)
|
||||
{
|
||||
printf ("[*** iASL: Write error on output file ***]\n");
|
||||
return;
|
||||
/* After the max line length, we will just read the line, no write */
|
||||
|
||||
if (fwrite (&SourceByte, 1, 1, OutputFile) != 1)
|
||||
{
|
||||
printf ("[*** iASL: Write error on output file ***]\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (Total == 256)
|
||||
{
|
||||
fprintf (OutputFile,
|
||||
"\n[*** iASL: Very long input line, message below refers to column %u ***]",
|
||||
Enode->Column);
|
||||
}
|
||||
|
||||
RActual = fread (&SourceByte, 1, 1, SourceFile);
|
||||
@ -320,13 +333,6 @@ AePrintException (
|
||||
}
|
||||
Total++;
|
||||
}
|
||||
|
||||
if (Total >= 256)
|
||||
{
|
||||
fprintf (OutputFile,
|
||||
"\n[*** iASL: Long input line, an error occurred at column %u ***]",
|
||||
Enode->Column);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -675,6 +675,27 @@ FlOpenMiscOutputFiles (
|
||||
AslCompilerFileHeader (ASL_FILE_C_SOURCE_OUTPUT);
|
||||
}
|
||||
|
||||
/* Create/Open a C code source output file for the offset table if asked */
|
||||
|
||||
if (Gbl_C_OffsetTableFlag)
|
||||
{
|
||||
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_C_OFFSET);
|
||||
if (!Filename)
|
||||
{
|
||||
AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
|
||||
0, 0, 0, 0, NULL, NULL);
|
||||
return (AE_ERROR);
|
||||
}
|
||||
|
||||
/* Open the C code source file, text mode */
|
||||
|
||||
FlOpenFile (ASL_FILE_C_OFFSET_OUTPUT, Filename, "w+t");
|
||||
|
||||
FlPrintFile (ASL_FILE_C_OFFSET_OUTPUT, "/*\n");
|
||||
AslCompilerSignon (ASL_FILE_C_OFFSET_OUTPUT);
|
||||
AslCompilerFileHeader (ASL_FILE_C_OFFSET_OUTPUT);
|
||||
}
|
||||
|
||||
/* Create/Open a assembly include output file if asked */
|
||||
|
||||
if (Gbl_AsmIncludeOutputFlag)
|
||||
|
@ -86,7 +86,8 @@ ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES] =
|
||||
{NULL, NULL, "ASM Source: ", "Assembly Code Output"},
|
||||
{NULL, NULL, "C Source: ", "C Code Output"},
|
||||
{NULL, NULL, "ASM Include: ", "Assembly Header Output"},
|
||||
{NULL, NULL, "C Include: ", "C Header Output"}
|
||||
{NULL, NULL, "C Include: ", "C Header Output"},
|
||||
{NULL, NULL, "Offset Table: ", "C Offset Table Output"}
|
||||
};
|
||||
|
||||
#else
|
||||
@ -143,6 +144,7 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessorOutputFlag,
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DebugFlag, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AsmOutputFlag, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_C_OutputFlag, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_C_OffsetTableFlag, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AsmIncludeOutputFlag, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_C_IncludeOutputFlag, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ListingFlag, FALSE);
|
||||
|
@ -41,23 +41,22 @@
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include "aslcompiler.y.h"
|
||||
#include <contrib/dev/acpica/include/amlcode.h>
|
||||
#include <contrib/dev/acpica/include/acparser.h>
|
||||
#include <contrib/dev/acpica/include/acnamesp.h>
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("aslisting")
|
||||
ACPI_MODULE_NAME ("asllisting")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
LsDumpAscii (
|
||||
UINT32 FileId,
|
||||
UINT32 Count,
|
||||
UINT8 *Buffer);
|
||||
LsGenerateListing (
|
||||
UINT32 FileId);
|
||||
|
||||
static ACPI_STATUS
|
||||
LsAmlListingWalk (
|
||||
@ -65,66 +64,27 @@ LsAmlListingWalk (
|
||||
UINT32 Level,
|
||||
void *Context);
|
||||
|
||||
static void
|
||||
LsGenerateListing (
|
||||
UINT32 FileId);
|
||||
|
||||
static void
|
||||
LsPushNode (
|
||||
char *Filename);
|
||||
|
||||
static ASL_LISTING_NODE *
|
||||
LsPopNode (
|
||||
void);
|
||||
|
||||
static void
|
||||
LsCheckException (
|
||||
UINT32 LineNumber,
|
||||
UINT32 FileId);
|
||||
|
||||
static void
|
||||
LsFlushListingBuffer (
|
||||
UINT32 FileId);
|
||||
|
||||
static void
|
||||
LsWriteListingHexBytes (
|
||||
UINT8 *Buffer,
|
||||
UINT32 Length,
|
||||
UINT32 FileId);
|
||||
|
||||
static UINT32
|
||||
LsWriteOneSourceLine (
|
||||
UINT32 FileId);
|
||||
|
||||
static void
|
||||
LsFinishSourceListing (
|
||||
UINT32 FileId);
|
||||
|
||||
static void
|
||||
LsWriteSourceLines (
|
||||
UINT32 ToLineNumber,
|
||||
UINT32 ToLogicalLineNumber,
|
||||
UINT32 FileId);
|
||||
|
||||
static void
|
||||
LsWriteNodeToListing (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 FileId);
|
||||
|
||||
static ACPI_STATUS
|
||||
LsTreeWriteWalk (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Level,
|
||||
void *Context);
|
||||
|
||||
#define ASL_LISTING_LINE_PREFIX ": "
|
||||
static void
|
||||
LsWriteNodeToListing (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 FileId);
|
||||
|
||||
static void
|
||||
LsFinishSourceListing (
|
||||
UINT32 FileId);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsDoListings
|
||||
*
|
||||
* PARAMETERS: None
|
||||
* PARAMETERS: None. Examines the various output file global flags.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
@ -161,153 +121,60 @@ LsDoListings (
|
||||
{
|
||||
LsGenerateListing (ASL_FILE_ASM_INCLUDE_OUTPUT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsTreeWriteWalk
|
||||
*
|
||||
* PARAMETERS: ASL_WALK_CALLBACK
|
||||
*
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Dump entire parse tree, for compiler debug only
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
LsTreeWriteWalk (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Level,
|
||||
void *Context)
|
||||
{
|
||||
|
||||
/* Debug output */
|
||||
|
||||
DbgPrint (ASL_TREE_OUTPUT,
|
||||
"%5.5d [%2d]", Op->Asl.LogicalLineNumber, Level);
|
||||
UtPrintFormattedName (Op->Asl.ParseOpcode, Level);
|
||||
|
||||
|
||||
DbgPrint (ASL_TREE_OUTPUT, "\n");
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LsDumpParseTree (
|
||||
void)
|
||||
{
|
||||
|
||||
if (!Gbl_DebugFlag)
|
||||
if (Gbl_C_OffsetTableFlag)
|
||||
{
|
||||
return;
|
||||
LsGenerateListing (ASL_FILE_C_OFFSET_OUTPUT);
|
||||
}
|
||||
|
||||
DbgPrint (ASL_TREE_OUTPUT, "\nOriginal parse tree from parser:\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
|
||||
LsTreeWriteWalk, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsDumpAscii
|
||||
* FUNCTION: LsGenerateListing
|
||||
*
|
||||
* PARAMETERS: FileId - ID of current listing file
|
||||
* Count - Number of bytes to convert
|
||||
* Buffer - Buffer of bytes to convert
|
||||
* PARAMETERS: FileId - ID of listing file
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Convert hex bytes to ascii
|
||||
* DESCRIPTION: Generate a listing file. This can be one of the several types
|
||||
* of "listings" supported.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
LsDumpAscii (
|
||||
UINT32 FileId,
|
||||
UINT32 Count,
|
||||
UINT8 *Buffer)
|
||||
LsGenerateListing (
|
||||
UINT32 FileId)
|
||||
{
|
||||
UINT8 BufChar;
|
||||
UINT32 i;
|
||||
|
||||
/* Start at the beginning of both the source and AML files */
|
||||
|
||||
FlPrintFile (FileId, " \"");
|
||||
for (i = 0; i < Count; i++)
|
||||
FlSeekFile (ASL_FILE_SOURCE_OUTPUT, 0);
|
||||
FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
|
||||
Gbl_SourceLine = 0;
|
||||
Gbl_CurrentHexColumn = 0;
|
||||
LsPushNode (Gbl_Files[ASL_FILE_INPUT].Filename);
|
||||
|
||||
if (FileId == ASL_FILE_C_OFFSET_OUTPUT)
|
||||
{
|
||||
BufChar = Buffer[i];
|
||||
if (isprint (BufChar))
|
||||
{
|
||||
FlPrintFile (FileId, "%c", BufChar);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Not a printable character, just put out a dot */
|
||||
/* Offset table file has a special header and footer */
|
||||
|
||||
FlPrintFile (FileId, ".");
|
||||
}
|
||||
LsDoOffsetTableHeader (FileId);
|
||||
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, LsAmlOffsetWalk,
|
||||
NULL, (void *) ACPI_TO_POINTER (FileId));
|
||||
LsDoOffsetTableFooter (FileId);
|
||||
return;
|
||||
}
|
||||
FlPrintFile (FileId, "\"");
|
||||
}
|
||||
|
||||
/* Process all parse nodes */
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsDumpAsciiInComment
|
||||
*
|
||||
* PARAMETERS: FileId - ID of current listing file
|
||||
* Count - Number of bytes to convert
|
||||
* Buffer - Buffer of bytes to convert
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Convert hex bytes to ascii
|
||||
*
|
||||
******************************************************************************/
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, LsAmlListingWalk,
|
||||
NULL, (void *) ACPI_TO_POINTER (FileId));
|
||||
|
||||
void
|
||||
LsDumpAsciiInComment (
|
||||
UINT32 FileId,
|
||||
UINT32 Count,
|
||||
UINT8 *Buffer)
|
||||
{
|
||||
UINT8 BufChar = 0;
|
||||
UINT8 LastChar;
|
||||
UINT32 i;
|
||||
/* Final processing */
|
||||
|
||||
|
||||
FlPrintFile (FileId, " \"");
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
LastChar = BufChar;
|
||||
BufChar = Buffer[i];
|
||||
|
||||
if (isprint (BufChar))
|
||||
{
|
||||
/* Handle embedded C comment sequences */
|
||||
|
||||
if (((LastChar == '*') && (BufChar == '/')) ||
|
||||
((LastChar == '/') && (BufChar == '*')))
|
||||
{
|
||||
/* Insert a space to break the sequence */
|
||||
|
||||
FlPrintFile (FileId, ".", BufChar);
|
||||
}
|
||||
|
||||
FlPrintFile (FileId, "%c", BufChar);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Not a printable character, just put out a dot */
|
||||
|
||||
FlPrintFile (FileId, ".");
|
||||
}
|
||||
}
|
||||
FlPrintFile (FileId, "\"");
|
||||
LsFinishSourceListing (FileId);
|
||||
}
|
||||
|
||||
|
||||
@ -361,576 +228,47 @@ LsAmlListingWalk (
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsGenerateListing
|
||||
*
|
||||
* PARAMETERS: FileId - ID of listing file
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Generate a listing file. This can be one of the several types
|
||||
* of "listings" supported.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
LsGenerateListing (
|
||||
UINT32 FileId)
|
||||
{
|
||||
|
||||
/* Start at the beginning of both the source and AML files */
|
||||
|
||||
FlSeekFile (ASL_FILE_SOURCE_OUTPUT, 0);
|
||||
FlSeekFile (ASL_FILE_AML_OUTPUT, 0);
|
||||
Gbl_SourceLine = 0;
|
||||
Gbl_CurrentHexColumn = 0;
|
||||
LsPushNode (Gbl_Files[ASL_FILE_INPUT].Filename);
|
||||
|
||||
/* Process all parse nodes */
|
||||
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, LsAmlListingWalk,
|
||||
NULL, (void *) ACPI_TO_POINTER (FileId));
|
||||
|
||||
/* Final processing */
|
||||
|
||||
LsFinishSourceListing (FileId);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsPushNode
|
||||
*
|
||||
* PARAMETERS: Filename - Pointer to the include filename
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Push a listing node on the listing/include file stack. This
|
||||
* stack enables tracking of include files (infinitely nested)
|
||||
* and resumption of the listing of the parent file when the
|
||||
* include file is finished.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
LsPushNode (
|
||||
char *Filename)
|
||||
{
|
||||
ASL_LISTING_NODE *Lnode;
|
||||
|
||||
|
||||
/* Create a new node */
|
||||
|
||||
Lnode = UtLocalCalloc (sizeof (ASL_LISTING_NODE));
|
||||
|
||||
/* Initialize */
|
||||
|
||||
Lnode->Filename = Filename;
|
||||
Lnode->LineNumber = 0;
|
||||
|
||||
/* Link (push) */
|
||||
|
||||
Lnode->Next = Gbl_ListingNode;
|
||||
Gbl_ListingNode = Lnode;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsPopNode
|
||||
* FUNCTION: LsDumpParseTree, LsTreeWriteWalk
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: List head after current head is popped off
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Pop the current head of the list, free it, and return the
|
||||
* next node on the stack (the new current node).
|
||||
* DESCRIPTION: Dump entire parse tree, for compiler debug only
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ASL_LISTING_NODE *
|
||||
LsPopNode (
|
||||
void
|
||||
LsDumpParseTree (
|
||||
void)
|
||||
{
|
||||
ASL_LISTING_NODE *Lnode;
|
||||
|
||||
|
||||
/* Just grab the node at the head of the list */
|
||||
|
||||
Lnode = Gbl_ListingNode;
|
||||
if ((!Lnode) ||
|
||||
(!Lnode->Next))
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, NULL,
|
||||
"Could not pop empty listing stack");
|
||||
return (Gbl_ListingNode);
|
||||
}
|
||||
|
||||
Gbl_ListingNode = Lnode->Next;
|
||||
ACPI_FREE (Lnode);
|
||||
|
||||
/* New "Current" node is the new head */
|
||||
|
||||
return (Gbl_ListingNode);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsCheckException
|
||||
*
|
||||
* PARAMETERS: LineNumber - Current logical (cumulative) line #
|
||||
* FileId - ID of output listing file
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Check if there is an exception for this line, and if there is,
|
||||
* put it in the listing immediately. Handles multiple errors
|
||||
* per line. Gbl_NextError points to the next error in the
|
||||
* sorted (by line #) list of compile errors/warnings.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
LsCheckException (
|
||||
UINT32 LineNumber,
|
||||
UINT32 FileId)
|
||||
{
|
||||
|
||||
if ((!Gbl_NextError) ||
|
||||
(LineNumber < Gbl_NextError->LogicalLineNumber ))
|
||||
if (!Gbl_DebugFlag)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Handle multiple errors per line */
|
||||
|
||||
if (FileId == ASL_FILE_LISTING_OUTPUT)
|
||||
{
|
||||
while (Gbl_NextError &&
|
||||
(LineNumber >= Gbl_NextError->LogicalLineNumber))
|
||||
{
|
||||
AePrintException (FileId, Gbl_NextError, "\n[****iasl****]\n");
|
||||
|
||||
Gbl_NextError = Gbl_NextError->Next;
|
||||
}
|
||||
|
||||
FlPrintFile (FileId, "\n");
|
||||
}
|
||||
DbgPrint (ASL_TREE_OUTPUT, "\nOriginal parse tree from parser:\n\n");
|
||||
TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
|
||||
LsTreeWriteWalk, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsFlushListingBuffer
|
||||
*
|
||||
* PARAMETERS: FileId - ID of the listing file
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Flush out the current contents of the 16-byte hex AML code
|
||||
* buffer. Usually called at the termination of a single line
|
||||
* of source code or when the buffer is full.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
LsFlushListingBuffer (
|
||||
UINT32 FileId)
|
||||
{
|
||||
UINT32 i;
|
||||
|
||||
|
||||
if (Gbl_CurrentHexColumn == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Write the hex bytes */
|
||||
|
||||
switch (FileId)
|
||||
{
|
||||
case ASL_FILE_LISTING_OUTPUT:
|
||||
|
||||
for (i = 0; i < Gbl_CurrentHexColumn; i++)
|
||||
{
|
||||
FlPrintFile (FileId, "%2.2X ", Gbl_AmlBuffer[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < ((HEX_LISTING_LINE_SIZE - Gbl_CurrentHexColumn) * 3); i++)
|
||||
{
|
||||
FlWriteFile (FileId, ".", 1);
|
||||
}
|
||||
|
||||
/* Write the ASCII character associated with each of the bytes */
|
||||
|
||||
LsDumpAscii (FileId, Gbl_CurrentHexColumn, Gbl_AmlBuffer);
|
||||
break;
|
||||
|
||||
|
||||
case ASL_FILE_ASM_SOURCE_OUTPUT:
|
||||
|
||||
for (i = 0; i < Gbl_CurrentHexColumn; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
FlPrintFile (FileId, ",");
|
||||
}
|
||||
FlPrintFile (FileId, "0%2.2Xh", Gbl_AmlBuffer[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < ((HEX_LISTING_LINE_SIZE - Gbl_CurrentHexColumn) * 5); i++)
|
||||
{
|
||||
FlWriteFile (FileId, " ", 1);
|
||||
}
|
||||
|
||||
FlPrintFile (FileId, " ;%8.8X",
|
||||
Gbl_CurrentAmlOffset - HEX_LISTING_LINE_SIZE);
|
||||
|
||||
/* Write the ASCII character associated with each of the bytes */
|
||||
|
||||
LsDumpAscii (FileId, Gbl_CurrentHexColumn, Gbl_AmlBuffer);
|
||||
break;
|
||||
|
||||
|
||||
case ASL_FILE_C_SOURCE_OUTPUT:
|
||||
|
||||
for (i = 0; i < Gbl_CurrentHexColumn; i++)
|
||||
{
|
||||
FlPrintFile (FileId, "0x%2.2X,", Gbl_AmlBuffer[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < ((HEX_LISTING_LINE_SIZE - Gbl_CurrentHexColumn) * 5); i++)
|
||||
{
|
||||
FlWriteFile (FileId, " ", 1);
|
||||
}
|
||||
|
||||
FlPrintFile (FileId, " /* %8.8X",
|
||||
Gbl_CurrentAmlOffset - HEX_LISTING_LINE_SIZE);
|
||||
|
||||
/* Write the ASCII character associated with each of the bytes */
|
||||
|
||||
LsDumpAsciiInComment (FileId, Gbl_CurrentHexColumn, Gbl_AmlBuffer);
|
||||
FlPrintFile (FileId, " */");
|
||||
break;
|
||||
|
||||
default:
|
||||
/* No other types supported */
|
||||
return;
|
||||
}
|
||||
|
||||
FlPrintFile (FileId, "\n");
|
||||
|
||||
Gbl_CurrentHexColumn = 0;
|
||||
Gbl_HexBytesWereWritten = TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsWriteListingHexBytes
|
||||
*
|
||||
* PARAMETERS: Buffer - AML code buffer
|
||||
* Length - Number of AML bytes to write
|
||||
* FileId - ID of current listing file.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Write the contents of the AML buffer to the listing file via
|
||||
* the listing buffer. The listing buffer is flushed every 16
|
||||
* AML bytes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
LsWriteListingHexBytes (
|
||||
UINT8 *Buffer,
|
||||
UINT32 Length,
|
||||
UINT32 FileId)
|
||||
{
|
||||
UINT32 i;
|
||||
|
||||
|
||||
/* Transfer all requested bytes */
|
||||
|
||||
for (i = 0; i < Length; i++)
|
||||
{
|
||||
/* Print line header when buffer is empty */
|
||||
|
||||
if (Gbl_CurrentHexColumn == 0)
|
||||
{
|
||||
if (Gbl_HasIncludeFiles)
|
||||
{
|
||||
FlPrintFile (FileId, "%*s", 10, " ");
|
||||
}
|
||||
|
||||
switch (FileId)
|
||||
{
|
||||
case ASL_FILE_LISTING_OUTPUT:
|
||||
|
||||
FlPrintFile (FileId, "%8.8X%s", Gbl_CurrentAmlOffset,
|
||||
ASL_LISTING_LINE_PREFIX);
|
||||
break;
|
||||
|
||||
case ASL_FILE_ASM_SOURCE_OUTPUT:
|
||||
|
||||
FlPrintFile (FileId, " db ");
|
||||
break;
|
||||
|
||||
case ASL_FILE_C_SOURCE_OUTPUT:
|
||||
|
||||
FlPrintFile (FileId, " ");
|
||||
break;
|
||||
|
||||
default:
|
||||
/* No other types supported */
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Transfer AML byte and update counts */
|
||||
|
||||
Gbl_AmlBuffer[Gbl_CurrentHexColumn] = Buffer[i];
|
||||
|
||||
Gbl_CurrentHexColumn++;
|
||||
Gbl_CurrentAmlOffset++;
|
||||
|
||||
/* Flush buffer when it is full */
|
||||
|
||||
if (Gbl_CurrentHexColumn >= HEX_LISTING_LINE_SIZE)
|
||||
{
|
||||
LsFlushListingBuffer (FileId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsWriteOneSourceLine
|
||||
*
|
||||
* PARAMETERS: FileID - ID of current listing file
|
||||
*
|
||||
* RETURN: FALSE on EOF (input source file), TRUE otherwise
|
||||
*
|
||||
* DESCRIPTION: Read one line from the input source file and echo it to the
|
||||
* listing file, prefixed with the line number, and if the source
|
||||
* file contains include files, prefixed with the current filename
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static UINT32
|
||||
LsWriteOneSourceLine (
|
||||
UINT32 FileId)
|
||||
{
|
||||
UINT8 FileByte;
|
||||
|
||||
|
||||
Gbl_SourceLine++;
|
||||
Gbl_ListingNode->LineNumber++;
|
||||
|
||||
/* Ignore lines that are completely blank (but count the line above) */
|
||||
|
||||
if (FlReadFile (ASL_FILE_SOURCE_OUTPUT, &FileByte, 1) != AE_OK)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
if (FileByte == '\n')
|
||||
{
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* This is a non-empty line, we will print the entire line with
|
||||
* the line number and possibly other prefixes and transforms.
|
||||
*/
|
||||
|
||||
/* Line prefixes for special files, C and ASM output */
|
||||
|
||||
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
|
||||
{
|
||||
FlPrintFile (FileId, " *");
|
||||
}
|
||||
if (FileId == ASL_FILE_ASM_SOURCE_OUTPUT)
|
||||
{
|
||||
FlPrintFile (FileId, "; ");
|
||||
}
|
||||
|
||||
if (Gbl_HasIncludeFiles)
|
||||
{
|
||||
/*
|
||||
* This file contains "include" statements, print the current
|
||||
* filename and line number within the current file
|
||||
*/
|
||||
FlPrintFile (FileId, "%12s %5d%s",
|
||||
Gbl_ListingNode->Filename, Gbl_ListingNode->LineNumber,
|
||||
ASL_LISTING_LINE_PREFIX);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No include files, just print the line number */
|
||||
|
||||
FlPrintFile (FileId, "%8u%s", Gbl_SourceLine,
|
||||
ASL_LISTING_LINE_PREFIX);
|
||||
}
|
||||
|
||||
/* Read the rest of this line (up to a newline or EOF) */
|
||||
|
||||
do
|
||||
{
|
||||
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
|
||||
{
|
||||
if (FileByte == '/')
|
||||
{
|
||||
FileByte = '*';
|
||||
}
|
||||
}
|
||||
|
||||
FlWriteFile (FileId, &FileByte, 1);
|
||||
if (FileByte == '\n')
|
||||
{
|
||||
/*
|
||||
* This line has been completed.
|
||||
* Check if an error occurred on this source line during the compile.
|
||||
* If so, we print the error message after the source line.
|
||||
*/
|
||||
LsCheckException (Gbl_SourceLine, FileId);
|
||||
return (1);
|
||||
}
|
||||
|
||||
} while (FlReadFile (ASL_FILE_SOURCE_OUTPUT, &FileByte, 1) == AE_OK);
|
||||
|
||||
/* EOF on the input file was reached */
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsFinishSourceListing
|
||||
*
|
||||
* PARAMETERS: FileId - ID of current listing file.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Cleanup routine for the listing file. Flush the hex AML
|
||||
* listing buffer, and flush out any remaining lines in the
|
||||
* source input file.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
LsFinishSourceListing (
|
||||
UINT32 FileId)
|
||||
static ACPI_STATUS
|
||||
LsTreeWriteWalk (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Level,
|
||||
void *Context)
|
||||
{
|
||||
|
||||
if ((FileId == ASL_FILE_ASM_INCLUDE_OUTPUT) ||
|
||||
(FileId == ASL_FILE_C_INCLUDE_OUTPUT))
|
||||
{
|
||||
return;
|
||||
}
|
||||
/* Debug output */
|
||||
|
||||
LsFlushListingBuffer (FileId);
|
||||
Gbl_CurrentAmlOffset = 0;
|
||||
DbgPrint (ASL_TREE_OUTPUT,
|
||||
"%5.5d [%2d]", Op->Asl.LogicalLineNumber, Level);
|
||||
UtPrintFormattedName (Op->Asl.ParseOpcode, Level);
|
||||
|
||||
/* Flush any remaining text in the source file */
|
||||
|
||||
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
|
||||
{
|
||||
FlPrintFile (FileId, " /*\n");
|
||||
}
|
||||
|
||||
while (LsWriteOneSourceLine (FileId))
|
||||
{ ; }
|
||||
|
||||
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
|
||||
{
|
||||
FlPrintFile (FileId, "\n */\n };\n");
|
||||
}
|
||||
|
||||
FlPrintFile (FileId, "\n");
|
||||
|
||||
if (FileId == ASL_FILE_LISTING_OUTPUT)
|
||||
{
|
||||
/* Print a summary of the compile exceptions */
|
||||
|
||||
FlPrintFile (FileId, "\n\nSummary of errors and warnings\n\n");
|
||||
AePrintErrorLog (FileId);
|
||||
FlPrintFile (FileId, "\n");
|
||||
UtDisplaySummary (FileId);
|
||||
FlPrintFile (FileId, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsWriteSourceLines
|
||||
*
|
||||
* PARAMETERS: ToLineNumber -
|
||||
* ToLogicalLineNumber - Write up to this source line number
|
||||
* FileId - ID of current listing file
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Read then write source lines to the listing file until we have
|
||||
* reached the specified logical (cumulative) line number. This
|
||||
* automatically echos out comment blocks and other non-AML
|
||||
* generating text until we get to the actual AML-generating line
|
||||
* of ASL code specified by the logical line number.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
LsWriteSourceLines (
|
||||
UINT32 ToLineNumber,
|
||||
UINT32 ToLogicalLineNumber,
|
||||
UINT32 FileId)
|
||||
{
|
||||
|
||||
if ((FileId == ASL_FILE_ASM_INCLUDE_OUTPUT) ||
|
||||
(FileId == ASL_FILE_C_INCLUDE_OUTPUT))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Gbl_CurrentLine = ToLogicalLineNumber;
|
||||
|
||||
/* Flush any hex bytes remaining from the last opcode */
|
||||
|
||||
LsFlushListingBuffer (FileId);
|
||||
|
||||
/* Read lines and write them as long as we are not caught up */
|
||||
|
||||
if (Gbl_SourceLine < Gbl_CurrentLine)
|
||||
{
|
||||
/*
|
||||
* If we just completed writing some AML hex bytes, output a linefeed
|
||||
* to add some whitespace for readability.
|
||||
*/
|
||||
if (Gbl_HexBytesWereWritten)
|
||||
{
|
||||
FlPrintFile (FileId, "\n");
|
||||
Gbl_HexBytesWereWritten = FALSE;
|
||||
}
|
||||
|
||||
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
|
||||
{
|
||||
FlPrintFile (FileId, " /*\n");
|
||||
}
|
||||
|
||||
/* Write one line at a time until we have reached the target line # */
|
||||
|
||||
while ((Gbl_SourceLine < Gbl_CurrentLine) &&
|
||||
LsWriteOneSourceLine (FileId))
|
||||
{ ; }
|
||||
|
||||
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
|
||||
{
|
||||
FlPrintFile (FileId, " */");
|
||||
}
|
||||
FlPrintFile (FileId, "\n");
|
||||
}
|
||||
DbgPrint (ASL_TREE_OUTPUT, "\n");
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
@ -938,7 +276,7 @@ LsWriteSourceLines (
|
||||
*
|
||||
* FUNCTION: LsWriteNodeToListing
|
||||
*
|
||||
* PARAMETERS: Op - Parse node to write to the listing file.
|
||||
* PARAMETERS: Op - Parse node to write to the listing file.
|
||||
* FileId - ID of current listing file
|
||||
*
|
||||
* RETURN: None.
|
||||
@ -1244,3 +582,61 @@ LsWriteNodeToListing (
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsFinishSourceListing
|
||||
*
|
||||
* PARAMETERS: FileId - ID of current listing file.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Cleanup routine for the listing file. Flush the hex AML
|
||||
* listing buffer, and flush out any remaining lines in the
|
||||
* source input file.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
LsFinishSourceListing (
|
||||
UINT32 FileId)
|
||||
{
|
||||
|
||||
if ((FileId == ASL_FILE_ASM_INCLUDE_OUTPUT) ||
|
||||
(FileId == ASL_FILE_C_INCLUDE_OUTPUT))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LsFlushListingBuffer (FileId);
|
||||
Gbl_CurrentAmlOffset = 0;
|
||||
|
||||
/* Flush any remaining text in the source file */
|
||||
|
||||
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
|
||||
{
|
||||
FlPrintFile (FileId, " /*\n");
|
||||
}
|
||||
|
||||
while (LsWriteOneSourceLine (FileId))
|
||||
{ ; }
|
||||
|
||||
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
|
||||
{
|
||||
FlPrintFile (FileId, "\n */\n };\n");
|
||||
}
|
||||
|
||||
FlPrintFile (FileId, "\n");
|
||||
|
||||
if (FileId == ASL_FILE_LISTING_OUTPUT)
|
||||
{
|
||||
/* Print a summary of the compile exceptions */
|
||||
|
||||
FlPrintFile (FileId, "\n\nSummary of errors and warnings\n\n");
|
||||
AePrintErrorLog (FileId);
|
||||
FlPrintFile (FileId, "\n");
|
||||
UtDisplaySummary (FileId);
|
||||
FlPrintFile (FileId, "\n");
|
||||
}
|
||||
}
|
||||
|
706
sys/contrib/dev/acpica/compiler/asllistsup.c
Normal file
706
sys/contrib/dev/acpica/compiler/asllistsup.c
Normal file
@ -0,0 +1,706 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: asllistsup - Listing file support utilities
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2013, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* NO WARRANTY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include "aslcompiler.y.h"
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("aslistsup")
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsDumpAscii
|
||||
*
|
||||
* PARAMETERS: FileId - ID of current listing file
|
||||
* Count - Number of bytes to convert
|
||||
* Buffer - Buffer of bytes to convert
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Convert hex bytes to ascii
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
LsDumpAscii (
|
||||
UINT32 FileId,
|
||||
UINT32 Count,
|
||||
UINT8 *Buffer)
|
||||
{
|
||||
UINT8 BufChar;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
FlPrintFile (FileId, " \"");
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
BufChar = Buffer[i];
|
||||
if (isprint (BufChar))
|
||||
{
|
||||
FlPrintFile (FileId, "%c", BufChar);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Not a printable character, just put out a dot */
|
||||
|
||||
FlPrintFile (FileId, ".");
|
||||
}
|
||||
}
|
||||
FlPrintFile (FileId, "\"");
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsDumpAsciiInComment
|
||||
*
|
||||
* PARAMETERS: FileId - ID of current listing file
|
||||
* Count - Number of bytes to convert
|
||||
* Buffer - Buffer of bytes to convert
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Convert hex bytes to ascii
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
LsDumpAsciiInComment (
|
||||
UINT32 FileId,
|
||||
UINT32 Count,
|
||||
UINT8 *Buffer)
|
||||
{
|
||||
UINT8 BufChar = 0;
|
||||
UINT8 LastChar;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
FlPrintFile (FileId, " \"");
|
||||
for (i = 0; i < Count; i++)
|
||||
{
|
||||
LastChar = BufChar;
|
||||
BufChar = Buffer[i];
|
||||
|
||||
if (isprint (BufChar))
|
||||
{
|
||||
/* Handle embedded C comment sequences */
|
||||
|
||||
if (((LastChar == '*') && (BufChar == '/')) ||
|
||||
((LastChar == '/') && (BufChar == '*')))
|
||||
{
|
||||
/* Insert a space to break the sequence */
|
||||
|
||||
FlPrintFile (FileId, ".", BufChar);
|
||||
}
|
||||
|
||||
FlPrintFile (FileId, "%c", BufChar);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Not a printable character, just put out a dot */
|
||||
|
||||
FlPrintFile (FileId, ".");
|
||||
}
|
||||
}
|
||||
|
||||
FlPrintFile (FileId, "\"");
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsCheckException
|
||||
*
|
||||
* PARAMETERS: LineNumber - Current logical (cumulative) line #
|
||||
* FileId - ID of output listing file
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Check if there is an exception for this line, and if there is,
|
||||
* put it in the listing immediately. Handles multiple errors
|
||||
* per line. Gbl_NextError points to the next error in the
|
||||
* sorted (by line #) list of compile errors/warnings.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
LsCheckException (
|
||||
UINT32 LineNumber,
|
||||
UINT32 FileId)
|
||||
{
|
||||
|
||||
if ((!Gbl_NextError) ||
|
||||
(LineNumber < Gbl_NextError->LogicalLineNumber ))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Handle multiple errors per line */
|
||||
|
||||
if (FileId == ASL_FILE_LISTING_OUTPUT)
|
||||
{
|
||||
while (Gbl_NextError &&
|
||||
(LineNumber >= Gbl_NextError->LogicalLineNumber))
|
||||
{
|
||||
AePrintException (FileId, Gbl_NextError, "\n[****iasl****]\n");
|
||||
|
||||
Gbl_NextError = Gbl_NextError->Next;
|
||||
}
|
||||
|
||||
FlPrintFile (FileId, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsWriteListingHexBytes
|
||||
*
|
||||
* PARAMETERS: Buffer - AML code buffer
|
||||
* Length - Number of AML bytes to write
|
||||
* FileId - ID of current listing file.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Write the contents of the AML buffer to the listing file via
|
||||
* the listing buffer. The listing buffer is flushed every 16
|
||||
* AML bytes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
LsWriteListingHexBytes (
|
||||
UINT8 *Buffer,
|
||||
UINT32 Length,
|
||||
UINT32 FileId)
|
||||
{
|
||||
UINT32 i;
|
||||
|
||||
|
||||
/* Transfer all requested bytes */
|
||||
|
||||
for (i = 0; i < Length; i++)
|
||||
{
|
||||
/* Print line header when buffer is empty */
|
||||
|
||||
if (Gbl_CurrentHexColumn == 0)
|
||||
{
|
||||
if (Gbl_HasIncludeFiles)
|
||||
{
|
||||
FlPrintFile (FileId, "%*s", 10, " ");
|
||||
}
|
||||
|
||||
switch (FileId)
|
||||
{
|
||||
case ASL_FILE_LISTING_OUTPUT:
|
||||
|
||||
FlPrintFile (FileId, "%8.8X%s", Gbl_CurrentAmlOffset,
|
||||
ASL_LISTING_LINE_PREFIX);
|
||||
break;
|
||||
|
||||
case ASL_FILE_ASM_SOURCE_OUTPUT:
|
||||
|
||||
FlPrintFile (FileId, " db ");
|
||||
break;
|
||||
|
||||
case ASL_FILE_C_SOURCE_OUTPUT:
|
||||
|
||||
FlPrintFile (FileId, " ");
|
||||
break;
|
||||
|
||||
default:
|
||||
/* No other types supported */
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Transfer AML byte and update counts */
|
||||
|
||||
Gbl_AmlBuffer[Gbl_CurrentHexColumn] = Buffer[i];
|
||||
|
||||
Gbl_CurrentHexColumn++;
|
||||
Gbl_CurrentAmlOffset++;
|
||||
|
||||
/* Flush buffer when it is full */
|
||||
|
||||
if (Gbl_CurrentHexColumn >= HEX_LISTING_LINE_SIZE)
|
||||
{
|
||||
LsFlushListingBuffer (FileId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsWriteSourceLines
|
||||
*
|
||||
* PARAMETERS: ToLineNumber -
|
||||
* ToLogicalLineNumber - Write up to this source line number
|
||||
* FileId - ID of current listing file
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Read then write source lines to the listing file until we have
|
||||
* reached the specified logical (cumulative) line number. This
|
||||
* automatically echos out comment blocks and other non-AML
|
||||
* generating text until we get to the actual AML-generating line
|
||||
* of ASL code specified by the logical line number.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
LsWriteSourceLines (
|
||||
UINT32 ToLineNumber,
|
||||
UINT32 ToLogicalLineNumber,
|
||||
UINT32 FileId)
|
||||
{
|
||||
|
||||
/* Nothing to do for these file types */
|
||||
|
||||
if ((FileId == ASL_FILE_ASM_INCLUDE_OUTPUT) ||
|
||||
(FileId == ASL_FILE_C_INCLUDE_OUTPUT))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Gbl_CurrentLine = ToLogicalLineNumber;
|
||||
|
||||
/* Flush any hex bytes remaining from the last opcode */
|
||||
|
||||
LsFlushListingBuffer (FileId);
|
||||
|
||||
/* Read lines and write them as long as we are not caught up */
|
||||
|
||||
if (Gbl_SourceLine < Gbl_CurrentLine)
|
||||
{
|
||||
/*
|
||||
* If we just completed writing some AML hex bytes, output a linefeed
|
||||
* to add some whitespace for readability.
|
||||
*/
|
||||
if (Gbl_HexBytesWereWritten)
|
||||
{
|
||||
FlPrintFile (FileId, "\n");
|
||||
Gbl_HexBytesWereWritten = FALSE;
|
||||
}
|
||||
|
||||
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
|
||||
{
|
||||
FlPrintFile (FileId, " /*\n");
|
||||
}
|
||||
|
||||
/* Write one line at a time until we have reached the target line # */
|
||||
|
||||
while ((Gbl_SourceLine < Gbl_CurrentLine) &&
|
||||
LsWriteOneSourceLine (FileId))
|
||||
{ ; }
|
||||
|
||||
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
|
||||
{
|
||||
FlPrintFile (FileId, " */");
|
||||
}
|
||||
|
||||
FlPrintFile (FileId, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsWriteOneSourceLine
|
||||
*
|
||||
* PARAMETERS: FileId - ID of current listing file
|
||||
*
|
||||
* RETURN: FALSE on EOF (input source file), TRUE otherwise
|
||||
*
|
||||
* DESCRIPTION: Read one line from the input source file and echo it to the
|
||||
* listing file, prefixed with the line number, and if the source
|
||||
* file contains include files, prefixed with the current filename
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
UINT32
|
||||
LsWriteOneSourceLine (
|
||||
UINT32 FileId)
|
||||
{
|
||||
UINT8 FileByte;
|
||||
UINT32 Column = 0;
|
||||
UINT32 Index = 16;
|
||||
BOOLEAN StartOfLine = FALSE;
|
||||
BOOLEAN ProcessLongLine = FALSE;
|
||||
|
||||
|
||||
Gbl_SourceLine++;
|
||||
Gbl_ListingNode->LineNumber++;
|
||||
|
||||
/* Ignore lines that are completely blank (but count the line above) */
|
||||
|
||||
if (FlReadFile (ASL_FILE_SOURCE_OUTPUT, &FileByte, 1) != AE_OK)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
if (FileByte == '\n')
|
||||
{
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* This is a non-empty line, we will print the entire line with
|
||||
* the line number and possibly other prefixes and transforms.
|
||||
*/
|
||||
|
||||
/* Line prefixes for special files, C and ASM output */
|
||||
|
||||
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
|
||||
{
|
||||
FlPrintFile (FileId, " *");
|
||||
}
|
||||
if (FileId == ASL_FILE_ASM_SOURCE_OUTPUT)
|
||||
{
|
||||
FlPrintFile (FileId, "; ");
|
||||
}
|
||||
|
||||
if (Gbl_HasIncludeFiles)
|
||||
{
|
||||
/*
|
||||
* This file contains "include" statements, print the current
|
||||
* filename and line number within the current file
|
||||
*/
|
||||
FlPrintFile (FileId, "%12s %5d%s",
|
||||
Gbl_ListingNode->Filename, Gbl_ListingNode->LineNumber,
|
||||
ASL_LISTING_LINE_PREFIX);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No include files, just print the line number */
|
||||
|
||||
FlPrintFile (FileId, "%8u%s", Gbl_SourceLine,
|
||||
ASL_LISTING_LINE_PREFIX);
|
||||
}
|
||||
|
||||
/* Read the rest of this line (up to a newline or EOF) */
|
||||
|
||||
do
|
||||
{
|
||||
if (FileId == ASL_FILE_C_SOURCE_OUTPUT)
|
||||
{
|
||||
if (FileByte == '/')
|
||||
{
|
||||
FileByte = '*';
|
||||
}
|
||||
}
|
||||
|
||||
/* Split long input lines for readability in the listing */
|
||||
|
||||
Column++;
|
||||
if (Column >= 128)
|
||||
{
|
||||
if (!ProcessLongLine)
|
||||
{
|
||||
if ((FileByte != '}') &&
|
||||
(FileByte != '{'))
|
||||
{
|
||||
goto WriteByte;
|
||||
}
|
||||
|
||||
ProcessLongLine = TRUE;
|
||||
}
|
||||
|
||||
if (FileByte == '{')
|
||||
{
|
||||
FlPrintFile (FileId, "\n%*s{\n", Index, " ");
|
||||
StartOfLine = TRUE;
|
||||
Index += 4;
|
||||
continue;
|
||||
}
|
||||
|
||||
else if (FileByte == '}')
|
||||
{
|
||||
if (!StartOfLine)
|
||||
{
|
||||
FlPrintFile (FileId, "\n");
|
||||
}
|
||||
|
||||
StartOfLine = TRUE;
|
||||
Index -= 4;
|
||||
FlPrintFile (FileId, "%*s}\n", Index, " ");
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Ignore spaces/tabs at the start of line */
|
||||
|
||||
else if ((FileByte == ' ') && StartOfLine)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
else if (StartOfLine)
|
||||
{
|
||||
StartOfLine = FALSE;
|
||||
FlPrintFile (FileId, "%*s", Index, " ");
|
||||
}
|
||||
|
||||
WriteByte:
|
||||
FlWriteFile (FileId, &FileByte, 1);
|
||||
if (FileByte == '\n')
|
||||
{
|
||||
/*
|
||||
* This line has been completed.
|
||||
* Check if an error occurred on this source line during the compile.
|
||||
* If so, we print the error message after the source line.
|
||||
*/
|
||||
LsCheckException (Gbl_SourceLine, FileId);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FlWriteFile (FileId, &FileByte, 1);
|
||||
if (FileByte == '\n')
|
||||
{
|
||||
/*
|
||||
* This line has been completed.
|
||||
* Check if an error occurred on this source line during the compile.
|
||||
* If so, we print the error message after the source line.
|
||||
*/
|
||||
LsCheckException (Gbl_SourceLine, FileId);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
} while (FlReadFile (ASL_FILE_SOURCE_OUTPUT, &FileByte, 1) == AE_OK);
|
||||
|
||||
/* EOF on the input file was reached */
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsFlushListingBuffer
|
||||
*
|
||||
* PARAMETERS: FileId - ID of the listing file
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Flush out the current contents of the 16-byte hex AML code
|
||||
* buffer. Usually called at the termination of a single line
|
||||
* of source code or when the buffer is full.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
LsFlushListingBuffer (
|
||||
UINT32 FileId)
|
||||
{
|
||||
UINT32 i;
|
||||
|
||||
|
||||
if (Gbl_CurrentHexColumn == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Write the hex bytes */
|
||||
|
||||
switch (FileId)
|
||||
{
|
||||
case ASL_FILE_LISTING_OUTPUT:
|
||||
|
||||
for (i = 0; i < Gbl_CurrentHexColumn; i++)
|
||||
{
|
||||
FlPrintFile (FileId, "%2.2X ", Gbl_AmlBuffer[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < ((HEX_LISTING_LINE_SIZE - Gbl_CurrentHexColumn) * 3); i++)
|
||||
{
|
||||
FlWriteFile (FileId, ".", 1);
|
||||
}
|
||||
|
||||
/* Write the ASCII character associated with each of the bytes */
|
||||
|
||||
LsDumpAscii (FileId, Gbl_CurrentHexColumn, Gbl_AmlBuffer);
|
||||
break;
|
||||
|
||||
|
||||
case ASL_FILE_ASM_SOURCE_OUTPUT:
|
||||
|
||||
for (i = 0; i < Gbl_CurrentHexColumn; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
FlPrintFile (FileId, ",");
|
||||
}
|
||||
FlPrintFile (FileId, "0%2.2Xh", Gbl_AmlBuffer[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < ((HEX_LISTING_LINE_SIZE - Gbl_CurrentHexColumn) * 5); i++)
|
||||
{
|
||||
FlWriteFile (FileId, " ", 1);
|
||||
}
|
||||
|
||||
FlPrintFile (FileId, " ;%8.8X",
|
||||
Gbl_CurrentAmlOffset - HEX_LISTING_LINE_SIZE);
|
||||
|
||||
/* Write the ASCII character associated with each of the bytes */
|
||||
|
||||
LsDumpAscii (FileId, Gbl_CurrentHexColumn, Gbl_AmlBuffer);
|
||||
break;
|
||||
|
||||
|
||||
case ASL_FILE_C_SOURCE_OUTPUT:
|
||||
|
||||
for (i = 0; i < Gbl_CurrentHexColumn; i++)
|
||||
{
|
||||
FlPrintFile (FileId, "0x%2.2X,", Gbl_AmlBuffer[i]);
|
||||
}
|
||||
|
||||
/* Pad hex output with spaces if line is shorter than max line size */
|
||||
|
||||
for (i = 0; i < ((HEX_LISTING_LINE_SIZE - Gbl_CurrentHexColumn) * 5); i++)
|
||||
{
|
||||
FlWriteFile (FileId, " ", 1);
|
||||
}
|
||||
|
||||
/* AML offset for the start of the line */
|
||||
|
||||
FlPrintFile (FileId, " /* %8.8X",
|
||||
Gbl_CurrentAmlOffset - Gbl_CurrentHexColumn);
|
||||
|
||||
/* Write the ASCII character associated with each of the bytes */
|
||||
|
||||
LsDumpAsciiInComment (FileId, Gbl_CurrentHexColumn, Gbl_AmlBuffer);
|
||||
FlPrintFile (FileId, " */");
|
||||
break;
|
||||
|
||||
default:
|
||||
/* No other types supported */
|
||||
return;
|
||||
}
|
||||
|
||||
FlPrintFile (FileId, "\n");
|
||||
|
||||
Gbl_CurrentHexColumn = 0;
|
||||
Gbl_HexBytesWereWritten = TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsPushNode
|
||||
*
|
||||
* PARAMETERS: Filename - Pointer to the include filename
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Push a listing node on the listing/include file stack. This
|
||||
* stack enables tracking of include files (infinitely nested)
|
||||
* and resumption of the listing of the parent file when the
|
||||
* include file is finished.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
LsPushNode (
|
||||
char *Filename)
|
||||
{
|
||||
ASL_LISTING_NODE *Lnode;
|
||||
|
||||
|
||||
/* Create a new node */
|
||||
|
||||
Lnode = UtLocalCalloc (sizeof (ASL_LISTING_NODE));
|
||||
|
||||
/* Initialize */
|
||||
|
||||
Lnode->Filename = Filename;
|
||||
Lnode->LineNumber = 0;
|
||||
|
||||
/* Link (push) */
|
||||
|
||||
Lnode->Next = Gbl_ListingNode;
|
||||
Gbl_ListingNode = Lnode;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsPopNode
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: List head after current head is popped off
|
||||
*
|
||||
* DESCRIPTION: Pop the current head of the list, free it, and return the
|
||||
* next node on the stack (the new current node).
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ASL_LISTING_NODE *
|
||||
LsPopNode (
|
||||
void)
|
||||
{
|
||||
ASL_LISTING_NODE *Lnode;
|
||||
|
||||
|
||||
/* Just grab the node at the head of the list */
|
||||
|
||||
Lnode = Gbl_ListingNode;
|
||||
if ((!Lnode) ||
|
||||
(!Lnode->Next))
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, NULL,
|
||||
"Could not pop empty listing stack");
|
||||
return (Gbl_ListingNode);
|
||||
}
|
||||
|
||||
Gbl_ListingNode = Lnode->Next;
|
||||
ACPI_FREE (Lnode);
|
||||
|
||||
/* New "Current" node is the new head */
|
||||
|
||||
return (Gbl_ListingNode);
|
||||
}
|
@ -156,6 +156,7 @@ Options (
|
||||
ACPI_OPTION ("-sc -sa", "Create source file in C or assembler (*.c or *.asm)");
|
||||
ACPI_OPTION ("-ic -ia", "Create include file in C or assembler (*.h or *.inc)");
|
||||
ACPI_OPTION ("-tc -ta -ts", "Create hex AML table in C, assembler, or ASL (*.hex)");
|
||||
ACPI_OPTION ("-so", "Create offset table in C (*.offset.h)");
|
||||
|
||||
printf ("\nOptional Listing Files:\n");
|
||||
ACPI_OPTION ("-l", "Create mixed listing file (ASL source and AML) (*.lst)");
|
||||
@ -784,6 +785,13 @@ AslDoOptions (
|
||||
Gbl_C_OutputFlag = TRUE;
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
|
||||
/* Produce AML offset table in C */
|
||||
|
||||
Gbl_C_OffsetTableFlag = TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
printf ("Unknown option: -s%s\n", AcpiGbl_Optarg);
|
||||
return (-1);
|
||||
|
326
sys/contrib/dev/acpica/compiler/asloffset.c
Normal file
326
sys/contrib/dev/acpica/compiler/asloffset.c
Normal file
@ -0,0 +1,326 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: asloffset - Generate a C "offset table" for BIOS use.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2013, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* NO WARRANTY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include "aslcompiler.y.h"
|
||||
#include <contrib/dev/acpica/include/amlcode.h>
|
||||
#include <contrib/dev/acpica/include/acnamesp.h>
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_COMPILER
|
||||
ACPI_MODULE_NAME ("asloffset")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
LsEmitOffsetTableEntry (
|
||||
UINT32 FileId,
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
UINT32 Offset,
|
||||
UINT32 Length,
|
||||
char *OpName,
|
||||
UINT64 Value,
|
||||
UINT8 AmlOpcode);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsAmlOffsetWalk
|
||||
*
|
||||
* PARAMETERS: ASL_WALK_CALLBACK
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Process one node during a offset table file generation.
|
||||
*
|
||||
* Three types of objects are currently emitted to the offset table:
|
||||
* 1) Tagged (named) resource descriptors
|
||||
* 2) Named integer objects with constant integer values
|
||||
* 3) Operation Regions that have constant Offset (address) parameters
|
||||
*
|
||||
* The offset table allows the BIOS to dynamically update the values of these
|
||||
* objects at boot time.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
LsAmlOffsetWalk (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 Level,
|
||||
void *Context)
|
||||
{
|
||||
UINT32 FileId = (UINT32) ACPI_TO_INTEGER (Context);
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
UINT32 Length;
|
||||
UINT32 OffsetOfOpcode;
|
||||
ACPI_PARSE_OBJECT *AddressOp;
|
||||
|
||||
|
||||
/* Ignore actual data blocks for resource descriptors */
|
||||
|
||||
if (Op->Asl.CompileFlags & NODE_IS_RESOURCE_DATA)
|
||||
{
|
||||
return (AE_OK); /* Do NOT update the global AML offset */
|
||||
}
|
||||
|
||||
/* We are only interested in named objects (have a namespace node) */
|
||||
|
||||
Node = Op->Asl.Node;
|
||||
if (!Node)
|
||||
{
|
||||
Gbl_CurrentAmlOffset += Op->Asl.FinalAmlLength;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* Named resource descriptor (has a descriptor tag) */
|
||||
|
||||
if ((Node->Type == ACPI_TYPE_LOCAL_RESOURCE) &&
|
||||
(Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC))
|
||||
{
|
||||
LsEmitOffsetTableEntry (FileId, Node, Gbl_CurrentAmlOffset,
|
||||
Op->Asl.FinalAmlLength, Op->Asl.ParseOpName, 0, Op->Asl.Extra);
|
||||
}
|
||||
|
||||
/* Named object -- Name (NameString, DataRefObject) */
|
||||
|
||||
else if (Op->Asl.AmlOpcode == AML_NAME_OP)
|
||||
{
|
||||
if (!Op->Asl.Child)
|
||||
{
|
||||
FlPrintFile (FileId, "%s NO CHILD!\n", MsgBuffer);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
Length = Op->Asl.FinalAmlLength;
|
||||
|
||||
/* Get to the NameSeg/NamePath Op (and length of the name) */
|
||||
|
||||
Op = Op->Asl.Child;
|
||||
OffsetOfOpcode = Length + Op->Asl.FinalAmlLength;
|
||||
|
||||
/* Get actual value associated with the name */
|
||||
|
||||
Op = Op->Asl.Next;
|
||||
switch (Op->Asl.AmlOpcode)
|
||||
{
|
||||
/*
|
||||
* We are only interested in integer constants that can be changed
|
||||
* at boot time. Note, the One/Ones/Zero opcodes are considered
|
||||
* non-changeable, so we ignore them here.
|
||||
*/
|
||||
case AML_BYTE_OP:
|
||||
case AML_WORD_OP:
|
||||
case AML_DWORD_OP:
|
||||
case AML_QWORD_OP:
|
||||
|
||||
/* The +1/-1 is to handle the integer size prefix (opcode) */
|
||||
|
||||
LsEmitOffsetTableEntry (FileId, Node,
|
||||
(Gbl_CurrentAmlOffset + OffsetOfOpcode + 1),
|
||||
(Op->Asl.FinalAmlLength - 1), Op->Asl.ParseOpName,
|
||||
Op->Asl.Value.Integer, (UINT8) Op->Asl.AmlOpcode);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Gbl_CurrentAmlOffset += Length;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* OperationRegion (NameString, RegionSpace, RegionOffset, RegionLength) */
|
||||
|
||||
else if (Op->Asl.AmlOpcode == AML_REGION_OP)
|
||||
{
|
||||
Length = Op->Asl.FinalAmlLength;
|
||||
|
||||
/* Get the name/namepath node */
|
||||
|
||||
AddressOp = Op->Asl.Child;
|
||||
OffsetOfOpcode = Length + AddressOp->Asl.FinalAmlLength + 1;
|
||||
|
||||
/* Get the SpaceId node, then the Offset (address) node */
|
||||
|
||||
AddressOp = AddressOp->Asl.Next;
|
||||
AddressOp = AddressOp->Asl.Next;
|
||||
|
||||
switch (AddressOp->Asl.AmlOpcode)
|
||||
{
|
||||
/*
|
||||
* We are only interested in integer constants that can be changed
|
||||
* at boot time. Note, the One/Ones/Zero opcodes are considered
|
||||
* non-changeable, so we ignore them here.
|
||||
*/
|
||||
case AML_BYTE_OP:
|
||||
case AML_WORD_OP:
|
||||
case AML_DWORD_OP:
|
||||
case AML_QWORD_OP:
|
||||
|
||||
/* The +1/-1 is to handle the integer size prefix (opcode) */
|
||||
|
||||
LsEmitOffsetTableEntry (FileId, Node,
|
||||
(Gbl_CurrentAmlOffset + OffsetOfOpcode + 1),
|
||||
(AddressOp->Asl.FinalAmlLength - 1), Op->Asl.ParseOpName,
|
||||
AddressOp->Asl.Value.Integer, (UINT8) AddressOp->Asl.AmlOpcode);
|
||||
|
||||
Gbl_CurrentAmlOffset += Length;
|
||||
return (AE_OK);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Gbl_CurrentAmlOffset += Op->Asl.FinalAmlLength;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsEmitOffsetTableEntry
|
||||
*
|
||||
* PARAMETERS: FileId - ID of current listing file
|
||||
* Node - Namespace node associated with the name
|
||||
* Offset - Offset of the value within the AML table
|
||||
* Length - Length in bytes of the value
|
||||
* OpName - Name of the AML opcode
|
||||
* Value - Current value of the AML field
|
||||
* AmlOpcode - Opcode associated with the field
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Emit a line of the offset table (-so option)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
LsEmitOffsetTableEntry (
|
||||
UINT32 FileId,
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
UINT32 Offset,
|
||||
UINT32 Length,
|
||||
char *OpName,
|
||||
UINT64 Value,
|
||||
UINT8 AmlOpcode)
|
||||
{
|
||||
ACPI_BUFFER TargetPath;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
/* Get the full pathname to the namespace node */
|
||||
|
||||
TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
|
||||
Status = AcpiNsHandleToPathname (Node, &TargetPath);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* [1] - Skip the opening backslash for the path */
|
||||
|
||||
strcpy (MsgBuffer, "\"");
|
||||
strcat (MsgBuffer, &((char *) TargetPath.Pointer)[1]);
|
||||
strcat (MsgBuffer, "\",");
|
||||
ACPI_FREE (TargetPath.Pointer);
|
||||
|
||||
/*
|
||||
* Max offset is 4G, constrained by 32-bit ACPI table length.
|
||||
* Max Length for Integers is 8 bytes.
|
||||
*/
|
||||
FlPrintFile (FileId,
|
||||
" {%-29s 0x%8.8X, 0x%2.2X, 0x%8.8X%8.8X}, /* %s */\n",
|
||||
MsgBuffer, Offset, AmlOpcode, ACPI_FORMAT_UINT64 (Value), OpName);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: LsDoOffsetTableHeader, LsDoOffsetTableFooter
|
||||
*
|
||||
* PARAMETERS: FileId - ID of current listing file
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Header and footer for the offset table file.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
LsDoOffsetTableHeader (
|
||||
UINT32 FileId)
|
||||
{
|
||||
|
||||
Gbl_CurrentAmlOffset = 0;
|
||||
|
||||
FlPrintFile (FileId,
|
||||
"#ifndef __AML_OFFSET_TABLE_H\n"
|
||||
"#define __AML_OFFSET_TABLE_H\n\n");
|
||||
|
||||
FlPrintFile (FileId, "typedef struct {\n"
|
||||
" char *Pathname;\n"
|
||||
" unsigned long Offset;\n"
|
||||
" unsigned char AmlOpcode;\n"
|
||||
" unsigned long long AmlValue;\n"
|
||||
"} AML_OFFSET_TABLE_ENTRY;\n\n");
|
||||
|
||||
FlPrintFile (FileId,
|
||||
"#endif /* __AML_OFFSET_TABLE_H */\n\n");
|
||||
|
||||
FlPrintFile (FileId,
|
||||
"AML_OFFSET_TABLE_ENTRY %s_%s_OffsetTable[] =\n{\n",
|
||||
Gbl_TableSignature, Gbl_TableId);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LsDoOffsetTableFooter (
|
||||
UINT32 FileId)
|
||||
{
|
||||
|
||||
FlPrintFile (FileId,
|
||||
" {0,0,0,0} /* Table terminator */\n};\n\n");
|
||||
Gbl_CurrentAmlOffset = 0;
|
||||
}
|
@ -42,6 +42,7 @@
|
||||
*/
|
||||
|
||||
#define ACPI_CREATE_PREDEFINED_TABLE
|
||||
#define ACPI_CREATE_RESOURCE_TABLE
|
||||
|
||||
#include <contrib/dev/acpica/compiler/aslcompiler.h>
|
||||
#include "aslcompiler.y.h"
|
||||
@ -65,90 +66,6 @@ ApCheckForSpecialName (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
char *Name);
|
||||
|
||||
static void
|
||||
ApGetExpectedTypes (
|
||||
char *Buffer,
|
||||
UINT32 ExpectedBtypes);
|
||||
|
||||
|
||||
/*
|
||||
* Names for the types that can be returned by the predefined objects.
|
||||
* Used for warning messages. Must be in the same order as the ACPI_RTYPEs
|
||||
*/
|
||||
static const char *AcpiRtypeNames[] =
|
||||
{
|
||||
"/Integer",
|
||||
"/String",
|
||||
"/Buffer",
|
||||
"/Package",
|
||||
"/Reference",
|
||||
};
|
||||
|
||||
/*
|
||||
* Predefined names for use in Resource Descriptors. These names do not
|
||||
* appear in the global Predefined Name table (since these names never
|
||||
* appear in actual AML byte code, only in the original ASL)
|
||||
*/
|
||||
static const ACPI_PREDEFINED_INFO ResourceNames[] = {
|
||||
{{"_ALN", 0, 0}},
|
||||
{{"_ASI", 0, 0}},
|
||||
{{"_ASZ", 0, 0}},
|
||||
{{"_ATT", 0, 0}},
|
||||
{{"_BAS", 0, 0}},
|
||||
{{"_BM_", 0, 0}},
|
||||
{{"_DBT", 0, 0}}, /* Acpi 5.0 */
|
||||
{{"_DEC", 0, 0}},
|
||||
{{"_DPL", 0, 0}}, /* Acpi 5.0 */
|
||||
{{"_DRS", 0, 0}}, /* Acpi 5.0 */
|
||||
{{"_END", 0, 0}}, /* Acpi 5.0 */
|
||||
{{"_FLC", 0, 0}}, /* Acpi 5.0 */
|
||||
{{"_GRA", 0, 0}},
|
||||
{{"_HE_", 0, 0}},
|
||||
{{"_INT", 0, 0}},
|
||||
{{"_IOR", 0, 0}}, /* Acpi 5.0 */
|
||||
{{"_LEN", 0, 0}},
|
||||
{{"_LIN", 0, 0}}, /* Acpi 5.0 */
|
||||
{{"_LL_", 0, 0}},
|
||||
{{"_MAF", 0, 0}},
|
||||
{{"_MAX", 0, 0}},
|
||||
{{"_MEM", 0, 0}},
|
||||
{{"_MIF", 0, 0}},
|
||||
{{"_MIN", 0, 0}},
|
||||
{{"_MOD", 0, 0}}, /* Acpi 5.0 */
|
||||
{{"_MTP", 0, 0}},
|
||||
{{"_PAR", 0, 0}}, /* Acpi 5.0 */
|
||||
{{"_PHA", 0, 0}}, /* Acpi 5.0 */
|
||||
{{"_PIN", 0, 0}}, /* Acpi 5.0 */
|
||||
{{"_PPI", 0, 0}}, /* Acpi 5.0 */
|
||||
{{"_POL", 0, 0}}, /* Acpi 5.0 */
|
||||
{{"_RBO", 0, 0}},
|
||||
{{"_RBW", 0, 0}},
|
||||
{{"_RNG", 0, 0}},
|
||||
{{"_RT_", 0, 0}}, /* Acpi 3.0 */
|
||||
{{"_RW_", 0, 0}},
|
||||
{{"_RXL", 0, 0}}, /* Acpi 5.0 */
|
||||
{{"_SHR", 0, 0}},
|
||||
{{"_SIZ", 0, 0}},
|
||||
{{"_SLV", 0, 0}}, /* Acpi 5.0 */
|
||||
{{"_SPE", 0, 0}}, /* Acpi 5.0 */
|
||||
{{"_STB", 0, 0}}, /* Acpi 5.0 */
|
||||
{{"_TRA", 0, 0}},
|
||||
{{"_TRS", 0, 0}},
|
||||
{{"_TSF", 0, 0}}, /* Acpi 3.0 */
|
||||
{{"_TTP", 0, 0}},
|
||||
{{"_TXL", 0, 0}}, /* Acpi 5.0 */
|
||||
{{"_TYP", 0, 0}},
|
||||
{{"_VEN", 0, 0}}, /* Acpi 5.0 */
|
||||
{{{0,0,0,0}, 0, 0}} /* Table terminator */
|
||||
};
|
||||
|
||||
static const ACPI_PREDEFINED_INFO ScopeNames[] = {
|
||||
{{"_SB_", 0, 0}},
|
||||
{{"_SI_", 0, 0}},
|
||||
{{"_TZ_", 0, 0}},
|
||||
{{{0,0,0,0}, 0, 0}} /* Table terminator */
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -170,9 +87,9 @@ ApCheckForPredefinedMethod (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ASL_METHOD_INFO *MethodInfo)
|
||||
{
|
||||
UINT32 Index;
|
||||
UINT32 RequiredArgsCurrent;
|
||||
UINT32 RequiredArgsOld;
|
||||
UINT32 Index;
|
||||
UINT32 RequiredArgCount;
|
||||
const ACPI_PREDEFINED_INFO *ThisName;
|
||||
|
||||
|
||||
/* Check for a match against the predefined name list */
|
||||
@ -213,17 +130,16 @@ ApCheckForPredefinedMethod (
|
||||
* arg counts.
|
||||
*/
|
||||
Gbl_ReservedMethods++;
|
||||
ThisName = &AcpiGbl_PredefinedMethods[Index];
|
||||
RequiredArgCount = ThisName->Info.ArgumentList & METHOD_ARG_MASK;
|
||||
|
||||
RequiredArgsCurrent = PredefinedNames[Index].Info.ParamCount & 0x0F;
|
||||
RequiredArgsOld = PredefinedNames[Index].Info.ParamCount >> 4;
|
||||
|
||||
if ((MethodInfo->NumArguments != RequiredArgsCurrent) &&
|
||||
(MethodInfo->NumArguments != RequiredArgsOld))
|
||||
if (MethodInfo->NumArguments != RequiredArgCount)
|
||||
{
|
||||
sprintf (MsgBuffer, "%4.4s requires %u",
|
||||
PredefinedNames[Index].Info.Name, RequiredArgsCurrent);
|
||||
ThisName->Info.Name, RequiredArgCount);
|
||||
|
||||
if (MethodInfo->NumArguments > RequiredArgsCurrent)
|
||||
if ((MethodInfo->NumArguments > RequiredArgCount) &&
|
||||
!(ThisName->Info.ArgumentList & ARG_COUNT_IS_MINIMUM))
|
||||
{
|
||||
AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op,
|
||||
MsgBuffer);
|
||||
@ -240,13 +156,13 @@ ApCheckForPredefinedMethod (
|
||||
* required to return a value
|
||||
*/
|
||||
if (MethodInfo->NumReturnNoValue &&
|
||||
PredefinedNames[Index].Info.ExpectedBtypes)
|
||||
ThisName->Info.ExpectedBtypes)
|
||||
{
|
||||
ApGetExpectedTypes (StringBuffer,
|
||||
PredefinedNames[Index].Info.ExpectedBtypes);
|
||||
AcpiUtGetExpectedReturnTypes (StringBuffer,
|
||||
ThisName->Info.ExpectedBtypes);
|
||||
|
||||
sprintf (MsgBuffer, "%s required for %4.4s",
|
||||
StringBuffer, PredefinedNames[Index].Info.Name);
|
||||
StringBuffer, ThisName->Info.Name);
|
||||
|
||||
AslError (ASL_WARNING, ASL_MSG_RESERVED_RETURN_VALUE, Op,
|
||||
MsgBuffer);
|
||||
@ -329,8 +245,9 @@ ApCheckPredefinedReturnValue (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ASL_METHOD_INFO *MethodInfo)
|
||||
{
|
||||
UINT32 Index;
|
||||
ACPI_PARSE_OBJECT *ReturnValueOp;
|
||||
UINT32 Index;
|
||||
ACPI_PARSE_OBJECT *ReturnValueOp;
|
||||
const ACPI_PREDEFINED_INFO *ThisName;
|
||||
|
||||
|
||||
/* Check parent method for a match against the predefined name list */
|
||||
@ -356,7 +273,8 @@ ApCheckPredefinedReturnValue (
|
||||
|
||||
default: /* A standard predefined ACPI name */
|
||||
|
||||
if (!PredefinedNames[Index].Info.ExpectedBtypes)
|
||||
ThisName = &AcpiGbl_PredefinedMethods[Index];
|
||||
if (!ThisName->Info.ExpectedBtypes)
|
||||
{
|
||||
/* No return value expected, warn if there is one */
|
||||
|
||||
@ -379,16 +297,14 @@ ApCheckPredefinedReturnValue (
|
||||
|
||||
/* Static data return object - check against expected type */
|
||||
|
||||
ApCheckObjectType (PredefinedNames[Index].Info.Name,
|
||||
ReturnValueOp,
|
||||
PredefinedNames[Index].Info.ExpectedBtypes,
|
||||
ACPI_NOT_PACKAGE_ELEMENT);
|
||||
ApCheckObjectType (ThisName->Info.Name, ReturnValueOp,
|
||||
ThisName->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT);
|
||||
|
||||
/* For packages, check the individual package elements */
|
||||
|
||||
if (ReturnValueOp->Asl.ParseOpcode == PARSEOP_PACKAGE)
|
||||
{
|
||||
ApCheckPackage (ReturnValueOp, &PredefinedNames[Index]);
|
||||
ApCheckPackage (ReturnValueOp, ThisName);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -430,8 +346,9 @@ ApCheckForPredefinedObject (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
char *Name)
|
||||
{
|
||||
UINT32 Index;
|
||||
ACPI_PARSE_OBJECT *ObjectOp;
|
||||
UINT32 Index;
|
||||
ACPI_PARSE_OBJECT *ObjectOp;
|
||||
const ACPI_PREDEFINED_INFO *ThisName;
|
||||
|
||||
|
||||
/*
|
||||
@ -470,7 +387,8 @@ ApCheckForPredefinedObject (
|
||||
* If this predefined name requires input arguments, then
|
||||
* it must be implemented as a control method
|
||||
*/
|
||||
if (PredefinedNames[Index].Info.ParamCount > 0)
|
||||
ThisName = &AcpiGbl_PredefinedMethods[Index];
|
||||
if ((ThisName->Info.ArgumentList & METHOD_ARG_MASK) > 0)
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
|
||||
"with arguments");
|
||||
@ -483,7 +401,7 @@ ApCheckForPredefinedObject (
|
||||
* (with zero args, because the args > 0 case was handled above)
|
||||
* Examples are: _DIS, _INI, _IRC, _OFF, _ON, _PSx
|
||||
*/
|
||||
if (!PredefinedNames[Index].Info.ExpectedBtypes)
|
||||
if (!ThisName->Info.ExpectedBtypes)
|
||||
{
|
||||
AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
|
||||
"with zero arguments");
|
||||
@ -493,16 +411,14 @@ ApCheckForPredefinedObject (
|
||||
/* Typecheck the actual object, it is the next argument */
|
||||
|
||||
ObjectOp = Op->Asl.Child->Asl.Next;
|
||||
ApCheckObjectType (PredefinedNames[Index].Info.Name,
|
||||
Op->Asl.Child->Asl.Next,
|
||||
PredefinedNames[Index].Info.ExpectedBtypes,
|
||||
ACPI_NOT_PACKAGE_ELEMENT);
|
||||
ApCheckObjectType (ThisName->Info.Name, Op->Asl.Child->Asl.Next,
|
||||
ThisName->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT);
|
||||
|
||||
/* For packages, check the individual package elements */
|
||||
|
||||
if (ObjectOp->Asl.ParseOpcode == PARSEOP_PACKAGE)
|
||||
{
|
||||
ApCheckPackage (ObjectOp, &PredefinedNames[Index]);
|
||||
ApCheckPackage (ObjectOp, ThisName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -525,7 +441,8 @@ ApCheckForPredefinedName (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
char *Name)
|
||||
{
|
||||
UINT32 i;
|
||||
UINT32 i;
|
||||
const ACPI_PREDEFINED_INFO *ThisName;
|
||||
|
||||
|
||||
if (Name[0] == 0)
|
||||
@ -543,31 +460,40 @@ ApCheckForPredefinedName (
|
||||
|
||||
/* Check for a standard predefined method name */
|
||||
|
||||
for (i = 0; PredefinedNames[i].Info.Name[0]; i++)
|
||||
ThisName = AcpiGbl_PredefinedMethods;
|
||||
for (i = 0; ThisName->Info.Name[0]; i++)
|
||||
{
|
||||
if (ACPI_COMPARE_NAME (Name, PredefinedNames[i].Info.Name))
|
||||
if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name))
|
||||
{
|
||||
/* Return index into predefined array */
|
||||
return (i);
|
||||
}
|
||||
|
||||
ThisName++; /* Does not account for extra package data, but is OK */
|
||||
}
|
||||
|
||||
/* Check for resource names and predefined scope names */
|
||||
|
||||
for (i = 0; ResourceNames[i].Info.Name[0]; i++)
|
||||
ThisName = AcpiGbl_ResourceNames;
|
||||
while (ThisName->Info.Name[0])
|
||||
{
|
||||
if (ACPI_COMPARE_NAME (Name, ResourceNames[i].Info.Name))
|
||||
if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name))
|
||||
{
|
||||
return (ACPI_PREDEFINED_NAME);
|
||||
}
|
||||
|
||||
ThisName++;
|
||||
}
|
||||
|
||||
for (i = 0; ScopeNames[i].Info.Name[0]; i++)
|
||||
ThisName = AcpiGbl_ScopeNames;
|
||||
while (ThisName->Info.Name[0])
|
||||
{
|
||||
if (ACPI_COMPARE_NAME (Name, ScopeNames[i].Info.Name))
|
||||
if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name))
|
||||
{
|
||||
return (ACPI_PREDEFINED_NAME);
|
||||
}
|
||||
|
||||
ThisName++;
|
||||
}
|
||||
|
||||
/* Check for _Lxx/_Exx/_Wxx/_Qxx/_T_x. Warning if unknown predefined name */
|
||||
@ -742,16 +668,16 @@ TypeErrorExit:
|
||||
|
||||
/* Format the expected types and emit an error message */
|
||||
|
||||
ApGetExpectedTypes (StringBuffer, ExpectedBtypes);
|
||||
AcpiUtGetExpectedReturnTypes (StringBuffer, ExpectedBtypes);
|
||||
|
||||
if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
|
||||
{
|
||||
sprintf (MsgBuffer, "%s: found %s, %s required",
|
||||
sprintf (MsgBuffer, "%4.4s: found %s, %s required",
|
||||
PredefinedName, TypeName, StringBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf (MsgBuffer, "%s: found %s at index %u, %s required",
|
||||
sprintf (MsgBuffer, "%4.4s: found %s at index %u, %s required",
|
||||
PredefinedName, TypeName, PackageIndex, StringBuffer);
|
||||
}
|
||||
|
||||
@ -778,8 +704,8 @@ ApDisplayReservedNames (
|
||||
void)
|
||||
{
|
||||
const ACPI_PREDEFINED_INFO *ThisName;
|
||||
char TypeBuffer[48]; /* Room for 5 types */
|
||||
UINT32 Count;
|
||||
UINT32 NumTypes;
|
||||
|
||||
|
||||
/*
|
||||
@ -788,33 +714,12 @@ ApDisplayReservedNames (
|
||||
printf ("\nPredefined Name Information\n\n");
|
||||
|
||||
Count = 0;
|
||||
ThisName = PredefinedNames;
|
||||
ThisName = AcpiGbl_PredefinedMethods;
|
||||
while (ThisName->Info.Name[0])
|
||||
{
|
||||
printf ("%4.4s Requires %u arguments, ",
|
||||
ThisName->Info.Name, ThisName->Info.ParamCount & 0x0F);
|
||||
|
||||
if (ThisName->Info.ExpectedBtypes)
|
||||
{
|
||||
ApGetExpectedTypes (TypeBuffer, ThisName->Info.ExpectedBtypes);
|
||||
printf ("Must return: %s\n", TypeBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("No return value\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Skip next entry in the table if this name returns a Package
|
||||
* (next entry contains the package info)
|
||||
*/
|
||||
if (ThisName->Info.ExpectedBtypes & ACPI_RTYPE_PACKAGE)
|
||||
{
|
||||
ThisName++;
|
||||
}
|
||||
|
||||
AcpiUtDisplayPredefinedMethod (MsgBuffer, ThisName, FALSE);
|
||||
Count++;
|
||||
ThisName++;
|
||||
ThisName = AcpiUtGetNextPredefinedMethod (ThisName);
|
||||
}
|
||||
|
||||
printf ("%u Predefined Names are recognized\n", Count);
|
||||
@ -822,69 +727,34 @@ ApDisplayReservedNames (
|
||||
/*
|
||||
* Resource Descriptor names
|
||||
*/
|
||||
printf ("\nResource Descriptor Predefined Names\n\n");
|
||||
printf ("\nPredefined Names for Resource Descriptor Fields\n\n");
|
||||
|
||||
Count = 0;
|
||||
ThisName = ResourceNames;
|
||||
ThisName = AcpiGbl_ResourceNames;
|
||||
while (ThisName->Info.Name[0])
|
||||
{
|
||||
printf ("%4.4s Resource Descriptor\n", ThisName->Info.Name);
|
||||
NumTypes = AcpiUtGetResourceBitWidth (MsgBuffer,
|
||||
ThisName->Info.ArgumentList);
|
||||
|
||||
printf ("%4.4s Field is %s bits wide%s\n",
|
||||
ThisName->Info.Name, MsgBuffer,
|
||||
(NumTypes > 1) ? " (depending on descriptor type)" : "");
|
||||
|
||||
Count++;
|
||||
ThisName++;
|
||||
}
|
||||
|
||||
printf ("%u Resource Descriptor Names are recognized\n", Count);
|
||||
printf ("%u Resource Descriptor Field Names are recognized\n", Count);
|
||||
|
||||
/*
|
||||
* Predefined scope names
|
||||
*/
|
||||
printf ("\nPredefined Scope Names\n\n");
|
||||
printf ("\nPredefined Scope/Device Names (automatically created at root)\n\n");
|
||||
|
||||
ThisName = ScopeNames;
|
||||
ThisName = AcpiGbl_ScopeNames;
|
||||
while (ThisName->Info.Name[0])
|
||||
{
|
||||
printf ("%4.4s Scope\n", ThisName->Info.Name);
|
||||
printf ("%4.4s Scope/Device\n", ThisName->Info.Name);
|
||||
ThisName++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: ApGetExpectedTypes
|
||||
*
|
||||
* PARAMETERS: Buffer - Where the formatted string is returned
|
||||
* ExpectedBTypes - Bitfield of expected data types
|
||||
*
|
||||
* RETURN: None, formatted string
|
||||
*
|
||||
* DESCRIPTION: Format the expected object types into a printable string.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
ApGetExpectedTypes (
|
||||
char *Buffer,
|
||||
UINT32 ExpectedBtypes)
|
||||
{
|
||||
UINT32 ThisRtype;
|
||||
UINT32 i;
|
||||
UINT32 j;
|
||||
|
||||
|
||||
j = 1;
|
||||
Buffer[0] = 0;
|
||||
ThisRtype = ACPI_RTYPE_INTEGER;
|
||||
|
||||
for (i = 0; i < ACPI_NUM_RTYPES; i++)
|
||||
{
|
||||
/* If one of the expected types, concatenate the name of this type */
|
||||
|
||||
if (ExpectedBtypes & ThisRtype)
|
||||
{
|
||||
ACPI_STRCAT (Buffer, &AcpiRtypeNames[i][j]);
|
||||
j = 0; /* Use name separator from now on */
|
||||
}
|
||||
ThisRtype <<= 1; /* Next Rtype */
|
||||
}
|
||||
}
|
||||
|
@ -126,15 +126,35 @@ ApCheckPackage (
|
||||
Count = (UINT32) Op->Asl.Value.Integer;
|
||||
|
||||
/*
|
||||
* Most packages must have at least one element. The only exception
|
||||
* is the variable-length package (ACPI_PTYPE1_VAR).
|
||||
* Many of the variable-length top-level packages are allowed to simply
|
||||
* have zero elements. This allows the BIOS to tell the host that even
|
||||
* though the predefined name/method exists, the feature is not supported.
|
||||
* Other package types require one or more elements. In any case, there
|
||||
* is no need to continue validation.
|
||||
*/
|
||||
if (!Count)
|
||||
{
|
||||
if (Package->RetInfo.Type != ACPI_PTYPE1_VAR)
|
||||
switch (Package->RetInfo.Type)
|
||||
{
|
||||
case ACPI_PTYPE1_FIXED:
|
||||
case ACPI_PTYPE1_OPTION:
|
||||
case ACPI_PTYPE2_PKG_COUNT:
|
||||
case ACPI_PTYPE2_REV_FIXED:
|
||||
|
||||
ApZeroLengthPackage (Predefined->Info.Name, ParentOp);
|
||||
break;
|
||||
|
||||
case ACPI_PTYPE1_VAR:
|
||||
case ACPI_PTYPE2:
|
||||
case ACPI_PTYPE2_COUNT:
|
||||
case ACPI_PTYPE2_FIXED:
|
||||
case ACPI_PTYPE2_MIN:
|
||||
case ACPI_PTYPE2_FIX_VAR:
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -894,6 +894,7 @@ RsDoOneResourceDescriptor (
|
||||
if (Rnode)
|
||||
{
|
||||
DescriptorTypeOp->Asl.FinalAmlLength = Rnode->BufferLength;
|
||||
DescriptorTypeOp->Asl.Extra = ((AML_RESOURCE *) Rnode->Buffer)->DescriptorType;
|
||||
}
|
||||
|
||||
return (Rnode);
|
||||
|
@ -164,12 +164,13 @@ typedef enum
|
||||
ASL_FILE_ASM_SOURCE_OUTPUT,
|
||||
ASL_FILE_C_SOURCE_OUTPUT,
|
||||
ASL_FILE_ASM_INCLUDE_OUTPUT,
|
||||
ASL_FILE_C_INCLUDE_OUTPUT
|
||||
ASL_FILE_C_INCLUDE_OUTPUT,
|
||||
ASL_FILE_C_OFFSET_OUTPUT
|
||||
|
||||
} ASL_FILE_TYPES;
|
||||
|
||||
|
||||
#define ASL_MAX_FILE_TYPE 13
|
||||
#define ASL_MAX_FILE_TYPE 14
|
||||
#define ASL_NUM_FILES (ASL_MAX_FILE_TYPE + 1)
|
||||
|
||||
|
||||
|
@ -499,13 +499,13 @@ AnOtherSemanticAnalysisWalkBegin (
|
||||
(PrevArgNode) &&
|
||||
(PrevArgNode->Asl.ParseOpcode == PARSEOP_ZERO))
|
||||
{
|
||||
AslError (ASL_WARNING, ASL_MSG_RESULT_NOT_USED,
|
||||
AslError (ASL_ERROR, ASL_MSG_RESULT_NOT_USED,
|
||||
Op, Op->Asl.ExternalName);
|
||||
}
|
||||
}
|
||||
else if (ArgNode->Asl.ParseOpcode == PARSEOP_ZERO)
|
||||
{
|
||||
AslError (ASL_WARNING, ASL_MSG_RESULT_NOT_USED,
|
||||
AslError (ASL_ERROR, ASL_MSG_RESULT_NOT_USED,
|
||||
Op, Op->Asl.ExternalName);
|
||||
}
|
||||
}
|
||||
@ -523,7 +523,7 @@ AnOtherSemanticAnalysisWalkBegin (
|
||||
break;
|
||||
|
||||
default:
|
||||
AslError (ASL_WARNING, ASL_MSG_RESULT_NOT_USED,
|
||||
AslError (ASL_ERROR, ASL_MSG_RESULT_NOT_USED,
|
||||
Op, Op->Asl.ExternalName);
|
||||
break;
|
||||
}
|
||||
|
@ -449,7 +449,7 @@ AcpiDbWalkForExecute (
|
||||
const ACPI_PREDEFINED_INFO *Predefined;
|
||||
|
||||
|
||||
Predefined = AcpiNsCheckForPredefinedName (Node);
|
||||
Predefined = AcpiUtMatchPredefinedMethod (Node->Name.Ascii);
|
||||
if (!Predefined)
|
||||
{
|
||||
return (AE_OK);
|
||||
|
@ -46,6 +46,7 @@
|
||||
#include <contrib/dev/acpica/include/accommon.h>
|
||||
#include <contrib/dev/acpica/include/acnamesp.h>
|
||||
#include <contrib/dev/acpica/include/acdebug.h>
|
||||
#include <contrib/dev/acpica/include/acpredef.h>
|
||||
|
||||
|
||||
#ifdef ACPI_DEBUGGER
|
||||
@ -436,7 +437,7 @@ AcpiDbWalkForPredefinedNames (
|
||||
char *Pathname;
|
||||
|
||||
|
||||
Predefined = AcpiNsCheckForPredefinedName (Node);
|
||||
Predefined = AcpiUtMatchPredefinedMethod (Node->Name.Ascii);
|
||||
if (!Predefined)
|
||||
{
|
||||
return (AE_OK);
|
||||
@ -450,13 +451,14 @@ AcpiDbWalkForPredefinedNames (
|
||||
|
||||
/* If method returns a package, the info is in the next table entry */
|
||||
|
||||
if (Predefined->Info.ExpectedBtypes & ACPI_BTYPE_PACKAGE)
|
||||
if (Predefined->Info.ExpectedBtypes & ACPI_RTYPE_PACKAGE)
|
||||
{
|
||||
Package = Predefined + 1;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%-32s arg %X ret %2.2X", Pathname,
|
||||
Predefined->Info.ParamCount, Predefined->Info.ExpectedBtypes);
|
||||
(Predefined->Info.ArgumentList & METHOD_ARG_MASK),
|
||||
Predefined->Info.ExpectedBtypes);
|
||||
|
||||
if (Package)
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dsopcode - Dispatcher suport for regions and fields
|
||||
* Module Name: dsopcode - Dispatcher support for regions and fields
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
@ -727,7 +727,7 @@ AcpiDsExecEndOp (
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Unimplemented opcode, class=0x%X type=0x%X Opcode=-0x%X Op=%p",
|
||||
"Unimplemented opcode, class=0x%X type=0x%X Opcode=0x%X Op=%p",
|
||||
OpClass, OpType, Op->Common.AmlOpcode, Op));
|
||||
|
||||
Status = AE_NOT_IMPLEMENTED;
|
||||
|
@ -292,7 +292,7 @@ AcpiEvFixedEventDetect (
|
||||
* DESCRIPTION: Clears the status bit for the requested event, calls the
|
||||
* handler that previously registered for the event.
|
||||
* NOTE: If there is no handler for the event, the event is
|
||||
* disabled to prevent futher interrupts.
|
||||
* disabled to prevent further interrupts.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -286,7 +286,7 @@ AcpiExOpcode_2A_1T_1R (
|
||||
ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
|
||||
UINT64 Index;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_SIZE Length;
|
||||
ACPI_SIZE Length = 0;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_STR (ExOpcode_2A_1T_1R,
|
||||
@ -356,7 +356,6 @@ AcpiExOpcode_2A_1T_1R (
|
||||
* NOTE: A length of zero is ok, and will create a zero-length, null
|
||||
* terminated string.
|
||||
*/
|
||||
Length = 0;
|
||||
while ((Length < Operand[0]->Buffer.Length) &&
|
||||
(Length < Operand[1]->Integer.Value) &&
|
||||
(Operand[0]->Buffer.Pointer[Length]))
|
||||
@ -418,6 +417,7 @@ AcpiExOpcode_2A_1T_1R (
|
||||
|
||||
if (Index >= Operand[0]->String.Length)
|
||||
{
|
||||
Length = Operand[0]->String.Length;
|
||||
Status = AE_AML_STRING_LIMIT;
|
||||
}
|
||||
|
||||
@ -428,6 +428,7 @@ AcpiExOpcode_2A_1T_1R (
|
||||
|
||||
if (Index >= Operand[0]->Buffer.Length)
|
||||
{
|
||||
Length = Operand[0]->Buffer.Length;
|
||||
Status = AE_AML_BUFFER_LIMIT;
|
||||
}
|
||||
|
||||
@ -438,6 +439,7 @@ AcpiExOpcode_2A_1T_1R (
|
||||
|
||||
if (Index >= Operand[0]->Package.Count)
|
||||
{
|
||||
Length = Operand[0]->Package.Count;
|
||||
Status = AE_AML_PACKAGE_LIMIT;
|
||||
}
|
||||
|
||||
@ -456,8 +458,8 @@ AcpiExOpcode_2A_1T_1R (
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Index (0x%8.8X%8.8X) is beyond end of object",
|
||||
ACPI_FORMAT_UINT64 (Index)));
|
||||
"Index (0x%X%8.8X) is beyond end of object (length 0x%X)",
|
||||
ACPI_FORMAT_UINT64 (Index), (UINT32) Length));
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
|
@ -109,18 +109,22 @@ AcpiNsEvaluate (
|
||||
Info->ReturnObject = NULL;
|
||||
Info->ParamCount = 0;
|
||||
|
||||
/*
|
||||
* Get the actual namespace node for the target object. Handles these cases:
|
||||
*
|
||||
* 1) Null node, Pathname (absolute path)
|
||||
* 2) Node, Pathname (path relative to Node)
|
||||
* 3) Node, Null Pathname
|
||||
*/
|
||||
Status = AcpiNsGetNode (Info->PrefixNode, Info->Pathname,
|
||||
ACPI_NS_NO_UPSEARCH, &Info->ResolvedNode);
|
||||
if (ACPI_FAILURE (Status))
|
||||
if (!Info->ResolvedNode)
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
/*
|
||||
* Get the actual namespace node for the target object if we need to.
|
||||
* Handles these cases:
|
||||
*
|
||||
* 1) Null node, Pathname (absolute path)
|
||||
* 2) Node, Pathname (path relative to Node)
|
||||
* 3) Node, Null Pathname
|
||||
*/
|
||||
Status = AcpiNsGetNode (Info->PrefixNode, Info->Pathname,
|
||||
ACPI_NS_NO_UPSEARCH, &Info->ResolvedNode);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -82,30 +82,11 @@ AcpiNsCheckReference (
|
||||
ACPI_PREDEFINED_DATA *Data,
|
||||
ACPI_OPERAND_OBJECT *ReturnObject);
|
||||
|
||||
static void
|
||||
AcpiNsGetExpectedTypes (
|
||||
char *Buffer,
|
||||
UINT32 ExpectedBtypes);
|
||||
|
||||
static UINT32
|
||||
AcpiNsGetBitmappedType (
|
||||
ACPI_OPERAND_OBJECT *ReturnObject);
|
||||
|
||||
|
||||
/*
|
||||
* Names for the types that can be returned by the predefined objects.
|
||||
* Used for warning messages. Must be in the same order as the ACPI_RTYPEs
|
||||
*/
|
||||
static const char *AcpiRtypeNames[] =
|
||||
{
|
||||
"/Integer",
|
||||
"/String",
|
||||
"/Buffer",
|
||||
"/Package",
|
||||
"/Reference",
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsCheckPredefinedNames
|
||||
@ -137,7 +118,7 @@ AcpiNsCheckPredefinedNames (
|
||||
|
||||
/* Match the name for this method/object against the predefined list */
|
||||
|
||||
Predefined = AcpiNsCheckForPredefinedName (Node);
|
||||
Predefined = AcpiUtMatchPredefinedMethod (Node->Name.Ascii);
|
||||
|
||||
/* Get the full pathname to the object, for use in warning messages */
|
||||
|
||||
@ -321,8 +302,8 @@ AcpiNsCheckParameterCount (
|
||||
* Validate the user-supplied parameter count.
|
||||
* Allow two different legal argument counts (_SCP, etc.)
|
||||
*/
|
||||
RequiredParamsCurrent = Predefined->Info.ParamCount & 0x0F;
|
||||
RequiredParamsOld = Predefined->Info.ParamCount >> 4;
|
||||
RequiredParamsCurrent = Predefined->Info.ArgumentList & METHOD_ARG_MASK;
|
||||
RequiredParamsOld = Predefined->Info.ArgumentList >> METHOD_ARG_BIT_WIDTH;
|
||||
|
||||
if (UserParamCount != ACPI_UINT32_MAX)
|
||||
{
|
||||
@ -351,58 +332,6 @@ AcpiNsCheckParameterCount (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsCheckForPredefinedName
|
||||
*
|
||||
* PARAMETERS: Node - Namespace node for the method/object
|
||||
*
|
||||
* RETURN: Pointer to entry in predefined table. NULL indicates not found.
|
||||
*
|
||||
* DESCRIPTION: Check an object name against the predefined object list.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
const ACPI_PREDEFINED_INFO *
|
||||
AcpiNsCheckForPredefinedName (
|
||||
ACPI_NAMESPACE_NODE *Node)
|
||||
{
|
||||
const ACPI_PREDEFINED_INFO *ThisName;
|
||||
|
||||
|
||||
/* Quick check for a predefined name, first character must be underscore */
|
||||
|
||||
if (Node->Name.Ascii[0] != '_')
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Search info table for a predefined method/object name */
|
||||
|
||||
ThisName = PredefinedNames;
|
||||
while (ThisName->Info.Name[0])
|
||||
{
|
||||
if (ACPI_COMPARE_NAME (Node->Name.Ascii, ThisName->Info.Name))
|
||||
{
|
||||
return (ThisName);
|
||||
}
|
||||
|
||||
/*
|
||||
* Skip next entry in the table if this name returns a Package
|
||||
* (next entry contains the package info)
|
||||
*/
|
||||
if (ThisName->Info.ExpectedBtypes & ACPI_RTYPE_PACKAGE)
|
||||
{
|
||||
ThisName++;
|
||||
}
|
||||
|
||||
ThisName++;
|
||||
}
|
||||
|
||||
return (NULL); /* Not found */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsCheckObjectType
|
||||
@ -480,7 +409,7 @@ TypeErrorExit:
|
||||
|
||||
/* Create a string with all expected types for this predefined object */
|
||||
|
||||
AcpiNsGetExpectedTypes (TypeBuffer, ExpectedBtypes);
|
||||
AcpiUtGetExpectedReturnTypes (TypeBuffer, ExpectedBtypes);
|
||||
|
||||
if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
|
||||
{
|
||||
@ -600,45 +529,3 @@ AcpiNsGetBitmappedType (
|
||||
|
||||
return (ReturnBtype);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsGetExpectedTypes
|
||||
*
|
||||
* PARAMETERS: Buffer - Pointer to where the string is returned
|
||||
* ExpectedBtypes - Bitmap of expected return type(s)
|
||||
*
|
||||
* RETURN: Buffer is populated with type names.
|
||||
*
|
||||
* DESCRIPTION: Translate the expected types bitmap into a string of ascii
|
||||
* names of expected types, for use in warning messages.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
AcpiNsGetExpectedTypes (
|
||||
char *Buffer,
|
||||
UINT32 ExpectedBtypes)
|
||||
{
|
||||
UINT32 ThisRtype;
|
||||
UINT32 i;
|
||||
UINT32 j;
|
||||
|
||||
|
||||
j = 1;
|
||||
Buffer[0] = 0;
|
||||
ThisRtype = ACPI_RTYPE_INTEGER;
|
||||
|
||||
for (i = 0; i < ACPI_NUM_RTYPES; i++)
|
||||
{
|
||||
/* If one of the expected types, concatenate the name of this type */
|
||||
|
||||
if (ExpectedBtypes & ThisRtype)
|
||||
{
|
||||
ACPI_STRCAT (Buffer, &AcpiRtypeNames[i][j]);
|
||||
j = 0; /* Use name separator from now on */
|
||||
}
|
||||
ThisRtype <<= 1; /* Next Rtype */
|
||||
}
|
||||
}
|
||||
|
@ -590,8 +590,12 @@ AcpiTbValidateFadt (
|
||||
/*
|
||||
* For each extended field, check for length mismatch between the
|
||||
* legacy length field and the corresponding 64-bit X length field.
|
||||
* Note: If the legacy length field is > 0xFF bits, ignore this
|
||||
* check. (GPE registers can be larger than the 64-bit GAS structure
|
||||
* can accomodate, 0xFF bits).
|
||||
*/
|
||||
if (Address64->Address &&
|
||||
(ACPI_MUL_8 (Length) <= ACPI_UINT8_MAX) &&
|
||||
(Address64->BitWidth != ACPI_MUL_8 (Length)))
|
||||
{
|
||||
ACPI_BIOS_WARNING ((AE_INFO,
|
||||
|
@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: tbxface - ACPI table oriented external interfaces
|
||||
* Module Name: tbxface - ACPI table-oriented external interfaces
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@ -86,7 +86,7 @@ AcpiAllocateRootTable (
|
||||
* array is dynamically allocated.
|
||||
* InitialTableCount - Size of InitialTableArray, in number of
|
||||
* ACPI_TABLE_DESC structures
|
||||
* AllowRealloc - Flag to tell Table Manager if resize of
|
||||
* AllowResize - Flag to tell Table Manager if resize of
|
||||
* pre-allocated array is allowed. Ignored
|
||||
* if InitialTableArray is NULL.
|
||||
*
|
||||
@ -117,8 +117,8 @@ AcpiInitializeTables (
|
||||
|
||||
|
||||
/*
|
||||
* Set up the Root Table Array
|
||||
* Allocate the table array if requested
|
||||
* Setup the Root Table Array and allocate the table array
|
||||
* if requested
|
||||
*/
|
||||
if (!InitialTableArray)
|
||||
{
|
||||
@ -304,9 +304,10 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader)
|
||||
* Instance - Which instance (for SSDTs)
|
||||
* OutTable - Where the pointer to the table is returned
|
||||
*
|
||||
* RETURN: Status and pointer to table
|
||||
* RETURN: Status and pointer to the requested table
|
||||
*
|
||||
* DESCRIPTION: Finds and verifies an ACPI table.
|
||||
* DESCRIPTION: Finds and verifies an ACPI table. Table must be in the
|
||||
* RSDT/XSDT.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -365,9 +366,10 @@ ACPI_EXPORT_SYMBOL (AcpiGetTable)
|
||||
* PARAMETERS: TableIndex - Table index
|
||||
* Table - Where the pointer to the table is returned
|
||||
*
|
||||
* RETURN: Status and pointer to the table
|
||||
* RETURN: Status and pointer to the requested table
|
||||
*
|
||||
* DESCRIPTION: Obtain a table by an index into the global table list.
|
||||
* DESCRIPTION: Obtain a table by an index into the global table list. Used
|
||||
* internally also.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -428,7 +430,7 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableByIndex)
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Install table event handler
|
||||
* DESCRIPTION: Install a global table event handler.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -484,7 +486,7 @@ ACPI_EXPORT_SYMBOL (AcpiInstallTableHandler)
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Remove table event handler
|
||||
* DESCRIPTION: Remove a table event handler
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -390,11 +390,11 @@ AcpiUtDeleteInternalObjectList (
|
||||
* FUNCTION: AcpiUtUpdateRefCount
|
||||
*
|
||||
* PARAMETERS: Object - Object whose ref count is to be updated
|
||||
* Action - What to do
|
||||
* Action - What to do (REF_INCREMENT or REF_DECREMENT)
|
||||
*
|
||||
* RETURN: New ref count
|
||||
* RETURN: None. Sets new reference count within the object
|
||||
*
|
||||
* DESCRIPTION: Modify the ref count and return it.
|
||||
* DESCRIPTION: Modify the reference count for an internal acpi object
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -403,8 +403,9 @@ AcpiUtUpdateRefCount (
|
||||
ACPI_OPERAND_OBJECT *Object,
|
||||
UINT32 Action)
|
||||
{
|
||||
UINT16 Count;
|
||||
UINT16 NewCount;
|
||||
UINT16 OriginalCount;
|
||||
UINT16 NewCount = 0;
|
||||
ACPI_CPU_FLAGS LockFlags;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (UtUpdateRefCount);
|
||||
@ -415,80 +416,85 @@ AcpiUtUpdateRefCount (
|
||||
return;
|
||||
}
|
||||
|
||||
Count = Object->Common.ReferenceCount;
|
||||
NewCount = Count;
|
||||
|
||||
/*
|
||||
* Perform the reference count action (increment, decrement, force delete)
|
||||
* Always get the reference count lock. Note: Interpreter and/or
|
||||
* Namespace is not always locked when this function is called.
|
||||
*/
|
||||
LockFlags = AcpiOsAcquireLock (AcpiGbl_ReferenceCountLock);
|
||||
OriginalCount = Object->Common.ReferenceCount;
|
||||
|
||||
/* Perform the reference count action (increment, decrement) */
|
||||
|
||||
switch (Action)
|
||||
{
|
||||
case REF_INCREMENT:
|
||||
|
||||
NewCount++;
|
||||
NewCount = OriginalCount + 1;
|
||||
Object->Common.ReferenceCount = NewCount;
|
||||
AcpiOsReleaseLock (AcpiGbl_ReferenceCountLock, LockFlags);
|
||||
|
||||
/* The current reference count should never be zero here */
|
||||
|
||||
if (!OriginalCount)
|
||||
{
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Obj %p, Reference Count was zero before increment\n",
|
||||
Object));
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
|
||||
"Obj %p Refs=%X, [Incremented]\n",
|
||||
Object, NewCount));
|
||||
"Obj %p Type %.2X Refs %.2X [Incremented]\n",
|
||||
Object, Object->Common.Type, NewCount));
|
||||
break;
|
||||
|
||||
case REF_DECREMENT:
|
||||
|
||||
if (Count < 1)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
|
||||
"Obj %p Refs=%X, can't decrement! (Set to 0)\n",
|
||||
Object, NewCount));
|
||||
/* The current reference count must be non-zero */
|
||||
|
||||
NewCount = 0;
|
||||
}
|
||||
else
|
||||
if (OriginalCount)
|
||||
{
|
||||
NewCount--;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
|
||||
"Obj %p Refs=%X, [Decremented]\n",
|
||||
Object, NewCount));
|
||||
NewCount = OriginalCount - 1;
|
||||
Object->Common.ReferenceCount = NewCount;
|
||||
}
|
||||
|
||||
if (Object->Common.Type == ACPI_TYPE_METHOD)
|
||||
AcpiOsReleaseLock (AcpiGbl_ReferenceCountLock, LockFlags);
|
||||
|
||||
if (!OriginalCount)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
|
||||
"Method Obj %p Refs=%X, [Decremented]\n", Object, NewCount));
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Obj %p, Reference Count is already zero, cannot decrement\n",
|
||||
Object));
|
||||
}
|
||||
|
||||
Object->Common.ReferenceCount = NewCount;
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
|
||||
"Obj %p Type %.2X Refs %.2X [Decremented]\n",
|
||||
Object, Object->Common.Type, NewCount));
|
||||
|
||||
/* Actually delete the object on a reference count of zero */
|
||||
|
||||
if (NewCount == 0)
|
||||
{
|
||||
AcpiUtDeleteInternalObj (Object);
|
||||
}
|
||||
break;
|
||||
|
||||
case REF_FORCE_DELETE:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
|
||||
"Obj %p Refs=%X, Force delete! (Set to 0)\n", Object, Count));
|
||||
|
||||
NewCount = 0;
|
||||
Object->Common.ReferenceCount = NewCount;
|
||||
AcpiUtDeleteInternalObj (Object);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown action (0x%X)", Action));
|
||||
break;
|
||||
AcpiOsReleaseLock (AcpiGbl_ReferenceCountLock, LockFlags);
|
||||
ACPI_ERROR ((AE_INFO, "Unknown Reference Count action (0x%X)",
|
||||
Action));
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Sanity check the reference count, for debug purposes only.
|
||||
* (A deleted object will have a huge reference count)
|
||||
*/
|
||||
if (Count > ACPI_MAX_REFERENCE_COUNT)
|
||||
if (NewCount > ACPI_MAX_REFERENCE_COUNT)
|
||||
{
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Large Reference Count (0x%X) in object %p", Count, Object));
|
||||
"Large Reference Count (0x%X) in object %p, Type=0x%.2X",
|
||||
NewCount, Object, Object->Common.Type));
|
||||
}
|
||||
}
|
||||
|
||||
@ -499,8 +505,7 @@ AcpiUtUpdateRefCount (
|
||||
*
|
||||
* PARAMETERS: Object - Increment ref count for this object
|
||||
* and all sub-objects
|
||||
* Action - Either REF_INCREMENT or REF_DECREMENT or
|
||||
* REF_FORCE_DELETE
|
||||
* Action - Either REF_INCREMENT or REF_DECREMENT
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
@ -771,7 +776,6 @@ AcpiUtRemoveReference (
|
||||
/*
|
||||
* Allow a NULL pointer to be passed in, just ignore it. This saves
|
||||
* each caller from having to check. Also, ignore NS nodes.
|
||||
*
|
||||
*/
|
||||
if (!Object ||
|
||||
(ACPI_GET_DESCRIPTOR_TYPE (Object) == ACPI_DESC_TYPE_NAMED))
|
||||
|
@ -96,7 +96,7 @@ AcpiUtMutexInitialize (
|
||||
}
|
||||
}
|
||||
|
||||
/* Create the spinlocks for use at interrupt level */
|
||||
/* Create the spinlocks for use at interrupt level or for speed */
|
||||
|
||||
Status = AcpiOsCreateLock (&AcpiGbl_GpeLock);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@ -110,7 +110,14 @@ AcpiUtMutexInitialize (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
Status = AcpiOsCreateLock (&AcpiGbl_ReferenceCountLock);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Mutex for _OSI support */
|
||||
|
||||
Status = AcpiOsCreateMutex (&AcpiGbl_OsiMutex);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@ -160,6 +167,7 @@ AcpiUtMutexTerminate (
|
||||
|
||||
AcpiOsDeleteLock (AcpiGbl_GpeLock);
|
||||
AcpiOsDeleteLock (AcpiGbl_HardwareLock);
|
||||
AcpiOsDeleteLock (AcpiGbl_ReferenceCountLock);
|
||||
|
||||
/* Delete the reader/writer lock */
|
||||
|
||||
|
@ -115,10 +115,16 @@ ACPI_STATUS
|
||||
AcpiUtInitializeInterfaces (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
|
||||
Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
AcpiGbl_SupportedInterfaces = AcpiDefaultSupportedInterfaces;
|
||||
|
||||
/* Link the static list of supported interfaces */
|
||||
@ -140,23 +146,28 @@ AcpiUtInitializeInterfaces (
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Delete all interfaces in the global list. Sets
|
||||
* AcpiGbl_SupportedInterfaces to NULL.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ACPI_STATUS
|
||||
AcpiUtInterfaceTerminate (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_INTERFACE_INFO *NextInterface;
|
||||
|
||||
|
||||
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
|
||||
NextInterface = AcpiGbl_SupportedInterfaces;
|
||||
Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
NextInterface = AcpiGbl_SupportedInterfaces;
|
||||
while (NextInterface)
|
||||
{
|
||||
AcpiGbl_SupportedInterfaces = NextInterface->Next;
|
||||
@ -173,6 +184,7 @@ AcpiUtInterfaceTerminate (
|
||||
}
|
||||
|
||||
AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
@ -350,6 +362,7 @@ AcpiUtOsiImplementation (
|
||||
ACPI_OPERAND_OBJECT *ReturnDesc;
|
||||
ACPI_INTERFACE_INFO *InterfaceInfo;
|
||||
ACPI_INTERFACE_HANDLER InterfaceHandler;
|
||||
ACPI_STATUS Status;
|
||||
UINT32 ReturnValue;
|
||||
|
||||
|
||||
@ -376,7 +389,12 @@ AcpiUtOsiImplementation (
|
||||
/* Default return value is 0, NOT SUPPORTED */
|
||||
|
||||
ReturnValue = 0;
|
||||
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
|
||||
Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiUtDeleteObjectDesc (ReturnDesc);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Lookup the interface in the global _OSI list */
|
||||
|
||||
|
451
sys/contrib/dev/acpica/components/utilities/utpredef.c
Normal file
451
sys/contrib/dev/acpica/components/utilities/utpredef.c
Normal file
@ -0,0 +1,451 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: utpredef - support functions for predefined names
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2013, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* NO WARRANTY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#define __UTPREDEF_C__
|
||||
|
||||
#include <contrib/dev/acpica/include/acpi.h>
|
||||
#include <contrib/dev/acpica/include/accommon.h>
|
||||
#include <contrib/dev/acpica/include/acpredef.h>
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_UTILITIES
|
||||
ACPI_MODULE_NAME ("utpredef")
|
||||
|
||||
|
||||
/*
|
||||
* Names for the types that can be returned by the predefined objects.
|
||||
* Used for warning messages. Must be in the same order as the ACPI_RTYPEs
|
||||
*/
|
||||
static const char *UtRtypeNames[] =
|
||||
{
|
||||
"/Integer",
|
||||
"/String",
|
||||
"/Buffer",
|
||||
"/Package",
|
||||
"/Reference",
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtGetNextPredefinedMethod
|
||||
*
|
||||
* PARAMETERS: ThisName - Entry in the predefined method/name table
|
||||
*
|
||||
* RETURN: Pointer to next entry in predefined table.
|
||||
*
|
||||
* DESCRIPTION: Get the next entry in the predefine method table. Handles the
|
||||
* cases where a package info entry follows a method name that
|
||||
* returns a package.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
const ACPI_PREDEFINED_INFO *
|
||||
AcpiUtGetNextPredefinedMethod (
|
||||
const ACPI_PREDEFINED_INFO *ThisName)
|
||||
{
|
||||
|
||||
/*
|
||||
* Skip next entry in the table if this name returns a Package
|
||||
* (next entry contains the package info)
|
||||
*/
|
||||
if ((ThisName->Info.ExpectedBtypes & ACPI_RTYPE_PACKAGE) &&
|
||||
(ThisName->Info.ExpectedBtypes != ACPI_RTYPE_ALL))
|
||||
{
|
||||
ThisName++;
|
||||
}
|
||||
|
||||
ThisName++;
|
||||
return (ThisName);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtMatchPredefinedMethod
|
||||
*
|
||||
* PARAMETERS: Name - Name to find
|
||||
*
|
||||
* RETURN: Pointer to entry in predefined table. NULL indicates not found.
|
||||
*
|
||||
* DESCRIPTION: Check an object name against the predefined object list.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
const ACPI_PREDEFINED_INFO *
|
||||
AcpiUtMatchPredefinedMethod (
|
||||
char *Name)
|
||||
{
|
||||
const ACPI_PREDEFINED_INFO *ThisName;
|
||||
|
||||
|
||||
/* Quick check for a predefined name, first character must be underscore */
|
||||
|
||||
if (Name[0] != '_')
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Search info table for a predefined method/object name */
|
||||
|
||||
ThisName = AcpiGbl_PredefinedMethods;
|
||||
while (ThisName->Info.Name[0])
|
||||
{
|
||||
if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name))
|
||||
{
|
||||
return (ThisName);
|
||||
}
|
||||
|
||||
ThisName = AcpiUtGetNextPredefinedMethod (ThisName);
|
||||
}
|
||||
|
||||
return (NULL); /* Not found */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtGetExpectedReturnTypes
|
||||
*
|
||||
* PARAMETERS: Buffer - Where the formatted string is returned
|
||||
* ExpectedBTypes - Bitfield of expected data types
|
||||
*
|
||||
* RETURN: Formatted string in Buffer.
|
||||
*
|
||||
* DESCRIPTION: Format the expected object types into a printable string.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiUtGetExpectedReturnTypes (
|
||||
char *Buffer,
|
||||
UINT32 ExpectedBtypes)
|
||||
{
|
||||
UINT32 ThisRtype;
|
||||
UINT32 i;
|
||||
UINT32 j;
|
||||
|
||||
|
||||
j = 1;
|
||||
Buffer[0] = 0;
|
||||
ThisRtype = ACPI_RTYPE_INTEGER;
|
||||
|
||||
for (i = 0; i < ACPI_NUM_RTYPES; i++)
|
||||
{
|
||||
/* If one of the expected types, concatenate the name of this type */
|
||||
|
||||
if (ExpectedBtypes & ThisRtype)
|
||||
{
|
||||
ACPI_STRCAT (Buffer, &UtRtypeNames[i][j]);
|
||||
j = 0; /* Use name separator from now on */
|
||||
}
|
||||
|
||||
ThisRtype <<= 1; /* Next Rtype */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* The remaining functions are used by iASL and AcpiHelp only
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP)
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static UINT32
|
||||
AcpiUtGetArgumentTypes (
|
||||
char *Buffer,
|
||||
UINT16 ArgumentTypes);
|
||||
|
||||
|
||||
/* Types that can be returned externally by a predefined name */
|
||||
|
||||
static const char *UtExternalTypeNames[] = /* Indexed by ACPI_TYPE_* */
|
||||
{
|
||||
", UNSUPPORTED-TYPE",
|
||||
", Integer",
|
||||
", String",
|
||||
", Buffer",
|
||||
", Package"
|
||||
};
|
||||
|
||||
/* Bit widths for resource descriptor predefined names */
|
||||
|
||||
static const char *UtResourceTypeNames[] =
|
||||
{
|
||||
"/1",
|
||||
"/2",
|
||||
"/3",
|
||||
"/8",
|
||||
"/16",
|
||||
"/32",
|
||||
"/64",
|
||||
"/variable",
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtMatchResourceName
|
||||
*
|
||||
* PARAMETERS: Name - Name to find
|
||||
*
|
||||
* RETURN: Pointer to entry in the resource table. NULL indicates not
|
||||
* found.
|
||||
*
|
||||
* DESCRIPTION: Check an object name against the predefined resource
|
||||
* descriptor object list.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
const ACPI_PREDEFINED_INFO *
|
||||
AcpiUtMatchResourceName (
|
||||
char *Name)
|
||||
{
|
||||
const ACPI_PREDEFINED_INFO *ThisName;
|
||||
|
||||
|
||||
/* Quick check for a predefined name, first character must be underscore */
|
||||
|
||||
if (Name[0] != '_')
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Search info table for a predefined method/object name */
|
||||
|
||||
ThisName = AcpiGbl_ResourceNames;
|
||||
while (ThisName->Info.Name[0])
|
||||
{
|
||||
if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name))
|
||||
{
|
||||
return (ThisName);
|
||||
}
|
||||
|
||||
ThisName++;
|
||||
}
|
||||
|
||||
return (NULL); /* Not found */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtDisplayPredefinedMethod
|
||||
*
|
||||
* PARAMETERS: Buffer - Scratch buffer for this function
|
||||
* ThisName - Entry in the predefined method/name table
|
||||
* MultiLine - TRUE if output should be on >1 line
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Display information about a predefined method. Number and
|
||||
* type of the input arguments, and expected type(s) for the
|
||||
* return value, if any.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiUtDisplayPredefinedMethod (
|
||||
char *Buffer,
|
||||
const ACPI_PREDEFINED_INFO *ThisName,
|
||||
BOOLEAN MultiLine)
|
||||
{
|
||||
UINT32 ArgCount;
|
||||
|
||||
/*
|
||||
* Get the argument count and the string buffer
|
||||
* containing all argument types
|
||||
*/
|
||||
ArgCount = AcpiUtGetArgumentTypes (Buffer,
|
||||
ThisName->Info.ArgumentList);
|
||||
|
||||
if (MultiLine)
|
||||
{
|
||||
printf (" ");
|
||||
}
|
||||
|
||||
printf ("%4.4s Requires %s%u argument%s",
|
||||
ThisName->Info.Name,
|
||||
(ThisName->Info.ArgumentList & ARG_COUNT_IS_MINIMUM) ?
|
||||
"(at least) " : "",
|
||||
ArgCount, ArgCount != 1 ? "s" : "");
|
||||
|
||||
/* Display the types for any arguments */
|
||||
|
||||
if (ArgCount > 0)
|
||||
{
|
||||
printf (" (%s)", Buffer);
|
||||
}
|
||||
|
||||
if (MultiLine)
|
||||
{
|
||||
printf ("\n ");
|
||||
}
|
||||
|
||||
/* Get the return value type(s) allowed */
|
||||
|
||||
if (ThisName->Info.ExpectedBtypes)
|
||||
{
|
||||
AcpiUtGetExpectedReturnTypes (Buffer, ThisName->Info.ExpectedBtypes);
|
||||
printf (" Return value types: %s\n", Buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf (" No return value\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtGetArgumentTypes
|
||||
*
|
||||
* PARAMETERS: Buffer - Where to return the formatted types
|
||||
* ArgumentTypes - Types field for this method
|
||||
*
|
||||
* RETURN: Count - the number of arguments required for this method
|
||||
*
|
||||
* DESCRIPTION: Format the required data types for this method (Integer,
|
||||
* String, Buffer, or Package) and return the required argument
|
||||
* count.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static UINT32
|
||||
AcpiUtGetArgumentTypes (
|
||||
char *Buffer,
|
||||
UINT16 ArgumentTypes)
|
||||
{
|
||||
UINT16 ThisArgumentType;
|
||||
UINT16 SubIndex;
|
||||
UINT16 ArgCount;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
*Buffer = 0;
|
||||
SubIndex = 2;
|
||||
|
||||
/* First field in the types list is the count of args to follow */
|
||||
|
||||
ArgCount = (ArgumentTypes & METHOD_ARG_MASK);
|
||||
ArgumentTypes >>= METHOD_ARG_BIT_WIDTH;
|
||||
|
||||
if (ArgCount > METHOD_PREDEF_ARGS_MAX)
|
||||
{
|
||||
printf ("**** Invalid argument count (%u) "
|
||||
"in predefined info structure\n", ArgCount);
|
||||
return (ArgCount);
|
||||
}
|
||||
|
||||
/* Get each argument from the list, convert to ascii, store to buffer */
|
||||
|
||||
for (i = 0; i < ArgCount; i++)
|
||||
{
|
||||
ThisArgumentType = (ArgumentTypes & METHOD_ARG_MASK);
|
||||
if (!ThisArgumentType || (ThisArgumentType > METHOD_MAX_ARG_TYPE))
|
||||
{
|
||||
printf ("**** Invalid argument type (%u) "
|
||||
"in predefined info structure\n", ThisArgumentType);
|
||||
return (ArgCount);
|
||||
}
|
||||
|
||||
strcat (Buffer, UtExternalTypeNames[ThisArgumentType] + SubIndex);
|
||||
|
||||
/* Shift to next argument type field */
|
||||
|
||||
ArgumentTypes >>= METHOD_ARG_BIT_WIDTH;
|
||||
SubIndex = 0;
|
||||
}
|
||||
|
||||
return (ArgCount);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiUtGetResourceBitWidth
|
||||
*
|
||||
* PARAMETERS: Buffer - Where the formatted string is returned
|
||||
* Types - Bitfield of expected data types
|
||||
*
|
||||
* RETURN: Count of return types. Formatted string in Buffer.
|
||||
*
|
||||
* DESCRIPTION: Format the resource bit widths into a printable string.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
UINT32
|
||||
AcpiUtGetResourceBitWidth (
|
||||
char *Buffer,
|
||||
UINT16 Types)
|
||||
{
|
||||
UINT32 i;
|
||||
UINT16 SubIndex;
|
||||
UINT32 Found;
|
||||
|
||||
|
||||
*Buffer = 0;
|
||||
SubIndex = 1;
|
||||
Found = 0;
|
||||
|
||||
for (i = 0; i < NUM_RESOURCE_WIDTHS; i++)
|
||||
{
|
||||
if (Types & 1)
|
||||
{
|
||||
strcat (Buffer, &(UtResourceTypeNames[i][SubIndex]));
|
||||
SubIndex = 0;
|
||||
Found++;
|
||||
}
|
||||
|
||||
Types >>= 1;
|
||||
}
|
||||
|
||||
return (Found);
|
||||
}
|
||||
#endif
|
@ -373,7 +373,11 @@ AcpiInstallInterface (
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
|
||||
Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* Check if the interface name is already in the global list */
|
||||
|
||||
@ -434,7 +438,11 @@ AcpiRemoveInterface (
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
|
||||
Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Status = AcpiUtRemoveInterface (InterfaceName);
|
||||
|
||||
@ -464,10 +472,14 @@ ACPI_STATUS
|
||||
AcpiInstallInterfaceHandler (
|
||||
ACPI_INTERFACE_HANDLER Handler)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
(void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
|
||||
Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
if (Handler && AcpiGbl_InterfaceHandler)
|
||||
{
|
||||
|
@ -228,6 +228,7 @@ ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockPending;
|
||||
*/
|
||||
ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_GpeLock; /* For GPE data structs and registers */
|
||||
ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_HardwareLock; /* For ACPI H/W except GPE registers */
|
||||
ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_ReferenceCountLock;
|
||||
|
||||
/* Mutex for _OSI support */
|
||||
|
||||
|
@ -335,6 +335,7 @@ ACPI_STATUS (*ACPI_INTERNAL_METHOD) (
|
||||
#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */
|
||||
#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
/*
|
||||
* Information structure for ACPI predefined names.
|
||||
@ -347,7 +348,7 @@ ACPI_STATUS (*ACPI_INTERNAL_METHOD) (
|
||||
typedef struct acpi_name_info
|
||||
{
|
||||
char Name[ACPI_NAME_SIZE];
|
||||
UINT8 ParamCount;
|
||||
UINT16 ArgumentList;
|
||||
UINT8 ExpectedBtypes;
|
||||
|
||||
} ACPI_NAME_INFO;
|
||||
@ -372,7 +373,7 @@ typedef struct acpi_package_info
|
||||
UINT8 Count1;
|
||||
UINT8 ObjectType2;
|
||||
UINT8 Count2;
|
||||
UINT8 Reserved;
|
||||
UINT16 Reserved;
|
||||
|
||||
} ACPI_PACKAGE_INFO;
|
||||
|
||||
@ -383,6 +384,7 @@ typedef struct acpi_package_info2
|
||||
UINT8 Type;
|
||||
UINT8 Count;
|
||||
UINT8 ObjectType[4];
|
||||
UINT8 Reserved;
|
||||
|
||||
} ACPI_PACKAGE_INFO2;
|
||||
|
||||
@ -394,7 +396,7 @@ typedef struct acpi_package_info3
|
||||
UINT8 Count;
|
||||
UINT8 ObjectType[2];
|
||||
UINT8 TailObjectType;
|
||||
UINT8 Reserved;
|
||||
UINT16 Reserved;
|
||||
|
||||
} ACPI_PACKAGE_INFO3;
|
||||
|
||||
@ -407,6 +409,10 @@ typedef union acpi_predefined_info
|
||||
|
||||
} ACPI_PREDEFINED_INFO;
|
||||
|
||||
/* Reset to default packing */
|
||||
|
||||
#pragma pack()
|
||||
|
||||
|
||||
/* Data block used during object validation */
|
||||
|
||||
|
@ -295,10 +295,6 @@ AcpiNsCheckPredefinedNames (
|
||||
ACPI_STATUS ReturnStatus,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
|
||||
const ACPI_PREDEFINED_INFO *
|
||||
AcpiNsCheckForPredefinedName (
|
||||
ACPI_NAMESPACE_NODE *Node);
|
||||
|
||||
void
|
||||
AcpiNsCheckParameterCount (
|
||||
char *Pathname,
|
||||
|
@ -47,7 +47,7 @@
|
||||
|
||||
/* Current ACPICA subsystem version in YYYYMMDD format */
|
||||
|
||||
#define ACPI_CA_VERSION 0x20130214
|
||||
#define ACPI_CA_VERSION 0x20130328
|
||||
|
||||
#include <contrib/dev/acpica/include/acconfig.h>
|
||||
#include <contrib/dev/acpica/include/actypes.h>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -119,9 +119,10 @@ typedef struct acpi_pkg_info
|
||||
|
||||
} ACPI_PKG_INFO;
|
||||
|
||||
/* Object reference counts */
|
||||
|
||||
#define REF_INCREMENT (UINT16) 0
|
||||
#define REF_DECREMENT (UINT16) 1
|
||||
#define REF_FORCE_DELETE (UINT16) 2
|
||||
|
||||
/* AcpiUtDumpBuffer */
|
||||
|
||||
@ -614,7 +615,7 @@ ACPI_STATUS
|
||||
AcpiUtInitializeInterfaces (
|
||||
void);
|
||||
|
||||
void
|
||||
ACPI_STATUS
|
||||
AcpiUtInterfaceTerminate (
|
||||
void);
|
||||
|
||||
@ -635,6 +636,38 @@ AcpiUtOsiImplementation (
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
|
||||
/*
|
||||
* utpredef - support for predefined names
|
||||
*/
|
||||
const ACPI_PREDEFINED_INFO *
|
||||
AcpiUtGetNextPredefinedMethod (
|
||||
const ACPI_PREDEFINED_INFO *ThisName);
|
||||
|
||||
const ACPI_PREDEFINED_INFO *
|
||||
AcpiUtMatchPredefinedMethod (
|
||||
char *Name);
|
||||
|
||||
const ACPI_PREDEFINED_INFO *
|
||||
AcpiUtMatchResourceName (
|
||||
char *Name);
|
||||
|
||||
void
|
||||
AcpiUtDisplayPredefinedMethod (
|
||||
char *Buffer,
|
||||
const ACPI_PREDEFINED_INFO *ThisName,
|
||||
BOOLEAN MultiLine);
|
||||
|
||||
void
|
||||
AcpiUtGetExpectedReturnTypes (
|
||||
char *Buffer,
|
||||
UINT32 ExpectedBtypes);
|
||||
|
||||
UINT32
|
||||
AcpiUtGetResourceBitWidth (
|
||||
char *Buffer,
|
||||
UINT16 Types);
|
||||
|
||||
|
||||
/*
|
||||
* utstate - Generic state creation/cache routines
|
||||
*/
|
||||
|
@ -61,8 +61,9 @@ SRCS+= tbfadt.c tbfind.c tbinstal.c tbutils.c tbxface.c \
|
||||
SRCS+= utaddress.c utalloc.c utcache.c utcopy.c utdebug.c \
|
||||
utdecode.c utdelete.c uteval.c utexcep.c utglobal.c \
|
||||
utids.c utinit.c utlock.c utmath.c utmisc.c utmutex.c \
|
||||
utobject.c utosi.c utownerid.c utresrc.c utstate.c \
|
||||
utstring.c uttrack.c utxface.c utxferror.c utxfinit.c
|
||||
utobject.c utosi.c utownerid.c utpredef.c utresrc.c \
|
||||
utstate.c utstring.c uttrack.c utxface.c utxferror.c \
|
||||
utxfinit.c
|
||||
|
||||
MAN= acpidb.8
|
||||
WARNS?= 2
|
||||
|
@ -11,18 +11,19 @@ SRCS+= ahpredef.c dmextern.c dmrestag.c dmtable.c dmtbdump.c \
|
||||
SRCS+= aslanalyze.c aslbtypes.c aslcodegen.c aslcompile.c \
|
||||
aslcompiler.y.h aslcompilerlex.c aslcompilerparse.c \
|
||||
aslerror.c aslfileio.c aslfiles.c aslfold.c aslhex.c \
|
||||
asllength.c asllisting.c aslload.c asllookup.c \
|
||||
aslmain.c aslmap.c aslmethod.c aslnamesp.c aslopcodes.c \
|
||||
asloperands.c aslopt.c aslpredef.c aslprepkg.c \
|
||||
aslresource.c aslrestype1.c aslrestype1i.c \
|
||||
aslrestype2.c aslrestype2d.c aslrestype2e.c \
|
||||
aslrestype2q.c aslrestype2s.c aslrestype2w.c \
|
||||
aslstartup.c aslstubs.c asltransform.c asltree.c \
|
||||
aslutils.c asluuid.c aslwalks.c aslxref.c dtcompile.c \
|
||||
dtexpress.c dtfield.c dtio.c dtparser.y.h dtparserlex.c \
|
||||
dtparserparse.c dtsubtable.c dttable.c dttemplate.c \
|
||||
dtutils.c prexpress.c prmacros.c prparser.y.h \
|
||||
prparserlex.c prparserparse.c prscan.c prutils.c
|
||||
asllength.c asllisting.c asllistsup.c aslload.c \
|
||||
asllookup.c aslmain.c aslmap.c aslmethod.c aslnamesp.c \
|
||||
asloffset.c aslopcodes.c asloperands.c aslopt.c \
|
||||
aslpredef.c aslprepkg.c aslresource.c aslrestype1.c \
|
||||
aslrestype1i.c aslrestype2.c aslrestype2d.c \
|
||||
aslrestype2e.c aslrestype2q.c aslrestype2s.c \
|
||||
aslrestype2w.c aslstartup.c aslstubs.c asltransform.c \
|
||||
asltree.c aslutils.c asluuid.c aslwalks.c aslxref.c \
|
||||
dtcompile.c dtexpress.c dtfield.c dtio.c dtparser.y.h \
|
||||
dtparserlex.c dtparserparse.c dtsubtable.c dttable.c \
|
||||
dttemplate.c dtutils.c prexpress.c prmacros.c \
|
||||
prparser.y.h prparserlex.c prparserparse.c prscan.c \
|
||||
prutils.c
|
||||
|
||||
# components/debugger
|
||||
SRCS+= dbfileio.c
|
||||
@ -57,8 +58,8 @@ SRCS+= tbfadt.c tbinstal.c tbutils.c tbxface.c
|
||||
SRCS+= utaddress.c utalloc.c utcache.c utcopy.c utdebug.c \
|
||||
utdecode.c utdelete.c utexcep.c utglobal.c utinit.c \
|
||||
utlock.c utmath.c utmisc.c utmutex.c utobject.c \
|
||||
utownerid.c utresrc.c utstate.c utstring.c utxface.c \
|
||||
utxferror.c
|
||||
utownerid.c utpredef.c utresrc.c utstate.c utstring.c \
|
||||
utxface.c utxferror.c
|
||||
|
||||
# os_specific/service_layers
|
||||
SRCS+= osunixxf.c
|
||||
|
Loading…
x
Reference in New Issue
Block a user