TianoCore EDK2 master
|
Go to the source code of this file.
Data Structures | |
union | IA32_MAP_ATTRIBUTE |
struct | IA32_MAP_ENTRY |
Macros | |
#define | IA32_MAP_ATTRIBUTE_PAGE_TABLE_BASE_ADDRESS_MASK 0xFFFFFFFFFF000ull |
#define | IA32_MAP_ATTRIBUTE_PAGE_TABLE_BASE_ADDRESS(pa) ((pa)->Uint64 & IA32_MAP_ATTRIBUTE_PAGE_TABLE_BASE_ADDRESS_MASK) |
#define | IA32_MAP_ATTRIBUTE_ATTRIBUTES(pa) ((pa)->Uint64 & ~IA32_MAP_ATTRIBUTE_PAGE_TABLE_BASE_ADDRESS_MASK) |
Functions | |
RETURN_STATUS EFIAPI | PageTableMap (IN OUT UINTN *PageTable OPTIONAL, IN PAGING_MODE PagingMode, IN VOID *Buffer, IN OUT UINTN *BufferSize, IN UINT64 LinearAddress, IN UINT64 Length, IN IA32_MAP_ATTRIBUTE *Attribute, IN IA32_MAP_ATTRIBUTE *Mask, OUT BOOLEAN *IsModified OPTIONAL) |
RETURN_STATUS EFIAPI | PageTableParse (IN UINTN PageTable, IN PAGING_MODE PagingMode, IN IA32_MAP_ENTRY *Map, IN OUT UINTN *MapCount) |
Public include file for PageTableLib library.
Copyright (c) 2022 - 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file CpuPageTableLib.h.
#define IA32_MAP_ATTRIBUTE_ATTRIBUTES | ( | pa | ) | ((pa)->Uint64 & ~IA32_MAP_ATTRIBUTE_PAGE_TABLE_BASE_ADDRESS_MASK) |
Definition at line 36 of file CpuPageTableLib.h.
#define IA32_MAP_ATTRIBUTE_PAGE_TABLE_BASE_ADDRESS | ( | pa | ) | ((pa)->Uint64 & IA32_MAP_ATTRIBUTE_PAGE_TABLE_BASE_ADDRESS_MASK) |
Definition at line 35 of file CpuPageTableLib.h.
#define IA32_MAP_ATTRIBUTE_PAGE_TABLE_BASE_ADDRESS_MASK 0xFFFFFFFFFF000ull |
Definition at line 34 of file CpuPageTableLib.h.
enum PAGING_MODE |
Definition at line 42 of file CpuPageTableLib.h.
RETURN_STATUS EFIAPI PageTableMap | ( | IN OUT UINTN *PageTable | OPTIONAL, |
IN PAGING_MODE | PagingMode, | ||
IN VOID * | Buffer, | ||
IN OUT UINTN * | BufferSize, | ||
IN UINT64 | LinearAddress, | ||
IN UINT64 | Length, | ||
IN IA32_MAP_ATTRIBUTE * | Attribute, | ||
IN IA32_MAP_ATTRIBUTE * | Mask, | ||
OUT BOOLEAN *IsModified | OPTIONAL | ||
) |
Create or update page table to map [LinearAddress, LinearAddress + Length) with specified attribute.
[in,out] | PageTable | The pointer to the page table to update, or pointer to NULL if a new page table is to be created. If not pointer to NULL, the value it points to won't be changed in this function. |
[in] | PagingMode | The paging mode. |
[in] | Buffer | The free buffer to be used for page table creation/updating. |
[in,out] | BufferSize | The buffer size. On return, the remaining buffer size. The free buffer is used from the end so caller can supply the same Buffer pointer with an updated BufferSize in the second call to this API. |
[in] | LinearAddress | The start of the linear address range. |
[in] | Length | The length of the linear address range. |
[in] | Attribute | The attribute of the linear address range. All non-reserved fields in IA32_MAP_ATTRIBUTE are supported to set in the page table. Page table entries that map the linear address range are reset to 0 before set to the new attribute when a new physical base address is set. |
[in] | Mask | The mask used for attribute. The corresponding field in Attribute is ignored if that in Mask is 0. |
[out] | IsModified | TRUE means page table is modified by software or hardware. FALSE means page table is not modified by software. If the output IsModified is FALSE, there is possibility that the page table is changed by hardware. It is ok because page table can be changed by hardware anytime, and caller don't need to Flush TLB. |
RETURN_UNSUPPORTED | PagingMode is not supported. |
RETURN_INVALID_PARAMETER | PageTable, BufferSize, Attribute or Mask is NULL. |
RETURN_INVALID_PARAMETER | For non-present range, Mask->Bits.Present is 0 but some other attributes are provided. |
RETURN_INVALID_PARAMETER | For non-present range, Mask->Bits.Present is 1, Attribute->Bits.Present is 1 but some other attributes are not provided. |
RETURN_INVALID_PARAMETER | For non-present range, Mask->Bits.Present is 1, Attribute->Bits.Present is 0 but some other attributes are provided. |
RETURN_INVALID_PARAMETER | For present range, Mask->Bits.Present is 1, Attribute->Bits.Present is 0 but some other attributes are provided. |
RETURN_INVALID_PARAMETER | *BufferSize is not multiple of 4KB. |
RETURN_BUFFER_TOO_SMALL | The buffer is too small for page table creation/updating. BufferSize is updated to indicate the expected buffer size. Caller may still get RETURN_BUFFER_TOO_SMALL with the new BufferSize. |
RETURN_SUCCESS | PageTable is created/updated successfully or the input Length is 0. |
Definition at line 686 of file CpuPageTableMap.c.
RETURN_STATUS EFIAPI PageTableParse | ( | IN UINTN | PageTable, |
IN PAGING_MODE | PagingMode, | ||
IN IA32_MAP_ENTRY * | Map, | ||
IN OUT UINTN * | MapCount | ||
) |
Parse page table.
[in] | PageTable | Pointer to the page table. |
[in] | PagingMode | The paging mode. |
[out] | Map | Return an array that describes multiple linear address ranges. |
[in,out] | MapCount | On input, the maximum number of entries that Map can hold. On output, the number of entries in Map. |
RETURN_UNSUPPORTED | PageLevel is not 5 or 4. |
RETURN_INVALID_PARAMETER | MapCount is NULL. |
RETURN_INVALID_PARAMETER | *MapCount is not 0 but Map is NULL. |
RETURN_BUFFER_TOO_SMALL | *MapCount is too small. |
RETURN_SUCCESS | Page table is parsed successfully. |