mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-08-18 10:27:06 +02:00
Enforce full include path for includes. Deprecate old paths. The following folders inside include/lib have been left unchanged: - include/lib/cpus/${ARCH} - include/lib/el3_runtime/${ARCH} The reason for this change is that having a global namespace for includes isn't a good idea. It defeats one of the advantages of having folders and it introduces problems that are sometimes subtle (because you may not know the header you are actually including if there are two of them). For example, this patch had to be created because two headers were called the same way:e0ea0928d5
("Fix gpio includes of mt8173 platform to avoid collision."). More recently, this patch has had similar problems:46f9b2c3a2
("drivers: add tzc380 support"). This problem was introduced in commit4ecca33988
("Move include and source files to logical locations"). At that time, there weren't too many headers so it wasn't a real issue. However, time has shown that this creates problems. Platforms that want to preserve the way they include headers may add the removed paths to PLAT_INCLUDES, but this is discouraged. Change-Id: I39dc53ed98f9e297a5966e723d1936d6ccf2fc8f Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
91 lines
2.4 KiB
C
91 lines
2.4 KiB
C
/*
|
|
* Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef SPM_SVC_H
|
|
#define SPM_SVC_H
|
|
|
|
#if SPM_DEPRECATED
|
|
|
|
#include <lib/utils_def.h>
|
|
|
|
#define SPM_VERSION_MAJOR U(0)
|
|
#define SPM_VERSION_MAJOR_SHIFT 16
|
|
#define SPM_VERSION_MAJOR_MASK U(0x7FFF)
|
|
#define SPM_VERSION_MINOR U(1)
|
|
#define SPM_VERSION_MINOR_SHIFT 0
|
|
#define SPM_VERSION_MINOR_MASK U(0xFFFF)
|
|
#define SPM_VERSION_FORM(major, minor) ((major << SPM_VERSION_MAJOR_SHIFT) | (minor))
|
|
#define SPM_VERSION_COMPILED SPM_VERSION_FORM(SPM_VERSION_MAJOR, SPM_VERSION_MINOR)
|
|
|
|
/* The macros below are used to identify SPM calls from the SMC function ID */
|
|
#define SPM_FID_MASK U(0xffff)
|
|
#define SPM_FID_MIN_VALUE U(0x40)
|
|
#define SPM_FID_MAX_VALUE U(0x7f)
|
|
#define is_spm_fid(_fid) \
|
|
((((_fid) & SPM_FID_MASK) >= SPM_FID_MIN_VALUE) && \
|
|
(((_fid) & SPM_FID_MASK) <= SPM_FID_MAX_VALUE))
|
|
|
|
/*
|
|
* SMC IDs defined for accessing services implemented by the Secure Partition
|
|
* Manager from the Secure Partition(s). These services enable a partition to
|
|
* handle delegated events and request privileged operations from the manager.
|
|
* They occupy the range 0x60-0x7f.
|
|
*/
|
|
#define SPM_VERSION_AARCH32 U(0x84000060)
|
|
#define SP_EVENT_COMPLETE_AARCH64 U(0xC4000061)
|
|
#define SP_MEMORY_ATTRIBUTES_GET_AARCH64 U(0xC4000064)
|
|
#define SP_MEMORY_ATTRIBUTES_SET_AARCH64 U(0xC4000065)
|
|
|
|
/*
|
|
* Macros used by SP_MEMORY_ATTRIBUTES_SET_AARCH64.
|
|
*/
|
|
|
|
#define SP_MEMORY_ATTRIBUTES_ACCESS_NOACCESS U(0)
|
|
#define SP_MEMORY_ATTRIBUTES_ACCESS_RW U(1)
|
|
/* Value U(2) is reserved. */
|
|
#define SP_MEMORY_ATTRIBUTES_ACCESS_RO U(3)
|
|
#define SP_MEMORY_ATTRIBUTES_ACCESS_MASK U(3)
|
|
#define SP_MEMORY_ATTRIBUTES_ACCESS_SHIFT 0
|
|
|
|
#define SP_MEMORY_ATTRIBUTES_EXEC (U(0) << 2)
|
|
#define SP_MEMORY_ATTRIBUTES_NON_EXEC (U(1) << 2)
|
|
|
|
|
|
/* SPM error codes. */
|
|
#define SPM_SUCCESS 0
|
|
#define SPM_NOT_SUPPORTED -1
|
|
#define SPM_INVALID_PARAMETER -2
|
|
#define SPM_DENIED -3
|
|
#define SPM_NO_MEMORY -5
|
|
|
|
#endif /* SPM_DEPRECATED */
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
#include <stdint.h>
|
|
|
|
int32_t spm_setup(void);
|
|
|
|
#if SPM_DEPRECATED
|
|
|
|
uint64_t spm_smc_handler(uint32_t smc_fid,
|
|
uint64_t x1,
|
|
uint64_t x2,
|
|
uint64_t x3,
|
|
uint64_t x4,
|
|
void *cookie,
|
|
void *handle,
|
|
uint64_t flags);
|
|
|
|
/* Helper to enter a Secure Partition */
|
|
uint64_t spm_sp_call(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3);
|
|
|
|
#endif /* SPM_DEPRECATED */
|
|
|
|
#endif /* __ASSEMBLY__ */
|
|
|
|
#endif /* SPM_SVC_H */
|