Subversion Repositories HelenOS

Rev

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

Rev 3343 Rev 3549
Line 33... Line 33...
33
 */
33
 */
34
/** @file
34
/** @file
35
 */
35
 */
36
 
36
 
37
#include <arch/kbd.h>
37
#include <arch/kbd.h>
-
 
38
#include <arch/sgcn.h>
38
#include <ipc/ipc.h>
39
#include <ipc/ipc.h>
39
#include <sysinfo.h>
40
#include <sysinfo.h>
40
#include <kbd.h>
41
#include <kbd.h>
41
#include <keys.h>
42
#include <keys.h>
42
#include <stdio.h>
43
#include <stdio.h>
Line 76... Line 77...
76
    ns16550_cmds
77
    ns16550_cmds
77
};
78
};
78
 
79
 
79
#define KBD_Z8530   1
80
#define KBD_Z8530   1
80
#define KBD_NS16550 2
81
#define KBD_NS16550 2
-
 
82
#define KBD_SGCN    3
81
 
83
 
82
int kbd_arch_init(void)
84
int kbd_arch_init(void)
83
{
85
{
84
    int type = sysinfo_value("kbd.type");
86
    int type = sysinfo_value("kbd.type");
85
    switch (type) {
87
    switch (type) {
Line 89... Line 91...
89
        break;
91
        break;
90
    case KBD_NS16550:
92
    case KBD_NS16550:
91
        ns16550_cmds[0].addr = (void *) sysinfo_value("kbd.address.virtual");
93
        ns16550_cmds[0].addr = (void *) sysinfo_value("kbd.address.virtual");
92
        ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &ns16550_kbd);
94
        ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &ns16550_kbd);
93
        break;
95
        break;
-
 
96
    case KBD_SGCN:
-
 
97
        sgcn_init();
-
 
98
        break;
94
    default:
99
    default:
95
        break;
100
        break;
96
    }
101
    }
97
    return 0;
102
    return 0;
98
}
103
}
99
 
104
 
100
/** Process keyboard events */
105
/** Process keyboard events */
101
int kbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call)
106
int kbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call)
102
{
107
{
-
 
108
    if (sysinfo_value("kbd.type") == KBD_SGCN) {
-
 
109
        sgcn_key_pressed();
-
 
110
        return 1;
-
 
111
    }
-
 
112
   
103
    int scan_code = IPC_GET_ARG1(*call);
113
    int scan_code = IPC_GET_ARG1(*call);
104
 
114
 
105
    if (scan_code == KBD_ALL_KEYS_UP)
115
    if (scan_code == KBD_ALL_KEYS_UP)
106
        return 1;
116
        return 1;
107
       
117