[1] | 1 | /* |
---|
| 2 | * rpc.h - RPC (Remote Procedure Call) operations definition. |
---|
| 3 | * |
---|
[437] | 4 | * Author Alain Greiner (2016,2017,2018) |
---|
[1] | 5 | * |
---|
| 6 | * Copyright (c) UPMC Sorbonne Universites |
---|
| 7 | * |
---|
| 8 | * This file is part of ALMOS-MKH. |
---|
| 9 | * |
---|
| 10 | * ALMOS-MKH is free software; you can redistribute it and/or modify it |
---|
| 11 | * under the terms of the GNU General Public License as published by |
---|
| 12 | * the Free Software Foundation; version 2.0 of the License. |
---|
| 13 | * |
---|
| 14 | * ALMOS-MKH is distributed in the hope that it will be useful, but |
---|
| 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
| 17 | * General Public License for more details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU General Public License |
---|
| 20 | * along with ALMOS-MKH; if not, write to the Free Software Foundation, |
---|
| 21 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
| 22 | */ |
---|
| 23 | |
---|
| 24 | #ifndef _RPC_H_ |
---|
| 25 | #define _RPC_H_ |
---|
| 26 | |
---|
[14] | 27 | #include <kernel_config.h> |
---|
[457] | 28 | #include <hal_kernel_types.h> |
---|
[1] | 29 | #include <hal_atomic.h> |
---|
| 30 | #include <bits.h> |
---|
[407] | 31 | #include <vseg.h> |
---|
[1] | 32 | #include <remote_fifo.h> |
---|
| 33 | |
---|
| 34 | /**** Forward declarations ****/ |
---|
| 35 | |
---|
| 36 | struct process_s; |
---|
[313] | 37 | struct page_s; |
---|
[1] | 38 | struct vseg_s; |
---|
| 39 | struct exec_info_s; |
---|
| 40 | struct pthread_attr_s; |
---|
| 41 | struct remote_sem_s; |
---|
[612] | 42 | struct user_dir_s; |
---|
[1] | 43 | struct fragment_s; |
---|
| 44 | struct vfs_inode_s; |
---|
| 45 | struct vfs_dentry_s; |
---|
[23] | 46 | struct vfs_file_s; |
---|
[1] | 47 | struct thread_s; |
---|
| 48 | struct mapper_s; |
---|
| 49 | |
---|
[436] | 50 | |
---|
[1] | 51 | /**********************************************************************************/ |
---|
| 52 | /************** structures for Remote Procedure Calls ****************************/ |
---|
| 53 | /**********************************************************************************/ |
---|
| 54 | |
---|
| 55 | /*********************************************************************************** |
---|
| 56 | * This enum defines all RPC indexes. |
---|
[611] | 57 | * It must be consistent with the rpc_server[] arrays defined in in the rpc.c file. |
---|
[1] | 58 | **********************************************************************************/ |
---|
| 59 | |
---|
| 60 | typedef enum |
---|
| 61 | { |
---|
[640] | 62 | RPC_UNDEFINED_0 = 0, // |
---|
| 63 | RPC_UNDEFINED_1 = 1, // |
---|
| 64 | RPC_UNDEFINED_2 = 2, // |
---|
[601] | 65 | RPC_PROCESS_MAKE_FORK = 3, |
---|
[612] | 66 | RPC_USER_DIR_CREATE = 4, |
---|
| 67 | RPC_USER_DIR_DESTROY = 5, |
---|
[601] | 68 | RPC_THREAD_USER_CREATE = 6, |
---|
| 69 | RPC_THREAD_KERNEL_CREATE = 7, |
---|
[623] | 70 | RPC_VFS_FS_UPDATE_DENTRY = 8, |
---|
[619] | 71 | RPC_PROCESS_SIGACTION = 9, |
---|
[1] | 72 | |
---|
[601] | 73 | RPC_VFS_INODE_CREATE = 10, |
---|
| 74 | RPC_VFS_INODE_DESTROY = 11, |
---|
| 75 | RPC_VFS_DENTRY_CREATE = 12, |
---|
| 76 | RPC_VFS_DENTRY_DESTROY = 13, |
---|
| 77 | RPC_VFS_FILE_CREATE = 14, |
---|
| 78 | RPC_VFS_FILE_DESTROY = 15, |
---|
[628] | 79 | RPC_VFS_FS_NEW_DENTRY = 16, |
---|
[610] | 80 | RPC_VFS_FS_ADD_DENTRY = 17, |
---|
| 81 | RPC_VFS_FS_REMOVE_DENTRY = 18, |
---|
[601] | 82 | RPC_VFS_INODE_LOAD_ALL_PAGES = 19, |
---|
[1] | 83 | |
---|
[640] | 84 | RPC_UNDEFINED_20 = 20, // |
---|
| 85 | RPC_UNDEFINED_21 = 21, // |
---|
| 86 | RPC_UNDEFINED_22 = 22, // |
---|
| 87 | RPC_UNDEFINED_23 = 23, // |
---|
[623] | 88 | RPC_MAPPER_SYNC = 24, |
---|
[640] | 89 | RPC_VMM_RESIZE_VSEG = 25, |
---|
| 90 | RPC_VMM_REMOVE_VSEG = 26, |
---|
[601] | 91 | RPC_VMM_CREATE_VSEG = 27, |
---|
| 92 | RPC_VMM_SET_COW = 28, |
---|
[640] | 93 | RPC_UNDEFINED_29 = 29, // |
---|
[409] | 94 | |
---|
[601] | 95 | RPC_MAX_INDEX = 30, |
---|
[1] | 96 | } |
---|
| 97 | rpc_index_t; |
---|
| 98 | |
---|
| 99 | /*********************************************************************************** |
---|
| 100 | * This defines the prototype of the rpc_server functions, |
---|
| 101 | * defined by the rpc_server[] array in the rpc.c file. |
---|
| 102 | **********************************************************************************/ |
---|
| 103 | |
---|
| 104 | typedef void (rpc_server_t) ( xptr_t xp ); |
---|
| 105 | |
---|
| 106 | /*********************************************************************************** |
---|
[619] | 107 | * This structure defines the RPC descriptor (100 bytes on a 32bits core) |
---|
[1] | 108 | **********************************************************************************/ |
---|
| 109 | |
---|
| 110 | typedef struct rpc_desc_s |
---|
| 111 | { |
---|
[619] | 112 | rpc_index_t index; /*! index of requested RPC service ( 4) */ |
---|
| 113 | uint32_t * rsp; /*! local pointer ond responses counter ( 4) */ |
---|
| 114 | struct thread_s * thread; /*! local pointer on client thread ( 4) */ |
---|
| 115 | uint32_t lid; /*! index of core running client thread ( 4) */ |
---|
| 116 | bool_t blocking; /*! simple RPC mode when true ( 4) */ |
---|
| 117 | uint64_t args[10]; /*! input/output arguments buffer (80) */ |
---|
[1] | 118 | } |
---|
| 119 | rpc_desc_t; |
---|
| 120 | |
---|
| 121 | /**********************************************************************************/ |
---|
| 122 | /******* Generic functions supporting RPCs : client side **************************/ |
---|
| 123 | /**********************************************************************************/ |
---|
| 124 | |
---|
| 125 | /*********************************************************************************** |
---|
[409] | 126 | * This function is executed by the client thread in the client cluster. |
---|
| 127 | * It puts one RPC descriptor defined by the <desc> argument in the remote fifo |
---|
| 128 | * defined by the <cxy> argument. It sends an IPI to the server if fifo is empty. |
---|
| 129 | * The RPC descriptor must be allocated in the caller's stack, and initialised by |
---|
| 130 | * the caller. It exit with a Panic message if remote fifo is still full after |
---|
| 131 | * (CONFIG_RPC_PUT_MAX_ITERATIONS) retries. |
---|
[641] | 132 | * - When the RPC <blocking> field is true, this function blocks and deschedule |
---|
| 133 | * the client thread. It returns only when the server completes the RPC and |
---|
| 134 | * unblocks the client thread. |
---|
[416] | 135 | * - When the <blocking> field is false, this function returns as soon as the RPC |
---|
[641] | 136 | * has been registered in the FIFO, and the client thread must block itself when |
---|
| 137 | * all RPCS have been registered in all target clusters. |
---|
[1] | 138 | *********************************************************************************** |
---|
| 139 | * @ cxy : server cluster identifier |
---|
| 140 | * @ desc : local pointer on RPC descriptor in client cluster |
---|
| 141 | **********************************************************************************/ |
---|
[409] | 142 | void rpc_send( cxy_t cxy, |
---|
[416] | 143 | rpc_desc_t * desc ); |
---|
[1] | 144 | |
---|
| 145 | |
---|
| 146 | |
---|
| 147 | /**********************************************************************************/ |
---|
| 148 | /******* Generic functions supporting RPCs : server side **************************/ |
---|
| 149 | /**********************************************************************************/ |
---|
| 150 | |
---|
| 151 | /*********************************************************************************** |
---|
[583] | 152 | * This function contains the infinite loop executed by a RPC server thread, |
---|
| 153 | * to handle pending RPCs registered in the RPC fifo attached to a given core. |
---|
| 154 | * In each iteration in this loop, it try to handle one RPC request: |
---|
| 155 | * - it tries to take the RPC FIFO ownership, |
---|
| 156 | * - it consumes one request when the FIFO is not empty, |
---|
| 157 | * - it releases the FIFO ownership, |
---|
| 158 | * - it execute the requested service, |
---|
| 159 | * - it unblock and send an IPI to the client thread, |
---|
| 160 | * - it suicides if the number of RPC threads for this core is to large, |
---|
| 161 | * - it block on IDLE and deschedule otherwise. |
---|
[1] | 162 | **********************************************************************************/ |
---|
[619] | 163 | void rpc_server_func( void ); |
---|
[1] | 164 | |
---|
| 165 | /*********************************************************************************** |
---|
| 166 | * This function is executed in case of illegal RPC index. |
---|
| 167 | **********************************************************************************/ |
---|
[503] | 168 | void __attribute__((noinline)) rpc_undefined( xptr_t xp __attribute__ ((unused)) ); |
---|
[1] | 169 | |
---|
[23] | 170 | |
---|
| 171 | |
---|
[1] | 172 | /**********************************************************************************/ |
---|
| 173 | /******* Marshalling functions attached to the various RPCs ***********************/ |
---|
| 174 | /**********************************************************************************/ |
---|
| 175 | |
---|
| 176 | /*********************************************************************************** |
---|
[640] | 177 | * [0] undefined |
---|
[1] | 178 | **********************************************************************************/ |
---|
[632] | 179 | |
---|
[1] | 180 | /*********************************************************************************** |
---|
[640] | 181 | * [1] undefined |
---|
[409] | 182 | **********************************************************************************/ |
---|
[632] | 183 | |
---|
[409] | 184 | /*********************************************************************************** |
---|
[640] | 185 | * [2] undefined |
---|
[1] | 186 | **********************************************************************************/ |
---|
[632] | 187 | |
---|
[1] | 188 | /*********************************************************************************** |
---|
[409] | 189 | * [3] The RPC_PROCESS_MAKE_FORK creates a "child" process descriptor, and the |
---|
[408] | 190 | * associated "child" thread descriptor in a target remote cluster that can be |
---|
| 191 | * any cluster. The child process is initialized from informations found in the |
---|
| 192 | * "parent" process descriptor (that must be the parent reference cluster), |
---|
| 193 | * and from the "parent" thread descriptor that can be in any cluster. |
---|
[1] | 194 | *********************************************************************************** |
---|
[408] | 195 | * @ cxy : server cluster identifier. |
---|
| 196 | * @ ref_process_xp : [in] extended pointer on reference parent process. |
---|
| 197 | * @ parent_thread_xp : [in] extended pointer on parent thread. |
---|
| 198 | * @ child_pid : [out] child process identifier. |
---|
| 199 | * @ child_thread_ptr : [out] local pointer on child thread. |
---|
| 200 | * @ error : [out] error status (0 if success). |
---|
[1] | 201 | **********************************************************************************/ |
---|
[408] | 202 | void rpc_process_make_fork_client( cxy_t cxy, |
---|
| 203 | xptr_t ref_process_xp, |
---|
| 204 | xptr_t parent_thread_xp, |
---|
| 205 | pid_t * child_pid, |
---|
| 206 | struct thread_s ** child_thread_ptr, |
---|
| 207 | error_t * error ); |
---|
[1] | 208 | |
---|
[408] | 209 | void rpc_process_make_fork_server( xptr_t xp ); |
---|
[1] | 210 | |
---|
| 211 | /*********************************************************************************** |
---|
[612] | 212 | * [4] The RPC_USER_DIR_CREATE allows a client thread to create an user_dir_t |
---|
| 213 | * structure and the associated array of dirents in a remote cluster containing |
---|
[614] | 214 | * the target directory <inode>. It creates an ANON vseg in the user reference |
---|
| 215 | * process VMM identified by the <ref_xp>. This reference cluster cluster can be |
---|
| 216 | * different from both the client and server clusters. |
---|
| 217 | * It is called by the sys_opendir() function. |
---|
[612] | 218 | *********************************************************************************** |
---|
| 219 | * @ cxy : server cluster identifier. |
---|
| 220 | * @ inode : [in] local pointer on inode in server cluster. |
---|
[614] | 221 | * @ ref_xp : [in] extended pointer on user reference process descriptor. |
---|
[612] | 222 | * @ dir : [out] local pointer on created user_dir structure. |
---|
[1] | 223 | **********************************************************************************/ |
---|
[612] | 224 | void rpc_user_dir_create_client( cxy_t cxy, |
---|
| 225 | struct vfs_inode_s * inode, |
---|
[614] | 226 | xptr_t ref_xp, |
---|
[612] | 227 | struct user_dir_s ** dir ); |
---|
[1] | 228 | |
---|
[612] | 229 | void rpc_user_dir_create_server( xptr_t xp ); |
---|
| 230 | |
---|
[1] | 231 | /*********************************************************************************** |
---|
[612] | 232 | * [5] The RPC_USER_DIR_DESTROY allows a client thread to delete an user_dir_t |
---|
| 233 | * structure and the associated array of dirents in a remote cluster containing |
---|
| 234 | * the target directory inode. It is called by the sys_closedir() function. |
---|
| 235 | *********************************************************************************** |
---|
| 236 | * @ cxy : server cluster identifier. |
---|
| 237 | * @ dir : [in] local pointer on created user_dir structure. |
---|
[614] | 238 | * @ ref_xp : [in] extended pointer on user reference process descriptor. |
---|
[409] | 239 | **********************************************************************************/ |
---|
[612] | 240 | void rpc_user_dir_destroy_client( cxy_t cxy, |
---|
[614] | 241 | struct user_dir_s * dir, |
---|
| 242 | xptr_t ref_xp ); |
---|
[409] | 243 | |
---|
[612] | 244 | void rpc_user_dir_destroy_server( xptr_t xp ); |
---|
| 245 | |
---|
[409] | 246 | /*********************************************************************************** |
---|
| 247 | * [6] The RPC_THREAD_USER_CREATE creates an user thread in the server cluster, |
---|
[23] | 248 | * as specified by the arguments. It returns an extended pointer on the new |
---|
| 249 | * thread descriptor in server cluster, and an error code. |
---|
| 250 | * It is called by the sys_thread_create() system call. |
---|
[1] | 251 | *********************************************************************************** |
---|
| 252 | * @ cxy : server cluster identifier. |
---|
[407] | 253 | * @ attr : [in] local pointer on pthread_attr_t in client cluster. |
---|
| 254 | * @ thread_xp : [out] buffer for thread extended pointer. |
---|
[1] | 255 | * @ error : [out] error status (0 if success). |
---|
| 256 | **********************************************************************************/ |
---|
| 257 | void rpc_thread_user_create_client( cxy_t cxy, |
---|
[23] | 258 | pid_t pid, |
---|
| 259 | void * start_func, |
---|
| 260 | void * start_arg, |
---|
[407] | 261 | pthread_attr_t * attr, |
---|
[1] | 262 | xptr_t * thread_xp, |
---|
| 263 | error_t * error ); |
---|
| 264 | |
---|
| 265 | void rpc_thread_user_create_server( xptr_t xp ); |
---|
| 266 | |
---|
| 267 | /*********************************************************************************** |
---|
[409] | 268 | * [7] The RPC_THREAD_KERNEL_CREATE creates a kernel thread in the server cluster, |
---|
[1] | 269 | * as specified by the type, func and args arguments. It returns the local pointer |
---|
| 270 | * on the thread descriptor in server cluster and an error code. |
---|
[23] | 271 | * It is used by the dev_init() function to create the device server thread. |
---|
[1] | 272 | *********************************************************************************** |
---|
| 273 | * @ cxy : server cluster identifier. |
---|
| 274 | * @ type : [in] type of kernel thread. |
---|
| 275 | * @ func : [in] local pointer on thread function. |
---|
| 276 | * @ args : [in] local pointer on function arguments. |
---|
| 277 | * @ thread_xp : [out] pointer on buffer for thread extended pointer. |
---|
| 278 | * @ error : [out] error status (0 if success). |
---|
| 279 | **********************************************************************************/ |
---|
| 280 | void rpc_thread_kernel_create_client( cxy_t cxy, |
---|
| 281 | uint32_t type, |
---|
| 282 | void * func, |
---|
| 283 | void * args, |
---|
| 284 | xptr_t * thread_xp, |
---|
| 285 | error_t * error ); |
---|
| 286 | |
---|
| 287 | void rpc_thread_kernel_create_server( xptr_t xp ); |
---|
| 288 | |
---|
[23] | 289 | /*********************************************************************************** |
---|
[623] | 290 | * [8] The RPC_VFS_FS_UPDATE_DENTRY allows a client thread to request a remote |
---|
| 291 | * cluster to update the <size> field of a directory entry in the mapper of a |
---|
| 292 | * remote directory inode, identified by the <inode> local pointer. |
---|
| 293 | * The target entry name is identified by the <dentry> local pointer. |
---|
| 294 | *********************************************************************************** |
---|
| 295 | * @ cxy : server cluster identifier. |
---|
| 296 | * @ inode : [in] local pointer on remote directory inode. |
---|
| 297 | * @ dentry : [in] local pointer on remote dentry. |
---|
| 298 | * @ size : [in] new size value. |
---|
| 299 | * @ error : [out] error status (0 if success). |
---|
[23] | 300 | **********************************************************************************/ |
---|
[623] | 301 | void rpc_vfs_fs_update_dentry_client( cxy_t cxy, |
---|
| 302 | struct vfs_inode_s * inode, |
---|
| 303 | struct vfs_dentry_s * dentry, |
---|
| 304 | uint32_t size, |
---|
| 305 | error_t * error ); |
---|
[23] | 306 | |
---|
[623] | 307 | void rpc_vfs_fs_update_dentry_server( xptr_t xp ); |
---|
| 308 | |
---|
[409] | 309 | /*********************************************************************************** |
---|
[623] | 310 | * [9] The RPC_PROCESS_SIGACTION allows a client thread to request a remote cluster |
---|
| 311 | * to execute a given sigaction, defined by the <action_type> for a given process, |
---|
[619] | 312 | * identified by the <pid> argument. |
---|
[409] | 313 | *********************************************************************************** |
---|
[436] | 314 | * @ cxy : server cluster identifier. |
---|
[619] | 315 | * @ pid : [in] target process identifier. |
---|
| 316 | * @ action : [in] sigaction index. |
---|
[409] | 317 | **********************************************************************************/ |
---|
[619] | 318 | void rpc_process_sigaction_client( cxy_t cxy, |
---|
| 319 | pid_t pid, |
---|
| 320 | uint32_t action ); |
---|
[409] | 321 | |
---|
| 322 | void rpc_process_sigaction_server( xptr_t xp ); |
---|
| 323 | |
---|
[1] | 324 | /*********************************************************************************** |
---|
[23] | 325 | * [10] The RPC_VFS_INODE_CREATE creates an inode and the associated mapper in a |
---|
[1] | 326 | * remote cluster. The parent dentry must have been previously created. |
---|
| 327 | * It returns an extended pointer on the created inode. |
---|
| 328 | *********************************************************************************** |
---|
[23] | 329 | * @ cxy : server cluster identifier. |
---|
| 330 | * @ fs_type : [in] file system type. |
---|
| 331 | * @ inode_type : [in] file system type. |
---|
| 332 | * @ attr : [in] inode attributes. |
---|
| 333 | * @ rights : [in] access rights |
---|
| 334 | * @ uid : [in] user ID |
---|
| 335 | * @ gid : [in] group ID |
---|
| 336 | * @ inode_xp : [out] buffer for extended pointer on created inode. |
---|
| 337 | * @ error : [out] error status (0 if success). |
---|
[1] | 338 | **********************************************************************************/ |
---|
| 339 | void rpc_vfs_inode_create_client( cxy_t cxy, |
---|
[23] | 340 | uint32_t fs_type, |
---|
[1] | 341 | uint32_t attr, |
---|
[23] | 342 | uint32_t rights, |
---|
[1] | 343 | uint32_t uid, |
---|
| 344 | uint32_t gid, |
---|
| 345 | xptr_t * inode_xp, |
---|
| 346 | error_t * error ); |
---|
| 347 | |
---|
| 348 | void rpc_vfs_inode_create_server( xptr_t xp ); |
---|
| 349 | |
---|
| 350 | /*********************************************************************************** |
---|
[23] | 351 | * [11] The RPC_VFS_INODE_DESTROY releases memory allocated for an inode descriptor |
---|
[1] | 352 | * and for the associated mapper in a remote cluster. |
---|
| 353 | *********************************************************************************** |
---|
| 354 | * @ cxy : server cluster identifier |
---|
| 355 | * @ inode : [in] local pointer on inode. |
---|
| 356 | **********************************************************************************/ |
---|
[601] | 357 | void rpc_vfs_inode_destroy_client( cxy_t cxy, |
---|
| 358 | struct vfs_inode_s * inode ); |
---|
[1] | 359 | |
---|
| 360 | void rpc_vfs_inode_destroy_server( xptr_t xp ); |
---|
| 361 | |
---|
| 362 | /*********************************************************************************** |
---|
[23] | 363 | * [12] The RPC_VFS_DENTRY_CREATE creates a dentry in a remote cluster. |
---|
[1] | 364 | * It returns an extended pointer on the created dentry. |
---|
| 365 | *********************************************************************************** |
---|
| 366 | * @ cxy : server cluster identifier |
---|
| 367 | * @ type : [in] file system type. |
---|
| 368 | * @ name : [in] directory entry name. |
---|
| 369 | * @ dentry_xp : [out] buffer for extended pointer on created dentry. |
---|
| 370 | * @ error : [out] error status (0 if success). |
---|
| 371 | **********************************************************************************/ |
---|
| 372 | void rpc_vfs_dentry_create_client( cxy_t cxy, |
---|
| 373 | uint32_t type, |
---|
| 374 | char * name, |
---|
| 375 | xptr_t * dentry_xp, |
---|
| 376 | error_t * error ); |
---|
| 377 | |
---|
| 378 | void rpc_vfs_dentry_create_server( xptr_t xp ); |
---|
| 379 | |
---|
| 380 | /*********************************************************************************** |
---|
[459] | 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. |
---|
[1] | 383 | *********************************************************************************** |
---|
| 384 | * @ cxy : server cluster identifier |
---|
| 385 | * @ dentry : [in] local pointer on dentry. |
---|
| 386 | **********************************************************************************/ |
---|
| 387 | void rpc_vfs_dentry_destroy_client( cxy_t cxy, |
---|
[601] | 388 | struct vfs_dentry_s * dentry ); |
---|
[1] | 389 | |
---|
| 390 | void rpc_vfs_dentry_destroy_server( xptr_t xp ); |
---|
| 391 | |
---|
[23] | 392 | /*********************************************************************************** |
---|
| 393 | * [14] The RPC_VFS_FILE_CREATE creates a file descriptor in a remote cluster. |
---|
| 394 | * It returns an extended pointer on the created file structure. |
---|
| 395 | *********************************************************************************** |
---|
| 396 | * @ cxy : server cluster identifier |
---|
| 397 | * @ inode : [in] local pointer on parent inode. |
---|
| 398 | * @ file_attr : [in] new file attributes. |
---|
| 399 | * @ file_xp : [out] buffer for extended pointer on created file. |
---|
| 400 | * @ error : [out] error status (0 if success). |
---|
| 401 | **********************************************************************************/ |
---|
| 402 | void rpc_vfs_file_create_client( cxy_t cxy, |
---|
| 403 | struct vfs_inode_s * inode, |
---|
| 404 | uint32_t file_attr, |
---|
| 405 | xptr_t * file_xp, |
---|
| 406 | error_t * error ); |
---|
[1] | 407 | |
---|
[23] | 408 | void rpc_vfs_file_create_server( xptr_t xp ); |
---|
[1] | 409 | |
---|
[23] | 410 | /*********************************************************************************** |
---|
| 411 | * [15] The RPC_VFS_FILE_DESTROY releases memory allocated for a file descriptor |
---|
| 412 | * in a remote cluster. |
---|
| 413 | *********************************************************************************** |
---|
| 414 | * @ cxy : server cluster identifier |
---|
| 415 | * @ file : [in] local pointer on file. |
---|
| 416 | **********************************************************************************/ |
---|
| 417 | void rpc_vfs_file_destroy_client( cxy_t cxy, |
---|
| 418 | struct vfs_file_s * file ); |
---|
[1] | 419 | |
---|
[23] | 420 | void rpc_vfs_file_destroy_server( xptr_t xp ); |
---|
| 421 | |
---|
[238] | 422 | /*********************************************************************************** |
---|
[623] | 423 | * [16] The RPC_VFS_FS_GET_DENTRY calls the vfs_fs_new_dentry() |
---|
[601] | 424 | * function in a remote cluster containing a parent inode directory to scan the |
---|
| 425 | * associated mapper, find a directory entry identified by its name, and update |
---|
[612] | 426 | * both the - existing - child inode and dentry. |
---|
[238] | 427 | *********************************************************************************** |
---|
[601] | 428 | * @ cxy : server cluster identifier |
---|
[238] | 429 | * @ parent_inode : [in] local pointer on parent inode. |
---|
| 430 | * @ name : [in] local pointer on child name (in client cluster). |
---|
| 431 | * @ child_inode_xp : [in] extended pointer on child inode (in another cluster). |
---|
| 432 | * @ error : [out] error status (0 if success). |
---|
| 433 | **********************************************************************************/ |
---|
[623] | 434 | void rpc_vfs_fs_new_dentry_client( cxy_t cxy, |
---|
[601] | 435 | struct vfs_inode_s * parent_inode, |
---|
| 436 | char * name, |
---|
| 437 | xptr_t child_inode_xp, |
---|
| 438 | error_t * error ); |
---|
[238] | 439 | |
---|
[623] | 440 | void rpc_vfs_fs_new_dentry_server( xptr_t xp ); |
---|
[238] | 441 | |
---|
| 442 | /*********************************************************************************** |
---|
[601] | 443 | * [17] The RPC_VFS_FS_ADD_DENTRY calls the vfs_fs_add_dentry() function in a |
---|
| 444 | * remote cluster containing a directory inode and mapper, to add a new dentry |
---|
| 445 | * in the mapper of this directory. |
---|
[238] | 446 | *********************************************************************************** |
---|
[601] | 447 | * @ cxy : server cluster identifier |
---|
| 448 | * @ parent : [in] local pointer on directory inode. |
---|
| 449 | * @ dentry : [in] local pointer on dentry. |
---|
| 450 | * @ error : [out] error status (0 if success). |
---|
[238] | 451 | **********************************************************************************/ |
---|
[601] | 452 | void rpc_vfs_fs_add_dentry_client( cxy_t, |
---|
| 453 | struct vfs_inode_s * parent, |
---|
| 454 | struct vfs_dentry_s * dentry, |
---|
| 455 | error_t * error ); |
---|
[238] | 456 | |
---|
[601] | 457 | void rpc_vfs_fs_add_dentry_server( xptr_t xp ); |
---|
[238] | 458 | |
---|
[601] | 459 | /*********************************************************************************** |
---|
| 460 | * [18] The RPC_VFS_FS_REMOVE_DENTRY calls the vfs_fs_remove_dentry() function in a |
---|
| 461 | * remote cluster containing a directory inode and mapper, to remove a dentry from |
---|
| 462 | * the mapper of this directory. |
---|
[23] | 463 | *********************************************************************************** |
---|
[601] | 464 | * @ cxy : server cluster identifier |
---|
| 465 | * @ parent : [in] local pointer on directory inode. |
---|
| 466 | * @ dentry : [in] local pointer on dentry. |
---|
| 467 | * @ error : [out] error status (0 if success). |
---|
[23] | 468 | **********************************************************************************/ |
---|
[601] | 469 | void rpc_vfs_fs_remove_dentry_client( cxy_t, |
---|
| 470 | struct vfs_inode_s * parent, |
---|
| 471 | struct vfs_dentry_s * dentry, |
---|
| 472 | error_t * error ); |
---|
[23] | 473 | |
---|
[601] | 474 | void rpc_vfs_fs_remove_dentry_server( xptr_t xp ); |
---|
[23] | 475 | |
---|
| 476 | /*********************************************************************************** |
---|
[601] | 477 | * [19] The RPC_VFS_INODE_LOAD_ALL_PAGES calls the vfs_inode_load_all_pages() |
---|
| 478 | * function a remote cluster containing an inode to load all pages in the |
---|
| 479 | * associated mapper. |
---|
| 480 | *********************************************************************************** |
---|
| 481 | * @ cxy : server cluster identifier |
---|
| 482 | * @ inode : [in] local pointer on inode in server cluster. |
---|
| 483 | * @ error : [out] error status (0 if success). |
---|
[433] | 484 | **********************************************************************************/ |
---|
[601] | 485 | void rpc_vfs_inode_load_all_pages_client( cxy_t cxy, |
---|
| 486 | struct vfs_inode_s * inode, |
---|
| 487 | error_t * error ); |
---|
[433] | 488 | |
---|
[601] | 489 | void rpc_vfs_inode_load_all_pages_server( xptr_t xp ); |
---|
| 490 | |
---|
[433] | 491 | /*********************************************************************************** |
---|
[640] | 492 | * [20] undefined |
---|
[1] | 493 | **********************************************************************************/ |
---|
| 494 | |
---|
| 495 | /*********************************************************************************** |
---|
[640] | 496 | * [21] undefined |
---|
[1] | 497 | **********************************************************************************/ |
---|
| 498 | |
---|
| 499 | /*********************************************************************************** |
---|
[640] | 500 | * [22] undefined |
---|
[1] | 501 | **********************************************************************************/ |
---|
[635] | 502 | |
---|
[1] | 503 | /*********************************************************************************** |
---|
[640] | 504 | * [23] undefined |
---|
[1] | 505 | **********************************************************************************/ |
---|
[635] | 506 | |
---|
[1] | 507 | /*********************************************************************************** |
---|
[623] | 508 | * [24] The RPC_MAPPER_SYNC allows a client thread to synchronize on disk |
---|
| 509 | * all dirty pages of a remote mapper. |
---|
| 510 | *********************************************************************************** |
---|
| 511 | * @ cxy : server cluster identifier. |
---|
| 512 | * @ mapper : [in] local pointer on mapper in server cluster. |
---|
| 513 | * @ error : [out] error status (0 if success). |
---|
[1] | 514 | **********************************************************************************/ |
---|
[623] | 515 | void rpc_mapper_sync_client( cxy_t cxy, |
---|
| 516 | struct mapper_s * mapper, |
---|
| 517 | error_t * error ); |
---|
[1] | 518 | |
---|
[623] | 519 | void rpc_mapper_sync_server( xptr_t xp ); |
---|
| 520 | |
---|
[313] | 521 | /*********************************************************************************** |
---|
[641] | 522 | * [25] The RPC_VMM_RESIZE_VSEG allows a client thread to request a remote cluster |
---|
| 523 | * to resize a vseg identified by the <base> argument in a process descriptor |
---|
| 524 | * identified by the <pid> argument, as defined by the <new_base> and <new_size> |
---|
| 525 | * arguments. Both the VSL and the GPT are updated in the remote cluster. |
---|
[611] | 526 | *********************************************************************************** |
---|
[313] | 527 | * @ cxy : server cluster identifier. |
---|
[641] | 528 | * @ pid : [in] process identifier. |
---|
| 529 | * @ base : [in] vseg base. |
---|
| 530 | * @ new_base : [in] new vseg base. |
---|
[640] | 531 | * @ new_size : [in] new vseg size. |
---|
[313] | 532 | **********************************************************************************/ |
---|
[640] | 533 | void rpc_vmm_resize_vseg_client( cxy_t cxy, |
---|
[641] | 534 | pid_t pid, |
---|
| 535 | intptr_t base, |
---|
[640] | 536 | intptr_t new_base, |
---|
| 537 | intptr_t new_size ); |
---|
[601] | 538 | |
---|
[640] | 539 | void rpc_vmm_resize_vseg_server( xptr_t xp ); |
---|
| 540 | |
---|
[601] | 541 | /*********************************************************************************** |
---|
[641] | 542 | * [26] The RPC_VMM_REMOVE_VSEG allows a client thread to request a remote cluster |
---|
| 543 | * to delete a vseg identified by the <vaddr> argument in a process descriptor |
---|
| 544 | * identified by the <pid> argument. |
---|
| 545 | * Both the VSL and the GPT are updated in the remote cluster. |
---|
[611] | 546 | *********************************************************************************** |
---|
[641] | 547 | * @ cxy : server cluster identifier. |
---|
| 548 | * @ pid : [in] process identifier. |
---|
| 549 | * @ base : [in] vseg base. |
---|
[601] | 550 | **********************************************************************************/ |
---|
[641] | 551 | void rpc_vmm_remove_vseg_client( cxy_t cxy, |
---|
| 552 | pid_t pid, |
---|
| 553 | intptr_t base ); |
---|
[611] | 554 | |
---|
[640] | 555 | void rpc_vmm_remove_vseg_server( xptr_t xp ); |
---|
[1] | 556 | |
---|
[407] | 557 | /*********************************************************************************** |
---|
[601] | 558 | * [27] The RPC_VMM_CREATE_VSEG allows a client thread to request the remote |
---|
[407] | 559 | * reference cluster of a given process to allocate and register in the reference |
---|
| 560 | * process VMM a new vseg descriptor. |
---|
| 561 | * On the server side, this RPC uses the vmm_create_vseg() function, and returns |
---|
| 562 | * to the client the local pointer on the created vseg descriptor. |
---|
| 563 | *********************************************************************************** |
---|
| 564 | * @ cxy : server cluster identifier. |
---|
| 565 | * @ process : [in] local pointer on process descriptor in server. |
---|
| 566 | * @ type : [in] vseg type. |
---|
| 567 | * @ base : [in] base address (unused for dynamically allocated vsegs). |
---|
| 568 | * @ size : [in] number of bytes. |
---|
| 569 | * @ file_offset : [in] offset in file (for CODE, DATA, FILE types). |
---|
| 570 | * @ file_size : [in] can be smaller than size for DATA type. |
---|
| 571 | * @ mapper_xp : [in] extended pointer on mapper (for CODE, DATA, FILE types). |
---|
| 572 | * @ vseg_cxy : [in] target cluster for mapping (if not data type). |
---|
| 573 | * @ vseg : [out] local pointer on vseg descriptor / NULL if failure. |
---|
| 574 | **********************************************************************************/ |
---|
| 575 | void rpc_vmm_create_vseg_client( cxy_t cxy, |
---|
| 576 | struct process_s * process, |
---|
| 577 | vseg_type_t type, |
---|
| 578 | intptr_t base, |
---|
| 579 | uint32_t size, |
---|
| 580 | uint32_t file_offset, |
---|
| 581 | uint32_t file_size, |
---|
| 582 | xptr_t mapper_xp, |
---|
| 583 | cxy_t vseg_cxy, |
---|
| 584 | struct vseg_s ** vseg ); |
---|
| 585 | |
---|
| 586 | void rpc_vmm_create_vseg_server( xptr_t xp ); |
---|
| 587 | |
---|
| 588 | /*********************************************************************************** |
---|
[408] | 589 | * [28] The RPC_VMM_SET_COW allows a client thread to request the remote reference |
---|
| 590 | * cluster to set the COW flag and reset the WRITABLE flag of all GPT entries for |
---|
| 591 | * the DATA, MMAP and REMOTE vsegs of process identified by the <process> argument. |
---|
| 592 | |
---|
| 593 | * of a remote scheduler, identified by the <lid> argument. |
---|
| 594 | *********************************************************************************** |
---|
| 595 | * @ cxy : server cluster identifier. |
---|
| 596 | * @ process : [in] local pointer on reference process descriptor. |
---|
| 597 | **********************************************************************************/ |
---|
| 598 | void rpc_vmm_set_cow_client( cxy_t cxy, |
---|
| 599 | struct process_s * process ); |
---|
| 600 | |
---|
| 601 | void rpc_vmm_set_cow_server( xptr_t xp ); |
---|
| 602 | |
---|
[428] | 603 | /*********************************************************************************** |
---|
[640] | 604 | * [29] undefined |
---|
[428] | 605 | **********************************************************************************/ |
---|
[635] | 606 | |
---|
[428] | 607 | |
---|
[1] | 608 | #endif |
---|