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

Go to the source code of this file.

Macros

#define _DBGMSGID_   "[PRMCONFIG]"
 

Functions

VOID ConvertRuntimeMemoryRangeAddresses (IN PRM_RUNTIME_MMIO_RANGES *RuntimeMmioRanges)
 
VOID SetRuntimeMemoryRangeAttributes (IN PRM_RUNTIME_MMIO_RANGES *RuntimeMmioRanges)
 
VOID StoreVirtualMemoryAddressChangePointers (VOID)
 
EFI_STATUS ValidatePrmDataBuffer (IN CONST PRM_DATA_BUFFER *PrmDataBuffer)
 
EFI_STATUS ValidatePrmContextBuffer (IN CONST PRM_CONTEXT_BUFFER *PrmContextBuffer)
 
VOID EFIAPI PrmConfigVirtualAddressChangeEvent (IN EFI_EVENT Event, IN VOID *Context)
 
VOID EFIAPI PrmConfigEndOfDxeNotification (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS EFIAPI PrmConfigEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC UINTN mMaxRuntimeMmioRangeCount
 
GLOBAL_REMOVE_IF_UNREFERENCED STATIC PRM_RUNTIME_MMIO_RANGES ** mRuntimeMmioRanges
 

Detailed Description

This file contains the implementation for a Platform Runtime Mechanism (PRM) configuration driver.

Copyright (c) Microsoft Corporation Copyright (c) 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file PrmConfigDxe.c.

Macro Definition Documentation

◆ _DBGMSGID_

#define _DBGMSGID_   "[PRMCONFIG]"

Definition at line 26 of file PrmConfigDxe.c.

Function Documentation

◆ ConvertRuntimeMemoryRangeAddresses()

VOID ConvertRuntimeMemoryRangeAddresses ( IN PRM_RUNTIME_MMIO_RANGES RuntimeMmioRanges)

Converts the runtime memory range physical addresses to virtual addresses.

Parameters
[in]RuntimeMmioRangesA pointer to a PRM_RUNTIME_MMIO_RANGES buffer.

Definition at line 39 of file PrmConfigDxe.c.

◆ PrmConfigEndOfDxeNotification()

VOID EFIAPI PrmConfigEndOfDxeNotification ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

The PRM Config END_OF_DXE protocol notification event handler.

Finds all of the PRM_CONFIG_PROTOCOL instances installed at end of DXE and marks all PRM_RUNTIME_MMIO_RANGE entries as EFI_MEMORY_RUNTIME.

Parameters
[in]EventEvent whose notification function is being invoked.
[in]ContextThe pointer to the notification function's context, which is implementation-dependent.

Definition at line 382 of file PrmConfigDxe.c.

◆ PrmConfigEntryPoint()

EFI_STATUS EFIAPI PrmConfigEntryPoint ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

The entry point for this module.

Parameters
[in]ImageHandleThe firmware allocated handle for the EFI image.
[in]SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe entry point is executed successfully.
OthersAn error occurred when executing this entry point.

Definition at line 478 of file PrmConfigDxe.c.

◆ PrmConfigVirtualAddressChangeEvent()

VOID EFIAPI PrmConfigVirtualAddressChangeEvent ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Notification function of EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE.

This is notification function converts any registered PRM_RUNTIME_MMIO_RANGE addresses to a virtual address.

Parameters
[in]EventEvent whose notification function is being invoked.
[in]ContextPointer to the notification function's context.

Definition at line 354 of file PrmConfigDxe.c.

◆ SetRuntimeMemoryRangeAttributes()

VOID SetRuntimeMemoryRangeAttributes ( IN PRM_RUNTIME_MMIO_RANGES RuntimeMmioRanges)

Sets the runtime memory range attributes.

The EFI_MEMORY_RUNTIME attribute is set for each PRM_RUNTIME_MMIO_RANGE present in the buffer provided.

Parameters
[in]RuntimeMmioRangesA pointer to a PRM_RUNTIME_MMIO_RANGES buffer.

Definition at line 65 of file PrmConfigDxe.c.

◆ StoreVirtualMemoryAddressChangePointers()

VOID StoreVirtualMemoryAddressChangePointers ( VOID  )

Stores pointers or pointer to resources that should be converted in the virtual address change event.

Definition at line 186 of file PrmConfigDxe.c.

◆ ValidatePrmContextBuffer()

EFI_STATUS ValidatePrmContextBuffer ( IN CONST PRM_CONTEXT_BUFFER PrmContextBuffer)

Validates a PRM context buffer.

Verifies the buffer header signature is valid and the GUID is set to a non-zero value.

Parameters
[in]PrmContextBufferA pointer to the context buffer for this PRM handler.
Return values
EFI_SUCCESSThe context buffer was validated successfully.
EFI_INVALID_PARAMETERThe pointer given for ContextBuffer is NULL.
EFI_NOT_FOUNDThe proper value for a field was not found.

Definition at line 310 of file PrmConfigDxe.c.

◆ ValidatePrmDataBuffer()

EFI_STATUS ValidatePrmDataBuffer ( IN CONST PRM_DATA_BUFFER PrmDataBuffer)

Validates a data buffer for a PRM module.

Verifies the buffer header signature is valid and the length meets the minimum size.

Parameters
[in]PrmDataBufferA pointer to the data buffer for this PRM module.
Return values
EFI_SUCCESSThe data buffer was validated successfully.
EFI_INVALID_PARAMETERThe pointer given for PrmDataBuffer is NULL.
EFI_NOT_FOUNDThe data buffer signature is not valid.
EFI_BUFFER_TOO_SMALLThe buffer size is too small.

Definition at line 276 of file PrmConfigDxe.c.

Variable Documentation

◆ mMaxRuntimeMmioRangeCount

STATIC UINTN mMaxRuntimeMmioRangeCount

Definition at line 28 of file PrmConfigDxe.c.

◆ mRuntimeMmioRanges

Definition at line 30 of file PrmConfigDxe.c.