Changeset b0f00a9 in mainline for uspace/srv/hid/input/port/ns16550.c
- Timestamp:
- 2011-11-06T22:21:05Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 898e847
- Parents:
- 2bdf8313 (diff), 7b5f4c9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 moved
-
uspace/srv/hid/input/port/ns16550.c (moved) (moved from uspace/srv/hid/kbd/port/ns16550.c ) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/input/port/ns16550.c
r2bdf8313 rb0f00a9 1 1 /* 2 2 * Copyright (c) 2006 Josef Cejka 3 * Copyright (c) 2011 Jiri Svoboda 3 4 * All rights reserved. 4 5 * … … 38 39 #include <async.h> 39 40 #include <sysinfo.h> 41 #include <input.h> 40 42 #include <kbd.h> 41 43 #include <kbd_port.h> 42 #include <sun.h>43 44 #include <ddi.h> 44 45 #include <errno.h> 46 47 static int ns16550_port_init(kbd_dev_t *); 48 static void ns16550_port_yield(void); 49 static void ns16550_port_reclaim(void); 50 static void ns16550_port_write(uint8_t data); 51 52 kbd_port_ops_t ns16550_port = { 53 .init = ns16550_port_init, 54 .yield = ns16550_port_yield, 55 .reclaim = ns16550_port_reclaim, 56 .write = ns16550_port_write 57 }; 58 59 static kbd_dev_t *kbd_dev; 45 60 46 61 /* NS16550 registers */ … … 90 105 91 106 static uintptr_t ns16550_physical; 92 static uintptr_t ns16550_kernel; 107 static uintptr_t ns16550_kernel; 93 108 94 int ns16550_port_init(void) 109 static kbd_dev_t *kbd_dev; 110 111 static int ns16550_port_init(kbd_dev_t *kdev) 95 112 { 96 113 void *vaddr; 97 114 115 kbd_dev = kdev; 116 117 sysarg_t ns16550; 118 if (sysinfo_get_value("kbd.type.ns16550", &ns16550) != EOK) 119 return -1; 120 if (!ns16550) 121 return -1; 122 98 123 if (sysinfo_get_value("kbd.address.physical", &ns16550_physical) != EOK) 99 124 return -1; … … 115 140 } 116 141 142 static void ns16550_port_yield(void) 143 { 144 } 145 146 static void ns16550_port_reclaim(void) 147 { 148 } 149 150 static void ns16550_port_write(uint8_t data) 151 { 152 (void) data; 153 } 154 117 155 static void ns16550_irq_handler(ipc_callid_t iid, ipc_call_t *call) 118 156 { 119 int scan_code = IPC_GET_ARG2(*call); 120 kbd_push_scancode(scan_code); 157 kbd_push_data(kbd_dev, IPC_GET_ARG2(*call)); 121 158 122 if (irc_service) 123 async_msg_1(irc_phone, IRC_CLEAR_INTERRUPT, 124 IPC_GET_IMETHOD(*call)); 159 if (irc_service) { 160 async_exch_t *exch = async_exchange_begin(irc_sess); 161 async_msg_1(exch, IRC_CLEAR_INTERRUPT, IPC_GET_IMETHOD(*call)); 162 async_exchange_end(exch); 163 } 125 164 } 126 165
Note:
See TracChangeset
for help on using the changeset viewer.
