Commit 33620c5419e8a11814dd11e02a80e6ef77a43407

Authored by Bob Moore
Committed by Len Brown
1 parent d08310fe0d

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>

Showing 30 changed files with 762 additions and 551 deletions Side-by-side Diff

drivers/acpi/acpica/accommon.h
... ... @@ -51,7 +51,6 @@
51 51 *
52 52 * Note: The order of these include files is important.
53 53 */
54   -#include "acconfig.h" /* Global configuration constants */
55 54 #include "acmacros.h" /* C macros */
56 55 #include "aclocal.h" /* Internal data types */
57 56 #include "acobject.h" /* ACPI internal object */
drivers/acpi/acpica/acconfig.h
1   -/******************************************************************************
2   - *
3   - * Name: acconfig.h - Global configuration constants
4   - *
5   - *****************************************************************************/
6   -
7   -/*
8   - * Copyright (C) 2000 - 2012, Intel Corp.
9   - * All rights reserved.
10   - *
11   - * Redistribution and use in source and binary forms, with or without
12   - * modification, are permitted provided that the following conditions
13   - * are met:
14   - * 1. Redistributions of source code must retain the above copyright
15   - * notice, this list of conditions, and the following disclaimer,
16   - * without modification.
17   - * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18   - * substantially similar to the "NO WARRANTY" disclaimer below
19   - * ("Disclaimer") and any redistribution must be conditioned upon
20   - * including a substantially similar Disclaimer requirement for further
21   - * binary redistribution.
22   - * 3. Neither the names of the above-listed copyright holders nor the names
23   - * of any contributors may be used to endorse or promote products derived
24   - * from this software without specific prior written permission.
25   - *
26   - * Alternatively, this software may be distributed under the terms of the
27   - * GNU General Public License ("GPL") version 2 as published by the Free
28   - * Software Foundation.
29   - *
30   - * NO WARRANTY
31   - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32   - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33   - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34   - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35   - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36   - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37   - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38   - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39   - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40   - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41   - * POSSIBILITY OF SUCH DAMAGES.
42   - */
43   -
44   -#ifndef _ACCONFIG_H
45   -#define _ACCONFIG_H
46   -
47   -/******************************************************************************
48   - *
49   - * Configuration options
50   - *
51   - *****************************************************************************/
52   -
53   -/*
54   - * ACPI_DEBUG_OUTPUT - This switch enables all the debug facilities of the
55   - * ACPI subsystem. This includes the DEBUG_PRINT output
56   - * statements. When disabled, all DEBUG_PRINT
57   - * statements are compiled out.
58   - *
59   - * ACPI_APPLICATION - Use this switch if the subsystem is going to be run
60   - * at the application level.
61   - *
62   - */
63   -
64   -/*
65   - * OS name, used for the _OS object. The _OS object is essentially obsolete,
66   - * but there is a large base of ASL/AML code in existing machines that check
67   - * for the string below. The use of this string usually guarantees that
68   - * the ASL will execute down the most tested code path. Also, there is some
69   - * code that will not execute the _OSI method unless _OS matches the string
70   - * below. Therefore, change this string at your own risk.
71   - */
72   -#define ACPI_OS_NAME "Microsoft Windows NT"
73   -
74   -/* Maximum objects in the various object caches */
75   -
76   -#define ACPI_MAX_STATE_CACHE_DEPTH 96 /* State objects */
77   -#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */
78   -#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */
79   -#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */
80   -#define ACPI_MAX_NAMESPACE_CACHE_DEPTH 96 /* Namespace objects */
81   -
82   -/*
83   - * Should the subsystem abort the loading of an ACPI table if the
84   - * table checksum is incorrect?
85   - */
86   -#define ACPI_CHECKSUM_ABORT FALSE
87   -
88   -/******************************************************************************
89   - *
90   - * Subsystem Constants
91   - *
92   - *****************************************************************************/
93   -
94   -/* Version of ACPI supported */
95   -
96   -#define ACPI_CA_SUPPORT_LEVEL 5
97   -
98   -/* Maximum count for a semaphore object */
99   -
100   -#define ACPI_MAX_SEMAPHORE_COUNT 256
101   -
102   -/* Maximum object reference count (detects object deletion issues) */
103   -
104   -#define ACPI_MAX_REFERENCE_COUNT 0x1000
105   -
106   -/* Default page size for use in mapping memory for operation regions */
107   -
108   -#define ACPI_DEFAULT_PAGE_SIZE 4096 /* Must be power of 2 */
109   -
110   -/* owner_id tracking. 8 entries allows for 255 owner_ids */
111   -
112   -#define ACPI_NUM_OWNERID_MASKS 8
113   -
114   -/* Size of the root table array is increased by this increment */
115   -
116   -#define ACPI_ROOT_TABLE_SIZE_INCREMENT 4
117   -
118   -/* Maximum number of While() loop iterations before forced abort */
119   -
120   -#define ACPI_MAX_LOOP_ITERATIONS 0xFFFF
121   -
122   -/* Maximum sleep allowed via Sleep() operator */
123   -
124   -#define ACPI_MAX_SLEEP 2000 /* Two seconds */
125   -
126   -/* Address Range lists are per-space_id (Memory and I/O only) */
127   -
128   -#define ACPI_ADDRESS_RANGE_MAX 2
129   -
130   -/******************************************************************************
131   - *
132   - * ACPI Specification constants (Do not change unless the specification changes)
133   - *
134   - *****************************************************************************/
135   -
136   -/* Number of distinct GPE register blocks and register width */
137   -
138   -#define ACPI_MAX_GPE_BLOCKS 2
139   -#define ACPI_GPE_REGISTER_WIDTH 8
140   -
141   -/* Method info (in WALK_STATE), containing local variables and argumetns */
142   -
143   -#define ACPI_METHOD_NUM_LOCALS 8
144   -#define ACPI_METHOD_MAX_LOCAL 7
145   -
146   -#define ACPI_METHOD_NUM_ARGS 7
147   -#define ACPI_METHOD_MAX_ARG 6
148   -
149   -/* Length of _HID, _UID, _CID, and UUID values */
150   -
151   -#define ACPI_DEVICE_ID_LENGTH 0x09
152   -#define ACPI_MAX_CID_LENGTH 48
153   -#define ACPI_UUID_LENGTH 16
154   -
155   -/*
156   - * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG
157   - */
158   -#define ACPI_OBJ_NUM_OPERANDS 8
159   -#define ACPI_OBJ_MAX_OPERAND 7
160   -
161   -/* Number of elements in the Result Stack frame, can be an arbitrary value */
162   -
163   -#define ACPI_RESULTS_FRAME_OBJ_NUM 8
164   -
165   -/*
166   - * Maximal number of elements the Result Stack can contain,
167   - * it may be an arbitray value not exceeding the types of
168   - * result_size and result_count (now u8).
169   - */
170   -#define ACPI_RESULTS_OBJ_NUM_MAX 255
171   -
172   -/* Names within the namespace are 4 bytes long */
173   -
174   -#define ACPI_NAME_SIZE 4
175   -#define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */
176   -#define ACPI_PATH_SEPARATOR '.'
177   -
178   -/* Sizes for ACPI table headers */
179   -
180   -#define ACPI_OEM_ID_SIZE 6
181   -#define ACPI_OEM_TABLE_ID_SIZE 8
182   -
183   -/* Constants used in searching for the RSDP in low memory */
184   -
185   -#define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */
186   -#define ACPI_EBDA_PTR_LENGTH 2
187   -#define ACPI_EBDA_WINDOW_SIZE 1024
188   -#define ACPI_HI_RSDP_WINDOW_BASE 0x000E0000 /* Physical Address */
189   -#define ACPI_HI_RSDP_WINDOW_SIZE 0x00020000
190   -#define ACPI_RSDP_SCAN_STEP 16
191   -
192   -/* Operation regions */
193   -
194   -#define ACPI_USER_REGION_BEGIN 0x80
195   -
196   -/* Maximum space_ids for Operation Regions */
197   -
198   -#define ACPI_MAX_ADDRESS_SPACE 255
199   -
200   -/* Array sizes. Used for range checking also */
201   -
202   -#define ACPI_MAX_MATCH_OPCODE 5
203   -
204   -/* RSDP checksums */
205   -
206   -#define ACPI_RSDP_CHECKSUM_LENGTH 20
207   -#define ACPI_RSDP_XCHECKSUM_LENGTH 36
208   -
209   -/* SMBus, GSBus and IPMI bidirectional buffer size */
210   -
211   -#define ACPI_SMBUS_BUFFER_SIZE 34
212   -#define ACPI_GSBUS_BUFFER_SIZE 34
213   -#define ACPI_IPMI_BUFFER_SIZE 66
214   -
215   -/* _sx_d and _sx_w control methods */
216   -
217   -#define ACPI_NUM_sx_d_METHODS 4
218   -#define ACPI_NUM_sx_w_METHODS 5
219   -
220   -/******************************************************************************
221   - *
222   - * ACPI AML Debugger
223   - *
224   - *****************************************************************************/
225   -
226   -#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */
227   -
228   -#define ACPI_DEBUGGER_COMMAND_PROMPT '-'
229   -#define ACPI_DEBUGGER_EXECUTE_PROMPT '%'
230   -
231   -#endif /* _ACCONFIG_H */
drivers/acpi/acpica/acdebug.h
... ... @@ -111,7 +111,7 @@
111 111  
112 112 void acpi_db_set_scope(char *name);
113 113  
114   -acpi_status acpi_db_sleep(char *object_arg);
  114 +ACPI_HW_DEPENDENT_RETURN_OK(acpi_status acpi_db_sleep(char *object_arg))
