aboutsummaryrefslogtreecommitdiff
path: root/secure_fw/include/load/partition_static_load.h
diff options
context:
space:
mode:
authorMingyang Sun <mingyang.sun@arm.com>2021-04-15 15:46:08 +0800
committerMingyang Sun <mingyang.sun@arm.com>2021-05-08 15:41:41 +0800
commit00df2357ff73936a6da5e94c41ccf7f9e7f11041 (patch)
tree64652bc254e924f7b81e52cec32bc529ea10af20 /secure_fw/include/load/partition_static_load.h
parent77ad9f8777328faac28a1572b255af5b49b21f5b (diff)
downloadtrusted-firmware-m-00df2357ff73936a6da5e94c41ccf7f9e7f11041.tar.gz
SPM: Add header files for partition static load
- Create two new header files that define the partition and service static data type. - Create a header file for partition static loading definitions. Change-Id: I73dafef7b587d3cad6fa35ff4788365a9936c062 Signed-off-by: Mingyang Sun <mingyang.sun@arm.com>
Diffstat (limited to 'secure_fw/include/load/partition_static_load.h')
-rw-r--r--secure_fw/include/load/partition_static_load.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/secure_fw/include/load/partition_static_load.h b/secure_fw/include/load/partition_static_load.h
new file mode 100644
index 0000000000..065c6db2b0
--- /dev/null
+++ b/secure_fw/include/load/partition_static_load.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2021, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#ifndef __PARTITION_STATIC_LOAD_H__
+#define __PARTITION_STATIC_LOAD_H__
+
+#include "partition_defs.h"
+#include "service_defs.h"
+
+#define PARTITION_GET_PRIOR(flag) ((flag) & PARTITION_PRI_MASK)
+#define TO_THREAD_PRIORITY(x) (x)
+
+#define STRID_TO_STRING_PTR(strid) (const char *)(strid)
+#define STRING_PTR_TO_STRID(str) (uintptr_t)(str)
+
+#define ENTRY_TO_POSITION(x) (uintptr_t)(x)
+#define POSITION_TO_ENTRY(x, t) (t)(x)
+
+#define PTR_TO_POSITION(x) (uintptr_t)(x)
+#define POSITION_TO_PTR(x, t) (t)(x)
+
+/* Length of extendable variables in partition static type */
+#define STATIC_INFO_EXT_LENGTH 0
+/*
+ * Argument "ps_ptr" must have be a "struct partition_static_info_t *" type and
+ * must be validated before using.
+ */
+#define STATIC_INFSZ_BYTES(ps_ptr) \
+ (sizeof(*(ps_ptr)) + STATIC_INFO_EXT_LENGTH * sizeof(uintptr_t) + \
+ (ps_ptr)->ndeps * sizeof(uint32_t) + \
+ (ps_ptr)->nservices * sizeof(struct service_static_info_t))
+
+#endif /* __PARTITION_STATIC_LOAD_H__ */