Home | History | Annotate | Download | only in Library
      1 /** @file
      2 
      3   Definitions for the VirtIo MMIO Device Library
      4 
      5   Copyright (C) 2013, ARM Ltd
      6 
      7   This program and the accompanying materials are licensed and made available
      8   under the terms and conditions of the BSD License which accompanies this
      9   distribution. The full text of the license may be found at
     10   http://opensource.org/licenses/bsd-license.php
     11 
     12   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
     13   WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     14 
     15 **/
     16 
     17 #ifndef _VIRTIO_MMIO_DEVICE_LIB_H_
     18 #define _VIRTIO_MMIO_DEVICE_LIB_H_
     19 
     20 /**
     21 
     22   Initialize VirtIo Device and Install VIRTIO_DEVICE_PROTOCOL protocol
     23 
     24   @param[in] BaseAddress  Base Address of the VirtIo MMIO Device
     25 
     26   @param[in] Handle       Handle of the device the driver should be attached
     27                           to.
     28 
     29   @retval EFI_SUCCESS           The VirtIo Device has been installed
     30                                 successfully.
     31 
     32   @retval EFI_OUT_OF_RESOURCES  The function failed to allocate memory required
     33                                 by the Virtio MMIO device initialization.
     34 
     35   @retval EFI_UNSUPPORTED       BaseAddress does not point to a VirtIo MMIO
     36                                 device.
     37 
     38   @return                       Status code returned by InstallProtocolInterface
     39                                 Boot Service function.
     40 
     41 **/
     42 EFI_STATUS
     43 VirtioMmioInstallDevice (
     44   IN PHYSICAL_ADDRESS       BaseAddress,
     45   IN EFI_HANDLE             Handle
     46   );
     47 
     48 /**
     49 
     50   Uninstall the VirtIo Device
     51 
     52   @param[in] Handle       Handle of the device where the VirtIo Device protocol
     53                           should have been installed.
     54 
     55   @retval EFI_SUCCESS     The device has been un-initialized successfully.
     56 
     57   @return                 Status code returned by UninstallProtocolInterface
     58                           Boot Service function.
     59 
     60 **/
     61 EFI_STATUS
     62 VirtioMmioUninstallDevice (
     63   IN EFI_HANDLE             Handle
     64   );
     65 
     66 #endif // _VIRTIO_MMIO_DEVICE_LIB_H_
     67