Changeset 516ff92 in mainline for kernel/arch/mips32


Ignore:
Timestamp:
2009-01-31T21:27:18Z (17 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4863e50b
Parents:
96a2e45
Message:

silent kernel console output when user space console is active

Location:
kernel/arch/mips32/src/drivers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/mips32/src/drivers/msim.c

    r96a2e45 r516ff92  
    2727 */
    2828
    29 /** @addtogroup mips32 
     29/** @addtogroup mips32
    3030 * @{
    3131 */
     
    5959
    6060/** Putchar that works with MSIM & gxemul */
    61 void msim_write(chardev_t *dev, const char ch)
     61void msim_write(chardev_t *dev, const char ch, bool silent)
    6262{
    63         *((char *) MSIM_VIDEORAM) = ch;
     63        if (!silent)
     64                *((char *) MSIM_VIDEORAM) = ch;
    6465}
    6566
     
    8182{
    8283        char ch;
    83 
     84       
    8485        while (1) {
    8586                ch = *((volatile char *) MSIM_KBD_ADDRESS);
     
    102103                char ch = 0;
    103104               
    104                         ch = *((char *) MSIM_KBD_ADDRESS);
    105                         if (ch =='\r')
    106                                 ch = '\n';
    107                         if (ch == 0x7f)
    108                                 ch = '\b';
    109                         chardev_push_character(&console, ch);
     105                ch = *((char *) MSIM_KBD_ADDRESS);
     106                if (ch =='\r')
     107                        ch = '\n';
     108                if (ch == 0x7f)
     109                        ch = '\b';
     110                chardev_push_character(&console, ch);
    110111        }
    111112}
  • kernel/arch/mips32/src/drivers/serial.c

    r96a2e45 r516ff92  
    2727 */
    2828
    29 /** @addtogroup mips32 
     29/** @addtogroup mips32
    3030 * @{
    3131 */
     
    4747static bool kb_enabled;
    4848
    49 static void serial_write(chardev_t *d, const char ch)
     49static void serial_write(chardev_t *d, const char ch, bool silent)
    5050{
    51         serial_t *sd = (serial_t *)d->data;
    52 
    53         if (ch == '\n')
    54                 serial_write(d, '\r');
    55         /* Wait until transmit buffer empty */
    56         while (! (SERIAL_READ_LSR(sd->port) & (1<<TRANSMIT_EMPTY_BIT)))
    57                 ;
    58         SERIAL_WRITE(sd->port, ch);
     51        if (!silent) {
     52                serial_t *sd = (serial_t *)d->data;
     53               
     54                if (ch == '\n')
     55                        serial_write(d, '\r');
     56               
     57                /* Wait until transmit buffer empty */
     58                while (!(SERIAL_READ_LSR(sd->port) & (1 << TRANSMIT_EMPTY_BIT)));
     59                SERIAL_WRITE(sd->port, ch);
     60        }
    5961}
    6062
     
    134136{
    135137        serial_t *sd = &sconf[0];
    136 
    137 
     138       
    138139        chardev_initialize("serial_console", &console, &serial_ops);
    139140        console.data = sd;
     
    146147        serial_irq.handler = serial_irq_handler;
    147148        irq_register(&serial_irq);
    148 
     149       
    149150        /* I don't know why, but the serial interrupts simply
    150          * don't work on simics
    151          */
     151           don't work on simics */
    152152        virtual_timer_fnc = &serial_handler;
    153153       
Note: See TracChangeset for help on using the changeset viewer.