Changes between Version 3 and Version 4 of tty_driver


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

--

Legend:

Unmodified
Added
Removed
Modified
  • tty_driver

    v3 v4  
    77This ''vci_multi_tty'' component is a multi-terminals controller. It is an ''external'' peripheral.
    88
    9 The total number of terminals must be defined by the configuration  parameter NB_TTY_CHANNELS in the ''hard_config.h'' file.
     9The total number of terminals available in the platform must be defined by the configuration  parameter NB_TTY_CHANNELS in the ''hard_config.h'' file.
    1010
    11 The kernel terminal is TTY[0]. The user TTYs are allocated to applications by the GIET-VM in the boot phase, as defined in the mapping. The corresponding global index is stored in the context of the task.
     11The kernel terminal is TTY[0]. Private TTY Terminal can be allocated to the task requesting it thanks to the ''giet_tty_alloc()'' system call. The corresponding TTY terminal index is stored in the context of the task.
    1212
    1313The SEG_TTY_BASE address must be defined in the hard_config.h file.
     
    1818
    1919
    20 
    21 
    2220 === unsigned int '''_tty_get_register'''( unsigned int channel,   unsigned int index ) ===
    2321This low level function returns the value of register (channel / index).
     
    2523 === void '''_tty_set_register'''( unsigned int channel,  unsigned int index,  unsigned int value ) ===
    2624This low level function set a new value in register (channel / index).
    27 
    28  === unsigned int '''_tty_write'''( const char*  buffer,  unsigned int length,  unsigned int channel ) === 
    29 This non-blocking function writes a character string from a fixed-length buffer to a TTY terminal identified by the channel argument. This function is intended to be used to handle a system call, and should not be used by the kernel for log messages on TTY 0. If channel argument is 0xFFFFFFFF, the TTY index is found in the task context.
    30 It is non blocking: it tests the TTY_STATUS register, and stops the transfer as soon as the TTY_STATUS[WRITE] bit is set.
    31 Returns  the number of characters that have been written.
    32 
    33  === unsigned int '''_tty_read'''(  char* buffer,  unsigned int length,  unsigned int channel ) ===
    34 This 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.
    35 It uses the TTY_GET_IRQ[tty_id] interrupt and the buffer must have been filled by the TTY_ISR.
    36 It 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.
    37 Returns  the number of characters that have been read (0/1).
    38 
    39  === void '''_tty_get_lock'''( unsigned int  channel,   unsigned int* save_sr_ptr ) ===
    40 This blocking function try to take the lock protecting exclusive access to TTY terminal identified by the "channel" argument.
    41 It enters a critical section before taking the lock, and save the SR value at address defined by the ''save_sr_ptr'' argument.
    42 It returns only when the lock has been successfully taken.
    43 
    44  === void '''_tty_release_lock'''( unsigned int  channel,  unsigned int* save_sr_ptr ) ===
    45 This function releases the lock protecting exclusive access to TTY terminal identified by the channel argument.
    46 It exit the critical section after lock release, and restore SR value from address defined by the ''save_sr_ptr'' argument.
    4725
    4826 === void '''_tty_rx_isr'''( unsigned int irq_type,  unsigned int irq_id,  unsigned int channel ) ===