@@ -463,6 +463,8 @@ static uint32_t tfm_spm_partition_get_priority_ext(uint32_t partition_idx)
463
463
/* Macros to pick linker symbols and allow references to sections in all level*/
464
464
#define REGION_DECLARE_EXT (a , b , c ) extern uint32_t REGION_NAME(a, b, c)
465
465
466
+ REGION_DECLARE_EXT (Image$$ , ARM_LIB_HEAP , $$ZI$$Base );
467
+ REGION_DECLARE_EXT (Image$$ , ARM_LIB_HEAP , $$ZI$$Limit );
466
468
REGION_DECLARE_EXT (Image$$ , ER_TFM_DATA , $$ZI$$Base );
467
469
REGION_DECLARE_EXT (Image$$ , ER_TFM_DATA , $$ZI$$Limit );
468
470
REGION_DECLARE_EXT (Image$$ , ER_TFM_DATA , $$RW$$Base );
@@ -518,7 +520,19 @@ int32_t tfm_memory_check(void *buffer, size_t len, int32_t ns_caller)
518
520
if (memory_check_range (buffer , len , base , limit ) == IPC_SUCCESS ) {
519
521
return IPC_SUCCESS ;
520
522
}
523
+
524
+ base = (uintptr_t )NS_CODE_START ;
525
+ limit = (uintptr_t )(NS_CODE_START + NS_CODE_SIZE );
526
+ if (memory_check_range (buffer , len , base , limit ) == IPC_SUCCESS ) {
527
+ return IPC_SUCCESS ;
528
+ }
521
529
} else {
530
+ base = (uintptr_t )& REGION_NAME (Image$$ , ARM_LIB_HEAP , $$ZI$$Base );
531
+ limit = (uintptr_t )& REGION_NAME (Image$$ , ARM_LIB_HEAP , $$ZI$$Limit );
532
+ if (memory_check_range (buffer , len , base , limit ) == IPC_SUCCESS ) {
533
+ return IPC_SUCCESS ;
534
+ }
535
+
522
536
base = (uintptr_t )& REGION_NAME (Image$$ , ER_TFM_DATA , $$RW$$Base );
523
537
limit = (uintptr_t )& REGION_NAME (Image$$ , ER_TFM_DATA , $$RW$$Limit );
524
538
if (memory_check_range (buffer , len , base , limit ) == IPC_SUCCESS ) {
@@ -543,6 +557,12 @@ int32_t tfm_memory_check(void *buffer, size_t len, int32_t ns_caller)
543
557
if (memory_check_range (buffer , len , base , limit ) == IPC_SUCCESS ) {
544
558
return IPC_SUCCESS ;
545
559
}
560
+
561
+ base = (uintptr_t )S_CODE_START ;
562
+ limit = (uintptr_t )(S_CODE_START + S_CODE_SIZE );
563
+ if (memory_check_range (buffer , len , base , limit ) == IPC_SUCCESS ) {
564
+ return IPC_SUCCESS ;
565
+ }
546
566
}
547
567
548
568
return IPC_ERROR_MEMORY_CHECK ;
0 commit comments