Changeset 6860ddb in rtems


Ignore:
Timestamp:
Mar 14, 2017, 4:27:57 PM (3 years ago)
Author:
Martin Aberg <maberg@…>
Branches:
master
Children:
e5e44bdb
Parents:
3df6710
git-author:
Martin Aberg <maberg@…> (03/14/17 16:27:57)
git-committer:
Daniel Hellstrom <daniel@…> (05/02/17 10:34:46)
Message:

leon, apbuart: Optimized RX processing in ISR

Limit the number of calls to termios rtems_termios_enqueue_raw_characters() by
reading out the RX FIFO on stack and then call termios only once.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c

    r3df6710 r6860ddb  
    807807        struct apbuart_regs *regs = uart->regs;
    808808        unsigned int status;
    809         char data;
     809        char buf[33];
    810810        int cnt;
    811811
     
    825825                }
    826826        } else {
    827                 /* Get all received characters */
    828                 while ((status=regs->status) & APBUART_STATUS_DR) {
    829                         /* Data has arrived, get new data */
    830                         data = regs->data;
    831 
    832                         /* Tell termios layer about new character */
    833                         rtems_termios_enqueue_raw_characters(tty, &data, 1);
     827                /*
     828                 * Get all new characters from APBUART RX (FIFO) and store them
     829                 * on the stack. Then tell termios about the new characters.
     830                 * Maximum APBUART RX FIFO size is 32 characters.
     831                 */
     832                cnt = 0;
     833                while (
     834                        ((status=regs->status) & APBUART_STATUS_DR) &&
     835                        (cnt < sizeof(buf))
     836                ) {
     837                        buf[cnt] = regs->data;
     838                        cnt++;
     839                }
     840                if (0 < cnt) {
     841                        /* Tell termios layer about new characters */
     842                        rtems_termios_enqueue_raw_characters(tty, &buf[0], cnt);
    834843                }
    835844        }
Note: See TracChangeset for help on using the changeset viewer.