From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=217.140.101.70; helo=foss.arm.com; envelope-from=supreeth.venkatesh@arm.com; receiver=edk2-devel@lists.01.org Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by ml01.01.org (Postfix) with ESMTP id 7978720945BAC for ; Wed, 27 Sep 2017 11:56:15 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1FBC11529; Wed, 27 Sep 2017 11:59:29 -0700 (PDT) Received: from u201365.usa.Arm.com (bc-c3-3-14.eu.iaas.arm.com [10.6.43.238]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 347733F3E1; Wed, 27 Sep 2017 11:59:28 -0700 (PDT) From: Supreeth Venkatesh To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, Supreeth Venkatesh Date: Wed, 27 Sep 2017 19:58:59 +0100 Message-Id: <20170927185859.27833-2-supreeth.venkatesh@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170927185859.27833-1-supreeth.venkatesh@arm.com> References: <20170927185859.27833-1-supreeth.venkatesh@arm.com> Subject: [PATCH v2 2/2] ArmPkg/Include: Add SVC function IDs for Management Mode. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Sep 2017 18:56:15 -0000 SVCs are in the range 0xC4000060 - 0xC400007f. The functions available to the secure MM partition: 1. Signal completion of MM event handling. 2. Set/Get memory attributes for a memory region at runtime. 3. Get version number of secure partition manager. Also, it defines memory attributes required for set/get operations. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Supreeth Venkatesh --- ArmPkg/Include/IndustryStandard/ArmMmSvc.h | 43 ++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 ArmPkg/Include/IndustryStandard/ArmMmSvc.h diff --git a/ArmPkg/Include/IndustryStandard/ArmMmSvc.h b/ArmPkg/Include/IndustryStandard/ArmMmSvc.h new file mode 100644 index 0000000000..4c7b6c3386 --- /dev/null +++ b/ArmPkg/Include/IndustryStandard/ArmMmSvc.h @@ -0,0 +1,43 @@ +/** @file +* +* Copyright (c) 2012-2017, ARM Limited. All rights reserved. +* +* This program and the accompanying materials +* are licensed and made available under the terms and conditions of the BSD License +* which accompanies this distribution. The full text of the license may be found at +* http://opensource.org/licenses/bsd-license.php +* +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +* +**/ + +#ifndef __ARM_MM_SVC_H__ +#define __ARM_MM_SVC_H__ + +/* + * SVC IDs to allow the MM secure partition to initialise itself, handle + * delegated events and request the Secure partition manager to perform + * privileged operations on its behalf. + */ +#define ARM_SVC_ID_SPM_VERSION_AARCH64 0xC4000060 +#define ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64 0xC4000061 +#define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64 0xC4000064 +#define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64 0xC4000065 + +#define SET_MEM_ATTR_DATA_PERM_MASK 0x3 +#define SET_MEM_ATTR_DATA_PERM_SHIFT 0 +#define SET_MEM_ATTR_DATA_PERM_NO_ACCESS 0 +#define SET_MEM_ATTR_DATA_PERM_RW 1 +#define SET_MEM_ATTR_DATA_PERM_RO 3 + +#define SET_MEM_ATTR_CODE_PERM_MASK 0x1 +#define SET_MEM_ATTR_CODE_PERM_SHIFT 2 +#define SET_MEM_ATTR_CODE_PERM_X 0 +#define SET_MEM_ATTR_CODE_PERM_XN 1 + +#define SET_MEM_ATTR_MAKE_PERM_REQUEST(d_perm, c_perm) \ + ((((c_perm) & SET_MEM_ATTR_CODE_PERM_MASK) << SET_MEM_ATTR_CODE_PERM_SHIFT) | \ + (( (d_perm) & SET_MEM_ATTR_DATA_PERM_MASK) << SET_MEM_ATTR_DATA_PERM_SHIFT)) + +#endif -- 2.14.1