TianoCore EDK2 master
Loading...
Searching...
No Matches
MemDetect.c File Reference
#include <IndustryStandard/E820.h>
#include <IndustryStandard/Q35MchIch9.h>
#include <PiPei.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/HobLib.h>
#include <Library/IoLib.h>
#include <Library/PcdLib.h>
#include <Library/PciLib.h>
#include <Library/PeimEntryPoint.h>
#include <Library/ResourcePublicationLib.h>
#include <Library/MtrrLib.h>
#include "Platform.h"
#include "Cmos.h"

Go to the source code of this file.

Functions

VOID Q35TsegMbytesInitialization (VOID)
 
UINT32 GetSystemMemorySizeBelow4gb (VOID)
 
STATIC UINT64 GetSystemMemorySizeAbove4gb ()
 
STATIC UINT64 GetFirstNonAddress (VOID)
 
VOID AddressWidthInitialization (VOID)
 
STATIC UINT32 GetPeiMemoryCap (VOID)
 
EFI_STATUS PublishPeiMemory (VOID)
 
STATIC VOID QemuInitializeRam (VOID)
 
VOID InitializeRamRegions (VOID)
 

Variables

UINT8 mPhysMemAddressWidth
 
STATIC UINT32 mS3AcpiReservedMemoryBase
 
STATIC UINT32 mS3AcpiReservedMemorySize
 
STATIC UINT16 mQ35TsegMbytes
 
BOOLEAN mQ35SmramAtDefaultSmbase = FALSE
 

Detailed Description

Memory Detection for Virtual Machines.

Copyright (c) 2020, Rebecca Cran rebec.nosp@m.ca@b.nosp@m.sdio..nosp@m.com Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.

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

Module Name:

MemDetect.c

Definition in file MemDetect.c.

Function Documentation

◆ AddressWidthInitialization()

VOID AddressWidthInitialization ( VOID  )

Initialize the mPhysMemAddressWidth variable, based on guest RAM size.

Definition at line 248 of file MemDetect.c.

◆ GetFirstNonAddress()

STATIC UINT64 GetFirstNonAddress ( VOID  )

Return the highest address that DXE could possibly use, plus one.

Definition at line 155 of file MemDetect.c.

◆ GetPeiMemoryCap()

STATIC UINT32 GetPeiMemoryCap ( VOID  )

Calculate the cap for the permanent PEI memory.

Definition at line 289 of file MemDetect.c.

◆ GetSystemMemorySizeAbove4gb()

STATIC UINT64 GetSystemMemorySizeAbove4gb ( )

Definition at line 128 of file MemDetect.c.

◆ GetSystemMemorySizeBelow4gb()

UINT32 GetSystemMemorySizeBelow4gb ( VOID  )

Definition at line 104 of file MemDetect.c.

◆ InitializeRamRegions()

VOID InitializeRamRegions ( VOID  )

Publish system RAM and reserve memory regions

Definition at line 556 of file MemDetect.c.

◆ PublishPeiMemory()

EFI_STATUS PublishPeiMemory ( VOID  )

Publish PEI core memory

Returns
EFI_SUCCESS The PEIM initialized successfully.

Definition at line 356 of file MemDetect.c.

◆ Q35TsegMbytesInitialization()

VOID Q35TsegMbytesInitialization ( VOID  )

Definition at line 49 of file MemDetect.c.

◆ QemuInitializeRam()

STATIC VOID QemuInitializeRam ( VOID  )

Peform Memory Detection for QEMU / KVM

Definition at line 435 of file MemDetect.c.

Variable Documentation

◆ mPhysMemAddressWidth

UINT8 mPhysMemAddressWidth

Definition at line 39 of file MemDetect.c.

◆ mQ35SmramAtDefaultSmbase

BOOLEAN mQ35SmramAtDefaultSmbase = FALSE

Definition at line 46 of file MemDetect.c.

◆ mQ35TsegMbytes

STATIC UINT16 mQ35TsegMbytes

Definition at line 44 of file MemDetect.c.

◆ mS3AcpiReservedMemoryBase

STATIC UINT32 mS3AcpiReservedMemoryBase

Definition at line 41 of file MemDetect.c.

◆ mS3AcpiReservedMemorySize

STATIC UINT32 mS3AcpiReservedMemorySize

Definition at line 42 of file MemDetect.c.