Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
0002 /******************************************************************************
0003  *
0004  * Name: acpixf.h - External interfaces to the ACPI subsystem
0005  *
0006  * Copyright (C) 2000 - 2022, Intel Corp.
0007  *
0008  *****************************************************************************/
0009 
0010 #ifndef __ACXFACE_H__
0011 #define __ACXFACE_H__
0012 
0013 /* Current ACPICA subsystem version in YYYYMMDD format */
0014 
0015 #define ACPI_CA_VERSION                 0x20220331
0016 
0017 #include <acpi/acconfig.h>
0018 #include <acpi/actypes.h>
0019 #include <acpi/actbl.h>
0020 #include <acpi/acbuffer.h>
0021 
0022 /*****************************************************************************
0023  *
0024  * Macros used for ACPICA globals and configuration
0025  *
0026  ****************************************************************************/
0027 
0028 /*
0029  * Ensure that global variables are defined and initialized only once.
0030  *
0031  * The use of these macros allows for a single list of globals (here)
0032  * in order to simplify maintenance of the code.
0033  */
0034 #ifdef DEFINE_ACPI_GLOBALS
0035 #define ACPI_GLOBAL(type,name) \
0036     extern type name; \
0037     type name
0038 
0039 #define ACPI_INIT_GLOBAL(type,name,value) \
0040     type name=value
0041 
0042 #else
0043 #ifndef ACPI_GLOBAL
0044 #define ACPI_GLOBAL(type,name) \
0045     extern type name
0046 #endif
0047 
0048 #ifndef ACPI_INIT_GLOBAL
0049 #define ACPI_INIT_GLOBAL(type,name,value) \
0050     extern type name
0051 #endif
0052 #endif
0053 
0054 /*
0055  * These macros configure the various ACPICA interfaces. They are
0056  * useful for generating stub inline functions for features that are
0057  * configured out of the current kernel or ACPICA application.
0058  */
0059 #ifndef ACPI_EXTERNAL_RETURN_STATUS
0060 #define ACPI_EXTERNAL_RETURN_STATUS(prototype) \
0061     prototype;
0062 #endif
0063 
0064 #ifndef ACPI_EXTERNAL_RETURN_OK
0065 #define ACPI_EXTERNAL_RETURN_OK(prototype) \
0066     prototype;
0067 #endif
0068 
0069 #ifndef ACPI_EXTERNAL_RETURN_VOID
0070 #define ACPI_EXTERNAL_RETURN_VOID(prototype) \
0071     prototype;
0072 #endif
0073 
0074 #ifndef ACPI_EXTERNAL_RETURN_UINT32
0075 #define ACPI_EXTERNAL_RETURN_UINT32(prototype) \
0076     prototype;
0077 #endif
0078 
0079 #ifndef ACPI_EXTERNAL_RETURN_PTR
0080 #define ACPI_EXTERNAL_RETURN_PTR(prototype) \
0081     prototype;
0082 #endif
0083 
0084 /*****************************************************************************
0085  *
0086  * Public globals and runtime configuration options
0087  *
0088  ****************************************************************************/
0089 
0090 /*
0091  * Enable "slack mode" of the AML interpreter?  Default is FALSE, and the
0092  * interpreter strictly follows the ACPI specification. Setting to TRUE
0093  * allows the interpreter to ignore certain errors and/or bad AML constructs.
0094  *
0095  * Currently, these features are enabled by this flag:
0096  *
0097  * 1) Allow "implicit return" of last value in a control method
0098  * 2) Allow access beyond the end of an operation region
0099  * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
0100  * 4) Allow ANY object type to be a source operand for the Store() operator
0101  * 5) Allow unresolved references (invalid target name) in package objects
0102  * 6) Enable warning messages for behavior that is not ACPI spec compliant
0103  */
0104 ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_interpreter_slack, FALSE);
0105 
0106 /*
0107  * Automatically serialize all methods that create named objects? Default
0108  * is TRUE, meaning that all non_serialized methods are scanned once at
0109  * table load time to determine those that create named objects. Methods
0110  * that create named objects are marked Serialized in order to prevent
0111  * possible run-time problems if they are entered by more than one thread.
0112  */
0113 ACPI_INIT_GLOBAL(u8, acpi_gbl_auto_serialize_methods, TRUE);
0114 
0115 /*
0116  * Create the predefined _OSI method in the namespace? Default is TRUE
0117  * because ACPICA is fully compatible with other ACPI implementations.
0118  * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior.
0119  */
0120 ACPI_INIT_GLOBAL(u8, acpi_gbl_create_osi_method, TRUE);
0121 
0122 /*
0123  * Optionally use default values for the ACPI register widths. Set this to
0124  * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
0125  */
0126 ACPI_INIT_GLOBAL(u8, acpi_gbl_use_default_register_widths, TRUE);
0127 
0128 /*
0129  * Whether or not to validate (map) an entire table to verify
0130  * checksum/duplication in early stage before install. Set this to TRUE to
0131  * allow early table validation before install it to the table manager.
0132  * Note that enabling this option causes errors to happen in some OSPMs
0133  * during early initialization stages. Default behavior is to allow such
0134  * validation.
0135  */
0136 ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_table_validation, TRUE);
0137 
0138 /*
0139  * Optionally enable output from the AML Debug Object.
0140  */
0141 ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_aml_debug_object, FALSE);
0142 
0143 /*
0144  * Optionally copy the entire DSDT to local memory (instead of simply
0145  * mapping it.) There are some BIOSs that corrupt or replace the original
0146  * DSDT, creating the need for this option. Default is FALSE, do not copy
0147  * the DSDT.
0148  */
0149 ACPI_INIT_GLOBAL(u8, acpi_gbl_copy_dsdt_locally, FALSE);
0150 
0151 /*
0152  * Optionally ignore an XSDT if present and use the RSDT instead.
0153  * Although the ACPI specification requires that an XSDT be used instead
0154  * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
0155  * some machines. Default behavior is to use the XSDT if present.
0156  */
0157 ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE);
0158 
0159 /*
0160  * Optionally use 32-bit FADT addresses if and when there is a conflict
0161  * (address mismatch) between the 32-bit and 64-bit versions of the
0162  * address. Although ACPICA adheres to the ACPI specification which
0163  * requires the use of the corresponding 64-bit address if it is non-zero,
0164  * some machines have been found to have a corrupted non-zero 64-bit
0165  * address. Default is FALSE, do not favor the 32-bit addresses.
0166  */
0167 ACPI_INIT_GLOBAL(u8, acpi_gbl_use32_bit_fadt_addresses, FALSE);
0168 
0169 /*
0170  * Optionally use 32-bit FACS table addresses.
0171  * It is reported that some platforms fail to resume from system suspending
0172  * if 64-bit FACS table address is selected:
0173  * https://bugzilla.kernel.org/show_bug.cgi?id=74021
0174  * Default is TRUE, favor the 32-bit addresses.
0175  */
0176 ACPI_INIT_GLOBAL(u8, acpi_gbl_use32_bit_facs_addresses, TRUE);
0177 
0178 /*
0179  * Optionally truncate I/O addresses to 16 bits. Provides compatibility
0180  * with other ACPI implementations. NOTE: During ACPICA initialization,
0181  * this value is set to TRUE if any Windows OSI strings have been
0182  * requested by the BIOS.
0183  */
0184 ACPI_INIT_GLOBAL(u8, acpi_gbl_truncate_io_addresses, FALSE);
0185 
0186 /*
0187  * Disable runtime checking and repair of values returned by control methods.
0188  * Use only if the repair is causing a problem on a particular machine.
0189  */
0190 ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_auto_repair, FALSE);
0191 
0192 /*
0193  * Optionally do not install any SSDTs from the RSDT/XSDT during initialization.
0194  * This can be useful for debugging ACPI problems on some machines.
0195  */
0196 ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_ssdt_table_install, FALSE);
0197 
0198 /*
0199  * Optionally enable runtime namespace override.
0200  */
0201 ACPI_INIT_GLOBAL(u8, acpi_gbl_runtime_namespace_override, TRUE);
0202 
0203 /*
0204  * We keep track of the latest version of Windows that has been requested by
0205  * the BIOS. ACPI 5.0.
0206  */
0207 ACPI_INIT_GLOBAL(u8, acpi_gbl_osi_data, 0);
0208 
0209 /*
0210  * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
0211  * that the ACPI hardware is no longer required. A flag in the FADT indicates
0212  * a reduced HW machine, and that flag is duplicated here for convenience.
0213  */
0214 ACPI_INIT_GLOBAL(u8, acpi_gbl_reduced_hardware, FALSE);
0215 
0216 /*
0217  * Maximum timeout for While() loop iterations before forced method abort.
0218  * This mechanism is intended to prevent infinite loops during interpreter
0219  * execution within a host kernel.
0220  */
0221 ACPI_INIT_GLOBAL(u32, acpi_gbl_max_loop_iterations, ACPI_MAX_LOOP_TIMEOUT);
0222 
0223 /*
0224  * Optionally ignore AE_NOT_FOUND errors from named reference package elements
0225  * during DSDT/SSDT table loading. This reduces error "noise" in platforms
0226  * whose firmware is carrying around a bunch of unused package objects that
0227  * refer to non-existent named objects. However, If the AML actually tries to
0228  * use such a package, the unresolved element(s) will be replaced with NULL
0229  * elements.
0230  */
0231 ACPI_INIT_GLOBAL(u8, acpi_gbl_ignore_package_resolution_errors, FALSE);
0232 
0233 /*
0234  * This mechanism is used to trace a specified AML method. The method is
0235  * traced each time it is executed.
0236  */
0237 ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_flags, 0);
0238 ACPI_INIT_GLOBAL(const char *, acpi_gbl_trace_method_name, NULL);
0239 ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_dbg_level, ACPI_TRACE_LEVEL_DEFAULT);
0240 ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_dbg_layer, ACPI_TRACE_LAYER_DEFAULT);
0241 
0242 /*
0243  * Runtime configuration of debug output control masks. We want the debug
0244  * switches statically initialized so they are already set when the debugger
0245  * is entered.
0246  */
0247 ACPI_INIT_GLOBAL(u32, acpi_dbg_level, ACPI_DEBUG_DEFAULT);
0248 ACPI_INIT_GLOBAL(u32, acpi_dbg_layer, 0);
0249 
0250 /* Optionally enable timer output with Debug Object output */
0251 
0252 ACPI_INIT_GLOBAL(u8, acpi_gbl_display_debug_timer, FALSE);
0253 
0254 /*
0255  * Debugger command handshake globals. Host OSes need to access these
0256  * variables to implement their own command handshake mechanism.
0257  */
0258 #ifdef ACPI_DEBUGGER
0259 ACPI_INIT_GLOBAL(u8, acpi_gbl_method_executing, FALSE);
0260 ACPI_GLOBAL(char, acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE]);
0261 #endif
0262 
0263 /*
0264  * Other miscellaneous globals
0265  */
0266 ACPI_GLOBAL(struct acpi_table_fadt, acpi_gbl_FADT);
0267 ACPI_GLOBAL(u32, acpi_current_gpe_count);
0268 ACPI_GLOBAL(u8, acpi_gbl_system_awake_and_running);
0269 
0270 /*****************************************************************************
0271  *
0272  * ACPICA public interface configuration.
0273  *
0274  * Interfaces that are configured out of the ACPICA build are replaced
0275  * by inlined stubs by default.
0276  *
0277  ****************************************************************************/
0278 
0279 /*
0280  * Hardware-reduced prototypes (default: Not hardware reduced).
0281  *
0282  * All ACPICA hardware-related interfaces that use these macros will be
0283  * configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
0284  * is set to TRUE.
0285  *
0286  * Note: This static build option for reduced hardware is intended to
0287  * reduce ACPICA code size if desired or necessary. However, even if this
0288  * option is not specified, the runtime behavior of ACPICA is dependent
0289  * on the actual FADT reduced hardware flag (HW_REDUCED_ACPI). If set,
0290  * the flag will enable similar behavior -- ACPICA will not attempt
0291  * to access any ACPI-relate hardware (SCI, GPEs, Fixed Events, etc.)
0292  */
0293 #if (!ACPI_REDUCED_HARDWARE)
0294 #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
0295     ACPI_EXTERNAL_RETURN_STATUS(prototype)
0296 
0297 #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \
0298     ACPI_EXTERNAL_RETURN_OK(prototype)
0299 
0300 #define ACPI_HW_DEPENDENT_RETURN_UINT32(prototype) \
0301     ACPI_EXTERNAL_RETURN_UINT32(prototype)
0302 
0303 #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
0304     ACPI_EXTERNAL_RETURN_VOID(prototype)
0305 
0306 #else
0307 #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
0308     static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);}
0309 
0310 #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \
0311     static ACPI_INLINE prototype {return(AE_OK);}
0312 
0313 #define ACPI_HW_DEPENDENT_RETURN_UINT32(prototype) \
0314     static ACPI_INLINE prototype {return(0);}
0315 
0316 #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
0317     static ACPI_INLINE prototype {return;}
0318 
0319 #endif              /* !ACPI_REDUCED_HARDWARE */
0320 
0321 /*
0322  * Error message prototypes (default: error messages enabled).
0323  *
0324  * All interfaces related to error and warning messages
0325  * will be configured out of the ACPICA build if the
0326  * ACPI_NO_ERROR_MESSAGE flag is defined.
0327  */
0328 #ifndef ACPI_NO_ERROR_MESSAGES
0329 #define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \
0330     prototype;
0331 
0332 #else
0333 #define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \
0334     static ACPI_INLINE prototype {return;}
0335 
0336 #endif              /* ACPI_NO_ERROR_MESSAGES */
0337 
0338 /*
0339  * Debugging output prototypes (default: no debug output).
0340  *
0341  * All interfaces related to debug output messages
0342  * will be configured out of the ACPICA build unless the
0343  * ACPI_DEBUG_OUTPUT flag is defined.
0344  */
0345 #ifdef ACPI_DEBUG_OUTPUT
0346 #define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \
0347     prototype;
0348 
0349 #else
0350 #define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \
0351     static ACPI_INLINE prototype {return;}
0352 
0353 #endif              /* ACPI_DEBUG_OUTPUT */
0354 
0355 /*
0356  * Application prototypes
0357  *
0358  * All interfaces used by application will be configured
0359  * out of the ACPICA build unless the ACPI_APPLICATION
0360  * flag is defined.
0361  */
0362 #ifdef ACPI_APPLICATION
0363 #define ACPI_APP_DEPENDENT_RETURN_VOID(prototype) \
0364     prototype;
0365 
0366 #else
0367 #define ACPI_APP_DEPENDENT_RETURN_VOID(prototype) \
0368     static ACPI_INLINE prototype {return;}
0369 
0370 #endif              /* ACPI_APPLICATION */
0371 
0372 /*
0373  * Debugger prototypes
0374  *
0375  * All interfaces used by debugger will be configured
0376  * out of the ACPICA build unless the ACPI_DEBUGGER
0377  * flag is defined.
0378  */
0379 #ifdef ACPI_DEBUGGER
0380 #define ACPI_DBR_DEPENDENT_RETURN_OK(prototype) \
0381     ACPI_EXTERNAL_RETURN_OK(prototype)
0382 
0383 #define ACPI_DBR_DEPENDENT_RETURN_VOID(prototype) \
0384     ACPI_EXTERNAL_RETURN_VOID(prototype)
0385 
0386 #else
0387 #define ACPI_DBR_DEPENDENT_RETURN_OK(prototype) \
0388     static ACPI_INLINE prototype {return(AE_OK);}
0389 
0390 #define ACPI_DBR_DEPENDENT_RETURN_VOID(prototype) \
0391     static ACPI_INLINE prototype {return;}
0392 
0393 #endif              /* ACPI_DEBUGGER */
0394 
0395 /*****************************************************************************
0396  *
0397  * ACPICA public interface prototypes
0398  *
0399  ****************************************************************************/
0400 
0401 /*
0402  * Initialization
0403  */
0404 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
0405                 acpi_initialize_tables(struct acpi_table_desc
0406                            *initial_storage,
0407                            u32 initial_table_count,
0408                            u8 allow_resize))
0409 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
0410                  acpi_initialize_subsystem(void))
0411 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
0412                  acpi_enable_subsystem(u32 flags))
0413 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
0414                  acpi_initialize_objects(u32 flags))
0415 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
0416                  acpi_terminate(void))
0417 
0418 /*
0419  * Miscellaneous global interfaces
0420  */
0421 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
0422 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
0423 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_subsystem_status(void))
0424 
0425 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0426                 acpi_get_system_info(struct acpi_buffer
0427                          *ret_buffer))
0428 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0429                  acpi_get_statistics(struct acpi_statistics *stats))
0430 ACPI_EXTERNAL_RETURN_PTR(const char
0431               *acpi_format_exception(acpi_status exception))
0432 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_purge_cached_objects(void))
0433 
0434 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0435                 acpi_install_interface(acpi_string interface_name))
0436 
0437 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0438                 acpi_remove_interface(acpi_string interface_name))
0439 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_update_interfaces(u8 action))
0440 
0441 ACPI_EXTERNAL_RETURN_UINT32(u32
0442                 acpi_check_address_range(acpi_adr_space_type
0443                              space_id,
0444                              acpi_physical_address
0445                              address, acpi_size length,
0446                              u8 warn))
0447 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0448                  acpi_decode_pld_buffer(u8 *in_buffer,
0449                             acpi_size length,
0450                             struct acpi_pld_info
0451                             **return_buffer))
0452 
0453 /*
0454  * ACPI table load/unload interfaces
0455  */
0456 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
0457                 acpi_install_table(struct acpi_table_header *table))
0458 
0459 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
0460                 acpi_install_physical_table(acpi_physical_address
0461                             address))
0462 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0463                 acpi_load_table(struct acpi_table_header *table,
0464                         u32 *table_idx))
0465 
0466 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0467                 acpi_unload_table(u32 table_index))
0468 
0469 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0470                 acpi_unload_parent_table(acpi_handle object))
0471 
0472 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
0473                 acpi_load_tables(void))
0474 
0475 /*
0476  * ACPI table manipulation interfaces
0477  */
0478 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
0479                 acpi_reallocate_root_table(void))
0480 
0481 ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_INIT_FUNCTION
0482                 acpi_find_root_pointer(acpi_physical_address
0483                            *rsdp_address))
0484 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0485                  acpi_get_table_header(acpi_string signature,
0486                            u32 instance,
0487                            struct acpi_table_header
0488                            *out_table_header))
0489 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0490                  acpi_get_table(acpi_string signature, u32 instance,
0491                         struct acpi_table_header
0492                         **out_table))
0493 ACPI_EXTERNAL_RETURN_VOID(void acpi_put_table(struct acpi_table_header *table))
0494 
0495 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0496                 acpi_get_table_by_index(u32 table_index,
0497                             struct acpi_table_header
0498                             **out_table))
0499 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0500                  acpi_install_table_handler(acpi_table_handler
0501                             handler, void *context))
0502 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0503                  acpi_remove_table_handler(acpi_table_handler
0504                                handler))
0505 
0506 /*
0507  * Namespace and name interfaces
0508  */
0509 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0510                 acpi_walk_namespace(acpi_object_type type,
0511                         acpi_handle start_object,
0512                         u32 max_depth,
0513                         acpi_walk_callback
0514                         descending_callback,
0515                         acpi_walk_callback
0516                         ascending_callback,
0517                         void *context,
0518                         void **return_value))
0519 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0520                  acpi_get_devices(const char *HID,
0521                           acpi_walk_callback user_function,
0522                           void *context,
0523                           void **return_value))
0524 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0525                  acpi_get_name(acpi_handle object, u32 name_type,
0526                        struct acpi_buffer *ret_path_ptr))
0527 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0528                  acpi_get_handle(acpi_handle parent,
0529                          acpi_string pathname,
0530                          acpi_handle *ret_handle))
0531 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0532                  acpi_attach_data(acpi_handle object,
0533                           acpi_object_handler handler,
0534                           void *data))
0535 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0536                  acpi_detach_data(acpi_handle object,
0537                           acpi_object_handler handler))
0538 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0539                  acpi_get_data(acpi_handle object,
0540                        acpi_object_handler handler,
0541                        void **data))
0542 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0543                  acpi_debug_trace(const char *name, u32 debug_level,
0544                           u32 debug_layer, u32 flags))
0545 
0546 /*
0547  * Object manipulation and enumeration
0548  */
0549 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0550                 acpi_evaluate_object(acpi_handle object,
0551                          acpi_string pathname,
0552                          struct acpi_object_list
0553                          *parameter_objects,
0554                          struct acpi_buffer
0555                          *return_object_buffer))
0556 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0557                  acpi_evaluate_object_typed(acpi_handle object,
0558                             acpi_string pathname,
0559                             struct acpi_object_list
0560                             *external_params,
0561                             struct acpi_buffer
0562                             *return_buffer,
0563                             acpi_object_type
0564                             return_type))
0565 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0566                  acpi_get_object_info(acpi_handle object,
0567                           struct acpi_device_info
0568                           **return_buffer))
0569 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_install_method(u8 *buffer))
0570 
0571 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0572                 acpi_get_next_object(acpi_object_type type,
0573                          acpi_handle parent,
0574                          acpi_handle child,
0575                          acpi_handle *out_handle))
0576 
0577 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0578                 acpi_get_type(acpi_handle object,
0579                       acpi_object_type *out_type))
0580 
0581 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0582                 acpi_get_parent(acpi_handle object,
0583                         acpi_handle *out_handle))
0584 
0585 /*
0586  * Handler interfaces
0587  */
0588 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0589                 acpi_install_initialization_handler
0590                 (acpi_init_handler handler, u32 function))
0591 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0592                  acpi_install_sci_handler(acpi_sci_handler
0593                               address,
0594                               void *context))
0595 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0596                  acpi_remove_sci_handler(acpi_sci_handler
0597                              address))
0598 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0599                  acpi_install_global_event_handler
0600                  (acpi_gbl_event_handler handler,
0601                   void *context))
0602 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0603                  acpi_install_fixed_event_handler(u32
0604                                   acpi_event,
0605                                   acpi_event_handler
0606                                   handler,
0607                                   void
0608                                   *context))
0609 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0610                  acpi_remove_fixed_event_handler(u32 acpi_event,
0611                                  acpi_event_handler
0612                                  handler))
0613 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0614                  acpi_install_gpe_handler(acpi_handle
0615                               gpe_device,
0616                               u32 gpe_number,
0617                               u32 type,
0618                               acpi_gpe_handler
0619                               address,
0620                               void *context))
0621 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0622                  acpi_install_gpe_raw_handler(acpi_handle
0623                                   gpe_device,
0624                                   u32 gpe_number,
0625                                   u32 type,
0626                                   acpi_gpe_handler
0627                                   address,
0628                                   void *context))
0629 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0630                  acpi_remove_gpe_handler(acpi_handle gpe_device,
0631                              u32 gpe_number,
0632                              acpi_gpe_handler
0633                              address))
0634 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0635                  acpi_install_notify_handler(acpi_handle device,
0636                              u32 handler_type,
0637                              acpi_notify_handler
0638                              handler,
0639                              void *context))
0640 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0641                  acpi_remove_notify_handler(acpi_handle device,
0642                             u32 handler_type,
0643                             acpi_notify_handler
0644                             handler))
0645 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0646                  acpi_install_address_space_handler(acpi_handle
0647                                 device,
0648                                 acpi_adr_space_type
0649                                 space_id,
0650                                 acpi_adr_space_handler
0651                                 handler,
0652                                 acpi_adr_space_setup
0653                                 setup,
0654                                 void *context))
0655 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0656                  acpi_remove_address_space_handler(acpi_handle
0657                                    device,
0658                                    acpi_adr_space_type
0659                                    space_id,
0660                                    acpi_adr_space_handler
0661                                    handler))
0662 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0663                  acpi_install_exception_handler
0664                  (acpi_exception_handler handler))
0665 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0666                  acpi_install_interface_handler
0667                  (acpi_interface_handler handler))
0668 
0669 /*
0670  * Global Lock interfaces
0671  */
0672 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0673                 acpi_acquire_global_lock(u16 timeout,
0674                              u32 *handle))
0675 
0676 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0677                 acpi_release_global_lock(u32 handle))
0678 
0679 /*
0680  * Interfaces to AML mutex objects
0681  */
0682 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0683                 acpi_acquire_mutex(acpi_handle handle,
0684                            acpi_string pathname,
0685                            u16 timeout))
0686 
0687 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0688                 acpi_release_mutex(acpi_handle handle,
0689                            acpi_string pathname))
0690 
0691 /*
0692  * Fixed Event interfaces
0693  */
0694 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0695                 acpi_enable_event(u32 event, u32 flags))
0696 
0697 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0698                 acpi_disable_event(u32 event, u32 flags))
0699 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event))
0700 
0701 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0702                 acpi_get_event_status(u32 event,
0703                               acpi_event_status
0704                               *event_status))
0705 
0706 /*
0707  * General Purpose Event (GPE) Interfaces
0708  */
0709 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_update_all_gpes(void))
0710 
0711 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0712                 acpi_enable_gpe(acpi_handle gpe_device,
0713                         u32 gpe_number))
0714 
0715 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0716                 acpi_disable_gpe(acpi_handle gpe_device,
0717                          u32 gpe_number))
0718 
0719 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0720                 acpi_clear_gpe(acpi_handle gpe_device,
0721                            u32 gpe_number))
0722 
0723 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0724                 acpi_set_gpe(acpi_handle gpe_device,
0725                          u32 gpe_number, u8 action))
0726 
0727 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0728                 acpi_finish_gpe(acpi_handle gpe_device,
0729                         u32 gpe_number))
0730 
0731 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0732                 acpi_mask_gpe(acpi_handle gpe_device,
0733                           u32 gpe_number, u8 is_masked))
0734 
0735 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0736                 acpi_mark_gpe_for_wake(acpi_handle gpe_device,
0737                                u32 gpe_number))
0738 
0739 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0740                 acpi_setup_gpe_for_wake(acpi_handle
0741                             parent_device,
0742                             acpi_handle gpe_device,
0743                             u32 gpe_number))
0744 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0745                  acpi_set_gpe_wake_mask(acpi_handle gpe_device,
0746                             u32 gpe_number,
0747                             u8 action))
0748 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0749                  acpi_get_gpe_status(acpi_handle gpe_device,
0750                              u32 gpe_number,
0751                              acpi_event_status
0752                              *event_status))
0753 ACPI_HW_DEPENDENT_RETURN_UINT32(u32 acpi_dispatch_gpe(acpi_handle gpe_device, u32 gpe_number))
0754 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
0755 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void))
0756 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_wakeup_gpes(void))
0757 ACPI_HW_DEPENDENT_RETURN_UINT32(u32 acpi_any_gpe_status_set(u32 gpe_skip_number))
0758 ACPI_HW_DEPENDENT_RETURN_UINT32(u32 acpi_any_fixed_event_status_set(void))
0759 
0760 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0761                 acpi_get_gpe_device(u32 gpe_index,
0762                             acpi_handle *gpe_device))
0763 
0764 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0765                 acpi_install_gpe_block(acpi_handle gpe_device,
0766                                struct
0767                                acpi_generic_address
0768                                *gpe_block_address,
0769                                u32 register_count,
0770                                u32 interrupt_number))
0771 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0772                  acpi_remove_gpe_block(acpi_handle gpe_device))
0773 
0774 /*
0775  * Resource interfaces
0776  */
0777 typedef
0778 acpi_status (*acpi_walk_resource_callback) (struct acpi_resource * resource,
0779                         void *context);
0780 
0781 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0782                 acpi_get_vendor_resource(acpi_handle device,
0783                              char *name,
0784                              struct acpi_vendor_uuid
0785                              *uuid,
0786                              struct acpi_buffer
0787                              *ret_buffer))
0788 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0789                  acpi_get_current_resources(acpi_handle device,
0790                             struct acpi_buffer
0791                             *ret_buffer))
0792 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0793                  acpi_get_possible_resources(acpi_handle device,
0794                              struct acpi_buffer
0795                              *ret_buffer))
0796 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0797                  acpi_get_event_resources(acpi_handle device_handle,
0798                               struct acpi_buffer
0799                               *ret_buffer))
0800 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0801                  acpi_walk_resource_buffer(struct acpi_buffer
0802                                *buffer,
0803                                acpi_walk_resource_callback
0804                                user_function,
0805                                void *context))
0806 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0807                  acpi_walk_resources(acpi_handle device, char *name,
0808                          acpi_walk_resource_callback
0809                          user_function, void *context))
0810 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0811                  acpi_set_current_resources(acpi_handle device,
0812                             struct acpi_buffer
0813                             *in_buffer))
0814 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0815                  acpi_get_irq_routing_table(acpi_handle device,
0816                             struct acpi_buffer
0817                             *ret_buffer))
0818 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0819                  acpi_resource_to_address64(struct acpi_resource
0820                             *resource,
0821                             struct
0822                             acpi_resource_address64
0823                             *out))
0824 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0825                  acpi_buffer_to_resource(u8 *aml_buffer,
0826                              u16 aml_buffer_length,
0827                              struct acpi_resource
0828                              **resource_ptr))
0829 
0830 /*
0831  * Hardware (ACPI device) interfaces
0832  */
0833 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_reset(void))
0834 
0835 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0836                 acpi_read(u64 *value,
0837                       struct acpi_generic_address *reg))
0838 
0839 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0840                 acpi_write(u64 value,
0841                        struct acpi_generic_address *reg))
0842 
0843 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0844                 acpi_read_bit_register(u32 register_id,
0845                                u32 *return_value))
0846 
0847 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0848                 acpi_write_bit_register(u32 register_id,
0849                             u32 value))
0850 
0851 /*
0852  * Sleep/Wake interfaces
0853  */
0854 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0855                 acpi_get_sleep_type_data(u8 sleep_state,
0856                              u8 *slp_typ_a,
0857                              u8 *slp_typ_b))
0858 
0859 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0860                 acpi_enter_sleep_state_prep(u8 sleep_state))
0861 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_enter_sleep_state(u8 sleep_state))
0862 
0863 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enter_sleep_state_s4bios(void))
0864 
0865 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0866                 acpi_leave_sleep_state_prep(u8 sleep_state))
0867 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_leave_sleep_state(u8 sleep_state))
0868 
0869 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0870                 acpi_set_firmware_waking_vector
0871                 (acpi_physical_address physical_address,
0872                  acpi_physical_address physical_address64))
0873 /*
0874  * ACPI Timer interfaces
0875  */
0876 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0877                 acpi_get_timer_resolution(u32 *resolution))
0878 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks))
0879 
0880 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
0881                 acpi_get_timer_duration(u32 start_ticks,
0882                             u32 end_ticks,
0883                             u32 *time_elapsed))
0884 
0885 /*
0886  * Error/Warning output
0887  */
0888 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
0889                    void ACPI_INTERNAL_VAR_XFACE
0890                    acpi_error(const char *module_name,
0891                       u32 line_number,
0892                       const char *format, ...))
0893 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4)
0894                 void ACPI_INTERNAL_VAR_XFACE
0895                 acpi_exception(const char *module_name,
0896                            u32 line_number,
0897                            acpi_status status,
0898                            const char *format, ...))
0899 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
0900                 void ACPI_INTERNAL_VAR_XFACE
0901                 acpi_warning(const char *module_name,
0902                          u32 line_number,
0903                          const char *format, ...))
0904 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1)
0905                 void ACPI_INTERNAL_VAR_XFACE
0906                 acpi_info(const char *format, ...))
0907 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
0908                 void ACPI_INTERNAL_VAR_XFACE
0909                 acpi_bios_error(const char *module_name,
0910                         u32 line_number,
0911                         const char *format, ...))
0912 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4)
0913                 void ACPI_INTERNAL_VAR_XFACE
0914                 acpi_bios_exception(const char *module_name,
0915                             u32 line_number,
0916                             acpi_status status,
0917                             const char *format, ...))
0918 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
0919                 void ACPI_INTERNAL_VAR_XFACE
0920                 acpi_bios_warning(const char *module_name,
0921                           u32 line_number,
0922                           const char *format, ...))
0923 
0924 /*
0925  * Debug output
0926  */
0927 ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6)
0928                    void ACPI_INTERNAL_VAR_XFACE
0929                    acpi_debug_print(u32 requested_debug_level,
0930                         u32 line_number,
0931                         const char *function_name,
0932                         const char *module_name,
0933                         u32 component_id,
0934                         const char *format, ...))
0935 ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6)
0936                 void ACPI_INTERNAL_VAR_XFACE
0937                 acpi_debug_print_raw(u32 requested_debug_level,
0938                              u32 line_number,
0939                              const char *function_name,
0940                              const char *module_name,
0941                              u32 component_id,
0942                              const char *format, ...))
0943 
0944 ACPI_DBG_DEPENDENT_RETURN_VOID(void
0945                    acpi_trace_point(acpi_trace_event_type type,
0946                         u8 begin,
0947                         u8 *aml, char *pathname))
0948 
0949 acpi_status acpi_initialize_debugger(void);
0950 
0951 void acpi_terminate_debugger(void);
0952 
0953 /*
0954  * Divergences
0955  */
0956 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
0957                 acpi_get_data_full(acpi_handle object,
0958                            acpi_object_handler handler,
0959                            void **data,
0960                            void (*callback)(void *)))
0961 
0962 void acpi_run_debugger(char *batch_buffer);
0963 
0964 void acpi_set_debugger_thread_id(acpi_thread_id thread_id);
0965 
0966 #endif              /* __ACXFACE_H__ */