From patchwork Thu Jun 16 10:29:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 70166 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp185342qgy; Thu, 16 Jun 2016 03:29:39 -0700 (PDT) X-Received: by 10.66.50.105 with SMTP id b9mr4331614pao.122.1466072979536; Thu, 16 Jun 2016 03:29:39 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id o128si5367916pfg.246.2016.06.16.03.29.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jun 2016 03:29:39 -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 23FCA1A1E30; Thu, 16 Jun 2016 03:30:04 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (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 515A41A1E08 for ; Thu, 16 Jun 2016 03:30:02 -0700 (PDT) Received: by mail-wm0-x22f.google.com with SMTP id a66so51090940wme.0 for ; Thu, 16 Jun 2016 03:29:36 -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=8L6Rj67QVyRTWhbXxdR23nv1BrO/OvB0yQIGG4MOS3k=; b=OZF2WlCAE0kFnq+jZLKze0ShXUyEf5o5+P4XEz2ERu7zD/H20mVwlWnm+5mUSPZhm6 OJtZ5GHAQjpmysoOlYIUd/LyLkGYJ0NOuDlTRVMc/2HsRi8BxS8NihzcLOCJBoXdE/w7 /L7d74HuI8pmNtE0zZE2r4HuaMviO4M8kjFtA= 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=8L6Rj67QVyRTWhbXxdR23nv1BrO/OvB0yQIGG4MOS3k=; b=P1rxV/0GMZZaozjK5CeKn25TfZWdcYvDeDqPn0Cu/HNoKABxrCraeUroLIiItYMNQP qWxl4wzJceT5Y3DmdZ2vSoKkUQ25sZtP6eDI8FAgMrjVxwJO6VHPxNQ7/0Zo9lAP3TOz 8Vd9INNOboCXbUpvaGRnRPyB3a+UDvLcI+MfZeiwu2gy0FspQNfj04yo8Rpamb4UtlQB az4Z5fC0ebDcyTLOuwEFJc4nquetaiqiTPJbx/0FoBNtmmGywZFcNvZuBdVcMsmWDFaD Tk7bfd5zGmXsW/OO644O1RbEQ67fTyJoB5SVYWl2nLxgJHqxsArC3d8greYj26838iOx 865A== X-Gm-Message-State: ALyK8tI5KyUwqR3oah1Egb8uaadu6Gq3ta4Cr9qgn7XG3OAgIbaV7r/5RW+7EFTgeaNWv+at X-Received: by 10.28.126.2 with SMTP id z2mr4101401wmc.73.1466072974893; Thu, 16 Jun 2016 03:29:34 -0700 (PDT) Received: from ards-macbook-pro.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id b200sm14163486wmb.9.2016.06.16.03.29.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Jun 2016 03:29:34 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, lersek@redhat.com Date: Thu, 16 Jun 2016 12:29:27 +0200 Message-Id: <1466072970-5318-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466072970-5318-1-git-send-email-ard.biesheuvel@linaro.org> References: <1466072970-5318-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 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: heyi.guo@linaro.org, feng.tian@intel.com, 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(+) -- 1.9.1 _______________________________________________ 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