Changeset 1db44ea in mainline for uspace/srv/hid/console/console.c


Ignore:
Timestamp:
2011-09-25T18:46:45Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
36cb22f
Parents:
dcc44ca1 (diff), f9d8c3a (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
  • uspace/srv/hid/console/console.c

    rdcc44ca1 r1db44ea  
    344344}
    345345
     346static console_t *cons_get_active_uspace(void)
     347{
     348        fibril_mutex_lock(&switch_mtx);
     349
     350        console_t *active_uspace = active_console;
     351        if (active_uspace == kernel_console) {
     352                active_uspace = prev_console;
     353        }
     354        assert(active_uspace != kernel_console);
     355
     356        fibril_mutex_unlock(&switch_mtx);
     357
     358        return active_uspace;
     359}
     360
    346361static ssize_t limit(ssize_t val, ssize_t lo, ssize_t hi)
    347362{
     
    466481                                event->c = c;
    467482                               
    468                                 prodcons_produce(&active_console->input_pc, &event->link);
     483                                /* Kernel console does not read events
     484                                 * from us, so we will redirect them
     485                                 * to the (last) active userspace console
     486                                 * if necessary.
     487                                 */
     488                                console_t *target_console = cons_get_active_uspace();
     489
     490                                prodcons_produce(&target_console->input_pc,
     491                                    &event->link);
    469492                        }
    470493                       
     
    904927                atomic_set(&consoles[i].refcnt, 0);
    905928                fibril_mutex_initialize(&consoles[i].mtx);
     929                prodcons_initialize(&consoles[i].input_pc);
    906930               
    907931                if (graphics_state == GRAPHICS_FULL) {
     
    942966                }
    943967               
    944                 prodcons_initialize(&consoles[i].input_pc);
    945968                cons_redraw_state(&consoles[i]);
    946969               
Note: See TracChangeset for help on using the changeset viewer.