@@ -466,6 +466,8 @@ static uint32_t tfm_spm_partition_get_priority_ext(uint32_t partition_idx)
466
466
/* Macros to pick linker symbols and allow references to sections in all level*/
467
467
#define REGION_DECLARE_EXT (a , b , c ) extern uint32_t REGION_NAME(a, b, c)
468
468
469
+ REGION_DECLARE_EXT (Image$$ , ARM_LIB_HEAP , $$ZI$$Base );
470
+ REGION_DECLARE_EXT (Image$$ , ARM_LIB_HEAP , $$ZI$$Limit );
469
471
REGION_DECLARE_EXT (Image$$ , ER_TFM_DATA , $$Base );
470
472
REGION_DECLARE_EXT (Image$$ , ER_TFM_DATA , $$Limit );
471
473
REGION_DECLARE_EXT (Image$$ , TFM_SECURE_STACK , $$ZI$$Base );
@@ -519,7 +521,19 @@ int32_t tfm_memory_check(void *buffer, size_t len, int32_t ns_caller)
519
521
if (memory_check_range (buffer , len , base , limit ) == IPC_SUCCESS ) {
520
522
return IPC_SUCCESS ;
521
523
}
524
+
525
+ base = (uintptr_t )NS_CODE_START ;
526
+ limit = (uintptr_t )(NS_CODE_START + NS_CODE_SIZE );
527
+ if (memory_check_range (buffer , len , base , limit ) == IPC_SUCCESS ) {
528
+ return IPC_SUCCESS ;
529
+ }
522
530
} else {
531
+ base = (uintptr_t )& REGION_NAME (Image$$ , ARM_LIB_HEAP , $$ZI$$Base );
532
+ limit = (uintptr_t )& REGION_NAME (Image$$ , ARM_LIB_HEAP , $$ZI$$Limit );
533
+ if (memory_check_range (buffer , len , base , limit ) == IPC_SUCCESS ) {
534
+ return IPC_SUCCESS ;
535
+ }
536
+
523
537
base = (uintptr_t )& REGION_NAME (Image$$ , ER_TFM_DATA , $$Base );
524
538
limit = (uintptr_t )& REGION_NAME (Image$$ , ER_TFM_DATA , $$Limit );
525
539
if (memory_check_range (buffer , len , base , limit ) == IPC_SUCCESS ) {
0 commit comments