[258] | 1 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 2 | // File : sys_handler.h |
---|
| 3 | // Date : 01/04/2012 |
---|
| 4 | // Author : alain greiner and joel porquet |
---|
| 5 | // Copyright (c) UPMC-LIP6 |
---|
| 6 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[440] | 7 | // The sys_handler.c and sys_handler.h files are part of the GIET-VM nano-kernel. |
---|
| 8 | // It define the syscall_vector[] (at the end of this file), as well as the |
---|
| 9 | // associated syscall handlers. |
---|
| 10 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[258] | 11 | |
---|
| 12 | #ifndef _SYS_HANDLER_H |
---|
| 13 | #define _SYS_HANDLER_H |
---|
| 14 | |
---|
[440] | 15 | #include <mapping_info.h> |
---|
| 16 | |
---|
| 17 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[258] | 18 | // Syscall Vector Table (indexed by syscall index) |
---|
[440] | 19 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[258] | 20 | |
---|
| 21 | extern const void * _syscall_vector[64]; |
---|
| 22 | |
---|
[440] | 23 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 24 | // This structure can be used by the vci_chbuf_dma component to transfer a stream |
---|
| 25 | // of images from two buffers in user space to the frame buffer in kernel space. |
---|
| 26 | // It contains two chbuf descriptors |
---|
| 27 | // - The SRC chbuf contains two buffers (buf0 & buf1), that can be in user space. |
---|
| 28 | // - The DST cbuf contains one single buffer (fbf), that is the frame buffer. |
---|
| 29 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 30 | |
---|
| 31 | typedef struct fbf_chbuf_s |
---|
| 32 | { |
---|
| 33 | unsigned long long buf0; // physical address + status for user buffer 0 |
---|
| 34 | unsigned long long buf1; // physical address + status for user buffer 1 |
---|
| 35 | unsigned long long fbf; // physical address + status for user buffer 0 |
---|
| 36 | unsigned int length; // buffer length (bytes) |
---|
| 37 | unsigned int padding; // for 32 bytes alignment |
---|
| 38 | } fbf_chbuf_t; |
---|
| 39 | |
---|
[258] | 40 | ////////////////////////////////////////////////////////////////////////////////// |
---|
[440] | 41 | // TTY related syscall handlers |
---|
[258] | 42 | ////////////////////////////////////////////////////////////////////////////////// |
---|
| 43 | |
---|
[440] | 44 | int _sys_tty_alloc(); |
---|
[294] | 45 | |
---|
[440] | 46 | int _sys_tty_write( const char* buffer, |
---|
| 47 | unsigned int length, |
---|
| 48 | unsigned int channel ); |
---|
[428] | 49 | |
---|
[440] | 50 | int _sys_tty_read( char* buffer, |
---|
| 51 | unsigned int length, |
---|
| 52 | unsigned int channel ); |
---|
[294] | 53 | |
---|
[440] | 54 | int _sys_tty_get_lock( unsigned int channel, |
---|
| 55 | unsigned int * save_sr_ptr ); |
---|
[294] | 56 | |
---|
[440] | 57 | int _sys_tty_release_lock( unsigned int channel, |
---|
| 58 | unsigned int * save_sr_ptr ); |
---|
[294] | 59 | |
---|
[440] | 60 | ////////////////////////////////////////////////////////////////////////////// |
---|
| 61 | // TIM related syscall handlers |
---|
| 62 | ////////////////////////////////////////////////////////////////////////////// |
---|
[294] | 63 | |
---|
[440] | 64 | int _sys_tim_alloc(); |
---|
[258] | 65 | |
---|
[440] | 66 | int _sys_tim_start( unsigned int period ); |
---|
[258] | 67 | |
---|
[440] | 68 | int _sys_tim_stop(); |
---|
[258] | 69 | |
---|
[440] | 70 | ////////////////////////////////////////////////////////////////////////////// |
---|
| 71 | // NIC related syscall handlers |
---|
| 72 | ////////////////////////////////////////////////////////////////////////////// |
---|
[294] | 73 | |
---|
[440] | 74 | int _sys_nic_alloc(); |
---|
[396] | 75 | |
---|
[440] | 76 | int _sys_nic_sync_send( void* vbuf ); |
---|
[396] | 77 | |
---|
[440] | 78 | int _sys_nic_sync_receive( void* vbuf ); |
---|
| 79 | |
---|
| 80 | ////////////////////////////////////////////////////////////////////////////// |
---|
| 81 | // FBF related syscall handlers |
---|
| 82 | ////////////////////////////////////////////////////////////////////////////// |
---|
| 83 | |
---|
| 84 | int _sys_fbf_sync_write( unsigned int offset, |
---|
| 85 | void* buffer, |
---|
| 86 | unsigned int length ); |
---|
| 87 | |
---|
| 88 | int _sys_fbf_sync_read( unsigned int offset, |
---|
| 89 | void* buffer, |
---|
| 90 | unsigned int length ); |
---|
| 91 | |
---|
| 92 | int _sys_fbf_cma_alloc(); |
---|
| 93 | |
---|
| 94 | int _sys_fbf_cma_start( void* vbase0, |
---|
| 95 | void* vbase1, |
---|
| 96 | unsigned int length ); |
---|
| 97 | |
---|
| 98 | int _sys_fbf_cma_display( unsigned int buffer_index ); |
---|
| 99 | |
---|
| 100 | int _sys_fbf_cma_stop(); |
---|
| 101 | |
---|
| 102 | ////////////////////////////////////////////////////////////////////////////// |
---|
| 103 | // Miscelaneous syscall handlers |
---|
| 104 | ////////////////////////////////////////////////////////////////////////////// |
---|
| 105 | |
---|
| 106 | int _sys_ukn(); |
---|
| 107 | |
---|
| 108 | int _sys_proc_xyp( unsigned int* x, |
---|
| 109 | unsigned int* y, |
---|
| 110 | unsigned int* p ); |
---|
| 111 | |
---|
| 112 | int _sys_task_exit( char* string ); |
---|
| 113 | |
---|
| 114 | int _context_switch(); |
---|
| 115 | |
---|
| 116 | int _sys_local_task_id(); |
---|
| 117 | |
---|
| 118 | int _sys_global_task_id(); |
---|
| 119 | |
---|
| 120 | int _sys_thread_id(); |
---|
| 121 | |
---|
| 122 | int _sys_procs_number( unsigned int x, |
---|
| 123 | unsigned int y, |
---|
| 124 | unsigned int* number ); |
---|
| 125 | |
---|
| 126 | int _sys_vobj_get_vbase( char* vspace_name, |
---|
| 127 | char* vobj_name, |
---|
| 128 | unsigned int* vbase ); |
---|
| 129 | |
---|
| 130 | int _sys_vobj_get_length( char* vspace_name, |
---|
| 131 | char* vobj_name, |
---|
| 132 | unsigned int* length ); |
---|
| 133 | |
---|
| 134 | int _sys_xy_from_ptr( void* ptr, |
---|
| 135 | unsigned int* x, |
---|
| 136 | unsigned int* y ); |
---|
| 137 | |
---|
| 138 | int _sys_heap_info( unsigned int* vaddr, |
---|
| 139 | unsigned int* length, |
---|
| 140 | unsigned int x, |
---|
| 141 | unsigned int y ); |
---|
| 142 | |
---|
[258] | 143 | #endif |
---|
| 144 | |
---|
| 145 | // Local Variables: |
---|
| 146 | // tab-width: 4 |
---|
| 147 | // c-basic-offset: 4 |
---|
| 148 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
---|
| 149 | // indent-tabs-mode: nil |
---|
| 150 | // End: |
---|
| 151 | // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
| 152 | |
---|