Changeset 516ff92 in mainline for kernel/generic/src


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

Location:
kernel/generic/src
Files:
3 edited

Legend:

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

    r96a2e45 r516ff92  
    977977{
    978978        printf("The kernel will now relinquish the console.\n");
    979         arch_release_console();
     979        release_console();
    980980       
    981981        if ((kconsole_notify) && (kconsole_irq.notif_cfg.notify))
  • 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 */
  • kernel/generic/src/syscall/syscall.c

    r96a2e45 r516ff92  
    9393{
    9494#ifdef CONFIG_KCONSOLE
    95         arch_grab_console();
     95        grab_console();
    9696        return true;
    9797#else
    9898        return false;
    9999#endif
     100}
     101
     102/** Tell kernel to relinquish keyboard/console access */
     103static unative_t sys_debug_disable_console(void)
     104{
     105        release_console();
     106        return true;
    100107}
    101108
     
    185192        /* Debug calls */
    186193        (syshandler_t) sys_debug_enable_console,
    187 
     194        (syshandler_t) sys_debug_disable_console,
     195       
    188196        (syshandler_t) sys_ipc_connect_kbox
    189197};
Note: See TracChangeset for help on using the changeset viewer.