115 115  
116 116 void acpi_db_find_references(char *object_arg);
117 117  
118 118  
... ... @@ -119,11 +119,13 @@
119 119  
120 120 void acpi_db_display_resources(char *object_arg);
121 121  
122   -void acpi_db_display_gpes(void);
  122 +ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_db_display_gpes(void))
123 123  
124 124 void acpi_db_check_integrity(void);
125 125  
126   -void acpi_db_generate_gpe(char *gpe_arg, char *block_arg);
  126 +ACPI_HW_DEPENDENT_RETURN_VOID(void
  127 + acpi_db_generate_gpe(char *gpe_arg,
  128 + char *block_arg))
127 129  
128 130 void acpi_db_check_predefined_names(void);
129 131  
drivers/acpi/acpica/acevents.h
... ... @@ -69,12 +69,11 @@
69 69 */
70 70 acpi_status acpi_ev_init_global_lock_handler(void);
71 71  
72   -acpi_status acpi_ev_acquire_global_lock(u16 timeout);
  72 +ACPI_HW_DEPENDENT_RETURN_OK(acpi_status
  73 + acpi_ev_acquire_global_lock(u16 timeout))
  74 + ACPI_HW_DEPENDENT_RETURN_OK(acpi_status acpi_ev_release_global_lock(void))
  75 + acpi_status acpi_ev_remove_global_lock_handler(void);
73 76  
74   -acpi_status acpi_ev_release_global_lock(void);
75   -
76   -acpi_status acpi_ev_remove_global_lock_handler(void);
77   -
78 77 /*
79 78 * evgpe - Low-level GPE support
80 79 */
... ... @@ -114,7 +113,9 @@
114 113 struct acpi_gpe_block_info *gpe_block,
115 114 void *context);
116 115  
117   -acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block);
  116 +ACPI_HW_DEPENDENT_RETURN_OK(acpi_status
  117 + acpi_ev_delete_gpe_block(struct acpi_gpe_block_info
  118 + *gpe_block))
118 119  
119 120 u32
120 121 acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
121 122  
... ... @@ -126,9 +127,10 @@
126 127 */
127 128 acpi_status acpi_ev_gpe_initialize(void);
128 129  
129   -void acpi_ev_update_gpes(acpi_owner_id table_owner_id);
  130 +ACPI_HW_DEPENDENT_RETURN_VOID(void
  131 + acpi_ev_update_gpes(acpi_owner_id table_owner_id))
130 132  
131   -acpi_status
  133 + acpi_status
132 134 acpi_ev_match_gpe_method(acpi_handle obj_handle,
133 135 u32 level, void *context, void **return_value);
134 136  
... ... @@ -237,7 +239,6 @@
237 239  
238 240 u32 acpi_ev_initialize_sCI(u32 program_sCI);
239 241  
240   -void acpi_ev_terminate(void);
241   -
  242 +ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_ev_terminate(void))
242 243 #endif /* __ACEVENTS_H__ */
drivers/acpi/acpica/acglobal.h
... ... @@ -147,7 +147,7 @@
147 147 */
148 148 u8 acpi_gbl_reduced_hardware;
149 149  
150   -#endif
  150 +#endif /* DEFINE_ACPI_GLOBALS */
151 151  
152 152 /* Do not disassemble buffers to resource descriptors */
153 153  
154 154  
... ... @@ -184,8 +184,12 @@
184 184 * found in the RSDT/XSDT.
185 185 */
186 186 ACPI_EXTERN struct acpi_table_list acpi_gbl_root_table_list;
  187 +
  188 +#if (!ACPI_REDUCED_HARDWARE)
187 189 ACPI_EXTERN struct acpi_table_facs *acpi_gbl_FACS;
188 190  
  191 +#endif /* !ACPI_REDUCED_HARDWARE */
  192 +
