Skip to content

Commit 5c24ffe

Browse files
authored
Merge pull request ARMmbed#9915 from kfnta/tfm_import_new
Update TF-M sources
2 parents 9f6156a + f32f2ae commit 5c24ffe

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/tfm_spm.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,10 @@ static uint32_t tfm_spm_partition_get_priority_ext(uint32_t partition_idx)
468468

469469
REGION_DECLARE_EXT(Image$$, ARM_LIB_HEAP, $$ZI$$Base);
470470
REGION_DECLARE_EXT(Image$$, ARM_LIB_HEAP, $$ZI$$Limit);
471-
REGION_DECLARE_EXT(Image$$, ER_TFM_DATA, $$Base);
472-
REGION_DECLARE_EXT(Image$$, ER_TFM_DATA, $$Limit);
473471
REGION_DECLARE_EXT(Image$$, ER_TFM_DATA, $$ZI$$Base);
474472
REGION_DECLARE_EXT(Image$$, ER_TFM_DATA, $$ZI$$Limit);
473+
REGION_DECLARE_EXT(Image$$, ER_TFM_DATA, $$RW$$Base);
474+
REGION_DECLARE_EXT(Image$$, ER_TFM_DATA, $$RW$$Limit);
475475
REGION_DECLARE_EXT(Image$$, TFM_SECURE_STACK, $$ZI$$Base);
476476
REGION_DECLARE_EXT(Image$$, TFM_SECURE_STACK, $$ZI$$Limit);
477477
REGION_DECLARE_EXT(Image$$, TFM_UNPRIV_SCRATCH, $$ZI$$Base);
@@ -536,14 +536,14 @@ int32_t tfm_memory_check(void *buffer, size_t len, int32_t ns_caller)
536536
return IPC_SUCCESS;
537537
}
538538

539-
base = (uintptr_t)&REGION_NAME(Image$$, ER_TFM_DATA, $$ZI$$Base);
540-
limit = (uintptr_t)&REGION_NAME(Image$$, ER_TFM_DATA, $$ZI$$Limit);
539+
base = (uintptr_t)&REGION_NAME(Image$$, ER_TFM_DATA, $$RW$$Base);
540+
limit = (uintptr_t)&REGION_NAME(Image$$, ER_TFM_DATA, $$RW$$Limit);
541541
if (memory_check_range(buffer, len, base, limit) == IPC_SUCCESS) {
542542
return IPC_SUCCESS;
543543
}
544544

545-
base = (uintptr_t)&REGION_NAME(Image$$, ER_TFM_DATA, $$Base);
546-
limit = (uintptr_t)&REGION_NAME(Image$$, ER_TFM_DATA, $$Limit);
545+
base = (uintptr_t)&REGION_NAME(Image$$, ER_TFM_DATA, $$ZI$$Base);
546+
limit = (uintptr_t)&REGION_NAME(Image$$, ER_TFM_DATA, $$ZI$$Limit);
547547
if (memory_check_range(buffer, len, base, limit) == IPC_SUCCESS) {
548548
return IPC_SUCCESS;
549549
}

components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/tfm_thread.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,23 @@ static struct tfm_thrd_ctx *p_curr_thrd = NULL;
2121
#define RUNN_HEAD p_runn_head
2222
#define CURR_THRD p_curr_thrd
2323

24+
static struct tfm_thrd_ctx *find_next_running_thread(struct tfm_thrd_ctx *pth)
25+
{
26+
while (pth && pth->status != THRD_STAT_RUNNING) {
27+
pth = pth->next;
28+
}
29+
30+
return pth;
31+
}
32+
2433
/* To get next running thread for scheduler */
2534
struct tfm_thrd_ctx *tfm_thrd_next_thread(void)
2635
{
27-
struct tfm_thrd_ctx *pth = RUNN_HEAD;
28-
2936
/*
3037
* First RUNNING thread has highest priority since threads are sorted with
3138
* priority.
3239
*/
33-
while (pth && pth->status != THRD_STAT_RUNNING) {
34-
pth = pth->next;
35-
}
36-
37-
return pth;
40+
return find_next_running_thread(RUNN_HEAD);
3841
}
3942

4043
/* To get current thread for caller */
@@ -69,10 +72,10 @@ static void update_running_head(struct tfm_thrd_ctx **runn,
6972
struct tfm_thrd_ctx *node)
7073
{
7174
if ((node->status == THRD_STAT_RUNNING) &&
72-
(*runn == NULL || (node->prior <= (*runn)->prior))) {
75+
(*runn == NULL || (node->prior < (*runn)->prior))) {
7376
*runn = node;
7477
} else {
75-
*runn = tfm_thrd_next_thread();
78+
*runn = find_next_running_thread(LIST_HEAD);
7679
}
7780
}
7881

components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/spm/spm_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,12 @@ enum spm_err_t tfm_spm_partition_init(void)
141141
/* Call the init function for each partition */
142142
for (idx = 0; idx < g_spm_partition_db.partition_count; ++idx) {
143143
part = &g_spm_partition_db.partitions[idx];
144+
tfm_spm_hal_configure_default_isolation(part->platform_data);
144145
#ifdef TFM_PSA_API
145146
if (part->static_data.partition_flags & SPM_PART_FLAG_IPC) {
146147
continue;
147148
}
148149
#endif
149-
tfm_spm_hal_configure_default_isolation(part->platform_data);
150150
if (part->static_data.partition_init == NULL) {
151151
tfm_spm_partition_set_state(idx, SPM_PARTITION_STATE_IDLE);
152152
tfm_spm_partition_set_caller_partition_idx(idx,

tools/importer/tfm_importer.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,13 @@
6464
}
6565
],
6666
"commit_sha" : [
67-
"1f30b52488e88704cdb51c8c26e7225e580e5cc2",
68-
"5f2e4b3911ca3a776fab55a6d12054904614cced",
69-
"0c23e8698958b6e716114267fbdf6d82a16b6e0c",
70-
"fc7864055982f3b8e7e556f9dd8d0c94a1c772bc",
71-
"011fa28110ccfd87554f9a1f06c2eb8a8a34d1e0",
72-
"da01e3411fcf8010f4ae581946cf4b0e7753e024",
73-
"008bf1b2d176c04fb33985e0677e90e3800cb4ca",
74-
"67a4e6d723dfb199fdbe9a2cef57dbe58cbc026f",
75-
"6354b9a47351a29ea24023c5471b63d39e091959",
76-
"ebc961dab8630522fa341015260d9e75981f6982"
67+
"71cd34df3265d98da5c9b34e4e18ef039d7bef5c",
68+
"87f22efcb5ed28fc4dbe6c940057bc6ace3ec00a",
69+
"03dbd4bb28113c6ffc05e6884b6b38f52163cb4b",
70+
"ea8bff57b14dad0b8d7e09c698ed1a08c532f04b",
71+
"8a087a6504a0e2d7e3e48adc6301f16e44ea5957",
72+
"749faa6534be5b3067be4c1bcca12681f9587c0e",
73+
"7a2c7d7df4d12776689b10e5fa77963f8473193f"
7774
]
7875
}
7976

0 commit comments

Comments
 (0)