Page MenuHomeFreeBSD

D23139.id66920.diff
No OneTemporary

D23139.id66920.diff

Index: head/sys/riscv/riscv/locore.S
===================================================================
--- head/sys/riscv/riscv/locore.S
+++ head/sys/riscv/riscv/locore.S
@@ -53,6 +53,12 @@
.text
.globl _start
_start:
+ /* Set the global pointer */
+.option push
+.option norelax
+ lla gp, __global_pointer$
+.option pop
+
/* Get the physical address kernel loaded to */
lla t0, virt_map
ld t1, 0(t0)
@@ -168,6 +174,11 @@
.align 2
va:
+ /* Set the global pointer again, this time with the virtual address. */
+.option push
+.option norelax
+ lla gp, __global_pointer$
+.option pop
/* Setup supervisor trap vector */
la t0, cpu_exception_handler
@@ -177,12 +188,6 @@
li t0, 0
csrw sscratch, t0
- /* Set the global pointer */
-.option push
-.option norelax
- la gp, __global_pointer$
-.option pop
-
/* Initialize stack pointer */
la s3, initstack_end
mv sp, s3
@@ -322,6 +327,12 @@
.align 2
mpva:
+ /* Set the global pointer again, this time with the virtual address. */
+.option push
+.option norelax
+ lla gp, __global_pointer$
+.option pop
+
/* Setup supervisor trap vector */
la t0, cpu_exception_handler
csrw stvec, t0
@@ -329,12 +340,6 @@
/* Ensure sscratch is zero */
li t0, 0
csrw sscratch, t0
-
- /* Set the global pointer */
-.option push
-.option norelax
- la gp, __global_pointer$
-.option pop
call init_secondary
END(mpentry)

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 14, 5:45 PM (3 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25295153
Default Alt Text
D23139.id66920.diff (1 KB)

Event Timeline