189 193 /* These addresses are calculated from the FADT Event Block addresses */
190 194  
191 195 ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_status;
192 196  
... ... @@ -397,9 +401,14 @@
397 401 ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head;
398 402 ACPI_EXTERN struct acpi_gpe_block_info
399 403 *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS];
  404 +
  405 +#if (!ACPI_REDUCED_HARDWARE)
  406 +
400 407 ACPI_EXTERN u8 acpi_gbl_all_gpes_initialized;
401 408 ACPI_EXTERN ACPI_GBL_EVENT_HANDLER acpi_gbl_global_event_handler;
402 409 ACPI_EXTERN void *acpi_gbl_global_event_handler_context;
  410 +
  411 +#endif /* !ACPI_REDUCED_HARDWARE */
403 412  
404 413 /*****************************************************************************
405 414 *
drivers/acpi/acpica/evevent.c
... ... @@ -47,7 +47,7 @@
47 47  
48 48 #define _COMPONENT ACPI_EVENTS
49 49 ACPI_MODULE_NAME("evevent")
50   -
  50 +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
51 51 /* Local prototypes */
52 52 static acpi_status acpi_ev_fixed_event_initialize(void);
53 53  
... ... @@ -291,4 +291,6 @@
291 291 return ((acpi_gbl_fixed_event_handlers[event].
292 292 handler) (acpi_gbl_fixed_event_handlers[event].context));
293 293 }
  294 +
  295 +#endif /* !ACPI_REDUCED_HARDWARE */
drivers/acpi/acpica/evglock.c
... ... @@ -48,7 +48,7 @@
48 48  
49 49 #define _COMPONENT ACPI_EVENTS
50 50 ACPI_MODULE_NAME("evglock")
51   -
  51 +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
52 52 /* Local prototypes */
53 53 static u32 acpi_ev_global_lock_handler(void *context);
54 54  
... ... @@ -339,4 +339,6 @@
339 339 acpi_os_release_mutex(acpi_gbl_global_lock_mutex->mutex.os_mutex);
340 340 return_ACPI_STATUS(status);
341 341 }
  342 +
  343 +#endif /* !ACPI_REDUCED_HARDWARE */
drivers/acpi/acpica/evgpe.c
... ... @@ -48,7 +48,7 @@
48 48  
49 49 #define _COMPONENT ACPI_EVENTS
50 50 ACPI_MODULE_NAME("evgpe")
51   -
  51 +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
52 52 /* Local prototypes */
53 53 static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context);
54 54  
... ... @@ -766,4 +766,6 @@
766 766  
767 767 return_UINT32(ACPI_INTERRUPT_HANDLED);
768 768 }
  769 +
  770 +#endif /* !ACPI_REDUCED_HARDWARE */
drivers/acpi/acpica/evgpeblk.c
... ... @@ -48,7 +48,7 @@
48 48  
49 49 #define _COMPONENT ACPI_EVENTS
50 50 ACPI_MODULE_NAME("evgpeblk")
51   -
  51 +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
52 52 /* Local prototypes */
53 53 static acpi_status
54 54 acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block,
... ... @@ -504,4 +504,6 @@
504 504  
505 505 return_ACPI_STATUS(AE_OK);
506 506 }
  507 +
  508 +#endif /* !ACPI_REDUCED_HARDWARE */
drivers/acpi/acpica/evgpeinit.c
... ... @@ -48,7 +48,7 @@
48 48  
49 49 #define _COMPONENT ACPI_EVENTS
50 50 ACPI_MODULE_NAME("evgpeinit")
51   -
  51 +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
52 52 /*
53 53 * Note: History of _PRW support in ACPICA
54 54 *
... ... @@ -440,4 +440,6 @@
440 440 name, gpe_number));
441 441 return_ACPI_STATUS(AE_OK);
442 442 }
  443 +
  444 +#endif /* !ACPI_REDUCED_HARDWARE */
drivers/acpi/acpica/evgpeutil.c
... ... @@ -48,6 +48,7 @@
48 48 #define _COMPONENT ACPI_EVENTS
49 49 ACPI_MODULE_NAME("evgpeutil")
50 50  
  51 +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
51 52 /*******************************************************************************
52 53 *
53 54 * FUNCTION: acpi_ev_walk_gpe_list
... ... @@ -374,4 +375,6 @@
374 375  
375 376 return_ACPI_STATUS(AE_OK);
376 377 }
  378 +
  379 +#endif /* !ACPI_REDUCED_HARDWARE */
drivers/acpi/acpica/evmisc.c
... ... @@ -270,6 +270,7 @@
270 270 acpi_ut_delete_generic_state(notify_info);
271 271 }
272 272  
  273 +#if (!ACPI_REDUCED_HARDWARE)
273 274 /******************************************************************************
274 275 *
275 276 * FUNCTION: acpi_ev_terminate
... ... @@ -338,4 +339,6 @@
338 339 }
339 340 return_VOID;
340 341 }
  342 +
  343 +#endif /* !ACPI_REDUCED_HARDWARE */
drivers/acpi/acpica/evsci.c
... ... @@ -48,7 +48,7 @@
48 48  
49 49 #define _COMPONENT ACPI_EVENTS
50 50 ACPI_MODULE_NAME("evsci")
51   -
  51 +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
52 52 /* Local prototypes */
53 53 static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context);
54 54  
... ... @@ -181,4 +181,6 @@
181 181  
182 182 return_ACPI_STATUS(status);
183 183 }
  184 +
  185 +#endif /* !ACPI_REDUCED_HARDWARE */
