Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/ia64/ia64 fix copy{in, out}{, str}() to return the er...



details:   https://anonhg.NetBSD.org/src/rev/dfe3f4afa776
branches:  trunk
changeset: 756960:dfe3f4afa776
user:      chs <chs%NetBSD.org@localhost>
date:      Sun Aug 08 18:18:58 2010 +0000

description:
fix copy{in,out}{,str}() to return the error returned by uvm_fault().
part of PR 41813 that I missed earlier.

diffstat:

 sys/arch/ia64/ia64/support.S |  24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diffs (75 lines):

diff -r 47f7e4c71272 -r dfe3f4afa776 sys/arch/ia64/ia64/support.S
--- a/sys/arch/ia64/ia64/support.S      Sun Aug 08 18:17:11 2010 +0000
+++ b/sys/arch/ia64/ia64/support.S      Sun Aug 08 18:18:58 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: support.S,v 1.5 2009/11/27 03:23:10 rmind Exp $        */
+/*     $NetBSD: support.S,v 1.6 2010/08/08 18:18:58 chs Exp $  */
 
 /*-
  * Copyright (c) 1998 Doug Rabson
@@ -57,7 +57,6 @@
 
 #include <machine/asm.h>
 #include <machine/ia64_cpu.h>
-#include <machine/vmparam.h>
 
 #include "assym.h"
 
@@ -708,7 +707,7 @@
        ;;
        cmp.geu p6,p0=in0,loc2                  // is in user space.
        ;;
-(p6)   br.cond.spnt.few copyerr                // if it's not, error out.
+(p6)   br.cond.spnt.few copyefault             // if it's not, error out.
        movl    r14=copyerr                     // set up fault handler.
        add     r15=PC_CURLWP,r13               // find curthread
        ;;
@@ -747,7 +746,7 @@
        ;;
        cmp.geu p6,p0=in1,loc2                  // is in user space.
        ;;
-(p6)   br.cond.spnt.few copyerr                // if it's not, error out.
+(p6)   br.cond.spnt.few copyefault             // if it's not, error out.
        movl    r14=copyerr                     // set up fault handler.
        add     r15=PC_CURLWP,r13               // find curthread
        ;;
@@ -898,7 +897,7 @@
        ;;
        cmp.geu p6,p0=in0,loc2                  // is in user space.
        ;;
-(p6)   br.cond.spnt.few copyerr                // if it's not, error out.
+(p6)   br.cond.spnt.few copyefault             // if it's not, error out.
        movl    r14=copyerr                     // set up fault handler.
        add     r15=PC_CURLWP,r13               // find curthread
        ;;
@@ -936,7 +935,7 @@
        ;;
        cmp.geu p6,p0=in1,loc2                  // is in user space.
        ;;
-(p6)   br.cond.spnt.few copyerr                // if it's not, error out.
+(p6)   br.cond.spnt.few copyefault             // if it's not, error out.
        movl    r14=copyerr                     // set up fault handler.
        add     r15=PC_CURLWP,r13               // find curthread
        ;;
@@ -969,9 +968,20 @@
        add     r14=PCB_ONFAULT,r14 ;;          // &curthread->td_pcb->pcb_onfault
        st8     [r14]=r0                        // reset fault handler
 
+       br.ret.sptk.few rp
+END(copyerr)
+
+ENTRY(copyefault, 0)
+       add     r14=PC_CURLWP,r13 ;;            // find curthread
+       ld8     r14=[r14] ;;
+       add     r14=L_PCB,r14 ;;                // curthread->td_addr
+       ld8     r14=[r14] ;;
+       add     r14=PCB_ONFAULT,r14 ;;          // &curthread->td_pcb->pcb_onfault
+       st8     [r14]=r0                        // reset fault handler
+
        mov     ret0=EFAULT                     // return EFAULT
        br.ret.sptk.few rp
-END(copyerr)
+END(copyefault)
 
 #if defined(GPROF)
 /*



Home | Main Index | Thread Index | Old Index