From 77389d27b53933dc5a85cfe86fbb2a0d1727cdec Mon Sep 17 00:00:00 2001 From: "William D. Jones" Date: Thu, 1 Nov 2018 02:18:03 -0400 Subject: [PATCH] libbase/crt0-picorv32: Ensure BSS is cleared on boot. --- litex/soc/software/libbase/crt0-picorv32.S | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/litex/soc/software/libbase/crt0-picorv32.S b/litex/soc/software/libbase/crt0-picorv32.S index 1d6faa85..054f84d3 100644 --- a/litex/soc/software/libbase/crt0-picorv32.S +++ b/litex/soc/software/libbase/crt0-picorv32.S @@ -180,6 +180,14 @@ _crt0: la t1, _irq_mask sw t0, 0(t1) + /* Clear BSS */ + la t0, _fbss + la t1, _ebss +2: + sw zero, 0(t0) + addi t0, t0, 4 + bltu t0, t1, 2b + /* set main stack */ la sp, _fstack -- 2.30.2