[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 | |
---|
[228] | 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); |
---|
[246] | 21 | unsigned int _timer_reset_irq_cpt(unsigned int cluster_id, unsigned int local_id); |
---|
[158] | 22 | |
---|
[189] | 23 | |
---|
| 24 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 25 | // TTY access functions and variables |
---|
| 26 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 27 | |
---|
[158] | 28 | extern volatile unsigned char _tty_get_buf[]; |
---|
| 29 | extern volatile unsigned char _tty_get_full[]; |
---|
[228] | 30 | extern unsigned int _tty_put_lock; |
---|
[158] | 31 | |
---|
[228] | 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); |
---|
[158] | 35 | |
---|
[189] | 36 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 37 | // ICU access functions (both vci_multi_icu and vci_xicu) |
---|
| 38 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[165] | 39 | |
---|
[228] | 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); |
---|
[165] | 46 | |
---|
[189] | 47 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 48 | // IOC access functions and variables (vci_block_device) |
---|
| 49 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[165] | 50 | |
---|
[228] | 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; |
---|
[165] | 56 | |
---|
[189] | 57 | |
---|
[228] | 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); |
---|
[158] | 60 | unsigned int _ioc_completed(); |
---|
[228] | 61 | unsigned int _ioc_get_status(unsigned int * status); |
---|
[237] | 62 | unsigned int _ioc_get_block_size(); |
---|
[158] | 63 | |
---|
[189] | 64 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[228] | 65 | // Multi DMA variables (vci_multi_dma) |
---|
[189] | 66 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[158] | 67 | |
---|
[228] | 68 | extern volatile unsigned int _dma_status[]; |
---|
| 69 | extern volatile unsigned int _dma_done[]; |
---|
| 70 | extern unsigned int _dma_lock[]; |
---|
| 71 | extern unsigned int _dma_iommu_ix1; |
---|
| 72 | extern unsigned int _dma_iommu_npages[]; |
---|
[204] | 73 | |
---|
[228] | 74 | unsigned int _dma_reset_irq(unsigned int cluster_id, unsigned int local_id); |
---|
| 75 | unsigned int _dma_get_status(unsigned int cluster_id, unsigned int local_id, unsigned int * status); |
---|
[204] | 76 | |
---|
[228] | 77 | unsigned int _dma_transfer( |
---|
| 78 | unsigned int dev_type, |
---|
| 79 | unsigned int to_user, |
---|
| 80 | unsigned int offset, |
---|
| 81 | unsigned int user_vaddr, |
---|
| 82 | unsigned int length); |
---|
[218] | 83 | |
---|
| 84 | unsigned int _dma_completed(); |
---|
| 85 | |
---|
[189] | 86 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 87 | // Frame Buffer access functions (vci_frame_buffer) |
---|
| 88 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[165] | 89 | |
---|
[228] | 90 | unsigned int _fb_sync_write(unsigned int offset, const void * buffer, unsigned int length); |
---|
| 91 | unsigned int _fb_sync_read( unsigned int offset, const void * buffer, unsigned int length); |
---|
| 92 | unsigned int _fb_write( unsigned int offset, const void * buffer, unsigned int length); |
---|
| 93 | unsigned int _fb_read( unsigned int offset, const void * buffer, unsigned int length); |
---|
[165] | 94 | |
---|
[158] | 95 | unsigned int _fb_completed(); |
---|
| 96 | |
---|
[189] | 97 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[218] | 98 | // NIC device access functions (vci_multi_nic) |
---|
| 99 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 100 | |
---|
[228] | 101 | unsigned int _nic_sync_write(unsigned int offset, const void * buffer, unsigned int length); |
---|
| 102 | unsigned int _nic_sync_read( unsigned int offset, const void * buffer, unsigned int length); |
---|
| 103 | unsigned int _nic_write( unsigned int offset, const void * buffer, unsigned int length); |
---|
| 104 | unsigned int _nic_read( unsigned int offset, const void * buffer, unsigned int length); |
---|
[218] | 105 | |
---|
| 106 | unsigned int _nic_completed(); |
---|
| 107 | |
---|
| 108 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[189] | 109 | // GCD access functions |
---|
| 110 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 111 | |
---|
[228] | 112 | unsigned int _gcd_write(unsigned int register_index, unsigned int value); |
---|
| 113 | unsigned int _gcd_read( unsigned int register_index, unsigned int * buffer); |
---|
[189] | 114 | |
---|
| 115 | |
---|
[232] | 116 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 117 | // Heap related function(s) |
---|
| 118 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 119 | |
---|
| 120 | unsigned int _heap_info(unsigned int * vaddr, unsigned int * size); |
---|
| 121 | |
---|
| 122 | |
---|
[158] | 123 | #endif |
---|
| 124 | |
---|
[228] | 125 | // Local Variables: |
---|
| 126 | // tab-width: 4 |
---|
| 127 | // c-basic-offset: 4 |
---|
| 128 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
---|
| 129 | // indent-tabs-mode: nil |
---|
| 130 | // End: |
---|
| 131 | // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
| 132 | |
---|