Subversion Repositories HelenOS-historic

Rev

Rev 1499 | Rev 1518 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1499 Rev 1508
Line 29... Line 29...
29
#include <ipc/ipc.h>
29
#include <ipc/ipc.h>
30
#include <ipc/services.h>
30
#include <ipc/services.h>
31
#include <stdio.h>
31
#include <stdio.h>
32
#include <unistd.h>
32
#include <unistd.h>
33
#include <stdlib.h>
33
#include <stdlib.h>
-
 
34
#include <stdio.h>
34
#include <ipc/ns.h>
35
#include <ipc/ns.h>
35
#include <errno.h>
36
#include <errno.h>
36
#include <arch/kbd.h>
37
#include <arch/kbd.h>
37
#include <kbd.h>
38
#include <kbd.h>
38
#include <libadt/fifo.h>
39
#include <libadt/fifo.h>
Line 44... Line 45...
44
{
45
{
45
    ipc_call_t call;
46
    ipc_call_t call;
46
    ipc_callid_t callid;
47
    ipc_callid_t callid;
47
    int res;
48
    int res;
48
    ipcarg_t phonead;
49
    ipcarg_t phonead;
49
    int phoneid;
50
    ipcarg_t phoneid;
50
    char connected = 0;
51
    char connected = 0;
51
    keybuffer_t keybuffer; 
52
    keybuffer_t keybuffer; 
52
    ipcarg_t retval, arg1, arg2;
53
    ipcarg_t retval, arg1, arg2;
-
 
54
   
-
 
55
    //open("null",0);
-
 
56
    //open("stdout",0);
53
 
57
   
54
    /* Initialize arch dependent parts */
58
    /* Initialize arch dependent parts */
55
    if (!(res = kbd_arch_init())) {
59
    if (!(res = kbd_arch_init())) {
56
            return -1;
60
            return -1;
57
            };
61
            };
58
   
62
   
Line 62... Line 66...
62
    /* Register service at nameserver */
66
    /* Register service at nameserver */
63
   
67
   
64
    if ((res = ipc_connect_to_me(PHONE_NS, SERVICE_KEYBOARD, 0, &phonead)) != 0) {
68
    if ((res = ipc_connect_to_me(PHONE_NS, SERVICE_KEYBOARD, 0, &phonead)) != 0) {
65
        return -1;
69
        return -1;
66
    };
70
    };
67
   
-
 
68
    while (1) {
71
    while (1) {
69
        callid = ipc_wait_for_call(&call);
72
        callid = ipc_wait_for_call(&call);
70
        switch (IPC_GET_METHOD(call)) {
73
        switch (IPC_GET_METHOD(call)) {
71
            case IPC_M_PHONE_HUNGUP:
74
            case IPC_M_PHONE_HUNGUP:
72
                connected = 0;
75
                connected = 0;