ACK: [PATCH] ACPICA: update to version 20131115
IvanHu
ivan.hu at canonical.com
Fri Nov 29 03:58:08 UTC 2013
On 11/18/2013 11:18 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> This set of ACPICA fixes includes the following fixes:
>
> https://lists.acpica.org/pipermail/devel/2013-November/thread.html
>
> I've run this through my database of ACPI tables on the method,
> syntaxcheck and WMI tests and compared these with previous version
> and we have no regressions. Also checked in Coverity Scan.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/acpica/source/common/adfile.c | 9 +-
> src/acpica/source/common/adwalk.c | 19 ++--
> src/acpica/source/components/debugger/dbcmds.c | 8 +-
> src/acpica/source/components/namespace/nsalloc.c | 19 +++-
> src/acpica/source/components/namespace/nsutils.c | 18 +--
> src/acpica/source/components/resources/rscalc.c | 6 +-
> src/acpica/source/components/resources/rscreate.c | 35 +++---
> src/acpica/source/components/resources/rsutils.c | 2 +-
> src/acpica/source/components/utilities/utdebug.c | 34 +++++-
> src/acpica/source/components/utilities/utxface.c | 1 +
> src/acpica/source/components/utilities/utxfinit.c | 1 +
> src/acpica/source/include/acconfig.h | 2 +
> src/acpica/source/include/acpixf.h | 2 +-
> src/acpica/source/include/acresrc.h | 5 +-
> src/acpica/source/include/platform/aclinux.h | 122 +++++++++++++--------
> .../source/os_specific/service_layers/osunixxf.c | 2 +-
> src/acpica/source/tools/acpiexec/aehandlers.c | 44 +++++++-
> 17 files changed, 221 insertions(+), 108 deletions(-)
>
> diff --git a/src/acpica/source/common/adfile.c b/src/acpica/source/common/adfile.c
> index 57cb580..d598ac8 100644
> --- a/src/acpica/source/common/adfile.c
> +++ b/src/acpica/source/common/adfile.c
> @@ -401,7 +401,7 @@ FlSplitInputPathname (
>
> if (!Filename)
> {
> - ACPI_FREE(DirectoryPath);
> + ACPI_FREE (DirectoryPath);
> return (AE_NO_MEMORY);
> }
>
> @@ -410,10 +410,9 @@ FlSplitInputPathname (
> if (OutFilename)
> {
> *OutFilename = Filename;
> + return (AE_OK);
> }
> - else
> - {
> - ACPI_FREE(Filename);
> - }
> +
> + ACPI_FREE (Filename);
> return (AE_OK);
> }
> diff --git a/src/acpica/source/common/adwalk.c b/src/acpica/source/common/adwalk.c
> index 76ef5df..2d380f4 100644
> --- a/src/acpica/source/common/adwalk.c
> +++ b/src/acpica/source/common/adwalk.c
> @@ -892,17 +892,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/src/acpica/source/components/debugger/dbcmds.c b/src/acpica/source/components/debugger/dbcmds.c
> index aa3f89b..bed0f55 100644
> --- a/src/acpica/source/components/debugger/dbcmds.c
> +++ b/src/acpica/source/components/debugger/dbcmds.c
> @@ -902,7 +902,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",
> @@ -914,8 +914,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 */
> @@ -1114,7 +1114,7 @@ GetCrs:
> }
>
> EndCrs:
> - ACPI_FREE_BUFFER (ReturnBuffer);
> + ACPI_FREE (ReturnBuffer.Pointer);
> }
>
>
> diff --git a/src/acpica/source/components/namespace/nsalloc.c b/src/acpica/source/components/namespace/nsalloc.c
> index cbb644f..8efa313 100644
> --- a/src/acpica/source/components/namespace/nsalloc.c
> +++ b/src/acpica/source/components/namespace/nsalloc.c
> @@ -193,6 +193,7 @@ AcpiNsDeleteNode (
> ACPI_NAMESPACE_NODE *Node)
> {
> ACPI_OPERAND_OBJECT *ObjDesc;
> + ACPI_OPERAND_OBJECT *NextDesc;
>
>
> ACPI_FUNCTION_NAME (NsDeleteNode);
> @@ -203,12 +204,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 */
> @@ -218,7 +220,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/src/acpica/source/components/namespace/nsutils.c b/src/acpica/source/components/namespace/nsutils.c
> index 1f5e188..f51fbf3 100644
> --- a/src/acpica/source/components/namespace/nsutils.c
> +++ b/src/acpica/source/components/namespace/nsutils.c
> @@ -765,27 +765,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/src/acpica/source/components/resources/rscalc.c b/src/acpica/source/components/resources/rscalc.c
> index f8eced5..dd0df81 100644
> --- a/src/acpica/source/components/resources/rscalc.c
> +++ b/src/acpica/source/components/resources/rscalc.c
> @@ -269,6 +269,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
> @@ -282,9 +283,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;
>
>
> @@ -293,7 +296,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/src/acpica/source/components/resources/rscreate.c b/src/acpica/source/components/resources/rscreate.c
> index 0e58aee..c73147a 100644
> --- a/src/acpica/source/components/resources/rscreate.c
> +++ b/src/acpica/source/components/resources/rscreate.c
> @@ -507,23 +507,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;
> @@ -533,17 +532,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)));
> @@ -562,14 +559,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/src/acpica/source/components/resources/rsutils.c b/src/acpica/source/components/resources/rsutils.c
> index bdc5ccf..ec692e2 100644
> --- a/src/acpica/source/components/resources/rsutils.c
> +++ b/src/acpica/source/components/resources/rsutils.c
> @@ -899,7 +899,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/src/acpica/source/components/utilities/utdebug.c b/src/acpica/source/components/utilities/utdebug.c
> index af904ac..0a57f76 100644
> --- a/src/acpica/source/components/utilities/utdebug.c
> +++ b/src/acpica/source/components/utilities/utdebug.c
> @@ -283,6 +283,7 @@ AcpiDebugPrint (
> }
>
> AcpiGbl_PrevThreadId = ThreadId;
> + AcpiGbl_NestingLevel = 0;
> }
>
> /*
> @@ -291,13 +292,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);
> @@ -547,7 +557,10 @@ AcpiUtExit (
> "%s\n", AcpiGbl_FnExitStr);
> }
>
> - AcpiGbl_NestingLevel--;
> + if (AcpiGbl_NestingLevel)
> + {
> + AcpiGbl_NestingLevel--;
> + }
> }
>
> ACPI_EXPORT_SYMBOL (AcpiUtExit)
> @@ -599,7 +612,10 @@ AcpiUtStatusExit (
> }
> }
>
> - AcpiGbl_NestingLevel--;
> + if (AcpiGbl_NestingLevel)
> + {
> + AcpiGbl_NestingLevel--;
> + }
> }
>
> ACPI_EXPORT_SYMBOL (AcpiUtStatusExit)
> @@ -641,7 +657,10 @@ AcpiUtValueExit (
> ACPI_FORMAT_UINT64 (Value));
> }
>
> - AcpiGbl_NestingLevel--;
> + if (AcpiGbl_NestingLevel)
> + {
> + AcpiGbl_NestingLevel--;
> + }
> }
>
> ACPI_EXPORT_SYMBOL (AcpiUtValueExit)
> @@ -682,7 +701,10 @@ AcpiUtPtrExit (
> "%s %p\n", AcpiGbl_FnExitStr, Ptr);
> }
>
> - AcpiGbl_NestingLevel--;
> + if (AcpiGbl_NestingLevel)
> + {
> + AcpiGbl_NestingLevel--;
> + }
> }
>
> #endif
> diff --git a/src/acpica/source/components/utilities/utxface.c b/src/acpica/source/components/utilities/utxface.c
> index 3b69560..51ab251 100644
> --- a/src/acpica/source/components/utilities/utxface.c
> +++ b/src/acpica/source/components/utilities/utxface.c
> @@ -115,6 +115,7 @@
>
>
> #define __UTXFACE_C__
> +#define EXPORT_ACPI_INTERFACES
>
> #include "acpi.h"
> #include "accommon.h"
> diff --git a/src/acpica/source/components/utilities/utxfinit.c b/src/acpica/source/components/utilities/utxfinit.c
> index d69adbc..9ee0309 100644
> --- a/src/acpica/source/components/utilities/utxfinit.c
> +++ b/src/acpica/source/components/utilities/utxfinit.c
> @@ -115,6 +115,7 @@
>
>
> #define __UTXFINIT_C__
> +#define EXPORT_ACPI_INTERFACES
>
> #include "acpi.h"
> #include "accommon.h"
> diff --git a/src/acpica/source/include/acconfig.h b/src/acpica/source/include/acconfig.h
> index b9bdab6..d1a3dce 100644
> --- a/src/acpica/source/include/acconfig.h
> +++ b/src/acpica/source/include/acconfig.h
> @@ -156,7 +156,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/src/acpica/source/include/acpixf.h b/src/acpica/source/include/acpixf.h
> index cbcf400..ea0ff78 100644
> --- a/src/acpica/source/include/acpixf.h
> +++ b/src/acpica/source/include/acpixf.h
> @@ -119,7 +119,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/src/acpica/source/include/acresrc.h b/src/acpica/source/include/acresrc.h
> index 0c51c15..12e4451 100644
> --- a/src/acpica/source/include/acresrc.h
> +++ b/src/acpica/source/include/acresrc.h
> @@ -270,7 +270,7 @@ AcpiRsCreateResourceList (
>
> ACPI_STATUS
> AcpiRsCreateAmlResources (
> - ACPI_RESOURCE *LinkedListBuffer,
> + ACPI_BUFFER *ResourceList,
> ACPI_BUFFER *OutputBuffer);
>
> ACPI_STATUS
> @@ -324,7 +324,8 @@ AcpiRsGetListLength (
>
> ACPI_STATUS
> AcpiRsGetAmlLength (
> - ACPI_RESOURCE *LinkedListBuffer,
> + ACPI_RESOURCE *ResourceList,
> + ACPI_SIZE ResourceListSize,
> ACPI_SIZE *SizeNeeded);
>
> ACPI_STATUS
> diff --git a/src/acpica/source/include/platform/aclinux.h b/src/acpica/source/include/platform/aclinux.h
> index 15c1748..e806e59 100644
> --- a/src/acpica/source/include/platform/aclinux.h
> +++ b/src/acpica/source/include/platform/aclinux.h
> @@ -130,11 +130,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 */
>
> @@ -157,7 +159,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
> @@ -182,24 +184,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.
> @@ -212,7 +221,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 (
> @@ -220,7 +231,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 (
> @@ -228,7 +240,7 @@ AcpiOsFree (
> {
> kfree (Memory);
> }
> -#define ACPI_USE_NATIVE_DECLARED_AcpiOsFree
> +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsFree
>
> static inline void *
> AcpiOsAcquireObject (
> @@ -237,20 +249,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
> @@ -260,6 +270,7 @@ AcpiOsGetThreadId (
> if (!irqs_disabled()) \
> cond_resched(); \
> } while (0)
> +
> #endif
>
> /*
> @@ -270,47 +281,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/src/acpica/source/os_specific/service_layers/osunixxf.c b/src/acpica/source/os_specific/service_layers/osunixxf.c
> index 7aa4168..ad003c1 100644
> --- a/src/acpica/source/os_specific/service_layers/osunixxf.c
> +++ b/src/acpica/source/os_specific/service_layers/osunixxf.c
> @@ -163,7 +163,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/src/acpica/source/tools/acpiexec/aehandlers.c b/src/acpica/source/tools/acpiexec/aehandlers.c
> index f0cc8ba..294abea 100644
> --- a/src/acpica/source/tools/acpiexec/aehandlers.c
> +++ b/src/acpica/source/tools/acpiexec/aehandlers.c
> @@ -170,6 +170,11 @@ AeAttachedDataHandler (
> ACPI_HANDLE Object,
> void *Data);
>
> +static void
> +AeAttachedDataHandler2 (
> + ACPI_HANDLE Object,
> + void *Data);
> +
> static UINT32
> AeInterfaceHandler (
> ACPI_STRING InterfaceName,
> @@ -677,7 +682,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);
> }
>
> @@ -1094,8 +1121,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
> {
>
Acked-by: Ivan Hu <ivan.hu at canonical.com>
More information about the fwts-devel
mailing list