From c7694c0f419ec54569d6595e216ba0238eaa1808 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 2 Apr 2025 15:30:30 +0200 Subject: fw/rv64: fix linker error. --- src/coreboot-start.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/coreboot-start.c') diff --git a/src/coreboot-start.c b/src/coreboot-start.c index 07606fc..c7b5094 100644 --- a/src/coreboot-start.c +++ b/src/coreboot-start.c @@ -27,13 +27,18 @@ extern void cb_start_rom(void); extern int cb_boot_processor_ready; -/// @brief hardware thread counter. +/// @brief hardware thread counter (rv64 only) +#ifdef __riscv64__ +uint64_t __cb_hart_counter = 0UL; +#endif /// @brief Start executing the firmware. /// @param void cb_start_exec(void) { +#ifndef __riscv64__ static uint64_t __cb_hart_counter = 0UL; +#endif ++__cb_hart_counter; -- cgit v1.2.3 From a113f91c6be56c3f39fc7680ec7f5c814d4d2c27 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 2 Apr 2025 15:33:03 +0200 Subject: tweak/rv64: use __COMPILE_RISCV__ instead of guessing each compiler's platform macro. Signed-off-by: Amlal El Mahrouss --- src/coreboot-start.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/coreboot-start.c') diff --git a/src/coreboot-start.c b/src/coreboot-start.c index c7b5094..cfcc668 100644 --- a/src/coreboot-start.c +++ b/src/coreboot-start.c @@ -28,7 +28,7 @@ extern void cb_start_rom(void); extern int cb_boot_processor_ready; /// @brief hardware thread counter (rv64 only) -#ifdef __riscv64__ +#ifdef __COMPILE_RISCV__ uint64_t __cb_hart_counter = 0UL; #endif @@ -36,7 +36,7 @@ uint64_t __cb_hart_counter = 0UL; /// @param void cb_start_exec(void) { -#ifndef __riscv64__ +#ifndef __COMPILE_RISCV__ static uint64_t __cb_hart_counter = 0UL; #endif -- cgit v1.2.3