Ignore:
File:
1 edited

Legend:

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

    r91db0280 r593e023  
    8484static outdev_t stdout_source;
    8585
     86static void stdin_signal(indev_t *, indev_signal_t);
     87
    8688static indev_operations_t stdin_ops = {
    87         .poll = NULL
     89        .poll = NULL,
     90        .signal = stdin_signal
    8891};
    8992
    9093static void stdout_write(outdev_t *, wchar_t);
    9194static void stdout_redraw(outdev_t *);
     95static void stdout_scroll_up(outdev_t *);
     96static void stdout_scroll_down(outdev_t *);
    9297
    9398static outdev_operations_t stdout_ops = {
    9499        .write = stdout_write,
    95         .redraw = stdout_redraw
     100        .redraw = stdout_redraw,
     101        .scroll_up = stdout_scroll_up,
     102        .scroll_down = stdout_scroll_down
    96103};
    97104
     
    113120}
    114121
     122static void stdin_signal(indev_t *indev, indev_signal_t signal)
     123{
     124        switch (signal) {
     125        case INDEV_SIGNAL_SCROLL_UP:
     126                if (stdout != NULL)
     127                        stdout_scroll_up(stdout);
     128                break;
     129        case INDEV_SIGNAL_SCROLL_DOWN:
     130                if (stdout != NULL)
     131                        stdout_scroll_down(stdout);
     132                break;
     133        }
     134}
     135
    115136void stdout_wire(outdev_t *outdev)
    116137{
     
    136157                if ((sink) && (sink->op->redraw))
    137158                        sink->op->redraw(sink);
     159        }
     160}
     161
     162static void stdout_scroll_up(outdev_t *dev)
     163{
     164        list_foreach(dev->list, link, outdev_t, sink) {
     165                if ((sink) && (sink->op->scroll_up))
     166                        sink->op->scroll_up(sink);
     167        }
     168}
     169
     170static void stdout_scroll_down(outdev_t *dev)
     171{
     172        list_foreach(dev->list, link, outdev_t, sink) {
     173                if ((sink) && (sink->op->scroll_down))
     174                        sink->op->scroll_down(sink);
    138175        }
    139176}
     
    167204void grab_console(void)
    168205{
     206        event_notify_1(EVENT_KCONSOLE, false, true);
    169207        bool prev = console_override;
    170208       
     
    184222{
    185223        console_override = false;
     224        event_notify_1(EVENT_KCONSOLE, false, false);
    186225}
    187226
    188227/** Activate kernel console override */
    189 sysarg_t sys_debug_activate_console(void)
     228sysarg_t sys_debug_console(void)
    190229{
    191230#ifdef CONFIG_KCONSOLE
     
    229268                        }
    230269                }
     270               
    231271                if (chr_encode(ch, buf, &offset, buflen - 1) == EOK) {
    232272                        putchar(ch);
     
    264304
    265305/** Flush characters that are stored in the output buffer
    266  * 
     306 *
    267307 */
    268308void kio_flush(void)
     
    294334
    295335/** Put a character into the output buffer.
    296  * 
     336 *
    297337 * The caller is required to hold kio_lock
    298338 */
Note: See TracChangeset for help on using the changeset viewer.