Changes in / [9247c02c:2f2f1186] in mainline
- Files:
-
- 10 edited
-
kernel/generic/include/ipc/ipc.h (modified) (2 diffs)
-
kernel/generic/src/ipc/event.c (modified) (1 diff)
-
kernel/generic/src/ipc/ipc.c (modified) (2 diffs)
-
kernel/generic/src/ipc/sysipc.c (modified) (2 diffs)
-
uspace/lib/c/generic/async.c (modified) (15 diffs)
-
uspace/lib/c/include/async.h (modified) (2 diffs)
-
uspace/lib/c/include/ipc/common.h (modified) (2 diffs)
-
uspace/srv/vfs/vfs.c (modified) (3 diffs)
-
uspace/srv/vfs/vfs.h (modified) (2 diffs)
-
uspace/srv/vfs/vfs_file.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/ipc/ipc.h
r9247c02c r2f2f1186 40 40 #include <synch/mutex.h> 41 41 #include <synch/waitq.h> 42 #include <typedefs.h>43 42 44 43 #define IPC_MAX_PHONES 32 … … 99 98 sysarg_t args[IPC_CALL_LEN]; 100 99 /** Task which made or forwarded the call with IPC_FF_ROUTE_FROM_ME. */ 101 task_id_t task_id;100 struct task *task; 102 101 /** Phone which made or last masqueraded this call. */ 103 102 phone_t *phone; -
kernel/generic/src/ipc/event.c
r9247c02c r2f2f1186 161 161 IPC_SET_ARG5(call->data, a5); 162 162 163 call->data.task_id = TASK ? TASK->taskid : 0;164 165 163 irq_spinlock_lock(&event->answerbox->irq_lock, true); 166 164 list_append(&call->link, &event->answerbox->irq_notifs); -
kernel/generic/src/ipc/ipc.c
r9247c02c r2f2f1186 294 294 atomic_inc(&phone->active_calls); 295 295 call->data.phone = phone; 296 call->data.task _id = TASK->taskid;296 call->data.task = TASK; 297 297 } 298 298 … … 406 406 call->caller_phone = call->data.phone; 407 407 call->data.phone = newphone; 408 call->data.task _id = TASK->taskid;408 call->data.task = TASK; 409 409 } 410 410 -
kernel/generic/src/ipc/sysipc.c
r9247c02c r2f2f1186 54 54 #include <mm/as.h> 55 55 #include <print.h> 56 #include <macros.h>57 56 58 57 /** … … 376 375 IPC_GET_ARG2(*olddata), 377 376 IPC_GET_ARG3(*olddata), 378 LOWER32(olddata->task_id),379 UPPER32(olddata->task_id));377 (sysarg_t) olddata->task, 378 (sysarg_t) TASK); 380 379 IPC_SET_RETVAL(answer->data, rc); 381 380 } -
uspace/lib/c/generic/async.c
r9247c02c r2f2f1186 112 112 #include <mem.h> 113 113 #include <stdlib.h> 114 #include <macros.h>115 114 #include "private/async.h" 116 115 … … 139 138 link_t link; 140 139 141 sysarg_t in_task_ id;140 sysarg_t in_task_hash; 142 141 atomic_t refcnt; 143 142 void *data; … … 151 150 link_t link; 152 151 153 /** Incoming client task ID. */154 task_id_t in_task_id;152 /** Incoming client task hash. */ 153 sysarg_t in_task_hash; 155 154 156 155 /** Incoming phone hash. */ … … 284 283 { 285 284 assert(key); 286 assert(keys == 2);287 285 assert(item); 288 286 289 287 client_t *client = hash_table_get_instance(item, client_t, link); 290 return (key[0] == LOWER32(client->in_task_id) && 291 (key[1] == UPPER32(client->in_task_id))); 288 return (key[0] == client->in_task_hash); 292 289 } 293 290 … … 577 574 } 578 575 579 static client_t *async_client_get(task_id_t client_id, bool create) 580 { 581 unsigned long key[2] = { 582 LOWER32(client_id), 583 UPPER32(client_id), 584 }; 576 static client_t *async_client_get(sysarg_t client_hash, bool create) 577 { 578 unsigned long key = client_hash; 585 579 client_t *client = NULL; 586 580 587 581 futex_down(&async_futex); 588 link_t *lnk = hash_table_find(&client_hash_table, key);582 link_t *lnk = hash_table_find(&client_hash_table, &key); 589 583 if (lnk) { 590 584 client = hash_table_get_instance(lnk, client_t, link); … … 593 587 client = malloc(sizeof(client_t)); 594 588 if (client) { 595 client->in_task_ id = client_id;589 client->in_task_hash = client_hash; 596 590 client->data = async_client_data_create(); 597 591 598 592 atomic_set(&client->refcnt, 1); 599 hash_table_insert(&client_hash_table, key, &client->link);593 hash_table_insert(&client_hash_table, &key, &client->link); 600 594 } 601 595 } … … 608 602 { 609 603 bool destroy; 610 unsigned long key[2] = { 611 LOWER32(client->in_task_id), 612 UPPER32(client->in_task_id) 613 }; 604 unsigned long key = client->in_task_hash; 614 605 615 606 futex_down(&async_futex); 616 607 617 608 if (atomic_predec(&client->refcnt) == 0) { 618 hash_table_remove(&client_hash_table, key, 2);609 hash_table_remove(&client_hash_table, &key, 1); 619 610 destroy = true; 620 611 } else … … 637 628 } 638 629 639 void *async_get_client_data_by_ id(task_id_t client_id)640 { 641 client_t *client = async_client_get(client_ id, false);630 void *async_get_client_data_by_hash(sysarg_t client_hash) 631 { 632 client_t *client = async_client_get(client_hash, false); 642 633 if (!client) 643 634 return NULL; … … 650 641 } 651 642 652 void async_put_client_data_by_ id(task_id_t client_id)653 { 654 client_t *client = async_client_get(client_ id, false);643 void async_put_client_data_by_hash(sysarg_t client_hash) 644 { 645 client_t *client = async_client_get(client_hash, false); 655 646 656 647 assert(client); … … 689 680 */ 690 681 691 client_t *client = async_client_get(fibril_connection->in_task_ id, true);682 client_t *client = async_client_get(fibril_connection->in_task_hash, true); 692 683 if (!client) { 693 684 ipc_answer_0(fibril_connection->callid, ENOMEM); … … 746 737 * particular fibrils. 747 738 * 748 * @param in_task_ idIdentification of the incoming connection.739 * @param in_task_hash Identification of the incoming connection. 749 740 * @param in_phone_hash Identification of the incoming connection. 750 741 * @param callid Hash of the opening IPC_M_CONNECT_ME_TO call. … … 760 751 * 761 752 */ 762 fid_t async_new_connection( task_id_t in_task_id, sysarg_t in_phone_hash,753 fid_t async_new_connection(sysarg_t in_task_hash, sysarg_t in_phone_hash, 763 754 ipc_callid_t callid, ipc_call_t *call, 764 755 async_client_conn_t cfibril, void *carg) … … 772 763 } 773 764 774 conn->in_task_ id = in_task_id;765 conn->in_task_hash = in_task_hash; 775 766 conn->in_phone_hash = in_phone_hash; 776 767 list_initialize(&conn->msg_queue); … … 831 822 case IPC_M_CONNECT_ME_TO: 832 823 /* Open new connection with fibril, etc. */ 833 async_new_connection(call->in_task_ id, IPC_GET_ARG5(*call),824 async_new_connection(call->in_task_hash, IPC_GET_ARG5(*call), 834 825 callid, call, client_connection, NULL); 835 826 return; … … 979 970 { 980 971 if (!hash_table_create(&client_hash_table, CLIENT_HASH_TABLE_BUCKETS, 981 2, &client_hash_table_ops))972 1, &client_hash_table_ops)) 982 973 abort(); 983 974 -
uspace/lib/c/include/async.h
r9247c02c r2f2f1186 176 176 extern int async_wait_timeout(aid_t, sysarg_t *, suseconds_t); 177 177 178 extern fid_t async_new_connection( task_id_t, sysarg_t, ipc_callid_t,178 extern fid_t async_new_connection(sysarg_t, sysarg_t, ipc_callid_t, 179 179 ipc_call_t *, async_client_conn_t, void *); 180 180 … … 186 186 extern void async_set_client_data_destructor(async_client_data_dtor_t); 187 187 extern void *async_get_client_data(void); 188 extern void *async_get_client_data_by_ id(task_id_t);189 extern void async_put_client_data_by_ id(task_id_t);188 extern void *async_get_client_data_by_hash(sysarg_t); 189 extern void async_put_client_data_by_hash(sysarg_t); 190 190 191 191 extern void async_set_client_connection(async_client_conn_t); -
uspace/lib/c/include/ipc/common.h
r9247c02c r2f2f1186 39 39 #include <abi/ipc/ipc.h> 40 40 #include <atomic.h> 41 #include <task.h>42 41 43 42 #define IPC_FLAG_BLOCKING 0x01 … … 45 44 typedef struct { 46 45 sysarg_t args[IPC_CALL_LEN]; 47 task_id_t in_task_id;46 sysarg_t in_task_hash; 48 47 sysarg_t in_phone_hash; 49 48 } ipc_call_t; -
uspace/srv/vfs/vfs.c
r9247c02c r2f2f1186 36 36 */ 37 37 38 #include <vfs/vfs.h>39 38 #include <ipc/services.h> 40 39 #include <abi/ipc/event.h> … … 48 47 #include <as.h> 49 48 #include <atomic.h> 50 #include < macros.h>49 #include <vfs/vfs.h> 51 50 #include "vfs.h" 52 51 … … 144 143 case VFS_TASK_STATE_CHANGE: 145 144 if (IPC_GET_ARG1(*call) == VFS_PASS_HANDLE) 146 vfs_pass_handle( 147 (task_id_t) MERGE_LOUP32(IPC_GET_ARG4(*call), 148 IPC_GET_ARG5(*call)), call->in_task_id, 149 (int) IPC_GET_ARG2(*call)); 145 vfs_pass_handle(IPC_GET_ARG4(*call), 146 IPC_GET_ARG5(*call), (int) IPC_GET_ARG2(*call)); 150 147 break; 151 148 default: -
uspace/srv/vfs/vfs.h
r9247c02c r2f2f1186 41 41 #include <bool.h> 42 42 #include <ipc/vfs.h> 43 #include <task.h>44 43 45 44 #ifndef dprintf … … 189 188 extern void vfs_client_data_destroy(void *); 190 189 191 extern void vfs_pass_handle( task_id_t, task_id_t, int);190 extern void vfs_pass_handle(sysarg_t, sysarg_t, int); 192 191 extern int vfs_wait_handle_internal(void); 193 192 -
uspace/srv/vfs/vfs_file.c
r9247c02c r2f2f1186 44 44 #include <fibril_synch.h> 45 45 #include <adt/list.h> 46 #include <task.h>47 46 #include "vfs.h" 48 47 … … 347 346 } 348 347 349 void vfs_pass_handle( task_id_t donor_id, task_id_t acceptor_id, int donor_fd)348 void vfs_pass_handle(sysarg_t donor_hash, sysarg_t acceptor_hash, int donor_fd) 350 349 { 351 350 vfs_client_data_t *donor_data = NULL; … … 356 355 int acceptor_fd; 357 356 358 acceptor_data = async_get_client_data_by_ id(acceptor_id);357 acceptor_data = async_get_client_data_by_hash(acceptor_hash); 359 358 if (!acceptor_data) 360 359 return; … … 366 365 bh->handle = -1; 367 366 368 donor_data = async_get_client_data_by_ id(donor_id);367 donor_data = async_get_client_data_by_hash(donor_hash); 369 368 if (!donor_data) 370 369 goto out; … … 403 402 404 403 if (donor_data) 405 async_put_client_data_by_ id(donor_id);404 async_put_client_data_by_hash(donor_hash); 406 405 if (acceptor_data) 407 async_put_client_data_by_ id(acceptor_id);406 async_put_client_data_by_hash(acceptor_hash); 408 407 if (donor_file) 409 408 _vfs_file_put(donor_data, donor_file);
Note:
See TracChangeset
for help on using the changeset viewer.
