aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/init.h43
-rw-r--r--include/linux/irq.h15
-rw-r--r--include/linux/kernel_stat.h16
3 files changed, 6 insertions, 68 deletions
diff --git a/include/linux/init.h b/include/linux/init.h
index 59fbb4aaba6a..70ad53e1eab8 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -247,49 +247,6 @@ struct obs_kernel_param {
247/* Relies on boot_command_line being set */ 247/* Relies on boot_command_line being set */
248void __init parse_early_param(void); 248void __init parse_early_param(void);
249 249
250struct dyn_array {
251 void **name;
252 unsigned long size;
253 unsigned int *nr;
254 unsigned long align;
255 void (*init_work)(void *);
256};
257extern struct dyn_array *__dyn_array_start[], *__dyn_array_end[];
258extern struct dyn_array *__per_cpu_dyn_array_start[], *__per_cpu_dyn_array_end[];
259
260#define DEFINE_DYN_ARRAY_ADDR(nameX, addrX, sizeX, nrX, alignX, init_workX) \
261 static struct dyn_array __dyn_array_##nameX __initdata = \
262 { .name = (void **)&(nameX),\
263 .size = sizeX,\
264 .nr = &(nrX),\
265 .align = alignX,\
266 .init_work = init_workX,\
267 }; \
268 static struct dyn_array *__dyn_array_ptr_##nameX __used \
269 __attribute__((__section__(".dyn_array.init"))) = \
270 &__dyn_array_##nameX
271
272#define DEFINE_DYN_ARRAY(nameX, sizeX, nrX, alignX, init_workX) \
273 DEFINE_DYN_ARRAY_ADDR(nameX, nameX, sizeX, nrX, alignX, init_workX)
274
275#define DEFINE_PER_CPU_DYN_ARRAY_ADDR(nameX, addrX, sizeX, nrX, alignX, init_workX) \
276 static struct dyn_array __per_cpu_dyn_array_##nameX __initdata = \
277 { .name = (void **)&(addrX),\
278 .size = sizeX,\
279 .nr = &(nrX),\
280 .align = alignX,\
281 .init_work = init_workX,\
282 }; \
283 static struct dyn_array *__per_cpu_dyn_array_ptr_##nameX __used \
284 __attribute__((__section__(".per_cpu_dyn_array.init"))) = \
285 &__per_cpu_dyn_array_##nameX
286
287#define DEFINE_PER_CPU_DYN_ARRAY(nameX, sizeX, nrX, alignX, init_workX) \
288 DEFINE_PER_CPU_DYN_ARRAY_ADDR(nameX, nameX, nrX, alignX, init_workX)
289
290extern void pre_alloc_dyn_array(void);
291extern unsigned long per_cpu_dyn_array_size(unsigned long *align);
292extern void per_cpu_alloc_dyn_array(int cpu, char *ptr);
293#endif /* __ASSEMBLY__ */ 250#endif /* __ASSEMBLY__ */
294 251
295/** 252/**
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 3f33c7790300..38bf89f2ade0 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -139,8 +139,6 @@ struct irq_chip {
139 const char *typename; 139 const char *typename;
140}; 140};
141 141
142struct timer_rand_state;
143struct irq_2_iommu;
144/** 142/**
145 * struct irq_desc - interrupt descriptor 143 * struct irq_desc - interrupt descriptor
146 * 144 *
@@ -167,9 +165,6 @@ struct irq_2_iommu;
167 */ 165 */
168struct irq_desc { 166struct irq_desc {
169 unsigned int irq; 167 unsigned int irq;
170#ifdef CONFIG_HAVE_DYN_ARRAY
171 unsigned int *kstat_irqs;
172#endif
173 irq_flow_handler_t handle_irq; 168 irq_flow_handler_t handle_irq;
174 struct irq_chip *chip; 169 struct irq_chip *chip;
175 struct msi_desc *msi_desc; 170 struct msi_desc *msi_desc;
@@ -198,23 +193,13 @@ struct irq_desc {
198} ____cacheline_internodealigned_in_smp; 193} ____cacheline_internodealigned_in_smp;
199 194
200 195
201#ifndef CONFIG_HAVE_DYN_ARRAY
202/* could be removed if we get rid of all irq_desc reference */
203extern struct irq_desc irq_desc[NR_IRQS]; 196extern struct irq_desc irq_desc[NR_IRQS];
204#else
205extern struct irq_desc *irq_desc;
206#endif
207 197
208static inline struct irq_desc *irq_to_desc(unsigned int irq) 198static inline struct irq_desc *irq_to_desc(unsigned int irq)
209{ 199{
210 return (irq < nr_irqs) ? irq_desc + irq : NULL; 200 return (irq < nr_irqs) ? irq_desc + irq : NULL;
211} 201}
212 202
213#ifdef CONFIG_HAVE_DYN_ARRAY
214#define kstat_irqs_this_cpu(DESC) \
215 ((DESC)->kstat_irqs[smp_processor_id()])
216#endif
217
218/* 203/*
219 * Migration helpers for obsolete names, they will go away: 204 * Migration helpers for obsolete names, they will go away:
220 */ 205 */
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index 21249d8c1293..a9d0d360b776 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -28,9 +28,7 @@ struct cpu_usage_stat {
28 28
29struct kernel_stat { 29struct kernel_stat {
30 struct cpu_usage_stat cpustat; 30 struct cpu_usage_stat cpustat;
31#ifndef CONFIG_HAVE_DYN_ARRAY
32 unsigned int irqs[NR_IRQS]; 31 unsigned int irqs[NR_IRQS];
33#endif
34}; 32};
35 33
36DECLARE_PER_CPU(struct kernel_stat, kstat); 34DECLARE_PER_CPU(struct kernel_stat, kstat);
@@ -41,20 +39,18 @@ DECLARE_PER_CPU(struct kernel_stat, kstat);
41 39
42extern unsigned long long nr_context_switches(void); 40extern unsigned long long nr_context_switches(void);
43 41
44#ifndef CONFIG_HAVE_DYN_ARRAY 42struct irq_desc;
45#define kstat_irqs_this_cpu(irq) \
46 (kstat_this_cpu.irqs[irq])
47#endif
48 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 49
50#ifndef CONFIG_HAVE_DYN_ARRAY
51static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) 50static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
52{ 51{
53 return kstat_cpu(cpu).irqs[irq]; 52 return kstat_cpu(cpu).irqs[irq];
54} 53}
55#else
56extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu);
57#endif
58 54
59/* 55/*
60 * Number of interrupts per specific IRQ source, since bootup 56 * Number of interrupts per specific IRQ source, since bootup