1 /* 2 * Copyright 2003-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 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_INT_H 9 #define _KERNEL_INT_H 10 11 12 #include <KernelExport.h> 13 #include <arch/int.h> 14 15 // private install_io_interrupt_handler() flags 16 #define B_NO_LOCK_VECTOR 0x100 17 #define B_NO_HANDLED_INFO 0x200 18 19 struct kernel_args; 20 21 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 25 26 status_t int_init(struct kernel_args *args); 27 status_t int_init_post_vm(struct kernel_args *args); 28 status_t int_init_post_device_manager(struct kernel_args *args); 29 int int_io_interrupt_handler(int vector, bool levelTriggered); 30 31 bool interrupts_enabled(void); 32 33 static inline void 34 enable_interrupts(void) 35 { 36 arch_int_enable_interrupts(); 37 } 38 39 static inline bool 40 are_interrupts_enabled(void) 41 { 42 return arch_int_are_interrupts_enabled(); 43 } 44 45 #ifdef __cplusplus 46 } 47 #endif 48 49 50 // map those directly to the arch versions, so they can be inlined 51 #define disable_interrupts() arch_int_disable_interrupts() 52 #define restore_interrupts(status) arch_int_restore_interrupts(status) 53 54 55 #endif /* _KERNEL_INT_H */ 56