2 * Copyright 2003-2010, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
5 * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
6 * Distributed under the terms of the NewOS License.
12 #include <KernelExport.h>
15 #include <util/list.h>
17 // private install_io_interrupt_handler() flags
18 #define B_NO_LOCK_VECTOR 0x100
19 #define B_NO_HANDLED_INFO 0x200
25 INTERRUPT_TYPE_EXCEPTION
,
27 INTERRUPT_TYPE_LOCAL_IRQ
,
28 INTERRUPT_TYPE_SYSCALL
,
30 INTERRUPT_TYPE_UNKNOWN
33 struct irq_assignment
{
50 status_t
int_init(struct kernel_args
* args
);
51 status_t
int_init_post_vm(struct kernel_args
* args
);
52 status_t
int_init_io(struct kernel_args
* args
);
53 status_t
int_init_post_device_manager(struct kernel_args
* args
);
54 int int_io_interrupt_handler(int vector
, bool levelTriggered
);
56 bool interrupts_enabled(void);
59 enable_interrupts(void)
61 arch_int_enable_interrupts();
65 are_interrupts_enabled(void)
67 return arch_int_are_interrupts_enabled();
75 // map those directly to the arch versions, so they can be inlined
76 #define disable_interrupts() arch_int_disable_interrupts()
77 #define restore_interrupts(status) arch_int_restore_interrupts(status)
80 status_t
reserve_io_interrupt_vectors(long count
, long startVector
,
81 enum interrupt_type type
);
82 status_t
allocate_io_interrupt_vectors(long count
, long *startVector
,
83 enum interrupt_type type
);
84 void free_io_interrupt_vectors(long count
, long startVector
);
86 void assign_io_interrupt_to_cpu(long vector
, int32 cpu
);
88 #endif /* _KERNEL_INT_H */