Rework GPE handling slightly
PATCH 1/1 Rework GPE handling slightly
This patch modularises the ACPI code a little by reducing use of acpi_gbl_gpe_register_info and eliminating use of acpi_gbl_gpe_number_info in hardware/ . It also reduces compiled code size by 110 bytes on x86. This patch is against 2.5.59 -- would it be better to prepare against a different tree?
drivers/acpi/events/evmisc.c +35 -7
@@ -67,27 +67,55 @@ acpi_ev_is_notify_object (/******************************************************************************* * -* FUNCTION: acpi_ev_get_gpe_register_index +* FUNCTION: acpi_ev_get_gpe_register_info * * PARAMETERS: gpe_number - Raw GPE number * * RETURN: None. * -* DESCRIPTION: Returns the register index (index into the GPE register info -* table) associated with this GPE. +* DESCRIPTION: Returns the register info entry associated with this GPE. * ******************************************************************************/ -u32 -acpi_ev_get_gpe_register_index ( +struct acpi_gpe_register_info * +acpi_ev_get_gpe_register_info (u32 gpe_number) { +u32 register_index;if (gpe_number > acpi_gbl_gpe_number_max) { -return (ACPI_GPE_INVALID ); +return NULL ; + } + + register_index =ACPI_DIV_8 (acpi_gbl_gpe_number_to_index[gpe_number].number_index); +return &acpi_gbl_gpe_register_info[register_index]; +} + + +/******************************************************************************* +* +* FUNCTION: acpi_ev_get_gpe_number_info +* +* PARAMETERS: gpe_number - Raw GPE number +* +* RETURN: None. +* +* DESCRIPTION: Returns the number info entry associated with this GPE. +* +******************************************************************************/ + +struct acpi_gpe_number_info * +acpi_ev_get_gpe_number_info ( +u32 gpe_number) +{ +u32 register_index; + +if (gpe_number > acpi_gbl_gpe_number_max) { +return NULL ; } -return (ACPI_DIV_8 (acpi_gbl_gpe_number_to_index[gpe_number].number_index)); + register_index =ACPI_DIV_8 (acpi_gbl_gpe_number_to_index[gpe_number].number_index); +return &acpi_gbl_gpe_number_info[register_index]; }
drivers/acpi/hardware/hwgpe.c +52 -84
279 lines not on this page · raw message
drivers/acpi/include/acevents.h +6 -2
@@ -72,8 +72,12 @@ acpi_statusacpi_ev_init_global_lock_handler ( void); -u32 -acpi_ev_get_gpe_register_index ( +struct acpi_gpe_register_info * +acpi_ev_get_gpe_register_info ( +u32 gpe_number); + +struct acpi_gpe_number_info * +acpi_ev_get_gpe_number_info (u32 gpe_number); u32
drivers/acpi/include/achware.h +0 -4
@@ -96,10 +96,6 @@ acpi_hw_clear_acpi_status (/* GPE support */ -u8 -acpi_hw_get_gpe_bit_mask ( -u32 gpe_number); -acpi_status acpi_hw_enable_gpe (u32 gpe_number);
Signature · 9 lines
"It's not Hollywood. War is real, war is primarily not about defeat or victory, it is about death. I've seen thousands and thousands of dead bodies. Do you think I want to have an academic debate on this subject?" -- Robert Fisk ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com