VirtioRng.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /** @file
  2. Private definitions of the VirtioRng RNG driver
  3. Copyright (C) 2016, Linaro Ltd.
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef _VIRTIO_RNG_DXE_H_
  7. #define _VIRTIO_RNG_DXE_H_
  8. #include <Protocol/ComponentName.h>
  9. #include <Protocol/DriverBinding.h>
  10. #include <Protocol/Rng.h>
  11. #include <IndustryStandard/Virtio.h>
  12. #define VIRTIO_RNG_SIG SIGNATURE_32 ('V', 'R', 'N', 'G')
  13. typedef struct {
  14. //
  15. // Parts of this structure are initialized / torn down in various functions
  16. // at various call depths. The table to the right should make it easier to
  17. // track them.
  18. //
  19. // field init function init depth
  20. // ---------------- ------------------ ----------
  21. UINT32 Signature; // DriverBindingStart 0
  22. VIRTIO_DEVICE_PROTOCOL *VirtIo; // DriverBindingStart 0
  23. EFI_EVENT ExitBoot; // DriverBindingStart 0
  24. VRING Ring; // VirtioRingInit 2
  25. EFI_RNG_PROTOCOL Rng; // VirtioRngInit 1
  26. VOID *RingMap; // VirtioRingMap 2
  27. } VIRTIO_RNG_DEV;
  28. #define VIRTIO_ENTROPY_SOURCE_FROM_RNG(RngPointer) \
  29. CR (RngPointer, VIRTIO_RNG_DEV, Rng, VIRTIO_RNG_SIG)
  30. #endif