From patchwork Fri Nov 17 16:09:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 119182 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp703570qgn; Fri, 17 Nov 2017 08:09:56 -0800 (PST) X-Google-Smtp-Source: AGs4zMamFIfgn0QodikZ/Bxh8/O8xeukvb/RqCR1BVIuxXlvVz6F6DW3bUjlVrKiKl0s1ewAYmzv X-Received: by 10.159.245.148 with SMTP id a20mr5641981pls.202.1510934996245; Fri, 17 Nov 2017 08:09:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510934996; cv=none; d=google.com; s=arc-20160816; b=NIe152rxqLTzuCcv5cP/iUPzkSPA0jWG5+jgc/u/PJasRKUKhTXfw8yARIdsLV/jyP SSXF3nRB/9Sy6BsKc7cAtyOTSXNKTV2D9AJDpZvk4YlqdBOa54Lv4IhO8ylbCJFrvlaV RjDZaJjZWMCEhqaSWZxRgavzDQYcRHeOCKlnmfzVNb2hpGqIqnkd7HLLFu9B4gQMSiuh BX8+9Ci8Cx4QWd7orU4KwM/Um+GoSTAV588AiS1T7oZ7qdF9EVN1EeLt1gGFQdDuHgbv wFmcie05rI/Zx1km2WI92PMLMioHNgICCtK++lQ0/mJsb3FYAw1IyEFaL4mKsTMws5WM Bx7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=1Xy1pHc+vKBewIe2J+lJM6ppxXMY3q0sq+thWQJobbM=; b=fW0GE4Ej6kxAC7YT2Uc1XuJvVH6JjeX4Fme4fkp3uqD2KCzXC0toS1IFmUq/LNwN5H Bdx8JlhHNisLgvujzDCB1p47mXAHaaigtkN7GuiLFffZBALQIKJ7HsbrqOIO+DxqbVwA uc/h/OvClryiDkoppNaXS/tM8CqfmcDEDRICwuIJC8FcqnOZcU04i+E0aGcqIS9VibjO NcTyzBMUeyivUKcmSlHeCEUwDyK8Lj17vDwZjeq6EM+DYx/UV3KK0SNphXzOld12LKWP Oeyg6VpYnZzdD3vWLTW7ugw2aJUNbqsQ2JcjiMXqAjaKkGypeH/YkDVJd6ixu7iG6r1T BMtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=X0XpSckf; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id r66si3270104pfi.217.2017.11.17.08.09.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=X0XpSckf; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0AB7B2035BB26; Fri, 17 Nov 2017 08:05:33 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::243; helo=mail-wm0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (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 024E92035BB24 for ; Fri, 17 Nov 2017 08:05:30 -0800 (PST) Received: by mail-wm0-x243.google.com with SMTP id b189so7481340wmd.0 for ; Fri, 17 Nov 2017 08:09:41 -0800 (PST) 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=czegQEplayVd6OVuFpEeJbO+lbibqGWFW6iKBUYI4a0=; b=X0XpSckfG8fqBcHPjfGSIpdFWFv9pnWnGA5b0SReivt+YJGeYUn8k9Kdk2fNNC0Gyk rqW3mnD2o1RbZyWYw1qkXkR/m7+WAyES4s7VAedy6hqN06Ye2VALf1tA8afbO2fOF316 T5qhPn4MTECcub2nbbZTwhUuvoqgVOcyW5X7I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=czegQEplayVd6OVuFpEeJbO+lbibqGWFW6iKBUYI4a0=; b=Xp+l2p8NWAy7GgBHFCqjjaVcjenjHWQIwDU0qzmR1A5z1xRe+m0U961xwS+kFwS8WW YMjfE1ms09/JLV6zmMDgScsTVd+WJCdG8k3cQ7KX5QseiXtrQ2A0GM1E2Fb+3idAXxLL Eovndff/MDSi5rNzpmm1K89QAfPfRZ1mhQGeyydi4bPjGmpit9pF38qlA2bxbOscYJoV sEV6xIH4AMVOuIlSw3Ai1+O+o/Uwylexrt4V7ZFNo9CjZJcx2gyEmlm23Omudc+hzsBR //udr+fcqqouy697Nc9R5wXvU6FxSHIG8tvidgBFTurq1iOm2ytoc35J8Vjb1VMFSKIS NTYg== X-Gm-Message-State: AJaThX58+ggbaHwO+u2ZSlGC84Wj5alM70VhOZWr+1hdiAF/+t61boQe Asjn9o8JSJpdiJr35lWiOUfR6k9cups= X-Received: by 10.28.30.151 with SMTP id e145mr4274632wme.8.1510934980218; Fri, 17 Nov 2017 08:09:40 -0800 (PST) Received: from localhost.localdomain ([160.167.170.128]) by smtp.gmail.com with ESMTPSA id p42sm5575959wrb.28.2017.11.17.08.09.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 08:09:39 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Fri, 17 Nov 2017 16:09:08 +0000 Message-Id: <20171117160913.17292-11-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171117160913.17292-1-ard.biesheuvel@linaro.org> References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 10/15] ArmVirtPkg: introduce ArmVirtMemInfoLib library class 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: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" As part of the effort to get rid of ArmPlatformLib (which incorporates far too many duties in a single library), introduce ArmVirtMemInfoLib which will be invoked by our ArmVirtMemoryInitPeiLib implementation to get a description of the virtual address space. This will allow us to remove this functionality from ArmPlatformLib later, or, in the case of ArmVirtXen and ArmVirtQemuKernel, drop ArmPlatformLib altogether. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/ArmVirtPkg.dec | 3 ++ ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h | 39 ++++++++++++++++++++ 2 files changed, 42 insertions(+) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Laszlo Ersek diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec index a8603e1b80e5..8f656fd2739d 100644 --- a/ArmVirtPkg/ArmVirtPkg.dec +++ b/ArmVirtPkg/ArmVirtPkg.dec @@ -30,6 +30,9 @@ [Defines] [Includes.common] Include # Root include for the package +[LibraryClasses] + ArmVirtMemInfoLib|Include/Library/ArmVirtMemInfoLib.h + [Guids.common] gArmVirtTokenSpaceGuid = { 0x0B6F5CA7, 0x4F53, 0x445A, { 0xB7, 0x6E, 0x2E, 0x36, 0x5B, 0x80, 0x63, 0x66 } } gEarlyPL011BaseAddressGuid = { 0xB199DEA9, 0xFD5C, 0x4A84, { 0x80, 0x82, 0x2F, 0x41, 0x70, 0x78, 0x03, 0x05 } } diff --git a/ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h b/ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h new file mode 100644 index 000000000000..65be2cbd8082 --- /dev/null +++ b/ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h @@ -0,0 +1,39 @@ +/** @file + + Copyright (c) 2011-2013, ARM Limited. All rights reserved. + Copyright (c) 2017, 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_VIRT_MEMINFO_LIB_H_ +#define _ARM_VIRT_MEMINFO_LIB_H_ + +#include +#include + +/** + Return the Virtual Memory Map of your platform + + This Virtual Memory Map is used by MemoryInitPei Module to initialize the MMU + on your platform. + + @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR + describing a Physical-to-Virtual Memory + mapping. This array must be ended by a + zero-filled entry + +**/ +VOID +ArmVirtGetMemoryMap ( + OUT ARM_MEMORY_REGION_DESCRIPTOR **VirtualMemoryMap + ); + +#endif