debuggers.hg

view xen/common/softirq.c @ 3726:88957a238191

bitkeeper revision 1.1159.1.544 (4207248crq3YxiyLWjUehtHv_Yd3tg)

Merge tempest.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xeno.bk
into tempest.cl.cam.ac.uk:/local/scratch/smh22/xen-unstable.bk
author smh22@tempest.cl.cam.ac.uk
date Mon Feb 07 08:19:24 2005 +0000 (2005-02-07)
parents bb56e77896e7 4294cfa9fad3
children 0a4b76b6b5a0
line source
1 /* -*- Mode:C; c-basic-offset:4; tab-width:4; indent-tabs-mode:nil -*- */
2 /******************************************************************************
3 * common/softirq.c
4 *
5 * Softirqs in Xen are only executed in an outermost activation (e.g., never
6 * within an interrupt activation). This simplifies some things and generally
7 * seems a good thing.
8 *
9 * Copyright (c) 2003, K A Fraser
10 * Copyright (c) 1992, Linus Torvalds
11 */
13 #include <xen/config.h>
14 #include <xen/init.h>
15 #include <xen/mm.h>
16 #include <xen/sched.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()
26 {
27 unsigned int i, pending, cpu = smp_processor_id();
29 pending = softirq_pending(cpu);
30 ASSERT(pending != 0);
32 do {
33 i = find_first_set_bit(pending);
34 clear_bit(i, &softirq_pending(cpu));
35 (*softirq_handlers[i])();
36 } while ( (pending = softirq_pending(cpu)) != 0 );
37 }
39 void open_softirq(int nr, softirq_handler handler)
40 {
41 softirq_handlers[nr] = handler;
42 }