Changeset 614 for trunk/kernel/kern


Ignore:
Timestamp:
Jan 15, 2019, 1:59:32 PM (6 years ago)
Author:
alain
Message:

1) introduce a dev_ioc_sync_write() function in IOC API,

to improve the DEVFS synchronous update.

2) fix a big bug in both the user_dir_create() and user_dir_destroy()

functions: add an extended pointer on the reference client process
in the function's arguments.

Location:
trunk/kernel/kern
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/kernel_init.c

    r612 r614  
    11131113        vfs_root_inode_xp = XPTR_NULL;
    11141114
    1115         // File System must be FATFS in this implementation,
    1116         // but other File System can be introduced here
     1115        // Only FATFS is supported yet,
     1116        // other File System can be introduced here
    11171117        if( CONFIG_VFS_ROOT_IS_FATFS )
    11181118        {
     
    11721172        }
    11731173
     1174        // create the <.> and <..> dentries in VFS root directory
     1175        // the VFS root parent inode is the VFS root inode itself
     1176        vfs_add_special_dentries( vfs_root_inode_xp,
     1177                                  vfs_root_inode_xp );
     1178
    11741179        // register VFS root inode in process_zero descriptor of cluster 0
    11751180        process_zero.vfs_root_xp = vfs_root_inode_xp;
     
    12551260#if DEBUG_KERNEL_INIT
    12561261if( (core_lid ==  0) & (local_cxy == 1) )
    1257 printk("\n[%s] : exit barrier 4 : VFS root (%x,%x) in cluster 1 / cycle %d\n",
     1262printk("\n[%s] : exit barrier 5 : VFS root (%x,%x) in cluster 1 / cycle %d\n",
    12581263__FUNCTION__, GET_CXY(process_zero.vfs_root_xp),
    12591264GET_PTR(process_zero.vfs_root_xp), (uint32_t)hal_get_cycles() );
  • trunk/kernel/kern/rpc.c

    r612 r614  
    5454    &rpc_undefined,                        // 2    unused slot
    5555    &rpc_process_make_fork_server,         // 3
    56     &rpc_undefined,                        // 4    unused slot
    57     &rpc_undefined,                        // 5    unused slot
     56    &rpc_user_dir_create_server,           // 4
     57    &rpc_user_dir_destroy_server,          // 5
    5858    &rpc_thread_user_create_server,        // 6
    5959    &rpc_thread_kernel_create_server,      // 7
     
    9090    "undefined",                 // 2
    9191    "PROCESS_MAKE_FORK",         // 3
    92     "undefined",                 // 4
    93     "undefined",                 // 5
     92    "USER_DIR_CREATE",           // 4
     93    "USER_DIR_DESTROY",          // 5
    9494    "THREAD_USER_CREATE",        // 6
    9595    "THREAD_KERNEL_CREATE",      // 7
     
    657657void rpc_user_dir_create_client( cxy_t          cxy,
    658658                                 vfs_inode_t *  inode,
     659                                 xptr_t         ref_xp,
    659660                                 user_dir_t  ** dir )
    660661{
     
    677678    // set input arguments in RPC descriptor
    678679    rpc.args[0] = (uint64_t)(intptr_t)inode;
     680    rpc.args[1] = (uint64_t)ref_xp;
    679681
    680682    // register RPC request in remote RPC fifo
     
    682684
    683685    // get output argument from RPC descriptor
    684     *dir = (user_dir_t *)(intptr_t)rpc.args[1];
     686    *dir = (user_dir_t *)(intptr_t)rpc.args[2];
    685687
    686688#if DEBUG_RPC_USER_DIR_CREATE
     
    704706
    705707    vfs_inode_t * inode;          // pointer on inode in server cluster
     708    xptr_t        ref_xp;         // extended pointer on reference user process
    706709    user_dir_t  * dir;            // pointer on user_dir structure in server cluster
    707710
     
    711714
    712715    // get input argument from RPC descriptor
    713     inode = (vfs_inode_t *)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
     716    inode  = (vfs_inode_t *)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
     717    ref_xp = (xptr_t)                 hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
    714718
    715719    // call kernel function
    716     dir = user_dir_create( inode );
     720    dir = user_dir_create( inode , ref_xp );
    717721
    718722    // set output argument into RPC descriptor
    719     hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (intptr_t)dir );
     723    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (intptr_t)dir );
    720724
    721725#if DEBUG_RPC_USER_DIR_CREATE
     
    733737////////////////////////////////////////////////////
    734738void rpc_user_dir_destroy_client( cxy_t         cxy,
    735                                   user_dir_t  * dir )
     739                                  user_dir_t  * dir,
     740                                  xptr_t        ref_xp )
    736741{
    737742#if DEBUG_RPC_USER_DIR_DESTROY
     
    753758    // set input arguments in RPC descriptor
    754759    rpc.args[0] = (uint64_t)(intptr_t)dir;
     760    rpc.args[1] = (uint64_t)ref_xp;
    755761
    756762    // register RPC request in remote RPC fifo
     
    777783
    778784    user_dir_t * dir;            // pointer on user_dir structure in server cluster
     785    xptr_t       ref_xp;         // extended pointer on reference process
    779786
    780787    // get client cluster identifier and pointer on RPC descriptor
     
    783790
    784791    // get input argument from RPC descriptor
    785     dir = (user_dir_t *)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
     792    dir    = (user_dir_t *)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
     793    ref_xp = (xptr_t)                hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
    786794
    787795    // call kernel function
    788     user_dir_destroy( dir );
     796    user_dir_destroy( dir , ref_xp );
    789797
    790798#if DEBUG_RPC_USER_DIR_DESTROY
  • trunk/kernel/kern/rpc.h

    r612 r614  
    229229 * [4] The RPC_USER_DIR_CREATE allows a client thread to create an user_dir_t
    230230 * structure and the associated array of dirents in a remote cluster containing
    231  * the target directory inode. It is called by the sys_opendir() function.
     231 * the target directory <inode>. It creates an ANON vseg in the user reference
     232 * process VMM identified by the <ref_xp>. This reference cluster cluster can be
     233 * different from both the client and server clusters.
     234 * It is called by the sys_opendir() function.
    232235 ***********************************************************************************
    233236 * @ cxy        : server cluster identifier.
    234237 * @ inode      : [in]   local pointer on inode in server cluster.
     238 * @ ref_xp     : [in]   extended pointer on user reference process descriptor.
    235239 * @ dir        : [out]  local pointer on created user_dir structure.
    236240 **********************************************************************************/
    237241void rpc_user_dir_create_client( cxy_t                 cxy,
    238242                                 struct vfs_inode_s  * inode,
     243                                 xptr_t                ref_xp,
    239244                                 struct user_dir_s  ** dir );
    240245
     
    248253 * @ cxy        : server cluster identifier.
    249254 * @ dir        : [in]  local pointer on created user_dir structure.
     255 * @ ref_xp     : [in]   extended pointer on user reference process descriptor.
    250256 **********************************************************************************/
    251257void rpc_user_dir_destroy_client( cxy_t               cxy,
    252                                   struct user_dir_s * dir );
     258                                  struct user_dir_s * dir,
     259                                  xptr_t              ref_xp );
    253260
    254261void rpc_user_dir_destroy_server( xptr_t xp );
  • trunk/kernel/kern/scheduler.c

    r610 r614  
    487487 
    488488#if (DEBUG_SCHED_YIELD & 0x1)
    489 if( sched->trace ) sched_display( lid );
     489if( sched->trace )
     490sched_display( lid );
    490491#endif
    491492
    492 // This assert should never be false, as this check must be
    493 // done before by any function that can possibly deschedule...
     493// This assert should never be false, as this check has been
     494// done before, by any function that can possibly deschedule...
    494495assert( (current->busylocks == 0),
    495496"unexpected descheduling of thread holding %d busylocks = %d\n", current->busylocks );
Note: See TracChangeset for help on using the changeset viewer.