Ignore:
Timestamp:
Feb 20, 2018, 5:32:17 PM (6 years ago)
Author:
alain
Message:

Fix a bad bug in scheduler...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/tsar_mips32/drivers/soclib_tty.h

    r424 r435  
    2828
    2929/****************************************************************************************
    30  * This driver supports the soclib_multi_tty component.
     30 * This driver supports the vci_tty_tsar component.
    3131 * It implements the generic TXT device API:
    3232 * - transfer one single character from TTY to command "buffer" if to_mem is non-zero.
     
    6262
    6363/****************************************************************************************
    64  * This function implements the TXT_READ & TXT_WRITE commands registered in the client
    65  * thread descriptor (in the txt_cmd field), identified by the <xp_thread> argument.
    66  * Depending on the command type, it only unmasks the relevant TTY_RX / TTY_TX IRQ,
     64 * This function implements both the TXT_READ & TXT_WRITE commands registered in the
     65 * client thread descriptor (in the txt_cmd field), even if ALMOS-MKH defines two
     66 * different chdevs (and consequently two diffeerent server threads) for the RX and TX
     67 * directions. The client thread is identified by the <thread_xp> argument.
     68 * Depending on the command type, it unmasks the relevant TTY_RX / TTY_TX IRQ,
    6769 * and blocks the TXT device server thread on the THREAD_BLOCKED_DEV_ISR, as the data
    6870 * transfer is done by the ISR.
     
    8385
    8486/****************************************************************************************
    85  * This ISR is executed to handle both the TTY_TX_IRQ and the TTY_RX_IRQ.
    86  * - the TTY_RX_IRQ is activated as soon as the TTY_STATUS_RX_FULL bit is set in the
    87  *   TTY status register, indicating a character registered in the TTY_READ register.
     87 * This ISR is executed to handle both the TTY_TX_IRQ and the TTY_RX_IRQ, even if
     88 *   The RX_IRQ is activated as soon as the TTY_STATUS_RX_FULL bit is 1 in the
     89 *   TTY_STATUS register, when the TTY_RX_IRQ_ENABLE is non zero, indicating that
     90 *   the TTY_READ buffer is full and can be read.
     91 *   The TX_IRQ is activated as soon as the TTY_STATUS_TX_FULL bit is 0 in the
     92 *   TTY_STATUS register, when the TTY_TX_IRQ_ENABLE is non zero, indicating that
     93 *   the TTY_WRITE buffer is empty, and can be written.
     94 * WARNING : In ALMOS-MKH, the RX_IRQ is always enabled to catch the control signals,
     95 * but the TX_IRQ is dynamically enabled by the TXT_WRITE command, and disabled when
     96 * the command is completed.
    8897 *
    89  *   . if it exist a TXT_READ command registered in the command queue, and thit copies the
     98 * 1) The ISR first read the TTY_STATUS to get the current state of the TTY_READ and
     99 *   the TTY_WRITE buffers.
     100 *
     101 * 2) It try to read the first command registered in the server thread queue associated
     102 *    to the TTY channel
     103 *
     104 * 2) The ISR handles the RX when the TTY_READ buffer is full :
     105 *   . it read the available character from the TTY_READ buffer, and this
     106 *     acknowledges the RX_IRQ.
     107 *   . if it is a control character ( ^C / ^D / ^Z ) it translate it to the proper
     108 *     signal and execute the relevant sigaction for the foreground process.
     109 *   . if it is a normal character, it try to get the first command registered in the
     110 *     server thread queue. If it is a TXT_READ, it returns this character to the
     111 *     command buffer in the client thread.
     112 *
     113 * 3) The ISR handles the TX when the TTY_WRITE buffer is empty and a TXT_WRITE
     114 *   . it try to get it copies the
    90115 *     character to the command buffer, acknowledges the TTY_RX_IRQ, and unblock the
    91116 *     associated server thread.
    92117     
    93  *   . the control characters are directly handled by the txt ^C / ^D /  and the this IRQ ca
    94  *
     118 *   . the control characters ^C / ^D / ^Z  are directly handled by the ISR and
     119 *     translated to the foreground process.
     120
     121 * - the
    95122 the TXT_READ and TXT_WRITE commands.
    96123 * It gets the command arguments from the first client thread in the TXT chdev queue:
Note: See TracChangeset for help on using the changeset viewer.