aboutsummaryrefslogtreecommitdiffstats
path: root/source/components
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2012-05-19 05:44:32 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2012-05-19 05:44:32 +0000
commitfa948a817cf9dae39dc632f9bf48a8af37244a0e (patch)
tree83fbd480537714dcce335edc4aed3216f4e57816 /source/components
parentb43c4dd5abdb09fe2e7f73f186586b962c9dc9f5 (diff)
downloadsrc-vendor/acpica/20120518.tar.gz
src-vendor/acpica/20120518.zip
Import ACPICA 20120518.vendor/acpica/20120518
Diffstat (limited to 'source/components')
-rw-r--r--source/components/debugger/dbfileio.c13
-rw-r--r--source/components/dispatcher/dsfield.c84
-rw-r--r--source/components/events/evxface.c10
-rw-r--r--source/components/tables/tbfadt.c33
-rw-r--r--source/components/utilities/utmisc.c35
5 files changed, 164 insertions, 11 deletions
diff --git a/source/components/debugger/dbfileio.c b/source/components/debugger/dbfileio.c
index ef9b7fef5379..9845ff47e68f 100644
--- a/source/components/debugger/dbfileio.c
+++ b/source/components/debugger/dbfileio.c
@@ -51,6 +51,10 @@
#include "actables.h"
#endif
+#ifdef ACPI_ASL_COMPILER
+#include "aslcompiler.h"
+#endif
+
#if (defined ACPI_DEBUGGER || defined ACPI_DISASSEMBLER)
#define _COMPONENT ACPI_CA_DEBUGGER
@@ -309,6 +313,15 @@ AcpiDbReadTable (
AcpiOsPrintf (
"TableHeader length [0x%X] greater than the input file size [0x%X]\n",
TableHeader.Length, FileSize);
+
+#ifdef ACPI_ASL_COMPILER
+ Status = FlCheckForAscii (fp, NULL, FALSE);
+ if (ACPI_SUCCESS (Status))
+ {
+ AcpiOsPrintf ("File appears to be ASCII only, must be binary\n",
+ TableHeader.Length, FileSize);
+ }
+#endif
return (AE_BAD_HEADER);
}
diff --git a/source/components/dispatcher/dsfield.c b/source/components/dispatcher/dsfield.c
index 1c3c523720cf..8a364c8a90bc 100644
--- a/source/components/dispatcher/dsfield.c
+++ b/source/components/dispatcher/dsfield.c
@@ -57,6 +57,18 @@
/* Local prototypes */
+#ifdef ACPI_ASL_COMPILER
+#include "acdisasm.h"
+
+static ACPI_STATUS
+AcpiDsCreateExternalRegion (
+ ACPI_STATUS LookupStatus,
+ ACPI_PARSE_OBJECT *Op,
+ char *Path,
+ ACPI_WALK_STATE *WalkState,
+ ACPI_NAMESPACE_NODE **Node);
+#endif
+
static ACPI_STATUS
AcpiDsGetFieldNames (
ACPI_CREATE_FIELD_INFO *Info,
@@ -64,6 +76,69 @@ AcpiDsGetFieldNames (
ACPI_PARSE_OBJECT *Arg);
+#ifdef ACPI_ASL_COMPILER
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDsCreateExternalRegion (iASL Disassembler only)
+ *
+ * PARAMETERS: LookupStatus - Status from NsLookup operation
+ * Op - Op containing the Field definition and args
+ * Path - Pathname of the region
+ * ` WalkState - Current method state
+ * Node - Where the new region node is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Add region to the external list if NOT_FOUND. Create a new
+ * region node/object.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDsCreateExternalRegion (
+ ACPI_STATUS LookupStatus,
+ ACPI_PARSE_OBJECT *Op,
+ char *Path,
+ ACPI_WALK_STATE *WalkState,
+ ACPI_NAMESPACE_NODE **Node)
+{
+ ACPI_STATUS Status;
+ ACPI_OPERAND_OBJECT *ObjDesc;
+
+
+ if (LookupStatus != AE_NOT_FOUND)
+ {
+ return (LookupStatus);
+ }
+
+ /*
+ * Table disassembly:
+ * OperationRegion not found. Generate an External for it, and
+ * insert the name into the namespace.
+ */
+ AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_REGION, 0);
+ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_REGION,
+ ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, WalkState, Node);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Must create and install a region object for the new node */
+
+ ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION);
+ if (!ObjDesc)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ ObjDesc->Region.Node = *Node;
+ Status = AcpiNsAttachObject (*Node, ObjDesc, ACPI_TYPE_REGION);
+ return (Status);
+}
+#endif
+
+
/*******************************************************************************
*
* FUNCTION: AcpiDsCreateBufferField
@@ -438,11 +513,16 @@ AcpiDsCreateField (
/* First arg is the name of the parent OpRegion (must already exist) */
Arg = Op->Common.Value.Arg;
+
if (!RegionNode)
{
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name,
ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
+#ifdef ACPI_ASL_COMPILER
+ Status = AcpiDsCreateExternalRegion (Status, Arg,
+ Arg->Common.Value.Name, WalkState, &RegionNode);
+#endif
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status);
@@ -628,6 +708,10 @@ AcpiDsCreateBankField (
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name,
ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
+#ifdef ACPI_ASL_COMPILER
+ Status = AcpiDsCreateExternalRegion (Status, Arg,
+ Arg->Common.Value.Name, WalkState, &RegionNode);
+#endif
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status);
diff --git a/source/components/events/evxface.c b/source/components/events/evxface.c
index 1b709a5787eb..334e2418ba19 100644
--- a/source/components/events/evxface.c
+++ b/source/components/events/evxface.c
@@ -280,11 +280,9 @@ AcpiRemoveNotifyHandler (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
-#ifdef _UNDER_DEVELOPMENT
- /* Make sure all deferred tasks are completed */
+ /* Make sure all deferred notify tasks are completed */
- AcpiOsWaitEventsComplete (NULL);
-#endif
+ AcpiOsWaitEventsComplete ();
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
@@ -802,6 +800,10 @@ AcpiRemoveGpeHandler (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
+ /* Make sure all deferred GPE tasks are completed */
+
+ AcpiOsWaitEventsComplete ();
+
Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
if (ACPI_FAILURE (Status))
{
diff --git a/source/components/tables/tbfadt.c b/source/components/tables/tbfadt.c
index e8773204478c..46925114ebe4 100644
--- a/source/components/tables/tbfadt.c
+++ b/source/components/tables/tbfadt.c
@@ -52,12 +52,13 @@
/* Local prototypes */
-static ACPI_INLINE void
+static void
AcpiTbInitGenericAddress (
ACPI_GENERIC_ADDRESS *GenericAddress,
UINT8 SpaceId,
UINT8 ByteWidth,
- UINT64 Address);
+ UINT64 Address,
+ char *RegisterName);
static void
AcpiTbConvertFadt (
@@ -202,13 +203,30 @@ static ACPI_FADT_PM_INFO FadtPmInfoTable[] =
*
******************************************************************************/
-static ACPI_INLINE void
+static void
AcpiTbInitGenericAddress (
ACPI_GENERIC_ADDRESS *GenericAddress,
UINT8 SpaceId,
UINT8 ByteWidth,
- UINT64 Address)
+ UINT64 Address,
+ char *RegisterName)
{
+ UINT8 BitWidth;
+
+
+ /* Bit width field in the GAS is only one byte long, 255 max */
+
+ BitWidth = (UINT8) (ByteWidth * 8);
+
+ if (ByteWidth > 31) /* (31*8)=248 */
+ {
+ ACPI_ERROR ((AE_INFO,
+ "%s - 32-bit FADT register is too long (%u bytes, %u bits) "
+ "to convert to GAS struct - 255 bits max, truncating",
+ RegisterName, ByteWidth, (ByteWidth * 8)));
+
+ BitWidth = 255;
+ }
/*
* The 64-bit Address field is non-aligned in the byte packed
@@ -219,7 +237,7 @@ AcpiTbInitGenericAddress (
/* All other fields are byte-wide */
GenericAddress->SpaceId = SpaceId;
- GenericAddress->BitWidth = (UINT8) ACPI_MUL_8 (ByteWidth);
+ GenericAddress->BitWidth = BitWidth;
GenericAddress->BitOffset = 0;
GenericAddress->AccessWidth = 0; /* Access width ANY */
}
@@ -484,7 +502,7 @@ AcpiTbConvertFadt (
*/
AcpiTbInitGenericAddress (Address64, ACPI_ADR_SPACE_SYSTEM_IO,
*ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT, FadtInfoTable[i].Length),
- (UINT64) Address32);
+ (UINT64) Address32, FadtInfoTable[i].Name);
}
}
}
@@ -700,7 +718,8 @@ AcpiTbSetupFadtRegisters (
AcpiTbInitGenericAddress (FadtPmInfoTable[i].Target,
Source64->SpaceId, Pm1RegisterByteWidth,
Source64->Address +
- (FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth));
+ (FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth),
+ "PmRegisters");
}
}
}
diff --git a/source/components/utilities/utmisc.c b/source/components/utilities/utmisc.c
index 062c768e72a0..7ce00df64281 100644
--- a/source/components/utilities/utmisc.c
+++ b/source/components/utilities/utmisc.c
@@ -55,6 +55,41 @@
/*******************************************************************************
*
+ * FUNCTION: UtConvertBackslashes
+ *
+ * PARAMETERS: Pathname - File pathname string to be converted
+ *
+ * RETURN: Modifies the input Pathname
+ *
+ * DESCRIPTION: Convert all backslashes (0x5C) to forward slashes (0x2F) within
+ * the entire input file pathname string.
+ *
+ ******************************************************************************/
+
+void
+UtConvertBackslashes (
+ char *Pathname)
+{
+
+ if (!Pathname)
+ {
+ return;
+ }
+
+ while (*Pathname)
+ {
+ if (*Pathname == '\\')
+ {
+ *Pathname = '/';
+ }
+
+ Pathname++;
+ }
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiUtValidateException
*
* PARAMETERS: Status - The ACPI_STATUS code to be formatted