Merge ACPICA 20110316.

This commit is contained in:
Jung-uk Kim 2011-03-17 00:29:53 +00:00
commit dcbce41eb0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=219707
16 changed files with 612 additions and 71 deletions

View File

@ -1,8 +1,50 @@
----------------------------------------
16 March 2011. Summary of changes for version 20110316:
x
1) ACPI CA Core Subsystem:
Fixed a problem caused by a _PRW method appearing at the namespace root scope
during the setup of wake GPEs. A fault could occur if a _PRW directly under the
root object was passed to the AcpiSetupGpeForWake interface. Lin Ming.
Implemented support for "spurious" Global Lock interrupts. On some systems, a
global lock interrupt can occur without the pending flag being set. Upon a GL
interrupt, we now ensure that a thread is actually waiting for the lock before
signaling GL availability. Rafael Wysocki, Bob Moore.
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 (VC 9.0):
Non-Debug Version: 89.7K Code, 23.7K Data, 113.4K Total
Debug Version: 163.9K Code, 67.5K Data, 231.4K Total
Current Release (VC 9.0):
Non-Debug Version: 89.8K Code, 23.8K Data, 113.6K Total
Debug Version: 164.2K Code, 67.9K Data, 232.1K Total
2) iASL Compiler/Disassembler and Tools:
Implemented full support for the "SLIC" ACPI table. Includes support in the
header files, disassembler, table compiler, and template generator. Bob Moore,
Lin Ming.
AcpiXtract: Correctly handle embedded comments and messages from AcpiDump.
Apparently some or all versions of acpidump will occasionally emit a comment like
"Wrong checksum", etc., into the dump file. This was causing problems for
AcpiXtract. ACPICA BZ 905.
iASL: Fix the Linux makefile by removing an inadvertent double file inclusion.
ACPICA BZ 913.
AcpiExec: Update installation of operation region handlers. Install one handler
for a user-defined address space. This is used by the ASL test suite (ASLTS).
----------------------------------------
11 February 2011. Summary of changes for version 20110211:
This release is available at www.acpica.org/downloads
1) ACPI CA Core Subsystem:
Added a mechanism to defer _REG methods for some early-installed handlers.

View File

