Changeset ffa2c8ef in mainline for uspace/srv/hid
- Timestamp:
- 2011-01-29T11:36:08Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 46b881c
- Parents:
- 64d2b10
- Location:
- uspace/srv/hid
- Files:
-
- 20 edited
-
adb_mouse/adb_dev.c (modified) (3 diffs)
-
adb_mouse/adb_mouse.c (modified) (4 diffs)
-
char_mouse/char_mouse.c (modified) (4 diffs)
-
char_mouse/chardev.c (modified) (3 diffs)
-
console/console.c (modified) (18 diffs)
-
console/gcons.c (modified) (1 diff)
-
fb/ega.c (modified) (7 diffs)
-
fb/fb.c (modified) (11 diffs)
-
fb/main.c (modified) (2 diffs)
-
fb/serial_console.c (modified) (1 diff)
-
fb/serial_console.h (modified) (1 diff)
-
kbd/generic/kbd.c (modified) (4 diffs)
-
kbd/port/adb.c (modified) (1 diff)
-
kbd/port/chardev.c (modified) (3 diffs)
-
kbd/port/gxemul.c (modified) (1 diff)
-
kbd/port/msim.c (modified) (1 diff)
-
kbd/port/ns16550.c (modified) (1 diff)
-
kbd/port/pl050.c (modified) (1 diff)
-
kbd/port/z8530.c (modified) (1 diff)
-
s3c24xx_ts/s3c24xx_ts.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/adb_mouse/adb_dev.c
r64d2b10 rffa2c8ef 34 34 */ 35 35 36 #include <ipc/ipc.h>37 36 #include <ipc/adb.h> 38 37 #include <async.h> … … 68 67 69 68 /* NB: The callback connection is slotted for removal */ 70 sysarg_t taskhash; 71 sysarg_t phonehash; 72 if (ipc_connect_to_me(dev_phone, 0, 0, 0, &taskhash, &phonehash) != 0) { 69 if (async_connect_to_me(dev_phone, 0, 0, 0, adb_dev_events) != 0) { 73 70 printf(NAME ": Failed to create callback from device\n"); 74 71 return false; 75 72 } 76 77 async_new_connection(taskhash, phonehash, 0, NULL, adb_dev_events); 78 73 79 74 return 0; 80 75 } … … 100 95 retval = ENOENT; 101 96 } 102 ipc_answer_0(callid, retval);97 async_answer_0(callid, retval); 103 98 } 104 99 } -
uspace/srv/hid/adb_mouse/adb_mouse.c
r64d2b10 rffa2c8ef 39 39 */ 40 40 41 #include <ipc/ipc.h>42 41 #include <ipc/mouse.h> 43 42 #include <stdio.h> … … 98 97 int retval; 99 98 100 ipc_answer_0(iid, EOK);99 async_answer_0(iid, EOK); 101 100 102 101 while (1) { … … 105 104 case IPC_M_PHONE_HUNGUP: 106 105 if (client_phone != -1) { 107 ipc_hangup(client_phone);106 async_hangup(client_phone); 108 107 client_phone = -1; 109 108 } 110 109 111 ipc_answer_0(callid, EOK);110 async_answer_0(callid, EOK); 112 111 return; 113 112 case IPC_M_CONNECT_TO_ME: … … 122 121 retval = EINVAL; 123 122 } 124 ipc_answer_0(callid, retval);123 async_answer_0(callid, retval); 125 124 } 126 125 } -
uspace/srv/hid/char_mouse/char_mouse.c
r64d2b10 rffa2c8ef 39 39 */ 40 40 41 #include <ipc/ipc.h>42 41 #include <ipc/mouse.h> 43 42 #include <stdio.h> … … 83 82 int retval; 84 83 85 ipc_answer_0(iid, EOK);84 async_answer_0(iid, EOK); 86 85 87 86 while (1) { … … 90 89 case IPC_M_PHONE_HUNGUP: 91 90 if (client_phone != -1) { 92 ipc_hangup(client_phone);91 async_hangup(client_phone); 93 92 client_phone = -1; 94 93 } 95 94 96 ipc_answer_0(callid, EOK);95 async_answer_0(callid, EOK); 97 96 return; 98 97 case IPC_M_CONNECT_TO_ME: … … 107 106 retval = EINVAL; 108 107 } 109 ipc_answer_0(callid, retval);108 async_answer_0(callid, retval); 110 109 } 111 110 } -
uspace/srv/hid/char_mouse/chardev.c
r64d2b10 rffa2c8ef 34 34 */ 35 35 36 #include <ipc/ipc.h>37 36 #include <ipc/char.h> 38 37 #include <async.h> … … 70 69 71 70 /* NB: The callback connection is slotted for removal */ 72 sysarg_t taskhash; 73 sysarg_t phonehash; 74 if (ipc_connect_to_me(dev_phone, 0, 0, 0, &taskhash, &phonehash) != 0) { 71 if (async_connect_to_me(dev_phone, 0, 0, 0, chardev_events) != 0) { 75 72 printf(NAME ": Failed to create callback from device\n"); 76 73 return false; 77 74 } 78 79 async_new_connection(taskhash, phonehash, 0, NULL, chardev_events);80 75 81 76 return 0; … … 115 110 retval = ENOENT; 116 111 } 117 ipc_answer_0(callid, retval);112 async_answer_0(callid, retval); 118 113 } 119 114 } -
uspace/srv/hid/console/console.c
r64d2b10 rffa2c8ef 34 34 35 35 #include <libc.h> 36 #include <ipc/ipc.h>37 36 #include <ipc/kbd.h> 38 37 #include <io/keycode.h> … … 117 116 static void curs_hide_sync(void) 118 117 { 119 ipc_call_sync_1_0(fb_info.phone, FB_CURSOR_VISIBILITY, false);118 async_req_1_0(fb_info.phone, FB_CURSOR_VISIBILITY, false); 120 119 } 121 120 … … 132 131 static void screen_yield(void) 133 132 { 134 ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_YIELD);133 async_req_0_0(fb_info.phone, FB_SCREEN_YIELD); 135 134 } 136 135 137 136 static void screen_reclaim(void) 138 137 { 139 ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_RECLAIM);138 async_req_0_0(fb_info.phone, FB_SCREEN_RECLAIM); 140 139 } 141 140 142 141 static void kbd_yield(void) 143 142 { 144 ipc_call_sync_0_0(kbd_phone, KBD_YIELD);143 async_req_0_0(kbd_phone, KBD_YIELD); 145 144 } 146 145 147 146 static void kbd_reclaim(void) 148 147 { 149 ipc_call_sync_0_0(kbd_phone, KBD_RECLAIM);148 async_req_0_0(kbd_phone, KBD_RECLAIM); 150 149 } 151 150 … … 438 437 retval = ENOENT; 439 438 } 440 ipc_answer_0(callid, retval);439 async_answer_0(callid, retval); 441 440 } 442 441 } … … 473 472 } 474 473 475 ipc_answer_0(callid, retval);474 async_answer_0(callid, retval); 476 475 } 477 476 } … … 484 483 485 484 if (rc != EOK) { 486 ipc_answer_0(rid, rc);485 async_answer_0(rid, rc); 487 486 return; 488 487 } … … 499 498 500 499 gcons_notify_char(cons->index); 501 ipc_answer_1(rid, EOK, size);500 async_answer_1(rid, EOK, size); 502 501 503 502 free(buf); … … 509 508 size_t size; 510 509 if (!async_data_read_receive(&callid, &size)) { 511 ipc_answer_0(callid, EINVAL);512 ipc_answer_0(rid, EINVAL);510 async_answer_0(callid, EINVAL); 511 async_answer_0(rid, EINVAL); 513 512 return; 514 513 } … … 516 515 char *buf = (char *) malloc(size); 517 516 if (buf == NULL) { 518 ipc_answer_0(callid, ENOMEM);519 ipc_answer_0(rid, ENOMEM);517 async_answer_0(callid, ENOMEM); 518 async_answer_0(rid, ENOMEM); 520 519 return; 521 520 } … … 535 534 if (pos == size) { 536 535 (void) async_data_read_finalize(callid, buf, size); 537 ipc_answer_1(rid, EOK, size);536 async_answer_1(rid, EOK, size); 538 537 free(buf); 539 538 } else { … … 553 552 recheck: 554 553 if (keybuffer_pop(&cons->keybuffer, &ev)) { 555 ipc_answer_4(rid, EOK, ev.type, ev.key, ev.mods, ev.c);554 async_answer_4(rid, EOK, ev.type, ev.key, ev.mods, ev.c); 556 555 } else { 557 556 fibril_condvar_wait(&input_cv, &input_mutex); … … 579 578 580 579 if (cons == NULL) { 581 ipc_answer_0(iid, ENOENT);580 async_answer_0(iid, ENOENT); 582 581 return; 583 582 } … … 598 597 599 598 /* Accept the connection */ 600 ipc_answer_0(iid, EOK);599 async_answer_0(iid, EOK); 601 600 602 601 while (true) { … … 658 657 rc = ccap_fb_to_con(fb_info.color_cap, &arg1); 659 658 if (rc != EOK) { 660 ipc_answer_0(callid, rc);659 async_answer_0(callid, rc); 661 660 continue; 662 661 } … … 702 701 break; 703 702 } 704 ipc_answer_3(callid, EOK, arg1, arg2, arg3);703 async_answer_3(callid, EOK, arg1, arg2, arg3); 705 704 } 706 705 } … … 727 726 728 727 /* NB: The callback connection is slotted for removal */ 729 sysarg_t taskhash; 730 sysarg_t phonehash; 731 if (ipc_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, 0, &taskhash, 732 &phonehash) != 0) { 728 if (async_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, 0, keyboard_events) 729 != 0) { 733 730 printf(NAME ": Failed to create callback from input device\n"); 734 731 return false; 735 732 } 736 737 async_new_connection(taskhash, phonehash, 0, NULL, keyboard_events);738 733 739 734 /* Connect to mouse device */ … … 752 747 } 753 748 754 if ( ipc_connect_to_me(mouse_phone, SERVICE_CONSOLE, 0, 0, &taskhash,755 &phonehash)!= 0) {749 if (async_connect_to_me(mouse_phone, SERVICE_CONSOLE, 0, 0, mouse_events) 750 != 0) { 756 751 printf(NAME ": Failed to create callback from mouse device\n"); 757 752 mouse_phone = -1; … … 759 754 } 760 755 761 async_new_connection(taskhash, phonehash, 0, NULL, mouse_events);762 756 skip_mouse: 763 757 -
uspace/srv/hid/console/gcons.c
r64d2b10 rffa2c8ef 34 34 35 35 #include <ipc/fb.h> 36 #include <ipc/ipc.h>37 36 #include <async.h> 38 37 #include <stdio.h> -
uspace/srv/hid/fb/ega.c
r64d2b10 rffa2c8ef 39 39 #include <align.h> 40 40 #include <async.h> 41 #include <ipc/ipc.h>42 41 #include <errno.h> 43 42 #include <stdio.h> … … 46 45 #include <as.h> 47 46 #include <ipc/fb.h> 48 #include <ipc/ipc.h>49 47 #include <ipc/ns.h> 50 48 #include <ipc/services.h> … … 262 260 263 261 if (client_connected) { 264 ipc_answer_0(iid, ELIMIT);262 async_answer_0(iid, ELIMIT); 265 263 return; 266 264 } … … 268 266 /* Accept connection */ 269 267 client_connected = 1; 270 ipc_answer_0(iid, EOK);268 async_answer_0(iid, EOK); 271 269 272 270 while (true) { … … 296 294 case IPC_M_PHONE_HUNGUP: 297 295 client_connected = 0; 298 ipc_answer_0(callid, EOK);296 async_answer_0(callid, EOK); 299 297 300 298 /* Exit thread */ … … 332 330 break; 333 331 case FB_GET_CSIZE: 334 ipc_answer_2(callid, EOK, scr_width, scr_height);332 async_answer_2(callid, EOK, scr_width, scr_height); 335 333 continue; 336 334 case FB_GET_COLOR_CAP: 337 ipc_answer_1(callid, EOK, FB_CCAP_INDEXED);335 async_answer_1(callid, EOK, FB_CCAP_INDEXED); 338 336 continue; 339 337 case FB_CLEAR: … … 440 438 retval = EINVAL; 441 439 } 442 ipc_answer_0(callid, retval);440 async_answer_0(callid, retval); 443 441 } 444 442 } -
uspace/srv/hid/fb/fb.c
r64d2b10 rffa2c8ef 47 47 #include <as.h> 48 48 #include <ipc/fb.h> 49 #include <ipc/ipc.h>50 49 #include <ipc/ns.h> 51 50 #include <ipc/services.h> … … 1089 1088 void *dest = as_get_mappable_page(IPC_GET_ARG2(*call)); 1090 1089 shm_size = IPC_GET_ARG2(*call); 1091 if ( ipc_answer_1(callid, EOK, (sysarg_t) dest)) {1090 if (async_answer_1(callid, EOK, (sysarg_t) dest)) { 1092 1091 shm_id = 0; 1093 1092 return false; … … 1166 1165 1167 1166 if (handled) 1168 ipc_answer_0(callid, retval);1167 async_answer_0(callid, retval); 1169 1168 return handled; 1170 1169 } … … 1445 1444 } 1446 1445 if (handled) 1447 ipc_answer_0(callid, retval);1446 async_answer_0(callid, retval); 1448 1447 return handled; 1449 1448 } … … 1498 1497 1499 1498 if (handled) 1500 ipc_answer_0(callid, retval);1499 async_answer_0(callid, retval); 1501 1500 return handled; 1502 1501 … … 1582 1581 1583 1582 if (client_connected) { 1584 ipc_answer_0(iid, ELIMIT);1583 async_answer_0(iid, ELIMIT); 1585 1584 return; 1586 1585 } … … 1588 1587 /* Accept connection */ 1589 1588 client_connected = true; 1590 ipc_answer_0(iid, EOK);1589 async_answer_0(iid, EOK); 1591 1590 1592 1591 while (true) { … … 1641 1640 break; 1642 1641 } 1643 ipc_answer_0(callid, EOK);1642 async_answer_0(callid, EOK); 1644 1643 1645 1644 draw_char(vport, ch, col, row); … … 1674 1673 break; 1675 1674 case FB_GET_CSIZE: 1676 ipc_answer_2(callid, EOK, vport->cols, vport->rows);1675 async_answer_2(callid, EOK, vport->cols, vport->rows); 1677 1676 continue; 1678 1677 case FB_GET_COLOR_CAP: 1679 ipc_answer_1(callid, EOK, FB_CCAP_RGB);1678 async_answer_1(callid, EOK, FB_CCAP_RGB); 1680 1679 continue; 1681 1680 case FB_SCROLL: … … 1742 1741 break; 1743 1742 case FB_GET_RESOLUTION: 1744 ipc_answer_2(callid, EOK, screen.xres, screen.yres);1743 async_answer_2(callid, EOK, screen.xres, screen.yres); 1745 1744 continue; 1746 1745 case FB_POINTER_MOVE: … … 1756 1755 retval = ENOENT; 1757 1756 } 1758 ipc_answer_0(callid, retval);1757 async_answer_0(callid, retval); 1759 1758 } 1760 1759 } -
uspace/srv/hid/fb/main.c
r64d2b10 rffa2c8ef 27 27 */ 28 28 29 #include <ipc/ipc.h>30 29 #include <ipc/services.h> 31 30 #include <ipc/ns.h> … … 52 51 53 52 dest = as_get_mappable_page(IPC_GET_ARG2(*call)); 54 if ( ipc_answer_1(callid, EOK, (sysarg_t) dest) == 0) {53 if (async_answer_1(callid, EOK, (sysarg_t) dest) == 0) { 55 54 if (*area) 56 55 as_area_destroy(*area); -
uspace/srv/hid/fb/serial_console.c
r64d2b10 rffa2c8ef 39 39 40 40 #include <stdio.h> 41 #include <ipc/ipc.h>42 41 #include <async.h> 43 42 #include <ipc/fb.h> -
uspace/srv/hid/fb/serial_console.h
r64d2b10 rffa2c8ef 39 39 #define FB_SERIAL_CONSOLE_H_ 40 40 41 #include <ipc/ipc.h> 41 #include <sys/types.h> 42 #include <ipc/common.h> 42 43 43 44 typedef void (*putc_function_t)(char); -
uspace/srv/hid/kbd/generic/kbd.c
r64d2b10 rffa2c8ef 36 36 */ 37 37 38 #include <ipc/ipc.h>39 38 #include <ipc/services.h> 40 39 #include <ipc/kbd.h> … … 173 172 int retval; 174 173 175 ipc_answer_0(iid, EOK);174 async_answer_0(iid, EOK); 176 175 177 176 while (1) { … … 180 179 case IPC_M_PHONE_HUNGUP: 181 180 if (client_phone != -1) { 182 ipc_hangup(client_phone);181 async_hangup(client_phone); 183 182 client_phone = -1; 184 183 } 185 184 186 ipc_answer_0(callid, EOK);185 async_answer_0(callid, EOK); 187 186 return; 188 187 case IPC_M_CONNECT_TO_ME: … … 205 204 retval = EINVAL; 206 205 } 207 ipc_answer_0(callid, retval);206 async_answer_0(callid, retval); 208 207 } 209 208 } -
uspace/srv/hid/kbd/port/adb.c
r64d2b10 rffa2c8ef 35 35 */ 36 36 37 #include <ipc/ipc.h>38 37 #include <ipc/adb.h> 39 38 #include <async.h> -
uspace/srv/hid/kbd/port/chardev.c
r64d2b10 rffa2c8ef 35 35 */ 36 36 37 #include <ipc/ipc.h>38 37 #include <ipc/char.h> 39 38 #include <async.h> … … 91 90 92 91 /* NB: The callback connection is slotted for removal */ 93 sysarg_t taskhash; 94 sysarg_t phonehash; 95 if (ipc_connect_to_me(dev_phone, 0, 0, 0, &taskhash, &phonehash) != 0) { 92 if (async_connect_to_me(dev_phone, 0, 0, 0, kbd_port_events) != 0) { 96 93 printf(NAME ": Failed to create callback from device\n"); 97 94 return -1; 98 95 } 99 100 async_new_connection(taskhash, phonehash, 0, NULL, kbd_port_events);101 96 102 97 return 0; … … 136 131 retval = ENOENT; 137 132 } 138 ipc_answer_0(callid, retval);133 async_answer_0(callid, retval); 139 134 } 140 135 } -
uspace/srv/hid/kbd/port/gxemul.c
r64d2b10 rffa2c8ef 35 35 */ 36 36 37 #include <ipc/ipc.h>38 37 #include <async.h> 39 38 #include <sysinfo.h> -
uspace/srv/hid/kbd/port/msim.c
r64d2b10 rffa2c8ef 35 35 */ 36 36 37 #include <ipc/ipc.h>38 37 #include <async.h> 39 38 #include <sysinfo.h> -
uspace/srv/hid/kbd/port/ns16550.c
r64d2b10 rffa2c8ef 35 35 */ 36 36 37 #include <ipc/ipc.h>38 37 #include <ipc/irc.h> 39 38 #include <async.h> -
uspace/srv/hid/kbd/port/pl050.c
r64d2b10 rffa2c8ef 37 37 #include <ddi.h> 38 38 #include <libarch/ddi.h> 39 #include <ipc/ipc.h>40 39 #include <async.h> 41 40 #include <unistd.h> -
uspace/srv/hid/kbd/port/z8530.c
r64d2b10 rffa2c8ef 35 35 */ 36 36 37 #include <ipc/ipc.h>38 37 #include <ipc/irc.h> 39 38 #include <async.h> -
uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c
r64d2b10 rffa2c8ef 42 42 #include <io/console.h> 43 43 #include <vfs/vfs.h> 44 #include <ipc/ipc.h>45 44 #include <ipc/mouse.h> 46 45 #include <async.h> … … 140 139 141 140 async_set_interrupt_received(s3c24xx_ts_irq_handler); 142 ipc_register_irq(inr, device_assign_devno(), 0, &ts_irq_code);141 register_irq(inr, device_assign_devno(), 0, &ts_irq_code); 143 142 144 143 s3c24xx_ts_wait_for_int_mode(ts, updn_down); … … 377 376 int retval; 378 377 379 ipc_answer_0(iid, EOK);378 async_answer_0(iid, EOK); 380 379 381 380 while (1) { … … 384 383 case IPC_M_PHONE_HUNGUP: 385 384 if (ts->client_phone != -1) { 386 ipc_hangup(ts->client_phone);385 async_hangup(ts->client_phone); 387 386 ts->client_phone = -1; 388 387 } 389 388 390 ipc_answer_0(callid, EOK);389 async_answer_0(callid, EOK); 391 390 return; 392 391 case IPC_M_CONNECT_TO_ME: … … 401 400 retval = EINVAL; 402 401 } 403 ipc_answer_0(callid, retval);402 async_answer_0(callid, retval); 404 403 } 405 404 }
Note:
See TracChangeset
for help on using the changeset viewer.
