TianoCore EDK2 master
|
#include <PiPei.h>
#include <Ppi/ArmMpCoreInfo.h>
#include <Ppi/MemoryAttribute.h>
#include <Library/DebugLib.h>
#include <Library/PeimEntryPoint.h>
#include <Library/PeiServicesLib.h>
#include <Library/PcdLib.h>
#include <Library/HobLib.h>
#include <Library/ArmLib.h>
#include <Library/ArmMmuLib.h>
Go to the source code of this file.
Functions | |
STATIC EFI_STATUS EFIAPI | SetMemoryPermissions (IN EDKII_MEMORY_ATTRIBUTE_PPI *This, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Attributes, IN UINT64 AttributeMask) |
EFI_STATUS EFIAPI | InitializeCpuPeim (IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices) |
Variables | |
STATIC CONST EDKII_MEMORY_ATTRIBUTE_PPI | mMemoryAttributePpi |
STATIC CONST EFI_PEI_PPI_DESCRIPTOR | mMemoryAttributePpiDesc |
Copyright (c) 2006, Intel Corporation. All rights reserved.
Copyright (c) 2011 Hewlett Packard Corporation. All rights reserved.
Copyright (c) 2011-2013, ARM Limited. All rights reserved.
Copyright (c) 2023, Google, LLC. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Module Name:
MemoryInit.c
Abstract:
PEIM to provide fake memory init
Definition in file CpuPei.c.
EFI_STATUS EFIAPI InitializeCpuPeim | ( | IN EFI_PEI_FILE_HANDLE | FileHandle, |
IN CONST EFI_PEI_SERVICES ** | PeiServices | ||
) |
STATIC EFI_STATUS EFIAPI SetMemoryPermissions | ( | IN EDKII_MEMORY_ATTRIBUTE_PPI * | This, |
IN EFI_PHYSICAL_ADDRESS | BaseAddress, | ||
IN UINT64 | Length, | ||
IN UINT64 | Attributes, | ||
IN UINT64 | AttributeMask | ||
) |
Set the requested memory permission attributes on a region of memory.
BaseAddress and Length must be aligned to EFI_PAGE_SIZE.
Attributes must contain a combination of EFI_MEMORY_RP, EFI_MEMORY_RO and EFI_MEMORY_XP, and specifies the attributes that must be set for the region in question. Attributes that are omitted will be cleared from the region only if they are set in AttributeMask.
AttributeMask must contain a combination of EFI_MEMORY_RP, EFI_MEMORY_RO and EFI_MEMORY_XP, and specifies the attributes that the call will operate on. AttributeMask must not be 0x0, and must contain at least the bits set in Attributes.
[in] | This | The protocol instance pointer. |
[in] | BaseAddress | The physical address that is the start address of a memory region. |
[in] | Length | The size in bytes of the memory region. |
[in] | Attributes | Memory attributes to set or clear. |
[in] | AttributeMask | Mask of memory attributes to operate on. |
EFI_SUCCESS | The attributes were set for the memory region. |
EFI_INVALID_PARAMETER | Length is zero. AttributeMask is zero. AttributeMask lacks bits set in Attributes. BaseAddress or Length is not suitably aligned. |
EFI_UNSUPPORTED | The processor does not support one or more bytes of the memory resource range specified by BaseAddress and Length. The bit mask of attributes is not supported for the memory resource range specified by BaseAddress and Length. |
EFI_OUT_OF_RESOURCES | Requested attributes cannot be applied due to lack of system resources. |
STATIC CONST EDKII_MEMORY_ATTRIBUTE_PPI mMemoryAttributePpi |
STATIC CONST EFI_PEI_PPI_DESCRIPTOR mMemoryAttributePpiDesc |