ia64/xen-unstable

view xen/common/softirq.c @ 12390:e28beea6d228

[IA64] Fix time services of EFI emulation

This patch serializes the execution of following efi.runtimes.
- GetTime
- SetTime
- GetWakeTime
- SetWakeTime

Linux/ia64 uses similar spinlocks in the EFI RTC driver.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author awilliam@xenbuild.aw
date Fri Nov 10 12:03:19 2006 -0700 (2006-11-10)
parents 53f552ad4042
children 32fd32bbf78d
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/softirq.h>
18 #ifndef __ARCH_IRQ_STAT
19 irq_cpustat_t irq_stat[NR_CPUS];
20 #endif
22 static softirq_handler softirq_handlers[NR_SOFTIRQS];
24 asmlinkage void do_softirq(void)
25 {
26 unsigned int i, cpu;
27 unsigned long pending;
29 for ( ; ; )
30 {
31 /*
32 * Initialise @cpu on every iteration: SCHEDULE_SOFTIRQ may move
33 * us to another processor.
34 */
35 cpu = smp_processor_id();
36 if ( (pending = softirq_pending(cpu)) == 0 )
37 break;
39 i = find_first_set_bit(pending);
40 clear_bit(i, &softirq_pending(cpu));
41 (*softirq_handlers[i])();
42 }
43 }
45 void open_softirq(int nr, softirq_handler handler)
46 {
47 softirq_handlers[nr] = handler;
48 }
50 /*
51 * Local variables:
52 * mode: C
53 * c-set-style: "BSD"
54 * c-basic-offset: 4
55 * tab-width: 4
56 * indent-tabs-mode: nil
57 * End:
58 */