source: trunk/kernel/kern/rpc.h @ 610

Last change on this file since 610 was 610, checked in by alain, 3 years ago

Fix several bugs in VFS to support the following
ksh commandis : cp, mv, rm, mkdir, cd, pwd

File size: 32.7 KB
Line 
1/*
2 * rpc.h - RPC (Remote Procedure Call) operations definition.
3 *
4 * Author  Alain Greiner (2016,2017,2018)
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
27#include <kernel_config.h>
28#include <hal_kernel_types.h>
29#include <hal_atomic.h>
30#include <bits.h>
31#include <vseg.h>
32#include <remote_fifo.h>
33
34/**** Forward declarations ****/
35
36struct process_s;
37struct page_s;
38struct vseg_s;
39struct exec_info_s;
40struct pthread_attr_s;
41struct remote_sem_s;
42struct fragment_s;
43struct vfs_inode_s;
44struct vfs_dentry_s;
45struct vfs_file_s;
46struct thread_s;
47struct mapper_s;
48
49
50/**********************************************************************************/
51/**************  structures for Remote Procedure Calls ****************************/
52/**********************************************************************************/
53
54/***********************************************************************************
55 * This enum defines all RPC indexes.
56 * It must be consistent with the rpc_server[] array defined in in the rpc.c file.
57 **********************************************************************************/
58
59typedef enum
60{
61    RPC_PMEM_GET_PAGES            = 0,
62    RPC_PMEM_RELEASE_PAGES        = 1,
63    RPC_UNDEFINED_2               = 2,     
64    RPC_PROCESS_MAKE_FORK         = 3,
65    RPC_UNDEFINED_4               = 4,
66    RPC_UNDEFINED_5               = 5,
67    RPC_THREAD_USER_CREATE        = 6,
68    RPC_THREAD_KERNEL_CREATE      = 7,
69    RPC_UNDEFINED_8               = 8,
70    RPC_PROCESS_SIGACTION         = 9,
71
72    RPC_VFS_INODE_CREATE          = 10,
73    RPC_VFS_INODE_DESTROY         = 11,
74    RPC_VFS_DENTRY_CREATE         = 12,
75    RPC_VFS_DENTRY_DESTROY        = 13,
76    RPC_VFS_FILE_CREATE           = 14,
77    RPC_VFS_FILE_DESTROY          = 15,
78    RPC_VFS_FS_CHILD_INIT         = 16,
79    RPC_VFS_FS_ADD_DENTRY         = 17,
80    RPC_VFS_FS_REMOVE_DENTRY      = 18,
81    RPC_VFS_INODE_LOAD_ALL_PAGES  = 19,
82
83    RPC_VMM_GET_VSEG              = 20,
84    RPC_VMM_GLOBAL_UPDATE_PTE     = 21,
85    RPC_KCM_ALLOC                 = 22,
86    RPC_KCM_FREE                  = 23,
87    RPC_UNDEFINED_24              = 24,
88    RPC_MAPPER_HANDLE_MISS        = 25,
89    RPC_UNDEFINED_26              = 26,
90    RPC_VMM_CREATE_VSEG           = 27,
91    RPC_VMM_SET_COW               = 28,
92    RPC_VMM_DISPLAY               = 29,
93
94    RPC_MAX_INDEX                 = 30,
95}
96rpc_index_t;
97
98/***********************************************************************************
99 * This defines the prototype of the rpc_server functions,
100 * defined by the rpc_server[] array in the rpc.c file.
101 **********************************************************************************/
102
103typedef  void (rpc_server_t) ( xptr_t xp );
104
105/***********************************************************************************
106 *  This structure defines the RPC descriptor
107 **********************************************************************************/
108
109typedef struct rpc_desc_s
110{
111        rpc_index_t         index;       /*! index of requested RPC service           */
112        volatile uint32_t   responses;   /*! number of expected responses             */
113    struct thread_s   * thread;      /*! local pointer on client thread           */
114    uint32_t            lid;         /*! index of core running the calling thread */ 
115    bool_t              blocking;    /*! blocking RPC when true                   */
116    uint64_t            args[10];    /*! input/output arguments buffer            */
117} 
118rpc_desc_t;
119
120/**********************************************************************************/
121/******* Generic functions supporting RPCs : client side **************************/
122/**********************************************************************************/
123
124/***********************************************************************************
125 * This function is executed by the client thread in the client cluster.
126 * It puts one RPC descriptor defined by the <desc> argument in the remote fifo
127 * defined by the <cxy> argument.  It sends an IPI to the server if fifo is empty.
128 * The RPC descriptor must be allocated in the caller's stack, and initialised by
129 * the caller. It exit with a Panic message if remote fifo is still full after
130 * (CONFIG_RPC_PUT_MAX_ITERATIONS) retries.
131 * - When the RPC <blocking> field is true, this function blocks and deschedule.
132 *   It returns only when the server acknowledges the RPC by writing in the RPC
133 *   "response" field, and unblocks the client.
134 * - When the <blocking> field is false, this function returns as soon as the RPC
135 *   has been registered in the FIFO, and the server thread must directly signal
136 *   completion to the client thread.
137 ***********************************************************************************
138 * @ cxy   : server cluster identifier
139 * @ desc  : local pointer on RPC descriptor in client cluster
140 **********************************************************************************/
141void rpc_send( cxy_t        cxy,   
142               rpc_desc_t * desc );
143
144
145
146/**********************************************************************************/
147/******* Generic functions supporting RPCs : server side **************************/
148/**********************************************************************************/
149
150/***********************************************************************************
151 * This function contains the infinite loop executed by a RPC server thread,
152 * to handle pending RPCs registered in the RPC fifo attached to a given core.
153 * In each iteration in this loop, it try to handle one RPC request:
154 * - it tries to take the RPC FIFO ownership,
155 * - it consumes one request when the FIFO is not empty,
156 * - it releases the FIFO ownership,
157 * - it execute the requested service,
158 * - it unblock and send an IPI to the client thread,
159 * - it suicides if the number of RPC threads for this core is to large,
160 * - it block on IDLE and deschedule otherwise. 
161 **********************************************************************************/
162void rpc_thread_func( void );
163
164/***********************************************************************************
165 * This function is executed in case of illegal RPC index.
166 **********************************************************************************/
167void __attribute__((noinline)) rpc_undefined( xptr_t xp __attribute__ ((unused)) );
168
169
170
171/**********************************************************************************/
172/******* Marshalling functions attached to the various RPCs ***********************/
173/**********************************************************************************/
174
175/***********************************************************************************
176 * [0] The RPC_PMEM_GET_PAGES allocates one or several pages in a remote cluster,
177 * and returns the local pointer on the page descriptor.
178 ***********************************************************************************
179 * @ cxy     : server cluster identifier
180 * @ order   : [in]  ln2( number of requested pages )
181 * @ page    : [out] local pointer on page descriptor / NULL if failure
182 **********************************************************************************/
183void rpc_pmem_get_pages_client( cxy_t             cxy,
184                                uint32_t          order,
185                                struct page_s  ** page );
186
187void rpc_pmem_get_pages_server( xptr_t xp );
188
189/***********************************************************************************
190 * [1] The RPC_PMEM_RELEASE_PAGES release one or several pages to a remote cluster.
191 ***********************************************************************************
192 * @ cxy     : server cluster identifier
193 * @ page    : [in] local pointer on page descriptor to release.
194 **********************************************************************************/
195void rpc_pmem_release_pages_client( cxy_t            cxy,
196                                    struct page_s  * page );
197
198void rpc_pmem_release_pages_server( xptr_t xp );
199
200/***********************************************************************************
201 * [2] undefined slot
202 **********************************************************************************/
203
204/***********************************************************************************
205 * [3] The RPC_PROCESS_MAKE_FORK creates a "child" process descriptor, and the
206 * associated "child" thread descriptor in a target remote cluster that can be
207 * any cluster.  The child process is initialized from informations found in the
208 * "parent" process descriptor (that must be the parent reference cluster),
209 * and from the "parent" thread descriptor that can be in any cluster.
210 ***********************************************************************************
211 * @ cxy              : server cluster identifier.
212 * @ ref_process_xp   : [in]  extended pointer on reference parent process.
213 * @ parent_thread_xp : [in]  extended pointer on parent thread.
214 * @ child_pid        : [out] child process identifier.
215 * @ child_thread_ptr : [out] local pointer on child thread.
216 * @ error            : [out]  error status (0 if success).
217 **********************************************************************************/
218void rpc_process_make_fork_client( cxy_t              cxy,
219                                   xptr_t             ref_process_xp,
220                                   xptr_t             parent_thread_xp,
221                                   pid_t            * child_pid,
222                                   struct thread_s ** child_thread_ptr,
223                                   error_t          * error );
224
225void rpc_process_make_fork_server( xptr_t xp );
226
227/***********************************************************************************
228 * [4] undefined slot
229 **********************************************************************************/
230
231/***********************************************************************************
232 * [5] undefined slot
233 **********************************************************************************/
234
235/***********************************************************************************
236 * [6] The RPC_THREAD_USER_CREATE creates an user thread in the server cluster,
237 * as specified by the arguments. It returns an extended pointer on the new
238 * thread descriptor in server cluster, and an error code.
239 * It is called by the sys_thread_create() system call.
240 ***********************************************************************************
241 * @ cxy       : server cluster identifier.
242 * @ attr      : [in]  local pointer on pthread_attr_t in client cluster.
243 * @ thread_xp : [out] buffer for thread extended pointer.
244 * @ error     : [out] error status (0 if success).
245 **********************************************************************************/
246void rpc_thread_user_create_client( cxy_t                   cxy,
247                                    pid_t                   pid,
248                                    void                  * start_func,
249                                    void                  * start_arg,
250                                    pthread_attr_t        * attr,
251                                    xptr_t                * thread_xp,
252                                    error_t               * error );
253
254void rpc_thread_user_create_server( xptr_t xp );
255
256/***********************************************************************************
257 * [7] The RPC_THREAD_KERNEL_CREATE creates a kernel thread in the server cluster,
258 * as specified by the type, func and args arguments. It returns the local pointer
259 * on the thread descriptor in server cluster and an error code.
260 * It is used by the dev_init() function to create the device server thread.
261 ***********************************************************************************
262 * @ cxy       : server cluster identifier.
263 * @ type      : [in]  type of kernel thread.
264 * @ func      : [in]  local pointer on thread function.
265 * @ args      : [in]  local pointer on function arguments.
266 * @ thread_xp : [out] pointer on buffer for thread extended pointer.
267 * @ error     : [out] error status (0 if success).
268 **********************************************************************************/
269void rpc_thread_kernel_create_client( cxy_t     cxy,
270                                      uint32_t  type,
271                                      void    * func,
272                                      void    * args,
273                                      xptr_t  * thread_xp,
274                                      error_t * error );
275
276void rpc_thread_kernel_create_server( xptr_t xp );
277
278/***********************************************************************************
279 * [8] undefined slot
280 **********************************************************************************/
281
282/***********************************************************************************
283 * [9] The RPC_PROCESS_SIGACTION allows a thread running in any cluster
284 * to request a cluster identified by the <cxy> argument (local or remote)
285 * to execute a given sigaction for a given cluster. The <action_type> and
286 * the <pid> arguments are defined in the shared RPC descriptor, that must be
287 * initialised by the client thread.
288 *
289 * WARNING : It is implemented as a NON BLOCKING multicast RPC, that can be sent
290 * in parallel to all process copies. The various RPC server threads atomically
291 * decrement the <response> field in the shared RPC descriptor.
292 * The last server thread unblock the client thread that blocked (after sending
293 * all RPC requests) in the process_sigaction() function.
294 ***********************************************************************************
295 * @ cxy     : server cluster identifier.
296 * @ rpc     : pointer on ishared RPC descriptor initialized by the client thread.
297 **********************************************************************************/
298void rpc_process_sigaction_client( cxy_t               cxy,
299                                   struct rpc_desc_s * rpc );
300                             
301void rpc_process_sigaction_server( xptr_t xp );
302
303/***********************************************************************************
304 * [10] The RPC_VFS_INODE_CREATE creates an inode and the associated mapper in a
305 * remote cluster. The parent dentry must have been previously created.
306 * It returns an extended pointer on the created inode.
307 ***********************************************************************************
308 * @ cxy        :  server cluster identifier.
309 * @ fs_type    : [in]  file system type.
310 * @ inode_type : [in]  file system type.
311 * @ attr       : [in]  inode attributes.
312 * @ rights     : [in]  access rights
313 * @ uid        : [in]  user ID
314 * @ gid        : [in]  group ID
315 * @ inode_xp   : [out] buffer for extended pointer on created inode.
316 * @ error      : [out] error status (0 if success).
317 **********************************************************************************/
318void rpc_vfs_inode_create_client( cxy_t      cxy,
319                                  uint32_t   fs_type,
320                                  uint32_t   inode_type,
321                                  uint32_t   attr,   
322                                  uint32_t   rights, 
323                                  uint32_t   uid,
324                                  uint32_t   gid,
325                                  xptr_t   * inode_xp,
326                                  error_t  * error );
327
328void rpc_vfs_inode_create_server( xptr_t xp );
329
330/***********************************************************************************
331 * [11] The RPC_VFS_INODE_DESTROY releases memory allocated for an inode descriptor
332 * and for the associated mapper in a remote cluster.
333 ***********************************************************************************
334 * @ cxy       :  server cluster identifier
335 * @ inode     : [in]  local pointer on inode.
336 **********************************************************************************/
337void rpc_vfs_inode_destroy_client( cxy_t                cxy,
338                                   struct vfs_inode_s * inode );
339
340void rpc_vfs_inode_destroy_server( xptr_t xp );
341
342/***********************************************************************************
343 * [12] The RPC_VFS_DENTRY_CREATE creates a dentry in a remote cluster.
344 * It returns an extended pointer on the created dentry.
345 ***********************************************************************************
346 * @ cxy        :  server cluster identifier
347 * @ type       : [in]  file system type.
348 * @ name       : [in]  directory entry name.
349 * @ dentry_xp  : [out] buffer for extended pointer on created dentry.
350 * @ error      : [out] error status (0 if success).
351 **********************************************************************************/
352void rpc_vfs_dentry_create_client( cxy_t                  cxy,
353                                   uint32_t               type,
354                                   char                 * name,   
355                                   xptr_t               * dentry_xp,
356                                   error_t              * error );
357
358void rpc_vfs_dentry_create_server( xptr_t xp );
359
360/***********************************************************************************
361 * [13] The RPC_VFS_DENTRY_DESTROY remove a denfry from the parent inode XHTAB,
362 * and releases memory allocated for the dentry descriptor in a remote cluster.
363 ***********************************************************************************
364 * @ cxy       :  server cluster identifier
365 * @ dentry     : [in]  local pointer on dentry.
366 **********************************************************************************/
367void rpc_vfs_dentry_destroy_client( cxy_t                 cxy,
368                                    struct vfs_dentry_s * dentry );
369
370void rpc_vfs_dentry_destroy_server( xptr_t xp );
371
372/***********************************************************************************
373 * [14] The RPC_VFS_FILE_CREATE creates a file descriptor in a remote cluster.
374 * It returns an extended pointer on the created file structure.
375 ***********************************************************************************
376 * @ cxy        :  server cluster identifier
377 * @ inode      : [in]  local pointer on parent inode.
378 * @ file_attr  : [in]  new file attributes.
379 * @ file_xp    : [out] buffer for extended pointer on created file.
380 * @ error      : [out] error status (0 if success).
381 **********************************************************************************/
382void rpc_vfs_file_create_client( cxy_t                  cxy,
383                                 struct vfs_inode_s   * inode,
384                                 uint32_t               file_attr,
385                                 xptr_t               * file_xp,
386                                 error_t              * error );
387
388void rpc_vfs_file_create_server( xptr_t xp );
389
390/***********************************************************************************
391 * [15] The RPC_VFS_FILE_DESTROY releases memory allocated for a file descriptor
392 * in a remote cluster.
393 ***********************************************************************************
394 * @ cxy       :  server cluster identifier
395 * @ file       : [in]  local pointer on file.
396 **********************************************************************************/
397void rpc_vfs_file_destroy_client( cxy_t               cxy,
398                                  struct vfs_file_s * file );
399
400void rpc_vfs_file_destroy_server( xptr_t xp );
401
402/***********************************************************************************
403 * [16] The RPC_VFS_FS_CHILD_INIT calls the vfs_fs_child_init_load_inode()
404 * function in a remote cluster containing a parent inode directory to scan the
405 * associated mapper, find a directory entry identified by its name, and update
406 * both the child inode and the dentry.
407 ***********************************************************************************
408 * @ cxy            : server cluster identifier
409 * @ parent_inode   : [in]  local pointer on parent inode.
410 * @ name           : [in]  local pointer on child name (in client cluster).
411 * @ child_inode_xp : [in]  extended pointer on child inode (in another cluster).
412 * @ error          : [out] error status (0 if success).
413 **********************************************************************************/
414void rpc_vfs_fs_child_init_client( cxy_t                cxy,
415                                   struct vfs_inode_s * parent_inode,
416                                   char               * name,
417                                   xptr_t               child_inode_xp,
418                                   error_t            * error );
419
420void rpc_vfs_fs_child_init_server( xptr_t xp );
421
422/***********************************************************************************
423 * [17] The RPC_VFS_FS_ADD_DENTRY calls the vfs_fs_add_dentry() function in a
424 * remote cluster containing a directory inode and mapper, to add a new dentry
425 * in the mapper of this directory.
426 ***********************************************************************************
427 * @ cxy            : server cluster identifier
428 * @ parent         : [in]  local pointer on directory inode.
429 * @ dentry         : [in]  local pointer on dentry.
430 * @ error          : [out] error status (0 if success).
431 **********************************************************************************/
432void rpc_vfs_fs_add_dentry_client( cxy_t,
433                                   struct vfs_inode_s  * parent,
434                                   struct vfs_dentry_s * dentry,
435                                   error_t             * error );
436
437void rpc_vfs_fs_add_dentry_server( xptr_t xp );
438
439/***********************************************************************************
440 * [18] The RPC_VFS_FS_REMOVE_DENTRY calls the vfs_fs_remove_dentry() function in a
441 * remote cluster containing a directory inode and mapper, to remove a dentry from
442 * the mapper of this directory.
443 ***********************************************************************************
444 * @ cxy            : server cluster identifier
445 * @ parent         : [in]  local pointer on directory inode.
446 * @ dentry         : [in]  local pointer on dentry.
447 * @ error          : [out] error status (0 if success).
448 **********************************************************************************/
449void rpc_vfs_fs_remove_dentry_client( cxy_t,
450                                      struct vfs_inode_s  * parent,
451                                      struct vfs_dentry_s * dentry,
452                                      error_t             * error );
453
454void rpc_vfs_fs_remove_dentry_server( xptr_t xp );
455
456/***********************************************************************************
457 * [19] The RPC_VFS_INODE_LOAD_ALL_PAGES calls the vfs_inode_load_all_pages()
458 * function a remote cluster containing an inode to load all pages in the
459 * associated mapper. 
460 ***********************************************************************************
461 * @ cxy     : server cluster identifier
462 * @ inode   : [in]  local pointer on inode in server cluster.
463 * @ error   : [out] error status (0 if success).
464 **********************************************************************************/
465void rpc_vfs_inode_load_all_pages_client( cxy_t                cxy,
466                                          struct vfs_inode_s * inode,
467                                          error_t            * error );
468
469void rpc_vfs_inode_load_all_pages_server( xptr_t xp );
470
471/***********************************************************************************
472 * [20] The RPC_VMM_GET_VSEG returns an extended pointer
473 * on the vseg containing a given virtual address in a given process.
474 * The server cluster is supposed to be the reference cluster.
475 * It returns a non zero error value if no vseg has been founded.
476 ***********************************************************************************
477 * @ cxy     : server cluster identifier.
478 * @ process : [in]   pointer on process descriptor in server cluster.
479 * @ vaddr   : [in]   virtual address to be searched.
480 * @ vseg_xp : [out]  buffer for extended pointer on vseg in client cluster.
481 * @ error   : [out] local pointer on buffer for error code (in client cluster).
482 **********************************************************************************/
483void rpc_vmm_get_vseg_client( cxy_t              cxy,
484                              struct process_s * process,
485                              intptr_t           vaddr,
486                              xptr_t           * vseg_xp,
487                              error_t          * error );
488
489void rpc_vmm_get_vseg_server( xptr_t xp );
490
491/***********************************************************************************
492 * [21] The RPC_VMM_GLOBAL_UPDATE_PTE can be used by a thread that is not running
493 * in reference cluster, to ask the reference cluster to update a specific entry,
494 * identified by the <vpn> argument in all GPT copies of a process identified by
495 * the <process> argument, using the values defined by <attr> and <ppn> arguments.
496 * The server cluster is supposed to be the reference cluster.
497 * It does not return any error code as the called function vmm_global_update_pte()
498 * cannot fail.
499 ***********************************************************************************
500 * @ cxy     : server cluster identifier.
501 * @ process : [in]  pointer on process descriptor in server cluster.
502 * @ vpn     : [in]  virtual address to be searched.
503 * @ attr    : [in]  PTE attributes.
504 * @ ppn     : [it]  PTE PPN.
505 **********************************************************************************/
506void rpc_vmm_global_update_pte_client( cxy_t              cxy,
507                                       struct process_s * process,
508                                       vpn_t              vpn,
509                                       uint32_t           attr,
510                                       ppn_t              ppn );
511
512void rpc_vmm_global_update_pte_server( xptr_t xp );
513
514/***********************************************************************************
515 * [22] The RPC_KCM_ALLOC allocates memory from a given KCM in a remote cluster,
516 * and returns an extended pointer on the allocated object.
517  It returns XPTR_NULL if physical memory cannot be allocated.
518 ***********************************************************************************
519 * @ cxy       : server cluster identifier.
520 * @ kmem_type : [in]  KCM object type (as defined in kmem.h).
521 * @ buf_xp    : [out] buffer for extended pointer on allocated buffer.
522 **********************************************************************************/
523void rpc_kcm_alloc_client( cxy_t      cxy,
524                           uint32_t   kmem_type,
525                           xptr_t   * buf_xp ); 
526
527void rpc_kcm_alloc_server( xptr_t xp );
528
529/***********************************************************************************
530 * [23] The RPC_KCM_FREE releases memory allocated for a KCM object of a given type,
531 * in a remote cluster.
532 ***********************************************************************************
533 * @ cxy       : server cluster identifier.
534 * @ buf       : [in] local pointer on allocated buffer.
535 * @ kmem_type : [in]  KCM object type (as defined in kmem.h).
536 **********************************************************************************/
537void rpc_kcm_free_client( cxy_t     cxy,
538                          void    * buf,
539                          uint32_t  kmem_type );
540
541void rpc_kcm_free_server( xptr_t xp );
542
543/***********************************************************************************
544 * [24] undefined slot
545 **********************************************************************************/
546
547/***********************************************************************************
548 * [25] The RPC__MAPPER_HANDLE_MISS allows a client thread to request a remote
549 * mapper to load a missing page from the IOC device.
550 * On the server side, this RPC call the mapper_handle_miss() function and return
551 * an extended pointer on the allocated page descriptor and an error status.
552 * @ cxy         : server cluster identifier.
553 * @ mapper      : [in]  local pointer on mapper.
554 * @ page_id     : [in]  missing page index in mapper
555 * @ buffer      : [in]  user space pointer / kernel extended pointer
556 * @ page_xp     : [out] pointer on buffer for extended pointer on page descriptor.
557 * @ error       : [out] error status (0 if success).
558 **********************************************************************************/
559void rpc_mapper_handle_miss_client( cxy_t             cxy,
560                                    struct mapper_s * mapper,
561                                    uint32_t          page_id,
562                                    xptr_t          * page_xp,
563                                    error_t         * error );
564 
565void rpc_mapper_handle_miss_server( xptr_t xp );
566
567/***********************************************************************************
568 * [26] undefined slot
569 **********************************************************************************/
570
571/***********************************************************************************
572 * [27] The RPC_VMM_CREATE_VSEG allows a client thread to request the remote
573 * reference cluster of a given process to allocate and register in the reference
574 * process VMM a new vseg descriptor.
575 * On the server side, this RPC uses the vmm_create_vseg() function, and returns
576 * to the client the local pointer on the created vseg descriptor.
577 ***********************************************************************************
578 * @ cxy         : server cluster identifier.
579 * @ process     : [in]  local pointer on process descriptor in server.
580 * @ type        : [in]  vseg type.
581 * @ base        : [in]  base address (unused for dynamically allocated vsegs).
582 * @ size        : [in]  number of bytes.
583 * @ file_offset : [in]  offset in file (for CODE, DATA, FILE types).
584 * @ file_size   : [in]  can be smaller than size for DATA type.
585 * @ mapper_xp   : [in]  extended pointer on mapper (for CODE, DATA, FILE types).
586 * @ vseg_cxy    : [in]  target cluster for mapping (if not data type).
587 * @ vseg        : [out] local pointer on vseg descriptor / NULL if failure.
588 **********************************************************************************/
589void rpc_vmm_create_vseg_client( cxy_t              cxy,
590                                 struct process_s * process,
591                                 vseg_type_t        type,
592                                 intptr_t           base,
593                                 uint32_t           size,
594                                 uint32_t           file_offset,
595                                 uint32_t           file_size,
596                                 xptr_t             mapper_xp,
597                                 cxy_t              vseg_cxy,
598                                 struct vseg_s   ** vseg );
599
600void rpc_vmm_create_vseg_server( xptr_t xp );
601
602/***********************************************************************************
603 * [28] The RPC_VMM_SET_COW allows a client thread to request the remote reference
604 * cluster to set the COW flag and reset the WRITABLE flag of all GPT entries for
605 * the DATA, MMAP and REMOTE vsegs of process identified by the <process> argument.
606
607 * of a remote scheduler, identified by the <lid> argument.
608 ***********************************************************************************
609 * @ cxy         : server cluster identifier.
610 * @ process     : [in]  local pointer on reference process descriptor.
611 **********************************************************************************/
612void rpc_vmm_set_cow_client( cxy_t              cxy,
613                             struct process_s * process );
614
615void rpc_vmm_set_cow_server( xptr_t xp );
616
617/***********************************************************************************
618 * [29] The RPC_VMM_DISPLAY allows any client thread to display the VMM state
619 * of a remote reference process identified by the <cxy> and <process> arguments.
620 * The type of display is defined by the <detailed> boolean argument.
621 ***********************************************************************************
622 * @ cxy         : server cluster identifier.
623 * @ process     : [in]  local pointer on reference process descriptor.
624 * @ detailed    : [in]  detailed display if true.
625 **********************************************************************************/
626void rpc_vmm_display_client( cxy_t              cxy,
627                             struct process_s * process,
628                             bool_t             detailed );
629
630void rpc_vmm_display_server( xptr_t xp );
631
632
633#endif
Note: See TracBrowser for help on using the repository browser.