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 In ddb, fixed "trace/u" and user pr...



details:   https://anonhg.NetBSD.org/src/rev/a32bfca0bcb2
branches:  trunk
changeset: 366437:a32bfca0bcb2
user:      ryo <ryo%NetBSD.org@localhost>
date:      Thu May 26 17:11:05 2022 +0000

description:
In ddb, fixed "trace/u" and user process memory read/write to work correctly.

In the softint context, curlwp points the kernel lwp, so to get the pmap
of a user process, we had to use curcpu()->ci_onproc->l_proc instead of
curproc (curlwp->l_proc). Adviced by ad@.

diffstat:

 sys/arch/aarch64/aarch64/db_interface.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 8e1a2b2aed8b -r a32bfca0bcb2 sys/arch/aarch64/aarch64/db_interface.c
--- a/sys/arch/aarch64/aarch64/db_interface.c   Thu May 26 16:52:30 2022 +0000
+++ b/sys/arch/aarch64/aarch64/db_interface.c   Thu May 26 17:11:05 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.16 2021/05/19 12:16:01 skrll Exp $ */
+/* $NetBSD: db_interface.c,v 1.17 2022/05/26 17:11:05 ryo Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.16 2021/05/19 12:16:01 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.17 2022/05/26 17:11:05 ryo Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -60,7 +60,7 @@
 static int
 db_validate_address(vaddr_t addr)
 {
-       struct proc *p = curproc;
+       struct proc *p = curcpu()->ci_onproc->l_proc;
        struct pmap *pmap;
 
        if (!p || !p->p_vmspace || !p->p_vmspace->vm_map.pmap ||



Home | Main Index | Thread Index | Old Index