aboutsummaryrefslogtreecommitdiff
path: root/secure_fw/include
diff options
context:
space:
mode:
authorKen Liu <Ken.Liu@arm.com>2021-05-12 12:46:47 +0800
committerKen Liu <ken.liu@arm.com>2021-05-21 09:17:07 +0200
commitaa6e8ce59beb4a21d0b8cd8891a4e57774ed9d08 (patch)
tree3525c5670606404faccb2af940a7cab9699bbf73 /secure_fw/include
parent0894c1c6aa66c09c8995be75a7ddc61550fc7ce6 (diff)
downloadtrusted-firmware-m-aa6e8ce59beb4a21d0b8cd8891a4e57774ed9d08.tar.gz
SPM: Move 'load' headers into 'spm' folder
The 'secure_fw/include' is for secure firmware interfaces, do not put internal headers there. Change-Id: I47dcebe616a0245a82e4eb1df493e91d731adefb Signed-off-by: Ken Liu <Ken.Liu@arm.com>
Diffstat (limited to 'secure_fw/include')
-rw-r--r--secure_fw/include/load/asset_defs.h34
-rw-r--r--secure_fw/include/load/partition_defs.h57
-rw-r--r--secure_fw/include/load/partition_static_load.h49
-rw-r--r--secure_fw/include/load/service_defs.h43
4 files changed, 0 insertions, 183 deletions
diff --git a/secure_fw/include/load/asset_defs.h b/secure_fw/include/load/asset_defs.h
deleted file mode 100644
index 6e5c8d059e..0000000000
--- a/secure_fw/include/load/asset_defs.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2021, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-#ifndef __ASSET_DEFS_H__
-#define __ASSET_DEFS_H__
-
-#include <stdint.h>
-
-/* Memory-based object attributes */
-#define ASSET_MEM_RD_BIT (1U << 0) /* 1: readable memory address */
-#define ASSET_MEM_WR_BIT (1U << 1) /* 1: writable memory address */
-#define ASSET_MEM_PPB_BIT (1U << 2) /* 1: PPB indicator */
-
-/* Customized objects such as device or symbol. Refer by 'dev' in the union. */
-#define ASSET_DEV_REF_BIT (1U << 3)
-
-struct asset_desc_t {
- union {
- struct { /* Memory asset type */
- uintptr_t addr_x;
- uintptr_t addr_y;
- } mem;
- struct { /* Device asset type */
- uintptr_t addr_ref;
- uintptr_t reserved;
- } dev;
- };
- uint32_t attr; /* Asset attributes */
-} __attribute__((aligned(4)));
-
-#endif /* __ASSET_DEFS_H__ */
diff --git a/secure_fw/include/load/partition_defs.h b/secure_fw/include/load/partition_defs.h
deleted file mode 100644
index 80edfd978a..0000000000
--- a/secure_fw/include/load/partition_defs.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2021, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#ifndef __PARTITION_DEFS_H__
-#define __PARTITION_DEFS_H__
-
-#include <stddef.h>
-#include <stdint.h>
-
-/* Encode a magic number into version for validating partition info */
-#define PARTITION_INFO_VERSION_MASK (0x0000FFFF)
-#define PARTITION_INFO_MAGIC_MASK (0xFFFF0000)
-#define PARTITION_INFO_MAGIC (0x5F5F0000)
-
-/* Privileged definitions for partition thread mode */
-#define TFM_PARTITION_UNPRIVILEGED_MODE (0U)
-#define TFM_PARTITION_PRIVILEGED_MODE (1U)
-
-/*
- * Partition load data - flags
- * bit 7-0: priority
- * bit 8: 1 - PSA_ROT, 0 - APP_ROT
- * bit 9: 1 - IPC model, 0 - SFN model
- */
-#define PARTITION_PRI_HIGHEST (0x0)
-#define PARTITION_PRI_HIGH (0xF)
-#define PARTITION_PRI_NORMAL (0x1F)
-#define PARTITION_PRI_LOW (0x7F)
-#define PARTITION_PRI_LOWEST (0xFF)
-#define PARTITION_PRI_MASK (0xFF)
-
-#define SPM_PART_FLAG_PSA_ROT (1U << 8)
-#define SPM_PART_FLAG_IPC (1U << 9)
-
-/*
- * Common partition structure type, the extendable data is right after it.
- * Extendable data has different size for each partition, and must be 4-byte
- * aligned. It includes: stack and heap position, dependencies, services and
- * assets data.
- */
-struct partition_load_info_t {
- uint32_t psa_ff_ver; /* Encode the version with magic */
- uint32_t pid; /* Partition ID */
- uint32_t flags; /* ARoT/PRoT, SFN/IPC, priority */
- uintptr_t entry; /* Entry point */
- size_t stack_size; /* Stack size */
- size_t heap_size; /* Heap size */
- uint32_t ndeps; /* Dependency number */
- uint32_t nservices; /* Service number */
- uint32_t nassets; /* Asset numbers */
-} __attribute__((aligned(4)));
-
-#endif /* __PARTITION_DEFS_H__ */
diff --git a/secure_fw/include/load/partition_static_load.h b/secure_fw/include/load/partition_static_load.h
deleted file mode 100644
index 698c03474f..0000000000
--- a/secure_fw/include/load/partition_static_load.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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 LOAD_INFO_EXT_LENGTH 2
-/*
- * Argument "ps_ptr" must have be a "struct partition_load_info_t *" type and
- * must be validated before using.
- */
-#define LOAD_INFSZ_BYTES(ps_ptr) \
- (sizeof(*(ps_ptr)) + LOAD_INFO_EXT_LENGTH * sizeof(uintptr_t) + \
- (ps_ptr)->ndeps * sizeof(uint32_t) + \
- (ps_ptr)->nservices * sizeof(struct service_load_info_t) + \
- (ps_ptr)->nassets * sizeof(struct asset_desc_t))
-
-/* 'Allocate' stack based on load info */
-#define LOAD_ALLOCED_STACK_ADDR(ps_ptr) (*((uintptr_t *)(ps_ptr + 1)))
-
-#define LOAD_INFO_DEPS(ps_ptr) \
- ((uintptr_t)(ps_ptr + 1) + LOAD_INFO_EXT_LENGTH * sizeof(uintptr_t))
-#define LOAD_INFO_SERVICE(ps_ptr) \
- ((uintptr_t)LOAD_INFO_DEPS(ps_ptr) + (ps_ptr)->ndeps * sizeof(uint32_t))
-#define LOAD_INFO_ASSET(ps_ptr) \
- ((uintptr_t)LOAD_INFO_SERVICE(ps_ptr) + \
- (ps_ptr)->nservices * sizeof(struct service_load_info_t))
-
-#endif /* __PARTITION_STATIC_LOAD_H__ */
diff --git a/secure_fw/include/load/service_defs.h b/secure_fw/include/load/service_defs.h
deleted file mode 100644
index d0825072d4..0000000000
--- a/secure_fw/include/load/service_defs.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2021, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#ifndef __SERVICE_DEFS_H__
-#define __SERVICE_DEFS_H__
-
-#include <stdint.h>
-#include "psa/service.h"
-
-/*
- * Service static data - flags
- * bit 7-0: version policy
- * bit 8: 1 - NS accessible, 0 - NS not accessible
- * bit 9: 1 - stateless, 0 - connection-based
- */
-#define SERVICE_FLAG_NS_ACCESSIBLE (1U << 8)
-#define SERVICE_FLAG_STATELESS (1U << 9)
-
-#define TFM_VERSION_POLICY_RELAXED (0x0)
-#define TFM_VERSION_POLICY_STRICT (0x1)
-#define SERVICE_VERSION_POLICY_MASK (0xFF)
-
-#define SERVICE_IS_NS_ACCESSIBLE(flag) \
- ((flag) & SERVICE_FLAG_NS_ACCESSIBLE)
-#define SERVICE_IS_STATELESS(flag) \
- ((flag) & SERVICE_FLAG_STATELESS)
-#define SERVICE_GET_VERSION_POLICY(flag) \
- ((flag) & SERVICE_VERSION_POLICY_MASK)
-
-/* Common service structure type */
-struct service_load_info_t {
- uintptr_t name_strid; /* String ID for name */
- psa_signal_t signal; /* Service signal */
- uint32_t sid; /* Service ID */
- uint32_t flags; /* Flags */
- uint32_t version; /* Service version */
-} __attribute__((aligned(4)));
-
-#endif /* __SERVICE_DEFS_H__ */