Rev 3959 | Rev 4042 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3959 | Rev 3982 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* |
1 | /* |
2 | * Copyright (c) 2001-2006 Jakub Jermar |
2 | * Copyright (c) 2009 Jakub Jermar |
3 | * All rights reserved. |
3 | * All rights reserved. |
4 | * |
4 | * |
5 | * Redistribution and use in source and binary forms, with or without |
5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions |
6 | * modification, are permitted provided that the following conditions |
7 | * are met: |
7 | * are met: |
Line 45... | Line 45... | ||
45 | #include <arch.h> |
45 | #include <arch.h> |
46 | #include <console/chardev.h> |
46 | #include <console/chardev.h> |
47 | #include <console/console.h> |
47 | #include <console/console.h> |
48 | #include <interrupt.h> |
48 | #include <interrupt.h> |
49 | #include <arch/interrupt.h> |
49 | #include <arch/interrupt.h> |
50 | #include <sysinfo/sysinfo.h> |
- | |
51 | #include <synch/spinlock.h> |
50 | #include <synch/spinlock.h> |
52 | #include <mm/slab.h> |
51 | #include <mm/slab.h> |
53 | 52 | ||
54 | #define LSR_DATA_READY 0x01 |
53 | #define LSR_DATA_READY 0x01 |
55 | 54 | ||
Line 102... | Line 101... | ||
102 | irq_register(&instance->irq); |
101 | irq_register(&instance->irq); |
103 | 102 | ||
104 | while ((pio_read_8(&dev->lsr) & LSR_DATA_READY)) |
103 | while ((pio_read_8(&dev->lsr) & LSR_DATA_READY)) |
105 | (void) pio_read_8(&dev->rbr); |
104 | (void) pio_read_8(&dev->rbr); |
106 | 105 | ||
107 | /* |
- | |
108 | * This is the necessary evil until the userspace driver is entirely |
- | |
109 | * self-sufficient. |
- | |
110 | */ |
- | |
111 | sysinfo_set_item_val("kbd", NULL, true); |
- | |
112 | sysinfo_set_item_val("kbd.type", NULL, KBD_NS16550); |
- | |
113 | sysinfo_set_item_val("kbd.devno", NULL, devno); |
- | |
114 | sysinfo_set_item_val("kbd.inr", NULL, inr); |
- | |
115 | sysinfo_set_item_val("kbd.address.virtual", NULL, (uintptr_t) dev); |
- | |
116 | sysinfo_set_item_val("kbd.port", NULL, (uintptr_t) dev); |
- | |
117 | - | ||
118 | /* Enable interrupts */ |
106 | /* Enable interrupts */ |
119 | pio_write_8(&dev->ier, IER_ERBFI); |
107 | pio_write_8(&dev->ier, IER_ERBFI); |
120 | pio_write_8(&dev->mcr, MCR_OUT2); |
108 | pio_write_8(&dev->mcr, MCR_OUT2); |
121 | 109 | ||
122 | return true; |
110 | return true; |