From: William D. Jones Date: Thu, 1 Nov 2018 06:18:03 +0000 (-0400) Subject: libbase/crt0-picorv32: Ensure BSS is cleared on boot. X-Git-Tag: 24jan2021_ls180~1524^2~2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=77389d27b53933dc5a85cfe86fbb2a0d1727cdec;p=litex.git libbase/crt0-picorv32: Ensure BSS is cleared on boot. --- 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