]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Include/IndustryStandard/ArmMmSvc.h
ArmPkg: Fix Ecc error 8003
[mirror_edk2.git] / ArmPkg / Include / IndustryStandard / ArmMmSvc.h
1 /** @file
2 *
3 * Copyright (c) 2012-2017, ARM Limited. All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-2-Clause-Patent
6 *
7 **/
8
9 #ifndef ARM_MM_SVC_H_
10 #define ARM_MM_SVC_H_
11
12 /*
13 * SVC IDs to allow the MM secure partition to initialise itself, handle
14 * delegated events and request the Secure partition manager to perform
15 * privileged operations on its behalf.
16 */
17 #define ARM_SVC_ID_SPM_VERSION_AARCH32 0x84000060
18 #define ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64 0xC4000061
19 #define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64 0xC4000064
20 #define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64 0xC4000065
21
22 #define SET_MEM_ATTR_DATA_PERM_MASK 0x3
23 #define SET_MEM_ATTR_DATA_PERM_SHIFT 0
24 #define SET_MEM_ATTR_DATA_PERM_NO_ACCESS 0
25 #define SET_MEM_ATTR_DATA_PERM_RW 1
26 #define SET_MEM_ATTR_DATA_PERM_RO 3
27
28 #define SET_MEM_ATTR_CODE_PERM_MASK 0x1
29 #define SET_MEM_ATTR_CODE_PERM_SHIFT 2
30 #define SET_MEM_ATTR_CODE_PERM_X 0
31 #define SET_MEM_ATTR_CODE_PERM_XN 1
32
33 #define SET_MEM_ATTR_MAKE_PERM_REQUEST(d_perm, c_perm) \
34 ((((c_perm) & SET_MEM_ATTR_CODE_PERM_MASK) << SET_MEM_ATTR_CODE_PERM_SHIFT) | \
35 (( (d_perm) & SET_MEM_ATTR_DATA_PERM_MASK) << SET_MEM_ATTR_DATA_PERM_SHIFT))
36
37 /* MM SVC Return error codes */
38 #define ARM_SVC_SPM_RET_SUCCESS 0
39 #define ARM_SVC_SPM_RET_NOT_SUPPORTED -1
40 #define ARM_SVC_SPM_RET_INVALID_PARAMS -2
41 #define ARM_SVC_SPM_RET_DENIED -3
42 #define ARM_SVC_SPM_RET_NO_MEMORY -5
43
44 #define SPM_MAJOR_VERSION 0
45 #define SPM_MINOR_VERSION 1
46
47 #endif // ARM_MM_SVC_H_