From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Google-Smtp-Source: AGs4zMYcDkBuHRQmr0dW9m/Ap/X4p8owlKXRXPOPbaMjOOGziI1mdhRfelG4zuT5dyivRLFwn/IWdg== 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 Cc: Ard Biesheuvel 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: [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: , X-List-Received-Date: Wed, 22 Nov 2017 10:03:39 -0000 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(+) 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 -- 2.11.0