drivers/acpi/acpica/evxface.c
... ... @@ -51,225 +51,9 @@
51 51 #define _COMPONENT ACPI_EVENTS
52 52 ACPI_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
67   -acpi_status acpi_install_exception_handler(acpi_exception_handler handler)
68   -{
69   - acpi_status status;
70 54  
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   -
94   -ACPI_EXPORT_SYMBOL(acpi_install_exception_handler)
95   -#endif /* ACPI_FUTURE_USAGE */
96   -
97 55 /*******************************************************************************
98 56 *
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   - ******************************************************************************/
112   -acpi_status
113   -acpi_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   -
145   -ACPI_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   - ******************************************************************************/
162   -acpi_status
163   -acpi_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   -
215   -ACPI_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   - ******************************************************************************/
229   -acpi_status
230   -acpi_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   -
269   -ACPI_EXPORT_SYMBOL(acpi_remove_fixed_event_handler)
270   -
271   -/*******************************************************************************
272   - *
273 57 * FUNCTION: acpi_populate_handler_object
274 58 *
275 59 * PARAMETERS: handler_obj - Handler object to populate
... ... @@ -334,6 +118,7 @@
334 118 return AE_OK;
335 119 }
336 120  
  121 +
337 122 /*******************************************************************************
338 123 *
339 124 * FUNCTION: acpi_install_notify_handler
... ... @@ -705,6 +490,224 @@
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
  504 +acpi_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 +
  531 +ACPI_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 + ******************************************************************************/
  550 +acpi_status
  551 +acpi_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 +
  583 +ACPI_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 + ******************************************************************************/
  600 +acpi_status
  601 +acpi_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 +
  653 +ACPI_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 + ******************************************************************************/
  667 +acpi_status
  668 +acpi_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 +
  707 +ACPI_EXPORT_SYMBOL(acpi_remove_fixed_event_handler)
  708 +
  709 +/*******************************************************************************
  710 + *
708 711 * FUNCTION: acpi_install_gpe_handler
709 712 *
710 713 * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT
... ... @@ -984,4 +987,5 @@
984 987 }
985 988  
986 989 ACPI_EXPORT_SYMBOL(acpi_release_global_lock)
  990 +#endif /* !ACPI_REDUCED_HARDWARE */
drivers/acpi/acpica/evxfevnt.c
... ... @@ -49,6 +49,7 @@
49 49 #define _COMPONENT ACPI_EVENTS
50 50 ACPI_MODULE_NAME("evxfevnt")
51 51  
  52 +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
52 53 /*******************************************************************************
53 54 *
54 55 * FUNCTION: acpi_enable
... ... @@ -352,4 +353,5 @@
352 353 }
353 354  
354 355 ACPI_EXPORT_SYMBOL(acpi_get_event_status)
  356 +#endif /* !ACPI_REDUCED_HARDWARE */
drivers/acpi/acpica/evxfgpe.c
... ... @@ -50,6 +50,7 @@
50 50 #define _COMPONENT ACPI_EVENTS
51 51 ACPI_MODULE_NAME("evxfgpe")
52 52  
  53 +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
53 54 /******************************************************************************
54 55 *
55 56 * FUNCTION: acpi_update_all_gpes
... ... @@ -695,4 +696,5 @@
695 696 }
696 697  
697 698 ACPI_EXPORT_SYMBOL(acpi_get_gpe_device)
  699 +#endif /* !ACPI_REDUCED_HARDWARE */
drivers/acpi/acpica/hwacpi.c
... ... @@ -48,6 +48,7 @@
48 48 #define _COMPONENT ACPI_HARDWARE
49 49 ACPI_MODULE_NAME("hwacpi")
50 50  
  51 +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
51 52 /******************************************************************************
52 53 *
53 54 * FUNCTION: acpi_hw_set_mode
... ... @@ -166,4 +167,6 @@
166 167 return_UINT32(ACPI_SYS_MODE_LEGACY);
167 168 }
168 169 }
  170 +
  171 +#endif /* !ACPI_REDUCED_HARDWARE */
drivers/acpi/acpica/hwgpe.c
... ... @@ -48,7 +48,7 @@
48 48  
49 49 #define _COMPONENT ACPI_HARDWARE
50 50 ACPI_MODULE_NAME("hwgpe")
51   -
  51 +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
52 52 /* Local prototypes */
53 53 static acpi_status
54 54 acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
... ... @@ -479,4 +479,6 @@
479 479 status = acpi_ev_walk_gpe_list(acpi_hw_enable_wakeup_gpe_block, NULL);
480 480 return_ACPI_STATUS(status);
481 481 }
  482 +
  483 +#endif /* !ACPI_REDUCED_HARDWARE */
drivers/acpi/acpica/hwregs.c
... ... @@ -51,6 +51,7 @@
51 51 #define _COMPONENT ACPI_HARDWARE
52 52 ACPI_MODULE_NAME("hwregs")
53 53  
  54 +#if (!ACPI_REDUCED_HARDWARE)
54 55 /* Local Prototypes */
55 56 static acpi_status
56 57 acpi_hw_read_multiple(u32 *value,
... ... @@ -62,6 +63,8 @@
62 63 struct acpi_generic_address *register_a,
63 64 struct acpi_generic_address *register_b);
64 65  
  66 +#endif /* !ACPI_REDUCED_HARDWARE */
  67 +
65 68 /******************************************************************************
66 69 *
67 70 * FUNCTION: acpi_hw_validate_register
... ... @@ -240,6 +243,7 @@
240 243 return (status);
241 244 }
242 245  
  246 +#if (!ACPI_REDUCED_HARDWARE)
243 247 /*******************************************************************************
244 248 *
245 249 * FUNCTION: acpi_hw_clear_acpi_status
... ... @@ -285,7 +289,7 @@
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 294 * PARAMETERS: register_id - Index of ACPI Register to access
291 295 *
... ... @@ -658,4 +662,6 @@
658 662  
659 663 return (status);
660 664 }
  665 +
  666 +#endif /* !ACPI_REDUCED_HARDWARE */
drivers/acpi/acpica/hwsleep.c
... ... @@ -197,6 +197,7 @@
197 197 }
198 198 }
199 199  
  200 +#if (!ACPI_REDUCED_HARDWARE)
200 201 /*******************************************************************************
201 202 *
202 203 * FUNCTION: acpi_hw_legacy_sleep
... ... @@ -512,6 +513,7 @@
512 513 return_ACPI_STATUS(status);
513 514 }
514 515  
  516 +#endif /* !ACPI_REDUCED_HARDWARE */
515 517  
516 518 /*******************************************************************************
517 519 *
drivers/acpi/acpica/hwtimer.c
... ... @@ -49,6 +49,7 @@
49 49 #define _COMPONENT ACPI_HARDWARE
50 50 ACPI_MODULE_NAME("hwtimer")
51 51  
  52 +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
52 53 /******************************************************************************
53 54 *
54 55 * FUNCTION: acpi_get_timer_resolution
... ... @@ -187,4 +188,5 @@
187 188 }
188 189  
189 190 ACPI_EXPORT_SYMBOL(acpi_get_timer_duration)
  191 +#endif /* !ACPI_REDUCED_HARDWARE */
drivers/acpi/acpica/hwxface.c
... ... @@ -286,6 +286,7 @@
286 286  
287 287 ACPI_EXPORT_SYMBOL(acpi_write)
288 288  
  289 +#if (!ACPI_REDUCED_HARDWARE)
289 290 /*******************************************************************************
290 291 *
291 292 * FUNCTION: acpi_read_bit_register
... ... @@ -453,7 +454,7 @@
453 454 }
454 455  
455 456 ACPI_EXPORT_SYMBOL(acpi_write_bit_register)
456   -
  457 +#endif /* !ACPI_REDUCED_HARDWARE */
457 458 /*******************************************************************************
458 459 *
459 460 * FUNCTION: acpi_get_sleep_type_data
drivers/acpi/acpica/hwxfsleep.c
... ... @@ -48,6 +48,7 @@
48 48 #define _COMPONENT ACPI_HARDWARE
49 49 ACPI_MODULE_NAME("hwxfsleep")
50 50  
  51 +#if (!ACPI_REDUCED_HARDWARE)
51 52 /*******************************************************************************
52 53 *
53 54 * FUNCTION: acpi_set_firmware_waking_vector
... ... @@ -189,7 +190,7 @@
189 190 }
190 191  
191 192 ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios)
192   -
  193 +#endif /* !ACPI_REDUCED_HARDWARE */
