Skip to content

Commit 6140ba6

Browse files
Add --implicit-mem-0 option to FreeRTOS demos to disable zero-init (#399)
Many RISC-V simulators start with memory implicitly zeroed. I have PR-d a commit to CTSRD-CHERI/FreeRTOS-Demos-CHERI-RISC-V#5 which allows the .bss and .sbss zero-initialization to be disabled in these cases, because it takes too long to simulate and isn't necessary in this case. This commit adds an option to cheribuild which passes an option to the FreeRTOS demos to disable the zero-initialization.
1 parent 06934cf commit 6140ba6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pycheribuild/projects/cross/freertos.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ def setup_config_options(cls, **kwargs):
199199
"platform, RISC-V arch and RISC-V abi in the "
200200
"$platform-$arch-$abi format. See RISC-V-Generic/README for more details")
201201

202+
cls.implicit_mem_0 = cls.add_bool_option(
203+
"implicit_mem_0", show_help=True, default=False,
204+
help="Set if running on a simulation platform which initializes memory to zero. "
205+
"This allows the boot phase to skip zero-initialization steps.")
206+
202207
def default_demo_bsp(self):
203208
return "qemu_virt-" + self.target_info.get_riscv_arch_string(self.crosscompile_target, softfloat=True) + "-" + \
204209
self.target_info.get_riscv_abi(self.crosscompile_target, softfloat=True)
@@ -287,6 +292,9 @@ def configure(self):
287292
if self.log_udp:
288293
config_options += ["--log_udp"]
289294

295+
if self.implicit_mem_0:
296+
config_options += ["--implicit-mem-0"]
297+
290298
self._run_waf("distclean", "configure", *config_options)
291299

292300
def install(self, **kwargs):

0 commit comments

Comments
 (0)