Changeset 3b3e776 in mainline for uspace/srv/hid/kbd
- Timestamp:
- 2010-02-05T10:57:50Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0358da0
- Parents:
- 3f085132 (diff), b4cbef1 (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. - Location:
- uspace/srv/hid/kbd
- Files:
-
- 3 added
- 31 moved
-
Makefile (moved) (moved from uspace/srv/cir/obio/Makefile ) (1 diff)
-
Makefile.build (moved) (moved from uspace/srv/kbd/Makefile.build ) (5 diffs)
-
Makefile.common (moved) (moved from uspace/srv/bd/file_bd/Makefile.common ) (1 diff)
-
ctl/apple.c (added)
-
ctl/gxe_fb.c (moved) (moved from uspace/srv/kbd/ctl/gxe_fb.c )
-
ctl/pc.c (moved) (moved from uspace/srv/kbd/ctl/pc.c )
-
ctl/pl050.c (moved) (moved from uspace/srv/kbd/ctl/pl050.c )
-
ctl/stty.c (moved) (moved from uspace/srv/kbd/ctl/stty.c )
-
ctl/sun.c (moved) (moved from uspace/srv/kbd/ctl/sun.c )
-
genarch/gsp.c (moved) (moved from uspace/srv/kbd/genarch/gsp.c )
-
genarch/stroke.c (moved) (moved from uspace/srv/kbd/genarch/stroke.c )
-
generic/kbd.c (moved) (moved from uspace/srv/kbd/generic/kbd.c ) (7 diffs)
-
include/gsp.h (moved) (moved from uspace/srv/kbd/include/gsp.h )
-
include/kbd.h (moved) (moved from uspace/srv/kbd/include/kbd.h )
-
include/kbd_ctl.h (moved) (moved from uspace/srv/kbd/include/kbd_ctl.h )
-
include/kbd_port.h (moved) (moved from uspace/srv/kbd/include/kbd_port.h )
-
include/layout.h (moved) (moved from uspace/srv/kbd/include/layout.h )
-
include/stroke.h (moved) (moved from uspace/srv/kbd/include/stroke.h )
-
include/sun.h (moved) (moved from uspace/srv/kbd/include/sun.h )
-
layout/cz.c (moved) (moved from uspace/srv/kbd/layout/cz.c )
-
layout/us_dvorak.c (moved) (moved from uspace/srv/kbd/layout/us_dvorak.c )
-
layout/us_qwerty.c (moved) (moved from uspace/srv/kbd/layout/us_qwerty.c )
-
port/adb.c (added)
-
port/chardev.c (added)
-
port/dummy.c (moved) (moved from uspace/srv/kbd/port/dummy.c )
-
port/gxemul.c (moved) (moved from uspace/srv/kbd/port/gxemul.c )
-
port/i8042.h (moved) (moved from uspace/srv/kbd/port/i8042.h )
-
port/msim.c (moved) (moved from uspace/srv/kbd/port/msim.c )
-
port/ns16550.c (moved) (moved from uspace/srv/kbd/port/ns16550.c )
-
port/pl050.c (moved) (moved from uspace/srv/kbd/port/pl050.c )
-
port/sgcn.c (moved) (moved from uspace/srv/kbd/port/sgcn.c )
-
port/ski.c (moved) (moved from uspace/srv/kbd/port/ski.c )
-
port/sun.c (moved) (moved from uspace/srv/kbd/port/sun.c )
-
port/z8530.c (moved) (moved from uspace/srv/kbd/port/z8530.c )
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/kbd/Makefile
r3f085132 r3b3e776 34 34 all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS) 35 35 -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV) 36 $(MAKE) -f Makefile.build 36 $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK) 37 37 38 38 clean: 39 rm -f $(DEPEND) $(DEPEND_PREV) $( OUTPUT) $(OUTPUT).map $(OUTPUT).disasm39 rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm 40 40 find . -name '*.o' -follow -exec rm \{\} \; -
uspace/srv/hid/kbd/Makefile.build
r3f085132 r3b3e776 49 49 ifeq ($(UARCH),amd64) 50 50 SOURCES += \ 51 port/ i8042.c \51 port/chardev.c \ 52 52 ctl/pc.c 53 53 endif … … 75 75 ifeq ($(UARCH),ia32) 76 76 SOURCES += \ 77 port/ i8042.c \77 port/chardev.c \ 78 78 ctl/pc.c 79 79 endif … … 81 81 ifeq ($(MACHINE),i460GX) 82 82 SOURCES += \ 83 port/ i8042.c \83 port/chardev.c \ 84 84 ctl/pc.c 85 85 endif … … 125 125 ifeq ($(UARCH),ppc32) 126 126 SOURCES += \ 127 port/ dummy.c \128 ctl/ stty.c127 port/adb.c \ 128 ctl/apple.c 129 129 endif 130 130 … … 159 159 %.o: %.c $(DEPEND) 160 160 $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ 161 ifeq ($(PRECHECK),y) 162 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) 163 endif 161 164 162 165 $(DEPEND): -
uspace/srv/hid/kbd/Makefile.common
r3f085132 r3b3e776 37 37 DEPEND = Makefile.depend 38 38 DEPEND_PREV = $(DEPEND).prev 39 OUTPUT = file_bd 39 JOB = kbd.job 40 OUTPUT = kbd -
uspace/srv/hid/kbd/generic/kbd.c
r3f085132 r3b3e776 50 50 #include <io/console.h> 51 51 #include <io/keycode.h> 52 #include <devmap.h> 52 53 53 54 #include <kbd.h> … … 56 57 #include <layout.h> 57 58 58 #define NAME "kbd"59 60 int cons_connected = 0; 61 int phone2cons= -1;59 #define NAME "kbd" 60 #define NAMESPACE "hid_in" 61 62 int client_phone = -1; 62 63 63 64 /** Currently active modifiers. */ … … 163 164 ev.c = layout[active_layout]->parse_ev(&ev); 164 165 165 async_msg_4( phone2cons, KBD_EVENT, ev.type, ev.key, ev.mods, ev.c);166 } 167 168 static void c onsole_connection(ipc_callid_t iid, ipc_call_t *icall)166 async_msg_4(client_phone, KBD_EVENT, ev.type, ev.key, ev.mods, ev.c); 167 } 168 169 static void client_connection(ipc_callid_t iid, ipc_call_t *icall) 169 170 { 170 171 ipc_callid_t callid; … … 172 173 int retval; 173 174 174 if (cons_connected) {175 ipc_answer_0(iid, ELIMIT);176 return;177 }178 cons_connected = 1;179 175 ipc_answer_0(iid, EOK); 180 176 … … 183 179 switch (IPC_GET_METHOD(call)) { 184 180 case IPC_M_PHONE_HUNGUP: 185 cons_connected = 0; 186 ipc_hangup(phone2cons); 187 phone2cons = -1; 181 if (client_phone != -1) { 182 ipc_hangup(client_phone); 183 client_phone = -1; 184 } 185 188 186 ipc_answer_0(callid, EOK); 189 187 return; 190 188 case IPC_M_CONNECT_TO_ME: 191 if ( phone2cons!= -1) {189 if (client_phone != -1) { 192 190 retval = ELIMIT; 193 191 break; 194 192 } 195 phone2cons= IPC_GET_ARG5(call);193 client_phone = IPC_GET_ARG5(call); 196 194 retval = 0; 197 195 break; … … 216 214 printf(NAME ": HelenOS Keyboard service\n"); 217 215 218 ipcarg_t phonead;219 220 216 if (sysinfo_value("kbd.cir.fhc") == 1) 221 217 cir_service = SERVICE_FHC; … … 241 237 layout[active_layout]->reset(); 242 238 243 async_set_client_connection(console_connection); 244 245 /* Register service at nameserver. */ 246 if (ipc_connect_to_me(PHONE_NS, SERVICE_KEYBOARD, 0, 0, &phonead) != 0) 247 return -1; 248 239 /* Register driver */ 240 int rc = devmap_driver_register(NAME, client_connection); 241 if (rc < 0) { 242 printf(NAME ": Unable to register driver (%d)\n", rc); 243 return -1; 244 } 245 246 char kbd[DEVMAP_NAME_MAXLEN + 1]; 247 snprintf(kbd, DEVMAP_NAME_MAXLEN, "%s/%s", NAMESPACE, NAME); 248 249 dev_handle_t dev_handle; 250 if (devmap_device_register(kbd, &dev_handle) != EOK) { 251 printf(NAME ": Unable to register device %s\n", kbd); 252 return -1; 253 } 254 249 255 printf(NAME ": Accepting connections\n"); 250 256 async_manager();
Note:
See TracChangeset
for help on using the changeset viewer.
