summaryrefslogtreecommitdiff
path: root/sys/arch/sgi
diff options
context:
space:
mode:
authorTakuya ASADA <syuu@cvs.openbsd.org>2010-09-11 11:29:51 +0000
committerTakuya ASADA <syuu@cvs.openbsd.org>2010-09-11 11:29:51 +0000
commitaf8cab657ccebdedb57110926c79dbb4b51f4664 (patch)
tree957100f6bb371ec45c9bd8564a97d938724c5257 /sys/arch/sgi
parent4547a29bb5bafa8c3d8068937641164a9e24f967 (diff)
move machine dependent GET_CPU_INFO(), getcurcpu(), setcurcpu() to arch/sgi. ok miod@
Diffstat (limited to 'sys/arch/sgi')
-rw-r--r--sys/arch/sgi/include/asm.h9
-rw-r--r--sys/arch/sgi/include/cpu.h4
-rw-r--r--sys/arch/sgi/sgi/locore.S14
3 files changed, 23 insertions, 4 deletions
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 */