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 | |
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')
-rw-r--r-- | sys/arch/solbourne/solbourne/locore.s | 6 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/locore.s | 4 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/locore.s | 4 | ||||
-rw-r--r-- | sys/arch/vax/vax/locore.S | 16 | ||||
-rw-r--r-- | sys/arch/vax/vax/trap.c | 5 |
5 files changed, 14 insertions, 21 deletions
diff --git a/sys/arch/solbourne/solbourne/locore.s b/sys/arch/solbourne/solbourne/locore.s index 21644f93067..3671bd8e5ce 100644 --- a/sys/arch/solbourne/solbourne/locore.s +++ b/sys/arch/solbourne/solbourne/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.14 2009/04/10 20:57:28 miod Exp $ */ +/* $OpenBSD: locore.s,v 1.15 2010/11/27 18:04:20 miod Exp $ */ /* OpenBSD: locore.s,v 1.64 2005/04/17 18:47:50 miod Exp */ /* @@ -3950,8 +3950,8 @@ Lback_mopb: stb %o4, [%o1 - 1] ! } /* - * kcopy() is exactly like bcopy except that it set pcb_onfault such that - * when a fault occurs, it is able to return -1 to indicate this to the + * kcopy() is exactly like old bcopy except that it set pcb_onfault such that + * when a fault occurs, it is able to return EFAULT to indicate this to the * caller. */ ENTRY(kcopy) diff --git a/sys/arch/sparc/sparc/locore.s b/sys/arch/sparc/sparc/locore.s index 527a1ba414b..6de829ec45c 100644 --- a/sys/arch/sparc/sparc/locore.s +++ b/sys/arch/sparc/sparc/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.88 2010/07/10 19:32:25 miod Exp $ */ +/* $OpenBSD: locore.s,v 1.89 2010/11/27 18:04:21 miod Exp $ */ /* $NetBSD: locore.s,v 1.73 1997/09/13 20:36:48 pk Exp $ */ /* @@ -5088,7 +5088,7 @@ Lback_mopb: /* * kcopy() is exactly like old bcopy except that it set pcb_onfault such that - * when a fault occurs, it is able to return -1 to indicate this to the + * when a fault occurs, it is able to return EFAULT to indicate this to the * caller. */ ENTRY(kcopy) diff --git a/sys/arch/sparc64/sparc64/locore.s b/sys/arch/sparc64/sparc64/locore.s index eb9617d6c8c..f200b2a4d8b 100644 --- a/sys/arch/sparc64/sparc64/locore.s +++ b/sys/arch/sparc64/sparc64/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.162 2010/03/27 23:12:48 kettenis Exp $ */ +/* $OpenBSD: locore.s,v 1.163 2010/11/27 18:04:23 miod Exp $ */ /* $NetBSD: locore.s,v 1.137 2001/08/13 06:10:10 jdolecek Exp $ */ /* @@ -8318,7 +8318,7 @@ Lbzero_block: /* * kcopy() is exactly like bcopy except that it set pcb_onfault such that - * when a fault occurs, it is able to return -1 to indicate this to the + * when a fault occurs, it is able to return EFAULT to indicate this to the * caller. */ ENTRY(kcopy) 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) |