Ignore:
Timestamp:
Dec 5, 2017, 4:20:07 PM (6 years ago)
Author:
alain
Message:

Fix several bugs in the fork() syscall.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/rpc.h

    r407 r408  
    6060{
    6161    RPC_PMEM_GET_PAGES         = 0,
    62     RPC_PROCESS_PID_ALLOC      = 1,
    63     RPC_PROCESS_EXEC           = 2,
     62    RPC_PROCESS_MAKE_EXEC      = 1,     
     63    RPC_PROCESS_MAKE_FORK      = 2,
    6464    RPC_PROCESS_KILL           = 3,
    6565    RPC_THREAD_USER_CREATE     = 4,
     
    8585    RPC_VMM_CREATE_VSEG        = 26,
    8686    RPC_SCHED_DISPLAY          = 27,
    87 
     87    RPC_VMM_SET_COW            = 28,
    8888    RPC_MAX_INDEX              = 30,
    8989}
     
    186186
    187187/***********************************************************************************
    188  * [1] The RPC_PROCESS_PID_ALLOC allocates one new PID in a remote cluster, registers
    189  * the new process in the remote cluster, and returns the PID, and an error code.
     188 * [1] The RPC_PROCESS_MAKE_EXEC creates a new process descriptor, from an existing
     189 * process descriptor in a remote server cluster. This server cluster must be
     190 * the owner cluster for the existing process. The new process descriptor is
     191 * initialized from informations found in the <exec_info> structure.
     192 * A new main thread descriptor is created in the server cluster.
     193 * All copies of the old process descriptor and all old threads are destroyed.
    190194 ***********************************************************************************
    191195 * @ cxy     : server cluster identifier.
    192  * @ process : [in]  local pointer on process descriptor in client cluster.
     196 * @ process : [in]  local pointer on the exec_info structure in client cluster.
    193197 * @ error   : [out] error status (0 if success).
    194  * @ pid     : [out] new process identifier.
    195  **********************************************************************************/
    196 void rpc_process_pid_alloc_client( cxy_t              cxy,
    197                                    struct process_s * process,
    198                                    error_t          * error,
    199                                    pid_t            * pid );
    200 
    201 void rpc_process_pid_alloc_server( xptr_t xp );
    202 
    203 /***********************************************************************************
    204  * [2] The RPC_PROCESS_EXEC creates a process descriptor copy, in a remote cluster
    205  * and initializes if from information found in the reference process descriptor.
    206  * This remote cluster becomes the new reference cluster.
    207  ***********************************************************************************
    208  * @ cxy     : server cluster identifier.
    209  * @ info    : [in]   pointer on local exec_info structure.
    210  * @ error   : [out]  error status (0 if success).
    211  **********************************************************************************/
    212 void rpc_process_exec_client( cxy_t                cxy,
    213                               struct exec_info_s * info,
    214                               error_t            * error );
    215 
    216 void rpc_process_exec_server( xptr_t xp );
     198 **********************************************************************************/
     199void rpc_process_make_exec_client( cxy_t                cxy,
     200                                   struct exec_info_s * info,
     201                                   error_t            * error );
     202
     203void rpc_process_make_exec_server( xptr_t xp );
     204
     205/***********************************************************************************
     206 * [2] The RPC_PROCESS_MAKE_FORK creates a "child" process descriptor, and the
     207 * associated "child" thread descriptor in a target remote cluster that can be
     208 * any cluster.  The child process is initialized from informations found in the
     209 * "parent" process descriptor (that must be the parent reference cluster),
     210 * and from the "parent" thread descriptor that can be in any cluster.
     211 ***********************************************************************************
     212 * @ cxy              : server cluster identifier.
     213 * @ ref_process_xp   : [in]  extended pointer on reference parent process.
     214 * @ parent_thread_xp : [in]  extended pointer on parent thread.
     215 * @ child_pid        : [out] child process identifier.
     216 * @ child_thread_ptr : [out] local pointer on child thread.
     217 * @ error            : [out]  error status (0 if success).
     218 **********************************************************************************/
     219void rpc_process_make_fork_client( cxy_t              cxy,
     220                                   xptr_t             ref_process_xp,
     221                                   xptr_t             parent_thread_xp,
     222                                   pid_t            * child_pid,
     223                                   struct thread_s ** child_thread_ptr,
     224                                   error_t          * error );
     225
     226void rpc_process_make_fork_server( xptr_t xp );
    217227
    218228/***********************************************************************************
     
    613623void rpc_sched_display_server( xptr_t xp );
    614624
     625/***********************************************************************************
     626 * [28] The RPC_VMM_SET_COW allows a client thread to request the remote reference
     627 * cluster to set the COW flag and reset the WRITABLE flag of all GPT entries for
     628 * the DATA, MMAP and REMOTE vsegs of process identified by the <process> argument.
     629
     630 * of a remote scheduler, identified by the <lid> argument.
     631 ***********************************************************************************
     632 * @ cxy         : server cluster identifier.
     633 * @ process     : [in]  local pointer on reference process descriptor.
     634 **********************************************************************************/
     635void rpc_vmm_set_cow_client( cxy_t              cxy,
     636                             struct process_s * process );
     637
     638void rpc_vmm_set_cow_server( xptr_t xp );
     639
    615640#endif
Note: See TracChangeset for help on using the changeset viewer.