diff options
Diffstat (limited to 'include/lib/smcc.h')
-rw-r--r-- | include/lib/smcc.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/include/lib/smcc.h b/include/lib/smcc.h index 13b1e7ac..0a2d9277 100644 --- a/include/lib/smcc.h +++ b/include/lib/smcc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -35,13 +35,13 @@ #define SMC_64 U(1) #define SMC_32 U(0) #define SMC_OK U(0) -#define SMC_UNK U(0xffffffff) +#define SMC_UNK -1 #define SMC_TYPE_FAST ULL(1) #if !ERROR_DEPRECATED #define SMC_TYPE_STD ULL(0) #endif #define SMC_TYPE_YIELD U(0) -#define SMC_PREEMPTED U(0xfffffffe) +#define SMC_PREEMPTED -2 /******************************************************************************* * Owning entity number definitions inside the function id as per the SMC * calling convention @@ -67,6 +67,11 @@ #include <cassert.h> #include <stdint.h> +#define SMCCC_MAJOR_VERSION U(1) +#define SMCCC_MINOR_VERSION U(1) + +#define MAKE_SMCCC_VERSION(_major, _minor) (((_major) << 16) | (_minor)) + /* Various flags passed to SMC handlers */ #define SMC_FROM_SECURE (U(0) << 0) #define SMC_FROM_NON_SECURE (U(1) << 0) @@ -78,6 +83,10 @@ #define is_std_svc_call(_fid) ((((_fid) >> FUNCID_OEN_SHIFT) & \ FUNCID_OEN_MASK) == OEN_STD_START) +/* The macro below is used to identify a Arm Architectural Service SMC call */ +#define is_arm_arch_svc_call(_fid) ((((_fid) >> FUNCID_OEN_SHIFT) & \ + FUNCID_OEN_MASK) == OEN_ARM_START) + /* The macro below is used to identify a valid Fast SMC call */ #define is_valid_fast_smc(_fid) ((!(((_fid) >> 16) & U(0xff))) && \ (GET_SMC_TYPE(_fid) == SMC_TYPE_FAST)) @@ -90,7 +99,7 @@ */ #define DEFINE_SVC_UUID(_name, _tl, _tm, _th, _cl, _ch, \ _n0, _n1, _n2, _n3, _n4, _n5) \ - CASSERT(_tl != SMC_UNK, invalid_svc_uuid);\ + CASSERT((uint32_t)(_tl) != (uint32_t) SMC_UNK, invalid_svc_uuid);\ static const uuid_t _name = { \ _tl, _tm, _th, _cl, _ch, \ { _n0, _n1, _n2, _n3, _n4, _n5 } \ |