[rtems commit] bsp/riscv: Load global pointer

Sebastian Huber sebh at rtems.org
Fri Jun 29 09:56:16 UTC 2018


Module:    rtems
Branch:    master
Commit:    9b2ef07f4b2307c2ea7c057918643747e8e2f4a4
Changeset: http://git.rtems.org/rtems/commit/?id=9b2ef07f4b2307c2ea7c057918643747e8e2f4a4

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Jun 22 13:30:21 2018 +0200

bsp/riscv: Load global pointer

Update #3433.

---

 bsps/riscv/riscv/start/start.S                | 6 ++++++
 cpukit/score/cpu/riscv/riscv-context-switch.S | 2 --
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/bsps/riscv/riscv/start/start.S b/bsps/riscv/riscv/start/start.S
index 3674a4b..58bc57d 100644
--- a/bsps/riscv/riscv/start/start.S
+++ b/bsps/riscv/riscv/start/start.S
@@ -46,6 +46,12 @@ PUBLIC(_start)
 
 TYPE_FUNC(_start)
 SYM(_start):
+	/* Load global pointer */
+	.option	push
+	.option	norelax
+	la	gp, __global_pointer$
+	.option	pop
+
 	la	t0, ISR_Handler
 	csrw	mtvec, t0
 
diff --git a/cpukit/score/cpu/riscv/riscv-context-switch.S b/cpukit/score/cpu/riscv/riscv-context-switch.S
index 448a599..705cd77 100644
--- a/cpukit/score/cpu/riscv/riscv-context-switch.S
+++ b/cpukit/score/cpu/riscv/riscv-context-switch.S
@@ -51,7 +51,6 @@ SYM(_CPU_Context_switch):
 
 	SREG	x1, (1 * CPU_SIZEOF_POINTER)(a0)
 	SREG	x2, (2 * CPU_SIZEOF_POINTER)(a0)
-	SREG	x3, (3 * CPU_SIZEOF_POINTER)(a0)
 	SREG	x4, (4 * CPU_SIZEOF_POINTER)(a0)
 	SREG	x5, (5 * CPU_SIZEOF_POINTER)(a0)
 	SREG	x6, (6 * CPU_SIZEOF_POINTER)(a0)
@@ -85,7 +84,6 @@ SYM(_CPU_Context_switch):
 
 	LREG	x1, (1 * CPU_SIZEOF_POINTER)(a1)
 	LREG	x2, (2 * CPU_SIZEOF_POINTER)(a1)
-	LREG	x3, (3 * CPU_SIZEOF_POINTER)(a1)
 	LREG	x4, (4 * CPU_SIZEOF_POINTER)(a1)
 	LREG	x5, (5 * CPU_SIZEOF_POINTER)(a1)
 	LREG	x6, (6 * CPU_SIZEOF_POINTER)(a1)



More information about the vc mailing list