Add example_partition from tf-m-tools
Signed-off-by: Anton Komlev <anton.komlev@arm.com>
Change-Id: I29baec63c1ea8e06457b92a6277fc5f2fa9ec335
diff --git a/examples/example_partition/tfm_example_partition_api.c b/examples/example_partition/tfm_example_partition_api.c
new file mode 100644
index 0000000..5e83cd5
--- /dev/null
+++ b/examples/example_partition/tfm_example_partition_api.c
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2020, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#include "tfm_example_partition_api.h"
+
+#include "psa/client.h"
+#include "psa_manifest/sid.h"
+
+psa_status_t tfm_example_partition_call(uint32_t arg)
+{
+ psa_status_t status;
+ psa_handle_t handle;
+ psa_invec in_vec[] = {
+ { .base = &arg, .len = sizeof(arg) },
+ };
+
+ handle = psa_connect(TFM_EXAMPLE_SERVICE_SID, TFM_EXAMPLE_SERVICE_VERSION);
+ if (!PSA_HANDLE_IS_VALID(handle)) {
+ return PSA_HANDLE_TO_ERROR(handle);
+ }
+
+ status = psa_call(handle, PSA_IPC_CALL, in_vec, 1, NULL, 0);
+
+ psa_close(handle);
+
+ return status;
+}