summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1999-08-17 16:09:22 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1999-08-17 16:09:22 +0000
commit59377078fca7bc471d831a664d3455936cf44d75 (patch)
tree5528b091df49172b9a6df7c482483b3ea52a480a /sys/arch
parenta542dc1d959bb5c67554386704fedffdd4fac335 (diff)
mem_access_fault4m: init ftype earlier to avoid passing junk to trapsignal
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc/sparc/trap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/sparc/sparc/trap.c b/sys/arch/sparc/sparc/trap.c
index 1ea9edb154f..66db2e86a76 100644
--- a/sys/arch/sparc/sparc/trap.c
+++ b/sys/arch/sparc/sparc/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.18 1999/07/09 21:30:03 art Exp $ */
+/* $OpenBSD: trap.c,v 1.19 1999/08/17 16:09:21 art Exp $ */
/* $NetBSD: trap.c,v 1.58 1997/09/12 08:55:01 pk Exp $ */
/*
@@ -890,6 +890,8 @@ mem_access_fault4m(type, sfsr, sfva, afsr, afva, tf)
if ((sfsr & SFSR_FT) == SFSR_FT_NONE)
goto out; /* No fault. Why were we called? */
+ ftype = sfsr & SFSR_AT_STORE ? VM_PROT_WRITE : VM_PROT_READ;
+
/*
* NOTE: the per-CPU fault status register readers (in locore)
* may already have decided to pass `pc' in `sfva', so we avoid
@@ -943,7 +945,6 @@ mem_access_fault4m(type, sfsr, sfva, afsr, afva, tf)
/* Now munch on protections... */
- ftype = sfsr & SFSR_AT_STORE ? VM_PROT_WRITE : VM_PROT_READ;
if (psr & PSR_PS) {
extern char Lfsbail[];
if (sfsr & SFSR_AT_TEXT || type == T_TEXTFAULT) {