summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2013-11-15 20:40:27 +0000
committerjkim <jkim@FreeBSD.org>2013-11-15 20:40:27 +0000
commita1672476f94b0c9ac84a682574aeb1eb481c484c (patch)
tree393e1854c22739c2db6213f80e859a02e4223818 /source
parentf4a31baa14e08b26c3b63f02571280c872cabe90 (diff)
downloadFreeBSD-src-a1672476f94b0c9ac84a682574aeb1eb481c484c.zip
FreeBSD-src-a1672476f94b0c9ac84a682574aeb1eb481c484c.tar.gz
Import ACPICA 20131115.
Diffstat (limited to 'source')
-rw-r--r--source/common/adfile.c4
-rw-r--r--source/common/adwalk.c19
-rw-r--r--source/components/debugger/dbcmds.c8
-rw-r--r--source/components/namespace/nsalloc.c19
-rw-r--r--source/components/namespace/nsutils.c18
-rw-r--r--source/components/resources/rscalc.c6
-rw-r--r--source/components/resources/rscreate.c35
-rw-r--r--source/components/resources/rsutils.c2
-rw-r--r--source/components/utilities/utdebug.c34
-rw-r--r--source/components/utilities/utxface.c1
-rw-r--r--source/components/utilities/utxfinit.c1
-rw-r--r--source/include/acconfig.h2
-rw-r--r--source/include/acpixf.h2
-rw-r--r--source/include/acresrc.h5
-rw-r--r--source/include/platform/aclinux.h122
-rw-r--r--source/os_specific/service_layers/osunixxf.c2
-rw-r--r--source/tools/acpiexec/aehandlers.c44
17 files changed, 221 insertions, 103 deletions
diff --git a/source/common/adfile.c b/source/common/adfile.c
index 48ff89f..dd5abee 100644
--- a/source/common/adfile.c
+++ b/source/common/adfile.c
@@ -329,6 +329,7 @@ FlSplitInputPathname (
if (!Filename)
{
+ ACPI_FREE (DirectoryPath);
return (AE_NO_MEMORY);
}
@@ -337,6 +338,9 @@ FlSplitInputPathname (
if (OutFilename)
{
*OutFilename = Filename;
+ return (AE_OK);
}
+
+ ACPI_FREE (Filename);
return (AE_OK);
}
diff --git a/source/common/adwalk.c b/source/common/adwalk.c
index 2fb42fd..5b04859 100644
--- a/source/common/adwalk.c
+++ b/source/common/adwalk.c
@@ -820,17 +820,18 @@ AcpiDmXrefDescendingOp (
{
if (Status == AE_NOT_FOUND)
{
- AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType, 0);
-
/*
- * We could install this into the namespace, but we catch duplicate
- * externals when they are added to the list.
+ * Add this symbol as an external declaration, except if the
+ * parent is a CondRefOf operator. For this operator, we do not
+ * need an external, nor do we want one, since this can cause
+ * disassembly problems if the symbol is actually a control
+ * method.
*/
-#if 0
- Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
- ACPI_IMODE_LOAD_PASS1, ACPI_NS_DONT_OPEN_SCOPE,
- WalkState, &Node);
-#endif
+ if (!(Op->Asl.Parent &&
+ (Op->Asl.Parent->Asl.AmlOpcode == AML_COND_REF_OF_OP)))
+ {
+ AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType, 0);
+ }
}
}
diff --git a/source/components/debugger/dbcmds.c b/source/components/debugger/dbcmds.c
index be35763..7a417155 100644
--- a/source/components/debugger/dbcmds.c
+++ b/source/components/debugger/dbcmds.c
@@ -830,7 +830,7 @@ AcpiDmTestResourceConversion (
/* Convert internal resource list to external AML resource template */
- Status = AcpiRsCreateAmlResources (ResourceBuffer.Pointer, &NewAml);
+ Status = AcpiRsCreateAmlResources (&ResourceBuffer, &NewAml);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("AcpiRsCreateAmlResources failed: %s\n",
@@ -842,8 +842,8 @@ AcpiDmTestResourceConversion (
OriginalAml = ReturnBuffer.Pointer;
- AcpiDmCompareAmlResources (
- OriginalAml->Buffer.Pointer, (ACPI_RSDESC_SIZE) OriginalAml->Buffer.Length,
+ AcpiDmCompareAmlResources (OriginalAml->Buffer.Pointer,
+ (ACPI_RSDESC_SIZE) OriginalAml->Buffer.Length,
NewAml.Pointer, (ACPI_RSDESC_SIZE) NewAml.Length);
/* Cleanup and exit */
@@ -1042,7 +1042,7 @@ GetCrs:
}
EndCrs:
- ACPI_FREE_BUFFER (ReturnBuffer);
+ ACPI_FREE (ReturnBuffer.Pointer);
}
diff --git a/source/components/namespace/nsalloc.c b/source/components/namespace/nsalloc.c
index 09b42f5..38ce8fc 100644
--- a/source/components/namespace/nsalloc.c
+++ b/source/components/namespace/nsalloc.c
@@ -121,6 +121,7 @@ AcpiNsDeleteNode (
ACPI_NAMESPACE_NODE *Node)
{
ACPI_OPERAND_OBJECT *ObjDesc;
+ ACPI_OPERAND_OBJECT *NextDesc;
ACPI_FUNCTION_NAME (NsDeleteNode);
@@ -131,12 +132,13 @@ AcpiNsDeleteNode (
AcpiNsDetachObject (Node);
/*
- * Delete an attached data object if present (an object that was created
- * and attached via AcpiAttachData). Note: After any normal object is
- * detached above, the only possible remaining object is a data object.
+ * Delete an attached data object list if present (objects that were
+ * attached via AcpiAttachData). Note: After any normal object is
+ * detached above, the only possible remaining object(s) are data
+ * objects, in a linked list.
*/
ObjDesc = Node->Object;
- if (ObjDesc &&
+ while (ObjDesc &&
(ObjDesc->Common.Type == ACPI_TYPE_LOCAL_DATA))
{
/* Invoke the attached data deletion handler if present */
@@ -146,7 +148,16 @@ AcpiNsDeleteNode (
ObjDesc->Data.Handler (Node, ObjDesc->Data.Pointer);
}
+ NextDesc = ObjDesc->Common.NextObject;
AcpiUtRemoveReference (ObjDesc);
+ ObjDesc = NextDesc;
+ }
+
+ /* Special case for the statically allocated root node */
+
+ if (Node == AcpiGbl_RootNode)
+ {
+ return;
}
/* Now we can delete the node */
diff --git a/source/components/namespace/nsutils.c b/source/components/namespace/nsutils.c
index f2cf74f..ccecd6d 100644
--- a/source/components/namespace/nsutils.c
+++ b/source/components/namespace/nsutils.c
@@ -693,27 +693,29 @@ void
AcpiNsTerminate (
void)
{
- ACPI_OPERAND_OBJECT *ObjDesc;
+ ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (NsTerminate);
/*
- * 1) Free the entire namespace -- all nodes and objects
- *
- * Delete all object descriptors attached to namepsace nodes
+ * Free the entire namespace -- all nodes and all objects
+ * attached to the nodes
*/
AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode);
- /* Detach any objects attached to the root */
+ /* Delete any objects attached to the root node */
- ObjDesc = AcpiNsGetAttachedObject (AcpiGbl_RootNode);
- if (ObjDesc)
+ Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status))
{
- AcpiNsDetachObject (AcpiGbl_RootNode);
+ return_VOID;
}
+ AcpiNsDeleteNode (AcpiGbl_RootNode);
+ (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Namespace freed\n"));
return_VOID;
}
diff --git a/source/components/resources/rscalc.c b/source/components/resources/rscalc.c
index a6e8b38..a5a8e5a 100644
--- a/source/components/resources/rscalc.c
+++ b/source/components/resources/rscalc.c
@@ -197,6 +197,7 @@ AcpiRsStreamOptionLength (
* FUNCTION: AcpiRsGetAmlLength
*
* PARAMETERS: Resource - Pointer to the resource linked list
+ * ResourceListSize - Size of the resource linked list
* SizeNeeded - Where the required size is returned
*
* RETURN: Status
@@ -210,9 +211,11 @@ AcpiRsStreamOptionLength (
ACPI_STATUS
AcpiRsGetAmlLength (
ACPI_RESOURCE *Resource,
+ ACPI_SIZE ResourceListSize,
ACPI_SIZE *SizeNeeded)
{
ACPI_SIZE AmlSizeNeeded = 0;
+ ACPI_RESOURCE *ResourceEnd;
ACPI_RS_LENGTH TotalSize;
@@ -221,7 +224,8 @@ AcpiRsGetAmlLength (
/* Traverse entire list of internal resource descriptors */
- while (Resource)
+ ResourceEnd = ACPI_ADD_PTR (ACPI_RESOURCE, Resource, ResourceListSize);
+ while (Resource < ResourceEnd)
{
/* Validate the descriptor type */
diff --git a/source/components/resources/rscreate.c b/source/components/resources/rscreate.c
index 209b503..fa6b4aa 100644
--- a/source/components/resources/rscreate.c
+++ b/source/components/resources/rscreate.c
@@ -435,23 +435,22 @@ AcpiRsCreatePciRoutingTable (
*
* FUNCTION: AcpiRsCreateAmlResources
*
- * PARAMETERS: LinkedListBuffer - Pointer to the resource linked list
- * OutputBuffer - Pointer to the user's buffer
+ * PARAMETERS: ResourceList - Pointer to the resource list buffer
+ * OutputBuffer - Where the AML buffer is returned
*
* RETURN: Status AE_OK if okay, else a valid ACPI_STATUS code.
* If the OutputBuffer is too small, the error will be
* AE_BUFFER_OVERFLOW and OutputBuffer->Length will point
* to the size buffer needed.
*
- * DESCRIPTION: Takes the linked list of device resources and
- * creates a bytestream to be used as input for the
- * _SRS control method.
+ * DESCRIPTION: Converts a list of device resources to an AML bytestream
+ * to be used as input for the _SRS control method.
*
******************************************************************************/
ACPI_STATUS
AcpiRsCreateAmlResources (
- ACPI_RESOURCE *LinkedListBuffer,
+ ACPI_BUFFER *ResourceList,
ACPI_BUFFER *OutputBuffer)
{
ACPI_STATUS Status;
@@ -461,17 +460,15 @@ AcpiRsCreateAmlResources (
ACPI_FUNCTION_TRACE (RsCreateAmlResources);
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "LinkedListBuffer = %p\n",
- LinkedListBuffer));
+ /* Params already validated, no need to re-validate here */
- /*
- * Params already validated, so we don't re-validate here
- *
- * Pass the LinkedListBuffer into a module that calculates
- * the buffer size needed for the byte stream.
- */
- Status = AcpiRsGetAmlLength (LinkedListBuffer,
- &AmlSizeNeeded);
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ResourceList Buffer = %p\n",
+ ResourceList->Pointer));
+
+ /* Get the buffer size needed for the AML byte stream */
+
+ Status = AcpiRsGetAmlLength (ResourceList->Pointer,
+ ResourceList->Length, &AmlSizeNeeded);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n",
(UINT32) AmlSizeNeeded, AcpiFormatException (Status)));
@@ -490,14 +487,14 @@ AcpiRsCreateAmlResources (
/* Do the conversion */
- Status = AcpiRsConvertResourcesToAml (LinkedListBuffer, AmlSizeNeeded,
- OutputBuffer->Pointer);
+ Status = AcpiRsConvertResourcesToAml (ResourceList->Pointer,
+ AmlSizeNeeded, OutputBuffer->Pointer);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "OutputBuffer %p Length %X\n",
- OutputBuffer->Pointer, (UINT32) OutputBuffer->Length));
+ OutputBuffer->Pointer, (UINT32) OutputBuffer->Length));
return_ACPI_STATUS (AE_OK);
}
diff --git a/source/components/resources/rsutils.c b/source/components/resources/rsutils.c
index 04591d9..eb0d93c 100644
--- a/source/components/resources/rsutils.c
+++ b/source/components/resources/rsutils.c
@@ -827,7 +827,7 @@ AcpiRsSetSrsMethodData (
* Convert the linked list into a byte stream
*/
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
- Status = AcpiRsCreateAmlResources (InBuffer->Pointer, &Buffer);
+ Status = AcpiRsCreateAmlResources (InBuffer, &Buffer);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
diff --git a/source/components/utilities/utdebug.c b/source/components/utilities/utdebug.c
index ab16236..87dbf53 100644
--- a/source/components/utilities/utdebug.c
+++ b/source/components/utilities/utdebug.c
@@ -211,6 +211,7 @@ AcpiDebugPrint (
}
AcpiGbl_PrevThreadId = ThreadId;
+ AcpiGbl_NestingLevel = 0;
}
/*
@@ -219,13 +220,22 @@ AcpiDebugPrint (
*/
AcpiOsPrintf ("%9s-%04ld ", ModuleName, LineNumber);
+#ifdef ACPI_EXEC_APP
+ /*
+ * For AcpiExec only, emit the thread ID and nesting level.
+ * Note: nesting level is really only useful during a single-thread
+ * execution. Otherwise, multiple threads will keep resetting the
+ * level.
+ */
if (ACPI_LV_THREADS & AcpiDbgLevel)
{
AcpiOsPrintf ("[%u] ", (UINT32) ThreadId);
}
- AcpiOsPrintf ("[%02ld] %-22.22s: ",
- AcpiGbl_NestingLevel, AcpiUtTrimFunctionName (FunctionName));
+ AcpiOsPrintf ("[%02ld] ", AcpiGbl_NestingLevel);
+#endif
+
+ AcpiOsPrintf ("%-22.22s: ", AcpiUtTrimFunctionName (FunctionName));
va_start (args, Format);
AcpiOsVprintf (Format, args);
@@ -475,7 +485,10 @@ AcpiUtExit (
"%s\n", AcpiGbl_FnExitStr);
}
- AcpiGbl_NestingLevel--;
+ if (AcpiGbl_NestingLevel)
+ {
+ AcpiGbl_NestingLevel--;
+ }
}
ACPI_EXPORT_SYMBOL (AcpiUtExit)
@@ -527,7 +540,10 @@ AcpiUtStatusExit (
}
}
- AcpiGbl_NestingLevel--;
+ if (AcpiGbl_NestingLevel)
+ {
+ AcpiGbl_NestingLevel--;
+ }
}
ACPI_EXPORT_SYMBOL (AcpiUtStatusExit)
@@ -569,7 +585,10 @@ AcpiUtValueExit (
ACPI_FORMAT_UINT64 (Value));
}
- AcpiGbl_NestingLevel--;
+ if (AcpiGbl_NestingLevel)
+ {
+ AcpiGbl_NestingLevel--;
+ }
}
ACPI_EXPORT_SYMBOL (AcpiUtValueExit)
@@ -610,7 +629,10 @@ AcpiUtPtrExit (
"%s %p\n", AcpiGbl_FnExitStr, Ptr);
}
- AcpiGbl_NestingLevel--;
+ if (AcpiGbl_NestingLevel)
+ {
+ AcpiGbl_NestingLevel--;
+ }
}
#endif
diff --git a/source/components/utilities/utxface.c b/source/components/utilities/utxface.c
index 3087d67..a093ec6 100644
--- a/source/components/utilities/utxface.c
+++ b/source/components/utilities/utxface.c
@@ -43,6 +43,7 @@
#define __UTXFACE_C__
+#define EXPORT_ACPI_INTERFACES
#include "acpi.h"
#include "accommon.h"
diff --git a/source/components/utilities/utxfinit.c b/source/components/utilities/utxfinit.c
index a9d9251..b395c15 100644
--- a/source/components/utilities/utxfinit.c
+++ b/source/components/utilities/utxfinit.c
@@ -43,6 +43,7 @@
#define __UTXFINIT_C__
+#define EXPORT_ACPI_INTERFACES
#include "acpi.h"
#include "accommon.h"
diff --git a/source/include/acconfig.h b/source/include/acconfig.h
index 48f220b..4846445 100644
--- a/source/include/acconfig.h
+++ b/source/include/acconfig.h
@@ -84,7 +84,9 @@
* Should the subsystem abort the loading of an ACPI table if the
* table checksum is incorrect?
*/
+#ifndef ACPI_CHECKSUM_ABORT
#define ACPI_CHECKSUM_ABORT FALSE
+#endif
/*
* Generate a version of ACPICA that only supports "reduced hardware"
diff --git a/source/include/acpixf.h b/source/include/acpixf.h
index cba3e56..15273ad 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 0x20130927
+#define ACPI_CA_VERSION 0x20131115
#include "acconfig.h"
#include "actypes.h"
diff --git a/source/include/acresrc.h b/source/include/acresrc.h
index dbe90df..98f650b 100644
--- a/source/include/acresrc.h
+++ b/source/include/acresrc.h
@@ -197,7 +197,7 @@ AcpiRsCreateResourceList (
ACPI_STATUS
AcpiRsCreateAmlResources (
- ACPI_RESOURCE *LinkedListBuffer,
+ ACPI_BUFFER *ResourceList,
ACPI_BUFFER *OutputBuffer);
ACPI_STATUS
@@ -251,7 +251,8 @@ AcpiRsGetListLength (
ACPI_STATUS
AcpiRsGetAmlLength (
- ACPI_RESOURCE *LinkedListBuffer,
+ ACPI_RESOURCE *ResourceList,
+ ACPI_SIZE ResourceListSize,
ACPI_SIZE *SizeNeeded);
ACPI_STATUS
diff --git a/source/include/platform/aclinux.h b/source/include/platform/aclinux.h
index b6a7e17..f56aff1 100644
--- a/source/include/platform/aclinux.h
+++ b/source/include/platform/aclinux.h
@@ -58,11 +58,13 @@
#include <linux/ctype.h>
#include <linux/sched.h>
#include <linux/atomic.h>
-#include <asm/div64.h>
-#include <asm/acpi.h>
+#include <linux/math64.h>
#include <linux/slab.h>
#include <linux/spinlock_types.h>
-#include <asm/current.h>
+#ifdef EXPORT_ACPI_INTERFACES
+#include <linux/export.h>
+#endif
+#include <asm/acpi.h>
/* Host-dependent types and defines for in-kernel ACPICA */
@@ -85,7 +87,7 @@
/* Host-dependent types and defines for user-space ACPICA */
#define ACPI_FLUSH_CPU_CACHE()
-#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (pthread))
+#define ACPI_CAST_PTHREAD_T(Pthread) ((ACPI_THREAD_ID) (Pthread))
#if defined(__ia64__) || defined(__x86_64__) || defined(__aarch64__)
#define ACPI_MACHINE_WIDTH 64
@@ -110,24 +112,31 @@
#ifdef __KERNEL__
+
+/*
+ * FIXME: Inclusion of actypes.h
+ * Linux kernel need this before defining inline OSL interfaces as
+ * actypes.h need to be included to find ACPICA type definitions.
+ * Since from ACPICA's perspective, the actypes.h should be included after
+ * acenv.h (aclinux.h), this leads to a inclusion mis-ordering issue.
+ */
#include <acpi/actypes.h>
+/*
+ * Overrides for in-kernel ACPICA
+ */
ACPI_STATUS __init AcpiOsInitialize (
void);
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsInitialize
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInitialize
-ACPI_STATUS __exit AcpiOsTerminate (
+ACPI_STATUS AcpiOsTerminate (
void);
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsTerminate
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTerminate
/*
* Memory allocation/deallocation
*/
-/* Use native linux version of acpi_os_allocate_zeroed */
-
-#define USE_NATIVE_ALLOCATE_ZEROED
-
/*
* The irqs_disabled() check is for resume from RAM.
* Interrupts are off during resume, just like they are for boot.
@@ -140,7 +149,9 @@ AcpiOsAllocate (
{
return kmalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
}
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsAllocate
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocate
+
+/* Use native linux version of AcpiOsAllocateZeroed */
static inline void *
AcpiOsAllocateZeroed (
@@ -148,7 +159,8 @@ AcpiOsAllocateZeroed (
{
return kzalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
}
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsAllocateZeroed
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocateZeroed
+#define USE_NATIVE_ALLOCATE_ZEROED
static inline void
AcpiOsFree (
@@ -156,7 +168,7 @@ AcpiOsFree (
{
kfree (Memory);
}
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsFree
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsFree
static inline void *
AcpiOsAcquireObject (
@@ -165,20 +177,18 @@ AcpiOsAcquireObject (
return kmem_cache_zalloc (Cache,
irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL);
}
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsAcquireObject
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireObject
-/*
- * Overrides for in-kernel ACPICA
- */
static inline ACPI_THREAD_ID
AcpiOsGetThreadId (
void)
{
return (ACPI_THREAD_ID) (unsigned long) current;
}
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetThreadId
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetThreadId
#ifndef CONFIG_PREEMPT
+
/*
* Used within ACPICA to show where it is safe to preempt execution
* when CONFIG_PREEMPT=n
@@ -188,6 +198,7 @@ AcpiOsGetThreadId (
if (!irqs_disabled()) \
cond_resched(); \
} while (0)
+
#endif
/*
@@ -198,47 +209,66 @@ AcpiOsGetThreadId (
* prevents lockdep from reporting false positives for ACPICA locks.
*/
#define AcpiOsCreateLock(__Handle) \
-({ \
- spinlock_t *Lock = ACPI_ALLOCATE(sizeof(*Lock)); \
- if (Lock) { \
- *(__Handle) = Lock; \
- spin_lock_init(*(__Handle)); \
- } \
- Lock ? AE_OK : AE_NO_MEMORY; \
-})
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsCreateLock
+ ({ \
+ spinlock_t *Lock = ACPI_ALLOCATE(sizeof(*Lock)); \
+ if (Lock) { \
+ *(__Handle) = Lock; \
+ spin_lock_init(*(__Handle)); \
+ } \
+ Lock ? AE_OK : AE_NO_MEMORY; \
+ })
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateLock
void __iomem *
AcpiOsMapMemory (
ACPI_PHYSICAL_ADDRESS Where,
ACPI_SIZE Length);
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsMapMemory
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsMapMemory
void
AcpiOsUnmapMemory (
void __iomem *LogicalAddress,
ACPI_SIZE Size);
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsUnmapMemory
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsUnmapMemory
+
+/*
+ * OSL interfaces used by debugger/disassembler
+ */
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadable
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritable
+
+/*
+ * OSL interfaces used by utilities
+ */
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRedirectOutput
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetLine
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByName
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByIndex
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByAddress
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenDirectory
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetNextFilename
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseDirectory
-/* OSL interfaces used by debugger/disassembler */
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsReadable
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsWritable
+/*
+ * OSL interfaces added by Linux
+ */
+void
+EarlyAcpiOsUnmapMemory (
+ void __iomem *Virt,
+ ACPI_SIZE Size);
-/* OSL interfaces used by utilities */
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsRedirectOutput
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetLine
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetTableByName
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetTableByIndex
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetTableByAddress
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsOpenDirectory
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsGetNextFilename
-#define ACPI_USE_NATIVE_DECLARED_AcpiOsCloseDirectory
+void
+AcpiOsGpeCount (
+ UINT32 GpeNumber);
-/* OSL interfaces added by Linux */
+void
+AcpiOsFixedEventCount (
+ UINT32 FixedEventNumber);
-#ifdef EXPORT_ACPI_INTERFACES
-#include <linux/export.h>
-#endif
+ACPI_STATUS
+AcpiOsHotplugExecute (
+ ACPI_OSD_EXEC_CALLBACK Function,
+ void *Context);
#endif /* __KERNEL__ */
diff --git a/source/os_specific/service_layers/osunixxf.c b/source/os_specific/service_layers/osunixxf.c
index fee51a6..74c4c24 100644
--- a/source/os_specific/service_layers/osunixxf.c
+++ b/source/os_specific/service_layers/osunixxf.c
@@ -91,7 +91,7 @@ typedef void* (*PTHREAD_CALLBACK) (void *);
/* Terminal support for AcpiExec only */
#ifdef ACPI_EXEC_APP
-#include <termio.h>
+#include <termios.h>
struct termios OriginalTermAttributes;
diff --git a/source/tools/acpiexec/aehandlers.c b/source/tools/acpiexec/aehandlers.c
index aad2705..2447414 100644
--- a/source/tools/acpiexec/aehandlers.c
+++ b/source/tools/acpiexec/aehandlers.c
@@ -98,6 +98,11 @@ AeAttachedDataHandler (
ACPI_HANDLE Object,
void *Data);
+static void
+AeAttachedDataHandler2 (
+ ACPI_HANDLE Object,
+ void *Data);
+
static UINT32
AeInterfaceHandler (
ACPI_STRING InterfaceName,
@@ -605,7 +610,29 @@ AeAttachedDataHandler (
ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Data);
- AcpiOsPrintf ("Received an attached data deletion on %4.4s\n",
+ AcpiOsPrintf ("Received an attached data deletion (1) on %4.4s\n",
+ Node->Name.Ascii);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AeAttachedDataHandler2
+ *
+ * DESCRIPTION: Handler for deletion of nodes with attached data (attached via
+ * AcpiAttachData)
+ *
+ *****************************************************************************/
+
+static void
+AeAttachedDataHandler2 (
+ ACPI_HANDLE Object,
+ void *Data)
+{
+ ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Data);
+
+
+ AcpiOsPrintf ("Received an attached data deletion (2) on %4.4s\n",
Node->Name.Ascii);
}
@@ -1022,8 +1049,23 @@ AeInstallEarlyHandlers (
Status = AcpiDetachData (Handle, AeAttachedDataHandler);
AE_CHECK_OK (AcpiDetachData, Status);
+ /* Test attach data at the root object */
+
+ Status = AcpiAttachData (ACPI_ROOT_OBJECT, AeAttachedDataHandler,
+ AcpiGbl_RootNode);
+ AE_CHECK_OK (AcpiAttachData, Status);
+
+ Status = AcpiAttachData (ACPI_ROOT_OBJECT, AeAttachedDataHandler2,
+ AcpiGbl_RootNode);
+ AE_CHECK_OK (AcpiAttachData, Status);
+
+ /* Test support for multiple attaches */
+
Status = AcpiAttachData (Handle, AeAttachedDataHandler, Handle);
AE_CHECK_OK (AcpiAttachData, Status);
+
+ Status = AcpiAttachData (Handle, AeAttachedDataHandler2, Handle);
+ AE_CHECK_OK (AcpiAttachData, Status);
}
else
{
OpenPOWER on IntegriCloud