Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/riscv/riscv Fix CONSADDR and save a label



details:   https://anonhg.NetBSD.org/src/rev/88b2bcf62252
branches:  trunk
changeset: 372377:88b2bcf62252
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sat Nov 19 09:55:11 2022 +0000

description:
Fix CONSADDR and save a label

diffstat:

 sys/arch/riscv/riscv/locore.S |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (52 lines):

diff -r 41c4c57f29c0 -r 88b2bcf62252 sys/arch/riscv/riscv/locore.S
--- a/sys/arch/riscv/riscv/locore.S     Sat Nov 19 09:29:26 2022 +0000
+++ b/sys/arch/riscv/riscv/locore.S     Sat Nov 19 09:55:11 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.S,v 1.39 2022/10/16 06:14:53 skrll Exp $ */
+/* $NetBSD: locore.S,v 1.40 2022/11/19 09:55:11 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014, 2022 The NetBSD Foundation, Inc.
@@ -292,7 +292,7 @@
        or      s0, s0, s7
 
        VPRINTS("cons:    ")
-       VPRINTX(s2)
+       VPRINTX(s9)
        VPRINTS(":  ")
        VPRINTXNL(s0)
 
@@ -303,7 +303,7 @@
        call    _C_LABEL(uartputc)
 
        /* Set supervisor trap vector base register */
-       PTR_LA  t0, .Lmmu_on
+       PTR_LA  t0, vstart
        add     t0, t0, s8
        csrw    stvec, t0
 
@@ -319,10 +319,14 @@
        csrw    satp, t0
 
        .align 2
-.Lmmu_on:
+       .global vstart
+vstart:
        // MMU is on!
        csrw    sscratch, zero          // zero in sscratch to mark kernel
 
+#ifdef CONSADDR
+       add     sp, sp, s8
+#endif
        li      a0, 'M'
        call    _C_LABEL(uartputc)      // uartputs doesn't use stack
        li      a0, '\n'
@@ -332,8 +336,6 @@
 
        PTR_LA  tp, _C_LABEL(lwp0)      // put curlwp in tp
 
-       .global vstart
-vstart:
 
        /* Set supervisor trap vector base register */
        PTR_LA  a0, _C_LABEL(cpu_exception_handler)



Home | Main Index | Thread Index | Old Index