Core: Add unpriv API to get caller client ID
Add tfm_core_get_caller_client_id(void) function to the unprivileged
TF-M core API. This function can only be called from secure partition.
Also add test case to test this function in the positive core test
suite.
Change-Id: I8dcd07b62f7bf8e43258695283cbb719a9357e48
Signed-off-by: Mate Toth-Pal <mate.toth-pal@arm.com>
diff --git a/secure_fw/spm/spm_api.c b/secure_fw/spm/spm_api.c
index ff68245..77bf5be 100644
--- a/secure_fw/spm/spm_api.c
+++ b/secure_fw/spm/spm_api.c
@@ -210,6 +210,30 @@
return g_spm_partition_db.partitions[partition_idx].memory_data.stack_top;
}
+uint32_t tfm_spm_partition_get_zi_start(uint32_t partition_idx)
+{
+ return g_spm_partition_db.partitions[partition_idx].
+ memory_data.zi_start;
+}
+
+uint32_t tfm_spm_partition_get_zi_limit(uint32_t partition_idx)
+{
+ return g_spm_partition_db.partitions[partition_idx].
+ memory_data.zi_limit;
+}
+
+uint32_t tfm_spm_partition_get_rw_start(uint32_t partition_idx)
+{
+ return g_spm_partition_db.partitions[partition_idx].
+ memory_data.rw_start;
+}
+
+uint32_t tfm_spm_partition_get_rw_limit(uint32_t partition_idx)
+{
+ return g_spm_partition_db.partitions[partition_idx].
+ memory_data.rw_limit;
+}
+
void tfm_spm_partition_set_stack(uint32_t partition_idx, uint32_t stack_ptr)
{
g_spm_partition_db.partitions[partition_idx].
@@ -260,6 +284,13 @@
caller_partition_idx = caller_partition_idx;
}
+void tfm_spm_partition_set_caller_client_id(uint32_t partition_idx,
+ int32_t caller_client_id)
+{
+ g_spm_partition_db.partitions[partition_idx].runtime_data.
+ caller_client_id = caller_client_id;
+}
+
enum spm_err_t tfm_spm_partition_set_share(uint32_t partition_idx,
uint32_t share)
{