x86: Add cpu_shutdown() support Doesn't do anything yet. Losely based on a earlier patch by Eric Biederman --- arch/i386/kernel/cpu/common.c | 4 ++++ arch/i386/kernel/reboot.c | 1 + arch/i386/kernel/smp.c | 1 + arch/i386/mach-visws/reboot.c | 1 + arch/x86_64/kernel/reboot.c | 1 + arch/x86_64/kernel/setup64.c | 4 ++++ include/asm-i386/processor.h | 1 + include/asm-x86_64/processor.h | 1 + 8 files changed, 14 insertions(+) Index: linux/arch/i386/kernel/reboot.c =================================================================== --- linux.orig/arch/i386/kernel/reboot.c +++ linux/arch/i386/kernel/reboot.c @@ -313,6 +313,7 @@ void machine_shutdown(void) #ifdef CONFIG_X86_IO_APIC disable_IO_APIC(); #endif + cpu_shutdown(); } void machine_emergency_restart(void) Index: linux/arch/i386/kernel/smp.c =================================================================== --- linux.orig/arch/i386/kernel/smp.c +++ linux/arch/i386/kernel/smp.c @@ -582,6 +582,7 @@ static void stop_this_cpu (void * dummy) cpu_clear(smp_processor_id(), cpu_online_map); local_irq_disable(); disable_local_APIC(); + cpu_shutdown(); if (cpu_data[smp_processor_id()].hlt_works_ok) for(;;) halt(); for (;;); Index: linux/arch/i386/mach-visws/reboot.c =================================================================== --- linux.orig/arch/i386/mach-visws/reboot.c +++ linux/arch/i386/mach-visws/reboot.c @@ -13,6 +13,7 @@ void machine_shutdown(void) #ifdef CONFIG_SMP smp_send_stop(); #endif + cpu_shutdown(); } void machine_emergency_restart(void) Index: linux/arch/x86_64/kernel/reboot.c =================================================================== --- linux.orig/arch/x86_64/kernel/reboot.c +++ linux/arch/x86_64/kernel/reboot.c @@ -108,6 +108,7 @@ void machine_shutdown(void) #endif disable_IO_APIC(); + cpu_shutdown(); local_irq_restore(flags); } Index: linux/include/asm-i386/processor.h =================================================================== --- linux.orig/include/asm-i386/processor.h +++ linux/include/asm-i386/processor.h @@ -112,6 +112,7 @@ extern int cpu_llc_id[NR_CPUS]; extern char ignore_fpu_irq; extern void identify_cpu(struct cpuinfo_x86 *); +extern void cpu_shutdown(void); extern void print_cpu_info(struct cpuinfo_x86 *); extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); extern unsigned short num_cache_leaves; Index: linux/include/asm-x86_64/processor.h =================================================================== --- linux.orig/include/asm-x86_64/processor.h +++ linux/include/asm-x86_64/processor.h @@ -98,6 +98,7 @@ extern struct cpuinfo_x86 cpu_data[]; extern char ignore_irq13; extern void identify_cpu(struct cpuinfo_x86 *); +extern void cpu_shutdown(void); extern void print_cpu_info(struct cpuinfo_x86 *); extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); extern unsigned short num_cache_leaves; Index: linux/arch/x86_64/kernel/setup64.c =================================================================== --- linux.orig/arch/x86_64/kernel/setup64.c +++ linux/arch/x86_64/kernel/setup64.c @@ -286,3 +286,7 @@ void __cpuinit cpu_init (void) raw_local_save_flags(kernel_eflags); } + +void cpu_shutdown(void) +{ +} Index: linux/arch/i386/kernel/cpu/common.c =================================================================== --- linux.orig/arch/i386/kernel/cpu/common.c +++ linux/arch/i386/kernel/cpu/common.c @@ -701,6 +701,10 @@ old_gdt: mxcsr_feature_mask_init(); } +void cpu_shutdown(void) +{ +} + #ifdef CONFIG_HOTPLUG_CPU void __cpuinit cpu_uninit(void) {