|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
NSC veneer: secure-side logging. More...
#include <stdint.h>#include "ra8_attributes.h"#include "ra8_check.h"#include "ra8_err.h"#include "ra8_log.h"#include "ra8_nsc.h"#include "ra8_nsc_veneer.h"Go to the source code of this file.
Functions | |
| static void | internal_safe_strcpy (char *dst, const char *src, uint32_t cap) |
| Length-bounded string copy with NUL terminator. | |
| ra8_err_t | ra8_nsc_log_emit (const char *tag, const char *message) |
| NSC veneer: emit a log line from Non-Secure code. | |
Variables | |
| static const char * | s_tag = "NSCLOG" |
| static char | s_tag_scratch [k_ra8_nsc_log_msg_max_len] |
| Secure scratch for the (tag, message) copy. | |
| static char | s_msg_scratch [k_ra8_nsc_log_msg_max_len] |
NSC veneer: secure-side logging.
scaffold. Forwards the (tag, message) pair to ra8_log_info after copying both strings into a small secure-side scratch area to make sure the secure code never dereferences NS pointers directly.
Definition in file ra8_nsc_log.c.
|
static |
Length-bounded string copy with NUL terminator.
Copies up to cap-1 bytes from src into dst and always writes a terminating NUL.
| [out] | dst | Destination buffer (must hold cap bytes). |
| [in] | src | Source NUL-terminated string. |
| [in] | cap | Capacity of dst in bytes; must be >= 1. |
Definition at line 60 of file ra8_nsc_log.c.
Referenced by ra8_nsc_log_emit().
|
nodiscard |
NSC veneer: emit a log line from Non-Secure code.
NSC veneer: emit a log line via the secure ITM channel.
Copies (tag,message) into secure scratch buffers and forwards to ra8_log_info.
| [in] | tag | NUL-terminated NS string (subsystem tag). |
| [in] | message | NUL-terminated NS string (log message body). |
| k_ra8_ok | Message handed to the secure logger. |
| k_ra8_err_null_ptr | A pointer argument was NULL. |
Definition at line 94 of file ra8_nsc_log.c.
References internal_safe_strcpy(), k_ra8_nsc_log_msg_max_len, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_log_info, RA8_NSC_CHECK_NS_RANGE_R, RA8_NSC_VENEER, s_msg_scratch, s_tag, and s_tag_scratch.
Referenced by internal_sys_thread_entry(), internal_ui_thread_entry(), ns_reset_handler(), ui_thread_entry(), and work_thread_entry().
|
static |
Definition at line 39 of file ra8_nsc_log.c.
Referenced by ra8_nsc_log_emit().
|
static |
Definition at line 27 of file ra8_nsc_log.c.
|
static |
Secure scratch for the (tag, message) copy.
Living in the secure data section, this buffer is updated before each ra8_log_info call so the secure code never has to read from a Non-Secure pointer.
Definition at line 38 of file ra8_nsc_log.c.
Referenced by ra8_nsc_log_emit().