QemuFwCfgLibInternal.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /** @file
  2. fw_cfg library implementation.
  3. Copyright (c) 2022 Loongson Technology Corporation Limited. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. @par Glossary:
  6. - FwCfg - firmWare Configure
  7. **/
  8. #ifndef QEMU_FW_CFG_LIB_INTERNAL_H_
  9. #define QEMU_FW_CFG_LIB_INTERNAL_H_
  10. /**
  11. Returns a boolean indicating if the firmware configuration interface is
  12. available for library-internal purposes.
  13. This function never changes fw_cfg state.
  14. @retval TRUE The interface is available internally.
  15. @retval FALSE The interface is not available internally.
  16. **/
  17. BOOLEAN
  18. InternalQemuFwCfgIsAvailable (
  19. VOID
  20. );
  21. /**
  22. Returns a boolean indicating whether QEMU provides the DMA-like access method
  23. for fw_cfg.
  24. @retval TRUE The DMA-like access method is available.
  25. @retval FALSE The DMA-like access method is unavailable.
  26. **/
  27. BOOLEAN
  28. InternalQemuFwCfgDmaIsAvailable (
  29. VOID
  30. );
  31. /**
  32. Transfer an array of bytes, or skip a number of bytes, using the DMA
  33. interface.
  34. @param[in] Size Size in bytes to transfer or skip.
  35. @param[in,out] Buffer Buffer to read data into or write data from. Ignored,
  36. and may be NULL, if Size is zero, or Control is
  37. FW_CFG_DMA_CTL_SKIP.
  38. @param[in] Control One of the following:
  39. FW_CFG_DMA_CTL_WRITE - write to fw_cfg from Buffer.
  40. FW_CFG_DMA_CTL_READ - read from fw_cfg into Buffer.
  41. FW_CFG_DMA_CTL_SKIP - skip bytes in fw_cfg.
  42. **/
  43. VOID
  44. InternalQemuFwCfgDmaBytes (
  45. IN UINT32 Size,
  46. IN OUT VOID *Buffer OPTIONAL,
  47. IN UINT32 Control
  48. );
  49. #endif // QEMU_FW_CFG_LIB_INTERNAL_H_