Changeset 265 for trunk/kernel/kern
- Timestamp:
- Jul 21, 2017, 7:36:08 AM (7 years ago)
- Location:
- trunk/kernel/kern
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/kernel_init.c
r249 r265 860 860 fatfs_ctx_t * fatfs_ctx = fatfs_ctx_alloc(); 861 861 862 printk("\n@@@ %s extend = %x\n", __FUNCTION__ , fatfs_ctx );863 864 862 nolock_assert( (fatfs_ctx != NULL) , __FUNCTION__ , 865 863 "cannot create FATFS context in cluster 0\n" ); … … 901 899 hal_core_sleep(); 902 900 } 903 904 ///////////////////////////////@@@905 fatfs_ctx_display();906 ///////////////////////////////@@@907 901 908 902 // register VFS root inode in process_zero -
trunk/kernel/kern/rpc.c
r248 r265 74 74 &rpc_kcm_alloc_server, // 22 75 75 &rpc_kcm_free_server, // 23 76 &rpc_mapper_move_ server,// 2476 &rpc_mapper_move_buffer_server, // 24 77 77 &rpc_undefined, // 25 78 78 &rpc_undefined, // 26 … … 1184 1184 1185 1185 ///////////////////////////////////////////////////////////////////////////////////////// 1186 // [24] Marshaling functions attached to RPC_MAPPER_MOVE 1187 ///////////////////////////////////////////////////////////////////////////////////////// 1188 1189 /////////////////////////////////////////// 1190 void rpc_mapper_move_client( cxy_t cxy, 1191 mapper_t * mapper, // in 1192 uint32_t to_buffer, // in 1193 uint32_t file_offset, // in 1194 void * buffer, // in 1195 uint32_t size, // in 1196 error_t * error ) // out 1197 { 1198 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 1199 1200 // initialise RPC descriptor header 1201 rpc_desc_t rpc; 1202 rpc.index = RPC_MAPPER_MOVE; 1186 // [24] Marshaling functions attached to RPC_MAPPER_MOVE_BUFFER 1187 ///////////////////////////////////////////////////////////////////////////////////////// 1188 1189 /////////////////////////////////////////////////// 1190 void rpc_mapper_move_buffer_client( cxy_t cxy, 1191 mapper_t * mapper, // in 1192 bool_t to_buffer, // in 1193 bool_t is_user, // in 1194 uint32_t file_offset, // in 1195 void * buffer, // in 1196 uint32_t size, // in 1197 error_t * error ) // out 1198 { 1199 assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n"); 1200 1201 // initialise RPC descriptor header 1202 rpc_desc_t rpc; 1203 rpc.index = RPC_MAPPER_MOVE_BUFFER; 1203 1204 rpc.response = 1; 1204 1205 … … 1206 1207 rpc.args[0] = (uint64_t)(intptr_t)mapper; 1207 1208 rpc.args[1] = (uint64_t)to_buffer; 1208 rpc.args[2] = (uint64_t)file_offset; 1209 rpc.args[3] = (uint64_t)(intptr_t)buffer; 1210 rpc.args[4] = (uint64_t)size; 1209 rpc.args[2] = (uint64_t)is_user; 1210 rpc.args[3] = (uint64_t)file_offset; 1211 rpc.args[4] = (uint64_t)(intptr_t)buffer; 1212 rpc.args[5] = (uint64_t)size; 1211 1213 1212 1214 // register RPC request in remote RPC fifo (blocking function) … … 1214 1216 1215 1217 // get output values from RPC descriptor 1216 *error = (error_t)rpc.args[ 5];1217 } 1218 1219 //////////////////////////////////////// 1220 void rpc_mapper_move_ server( xptr_t xp )1218 *error = (error_t)rpc.args[6]; 1219 } 1220 1221 /////////////////////////////////////////////// 1222 void rpc_mapper_move_buffer_server( xptr_t xp ) 1221 1223 { 1222 1224 mapper_t * mapper; 1223 uint32_t to_buffer; 1225 bool_t to_buffer; 1226 bool_t is_user; 1224 1227 uint32_t file_offset; 1225 1228 void * buffer; … … 1234 1237 mapper = (mapper_t *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) ); 1235 1238 to_buffer = hal_remote_lwd( XPTR( client_cxy , &desc->args[1] ) ); 1236 file_offset = hal_remote_lwd( XPTR( client_cxy , &desc->args[2] ) ); 1237 buffer = (void *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[3] ) ); 1238 size = hal_remote_lwd( XPTR( client_cxy , &desc->args[4] ) ); 1239 is_user = hal_remote_lwd( XPTR( client_cxy , &desc->args[2] ) ); 1240 file_offset = hal_remote_lwd( XPTR( client_cxy , &desc->args[3] ) ); 1241 buffer = (void *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[4] ) ); 1242 size = hal_remote_lwd( XPTR( client_cxy , &desc->args[5] ) ); 1239 1243 1240 1244 // call local kernel function 1241 error = mapper_move( mapper, 1242 to_buffer, 1243 file_offset, 1244 buffer, 1245 size ); 1245 error = mapper_move_buffer( mapper, 1246 to_buffer, 1247 is_user, 1248 file_offset, 1249 buffer, 1250 size ); 1246 1251 1247 1252 // set output argument to client RPC descriptor 1248 hal_remote_swd( XPTR( client_cxy , &desc->args[ 5] ) , (uint64_t)error );1253 hal_remote_swd( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)error ); 1249 1254 } 1250 1255 -
trunk/kernel/kern/rpc.h
r238 r265 79 79 RPC_KCM_ALLOC = 22, 80 80 RPC_KCM_FREE = 23, 81 RPC_MAPPER_MOVE 81 RPC_MAPPER_MOVE_BUFFER = 24, 82 82 83 83 RPC_MAX_INDEX = 30, … … 551 551 552 552 /*********************************************************************************** 553 * [24] The RPC_MAPPER_MOVE is called by the vfs_move() function.553 * [24] The RPC_MAPPER_MOVE_USER is called by the vfs_move() function. 554 554 * It allows a client thread to requires a remote mapper to move data to/from 555 555 * an user buffer, as specified by the arguments. … … 558 558 * @ mapper : [in] local pointer on mapper 559 559 * @ to_buffer : [in] move data from buffer to mapper if non zero. 560 * @ is_user : [in] buffer in user space if non zero. 560 561 * @ file_offset : [in] first byte to move in mapper 561 562 * @ buffer : [in] pointer on buffer in user space … … 563 564 * @ error : [out] error status (0 if success). 564 565 **********************************************************************************/ 565 void rpc_mapper_move_client( cxy_t cxy, 566 struct mapper_s * mapper, 567 uint32_t to_buffer, 568 uint32_t file_offset, 569 void * buffer, 570 uint32_t size, 571 error_t * error ); 572 573 void rpc_mapper_move_server( xptr_t xp ); 566 void rpc_mapper_move_buffer_client( cxy_t cxy, 567 struct mapper_s * mapper, 568 bool_t to_buffer, 569 bool_t is_user, 570 uint32_t file_offset, 571 void * buffer, 572 uint32_t size, 573 error_t * error ); 574 575 void rpc_mapper_move_buffer_server( xptr_t xp ); 574 576 575 577
Note: See TracChangeset
for help on using the changeset viewer.