diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/init.h | 43 | ||||
| -rw-r--r-- | include/linux/irq.h | 15 | ||||
| -rw-r--r-- | include/linux/kernel_stat.h | 16 |
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 */ |
| 248 | void __init parse_early_param(void); | 248 | void __init parse_early_param(void); |
| 249 | 249 | ||
| 250 | struct dyn_array { | ||
| 251 | void **name; | ||
| 252 | unsigned long size; | ||
| 253 | unsigned int *nr; | ||
| 254 | unsigned long align; | ||
| 255 | void (*init_work)(void *); | ||
| 256 | }; | ||
| 257 | extern struct dyn_array *__dyn_array_start[], *__dyn_array_end[]; | ||
| 258 | extern 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 | |||
| 290 | extern void pre_alloc_dyn_array(void); | ||
| 291 | extern unsigned long per_cpu_dyn_array_size(unsigned long *align); | ||
| 292 | extern 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 | ||
| 142 | struct timer_rand_state; | ||
| 143 | struct 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 | */ |
| 168 | struct irq_desc { | 166 | struct 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 */ | ||
| 203 | extern struct irq_desc irq_desc[NR_IRQS]; | 196 | extern struct irq_desc irq_desc[NR_IRQS]; |
| 204 | #else | ||
| 205 | extern struct irq_desc *irq_desc; | ||
| 206 | #endif | ||
| 207 | 197 | ||
| 208 | static inline struct irq_desc *irq_to_desc(unsigned int irq) | 198 | static 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 | ||
| 29 | struct kernel_stat { | 29 | struct 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 | ||
| 36 | DECLARE_PER_CPU(struct kernel_stat, kstat); | 34 | DECLARE_PER_CPU(struct kernel_stat, kstat); |
| @@ -41,20 +39,18 @@ DECLARE_PER_CPU(struct kernel_stat, kstat); | |||
| 41 | 39 | ||
| 42 | extern unsigned long long nr_context_switches(void); | 40 | extern unsigned long long nr_context_switches(void); |
| 43 | 41 | ||
| 44 | #ifndef CONFIG_HAVE_DYN_ARRAY | 42 | struct irq_desc; |
| 45 | #define kstat_irqs_this_cpu(irq) \ | ||
| 46 | (kstat_this_cpu.irqs[irq]) | ||
| 47 | #endif | ||
| 48 | 43 | ||
| 44 | static 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 | ||
| 51 | static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) | 50 | static 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 | ||
| 56 | extern 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 |
