]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Include/IndustryStandard/ArmMmSvc.h
ArmPkg/Include: Fix the SPM version SVC ID
[mirror_edk2.git] / ArmPkg / Include / IndustryStandard / ArmMmSvc.h
1 /** @file
2 *
3 * Copyright (c) 2012-2017, ARM Limited. All rights reserved.
4 *
5 * This program and the accompanying materials
6 * are licensed and made available under the terms and conditions of the BSD License
7 * which accompanies this distribution. The full text of the license may be found at
8 * http://opensource.org/licenses/bsd-license.php
9 *
10 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 *
13 **/
14
15 #ifndef __ARM_MM_SVC_H__
16 #define __ARM_MM_SVC_H__
17
18 /*
19 * SVC IDs to allow the MM secure partition to initialise itself, handle
20 * delegated events and request the Secure partition manager to perform
21 * privileged operations on its behalf.
22 */
23 #define ARM_SVC_ID_SPM_VERSION_AARCH32 0x84000060
24 #define ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64 0xC4000061
25 #define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64 0xC4000064
26 #define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64 0xC4000065
27
28 #define SET_MEM_ATTR_DATA_PERM_MASK 0x3
29 #define SET_MEM_ATTR_DATA_PERM_SHIFT 0
30 #define SET_MEM_ATTR_DATA_PERM_NO_ACCESS 0
31 #define SET_MEM_ATTR_DATA_PERM_RW 1
32 #define SET_MEM_ATTR_DATA_PERM_RO 3
33
34 #define SET_MEM_ATTR_CODE_PERM_MASK 0x1
35 #define SET_MEM_ATTR_CODE_PERM_SHIFT 2
36 #define SET_MEM_ATTR_CODE_PERM_X 0
37 #define SET_MEM_ATTR_CODE_PERM_XN 1
38
39 #define SET_MEM_ATTR_MAKE_PERM_REQUEST(d_perm, c_perm) \
40 ((((c_perm) & SET_MEM_ATTR_CODE_PERM_MASK) << SET_MEM_ATTR_CODE_PERM_SHIFT) | \
41 (( (d_perm) & SET_MEM_ATTR_DATA_PERM_MASK) << SET_MEM_ATTR_DATA_PERM_SHIFT))
42
43 #endif