source: soft/giet_vm/giet_kernel/sys_handler.h @ 440

Last change on this file since 440 was 440, checked in by alain, 10 years ago

Introducing dynamic allocation of peripheral channels (NIC, TTY, CMA, TIM)
Intoducing a kernel function for all system calls: No more direct call
to the peripheral drivers.

  • Property svn:executable set to *
File size: 5.1 KB
Line 
1///////////////////////////////////////////////////////////////////////////////////
2// File     : sys_handler.h
3// Date     : 01/04/2012
4// Author   : alain greiner and joel porquet
5// Copyright (c) UPMC-LIP6
6///////////////////////////////////////////////////////////////////////////////////
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///////////////////////////////////////////////////////////////////////////////////
11
12#ifndef _SYS_HANDLER_H
13#define _SYS_HANDLER_H
14
15#include <mapping_info.h>
16
17///////////////////////////////////////////////////////////////////////////////////
18//     Syscall Vector Table (indexed by syscall index)
19///////////////////////////////////////////////////////////////////////////////////
20
21extern const void * _syscall_vector[64];
22
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
31typedef 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
40//////////////////////////////////////////////////////////////////////////////////
41//    TTY related syscall handlers
42//////////////////////////////////////////////////////////////////////////////////
43
44int _sys_tty_alloc();
45
46int _sys_tty_write( const char*  buffer,
47                    unsigned int length,
48                    unsigned int channel );
49
50int _sys_tty_read(  char*        buffer,
51                    unsigned int length,
52                    unsigned int channel );
53
54int _sys_tty_get_lock( unsigned int   channel,
55                       unsigned int * save_sr_ptr );
56
57int _sys_tty_release_lock( unsigned int   channel,
58                           unsigned int * save_sr_ptr );
59
60//////////////////////////////////////////////////////////////////////////////
61//    TIM related syscall handlers
62//////////////////////////////////////////////////////////////////////////////
63
64int _sys_tim_alloc();
65
66int _sys_tim_start( unsigned int period );
67
68int _sys_tim_stop();
69
70//////////////////////////////////////////////////////////////////////////////
71//    NIC related syscall handlers
72//////////////////////////////////////////////////////////////////////////////
73
74int _sys_nic_alloc();
75
76int _sys_nic_sync_send( void* vbuf );
77
78int _sys_nic_sync_receive( void* vbuf );
79
80//////////////////////////////////////////////////////////////////////////////
81//    FBF related syscall handlers
82//////////////////////////////////////////////////////////////////////////////
83
84int _sys_fbf_sync_write( unsigned int offset,
85                         void*        buffer,
86                         unsigned int length );
87
88int _sys_fbf_sync_read(  unsigned int offset,
89                         void*        buffer,
90                         unsigned int length );
91
92int _sys_fbf_cma_alloc();
93
94int _sys_fbf_cma_start( void*        vbase0, 
95                        void*        vbase1, 
96                        unsigned int length );
97
98int _sys_fbf_cma_display( unsigned int buffer_index );
99
100int _sys_fbf_cma_stop();
101
102//////////////////////////////////////////////////////////////////////////////
103//    Miscelaneous syscall handlers
104//////////////////////////////////////////////////////////////////////////////
105
106int _sys_ukn();
107
108int _sys_proc_xyp( unsigned int* x,
109                   unsigned int* y,
110                   unsigned int* p );
111
112int _sys_task_exit( char* string );
113
114int _context_switch();
115
116int _sys_local_task_id();
117
118int _sys_global_task_id();
119
120int _sys_thread_id();
121
122int _sys_procs_number( unsigned int  x,
123                       unsigned int  y, 
124                       unsigned int* number );
125
126int _sys_vobj_get_vbase( char*         vspace_name,
127                         char*         vobj_name,
128                         unsigned int* vbase );
129
130int _sys_vobj_get_length( char*         vspace_name, 
131                          char*         vobj_name,
132                          unsigned int* length );
133
134int _sys_xy_from_ptr( void*          ptr,
135                      unsigned int*  x,
136                      unsigned int*  y );
137
138int _sys_heap_info( unsigned int* vaddr, 
139                    unsigned int* length,
140                    unsigned int  x,
141                    unsigned int  y ); 
142
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
Note: See TracBrowser for help on using the repository browser.