summaryrefslogtreecommitdiff
path: root/sys/arch/hppa
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2010-12-30 14:30:13 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2010-12-30 14:30:13 +0000
commitfbdc0a4d566f770a8922e3787790a8e86b7ffb4c (patch)
tree69c97b638b8a731b6bd261462c03b402f103d3c3 /sys/arch/hppa
parent9406de6e916ef06271a99833196f0f0c096d5bc7 (diff)
Prior to loading the FPU context onto the current CPU, check to see if the
FPU context is still present on another CPU. If so, perform an FPU shootdown and wait for the FPU context to be saved before continuing. ok kettenis@
Diffstat (limited to 'sys/arch/hppa')
-rw-r--r--sys/arch/hppa/hppa/genassym.cf4
-rw-r--r--sys/arch/hppa/hppa/locore.S25
2 files changed, 27 insertions, 2 deletions
diff --git a/sys/arch/hppa/hppa/genassym.cf b/sys/arch/hppa/hppa/genassym.cf
index 04caaa5196c..a5690d283d5 100644
--- a/sys/arch/hppa/hppa/genassym.cf
+++ b/sys/arch/hppa/hppa/genassym.cf
@@ -1,4 +1,4 @@
-# $OpenBSD: genassym.cf,v 1.41 2010/07/01 05:33:32 jsing Exp $
+# $OpenBSD: genassym.cf,v 1.42 2010/12/30 14:30:12 jsing Exp $
#
# Copyright (c) 1982, 1990, 1993
@@ -164,6 +164,8 @@ member ci_cpl
member ci_ipending
member ci_trap_save
member ci_fpu_state
+member ci_ipi
+member ci_hpa
struct hppa_fpstate
member hfp_regs
diff --git a/sys/arch/hppa/hppa/locore.S b/sys/arch/hppa/hppa/locore.S
index a76b179973d..d4430e2f00b 100644
--- a/sys/arch/hppa/hppa/locore.S
+++ b/sys/arch/hppa/hppa/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.182 2010/12/21 14:56:23 claudio Exp $ */
+/* $OpenBSD: locore.S,v 1.183 2010/12/30 14:30:12 jsing Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
@@ -1087,6 +1087,29 @@ $fpusw_set
sync
$fpusw_nosave
+
+#ifdef MULTIPROCESSOR
+ /* See if this process has FPU context on another CPU. */
+ ldw HFP_CPU(r9), r1
+ comb,=,n r1, r0, $fpusw_noshoot
+
+ /* Perform FPU shootdown. */
+ ldi (1 << HPPA_IPI_FPU_SAVE), r1
+ ldw HFP_CPU(r9), r16
+ stw r1, CI_IPI(r16)
+ ldi 1, r1
+ ldw CI_HPA(r16), r16
+ stw r1, 0(r16)
+
+$fpusw_spin
+ /* Wait for shootdown to complete. */
+ sync
+ ldw HFP_CPU(r9), r1
+ comb,<>,n r1, r0, $fpusw_spin
+
+$fpusw_noshoot
+#endif
+
/* count switches */
.import uvmexp, data
ldil L%(uvmexp+FPSWTCH), r1