diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-07-27 22:15:01 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-07-27 22:15:01 +0000 |
commit | 7996a3d79d55b7f879dfd62e202bbfe2963718d3 (patch) | |
tree | 8d9f6759fec4099b9be503c11c7ed174f7204980 /libdde-linux26/lib/src/arch/l4/cli_sti.c | |
parent | 4fbe7358c7747a9165f776eb19addbb9baf7def2 (diff) |
really properly move files
Diffstat (limited to 'libdde-linux26/lib/src/arch/l4/cli_sti.c')
-rw-r--r-- | libdde-linux26/lib/src/arch/l4/cli_sti.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/libdde-linux26/lib/src/arch/l4/cli_sti.c b/libdde-linux26/lib/src/arch/l4/cli_sti.c new file mode 100644 index 00000000..81864ebb --- /dev/null +++ b/libdde-linux26/lib/src/arch/l4/cli_sti.c @@ -0,0 +1,63 @@ +#include "local.h" + +#include <linux/kernel.h> + +/* IRQ lock reference counter */ +static __thread atomic_t _refcnt = ATOMIC_INIT(0); + +/* Check whether IRQs are currently disabled. + * + * This is the case, if flags is greater than 0. + */ + +int raw_irqs_disabled_flags(unsigned long flags) +{ + return ((int)flags > 0); +} + +/* Store the current flags state. + * + * This is done by returning the current refcnt. + */ +unsigned long __raw_local_save_flags(void) +{ + return (unsigned long)atomic_read(&_refcnt); +} + +/* Restore IRQ state. */ +void raw_local_irq_restore(unsigned long flags) +{ + atomic_set(&_refcnt, flags); +} + +/* Disable IRQs by grabbing the IRQ lock. */ +void raw_local_irq_disable(void) +{ + atomic_inc(&_refcnt); +} + +/* Unlock the IRQ lock until refcnt is 0. */ +void raw_local_irq_enable(void) +{ + atomic_set(&_refcnt, 0); +} + + +void raw_safe_halt(void) +{ + WARN_UNIMPL; +} + + +void halt(void) +{ + WARN_UNIMPL; +} + +/* These functions are empty for DDE. Every DDE thread is a separate + * "virtual" CPU. Therefore there is no need to en/disable bottom halves. + */ +void local_bh_disable(void) {} +void __local_bh_enable(void) {} +void _local_bh_enable(void) {} +void local_bh_enable(void) {} |