47 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
48 &gEfiPeiCpuIoPpiInstalledGuid,
106 IN BOOLEAN MmioOperation,
119 if (Buffer ==
NULL) {
120 return EFI_INVALID_PARAMETER;
126 if ((UINT32)Width >= EfiPeiCpuIoWidthMaximum) {
127 return EFI_INVALID_PARAMETER;
134 if ((Width >= EfiPeiCpuIoWidthFifoUint8) && (Width <= EfiPeiCpuIoWidthFifoUint64)) {
142 if (!MmioOperation && (Width == EfiPeiCpuIoWidthUint64)) {
143 return EFI_INVALID_PARAMETER;
161 Limit = (MmioOperation ?
MAX_ADDRESS : MAX_IO_PORT_ADDRESS);
163 if (Address > Limit) {
164 return EFI_UNSUPPORTED;
168 if (MaxCount < (Count - 1)) {
169 return EFI_UNSUPPORTED;
172 if (Address >
LShiftU64 (MaxCount - Count + 1, Width)) {
173 return EFI_UNSUPPORTED;
217 if (EFI_ERROR (Status)) {
224 InStride = mInStride[Width];
225 OutStride = mOutStride[Width];
227 Aligned = (BOOLEAN)(((
UINTN)Buffer & (mInStride[OperationWidth] - 1)) == 0x00);
228 for (Uint8Buffer = Buffer; Count > 0; Address += InStride, Uint8Buffer += OutStride, Count--) {
229 if (OperationWidth == EfiPeiCpuIoWidthUint8) {
231 }
else if (OperationWidth == EfiPeiCpuIoWidthUint16) {
237 }
else if (OperationWidth == EfiPeiCpuIoWidthUint32) {
243 }
else if (OperationWidth == EfiPeiCpuIoWidthUint64) {
292 if (EFI_ERROR (Status)) {
299 InStride = mInStride[Width];
300 OutStride = mOutStride[Width];
302 Aligned = (BOOLEAN)(((
UINTN)Buffer & (mInStride[OperationWidth] - 1)) == 0x00);
303 for (Uint8Buffer = Buffer; Count > 0; Address += InStride, Uint8Buffer += OutStride, Count--) {
304 if (OperationWidth == EfiPeiCpuIoWidthUint8) {
306 }
else if (OperationWidth == EfiPeiCpuIoWidthUint16) {
312 }
else if (OperationWidth == EfiPeiCpuIoWidthUint32) {
318 }
else if (OperationWidth == EfiPeiCpuIoWidthUint64) {
367 if (EFI_ERROR (Status)) {
374 InStride = mInStride[Width];
375 OutStride = mOutStride[Width];
382 switch (OperationWidth) {
383 case EfiPeiCpuIoWidthUint8:
386 case EfiPeiCpuIoWidthUint16:
389 case EfiPeiCpuIoWidthUint32:
402 Aligned = (BOOLEAN)(((
UINTN)Buffer & (mInStride[OperationWidth] - 1)) == 0x00);
403 for (Uint8Buffer = Buffer; Count > 0; Address += InStride, Uint8Buffer += OutStride, Count--) {
404 if (OperationWidth == EfiPeiCpuIoWidthUint8) {
406 }
else if (OperationWidth == EfiPeiCpuIoWidthUint16) {
412 }
else if (OperationWidth == EfiPeiCpuIoWidthUint32) {
464 if (EFI_ERROR (Status)) {
471 InStride = mInStride[Width];
472 OutStride = mOutStride[Width];
479 switch (OperationWidth) {
480 case EfiPeiCpuIoWidthUint8:
483 case EfiPeiCpuIoWidthUint16:
486 case EfiPeiCpuIoWidthUint32:
499 Aligned = (BOOLEAN)(((
UINTN)Buffer & (mInStride[OperationWidth] - 1)) == 0x00);
500 for (Uint8Buffer = (UINT8 *)Buffer; Count > 0; Address += InStride, Uint8Buffer += OutStride, Count--) {
501 if (OperationWidth == EfiPeiCpuIoWidthUint8) {
503 }
else if (OperationWidth == EfiPeiCpuIoWidthUint16) {
509 }
else if (OperationWidth == EfiPeiCpuIoWidthUint32) {
902 if (Status == EFI_ALREADY_STARTED) {
906 DEBUG ((DEBUG_INFO,
"CpuIO PPI has been loaded into memory. Reinstalled PPI=0x%x\n", &gCpuIoPpi));
UINT64 EFIAPI ReadUnaligned64(IN CONST UINT64 *Buffer)
UINT16 EFIAPI ReadUnaligned16(IN CONST UINT16 *Buffer)
UINT64 EFIAPI RShiftU64(IN UINT64 Operand, IN UINTN Count)
UINT32 EFIAPI WriteUnaligned32(OUT UINT32 *Buffer, IN UINT32 Value)
UINT16 EFIAPI WriteUnaligned16(OUT UINT16 *Buffer, IN UINT16 Value)
UINT64 EFIAPI LShiftU64(IN UINT64 Operand, IN UINTN Count)
UINT64 EFIAPI WriteUnaligned64(OUT UINT64 *Buffer, IN UINT64 Value)
UINT32 EFIAPI ReadUnaligned32(IN CONST UINT32 *Buffer)
VOID EFIAPI CpuMemWrite32(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address, IN UINT32 Data)
UINT8 EFIAPI CpuMemRead8(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address)
VOID EFIAPI CpuIoWrite64(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address, IN UINT64 Data)
UINT64 EFIAPI CpuMemRead64(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address)
EFI_STATUS EFIAPI CpuIoServiceRead(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN EFI_PEI_CPU_IO_PPI_WIDTH Width, IN UINT64 Address, IN UINTN Count, OUT VOID *Buffer)
VOID EFIAPI CpuMemWrite64(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address, IN UINT64 Data)
VOID EFIAPI CpuIoWrite8(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address, IN UINT8 Data)
UINT8 EFIAPI CpuIoRead8(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address)
VOID EFIAPI CpuMemWrite8(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address, IN UINT8 Data)
EFI_STATUS EFIAPI CpuIoServiceWrite(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN EFI_PEI_CPU_IO_PPI_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer)
VOID EFIAPI CpuIoWrite16(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address, IN UINT16 Data)
EFI_STATUS EFIAPI CpuIoInitialize(IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
UINT16 EFIAPI CpuMemRead16(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address)
EFI_STATUS CpuIoCheckParameter(IN BOOLEAN MmioOperation, IN EFI_PEI_CPU_IO_PPI_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer)
UINT32 EFIAPI CpuMemRead32(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address)
UINT64 EFIAPI CpuIoRead64(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address)
UINT32 EFIAPI CpuIoRead32(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address)
UINT16 EFIAPI CpuIoRead16(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address)
EFI_STATUS EFIAPI CpuMemoryServiceWrite(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN EFI_PEI_CPU_IO_PPI_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer)
VOID EFIAPI CpuIoWrite32(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address, IN UINT32 Data)
EFI_STATUS EFIAPI CpuMemoryServiceRead(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN EFI_PEI_CPU_IO_PPI_WIDTH Width, IN UINT64 Address, IN UINTN Count, OUT VOID *Buffer)
VOID EFIAPI CpuMemWrite16(IN CONST EFI_PEI_SERVICES **PeiServices, IN CONST EFI_PEI_CPU_IO_PPI *This, IN UINT64 Address, IN UINT16 Data)
EFI_STATUS EFIAPI PeiServicesInstallPpi(IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList)
EFI_STATUS EFIAPI PeiServicesRegisterForShadow(IN EFI_PEI_FILE_HANDLE FileHandle)
UINT8 EFIAPI IoWrite8(IN UINTN Port, IN UINT8 Value)
UINT64 EFIAPI MmioWrite64(IN UINTN Address, IN UINT64 Value)
VOID EFIAPI IoWriteFifo32(IN UINTN Port, IN UINTN Count, IN VOID *Buffer)
VOID EFIAPI IoReadFifo8(IN UINTN Port, IN UINTN Count, OUT VOID *Buffer)
UINT64 EFIAPI IoRead64(IN UINTN Port)
VOID EFIAPI IoReadFifo16(IN UINTN Port, IN UINTN Count, OUT VOID *Buffer)
UINT64 EFIAPI IoWrite64(IN UINTN Port, IN UINT64 Value)
VOID EFIAPI IoWriteFifo16(IN UINTN Port, IN UINTN Count, IN VOID *Buffer)
UINT64 EFIAPI MmioRead64(IN UINTN Address)
VOID EFIAPI IoReadFifo32(IN UINTN Port, IN UINTN Count, OUT VOID *Buffer)
UINT16 EFIAPI MmioRead16(IN UINTN Address)
UINT8 EFIAPI MmioRead8(IN UINTN Address)
UINT8 EFIAPI MmioWrite8(IN UINTN Address, IN UINT8 Value)
UINT8 EFIAPI IoRead8(IN UINTN Port)
UINT32 EFIAPI MmioRead32(IN UINTN Address)
VOID EFIAPI IoWriteFifo8(IN UINTN Port, IN UINTN Count, IN VOID *Buffer)
UINT16 EFIAPI IoRead16(IN UINTN Port)
UINT16 EFIAPI MmioWrite16(IN UINTN Address, IN UINT16 Value)
UINT32 EFIAPI IoRead32(IN UINTN Port)
UINT32 EFIAPI IoWrite32(IN UINTN Port, IN UINT32 Value)
UINT16 EFIAPI IoWrite16(IN UINTN Port, IN UINT16 Value)
UINT32 EFIAPI MmioWrite32(IN UINTN Address, IN UINT32 Value)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
VOID * EFI_PEI_FILE_HANDLE