^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Name: acpiosxf.h - All interfaces to the OS Services Layer (OSL). These
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * interfaces must be implemented by OSL to interface the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * ACPI components to the host operating system.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Copyright (C) 2000 - 2020, Intel Corp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) *****************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #ifndef __ACPIOSXF_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #define __ACPIOSXF_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <acpi/platform/acenv.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <acpi/actypes.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) /* Types for acpi_os_execute */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) typedef enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) OSL_GLOBAL_LOCK_HANDLER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) OSL_NOTIFY_HANDLER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) OSL_GPE_HANDLER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) OSL_DEBUGGER_MAIN_THREAD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) OSL_DEBUGGER_EXEC_THREAD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) OSL_EC_POLL_HANDLER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) OSL_EC_BURST_HANDLER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) } acpi_execute_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define ACPI_NO_UNIT_LIMIT ((u32) -1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #define ACPI_MUTEX_SEM 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) /* Functions for acpi_os_signal */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #define ACPI_SIGNAL_FATAL 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #define ACPI_SIGNAL_BREAKPOINT 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) struct acpi_signal_fatal_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) u32 type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) u32 code;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) u32 argument;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) * OSL Initialization and shutdown primitives
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_initialize
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) acpi_status acpi_os_initialize(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_terminate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) acpi_status acpi_os_terminate(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) * ACPI Table interfaces
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_root_pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) acpi_physical_address acpi_os_get_root_pointer(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_predefined_override
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) acpi_string *new_val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_table_override
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) acpi_os_table_override(struct acpi_table_header *existing_table,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) struct acpi_table_header **new_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_physical_table_override
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) acpi_os_physical_table_override(struct acpi_table_header *existing_table,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) acpi_physical_address *new_address,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) u32 *new_table_length);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) * Spinlock primitives
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_lock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) acpi_status acpi_os_create_lock(acpi_spinlock * out_handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_lock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) void acpi_os_delete_lock(acpi_spinlock handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_lock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_lock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) void acpi_os_release_lock(acpi_spinlock handle, acpi_cpu_flags flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) * RAW spinlock primitives. If the OS does not provide them, fallback to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) * spinlock primitives
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_raw_lock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) # define acpi_os_create_raw_lock(out_handle) acpi_os_create_lock(out_handle)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_raw_lock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) # define acpi_os_delete_raw_lock(handle) acpi_os_delete_lock(handle)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_raw_lock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) # define acpi_os_acquire_raw_lock(handle) acpi_os_acquire_lock(handle)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_raw_lock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) # define acpi_os_release_raw_lock(handle, flags) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) acpi_os_release_lock(handle, flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) * Semaphore primitives
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_semaphore
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) acpi_os_create_semaphore(u32 max_units,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) u32 initial_units, acpi_semaphore * out_handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_semaphore
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) acpi_status acpi_os_delete_semaphore(acpi_semaphore handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_wait_semaphore
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) acpi_os_wait_semaphore(acpi_semaphore handle, u32 units, u16 timeout);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_signal_semaphore
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) acpi_status acpi_os_signal_semaphore(acpi_semaphore handle, u32 units);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) * Mutex primitives. May be configured to use semaphores instead via
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) * ACPI_MUTEX_TYPE (see platform/acenv.h)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) #if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_mutex
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) acpi_status acpi_os_create_mutex(acpi_mutex * out_handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_mutex
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) void acpi_os_delete_mutex(acpi_mutex handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_mutex
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) acpi_status acpi_os_acquire_mutex(acpi_mutex handle, u16 timeout);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_mutex
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) void acpi_os_release_mutex(acpi_mutex handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) * Memory allocation and mapping
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) void *acpi_os_allocate(acpi_size size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate_zeroed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) void *acpi_os_allocate_zeroed(acpi_size size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_free
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) void acpi_os_free(void *memory);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_map_memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) void *acpi_os_map_memory(acpi_physical_address where, acpi_size length);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_unmap_memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) void acpi_os_unmap_memory(void *logical_address, acpi_size size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_physical_address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) acpi_os_get_physical_address(void *logical_address,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) acpi_physical_address *physical_address);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) * Memory/Object Cache
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_cache
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) acpi_os_create_cache(char *cache_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) u16 object_size,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) u16 max_depth, acpi_cache_t ** return_cache);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_cache
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) acpi_status acpi_os_delete_cache(acpi_cache_t * cache);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_purge_cache
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) acpi_status acpi_os_purge_cache(acpi_cache_t * cache);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) void *acpi_os_acquire_object(acpi_cache_t * cache);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) * Interrupt handlers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_install_interrupt_handler
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) acpi_os_install_interrupt_handler(u32 interrupt_number,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) acpi_osd_handler service_routine,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) void *context);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_remove_interrupt_handler
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) acpi_os_remove_interrupt_handler(u32 interrupt_number,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) acpi_osd_handler service_routine);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) * Threads and Scheduling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_thread_id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) acpi_thread_id acpi_os_get_thread_id(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_execute
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) acpi_os_execute(acpi_execute_type type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) acpi_osd_exec_callback function, void *context);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_wait_events_complete
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) void acpi_os_wait_events_complete(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_sleep
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) void acpi_os_sleep(u64 milliseconds);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_stall
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) void acpi_os_stall(u32 microseconds);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) * Platform and hardware-independent I/O interfaces
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_read_port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) acpi_status acpi_os_read_port(acpi_io_address address, u32 *value, u32 width);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_write_port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) acpi_status acpi_os_write_port(acpi_io_address address, u32 value, u32 width);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) * Platform and hardware-independent physical memory interfaces
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) int acpi_os_read_iomem(void __iomem *virt_addr, u64 *value, u32 width);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_read_memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) acpi_os_read_memory(acpi_physical_address address, u64 *value, u32 width);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_write_memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) acpi_os_write_memory(acpi_physical_address address, u64 value, u32 width);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) * Platform and hardware-independent PCI configuration space access
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) * Note: Can't use "Register" as a parameter, changed to "Reg" --
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) * certain compilers complain.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_read_pci_configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) u32 reg, u64 *value, u32 width);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_write_pci_configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) u32 reg, u64 value, u32 width);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) * Miscellaneous
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_readable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) u8 acpi_os_readable(void *pointer, acpi_size length);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_writable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) u8 acpi_os_writable(void *pointer, acpi_size length);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_timer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) u64 acpi_os_get_timer(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_signal
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) acpi_status acpi_os_signal(u32 function, void *info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_enter_sleep
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) acpi_status acpi_os_enter_sleep(u8 sleep_state, u32 rega_value, u32 regb_value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) * Debug print routines
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) ACPI_PRINTF_LIKE(1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) void ACPI_INTERNAL_VAR_XFACE acpi_os_printf(const char *format, ...);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_vprintf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) void acpi_os_vprintf(const char *format, va_list args);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_redirect_output
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) void acpi_os_redirect_output(void *destination);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) * Debug IO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_line
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) acpi_status acpi_os_get_line(char *buffer, u32 buffer_length, u32 *bytes_read);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_initialize_debugger
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) acpi_status acpi_os_initialize_debugger(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_terminate_debugger
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) void acpi_os_terminate_debugger(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_wait_command_ready
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) acpi_status acpi_os_wait_command_ready(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_notify_command_complete
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) acpi_status acpi_os_notify_command_complete(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_trace_point
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) acpi_os_trace_point(acpi_trace_event_type type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) u8 begin, u8 *aml, char *pathname);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) * Obtain ACPI table(s)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) acpi_os_get_table_by_name(char *signature,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) u32 instance,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) struct acpi_table_header **table,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) acpi_physical_address *address);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_index
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) acpi_os_get_table_by_index(u32 index,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) struct acpi_table_header **table,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) u32 *instance, acpi_physical_address *address);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) acpi_status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) acpi_os_get_table_by_address(acpi_physical_address address,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) struct acpi_table_header **table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) * Directory manipulation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_open_directory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) void *acpi_os_open_directory(char *pathname,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) char *wildcard_spec, char requested_file_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) /* requeste_file_type values */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) #define REQUEST_FILE_ONLY 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) #define REQUEST_DIR_ONLY 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_next_filename
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) char *acpi_os_get_next_filename(void *dir_handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_close_directory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) void acpi_os_close_directory(void *dir_handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) #endif /* __ACPIOSXF_H__ */