Commit e328b98a authored by David S. Miller's avatar David S. Miller

[SOFTIRQ]: Move softirq implementation to common area, add debug check.

1) Every arch implemented local_bh_foo identically, move to
   linux/interrupt.h
2) Kill all asm/softirq.h references
3) Kill asm/softirq.h itself
4) Move local_bh_disable() out of line to kernel/softirq.c
5) Add BUG check on irqs_disabled() to local_bh_disable()
parent 9e0206ab
......@@ -25,7 +25,6 @@
#include <asm/processor.h>
#include <asm/checksum.h>
#include <linux/interrupt.h>
#include <asm/softirq.h>
#include <asm/fpu.h>
#include <asm/irq.h>
#include <asm/machvec.h>
......
......@@ -35,7 +35,6 @@
#include <asm/pgtable.h>
#include <asm/pgalloc.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/mmu_context.h>
#include <asm/tlbflush.h>
......
......@@ -18,7 +18,6 @@
#include <asm/semaphore.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/current.h>
#include <asm/sn/sv.h>
......
......@@ -17,7 +17,6 @@
#include <asm/semaphore.h>
#include <asm/checksum.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
asmlinkage long long __ashldi3 (long long, int);
asmlinkage long long __ashrdi3 (long long, int);
......
......@@ -17,7 +17,6 @@
#include <asm/semaphore.h>
#include <asm/checksum.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/current.h>
extern void dump_thread(struct pt_regs *, struct user *);
......
......@@ -25,7 +25,6 @@
#include <asm/pgalloc.h>
#include <asm/semaphore.h>
#include <asm/sgi/sgihpc.h>
#include <asm/softirq.h>
#include <asm/uaccess.h>
#ifdef CONFIG_BLK_DEV_FD
#include <asm/floppy.h>
......
......@@ -37,7 +37,6 @@
#include <asm/processor.h>
#include <asm/system.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/mmu_context.h>
#include <asm/delay.h>
#include <asm/smp.h>
......
......@@ -22,7 +22,6 @@
#include <asm/hardirq.h>
#include <asm/pgalloc.h>
#include <asm/mmu_context.h>
#include <asm/softirq.h>
#include <asm/system.h>
#include <asm/uaccess.h>
......
......@@ -24,7 +24,6 @@
#include <asm/page.h>
#include <asm/pgalloc.h>
#include <asm/semaphore.h>
#include <asm/softirq.h>
#include <asm/uaccess.h>
#include <asm/checksum.h>
......
......@@ -6,12 +6,12 @@
#include <linux/timex.h>
#include <linux/sched.h>
#include <linux/cache.h>
#include <linux/interrupt.h>
#include <asm/atomic.h>
#include <asm/processor.h>
#include <asm/system.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/mmu_context.h>
#include <asm/irq.h>
......
......@@ -24,7 +24,6 @@
#include <asm/hardirq.h>
#include <asm/pgalloc.h>
#include <asm/mmu_context.h>
#include <asm/softirq.h>
#include <asm/system.h>
#include <asm/uaccess.h>
#include <asm/ptrace.h>
......
......@@ -28,7 +28,6 @@
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/smp.h>
......
......@@ -27,7 +27,6 @@
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/sections.h>
#include <asm/io.h>
#include <asm/prom.h>
......
......@@ -35,7 +35,6 @@
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/sections.h>
#include <asm/io.h>
#include <asm/prom.h>
......
......@@ -34,7 +34,6 @@
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/smp.h>
......
......@@ -6,10 +6,10 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/smp.h>
#include <linux/interrupt.h>
#include <asm/checksum.h>
#include <asm/delay.h>
#include <asm/setup.h>
#include <asm/softirq.h>
#if CONFIG_IP_MULTICAST
#include <net/arp.h>
#endif
......
......@@ -8,11 +8,11 @@
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/interrupt.h>
#include <asm/checksum.h>
#include <asm/delay.h>
#include <asm/pgalloc.h>
#include <asm/setup.h>
#include <asm/softirq.h>
#if CONFIG_IP_MULTICAST
#include <net/arp.h>
#endif
......
......@@ -45,7 +45,6 @@
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/pcic.h>
#include <asm/cacheflush.h>
......
......@@ -43,7 +43,6 @@
#include <asm/kdebug.h>
#include <asm/mbus.h>
#include <asm/idprom.h>
#include <asm/softirq.h>
#include <asm/hardirq.h>
#include <asm/machines.h>
......
......@@ -30,7 +30,6 @@
#include <asm/pgtable.h>
#include <asm/oplib.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#define __KERNEL_SYSCALLS__
#include <linux/unistd.h>
......
......@@ -40,7 +40,6 @@
#include <asm/smp.h>
#include <asm/mostek.h>
#include <asm/ptrace.h>
#include <asm/softirq.h>
#include <asm/hardirq.h>
#include <asm/user.h>
#include <asm/uaccess.h>
......
......@@ -29,7 +29,6 @@
#include <asm/pgtable.h>
#include <asm/oplib.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/sbus.h>
#include <asm/sbi.h>
......
......@@ -26,7 +26,6 @@
#include <asm/pgtable.h>
#include <asm/oplib.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#define __KERNEL_SYSCALLS__
#include <linux/unistd.h>
......
......@@ -33,7 +33,6 @@
#include <asm/timer.h>
#include <asm/smp.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/starfire.h>
#include <asm/uaccess.h>
#include <asm/cache.h>
......
......@@ -31,7 +31,6 @@
#include <asm/pgtable.h>
#include <asm/oplib.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/uaccess.h>
#include <asm/timer.h>
#include <asm/starfire.h>
......
......@@ -30,7 +30,6 @@
#include <asm/pgtable.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/softirq.h>
#include <asm/hardirq.h>
#include <asm/idprom.h>
#include <asm/svr4.h>
......
......@@ -18,7 +18,6 @@
#include "linux/interrupt.h"
#include "linux/slab.h"
#include "asm/current.h"
#include "asm/softirq.h"
#include "asm/hardirq.h"
#include "asm/irq.h"
#include "stdio_console.h"
......
......@@ -17,7 +17,6 @@ unsigned long cpu_online_map = 1;
#include "asm/smp.h"
#include "asm/processor.h"
#include "asm/spinlock.h"
#include "asm/softirq.h"
#include "asm/hardirq.h"
#include "user_util.h"
#include "kern_util.h"
......
......@@ -16,7 +16,6 @@
#include <asm/semaphore.h>
#include <asm/checksum.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/current.h>
......
......@@ -13,9 +13,9 @@
#define _CRYPTO_INTERNAL_H
#include <linux/mm.h>
#include <linux/highmem.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/kmap_types.h>
extern enum km_type crypto_km_types[];
......
#ifndef _ALPHA_SOFTIRQ_H
#define _ALPHA_SOFTIRQ_H
#include <linux/preempt.h>
#include <asm/hardirq.h>
#define local_bh_disable() \
do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
#define __local_bh_enable() \
do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
#define local_bh_enable() \
do { \
__local_bh_enable(); \
if (unlikely(!in_interrupt() && \
softirq_pending(smp_processor_id()))) \
do_softirq(); \
preempt_check_resched(); \
} while (0)
#endif /* _ALPHA_SOFTIRQ_H */
......@@ -5,7 +5,6 @@
#include <linux/cache.h>
#include <linux/threads.h>
/* softirq.h is sensitive to the offsets of these fields */
typedef struct {
unsigned int __softirq_pending;
unsigned int __local_irq_count;
......
#ifndef __ASM_SOFTIRQ_H
#define __ASM_SOFTIRQ_H
#include <linux/preempt.h>
#include <asm/hardirq.h>
#define local_bh_disable() \
do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
#define __local_bh_enable() \
do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
#define local_bh_enable() \
do { \
__local_bh_enable(); \
if (unlikely(!in_interrupt() && softirq_pending(smp_processor_id()))) \
__asm__("bl%? __do_softirq": : : "lr");/* out of line */\
preempt_check_resched(); \
} while (0)
#endif /* __ASM_SOFTIRQ_H */
#ifndef __ASM_SOFTIRQ_H
#define __ASM_SOFTIRQ_H
#include <asm/atomic.h>
#include <asm/hardirq.h>
#define local_bh_disable() \
do { \
local_bh_count(smp_processor_id())++; \
barrier(); \
} while (0)
#define __local_bh_enable() \
do { \
barrier(); \
local_bh_count(smp_processor_id())--; \
} while (0)
#define local_bh_enable() \
do { \
if (!--local_bh_count(smp_processor_id()) \
&& softirq_pending(smp_processor_id())) { \
do_softirq(); \
local_irq_enable(); \
} \
} while (0)
#define in_softirq() (local_bh_count(smp_processor_id()) != 0)
#endif /* __ASM_SOFTIRQ_H */
......@@ -5,7 +5,6 @@
#include <linux/threads.h>
#include <linux/irq.h>
/* assembly code in softirq.h is sensitive to the offsets of these fields */
typedef struct {
unsigned int __softirq_pending;
unsigned int __syscall_count;
......
#ifndef __ASM_SOFTIRQ_H
#define __ASM_SOFTIRQ_H
#include <linux/preempt.h>
#include <asm/hardirq.h>
#define local_bh_disable() \
do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
#define __local_bh_enable() \
do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
#define local_bh_enable() \
do { \
__local_bh_enable(); \
if (unlikely(!in_interrupt() && softirq_pending(smp_processor_id()))) \
do_softirq(); \
preempt_check_resched(); \
} while (0)
#endif /* __ASM_SOFTIRQ_H */
#ifndef _ASM_IA64_SOFTIRQ_H
#define _ASM_IA64_SOFTIRQ_H
#include <linux/compiler.h>
/*
* Copyright (C) 1998-2002 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
*/
#include <linux/compiler.h>
#include <linux/preempt.h>
#include <asm/hardirq.h>
#define __local_bh_enable() do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
#define local_bh_disable() do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
#define local_bh_enable() \
do { \
__local_bh_enable(); \
if (unlikely(!in_interrupt() && local_softirq_pending())) \
do_softirq(); \
preempt_check_resched(); \
} while (0)
#endif /* _ASM_IA64_SOFTIRQ_H */
#ifndef __M68K_SOFTIRQ_H
#define __M68K_SOFTIRQ_H
/*
* Software interrupts.. no SMP here either.
*/
#include <asm/atomic.h>
#include <asm/hardirq.h>
#define local_bh_disable() \
do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
#define __local_bh_enable() \
do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
#define local_bh_enable() \
do { \
__local_bh_enable(); \
if (unlikely(!in_interrupt() && softirq_pending(smp_processor_id()))) \
do_softirq(); \
preempt_check_resched(); \
} while (0)
#endif
#ifndef __ASM_SOFTIRQ_H
#define __ASM_SOFTIRQ_H
#include <linux/preempt.h>
#include <asm/hardirq.h>
#define local_bh_disable() \
do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
#define __local_bh_enable() \
do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
#define local_bh_enable() \
do { \
__local_bh_enable(); \
if (unlikely(!in_interrupt() && softirq_pending(smp_processor_id()))) \
do_softirq(); \
preempt_check_resched(); \
} while (0)
#endif /* __ASM_SOFTIRQ_H */
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1997, 1998, 1999, 2000, 2001 Ralf Baechle
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
* Copyright (C) 1999, 2001 MIPS Technologies, Inc.
*/
#ifndef _ASM_SOFTIRQ_H
#define _ASM_SOFTIRQ_H
#include <asm/atomic.h>
#include <asm/hardirq.h>
extern inline void cpu_bh_disable(int cpu)
{
local_bh_count(cpu)++;
barrier();
}
extern inline void __cpu_bh_enable(int cpu)
{
barrier();
local_bh_count(cpu)--;
}
#define local_bh_disable() cpu_bh_disable(smp_processor_id())
#define __local_bh_enable() __cpu_bh_enable(smp_processor_id())
#define local_bh_enable() \
do { \
int cpu; \
\
barrier(); \
cpu = smp_processor_id(); \
if (!--local_bh_count(cpu) && softirq_pending(cpu)) \
do_softirq(); \
} while (0)
#define in_softirq() (local_bh_count(smp_processor_id()) != 0)
#define __cpu_raise_softirq(cpu, nr) set_bit(nr, &softirq_pending(cpu))
#endif /* _ASM_SOFTIRQ_H */
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1997, 1998, 1999, 2000, 2001 by Ralf Baechle
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
* Copyright (C) 2001 MIPS Technologies, Inc.
*/
#ifndef _ASM_SOFTIRQ_H
#define _ASM_SOFTIRQ_H
#include <asm/atomic.h>
#include <asm/hardirq.h>
extern inline void cpu_bh_disable(int cpu)
{
local_bh_count(cpu)++;
barrier();
}
extern inline void __cpu_bh_enable(int cpu)
{
barrier();
local_bh_count(cpu)--;
}
#define local_bh_disable() cpu_bh_disable(smp_processor_id())
#define __local_bh_enable() __cpu_bh_enable(smp_processor_id())
#define local_bh_enable() \
do { \
int cpu; \
\
barrier(); \
cpu = smp_processor_id(); \
if (!--local_bh_count(cpu) && softirq_pending(cpu)) \
do_softirq(); \
} while (0)
#define in_softirq() (local_bh_count(smp_processor_id()) != 0)
extern inline void __cpu_raise_softirq(int cpu, int nr)
{
unsigned int *m = (unsigned int *) &softirq_pending(cpu);
unsigned int temp;
__asm__ __volatile__(
"1:\tll\t%0, %1\t\t\t# __cpu_raise_softirq\n\t"
"or\t%0, %2\n\t"
"sc\t%0, %1\n\t"
"beqz\t%0, 1b"
: "=&r" (temp), "=m" (*m)
: "ir" (1UL << nr), "m" (*m)
: "memory");
}
#endif /* _ASM_SOFTIRQ_H */
#ifndef __ASM_SOFTIRQ_H
#define __ASM_SOFTIRQ_H
#include <asm/atomic.h>
#include <asm/hardirq.h>
#define local_bh_disable() \
do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
#define __local_bh_enable() \
do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
#define local_bh_enable() \
do { \
__local_bh_enable(); \
if (unlikely(!in_interrupt() && softirq_pending(smp_processor_id()))) \
do_softirq(); \
preempt_check_resched(); \
} while (0)
#endif /* __ASM_SOFTIRQ_H */
#ifdef __KERNEL__
#ifndef __ASM_SOFTIRQ_H
#define __ASM_SOFTIRQ_H
#include <linux/preempt.h>
#include <asm/hardirq.h>
#define local_bh_disable() \
do { \
preempt_count() += SOFTIRQ_OFFSET; \
barrier(); \
} while (0)
#define __local_bh_enable() \
do { \
barrier(); \
preempt_count() -= SOFTIRQ_OFFSET; \
} while (0)
#define local_bh_enable() \
do { \
__local_bh_enable(); \
if (unlikely(!in_interrupt() \
&& softirq_pending(smp_processor_id()))) \
do_softirq(); \
if (preempt_count() == 0) \
preempt_check_resched(); \
} while (0)
#endif /* __ASM_SOFTIRQ_H */
#endif /* __KERNEL__ */
#ifndef __ASM_SOFTIRQ_H
#define __ASM_SOFTIRQ_H
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/preempt.h>
#include <asm/hardirq.h>
#define local_bh_disable() \
do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
#define __local_bh_enable() \
do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
#define local_bh_enable() \
do { \
__local_bh_enable(); \
if (unlikely(!in_interrupt() && softirq_pending(smp_processor_id()))) \
do_softirq(); \
preempt_check_resched(); \
} while (0)
#endif /* __ASM_SOFTIRQ_H */
/*
* include/asm-s390/softirq.h
*
* S390 version
*
* Derived from "include/asm-i386/softirq.h"
*/
#ifndef __ASM_SOFTIRQ_H
#define __ASM_SOFTIRQ_H
#include <linux/smp.h>
#include <linux/preempt.h>
#include <asm/atomic.h>
#include <asm/hardirq.h>
#include <asm/lowcore.h>
#define local_bh_disable() \
do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
#define __local_bh_enable() \
do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
extern void do_call_softirq(void);
#define local_bh_enable() \
do { \
__local_bh_enable(); \
if (!in_interrupt() && softirq_pending(smp_processor_id())) \
/* Use the async. stack for softirq */ \
do_call_softirq(); \
preempt_check_resched(); \
} while (0)
#endif /* __ASM_SOFTIRQ_H */
/*
* include/asm-s390/softirq.h
*
* S390 version
*
* Derived from "include/asm-i386/softirq.h"
*/
#ifndef __ASM_SOFTIRQ_H
#define __ASM_SOFTIRQ_H
#include <linux/smp.h>
#include <linux/preempt.h>
#include <asm/atomic.h>
#include <asm/hardirq.h>
#include <asm/lowcore.h>
#define local_bh_disable() \
do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
#define __local_bh_enable() \
do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
extern void do_call_softirq(void);
#define local_bh_enable() \
do { \
__local_bh_enable(); \
if (!in_interrupt() && softirq_pending(smp_processor_id())) \
/* Use the async. stack for softirq */ \
do_call_softirq(); \
preempt_check_resched(); \
} while (0)
#endif /* __ASM_SOFTIRQ_H */
#ifndef __ASM_SH_SOFTIRQ_H
#define __ASM_SH_SOFTIRQ_H
#include <asm/atomic.h>
#include <asm/hardirq.h>
#define local_bh_disable() \
do { \
local_bh_count(smp_processor_id())++; \
barrier(); \
} while (0)
#define __local_bh_enable() \
do { \
barrier(); \
local_bh_count(smp_processor_id())--; \
} while (0)
#define local_bh_enable() \
do { \
barrier(); \
if (!--local_bh_count(smp_processor_id()) \
&& softirq_pending(smp_processor_id())) { \
do_softirq(); \
} \
} while (0)
#define in_softirq() (local_bh_count(smp_processor_id()) != 0)
#endif /* __ASM_SH_SOFTIRQ_H */
/* softirq.h: 32-bit Sparc soft IRQ support.
*
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
* Copyright (C) 1998-99 Anton Blanchard (anton@progsoc.uts.edu.au)
*/
#ifndef __SPARC_SOFTIRQ_H
#define __SPARC_SOFTIRQ_H
// #include <linux/threads.h> /* For NR_CPUS */
// #include <asm/atomic.h>
#include <asm/smp.h>
#include <asm/hardirq.h>
#define local_bh_disable() \
do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
#define __local_bh_enable() \
do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
#define local_bh_enable() \
do { \
__local_bh_enable(); \
if (!in_interrupt() && \
softirq_pending(smp_processor_id())) { \
do_softirq(); \
} \
preempt_check_resched(); \
} while (0)
#endif /* __SPARC_SOFTIRQ_H */
/* softirq.h: 64-bit Sparc soft IRQ support.
*
* Copyright (C) 1997, 1998 David S. Miller (davem@caip.rutgers.edu)
*/
#ifndef __SPARC64_SOFTIRQ_H
#define __SPARC64_SOFTIRQ_H
#include <linux/preempt.h>
#include <asm/hardirq.h>
#include <asm/system.h> /* for membar() */
#define local_bh_disable() \
do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
#define __local_bh_enable() \
do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
#define local_bh_enable() \
do { __local_bh_enable(); \
if (unlikely(!in_interrupt() && \
softirq_pending(smp_processor_id()))) \
do_softirq(); \
preempt_check_resched(); \
} while (0)
#endif /* !(__SPARC64_SOFTIRQ_H) */
#ifndef __UM_SOFTIRQ_H
#define __UM_SOFTIRQ_H
#include "linux/smp.h"
#include "asm/system.h"
#include "asm/processor.h"
/* A gratuitous name change */
#define i386_bh_lock um_bh_lock
#include "asm/arch/softirq.h"
#undef i386_bh_lock
#endif
#ifndef __V850_SOFTIRQ_H__
#define __V850_SOFTIRQ_H__
#include <linux/preempt.h>
#include <asm/hardirq.h>
#define local_bh_disable() \
do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
#define __local_bh_enable() \
do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
#define local_bh_enable() \
do { \
__local_bh_enable(); \
if (unlikely(!in_interrupt() && softirq_pending(smp_processor_id()))) \
do_softirq(); \
preempt_check_resched(); \
} while (0)
#endif /* __V850_SOFTIRQ_H__ */
#ifndef __ASM_SOFTIRQ_H
#define __ASM_SOFTIRQ_H
#include <linux/preempt.h>
#include <asm/hardirq.h>
#define local_bh_disable() \
do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
#define __local_bh_enable() \
do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
void do_softirq(void);
#define local_bh_enable() \
do { \
__local_bh_enable(); \
if (unlikely(!in_interrupt() && softirq_pending(smp_processor_id()))) \
do_softirq(); \
preempt_check_resched(); \
} while (0)
#endif /* __ASM_SOFTIRQ_H */
......@@ -8,7 +8,6 @@
#include <asm/atomic.h>
#include <asm/hardirq.h>
#include <asm/ptrace.h>
#include <asm/softirq.h>
#include <asm/system.h>
struct irqaction {
......@@ -36,6 +35,13 @@ extern void free_irq(unsigned int, void *);
# define save_and_cli(x) local_irq_save(x)
#endif
/* SoftIRQ primitives. */
#define local_bh_disable() \
do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
#define __local_bh_enable() \
do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
extern void local_bh_enable(void);
/* PLEASE, avoid to allocate new softirqs, if you need not _really_ high
frequency threaded job scheduling. For almost all the purposes
......
......@@ -194,7 +194,6 @@ static inline int try_inc_mod_count(struct module *mod)
#define spin_unlock_bh(lock) do {spin_unlock(lock);end_bh_atomic();} while(0)
#else
#include <linux/interrupt.h>
#include <asm/softirq.h>
#include <linux/spinlock.h>
#endif
......
......@@ -6,6 +6,7 @@
* Rewritten. Old one was good in 2.2, but in 2.3 it was immoral. --ANK (990903)
*/
#include <linux/module.h>
#include <linux/kernel_stat.h>
#include <linux/interrupt.h>
#include <linux/notifier.h>
......@@ -100,6 +101,17 @@ asmlinkage void do_softirq()
local_irq_restore(flags);
}
void local_bh_enable(void)
{
__local_bh_enable();
BUG_ON(irqs_disabled());
if (unlikely(!in_interrupt() &&
softirq_pending(smp_processor_id())))
do_softirq();
preempt_check_resched();
}
EXPORT_SYMBOL(local_bh_enable);
/*
* This function must run with irqs disabled!
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment