summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2013-07-26 18:20:00 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2013-07-26 18:20:00 +0000
commitdbded195f9840f9044a6828c8877c6bf0a956482 (patch)
treee05da15a04629f6e36af5ca6c81a2efda47a9dc3 /source
parent94c37fb2483cc09856a30e74879a69f2ccfe22f0 (diff)
downloadsrc-test2-dbded195f9840f9044a6828c8877c6bf0a956482.tar.gz
src-test2-dbded195f9840f9044a6828c8877c6bf0a956482.zip
Notes
Diffstat (limited to 'source')
-rw-r--r--source/common/dmextern.c47
-rw-r--r--source/common/getopt.c20
-rw-r--r--source/compiler/asloffset.c172
-rw-r--r--source/compiler/asloperands.c9
-rw-r--r--source/compiler/asloptions.c2
-rw-r--r--source/compiler/dttemplate.c23
-rw-r--r--source/components/executer/exoparg1.c50
-rw-r--r--source/components/hardware/hwtimer.c15
-rw-r--r--source/components/namespace/nspredef.c18
-rw-r--r--source/components/namespace/nswalk.c18
-rw-r--r--source/components/namespace/nsxfeval.c14
-rw-r--r--source/components/tables/tbfadt.c4
-rw-r--r--source/components/tables/tbxfroot.c10
-rw-r--r--source/components/utilities/utglobal.c1
-rw-r--r--source/components/utilities/utosi.c89
-rw-r--r--source/components/utilities/utxface.c34
-rw-r--r--source/include/acglobal.h7
-rw-r--r--source/include/aclocal.h17
-rw-r--r--source/include/acnamesp.h4
-rw-r--r--source/include/acpixf.h11
-rw-r--r--source/include/actables.h4
-rw-r--r--source/include/actypes.h28
-rw-r--r--source/include/acutils.h4
-rw-r--r--source/include/platform/acfreebsd.h12
-rw-r--r--source/os_specific/service_layers/osfreebsdtbl.c27
-rw-r--r--source/os_specific/service_layers/oslinuxtbl.c23
-rw-r--r--source/tools/acpiexec/aetables.c9
-rw-r--r--source/tools/acpiexec/aetables.h54
28 files changed, 548 insertions, 178 deletions
diff --git a/source/common/dmextern.c b/source/common/dmextern.c
index 5baa462579ee..e74311701bc4 100644
--- a/source/common/dmextern.c
+++ b/source/common/dmextern.c
@@ -719,34 +719,54 @@ AcpiDmEmitExternals (
AcpiDmUnresolvedWarning (1);
+ /* Emit any unresolved method externals in a single text block */
+
+ NextExternal = AcpiGbl_ExternalList;
+ while (NextExternal)
+ {
+ if ((NextExternal->Type == ACPI_TYPE_METHOD) &&
+ (!NextExternal->Resolved))
+ {
+ AcpiOsPrintf (" External (%s%s",
+ NextExternal->Path,
+ AcpiDmGetObjectTypeName (NextExternal->Type));
+
+ AcpiOsPrintf (") // Warning: Unresolved Method, "
+ "guessing %u arguments (may be incorrect, see warning above)\n",
+ NextExternal->Value);
+
+ NextExternal->Emitted = TRUE;
+ }
+
+ NextExternal = NextExternal->Next;
+ }
+
+ AcpiOsPrintf ("\n");
+
/*
* Walk the list of externals (unresolved references)
* found during the AML parsing
*/
while (AcpiGbl_ExternalList)
{
- AcpiOsPrintf (" External (%s%s",
- AcpiGbl_ExternalList->Path,
- AcpiDmGetObjectTypeName (AcpiGbl_ExternalList->Type));
-
- if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD)
+ if (!AcpiGbl_ExternalList->Emitted)
{
- if (AcpiGbl_ExternalList->Resolved)
+ AcpiOsPrintf (" External (%s%s",
+ AcpiGbl_ExternalList->Path,
+ AcpiDmGetObjectTypeName (AcpiGbl_ExternalList->Type));
+
+ /* For methods, add a comment with the number of arguments */
+
+ if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD)
{
AcpiOsPrintf (") // %u Arguments\n",
AcpiGbl_ExternalList->Value);
}
else
{
- AcpiOsPrintf (") // Warning: unresolved Method, "
- "assuming %u arguments (may be incorrect, see warning above)\n",
- AcpiGbl_ExternalList->Value);
+ AcpiOsPrintf (")\n");
}
}
- else
- {
- AcpiOsPrintf (")\n");
- }
/* Free this external info block and move on to next external */
@@ -931,5 +951,4 @@ AcpiDmUnresolvedWarning (
(AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods));
}
}
-
}
diff --git a/source/common/getopt.c b/source/common/getopt.c
index f1921ee2c2cb..4bcf3dbc2821 100644
--- a/source/common/getopt.c
+++ b/source/common/getopt.c
@@ -197,6 +197,26 @@ AcpiGetopt(
CurrentCharPtr = 1;
}
+ /* Option has an optional argument? */
+
+ else if (*OptsPtr == '+')
+ {
+ if (argv[AcpiGbl_Optind][(int) (CurrentCharPtr+1)] != '\0')
+ {
+ AcpiGbl_Optarg = &argv[AcpiGbl_Optind++][(int) (CurrentCharPtr+1)];
+ }
+ else if (++AcpiGbl_Optind >= argc)
+ {
+ AcpiGbl_Optarg = NULL;
+ }
+ else
+ {
+ AcpiGbl_Optarg = argv[AcpiGbl_Optind++];
+ }
+
+ CurrentCharPtr = 1;
+ }
+
/* Option has optional single-char arguments? */
else if (*OptsPtr == '^')
diff --git a/source/compiler/asloffset.c b/source/compiler/asloffset.c
index 25e5b0f43fef..b2fe775d84bb 100644
--- a/source/compiler/asloffset.c
+++ b/source/compiler/asloffset.c
@@ -57,10 +57,12 @@ static void
LsEmitOffsetTableEntry (
UINT32 FileId,
ACPI_NAMESPACE_NODE *Node,
+ UINT32 NamepathOffset,
UINT32 Offset,
char *OpName,
UINT64 Value,
- UINT8 AmlOpcode);
+ UINT8 AmlOpcode,
+ UINT16 ParentOpcode);
/*******************************************************************************
@@ -94,7 +96,8 @@ LsAmlOffsetWalk (
UINT32 FileId = (UINT32) ACPI_TO_INTEGER (Context);
ACPI_NAMESPACE_NODE *Node;
UINT32 Length;
- UINT32 OffsetOfOpcode;
+ UINT32 NamepathOffset;
+ UINT32 DataOffset;
ACPI_PARSE_OBJECT *NextOp;
@@ -119,8 +122,9 @@ LsAmlOffsetWalk (
if ((Node->Type == ACPI_TYPE_LOCAL_RESOURCE) &&
(Op->Asl.CompileFlags & NODE_IS_RESOURCE_DESC))
{
- LsEmitOffsetTableEntry (FileId, Node, Gbl_CurrentAmlOffset,
- Op->Asl.ParseOpName, 0, Op->Asl.Extra);
+ LsEmitOffsetTableEntry (FileId, Node, 0, Gbl_CurrentAmlOffset,
+ Op->Asl.ParseOpName, 0, Op->Asl.Extra, AML_BUFFER_OP);
+
Gbl_CurrentAmlOffset += Op->Asl.FinalAmlLength;
return (AE_OK);
}
@@ -138,22 +142,25 @@ LsAmlOffsetWalk (
}
Length = Op->Asl.FinalAmlLength;
+ NamepathOffset = Gbl_CurrentAmlOffset + Length;
/* Get to the NameSeg/NamePath Op (and length of the name) */
Op = Op->Asl.Child;
- OffsetOfOpcode = Length + Op->Asl.FinalAmlLength;
+
+ /* Get offset of last nameseg and the actual data */
+
+ NamepathOffset = Gbl_CurrentAmlOffset + Length +
+ (Op->Asl.FinalAmlLength - ACPI_NAME_SIZE);
+
+ DataOffset = Gbl_CurrentAmlOffset + 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:
@@ -161,22 +168,32 @@ LsAmlOffsetWalk (
/* The +1 is to handle the integer size prefix (opcode) */
- LsEmitOffsetTableEntry (FileId, Node,
- (Gbl_CurrentAmlOffset + OffsetOfOpcode + 1),
+ LsEmitOffsetTableEntry (FileId, Node, NamepathOffset, (DataOffset + 1),
Op->Asl.ParseOpName, Op->Asl.Value.Integer,
- (UINT8) Op->Asl.AmlOpcode);
+ (UINT8) Op->Asl.AmlOpcode, AML_NAME_OP);
+ break;
+
+ case AML_ONE_OP:
+ case AML_ONES_OP:
+ case AML_ZERO_OP:
+
+ /* For these, offset will point to the opcode */
+
+ LsEmitOffsetTableEntry (FileId, Node, NamepathOffset, DataOffset,
+ Op->Asl.ParseOpName, Op->Asl.Value.Integer,
+ (UINT8) Op->Asl.AmlOpcode, AML_NAME_OP);
break;
case AML_PACKAGE_OP:
case AML_VAR_PACKAGE_OP:
+ /* Get the package element count */
+
NextOp = Op->Asl.Child;
- LsEmitOffsetTableEntry (FileId, Node,
- (Gbl_CurrentAmlOffset + OffsetOfOpcode),
- Op->Asl.ParseOpName,
- NextOp->Asl.Value.Integer,
- (UINT8) Op->Asl.AmlOpcode);
+ LsEmitOffsetTableEntry (FileId, Node, NamepathOffset, DataOffset,
+ Op->Asl.ParseOpName, NextOp->Asl.Value.Integer,
+ (UINT8) Op->Asl.AmlOpcode, AML_NAME_OP);
break;
default:
@@ -195,7 +212,14 @@ LsAmlOffsetWalk (
/* Get the name/namepath node */
NextOp = Op->Asl.Child;
- OffsetOfOpcode = Length + NextOp->Asl.FinalAmlLength + 1;
+
+ /* Get offset of last nameseg and the actual data */
+
+ NamepathOffset = Gbl_CurrentAmlOffset + Length +
+ (NextOp->Asl.FinalAmlLength - ACPI_NAME_SIZE);
+
+ DataOffset = Gbl_CurrentAmlOffset + Length +
+ (NextOp->Asl.FinalAmlLength + 1);
/* Get the SpaceId node, then the Offset (address) node */
@@ -214,10 +238,9 @@ LsAmlOffsetWalk (
case AML_DWORD_OP:
case AML_QWORD_OP:
- LsEmitOffsetTableEntry (FileId, Node,
- (Gbl_CurrentAmlOffset + OffsetOfOpcode + 1),
+ LsEmitOffsetTableEntry (FileId, Node, NamepathOffset, (DataOffset + 1),
Op->Asl.ParseOpName, NextOp->Asl.Value.Integer,
- (UINT8) NextOp->Asl.AmlOpcode);
+ (UINT8) NextOp->Asl.AmlOpcode, AML_REGION_OP);
Gbl_CurrentAmlOffset += Length;
return (AE_OK);
@@ -237,15 +260,62 @@ LsAmlOffsetWalk (
NextOp = Op->Asl.Child;
- /* Point to the *last* nameseg in the namepath */
+ /* Get offset of last nameseg and the actual data (flags byte) */
- OffsetOfOpcode = NextOp->Asl.FinalAmlLength - ACPI_NAME_SIZE;
+ NamepathOffset = Gbl_CurrentAmlOffset + Length +
+ (NextOp->Asl.FinalAmlLength - ACPI_NAME_SIZE);
- LsEmitOffsetTableEntry (FileId, Node,
- (Gbl_CurrentAmlOffset + OffsetOfOpcode + Length),
- Op->Asl.ParseOpName,
- *((UINT32 *) &NextOp->Asl.Value.Buffer[OffsetOfOpcode]),
- (UINT8) Op->Asl.AmlOpcode);
+ DataOffset = Gbl_CurrentAmlOffset + Length +
+ NextOp->Asl.FinalAmlLength;
+
+ /* Get the flags byte Op */
+
+ NextOp = NextOp->Asl.Next;
+
+ LsEmitOffsetTableEntry (FileId, Node, NamepathOffset, DataOffset,
+ Op->Asl.ParseOpName, NextOp->Asl.Value.Integer,
+ (UINT8) Op->Asl.AmlOpcode, AML_METHOD_OP);
+ break;
+
+ case AML_PROCESSOR_OP:
+
+ /* Processor (Namepath, ProcessorId, Address, Length) */
+
+ Length = Op->Asl.FinalAmlLength;
+ NextOp = Op->Asl.Child; /* Get Namepath */
+
+ /* Get offset of last nameseg and the actual data (PBlock address) */
+
+ NamepathOffset = Gbl_CurrentAmlOffset + Length +
+ (NextOp->Asl.FinalAmlLength - ACPI_NAME_SIZE);
+
+ DataOffset = Gbl_CurrentAmlOffset + Length +
+ (NextOp->Asl.FinalAmlLength + 1);
+
+ NextOp = NextOp->Asl.Next; /* Get ProcessorID (BYTE) */
+ NextOp = NextOp->Asl.Next; /* Get Address (DWORD) */
+
+ LsEmitOffsetTableEntry (FileId, Node, NamepathOffset, DataOffset,
+ Op->Asl.ParseOpName, NextOp->Asl.Value.Integer,
+ (UINT8) AML_DWORD_OP, AML_PROCESSOR_OP);
+ break;
+
+ case AML_DEVICE_OP:
+ case AML_SCOPE_OP:
+ case AML_THERMAL_ZONE_OP:
+
+ /* Device/Scope/ThermalZone (Namepath) */
+
+ Length = Op->Asl.FinalAmlLength;
+ NextOp = Op->Asl.Child; /* Get Namepath */
+
+ /* Get offset of last nameseg */
+
+ NamepathOffset = Gbl_CurrentAmlOffset + Length +
+ (NextOp->Asl.FinalAmlLength - ACPI_NAME_SIZE);
+
+ LsEmitOffsetTableEntry (FileId, Node, NamepathOffset, 0,
+ Op->Asl.ParseOpName, 0, (UINT8) 0, Op->Asl.AmlOpcode);
break;
default:
@@ -267,6 +337,7 @@ LsAmlOffsetWalk (
* OpName - Name of the AML opcode
* Value - Current value of the AML field
* AmlOpcode - Opcode associated with the field
+ * ObjectType - ACPI object type
*
* RETURN: None
*
@@ -278,10 +349,12 @@ static void
LsEmitOffsetTableEntry (
UINT32 FileId,
ACPI_NAMESPACE_NODE *Node,
+ UINT32 NamepathOffset,
UINT32 Offset,
char *OpName,
UINT64 Value,
- UINT8 AmlOpcode)
+ UINT8 AmlOpcode,
+ UINT16 ParentOpcode)
{
ACPI_BUFFER TargetPath;
ACPI_STATUS Status;
@@ -308,8 +381,9 @@ LsEmitOffsetTableEntry (
* 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);
+ " {%-29s 0x%4.4X, 0x%8.8X, 0x%2.2X, 0x%8.8X, 0x%8.8X%8.8X}, /* %s */\n",
+ MsgBuffer, ParentOpcode, NamepathOffset, AmlOpcode,
+ Offset, ACPI_FORMAT_UINT64 (Value), OpName);
}
@@ -335,10 +409,12 @@ LsDoOffsetTableHeader (
"#define __AML_OFFSET_TABLE_H\n\n");
FlPrintFile (FileId, "typedef struct {\n"
- " char *Pathname;\n"
- " unsigned long Offset;\n"
- " unsigned char Opcode;\n"
- " unsigned long long Value;\n"
+ " char *Pathname; /* Full pathname (from root) to the object */\n"
+ " unsigned short ParentOpcode; /* AML opcode for the parent object */\n"
+ " unsigned long NamesegOffset; /* Offset of last nameseg in the parent namepath */\n"
+ " unsigned char Opcode; /* AML opcode for the data */\n"
+ " unsigned long Offset; /* Offset for the data */\n"
+ " unsigned long long Value; /* Original value of the data (as applicable) */\n"
"} AML_OFFSET_TABLE_ENTRY;\n\n");
FlPrintFile (FileId,
@@ -346,29 +422,37 @@ LsDoOffsetTableHeader (
FlPrintFile (FileId,
"/*\n"
- " * Information about supported object types:\n"
+ " * Information specific to the supported object types:\n"
" *\n"
" * Integers:\n"
- " * Offset points to the actual integer data\n"
" * Opcode is the integer prefix, indicates length of the data\n"
+ " * (One of: BYTE, WORD, DWORD, QWORD, ZERO, ONE, ONES)\n"
+ " * Offset points to the actual integer data\n"
" * Value is the existing value in the AML\n"
" *\n"
" * Packages:\n"
- " * Offset points to the package opcode\n"
" * Opcode is the package or var_package opcode\n"
- " * Value is the package element cound\n"
+ " * Offset points to the package opcode\n"
+ " * Value is the package element count\n"
" *\n"
" * Operation Regions:\n"
- " * Offset points to the region address data\n"
" * Opcode is the address integer prefix, indicates length of the data\n"
+ " * Offset points to the region address\n"
" * Value is the existing address value in the AML\n"
" *\n"
" * Control Methods:\n"
- " * Offset points to the first byte of the namepath\n"
+ " * Offset points to the method flags byte\n"
+ " * Value is the existing flags value in the AML\n"
+ " *\n"
+ " * Processors:\n"
+ " * Offset points to the first byte of the PBlock Address\n"
" *\n"
" * Resource Descriptors:\n"
- " * Offset points to the start of the descriptor\n"
" * Opcode is the descriptor type\n"
+ " * Offset points to the start of the descriptor\n"
+ " *\n"
+ " * Scopes/Devices/ThermalZones:\n"
+ " * Nameseg offset only\n"
" */\n");
FlPrintFile (FileId,
@@ -383,6 +467,6 @@ LsDoOffsetTableFooter (
{
FlPrintFile (FileId,
- " {0,0,0,0} /* Table terminator */\n};\n\n");
+ " {NULL,0,0,0,0,0} /* Table terminator */\n};\n\n");
Gbl_CurrentAmlOffset = 0;
}
diff --git a/source/compiler/asloperands.c b/source/compiler/asloperands.c
index deb4bd4cba50..4afbd9629042 100644
--- a/source/compiler/asloperands.c
+++ b/source/compiler/asloperands.c
@@ -971,12 +971,15 @@ OpnDoDefinitionBlock (
Gbl_TableId = AcpiOsAllocate (Length + 1);
ACPI_STRCPY (Gbl_TableId, Child->Asl.Value.String);
+ /*
+ * Convert anything non-alphanumeric to an underscore. This
+ * allows us to use the TableID to generate unique C symbols.
+ */
for (i = 0; i < Length; i++)
{
- if (Gbl_TableId[i] == ' ')
+ if (!isalnum ((int) Gbl_TableId[i]))
{
- Gbl_TableId[i] = 0;
- break;
+ Gbl_TableId[i] = '_';
}
}
}
diff --git a/source/compiler/asloptions.c b/source/compiler/asloptions.c
index bfb3d75d1340..441dbb3fd1f5 100644
--- a/source/compiler/asloptions.c
+++ b/source/compiler/asloptions.c
@@ -68,7 +68,7 @@ AslDoResponseFile (
#define ASL_TOKEN_SEPARATORS " \t\n"
-#define ASL_SUPPORTED_OPTIONS "@:b|c|d^D:e:fgh^i|I:l^m:no|p:P^r:s|t|T:G^v^w|x:z"
+#define ASL_SUPPORTED_OPTIONS "@:b|c|d^D:e:fgh^i|I:l^m:no|p:P^r:s|t|T+G^v^w|x:z"
/*******************************************************************************
diff --git a/source/compiler/dttemplate.c b/source/compiler/dttemplate.c
index 09e9990149c8..73708558d0ee 100644
--- a/source/compiler/dttemplate.c
+++ b/source/compiler/dttemplate.c
@@ -117,13 +117,21 @@ DtCreateTemplates (
AslInitializeGlobals ();
- AcpiUtStrupr (Signature);
- /* Create all known templates if requested */
+ /* Default (no signature) is DSDT */
+
+ if (!Signature)
+ {
+ Signature = "DSDT";
+ goto GetTemplate;
+ }
- if (!ACPI_STRNCMP (Signature, "ALL", 3) ||
+ AcpiUtStrupr (Signature);
+ if (!ACPI_STRCMP (Signature, "ALL") ||
!ACPI_STRCMP (Signature, "*"))
{
+ /* Create all available/known templates */
+
Status = DtCreateAllTemplates ();
return (Status);
}
@@ -136,7 +144,9 @@ DtCreateTemplates (
*/
if (strlen (Signature) != ACPI_NAME_SIZE)
{
- fprintf (stderr, "%s, Invalid ACPI table signature\n", Signature);
+ fprintf (stderr,
+ "%s: Invalid ACPI table signature (length must be 4 characters)\n",
+ Signature);
return (AE_ERROR);
}
@@ -153,19 +163,20 @@ DtCreateTemplates (
Signature = "FACP";
}
+GetTemplate:
TableData = AcpiDmGetTableData (Signature);
if (TableData)
{
if (!TableData->Template)
{
- fprintf (stderr, "%4.4s, No template available\n", Signature);
+ fprintf (stderr, "%4.4s: No template available\n", Signature);
return (AE_ERROR);
}
}
else if (!AcpiUtIsSpecialTable (Signature))
{
fprintf (stderr,
- "%4.4s, Unrecognized ACPI table signature\n", Signature);
+ "%4.4s: Unrecognized ACPI table signature\n", Signature);
return (AE_ERROR);
}
diff --git a/source/components/executer/exoparg1.c b/source/components/executer/exoparg1.c
index ff8dee2487aa..bcd702af946b 100644
--- a/source/components/executer/exoparg1.c
+++ b/source/components/executer/exoparg1.c
@@ -1009,10 +1009,17 @@ AcpiExOpcode_1A_0T_1R (
* add another reference to the referenced object, however.
*/
ReturnDesc = *(Operand[0]->Reference.Where);
- if (ReturnDesc)
+ if (!ReturnDesc)
{
- AcpiUtAddReference (ReturnDesc);
+ /*
+ * Element is NULL, do not allow the dereference.
+ * This provides compatibility with other ACPI
+ * implementations.
+ */
+ return_ACPI_STATUS (AE_AML_UNINITIALIZED_ELEMENT);
}
+
+ AcpiUtAddReference (ReturnDesc);
break;
default:
@@ -1030,15 +1037,44 @@ AcpiExOpcode_1A_0T_1R (
ReturnDesc = Operand[0]->Reference.Object;
if (ACPI_GET_DESCRIPTOR_TYPE (ReturnDesc) ==
- ACPI_DESC_TYPE_NAMED)
+ ACPI_DESC_TYPE_NAMED)
{
ReturnDesc = AcpiNsGetAttachedObject (
- (ACPI_NAMESPACE_NODE *) ReturnDesc);
- }
+ (ACPI_NAMESPACE_NODE *) ReturnDesc);
+ if (!ReturnDesc)
+ {
+ break;
+ }
- /* Add another reference to the object! */
+ /*
+ * June 2013:
+ * BufferFields/FieldUnits require additional resolution
+ */
+ switch (ReturnDesc->Common.Type)
+ {
+ case ACPI_TYPE_BUFFER_FIELD:
+ case ACPI_TYPE_LOCAL_REGION_FIELD:
+ case ACPI_TYPE_LOCAL_BANK_FIELD:
+ case ACPI_TYPE_LOCAL_INDEX_FIELD:
- AcpiUtAddReference (ReturnDesc);
+ Status = AcpiExReadDataFromField (WalkState,
+ ReturnDesc, &TempDesc);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Cleanup;
+ }
+
+ ReturnDesc = TempDesc;
+ break;
+
+ default:
+
+ /* Add another reference to the object */
+
+ AcpiUtAddReference (ReturnDesc);
+ break;
+ }
+ }
break;
default:
diff --git a/source/components/hardware/hwtimer.c b/source/components/hardware/hwtimer.c
index 7e4177afd6d5..cbfa96b0c7a3 100644
--- a/source/components/hardware/hwtimer.c
+++ b/source/components/hardware/hwtimer.c
@@ -115,8 +115,14 @@ AcpiGetTimer (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- Status = AcpiHwRead (Ticks, &AcpiGbl_FADT.XPmTimerBlock);
+ /* ACPI 5.0A: PM Timer is optional */
+ if (!AcpiGbl_FADT.XPmTimerBlock.Address)
+ {
+ return_ACPI_STATUS (AE_SUPPORT);
+ }
+
+ Status = AcpiHwRead (Ticks, &AcpiGbl_FADT.XPmTimerBlock);
return_ACPI_STATUS (Status);
}
@@ -171,6 +177,13 @@ AcpiGetTimerDuration (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
+ /* ACPI 5.0A: PM Timer is optional */
+
+ if (!AcpiGbl_FADT.XPmTimerBlock.Address)
+ {
+ return_ACPI_STATUS (AE_SUPPORT);
+ }
+
/*
* Compute Tick Delta:
* Handle (max one) timer rollovers on 24-bit versus 32-bit timers.
diff --git a/source/components/namespace/nspredef.c b/source/components/namespace/nspredef.c
index 7122e7accbe1..7b7e3e34fd50 100644
--- a/source/components/namespace/nspredef.c
+++ b/source/components/namespace/nspredef.c
@@ -166,6 +166,16 @@ AcpiNsCheckReturnValue (
}
/*
+ *
+ * 4) If there is no return value and it is optional, just return
+ * AE_OK (_WAK).
+ */
+ if (!(*ReturnObjectPtr))
+ {
+ goto Exit;
+ }
+
+ /*
* For returned Package objects, check the type of all sub-objects.
* Note: Package may have been newly created by call above.
*/
@@ -293,7 +303,13 @@ TypeErrorExit:
AcpiUtGetExpectedReturnTypes (TypeBuffer, ExpectedBtypes);
- if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
+ if (!ReturnObject)
+ {
+ ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
+ "Expected return object of type %s",
+ TypeBuffer));
+ }
+ else if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
{
ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
"Return type mismatch - found %s, expected %s",
diff --git a/source/components/namespace/nswalk.c b/source/components/namespace/nswalk.c
index 0b25ffdb8951..577b89bd5244 100644
--- a/source/components/namespace/nswalk.c
+++ b/source/components/namespace/nswalk.c
@@ -165,9 +165,9 @@ AcpiNsGetNextNodeTyped (
* MaxDepth - Depth to which search is to reach
* Flags - Whether to unlock the NS before invoking
* the callback routine
- * PreOrderVisit - Called during tree pre-order visit
+ * DescendingCallback - Called during tree descent
* when an object of "Type" is found
- * PostOrderVisit - Called during tree post-order visit
+ * AscendingCallback - Called during tree ascent
* when an object of "Type" is found
* Context - Passed to user function(s) above
* ReturnValue - from the UserFunction if terminated
@@ -195,8 +195,8 @@ AcpiNsWalkNamespace (
ACPI_HANDLE StartNode,
UINT32 MaxDepth,
UINT32 Flags,
- ACPI_WALK_CALLBACK PreOrderVisit,
- ACPI_WALK_CALLBACK PostOrderVisit,
+ ACPI_WALK_CALLBACK DescendingCallback,
+ ACPI_WALK_CALLBACK AscendingCallback,
void *Context,
void **ReturnValue)
{
@@ -274,22 +274,22 @@ AcpiNsWalkNamespace (
}
/*
- * Invoke the user function, either pre-order or post-order
+ * Invoke the user function, either descending, ascending,
* or both.
*/
if (!NodePreviouslyVisited)
{
- if (PreOrderVisit)
+ if (DescendingCallback)
{
- Status = PreOrderVisit (ChildNode, Level,
+ Status = DescendingCallback (ChildNode, Level,
Context, ReturnValue);
}
}
else
{
- if (PostOrderVisit)
+ if (AscendingCallback)
{
- Status = PostOrderVisit (ChildNode, Level,
+ Status = AscendingCallback (ChildNode, Level,
Context, ReturnValue);
}
}
diff --git a/source/components/namespace/nsxfeval.c b/source/components/namespace/nsxfeval.c
index 6a2649a5dd0e..e5c1e17f2027 100644
--- a/source/components/namespace/nsxfeval.c
+++ b/source/components/namespace/nsxfeval.c
@@ -574,9 +574,9 @@ AcpiNsResolveReferences (
* PARAMETERS: Type - ACPI_OBJECT_TYPE to search for
* StartObject - Handle in namespace where search begins
* MaxDepth - Depth to which search is to reach
- * PreOrderVisit - Called during tree pre-order visit
+ * DescendingCallback - Called during tree descent
* when an object of "Type" is found
- * PostOrderVisit - Called during tree post-order visit
+ * AscendingCallback - Called during tree ascent
* when an object of "Type" is found
* Context - Passed to user function(s) above
* ReturnValue - Location where return value of
@@ -605,8 +605,8 @@ AcpiWalkNamespace (
ACPI_OBJECT_TYPE Type,
ACPI_HANDLE StartObject,
UINT32 MaxDepth,
- ACPI_WALK_CALLBACK PreOrderVisit,
- ACPI_WALK_CALLBACK PostOrderVisit,
+ ACPI_WALK_CALLBACK DescendingCallback,
+ ACPI_WALK_CALLBACK AscendingCallback,
void *Context,
void **ReturnValue)
{
@@ -620,7 +620,7 @@ AcpiWalkNamespace (
if ((Type > ACPI_TYPE_LOCAL_MAX) ||
(!MaxDepth) ||
- (!PreOrderVisit && !PostOrderVisit))
+ (!DescendingCallback && !AscendingCallback))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
@@ -655,8 +655,8 @@ AcpiWalkNamespace (
}
Status = AcpiNsWalkNamespace (Type, StartObject, MaxDepth,
- ACPI_NS_WALK_UNLOCK, PreOrderVisit,
- PostOrderVisit, Context, ReturnValue);
+ ACPI_NS_WALK_UNLOCK, DescendingCallback,
+ AscendingCallback, Context, ReturnValue);
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
diff --git a/source/components/tables/tbfadt.c b/source/components/tables/tbfadt.c
index 6f41c46321e4..eb4e0e5695d5 100644
--- a/source/components/tables/tbfadt.c
+++ b/source/components/tables/tbfadt.c
@@ -132,7 +132,7 @@ static ACPI_FADT_INFO FadtInfoTable[] =
ACPI_FADT_OFFSET (PmTimerBlock),
ACPI_FADT_OFFSET (PmTimerLength),
ACPI_PM_TIMER_WIDTH,
- ACPI_FADT_REQUIRED},
+ ACPI_FADT_SEPARATE_LENGTH}, /* ACPI 5.0A: Timer is optional */
{"Gpe0Block",
ACPI_FADT_OFFSET (XGpe0Block),
@@ -606,7 +606,7 @@ AcpiTbValidateFadt (
if (FadtInfoTable[i].Type & ACPI_FADT_REQUIRED)
{
/*
- * Field is required (PM1aEvent, PM1aControl, PmTimer).
+ * Field is required (PM1aEvent, PM1aControl).
* Both the address and length must be non-zero.
*/
if (!Address64->Address || !Length)
diff --git a/source/components/tables/tbxfroot.c b/source/components/tables/tbxfroot.c
index 20cc0fa6c85b..fa67781cb14f 100644
--- a/source/components/tables/tbxfroot.c
+++ b/source/components/tables/tbxfroot.c
@@ -51,12 +51,6 @@
#define _COMPONENT ACPI_TABLES
ACPI_MODULE_NAME ("tbxfroot")
-/* Local prototypes */
-
-static ACPI_STATUS
-AcpiTbValidateRsdp (
- ACPI_TABLE_RSDP *Rsdp);
-
/*******************************************************************************
*
@@ -70,7 +64,7 @@ AcpiTbValidateRsdp (
*
******************************************************************************/
-static ACPI_STATUS
+ACPI_STATUS
AcpiTbValidateRsdp (
ACPI_TABLE_RSDP *Rsdp)
{
@@ -81,7 +75,7 @@ AcpiTbValidateRsdp (
* Note: Sometimes there exists more than one RSDP in memory; the valid
* RSDP has a valid checksum, all others have an invalid checksum.
*/
- if (ACPI_STRNCMP ((char *) Rsdp, ACPI_SIG_RSDP,
+ if (ACPI_STRNCMP ((char *) Rsdp->Signature, ACPI_SIG_RSDP,
sizeof (ACPI_SIG_RSDP)-1) != 0)
{
/* Nope, BAD Signature */
diff --git a/source/components/utilities/utglobal.c b/source/components/utilities/utglobal.c
index 83b05266ad5f..56c4e0693573 100644
--- a/source/components/utilities/utglobal.c
+++ b/source/components/utilities/utglobal.c
@@ -319,7 +319,6 @@ AcpiUtInitGlobals (
AcpiGbl_TraceDbgLayer = 0;
AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING;
AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT;
- AcpiGbl_OsiData = 0;
AcpiGbl_OsiMutex = NULL;
AcpiGbl_RegMethodsExecuted = FALSE;
diff --git a/source/components/utilities/utosi.c b/source/components/utilities/utosi.c
index 21fe51b5faec..c3762562bd71 100644
--- a/source/components/utilities/utosi.c
+++ b/source/components/utilities/utosi.c
@@ -81,21 +81,20 @@ static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[] =
/* Feature Group Strings */
- {"Extended Address Space Descriptor", NULL, 0, 0}
+ {"Extended Address Space Descriptor", NULL, ACPI_OSI_FEATURE, 0},
/*
* All "optional" feature group strings (features that are implemented
- * by the host) should be dynamically added by the host via
- * AcpiInstallInterface and should not be manually added here.
- *
- * Examples of optional feature group strings:
- *
- * "Module Device"
- * "Processor Device"
- * "3.0 Thermal Model"
- * "3.0 _SCP Extensions"
- * "Processor Aggregator Device"
+ * by the host) should be dynamically modified to VALID by the host via
+ * AcpiInstallInterface or AcpiUpdateInterfaces. Such optional feature
+ * group strings are set as INVALID by default here.
*/
+
+ {"Module Device", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0},
+ {"Processor Device", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0},
+ {"3.0 Thermal Model", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0},
+ {"3.0 _SCP Extensions", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0},
+ {"Processor Aggregator Device", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0}
};
@@ -172,13 +171,26 @@ AcpiUtInterfaceTerminate (
{
AcpiGbl_SupportedInterfaces = NextInterface->Next;
- /* Only interfaces added at runtime can be freed */
-
if (NextInterface->Flags & ACPI_OSI_DYNAMIC)
{
+ /* Only interfaces added at runtime can be freed */
+
ACPI_FREE (NextInterface->Name);
ACPI_FREE (NextInterface);
}
+ else
+ {
+ /* Interface is in static list. Reset it to invalid or valid. */
+
+ if (NextInterface->Flags & ACPI_OSI_DEFAULT_INVALID)
+ {
+ NextInterface->Flags |= ACPI_OSI_INVALID;
+ }
+ else
+ {
+ NextInterface->Flags &= ~ACPI_OSI_INVALID;
+ }
+ }
NextInterface = AcpiGbl_SupportedInterfaces;
}
@@ -307,6 +319,57 @@ AcpiUtRemoveInterface (
/*******************************************************************************
*
+ * FUNCTION: AcpiUtUpdateInterfaces
+ *
+ * PARAMETERS: Action - Actions to be performed during the
+ * update
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Update _OSI interface strings, disabling or enabling OS vendor
+ * strings or/and feature group strings.
+ * Caller MUST hold AcpiGbl_OsiMutex
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtUpdateInterfaces (
+ UINT8 Action)
+{
+ ACPI_INTERFACE_INFO *NextInterface;
+
+
+ NextInterface = AcpiGbl_SupportedInterfaces;
+ while (NextInterface)
+ {
+ if (((NextInterface->Flags & ACPI_OSI_FEATURE) &&
+ (Action & ACPI_FEATURE_STRINGS)) ||
+ (!(NextInterface->Flags & ACPI_OSI_FEATURE) &&
+ (Action & ACPI_VENDOR_STRINGS)))
+ {
+ if (Action & ACPI_DISABLE_INTERFACES)
+ {
+ /* Mark the interfaces as invalid */
+
+ NextInterface->Flags |= ACPI_OSI_INVALID;
+ }
+ else
+ {
+ /* Mark the interfaces as valid */
+
+ NextInterface->Flags &= ~ACPI_OSI_INVALID;
+ }
+ }
+
+ NextInterface = NextInterface->Next;
+ }
+
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiUtGetInterface
*
* PARAMETERS: InterfaceName - The interface to find
diff --git a/source/components/utilities/utxface.c b/source/components/utilities/utxface.c
index 450698054d3b..021a4627702c 100644
--- a/source/components/utilities/utxface.c
+++ b/source/components/utilities/utxface.c
@@ -499,6 +499,40 @@ ACPI_EXPORT_SYMBOL (AcpiInstallInterfaceHandler)
/*****************************************************************************
*
+ * FUNCTION: AcpiUpdateInterfaces
+ *
+ * PARAMETERS: Action - Actions to be performed during the
+ * update
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Update _OSI interface strings, disabling or enabling OS vendor
+ * string or/and feature group strings.
+ *
+ ****************************************************************************/
+
+ACPI_STATUS
+AcpiUpdateInterfaces (
+ UINT8 Action)
+{
+ ACPI_STATUS Status;
+
+
+ Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ Status = AcpiUtUpdateInterfaces (Action);
+
+ AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
+ return (Status);
+}
+
+
+/*****************************************************************************
+ *
* FUNCTION: AcpiCheckAddressRange
*
* PARAMETERS: SpaceId - Address space ID
diff --git a/source/include/acglobal.h b/source/include/acglobal.h
index 32ae55f855f9..a4538051ec0f 100644
--- a/source/include/acglobal.h
+++ b/source/include/acglobal.h
@@ -140,6 +140,12 @@ UINT8 ACPI_INIT_GLOBAL (AcpiGbl_DisableAutoRepair, FALSE);
*/
UINT8 ACPI_INIT_GLOBAL (AcpiGbl_DisableSsdtTableLoad, FALSE);
+/*
+ * We keep track of the latest version of Windows that has been requested by
+ * the BIOS.
+ */
+UINT8 ACPI_INIT_GLOBAL (AcpiGbl_OsiData, 0);
+
/* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */
@@ -290,7 +296,6 @@ ACPI_EXTERN UINT8 AcpiGbl_DebuggerConfiguration;
ACPI_EXTERN BOOLEAN AcpiGbl_StepToNextCall;
ACPI_EXTERN BOOLEAN AcpiGbl_AcpiHardwarePresent;
ACPI_EXTERN BOOLEAN AcpiGbl_EventsInitialized;
-ACPI_EXTERN UINT8 AcpiGbl_OsiData;
ACPI_EXTERN ACPI_INTERFACE_INFO *AcpiGbl_SupportedInterfaces;
ACPI_EXTERN ACPI_ADDRESS_RANGE *AcpiGbl_AddressRangeList[ACPI_ADDRESS_RANGE_MAX];
diff --git a/source/include/aclocal.h b/source/include/aclocal.h
index 47e743738f49..a3569fb8b7ec 100644
--- a/source/include/aclocal.h
+++ b/source/include/aclocal.h
@@ -1100,19 +1100,6 @@ typedef struct acpi_bit_register_info
/* Structs and definitions for _OSI support and I/O port validation */
-#define ACPI_OSI_WIN_2000 0x01
-#define ACPI_OSI_WIN_XP 0x02
-#define ACPI_OSI_WIN_XP_SP1 0x03
-#define ACPI_OSI_WINSRV_2003 0x04
-#define ACPI_OSI_WIN_XP_SP2 0x05
-#define ACPI_OSI_WINSRV_2003_SP1 0x06
-#define ACPI_OSI_WIN_VISTA 0x07
-#define ACPI_OSI_WINSRV_2008 0x08
-#define ACPI_OSI_WIN_VISTA_SP1 0x09
-#define ACPI_OSI_WIN_VISTA_SP2 0x0A
-#define ACPI_OSI_WIN_7 0x0B
-#define ACPI_OSI_WIN_8 0x0C
-
#define ACPI_ALWAYS_ILLEGAL 0x00
typedef struct acpi_interface_info
@@ -1126,6 +1113,9 @@ typedef struct acpi_interface_info
#define ACPI_OSI_INVALID 0x01
#define ACPI_OSI_DYNAMIC 0x02
+#define ACPI_OSI_FEATURE 0x04
+#define ACPI_OSI_DEFAULT_INVALID 0x08
+#define ACPI_OSI_OPTIONAL_FEATURE (ACPI_OSI_FEATURE | ACPI_OSI_DEFAULT_INVALID | ACPI_OSI_INVALID)
typedef struct acpi_port_info
{
@@ -1221,6 +1211,7 @@ typedef struct acpi_external_list
UINT8 Type;
UINT8 Flags;
BOOLEAN Resolved;
+ BOOLEAN Emitted;
} ACPI_EXTERNAL_LIST;
diff --git a/source/include/acnamesp.h b/source/include/acnamesp.h
index 1118184ed383..63caba3afa19 100644
--- a/source/include/acnamesp.h
+++ b/source/include/acnamesp.h
@@ -117,8 +117,8 @@ AcpiNsWalkNamespace (
ACPI_HANDLE StartObject,
UINT32 MaxDepth,
UINT32 Flags,
- ACPI_WALK_CALLBACK PreOrderVisit,
- ACPI_WALK_CALLBACK PostOrderVisit,
+ ACPI_WALK_CALLBACK DescendingCallback,
+ ACPI_WALK_CALLBACK AscendingCallback,
void *Context,
void **ReturnValue);
diff --git a/source/include/acpixf.h b/source/include/acpixf.h
index a334b2d4401a..7dee52a64b24 100644
--- a/source/include/acpixf.h
+++ b/source/include/acpixf.h
@@ -47,7 +47,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20130626
+#define ACPI_CA_VERSION 0x20130725
#include "acconfig.h"
#include "actypes.h"
@@ -61,6 +61,7 @@ extern UINT32 AcpiCurrentGpeCount;
extern ACPI_TABLE_FADT AcpiGbl_FADT;
extern BOOLEAN AcpiGbl_SystemAwakeAndRunning;
extern BOOLEAN AcpiGbl_ReducedHardware; /* ACPI 5.0 */
+extern UINT8 AcpiGbl_OsiData;
/* Runtime configuration of debug print levels */
@@ -177,6 +178,10 @@ ACPI_STATUS
AcpiRemoveInterface (
ACPI_STRING InterfaceName);
+ACPI_STATUS
+AcpiUpdateInterfaces (
+ UINT8 Action);
+
UINT32
AcpiCheckAddressRange (
ACPI_ADR_SPACE_TYPE SpaceId,
@@ -268,8 +273,8 @@ AcpiWalkNamespace (
ACPI_OBJECT_TYPE Type,
ACPI_HANDLE StartObject,
UINT32 MaxDepth,
- ACPI_WALK_CALLBACK PreOrderVisit,
- ACPI_WALK_CALLBACK PostOrderVisit,
+ ACPI_WALK_CALLBACK DescendingCallback,
+ ACPI_WALK_CALLBACK AscendingCallback,
void *Context,
void **ReturnValue);
diff --git a/source/include/actables.h b/source/include/actables.h
index 3452a7b870a6..42958945bca4 100644
--- a/source/include/actables.h
+++ b/source/include/actables.h
@@ -52,6 +52,10 @@ AcpiAllocateRootTable (
/*
* tbxfroot - Root pointer utilities
*/
+ACPI_STATUS
+AcpiTbValidateRsdp (
+ ACPI_TABLE_RSDP *Rsdp);
+
UINT8 *
AcpiTbScanMemoryForRsdp (
UINT8 *StartAddress,
diff --git a/source/include/actypes.h b/source/include/actypes.h
index 09ccfdf08d73..cf98e4bfc6e9 100644
--- a/source/include/actypes.h
+++ b/source/include/actypes.h
@@ -1244,4 +1244,32 @@ typedef struct acpi_memory_list
} ACPI_MEMORY_LIST;
+/* Definitions of _OSI support */
+
+#define ACPI_VENDOR_STRINGS 0x01
+#define ACPI_FEATURE_STRINGS 0x02
+#define ACPI_ENABLE_INTERFACES 0x00
+#define ACPI_DISABLE_INTERFACES 0x04
+
+#define ACPI_DISABLE_ALL_VENDOR_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS)
+#define ACPI_DISABLE_ALL_FEATURE_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_FEATURE_STRINGS)
+#define ACPI_DISABLE_ALL_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS)
+#define ACPI_ENABLE_ALL_VENDOR_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS)
+#define ACPI_ENABLE_ALL_FEATURE_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_FEATURE_STRINGS)
+#define ACPI_ENABLE_ALL_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS)
+
+#define ACPI_OSI_WIN_2000 0x01
+#define ACPI_OSI_WIN_XP 0x02
+#define ACPI_OSI_WIN_XP_SP1 0x03
+#define ACPI_OSI_WINSRV_2003 0x04
+#define ACPI_OSI_WIN_XP_SP2 0x05
+#define ACPI_OSI_WINSRV_2003_SP1 0x06
+#define ACPI_OSI_WIN_VISTA 0x07
+#define ACPI_OSI_WINSRV_2008 0x08
+#define ACPI_OSI_WIN_VISTA_SP1 0x09
+#define ACPI_OSI_WIN_VISTA_SP2 0x0A
+#define ACPI_OSI_WIN_7 0x0B
+#define ACPI_OSI_WIN_8 0x0C
+
+
#endif /* __ACTYPES_H__ */
diff --git a/source/include/acutils.h b/source/include/acutils.h
index c0ea53333503..c80dd36ca4f6 100644
--- a/source/include/acutils.h
+++ b/source/include/acutils.h
@@ -670,6 +670,10 @@ ACPI_STATUS
AcpiUtRemoveInterface (
ACPI_STRING InterfaceName);
+ACPI_STATUS
+AcpiUtUpdateInterfaces (
+ UINT8 Action);
+
ACPI_INTERFACE_INFO *
AcpiUtGetInterface (
ACPI_STRING InterfaceName);
diff --git a/source/include/platform/acfreebsd.h b/source/include/platform/acfreebsd.h
index 92d7382d19aa..4b9c203b022e 100644
--- a/source/include/platform/acfreebsd.h
+++ b/source/include/platform/acfreebsd.h
@@ -49,12 +49,21 @@
#include "acgcc.h"
#include <sys/types.h>
-#include <machine/acpica_machdep.h>
+
+#ifdef __LP64__
+#define ACPI_MACHINE_WIDTH 64
+#else
+#define ACPI_MACHINE_WIDTH 32
+#endif
+
+#define COMPILER_DEPENDENT_INT64 int64_t
+#define COMPILER_DEPENDENT_UINT64 uint64_t
#define ACPI_UINTPTR_T uintptr_t
#define ACPI_USE_DO_WHILE_0
#define ACPI_USE_LOCAL_CACHE
+#define ACPI_USE_NATIVE_DIVIDE
#define ACPI_USE_SYSTEM_CLIBRARY
#ifdef _KERNEL
@@ -63,6 +72,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/libkern.h>
+#include <machine/acpica_machdep.h>
#include <machine/stdarg.h>
#include "opt_acpi.h"
diff --git a/source/os_specific/service_layers/osfreebsdtbl.c b/source/os_specific/service_layers/osfreebsdtbl.c
index 3df48456d2ba..9d39bc3ca8f1 100644
--- a/source/os_specific/service_layers/osfreebsdtbl.c
+++ b/source/os_specific/service_layers/osfreebsdtbl.c
@@ -964,28 +964,15 @@ OslMapTable (
*Table = MappedTable;
- /* Checksum for RSDP */
+ /*
+ * Checksum for RSDP.
+ * Note: Other checksums are computed during the table dump.
+ */
- if (!ACPI_STRNCMP (MappedTable->Signature, ACPI_SIG_RSDP,
- sizeof (ACPI_SIG_RSDP) - 1))
+ if (AcpiTbValidateRsdp (ACPI_CAST_PTR (ACPI_TABLE_RSDP, MappedTable)) ==
+ AE_BAD_CHECKSUM)
{
- /* Check the standard checksum */
-
- if (AcpiTbChecksum ((UINT8 *) MappedTable, ACPI_RSDP_CHECKSUM_LENGTH))
- {
- fprintf (stderr, "Warning: wrong checksum for RSDP\n");
- }
-
- /* Check extended checksum if table version >= 2 */
-
- if (MappedTable->Revision)
- {
- if (AcpiTbChecksum ((UINT8 *) MappedTable,
- ACPI_RSDP_XCHECKSUM_LENGTH))
- {
- fprintf (stderr, "Warning: wrong checksum for RSDP\n");
- }
- }
+ fprintf (stderr, "Warning: wrong checksum for RSDP\n");
}
return (AE_OK);
diff --git a/source/os_specific/service_layers/oslinuxtbl.c b/source/os_specific/service_layers/oslinuxtbl.c
index 67a5e0246db3..fd593a12263e 100644
--- a/source/os_specific/service_layers/oslinuxtbl.c
+++ b/source/os_specific/service_layers/oslinuxtbl.c
@@ -960,26 +960,11 @@ OslMapTable (
* Checksum for RSDP.
* Note: Other checksums are computed during the table dump.
*/
- if (!ACPI_STRNCMP (MappedTable->Signature, ACPI_SIG_RSDP,
- sizeof (ACPI_SIG_RSDP) - 1))
- {
- /* Check the standard checksum */
-
- if (AcpiTbChecksum ((UINT8 *) MappedTable, ACPI_RSDP_CHECKSUM_LENGTH))
- {
- fprintf (stderr, "Warning: wrong checksum for RSDP\n");
- }
-
- /* Check extended checksum if table version >= 2 */
- if (MappedTable->Revision)
- {
- if (AcpiTbChecksum ((UINT8 *) MappedTable,
- ACPI_RSDP_XCHECKSUM_LENGTH))
- {
- fprintf (stderr, "Warning: wrong checksum for RSDP\n");
- }
- }
+ if (AcpiTbValidateRsdp (ACPI_CAST_PTR (ACPI_TABLE_RSDP, MappedTable)) ==
+ AE_BAD_CHECKSUM)
+ {
+ fprintf (stderr, "Warning: wrong checksum for RSDP\n");
}
return (AE_OK);
diff --git a/source/tools/acpiexec/aetables.c b/source/tools/acpiexec/aetables.c
index 07af7965899f..a32c4c54dea8 100644
--- a/source/tools/acpiexec/aetables.c
+++ b/source/tools/acpiexec/aetables.c
@@ -81,7 +81,7 @@ static ACPI_TABLE_FADT LocalFADT;
*/
static ACPI_TABLE_XSDT *LocalXSDT;
-#define BASE_XSDT_TABLES 8
+#define BASE_XSDT_TABLES 10
#define BASE_XSDT_SIZE (sizeof (ACPI_TABLE_XSDT) + \
((BASE_XSDT_TABLES -1) * sizeof (UINT64)))
@@ -198,7 +198,12 @@ AeBuildLocalTables (
LocalXSDT->TableOffsetEntry[7] = ACPI_PTR_TO_PHYSADDR (&EcdtCode);
- /*
+ /* Install two UEFIs to test multiple table support */
+
+ LocalXSDT->TableOffsetEntry[8] = ACPI_PTR_TO_PHYSADDR (&Uefi1Code);
+ LocalXSDT->TableOffsetEntry[9] = ACPI_PTR_TO_PHYSADDR (&Uefi2Code);
+
+ /*
* Install the user tables. The DSDT must be installed in the FADT.
* All other tables are installed directly into the XSDT.
*/
diff --git a/source/tools/acpiexec/aetables.h b/source/tools/acpiexec/aetables.h
index 791a7492975d..410d5289b9ec 100644
--- a/source/tools/acpiexec/aetables.h
+++ b/source/tools/acpiexec/aetables.h
@@ -214,6 +214,30 @@ unsigned char EcdtCode[] =
0x49,0x30,0x2E,0x45,0x43,0x00 /* 00000048 "I0.EC." */
};
+/* Test for multiple UEFI tables */
+
+unsigned char Uefi1Code[] =
+{
+ 0x55,0x45,0x46,0x49,0x36,0x00,0x00,0x00, /* 00000000 "UEFI6..." */
+ 0x01,0x03,0x20,0x49,0x6E,0x74,0x65,0x6C, /* 00000008 ".. Intel" */
+ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
+ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x26,0x06,0x13,0x20,0x00,0x01,0x02,0x03, /* 00000020 "&.. ...." */
+ 0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B, /* 00000028 "........" */
+ 0x0C,0x0D,0x0E,0x0F,0x36,0x00 /* 00000030 "....6." */
+};
+
+unsigned char Uefi2Code[] =
+{
+ 0x55,0x45,0x46,0x49,0x36,0x00,0x00,0x00, /* 00000000 "UEFI6..." */
+ 0x01,0xEB,0x20,0x49,0x6E,0x74,0x65,0x6C, /* 00000008 ".. Intel" */
+ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
+ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x26,0x06,0x13,0x20,0x06,0x07,0x08,0x09, /* 00000020 "&.. ...." */
+ 0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B, /* 00000028 "........" */
+ 0x0C,0x0D,0x0E,0x0F,0x36,0x00 /* 00000030 "....6." */
+};
+
/*
* Example installable control method
@@ -414,6 +438,36 @@ DefinitionBlock ("ssdt4.aml", "SSDT", 2, "Intel", "ssdt4", 0x00000004)
[040h 0064 1] GPE Number : 09
[041h 0065 13] Namepath : "\_SB.PCI0.EC"
+
+/* Test multiple UEFI support */
+
+[0004] Signature : "UEFI" [UEFI Boot Optimization Table]
+[0004] Table Length : 00000036
+[0001] Revision : 01
+[0001] Checksum : 9B
+[0006] Oem ID : " Intel"
+[0008] Oem Table ID : "Template"
+[0004] Oem Revision : 00000001
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20100528
+
+[0016] UUID Identifier : 03020100-0504-0706-0809-0A0B0C0D0E0F
+[0002] Data Offset : 0000
+
+
+[0004] Signature : "UEFI" [UEFI Boot Optimization Table]
+[0004] Table Length : 00000036
+[0001] Revision : 01
+[0001] Checksum : 9B
+[0006] Oem ID : " Intel"
+[0008] Oem Table ID : "Template"
+[0004] Oem Revision : 00000001
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20100528
+
+[0016] UUID Identifier : 09080706-0504-0706-0809-0A0B0C0D0E0F
+[0002] Data Offset : 0000
+
#endif
#endif /* __AETABLES_H__ */