Commit f81d800e authored by Len Brown's avatar Len Brown Committed by Len Brown

[ACPI] ACPICA 20040514 from Bob Moore

Fixed a problem where hardware GPE enable bits sometimes
not set properly during and after GPE method execution.
Result of ACPICA 20040427 changes.

Removed extra "clear all GPEs" when sleeping/waking.

Removed acpi_ht_enable_gpe and acpi_hw_disable_gpe, replaced
by the single acpi_hw_write_gpe_enable_reg. Changed a couple
of calls to the functions above to the new acpi_ev* calls
as appropriate.

ACPI_OS_NAME was removed from the OS-specific headers.
The default name is now "Microsoft Windows NT" for maximum
compatibility. However this can be changed by modifying
the acconfig.h file.  Fixes EHCI probe issue:
http://bugme.osdl.org/show_bug.cgi?id=1762

Allow a single invocation of acpi_install_notify_handler
for a handler that traps both types of notifies (System,
Device). Use ACPI_ALL_NOTIFY flag.

Run _INI methods on ThermalZone objects. This is against
the ACPI specification, but there is apparently ASL code
in the field that has these _INI methods, and apparently
"other" AML interpreters execute them.

Performed a full 16/32/64 bit lint that resulted in some
small changes.
parent 5eb3a43d
...@@ -386,7 +386,7 @@ acpi_ds_call_control_method ( ...@@ -386,7 +386,7 @@ acpi_ds_call_control_method (
/* On error, we must delete the new walk state */ /* On error, we must delete the new walk state */
cleanup: cleanup:
if (next_walk_state->method_desc) { if (next_walk_state && (next_walk_state->method_desc)) {
/* Decrement the thread count on the method parse tree */ /* Decrement the thread count on the method parse tree */
next_walk_state->method_desc->method.thread_count--; next_walk_state->method_desc->method.thread_count--;
......
...@@ -67,6 +67,9 @@ acpi_ev_set_gpe_type ( ...@@ -67,6 +67,9 @@ acpi_ev_set_gpe_type (
struct acpi_gpe_event_info *gpe_event_info, struct acpi_gpe_event_info *gpe_event_info,
u8 type) u8 type)
{ {
acpi_status status;
ACPI_FUNCTION_TRACE ("ev_set_gpe_type"); ACPI_FUNCTION_TRACE ("ev_set_gpe_type");
...@@ -84,13 +87,13 @@ acpi_ev_set_gpe_type ( ...@@ -84,13 +87,13 @@ acpi_ev_set_gpe_type (
/* Disable the GPE if currently enabled */ /* Disable the GPE if currently enabled */
acpi_ev_disable_gpe (gpe_event_info); status = acpi_ev_disable_gpe (gpe_event_info);
/* Type was validated above */ /* Type was validated above */
gpe_event_info->flags &= ~ACPI_GPE_TYPE_MASK; /* Clear type bits */ gpe_event_info->flags &= ~ACPI_GPE_TYPE_MASK; /* Clear type bits */
gpe_event_info->flags |= type; /* Insert type */ gpe_event_info->flags |= type; /* Insert type */
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (status);
} }
...@@ -198,7 +201,7 @@ acpi_ev_enable_gpe ( ...@@ -198,7 +201,7 @@ acpi_ev_enable_gpe (
case ACPI_GPE_TYPE_WAKE_RUN: case ACPI_GPE_TYPE_WAKE_RUN:
gpe_event_info->flags |= ACPI_GPE_WAKE_ENABLED; gpe_event_info->flags |= ACPI_GPE_WAKE_ENABLED;
/* Fallthrough */ /*lint -fallthrough */
case ACPI_GPE_TYPE_RUNTIME: case ACPI_GPE_TYPE_RUNTIME:
...@@ -214,7 +217,7 @@ acpi_ev_enable_gpe ( ...@@ -214,7 +217,7 @@ acpi_ev_enable_gpe (
/* Enable the requested runtime GPE */ /* Enable the requested runtime GPE */
status = acpi_hw_enable_gpe (gpe_event_info); status = acpi_hw_write_gpe_enable_reg (gpe_event_info);
} }
break; break;
...@@ -269,14 +272,14 @@ acpi_ev_disable_gpe ( ...@@ -269,14 +272,14 @@ acpi_ev_disable_gpe (
case ACPI_GPE_TYPE_WAKE_RUN: case ACPI_GPE_TYPE_WAKE_RUN:
gpe_event_info->flags &= ~ACPI_GPE_WAKE_ENABLED; gpe_event_info->flags &= ~ACPI_GPE_WAKE_ENABLED;
/* Fallthrough */ /*lint -fallthrough */
case ACPI_GPE_TYPE_RUNTIME: case ACPI_GPE_TYPE_RUNTIME:
/* Disable the requested runtime GPE */ /* Disable the requested runtime GPE */
gpe_event_info->flags &= ~ACPI_GPE_RUN_ENABLED; gpe_event_info->flags &= ~ACPI_GPE_RUN_ENABLED;
status = acpi_hw_disable_gpe (gpe_event_info); status = acpi_hw_write_gpe_enable_reg (gpe_event_info);
break; break;
default: default:
...@@ -381,8 +384,8 @@ acpi_ev_gpe_detect ( ...@@ -381,8 +384,8 @@ acpi_ev_gpe_detect (
u32 enable_reg; u32 enable_reg;
acpi_status status; acpi_status status;
struct acpi_gpe_block_info *gpe_block; struct acpi_gpe_block_info *gpe_block;
u32 i; acpi_native_uint i;
u32 j; acpi_native_uint j;
ACPI_FUNCTION_NAME ("ev_gpe_detect"); ACPI_FUNCTION_NAME ("ev_gpe_detect");
...@@ -454,7 +457,7 @@ acpi_ev_gpe_detect ( ...@@ -454,7 +457,7 @@ acpi_ev_gpe_detect (
*/ */
int_status |= acpi_ev_gpe_dispatch ( int_status |= acpi_ev_gpe_dispatch (
&gpe_block->event_info[(i * ACPI_GPE_REGISTER_WIDTH) + j], &gpe_block->event_info[(i * ACPI_GPE_REGISTER_WIDTH) + j],
j + gpe_register_info->base_gpe_number); (u32) j + gpe_register_info->base_gpe_number);
} }
} }
} }
...@@ -511,6 +514,10 @@ acpi_ev_asynch_execute_gpe_method ( ...@@ -511,6 +514,10 @@ acpi_ev_asynch_execute_gpe_method (
return_VOID; return_VOID;
} }
/* Set the GPE flags for return to enabled state */
(void) acpi_ev_enable_gpe (gpe_event_info, FALSE);
/* /*
* Take a snapshot of the GPE info for this level - we copy the * Take a snapshot of the GPE info for this level - we copy the
* info to prevent a race condition with remove_handler/remove_block. * info to prevent a race condition with remove_handler/remove_block.
...@@ -558,7 +565,7 @@ acpi_ev_asynch_execute_gpe_method ( ...@@ -558,7 +565,7 @@ acpi_ev_asynch_execute_gpe_method (
/* Enable this GPE */ /* Enable this GPE */
(void) acpi_hw_enable_gpe (&local_gpe_event_info); (void) acpi_hw_write_gpe_enable_reg (&local_gpe_event_info);
return_VOID; return_VOID;
} }
...@@ -624,7 +631,7 @@ acpi_ev_gpe_dispatch ( ...@@ -624,7 +631,7 @@ acpi_ev_gpe_dispatch (
/* Invoke the installed handler (at interrupt level) */ /* Invoke the installed handler (at interrupt level) */
gpe_event_info->dispatch.handler->address ( gpe_event_info->dispatch.handler->address ((void *)
gpe_event_info->dispatch.handler->context); gpe_event_info->dispatch.handler->context);
/* It is now safe to clear level-triggered events. */ /* It is now safe to clear level-triggered events. */
...@@ -646,7 +653,7 @@ acpi_ev_gpe_dispatch ( ...@@ -646,7 +653,7 @@ acpi_ev_gpe_dispatch (
* Disable GPE, so it doesn't keep firing before the method has a * Disable GPE, so it doesn't keep firing before the method has a
* chance to run. * chance to run.
*/ */
status = acpi_hw_disable_gpe (gpe_event_info); status = acpi_ev_disable_gpe (gpe_event_info);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_REPORT_ERROR (( ACPI_REPORT_ERROR ((
"acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n", "acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n",
...@@ -679,7 +686,7 @@ acpi_ev_gpe_dispatch ( ...@@ -679,7 +686,7 @@ acpi_ev_gpe_dispatch (
* Disable the GPE. The GPE will remain disabled until the ACPI * Disable the GPE. The GPE will remain disabled until the ACPI
* Core Subsystem is restarted, or a handler is installed. * Core Subsystem is restarted, or a handler is installed.
*/ */
status = acpi_hw_disable_gpe (gpe_event_info); status = acpi_ev_disable_gpe (gpe_event_info);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
ACPI_REPORT_ERROR (( ACPI_REPORT_ERROR ((
"acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n", "acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n",
...@@ -725,7 +732,7 @@ acpi_ev_check_for_wake_only_gpe ( ...@@ -725,7 +732,7 @@ acpi_ev_check_for_wake_only_gpe (
((gpe_event_info->flags & ACPI_GPE_SYSTEM_MASK) == ACPI_GPE_SYSTEM_RUNNING)) /* System state at GPE time */ { ((gpe_event_info->flags & ACPI_GPE_SYSTEM_MASK) == ACPI_GPE_SYSTEM_RUNNING)) /* System state at GPE time */ {
/* This must be a wake-only GPE, disable it */ /* This must be a wake-only GPE, disable it */
status = acpi_hw_disable_gpe (gpe_event_info); status = acpi_ev_disable_gpe (gpe_event_info);
/* Set GPE to wake-only. Do not change wake disabled/enabled status */ /* Set GPE to wake-only. Do not change wake disabled/enabled status */
......
...@@ -174,8 +174,11 @@ acpi_ev_delete_gpe_handlers ( ...@@ -174,8 +174,11 @@ acpi_ev_delete_gpe_handlers (
struct acpi_gpe_block_info *gpe_block) struct acpi_gpe_block_info *gpe_block)
{ {
struct acpi_gpe_event_info *gpe_event_info; struct acpi_gpe_event_info *gpe_event_info;
u32 i; acpi_native_uint i;
u32 j; acpi_native_uint j;
ACPI_FUNCTION_TRACE ("ev_delete_gpe_handlers");
/* Examine each GPE Register within the block */ /* Examine each GPE Register within the block */
...@@ -194,7 +197,7 @@ acpi_ev_delete_gpe_handlers ( ...@@ -194,7 +197,7 @@ acpi_ev_delete_gpe_handlers (
} }
} }
return (AE_OK); return_ACPI_STATUS (AE_OK);
} }
...@@ -232,6 +235,7 @@ acpi_ev_save_method_info ( ...@@ -232,6 +235,7 @@ acpi_ev_save_method_info (
u32 gpe_number; u32 gpe_number;
char name[ACPI_NAME_SIZE + 1]; char name[ACPI_NAME_SIZE + 1];
u8 type; u8 type;
acpi_status status;
ACPI_FUNCTION_TRACE ("ev_save_method_info"); ACPI_FUNCTION_TRACE ("ev_save_method_info");
...@@ -309,12 +313,12 @@ acpi_ev_save_method_info ( ...@@ -309,12 +313,12 @@ acpi_ev_save_method_info (
/* Update enable mask, but don't enable the HW GPE as of yet */ /* Update enable mask, but don't enable the HW GPE as of yet */
acpi_ev_enable_gpe (gpe_event_info, FALSE); status = acpi_ev_enable_gpe (gpe_event_info, FALSE);
ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, ACPI_DEBUG_PRINT ((ACPI_DB_LOAD,
"Registered GPE method %s as GPE number 0x%.2X\n", "Registered GPE method %s as GPE number 0x%.2X\n",
name, gpe_number)); name, gpe_number));
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (status);
} }
...@@ -425,8 +429,11 @@ acpi_ev_match_prw_and_gpe ( ...@@ -425,8 +429,11 @@ acpi_ev_match_prw_and_gpe (
/* Mark GPE for WAKE-ONLY but WAKE_DISABLED */ /* Mark GPE for WAKE-ONLY but WAKE_DISABLED */
gpe_event_info->flags &= ~(ACPI_GPE_WAKE_ENABLED | ACPI_GPE_RUN_ENABLED); gpe_event_info->flags &= ~(ACPI_GPE_WAKE_ENABLED | ACPI_GPE_RUN_ENABLED);
acpi_ev_set_gpe_type (gpe_event_info, ACPI_GPE_TYPE_WAKE); status = acpi_ev_set_gpe_type (gpe_event_info, ACPI_GPE_TYPE_WAKE);
acpi_ev_update_gpe_enable_masks (gpe_event_info, ACPI_GPE_DISABLE); if (ACPI_FAILURE (status)) {
goto cleanup;
}
status = acpi_ev_update_gpe_enable_masks (gpe_event_info, ACPI_GPE_DISABLE);
} }
cleanup: cleanup:
......
...@@ -196,8 +196,8 @@ acpi_ev_queue_notify_request ( ...@@ -196,8 +196,8 @@ acpi_ev_queue_notify_request (
/* There is no per-device notify handler for this device */ /* There is no per-device notify handler for this device */
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"No notify handler for [%4.4s] node %p\n", "No notify handler for Notify(%4.4s, %X) node %p\n",
acpi_ut_get_node_name (node), node)); acpi_ut_get_node_name (node), notify_value, node));
} }
return (status); return (status);
......
...@@ -188,6 +188,7 @@ acpi_remove_fixed_event_handler ( ...@@ -188,6 +188,7 @@ acpi_remove_fixed_event_handler (
* handler_type - The type of handler: * handler_type - The type of handler:
* ACPI_SYSTEM_NOTIFY: system_handler (00-7f) * ACPI_SYSTEM_NOTIFY: system_handler (00-7f)
* ACPI_DEVICE_NOTIFY: driver_handler (80-ff) * ACPI_DEVICE_NOTIFY: driver_handler (80-ff)
* ACPI_ALL_NOTIFY: both system and device
* Handler - Address of the handler * Handler - Address of the handler
* Context - Value passed to the handler on each GPE * Context - Value passed to the handler on each GPE
* *
...@@ -243,20 +244,21 @@ acpi_install_notify_handler ( ...@@ -243,20 +244,21 @@ acpi_install_notify_handler (
if (device == ACPI_ROOT_OBJECT) { if (device == ACPI_ROOT_OBJECT) {
/* Make sure the handler is not already installed */ /* Make sure the handler is not already installed */
if (((handler_type == ACPI_SYSTEM_NOTIFY) && if (((handler_type & ACPI_SYSTEM_NOTIFY) &&
acpi_gbl_system_notify.handler) || acpi_gbl_system_notify.handler) ||
((handler_type == ACPI_DEVICE_NOTIFY) && ((handler_type & ACPI_DEVICE_NOTIFY) &&
acpi_gbl_device_notify.handler)) { acpi_gbl_device_notify.handler)) {
status = AE_ALREADY_EXISTS; status = AE_ALREADY_EXISTS;
goto unlock_and_exit; goto unlock_and_exit;
} }
if (handler_type == ACPI_SYSTEM_NOTIFY) { if (handler_type & ACPI_SYSTEM_NOTIFY) {
acpi_gbl_system_notify.node = node; acpi_gbl_system_notify.node = node;
acpi_gbl_system_notify.handler = handler; acpi_gbl_system_notify.handler = handler;
acpi_gbl_system_notify.context = context; acpi_gbl_system_notify.context = context;
} }
else /* ACPI_DEVICE_NOTIFY */ {
if (handler_type & ACPI_DEVICE_NOTIFY) {
acpi_gbl_device_notify.node = node; acpi_gbl_device_notify.node = node;
acpi_gbl_device_notify.handler = handler; acpi_gbl_device_notify.handler = handler;
acpi_gbl_device_notify.context = context; acpi_gbl_device_notify.context = context;
...@@ -284,9 +286,9 @@ acpi_install_notify_handler ( ...@@ -284,9 +286,9 @@ acpi_install_notify_handler (
if (obj_desc) { if (obj_desc) {
/* Object exists - make sure there's no handler */ /* Object exists - make sure there's no handler */
if (((handler_type == ACPI_SYSTEM_NOTIFY) && if (((handler_type & ACPI_SYSTEM_NOTIFY) &&
obj_desc->common_notify.system_notify) || obj_desc->common_notify.system_notify) ||
((handler_type == ACPI_DEVICE_NOTIFY) && ((handler_type & ACPI_DEVICE_NOTIFY) &&
obj_desc->common_notify.device_notify)) { obj_desc->common_notify.device_notify)) {
status = AE_ALREADY_EXISTS; status = AE_ALREADY_EXISTS;
goto unlock_and_exit; goto unlock_and_exit;
...@@ -308,7 +310,6 @@ acpi_install_notify_handler ( ...@@ -308,7 +310,6 @@ acpi_install_notify_handler (
/* Remove local reference to the object */ /* Remove local reference to the object */
acpi_ut_remove_reference (obj_desc); acpi_ut_remove_reference (obj_desc);
if (ACPI_FAILURE (status)) { if (ACPI_FAILURE (status)) {
goto unlock_and_exit; goto unlock_and_exit;
} }
...@@ -326,12 +327,19 @@ acpi_install_notify_handler ( ...@@ -326,12 +327,19 @@ acpi_install_notify_handler (
notify_obj->notify.handler = handler; notify_obj->notify.handler = handler;
notify_obj->notify.context = context; notify_obj->notify.context = context;
if (handler_type == ACPI_SYSTEM_NOTIFY) { if (handler_type & ACPI_SYSTEM_NOTIFY) {
obj_desc->common_notify.system_notify = notify_obj; obj_desc->common_notify.system_notify = notify_obj;
} }
else /* ACPI_DEVICE_NOTIFY */ {
if (handler_type & ACPI_DEVICE_NOTIFY) {
obj_desc->common_notify.device_notify = notify_obj; obj_desc->common_notify.device_notify = notify_obj;
} }
if (handler_type == ACPI_ALL_NOTIFY) {
/* Extra ref if installed in both */
acpi_ut_add_reference (notify_obj);
}
} }
...@@ -349,6 +357,7 @@ acpi_install_notify_handler ( ...@@ -349,6 +357,7 @@ acpi_install_notify_handler (
* handler_type - The type of handler: * handler_type - The type of handler:
* ACPI_SYSTEM_NOTIFY: system_handler (00-7f) * ACPI_SYSTEM_NOTIFY: system_handler (00-7f)
* ACPI_DEVICE_NOTIFY: driver_handler (80-ff) * ACPI_DEVICE_NOTIFY: driver_handler (80-ff)
* ACPI_ALL_NOTIFY: both system and device
* Handler - Address of the handler * Handler - Address of the handler
* RETURN: Status * RETURN: Status
* *
...@@ -398,20 +407,21 @@ acpi_remove_notify_handler ( ...@@ -398,20 +407,21 @@ acpi_remove_notify_handler (
if (device == ACPI_ROOT_OBJECT) { if (device == ACPI_ROOT_OBJECT) {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing notify handler for ROOT object.\n")); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing notify handler for ROOT object.\n"));
if (((handler_type == ACPI_SYSTEM_NOTIFY) && if (((handler_type & ACPI_SYSTEM_NOTIFY) &&
!acpi_gbl_system_notify.handler) || !acpi_gbl_system_notify.handler) ||
((handler_type == ACPI_DEVICE_NOTIFY) && ((handler_type & ACPI_DEVICE_NOTIFY) &&
!acpi_gbl_device_notify.handler)) { !acpi_gbl_device_notify.handler)) {
status = AE_NOT_EXIST; status = AE_NOT_EXIST;
goto unlock_and_exit; goto unlock_and_exit;
} }
if (handler_type == ACPI_SYSTEM_NOTIFY) { if (handler_type & ACPI_SYSTEM_NOTIFY) {
acpi_gbl_system_notify.node = NULL; acpi_gbl_system_notify.node = NULL;
acpi_gbl_system_notify.handler = NULL; acpi_gbl_system_notify.handler = NULL;
acpi_gbl_system_notify.context = NULL; acpi_gbl_system_notify.context = NULL;
} }
else {
if (handler_type & ACPI_DEVICE_NOTIFY) {
acpi_gbl_device_notify.node = NULL; acpi_gbl_device_notify.node = NULL;
acpi_gbl_device_notify.handler = NULL; acpi_gbl_device_notify.handler = NULL;
acpi_gbl_device_notify.context = NULL; acpi_gbl_device_notify.context = NULL;
...@@ -439,29 +449,33 @@ acpi_remove_notify_handler ( ...@@ -439,29 +449,33 @@ acpi_remove_notify_handler (
/* Object exists - make sure there's an existing handler */ /* Object exists - make sure there's an existing handler */
if (handler_type == ACPI_SYSTEM_NOTIFY) { if (handler_type & ACPI_SYSTEM_NOTIFY) {
notify_obj = obj_desc->common_notify.system_notify; notify_obj = obj_desc->common_notify.system_notify;
} if ((!notify_obj) ||
else { (notify_obj->notify.handler != handler)) {
notify_obj = obj_desc->common_notify.device_notify; status = AE_BAD_PARAMETER;
} goto unlock_and_exit;
}
if ((!notify_obj) ||
(notify_obj->notify.handler != handler)) {
status = AE_BAD_PARAMETER;
goto unlock_and_exit;
}
/* Remove the handler */ /* Remove the handler */
if (handler_type == ACPI_SYSTEM_NOTIFY) {
obj_desc->common_notify.system_notify = NULL; obj_desc->common_notify.system_notify = NULL;
acpi_ut_remove_reference (notify_obj);
} }
else {
if (handler_type & ACPI_DEVICE_NOTIFY) {
notify_obj = obj_desc->common_notify.device_notify;
if ((!notify_obj) ||
(notify_obj->notify.handler != handler)) {
status = AE_BAD_PARAMETER;
goto unlock_and_exit;
}
/* Remove the handler */
obj_desc->common_notify.device_notify = NULL; obj_desc->common_notify.device_notify = NULL;
acpi_ut_remove_reference (notify_obj);
} }
acpi_ut_remove_reference (notify_obj);
} }
......
...@@ -241,14 +241,7 @@ acpi_set_gpe_type ( ...@@ -241,14 +241,7 @@ acpi_set_gpe_type (
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
} }
/* Disable the GPE if enabled */ /* Set the new type (will disable GPE if currently enabled) */
status = acpi_ev_disable_gpe (gpe_event_info);
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
/* Set the new type */
status = acpi_ev_set_gpe_type (gpe_event_info, type); status = acpi_ev_set_gpe_type (gpe_event_info, type);
......
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acnamesp.h> #include <acpi/acnamesp.h>
#include <acpi/acevents.h> #include <acpi/acevents.h>
#include <acpi/acinterp.h>
#define _COMPONENT ACPI_EVENTS #define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evxfregn") ACPI_MODULE_NAME ("evxfregn")
......
...@@ -187,15 +187,15 @@ acpi_ex_resolve_object_to_value ( ...@@ -187,15 +187,15 @@ acpi_ex_resolve_object_to_value (
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Arg/Local %X] value_obj is %p\n",
stack_desc->reference.offset, obj_desc));
/* /*
* Now we can delete the original Reference Object and * Now we can delete the original Reference Object and
* replace it with the resolve value * replace it with the resolved value
*/ */
acpi_ut_remove_reference (stack_desc); acpi_ut_remove_reference (stack_desc);
*stack_ptr = obj_desc; *stack_ptr = obj_desc;
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Arg/Local %d] value_obj is %p\n",
stack_desc->reference.offset, obj_desc));
break; break;
......
...@@ -51,19 +51,20 @@ ...@@ -51,19 +51,20 @@
/****************************************************************************** /******************************************************************************
* *
* FUNCTION: acpi_hw_enable_gpe * FUNCTION: acpi_hw_write_gpe_enable_reg
* *
* PARAMETERS: gpe_event_info - Info block for the GPE to be enabled * PARAMETERS: gpe_event_info - Info block for the GPE to be enabled
* *
* RETURN: Status * RETURN: Status
* *
* DESCRIPTION: Enable a single GPE. Note: The bit for this GPE must already * DESCRIPTION: Write a GPE enable register. Note: The bit for this GPE must
* be set in the parent register enable_for_run mask. * already be cleared or set in the parent register
* enable_for_run mask.
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_hw_enable_gpe ( acpi_hw_write_gpe_enable_reg (
struct acpi_gpe_event_info *gpe_event_info) struct acpi_gpe_event_info *gpe_event_info)
{ {
struct acpi_gpe_register_info *gpe_register_info; struct acpi_gpe_register_info *gpe_register_info;
...@@ -80,7 +81,7 @@ acpi_hw_enable_gpe ( ...@@ -80,7 +81,7 @@ acpi_hw_enable_gpe (
return (AE_NOT_EXIST); return (AE_NOT_EXIST);
} }
/* Write GPE enable register with the new GPE bit enabled */ /* Write the entire GPE (runtime) enable register */
status = acpi_hw_low_level_write (8, gpe_register_info->enable_for_run, status = acpi_hw_low_level_write (8, gpe_register_info->enable_for_run,
&gpe_register_info->enable_address); &gpe_register_info->enable_address);
...@@ -89,44 +90,6 @@ acpi_hw_enable_gpe ( ...@@ -89,44 +90,6 @@ acpi_hw_enable_gpe (
} }
/******************************************************************************
*
* FUNCTION: acpi_hw_disable_gpe
*
* PARAMETERS: gpe_event_info - Info block for the GPE to be disabled
*
* RETURN: Status
*
* DESCRIPTION: Disable a single GPE.
*
******************************************************************************/
acpi_status
acpi_hw_disable_gpe (
struct acpi_gpe_event_info *gpe_event_info)
{
struct acpi_gpe_register_info *gpe_register_info;
acpi_status status;
ACPI_FUNCTION_ENTRY ();
/* Get the info block for the entire GPE register */
gpe_register_info = gpe_event_info->register_info;
if (!gpe_register_info) {
return (AE_NOT_EXIST);
}
/* Write the GPE enable register with this GPE bit cleared */
status = acpi_hw_low_level_write (8, gpe_register_info->enable_for_run,
&gpe_register_info->enable_address);
return (status);
}
/****************************************************************************** /******************************************************************************
* *
* FUNCTION: acpi_hw_clear_gpe * FUNCTION: acpi_hw_clear_gpe
...@@ -380,6 +343,10 @@ acpi_hw_enable_wakeup_gpe_block ( ...@@ -380,6 +343,10 @@ acpi_hw_enable_wakeup_gpe_block (
/* Examine each GPE Register within the block */ /* Examine each GPE Register within the block */
for (i = 0; i < gpe_block->register_count; i++) { for (i = 0; i < gpe_block->register_count; i++) {
if (!gpe_block->register_info[i].enable_for_wake) {
continue;
}
/* Enable all "wake" GPEs in this register */ /* Enable all "wake" GPEs in this register */
status = acpi_hw_low_level_write (8, gpe_block->register_info[i].enable_for_wake, status = acpi_hw_low_level_write (8, gpe_block->register_info[i].enable_for_wake,
...@@ -412,12 +379,12 @@ acpi_hw_disable_all_gpes ( ...@@ -412,12 +379,12 @@ acpi_hw_disable_all_gpes (
acpi_status status; acpi_status status;
ACPI_FUNCTION_ENTRY (); ACPI_FUNCTION_TRACE ("hw_disable_all_gpes");
status = acpi_ev_walk_gpe_list (acpi_hw_disable_gpe_block); status = acpi_ev_walk_gpe_list (acpi_hw_disable_gpe_block);
status = acpi_ev_walk_gpe_list (acpi_hw_clear_gpe_block); status = acpi_ev_walk_gpe_list (acpi_hw_clear_gpe_block);
return (status); return_ACPI_STATUS (status);
} }
...@@ -440,12 +407,11 @@ acpi_hw_enable_all_runtime_gpes ( ...@@ -440,12 +407,11 @@ acpi_hw_enable_all_runtime_gpes (
acpi_status status; acpi_status status;
ACPI_FUNCTION_ENTRY (); ACPI_FUNCTION_TRACE ("hw_enable_all_runtime_gpes");
status = acpi_ev_walk_gpe_list (acpi_hw_clear_gpe_block);
status = acpi_ev_walk_gpe_list (acpi_hw_enable_runtime_gpe_block); status = acpi_ev_walk_gpe_list (acpi_hw_enable_runtime_gpe_block);
return (status); return_ACPI_STATUS (status);
} }
...@@ -468,11 +434,10 @@ acpi_hw_enable_all_wakeup_gpes ( ...@@ -468,11 +434,10 @@ acpi_hw_enable_all_wakeup_gpes (
acpi_status status; acpi_status status;
ACPI_FUNCTION_ENTRY (); ACPI_FUNCTION_TRACE ("hw_enable_all_wakeup_gpes");
status = acpi_ev_walk_gpe_list (acpi_hw_clear_gpe_block);
status = acpi_ev_walk_gpe_list (acpi_hw_enable_wakeup_gpe_block); status = acpi_ev_walk_gpe_list (acpi_hw_enable_wakeup_gpe_block);
return (status); return_ACPI_STATUS (status);
} }
...@@ -570,9 +570,9 @@ acpi_leave_sleep_state ( ...@@ -570,9 +570,9 @@ acpi_leave_sleep_state (
/* Enable power button */ /* Enable power button */
acpi_set_register(acpi_gbl_fixed_event_info[ACPI_EVENT_POWER_BUTTON].enable_register_id, (void) acpi_set_register(acpi_gbl_fixed_event_info[ACPI_EVENT_POWER_BUTTON].enable_register_id,
1, ACPI_MTX_DO_NOT_LOCK); 1, ACPI_MTX_DO_NOT_LOCK);
acpi_set_register(acpi_gbl_fixed_event_info[ACPI_EVENT_POWER_BUTTON].status_register_id, (void) acpi_set_register(acpi_gbl_fixed_event_info[ACPI_EVENT_POWER_BUTTON].status_register_id,
1, ACPI_MTX_DO_NOT_LOCK); 1, ACPI_MTX_DO_NOT_LOCK);
/* Enable BM arbitration */ /* Enable BM arbitration */
......
...@@ -267,7 +267,7 @@ acpi_ns_install_node ( ...@@ -267,7 +267,7 @@ acpi_ns_install_node (
else { else {
#ifdef ACPI_ALPHABETIC_NAMESPACE #ifdef ACPI_ALPHABETIC_NAMESPACE
/* /*
* Walk the list whilst searching for the the correct * Walk the list whilst searching for the correct
* alphabetic placement. * alphabetic placement.
*/ */
previous_child_node = NULL; previous_child_node = NULL;
......
...@@ -494,7 +494,7 @@ acpi_ns_get_object_value ( ...@@ -494,7 +494,7 @@ acpi_ns_get_object_value (
status = AE_CTRL_RETURN_VALUE; status = AE_CTRL_RETURN_VALUE;
info->return_object = ACPI_CAST_PTR (union acpi_operand_object, resolved_node); info->return_object = ACPI_CAST_PTR (union acpi_operand_object, resolved_node);
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Returning object %p [%s]\n", ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Returning object %p [%s]\n",
*info->return_object, acpi_ut_get_object_type_name (info->return_object))); info->return_object, acpi_ut_get_object_type_name (info->return_object)));
} }
} }
......
...@@ -149,7 +149,7 @@ acpi_ns_initialize_devices ( ...@@ -149,7 +149,7 @@ acpi_ns_initialize_devices (
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
/* Walk namespace for all objects of type Device or Processor */ /* Walk namespace for all objects */
status = acpi_ns_walk_namespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, status = acpi_ns_walk_namespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, TRUE, acpi_ns_init_one_device, &info, NULL); ACPI_UINT32_MAX, TRUE, acpi_ns_init_one_device, &info, NULL);
...@@ -355,10 +355,11 @@ acpi_ns_init_one_device ( ...@@ -355,10 +355,11 @@ acpi_ns_init_one_device (
} }
/* /*
* We will run _STA/_INI on Devices and Processors only * We will run _STA/_INI on Devices, Processors and thermal_zones only
*/ */
if ((pinfo.node->type != ACPI_TYPE_DEVICE) && if ((pinfo.node->type != ACPI_TYPE_DEVICE) &&
(pinfo.node->type != ACPI_TYPE_PROCESSOR)) { (pinfo.node->type != ACPI_TYPE_PROCESSOR) &&
(pinfo.node->type != ACPI_TYPE_THERMAL)) {
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
} }
...@@ -381,7 +382,7 @@ acpi_ns_init_one_device ( ...@@ -381,7 +382,7 @@ acpi_ns_init_one_device (
return_ACPI_STATUS (AE_OK); return_ACPI_STATUS (AE_OK);
} }
/* _STA is not required for Processor objects */ /* _STA is not required for Processor or thermal_zone objects */
} }
else { else {
info->num_STA++; info->num_STA++;
...@@ -404,14 +405,14 @@ acpi_ns_init_one_device ( ...@@ -404,14 +405,14 @@ acpi_ns_init_one_device (
if (status != AE_NOT_FOUND) { if (status != AE_NOT_FOUND) {
/* Ignore error and move on to next device */ /* Ignore error and move on to next device */
#ifdef ACPI_DEBUG_OUTPUT #ifdef ACPI_DEBUG_OUTPUT
char *scope_name = acpi_ns_get_external_pathname (pinfo.node); char *scope_name = acpi_ns_get_external_pathname (pinfo.node);
ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "%s._INI failed: %s\n", ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "%s._INI failed: %s\n",
scope_name, acpi_format_exception (status))); scope_name, acpi_format_exception (status)));
ACPI_MEM_FREE (scope_name); ACPI_MEM_FREE (scope_name);
#endif #endif
} }
status = AE_OK; status = AE_OK;
......
...@@ -103,9 +103,8 @@ acpi_psx_execute ( ...@@ -103,9 +103,8 @@ acpi_psx_execute (
return_ACPI_STATUS (status); return_ACPI_STATUS (status);
} }
if (info && if ((info->parameter_type == ACPI_PARAM_ARGS) &&
(info->parameter_type == ACPI_PARAM_ARGS) && (info->parameters)) {
(info->parameters)) {
/* /*
* The caller "owns" the parameters, so give each one an extra * The caller "owns" the parameters, so give each one an extra
* reference * reference
......
...@@ -259,7 +259,8 @@ acpi_walk_resources ( ...@@ -259,7 +259,8 @@ acpi_walk_resources (
/* Setup pointers */ /* Setup pointers */
resource = (struct acpi_resource *) buffer.pointer; resource = (struct acpi_resource *) buffer.pointer;
buffer_end = (struct acpi_resource *) ((u8 *) buffer.pointer + buffer.length); buffer_end = ACPI_CAST_PTR (struct acpi_resource,
((u8 *) buffer.pointer + buffer.length));
/* Walk the resource list */ /* Walk the resource list */
......
...@@ -226,7 +226,7 @@ const struct acpi_predefined_names acpi_gbl_pre_defined_names[] = ...@@ -226,7 +226,7 @@ const struct acpi_predefined_names acpi_gbl_pre_defined_names[] =
{"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL}, {"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL},
{"_SB_", ACPI_TYPE_DEVICE, NULL}, {"_SB_", ACPI_TYPE_DEVICE, NULL},
{"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL}, {"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL},
{"_TZ_", ACPI_TYPE_LOCAL_SCOPE, NULL}, {"_TZ_", ACPI_TYPE_THERMAL, NULL},
{"_REV", ACPI_TYPE_INTEGER, "2"}, {"_REV", ACPI_TYPE_INTEGER, "2"},
{"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME},
{"_GL_", ACPI_TYPE_MUTEX, "0"}, {"_GL_", ACPI_TYPE_MUTEX, "0"},
......
...@@ -64,7 +64,17 @@ ...@@ -64,7 +64,17 @@
/* Version string */ /* Version string */
#define ACPI_CA_VERSION 0x20040427 #define ACPI_CA_VERSION 0x20040514
/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
* but there is a large base of ASL/AML code in existing machines that check
* for the string below. The use of this string usually guarantees that
* the ASL will execute down the most tested code path. Also, there is some
* code that will not execute the _OSI method unless _OS matches the string
* below. Therefore, change this string at your own risk.
*/
#define ACPI_OS_NAME "Microsoft Windows NT"
/* Maximum objects in the various object caches */ /* Maximum objects in the various object caches */
......
...@@ -164,6 +164,10 @@ void ...@@ -164,6 +164,10 @@ void
acpi_db_set_scope ( acpi_db_set_scope (
char *name); char *name);
acpi_status
acpi_db_sleep (
char *object_arg);
void void
acpi_db_find_references ( acpi_db_find_references (
char *object_arg); char *object_arg);
......
...@@ -114,11 +114,7 @@ acpi_hw_clear_acpi_status ( ...@@ -114,11 +114,7 @@ acpi_hw_clear_acpi_status (
/* GPE support */ /* GPE support */
acpi_status acpi_status
acpi_hw_enable_gpe ( acpi_hw_write_gpe_enable_reg (
struct acpi_gpe_event_info *gpe_event_info);
acpi_status
acpi_hw_disable_gpe (
struct acpi_gpe_event_info *gpe_event_info); struct acpi_gpe_event_info *gpe_event_info);
acpi_status acpi_status
...@@ -157,6 +153,11 @@ acpi_hw_enable_runtime_gpe_block ( ...@@ -157,6 +153,11 @@ acpi_hw_enable_runtime_gpe_block (
struct acpi_gpe_xrupt_info *gpe_xrupt_info, struct acpi_gpe_xrupt_info *gpe_xrupt_info,
struct acpi_gpe_block_info *gpe_block); struct acpi_gpe_block_info *gpe_block);
acpi_status
acpi_hw_enable_wakeup_gpe_block (
struct acpi_gpe_xrupt_info *gpe_xrupt_info,
struct acpi_gpe_block_info *gpe_block);
/* ACPI Timer prototypes */ /* ACPI Timer prototypes */
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
* printf() format helpers * printf() format helpers
*/ */
/* Split 64-bit integer into two 32-bit values. use with %8,8_x%8.8X */ /* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */
#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i) #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i)
......
...@@ -614,9 +614,10 @@ typedef u32 acpi_event_status; ...@@ -614,9 +614,10 @@ typedef u32 acpi_event_status;
/* Notify types */ /* Notify types */
#define ACPI_SYSTEM_NOTIFY 0 #define ACPI_SYSTEM_NOTIFY 0x1
#define ACPI_DEVICE_NOTIFY 1 #define ACPI_DEVICE_NOTIFY 0x2
#define ACPI_MAX_NOTIFY_HANDLER_TYPE 1 #define ACPI_ALL_NOTIFY 0x3
#define ACPI_MAX_NOTIFY_HANDLER_TYPE 0x3
#define ACPI_MAX_SYS_NOTIFY 0x7f #define ACPI_MAX_SYS_NOTIFY 0x7f
......
...@@ -152,12 +152,8 @@ ...@@ -152,12 +152,8 @@
#define COMPILER_DEPENDENT_INT64 long long #define COMPILER_DEPENDENT_INT64 long long
#define COMPILER_DEPENDENT_UINT64 unsigned long long #define COMPILER_DEPENDENT_UINT64 unsigned long long
/*
/* Name of host operating system (returned by the _OS_ namespace object) */ * This macro is used to tag functions as "printf-like" because
#define ACPI_OS_NAME "Intel ACPI/CA Core Subsystem"
/* This macro is used to tag functions as "printf-like" because
* some compilers can catch printf format string problems. MSVC * some compilers can catch printf format string problems. MSVC
* doesn't, so this is proprocessed away. * doesn't, so this is proprocessed away.
*/ */
......
...@@ -44,8 +44,6 @@ ...@@ -44,8 +44,6 @@
#ifndef __ACLINUX_H__ #ifndef __ACLINUX_H__
#define __ACLINUX_H__ #define __ACLINUX_H__
#define ACPI_OS_NAME "Linux"
#define ACPI_USE_SYSTEM_CLIBRARY #define ACPI_USE_SYSTEM_CLIBRARY
#define ACPI_USE_DO_WHILE_0 #define ACPI_USE_DO_WHILE_0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment