ia64/xen-unstable

view xen/common/softirq.c @ 15647:cc48264ed647

Merge
author Tim Deegan <Tim.Deegan@xensource.com>
date Tue Jul 24 14:53:06 2007 +0100 (2007-07-24)
parents 32fd32bbf78d
children 96b099ad0497
line source
1 /******************************************************************************
2 * common/softirq.c
3 *
4 * Softirqs in Xen are only executed in an outermost activation (e.g., never
5 * within an interrupt activation). This simplifies some things and generally
6 * seems a good thing.
7 *
8 * Copyright (c) 2003, K A Fraser
9 * Copyright (c) 1992, Linus Torvalds
10 */
12 #include <xen/config.h>
13 #include <xen/init.h>
14 #include <xen/mm.h>
15 #include <xen/sched.h>
16 #include <xen/rcupdate.h>
17 #include <xen/softirq.h>
19 #ifndef __ARCH_IRQ_STAT
20 irq_cpustat_t irq_stat[NR_CPUS];
21 #endif
23 static softirq_handler softirq_handlers[NR_SOFTIRQS];
25 asmlinkage void do_softirq(void)
26 {
27 unsigned int i, cpu;
28 unsigned long pending;
30 for ( ; ; )
31 {
32 /*
33 * Initialise @cpu on every iteration: SCHEDULE_SOFTIRQ may move
34 * us to another processor.
35 */
36 cpu = smp_processor_id();
38 if ( rcu_pending(cpu) )
39 rcu_check_callbacks(cpu);
41 if ( (pending = softirq_pending(cpu)) == 0 )
42 break;
44 i = find_first_set_bit(pending);
45 clear_bit(i, &softirq_pending(cpu));
46 (*softirq_handlers[i])();
47 }
48 }
50 void open_softirq(int nr, softirq_handler handler)
51 {
52 softirq_handlers[nr] = handler;
53 }
55 /*
56 * Local variables:
57 * mode: C
58 * c-set-style: "BSD"
59 * c-basic-offset: 4
60 * tab-width: 4
61 * indent-tabs-mode: nil
62 * End:
63 */