2002-07-09 16:24:59 +04:00
|
|
|
/*
|
2006-04-30 17:56:21 +04:00
|
|
|
* Copyright 2003-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
2005-04-12 10:09:13 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
|
|
|
* Distributed under the terms of the NewOS License.
|
|
|
|
*/
|
2002-07-09 16:24:59 +04:00
|
|
|
#ifndef _KERNEL_INT_H
|
|
|
|
#define _KERNEL_INT_H
|
|
|
|
|
|
|
|
|
2005-04-12 10:09:13 +04:00
|
|
|
#include <KernelExport.h>
|
2003-05-03 20:03:26 +04:00
|
|
|
#include <arch/int.h>
|
2002-07-19 22:28:57 +04:00
|
|
|
|
2009-02-18 00:41:51 +03:00
|
|
|
// private install_io_interrupt_handler() flags
|
|
|
|
#define B_NO_LOCK_VECTOR 0x100
|
|
|
|
#define B_NO_HANDLED_INFO 0x200
|
|
|
|
|
2003-05-03 20:03:26 +04:00
|
|
|
struct kernel_args;
|
2002-07-19 22:28:57 +04:00
|
|
|
|
2005-04-12 10:09:13 +04:00
|
|
|
|
2003-10-28 20:55:20 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2004-10-21 05:41:29 +04:00
|
|
|
status_t int_init(struct kernel_args *args);
|
|
|
|
status_t int_init_post_vm(struct kernel_args *args);
|
2006-02-07 05:50:32 +03:00
|
|
|
status_t int_init_post_device_manager(struct kernel_args *args);
|
2006-04-30 17:56:21 +04:00
|
|
|
int int_io_interrupt_handler(int vector, bool levelTriggered);
|
2005-04-27 05:08:35 +04:00
|
|
|
|
|
|
|
bool interrupts_enabled(void);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2003-10-28 20:55:20 +03:00
|
|
|
static inline void
|
|
|
|
enable_interrupts(void)
|
|
|
|
{
|
|
|
|
arch_int_enable_interrupts();
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool
|
|
|
|
are_interrupts_enabled(void)
|
|
|
|
{
|
|
|
|
return arch_int_are_interrupts_enabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2002-11-28 05:25:04 +03:00
|
|
|
|
2008-10-01 18:33:10 +04:00
|
|
|
|
|
|
|
// map those directly to the arch versions, so they can be inlined
|
|
|
|
#define disable_interrupts() arch_int_disable_interrupts()
|
|
|
|
#define restore_interrupts(status) arch_int_restore_interrupts(status)
|
|
|
|
|
|
|
|
|
2002-07-19 20:00:17 +04:00
|
|
|
#endif /* _KERNEL_INT_H */
|