Changes between Version 40 and Version 41 of kernel_syscalls


Ignore:
Timestamp:
Sep 16, 2015, 5:42:13 PM (9 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • kernel_syscalls

    v40 v41  
    5959== TTY related syscall handlers ==
    6060
    61 === 1) int '''_sys_tty_alloc'''() ===
    62 This function allocates a private TTY terminal to the calling task, and registers the TTY index in the task context.
    63 Returns 0 if success, returns -1 if not enough terminals.
    64 
    65 === 2) int '''_sys_tty_write'''( const char*  buffer,  unsigned int length,  unsigned int channel ) === 
     61=== 1) int '''_sys_tty_alloc'''( unsigned int shared ) ===
     62This function allocates a private TTY terminal to the calling thread, and registers the TTY terminal index (called channel) in the thread context. If the <shared> argument is non-zero, the same TTY channel is registered in the context of all others threads in the same vspace, resulting in one single TTY terminal shared by all threads in the vspace. The number of users is registered in the _tty_channel[channel] array.
     63
     64Returns 0 if success.
     65Returns -1 if no available TTY channel, or TTY already allocated.
     66
     67=== 2) '''_sys_tty_release'''( ) ===
     68This function release the TTY channel allocated to the calling thread. The corresponding thread context slot is reset (0xFFFFFFFF value), and the _tty_channel[channel] entry is decremented. The corresponding channel keep busy until
     69the value stored in _tty_channel[channel] is non-zero.
     70
     71Returns 0 if success.
     72Returns -1 if TTY already released.
     73
     74=== 3) int '''_sys_tty_write'''( const char*  buffer,  unsigned int length,  unsigned int channel ) === 
    6675This 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.
    6776It is non blocking: it tests the TTY_STATUS register, and stops the transfer as soon as the TTY_STATUS[WRITE] bit is set. Returns -1 if no TTT terminal allocated to the calling task. Returns  the number of characters that have been written if a terminal is allocated.
    6877
    69 === 3) int '''_sys_tty_read'''(  char* buffer,  unsigned int length,  unsigned int channel ) ===
     78=== 4) int '''_sys_tty_read'''(  char* buffer,  unsigned int length,  unsigned int channel ) ===
    7079This non-blocking function fetches one character from the terminal identified by the ''channel'' argument. If the ''channel'' argument is 0xFFFFFFFF, the TTY index is obtained from the current task context.
    7180It uses the TTY_GET_IRQ[tty_id] interrupt and the buffer must have been filled by the TTY_ISR.
     
    229238 * else, it return the heap associated to the calling task.
    230239Returns 0 if success, returns -1 if not found.
    231