~ubuntu-branches/ubuntu/wily/qemu-kvm-spice/wily

« back to all changes in this revision

Viewing changes to hw/xilinx_axidma.h

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-10-19 10:44:56 UTC
  • Revision ID: james.westby@ubuntu.com-20111019104456-xgvskumk3sxi97f4
Tags: upstream-0.15.0+noroms
ImportĀ upstreamĀ versionĀ 0.15.0+noroms

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* AXI DMA connection. Used until qdev provides a generic way.  */
 
2
typedef void (*DMAPushFn)(void *opaque,
 
3
                            unsigned char *buf, size_t len, uint32_t *app);
 
4
 
 
5
struct XilinxDMAConnection {
 
6
    void *dma;
 
7
    void *client;
 
8
 
 
9
    DMAPushFn to_dma;
 
10
    DMAPushFn to_client;
 
11
};
 
12
 
 
13
static inline void xlx_dma_connect_client(struct XilinxDMAConnection *dmach,
 
14
                                          void *c, DMAPushFn f)
 
15
{
 
16
    dmach->client = c;
 
17
    dmach->to_client = f;
 
18
}
 
19
 
 
20
static inline void xlx_dma_connect_dma(struct XilinxDMAConnection *dmach,
 
21
                                       void *d, DMAPushFn f)
 
22
{
 
23
    dmach->dma = d;
 
24
    dmach->to_dma = f;
 
25
}
 
26
 
 
27
static inline
 
28
void xlx_dma_push_to_dma(struct XilinxDMAConnection *dmach,
 
29
                         uint8_t *buf, size_t len, uint32_t *app)
 
30
{
 
31
    dmach->to_dma(dmach->dma, buf, len, app);
 
32
}
 
33
static inline
 
34
void xlx_dma_push_to_client(struct XilinxDMAConnection *dmach,
 
35
                            uint8_t *buf, size_t len, uint32_t *app)
 
36
{
 
37
    dmach->to_client(dmach->client, buf, len, app);
 
38
}
 
39