TianoCore EDK2 master
Loading...
Searching...
No Matches
CpuIo2Mm.c File Reference
#include "CpuIo2Mm.h"

Go to the source code of this file.

Functions

EFI_STATUS CpuIoCheckParameter (IN BOOLEAN MmioOperation, IN EFI_SMM_IO_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer)
 
EFI_STATUS EFIAPI CpuMemoryServiceRead (IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This, IN EFI_SMM_IO_WIDTH Width, IN UINT64 Address, IN UINTN Count, OUT VOID *Buffer)
 
EFI_STATUS EFIAPI CpuMemoryServiceWrite (IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This, IN EFI_SMM_IO_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer)
 
EFI_STATUS EFIAPI CpuIoServiceRead (IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This, IN EFI_SMM_IO_WIDTH Width, IN UINT64 Address, IN UINTN Count, OUT VOID *Buffer)
 
EFI_STATUS EFIAPI CpuIoServiceWrite (IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This, IN EFI_SMM_IO_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer)
 
EFI_STATUS CommonCpuIo2Initialize (VOID)
 

Variables

EFI_HANDLE mHandle = NULL
 
EFI_SMM_CPU_IO2_PROTOCOL mSmmCpuIo2
 
UINT8 mStride []
 

Detailed Description

Produces the SMM CPU I/O Protocol.

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

Definition in file CpuIo2Mm.c.

Function Documentation

◆ CommonCpuIo2Initialize()

EFI_STATUS CommonCpuIo2Initialize ( VOID  )

The module Entry Point SmmCpuIoProtocol driver

Return values
EFI_SUCCESSThe entry point is executed successfully.
OtherSome error occurs when executing this entry point.

Definition at line 382 of file CpuIo2Mm.c.

◆ CpuIoCheckParameter()

EFI_STATUS CpuIoCheckParameter ( IN BOOLEAN  MmioOperation,
IN EFI_SMM_IO_WIDTH  Width,
IN UINT64  Address,
IN UINTN  Count,
IN VOID *  Buffer 
)

Check parameters to a SMM CPU I/O Protocol service request.

Parameters
[in]MmioOperationTRUE for an MMIO operation, FALSE for I/O Port operation.
[in]WidthSignifies the width of the I/O operations.
[in]AddressThe base address of the I/O operations. The caller is responsible for aligning the Address if required.
[in]CountThe number of I/O operations to perform.
[in]BufferFor read operations, the destination buffer to store the results. For write operations, the source buffer from which to write data.
Return values
EFI_SUCCESSThe data was read from or written to the device.
EFI_UNSUPPORTEDThe Address is not valid for this system.
EFI_INVALID_PARAMETERWidth or Count, or both, were invalid.

Definition at line 58 of file CpuIo2Mm.c.

◆ CpuIoServiceRead()

EFI_STATUS EFIAPI CpuIoServiceRead ( IN CONST EFI_SMM_CPU_IO2_PROTOCOL This,
IN EFI_SMM_IO_WIDTH  Width,
IN UINT64  Address,
IN UINTN  Count,
OUT VOID *  Buffer 
)

Reads I/O registers.

The I/O operations are carried out exactly as requested. The caller is responsible for any alignment and I/O width issues that the bus, device, platform, or type of I/O might require.

Parameters
[in]ThisThe EFI_SMM_CPU_IO2_PROTOCOL instance.
[in]WidthSignifies the width of the I/O operations.
[in]AddressThe base address of the I/O operations. The caller is responsible for aligning the Address if required.
[in]CountThe number of I/O operations to perform.
[out]BufferFor read operations, the destination buffer to store the results. For write operations, the source buffer from which to write data.
Return values
EFI_SUCCESSThe data was read from or written to the device.
EFI_UNSUPPORTEDThe Address is not valid for this system.
EFI_INVALID_PARAMETERWidth or Count, or both, were invalid.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources

Definition at line 278 of file CpuIo2Mm.c.

◆ CpuIoServiceWrite()

EFI_STATUS EFIAPI CpuIoServiceWrite ( IN CONST EFI_SMM_CPU_IO2_PROTOCOL This,
IN EFI_SMM_IO_WIDTH  Width,
IN UINT64  Address,
IN UINTN  Count,
IN VOID *  Buffer 
)

Write I/O registers.

The I/O operations are carried out exactly as requested. The caller is responsible for any alignment and I/O width issues that the bus, device, platform, or type of I/O might require.

