[PATCH 11/17] bsp/riscv: Use memset() to clear .bss

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Jun 22 11:59:08 UTC 2018


Update #3433.
---
 bsps/riscv/riscv/start/start.S | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/bsps/riscv/riscv/start/start.S b/bsps/riscv/riscv/start/start.S
index 62aa3b063a..ae45de4876 100644
--- a/bsps/riscv/riscv/start/start.S
+++ b/bsps/riscv/riscv/start/start.S
@@ -52,16 +52,11 @@ SYM(_start):
 	/* load stack and frame pointers */
 	la	sp, _Configuration_Interrupt_stack_area_end
 
-	/* Clearing .bss */
-	la	t0, bsp_section_bss_begin
-	la	t1, bsp_section_bss_end
-
-.Lclear_bss_loop:
-	bge	t0, t1, .Lclear_bss_end
-	SREG	x0, 0(t0)
-	addi	t0, t0, CPU_SIZEOF_POINTER
-	j	.Lclear_bss_loop
-.Lclear_bss_end:
+	/* Clear .bss */
+	la	a0, bsp_section_bss_begin
+	li	a1, 0
+	la	a2, bsp_section_bss_size
+	call	memset
 
 	/* Init FPU unit if it's there */
 	li	t0, MSTATUS_FS
-- 
2.13.7




More information about the devel mailing list