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

Go to the source code of this file.

Macros

#define _DBGMSGID_   "[PRMLOADER]"
 

Functions

EFI_STATUS ProcessPrmModules (OUT PRM_ACPI_DESCRIPTION_TABLE **PrmAcpiDescriptionTable)
 
EFI_STATUS PublishPrmAcpiTable (IN PRM_ACPI_DESCRIPTION_TABLE *PrmAcpiDescriptionTable)
 
VOID EFIAPI PrmLoaderEndOfDxeNotification (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS EFIAPI PrmLoaderEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

UINTN mPrmHandlerCount
 
UINTN mPrmModuleCount
 

Detailed Description

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

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

Definition in file PrmLoaderDxe.c.

Macro Definition Documentation

◆ _DBGMSGID_

#define _DBGMSGID_   "[PRMLOADER]"

Definition at line 31 of file PrmLoaderDxe.c.

Function Documentation

◆ PrmLoaderEndOfDxeNotification()

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

The PRM Loader END_OF_DXE protocol notification event handler.

All PRM Modules that are eligible for dispatch should have been loaded the DXE Dispatcher at the time of this function invocation.

The main responsibilities of the PRM Loader are executed from this function which include 3 phases: 1.) Disover PRM Modules - Find all PRM modules loaded during DXE dispatch and insert a PRM Module Context entry into a linked list to be handed off to phase 2. 2.) Process PRM Modules - Build a GUID to PRM handler mapping for each module that is described in the PRM ACPI table so the OS can resolve a PRM Handler GUID to the corresponding PRM Handler physical address. 3.) Publish PRM ACPI Table - Publish the PRM ACPI table with the information gathered in the phase 2.

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 311 of file PrmLoaderDxe.c.

◆ PrmLoaderEntryPoint()

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

The entry point for this module.

Parameters
ImageHandleThe firmware allocated handle for the EFI image.
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 349 of file PrmLoaderDxe.c.

◆ ProcessPrmModules()

EFI_STATUS ProcessPrmModules ( OUT PRM_ACPI_DESCRIPTION_TABLE **  PrmAcpiDescriptionTable)

Processes a list of PRM context entries to build a PRM ACPI table.

The ACPI table buffer is allocated and the table structure is built inside this function.

Parameters
[out]PrmAcpiDescriptionTableA pointer to a pointer to a buffer that is allocated within this function and will contain the PRM ACPI table. In case of an error in this function, PrmAcpiDescriptorTable will be NULL.
Return values
EFI_SUCCESSAll PRM Modules were processed to construct the PRM ACPI table successfully.
EFI_INVALID_PARAMETERTHe parameter PrmAcpiDescriptionTable is NULL.
EFI_OUT_OF_RESOURCESInsufficient memory resources to allocate the PRM ACPI table boot services memory data buffer.

Definition at line 52 of file PrmLoaderDxe.c.

◆ PublishPrmAcpiTable()

EFI_STATUS PublishPrmAcpiTable ( IN PRM_ACPI_DESCRIPTION_TABLE PrmAcpiDescriptionTable)

Publishes the PRM ACPI table (PRMT).

Parameters
[in]PrmAcpiDescriptionTableA pointer to a buffer with a completely populated and valid PRM ACPI description table.
Return values
EFI_SUCCESSThe PRM ACPI was installed successfully.
EFI_INVALID_PARAMETERTHe parameter PrmAcpiDescriptionTable is NULL or the table signature in the table provided is invalid.
EFI_NOT_FOUNDThe protocol gEfiAcpiTableProtocolGuid could not be found.
EFI_OUT_OF_RESOURCESInsufficient memory resources to allocate the PRM ACPI table buffer.

Definition at line 257 of file PrmLoaderDxe.c.

Variable Documentation

◆ mPrmHandlerCount

UINTN mPrmHandlerCount

Definition at line 33 of file PrmLoaderDxe.c.

◆ mPrmModuleCount

UINTN mPrmModuleCount

Definition at line 34 of file PrmLoaderDxe.c.