Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/sparc64 remove all MD uses of suword(), rep...



details:   https://anonhg.NetBSD.org/src/rev/9d1e58009aec
branches:  trunk
changeset: 811929:9d1e58009aec
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Nov 22 09:32:34 2015 +0000

description:
remove all MD uses of suword(), replace by copyout()

diffstat:

 sys/arch/sparc64/sparc64/machdep.c          |  11 +++++++----
 sys/arch/sparc64/sparc64/netbsd32_machdep.c |  15 ++++++++++-----
 sys/arch/sparc64/sparc64/sunos_machdep.c    |   9 ++++++---
 3 files changed, 23 insertions(+), 12 deletions(-)

diffs (139 lines):

diff -r 8225cc29db3d -r 9d1e58009aec sys/arch/sparc64/sparc64/machdep.c
--- a/sys/arch/sparc64/sparc64/machdep.c        Sun Nov 22 05:12:22 2015 +0000
+++ b/sys/arch/sparc64/sparc64/machdep.c        Sun Nov 22 09:32:34 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.282 2015/06/11 21:00:05 palle Exp $ */
+/*     $NetBSD: machdep.c,v 1.283 2015/11/22 09:32:34 martin Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.282 2015/06/11 21:00:05 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.283 2015/11/22 09:32:34 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -447,6 +447,7 @@
        sig_t catcher = SIGACTION(p, sig).sa_handler;
        struct trapframe64 *tf = l->l_md.md_tf;
        struct rwindow *newsp;
+       register_t sp;
        /* Allocate an aligned sigframe */
        fp = (void *)((u_long)(fp - 1) & ~0x0f);
 
@@ -472,9 +473,11 @@
         * C stack frame.
         */
        newsp = (struct rwindow *)((u_long)fp - CCFSZ);
-       error = (copyout(&ksi->ksi_info, &fp->sf_si, sizeof(ksi->ksi_info)) != 0 ||
+       sp = (register_t)(uintptr_t)tf->tf_out[6];
+       error = (copyout(&ksi->ksi_info, &fp->sf_si,
+                       sizeof(ksi->ksi_info)) != 0 ||
            copyout(&uc, &fp->sf_uc, ucsz) != 0 ||
-           suword(&newsp->rw_in[6], (uintptr_t)tf->tf_out[6]) != 0);
+           copyout(&sp, &newsp->rw_in[6], sizeof(sp)) != 0);
        mutex_enter(p->p_lock);
 
        if (error) {
diff -r 8225cc29db3d -r 9d1e58009aec sys/arch/sparc64/sparc64/netbsd32_machdep.c
--- a/sys/arch/sparc64/sparc64/netbsd32_machdep.c       Sun Nov 22 05:12:22 2015 +0000
+++ b/sys/arch/sparc64/sparc64/netbsd32_machdep.c       Sun Nov 22 09:32:34 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.106 2015/11/07 21:07:18 martin Exp $    */
+/*     $NetBSD: netbsd32_machdep.c,v 1.107 2015/11/22 09:32:34 martin Exp $    */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.106 2015/11/07 21:07:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.107 2015/11/22 09:32:34 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -178,6 +178,7 @@
        struct trapframe64 *tf;
        int addr, onstack, error;
        struct rwindow32 *oldsp, *newsp;
+       register32_t sp;
        sig_t catcher = SIGACTION(p, sig).sa_handler;
        struct sparc32_sigframe sf;
        extern char netbsd32_sigcode[], netbsd32_esigcode[];
@@ -248,9 +249,11 @@
            printf("sendsig: saving sf to %p, setting stack pointer %p to %p\n",
                   fp, &(((struct rwindow32 *)newsp)->rw_in[6]), oldsp);
 #endif
+       sp = (register32_t)(uintptr_t)oldsp;
        error = (rwindow_save(l) || 
-           copyout((void *)&sf, (void *)fp, sizeof sf) || 
-           suword(&(((struct rwindow32 *)newsp)->rw_in[6]), (u_long)oldsp));
+           copyout(&sf, fp, sizeof sf) || 
+           copyout(&sp, &(((struct rwindow32 *)newsp)->rw_in[6]),
+               sizeof(sp)));
        mutex_enter(p->p_lock);
        if (error) {
                /*
@@ -320,6 +323,7 @@
        netbsd32_intptr_t catcher;
        struct trapframe64 *tf = l->l_md.md_tf;
        struct rwindow32 *oldsp, *newsp;
+       register32_t sp;
        int ucsz, error;
 
        /* Need to attempt to zero extend this 32-bit pointer */
@@ -364,9 +368,10 @@
        netbsd32_si_to_si32(&si32, (const siginfo_t *)&ksi->ksi_info);
        ucsz = (int)(intptr_t)&uc.__uc_pad - (int)(intptr_t)&uc;
        newsp = (struct rwindow32*)((intptr_t)fp - sizeof(struct frame32));
+       sp = (register32_t)(uintptr_t)oldsp;
        error = (copyout(&si32, &fp->sf_si, sizeof si32) ||
            copyout(&uc, &fp->sf_uc, ucsz) ||
-           suword(&newsp->rw_in[6], (intptr_t)oldsp));
+           copyout(&sp, &newsp->rw_in[6], sizeof(sp)));
        mutex_enter(p->p_lock);
 
        if (error) {
diff -r 8225cc29db3d -r 9d1e58009aec sys/arch/sparc64/sparc64/sunos_machdep.c
--- a/sys/arch/sparc64/sparc64/sunos_machdep.c  Sun Nov 22 05:12:22 2015 +0000
+++ b/sys/arch/sparc64/sparc64/sunos_machdep.c  Sun Nov 22 09:32:34 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sunos_machdep.c,v 1.32 2013/11/27 14:22:45 mrg Exp $   */
+/*     $NetBSD: sunos_machdep.c,v 1.33 2015/11/22 09:32:34 martin Exp $        */
 
 /*
  * Copyright (c) 1995 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunos_machdep.c,v 1.32 2013/11/27 14:22:45 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos_machdep.c,v 1.33 2015/11/22 09:32:34 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -88,6 +88,7 @@
        register struct trapframe64 *tf;
        register int addr, onstack; 
        struct rwindow32 *oldsp, *newsp;
+       register32_t sp;
        int sig = ksi->ksi_signo, error;
        sig_t catcher = SIGACTION(p, sig).sa_handler;
        struct sunos_sigframe sf;
@@ -160,9 +161,11 @@
            printf("sunos_sendsig: saving sf to %p, setting stack pointer %p to %p\n",
                   fp, &(((struct rwindow32 *)newsp)->rw_in[6]), oldsp);
 #endif
+       sp = (register32_t)(uintptr_t)oldsp;
        error = (rwindow_save(l) || 
            copyout((void *)&sf, (void *)fp, sizeof sf) || 
-           suword(&(((struct rwindow32 *)newsp)->rw_in[6]), (u_long)oldsp));
+           copyout(&sp, &(((struct rwindow32 *)newsp)->rw_in[6]),
+               sizeof(sp)));
        mutex_enter(p->p_lock);
 
        if (error) {



Home | Main Index | Thread Index | Old Index