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 E0C30940FC7 for ; Mon, 25 Mar 2024 02:29:59 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=+ZoZeKXRzl/u96iVmtyv5S8PQbkFOJKfKUYfFLWEXAc=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type; s=20240206; t=1711333798; v=1; b=vhktvFdaBfSC/5TZouhDbHlaJ6g5rp87Nze/Vz7LPcl951TdTAELStjza49XNVQQHfWk8uzZ 6rZBZf4Yd4S16R3oq8h/BP6DaXy4xi0u3TUyuUDZ0wXmovMbtHQ9mD1z2GZT9NRZaiPcaySAagB 7zmp55ya1/yOLA0hGJAFaVQ6KGXBPKl4YDs/AfhyUbmmOX+PANdDhawONqBHAISnqN7aT879NeQ Tsq7cVuZ3i2IXtpWNmSbUeRb3P8U+s0wPOB3Uo62v8o5fH56XeZL3CSPrlPOVyk3NEqKVonN5r6 PZFSFlCWfaAHbwpvd31CnoIxOGF+kCNjAcLVV7eMKF9iQ== X-Received: by 127.0.0.2 with SMTP id D3IqYY7687511xP3CnSBneM3; Sun, 24 Mar 2024 19:29:58 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) by mx.groups.io with SMTP id smtpd.web11.43418.1711333797724206193 for ; Sun, 24 Mar 2024 19:29:57 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,11023"; a="9273208" X-IronPort-AV: E=Sophos;i="6.07,152,1708416000"; d="scan'208,217";a="9273208" X-Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2024 19:29:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,152,1708416000"; d="scan'208,217";a="15551357" X-Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmviesa008.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 24 Mar 2024 19:29:39 -0700 X-Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Sun, 24 Mar 2024 19:29:39 -0700 X-Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Sun, 24 Mar 2024 19:29:39 -0700 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Sun, 24 Mar 2024 19:29:38 -0700 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by IA0PR11MB7693.namprd11.prod.outlook.com (2603:10b6:208:401::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.31; Mon, 25 Mar 2024 02:29:36 +0000 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::2c31:82b7:9f26:5817]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::2c31:82b7:9f26:5817%5]) with mapi id 15.20.7409.028; Mon, 25 Mar 2024 02:29:36 +0000 From: "Ni, Ray" To: Chao Li , "devel@edk2.groups.io" , Ard Biesheuvel CC: "Kumar, Rahul R" , Gerd Hoffmann , Leif Lindholm , Sami Mujawar , Sunil V L , "Warkentin, Andrei" Subject: Re: [edk2-devel] [PATCH v2 07/13] UefiCpuPkg: Add CpuMmuLib.h to UefiCpuPkg Thread-Topic: [PATCH v2 07/13] UefiCpuPkg: Add CpuMmuLib.h to UefiCpuPkg Thread-Index: AQHaeqKwCaJbYZZ8mEy2XpK3sTNxXLFHwNv9 Date: Mon, 25 Mar 2024 02:29:36 +0000 Message-ID: References: <20240320084152.268323-1-lichao@loongson.cn> <20240320084319.276603-1-lichao@loongson.cn> In-Reply-To: <20240320084319.276603-1-lichao@loongson.cn> Accept-Language: en-US X-Mentions: ardb+tianocore@kernel.org X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|IA0PR11MB7693:EE_ x-ms-office365-filtering-correlation-id: 51e46d0f-f7d9-4290-c4cf-08dc4c736a41 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: i7RfR4kw2wX3BRnehNcUZ4xTjeUSqVFbVHevoaWSDUGZPHcCTor9PsBi5czLbD/PtKMW5moCpeMPp1CSNqwy1tWCfDIURrRuEluov4T0N8gmGBf2OLPQvicueZXWj2kT1ZRGwABb0Ayh1cM+LrNJbP/Jgq/30q1odOaEGudf8yxAp13ofyJ6iS5Q6XwJAJSroiC5B7dg3r7I0sRHF1rLhXL0d/MOEdY8M5C/NEOvJOOa3T25I/kEGcq3T+PpWSLmh9xUAa9zmSTMyqPrwHge3CC9AkS9+BCGokOZGbVby5f+rIw8ikrC+x2mn3CtNTD87E9XuqVSZwkYZFpSFiZj3aMl+/ja5qSvRSXZ4IOVlaV2n6DsWe+gNsw0QflKfIFddCv1/asNZ2Y8WUK6GKExxqMQwDM/bTbiD1eV01mwdVL8bb7EJntpPfCHNfIhcL4ls4vM/NjYmRsY+aAw0VpMNRAuzBF5EANeXoxm5t1Qj+yIb9yzeSBasxHaHnfzVw5c8x8BcJY1/u+BCWHiBSISEIJhwKkAkIStL6f+ULids2qqTyH8uetV3m3SSPSzdE3yojJ7fA+w7YDfSI9TUsy+uN0Uf/h9xHtNLb9rrrFMcqGdiVG1mZ+EmTGuHAPUWd2SjRrNM3337KshhOQRd96dDwpEppdVCy4DJdtcawNaIB4= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?tf0JsNOWcnNn5CkvlxxOja24WcrtaswrdPykReQQ59u09mJ0nxR+prTVbEnV?= =?us-ascii?Q?0Nnhuvu94BeNnDRX76kGwveH2oEmNI980B71/cgA8FRXCoRGxpvwHy36rQQF?= =?us-ascii?Q?8w5UqH8UBywU0xvMegiF8dvGD9vuf735rbCSmfZxLt27okb1EXhU7H0WOtaY?= =?us-ascii?Q?tFRs68cKe6RxUm12EkD9nndPHERwDGRWc7xbo025MgTFOin7xchgo4P2qrir?= =?us-ascii?Q?zwXjpiinrfImBPZhYhwf8YzvBOqKEz8XvcmlN17mnd6dZyBe2cNWmcm61OFP?= =?us-ascii?Q?nXiwxr8H5mOmE0N8odqHG6iX03sqRXrGiiqe+bN5YhqycM9JNG6vjX+k9Gs/?= =?us-ascii?Q?wAxHMfSCNhySHD6k49ZnGAJLCVz7UU7rjGcF1Lz7QW3i3DVWhVCjtgiitXXh?= =?us-ascii?Q?EeCwfJ83Cc4xP421uKy0waaPlyPxk53x7p94whxKuaLUCjuftauvgcwF5Ouo?= =?us-ascii?Q?at/pF9yk6gAWgpIGSmxe/unfNesBErOg8NnvcgHPjZq8HG0SY4WR9uJh54+h?= =?us-ascii?Q?U2RbK4lvYQ1Bs9vOX4wWsXCELb5xjL7Am5MG9TejRcImdCvghYY4qjYY/cXn?= =?us-ascii?Q?rGoDjJBpJkg+1fMOSYLLc9+cWas4UT1dwQya99cNwAC1l37KyB4m322EUur4?= =?us-ascii?Q?Vw4tIBXFD/xYplYoiP07q1G1CepUmyO6jtNi2gQ/Hlz4KAhuGhW87lhpCagv?= =?us-ascii?Q?dTa+jysKAXT9f/3mzRxbcvMD03kIYhIilL351diS7PNQlA8KZIEA95Yiq57C?= =?us-ascii?Q?mnzz8N2/Y3ZiCAuR4puzi6Qq1xzvq899gPdNmXUC6ETFp5UQ0lJxGYh/heFX?= =?us-ascii?Q?v7Ac3xGMjZdC/RYlETwWzpnkCEPXnW0DjSSWmj++JysAJsE0613SF0X9SESE?= =?us-ascii?Q?vjzhp6lC8fXvccnpqfxZ0aNDeOqkf5fijaFBkklwJ1jYlWBc0PPNR00gStHS?= =?us-ascii?Q?IUihz8XV/8fQ41AD5owWDzHm6YRfn7PGmCZcf2ziN1ULK7QdXq2zxo2GNmPT?= =?us-ascii?Q?PRnmX6IFOciBLAtaeMo98rJRT4CCed22rvA29FoB95cm7vSVY+vXr3aVr/pQ?= =?us-ascii?Q?3QkA6bkZzyAOckswrGICMGlUIbi6eHoJfkX1KmqnVfRlX0o+6E6/BCmFZhcr?= =?us-ascii?Q?9lQW4ZdjjX1OkajB9uH/gPnXbJQ/ZPlyheGn0X51wy0DYtuMajym/Rna/bmI?= =?us-ascii?Q?TajWG+UPrgHHLqJBOXhT6pxplJNLxVXyFM8OwGjlsuYQztz/ANyPi7cmFFXl?= =?us-ascii?Q?K82GWDW6v/vX/lorgkFCd8OHkkQIaiWyoHbnX+P9J008GkVXU94Wquw9ogO4?= =?us-ascii?Q?XUlf44f9jXcwhthFnymc5KR0ydc85p3dXYSGXN4sJJDgxoFft9CGDFEu+4ng?= =?us-ascii?Q?EhinN1vVtrB5WK6Med27Ge5BVE/x8GNIjVatVydkj6JUzu+lLhy6Q810/sEF?= =?us-ascii?Q?V9+qoqKsTSKyEjN4aO2b4oFUu/4QbJbwnZiilHEURgM5zo6a2x0l14wN+upU?= =?us-ascii?Q?w+Qj+AULJoE56t0pLfYnvzyPQ97fwDkDKQ3PxEdgQHKrLsN9ybP/H3U9R85u?= =?us-ascii?Q?3DuG+woikcIIOEkgA00=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51e46d0f-f7d9-4290-c4cf-08dc4c736a41 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Mar 2024 02:29:36.7108 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: hiXa+v+FBO1VX+7kdiH/xDyGQQ0K+j9OlyG1qDAl13TcboBrN7WnUpRFQlJig3veq98gi2jztcRY3VMIPDFf7w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR11MB7693 X-OriginatorOrg: intel.com 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 Resent-Date: Sun, 24 Mar 2024 19:29:57 -0700 Reply-To: devel@edk2.groups.io,ray.ni@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: jOjVio4apMAy9RZN5UjPd5cSx7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MN6PR11MB8244CF91FF08CA66533ABD678C362MN6PR11MB8244namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=vhktvFda; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=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 --_000_MN6PR11MB8244CF91FF08CA66533ABD678C362MN6PR11MB8244namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 2 comments: 1. Atrributes is type of UINTN but Mask is type of UINT64. Should they follow = the same UINT64 type? 2. The header file does not define the meaning of each bit. As a reference, Md= eModulePkg/Include/Ppi/MemoryAttribute.h defines 3 bits can be used for mem= ory permission setting. @Ard Biesheuvel, Do you think that MdeModulePkg/Include/Ppi/MemoryAttribute.h misses a capab= ility to return the attributes of a given range of memory address? For your reference, Chao defined a lib API as below to serve the same reque= st: /** Finds the first of the length and memory properties of the memory region = corresponding to the specified base address. @param[in] BaseAddress To find the base address of the memory= region. @param[in, out] RegionLength Pointer holding: - At entry, the length of the memory = region expected to be found. - At exit, the length of the memory r= egion found. @param[out] RegionAttributes Properties of the memory region found. @retval EFI_SUCCESS The corresponding memory area was successfully fo= und EFI_NOT_FOUND No memory area found **/ EFI_STATUS EFIAPI GetMemoryRegionAttributes ( IN UINTN BaseAddress, IN OUT UINTN *RegionLength, OUT UINTN *RegionAttributes ); I hope we can align the lib API and PPI definition to one so that the lib A= PI can be dropped in future (not in this round of patch). Thanks, Ray ________________________________ From: Chao Li Sent: Wednesday, March 20, 2024 16:43 To: devel@edk2.groups.io Cc: Ni, Ray ; Kumar, Rahul R ; G= erd Hoffmann ; Leif Lindholm = ; Ard Biesheuvel ; Sami Mujawar ; Sunil V L ; Warkentin, Andrei Subject: [PATCH v2 07/13] UefiCpuPkg: Add CpuMmuLib.h to UefiCpuPkg Add a new header file CpuMmuLib.h, whitch is referenced from ArmPkg/Include/Library/ArmMmuLib.h. Currently, only support for LoongArch64 is added, and more architectures can be accommodated in the future. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4734 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 Acked-by: Gerd Hoffmann --- UefiCpuPkg/Include/Library/CpuMmuLib.h | 55 ++++++++++++++++++++++++++ UefiCpuPkg/UefiCpuPkg.dec | 4 ++ 2 files changed, 59 insertions(+) create mode 100644 UefiCpuPkg/Include/Library/CpuMmuLib.h diff --git a/UefiCpuPkg/Include/Library/CpuMmuLib.h b/UefiCpuPkg/Include/Li= brary/CpuMmuLib.h new file mode 100644 index 0000000000..26d2d65524 --- /dev/null +++ b/UefiCpuPkg/Include/Library/CpuMmuLib.h @@ -0,0 +1,33 @@ +/** @file + + Copyright (c) 2024 Loongson Technology Corporation Limited. All rights r= eserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef CPU_MMU_LIB_H_ +#define CPU_MMU_LIB_H_ + +#include + +/** + Sets the Attributes of the specified memory region. + + @param[in] BaseAddress The base address of the memory region to set = the Attributes. + @param[in] Length The length of the memory region to set the At= tributes. + @param[in] Attributes The Attributes to be set. + @param[in] AttributeMask Mask of memory attributes to take into accoun= t. + + @retval EFI_SUCCESS The Attributes was set successfully +**/ +EFI_STATUS +EFIAPI +SetMemoryRegionAttributes ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINTN Length, + IN UINTN Attributes, + IN UINT64 AttributeMask + ); + +#endif // CPU_MMU_LIB_H_ diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec index 571b59b36f..ca744fab55 100644 --- a/UefiCpuPkg/UefiCpuPkg.dec +++ b/UefiCpuPkg/UefiCpuPkg.dec @@ -72,6 +72,10 @@ [LibraryClasses.RISCV64] ## RiscVMmuLib|Include/Library/BaseRiscVMmuLib.h +[LibraryClasses.LoongArch64] + ## @libraryclass Provides functions for the memory management unit. + CpuMmuLib|Include/Library/CpuMmuLib.h + [Guids] gUefiCpuPkgTokenSpaceGuid =3D { 0xac05bf33, 0x995a, 0x4ed4, { 0xaa,= 0xb8, 0xef, 0x7a, 0xe8, 0xf, 0x5c, 0xb0 }} gMsegSmramGuid =3D { 0x5802bce4, 0xeeee, 0x4e33, { 0xa1,= 0x30, 0xeb, 0xad, 0x27, 0xf0, 0xe4, 0x39 }} -- 2.27.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117074): https://edk2.groups.io/g/devel/message/117074 Mute This Topic: https://groups.io/mt/105041094/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --_000_MN6PR11MB8244CF91FF08CA66533ABD678C362MN6PR11MB8244namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
2 comments:
  1. Atrributes is type of UINTN but Mask is type of UINT64. Should they follow = the same UINT64 type?
  2. The header file does not define the meanin= g of each bit. As a reference, MdeModulePkg/Include/Ppi/MemoryAttribute.h defines 3 bits can be used for memory permission setti= ng.


