summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2009-01-23 19:16:40 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2009-01-23 19:16:40 +0000
commit6d54d03573c96c5e760fb506855c9a967178e0b6 (patch)
treecf292383d3cb5da7ec472b2d5829fdc73264bb96 /sys/arch/sparc64
parent9a5851d4b30aae599e77ec4538fc8efb635b77cf (diff)
Make write_user_windows() do what the name suggests: flush user windows instead
of all windows.
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/include/cpu.h4
-rw-r--r--sys/arch/sparc64/sparc64/locore.s22
2 files changed, 23 insertions, 3 deletions
diff --git a/sys/arch/sparc64/include/cpu.h b/sys/arch/sparc64/include/cpu.h
index 3db5b3d1506..2bffa5dfa14 100644
--- a/sys/arch/sparc64/include/cpu.h
+++ b/sys/arch/sparc64/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.70 2008/11/22 18:12:32 art Exp $ */
+/* $OpenBSD: cpu.h,v 1.71 2009/01/23 19:16:39 kettenis Exp $ */
/* $NetBSD: cpu.h,v 1.28 2001/06/14 22:56:58 thorpej Exp $ */
/*
@@ -265,7 +265,7 @@ void loadfpstate(struct fpstate64 *);
void clearfpstate(void);
u_int64_t probeget(paddr_t, int, int);
#define write_all_windows() __asm __volatile("flushw" : : )
-#define write_user_windows() __asm __volatile("flushw" : : )
+void write_user_windows(void);
void proc_trampoline(void);
struct pcb;
void snapshot(struct pcb *);
diff --git a/sys/arch/sparc64/sparc64/locore.s b/sys/arch/sparc64/sparc64/locore.s
index 6fdaa0e0e98..4eafbf2f531 100644
--- a/sys/arch/sparc64/sparc64/locore.s
+++ b/sys/arch/sparc64/sparc64/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.156 2008/12/22 23:01:31 kettenis Exp $ */
+/* $OpenBSD: locore.s,v 1.157 2009/01/23 19:16:39 kettenis Exp $ */
/* $NetBSD: locore.s,v 1.137 2001/08/13 06:10:10 jdolecek Exp $ */
/*
@@ -8891,6 +8891,26 @@ ENTRY(send_softint)
wrpr %g1, 0, %pstate ! restore interrupts
/*
+ * Flush user windows to memory.
+ */
+ENTRY(write_user_windows)
+ rdpr %otherwin, %g1
+ brz %g1, 3f
+ clr %g2
+1:
+ save %sp, -CC64FSZ, %sp
+ rdpr %otherwin, %g1
+ brnz %g1, 1b
+ inc %g2
+2:
+ dec %g2
+ brnz %g2, 2b
+ restore
+3:
+ retl
+ nop
+
+/*
* On Blackbird (UltraSPARC-II) CPUs, writes to %tick_cmpr may fail.
* The workaround is to do a read immediately after the write and make
* sure the same cache line.