Changeset 601 for trunk/kernel/kern/rpc.c
- Timestamp:
- Dec 3, 2018, 12:15:01 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/rpc.c
r591 r601 49 49 rpc_server_t * rpc_server[RPC_MAX_INDEX] = 50 50 { 51 &rpc_pmem_get_pages_server, // 052 &rpc_pmem_release_pages_server, // 153 &rpc_undefined, // 2 unused slot54 &rpc_process_make_fork_server, // 355 &rpc_undefined, // 4 unused slot56 &rpc_undefined, // 5 unused slot57 &rpc_thread_user_create_server, // 658 &rpc_thread_kernel_create_server, // 759 &rpc_undefined, // 8 unused slot60 &rpc_process_sigaction_server, // 961 62 &rpc_vfs_inode_create_server, // 1063 &rpc_vfs_inode_destroy_server, // 1164 &rpc_vfs_dentry_create_server, // 1265 &rpc_vfs_dentry_destroy_server, // 1366 &rpc_vfs_file_create_server, // 1467 &rpc_vfs_file_destroy_server, // 1568 &rpc_vfs_ inode_load_server, // 1669 &rpc_vfs_ mapper_load_all_server,// 1770 &rpc_ fatfs_get_cluster_server, // 1871 &rpc_ undefined, // 19 unused slot72 73 &rpc_vmm_get_vseg_server, // 2074 &rpc_vmm_global_update_pte_server, // 2175 &rpc_kcm_alloc_server, // 2276 &rpc_kcm_free_server, // 2377 &rpc_mapper_move_ buffer_server,// 2478 &rpc_mapper_ get_page_server, // 2579 &rpc_ vmm_create_vseg_server, // 2680 &rpc_ undefined, // 27 unused slot81 &rpc_vmm_set_cow_server, // 2882 &rpc_vmm_display_server, // 2951 &rpc_pmem_get_pages_server, // 0 52 &rpc_pmem_release_pages_server, // 1 53 &rpc_undefined, // 2 unused slot 54 &rpc_process_make_fork_server, // 3 55 &rpc_undefined, // 4 unused slot 56 &rpc_undefined, // 5 unused slot 57 &rpc_thread_user_create_server, // 6 58 &rpc_thread_kernel_create_server, // 7 59 &rpc_undefined, // 8 unused slot 60 &rpc_process_sigaction_server, // 9 61 62 &rpc_vfs_inode_create_server, // 10 63 &rpc_vfs_inode_destroy_server, // 11 64 &rpc_vfs_dentry_create_server, // 12 65 &rpc_vfs_dentry_destroy_server, // 13 66 &rpc_vfs_file_create_server, // 14 67 &rpc_vfs_file_destroy_server, // 15 68 &rpc_vfs_fs_child_init_server, // 16 69 &rpc_vfs_fs_add_dentry_server, // 17 70 &rpc_vfs_fs_remove_dentry_server, // 18 71 &rpc_vfs_inode_load_all_pages_server, // 19 72 73 &rpc_vmm_get_vseg_server, // 20 74 &rpc_vmm_global_update_pte_server, // 21 75 &rpc_kcm_alloc_server, // 22 76 &rpc_kcm_free_server, // 23 77 &rpc_mapper_move_user_server, // 24 78 &rpc_mapper_handle_miss_server, // 25 79 &rpc_undefined, // 26 unused slot 80 &rpc_vmm_create_vseg_server, // 27 81 &rpc_vmm_set_cow_server, // 28 82 &rpc_vmm_display_server, // 29 83 83 }; 84 84 85 85 char * rpc_str[RPC_MAX_INDEX] = 86 86 { 87 "PMEM_GET_PAGES", // 088 "PMEM_RELEASE_PAGES", // 189 "undefined", // 290 "PROCESS_MAKE_FORK", // 391 "undefined", // 492 "undefined", // 593 "THREAD_USER_CREATE", // 694 "THREAD_KERNEL_CREATE", // 795 "undefined", // 896 "PROCESS_SIGACTION", // 997 98 "VFS_INODE_CREATE", // 1099 "VFS_INODE_DESTROY", // 11100 "VFS_DENTRY_CREATE", // 12101 "VFS_DENTRY_DESTROY", // 13102 "VFS_FILE_CREATE", // 14103 "VFS_FILE_DESTROY", // 15104 "VFS_ INODE_LOAD", // 16105 "VFS_ MAPPER_LOAD_ALL",// 17106 " FATFS_GET_CLUSTER", // 18107 " undefined",// 19108 109 "GET_VSEG", // 20110 "GLOBAL_UPDATE_PTE", 111 "KCM_ALLOC", // 22112 "KCM_FREE", // 23113 "MAPPER_MOVE_ BUFFER",// 24114 "MAPPER_ GET_PAGE", // 25115 " VMM_CREATE_VSEG",// 26116 " undefined",// 27117 "VMM_SET_COW", // 28118 "VMM_DISPLAY", // 2987 "PMEM_GET_PAGES", // 0 88 "PMEM_RELEASE_PAGES", // 1 89 "undefined", // 2 90 "PROCESS_MAKE_FORK", // 3 91 "undefined", // 4 92 "undefined", // 5 93 "THREAD_USER_CREATE", // 6 94 "THREAD_KERNEL_CREATE", // 7 95 "undefined", // 8 96 "PROCESS_SIGACTION", // 9 97 98 "VFS_INODE_CREATE", // 10 99 "VFS_INODE_DESTROY", // 11 100 "VFS_DENTRY_CREATE", // 12 101 "VFS_DENTRY_DESTROY", // 13 102 "VFS_FILE_CREATE", // 14 103 "VFS_FILE_DESTROY", // 15 104 "VFS_FS_CHILD_INIT", // 16 105 "VFS_FS_ADD_DENTRY", // 17 106 "VFS_FS_REMOVE_DENTRY", // 18 107 "VFS_INODE_LOAD_ALL_PAGES", // 19 108 109 "GET_VSEG", // 20 110 "GLOBAL_UPDATE_PTE", // 21 111 "KCM_ALLOC", // 22 112 "KCM_FREE", // 23 113 "MAPPER_MOVE_USER", // 24 114 "MAPPER_HANDLE_MISS", // 25 115 "undefined", // 26 116 "VMM_CREATE_VSEG", // 27 117 "VMM_SET_COW", // 28 118 "VMM_DISPLAY", // 29 119 119 }; 120 120 … … 189 189 uint32_t items = remote_fifo_items( rpc_fifo_xp ); 190 190 if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 191 printk("\n[ DBG] %s : thread %x in process %x/ rpc %s / server[%x,%d] / items %d / cycle %d\n",192 __FUNCTION__, this-> trdid, this->process->pid, rpc_str[rpc->index],191 printk("\n[%s] thread[%x,%x] / rpc %s / server[%x,%d] / items %d / cycle %d\n", 192 __FUNCTION__, this->process->pid, this->trdid, rpc_str[rpc->index], 193 193 server_cxy, server_core_lid, items, cycle ); 194 194 #endif … … 208 208 cycle = (uint32_t)hal_get_cycles(); 209 209 if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 210 printk("\n[ DBG] %s : thread %x in process %xenter waiting loop for rpc %s / cycle %d\n",211 __FUNCTION__, this-> trdid, this->process->pid, rpc_str[rpc->index], cycle );210 printk("\n[%s] thread[%x,%x] enter waiting loop for rpc %s / cycle %d\n", 211 __FUNCTION__, this->process->pid, this->trdid, rpc_str[rpc->index], cycle ); 212 212 #endif 213 213 … … 217 217 cycle = (uint32_t)hal_get_cycles(); 218 218 if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 219 printk("\n[ DBG] %s : thread %x in process %xreceived response for rpc %s / cycle %d\n",220 __FUNCTION__, this-> trdid, this->process->pid, rpc_str[rpc->index], cycle );219 printk("\n[%s] thread[%x,%x] received response for rpc %s / cycle %d\n", 220 __FUNCTION__, this->process->pid, this->trdid, rpc_str[rpc->index], cycle ); 221 221 #endif 222 222 … … 228 228 cycle = (uint32_t)hal_get_cycles(); 229 229 if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 230 printk("\n[ DBG] %s : thread %x in process %xblocks & deschedules for rpc %s / cycle %d\n",231 __FUNCTION__, this-> trdid, this->process->pid, rpc_str[rpc->index], cycle );230 printk("\n[%s] thread[%x,%x] blocks & deschedules for rpc %s / cycle %d\n", 231 __FUNCTION__, this->process->pid, this->trdid, rpc_str[rpc->index], cycle ); 232 232 #endif 233 233 … … 241 241 cycle = (uint32_t)hal_get_cycles(); 242 242 if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 243 printk("\n[ DBG] %s : thread %x in process %xresumes for rpc %s / cycle %d\n",244 __FUNCTION__, this-> trdid, this->process->pid, rpc_str[rpc->index], cycle );243 printk("\n[%s] thread[%x,%x] resumes for rpc %s / cycle %d\n", 244 __FUNCTION__, this->process->pid, this->trdid, rpc_str[rpc->index], cycle ); 245 245 #endif 246 246 } … … 256 256 cycle = (uint32_t)hal_get_cycles(); 257 257 if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 258 printk("\n[ DBG] %s : thread %x in process %xreturns for non blocking rpc %s / cycle %d\n",259 __FUNCTION__, this-> trdid, this->process->pid, rpc_str[rpc->index], cycle );258 printk("\n[%s] thread[%x,%x] returns for non blocking rpc %s / cycle %d\n", 259 __FUNCTION__, this->process->pid, this->trdid, rpc_str[rpc->index], cycle ); 260 260 #endif 261 261 … … 417 417 uint32_t cycle = (uint32_t)hal_get_cycles(); 418 418 if( cycle > DEBUG_RPC_PMEM_GET_PAGES ) 419 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",420 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );419 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 420 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 421 421 #endif 422 422 … … 441 441 cycle = (uint32_t)hal_get_cycles(); 442 442 if( cycle > DEBUG_RPC_PMEM_GET_PAGES ) 443 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",444 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );443 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 444 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 445 445 #endif 446 446 } … … 453 453 uint32_t cycle = (uint32_t)hal_get_cycles(); 454 454 if( cycle > DEBUG_RPC_PMEM_GET_PAGES ) 455 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",456 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );455 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 456 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 457 457 #endif 458 458 … … 473 473 cycle = (uint32_t)hal_get_cycles(); 474 474 if( cycle > DEBUG_RPC_PMEM_GET_PAGES ) 475 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",476 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );475 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 476 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 477 477 #endif 478 478 } … … 490 490 uint32_t cycle = (uint32_t)hal_get_cycles(); 491 491 if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES ) 492 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",493 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );492 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 493 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 494 494 #endif 495 495 … … 511 511 cycle = (uint32_t)hal_get_cycles(); 512 512 if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES ) 513 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",514 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );513 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 514 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 515 515 #endif 516 516 } … … 523 523 uint32_t cycle = (uint32_t)hal_get_cycles(); 524 524 if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES ) 525 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",526 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );525 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 526 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 527 527 #endif 528 528 … … 543 543 cycle = (uint32_t)hal_get_cycles(); 544 544 if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES ) 545 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",546 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );545 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 546 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 547 547 #endif 548 548 } … … 568 568 uint32_t cycle = (uint32_t)hal_get_cycles(); 569 569 if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK ) 570 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",571 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );570 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 571 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 572 572 #endif 573 573 … … 595 595 cycle = (uint32_t)hal_get_cycles(); 596 596 if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK ) 597 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",598 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );597 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 598 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 599 599 #endif 600 600 } … … 607 607 uint32_t cycle = (uint32_t)hal_get_cycles(); 608 608 if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK ) 609 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",610 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );609 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 610 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 611 611 #endif 612 612 … … 639 639 cycle = (uint32_t)hal_get_cycles(); 640 640 if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK ) 641 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",642 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );641 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 642 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 643 643 #endif 644 644 } … … 669 669 uint32_t cycle = (uint32_t)hal_get_cycles(); 670 670 if( cycle > DEBUG_RPC_THREAD_USER_CREATE) 671 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",672 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );671 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 672 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 673 673 #endif 674 674 … … 697 697 cycle = (uint32_t)hal_get_cycles(); 698 698 if( cycle > DEBUG_RPC_THREAD_USER_CREATE) 699 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",700 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );699 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 700 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 701 701 #endif 702 702 } … … 709 709 uint32_t cycle = (uint32_t)hal_get_cycles(); 710 710 if( cycle > DEBUG_RPC_THREAD_USER_CREATE) 711 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",712 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );711 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 712 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 713 713 #endif 714 714 … … 755 755 cycle = (uint32_t)hal_get_cycles(); 756 756 if( cycle > DEBUG_RPC_THREAD_USER_CREATE) 757 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",758 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );757 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 758 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 759 759 #endif 760 760 } … … 776 776 uint32_t cycle = (uint32_t)hal_get_cycles(); 777 777 if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE) 778 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",779 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );778 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 779 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 780 780 #endif 781 781 … … 803 803 cycle = (uint32_t)hal_get_cycles(); 804 804 if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE) 805 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",806 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );805 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 806 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 807 807 #endif 808 808 } … … 815 815 uint32_t cycle = (uint32_t)hal_get_cycles(); 816 816 if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE) 817 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",818 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );817 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 818 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 819 819 #endif 820 820 … … 847 847 cycle = (uint32_t)hal_get_cycles(); 848 848 if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE) 849 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",850 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );849 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 850 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 851 851 #endif 852 852 } … … 969 969 uint32_t fs_type, // in 970 970 uint32_t inode_type, // in 971 void * extend, // in972 971 uint32_t attr, // in 973 972 uint32_t rights, // in … … 981 980 uint32_t cycle = (uint32_t)hal_get_cycles(); 982 981 if( cycle > DEBUG_RPC_VFS_INODE_CREATE ) 983 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",984 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );982 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 983 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 985 984 #endif 986 985 … … 997 996 rpc.args[1] = (uint64_t)fs_type; 998 997 rpc.args[2] = (uint64_t)inode_type; 999 rpc.args[3] = (uint64_t)(intptr_t)extend; 1000 rpc.args[4] = (uint64_t)attr; 1001 rpc.args[5] = (uint64_t)rights; 1002 rpc.args[6] = (uint64_t)uid; 1003 rpc.args[7] = (uint64_t)gid; 998 rpc.args[3] = (uint64_t)attr; 999 rpc.args[4] = (uint64_t)rights; 1000 rpc.args[5] = (uint64_t)uid; 1001 rpc.args[6] = (uint64_t)gid; 1004 1002 1005 1003 // register RPC request in remote RPC fifo … … 1007 1005 1008 1006 // get output values from RPC descriptor 1009 *inode_xp = (xptr_t)rpc.args[ 8];1010 *error = (error_t)rpc.args[ 9];1007 *inode_xp = (xptr_t)rpc.args[7]; 1008 *error = (error_t)rpc.args[8]; 1011 1009 1012 1010 #if DEBUG_RPC_VFS_INODE_CREATE 1013 1011 cycle = (uint32_t)hal_get_cycles(); 1014 1012 if( cycle > DEBUG_RPC_VFS_INODE_CREATE ) 1015 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1016 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );1013 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1014 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 1017 1015 #endif 1018 1016 } … … 1025 1023 uint32_t cycle = (uint32_t)hal_get_cycles(); 1026 1024 if( cycle > DEBUG_RPC_VFS_INODE_CREATE ) 1027 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1028 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );1025 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1026 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 1029 1027 #endif 1030 1028 … … 1032 1030 uint32_t fs_type; 1033 1031 uint32_t inode_type; 1034 void * extend;1035 1032 uint32_t attr; 1036 1033 uint32_t rights; … … 1045 1042 1046 1043 // get input arguments from client rpc descriptor 1047 dentry_xp = (xptr_t) hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 1048 fs_type = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 1049 inode_type = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) ); 1050 extend = (void *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) ); 1051 attr = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) ); 1052 rights = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[5] ) ); 1053 uid = (uid_t) hal_remote_l64( XPTR( client_cxy , &desc->args[6] ) ); 1054 gid = (gid_t) hal_remote_l64( XPTR( client_cxy , &desc->args[7] ) ); 1044 dentry_xp = (xptr_t) hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 1045 fs_type = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 1046 inode_type = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) ); 1047 attr = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) ); 1048 rights = (uint32_t) hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) ); 1049 uid = (uid_t) hal_remote_l64( XPTR( client_cxy , &desc->args[5] ) ); 1050 gid = (gid_t) hal_remote_l64( XPTR( client_cxy , &desc->args[6] ) ); 1055 1051 1056 1052 // call local kernel function … … 1058 1054 fs_type, 1059 1055 inode_type, 1060 extend,1061 1056 attr, 1062 1057 rights, … … 1066 1061 1067 1062 // set output arguments 1068 hal_remote_s64( XPTR( client_cxy , &desc->args[ 8] ) , (uint64_t)inode_xp );1069 hal_remote_s64( XPTR( client_cxy , &desc->args[ 9] ) , (uint64_t)error );1063 hal_remote_s64( XPTR( client_cxy , &desc->args[7] ) , (uint64_t)inode_xp ); 1064 hal_remote_s64( XPTR( client_cxy , &desc->args[8] ) , (uint64_t)error ); 1070 1065 1071 1066 #if DEBUG_RPC_VFS_INODE_CREATE 1072 1067 cycle = (uint32_t)hal_get_cycles(); 1073 1068 if( cycle > DEBUG_RPC_VFS_INODE_CREATE ) 1074 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1075 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );1069 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1070 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 1076 1071 #endif 1077 1072 } … … 1083 1078 ///////////////////////////////////////////////////////////// 1084 1079 void rpc_vfs_inode_destroy_client( cxy_t cxy, 1085 struct vfs_inode_s * inode, 1086 error_t * error ) 1080 struct vfs_inode_s * inode ) 1087 1081 { 1088 1082 #if DEBUG_RPC_VFS_INODE_DESTROY … … 1090 1084 uint32_t cycle = (uint32_t)hal_get_cycles(); 1091 1085 if( cycle > DEBUG_RPC_VFS_INODE_DESTROY ) 1092 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1093 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );1086 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1087 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 1094 1088 #endif 1095 1089 … … 1108 1102 rpc_send( cxy , &rpc ); 1109 1103 1110 // get output argument from RPC descriptor1111 *error = (error_t)rpc.args[1];1112 1113 1104 #if DEBUG_RPC_VFS_INODE_DESTROY 1114 1105 cycle = (uint32_t)hal_get_cycles(); 1115 1106 if( cycle > DEBUG_RPC_VFS_INODE_DESTROY ) 1116 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1117 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );1107 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1108 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 1118 1109 #endif 1119 1110 } … … 1126 1117 uint32_t cycle = (uint32_t)hal_get_cycles(); 1127 1118 if( cycle > DEBUG_RPC_VFS_INODE_DESTROY ) 1128 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1129 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );1119 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1120 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 1130 1121 #endif 1131 1122 1132 1123 vfs_inode_t * inode; 1133 error_t error;1134 1124 1135 1125 // get client cluster identifier and pointer on RPC descriptor … … 1137 1127 rpc_desc_t * desc = GET_PTR( xp ); 1138 1128 1139 // get argument s"inode" from client RPC descriptor1129 // get argument "inode" from client RPC descriptor 1140 1130 inode = (vfs_inode_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 1141 1131 1142 1132 // call local kernel function 1143 error = vfs_inode_destroy( inode ); 1144 1145 // set output argument 1146 hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error ); 1133 vfs_inode_destroy( inode ); 1147 1134 1148 1135 #if DEBUG_RPC_VFS_INODE_DESTROY 1149 1136 cycle = (uint32_t)hal_get_cycles(); 1150 1137 if( cycle > DEBUG_RPC_VFS_INODE_DESTROY ) 1151 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1152 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );1138 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1139 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 1153 1140 #endif 1154 1141 } … … 1170 1157 uint32_t cycle = (uint32_t)hal_get_cycles(); 1171 1158 if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE ) 1172 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1173 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );1159 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1160 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 1174 1161 #endif 1175 1162 … … 1197 1184 cycle = (uint32_t)hal_get_cycles(); 1198 1185 if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE ) 1199 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1200 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );1186 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1187 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 1201 1188 #endif 1202 1189 } … … 1209 1196 uint32_t cycle = (uint32_t)hal_get_cycles(); 1210 1197 if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE ) 1211 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1212 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );1198 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1199 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1213 1200 #endif 1214 1201 … … 1245 1232 cycle = (uint32_t)hal_get_cycles(); 1246 1233 if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE ) 1247 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1248 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );1234 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1235 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 1249 1236 #endif 1250 1237 } … … 1256 1243 /////////////////////////////////////////////////////// 1257 1244 void rpc_vfs_dentry_destroy_client( cxy_t cxy, 1258 vfs_dentry_t * dentry, 1259 error_t * error ) 1245 vfs_dentry_t * dentry ) 1260 1246 { 1261 1247 #if DEBUG_RPC_VFS_DENTRY_DESTROY … … 1263 1249 uint32_t cycle = (uint32_t)hal_get_cycles(); 1264 1250 if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY ) 1265 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1266 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );1251 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1252 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1267 1253 #endif 1268 1254 … … 1281 1267 rpc_send( cxy , &rpc ); 1282 1268 1283 // get output argument from RPC descriptor1284 *error = (error_t)rpc.args[1];1285 1286 1269 #if DEBUG_RPC_VFS_DENTRY_DESTROY 1287 1270 cycle = (uint32_t)hal_get_cycles(); 1288 1271 if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY ) 1289 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1290 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );1272 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1273 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 1291 1274 #endif 1292 1275 } … … 1299 1282 uint32_t cycle = (uint32_t)hal_get_cycles(); 1300 1283 if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY ) 1301 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1302 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );1284 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1285 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1303 1286 #endif 1304 1287 1305 1288 vfs_dentry_t * dentry; 1306 error_t error;1307 1289 1308 1290 // get client cluster identifier and pointer on RPC descriptor … … 1314 1296 1315 1297 // call local kernel function 1316 error = vfs_dentry_destroy( dentry ); 1317 1318 // set output argument 1319 hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error ); 1298 vfs_dentry_destroy( dentry ); 1320 1299 1321 1300 #if DEBUG_RPC_VFS_DENTRY_DESTROY 1322 1301 cycle = (uint32_t)hal_get_cycles(); 1323 1302 if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY ) 1324 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1325 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );1303 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1304 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 1326 1305 #endif 1327 1306 } … … 1343 1322 uint32_t cycle = (uint32_t)hal_get_cycles(); 1344 1323 if( cycle > DEBUG_RPC_VFS_FILE_CREATE ) 1345 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1346 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );1324 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1325 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1347 1326 #endif 1348 1327 … … 1369 1348 cycle = (uint32_t)hal_get_cycles(); 1370 1349 if( cycle > DEBUG_RPC_VFS_FILE_CREATE ) 1371 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1372 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );1350 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1351 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 1373 1352 #endif 1374 1353 } … … 1381 1360 uint32_t cycle = (uint32_t)hal_get_cycles(); 1382 1361 if( cycle > DEBUG_RPC_VFS_FILE_CREATE ) 1383 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1384 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );1362 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1363 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1385 1364 #endif 1386 1365 … … 1410 1389 cycle = (uint32_t)hal_get_cycles(); 1411 1390 if( cycle > DEBUG_RPC_VFS_FILE_CREATE ) 1412 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1413 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );1391 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1392 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 1414 1393 #endif 1415 1394 } … … 1427 1406 uint32_t cycle = (uint32_t)hal_get_cycles(); 1428 1407 if( cycle > DEBUG_RPC_VFS_FILE_DESTROY ) 1429 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1430 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );1408 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1409 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1431 1410 #endif 1432 1411 … … 1448 1427 cycle = (uint32_t)hal_get_cycles(); 1449 1428 if( cycle > DEBUG_RPC_VFS_FILE_DESTROY ) 1450 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1451 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid, cycle );1429 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1430 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 1452 1431 #endif 1453 1432 } … … 1460 1439 uint32_t cycle = (uint32_t)hal_get_cycles(); 1461 1440 if( cycle > DEBUG_RPC_VFS_FILE_DESTROY ) 1462 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1463 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );1441 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1442 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1464 1443 #endif 1465 1444 … … 1479 1458 cycle = (uint32_t)hal_get_cycles(); 1480 1459 if( cycle > DEBUG_RPC_VFS_FILE_DESTROY ) 1481 printk("\n[DBG] %s : thread %x in process %x on core %d exit / cycle %d\n", 1482 __FUNCTION__, this->trdid, this->process->pid, this->core->lid, cycle ); 1483 #endif 1484 } 1485 1486 ///////////////////////////////////////////////////////////////////////////////////////// 1487 // [16] Marshaling functions attached to RPC_VFS_INODE_LOAD (blocking) 1488 ///////////////////////////////////////////////////////////////////////////////////////// 1489 1490 ////////////////////////////////////////////////// 1491 void rpc_vfs_inode_load_client( cxy_t cxy, 1492 vfs_inode_t * parent_inode, // in 1493 char * name, // in 1494 xptr_t child_inode_xp, // in 1495 error_t * error ) // out 1496 { 1460 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1461 __FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle ); 1462 #endif 1463 } 1464 1465 ///////////////////////////////////////////////////////////////////////////////////////// 1466 // [16] Marshaling functions attached to RPC_VFS_FS_CHILD_INIT (blocking) 1467 ///////////////////////////////////////////////////////////////////////////////////////// 1468 1469 ///////////////////////////////////////////////////////// 1470 void rpc_vfs_fs_child_init_client( cxy_t cxy, 1471 vfs_inode_t * parent_inode, // in 1472 char * name, // in 1473 xptr_t child_inode_xp, // in 1474 error_t * error ) // out 1475 { 1476 #if DEBUG_RPC_VFS_FS_CHILD_INIT 1477 thread_t * this = CURRENT_THREAD; 1478 uint32_t cycle = (uint32_t)hal_get_cycles(); 1479 if( cycle > DEBUG_RPC_VFS_FS_CHILD_INIT ) 1480 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1481 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1482 #endif 1483 1497 1484 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1498 1485 1499 1486 // initialise RPC descriptor header 1500 1487 rpc_desc_t rpc; 1501 rpc.index = RPC_VFS_ INODE_LOAD;1488 rpc.index = RPC_VFS_FS_CHILD_INIT; 1502 1489 rpc.blocking = true; 1503 1490 rpc.responses = 1; … … 1514 1501 *error = (error_t)rpc.args[3]; 1515 1502 1516 } 1517 1518 /////////////////////////////////////////// 1519 void rpc_vfs_inode_load_server( xptr_t xp ) 1520 { 1503 #if DEBUG_RPC_VFS_FS_CHILD_INIT 1504 cycle = (uint32_t)hal_get_cycles(); 1505 if( cycle > DEBUG_RPC_VFS_FS_CHILD_INIT ) 1506 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1507 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1508 #endif 1509 } 1510 1511 ////////////////////////////////////////////// 1512 void rpc_vfs_fs_child_init_server( xptr_t xp ) 1513 { 1514 #if DEBUG_RPC_VFS_FS_CHILD_INIT 1515 thread_t * this = CURRENT_THREAD; 1516 uint32_t cycle = (uint32_t)hal_get_cycles(); 1517 if( cycle > DEBUG_RPC_VFS_FS_CHILD_INIT ) 1518 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1519 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1520 #endif 1521 1521 1522 error_t error; 1522 1523 vfs_inode_t * parent; … … 1540 1541 1541 1542 // call the kernel function 1542 error = vfs_ inode_load( parent , name_copy , child_xp );1543 error = vfs_fs_child_init( parent , name_copy , child_xp ); 1543 1544 1544 1545 // set output argument 1545 1546 hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error ); 1546 1547 1547 } 1548 1549 ///////////////////////////////////////////////////////////////////////////////////////// 1550 // [17] Marshaling functions attached to RPC_VFS_MAPPER_LOAD_ALL (blocking) 1551 ///////////////////////////////////////////////////////////////////////////////////////// 1552 1553 /////////////////////////////////////////////////////// 1554 void rpc_vfs_mapper_load_all_client( cxy_t cxy, 1555 vfs_inode_t * inode, // in 1556 error_t * error ) // out 1557 { 1548 #if DEBUG_RPC_VFS_FS_CHILD_INIT 1549 cycle = (uint32_t)hal_get_cycles(); 1550 if( cycle > DEBUG_RPC_VFS_FS_CHILD_INIT ) 1551 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1552 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1553 #endif 1554 } 1555 1556 ///////////////////////////////////////////////////////////////////////////////////////// 1557 // [17] Marshaling function attached to RPC_VFS_FS_ADD_DENTRY (blocking) 1558 ///////////////////////////////////////////////////////////////////////////////////////// 1559 1560 void rpc_vfs_fs_add_dentry_client( cxy_t cxy, 1561 vfs_inode_t * parent, // in 1562 vfs_dentry_t * dentry, // in 1563 error_t * error ) // out 1564 { 1565 #if DEBUG_RPC_VFS_FS_ADD_DENTRY 1566 thread_t * this = CURRENT_THREAD; 1567 uint32_t cycle = (uint32_t)hal_get_cycles(); 1568 if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY ) 1569 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1570 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1571 #endif 1572 1558 1573 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1559 1574 1560 1575 // initialise RPC descriptor header 1561 1576 rpc_desc_t rpc; 1562 rpc.index = RPC_VFS_ MAPPER_LOAD_ALL;1577 rpc.index = RPC_VFS_FS_ADD_DENTRY; 1563 1578 rpc.blocking = true; 1564 1579 rpc.responses = 1; 1565 1580 1566 1581 // set input arguments in RPC descriptor 1567 rpc.args[0] = (uint64_t)(intptr_t)inode; 1582 rpc.args[0] = (uint64_t)(intptr_t)parent; 1583 rpc.args[1] = (uint64_t)(intptr_t)dentry; 1568 1584 1569 1585 // register RPC request in remote RPC fifo … … 1571 1587 1572 1588 // get output values from RPC descriptor 1573 *error = (error_t)rpc.args[1]; 1574 1575 } 1576 1577 //////////////////////////////////////////////// 1578 void rpc_vfs_mapper_load_all_server( xptr_t xp ) 1579 { 1580 error_t error; 1581 vfs_inode_t * inode; 1589 *error = (error_t)rpc.args[2]; 1590 1591 #if DEBUG_RPC_VFS_FS_ADD_DENTRY 1592 cycle = (uint32_t)hal_get_cycles(); 1593 if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY ) 1594 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1595 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1596 #endif 1597 } 1598 1599 ///////////////////////////////////////////////// 1600 void rpc_vfs_fs_add_dentry_server( xptr_t xp ) 1601 { 1602 #if DEBUG_RPC_VFS_FS_ADD_DENTRY 1603 thread_t * this = CURRENT_THREAD; 1604 uint32_t cycle = (uint32_t)hal_get_cycles(); 1605 if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY ) 1606 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1607 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1608 #endif 1609 1610 error_t error; 1611 vfs_inode_t * parent; 1612 vfs_dentry_t * dentry; 1582 1613 1583 1614 // get client cluster identifier and pointer on RPC descriptor … … 1585 1616 rpc_desc_t * desc = GET_PTR( xp ); 1586 1617 1587 // get arguments "parent", "name", and "child_xp" 1588 inode = (vfs_inode_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0])); 1618 // get input arguments 1619 parent = (vfs_inode_t*)(intptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[0])); 1620 dentry = (vfs_dentry_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[1])); 1589 1621 1590 1622 // call the kernel function 1591 error = vfs_ mapper_load_all( inode);1623 error = vfs_fs_add_dentry( parent , dentry ); 1592 1624 1593 1625 // set output argument 1594 hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error ); 1595 1596 } 1597 1598 ///////////////////////////////////////////////////////////////////////////////////////// 1599 // [18] Marshaling functions attached to RPC_FATFS_GET_CLUSTER (blocking) 1600 ///////////////////////////////////////////////////////////////////////////////////////// 1601 1602 ////////////////////////////////////////////////// 1603 void rpc_fatfs_get_cluster_client( cxy_t cxy, 1604 mapper_t * mapper, // in 1605 uint32_t first, // in 1606 uint32_t index, // in 1607 uint32_t * cluster, // out 1608 error_t * error ) // out 1609 { 1626 hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)error ); 1627 1628 #if DEBUG_RPC_VFS_FS_ADD_DENTRY 1629 cycle = (uint32_t)hal_get_cycles(); 1630 if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY ) 1631 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1632 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1633 #endif 1634 } 1635 1636 ///////////////////////////////////////////////////////////////////////////////////////// 1637 // [18] Marshaling function attached to RPC_VFS_FS_REMOVE_DENTRY (blocking) 1638 ///////////////////////////////////////////////////////////////////////////////////////// 1639 1640 void rpc_vfs_fs_remove_dentry_client( cxy_t cxy, 1641 vfs_inode_t * parent, // in 1642 vfs_dentry_t * dentry, // in 1643 error_t * error ) // out 1644 { 1645 #if DEBUG_RPC_VFS_FS_REMOVE_DENTRY 1646 thread_t * this = CURRENT_THREAD; 1647 uint32_t cycle = (uint32_t)hal_get_cycles(); 1648 if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY ) 1649 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1650 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1651 #endif 1652 1610 1653 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1611 1654 1612 1655 // initialise RPC descriptor header 1613 1656 rpc_desc_t rpc; 1614 rpc.index = RPC_ FATFS_GET_CLUSTER;1657 rpc.index = RPC_VFS_FS_REMOVE_DENTRY; 1615 1658 rpc.blocking = true; 1616 1659 rpc.responses = 1; 1617 1660 1618 1661 // set input arguments in RPC descriptor 1619 rpc.args[0] = (uint64_t)(intptr_t)mapper; 1620 rpc.args[1] = (uint64_t)first; 1621 rpc.args[2] = (uint64_t)index; 1622 1623 // register RPC request in remote RPC fifo 1662 rpc.args[0] = (uint64_t)(intptr_t)parent; 1663 rpc.args[1] = (uint64_t)(intptr_t)dentry; 1664 1665 // register RPC request in remote RPC fifo 1624 1666 rpc_send( cxy , &rpc ); 1625 1667 1626 // get output argument from rpc descriptor 1627 *cluster = (uint32_t)rpc.args[3]; 1628 *error = (error_t)rpc.args[4]; 1629 1630 } 1631 1632 ////////////////////////////////////////////// 1633 void rpc_fatfs_get_cluster_server( xptr_t xp ) 1634 { 1635 mapper_t * mapper; 1636 uint32_t first; 1637 uint32_t index; 1638 uint32_t cluster; 1639 error_t error; 1668 // get output values from RPC descriptor 1669 *error = (error_t)rpc.args[2]; 1670 1671 #if DEBUG_RPC_VFS_FS_REMOVE_DENTRY 1672 cycle = (uint32_t)hal_get_cycles(); 1673 if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY ) 1674 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1675 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1676 #endif 1677 } 1678 1679 ///////////////////////////////////////////////// 1680 void rpc_vfs_fs_remove_dentry_server( xptr_t xp ) 1681 { 1682 #if DEBUG_RPC_VFS_FS_REMOVE_DENTRY 1683 thread_t * this = CURRENT_THREAD; 1684 uint32_t cycle = (uint32_t)hal_get_cycles(); 1685 if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY ) 1686 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1687 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1688 #endif 1689 1690 error_t error; 1691 vfs_inode_t * parent; 1692 vfs_dentry_t * dentry; 1640 1693 1641 1694 // get client cluster identifier and pointer on RPC descriptor … … 1644 1697 1645 1698 // get input arguments 1646 mapper = (mapper_t *)(intptr_t)hal_remote_lpt( XPTR( client_cxy , &desc->args[0] ) ); 1647 first = (uint32_t) hal_remote_l32 ( XPTR( client_cxy , &desc->args[1] ) ); 1648 index = (uint32_t) hal_remote_l32 ( XPTR( client_cxy , &desc->args[2] ) ); 1699 parent = (vfs_inode_t*)(intptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[0])); 1700 dentry = (vfs_dentry_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[1])); 1649 1701 1650 1702 // call the kernel function 1651 error = fatfs_get_cluster( mapper , first , index , &cluster);1703 error = vfs_fs_remove_dentry( parent , dentry ); 1652 1704 1653 1705 // set output argument 1654 hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)cluster ); 1655 hal_remote_s64( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error ); 1656 1706 hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)error ); 1707 1708 #if DEBUG_RPC_VFS_FS_REMOVE_DENTRY 1709 cycle = (uint32_t)hal_get_cycles(); 1710 if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY ) 1711 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1712 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1713 #endif 1714 } 1715 1716 ///////////////////////////////////////////////////////////////////////////////////////// 1717 // [19] Marshaling functions attached to RPC_VFS_INODE_LOAD_ALL_PAGES (blocking) 1718 ///////////////////////////////////////////////////////////////////////////////////////// 1719 1720 //////////////////////////////////////////////////////////// 1721 void rpc_vfs_inode_load_all_pages_client( cxy_t cxy, 1722 vfs_inode_t * inode, // in 1723 error_t * error ) // out 1724 { 1725 #if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES 1726 thread_t * this = CURRENT_THREAD; 1727 uint32_t cycle = (uint32_t)hal_get_cycles(); 1728 if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES ) 1729 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1730 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1731 #endif 1732 1733 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1734 1735 // initialise RPC descriptor header 1736 rpc_desc_t rpc; 1737 rpc.index = RPC_VFS_INODE_LOAD_ALL_PAGES; 1738 rpc.blocking = true; 1739 rpc.responses = 1; 1740 1741 // set input arguments in RPC descriptor 1742 rpc.args[0] = (uint64_t)(intptr_t)inode; 1743 1744 // register RPC request in remote RPC fifo 1745 rpc_send( cxy , &rpc ); 1746 1747 // get output values from RPC descriptor 1748 *error = (error_t)rpc.args[1]; 1749 1750 #if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES 1751 cycle = (uint32_t)hal_get_cycles(); 1752 if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES ) 1753 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1754 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1755 #endif 1756 } 1757 1758 ///////////////////////////////////////////////////// 1759 void rpc_vfs_inode_load_all_pages_server( xptr_t xp ) 1760 { 1761 #if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES 1762 thread_t * this = CURRENT_THREAD; 1763 uint32_t cycle = (uint32_t)hal_get_cycles(); 1764 if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES ) 1765 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1766 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1767 #endif 1768 1769 error_t error; 1770 vfs_inode_t * inode; 1771 1772 // get client cluster identifier and pointer on RPC descriptor 1773 cxy_t client_cxy = GET_CXY( xp ); 1774 rpc_desc_t * desc = GET_PTR( xp ); 1775 1776 // get input argument 1777 inode = (vfs_inode_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0])); 1778 1779 // call the kernel function 1780 error = vfs_inode_load_all_pages( inode ); 1781 1782 // set output argument 1783 hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error ); 1784 1785 #if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES 1786 cycle = (uint32_t)hal_get_cycles(); 1787 if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES ) 1788 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1789 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1790 #endif 1657 1791 } 1658 1792 … … 1672 1806 uint32_t cycle = (uint32_t)hal_get_cycles(); 1673 1807 if( cycle > DEBUG_RPC_VMM_GET_VSEG ) 1674 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1675 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );1808 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1809 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1676 1810 #endif 1677 1811 … … 1698 1832 cycle = (uint32_t)hal_get_cycles(); 1699 1833 if( cycle > DEBUG_RPC_VMM_GET_VSEG ) 1700 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1701 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );1834 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1835 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1702 1836 #endif 1703 1837 } … … 1710 1844 uint32_t cycle = (uint32_t)hal_get_cycles(); 1711 1845 if( cycle > DEBUG_RPC_VMM_GET_VSEG ) 1712 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1713 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );1846 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1847 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1714 1848 #endif 1715 1849 … … 1739 1873 cycle = (uint32_t)hal_get_cycles(); 1740 1874 if( cycle > DEBUG_RPC_VMM_GET_VSEG ) 1741 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1742 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );1875 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1876 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1743 1877 #endif 1744 1878 } … … 1760 1894 uint32_t cycle = (uint32_t)hal_get_cycles(); 1761 1895 if( cycle > DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE ) 1762 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1763 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );1896 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1897 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1764 1898 #endif 1765 1899 … … 1784 1918 cycle = (uint32_t)hal_get_cycles(); 1785 1919 if( cycle > DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE ) 1786 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1787 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );1920 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1921 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1788 1922 #endif 1789 1923 } … … 1796 1930 uint32_t cycle = (uint32_t)hal_get_cycles(); 1797 1931 if( cycle > DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE ) 1798 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1799 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );1932 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1933 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1800 1934 #endif 1801 1935 … … 1821 1955 cycle = (uint32_t)hal_get_cycles(); 1822 1956 if( cycle > DEBUG_RPC_VMM_GLOBAL_UPDATE_PTE ) 1823 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1824 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );1957 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 1958 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1825 1959 #endif 1826 1960 } … … 1839 1973 uint32_t cycle = (uint32_t)hal_get_cycles(); 1840 1974 if( cycle > DEBUG_RPC_KCM_ALLOC ) 1841 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1842 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );1975 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 1976 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1843 1977 #endif 1844 1978 … … 1863 1997 cycle = (uint32_t)hal_get_cycles(); 1864 1998 if( cycle > DEBUG_RPC_KCM_ALLOC ) 1865 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1866 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );1999 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 2000 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1867 2001 #endif 1868 2002 } … … 1875 2009 uint32_t cycle = (uint32_t)hal_get_cycles(); 1876 2010 if( cycle > DEBUG_RPC_KCM_ALLOC ) 1877 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1878 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );2011 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 2012 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1879 2013 #endif 1880 2014 … … 1899 2033 cycle = (uint32_t)hal_get_cycles(); 1900 2034 if( cycle > DEBUG_RPC_KCM_ALLOC ) 1901 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1902 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );2035 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 2036 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1903 2037 #endif 1904 2038 } … … 1917 2051 uint32_t cycle = (uint32_t)hal_get_cycles(); 1918 2052 if( cycle > DEBUG_RPC_KCM_FREE ) 1919 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1920 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );2053 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 2054 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1921 2055 #endif 1922 2056 … … 1939 2073 cycle = (uint32_t)hal_get_cycles(); 1940 2074 if( cycle > DEBUG_RPC_KCM_FREE ) 1941 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1942 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );2075 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 2076 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1943 2077 #endif 1944 2078 } … … 1951 2085 uint32_t cycle = (uint32_t)hal_get_cycles(); 1952 2086 if( cycle > DEBUG_RPC_KCM_FREE ) 1953 printk("\n[ DBG] %s : thread %x in process %xon core %d enter / cycle %d\n",1954 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );2087 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 2088 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1955 2089 #endif 1956 2090 … … 1972 2106 cycle = (uint32_t)hal_get_cycles(); 1973 2107 if( cycle > DEBUG_RPC_KCM_FREE ) 1974 printk("\n[ DBG] %s : thread %x in process %xon core %d exit / cycle %d\n",1975 __FUNCTION__, this-> trdid, this->process->pid, this->core->lid , cycle );2108 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 2109 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 1976 2110 #endif 1977 2111 } 1978 2112 1979 2113 ///////////////////////////////////////////////////////////////////////////////////////// 1980 // [24] Marshaling functions attached to RPC_MAPPER_MOVE_BUFFER 1981 ///////////////////////////////////////////////////////////////////////////////////////// 1982 1983 /////////////////////////////////////////////////// 1984 void rpc_mapper_move_buffer_client( cxy_t cxy, 1985 mapper_t * mapper, // in 1986 bool_t to_buffer, // in 1987 bool_t is_user, // in 1988 uint32_t file_offset, // in 1989 uint64_t buffer, // in 1990 uint32_t size, // in 1991 error_t * error ) // out 1992 { 2114 // [24] Marshaling functions attached to RPC_MAPPER_MOVE_USER 2115 ///////////////////////////////////////////////////////////////////////////////////////// 2116 2117 ///////////////////////////////////////////////// 2118 void rpc_mapper_move_user_client( cxy_t cxy, 2119 mapper_t * mapper, // in 2120 bool_t to_buffer, // in 2121 uint32_t file_offset, // in 2122 void * buffer, // in 2123 uint32_t size, // in 2124 error_t * error ) // out 2125 { 2126 #if DEBUG_RPC_MAPPER_MOVE_USER 2127 uint32_t cycle = (uint32_t)hal_get_cycles(); 2128 if( cycle > DEBUG_RPC_MAPPER_MOVE_USER ) 2129 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 2130 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 2131 #endif 2132 1993 2133 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 1994 2134 1995 2135 // initialise RPC descriptor header 1996 2136 rpc_desc_t rpc; 1997 rpc.index = RPC_MAPPER_MOVE_ BUFFER;2137 rpc.index = RPC_MAPPER_MOVE_USER; 1998 2138 rpc.blocking = true; 1999 2139 rpc.responses = 1; … … 2002 2142 rpc.args[0] = (uint64_t)(intptr_t)mapper; 2003 2143 rpc.args[1] = (uint64_t)to_buffer; 2004 rpc.args[2] = (uint64_t)is_user; 2005 rpc.args[3] = (uint64_t)file_offset; 2006 rpc.args[4] = (uint64_t)buffer; 2007 rpc.args[5] = (uint64_t)size; 2144 rpc.args[2] = (uint64_t)file_offset; 2145 rpc.args[3] = (uint64_t)(intptr_t)buffer; 2146 rpc.args[4] = (uint64_t)size; 2008 2147 2009 2148 // register RPC request in remote RPC fifo … … 2011 2150 2012 2151 // get output values from RPC descriptor 2013 *error = (error_t)rpc.args[6]; 2014 2015 } 2016 2017 /////////////////////////////////////////////// 2018 void rpc_mapper_move_buffer_server( xptr_t xp ) 2019 { 2152 *error = (error_t)rpc.args[5]; 2153 2154 #if DEBUG_RPC_MAPPER_MOVE_USER 2155 cycle = (uint32_t)hal_get_cycles(); 2156 if( cycle > DEBUG_RPC_MAPPER_MOVE_USER ) 2157 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 2158 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 2159 #endif 2160 } 2161 2162 ///////////////////////////////////////////// 2163 void rpc_mapper_move_user_server( xptr_t xp ) 2164 { 2165 #if DEBUG_RPC_MAPPER_MOVE_USER 2166 uint32_t cycle = (uint32_t)hal_get_cycles(); 2167 if( cycle > DEBUG_RPC_MAPPER_MOVE_USER ) 2168 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 2169 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 2170 #endif 2171 2020 2172 mapper_t * mapper; 2021 2173 bool_t to_buffer; 2022 bool_t is_user;2023 2174 uint32_t file_offset; 2024 void * user_buffer; 2025 xptr_t kern_buffer; 2175 void * buffer; 2026 2176 uint32_t size; 2027 2177 error_t error; … … 2034 2184 mapper = (mapper_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 2035 2185 to_buffer = hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 2036 is_user= hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );2037 file_offset =hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) );2038 size = hal_remote_l64( XPTR( client_cxy , &desc->args[ 5] ) );2186 file_offset = hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) ); 2187 buffer = (void *)(intptr_t) hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) ); 2188 size = hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) ); 2039 2189 2040 2190 // call local kernel function 2041 if( is_user ) 2042 { 2043 user_buffer = (void *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) ); 2044 2045 error = mapper_move_user( mapper, 2046 to_buffer, 2047 file_offset, 2048 user_buffer, 2049 size ); 2050 } 2051 else 2052 { 2053 kern_buffer = (xptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) ); 2054 2055 error = mapper_move_kernel( mapper, 2056 to_buffer, 2057 file_offset, 2058 kern_buffer, 2059 size ); 2060 } 2191 error = mapper_move_user( mapper, 2192 to_buffer, 2193 file_offset, 2194 buffer, 2195 size ); 2061 2196 2062 2197 // set output argument to client RPC descriptor 2063 2198 hal_remote_s64( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)error ); 2064 2199 2065 } 2066 2067 ///////////////////////////////////////////////////////////////////////////////////////// 2068 // [25] Marshaling functions attached to RPC_MAPPER_GET_PAGE (blocking) 2069 ///////////////////////////////////////////////////////////////////////////////////////// 2070 2071 /////////////////////////////////////////////////////// 2072 void rpc_mapper_get_page_client( cxy_t cxy, 2073 struct mapper_s * mapper, // in 2074 uint32_t index, // in 2075 page_t ** page ) // out 2076 { 2200 #if DEBUG_RPC_MAPPER_MOVE_USER 2201 cycle = (uint32_t)hal_get_cycles(); 2202 if( cycle > DEBUG_RPC_MAPPER_MOVE_USER ) 2203 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 2204 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 2205 #endif 2206 } 2207 2208 ///////////////////////////////////////////////////////////////////////////////////////// 2209 // [25] Marshaling functions attached to RPC_MAPPER_HANDLE_MISS (blocking) 2210 ///////////////////////////////////////////////////////////////////////////////////////// 2211 2212 ////////////////////////////////////////////////////////// 2213 void rpc_mapper_handle_miss_client( cxy_t cxy, 2214 struct mapper_s * mapper, 2215 uint32_t page_id, 2216 xptr_t * page_xp, 2217 error_t * error ) 2218 { 2219 #if DEBUG_RPC_MAPPER_HANDLE_MISS 2220 uint32_t cycle = (uint32_t)hal_get_cycles(); 2221 if( cycle > DEBUG_RPC_MAPPER_HANDLE_MISS ) 2222 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 2223 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 2224 #endif 2225 2077 2226 assert( (cxy != local_cxy) , "target cluster is not remote\n"); 2078 2227 2079 2228 // initialise RPC descriptor header 2080 2229 rpc_desc_t rpc; 2081 rpc.index = RPC_MAPPER_ GET_PAGE;2230 rpc.index = RPC_MAPPER_HANDLE_MISS; 2082 2231 rpc.blocking = true; 2083 2232 rpc.responses = 1; … … 2085 2234 // set input arguments in RPC descriptor 2086 2235 rpc.args[0] = (uint64_t)(intptr_t)mapper; 2087 rpc.args[1] = (uint64_t) index;2236 rpc.args[1] = (uint64_t)page_id; 2088 2237 2089 2238 // register RPC request in remote RPC fifo … … 2091 2240 2092 2241 // get output values from RPC descriptor 2093 *page = (page_t *)(intptr_t)rpc.args[2]; 2094 2095 } 2096 2097 //////////////////////////////////////////// 2098 void rpc_mapper_get_page_server( xptr_t xp ) 2099 { 2242 *page_xp = (xptr_t)rpc.args[2]; 2243 *error = (error_t)rpc.args[3]; 2244 2245 #if DEBUG_RPC_MAPPER_HANDLE_MISS 2246 cycle = (uint32_t)hal_get_cycles(); 2247 if( cycle > DEBUG_RPC_MAPPER_HANDLE_MISS ) 2248 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 2249 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 2250 #endif 2251 } 2252 2253 /////////////////////////////////////////////// 2254 void rpc_mapper_handle_miss_server( xptr_t xp ) 2255 { 2256 #if DEBUG_RPC_MAPPER_HANDLE_MISS 2257 uint32_t cycle = (uint32_t)hal_get_cycles(); 2258 if( cycle > DEBUG_RPC_MAPPER_HANDLE_MISS ) 2259 printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n", 2260 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 2261 #endif 2262 2263 mapper_t * mapper; 2264 uint32_t page_id; 2265 xptr_t page_xp; 2266 error_t error; 2267 2100 2268 // get client cluster identifier and pointer on RPC descriptor 2101 cxy_t cxy = GET_CXY( xp ); 2102 rpc_desc_t * desc = GET_PTR( xp ); 2103 2104 // get input arguments from client RPC descriptor 2105 mapper_t * mapper = (mapper_t *)(intptr_t)hal_remote_l64( XPTR( cxy , &desc->args[0] ) ); 2106 uint32_t index = (uint32_t) hal_remote_l64( XPTR( cxy , &desc->args[1] ) ); 2107 2108 // call local pmem allocator 2109 page_t * page = mapper_get_page( mapper , index ); 2110 2111 // set output arguments into client RPC descriptor 2112 hal_remote_s64( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page ); 2113 2114 } 2115 2116 ///////////////////////////////////////////////////////////////////////////////////////// 2117 // [26] Marshaling functions attached to RPC_VMM_CREATE_VSEG (blocking) 2269 cxy_t client_cxy = GET_CXY( xp ); 2270 rpc_desc_t * desc = GET_PTR( xp ); 2271 2272 // get arguments from client RPC descriptor 2273 mapper = (mapper_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) ); 2274 page_id = hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) ); 2275 2276 // call local kernel function 2277 error = mapper_handle_miss( mapper, 2278 page_id, 2279 &page_xp ); 2280 2281 // set output argument to client RPC descriptor 2282 hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)error ); 2283 hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)page_xp ); 2284 2285 #if DEBUG_RPC_MAPPER_HANDLE_MISS 2286 cycle = (uint32_t)hal_get_cycles(); 2287 if( cycle > DEBUG_RPC_MAPPER_HANDLE_MISS ) 2288 printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n", 2289 __FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle ); 2290 #endif 2291 } 2292 2293 ///////////////////////////////////////////////////////////////////////////////////////// 2294 // [26] undefined slot 2295 ///////////////////////////////////////////////////////////////////////////////////////// 2296 2297 ///////////////////////////////////////////////////////////////////////////////////////// 2298 // [27] Marshaling functions attached to RPC_VMM_CREATE_VSEG (blocking) 2118 2299 ///////////////////////////////////////////////////////////////////////////////////////// 2119 2300 … … 2189 2370 2190 2371 ///////////////////////////////////////////////////////////////////////////////////////// 2191 // [27] undefined slot2192 /////////////////////////////////////////////////////////////////////////////////////////2193 2194 /////////////////////////////////////////////////////////////////////////////////////////2195 2372 // [28] Marshaling functions attached to RPC_VMM_SET_COW (blocking) 2196 2373 /////////////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.