debuggers.hg

view xen/include/asm-x86/irq.h @ 22855:1d1eec7e1fb4

xl: Perform minimal validation of virtual disk file while parsing config file

This patch performs some very basic validation on the virtual disk
file passed through the config file. This validation ensures that we
don't go too far with the initialization like spawn qemu and more
while there could be some potentially fundamental issues.

[ Patch fixed up to work with PHYSTYPE_EMPTY 22808:6ec61438713a -iwj ]

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Kamala Narasimhan <kamala.narasimhan@gmail.com>
date Tue Jan 25 18:09:49 2011 +0000 (2011-01-25)
parents e8acb9753ff1
children
line source
1 #ifndef _ASM_HW_IRQ_H
2 #define _ASM_HW_IRQ_H
4 /* (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar */
6 #include <xen/config.h>
7 #include <asm/atomic.h>
8 #include <xen/cpumask.h>
9 #include <xen/smp.h>
10 #include <irq_vectors.h>
11 #include <asm/percpu.h>
13 #define IO_APIC_IRQ(irq) (platform_legacy_irq(irq) ? \
14 (1 << (irq)) & io_apic_irqs : \
15 (irq) < nr_irqs_gsi)
16 #define IO_APIC_VECTOR(irq) (irq_vector[irq])
18 #define MSI_IRQ(irq) ((irq) >= nr_irqs_gsi && (irq) < nr_irqs)
20 #define LEGACY_VECTOR(irq) ((irq) + FIRST_LEGACY_VECTOR)
21 #define LEGACY_IRQ_FROM_VECTOR(vec) ((vec) - FIRST_LEGACY_VECTOR)
23 #define irq_to_desc(irq) (&irq_desc[irq])
24 #define irq_cfg(irq) (&irq_cfg[irq])
26 struct irq_cfg {
27 int vector;
28 cpumask_t cpu_mask;
29 cpumask_t old_cpu_mask;
30 unsigned move_cleanup_count;
31 u8 move_in_progress : 1;
32 };
34 extern struct irq_cfg *irq_cfg;
36 typedef int vector_irq_t[NR_VECTORS];
37 DECLARE_PER_CPU(vector_irq_t, vector_irq);
39 extern u8 *irq_vector;
41 extern bool_t opt_noirqbalance;
43 /*
44 * Per-cpu current frame pointer - the location of the last exception frame on
45 * the stack
46 */
47 DECLARE_PER_CPU(struct cpu_user_regs *, __irq_regs);
49 static inline struct cpu_user_regs *get_irq_regs(void)
50 {
51 return __get_cpu_var(__irq_regs);
52 }
54 static inline struct cpu_user_regs *set_irq_regs(struct cpu_user_regs *new_regs)
55 {
56 struct cpu_user_regs *old_regs, **pp_regs = &__get_cpu_var(__irq_regs);
58 old_regs = *pp_regs;
59 *pp_regs = new_regs;
60 return old_regs;
61 }
64 #define platform_legacy_irq(irq) ((irq) < 16)
66 fastcall void event_check_interrupt(void);
67 fastcall void invalidate_interrupt(void);
68 fastcall void call_function_interrupt(void);
69 fastcall void apic_timer_interrupt(void);
70 fastcall void error_interrupt(void);
71 fastcall void pmu_apic_interrupt(void);
72 fastcall void spurious_interrupt(void);
73 fastcall void thermal_interrupt(void);
74 fastcall void cmci_interrupt(void);
75 fastcall void irq_move_cleanup_interrupt(void);
77 fastcall void smp_event_check_interrupt(struct cpu_user_regs *regs);
78 fastcall void smp_invalidate_interrupt(void);
79 fastcall void smp_call_function_interrupt(struct cpu_user_regs *regs);
80 fastcall void smp_apic_timer_interrupt(struct cpu_user_regs *regs);
81 fastcall void smp_error_interrupt(struct cpu_user_regs *regs);
82 fastcall void smp_pmu_apic_interrupt(struct cpu_user_regs *regs);
83 fastcall void smp_spurious_interrupt(struct cpu_user_regs *regs);
84 fastcall void smp_thermal_interrupt(struct cpu_user_regs *regs);
85 fastcall void smp_cmci_interrupt(struct cpu_user_regs *regs);
86 fastcall void smp_irq_move_cleanup_interrupt(struct cpu_user_regs *regs);
88 asmlinkage void do_IRQ(struct cpu_user_regs *regs);
90 void disable_8259A_irq(unsigned int irq);
91 void enable_8259A_irq(unsigned int irq);
92 int i8259A_irq_pending(unsigned int irq);
93 void mask_8259A(void);
94 void unmask_8259A(void);
95 void init_8259A(int aeoi);
96 void make_8259A_irq(unsigned int irq);
97 int i8259A_suspend(void);
98 int i8259A_resume(void);
100 void setup_IO_APIC(void);
101 void disable_IO_APIC(void);
102 void print_IO_APIC(void);
103 void setup_ioapic_dest(void);
105 extern unsigned long io_apic_irqs;
107 DECLARE_PER_CPU(unsigned int, irq_count);
109 int pirq_shared(struct domain *d , int irq);
111 int map_domain_pirq(struct domain *d, int pirq, int irq, int type,
112 void *data);
113 int unmap_domain_pirq(struct domain *d, int pirq);
114 int get_free_pirq(struct domain *d, int type, int index);
115 void free_domain_pirqs(struct domain *d);
116 int map_domain_emuirq_pirq(struct domain *d, int pirq, int irq);
117 int unmap_domain_pirq_emuirq(struct domain *d, int pirq);
118 int hvm_domain_use_pirq(struct domain *d, int irq);
120 int init_irq_data(void);
122 void clear_irq_vector(int irq);
124 int irq_to_vector(int irq);
125 int create_irq(void);
126 void destroy_irq(unsigned int irq);
128 struct irq_desc;
129 extern void irq_complete_move(struct irq_desc **descp);
131 extern struct irq_desc *irq_desc;
133 void lock_vector_lock(void);
134 void unlock_vector_lock(void);
136 void __setup_vector_irq(int cpu);
138 void move_native_irq(int irq);
139 void move_masked_irq(int irq);
141 int __assign_irq_vector(int irq, struct irq_cfg *, const cpumask_t *);
143 int bind_irq_vector(int irq, int vector, cpumask_t domain);
145 void irq_set_affinity(struct irq_desc *, const cpumask_t *mask);
147 #define domain_pirq_to_irq(d, pirq) ((d)->arch.pirq_irq[pirq])
148 #define domain_irq_to_pirq(d, irq) ((d)->arch.irq_pirq[irq])
149 #define PIRQ_ALLOCATED -1
150 #define domain_pirq_to_emuirq(d, pirq) ((d)->arch.pirq_emuirq[pirq])
151 #define domain_emuirq_to_pirq(d, emuirq) ((d)->arch.emuirq_pirq[emuirq])
152 #define IRQ_UNBOUND -1
153 #define IRQ_PT -2
155 bool_t cpu_has_pending_apic_eoi(void);
157 #endif /* _ASM_HW_IRQ_H */