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

Go to the source code of this file.

Functions

VOID EFIAPI FreeList (IN LIST_ENTRY *ListHead)
 
PRM_HANDLER_CONTEXT_LIST_ENTRYCreateNewPrmHandlerListEntry (VOID)
 
VOID PrintMmioRuntimeRangeInfo (IN PRM_RUNTIME_MMIO_RANGES *RuntimeMmioRanges)
 
VOID GatherPrmHandlerInfo (IN BOOLEAN PrintInformation)
 
EFI_STATUS PopulateContextBuffer (IN PRM_DATA_BUFFER *StaticDataBuffer OPTIONAL, IN EFI_GUID *HandlerGuid, IN PRM_CONTEXT_BUFFER *ContextBuffer)
 
VOID PrintExecutionTime (IN UINT64 TimeInNanoSec)
 
EFI_STATUS ExecutePrmHandlerByGuid (IN EFI_GUID *HandlerGuid)
 
EFI_STATUS ParseParameterList (VOID)
 
EFI_STATUS EFIAPI UefiMain (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringPrmInfoHelpTokenId = STRING_TOKEN (STR_PRMINFO_HELP)
 
UINT8 PrmInfoStrings []
 
STATIC UINTN mPrmHandlerCount
 
STATIC UINTN mPrmModuleCount
 
STATIC EFI_HII_HANDLE mPrmInfoHiiHandle
 
STATIC LIST_ENTRY mPrmHandlerList
 
STATIC CONST SHELL_PARAM_ITEM mParamList []
 

Detailed Description

Prints information about the PRM configuration loaded by the system firmware.

This application also provides some additional testing features for PRM configuration. For example, the application can be used to selectively invoke PRM handlers in the UEFI shell environment to provide a quick testing path of the PRM infrastructure on the firmware and the PRM module implementation.

This can also be useful to prepare a PRM enabled firmware and PRM modules prior to formal OS support to test the PRM code.

Copyright (C) Microsoft Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file PrmInfo.c.

Function Documentation

◆ CreateNewPrmHandlerListEntry()

PRM_HANDLER_CONTEXT_LIST_ENTRY * CreateNewPrmHandlerListEntry ( VOID  )

Creates a new PRM Module Image Context linked list entry.

Return values
PrmHandlerContextListEntryIf successful, a pointer a PRM Handler Context linked list entry otherwise, NULL is returned.

Definition at line 95 of file PrmInfo.c.

◆ ExecutePrmHandlerByGuid()

EFI_STATUS ExecutePrmHandlerByGuid ( IN EFI_GUID HandlerGuid)

Executes the PRM handler with the provided GUID.

Parameters
[in]HandlerGuidA pointer to the GUID of the PRM handler to execute. A zero GUID indicates that all PRM handlers present should be executed.
Return values
EFI_SUCCESSThe PRM handler(s) were executed.
EFI_INVALID_PARAMETERThe HandlerGuid actual argument is NULL.
EFI_NOT_FOUNDThe PRM handler could not be found.

Definition at line 416 of file PrmInfo.c.

◆ FreeList()

VOID EFIAPI FreeList ( IN LIST_ENTRY ListHead)

Frees all of the nodes in a linked list.

Parameters
[in]ListHeadA pointer to the head of the list that should be freed.

Definition at line 63 of file PrmInfo.c.

◆ GatherPrmHandlerInfo()

VOID GatherPrmHandlerInfo ( IN BOOLEAN  PrintInformation)

Gathers the PRM handler (and by extension module) information discovered on this system.

This function must be called to build up the discovered context for other functions in the application. The function will optionally print results as determed by the value of the PrintInformation parameter.

Parameters
[in]PrintInformationIndicates whether to print information as discovered in the function.

Definition at line 157 of file PrmInfo.c.

◆ ParseParameterList()

EFI_STATUS ParseParameterList ( VOID  )

Parses the application parameter list and performs the appropriate operations based on the results.

Return values
EFI_SUCCESSThe parameter list was parsed successfully.
EFI_INVALID_PARAMETERAn invalid parameter was given to the application.
EFI_LOAD_ERRORAn error occurred loading the application.

Definition at line 522 of file PrmInfo.c.

◆ PopulateContextBuffer()

EFI_STATUS PopulateContextBuffer ( IN PRM_DATA_BUFFER *StaticDataBuffer  OPTIONAL,
IN EFI_GUID HandlerGuid,
IN PRM_CONTEXT_BUFFER ContextBuffer 
)

Populates the given context buffer so it can be passed to a PRM handler.

Parameters
[in]StaticDataBufferA pointer to the static data buffer that will be referenced in the context buffer that is populated. This is an optional pointer that, if not provided, by passing NULL will be ignored.
[in]HandlerGuidA pointer to the GUID of the PRM handler.
[in]ContextBufferA pointer to a caller allocated ContextBuffer structure that will be populated by this function.
Return values
EFI_SUCCESSThe given ContextBuffer was populated successfully.
EFI_INVALID_PARAMETERThe HandlerGuid or ContextBuffer actual argument is NULL.

Definition at line 328 of file PrmInfo.c.

◆ PrintExecutionTime()

VOID PrintExecutionTime ( IN UINT64  TimeInNanoSec)

Prints a given execution time in the appropriate unit.

Parameters
[in]TimeInNanoSecThe time to print in unit of nanoseconds.

Definition at line 358 of file PrmInfo.c.

◆ PrintMmioRuntimeRangeInfo()

VOID PrintMmioRuntimeRangeInfo ( IN PRM_RUNTIME_MMIO_RANGES RuntimeMmioRanges)

Creates a new PRM Module Image Context linked list entry.

Parameters
[in]RuntimeMmioRangesA pointer to an array of PRM module config runtime MMIO ranges.

Definition at line 118 of file PrmInfo.c.

◆ UefiMain()

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

Entry point of this UEFI application.

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.
otherSome error occurs when executing this entry point.

Definition at line 676 of file PrmInfo.c.

Variable Documentation

◆ mParamList

Initial value:
= {
{ L"-l", TypeFlag },
{ L"-t", TypeValue },
{ NULL, TypeMax }
}
#define NULL
Definition: Base.h:319
@ TypeValue
A flag that has some data following it with a space (IE "-a 1").
Definition: ShellLib.h:700
@ TypeFlag
A flag that is present or not present only (IE "-a").
Definition: ShellLib.h:699

Definition at line 49 of file PrmInfo.c.

◆ mPrmHandlerCount

STATIC UINTN mPrmHandlerCount

Definition at line 43 of file PrmInfo.c.

◆ mPrmHandlerList

STATIC LIST_ENTRY mPrmHandlerList

Definition at line 47 of file PrmInfo.c.

◆ mPrmInfoHiiHandle

STATIC EFI_HII_HANDLE mPrmInfoHiiHandle

Definition at line 46 of file PrmInfo.c.

◆ mPrmModuleCount

STATIC UINTN mPrmModuleCount

Definition at line 44 of file PrmInfo.c.

◆ mStringPrmInfoHelpTokenId

GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringPrmInfoHelpTokenId = STRING_TOKEN (STR_PRMINFO_HELP)

Definition at line 35 of file PrmInfo.c.