mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-08-18 02:17:01 +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>
72 lines
2.2 KiB
C
72 lines
2.2 KiB
C
/*
|
|
* Copyright (c) 2018, Arm Limited. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef SPRT_SVC_H
|
|
#define SPRT_SVC_H
|
|
|
|
#include <lib/smccc.h>
|
|
#include <lib/utils_def.h>
|
|
|
|
/* SPRT_VERSION helpers */
|
|
|
|
#define SPRT_VERSION_MAJOR U(0)
|
|
#define SPRT_VERSION_MAJOR_SHIFT 16
|
|
#define SPRT_VERSION_MAJOR_MASK U(0x7FFF)
|
|
#define SPRT_VERSION_MINOR U(1)
|
|
#define SPRT_VERSION_MINOR_SHIFT 0
|
|
#define SPRT_VERSION_MINOR_MASK U(0xFFFF)
|
|
#define SPRT_VERSION_FORM(major, minor) ((((major) & SPRT_VERSION_MAJOR_MASK) \
|
|
<< SPRT_VERSION_MAJOR_SHIFT) | \
|
|
((minor) & SPRT_VERSION_MINOR_MASK))
|
|
#define SPRT_VERSION_COMPILED SPRT_VERSION_FORM(SPRT_VERSION_MAJOR, \
|
|
SPRT_VERSION_MINOR)
|
|
|
|
/* SPRT function IDs */
|
|
|
|
#define SPRT_FID_VERSION U(0x0)
|
|
#define SPRT_FID_PUT_RESPONSE U(0x1)
|
|
#define SPRT_FID_YIELD U(0x5)
|
|
#define SPRT_FID_PANIC U(0x7)
|
|
#define SPRT_FID_MEMORY_PERM_ATTR_GET U(0xB)
|
|
#define SPRT_FID_MEMORY_PERM_ATTR_SET U(0xC)
|
|
|
|
#define SPRT_FID_MASK U(0xFF)
|
|
|
|
/* Definitions to build the complete SMC ID */
|
|
|
|
#define SPRT_SMC_64(sprt_fid) ((FUNCID_NAMESPACE_SPRT << FUNCID_NAMESPACE_SHIFT) | \
|
|
(U(1) << 31) | ((sprt_fid) & SPRT_FID_MASK) | \
|
|
(SMC_64 << FUNCID_CC_SHIFT))
|
|
#define SPRT_SMC_32(sprt_fid) ((FUNCID_NAMESPACE_SPRT << FUNCID_NAMESPACE_SHIFT) | \
|
|
(U(1) << 31) | ((sprt_fid) & SPRT_FID_MASK) | \
|
|
(SMC_32 << FUNCID_CC_SHIFT))
|
|
|
|
/* Complete SMC IDs */
|
|
|
|
#define SPRT_VERSION SPRT_SMC_32(SPRT_FID_VERSION)
|
|
#define SPRT_PUT_RESPONSE_AARCH64 SPRT_SMC_64(SPRT_FID_PUT_RESPONSE)
|
|
#define SPRT_YIELD_AARCH64 SPRT_SMC_64(SPRT_FID_YIELD)
|
|
#define SPRT_PANIC_AARCH64 SPRT_SMC_64(SPRT_FID_PANIC)
|
|
#define SPRT_MEMORY_PERM_ATTR_GET_AARCH64 SPRT_SMC_64(SPRT_FID_MEMORY_PERM_ATTR_GET)
|
|
#define SPRT_MEMORY_PERM_ATTR_SET_AARCH64 SPRT_SMC_64(SPRT_FID_MEMORY_PERM_ATTR_SET)
|
|
|
|
/* Defines used by SPRT_MEMORY_PERM_ATTR_{GET,SET}_AARCH64 */
|
|
|
|
#define SPRT_MEMORY_PERM_ATTR_RO U(0)
|
|
#define SPRT_MEMORY_PERM_ATTR_RW U(1)
|
|
#define SPRT_MEMORY_PERM_ATTR_RO_EXEC U(2)
|
|
/* U(3) is reserved */
|
|
#define SPRT_MEMORY_PERM_ATTR_MASK U(3)
|
|
#define SPRT_MEMORY_PERM_ATTR_SHIFT 3
|
|
|
|
/* SPRT error codes. */
|
|
|
|
#define SPRT_SUCCESS 0
|
|
#define SPRT_NOT_SUPPORTED -1
|
|
#define SPRT_INVALID_PARAMETER -2
|
|
|
|
#endif /* SPRT_SVC_H */
|