- Kai Germaschewski: ISDN update (including Makefiles)
[davej-history.git] / drivers / acpi / include / acpiosxf.h
blob47b1f28e522178f10330122ab0172d22265ec2db
2 /******************************************************************************
4 * Name: acpiosd.h - All interfaces to the OS-dependent layer. These
5 * interfaces must be implemented by the OS-dependent
6 * front-end to the ACPI subsystem.
8 *****************************************************************************/
12 * Copyright (C) 2000 R. Byron Moore
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #ifndef __ACPIOSD_H__
30 #define __ACPIOSD_H__
32 #include "acenv.h"
33 #include "actypes.h"
36 /* Priorities for Acpi_os_queue_for_execution */
38 #define OSD_PRIORITY_HIGH 1
39 #define OSD_PRIORITY_MED 2
40 #define OSD_PRIORITY_LO 3
41 #define OSD_PRIORITY_GPE OSD_PRIORITY_HIGH
43 #define ACPI_NO_UNIT_LIMIT ((u32) -1)
44 #define ACPI_MUTEX_SEM 1
48 * Types specific to the OS-dependent layer interfaces
51 typedef
52 u32 (*OSD_HANDLER) (
53 void *context);
55 typedef
56 void (*OSD_EXECUTION_CALLBACK) (
57 void *context);
61 * Initialization and shutdown primitives (Optional)
64 ACPI_STATUS
65 acpi_os_initialize (
66 void);
68 ACPI_STATUS
69 acpi_os_terminate (
70 void);
73 * Synchronization primitives
76 ACPI_STATUS
77 acpi_os_create_semaphore (
78 u32 max_units,
79 u32 initial_units,
80 ACPI_HANDLE *out_handle);
82 ACPI_STATUS
83 acpi_os_delete_semaphore (
84 ACPI_HANDLE handle);
86 ACPI_STATUS
87 acpi_os_wait_semaphore (
88 ACPI_HANDLE handle,
89 u32 units,
90 u32 timeout);
92 ACPI_STATUS
93 acpi_os_signal_semaphore (
94 ACPI_HANDLE handle,
95 u32 units);
98 * Memory allocation and mapping
101 void *
102 acpi_os_allocate (
103 u32 size);
105 void *
106 acpi_os_callocate (
107 u32 size);
109 void
110 acpi_os_free (
111 void * memory);
113 ACPI_STATUS
114 acpi_os_map_memory (
115 ACPI_PHYSICAL_ADDRESS physical_address,
116 u32 length,
117 void **logical_address);
119 void
120 acpi_os_unmap_memory (
121 void *logical_address,
122 u32 length);
126 * Interrupt handlers
129 ACPI_STATUS
130 acpi_os_install_interrupt_handler (
131 u32 interrupt_number,
132 OSD_HANDLER service_routine,
133 void *context);
135 ACPI_STATUS
136 acpi_os_remove_interrupt_handler (
137 u32 interrupt_number,
138 OSD_HANDLER service_routine);
142 * Scheduling
145 ACPI_STATUS
146 acpi_os_queue_for_execution (
147 u32 priority,
148 OSD_EXECUTION_CALLBACK function,
149 void *context);
151 void
152 acpi_os_sleep (
153 u32 seconds,
154 u32 milliseconds);
156 void
157 acpi_os_sleep_usec (
158 u32 microseconds);
161 * Platform/Hardware independent I/O interfaces
165 acpi_os_in8 (
166 ACPI_IO_ADDRESS in_port);
170 acpi_os_in16 (
171 ACPI_IO_ADDRESS in_port);
174 acpi_os_in32 (
175 ACPI_IO_ADDRESS in_port);
177 void
178 acpi_os_out8 (
179 ACPI_IO_ADDRESS out_port,
180 u8 value);
182 void
183 acpi_os_out16 (
184 ACPI_IO_ADDRESS out_port,
185 u16 value);
187 void
188 acpi_os_out32 (
189 ACPI_IO_ADDRESS out_port,
190 u32 value);
193 * Platform/Hardware independent physical memory interfaces
197 acpi_os_mem_in8 (
198 ACPI_PHYSICAL_ADDRESS in_addr);
201 acpi_os_mem_in16 (
202 ACPI_PHYSICAL_ADDRESS in_addr);
205 acpi_os_mem_in32 (
206 ACPI_PHYSICAL_ADDRESS in_addr);
208 void
209 acpi_os_mem_out8 (
210 ACPI_PHYSICAL_ADDRESS out_addr,
211 u8 value);
213 void
214 acpi_os_mem_out16 (
215 ACPI_PHYSICAL_ADDRESS out_addr,
216 u16 value);
218 void
219 acpi_os_mem_out32 (
220 ACPI_PHYSICAL_ADDRESS out_addr,
221 u32 value);
225 * Standard access to PCI configuration space
228 ACPI_STATUS
229 acpi_os_read_pci_cfg_byte (
230 u32 bus,
231 u32 device_function,
232 u32 register,
233 u8 *value);
235 ACPI_STATUS
236 acpi_os_read_pci_cfg_word (
237 u32 bus,
238 u32 device_function,
239 u32 register,
240 u16 *value);
242 ACPI_STATUS
243 acpi_os_read_pci_cfg_dword (
244 u32 bus,
245 u32 device_function,
246 u32 register,
247 u32 *value);
249 ACPI_STATUS
250 acpi_os_write_pci_cfg_byte (
251 u32 bus,
252 u32 device_function,
253 u32 register,
254 u8 value);
256 ACPI_STATUS
257 acpi_os_write_pci_cfg_word (
258 u32 bus,
259 u32 device_function,
260 u32 register,
261 u16 value);
264 ACPI_STATUS
265 acpi_os_write_pci_cfg_dword (
266 u32 bus,
267 u32 device_function,
268 u32 register,
269 u32 value);
273 * Miscellaneous
276 ACPI_STATUS
277 acpi_os_breakpoint (
278 NATIVE_CHAR *message);
281 acpi_os_readable (
282 void *pointer,
283 u32 length);
287 acpi_os_writable (
288 void *pointer,
289 u32 length);
293 * Debug print routines
297 acpi_os_printf (
298 const NATIVE_CHAR *format,
299 ...);
302 acpi_os_vprintf (
303 const NATIVE_CHAR *format,
304 va_list args);
307 * Debug input
311 acpi_os_get_line (
312 NATIVE_CHAR *buffer);
316 * Debug
319 void
320 acpi_os_dbg_assert(
321 void *failed_assertion,
322 void *file_name,
323 u32 line_number,
324 NATIVE_CHAR *message);
327 #endif /* __ACPIOSD_H__ */