|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Macros for declaring Non-Secure Callable veneer functions. More...
Go to the source code of this file.
Macros | |
| #define | RA8_NSC_VENEER RA8_INTERNAL_ANNOTATE("ra8_nsc_veneer") |
| RA8 NSC VENEER – annotation only: no -mcmse, so no SG veneer. | |
| #define | RA8_NSC_CHECK_NS_RANGE_R(ptr, len) |
| RA8 NSC CHECK NS RANGE r. | |
| #define | RA8_NSC_CHECK_NS_RANGE_RW(ptr, len) |
| RA8 NSC CHECK NS RANGE RW. | |
Macros for declaring Non-Secure Callable veneer functions.
enables __attribute__((cmse_nonsecure_entry)) on the NSC veneer functions when the firmware is built with -DRA8_TRUSTZONE_ENABLE=ON and the translation unit is compiled for the Secure world (-mcmse, i.e. __ARM_FEATURE_CMSE bit 1 set). Non-Secure images define RA8_TRUSTZONE_ENABLE too but compile without -mcmse; they must see the veneers as plain function declarations, because gcc ignores cmse_nonsecure_entry without -mcmse and the -Wattributes diagnostic is fatal under the project -Werror profile. In single-world and host builds the macros likewise compile to nothing, so the same veneer source compiles cleanly against every build configuration.
Use RA8_NSC_VENEER on the function declarations in ra8_nsc.h and on the matching definitions in libs/ra8_nsc/src. Use RA8_NSC_CHECK_NS_RANGE_R / _RW to validate that pointer arguments lie inside the Non-Secure region; the macros expand to cmse_check_address_range calls under TrustZone and to no-ops otherwise.
cmse_nonsecure_entry imposes restrictions: parameters must be in registers (no struct-by-value bigger than a register), and the return value must fit in registers as well. The existing veneer signatures already comply – everything is uint*_t / pointer / enum.
Definition in file ra8_nsc_veneer.h.
| #define RA8_NSC_CHECK_NS_RANGE_R | ( | ptr, | |
| len ) |
RA8 NSC CHECK NS RANGE r.
Definition at line 123 of file ra8_nsc_veneer.h.
Referenced by ra8_nsc_crc_compute(), ra8_nsc_eth_send(), ra8_nsc_glcdc_init(), ra8_nsc_gpt_init(), ra8_nsc_iic_init(), ra8_nsc_iic_write(), ra8_nsc_key_vault_challenge(), ra8_nsc_log_emit(), ra8_nsc_sci_init(), ra8_nsc_spi_init(), ra8_nsc_spi_write(), and ra8_nsc_spi_write_read().
| #define RA8_NSC_CHECK_NS_RANGE_RW | ( | ptr, | |
| len ) |
RA8 NSC CHECK NS RANGE RW.
Definition at line 125 of file ra8_nsc_veneer.h.
Referenced by ra8_nsc_acmphs_read_output(), ra8_nsc_adc_read_channel(), ra8_nsc_cgc_get_clock_hz(), ra8_nsc_crc_compute(), ra8_nsc_eth_recv(), ra8_nsc_gpt_read(), ra8_nsc_iic_read(), ra8_nsc_key_vault_challenge(), ra8_nsc_sci_getc(), ra8_nsc_spi_read(), ra8_nsc_spi_write_read(), ra8_nsc_spi_xfer8(), ra8_nsc_xspi_read(), and ra8_nsc_xspi_status().
| #define RA8_NSC_VENEER RA8_INTERNAL_ANNOTATE("ra8_nsc_veneer") |
RA8 NSC VENEER – annotation only: no -mcmse, so no SG veneer.
Definition at line 121 of file ra8_nsc_veneer.h.