Upgrade to ACPICA 20180105

Tested on x86_64 and x86_gcc2, works on my machine and most likely fixes
that was most likely due to missing lock sync in previous ACPI upgrade.

 * Redid some of kallisti5's work as it was easier to start from earlier
   version.

 * Evaluating 64 bit physical addressing on 32 bit Haiku again as this
   was likely the cause of pagefaults (#12377):
"Implemented internal support for full 64-bit addresses that appear in all
Generic Address Structure (GAS) structures. Previously, only the lower 32
bits were used. Affects the use of GAS structures in the FADT and other
tables, as well as the GAS structures passed to the AcpiRead and
AcpiWrite public external interfaces that are used by drivers. Lv Zheng."

 * Mostly bugfixes in ACPICA
This commit is contained in:
Fredrik Holmqvist
2018-01-21 20:09:45 +01:00
parent 3f04c8352e
commit ff2e2f8198
206 changed files with 16258 additions and 3103 deletions
@@ -1350,3 +1350,29 @@ AcpiOsWaitEventsComplete()
//TODO: FreeBSD See description.
return;
}
/******************************************************************************
*
* FUNCTION: AcpiOsEnterSleep
*
* PARAMETERS: SleepState - Which sleep state to enter
* RegaValue - Register A value
* RegbValue - Register B value
*
* RETURN: Status
*
* DESCRIPTION: A hook before writing sleep registers to enter the sleep
* state. Return AE_CTRL_TERMINATE to skip further sleep register
* writes.
*
*****************************************************************************/
ACPI_STATUS
AcpiOsEnterSleep (
UINT8 SleepState,
UINT32 RegaValue,
UINT32 RegbValue)
{
return (AE_OK);
}
@@ -17,6 +17,7 @@ local dispatcher_src =
dsmthdat.c
dsobject.c
dsopcode.c
dspkginit.c
dsutils.c
dswexec.c
dswload.c
@@ -180,6 +181,8 @@ local utilities_src =
utresrc.c
utstate.c
utstring.c
utstrsuppt.c
utstrtoul64.c
uttrack.c
utuuid.c
utxface.c
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -161,7 +197,7 @@ AcpiDsExecuteArguments (
ACPI_WALK_STATE *WalkState;
ACPI_FUNCTION_TRACE (DsExecuteArguments);
ACPI_FUNCTION_TRACE_PTR (DsExecuteArguments, AmlStart);
/* Allocate a new parser op to be the root of the parsed tree */
@@ -438,7 +474,8 @@ AcpiDsGetPackageArguments (
return_ACPI_STATUS (AE_AML_INTERNAL);
}
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package Arg Init\n"));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package Argument Init, AML Ptr: %p\n",
ObjDesc->Package.AmlStart));
/* Execute the AML code for the TermArg arguments */
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -198,7 +234,8 @@ AcpiDsExecBeginControlOp (
WalkState->ParserState.PkgEnd;
ControlState->Control.Opcode =
Op->Common.AmlOpcode;
ControlState->Control.LoopTimeout = AcpiOsGetTimer () +
(UINT64) (AcpiGbl_MaxLoopIterations * ACPI_100NSEC_PER_SEC);
/* Push the control state on this walk's control stack */
@@ -291,15 +328,15 @@ AcpiDsExecEndControlOp (
/* Predicate was true, the body of the loop was just executed */
/*
* This loop counter mechanism allows the interpreter to escape
* possibly infinite loops. This can occur in poorly written AML
* when the hardware does not respond within a while loop and the
* loop does not implement a timeout.
* This infinite loop detection mechanism allows the interpreter
* to escape possibly infinite loops. This can occur in poorly
* written AML when the hardware does not respond within a while
* loop and the loop does not implement a timeout.
*/
ControlState->Control.LoopCount++;
if (ControlState->Control.LoopCount > AcpiGbl_MaxLoopIterations)
if (ACPI_TIME_AFTER (AcpiOsGetTimer (),
ControlState->Control.LoopTimeout))
{
Status = AE_AML_INFINITE_LOOP;
Status = AE_AML_LOOP_TIMEOUT;
break;
}
@@ -430,7 +467,7 @@ AcpiDsExecEndControlOp (
break;
case AML_BREAK_POINT_OP:
case AML_BREAKPOINT_OP:
AcpiDbSignalBreakPoint (WalkState);
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -284,6 +320,7 @@ AcpiDsDumpMethodStack (
Op->Common.Next = NULL;
#ifdef ACPI_DISASSEMBLER
AcpiOsPrintf ("Failed at ");
AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX);
#endif
Op->Common.Next = Next;
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -277,6 +313,8 @@ AcpiDsCreateBufferField (
if (!(WalkState->ParseFlags & ACPI_PARSE_EXECUTE))
{
ACPI_ERROR ((AE_INFO,
"Parse execute mode is not set"));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
@@ -302,7 +340,8 @@ AcpiDsCreateBufferField (
ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &Node);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
Arg->Common.Value.String, Status);
return_ACPI_STATUS (Status);
}
}
@@ -486,7 +525,8 @@ AcpiDsGetFieldNames (
WalkState, &Info->ConnectionNode);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Child->Common.Value.Name, Status);
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
Child->Common.Value.Name, Status);
return_ACPI_STATUS (Status);
}
}
@@ -502,7 +542,8 @@ AcpiDsGetFieldNames (
WalkState, &Info->FieldNode);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE ((char *) &Arg->Named.Name, Status);
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
(char *) &Arg->Named.Name, Status);
return_ACPI_STATUS (Status);
}
else
@@ -601,7 +642,8 @@ AcpiDsCreateField (
#endif
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status);
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
Arg->Common.Value.Name, Status);
return_ACPI_STATUS (Status);
}
}
@@ -665,6 +707,8 @@ AcpiDsInitFieldObjects (
return_ACPI_STATUS (AE_OK);
}
ACPI_ERROR ((AE_INFO,
"Parse deferred mode is not set"));
return_ACPI_STATUS (AE_AML_INTERNAL);
}
@@ -729,7 +773,8 @@ AcpiDsInitFieldObjects (
Flags, WalkState, &Node);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE ((char *) &Arg->Named.Name, Status);
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
(char *) &Arg->Named.Name, Status);
if (Status != AE_ALREADY_EXISTS)
{
return_ACPI_STATUS (Status);
@@ -794,7 +839,8 @@ AcpiDsCreateBankField (
#endif
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status);
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
Arg->Common.Value.Name, Status);
return_ACPI_STATUS (Status);
}
}
@@ -807,7 +853,8 @@ AcpiDsCreateBankField (
ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
Arg->Common.Value.String, Status);
return_ACPI_STATUS (Status);
}
@@ -880,7 +927,8 @@ AcpiDsCreateIndexField (
ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
Arg->Common.Value.String, Status);
return_ACPI_STATUS (Status);
}
@@ -892,7 +940,8 @@ AcpiDsCreateIndexField (
ACPI_NS_SEARCH_PARENT, WalkState, &Info.DataRegisterNode);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
Arg->Common.Value.String, Status);
return_ACPI_STATUS (Status);
}
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -118,6 +154,7 @@
#include "acdispat.h"
#include "acnamesp.h"
#include "actables.h"
#include "acinterp.h"
#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME ("dsinit")
@@ -303,23 +340,16 @@ AcpiDsInitializeObjects (
/* Walk entire namespace from the supplied root */
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/*
* We don't use AcpiWalkNamespace since we do not want to acquire
* the namespace reader lock.
*/
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, StartNode, ACPI_UINT32_MAX,
ACPI_NS_WALK_UNLOCK, AcpiDsInitOneObject, NULL, &Info, NULL);
ACPI_NS_WALK_NO_UNLOCK, AcpiDsInitOneObject, NULL, &Info, NULL);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace"));
}
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
Status = AcpiGetTableByIndex (TableIndex, &Table);
if (ACPI_FAILURE (Status))
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -297,6 +333,7 @@ AcpiDsMethodError (
ACPI_WALK_STATE *WalkState)
{
UINT32 AmlOffset;
ACPI_NAME Name = 0;
ACPI_FUNCTION_ENTRY ();
@@ -325,9 +362,16 @@ AcpiDsMethodError (
AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml,
WalkState->ParserState.AmlStart);
Status = AcpiGbl_ExceptionHandler (Status,
WalkState->MethodNode ?
WalkState->MethodNode->Name.Integer : 0,
if (WalkState->MethodNode)
{
Name = WalkState->MethodNode->Name.Integer;
}
else if (WalkState->DeferredNode)
{
Name = WalkState->DeferredNode->Name.Integer;
}
Status = AcpiGbl_ExceptionHandler (Status, Name,
WalkState->Opcode, AmlOffset, NULL);
AcpiExEnterInterpreter ();
}
@@ -849,6 +893,40 @@ AcpiDsTerminateControlMethod (
AcpiDsMethodDataDeleteAll (WalkState);
/*
* Delete any namespace objects created anywhere within the
* namespace by the execution of this method. Unless:
* 1) This method is a module-level executable code method, in which
* case we want make the objects permanent.
* 2) There are other threads executing the method, in which case we
* will wait until the last thread has completed.
*/
if (!(MethodDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL) &&
(MethodDesc->Method.ThreadCount == 1))
{
/* Delete any direct children of (created by) this method */
(void) AcpiExExitInterpreter ();
AcpiNsDeleteNamespaceSubtree (WalkState->MethodNode);
(void) AcpiExEnterInterpreter ();
/*
* Delete any objects that were created by this method
* elsewhere in the namespace (if any were created).
* Use of the ACPI_METHOD_MODIFIED_NAMESPACE optimizes the
* deletion such that we don't have to perform an entire
* namespace walk for every control method execution.
*/
if (MethodDesc->Method.InfoFlags & ACPI_METHOD_MODIFIED_NAMESPACE)
{
(void) AcpiExExitInterpreter ();
AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId);
(void) AcpiExEnterInterpreter ();
MethodDesc->Method.InfoFlags &=
~ACPI_METHOD_MODIFIED_NAMESPACE;
}
}
/*
* If method is serialized, release the mutex and restore the
* current sync level for this thread
@@ -868,36 +946,6 @@ AcpiDsTerminateControlMethod (
MethodDesc->Method.Mutex->Mutex.ThreadId = 0;
}
}
/*
* Delete any namespace objects created anywhere within the
* namespace by the execution of this method. Unless:
* 1) This method is a module-level executable code method, in which
* case we want make the objects permanent.
* 2) There are other threads executing the method, in which case we
* will wait until the last thread has completed.
*/
if (!(MethodDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL) &&
(MethodDesc->Method.ThreadCount == 1))
{
/* Delete any direct children of (created by) this method */
AcpiNsDeleteNamespaceSubtree (WalkState->MethodNode);
/*
* Delete any objects that were created by this method
* elsewhere in the namespace (if any were created).
* Use of the ACPI_METHOD_MODIFIED_NAMESPACE optimizes the
* deletion such that we don't have to perform an entire
* namespace walk for every control method execution.
*/
if (MethodDesc->Method.InfoFlags & ACPI_METHOD_MODIFIED_NAMESPACE)
{
AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId);
MethodDesc->Method.InfoFlags &=
~ACPI_METHOD_MODIFIED_NAMESPACE;
}
}
}
/* Decrement the thread count on the method */
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -800,7 +836,8 @@ AcpiDsStoreObjectToLocal (
*
* FUNCTION: AcpiDsMethodDataGetType
*
* PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP
* PARAMETERS: Opcode - Either AML_FIRST LOCAL_OP or
* AML_FIRST_ARG_OP
* Index - Which Local or Arg whose type to get
* WalkState - Current walk state object
*
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -124,14 +160,6 @@
#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME ("dsobject")
/* Local prototypes */
static ACPI_STATUS
AcpiDsBuildInternalObject (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
ACPI_OPERAND_OBJECT **ObjDescPtr);
#ifndef ACPI_NO_METHOD_EXECUTION
/*******************************************************************************
@@ -149,7 +177,7 @@ AcpiDsBuildInternalObject (
*
******************************************************************************/
static ACPI_STATUS
ACPI_STATUS
AcpiDsBuildInternalObject (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
@@ -157,7 +185,6 @@ AcpiDsBuildInternalObject (
{
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_STATUS Status;
ACPI_OBJECT_TYPE Type;
ACPI_FUNCTION_TRACE (DsBuildInternalObject);
@@ -168,129 +195,44 @@ AcpiDsBuildInternalObject (
{
/*
* This is a named object reference. If this name was
* previously looked up in the namespace, it was stored in this op.
* Otherwise, go ahead and look it up now
* previously looked up in the namespace, it was stored in
* this op. Otherwise, go ahead and look it up now
*/
if (!Op->Common.Node)
{
Status = AcpiNsLookup (WalkState->ScopeInfo,
Op->Common.Value.String,
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL,
ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &(Op->Common.Node)));
if (ACPI_FAILURE (Status))
/* Check if we are resolving a named reference within a package */
if ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
{
/* Check if we are resolving a named reference within a package */
if ((Status == AE_NOT_FOUND) && (AcpiGbl_EnableInterpreterSlack) &&
((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP)))
{
/*
* We didn't find the target and we are populating elements
* of a package - ignore if slack enabled. Some ASL code
* contains dangling invalid references in packages and
* expects that no exception will be issued. Leave the
* element as a null element. It cannot be used, but it
* can be overwritten by subsequent ASL code - this is
* typically the case.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Ignoring unresolved reference in package [%4.4s]\n",
WalkState->ScopeInfo->Scope.Node->Name.Ascii));
return_ACPI_STATUS (AE_OK);
}
else
{
ACPI_ERROR_NAMESPACE (Op->Common.Value.String, Status);
}
return_ACPI_STATUS (Status);
}
}
/* Special object resolution for elements of a package */
if ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
{
/*
* Attempt to resolve the node to a value before we insert it into
* the package. If this is a reference to a common data type,
* resolve it immediately. According to the ACPI spec, package
* elements can only be "data objects" or method references.
* Attempt to resolve to an Integer, Buffer, String or Package.
* If cannot, return the named reference (for things like Devices,
* Methods, etc.) Buffer Fields and Fields will resolve to simple
* objects (int/buf/str/pkg).
*
* NOTE: References to things like Devices, Methods, Mutexes, etc.
* will remain as named references. This behavior is not described
* in the ACPI spec, but it appears to be an oversight.
*/
ObjDesc = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Op->Common.Node);
Status = AcpiExResolveNodeToValue (
ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ObjDesc),
WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/*
* Special handling for Alias objects. We need to setup the type
* and the Op->Common.Node to point to the Alias target. Note,
* Alias has at most one level of indirection internally.
*/
Type = Op->Common.Node->Type;
if (Type == ACPI_TYPE_LOCAL_ALIAS)
{
Type = ObjDesc->Common.Type;
Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
Op->Common.Node->Object);
}
switch (Type)
{
/*
* For these types, we need the actual node, not the subobject.
* However, the subobject did not get an extra reference count above.
*
* TBD: should ExResolveNodeToValue be changed to fix this?
*/
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_THERMAL:
AcpiUtAddReference (Op->Common.Node->Object);
/*lint -fallthrough */
/*
* For these types, we need the actual node, not the subobject.
* The subobject got an extra reference count in ExResolveNodeToValue.
*/
case ACPI_TYPE_MUTEX:
case ACPI_TYPE_METHOD:
case ACPI_TYPE_POWER:
case ACPI_TYPE_PROCESSOR:
case ACPI_TYPE_EVENT:
case ACPI_TYPE_REGION:
/* We will create a reference object for these types below */
break;
default:
/*
* All other types - the node was resolved to an actual
* object, we are done.
* We won't resolve package elements here, we will do this
* after all ACPI tables are loaded into the namespace. This
* behavior supports both forward references to named objects
* and external references to objects in other tables.
*/
goto Exit;
goto CreateNewObject;
}
else
{
Status = AcpiNsLookup (WalkState->ScopeInfo,
Op->Common.Value.String,
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL,
ACPI_CAST_INDIRECT_PTR (
ACPI_NAMESPACE_NODE, &(Op->Common.Node)));
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
Op->Common.Value.String, Status);
return_ACPI_STATUS (Status);
}
}
}
}
CreateNewObject:
/* Create and init a new internal ACPI object */
ObjDesc = AcpiUtCreateInternalObject (
@@ -308,7 +250,28 @@ AcpiDsBuildInternalObject (
return_ACPI_STATUS (Status);
}
Exit:
/*
* Handling for unresolved package reference elements.
* These are elements that are namepaths.
*/
if ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
{
ObjDesc->Reference.Resolved = TRUE;
if ((Op->Common.AmlOpcode == AML_INT_NAMEPATH_OP) &&
!ObjDesc->Reference.Node)
{
/*
* Name was unresolved above.
* Get the prefix node for later lookup
*/
ObjDesc->Reference.Node = WalkState->ScopeInfo->Scope.Node;
ObjDesc->Reference.Aml = Op->Common.Aml;
ObjDesc->Reference.Resolved = FALSE;
}
}
*ObjDescPtr = ObjDesc;
return_ACPI_STATUS (Status);
}
@@ -430,209 +393,6 @@ AcpiDsBuildInternalBufferObj (
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiDsBuildInternalPackageObj
*
* PARAMETERS: WalkState - Current walk state
* Op - Parser object to be translated
* ElementCount - Number of elements in the package - this is
* the NumElements argument to Package()
* ObjDescPtr - Where the ACPI internal object is returned
*
* RETURN: Status
*
* DESCRIPTION: Translate a parser Op package object to the equivalent
* namespace object
*
* NOTE: The number of elements in the package will be always be the NumElements
* count, regardless of the number of elements in the package list. If
* NumElements is smaller, only that many package list elements are used.
* if NumElements is larger, the Package object is padded out with
* objects of type Uninitialized (as per ACPI spec.)
*
* Even though the ASL compilers do not allow NumElements to be smaller
* than the Package list length (for the fixed length package opcode), some
* BIOS code modifies the AML on the fly to adjust the NumElements, and
* this code compensates for that. This also provides compatibility with
* other AML interpreters.
*
******************************************************************************/
ACPI_STATUS
AcpiDsBuildInternalPackageObj (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
UINT32 ElementCount,
ACPI_OPERAND_OBJECT **ObjDescPtr)
{
ACPI_PARSE_OBJECT *Arg;
ACPI_PARSE_OBJECT *Parent;
ACPI_OPERAND_OBJECT *ObjDesc = NULL;
ACPI_STATUS Status = AE_OK;
UINT32 i;
UINT16 Index;
UINT16 ReferenceCount;
ACPI_FUNCTION_TRACE (DsBuildInternalPackageObj);
/* Find the parent of a possibly nested package */
Parent = Op->Common.Parent;
while ((Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
{
Parent = Parent->Common.Parent;
}
/*
* If we are evaluating a Named package object "Name (xxxx, Package)",
* the package object already exists, otherwise it must be created.
*/
ObjDesc = *ObjDescPtr;
if (!ObjDesc)
{
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_PACKAGE);
*ObjDescPtr = ObjDesc;
if (!ObjDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
ObjDesc->Package.Node = Parent->Common.Node;
}
/*
* Allocate the element array (array of pointers to the individual
* objects) based on the NumElements parameter. Add an extra pointer slot
* so that the list is always null terminated.
*/
ObjDesc->Package.Elements = ACPI_ALLOCATE_ZEROED (
((ACPI_SIZE) ElementCount + 1) * sizeof (void *));
if (!ObjDesc->Package.Elements)
{
AcpiUtDeleteObjectDesc (ObjDesc);
return_ACPI_STATUS (AE_NO_MEMORY);
}
ObjDesc->Package.Count = ElementCount;
/*
* Initialize the elements of the package, up to the NumElements count.
* Package is automatically padded with uninitialized (NULL) elements
* if NumElements is greater than the package list length. Likewise,
* Package is truncated if NumElements is less than the list length.
*/
Arg = Op->Common.Value.Arg;
Arg = Arg->Common.Next;
for (i = 0; Arg && (i < ElementCount); i++)
{
if (Arg->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP)
{
if (Arg->Common.Node->Type == ACPI_TYPE_METHOD)
{
/*
* A method reference "looks" to the parser to be a method
* invocation, so we special case it here
*/
Arg->Common.AmlOpcode = AML_INT_NAMEPATH_OP;
Status = AcpiDsBuildInternalObject (
WalkState, Arg, &ObjDesc->Package.Elements[i]);
}
else
{
/* This package element is already built, just get it */
ObjDesc->Package.Elements[i] =
ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node);
}
}
else
{
Status = AcpiDsBuildInternalObject (
WalkState, Arg, &ObjDesc->Package.Elements[i]);
}
if (*ObjDescPtr)
{
/* Existing package, get existing reference count */
ReferenceCount = (*ObjDescPtr)->Common.ReferenceCount;
if (ReferenceCount > 1)
{
/* Make new element ref count match original ref count */
for (Index = 0; Index < (ReferenceCount - 1); Index++)
{
AcpiUtAddReference ((ObjDesc->Package.Elements[i]));
}
}
}
Arg = Arg->Common.Next;
}
/* Check for match between NumElements and actual length of PackageList */
if (Arg)
{
/*
* NumElements was exhausted, but there are remaining elements in the
* PackageList. Truncate the package to NumElements.
*
* Note: technically, this is an error, from ACPI spec: "It is an error
* for NumElements to be less than the number of elements in the
* PackageList". However, we just print a message and
* no exception is returned. This provides Windows compatibility. Some
* BIOSs will alter the NumElements on the fly, creating this type
* of ill-formed package object.
*/
while (Arg)
{
/*
* We must delete any package elements that were created earlier
* and are not going to be used because of the package truncation.
*/
if (Arg->Common.Node)
{
AcpiUtRemoveReference (
ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node));
Arg->Common.Node = NULL;
}
/* Find out how many elements there really are */
i++;
Arg = Arg->Common.Next;
}
ACPI_INFO ((
"Actual Package length (%u) is larger than "
"NumElements field (%u), truncated",
i, ElementCount));
}
else if (i < ElementCount)
{
/*
* Arg list (elements) was exhausted, but we did not reach NumElements count.
* Note: this is not an error, the package is padded out with NULLs.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Package List length (%u) smaller than NumElements "
"count (%u), padded with null elements\n",
i, ElementCount));
}
ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjDesc);
return_ACPI_STATUS (Status);
}
/*******************************************************************************
*
* FUNCTION: AcpiDsCreateNode
@@ -760,10 +520,20 @@ AcpiDsInitObjectFromOp (
case ACPI_TYPE_PACKAGE:
/*
* Defer evaluation of Package TermArg operand
* Defer evaluation of Package TermArg operand and all
* package elements. (01/2017): We defer the element
* resolution to allow forward references from the package
* in order to provide compatibility with other ACPI
* implementations.
*/
ObjDesc->Package.Node = ACPI_CAST_PTR (
ACPI_NAMESPACE_NODE, WalkState->Operands[0]);
if (!Op->Named.Data)
{
return_ACPI_STATUS (AE_OK);
}
ObjDesc->Package.AmlStart = Op->Named.Data;
ObjDesc->Package.AmlLength = Op->Named.Length;
break;
@@ -867,9 +637,9 @@ AcpiDsInitObjectFromOp (
{
case AML_TYPE_LOCAL_VARIABLE:
/* Local ID (0-7) is (AML opcode - base AML_LOCAL_OP) */
/* Local ID (0-7) is (AML opcode - base AML_FIRST_LOCAL_OP) */
ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_LOCAL_OP;
ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_FIRST_LOCAL_OP;
ObjDesc->Reference.Class = ACPI_REFCLASS_LOCAL;
#ifndef ACPI_NO_METHOD_EXECUTION
@@ -882,9 +652,9 @@ AcpiDsInitObjectFromOp (
case AML_TYPE_METHOD_ARGUMENT:
/* Arg ID (0-6) is (AML opcode - base AML_ARG_OP) */
/* Arg ID (0-6) is (AML opcode - base AML_FIRST_ARG_OP) */
ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_ARG_OP;
ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_FIRST_ARG_OP;
ObjDesc->Reference.Class = ACPI_REFCLASS_ARG;
#ifndef ACPI_NO_METHOD_EXECUTION
@@ -904,8 +674,11 @@ AcpiDsInitObjectFromOp (
/* Node was saved in Op */
ObjDesc->Reference.Node = Op->Common.Node;
ObjDesc->Reference.Object = Op->Common.Node->Object;
ObjDesc->Reference.Class = ACPI_REFCLASS_NAME;
if (Op->Common.Node)
{
ObjDesc->Reference.Object = Op->Common.Node->Object;
}
break;
case AML_DEBUG_OP:
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -162,7 +198,7 @@ AcpiDsInitializeRegion (
/* Namespace is NOT locked */
Status = AcpiEvInitializeRegion (ObjDesc, FALSE);
Status = AcpiEvInitializeRegion (ObjDesc);
return (Status);
}
@@ -317,10 +353,9 @@ AcpiDsInitBufferField (
(8 * (UINT32) BufferDesc->Buffer.Length))
{
ACPI_ERROR ((AE_INFO,
"Field [%4.4s] at %u exceeds Buffer [%4.4s] size %u (bits)",
AcpiUtGetNodeName (ResultDesc),
BitOffset + BitCount,
AcpiUtGetNodeName (BufferDesc->Buffer.Node),
"Field [%4.4s] at bit offset/length %u/%u "
"exceeds size of target Buffer (%u bits)",
AcpiUtGetNodeName (ResultDesc), BitOffset, BitCount,
8 * (UINT32) BufferDesc->Buffer.Length));
Status = AE_AML_BUFFER_LIMIT;
goto Cleanup;
@@ -712,6 +747,16 @@ AcpiDsEvalDataObjectOperands (
*/
WalkState->OperandIndex = WalkState->NumOperands;
/* Ignore if child is not valid */
if (!Op->Common.Value.Arg)
{
ACPI_ERROR ((AE_INFO,
"Dispatch: Missing child while executing TermArg for %X",
Op->Common.AmlOpcode));
return_ACPI_STATUS (AE_OK);
}
Status = AcpiDsCreateOperand (WalkState, Op->Common.Value.Arg, 1);
if (ACPI_FAILURE (Status))
{
@@ -753,7 +798,7 @@ AcpiDsEvalDataObjectOperands (
break;
case AML_PACKAGE_OP:
case AML_VAR_PACKAGE_OP:
case AML_VARIABLE_PACKAGE_OP:
Status = AcpiDsBuildInternalPackageObj (
WalkState, Op, Length, &ObjDesc);
@@ -773,7 +818,7 @@ AcpiDsEvalDataObjectOperands (
*/
if ((!Op->Common.Parent) ||
((Op->Common.Parent->Common.AmlOpcode != AML_PACKAGE_OP) &&
(Op->Common.Parent->Common.AmlOpcode != AML_VAR_PACKAGE_OP) &&
(Op->Common.Parent->Common.AmlOpcode != AML_VARIABLE_PACKAGE_OP) &&
(Op->Common.Parent->Common.AmlOpcode != AML_NAME_OP)))
{
WalkState->ResultObj = ObjDesc;
@@ -0,0 +1,641 @@
/******************************************************************************
*
* Module Name: dspkginit - Completion of deferred package initialization
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
*
* 2.1. This is your license from Intel Corp. under its intellectual property
* rights. You may have additional license terms from the party that provided
* you this software, covering your right to use that party's intellectual
* property rights.
*
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
* copy of the source code appearing in this file ("Covered Code") an
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
* base code distributed originally by Intel ("Original Intel Code") to copy,
* make derivatives, distribute, use and display any portion of the Covered
* Code in any form, with the right to sublicense such rights; and
*
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
* license (with the right to sublicense), under only those claims of Intel
* patents that are infringed by the Original Intel Code, to make, use, sell,
* offer to sell, and import the Covered Code and derivative works thereof
* solely to the minimum extent necessary to exercise the above copyright
* license, and in no event shall the patent license extend to any additions
* to or modifications of the Original Intel Code. No other license or right
* is granted directly or by implication, estoppel or otherwise;
*
* The above copyright and patent license is granted only if the following
* conditions are met:
*
* 3. Conditions
*
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification with rights to further distribute source must include
* the above Copyright Notice, the above License, this list of Conditions,
* and the following Disclaimer and Export Compliance provision. In addition,
* Licensee must cause all Covered Code to which Licensee contributes to
* contain a file documenting the changes Licensee made to create that Covered
* Code and the date of any change. Licensee must include in that file the
* documentation of any changes made by any predecessor Licensee. Licensee
* must include a prominent statement that the modification is derived,
* directly or indirectly, from Original Intel Code.
*
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification without rights to further distribute source must
* include the following Disclaimer and Export Compliance provision in the
* documentation and/or other materials provided with distribution. In
* addition, Licensee may not authorize further sublicense of source of any
* portion of the Covered Code, and must include terms to the effect that the
* license from Licensee to its licensee is limited to the intellectual
* property embodied in the software Licensee provides to its licensee, and
* not to intellectual property embodied in modifications its licensee may
* make.
*
* 3.3. Redistribution of Executable. Redistribution in executable form of any
* substantial portion of the Covered Code or modification must reproduce the
* above Copyright Notice, and the following Disclaimer and Export Compliance
* provision in the documentation and/or other materials provided with the
* distribution.
*
* 3.4. Intel retains all right, title, and interest in and to the Original
* Intel Code.
*
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
* Intel shall be used in advertising or otherwise to promote the sale, use or
* other dealings in products derived from or relating to the Covered Code
* without prior written authorization from Intel.
*
* 4. Disclaimer and Export Compliance
*
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
* LIMITED REMEDY.
*
* 4.3. Licensee shall not export, either directly or indirectly, any of this
* software or system incorporating such software without first obtaining any
* required license or other approval from the U. S. Department of Commerce or
* any other agency or department of the United States Government. In the
* event Licensee exports any such software from the United States or
* re-exports any such software from a foreign destination, Licensee shall
* ensure that the distribution and export/re-export of the software is in
* compliance with all laws, regulations, orders, or other restrictions of the
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
* any of its subsidiaries will export/re-export any technical data, process,
* software, or service, directly or indirectly, to any country for which the
* United States government or any agency thereof requires an export license,
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
#include "accommon.h"
#include "acnamesp.h"
#include "amlcode.h"
#include "acdispat.h"
#include "acinterp.h"
#define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME ("dspkginit")
/* Local prototypes */
static void
AcpiDsResolvePackageElement (
ACPI_OPERAND_OBJECT **Element);
/*******************************************************************************
*
* FUNCTION: AcpiDsBuildInternalPackageObj
*
* PARAMETERS: WalkState - Current walk state
* Op - Parser object to be translated
* ElementCount - Number of elements in the package - this is
* the NumElements argument to Package()
* ObjDescPtr - Where the ACPI internal object is returned
*
* RETURN: Status
*
* DESCRIPTION: Translate a parser Op package object to the equivalent
* namespace object
*
* NOTE: The number of elements in the package will be always be the NumElements
* count, regardless of the number of elements in the package list. If
* NumElements is smaller, only that many package list elements are used.
* if NumElements is larger, the Package object is padded out with
* objects of type Uninitialized (as per ACPI spec.)
*
* Even though the ASL compilers do not allow NumElements to be smaller
* than the Package list length (for the fixed length package opcode), some
* BIOS code modifies the AML on the fly to adjust the NumElements, and
* this code compensates for that. This also provides compatibility with
* other AML interpreters.
*
******************************************************************************/
ACPI_STATUS
AcpiDsBuildInternalPackageObj (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
UINT32 ElementCount,
ACPI_OPERAND_OBJECT **ObjDescPtr)
{
ACPI_PARSE_OBJECT *Arg;
ACPI_PARSE_OBJECT *Parent;
ACPI_OPERAND_OBJECT *ObjDesc = NULL;
ACPI_STATUS Status = AE_OK;
UINT16 ReferenceCount;
UINT32 Index;
UINT32 i;
ACPI_FUNCTION_TRACE (DsBuildInternalPackageObj);
/* Find the parent of a possibly nested package */
Parent = Op->Common.Parent;
while ((Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
{
Parent = Parent->Common.Parent;
}
/*
* If we are evaluating a Named package object of the form:
* Name (xxxx, Package)
* the package object already exists, otherwise it must be created.
*/
ObjDesc = *ObjDescPtr;
if (!ObjDesc)
{
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_PACKAGE);
*ObjDescPtr = ObjDesc;
if (!ObjDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
ObjDesc->Package.Node = Parent->Common.Node;
}
if (ObjDesc->Package.Flags & AOPOBJ_DATA_VALID) /* Just in case */
{
return_ACPI_STATUS (AE_OK);
}
/*
* Allocate the element array (array of pointers to the individual
* objects) based on the NumElements parameter. Add an extra pointer slot
* so that the list is always null terminated.
*/
ObjDesc->Package.Elements = ACPI_ALLOCATE_ZEROED (
((ACPI_SIZE) ElementCount + 1) * sizeof (void *));
if (!ObjDesc->Package.Elements)
{
AcpiUtDeleteObjectDesc (ObjDesc);
return_ACPI_STATUS (AE_NO_MEMORY);
}
ObjDesc->Package.Count = ElementCount;
Arg = Op->Common.Value.Arg;
Arg = Arg->Common.Next;
if (Arg)
{
ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
}
/*
* Initialize the elements of the package, up to the NumElements count.
* Package is automatically padded with uninitialized (NULL) elements
* if NumElements is greater than the package list length. Likewise,
* Package is truncated if NumElements is less than the list length.
*/
for (i = 0; Arg && (i < ElementCount); i++)
{
if (Arg->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP)
{
if (Arg->Common.Node->Type == ACPI_TYPE_METHOD)
{
/*
* A method reference "looks" to the parser to be a method
* invocation, so we special case it here
*/
Arg->Common.AmlOpcode = AML_INT_NAMEPATH_OP;
Status = AcpiDsBuildInternalObject (
WalkState, Arg, &ObjDesc->Package.Elements[i]);
}
else
{
/* This package element is already built, just get it */
ObjDesc->Package.Elements[i] =
ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node);
}
}
else
{
Status = AcpiDsBuildInternalObject (
WalkState, Arg, &ObjDesc->Package.Elements[i]);
if (Status == AE_NOT_FOUND)
{
ACPI_ERROR ((AE_INFO, "%-48s", "****DS namepath not found"));
}
/*
* Initialize this package element. This function handles the
* resolution of named references within the package.
*/
AcpiDsInitPackageElement (0, ObjDesc->Package.Elements[i],
NULL, &ObjDesc->Package.Elements[i]);
}
if (*ObjDescPtr)
{
/* Existing package, get existing reference count */
ReferenceCount = (*ObjDescPtr)->Common.ReferenceCount;
if (ReferenceCount > 1)
{
/* Make new element ref count match original ref count */
/* TBD: Probably need an AcpiUtAddReferences function */
for (Index = 0; Index < ((UINT32) ReferenceCount - 1); Index++)
{
AcpiUtAddReference ((ObjDesc->Package.Elements[i]));
}
}
}
Arg = Arg->Common.Next;
}
/* Check for match between NumElements and actual length of PackageList */
if (Arg)
{
/*
* NumElements was exhausted, but there are remaining elements in
* the PackageList. Truncate the package to NumElements.
*
* Note: technically, this is an error, from ACPI spec: "It is an
* error for NumElements to be less than the number of elements in
* the PackageList". However, we just print a message and no
* exception is returned. This provides compatibility with other
* ACPI implementations. Some firmware implementations will alter
* the NumElements on the fly, possibly creating this type of
* ill-formed package object.
*/
while (Arg)
{
/*
* We must delete any package elements that were created earlier
* and are not going to be used because of the package truncation.
*/
if (Arg->Common.Node)
{
AcpiUtRemoveReference (
ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node));
Arg->Common.Node = NULL;
}
/* Find out how many elements there really are */
i++;
Arg = Arg->Common.Next;
}
ACPI_INFO ((
"Actual Package length (%u) is larger than "
"NumElements field (%u), truncated",
i, ElementCount));
}
else if (i < ElementCount)
{
/*
* Arg list (elements) was exhausted, but we did not reach
* NumElements count.
*
* Note: this is not an error, the package is padded out
* with NULLs.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Package List length (%u) smaller than NumElements "
"count (%u), padded with null elements\n",
i, ElementCount));
}
ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjDesc);
return_ACPI_STATUS (Status);
}
/*******************************************************************************
*
* FUNCTION: AcpiDsInitPackageElement
*
* PARAMETERS: ACPI_PKG_CALLBACK
*
* RETURN: Status
*
* DESCRIPTION: Resolve a named reference element within a package object
*
******************************************************************************/
ACPI_STATUS
AcpiDsInitPackageElement (
UINT8 ObjectType,
ACPI_OPERAND_OBJECT *SourceObject,
ACPI_GENERIC_STATE *State,
void *Context)
{
ACPI_OPERAND_OBJECT **ElementPtr;
ACPI_FUNCTION_TRACE (DsInitPackageElement);
if (!SourceObject)
{
return_ACPI_STATUS (AE_OK);
}
/*
* The following code is a bit of a hack to workaround a (current)
* limitation of the ACPI_PKG_CALLBACK interface. We need a pointer
* to the location within the element array because a new object
* may be created and stored there.
*/
if (Context)
{
/* A direct call was made to this function */
ElementPtr = (ACPI_OPERAND_OBJECT **) Context;
}
else
{
/* Call came from AcpiUtWalkPackageTree */
ElementPtr = State->Pkg.ThisTargetObj;
}
/* We are only interested in reference objects/elements */
if (SourceObject->Common.Type == ACPI_TYPE_LOCAL_REFERENCE)
{
/* Attempt to resolve the (named) reference to a namespace node */
AcpiDsResolvePackageElement (ElementPtr);
}
else if (SourceObject->Common.Type == ACPI_TYPE_PACKAGE)
{
SourceObject->Package.Flags |= AOPOBJ_DATA_VALID;
}
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiDsResolvePackageElement
*
* PARAMETERS: ElementPtr - Pointer to a reference object
*
* RETURN: Possible new element is stored to the indirect ElementPtr
*
* DESCRIPTION: Resolve a package element that is a reference to a named
* object.
*
******************************************************************************/
static void
AcpiDsResolvePackageElement (
ACPI_OPERAND_OBJECT **ElementPtr)
{
ACPI_STATUS Status;
ACPI_GENERIC_STATE ScopeInfo;
ACPI_OPERAND_OBJECT *Element = *ElementPtr;
ACPI_NAMESPACE_NODE *ResolvedNode;
ACPI_NAMESPACE_NODE *OriginalNode;
char *ExternalPath = NULL;
ACPI_OBJECT_TYPE Type;
ACPI_FUNCTION_TRACE (DsResolvePackageElement);
/* Check if reference element is already resolved */
if (Element->Reference.Resolved)
{
return_VOID;
}
/* Element must be a reference object of correct type */
ScopeInfo.Scope.Node = Element->Reference.Node; /* Prefix node */
Status = AcpiNsLookup (&ScopeInfo,
(char *) Element->Reference.Aml, /* Pointer to AML path */
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
NULL, &ResolvedNode);
if (ACPI_FAILURE (Status))
{
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX,
(char *) Element->Reference.Aml,
NULL, &ExternalPath);
ACPI_EXCEPTION ((AE_INFO, Status,
"Could not find/resolve named package element: %s", ExternalPath));
ACPI_FREE (ExternalPath);
*ElementPtr = NULL;
return_VOID;
}
else if (ResolvedNode->Type == ACPI_TYPE_ANY)
{
/* Named reference not resolved, return a NULL package element */
ACPI_ERROR ((AE_INFO,
"Could not resolve named package element [%4.4s] in [%4.4s]",
ResolvedNode->Name.Ascii, ScopeInfo.Scope.Node->Name.Ascii));
*ElementPtr = NULL;
return_VOID;
}
#if 0
else if (ResolvedNode->Flags & ANOBJ_TEMPORARY)
{
/*
* A temporary node found here indicates that the reference is
* to a node that was created within this method. We are not
* going to allow it (especially if the package is returned
* from the method) -- the temporary node will be deleted out
* from under the method. (05/2017).
*/
ACPI_ERROR ((AE_INFO,
"Package element refers to a temporary name [%4.4s], "
"inserting a NULL element",
ResolvedNode->Name.Ascii));
*ElementPtr = NULL;
return_VOID;
}
#endif
/*
* Special handling for Alias objects. We need ResolvedNode to point
* to the Alias target. This effectively "resolves" the alias.
*/
if (ResolvedNode->Type == ACPI_TYPE_LOCAL_ALIAS)
{
ResolvedNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
ResolvedNode->Object);
}
/* Update the reference object */
Element->Reference.Resolved = TRUE;
Element->Reference.Node = ResolvedNode;
Type = Element->Reference.Node->Type;
/*
* Attempt to resolve the node to a value before we insert it into
* the package. If this is a reference to a common data type,
* resolve it immediately. According to the ACPI spec, package
* elements can only be "data objects" or method references.
* Attempt to resolve to an Integer, Buffer, String or Package.
* If cannot, return the named reference (for things like Devices,
* Methods, etc.) Buffer Fields and Fields will resolve to simple
* objects (int/buf/str/pkg).
*
* NOTE: References to things like Devices, Methods, Mutexes, etc.
* will remain as named references. This behavior is not described
* in the ACPI spec, but it appears to be an oversight.
*/
OriginalNode = ResolvedNode;
Status = AcpiExResolveNodeToValue (&ResolvedNode, NULL);
if (ACPI_FAILURE (Status))
{
return_VOID;
}
#if 0
/* TBD - alias support */
/*
* Special handling for Alias objects. We need to setup the type
* and the Op->Common.Node to point to the Alias target. Note,
* Alias has at most one level of indirection internally.
*/
Type = Op->Common.Node->Type;
if (Type == ACPI_TYPE_LOCAL_ALIAS)
{
Type = ObjDesc->Common.Type;
Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
Op->Common.Node->Object);
}
#endif
switch (Type)
{
/*
* These object types are a result of named references, so we will
* leave them as reference objects. In other words, these types
* have no intrinsic "value".
*/
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_THERMAL:
case ACPI_TYPE_METHOD:
break;
case ACPI_TYPE_MUTEX:
case ACPI_TYPE_POWER:
case ACPI_TYPE_PROCESSOR:
case ACPI_TYPE_EVENT:
case ACPI_TYPE_REGION:
/* AcpiExResolveNodeToValue gave these an extra reference */
AcpiUtRemoveReference (OriginalNode->Object);
break;
default:
/*
* For all other types - the node was resolved to an actual
* operand object with a value, return the object. Remove
* a reference on the existing object.
*/
AcpiUtRemoveReference (Element);
*ElementPtr = (ACPI_OPERAND_OBJECT *) ResolvedNode;
break;
}
return_VOID;
}
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -369,8 +405,8 @@ AcpiDsIsResultUsed (
if ((Op->Common.Parent->Common.AmlOpcode == AML_REGION_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_DATA_REGION_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_BUFFER_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_INT_EVAL_SUBTREE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_BANK_FIELD_OP))
{
@@ -661,7 +697,7 @@ AcpiDsCreateOperand (
*/
if (Status == AE_NOT_FOUND)
{
if (ParentOp->Common.AmlOpcode == AML_COND_REF_OF_OP)
if (ParentOp->Common.AmlOpcode == AML_CONDITIONAL_REF_OF_OP)
{
/*
* For the Conditional Reference op, it's OK if
@@ -696,7 +732,8 @@ AcpiDsCreateOperand (
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (NameString, Status);
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
NameString, Status);
}
}
@@ -755,12 +792,6 @@ AcpiDsCreateOperand (
if ((OpInfo->Flags & AML_HAS_RETVAL) ||
(Arg->Common.Flags & ACPI_PARSEOP_IN_STACK))
{
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"Argument previously created, already stacked\n"));
AcpiDbDisplayArgumentObject (
WalkState->Operands [WalkState->NumOperands - 1], WalkState);
/*
* Use value that was already previously returned
* by the evaluation of this argument
@@ -942,7 +973,7 @@ AcpiDsEvaluateNamePath (
}
if ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_REF_OF_OP))
{
/* TBD: Should we specify this feature as a bit of OpInfo->Flags of these opcodes? */
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -216,7 +252,8 @@ AcpiDsGetPredicateValue (
* Result of predicate evaluation must be an Integer
* object. Implicitly convert the argument if necessary.
*/
Status = AcpiExConvertToInteger (ObjDesc, &LocalObjDesc, 16);
Status = AcpiExConvertToInteger (ObjDesc, &LocalObjDesc,
ACPI_IMPLICIT_CONVERSION);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
@@ -607,7 +644,7 @@ AcpiDsExecEndOp (
*/
if ((Op->Asl.Parent) &&
((Op->Asl.Parent->Asl.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Asl.Parent->Asl.AmlOpcode == AML_VAR_PACKAGE_OP)))
(Op->Asl.Parent->Asl.AmlOpcode == AML_VARIABLE_PACKAGE_OP)))
{
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"Method Reference in a Package, Op=%p\n", Op));
@@ -686,7 +723,8 @@ AcpiDsExecEndOp (
case AML_TYPE_CREATE_OBJECT:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Executing CreateObject (Buffer/Package) Op=%p\n", Op));
"Executing CreateObject (Buffer/Package) Op=%p AMLPtr=%p\n",
Op, Op->Named.Data));
switch (Op->Common.Parent->Common.AmlOpcode)
{
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -289,7 +325,7 @@ AcpiDsLoad1BeginOp (
#endif
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Path, Status);
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, Path, Status);
return_ACPI_STATUS (Status);
}
@@ -459,7 +495,7 @@ AcpiDsLoad1BeginOp (
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Path, Status);
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, Path, Status);
return_ACPI_STATUS (Status);
}
}
@@ -482,7 +518,7 @@ AcpiDsLoad1BeginOp (
/* Initialize the op */
#if (defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY))
Op->Named.Path = ACPI_CAST_PTR (UINT8, Path);
Op->Named.Path = Path;
#endif
if (Node)
@@ -522,6 +558,10 @@ AcpiDsLoad1EndOp (
ACPI_OBJECT_TYPE ObjectType;
ACPI_STATUS Status = AE_OK;
#ifdef ACPI_ASL_COMPILER
UINT8 ParamCount;
#endif
ACPI_FUNCTION_TRACE (DsLoad1EndOp);
@@ -606,6 +646,37 @@ AcpiDsLoad1EndOp (
}
}
#ifdef ACPI_ASL_COMPILER
/*
* For external opcode, get the object type from the argument and
* get the parameter count from the argument's next.
*/
if (AcpiGbl_DisasmFlag &&
Op->Common.Node &&
Op->Common.AmlOpcode == AML_EXTERNAL_OP)
{
/*
* Note, if this external is not a method
* Op->Common.Value.Arg->Common.Next->Common.Value.Integer == 0
* Therefore, ParamCount will be 0.
*/
ParamCount = (UINT8) Op->Common.Value.Arg->Common.Next->Common.Value.Integer;
ObjectType = (UINT8) Op->Common.Value.Arg->Common.Value.Integer;
Op->Common.Node->Flags |= ANOBJ_IS_EXTERNAL;
Op->Common.Node->Type = (UINT8) ObjectType;
AcpiDmCreateSubobjectForExternal ((UINT8)ObjectType,
&Op->Common.Node, ParamCount);
/*
* Add the external to the external list because we may be
* emitting code based off of the items within the external list.
*/
AcpiDmAddOpToExternalList (Op, Op->Named.Path, (UINT8)ObjectType, ParamCount,
ACPI_EXT_ORIGIN_FROM_OPCODE | ACPI_EXT_RESOLVED_REFERENCE);
}
#endif
/*
* If we are executing a method, do not create any namespace objects
* during the load phase, only during execution.
@@ -653,6 +724,7 @@ AcpiDsLoad1EndOp (
/* Pop the scope stack (only if loading a table) */
if (!WalkState->MethodNode &&
Op->Common.AmlOpcode != AML_EXTERNAL_OP &&
AcpiNsOpensScope (ObjectType))
{
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s): Popping scope for Op %p\n",
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -268,10 +304,12 @@ AcpiDsLoad2BeginOp (
}
else
{
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
BufferPtr, Status);
}
#else
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
BufferPtr, Status);
#endif
return_ACPI_STATUS (Status);
}
@@ -392,6 +430,24 @@ AcpiDsLoad2BeginOp (
}
}
#ifdef ACPI_ASL_COMPILER
/*
* Do not open a scope for AML_EXTERNAL_OP
* AcpiNsLookup can open a new scope based on the object type
* of this op. AML_EXTERNAL_OP is a declaration rather than a
* definition. In the case that this external is a method object,
* AcpiNsLookup will open a new scope. However, an AML_EXTERNAL_OP
* associated with the ACPI_TYPE_METHOD is a declaration, rather than
* a definition. Flags is set to avoid opening a scope for any
* AML_EXTERNAL_OP.
*/
if (WalkState->Opcode == AML_EXTERNAL_OP)
{
Flags |= ACPI_NS_DONT_OPEN_SCOPE;
}
#endif
/* Add new entry or lookup existing entry */
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
@@ -408,7 +464,8 @@ AcpiDsLoad2BeginOp (
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
BufferPtr, Status);
return_ACPI_STATUS (Status);
}
@@ -615,7 +672,7 @@ AcpiDsLoad2EndOp (
Status = AcpiExCreateProcessor (WalkState);
break;
case AML_POWER_RES_OP:
case AML_POWER_RESOURCE_OP:
Status = AcpiExCreatePowerResource (WalkState);
break;
@@ -696,29 +753,10 @@ AcpiDsLoad2EndOp (
{
return_ACPI_STATUS (Status);
}
AcpiExExitInterpreter ();
}
Status = AcpiEvInitializeRegion (
AcpiNsGetAttachedObject (Node), FALSE);
if (WalkState->MethodNode)
{
AcpiExEnterInterpreter ();
}
if (ACPI_FAILURE (Status))
{
/*
* If AE_NOT_EXIST is returned, it is not fatal
* because many regions get created before a handler
* is installed for said region.
*/
if (AE_NOT_EXIST == Status)
{
Status = AE_OK;
}
}
AcpiNsGetAttachedObject (Node));
break;
case AML_NAME_OP:
@@ -809,7 +847,8 @@ AcpiDsLoad2EndOp (
}
else
{
ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo,
Arg->Common.Value.String, Status);
}
break;
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -219,6 +255,70 @@ AcpiEvEnableGpe (
}
/*******************************************************************************
*
* FUNCTION: AcpiEvMaskGpe
*
* PARAMETERS: GpeEventInfo - GPE to be blocked/unblocked
* IsMasked - Whether the GPE is masked or not
*
* RETURN: Status
*
* DESCRIPTION: Unconditionally mask/unmask a GPE during runtime.
*
******************************************************************************/
ACPI_STATUS
AcpiEvMaskGpe (
ACPI_GPE_EVENT_INFO *GpeEventInfo,
BOOLEAN IsMasked)
{
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
UINT32 RegisterBit;
ACPI_FUNCTION_TRACE (EvMaskGpe);
GpeRegisterInfo = GpeEventInfo->RegisterInfo;
if (!GpeRegisterInfo)
{
return_ACPI_STATUS (AE_NOT_EXIST);
}
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
/* Perform the action */
if (IsMasked)
{
if (RegisterBit & GpeRegisterInfo->MaskForRun)
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
(void) AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
ACPI_SET_BIT (GpeRegisterInfo->MaskForRun, (UINT8) RegisterBit);
}
else
{
if (!(RegisterBit & GpeRegisterInfo->MaskForRun))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
ACPI_CLEAR_BIT (GpeRegisterInfo->MaskForRun, (UINT8) RegisterBit);
if (GpeEventInfo->RuntimeCount &&
!GpeEventInfo->DisableForDispatch)
{
(void) AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE);
}
}
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiEvAddGpeReference
@@ -451,8 +551,8 @@ AcpiEvGpeDetect (
ACPI_GPE_HANDLER_INFO *GpeHandlerInfo;
UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED;
UINT8 EnabledStatusByte;
UINT32 StatusReg;
UINT32 EnableReg;
UINT64 StatusReg;
UINT64 EnableReg;
ACPI_CPU_FLAGS Flags;
UINT32 i;
UINT32 j;
@@ -529,7 +629,7 @@ AcpiEvGpeDetect (
"RunEnable=%02X, WakeEnable=%02X\n",
GpeRegisterInfo->BaseGpeNumber,
GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
StatusReg, EnableReg,
(UINT32) StatusReg, (UINT32) EnableReg,
GpeRegisterInfo->EnableForRun,
GpeRegisterInfo->EnableForWake));
@@ -787,6 +887,7 @@ AcpiEvFinishGpe (
* in the EventInfo.
*/
(void) AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_CONDITIONAL_ENABLE);
GpeEventInfo->DisableForDispatch = FALSE;
return (AE_OK);
}
@@ -856,6 +957,8 @@ AcpiEvGpeDispatch (
}
}
GpeEventInfo->DisableForDispatch = TRUE;
/*
* Dispatch the GPE to either an installed handler or the control
* method associated with this GPE (_Lxx or _Exx). If a handler
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -408,7 +444,9 @@ AcpiEvMatchGpeMethod (
ACPI_NAMESPACE_NODE *MethodNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
ACPI_GPE_WALK_INFO *WalkInfo = ACPI_CAST_PTR (ACPI_GPE_WALK_INFO, Context);
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_STATUS Status;
UINT32 GpeNumber;
UINT8 TempGpeNumber;
char Name[ACPI_NAME_SIZE + 1];
UINT8 Type;
@@ -467,8 +505,8 @@ AcpiEvMatchGpeMethod (
/* 4) The last two characters of the name are the hex GPE Number */
GpeNumber = strtoul (&Name[2], NULL, 16);
if (GpeNumber == ACPI_UINT32_MAX)
Status = AcpiUtAsciiToHexByte (&Name[2], &TempGpeNumber);
if (ACPI_FAILURE (Status))
{
/* Conversion failed; invalid method, just ignore it */
@@ -480,6 +518,7 @@ AcpiEvMatchGpeMethod (
/* Ensure that we have a valid GPE number for this GPE block */
GpeNumber = (UINT32) TempGpeNumber;
GpeEventInfo = AcpiEvLowGetGpeInfo (GpeNumber, WalkInfo->GpeBlock);
if (!GpeEventInfo)
{
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -387,6 +423,17 @@ AcpiEvAddressSpaceDispatch (
{
ACPI_EXCEPTION ((AE_INFO, Status, "Returned by Handler for [%s]",
AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
/*
* Special case for an EC timeout. These are seen so frequently
* that an additional error message is helpful
*/
if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) &&
(Status == AE_TIME))
{
ACPI_ERROR ((AE_INFO,
"Timeout from EC hardware or EC device driver"));
}
}
if (!(HandlerDesc->AddressSpace.HandlerFlags &
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,12 +111,49 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
#include "accommon.h"
#include "acevents.h"
#include "acnamesp.h"
#include "acinterp.h"
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evrgnini")
@@ -609,7 +646,6 @@ AcpiEvDefaultRegionSetup (
* FUNCTION: AcpiEvInitializeRegion
*
* PARAMETERS: RegionObj - Region we are initializing
* AcpiNsLocked - Is namespace locked?
*
* RETURN: Status
*
@@ -627,21 +663,33 @@ AcpiEvDefaultRegionSetup (
* MUTEX: Interpreter should be unlocked, because we may run the _REG
* method for this region.
*
* NOTE: Possible incompliance:
* There is a behavior conflict in automatic _REG execution:
* 1. When the interpreter is evaluating a method, we can only
* automatically run _REG for the following case:
* Method(_REG, 2) {}
* OperationRegion (OPR1, 0x80, 0x1000010, 0x4)
* 2. When the interpreter is loading a table, we can also
* automatically run _REG for the following case:
* OperationRegion (OPR1, 0x80, 0x1000010, 0x4)
* Method(_REG, 2) {}
* Though this may not be compliant to the de-facto standard, the
* logic is kept in order not to trigger regressions. And keeping
* this logic should be taken care by the caller of this function.
*
******************************************************************************/
ACPI_STATUS
AcpiEvInitializeRegion (
ACPI_OPERAND_OBJECT *RegionObj,
BOOLEAN AcpiNsLocked)
ACPI_OPERAND_OBJECT *RegionObj)
{
ACPI_OPERAND_OBJECT *HandlerObj;
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_ADR_SPACE_TYPE SpaceId;
ACPI_NAMESPACE_NODE *Node;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE_U32 (EvInitializeRegion, AcpiNsLocked);
ACPI_FUNCTION_TRACE (EvInitializeRegion);
if (!RegionObj)
@@ -690,7 +738,8 @@ AcpiEvInitializeRegion (
*
* See AcpiNsExecModuleCode
*/
if (ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL)
if (!AcpiGbl_ParseTableAsTermList &&
ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL)
{
HandlerObj = ObjDesc->Method.Dispatch.Handler;
}
@@ -712,33 +761,15 @@ AcpiEvInitializeRegion (
"Found handler %p for region %p in obj %p\n",
HandlerObj, RegionObj, ObjDesc));
Status = AcpiEvAttachRegion (HandlerObj, RegionObj,
AcpiNsLocked);
(void) AcpiEvAttachRegion (HandlerObj, RegionObj, FALSE);
/*
* Tell all users that this region is usable by
* running the _REG method
*/
if (AcpiNsLocked)
{
Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
}
Status = AcpiEvExecuteRegMethod (RegionObj, ACPI_REG_CONNECT);
if (AcpiNsLocked)
{
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
}
AcpiExExitInterpreter ();
(void) AcpiEvExecuteRegMethod (RegionObj, ACPI_REG_CONNECT);
AcpiExEnterInterpreter ();
return_ACPI_STATUS (AE_OK);
}
}
@@ -748,11 +779,14 @@ AcpiEvInitializeRegion (
Node = Node->Parent;
}
/* If we get here, there is no handler for this region */
/*
* If we get here, there is no handler for this region. This is not
* fatal because many regions get created before a handler is installed
* for said region.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
"No handler for RegionType %s(%X) (RegionObj %p)\n",
AcpiUtGetRegionName (SpaceId), SpaceId, RegionObj));
return_ACPI_STATUS (AE_NOT_EXIST);
return_ACPI_STATUS (AE_OK);
}
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -113,6 +113,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#define EXPORT_ACPI_INTERFACES
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#define EXPORT_ACPI_INTERFACES
@@ -270,6 +306,13 @@ AcpiEnableEvent (
ACPI_FUNCTION_TRACE (AcpiEnableEvent);
/* If Hardware Reduced flag is set, there are no fixed events */
if (AcpiGbl_ReducedHardware)
{
return_ACPI_STATUS (AE_OK);
}
/* Decode the Fixed Event */
if (Event > ACPI_EVENT_MAX)
@@ -336,6 +379,13 @@ AcpiDisableEvent (
ACPI_FUNCTION_TRACE (AcpiDisableEvent);
/* If Hardware Reduced flag is set, there are no fixed events */
if (AcpiGbl_ReducedHardware)
{
return_ACPI_STATUS (AE_OK);
}
/* Decode the Fixed Event */
if (Event > ACPI_EVENT_MAX)
@@ -397,6 +447,13 @@ AcpiClearEvent (
ACPI_FUNCTION_TRACE (AcpiClearEvent);
/* If Hardware Reduced flag is set, there are no fixed events */
if (AcpiGbl_ReducedHardware)
{
return_ACPI_STATUS (AE_OK);
}
/* Decode the Fixed Event */
if (Event > ACPI_EVENT_MAX)
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#define EXPORT_ACPI_INTERFACES
@@ -343,11 +379,13 @@ AcpiSetGpe (
case ACPI_GPE_ENABLE:
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE);
GpeEventInfo->DisableForDispatch = FALSE;
break;
case ACPI_GPE_DISABLE:
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
GpeEventInfo->DisableForDispatch = TRUE;
break;
default:
@@ -364,6 +402,56 @@ UnlockAndExit:
ACPI_EXPORT_SYMBOL (AcpiSetGpe)
/*******************************************************************************
*
* FUNCTION: AcpiMaskGpe
*
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
* GpeNumber - GPE level within the GPE block
* IsMasked - Whether the GPE is masked or not
*
* RETURN: Status
*
* DESCRIPTION: Unconditionally mask/unmask the an individual GPE, ex., to
* prevent a GPE flooding.
*
******************************************************************************/
ACPI_STATUS
AcpiMaskGpe (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber,
BOOLEAN IsMasked)
{
ACPI_GPE_EVENT_INFO *GpeEventInfo;
ACPI_STATUS Status;
ACPI_CPU_FLAGS Flags;
ACPI_FUNCTION_TRACE (AcpiMaskGpe);
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
/* Ensure that we have a valid GPE number */
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
if (!GpeEventInfo)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
}
Status = AcpiEvMaskGpe (GpeEventInfo, IsMasked);
UnlockAndExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
return_ACPI_STATUS (Status);
}
ACPI_EXPORT_SYMBOL (AcpiMaskGpe)
/*******************************************************************************
*
* FUNCTION: AcpiMarkGpeForWake
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#define EXPORT_ACPI_INTERFACES
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -237,7 +273,8 @@ AcpiExDoConcatenate (
{
case ACPI_TYPE_INTEGER:
Status = AcpiExConvertToInteger (LocalOperand1, &TempOperand1, 16);
Status = AcpiExConvertToInteger (LocalOperand1, &TempOperand1,
ACPI_IMPLICIT_CONVERSION);
break;
case ACPI_TYPE_BUFFER:
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -132,7 +168,6 @@
static ACPI_STATUS
AcpiExAddTable (
UINT32 TableIndex,
ACPI_NAMESPACE_NODE *ParentNode,
ACPI_OPERAND_OBJECT **DdbHandle);
static ACPI_STATUS
@@ -160,12 +195,9 @@ AcpiExRegionRead (
static ACPI_STATUS
AcpiExAddTable (
UINT32 TableIndex,
ACPI_NAMESPACE_NODE *ParentNode,
ACPI_OPERAND_OBJECT **DdbHandle)
{
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_STATUS Status;
ACPI_OWNER_ID OwnerId;
ACPI_FUNCTION_TRACE (ExAddTable);
@@ -183,42 +215,8 @@ AcpiExAddTable (
ObjDesc->Common.Flags |= AOPOBJ_DATA_VALID;
ObjDesc->Reference.Class = ACPI_REFCLASS_TABLE;
*DdbHandle = ObjDesc;
/* Install the new table into the local data structures */
ObjDesc->Reference.Value = TableIndex;
/* Add the table to the namespace */
Status = AcpiNsLoadTable (TableIndex, ParentNode);
if (ACPI_FAILURE (Status))
{
AcpiUtRemoveReference (ObjDesc);
*DdbHandle = NULL;
return_ACPI_STATUS (Status);
}
/* Execute any module-level code that was found in the table */
AcpiExExitInterpreter ();
if (AcpiGbl_GroupModuleLevelCode)
{
AcpiNsExecModuleCodeList ();
}
AcpiExEnterInterpreter ();
/*
* Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is
* responsible for discovering any new wake GPEs by running _PRW methods
* that may have been loaded by this table.
*/
Status = AcpiTbGetOwnerId (TableIndex, &OwnerId);
if (ACPI_SUCCESS (Status))
{
AcpiEvUpdateGpes (OwnerId);
}
*DdbHandle = ObjDesc;
return_ACPI_STATUS (AE_OK);
}
@@ -247,7 +245,6 @@ AcpiExLoadTableOp (
ACPI_NAMESPACE_NODE *StartNode;
ACPI_NAMESPACE_NODE *ParameterNode = NULL;
ACPI_OPERAND_OBJECT *DdbHandle;
ACPI_TABLE_HEADER *Table;
UINT32 TableIndex;
@@ -256,10 +253,12 @@ AcpiExLoadTableOp (
/* Find the ACPI table in the RSDT/XSDT */
AcpiExExitInterpreter ();
Status = AcpiTbFindTable (
Operand[0]->String.Pointer,
Operand[1]->String.Pointer,
Operand[2]->String.Pointer, &TableIndex);
AcpiExEnterInterpreter ();
if (ACPI_FAILURE (Status))
{
if (Status != AE_NOT_FOUND)
@@ -292,8 +291,9 @@ AcpiExLoadTableOp (
* Find the node referenced by the RootPathString. This is the
* location within the namespace where the table will be loaded.
*/
Status = AcpiNsGetNode (StartNode, Operand[3]->String.Pointer,
ACPI_NS_SEARCH_PARENT, &ParentNode);
Status = AcpiNsGetNodeUnlocked (StartNode,
Operand[3]->String.Pointer, ACPI_NS_SEARCH_PARENT,
&ParentNode);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -316,8 +316,9 @@ AcpiExLoadTableOp (
/* Find the node referenced by the ParameterPathString */
Status = AcpiNsGetNode (StartNode, Operand[4]->String.Pointer,
ACPI_NS_SEARCH_PARENT, &ParameterNode);
Status = AcpiNsGetNodeUnlocked (StartNode,
Operand[4]->String.Pointer, ACPI_NS_SEARCH_PARENT,
&ParameterNode);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -326,7 +327,16 @@ AcpiExLoadTableOp (
/* Load the table into the namespace */
Status = AcpiExAddTable (TableIndex, ParentNode, &DdbHandle);
ACPI_INFO (("Dynamic OEM Table Load:"));
AcpiExExitInterpreter ();
Status = AcpiTbLoadTable (TableIndex, ParentNode);
AcpiExEnterInterpreter ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
Status = AcpiExAddTable (TableIndex, &DdbHandle);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -349,21 +359,6 @@ AcpiExLoadTableOp (
}
}
Status = AcpiGetTableByIndex (TableIndex, &Table);
if (ACPI_SUCCESS (Status))
{
ACPI_INFO (("Dynamic OEM Table Load:"));
AcpiTbPrintTableHeader (0, Table);
}
/* Invoke table handler if present */
if (AcpiGbl_TableHandler)
{
(void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,
AcpiGbl_TableHandlerContext);
}
*ReturnDesc = DdbHandle;
return_ACPI_STATUS (Status);
}
@@ -593,13 +588,10 @@ AcpiExLoadOp (
/* Install the new table into the local data structures */
ACPI_INFO (("Dynamic OEM Table Load:"));
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table),
ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, TRUE, TRUE,
&TableIndex);
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
AcpiExExitInterpreter ();
Status = AcpiTbInstallAndLoadTable (ACPI_PTR_TO_PHYSADDR (Table),
ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, TRUE, &TableIndex);
AcpiExEnterInterpreter ();
if (ACPI_FAILURE (Status))
{
/* Delete allocated table buffer */
@@ -608,17 +600,6 @@ AcpiExLoadOp (
return_ACPI_STATUS (Status);
}
/*
* Note: Now table is "INSTALLED", it must be validated before
* loading.
*/
Status = AcpiTbValidateTable (
&AcpiGbl_RootTableList.Tables[TableIndex]);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/*
* Add the table to the namespace.
*
@@ -626,7 +607,7 @@ AcpiExLoadOp (
* This appears to go against the ACPI specification, but we do it for
* compatibility with other ACPI implementations.
*/
Status = AcpiExAddTable (TableIndex, AcpiGbl_RootNode, &DdbHandle);
Status = AcpiExAddTable (TableIndex, &DdbHandle);
if (ACPI_FAILURE (Status))
{
/* On error, TablePtr was deallocated above */
@@ -650,15 +631,6 @@ AcpiExLoadOp (
/* Remove the reference by added by AcpiExStore above */
AcpiUtRemoveReference (DdbHandle);
/* Invoke table handler if present */
if (AcpiGbl_TableHandler)
{
(void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,
AcpiGbl_TableHandlerContext);
}
return_ACPI_STATUS (Status);
}
@@ -682,7 +654,6 @@ AcpiExUnloadTable (
ACPI_STATUS Status = AE_OK;
ACPI_OPERAND_OBJECT *TableDesc = DdbHandle;
UINT32 TableIndex;
ACPI_TABLE_HEADER *Table;
ACPI_FUNCTION_TRACE (ExUnloadTable);
@@ -718,40 +689,21 @@ AcpiExUnloadTable (
TableIndex = TableDesc->Reference.Value;
/* Ensure the table is still loaded */
if (!AcpiTbIsTableLoaded (TableIndex))
{
return_ACPI_STATUS (AE_NOT_EXIST);
}
/* Invoke table handler if present */
if (AcpiGbl_TableHandler)
{
Status = AcpiGetTableByIndex (TableIndex, &Table);
if (ACPI_SUCCESS (Status))
{
(void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_UNLOAD, Table,
AcpiGbl_TableHandlerContext);
}
}
/* Delete the portion of the namespace owned by this table */
Status = AcpiTbDeleteNamespaceByOwner (TableIndex);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
(void) AcpiTbReleaseOwnerId (TableIndex);
AcpiTbSetTableLoadedFlag (TableIndex, FALSE);
/*
* Release the interpreter lock so that the table lock won't have
* strict order requirement against it.
*/
AcpiExExitInterpreter ();
Status = AcpiTbUnloadTable (TableIndex);
AcpiExEnterInterpreter ();
/*
* Invalidate the handle. We do this because the handle may be stored
* in a named object and may not be actually deleted until much later.
*/
DdbHandle->Common.Flags &= ~AOPOBJ_DATA_VALID;
return_ACPI_STATUS (AE_OK);
if (ACPI_SUCCESS (Status))
{
DdbHandle->Common.Flags &= ~AOPOBJ_DATA_VALID;
}
return_ACPI_STATUS (Status);
}
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -136,10 +172,10 @@ AcpiExConvertToAscii (
*
* FUNCTION: AcpiExConvertToInteger
*
* PARAMETERS: ObjDesc - Object to be converted. Must be an
* Integer, Buffer, or String
* ResultDesc - Where the new Integer object is returned
* Flags - Used for string conversion
* PARAMETERS: ObjDesc - Object to be converted. Must be an
* Integer, Buffer, or String
* ResultDesc - Where the new Integer object is returned
* ImplicitConversion - Used for string conversion
*
* RETURN: Status
*
@@ -151,14 +187,13 @@ ACPI_STATUS
AcpiExConvertToInteger (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **ResultDesc,
UINT32 Flags)
UINT32 ImplicitConversion)
{
ACPI_OPERAND_OBJECT *ReturnDesc;
UINT8 *Pointer;
UINT64 Result;
UINT32 i;
UINT32 Count;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE_PTR (ExConvertToInteger, ObjDesc);
@@ -208,12 +243,17 @@ AcpiExConvertToInteger (
* hexadecimal as per the ACPI specification. The only exception (as
* of ACPI 3.0) is that the ToInteger() operator allows both decimal
* and hexadecimal strings (hex prefixed with "0x").
*
* Explicit conversion is used only by ToInteger.
* All other string-to-integer conversions are implicit conversions.
*/
Status = AcpiUtStrtoul64 ((char *) Pointer, Flags,
AcpiGbl_IntegerByteWidth, &Result);
if (ACPI_FAILURE (Status))
if (ImplicitConversion)
{
return_ACPI_STATUS (Status);
Result = AcpiUtImplicitStrtoul64 (ACPI_CAST_PTR (char, Pointer));
}
else
{
Result = AcpiUtExplicitStrtoul64 (ACPI_CAST_PTR (char, Pointer));
}
break;
@@ -717,7 +757,6 @@ AcpiExConvertToTargetType (
switch (GET_CURRENT_ARG_TYPE (WalkState->OpInfo->RuntimeArgs))
{
case ARGI_SIMPLE_TARGET:
case ARGI_FIXED_TARGET:
case ARGI_INTEGER_REF: /* Handles Increment, Decrement cases */
switch (DestinationType)
@@ -756,7 +795,8 @@ AcpiExConvertToTargetType (
* These types require an Integer operand. We can convert
* a Buffer or a String to an Integer if necessary.
*/
Status = AcpiExConvertToInteger (SourceDesc, ResultDesc, 16);
Status = AcpiExConvertToInteger (SourceDesc, ResultDesc,
ACPI_IMPLICIT_CONVERSION);
break;
case ACPI_TYPE_STRING:
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -167,65 +203,40 @@ AcpiExCreateAlias (
TargetNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, TargetNode->Object);
}
/*
* For objects that can never change (i.e., the NS node will
* permanently point to the same object), we can simply attach
* the object to the new NS node. For other objects (such as
* Integers, buffers, etc.), we have to point the Alias node
* to the original Node.
*/
/* Ensure that the target node is valid */
if (!TargetNode)
{
return_ACPI_STATUS (AE_NULL_OBJECT);
}
/* Construct the alias object (a namespace node) */
switch (TargetNode->Type)
{
/* For these types, the sub-object can change dynamically via a Store */
case ACPI_TYPE_INTEGER:
case ACPI_TYPE_STRING:
case ACPI_TYPE_BUFFER:
case ACPI_TYPE_PACKAGE:
case ACPI_TYPE_BUFFER_FIELD:
/*
* These types open a new scope, so we need the NS node in order to access
* any children.
*/
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_POWER:
case ACPI_TYPE_PROCESSOR:
case ACPI_TYPE_THERMAL:
case ACPI_TYPE_LOCAL_SCOPE:
case ACPI_TYPE_METHOD:
/*
* Control method aliases need to be differentiated with
* a special type
*/
AliasNode->Type = ACPI_TYPE_LOCAL_METHOD_ALIAS;
break;
default:
/*
* All other object types.
*
* The new alias has the type ALIAS and points to the original
* NS node, not the object itself.
*/
AliasNode->Type = ACPI_TYPE_LOCAL_ALIAS;
AliasNode->Object = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, TargetNode);
break;
case ACPI_TYPE_METHOD:
/*
* Control method aliases need to be differentiated
*/
AliasNode->Type = ACPI_TYPE_LOCAL_METHOD_ALIAS;
AliasNode->Object = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, TargetNode);
break;
default:
/* Attach the original source object to the new Alias Node */
/*
* The new alias assumes the type of the target, and it points
* to the same object. The reference count of the object has an
* additional reference to prevent deletion out from under either the
* target node or the alias Node
*/
Status = AcpiNsAttachObject (AliasNode,
AcpiNsGetAttachedObject (TargetNode), TargetNode->Type);
break;
}
/* Since both operands are Nodes, we don't need to delete them */
AliasNode->Object = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, TargetNode);
return_ACPI_STATUS (Status);
}
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -201,11 +237,11 @@ AcpiExDoDebugObject (
Timer = ((UINT32) AcpiOsGetTimer () / 10);
Timer &= 0x03FFFFFF;
AcpiOsPrintf ("[ACPI Debug T=0x%8.8X] %*s", Timer, Level, " ");
AcpiOsPrintf ("ACPI Debug: T=0x%8.8X %*s", Timer, Level, " ");
}
else
{
AcpiOsPrintf ("[ACPI Debug] %*s", Level, " ");
AcpiOsPrintf ("ACPI Debug: %*s", Level, " ");
}
}
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -193,7 +229,7 @@ static ACPI_EXDUMP_INFO AcpiExDumpPackage[6] =
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpPackage), NULL},
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Package.Node), "Parent Node"},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Package.Flags), "Flags"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Package.Count), "Elements"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Package.Count), "Element Count"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Package.Elements), "Element List"},
{ACPI_EXD_PACKAGE, 0, NULL}
};
@@ -474,6 +510,11 @@ AcpiExDumpObject (
while (Count)
{
if (!ObjDesc)
{
return;
}
Target = ACPI_ADD_PTR (UINT8, ObjDesc, Info->Offset);
Name = Info->Name;
@@ -486,7 +527,8 @@ AcpiExDumpObject (
case ACPI_EXD_TYPE:
AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
ObjDesc->Common.Type, AcpiUtGetObjectTypeName (ObjDesc));
ObjDesc->Common.Type,
AcpiUtGetObjectTypeName (ObjDesc));
break;
case ACPI_EXD_UINT8:
@@ -552,10 +594,10 @@ AcpiExDumpObject (
Start = *ACPI_CAST_PTR (void *, Target);
Next = Start;
AcpiOsPrintf ("%20s : %p", Name, Next);
AcpiOsPrintf ("%20s : %p ", Name, Next);
if (Next)
{
AcpiOsPrintf ("(%s %2.2X)",
AcpiOsPrintf ("%s (Type %2.2X)",
AcpiUtGetObjectTypeName (Next), Next->Common.Type);
while (Next->Common.NextObject)
@@ -578,6 +620,10 @@ AcpiExDumpObject (
}
}
}
else
{
AcpiOsPrintf ("- No attached objects");
}
AcpiOsPrintf ("\n");
break;
@@ -701,7 +747,7 @@ AcpiExDumpOperand (
UINT32 Index;
ACPI_FUNCTION_NAME (ExDumpOperand)
ACPI_FUNCTION_NAME (ExDumpOperand);
/* Check if debug output enabled */
@@ -739,12 +785,13 @@ AcpiExDumpOperand (
if (Depth > 0)
{
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%*s[%u] %p ",
Depth, " ", Depth, ObjDesc));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%*s[%u] %p Refs=%u ",
Depth, " ", Depth, ObjDesc, ObjDesc->Common.ReferenceCount));
}
else
{
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", ObjDesc));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p Refs=%u ",
ObjDesc, ObjDesc->Common.ReferenceCount));
}
/* Decode object type */
@@ -782,8 +829,10 @@ AcpiExDumpOperand (
case ACPI_REFCLASS_NAME:
AcpiOsPrintf ("- [%4.4s]\n",
ObjDesc->Reference.Node->Name.Ascii);
AcpiUtRepairName (ObjDesc->Reference.Node->Name.Ascii);
AcpiOsPrintf ("- [%4.4s] (Node %p)\n",
ObjDesc->Reference.Node->Name.Ascii,
ObjDesc->Reference.Node);
break;
case ACPI_REFCLASS_ARG:
@@ -993,7 +1042,7 @@ AcpiExDumpOperands (
const char *OpcodeName,
UINT32 NumOperands)
{
ACPI_FUNCTION_NAME (ExDumpOperands);
ACPI_FUNCTION_TRACE (ExDumpOperands);
if (!OpcodeName)
@@ -1021,7 +1070,7 @@ AcpiExDumpOperands (
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"**** End operand dump for [%s]\n", OpcodeName));
return;
return_VOID;
}
@@ -1122,12 +1171,15 @@ AcpiExDumpReferenceObj (
&RetBuf, TRUE);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf (" Could not convert name to pathname\n");
AcpiOsPrintf (" Could not convert name to pathname: %s\n",
AcpiFormatException (Status));
}
else
{
AcpiOsPrintf ("%s\n", (char *) RetBuf.Pointer);
ACPI_FREE (RetBuf.Pointer);
AcpiOsPrintf ("%s: %s\n",
AcpiUtGetTypeName (ObjDesc->Reference.Node->Type),
(char *) RetBuf.Pointer);
ACPI_FREE (RetBuf.Pointer);
}
}
else if (ObjDesc->Reference.Object)
@@ -1245,15 +1297,15 @@ AcpiExDumpPackageObj (
case ACPI_TYPE_LOCAL_REFERENCE:
AcpiOsPrintf ("[Object Reference] Type [%s] %2.2X",
AcpiUtGetReferenceName (ObjDesc),
ObjDesc->Reference.Class);
AcpiOsPrintf ("[Object Reference] Class [%s]",
AcpiUtGetReferenceName (ObjDesc));
AcpiExDumpReferenceObj (ObjDesc);
break;
default:
AcpiOsPrintf ("[Unknown Type] %X\n", ObjDesc->Common.Type);
AcpiOsPrintf ("[%s] Type: %2.2X\n",
AcpiUtGetTypeName (ObjDesc->Common.Type), ObjDesc->Common.Type);
break;
}
}
@@ -1297,10 +1349,19 @@ AcpiExDumpObjectDescriptor (
{
AcpiExDumpNamespaceNode ((ACPI_NAMESPACE_NODE *) ObjDesc, Flags);
AcpiOsPrintf ("\nAttached Object (%p):\n",
((ACPI_NAMESPACE_NODE *) ObjDesc)->Object);
ObjDesc = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object;
if (!ObjDesc)
{
return_VOID;
}
AcpiOsPrintf ("\nAttached Object %p", ObjDesc);
if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED)
{
AcpiOsPrintf (" - Namespace Node");
}
AcpiOsPrintf (":\n");
goto DumpObject;
}
@@ -1324,6 +1385,11 @@ AcpiExDumpObjectDescriptor (
DumpObject:
if (!ObjDesc)
{
return_VOID;
}
/* Common Fields */
AcpiExDumpObject (ObjDesc, AcpiExDumpCommon);
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -1018,20 +1054,9 @@ AcpiExInsertIntoField (
AccessBitWidth = ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth);
/*
* Create the bitmasks used for bit insertion.
* Note: This if/else is used to bypass compiler differences with the
* shift operator
*/
if (AccessBitWidth == ACPI_INTEGER_BIT_SIZE)
{
WidthMask = ACPI_UINT64_MAX;
}
else
{
WidthMask = ACPI_MASK_BITS_ABOVE (AccessBitWidth);
}
/* Create the bitmasks used for bit insertion */
WidthMask = ACPI_MASK_BITS_ABOVE_64 (AccessBitWidth);
Mask = WidthMask &
ACPI_MASK_BITS_BELOW (ObjDesc->CommonField.StartFieldBitOffset);
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -347,7 +383,7 @@ AcpiExDoLogicalNumericOp (
switch (Opcode)
{
case AML_LAND_OP: /* LAnd (Integer0, Integer1) */
case AML_LOGICAL_AND_OP: /* LAnd (Integer0, Integer1) */
if (Integer0 && Integer1)
{
@@ -355,7 +391,7 @@ AcpiExDoLogicalNumericOp (
}
break;
case AML_LOR_OP: /* LOr (Integer0, Integer1) */
case AML_LOGICAL_OR_OP: /* LOr (Integer0, Integer1) */
if (Integer0 || Integer1)
{
@@ -365,6 +401,8 @@ AcpiExDoLogicalNumericOp (
default:
ACPI_ERROR ((AE_INFO,
"Invalid numeric logical opcode: %X", Opcode));
Status = AE_AML_INTERNAL;
break;
}
@@ -433,7 +471,8 @@ AcpiExDoLogicalOp (
{
case ACPI_TYPE_INTEGER:
Status = AcpiExConvertToInteger (Operand1, &LocalOperand1, 16);
Status = AcpiExConvertToInteger (Operand1, &LocalOperand1,
ACPI_IMPLICIT_CONVERSION);
break;
case ACPI_TYPE_STRING:
@@ -449,6 +488,9 @@ AcpiExDoLogicalOp (
default:
ACPI_ERROR ((AE_INFO,
"Invalid object type for logical operator: %X",
Operand0->Common.Type));
Status = AE_AML_INTERNAL;
break;
}
@@ -472,7 +514,7 @@ AcpiExDoLogicalOp (
switch (Opcode)
{
case AML_LEQUAL_OP: /* LEqual (Operand0, Operand1) */
case AML_LOGICAL_EQUAL_OP: /* LEqual (Operand0, Operand1) */
if (Integer0 == Integer1)
{
@@ -480,7 +522,7 @@ AcpiExDoLogicalOp (
}
break;
case AML_LGREATER_OP: /* LGreater (Operand0, Operand1) */
case AML_LOGICAL_GREATER_OP: /* LGreater (Operand0, Operand1) */
if (Integer0 > Integer1)
{
@@ -488,7 +530,7 @@ AcpiExDoLogicalOp (
}
break;
case AML_LLESS_OP: /* LLess (Operand0, Operand1) */
case AML_LOGICAL_LESS_OP: /* LLess (Operand0, Operand1) */
if (Integer0 < Integer1)
{
@@ -498,6 +540,8 @@ AcpiExDoLogicalOp (
default:
ACPI_ERROR ((AE_INFO,
"Invalid comparison opcode: %X", Opcode));
Status = AE_AML_INTERNAL;
break;
}
@@ -521,7 +565,7 @@ AcpiExDoLogicalOp (
switch (Opcode)
{
case AML_LEQUAL_OP: /* LEqual (Operand0, Operand1) */
case AML_LOGICAL_EQUAL_OP: /* LEqual (Operand0, Operand1) */
/* Length and all bytes must be equal */
@@ -534,7 +578,7 @@ AcpiExDoLogicalOp (
}
break;
case AML_LGREATER_OP: /* LGreater (Operand0, Operand1) */
case AML_LOGICAL_GREATER_OP: /* LGreater (Operand0, Operand1) */
if (Compare > 0)
{
@@ -554,7 +598,7 @@ AcpiExDoLogicalOp (
}
break;
case AML_LLESS_OP: /* LLess (Operand0, Operand1) */
case AML_LOGICAL_LESS_OP: /* LLess (Operand0, Operand1) */
if (Compare > 0)
{
@@ -576,6 +620,8 @@ AcpiExDoLogicalOp (
default:
ACPI_ERROR ((AE_INFO,
"Invalid comparison opcode: %X", Opcode));
Status = AE_AML_INTERNAL;
break;
}
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -213,7 +249,7 @@ AcpiExAllocateNameString (
{
/* Set up multi prefixes */
*TempPtr++ = AML_MULTI_NAME_PREFIX_OP;
*TempPtr++ = AML_MULTI_NAME_PREFIX;
*TempPtr++ = (char) NumNameSegs;
}
else if (2 == NumNameSegs)
@@ -457,7 +493,7 @@ AcpiExGetNameString (
}
break;
case AML_MULTI_NAME_PREFIX_OP:
case AML_MULTI_NAME_PREFIX:
ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "MultiNamePrefix at %p\n",
AmlAddress));
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -376,7 +412,7 @@ AcpiExOpcode_1A_1T_1R (
case AML_FIND_SET_RIGHT_BIT_OP:
case AML_FROM_BCD_OP:
case AML_TO_BCD_OP:
case AML_COND_REF_OF_OP:
case AML_CONDITIONAL_REF_OF_OP:
/* Create a return object of type Integer for these opcodes */
@@ -507,7 +543,7 @@ AcpiExOpcode_1A_1T_1R (
}
break;
case AML_COND_REF_OF_OP: /* CondRefOf (SourceObject, Result) */
case AML_CONDITIONAL_REF_OF_OP: /* CondRefOf (SourceObject, Result) */
/*
* This op is a little strange because the internal return value is
* different than the return value stored in the result descriptor
@@ -579,13 +615,13 @@ AcpiExOpcode_1A_1T_1R (
/*
* ACPI 2.0 Opcodes
*/
case AML_COPY_OP: /* Copy (Source, Target) */
case AML_COPY_OBJECT_OP: /* CopyObject (Source, Target) */
Status = AcpiUtCopyIobjectToIobject (
Operand[0], &ReturnDesc, WalkState);
break;
case AML_TO_DECSTRING_OP: /* ToDecimalString (Data, Result) */
case AML_TO_DECIMAL_STRING_OP: /* ToDecimalString (Data, Result) */
Status = AcpiExConvertToString (
Operand[0], &ReturnDesc, ACPI_EXPLICIT_CONVERT_DECIMAL);
@@ -597,7 +633,7 @@ AcpiExOpcode_1A_1T_1R (
}
break;
case AML_TO_HEXSTRING_OP: /* ToHexString (Data, Result) */
case AML_TO_HEX_STRING_OP: /* ToHexString (Data, Result) */
Status = AcpiExConvertToString (
Operand[0], &ReturnDesc, ACPI_EXPLICIT_CONVERT_HEX);
@@ -622,8 +658,9 @@ AcpiExOpcode_1A_1T_1R (
case AML_TO_INTEGER_OP: /* ToInteger (Data, Result) */
Status = AcpiExConvertToInteger (
Operand[0], &ReturnDesc, ACPI_ANY_BASE);
/* Perform "explicit" conversion */
Status = AcpiExConvertToInteger (Operand[0], &ReturnDesc, 0);
if (ReturnDesc == Operand[0])
{
/* No conversion performed, add ref to handle return value */
@@ -711,7 +748,7 @@ AcpiExOpcode_1A_0T_1R (
switch (WalkState->Opcode)
{
case AML_LNOT_OP: /* LNot (Operand) */
case AML_LOGICAL_NOT_OP: /* LNot (Operand) */
ReturnDesc = AcpiUtCreateIntegerObject ((UINT64) 0);
if (!ReturnDesc)
@@ -762,7 +799,8 @@ AcpiExOpcode_1A_0T_1R (
* NOTE: We use LNOT_OP here in order to force resolution of the
* reference operand to an actual integer.
*/
Status = AcpiExResolveOperands (AML_LNOT_OP, &TempDesc, WalkState);
Status = AcpiExResolveOperands (AML_LOGICAL_NOT_OP,
&TempDesc, WalkState);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
@@ -921,7 +959,7 @@ AcpiExOpcode_1A_0T_1R (
if (ACPI_GET_DESCRIPTOR_TYPE (Operand[0]) == ACPI_DESC_TYPE_NAMED)
{
TempDesc = AcpiNsGetAttachedObject (
(ACPI_NAMESPACE_NODE *) Operand[0]);
(ACPI_NAMESPACE_NODE *) Operand[0]);
if (TempDesc &&
((TempDesc->Common.Type == ACPI_TYPE_STRING) ||
(TempDesc->Common.Type == ACPI_TYPE_LOCAL_REFERENCE)))
@@ -1008,7 +1046,7 @@ AcpiExOpcode_1A_0T_1R (
* 2) Dereference the node to an actual object. Could be a
* Field, so we need to resolve the node to a value.
*/
Status = AcpiNsGetNode (WalkState->ScopeInfo->Scope.Node,
Status = AcpiNsGetNodeUnlocked (WalkState->ScopeInfo->Scope.Node,
Operand[0]->String.Pointer,
ACPI_NS_SEARCH_PARENT,
ACPI_CAST_INDIRECT_PTR (
@@ -1034,11 +1072,27 @@ AcpiExOpcode_1A_0T_1R (
* This is a DerefOf (ObjectReference)
* Get the actual object from the Node (This is the dereference).
* This case may only happen when a LocalX or ArgX is
* dereferenced above.
* dereferenced above, or for references to device and
* thermal objects.
*/
ReturnDesc = AcpiNsGetAttachedObject (
(ACPI_NAMESPACE_NODE *) Operand[0]);
AcpiUtAddReference (ReturnDesc);
switch (((ACPI_NAMESPACE_NODE *) Operand[0])->Type)
{
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_THERMAL:
/* These types have no node subobject, return the NS node */
ReturnDesc = Operand[0];
break;
default:
/* For most types, get the object attached to the node */
ReturnDesc = AcpiNsGetAttachedObject (
(ACPI_NAMESPACE_NODE *) Operand[0]);
AcpiUtAddReference (ReturnDesc);
break;
}
}
else
{
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -402,7 +438,7 @@ AcpiExOpcode_2A_1T_1R (
&ReturnDesc->Integer.Value);
break;
case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */
case AML_CONCATENATE_OP: /* Concatenate (Data1, Data2, Result) */
Status = AcpiExDoConcatenate (
Operand[0], Operand[1], &ReturnDesc, WalkState);
@@ -448,7 +484,7 @@ AcpiExOpcode_2A_1T_1R (
Operand[0]->Buffer.Pointer, Length);
break;
case AML_CONCAT_RES_OP:
case AML_CONCATENATE_TEMPLATE_OP:
/* ConcatenateResTemplate (Buffer, Buffer, Result) (ACPI 2.0) */
@@ -520,6 +556,8 @@ AcpiExOpcode_2A_1T_1R (
default:
ACPI_ERROR ((AE_INFO,
"Invalid object type: %X", (Operand[0])->Common.Type));
Status = AE_AML_INTERNAL;
goto Cleanup;
}
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -206,7 +242,7 @@ AcpiExDoMatch (
* Change to: (M == P[i])
*/
Status = AcpiExDoLogicalOp (
AML_LEQUAL_OP, MatchObj, PackageObj, &LogicalResult);
AML_LOGICAL_EQUAL_OP, MatchObj, PackageObj, &LogicalResult);
if (ACPI_FAILURE (Status))
{
return (FALSE);
@@ -219,7 +255,7 @@ AcpiExDoMatch (
* Change to: (M >= P[i]) (M NotLess than P[i])
*/
Status = AcpiExDoLogicalOp (
AML_LLESS_OP, MatchObj, PackageObj, &LogicalResult);
AML_LOGICAL_LESS_OP, MatchObj, PackageObj, &LogicalResult);
if (ACPI_FAILURE (Status))
{
return (FALSE);
@@ -233,7 +269,7 @@ AcpiExDoMatch (
* Change to: (M > P[i])
*/
Status = AcpiExDoLogicalOp (
AML_LGREATER_OP, MatchObj, PackageObj, &LogicalResult);
AML_LOGICAL_GREATER_OP, MatchObj, PackageObj, &LogicalResult);
if (ACPI_FAILURE (Status))
{
return (FALSE);
@@ -246,7 +282,7 @@ AcpiExDoMatch (
* Change to: (M <= P[i]) (M NotGreater than P[i])
*/
Status = AcpiExDoLogicalOp (
AML_LGREATER_OP, MatchObj, PackageObj, &LogicalResult);
AML_LOGICAL_GREATER_OP, MatchObj, PackageObj, &LogicalResult);
if (ACPI_FAILURE (Status))
{
return (FALSE);
@@ -260,7 +296,7 @@ AcpiExDoMatch (
* Change to: (M < P[i])
*/
Status = AcpiExDoLogicalOp (
AML_LLESS_OP, MatchObj, PackageObj, &LogicalResult);
AML_LOGICAL_LESS_OP, MatchObj, PackageObj, &LogicalResult);
if (ACPI_FAILURE (Status))
{
return (FALSE);
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -282,7 +318,7 @@ AcpiExResolveObjectToValue (
/* If method call or CopyObject - do not dereference */
if ((WalkState->Opcode == AML_INT_METHODCALL_OP) ||
(WalkState->Opcode == AML_COPY_OP))
(WalkState->Opcode == AML_COPY_OBJECT_OP))
{
break;
}
@@ -457,12 +493,26 @@ AcpiExResolveMultiple (
(ACPI_NAMESPACE_NODE *) ObjDesc);
}
if (!ObjDesc)
switch (Type)
{
ACPI_ERROR ((AE_INFO,
"[%4.4s] Node is unresolved or uninitialized",
AcpiUtGetNodeName (Node)));
return_ACPI_STATUS (AE_AML_UNINITIALIZED_NODE);
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_THERMAL:
/* These types have no attached subobject */
break;
default:
/* All other types require a subobject */
if (!ObjDesc)
{
ACPI_ERROR ((AE_INFO,
"[%4.4s] Node is unresolved or uninitialized",
AcpiUtGetNodeName (Node)));
return_ACPI_STATUS (AE_AML_UNINITIALIZED_NODE);
}
break;
}
break;
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -393,7 +429,6 @@ AcpiExResolveOperands (
case ARGI_OBJECT_REF:
case ARGI_DEVICE_REF:
case ARGI_TARGETREF: /* Allows implicit conversion rules before store */
case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */
case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */
case ARGI_STORE_TARGET:
@@ -500,11 +535,13 @@ AcpiExResolveOperands (
case ARGI_INTEGER:
/*
* Need an operand of type ACPI_TYPE_INTEGER,
* But we can implicitly convert from a STRING or BUFFER
* Aka - "Implicit Source Operand Conversion"
* Need an operand of type ACPI_TYPE_INTEGER, but we can
* implicitly convert from a STRING or BUFFER.
*
* Known as "Implicit Source Operand Conversion"
*/
Status = AcpiExConvertToInteger (ObjDesc, StackPtr, 16);
Status = AcpiExConvertToInteger (ObjDesc, StackPtr,
ACPI_IMPLICIT_CONVERSION);
if (ACPI_FAILURE (Status))
{
if (Status == AE_TYPE)
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -507,7 +543,7 @@ AcpiExStoreObjectToNode (
/* Only limited target types possible for everything except CopyObject */
if (WalkState->Opcode != AML_COPY_OP)
if (WalkState->Opcode != AML_COPY_OBJECT_OP)
{
/*
* Only CopyObject allows all object types to be overwritten. For
@@ -593,7 +629,7 @@ AcpiExStoreObjectToNode (
case ACPI_TYPE_STRING:
case ACPI_TYPE_BUFFER:
if ((WalkState->Opcode == AML_COPY_OP) ||
if ((WalkState->Opcode == AML_COPY_OBJECT_OP) ||
!ImplicitConversion)
{
/*
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -185,7 +221,7 @@ AcpiExResolveObject (
/* For CopyObject, no further validation necessary */
if (WalkState->Opcode == AML_COPY_OP)
if (WalkState->Opcode == AML_COPY_OBJECT_OP)
{
break;
}
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -298,7 +334,6 @@ AcpiExStartTraceMethod (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState)
{
ACPI_STATUS Status;
char *Pathname = NULL;
BOOLEAN Enabled = FALSE;
@@ -311,12 +346,6 @@ AcpiExStartTraceMethod (
Pathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
}
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
goto Exit;
}
Enabled = AcpiExInterpreterTraceEnabled (Pathname);
if (Enabled && !AcpiGbl_TraceMethodObject)
{
@@ -337,9 +366,6 @@ AcpiExStartTraceMethod (
}
}
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
Exit:
if (Enabled)
{
ACPI_TRACE_POINT (ACPI_TRACE_AML_METHOD, TRUE,
@@ -374,7 +400,6 @@ AcpiExStopTraceMethod (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState)
{
ACPI_STATUS Status;
char *Pathname = NULL;
BOOLEAN Enabled;
@@ -387,28 +412,14 @@ AcpiExStopTraceMethod (
Pathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
}
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
goto ExitPath;
}
Enabled = AcpiExInterpreterTraceEnabled (NULL);
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
if (Enabled)
{
ACPI_TRACE_POINT (ACPI_TRACE_AML_METHOD, FALSE,
ObjDesc ? ObjDesc->Method.AmlStart : NULL, Pathname);
}
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
goto ExitPath;
}
/* Check whether the tracer should be stopped */
if (AcpiGbl_TraceMethodObject == ObjDesc)
@@ -425,9 +436,6 @@ AcpiExStopTraceMethod (
AcpiGbl_TraceMethodObject = NULL;
}
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
ExitPath:
if (Pathname)
{
ACPI_FREE (Pathname);
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
/*
@@ -175,6 +211,11 @@ AcpiExEnterInterpreter (
{
ACPI_ERROR ((AE_INFO, "Could not acquire AML Interpreter mutex"));
}
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR ((AE_INFO, "Could not acquire AML Namespace mutex"));
}
return_VOID;
}
@@ -213,6 +254,11 @@ AcpiExExitInterpreter (
ACPI_FUNCTION_TRACE (ExExitInterpreter);
Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR ((AE_INFO, "Could not release AML Namespace mutex"));
}
Status = AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER);
if (ACPI_FAILURE (Status))
{
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -185,7 +221,7 @@ AcpiHwExtendedSleep (
UINT8 SleepState)
{
ACPI_STATUS Status;
UINT8 SleepTypeValue;
UINT8 SleepControl;
UINT64 SleepStatus;
@@ -211,10 +247,6 @@ AcpiHwExtendedSleep (
AcpiGbl_SystemAwakeAndRunning = FALSE;
/* Flush caches, as per ACPI specification */
ACPI_FLUSH_CPU_CACHE ();
/*
* Set the SLP_TYP and SLP_EN bits.
*
@@ -224,11 +256,24 @@ AcpiHwExtendedSleep (
ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
"Entering sleep state [S%u]\n", SleepState));
SleepTypeValue = ((AcpiGbl_SleepTypeA << ACPI_X_SLEEP_TYPE_POSITION) &
ACPI_X_SLEEP_TYPE_MASK);
SleepControl = ((AcpiGbl_SleepTypeA << ACPI_X_SLEEP_TYPE_POSITION) &
ACPI_X_SLEEP_TYPE_MASK) | ACPI_X_SLEEP_ENABLE;
Status = AcpiWrite ((UINT64) (SleepTypeValue | ACPI_X_SLEEP_ENABLE),
&AcpiGbl_FADT.SleepControl);
/* Flush caches, as per ACPI specification */
ACPI_FLUSH_CPU_CACHE ();
Status = AcpiOsEnterSleep (SleepState, SleepControl, 0);
if (Status == AE_CTRL_TERMINATE)
{
return_ACPI_STATUS (AE_OK);
}
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
Status = AcpiWrite ((UINT64) SleepControl, &AcpiGbl_FADT.SleepControl);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -180,8 +216,8 @@ AcpiHwLowSetGpe (
UINT32 Action)
{
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
ACPI_STATUS Status;
UINT32 EnableMask;
ACPI_STATUS Status = AE_OK;
UINT64 EnableMask;
UINT32 RegisterBit;
@@ -236,9 +272,12 @@ AcpiHwLowSetGpe (
return (AE_BAD_PARAMETER);
}
/* Write the updated enable mask */
if (!(RegisterBit & GpeRegisterInfo->MaskForRun))
{
/* Write the updated enable mask */
Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
}
return (Status);
}
@@ -303,7 +342,7 @@ AcpiHwGetGpeStatus (
ACPI_GPE_EVENT_INFO *GpeEventInfo,
ACPI_EVENT_STATUS *EventStatus)
{
UINT32 InByte;
UINT64 InByte;
UINT32 RegisterBit;
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
ACPI_EVENT_STATUS LocalEventStatus = 0;
@@ -341,6 +380,13 @@ AcpiHwGetGpeStatus (
LocalEventStatus |= ACPI_EVENT_FLAG_ENABLED;
}
/* GPE currently masked? (masked for runtime?) */
if (RegisterBit & GpeRegisterInfo->MaskForRun)
{
LocalEventStatus |= ACPI_EVENT_FLAG_MASKED;
}
/* GPE enabled for wake? */
if (RegisterBit & GpeRegisterInfo->EnableForWake)
@@ -512,6 +558,7 @@ AcpiHwEnableRuntimeGpeBlock (
UINT32 i;
ACPI_STATUS Status;
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
UINT8 EnableMask;
/* NOTE: assumes that all GPEs are currently disabled */
@@ -528,8 +575,9 @@ AcpiHwEnableRuntimeGpeBlock (
/* Enable all "runtime" GPEs in this register */
Status = AcpiHwGpeEnableWrite (GpeRegisterInfo->EnableForRun,
GpeRegisterInfo);
EnableMask = GpeRegisterInfo->EnableForRun &
~GpeRegisterInfo->MaskForRun;
Status = AcpiHwGpeEnableWrite (EnableMask, GpeRegisterInfo);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -126,6 +162,12 @@
/* Local Prototypes */
static UINT8
AcpiHwGetAccessBitWidth (
UINT64 Address,
ACPI_GENERIC_ADDRESS *Reg,
UINT8 MaxBitWidth);
static ACPI_STATUS
AcpiHwReadMultiple (
UINT32 *Value,
@@ -141,6 +183,90 @@ AcpiHwWriteMultiple (
#endif /* !ACPI_REDUCED_HARDWARE */
/******************************************************************************
*
* FUNCTION: AcpiHwGetAccessBitWidth
*
* PARAMETERS: Address - GAS register address
* Reg - GAS register structure
* MaxBitWidth - Max BitWidth supported (32 or 64)
*
* RETURN: Status
*
* DESCRIPTION: Obtain optimal access bit width
*
******************************************************************************/
static UINT8
AcpiHwGetAccessBitWidth (
UINT64 Address,
ACPI_GENERIC_ADDRESS *Reg,
UINT8 MaxBitWidth)
{
UINT8 AccessBitWidth;
/*
* GAS format "register", used by FADT:
* 1. Detected if BitOffset is 0 and BitWidth is 8/16/32/64;
* 2. AccessSize field is ignored and BitWidth field is used for
* determining the boundary of the IO accesses.
* GAS format "region", used by APEI registers:
* 1. Detected if BitOffset is not 0 or BitWidth is not 8/16/32/64;
* 2. AccessSize field is used for determining the boundary of the
* IO accesses;
* 3. BitOffset/BitWidth fields are used to describe the "region".
*
* Note: This algorithm assumes that the "Address" fields should always
* contain aligned values.
*/
if (!Reg->BitOffset && Reg->BitWidth &&
ACPI_IS_POWER_OF_TWO (Reg->BitWidth) &&
ACPI_IS_ALIGNED (Reg->BitWidth, 8))
{
AccessBitWidth = Reg->BitWidth;
}
else if (Reg->AccessWidth)
{
AccessBitWidth = ACPI_ACCESS_BIT_WIDTH (Reg->AccessWidth);
}
else
{
AccessBitWidth = ACPI_ROUND_UP_POWER_OF_TWO_8 (
Reg->BitOffset + Reg->BitWidth);
if (AccessBitWidth <= 8)
{
AccessBitWidth = 8;
}
else
{
while (!ACPI_IS_ALIGNED (Address, AccessBitWidth >> 3))
{
AccessBitWidth >>= 1;
}
}
}
/* Maximum IO port access bit width is 32 */
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_IO)
{
MaxBitWidth = 32;
}
/*
* Return access width according to the requested maximum access bit width,
* as the caller should know the format of the register and may enforce
* a 32-bit accesses.
*/
if (AccessBitWidth < MaxBitWidth)
{
return (AccessBitWidth);
}
return (MaxBitWidth);
}
/******************************************************************************
*
* FUNCTION: AcpiHwValidateRegister
@@ -163,6 +289,9 @@ AcpiHwValidateRegister (
UINT8 MaxBitWidth,
UINT64 *Address)
{
UINT8 BitWidth;
UINT8 AccessWidth;
/* Must have a valid pointer to a GAS structure */
@@ -192,24 +321,25 @@ AcpiHwValidateRegister (
return (AE_SUPPORT);
}
/* Validate the BitWidth */
/* Validate the AccessWidth */
if ((Reg->BitWidth != 8) &&
(Reg->BitWidth != 16) &&
(Reg->BitWidth != 32) &&
(Reg->BitWidth != MaxBitWidth))
if (Reg->AccessWidth > 4)
{
ACPI_ERROR ((AE_INFO,
"Unsupported register bit width: 0x%X", Reg->BitWidth));
"Unsupported register access width: 0x%X", Reg->AccessWidth));
return (AE_SUPPORT);
}
/* Validate the BitOffset. Just a warning for now. */
/* Validate the BitWidth, convert AccessWidth into number of bits */
if (Reg->BitOffset != 0)
AccessWidth = AcpiHwGetAccessBitWidth (*Address, Reg, MaxBitWidth);
BitWidth = ACPI_ROUND_UP (Reg->BitOffset + Reg->BitWidth, AccessWidth);
if (MaxBitWidth < BitWidth)
{
ACPI_WARNING ((AE_INFO,
"Unsupported register bit offset: 0x%X", Reg->BitOffset));
"Requested bit width 0x%X is smaller than register bit width 0x%X",
MaxBitWidth, BitWidth));
return (AE_SUPPORT);
}
return (AE_OK);
@@ -225,25 +355,26 @@ AcpiHwValidateRegister (
*
* RETURN: Status
*
* DESCRIPTION: Read from either memory or IO space. This is a 32-bit max
* version of AcpiRead, used internally since the overhead of
* 64-bit values is not needed.
* DESCRIPTION: Read from either memory or IO space. This is a 64-bit max
* version of AcpiRead.
*
* LIMITATIONS: <These limitations also apply to AcpiHwWrite>
* BitWidth must be exactly 8, 16, or 32.
* SpaceID must be SystemMemory or SystemIO.
* BitOffset and AccessWidth are currently ignored, as there has
* not been a need to implement these.
*
******************************************************************************/
ACPI_STATUS
AcpiHwRead (
UINT32 *Value,
UINT64 *Value,
ACPI_GENERIC_ADDRESS *Reg)
{
UINT64 Address;
UINT8 AccessWidth;
UINT32 BitWidth;
UINT8 BitOffset;
UINT64 Value64;
UINT32 Value32;
UINT8 Index;
ACPI_STATUS Status;
@@ -252,37 +383,65 @@ AcpiHwRead (
/* Validate contents of the GAS register */
Status = AcpiHwValidateRegister (Reg, 32, &Address);
Status = AcpiHwValidateRegister (Reg, 64, &Address);
if (ACPI_FAILURE (Status))
{
return (Status);
}
/* Initialize entire 32-bit return value to zero */
/*
* Initialize entire 64-bit return value to zero, convert AccessWidth
* into number of bits based
*/
*Value = 0;
AccessWidth = AcpiHwGetAccessBitWidth (Address, Reg, 64);
BitWidth = Reg->BitOffset + Reg->BitWidth;
BitOffset = Reg->BitOffset;
/*
* Two address spaces supported: Memory or IO. PCI_Config is
* not supported here because the GAS structure is insufficient
*/
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
Index = 0;
while (BitWidth)
{
Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
Address, &Value64, Reg->BitWidth);
if (BitOffset >= AccessWidth)
{
Value64 = 0;
BitOffset -= AccessWidth;
}
else
{
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
Address + Index * ACPI_DIV_8 (AccessWidth),
&Value64, AccessWidth);
}
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
{
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
Address + Index * ACPI_DIV_8 (AccessWidth),
&Value32, AccessWidth);
Value64 = (UINT64) Value32;
}
}
*Value = (UINT32) Value64;
}
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
{
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
Address, Value, Reg->BitWidth);
/*
* Use offset style bit writes because "Index * AccessWidth" is
* ensured to be less than 64-bits by AcpiHwValidateRegister().
*/
ACPI_SET_BITS (Value, Index * AccessWidth,
ACPI_MASK_BITS_ABOVE_64 (AccessWidth), Value64);
BitWidth -= BitWidth > AccessWidth ? AccessWidth : BitWidth;
Index++;
}
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
"Read: %8.8X width %2d from %8.8X%8.8X (%s)\n",
*Value, Reg->BitWidth, ACPI_FORMAT_UINT64 (Address),
AcpiUtGetRegionName (Reg->SpaceId)));
"Read: %8.8X%8.8X width %2d from %8.8X%8.8X (%s)\n",
ACPI_FORMAT_UINT64 (*Value), AccessWidth,
ACPI_FORMAT_UINT64 (Address), AcpiUtGetRegionName (Reg->SpaceId)));
return (Status);
}
@@ -297,18 +456,22 @@ AcpiHwRead (
*
* RETURN: Status
*
* DESCRIPTION: Write to either memory or IO space. This is a 32-bit max
* version of AcpiWrite, used internally since the overhead of
* 64-bit values is not needed.
* DESCRIPTION: Write to either memory or IO space. This is a 64-bit max
* version of AcpiWrite.
*
******************************************************************************/
ACPI_STATUS
AcpiHwWrite (
UINT32 Value,
UINT64 Value,
ACPI_GENERIC_ADDRESS *Reg)
{
UINT64 Address;
UINT8 AccessWidth;
UINT32 BitWidth;
UINT8 BitOffset;
UINT64 Value64;
UINT8 Index;
ACPI_STATUS Status;
@@ -317,31 +480,64 @@ AcpiHwWrite (
/* Validate contents of the GAS register */
Status = AcpiHwValidateRegister (Reg, 32, &Address);
Status = AcpiHwValidateRegister (Reg, 64, &Address);
if (ACPI_FAILURE (Status))
{
return (Status);
}
/* Convert AccessWidth into number of bits based */
AccessWidth = AcpiHwGetAccessBitWidth (Address, Reg, 64);
BitWidth = Reg->BitOffset + Reg->BitWidth;
BitOffset = Reg->BitOffset;
/*
* Two address spaces supported: Memory or IO. PCI_Config is
* not supported here because the GAS structure is insufficient
*/
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
Index = 0;
while (BitWidth)
{
Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
Address, (UINT64) Value, Reg->BitWidth);
}
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
{
Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
Address, Value, Reg->BitWidth);
/*
* Use offset style bit reads because "Index * AccessWidth" is
* ensured to be less than 64-bits by AcpiHwValidateRegister().
*/
Value64 = ACPI_GET_BITS (&Value, Index * AccessWidth,
ACPI_MASK_BITS_ABOVE_64 (AccessWidth));
if (BitOffset >= AccessWidth)
{
BitOffset -= AccessWidth;
}
else
{
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
Address + Index * ACPI_DIV_8 (AccessWidth),
Value64, AccessWidth);
}
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
{
Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
Address + Index * ACPI_DIV_8 (AccessWidth),
(UINT32) Value64, AccessWidth);
}
}
/*
* Index * AccessWidth is ensured to be less than 32-bits by
* AcpiHwValidateRegister().
*/
BitWidth -= BitWidth > AccessWidth ? AccessWidth : BitWidth;
Index++;
}
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
"Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n",
Value, Reg->BitWidth, ACPI_FORMAT_UINT64 (Address),
AcpiUtGetRegionName (Reg->SpaceId)));
"Wrote: %8.8X%8.8X width %2d to %8.8X%8.8X (%s)\n",
ACPI_FORMAT_UINT64 (Value), AccessWidth,
ACPI_FORMAT_UINT64 (Address), AcpiUtGetRegionName (Reg->SpaceId)));
return (Status);
}
@@ -488,6 +684,7 @@ AcpiHwRegisterRead (
UINT32 *ReturnValue)
{
UINT32 Value = 0;
UINT64 Value64;
ACPI_STATUS Status;
@@ -526,12 +723,14 @@ AcpiHwRegisterRead (
case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
Status = AcpiHwRead (&Value, &AcpiGbl_FADT.XPm2ControlBlock);
Status = AcpiHwRead (&Value64, &AcpiGbl_FADT.XPm2ControlBlock);
Value = (UINT32) Value64;
break;
case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
Status = AcpiHwRead (&Value, &AcpiGbl_FADT.XPmTimerBlock);
Status = AcpiHwRead (&Value64, &AcpiGbl_FADT.XPmTimerBlock);
Value = (UINT32) Value64;
break;
case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
@@ -549,7 +748,7 @@ AcpiHwRegisterRead (
if (ACPI_SUCCESS (Status))
{
*ReturnValue = Value;
*ReturnValue = (UINT32) Value;
}
return_ACPI_STATUS (Status);
@@ -589,6 +788,7 @@ AcpiHwRegisterWrite (
{
ACPI_STATUS Status;
UINT32 ReadValue;
UINT64 ReadValue64;
ACPI_FUNCTION_TRACE (HwRegisterWrite);
@@ -650,11 +850,12 @@ AcpiHwRegisterWrite (
* For control registers, all reserved bits must be preserved,
* as per the ACPI spec.
*/
Status = AcpiHwRead (&ReadValue, &AcpiGbl_FADT.XPm2ControlBlock);
Status = AcpiHwRead (&ReadValue64, &AcpiGbl_FADT.XPm2ControlBlock);
if (ACPI_FAILURE (Status))
{
goto Exit;
}
ReadValue = (UINT32) ReadValue64;
/* Insert the bits to be preserved */
@@ -710,26 +911,29 @@ AcpiHwReadMultiple (
{
UINT32 ValueA = 0;
UINT32 ValueB = 0;
UINT64 Value64;
ACPI_STATUS Status;
/* The first register is always required */
Status = AcpiHwRead (&ValueA, RegisterA);
Status = AcpiHwRead (&Value64, RegisterA);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ValueA = (UINT32) Value64;
/* Second register is optional */
if (RegisterB->Address)
{
Status = AcpiHwRead (&ValueB, RegisterB);
Status = AcpiHwRead (&Value64, RegisterB);
if (ACPI_FAILURE (Status))
{
return (Status);
}
ValueB = (UINT32) Value64;
}
/*
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -231,6 +267,16 @@ AcpiHwLegacySleep (
ACPI_FLUSH_CPU_CACHE ();
Status = AcpiOsEnterSleep (SleepState, Pm1aControl, Pm1bControl);
if (Status == AE_CTRL_TERMINATE)
{
return_ACPI_STATUS (AE_OK);
}
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* Write #2: Write both SLP_TYP + SLP_EN */
Status = AcpiHwWritePm1Control (Pm1aControl, Pm1bControl);
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#define EXPORT_ACPI_INTERFACES
@@ -179,6 +215,7 @@ AcpiGetTimer (
UINT32 *Ticks)
{
ACPI_STATUS Status;
UINT64 TimerValue;
ACPI_FUNCTION_TRACE (AcpiGetTimer);
@@ -196,7 +233,14 @@ AcpiGetTimer (
return_ACPI_STATUS (AE_SUPPORT);
}
Status = AcpiHwRead (Ticks, &AcpiGbl_FADT.XPmTimerBlock);
Status = AcpiHwRead (&TimerValue, &AcpiGbl_FADT.XPmTimerBlock);
if (ACPI_SUCCESS (Status))
{
/* ACPI PM Timer is defined to be 32 bits (PM_TMR_LEN) */
*Ticks = (UINT32) TimerValue;
}
return_ACPI_STATUS (Status);
}
@@ -239,7 +283,7 @@ AcpiGetTimerDuration (
UINT32 *TimeElapsed)
{
ACPI_STATUS Status;
UINT32 DeltaTicks;
UINT64 DeltaTicks;
UINT64 Quotient;
@@ -258,34 +302,33 @@ AcpiGetTimerDuration (
return_ACPI_STATUS (AE_SUPPORT);
}
if (StartTicks == EndTicks)
{
*TimeElapsed = 0;
return_ACPI_STATUS (AE_OK);
}
/*
* Compute Tick Delta:
* Handle (max one) timer rollovers on 24-bit versus 32-bit timers.
*/
if (StartTicks < EndTicks)
{
DeltaTicks = EndTicks - StartTicks;
}
else if (StartTicks > EndTicks)
DeltaTicks = EndTicks;
if (StartTicks > EndTicks)
{
if ((AcpiGbl_FADT.Flags & ACPI_FADT_32BIT_TIMER) == 0)
{
/* 24-bit Timer */
DeltaTicks = (((0x00FFFFFF - StartTicks) + EndTicks) & 0x00FFFFFF);
DeltaTicks |= (UINT64) 1 << 24;
}
else
{
/* 32-bit Timer */
DeltaTicks = (0xFFFFFFFF - StartTicks) + EndTicks;
DeltaTicks |= (UINT64) 1 << 32;
}
}
else /* StartTicks == EndTicks */
{
*TimeElapsed = 0;
return_ACPI_STATUS (AE_OK);
}
DeltaTicks -= StartTicks;
/*
* Compute Duration (Requires a 64-bit multiply and divide):
@@ -293,7 +336,7 @@ AcpiGetTimerDuration (
* TimeElapsed (microseconds) =
* (DeltaTicks * ACPI_USEC_PER_SEC) / ACPI_PM_TIMER_FREQUENCY;
*/
Status = AcpiUtShortDivide (((UINT64) DeltaTicks) * ACPI_USEC_PER_SEC,
Status = AcpiUtShortDivide (DeltaTicks * ACPI_USEC_PER_SEC,
ACPI_PM_TIMER_FREQUENCY, &Quotient, NULL);
*TimeElapsed = (UINT32) Quotient;
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -179,7 +215,7 @@ static const ACPI_PORT_INFO AcpiProtectedPorts[] =
{"PCI", 0x0CF8, 0x0CFF, ACPI_OSI_WIN_XP}
};
#define ACPI_PORT_INFO_ENTRIES ACPI_ARRAY_LENGTH (AcpiProtectedPorts)
#define ACPI_PORT_INFO_ENTRIES ACPI_ARRAY_LENGTH (AcpiProtectedPorts)
/******************************************************************************
@@ -220,14 +256,15 @@ AcpiHwValidateIoRequest (
{
ACPI_ERROR ((AE_INFO,
"Bad BitWidth parameter: %8.8X", BitWidth));
return (AE_BAD_PARAMETER);
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
PortInfo = AcpiProtectedPorts;
ByteWidth = ACPI_DIV_8 (BitWidth);
LastAddress = Address + ByteWidth - 1;
ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Address %8.8X%8.8X LastAddress %8.8X%8.8X Length %X",
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
"Address %8.8X%8.8X LastAddress %8.8X%8.8X Length %X",
ACPI_FORMAT_UINT64 (Address), ACPI_FORMAT_UINT64 (LastAddress),
ByteWidth));
@@ -254,7 +291,7 @@ AcpiHwValidateIoRequest (
{
/*
* Check if the requested address range will write to a reserved
* port. Four cases to consider:
* port. There are four cases to consider:
*
* 1) Address range is contained completely in the port address range
* 2) Address range overlaps port range at the port range start
@@ -267,8 +304,8 @@ AcpiHwValidateIoRequest (
if (AcpiGbl_OsiData >= PortInfo->OsiDependency)
{
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
"Denied AML access to port 0x%8.8X%8.8X/%X (%s 0x%.4X-0x%.4X)",
ACPI_DEBUG_PRINT ((ACPI_DB_VALUES,
"Denied AML access to port 0x%8.8X%8.8X/%X (%s 0x%.4X-0x%.4X)\n",
ACPI_FORMAT_UINT64 (Address), ByteWidth, PortInfo->Name,
PortInfo->Start, PortInfo->End));
@@ -293,7 +330,7 @@ AcpiHwValidateIoRequest (
* FUNCTION: AcpiHwReadPort
*
* PARAMETERS: Address Address of I/O port/register to read
* Value Where value is placed
* Value Where value (data) is returned
* Width Number of bits
*
* RETURN: Status and value read from port
@@ -339,7 +376,7 @@ AcpiHwReadPort (
/*
* There has been a protection violation within the request. Fall
* back to byte granularity port I/O and ignore the failing bytes.
* This provides Windows compatibility.
* This provides compatibility with other ACPI implementations.
*/
for (i = 0, *Value = 0; i < Width; i += 8)
{
@@ -413,7 +450,7 @@ AcpiHwWritePort (
/*
* There has been a protection violation within the request. Fall
* back to byte granularity port I/O and ignore the failing bytes.
* This provides Windows compatibility.
* This provides compatibility with other ACPI implementations.
*/
for (i = 0; i < Width; i += 8)
{
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#define EXPORT_ACPI_INTERFACES
@@ -211,84 +247,14 @@ AcpiRead (
UINT64 *ReturnValue,
ACPI_GENERIC_ADDRESS *Reg)
{
UINT32 ValueLo;
UINT32 ValueHi;
UINT32 Width;
UINT64 Address;
ACPI_STATUS Status;
ACPI_FUNCTION_NAME (AcpiRead);
if (!ReturnValue)
{
return (AE_BAD_PARAMETER);
}
/* Validate contents of the GAS register. Allow 64-bit transfers */
Status = AcpiHwValidateRegister (Reg, 64, &Address);
if (ACPI_FAILURE (Status))
{
return (Status);
}
/*
* Two address spaces supported: Memory or I/O. PCI_Config is
* not supported here because the GAS structure is insufficient
*/
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
Address, ReturnValue, Reg->BitWidth);
if (ACPI_FAILURE (Status))
{
return (Status);
}
}
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
{
ValueLo = 0;
ValueHi = 0;
Width = Reg->BitWidth;
if (Width == 64)
{
Width = 32; /* Break into two 32-bit transfers */
}
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
Address, &ValueLo, Width);
if (ACPI_FAILURE (Status))
{
return (Status);
}
if (Reg->BitWidth == 64)
{
/* Read the top 32 bits */
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
(Address + 4), &ValueHi, 32);
if (ACPI_FAILURE (Status))
{
return (Status);
}
}
/* Set the return value only if status is AE_OK */
*ReturnValue = (ValueLo | ((UINT64) ValueHi << 32));
}
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
"Read: %8.8X%8.8X width %2d from %8.8X%8.8X (%s)\n",
ACPI_FORMAT_UINT64 (*ReturnValue), Reg->BitWidth,
ACPI_FORMAT_UINT64 (Address),
AcpiUtGetRegionName (Reg->SpaceId)));
return (AE_OK);
Status = AcpiHwRead (ReturnValue, Reg);
return (Status);
}
ACPI_EXPORT_SYMBOL (AcpiRead)
@@ -312,67 +278,13 @@ AcpiWrite (
UINT64 Value,
ACPI_GENERIC_ADDRESS *Reg)
{
UINT32 Width;
UINT64 Address;
ACPI_STATUS Status;
ACPI_FUNCTION_NAME (AcpiWrite);
/* Validate contents of the GAS register. Allow 64-bit transfers */
Status = AcpiHwValidateRegister (Reg, 64, &Address);
if (ACPI_FAILURE (Status))
{
return (Status);
}
/*
* Two address spaces supported: Memory or IO. PCI_Config is
* not supported here because the GAS structure is insufficient
*/
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
Address, Value, Reg->BitWidth);
if (ACPI_FAILURE (Status))
{
return (Status);
}
}
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
{
Width = Reg->BitWidth;
if (Width == 64)
{
Width = 32; /* Break into two 32-bit transfers */
}
Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
Address, ACPI_LODWORD (Value), Width);
if (ACPI_FAILURE (Status))
{
return (Status);
}
if (Reg->BitWidth == 64)
{
Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
(Address + 4), ACPI_HIDWORD (Value), 32);
if (ACPI_FAILURE (Status))
{
return (Status);
}
}
}
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
"Wrote: %8.8X%8.8X width %2d to %8.8X%8.8X (%s)\n",
ACPI_FORMAT_UINT64 (Value), Reg->BitWidth,
ACPI_FORMAT_UINT64 (Address),
AcpiUtGetRegionName (Reg->SpaceId)));
Status = AcpiHwWrite (Value, Reg);
return (Status);
}
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#define EXPORT_ACPI_INTERFACES
@@ -148,9 +184,18 @@ AcpiHwSleepDispatch (
static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[] =
{
{ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacySleep), AcpiHwExtendedSleep},
{ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep), AcpiHwExtendedWakePrep},
{ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake), AcpiHwExtendedWake}
{ACPI_STRUCT_INIT (legacy_function,
ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacySleep)),
ACPI_STRUCT_INIT (extended_function,
AcpiHwExtendedSleep) },
{ACPI_STRUCT_INIT (legacy_function,
ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep)),
ACPI_STRUCT_INIT (extended_function,
AcpiHwExtendedWakePrep) },
{ACPI_STRUCT_INIT (legacy_function,
ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake)),
ACPI_STRUCT_INIT (extended_function,
AcpiHwExtendedWake) }
};
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -119,6 +155,9 @@
#include "acnamesp.h"
#include "acdispat.h"
#ifdef ACPI_ASL_COMPILER
#include "acdisasm.h"
#endif
#define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME ("nsaccess")
@@ -371,6 +410,7 @@ AcpiNsLookup (
{
ACPI_STATUS Status;
char *Path = Pathname;
char *ExternalPath;
ACPI_NAMESPACE_NODE *PrefixNode;
ACPI_NAMESPACE_NODE *CurrentNode = NULL;
ACPI_NAMESPACE_NODE *ThisNode = NULL;
@@ -517,11 +557,21 @@ AcpiNsLookup (
ThisNode = ThisNode->Parent;
if (!ThisNode)
{
/* Current scope has no parent scope */
/*
* Current scope has no parent scope. Externalize
* the internal path for error message.
*/
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Pathname,
NULL, &ExternalPath);
if (ACPI_SUCCESS (Status))
{
ACPI_ERROR ((AE_INFO,
"%s: Path has too many parent prefixes (^)",
ExternalPath));
ACPI_FREE (ExternalPath);
}
ACPI_ERROR ((AE_INFO,
"%s: Path has too many parent prefixes (^) "
"- reached beyond root node", Pathname));
return_ACPI_STATUS (AE_NOT_FOUND);
}
}
@@ -577,7 +627,7 @@ AcpiNsLookup (
"Dual Pathname (2 segments, Flags=%X)\n", Flags));
break;
case AML_MULTI_NAME_PREFIX_OP:
case AML_MULTI_NAME_PREFIX:
/* More than one NameSeg, search rules do not apply */
@@ -674,6 +724,30 @@ AcpiNsLookup (
CurrentNode));
}
#ifdef ACPI_ASL_COMPILER
/*
* If this ACPI name already exists within the namespace as an
* external declaration, then mark the external as a conflicting
* declaration and proceed to process the current node as if it did
* not exist in the namespace. If this node is not processed as
* normal, then it could cause improper namespace resolution
* by failing to open a new scope.
*/
if (AcpiGbl_DisasmFlag &&
(Status == AE_ALREADY_EXISTS) &&
((ThisNode->Flags & ANOBJ_IS_EXTERNAL) ||
(WalkState && WalkState->Opcode == AML_EXTERNAL_OP)))
{
ThisNode->Flags &= ~ANOBJ_IS_EXTERNAL;
ThisNode->Type = (UINT8)ThisSearchType;
if (WalkState->Opcode != AML_EXTERNAL_OP)
{
AcpiDmMarkExternalConflict (ThisNode);
}
break;
}
#endif
*ReturnNode = ThisNode;
return_ACPI_STATUS (Status);
}
@@ -707,6 +781,13 @@ AcpiNsLookup (
else
{
#ifdef ACPI_ASL_COMPILER
if (!AcpiGbl_DisasmFlag && (ThisNode->Flags & ANOBJ_IS_EXTERNAL))
{
ThisNode->Flags &= ~IMPLICIT_EXTERNAL;
}
#endif
/*
* Sanity typecheck of the target object:
*
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -147,9 +183,14 @@ AcpiNsCheckArgumentTypes (
UINT32 i;
/* If not a predefined name, cannot typecheck args */
if (!Info->Predefined)
/*
* If not a predefined name, cannot typecheck args, because
* we have no idea what argument types are expected.
* Also, ignore typecheck if warnings/errors if this method
* has already been evaluated at least once -- in order
* to suppress repetitive messages.
*/
if (!Info->Predefined || (Info->Node->Flags & ANOBJ_EVALUATED))
{
return;
}
@@ -171,6 +212,10 @@ AcpiNsCheckArgumentTypes (
"Found [%s], ACPI requires [%s]", (i + 1),
AcpiUtGetTypeName (UserArgType),
AcpiUtGetTypeName (ArgType)));
/* Prevent any additional typechecking for this method */
Info->Node->Flags |= ANOBJ_EVALUATED;
}
}
}
@@ -202,7 +247,7 @@ AcpiNsCheckAcpiCompliance (
UINT32 RequiredParamCount;
if (!Predefined)
if (!Predefined || (Node->Flags & ANOBJ_EVALUATED))
{
return;
}
@@ -296,6 +341,11 @@ AcpiNsCheckArgumentCount (
UINT32 RequiredParamCount;
if (Node->Flags & ANOBJ_EVALUATED)
{
return;
}
if (!Predefined)
{
/*
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -155,8 +191,7 @@ AcpiNsConvertToInteger (
/* String-to-Integer conversion */
Status = AcpiUtStrtoul64 (OriginalObject->String.Pointer,
ACPI_ANY_BASE, AcpiGbl_IntegerByteWidth, &Value);
Status = AcpiUtStrtoul64 (OriginalObject->String.Pointer, &Value);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -609,7 +644,8 @@ AcpiNsConvertToReference (
{
/* Check if we are resolving a named reference within a package */
ACPI_ERROR_NAMESPACE (OriginalObject->String.Pointer, Status);
ACPI_ERROR_NAMESPACE (&ScopeInfo,
OriginalObject->String.Pointer, Status);
goto ErrorExit;
}
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -499,6 +535,20 @@ AcpiNsInitOneObject (
Info->PackageInit++;
Status = AcpiDsGetPackageArguments (ObjDesc);
if (ACPI_FAILURE (Status))
{
break;
}
/*
* Resolve all named references in package objects (and all
* sub-packages). This action has been deferred until the entire
* namespace has been loaded, in order to support external and
* forward references from individual package elements (05/2017).
*/
Status = AcpiUtWalkPackageTree (ObjDesc, NULL,
AcpiDsInitPackageElement, NULL);
ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
break;
default:
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -118,6 +154,7 @@
#include "acnamesp.h"
#include "acdispat.h"
#include "actables.h"
#include "acinterp.h"
#define _COMPONENT ACPI_NAMESPACE
@@ -161,21 +198,6 @@ AcpiNsLoadTable (
ACPI_FUNCTION_TRACE (NsLoadTable);
/*
* Parse the table and load the namespace with all named
* objects found within. Control methods are NOT parsed
* at this time. In fact, the control methods cannot be
* parsed until the entire namespace is loaded, because
* if a control method makes a forward reference (call)
* to another control method, we can't continue parsing
* because we don't know how many arguments to parse next!
*/
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* If table already loaded into namespace, just return */
if (AcpiTbIsTableLoaded (TableIndex))
@@ -193,6 +215,15 @@ AcpiNsLoadTable (
goto Unlock;
}
/*
* Parse the table and load the namespace with all named
* objects found within. Control methods are NOT parsed
* at this time. In fact, the control methods cannot be
* parsed until the entire namespace is loaded, because
* if a control method makes a forward reference (call)
* to another control method, we can't continue parsing
* because we don't know how many arguments to parse next!
*/
Status = AcpiNsParseTable (TableIndex, Node);
if (ACPI_SUCCESS (Status))
{
@@ -209,7 +240,6 @@ AcpiNsLoadTable (
* exist. This target of Scope must already exist in the
* namespace, as per the ACPI specification.
*/
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
AcpiNsDeleteNamespaceByOwner (
AcpiGbl_RootTableList.Tables[TableIndex].OwnerId);
@@ -218,8 +248,6 @@ AcpiNsLoadTable (
}
Unlock:
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -234,7 +262,9 @@ Unlock:
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"**** Begin Table Object Initialization\n"));
AcpiExEnterInterpreter ();
Status = AcpiDsInitializeObjects (TableIndex, Node);
AcpiExExitInterpreter ();
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"**** Completed Table Object Initialization\n"));
@@ -252,7 +282,7 @@ Unlock:
* other ACPI implementations. Optionally, the execution can be deferred
* until later, see AcpiInitializeObjects.
*/
if (!AcpiGbl_GroupModuleLevelCode)
if (!AcpiGbl_ParseTableAsTermList && !AcpiGbl_GroupModuleLevelCode)
{
AcpiNsExecModuleCodeList ();
}
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -122,6 +158,12 @@
#define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME ("nsnames")
/* Local Prototypes */
static void
AcpiNsNormalizePathname (
char *OriginalPath);
/*******************************************************************************
*
@@ -172,14 +214,73 @@ AcpiNsGetPathnameLength (
ACPI_SIZE Size;
ACPI_FUNCTION_ENTRY ();
/* Validate the Node */
if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
{
ACPI_ERROR ((AE_INFO,
"Invalid/cached reference target node: %p, descriptor type %d",
Node, ACPI_GET_DESCRIPTOR_TYPE (Node)));
return (0);
}
Size = AcpiNsBuildNormalizedPath (Node, NULL, 0, FALSE);
return (Size);
}
/*******************************************************************************
*
* FUNCTION: AcpiNsHandleToName
*
* PARAMETERS: TargetHandle - Handle of named object whose name is
* to be found
* Buffer - Where the name is returned
*
* RETURN: Status, Buffer is filled with name if status is AE_OK
*
* DESCRIPTION: Build and return a full namespace name
*
******************************************************************************/
ACPI_STATUS
AcpiNsHandleToName (
ACPI_HANDLE TargetHandle,
ACPI_BUFFER *Buffer)
{
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node;
const char *NodeName;
ACPI_FUNCTION_TRACE_PTR (NsHandleToName, TargetHandle);
Node = AcpiNsValidateHandle (TargetHandle);
if (!Node)
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/* Validate/Allocate/Clear caller buffer */
Status = AcpiUtInitializeBuffer (Buffer, ACPI_PATH_SEGMENT_LENGTH);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* Just copy the ACPI name from the Node and zero terminate it */
NodeName = AcpiUtGetNodeName (Node);
ACPI_MOVE_NAME (Buffer->Pointer, NodeName);
((char *) Buffer->Pointer) [ACPI_NAME_SIZE] = 0;
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%4.4s\n", (char *) Buffer->Pointer));
return_ACPI_STATUS (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiNsHandleToPathname
@@ -236,10 +337,6 @@ AcpiNsHandleToPathname (
(void) AcpiNsBuildNormalizedPath (Node, Buffer->Pointer,
RequiredSize, NoTrailing);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s [%X]\n",
(char *) Buffer->Pointer, (UINT32) RequiredSize));
@@ -416,3 +513,169 @@ AcpiNsGetNormalizedPathname (
return_PTR (NameBuffer);
}
/*******************************************************************************
*
* FUNCTION: AcpiNsBuildPrefixedPathname
*
* PARAMETERS: PrefixScope - Scope/Path that prefixes the internal path
* InternalPath - Name or path of the namespace node
*
* RETURN: None
*
* DESCRIPTION: Construct a fully qualified pathname from a concatenation of:
* 1) Path associated with the PrefixScope namespace node
* 2) External path representation of the Internal path
*
******************************************************************************/
char *
AcpiNsBuildPrefixedPathname (
ACPI_GENERIC_STATE *PrefixScope,
const char *InternalPath)
{
ACPI_STATUS Status;
char *FullPath = NULL;
char *ExternalPath = NULL;
char *PrefixPath = NULL;
UINT32 PrefixPathLength = 0;
/* If there is a prefix, get the pathname to it */
if (PrefixScope && PrefixScope->Scope.Node)
{
PrefixPath = AcpiNsGetNormalizedPathname (PrefixScope->Scope.Node, TRUE);
if (PrefixPath)
{
PrefixPathLength = strlen (PrefixPath);
}
}
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, InternalPath,
NULL, &ExternalPath);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
}
/* Merge the prefix path and the path. 2 is for one dot and trailing null */
FullPath = ACPI_ALLOCATE_ZEROED (
PrefixPathLength + strlen (ExternalPath) + 2);
if (!FullPath)
{
goto Cleanup;
}
/* Don't merge if the External path is already fully qualified */
if (PrefixPath &&
(*ExternalPath != '\\') &&
(*ExternalPath != '^'))
{
strcat (FullPath, PrefixPath);
if (PrefixPath[1])
{
strcat (FullPath, ".");
}
}
AcpiNsNormalizePathname (ExternalPath);
strcat (FullPath, ExternalPath);
Cleanup:
if (PrefixPath)
{
ACPI_FREE (PrefixPath);
}
if (ExternalPath)
{
ACPI_FREE (ExternalPath);
}
return (FullPath);
}
/*******************************************************************************
*
* FUNCTION: AcpiNsNormalizePathname
*
* PARAMETERS: OriginalPath - Path to be normalized, in External format
*
* RETURN: The original path is processed in-place
*
* DESCRIPTION: Remove trailing underscores from each element of a path.
*
* For example: \A___.B___.C___ becomes \A.B.C
*
******************************************************************************/
static void
AcpiNsNormalizePathname (
char *OriginalPath)
{
char *InputPath = OriginalPath;
char *NewPathBuffer;
char *NewPath;
UINT32 i;
/* Allocate a temp buffer in which to construct the new path */
NewPathBuffer = ACPI_ALLOCATE_ZEROED (strlen (InputPath) + 1);
NewPath = NewPathBuffer;
if (!NewPathBuffer)
{
return;
}
/* Special characters may appear at the beginning of the path */
if (*InputPath == '\\')
{
*NewPath = *InputPath;
NewPath++;
InputPath++;
}
while (*InputPath == '^')
{
*NewPath = *InputPath;
NewPath++;
InputPath++;
}
/* Remainder of the path */
while (*InputPath)
{
/* Do one nameseg at a time */
for (i = 0; (i < ACPI_NAME_SIZE) && *InputPath; i++)
{
if ((i == 0) || (*InputPath != '_')) /* First char is allowed to be underscore */
{
*NewPath = *InputPath;
NewPath++;
}
InputPath++;
}
/* Dot means that there are more namesegs to come */
if (*InputPath == '.')
{
*NewPath = *InputPath;
NewPath++;
InputPath++;
}
}
*NewPath = 0;
strcpy (OriginalPath, NewPathBuffer);
ACPI_FREE (NewPathBuffer);
}
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -119,12 +155,116 @@
#include "acparser.h"
#include "acdispat.h"
#include "actables.h"
#include "acinterp.h"
#define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME ("nsparse")
/*******************************************************************************
*
* FUNCTION: NsExecuteTable
*
* PARAMETERS: TableDesc - An ACPI table descriptor for table to parse
* StartNode - Where to enter the table into the namespace
*
* RETURN: Status
*
* DESCRIPTION: Load ACPI/AML table by executing the entire table as a
* TermList.
*
******************************************************************************/
ACPI_STATUS
AcpiNsExecuteTable (
UINT32 TableIndex,
ACPI_NAMESPACE_NODE *StartNode)
{
ACPI_STATUS Status;
ACPI_TABLE_HEADER *Table;
ACPI_OWNER_ID OwnerId;
ACPI_EVALUATE_INFO *Info = NULL;
UINT32 AmlLength;
UINT8 *AmlStart;
ACPI_OPERAND_OBJECT *MethodObj = NULL;
ACPI_FUNCTION_TRACE (NsExecuteTable);
Status = AcpiGetTableByIndex (TableIndex, &Table);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* Table must consist of at least a complete header */
if (Table->Length < sizeof (ACPI_TABLE_HEADER))
{
return_ACPI_STATUS (AE_BAD_HEADER);
}
AmlStart = (UINT8 *) Table + sizeof (ACPI_TABLE_HEADER);
AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER);
Status = AcpiTbGetOwnerId (TableIndex, &OwnerId);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* Create, initialize, and link a new temporary method object */
MethodObj = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD);
if (!MethodObj)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Allocate the evaluation information block */
Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EVALUATE_INFO));
if (!Info)
{
Status = AE_NO_MEMORY;
goto Cleanup;
}
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"Create table code block: %p\n", MethodObj));
MethodObj->Method.AmlStart = AmlStart;
MethodObj->Method.AmlLength = AmlLength;
MethodObj->Method.OwnerId = OwnerId;
MethodObj->Method.InfoFlags |= ACPI_METHOD_MODULE_LEVEL;
Info->PassNumber = ACPI_IMODE_EXECUTE;
Info->Node = StartNode;
Info->ObjDesc = MethodObj;
Info->NodeFlags = Info->Node->Flags;
Info->FullPathname = AcpiNsGetNormalizedPathname (Info->Node, TRUE);
if (!Info->FullPathname)
{
Status = AE_NO_MEMORY;
goto Cleanup;
}
Status = AcpiPsExecuteTable (Info);
Cleanup:
if (Info)
{
ACPI_FREE (Info->FullPathname);
Info->FullPathname = NULL;
}
ACPI_FREE (Info);
AcpiUtRemoveReference (MethodObj);
return_ACPI_STATUS (Status);
}
/*******************************************************************************
*
* FUNCTION: NsOneCompleteParse
@@ -228,7 +368,9 @@ AcpiNsOneCompleteParse (
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"*PARSE* pass %u parse\n", PassNumber));
AcpiExEnterInterpreter ();
Status = AcpiPsParseAml (WalkState);
AcpiExExitInterpreter ();
Cleanup:
AcpiPsDeleteParseTree (ParseRoot);
@@ -260,40 +402,53 @@ AcpiNsParseTable (
ACPI_FUNCTION_TRACE (NsParseTable);
/*
* AML Parse, pass 1
*
* In this pass, we load most of the namespace. Control methods
* are not parsed until later. A parse tree is not created. Instead,
* each Parser Op subtree is deleted when it is finished. This saves
* a great deal of memory, and allows a small cache of parse objects
* to service the entire parse. The second pass of the parse then
* performs another complete parse of the AML.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 1\n"));
Status = AcpiNsOneCompleteParse (ACPI_IMODE_LOAD_PASS1,
TableIndex, StartNode);
if (ACPI_FAILURE (Status))
if (AcpiGbl_ParseTableAsTermList)
{
return_ACPI_STATUS (Status);
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start load pass\n"));
Status = AcpiNsExecuteTable (TableIndex, StartNode);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
}
/*
* AML Parse, pass 2
*
* In this pass, we resolve forward references and other things
* that could not be completed during the first pass.
* Another complete parse of the AML is performed, but the
* overhead of this is compensated for by the fact that the
* parse objects are all cached.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 2\n"));
Status = AcpiNsOneCompleteParse (ACPI_IMODE_LOAD_PASS2,
TableIndex, StartNode);
if (ACPI_FAILURE (Status))
else
{
return_ACPI_STATUS (Status);
/*
* AML Parse, pass 1
*
* In this pass, we load most of the namespace. Control methods
* are not parsed until later. A parse tree is not created.
* Instead, each Parser Op subtree is deleted when it is finished.
* This saves a great deal of memory, and allows a small cache of
* parse objects to service the entire parse. The second pass of
* the parse then performs another complete parse of the AML.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 1\n"));
Status = AcpiNsOneCompleteParse (ACPI_IMODE_LOAD_PASS1,
TableIndex, StartNode);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/*
* AML Parse, pass 2
*
* In this pass, we resolve forward references and other things
* that could not be completed during the first pass.
* Another complete parse of the AML is performed, but the
* overhead of this is compensated for by the fact that the
* parse objects are all cached.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 2\n"));
Status = AcpiNsOneCompleteParse (ACPI_IMODE_LOAD_PASS2,
TableIndex, StartNode);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
}
return_ACPI_STATUS (Status);
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#define ACPI_CREATE_PREDEFINED_TABLE
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -686,6 +722,8 @@ AcpiNsCheckPackageList (
default: /* Should not get here, type was validated by caller */
ACPI_ERROR ((AE_INFO, "Invalid Package type: %X",
Package->RetInfo.Type));
return (AE_AML_INTERNAL);
}
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -374,24 +410,12 @@ ObjectRepaired:
if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT)
{
/*
* The original object is a package element. We need to
* decrement the reference count of the original object,
* for removing it from the package.
*
* However, if the original object was just wrapped with a
* package object as part of the repair, we don't need to
* change the reference count.
*/
/* Update reference count of new object */
if (!(Info->ReturnFlags & ACPI_OBJECT_WRAPPED))
{
NewObject->Common.ReferenceCount =
ReturnObject->Common.ReferenceCount;
if (ReturnObject->Common.ReferenceCount > 1)
{
ReturnObject->Common.ReferenceCount--;
}
}
ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR,
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -520,16 +556,12 @@ AcpiNsRepair_CID (
return (Status);
}
/* Take care with reference counts */
if (OriginalElement != *ElementPtr)
{
/* Element was replaced */
/* Update reference count of new object */
(*ElementPtr)->Common.ReferenceCount =
OriginalRefCount;
AcpiUtRemoveReference (OriginalElement);
}
ElementPtr++;
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -509,6 +545,7 @@ AcpiNsSearchAndEnter (
(WalkState && WalkState->Opcode == AML_SCOPE_OP))
{
NewNode->Flags |= ANOBJ_IS_EXTERNAL;
NewNode->Flags |= IMPLICIT_EXTERNAL;
}
#endif
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -170,7 +206,7 @@ AcpiNsPrintNodePathname (
AcpiOsPrintf ("%s ", Message);
}
AcpiOsPrintf ("[%s] (Node %p)", (char *) Buffer.Pointer, Node);
AcpiOsPrintf ("%s", (char *) Buffer.Pointer);
ACPI_FREE (Buffer.Pointer);
}
}
@@ -366,7 +402,7 @@ AcpiNsBuildInternalName (
}
else
{
InternalName[1] = AML_MULTI_NAME_PREFIX_OP;
InternalName[1] = AML_MULTI_NAME_PREFIX;
InternalName[2] = (char) NumSegments;
Result = &InternalName[3];
}
@@ -397,7 +433,7 @@ AcpiNsBuildInternalName (
}
else
{
InternalName[i] = AML_MULTI_NAME_PREFIX_OP;
InternalName[i] = AML_MULTI_NAME_PREFIX;
InternalName[(ACPI_SIZE) i+1] = (char) NumSegments;
Result = &InternalName[(ACPI_SIZE) i+2];
}
@@ -606,7 +642,7 @@ AcpiNsExternalizeName (
{
switch (InternalName[PrefixLength])
{
case AML_MULTI_NAME_PREFIX_OP:
case AML_MULTI_NAME_PREFIX:
/* <count> 4-byte names */
@@ -766,28 +802,23 @@ AcpiNsTerminate (
void)
{
ACPI_STATUS Status;
ACPI_OPERAND_OBJECT *Prev;
ACPI_OPERAND_OBJECT *Next;
ACPI_FUNCTION_TRACE (NsTerminate);
#ifdef ACPI_EXEC_APP
/* Delete any module-level code blocks */
Next = AcpiGbl_ModuleCodeList;
while (Next)
{
ACPI_OPERAND_OBJECT *Prev;
ACPI_OPERAND_OBJECT *Next;
/* Delete any module-level code blocks */
Next = AcpiGbl_ModuleCodeList;
while (Next)
{
Prev = Next;
Next = Next->Method.Mutex;
Prev->Method.Mutex = NULL; /* Clear the Mutex (cheated) field */
AcpiUtRemoveReference (Prev);
}
Prev = Next;
Next = Next->Method.Mutex;
Prev->Method.Mutex = NULL; /* Clear the Mutex (cheated) field */
AcpiUtRemoveReference (Prev);
}
#endif
/*
* Free the entire namespace -- all nodes and all objects
@@ -843,7 +874,7 @@ AcpiNsOpensScope (
/*******************************************************************************
*
* FUNCTION: AcpiNsGetNode
* FUNCTION: AcpiNsGetNodeUnlocked
*
* PARAMETERS: *Pathname - Name to be found, in external (ASL) format. The
* \ (backslash) and ^ (carat) prefixes, and the
@@ -859,12 +890,12 @@ AcpiNsOpensScope (
* DESCRIPTION: Look up a name relative to a given scope and return the
* corresponding Node. NOTE: Scope can be null.
*
* MUTEX: Locks namespace
* MUTEX: Doesn't locks namespace
*
******************************************************************************/
ACPI_STATUS
AcpiNsGetNode (
AcpiNsGetNodeUnlocked (
ACPI_NAMESPACE_NODE *PrefixNode,
const char *Pathname,
UINT32 Flags,
@@ -875,7 +906,7 @@ AcpiNsGetNode (
char *InternalPath;
ACPI_FUNCTION_TRACE_PTR (NsGetNode, ACPI_CAST_PTR (char, Pathname));
ACPI_FUNCTION_TRACE_PTR (NsGetNodeUnlocked, ACPI_CAST_PTR (char, Pathname));
/* Simplest case is a null pathname */
@@ -907,14 +938,6 @@ AcpiNsGetNode (
return_ACPI_STATUS (Status);
}
/* Must lock namespace during lookup */
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
}
/* Setup lookup scope (search starting point) */
ScopeInfo.Scope.Node = PrefixNode;
@@ -930,9 +953,55 @@ AcpiNsGetNode (
Pathname, AcpiFormatException (Status)));
}
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
Cleanup:
ACPI_FREE (InternalPath);
return_ACPI_STATUS (Status);
}
/*******************************************************************************
*
* FUNCTION: AcpiNsGetNode
*
* PARAMETERS: *Pathname - Name to be found, in external (ASL) format. The
* \ (backslash) and ^ (carat) prefixes, and the
* . (period) to separate segments are supported.
* PrefixNode - Root of subtree to be searched, or NS_ALL for the
* root of the name space. If Name is fully
* qualified (first INT8 is '\'), the passed value
* of Scope will not be accessed.
* Flags - Used to indicate whether to perform upsearch or
* not.
* ReturnNode - Where the Node is returned
*
* DESCRIPTION: Look up a name relative to a given scope and return the
* corresponding Node. NOTE: Scope can be null.
*
* MUTEX: Locks namespace
*
******************************************************************************/
ACPI_STATUS
AcpiNsGetNode (
ACPI_NAMESPACE_NODE *PrefixNode,
const char *Pathname,
UINT32 Flags,
ACPI_NAMESPACE_NODE **ReturnNode)
{
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE_PTR (NsGetNode, ACPI_CAST_PTR (char, Pathname));
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
Status = AcpiNsGetNodeUnlocked (PrefixNode, Pathname,
Flags, ReturnNode);
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (Status);
}
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#define EXPORT_ACPI_INTERFACES
@@ -138,11 +174,11 @@ AcpiNsResolveReferences (
*
* PARAMETERS: Handle - Object handle (optional)
* Pathname - Object pathname (optional)
* ExternalParams - List of parameters to pass to method,
* ExternalParams - List of parameters to pass to a method,
* terminated by NULL. May be NULL
* if no parameters are being passed.
* ReturnBuffer - Where to put method's return value (if
* any). If NULL, no value is returned.
* ReturnBuffer - Where to put the object return value (if
* any). Required.
* ReturnType - Expected type of return object
*
* RETURN: Status
@@ -163,6 +199,8 @@ AcpiEvaluateObjectTyped (
{
ACPI_STATUS Status;
BOOLEAN FreeBufferOnError = FALSE;
ACPI_HANDLE TargetHandle;
char *FullPathname;
ACPI_FUNCTION_TRACE (AcpiEvaluateObjectTyped);
@@ -180,41 +218,62 @@ AcpiEvaluateObjectTyped (
FreeBufferOnError = TRUE;
}
/* Evaluate the object */
/* Get a handle here, in order to build an error message if needed */
Status = AcpiEvaluateObject (Handle, Pathname,
ExternalParams, ReturnBuffer);
if (ACPI_FAILURE (Status))
TargetHandle = Handle;
if (Pathname)
{
return_ACPI_STATUS (Status);
Status = AcpiGetHandle (Handle, Pathname, &TargetHandle);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
}
/* Type ANY means "don't care" */
FullPathname = AcpiNsGetExternalPathname (TargetHandle);
if (!FullPathname)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Evaluate the object */
Status = AcpiEvaluateObject (TargetHandle, NULL, ExternalParams,
ReturnBuffer);
if (ACPI_FAILURE (Status))
{
goto Exit;
}
/* Type ANY means "don't care about return value type" */
if (ReturnType == ACPI_TYPE_ANY)
{
return_ACPI_STATUS (AE_OK);
goto Exit;
}
if (ReturnBuffer->Length == 0)
{
/* Error because caller specifically asked for a return value */
ACPI_ERROR ((AE_INFO, "No return value"));
return_ACPI_STATUS (AE_NULL_OBJECT);
ACPI_ERROR ((AE_INFO, "%s did not return any object",
FullPathname));
Status = AE_NULL_OBJECT;
goto Exit;
}
/* Examine the object type returned from EvaluateObject */
if (((ACPI_OBJECT *) ReturnBuffer->Pointer)->Type == ReturnType)
{
return_ACPI_STATUS (AE_OK);
goto Exit;
}
/* Return object type does not match requested type */
ACPI_ERROR ((AE_INFO,
"Incorrect return type [%s] requested [%s]",
"Incorrect return type from %s - received [%s], requested [%s]",
FullPathname,
AcpiUtGetTypeName (((ACPI_OBJECT *) ReturnBuffer->Pointer)->Type),
AcpiUtGetTypeName (ReturnType)));
@@ -232,7 +291,11 @@ AcpiEvaluateObjectTyped (
}
ReturnBuffer->Length = 0;
return_ACPI_STATUS (AE_TYPE);
Status = AE_TYPE;
Exit:
ACPI_FREE (FullPathname);
return_ACPI_STATUS (Status);
}
ACPI_EXPORT_SYMBOL (AcpiEvaluateObjectTyped)
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#define EXPORT_ACPI_INTERFACES
@@ -248,8 +284,6 @@ AcpiGetName (
ACPI_BUFFER *Buffer)
{
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node;
const char *NodeName;
/* Parameter validation */
@@ -265,16 +299,6 @@ AcpiGetName (
return (Status);
}
if (NameType == ACPI_FULL_PATHNAME ||
NameType == ACPI_FULL_PATHNAME_NO_TRAILING)
{
/* Get the full pathname (From the namespace root) */
Status = AcpiNsHandleToPathname (Handle, Buffer,
NameType == ACPI_FULL_PATHNAME ? FALSE : TRUE);
return (Status);
}
/*
* Wants the single segment ACPI name.
* Validate handle and convert to a namespace Node
@@ -285,31 +309,21 @@ AcpiGetName (
return (Status);
}
Node = AcpiNsValidateHandle (Handle);
if (!Node)
if (NameType == ACPI_FULL_PATHNAME ||
NameType == ACPI_FULL_PATHNAME_NO_TRAILING)
{
Status = AE_BAD_PARAMETER;
goto UnlockAndExit;
/* Get the full pathname (From the namespace root) */
Status = AcpiNsHandleToPathname (Handle, Buffer,
NameType == ACPI_FULL_PATHNAME ? FALSE : TRUE);
}
/* Validate/Allocate/Clear caller buffer */
Status = AcpiUtInitializeBuffer (Buffer, ACPI_PATH_SEGMENT_LENGTH);
if (ACPI_FAILURE (Status))
else
{
goto UnlockAndExit;
/* Get the single name */
Status = AcpiNsHandleToName (Handle, Buffer);
}
/* Just copy the ACPI name from the Node and zero terminate it */
NodeName = AcpiUtGetNodeName (Node);
ACPI_MOVE_NAME (Buffer->Pointer, NodeName);
((char *) Buffer->Pointer) [ACPI_NAME_SIZE] = 0;
Status = AE_OK;
UnlockAndExit:
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return (Status);
}
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -112,6 +112,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#define EXPORT_ACPI_INTERFACES
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -119,6 +155,7 @@
#include "amlcode.h"
#include "acnamesp.h"
#include "acdispat.h"
#include "acconvert.h"
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("psargs")
@@ -280,7 +317,7 @@ AcpiPsGetNextNamestring (
End += 1 + (2 * ACPI_NAME_SIZE);
break;
case AML_MULTI_NAME_PREFIX_OP:
case AML_MULTI_NAME_PREFIX:
/* Multiple name segments, 4 chars each, count in next byte */
@@ -370,23 +407,26 @@ AcpiPsGetNextNamepath (
PossibleMethodCall &&
(Node->Type == ACPI_TYPE_METHOD))
{
if (WalkState->Opcode == AML_UNLOAD_OP)
if ((GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) == ARGP_SUPERNAME) ||
(GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) == ARGP_TARGET))
{
/*
* AcpiPsGetNextNamestring has increased the AML pointer,
* so we need to restore the saved AML pointer for method call.
* AcpiPsGetNextNamestring has increased the AML pointer past
* the method invocation namestring, so we need to restore the
* saved AML pointer back to the original method invocation
* namestring.
*/
WalkState->ParserState.Aml = Start;
WalkState->ArgCount = 1;
AcpiPsInitOp (Arg, AML_INT_METHODCALL_OP);
return_ACPI_STATUS (AE_OK);
}
/* This name is actually a control method invocation */
MethodDesc = AcpiNsGetAttachedObject (Node);
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"Control Method - %p Desc %p Path=%p\n", Node, MethodDesc, Path));
"Control Method invocation %4.4s - %p Desc %p Path=%p\n",
Node->Name.Ascii, Node, MethodDesc, Path));
NameOp = AcpiPsAllocOp (AML_INT_NAMEPATH_OP, Start);
if (!NameOp)
@@ -438,7 +478,7 @@ AcpiPsGetNextNamepath (
/* 2) NotFound during a CondRefOf(x) is ok by definition */
else if (WalkState->Op->Common.AmlOpcode == AML_COND_REF_OF_OP)
else if (WalkState->Op->Common.AmlOpcode == AML_CONDITIONAL_REF_OF_OP)
{
Status = AE_OK;
}
@@ -450,7 +490,7 @@ AcpiPsGetNextNamepath (
*/
else if ((Arg->Common.Parent) &&
((Arg->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Arg->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP)))
(Arg->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP)))
{
Status = AE_OK;
}
@@ -460,7 +500,7 @@ AcpiPsGetNextNamepath (
if (ACPI_FAILURE (Status))
{
ACPI_ERROR_NAMESPACE (Path, Status);
ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, Path, Status);
if ((WalkState->ParseFlags & ACPI_PARSE_MODE_MASK) ==
ACPI_PARSE_EXECUTE)
@@ -612,6 +652,7 @@ AcpiPsGetNextField (
ACPI_FUNCTION_TRACE (PsGetNextField);
ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState);
Aml = ParserState->Aml;
/* Determine field type */
@@ -658,6 +699,7 @@ AcpiPsGetNextField (
/* Decode the field type */
ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState);
switch (Opcode)
{
case AML_INT_NAMEDFIELD_OP:
@@ -668,6 +710,23 @@ AcpiPsGetNextField (
AcpiPsSetName (Field, Name);
ParserState->Aml += ACPI_NAME_SIZE;
ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState);
#ifdef ACPI_ASL_COMPILER
/*
* Because the package length isn't represented as a parse tree object,
* take comments surrounding this and add to the previously created
* parse node.
*/
if (Field->Common.InlineComment)
{
Field->Common.NameComment = Field->Common.InlineComment;
}
Field->Common.InlineComment = AcpiGbl_CurrentInlineComment;
AcpiGbl_CurrentInlineComment = NULL;
#endif
/* Get the length which is encoded as a package length */
Field->Common.Value.Size = AcpiPsGetNextPackageLength (ParserState);
@@ -724,10 +783,12 @@ AcpiPsGetNextField (
{
ParserState->Aml++;
ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState);
PkgEnd = ParserState->Aml;
PkgLength = AcpiPsGetNextPackageLength (ParserState);
PkgEnd += PkgLength;
ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState);
if (ParserState->Aml < PkgEnd)
{
/* Non-empty list */
@@ -744,6 +805,7 @@ AcpiPsGetNextField (
Opcode = ACPI_GET8 (ParserState->Aml);
ParserState->Aml++;
ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState);
switch (Opcode)
{
case AML_BYTE_OP: /* AML_BYTEDATA_ARG */
@@ -772,6 +834,7 @@ AcpiPsGetNextField (
/* Fill in bytelist data */
ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState);
Arg->Named.Value.Size = BufferLength;
Arg->Named.Data = ParserState->Aml;
}
@@ -843,6 +906,10 @@ AcpiPsGetNextArg (
ACPI_FUNCTION_TRACE_PTR (PsGetNextArg, ParserState);
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"Expected argument type ARGP: %s (%2.2X)\n",
AcpiUtGetArgumentTypeName (ArgType), ArgType));
switch (ArgType)
{
case ARGP_BYTEDATA:
@@ -926,11 +993,13 @@ AcpiPsGetNextArg (
}
break;
case ARGP_TARGET:
case ARGP_SUPERNAME:
case ARGP_SIMPLENAME:
case ARGP_NAME_OR_REF:
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"**** SimpleName/NameOrRef: %s (%2.2X)\n",
AcpiUtGetArgumentTypeName (ArgType), ArgType));
Subop = AcpiPsPeekOpcode (ParserState);
if (Subop == 0 ||
AcpiPsIsLeadingChar (Subop) ||
@@ -945,27 +1014,46 @@ AcpiPsGetNextArg (
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* To support SuperName arg of Unload */
Status = AcpiPsGetNextNamepath (WalkState, ParserState,
Arg, ACPI_NOT_METHOD_CALL);
}
else
{
/* Single complex argument, nothing returned */
if (WalkState->Opcode == AML_UNLOAD_OP)
WalkState->ArgCount = 1;
}
break;
case ARGP_TARGET:
case ARGP_SUPERNAME:
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"**** Target/Supername: %s (%2.2X)\n",
AcpiUtGetArgumentTypeName (ArgType), ArgType));
Subop = AcpiPsPeekOpcode (ParserState);
if (Subop == 0 ||
AcpiPsIsLeadingChar (Subop) ||
ACPI_IS_ROOT_PREFIX (Subop) ||
ACPI_IS_PARENT_PREFIX (Subop))
{
/* NULL target (zero). Convert to a NULL namepath */
Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP, ParserState->Aml);
if (!Arg)
{
Status = AcpiPsGetNextNamepath (WalkState, ParserState,
Arg, ACPI_POSSIBLE_METHOD_CALL);
/*
* If the SuperName argument is a method call, we have
* already restored the AML pointer, just free this Arg
*/
if (Arg->Common.AmlOpcode == AML_INT_METHODCALL_OP)
{
AcpiPsFreeOp (Arg);
Arg = NULL;
}
return_ACPI_STATUS (AE_NO_MEMORY);
}
else
Status = AcpiPsGetNextNamepath (WalkState, ParserState,
Arg, ACPI_POSSIBLE_METHOD_CALL);
if (Arg->Common.AmlOpcode == AML_INT_METHODCALL_OP)
{
Status = AcpiPsGetNextNamepath (WalkState, ParserState,
Arg, ACPI_NOT_METHOD_CALL);
AcpiPsFreeOp (Arg);
Arg = NULL;
WalkState->ArgCount = 1;
}
}
else
@@ -979,6 +1067,11 @@ AcpiPsGetNextArg (
case ARGP_DATAOBJ:
case ARGP_TERMARG:
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"**** TermArg/DataObj: %s (%2.2X)\n",
AcpiUtGetArgumentTypeName (ArgType), ArgType));
/* Single complex argument, nothing returned */
WalkState->ArgCount = 1;
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
/*
@@ -127,6 +163,7 @@
#include "acparser.h"
#include "acdispat.h"
#include "amlcode.h"
#include "acconvert.h"
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("psloop")
@@ -176,6 +213,9 @@ AcpiPsGetArguments (
ACPI_FUNCTION_TRACE_PTR (PsGetArguments, WalkState);
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"Get arguments for opcode [%s]\n", Op->Common.AmlOpName));
switch (Op->Common.AmlOpcode)
{
case AML_BYTE_OP: /* AML_BYTEDATA_ARG */
@@ -211,6 +251,22 @@ AcpiPsGetArguments (
{
WalkState->Aml = WalkState->ParserState.Aml;
switch (Op->Common.AmlOpcode)
{
case AML_METHOD_OP:
case AML_BUFFER_OP:
case AML_PACKAGE_OP:
case AML_VARIABLE_PACKAGE_OP:
case AML_WHILE_OP:
break;
default:
ASL_CV_CAPTURE_COMMENTS (WalkState);
break;
}
Status = AcpiPsGetNextArg (WalkState, &(WalkState->ParserState),
GET_CURRENT_ARG_TYPE (WalkState->ArgTypes), &Arg);
if (ACPI_FAILURE (Status))
@@ -226,6 +282,9 @@ AcpiPsGetArguments (
INCREMENT_ARG_LIST (WalkState->ArgTypes);
}
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"Final argument count: %u pass %u\n",
WalkState->ArgCount, WalkState->PassNumber));
/*
* Handle executable code at "module-level". This refers to
@@ -318,12 +377,16 @@ AcpiPsGetArguments (
case AML_BUFFER_OP:
case AML_PACKAGE_OP:
case AML_VAR_PACKAGE_OP:
case AML_VARIABLE_PACKAGE_OP:
if ((Op->Common.Parent) &&
(Op->Common.Parent->Common.AmlOpcode == AML_NAME_OP) &&
(WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS2))
{
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"Setup Package/Buffer: Pass %u, AML Ptr: %p\n",
WalkState->PassNumber, AmlOpStart));
/*
* Skip parsing of Buffers and Packages because we don't have
* enough info in the first pass to parse them correctly.
@@ -556,6 +619,8 @@ AcpiPsParseLoop (
while ((ParserState->Aml < ParserState->AmlEnd) || (Op))
{
ASL_CV_CAPTURE_COMMENTS (WalkState);
AmlOpStart = ParserState->Aml;
if (!Op)
{
@@ -589,12 +654,26 @@ AcpiPsParseLoop (
AcpiExStartTraceOpcode (Op, WalkState);
}
/*
* Start ArgCount at zero because we don't know if there are
* any args yet
*/
WalkState->ArgCount = 0;
WalkState->ArgCount = 0;
switch (Op->Common.AmlOpcode)
{
case AML_BYTE_OP:
case AML_WORD_OP:
case AML_DWORD_OP:
case AML_QWORD_OP:
break;
default:
ASL_CV_CAPTURE_COMMENTS (WalkState);
break;
}
/* Are there any arguments that must be processed? */
@@ -617,6 +696,9 @@ AcpiPsParseLoop (
/* Check for arguments that need to be processed */
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"Parseloop: argument count: %u\n", WalkState->ArgCount));
if (WalkState->ArgCount)
{
/*
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,12 +111,49 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
#include "amlcode.h"
#include "acconvert.h"
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("psobject")
@@ -200,12 +237,23 @@ AcpiPsGetAmlOpcode (
WalkState->Opcode,
(UINT32) (AmlOffset + sizeof (ACPI_TABLE_HEADER)));
ACPI_ERROR ((AE_INFO,
"Aborting disassembly, AML byte code is corrupt"));
/* Dump the context surrounding the invalid opcode */
AcpiUtDumpBuffer (((UINT8 *) WalkState->ParserState.Aml - 16),
48, DB_BYTE_DISPLAY,
(AmlOffset + sizeof (ACPI_TABLE_HEADER) - 16));
AcpiOsPrintf (" */\n");
/*
* Just abort the disassembly, cannot continue because the
* parser is essentially lost. The disassembler can then
* randomly fail because an ill-constructed parse tree
* can result.
*/
return_ACPI_STATUS (AE_AML_BAD_OPCODE);
#endif
}
@@ -273,6 +321,7 @@ AcpiPsBuildNamedOp (
while (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) &&
(GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) != ARGP_NAME))
{
ASL_CV_CAPTURE_COMMENTS (WalkState);
Status = AcpiPsGetNextArg (WalkState, &(WalkState->ParserState),
GET_CURRENT_ARG_TYPE (WalkState->ArgTypes), &Arg);
if (ACPI_FAILURE (Status))
@@ -284,6 +333,18 @@ AcpiPsBuildNamedOp (
INCREMENT_ARG_LIST (WalkState->ArgTypes);
}
/* are there any inline comments associated with the NameSeg?? If so, save this. */
ASL_CV_CAPTURE_COMMENTS (WalkState);
#ifdef ACPI_ASL_COMPILER
if (AcpiGbl_CurrentInlineComment != NULL)
{
UnnamedOp->Common.NameComment = AcpiGbl_CurrentInlineComment;
AcpiGbl_CurrentInlineComment = NULL;
}
#endif
/*
* Make sure that we found a NAME and didn't run out of arguments
*/
@@ -329,6 +390,28 @@ AcpiPsBuildNamedOp (
AcpiPsAppendArg (*Op, UnnamedOp->Common.Value.Arg);
#ifdef ACPI_ASL_COMPILER
/* save any comments that might be associated with UnnamedOp. */
(*Op)->Common.InlineComment = UnnamedOp->Common.InlineComment;
(*Op)->Common.EndNodeComment = UnnamedOp->Common.EndNodeComment;
(*Op)->Common.CloseBraceComment = UnnamedOp->Common.CloseBraceComment;
(*Op)->Common.NameComment = UnnamedOp->Common.NameComment;
(*Op)->Common.CommentList = UnnamedOp->Common.CommentList;
(*Op)->Common.EndBlkComment = UnnamedOp->Common.EndBlkComment;
(*Op)->Common.CvFilename = UnnamedOp->Common.CvFilename;
(*Op)->Common.CvParentFilename = UnnamedOp->Common.CvParentFilename;
(*Op)->Named.Aml = UnnamedOp->Common.Aml;
UnnamedOp->Common.InlineComment = NULL;
UnnamedOp->Common.EndNodeComment = NULL;
UnnamedOp->Common.CloseBraceComment = NULL;
UnnamedOp->Common.NameComment = NULL;
UnnamedOp->Common.CommentList = NULL;
UnnamedOp->Common.EndBlkComment = NULL;
#endif
if ((*Op)->Common.AmlOpcode == AML_REGION_OP ||
(*Op)->Common.AmlOpcode == AML_DATA_REGION_OP)
{
@@ -386,6 +469,10 @@ AcpiPsCreateOp (
{
return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE);
}
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* Create Op structure and append to parent's argument list */
@@ -400,6 +487,26 @@ AcpiPsCreateOp (
{
Status = AcpiPsBuildNamedOp (WalkState, AmlOpStart, Op, &NamedOp);
AcpiPsFreeOp (Op);
#ifdef ACPI_ASL_COMPILER
if (AcpiGbl_DisasmFlag && WalkState->Opcode == AML_EXTERNAL_OP &&
Status == AE_NOT_FOUND)
{
/*
* If parsing of AML_EXTERNAL_OP's name path fails, then skip
* past this opcode and keep parsing. This is a much better
* alternative than to abort the entire disassembler. At this
* point, the ParserState is at the end of the namepath of the
* external declaration opcode. Setting WalkState->Aml to
* WalkState->ParserState.Aml + 2 moves increments the
* WalkState->Aml past the object type and the paramcount of the
* external opcode.
*/
WalkState->Aml = WalkState->ParserState.Aml + 2;
WalkState->ParserState.Aml = WalkState->Aml;
return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE);
}
#endif
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -445,7 +552,13 @@ AcpiPsCreateOp (
Op->Common.Flags |= ACPI_PARSEOP_TARGET;
}
}
else if (ParentScope->Common.AmlOpcode == AML_INCREMENT_OP)
/*
* Special case for both Increment() and Decrement(), where
* the lone argument is both a source and a target.
*/
else if ((ParentScope->Common.AmlOpcode == AML_INCREMENT_OP) ||
(ParentScope->Common.AmlOpcode == AML_DECREMENT_OP))
{
Op->Common.Flags |= ACPI_PARSEOP_TARGET;
}
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -144,7 +180,7 @@
AML_DEVICE_OP
AML_THERMAL_ZONE_OP
AML_METHOD_OP
AML_POWER_RES_OP
AML_POWER_RESOURCE_OP
AML_PROCESSOR_OP
AML_FIELD_OP
AML_INDEX_FIELD_OP
@@ -170,7 +206,7 @@
AML_DEVICE_OP
AML_THERMAL_ZONE_OP
AML_METHOD_OP
AML_POWER_RES_OP
AML_POWER_RESOURCE_OP
AML_PROCESSOR_OP
AML_FIELD_OP
AML_INDEX_FIELD_OP
@@ -188,7 +224,7 @@
AML_DEVICE_OP
AML_THERMAL_ZONE_OP
AML_METHOD_OP
AML_POWER_RES_OP
AML_POWER_RESOURCE_OP
AML_PROCESSOR_OP
AML_NAME_OP
AML_ALIAS_OP
@@ -211,7 +247,7 @@
AML_DEVICE_OP
AML_THERMAL_ZONE_OP
AML_METHOD_OP
AML_POWER_RES_OP
AML_POWER_RESOURCE_OP
AML_PROCESSOR_OP
AML_NAME_OP
AML_ALIAS_OP
@@ -224,7 +260,7 @@
must be deferred until needed
AML_METHOD_OP
AML_VAR_PACKAGE_OP
AML_VARIABLE_PACKAGE_OP
AML_CREATE_FIELD_OP
AML_CREATE_BIT_FIELD_OP
AML_CREATE_BYTE_FIELD_OP
@@ -409,7 +445,8 @@ const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES] =
/* ACPI 6.0 opcodes */
/* 81 */ ACPI_OP ("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE,/* ? */ AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R)
/* 81 */ ACPI_OP ("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
/* 82 */ ACPI_OP ("Comment", ARGP_COMMENT_OP, ARGI_COMMENT_OP, ACPI_TYPE_STRING, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT)
/*! [End] no source code translation !*/
};
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -314,7 +350,7 @@ const UINT8 AcpiGbl_ShortOpIndex[256] =
/* 0x90 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x73, 0x74,
/* 0x98 */ 0x75, 0x76, _UNK, _UNK, 0x77, 0x78, 0x79, 0x7A,
/* 0xA0 */ 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x60, 0x61,
/* 0xA8 */ 0x62, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
/* 0xA8 */ 0x62, 0x82, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
/* 0xB0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
/* 0xB8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
/* 0xC0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
/*
@@ -128,6 +164,7 @@
#include "acdispat.h"
#include "amlcode.h"
#include "acinterp.h"
#include "acnamesp.h"
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("psparse")
@@ -186,7 +223,7 @@ AcpiPsPeekOpcode (
Aml = ParserState->Aml;
Opcode = (UINT16) ACPI_GET8 (Aml);
if (Opcode == AML_EXTENDED_OP_PREFIX)
if (Opcode == AML_EXTENDED_PREFIX)
{
/* Extended opcode, get the second opcode byte */
@@ -290,7 +327,7 @@ AcpiPsCompleteThisOp (
(Op->Common.Parent->Common.AmlOpcode == AML_BUFFER_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_BANK_FIELD_OP) ||
(Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
(Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
{
ReplacementOp = AcpiPsAllocOp (
AML_INT_RETURN_VALUE_OP, Op->Common.Aml);
@@ -304,7 +341,7 @@ AcpiPsCompleteThisOp (
{
if ((Op->Common.AmlOpcode == AML_BUFFER_OP) ||
(Op->Common.AmlOpcode == AML_PACKAGE_OP) ||
(Op->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
(Op->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
{
ReplacementOp = AcpiPsAllocOp (Op->Common.AmlOpcode,
Op->Common.Aml);
@@ -627,8 +664,19 @@ AcpiPsParseAml (
{
/* Either the method parse or actual execution failed */
ACPI_ERROR_METHOD ("Method parse/execution failed",
WalkState->MethodNode, NULL, Status);
AcpiExExitInterpreter ();
if (Status == AE_ABORT_METHOD)
{
AcpiNsPrintNodePathname (
WalkState->MethodNode, "Method aborted:");
AcpiOsPrintf ("\n");
}
else
{
ACPI_ERROR_METHOD ("Method parse/execution failed",
WalkState->MethodNode, NULL, Status);
}
AcpiExEnterInterpreter ();
/* Check for possible multi-thread reentrancy problem */
@@ -661,7 +709,8 @@ AcpiPsParseAml (
* cleanup to do
*/
if (((WalkState->ParseFlags & ACPI_PARSE_MODE_MASK) ==
ACPI_PARSE_EXECUTE) ||
ACPI_PARSE_EXECUTE &&
!(WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL)) ||
(ACPI_FAILURE (Status)))
{
AcpiDsTerminateControlMethod (WalkState->MethodDesc, WalkState);
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,6 +111,42 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,12 +111,49 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
#include "amlcode.h"
#include "acconvert.h"
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("pstree")
@@ -214,12 +251,12 @@ AcpiPsAppendArg (
const ACPI_OPCODE_INFO *OpInfo;
ACPI_FUNCTION_ENTRY ();
ACPI_FUNCTION_TRACE (PsAppendArg);
if (!Op)
{
return;
return_VOID;
}
/* Get the info structure for this opcode */
@@ -231,7 +268,7 @@ AcpiPsAppendArg (
ACPI_ERROR ((AE_INFO, "Invalid AML Opcode: 0x%2.2X",
Op->Common.AmlOpcode));
return;
return_VOID;
}
/* Check if this opcode requires argument sub-objects */
@@ -240,7 +277,7 @@ AcpiPsAppendArg (
{
/* Has no linked argument objects */
return;
return_VOID;
}
/* Append the argument to the linked argument list */
@@ -272,6 +309,8 @@ AcpiPsAppendArg (
Op->Common.ArgListLength++;
}
return_VOID;
}
@@ -312,6 +351,7 @@ AcpiPsGetDepthNext (
Next = AcpiPsGetArg (Op, 0);
if (Next)
{
ASL_CV_LABEL_FILENODE (Next);
return (Next);
}
@@ -320,6 +360,7 @@ AcpiPsGetDepthNext (
Next = Op->Common.Next;
if (Next)
{
ASL_CV_LABEL_FILENODE (Next);
return (Next);
}
@@ -332,6 +373,8 @@ AcpiPsGetDepthNext (
Arg = AcpiPsGetArg (Parent, 0);
while (Arg && (Arg != Origin) && (Arg != Op))
{
ASL_CV_LABEL_FILENODE (Arg);
Arg = Arg->Common.Next;
}
@@ -346,6 +389,7 @@ AcpiPsGetDepthNext (
{
/* Found sibling of parent */
ASL_CV_LABEL_FILENODE (Parent->Common.Next);
return (Parent->Common.Next);
}
@@ -353,6 +397,7 @@ AcpiPsGetDepthNext (
Parent = Parent->Common.Parent;
}
ASL_CV_LABEL_FILENODE (Next);
return (Next);
}
@@ -401,7 +446,7 @@ AcpiPsGetChild (
Child = AcpiPsGetArg (Op, 1);
break;
case AML_POWER_RES_OP:
case AML_POWER_RESOURCE_OP:
case AML_INDEX_FIELD_OP:
Child = AcpiPsGetArg (Op, 2);
@@ -8,7 +8,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -111,12 +111,49 @@
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
#include "amlcode.h"
#include "acconvert.h"
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("psutils")
@@ -176,7 +213,7 @@ AcpiPsInitOp (
Op->Common.DescriptorType = ACPI_DESC_TYPE_PARSER;
Op->Common.AmlOpcode = Opcode;
ACPI_DISASM_ONLY_MEMBERS (strncpy (Op->Common.AmlOpName,
ACPI_DISASM_ONLY_MEMBERS (AcpiUtSafeStrncpy (Op->Common.AmlOpName,
(AcpiPsGetOpcodeInfo (Opcode))->Name,
sizeof (Op->Common.AmlOpName)));
}
@@ -249,6 +286,17 @@ AcpiPsAllocOp (
AcpiPsInitOp (Op, Opcode);
Op->Common.Aml = Aml;
Op->Common.Flags = Flags;
ASL_CV_CLEAR_OP_COMMENTS(Op);
if (Opcode == AML_SCOPE_OP)
{
AcpiGbl_CurrentScope = Op;
}
if (AcpiGbl_CaptureComments)
{
ASL_CV_TRANSFER_COMMENTS (Op);
}
}
return (Op);
@@ -275,6 +323,7 @@ AcpiPsFreeOp (
ACPI_FUNCTION_NAME (PsFreeOp);
ASL_CV_CLEAR_OP_COMMENTS(Op);
if (Op->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP)
{
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,

Some files were not shown because too many files have changed in this diff Show More