From e5ec23ca4a9588a0bcc1ac86db3617bcdbcfb003 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Tue, 31 Jan 2012 13:19:19 -0500 Subject: [PATCH] --- yaml --- r: 298006 b: refs/heads/master c: f2d4753fbd4d15c65d6ba48167aa83916ddbe518 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/acpi/acpica/Makefile | 4 +- trunk/drivers/acpi/acpica/accommon.h | 1 + .../acpi => drivers/acpi/acpica}/acconfig.h | 19 +- trunk/drivers/acpi/acpica/acdebug.h | 8 +- trunk/drivers/acpi/acpica/acevents.h | 21 +- trunk/drivers/acpi/acpica/acglobal.h | 11 +- trunk/drivers/acpi/acpica/achware.h | 32 +- trunk/drivers/acpi/acpica/aclocal.h | 1 - trunk/drivers/acpi/acpica/acmacros.h | 6 - trunk/drivers/acpi/acpica/acnamesp.h | 5 +- trunk/drivers/acpi/acpica/actables.h | 5 - trunk/drivers/acpi/acpica/evevent.c | 4 +- trunk/drivers/acpi/acpica/evglock.c | 4 +- trunk/drivers/acpi/acpica/evgpe.c | 4 +- trunk/drivers/acpi/acpica/evgpeblk.c | 4 +- trunk/drivers/acpi/acpica/evgpeinit.c | 4 +- trunk/drivers/acpi/acpica/evgpeutil.c | 3 - trunk/drivers/acpi/acpica/evmisc.c | 26 +- trunk/drivers/acpi/acpica/evsci.c | 4 +- trunk/drivers/acpi/acpica/evxface.c | 436 +++++++++--------- trunk/drivers/acpi/acpica/evxfevnt.c | 2 - trunk/drivers/acpi/acpica/evxfgpe.c | 2 - trunk/drivers/acpi/acpica/hwacpi.c | 3 - trunk/drivers/acpi/acpica/hwesleep.c | 247 ---------- trunk/drivers/acpi/acpica/hwgpe.c | 4 +- trunk/drivers/acpi/acpica/hwregs.c | 16 +- trunk/drivers/acpi/acpica/hwsleep.c | 391 +++++++++++++--- trunk/drivers/acpi/acpica/hwtimer.c | 2 - trunk/drivers/acpi/acpica/hwxface.c | 47 +- trunk/drivers/acpi/acpica/hwxfsleep.c | 431 ----------------- trunk/drivers/acpi/acpica/nsdump.c | 15 +- trunk/drivers/acpi/acpica/nsdumpdv.c | 2 +- trunk/drivers/acpi/acpica/nspredef.c | 4 +- trunk/drivers/acpi/acpica/nsrepair.c | 159 ++++--- trunk/drivers/acpi/acpica/nsutils.c | 2 +- trunk/drivers/acpi/acpica/tbinstal.c | 117 +---- trunk/drivers/acpi/acpica/tbutils.c | 95 ++-- trunk/drivers/acpi/acpica/utdecode.c | 34 +- trunk/drivers/acpi/acpica/utglobal.c | 9 +- trunk/drivers/acpi/acpica/utinit.c | 37 +- trunk/drivers/acpi/acpica/utxface.c | 6 +- trunk/drivers/acpi/apei/apei-base.c | 4 +- trunk/drivers/acpi/bus.c | 1 + trunk/drivers/acpi/osl.c | 95 +++- trunk/drivers/acpi/sleep.c | 41 +- trunk/include/acpi/acexcep.h | 6 +- trunk/include/acpi/acnames.h | 12 +- trunk/include/acpi/acpiosxf.h | 13 +- trunk/include/acpi/acpixf.h | 229 +++------ trunk/include/acpi/actbl.h | 7 - trunk/include/acpi/actypes.h | 22 +- 52 files changed, 999 insertions(+), 1660 deletions(-) rename trunk/{include/acpi => drivers/acpi/acpica}/acconfig.h (92%) delete mode 100644 trunk/drivers/acpi/acpica/hwesleep.c delete mode 100644 trunk/drivers/acpi/acpica/hwxfsleep.c diff --git a/[refs] b/[refs] index 63a0339b6f77..e70f2eb16dde 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5aa3c16c6b196857ea24ec1c589e3db3c4c64c96 +refs/heads/master: f2d4753fbd4d15c65d6ba48167aa83916ddbe518 diff --git a/trunk/drivers/acpi/acpica/Makefile b/trunk/drivers/acpi/acpica/Makefile index 793b8cc8e256..0ca208b6dcf0 100644 --- a/trunk/drivers/acpi/acpica/Makefile +++ b/trunk/drivers/acpi/acpica/Makefile @@ -68,14 +68,12 @@ acpi-y += \ acpi-y += \ hwacpi.o \ - hwesleep.o \ hwgpe.o \ hwpci.o \ hwregs.o \ hwsleep.o \ hwvalid.o \ - hwxface.o \ - hwxfsleep.o + hwxface.o acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o diff --git a/trunk/drivers/acpi/acpica/accommon.h b/trunk/drivers/acpi/acpica/accommon.h index 8a7d51bfb3b3..a44bd424f9f4 100644 --- a/trunk/drivers/acpi/acpica/accommon.h +++ b/trunk/drivers/acpi/acpica/accommon.h @@ -51,6 +51,7 @@ * * Note: The order of these include files is important. */ +#include "acconfig.h" /* Global configuration constants */ #include "acmacros.h" /* C macros */ #include "aclocal.h" /* Internal data types */ #include "acobject.h" /* ACPI internal object */ diff --git a/trunk/include/acpi/acconfig.h b/trunk/drivers/acpi/acpica/acconfig.h similarity index 92% rename from trunk/include/acpi/acconfig.h rename to trunk/drivers/acpi/acpica/acconfig.h index 03f14856bd09..1f30af613e87 100644 --- a/trunk/include/acpi/acconfig.h +++ b/trunk/drivers/acpi/acpica/acconfig.h @@ -85,23 +85,6 @@ */ #define ACPI_CHECKSUM_ABORT FALSE -/* - * Generate a version of ACPICA that only supports "reduced hardware" - * platforms (as defined in ACPI 5.0). Set to TRUE to generate a specialized - * version of ACPICA that ONLY supports the ACPI 5.0 "reduced hardware" - * model. In other words, no ACPI hardware is supported. - * - * If TRUE, this means no support for the following: - * PM Event and Control registers - * SCI interrupt (and handler) - * Fixed Events - * General Purpose Events (GPEs) - * Global Lock - * ACPI PM timer - * FACS table (Waking vectors and Global Lock) - */ -#define ACPI_REDUCED_HARDWARE FALSE - /****************************************************************************** * * Subsystem Constants @@ -110,7 +93,7 @@ /* Version of ACPI supported */ -#define ACPI_CA_SUPPORT_LEVEL 5 +#define ACPI_CA_SUPPORT_LEVEL 3 /* Maximum count for a semaphore object */ diff --git a/trunk/drivers/acpi/acpica/acdebug.h b/trunk/drivers/acpi/acpica/acdebug.h index 5e8abb07724f..deaa81979561 100644 --- a/trunk/drivers/acpi/acpica/acdebug.h +++ b/trunk/drivers/acpi/acpica/acdebug.h @@ -111,7 +111,7 @@ acpi_status acpi_db_find_name_in_namespace(char *name_arg); void acpi_db_set_scope(char *name); -ACPI_HW_DEPENDENT_RETURN_OK(acpi_status acpi_db_sleep(char *object_arg)) +acpi_status acpi_db_sleep(char *object_arg); void acpi_db_find_references(char *object_arg); @@ -119,13 +119,11 @@ void acpi_db_display_locks(void); void acpi_db_display_resources(char *object_arg); -ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_db_display_gpes(void)) +void acpi_db_display_gpes(void); void acpi_db_check_integrity(void); -ACPI_HW_DEPENDENT_RETURN_VOID(void - acpi_db_generate_gpe(char *gpe_arg, - char *block_arg)) +void acpi_db_generate_gpe(char *gpe_arg, char *block_arg); void acpi_db_check_predefined_names(void); diff --git a/trunk/drivers/acpi/acpica/acevents.h b/trunk/drivers/acpi/acpica/acevents.h index d700f63e4701..c53caa521a30 100644 --- a/trunk/drivers/acpi/acpica/acevents.h +++ b/trunk/drivers/acpi/acpica/acevents.h @@ -69,10 +69,11 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node *node, */ acpi_status acpi_ev_init_global_lock_handler(void); -ACPI_HW_DEPENDENT_RETURN_OK(acpi_status - acpi_ev_acquire_global_lock(u16 timeout)) - ACPI_HW_DEPENDENT_RETURN_OK(acpi_status acpi_ev_release_global_lock(void)) - acpi_status acpi_ev_remove_global_lock_handler(void); +acpi_status acpi_ev_acquire_global_lock(u16 timeout); + +acpi_status acpi_ev_release_global_lock(void); + +acpi_status acpi_ev_remove_global_lock_handler(void); /* * evgpe - Low-level GPE support @@ -113,9 +114,7 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, struct acpi_gpe_block_info *gpe_block, void *context); -ACPI_HW_DEPENDENT_RETURN_OK(acpi_status - acpi_ev_delete_gpe_block(struct acpi_gpe_block_info - *gpe_block)) +acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block); u32 acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device, @@ -127,10 +126,9 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device, */ acpi_status acpi_ev_gpe_initialize(void); -ACPI_HW_DEPENDENT_RETURN_VOID(void - acpi_ev_update_gpes(acpi_owner_id table_owner_id)) +void acpi_ev_update_gpes(acpi_owner_id table_owner_id); - acpi_status +acpi_status acpi_ev_match_gpe_method(acpi_handle obj_handle, u32 level, void *context, void **return_value); @@ -239,5 +237,6 @@ acpi_status acpi_ev_remove_sci_handler(void); u32 acpi_ev_initialize_sCI(u32 program_sCI); -ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_ev_terminate(void)) +void acpi_ev_terminate(void); + #endif /* __ACEVENTS_H__ */ diff --git a/trunk/drivers/acpi/acpica/acglobal.h b/trunk/drivers/acpi/acpica/acglobal.h index 4f7d3f57d05c..2853f7673f3b 100644 --- a/trunk/drivers/acpi/acpica/acglobal.h +++ b/trunk/drivers/acpi/acpica/acglobal.h @@ -147,7 +147,7 @@ u8 acpi_gbl_system_awake_and_running; */ u8 acpi_gbl_reduced_hardware; -#endif /* DEFINE_ACPI_GLOBALS */ +#endif /* Do not disassemble buffers to resource descriptors */ @@ -184,12 +184,8 @@ ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer; * found in the RSDT/XSDT. */ ACPI_EXTERN struct acpi_table_list acpi_gbl_root_table_list; - -#if (!ACPI_REDUCED_HARDWARE) ACPI_EXTERN struct acpi_table_facs *acpi_gbl_FACS; -#endif /* !ACPI_REDUCED_HARDWARE */ - /* These addresses are calculated from the FADT Event Block addresses */ ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_status; @@ -401,15 +397,10 @@ ACPI_EXTERN struct acpi_fixed_event_handler ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; ACPI_EXTERN struct acpi_gpe_block_info *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; - -#if (!ACPI_REDUCED_HARDWARE) - ACPI_EXTERN u8 acpi_gbl_all_gpes_initialized; ACPI_EXTERN ACPI_GBL_EVENT_HANDLER acpi_gbl_global_event_handler; ACPI_EXTERN void *acpi_gbl_global_event_handler_context; -#endif /* !ACPI_REDUCED_HARDWARE */ - /***************************************************************************** * * Debugger globals diff --git a/trunk/drivers/acpi/acpica/achware.h b/trunk/drivers/acpi/acpica/achware.h index 5ccb99ae3a6f..677793e938f5 100644 --- a/trunk/drivers/acpi/acpica/achware.h +++ b/trunk/drivers/acpi/acpica/achware.h @@ -80,26 +80,6 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value); acpi_status acpi_hw_clear_acpi_status(void); -/* - * hwsleep - sleep/wake support (Legacy sleep registers) - */ -acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags); - -acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state, u8 flags); - -acpi_status acpi_hw_legacy_wake(u8 sleep_state, u8 flags); - -/* - * hwesleep - sleep/wake support (Extended FADT-V5 sleep registers) - */ -void acpi_hw_execute_sleep_method(char *method_name, u32 integer_argument); - -acpi_status acpi_hw_extended_sleep(u8 sleep_state, u8 flags); - -acpi_status acpi_hw_extended_wake_prep(u8 sleep_state, u8 flags); - -acpi_status acpi_hw_extended_wake(u8 sleep_state, u8 flags); - /* * hwvalid - Port I/O with validation */ @@ -148,4 +128,16 @@ acpi_status acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id, acpi_handle root_pci_device, acpi_handle pci_region); +#ifdef ACPI_FUTURE_USAGE +/* + * hwtimer - ACPI Timer prototypes + */ +acpi_status acpi_get_timer_resolution(u32 * resolution); + +acpi_status acpi_get_timer(u32 * ticks); + +acpi_status +acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed); +#endif /* ACPI_FUTURE_USAGE */ + #endif /* __ACHWARE_H__ */ diff --git a/trunk/drivers/acpi/acpica/aclocal.h b/trunk/drivers/acpi/acpica/aclocal.h index e3922ca20e7f..3f24068837d5 100644 --- a/trunk/drivers/acpi/acpica/aclocal.h +++ b/trunk/drivers/acpi/acpica/aclocal.h @@ -370,7 +370,6 @@ struct acpi_predefined_data { /* Defines for Flags field above */ #define ACPI_OBJECT_REPAIRED 1 -#define ACPI_OBJECT_WRAPPED 2 /* * Bitmapped return value types diff --git a/trunk/drivers/acpi/acpica/acmacros.h b/trunk/drivers/acpi/acpica/acmacros.h index f119f473f71a..ef338a96f5b2 100644 --- a/trunk/drivers/acpi/acpica/acmacros.h +++ b/trunk/drivers/acpi/acpica/acmacros.h @@ -516,12 +516,6 @@ #endif /* ACPI_DEBUG_OUTPUT */ -#if (!ACPI_REDUCED_HARDWARE) -#define ACPI_HW_OPTIONAL_FUNCTION(addr) addr -#else -#define ACPI_HW_OPTIONAL_FUNCTION(addr) NULL -#endif - /* * Some code only gets executed when the debugger is built in. * Note that this is entirely independent of whether the diff --git a/trunk/drivers/acpi/acpica/acnamesp.h b/trunk/drivers/acpi/acpica/acnamesp.h index 9b19d4b86424..2c9e0f049523 100644 --- a/trunk/drivers/acpi/acpica/acnamesp.h +++ b/trunk/drivers/acpi/acpica/acnamesp.h @@ -283,9 +283,8 @@ acpi_ns_repair_object(struct acpi_predefined_data *data, union acpi_operand_object **return_object_ptr); acpi_status -acpi_ns_wrap_with_package(struct acpi_predefined_data *data, - union acpi_operand_object *original_object, - union acpi_operand_object **obj_desc_ptr); +acpi_ns_repair_package_list(struct acpi_predefined_data *data, + union acpi_operand_object **obj_desc_ptr); acpi_status acpi_ns_repair_null_element(struct acpi_predefined_data *data, diff --git a/trunk/drivers/acpi/acpica/actables.h b/trunk/drivers/acpi/acpica/actables.h index 6712965ba8ae..d5bec304c823 100644 --- a/trunk/drivers/acpi/acpica/actables.h +++ b/trunk/drivers/acpi/acpica/actables.h @@ -67,11 +67,6 @@ acpi_status acpi_tb_resize_root_table_list(void); acpi_status acpi_tb_verify_table(struct acpi_table_desc *table_desc); -struct acpi_table_header *acpi_tb_table_override(struct acpi_table_header - *table_header, - struct acpi_table_desc - *table_desc); - acpi_status acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index); diff --git a/trunk/drivers/acpi/acpica/evevent.c b/trunk/drivers/acpi/acpica/evevent.c index 07e4dc44f81c..6729ebe2f1e6 100644 --- a/trunk/drivers/acpi/acpica/evevent.c +++ b/trunk/drivers/acpi/acpica/evevent.c @@ -47,7 +47,7 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME("evevent") -#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static acpi_status acpi_ev_fixed_event_initialize(void); @@ -291,5 +291,3 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event) return ((acpi_gbl_fixed_event_handlers[event]. handler) (acpi_gbl_fixed_event_handlers[event].context)); } - -#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/trunk/drivers/acpi/acpica/evglock.c b/trunk/drivers/acpi/acpica/evglock.c index cfeab38795d8..5e5683cb1f0d 100644 --- a/trunk/drivers/acpi/acpica/evglock.c +++ b/trunk/drivers/acpi/acpica/evglock.c @@ -48,7 +48,7 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME("evglock") -#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static u32 acpi_ev_global_lock_handler(void *context); @@ -339,5 +339,3 @@ acpi_status acpi_ev_release_global_lock(void) acpi_os_release_mutex(acpi_gbl_global_lock_mutex->mutex.os_mutex); return_ACPI_STATUS(status); } - -#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/trunk/drivers/acpi/acpica/evgpe.c b/trunk/drivers/acpi/acpica/evgpe.c index 8ba0e5f17091..9e88cb6fb25e 100644 --- a/trunk/drivers/acpi/acpica/evgpe.c +++ b/trunk/drivers/acpi/acpica/evgpe.c @@ -48,7 +48,7 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME("evgpe") -#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context); @@ -766,5 +766,3 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device, return_UINT32(ACPI_INTERRUPT_HANDLED); } - -#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/trunk/drivers/acpi/acpica/evgpeblk.c b/trunk/drivers/acpi/acpica/evgpeblk.c index 23a3ca86b2eb..be75339cd5dd 100644 --- a/trunk/drivers/acpi/acpica/evgpeblk.c +++ b/trunk/drivers/acpi/acpica/evgpeblk.c @@ -48,7 +48,7 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME("evgpeblk") -#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static acpi_status acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block, @@ -504,5 +504,3 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, return_ACPI_STATUS(AE_OK); } - -#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/trunk/drivers/acpi/acpica/evgpeinit.c b/trunk/drivers/acpi/acpica/evgpeinit.c index da0add858f81..adf7494da9db 100644 --- a/trunk/drivers/acpi/acpica/evgpeinit.c +++ b/trunk/drivers/acpi/acpica/evgpeinit.c @@ -48,7 +48,7 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME("evgpeinit") -#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* * Note: History of _PRW support in ACPICA * @@ -440,5 +440,3 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle, name, gpe_number)); return_ACPI_STATUS(AE_OK); } - -#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/trunk/drivers/acpi/acpica/evgpeutil.c b/trunk/drivers/acpi/acpica/evgpeutil.c index 3c43796b8361..25073932aa10 100644 --- a/trunk/drivers/acpi/acpica/evgpeutil.c +++ b/trunk/drivers/acpi/acpica/evgpeutil.c @@ -48,7 +48,6 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME("evgpeutil") -#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /******************************************************************************* * * FUNCTION: acpi_ev_walk_gpe_list @@ -375,5 +374,3 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, return_ACPI_STATUS(AE_OK); } - -#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/trunk/drivers/acpi/acpica/evmisc.c b/trunk/drivers/acpi/acpica/evmisc.c index 51ef9f5e002d..84966f416463 100644 --- a/trunk/drivers/acpi/acpica/evmisc.c +++ b/trunk/drivers/acpi/acpica/evmisc.c @@ -108,30 +108,27 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, ACPI_FUNCTION_NAME(ev_queue_notify_request); /* - * For value 0x03 (Ejection Request), may need to run a device method. - * For value 0x02 (Device Wake), if _PRW exists, may need to run - * the _PS0 method. + * For value 3 (Ejection Request), some device method may need to be run. + * For value 2 (Device Wake) if _PRW exists, the _PS0 method may need + * to be run. * For value 0x80 (Status Change) on the power button or sleep button, - * initiate soft-off or sleep operation. - * - * For all cases, simply dispatch the notify to the handler. + * initiate soft-off or sleep operation? */ ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Dispatching Notify on [%4.4s] (%s) Value 0x%2.2X (%s) Node %p\n", - acpi_ut_get_node_name(node), - acpi_ut_get_type_name(node->type), notify_value, - acpi_ut_get_notify_name(notify_value), node)); + "Dispatching Notify on [%4.4s] Node %p Value 0x%2.2X (%s)\n", + acpi_ut_get_node_name(node), node, notify_value, + acpi_ut_get_notify_name(notify_value))); /* Get the notify object attached to the NS Node */ obj_desc = acpi_ns_get_attached_object(node); if (obj_desc) { - /* We have the notify object, Get the correct handler */ + /* We have the notify object, Get the right handler */ switch (node->type) { - /* Notify is allowed only on these types */ + /* Notify allowed only on these types */ case ACPI_TYPE_DEVICE: case ACPI_TYPE_THERMAL: @@ -155,7 +152,7 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, } /* - * If there is a handler to run, schedule the dispatcher. + * If there is any handler to run, schedule the dispatcher. * Check for: * 1) Global system notify handler * 2) Global device notify handler @@ -273,7 +270,6 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context) acpi_ut_delete_generic_state(notify_info); } -#if (!ACPI_REDUCED_HARDWARE) /****************************************************************************** * * FUNCTION: acpi_ev_terminate @@ -342,5 +338,3 @@ void acpi_ev_terminate(void) } return_VOID; } - -#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/trunk/drivers/acpi/acpica/evsci.c b/trunk/drivers/acpi/acpica/evsci.c index 6a57aa2d70d1..26065c612e76 100644 --- a/trunk/drivers/acpi/acpica/evsci.c +++ b/trunk/drivers/acpi/acpica/evsci.c @@ -48,7 +48,7 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME("evsci") -#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context); @@ -181,5 +181,3 @@ acpi_status acpi_ev_remove_sci_handler(void) return_ACPI_STATUS(status); } - -#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/trunk/drivers/acpi/acpica/evxface.c b/trunk/drivers/acpi/acpica/evxface.c index 44bef5744ebb..61944e89565a 100644 --- a/trunk/drivers/acpi/acpica/evxface.c +++ b/trunk/drivers/acpi/acpica/evxface.c @@ -51,6 +51,222 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME("evxface") +/******************************************************************************* + * + * FUNCTION: acpi_install_exception_handler + * + * PARAMETERS: Handler - Pointer to the handler function for the + * event + * + * RETURN: Status + * + * DESCRIPTION: Saves the pointer to the handler function + * + ******************************************************************************/ +#ifdef ACPI_FUTURE_USAGE +acpi_status acpi_install_exception_handler(acpi_exception_handler handler) +{ + acpi_status status; + + ACPI_FUNCTION_TRACE(acpi_install_exception_handler); + + status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); + if (ACPI_FAILURE(status)) { + return_ACPI_STATUS(status); + } + + /* Don't allow two handlers. */ + + if (acpi_gbl_exception_handler) { + status = AE_ALREADY_EXISTS; + goto cleanup; + } + + /* Install the handler */ + + acpi_gbl_exception_handler = handler; + + cleanup: + (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); + return_ACPI_STATUS(status); +} + +ACPI_EXPORT_SYMBOL(acpi_install_exception_handler) +#endif /* ACPI_FUTURE_USAGE */ + +/******************************************************************************* + * + * FUNCTION: acpi_install_global_event_handler + * + * PARAMETERS: Handler - Pointer to the global event handler function + * Context - Value passed to the handler on each event + * + * RETURN: Status + * + * DESCRIPTION: Saves the pointer to the handler function. The global handler + * is invoked upon each incoming GPE and Fixed Event. It is + * invoked at interrupt level at the time of the event dispatch. + * Can be used to update event counters, etc. + * + ******************************************************************************/ +acpi_status +acpi_install_global_event_handler(ACPI_GBL_EVENT_HANDLER handler, void *context) +{ + acpi_status status; + + ACPI_FUNCTION_TRACE(acpi_install_global_event_handler); + + /* Parameter validation */ + + if (!handler) { + return_ACPI_STATUS(AE_BAD_PARAMETER); + } + + status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); + if (ACPI_FAILURE(status)) { + return_ACPI_STATUS(status); + } + + /* Don't allow two handlers. */ + + if (acpi_gbl_global_event_handler) { + status = AE_ALREADY_EXISTS; + goto cleanup; + } + + acpi_gbl_global_event_handler = handler; + acpi_gbl_global_event_handler_context = context; + + cleanup: + (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); + return_ACPI_STATUS(status); +} + +ACPI_EXPORT_SYMBOL(acpi_install_global_event_handler) + +/******************************************************************************* + * + * FUNCTION: acpi_install_fixed_event_handler + * + * PARAMETERS: Event - Event type to enable. + * Handler - Pointer to the handler function for the + * event + * Context - Value passed to the handler on each GPE + * + * RETURN: Status + * + * DESCRIPTION: Saves the pointer to the handler function and then enables the + * event. + * + ******************************************************************************/ +acpi_status +acpi_install_fixed_event_handler(u32 event, + acpi_event_handler handler, void *context) +{ + acpi_status status; + + ACPI_FUNCTION_TRACE(acpi_install_fixed_event_handler); + + /* Parameter validation */ + + if (event > ACPI_EVENT_MAX) { + return_ACPI_STATUS(AE_BAD_PARAMETER); + } + + status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); + if (ACPI_FAILURE(status)) { + return_ACPI_STATUS(status); + } + + /* Don't allow two handlers. */ + + if (NULL != acpi_gbl_fixed_event_handlers[event].handler) { + status = AE_ALREADY_EXISTS; + goto cleanup; + } + + /* Install the handler before enabling the event */ + + acpi_gbl_fixed_event_handlers[event].handler = handler; + acpi_gbl_fixed_event_handlers[event].context = context; + + status = acpi_clear_event(event); + if (ACPI_SUCCESS(status)) + status = acpi_enable_event(event, 0); + if (ACPI_FAILURE(status)) { + ACPI_WARNING((AE_INFO, "Could not enable fixed event 0x%X", + event)); + + /* Remove the handler */ + + acpi_gbl_fixed_event_handlers[event].handler = NULL; + acpi_gbl_fixed_event_handlers[event].context = NULL; + } else { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "Enabled fixed event %X, Handler=%p\n", event, + handler)); + } + + cleanup: + (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); + return_ACPI_STATUS(status); +} + +ACPI_EXPORT_SYMBOL(acpi_install_fixed_event_handler) + +/******************************************************************************* + * + * FUNCTION: acpi_remove_fixed_event_handler + * + * PARAMETERS: Event - Event type to disable. + * Handler - Address of the handler + * + * RETURN: Status + * + * DESCRIPTION: Disables the event and unregisters the event handler. + * + ******************************************************************************/ +acpi_status +acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler) +{ + acpi_status status = AE_OK; + + ACPI_FUNCTION_TRACE(acpi_remove_fixed_event_handler); + + /* Parameter validation */ + + if (event > ACPI_EVENT_MAX) { + return_ACPI_STATUS(AE_BAD_PARAMETER); + } + + status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); + if (ACPI_FAILURE(status)) { + return_ACPI_STATUS(status); + } + + /* Disable the event before removing the handler */ + + status = acpi_disable_event(event, 0); + + /* Always Remove the handler */ + + acpi_gbl_fixed_event_handlers[event].handler = NULL; + acpi_gbl_fixed_event_handlers[event].context = NULL; + + if (ACPI_FAILURE(status)) { + ACPI_WARNING((AE_INFO, + "Could not write to fixed event enable register 0x%X", + event)); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X\n", + event)); + } + + (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); + return_ACPI_STATUS(status); +} + +ACPI_EXPORT_SYMBOL(acpi_remove_fixed_event_handler) /******************************************************************************* * @@ -118,7 +334,6 @@ acpi_add_handler_object(struct acpi_object_notify_handler *parent_obj, return AE_OK; } - /******************************************************************************* * * FUNCTION: acpi_install_notify_handler @@ -488,224 +703,6 @@ acpi_remove_notify_handler(acpi_handle device, ACPI_EXPORT_SYMBOL(acpi_remove_notify_handler) -/******************************************************************************* - * - * FUNCTION: acpi_install_exception_handler - * - * PARAMETERS: Handler - Pointer to the handler function for the - * event - * - * RETURN: Status - * - * DESCRIPTION: Saves the pointer to the handler function - * - ******************************************************************************/ -#ifdef ACPI_FUTURE_USAGE -acpi_status acpi_install_exception_handler(acpi_exception_handler handler) -{ - acpi_status status; - - ACPI_FUNCTION_TRACE(acpi_install_exception_handler); - - status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* Don't allow two handlers. */ - - if (acpi_gbl_exception_handler) { - status = AE_ALREADY_EXISTS; - goto cleanup; - } - - /* Install the handler */ - - acpi_gbl_exception_handler = handler; - - cleanup: - (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); - return_ACPI_STATUS(status); -} - -ACPI_EXPORT_SYMBOL(acpi_install_exception_handler) -#endif /* ACPI_FUTURE_USAGE */ - -#if (!ACPI_REDUCED_HARDWARE) -/******************************************************************************* - * - * FUNCTION: acpi_install_global_event_handler - * - * PARAMETERS: Handler - Pointer to the global event handler function - * Context - Value passed to the handler on each event - * - * RETURN: Status - * - * DESCRIPTION: Saves the pointer to the handler function. The global handler - * is invoked upon each incoming GPE and Fixed Event. It is - * invoked at interrupt level at the time of the event dispatch. - * Can be used to update event counters, etc. - * - ******************************************************************************/ -acpi_status -acpi_install_global_event_handler(ACPI_GBL_EVENT_HANDLER handler, void *context) -{ - acpi_status status; - - ACPI_FUNCTION_TRACE(acpi_install_global_event_handler); - - /* Parameter validation */ - - if (!handler) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* Don't allow two handlers. */ - - if (acpi_gbl_global_event_handler) { - status = AE_ALREADY_EXISTS; - goto cleanup; - } - - acpi_gbl_global_event_handler = handler; - acpi_gbl_global_event_handler_context = context; - - cleanup: - (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); - return_ACPI_STATUS(status); -} - -ACPI_EXPORT_SYMBOL(acpi_install_global_event_handler) - -/******************************************************************************* - * - * FUNCTION: acpi_install_fixed_event_handler - * - * PARAMETERS: Event - Event type to enable. - * Handler - Pointer to the handler function for the - * event - * Context - Value passed to the handler on each GPE - * - * RETURN: Status - * - * DESCRIPTION: Saves the pointer to the handler function and then enables the - * event. - * - ******************************************************************************/ -acpi_status -acpi_install_fixed_event_handler(u32 event, - acpi_event_handler handler, void *context) -{ - acpi_status status; - - ACPI_FUNCTION_TRACE(acpi_install_fixed_event_handler); - - /* Parameter validation */ - - if (event > ACPI_EVENT_MAX) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* Don't allow two handlers. */ - - if (NULL != acpi_gbl_fixed_event_handlers[event].handler) { - status = AE_ALREADY_EXISTS; - goto cleanup; - } - - /* Install the handler before enabling the event */ - - acpi_gbl_fixed_event_handlers[event].handler = handler; - acpi_gbl_fixed_event_handlers[event].context = context; - - status = acpi_clear_event(event); - if (ACPI_SUCCESS(status)) - status = acpi_enable_event(event, 0); - if (ACPI_FAILURE(status)) { - ACPI_WARNING((AE_INFO, "Could not enable fixed event 0x%X", - event)); - - /* Remove the handler */ - - acpi_gbl_fixed_event_handlers[event].handler = NULL; - acpi_gbl_fixed_event_handlers[event].context = NULL; - } else { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Enabled fixed event %X, Handler=%p\n", event, - handler)); - } - - cleanup: - (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); - return_ACPI_STATUS(status); -} - -ACPI_EXPORT_SYMBOL(acpi_install_fixed_event_handler) - -/******************************************************************************* - * - * FUNCTION: acpi_remove_fixed_event_handler - * - * PARAMETERS: Event - Event type to disable. - * Handler - Address of the handler - * - * RETURN: Status - * - * DESCRIPTION: Disables the event and unregisters the event handler. - * - ******************************************************************************/ -acpi_status -acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler) -{ - acpi_status status = AE_OK; - - ACPI_FUNCTION_TRACE(acpi_remove_fixed_event_handler); - - /* Parameter validation */ - - if (event > ACPI_EVENT_MAX) { - return_ACPI_STATUS(AE_BAD_PARAMETER); - } - - status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* Disable the event before removing the handler */ - - status = acpi_disable_event(event, 0); - - /* Always Remove the handler */ - - acpi_gbl_fixed_event_handlers[event].handler = NULL; - acpi_gbl_fixed_event_handlers[event].context = NULL; - - if (ACPI_FAILURE(status)) { - ACPI_WARNING((AE_INFO, - "Could not write to fixed event enable register 0x%X", - event)); - } else { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X\n", - event)); - } - - (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); - return_ACPI_STATUS(status); -} - -ACPI_EXPORT_SYMBOL(acpi_remove_fixed_event_handler) - /******************************************************************************* * * FUNCTION: acpi_install_gpe_handler @@ -987,4 +984,3 @@ acpi_status acpi_release_global_lock(u32 handle) } ACPI_EXPORT_SYMBOL(acpi_release_global_lock) -#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/trunk/drivers/acpi/acpica/evxfevnt.c b/trunk/drivers/acpi/acpica/evxfevnt.c index 77cee5a5e891..1768bbec1002 100644 --- a/trunk/drivers/acpi/acpica/evxfevnt.c +++ b/trunk/drivers/acpi/acpica/evxfevnt.c @@ -49,7 +49,6 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME("evxfevnt") -#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /******************************************************************************* * * FUNCTION: acpi_enable @@ -353,4 +352,3 @@ acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status) } ACPI_EXPORT_SYMBOL(acpi_get_event_status) -#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/trunk/drivers/acpi/acpica/evxfgpe.c b/trunk/drivers/acpi/acpica/evxfgpe.c index 86f9b343ebd4..33388fd69df4 100644 --- a/trunk/drivers/acpi/acpica/evxfgpe.c +++ b/trunk/drivers/acpi/acpica/evxfgpe.c @@ -50,7 +50,6 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME("evxfgpe") -#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /****************************************************************************** * * FUNCTION: acpi_update_all_gpes @@ -696,4 +695,3 @@ acpi_get_gpe_device(u32 index, acpi_handle *gpe_device) } ACPI_EXPORT_SYMBOL(acpi_get_gpe_device) -#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/trunk/drivers/acpi/acpica/hwacpi.c b/trunk/drivers/acpi/acpica/hwacpi.c index d0b9ed5df97e..d21ec5f0b3a9 100644 --- a/trunk/drivers/acpi/acpica/hwacpi.c +++ b/trunk/drivers/acpi/acpica/hwacpi.c @@ -48,7 +48,6 @@ #define _COMPONENT ACPI_HARDWARE ACPI_MODULE_NAME("hwacpi") -#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /****************************************************************************** * * FUNCTION: acpi_hw_set_mode @@ -167,5 +166,3 @@ u32 acpi_hw_get_mode(void) return_UINT32(ACPI_SYS_MODE_LEGACY); } } - -#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/trunk/drivers/acpi/acpica/hwesleep.c b/trunk/drivers/acpi/acpica/hwesleep.c deleted file mode 100644 index 29e859293edd..000000000000 --- a/trunk/drivers/acpi/acpica/hwesleep.c +++ /dev/null @@ -1,247 +0,0 @@ -/****************************************************************************** - * - * Name: hwesleep.c - ACPI Hardware Sleep/Wake Support functions for the - * extended FADT-V5 sleep registers. - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2012, Intel Corp. - * All rights reserved. - * - * 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. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * NO WARRANTY - * 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 MERCHANTIBILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. - */ - -#include -#include "accommon.h" - -#define _COMPONENT ACPI_HARDWARE -ACPI_MODULE_NAME("hwesleep") - -/******************************************************************************* - * - * FUNCTION: acpi_hw_execute_sleep_method - * - * PARAMETERS: method_pathname - Pathname of method to execute - * integer_argument - Argument to pass to the method - * - * RETURN: None - * - * DESCRIPTION: Execute a sleep/wake related method with one integer argument - * and no return value. - * - ******************************************************************************/ -void acpi_hw_execute_sleep_method(char *method_pathname, u32 integer_argument) -{ - struct acpi_object_list arg_list; - union acpi_object arg; - acpi_status status; - - ACPI_FUNCTION_TRACE(hw_execute_sleep_method); - - /* One argument, integer_argument; No return value expected */ - - arg_list.count = 1; - arg_list.pointer = &arg; - arg.type = ACPI_TYPE_INTEGER; - arg.integer.value = (u64)integer_argument; - - status = acpi_evaluate_object(NULL, method_pathname, &arg_list, NULL); - if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { - ACPI_EXCEPTION((AE_INFO, status, "While executing method %s", - method_pathname)); - } - - return_VOID; -} - -/******************************************************************************* - * - * FUNCTION: acpi_hw_extended_sleep - * - * PARAMETERS: sleep_state - Which sleep state to enter - * Flags - ACPI_EXECUTE_GTS to run optional method - * - * RETURN: Status - * - * DESCRIPTION: Enter a system sleep state via the extended FADT sleep - * registers (V5 FADT). - * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED - * - ******************************************************************************/ - -acpi_status acpi_hw_extended_sleep(u8 sleep_state, u8 flags) -{ - acpi_status status; - u8 sleep_type_value; - u64 sleep_status; - - ACPI_FUNCTION_TRACE(hw_extended_sleep); - - /* Extended sleep registers must be valid */ - - if (!acpi_gbl_FADT.sleep_control.address || - !acpi_gbl_FADT.sleep_status.address) { - return_ACPI_STATUS(AE_NOT_EXIST); - } - - /* Clear wake status (WAK_STS) */ - - status = acpi_write(ACPI_X_WAKE_STATUS, &acpi_gbl_FADT.sleep_status); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - acpi_gbl_system_awake_and_running = FALSE; - - /* Optionally execute _GTS (Going To Sleep) */ - - if (flags & ACPI_EXECUTE_GTS) { - acpi_hw_execute_sleep_method(METHOD_PATHNAME__GTS, sleep_state); - } - - /* Flush caches, as per ACPI specification */ - - ACPI_FLUSH_CPU_CACHE(); - - /* - * Set the SLP_TYP and SLP_EN bits. - * - * Note: We only use the first value returned by the \_Sx method - * (acpi_gbl_sleep_type_a) - As per ACPI specification. - */ - ACPI_DEBUG_PRINT((ACPI_DB_INIT, - "Entering sleep state [S%u]\n", sleep_state)); - - sleep_type_value = - ((acpi_gbl_sleep_type_a << ACPI_X_SLEEP_TYPE_POSITION) & - ACPI_X_SLEEP_TYPE_MASK); - - status = acpi_write((sleep_type_value | ACPI_X_SLEEP_ENABLE), - &acpi_gbl_FADT.sleep_control); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* Wait for transition back to Working State */ - - do { - status = acpi_read(&sleep_status, &acpi_gbl_FADT.sleep_status); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - } while (!(((u8)sleep_status) & ACPI_X_WAKE_STATUS)); - - return_ACPI_STATUS(AE_OK); -} - -/******************************************************************************* - * - * FUNCTION: acpi_hw_extended_wake_prep - * - * PARAMETERS: sleep_state - Which sleep state we just exited - * Flags - ACPI_EXECUTE_BFS to run optional method - * - * RETURN: Status - * - * DESCRIPTION: Perform first part of OS-independent ACPI cleanup after - * a sleep. Called with interrupts ENABLED. - * - ******************************************************************************/ - -acpi_status acpi_hw_extended_wake_prep(u8 sleep_state, u8 flags) -{ - acpi_status status; - u8 sleep_type_value; - - ACPI_FUNCTION_TRACE(hw_extended_wake_prep); - - status = acpi_get_sleep_type_data(ACPI_STATE_S0, - &acpi_gbl_sleep_type_a, - &acpi_gbl_sleep_type_b); - if (ACPI_SUCCESS(status)) { - sleep_type_value = - ((acpi_gbl_sleep_type_a << ACPI_X_SLEEP_TYPE_POSITION) & - ACPI_X_SLEEP_TYPE_MASK); - - (void)acpi_write((sleep_type_value | ACPI_X_SLEEP_ENABLE), - &acpi_gbl_FADT.sleep_control); - } - - /* Optionally execute _BFS (Back From Sleep) */ - - if (flags & ACPI_EXECUTE_BFS) { - acpi_hw_execute_sleep_method(METHOD_PATHNAME__BFS, sleep_state); - } - return_ACPI_STATUS(AE_OK); -} - -/******************************************************************************* - * - * FUNCTION: acpi_hw_extended_wake - * - * PARAMETERS: sleep_state - Which sleep state we just exited - * Flags - Reserved, set to zero - * - * RETURN: Status - * - * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep - * Called with interrupts ENABLED. - * - ******************************************************************************/ - -acpi_status acpi_hw_extended_wake(u8 sleep_state, u8 flags) -{ - ACPI_FUNCTION_TRACE(hw_extended_wake); - - /* Ensure enter_sleep_state_prep -> enter_sleep_state ordering */ - - acpi_gbl_sleep_type_a = ACPI_SLEEP_TYPE_INVALID; - - /* Execute the wake methods */ - - acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WAKING); - acpi_hw_execute_sleep_method(METHOD_PATHNAME__WAK, sleep_state); - - /* - * Some BIOS code assumes that WAK_STS will be cleared on resume - * and use it to determine whether the system is rebooting or - * resuming. Clear WAK_STS for compatibility. - */ - (void)acpi_write(ACPI_X_WAKE_STATUS, &acpi_gbl_FADT.sleep_status); - acpi_gbl_system_awake_and_running = TRUE; - - acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING); - return_ACPI_STATUS(AE_OK); -} diff --git a/trunk/drivers/acpi/acpica/hwgpe.c b/trunk/drivers/acpi/acpica/hwgpe.c index 25bd28c4ae8d..1a6894afef79 100644 --- a/trunk/drivers/acpi/acpica/hwgpe.c +++ b/trunk/drivers/acpi/acpica/hwgpe.c @@ -48,7 +48,7 @@ #define _COMPONENT ACPI_HARDWARE ACPI_MODULE_NAME("hwgpe") -#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static acpi_status acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, @@ -479,5 +479,3 @@ acpi_status acpi_hw_enable_all_wakeup_gpes(void) status = acpi_ev_walk_gpe_list(acpi_hw_enable_wakeup_gpe_block, NULL); return_ACPI_STATUS(status); } - -#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/trunk/drivers/acpi/acpica/hwregs.c b/trunk/drivers/acpi/acpica/hwregs.c index 6b6c83b87b52..4ea4eeb51bfd 100644 --- a/trunk/drivers/acpi/acpica/hwregs.c +++ b/trunk/drivers/acpi/acpica/hwregs.c @@ -51,7 +51,6 @@ #define _COMPONENT ACPI_HARDWARE ACPI_MODULE_NAME("hwregs") -#if (!ACPI_REDUCED_HARDWARE) /* Local Prototypes */ static acpi_status acpi_hw_read_multiple(u32 *value, @@ -63,8 +62,6 @@ acpi_hw_write_multiple(u32 value, struct acpi_generic_address *register_a, struct acpi_generic_address *register_b); -#endif /* !ACPI_REDUCED_HARDWARE */ - /****************************************************************************** * * FUNCTION: acpi_hw_validate_register @@ -157,7 +154,6 @@ acpi_hw_validate_register(struct acpi_generic_address *reg, acpi_status acpi_hw_read(u32 *value, struct acpi_generic_address *reg) { u64 address; - u64 value64; acpi_status status; ACPI_FUNCTION_NAME(hw_read); @@ -179,9 +175,7 @@ acpi_status acpi_hw_read(u32 *value, struct acpi_generic_address *reg) */ if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { status = acpi_os_read_memory((acpi_physical_address) - address, &value64, reg->bit_width); - - *value = (u32)value64; + address, value, reg->bit_width); } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ status = acpi_hw_read_port((acpi_io_address) @@ -231,8 +225,7 @@ acpi_status acpi_hw_write(u32 value, struct acpi_generic_address *reg) */ if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { status = acpi_os_write_memory((acpi_physical_address) - address, (u64)value, - reg->bit_width); + address, value, reg->bit_width); } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ status = acpi_hw_write_port((acpi_io_address) @@ -247,7 +240,6 @@ acpi_status acpi_hw_write(u32 value, struct acpi_generic_address *reg) return (status); } -#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: acpi_hw_clear_acpi_status @@ -293,7 +285,7 @@ acpi_status acpi_hw_clear_acpi_status(void) /******************************************************************************* * - * FUNCTION: acpi_hw_get_bit_register_info + * FUNCTION: acpi_hw_get_register_bit_mask * * PARAMETERS: register_id - Index of ACPI Register to access * @@ -666,5 +658,3 @@ acpi_hw_write_multiple(u32 value, return (status); } - -#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/trunk/drivers/acpi/acpica/hwsleep.c b/trunk/drivers/acpi/acpica/hwsleep.c index 8ab325cefa68..3c4a922a9fc2 100644 --- a/trunk/drivers/acpi/acpica/hwsleep.c +++ b/trunk/drivers/acpi/acpica/hwsleep.c @@ -1,7 +1,7 @@ + /****************************************************************************** * - * Name: hwsleep.c - ACPI Hardware Sleep/Wake Support functions for the - * original/legacy sleep/PM registers. + * Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface * *****************************************************************************/ @@ -44,36 +44,212 @@ #include #include "accommon.h" +#include "actables.h" #include #include #define _COMPONENT ACPI_HARDWARE ACPI_MODULE_NAME("hwsleep") -#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /******************************************************************************* * - * FUNCTION: acpi_hw_legacy_sleep + * FUNCTION: acpi_set_firmware_waking_vector + * + * PARAMETERS: physical_address - 32-bit physical address of ACPI real mode + * entry point. + * + * RETURN: Status + * + * DESCRIPTION: Sets the 32-bit firmware_waking_vector field of the FACS + * + ******************************************************************************/ +acpi_status +acpi_set_firmware_waking_vector(u32 physical_address) +{ + ACPI_FUNCTION_TRACE(acpi_set_firmware_waking_vector); + + + /* + * According to the ACPI specification 2.0c and later, the 64-bit + * waking vector should be cleared and the 32-bit waking vector should + * be used, unless we want the wake-up code to be called by the BIOS in + * Protected Mode. Some systems (for example HP dv5-1004nr) are known + * to fail to resume if the 64-bit vector is used. + */ + + /* Set the 32-bit vector */ + + acpi_gbl_FACS->firmware_waking_vector = physical_address; + + /* Clear the 64-bit vector if it exists */ + + if ((acpi_gbl_FACS->length > 32) && (acpi_gbl_FACS->version >= 1)) { + acpi_gbl_FACS->xfirmware_waking_vector = 0; + } + + return_ACPI_STATUS(AE_OK); +} + +ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector) + +#if ACPI_MACHINE_WIDTH == 64 +/******************************************************************************* + * + * FUNCTION: acpi_set_firmware_waking_vector64 + * + * PARAMETERS: physical_address - 64-bit physical address of ACPI protected + * mode entry point. + * + * RETURN: Status + * + * DESCRIPTION: Sets the 64-bit X_firmware_waking_vector field of the FACS, if + * it exists in the table. This function is intended for use with + * 64-bit host operating systems. + * + ******************************************************************************/ +acpi_status +acpi_set_firmware_waking_vector64(u64 physical_address) +{ + ACPI_FUNCTION_TRACE(acpi_set_firmware_waking_vector64); + + + /* Determine if the 64-bit vector actually exists */ + + if ((acpi_gbl_FACS->length <= 32) || (acpi_gbl_FACS->version < 1)) { + return_ACPI_STATUS(AE_NOT_EXIST); + } + + /* Clear 32-bit vector, set the 64-bit X_ vector */ + + acpi_gbl_FACS->firmware_waking_vector = 0; + acpi_gbl_FACS->xfirmware_waking_vector = physical_address; + + return_ACPI_STATUS(AE_OK); +} + +ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector64) +#endif + +/******************************************************************************* + * + * FUNCTION: acpi_enter_sleep_state_prep * * PARAMETERS: sleep_state - Which sleep state to enter - * Flags - ACPI_EXECUTE_GTS to run optional method * * RETURN: Status * - * DESCRIPTION: Enter a system sleep state via the legacy FADT PM registers + * DESCRIPTION: Prepare to enter a system sleep state (see ACPI 2.0 spec p 231) + * This function must execute with interrupts enabled. + * We break sleeping into 2 stages so that OSPM can handle + * various OS-specific tasks between the two steps. + * + ******************************************************************************/ +acpi_status acpi_enter_sleep_state_prep(u8 sleep_state) +{ + acpi_status status; + struct acpi_object_list arg_list; + union acpi_object arg; + + ACPI_FUNCTION_TRACE(acpi_enter_sleep_state_prep); + + /* _PSW methods could be run here to enable wake-on keyboard, LAN, etc. */ + + status = acpi_get_sleep_type_data(sleep_state, + &acpi_gbl_sleep_type_a, + &acpi_gbl_sleep_type_b); + if (ACPI_FAILURE(status)) { + return_ACPI_STATUS(status); + } + + /* Setup parameter object */ + + arg_list.count = 1; + arg_list.pointer = &arg; + + arg.type = ACPI_TYPE_INTEGER; + arg.integer.value = sleep_state; + + /* Run the _PTS method */ + + status = acpi_evaluate_object(NULL, METHOD_NAME__PTS, &arg_list, NULL); + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { + return_ACPI_STATUS(status); + } + + /* Setup the argument to _SST */ + + switch (sleep_state) { + case ACPI_STATE_S0: + arg.integer.value = ACPI_SST_WORKING; + break; + + case ACPI_STATE_S1: + case ACPI_STATE_S2: + case ACPI_STATE_S3: + arg.integer.value = ACPI_SST_SLEEPING; + break; + + case ACPI_STATE_S4: + arg.integer.value = ACPI_SST_SLEEP_CONTEXT; + break; + + default: + arg.integer.value = ACPI_SST_INDICATOR_OFF; /* Default is off */ + break; + } + + /* + * Set the system indicators to show the desired sleep state. + * _SST is an optional method (return no error if not found) + */ + status = acpi_evaluate_object(NULL, METHOD_NAME__SST, &arg_list, NULL); + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { + ACPI_EXCEPTION((AE_INFO, status, + "While executing method _SST")); + } + + return_ACPI_STATUS(AE_OK); +} + +ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep) + +static unsigned int gts, bfs; +module_param(gts, uint, 0644); +module_param(bfs, uint, 0644); +MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend."); +MODULE_PARM_DESC(bfs, "Enable evaluation of _BFS on resume".); + +/******************************************************************************* + * + * FUNCTION: acpi_enter_sleep_state + * + * PARAMETERS: sleep_state - Which sleep state to enter + * + * RETURN: Status + * + * DESCRIPTION: Enter a system sleep state (see ACPI 2.0 spec p 231) * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED * ******************************************************************************/ -acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags) +acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) { - struct acpi_bit_register_info *sleep_type_reg_info; - struct acpi_bit_register_info *sleep_enable_reg_info; u32 pm1a_control; u32 pm1b_control; + struct acpi_bit_register_info *sleep_type_reg_info; + struct acpi_bit_register_info *sleep_enable_reg_info; u32 in_value; + struct acpi_object_list arg_list; + union acpi_object arg; acpi_status status; - ACPI_FUNCTION_TRACE(hw_legacy_sleep); + ACPI_FUNCTION_TRACE(acpi_enter_sleep_state); + + if ((acpi_gbl_sleep_type_a > ACPI_SLEEP_TYPE_MAX) || + (acpi_gbl_sleep_type_b > ACPI_SLEEP_TYPE_MAX)) { + ACPI_ERROR((AE_INFO, "Sleep values out of range: A=0x%X B=0x%X", + acpi_gbl_sleep_type_a, acpi_gbl_sleep_type_b)); + return_ACPI_STATUS(AE_AML_OPERAND_VALUE); + } sleep_type_reg_info = acpi_hw_get_bit_register_info(ACPI_BITREG_SLEEP_TYPE); @@ -95,18 +271,6 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags) return_ACPI_STATUS(status); } - if (sleep_state != ACPI_STATE_S5) { - /* - * Disable BM arbitration. This feature is contained within an - * optional register (PM2 Control), so ignore a BAD_ADDRESS - * exception. - */ - status = acpi_write_bit_register(ACPI_BITREG_ARB_DISABLE, 1); - if (ACPI_FAILURE(status) && (status != AE_BAD_ADDRESS)) { - return_ACPI_STATUS(status); - } - } - /* * 1) Disable/Clear all GPEs * 2) Enable all wakeup GPEs @@ -122,10 +286,18 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags) return_ACPI_STATUS(status); } - /* Optionally execute _GTS (Going To Sleep) */ + if (gts) { + /* Execute the _GTS method */ - if (flags & ACPI_EXECUTE_GTS) { - acpi_hw_execute_sleep_method(METHOD_PATHNAME__GTS, sleep_state); + arg_list.count = 1; + arg_list.pointer = &arg; + arg.type = ACPI_TYPE_INTEGER; + arg.integer.value = sleep_state; + + status = acpi_evaluate_object(NULL, METHOD_NAME__GTS, &arg_list, NULL); + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { + return_ACPI_STATUS(status); + } } /* Get current value of PM1A control */ @@ -203,44 +375,114 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags) } } - /* Wait for transition back to Working State */ + /* Wait until we enter sleep state */ do { + status = acpi_read_bit_register(ACPI_BITREG_WAKE_STATUS, + &in_value); + if (ACPI_FAILURE(status)) { + return_ACPI_STATUS(status); + } + + /* Spin until we wake */ + + } while (!in_value); + + return_ACPI_STATUS(AE_OK); +} + +ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state) + +/******************************************************************************* + * + * FUNCTION: acpi_enter_sleep_state_s4bios + * + * PARAMETERS: None + * + * RETURN: Status + * + * DESCRIPTION: Perform a S4 bios request. + * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED + * + ******************************************************************************/ +acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void) +{ + u32 in_value; + acpi_status status; + + ACPI_FUNCTION_TRACE(acpi_enter_sleep_state_s4bios); + + /* Clear the wake status bit (PM1) */ + + status = + acpi_write_bit_register(ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS); + if (ACPI_FAILURE(status)) { + return_ACPI_STATUS(status); + } + + status = acpi_hw_clear_acpi_status(); + if (ACPI_FAILURE(status)) { + return_ACPI_STATUS(status); + } + + /* + * 1) Disable/Clear all GPEs + * 2) Enable all wakeup GPEs + */ + status = acpi_hw_disable_all_gpes(); + if (ACPI_FAILURE(status)) { + return_ACPI_STATUS(status); + } + acpi_gbl_system_awake_and_running = FALSE; + + status = acpi_hw_enable_all_wakeup_gpes(); + if (ACPI_FAILURE(status)) { + return_ACPI_STATUS(status); + } + + ACPI_FLUSH_CPU_CACHE(); + + status = acpi_hw_write_port(acpi_gbl_FADT.smi_command, + (u32) acpi_gbl_FADT.S4bios_request, 8); + + do { + acpi_os_stall(1000); status = acpi_read_bit_register(ACPI_BITREG_WAKE_STATUS, &in_value); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } - } while (!in_value); return_ACPI_STATUS(AE_OK); } +ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios) + /******************************************************************************* * - * FUNCTION: acpi_hw_legacy_wake_prep + * FUNCTION: acpi_leave_sleep_state_prep * - * PARAMETERS: sleep_state - Which sleep state we just exited - * Flags - ACPI_EXECUTE_BFS to run optional method + * PARAMETERS: sleep_state - Which sleep state we are exiting * * RETURN: Status * * DESCRIPTION: Perform the first state of OS-independent ACPI cleanup after a * sleep. - * Called with interrupts ENABLED. + * Called with interrupts DISABLED. * ******************************************************************************/ - -acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state, u8 flags) +acpi_status acpi_leave_sleep_state_prep(u8 sleep_state) { + struct acpi_object_list arg_list; + union acpi_object arg; acpi_status status; struct acpi_bit_register_info *sleep_type_reg_info; struct acpi_bit_register_info *sleep_enable_reg_info; u32 pm1a_control; u32 pm1b_control; - ACPI_FUNCTION_TRACE(hw_legacy_wake_prep); + ACPI_FUNCTION_TRACE(acpi_leave_sleep_state_prep); /* * Set SLP_TYPE and SLP_EN to state S0. @@ -283,20 +525,27 @@ acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state, u8 flags) } } - /* Optionally execute _BFS (Back From Sleep) */ + if (bfs) { + /* Execute the _BFS method */ - if (flags & ACPI_EXECUTE_BFS) { - acpi_hw_execute_sleep_method(METHOD_PATHNAME__BFS, sleep_state); + arg_list.count = 1; + arg_list.pointer = &arg; + arg.type = ACPI_TYPE_INTEGER; + arg.integer.value = sleep_state; + + status = acpi_evaluate_object(NULL, METHOD_NAME__BFS, &arg_list, NULL); + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { + ACPI_EXCEPTION((AE_INFO, status, "During Method _BFS")); + } } return_ACPI_STATUS(status); } /******************************************************************************* * - * FUNCTION: acpi_hw_legacy_wake + * FUNCTION: acpi_leave_sleep_state * * PARAMETERS: sleep_state - Which sleep state we just exited - * Flags - Reserved, set to zero * * RETURN: Status * @@ -304,17 +553,31 @@ acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state, u8 flags) * Called with interrupts ENABLED. * ******************************************************************************/ - -acpi_status acpi_hw_legacy_wake(u8 sleep_state, u8 flags) +acpi_status acpi_leave_sleep_state(u8 sleep_state) { + struct acpi_object_list arg_list; + union acpi_object arg; acpi_status status; - ACPI_FUNCTION_TRACE(hw_legacy_wake); + ACPI_FUNCTION_TRACE(acpi_leave_sleep_state); /* Ensure enter_sleep_state_prep -> enter_sleep_state ordering */ acpi_gbl_sleep_type_a = ACPI_SLEEP_TYPE_INVALID; - acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WAKING); + + /* Setup parameter object */ + + arg_list.count = 1; + arg_list.pointer = &arg; + arg.type = ACPI_TYPE_INTEGER; + + /* Ignore any errors from these methods */ + + arg.integer.value = ACPI_SST_WAKING; + status = acpi_evaluate_object(NULL, METHOD_NAME__SST, &arg_list, NULL); + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { + ACPI_EXCEPTION((AE_INFO, status, "During Method _SST")); + } /* * GPEs must be enabled before _WAK is called as GPEs @@ -328,50 +591,46 @@ acpi_status acpi_hw_legacy_wake(u8 sleep_state, u8 flags) if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } - status = acpi_hw_enable_all_runtime_gpes(); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } - /* - * Now we can execute _WAK, etc. Some machines require that the GPEs - * are enabled before the wake methods are executed. - */ - acpi_hw_execute_sleep_method(METHOD_PATHNAME__WAK, sleep_state); + arg.integer.value = sleep_state; + status = acpi_evaluate_object(NULL, METHOD_NAME__WAK, &arg_list, NULL); + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { + ACPI_EXCEPTION((AE_INFO, status, "During Method _WAK")); + } + /* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */ /* - * Some BIOS code assumes that WAK_STS will be cleared on resume - * and use it to determine whether the system is rebooting or - * resuming. Clear WAK_STS for compatibility. + * Some BIOSes assume that WAK_STS will be cleared on resume and use + * it to determine whether the system is rebooting or resuming. Clear + * it for compatibility. */ acpi_write_bit_register(ACPI_BITREG_WAKE_STATUS, 1); + acpi_gbl_system_awake_and_running = TRUE; /* Enable power button */ (void) acpi_write_bit_register(acpi_gbl_fixed_event_info - [ACPI_EVENT_POWER_BUTTON]. - enable_register_id, ACPI_ENABLE_EVENT); + [ACPI_EVENT_POWER_BUTTON]. + enable_register_id, ACPI_ENABLE_EVENT); (void) acpi_write_bit_register(acpi_gbl_fixed_event_info - [ACPI_EVENT_POWER_BUTTON]. - status_register_id, ACPI_CLEAR_STATUS); + [ACPI_EVENT_POWER_BUTTON]. + status_register_id, ACPI_CLEAR_STATUS); - /* - * Enable BM arbitration. This feature is contained within an - * optional register (PM2 Control), so ignore a BAD_ADDRESS - * exception. - */ - status = acpi_write_bit_register(ACPI_BITREG_ARB_DISABLE, 0); - if (ACPI_FAILURE(status) && (status != AE_BAD_ADDRESS)) { - return_ACPI_STATUS(status); + arg.integer.value = ACPI_SST_WORKING; + status = acpi_evaluate_object(NULL, METHOD_NAME__SST, &arg_list, NULL); + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { + ACPI_EXCEPTION((AE_INFO, status, "During Method _SST")); } - acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING); return_ACPI_STATUS(status); } -#endif /* !ACPI_REDUCED_HARDWARE */ +ACPI_EXPORT_SYMBOL(acpi_leave_sleep_state) diff --git a/trunk/drivers/acpi/acpica/hwtimer.c b/trunk/drivers/acpi/acpica/hwtimer.c index f1b2c3b94cac..d4973d9da9f1 100644 --- a/trunk/drivers/acpi/acpica/hwtimer.c +++ b/trunk/drivers/acpi/acpica/hwtimer.c @@ -49,7 +49,6 @@ #define _COMPONENT ACPI_HARDWARE ACPI_MODULE_NAME("hwtimer") -#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /****************************************************************************** * * FUNCTION: acpi_get_timer_resolution @@ -188,4 +187,3 @@ acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed) } ACPI_EXPORT_SYMBOL(acpi_get_timer_duration) -#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/trunk/drivers/acpi/acpica/hwxface.c b/trunk/drivers/acpi/acpica/hwxface.c index a716fede4f25..9d38eb6c0d0b 100644 --- a/trunk/drivers/acpi/acpica/hwxface.c +++ b/trunk/drivers/acpi/acpica/hwxface.c @@ -138,6 +138,11 @@ acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg) return (status); } + width = reg->bit_width; + if (width == 64) { + width = 32; /* Break into two 32-bit transfers */ + } + /* Initialize entire 64-bit return value to zero */ *return_value = 0; @@ -149,17 +154,24 @@ acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg) */ if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { status = acpi_os_read_memory((acpi_physical_address) - address, return_value, - reg->bit_width); + address, &value, width); if (ACPI_FAILURE(status)) { return (status); } - } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ + *return_value = value; + + if (reg->bit_width == 64) { - width = reg->bit_width; - if (width == 64) { - width = 32; /* Break into two 32-bit transfers */ + /* Read the top 32 bits */ + + status = acpi_os_read_memory((acpi_physical_address) + (address + 4), &value, 32); + if (ACPI_FAILURE(status)) { + return (status); + } + *return_value |= ((u64)value << 32); } + } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ status = acpi_hw_read_port((acpi_io_address) address, &value, width); @@ -219,22 +231,32 @@ acpi_status acpi_write(u64 value, struct acpi_generic_address *reg) return (status); } + width = reg->bit_width; + if (width == 64) { + width = 32; /* Break into two 32-bit transfers */ + } + /* * Two address spaces supported: Memory or IO. PCI_Config is * not supported here because the GAS structure is insufficient */ if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { status = acpi_os_write_memory((acpi_physical_address) - address, value, reg->bit_width); + address, ACPI_LODWORD(value), + width); if (ACPI_FAILURE(status)) { return (status); } - } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ - width = reg->bit_width; - if (width == 64) { - width = 32; /* Break into two 32-bit transfers */ + if (reg->bit_width == 64) { + status = acpi_os_write_memory((acpi_physical_address) + (address + 4), + ACPI_HIDWORD(value), 32); + if (ACPI_FAILURE(status)) { + return (status); + } } + } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ status = acpi_hw_write_port((acpi_io_address) address, ACPI_LODWORD(value), @@ -264,7 +286,6 @@ acpi_status acpi_write(u64 value, struct acpi_generic_address *reg) ACPI_EXPORT_SYMBOL(acpi_write) -#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: acpi_read_bit_register @@ -432,7 +453,7 @@ acpi_status acpi_write_bit_register(u32 register_id, u32 value) } ACPI_EXPORT_SYMBOL(acpi_write_bit_register) -#endif /* !ACPI_REDUCED_HARDWARE */ + /******************************************************************************* * * FUNCTION: acpi_get_sleep_type_data diff --git a/trunk/drivers/acpi/acpica/hwxfsleep.c b/trunk/drivers/acpi/acpica/hwxfsleep.c deleted file mode 100644 index 762d059bb508..000000000000 --- a/trunk/drivers/acpi/acpica/hwxfsleep.c +++ /dev/null @@ -1,431 +0,0 @@ -/****************************************************************************** - * - * Name: hwxfsleep.c - ACPI Hardware Sleep/Wake External Interfaces - * - *****************************************************************************/ - -/* - * Copyright (C) 2000 - 2012, Intel Corp. - * All rights reserved. - * - * 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. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * NO WARRANTY - * 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 MERCHANTIBILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. - */ - -#include -#include "accommon.h" -#include - -#define _COMPONENT ACPI_HARDWARE -ACPI_MODULE_NAME("hwxfsleep") - -/* Local prototypes */ -static acpi_status -acpi_hw_sleep_dispatch(u8 sleep_state, u8 flags, u32 function_id); - -/* - * Dispatch table used to efficiently branch to the various sleep - * functions. - */ -#define ACPI_SLEEP_FUNCTION_ID 0 -#define ACPI_WAKE_PREP_FUNCTION_ID 1 -#define ACPI_WAKE_FUNCTION_ID 2 - -/* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */ - -static struct acpi_sleep_functions acpi_sleep_dispatch[] = { - {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep), - acpi_hw_extended_sleep}, - {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep), - acpi_hw_extended_wake_prep}, - {ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake), acpi_hw_extended_wake} -}; - -/* - * These functions are removed for the ACPI_REDUCED_HARDWARE case: - * acpi_set_firmware_waking_vector - * acpi_set_firmware_waking_vector64 - * acpi_enter_sleep_state_s4bios - */ - -#if (!ACPI_REDUCED_HARDWARE) -/******************************************************************************* - * - * FUNCTION: acpi_set_firmware_waking_vector - * - * PARAMETERS: physical_address - 32-bit physical address of ACPI real mode - * entry point. - * - * RETURN: Status - * - * DESCRIPTION: Sets the 32-bit firmware_waking_vector field of the FACS - * - ******************************************************************************/ - -acpi_status acpi_set_firmware_waking_vector(u32 physical_address) -{ - ACPI_FUNCTION_TRACE(acpi_set_firmware_waking_vector); - - - /* - * According to the ACPI specification 2.0c and later, the 64-bit - * waking vector should be cleared and the 32-bit waking vector should - * be used, unless we want the wake-up code to be called by the BIOS in - * Protected Mode. Some systems (for example HP dv5-1004nr) are known - * to fail to resume if the 64-bit vector is used. - */ - - /* Set the 32-bit vector */ - - acpi_gbl_FACS->firmware_waking_vector = physical_address; - - /* Clear the 64-bit vector if it exists */ - - if ((acpi_gbl_FACS->length > 32) && (acpi_gbl_FACS->version >= 1)) { - acpi_gbl_FACS->xfirmware_waking_vector = 0; - } - - return_ACPI_STATUS(AE_OK); -} - -ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector) - -#if ACPI_MACHINE_WIDTH == 64 -/******************************************************************************* - * - * FUNCTION: acpi_set_firmware_waking_vector64 - * - * PARAMETERS: physical_address - 64-bit physical address of ACPI protected - * mode entry point. - * - * RETURN: Status - * - * DESCRIPTION: Sets the 64-bit X_firmware_waking_vector field of the FACS, if - * it exists in the table. This function is intended for use with - * 64-bit host operating systems. - * - ******************************************************************************/ -acpi_status acpi_set_firmware_waking_vector64(u64 physical_address) -{ - ACPI_FUNCTION_TRACE(acpi_set_firmware_waking_vector64); - - - /* Determine if the 64-bit vector actually exists */ - - if ((acpi_gbl_FACS->length <= 32) || (acpi_gbl_FACS->version < 1)) { - return_ACPI_STATUS(AE_NOT_EXIST); - } - - /* Clear 32-bit vector, set the 64-bit X_ vector */ - - acpi_gbl_FACS->firmware_waking_vector = 0; - acpi_gbl_FACS->xfirmware_waking_vector = physical_address; - return_ACPI_STATUS(AE_OK); -} - -ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector64) -#endif - -/******************************************************************************* - * - * FUNCTION: acpi_enter_sleep_state_s4bios - * - * PARAMETERS: None - * - * RETURN: Status - * - * DESCRIPTION: Perform a S4 bios request. - * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED - * - ******************************************************************************/ -acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void) -{ - u32 in_value; - acpi_status status; - - ACPI_FUNCTION_TRACE(acpi_enter_sleep_state_s4bios); - - /* Clear the wake status bit (PM1) */ - - status = - acpi_write_bit_register(ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - status = acpi_hw_clear_acpi_status(); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* - * 1) Disable/Clear all GPEs - * 2) Enable all wakeup GPEs - */ - status = acpi_hw_disable_all_gpes(); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - acpi_gbl_system_awake_and_running = FALSE; - - status = acpi_hw_enable_all_wakeup_gpes(); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - ACPI_FLUSH_CPU_CACHE(); - - status = acpi_hw_write_port(acpi_gbl_FADT.smi_command, - (u32)acpi_gbl_FADT.S4bios_request, 8); - - do { - acpi_os_stall(1000); - status = - acpi_read_bit_register(ACPI_BITREG_WAKE_STATUS, &in_value); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - } while (!in_value); - - return_ACPI_STATUS(AE_OK); -} - -ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios) -#endif /* !ACPI_REDUCED_HARDWARE */ -/******************************************************************************* - * - * FUNCTION: acpi_hw_sleep_dispatch - * - * PARAMETERS: sleep_state - Which sleep state to enter/exit - * function_id - Sleep, wake_prep, or Wake - * - * RETURN: Status from the invoked sleep handling function. - * - * DESCRIPTION: Dispatch a sleep/wake request to the appropriate handling - * function. - * - ******************************************************************************/ -static acpi_status -acpi_hw_sleep_dispatch(u8 sleep_state, u8 flags, u32 function_id) -{ - acpi_status status; - struct acpi_sleep_functions *sleep_functions = - &acpi_sleep_dispatch[function_id]; - -#if (!ACPI_REDUCED_HARDWARE) - - /* - * If the Hardware Reduced flag is set (from the FADT), we must - * use the extended sleep registers - */ - if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) { - status = sleep_functions->extended_function(sleep_state, flags); - } else { - /* Legacy sleep */ - - status = sleep_functions->legacy_function(sleep_state, flags); - } - - return (status); - -#else - /* - * For the case where reduced-hardware-only code is being generated, - * we know that only the extended sleep registers are available - */ - status = sleep_functions->extended_function(sleep_state, flags); - return (status); - -#endif /* !ACPI_REDUCED_HARDWARE */ -} - -/******************************************************************************* - * - * FUNCTION: acpi_enter_sleep_state_prep - * - * PARAMETERS: sleep_state - Which sleep state to enter - * - * RETURN: Status - * - * DESCRIPTION: Prepare to enter a system sleep state. - * This function must execute with interrupts enabled. - * We break sleeping into 2 stages so that OSPM can handle - * various OS-specific tasks between the two steps. - * - ******************************************************************************/ - -acpi_status acpi_enter_sleep_state_prep(u8 sleep_state) -{ - acpi_status status; - struct acpi_object_list arg_list; - union acpi_object arg; - u32 sst_value; - - ACPI_FUNCTION_TRACE(acpi_enter_sleep_state_prep); - - status = acpi_get_sleep_type_data(sleep_state, - &acpi_gbl_sleep_type_a, - &acpi_gbl_sleep_type_b); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - - /* Execute the _PTS method (Prepare To Sleep) */ - - arg_list.count = 1; - arg_list.pointer = &arg; - arg.type = ACPI_TYPE_INTEGER; - arg.integer.value = sleep_state; - - status = - acpi_evaluate_object(NULL, METHOD_PATHNAME__PTS, &arg_list, NULL); - if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { - return_ACPI_STATUS(status); - } - - /* Setup the argument to the _SST method (System STatus) */ - - switch (sleep_state) { - case ACPI_STATE_S0: - sst_value = ACPI_SST_WORKING; - break; - - case ACPI_STATE_S1: - case ACPI_STATE_S2: - case ACPI_STATE_S3: - sst_value = ACPI_SST_SLEEPING; - break; - - case ACPI_STATE_S4: - sst_value = ACPI_SST_SLEEP_CONTEXT; - break; - - default: - sst_value = ACPI_SST_INDICATOR_OFF; /* Default is off */ - break; - } - - /* - * Set the system indicators to show the desired sleep state. - * _SST is an optional method (return no error if not found) - */ - acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, sst_value); - return_ACPI_STATUS(AE_OK); -} - -ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep) - -/******************************************************************************* - * - * FUNCTION: acpi_enter_sleep_state - * - * PARAMETERS: sleep_state - Which sleep state to enter - * Flags - ACPI_EXECUTE_GTS to run optional method - * - * RETURN: Status - * - * DESCRIPTION: Enter a system sleep state (see ACPI 2.0 spec p 231) - * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED - * - ******************************************************************************/ -acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state, u8 flags) -{ - acpi_status status; - - ACPI_FUNCTION_TRACE(acpi_enter_sleep_state); - - if ((acpi_gbl_sleep_type_a > ACPI_SLEEP_TYPE_MAX) || - (acpi_gbl_sleep_type_b > ACPI_SLEEP_TYPE_MAX)) { - ACPI_ERROR((AE_INFO, "Sleep values out of range: A=0x%X B=0x%X", - acpi_gbl_sleep_type_a, acpi_gbl_sleep_type_b)); - return_ACPI_STATUS(AE_AML_OPERAND_VALUE); - } - - status = - acpi_hw_sleep_dispatch(sleep_state, flags, ACPI_SLEEP_FUNCTION_ID); - return_ACPI_STATUS(status); -} - -ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state) - -/******************************************************************************* - * - * FUNCTION: acpi_leave_sleep_state_prep - * - * PARAMETERS: sleep_state - Which sleep state we are exiting - * Flags - ACPI_EXECUTE_BFS to run optional method - * - * RETURN: Status - * - * DESCRIPTION: Perform the first state of OS-independent ACPI cleanup after a - * sleep. - * Called with interrupts DISABLED. - * - ******************************************************************************/ -acpi_status acpi_leave_sleep_state_prep(u8 sleep_state, u8 flags) -{ - acpi_status status; - - ACPI_FUNCTION_TRACE(acpi_leave_sleep_state_prep); - - status = - acpi_hw_sleep_dispatch(sleep_state, flags, - ACPI_WAKE_PREP_FUNCTION_ID); - return_ACPI_STATUS(status); -} - -ACPI_EXPORT_SYMBOL(acpi_leave_sleep_state_prep) - -/******************************************************************************* - * - * FUNCTION: acpi_leave_sleep_state - * - * PARAMETERS: sleep_state - Which sleep state we are exiting - * - * RETURN: Status - * - * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep - * Called with interrupts ENABLED. - * - ******************************************************************************/ -acpi_status acpi_leave_sleep_state(u8 sleep_state) -{ - acpi_status status; - - ACPI_FUNCTION_TRACE(acpi_leave_sleep_state); - - - status = acpi_hw_sleep_dispatch(sleep_state, 0, ACPI_WAKE_FUNCTION_ID); - return_ACPI_STATUS(status); -} - -ACPI_EXPORT_SYMBOL(acpi_leave_sleep_state) diff --git a/trunk/drivers/acpi/acpica/nsdump.c b/trunk/drivers/acpi/acpica/nsdump.c index 3f7f3f6e7dd5..b7f2b3be79ac 100644 --- a/trunk/drivers/acpi/acpica/nsdump.c +++ b/trunk/drivers/acpi/acpica/nsdump.c @@ -242,20 +242,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle, if (!obj_desc) { - /* No attached object. Some types should always have an object */ - - switch (type) { - case ACPI_TYPE_INTEGER: - case ACPI_TYPE_PACKAGE: - case ACPI_TYPE_BUFFER: - case ACPI_TYPE_STRING: - case ACPI_TYPE_METHOD: - acpi_os_printf(""); - break; - - default: - break; - } + /* No attached object, we are done */ acpi_os_printf("\n"); return (AE_OK); diff --git a/trunk/drivers/acpi/acpica/nsdumpdv.c b/trunk/drivers/acpi/acpica/nsdumpdv.c index 3b5acb0eb406..30ea5bc53a78 100644 --- a/trunk/drivers/acpi/acpica/nsdumpdv.c +++ b/trunk/drivers/acpi/acpica/nsdumpdv.c @@ -121,7 +121,7 @@ void acpi_ns_dump_root_devices(void) return; } - status = acpi_get_handle(NULL, METHOD_NAME__SB_, &sys_bus_handle); + status = acpi_get_handle(NULL, ACPI_NS_SYSTEM_BUS, &sys_bus_handle); if (ACPI_FAILURE(status)) { return; } diff --git a/trunk/drivers/acpi/acpica/nspredef.c b/trunk/drivers/acpi/acpica/nspredef.c index 23ce09686418..bbe46a447d34 100644 --- a/trunk/drivers/acpi/acpica/nspredef.c +++ b/trunk/drivers/acpi/acpica/nspredef.c @@ -638,8 +638,8 @@ acpi_ns_check_package(struct acpi_predefined_data *data, /* Create the new outer package and populate it */ status = - acpi_ns_wrap_with_package(data, *elements, - return_object_ptr); + acpi_ns_repair_package_list(data, + return_object_ptr); if (ACPI_FAILURE(status)) { return (status); } diff --git a/trunk/drivers/acpi/acpica/nsrepair.c b/trunk/drivers/acpi/acpica/nsrepair.c index 5519a64a353f..9c35d20eb52b 100644 --- a/trunk/drivers/acpi/acpica/nsrepair.c +++ b/trunk/drivers/acpi/acpica/nsrepair.c @@ -71,10 +71,11 @@ ACPI_MODULE_NAME("nsrepair") * Buffer -> String * Buffer -> Package of Integers * Package -> Package of one Package - * An incorrect standalone object is wrapped with required outer package * * Additional possible repairs: + * * Required package elements that are NULL replaced by Integer/String/Buffer + * Incorrect standalone package wrapped with required outer package * ******************************************************************************/ /* Local prototypes */ @@ -90,6 +91,10 @@ static acpi_status acpi_ns_convert_to_buffer(union acpi_operand_object *original_object, union acpi_operand_object **return_object); +static acpi_status +acpi_ns_convert_to_package(union acpi_operand_object *original_object, + union acpi_operand_object **return_object); + /******************************************************************************* * * FUNCTION: acpi_ns_repair_object @@ -146,24 +151,9 @@ acpi_ns_repair_object(struct acpi_predefined_data *data, } } if (expected_btypes & ACPI_RTYPE_PACKAGE) { - /* - * A package is expected. We will wrap the existing object with a - * new package object. It is often the case that if a variable-length - * package is required, but there is only a single object needed, the - * BIOS will return that object instead of wrapping it with a Package - * object. Note: after the wrapping, the package will be validated - * for correct contents (expected object type or types). - */ - status = - acpi_ns_wrap_with_package(data, return_object, &new_object); + status = acpi_ns_convert_to_package(return_object, &new_object); if (ACPI_SUCCESS(status)) { - /* - * The original object just had its reference count - * incremented for being inserted into the new package. - */ - *return_object_ptr = new_object; /* New Package object */ - data->flags |= ACPI_OBJECT_REPAIRED; - return (AE_OK); + goto object_repaired; } } @@ -175,27 +165,22 @@ acpi_ns_repair_object(struct acpi_predefined_data *data, /* Object was successfully repaired */ + /* + * If the original object is a package element, we need to: + * 1. Set the reference count of the new object to match the + * reference count of the old object. + * 2. Decrement the reference count of the original object. + */ if (package_index != 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. - */ - if (!(data->flags & ACPI_OBJECT_WRAPPED)) { - new_object->common.reference_count = - return_object->common.reference_count; + new_object->common.reference_count = + return_object->common.reference_count; - if (return_object->common.reference_count > 1) { - return_object->common.reference_count--; - } + if (return_object->common.reference_count > 1) { + return_object->common.reference_count--; } ACPI_DEBUG_PRINT((ACPI_DB_REPAIR, - "%s: Converted %s to expected %s at Package index %u\n", + "%s: Converted %s to expected %s at index %u\n", data->pathname, acpi_ut_get_object_type_name(return_object), acpi_ut_get_object_type_name(new_object), @@ -466,6 +451,65 @@ acpi_ns_convert_to_buffer(union acpi_operand_object *original_object, return (AE_OK); } +/******************************************************************************* + * + * FUNCTION: acpi_ns_convert_to_package + * + * PARAMETERS: original_object - Object to be converted + * return_object - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a Buffer object to a Package. Each byte of + * the buffer is converted to a single integer package element. + * + ******************************************************************************/ + +static acpi_status +acpi_ns_convert_to_package(union acpi_operand_object *original_object, + union acpi_operand_object **return_object) +{ + union acpi_operand_object *new_object; + union acpi_operand_object **elements; + u32 length; + u8 *buffer; + + switch (original_object->common.type) { + case ACPI_TYPE_BUFFER: + + /* Buffer-to-Package conversion */ + + length = original_object->buffer.length; + new_object = acpi_ut_create_package_object(length); + if (!new_object) { + return (AE_NO_MEMORY); + } + + /* Convert each buffer byte to an integer package element */ + + elements = new_object->package.elements; + buffer = original_object->buffer.pointer; + + while (length--) { + *elements = + acpi_ut_create_integer_object((u64) *buffer); + if (!*elements) { + acpi_ut_remove_reference(new_object); + return (AE_NO_MEMORY); + } + elements++; + buffer++; + } + break; + + default: + return (AE_AML_OPERAND_TYPE); + } + + *return_object = new_object; + return (AE_OK); +} + /******************************************************************************* * * FUNCTION: acpi_ns_repair_null_element @@ -633,56 +677,55 @@ acpi_ns_remove_null_elements(struct acpi_predefined_data *data, /******************************************************************************* * - * FUNCTION: acpi_ns_wrap_with_package + * FUNCTION: acpi_ns_repair_package_list * * PARAMETERS: Data - Pointer to validation data structure - * original_object - Pointer to the object to repair. - * obj_desc_ptr - The new package object is returned here + * obj_desc_ptr - Pointer to the object to repair. The new + * package object is returned here, + * overwriting the old object. * * RETURN: Status, new object in *obj_desc_ptr * - * DESCRIPTION: Repair a common problem with objects that are defined to - * return a variable-length Package of sub-objects. If there is - * only one sub-object, some BIOS code mistakenly simply declares - * the single object instead of a Package with one sub-object. - * This function attempts to repair this error by wrapping a - * Package object around the original object, creating the - * correct and expected Package with one sub-object. + * DESCRIPTION: Repair a common problem with objects that are defined to return + * a variable-length Package of Packages. If the variable-length + * is one, some BIOS code mistakenly simply declares a single + * Package instead of a Package with one sub-Package. This + * function attempts to repair this error by wrapping a Package + * object around the original Package, creating the correct + * Package with one sub-Package. * * Names that can be repaired in this manner include: - * _ALR, _CSD, _HPX, _MLS, _PLD, _PRT, _PSS, _TRT, _TSS, - * _BCL, _DOD, _FIX, _Sx + * _ALR, _CSD, _HPX, _MLS, _PRT, _PSS, _TRT, TSS * ******************************************************************************/ acpi_status -acpi_ns_wrap_with_package(struct acpi_predefined_data *data, - union acpi_operand_object *original_object, - union acpi_operand_object **obj_desc_ptr) +acpi_ns_repair_package_list(struct acpi_predefined_data *data, + union acpi_operand_object **obj_desc_ptr) { union acpi_operand_object *pkg_obj_desc; - ACPI_FUNCTION_NAME(ns_wrap_with_package); + ACPI_FUNCTION_NAME(ns_repair_package_list); /* * Create the new outer package and populate it. The new package will - * have a single element, the lone sub-object. + * have a single element, the lone subpackage. */ pkg_obj_desc = acpi_ut_create_package_object(1); if (!pkg_obj_desc) { return (AE_NO_MEMORY); } - pkg_obj_desc->package.elements[0] = original_object; - - ACPI_DEBUG_PRINT((ACPI_DB_REPAIR, - "%s: Wrapped %s with expected Package object\n", - data->pathname, - acpi_ut_get_object_type_name(original_object))); + pkg_obj_desc->package.elements[0] = *obj_desc_ptr; /* Return the new object in the object pointer */ *obj_desc_ptr = pkg_obj_desc; - data->flags |= ACPI_OBJECT_REPAIRED | ACPI_OBJECT_WRAPPED; + data->flags |= ACPI_OBJECT_REPAIRED; + + ACPI_DEBUG_PRINT((ACPI_DB_REPAIR, + "%s: Repaired incorrectly formed Package\n", + data->pathname)); + return (AE_OK); } diff --git a/trunk/drivers/acpi/acpica/nsutils.c b/trunk/drivers/acpi/acpica/nsutils.c index 75113759f69d..a535b7afda5c 100644 --- a/trunk/drivers/acpi/acpica/nsutils.c +++ b/trunk/drivers/acpi/acpica/nsutils.c @@ -341,7 +341,7 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info) if (!acpi_ns_valid_path_separator(*external_name) && (*external_name != 0)) { - return_ACPI_STATUS(AE_BAD_PATHNAME); + return_ACPI_STATUS(AE_BAD_PARAMETER); } /* Move on the next segment */ diff --git a/trunk/drivers/acpi/acpica/tbinstal.c b/trunk/drivers/acpi/acpica/tbinstal.c index c03500b4cc7a..1aecf7baa4e0 100644 --- a/trunk/drivers/acpi/acpica/tbinstal.c +++ b/trunk/drivers/acpi/acpica/tbinstal.c @@ -114,6 +114,7 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index) { u32 i; acpi_status status = AE_OK; + struct acpi_table_header *override_table = NULL; ACPI_FUNCTION_TRACE(tb_add_table); @@ -223,10 +224,25 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index) /* * ACPI Table Override: * Allow the host to override dynamically loaded tables. - * NOTE: the table is fully mapped at this point, and the mapping will - * be deleted by tb_table_override if the table is actually overridden. */ - (void)acpi_tb_table_override(table_desc->pointer, table_desc); + status = acpi_os_table_override(table_desc->pointer, &override_table); + if (ACPI_SUCCESS(status) && override_table) { + ACPI_INFO((AE_INFO, + "%4.4s @ 0x%p Table override, replaced with:", + table_desc->pointer->signature, + ACPI_CAST_PTR(void, table_desc->address))); + + /* We can delete the table that was passed as a parameter */ + + acpi_tb_delete_table(table_desc); + + /* Setup descriptor for the new table */ + + table_desc->address = ACPI_PTR_TO_PHYSADDR(override_table); + table_desc->pointer = override_table; + table_desc->length = override_table->length; + table_desc->flags = ACPI_TABLE_ORIGIN_OVERRIDE; + } /* Add the table to the global root table list */ @@ -245,95 +261,6 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index) return_ACPI_STATUS(status); } -/******************************************************************************* - * - * FUNCTION: acpi_tb_table_override - * - * PARAMETERS: table_header - Header for the original table - * table_desc - Table descriptor initialized for the - * original table. May or may not be mapped. - * - * RETURN: Pointer to the entire new table. NULL if table not overridden. - * If overridden, installs the new table within the input table - * descriptor. - * - * DESCRIPTION: Attempt table override by calling the OSL override functions. - * Note: If the table is overridden, then the entire new table - * is mapped and returned by this function. - * - ******************************************************************************/ - -struct acpi_table_header *acpi_tb_table_override(struct acpi_table_header - *table_header, - struct acpi_table_desc - *table_desc) -{ - acpi_status status; - struct acpi_table_header *new_table = NULL; - acpi_physical_address new_address = 0; - u32 new_table_length = 0; - u8 new_flags; - char *override_type; - - /* (1) Attempt logical override (returns a logical address) */ - - status = acpi_os_table_override(table_header, &new_table); - if (ACPI_SUCCESS(status) && new_table) { - new_address = ACPI_PTR_TO_PHYSADDR(new_table); - new_table_length = new_table->length; - new_flags = ACPI_TABLE_ORIGIN_OVERRIDE; - override_type = "Logical"; - goto finish_override; - } - - /* (2) Attempt physical override (returns a physical address) */ - - status = acpi_os_physical_table_override(table_header, - &new_address, - &new_table_length); - if (ACPI_SUCCESS(status) && new_address && new_table_length) { - - /* Map the entire new table */ - - new_table = acpi_os_map_memory(new_address, new_table_length); - if (!new_table) { - ACPI_EXCEPTION((AE_INFO, AE_NO_MEMORY, - "%4.4s %p Attempted physical table override failed", - table_header->signature, - ACPI_CAST_PTR(void, - table_desc->address))); - return (NULL); - } - - override_type = "Physical"; - new_flags = ACPI_TABLE_ORIGIN_MAPPED; - goto finish_override; - } - - return (NULL); /* There was no override */ - - finish_override: - - ACPI_INFO((AE_INFO, - "%4.4s %p %s table override, new table: %p", - table_header->signature, - ACPI_CAST_PTR(void, table_desc->address), - override_type, new_table)); - - /* We can now unmap/delete the original table (if fully mapped) */ - - acpi_tb_delete_table(table_desc); - - /* Setup descriptor for the new table */ - - table_desc->address = new_address; - table_desc->pointer = new_table; - table_desc->length = new_table_length; - table_desc->flags = new_flags; - - return (new_table); -} - /******************************************************************************* * * FUNCTION: acpi_tb_resize_root_table_list @@ -469,11 +396,7 @@ void acpi_tb_delete_table(struct acpi_table_desc *table_desc) case ACPI_TABLE_ORIGIN_ALLOCATED: ACPI_FREE(table_desc->pointer); break; - - /* Not mapped or allocated, there is nothing we can do */ - - default: - return; + default:; } table_desc->pointer = NULL; diff --git a/trunk/drivers/acpi/acpica/tbutils.c b/trunk/drivers/acpi/acpica/tbutils.c index 0a706cac37de..09ca39e14337 100644 --- a/trunk/drivers/acpi/acpica/tbutils.c +++ b/trunk/drivers/acpi/acpica/tbutils.c @@ -118,7 +118,6 @@ acpi_tb_check_xsdt(acpi_physical_address address) return AE_OK; } -#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: acpi_tb_initialize_facs @@ -149,7 +148,6 @@ acpi_status acpi_tb_initialize_facs(void) &acpi_gbl_FACS)); return status; } -#endif /* !ACPI_REDUCED_HARDWARE */ /******************************************************************************* * @@ -446,7 +444,7 @@ struct acpi_table_header *acpi_tb_copy_dsdt(u32 table_index) * RETURN: None * * DESCRIPTION: Install an ACPI table into the global data structure. The - * table override mechanism is called to allow the host + * table override mechanism is implemented here to allow the host * OS to replace any table before it is installed in the root * table array. * @@ -456,9 +454,11 @@ void acpi_tb_install_table(acpi_physical_address address, char *signature, u32 table_index) { - struct acpi_table_header *table; - struct acpi_table_header *final_table; - struct acpi_table_desc *table_desc; + u8 flags; + acpi_status status; + struct acpi_table_header *table_to_install; + struct acpi_table_header *mapped_table; + struct acpi_table_header *override_table = NULL; if (!address) { ACPI_ERROR((AE_INFO, @@ -469,78 +469,69 @@ acpi_tb_install_table(acpi_physical_address address, /* Map just the table header */ - table = acpi_os_map_memory(address, sizeof(struct acpi_table_header)); - if (!table) { - ACPI_ERROR((AE_INFO, - "Could not map memory for table [%s] at %p", - signature, ACPI_CAST_PTR(void, address))); + mapped_table = + acpi_os_map_memory(address, sizeof(struct acpi_table_header)); + if (!mapped_table) { return; } /* If a particular signature is expected (DSDT/FACS), it must match */ - if (signature && !ACPI_COMPARE_NAME(table->signature, signature)) { + if (signature && !ACPI_COMPARE_NAME(mapped_table->signature, signature)) { ACPI_ERROR((AE_INFO, "Invalid signature 0x%X for ACPI table, expected [%s]", - *ACPI_CAST_PTR(u32, table->signature), signature)); + *ACPI_CAST_PTR(u32, mapped_table->signature), + signature)); goto unmap_and_exit; } - /* - * Initialize the table entry. Set the pointer to NULL, since the - * table is not fully mapped at this time. - */ - table_desc = &acpi_gbl_root_table_list.tables[table_index]; - - table_desc->address = address; - table_desc->pointer = NULL; - table_desc->length = table->length; - table_desc->flags = ACPI_TABLE_ORIGIN_MAPPED; - ACPI_MOVE_32_TO_32(table_desc->signature.ascii, table->signature); - /* * ACPI Table Override: * * Before we install the table, let the host OS override it with a new * one if desired. Any table within the RSDT/XSDT can be replaced, * including the DSDT which is pointed to by the FADT. - * - * NOTE: If the table is overridden, then final_table will contain a - * mapped pointer to the full new table. If the table is not overridden, - * or if there has been a physical override, then the table will be - * fully mapped later (in verify table). In any case, we must - * unmap the header that was mapped above. */ - final_table = acpi_tb_table_override(table, table_desc); - if (!final_table) { - final_table = table; /* There was no override */ + status = acpi_os_table_override(mapped_table, &override_table); + if (ACPI_SUCCESS(status) && override_table) { + ACPI_INFO((AE_INFO, + "%4.4s @ 0x%p Table override, replaced with:", + mapped_table->signature, ACPI_CAST_PTR(void, + address))); + + acpi_gbl_root_table_list.tables[table_index].pointer = + override_table; + address = ACPI_PTR_TO_PHYSADDR(override_table); + + table_to_install = override_table; + flags = ACPI_TABLE_ORIGIN_OVERRIDE; + } else { + table_to_install = mapped_table; + flags = ACPI_TABLE_ORIGIN_MAPPED; } - acpi_tb_print_table_header(table_desc->address, final_table); + /* Initialize the table entry */ - /* Set the global integer width (based upon revision of the DSDT) */ + acpi_gbl_root_table_list.tables[table_index].address = address; + acpi_gbl_root_table_list.tables[table_index].length = + table_to_install->length; + acpi_gbl_root_table_list.tables[table_index].flags = flags; + + ACPI_MOVE_32_TO_32(& + (acpi_gbl_root_table_list.tables[table_index]. + signature), table_to_install->signature); + + acpi_tb_print_table_header(address, table_to_install); if (table_index == ACPI_TABLE_INDEX_DSDT) { - acpi_ut_set_integer_width(final_table->revision); - } - /* - * If we have a physical override during this early loading of the ACPI - * tables, unmap the table for now. It will be mapped again later when - * it is actually used. This supports very early loading of ACPI tables, - * before virtual memory is fully initialized and running within the - * host OS. Note: A logical override has the ACPI_TABLE_ORIGIN_OVERRIDE - * flag set and will not be deleted below. - */ - if (final_table != table) { - acpi_tb_delete_table(table_desc); + /* Global integer width is based upon revision of the DSDT */ + + acpi_ut_set_integer_width(table_to_install->revision); } unmap_and_exit: - - /* Always unmap the table header that we mapped above */ - - acpi_os_unmap_memory(table, sizeof(struct acpi_table_header)); + acpi_os_unmap_memory(mapped_table, sizeof(struct acpi_table_header)); } /******************************************************************************* diff --git a/trunk/drivers/acpi/acpica/utdecode.c b/trunk/drivers/acpi/acpica/utdecode.c index 684849949bf3..d42ede5260c7 100644 --- a/trunk/drivers/acpi/acpica/utdecode.c +++ b/trunk/drivers/acpi/acpica/utdecode.c @@ -497,20 +497,19 @@ char *acpi_ut_get_mutex_name(u32 mutex_id) /* Names for Notify() values, used for debug output */ -static const char *acpi_gbl_notify_value_names[ACPI_NOTIFY_MAX + 1] = { - /* 00 */ "Bus Check", - /* 01 */ "Device Check", - /* 02 */ "Device Wake", - /* 03 */ "Eject Request", - /* 04 */ "Device Check Light", - /* 05 */ "Frequency Mismatch", - /* 06 */ "Bus Mode Mismatch", - /* 07 */ "Power Fault", - /* 08 */ "Capabilities Check", - /* 09 */ "Device PLD Check", - /* 10 */ "Reserved", - /* 11 */ "System Locality Update", - /* 12 */ "Shutdown Request" +static const char *acpi_gbl_notify_value_names[] = { + "Bus Check", + "Device Check", + "Device Wake", + "Eject Request", + "Device Check Light", + "Frequency Mismatch", + "Bus Mode Mismatch", + "Power Fault", + "Capabilities Check", + "Device PLD Check", + "Reserved", + "System Locality Update" }; const char *acpi_ut_get_notify_name(u32 notify_value) @@ -520,10 +519,9 @@ const char *acpi_ut_get_notify_name(u32 notify_value) return (acpi_gbl_notify_value_names[notify_value]); } else if (notify_value <= ACPI_MAX_SYS_NOTIFY) { return ("Reserved"); - } else if (notify_value <= ACPI_MAX_DEVICE_SPECIFIC_NOTIFY) { - return ("Device Specific"); - } else { - return ("Hardware Specific"); + } else { /* Greater or equal to 0x80 */ + + return ("**Device Specific**"); } } #endif diff --git a/trunk/drivers/acpi/acpica/utglobal.c b/trunk/drivers/acpi/acpica/utglobal.c index 90f53b42eca9..4153584cf526 100644 --- a/trunk/drivers/acpi/acpica/utglobal.c +++ b/trunk/drivers/acpi/acpica/utglobal.c @@ -140,7 +140,6 @@ const struct acpi_predefined_names acpi_gbl_pre_defined_names[] = { {NULL, ACPI_TYPE_ANY, NULL} }; -#if (!ACPI_REDUCED_HARDWARE) /****************************************************************************** * * Event and Hardware globals @@ -237,7 +236,6 @@ struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] = ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE}, }; -#endif /* !ACPI_REDUCED_HARDWARE */ /******************************************************************************* * @@ -288,8 +286,6 @@ acpi_status acpi_ut_init_globals(void) acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000; -#if (!ACPI_REDUCED_HARDWARE) - /* GPE support */ acpi_gbl_gpe_xrupt_list_head = NULL; @@ -298,10 +294,6 @@ acpi_status acpi_ut_init_globals(void) acpi_current_gpe_count = 0; acpi_gbl_all_gpes_initialized = FALSE; - acpi_gbl_global_event_handler = NULL; - -#endif /* !ACPI_REDUCED_HARDWARE */ - /* Global handlers */ acpi_gbl_system_notify.handler = NULL; @@ -310,6 +302,7 @@ acpi_status acpi_ut_init_globals(void) acpi_gbl_init_handler = NULL; acpi_gbl_table_handler = NULL; acpi_gbl_interface_handler = NULL; + acpi_gbl_global_event_handler = NULL; /* Global Lock support */ diff --git a/trunk/drivers/acpi/acpica/utinit.c b/trunk/drivers/acpi/acpica/utinit.c index 246798e4c938..8359c0c5dc98 100644 --- a/trunk/drivers/acpi/acpica/utinit.c +++ b/trunk/drivers/acpi/acpica/utinit.c @@ -53,35 +53,27 @@ ACPI_MODULE_NAME("utinit") /* Local prototypes */ static void acpi_ut_terminate(void); -#if (!ACPI_REDUCED_HARDWARE) - -static void acpi_ut_free_gpe_lists(void); - -#else - -#define acpi_ut_free_gpe_lists() -#endif /* !ACPI_REDUCED_HARDWARE */ - -#if (!ACPI_REDUCED_HARDWARE) /****************************************************************************** * - * FUNCTION: acpi_ut_free_gpe_lists + * FUNCTION: acpi_ut_terminate * * PARAMETERS: none * * RETURN: none * - * DESCRIPTION: Free global GPE lists + * DESCRIPTION: Free global memory * ******************************************************************************/ -static void acpi_ut_free_gpe_lists(void) +static void acpi_ut_terminate(void) { struct acpi_gpe_block_info *gpe_block; struct acpi_gpe_block_info *next_gpe_block; struct acpi_gpe_xrupt_info *gpe_xrupt_info; struct acpi_gpe_xrupt_info *next_gpe_xrupt_info; + ACPI_FUNCTION_TRACE(ut_terminate); + /* Free global GPE blocks and related info structures */ gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head; @@ -99,26 +91,7 @@ static void acpi_ut_free_gpe_lists(void) ACPI_FREE(gpe_xrupt_info); gpe_xrupt_info = next_gpe_xrupt_info; } -} -#endif /* !ACPI_REDUCED_HARDWARE */ - -/****************************************************************************** - * - * FUNCTION: acpi_ut_terminate - * - * PARAMETERS: none - * - * RETURN: none - * - * DESCRIPTION: Free global memory - * - ******************************************************************************/ - -static void acpi_ut_terminate(void) -{ - ACPI_FUNCTION_TRACE(ut_terminate); - acpi_ut_free_gpe_lists(); acpi_ut_delete_address_lists(); return_VOID; } diff --git a/trunk/drivers/acpi/acpica/utxface.c b/trunk/drivers/acpi/acpica/utxface.c index afa94f51ff0b..644e8c8ebc4b 100644 --- a/trunk/drivers/acpi/acpica/utxface.c +++ b/trunk/drivers/acpi/acpica/utxface.c @@ -145,8 +145,6 @@ acpi_status acpi_enable_subsystem(u32 flags) ACPI_FUNCTION_TRACE(acpi_enable_subsystem); -#if (!ACPI_REDUCED_HARDWARE) - /* Enable ACPI mode */ if (!(flags & ACPI_NO_ACPI_ENABLE)) { @@ -171,7 +169,6 @@ acpi_status acpi_enable_subsystem(u32 flags) ACPI_WARNING((AE_INFO, "Could not map the FACS table")); return_ACPI_STATUS(status); } -#endif /* !ACPI_REDUCED_HARDWARE */ /* * Install the default op_region handlers. These are installed unless @@ -187,7 +184,7 @@ acpi_status acpi_enable_subsystem(u32 flags) return_ACPI_STATUS(status); } } -#if (!ACPI_REDUCED_HARDWARE) + /* * Initialize ACPI Event handling (Fixed and General Purpose) * @@ -223,7 +220,6 @@ acpi_status acpi_enable_subsystem(u32 flags) return_ACPI_STATUS(status); } } -#endif /* !ACPI_REDUCED_HARDWARE */ return_ACPI_STATUS(status); } diff --git a/trunk/drivers/acpi/apei/apei-base.c b/trunk/drivers/acpi/apei/apei-base.c index ca773683d87e..e5d53b7ddc7e 100644 --- a/trunk/drivers/acpi/apei/apei-base.c +++ b/trunk/drivers/acpi/apei/apei-base.c @@ -605,7 +605,7 @@ int apei_read(u64 *val, struct acpi_generic_address *reg) *val = 0; switch(reg->space_id) { case ACPI_ADR_SPACE_SYSTEM_MEMORY: - status = acpi_os_read_memory((acpi_physical_address) + status = acpi_os_read_memory64((acpi_physical_address) address, val, reg->bit_width); if (ACPI_FAILURE(status)) return -EIO; @@ -636,7 +636,7 @@ int apei_write(u64 val, struct acpi_generic_address *reg) switch (reg->space_id) { case ACPI_ADR_SPACE_SYSTEM_MEMORY: - status = acpi_os_write_memory((acpi_physical_address) + status = acpi_os_write_memory64((acpi_physical_address) address, val, reg->bit_width); if (ACPI_FAILURE(status)) return -EIO; diff --git a/trunk/drivers/acpi/bus.c b/trunk/drivers/acpi/bus.c index 9ecec98bc76e..3263b68cdfa3 100644 --- a/trunk/drivers/acpi/bus.c +++ b/trunk/drivers/acpi/bus.c @@ -1010,6 +1010,7 @@ static int __init acpi_bus_init(void) } struct kobject *acpi_kobj; +EXPORT_SYMBOL_GPL(acpi_kobj); static int __init acpi_init(void) { diff --git a/trunk/drivers/acpi/osl.c b/trunk/drivers/acpi/osl.c index 07d426425b59..412a1e04a922 100644 --- a/trunk/drivers/acpi/osl.c +++ b/trunk/drivers/acpi/osl.c @@ -554,15 +554,6 @@ acpi_os_table_override(struct acpi_table_header * existing_table, return AE_OK; } -acpi_status -acpi_os_physical_table_override(struct acpi_table_header *existing_table, - acpi_physical_address * new_address, - u32 *new_table_length) -{ - return AE_SUPPORT; -} - - static irqreturn_t acpi_irq(int irq, void *dev_id) { u32 handled; @@ -708,6 +699,49 @@ acpi_status acpi_os_write_port(acpi_io_address port, u32 value, u32 width) EXPORT_SYMBOL(acpi_os_write_port); +acpi_status +acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width) +{ + void __iomem *virt_addr; + unsigned int size = width / 8; + bool unmap = false; + u32 dummy; + + rcu_read_lock(); + virt_addr = acpi_map_vaddr_lookup(phys_addr, size); + if (!virt_addr) { + rcu_read_unlock(); + virt_addr = acpi_os_ioremap(phys_addr, size); + if (!virt_addr) + return AE_BAD_ADDRESS; + unmap = true; + } + + if (!value) + value = &dummy; + + switch (width) { + case 8: + *(u8 *) value = readb(virt_addr); + break; + case 16: + *(u16 *) value = readw(virt_addr); + break; + case 32: + *(u32 *) value = readl(virt_addr); + break; + default: + BUG(); + } + + if (unmap) + iounmap(virt_addr); + else + rcu_read_unlock(); + + return AE_OK; +} + #ifdef readq static inline u64 read64(const volatile void __iomem *addr) { @@ -724,7 +758,7 @@ static inline u64 read64(const volatile void __iomem *addr) #endif acpi_status -acpi_os_read_memory(acpi_physical_address phys_addr, u64 *value, u32 width) +acpi_os_read_memory64(acpi_physical_address phys_addr, u64 *value, u32 width) { void __iomem *virt_addr; unsigned int size = width / 8; @@ -769,6 +803,45 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u64 *value, u32 width) return AE_OK; } +acpi_status +acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width) +{ + void __iomem *virt_addr; + unsigned int size = width / 8; + bool unmap = false; + + rcu_read_lock(); + virt_addr = acpi_map_vaddr_lookup(phys_addr, size); + if (!virt_addr) { + rcu_read_unlock(); + virt_addr = acpi_os_ioremap(phys_addr, size); + if (!virt_addr) + return AE_BAD_ADDRESS; + unmap = true; + } + + switch (width) { + case 8: + writeb(value, virt_addr); + break; + case 16: + writew(value, virt_addr); + break; + case 32: + writel(value, virt_addr); + break; + default: + BUG(); + } + + if (unmap) + iounmap(virt_addr); + else + rcu_read_unlock(); + + return AE_OK; +} + #ifdef writeq static inline void write64(u64 val, volatile void __iomem *addr) { @@ -783,7 +856,7 @@ static inline void write64(u64 val, volatile void __iomem *addr) #endif acpi_status -acpi_os_write_memory(acpi_physical_address phys_addr, u64 value, u32 width) +acpi_os_write_memory64(acpi_physical_address phys_addr, u64 value, u32 width) { void __iomem *virt_addr; unsigned int size = width / 8; diff --git a/trunk/drivers/acpi/sleep.c b/trunk/drivers/acpi/sleep.c index acf81fe86b53..ca191ff97844 100644 --- a/trunk/drivers/acpi/sleep.c +++ b/trunk/drivers/acpi/sleep.c @@ -17,7 +17,6 @@ #include #include #include -#include #include @@ -27,24 +26,6 @@ #include "internal.h" #include "sleep.h" -static unsigned int gts, bfs; -module_param(gts, uint, 0644); -module_param(bfs, uint, 0644); -MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend."); -MODULE_PARM_DESC(bfs, "Enable evaluation of _BFS on resume".); - -static u8 wake_sleep_flags(void) -{ - u8 flags = ACPI_NO_OPTIONAL_METHODS; - - if (gts) - flags |= ACPI_EXECUTE_GTS; - if (bfs) - flags |= ACPI_EXECUTE_BFS; - - return flags; -} - static u8 sleep_states[ACPI_S_STATE_COUNT]; static void acpi_sleep_tts_switch(u32 acpi_state) @@ -262,7 +243,6 @@ static int acpi_suspend_enter(suspend_state_t pm_state) { acpi_status status = AE_OK; u32 acpi_state = acpi_target_sleep_state; - u8 flags = wake_sleep_flags(); int error; ACPI_FLUSH_CPU_CACHE(); @@ -270,7 +250,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state) switch (acpi_state) { case ACPI_STATE_S1: barrier(); - status = acpi_enter_sleep_state(acpi_state, flags); + status = acpi_enter_sleep_state(acpi_state); break; case ACPI_STATE_S3: @@ -285,7 +265,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state) acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1); /* Reprogram control registers and execute _BFS */ - acpi_leave_sleep_state_prep(acpi_state, flags); + acpi_leave_sleep_state_prep(acpi_state); /* ACPI 3.0 specs (P62) says that it's the responsibility * of the OSPM to clear the status bit [ implying that the @@ -549,30 +529,27 @@ static int acpi_hibernation_begin(void) static int acpi_hibernation_enter(void) { - u8 flags = wake_sleep_flags(); acpi_status status = AE_OK; ACPI_FLUSH_CPU_CACHE(); /* This shouldn't return. If it returns, we have a problem */ - status = acpi_enter_sleep_state(ACPI_STATE_S4, flags); + status = acpi_enter_sleep_state(ACPI_STATE_S4); /* Reprogram control registers and execute _BFS */ - acpi_leave_sleep_state_prep(ACPI_STATE_S4, flags); + acpi_leave_sleep_state_prep(ACPI_STATE_S4); return ACPI_SUCCESS(status) ? 0 : -EFAULT; } static void acpi_hibernation_leave(void) { - u8 flags = wake_sleep_flags(); - /* * If ACPI is not enabled by the BIOS and the boot kernel, we need to * enable it here. */ acpi_enable(); /* Reprogram control registers and execute _BFS */ - acpi_leave_sleep_state_prep(ACPI_STATE_S4, flags); + acpi_leave_sleep_state_prep(ACPI_STATE_S4); /* Check the hardware signature */ if (facs && s4_hardware_signature != facs->hardware_signature) { printk(KERN_EMERG "ACPI: Hardware changed while hibernated, " @@ -793,12 +770,10 @@ static void acpi_power_off_prepare(void) static void acpi_power_off(void) { - u8 flags = wake_sleep_flags(); - /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */ printk(KERN_DEBUG "%s called\n", __func__); local_irq_disable(); - acpi_enter_sleep_state(ACPI_STATE_S5, flags); + acpi_enter_sleep_state(ACPI_STATE_S5); } /* @@ -813,13 +788,13 @@ static void __init acpi_gts_bfs_check(void) { acpi_handle dummy; - if (ACPI_SUCCESS(acpi_get_handle(ACPI_ROOT_OBJECT, METHOD_PATHNAME__GTS, &dummy))) + if (ACPI_SUCCESS(acpi_get_handle(ACPI_ROOT_OBJECT, METHOD_NAME__GTS, &dummy))) { printk(KERN_NOTICE PREFIX "BIOS offers _GTS\n"); printk(KERN_NOTICE PREFIX "If \"acpi.gts=1\" improves suspend, " "please notify linux-acpi@vger.kernel.org\n"); } - if (ACPI_SUCCESS(acpi_get_handle(ACPI_ROOT_OBJECT, METHOD_PATHNAME__BFS, &dummy))) + if (ACPI_SUCCESS(acpi_get_handle(ACPI_ROOT_OBJECT, METHOD_NAME__BFS, &dummy))) { printk(KERN_NOTICE PREFIX "BIOS offers _BFS\n"); printk(KERN_NOTICE PREFIX "If \"acpi.bfs=1\" improves resume, " diff --git a/trunk/include/acpi/acexcep.h b/trunk/include/acpi/acexcep.h index 47b3902957b0..5b6c391efc8e 100644 --- a/trunk/include/acpi/acexcep.h +++ b/trunk/include/acpi/acexcep.h @@ -89,9 +89,8 @@ #define AE_SAME_HANDLER (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL) #define AE_NO_HANDLER (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL) #define AE_OWNER_ID_LIMIT (acpi_status) (0x001B | AE_CODE_ENVIRONMENTAL) -#define AE_NOT_CONFIGURED (acpi_status) (0x001C | AE_CODE_ENVIRONMENTAL) -#define AE_CODE_ENV_MAX 0x001C +#define AE_CODE_ENV_MAX 0x001B /* * Programmer exceptions @@ -214,8 +213,7 @@ char const *acpi_gbl_exception_names_env[] = { "AE_ABORT_METHOD", "AE_SAME_HANDLER", "AE_NO_HANDLER", - "AE_OWNER_ID_LIMIT", - "AE_NOT_CONFIGURED" + "AE_OWNER_ID_LIMIT" }; char const *acpi_gbl_exception_names_pgm[] = { diff --git a/trunk/include/acpi/acnames.h b/trunk/include/acpi/acnames.h index 38f508816e4a..5b5af0d30a97 100644 --- a/trunk/include/acpi/acnames.h +++ b/trunk/include/acpi/acnames.h @@ -46,7 +46,6 @@ /* Method names - these methods can appear anywhere in the namespace */ -#define METHOD_NAME__SB_ "_SB_" #define METHOD_NAME__HID "_HID" #define METHOD_NAME__CID "_CID" #define METHOD_NAME__UID "_UID" @@ -65,11 +64,11 @@ /* Method names - these methods must appear at the namespace root */ -#define METHOD_PATHNAME__BFS "\\_BFS" -#define METHOD_PATHNAME__GTS "\\_GTS" -#define METHOD_PATHNAME__PTS "\\_PTS" -#define METHOD_PATHNAME__SST "\\_SI._SST" -#define METHOD_PATHNAME__WAK "\\_WAK" +#define METHOD_NAME__BFS "\\_BFS" +#define METHOD_NAME__GTS "\\_GTS" +#define METHOD_NAME__PTS "\\_PTS" +#define METHOD_NAME__SST "\\_SI._SST" +#define METHOD_NAME__WAK "\\_WAK" /* Definitions of the predefined namespace names */ @@ -80,5 +79,6 @@ #define ACPI_PREFIX_LOWER (u32) 0x69706361 /* "acpi" */ #define ACPI_NS_ROOT_PATH "\\" +#define ACPI_NS_SYSTEM_BUS "_SB_" #endif /* __ACNAMES_H__ */ diff --git a/trunk/include/acpi/acpiosxf.h b/trunk/include/acpi/acpiosxf.h index 21a5548c6686..7c9aebe8a7aa 100644 --- a/trunk/include/acpi/acpiosxf.h +++ b/trunk/include/acpi/acpiosxf.h @@ -95,11 +95,6 @@ acpi_status acpi_os_table_override(struct acpi_table_header *existing_table, struct acpi_table_header **new_table); -acpi_status -acpi_os_physical_table_override(struct acpi_table_header *existing_table, - acpi_physical_address * new_address, - u32 *new_table_length); - /* * Spinlock primitives */ @@ -222,10 +217,14 @@ acpi_status acpi_os_write_port(acpi_io_address address, u32 value, u32 width); * Platform and hardware-independent physical memory interfaces */ acpi_status -acpi_os_read_memory(acpi_physical_address address, u64 *value, u32 width); +acpi_os_read_memory(acpi_physical_address address, u32 * value, u32 width); +acpi_status +acpi_os_read_memory64(acpi_physical_address address, u64 *value, u32 width); acpi_status -acpi_os_write_memory(acpi_physical_address address, u64 value, u32 width); +acpi_os_write_memory(acpi_physical_address address, u32 value, u32 width); +acpi_status +acpi_os_write_memory64(acpi_physical_address address, u64 value, u32 width); /* * Platform and hardware-independent PCI configuration space access diff --git a/trunk/include/acpi/acpixf.h b/trunk/include/acpi/acpixf.h index 982110134672..a28da35ba45e 100644 --- a/trunk/include/acpi/acpixf.h +++ b/trunk/include/acpi/acpixf.h @@ -47,9 +47,8 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20120320 +#define ACPI_CA_VERSION 0x20120111 -#include "acconfig.h" #include "actypes.h" #include "actbl.h" @@ -72,33 +71,6 @@ extern u8 acpi_gbl_copy_dsdt_locally; extern u8 acpi_gbl_truncate_io_addresses; extern u8 acpi_gbl_disable_auto_repair; -/* - * Hardware-reduced prototypes. All interfaces that use these macros will - * be configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag - * is set to TRUE. - */ -#if (!ACPI_REDUCED_HARDWARE) -#define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \ - prototype; - -#define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \ - prototype; - -#define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \ - prototype; - -#else -#define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \ - static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);} - -#define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \ - static ACPI_INLINE prototype {return(AE_OK);} - -#define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \ - static ACPI_INLINE prototype {} - -#endif /* !ACPI_REDUCED_HARDWARE */ - extern u32 acpi_current_gpe_count; extern struct acpi_table_fadt acpi_gbl_FADT; extern u8 acpi_gbl_system_awake_and_running; @@ -124,8 +96,9 @@ acpi_status acpi_terminate(void); acpi_status acpi_subsystem_status(void); #endif -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void)) -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void)) +acpi_status acpi_enable(void); + +acpi_status acpi_disable(void); #ifdef ACPI_FUTURE_USAGE acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer); @@ -262,34 +235,17 @@ acpi_status acpi_get_parent(acpi_handle object, acpi_handle * out_handle); acpi_status acpi_install_initialization_handler(acpi_init_handler handler, u32 function); -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_install_global_event_handler - (ACPI_GBL_EVENT_HANDLER handler, void *context)) - -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_install_fixed_event_handler(u32 - acpi_event, - acpi_event_handler - handler, - void - *context)) -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_remove_fixed_event_handler(u32 acpi_event, - acpi_event_handler - handler)) -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_install_gpe_handler(acpi_handle - gpe_device, - u32 gpe_number, - u32 type, - acpi_gpe_handler - address, - void *context)) -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_remove_gpe_handler(acpi_handle gpe_device, - u32 gpe_number, - acpi_gpe_handler - address)) +acpi_status +acpi_install_global_event_handler(ACPI_GBL_EVENT_HANDLER handler, + void *context); + +acpi_status +acpi_install_fixed_event_handler(u32 acpi_event, + acpi_event_handler handler, void *context); + +acpi_status +acpi_remove_fixed_event_handler(u32 acpi_event, acpi_event_handler handler); + acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type, @@ -310,6 +266,15 @@ acpi_remove_address_space_handler(acpi_handle device, acpi_adr_space_type space_id, acpi_adr_space_handler handler); +acpi_status +acpi_install_gpe_handler(acpi_handle gpe_device, + u32 gpe_number, + u32 type, acpi_gpe_handler address, void *context); + +acpi_status +acpi_remove_gpe_handler(acpi_handle gpe_device, + u32 gpe_number, acpi_gpe_handler address); + #ifdef ACPI_FUTURE_USAGE acpi_status acpi_install_exception_handler(acpi_exception_handler handler); #endif @@ -319,11 +284,9 @@ acpi_status acpi_install_interface_handler(acpi_interface_handler handler); /* * Global Lock interfaces */ -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_acquire_global_lock(u16 timeout, - u32 *handle)) -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_release_global_lock(u32 handle)) +acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle); + +acpi_status acpi_release_global_lock(u32 handle); /* * Interfaces to AML mutex objects @@ -336,75 +299,47 @@ acpi_status acpi_release_mutex(acpi_handle handle, acpi_string pathname); /* * Fixed Event interfaces */ -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_enable_event(u32 event, u32 flags)) +acpi_status acpi_enable_event(u32 event, u32 flags); + +acpi_status acpi_disable_event(u32 event, u32 flags); -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_disable_event(u32 event, u32 flags)) +acpi_status acpi_clear_event(u32 event); -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event)) +acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status); -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_get_event_status(u32 event, - acpi_event_status - *event_status)) /* * General Purpose Event (GPE) Interfaces */ -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_update_all_gpes(void)) - -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_enable_gpe(acpi_handle gpe_device, - u32 gpe_number)) - -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_disable_gpe(acpi_handle gpe_device, - u32 gpe_number)) - -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_clear_gpe(acpi_handle gpe_device, - u32 gpe_number)) - -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_set_gpe(acpi_handle gpe_device, - u32 gpe_number, u8 action)) - -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_finish_gpe(acpi_handle gpe_device, - u32 gpe_number)) - -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_setup_gpe_for_wake(acpi_handle - parent_device, - acpi_handle gpe_device, - u32 gpe_number)) -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_set_gpe_wake_mask(acpi_handle gpe_device, - u32 gpe_number, - u8 action)) -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_get_gpe_status(acpi_handle gpe_device, - u32 gpe_number, - acpi_event_status - *event_status)) - -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void)) - -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void)) - -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_get_gpe_device(u32 gpe_index, - acpi_handle * gpe_device)) - -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_install_gpe_block(acpi_handle gpe_device, - struct - acpi_generic_address - *gpe_block_address, - u32 register_count, - u32 interrupt_number)) -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_remove_gpe_block(acpi_handle gpe_device)) +acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number); + +acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number); + +acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number); + +acpi_status +acpi_setup_gpe_for_wake(acpi_handle parent_device, + acpi_handle gpe_device, u32 gpe_number); + +acpi_status acpi_set_gpe_wake_mask(acpi_handle gpe_device, u32 gpe_number, u8 action); + +acpi_status +acpi_get_gpe_status(acpi_handle gpe_device, + u32 gpe_number, acpi_event_status *event_status); + +acpi_status acpi_disable_all_gpes(void); + +acpi_status acpi_enable_all_runtime_gpes(void); + +acpi_status acpi_get_gpe_device(u32 gpe_index, acpi_handle *gpe_device); + +acpi_status +acpi_install_gpe_block(acpi_handle gpe_device, + struct acpi_generic_address *gpe_block_address, + u32 register_count, u32 interrupt_number); + +acpi_status acpi_remove_gpe_block(acpi_handle gpe_device); + +acpi_status acpi_update_all_gpes(void); /* * Resource interfaces @@ -456,59 +391,33 @@ acpi_buffer_to_resource(u8 *aml_buffer, */ acpi_status acpi_reset(void); -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_read_bit_register(u32 register_id, - u32 *return_value)) +acpi_status acpi_read_bit_register(u32 register_id, u32 *return_value); -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_write_bit_register(u32 register_id, - u32 value)) +acpi_status acpi_write_bit_register(u32 register_id, u32 value); -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_set_firmware_waking_vector(u32 - physical_address)) +acpi_status acpi_set_firmware_waking_vector(u32 physical_address); #if ACPI_MACHINE_WIDTH == 64 -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_set_firmware_waking_vector64(u64 - physical_address)) +acpi_status acpi_set_firmware_waking_vector64(u64 physical_address); #endif acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg); acpi_status acpi_write(u64 value, struct acpi_generic_address *reg); -/* - * Sleep/Wake interfaces - */ acpi_status acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b); acpi_status acpi_enter_sleep_state_prep(u8 sleep_state); -acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state, u8 flags); +acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state); -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void)) +acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void); -acpi_status acpi_leave_sleep_state_prep(u8 sleep_state, u8 flags); +acpi_status acpi_leave_sleep_state_prep(u8 sleep_state); acpi_status acpi_leave_sleep_state(u8 sleep_state); -/* - * ACPI Timer interfaces - */ -#ifdef ACPI_FUTURE_USAGE -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_get_timer_resolution(u32 *resolution)) - -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks)) - -ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status - acpi_get_timer_duration(u32 start_ticks, - u32 end_ticks, - u32 *time_elapsed)) -#endif /* ACPI_FUTURE_USAGE */ - /* * Error/Warning output */ diff --git a/trunk/include/acpi/actbl.h b/trunk/include/acpi/actbl.h index 8dea54665dcf..8e1b92f6f650 100644 --- a/trunk/include/acpi/actbl.h +++ b/trunk/include/acpi/actbl.h @@ -309,13 +309,6 @@ enum acpi_prefered_pm_profiles { PM_TABLET = 8 }; -/* Values for sleep_status and sleep_control registers (V5 FADT) */ - -#define ACPI_X_WAKE_STATUS 0x80 -#define ACPI_X_SLEEP_TYPE_MASK 0x1C -#define ACPI_X_SLEEP_TYPE_POSITION 0x02 -#define ACPI_X_SLEEP_ENABLE 0x20 - /* Reset to default packing */ #pragma pack() diff --git a/trunk/include/acpi/actypes.h b/trunk/include/acpi/actypes.h index eba66043cf1b..d5dee7ce9474 100644 --- a/trunk/include/acpi/actypes.h +++ b/trunk/include/acpi/actypes.h @@ -517,13 +517,6 @@ typedef u64 acpi_integer; #define ACPI_SLEEP_TYPE_MAX 0x7 #define ACPI_SLEEP_TYPE_INVALID 0xFF -/* - * Sleep/Wake flags - */ -#define ACPI_NO_OPTIONAL_METHODS 0x00 /* Do not execute any optional methods */ -#define ACPI_EXECUTE_GTS 0x01 /* For enter sleep interface */ -#define ACPI_EXECUTE_BFS 0x02 /* For leave sleep prep interface */ - /* * Standard notify values */ @@ -539,9 +532,8 @@ typedef u64 acpi_integer; #define ACPI_NOTIFY_DEVICE_PLD_CHECK (u8) 0x09 #define ACPI_NOTIFY_RESERVED (u8) 0x0A #define ACPI_NOTIFY_LOCALITY_UPDATE (u8) 0x0B -#define ACPI_NOTIFY_SHUTDOWN_REQUEST (u8) 0x0C -#define ACPI_NOTIFY_MAX 0x0C +#define ACPI_NOTIFY_MAX 0x0B /* * Types associated with ACPI names and objects. The first group of @@ -706,8 +698,7 @@ typedef u32 acpi_event_status; #define ACPI_ALL_NOTIFY (ACPI_SYSTEM_NOTIFY | ACPI_DEVICE_NOTIFY) #define ACPI_MAX_NOTIFY_HANDLER_TYPE 0x3 -#define ACPI_MAX_SYS_NOTIFY 0x7F -#define ACPI_MAX_DEVICE_SPECIFIC_NOTIFY 0xBF +#define ACPI_MAX_SYS_NOTIFY 0x7f /* Address Space (Operation Region) Types */ @@ -795,15 +786,6 @@ typedef u8 acpi_adr_space_type; #define ACPI_ENABLE_EVENT 1 #define ACPI_DISABLE_EVENT 0 -/* Sleep function dispatch */ - -typedef acpi_status(*ACPI_SLEEP_FUNCTION) (u8 sleep_state, u8 flags); - -struct acpi_sleep_functions { - ACPI_SLEEP_FUNCTION legacy_function; - ACPI_SLEEP_FUNCTION extended_function; -}; - /* * External ACPI object definition */