aboutsummaryrefslogtreecommitdiff
path: root/protocols/service/secure_storage
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/service/secure_storage')
-rw-r--r--protocols/service/secure_storage/packed-c/component.cmake16
-rw-r--r--protocols/service/secure_storage/packed-c/secure_storage_proto.h50
2 files changed, 66 insertions, 0 deletions
diff --git a/protocols/service/secure_storage/packed-c/component.cmake b/protocols/service/secure_storage/packed-c/component.cmake
new file mode 100644
index 000000000..b620b463f
--- /dev/null
+++ b/protocols/service/secure_storage/packed-c/component.cmake
@@ -0,0 +1,16 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+if (NOT DEFINED TGT)
+ message(FATAL_ERROR "mandatory parameter TGT is not defined.")
+endif()
+
+
+
+target_include_directories(${TGT}
+ PRIVATE
+ "${CMAKE_CURRENT_LIST_DIR}"
+ )
diff --git a/protocols/service/secure_storage/packed-c/secure_storage_proto.h b/protocols/service/secure_storage/packed-c/secure_storage_proto.h
new file mode 100644
index 000000000..1a9b8c845
--- /dev/null
+++ b/protocols/service/secure_storage/packed-c/secure_storage_proto.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef SECURE_STORAGE_PROTO_H
+#define SECURE_STORAGE_PROTO_H
+
+#include <stdint.h>
+
+struct __attribute__ ((__packed__)) secure_storage_request_set {
+ uint64_t uid;
+ uint64_t data_length;
+ uint32_t create_flags;
+ uint8_t p_data[];
+};
+
+struct __attribute__ ((__packed__)) secure_storage_request_get {
+ uint64_t uid;
+ uint64_t data_offset;
+ uint64_t data_size;
+};
+
+struct __attribute__ ((__packed__)) secure_storage_request_get_info {
+ uint64_t uid;
+};
+
+struct __attribute__ ((__packed__)) secure_storage_response_get_info {
+ uint64_t capacity;
+ uint64_t size;
+ uint32_t flags;
+};
+
+struct __attribute__ ((__packed__)) secure_storage_request_remove {
+ uint64_t uid;
+};
+
+#define TS_SECURE_STORAGE_OPCODE_SET (0u)
+#define TS_SECURE_STORAGE_OPCODE_GET (1u)
+#define TS_SECURE_STORAGE_OPCODE_GET_INFO (2u)
+#define TS_SECURE_STORAGE_OPCODE_REMOVE (3u)
+
+#define TS_SECURE_STORAGE_FLAG_NONE (0u)
+#define TS_SECURE_STORAGE_FLAG_WRITE_ONCE (1u << 0)
+#define TS_SECURE_STORAGE_FLAG_NO_CONFIDENTIALITY (1u << 1)
+#define TS_SECURE_STORAGE_FLAG_NO_REPLAY_PROTECTION (1u << 2)
+#define TS_SECURE_STORAGE_SUPPORT_SET_EXTENDED (1u << 0)
+
+#endif /* SECURE_STORAGE_PROTO_H */