TianoCore EDK2 master
Loading...
Searching...
No Matches
VirtioMmioDevice.c File Reference

Go to the source code of this file.

Functions

STATIC EFI_STATUS EFIAPI VirtioMmioInit (IN PHYSICAL_ADDRESS BaseAddress, IN OUT VIRTIO_MMIO_DEVICE *Device)
 
STATIC VOID EFIAPI VirtioMmioUninit (IN VIRTIO_MMIO_DEVICE *Device)
 
EFI_STATUS VirtioMmioInstallDevice (IN PHYSICAL_ADDRESS BaseAddress, IN EFI_HANDLE Handle)
 
EFI_STATUS VirtioMmioUninstallDevice (IN EFI_HANDLE DeviceHandle)
 

Variables

STATIC CONST VIRTIO_DEVICE_PROTOCOL mMmioDeviceProtocolTemplate
 

Detailed Description

This driver produces Virtio Device Protocol instances for Virtio Mmio devices.

Copyright (C) 2013, ARM Ltd. Copyright (C) 2017, AMD Inc. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file VirtioMmioDevice.c.

Function Documentation

◆ VirtioMmioInit()

STATIC EFI_STATUS EFIAPI VirtioMmioInit ( IN PHYSICAL_ADDRESS  BaseAddress,
IN OUT VIRTIO_MMIO_DEVICE Device 
)

Initialize the VirtIo MMIO Device

Parameters
[in]BaseAddressBase Address of the VirtIo MMIO Device
[in,out]DeviceThe driver instance to configure.
Return values
EFI_SUCCESSSetup complete.
EFI_UNSUPPORTEDThe driver is not a VirtIo MMIO device.

Definition at line 55 of file VirtioMmioDevice.c.

◆ VirtioMmioInstallDevice()

EFI_STATUS VirtioMmioInstallDevice ( IN PHYSICAL_ADDRESS  BaseAddress,
IN EFI_HANDLE  Handle 
)

Initialize VirtIo Device and Install VIRTIO_DEVICE_PROTOCOL protocol

Parameters
[in]BaseAddressBase Address of the VirtIo MMIO Device
[in]HandleHandle of the device the driver should be attached to.
Return values
EFI_SUCCESSThe VirtIo Device has been installed successfully.
EFI_OUT_OF_RESOURCESThe function failed to allocate memory required by the Virtio MMIO device initialization.
EFI_UNSUPPORTEDBaseAddress does not point to a VirtIo MMIO device.
Returns
Status code returned by InstallProtocolInterface Boot Service function.

Definition at line 131 of file VirtioMmioDevice.c.

◆ VirtioMmioUninit()

STATIC VOID EFIAPI VirtioMmioUninit ( IN VIRTIO_MMIO_DEVICE Device)

Uninitialize the internals of a virtio-mmio device that has been successfully set up with VirtioMmioInit().

Parameters
[in,out]DeviceThe device to clean up.

Definition at line 120 of file VirtioMmioDevice.c.

◆ VirtioMmioUninstallDevice()

EFI_STATUS VirtioMmioUninstallDevice ( IN EFI_HANDLE  Handle)

Uninstall the VirtIo Device

Parameters
[in]HandleHandle of the device where the VirtIo Device protocol should have been installed.
Return values
EFI_SUCCESSThe device has been un-initialized successfully.
Returns
Status code returned by UninstallProtocolInterface Boot Service function.

Definition at line 186 of file VirtioMmioDevice.c.

Variable Documentation

◆ mMmioDeviceProtocolTemplate

STATIC CONST VIRTIO_DEVICE_PROTOCOL mMmioDeviceProtocolTemplate
Initial value:
= {
0,
0,
VirtioMmioGetDeviceFeatures,
VirtioMmioSetGuestFeatures,
VirtioMmioSetQueueAddress,
VirtioMmioSetQueueSel,
VirtioMmioSetQueueNotify,
VirtioMmioSetQueueAlignment,
VirtioMmioSetPageSize,
VirtioMmioGetQueueSize,
VirtioMmioSetQueueSize,
VirtioMmioGetDeviceStatus,
VirtioMmioSetDeviceStatus,
VirtioMmioDeviceWrite,
VirtioMmioDeviceRead,
VirtioMmioAllocateSharedPages,
VirtioMmioFreeSharedPages,
VirtioMmioMapSharedBuffer,
VirtioMmioUnmapSharedBuffer
}

Definition at line 17 of file VirtioMmioDevice.c.