mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-03 04:42:13 +00:00
[PATCH] i386: clean up identify_cpu
identify_cpu() is used to identify both the boot CPU and secondary CPUs, but it performs some actions which only apply to the boot CPU. Those functions are therefore really __init functions, but because they're called by identify_cpu(), they must be marked __cpuinit. This patch splits identify_cpu() into identify_boot_cpu() and identify_secondary_cpu(), and calls the appropriate init functions from each. Also, identify_boot_cpu() and all the functions it dominates are marked __init. Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com> Signed-off-by: Andi Kleen <ak@suse.de>
This commit is contained in:
parent
1353ebb4b4
commit
a6c4e076ee
4 changed files with 18 additions and 10 deletions
|
@ -394,7 +394,7 @@ __setup("serialnumber", x86_serial_nr_setup);
|
||||||
/*
|
/*
|
||||||
* This does the hard work of actually picking apart the CPU stuff...
|
* This does the hard work of actually picking apart the CPU stuff...
|
||||||
*/
|
*/
|
||||||
void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
|
static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -505,15 +505,22 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
|
||||||
|
|
||||||
/* Init Machine Check Exception if available. */
|
/* Init Machine Check Exception if available. */
|
||||||
mcheck_init(c);
|
mcheck_init(c);
|
||||||
|
}
|
||||||
|
|
||||||
if (c == &boot_cpu_data)
|
void __init identify_boot_cpu(void)
|
||||||
sysenter_setup();
|
{
|
||||||
|
identify_cpu(&boot_cpu_data);
|
||||||
|
sysenter_setup();
|
||||||
enable_sep_cpu();
|
enable_sep_cpu();
|
||||||
|
mtrr_bp_init();
|
||||||
|
}
|
||||||
|
|
||||||
if (c == &boot_cpu_data)
|
void __cpuinit identify_secondary_cpu(struct cpuinfo_x86 *c)
|
||||||
mtrr_bp_init();
|
{
|
||||||
else
|
BUG_ON(c == &boot_cpu_data);
|
||||||
mtrr_ap_init();
|
identify_cpu(c);
|
||||||
|
enable_sep_cpu();
|
||||||
|
mtrr_ap_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_X86_HT
|
#ifdef CONFIG_X86_HT
|
||||||
|
|
|
@ -155,7 +155,7 @@ static void __cpuinit smp_store_cpu_info(int id)
|
||||||
|
|
||||||
*c = boot_cpu_data;
|
*c = boot_cpu_data;
|
||||||
if (id!=0)
|
if (id!=0)
|
||||||
identify_cpu(c);
|
identify_secondary_cpu(c);
|
||||||
/*
|
/*
|
||||||
* Mask B, Pentium, but not Pentium MMX
|
* Mask B, Pentium, but not Pentium MMX
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -72,7 +72,7 @@ extern const char vsyscall_int80_start, vsyscall_int80_end;
|
||||||
extern const char vsyscall_sysenter_start, vsyscall_sysenter_end;
|
extern const char vsyscall_sysenter_start, vsyscall_sysenter_end;
|
||||||
static struct page *syscall_pages[1];
|
static struct page *syscall_pages[1];
|
||||||
|
|
||||||
int __cpuinit sysenter_setup(void)
|
int __init sysenter_setup(void)
|
||||||
{
|
{
|
||||||
void *syscall_page = (void *)get_zeroed_page(GFP_ATOMIC);
|
void *syscall_page = (void *)get_zeroed_page(GFP_ATOMIC);
|
||||||
syscall_pages[0] = virt_to_page(syscall_page);
|
syscall_pages[0] = virt_to_page(syscall_page);
|
||||||
|
|
|
@ -116,7 +116,8 @@ extern char ignore_fpu_irq;
|
||||||
|
|
||||||
void __init cpu_detect(struct cpuinfo_x86 *c);
|
void __init cpu_detect(struct cpuinfo_x86 *c);
|
||||||
|
|
||||||
extern void identify_cpu(struct cpuinfo_x86 *);
|
extern void identify_boot_cpu(void);
|
||||||
|
extern void identify_secondary_cpu(struct cpuinfo_x86 *);
|
||||||
extern void print_cpu_info(struct cpuinfo_x86 *);
|
extern void print_cpu_info(struct cpuinfo_x86 *);
|
||||||
extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
|
extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
|
||||||
extern unsigned short num_cache_leaves;
|
extern unsigned short num_cache_leaves;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue