Changeset 265 for trunk/kernel/kern/rpc.c
- Timestamp:
- Jul 21, 2017, 7:36:08 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.