Files
system76-edk2/OvmfPkg/VirtioRngDxe/VirtioRng.h
Brijesh Singh 0a568ccbcb OvmfPkg/VirtioRngDxe: map host address to device address
patch maps the host address to a device address for buffers (including
rings, device specifc request and response pointed by vring descriptor,
and any further memory reference by those request and response).

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
[lersek@redhat.com: return EFI_DEVICE_ERROR if mapping fails in GetRNG]
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
2017-08-25 10:42:19 +02:00

48 lines
1.7 KiB
C

/** @file
Private definitions of the VirtioRng RNG driver
Copyright (C) 2016, Linaro Ltd.
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _VIRTIO_RNG_DXE_H_
#define _VIRTIO_RNG_DXE_H_
#include <Protocol/ComponentName.h>
#include <Protocol/DriverBinding.h>
#include <Protocol/Rng.h>
#include <IndustryStandard/Virtio.h>
#define VIRTIO_RNG_SIG SIGNATURE_32 ('V', 'R', 'N', 'G')
typedef struct {
//
// Parts of this structure are initialized / torn down in various functions
// at various call depths. The table to the right should make it easier to
// track them.
//
// field init function init depth
// ---------------- ------------------ ----------
UINT32 Signature; // DriverBindingStart 0
VIRTIO_DEVICE_PROTOCOL *VirtIo; // DriverBindingStart 0
EFI_EVENT ExitBoot; // DriverBindingStart 0
VRING Ring; // VirtioRingInit 2
EFI_RNG_PROTOCOL Rng; // VirtioRngInit 1
VOID *RingMap; // VirtioRingMap 2
} VIRTIO_RNG_DEV;
#define VIRTIO_ENTROPY_SOURCE_FROM_RNG(RngPointer) \
CR (RngPointer, VIRTIO_RNG_DEV, Rng, VIRTIO_RNG_SIG)
#endif