From 529d8041be254a2ba56543953b1daf8f1c83a204 Mon Sep 17 00:00:00 2001 From: Zheng Da Date: Mon, 9 Aug 2010 12:32:17 +0200 Subject: fake irq disable and enable. Some functions such as blk_plug_device checks whether irqs are disabled. So I need to fake irq diable in spin_lock_irq and spin_lock_irqsave. --- libdde_linux26/lib/src/arch/l4/cli_sti.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libdde_linux26/lib/src') diff --git a/libdde_linux26/lib/src/arch/l4/cli_sti.c b/libdde_linux26/lib/src/arch/l4/cli_sti.c index 3f5ba4cf..051f2598 100644 --- a/libdde_linux26/lib/src/arch/l4/cli_sti.c +++ b/libdde_linux26/lib/src/arch/l4/cli_sti.c @@ -39,6 +39,21 @@ static int nested_lock(ddekit_lock_t lock) return do_lock; } +unsigned long fake_local_irq_disable_flags(void) +{ + return atomic_add_return (1, &_refcnt) - 1; +} + +void fake_local_irq_enable(void) +{ + atomic_set(&_refcnt, 0); +} + +void fake_local_irq_restore(unsigned long flags) +{ + atomic_set(&_refcnt, flags); +} + /* Store the current flags state. * * This is done by returning the current refcnt. -- cgit v1.2.3