aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/cpu.h
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2008-02-15 06:00:23 -0500
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:40:47 -0400
commit03ae5768b6110ebaa97dc3e7abf1c3d8bec5f874 (patch)
treee9dffa8c5eccd43ea8284d7e2e48b782166bbcac /arch/x86/kernel/cpu/cpu.h
parentbc7c314d7048017caa0725b41cc577cccf4fc53b (diff)
x86: use ELF section to list CPU vendor specific code
Replace the hardcoded list of initialization functions for each CPU vendor by a list in an ELF section, which is read at initialization in arch/x86/kernel/cpu/cpu.c to fill the cpu_devs[] array. The ELF section, named .x86cpuvendor.init, is reclaimed after boot, and contains entries of type "struct cpu_vendor_dev" which associates a vendor number with a pointer to a "struct cpu_dev" structure. This first modification allows to remove all the VENDOR_init_cpu() functions. This patch also removes the hardcoded calls to early_init_amd() and early_init_intel(). Instead, we add a "c_early_init" member to the cpu_dev structure, which is then called if not NULL by the generic CPU initialization code. Unfortunately, in early_cpu_detect(), this_cpu is not yet set, so we have to use the cpu_devs[] array directly. This patch is part of the Linux Tiny project, and is needed for further patch that will allow to disable compilation of unused CPU support code. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/cpu/cpu.h')
-rw-r--r--arch/x86/kernel/cpu/cpu.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h
index e0b38c33d842..783691b2a738 100644
--- a/arch/x86/kernel/cpu/cpu.h
+++ b/arch/x86/kernel/cpu/cpu.h
@@ -14,6 +14,7 @@ struct cpu_dev {
14 14
15 struct cpu_model_info c_models[4]; 15 struct cpu_model_info c_models[4];
16 16
17 void (*c_early_init)(struct cpuinfo_x86 *c);
17 void (*c_init)(struct cpuinfo_x86 * c); 18 void (*c_init)(struct cpuinfo_x86 * c);
18 void (*c_identify)(struct cpuinfo_x86 * c); 19 void (*c_identify)(struct cpuinfo_x86 * c);
19 unsigned int (*c_size_cache)(struct cpuinfo_x86 * c, unsigned int size); 20 unsigned int (*c_size_cache)(struct cpuinfo_x86 * c, unsigned int size);
@@ -21,18 +22,17 @@ struct cpu_dev {
21 22
22extern struct cpu_dev * cpu_devs [X86_VENDOR_NUM]; 23extern struct cpu_dev * cpu_devs [X86_VENDOR_NUM];
23 24
25struct cpu_vendor_dev {
26 int vendor;
27 struct cpu_dev *cpu_dev;
28};
29
30#define cpu_vendor_dev_register(cpu_vendor_id, cpu_dev) \
31 static struct cpu_vendor_dev __cpu_vendor_dev_##cpu_vendor_id __used \
32 __attribute__((__section__(".x86cpuvendor.init"))) = \
33 { cpu_vendor_id, cpu_dev }
34
35extern struct cpu_vendor_dev __x86cpuvendor_start[], __x86cpuvendor_end[];
36
24extern int get_model_name(struct cpuinfo_x86 *c); 37extern int get_model_name(struct cpuinfo_x86 *c);
25extern void display_cacheinfo(struct cpuinfo_x86 *c); 38extern void display_cacheinfo(struct cpuinfo_x86 *c);
26
27extern void early_init_intel(struct cpuinfo_x86 *c);
28extern void early_init_amd(struct cpuinfo_x86 *c);
29
30/* Specific CPU type init functions */
31int intel_cpu_init(void);
32int amd_init_cpu(void);
33int cyrix_init_cpu(void);
34int nsc_init_cpu(void);
35int centaur_init_cpu(void);
36int transmeta_init_cpu(void);
37int nexgen_init_cpu(void);
38int umc_init_cpu(void);