Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bob Moore and committed by
Len Brown
33620c54 d08310fe

+520 -309
-1
drivers/acpi/acpica/accommon.h
··· 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 */
+17
drivers/acpi/acpica/acconfig.h include/acpi/acconfig.h
··· 85 85 */ 86 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 107 * Subsystem Constants
+5 -3
drivers/acpi/acpica/acdebug.h
··· 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 ··· 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
+11 -10
drivers/acpi/acpica/acevents.h
··· 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); 73 - 74 - acpi_status acpi_ev_release_global_lock(void); 75 - 76 - acpi_status acpi_ev_remove_global_lock_handler(void); 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); 77 76 78 77 /* 79 78 * evgpe - Low-level GPE support ··· 113 114 struct acpi_gpe_block_info *gpe_block, 114 115 void *context); 115 116 116 - acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block); 117 + ACPI_HW_DEPENDENT_RETURN_OK(acpi_status 118 + acpi_ev_delete_gpe_block(struct acpi_gpe_block_info 119 + *gpe_block)) 117 120 118 121 u32 119 122 acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device, ··· 127 126 */ 128 127 acpi_status acpi_ev_gpe_initialize(void); 129 128 130 - void acpi_ev_update_gpes(acpi_owner_id table_owner_id); 129 + ACPI_HW_DEPENDENT_RETURN_VOID(void 130 + acpi_ev_update_gpes(acpi_owner_id table_owner_id)) 131 131 132 - acpi_status 132 + acpi_status 133 133 acpi_ev_match_gpe_method(acpi_handle obj_handle, 134 134 u32 level, void *context, void **return_value); 135 135 ··· 239 237 240 238 u32 acpi_ev_initialize_sCI(u32 program_sCI); 241 239 242 - void acpi_ev_terminate(void); 243 - 240 + ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_ev_terminate(void)) 244 241 #endif /* __ACEVENTS_H__ */
+10 -1
drivers/acpi/acpica/acglobal.h
··· 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 ··· 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; 190 + 191 + #endif /* !ACPI_REDUCED_HARDWARE */ 188 192 189 193 /* These addresses are calculated from the FADT Event Block addresses */ 190 194 ··· 401 397 ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; 402 398 ACPI_EXTERN struct acpi_gpe_block_info 403 399 *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; 400 + 401 + #if (!ACPI_REDUCED_HARDWARE) 402 + 404 403 ACPI_EXTERN u8 acpi_gbl_all_gpes_initialized; 405 404 ACPI_EXTERN ACPI_GBL_EVENT_HANDLER acpi_gbl_global_event_handler; 406 405 ACPI_EXTERN void *acpi_gbl_global_event_handler_context; 406 + 407 + #endif /* !ACPI_REDUCED_HARDWARE */ 407 408 408 409 /***************************************************************************** 409 410 *
+3 -1
drivers/acpi/acpica/evevent.c
··· 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 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 */
+3 -1
drivers/acpi/acpica/evglock.c
··· 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 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 */
+3 -1
drivers/acpi/acpica/evgpe.c
··· 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 766 767 767 return_UINT32(ACPI_INTERRUPT_HANDLED); 768 768 } 769 + 770 + #endif /* !ACPI_REDUCED_HARDWARE */
+3 -1
drivers/acpi/acpica/evgpeblk.c
··· 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 504 505 505 return_ACPI_STATUS(AE_OK); 506 506 } 507 + 508 + #endif /* !ACPI_REDUCED_HARDWARE */
+3 -1
drivers/acpi/acpica/evgpeinit.c
··· 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 440 name, gpe_number)); 441 441 return_ACPI_STATUS(AE_OK); 442 442 } 443 + 444 + #endif /* !ACPI_REDUCED_HARDWARE */
+3
drivers/acpi/acpica/evgpeutil.c
··· 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 ··· 375 374 376 375 return_ACPI_STATUS(AE_OK); 377 376 } 377 + 378 + #endif /* !ACPI_REDUCED_HARDWARE */
+3
drivers/acpi/acpica/evmisc.c
··· 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 ··· 339 338 } 340 339 return_VOID; 341 340 } 341 + 342 + #endif /* !ACPI_REDUCED_HARDWARE */
+3 -1
drivers/acpi/acpica/evsci.c
··· 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 181 182 182 return_ACPI_STATUS(status); 183 183 } 184 + 185 + #endif /* !ACPI_REDUCED_HARDWARE */
+220 -216
drivers/acpi/acpica/evxface.c
··· 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 - 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 - /******************************************************************************* 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 - ******************************************************************************/ 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 54 271 55 /******************************************************************************* 272 56 * ··· 117 333 118 334 return AE_OK; 119 335 } 336 + 120 337 121 338 /******************************************************************************* 122 339 * ··· 490 705 491 706 /******************************************************************************* 492 707 * 708 + * FUNCTION: acpi_install_exception_handler 709 + * 710 + * PARAMETERS: Handler - Pointer to the handler function for the 711 + * event 712 + * 713 + * RETURN: Status 714 + * 715 + * DESCRIPTION: Saves the pointer to the handler function 716 + * 717 + ******************************************************************************/ 718 + #ifdef ACPI_FUTURE_USAGE 719 + acpi_status acpi_install_exception_handler(acpi_exception_handler handler) 720 + { 721 + acpi_status status; 722 + 723 + ACPI_FUNCTION_TRACE(acpi_install_exception_handler); 724 + 725 + status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); 726 + if (ACPI_FAILURE(status)) { 727 + return_ACPI_STATUS(status); 728 + } 729 + 730 + /* Don't allow two handlers. */ 731 + 732 + if (acpi_gbl_exception_handler) { 733 + status = AE_ALREADY_EXISTS; 734 + goto cleanup; 735 + } 736 + 737 + /* Install the handler */ 738 + 739 + acpi_gbl_exception_handler = handler; 740 + 741 + cleanup: 742 + (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); 743 + return_ACPI_STATUS(status); 744 + } 745 + 746 + ACPI_EXPORT_SYMBOL(acpi_install_exception_handler) 747 + #endif /* ACPI_FUTURE_USAGE */ 748 + 749 + #if (!ACPI_REDUCED_HARDWARE) 750 + /******************************************************************************* 751 + * 752 + * FUNCTION: acpi_install_global_event_handler 753 + * 754 + * PARAMETERS: Handler - Pointer to the global event handler function 755 + * Context - Value passed to the handler on each event 756 + * 757 + * RETURN: Status 758 + * 759 + * DESCRIPTION: Saves the pointer to the handler function. The global handler 760 + * is invoked upon each incoming GPE and Fixed Event. It is 761 + * invoked at interrupt level at the time of the event dispatch. 762 + * Can be used to update event counters, etc. 763 + * 764 + ******************************************************************************/ 765 + acpi_status 766 + acpi_install_global_event_handler(ACPI_GBL_EVENT_HANDLER handler, void *context) 767 + { 768 + acpi_status status; 769 + 770 + ACPI_FUNCTION_TRACE(acpi_install_global_event_handler); 771 + 772 + /* Parameter validation */ 773 + 774 + if (!handler) { 775 + return_ACPI_STATUS(AE_BAD_PARAMETER); 776 + } 777 + 778 + status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); 779 + if (ACPI_FAILURE(status)) { 780 + return_ACPI_STATUS(status); 781 + } 782 + 783 + /* Don't allow two handlers. */ 784 + 785 + if (acpi_gbl_global_event_handler) { 786 + status = AE_ALREADY_EXISTS; 787 + goto cleanup; 788 + } 789 + 790 + acpi_gbl_global_event_handler = handler; 791 + acpi_gbl_global_event_handler_context = context; 792 + 793 + cleanup: 794 + (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); 795 + return_ACPI_STATUS(status); 796 + } 797 + 798 + ACPI_EXPORT_SYMBOL(acpi_install_global_event_handler) 799 + 800 + /******************************************************************************* 801 + * 802 + * FUNCTION: acpi_install_fixed_event_handler 803 + * 804 + * PARAMETERS: Event - Event type to enable. 805 + * Handler - Pointer to the handler function for the 806 + * event 807 + * Context - Value passed to the handler on each GPE 808 + * 809 + * RETURN: Status 810 + * 811 + * DESCRIPTION: Saves the pointer to the handler function and then enables the 812 + * event. 813 + * 814 + ******************************************************************************/ 815 + acpi_status 816 + acpi_install_fixed_event_handler(u32 event, 817 + acpi_event_handler handler, void *context) 818 + { 819 + acpi_status status; 820 + 821 + ACPI_FUNCTION_TRACE(acpi_install_fixed_event_handler); 822 + 823 + /* Parameter validation */ 824 + 825 + if (event > ACPI_EVENT_MAX) { 826 + return_ACPI_STATUS(AE_BAD_PARAMETER); 827 + } 828 + 829 + status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); 830 + if (ACPI_FAILURE(status)) { 831 + return_ACPI_STATUS(status); 832 + } 833 + 834 + /* Don't allow two handlers. */ 835 + 836 + if (NULL != acpi_gbl_fixed_event_handlers[event].handler) { 837 + status = AE_ALREADY_EXISTS; 838 + goto cleanup; 839 + } 840 + 841 + /* Install the handler before enabling the event */ 842 + 843 + acpi_gbl_fixed_event_handlers[event].handler = handler; 844 + acpi_gbl_fixed_event_handlers[event].context = context; 845 + 846 + status = acpi_clear_event(event); 847 + if (ACPI_SUCCESS(status)) 848 + status = acpi_enable_event(event, 0); 849 + if (ACPI_FAILURE(status)) { 850 + ACPI_WARNING((AE_INFO, "Could not enable fixed event 0x%X", 851 + event)); 852 + 853 + /* Remove the handler */ 854 + 855 + acpi_gbl_fixed_event_handlers[event].handler = NULL; 856 + acpi_gbl_fixed_event_handlers[event].context = NULL; 857 + } else { 858 + ACPI_DEBUG_PRINT((ACPI_DB_INFO, 859 + "Enabled fixed event %X, Handler=%p\n", event, 860 + handler)); 861 + } 862 + 863 + cleanup: 864 + (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); 865 + return_ACPI_STATUS(status); 866 + } 867 + 868 + ACPI_EXPORT_SYMBOL(acpi_install_fixed_event_handler) 869 + 870 + /******************************************************************************* 871 + * 872 + * FUNCTION: acpi_remove_fixed_event_handler 873 + * 874 + * PARAMETERS: Event - Event type to disable. 875 + * Handler - Address of the handler 876 + * 877 + * RETURN: Status 878 + * 879 + * DESCRIPTION: Disables the event and unregisters the event handler. 880 + * 881 + ******************************************************************************/ 882 + acpi_status 883 + acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler) 884 + { 885 + acpi_status status = AE_OK; 886 + 887 + ACPI_FUNCTION_TRACE(acpi_remove_fixed_event_handler); 888 + 889 + /* Parameter validation */ 890 + 891 + if (event > ACPI_EVENT_MAX) { 892 + return_ACPI_STATUS(AE_BAD_PARAMETER); 893 + } 894 + 895 + status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); 896 + if (ACPI_FAILURE(status)) { 897 + return_ACPI_STATUS(status); 898 + } 899 + 900 + /* Disable the event before removing the handler */ 901 + 902 + status = acpi_disable_event(event, 0); 903 + 904 + /* Always Remove the handler */ 905 + 906 + acpi_gbl_fixed_event_handlers[event].handler = NULL; 907 + acpi_gbl_fixed_event_handlers[event].context = NULL; 908 + 909 + if (ACPI_FAILURE(status)) { 910 + ACPI_WARNING((AE_INFO, 911 + "Could not write to fixed event enable register 0x%X", 912 + event)); 913 + } else { 914 + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X\n", 915 + event)); 916 + } 917 + 918 + (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); 919 + return_ACPI_STATUS(status); 920 + } 921 + 922 + ACPI_EXPORT_SYMBOL(acpi_remove_fixed_event_handler) 923 + 924 + /******************************************************************************* 925 + * 493 926 * FUNCTION: acpi_install_gpe_handler 494 927 * 495 928 * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT ··· 987 984 } 988 985 989 986 ACPI_EXPORT_SYMBOL(acpi_release_global_lock) 987 + #endif /* !ACPI_REDUCED_HARDWARE */
+2
drivers/acpi/acpica/evxfevnt.c
··· 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 ··· 353 352 } 354 353 355 354 ACPI_EXPORT_SYMBOL(acpi_get_event_status) 355 + #endif /* !ACPI_REDUCED_HARDWARE */
+2
drivers/acpi/acpica/evxfgpe.c
··· 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 ··· 696 695 } 697 696 698 697 ACPI_EXPORT_SYMBOL(acpi_get_gpe_device) 698 + #endif /* !ACPI_REDUCED_HARDWARE */
+3
drivers/acpi/acpica/hwacpi.c
··· 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 ··· 167 166 return_UINT32(ACPI_SYS_MODE_LEGACY); 168 167 } 169 168 } 169 + 170 + #endif /* !ACPI_REDUCED_HARDWARE */
+3 -1
drivers/acpi/acpica/hwgpe.c
··· 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 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 */
+7 -1
drivers/acpi/acpica/hwregs.c
··· 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 61 acpi_hw_write_multiple(u32 value, 63 62 struct acpi_generic_address *register_a, 64 63 struct acpi_generic_address *register_b); 64 + 65 + #endif /* !ACPI_REDUCED_HARDWARE */ 65 66 66 67 /****************************************************************************** 67 68 * ··· 243 240 return (status); 244 241 } 245 242 243 + #if (!ACPI_REDUCED_HARDWARE) 246 244 /******************************************************************************* 247 245 * 248 246 * FUNCTION: acpi_hw_clear_acpi_status ··· 289 285 290 286 /******************************************************************************* 291 287 * 292 - * FUNCTION: acpi_hw_get_register_bit_mask 288 + * FUNCTION: acpi_hw_get_bit_register_info 293 289 * 294 290 * PARAMETERS: register_id - Index of ACPI Register to access 295 291 * ··· 662 658 663 659 return (status); 664 660 } 661 + 662 + #endif /* !ACPI_REDUCED_HARDWARE */
+2
drivers/acpi/acpica/hwsleep.c
··· 197 197 } 198 198 } 199 199 200 + #if (!ACPI_REDUCED_HARDWARE) 200 201 /******************************************************************************* 201 202 * 202 203 * FUNCTION: acpi_hw_legacy_sleep ··· 513 512 return_ACPI_STATUS(status); 514 513 } 515 514 515 + #endif /* !ACPI_REDUCED_HARDWARE */ 516 516 517 517 /******************************************************************************* 518 518 *
+2
drivers/acpi/acpica/hwtimer.c
··· 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 ··· 188 187 } 189 188 190 189 ACPI_EXPORT_SYMBOL(acpi_get_timer_duration) 190 + #endif /* !ACPI_REDUCED_HARDWARE */
+2 -1
drivers/acpi/acpica/hwxface.c
··· 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 ··· 454 453 } 455 454 456 455 ACPI_EXPORT_SYMBOL(acpi_write_bit_register) 457 - 456 + #endif /* !ACPI_REDUCED_HARDWARE */ 458 457 /******************************************************************************* 459 458 * 460 459 * FUNCTION: acpi_get_sleep_type_data
+21 -1
drivers/acpi/acpica/hwxfsleep.c
··· 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 ··· 190 189 } 191 190 192 191 ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios) 193 - 192 + #endif /* !ACPI_REDUCED_HARDWARE */ 194 193 /******************************************************************************* 195 194 * 196 195 * FUNCTION: acpi_enter_sleep_state_prep ··· 291 290 acpi_gbl_sleep_type_a, acpi_gbl_sleep_type_b)); 292 291 return_ACPI_STATUS(AE_AML_OPERAND_VALUE); 293 292 } 293 + #if (!ACPI_REDUCED_HARDWARE) 294 294 295 295 /* If Hardware Reduced flag is set, must use the extended sleep registers */ 296 296 ··· 302 300 303 301 status = acpi_hw_legacy_sleep(sleep_state); 304 302 } 303 + 304 + #else 305 + status = acpi_hw_extended_sleep(sleep_state); 306 + 307 + #endif /* !ACPI_REDUCED_HARDWARE */ 305 308 306 309 return_ACPI_STATUS(status); 307 310 } ··· 333 326 ACPI_FUNCTION_TRACE(acpi_leave_sleep_state); 334 327 335 328 329 + #if (!ACPI_REDUCED_HARDWARE) 330 + 336 331 /* If Hardware Reduced flag is set, must use the extended sleep registers */ 337 332 338 333 if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) { ··· 344 335 345 336 status = acpi_hw_legacy_wake_prep(sleep_state); 346 337 } 338 + #else 339 + status = acpi_hw_extended_wake_prep(sleep_state); 340 + 341 + #endif /* !ACPI_REDUCED_HARDWARE */ 347 342 348 343 349 344 return_ACPI_STATUS(status); ··· 374 361 ACPI_FUNCTION_TRACE(acpi_leave_sleep_state); 375 362 376 363 364 + #if (!ACPI_REDUCED_HARDWARE) 365 + 377 366 /* If Hardware Reduced flag is set, must use the extended sleep registers */ 378 367 379 368 if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) { ··· 385 370 386 371 status = acpi_hw_legacy_wake(sleep_state); 387 372 } 373 + 374 + #else 375 + status = acpi_hw_extended_wake(sleep_state); 376 + 377 + #endif /* !ACPI_REDUCED_HARDWARE */ 388 378 389 379 return_ACPI_STATUS(status); 390 380 }
+2
drivers/acpi/acpica/tbutils.c
··· 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 ··· 149 148 &acpi_gbl_FACS)); 150 149 return status; 151 150 } 151 + #endif /* !ACPI_REDUCED_HARDWARE */ 152 152 153 153 /******************************************************************************* 154 154 *
+8 -1
drivers/acpi/acpica/utglobal.c
··· 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 ··· 237 236 ACPI_BITMASK_RT_CLOCK_STATUS, 238 237 ACPI_BITMASK_RT_CLOCK_ENABLE}, 239 238 }; 239 + #endif /* !ACPI_REDUCED_HARDWARE */ 240 240 241 241 /******************************************************************************* 242 242 * ··· 288 286 289 287 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000; 290 288 289 + #if (!ACPI_REDUCED_HARDWARE) 290 + 291 291 /* GPE support */ 292 292 293 293 acpi_gbl_gpe_xrupt_list_head = NULL; ··· 297 293 acpi_gbl_gpe_fadt_blocks[1] = NULL; 298 294 acpi_current_gpe_count = 0; 299 295 acpi_gbl_all_gpes_initialized = FALSE; 296 + 297 + acpi_gbl_global_event_handler = NULL; 298 + 299 + #endif /* !ACPI_REDUCED_HARDWARE */ 300 300 301 301 /* Global handlers */ 302 302 ··· 310 302 acpi_gbl_init_handler = NULL; 311 303 acpi_gbl_table_handler = NULL; 312 304 acpi_gbl_interface_handler = NULL; 313 - acpi_gbl_global_event_handler = NULL; 314 305 315 306 /* Global Lock support */ 316 307
+32 -5
drivers/acpi/acpica/utinit.c
··· 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 - 75 - ACPI_FUNCTION_TRACE(ut_terminate); 76 84 77 85 /* Free global GPE blocks and related info structures */ 78 86 ··· 99 91 ACPI_FREE(gpe_xrupt_info); 100 92 gpe_xrupt_info = next_gpe_xrupt_info; 101 93 } 94 + } 95 + #endif /* !ACPI_REDUCED_HARDWARE */ 102 96 97 + /****************************************************************************** 98 + * 99 + * FUNCTION: acpi_ut_terminate 100 + * 101 + * PARAMETERS: none 102 + * 103 + * RETURN: none 104 + * 105 + * DESCRIPTION: Free global memory 106 + * 107 + ******************************************************************************/ 108 + 109 + static void acpi_ut_terminate(void) 110 + { 111 + ACPI_FUNCTION_TRACE(ut_terminate); 112 + 113 + acpi_ut_free_gpe_lists(); 103 114 acpi_ut_delete_address_lists(); 104 115 return_VOID; 105 116 }
+5 -1
drivers/acpi/acpica/utxface.c
··· 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)) { ··· 171 169 ACPI_WARNING((AE_INFO, "Could not map the FACS table")); 172 170 return_ACPI_STATUS(status); 173 171 } 172 + #endif /* !ACPI_REDUCED_HARDWARE */ 174 173 175 174 /* 176 175 * Install the default op_region handlers. These are installed unless ··· 187 184 return_ACPI_STATUS(status); 188 185 } 189 186 } 190 - 187 + #if (!ACPI_REDUCED_HARDWARE) 191 188 /* 192 189 * Initialize ACPI Event handling (Fixed and General Purpose) 193 190 * ··· 223 220 return_ACPI_STATUS(status); 224 221 } 225 222 } 223 + #endif /* !ACPI_REDUCED_HARDWARE */ 226 224 227 225 return_ACPI_STATUS(status); 228 226 }
+4 -2
include/acpi/acexcep.h
··· 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 ··· 214 213 "AE_ABORT_METHOD", 215 214 "AE_SAME_HANDLER", 216 215 "AE_NO_HANDLER", 217 - "AE_OWNER_ID_LIMIT" 216 + "AE_OWNER_ID_LIMIT", 217 + "AE_NOT_CONFIGURED" 218 218 }; 219 219 220 220 char const *acpi_gbl_exception_names_pgm[] = {
+138 -59
include/acpi/acpixf.h
··· 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 70 extern u8 acpi_gbl_copy_dsdt_locally; 72 71 extern u8 acpi_gbl_truncate_io_addresses; 73 72 extern u8 acpi_gbl_disable_auto_repair; 73 + 74 + /* 75 + * Hardware-reduced prototypes. All interfaces that use these macros will 76 + * be configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag 77 + * is set to TRUE. 78 + */ 79 + #if (!ACPI_REDUCED_HARDWARE) 80 + #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \ 81 + prototype; 82 + 83 + #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \ 84 + prototype; 85 + 86 + #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \ 87 + prototype; 88 + 89 + #else 90 + #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \ 91 + static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);} 92 + 93 + #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \ 94 + static ACPI_INLINE prototype {return(AE_OK);} 95 + 96 + #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \ 97 + static ACPI_INLINE prototype {} 98 + 99 + #endif /* !ACPI_REDUCED_HARDWARE */ 74 100 75 101 extern u32 acpi_current_gpe_count; 76 102 extern struct acpi_table_fadt acpi_gbl_FADT; ··· 124 96 acpi_status acpi_subsystem_status(void); 125 97 #endif 126 98 127 - acpi_status acpi_enable(void); 128 - 129 - acpi_status acpi_disable(void); 99 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void)) 100 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void)) 130 101 131 102 #ifdef ACPI_FUTURE_USAGE 132 103 acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer); ··· 262 235 acpi_status 263 236 acpi_install_initialization_handler(acpi_init_handler handler, u32 function); 264 237 265 - acpi_status 266 - acpi_install_global_event_handler(ACPI_GBL_EVENT_HANDLER handler, 267 - void *context); 238 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 239 + acpi_install_global_event_handler 240 + (ACPI_GBL_EVENT_HANDLER handler, void *context)) 268 241 269 - acpi_status 270 - acpi_install_fixed_event_handler(u32 acpi_event, 271 - acpi_event_handler handler, void *context); 272 - 273 - acpi_status 274 - acpi_remove_fixed_event_handler(u32 acpi_event, acpi_event_handler handler); 275 - 242 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 243 + acpi_install_fixed_event_handler(u32 244 + acpi_event, 245 + acpi_event_handler 246 + handler, 247 + void 248 + *context)) 249 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 250 + acpi_remove_fixed_event_handler(u32 acpi_event, 251 + acpi_event_handler 252 + handler)) 253 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 254 + acpi_install_gpe_handler(acpi_handle 255 + gpe_device, 256 + u32 gpe_number, 257 + u32 type, 258 + acpi_gpe_handler 259 + address, 260 + void *context)) 261 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 262 + acpi_remove_gpe_handler(acpi_handle gpe_device, 263 + u32 gpe_number, 264 + acpi_gpe_handler 265 + address)) 276 266 acpi_status 277 267 acpi_install_notify_handler(acpi_handle device, 278 268 u32 handler_type, ··· 310 266 acpi_adr_space_type space_id, 311 267 acpi_adr_space_handler handler); 312 268 313 - acpi_status 314 - acpi_install_gpe_handler(acpi_handle gpe_device, 315 - u32 gpe_number, 316 - u32 type, acpi_gpe_handler address, void *context); 317 - 318 - acpi_status 319 - acpi_remove_gpe_handler(acpi_handle gpe_device, 320 - u32 gpe_number, acpi_gpe_handler address); 321 - 322 269 #ifdef ACPI_FUTURE_USAGE 323 270 acpi_status acpi_install_exception_handler(acpi_exception_handler handler); 324 271 #endif ··· 319 284 /* 320 285 * Global Lock interfaces 321 286 */ 322 - acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle); 323 - 324 - acpi_status acpi_release_global_lock(u32 handle); 287 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 288 + acpi_acquire_global_lock(u16 timeout, 289 + u32 *handle)) 290 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 291 + acpi_release_global_lock(u32 handle)) 325 292 326 293 /* 327 294 * Interfaces to AML mutex objects ··· 336 299 /* 337 300 * Fixed Event interfaces 338 301 */ 339 - acpi_status acpi_enable_event(u32 event, u32 flags); 302 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 303 + acpi_enable_event(u32 event, u32 flags)) 340 304 341 - acpi_status acpi_disable_event(u32 event, u32 flags); 305 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 306 + acpi_disable_event(u32 event, u32 flags)) 342 307 343 - acpi_status acpi_clear_event(u32 event); 308 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event)) 344 309 345 - acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status); 346 - 310 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 311 + acpi_get_event_status(u32 event, 312 + acpi_event_status 313 + *event_status)) 347 314 /* 348 315 * General Purpose Event (GPE) Interfaces 349 316 */ 350 - acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number); 317 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_update_all_gpes(void)) 351 318 352 - acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number); 319 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 320 + acpi_enable_gpe(acpi_handle gpe_device, 321 + u32 gpe_number)) 353 322 354 - acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number); 323 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 324 + acpi_disable_gpe(acpi_handle gpe_device, 325 + u32 gpe_number)) 355 326 356 - acpi_status 357 - acpi_setup_gpe_for_wake(acpi_handle parent_device, 358 - acpi_handle gpe_device, u32 gpe_number); 327 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 328 + acpi_clear_gpe(acpi_handle gpe_device, 329 + u32 gpe_number)) 359 330 360 - acpi_status acpi_set_gpe_wake_mask(acpi_handle gpe_device, u32 gpe_number, u8 action); 331 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 332 + acpi_set_gpe(acpi_handle gpe_device, 333 + u32 gpe_number, u8 action)) 361 334 362 - acpi_status 363 - acpi_get_gpe_status(acpi_handle gpe_device, 364 - u32 gpe_number, acpi_event_status *event_status); 335 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 336 + acpi_finish_gpe(acpi_handle gpe_device, 337 + u32 gpe_number)) 365 338 366 - acpi_status acpi_disable_all_gpes(void); 339 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 340 + acpi_setup_gpe_for_wake(acpi_handle 341 + parent_device, 342 + acpi_handle gpe_device, 343 + u32 gpe_number)) 344 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 345 + acpi_set_gpe_wake_mask(acpi_handle gpe_device, 346 + u32 gpe_number, 347 + u8 action)) 348 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 349 + acpi_get_gpe_status(acpi_handle gpe_device, 350 + u32 gpe_number, 351 + acpi_event_status 352 + *event_status)) 367 353 368 - acpi_status acpi_enable_all_runtime_gpes(void); 354 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void)) 369 355 370 - acpi_status acpi_get_gpe_device(u32 gpe_index, acpi_handle *gpe_device); 356 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void)) 371 357 372 - acpi_status 373 - acpi_install_gpe_block(acpi_handle gpe_device, 374 - struct acpi_generic_address *gpe_block_address, 375 - u32 register_count, u32 interrupt_number); 358 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 359 + acpi_get_gpe_device(u32 gpe_index, 360 + acpi_handle * gpe_device)) 376 361 377 - acpi_status acpi_remove_gpe_block(acpi_handle gpe_device); 378 - 379 - acpi_status acpi_update_all_gpes(void); 362 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 363 + acpi_install_gpe_block(acpi_handle gpe_device, 364 + struct 365 + acpi_generic_address 366 + *gpe_block_address, 367 + u32 register_count, 368 + u32 interrupt_number)) 369 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 370 + acpi_remove_gpe_block(acpi_handle gpe_device)) 380 371 381 372 /* 382 373 * Resource interfaces ··· 456 391 */ 457 392 acpi_status acpi_reset(void); 458 393 459 - acpi_status acpi_read_bit_register(u32 register_id, u32 *return_value); 394 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 395 + acpi_read_bit_register(u32 register_id, 396 + u32 *return_value)) 460 397 461 - acpi_status acpi_write_bit_register(u32 register_id, u32 value); 398 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 399 + acpi_write_bit_register(u32 register_id, 400 + u32 value)) 462 401 463 - acpi_status acpi_set_firmware_waking_vector(u32 physical_address); 402 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 403 + acpi_set_firmware_waking_vector(u32 404 + physical_address)) 464 405 465 406 #if ACPI_MACHINE_WIDTH == 64 466 - acpi_status acpi_set_firmware_waking_vector64(u64 physical_address); 407 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 408 + acpi_set_firmware_waking_vector64(u64 409 + physical_address)) 467 410 #endif 468 411 469 412 acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg); 470 413 471 414 acpi_status acpi_write(u64 value, struct acpi_generic_address *reg); 472 415 416 + /* 417 + * Sleep/Wake interfaces 418 + */ 473 419 acpi_status 474 420 acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b); 475 421 ··· 488 412 489 413 acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state); 490 414 491 - acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void); 415 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void)) 492 416 493 417 acpi_status acpi_leave_sleep_state_prep(u8 sleep_state); 494 418 ··· 498 422 * ACPI Timer interfaces 499 423 */ 500 424 #ifdef ACPI_FUTURE_USAGE 501 - acpi_status acpi_get_timer_resolution(u32 *resolution); 425 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 426 + acpi_get_timer_resolution(u32 *resolution)) 502 427 503 - acpi_status acpi_get_timer(u32 *ticks); 428 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks)) 504 429 505 - acpi_status 506 - acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 *time_elapsed); 430 + ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 431 + acpi_get_timer_duration(u32 start_ticks, 432 + u32 end_ticks, 433 + u32 *time_elapsed)) 507 434 #endif /* ACPI_FUTURE_USAGE */ 508 435 509 436 /*