From patchwork Wed Nov 22 10:07:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 119452 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp6489501qgn; Wed, 22 Nov 2017 02:08:09 -0800 (PST) X-Google-Smtp-Source: AGs4zMaBO04tjXNBsrFgcD50yHkuhubOnO6rQyI9jU7f/fK3QHDBWgJFp9enXnbKTAG2Tu1WiLbH X-Received: by 10.99.3.88 with SMTP id 85mr20614423pgd.111.1511345289277; Wed, 22 Nov 2017 02:08:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511345289; cv=none; d=google.com; s=arc-20160816; b=jBcBZrTjei6kLRsleXzkkDrMPByCP9Fe+E/gmusFPsb/ILzJn/9zj0TVbSOUuetd19 Nvioa+R0MtOwpqi5rS794+TzaY3q5n2KF/b9qfqGpTbqlqyhh/9mf9hqtivEZNhyEPYC b99BZ8TLKJXzfijORPnLm3VNln/fVXPmgDdBZLbO9Tk/ScJobv6R4ES/zfiKsDDIkxJ7 sZAZDOo/ra00t89Lfxyz+9H2M+Zv2+1iu7h4a72gOtWDeDlL/VR7JP/OYmYVEiSRtHbv RKEmOvtewnlDSXPSc0j2Z8+m8ipSxqEaqYJFv1DMqiBBwemqZq6Kw0Jnjp2w0Bbywhxa Lo4g== 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=KFKFXHJsPgk+ntma8GzHNyktsdGEu0b3lfq8fviepKM=; b=Zj4qhNv4MaMV5YyyFO3kFWCoXEe7aDFuM28NW5maQtOCjp5ZT7Xs/MWUVlQ9K7KiD8 buLX/whkz2bQeMpn9uDQQRJ/bsjI4RY+8GXXBU6h9+nW9vkxkAH0EVSvhwSv/2/fAbIu DzW4vQow36ZuVJxiS8PpFQrsFewNH57EL+AC8XNVRnngGHb2HIjVXrv2b1OFy5B9BH63 JySr45pAGT7bEP0hY/+UL5+MOx09pxJwoz0U9//VPgQtOuJe0cAgcgNTKgO9buunmGCv Q3lMCWy978eHGoDBZfvzQIZ3yg12LXqE24r6ycMXY0o4hmkxFUqazc+15y9LGWKPi8xy DReA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MkHfWT5o; 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 sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id d126si14372489pfg.11.2017.11.22.02.08.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Nov 2017 02:08:09 -0800 (PST) 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 header.s=google header.b=MkHfWT5o; 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 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 3B853220C1623; Wed, 22 Nov 2017 02:03:44 -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 26116220C1602 for ; Wed, 22 Nov 2017 02:03:39 -0800 (PST) Received: by mail-wm0-x243.google.com with SMTP id v186so8937886wma.2 for ; Wed, 22 Nov 2017 02:07:55 -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=hq9M4e+t/Dtj7DciQ9f1O+Zv/7Fr/aDPE0rN3WJcHfM=; b=MkHfWT5ob7p9DLBoYQp7CN16G06dRmK0MIFCHDI+bhdo3CXZM0O/q8EwdeYbA4Vn35 Crt84RW/+NNxJGWG0NvF/Z1Y1dhDigox2lv+tyF+pn9OLd5uARovUOiR7CB/m6+XXWFv LMcIP0zsf0YEVifr2UmZ+j9c91n6jMlSif/rQ= 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=hq9M4e+t/Dtj7DciQ9f1O+Zv/7Fr/aDPE0rN3WJcHfM=; b=A/kLRJtxTSu07J44FCjtpoZkCeoOk/sQuS7UEZhDvtF+AfskULBoMmhqjW01LuGHFR WzKyXuVUO0y5C3m9Qo0+La0zadUGhMgblg/om4G1BNmJFcJThAMIe7l8wiN4EZDQc/Xd G+EMNeqiCSRAAMGv2IcmhwIBVCnptexh2KVP+TsRLgs2/mt8SwVzC3HyXANVsYzI4i1o LxOKtSsnifGuDSfzq6KBLu/smJ/K9cecQvKKhlYv/N39bVlnnYa6sgXlz8souoKKehiv JMzYngJaoNQ8rwUQwPHrlPlPcqn9XSynaH/od2FIyHyJA2kqrGI3C6IgB2NumT+BzvZA Ch8A== X-Gm-Message-State: AJaThX4vbxYYRz5hTpJLyGyqhpH6AeRF6/qKLlTNXAFdk8Zc8YVPtrs7 LzsGzlm3HizcXisN3MQTMOLHtC8LR4g= X-Received: by 10.28.217.75 with SMTP id q72mr3517998wmg.9.1511345273803; Wed, 22 Nov 2017 02:07:53 -0800 (PST) Received: from localhost.localdomain ([154.145.25.106]) by smtp.gmail.com with ESMTPSA id i192sm2761457wmf.46.2017.11.22.02.07.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Nov 2017 02:07:52 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com Date: Wed, 22 Nov 2017 10:07:26 +0000 Message-Id: <20171122100731.24525-10-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171122100731.24525-1-ard.biesheuvel@linaro.org> References: <20171122100731.24525-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 09/14] 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: 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 | 41 ++++++++++++++++++++ 2 files changed, 44 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..bdf1c513bc6d --- /dev/null +++ b/ArmVirtPkg/Include/Library/ArmVirtMemInfoLib.h @@ -0,0 +1,41 @@ +/** @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. The allocated memory + will not be freed. + +**/ +VOID +EFIAPI +ArmVirtGetMemoryMap ( + OUT ARM_MEMORY_REGION_DESCRIPTOR **VirtualMemoryMap + ); + +#endif