diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-03-14 01:39:27 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-03-14 01:39:27 +0000 |
commit | ce1a9d7d9ebf3bc87c544d06542a3d30f604dca5 (patch) | |
tree | 7e1c263dc7b02602aa730654465bca583883d9dd /arch/mips64/kernel | |
parent | f8dfaf80bdc1a29fba2da8e1abc61a30da7ba6ab (diff) |
MIPS64 SMP, compile only edition. Don't use yet ...
Diffstat (limited to 'arch/mips64/kernel')
-rw-r--r-- | arch/mips64/kernel/Makefile | 4 | ||||
-rw-r--r-- | arch/mips64/kernel/entry.S | 9 | ||||
-rw-r--r-- | arch/mips64/kernel/setup.c | 4 | ||||
-rw-r--r-- | arch/mips64/kernel/smp.c | 80 |
4 files changed, 91 insertions, 6 deletions
diff --git a/arch/mips64/kernel/Makefile b/arch/mips64/kernel/Makefile index 0f70cba13..8fb09b994 100644 --- a/arch/mips64/kernel/Makefile +++ b/arch/mips64/kernel/Makefile @@ -25,6 +25,10 @@ ifdef CONFIG_BINFMT_ELF32 O_OBJS += binfmt_elf32.o endif +ifdef CONFIG_SMP +O_OBJS += smp.o +endif + clean: include $(TOPDIR)/Rules.make diff --git a/arch/mips64/kernel/entry.S b/arch/mips64/kernel/entry.S index b869ed96b..e591fd845 100644 --- a/arch/mips64/kernel/entry.S +++ b/arch/mips64/kernel/entry.S @@ -1,4 +1,4 @@ -/* $Id: entry.S,v 1.4 2000/01/17 23:32:46 ralf Exp $ +/* $Id: entry.S,v 1.5 2000/02/23 00:41:00 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -33,10 +33,11 @@ reschedule: jal schedule FEXPORT(ret_from_sys_call) FEXPORT(ret_from_irq) -#ifdef __SMP__ -#error Barffff... -#else la t1, softirq_state +#ifdef __SMP__ + lwu t0, TASK_PROCESSOR($28) + dsll t0, t0, 5 + daddu t1, t0 #endif lw t0, 0 (t1) lw t1, 4 (t1) # unused delay slot diff --git a/arch/mips64/kernel/setup.c b/arch/mips64/kernel/setup.c index 2a7d8a894..316ad7c29 100644 --- a/arch/mips64/kernel/setup.c +++ b/arch/mips64/kernel/setup.c @@ -1,4 +1,4 @@ -/* $Id: setup.c,v 1.7 2000/02/04 07:40:24 ralf Exp $ +/* $Id: setup.c,v 1.8 2000/03/02 02:36:50 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -40,7 +40,7 @@ #include <asm/sn/sn0/addrs.h> #endif -struct mips_cpuinfo boot_cpu_data; +struct cpuinfo_mips boot_cpu_data; #ifdef CONFIG_VT struct screen_info screen_info; diff --git a/arch/mips64/kernel/smp.c b/arch/mips64/kernel/smp.c new file mode 100644 index 000000000..c0cd75e9a --- /dev/null +++ b/arch/mips64/kernel/smp.c @@ -0,0 +1,80 @@ +#include <linux/init.h> +#include <linux/spinlock.h> +#include <linux/threads.h> +#include <linux/time.h> +#include <linux/timex.h> + +#include <asm/atomic.h> +#include <asm/processor.h> +#include <asm/system.h> + +/* The 'big kernel lock' */ +spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED; + +int smp_threads_ready = 0; + +void __init smp_boot_cpus(void) +{ +} + +static atomic_t smp_commenced = ATOMIC_INIT(0); + +struct cpuinfo_mips cpu_data[NR_CPUS]; + +int smp_num_cpus = 1; /* Number that came online. */ + +void __init smp_commence(void) +{ + wmb(); + atomic_set(&smp_commenced,1); +} + +static void stop_this_cpu(void *dummy) +{ + /* + * Remove this CPU + */ + for (;;); +} + +void smp_send_stop(void) +{ + smp_call_function(stop_this_cpu, NULL, 1, 0); + smp_num_cpus = 1; +} + +/* + * this function sends a 'reschedule' IPI to another CPU. + * it goes straight through and wastes no time serializing + * anything. Worst case is that we lose a reschedule ... + */ +void smp_send_reschedule(int cpu) +{ +} + +int __cpu_number_map[NR_CPUS]; +int __cpu_logical_map[NR_CPUS]; + +cycles_t cacheflush_time; + +/* Not really SMP stuff ... */ +int setup_profiling_timer(unsigned int multiplier) +{ +} + +/* + * Run a function on all other CPUs. + * <func> The function to run. This must be fast and non-blocking. + * <info> An arbitrary pointer to pass to the function. + * <retry> If true, keep retrying until ready. + * <wait> If true, wait until function has completed on other CPUs. + * [RETURNS] 0 on success, else a negative status code. + * + * Does not return until remote CPUs are nearly ready to execute <func> + * or are or have executed. + */ +int +smp_call_function (void (*func) (void *info), void *info, int retry, int wait) +{ + /* XXX - kinda important ;-) */ +} |