[rtems commit] bsp/riscv: Use memset() to clear .bss

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


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Jun 22 11:14:07 2018 +0200

bsp/riscv: Use memset() to clear .bss

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 3fd68f1..3674a4b 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
-
-_loop_clear_bss:
-	bge	t0, t1, _end_clear_bss
-	SREG	x0, 0(t0)
-	addi	t0, t0, CPU_SIZEOF_POINTER
-	j	_loop_clear_bss
-_end_clear_bss:
+	/* 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



More information about the vc mailing list