@ -192,6 +192,13 @@ static const char *AcpiDmMadtSubnames[] =
"Unknown SubTable Type" /* Reserved */
};
static const char *AcpiDmSlicSubnames[] =
{
"Public Key Structure",
"Windows Marker Structure",
"Unknown SubTable Type" /* Reserved */
};
static const char *AcpiDmSratSubnames[] =
{
"Processor Local APIC/SAPIC Affinity",
@ -270,7 +277,7 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct, "Maximum System Characteristics Table"},
{ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt, "Root System Description Table"},
{ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst, "Smart Battery Specification Table"},
{ACPI_SIG_SLIC, AcpiDmTableInfoSlic, NULL, NULL, NULL, "Software Licensing Description Table"},
{ACPI_SIG_SLIC, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateSlic, "Software Licensing Description Table"},
{ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit, "System Locality Information Table"},
{ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr, "Serial Port Console Redirection table"},
{ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, TemplateSpmi, "Server Platform Management Interface table"},
@ -475,30 +482,34 @@ AcpiDmLineHeader (
char *Name)
{
/* Allow a null name for fields that span multiple lines (large buffers) */
if (!Name)
{
Name = "";
}
if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */
{
if (ByteLength)
{
AcpiOsPrintf ("[%.3d] %34s : ",
ByteLength, Name);
AcpiOsPrintf ("[%.4d] %34s : ", ByteLength, Name);
}
else
{
AcpiOsPrintf ("%40s : ",
Name);
AcpiOsPrintf ("%41s : ", Name);
}
}
else /* Normal disassembler or verbose template */
{
if (ByteLength)
{
AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %28s : ",
AcpiOsPrintf ("[%3.3Xh %4.4d% 4d] %28s : ",
Offset, Offset, ByteLength, Name);
}
else
{
AcpiOsPrintf ("%43s : ",
Name);
AcpiOsPrintf ("%44s : ", Name);
}
}
}
@ -635,6 +646,7 @@ AcpiDmDumpTable (
case ACPI_DMT_UINT32:
case ACPI_DMT_NAME4:
case ACPI_DMT_SIG:
case ACPI_DMT_SLIC:
ByteLength = 4;
break;
case ACPI_DMT_NAME6:
@ -652,6 +664,9 @@ AcpiDmDumpTable (
case ACPI_DMT_UUID:
ByteLength = 16;
break;
case ACPI_DMT_BUF128:
ByteLength = 128;
break;
case ACPI_DMT_STRING:
ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1;
break;
@ -754,17 +769,26 @@ AcpiDmDumpTable (
case ACPI_DMT_BUF7:
case ACPI_DMT_BUF16:
case ACPI_DMT_BUF128:
/*
* Buffer: Size depends on the opcode and was set above.
* Each hex byte is separated with a space.
*/
for (Temp8 = 0; Temp8 < ByteLength; Temp8++)
for (Temp16 = 0; Temp16 < ByteLength; Temp16++)
{
AcpiOsPrintf ("%2.2X", Target[Temp8]);
if ((UINT32) (Temp8 + 1) < ByteLength)
AcpiOsPrintf ("%2.2X", Target[Temp16]);
if ((UINT32) (Temp16 + 1) < ByteLength)
{
AcpiOsPrintf (" ");
if ((Temp16 > 0) && (!((Temp16+1) % 16)))
{
AcpiOsPrintf ("\n");
AcpiDmLineHeader (0, 0, NULL);
}
else
{
AcpiOsPrintf (" ");
}
}
}
AcpiOsPrintf ("\n");
@ -991,6 +1015,19 @@ AcpiDmDumpTable (
AcpiOsPrintf ("%2.2X <%s>\n", *Target, AcpiDmMadtSubnames[Temp8]);
break;
case ACPI_DMT_SLIC:
/* SLIC subtable types */
Temp8 = *Target;
if (Temp8 > ACPI_SLIC_TYPE_RESERVED)
{
Temp8 = ACPI_SLIC_TYPE_RESERVED;
}
AcpiOsPrintf ("%8.8X <%s>\n", *Target, AcpiDmSlicSubnames[Temp8]);
break;
case ACPI_DMT_SRAT:
/* SRAT subtable types */

View File

@ -1273,6 +1273,81 @@ AcpiDmDumpMsct (
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpSlic
*
* PARAMETERS: Table - A SLIC table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a SLIC
*
******************************************************************************/
void
AcpiDmDumpSlic (
ACPI_TABLE_HEADER *Table)
{
ACPI_STATUS Status;
UINT32 Offset = sizeof (ACPI_TABLE_SLIC);
ACPI_SLIC_HEADER *SubTable;
ACPI_DMTABLE_INFO *InfoTable;
/* There is no main SLIC table, only subtables */
SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, Table, Offset);
while (Offset < Table->Length)
{
/* Common sub-table header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
SubTable->Length, AcpiDmTableInfoSlicHdr);
if (ACPI_FAILURE (Status))
{
return;
}
switch (SubTable->Type)
{
case ACPI_SLIC_TYPE_PUBLIC_KEY:
InfoTable = AcpiDmTableInfoSlic0;
break;
case ACPI_SLIC_TYPE_WINDOWS_MARKER:
InfoTable = AcpiDmTableInfoSlic1;
break;
default:
AcpiOsPrintf ("\n**** Unknown SLIC sub-table type 0x%X\n", SubTable->Type);
/* Attempt to continue */
if (!SubTable->Length)
{
AcpiOsPrintf ("Invalid zero length subtable\n");
return;
}
goto NextSubTable;
}
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
SubTable->Length, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
}
NextSubTable:
/* Point to next sub-table */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, SubTable, SubTable->Length);
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpSlit

View File

@ -50,6 +50,31 @@
#define _COMPONENT ACPI_CA_DISASSEMBLER
ACPI_MODULE_NAME ("dmtbinfo")
/*
* How to add a new table:
*
* - Add the C table definition to the actbl1.h or actbl2.h header.
* - Add ACPI_xxxx_OFFSET macro(s) for the table (and subtables) to list below.
* - Define the table in this file (for the disassembler). If any
* new data types are required (ACPI_DMT_*), see below.
* - Add an external declaration for the new table definition (AcpiDmTableInfo*)
* in acdisam.h
* - Add new table definition to the dispatch table in dmtable.c (AcpiDmTableData)
* If a simple table (with no subtables), no disassembly code is needed.
* Otherwise, create the AcpiDmDump* function for to disassemble the table
* and add it to the dmtbdump.c file.
* - Add an external declaration for the new AcpiDmDump* function in acdisasm.h
* - Add the new AcpiDmDump* function to the dispatch table in dmtable.c
* - Create a template for the new table
* - Add data table compiler support
*
* How to add a new data type (ACPI_DMT_*):
*
* - Add new type at the end of the ACPI_DMT list in acdisasm.h
* - Add length and implementation cases in dmtable.c (disassembler)
* - Add type and length cases in dtutils.c (DT compiler)
*/
/*
* Macros used to generate offsets to specific table fields
*/
@ -131,6 +156,9 @@
#define ACPI_MADTH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
#define ACPI_MCFG0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f)
#define ACPI_MSCT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f)
#define ACPI_SLICH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SLIC_HEADER,f)
#define ACPI_SLIC0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SLIC_KEY,f)
#define ACPI_SLIC1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SLIC_MARKER,f)
#define ACPI_SRATH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
#define ACPI_SRAT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f)
#define ACPI_SRAT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
@ -1256,13 +1284,42 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[] =
/*******************************************************************************
*
* SLIC - Software Licensing Description Table. NOT FULLY IMPLEMENTED, do not
* have the table definition.
* SLIC - Software Licensing Description Table. There is no common table, just
* the standard ACPI header and then subtables.
*
******************************************************************************/
ACPI_DMTABLE_INFO AcpiDmTableInfoSlic[] =
/* Common Subtable header (one per Subtable) */
ACPI_DMTABLE_INFO AcpiDmTableInfoSlicHdr[] =
{
{ACPI_DMT_SLIC, ACPI_SLICH_OFFSET (Type), "Subtable Type", 0},
{ACPI_DMT_UINT32, ACPI_SLICH_OFFSET (Length), "Length", DT_LENGTH},
ACPI_DMT_TERMINATOR
};
ACPI_DMTABLE_INFO AcpiDmTableInfoSlic0[] =
{
{ACPI_DMT_UINT8, ACPI_SLIC0_OFFSET (KeyType), "Key Type", 0},
{ACPI_DMT_UINT8, ACPI_SLIC0_OFFSET (Version), "Version", 0},
{ACPI_DMT_UINT16, ACPI_SLIC0_OFFSET (Reserved), "Reserved", 0},
{ACPI_DMT_UINT32, ACPI_SLIC0_OFFSET (Algorithm), "Algorithm", 0},
{ACPI_DMT_NAME4, ACPI_SLIC0_OFFSET (Magic), "Magic", 0},
{ACPI_DMT_UINT32, ACPI_SLIC0_OFFSET (BitLength), "BitLength", 0},
{ACPI_DMT_UINT32, ACPI_SLIC0_OFFSET (Exponent), "Exponent", 0},
{ACPI_DMT_BUF128, ACPI_SLIC0_OFFSET (Modulus[0]), "Modulus", 0},
ACPI_DMT_TERMINATOR
};
ACPI_DMTABLE_INFO AcpiDmTableInfoSlic1[] =
{
{ACPI_DMT_UINT32, ACPI_SLIC1_OFFSET (Version), "Version", 0},
{ACPI_DMT_NAME6, ACPI_SLIC1_OFFSET (OemId[0]), "Oem ID", 0},
{ACPI_DMT_NAME8, ACPI_SLIC1_OFFSET (OemTableId[0]), "Oem Table ID", 0},
{ACPI_DMT_NAME8, ACPI_SLIC1_OFFSET (WindowsFlag[0]), "Windows Flag", 0},
{ACPI_DMT_UINT32, ACPI_SLIC1_OFFSET (SlicVersion), "SLIC Version", 0},
{ACPI_DMT_BUF16, ACPI_SLIC1_OFFSET (Reserved[0]), "Reserved", 0},
{ACPI_DMT_BUF128, ACPI_SLIC1_OFFSET (Signature[0]), "Signature", 0},
ACPI_DMT_TERMINATOR
};

View File

@ -728,6 +728,21 @@ ASLCode
| error {YYABORT; $$ = NULL;}
;
/*
* Note concerning support for "module-level code".
*
* ACPI 1.0 allowed Type1 and Type2 executable opcodes outside of control
* methods (the so-called module-level code.) This support was explicitly
* removed in ACPI 2.0, but this type of code continues to be created by
* BIOS vendors. In order to support the disassembly and recompilation of
* such code (and the porting of ASL code to iASL), iASL supports this
* code in violation of the current ACPI specification.
*
* The grammar change to support module-level code is to revert the
* {ObjectList} portion of the DefinitionBlockTerm in ACPI 2.0 to the
* original use of {TermList} instead (see below.) This allows the use
* of Type1 and Type2 opcodes at module level.
*/
DefinitionBlockTerm
: PARSEOP_DEFINITIONBLOCK '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITIONBLOCK);}
String ','

View File

@ -393,6 +393,10 @@ ACPI_STATUS
DtCompileRsdt (
void **PFieldList);
ACPI_STATUS
DtCompileSlic (
void **PFieldList);
ACPI_STATUS
DtCompileSlit (
void **PFieldList);

View File

@ -60,6 +60,10 @@ static void
DtLinkField (
DT_FIELD *Field);
static void
DtMergeField (
char *Value);
static ACPI_STATUS
DtParseLine (
char *LineBuffer,
@ -220,6 +224,56 @@ DtLinkField (
}
/******************************************************************************
*
* FUNCTION: DtMergeField
*
* PARAMETERS: Value - Merge this line into previous one
*
* RETURN: None
*
* DESCRIPTION: Merge a field value to the previous one,
* probably for a multi-line buffer definition.
*
*****************************************************************************/
static void
DtMergeField (
char *Value)
{
DT_FIELD *Prev;
DT_FIELD *Next;
char *NewValue;
UINT32 PrevLength;
UINT32 ThisLength;
Prev = Next = Gbl_FieldList;
while (Next)
{
Prev = Next;
Next = Next->Next;
}
if (Prev)
{
PrevLength = ACPI_STRLEN (Prev->Value);
ThisLength = ACPI_STRLEN (Value);
/* Add two for: separator + NULL terminator */
NewValue = UtLocalCalloc (PrevLength + ThisLength + 2);
ACPI_STRNCPY (NewValue, Prev->Value, PrevLength);
NewValue[PrevLength] = ' ';
ACPI_STRNCPY ((NewValue + PrevLength + 1), Value, ThisLength);
ACPI_FREE (Prev->Value);
Prev->Value = NewValue;
}
}
/******************************************************************************
*
* FUNCTION: DtParseLine
@ -354,11 +408,12 @@ DtParseLine (
Length = ACPI_PTR_DIFF (End, Start);
TmpValue = UtLocalCalloc (Length + 1);
ACPI_STRNCPY (TmpValue, Start, Length);
Value = DtTrim (TmpValue);
ACPI_FREE (TmpValue);
if (Name && Value)
if (ACPI_STRLEN (Name) && Value)
{
Field = UtLocalCalloc (sizeof (DT_FIELD));
Field->Name = Name;
@ -370,6 +425,17 @@ DtParseLine (
DtLinkField (Field);
}
else if (!ACPI_STRLEN (Name))
{
/* Handle multi-line buffers (length > 16) */
DtMergeField (Value);
}
else
{
ACPI_FREE (Name);
ACPI_FREE (Value);
}
return (AE_OK);
}

View File

@ -1132,6 +1132,75 @@ DtCompileRsdt (
}
/******************************************************************************
*
* FUNCTION: DtCompileSlic
*
* PARAMETERS: List - Current field list pointer
*
* RETURN: Status
*
* DESCRIPTION: Compile SLIC.
*
*****************************************************************************/
ACPI_STATUS
DtCompileSlic (
void **List)
{
ACPI_STATUS Status;
DT_SUBTABLE *Subtable;
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
DT_FIELD *SubtableStart;
ACPI_SLIC_HEADER *SlicHeader;
ACPI_DMTABLE_INFO *InfoTable;
while (*PFieldList)
{
SubtableStart = *PFieldList;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlicHdr,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
SlicHeader = ACPI_CAST_PTR (ACPI_SLIC_HEADER, Subtable->Buffer);
switch (SlicHeader->Type)
{
case ACPI_SLIC_TYPE_PUBLIC_KEY:
InfoTable = AcpiDmTableInfoSlic0;
break;
case ACPI_SLIC_TYPE_WINDOWS_MARKER:
InfoTable = AcpiDmTableInfoSlic1;
break;
default:
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SLIC");
return (AE_ERROR);
}
Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPopSubtable ();
}
return (AE_OK);
}
/******************************************************************************
*
* FUNCTION: DtCompileSlit

View File

@ -534,6 +534,57 @@ const unsigned char TemplateSbst[] =
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000028 "........" */
};
const unsigned char TemplateSlic[] =
{
0x53,0x4C,0x49,0x43,0x76,0x01,0x00,0x00, /* 00000000 "SLICv..." */
0x01,0x07,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
0x11,0x02,0x11,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */
0x9C,0x00,0x00,0x00,0x06,0x02,0x00,0x00, /* 00000028 "........" */
0x00,0x24,0x00,0x00,0x52,0x53,0x41,0x31, /* 00000030 ".$..RSA1" */
0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */
0x01,0x00,0x00,0x00,0xB6,0x00,0x00,0x00, /* 000000C0 "........" */
0x00,0x00,0x02,0x00,0x49,0x4E,0x54,0x45, /* 000000C8 "....INTE" */
0x4C,0x20,0x54,0x45,0x4D,0x50,0x4C,0x41, /* 000000D0 "L TEMPLA" */
0x54,0x45,0x57,0x49,0x4E,0x44,0x4F,0x57, /* 000000D8 "TEWINDOW" */
0x53,0x20,0x01,0x00,0x02,0x00,0x00,0x00, /* 000000E0 "S ......" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F0 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000150 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "........" */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000168 "........" */
0x00,0x00,0x00,0x00,0x00,0x00 /* 00000170 "......" */
};
const unsigned char TemplateSlit[] =
{
0x53,0x4C,0x49,0x54,0x3C,0x00,0x00,0x00, /* 00000000 "SLIT<..." */

View File

@ -401,6 +401,7 @@ DtGetFieldType (
case ACPI_DMT_BUFFER:
case ACPI_DMT_BUF7:
case ACPI_DMT_BUF16:
case ACPI_DMT_BUF128:
case ACPI_DMT_PCI_PATH:
Type = DT_FIELD_TYPE_BUFFER;
break;
@ -546,6 +547,7 @@ DtGetFieldLength (
case ACPI_DMT_UINT32:
case ACPI_DMT_NAME4:
case ACPI_DMT_SLIC:
case ACPI_DMT_SIG:
ByteLength = 4;
break;
@ -605,6 +607,10 @@ DtGetFieldLength (
ByteLength = 16;
break;
case ACPI_DMT_BUF128:
ByteLength = 128;
break;
case ACPI_DMT_UNICODE:
Value = DtGetFieldValue (Field, Info->Name);

View File

@ -309,12 +309,8 @@ AcpiEvNotifyDispatch (
* RETURN: ACPI_INTERRUPT_HANDLED
*
* DESCRIPTION: Invoked directly from the SCI handler when a global lock
* release interrupt occurs. Attempt to acquire the global lock,
* if successful, signal the thread waiting for the lock.
*
* NOTE: Assumes that the semaphore can be signaled from interrupt level. If
* this is not possible for some reason, a separate thread will have to be
* scheduled to do this.
* release interrupt occurs. If there is actually a pending
* request for the lock, signal the waiting thread.
*
******************************************************************************/
@ -322,32 +318,38 @@ static UINT32
AcpiEvGlobalLockHandler (
void *Context)
{
BOOLEAN Acquired = FALSE;
ACPI_STATUS Status;
ACPI_CPU_FLAGS Flags;
Flags = AcpiOsAcquireLock (AcpiGbl_GlobalLockPendingLock);
/*
* Attempt to get the lock.
*
* If we don't get it now, it will be marked pending and we will
* take another interrupt when it becomes free.
* If a request for the global lock is not actually pending,
* we are done. This handles "spurious" global lock interrupts
* which are possible (and have been seen) with bad BIOSs.
*/
ACPI_ACQUIRE_GLOBAL_LOCK (AcpiGbl_FACS, Acquired);
if (Acquired)
if (!AcpiGbl_GlobalLockPending)
{
/* Got the lock, now wake the thread waiting for it */
AcpiGbl_GlobalLockAcquired = TRUE;
/* Send a unit to the semaphore */
Status = AcpiOsSignalSemaphore (AcpiGbl_GlobalLockSemaphore, 1);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR ((AE_INFO, "Could not signal Global Lock semaphore"));
}
goto CleanupAndExit;
}
/*
* Send a unit to the global lock semaphore. The actual acquisition
* of the global lock will be performed by the waiting thread.
*/
Status = AcpiOsSignalSemaphore (AcpiGbl_GlobalLockSemaphore, 1);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR ((AE_INFO, "Could not signal Global Lock semaphore"));
}
AcpiGbl_GlobalLockPending = FALSE;
CleanupAndExit:
AcpiOsReleaseLock (AcpiGbl_GlobalLockPendingLock, Flags);
return (ACPI_INTERRUPT_HANDLED);
}
@ -385,15 +387,22 @@ AcpiEvInitGlobalLockHandler (
* Map to AE_OK, but mark global lock as not present. Any attempt to
* actually use the global lock will be flagged with an error.
*/
AcpiGbl_GlobalLockPresent = FALSE;
if (Status == AE_NO_HARDWARE_RESPONSE)
{
ACPI_ERROR ((AE_INFO,
"No response from Global Lock hardware, disabling lock"));
AcpiGbl_GlobalLockPresent = FALSE;
return_ACPI_STATUS (AE_OK);
}
Status = AcpiOsCreateLock (&AcpiGbl_GlobalLockPendingLock);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
AcpiGbl_GlobalLockPending = FALSE;
AcpiGbl_GlobalLockPresent = TRUE;
return_ACPI_STATUS (Status);
}
@ -454,7 +463,8 @@ ACPI_STATUS
AcpiEvAcquireGlobalLock (
UINT16 Timeout)
{
ACPI_STATUS Status = AE_OK;
ACPI_CPU_FLAGS Flags;
ACPI_STATUS Status;
BOOLEAN Acquired = FALSE;
@ -487,8 +497,8 @@ AcpiEvAcquireGlobalLock (
}
/*
* Make sure that a global lock actually exists. If not, just treat the
* lock as a standard mutex.
* Make sure that a global lock actually exists. If not, just
* treat the lock as a standard mutex.
*/
if (!AcpiGbl_GlobalLockPresent)
{
@ -496,31 +506,45 @@ AcpiEvAcquireGlobalLock (
return_ACPI_STATUS (AE_OK);
}
/* Attempt to acquire the actual hardware lock */
Flags = AcpiOsAcquireLock (AcpiGbl_GlobalLockPendingLock);
ACPI_ACQUIRE_GLOBAL_LOCK (AcpiGbl_FACS, Acquired);
if (Acquired)
do
{
/* We got the lock */
/* Attempt to acquire the actual hardware lock */
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Acquired hardware Global Lock\n"));
ACPI_ACQUIRE_GLOBAL_LOCK (AcpiGbl_FACS, Acquired);
if (Acquired)
{
AcpiGbl_GlobalLockAcquired = TRUE;
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Acquired hardware Global Lock\n"));
break;
}
AcpiGbl_GlobalLockAcquired = TRUE;
return_ACPI_STATUS (AE_OK);
}
/*
* Did not get the lock. The pending bit was set above, and
* we must now wait until we receive the global lock
* released interrupt.
*/
AcpiGbl_GlobalLockPending = TRUE;
AcpiOsReleaseLock (AcpiGbl_GlobalLockPendingLock, Flags);
/*
* Did not get the lock. The pending bit was set above, and we must now
* wait until we get the global lock released interrupt.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Waiting for hardware Global Lock\n"));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Waiting for hardware Global Lock\n"));
/*
* Wait for handshake with the global lock interrupt handler.
* This interface releases the interpreter if we must wait.
*/
Status = AcpiExSystemWaitSemaphore (AcpiGbl_GlobalLockSemaphore,
ACPI_WAIT_FOREVER);
/*
* Wait for handshake with the global lock interrupt handler.
* This interface releases the interpreter if we must wait.
*/
Status = AcpiExSystemWaitSemaphore (AcpiGbl_GlobalLockSemaphore,
ACPI_WAIT_FOREVER);
Flags = AcpiOsAcquireLock (AcpiGbl_GlobalLockPendingLock);
} while (ACPI_SUCCESS (Status));
AcpiGbl_GlobalLockPending = FALSE;
AcpiOsReleaseLock (AcpiGbl_GlobalLockPendingLock, Flags);
return_ACPI_STATUS (Status);
}

View File

@ -314,9 +314,19 @@ AcpiSetupGpeForWake (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/* Handle root object case */
if (WakeDevice == ACPI_ROOT_OBJECT)
{
DeviceNode = AcpiGbl_RootNode;
}
else
{
DeviceNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, WakeDevice);
}
/* Validate WakeDevice is of type Device */
DeviceNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, WakeDevice);
if (DeviceNode->Type != ACPI_TYPE_DEVICE)
{
return_ACPI_STATUS (AE_BAD_PARAMETER);

View File

@ -129,7 +129,8 @@ typedef const struct acpi_dmtable_info
#define ACPI_DMT_DEVICE_PATH 44
#define ACPI_DMT_LABEL 45
#define ACPI_DMT_BUF7 46
#define ACPI_DMT_BUF128 47
#define ACPI_DMT_SLIC 48
typedef
void (*ACPI_DMTABLE_HANDLER) (
@ -262,7 +263,9 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlicHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlit[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[];
@ -378,6 +381,10 @@ void
AcpiDmDumpRsdt (
ACPI_TABLE_HEADER *Table);
void
AcpiDmDumpSlic (
ACPI_TABLE_HEADER *Table);
void
AcpiDmDumpSlit (
ACPI_TABLE_HEADER *Table);

View File

@ -190,13 +190,16 @@ ACPI_EXTERN ACPI_MUTEX_INFO AcpiGbl_MutexInfo[ACPI_NUM_MUTEX];
/*
* Global lock mutex is an actual AML mutex object
* Global lock semaphore works in conjunction with the HW global lock
* Global lock semaphore works in conjunction with the actual global lock
* Global lock spinlock is used for "pending" handshake
*/
ACPI_EXTERN ACPI_OPERAND_OBJECT *AcpiGbl_GlobalLockMutex;
ACPI_EXTERN ACPI_SEMAPHORE AcpiGbl_GlobalLockSemaphore;
ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_GlobalLockPendingLock;
ACPI_EXTERN UINT16 AcpiGbl_GlobalLockHandle;
ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockAcquired;
ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockPresent;
ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockPending;
/*
* Spinlocks are used for interfaces that can be possibly called at

View File

@ -48,7 +48,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
#define ACPI_CA_VERSION 0x20110211
#define ACPI_CA_VERSION 0x20110316
#include <contrib/dev/acpica/include/actypes.h>
#include <contrib/dev/acpica/include/actbl.h>

View File

@ -1,6 +1,6 @@
/******************************************************************************
*
* Name: actbl2.h - ACPI Specification Revision 2.0 Tables
* Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec)
*
*****************************************************************************/
@ -829,6 +829,81 @@ typedef struct acpi_table_mchi
} ACPI_TABLE_MCHI;
/*******************************************************************************
*
* SLIC - Software Licensing Description Table
* Version 1
*
* Conforms to "OEM Activation 2.0 for Windows Vista Operating Systems",
* Copyright 2006
*
******************************************************************************/
/* Basic SLIC table is only the common ACPI header */
typedef struct acpi_table_slic
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
} ACPI_TABLE_SLIC;
/* Common SLIC subtable header */
typedef struct acpi_slic_header
{
UINT32 Type;
UINT32 Length;
} ACPI_SLIC_HEADER;
/* Values for Type field above */
enum AcpiSlicType
{
ACPI_SLIC_TYPE_PUBLIC_KEY = 0,
ACPI_SLIC_TYPE_WINDOWS_MARKER = 1,
ACPI_SLIC_TYPE_RESERVED = 2 /* 2 and greater are reserved */
};
/*
* SLIC Sub-tables, correspond to Type in ACPI_SLIC_HEADER
*/
/* 0: Public Key Structure */
typedef struct acpi_slic_key
{
ACPI_SLIC_HEADER Header;
UINT8 KeyType;
UINT8 Version;
UINT16 Reserved;
UINT32 Algorithm;
char Magic[4];
UINT32 BitLength;
UINT32 Exponent;
UINT8 Modulus[128];
} ACPI_SLIC_KEY;
/* 1: Windows Marker Structure */
typedef struct acpi_slic_marker
{
ACPI_SLIC_HEADER Header;
UINT32 Version;
char OemId[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */
char OemTableId[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
char WindowsFlag[8];
UINT32 SlicVersion;
UINT8 Reserved[16];
UINT8 Signature[128];
} ACPI_SLIC_MARKER;
/*******************************************************************************
*
* SPCR - Serial Port Console Redirection table