Changeset 459 for trunk/kernel/kern
- Timestamp:
- Aug 13, 2018, 1:43:20 PM (6 years ago)
- Location:
- trunk/kernel/kern
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/printk.c
r457 r459 406 406 remote_spinlock_lock_busy( lock_xp , &save_sr ); 407 407 408 // call nolock_printk to print function_name409 nolock_printk("\n[PANIC] on core[%x,%d] in %s : " ,410 local_cxy , CURRENT_THREAD->core->lid , function_name);408 // call nolock_printk to print core, function_name, and cycle 409 nolock_printk("\n[PANIC] on core[%x,%d] in %s at cycle %d : " , 410 local_cxy, CURRENT_THREAD->core->lid, function_name, (uint32_t)hal_get_cycles() ); 411 411 412 412 // call kernel_printf on TXT0, in busy waiting to print format -
trunk/kernel/kern/process.c
r457 r459 1018 1018 if( entry != XPTR_NULL ) 1019 1019 { 1020 // increment file descriptor ref 1020 // increment file descriptor refcount 1021 1021 vfs_file_count_up( entry ); 1022 1022 -
trunk/kernel/kern/rpc.c
r457 r459 980 980 error_t * error ) // out 981 981 { 982 #if DEBUG_RPC_VFS_INODE_CREATE 983 uint32_t cycle = (uint32_t)hal_get_cycles(); 984 if( cycle > DEBUG_RPC_VFS_INODE_CREATE ) 985 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n", 986 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle ); 987 #endif 988 982 989 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 983 990 … … 1005 1012 *error = (error_t)rpc.args[9]; 1006 1013 1014 #if DEBUG_RPC_VFS_INODE_CREATE 1015 uint32_t cycle = (uint32_t)hal_get_cycles(); 1016 if( cycle > DEBUG_RPC_VFS_INODE_CREATE ) 1017 printk("\n[DBG] %s : thread %x exit on core[%x,%d] / cycle %d\n", 1018 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle ); 1019 #endif 1007 1020 } 1008 1021 … … 1010 1023 void rpc_vfs_inode_create_server( xptr_t xp ) 1011 1024 { 1025 #if DEBUG_RPC_VFS_INODE_CREATE 1026 uint32_t cycle = (uint32_t)hal_get_cycles(); 1027 if( cycle > DEBUG_RPC_VFS_INODE_CREATE ) 1028 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n", 1029 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle ); 1030 #endif 1031 1012 1032 xptr_t dentry_xp; 1013 1033 uint32_t fs_type; … … 1050 1070 hal_remote_swd( XPTR( client_cxy , &desc->args[9] ) , (uint64_t)error ); 1051 1071 1072 #if DEBUG_RPC_VFS_INODE_CREATE 1073 uint32_t cycle = (uint32_t)hal_get_cycles(); 1074 if( cycle > DEBUG_RPC_VFS_INODE_CREATE ) 1075 printk("\n[DBG] %s : thread %x exit on core[%x,%d] / cycle %d\n", 1076 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle ); 1077 #endif 1052 1078 } 1053 1079 … … 1058 1084 ///////////////////////////////////////////////////////////// 1059 1085 void rpc_vfs_inode_destroy_client( cxy_t cxy, 1060 struct vfs_inode_s * inode ) 1061 { 1086 struct vfs_inode_s * inode, 1087 error_t * error ) 1088 { 1089 #if DEBUG_RPC_VFS_INODE_DESTROY 1090 uint32_t cycle = (uint32_t)hal_get_cycles(); 1091 if( cycle > DEBUG_RPC_VFS_INODE_DESTROY ) 1092 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n", 1093 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle ); 1094 #endif 1095 1062 1096 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 1063 1097 … … 1074 1108 rpc_send( cxy , &rpc ); 1075 1109 1110 #if DEBUG_RPC_VFS_INODE_DESTROY 1111 uint32_t cycle = (uint32_t)hal_get_cycles(); 1112 if( cycle > DEBUG_RPC_VFS_INODE_DESTROY ) 1113 printk("\n[DBG] %s : thread %x exit on core[%x,%d] / cycle %d\n", 1114 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle ); 1115 #endif 1076 1116 } 1077 1117 … … 1079 1119 void rpc_vfs_inode_destroy_server( xptr_t xp ) 1080 1120 { 1121 #if DEBUG_RPC_VFS_INODE_DESTROY 1122 uint32_t cycle = (uint32_t)hal_get_cycles(); 1123 if( cycle > DEBUG_RPC_VFS_INODE_DESTROY ) 1124 printk("\n[DBG] %s : thread %x enter on core[%x,%d] / cycle %d\n", 1125 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle ); 1126 #endif 1127 1081 1128 vfs_inode_t * inode; 1129 error_t error; 1082 1130 1083 1131 // get client cluster identifier and pointer on RPC descriptor … … 1089 1137 1090 1138 // call local kernel function 1091 vfs_inode_destroy( inode ); 1092 1139 error = vfs_inode_destroy( inode ); 1140 1141 // set output argument 1142 hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error ); 1143 1144 #if DEBUG_RPC_VFS_INODE_DESTROY 1145 uint32_t cycle = (uint32_t)hal_get_cycles(); 1146 if( cycle > DEBUG_RPC_VFS_INODE_DESTROY ) 1147 printk("\n[DBG] %s : thread %x exit on core[%x,%d] / cycle %d\n", 1148 __FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle ); 1149 #endif 1093 1150 } 1094 1151 … … 1194 1251 /////////////////////////////////////////////////////// 1195 1252 void rpc_vfs_dentry_destroy_client( cxy_t cxy, 1196 vfs_dentry_t * dentry ) 1253 vfs_dentry_t * dentry, 1254 error_t * error ) 1197 1255 { 1198 1256 #if DEBUG_RPC_VFS_DENTRY_DESTROY … … 1236 1294 1237 1295 vfs_dentry_t * dentry; 1296 error_t error; 1238 1297 1239 1298 // get client cluster identifier and pointer on RPC descriptor … … 1245 1304 1246 1305 // call local kernel function 1247 vfs_dentry_destroy( dentry ); 1306 error = vfs_dentry_destroy( dentry ); 1307 1308 // set output argument 1309 hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error ); 1248 1310 1249 1311 #if DEBUG_RPC_VFS_DENTRY_DESTROY -
trunk/kernel/kern/rpc.h
r457 r459 350 350 * @ cxy : server cluster identifier 351 351 * @ inode : [in] local pointer on inode. 352 * @ error : [out] error status (0 if success). 352 353 **********************************************************************************/ 353 354 void rpc_vfs_inode_destroy_client( cxy_t cxy, 354 struct vfs_inode_s * inode ); 355 struct vfs_inode_s * inode, 356 error_t * error ); 355 357 356 358 void rpc_vfs_inode_destroy_server( xptr_t xp ); … … 377 379 378 380 /*********************************************************************************** 379 * [13] The RPC_VFS_DENTRY_DESTROY re leases memory allocated for an dentry descriptor380 * in a remote cluster.381 * [13] The RPC_VFS_DENTRY_DESTROY remove a denfry from the parent inode XHTAB, 382 * and releases memory allocated for the dentry descriptor in a remote cluster. 381 383 *********************************************************************************** 382 384 * @ cxy : server cluster identifier 383 385 * @ dentry : [in] local pointer on dentry. 386 * @ error : [out] error status (0 if success). 384 387 **********************************************************************************/ 385 388 void rpc_vfs_dentry_destroy_client( cxy_t cxy, 386 struct vfs_dentry_s * dentry ); 389 struct vfs_dentry_s * dentry, 390 error_t * error ); 387 391 388 392 void rpc_vfs_dentry_destroy_server( xptr_t xp ); -
trunk/kernel/kern/thread.h
r457 r459 118 118 * This structure defines a thread descriptor. 119 119 * It is used for both the user threads and the kernel threads. 120 * In a process, a user thread is identified by a unique TRDID (thread identifier), 121 * that is returned by the kernel to the user: 120 * In a process, a user thread is identified by a unique TRDID (thread identifier): 122 121 * - The TRDID 16 LSB bits contain the LTID (Local Thread Index). 123 122 * - The TRDID 16 MSB bits contain the CXY of cluster containing the thread. 124 * - The LTID is used to index the th_tbl[] array in the local process descriptor. 125 _* This TRDID is computed by the process_register_thread() function, when the user 123 * The main thread LTID value is always 0. 124 * The LTID is used to index the th_tbl[] array in the local process descriptor. 125 * This TRDID is computed by the process_register_thread() function, when the user 126 126 * thread is registered in the local copy of the process descriptor. 127 *128 127 * WARNING : Don't modify the first 4 fields order, as this order is used by the 129 128 * hal_kentry assembly code for the TSAR architecture.
Note: See TracChangeset
for help on using the changeset viewer.