blob: 540d35f06ad6eb0b743db06b44a1c5a36ccfe2dd [file] [log] [blame]
Erik Schmauss95857632018-03-14 16:13:07 -07001/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/******************************************************************************
3 *
Bob Mooreabf95c32012-10-31 02:27:04 +00004 * Name: acpiosxf.h - All interfaces to the OS Services Layer (OSL). These
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 * interfaces must be implemented by OSL to interface the
6 * ACPI components to the host operating system.
7 *
Bob Mooreda6f8322018-01-04 10:06:38 -08008 * Copyright (C) 2000 - 2018, Intel Corp.
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 *
Erik Schmauss95857632018-03-14 16:13:07 -070010 *****************************************************************************/
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
12#ifndef __ACPIOSXF_H__
13#define __ACPIOSXF_H__
14
David Howellsa1ce3922012-10-02 18:01:25 +010015#include <acpi/platform/acenv.h>
16#include <acpi/actypes.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
Bob Moore958dd242006-05-12 17:12:00 -040018/* Types for acpi_os_execute */
Linus Torvalds1da177e2005-04-16 15:20:36 -070019
Bob Moore958dd242006-05-12 17:12:00 -040020typedef enum {
21 OSL_GLOBAL_LOCK_HANDLER,
22 OSL_NOTIFY_HANDLER,
23 OSL_GPE_HANDLER,
Lv Zhengf988f242015-10-19 10:25:50 +080024 OSL_DEBUGGER_MAIN_THREAD,
25 OSL_DEBUGGER_EXEC_THREAD,
Bob Moore958dd242006-05-12 17:12:00 -040026 OSL_EC_POLL_HANDLER,
Bob Moore41195322006-05-26 16:36:00 -040027 OSL_EC_BURST_HANDLER
Bob Moore958dd242006-05-12 17:12:00 -040028} acpi_execute_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
30#define ACPI_NO_UNIT_LIMIT ((u32) -1)
31#define ACPI_MUTEX_SEM 1
32
Linus Torvalds1da177e2005-04-16 15:20:36 -070033/* Functions for acpi_os_signal */
34
35#define ACPI_SIGNAL_FATAL 0
36#define ACPI_SIGNAL_BREAKPOINT 1
37
Len Brown4be44fc2005-08-05 00:44:28 -040038struct acpi_signal_fatal_info {
39 u32 type;
40 u32 code;
41 u32 argument;
Linus Torvalds1da177e2005-04-16 15:20:36 -070042};
43
Linus Torvalds1da177e2005-04-16 15:20:36 -070044/*
45 * OSL Initialization and shutdown primitives
46 */
Lv Zheng7e94632f2013-10-29 09:30:35 +080047#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_initialize
Lv Zheng93220582013-10-29 09:30:41 +080048acpi_status acpi_os_initialize(void);
Lv Zheng7e94632f2013-10-29 09:30:35 +080049#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
Lv Zheng7e94632f2013-10-29 09:30:35 +080051#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_terminate
Len Brown4be44fc2005-08-05 00:44:28 -040052acpi_status acpi_os_terminate(void);
Lv Zheng7e94632f2013-10-29 09:30:35 +080053#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070054
55/*
56 * ACPI Table interfaces
57 */
Lv Zheng7e94632f2013-10-29 09:30:35 +080058#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_root_pointer
Bob Mooref3d2e782007-02-02 19:48:18 +030059acpi_physical_address acpi_os_get_root_pointer(void);
Lv Zheng7e94632f2013-10-29 09:30:35 +080060#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070061
Lv Zheng7e94632f2013-10-29 09:30:35 +080062#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_predefined_override
Linus Torvalds1da177e2005-04-16 15:20:36 -070063acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -040064acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
Lv Zheng80b28812016-03-24 09:38:28 +080065 acpi_string *new_val);
Lv Zheng7e94632f2013-10-29 09:30:35 +080066#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070067
Lv Zheng7e94632f2013-10-29 09:30:35 +080068#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_table_override
Linus Torvalds1da177e2005-04-16 15:20:36 -070069acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -040070acpi_os_table_override(struct acpi_table_header *existing_table,
71 struct acpi_table_header **new_table);
Lv Zheng7e94632f2013-10-29 09:30:35 +080072#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070073
Lv Zheng7e94632f2013-10-29 09:30:35 +080074#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_physical_table_override
Bob Mooref7b004a2012-02-14 18:31:56 +080075acpi_status
76acpi_os_physical_table_override(struct acpi_table_header *existing_table,
Lv Zhengf5c1e1c2016-05-05 12:57:53 +080077 acpi_physical_address *new_address,
Bob Mooref7b004a2012-02-14 18:31:56 +080078 u32 *new_table_length);
Lv Zheng7e94632f2013-10-29 09:30:35 +080079#endif
Bob Mooref7b004a2012-02-14 18:31:56 +080080
Linus Torvalds1da177e2005-04-16 15:20:36 -070081/*
Bob Moore967440e32006-06-23 17:04:00 -040082 * Spinlock primitives
83 */
Lv Zheng7e94632f2013-10-29 09:30:35 +080084#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_lock
Lv Zheng3e8214e2012-12-19 05:37:15 +000085acpi_status acpi_os_create_lock(acpi_spinlock * out_handle);
Rafael J. Wysocki07e49a72011-07-06 20:44:25 +020086#endif
Lin Ming9f63b882011-03-23 17:26:34 +080087
Lv Zheng7e94632f2013-10-29 09:30:35 +080088#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_lock
Bob Moore967440e32006-06-23 17:04:00 -040089void acpi_os_delete_lock(acpi_spinlock handle);
Lv Zheng7e94632f2013-10-29 09:30:35 +080090#endif
Bob Moore967440e32006-06-23 17:04:00 -040091
Lv Zheng7e94632f2013-10-29 09:30:35 +080092#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_lock
Bob Moore967440e32006-06-23 17:04:00 -040093acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle);
Lv Zheng7e94632f2013-10-29 09:30:35 +080094#endif
Bob Moore967440e32006-06-23 17:04:00 -040095
Lv Zheng7e94632f2013-10-29 09:30:35 +080096#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_lock
Bob Moore967440e32006-06-23 17:04:00 -040097void acpi_os_release_lock(acpi_spinlock handle, acpi_cpu_flags flags);
Lv Zheng7e94632f2013-10-29 09:30:35 +080098#endif
Bob Moore967440e32006-06-23 17:04:00 -040099
100/*
101 * Semaphore primitives
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102 */
Lv Zheng7e94632f2013-10-29 09:30:35 +0800103#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_semaphore
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400105acpi_os_create_semaphore(u32 max_units,
Bob Moore967440e32006-06-23 17:04:00 -0400106 u32 initial_units, acpi_semaphore * out_handle);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800107#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108
Lv Zheng7e94632f2013-10-29 09:30:35 +0800109#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_semaphore
Bob Moore967440e32006-06-23 17:04:00 -0400110acpi_status acpi_os_delete_semaphore(acpi_semaphore handle);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800111#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112
Lv Zheng7e94632f2013-10-29 09:30:35 +0800113#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_wait_semaphore
Bob Moore967440e32006-06-23 17:04:00 -0400114acpi_status
115acpi_os_wait_semaphore(acpi_semaphore handle, u32 units, u16 timeout);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800116#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117
Lv Zheng7e94632f2013-10-29 09:30:35 +0800118#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_signal_semaphore
Bob Moore967440e32006-06-23 17:04:00 -0400119acpi_status acpi_os_signal_semaphore(acpi_semaphore handle, u32 units);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800120#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121
Bob Moore967440e32006-06-23 17:04:00 -0400122/*
Bob Moore1685bd42008-12-31 03:03:29 +0800123 * Mutex primitives. May be configured to use semaphores instead via
124 * ACPI_MUTEX_TYPE (see platform/acenv.h)
Bob Moore967440e32006-06-23 17:04:00 -0400125 */
Bob Moore1685bd42008-12-31 03:03:29 +0800126#if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE)
127
Lv Zheng7e94632f2013-10-29 09:30:35 +0800128#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_mutex
Bob Moore967440e32006-06-23 17:04:00 -0400129acpi_status acpi_os_create_mutex(acpi_mutex * out_handle);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800130#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700131
Lv Zheng7e94632f2013-10-29 09:30:35 +0800132#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_mutex
Bob Moore967440e32006-06-23 17:04:00 -0400133void acpi_os_delete_mutex(acpi_mutex handle);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800134#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135
Lv Zheng7e94632f2013-10-29 09:30:35 +0800136#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_mutex
Bob Moore967440e32006-06-23 17:04:00 -0400137acpi_status acpi_os_acquire_mutex(acpi_mutex handle, u16 timeout);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800138#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139
Lv Zheng7e94632f2013-10-29 09:30:35 +0800140#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_mutex
Bob Moore967440e32006-06-23 17:04:00 -0400141void acpi_os_release_mutex(acpi_mutex handle);
Bob Moore1685bd42008-12-31 03:03:29 +0800142#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700143
Lv Zheng7e94632f2013-10-29 09:30:35 +0800144#endif
145
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146/*
147 * Memory allocation and mapping
148 */
Lv Zheng7e94632f2013-10-29 09:30:35 +0800149#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate
Len Brown4be44fc2005-08-05 00:44:28 -0400150void *acpi_os_allocate(acpi_size size);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800151#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152
Lv Zheng7e94632f2013-10-29 09:30:35 +0800153#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate_zeroed
Lv Zhengb3c86c32013-10-29 09:29:27 +0800154void *acpi_os_allocate_zeroed(acpi_size size);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800155#endif
Lv Zhengb3c86c32013-10-29 09:29:27 +0800156
Lv Zheng7e94632f2013-10-29 09:30:35 +0800157#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_free
Lv Zheng739dcbb2012-12-20 01:07:26 +0000158void acpi_os_free(void *memory);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800159#endif
Lv Zheng739dcbb2012-12-20 01:07:26 +0000160
Lv Zheng7e94632f2013-10-29 09:30:35 +0800161#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_map_memory
Lv Zheng93220582013-10-29 09:30:41 +0800162void *acpi_os_map_memory(acpi_physical_address where, acpi_size length);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800163#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164
Lv Zheng7e94632f2013-10-29 09:30:35 +0800165#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_unmap_memory
Lv Zheng93220582013-10-29 09:30:41 +0800166void acpi_os_unmap_memory(void *logical_address, acpi_size size);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800167#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168
Lv Zheng7e94632f2013-10-29 09:30:35 +0800169#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_physical_address
Linus Torvalds1da177e2005-04-16 15:20:36 -0700170acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400171acpi_os_get_physical_address(void *logical_address,
Lv Zhengf5c1e1c2016-05-05 12:57:53 +0800172 acpi_physical_address *physical_address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173#endif
174
Robert Moore73459f72005-06-24 00:00:00 -0400175/*
176 * Memory/Object Cache
177 */
Lv Zheng7e94632f2013-10-29 09:30:35 +0800178#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_cache
Robert Moore73459f72005-06-24 00:00:00 -0400179acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400180acpi_os_create_cache(char *cache_name,
181 u16 object_size,
182 u16 max_depth, acpi_cache_t ** return_cache);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800183#endif
Robert Moore73459f72005-06-24 00:00:00 -0400184
Lv Zheng7e94632f2013-10-29 09:30:35 +0800185#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_cache
Len Brown4be44fc2005-08-05 00:44:28 -0400186acpi_status acpi_os_delete_cache(acpi_cache_t * cache);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800187#endif
Robert Moore73459f72005-06-24 00:00:00 -0400188
Lv Zheng7e94632f2013-10-29 09:30:35 +0800189#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_purge_cache
Len Brown4be44fc2005-08-05 00:44:28 -0400190acpi_status acpi_os_purge_cache(acpi_cache_t * cache);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800191#endif
Robert Moore73459f72005-06-24 00:00:00 -0400192
Lv Zheng7e94632f2013-10-29 09:30:35 +0800193#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_object
Len Brown4be44fc2005-08-05 00:44:28 -0400194void *acpi_os_acquire_object(acpi_cache_t * cache);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800195#endif
Robert Moore73459f72005-06-24 00:00:00 -0400196
Lv Zheng7e94632f2013-10-29 09:30:35 +0800197#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_object
Len Brown4be44fc2005-08-05 00:44:28 -0400198acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800199#endif
Robert Moore73459f72005-06-24 00:00:00 -0400200
Linus Torvalds1da177e2005-04-16 15:20:36 -0700201/*
202 * Interrupt handlers
203 */
Lv Zheng7e94632f2013-10-29 09:30:35 +0800204#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_install_interrupt_handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205acpi_status
Lv Zheng739dcbb2012-12-20 01:07:26 +0000206acpi_os_install_interrupt_handler(u32 interrupt_number,
Len Brown4be44fc2005-08-05 00:44:28 -0400207 acpi_osd_handler service_routine,
208 void *context);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800209#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700210
Lv Zheng7e94632f2013-10-29 09:30:35 +0800211#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_remove_interrupt_handler
Linus Torvalds1da177e2005-04-16 15:20:36 -0700212acpi_status
Lv Zheng739dcbb2012-12-20 01:07:26 +0000213acpi_os_remove_interrupt_handler(u32 interrupt_number,
214 acpi_osd_handler service_routine);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800215#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700216
217/*
218 * Threads and Scheduling
219 */
Lv Zheng7e94632f2013-10-29 09:30:35 +0800220#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_thread_id
Bob Moore83135242006-10-03 00:00:00 -0400221acpi_thread_id acpi_os_get_thread_id(void);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800222#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700223
Lv Zheng7e94632f2013-10-29 09:30:35 +0800224#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_execute
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225acpi_status
Bob Moore958dd242006-05-12 17:12:00 -0400226acpi_os_execute(acpi_execute_type type,
227 acpi_osd_exec_callback function, void *context);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800228#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700229
Lv Zheng7e94632f2013-10-29 09:30:35 +0800230#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_wait_events_complete
Lin Mingbd6f10a2012-05-22 16:43:49 +0800231void acpi_os_wait_events_complete(void);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800232#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700233
Lv Zheng7e94632f2013-10-29 09:30:35 +0800234#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_sleep
Bob Moore5df7e6c2010-01-21 10:06:32 +0800235void acpi_os_sleep(u64 milliseconds);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800236#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700237
Lv Zheng7e94632f2013-10-29 09:30:35 +0800238#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_stall
Len Brown4be44fc2005-08-05 00:44:28 -0400239void acpi_os_stall(u32 microseconds);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800240#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700241
242/*
243 * Platform and hardware-independent I/O interfaces
244 */
Lv Zheng7e94632f2013-10-29 09:30:35 +0800245#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_read_port
246acpi_status acpi_os_read_port(acpi_io_address address, u32 *value, u32 width);
247#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700248
Lv Zheng7e94632f2013-10-29 09:30:35 +0800249#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_write_port
Len Brown4be44fc2005-08-05 00:44:28 -0400250acpi_status acpi_os_write_port(acpi_io_address address, u32 value, u32 width);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800251#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700252
253/*
254 * Platform and hardware-independent physical memory interfaces
255 */
Srinivas Pandruvadaeeb2d802017-10-05 16:24:03 -0700256int acpi_os_read_iomem(void __iomem *virt_addr, u64 *value, u32 width);
257
Lv Zheng7e94632f2013-10-29 09:30:35 +0800258#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_read_memory
Linus Torvalds1da177e2005-04-16 15:20:36 -0700259acpi_status
Bob Moore653f4b52012-02-14 18:29:55 +0800260acpi_os_read_memory(acpi_physical_address address, u64 *value, u32 width);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800261#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700262
Lv Zheng7e94632f2013-10-29 09:30:35 +0800263#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_write_memory
Linus Torvalds1da177e2005-04-16 15:20:36 -0700264acpi_status
Bob Moore653f4b52012-02-14 18:29:55 +0800265acpi_os_write_memory(acpi_physical_address address, u64 value, u32 width);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800266#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700267
268/*
269 * Platform and hardware-independent PCI configuration space access
270 * Note: Can't use "Register" as a parameter, changed to "Reg" --
271 * certain compilers complain.
272 */
Lv Zheng7e94632f2013-10-29 09:30:35 +0800273#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_read_pci_configuration
Linus Torvalds1da177e2005-04-16 15:20:36 -0700274acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400275acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id,
Bob Moorec5f02312010-08-06 08:57:53 +0800276 u32 reg, u64 *value, u32 width);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800277#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700278
Lv Zheng7e94632f2013-10-29 09:30:35 +0800279#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_write_pci_configuration
Linus Torvalds1da177e2005-04-16 15:20:36 -0700280acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400281acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id,
Bob Moore5df7e6c2010-01-21 10:06:32 +0800282 u32 reg, u64 value, u32 width);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800283#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700284
285/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286 * Miscellaneous
287 */
Lv Zheng7e94632f2013-10-29 09:30:35 +0800288#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_readable
289u8 acpi_os_readable(void *pointer, acpi_size length);
290#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700291
Lv Zheng7e94632f2013-10-29 09:30:35 +0800292#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_writable
293u8 acpi_os_writable(void *pointer, acpi_size length);
294#endif
295
296#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_timer
297u64 acpi_os_get_timer(void);
298#endif
299
300#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_signal
Len Brown4be44fc2005-08-05 00:44:28 -0400301acpi_status acpi_os_signal(u32 function, void *info);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800302#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700303
Lv Zheng0fc5e8f2016-12-28 15:28:49 +0800304#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_enter_sleep
305acpi_status acpi_os_enter_sleep(u8 sleep_state, u32 rega_value, u32 regb_value);
306#endif
307
Linus Torvalds1da177e2005-04-16 15:20:36 -0700308/*
309 * Debug print routines
310 */
Lv Zheng7e94632f2013-10-29 09:30:35 +0800311#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_printf
Len Brown4be44fc2005-08-05 00:44:28 -0400312void ACPI_INTERNAL_VAR_XFACE acpi_os_printf(const char *format, ...);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800313#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700314
Lv Zheng7e94632f2013-10-29 09:30:35 +0800315#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_vprintf
Len Brown4be44fc2005-08-05 00:44:28 -0400316void acpi_os_vprintf(const char *format, va_list args);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800317#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700318
Lv Zheng7e94632f2013-10-29 09:30:35 +0800319#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_redirect_output
Len Brown4be44fc2005-08-05 00:44:28 -0400320void acpi_os_redirect_output(void *destination);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800321#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700322
323/*
Lv Zhengf8d31482015-12-03 10:42:46 +0800324 * Debug IO
Linus Torvalds1da177e2005-04-16 15:20:36 -0700325 */
Lv Zheng7e94632f2013-10-29 09:30:35 +0800326#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_line
327acpi_status acpi_os_get_line(char *buffer, u32 buffer_length, u32 *bytes_read);
328#endif
Lv Zheng7e94632f2013-10-29 09:30:35 +0800329
Lv Zheng703ecd22016-12-28 15:28:07 +0800330#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_initialize_debugger
331acpi_status acpi_os_initialize_debugger(void);
Lv Zhengf8d31482015-12-03 10:42:46 +0800332#endif
333
Lv Zheng703ecd22016-12-28 15:28:07 +0800334#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_terminate_debugger
335void acpi_os_terminate_debugger(void);
Lv Zhengf8d31482015-12-03 10:42:46 +0800336#endif
337
338#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_wait_command_ready
339acpi_status acpi_os_wait_command_ready(void);
340#endif
341
342#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_notify_command_complete
343acpi_status acpi_os_notify_command_complete(void);
344#endif
345
Lv Zhengdd99cbc2016-08-04 16:45:13 +0800346#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_trace_point
347void
348acpi_os_trace_point(acpi_trace_event_type type,
349 u8 begin, u8 *aml, char *pathname);
350#endif
351
Lv Zheng7e94632f2013-10-29 09:30:35 +0800352/*
353 * Obtain ACPI table(s)
354 */
355#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_name
356acpi_status
357acpi_os_get_table_by_name(char *signature,
358 u32 instance,
359 struct acpi_table_header **table,
Lv Zhengf5c1e1c2016-05-05 12:57:53 +0800360 acpi_physical_address *address);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800361#endif
362
363#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_index
364acpi_status
365acpi_os_get_table_by_index(u32 index,
366 struct acpi_table_header **table,
Lv Zhengf5c1e1c2016-05-05 12:57:53 +0800367 u32 *instance, acpi_physical_address *address);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800368#endif
369
370#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_address
371acpi_status
372acpi_os_get_table_by_address(acpi_physical_address address,
373 struct acpi_table_header **table);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700374#endif
375
Linus Torvalds1da177e2005-04-16 15:20:36 -0700376/*
377 * Directory manipulation
378 */
Lv Zheng7e94632f2013-10-29 09:30:35 +0800379#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_open_directory
Len Brown4be44fc2005-08-05 00:44:28 -0400380void *acpi_os_open_directory(char *pathname,
381 char *wildcard_spec, char requested_file_type);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800382#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700383
384/* requeste_file_type values */
385
386#define REQUEST_FILE_ONLY 0
387#define REQUEST_DIR_ONLY 1
388
Lv Zheng7e94632f2013-10-29 09:30:35 +0800389#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_next_filename
Len Brown4be44fc2005-08-05 00:44:28 -0400390char *acpi_os_get_next_filename(void *dir_handle);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800391#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700392
Lv Zheng7e94632f2013-10-29 09:30:35 +0800393#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_close_directory
Len Brown4be44fc2005-08-05 00:44:28 -0400394void acpi_os_close_directory(void *dir_handle);
Lv Zheng7e94632f2013-10-29 09:30:35 +0800395#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700396
Len Brown4be44fc2005-08-05 00:44:28 -0400397#endif /* __ACPIOSXF_H__ */