aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2012-02-14 05:14:27 -0500
committerLen Brown <len.brown@intel.com>2012-03-22 01:44:49 -0400
commit33620c5419e8a11814dd11e02a80e6ef77a43407 (patch)
tree8643dbb1e332dd9ece6fb92f22000413e8d8fdc7
parentd08310fe0d6bd8c82da94e8d8ef48bdbe14d2bd1 (diff)
ACPICA: Support for custom ACPICA build for ACPI 5 reduced hardware
Add ACPI_REDUCED_HARDWARE flag that removes all hardware-related code (about 10% code, 5% static data). Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/acpi/acpica/accommon.h1
-rw-r--r--drivers/acpi/acpica/acdebug.h8
-rw-r--r--drivers/acpi/acpica/acevents.h21
-rw-r--r--drivers/acpi/acpica/acglobal.h11
-rw-r--r--drivers/acpi/acpica/evevent.c4
-rw-r--r--drivers/acpi/acpica/evglock.c4
-rw-r--r--drivers/acpi/acpica/evgpe.c4
-rw-r--r--drivers/acpi/acpica/evgpeblk.c4
-rw-r--r--drivers/acpi/acpica/evgpeinit.c4
-rw-r--r--drivers/acpi/acpica/evgpeutil.c3
-rw-r--r--drivers/acpi/acpica/evmisc.c3
-rw-r--r--drivers/acpi/acpica/evsci.c4
-rw-r--r--drivers/acpi/acpica/evxface.c436
-rw-r--r--drivers/acpi/acpica/evxfevnt.c2
-rw-r--r--drivers/acpi/acpica/evxfgpe.c2
-rw-r--r--drivers/acpi/acpica/hwacpi.c3
-rw-r--r--drivers/acpi/acpica/hwgpe.c4
-rw-r--r--drivers/acpi/acpica/hwregs.c8
-rw-r--r--drivers/acpi/acpica/hwsleep.c2
-rw-r--r--drivers/acpi/acpica/hwtimer.c2
-rw-r--r--drivers/acpi/acpica/hwxface.c3
-rw-r--r--drivers/acpi/acpica/hwxfsleep.c22
-rw-r--r--drivers/acpi/acpica/tbutils.c2
-rw-r--r--drivers/acpi/acpica/utglobal.c9
-rw-r--r--drivers/acpi/acpica/utinit.c37
-rw-r--r--drivers/acpi/acpica/utxface.c6
-rw-r--r--include/acpi/acconfig.h (renamed from drivers/acpi/acpica/acconfig.h)17
-rw-r--r--include/acpi/acexcep.h6
-rw-r--r--include/acpi/acpixf.h219
29 files changed, 531 insertions, 320 deletions
diff --git a/drivers/acpi/acpica/accommon.h b/drivers/acpi/acpica/accommon.h
index a44bd424f9f4..8a7d51bfb3b3 100644
--- a/drivers/acpi/acpica/accommon.h
+++ b/drivers/acpi/acpica/accommon.h
@@ -51,7 +51,6 @@
51 * 51 *
52 * Note: The order of these include files is important. 52 * Note: The order of these include files is important.
53 */ 53 */
54#include "acconfig.h" /* Global configuration constants */
55#include "acmacros.h" /* C macros */ 54#include "acmacros.h" /* C macros */
56#include "aclocal.h" /* Internal data types */ 55#include "aclocal.h" /* Internal data types */
57#include "acobject.h" /* ACPI internal object */ 56#include "acobject.h" /* ACPI internal object */
diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h
index deaa81979561..5e8abb07724f 100644
--- a/drivers/acpi/acpica/acdebug.h
+++ b/drivers/acpi/acpica/acdebug.h
@@ -111,7 +111,7 @@ acpi_status acpi_db_find_name_in_namespace(char *name_arg);
111 111
112void acpi_db_set_scope(char *name); 112void acpi_db_set_scope(char *name);
113 113
114acpi_status acpi_db_sleep(char *object_arg); 114ACPI_HW_DEPENDENT_RETURN_OK(acpi_status acpi_db_sleep(char *object_arg))
115 115
116void acpi_db_find_references(char *object_arg); 116void acpi_db_find_references(char *object_arg);
117 117
@@ -119,11 +119,13 @@ void acpi_db_display_locks(void);
119 119
120void acpi_db_display_resources(char *object_arg); 120void acpi_db_display_resources(char *object_arg);
121 121
122void acpi_db_display_gpes(void); 122ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_db_display_gpes(void))
123 123
124void acpi_db_check_integrity(void); 124void acpi_db_check_integrity(void);
125 125
126void acpi_db_generate_gpe(char *gpe_arg, char *block_arg); 126ACPI_HW_DEPENDENT_RETURN_VOID(void
127 acpi_db_generate_gpe(char *gpe_arg,
128 char *block_arg))
127 129
128void acpi_db_check_predefined_names(void); 130void acpi_db_check_predefined_names(void);
129 131
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h
index c53caa521a30..d700f63e4701 100644
--- a/drivers/acpi/acpica/acevents.h
+++ b/drivers/acpi/acpica/acevents.h
@@ -69,11 +69,10 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node *node,
69 */ 69 */
70acpi_status acpi_ev_init_global_lock_handler(void); 70acpi_status acpi_ev_init_global_lock_handler(void);
71 71
72acpi_status acpi_ev_acquire_global_lock(u16 timeout); 72ACPI_HW_DEPENDENT_RETURN_OK(acpi_status
73 73 acpi_ev_acquire_global_lock(u16 timeout))
74acpi_status acpi_ev_release_global_lock(void); 74 ACPI_HW_DEPENDENT_RETURN_OK(acpi_status acpi_ev_release_global_lock(void))
75 75 acpi_status acpi_ev_remove_global_lock_handler(void);
76acpi_status acpi_ev_remove_global_lock_handler(void);
77 76
78/* 77/*
79 * evgpe - Low-level GPE support 78 * evgpe - Low-level GPE support
@@ -114,7 +113,9 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
114 struct acpi_gpe_block_info *gpe_block, 113 struct acpi_gpe_block_info *gpe_block,
115 void *context); 114 void *context);
116 115
117acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block); 116ACPI_HW_DEPENDENT_RETURN_OK(acpi_status
117 acpi_ev_delete_gpe_block(struct acpi_gpe_block_info
118 *gpe_block))
118 119
119u32 120u32
120acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device, 121acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
@@ -126,9 +127,10 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
126 */ 127 */
127acpi_status acpi_ev_gpe_initialize(void); 128acpi_status acpi_ev_gpe_initialize(void);
128 129
129void acpi_ev_update_gpes(acpi_owner_id table_owner_id); 130ACPI_HW_DEPENDENT_RETURN_VOID(void
131 acpi_ev_update_gpes(acpi_owner_id table_owner_id))
130 132
131acpi_status 133 acpi_status
132acpi_ev_match_gpe_method(acpi_handle obj_handle, 134acpi_ev_match_gpe_method(acpi_handle obj_handle,
133 u32 level, void *context, void **return_value); 135 u32 level, void *context, void **return_value);
134 136
@@ -237,6 +239,5 @@ acpi_status acpi_ev_remove_sci_handler(void);
237 239
238u32 acpi_ev_initialize_sCI(u32 program_sCI); 240u32 acpi_ev_initialize_sCI(u32 program_sCI);
239 241
240void acpi_ev_terminate(void); 242ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_ev_terminate(void))
241
242#endif /* __ACEVENTS_H__ */ 243#endif /* __ACEVENTS_H__ */
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 2853f7673f3b..4f7d3f57d05c 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -147,7 +147,7 @@ u8 acpi_gbl_system_awake_and_running;
147 */ 147 */
148u8 acpi_gbl_reduced_hardware; 148u8 acpi_gbl_reduced_hardware;
149 149
150#endif 150#endif /* DEFINE_ACPI_GLOBALS */
151 151
152/* Do not disassemble buffers to resource descriptors */ 152/* Do not disassemble buffers to resource descriptors */
153 153
@@ -184,8 +184,12 @@ ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;
184 * found in the RSDT/XSDT. 184 * found in the RSDT/XSDT.
185 */ 185 */
186ACPI_EXTERN struct acpi_table_list acpi_gbl_root_table_list; 186ACPI_EXTERN struct acpi_table_list acpi_gbl_root_table_list;
187
188#if (!ACPI_REDUCED_HARDWARE)
187ACPI_EXTERN struct acpi_table_facs *acpi_gbl_FACS; 189ACPI_EXTERN struct acpi_table_facs *acpi_gbl_FACS;
188 190
191#endif /* !ACPI_REDUCED_HARDWARE */
192
189/* These addresses are calculated from the FADT Event Block addresses */ 193/* These addresses are calculated from the FADT Event Block addresses */
190 194
191ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_status; 195ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_status;
@@ -397,10 +401,15 @@ ACPI_EXTERN struct acpi_fixed_event_handler
397ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; 401ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head;
398ACPI_EXTERN struct acpi_gpe_block_info 402ACPI_EXTERN struct acpi_gpe_block_info
399*acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; 403*acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS];
404
405#if (!ACPI_REDUCED_HARDWARE)
406
400ACPI_EXTERN u8 acpi_gbl_all_gpes_initialized; 407ACPI_EXTERN u8 acpi_gbl_all_gpes_initialized;
401ACPI_EXTERN ACPI_GBL_EVENT_HANDLER acpi_gbl_global_event_handler; 408ACPI_EXTERN ACPI_GBL_EVENT_HANDLER acpi_gbl_global_event_handler;
402ACPI_EXTERN void *acpi_gbl_global_event_handler_context; 409ACPI_EXTERN void *acpi_gbl_global_event_handler_context;
403 410
411#endif /* !ACPI_REDUCED_HARDWARE */
412
404/***************************************************************************** 413/*****************************************************************************
405 * 414 *
406 * Debugger globals 415 * Debugger globals
diff --git a/drivers/acpi/acpica/evevent.c b/drivers/acpi/acpica/evevent.c
index 6729ebe2f1e6..07e4dc44f81c 100644
--- a/drivers/acpi/acpica/evevent.c
+++ b/drivers/acpi/acpica/evevent.c
@@ -47,7 +47,7 @@
47 47
48#define _COMPONENT ACPI_EVENTS 48#define _COMPONENT ACPI_EVENTS
49ACPI_MODULE_NAME("evevent") 49ACPI_MODULE_NAME("evevent")
50 50#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
51/* Local prototypes */ 51/* Local prototypes */
52static acpi_status acpi_ev_fixed_event_initialize(void); 52static acpi_status acpi_ev_fixed_event_initialize(void);
53 53
@@ -291,3 +291,5 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event)
291 return ((acpi_gbl_fixed_event_handlers[event]. 291 return ((acpi_gbl_fixed_event_handlers[event].
292 handler) (acpi_gbl_fixed_event_handlers[event].context)); 292 handler) (acpi_gbl_fixed_event_handlers[event].context));
293} 293}
294
295#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/drivers/acpi/acpica/evglock.c b/drivers/acpi/acpica/evglock.c
index 5e5683cb1f0d..cfeab38795d8 100644
--- a/drivers/acpi/acpica/evglock.c
+++ b/drivers/acpi/acpica/evglock.c
@@ -48,7 +48,7 @@
48 48
49#define _COMPONENT ACPI_EVENTS 49#define _COMPONENT ACPI_EVENTS
50ACPI_MODULE_NAME("evglock") 50ACPI_MODULE_NAME("evglock")
51 51#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
52/* Local prototypes */ 52/* Local prototypes */
53static u32 acpi_ev_global_lock_handler(void *context); 53static u32 acpi_ev_global_lock_handler(void *context);
54 54
@@ -339,3 +339,5 @@ acpi_status acpi_ev_release_global_lock(void)
339 acpi_os_release_mutex(acpi_gbl_global_lock_mutex->mutex.os_mutex); 339 acpi_os_release_mutex(acpi_gbl_global_lock_mutex->mutex.os_mutex);
340 return_ACPI_STATUS(status); 340 return_ACPI_STATUS(status);
341} 341}
342
343#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
index 9e88cb6fb25e..8ba0e5f17091 100644
--- a/drivers/acpi/acpica/evgpe.c
+++ b/drivers/acpi/acpica/evgpe.c
@@ -48,7 +48,7 @@
48 48
49#define _COMPONENT ACPI_EVENTS 49#define _COMPONENT ACPI_EVENTS
50ACPI_MODULE_NAME("evgpe") 50ACPI_MODULE_NAME("evgpe")
51 51#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
52/* Local prototypes */ 52/* Local prototypes */
53static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context); 53static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context);
54 54
@@ -766,3 +766,5 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
766 766
767 return_UINT32(ACPI_INTERRUPT_HANDLED); 767 return_UINT32(ACPI_INTERRUPT_HANDLED);
768} 768}
769
770#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c
index be75339cd5dd..23a3ca86b2eb 100644
--- a/drivers/acpi/acpica/evgpeblk.c
+++ b/drivers/acpi/acpica/evgpeblk.c
@@ -48,7 +48,7 @@
48 48
49#define _COMPONENT ACPI_EVENTS 49#define _COMPONENT ACPI_EVENTS
50ACPI_MODULE_NAME("evgpeblk") 50ACPI_MODULE_NAME("evgpeblk")
51 51#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
52/* Local prototypes */ 52/* Local prototypes */
53static acpi_status 53static acpi_status
54acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block, 54acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block,
@@ -504,3 +504,5 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
504 504
505 return_ACPI_STATUS(AE_OK); 505 return_ACPI_STATUS(AE_OK);
506} 506}
507
508#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/drivers/acpi/acpica/evgpeinit.c b/drivers/acpi/acpica/evgpeinit.c
index adf7494da9db..da0add858f81 100644
--- a/drivers/acpi/acpica/evgpeinit.c
+++ b/drivers/acpi/acpica/evgpeinit.c
@@ -48,7 +48,7 @@
48 48
49#define _COMPONENT ACPI_EVENTS 49#define _COMPONENT ACPI_EVENTS
50ACPI_MODULE_NAME("evgpeinit") 50ACPI_MODULE_NAME("evgpeinit")
51 51#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
52/* 52/*
53 * Note: History of _PRW support in ACPICA 53 * Note: History of _PRW support in ACPICA
54 * 54 *
@@ -440,3 +440,5 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle,
440 name, gpe_number)); 440 name, gpe_number));
441 return_ACPI_STATUS(AE_OK); 441 return_ACPI_STATUS(AE_OK);
442} 442}
443
444#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/drivers/acpi/acpica/evgpeutil.c b/drivers/acpi/acpica/evgpeutil.c
index 25073932aa10..3c43796b8361 100644
--- a/drivers/acpi/acpica/evgpeutil.c
+++ b/drivers/acpi/acpica/evgpeutil.c
@@ -48,6 +48,7 @@
48#define _COMPONENT ACPI_EVENTS 48#define _COMPONENT ACPI_EVENTS
49ACPI_MODULE_NAME("evgpeutil") 49ACPI_MODULE_NAME("evgpeutil")
50 50
51#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
51/******************************************************************************* 52/*******************************************************************************
52 * 53 *
53 * FUNCTION: acpi_ev_walk_gpe_list 54 * FUNCTION: acpi_ev_walk_gpe_list
@@ -374,3 +375,5 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
374 375
375 return_ACPI_STATUS(AE_OK); 376 return_ACPI_STATUS(AE_OK);
376} 377}
378
379#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/drivers/acpi/acpica/evmisc.c b/drivers/acpi/acpica/evmisc.c
index 84966f416463..0912f62f05a0 100644
--- a/drivers/acpi/acpica/evmisc.c
+++ b/drivers/acpi/acpica/evmisc.c
@@ -270,6 +270,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context)
270 acpi_ut_delete_generic_state(notify_info); 270 acpi_ut_delete_generic_state(notify_info);
271} 271}
272 272
273#if (!ACPI_REDUCED_HARDWARE)
273/****************************************************************************** 274/******************************************************************************
274 * 275 *
275 * FUNCTION: acpi_ev_terminate 276 * FUNCTION: acpi_ev_terminate
@@ -338,3 +339,5 @@ void acpi_ev_terminate(void)
338 } 339 }
339 return_VOID; 340 return_VOID;
340} 341}
342
343#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c
index 26065c612e76..6a57aa2d70d1 100644
--- a/drivers/acpi/acpica/evsci.c
+++ b/drivers/acpi/acpica/evsci.c
@@ -48,7 +48,7 @@
48 48
49#define _COMPONENT ACPI_EVENTS 49#define _COMPONENT ACPI_EVENTS
50ACPI_MODULE_NAME("evsci") 50ACPI_MODULE_NAME("evsci")
51 51#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
52/* Local prototypes */ 52/* Local prototypes */
53static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context); 53static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context);
54 54
@@ -181,3 +181,5 @@ acpi_status acpi_ev_remove_sci_handler(void)
181 181
182 return_ACPI_STATUS(status); 182 return_ACPI_STATUS(status);
183} 183}
184
185#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
index 61944e89565a..44bef5744ebb 100644
--- a/drivers/acpi/acpica/evxface.c
+++ b/drivers/acpi/acpica/evxface.c
@@ -51,222 +51,6 @@
51#define _COMPONENT ACPI_EVENTS 51#define _COMPONENT ACPI_EVENTS
52ACPI_MODULE_NAME("evxface") 52ACPI_MODULE_NAME("evxface")
53 53
54/*******************************************************************************
55 *
56 * FUNCTION: acpi_install_exception_handler
57 *
58 * PARAMETERS: Handler - Pointer to the handler function for the
59 * event
60 *
61 * RETURN: Status
62 *
63 * DESCRIPTION: Saves the pointer to the handler function
64 *
65 ******************************************************************************/
66#ifdef ACPI_FUTURE_USAGE
67acpi_status acpi_install_exception_handler(acpi_exception_handler handler)
68{
69 acpi_status status;
70
71 ACPI_FUNCTION_TRACE(acpi_install_exception_handler);
72
73 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
74 if (ACPI_FAILURE(status)) {
75 return_ACPI_STATUS(status);
76 }
77
78 /* Don't allow two handlers. */
79
80 if (acpi_gbl_exception_handler) {
81 status = AE_ALREADY_EXISTS;
82 goto cleanup;
83 }
84
85 /* Install the handler */
86
87 acpi_gbl_exception_handler = handler;
88
89 cleanup:
90 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
91 return_ACPI_STATUS(status);
92}
93
94ACPI_EXPORT_SYMBOL(acpi_install_exception_handler)
95#endif /* ACPI_FUTURE_USAGE */
96
97/*******************************************************************************
98 *
99 * FUNCTION: acpi_install_global_event_handler
100 *
101 * PARAMETERS: Handler - Pointer to the global event handler function
102 * Context - Value passed to the handler on each event
103 *
104 * RETURN: Status
105 *
106 * DESCRIPTION: Saves the pointer to the handler function. The global handler
107 * is invoked upon each incoming GPE and Fixed Event. It is
108 * invoked at interrupt level at the time of the event dispatch.
109 * Can be used to update event counters, etc.
110 *
111 ******************************************************************************/
112acpi_status
113acpi_install_global_event_handler(ACPI_GBL_EVENT_HANDLER handler, void *context)
114{
115 acpi_status status;
116
117 ACPI_FUNCTION_TRACE(acpi_install_global_event_handler);
118
119 /* Parameter validation */
120
121 if (!handler) {
122 return_ACPI_STATUS(AE_BAD_PARAMETER);
123 }
124
125 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
126 if (ACPI_FAILURE(status)) {
127 return_ACPI_STATUS(status);
128 }
129
130 /* Don't allow two handlers. */
131
132 if (acpi_gbl_global_event_handler) {
133 status = AE_ALREADY_EXISTS;
134 goto cleanup;
135 }
136
137 acpi_gbl_global_event_handler = handler;
138 acpi_gbl_global_event_handler_context = context;
139
140 cleanup:
141 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
142 return_ACPI_STATUS(status);
143}
144
145ACPI_EXPORT_SYMBOL(acpi_install_global_event_handler)
146
147/*******************************************************************************
148 *
149 * FUNCTION: acpi_install_fixed_event_handler
150 *
151 * PARAMETERS: Event - Event type to enable.
152 * Handler - Pointer to the handler function for the
153 * event
154 * Context - Value passed to the handler on each GPE
155 *
156 * RETURN: Status
157 *
158 * DESCRIPTION: Saves the pointer to the handler function and then enables the
159 * event.
160 *
161 ******************************************************************************/
162acpi_status
163acpi_install_fixed_event_handler(u32 event,
164 acpi_event_handler handler, void *context)
165{
166 acpi_status status;
167
168 ACPI_FUNCTION_TRACE(acpi_install_fixed_event_handler);
169
170 /* Parameter validation */
171
172 if (event > ACPI_EVENT_MAX) {
173 return_ACPI_STATUS(AE_BAD_PARAMETER);
174 }
175
176 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
177 if (ACPI_FAILURE(status)) {
178 return_ACPI_STATUS(status);
179 }
180
181 /* Don't allow two handlers. */
182
183 if (NULL != acpi_gbl_fixed_event_handlers[event].handler) {
184 status = AE_ALREADY_EXISTS;
185 goto cleanup;
186 }
187
188 /* Install the handler before enabling the event */
189
190 acpi_gbl_fixed_event_handlers[event].handler = handler;
191 acpi_gbl_fixed_event_handlers[event].context = context;
192
193 status = acpi_clear_event(event);
194 if (ACPI_SUCCESS(status))
195 status = acpi_enable_event(event, 0);
196 if (ACPI_FAILURE(status)) {
197 ACPI_WARNING((AE_INFO, "Could not enable fixed event 0x%X",
198 event));
199
200 /* Remove the handler */
201
202 acpi_gbl_fixed_event_handlers[event].handler = NULL;
203 acpi_gbl_fixed_event_handlers[event].context = NULL;
204 } else {
205 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
206 "Enabled fixed event %X, Handler=%p\n", event,
207 handler));
208 }
209
210 cleanup:
211 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
212 return_ACPI_STATUS(status);
213}
214
215ACPI_EXPORT_SYMBOL(acpi_install_fixed_event_handler)
216
217/*******************************************************************************
218 *
219 * FUNCTION: acpi_remove_fixed_event_handler
220 *
221 * PARAMETERS: Event - Event type to disable.
222 * Handler - Address of the handler
223 *
224 * RETURN: Status
225 *
226 * DESCRIPTION: Disables the event and unregisters the event handler.
227 *
228 ******************************************************************************/
229acpi_status
230acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler)
231{
232 acpi_status status = AE_OK;
233
234 ACPI_FUNCTION_TRACE(acpi_remove_fixed_event_handler);
235
236 /* Parameter validation */
237
238 if (event > ACPI_EVENT_MAX) {
239 return_ACPI_STATUS(AE_BAD_PARAMETER);
240 }
241
242 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
243 if (ACPI_FAILURE(status)) {
244 return_ACPI_STATUS(status);
245 }
246
247 /* Disable the event before removing the handler */
248
249 status = acpi_disable_event(event, 0);
250
251 /* Always Remove the handler */
252
253 acpi_gbl_fixed_event_handlers[event].handler = NULL;
254 acpi_gbl_fixed_event_handlers[event].context = NULL;
255
256 if (ACPI_FAILURE(status)) {
257 ACPI_WARNING((AE_INFO,
258 "Could not write to fixed event enable register 0x%X",
259 event));
260 } else {
261 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X\n",
262 event));
263 }
264
265 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
266 return_ACPI_STATUS(status);
267}
268
269ACPI_EXPORT_SYMBOL(acpi_remove_fixed_event_handler)
270 54
271/******************************************************************************* 55/*******************************************************************************
272 * 56 *
@@ -334,6 +118,7 @@ acpi_add_handler_object(struct acpi_object_notify_handler *parent_obj,
334 return AE_OK; 118 return AE_OK;
335} 119}
336 120
121
337/******************************************************************************* 122/*******************************************************************************
338 * 123 *
339 * FUNCTION: acpi_install_notify_handler 124 * FUNCTION: acpi_install_notify_handler
@@ -705,6 +490,224 @@ ACPI_EXPORT_SYMBOL(acpi_remove_notify_handler)
705 490
706/******************************************************************************* 491/*******************************************************************************
707 * 492 *
493 * FUNCTION: acpi_install_exception_handler
494 *
495 * PARAMETERS: Handler - Pointer to the handler function for the
496 * event
497 *
498 * RETURN: Status
499 *
500 * DESCRIPTION: Saves the pointer to the handler function
501 *
502 ******************************************************************************/
503#ifdef ACPI_FUTURE_USAGE
504acpi_status acpi_install_exception_handler(acpi_exception_handler handler)
505{
506 acpi_status status;
507
508 ACPI_FUNCTION_TRACE(acpi_install_exception_handler);
509
510 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
511 if (ACPI_FAILURE(status)) {
512 return_ACPI_STATUS(status);
513 }
514
515 /* Don't allow two handlers. */
516
517 if (acpi_gbl_exception_handler) {
518 status = AE_ALREADY_EXISTS;
519 goto cleanup;
520 }
521
522 /* Install the handler */
523
524 acpi_gbl_exception_handler = handler;
525
526 cleanup:
527 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
528 return_ACPI_STATUS(status);
529}
530
531ACPI_EXPORT_SYMBOL(acpi_install_exception_handler)
532#endif /* ACPI_FUTURE_USAGE */
533
534#if (!ACPI_REDUCED_HARDWARE)
535/*******************************************************************************
536 *
537 * FUNCTION: acpi_install_global_event_handler
538 *
539 * PARAMETERS: Handler - Pointer to the global event handler function
540 * Context - Value passed to the handler on each event
541 *
542 * RETURN: Status
543 *
544 * DESCRIPTION: Saves the pointer to the handler function. The global handler
545 * is invoked upon each incoming GPE and Fixed Event. It is
546 * invoked at interrupt level at the time of the event dispatch.
547 * Can be used to update event counters, etc.
548 *
549 ******************************************************************************/
550acpi_status
551acpi_install_global_event_handler(ACPI_GBL_EVENT_HANDLER handler, void *context)
552{
553 acpi_status status;
554
555 ACPI_FUNCTION_TRACE(acpi_install_global_event_handler);
556
557 /* Parameter validation */
558
559 if (!handler) {
560 return_ACPI_STATUS(AE_BAD_PARAMETER);
561 }
562
563 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
564 if (ACPI_FAILURE(status)) {
565 return_ACPI_STATUS(status);
566 }
567
568 /* Don't allow two handlers. */
569
570 if (acpi_gbl_global_event_handler) {
571 status = AE_ALREADY_EXISTS;
572 goto cleanup;
573 }
574
575 acpi_gbl_global_event_handler = handler;
576 acpi_gbl_global_event_handler_context = context;
577
578 cleanup:
579 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
580 return_ACPI_STATUS(status);
581}
582
583ACPI_EXPORT_SYMBOL(acpi_install_global_event_handler)
584
585/*******************************************************************************
586 *
587 * FUNCTION: acpi_install_fixed_event_handler
588 *
589 * PARAMETERS: Event - Event type to enable.
590 * Handler - Pointer to the handler function for the
591 * event
592 * Context - Value passed to the handler on each GPE
593 *
594 * RETURN: Status
595 *
596 * DESCRIPTION: Saves the pointer to the handler function and then enables the
597 * event.
598 *
599 ******************************************************************************/
600acpi_status
601acpi_install_fixed_event_handler(u32 event,
602 acpi_event_handler handler, void *context)
603{
604 acpi_status status;
605
606 ACPI_FUNCTION_TRACE(acpi_install_fixed_event_handler);
607
608 /* Parameter validation */
609
610 if (event > ACPI_EVENT_MAX) {
611 return_ACPI_STATUS(AE_BAD_PARAMETER);
612 }
613
614 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
615 if (ACPI_FAILURE(status)) {
616 return_ACPI_STATUS(status);
617 }
618
619 /* Don't allow two handlers. */
620
621 if (NULL != acpi_gbl_fixed_event_handlers[event].handler) {
622 status = AE_ALREADY_EXISTS;
623 goto cleanup;
624 }
625
626 /* Install the handler before enabling the event */
627
628 acpi_gbl_fixed_event_handlers[event].handler = handler;
629 acpi_gbl_fixed_event_handlers[event].context = context;
630
631 status = acpi_clear_event(event);
632 if (ACPI_SUCCESS(status))
633 status = acpi_enable_event(event, 0);
634 if (ACPI_FAILURE(status)) {
635 ACPI_WARNING((AE_INFO, "Could not enable fixed event 0x%X",
636 event));
637
638 /* Remove the handler */
639
640 acpi_gbl_fixed_event_handlers[event].handler = NULL;
641 acpi_gbl_fixed_event_handlers[event].context = NULL;
642 } else {
643 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
644 "Enabled fixed event %X, Handler=%p\n", event,
645 handler));
646 }
647
648 cleanup:
649 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
650 return_ACPI_STATUS(status);
651}
652
653ACPI_EXPORT_SYMBOL(acpi_install_fixed_event_handler)
654
655/*******************************************************************************
656 *
657 * FUNCTION: acpi_remove_fixed_event_handler
658 *
659 * PARAMETERS: Event - Event type to disable.
660 * Handler - Address of the handler
661 *
662 * RETURN: Status
663 *
664 * DESCRIPTION: Disables the event and unregisters the event handler.
665 *
666 ******************************************************************************/
667acpi_status
668acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler)
669{
670 acpi_status status = AE_OK;
671
672 ACPI_FUNCTION_TRACE(acpi_remove_fixed_event_handler);
673
674 /* Parameter validation */
675
676 if (event > ACPI_EVENT_MAX) {
677 return_ACPI_STATUS(AE_BAD_PARAMETER);
678 }
679
680 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
681 if (ACPI_FAILURE(status)) {
682 return_ACPI_STATUS(status);
683 }
684
685 /* Disable the event before removing the handler */
686
687 status = acpi_disable_event(event, 0);
688
689 /* Always Remove the handler */
690
691 acpi_gbl_fixed_event_handlers[event].handler = NULL;
692 acpi_gbl_fixed_event_handlers[event].context = NULL;
693
694 if (ACPI_FAILURE(status)) {
695 ACPI_WARNING((AE_INFO,
696 "Could not write to fixed event enable register 0x%X",
697 event));
698 } else {
699 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X\n",
700 event));
701 }
702
703 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
704 return_ACPI_STATUS(status);
705}
706
707ACPI_EXPORT_SYMBOL(acpi_remove_fixed_event_handler)
708
709/*******************************************************************************
710 *
708 * FUNCTION: acpi_install_gpe_handler 711 * FUNCTION: acpi_install_gpe_handler
709 * 712 *
710 * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT 713 * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT
@@ -984,3 +987,4 @@ acpi_status acpi_release_global_lock(u32 handle)
984} 987}
985 988
986ACPI_EXPORT_SYMBOL(acpi_release_global_lock) 989ACPI_EXPORT_SYMBOL(acpi_release_global_lock)
990#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c
index 1768bbec1002..77cee5a5e891 100644
--- a/drivers/acpi/acpica/evxfevnt.c
+++ b/drivers/acpi/acpica/evxfevnt.c
@@ -49,6 +49,7 @@
49#define _COMPONENT ACPI_EVENTS 49#define _COMPONENT ACPI_EVENTS
50ACPI_MODULE_NAME("evxfevnt") 50ACPI_MODULE_NAME("evxfevnt")
51 51
52#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
52/******************************************************************************* 53/*******************************************************************************
53 * 54 *
54 * FUNCTION: acpi_enable 55 * FUNCTION: acpi_enable
@@ -352,3 +353,4 @@ acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status)
352} 353}
353 354
354ACPI_EXPORT_SYMBOL(acpi_get_event_status) 355ACPI_EXPORT_SYMBOL(acpi_get_event_status)
356#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c
index 33388fd69df4..86f9b343ebd4 100644
--- a/drivers/acpi/acpica/evxfgpe.c
+++ b/drivers/acpi/acpica/evxfgpe.c
@@ -50,6 +50,7 @@
50#define _COMPONENT ACPI_EVENTS 50#define _COMPONENT ACPI_EVENTS
51ACPI_MODULE_NAME("evxfgpe") 51ACPI_MODULE_NAME("evxfgpe")
52 52
53#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
53/****************************************************************************** 54/******************************************************************************
54 * 55 *
55 * FUNCTION: acpi_update_all_gpes 56 * FUNCTION: acpi_update_all_gpes
@@ -695,3 +696,4 @@ acpi_get_gpe_device(u32 index, acpi_handle *gpe_device)
695} 696}
696 697
697ACPI_EXPORT_SYMBOL(acpi_get_gpe_device) 698ACPI_EXPORT_SYMBOL(acpi_get_gpe_device)
699#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/drivers/acpi/acpica/hwacpi.c b/drivers/acpi/acpica/hwacpi.c
index d21ec5f0b3a9..d0b9ed5df97e 100644
--- a/drivers/acpi/acpica/hwacpi.c
+++ b/drivers/acpi/acpica/hwacpi.c
@@ -48,6 +48,7 @@
48#define _COMPONENT ACPI_HARDWARE 48#define _COMPONENT ACPI_HARDWARE
49ACPI_MODULE_NAME("hwacpi") 49ACPI_MODULE_NAME("hwacpi")
50 50
51#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
51/****************************************************************************** 52/******************************************************************************
52 * 53 *
53 * FUNCTION: acpi_hw_set_mode 54 * FUNCTION: acpi_hw_set_mode
@@ -166,3 +167,5 @@ u32 acpi_hw_get_mode(void)
166 return_UINT32(ACPI_SYS_MODE_LEGACY); 167 return_UINT32(ACPI_SYS_MODE_LEGACY);
167 } 168 }
168} 169}
170
171#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/drivers/acpi/acpica/hwgpe.c b/drivers/acpi/acpica/hwgpe.c
index 1a6894afef79..25bd28c4ae8d 100644
--- a/drivers/acpi/acpica/hwgpe.c
+++ b/drivers/acpi/acpica/hwgpe.c
@@ -48,7 +48,7 @@
48 48
49#define _COMPONENT ACPI_HARDWARE 49#define _COMPONENT ACPI_HARDWARE
50ACPI_MODULE_NAME("hwgpe") 50ACPI_MODULE_NAME("hwgpe")
51 51#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
52/* Local prototypes */ 52/* Local prototypes */
53static acpi_status 53static acpi_status
54acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, 54acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
@@ -479,3 +479,5 @@ acpi_status acpi_hw_enable_all_wakeup_gpes(void)
479 status = acpi_ev_walk_gpe_list(acpi_hw_enable_wakeup_gpe_block, NULL); 479 status = acpi_ev_walk_gpe_list(acpi_hw_enable_wakeup_gpe_block, NULL);
480 return_ACPI_STATUS(status); 480 return_ACPI_STATUS(status);
481} 481}
482
483#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c
index 4ea4eeb51bfd..17a78e5ef175 100644
--- a/drivers/acpi/acpica/hwregs.c
+++ b/drivers/acpi/acpica/hwregs.c
@@ -51,6 +51,7 @@
51#define _COMPONENT ACPI_HARDWARE 51#define _COMPONENT ACPI_HARDWARE
52ACPI_MODULE_NAME("hwregs") 52ACPI_MODULE_NAME("hwregs")
53 53
54#if (!ACPI_REDUCED_HARDWARE)
54/* Local Prototypes */ 55/* Local Prototypes */
55static acpi_status 56static acpi_status
56acpi_hw_read_multiple(u32 *value, 57acpi_hw_read_multiple(u32 *value,
@@ -62,6 +63,8 @@ acpi_hw_write_multiple(u32 value,
62 struct acpi_generic_address *register_a, 63 struct acpi_generic_address *register_a,
63 struct acpi_generic_address *register_b); 64 struct acpi_generic_address *register_b);
64 65
66#endif /* !ACPI_REDUCED_HARDWARE */
67
65/****************************************************************************** 68/******************************************************************************
66 * 69 *
67 * FUNCTION: acpi_hw_validate_register 70 * FUNCTION: acpi_hw_validate_register
@@ -240,6 +243,7 @@ acpi_status acpi_hw_write(u32 value, struct acpi_generic_address *reg)
240 return (status); 243 return (status);
241} 244}
242 245
246#if (!ACPI_REDUCED_HARDWARE)
243/******************************************************************************* 247/*******************************************************************************
244 * 248 *
245 * FUNCTION: acpi_hw_clear_acpi_status 249 * FUNCTION: acpi_hw_clear_acpi_status
@@ -285,7 +289,7 @@ exit:
285 289
286/******************************************************************************* 290/*******************************************************************************
287 * 291 *
288 * FUNCTION: acpi_hw_get_register_bit_mask 292 * FUNCTION: acpi_hw_get_bit_register_info
289 * 293 *
290 * PARAMETERS: register_id - Index of ACPI Register to access 294 * PARAMETERS: register_id - Index of ACPI Register to access
291 * 295 *
@@ -658,3 +662,5 @@ acpi_hw_write_multiple(u32 value,
658 662
659 return (status); 663 return (status);
660} 664}
665
666#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c
index 59a2a6b897d4..fa341471c231 100644
--- a/drivers/acpi/acpica/hwsleep.c
+++ b/drivers/acpi/acpica/hwsleep.c
@@ -197,6 +197,7 @@ void acpi_hw_execute_SST(u32 indicator_id)
197 } 197 }
198} 198}
199 199
200#if (!ACPI_REDUCED_HARDWARE)
200/******************************************************************************* 201/*******************************************************************************
201 * 202 *
202 * FUNCTION: acpi_hw_legacy_sleep 203 * FUNCTION: acpi_hw_legacy_sleep
@@ -512,6 +513,7 @@ acpi_status acpi_hw_legacy_wake(u8 sleep_state)
512 return_ACPI_STATUS(status); 513 return_ACPI_STATUS(status);
513} 514}
514 515
516#endif /* !ACPI_REDUCED_HARDWARE */
515 517
516/******************************************************************************* 518/*******************************************************************************
517 * 519 *
diff --git a/drivers/acpi/acpica/hwtimer.c b/drivers/acpi/acpica/hwtimer.c
index d4973d9da9f1..f1b2c3b94cac 100644
--- a/drivers/acpi/acpica/hwtimer.c
+++ b/drivers/acpi/acpica/hwtimer.c
@@ -49,6 +49,7 @@
49#define _COMPONENT ACPI_HARDWARE 49#define _COMPONENT ACPI_HARDWARE
50ACPI_MODULE_NAME("hwtimer") 50ACPI_MODULE_NAME("hwtimer")
51 51
52#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
52/****************************************************************************** 53/******************************************************************************
53 * 54 *
54 * FUNCTION: acpi_get_timer_resolution 55 * FUNCTION: acpi_get_timer_resolution
@@ -187,3 +188,4 @@ acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed)
187} 188}
188 189
189ACPI_EXPORT_SYMBOL(acpi_get_timer_duration) 190ACPI_EXPORT_SYMBOL(acpi_get_timer_duration)
191#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
index 9d38eb6c0d0b..bb8dba612212 100644
--- a/drivers/acpi/acpica/hwxface.c
+++ b/drivers/acpi/acpica/hwxface.c
@@ -286,6 +286,7 @@ acpi_status acpi_write(u64 value, struct acpi_generic_address *reg)
286 286
287ACPI_EXPORT_SYMBOL(acpi_write) 287ACPI_EXPORT_SYMBOL(acpi_write)
288 288
289#if (!ACPI_REDUCED_HARDWARE)
289/******************************************************************************* 290/*******************************************************************************
290 * 291 *
291 * FUNCTION: acpi_read_bit_register 292 * FUNCTION: acpi_read_bit_register
@@ -453,7 +454,7 @@ unlock_and_exit:
453} 454}
454 455
455ACPI_EXPORT_SYMBOL(acpi_write_bit_register) 456ACPI_EXPORT_SYMBOL(acpi_write_bit_register)
456 457#endif /* !ACPI_REDUCED_HARDWARE */
457/******************************************************************************* 458/*******************************************************************************
458 * 459 *
459 * FUNCTION: acpi_get_sleep_type_data 460 * FUNCTION: acpi_get_sleep_type_data
diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
index 29c0fd3810b0..d599961e93c8 100644
--- a/drivers/acpi/acpica/hwxfsleep.c
+++ b/drivers/acpi/acpica/hwxfsleep.c
@@ -48,6 +48,7 @@
48#define _COMPONENT ACPI_HARDWARE 48#define _COMPONENT ACPI_HARDWARE
49ACPI_MODULE_NAME("hwxfsleep") 49ACPI_MODULE_NAME("hwxfsleep")
50 50
51#if (!ACPI_REDUCED_HARDWARE)
51/******************************************************************************* 52/*******************************************************************************
52 * 53 *
53 * FUNCTION: acpi_set_firmware_waking_vector 54 * FUNCTION: acpi_set_firmware_waking_vector
@@ -189,7 +190,7 @@ acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void)
189} 190}
190 191
191ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios) 192ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios)
192 193#endif /* !ACPI_REDUCED_HARDWARE */
193/******************************************************************************* 194/*******************************************************************************
194 * 195 *
195 * FUNCTION: acpi_enter_sleep_state_prep 196 * FUNCTION: acpi_enter_sleep_state_prep
@@ -290,6 +291,7 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
290 acpi_gbl_sleep_type_a, acpi_gbl_sleep_type_b)); 291 acpi_gbl_sleep_type_a, acpi_gbl_sleep_type_b));
291 return_ACPI_STATUS(AE_AML_OPERAND_VALUE); 292 return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
292 } 293 }
294#if (!ACPI_REDUCED_HARDWARE)
293 295
294 /* If Hardware Reduced flag is set, must use the extended sleep registers */ 296 /* If Hardware Reduced flag is set, must use the extended sleep registers */
295 297
@@ -301,6 +303,11 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
301 status = acpi_hw_legacy_sleep(sleep_state); 303 status = acpi_hw_legacy_sleep(sleep_state);
302 } 304 }
303 305
306#else
307 status = acpi_hw_extended_sleep(sleep_state);
308
309#endif /* !ACPI_REDUCED_HARDWARE */
310
304 return_ACPI_STATUS(status); 311 return_ACPI_STATUS(status);
305} 312}
306 313
@@ -326,6 +333,8 @@ acpi_status acpi_leave_sleep_state_prep(u8 sleep_state)
326 ACPI_FUNCTION_TRACE(acpi_leave_sleep_state); 333 ACPI_FUNCTION_TRACE(acpi_leave_sleep_state);
327 334
328 335
336#if (!ACPI_REDUCED_HARDWARE)
337
329 /* If Hardware Reduced flag is set, must use the extended sleep registers */ 338 /* If Hardware Reduced flag is set, must use the extended sleep registers */
330 339
331 if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) { 340 if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) {
@@ -335,6 +344,10 @@ acpi_status acpi_leave_sleep_state_prep(u8 sleep_state)
335 344
336 status = acpi_hw_legacy_wake_prep(sleep_state); 345 status = acpi_hw_legacy_wake_prep(sleep_state);
337 } 346 }
347#else
348 status = acpi_hw_extended_wake_prep(sleep_state);
349
350#endif /* !ACPI_REDUCED_HARDWARE */
338 351
339 352
340 return_ACPI_STATUS(status); 353 return_ACPI_STATUS(status);
@@ -361,6 +374,8 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state)
361 ACPI_FUNCTION_TRACE(acpi_leave_sleep_state); 374 ACPI_FUNCTION_TRACE(acpi_leave_sleep_state);
362 375
363 376
377#if (!ACPI_REDUCED_HARDWARE)
378
364 /* If Hardware Reduced flag is set, must use the extended sleep registers */ 379 /* If Hardware Reduced flag is set, must use the extended sleep registers */
365 380
366 if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) { 381 if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) {
@@ -371,6 +386,11 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state)
371 status = acpi_hw_legacy_wake(sleep_state); 386 status = acpi_hw_legacy_wake(sleep_state);
372 } 387 }
373 388
389#else
390 status = acpi_hw_extended_wake(sleep_state);
391
392#endif /* !ACPI_REDUCED_HARDWARE */
393
374 return_ACPI_STATUS(status); 394 return_ACPI_STATUS(status);
375} 395}
376 396
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index 09ca39e14337..1347c084fc2b 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -118,6 +118,7 @@ acpi_tb_check_xsdt(acpi_physical_address address)
118 return AE_OK; 118 return AE_OK;
119} 119}
120 120
121#if (!ACPI_REDUCED_HARDWARE)
121/******************************************************************************* 122/*******************************************************************************
122 * 123 *
123 * FUNCTION: acpi_tb_initialize_facs 124 * FUNCTION: acpi_tb_initialize_facs
@@ -148,6 +149,7 @@ acpi_status acpi_tb_initialize_facs(void)
148 &acpi_gbl_FACS)); 149 &acpi_gbl_FACS));
149 return status; 150 return status;
150} 151}
152#endif /* !ACPI_REDUCED_HARDWARE */
151 153
152/******************************************************************************* 154/*******************************************************************************
153 * 155 *
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index 4153584cf526..90f53b42eca9 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -140,6 +140,7 @@ const struct acpi_predefined_names acpi_gbl_pre_defined_names[] = {
140 {NULL, ACPI_TYPE_ANY, NULL} 140 {NULL, ACPI_TYPE_ANY, NULL}
141}; 141};
142 142
143#if (!ACPI_REDUCED_HARDWARE)
143/****************************************************************************** 144/******************************************************************************
144 * 145 *
145 * Event and Hardware globals 146 * Event and Hardware globals
@@ -236,6 +237,7 @@ struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] =
236 ACPI_BITMASK_RT_CLOCK_STATUS, 237 ACPI_BITMASK_RT_CLOCK_STATUS,
237 ACPI_BITMASK_RT_CLOCK_ENABLE}, 238 ACPI_BITMASK_RT_CLOCK_ENABLE},
238}; 239};
240#endif /* !ACPI_REDUCED_HARDWARE */
239 241
240/******************************************************************************* 242/*******************************************************************************
241 * 243 *
@@ -286,6 +288,8 @@ acpi_status acpi_ut_init_globals(void)
286 288
287 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000; 289 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
288 290
291#if (!ACPI_REDUCED_HARDWARE)
292
289 /* GPE support */ 293 /* GPE support */
290 294
291 acpi_gbl_gpe_xrupt_list_head = NULL; 295 acpi_gbl_gpe_xrupt_list_head = NULL;
@@ -294,6 +298,10 @@ acpi_status acpi_ut_init_globals(void)
294 acpi_current_gpe_count = 0; 298 acpi_current_gpe_count = 0;
295 acpi_gbl_all_gpes_initialized = FALSE; 299 acpi_gbl_all_gpes_initialized = FALSE;
296 300
301 acpi_gbl_global_event_handler = NULL;
302
303#endif /* !ACPI_REDUCED_HARDWARE */
304
297 /* Global handlers */ 305 /* Global handlers */
298 306
299 acpi_gbl_system_notify.handler = NULL; 307 acpi_gbl_system_notify.handler = NULL;
@@ -302,7 +310,6 @@ acpi_status acpi_ut_init_globals(void)
302 acpi_gbl_init_handler = NULL; 310 acpi_gbl_init_handler = NULL;
303 acpi_gbl_table_handler = NULL; 311 acpi_gbl_table_handler = NULL;
304 acpi_gbl_interface_handler = NULL; 312 acpi_gbl_interface_handler = NULL;
305 acpi_gbl_global_event_handler = NULL;
306 313
307 /* Global Lock support */ 314 /* Global Lock support */
308 315
diff --git a/drivers/acpi/acpica/utinit.c b/drivers/acpi/acpica/utinit.c
index 8359c0c5dc98..246798e4c938 100644
--- a/drivers/acpi/acpica/utinit.c
+++ b/drivers/acpi/acpica/utinit.c
@@ -53,27 +53,35 @@ ACPI_MODULE_NAME("utinit")
53/* Local prototypes */ 53/* Local prototypes */
54static void acpi_ut_terminate(void); 54static void acpi_ut_terminate(void);
55 55
56#if (!ACPI_REDUCED_HARDWARE)
57
58static void acpi_ut_free_gpe_lists(void);
59
60#else
61
62#define acpi_ut_free_gpe_lists()
63#endif /* !ACPI_REDUCED_HARDWARE */
64
65#if (!ACPI_REDUCED_HARDWARE)
56/****************************************************************************** 66/******************************************************************************
57 * 67 *
58 * FUNCTION: acpi_ut_terminate 68 * FUNCTION: acpi_ut_free_gpe_lists
59 * 69 *
60 * PARAMETERS: none 70 * PARAMETERS: none
61 * 71 *
62 * RETURN: none 72 * RETURN: none
63 * 73 *
64 * DESCRIPTION: Free global memory 74 * DESCRIPTION: Free global GPE lists
65 * 75 *
66 ******************************************************************************/ 76 ******************************************************************************/
67 77
68static void acpi_ut_terminate(void) 78static void acpi_ut_free_gpe_lists(void)
69{ 79{
70 struct acpi_gpe_block_info *gpe_block; 80 struct acpi_gpe_block_info *gpe_block;
71 struct acpi_gpe_block_info *next_gpe_block; 81 struct acpi_gpe_block_info *next_gpe_block;
72 struct acpi_gpe_xrupt_info *gpe_xrupt_info; 82 struct acpi_gpe_xrupt_info *gpe_xrupt_info;
73 struct acpi_gpe_xrupt_info *next_gpe_xrupt_info; 83 struct acpi_gpe_xrupt_info *next_gpe_xrupt_info;
74 84
75 ACPI_FUNCTION_TRACE(ut_terminate);
76
77 /* Free global GPE blocks and related info structures */ 85 /* Free global GPE blocks and related info structures */
78 86
79 gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head; 87 gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head;
@@ -91,7 +99,26 @@ static void acpi_ut_terminate(void)
91 ACPI_FREE(gpe_xrupt_info); 99 ACPI_FREE(gpe_xrupt_info);
92 gpe_xrupt_info = next_gpe_xrupt_info; 100 gpe_xrupt_info = next_gpe_xrupt_info;
93 } 101 }
102}
103#endif /* !ACPI_REDUCED_HARDWARE */
104
105/******************************************************************************
106 *
107 * FUNCTION: acpi_ut_terminate
108 *
109 * PARAMETERS: none
110 *
111 * RETURN: none
112 *
113 * DESCRIPTION: Free global memory
114 *
115 ******************************************************************************/
116
117static void acpi_ut_terminate(void)
118{
119 ACPI_FUNCTION_TRACE(ut_terminate);
94 120
121 acpi_ut_free_gpe_lists();
95 acpi_ut_delete_address_lists(); 122 acpi_ut_delete_address_lists();
96 return_VOID; 123 return_VOID;
97} 124}
diff --git a/drivers/acpi/acpica/utxface.c b/drivers/acpi/acpica/utxface.c
index 644e8c8ebc4b..afa94f51ff0b 100644
--- a/drivers/acpi/acpica/utxface.c
+++ b/drivers/acpi/acpica/utxface.c
@@ -145,6 +145,8 @@ acpi_status acpi_enable_subsystem(u32 flags)
145 145
146 ACPI_FUNCTION_TRACE(acpi_enable_subsystem); 146 ACPI_FUNCTION_TRACE(acpi_enable_subsystem);
147 147
148#if (!ACPI_REDUCED_HARDWARE)
149
148 /* Enable ACPI mode */ 150 /* Enable ACPI mode */
149 151
150 if (!(flags & ACPI_NO_ACPI_ENABLE)) { 152 if (!(flags & ACPI_NO_ACPI_ENABLE)) {
@@ -169,6 +171,7 @@ acpi_status acpi_enable_subsystem(u32 flags)
169 ACPI_WARNING((AE_INFO, "Could not map the FACS table")); 171 ACPI_WARNING((AE_INFO, "Could not map the FACS table"));
170 return_ACPI_STATUS(status); 172 return_ACPI_STATUS(status);
171 } 173 }
174#endif /* !ACPI_REDUCED_HARDWARE */
172 175
173 /* 176 /*
174 * Install the default op_region handlers. These are installed unless 177 * Install the default op_region handlers. These are installed unless
@@ -184,7 +187,7 @@ acpi_status acpi_enable_subsystem(u32 flags)
184 return_ACPI_STATUS(status); 187 return_ACPI_STATUS(status);
185 } 188 }
186 } 189 }
187 190#if (!ACPI_REDUCED_HARDWARE)
188 /* 191 /*
189 * Initialize ACPI Event handling (Fixed and General Purpose) 192 * Initialize ACPI Event handling (Fixed and General Purpose)
190 * 193 *
@@ -220,6 +223,7 @@ acpi_status acpi_enable_subsystem(u32 flags)
220 return_ACPI_STATUS(status); 223 return_ACPI_STATUS(status);
221 } 224 }
222 } 225 }
226#endif /* !ACPI_REDUCED_HARDWARE */
223 227
224 return_ACPI_STATUS(status); 228 return_ACPI_STATUS(status);
225} 229}
diff --git a/drivers/acpi/acpica/acconfig.h b/include/acpi/acconfig.h
index 3748f1a09851..03f14856bd09 100644
--- a/drivers/acpi/acpica/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -85,6 +85,23 @@
85 */ 85 */
86#define ACPI_CHECKSUM_ABORT FALSE 86#define ACPI_CHECKSUM_ABORT FALSE
87 87
88/*
89 * Generate a version of ACPICA that only supports "reduced hardware"
90 * platforms (as defined in ACPI 5.0). Set to TRUE to generate a specialized
91 * version of ACPICA that ONLY supports the ACPI 5.0 "reduced hardware"
92 * model. In other words, no ACPI hardware is supported.
93 *
94 * If TRUE, this means no support for the following:
95 * PM Event and Control registers
96 * SCI interrupt (and handler)
97 * Fixed Events
98 * General Purpose Events (GPEs)
99 * Global Lock
100 * ACPI PM timer
101 * FACS table (Waking vectors and Global Lock)
102 */
103#define ACPI_REDUCED_HARDWARE FALSE
104
88/****************************************************************************** 105/******************************************************************************
89 * 106 *
90 * Subsystem Constants 107 * Subsystem Constants
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index 5b6c391efc8e..47b3902957b0 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -89,8 +89,9 @@
89#define AE_SAME_HANDLER (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL) 89#define AE_SAME_HANDLER (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL)
90#define AE_NO_HANDLER (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL) 90#define AE_NO_HANDLER (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL)
91#define AE_OWNER_ID_LIMIT (acpi_status) (0x001B | AE_CODE_ENVIRONMENTAL) 91#define AE_OWNER_ID_LIMIT (acpi_status) (0x001B | AE_CODE_ENVIRONMENTAL)
92#define AE_NOT_CONFIGURED (acpi_status) (0x001C | AE_CODE_ENVIRONMENTAL)
92 93
93#define AE_CODE_ENV_MAX 0x001B 94#define AE_CODE_ENV_MAX 0x001C
94 95
95/* 96/*
96 * Programmer exceptions 97 * Programmer exceptions
@@ -213,7 +214,8 @@ char const *acpi_gbl_exception_names_env[] = {
213 "AE_ABORT_METHOD", 214 "AE_ABORT_METHOD",
214 "AE_SAME_HANDLER", 215 "AE_SAME_HANDLER",
215 "AE_NO_HANDLER", 216 "AE_NO_HANDLER",
216 "AE_OWNER_ID_LIMIT" 217 "AE_OWNER_ID_LIMIT",
218 "AE_NOT_CONFIGURED"
217}; 219};
218 220
219char const *acpi_gbl_exception_names_pgm[] = { 221char const *acpi_gbl_exception_names_pgm[] = {
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 67cd51c8ee0a..e8600dd92573 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -49,6 +49,7 @@
49 49
50#define ACPI_CA_VERSION 0x20120111 50#define ACPI_CA_VERSION 0x20120111
51 51
52#include "acconfig.h"
52#include "actypes.h" 53#include "actypes.h"
53#include "actbl.h" 54#include "actbl.h"
54 55
@@ -71,6 +72,33 @@ extern u8 acpi_gbl_copy_dsdt_locally;
71extern u8 acpi_gbl_truncate_io_addresses; 72extern u8 acpi_gbl_truncate_io_addresses;
72extern u8 acpi_gbl_disable_auto_repair; 73extern u8 acpi_gbl_disable_auto_repair;
73 74
75/*
76 * Hardware-reduced prototypes. All interfaces that use these macros will
77 * be configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
78 * is set to TRUE.
79 */
80#if (!ACPI_REDUCED_HARDWARE)
81#define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
82 prototype;
83
84#define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \
85 prototype;
86
87#define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
88 prototype;
89
90#else
91#define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
92 static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);}
93
94#define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \
95 static ACPI_INLINE prototype {return(AE_OK);}
96
97#define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
98 static ACPI_INLINE prototype {}
99
100#endif /* !ACPI_REDUCED_HARDWARE */
101
74extern u32 acpi_current_gpe_count; 102extern u32 acpi_current_gpe_count;
75extern struct acpi_table_fadt acpi_gbl_FADT; 103extern struct acpi_table_fadt acpi_gbl_FADT;
76extern u8 acpi_gbl_system_awake_and_running; 104extern u8 acpi_gbl_system_awake_and_running;
@@ -96,9 +124,8 @@ acpi_status acpi_terminate(void);
96acpi_status acpi_subsystem_status(void); 124acpi_status acpi_subsystem_status(void);
97#endif 125#endif
98 126
99acpi_status acpi_enable(void); 127ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
100 128ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
101acpi_status acpi_disable(void);
102 129
103#ifdef ACPI_FUTURE_USAGE 130#ifdef ACPI_FUTURE_USAGE
104acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer); 131acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer);
@@ -235,17 +262,34 @@ acpi_status acpi_get_parent(acpi_handle object, acpi_handle * out_handle);
235acpi_status 262acpi_status
236acpi_install_initialization_handler(acpi_init_handler handler, u32 function); 263acpi_install_initialization_handler(acpi_init_handler handler, u32 function);
237 264
238acpi_status 265ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
239acpi_install_global_event_handler(ACPI_GBL_EVENT_HANDLER handler, 266 acpi_install_global_event_handler
240 void *context); 267 (ACPI_GBL_EVENT_HANDLER handler, void *context))
241 268
242acpi_status 269ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
243acpi_install_fixed_event_handler(u32 acpi_event, 270 acpi_install_fixed_event_handler(u32
244 acpi_event_handler handler, void *context); 271 acpi_event,
245 272 acpi_event_handler
246acpi_status 273 handler,
247acpi_remove_fixed_event_handler(u32 acpi_event, acpi_event_handler handler); 274 void
248 275 *context))
276ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
277 acpi_remove_fixed_event_handler(u32 acpi_event,
278 acpi_event_handler
279 handler))
280ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
281 acpi_install_gpe_handler(acpi_handle
282 gpe_device,
283 u32 gpe_number,
284 u32 type,
285 acpi_gpe_handler
286 address,
287 void *context))
288ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
289 acpi_remove_gpe_handler(acpi_handle gpe_device,
290 u32 gpe_number,
291 acpi_gpe_handler
292 address))
249acpi_status 293acpi_status
250acpi_install_notify_handler(acpi_handle device, 294acpi_install_notify_handler(acpi_handle device,
251 u32 handler_type, 295 u32 handler_type,
@@ -266,15 +310,6 @@ acpi_remove_address_space_handler(acpi_handle device,
266 acpi_adr_space_type space_id, 310 acpi_adr_space_type space_id,
267 acpi_adr_space_handler handler); 311 acpi_adr_space_handler handler);
268 312
269acpi_status
270acpi_install_gpe_handler(acpi_handle gpe_device,
271 u32 gpe_number,
272 u32 type, acpi_gpe_handler address, void *context);
273
274acpi_status
275acpi_remove_gpe_handler(acpi_handle gpe_device,
276 u32 gpe_number, acpi_gpe_handler address);
277
278#ifdef ACPI_FUTURE_USAGE 313#ifdef ACPI_FUTURE_USAGE
279acpi_status acpi_install_exception_handler(acpi_exception_handler handler); 314acpi_status acpi_install_exception_handler(acpi_exception_handler handler);
280#endif 315#endif
@@ -284,9 +319,11 @@ acpi_status acpi_install_interface_handler(acpi_interface_handler handler);
284/* 319/*
285 * Global Lock interfaces 320 * Global Lock interfaces
286 */ 321 */
287acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle); 322ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
288 323 acpi_acquire_global_lock(u16 timeout,
289acpi_status acpi_release_global_lock(u32 handle); 324 u32 *handle))
325ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
326 acpi_release_global_lock(u32 handle))
290 327
291/* 328/*
292 * Interfaces to AML mutex objects 329 * Interfaces to AML mutex objects
@@ -299,47 +336,75 @@ acpi_status acpi_release_mutex(acpi_handle handle, acpi_string pathname);
299/* 336/*
300 * Fixed Event interfaces 337 * Fixed Event interfaces
301 */ 338 */
302acpi_status acpi_enable_event(u32 event, u32 flags); 339ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
303 340 acpi_enable_event(u32 event, u32 flags))
304acpi_status acpi_disable_event(u32 event, u32 flags);
305 341
306acpi_status acpi_clear_event(u32 event); 342ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
343 acpi_disable_event(u32 event, u32 flags))
307 344
308acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status); 345ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event))
309 346
347ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
348 acpi_get_event_status(u32 event,
349 acpi_event_status
350 *event_status))
310/* 351/*
311 * General Purpose Event (GPE) Interfaces 352 * General Purpose Event (GPE) Interfaces
312 */ 353 */
313acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number); 354ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_update_all_gpes(void))
314 355
315acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number); 356ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
316 357 acpi_enable_gpe(acpi_handle gpe_device,
317acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number); 358 u32 gpe_number))
318 359
319acpi_status 360ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
320acpi_setup_gpe_for_wake(acpi_handle parent_device, 361 acpi_disable_gpe(acpi_handle gpe_device,
321 acpi_handle gpe_device, u32 gpe_number); 362 u32 gpe_number))
322 363
323acpi_status acpi_set_gpe_wake_mask(acpi_handle gpe_device, u32 gpe_number, u8 action); 364ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
324 365 acpi_clear_gpe(acpi_handle gpe_device,
325acpi_status 366 u32 gpe_number))
326acpi_get_gpe_status(acpi_handle gpe_device, 367
327 u32 gpe_number, acpi_event_status *event_status); 368ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
328 369 acpi_set_gpe(acpi_handle gpe_device,
329acpi_status acpi_disable_all_gpes(void); 370 u32 gpe_number, u8 action))
330 371
331acpi_status acpi_enable_all_runtime_gpes(void); 372ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
332 373 acpi_finish_gpe(acpi_handle gpe_device,
333acpi_status acpi_get_gpe_device(u32 gpe_index, acpi_handle *gpe_device); 374 u32 gpe_number))
334 375
335acpi_status 376ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
336acpi_install_gpe_block(acpi_handle gpe_device, 377 acpi_setup_gpe_for_wake(acpi_handle
337 struct acpi_generic_address *gpe_block_address, 378 parent_device,
338 u32 register_count, u32 interrupt_number); 379 acpi_handle gpe_device,
339 380 u32 gpe_number))
340acpi_status acpi_remove_gpe_block(acpi_handle gpe_device); 381ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
341 382 acpi_set_gpe_wake_mask(acpi_handle gpe_device,
342acpi_status acpi_update_all_gpes(void); 383 u32 gpe_number,
384 u8 action))
385ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
386 acpi_get_gpe_status(acpi_handle gpe_device,
387 u32 gpe_number,
388 acpi_event_status
389 *event_status))
390
391ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
392
393ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void))
394
395ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
396 acpi_get_gpe_device(u32 gpe_index,
397 acpi_handle * gpe_device))
398
399ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
400 acpi_install_gpe_block(acpi_handle gpe_device,
401 struct
402 acpi_generic_address
403 *gpe_block_address,
404 u32 register_count,
405 u32 interrupt_number))
406ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
407 acpi_remove_gpe_block(acpi_handle gpe_device))
343 408
344/* 409/*
345 * Resource interfaces 410 * Resource interfaces
@@ -391,20 +456,31 @@ acpi_buffer_to_resource(u8 *aml_buffer,
391 */ 456 */
392acpi_status acpi_reset(void); 457acpi_status acpi_reset(void);
393 458
394acpi_status acpi_read_bit_register(u32 register_id, u32 *return_value); 459ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
460 acpi_read_bit_register(u32 register_id,
461 u32 *return_value))
395 462
396acpi_status acpi_write_bit_register(u32 register_id, u32 value); 463ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
464 acpi_write_bit_register(u32 register_id,
465 u32 value))
397 466
398acpi_status acpi_set_firmware_waking_vector(u32 physical_address); 467ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
468 acpi_set_firmware_waking_vector(u32
469 physical_address))
399 470
400#if ACPI_MACHINE_WIDTH == 64 471#if ACPI_MACHINE_WIDTH == 64
401acpi_status acpi_set_firmware_waking_vector64(u64 physical_address); 472ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
473 acpi_set_firmware_waking_vector64(u64
474 physical_address))
402#endif 475#endif
403 476
404acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg); 477acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg);
405 478
406acpi_status acpi_write(u64 value, struct acpi_generic_address *reg); 479acpi_status acpi_write(u64 value, struct acpi_generic_address *reg);
407 480
481/*
482 * Sleep/Wake interfaces
483 */
408acpi_status 484acpi_status
409acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b); 485acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b);
410 486
@@ -412,7 +488,7 @@ acpi_status acpi_enter_sleep_state_prep(u8 sleep_state);
412 488
413acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state); 489acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state);
414 490
415acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void); 491ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void))
416 492
417acpi_status acpi_leave_sleep_state_prep(u8 sleep_state); 493acpi_status acpi_leave_sleep_state_prep(u8 sleep_state);
418 494
@@ -422,12 +498,15 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state);
422 * ACPI Timer interfaces 498 * ACPI Timer interfaces
423 */ 499 */
424#ifdef ACPI_FUTURE_USAGE 500#ifdef ACPI_FUTURE_USAGE
425acpi_status acpi_get_timer_resolution(u32 *resolution); 501ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
502 acpi_get_timer_resolution(u32 *resolution))
426 503
427acpi_status acpi_get_timer(u32 *ticks); 504ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks))
428 505
429acpi_status 506ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
430acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 *time_elapsed); 507 acpi_get_timer_duration(u32 start_ticks,
508 u32 end_ticks,
509 u32 *time_elapsed))
431#endif /* ACPI_FUTURE_USAGE */ 510#endif /* ACPI_FUTURE_USAGE */
432 511
433/* 512/*