File: xilinx_axidma.h

package info (click to toggle)
qemu-kvm 1.1.2%2Bdfsg-6%2Bdeb7u12
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 43,848 kB
  • sloc: ansic: 606,321; asm: 10,684; sh: 6,663; perl: 4,223; python: 3,802; makefile: 1,076; objc: 843; xml: 409
file content (39 lines) | stat: -rw-r--r-- 1,069 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* AXI DMA connection. Used until qdev provides a generic way.  */
typedef void (*DMAPushFn)(void *opaque,
                            unsigned char *buf, size_t len, uint32_t *app);

struct XilinxDMAConnection {
    void *dma;
    void *client;

    DMAPushFn to_dma;
    DMAPushFn to_client;
};

static inline void xlx_dma_connect_client(struct XilinxDMAConnection *dmach,
                                          void *c, DMAPushFn f)
{
    dmach->client = c;
    dmach->to_client = f;
}

static inline void xlx_dma_connect_dma(struct XilinxDMAConnection *dmach,
                                       void *d, DMAPushFn f)
{
    dmach->dma = d;
    dmach->to_dma = f;
}

static inline
void xlx_dma_push_to_dma(struct XilinxDMAConnection *dmach,
                         uint8_t *buf, size_t len, uint32_t *app)
{
    dmach->to_dma(dmach->dma, buf, len, app);
}
static inline
void xlx_dma_push_to_client(struct XilinxDMAConnection *dmach,
                            uint8_t *buf, size_t len, uint32_t *app)
{
    dmach->to_client(dmach->client, buf, len, app);
}