diff options
-rw-r--r-- | sys/arch/mips64/include/asm.h | 7 | ||||
-rw-r--r-- | sys/arch/mips64/include/cpu.h | 6 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/cp0access.S | 16 | ||||
-rw-r--r-- | sys/arch/sgi/include/asm.h | 9 | ||||
-rw-r--r-- | sys/arch/sgi/include/cpu.h | 4 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/locore.S | 14 |
6 files changed, 29 insertions, 27 deletions
diff --git a/sys/arch/mips64/include/asm.h b/sys/arch/mips64/include/asm.h index c8c2b368a41..5b97ab7848c 100644 --- a/sys/arch/mips64/include/asm.h +++ b/sys/arch/mips64/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.11 2010/04/28 16:20:28 syuu Exp $ */ +/* $OpenBSD: asm.h,v 1.12 2010/09/11 11:29:49 syuu Exp $ */ /* * Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -298,10 +298,7 @@ x: ; \ dsll reg, reg, 59 #ifdef MULTIPROCESSOR -#define GET_CPU_INFO(ci, tmp) \ - LOAD_XKPHYS(ci, CCA_CACHED); \ - mfc0 tmp, COP_0_LLADDR; \ - or ci, ci, tmp +#define GET_CPU_INFO(ci, tmp) HW_GET_CPU_INFO(ci, tmp) #else /* MULTIPROCESSOR */ #define GET_CPU_INFO(ci, tmp) \ LA ci, cpu_info_primary diff --git a/sys/arch/mips64/include/cpu.h b/sys/arch/mips64/include/cpu.h index 692aed0c0da..fc3d17a015e 100644 --- a/sys/arch/mips64/include/cpu.h +++ b/sys/arch/mips64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.59 2010/08/30 08:52:10 syuu Exp $ */ +/* $OpenBSD: cpu.h,v 1.60 2010/09/11 11:29:49 syuu Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -434,8 +434,8 @@ extern struct cpu_info *cpu_info_list; #ifdef MULTIPROCESSOR #define MAXCPUS 4 -extern struct cpu_info *getcurcpu(void); -extern void setcurcpu(struct cpu_info *); +#define getcurcpu() hw_getcurcpu() +#define setcurcpu(ci) hw_setcurcpu(ci) extern struct cpu_info *get_cpu_info(int); #define curcpu() getcurcpu() #define CPU_IS_PRIMARY(ci) ((ci)->ci_flags & CPUF_PRIMARY) diff --git a/sys/arch/mips64/mips64/cp0access.S b/sys/arch/mips64/mips64/cp0access.S index 3321ae85ea7..32866dce285 100644 --- a/sys/arch/mips64/mips64/cp0access.S +++ b/sys/arch/mips64/mips64/cp0access.S @@ -1,4 +1,4 @@ -/* $OpenBSD: cp0access.S,v 1.13 2010/04/28 16:20:28 syuu Exp $ */ +/* $OpenBSD: cp0access.S,v 1.14 2010/09/11 11:29:50 syuu Exp $ */ /* * Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -192,17 +192,3 @@ LEAF(cp0_setperfctrl, 0) j ra nop END(cp0_setperfctrl) - -#ifdef MULTIPROCESSOR -LEAF(getcurcpu, 0) - GET_CPU_INFO(v0, v1) - jr ra - nop -END(getcurcpu) - -LEAF(setcurcpu, 0) - mtc0 a0, COP_0_LLADDR - j ra - nop -END(setcurcpu) -#endif diff --git a/sys/arch/sgi/include/asm.h b/sys/arch/sgi/include/asm.h index f2930028dcd..4be5d0e3fce 100644 --- a/sys/arch/sgi/include/asm.h +++ b/sys/arch/sgi/include/asm.h @@ -1,5 +1,10 @@ -/* $OpenBSD: asm.h,v 1.3 2010/04/28 16:20:28 syuu Exp $ */ +/* $OpenBSD: asm.h,v 1.4 2010/09/11 11:29:50 syuu Exp $ */ -/* Use Mips generic include file */ +#ifdef MULTIPROCESSOR +#define HW_GET_CPU_INFO(ci, tmp) \ + LOAD_XKPHYS(ci, CCA_CACHED); \ + mfc0 tmp, COP_0_LLADDR; \ + or ci, ci, tmp +#endif #include <mips64/asm.h> diff --git a/sys/arch/sgi/include/cpu.h b/sys/arch/sgi/include/cpu.h index 57c639d4069..011721c63fe 100644 --- a/sys/arch/sgi/include/cpu.h +++ b/sys/arch/sgi/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.10 2010/09/09 10:59:01 syuu Exp $ */ +/* $OpenBSD: cpu.h,v 1.11 2010/09/11 11:29:50 syuu Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -47,6 +47,8 @@ #ifdef _KERNEL #if defined(MULTIPROCESSOR) && !defined(_LOCORE) struct cpu_info; +struct cpu_info *hw_getcurcpu(void); +void hw_setcurcpu(struct cpu_info *); void hw_cpu_boot_secondary(struct cpu_info *); void hw_cpu_hatch(struct cpu_info *); void hw_cpu_spinup_trampoline(struct cpu_info *); diff --git a/sys/arch/sgi/sgi/locore.S b/sys/arch/sgi/sgi/locore.S index 5ca8e2b118f..8a11e3c912c 100644 --- a/sys/arch/sgi/sgi/locore.S +++ b/sys/arch/sgi/sgi/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.11 2009/12/07 18:53:33 miod Exp $ */ +/* $OpenBSD: locore.S,v 1.12 2010/09/11 11:29:50 syuu Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -84,4 +84,16 @@ LEAF(hw_cpu_spinup_trampoline, 0) jal hw_cpu_hatch nop END(hw_cpu_spinup_trampoline) + +LEAF(hw_getcurcpu, 0) + GET_CPU_INFO(v0, v1) + jr ra + nop +END(hw_getcurcpu) + +LEAF(hw_setcurcpu, 0) + mtc0 a0, COP_0_LLADDR + j ra + nop +END(hw_setcurcpu) #endif /* MULTIPROCESSOR */ |