1 /* 2 * Copyright 2002-2005, 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_ARCH_INT_H 9 #define KERNEL_ARCH_INT_H 10 11 #include <arch_int.h> 12 13 // config flags for arch_int_configure_io_interrupt() 14 #define B_EDGE_TRIGGERED 1 15 #define B_LEVEL_TRIGGERED 2 16 #define B_LOW_ACTIVE_POLARITY 4 17 #define B_HIGH_ACTIVE_POLARITY 8 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_post_device_manager(struct kernel_args *args); 28 29 void arch_int_enable_interrupts(void); 30 int arch_int_disable_interrupts(void); 31 void arch_int_restore_interrupts(int oldstate); 32 void arch_int_enable_io_interrupt(int irq); 33 void arch_int_disable_io_interrupt(int irq); 34 void arch_int_configure_io_interrupt(int irq, uint32 config); 35 bool arch_int_are_interrupts_enabled(void); 36 37 #ifdef __cplusplus 38 } 39 #endif 40 41 #endif /* KERNEL_ARCH_INT_H */ 42