]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
add per_cpu_dyn_array support
authorYinghai Lu <yhlu.kernel@gmail.com>
Wed, 20 Aug 2008 03:49:44 +0000 (20:49 -0700)
committerIngo Molnar <mingo@elte.hu>
Thu, 16 Oct 2008 14:52:03 +0000 (16:52 +0200)
commit1f3fcd4b1adc972d5c6a34cfed98931c46575b49
treea79b6c656a09a8424863a0025d5b20e7264d6999
parent3ddfda11861d305b02ed810b522dcf48b74ca808
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>
arch/x86/kernel/setup_percpu.c
include/asm-generic/vmlinux.lds.h
include/linux/init.h
init/main.c