提交 9f15fc66 编写于 作者: B Bob Moore 提交者: Len Brown

ACPICA: Reformat comments, no functional changes

Reformat comments to use fewer lines.
Signed-off-by: NBob Moore <robert.moore@intel.com>
Signed-off-by: NLin Ming <ming.m.lin@intel.com>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 009c4cbe
...@@ -72,8 +72,8 @@ acpi_status acpi_ev_initialize_events(void) ...@@ -72,8 +72,8 @@ acpi_status acpi_ev_initialize_events(void)
/* /*
* Initialize the Fixed and General Purpose Events. This is done prior to * Initialize the Fixed and General Purpose Events. This is done prior to
* enabling SCIs to prevent interrupts from occurring before the handlers are * enabling SCIs to prevent interrupts from occurring before the handlers
* installed. * are installed.
*/ */
status = acpi_ev_fixed_event_initialize(); status = acpi_ev_fixed_event_initialize();
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
...@@ -192,8 +192,8 @@ static acpi_status acpi_ev_fixed_event_initialize(void) ...@@ -192,8 +192,8 @@ static acpi_status acpi_ev_fixed_event_initialize(void)
acpi_status status; acpi_status status;
/* /*
* Initialize the structure that keeps track of fixed event handlers * Initialize the structure that keeps track of fixed event handlers and
* and enable the fixed events. * enable the fixed events.
*/ */
for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) { for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
acpi_gbl_fixed_event_handlers[i].handler = NULL; acpi_gbl_fixed_event_handlers[i].handler = NULL;
...@@ -237,7 +237,7 @@ u32 acpi_ev_fixed_event_detect(void) ...@@ -237,7 +237,7 @@ u32 acpi_ev_fixed_event_detect(void)
/* /*
* Read the fixed feature status and enable registers, as all the cases * Read the fixed feature status and enable registers, as all the cases
* depend on their values. Ignore errors here. * depend on their values. Ignore errors here.
*/ */
(void)acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS, &fixed_status); (void)acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS, &fixed_status);
(void)acpi_hw_register_read(ACPI_REGISTER_PM1_ENABLE, &fixed_enable); (void)acpi_hw_register_read(ACPI_REGISTER_PM1_ENABLE, &fixed_enable);
...@@ -291,8 +291,8 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event) ...@@ -291,8 +291,8 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event)
status_register_id, 1); status_register_id, 1);
/* /*
* Make sure we've got a handler. If not, report an error. * Make sure we've got a handler. If not, report an error. The event is
* The event is disabled to prevent further interrupts. * disabled to prevent further interrupts.
*/ */
if (NULL == acpi_gbl_fixed_event_handlers[event].handler) { if (NULL == acpi_gbl_fixed_event_handlers[event].handler) {
(void)acpi_set_register(acpi_gbl_fixed_event_info[event]. (void)acpi_set_register(acpi_gbl_fixed_event_info[event].
......
...@@ -125,7 +125,7 @@ acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info, ...@@ -125,7 +125,7 @@ acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info,
(1 << (1 <<
(gpe_event_info->gpe_number - gpe_register_info->base_gpe_number)); (gpe_event_info->gpe_number - gpe_register_info->base_gpe_number));
/* 1) Disable case. Simply clear all enable bits */ /* 1) Disable case. Simply clear all enable bits */
if (type == ACPI_GPE_DISABLE) { if (type == ACPI_GPE_DISABLE) {
ACPI_CLEAR_BIT(gpe_register_info->enable_for_wake, ACPI_CLEAR_BIT(gpe_register_info->enable_for_wake,
...@@ -134,7 +134,7 @@ acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info, ...@@ -134,7 +134,7 @@ acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info,
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }
/* 2) Enable case. Set/Clear the appropriate enable bits */ /* 2) Enable case. Set/Clear the appropriate enable bits */
switch (gpe_event_info->flags & ACPI_GPE_TYPE_MASK) { switch (gpe_event_info->flags & ACPI_GPE_TYPE_MASK) {
case ACPI_GPE_TYPE_WAKE: case ACPI_GPE_TYPE_WAKE:
...@@ -295,7 +295,7 @@ acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info) ...@@ -295,7 +295,7 @@ acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info)
* *
* FUNCTION: acpi_ev_get_gpe_event_info * FUNCTION: acpi_ev_get_gpe_event_info
* *
* PARAMETERS: gpe_device - Device node. NULL for GPE0/GPE1 * PARAMETERS: gpe_device - Device node. NULL for GPE0/GPE1
* gpe_number - Raw GPE number * gpe_number - Raw GPE number
* *
* RETURN: A GPE event_info struct. NULL if not a valid GPE * RETURN: A GPE event_info struct. NULL if not a valid GPE
...@@ -372,7 +372,7 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device, ...@@ -372,7 +372,7 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
* *
* RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED
* *
* DESCRIPTION: Detect if any GP events have occurred. This function is * DESCRIPTION: Detect if any GP events have occurred. This function is
* executed at interrupt level. * executed at interrupt level.
* *
******************************************************************************/ ******************************************************************************/
...@@ -400,8 +400,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list) ...@@ -400,8 +400,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
/* /*
* We need to obtain the GPE lock for both the data structs and registers * We need to obtain the GPE lock for both the data structs and registers
* Note: Not necessary to obtain the hardware lock, since the GPE registers * Note: Not necessary to obtain the hardware lock, since the GPE
* are owned by the gpe_lock. * registers are owned by the gpe_lock.
*/ */
flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
...@@ -410,9 +410,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list) ...@@ -410,9 +410,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
gpe_block = gpe_xrupt_list->gpe_block_list_head; gpe_block = gpe_xrupt_list->gpe_block_list_head;
while (gpe_block) { while (gpe_block) {
/* /*
* Read all of the 8-bit GPE status and enable registers * Read all of the 8-bit GPE status and enable registers in this GPE
* in this GPE block, saving all of them. * block, saving all of them. Find all currently active GP events.
* Find all currently active GP events.
*/ */
for (i = 0; i < gpe_block->register_count; i++) { for (i = 0; i < gpe_block->register_count; i++) {
...@@ -527,8 +526,8 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context) ...@@ -527,8 +526,8 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
(void)acpi_ev_enable_gpe(gpe_event_info, FALSE); (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
* info to prevent a race condition with remove_handler/remove_block. * prevent a race condition with remove_handler/remove_block.
*/ */
ACPI_MEMCPY(&local_gpe_event_info, gpe_event_info, ACPI_MEMCPY(&local_gpe_event_info, gpe_event_info,
sizeof(struct acpi_gpe_event_info)); sizeof(struct acpi_gpe_event_info));
...@@ -539,8 +538,8 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context) ...@@ -539,8 +538,8 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
} }
/* /*
* Must check for control method type dispatch one more * Must check for control method type dispatch one more time to avoid a
* time to avoid race with ev_gpe_install_handler * race with ev_gpe_install_handler
*/ */
if ((local_gpe_event_info.flags & ACPI_GPE_DISPATCH_MASK) == if ((local_gpe_event_info.flags & ACPI_GPE_DISPATCH_MASK) ==
ACPI_GPE_DISPATCH_METHOD) { ACPI_GPE_DISPATCH_METHOD) {
...@@ -584,8 +583,8 @@ static void acpi_ev_asynch_enable_gpe(void *context) ...@@ -584,8 +583,8 @@ static void acpi_ev_asynch_enable_gpe(void *context)
if ((gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK) == if ((gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
ACPI_GPE_LEVEL_TRIGGERED) { ACPI_GPE_LEVEL_TRIGGERED) {
/* /*
* GPE is level-triggered, we clear the GPE status bit after * GPE is level-triggered, we clear the GPE status bit after handling
* handling the event. * the event.
*/ */
status = acpi_hw_clear_gpe(gpe_event_info); status = acpi_hw_clear_gpe(gpe_event_info);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
...@@ -624,7 +623,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number) ...@@ -624,7 +623,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
acpi_os_gpe_count(gpe_number); acpi_os_gpe_count(gpe_number);
/* /*
* If edge-triggered, clear the GPE status bit now. Note that * If edge-triggered, clear the GPE status bit now. Note that
* level-triggered events are cleared after the GPE is serviced. * level-triggered events are cleared after the GPE is serviced.
*/ */
if ((gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK) == if ((gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
...@@ -650,7 +649,8 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number) ...@@ -650,7 +649,8 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
/* /*
* Invoke the installed handler (at interrupt level) * Invoke the installed handler (at interrupt level)
* Ignore return status for now. TBD: leave GPE disabled on error? * Ignore return status for now.
* TBD: leave GPE disabled on error?
*/ */
(void)gpe_event_info->dispatch.handler->address(gpe_event_info-> (void)gpe_event_info->dispatch.handler->address(gpe_event_info->
dispatch. dispatch.
...@@ -708,7 +708,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number) ...@@ -708,7 +708,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
gpe_number)); gpe_number));
/* /*
* Disable the GPE. The GPE will remain disabled until the ACPI * Disable the GPE. The GPE will remain disabled until the ACPICA
* Core Subsystem is restarted, or a handler is installed. * Core Subsystem is restarted, or a handler is installed.
*/ */
status = acpi_ev_disable_gpe(gpe_event_info); status = acpi_ev_disable_gpe(gpe_event_info);
......
...@@ -309,17 +309,17 @@ acpi_ev_save_method_info(acpi_handle obj_handle, ...@@ -309,17 +309,17 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
(gpe_block->block_base_number + (gpe_block->block_base_number +
(gpe_block->register_count * 8)))) { (gpe_block->register_count * 8)))) {
/* /*
* Not valid for this GPE block, just ignore it * Not valid for this GPE block, just ignore it. However, it may be
* However, it may be valid for a different GPE block, since GPE0 and GPE1 * valid for a different GPE block, since GPE0 and GPE1 methods both
* methods both appear under \_GPE. * appear under \_GPE.
*/ */
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }
/* /*
* Now we can add this information to the gpe_event_info block * Now we can add this information to the gpe_event_info block for use
* for use during dispatch of this GPE. Default type is RUNTIME, although * during dispatch of this GPE. Default type is RUNTIME, although this may
* this may change when the _PRW methods are executed later. * change when the _PRW methods are executed later.
*/ */
gpe_event_info = gpe_event_info =
&gpe_block->event_info[gpe_number - gpe_block->block_base_number]; &gpe_block->event_info[gpe_number - gpe_block->block_base_number];
...@@ -394,8 +394,8 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle, ...@@ -394,8 +394,8 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
gpe_block = gpe_info->gpe_block; gpe_block = gpe_info->gpe_block;
/* /*
* The _PRW object must return a package, we are only interested * The _PRW object must return a package, we are only interested in the
* in the first element * first element
*/ */
obj_desc = pkg_desc->package.elements[0]; obj_desc = pkg_desc->package.elements[0];
...@@ -434,7 +434,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle, ...@@ -434,7 +434,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
/* /*
* Is this GPE within this block? * Is this GPE within this block?
* *
* TRUE iff these conditions are true: * TRUE if and only if these conditions are true:
* 1) The GPE devices match. * 1) The GPE devices match.
* 2) The GPE index(number) is within the range of the Gpe Block * 2) The GPE index(number) is within the range of the Gpe Block
* associated with the GPE device. * associated with the GPE device.
...@@ -457,6 +457,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle, ...@@ -457,6 +457,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
goto cleanup; goto cleanup;
} }
status = status =
acpi_ev_update_gpe_enable_masks(gpe_event_info, acpi_ev_update_gpe_enable_masks(gpe_event_info,
ACPI_GPE_DISABLE); ACPI_GPE_DISABLE);
...@@ -476,9 +477,9 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle, ...@@ -476,9 +477,9 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
* RETURN: A GPE interrupt block * RETURN: A GPE interrupt block
* *
* DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt * DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt
* block per unique interrupt level used for GPEs. * block per unique interrupt level used for GPEs. Should be
* Should be called only when the GPE lists are semaphore locked * called only when the GPE lists are semaphore locked and not
* and not subject to change. * subject to change.
* *
******************************************************************************/ ******************************************************************************/
...@@ -608,8 +609,9 @@ acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt) ...@@ -608,8 +609,9 @@ acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt)
* *
* FUNCTION: acpi_ev_install_gpe_block * FUNCTION: acpi_ev_install_gpe_block
* *
* PARAMETERS: gpe_block - New GPE block * PARAMETERS: gpe_block - New GPE block
* interrupt_number - Xrupt to be associated with this GPE block * interrupt_number - Xrupt to be associated with this
* GPE block
* *
* RETURN: Status * RETURN: Status
* *
...@@ -666,7 +668,7 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block, ...@@ -666,7 +668,7 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block,
* *
* FUNCTION: acpi_ev_delete_gpe_block * FUNCTION: acpi_ev_delete_gpe_block
* *
* PARAMETERS: gpe_block - Existing GPE block * PARAMETERS: gpe_block - Existing GPE block
* *
* RETURN: Status * RETURN: Status
* *
...@@ -786,9 +788,9 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block) ...@@ -786,9 +788,9 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
/* /*
* Initialize the GPE Register and Event structures. A goal of these * Initialize the GPE Register and Event structures. A goal of these
* tables is to hide the fact that there are two separate GPE register sets * tables is to hide the fact that there are two separate GPE register
* in a given GPE hardware block, the status registers occupy the first half, * sets in a given GPE hardware block, the status registers occupy the
* and the enable registers occupy the second half. * first half, and the enable registers occupy the second half.
*/ */
this_register = gpe_register_info; this_register = gpe_register_info;
this_event = gpe_event_info; this_event = gpe_event_info;
......
...@@ -148,7 +148,9 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, ...@@ -148,7 +148,9 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
break; break;
default: default:
/* All other types are not supported */ /* All other types are not supported */
return (AE_TYPE); return (AE_TYPE);
} }
} }
...@@ -189,9 +191,8 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, ...@@ -189,9 +191,8 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
acpi_ut_delete_generic_state(notify_info); acpi_ut_delete_generic_state(notify_info);
} }
} else { } else {
/* /* There is no notify handler (per-device or system) for this device */
* There is no notify handler (per-device or system) for this device.
*/
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"No notify handler for Notify (%4.4s, %X) node %p\n", "No notify handler for Notify (%4.4s, %X) node %p\n",
acpi_ut_get_node_name(node), notify_value, acpi_ut_get_node_name(node), notify_value,
...@@ -225,9 +226,8 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context) ...@@ -225,9 +226,8 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context)
ACPI_FUNCTION_ENTRY(); ACPI_FUNCTION_ENTRY();
/* /*
* We will invoke a global notify handler if installed. * We will invoke a global notify handler if installed. This is done
* This is done _before_ we invoke the per-device handler attached * _before_ we invoke the per-device handler attached to the device.
* to the device.
*/ */
if (notify_info->notify.value <= ACPI_MAX_SYS_NOTIFY) { if (notify_info->notify.value <= ACPI_MAX_SYS_NOTIFY) {
...@@ -339,11 +339,10 @@ acpi_status acpi_ev_init_global_lock_handler(void) ...@@ -339,11 +339,10 @@ acpi_status acpi_ev_init_global_lock_handler(void)
NULL); NULL);
/* /*
* If the global lock does not exist on this platform, the attempt * If the global lock does not exist on this platform, the attempt to
* to enable GBL_STATUS will fail (the GBL_ENABLE bit will not stick) * enable GBL_STATUS will fail (the GBL_ENABLE bit will not stick).
* Map to AE_OK, but mark global lock as not present. * Map to AE_OK, but mark global lock as not present. Any attempt to
* Any attempt to actually use the global lock will be flagged * actually use the global lock will be flagged with an error.
* with an error.
*/ */
if (status == AE_NO_HARDWARE_RESPONSE) { if (status == AE_NO_HARDWARE_RESPONSE) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
...@@ -452,8 +451,8 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout) ...@@ -452,8 +451,8 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout)
} }
/* /*
* Make sure that a global lock actually exists. If not, just treat * Make sure that a global lock actually exists. If not, just treat the
* the lock as a standard mutex. * lock as a standard mutex.
*/ */
if (!acpi_gbl_global_lock_present) { if (!acpi_gbl_global_lock_present) {
acpi_gbl_global_lock_acquired = TRUE; acpi_gbl_global_lock_acquired = TRUE;
...@@ -572,8 +571,8 @@ void acpi_ev_terminate(void) ...@@ -572,8 +571,8 @@ void acpi_ev_terminate(void)
if (acpi_gbl_events_initialized) { if (acpi_gbl_events_initialized) {
/* /*
* Disable all event-related functionality. * Disable all event-related functionality. In all cases, on error,
* In all cases, on error, print a message but obviously we don't abort. * print a message but obviously we don't abort.
*/ */
/* Disable all fixed events */ /* Disable all fixed events */
......
...@@ -48,16 +48,8 @@ ...@@ -48,16 +48,8 @@
#define _COMPONENT ACPI_EVENTS #define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME("evregion") ACPI_MODULE_NAME("evregion")
#define ACPI_NUM_DEFAULT_SPACES 4
static u8 acpi_gbl_default_address_spaces[ACPI_NUM_DEFAULT_SPACES] = {
ACPI_ADR_SPACE_SYSTEM_MEMORY,
ACPI_ADR_SPACE_SYSTEM_IO,
ACPI_ADR_SPACE_PCI_CONFIG,
ACPI_ADR_SPACE_DATA_TABLE
};
/* Local prototypes */ /* Local prototypes */
static acpi_status static acpi_status
acpi_ev_reg_run(acpi_handle obj_handle, acpi_ev_reg_run(acpi_handle obj_handle,
u32 level, void *context, void **return_value); u32 level, void *context, void **return_value);
...@@ -66,6 +58,17 @@ static acpi_status ...@@ -66,6 +58,17 @@ static acpi_status
acpi_ev_install_handler(acpi_handle obj_handle, acpi_ev_install_handler(acpi_handle obj_handle,
u32 level, void *context, void **return_value); u32 level, void *context, void **return_value);
/* These are the address spaces that will get default handlers */
#define ACPI_NUM_DEFAULT_SPACES 4
static u8 acpi_gbl_default_address_spaces[ACPI_NUM_DEFAULT_SPACES] = {
ACPI_ADR_SPACE_SYSTEM_MEMORY,
ACPI_ADR_SPACE_SYSTEM_IO,
ACPI_ADR_SPACE_PCI_CONFIG,
ACPI_ADR_SPACE_DATA_TABLE
};
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_ev_install_region_handlers * FUNCTION: acpi_ev_install_region_handlers
...@@ -91,18 +94,19 @@ acpi_status acpi_ev_install_region_handlers(void) ...@@ -91,18 +94,19 @@ acpi_status acpi_ev_install_region_handlers(void)
} }
/* /*
* All address spaces (PCI Config, EC, SMBus) are scope dependent * All address spaces (PCI Config, EC, SMBus) are scope dependent and
* and registration must occur for a specific device. * registration must occur for a specific device.
* *
* In the case of the system memory and IO address spaces there is currently * In the case of the system memory and IO address spaces there is
* no device associated with the address space. For these we use the root. * currently no device associated with the address space. For these we
* use the root.
* *
* We install the default PCI config space handler at the root so * We install the default PCI config space handler at the root so that
* that this space is immediately available even though the we have * this space is immediately available even though the we have not
* not enumerated all the PCI Root Buses yet. This is to conform * enumerated all the PCI Root Buses yet. This is to conform to the ACPI
* to the ACPI specification which states that the PCI config * specification which states that the PCI config space must be always
* space must be always available -- even though we are nowhere * available -- even though we are nowhere near ready to find the PCI root
* near ready to find the PCI root buses at this point. * buses at this point.
* *
* NOTE: We ignore AE_ALREADY_EXISTS because this means that a handler * NOTE: We ignore AE_ALREADY_EXISTS because this means that a handler
* has already been installed (via acpi_install_address_space_handler). * has already been installed (via acpi_install_address_space_handler).
...@@ -160,12 +164,11 @@ acpi_status acpi_ev_initialize_op_regions(void) ...@@ -160,12 +164,11 @@ acpi_status acpi_ev_initialize_op_regions(void)
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
/* /* Run the _REG methods for op_regions in each default address space */
* Run the _REG methods for op_regions in each default address space
*/
for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++) {
/* TBD: Make sure handler is the DEFAULT handler, otherwise for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++) {
/*
* TBD: Make sure handler is the DEFAULT handler, otherwise
* _REG will have already been run. * _REG will have already been run.
*/ */
status = acpi_ev_execute_reg_methods(acpi_gbl_root_node, status = acpi_ev_execute_reg_methods(acpi_gbl_root_node,
...@@ -318,13 +321,13 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, ...@@ -318,13 +321,13 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
} }
/* /*
* It may be the case that the region has never been initialized * It may be the case that the region has never been initialized.
* Some types of regions require special init code * Some types of regions require special init code
*/ */
if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) { if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) {
/*
* This region has not been initialized yet, do it /* This region has not been initialized yet, do it */
*/
region_setup = handler_desc->address_space.setup; region_setup = handler_desc->address_space.setup;
if (!region_setup) { if (!region_setup) {
...@@ -339,9 +342,9 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, ...@@ -339,9 +342,9 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
} }
/* /*
* We must exit the interpreter because the region * We must exit the interpreter because the region setup will
* setup will potentially execute control methods * potentially execute control methods (for example, the _REG method
* (e.g., _REG method for this region) * for this region)
*/ */
acpi_ex_exit_interpreter(); acpi_ex_exit_interpreter();
...@@ -364,9 +367,8 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, ...@@ -364,9 +367,8 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
/* /* Region initialization may have been completed by region_setup */
* Region initialization may have been completed by region_setup
*/
if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) { if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) {
region_obj->region.flags |= AOPOBJ_SETUP_COMPLETE; region_obj->region.flags |= AOPOBJ_SETUP_COMPLETE;
...@@ -521,8 +523,8 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj, ...@@ -521,8 +523,8 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
} }
/* /*
* If the region has been activated, call the setup handler * If the region has been activated, call the setup handler with
* with the deactivate notification * the deactivate notification
*/ */
if (region_obj->region.flags & AOPOBJ_SETUP_COMPLETE) { if (region_obj->region.flags & AOPOBJ_SETUP_COMPLETE) {
region_setup = handler_obj->address_space.setup; region_setup = handler_obj->address_space.setup;
...@@ -668,8 +670,8 @@ acpi_ev_install_handler(acpi_handle obj_handle, ...@@ -668,8 +670,8 @@ acpi_ev_install_handler(acpi_handle obj_handle,
} }
/* /*
* We only care about regions.and objects * We only care about regions and objects that are allowed to have
* that are allowed to have address space handlers * address space handlers
*/ */
if ((node->type != ACPI_TYPE_DEVICE) && if ((node->type != ACPI_TYPE_DEVICE) &&
(node->type != ACPI_TYPE_REGION) && (node != acpi_gbl_root_node)) { (node->type != ACPI_TYPE_REGION) && (node != acpi_gbl_root_node)) {
...@@ -710,9 +712,9 @@ acpi_ev_install_handler(acpi_handle obj_handle, ...@@ -710,9 +712,9 @@ acpi_ev_install_handler(acpi_handle obj_handle,
/* /*
* Since the object we found it on was a device, then it * Since the object we found it on was a device, then it
* means that someone has already installed a handler for * means that someone has already installed a handler for
* the branch of the namespace from this device on. Just * the branch of the namespace from this device on. Just
* bail out telling the walk routine to not traverse this * bail out telling the walk routine to not traverse this
* branch. This preserves the scoping rule for handlers. * branch. This preserves the scoping rule for handlers.
*/ */
return (AE_CTRL_DEPTH); return (AE_CTRL_DEPTH);
} }
...@@ -723,9 +725,8 @@ acpi_ev_install_handler(acpi_handle obj_handle, ...@@ -723,9 +725,8 @@ acpi_ev_install_handler(acpi_handle obj_handle,
} }
/* /*
* As long as the device didn't have a handler for this * As long as the device didn't have a handler for this space we
* space we don't care about it. We just ignore it and * don't care about it. We just ignore it and proceed.
* proceed.
*/ */
return (AE_OK); return (AE_OK);
} }
...@@ -733,16 +734,14 @@ acpi_ev_install_handler(acpi_handle obj_handle, ...@@ -733,16 +734,14 @@ acpi_ev_install_handler(acpi_handle obj_handle,
/* Object is a Region */ /* Object is a Region */
if (obj_desc->region.space_id != handler_obj->address_space.space_id) { if (obj_desc->region.space_id != handler_obj->address_space.space_id) {
/*
* This region is for a different address space /* This region is for a different address space, just ignore it */
* -- just ignore it
*/
return (AE_OK); return (AE_OK);
} }
/* /*
* Now we have a region and it is for the handler's address * Now we have a region and it is for the handler's address space type.
* space type.
* *
* First disconnect region for any previous handler (if any) * First disconnect region for any previous handler (if any)
*/ */
...@@ -786,9 +785,8 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node, ...@@ -786,9 +785,8 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
ACPI_FUNCTION_TRACE(ev_install_space_handler); ACPI_FUNCTION_TRACE(ev_install_space_handler);
/* /*
* This registration is valid for only the types below * This registration is valid for only the types below and the root. This
* and the root. This is where the default handlers * is where the default handlers get placed.
* get placed.
*/ */
if ((node->type != ACPI_TYPE_DEVICE) && if ((node->type != ACPI_TYPE_DEVICE) &&
(node->type != ACPI_TYPE_PROCESSOR) && (node->type != ACPI_TYPE_PROCESSOR) &&
...@@ -848,8 +846,8 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node, ...@@ -848,8 +846,8 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
obj_desc = acpi_ns_get_attached_object(node); obj_desc = acpi_ns_get_attached_object(node);
if (obj_desc) { if (obj_desc) {
/* /*
* The attached device object already exists. * The attached device object already exists. Make sure the handler
* Make sure the handler is not already installed. * is not already installed.
*/ */
handler_obj = obj_desc->device.handler; handler_obj = obj_desc->device.handler;
...@@ -864,8 +862,8 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node, ...@@ -864,8 +862,8 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
handler) { handler) {
/* /*
* It is (relatively) OK to attempt to install the SAME * It is (relatively) OK to attempt to install the SAME
* handler twice. This can easily happen * handler twice. This can easily happen with the
* with PCI_Config space. * PCI_Config space.
*/ */
status = AE_SAME_HANDLER; status = AE_SAME_HANDLER;
goto unlock_and_exit; goto unlock_and_exit;
...@@ -925,9 +923,8 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node, ...@@ -925,9 +923,8 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
/* /*
* Install the handler * Install the handler
* *
* At this point there is no existing handler. * At this point there is no existing handler. Just allocate the object
* Just allocate the object for the handler and link it * for the handler and link it into the list.
* into the list.
*/ */
handler_obj = handler_obj =
acpi_ut_create_internal_object(ACPI_TYPE_LOCAL_ADDRESS_HANDLER); acpi_ut_create_internal_object(ACPI_TYPE_LOCAL_ADDRESS_HANDLER);
...@@ -1000,11 +997,10 @@ acpi_ev_execute_reg_methods(struct acpi_namespace_node *node, ...@@ -1000,11 +997,10 @@ acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
ACPI_FUNCTION_TRACE(ev_execute_reg_methods); ACPI_FUNCTION_TRACE(ev_execute_reg_methods);
/* /*
* Run all _REG methods for all Operation Regions for this * Run all _REG methods for all Operation Regions for this space ID. This
* space ID. This is a separate walk in order to handle any * is a separate walk in order to handle any interdependencies between
* interdependencies between regions and _REG methods. (i.e. handlers * regions and _REG methods. (i.e. handlers must be installed for all
* must be installed for all regions of this Space ID before we * regions of this Space ID before we can run any _REG methods)
* can run any _REG methods)
*/ */
status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, node, ACPI_UINT32_MAX, status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, node, ACPI_UINT32_MAX,
ACPI_NS_WALK_UNLOCK, acpi_ev_reg_run, ACPI_NS_WALK_UNLOCK, acpi_ev_reg_run,
...@@ -1042,8 +1038,8 @@ acpi_ev_reg_run(acpi_handle obj_handle, ...@@ -1042,8 +1038,8 @@ acpi_ev_reg_run(acpi_handle obj_handle,
} }
/* /*
* We only care about regions.and objects * We only care about regions.and objects that are allowed to have address
* that are allowed to have address space handlers * space handlers
*/ */
if ((node->type != ACPI_TYPE_REGION) && (node != acpi_gbl_root_node)) { if ((node->type != ACPI_TYPE_REGION) && (node != acpi_gbl_root_node)) {
return (AE_OK); return (AE_OK);
...@@ -1062,10 +1058,9 @@ acpi_ev_reg_run(acpi_handle obj_handle, ...@@ -1062,10 +1058,9 @@ acpi_ev_reg_run(acpi_handle obj_handle,
/* Object is a Region */ /* Object is a Region */
if (obj_desc->region.space_id != space_id) { if (obj_desc->region.space_id != space_id) {
/*
* This region is for a different address space /* This region is for a different address space, just ignore it */
* -- just ignore it
*/
return (AE_OK); return (AE_OK);
} }
......
...@@ -233,9 +233,9 @@ acpi_ev_pci_config_region_setup(acpi_handle handle, ...@@ -233,9 +233,9 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
if (status == AE_SAME_HANDLER) { if (status == AE_SAME_HANDLER) {
/* /*
* It is OK if the handler is already installed on the root * It is OK if the handler is already installed on the
* bridge. Still need to return a context object for the * root bridge. Still need to return a context object
* new PCI_Config operation region, however. * for the new PCI_Config operation region, however.
*/ */
status = AE_OK; status = AE_OK;
} else { } else {
...@@ -272,8 +272,8 @@ acpi_ev_pci_config_region_setup(acpi_handle handle, ...@@ -272,8 +272,8 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
} }
/* /*
* For PCI_Config space access, we need the segment, bus, * For PCI_Config space access, we need the segment, bus, device and
* device and function numbers. Acquire them here. * function numbers. Acquire them here.
* *
* Find the parent device object. (This allows the operation region to be * Find the parent device object. (This allows the operation region to be
* within a subscope under the device, such as a control method.) * within a subscope under the device, such as a control method.)
...@@ -289,16 +289,16 @@ acpi_ev_pci_config_region_setup(acpi_handle handle, ...@@ -289,16 +289,16 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
} }
/* /*
* Get the PCI device and function numbers from the _ADR object * Get the PCI device and function numbers from the _ADR object contained
* contained in the parent's scope. * in the parent's scope.
*/ */
status = status =
acpi_ut_evaluate_numeric_object(METHOD_NAME__ADR, pci_device_node, acpi_ut_evaluate_numeric_object(METHOD_NAME__ADR, pci_device_node,
&pci_value); &pci_value);
/* /*
* The default is zero, and since the allocation above zeroed * The default is zero, and since the allocation above zeroed the data,
* the data, just do nothing on failure. * just do nothing on failure.
*/ */
if (ACPI_SUCCESS(status)) { if (ACPI_SUCCESS(status)) {
pci_id->device = ACPI_HIWORD(ACPI_LODWORD(pci_value)); pci_id->device = ACPI_HIWORD(ACPI_LODWORD(pci_value));
...@@ -382,9 +382,8 @@ static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node) ...@@ -382,9 +382,8 @@ static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node)
struct acpi_compatible_id_list *cid; struct acpi_compatible_id_list *cid;
u32 i; u32 i;
/* /* Get the _HID and check for a PCI Root Bridge */
* Get the _HID and check for a PCI Root Bridge
*/
status = acpi_ut_execute_HID(node, &hid); status = acpi_ut_execute_HID(node, &hid);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return (FALSE); return (FALSE);
...@@ -394,10 +393,8 @@ static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node) ...@@ -394,10 +393,8 @@ static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node)
return (TRUE); return (TRUE);
} }
/* /* The _HID did not match. Get the _CID and check for a PCI Root Bridge */
* The _HID did not match.
* Get the _CID and check for a PCI Root Bridge
*/
status = acpi_ut_execute_CID(node, &cid); status = acpi_ut_execute_CID(node, &cid);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return (FALSE); return (FALSE);
...@@ -516,9 +513,9 @@ acpi_ev_default_region_setup(acpi_handle handle, ...@@ -516,9 +513,9 @@ acpi_ev_default_region_setup(acpi_handle handle,
* Get the appropriate address space handler for a newly * Get the appropriate address space handler for a newly
* created region. * created region.
* *
* This also performs address space specific initialization. For * This also performs address space specific initialization. For
* example, PCI regions must have an _ADR object that contains * example, PCI regions must have an _ADR object that contains
* a PCI address in the scope of the definition. This address is * a PCI address in the scope of the definition. This address is
* required to perform an access to PCI config space. * required to perform an access to PCI config space.
* *
* MUTEX: Interpreter should be unlocked, because we may run the _REG * MUTEX: Interpreter should be unlocked, because we may run the _REG
...@@ -572,7 +569,7 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj, ...@@ -572,7 +569,7 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
if (ACPI_SUCCESS(status)) { if (ACPI_SUCCESS(status)) {
/* /*
* The _REG method is optional and there can be only one per region * The _REG method is optional and there can be only one per region
* definition. This will be executed when the handler is attached * definition. This will be executed when the handler is attached
* or removed * or removed
*/ */
region_obj2->extra.method_REG = method_node; region_obj2->extra.method_REG = method_node;
...@@ -670,10 +667,8 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj, ...@@ -670,10 +667,8 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
} }
} }
/* /* This node does not have the handler we need; Pop up one level */
* This node does not have the handler we need;
* Pop up one level
*/
node = acpi_ns_get_parent_node(node); node = acpi_ns_get_parent_node(node);
} }
......
...@@ -115,10 +115,8 @@ u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context) ...@@ -115,10 +115,8 @@ u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context)
* if this interrupt handler is installed, ACPI is enabled. * if this interrupt handler is installed, ACPI is enabled.
*/ */
/* /* GPEs: Check for and dispatch any GPEs that have occurred */
* GPEs:
* Check for and dispatch any GPEs that have occurred
*/
interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list); interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);
return_UINT32(interrupt_handled); return_UINT32(interrupt_handled);
...@@ -158,11 +156,11 @@ u32 acpi_ev_install_sci_handler(void) ...@@ -158,11 +156,11 @@ u32 acpi_ev_install_sci_handler(void)
* RETURN: E_OK if handler uninstalled OK, E_ERROR if handler was not * RETURN: E_OK if handler uninstalled OK, E_ERROR if handler was not
* installed to begin with * installed to begin with
* *
* DESCRIPTION: Remove the SCI interrupt handler. No further SCIs will be * DESCRIPTION: Remove the SCI interrupt handler. No further SCIs will be
* taken. * taken.
* *
* Note: It doesn't seem important to disable all events or set the event * Note: It doesn't seem important to disable all events or set the event
* enable registers to their original values. The OS should disable * enable registers to their original values. The OS should disable
* the SCI interrupt level when the handler is removed, so no more * the SCI interrupt level when the handler is removed, so no more
* events will come in. * events will come in.
* *
......
...@@ -267,7 +267,7 @@ acpi_install_notify_handler(acpi_handle device, ...@@ -267,7 +267,7 @@ acpi_install_notify_handler(acpi_handle device,
/* /*
* Root Object: * Root Object:
* Registering a notify handler on the root object indicates that the * Registering a notify handler on the root object indicates that the
* caller wishes to receive notifications for all objects. Note that * caller wishes to receive notifications for all objects. Note that
* only one <external> global handler can be regsitered (per notify type). * only one <external> global handler can be regsitered (per notify type).
*/ */
if (device == ACPI_ROOT_OBJECT) { if (device == ACPI_ROOT_OBJECT) {
......
...@@ -161,8 +161,8 @@ acpi_status acpi_enable_event(u32 event, u32 flags) ...@@ -161,8 +161,8 @@ acpi_status acpi_enable_event(u32 event, u32 flags)
} }
/* /*
* Enable the requested fixed event (by writing a one to the * Enable the requested fixed event (by writing a one to the enable
* enable register bit) * register bit)
*/ */
status = status =
acpi_set_register(acpi_gbl_fixed_event_info[event]. acpi_set_register(acpi_gbl_fixed_event_info[event].
...@@ -343,8 +343,8 @@ acpi_status acpi_disable_event(u32 event, u32 flags) ...@@ -343,8 +343,8 @@ acpi_status acpi_disable_event(u32 event, u32 flags)
} }
/* /*
* Disable the requested fixed event (by writing a zero to the * Disable the requested fixed event (by writing a zero to the enable
* enable register bit) * register bit)
*/ */
status = status =
acpi_set_register(acpi_gbl_fixed_event_info[event]. acpi_set_register(acpi_gbl_fixed_event_info[event].
...@@ -396,8 +396,8 @@ acpi_status acpi_clear_event(u32 event) ...@@ -396,8 +396,8 @@ acpi_status acpi_clear_event(u32 event)
} }
/* /*
* Clear the requested fixed event (By writing a one to the * Clear the requested fixed event (By writing a one to the status
* status register bit) * register bit)
*/ */
status = status =
acpi_set_register(acpi_gbl_fixed_event_info[event]. acpi_set_register(acpi_gbl_fixed_event_info[event].
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册