Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/riscv Fix RV32 so it gets to the same point as RV64



details:   https://anonhg.NetBSD.org/src/rev/03b57d05c9bb
branches:  trunk
changeset: 371191:03b57d05c9bb
user:      skrll <skrll%NetBSD.org@localhost>
date:      Wed Sep 28 05:02:02 2022 +0000

description:
Fix RV32 so it gets to the same point as RV64

diffstat:

 sys/arch/riscv/conf/Makefile.riscv |   4 ++--
 sys/arch/riscv/riscv/locore.S      |  12 +++++++++---
 2 files changed, 11 insertions(+), 5 deletions(-)

diffs (55 lines):

diff -r 8f8dfa6f4815 -r 03b57d05c9bb sys/arch/riscv/conf/Makefile.riscv
--- a/sys/arch/riscv/conf/Makefile.riscv        Wed Sep 28 00:35:47 2022 +0000
+++ b/sys/arch/riscv/conf/Makefile.riscv        Wed Sep 28 05:02:02 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.riscv,v 1.7 2021/05/01 07:13:21 skrll Exp $
+#      $NetBSD: Makefile.riscv,v 1.8 2022/09/28 05:02:02 skrll Exp $
 
 # Makefile for NetBSD
 #
@@ -71,7 +71,7 @@
 .if ${MACHINE_ARCH} == "riscv64" && ${LP64:Uyes} == "yes"
 TEXTADDR?=             0xFFFFFFC000000000
 .else
-TEXTADDR?=             0xC0001000
+TEXTADDR?=             0x80200000
 .endif
 KERNLDSCRIPT?=         ${RISCV}/conf/kern.ldscript
 EXTRA_LINKFLAGS=       ${LDOPTS} --relax
diff -r 8f8dfa6f4815 -r 03b57d05c9bb sys/arch/riscv/riscv/locore.S
--- a/sys/arch/riscv/riscv/locore.S     Wed Sep 28 00:35:47 2022 +0000
+++ b/sys/arch/riscv/riscv/locore.S     Wed Sep 28 05:02:02 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.S,v 1.26 2022/09/27 08:18:21 skrll Exp $ */
+/* $NetBSD: locore.S,v 1.27 2022/09/28 05:02:02 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014, 2022 The NetBSD Foundation, Inc.
@@ -222,11 +222,16 @@
 
        VPRINTX(s3)
 #endif
-#endif
 
        VPRINTS(": ")
        VPRINTXNL(t0)
        VPRINTS("\n\r")
+#endif // _LP64
+
+#if ((VM_MIN_KERNEL_ADDRESS >> SEGSHIFT) & (NPDEPG - 1)) * SZREG
+       li      t1,  ((VM_MIN_KERNEL_ADDRESS >> SEGSHIFT) & (NPDEPG - 1)) * SZREG
+       add     s2, s2, t1
+#endif
 
 #if PGSHIFT < PTE_PPN_SHIFT
 #error Code assumes PGSHIFT is greater than PTE_PPN_SHIFT
@@ -240,7 +245,8 @@
        // Fill in the PDEs for kernel.
        //
        PTR_LA  s0, start
-       srli    s0, s0, (PGSHIFT - PTE_PPN_SHIFT)
+       srli    s0, s0, SEGSHIFT        // round down to NBSEG, and shift in
+       slli    s0, s0, (SEGSHIFT - PGSHIFT + PTE_PPN_SHIFT)    // ... to PPN
        or      s0, s0, s7
 .Lfill:
        VPRINTS("kern ")



Home | Main Index | Thread Index | Old Index