@@ -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 , $$ZI$$Base );
470
472
REGION_DECLARE_EXT (Image$$ , ER_TFM_DATA , $$ZI$$Limit );
471
473
REGION_DECLARE_EXT (Image$$ , ER_TFM_DATA , $$RW$$Base );
@@ -521,7 +523,19 @@ int32_t tfm_memory_check(void *buffer, size_t len, int32_t ns_caller)
521
523
if (memory_check_range (buffer , len , base , limit ) == IPC_SUCCESS ) {
522
524
return IPC_SUCCESS ;
523
525
}
526
+
527
+ base = (uintptr_t )NS_CODE_START ;
528
+ limit = (uintptr_t )(NS_CODE_START + NS_CODE_SIZE );
529
+ if (memory_check_range (buffer , len , base , limit ) == IPC_SUCCESS ) {
530
+ return IPC_SUCCESS ;
531
+ }
524
532
} else {
533
+ base = (uintptr_t )& REGION_NAME (Image$$ , ARM_LIB_HEAP , $$ZI$$Base );
534
+ limit = (uintptr_t )& REGION_NAME (Image$$ , ARM_LIB_HEAP , $$ZI$$Limit );
535
+ if (memory_check_range (buffer , len , base , limit ) == IPC_SUCCESS ) {
536
+ return IPC_SUCCESS ;
537
+ }
538
+
525
539
base = (uintptr_t )& REGION_NAME (Image$$ , ER_TFM_DATA , $$RW$$Base );
526
540
limit = (uintptr_t )& REGION_NAME (Image$$ , ER_TFM_DATA , $$RW$$Limit );
527
541
if (memory_check_range (buffer , len , base , limit ) == IPC_SUCCESS ) {
@@ -546,6 +560,12 @@ int32_t tfm_memory_check(void *buffer, size_t len, int32_t ns_caller)
546
560
if (memory_check_range (buffer , len , base , limit ) == IPC_SUCCESS ) {
547
561
return IPC_SUCCESS ;
548
562
}
563
+
564
+ base = (uintptr_t )S_CODE_START ;
565
+ limit = (uintptr_t )(S_CODE_START + S_CODE_SIZE );
566
+ if (memory_check_range (buffer , len , base , limit ) == IPC_SUCCESS ) {
567
+ return IPC_SUCCESS ;
568
+ }
549
569
}
550
570
551
571
return IPC_ERROR_MEMORY_CHECK ;
0 commit comments