| 1 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 2 | // File     : drivers.h | 
|---|
| 3 | // Date     : 01/04/2012 | 
|---|
| 4 | // Author   : alain greiner and joel porquet | 
|---|
| 5 | // Copyright (c) UPMC-LIP6 | 
|---|
| 6 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 7 |  | 
|---|
| 8 | #ifndef _GIET_SYS_DRIVERS_H_ | 
|---|
| 9 | #define _GIET_SYS_DRIVERS_H_ | 
|---|
| 10 |  | 
|---|
| 11 |  | 
|---|
| 12 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 13 | // Timer access functions (used for both vci_multi_timer and vci_xicu) | 
|---|
| 14 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 15 |  | 
|---|
| 16 | extern volatile unsigned char _timer_event[]; | 
|---|
| 17 |  | 
|---|
| 18 | unsigned int _timer_start(unsigned int cluster_id, unsigned int local_id, unsigned int period); | 
|---|
| 19 | unsigned int _timer_stop(unsigned int cluster_id, unsigned int local_id); | 
|---|
| 20 | unsigned int _timer_reset_irq(unsigned int cluster_id, unsigned int local_id); | 
|---|
| 21 | unsigned int _timer_reset_irq_cpt(unsigned int cluster_id, unsigned int local_id); | 
|---|
| 22 |  | 
|---|
| 23 |  | 
|---|
| 24 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 25 | // TTY access functions and variables | 
|---|
| 26 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 27 |  | 
|---|
| 28 | extern volatile unsigned char _tty_get_buf[]; | 
|---|
| 29 | extern volatile unsigned char _tty_get_full[]; | 
|---|
| 30 | extern unsigned int _tty_put_lock; | 
|---|
| 31 |  | 
|---|
| 32 | unsigned int _tty_write(const char * buffer, unsigned int length); | 
|---|
| 33 | unsigned int _tty_read(char * buffer, unsigned int length); | 
|---|
| 34 | unsigned int _tty_get_char(unsigned int tty_id, unsigned char * buffer); | 
|---|
| 35 |  | 
|---|
| 36 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 37 | // ICU access functions (both vci_multi_icu and vci_xicu) | 
|---|
| 38 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 39 |  | 
|---|
| 40 | unsigned int _icu_get_index(unsigned int cluster_id, unsigned int proc_id, unsigned int * buffer); | 
|---|
| 41 | unsigned int _icu_set_mask( | 
|---|
| 42 | unsigned int cluster_id, | 
|---|
| 43 | unsigned int proc_id, | 
|---|
| 44 | unsigned int mask, | 
|---|
| 45 | unsigned int is_timer); | 
|---|
| 46 |  | 
|---|
| 47 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 48 | // IOC access functions and variables (vci_block_device) | 
|---|
| 49 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 50 |  | 
|---|
| 51 | extern volatile unsigned int _ioc_status; | 
|---|
| 52 | extern volatile unsigned int _ioc_done; | 
|---|
| 53 | extern unsigned int _ioc_lock; | 
|---|
| 54 | extern unsigned int _ioc_iommu_ix1; | 
|---|
| 55 | extern unsigned int _ioc_iommu_npages; | 
|---|
| 56 |  | 
|---|
| 57 |  | 
|---|
| 58 | unsigned int _ioc_write(unsigned int lba, const void * buffer, unsigned int count); | 
|---|
| 59 | unsigned int _ioc_read(unsigned int lba, void * buffer, unsigned int count); | 
|---|
| 60 | unsigned int _ioc_completed(); | 
|---|
| 61 | unsigned int _ioc_get_status(unsigned int * status); | 
|---|
| 62 |  | 
|---|
| 63 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 64 | // Multi DMA variables            (vci_multi_dma) | 
|---|
| 65 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 66 |  | 
|---|
| 67 | extern volatile unsigned int _dma_status[]; | 
|---|
| 68 | extern volatile unsigned int _dma_done[]; | 
|---|
| 69 | extern unsigned int _dma_lock[]; | 
|---|
| 70 | extern unsigned int _dma_iommu_ix1; | 
|---|
| 71 | extern unsigned int _dma_iommu_npages[]; | 
|---|
| 72 |  | 
|---|
| 73 | unsigned int _dma_reset_irq(unsigned int cluster_id, unsigned int local_id); | 
|---|
| 74 | unsigned int _dma_get_status(unsigned int cluster_id, unsigned int local_id, unsigned int * status); | 
|---|
| 75 |  | 
|---|
| 76 | unsigned int _dma_transfer( | 
|---|
| 77 | unsigned int dev_type, | 
|---|
| 78 | unsigned int to_user, | 
|---|
| 79 | unsigned int offset, | 
|---|
| 80 | unsigned int user_vaddr, | 
|---|
| 81 | unsigned int length); | 
|---|
| 82 |  | 
|---|
| 83 | unsigned int _dma_completed(); | 
|---|
| 84 |  | 
|---|
| 85 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 86 | // Frame Buffer access functions  (vci_frame_buffer) | 
|---|
| 87 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 88 |  | 
|---|
| 89 | unsigned int _fb_sync_write(unsigned int offset, const void * buffer, unsigned int length); | 
|---|
| 90 | unsigned int _fb_sync_read( unsigned int offset, const void * buffer, unsigned int length); | 
|---|
| 91 | unsigned int _fb_write(     unsigned int offset, const void * buffer, unsigned int length); | 
|---|
| 92 | unsigned int _fb_read(      unsigned int offset, const void * buffer, unsigned int length); | 
|---|
| 93 |  | 
|---|
| 94 | unsigned int _fb_completed(); | 
|---|
| 95 |  | 
|---|
| 96 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 97 | // NIC device access functions  (vci_multi_nic) | 
|---|
| 98 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 99 |  | 
|---|
| 100 | unsigned int _nic_sync_write(unsigned int offset, const void * buffer, unsigned int length); | 
|---|
| 101 | unsigned int _nic_sync_read( unsigned int offset, const void * buffer, unsigned int length); | 
|---|
| 102 | unsigned int _nic_write(     unsigned int offset, const void * buffer, unsigned int length); | 
|---|
| 103 | unsigned int _nic_read(      unsigned int offset, const void * buffer, unsigned int length); | 
|---|
| 104 |  | 
|---|
| 105 | unsigned int _nic_completed(); | 
|---|
| 106 |  | 
|---|
| 107 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 108 | // GCD access functions | 
|---|
| 109 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 110 |  | 
|---|
| 111 | unsigned int _gcd_write(unsigned int register_index, unsigned int   value); | 
|---|
| 112 | unsigned int _gcd_read( unsigned int register_index, unsigned int * buffer); | 
|---|
| 113 |  | 
|---|
| 114 |  | 
|---|
| 115 | #endif | 
|---|
| 116 |  | 
|---|
| 117 | // Local Variables: | 
|---|
| 118 | // tab-width: 4 | 
|---|
| 119 | // c-basic-offset: 4 | 
|---|
| 120 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) | 
|---|
| 121 | // indent-tabs-mode: nil | 
|---|
| 122 | // End: | 
|---|
| 123 | // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 | 
|---|
| 124 |  | 
|---|