source: soft/giet_vm/sys/drivers.h @ 218

Last change on this file since 218 was 218, checked in by alain, 12 years ago

Introducing support for Network controller

File size: 5.9 KB
RevLine 
[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]16extern volatile unsigned char _timer_event[];
[158]17
[203]18unsigned int _timer_start( unsigned int cluster_id,
19                           unsigned int local_id, 
20                           unsigned int period );
[158]21
[203]22unsigned int _timer_stop(  unsigned int cluster_id, 
23                           unsigned int local_id );
[189]24
25
[203]26unsigned 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]33extern volatile unsigned char _tty_get_buf[];
34extern volatile unsigned char _tty_get_full[];
[165]35extern unsigned int           _tty_put_lock;
[158]36
[189]37unsigned int _tty_write(    const char*         buffer, 
38                            unsigned int        length);
[158]39
[189]40unsigned int _tty_read(     char*                       buffer, 
41                            unsigned int        length);
[158]42
[204]43unsigned 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]50unsigned int _icu_get_index(unsigned int        cluster_id,
[165]51                            unsigned int        proc_id, 
[203]52                            unsigned int*       buffer );
[165]53
[203]54unsigned 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]63extern volatile unsigned int    _ioc_status;
64extern volatile unsigned int    _ioc_done;
65extern unsigned int                             _ioc_lock;
66extern unsigned int                             _ioc_iommu_ix1;
67extern unsigned int                             _ioc_iommu_npages; 
[165]68
[189]69
[165]70unsigned int _ioc_write(    unsigned int        lba, 
71                            const void*         buffer, 
72                            unsigned int        count);
73
74unsigned int _ioc_read(     unsigned int        lba, 
75                            void*                       buffer, 
76                            unsigned int        count);
77
[158]78unsigned int _ioc_completed();
79
[204]80unsigned int _ioc_get_status( unsigned int* status);
81
[189]82///////////////////////////////////////////////////////////////////////////////////
83// Multi DMA variables                  (vci_multi_dma)
84///////////////////////////////////////////////////////////////////////////////////
85 
86extern volatile unsigned int    _dma_status[];
87extern volatile unsigned int    _dma_done[];
88extern unsigned int                             _dma_lock[];
89extern unsigned int                             _dma_iommu_ix1;
90extern unsigned int                             _dma_iommu_npages[];
[158]91
[204]92unsigned int _dma_reset_irq( unsigned int       cluster_id,
93                             unsigned int       local_id );
94
95unsigned int _dma_get_status( unsigned int      cluster_id,
96                              unsigned int      local_id,
97                              unsigned int*     status );
98
[218]99unsigned 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
105unsigned int _dma_completed();
106
[189]107///////////////////////////////////////////////////////////////////////////////////
108// Frame Buffer access functions  (vci_frame_buffer)
109///////////////////////////////////////////////////////////////////////////////////
110 
[165]111unsigned int _fb_sync_write(unsigned int        offset, 
112                            const void*         buffer, 
113                            unsigned int        length);
114
115unsigned int _fb_sync_read( unsigned int        offset, 
116                            const void*         buffer, 
117                            unsigned int        length);
118
119unsigned int _fb_write(     unsigned int        offset, 
120                            const void*         buffer, 
121                            unsigned int        length);
122
123unsigned int _fb_read(      unsigned int        offset, 
124                            const void*         buffer, 
125                            unsigned int        length);
126
[158]127unsigned int _fb_completed();
128
[189]129///////////////////////////////////////////////////////////////////////////////////
[218]130// NIC device access functions  (vci_multi_nic)
131///////////////////////////////////////////////////////////////////////////////////
132
133unsigned int _nic_sync_write(unsigned int       offset, 
134                            const void*         buffer, 
135                            unsigned int        length);
136
137unsigned int _nic_sync_read( unsigned int       offset, 
138                            const void*         buffer, 
139                            unsigned int        length);
140
141
142unsigned int _nic_write(    unsigned int        offset, 
143                                        const void*             buffer, 
144                                        unsigned int    length);
145
146unsigned int _nic_read(     unsigned int        offset, 
147                                        const void*             buffer, 
148                                        unsigned int    length);
149
150unsigned int _nic_completed();
151
152///////////////////////////////////////////////////////////////////////////////////
[189]153// GCD access functions
154///////////////////////////////////////////////////////////////////////////////////
155
156unsigned int _gcd_write(    unsigned int        register_index, 
157                            unsigned int        value);
158
159unsigned int _gcd_read(     unsigned int        register_index, 
160                            unsigned int*       buffer);
161
162
[158]163#endif
164
Note: See TracBrowser for help on using the repository browser.