Changes between Version 7 and Version 8 of kernel_syscalls


Ignore:
Timestamp:
Oct 28, 2014, 8:13:36 PM (10 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • kernel_syscalls

    v7 v8  
    55[[PageOutline]]
    66
    7 The [source:soft/giet_vm/giet_kernel/sys_handler.c _syscall_vector] array contains the 64 kernel functions defined by the GIET-VM to handle system calls. Most of these functions are provided by the peripheral drivers,
    8 but some services are provided by the kernel itself:
     7The [source:soft/giet_vm/giet_kernel/sys_handler.c _syscall_vector] array contains the 64 kernel functions (syscal handlers) defined by the GIET-VM to handle system calls.
     8
     9== __Miscelaneous syscall handlers__ ==
    910
    1011=== void '''_sys_ukn'''() ===
    1112Function executed in case of undefined syscall
    1213
    13 === void '''_proc_xyp'''( unsigned int* x,  unsigned int*,   unsigned int* p ) ===
     14=== void '''_sys_proc_xyp'''( unsigned int* x,  unsigned int*,   unsigned int* p ) ===
    1415This function returns the processor (x,y,p) identifiers.
    1516
    16 === int '''_call_timer_start'''( unsigned int period ) ===
     17== __TTY related syscall handlers__ ==
     18
     19=== int '''_sys_tty_alloc'''() ===
     20
     21=== int '''_sys_tty_write'''( const char*  buffer,  unsigned int length,  unsigned int channel ) === 
     22This non-blocking function writes a character string from a fixed-length buffer to a TTY terminal identified by the channel argument. If channel argument is 0xFFFFFFFF, the TTY index is found in the task context.
     23It is non blocking: it tests the TTY_STATUS register, and stops the transfer as soon as the TTY_STATUS[WRITE] bit is set. Returns  the number of characters that have been written.
     24
     25=== int '''_sys_tty_read'''(  char* buffer,  unsigned int length,  unsigned int channel ) ===
     26This non-blocking function fetches one character from the terminal identified by the channel argument. If the channel argument is 0xFFFFFFFF, the channel index is obtained from the current task context.
     27It uses the TTY_GET_IRQ[tty_id] interrupt and the buffer must have been filled by the TTY_ISR.
     28It test the _tty_rx_full[tty_id] variable, read the _tty_rx_buf[tty_id] buffer, writes this character to the target buffer, and resets the_tty_rx_full[tty_id] register. The length argument is not used.
     29Returns  the number of characters that have been read (0/1).
     30
     31=== void '''_sys_tty_get_lock'''( unsigned int  channel,   unsigned int* save_sr_ptr ) ===
     32This blocking function try to take the lock protecting exclusive access to TTY terminal identified by the "channel" argument.
     33It enters a critical section before taking the lock, and save the SR value at address defined by the ''save_sr_ptr'' argument.
     34It returns only when the lock has been successfully taken.
     35
     36=== void '''_sys_tty_release_lock'''( unsigned int  channel,  unsigned int* save_sr_ptr ) ===
     37This function releases the lock protecting exclusive access to TTY terminal identified by the channel argument.
     38It exit the critical section after lock release, and restore SR value from address defined by the ''save_sr_ptr'' argument.
     39
     40== __TIM retated syscall handlers__ ==
     41
     42=== int '''_sys_timer_alloc'''() ===
     43This function allocates a private timer to the calling task, and register the timer index in the task context.
     44Return -1 if no timer available.
     45
     46=== int '''_sys_timer_start'''( unsigned int period ) ===
    1747This function starts the user timer channel allocated to the calling task.
     48Returns -1 if no allocated timer.
    1849
    19 === int '''_call_timer_stop'''( unsigned int period ) ===
     50=== int '''_sys_timer_stop'''() ===
    2051This function stops the user timer channel allocated to the calling task.
     52Returns -1 if no allocated timer.
    2153
    2254=== void '''_task_exit'''() ===