Changes in / [a7a0417:50286ec] in mainline


Ignore:
Files:
2 added
17 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/amd64/Makefile.inc

    ra7a0417 r50286ec  
    3131RD_SRVS += \
    3232        $(USPACEDIR)/srv/pci/pci \
    33         $(USPACEDIR)/srv/bd/ata_bd/ata_bd \
    34         $(USPACEDIR)/srv/char/i8042/i8042 \
    35         $(USPACEDIR)/srv/mouse/c_mouse/c_mouse
     33        $(USPACEDIR)/srv/bd/ata_bd/ata_bd
    3634
    3735MODULES := $(notdir $(COMPONENTS))
  • uspace/Makefile

    ra7a0417 r50286ec  
    4141        srv/fb \
    4242        srv/kbd \
    43         srv/char/i8042 \
    4443        srv/console \
    4544        srv/fs/fat \
    4645        srv/fs/tmpfs \
    4746        srv/fs/devfs \
    48         srv/mouse/c_mouse \
    4947        srv/vfs \
    5048        srv/devmap \
  • uspace/app/init/init.c

    ra7a0417 r50286ec  
    265265        spawn("/srv/fhc");
    266266        spawn("/srv/obio");
    267         srv_start("/srv/i8042");
    268         srv_start("/srv/c_mouse");
    269267
    270268        spawn("/srv/fb");
  • uspace/srv/console/console.c

    ra7a0417 r50286ec  
    3737#include <ipc/kbd.h>
    3838#include <io/keycode.h>
    39 #include <ipc/mouse.h>
    4039#include <ipc/fb.h>
    4140#include <ipc/services.h>
     
    6564/** Phone to the keyboard driver. */
    6665static int kbd_phone;
    67 
    68 /** Phone to the mouse driver. */
    69 static int mouse_phone;
    7066
    7167/** Information about framebuffer */
     
    430426}
    431427
    432 /** Handler for mouse events */
    433 static void mouse_events(ipc_callid_t iid, ipc_call_t *icall)
    434 {
    435         int button, press;
    436         int dx, dy;
    437         int newcon;
    438 
    439         /* Ignore parameters, the connection is already opened */
    440         while (true) {
    441 
    442                 ipc_call_t call;
    443                 ipc_callid_t callid = async_get_call(&call);
    444 
    445                 int retval;
    446 
    447                 switch (IPC_GET_METHOD(call)) {
    448                 case IPC_M_PHONE_HUNGUP:
    449                         /* TODO: Handle hangup */
    450                         return;
    451                 case MEVENT_BUTTON:
    452                         button = IPC_GET_ARG1(call);
    453                         press = IPC_GET_ARG2(call);
    454                         if (button == 1) {
    455                                 newcon = gcons_mouse_btn(press);
    456                                 if (newcon != -1)
    457                                         change_console(&consoles[newcon]);
    458                         }
    459                         retval = 0;
    460                         break;
    461                 case MEVENT_MOVE:
    462                         dx = IPC_GET_ARG1(call);
    463                         dy = IPC_GET_ARG2(call);
    464                         gcons_mouse_move(dx, dy);
    465                         retval = 0;
    466                         break;
    467                 default:
    468                         retval = ENOENT;
    469                 }
    470 
    471                 ipc_answer_0(callid, retval);
    472         }
    473 }
    474 
    475428static void cons_write(console_t *cons, ipc_callid_t rid, ipc_call_t *request)
    476429{
     
    722675                return false;
    723676        }
    724 
     677       
    725678        kbd_phone = fd_phone(input_fd);
    726679        if (kbd_phone < 0) {
     
    728681                return false;
    729682        }
    730 
     683       
    731684        /* NB: The callback connection is slotted for removal */
    732685        ipcarg_t phonehash;
     
    735688                return false;
    736689        }
    737 
     690       
    738691        async_new_connection(phonehash, 0, NULL, keyboard_events);
    739 
    740         /* Connect to mouse device */
    741         mouse_phone = -1;
    742         int mouse_fd = open("/dev/hid_in/mouse", O_RDONLY);
    743 
    744         if (mouse_fd < 0) {
    745                 printf(NAME ": Notice - failed opening %s\n", "/dev/hid_in/mouse");
    746                 goto skip_mouse;
    747         }
    748 
    749         mouse_phone = fd_phone(mouse_fd);
    750         if (mouse_phone < 0) {
    751                 printf(NAME ": Failed to connect to mouse device\n");
    752                 goto skip_mouse;
    753         }
    754 
    755         if (ipc_connect_to_me(mouse_phone, SERVICE_CONSOLE, 0, 0, &phonehash) != 0) {
    756                 printf(NAME ": Failed to create callback from mouse device\n");
    757                 mouse_phone = -1;
    758                 goto skip_mouse;
    759         }
    760 
    761         async_new_connection(phonehash, 0, NULL, mouse_events);
    762 skip_mouse:
    763692
    764693        /* Connect to framebuffer driver */
     
    768697                return -1;
    769698        }
    770 
     699       
    771700        /* Register driver */
    772701        int rc = devmap_driver_register(NAME, client_connection);
  • uspace/srv/kbd/Makefile.build

    ra7a0417 r50286ec  
    7575ifeq ($(UARCH),ia32)
    7676        SOURCES += \
    77                 port/chardev.c \
     77                port/i8042.c \
    7878                ctl/pc.c
    7979endif
  • uspace/srv/kbd/generic/kbd.c

    ra7a0417 r50286ec  
    6060#define NAMESPACE  "hid_in"
    6161
    62 int client_phone = -1;
     62int phone2cons = -1;
    6363
    6464/** Currently active modifiers. */
     
    164164        ev.c = layout[active_layout]->parse_ev(&ev);
    165165
    166         async_msg_4(client_phone, KBD_EVENT, ev.type, ev.key, ev.mods, ev.c);
    167 }
    168 
    169 static void client_connection(ipc_callid_t iid, ipc_call_t *icall)
     166        async_msg_4(phone2cons, KBD_EVENT, ev.type, ev.key, ev.mods, ev.c);
     167}
     168
     169static void console_connection(ipc_callid_t iid, ipc_call_t *icall)
    170170{
    171171        ipc_callid_t callid;
     
    179179                switch (IPC_GET_METHOD(call)) {
    180180                case IPC_M_PHONE_HUNGUP:
    181                         if (client_phone != -1) {
    182                                 ipc_hangup(client_phone);
    183                                 client_phone = -1;
     181                        if (phone2cons != -1) {
     182                                ipc_hangup(phone2cons);
     183                                phone2cons = -1;
    184184                        }
    185185                       
     
    187187                        return;
    188188                case IPC_M_CONNECT_TO_ME:
    189                         if (client_phone != -1) {
     189                        if (phone2cons != -1) {
    190190                                retval = ELIMIT;
    191191                                break;
    192192                        }
    193                         client_phone = IPC_GET_ARG5(call);
     193                        phone2cons = IPC_GET_ARG5(call);
    194194                        retval = 0;
    195195                        break;
     
    238238       
    239239        /* Register driver */
    240         int rc = devmap_driver_register(NAME, client_connection);
     240        int rc = devmap_driver_register(NAME, console_connection);
    241241        if (rc < 0) {
    242242                printf(NAME ": Unable to register driver (%d)\n", rc);
Note: See TracChangeset for help on using the changeset viewer.