Ignore:
Timestamp:
Nov 3, 2014, 11:03:55 AM (10 years ago)
Author:
alain
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_kernel/sys_handler.h

    r428 r440  
    55// Copyright (c) UPMC-LIP6
    66///////////////////////////////////////////////////////////////////////////////////
     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///////////////////////////////////////////////////////////////////////////////////
    711
    812#ifndef _SYS_HANDLER_H
    913#define _SYS_HANDLER_H
    1014
    11 //////////////////////////////////////////////////////////////////////////////////
     15#include <mapping_info.h>
     16
     17///////////////////////////////////////////////////////////////////////////////////
    1218//     Syscall Vector Table (indexed by syscall index)
    13 //////////////////////////////////////////////////////////////////////////////////
     19///////////////////////////////////////////////////////////////////////////////////
    1420
    1521extern const void * _syscall_vector[64];
    1622
     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
    1740//////////////////////////////////////////////////////////////////////////////////
    18 // Prototypes os the syscall handlers (other than peripheral drivers)
     41//    TTY related syscall handlers
    1942//////////////////////////////////////////////////////////////////////////////////
    2043
    21 void         _sys_ukn();
     44int _sys_tty_alloc();
    2245
    23 void         _proc_xyp( unsigned int* x,
    24                         unsigned int* y,
    25                         unsigned int* p );
     46int _sys_tty_write( const char*  buffer,
     47                    unsigned int length,
     48                    unsigned int channel );
    2649
    27 void         _task_exit();
     50int _sys_tty_read(  char*        buffer,
     51                    unsigned int length,
     52                    unsigned int channel );
    2853
    29 void         _context_switch();
     54int _sys_tty_get_lock( unsigned int   channel,
     55                       unsigned int * save_sr_ptr );
    3056
    31 unsigned int _local_task_id();
     57int _sys_tty_release_lock( unsigned int   channel,
     58                           unsigned int * save_sr_ptr );
    3259
    33 unsigned int _global_task_id();
     60//////////////////////////////////////////////////////////////////////////////
     61//    TIM related syscall handlers
     62//////////////////////////////////////////////////////////////////////////////
    3463
    35 unsigned int _thread_id();
     64int _sys_tim_alloc();
    3665
    37 unsigned int _procs_number( unsigned int  cluster_id,
    38                             unsigned int* number );
     66int _sys_tim_start( unsigned int period );
    3967
    40 unsigned int _vobj_get_vbase( char*         vspace_name,
    41                               char*         vobj_name,
    42                               unsigned int* vobj_vbase );
     68int _sys_tim_stop();
    4369
    44 unsigned int _vobj_get_length( char*         vspace_name,
    45                                char*         vobj_name,
    46                                unsigned int* vobj_length );
     70//////////////////////////////////////////////////////////////////////////////
     71//    NIC related syscall handlers
     72//////////////////////////////////////////////////////////////////////////////
    4773
    48 unsigned int _get_xy_from_ptr( void*          ptr,
    49                                unsigned int*  x,
    50                                unsigned int*  y );
     74int _sys_nic_alloc();
    5175
     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 );
    52142
    53143#endif
Note: See TracChangeset for help on using the changeset viewer.