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