diff options
author | Edgar E. Iglesias <edgar.iglesias@petalogix.com> | 2011-03-14 11:13:55 +0100 |
---|---|---|
committer | Edgar E. Iglesias <edgar.iglesias@petalogix.com> | 2011-03-16 15:18:58 +0100 |
commit | 93f1e4016b5e09a55d6f67fdfab37f80feb0ac29 (patch) | |
tree | 121f38e314a6f89ac2f49a166b2e828a4dc6a4be /hw/xilinx_axidma.h | |
parent | d746ce6dbaa91766e473f6fff82dfbd88ba3f86d (diff) |
xilinx: Add AXIENET & DMA models
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
Diffstat (limited to 'hw/xilinx_axidma.h')
-rw-r--r-- | hw/xilinx_axidma.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/hw/xilinx_axidma.h b/hw/xilinx_axidma.h new file mode 100644 index 0000000000..37cb6f0911 --- /dev/null +++ b/hw/xilinx_axidma.h @@ -0,0 +1,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); +} + |