193 194 /*******************************************************************************
194 195 *
195 196 * FUNCTION: acpi_enter_sleep_state_prep
... ... @@ -290,6 +291,7 @@
290 291 acpi_gbl_sleep_type_a, acpi_gbl_sleep_type_b));
291 292 return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
292 293 }
  294 +#if (!ACPI_REDUCED_HARDWARE)
293 295  
294 296 /* If Hardware Reduced flag is set, must use the extended sleep registers */
295 297  
... ... @@ -301,6 +303,11 @@
301 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 311 return_ACPI_STATUS(status);
305 312 }
306 313  
... ... @@ -326,6 +333,8 @@
326 333 ACPI_FUNCTION_TRACE(acpi_leave_sleep_state);
327 334  
328 335  
  336 +#if (!ACPI_REDUCED_HARDWARE)
  337 +
329 338 /* If Hardware Reduced flag is set, must use the extended sleep registers */
330 339  
331 340 if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) {
332 341  
333 342  
... ... @@ -335,8 +344,12 @@
335 344  
336 345 status = acpi_hw_legacy_wake_prep(sleep_state);
337 346 }
  347 +#else
  348 + status = acpi_hw_extended_wake_prep(sleep_state);
338 349  
  350 +#endif /* !ACPI_REDUCED_HARDWARE */
339 351  
  352 +
340 353 return_ACPI_STATUS(status);
341 354 }
342 355  
... ... @@ -361,6 +374,8 @@
361 374 ACPI_FUNCTION_TRACE(acpi_leave_sleep_state);
362 375  
363 376  
  377 +#if (!ACPI_REDUCED_HARDWARE)
  378 +
364 379 /* If Hardware Reduced flag is set, must use the extended sleep registers */
365 380  
366 381 if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) {
... ... @@ -370,6 +385,11 @@
370 385  
371 386 status = acpi_hw_legacy_wake(sleep_state);
372 387 }
  388 +
  389 +#else
  390 + status = acpi_hw_extended_wake(sleep_state);
  391 +
  392 +#endif /* !ACPI_REDUCED_HARDWARE */
373 393  
374 394 return_ACPI_STATUS(status);
375 395 }
drivers/acpi/acpica/tbutils.c
... ... @@ -118,6 +118,7 @@
118 118 return AE_OK;
119 119 }
120 120  
  121 +#if (!ACPI_REDUCED_HARDWARE)
121 122 /*******************************************************************************
122 123 *
123 124 * FUNCTION: acpi_tb_initialize_facs
... ... @@ -148,6 +149,7 @@
148 149 &acpi_gbl_FACS));
149 150 return status;
150 151 }
  152 +#endif /* !ACPI_REDUCED_HARDWARE */
151 153  
152 154 /*******************************************************************************
153 155 *
drivers/acpi/acpica/utglobal.c
... ... @@ -140,6 +140,7 @@
140 140 {NULL, ACPI_TYPE_ANY, NULL}
141 141 };
142 142  
  143 +#if (!ACPI_REDUCED_HARDWARE)
143 144 /******************************************************************************
144 145 *
145 146 * Event and Hardware globals
... ... @@ -236,6 +237,7 @@
236 237 ACPI_BITMASK_RT_CLOCK_STATUS,
237 238 ACPI_BITMASK_RT_CLOCK_ENABLE},
238 239 };
  240 +#endif /* !ACPI_REDUCED_HARDWARE */
239 241  
240 242 /*******************************************************************************
241 243 *
... ... @@ -286,6 +288,8 @@
286 288  
287 289 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
288 290  
  291 +#if (!ACPI_REDUCED_HARDWARE)
  292 +
289 293 /* GPE support */
290 294  
291 295 acpi_gbl_gpe_xrupt_list_head = NULL;
... ... @@ -294,6 +298,10 @@
294 298 acpi_current_gpe_count = 0;
295 299 acpi_gbl_all_gpes_initialized = FALSE;
296 300  
  301 + acpi_gbl_global_event_handler = NULL;
  302 +
  303 +#endif /* !ACPI_REDUCED_HARDWARE */
  304 +
297 305 /* Global handlers */
298 306  
299 307 acpi_gbl_system_notify.handler = NULL;
... ... @@ -302,7 +310,6 @@
302 310 acpi_gbl_init_handler = NULL;
303 311 acpi_gbl_table_handler = NULL;
304 312 acpi_gbl_interface_handler = NULL;
305   - acpi_gbl_global_event_handler = NULL;
306 313  
307 314 /* Global Lock support */
308 315  
drivers/acpi/acpica/utinit.c
... ... @@ -53,27 +53,35 @@
53 53 /* Local prototypes */
54 54 static void acpi_ut_terminate(void);
55 55  
  56 +#if (!ACPI_REDUCED_HARDWARE)
  57 +
  58 +static 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 70 * PARAMETERS: none
61 71 *
62 72 * RETURN: none
63 73 *
64   - * DESCRIPTION: Free global memory
  74 + * DESCRIPTION: Free global GPE lists
65 75 *
66 76 ******************************************************************************/
67 77  
68   -static void acpi_ut_terminate(void)
  78 +static void acpi_ut_free_gpe_lists(void)
69 79 {
70 80 struct acpi_gpe_block_info *gpe_block;
71 81 struct acpi_gpe_block_info *next_gpe_block;
72 82 struct acpi_gpe_xrupt_info *gpe_xrupt_info;
73 83 struct acpi_gpe_xrupt_info *next_gpe_xrupt_info;
74 84  
75   - ACPI_FUNCTION_TRACE(ut_terminate);
76   -
77 85 /* Free global GPE blocks and related info structures */
78 86  
79 87 gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head;
80 88  
... ... @@ -91,7 +99,26 @@
91 99 ACPI_FREE(gpe_xrupt_info);
92 100 gpe_xrupt_info = next_gpe_xrupt_info;
93 101 }
  102 +}
  103 +#endif /* !ACPI_REDUCED_HARDWARE */
94 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 +
  117 +static void acpi_ut_terminate(void)
  118 +{
  119 + ACPI_FUNCTION_TRACE(ut_terminate);
  120 +
  121 + acpi_ut_free_gpe_lists();
95 122 acpi_ut_delete_address_lists();
96 123 return_VOID;
97 124 }
drivers/acpi/acpica/utxface.c
... ... @@ -145,6 +145,8 @@
145 145  
146 146 ACPI_FUNCTION_TRACE(acpi_enable_subsystem);
147 147  
  148 +#if (!ACPI_REDUCED_HARDWARE)
  149 +
