TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tfm_core_mem_check.c File Reference
#include <arm_cmse.h>
#include <stdbool.h>
#include "region_defs.h"
#include "tfm_arch.h"
#include "tfm_spm_hal.h"
#include "tfm_api.h"
#include "spm_func.h"
Include dependency graph for tfm_core_mem_check.c:

Go to the source code of this file.

Functions

enum tfm_status_e tfm_core_has_read_access_to_region (const void *p, size_t s, bool ns_caller, uint32_t privileged)
 Check whether the current partition has read access to a memory range. More...
 
enum tfm_status_e tfm_core_has_write_access_to_region (const void *p, size_t s, bool ns_caller, uint32_t privileged)
 Check whether the current partition has write access to a memory range. More...
 

Function Documentation

enum tfm_status_e tfm_core_has_read_access_to_region ( const void *  p,
size_t  s,
bool  ns_caller,
uint32_t  privileged 
)

Check whether the current partition has read access to a memory range.

This function assumes, that the current MPU configuration is set for the partition to be checked.

Parameters
[in]pThe start address of the range to check
[in]sThe size of the range to check
[in]ns_callerWhether the current partition is non-secure
[in]privilegedPrivileged mode or unprivileged mode: TFM_PARTITION_UNPRIVILEGED_MODE TFM_PARTITION_PRIVILEGED_MODE
Returns
TFM_SUCCESS if the partition has access to the memory range, TFM_ERROR_GENERIC otherwise.

Definition at line 67 of file tfm_core_mem_check.c.

enum tfm_status_e tfm_core_has_write_access_to_region ( const void *  p,
size_t  s,
bool  ns_caller,
uint32_t  privileged 
)

Check whether the current partition has write access to a memory range.

This function assumes, that the current MPU configuration is set for the partition to be checked.

Parameters
[in]pThe start address of the range to check
[in]sThe size of the range to check
[in]ns_callerWhether the current partition is non-secure
[in]privilegedPrivileged mode or unprivileged mode: TFM_PARTITION_UNPRIVILEGED_MODE TFM_PARTITION_PRIVILEGED_MODE
Returns
TFM_SUCCESS if the partition has access to the memory range, TFM_ERROR_GENERIC otherwise.

Definition at line 98 of file tfm_core_mem_check.c.