12STATIC EFI_CPU_IO2_PROTOCOL *
mCpuIo = NULL;
58 Status =
gBS->LocateProtocol (
59 &gEfiCpuIo2ProtocolGuid,
64 if (EFI_ERROR (Status)) {
98 IN BOOLEAN MmioOperation,
112 return EFI_INVALID_PARAMETER;
119 return EFI_INVALID_PARAMETER;
135 return EFI_INVALID_PARAMETER;
141 if ((Address & ((UINT64)
mInStride[Width] - 1)) != 0) {
142 return EFI_UNSUPPORTED;
162 if (Address > Limit) {
163 return EFI_UNSUPPORTED;
167 if (MaxCount < (Count - 1)) {
168 return EFI_UNSUPPORTED;
171 if (Address >
LShiftU64 (MaxCount - Count + 1, Width)) {
172 return EFI_UNSUPPORTED;
181 return EFI_UNSUPPORTED;
229 IN EFI_CPU_IO2_PROTOCOL *This,
243 if (EFI_ERROR (Status)) {
253 for (Uint8Buffer =
Buffer; Count > 0; Address += InStride, Uint8Buffer += OutStride, Count--) {
255 *((UINT8 *)Uint8Buffer) = *((UINT8 *)(UINTN)Address);
310 IN EFI_CPU_IO2_PROTOCOL *This,
324 if (EFI_ERROR (Status)) {
334 for (Uint8Buffer =
Buffer; Count > 0; Address += InStride, Uint8Buffer += OutStride, Count--) {
336 *((UINT8 *)(UINTN)Address) = *((UINT8 *)Uint8Buffer);
379 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
380 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
387 return EFI_INVALID_PARAMETER;
390 if ((Width < 0) || (Width >= EfiPciWidthMaximum)) {
391 return EFI_INVALID_PARAMETER;
434 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
435 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
442 return EFI_INVALID_PARAMETER;
445 if ((Width < 0) || (Width >= EfiPciWidthMaximum)) {
446 return EFI_INVALID_PARAMETER;
450 return mCpuIo->Mem.Write (
EFI_CPU_IO_PROTOCOL_WIDTH
@ EfiCpuIoWidthFifoUint64
EFI_STATUS EFIAPI RootBridgeIoMemRead(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINTN Count, OUT VOID *Buffer)
EFI_STATUS CpuIoCheckParameter(IN BOOLEAN MmioOperation, IN EFI_CPU_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer)
EFI_CPU_IO2_PROTOCOL * InitializeCpuIo2(VOID)
STATIC CONST UINT8 mInStride[]
EFI_STATUS EFIAPI CpuMemoryServiceWrite(IN EFI_CPU_IO2_PROTOCOL *This, IN EFI_CPU_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer)
EFI_STATUS EFIAPI CpuMemoryServiceRead(IN EFI_CPU_IO2_PROTOCOL *This, IN EFI_CPU_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINTN Count, OUT VOID *Buffer)
STATIC CONST UINT8 mOutStride[]
EFI_STATUS EFIAPI RootBridgeIoMemWrite(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN VOID *Buffer)
STATIC EFI_CPU_IO2_PROTOCOL * mCpuIo
#define MAX_IO_PORT_ADDRESS
OC_TYPING_BUFFER_ENTRY Buffer[OC_TYPING_BUFFER_SIZE]
UINT64 EFIAPI ReadUnaligned64(IN CONST UINT64 *Buffer)
UINT16 EFIAPI ReadUnaligned16(IN CONST UINT16 *Buffer)
UINT32 EFIAPI WriteUnaligned32(OUT UINT32 *Buffer, IN UINT32 Value)
UINT16 EFIAPI WriteUnaligned16(OUT UINT16 *Buffer, IN UINT16 Value)
UINT64 EFIAPI WriteUnaligned64(OUT UINT64 *Buffer, IN UINT64 Value)
UINT32 EFIAPI ReadUnaligned32(IN CONST UINT32 *Buffer)
UINT64 EFIAPI RShiftU64(IN UINT64 Operand, IN UINTN Count)
UINT64 EFIAPI LShiftU64(IN UINT64 Operand, IN UINTN Count)