Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/mips/mips set error return value for user addresses...
details: https://anonhg.NetBSD.org/src/rev/084e71f063aa
branches: trunk
changeset: 756131:084e71f063aa
user: chs <chs%NetBSD.org@localhost>
date: Wed Jul 07 01:21:47 2010 +0000
description:
set error return value for user addresses in kernel space.
(this fixes a bug in my previous checkin here.)
diffstat:
sys/arch/mips/mips/copy.S | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diffs (69 lines):
diff -r 18b51901c36b -r 084e71f063aa sys/arch/mips/mips/copy.S
--- a/sys/arch/mips/mips/copy.S Wed Jul 07 01:21:15 2010 +0000
+++ b/sys/arch/mips/mips/copy.S Wed Jul 07 01:21:47 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: copy.S,v 1.9 2010/03/20 23:31:29 chs Exp $ */
+/* $NetBSD: copy.S,v 1.10 2010/07/07 01:21:47 chs Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -100,7 +100,7 @@
LEAF(copyinstr)
PTR_L v1, L_PCB(MIPS_CURLWP)
PTR_LA v0, _C_LABEL(copystrerr)
- blt a0, zero, _C_LABEL(copystrerr)
+ blt a0, zero, _C_LABEL(copystrefault)
PTR_S v0, PCB_ONFAULT(v1)
move t0, a2
beq a2, zero, 4f
@@ -134,7 +134,7 @@
LEAF(copyoutstr)
PTR_L v1, L_PCB(MIPS_CURLWP)
PTR_LA v0, _C_LABEL(copystrerr)
- blt a1, zero, _C_LABEL(copystrerr)
+ blt a1, zero, _C_LABEL(copystrefault)
PTR_S v0, PCB_ONFAULT(v1)
move t0, a2
beq a2, zero, 4f
@@ -163,6 +163,11 @@
PTR_S zero, PCB_ONFAULT(v1)
END(copystrerr)
+LEAF(copystrefault)
+ b copystrerr
+ li v0, EFAULT
+END(copystrefault)
+
/*
* kcopy(const void *src, void *dst, size_t len);
*
@@ -216,7 +221,7 @@
PTR_SUBU sp, sp, CALLFRAME_SIZ
.mask 0x80000000, -4
REG_S ra, CALLFRAME_RA(sp)
- blt a0, zero, _C_LABEL(copyerr)
+ blt a0, zero, _C_LABEL(copyefault)
move v0, a0 # swap a0, a1 for call to memcpy
move a0, a1
move a1, v0
@@ -243,7 +248,7 @@
PTR_SUBU sp, sp, CALLFRAME_SIZ
.mask 0x80000000, -4
REG_S ra, CALLFRAME_RA(sp)
- blt a1, zero, _C_LABEL(copyerr)
+ blt a1, zero, _C_LABEL(copyefault)
move v0, a0 # swap a0, a1 for call to memcpy
move a0, a1
move a1, v0
@@ -268,6 +273,11 @@
PTR_S zero, PCB_ONFAULT(v1)
END(copyerr)
+LEAF(copyefault)
+ b copyerr
+ li v0, EFAULT
+END(copyefault)
+
/*
* int fuswintr(void *)
* Fetches a short word of data from the user-space address.
Home |
Main Index |
Thread Index |
Old Index