Skip to content

Update TF-M sources #9915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,10 @@ static uint32_t tfm_spm_partition_get_priority_ext(uint32_t partition_idx)

REGION_DECLARE_EXT(Image$$, ARM_LIB_HEAP, $$ZI$$Base);
REGION_DECLARE_EXT(Image$$, ARM_LIB_HEAP, $$ZI$$Limit);
REGION_DECLARE_EXT(Image$$, ER_TFM_DATA, $$Base);
REGION_DECLARE_EXT(Image$$, ER_TFM_DATA, $$Limit);
REGION_DECLARE_EXT(Image$$, ER_TFM_DATA, $$ZI$$Base);
REGION_DECLARE_EXT(Image$$, ER_TFM_DATA, $$ZI$$Limit);
REGION_DECLARE_EXT(Image$$, ER_TFM_DATA, $$RW$$Base);
REGION_DECLARE_EXT(Image$$, ER_TFM_DATA, $$RW$$Limit);
REGION_DECLARE_EXT(Image$$, TFM_SECURE_STACK, $$ZI$$Base);
REGION_DECLARE_EXT(Image$$, TFM_SECURE_STACK, $$ZI$$Limit);
REGION_DECLARE_EXT(Image$$, TFM_UNPRIV_SCRATCH, $$ZI$$Base);
Expand Down Expand Up @@ -536,14 +536,14 @@ int32_t tfm_memory_check(void *buffer, size_t len, int32_t ns_caller)
return IPC_SUCCESS;
}

base = (uintptr_t)&REGION_NAME(Image$$, ER_TFM_DATA, $$ZI$$Base);
limit = (uintptr_t)&REGION_NAME(Image$$, ER_TFM_DATA, $$ZI$$Limit);
base = (uintptr_t)&REGION_NAME(Image$$, ER_TFM_DATA, $$RW$$Base);
limit = (uintptr_t)&REGION_NAME(Image$$, ER_TFM_DATA, $$RW$$Limit);
if (memory_check_range(buffer, len, base, limit) == IPC_SUCCESS) {
return IPC_SUCCESS;
}

base = (uintptr_t)&REGION_NAME(Image$$, ER_TFM_DATA, $$Base);
limit = (uintptr_t)&REGION_NAME(Image$$, ER_TFM_DATA, $$Limit);
base = (uintptr_t)&REGION_NAME(Image$$, ER_TFM_DATA, $$ZI$$Base);
limit = (uintptr_t)&REGION_NAME(Image$$, ER_TFM_DATA, $$ZI$$Limit);
if (memory_check_range(buffer, len, base, limit) == IPC_SUCCESS) {
return IPC_SUCCESS;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,23 @@ static struct tfm_thrd_ctx *p_curr_thrd = NULL;
#define RUNN_HEAD p_runn_head
#define CURR_THRD p_curr_thrd

static struct tfm_thrd_ctx *find_next_running_thread(struct tfm_thrd_ctx *pth)
{
while (pth && pth->status != THRD_STAT_RUNNING) {
pth = pth->next;
}

return pth;
}

/* To get next running thread for scheduler */
struct tfm_thrd_ctx *tfm_thrd_next_thread(void)
{
struct tfm_thrd_ctx *pth = RUNN_HEAD;

/*
* First RUNNING thread has highest priority since threads are sorted with
* priority.
*/
while (pth && pth->status != THRD_STAT_RUNNING) {
pth = pth->next;
}

return pth;
return find_next_running_thread(RUNN_HEAD);
}

/* To get current thread for caller */
Expand Down Expand Up @@ -69,10 +72,10 @@ static void update_running_head(struct tfm_thrd_ctx **runn,
struct tfm_thrd_ctx *node)
{
if ((node->status == THRD_STAT_RUNNING) &&
(*runn == NULL || (node->prior <= (*runn)->prior))) {
(*runn == NULL || (node->prior < (*runn)->prior))) {
*runn = node;
} else {
*runn = tfm_thrd_next_thread();
*runn = find_next_running_thread(LIST_HEAD);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ enum spm_err_t tfm_spm_partition_init(void)
/* Call the init function for each partition */
for (idx = 0; idx < g_spm_partition_db.partition_count; ++idx) {
part = &g_spm_partition_db.partitions[idx];
tfm_spm_hal_configure_default_isolation(part->platform_data);
#ifdef TFM_PSA_API
if (part->static_data.partition_flags & SPM_PART_FLAG_IPC) {
continue;
}
#endif
tfm_spm_hal_configure_default_isolation(part->platform_data);
if (part->static_data.partition_init == NULL) {
tfm_spm_partition_set_state(idx, SPM_PARTITION_STATE_IDLE);
tfm_spm_partition_set_caller_partition_idx(idx,
Expand Down
17 changes: 7 additions & 10 deletions tools/importer/tfm_importer.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,13 @@
}
],
"commit_sha" : [
"1f30b52488e88704cdb51c8c26e7225e580e5cc2",
"5f2e4b3911ca3a776fab55a6d12054904614cced",
"0c23e8698958b6e716114267fbdf6d82a16b6e0c",
"fc7864055982f3b8e7e556f9dd8d0c94a1c772bc",
"011fa28110ccfd87554f9a1f06c2eb8a8a34d1e0",
"da01e3411fcf8010f4ae581946cf4b0e7753e024",
"008bf1b2d176c04fb33985e0677e90e3800cb4ca",
"67a4e6d723dfb199fdbe9a2cef57dbe58cbc026f",
"6354b9a47351a29ea24023c5471b63d39e091959",
"ebc961dab8630522fa341015260d9e75981f6982"
"71cd34df3265d98da5c9b34e4e18ef039d7bef5c",
"87f22efcb5ed28fc4dbe6c940057bc6ace3ec00a",
"03dbd4bb28113c6ffc05e6884b6b38f52163cb4b",
"ea8bff57b14dad0b8d7e09c698ed1a08c532f04b",
"8a087a6504a0e2d7e3e48adc6301f16e44ea5957",
"749faa6534be5b3067be4c1bcca12681f9587c0e",
"7a2c7d7df4d12776689b10e5fa77963f8473193f"
]
}