Changes in uspace/srv/hid/console/console.c [cccc091:f302586] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/console/console.c
rcccc091 rf302586 344 344 } 345 345 346 static 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 346 361 static ssize_t limit(ssize_t val, ssize_t lo, ssize_t hi) 347 362 { … … 466 481 event->c = c; 467 482 468 prodcons_produce(&active_console->input_pc, &event->link); 483 /* 484 * Kernel console does not read events 485 * from us, so we will redirect them 486 * to the (last) active userspace console 487 * if necessary. 488 */ 489 console_t *target_console = cons_get_active_uspace(); 490 491 prodcons_produce(&target_console->input_pc, 492 &event->link); 469 493 } 470 494 … … 801 825 802 826 /* Register server */ 803 int rc = loc_server_register(NAME, client_connection); 827 async_set_client_connection(client_connection); 828 int rc = loc_server_register(NAME); 804 829 if (rc < 0) { 805 830 printf("%s: Unable to register server (%s)\n", NAME, … … 904 929 atomic_set(&consoles[i].refcnt, 0); 905 930 fibril_mutex_initialize(&consoles[i].mtx); 931 prodcons_initialize(&consoles[i].input_pc); 906 932 907 933 if (graphics_state == GRAPHICS_FULL) { … … 942 968 } 943 969 944 prodcons_initialize(&consoles[i].input_pc);945 970 cons_redraw_state(&consoles[i]); 946 971
Note:
See TracChangeset
for help on using the changeset viewer.