Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/aarch64/aarch64 use lwp_trapframe() macro. NFC.



details:   https://anonhg.NetBSD.org/src/rev/5bda4d8ea672
branches:  trunk
changeset: 1023702:5bda4d8ea672
user:      ryo <ryo%NetBSD.org@localhost>
date:      Thu Sep 23 15:19:03 2021 +0000

description:
use lwp_trapframe() macro. NFC.

diffstat:

 sys/arch/aarch64/aarch64/core_machdep.c     |   6 +++---
 sys/arch/aarch64/aarch64/cpu_machdep.c      |   8 ++++----
 sys/arch/aarch64/aarch64/exec_machdep.c     |   6 +++---
 sys/arch/aarch64/aarch64/netbsd32_machdep.c |  16 ++++++++--------
 sys/arch/aarch64/aarch64/process_machdep.c  |  14 +++++++-------
 sys/arch/aarch64/aarch64/sig_machdep.c      |   6 +++---
 sys/arch/aarch64/aarch64/syscall.c          |   6 +++---
 7 files changed, 31 insertions(+), 31 deletions(-)

diffs (273 lines):

diff -r dc5a68954925 -r 5bda4d8ea672 sys/arch/aarch64/aarch64/core_machdep.c
--- a/sys/arch/aarch64/aarch64/core_machdep.c   Thu Sep 23 13:59:27 2021 +0000
+++ b/sys/arch/aarch64/aarch64/core_machdep.c   Thu Sep 23 15:19:03 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: core_machdep.c,v 1.5 2019/11/20 19:37:51 pgoyette Exp $ */
+/* $NetBSD: core_machdep.c,v 1.6 2021/09/23 15:19:03 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: core_machdep.c,v 1.5 2019/11/20 19:37:51 pgoyette Exp $");
+__KERNEL_RCSID(1, "$NetBSD: core_machdep.c,v 1.6 2021/09/23 15:19:03 ryo Exp $");
 
 #include <sys/types.h>
 #include <sys/cpu.h>
@@ -66,7 +66,7 @@
                return 0;
        }
 
-       md_core.reg = l->l_md.md_utf->tf_regs;
+       md_core.reg = lwp_trapframe(l)->tf_regs;
        md_core.reg.r_tpidr = (uint64_t)(uintptr_t)l->l_private;
 
        fpu_save(l);
diff -r dc5a68954925 -r 5bda4d8ea672 sys/arch/aarch64/aarch64/cpu_machdep.c
--- a/sys/arch/aarch64/aarch64/cpu_machdep.c    Thu Sep 23 13:59:27 2021 +0000
+++ b/sys/arch/aarch64/aarch64/cpu_machdep.c    Thu Sep 23 15:19:03 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_machdep.c,v 1.11 2020/08/12 13:19:35 skrll Exp $ */
+/* $NetBSD: cpu_machdep.c,v 1.12 2021/09/23 15:19:03 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014, 2019 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: cpu_machdep.c,v 1.11 2020/08/12 13:19:35 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu_machdep.c,v 1.12 2021/09/23 15:19:03 ryo Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -181,7 +181,7 @@
 void
 cpu_getmcontext(struct lwp *l, mcontext_t *mcp, unsigned int *flagsp)
 {
-       const struct trapframe * const tf = l->l_md.md_utf;
+       const struct trapframe * const tf = lwp_trapframe(l);
 
        memcpy(mcp->__gregs, &tf->tf_regs, sizeof(mcp->__gregs));
        mcp->__gregs[_REG_TPIDR] = (uintptr_t)l->l_private;
@@ -202,7 +202,7 @@
        struct proc * const p = l->l_proc;
 
        if (flags & _UC_CPU) {
-               struct trapframe * const tf = l->l_md.md_utf;
+               struct trapframe * const tf = lwp_trapframe(l);
                int error = cpu_mcontext_validate(l, mcp);
                if (error)
                        return error;
diff -r dc5a68954925 -r 5bda4d8ea672 sys/arch/aarch64/aarch64/exec_machdep.c
--- a/sys/arch/aarch64/aarch64/exec_machdep.c   Thu Sep 23 13:59:27 2021 +0000
+++ b/sys/arch/aarch64/aarch64/exec_machdep.c   Thu Sep 23 15:19:03 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_machdep.c,v 1.9 2020/12/11 18:03:33 skrll Exp $ */
+/* $NetBSD: exec_machdep.c,v 1.10 2021/09/23 15:19:03 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: exec_machdep.c,v 1.9 2020/12/11 18:03:33 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exec_machdep.c,v 1.10 2021/09/23 15:19:03 ryo Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_netbsd32.h"
@@ -142,7 +142,7 @@
 setregs(struct lwp *l, struct exec_package *pack, vaddr_t stack)
 {
        struct proc * const p = l->l_proc;
-       struct trapframe * const tf = l->l_md.md_utf;
+       struct trapframe * const tf = lwp_trapframe(l);
 
        aarch64_setregs_ptrauth(l, true);
 
diff -r dc5a68954925 -r 5bda4d8ea672 sys/arch/aarch64/aarch64/netbsd32_machdep.c
--- a/sys/arch/aarch64/aarch64/netbsd32_machdep.c       Thu Sep 23 13:59:27 2021 +0000
+++ b/sys/arch/aarch64/aarch64/netbsd32_machdep.c       Thu Sep 23 15:19:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.18 2021/05/30 05:40:56 rin Exp $        */
+/*     $NetBSD: netbsd32_machdep.c,v 1.19 2021/09/23 15:19:03 ryo Exp $        */
 
 /*
  * Copyright (c) 2018 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.18 2021/05/30 05:40:56 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.19 2021/09/23 15:19:03 ryo Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -63,7 +63,7 @@
 netbsd32_setregs(struct lwp *l, struct exec_package *pack, vaddr_t stack)
 {
        struct proc * const p = l->l_proc;
-       struct trapframe * const tf = l->l_md.md_utf;
+       struct trapframe * const tf = lwp_trapframe(l);
 
        netbsd32_adjust_limits(p);
 
@@ -132,7 +132,7 @@
 netbsd32_process_read_regs(struct lwp *l, struct reg32 *regs)
 {
        struct proc * const p = l->l_proc;
-       struct trapframe *tf = l->l_md.md_utf;
+       struct trapframe *tf = lwp_trapframe(l);
        int i;
 
        if ((p->p_flag & PK_32) == 0)
@@ -201,7 +201,7 @@
 netbsd32_process_write_regs(struct lwp *l, const struct reg32 *regs)
 {
        struct proc * const p = l->l_proc;
-       struct trapframe *tf = l->l_md.md_utf;
+       struct trapframe *tf = lwp_trapframe(l);
        int i;
 
        if ((p->p_flag & PK_32) == 0)
@@ -305,7 +305,7 @@
 {
        struct lwp * const l = curlwp;
        struct proc * const p = l->l_proc;
-       struct trapframe * const tf = l->l_md.md_utf;
+       struct trapframe * const tf = lwp_trapframe(l);
        struct sigaltstack * const ss = &l->l_sigstk;
        const int signo = ksi->ksi_signo;
        const struct sigaction * const sa = &SIGACTION(p, signo);
@@ -434,7 +434,7 @@
 void
 cpu_getmcontext32(struct lwp *l, mcontext32_t *mcp, unsigned int *flagsp)
 {
-       struct trapframe * const tf = l->l_md.md_utf;
+       struct trapframe * const tf = lwp_trapframe(l);
        __greg32_t *gr = mcp->__gregs;
        __greg32_t ras_pc;
 
@@ -498,7 +498,7 @@
 int
 cpu_setmcontext32(struct lwp *l, const mcontext32_t *mcp, unsigned int flags)
 {
-       struct trapframe * const tf = l->l_md.md_utf;
+       struct trapframe * const tf = lwp_trapframe(l);
        const __greg32_t * const gr = mcp->__gregs;
        struct proc * const p = l->l_proc;
        int error, i, j;
diff -r dc5a68954925 -r 5bda4d8ea672 sys/arch/aarch64/aarch64/process_machdep.c
--- a/sys/arch/aarch64/aarch64/process_machdep.c        Thu Sep 23 13:59:27 2021 +0000
+++ b/sys/arch/aarch64/aarch64/process_machdep.c        Thu Sep 23 15:19:03 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: process_machdep.c,v 1.4 2018/12/13 10:44:25 ryo Exp $ */
+/* $NetBSD: process_machdep.c,v 1.5 2021/09/23 15:19:03 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: process_machdep.c,v 1.4 2018/12/13 10:44:25 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: process_machdep.c,v 1.5 2021/09/23 15:19:03 ryo Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -46,7 +46,7 @@
 int
 process_read_regs(struct lwp *l, struct reg *regs)
 {
-       *regs = l->l_md.md_utf->tf_regs;
+       *regs = lwp_trapframe(l)->tf_regs;
        regs->r_tpidr = (uint64_t)(uintptr_t)l->l_private;
        return 0;
 }
@@ -59,7 +59,7 @@
            || (regs->r_pc &  3) || regs->r_pc >= VM_MAXUSER_ADDRESS)
                return EINVAL;
 
-       l->l_md.md_utf->tf_regs = *regs;
+       lwp_trapframe(l)->tf_regs = *regs;
        l->l_private = (void *)regs->r_tpidr;
        return 0;
 }
@@ -92,9 +92,9 @@
 process_sstep(struct lwp *l, int sstep)
 {
        if (sstep)
-               l->l_md.md_utf->tf_spsr |= SPSR_SS;
+               lwp_trapframe(l)->tf_spsr |= SPSR_SS;
        else
-               l->l_md.md_utf->tf_spsr &= ~SPSR_SS;
+               lwp_trapframe(l)->tf_spsr &= ~SPSR_SS;
 
        return 0;
 }
@@ -103,7 +103,7 @@
 process_set_pc(struct lwp *l, void *addr)
 {
 
-       l->l_md.md_utf->tf_pc = (uintptr_t) addr;
+       lwp_trapframe(l)->tf_pc = (uintptr_t) addr;
 
        return 0;
 }
diff -r dc5a68954925 -r 5bda4d8ea672 sys/arch/aarch64/aarch64/sig_machdep.c
--- a/sys/arch/aarch64/aarch64/sig_machdep.c    Thu Sep 23 13:59:27 2021 +0000
+++ b/sys/arch/aarch64/aarch64/sig_machdep.c    Thu Sep 23 15:19:03 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sig_machdep.c,v 1.5 2020/05/01 17:58:48 tnn Exp $ */
+/* $NetBSD: sig_machdep.c,v 1.6 2021/09/23 15:19:03 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: sig_machdep.c,v 1.5 2020/05/01 17:58:48 tnn Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sig_machdep.c,v 1.6 2021/09/23 15:19:03 ryo Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -47,7 +47,7 @@
 {
        struct lwp * const l = curlwp;
        struct proc * const p = l->l_proc;
-       struct trapframe * const tf = l->l_md.md_utf;
+       struct trapframe * const tf = lwp_trapframe(l);
        struct sigaltstack * const ss = &l->l_sigstk;
        const struct sigact_sigdesc * const sd =
            &p->p_sigacts->sa_sigdesc[ksi->ksi_signo];
diff -r dc5a68954925 -r 5bda4d8ea672 sys/arch/aarch64/aarch64/syscall.c
--- a/sys/arch/aarch64/aarch64/syscall.c        Thu Sep 23 13:59:27 2021 +0000
+++ b/sys/arch/aarch64/aarch64/syscall.c        Thu Sep 23 15:19:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: syscall.c,v 1.7 2021/09/23 06:56:26 ryo Exp $  */
+/*     $NetBSD: syscall.c,v 1.8 2021/09/23 15:19:03 ryo Exp $  */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
 #define EMULNAME(x)    (x)
 #define EMULNAMEU(x)   (x)
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.7 2021/09/23 06:56:26 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.8 2021/09/23 15:19:03 ryo Exp $");
 
 void
 cpu_spawn_return(struct lwp *l)
@@ -73,7 +73,7 @@
 void
 md_child_return(struct lwp *l)
 {
-       struct trapframe * const tf = l->l_md.md_utf;
+       struct trapframe * const tf = lwp_trapframe(l);
 
        tf->tf_reg[0] = 0;
        tf->tf_reg[1] = 1;



Home | Main Index | Thread Index | Old Index