diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-08-19 20:49:44 -0700 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-16 16:52:03 +0200 |
commit | 1f3fcd4b1adc972d5c6a34cfed98931c46575b49 (patch) | |
tree | a79b6c656a09a8424863a0025d5b20e7264d6999 /include/asm-generic | |
parent | 3ddfda11861d305b02ed810b522dcf48b74ca808 (diff) | |
download | talos-op-linux-1f3fcd4b1adc972d5c6a34cfed98931c46575b49.tar.gz talos-op-linux-1f3fcd4b1adc972d5c6a34cfed98931c46575b49.zip |
add per_cpu_dyn_array support
allow dyn-array in per_cpu area, allocated dynamically.
usage:
| /* in .h */
| struct kernel_stat {
| struct cpu_usage_stat cpustat;
| unsigned int *irqs;
| };
|
| /* in .c */
| DEFINE_PER_CPU(struct kernel_stat, kstat);
|
| DEFINE_PER_CPU_DYN_ARRAY_ADDR(per_cpu__kstat_irqs, per_cpu__kstat.irqs, sizeof(unsigned int), nr_irqs, sizeof(unsigned long), NULL);
after setup_percpu()/per_cpu_alloc_dyn_array(), the dyn_array in
per_cpu area is ready to use.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/vmlinux.lds.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 7881406c03ec..c68eda9d9a90 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -216,6 +216,12 @@ VMLINUX_SYMBOL(__dyn_array_start) = .; \ *(.dyn_array.init) \ VMLINUX_SYMBOL(__dyn_array_end) = .; \ + } \ + . = ALIGN((align)); \ + .per_cpu_dyn_array.init : AT(ADDR(.per_cpu_dyn_array.init) - LOAD_OFFSET) { \ + VMLINUX_SYMBOL(__per_cpu_dyn_array_start) = .; \ + *(.per_cpu_dyn_array.init) \ + VMLINUX_SYMBOL(__per_cpu_dyn_array_end) = .; \ } #define SECURITY_INIT \ .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \ |