TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tfm_multi_core_mem_check.c File Reference
#include <stdbool.h>
#include "tfm_spm_hal.h"
#include "region_defs.h"
#include "spm_ipc.h"
#include "tfm_hal_isolation.h"
#include "tfm_multi_core.h"
#include "tfm_secure_api.h"
#include "utilities.h"
#include "region.h"
Include dependency graph for tfm_multi_core_mem_check.c:

Go to the source code of this file.

Macros

#define MEM_CHECK_MPU_READWRITE   (1 << 0x0)
 
#define MEM_CHECK_AU_NONSECURE   (1 << 0x1)
 
#define MEM_CHECK_MPU_UNPRIV   (1 << 0x2)
 
#define MEM_CHECK_MPU_READ   (1 << 0x3)
 
#define MEM_CHECK_MPU_NONSECURE   (1 << 0x4)
 
#define MEM_CHECK_NONSECURE
 

Functions

void tfm_get_mem_region_security_attr (const void *p, size_t s, struct security_attr_info_t *p_attr)
 Retrieve general security isolation configuration information of the target memory region according to the system memory region layout and fill the security_attr_info_t. More...
 
void tfm_get_secure_mem_region_attr (const void *p, size_t s, struct mem_attr_info_t *p_attr)
 Retrieve general secure memory protection configuration information of the target memory region according to the system memory region layout and symbol addresses and fill the mem_attr_info_t. More...
 
void tfm_get_ns_mem_region_attr (const void *p, size_t s, struct mem_attr_info_t *p_attr)
 Retrieve general non-secure memory protection configuration information of the target memory region according to the system memory region layout and fill the mem_attr_info_t. More...
 
int32_t tfm_has_access_to_region (const void *p, size_t s, uint32_t attr)
 Check whether a memory access is allowed to access to a memory range. More...
 

Macro Definition Documentation

#define MEM_CHECK_AU_NONSECURE   (1 << 0x1)

Definition at line 24 of file tfm_multi_core_mem_check.c.

#define MEM_CHECK_MPU_NONSECURE   (1 << 0x4)

Definition at line 27 of file tfm_multi_core_mem_check.c.

#define MEM_CHECK_MPU_READ   (1 << 0x3)

Definition at line 26 of file tfm_multi_core_mem_check.c.

#define MEM_CHECK_MPU_READWRITE   (1 << 0x0)

Definition at line 23 of file tfm_multi_core_mem_check.c.

#define MEM_CHECK_MPU_UNPRIV   (1 << 0x2)

Definition at line 25 of file tfm_multi_core_mem_check.c.

#define MEM_CHECK_NONSECURE
Value:

Definition at line 28 of file tfm_multi_core_mem_check.c.

Function Documentation

void tfm_get_mem_region_security_attr ( const void *  p,
size_t  s,
struct security_attr_info_t p_attr 
)

Retrieve general security isolation configuration information of the target memory region according to the system memory region layout and fill the security_attr_info_t.

Parameters
[in]pBase address of target memory region
[in]sSize of target memory region
[out]p_attrAddress of security_attr_info_t to be filled
Returns
void
Note
This function doesn't access any hardware security isolation unit.

Definition at line 67 of file tfm_multi_core_mem_check.c.

void tfm_get_ns_mem_region_attr ( const void *  p,
size_t  s,
struct mem_attr_info_t p_attr 
)

Retrieve general non-secure memory protection configuration information of the target memory region according to the system memory region layout and fill the mem_attr_info_t.

Parameters
[in]pBase address of target memory region
[in]sSize of target memory region
[out]p_attrAddress of mem_attr_info_t to be filled
Returns
void
Note
This function doesn't access any hardware memory protection unit. The mem_attr_info_t::is_mpu_enabled field is set to false by default.

Definition at line 220 of file tfm_multi_core_mem_check.c.

void tfm_get_secure_mem_region_attr ( const void *  p,
size_t  s,
struct mem_attr_info_t p_attr 
)

Retrieve general secure memory protection configuration information of the target memory region according to the system memory region layout and symbol addresses and fill the mem_attr_info_t.

Parameters
[in]pBase address of target memory region
[in]sSize of target memory region
[out]p_attrAddress of mem_attr_info_t to be filled
Returns
void
Note
This function doesn't access any hardware memory protection unit. The mem_attr_info_t::is_mpu_enabled field is set to false by default.

Definition at line 108 of file tfm_multi_core_mem_check.c.

int32_t tfm_has_access_to_region ( const void *  p,
size_t  s,
uint32_t  attr 
)

Check whether a memory access is allowed to access to a memory range.

Parameters
[in]pThe start address of the range to check
[in]sThe size of the range to check
[in]attrThe attributes indicating the access permissions.
Returns
TFM_SUCCESS if the access is allowed, TFM_ERROR_GENERIC otherwise.

Definition at line 422 of file tfm_multi_core_mem_check.c.

Here is the call graph for this function: