Skip to content

Commit

Permalink
[sw,pentest] Explicitely mark two functions as OT_USED
Browse files Browse the repository at this point in the history
Those functions are called from assembly and will be discarded otherwise.

Signed-off-by: Amaury Pouly <[email protected]>
  • Loading branch information
pamaury committed Feb 20, 2025
1 parent 80c2e16 commit 12f9cb7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sw/device/tests/penetrationtests/firmware/fi/ibex_fi.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ OT_SECTION(".data")
static volatile uint32_t sram_main_buffer[256];

// Make sure that this function does not get optimized by the compiler.
OT_USED
void increment_counter(void) __attribute__((optnone)) {
asm volatile("addi x5, x5, 1");
}
Expand Down Expand Up @@ -334,6 +335,7 @@ static inline void read_temp_regs(uint32_t buffer[]) {
}

// Make sure that this function does not get optimized by the compiler.
OT_USED
void not_increment_counter(void) __attribute__((optnone)) {
asm volatile("ret");
asm volatile(ADDI10);
Expand Down

0 comments on commit 12f9cb7

Please sign in to comment.