summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2004-03-18 17:46:27 +0000
committernjl <njl@FreeBSD.org>2004-03-18 17:46:27 +0000
commit8060f9608c951af14ff834dcdc228155cfd4395f (patch)
tree5e484a42fd06742cfa9d34306ef7299a4504b2f8 /sys/contrib/dev/acpica
parent77bf2c203ed86e3e5b316a311c5be887f215d07b (diff)
downloadFreeBSD-src-8060f9608c951af14ff834dcdc228155cfd4395f.zip
FreeBSD-src-8060f9608c951af14ff834dcdc228155cfd4395f.tar.gz
Check in files off the vendor branch as well as files with local patches.
Diffstat (limited to 'sys/contrib/dev/acpica')
-rw-r--r--sys/contrib/dev/acpica/acconfig.h8
-rw-r--r--sys/contrib/dev/acpica/acutils.h8
-rw-r--r--sys/contrib/dev/acpica/psparse.c52
-rw-r--r--sys/contrib/dev/acpica/utglobal.c30
4 files changed, 75 insertions, 23 deletions
diff --git a/sys/contrib/dev/acpica/acconfig.h b/sys/contrib/dev/acpica/acconfig.h
index fcbeffd..b4effcb 100644
--- a/sys/contrib/dev/acpica/acconfig.h
+++ b/sys/contrib/dev/acpica/acconfig.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acconfig.h - Global configuration constants
- * $Revision: 149 $
+ * $Revision: 150 $
*
*****************************************************************************/
@@ -137,7 +137,7 @@
/* Version string */
-#define ACPI_CA_VERSION 0x20040220
+#define ACPI_CA_VERSION 0x20040311
/* Maximum objects in the various object caches */
@@ -258,6 +258,10 @@
#define ACPI_SMBUS_BUFFER_SIZE 34
+/* Number of strings associated with the _OSI reserved method */
+
+#define ACPI_NUM_OSI_STRINGS 4
+
/******************************************************************************
*
diff --git a/sys/contrib/dev/acpica/acutils.h b/sys/contrib/dev/acpica/acutils.h
index 9f9b6d1..81e1df8 100644
--- a/sys/contrib/dev/acpica/acutils.h
+++ b/sys/contrib/dev/acpica/acutils.h
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
- * $Revision: 159 $
+ * $Revision: 160 $
*
*****************************************************************************/
@@ -125,7 +125,6 @@ ACPI_STATUS (*ACPI_PKG_CALLBACK) (
ACPI_GENERIC_STATE *State,
void *Context);
-
ACPI_STATUS
AcpiUtWalkPackageTree (
ACPI_OPERAND_OBJECT *SourceObject,
@@ -133,7 +132,6 @@ AcpiUtWalkPackageTree (
ACPI_PKG_CALLBACK WalkCallback,
void *Context);
-
typedef struct acpi_pkg_info
{
UINT8 *FreeSpace;
@@ -550,6 +548,10 @@ AcpiUtDeleteInternalObjectList (
ACPI_STATUS
+AcpiUtOsiImplementation (
+ ACPI_WALK_STATE *WalkState);
+
+ACPI_STATUS
AcpiUtEvaluateObject (
ACPI_NAMESPACE_NODE *PrefixNode,
char *Path,
diff --git a/sys/contrib/dev/acpica/psparse.c b/sys/contrib/dev/acpica/psparse.c
index 79ff1ff..570d252 100644
--- a/sys/contrib/dev/acpica/psparse.c
+++ b/sys/contrib/dev/acpica/psparse.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psparse - Parser top level AML parse routines
- * $Revision: 143 $
+ * $Revision: 144 $
*
*****************************************************************************/
@@ -522,7 +522,7 @@ AcpiPsParseLoop (
ACPI_STATUS Status = AE_OK;
ACPI_PARSE_OBJECT *Op = NULL; /* current op */
ACPI_PARSE_OBJECT *Arg = NULL;
- ACPI_PARSE_OBJECT PreOp;
+ ACPI_PARSE_OBJECT *PreOp = NULL;
ACPI_PARSE_STATE *ParserState;
UINT8 *AmlOpStart = NULL;
@@ -654,8 +654,19 @@ AcpiPsParseLoop (
if (WalkState->OpInfo->Flags & AML_NAMED)
{
- PreOp.Common.Value.Arg = NULL;
- PreOp.Common.AmlOpcode = WalkState->Opcode;
+ /* Allocate a new PreOp if necessary */
+
+ if (!PreOp)
+ {
+ PreOp = AcpiPsAllocOp (WalkState->Opcode);
+ if (!PreOp)
+ {
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+ }
+
+ PreOp->Common.Value.Arg = NULL;
+ PreOp->Common.AmlOpcode = WalkState->Opcode;
/*
* Get and append arguments until we find the node that contains
@@ -671,7 +682,7 @@ AcpiPsParseLoop (
goto CloseThisOp;
}
- AcpiPsAppendArg (&PreOp, Arg);
+ AcpiPsAppendArg (PreOp, Arg);
INCREMENT_ARG_LIST (WalkState->ArgTypes);
}
@@ -717,7 +728,7 @@ AcpiPsParseLoop (
goto CloseThisOp;
}
- AcpiPsAppendArg (Op, PreOp.Common.Value.Arg);
+ AcpiPsAppendArg (Op, PreOp->Common.Value.Arg);
AcpiGbl_Depth++;
if (Op->Common.AmlOpcode == AML_REGION_OP)
@@ -993,6 +1004,11 @@ CloseThisOp:
AcpiPsCompleteThisOp (WalkState, Op);
Op = NULL;
+ if (PreOp)
+ {
+ AcpiPsFreeOp (PreOp);
+ PreOp = NULL;
+ }
switch (Status)
{
@@ -1285,6 +1301,30 @@ AcpiPsParseAml (
{
ACPI_REPORT_METHOD_ERROR ("Method execution failed",
WalkState->MethodNode, NULL, Status);
+
+ /* Check for possible multi-thread reentrancy problem */
+
+ if ((Status == AE_ALREADY_EXISTS) &&
+ (!WalkState->MethodDesc->Method.Semaphore))
+ {
+ /*
+ * This method is marked NotSerialized, but it tried to create a named
+ * object, causing the second thread entrance to fail. We will workaround
+ * this by marking the method permanently as Serialized.
+ */
+ WalkState->MethodDesc->Method.MethodFlags |= AML_METHOD_SERIALIZED;
+ WalkState->MethodDesc->Method.Concurrency = 1;
+ }
+ }
+
+ if (WalkState->MethodDesc)
+ {
+ /* Decrement the thread count on the method parse tree */
+
+ if (WalkState->MethodDesc->Method.ThreadCount)
+ {
+ WalkState->MethodDesc->Method.ThreadCount--;
+ }
}
/* We are done with this walk, move on to the parent if any */
diff --git a/sys/contrib/dev/acpica/utglobal.c b/sys/contrib/dev/acpica/utglobal.c
index 39ebd58..d3ad37a 100644
--- a/sys/contrib/dev/acpica/utglobal.c
+++ b/sys/contrib/dev/acpica/utglobal.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utglobal - Global variables for the ACPI subsystem
- * $Revision: 193 $
+ * $Revision: 194 $
*
*****************************************************************************/
@@ -265,6 +265,15 @@ const char *AcpiGbl_HighestDstateNames[4] = {
"_S3D",
"_S4D"};
+/* Strings supported by the _OSI predefined (internal) method */
+
+const char *AcpiGbl_ValidOsiStrings[ACPI_NUM_OSI_STRINGS] = {
+ "Linux",
+ "Windows 2000",
+ "Windows 2001",
+ "Windows 2001.1"};
+
+
/******************************************************************************
*
* Namespace globals
@@ -275,14 +284,10 @@ const char *AcpiGbl_HighestDstateNames[4] = {
/*
* Predefined ACPI Names (Built-in to the Interpreter)
*
- * Initial values are currently supported only for types String and Number.
- * Both are specified as strings in this table.
- *
* NOTES:
- * 1) _SB_ is defined to be a device to allow _SB_/_INI to be run
+ * 1) _SB_ is defined to be a device to allow \_SB_._INI to be run
* during the initialization sequence.
*/
-
const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] =
{
{"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL},
@@ -294,7 +299,7 @@ const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] =
{"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME},
{"_GL_", ACPI_TYPE_MUTEX, "0"},
-#if defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
+#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
{"_OSI", ACPI_TYPE_METHOD, "1"},
#endif
{NULL, ACPI_TYPE_ANY, NULL} /* Table terminator */
@@ -305,7 +310,6 @@ const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] =
* Properties of the ACPI Object Types, both internal and external.
* The table is indexed by values of ACPI_OBJECT_TYPE
*/
-
const UINT8 AcpiGbl_NsProperties[] =
{
ACPI_NS_NORMAL, /* 00 Any */
@@ -384,10 +388,8 @@ AcpiUtHexToAsciiChar (
*
******************************************************************************/
-
ACPI_TABLE_LIST AcpiGbl_TableLists[NUM_ACPI_TABLE_TYPES];
-
ACPI_TABLE_SUPPORT AcpiGbl_TableData[NUM_ACPI_TABLE_TYPES] =
{
/*********** Name, Signature, Global typed pointer Signature size, Type How many allowed?, Contains valid AML? */
@@ -551,9 +553,8 @@ AcpiUtGetEventName (
*
* The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching; when
* stored in a table it really means that we have thus far seen no evidence to
- * indicatewhat type is actually going to be stored for this entry.
+ * indicate what type is actually going to be stored for this entry.
*/
-
static const char AcpiGbl_BadType[] = "UNDEFINED";
#define TYPE_NAME_LENGTH 12 /* Maximum length of each string */
@@ -858,6 +859,11 @@ AcpiUtInitGlobals (
ACPI_FUNCTION_TRACE ("UtInitGlobals");
+ /* Runtime configuration */
+
+ AcpiGbl_CreateOsiMethod = TRUE;
+ AcpiGbl_AllMethodsSerialized = FALSE;
+
/* Memory allocation and cache lists */
ACPI_MEMSET (AcpiGbl_MemoryLists, 0, sizeof (ACPI_MEMORY_LIST) * ACPI_NUM_MEM_LISTS);
OpenPOWER on IntegriCloud