diff options
author | Zheng Da <zhengda1936@gmail.com> | 2010-08-09 12:32:17 +0200 |
---|---|---|
committer | Zheng Da <zhengda1936@gmail.com> | 2010-08-09 12:32:17 +0200 |
commit | 529d8041be254a2ba56543953b1daf8f1c83a204 (patch) | |
tree | 08af6de7666084e70b62e08d37667cdc803b92de /libdde_linux26/lib/src | |
parent | 76f4a1e072033c98e4b7430a59929d7896064e83 (diff) |
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.
Diffstat (limited to 'libdde_linux26/lib/src')
-rw-r--r-- | libdde_linux26/lib/src/arch/l4/cli_sti.c | 15 |
1 files changed, 15 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 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. |