ia64/xen-unstable

view xen/include/xen/softirq.h @ 19800:78962f85c562

IOMMU: Add two generic functions to vendor neutral interface

Add 2 generic functions into the vendor neutral iommu interface, The
reason is that from changeset 19732, there is only one global flag
"iommu_enabled" that controls iommu enablement for both vtd and amd
systems, so we need different code paths for vtd and amd iommu systems
if this flag has been turned on. Also, the early checking of
"iommu_enabled" in iommu_setup() is removed to prevent iommu
functionalities from been disabled on amd systems.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jun 19 08:41:50 2009 +0100 (2009-06-19)
parents 822ea2bf0c54
children
line source
1 #if !defined(__XEN_SOFTIRQ_H__) && !defined(__ASSEMBLY__)
2 #define __XEN_SOFTIRQ_H__
4 /* Low-latency softirqs come first in the following list. */
5 enum {
6 TIMER_SOFTIRQ = 0,
7 SCHEDULE_SOFTIRQ,
8 NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ,
9 PAGE_SCRUB_SOFTIRQ,
10 RCU_SOFTIRQ,
11 STOPMACHINE_SOFTIRQ,
12 TASKLET_SOFTIRQ,
13 NR_COMMON_SOFTIRQS
14 };
16 #include <xen/config.h>
17 #include <xen/lib.h>
18 #include <xen/smp.h>
19 #include <asm/bitops.h>
20 #include <asm/current.h>
21 #include <asm/hardirq.h>
22 #include <asm/softirq.h>
24 #define NR_SOFTIRQS (NR_COMMON_SOFTIRQS + NR_ARCH_SOFTIRQS)
26 typedef void (*softirq_handler)(void);
28 asmlinkage void do_softirq(void);
29 void open_softirq(int nr, softirq_handler handler);
30 void softirq_init(void);
32 static inline void cpumask_raise_softirq(cpumask_t mask, unsigned int nr)
33 {
34 int cpu;
36 for_each_cpu_mask(cpu, mask)
37 {
38 if ( test_and_set_bit(nr, &softirq_pending(cpu)) )
39 cpu_clear(cpu, mask);
40 }
42 smp_send_event_check_mask(&mask);
43 }
45 static inline void cpu_raise_softirq(unsigned int cpu, unsigned int nr)
46 {
47 if ( !test_and_set_bit(nr, &softirq_pending(cpu)) )
48 smp_send_event_check_cpu(cpu);
49 }
51 static inline void raise_softirq(unsigned int nr)
52 {
53 set_bit(nr, &softirq_pending(smp_processor_id()));
54 }
56 /*
57 * TASKLETS -- dynamically-allocatable tasks run in softirq context
58 * on at most one CPU at a time.
59 */
60 struct tasklet
61 {
62 struct list_head list;
63 bool_t is_scheduled;
64 bool_t is_running;
65 bool_t is_dead;
66 void (*func)(unsigned long);
67 unsigned long data;
68 };
70 #define DECLARE_TASKLET(name, func, data) \
71 struct tasklet name = { LIST_HEAD_INIT(name.list), 0, 0, 0, func, data }
73 void tasklet_schedule(struct tasklet *t);
74 void tasklet_kill(struct tasklet *t);
75 void tasklet_init(
76 struct tasklet *t, void (*func)(unsigned long), unsigned long data);
78 #endif /* __XEN_SOFTIRQ_H__ */