SmmCpuIo.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /** @file
  2. SMM CPU I/O protocol as defined in the Intel Framework specification.
  3. This protocol provides CPU I/O and memory access within SMM.
  4. Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. **/
  7. #ifndef _SMM_CPU_IO_H_
  8. #define _SMM_CPU_IO_H_
  9. #include <Protocol/SmmCpuIo2.h>
  10. #define EFI_SMM_CPU_IO_GUID \
  11. { \
  12. 0x5f439a0b, 0x45d8, 0x4682, {0xa4, 0xf4, 0xf0, 0x57, 0x6b, 0x51, 0x34, 0x41} \
  13. }
  14. typedef struct _EFI_SMM_CPU_IO_INTERFACE EFI_SMM_CPU_IO_INTERFACE;
  15. /**
  16. Provides the basic memory and I/O interfaces used to abstract accesses to devices.
  17. The I/O operations are carried out exactly as requested. The caller is
  18. responsible for any alignment and I/O width issues that the bus, device,
  19. platform, or type of I/O might require.
  20. @param[in] This The EFI_SMM_CPU_IO_INTERFACE instance.
  21. @param[in] Width Signifies the width of the I/O operations.
  22. @param[in] Address The base address of the I/O operations. The caller is
  23. responsible for aligning the Address, if required.
  24. @param[in] Count The number of I/O operations to perform.
  25. @param[in,out] Buffer For read operations, the destination buffer to store
  26. the results. For write operations, the source buffer
  27. from which to write data.
  28. @retval EFI_SUCCESS The data was read from or written to the device.
  29. @retval EFI_UNSUPPORTED The Address is not valid for this system.
  30. @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
  31. @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack
  32. of resources.
  33. **/
  34. typedef
  35. EFI_STATUS
  36. (EFIAPI *EFI_SMM_CPU_IO)(
  37. IN EFI_SMM_CPU_IO_INTERFACE *This,
  38. IN EFI_SMM_IO_WIDTH Width,
  39. IN UINT64 Address,
  40. IN UINTN Count,
  41. IN OUT VOID *Buffer
  42. );
  43. typedef struct {
  44. ///
  45. /// This service provides the various modalities of memory and I/O read.
  46. ///
  47. EFI_SMM_CPU_IO Read;
  48. ///
  49. /// This service provides the various modalities of memory and I/O write.
  50. ///
  51. EFI_SMM_CPU_IO Write;
  52. } EFI_SMM_IO_ACCESS;
  53. ///
  54. /// SMM CPU I/O Protocol provides CPU I/O and memory access within SMM.
  55. ///
  56. struct _EFI_SMM_CPU_IO_INTERFACE {
  57. ///
  58. /// Allows reads and writes to memory-mapped I/O space.
  59. ///
  60. EFI_SMM_IO_ACCESS Mem;
  61. ///
  62. /// Allows reads and writes to I/O space.
  63. ///
  64. EFI_SMM_IO_ACCESS Io;
  65. };
  66. extern EFI_GUID gEfiSmmCpuIoGuid;
  67. #endif