xref: /haiku/headers/private/kernel/arch/int.h (revision 9f3bdf3d039430b5172c424def20ce5d9f7367d4)
1 /*
2  * Copyright 2002-2010, Axel Dörfler, axeld@pinc-software.de.
3  * Distributed under the terms of the MIT License.
4  *
5  * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
6  * Distributed under the terms of the NewOS License.
7  */
8 #ifndef KERNEL_ARCH_INT_H
9 #define KERNEL_ARCH_INT_H
10 
11 
12 // config flags for arch_int_configure_io_interrupt()
13 #define B_EDGE_TRIGGERED		1
14 #define B_LEVEL_TRIGGERED		2
15 #define B_LOW_ACTIVE_POLARITY	4
16 #define B_HIGH_ACTIVE_POLARITY	8
17 
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 struct kernel_args;
24 
25 status_t arch_int_init(struct kernel_args* args);
26 status_t arch_int_init_post_vm(struct kernel_args* args);
27 status_t arch_int_init_io(struct kernel_args* args);
28 status_t arch_int_init_post_device_manager(struct kernel_args* args);
29 
30 void arch_int_enable_interrupts(void);
31 int arch_int_disable_interrupts(void);
32 void arch_int_restore_interrupts(int oldState);
33 void arch_int_enable_io_interrupt(int32 irq);
34 void arch_int_disable_io_interrupt(int32 irq);
35 void arch_int_configure_io_interrupt(int32 irq, uint32 config);
36 bool arch_int_are_interrupts_enabled(void);
37 int32 arch_int_assign_to_cpu(int32 irq, int32 cpu);
38 
39 #ifdef __cplusplus
40 }
41 #endif
42 
43 
44 #include <arch_int.h>
45 
46 
47 #endif	/* KERNEL_ARCH_INT_H */
48