Changeset 409 for trunk/kernel/kern/rpc.h
- Timestamp:
- Dec 20, 2017, 4:51:09 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/rpc.h
r408 r409 32 32 #include <vseg.h> 33 33 #include <remote_fifo.h> 34 #include <signal.h> 34 35 35 36 /**** Forward declarations ****/ … … 60 61 { 61 62 RPC_PMEM_GET_PAGES = 0, 62 RPC_PROCESS_MAKE_EXEC = 1, 63 RPC_PROCESS_MAKE_FORK = 2, 64 RPC_PROCESS_KILL = 3, 65 RPC_THREAD_USER_CREATE = 4, 66 RPC_THREAD_KERNEL_CREATE = 5, 67 RPC_SIGNAL_RISE = 6, 63 RPC_PMEM_RELEASE_PAGES = 1, 64 RPC_PROCESS_MAKE_EXEC = 2, 65 RPC_PROCESS_MAKE_FORK = 3, 66 RPC_PROCESS_MAKE_EXIT = 4, 67 RPC_PROCESS_MAKE_KILL = 5, 68 RPC_THREAD_USER_CREATE = 6, 69 RPC_THREAD_KERNEL_CREATE = 7, 70 RPC_THREAD_KILL = 8, 71 RPC_PROCESS_SIGACTION = 9, 68 72 69 73 RPC_VFS_INODE_CREATE = 10, … … 86 90 RPC_SCHED_DISPLAY = 27, 87 91 RPC_VMM_SET_COW = 28, 92 88 93 RPC_MAX_INDEX = 30, 89 94 } … … 116 121 117 122 /*********************************************************************************** 118 * This blocking function executes on the client core. 119 * It puts one RPC extended pointer in the remote fifo. 120 * It sends an IPI if fifo is empty, and waits until RPC response available. 121 * The RPC descriptor must be allocated in the caller's stack 122 * and initialised by the caller. Exit with a Panic message if remote fifo 123 * is still full after (CONFIG_RPC_PUT_MAX_ITERATIONS) retries. 123 * This function is executed by the client thread in the client cluster. 124 * It puts one RPC descriptor defined by the <desc> argument in the remote fifo 125 * defined by the <cxy> argument. It sends an IPI to the server if fifo is empty. 126 * The RPC descriptor must be allocated in the caller's stack, and initialised by 127 * the caller. It exit with a Panic message if remote fifo is still full after 128 * (CONFIG_RPC_PUT_MAX_ITERATIONS) retries. 129 * - When the <block> argument is true, this function blocks and deschedule. 130 * It returns only when the server acknowledges the RPC by writing in the RPC 131 * "response" field, and unblocks the client. 132 * - When the <block> argument is false, this function returns as soon as the RPC 133 * has been registered in the FIFO, and the server thread must directly signal 134 * completion to the client thread. 124 135 *********************************************************************************** 125 136 * @ cxy : server cluster identifier 126 137 * @ desc : local pointer on RPC descriptor in client cluster 127 **********************************************************************************/ 128 void rpc_send_sync( cxy_t cxy, 129 rpc_desc_t * desc ); 138 * @ block : boolean true when blocking behaviour is required. 139 **********************************************************************************/ 140 void rpc_send( cxy_t cxy, 141 rpc_desc_t * desc, 142 bool_t block ); 130 143 131 144 … … 186 199 187 200 /*********************************************************************************** 188 * [1] The RPC_PROCESS_MAKE_EXEC creates a new process descriptor, from an existing 201 * [1] The RPC_PMEM_RELEASE_PAGES release one or several pages to a remote cluster. 202 *********************************************************************************** 203 * @ cxy : server cluster identifier 204 * @ page : [in] local pointer on page descriptor to release. 205 **********************************************************************************/ 206 void rpc_pmem_release_pages_client( cxy_t cxy, 207 struct page_s * page ); 208 209 void rpc_pmem_release_pages_server( xptr_t xp ); 210 211 /*********************************************************************************** 212 * [2] The RPC_PROCESS_MAKE_EXEC creates a new process descriptor, from an existing 189 213 * process descriptor in a remote server cluster. This server cluster must be 190 214 * the owner cluster for the existing process. The new process descriptor is … … 204 228 205 229 /*********************************************************************************** 206 * [ 2] The RPC_PROCESS_MAKE_FORK creates a "child" process descriptor, and the230 * [3] The RPC_PROCESS_MAKE_FORK creates a "child" process descriptor, and the 207 231 * associated "child" thread descriptor in a target remote cluster that can be 208 232 * any cluster. The child process is initialized from informations found in the … … 227 251 228 252 /*********************************************************************************** 229 * [3] The RPC_PROCESS_KILL is actually a multicast RPC sent by the reference cluster 230 * to other clusters containing a process descriptor copy, to destroy these copies. 231 *********************************************************************************** 232 * @ process : local pointer on target process. 233 **********************************************************************************/ 234 void rpc_process_kill_client( struct process_s * process ); 235 236 void rpc_process_kill_server( xptr_t xp ); 237 238 /*********************************************************************************** 239 * [4] The RPC_THREAD_USER_CREATE creates an user thread in the server cluster, 253 * [4] The RPC_PROCESS_MAKE_EXIT can be called by any thread to request the owner 254 * cluster to execute the process_make_exit() function for a calling process. 255 *********************************************************************************** 256 * @ cxy : server cluster identifier. 257 * @ process : local pointer on calling process in owner cluster. 258 * @ status : calling process exit status. 259 **********************************************************************************/ 260 void rpc_process_make_exit_client( cxy_t cxy, 261 struct process_s * process, 262 uint32_t status ); 263 264 void rpc_process_make_exit_server( xptr_t xp ); 265 266 /*********************************************************************************** 267 * [5] The RPC_PROCESS_MAKE_KILL can be called by any thread to request the owner 268 * cluster to execute the process_make_kill() function for a target process. 269 *********************************************************************************** 270 * @ cxy : server cluster identifier. 271 * @ process : local pointer on target process in owner cluster. 272 * @ seg_id : signal type (only SIGKILL / SIGSTOP / SIGCONT are supported). 273 **********************************************************************************/ 274 void rpc_process_make_kill_client( cxy_t cxy, 275 struct process_s * process, 276 uint32_t seg_id ); 277 278 void rpc_process_make_kill_server( xptr_t xp ); 279 280 /*********************************************************************************** 281 * [6] The RPC_THREAD_USER_CREATE creates an user thread in the server cluster, 240 282 * as specified by the arguments. It returns an extended pointer on the new 241 283 * thread descriptor in server cluster, and an error code. … … 258 300 259 301 /*********************************************************************************** 260 * [ 5] The RPC_THREAD_KERNEL_CREATE creates a kernel thread in the server cluster,302 * [7] The RPC_THREAD_KERNEL_CREATE creates a kernel thread in the server cluster, 261 303 * as specified by the type, func and args arguments. It returns the local pointer 262 304 * on the thread descriptor in server cluster and an error code. … … 280 322 281 323 /*********************************************************************************** 282 * [6] The RPC_SIGNAL_RISE ask a target cluster to register a given signal in 283 * all threads descriptors of a given process. 284 * It is used by the sys_kill() function. 324 * [8] The RPC_THREAD_KILL ask a target cluster to kill a given thread descriptor. 325 * It is called by the sys_thread_cancel() function for a remote thread. 285 326 *********************************************************************************** 286 327 * @ cxy : server cluster identifier. 287 * @ process : [in] local pointer on target process descriptor in server. 288 * @ sig_id : [in] signal index. 289 **********************************************************************************/ 290 void rpc_signal_rise_client( cxy_t cxy, 291 struct process_s * process, 292 uint32_t sig_id ); 328 * @ thread : [in] local pointer on target process descriptor in server. 329 **********************************************************************************/ 330 void rpc_thread_kill_client( cxy_t cxy, 331 struct thread_s * thread ); 293 332 294 void rpc_signal_rise_server( xptr_t xp ); 333 void rpc_thread_kill_server( xptr_t xp ); 334 335 /*********************************************************************************** 336 * [9] The RPC_PROCESS_SIGACTION allows the owner cluster to request any other 337 * cluster to execute a given sigaction (BLOCK / UNBLOCK / DELETE) for all threads 338 * of a given process. 339 * 340 * WARNING : It is implemented as a NON BLOCKING multicast RPC, that can be sent 341 * in parallel to all process copies. The various server threads must decrement the 342 * responses counter defined by the <rsp_xp> argument, and the last server thread 343 * must unblock the <client_xp> thread. 344 *********************************************************************************** 345 * @ cxy : server cluster identifier. 346 * @ process : [in] local pointer on target process in server cluster. 347 * @ sigaction : [in] action type (BLOCK / UNBLOCK / DELETE). 348 * @ rsp_xp : [in] extended pointer on response counter. 349 * @ client_xp : [in] extended pointer on client thread. 350 **********************************************************************************/ 351 void rpc_process_sigaction_client( cxy_t cxy, 352 struct process_s * process, 353 uint32_t sigaction, 354 xptr_t rsp_xp, 355 xptr_t client_xp ); 356 357 void rpc_process_sigaction_server( xptr_t xp ); 295 358 296 359 /***********************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.