qemu/hw/dma/xilinx_dpdma.h
<<
>>
Prefs
   1/*
   2 * xilinx_dpdma.h
   3 *
   4 *  Copyright (C) 2015 : GreenSocs Ltd
   5 *      http://www.greensocs.com/ , email: info@greensocs.com
   6 *
   7 *  Developed by :
   8 *  Frederic Konrad   <fred.konrad@greensocs.com>
   9 *
  10 * This program is free software; you can redistribute it and/or modify
  11 * it under the terms of the GNU General Public License as published by
  12 * the Free Software Foundation, either version 2 of the License, or
  13 * (at your option) any later version.
  14 *
  15 * This program is distributed in the hope that it will be useful,
  16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18 * GNU General Public License for more details.
  19 *
  20 * You should have received a copy of the GNU General Public License along
  21 * with this program; if not, see <http://www.gnu.org/licenses/>.
  22 *
  23 */
  24
  25#ifndef XILINX_DPDMA_H
  26#define XILINX_DPDMA_H
  27
  28#include "hw/sysbus.h"
  29#include "ui/console.h"
  30#include "sysemu/dma.h"
  31
  32typedef struct XilinxDPDMAState XilinxDPDMAState;
  33
  34#define TYPE_XILINX_DPDMA "xlnx.dpdma"
  35#define XILINX_DPDMA(obj) OBJECT_CHECK(XilinxDPDMAState, (obj),                \
  36                                       TYPE_XILINX_DPDMA)
  37
  38/*
  39 * \func xilinx_dpdma_start_operation.
  40 * \brief Start the operation on the specified channel. The DPDMA get the
  41 *        current descriptor and retrieve data to the buffer specified by
  42 *        dpdma_set_host_data_location.
  43 * \arg s The DPDMA instance.
  44 * \arg channel The channel to start.
  45 * \return false if the channel is disabled or if an error occured, true
  46 *         otherwise.
  47 */
  48bool xilinx_dpdma_start_operation(XilinxDPDMAState *s, uint8_t channel);
  49
  50/*
  51 * \func xilinx_dpdma_set_host_data_location.
  52 * \brief Set the location in the host memory where to store the data out from
  53 *        the dma channel.
  54 * \arg s The DPDMA instance.
  55 * \arg channel The channel associated to the pointer.
  56 * \arg p The buffer where to store the data.
  57 */
  58/* XXX: add a maximum size arg and send an interrupt in case of overflow. */
  59void xilinx_dpdma_set_host_data_location(XilinxDPDMAState *s, uint8_t channel,
  60                                         void *p);
  61
  62#endif /* !XILINX_DPDMA_H */
  63