Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/news68k/news68k Fix mm_md_physacc() to allow only a...



details:   https://anonhg.NetBSD.org/src/rev/81a9e1c2e09b
branches:  trunk
changeset: 1022767:81a9e1c2e09b
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri Aug 06 05:53:50 2021 +0000

description:
Fix mm_md_physacc() to allow only accesses to a region of RAMs.

Note on NetBSD/news68k RAMs reserved by the PROM (at the end of the RAM)
are not managed.

diffstat:

 sys/arch/news68k/news68k/machdep.c |  15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r 11c1f57f41a0 -r 81a9e1c2e09b sys/arch/news68k/news68k/machdep.c
--- a/sys/arch/news68k/news68k/machdep.c        Fri Aug 06 05:22:21 2021 +0000
+++ b/sys/arch/news68k/news68k/machdep.c        Fri Aug 06 05:53:50 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.108 2020/06/11 19:20:44 ad Exp $ */
+/*     $NetBSD: machdep.c,v 1.109 2021/08/06 05:53:50 tsutsui Exp $    */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.108 2020/06/11 19:20:44 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.109 2021/08/06 05:53:50 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -992,8 +992,17 @@
 int
 mm_md_physacc(paddr_t pa, vm_prot_t prot)
 {
+       paddr_t memend;
 
-       return (pa < lowram || pa >= 0xfffffffc) ? EFAULT : 0;
+       /*
+        * news68k has one contiguous memory segment.
+        */
+       memend = lowram + ctob(physmem);
+
+       if (lowram <= pa && pa < memend) 
+               return 0;
+
+       return EFAULT;
 }
 
 int



Home | Main Index | Thread Index | Old Index