[158] | 1 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 2 | // File : drivers.h |
---|
| 3 | // Date : 01/04/2012 |
---|
| 4 | // Author : alain greiner and joel porquet |
---|
| 5 | // Copyright (c) UPMC-LIP6 |
---|
| 6 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 7 | |
---|
[165] | 8 | #ifndef _GIET_SYS_DRIVERS_H_ |
---|
| 9 | #define _GIET_SYS_DRIVERS_H_ |
---|
[158] | 10 | |
---|
[218] | 11 | |
---|
[158] | 12 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[189] | 13 | // Timer access functions (used for both vci_multi_timer and vci_xicu) |
---|
[158] | 14 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 15 | |
---|
[189] | 16 | extern volatile unsigned char _timer_event[]; |
---|
[158] | 17 | |
---|
[203] | 18 | unsigned int _timer_start( unsigned int cluster_id, |
---|
| 19 | unsigned int local_id, |
---|
| 20 | unsigned int period ); |
---|
[158] | 21 | |
---|
[203] | 22 | unsigned int _timer_stop( unsigned int cluster_id, |
---|
| 23 | unsigned int local_id ); |
---|
[189] | 24 | |
---|
| 25 | |
---|
[203] | 26 | unsigned int _timer_reset_irq( unsigned int cluster_id, |
---|
| 27 | unsigned int local_id ); |
---|
| 28 | |
---|
[189] | 29 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 30 | // TTY access functions and variables |
---|
| 31 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 32 | |
---|
[158] | 33 | extern volatile unsigned char _tty_get_buf[]; |
---|
| 34 | extern volatile unsigned char _tty_get_full[]; |
---|
[165] | 35 | extern unsigned int _tty_put_lock; |
---|
[158] | 36 | |
---|
[189] | 37 | unsigned int _tty_write( const char* buffer, |
---|
| 38 | unsigned int length); |
---|
[158] | 39 | |
---|
[189] | 40 | unsigned int _tty_read( char* buffer, |
---|
| 41 | unsigned int length); |
---|
[158] | 42 | |
---|
[204] | 43 | unsigned int _tty_get_char( unsigned int tty_id, |
---|
[207] | 44 | unsigned char* buffer); |
---|
[158] | 45 | |
---|
[189] | 46 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 47 | // ICU access functions (both vci_multi_icu and vci_xicu) |
---|
| 48 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[165] | 49 | |
---|
[203] | 50 | unsigned int _icu_get_index(unsigned int cluster_id, |
---|
[165] | 51 | unsigned int proc_id, |
---|
[203] | 52 | unsigned int* buffer ); |
---|
[165] | 53 | |
---|
[203] | 54 | unsigned int _icu_set_mask( unsigned int cluster_id, |
---|
[189] | 55 | unsigned int proc_id, |
---|
[203] | 56 | unsigned int mask, |
---|
| 57 | unsigned int is_timer ); |
---|
[165] | 58 | |
---|
[189] | 59 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 60 | // IOC access functions and variables (vci_block_device) |
---|
| 61 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[165] | 62 | |
---|
[189] | 63 | extern volatile unsigned int _ioc_status; |
---|
| 64 | extern volatile unsigned int _ioc_done; |
---|
| 65 | extern unsigned int _ioc_lock; |
---|
| 66 | extern unsigned int _ioc_iommu_ix1; |
---|
| 67 | extern unsigned int _ioc_iommu_npages; |
---|
[165] | 68 | |
---|
[189] | 69 | |
---|
[165] | 70 | unsigned int _ioc_write( unsigned int lba, |
---|
| 71 | const void* buffer, |
---|
| 72 | unsigned int count); |
---|
| 73 | |
---|
| 74 | unsigned int _ioc_read( unsigned int lba, |
---|
| 75 | void* buffer, |
---|
| 76 | unsigned int count); |
---|
| 77 | |
---|
[158] | 78 | unsigned int _ioc_completed(); |
---|
| 79 | |
---|
[204] | 80 | unsigned int _ioc_get_status( unsigned int* status); |
---|
| 81 | |
---|
[189] | 82 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 83 | // Multi DMA variables (vci_multi_dma) |
---|
| 84 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 85 | |
---|
| 86 | extern volatile unsigned int _dma_status[]; |
---|
| 87 | extern volatile unsigned int _dma_done[]; |
---|
| 88 | extern unsigned int _dma_lock[]; |
---|
| 89 | extern unsigned int _dma_iommu_ix1; |
---|
| 90 | extern unsigned int _dma_iommu_npages[]; |
---|
[158] | 91 | |
---|
[204] | 92 | unsigned int _dma_reset_irq( unsigned int cluster_id, |
---|
| 93 | unsigned int local_id ); |
---|
| 94 | |
---|
| 95 | unsigned int _dma_get_status( unsigned int cluster_id, |
---|
| 96 | unsigned int local_id, |
---|
| 97 | unsigned int* status ); |
---|
| 98 | |
---|
[218] | 99 | unsigned int _dma_transfer( unsigned int dev_type, |
---|
| 100 | unsigned int to_user, |
---|
| 101 | unsigned int offset, |
---|
| 102 | unsigned int user_vaddr, |
---|
| 103 | unsigned int length ); |
---|
| 104 | |
---|
| 105 | unsigned int _dma_completed(); |
---|
| 106 | |
---|
[189] | 107 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 108 | // Frame Buffer access functions (vci_frame_buffer) |
---|
| 109 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 110 | |
---|
[165] | 111 | unsigned int _fb_sync_write(unsigned int offset, |
---|
| 112 | const void* buffer, |
---|
| 113 | unsigned int length); |
---|
| 114 | |
---|
| 115 | unsigned int _fb_sync_read( unsigned int offset, |
---|
| 116 | const void* buffer, |
---|
| 117 | unsigned int length); |
---|
| 118 | |
---|
| 119 | unsigned int _fb_write( unsigned int offset, |
---|
| 120 | const void* buffer, |
---|
| 121 | unsigned int length); |
---|
| 122 | |
---|
| 123 | unsigned int _fb_read( unsigned int offset, |
---|
| 124 | const void* buffer, |
---|
| 125 | unsigned int length); |
---|
| 126 | |
---|
[158] | 127 | unsigned int _fb_completed(); |
---|
| 128 | |
---|
[189] | 129 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[218] | 130 | // NIC device access functions (vci_multi_nic) |
---|
| 131 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 132 | |
---|
| 133 | unsigned int _nic_sync_write(unsigned int offset, |
---|
| 134 | const void* buffer, |
---|
| 135 | unsigned int length); |
---|
| 136 | |
---|
| 137 | unsigned int _nic_sync_read( unsigned int offset, |
---|
| 138 | const void* buffer, |
---|
| 139 | unsigned int length); |
---|
| 140 | |
---|
| 141 | |
---|
| 142 | unsigned int _nic_write( unsigned int offset, |
---|
| 143 | const void* buffer, |
---|
| 144 | unsigned int length); |
---|
| 145 | |
---|
| 146 | unsigned int _nic_read( unsigned int offset, |
---|
| 147 | const void* buffer, |
---|
| 148 | unsigned int length); |
---|
| 149 | |
---|
| 150 | unsigned int _nic_completed(); |
---|
| 151 | |
---|
| 152 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[189] | 153 | // GCD access functions |
---|
| 154 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 155 | |
---|
| 156 | unsigned int _gcd_write( unsigned int register_index, |
---|
| 157 | unsigned int value); |
---|
| 158 | |
---|
| 159 | unsigned int _gcd_read( unsigned int register_index, |
---|
| 160 | unsigned int* buffer); |
---|
| 161 | |
---|
| 162 | |
---|
[158] | 163 | #endif |
---|
| 164 | |
---|