= GIET-VM / CMA Driver = [[PageOutline]] The [source:soft/giet_vm/giet_drivers/cma_driver.c cma_driver.c] and [source:soft/giet_vm/giet_drivers/cma_driver.h cma_driver.h] files define the CMA driver. It supports the SOCLIB ''vci_chbuf_dma'' component, that is a multi channels, chained buffer DMA controller. This component can be used in conjonction with the SOCLIB ''vci_frame_buffer'' to display images, or with the SOCLIB ''vci_multi_nic'' controller to transfer RX or TX packets between NIC buffers and memory buffers. The SEG_CMA_BASE address must be defined in the hard_config.h file. The addressable registers map is defined [source:soft/giet_vm/giet_drivers/cma_driver.h here]. === unsigned int '''_cma_get_register'''( unsigned int channel, unsigned int index ) === This low_level function returns the value contained in register (index). === void '''_cma_set_register'''( unsigned int channel, unsigned int index, unsigned int value ) === This low_level function returns the value contained in register (index). === void '''_cma_start_channel'''( unsigned int channel, unsigned long long src_paddr, unsigned int src_nbufs, unsigned long long dst_paddr, unsigned int dst_nbufs, unsigned int buf_length ) === This function activates a chained buffer DMA channel. * channel : CMA channel index. * src_paddr : physical address of the source chbuf. * src_nbufs : number of buffers in the source chbuf. * dst_paddr : physical address of the destination chbuf. * dst_nbufs : number of buffers in the destination chbuf. * buf_length : single buffer length (bytes) * s === void '''_cma_stop_channel( unsigned int channel ) This function desactivates a chained buffer DMA channel. * channel : CMA channel index. === void '''_cma_isr'''( unsigned int irq_type, unsigned int irq_id, unsigned int channel ) === This Interrupt Service Routine handles the IRQ generated by a CMA channel.