summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/evregion.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/evregion.c')
-rw-r--r--sys/contrib/dev/acpica/evregion.c70
1 files changed, 47 insertions, 23 deletions
diff --git a/sys/contrib/dev/acpica/evregion.c b/sys/contrib/dev/acpica/evregion.c
index 32410e9..9a73be0 100644
--- a/sys/contrib/dev/acpica/evregion.c
+++ b/sys/contrib/dev/acpica/evregion.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: evregion - ACPI AddressSpace (OpRegion) handler dispatch
- * $Revision: 128 $
+ * $Revision: 134 $
*
*****************************************************************************/
@@ -121,15 +121,15 @@
#include "acevents.h"
#include "acnamesp.h"
#include "acinterp.h"
-#include "amlcode.h"
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evregion")
+
/*******************************************************************************
*
- * FUNCTION: AcpiEvInstallDefaultAddressSpaceHandlers
+ * FUNCTION: AcpiEvInitAddressSpaces
*
* PARAMETERS:
*
@@ -140,13 +140,13 @@
******************************************************************************/
ACPI_STATUS
-AcpiEvInstallDefaultAddressSpaceHandlers (
+AcpiEvInitAddressSpaces (
void)
{
ACPI_STATUS Status;
- ACPI_FUNCTION_TRACE ("EvInstallDefaultAddressSpaceHandlers");
+ ACPI_FUNCTION_TRACE ("EvInitAddressSpaces");
/*
@@ -267,7 +267,7 @@ AcpiEvExecuteRegMethod (
/*
* Set up the parameter objects
*/
- Params[0]->Integer.Value = RegionObj->Region.SpaceId;
+ Params[0]->Integer.Value = RegionObj->Region.SpaceId;
Params[1]->Integer.Value = Function;
Params[2] = NULL;
@@ -310,9 +310,10 @@ AcpiEvAddressSpaceDispatch (
UINT32 Function,
ACPI_PHYSICAL_ADDRESS Address,
UINT32 BitWidth,
- ACPI_INTEGER *Value)
+ void *Value)
{
ACPI_STATUS Status;
+ ACPI_STATUS Status2;
ACPI_ADR_SPACE_HANDLER Handler;
ACPI_ADR_SPACE_SETUP RegionSetup;
ACPI_OPERAND_OBJECT *HandlerDesc;
@@ -372,7 +373,11 @@ AcpiEvAddressSpaceDispatch (
/* Re-enter the interpreter */
- AcpiExEnterInterpreter ();
+ Status2 = AcpiExEnterInterpreter ();
+ if (ACPI_FAILURE (Status2))
+ {
+ return_ACPI_STATUS (Status2);
+ }
/*
* Init routine may fail
@@ -434,7 +439,11 @@ AcpiEvAddressSpaceDispatch (
* We just returned from a non-default handler, we must re-enter the
* interpreter
*/
- AcpiExEnterInterpreter ();
+ Status2 = AcpiExEnterInterpreter ();
+ if (ACPI_FAILURE (Status2))
+ {
+ return_ACPI_STATUS (Status2);
+ }
}
return_ACPI_STATUS (Status);
@@ -442,7 +451,7 @@ AcpiEvAddressSpaceDispatch (
/*******************************************************************************
*
- * FUNCTION: AcpiEvDisassociateRegionFromHandler
+ * FUNCTION: AcpiEvDetachRegion
*
* PARAMETERS: RegionObj - Region Object
* AcpiNsIsLocked - Namespace Region Already Locked?
@@ -455,7 +464,7 @@ AcpiEvAddressSpaceDispatch (
******************************************************************************/
void
-AcpiEvDisassociateRegionFromHandler(
+AcpiEvDetachRegion(
ACPI_OPERAND_OBJECT *RegionObj,
BOOLEAN AcpiNsIsLocked)
{
@@ -468,13 +477,13 @@ AcpiEvDisassociateRegionFromHandler(
ACPI_STATUS Status;
- ACPI_FUNCTION_TRACE ("EvDisassociateRegionFromHandler");
+ ACPI_FUNCTION_TRACE ("EvDetachRegion");
RegionObj2 = AcpiNsGetSecondaryObject (RegionObj);
if (!RegionObj2)
{
- return;
+ return_VOID;
}
RegionContext = RegionObj2->Extra.RegionContext;
@@ -525,7 +534,13 @@ AcpiEvDisassociateRegionFromHandler(
/*
* Now stop region accesses by executing the _REG method
*/
- AcpiEvExecuteRegMethod (RegionObj, 0);
+ Status = AcpiEvExecuteRegMethod (RegionObj, 0);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s from region _REG, [%s]\n",
+ AcpiFormatException (Status),
+ AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
+ }
if (AcpiNsIsLocked)
{
@@ -591,7 +606,7 @@ AcpiEvDisassociateRegionFromHandler(
/*******************************************************************************
*
- * FUNCTION: AcpiEvAssociateRegionAndHandler
+ * FUNCTION: AcpiEvAttachRegion
*
* PARAMETERS: HandlerObj - Handler Object
* RegionObj - Region Object
@@ -605,15 +620,16 @@ AcpiEvDisassociateRegionFromHandler(
******************************************************************************/
ACPI_STATUS
-AcpiEvAssociateRegionAndHandler (
+AcpiEvAttachRegion (
ACPI_OPERAND_OBJECT *HandlerObj,
ACPI_OPERAND_OBJECT *RegionObj,
BOOLEAN AcpiNsIsLocked)
{
- ACPI_STATUS Status;
+ ACPI_STATUS Status;
+ ACPI_STATUS Status2;
- ACPI_FUNCTION_TRACE ("EvAssociateRegionAndHandler");
+ ACPI_FUNCTION_TRACE ("EvAttachRegion");
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
@@ -638,14 +654,22 @@ AcpiEvAssociateRegionAndHandler (
*/
if (AcpiNsIsLocked)
{
- AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+ Status2 = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status2))
+ {
+ return_ACPI_STATUS (Status2);
+ }
}
Status = AcpiEvExecuteRegMethod (RegionObj, 1);
if (AcpiNsIsLocked)
{
- (void) AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ Status2 = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
+ if (ACPI_FAILURE (Status2))
+ {
+ return_ACPI_STATUS (Status2);
+ }
}
return_ACPI_STATUS (Status);
@@ -730,7 +754,7 @@ AcpiEvAddrHandlerHelper (
/*
* Devices are handled different than regions
*/
- if (ObjDesc->Common.Type == ACPI_TYPE_DEVICE)
+ if (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_DEVICE)
{
/*
* See if this guy has any handlers
@@ -793,12 +817,12 @@ AcpiEvAddrHandlerHelper (
*
* First disconnect region for any previous handler (if any)
*/
- AcpiEvDisassociateRegionFromHandler (ObjDesc, FALSE);
+ AcpiEvDetachRegion (ObjDesc, FALSE);
/*
* Then connect the region to the new handler
*/
- Status = AcpiEvAssociateRegionAndHandler (HandlerObj, ObjDesc, FALSE);
+ Status = AcpiEvAttachRegion (HandlerObj, ObjDesc, FALSE);
return (Status);
}
OpenPOWER on IntegriCloud