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


Ignore:
Timestamp:
2009-08-21T14:12:45Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0e6dce8, b50b5af2, e5792d1
Parents:
90c8b8d
Message:

kernel output devices now suport multiple instances (except ski and sgcn, which respect the same interface, but behave as singletons)
if more than one output device gets initialized, the output is cloned to all of them
get rid of arch_grab_console() and arch_release_console() (output devices can implement a generic "redraw" method, input devices respect the "silent" global variable)
related cleanups and modifications

File:
1 edited

Legend:

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

    r90c8b8d ra71c158  
    7171
    7272/** Kernel log spinlock */
    73 SPINLOCK_INITIALIZE(klog_lock);
     73SPINLOCK_STATIC_INITIALIZE_NAME(klog_lock, "*klog_lock");
    7474
    7575/** Physical memory area used for klog buffer */
     
    8484
    8585static void stdout_write(outdev_t *dev, wchar_t ch, bool silent);
     86static void stdout_redraw(outdev_t *dev);
    8687
    8788static outdev_operations_t stdout_ops = {
    88         .write = stdout_write
     89        .write = stdout_write,
     90        .redraw = stdout_redraw
    8991};
    9092
     
    122124        for (cur = dev->list.next; cur != &dev->list; cur = cur->next) {
    123125                outdev_t *sink = list_get_instance(cur, outdev_t, link);
    124                 sink->op->write(sink, ch, silent);
     126                if ((sink) && (sink->op->write))
     127                        sink->op->write(sink, ch, silent);
     128        }
     129}
     130
     131static void stdout_redraw(outdev_t *dev)
     132{
     133        link_t *cur;
     134       
     135        for (cur = dev->list.next; cur != &dev->list; cur = cur->next) {
     136                outdev_t *sink = list_get_instance(cur, outdev_t, link);
     137                if ((sink) && (sink->op->redraw))
     138                        sink->op->redraw(sink);
    125139        }
    126140}
     
    156170       
    157171        silent = false;
    158         arch_grab_console();
     172        if ((stdout) && (stdout->op->redraw))
     173                stdout->op->redraw(stdout);
    159174       
    160175        /* Force the console to print the prompt */
     
    165180void release_console(void)
    166181{
     182        // FIXME arch_release_console
    167183        silent = true;
    168         arch_release_console();
    169184}
    170185
Note: See TracChangeset for help on using the changeset viewer.