|
TianoCore EDK2 master
|
#include <PiDxe.h>#include <Library/BaseLib.h>#include <Library/BaseMemoryLib.h>#include <Library/MemoryAllocationLib.h>#include <Library/UefiBootServicesTableLib.h>#include <Library/DxeServicesTableLib.h>#include <Library/DebugLib.h>#include <Library/UefiLib.h>#include <Library/ImagePropertiesRecordLib.h>#include <Guid/EventGroup.h>#include <Guid/MemoryAttributesTable.h>#include "DxeMain.h"#include "HeapGuard.h"Go to the source code of this file.
Data Structures | |
| struct | IMAGE_PROPERTIES_PRIVATE_DATA |
Macros | |
| #define | PREVIOUS_MEMORY_DESCRIPTOR(MemoryDescriptor, Size) ((EFI_MEMORY_DESCRIPTOR *)((UINT8 *)(MemoryDescriptor) - (Size))) |
| #define | IMAGE_PROPERTIES_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('I','P','P','D') |
Variables | |
| STATIC IMAGE_PROPERTIES_PRIVATE_DATA | mImagePropertiesPrivateData |
| STATIC EFI_LOCK | mMemoryAttributesTableLock = EFI_INITIALIZE_LOCK_VARIABLE (TPL_NOTIFY) |
| BOOLEAN | mMemoryAttributesTableEnable = TRUE |
| EFI_MEMORY_ATTRIBUTES_TABLE * | mMemoryAttributesTable = NULL |
| BOOLEAN | mMemoryAttributesTableReadyToBoot = FALSE |
| BOOLEAN | gMemoryAttributesTableForwardCfi = TRUE |
UEFI MemoryAttributesTable support
Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file MemoryAttributesTable.c.
| #define IMAGE_PROPERTIES_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('I','P','P','D') |
Definition at line 71 of file MemoryAttributesTable.c.
| #define PREVIOUS_MEMORY_DESCRIPTOR | ( | MemoryDescriptor, | |
| Size | |||
| ) | ((EFI_MEMORY_DESCRIPTOR *)((UINT8 *)(MemoryDescriptor) - (Size))) |
Definition at line 68 of file MemoryAttributesTable.c.
Acquire memory lock on mMemoryAttributesTableLock.
Definition at line 357 of file MemoryAttributesTable.c.
| EFI_STATUS EFIAPI CoreGetMemoryMapWithSeparatedImageSection | ( | IN OUT UINTN * | MemoryMapSize, |
| IN OUT EFI_MEMORY_DESCRIPTOR * | MemoryMap, | ||
| OUT UINTN * | MapKey, | ||
| OUT UINTN * | DescriptorSize, | ||
| OUT UINT32 * | DescriptorVersion | ||
| ) |
This function for GetMemoryMap() with properties table capability.
It calls original GetMemoryMap() to get the original memory map information. Then plus the additional memory map entries for PE Code/Data seperation.
| MemoryMapSize | A pointer to the size, in bytes, of the MemoryMap buffer. On input, this is the size of the buffer allocated by the caller. On output, it is the size of the buffer returned by the firmware if the buffer was large enough, or the size of the buffer needed to contain the map if the buffer was too small. |
| MemoryMap | A pointer to the buffer in which firmware places the current memory map. |
| MapKey | A pointer to the location in which firmware returns the key for the current memory map. |
| DescriptorSize | A pointer to the location in which firmware returns the size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR. |
| DescriptorVersion | A pointer to the location in which firmware returns the version number associated with the EFI_MEMORY_DESCRIPTOR. |
| EFI_SUCCESS | The memory map was returned in the MemoryMap buffer. |
| EFI_BUFFER_TOO_SMALL | The MemoryMap buffer was too small. The current buffer size needed to hold the memory map is returned in MemoryMapSize. |
| EFI_INVALID_PARAMETER | One of the parameters has an invalid value. |
Definition at line 518 of file MemoryAttributesTable.c.
Initialize MemoryAttrubutesTable support.
Definition at line 309 of file MemoryAttributesTable.c.
Release memory lock on mMemoryAttributesTableLock.
Definition at line 369 of file MemoryAttributesTable.c.
| STATIC VOID EnforceMemoryMapAttribute | ( | IN OUT EFI_MEMORY_DESCRIPTOR * | MemoryMap, |
| IN UINTN | MemoryMapSize, | ||
| IN UINTN | DescriptorSize | ||
| ) |
Enforce memory map attributes. This function will set EfiRuntimeServicesData to be EFI_MEMORY_XP.
| MemoryMap | A pointer to the buffer in which firmware places the current memory map. |
| MemoryMapSize | Size, in bytes, of the MemoryMap buffer. |
| DescriptorSize | Size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR. |
Definition at line 447 of file MemoryAttributesTable.c.
| VOID InsertImageRecord | ( | IN EFI_RUNTIME_IMAGE_ENTRY * | RuntimeImage | ) |
Insert image record.
| RuntimeImage | Runtime image information |
Definition at line 589 of file MemoryAttributesTable.c.
Install MemoryAttributesTable.
Definition at line 99 of file MemoryAttributesTable.c.
Install initial MemoryAttributesTable on EndOfDxe. Then SMM can consume this information.
| [in] | Event | The Event this notify function registered to. |
| [in] | Context | Pointer to the context data registered to the Event. |
Definition at line 287 of file MemoryAttributesTable.c.
| VOID InstallMemoryAttributesTableOnMemoryAllocation | ( | IN EFI_MEMORY_TYPE | MemoryType | ) |
Install MemoryAttributesTable on memory allocation.
| [in] | MemoryType | EFI memory type. |
Definition at line 247 of file MemoryAttributesTable.c.
Install MemoryAttributesTable on ReadyToBoot.
| [in] | Event | The Event this notify function registered to. |
| [in] | Context | Pointer to the context data registered to the Event. |
Definition at line 269 of file MemoryAttributesTable.c.
| VOID MergeMemoryMap | ( | IN OUT EFI_MEMORY_DESCRIPTOR * | MemoryMap, |
| IN OUT UINTN * | MemoryMapSize, | ||
| IN UINTN | DescriptorSize | ||
| ) |
Merge continous memory map entries whose have same attributes.
| MemoryMap | A pointer to the buffer in which firmware places the current memory map. |
| MemoryMapSize | A pointer to the size, in bytes, of the MemoryMap buffer. On input, this is the size of the current memory map. On output, it is the size of new memory map after merge. |
| DescriptorSize | Size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR. |
Definition at line 388 of file MemoryAttributesTable.c.
| VOID RemoveImageRecord | ( | IN EFI_RUNTIME_IMAGE_ENTRY * | RuntimeImage | ) |
Remove Image record.
| RuntimeImage | Runtime image information |
Definition at line 673 of file MemoryAttributesTable.c.
| BOOLEAN gMemoryAttributesTableForwardCfi = TRUE |
Definition at line 92 of file MemoryAttributesTable.c.
| STATIC IMAGE_PROPERTIES_PRIVATE_DATA mImagePropertiesPrivateData |
Definition at line 80 of file MemoryAttributesTable.c.
| EFI_MEMORY_ATTRIBUTES_TABLE* mMemoryAttributesTable = NULL |
Definition at line 90 of file MemoryAttributesTable.c.
| BOOLEAN mMemoryAttributesTableEnable = TRUE |
Definition at line 89 of file MemoryAttributesTable.c.
| STATIC EFI_LOCK mMemoryAttributesTableLock = EFI_INITIALIZE_LOCK_VARIABLE (TPL_NOTIFY) |
Definition at line 87 of file MemoryAttributesTable.c.
| BOOLEAN mMemoryAttributesTableReadyToBoot = FALSE |
Definition at line 91 of file MemoryAttributesTable.c.