1 /****************************************************************************** 2 * 3 * Name: acpixf.h - External interfaces to the ACPI subsystem 4 * 5 *****************************************************************************/ 6 7 /* 8 * Copyright (C) 2000 - 2016, 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 __ACXFACE_H__ 45 #define __ACXFACE_H__ 46 47 /* Current ACPICA subsystem version in YYYYMMDD format */ 48 49 #define ACPI_CA_VERSION 0x20160930 50 51 #include <acpi/acconfig.h> 52 #include <acpi/actypes.h> 53 #include <acpi/actbl.h> 54 #include <acpi/acbuffer.h> 55 56 /***************************************************************************** 57 * 58 * Macros used for ACPICA globals and configuration 59 * 60 ****************************************************************************/ 61 62 /* 63 * Ensure that global variables are defined and initialized only once. 64 * 65 * The use of these macros allows for a single list of globals (here) 66 * in order to simplify maintenance of the code. 67 */ 68 #ifdef DEFINE_ACPI_GLOBALS 69 #define ACPI_GLOBAL(type,name) \ 70 extern type name; \ 71 type name 72 73 #define ACPI_INIT_GLOBAL(type,name,value) \ 74 type name=value 75 76 #else 77 #ifndef ACPI_GLOBAL 78 #define ACPI_GLOBAL(type,name) \ 79 extern type name 80 #endif 81 82 #ifndef ACPI_INIT_GLOBAL 83 #define ACPI_INIT_GLOBAL(type,name,value) \ 84 extern type name 85 #endif 86 #endif 87 88 /* 89 * These macros configure the various ACPICA interfaces. They are 90 * useful for generating stub inline functions for features that are 91 * configured out of the current kernel or ACPICA application. 92 */ 93 #ifndef ACPI_EXTERNAL_RETURN_STATUS 94 #define ACPI_EXTERNAL_RETURN_STATUS(prototype) \ 95 prototype; 96 #endif 97 98 #ifndef ACPI_EXTERNAL_RETURN_OK 99 #define ACPI_EXTERNAL_RETURN_OK(prototype) \ 100 prototype; 101 #endif 102 103 #ifndef ACPI_EXTERNAL_RETURN_VOID 104 #define ACPI_EXTERNAL_RETURN_VOID(prototype) \ 105 prototype; 106 #endif 107 108 #ifndef ACPI_EXTERNAL_RETURN_UINT32 109 #define ACPI_EXTERNAL_RETURN_UINT32(prototype) \ 110 prototype; 111 #endif 112 113 #ifndef ACPI_EXTERNAL_RETURN_PTR 114 #define ACPI_EXTERNAL_RETURN_PTR(prototype) \ 115 prototype; 116 #endif 117 118 /***************************************************************************** 119 * 120 * Public globals and runtime configuration options 121 * 122 ****************************************************************************/ 123 124 /* 125 * Enable "slack mode" of the AML interpreter? Default is FALSE, and the 126 * interpreter strictly follows the ACPI specification. Setting to TRUE 127 * allows the interpreter to ignore certain errors and/or bad AML constructs. 128 * 129 * Currently, these features are enabled by this flag: 130 * 131 * 1) Allow "implicit return" of last value in a control method 132 * 2) Allow access beyond the end of an operation region 133 * 3) Allow access to uninitialized locals/args (auto-init to integer 0) 134 * 4) Allow ANY object type to be a source operand for the Store() operator 135 * 5) Allow unresolved references (invalid target name) in package objects 136 * 6) Enable warning messages for behavior that is not ACPI spec compliant 137 */ 138 ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_interpreter_slack, FALSE); 139 140 /* 141 * Automatically serialize all methods that create named objects? Default 142 * is TRUE, meaning that all non_serialized methods are scanned once at 143 * table load time to determine those that create named objects. Methods 144 * that create named objects are marked Serialized in order to prevent 145 * possible run-time problems if they are entered by more than one thread. 146 */ 147 ACPI_INIT_GLOBAL(u8, acpi_gbl_auto_serialize_methods, TRUE); 148 149 /* 150 * Create the predefined _OSI method in the namespace? Default is TRUE 151 * because ACPICA is fully compatible with other ACPI implementations. 152 * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior. 153 */ 154 ACPI_INIT_GLOBAL(u8, acpi_gbl_create_osi_method, TRUE); 155 156 /* 157 * Optionally use default values for the ACPI register widths. Set this to 158 * TRUE to use the defaults, if an FADT contains incorrect widths/lengths. 159 */ 160 ACPI_INIT_GLOBAL(u8, acpi_gbl_use_default_register_widths, TRUE); 161 162 /* 163 * Whether or not to verify the table checksum before installation. Set 164 * this to TRUE to verify the table checksum before install it to the table 165 * manager. Note that enabling this option causes errors to happen in some 166 * OSPMs during early initialization stages. Default behavior is to do such 167 * verification. 168 */ 169 ACPI_INIT_GLOBAL(u8, acpi_gbl_verify_table_checksum, TRUE); 170 171 /* 172 * Optionally enable output from the AML Debug Object. 173 */ 174 ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_aml_debug_object, FALSE); 175 176 /* 177 * Optionally copy the entire DSDT to local memory (instead of simply 178 * mapping it.) There are some BIOSs that corrupt or replace the original 179 * DSDT, creating the need for this option. Default is FALSE, do not copy 180 * the DSDT. 181 */ 182 ACPI_INIT_GLOBAL(u8, acpi_gbl_copy_dsdt_locally, FALSE); 183 184 /* 185 * Optionally ignore an XSDT if present and use the RSDT instead. 186 * Although the ACPI specification requires that an XSDT be used instead 187 * of the RSDT, the XSDT has been found to be corrupt or ill-formed on 188 * some machines. Default behavior is to use the XSDT if present. 189 */ 190 ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE); 191 192 /* 193 * Optionally support group module level code. 194 */ 195 ACPI_INIT_GLOBAL(u8, acpi_gbl_group_module_level_code, TRUE); 196 197 /* 198 * Optionally support module level code by parsing the entire table as 199 * a term_list. Default is FALSE, do not execute entire table until some 200 * lock order issues are fixed. 201 */ 202 ACPI_INIT_GLOBAL(u8, acpi_gbl_parse_table_as_term_list, FALSE); 203 204 /* 205 * Optionally use 32-bit FADT addresses if and when there is a conflict 206 * (address mismatch) between the 32-bit and 64-bit versions of the 207 * address. Although ACPICA adheres to the ACPI specification which 208 * requires the use of the corresponding 64-bit address if it is non-zero, 209 * some machines have been found to have a corrupted non-zero 64-bit 210 * address. Default is FALSE, do not favor the 32-bit addresses. 211 */ 212 ACPI_INIT_GLOBAL(u8, acpi_gbl_use32_bit_fadt_addresses, FALSE); 213 214 /* 215 * Optionally use 32-bit FACS table addresses. 216 * It is reported that some platforms fail to resume from system suspending 217 * if 64-bit FACS table address is selected: 218 * https://bugzilla.kernel.org/show_bug.cgi?id=74021 219 * Default is TRUE, favor the 32-bit addresses. 220 */ 221 ACPI_INIT_GLOBAL(u8, acpi_gbl_use32_bit_facs_addresses, TRUE); 222 223 /* 224 * Optionally truncate I/O addresses to 16 bits. Provides compatibility 225 * with other ACPI implementations. NOTE: During ACPICA initialization, 226 * this value is set to TRUE if any Windows OSI strings have been 227 * requested by the BIOS. 228 */ 229 ACPI_INIT_GLOBAL(u8, acpi_gbl_truncate_io_addresses, FALSE); 230 231 /* 232 * Disable runtime checking and repair of values returned by control methods. 233 * Use only if the repair is causing a problem on a particular machine. 234 */ 235 ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_auto_repair, FALSE); 236 237 /* 238 * Optionally do not install any SSDTs from the RSDT/XSDT during initialization. 239 * This can be useful for debugging ACPI problems on some machines. 240 */ 241 ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_ssdt_table_install, FALSE); 242 243 /* 244 * Optionally enable runtime namespace override. 245 */ 246 ACPI_INIT_GLOBAL(u8, acpi_gbl_runtime_namespace_override, TRUE); 247 248 /* 249 * We keep track of the latest version of Windows that has been requested by 250 * the BIOS. ACPI 5.0. 251 */ 252 ACPI_INIT_GLOBAL(u8, acpi_gbl_osi_data, 0); 253 254 /* 255 * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning 256 * that the ACPI hardware is no longer required. A flag in the FADT indicates 257 * a reduced HW machine, and that flag is duplicated here for convenience. 258 */ 259 ACPI_INIT_GLOBAL(u8, acpi_gbl_reduced_hardware, FALSE); 260 261 /* 262 * Maximum number of While() loop iterations before forced method abort. 263 * This mechanism is intended to prevent infinite loops during interpreter 264 * execution within a host kernel. 265 */ 266 ACPI_INIT_GLOBAL(u32, acpi_gbl_max_loop_iterations, ACPI_MAX_LOOP_COUNT); 267 268 /* 269 * This mechanism is used to trace a specified AML method. The method is 270 * traced each time it is executed. 271 */ 272 ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_flags, 0); 273 ACPI_INIT_GLOBAL(const char *, acpi_gbl_trace_method_name, NULL); 274 ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_dbg_level, ACPI_TRACE_LEVEL_DEFAULT); 275 ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_dbg_layer, ACPI_TRACE_LAYER_DEFAULT); 276 277 /* 278 * Runtime configuration of debug output control masks. We want the debug 279 * switches statically initialized so they are already set when the debugger 280 * is entered. 281 */ 282 ACPI_INIT_GLOBAL(u32, acpi_dbg_level, ACPI_DEBUG_DEFAULT); 283 ACPI_INIT_GLOBAL(u32, acpi_dbg_layer, 0); 284 285 /* Optionally enable timer output with Debug Object output */ 286 287 ACPI_INIT_GLOBAL(u8, acpi_gbl_display_debug_timer, FALSE); 288 289 /* 290 * Debugger command handshake globals. Host OSes need to access these 291 * variables to implement their own command handshake mechanism. 292 */ 293 #ifdef ACPI_DEBUGGER 294 ACPI_INIT_GLOBAL(u8, acpi_gbl_method_executing, FALSE); 295 ACPI_GLOBAL(char, acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE]); 296 #endif 297 298 /* 299 * Other miscellaneous globals 300 */ 301 ACPI_GLOBAL(struct acpi_table_fadt, acpi_gbl_FADT); 302 ACPI_GLOBAL(u32, acpi_current_gpe_count); 303 ACPI_GLOBAL(u8, acpi_gbl_system_awake_and_running); 304 305 /***************************************************************************** 306 * 307 * ACPICA public interface configuration. 308 * 309 * Interfaces that are configured out of the ACPICA build are replaced 310 * by inlined stubs by default. 311 * 312 ****************************************************************************/ 313 314 /* 315 * Hardware-reduced prototypes (default: Not hardware reduced). 316 * 317 * All ACPICA hardware-related interfaces that use these macros will be 318 * configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag 319 * is set to TRUE. 320 * 321 * Note: This static build option for reduced hardware is intended to 322 * reduce ACPICA code size if desired or necessary. However, even if this 323 * option is not specified, the runtime behavior of ACPICA is dependent 324 * on the actual FADT reduced hardware flag (HW_REDUCED_ACPI). If set, 325 * the flag will enable similar behavior -- ACPICA will not attempt 326 * to access any ACPI-relate hardware (SCI, GPEs, Fixed Events, etc.) 327 */ 328 #if (!ACPI_REDUCED_HARDWARE) 329 #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \ 330 ACPI_EXTERNAL_RETURN_STATUS(prototype) 331 332 #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \ 333 ACPI_EXTERNAL_RETURN_OK(prototype) 334 335 #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \ 336 ACPI_EXTERNAL_RETURN_VOID(prototype) 337 338 #else 339 #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \ 340 static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);} 341 342 #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \ 343 static ACPI_INLINE prototype {return(AE_OK);} 344 345 #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \ 346 static ACPI_INLINE prototype {return;} 347 348 #endif /* !ACPI_REDUCED_HARDWARE */ 349 350 /* 351 * Error message prototypes (default: error messages enabled). 352 * 353 * All interfaces related to error and warning messages 354 * will be configured out of the ACPICA build if the 355 * ACPI_NO_ERROR_MESSAGE flag is defined. 356 */ 357 #ifndef ACPI_NO_ERROR_MESSAGES 358 #define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \ 359 prototype; 360 361 #else 362 #define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \ 363 static ACPI_INLINE prototype {return;} 364 365 #endif /* ACPI_NO_ERROR_MESSAGES */ 366 367 /* 368 * Debugging output prototypes (default: no debug output). 369 * 370 * All interfaces related to debug output messages 371 * will be configured out of the ACPICA build unless the 372 * ACPI_DEBUG_OUTPUT flag is defined. 373 */ 374 #ifdef ACPI_DEBUG_OUTPUT 375 #define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \ 376 prototype; 377 378 #else 379 #define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \ 380 static ACPI_INLINE prototype {return;} 381 382 #endif /* ACPI_DEBUG_OUTPUT */ 383 384 /* 385 * Application prototypes 386 * 387 * All interfaces used by application will be configured 388 * out of the ACPICA build unless the ACPI_APPLICATION 389 * flag is defined. 390 */ 391 #ifdef ACPI_APPLICATION 392 #define ACPI_APP_DEPENDENT_RETURN_VOID(prototype) \ 393 prototype; 394 395 #else 396 #define ACPI_APP_DEPENDENT_RETURN_VOID(prototype) \ 397 static ACPI_INLINE prototype {return;} 398 399 #endif /* ACPI_APPLICATION */ 400 401 /* 402 * Debugger prototypes 403 * 404 * All interfaces used by debugger will be configured 405 * out of the ACPICA build unless the ACPI_DEBUGGER 406 * flag is defined. 407 */ 408 #ifdef ACPI_DEBUGGER 409 #define ACPI_DBR_DEPENDENT_RETURN_OK(prototype) \ 410 ACPI_EXTERNAL_RETURN_OK(prototype) 411 412 #define ACPI_DBR_DEPENDENT_RETURN_VOID(prototype) \ 413 ACPI_EXTERNAL_RETURN_VOID(prototype) 414 415 #else 416 #define ACPI_DBR_DEPENDENT_RETURN_OK(prototype) \ 417 static ACPI_INLINE prototype {return(AE_OK);} 418 419 #define ACPI_DBR_DEPENDENT_RETURN_VOID(prototype) \ 420 static ACPI_INLINE prototype {return;} 421 422 #endif /* ACPI_DEBUGGER */ 423 424 /***************************************************************************** 425 * 426 * ACPICA public interface prototypes 427 * 428 ****************************************************************************/ 429 430 /* 431 * Initialization 432 */ 433 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION 434 acpi_initialize_tables(struct acpi_table_desc 435 *initial_storage, 436 u32 initial_table_count, 437 u8 allow_resize)) 438 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION 439 acpi_initialize_subsystem(void)) 440 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION 441 acpi_enable_subsystem(u32 flags)) 442 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION 443 acpi_initialize_objects(u32 flags)) 444 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION 445 acpi_terminate(void)) 446 447 /* 448 * Miscellaneous global interfaces 449 */ 450 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void)) 451 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void)) 452 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_subsystem_status(void)) 453 454 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 455 acpi_get_system_info(struct acpi_buffer 456 *ret_buffer)) 457 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 458 acpi_get_statistics(struct acpi_statistics *stats)) 459 ACPI_EXTERNAL_RETURN_PTR(const char 460 *acpi_format_exception(acpi_status exception)) 461 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_purge_cached_objects(void)) 462 463 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 464 acpi_install_interface(acpi_string interface_name)) 465 466 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 467 acpi_remove_interface(acpi_string interface_name)) 468 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_update_interfaces(u8 action)) 469 470 ACPI_EXTERNAL_RETURN_UINT32(u32 471 acpi_check_address_range(acpi_adr_space_type 472 space_id, 473 acpi_physical_address 474 address, acpi_size length, 475 u8 warn)) 476 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 477 acpi_decode_pld_buffer(u8 *in_buffer, 478 acpi_size length, 479 struct acpi_pld_info 480 **return_buffer)) 481 482 /* 483 * ACPI table load/unload interfaces 484 */ 485 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION 486 acpi_install_table(acpi_physical_address address, 487 u8 physical)) 488 489 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 490 acpi_load_table(struct acpi_table_header *table)) 491 492 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 493 acpi_unload_parent_table(acpi_handle object)) 494 495 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION 496 acpi_load_tables(void)) 497 498 /* 499 * ACPI table manipulation interfaces 500 */ 501 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION 502 acpi_reallocate_root_table(void)) 503 504 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION 505 acpi_find_root_pointer(acpi_physical_address 506 *rsdp_address)) 507 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 508 acpi_get_table_header(acpi_string signature, 509 u32 instance, 510 struct acpi_table_header 511 *out_table_header)) 512 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 513 acpi_get_table(acpi_string signature, u32 instance, 514 struct acpi_table_header 515 **out_table)) 516 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 517 acpi_get_table_by_index(u32 table_index, 518 struct acpi_table_header 519 **out_table)) 520 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 521 acpi_install_table_handler(acpi_table_handler 522 handler, void *context)) 523 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 524 acpi_remove_table_handler(acpi_table_handler 525 handler)) 526 527 /* 528 * Namespace and name interfaces 529 */ 530 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 531 acpi_walk_namespace(acpi_object_type type, 532 acpi_handle start_object, 533 u32 max_depth, 534 acpi_walk_callback 535 descending_callback, 536 acpi_walk_callback 537 ascending_callback, 538 void *context, 539 void **return_value)) 540 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 541 acpi_get_devices(const char *HID, 542 acpi_walk_callback user_function, 543 void *context, 544 void **return_value)) 545 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 546 acpi_get_name(acpi_handle object, u32 name_type, 547 struct acpi_buffer *ret_path_ptr)) 548 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 549 acpi_get_handle(acpi_handle parent, 550 acpi_string pathname, 551 acpi_handle *ret_handle)) 552 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 553 acpi_attach_data(acpi_handle object, 554 acpi_object_handler handler, 555 void *data)) 556 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 557 acpi_detach_data(acpi_handle object, 558 acpi_object_handler handler)) 559 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 560 acpi_get_data(acpi_handle object, 561 acpi_object_handler handler, 562 void **data)) 563 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 564 acpi_debug_trace(const char *name, u32 debug_level, 565 u32 debug_layer, u32 flags)) 566 567 /* 568 * Object manipulation and enumeration 569 */ 570 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 571 acpi_evaluate_object(acpi_handle object, 572 acpi_string pathname, 573 struct acpi_object_list 574 *parameter_objects, 575 struct acpi_buffer 576 *return_object_buffer)) 577 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 578 acpi_evaluate_object_typed(acpi_handle object, 579 acpi_string pathname, 580 struct acpi_object_list 581 *external_params, 582 struct acpi_buffer 583 *return_buffer, 584 acpi_object_type 585 return_type)) 586 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 587 acpi_get_object_info(acpi_handle object, 588 struct acpi_device_info 589 **return_buffer)) 590 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_install_method(u8 *buffer)) 591 592 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 593 acpi_get_next_object(acpi_object_type type, 594 acpi_handle parent, 595 acpi_handle child, 596 acpi_handle *out_handle)) 597 598 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 599 acpi_get_type(acpi_handle object, 600 acpi_object_type *out_type)) 601 602 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 603 acpi_get_parent(acpi_handle object, 604 acpi_handle *out_handle)) 605 606 /* 607 * Handler interfaces 608 */ 609 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 610 acpi_install_initialization_handler 611 (acpi_init_handler handler, u32 function)) 612 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 613 acpi_install_sci_handler(acpi_sci_handler 614 address, 615 void *context)) 616 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 617 acpi_remove_sci_handler(acpi_sci_handler 618 address)) 619 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 620 acpi_install_global_event_handler 621 (acpi_gbl_event_handler handler, 622 void *context)) 623 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 624 acpi_install_fixed_event_handler(u32 625 acpi_event, 626 acpi_event_handler 627 handler, 628 void 629 *context)) 630 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 631 acpi_remove_fixed_event_handler(u32 acpi_event, 632 acpi_event_handler 633 handler)) 634 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 635 acpi_install_gpe_handler(acpi_handle 636 gpe_device, 637 u32 gpe_number, 638 u32 type, 639 acpi_gpe_handler 640 address, 641 void *context)) 642 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 643 acpi_install_gpe_raw_handler(acpi_handle 644 gpe_device, 645 u32 gpe_number, 646 u32 type, 647 acpi_gpe_handler 648 address, 649 void *context)) 650 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 651 acpi_remove_gpe_handler(acpi_handle gpe_device, 652 u32 gpe_number, 653 acpi_gpe_handler 654 address)) 655 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 656 acpi_install_notify_handler(acpi_handle device, 657 u32 handler_type, 658 acpi_notify_handler 659 handler, 660 void *context)) 661 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 662 acpi_remove_notify_handler(acpi_handle device, 663 u32 handler_type, 664 acpi_notify_handler 665 handler)) 666 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 667 acpi_install_address_space_handler(acpi_handle 668 device, 669 acpi_adr_space_type 670 space_id, 671 acpi_adr_space_handler 672 handler, 673 acpi_adr_space_setup 674 setup, 675 void *context)) 676 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 677 acpi_remove_address_space_handler(acpi_handle 678 device, 679 acpi_adr_space_type 680 space_id, 681 acpi_adr_space_handler 682 handler)) 683 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 684 acpi_install_exception_handler 685 (acpi_exception_handler handler)) 686 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 687 acpi_install_interface_handler 688 (acpi_interface_handler handler)) 689 690 /* 691 * Global Lock interfaces 692 */ 693 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 694 acpi_acquire_global_lock(u16 timeout, 695 u32 *handle)) 696 697 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 698 acpi_release_global_lock(u32 handle)) 699 700 /* 701 * Interfaces to AML mutex objects 702 */ 703 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 704 acpi_acquire_mutex(acpi_handle handle, 705 acpi_string pathname, 706 u16 timeout)) 707 708 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 709 acpi_release_mutex(acpi_handle handle, 710 acpi_string pathname)) 711 712 /* 713 * Fixed Event interfaces 714 */ 715 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 716 acpi_enable_event(u32 event, u32 flags)) 717 718 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 719 acpi_disable_event(u32 event, u32 flags)) 720 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event)) 721 722 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 723 acpi_get_event_status(u32 event, 724 acpi_event_status 725 *event_status)) 726 727 /* 728 * General Purpose Event (GPE) Interfaces 729 */ 730 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_update_all_gpes(void)) 731 732 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 733 acpi_enable_gpe(acpi_handle gpe_device, 734 u32 gpe_number)) 735 736 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 737 acpi_disable_gpe(acpi_handle gpe_device, 738 u32 gpe_number)) 739 740 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 741 acpi_clear_gpe(acpi_handle gpe_device, 742 u32 gpe_number)) 743 744 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 745 acpi_set_gpe(acpi_handle gpe_device, 746 u32 gpe_number, u8 action)) 747 748 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 749 acpi_finish_gpe(acpi_handle gpe_device, 750 u32 gpe_number)) 751 752 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 753 acpi_mask_gpe(acpi_handle gpe_device, 754 u32 gpe_number, u8 is_masked)) 755 756 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 757 acpi_mark_gpe_for_wake(acpi_handle gpe_device, 758 u32 gpe_number)) 759 760 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 761 acpi_setup_gpe_for_wake(acpi_handle 762 parent_device, 763 acpi_handle gpe_device, 764 u32 gpe_number)) 765 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 766 acpi_set_gpe_wake_mask(acpi_handle gpe_device, 767 u32 gpe_number, 768 u8 action)) 769 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 770 acpi_get_gpe_status(acpi_handle gpe_device, 771 u32 gpe_number, 772 acpi_event_status 773 *event_status)) 774 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void)) 775 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void)) 776 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_wakeup_gpes(void)) 777 778 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 779 acpi_get_gpe_device(u32 gpe_index, 780 acpi_handle *gpe_device)) 781 782 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 783 acpi_install_gpe_block(acpi_handle gpe_device, 784 struct 785 acpi_generic_address 786 *gpe_block_address, 787 u32 register_count, 788 u32 interrupt_number)) 789 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 790 acpi_remove_gpe_block(acpi_handle gpe_device)) 791 792 /* 793 * Resource interfaces 794 */ 795 typedef 796 acpi_status (*acpi_walk_resource_callback) (struct acpi_resource * resource, 797 void *context); 798 799 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 800 acpi_get_vendor_resource(acpi_handle device, 801 char *name, 802 struct acpi_vendor_uuid 803 *uuid, 804 struct acpi_buffer 805 *ret_buffer)) 806 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 807 acpi_get_current_resources(acpi_handle device, 808 struct acpi_buffer 809 *ret_buffer)) 810 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 811 acpi_get_possible_resources(acpi_handle device, 812 struct acpi_buffer 813 *ret_buffer)) 814 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 815 acpi_get_event_resources(acpi_handle device_handle, 816 struct acpi_buffer 817 *ret_buffer)) 818 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 819 acpi_walk_resource_buffer(struct acpi_buffer 820 *buffer, 821 acpi_walk_resource_callback 822 user_function, 823 void *context)) 824 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 825 acpi_walk_resources(acpi_handle device, char *name, 826 acpi_walk_resource_callback 827 user_function, void *context)) 828 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 829 acpi_set_current_resources(acpi_handle device, 830 struct acpi_buffer 831 *in_buffer)) 832 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 833 acpi_get_irq_routing_table(acpi_handle device, 834 struct acpi_buffer 835 *ret_buffer)) 836 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 837 acpi_resource_to_address64(struct acpi_resource 838 *resource, 839 struct 840 acpi_resource_address64 841 *out)) 842 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 843 acpi_buffer_to_resource(u8 *aml_buffer, 844 u16 aml_buffer_length, 845 struct acpi_resource 846 **resource_ptr)) 847 848 /* 849 * Hardware (ACPI device) interfaces 850 */ 851 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_reset(void)) 852 853 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 854 acpi_read(u64 *value, 855 struct acpi_generic_address *reg)) 856 857 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 858 acpi_write(u64 value, 859 struct acpi_generic_address *reg)) 860 861 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 862 acpi_read_bit_register(u32 register_id, 863 u32 *return_value)) 864 865 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 866 acpi_write_bit_register(u32 register_id, 867 u32 value)) 868 869 /* 870 * Sleep/Wake interfaces 871 */ 872 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 873 acpi_get_sleep_type_data(u8 sleep_state, 874 u8 *slp_typ_a, 875 u8 *slp_typ_b)) 876 877 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 878 acpi_enter_sleep_state_prep(u8 sleep_state)) 879 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_enter_sleep_state(u8 sleep_state)) 880 881 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enter_sleep_state_s4bios(void)) 882 883 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 884 acpi_leave_sleep_state_prep(u8 sleep_state)) 885 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_leave_sleep_state(u8 sleep_state)) 886 887 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 888 acpi_set_firmware_waking_vector 889 (acpi_physical_address physical_address, 890 acpi_physical_address physical_address64)) 891 /* 892 * ACPI Timer interfaces 893 */ 894 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 895 acpi_get_timer_resolution(u32 *resolution)) 896 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks)) 897 898 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 899 acpi_get_timer_duration(u32 start_ticks, 900 u32 end_ticks, 901 u32 *time_elapsed)) 902 903 /* 904 * Error/Warning output 905 */ 906 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) 907 void ACPI_INTERNAL_VAR_XFACE 908 acpi_error(const char *module_name, 909 u32 line_number, 910 const char *format, ...)) 911 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4) 912 void ACPI_INTERNAL_VAR_XFACE 913 acpi_exception(const char *module_name, 914 u32 line_number, 915 acpi_status status, 916 const char *format, ...)) 917 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) 918 void ACPI_INTERNAL_VAR_XFACE 919 acpi_warning(const char *module_name, 920 u32 line_number, 921 const char *format, ...)) 922 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1) 923 void ACPI_INTERNAL_VAR_XFACE 924 acpi_info(const char *format, ...)) 925 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) 926 void ACPI_INTERNAL_VAR_XFACE 927 acpi_bios_error(const char *module_name, 928 u32 line_number, 929 const char *format, ...)) 930 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3) 931 void ACPI_INTERNAL_VAR_XFACE 932 acpi_bios_warning(const char *module_name, 933 u32 line_number, 934 const char *format, ...)) 935 936 /* 937 * Debug output 938 */ 939 ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6) 940 void ACPI_INTERNAL_VAR_XFACE 941 acpi_debug_print(u32 requested_debug_level, 942 u32 line_number, 943 const char *function_name, 944 const char *module_name, 945 u32 component_id, 946 const char *format, ...)) 947 ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6) 948 void ACPI_INTERNAL_VAR_XFACE 949 acpi_debug_print_raw(u32 requested_debug_level, 950 u32 line_number, 951 const char *function_name, 952 const char *module_name, 953 u32 component_id, 954 const char *format, ...)) 955 956 ACPI_DBG_DEPENDENT_RETURN_VOID(void 957 acpi_trace_point(acpi_trace_event_type type, 958 u8 begin, 959 u8 *aml, char *pathname)) 960 961 acpi_status acpi_initialize_debugger(void); 962 963 void acpi_terminate_debugger(void); 964 965 /* 966 * Divergences 967 */ 968 ACPI_GLOBAL(u8, acpi_gbl_permanent_mmap); 969 970 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 971 acpi_get_table_with_size(acpi_string signature, 972 u32 instance, 973 struct acpi_table_header 974 **out_table, 975 acpi_size *tbl_size)) 976 977 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 978 acpi_get_data_full(acpi_handle object, 979 acpi_object_handler handler, 980 void **data, 981 void (*callback)(void *))) 982 983 void acpi_run_debugger(char *batch_buffer); 984 985 void acpi_set_debugger_thread_id(acpi_thread_id thread_id); 986 987 #endif /* __ACXFACE_H__ */ 988