UefiCpuPkg: Add CpuMmuLib to UefiCpuPkg
Add a new base library named CpuMmuLib and add a LoongArch64 instance with in the library. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4734 Cc: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Chao Li <lichao@loongson.cn> Co-authored-by: Baoqi Zhang <zhangbaoqi@loongson.cn> Co-authored-by: Dongyan Qian <qiandongyan@loongson.cn> Co-authored-by: Xianglai Li <lixianglai@loongson.cn> Co-authored-by: Bibo Mao <maobibo@loongson.cn> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
33
UefiCpuPkg/Library/CpuMmuLib/LoongArch64/Page.h
Normal file
33
UefiCpuPkg/Library/CpuMmuLib/LoongArch64/Page.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2024 Loongson Technology Corporation Limited. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#ifndef PAGE_H_
|
||||
#define PAGE_H_
|
||||
|
||||
#define INVALID_PAGE 0
|
||||
|
||||
#define LEVEL5 5
|
||||
#define LEVEL4 4
|
||||
#define LEVEL3 3
|
||||
#define LEVEL2 2
|
||||
#define LEVEL1 1
|
||||
|
||||
#define PTE_ATTRIBUTES_MASK 0x600000000000007EULL
|
||||
|
||||
#define PTE_PPN_MASK 0xFFFFFFFFF000ULL
|
||||
#define PTE_PPN_SHIFT EFI_PAGE_SHIFT
|
||||
#define LOONGARCH_MMU_PAGE_SHIFT EFI_PAGE_SHIFT
|
||||
|
||||
//
|
||||
// For coding convenience, define the maximum valid
|
||||
// LoongArch exception.
|
||||
// Since UEFI V2.11, it will be present in DebugSupport.h.
|
||||
//
|
||||
#define MAX_LOONGARCH_EXCEPTION 64
|
||||
|
||||
#endif // PAGE_H_
|
Reference in New Issue
Block a user