/////////////////////////////////////////////////////////////////////////////////// // File : drivers.h // Date : 01/04/2012 // Author : alain greiner and joel porquet // Copyright (c) UPMC-LIP6 /////////////////////////////////////////////////////////////////////////////////// #ifndef _GIET_SYS_DRIVERS_H_ #define _GIET_SYS_DRIVERS_H_ /////////////////////////////////////////////////////////////////////////////////// // Timer access functions (used for both vci_multi_timer and vci_xicu) /////////////////////////////////////////////////////////////////////////////////// extern volatile unsigned char _timer_event[]; unsigned int _timer_start(unsigned int cluster_id, unsigned int local_id, unsigned int period); unsigned int _timer_stop(unsigned int cluster_id, unsigned int local_id); unsigned int _timer_reset_irq(unsigned int cluster_id, unsigned int local_id); unsigned int _timer_reset_irq_cpt(unsigned int cluster_id, unsigned int local_id); /////////////////////////////////////////////////////////////////////////////////// // TTY access functions and variables /////////////////////////////////////////////////////////////////////////////////// extern volatile unsigned char _tty_get_buf[]; extern volatile unsigned char _tty_get_full[]; extern unsigned int _tty_put_lock; unsigned int _tty_write(const char * buffer, unsigned int length); unsigned int _tty_read(char * buffer, unsigned int length); unsigned int _tty_get_char(unsigned int tty_id, unsigned char * buffer); /////////////////////////////////////////////////////////////////////////////////// // ICU access functions (both vci_multi_icu and vci_xicu) /////////////////////////////////////////////////////////////////////////////////// unsigned int _icu_get_index(unsigned int cluster_id, unsigned int proc_id, unsigned int * buffer); unsigned int _icu_set_mask( unsigned int cluster_id, unsigned int proc_id, unsigned int mask, unsigned int is_timer); /////////////////////////////////////////////////////////////////////////////////// // IOC access functions and variables (vci_block_device) /////////////////////////////////////////////////////////////////////////////////// extern volatile unsigned int _ioc_status; extern volatile unsigned int _ioc_done; extern unsigned int _ioc_lock; extern unsigned int _ioc_iommu_ix1; extern unsigned int _ioc_iommu_npages; unsigned int _ioc_write(unsigned int lba, const void * buffer, unsigned int count); unsigned int _ioc_read(unsigned int lba, void * buffer, unsigned int count); unsigned int _ioc_completed(); unsigned int _ioc_get_status(unsigned int * status); unsigned int _ioc_get_block_size(); /////////////////////////////////////////////////////////////////////////////////// // Multi DMA variables and access functions (vci_multi_dma) /////////////////////////////////////////////////////////////////////////////////// extern volatile unsigned int _dma_status[]; extern volatile unsigned int _dma_done[]; extern unsigned int _dma_lock[]; extern unsigned int _dma_iommu_ix1; extern unsigned int _dma_iommu_npages[]; unsigned int _dma_reset_irq(unsigned int cluster_id, unsigned int local_id); unsigned int _dma_get_status(unsigned int cluster_id, unsigned int local_id, unsigned int * status); unsigned int _dma_transfer( unsigned int dev_type, unsigned int to_user, unsigned int offset, unsigned int user_vaddr, unsigned int length ); unsigned int _dma_completed(); /////////////////////////////////////////////////////////////////////////////////// // Frame Buffer access functions (vci_frame_buffer) /////////////////////////////////////////////////////////////////////////////////// unsigned int _fb_sync_write( unsigned int offset, const void * buffer, unsigned int length); unsigned int _fb_sync_read( unsigned int offset, const void * buffer, unsigned int length); unsigned int _fb_dma_write( unsigned int offset, const void * buffer, unsigned int length); unsigned int _fb_dma_read( unsigned int offset, const void * buffer, unsigned int length); unsigned int _fb_dma_completed(); unsigned int _fb_cma_init( const void* vbase0, const void* vbase1, unsigned int length ); unsigned int _fb_cma_write( unsigned int buffer_id ); unsigned int _fb_cma_stop(); /////////////////////////////////////////////////////////////////////////////////// // NIC device access functions (vci_multi_nic) /////////////////////////////////////////////////////////////////////////////////// unsigned int _nic_sync_write( const void* buffer, unsigned int length); unsigned int _nic_sync_read( const void* buffer, unsigned int length); unsigned int _nic_cma_rx_init( const void* buf0, const void* buf1, unsigned int length ); unsigned int _nic_cma_tx_init( const void* buf0, const void* buf1, unsigned int length ); unsigned int _nic_cma_stop(); /////////////////////////////////////////////////////////////////////////////////// // GCD access functions /////////////////////////////////////////////////////////////////////////////////// unsigned int _gcd_write(unsigned int register_index, unsigned int value); unsigned int _gcd_read( unsigned int register_index, unsigned int * buffer); /////////////////////////////////////////////////////////////////////////////////// // MEMC access functions /////////////////////////////////////////////////////////////////////////////////// void _memc_inval( unsigned long long buf_paddr, unsigned int buf_length); void _memc_sync( unsigned long long buf_paddr, unsigned int buf_length); /////////////////////////////////////////////////////////////////////////////////// // Heap related function(s) /////////////////////////////////////////////////////////////////////////////////// unsigned int _heap_info(unsigned int * vaddr, unsigned int * size); #endif // Local Variables: // tab-width: 4 // c-basic-offset: 4 // c-file-offsets:((innamespace . 0)(inline-open . 0)) // indent-tabs-mode: nil // End: // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4