xref: /haiku/headers/private/kernel/int.h (revision e79e4e7c9e432c90415f79809b7160e864f79001)
1 /*
2 ** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
4 */
5 #ifndef _KERNEL_INT_H
6 #define _KERNEL_INT_H
7 
8 #include <KernelExport.h>
9 
10 #include <arch/int.h>
11 
12 struct kernel_args;
13 
14 /* adds the handler but don't change whether or not the interrupt is currently enabled */
15 #define B_NO_ENABLE_COUNTER	1
16 
17 /* during kernel startup, interrupts are disabled */
18 extern bool kernel_startup;
19 
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 int  int_init(struct kernel_args *ka);
26 int  int_init2(struct kernel_args *ka);
27 int  int_io_interrupt_handler(int vector);
28 long install_interrupt_handler(long, interrupt_handler,	void *);
29 long remove_interrupt_handler (long, interrupt_handler,	void *);
30 
31 static inline void
32 enable_interrupts(void)
33 {
34 	arch_int_enable_interrupts();
35 }
36 
37 static inline bool
38 are_interrupts_enabled(void)
39 {
40 	return arch_int_are_interrupts_enabled();
41 }
42 
43 #ifdef __cplusplus
44 }
45 #endif
46 
47 #endif /* _KERNEL_INT_H */
48