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 | |
parent | f8dfaf80bdc1a29fba2da8e1abc61a30da7ba6ab (diff) |
MIPS64 SMP, compile only edition. Don't use yet ...
Diffstat (limited to 'arch/mips64')
-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 | ||||
-rw-r--r-- | arch/mips64/sgi-ip27/ip27-irq.c | 14 | ||||
-rw-r--r-- | arch/mips64/tools/offset.c | 3 |
6 files changed, 102 insertions, 12 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 ;-) */ +} diff --git a/arch/mips64/sgi-ip27/ip27-irq.c b/arch/mips64/sgi-ip27/ip27-irq.c index d7ddb8682..ae096d28f 100644 --- a/arch/mips64/sgi-ip27/ip27-irq.c +++ b/arch/mips64/sgi-ip27/ip27-irq.c @@ -1,4 +1,4 @@ -/* $Id: ip27-irq.c,v 1.7 2000/03/02 02:36:50 ralf Exp $ +/* $Id: ip27-irq.c,v 1.8 2000/03/07 15:45:29 ralf Exp $ * * ip27-irq.c: Highlevel interrupt handling for IP27 architecture. * @@ -8,7 +8,6 @@ #include <linux/init.h> #include <linux/errno.h> -#include <linux/kernel_stat.h> #include <linux/signal.h> #include <linux/sched.h> #include <linux/types.h> @@ -17,8 +16,8 @@ #include <linux/timex.h> #include <linux/malloc.h> #include <linux/random.h> -#include <linux/smp.h> #include <linux/smp_lock.h> +#include <linux/kernel_stat.h> #include <asm/bitops.h> #include <asm/bootinfo.h> @@ -52,6 +51,11 @@ irq_cpustat_t irq_stat [NR_CPUS]; +#ifdef CONFIG_SMP +int global_irq_holder = NO_PROC_ID; +spinlock_t global_irq_lock; +#endif + extern asmlinkage void ip27_irq(void); int (*irq_cannonicalize)(int irq); @@ -105,7 +109,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs) int do_random, cpu; cpu = smp_processor_id(); - irq_enter(cpu); + irq_enter(cpu, irq); kstat.irqs[cpu][irq]++; action = *(irq + irq_action); @@ -123,7 +127,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs) add_interrupt_randomness(irq); __cli(); } - irq_exit(cpu); + irq_exit(cpu, irq); /* unmasking and bottom half handling is done magically for us. */ } diff --git a/arch/mips64/tools/offset.c b/arch/mips64/tools/offset.c index 4f8e28d09..a8833e216 100644 --- a/arch/mips64/tools/offset.c +++ b/arch/mips64/tools/offset.c @@ -1,4 +1,4 @@ -/* $Id: offset.c,v 1.5 1999/10/08 21:07:52 ralf Exp $ +/* $Id: offset.c,v 1.4 1999/12/04 03:59:01 ralf Exp $ * * offset.c: Calculate pt_regs and task_struct offsets. * @@ -82,6 +82,7 @@ void output_task_defines(void) offset("#define TASK_COUNTER ", struct task_struct, counter); offset("#define TASK_PRIORITY ", struct task_struct, priority); offset("#define TASK_MM ", struct task_struct, mm); + offset("#define TASK_PROCESSOR ", struct task_struct, processor); size("#define TASK_STRUCT_SIZE ", struct task_struct); linefeed; } |