Commit 9da7dc4e authored by Linus Torvalds's avatar Linus Torvalds Committed by Linus Torvalds

Merge bk://kernel.bkbits.net/davem/softirq-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 4ff1af27 23aafe08
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/checksum.h> #include <asm/checksum.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <asm/softirq.h>
#include <asm/fpu.h> #include <asm/fpu.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/machvec.h> #include <asm/machvec.h>
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include <asm/semaphore.h> #include <asm/semaphore.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/current.h> #include <asm/current.h>
#include <asm/sn/sv.h> #include <asm/sn/sv.h>
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <asm/semaphore.h> #include <asm/semaphore.h>
#include <asm/checksum.h> #include <asm/checksum.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/softirq.h>
asmlinkage long long __ashldi3 (long long, int); asmlinkage long long __ashldi3 (long long, int);
asmlinkage long long __ashrdi3 (long long, int); asmlinkage long long __ashrdi3 (long long, int);
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <asm/semaphore.h> #include <asm/semaphore.h>
#include <asm/checksum.h> #include <asm/checksum.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/current.h> #include <asm/current.h>
extern void dump_thread(struct pt_regs *, struct user *); extern void dump_thread(struct pt_regs *, struct user *);
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/semaphore.h> #include <asm/semaphore.h>
#include <asm/sgi/sgihpc.h> #include <asm/sgi/sgihpc.h>
#include <asm/softirq.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#ifdef CONFIG_BLK_DEV_FD #ifdef CONFIG_BLK_DEV_FD
#include <asm/floppy.h> #include <asm/floppy.h>
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/delay.h> #include <asm/delay.h>
#include <asm/smp.h> #include <asm/smp.h>
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/softirq.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <asm/page.h> #include <asm/page.h>
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/semaphore.h> #include <asm/semaphore.h>
#include <asm/softirq.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/checksum.h> #include <asm/checksum.h>
......
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
#include <linux/timex.h> #include <linux/timex.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/cache.h> #include <linux/cache.h>
#include <linux/interrupt.h>
#include <asm/atomic.h> #include <asm/atomic.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/irq.h> #include <asm/irq.h>
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/softirq.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <asm/page.h> #include <asm/page.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/smp.h> #include <asm/smp.h>
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <asm/page.h> #include <asm/page.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/prom.h> #include <asm/prom.h>
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include <asm/page.h> #include <asm/page.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/prom.h> #include <asm/prom.h>
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include <asm/page.h> #include <asm/page.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/smp.h> #include <asm/smp.h>
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/interrupt.h>
#include <asm/checksum.h> #include <asm/checksum.h>
#include <asm/delay.h> #include <asm/delay.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/softirq.h>
#if CONFIG_IP_MULTICAST #if CONFIG_IP_MULTICAST
#include <net/arp.h> #include <net/arp.h>
#endif #endif
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/interrupt.h>
#include <asm/checksum.h> #include <asm/checksum.h>
#include <asm/delay.h> #include <asm/delay.h>
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/softirq.h>
#if CONFIG_IP_MULTICAST #if CONFIG_IP_MULTICAST
#include <net/arp.h> #include <net/arp.h>
#endif #endif
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/pcic.h> #include <asm/pcic.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include <asm/kdebug.h> #include <asm/kdebug.h>
#include <asm/mbus.h> #include <asm/mbus.h>
#include <asm/idprom.h> #include <asm/idprom.h>
#include <asm/softirq.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/machines.h> #include <asm/machines.h>
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/oplib.h> #include <asm/oplib.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/softirq.h>
#define __KERNEL_SYSCALLS__ #define __KERNEL_SYSCALLS__
#include <linux/unistd.h> #include <linux/unistd.h>
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#include <asm/smp.h> #include <asm/smp.h>
#include <asm/mostek.h> #include <asm/mostek.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <asm/softirq.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/user.h> #include <asm/user.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/oplib.h> #include <asm/oplib.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/sbus.h> #include <asm/sbus.h>
#include <asm/sbi.h> #include <asm/sbi.h>
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/oplib.h> #include <asm/oplib.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/softirq.h>
#define __KERNEL_SYSCALLS__ #define __KERNEL_SYSCALLS__
#include <linux/unistd.h> #include <linux/unistd.h>
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <asm/timer.h> #include <asm/timer.h>
#include <asm/smp.h> #include <asm/smp.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/starfire.h> #include <asm/starfire.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/cache.h> #include <asm/cache.h>
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/oplib.h> #include <asm/oplib.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/timer.h> #include <asm/timer.h>
#include <asm/starfire.h> #include <asm/starfire.h>
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/softirq.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/idprom.h> #include <asm/idprom.h>
#include <asm/svr4.h> #include <asm/svr4.h>
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "linux/interrupt.h" #include "linux/interrupt.h"
#include "linux/slab.h" #include "linux/slab.h"
#include "asm/current.h" #include "asm/current.h"
#include "asm/softirq.h"
#include "asm/hardirq.h" #include "asm/hardirq.h"
#include "asm/irq.h" #include "asm/irq.h"
#include "stdio_console.h" #include "stdio_console.h"
......
...@@ -17,7 +17,6 @@ unsigned long cpu_online_map = 1; ...@@ -17,7 +17,6 @@ unsigned long cpu_online_map = 1;
#include "asm/smp.h" #include "asm/smp.h"
#include "asm/processor.h" #include "asm/processor.h"
#include "asm/spinlock.h" #include "asm/spinlock.h"
#include "asm/softirq.h"
#include "asm/hardirq.h" #include "asm/hardirq.h"
#include "user_util.h" #include "user_util.h"
#include "kern_util.h" #include "kern_util.h"
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include <asm/semaphore.h> #include <asm/semaphore.h>
#include <asm/checksum.h> #include <asm/checksum.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/current.h> #include <asm/current.h>
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
#define _CRYPTO_INTERNAL_H #define _CRYPTO_INTERNAL_H
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/kmap_types.h> #include <asm/kmap_types.h>
extern enum km_type crypto_km_types[]; 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 @@ ...@@ -5,7 +5,6 @@
#include <linux/cache.h> #include <linux/cache.h>
#include <linux/threads.h> #include <linux/threads.h>
/* softirq.h is sensitive to the offsets of these fields */
typedef struct { typedef struct {
unsigned int __softirq_pending; unsigned int __softirq_pending;
unsigned int __local_irq_count; 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 @@ ...@@ -5,7 +5,6 @@
#include <linux/threads.h> #include <linux/threads.h>
#include <linux/irq.h> #include <linux/irq.h>
/* assembly code in softirq.h is sensitive to the offsets of these fields */
typedef struct { typedef struct {
unsigned int __softirq_pending; unsigned int __softirq_pending;
unsigned int __syscall_count; 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 */
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/preempt.h>
#include <asm/atomic.h> #include <asm/atomic.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <asm/softirq.h>
#include <asm/system.h> #include <asm/system.h>
struct irqaction { struct irqaction {
...@@ -36,6 +36,13 @@ extern void free_irq(unsigned int, void *); ...@@ -36,6 +36,13 @@ extern void free_irq(unsigned int, void *);
# define save_and_cli(x) local_irq_save(x) # define save_and_cli(x) local_irq_save(x)
#endif #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 /* PLEASE, avoid to allocate new softirqs, if you need not _really_ high
frequency threaded job scheduling. For almost all the purposes frequency threaded job scheduling. For almost all the purposes
......
...@@ -29,6 +29,7 @@ extern irq_cpustat_t irq_stat[]; /* defined in asm/hardirq.h */ ...@@ -29,6 +29,7 @@ extern irq_cpustat_t irq_stat[]; /* defined in asm/hardirq.h */
/* arch independent irq_stat fields */ /* arch independent irq_stat fields */
#define softirq_pending(cpu) __IRQ_STAT((cpu), __softirq_pending) #define softirq_pending(cpu) __IRQ_STAT((cpu), __softirq_pending)
#define local_softirq_pending() softirq_pending(smp_processor_id())
#define syscall_count(cpu) __IRQ_STAT((cpu), __syscall_count) #define syscall_count(cpu) __IRQ_STAT((cpu), __syscall_count)
#define ksoftirqd_task(cpu) __IRQ_STAT((cpu), __ksoftirqd_task) #define ksoftirqd_task(cpu) __IRQ_STAT((cpu), __ksoftirqd_task)
/* arch dependent irq_stat fields */ /* arch dependent irq_stat fields */
......
...@@ -194,7 +194,6 @@ static inline int try_inc_mod_count(struct module *mod) ...@@ -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) #define spin_unlock_bh(lock) do {spin_unlock(lock);end_bh_atomic();} while(0)
#else #else
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <asm/softirq.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#endif #endif
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
* Rewritten. Old one was good in 2.2, but in 2.3 it was immoral. --ANK (990903) * 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/kernel_stat.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/notifier.h> #include <linux/notifier.h>
...@@ -55,15 +56,13 @@ asmlinkage void do_softirq() ...@@ -55,15 +56,13 @@ asmlinkage void do_softirq()
__u32 pending; __u32 pending;
unsigned long flags; unsigned long flags;
__u32 mask; __u32 mask;
int cpu;
if (in_interrupt()) if (in_interrupt())
return; return;
local_irq_save(flags); local_irq_save(flags);
cpu = smp_processor_id();
pending = softirq_pending(cpu); pending = local_softirq_pending();
if (pending) { if (pending) {
struct softirq_action *h; struct softirq_action *h;
...@@ -72,7 +71,7 @@ asmlinkage void do_softirq() ...@@ -72,7 +71,7 @@ asmlinkage void do_softirq()
local_bh_disable(); local_bh_disable();
restart: restart:
/* Reset the pending bitmask before enabling irqs */ /* Reset the pending bitmask before enabling irqs */
softirq_pending(cpu) = 0; local_softirq_pending() = 0;
local_irq_enable(); local_irq_enable();
...@@ -87,19 +86,30 @@ asmlinkage void do_softirq() ...@@ -87,19 +86,30 @@ asmlinkage void do_softirq()
local_irq_disable(); local_irq_disable();
pending = softirq_pending(cpu); pending = local_softirq_pending();
if (pending & mask) { if (pending & mask) {
mask &= ~pending; mask &= ~pending;
goto restart; goto restart;
} }
if (pending) if (pending)
wakeup_softirqd(cpu); wakeup_softirqd(smp_processor_id());
__local_bh_enable(); __local_bh_enable();
} }
local_irq_restore(flags); local_irq_restore(flags);
} }
void local_bh_enable(void)
{
__local_bh_enable();
BUG_ON(irqs_disabled());
if (unlikely(!in_interrupt() &&
local_softirq_pending()))
do_softirq();
preempt_check_resched();
}
EXPORT_SYMBOL(local_bh_enable);
/* /*
* This function must run with irqs disabled! * This function must run with irqs disabled!
*/ */
...@@ -314,12 +324,12 @@ static int ksoftirqd(void * __bind_cpu) ...@@ -314,12 +324,12 @@ static int ksoftirqd(void * __bind_cpu)
ksoftirqd_task(cpu) = current; ksoftirqd_task(cpu) = current;
for (;;) { for (;;) {
if (!softirq_pending(cpu)) if (!local_softirq_pending())
schedule(); schedule();
__set_current_state(TASK_RUNNING); __set_current_state(TASK_RUNNING);
while (softirq_pending(cpu)) { while (local_softirq_pending()) {
do_softirq(); do_softirq();
cond_resched(); cond_resched();
} }
......
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