148 150 /* Enable ACPI mode */
149 151  
150 152 if (!(flags & ACPI_NO_ACPI_ENABLE)) {
... ... @@ -169,6 +171,7 @@
169 171 ACPI_WARNING((AE_INFO, "Could not map the FACS table"));
170 172 return_ACPI_STATUS(status);
171 173 }
  174 +#endif /* !ACPI_REDUCED_HARDWARE */
172 175  
173 176 /*
174 177 * Install the default op_region handlers. These are installed unless
... ... @@ -184,7 +187,7 @@
184 187 return_ACPI_STATUS(status);
185 188 }
186 189 }
187   -
  190 +#if (!ACPI_REDUCED_HARDWARE)
188 191 /*
189 192 * Initialize ACPI Event handling (Fixed and General Purpose)
190 193 *
... ... @@ -220,6 +223,7 @@
220 223 return_ACPI_STATUS(status);
221 224 }
222 225 }
  226 +#endif /* !ACPI_REDUCED_HARDWARE */
223 227  
224 228 return_ACPI_STATUS(status);
225 229 }
include/acpi/acconfig.h
  1 +/******************************************************************************
  2 + *
  3 + * Name: acconfig.h - Global configuration constants
  4 + *
  5 + *****************************************************************************/
  6 +
  7 +/*
  8 + * Copyright (C) 2000 - 2012, Intel Corp.
  9 + * All rights reserved.
  10 + *
  11 + * Redistribution and use in source and binary forms, with or without
  12 + * modification, are permitted provided that the following conditions
  13 + * are met:
  14 + * 1. Redistributions of source code must retain the above copyright
  15 + * notice, this list of conditions, and the following disclaimer,
  16 + * without modification.
  17 + * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  18 + * substantially similar to the "NO WARRANTY" disclaimer below
  19 + * ("Disclaimer") and any redistribution must be conditioned upon
  20 + * including a substantially similar Disclaimer requirement for further
  21 + * binary redistribution.
  22 + * 3. Neither the names of the above-listed copyright holders nor the names
  23 + * of any contributors may be used to endorse or promote products derived
  24 + * from this software without specific prior written permission.
  25 + *
  26 + * Alternatively, this software may be distributed under the terms of the
  27 + * GNU General Public License ("GPL") version 2 as published by the Free
  28 + * Software Foundation.
  29 + *
  30 + * NO WARRANTY
  31 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  32 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  33 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  34 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  35 + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  36 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  37 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  38 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  39 + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  40 + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  41 + * POSSIBILITY OF SUCH DAMAGES.
  42 + */
  43 +
  44 +#ifndef _ACCONFIG_H
  45 +#define _ACCONFIG_H
  46 +
  47 +/******************************************************************************
  48 + *
  49 + * Configuration options
  50 + *
  51 + *****************************************************************************/
  52 +
  53 +/*
  54 + * ACPI_DEBUG_OUTPUT - This switch enables all the debug facilities of the
  55 + * ACPI subsystem. This includes the DEBUG_PRINT output
  56 + * statements. When disabled, all DEBUG_PRINT
  57 + * statements are compiled out.
  58 + *
  59 + * ACPI_APPLICATION - Use this switch if the subsystem is going to be run
  60 + * at the application level.
  61 + *
  62 + */
  63 +
  64 +/*
  65 + * OS name, used for the _OS object. The _OS object is essentially obsolete,
  66 + * but there is a large base of ASL/AML code in existing machines that check
  67 + * for the string below. The use of this string usually guarantees that
  68 + * the ASL will execute down the most tested code path. Also, there is some
  69 + * code that will not execute the _OSI method unless _OS matches the string
  70 + * below. Therefore, change this string at your own risk.
  71 + */
  72 +#define ACPI_OS_NAME "Microsoft Windows NT"
  73 +
  74 +/* Maximum objects in the various object caches */
  75 +
  76 +#define ACPI_MAX_STATE_CACHE_DEPTH 96 /* State objects */
  77 +#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */
  78 +#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */
  79 +#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */
  80 +#define ACPI_MAX_NAMESPACE_CACHE_DEPTH 96 /* Namespace objects */
  81 +
  82 +/*
  83 + * Should the subsystem abort the loading of an ACPI table if the
  84 + * table checksum is incorrect?
  85 + */
  86 +#define ACPI_CHECKSUM_ABORT FALSE
  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 +
  105 +/******************************************************************************
  106 + *
  107 + * Subsystem Constants
  108 + *
  109 + *****************************************************************************/
  110 +
  111 +/* Version of ACPI supported */
  112 +
  113 +#define ACPI_CA_SUPPORT_LEVEL 5
  114 +
  115 +/* Maximum count for a semaphore object */
  116 +
  117 +#define ACPI_MAX_SEMAPHORE_COUNT 256
  118 +
  119 +/* Maximum object reference count (detects object deletion issues) */
  120 +
  121 +#define ACPI_MAX_REFERENCE_COUNT 0x1000
  122 +
  123 +/* Default page size for use in mapping memory for operation regions */
  124 +
  125 +#define ACPI_DEFAULT_PAGE_SIZE 4096 /* Must be power of 2 */
  126 +
  127 +/* owner_id tracking. 8 entries allows for 255 owner_ids */
  128 +
  129 +#define ACPI_NUM_OWNERID_MASKS 8
  130 +
  131 +/* Size of the root table array is increased by this increment */
  132 +
  133 +#define ACPI_ROOT_TABLE_SIZE_INCREMENT 4
  134 +
  135 +/* Maximum number of While() loop iterations before forced abort */
  136 +
  137 +#define ACPI_MAX_LOOP_ITERATIONS 0xFFFF
  138 +
  139 +/* Maximum sleep allowed via Sleep() operator */
  140 +
  141 +#define ACPI_MAX_SLEEP 2000 /* Two seconds */
  142 +
  143 +/* Address Range lists are per-space_id (Memory and I/O only) */
  144 +
  145 +#define ACPI_ADDRESS_RANGE_MAX 2
  146 +
  147 +/******************************************************************************
  148 + *
  149 + * ACPI Specification constants (Do not change unless the specification changes)
  150 + *
  151 + *****************************************************************************/
  152 +
  153 +/* Number of distinct GPE register blocks and register width */
  154 +
  155 +#define ACPI_MAX_GPE_BLOCKS 2
  156 +#define ACPI_GPE_REGISTER_WIDTH 8
  157 +
  158 +/* Method info (in WALK_STATE), containing local variables and argumetns */
  159 +
  160 +#define ACPI_METHOD_NUM_LOCALS 8
  161 +#define ACPI_METHOD_MAX_LOCAL 7
  162 +
  163 +#define ACPI_METHOD_NUM_ARGS 7
  164 +#define ACPI_METHOD_MAX_ARG 6
  165 +
  166 +/* Length of _HID, _UID, _CID, and UUID values */
  167 +
  168 +#define ACPI_DEVICE_ID_LENGTH 0x09
  169 +#define ACPI_MAX_CID_LENGTH 48
  170 +#define ACPI_UUID_LENGTH 16
  171 +
  172 +/*
  173 + * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG
  174 + */
  175 +#define ACPI_OBJ_NUM_OPERANDS 8
  176 +#define ACPI_OBJ_MAX_OPERAND 7
  177 +
  178 +/* Number of elements in the Result Stack frame, can be an arbitrary value */
  179 +
  180 +#define ACPI_RESULTS_FRAME_OBJ_NUM 8
  181 +
  182 +/*
  183 + * Maximal number of elements the Result Stack can contain,
  184 + * it may be an arbitray value not exceeding the types of
  185 + * result_size and result_count (now u8).
  186 + */
  187 +#define ACPI_RESULTS_OBJ_NUM_MAX 255
  188 +
  189 +/* Names within the namespace are 4 bytes long */
  190 +
  191 +#define ACPI_NAME_SIZE 4
  192 +#define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */
  193 +#define ACPI_PATH_SEPARATOR '.'
  194 +
  195 +/* Sizes for ACPI table headers */
  196 +
  197 +#define ACPI_OEM_ID_SIZE 6
  198 +#define ACPI_OEM_TABLE_ID_SIZE 8
  199 +
  200 +/* Constants used in searching for the RSDP in low memory */
  201 +
  202 +#define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */
  203 +#define ACPI_EBDA_PTR_LENGTH 2
  204 +#define ACPI_EBDA_WINDOW_SIZE 1024
  205 +#define ACPI_HI_RSDP_WINDOW_BASE 0x000E0000 /* Physical Address */
  206 +#define ACPI_HI_RSDP_WINDOW_SIZE 0x00020000
  207 +#define ACPI_RSDP_SCAN_STEP 16
  208 +
  209 +/* Operation regions */
  210 +
  211 +#define ACPI_USER_REGION_BEGIN 0x80
  212 +
  213 +/* Maximum space_ids for Operation Regions */
  214 +
  215 +#define ACPI_MAX_ADDRESS_SPACE 255
  216 +
  217 +/* Array sizes. Used for range checking also */
  218 +
  219 +#define ACPI_MAX_MATCH_OPCODE 5
  220 +
  221 +/* RSDP checksums */
  222 +
  223 +#define ACPI_RSDP_CHECKSUM_LENGTH 20
  224 +#define ACPI_RSDP_XCHECKSUM_LENGTH 36
  225 +
  226 +/* SMBus, GSBus and IPMI bidirectional buffer size */
  227 +
  228 +#define ACPI_SMBUS_BUFFER_SIZE 34
  229 +#define ACPI_GSBUS_BUFFER_SIZE 34
  230 +#define ACPI_IPMI_BUFFER_SIZE 66
  231 +
  232 +/* _sx_d and _sx_w control methods */
  233 +
  234 +#define ACPI_NUM_sx_d_METHODS 4
  235 +#define ACPI_NUM_sx_w_METHODS 5
  236 +
  237 +/******************************************************************************
  238 + *
  239 + * ACPI AML Debugger
  240 + *
  241 + *****************************************************************************/
  242 +
  243 +#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */
  244 +
  245 +#define ACPI_DEBUGGER_COMMAND_PROMPT '-'
  246 +#define ACPI_DEBUGGER_EXECUTE_PROMPT '%'
  247 +
  248 +#endif /* _ACCONFIG_H */
