2 * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
4 * SPDX-License-Identifier: BSD-3-Clause
11 #error "This file must only be included from smccc.h"
14 /*******************************************************************************
15 * Bit definitions inside the function id as per the SMC calling convention
16 ******************************************************************************/
17 #define FUNCID_TYPE_SHIFT U(31)
18 #define FUNCID_TYPE_MASK U(0x1)
19 #define FUNCID_TYPE_WIDTH U(1)
21 #define FUNCID_CC_SHIFT U(30)
22 #define FUNCID_CC_MASK U(0x1)
23 #define FUNCID_CC_WIDTH U(1)
25 #define FUNCID_OEN_SHIFT U(24)
26 #define FUNCID_OEN_MASK U(0x3f)
27 #define FUNCID_OEN_WIDTH U(6)
29 #define FUNCID_NUM_SHIFT U(0)
30 #define FUNCID_NUM_MASK U(0xffff)
31 #define FUNCID_NUM_WIDTH U(16)
33 #define GET_SMC_TYPE(id) (((id) >> FUNCID_TYPE_SHIFT) & \
35 #define GET_SMC_CC(id) (((id) >> FUNCID_CC_SHIFT) & \
37 #define GET_SMC_OEN(id) (((id) >> FUNCID_OEN_SHIFT) & \
40 /*******************************************************************************
41 * Owning entity number definitions inside the function id as per the SMC
43 ******************************************************************************/
44 #define OEN_ARM_START U(0)
45 #define OEN_ARM_END U(0)
46 #define OEN_CPU_START U(1)
47 #define OEN_CPU_END U(1)
48 #define OEN_SIP_START U(2)
49 #define OEN_SIP_END U(2)
50 #define OEN_OEM_START U(3)
51 #define OEN_OEM_END U(3)
52 #define OEN_STD_START U(4) /* Standard Service Calls */
53 #define OEN_STD_END U(4)
54 #define OEN_STD_HYP_START U(5) /* Standard Hypervisor Service calls */
55 #define OEN_STD_HYP_END U(5)
56 #define OEN_VEN_HYP_START U(6) /* Vendor Hypervisor Service calls */
57 #define OEN_VEN_HYP_END U(6)
58 #define OEN_TAP_START U(48) /* Trusted Applications */
59 #define OEN_TAP_END U(49)
60 #define OEN_TOS_START U(50) /* Trusted OS */
61 #define OEN_TOS_END U(63)
62 #define OEN_LIMIT U(64)
64 /* Flags and error codes */
68 #define SMC_TYPE_FAST ULL(1)
69 #define SMC_TYPE_YIELD ULL(0)
73 #define SMC_PREEMPTED -2 /* Not defined by the SMCCC */
75 #endif /* SMCCC_V1_H */