EFI SMM CPU PROTOCOL

From PhoenixWiki

Jump to: navigation, search

Provides access to CPU-related information while in SMM.

Contents

GUID

#define EFI_SMM_CPU_PROTOCOL_GUID \
  { 0xeb346b97, 0x975f, 0x4a9f, \
  { 0x8b, 0x22, 0xf8, 0xe9, 0x2b, 0xb3, 0xd5, 0x69 } }

Prototype

typedef struct _EFI_SMM_CPU_PROTOCOL {
  EFI_SMM_READ_SAVE_STATE  ReadSaveState;
  EFI_SMM_WRITE_SAVE_STATE WriteSaveState;
} EFI_SMM_CPU_PROTOCOL;

Members

Member Description
ReadSaveState Read information from the CPU save state.
WriteSaveState Write information to the CPU save state.

Description

This protocol allows SMM drivers to access architecture-standard registers from any of the CPU save state areas. In some cases, difference processors provide the same information in the save state, but not in the same format. These so-called pseudo-registers provide this information in a standard format.

ReadSaveState()

Read data from the CPU save state.

Prototype

typedef
EFI_STATUS
(EFIAPI *EFI_SMM_READ_SAVE_STATE (
  IN  CONST EFI_SMM_CPU_PROTOCOL  *This,
  IN  UINTN                       Width,
  IN  EFI_SMM_SAVE_STATE_REGISTER Register,
  IN  UINTN                       CpuIndex,
  OUT VOID                        *Buffer
  );

Parameters

Parameters Description
Width The number of bytes to read from the CPU save state. If the register specified by Register does not support the size specified by Width, then EFI_INVALID_PARAMETER is returned.
Register Specifies the CPU register to read form the save state. If the specified register is not implemented in the CPU save state map then EFI_NOT_FOUND error will be returned.
CpuIndex Specifies the zero-based index of the CPU save state
Buffer Upon return, this points to the CPU register value read from the save state.

Description
This function is used to read the specified number of bytes of the specified register from the CPU save state of the specified CPU and place the value into the buffer. If the CPU does not support the specified register Register, then EFI_UNSUPPORTED should be returned. If the CPU does not support the specified register width Width, then EFI_INVALID_PARAMETER is returned.


Status Codes Returned

Status Code Description
EFI_SUCCESS The register was read or written from Save State
EFI_NOT_FOUND The register is not defined for the Save State of Processor
EFI_INVALID_PARAMTER Input parameters are not valid. For ex: Processor No or register width is not correct.

WriteSaveState()

Write data to the CPU save state.

Prototype

typedef
EFI_STATUS
(EFIAPI *EFI_SMM_WRITE_SAVE_STATE (
  IN CONST EFI_SMM_CPU_PROTOCOL  *This,
  IN UINTN                       Width,
  IN EFI_SMM_SAVE_STATE_REGISTER Register,
  IN UINTN                       CpuIndex,
  IN CONST VOID                  *Buffer
  );

Parameters

Parameter Description
Width The number of bytes to write to the CPU save state. If the register specified by Register does not support the size specified by Width, then EFI_INVALID_PARAMETER s returned.
Register Specifies the CPU register to write to the save state. If the specified register is not implemented in the CPU save state map then EFI_NOT_FOUND error will be returned.
CpuIndex Specifies the zero-based index of the CPU save state.
Buffer Upon entry, this points to the new CPU register value.

Description
This function is used to write the specified number of bytes of the specified register to the CPU save state of the specified CPU and place the value into the buffer. If the CPU does not support the specified register Register, then EFI_UNSUPPORTED is returned. If the CPU does not support the specified register width Width, then EFI_INVALID_PARAMETER is returned.

Status Codes Returned

Status Code Description
EFI_SUCCESS The register was read or written from the Save State
EFI_NOT_FOUND The register Register is not defined for the Save State of the Processor associated with CpuIndex.
EFI_INVALID_PARAMTER Input parameters are not valid. For example: ProcessorIndex or Width is not correct.

Copyright (C) 2008 Phoenix Technologies Ltd. All Rights Reserved. Portions copyright (C) 2008 UEFI Forum, Inc. Used with permission

Personal tools