include/acpi/acexcep.h
... ... @@ -89,8 +89,9 @@
89 89 #define AE_SAME_HANDLER (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL)
90 90 #define AE_NO_HANDLER (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL)
91 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 97 * Programmer exceptions
... ... @@ -213,7 +214,8 @@
213 214 "AE_ABORT_METHOD",
214 215 "AE_SAME_HANDLER",
215 216 "AE_NO_HANDLER",
216   - "AE_OWNER_ID_LIMIT"
  217 + "AE_OWNER_ID_LIMIT",
  218 + "AE_NOT_CONFIGURED"
217 219 };
218 220  
219 221 char const *acpi_gbl_exception_names_pgm[] = {
include/acpi/acpixf.h
... ... @@ -49,6 +49,7 @@
49 49  
50 50 #define ACPI_CA_VERSION 0x20120111
51 51  
  52 +#include "acconfig.h"
52 53 #include "actypes.h"
53 54 #include "actbl.h"
54 55  
... ... @@ -71,6 +72,33 @@
71 72 extern u8 acpi_gbl_truncate_io_addresses;
72 73 extern 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 +
74 102 extern u32 acpi_current_gpe_count;
75 103 extern struct acpi_table_fadt acpi_gbl_FADT;
76 104 extern u8 acpi_gbl_system_awake_and_running;
77 105  
... ... @@ -96,10 +124,9 @@
96 124 acpi_status acpi_subsystem_status(void);
97 125 #endif
98 126  
99   -acpi_status acpi_enable(void);
  127 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
  128 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
100 129  
101   -acpi_status acpi_disable(void);
102   -
103 130 #ifdef ACPI_FUTURE_USAGE
104 131 acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer);
105 132 #endif
106 133  
107 134  
... ... @@ -235,18 +262,35 @@
235 262 acpi_status
236 263 acpi_install_initialization_handler(acpi_init_handler handler, u32 function);
237 264  
238   -acpi_status
239   -acpi_install_global_event_handler(ACPI_GBL_EVENT_HANDLER handler,
240   - void *context);
  265 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  266 + acpi_install_global_event_handler
  267 + (ACPI_GBL_EVENT_HANDLER handler, void *context))
241 268  
  269 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  270 + acpi_install_fixed_event_handler(u32
  271 + acpi_event,
  272 + acpi_event_handler
  273 + handler,
  274 + void
  275 + *context))
  276 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  277 + acpi_remove_fixed_event_handler(u32 acpi_event,
  278 + acpi_event_handler
  279 + handler))
  280 +ACPI_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))
  288 +ACPI_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))
