From c1fffcb70b2f80e45f3745114b32eed027f51ec8 Mon Sep 17 00:00:00 2001 From: Daniel Lublin Date: Tue, 7 Mar 2023 15:03:59 +0100 Subject: [PATCH] Keep uninitialized var in main, not globally, preventing any BSS Signed-off-by: Daniel Lublin --- hw/application_fpga/fw/testfw/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/application_fpga/fw/testfw/main.c b/hw/application_fpga/fw/testfw/main.c index c9ca8f7..18a8fab 100644 --- a/hw/application_fpga/fw/testfw/main.c +++ b/hw/application_fpga/fw/testfw/main.c @@ -24,9 +24,6 @@ volatile uint32_t *timer_ctrl = (volatile uint32_t *)TK1_MMIO_TIMER_CTRL; volatile uint32_t *trng_status = (volatile uint32_t *)TK1_MMIO_TRNG_STATUS; volatile uint32_t *trng_entropy = (volatile uint32_t *)TK1_MMIO_TRNG_ENTROPY; volatile uint32_t *fw_blake2s_addr = (volatile uint32_t *)TK1_MMIO_TK1_BLAKE2S; - -// Function pointer to blake2s() -volatile int (*fw_blake2s)(void *, unsigned long, const void *, unsigned long, const void *, unsigned long, blake2s_ctx *); // clang-format on #define UDS_WORDS 8 @@ -110,6 +107,11 @@ uint32_t wait_timer_tick(uint32_t last_timer) int main() { + // Function pointer to blake2s() + volatile int (*fw_blake2s)(void *, unsigned long, const void *, + unsigned long, const void *, unsigned long, + blake2s_ctx *); + uint8_t in; // Wait for terminal program and a character to be typed @@ -190,9 +192,7 @@ int main() // Set up another stack because fw_ram is not available // anymore in app_mode. - asm volatile( - "li sp, 0x40006ff0" - ); + asm volatile("li sp, 0x40006ff0"); *switch_app = 1;