From patchwork Fri Jul 1 15:43:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 71315 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp367422qgy; Fri, 1 Jul 2016 08:44:08 -0700 (PDT) X-Received: by 10.66.25.78 with SMTP id a14mr5746913pag.11.1467387846879; Fri, 01 Jul 2016 08:44:06 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id rb9si4686682pab.270.2016.07.01.08.44.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Jul 2016 08:44:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2BFCC1A1E27; Fri, 1 Jul 2016 08:44:42 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3C5BA1A1E1B for ; Fri, 1 Jul 2016 08:44:41 -0700 (PDT) Received: by mail-wm0-x232.google.com with SMTP id v199so31594839wmv.0 for ; Fri, 01 Jul 2016 08:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FQitNAFk0pgT6kcIDD4LOedjHM76uykUZ0pCnNptJx4=; b=gpYVKPADeVGFodV/uRhoTlWghxrDwEWQBN1PYrVWR8dyIvAFn0HskpbYwpHnrrdD1I S8Qh5ir62PipB+Q7/yhPrIOqNWXmm3pAgXEURR9SO9WHNJ8F1hEdn7sDGZhqVUR51sNb YMtTCoECOGTU6PIPueUQWNe56mf14s90yQ56g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FQitNAFk0pgT6kcIDD4LOedjHM76uykUZ0pCnNptJx4=; b=HXOAgw7i44rN0/GmKmE5jMbhCUrHVb4LP/a4C4Md63sUQoDOV0m0t65COmlzj67RJ2 9E94TCKrw55+eynItEtQbI4v9fzkmLMc5JFZZouOyw6/LY966i+cdM4MIn0gly011vmX +uoZ2AFRkmqEqfwsVThTC4B/6E8wCiNc84ucvnDXXCD3WCsU9Q7F+DgkTZQv7L++mZp3 hRmgBBKr034mLnowWsCH91dsMC+hhGQIvqeQvpUz3MXqP8/EgWwn5jpigYVSugdTKTE6 djP5ywDbxCsWT92+/i8pv393os7XjILi88BDA3bIJlxTIPbQ8LIRH/BJ6olUh+87wHaQ 2hjw== X-Gm-Message-State: ALyK8tKa5L7/NgDpsQR4mX3KsXsFoFg2UU22xQQ3LFk40j+NeGCgLDV4tbmd7DzxEi5UvuKd X-Received: by 10.194.173.230 with SMTP id bn6mr4165850wjc.8.1467387842709; Fri, 01 Jul 2016 08:44:02 -0700 (PDT) Received: from localhost.localdomain ([188.203.148.129]) by smtp.gmail.com with ESMTPSA id l1sm6678056wjy.17.2016.07.01.08.44.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Jul 2016 08:44:01 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, lersek@redhat.com Date: Fri, 1 Jul 2016 17:43:53 +0200 Message-Id: <1467387836-3419-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1467387836-3419-1-git-send-email-ard.biesheuvel@linaro.org> References: <1467387836-3419-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 1/4] ArmPkg: introduce ArmMmuLib library class X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: star.zeng@intel.com, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Introduce the library class ArmMmuLib, which encapsulates the functionality to set up and modify page table entries. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmPkg/ArmPkg.dec | 1 + ArmPkg/Include/Library/ArmMmuLib.h | 65 ++++++++++++++++++++ 2 files changed, 66 insertions(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec index 75c238aa1e3d..c189117c674d 100644 --- a/ArmPkg/ArmPkg.dec +++ b/ArmPkg/ArmPkg.dec @@ -34,6 +34,7 @@ [Includes.common] [LibraryClasses.common] ArmLib|Include/Library/ArmLib.h + ArmMmuLib|Include/Library/ArmMmuLib.h SemihostLib|Include/Library/Semihosting.h UncachedMemoryAllocationLib|Include/Library/UncachedMemoryAllocationLib.h DefaultExceptionHandlerLib|Include/Library/DefaultExceptionHandlerLib.h diff --git a/ArmPkg/Include/Library/ArmMmuLib.h b/ArmPkg/Include/Library/ArmMmuLib.h new file mode 100644 index 000000000000..c1d43872d548 --- /dev/null +++ b/ArmPkg/Include/Library/ArmMmuLib.h @@ -0,0 +1,65 @@ +/** @file + + Copyright (c) 2015 - 2016, Linaro Ltd. 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_MMU_LIB__ +#define __ARM_MMU_LIB__ + +#include + +#include + +EFI_STATUS +EFIAPI +ArmConfigureMmu ( + IN ARM_MEMORY_REGION_DESCRIPTOR *MemoryTable, + OUT VOID **TranslationTableBase OPTIONAL, + OUT UINTN *TranslationTableSize OPTIONAL + ); + +EFI_STATUS +EFIAPI +ArmSetMemoryRegionNoExec ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length + ); + +EFI_STATUS +EFIAPI +ArmClearMemoryRegionNoExec ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length + ); + +EFI_STATUS +EFIAPI +ArmSetMemoryRegionReadOnly ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length + ); + +EFI_STATUS +EFIAPI +ArmClearMemoryRegionReadOnly ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length + ); + +VOID +EFIAPI +ArmReplaceLiveTranslationEntry ( + IN UINT64 *Entry, + IN UINT64 Value + ); + +#endif