Changes between Version 40 and Version 41 of kernel_syscalls
- Timestamp:
- Sep 16, 2015, 5:42:13 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
kernel_syscalls
v40 v41 59 59 == TTY related syscall handlers == 60 60 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 ) === 62 This 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 64 Returns 0 if success. 65 Returns -1 if no available TTY channel, or TTY already allocated. 66 67 === 2) '''_sys_tty_release'''( ) === 68 This 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 69 the value stored in _tty_channel[channel] is non-zero. 70 71 Returns 0 if success. 72 Returns -1 if TTY already released. 73 74 === 3) int '''_sys_tty_write'''( const char* buffer, unsigned int length, unsigned int channel ) === 66 75 This 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. 67 76 It 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. 68 77 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 ) === 70 79 This 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. 71 80 It uses the TTY_GET_IRQ[tty_id] interrupt and the buffer must have been filled by the TTY_ISR. … … 229 238 * else, it return the heap associated to the calling task. 230 239 Returns 0 if success, returns -1 if not found. 231