Changeset 516ff92 in mainline for kernel/generic/src/console/console.c


Ignore:
Timestamp:
2009-01-31T21:27:18Z (16 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/console/console.c

    r96a2e45 r516ff92  
    6666static size_t klog_uspace = 0;
    6767
     68/**< Silent output */
     69static bool silent = false;
     70
    6871/**< Kernel log spinlock */
    6972SPINLOCK_INITIALIZE(klog_lock);
     
    7174/** Physical memory area used for klog buffer */
    7275static parea_t klog_parea;
    73        
     76
    7477/*
    7578 * For now, we use 0 as INR.
     
    143146        klog_inited = true;
    144147        spinlock_unlock(&klog_lock);
     148}
     149
     150void grab_console(void)
     151{
     152        silent = false;
     153        arch_grab_console();
     154}
     155
     156void release_console(void)
     157{
     158        silent = true;
     159        arch_release_console();
    145160}
    146161
     
    200215        index_t index = 0;
    201216        char ch;
    202 
     217       
    203218        while (index < buflen) {
    204219                ch = _getc(chardev);
     
    214229                }
    215230                putchar(ch);
    216 
     231               
    217232                if (ch == '\n') { /* end of string => write 0, return */
    218233                        buf[index] = '\0';
     
    254269                index_t i;
    255270                for (i = klog_len - klog_stored; i < klog_len; i++)
    256                         stdout->op->write(stdout, klog[(klog_start + i) % KLOG_SIZE]);
     271                        stdout->op->write(stdout, klog[(klog_start + i) % KLOG_SIZE], silent);
    257272                klog_stored = 0;
    258273        }
     
    266281       
    267282        if (stdout->op->write)
    268                 stdout->op->write(stdout, c);
     283                stdout->op->write(stdout, c, silent);
    269284        else {
    270285                /* The character is just in the kernel log */
Note: See TracChangeset for help on using the changeset viewer.