Changeset c028b22 in mainline for kernel/generic/src/console/console.c


Ignore:
Timestamp:
2011-07-08T17:01:01Z (13 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cc1a727
Parents:
4e36219 (diff), 026793d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

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

    r4e36219 rc028b22  
    8787};
    8888
    89 static void stdout_write(outdev_t *, wchar_t, bool);
     89static void stdout_write(outdev_t *, wchar_t);
    9090static void stdout_redraw(outdev_t *);
    9191
     
    9595};
    9696
    97 /** Silence output */
    98 bool silent = false;
     97/** Override kernel console lockout */
     98bool console_override = false;
    9999
    100100/** Standard input and output character devices */
     
    122122}
    123123
    124 static void stdout_write(outdev_t *dev, wchar_t ch, bool silent)
    125 {
    126         link_t *cur;
    127        
    128         for (cur = dev->list.next; cur != &dev->list; cur = cur->next) {
     124static void stdout_write(outdev_t *dev, wchar_t ch)
     125{
     126        list_foreach(dev->list, cur) {
    129127                outdev_t *sink = list_get_instance(cur, outdev_t, link);
    130128                if ((sink) && (sink->op->write))
    131                         sink->op->write(sink, ch, silent);
     129                        sink->op->write(sink, ch);
    132130        }
    133131}
     
    135133static void stdout_redraw(outdev_t *dev)
    136134{
    137         link_t *cur;
    138        
    139         for (cur = dev->list.next; cur != &dev->list; cur = cur->next) {
     135        list_foreach(dev->list, cur) {
    140136                outdev_t *sink = list_get_instance(cur, outdev_t, link);
    141137                if ((sink) && (sink->op->redraw))
     
    160156        klog_parea.frames = SIZE2FRAMES(sizeof(klog));
    161157        klog_parea.unpriv = false;
     158        klog_parea.mapped = false;
    162159        ddi_parea_register(&klog_parea);
    163160       
     
    171168void grab_console(void)
    172169{
    173         bool prev = silent;
    174        
    175         silent = false;
     170        bool prev = console_override;
     171       
     172        console_override = true;
    176173        if ((stdout) && (stdout->op->redraw))
    177174                stdout->op->redraw(stdout);
    178175       
    179         if ((stdin) && (prev)) {
     176        if ((stdin) && (!prev)) {
    180177                /*
    181178                 * Force the console to print the prompt.
     
    187184void release_console(void)
    188185{
    189         // FIXME arch_release_console
    190         silent = true;
    191 }
    192 
    193 /** Tell kernel to get keyboard/console access again */
    194 sysarg_t sys_debug_enable_console(void)
     186        console_override = false;
     187}
     188
     189/** Activate kernel console override */
     190sysarg_t sys_debug_activate_console(void)
    195191{
    196192#ifdef CONFIG_KCONSOLE
     
    200196        return false;
    201197#endif
    202 }
    203 
    204 /** Tell kernel to relinquish keyboard/console access */
    205 sysarg_t sys_debug_disable_console(void)
    206 {
    207         release_console();
    208         return true;
    209198}
    210199
     
    293282                         */
    294283                        spinlock_unlock(&klog_lock);
    295                         stdout->op->write(stdout, tmp, silent);
     284                        stdout->op->write(stdout, tmp);
    296285                        spinlock_lock(&klog_lock);
    297286                }
     
    321310                 * it should be no longer buffered.
    322311                 */
    323                 stdout->op->write(stdout, ch, silent);
     312                stdout->op->write(stdout, ch);
    324313        } else {
    325314                /*
Note: See TracChangeset for help on using the changeset viewer.