|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Application-layer bring-up (called from main() after SystemInit). More...
#include "ra8_infrastructure.h"#include <stdint.h>#include "ra8_attributes.h"#include "ra8_err.h"#include "ra8_log.h"#include "ra8_pin_validator.h"Go to the source code of this file.
Enumerations | |
| enum | ra8_stack_canary_pattern_t : uint32_t { k_ra8_stack_canary_pattern = 0xDEADBEEFUL } |
Functions | |
| static void | internal_write_stack_canary (void) |
| Fill .stack_canary with the sentinel pattern. | |
| void | ra8_infrastructure_init (void) |
| Implementation of ra8_infrastructure_init() – bring-up. | |
| ra8_err_t | ra8_stack_canary_check (void) |
| Implementation of ra8_stack_canary_check() – sentinel check. | |
Variables | |
| uint32_t | g_ra8_ls_stack_canary_start [] |
| uint32_t | g_ra8_ls_stack_canary_end [] |
Application-layer bring-up (called from main() after SystemInit).
Runs after SystemInit() – which already handled VTOR, FPU, lazy stacking, I-cache, D-cache, branch predictor, and priority grouping. This function only covers the application layer:
Anything that depends on a peripheral clock lives in a driver _init() entry point, not here.
Definition in file ra8_infrastructure.c.
| enum ra8_stack_canary_pattern_t : uint32_t |
| Enumerator | |
|---|---|
| k_ra8_stack_canary_pattern | RA8 stack canary pattern. |
Definition at line 42 of file ra8_infrastructure.c.
|
static |
Fill .stack_canary with the sentinel pattern.
Walks the linker-defined region and writes k_ra8_stack_canary_pattern into every word. No-op on the fake host where the linker symbols are absent.
Definition at line 62 of file ra8_infrastructure.c.
References g_ra8_ls_stack_canary_end, g_ra8_ls_stack_canary_start, k_ra8_stack_canary_pattern, and RA8_INTERNAL.
Referenced by ra8_infrastructure_init().
| void ra8_infrastructure_init | ( | void | ) |
Implementation of ra8_infrastructure_init() – bring-up.
Run every piece of infrastructure init that a driver may assume.
Initialises the log backend, resets the pin validator, and seeds the stack canary region.
Definition at line 86 of file ra8_infrastructure.c.
References internal_write_stack_canary(), ra8_log_info, ra8_log_init(), and ra8_pin_validator_reset().
|
nodiscard |
Implementation of ra8_stack_canary_check() – sentinel check.
Verify the SRAM stack canary sentinel pattern.
Walks the linker-defined region and compares each word to k_ra8_stack_canary_pattern.
| k_ra8_ok | Sentinel intact. |
| k_ra8_err_validation_failed | At least one word was corrupted. |
Definition at line 120 of file ra8_infrastructure.c.
References g_ra8_ls_stack_canary_end, g_ra8_ls_stack_canary_start, k_ra8_err_validation_failed, k_ra8_ok, and k_ra8_stack_canary_pattern.
|
extern |
Referenced by internal_write_stack_canary(), and ra8_stack_canary_check().
|
extern |
Referenced by internal_write_stack_canary(), and ra8_stack_canary_check().