TianoCore EDK2 master
Loading...
Searching...
No Matches
CpuMmuInit.c File Reference

Go to the source code of this file.

Macros

#define DEFAULT_BIT_WIDTH_PER_LEVEL   (EFI_PAGE_SHIFT - 3)
 

Functions

STATIC UINT8 DecidePageWalkConfiguration (IN OUT UINT64 *PageWalkCfg OPTIONAL, IN UINT8 BitWidth)
 
EFI_STATUS EFIAPI ConfigureMemoryManagementUnit (IN EFI_MEMORY_DESCRIPTOR *MemoryTable)
 

Detailed Description

CPU Memory Map Unit Initialization library instance.

Copyright (c) 2024 Loongson Technology Corporation Limited. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file CpuMmuInit.c.

Macro Definition Documentation

◆ DEFAULT_BIT_WIDTH_PER_LEVEL

#define DEFAULT_BIT_WIDTH_PER_LEVEL   (EFI_PAGE_SHIFT - 3)

Definition at line 30 of file CpuMmuInit.c.

Function Documentation

◆ ConfigureMemoryManagementUnit()

EFI_STATUS EFIAPI ConfigureMemoryManagementUnit ( IN EFI_MEMORY_DESCRIPTOR MemoryTable)

Create a page table and initialize the memory management unit(MMU).

Parameters
[in]MemoryTableA pointer to a memory ragion table.
Return values
EFI_SUCCESSConfigure MMU successfully. EFI_INVALID_PARAMETER MemoryTable is NULL. EFI_UNSUPPORTED MemoryRegionMap failed or out of memory space or size not aligned or MaxLivel out of bound.

Definition at line 121 of file CpuMmuInit.c.

◆ DecidePageWalkConfiguration()

STATIC UINT8 DecidePageWalkConfiguration ( IN OUT UINT64 *PageWalkCfg  OPTIONAL,
IN UINT8  BitWidth 
)

Decided page walker width, level.

Parameters
[in,out]PageWalkCfgPage walker value instance.
[in]BitWidtThe bit width what you want, 0 is means use the default bit width.
Return values
PageTableLevelNumThe max page table level.

Definition at line 42 of file CpuMmuInit.c.