Name: Rewritten Hot-plug CPU Core Infrastructure for PPC Author: Rusty Russell Status: Tested on 2.5.15/PPC Depends: Hotcpu/hotcpu-boot-ppc.patch.gz D: This introduces hotplug CPU capability for PPC. diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal working-ppc-2.5-hotcpu/arch/ppc/kernel/smp.c working-ppc-2.5-hotcpu-all/arch/ppc/kernel/smp.c --- working-ppc-2.5-hotcpu/arch/ppc/kernel/smp.c Wed May 29 14:05:44 2002 +++ working-ppc-2.5-hotcpu-all/arch/ppc/kernel/smp.c Wed May 29 18:41:06 2002 @@ -653,6 +653,10 @@ char buf[32]; int c; + /* FIXME: we don't take it fully down ATM. --RR */ + if (cpu_callin_map[cpu]) + goto up; + /* create a process for the processor */ /* only regs.msr is actually used, and 0 is OK for it */ memset(®s, 0, sizeof(struct pt_regs)); @@ -696,6 +700,7 @@ printk("Processor %d found.\n", cpu); smp_ops->give_timebase(); + up: set_bit(cpu, &cpu_online_map); return 0; } @@ -703,5 +708,23 @@ void smp_cpus_done(unsigned int max_cpus) { smp_ops->setup_cpu(0); +} + +/* Upping and downing of CPUs */ +int __cpu_disable(void) +{ + unsigned int cpu = smp_processor_id(); + + /* FIXME: Should we tell the OpenPIC not to send this CPU + interrupts somehow? --RR */ + + /* Remove from online map. */ + clear_bit(cpu, &cpu_online_map); + return 0; +} + +void __cpu_die(unsigned int cpu) +{ + /* FIXME: Send an IPI to clean it up, kill idle process, etc. -- RR */ } #endif diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal working-ppc-2.5-hotcpu/include/asm-ppc/smp.h working-ppc-2.5-hotcpu-all/include/asm-ppc/smp.h --- working-ppc-2.5-hotcpu/include/asm-ppc/smp.h Tue May 28 16:47:01 2002 +++ working-ppc-2.5-hotcpu-all/include/asm-ppc/smp.h Wed May 29 15:17:27 2002 @@ -65,16 +65,9 @@ } /* Upping and downing of CPUs */ -static inline int __cpu_disable(void) -{ - return -ENOSYS; -} - -static inline void __cpu_die(unsigned int cpu) -{ -} - extern int __cpu_up(unsigned int cpu); +extern int __cpu_disable(void); +extern void __cpu_die(unsigned int cpu); extern int smp_hw_index[]; #define hard_smp_processor_id() (smp_hw_index[smp_processor_id()])