Do you think that MdeModulePkg/Include/Ppi/MemoryAttribute.h misses a capab= ility to return the attributes of a given range of memory address?
For your reference, Chao defined a lib API as below to serve the same reque= st:
/**
  Finds the first of the length and memory properties of the memory re= gion corresponding
  to the specified base address.
  @param[in]       BaseAddress       To = find the base address of the memory region.
  @param[in, out]  RegionLength      Pointer holdi= ng:
                     = ;                 - At entry, the l= ength of the memory region
                     = ;                   expected t= o be found.
                     = ;                 - At exit, the le= ngth of the memory region found.
  @param[out]      RegionAttributes  Properties of= the memory region found.
  @retval  EFI_SUCCESS    The corresponding memory area= was successfully found
           EFI_NOT_FOUND    No memo= ry area found
**/
EFI_STATUS
EFIAPI
GetMemoryRegionAttributes (
  IN     UINTN  BaseAddress,
  IN OUT UINTN  *RegionLength,
  OUT    UINTN  *RegionAttributes
  );

I hope we can align the lib API and PPI definition to one so that the lib A= PI can be dropped in future (not in this round of patch).

Thanks,
Ray

From: Chao Li <lichao@lo= ongson.cn>
Sent: Wednesday, March 20, 2024 16:43
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R <rahul.r.kum= ar@intel.com>; Gerd Hoffmann <kraxel@redhat.com>; Leif Lindholm &l= t;quic_llindhol@quicinc.com>; Ard Biesheuvel <ardb+tianocore@kernel.o= rg>; Sami Mujawar <sami.mujawar@arm.com>; Sunil V L <sunilvl@ve= ntanamicro.com>; Warkentin, Andrei <andrei.warkentin@intel.com>
Subject: [PATCH v2 07/13] UefiCpuPkg: Add CpuMmuLib.h to UefiCpuPkg<= /font>
 
