From cd2dc553716a061c3b39f5f4b16a3e541b4250ea Mon Sep 17 00:00:00 2001 From: Michael Cardell Widerkrantz Date: Fri, 10 Mar 2023 12:14:25 +0100 Subject: [PATCH] fw: Add function declaration for static functions --- hw/application_fpga/fw/tk1/main.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/hw/application_fpga/fw/tk1/main.c b/hw/application_fpga/fw/tk1/main.c index 4e8bdb6..ed0439f 100644 --- a/hw/application_fpga/fw/tk1/main.c +++ b/hw/application_fpga/fw/tk1/main.c @@ -42,6 +42,21 @@ struct context { uint8_t uss[32]; // User Supplied Secret, if any }; +static void print_hw_version(); +static void print_digest(uint8_t *md); +static uint32_t rnd_word(); +static void compute_cdi(const uint8_t digest[32], const uint8_t use_uss, + const uint8_t uss[32]); +static void copy_name(uint8_t *buf, const size_t bufsiz, const uint32_t word); +static enum state initial_commands(const struct frame_header *hdr, + const uint8_t *cmd, enum state state, + struct context *ctx); +static enum state loading_commands(const struct frame_header *hdr, + const uint8_t *cmd, enum state state, + struct context *ctx); +static void run(const struct context *ctx); +static void scramble_ram(); + static void print_hw_version() { htif_puts("Hello, I'm firmware with"); @@ -66,7 +81,7 @@ static void print_digest(uint8_t *md) htif_lf(); } -uint32_t rnd_word() +static uint32_t rnd_word() { while ((*trng_status & (1 << TK1_MMIO_TRNG_STATUS_READY_BIT)) == 0) { } @@ -339,7 +354,7 @@ static void run(const struct context *ctx) __builtin_unreachable(); } -void scramble_ram() +static void scramble_ram() { uint32_t *ram = (uint32_t *)(TK1_RAM_BASE); uint32_t rnd = rnd_word();