diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2010-11-27 18:04:24 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2010-11-27 18:04:24 +0000 |
commit | b76fc25e2f6671e9837c975c06b215a10e331621 (patch) | |
tree | 2503356c5e9b6e7fb215cc7cbead4e999f1072c7 /sys/arch/vax | |
parent | bc77e18a92190ebc45aaee71099662fe36f7b61d (diff) |
Make sure kcopy() returns EFAULT instead of -1 upon failure on vax, and
fix outdated comments suggesting kcopy() will return -1.
Diffstat (limited to 'sys/arch/vax')
-rw-r--r-- | sys/arch/vax/vax/locore.S | 16 | ||||
-rw-r--r-- | sys/arch/vax/vax/trap.c | 5 |
2 files changed, 7 insertions, 14 deletions
diff --git a/sys/arch/vax/vax/locore.S b/sys/arch/vax/vax/locore.S index 84cdfb5fa2b..404a821187d 100644 --- a/sys/arch/vax/vax/locore.S +++ b/sys/arch/vax/vax/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.3 2010/06/29 18:46:34 tedu Exp $ */ +/* $OpenBSD: locore.S,v 1.4 2010/11/27 18:04:23 miod Exp $ */ /* $NetBSD: intvec.s,v 1.39 1999/06/28 08:20:48 itojun Exp $ */ /* @@ -615,10 +615,10 @@ ENTRY_NOPROFILE(copyout, R2|R3|R4|R5|R6) 3: movl $EFAULT, r0 ret -/* kcopy: just like bcopy, except return -1 upon failure */ +/* kcopy: just like bcopy, except return EFAULT upon failure */ ENTRY_NOPROFILE(kcopy,R2|R3|R4|R5|R6) movl *pcbtrap,-(sp) - movab 2f,*pcbtrap + movab 1f,*pcbtrap movl 4(ap), r0 movl 8(ap), r1 movzwl 12(ap), r2 @@ -633,18 +633,12 @@ ENTRY_NOPROFILE(kcopy,R2|R3|R4|R5|R6) sobgtr r6, 0b /* - * If there is a failure, trap.c will set r1 to -1, and jump - * to the following 2. If not, we return 0. We duplicate a - * minuscule amount of code in the interest of speed; movc3 - * sets r0 to 0 anyway. + * If there is a failure, trap.c will set r0 to EFAULT, and jump + * to the following 1. If not, we return 0 (movc3 sets r0 to 0). */ 1: movl (sp)+,*pcbtrap ret - -2: movl (sp)+,*pcbtrap - movl r1,r0 - ret ENTRY_NOPROFILE(copyinstr,0) tstl 4(ap) # is from a kernel address? diff --git a/sys/arch/vax/vax/trap.c b/sys/arch/vax/vax/trap.c index 3ff3e3ea17a..e31a0897d6c 100644 --- a/sys/arch/vax/vax/trap.c +++ b/sys/arch/vax/vax/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.39 2007/05/16 05:19:15 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.40 2010/11/27 18:04:23 miod Exp $ */ /* $NetBSD: trap.c,v 1.47 1999/08/21 19:26:20 matt Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -96,8 +96,7 @@ int no_traps = 18; do if (p->p_addr->u_pcb.iftrap) { \ frame->pc = (unsigned)p->p_addr->u_pcb.iftrap; \ frame->psl &= ~PSL_FPD; \ - frame->r0 = EFAULT;/* for copyin/out */ \ - frame->r1 = -1; /* for fetch/store */ \ + frame->r0 = EFAULT; \ return; \ } while (0) |