123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442 |
- /** @file
- Internal include file for the CPU I/O PPI.
- Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
- SPDX-License-Identifier: BSD-2-Clause-Patent
- **/
- #ifndef _CPU_IO2_PEI_H_
- #define _CPU_IO2_PEI_H_
- #include <PiDxe.h>
- #include <Ppi/CpuIo.h>
- #include <Library/BaseLib.h>
- #include <Library/DebugLib.h>
- #include <Library/IoLib.h>
- #include <Library/PeiServicesLib.h>
- #define MAX_IO_PORT_ADDRESS 0xFFFF
- /**
- Reads memory-mapped registers.
- @param[in] PeiServices An indirect pointer to the PEI Services Table
- published by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Width The width of the access. Enumerated in bytes.
- @param[in] Address The physical address of the access.
- @param[in] Count The number of accesses to perform.
- @param[out] Buffer A pointer to the buffer of data.
- @retval EFI_SUCCESS The function completed successfully.
- @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
- @retval EFI_INVALID_PARAMETER Buffer is NULL.
- @retval EFI_UNSUPPORTED The address range specified by Address, Width,
- and Count is not valid for this EFI system.
- **/
- 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
- );
- /**
- Writes memory-mapped registers.
- @param[in] PeiServices An indirect pointer to the PEI Services Table
- published by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Width The width of the access. Enumerated in bytes.
- @param[in] Address The physical address of the access.
- @param[in] Count The number of accesses to perform.
- @param[in] Buffer A pointer to the buffer of data.
- @retval EFI_SUCCESS The function completed successfully.
- @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
- @retval EFI_INVALID_PARAMETER Buffer is NULL.
- @retval EFI_UNSUPPORTED The address range specified by Address, Width,
- and Count is not valid for this EFI system.
- **/
- 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
- );
- /**
- Reads I/O registers.
- @param[in] PeiServices An indirect pointer to the PEI Services Table
- published by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Width The width of the access. Enumerated in bytes.
- @param[in] Address The physical address of the access.
- @param[in] Count The number of accesses to perform.
- @param[out] Buffer A pointer to the buffer of data.
- @retval EFI_SUCCESS The function completed successfully.
- @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
- @retval EFI_INVALID_PARAMETER Buffer is NULL.
- @retval EFI_UNSUPPORTED The address range specified by Address, Width,
- and Count is not valid for this EFI system.
- **/
- 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
- );
- /**
- Write I/O registers.
- @param[in] PeiServices An indirect pointer to the PEI Services Table
- published by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Width The width of the access. Enumerated in bytes.
- @param[in] Address The physical address of the access.
- @param[in] Count The number of accesses to perform.
- @param[in] Buffer A pointer to the buffer of data.
- @retval EFI_SUCCESS The function completed successfully.
- @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.
- @retval EFI_INVALID_PARAMETER Buffer is NULL.
- @retval EFI_UNSUPPORTED The address range specified by Address, Width,
- and Count is not valid for this EFI system.
- **/
- 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
- );
- /**
- 8-bit I/O read operations.
- @param[in] PeiServices An indirect pointer to the PEI Services Table published
- by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Address The physical address of the access.
- @return An 8-bit value returned from the I/O space.
- **/
- UINT8
- EFIAPI
- CpuIoRead8 (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_CPU_IO_PPI *This,
- IN UINT64 Address
- );
- /**
- 16-bit I/O read operations.
- @param[in] PeiServices An indirect pointer to the PEI Services Table published
- by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Address The physical address of the access.
- @return A 16-bit value returned from the I/O space.
- **/
- UINT16
- EFIAPI
- CpuIoRead16 (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_CPU_IO_PPI *This,
- IN UINT64 Address
- );
- /**
- 32-bit I/O read operations.
- @param[in] PeiServices An indirect pointer to the PEI Services Table published
- by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Address The physical address of the access.
- @return A 32-bit value returned from the I/O space.
- **/
- UINT32
- EFIAPI
- CpuIoRead32 (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_CPU_IO_PPI *This,
- IN UINT64 Address
- );
- /**
- 64-bit I/O read operations.
- @param[in] PeiServices An indirect pointer to the PEI Services Table published
- by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Address The physical address of the access.
- @return A 64-bit value returned from the I/O space.
- **/
- UINT64
- EFIAPI
- CpuIoRead64 (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_CPU_IO_PPI *This,
- IN UINT64 Address
- );
- /**
- 8-bit I/O write operations.
- @param[in] PeiServices An indirect pointer to the PEI Services Table published
- by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Address The physical address of the access.
- @param[in] Data The data to write.
- **/
- VOID
- EFIAPI
- CpuIoWrite8 (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_CPU_IO_PPI *This,
- IN UINT64 Address,
- IN UINT8 Data
- );
- /**
- 16-bit I/O write operations.
- @param[in] PeiServices An indirect pointer to the PEI Services Table published
- by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Address The physical address of the access.
- @param[in] Data The data to write.
- **/
- VOID
- EFIAPI
- CpuIoWrite16 (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_CPU_IO_PPI *This,
- IN UINT64 Address,
- IN UINT16 Data
- );
- /**
- 32-bit I/O write operations.
- @param[in] PeiServices An indirect pointer to the PEI Services Table published
- by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Address The physical address of the access.
- @param[in] Data The data to write.
- **/
- VOID
- EFIAPI
- CpuIoWrite32 (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_CPU_IO_PPI *This,
- IN UINT64 Address,
- IN UINT32 Data
- );
- /**
- 64-bit I/O write operations.
- @param[in] PeiServices An indirect pointer to the PEI Services Table published
- by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Address The physical address of the access.
- @param[in] Data The data to write.
- **/
- VOID
- EFIAPI
- CpuIoWrite64 (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_CPU_IO_PPI *This,
- IN UINT64 Address,
- IN UINT64 Data
- );
- /**
- 8-bit memory read operations.
- @param[in] PeiServices An indirect pointer to the PEI Services Table published
- by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Address The physical address of the access.
- @return An 8-bit value returned from the memory space.
- **/
- UINT8
- EFIAPI
- CpuMemRead8 (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_CPU_IO_PPI *This,
- IN UINT64 Address
- );
- /**
- 16-bit memory read operations.
- @param[in] PeiServices An indirect pointer to the PEI Services Table published
- by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Address The physical address of the access.
- @return A 16-bit value returned from the memory space.
- **/
- UINT16
- EFIAPI
- CpuMemRead16 (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_CPU_IO_PPI *This,
- IN UINT64 Address
- );
- /**
- 32-bit memory read operations.
- @param[in] PeiServices An indirect pointer to the PEI Services Table published
- by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Address The physical address of the access.
- @return A 32-bit value returned from the memory space.
- **/
- UINT32
- EFIAPI
- CpuMemRead32 (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_CPU_IO_PPI *This,
- IN UINT64 Address
- );
- /**
- 64-bit memory read operations.
- @param[in] PeiServices An indirect pointer to the PEI Services Table published
- by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Address The physical address of the access.
- @return A 64-bit value returned from the memory space.
- **/
- UINT64
- EFIAPI
- CpuMemRead64 (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_CPU_IO_PPI *This,
- IN UINT64 Address
- );
- /**
- 8-bit memory write operations.
- @param[in] PeiServices An indirect pointer to the PEI Services Table published
- by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Address The physical address of the access.
- @param[in] Data The data to write.
- **/
- VOID
- EFIAPI
- CpuMemWrite8 (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_CPU_IO_PPI *This,
- IN UINT64 Address,
- IN UINT8 Data
- );
- /**
- 16-bit memory write operations.
- @param[in] PeiServices An indirect pointer to the PEI Services Table published
- by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Address The physical address of the access.
- @param[in] Data The data to write.
- **/
- VOID
- EFIAPI
- CpuMemWrite16 (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_CPU_IO_PPI *This,
- IN UINT64 Address,
- IN UINT16 Data
- );
- /**
- 32-bit memory write operations.
- @param[in] PeiServices An indirect pointer to the PEI Services Table published
- by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Address The physical address of the access.
- @param[in] Data The data to write.
- **/
- VOID
- EFIAPI
- CpuMemWrite32 (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_CPU_IO_PPI *This,
- IN UINT64 Address,
- IN UINT32 Data
- );
- /**
- 64-bit memory write operations.
- @param[in] PeiServices An indirect pointer to the PEI Services Table published
- by the PEI Foundation.
- @param[in] This Pointer to local data for the interface.
- @param[in] Address The physical address of the access.
- @param[in] Data The data to write.
- **/
- VOID
- EFIAPI
- CpuMemWrite64 (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_CPU_IO_PPI *This,
- IN UINT64 Address,
- IN UINT64 Data
- );
- #endif
|