242 293 acpi_status
243   -acpi_install_fixed_event_handler(u32 acpi_event,
244   - acpi_event_handler handler, void *context);
245   -
246   -acpi_status
247   -acpi_remove_fixed_event_handler(u32 acpi_event, acpi_event_handler handler);
248   -
249   -acpi_status
250 294 acpi_install_notify_handler(acpi_handle device,
251 295 u32 handler_type,
252 296 acpi_notify_handler handler, void *context);
... ... @@ -266,15 +310,6 @@
266 310 acpi_adr_space_type space_id,
267 311 acpi_adr_space_handler handler);
268 312  
269   -acpi_status
270   -acpi_install_gpe_handler(acpi_handle gpe_device,
271   - u32 gpe_number,
272   - u32 type, acpi_gpe_handler address, void *context);
273   -
274   -acpi_status
275   -acpi_remove_gpe_handler(acpi_handle gpe_device,
276   - u32 gpe_number, acpi_gpe_handler address);
277   -
278 313 #ifdef ACPI_FUTURE_USAGE
279 314 acpi_status acpi_install_exception_handler(acpi_exception_handler handler);
280 315 #endif
281 316  
... ... @@ -284,10 +319,12 @@
284 319 /*
285 320 * Global Lock interfaces
286 321 */
287   -acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle);
  322 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  323 + acpi_acquire_global_lock(u16 timeout,
  324 + u32 *handle))
  325 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  326 + acpi_release_global_lock(u32 handle))
288 327  
289   -acpi_status acpi_release_global_lock(u32 handle);
290   -
291 328 /*
292 329 * Interfaces to AML mutex objects
293 330 */
294 331  
295 332  
296 333  
297 334  
298 335  
299 336  
300 337  
301 338  
302 339  
303 340  
304 341  
305 342  
306 343  
307 344  
308 345  
... ... @@ -299,48 +336,76 @@
299 336 /*
300 337 * Fixed Event interfaces
301 338 */
302   -acpi_status acpi_enable_event(u32 event, u32 flags);
  339 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  340 + acpi_enable_event(u32 event, u32 flags))
303 341  
304   -acpi_status acpi_disable_event(u32 event, u32 flags);
  342 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  343 + acpi_disable_event(u32 event, u32 flags))
305 344  
306   -acpi_status acpi_clear_event(u32 event);
  345 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event))
307 346  
308   -acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status);
309   -
  347 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  348 + acpi_get_event_status(u32 event,
  349 + acpi_event_status
  350 + *event_status))
310 351 /*
311 352 * General Purpose Event (GPE) Interfaces
312 353 */
313   -acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number);
  354 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_update_all_gpes(void))
314 355  
315   -acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number);
  356 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  357 + acpi_enable_gpe(acpi_handle gpe_device,
  358 + u32 gpe_number))
316 359  
317   -acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number);
  360 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  361 + acpi_disable_gpe(acpi_handle gpe_device,
  362 + u32 gpe_number))
318 363  
319   -acpi_status
320   -acpi_setup_gpe_for_wake(acpi_handle parent_device,
321   - acpi_handle gpe_device, u32 gpe_number);
  364 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  365 + acpi_clear_gpe(acpi_handle gpe_device,
  366 + u32 gpe_number))
322 367  
323   -acpi_status acpi_set_gpe_wake_mask(acpi_handle gpe_device, u32 gpe_number, u8 action);
  368 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  369 + acpi_set_gpe(acpi_handle gpe_device,
  370 + u32 gpe_number, u8 action))
324 371  
325   -acpi_status
326   -acpi_get_gpe_status(acpi_handle gpe_device,
327   - u32 gpe_number, acpi_event_status *event_status);
  372 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  373 + acpi_finish_gpe(acpi_handle gpe_device,
  374 + u32 gpe_number))
328 375  
329   -acpi_status acpi_disable_all_gpes(void);
  376 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  377 + acpi_setup_gpe_for_wake(acpi_handle
  378 + parent_device,
  379 + acpi_handle gpe_device,
  380 + u32 gpe_number))
  381 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  382 + acpi_set_gpe_wake_mask(acpi_handle gpe_device,
  383 + u32 gpe_number,
  384 + u8 action))
  385 +ACPI_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))
330 390  
331   -acpi_status acpi_enable_all_runtime_gpes(void);
  391 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
332 392  
333   -acpi_status acpi_get_gpe_device(u32 gpe_index, acpi_handle *gpe_device);
  393 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void))
334 394  
335   -acpi_status
336   -acpi_install_gpe_block(acpi_handle gpe_device,
337   - struct acpi_generic_address *gpe_block_address,
338   - u32 register_count, u32 interrupt_number);
  395 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  396 + acpi_get_gpe_device(u32 gpe_index,
  397 + acpi_handle * gpe_device))
339 398  
340   -acpi_status acpi_remove_gpe_block(acpi_handle gpe_device);
  399 +ACPI_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))
  406 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  407 + acpi_remove_gpe_block(acpi_handle gpe_device))
341 408  
342   -acpi_status acpi_update_all_gpes(void);
343   -
344 409 /*
345 410 * Resource interfaces
346 411 */
347 412  
348 413  
349 414  
350 415  
... ... @@ -391,20 +456,31 @@
391 456 */
392 457 acpi_status acpi_reset(void);
393 458  
394   -acpi_status acpi_read_bit_register(u32 register_id, u32 *return_value);
  459 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  460 + acpi_read_bit_register(u32 register_id,
  461 + u32 *return_value))
395 462  
396   -acpi_status acpi_write_bit_register(u32 register_id, u32 value);
  463 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  464 + acpi_write_bit_register(u32 register_id,
  465 + u32 value))
397 466  
398   -acpi_status acpi_set_firmware_waking_vector(u32 physical_address);
  467 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  468 + acpi_set_firmware_waking_vector(u32
  469 + physical_address))
399 470  
400 471 #if ACPI_MACHINE_WIDTH == 64
401   -acpi_status acpi_set_firmware_waking_vector64(u64 physical_address);
  472 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  473 + acpi_set_firmware_waking_vector64(u64
  474 + physical_address))
402 475 #endif
403 476  
404 477 acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg);
405 478  
406 479 acpi_status acpi_write(u64 value, struct acpi_generic_address *reg);
407 480  
  481 +/*
  482 + * Sleep/Wake interfaces
  483 + */
408 484 acpi_status
409 485 acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b);
410 486  
... ... @@ -412,7 +488,7 @@
412 488  
413 489 acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state);
414 490  
415   -acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void);
  491 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void))
416 492  
417 493 acpi_status acpi_leave_sleep_state_prep(u8 sleep_state);
418 494  
419 495  
420 496  
... ... @@ -422,12 +498,15 @@
422 498 * ACPI Timer interfaces
423 499 */
424 500 #ifdef ACPI_FUTURE_USAGE
425   -acpi_status acpi_get_timer_resolution(u32 *resolution);
  501 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  502 + acpi_get_timer_resolution(u32 *resolution))
426 503  
427   -acpi_status acpi_get_timer(u32 *ticks);
  504 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks))
428 505  
429   -acpi_status
430   -acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 *time_elapsed);
  506 +ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
  507 + acpi_get_timer_duration(u32 start_ticks,
  508 + u32 end_ticks,
  509 + u32 *time_elapsed))
431 510 #endif /* ACPI_FUTURE_USAGE */
432 511  
433 512 /*