- Timestamp:
- Dec 3, 2018, 12:15:01 PM (6 years ago)
- Location:
- trunk/kernel/kern
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/chdev.c
r593 r601 175 175 if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) ) 176 176 printk("\n[%s] client[%x,%x] enter for RX / server[%x,%x] / cycle %d\n", 177 __FUNCTION__, this->process->pid, this->trdid, server_ptr->process->pid, server_ptr->trdid, rx_cycle ); 177 __FUNCTION__, this->process->pid, this->trdid, 178 server_ptr->process->pid, server_ptr->trdid, rx_cycle ); 178 179 #endif 179 180 … … 182 183 if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) ) 183 184 printk("\n[%s] client[%x,%x] enter for TX / server[%x,%x] / cycle %d\n", 184 __FUNCTION__, this->process->pid, this->trdid, server_ptr->process->pid, server_ptr->trdid, tx_cycle ); 185 __FUNCTION__, this->process->pid, this->trdid, 186 server_ptr->process->pid, server_ptr->trdid, tx_cycle ); 185 187 #endif 186 188 … … 223 225 if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) ) 224 226 printk("\n[%s] client thread[%x,%x] blocked\n", 225 __FUNCTION__, this->process _pid, this->trdid );227 __FUNCTION__, this->process->pid, this->trdid ); 226 228 #endif 227 229 … … 341 343 uint32_t rx_cycle = (uint32_t)hal_get_cycles(); 342 344 if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) ) 343 printk("\n[%s] dev_thread[%x,%x] start RX / cycle %d\n",345 printk("\n[%s] thread[%x,%x] start RX / cycle %d\n", 344 346 __FUNCTION__ , server->process->pid, server->trdid, rx_cycle ); 345 347 #endif … … 348 350 uint32_t tx_cycle = (uint32_t)hal_get_cycles(); 349 351 if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) ) 350 printk("\n[%s] dev_thread[%x,%x] start TX / cycle %d\n",352 printk("\n[%s] thread[%x,%x] start TX / cycle %d\n", 351 353 __FUNCTION__ , server->process->pid, server->trdid, tx_cycle ); 352 354 #endif 355 356 // check server thread can yield 357 thread_assert_can_yield( server , __FUNCTION__ ); 353 358 354 359 // get the lock protecting the waiting queue … … 358 363 if( xlist_is_empty( root_xp ) ) // waiting queue empty 359 364 { 365 // release lock protecting the waiting queue 366 remote_busylock_release( lock_xp ); 360 367 361 368 #if DEBUG_CHDEV_SERVER_RX 362 369 rx_cycle = (uint32_t)hal_get_cycles(); 363 370 if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) ) 364 printk("\n[%s] dev_thread[%x,%x] found RX queue empty => blocks / cycle %d\n",371 printk("\n[%s] thread[%x,%x] found RX queue empty => blocks / cycle %d\n", 365 372 __FUNCTION__ , server->process->pid, server->trdid, rx_cycle ); 366 373 #endif … … 369 376 tx_cycle = (uint32_t)hal_get_cycles(); 370 377 if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) ) 371 printk("\n[%s] dev_thread[%x,%x] found TX queue empty => blocks / cycle %d\n",378 printk("\n[%s] thread[%x,%x] found TX queue empty => blocks / cycle %d\n", 372 379 __FUNCTION__ , server->process->pid, server->trdid, tx_cycle ); 373 380 #endif 374 375 // release lock376 remote_busylock_release( lock_xp );377 378 381 // block 379 382 thread_block( XPTR( local_cxy , server ) , THREAD_BLOCKED_IDLE ); 380 381 // check server thread can yield382 assert( (server->busylocks == 0),383 "cannot yield : busylocks = %d\n", server->busylocks );384 383 385 384 // deschedule … … 388 387 else // waiting queue not empty 389 388 { 389 // release lock protecting the waiting queue 390 remote_busylock_release( lock_xp ); 391 390 392 // get extended pointer on first client thread 391 393 client_xp = XLIST_FIRST( root_xp , thread_t , wait_list ); … … 395 397 client_ptr = GET_PTR( client_xp ); 396 398 397 // remove this first client thread from waiting queue 398 xlist_unlink( XPTR( client_cxy , &client_ptr->wait_list) );399 400 // release lock 401 remote_busylock_release( lock_xp ); 399 #if( DDEBUG_CHDEV_SERVER_TX || DEBUG_CHDEV_SERVER_RX ) 400 process_t * process = hal_remote_lpt( XPTR( client_cxy , &client_ptr->process ) ); 401 pid_t client_pid = hal_remote_l32( XPTR( client_cxy , &process->pid ) ); 402 process_t client_trdid = hal_remote_l32( XPTR( client_cxy , &client_ptr->trdid ) ); 403 #endif 402 404 403 405 #if DEBUG_CHDEV_SERVER_RX 404 406 rx_cycle = (uint32_t)hal_get_cycles(); 405 407 if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) ) 406 printk("\n[%s] dev_thread[%x,%x] for RX get client thread[%x,%x] / cycle %d\n", 407 __FUNCTION__, server->process->pid, server->trdid, 408 client_ptr->process->pid, client_ptr->trdid, rx_cycle ); 408 printk("\n[%s] thread[%x,%x] for RX get client thread[%x,%x] / cycle %d\n", 409 __FUNCTION__, server->process->pid, server->trdid, client_pid, client_trdid, cycle ); 409 410 #endif 410 411 … … 412 413 tx_cycle = (uint32_t)hal_get_cycles(); 413 414 if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) ) 414 printk("\n[%s] dev_thread[%x,%x] for TX get client thread[%x,%x] / cycle %d\n", 415 __FUNCTION__, server->process->pid, server->trdid, 416 client_ptr->process->pid, client_ptr->trdid, tx_cycle ); 415 printk("\n[%s] thread[%x,%x] for TX get client thread[%x,%x] / cycle %d\n", 416 __FUNCTION__, server->process->pid, server->trdid, client_pid, client_trdid, cycle ); 417 417 #endif 418 418 … … 425 425 #endif 426 426 427 // call driver command function to execute I/O operation 427 // call the (blocking) driver command function 428 // to launch I/O operation AND wait completion 428 429 chdev->cmd( client_xp ); 429 430 430 // unblock client thread 431 // unblock client thread when driver returns 431 432 thread_unblock( client_xp , THREAD_BLOCKED_IO ); 433 434 // get the lock protecting the waiting queue 435 remote_busylock_acquire( lock_xp ); 436 437 // remove this client thread from chdev waiting queue 438 xlist_unlink( XPTR( client_cxy , &client_ptr->wait_list ) ); 439 440 // release lock protecting the waiting queue 441 remote_busylock_release( lock_xp ); 432 442 433 443 #if DEBUG_CHDEV_SERVER_RX 434 444 rx_cycle = (uint32_t)hal_get_cycles(); 435 445 if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) ) 436 printk("\n[%s] dev_thread[%x,%x] completes RX for client thread[%x,%x] / cycle %d\n", 437 __FUNCTION__, server->process->pid, server->trdid, 438 client_ptr->process->pid, client_ptr->trdid, rx_cycle ); 446 printk("\n[%s] thread[%x,%x] completes RX for client thread[%x,%x] / cycle %d\n", 447 __FUNCTION__, server->process->pid, server->trdid, client_pid, client_trdid, cycle ); 439 448 #endif 440 449 … … 442 451 tx_cycle = (uint32_t)hal_get_cycles(); 443 452 if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) ) 444 printk("\n[%s] dev_thread[%x,%x] completes TX for client thread[%x,%x] / cycle %d\n", 445 __FUNCTION__, server->process->pid, server->trdid, 446 client_ptr->process->pid, client_ptr->trdid, tx_cycle ); 453 printk("\n[%s] thread[%x,%x] completes TX for client thread[%x,%x] / cycle %d\n", 454 __FUNCTION__, server->process->pid, server->trdid, client_pid, client_trdid, cycle ); 447 455 #endif 448 456 … … 633 641 pid = hal_remote_l32 ( XPTR( thread_cxy , &process->pid ) ); 634 642 635 nolock_printk("- thread %X / cluster %X / trdid %X / pid %X\n", 636 thread_ptr, thread_cxy, trdid, pid ); 643 nolock_printk("- thread[%x,%x]\n", pid, trdid ); 637 644 } 638 645 } -
trunk/kernel/kern/kernel_init.c
r583 r601 159 159 160 160 "CLUSTER_PREFTBL", // 21 161 161 162 "PPM_DIRTY", // 22 162 163 163 "CLUSTER_LOCALS", // 23 164 164 "CLUSTER_COPIES", // 24 … … 166 166 "PROCESS_USERSYNC", // 26 167 167 "PROCESS_FDARRAY", // 27 168 169 "MAPPER_STATE", // 28 168 "FATFS_FREE", // 28 169 170 170 "PROCESS_THTBL", // 29 171 171 172 "PROCESS_CWD", // 30 173 "VFS_INODE", // 31 174 "VFS_FILE", // 32 175 "VMM_VSL", // 33 176 "VMM_GPT", // 34 172 "MAPPER_STATE", // 30 173 "PROCESS_CWD", // 31 174 "VFS_INODE", // 32 175 "VFS_FILE", // 33 176 "VMM_VSL", // 34 177 "VMM_GPT", // 35 177 178 }; 178 179 179 // these debug variables are usedto analyse the sys_read() and sys_write() syscalls timing180 // debug variables to analyse the sys_read() and sys_write() syscalls timing 180 181 181 182 #if DEBUG_SYS_READ … … 417 418 #if( DEBUG_KERNEL_INIT & 0x1 ) 418 419 if( hal_time_stamp() > DEBUG_KERNEL_INIT ) 419 printk("\n[ DBG] %s: created MMC in cluster %x / chdev = %x\n",420 printk("\n[%s] : created MMC in cluster %x / chdev = %x\n", 420 421 __FUNCTION__ , local_cxy , chdev_ptr ); 421 422 #endif … … 451 452 #if( DEBUG_KERNEL_INIT & 0x1 ) 452 453 if( hal_time_stamp() > DEBUG_KERNEL_INIT ) 453 printk("\n[ DBG] %s: created DMA[%d] in cluster %x / chdev = %x\n",454 printk("\n[%s] : created DMA[%d] in cluster %x / chdev = %x\n", 454 455 __FUNCTION__ , channel , local_cxy , chdev_ptr ); 455 456 #endif … … 611 612 #if( DEBUG_KERNEL_INIT & 0x1 ) 612 613 if( hal_time_stamp() > DEBUG_KERNEL_INIT ) 613 printk("\n[ DBG] %s: create chdev %s / channel = %d / rx = %d / cluster %x / chdev = %x\n",614 printk("\n[%s] : create chdev %s / channel = %d / rx = %d / cluster %x / chdev = %x\n", 614 615 __FUNCTION__ , chdev_func_str( func ), channel , rx , local_cxy , chdev ); 615 616 #endif … … 779 780 780 781 #if( DEBUG_KERNEL_INIT & 0x1 ) 781 if( hal_tim _stamp() > DEBUG_KERNEL_INIT )782 if( hal_time_stamp() > DEBUG_KERNEL_INIT ) 782 783 { 783 printk("\n[ DBG] %screated PIC chdev in cluster %x at cycle %d\n",784 printk("\n[%s] created PIC chdev in cluster %x at cycle %d\n", 784 785 __FUNCTION__ , local_cxy , (uint32_t)hal_time_stamp() ); 785 786 dev_pic_inputs_display(); … … 969 970 #if DEBUG_KERNEL_INIT 970 971 if( (core_lid == 0) & (local_cxy == 0) ) 971 printk("\n[ DBG] %s: exit barrier 0 : TXT0 initialized / sr %x / cycle %d\n",972 printk("\n[%s] : exit barrier 0 : TXT0 initialized / sr %x / cycle %d\n", 972 973 __FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() ); 973 974 #endif … … 1011 1012 #if DEBUG_KERNEL_INIT 1012 1013 if( (core_lid == 0) & (local_cxy == 0) ) 1013 printk("\n[ DBG] %s: exit barrier 1 : clusters initialised / sr %x / cycle %d\n",1014 printk("\n[%s] : exit barrier 1 : clusters initialised / sr %x / cycle %d\n", 1014 1015 __FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() ); 1015 1016 #endif … … 1038 1039 #if DEBUG_KERNEL_INIT 1039 1040 if( (core_lid == 0) & (local_cxy == 0) ) 1040 printk("\n[ DBG] %s: exit barrier 2 : PIC initialised / sr %x / cycle %d\n",1041 printk("\n[%s] : exit barrier 2 : PIC initialised / sr %x / cycle %d\n", 1041 1042 __FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() ); 1042 1043 #endif … … 1071 1072 #if DEBUG_KERNEL_INIT 1072 1073 if( (core_lid == 0) & (local_cxy == 0) ) 1073 printk("\n[ DBG] %s : exit barrier 3 : all chdevinitialised / sr %x / cycle %d\n",1074 printk("\n[%s] : exit barrier 3 : all chdevs initialised / sr %x / cycle %d\n", 1074 1075 __FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() ); 1075 1076 #endif … … 1115 1116 if( CONFIG_VFS_ROOT_IS_FATFS ) 1116 1117 { 1117 // 1. allocate memory for FATFS context in cluster 01118 // 1. allocate memory for FATFS context extension in cluster 0 1118 1119 fatfs_ctx_t * fatfs_ctx = fatfs_ctx_alloc(); 1119 1120 … … 1134 1135 uint32_t total_clusters = fatfs_ctx->fat_sectors_count << 7; 1135 1136 1136 // 4. initialize the FATFS entry in the vfs_context[] array 1137 vfs_ctx_init( FS_TYPE_FATFS, // fs type 1138 0, // attributes: unused 1139 total_clusters, 1140 cluster_size, 1141 vfs_root_inode_xp, // VFS root 1142 fatfs_ctx ); // extend 1143 1144 // 5. create VFS root inode in cluster 0 1137 // 4. create VFS root inode in cluster 0 1145 1138 error = vfs_inode_create( XPTR_NULL, // dentry_xp 1146 1139 FS_TYPE_FATFS, // fs_type 1147 1140 INODE_TYPE_DIR, // inode_type 1148 (void *)(intptr_t)root_dir_cluster, // extend1149 1141 0, // attr 1150 1142 0, // rights … … 1159 1151 } 1160 1152 1161 // 6. update the FATFS entry in vfs_context[] array1162 fs_context[FS_TYPE_FATFS].vfs_root_xp = vfs_root_inode_xp;1163 1164 // 7. check FATFS initialization1165 vfs_ctx_t * vfs_ctx = &fs_context[FS_TYPE_FATFS];1166 1167 if( ((fatfs_ctx_t *)vfs_ctx->extend)->sectors_per_cluster != 8 )1168 {1169 printk("\n[PANIC] in %s : illegal FATFS context in cluster 0\n",1170 __FUNCTION__ ); 1171 hal_core_sleep(); 1172 } 1173 1153 // 5. update FATFS root inode extension 1154 cxy_t vfs_root_cxy = GET_CXY( vfs_root_inode_xp ); 1155 vfs_inode_t * vfs_root_ptr = GET_PTR( vfs_root_inode_xp ); 1156 hal_remote_spt( XPTR( vfs_root_cxy , &vfs_root_ptr->extend ), 1157 (void*)(intptr_t)root_dir_cluster ); 1158 1159 // 6. initialize the generic VFS context for FATFS 1160 vfs_ctx_init( FS_TYPE_FATFS, // fs type 1161 0, // attributes: unused 1162 total_clusters, // number of clusters 1163 cluster_size, // bytes 1164 vfs_root_inode_xp, // VFS root 1165 fatfs_ctx ); // extend 1174 1166 } 1175 1167 else … … 1193 1185 #if DEBUG_KERNEL_INIT 1194 1186 if( (core_lid == 0) & (local_cxy == 0) ) 1195 printk("\n[ DBG] %s: exit barrier 4 : VFS root initialized in cluster 0 / sr %x / cycle %d\n",1187 printk("\n[%s] : exit barrier 4 : VFS root initialized in cluster 0 / sr %x / cycle %d\n", 1196 1188 __FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() ); 1197 1189 #endif … … 1262 1254 #if DEBUG_KERNEL_INIT 1263 1255 if( (core_lid == 0) & (local_cxy == 1) ) 1264 printk("\n[ DBG] %s: exit barrier 5 : VFS root initialized in cluster 1 / sr %x / cycle %d\n",1256 printk("\n[%s] : exit barrier 5 : VFS root initialized in cluster 1 / sr %x / cycle %d\n", 1265 1257 __FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() ); 1266 1258 #endif … … 1311 1303 #if DEBUG_KERNEL_INIT 1312 1304 if( (core_lid == 0) & (local_cxy == 0) ) 1313 printk("\n[ DBG] %s: exit barrier 6 : DEVFS root initialized in cluster 0 / sr %x / cycle %d\n",1305 printk("\n[%s] : exit barrier 6 : DEVFS root initialized in cluster 0 / sr %x / cycle %d\n", 1314 1306 __FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() ); 1315 1307 #endif … … 1348 1340 #if DEBUG_KERNEL_INIT 1349 1341 if( (core_lid == 0) & (local_cxy == 0) ) 1350 printk("\n[ DBG] %s: exit barrier 7 : DEV initialized in cluster 0 / sr %x / cycle %d\n",1342 printk("\n[%s] : exit barrier 7 : DEV initialized in cluster 0 / sr %x / cycle %d\n", 1351 1343 __FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() ); 1352 1344 #endif … … 1374 1366 #if DEBUG_KERNEL_INIT 1375 1367 if( (core_lid == 0) & (local_cxy == 0) ) 1376 printk("\n[ DBG] %s: exit barrier 8 : process init created / sr %x / cycle %d\n",1368 printk("\n[%s] : exit barrier 8 : process init created / sr %x / cycle %d\n", 1377 1369 __FUNCTION__, (uint32_t)hal_get_sr(), (uint32_t)hal_get_cycles() ); 1378 1370 #endif … … 1445 1437 1446 1438 #if DEBUG_KERNEL_INIT 1447 printk("\n[ DBG] %s: thread %x on core[%x,%d] jumps to thread_idle_func() / cycle %d\n",1439 printk("\n[%s] : thread %x on core[%x,%d] jumps to thread_idle_func() / cycle %d\n", 1448 1440 __FUNCTION__ , CURRENT_THREAD , local_cxy , core_lid , (uint32_t)hal_get_cycles() ); 1449 1441 #endif -
trunk/kernel/kern/process.h
r593 r601 34 34 #include <bits.h> 35 35 #include <busylock.h> 36 #include <rwlock.h> 36 37 #include <queuelock.h> 37 38 #include <remote_queuelock.h> -
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 ///////////////////////////////////////////////////////////////////////////////////////// -
trunk/kernel/kern/rpc.h
r583 r601 59 59 typedef enum 60 60 { 61 RPC_PMEM_GET_PAGES = 0,62 RPC_PMEM_RELEASE_PAGES = 1,63 RPC_UNDEFINED_2 = 2,64 RPC_PROCESS_MAKE_FORK = 3,65 RPC_UNDEFINED_4 = 4,66 RPC_UNDEFINED_5 = 5,67 RPC_THREAD_USER_CREATE = 6,68 RPC_THREAD_KERNEL_CREATE = 7,69 RPC_UNDEFINED_8 = 8,70 RPC_PROCESS_SIGACTION = 9,71 72 RPC_VFS_INODE_CREATE = 10,73 RPC_VFS_INODE_DESTROY = 11,74 RPC_VFS_DENTRY_CREATE = 12,75 RPC_VFS_DENTRY_DESTROY = 13,76 RPC_VFS_FILE_CREATE = 14,77 RPC_VFS_FILE_DESTROY = 15,78 RPC_VFS_ INODE_LOAD= 16,79 RPC_VFS_ MAPPER_LOAD_ALL= 17,80 RPC_ FATFS_GET_CLUSTER= 18,81 RPC_ UNDEFINED_19= 19,82 83 RPC_VMM_GET_VSEG = 20,84 RPC_VMM_GLOBAL_UPDATE_PTE = 21,85 RPC_KCM_ALLOC = 22,86 RPC_KCM_FREE = 23,87 RPC_MAPPER_MOVE_ BUFFER= 24,88 RPC_MAPPER_ GET_PAGE= 25,89 RPC_ VMM_CREATE_VSEG= 26,90 RPC_ UNDEFINED_27= 27,91 RPC_VMM_SET_COW = 28,92 RPC_VMM_DISPLAY = 29,93 94 RPC_MAX_INDEX = 30,61 RPC_PMEM_GET_PAGES = 0, 62 RPC_PMEM_RELEASE_PAGES = 1, 63 RPC_UNDEFINED_2 = 2, 64 RPC_PROCESS_MAKE_FORK = 3, 65 RPC_UNDEFINED_4 = 4, 66 RPC_UNDEFINED_5 = 5, 67 RPC_THREAD_USER_CREATE = 6, 68 RPC_THREAD_KERNEL_CREATE = 7, 69 RPC_UNDEFINED_8 = 8, 70 RPC_PROCESS_SIGACTION = 9, 71 72 RPC_VFS_INODE_CREATE = 10, 73 RPC_VFS_INODE_DESTROY = 11, 74 RPC_VFS_DENTRY_CREATE = 12, 75 RPC_VFS_DENTRY_DESTROY = 13, 76 RPC_VFS_FILE_CREATE = 14, 77 RPC_VFS_FILE_DESTROY = 15, 78 RPC_VFS_FS_CHILD_INIT = 16, 79 RPC_VFS_FS_REMOVE_DENTRY = 17, 80 RPC_VFS_FS_ADD_DENTRY = 18, 81 RPC_VFS_INODE_LOAD_ALL_PAGES = 19, 82 83 RPC_VMM_GET_VSEG = 20, 84 RPC_VMM_GLOBAL_UPDATE_PTE = 21, 85 RPC_KCM_ALLOC = 22, 86 RPC_KCM_FREE = 23, 87 RPC_MAPPER_MOVE_USER = 24, 88 RPC_MAPPER_HANDLE_MISS = 25, 89 RPC_UNDEFINED_26 = 26, 90 RPC_VMM_CREATE_VSEG = 27, 91 RPC_VMM_SET_COW = 28, 92 RPC_VMM_DISPLAY = 29, 93 94 RPC_MAX_INDEX = 30, 95 95 } 96 96 rpc_index_t; … … 310 310 * @ fs_type : [in] file system type. 311 311 * @ inode_type : [in] file system type. 312 * @ extend : [in] fs_type_specific inode extension.313 312 * @ attr : [in] inode attributes. 314 313 * @ rights : [in] access rights … … 322 321 uint32_t fs_type, 323 322 uint32_t inode_type, 324 void * extend,325 323 uint32_t attr, 326 324 uint32_t rights, … … 338 336 * @ cxy : server cluster identifier 339 337 * @ inode : [in] local pointer on inode. 340 * @ error : [out] error status (0 if success). 341 **********************************************************************************/ 342 void rpc_vfs_inode_destroy_client( cxy_t cxy, 343 struct vfs_inode_s * inode, 344 error_t * error ); 338 **********************************************************************************/ 339 void rpc_vfs_inode_destroy_client( cxy_t cxy, 340 struct vfs_inode_s * inode ); 345 341 346 342 void rpc_vfs_inode_destroy_server( xptr_t xp ); … … 372 368 * @ cxy : server cluster identifier 373 369 * @ dentry : [in] local pointer on dentry. 374 * @ error : [out] error status (0 if success).375 370 **********************************************************************************/ 376 371 void rpc_vfs_dentry_destroy_client( cxy_t cxy, 377 struct vfs_dentry_s * dentry, 378 error_t * error ); 372 struct vfs_dentry_s * dentry ); 379 373 380 374 void rpc_vfs_dentry_destroy_server( xptr_t xp ); … … 411 405 412 406 /*********************************************************************************** 413 * [16] The RPC_VFS_ LOAD_INODE calls the vfs_inode_load() kernel function in a414 * remote cluster containing a parent inode directory to scan the associated415 * mapper, find a directory entry, identified by its name, and update the remote416 * child inode.417 *********************************************************************************** 418 * @ cxy : 407 * [16] The RPC_VFS_FS_CHILD_INIT calls the vfs_fs_child_init_load_inode() 408 * function in a remote cluster containing a parent inode directory to scan the 409 * associated mapper, find a directory entry identified by its name, and update 410 * both the child inode and the dentry. 411 *********************************************************************************** 412 * @ cxy : server cluster identifier 419 413 * @ parent_inode : [in] local pointer on parent inode. 420 414 * @ name : [in] local pointer on child name (in client cluster). … … 422 416 * @ error : [out] error status (0 if success). 423 417 **********************************************************************************/ 424 void rpc_vfs_inode_load_client( cxy_t cxy, 425 struct vfs_inode_s * parent_inode, 426 char * name, 427 xptr_t child_inode_xp, 428 error_t * error ); 429 430 void rpc_vfs_inode_load_server( xptr_t xp ); 431 432 /*********************************************************************************** 433 * [17] The RPC_VFS_MAPPER_LOAD_ALL calls the vfs_mapper_load_all() kernel function 434 * in a remote cluster containing an inode, to load all pages of the associated 435 * mapper from the file system on device. 436 *********************************************************************************** 437 * @ cxy : server cluster identifier 418 void rpc_vfs_fs_child_init_client( cxy_t cxy, 419 struct vfs_inode_s * parent_inode, 420 char * name, 421 xptr_t child_inode_xp, 422 error_t * error ); 423 424 void rpc_vfs_fs_child_init_server( xptr_t xp ); 425 426 /*********************************************************************************** 427 * [17] The RPC_VFS_FS_ADD_DENTRY calls the vfs_fs_add_dentry() function in a 428 * remote cluster containing a directory inode and mapper, to add a new dentry 429 * in the mapper of this directory. 430 *********************************************************************************** 431 * @ cxy : server cluster identifier 432 * @ parent : [in] local pointer on directory inode. 433 * @ dentry : [in] local pointer on dentry. 434 * @ error : [out] error status (0 if success). 435 **********************************************************************************/ 436 void rpc_vfs_fs_add_dentry_client( cxy_t, 437 struct vfs_inode_s * parent, 438 struct vfs_dentry_s * dentry, 439 error_t * error ); 440 441 void rpc_vfs_fs_add_dentry_server( xptr_t xp ); 442 443 /*********************************************************************************** 444 * [18] The RPC_VFS_FS_REMOVE_DENTRY calls the vfs_fs_remove_dentry() function in a 445 * remote cluster containing a directory inode and mapper, to remove a dentry from 446 * the mapper of this directory. 447 *********************************************************************************** 448 * @ cxy : server cluster identifier 449 * @ parent : [in] local pointer on directory inode. 450 * @ dentry : [in] local pointer on dentry. 451 * @ error : [out] error status (0 if success). 452 **********************************************************************************/ 453 void rpc_vfs_fs_remove_dentry_client( cxy_t, 454 struct vfs_inode_s * parent, 455 struct vfs_dentry_s * dentry, 456 error_t * error ); 457 458 void rpc_vfs_fs_remove_dentry_server( xptr_t xp ); 459 460 /*********************************************************************************** 461 * [19] The RPC_VFS_INODE_LOAD_ALL_PAGES calls the vfs_inode_load_all_pages() 462 * function a remote cluster containing an inode to load all pages in the 463 * associated mapper. 464 *********************************************************************************** 465 * @ cxy : server cluster identifier 438 466 * @ inode : [in] local pointer on inode in server cluster. 439 467 * @ error : [out] error status (0 if success). 440 468 **********************************************************************************/ 441 void rpc_vfs_mapper_load_all_client( cxy_t cxy, 442 struct vfs_inode_s * inode, 443 error_t * error ); 444 445 void rpc_vfs_mapper_load_all_server( xptr_t xp ); 446 447 /*********************************************************************************** 448 * [18] The RPC_FATFS_GET_CLUSTER can be send by any thread running in a "client" 449 * cluster to scan the FAT mapper, stored in a remote "server" cluster, and get 450 * from the mapper the local pointer on a given page. 451 *********************************************************************************** 452 * @ cxy : server cluster identifier. 453 * @ mapper : [in] local pointer on FAT mapper. 454 * @ first : [in] FATFS cluster index allocated to first page of file. 455 * @ page : [in] page index in file. 456 * @ cluster : [out] local pointer on buffer for found FATFS cluster index. 457 * @ error : [out] local pointer on buffer for error code (in client cluster). 458 **********************************************************************************/ 459 void rpc_fatfs_get_cluster_client( cxy_t cxy, 460 struct mapper_s * mapper, 461 uint32_t first, 462 uint32_t page, 463 uint32_t * cluster, 464 error_t * error ); 465 466 void rpc_fatfs_get_cluster_server( xptr_t xp ); 467 468 /*********************************************************************************** 469 * [19] undefined slot 470 **********************************************************************************/ 469 void rpc_vfs_inode_load_all_pages_client( cxy_t cxy, 470 struct vfs_inode_s * inode, 471 error_t * error ); 472 473 void rpc_vfs_inode_load_all_pages_server( xptr_t xp ); 471 474 472 475 /*********************************************************************************** … … 543 546 544 547 /*********************************************************************************** 545 * [24] The RPC_MAPPER_MOVE_BUFFER allows a client thread to require a remote 546 * mapper to move data to/from a kernel or user buffer. 547 * - It calls the mapper_move_user() function for a - possibly distributed - 548 * user buffer identified by a user-space pointer, and casted to uint64_t. 549 * - It calls the mapper_move_kernel() function for a - possibly remote - 550 * kernel buffer identified by an extended pointer, and casted to uint64_t. 548 * [24] The RPC_MAPPER_MOVE_USER allows a client thread to require a remote 549 * mapper to move data to/from a distributed user buffer. 551 550 * It is used by the vfs_move_user() function to move data between a mapper 552 551 * and an user buffer required by a sys_read() or a sys_write(). 553 * It is used by the vmm_get_one_ppn() function to initialise a physical page554 * from a .elf file mapper, for a CODE or DATA vseg page fault.555 ***********************************************************************************556 * @ cxy : server cluster identifier.557 * @ mapper : [in] local pointer on mapper558 * @ to_buffer : [in] move data from mapper to buffer if non zero.559 * @ is_user : [in] buffer in user space if true560 * @ file_offset : [in] first byte to move in mapper561 * @ buffer : [in] user space pointer / kernel extended pointer562 * @ size : [in] number of bytes to move563 * @ error : [out] error status (0 if success).564 **********************************************************************************/565 void rpc_mapper_move_buffer_client( cxy_t cxy,566 struct mapper_s * mapper,567 bool_t to_buffer,568 bool_t is_user,569 uint32_t file_offset,570 uint64_t buffer,571 uint32_t size,572 error_t * error );573 574 void rpc_mapper_move_buffer_server( xptr_t xp );575 576 /***********************************************************************************577 * [25] The RPC_MAPPER_GET_PAGE allows a client thread to get the local pointer578 * on a remote page descriptor, for a page, identified by the page index in mapper.579 * It is used by the vmm_get_one_ppn() function to handle a page fault on580 * a FILE type vseg.581 552 *********************************************************************************** 582 553 * @ cxy : server cluster identifier. 583 554 * @ mapper : [in] local pointer on mapper. 584 * @ index : [in] page index in mapper. 585 * @ page : [out] local pointer on page descriptor / NULL if failure. 586 **********************************************************************************/ 587 void rpc_mapper_get_page_client( cxy_t cxy, 588 struct mapper_s * mapper, 589 uint32_t index, 590 struct page_s ** page ); 591 592 void rpc_mapper_get_page_server( xptr_t xp ); 593 594 /*********************************************************************************** 595 * [26] The RPC_VMM_CREATE_VSEG allows a client thread to request the remote 555 * @ to_buffer : [in] move data from mapper to buffer if non zero. 556 * @ file_offset : [in] first byte to move in mapper. 557 * @ buffer : [in] user space buffer pointer. 558 * @ size : [in] number of bytes to move. 559 * @ error : [out] error status (0 if success). 560 **********************************************************************************/ 561 void rpc_mapper_move_user_client( cxy_t cxy, 562 struct mapper_s * mapper, 563 bool_t to_buffer, 564 uint32_t file_offset, 565 void * buffer, 566 uint32_t size, 567 error_t * error ); 568 569 void rpc_mapper_move_user_server( xptr_t xp ); 570 571 /*********************************************************************************** 572 * [25] The RPC__MAPPER_HANDLE_MISS allows a client thread to request a remote 573 * mapper to load a missing page from the IOC device. 574 * On the server side, this RPC call the mapper_handle_miss() function and return 575 * an extended pointer on the allocated page descriptor and an error status. 576 * @ cxy : server cluster identifier. 577 * @ mapper : [in] local pointer on mapper. 578 * @ page_id : [in] missing page index in mapper 579 * @ buffer : [in] user space pointer / kernel extended pointer 580 * @ page_xp : [out] pointer on buffer for extended pointer on page descriptor. 581 * @ error : [out] error status (0 if success). 582 **********************************************************************************/ 583 void rpc_mapper_handle_miss_client( cxy_t cxy, 584 struct mapper_s * mapper, 585 uint32_t page_id, 586 xptr_t * page_xp, 587 error_t * error ); 588 589 void rpc_mapper_handle_miss_server( xptr_t xp ); 590 591 /*********************************************************************************** 592 * [26] undefined slot 593 **********************************************************************************/ 594 595 /*********************************************************************************** 596 * [27] The RPC_VMM_CREATE_VSEG allows a client thread to request the remote 596 597 * reference cluster of a given process to allocate and register in the reference 597 598 * process VMM a new vseg descriptor. … … 624 625 625 626 /*********************************************************************************** 626 * [27] undefined slot627 **********************************************************************************/628 629 /***********************************************************************************630 627 * [28] The RPC_VMM_SET_COW allows a client thread to request the remote reference 631 628 * cluster to set the COW flag and reset the WRITABLE flag of all GPT entries for
Note: See TracChangeset
for help on using the changeset viewer.