TianoCore EDK2 master
Loading...
Searching...
No Matches
MmSaveStateLib.h File Reference
#include <Protocol/MmCpu.h>
#include <Uefi/UefiBaseType.h>

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI MmSaveStateReadRegister (IN UINTN CpuIndex, IN EFI_MM_SAVE_STATE_REGISTER Register, IN UINTN Width, OUT VOID *Buffer)
 
EFI_STATUS EFIAPI MmSaveStateWriteRegister (IN UINTN CpuIndex, IN EFI_MM_SAVE_STATE_REGISTER Register, IN UINTN Width, IN CONST VOID *Buffer)
 

Detailed Description

Library that provides service to read/write CPU specific smram save state registers.

Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.

Note
SaveState(Read/Write) of EFI_SMM_SAVE_STATE_REGISTER_PROCESSOR_ID/EFI_MM_SAVE_STATE_REGISTER_PROCESSOR_ID is handled by PiSmmCpuDxeSmm driver.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file MmSaveStateLib.h.

Function Documentation

◆ MmSaveStateReadRegister()

EFI_STATUS EFIAPI MmSaveStateReadRegister ( IN UINTN  CpuIndex,
IN EFI_MM_SAVE_STATE_REGISTER  Register,
IN UINTN  Width,
OUT VOID *  Buffer 
)

Read a save state register on the target processor. If this function returns EFI_UNSUPPORTED, then the caller is responsible for reading the MM Save State register.

Parameters
[in]CpuIndexThe index of the CPU to read the Save State register. The value must be between 0 and the NumberOfCpus field in the System Management System Table (SMST).
[in]RegisterThe MM Save State register to read.
[in]WidthThe number of bytes to read from the CPU save state.
[out]BufferUpon return, this holds the CPU register value read from the save state.
Return values
EFI_SUCCESSThe register was read from Save State.
EFI_INVALID_PARAMTERBuffer is NULL.
EFI_UNSUPPORTEDThis function does not support reading Register.
EFI_NOT_FOUNDIf desired Register not found.

Read an SMM Save State register on the target processor. If this function returns EFI_UNSUPPORTED, then the caller is responsible for reading the SMM Save Sate register.

Parameters
[in]CpuIndexThe index of the CPU to read the SMM Save State. The value must be between 0 and the NumberOfCpus field in the System Management System Table (SMST).
[in]RegisterThe SMM Save State register to read.
[in]WidthThe number of bytes to read from the CPU save state.
[out]BufferUpon return, this holds the CPU register value read from the save state.
Return values
EFI_SUCCESSThe register was read from Save State.
EFI_INVALID_PARAMTERBuffer is NULL.
EFI_UNSUPPORTEDThis function does not support reading Register.
EFI_NOT_FOUNDIf desired Register not found.

Definition at line 103 of file AmdMmSaveState.c.

◆ MmSaveStateWriteRegister()

EFI_STATUS EFIAPI MmSaveStateWriteRegister ( IN UINTN  CpuIndex,
IN EFI_MM_SAVE_STATE_REGISTER  Register,
IN UINTN  Width,
IN CONST VOID *  Buffer 
)

Writes a save state register on the target processor. If this function returns EFI_UNSUPPORTED, then the caller is responsible for writing the MM save state register.

Parameters
[in]CpuIndexThe index of the CPU to write the MM Save State. The value must be between 0 and the NumberOfCpus field in the System Management System Table (SMST).
[in]RegisterThe MM Save State register to write.
[in]WidthThe number of bytes to write to the CPU save state.
[in]BufferUpon entry, this holds the new CPU register value.
Return values
EFI_SUCCESSThe register was written to Save State.
EFI_INVALID_PARAMTERBuffer is NULL.
EFI_UNSUPPORTEDThis function does not support writing Register.
EFI_NOT_FOUNDIf desired Register not found.

Writes an SMM Save State register on the target processor. If this function returns EFI_UNSUPPORTED, then the caller is responsible for writing the SMM Save Sate register.

Parameters
[in]CpuIndexThe index of the CPU to write the SMM Save State. The value must be between 0 and the NumberOfCpus field in the System Management System Table (SMST).
[in]RegisterThe SMM Save State register to write.
[in]WidthThe number of bytes to write to the CPU save state.
[in]BufferUpon entry, this holds the new CPU register value.
Return values
EFI_SUCCESSThe register was written to Save State.
EFI_INVALID_PARAMTERBuffer is NULL.
EFI_UNSUPPORTEDThis function does not support writing Register.
EFI_NOT_FOUNDIf desired Register not found.

Definition at line 202 of file AmdMmSaveState.c.