Parameters
[in]ThisThe EFI_SMM_CPU_IO2_PROTOCOL instance.
[in]WidthSignifies the width of the I/O operations.
[in]AddressThe base address of the I/O operations. The caller is responsible for aligning the Address if required.
[in]CountThe number of I/O operations to perform.
[in]BufferFor read operations, the destination buffer to store the results. For write operations, the source buffer from which to write data.
Return values
EFI_SUCCESSThe data was read from or written to the device.
EFI_UNSUPPORTEDThe Address is not valid for this system.
EFI_INVALID_PARAMETERWidth or Count, or both, were invalid.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources

Definition at line 337 of file CpuIo2Mm.c.

◆ CpuMemoryServiceRead()

EFI_STATUS EFIAPI CpuMemoryServiceRead ( IN CONST EFI_SMM_CPU_IO2_PROTOCOL This,
IN EFI_SMM_IO_WIDTH  Width,
IN UINT64  Address,
IN UINTN  Count,
OUT VOID *  Buffer 
)

Reads memory-mapped registers.

The I/O operations are carried out exactly as requested. The caller is responsible for any alignment and I/O width issues that the bus, device, platform, or type of I/O might require.

Parameters
[in]ThisThe EFI_SMM_CPU_IO2_PROTOCOL instance.
[in]WidthSignifies the width of the I/O operations.
[in]AddressThe base address of the I/O operations. The caller is responsible for aligning the Address if required.
[in]CountThe number of I/O operations to perform.
[out]BufferFor read operations, the destination buffer to store the results. For write operations, the source buffer from which to write data.
Return values
EFI_SUCCESSThe data was read from or written to the device.
EFI_UNSUPPORTEDThe Address is not valid for this system.
EFI_INVALID_PARAMETERWidth or Count, or both, were invalid.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources

Definition at line 156 of file CpuIo2Mm.c.

◆ CpuMemoryServiceWrite()

EFI_STATUS EFIAPI CpuMemoryServiceWrite ( IN CONST EFI_SMM_CPU_IO2_PROTOCOL This,
IN EFI_SMM_IO_WIDTH  Width,
IN UINT64  Address,
IN UINTN  Count,
IN VOID *  Buffer 
)

Writes memory-mapped registers.

The I/O operations are carried out exactly as requested. The caller is responsible for any alignment and I/O width issues that the bus, device, platform, or type of I/O might require.

Parameters
[in]ThisThe EFI_SMM_CPU_IO2_PROTOCOL instance.
[in]WidthSignifies the width of the I/O operations.
[in]AddressThe base address of the I/O operations. The caller is responsible for aligning the Address if required.
[in]CountThe number of I/O operations to perform.
[in]BufferFor read operations, the destination buffer to store the results. For write operations, the source buffer from which to write data.
Return values
EFI_SUCCESSThe data was read from or written to the device.
EFI_UNSUPPORTEDThe Address is not valid for this system.
EFI_INVALID_PARAMETERWidth or Count, or both, were invalid.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources

Definition at line 217 of file CpuIo2Mm.c.

Variable Documentation

◆ mHandle

EFI_HANDLE mHandle = NULL

Handle for the Capsule Update Policy Protocol

Definition at line 14 of file CpuIo2Mm.c.

◆ mSmmCpuIo2

Initial value:
= {
{
},
{
}
}
EFI_STATUS EFIAPI CpuMemoryServiceRead(IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This, IN EFI_SMM_IO_WIDTH Width, IN UINT64 Address, IN UINTN Count, OUT VOID *Buffer)
Definition: CpuIo2Mm.c:156
EFI_STATUS EFIAPI CpuIoServiceWrite(IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This, IN EFI_SMM_IO_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer)
Definition: CpuIo2Mm.c:337
EFI_STATUS EFIAPI CpuIoServiceRead(IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This, IN EFI_SMM_IO_WIDTH Width, IN UINT64 Address, IN UINTN Count, OUT VOID *Buffer)
Definition: CpuIo2Mm.c:278
EFI_STATUS EFIAPI CpuMemoryServiceWrite(IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This, IN EFI_SMM_IO_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer)
Definition: CpuIo2Mm.c:217

Definition at line 19 of file CpuIo2Mm.c.

◆ mStride

UINT8 mStride[]
Initial value:
= {
1,
2,
4,
8
}

Definition at line 33 of file CpuIo2Mm.c.