From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id B8D137803DB for ; Mon, 11 Mar 2024 09:38:35 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=pcTQnrXne/m32goktdLMiDxa/VpgY7q6nj+QNccZIGM=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1710149914; v=1; b=QZA89mSU2ORn6f8+ByHMz/3SgG6QHsSvwESIWgKOxe08arsPZ/4rKY+Dot7pM1WYgW4r84No fD4Ti9L5TGnHP5FqQiGivg2p89+gItGTXrx6xY7b4ppo+4fLcrN6TPpPcDBr4PSS+hpiu+CWKbr fTaY0hJgXwFYXw/+6BGstFFAQm6IJZ5LYwop7BjlhmCB2mCWTe0RKYgHv2bcfVfrt6gh/EckY/V C2Wnjq0oRXy5R3R1ZoViqPIIviEb0Rloz3cQGKPEV0rmD2kBhT7A+6hxovPck32Sn6kV1XnsUHw xwxxzW+ubxOlz+zdR6LRfZSDBP/U6+DTIJW9bsgb0F/yA== X-Received: by 127.0.0.2 with SMTP id xhocYY7687511xKCou28y8Kp; Mon, 11 Mar 2024 02:38:34 -0700 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web10.58519.1710149912917582086 for ; Mon, 11 Mar 2024 02:38:33 -0700 X-Received: from loongson.cn (unknown [10.2.9.245]) by gateway (Coremail) with SMTP id _____8DxJ+gW0e5llhoXAA--.36972S3; Mon, 11 Mar 2024 17:38:30 +0800 (CST) X-Received: from code-server.gen (unknown [10.2.9.245]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxTRMV0e5l7CRWAA--.30447S2; Mon, 11 Mar 2024 17:38:29 +0800 (CST) From: "Chao Li" To: devel@edk2.groups.io Cc: Ray Ni , Rahul Kumar , Gerd Hoffmann , Leif Lindholm , Ard Biesheuvel , Sami Mujawar , Sunil V L , Andrei Warkentin Subject: [edk2-devel] [PATCH v1 11/26] UefiCpuPkg: Add CpuMmuInitLib.h to UefiCpuPkg Date: Mon, 11 Mar 2024 02:38:34 -0700 Message-Id: <20240311093828.1253895-1-lichao@loongson.cn> In-Reply-To: <20240311093631.1251466-1-lichao@loongson.cn> References: <20240311093631.1251466-1-lichao@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8AxTRMV0e5l7CRWAA--.30447S2 X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQANCGXuwOYA3wARsn X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lichao@loongson.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: JfxhLQIZlk46uQ8xIL81tPGTx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=QZA89mSU; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io This file provide the CPU MMU configure and initialize interface, it will consumes by CpuMmuLib to configure or initialize the MMU. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584 Cc: Ray Ni Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Sami Mujawar Cc: Sunil V L Cc: Andrei Warkentin Signed-off-by: Chao Li --- UefiCpuPkg/Include/Library/CpuMmuInitLib.h | 34 ++++++++++++++++++++++ UefiCpuPkg/UefiCpuPkg.dec | 3 ++ 2 files changed, 37 insertions(+) create mode 100644 UefiCpuPkg/Include/Library/CpuMmuInitLib.h diff --git a/UefiCpuPkg/Include/Library/CpuMmuInitLib.h b/UefiCpuPkg/Include/Library/CpuMmuInitLib.h new file mode 100644 index 0000000000..848050d056 --- /dev/null +++ b/UefiCpuPkg/Include/Library/CpuMmuInitLib.h @@ -0,0 +1,34 @@ +/** @file + + Copyright (c) 2024 Loongson Technology Corporation Limited. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef CPU_MMU_INIT_LIB_H_ +#define CPU_MMU_INIT_LIB_H_ + +#include +#include + +/** + Create a page table and initialize the memory management unit(MMU). + + @param[in] MemoryTable A pointer to a memory ragion table. + @param[out] TranslationTableBase A pointer to a translation table base address. + @param[out] TranslationTableSize A pointer to a translation table base size. + + @retval EFI_SUCCESS Configure MMU successfully. + EFI_INVALID_PARAMETER MemoryTable is NULL. + EFI_UNSUPPORTED Out of memory space or size not aligned. +**/ +EFI_STATUS +EFIAPI +ConfigureMemoryManagementUnit ( + IN EFI_MEMORY_DESCRIPTOR *MemoryTable, + OUT VOID **TranslationTableBase OPTIONAL, + OUT UINTN *TranslationTableSize OPTIONAL + ); + +#endif // CPU_MMU_INIT_LIB_H_ diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec index b27cf88aee..ff5ef5bb00 100644 --- a/UefiCpuPkg/UefiCpuPkg.dec +++ b/UefiCpuPkg/UefiCpuPkg.dec @@ -77,6 +77,9 @@ [LibraryClasses.LoongArch64] ## @libraryclass Provides functions for the memory management unit. CpuMmuLib|Include/Library/CpuMmuLib.h + ## @libraryclass Provides functions for Initialize the memory management unit. + CpuMmuInitLib|Include/Library/CpuMmuInitLib.h + [Guids] gUefiCpuPkgTokenSpaceGuid = { 0xac05bf33, 0x995a, 0x4ed4, { 0xaa, 0xb8, 0xef, 0x7a, 0xe8, 0xf, 0x5c, 0xb0 }} gMsegSmramGuid = { 0x5802bce4, 0xeeee, 0x4e33, { 0xa1, 0x30, 0xeb, 0xad, 0x27, 0xf0, 0xe4, 0x39 }} -- 2.27.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116594): https://edk2.groups.io/g/devel/message/116594 Mute This Topic: https://groups.io/mt/104859882/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-