Subversion Repositories HelenOS

Rev

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

Rev 3657 Rev 3661
Line 56... Line 56...
56
#include <ipc/ns.h>
56
#include <ipc/ns.h>
57
#include <ipc/services.h>
57
#include <ipc/services.h>
58
#include <libarch/ddi.h>
58
#include <libarch/ddi.h>
59
 
59
 
60
 
60
 
-
 
61
extern int lkbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call);
-
 
62
extern int lkbd_arch_init(void);
-
 
63
 
-
 
64
 
-
 
65
 
61
#define KEY_F1 0x504f1b
66
#define KEY_F1 0x504f1b
62
#define KEY_F2 0x514f1b
67
#define KEY_F2 0x514f1b
63
#define KEY_F3 0x524f1b
68
#define KEY_F3 0x524f1b
64
#define KEY_F4 0x534f1b
69
#define KEY_F4 0x534f1b
65
#define KEY_F5 0x7e35315b1b
70
#define KEY_F5 0x7e35315b1b
Line 138... Line 143...
138
int kbd_arch_init(void)
143
int kbd_arch_init(void)
139
{
144
{
140
    if (sysinfo_value("kbd")) {
145
    if (sysinfo_value("kbd")) {
141
        kbd_type=sysinfo_value("kbd.type");
146
        kbd_type=sysinfo_value("kbd.type");
142
        if(kbd_type==KBD_SKI) ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &ski_kbd);
147
        if(kbd_type==KBD_SKI) ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &ski_kbd);
-
 
148
        if(kbd_type==KBD_LEGACY) return lkbd_arch_init();
143
        if(kbd_type==KBD_NS16550) {
149
        if(kbd_type==KBD_NS16550) {
144
            ns16550_kbd.cmds[0].addr= (void *)  (sysinfo_value("kbd.port")+RBR_REG);
150
            ns16550_kbd.cmds[0].addr= (void *)  (sysinfo_value("kbd.port")+RBR_REG);
145
            ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &ns16550_kbd);
151
            ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &ns16550_kbd);
146
            iospace_enable(task_get_id(),ns16550_port=sysinfo_value("kbd.port"),8);
152
            iospace_enable(task_get_id(),ns16550_port=sysinfo_value("kbd.port"),8);
147
        }  
153
        }  
Line 320... Line 326...
320
    //keybuffer_push(keybuffer, to_hex((scan_code>>4)&0xf));
326
    //keybuffer_push(keybuffer, to_hex((scan_code>>4)&0xf));
321
    //keybuffer_push(keybuffer, to_hex(scan_code&0xf));
327
    //keybuffer_push(keybuffer, to_hex(scan_code&0xf));
322
    //keybuffer_push(keybuffer, ' ');
328
    //keybuffer_push(keybuffer, ' ');
323
    //keybuffer_push(keybuffer, ' ');
329
    //keybuffer_push(keybuffer, ' ');
324
    //*/
330
    //*/
325
 
-
 
326
   
331
   
327
    if (scan_code) {
332
    if (scan_code) {
328
        buf |= (unsigned long long) scan_code<<(8*(count++));
333
        buf |= (unsigned long long) scan_code<<(8*(count++));
329
    } else {
334
    } else {
330
       
335
       
Line 387... Line 392...
387
int kbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call)
392
int kbd_arch_process(keybuffer_t *keybuffer, ipc_call_t *call)
388
{
393
{
389
    printf("KBD Key pressed: %x(%c)\n",IPC_GET_ARG2(*call),IPC_GET_ARG2(*call));
394
    printf("KBD Key pressed: %x(%c)\n",IPC_GET_ARG2(*call),IPC_GET_ARG2(*call));
390
    if(kbd_type==KBD_SKI) return kbd_ski_process(keybuffer,call);
395
    if(kbd_type==KBD_SKI) return kbd_ski_process(keybuffer,call);
391
    if(kbd_type==KBD_NS16550) return kbd_ns16550_process(keybuffer,call);
396
    if(kbd_type==KBD_NS16550) return kbd_ns16550_process(keybuffer,call);
-
 
397
    if(kbd_type==KBD_LEGACY) return lkbd_arch_process(keybuffer,call);
392
 
398
 
393
   
399
   
394
}
400
}
395
 
401
 
396
 
402