aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dmar.h1
-rw-r--r--include/linux/efi.h4
-rw-r--r--include/linux/interrupt.h1
-rw-r--r--include/linux/irq.h56
-rw-r--r--include/linux/irqnr.h24
-rw-r--r--include/linux/kernel_stat.h20
-rw-r--r--include/linux/pci.h2
7 files changed, 78 insertions, 30 deletions
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index c360c558e59e..f1984fc3e06d 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -45,7 +45,6 @@ extern struct list_head dmar_drhd_units;
45 list_for_each_entry(drhd, &dmar_drhd_units, list) 45 list_for_each_entry(drhd, &dmar_drhd_units, list)
46 46
47extern int dmar_table_init(void); 47extern int dmar_table_init(void);
48extern int early_dmar_detect(void);
49extern int dmar_dev_scope_init(void); 48extern int dmar_dev_scope_init(void);
50 49
51/* Intel IOMMU detection */ 50/* Intel IOMMU detection */
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 807373d467f7..bb66feb164bd 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -208,6 +208,9 @@ typedef efi_status_t efi_set_virtual_address_map_t (unsigned long memory_map_siz
208#define EFI_GLOBAL_VARIABLE_GUID \ 208#define EFI_GLOBAL_VARIABLE_GUID \
209 EFI_GUID( 0x8be4df61, 0x93ca, 0x11d2, 0xaa, 0x0d, 0x00, 0xe0, 0x98, 0x03, 0x2b, 0x8c ) 209 EFI_GUID( 0x8be4df61, 0x93ca, 0x11d2, 0xaa, 0x0d, 0x00, 0xe0, 0x98, 0x03, 0x2b, 0x8c )
210 210
211#define UV_SYSTEM_TABLE_GUID \
212 EFI_GUID( 0x3b13a7d4, 0x633e, 0x11dd, 0x93, 0xec, 0xda, 0x25, 0x56, 0xd8, 0x95, 0x93 )
213
211typedef struct { 214typedef struct {
212 efi_guid_t guid; 215 efi_guid_t guid;
213 unsigned long table; 216 unsigned long table;
@@ -255,6 +258,7 @@ extern struct efi {
255 unsigned long boot_info; /* boot info table */ 258 unsigned long boot_info; /* boot info table */
256 unsigned long hcdp; /* HCDP table */ 259 unsigned long hcdp; /* HCDP table */
257 unsigned long uga; /* UGA table */ 260 unsigned long uga; /* UGA table */
261 unsigned long uv_systab; /* UV system table */
258 efi_get_time_t *get_time; 262 efi_get_time_t *get_time;
259 efi_set_time_t *set_time; 263 efi_set_time_t *set_time;
260 efi_get_wakeup_time_t *get_wakeup_time; 264 efi_get_wakeup_time_t *get_wakeup_time;
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 35a61dc60d51..f58a0cf8929a 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -8,6 +8,7 @@
8#include <linux/preempt.h> 8#include <linux/preempt.h>
9#include <linux/cpumask.h> 9#include <linux/cpumask.h>
10#include <linux/irqreturn.h> 10#include <linux/irqreturn.h>
11#include <linux/irqnr.h>
11#include <linux/hardirq.h> 12#include <linux/hardirq.h>
12#include <linux/sched.h> 13#include <linux/sched.h>
13#include <linux/irqflags.h> 14#include <linux/irqflags.h>
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 8d9411bc60f6..d058c57be02d 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -18,6 +18,7 @@
18#include <linux/spinlock.h> 18#include <linux/spinlock.h>
19#include <linux/cpumask.h> 19#include <linux/cpumask.h>
20#include <linux/irqreturn.h> 20#include <linux/irqreturn.h>
21#include <linux/irqnr.h>
21#include <linux/errno.h> 22#include <linux/errno.h>
22 23
23#include <asm/irq.h> 24#include <asm/irq.h>
@@ -152,6 +153,7 @@ struct irq_chip {
152 * @name: flow handler name for /proc/interrupts output 153 * @name: flow handler name for /proc/interrupts output
153 */ 154 */
154struct irq_desc { 155struct irq_desc {
156 unsigned int irq;
155 irq_flow_handler_t handle_irq; 157 irq_flow_handler_t handle_irq;
156 struct irq_chip *chip; 158 struct irq_chip *chip;
157 struct msi_desc *msi_desc; 159 struct msi_desc *msi_desc;
@@ -170,7 +172,7 @@ struct irq_desc {
170 cpumask_t affinity; 172 cpumask_t affinity;
171 unsigned int cpu; 173 unsigned int cpu;
172#endif 174#endif
173#if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) 175#ifdef CONFIG_GENERIC_PENDING_IRQ
174 cpumask_t pending_mask; 176 cpumask_t pending_mask;
175#endif 177#endif
176#ifdef CONFIG_PROC_FS 178#ifdef CONFIG_PROC_FS
@@ -179,8 +181,14 @@ struct irq_desc {
179 const char *name; 181 const char *name;
180} ____cacheline_internodealigned_in_smp; 182} ____cacheline_internodealigned_in_smp;
181 183
184
182extern struct irq_desc irq_desc[NR_IRQS]; 185extern struct irq_desc irq_desc[NR_IRQS];
183 186
187static inline struct irq_desc *irq_to_desc(unsigned int irq)
188{
189 return (irq < nr_irqs) ? irq_desc + irq : NULL;
190}
191
184/* 192/*
185 * Migration helpers for obsolete names, they will go away: 193 * Migration helpers for obsolete names, they will go away:
186 */ 194 */
@@ -198,19 +206,15 @@ extern int setup_irq(unsigned int irq, struct irqaction *new);
198 206
199#ifdef CONFIG_GENERIC_HARDIRQS 207#ifdef CONFIG_GENERIC_HARDIRQS
200 208
201#ifndef handle_dynamic_tick
202# define handle_dynamic_tick(a) do { } while (0)
203#endif
204
205#ifdef CONFIG_SMP 209#ifdef CONFIG_SMP
206 210
207#if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) 211#ifdef CONFIG_GENERIC_PENDING_IRQ
208 212
209void set_pending_irq(unsigned int irq, cpumask_t mask); 213void set_pending_irq(unsigned int irq, cpumask_t mask);
210void move_native_irq(int irq); 214void move_native_irq(int irq);
211void move_masked_irq(int irq); 215void move_masked_irq(int irq);
212 216
213#else /* CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE */ 217#else /* CONFIG_GENERIC_PENDING_IRQ */
214 218
215static inline void move_irq(int irq) 219static inline void move_irq(int irq)
216{ 220{
@@ -237,19 +241,14 @@ static inline void set_pending_irq(unsigned int irq, cpumask_t mask)
237 241
238#endif /* CONFIG_SMP */ 242#endif /* CONFIG_SMP */
239 243
240#ifdef CONFIG_IRQBALANCE
241extern void set_balance_irq_affinity(unsigned int irq, cpumask_t mask);
242#else
243static inline void set_balance_irq_affinity(unsigned int irq, cpumask_t mask)
244{
245}
246#endif
247
248extern int no_irq_affinity; 244extern int no_irq_affinity;
249 245
250static inline int irq_balancing_disabled(unsigned int irq) 246static inline int irq_balancing_disabled(unsigned int irq)
251{ 247{
252 return irq_desc[irq].status & IRQ_NO_BALANCING_MASK; 248 struct irq_desc *desc;
249
250 desc = irq_to_desc(irq);
251 return desc->status & IRQ_NO_BALANCING_MASK;
253} 252}
254 253
255/* Handle irq action chains: */ 254/* Handle irq action chains: */
@@ -279,10 +278,8 @@ extern unsigned int __do_IRQ(unsigned int irq);
279 * irqchip-style controller then we call the ->handle_irq() handler, 278 * irqchip-style controller then we call the ->handle_irq() handler,
280 * and it calls __do_IRQ() if it's attached to an irqtype-style controller. 279 * and it calls __do_IRQ() if it's attached to an irqtype-style controller.
281 */ 280 */
282static inline void generic_handle_irq(unsigned int irq) 281static inline void generic_handle_irq_desc(unsigned int irq, struct irq_desc *desc)
283{ 282{
284 struct irq_desc *desc = irq_desc + irq;
285
286#ifdef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ 283#ifdef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ
287 desc->handle_irq(irq, desc); 284 desc->handle_irq(irq, desc);
288#else 285#else
@@ -293,6 +290,11 @@ static inline void generic_handle_irq(unsigned int irq)
293#endif 290#endif
294} 291}
295 292
293static inline void generic_handle_irq(unsigned int irq)
294{
295 generic_handle_irq_desc(irq, irq_to_desc(irq));
296}
297
296/* Handling of unhandled and spurious interrupts: */ 298/* Handling of unhandled and spurious interrupts: */
297extern void note_interrupt(unsigned int irq, struct irq_desc *desc, 299extern void note_interrupt(unsigned int irq, struct irq_desc *desc,
298 int action_ret); 300 int action_ret);
@@ -325,7 +327,10 @@ __set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
325static inline void __set_irq_handler_unlocked(int irq, 327static inline void __set_irq_handler_unlocked(int irq,
326 irq_flow_handler_t handler) 328 irq_flow_handler_t handler)
327{ 329{
328 irq_desc[irq].handle_irq = handler; 330 struct irq_desc *desc;
331
332 desc = irq_to_desc(irq);
333 desc->handle_irq = handler;
329} 334}
330 335
331/* 336/*
@@ -353,13 +358,14 @@ extern void set_irq_noprobe(unsigned int irq);
353extern void set_irq_probe(unsigned int irq); 358extern void set_irq_probe(unsigned int irq);
354 359
355/* Handle dynamic irq creation and destruction */ 360/* Handle dynamic irq creation and destruction */
361extern unsigned int create_irq_nr(unsigned int irq_want);
356extern int create_irq(void); 362extern int create_irq(void);
357extern void destroy_irq(unsigned int irq); 363extern void destroy_irq(unsigned int irq);
358 364
359/* Test to see if a driver has successfully requested an irq */ 365/* Test to see if a driver has successfully requested an irq */
360static inline int irq_has_action(unsigned int irq) 366static inline int irq_has_action(unsigned int irq)
361{ 367{
362 struct irq_desc *desc = irq_desc + irq; 368 struct irq_desc *desc = irq_to_desc(irq);
363 return desc->action != NULL; 369 return desc->action != NULL;
364} 370}
365 371
@@ -374,10 +380,10 @@ extern int set_irq_chip_data(unsigned int irq, void *data);
374extern int set_irq_type(unsigned int irq, unsigned int type); 380extern int set_irq_type(unsigned int irq, unsigned int type);
375extern int set_irq_msi(unsigned int irq, struct msi_desc *entry); 381extern int set_irq_msi(unsigned int irq, struct msi_desc *entry);
376 382
377#define get_irq_chip(irq) (irq_desc[irq].chip) 383#define get_irq_chip(irq) (irq_to_desc(irq)->chip)
378#define get_irq_chip_data(irq) (irq_desc[irq].chip_data) 384#define get_irq_chip_data(irq) (irq_to_desc(irq)->chip_data)
379#define get_irq_data(irq) (irq_desc[irq].handler_data) 385#define get_irq_data(irq) (irq_to_desc(irq)->handler_data)
380#define get_irq_msi(irq) (irq_desc[irq].msi_desc) 386#define get_irq_msi(irq) (irq_to_desc(irq)->msi_desc)
381 387
382#endif /* CONFIG_GENERIC_HARDIRQS */ 388#endif /* CONFIG_GENERIC_HARDIRQS */
383 389
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h
new file mode 100644
index 000000000000..3171ddc3b39d
--- /dev/null
+++ b/include/linux/irqnr.h
@@ -0,0 +1,24 @@
1#ifndef _LINUX_IRQNR_H
2#define _LINUX_IRQNR_H
3
4#ifndef CONFIG_GENERIC_HARDIRQS
5#include <asm/irq.h>
6# define nr_irqs NR_IRQS
7
8# define for_each_irq_desc(irq, desc) \
9 for (irq = 0; irq < nr_irqs; irq++)
10#else
11extern int nr_irqs;
12
13# define for_each_irq_desc(irq, desc) \
14 for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++)
15
16# define for_each_irq_desc_reverse(irq, desc) \
17 for (irq = nr_irqs -1, desc = irq_desc + (nr_irqs -1 ); \
18 irq > 0; irq--, desc--)
19#endif
20
21#define for_each_irq_nr(irq) \
22 for (irq = 0; irq < nr_irqs; irq++)
23
24#endif
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index cac3750cd65e..4a145caeee07 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -39,15 +39,29 @@ DECLARE_PER_CPU(struct kernel_stat, kstat);
39 39
40extern unsigned long long nr_context_switches(void); 40extern unsigned long long nr_context_switches(void);
41 41
42struct irq_desc;
43
44static inline void kstat_incr_irqs_this_cpu(unsigned int irq,
45 struct irq_desc *desc)
46{
47 kstat_this_cpu.irqs[irq]++;
48}
49
50static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
51{
52 return kstat_cpu(cpu).irqs[irq];
53}
54
42/* 55/*
43 * Number of interrupts per specific IRQ source, since bootup 56 * Number of interrupts per specific IRQ source, since bootup
44 */ 57 */
45static inline int kstat_irqs(int irq) 58static inline unsigned int kstat_irqs(unsigned int irq)
46{ 59{
47 int cpu, sum = 0; 60 unsigned int sum = 0;
61 int cpu;
48 62
49 for_each_possible_cpu(cpu) 63 for_each_possible_cpu(cpu)
50 sum += kstat_cpu(cpu).irqs[irq]; 64 sum += kstat_irqs_cpu(irq, cpu);
51 65
52 return sum; 66 return sum;
53} 67}
diff --git a/include/linux/pci.h b/include/linux/pci.h
index acf8f24037cd..7f3f65ee4da7 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -725,7 +725,7 @@ enum pci_dma_burst_strategy {
725}; 725};
726 726
727struct msix_entry { 727struct msix_entry {
728 u16 vector; /* kernel uses to write allocated vector */ 728 u32 vector; /* kernel uses to write allocated vector */
729 u16 entry; /* driver uses to specify entry, OS writes */ 729 u16 entry; /* driver uses to specify entry, OS writes */
730}; 730};
731 731