Add a new header file CpuMmuLib.h, whitch is refer= enced from
ArmPkg/Include/Library/ArmMmuLib.h. Currently, only support for
LoongArch64 is added, and more architectures can be accommodated in the
future.

BZ: https= ://bugzilla.tianocore.org/show_bug.cgi?id=3D4734

Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Andrei Warkentin <andrei.warkentin@intel.com>
Signed-off-by: Chao Li <lichao@loongson.cn>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
---
 UefiCpuPkg/Include/Library/CpuMmuLib.h | 55 +++++++++++++++++++++++++= +
 UefiCpuPkg/UefiCpuPkg.dec       &n= bsp;      |  4 ++
 2 files changed, 59 insertions(+)
 create mode 100644 UefiCpuPkg/Include/Library/CpuMmuLib.h

diff --git a/UefiCpuPkg/Include/Library/CpuMmuLib.h b/UefiCpuPkg/Include/Li= brary/CpuMmuLib.h
new file mode 100644
index 0000000000..26d2d65524
--- /dev/null
+++ b/UefiCpuPkg/Include/Library/CpuMmuLib.h
@@ -0,0 +1,33 @@
+/** @file
+
+  Copyright (c) 2024 Loongson Technology Corporation Limited. All rig= hts reserved.<BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef CPU_MMU_LIB_H_
+#define CPU_MMU_LIB_H_
+
+#include <Uefi/UefiBaseType.h>
+
+/**
+  Sets the Attributes  of the specified memory region.
+
+  @param[in]  BaseAddress    The base address of = the memory region to set the Attributes.
+  @param[in]  Length       &n= bsp; The length of the memory region to set the Attributes.
+  @param[in]  Attributes     The Attributes = to be set.
+  @param[in]  AttributeMask  Mask of memory attributes to t= ake into account.
+
+  @retval  EFI_SUCCESS    The Attributes was set = successfully
+**/
+EFI_STATUS
+EFIAPI
+SetMemoryRegionAttributes (
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,
+  IN UINTN          = ;       Length,
+  IN UINTN          = ;       Attributes,
+  IN UINT64         &nbs= p;      AttributeMask
+  );
+
+#endif // CPU_MMU_LIB_H_
diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec
index 571b59b36f..ca744fab55 100644
--- a/UefiCpuPkg/UefiCpuPkg.dec
+++ b/UefiCpuPkg/UefiCpuPkg.dec
@@ -72,6 +72,10 @@ [LibraryClasses.RISCV64]
   ##
   RiscVMmuLib|Include/Library/BaseRiscVMmuLib.h
 
+[LibraryClasses.LoongArch64]
+  ##  @libraryclass  Provides functions for the memory mana= gement unit.
+  CpuMmuLib|Include/Library/CpuMmuLib.h
+
 [Guids]
   gUefiCpuPkgTokenSpaceGuid      =3D { = 0xac05bf33, 0x995a, 0x4ed4, { 0xaa, 0xb8, 0xef, 0x7a, 0xe8, 0xf, 0x5c, 0xb0= }}
   gMsegSmramGuid        =          =3D { 0x5802bce4, 0xeeee, = 0x4e33, { 0xa1, 0x30, 0xeb, 0xad, 0x27, 0xf0, 0xe4, 0x39 }}
--
2.27.0

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#117074) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_MN6PR11MB8244CF91FF08CA66533ABD678C362MN6PR11MB8244namp_--