Ignore:
Timestamp:
Jan 4, 2018, 10:05:47 AM (4 years ago)
Author:
alain
Message:

Improve sys_exec.

File:
1 edited

Legend:

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

    r409 r416  
    228228}
    229229
    230 ////////////////////////////////////////////////
    231 error_t cluster_pid_alloc( xptr_t    process_xp,
    232                            pid_t   * pid )
    233 {
    234     error_t     error;
     230///////////////////////////////////////////////
     231error_t cluster_pid_alloc( process_t * process,
     232                           pid_t     * pid )
     233{
    235234    lpid_t      lpid;
    236235    bool_t      found;
     
    255254    {
    256255        // register process in pref_tbl[]
    257         pm->pref_tbl[lpid] = process_xp;
     256        pm->pref_tbl[lpid] = XPTR( local_cxy , process );
    258257        pm->pref_nr++;
    259258
     
    261260        *pid = PID( local_cxy , lpid );
    262261
    263         error = 0;
     262        // release the processs_manager lock
     263        spinlock_unlock( &pm->pref_lock );
     264
     265        return 0;
    264266    }
    265267    else
    266268    {
    267         error = EAGAIN;
    268     }
    269 
    270     // release the processs_manager lock
    271     spinlock_unlock( &pm->pref_lock );
    272 
    273     return error;
     269        // release the processs_manager lock
     270        spinlock_unlock( &pm->pref_lock );
     271
     272        return -1;
     273    }
    274274
    275275} // end cluster_pid_alloc()
     
    286286    assert( (lpid < CONFIG_MAX_PROCESS_PER_CLUSTER) && (owner_cxy == local_cxy) ,
    287287    __FUNCTION__ , "illegal PID" );
    288 
    289     // check number of copies
    290     assert( (pm->copies_nr[lpid] == 0) ,
    291     __FUNCTION__ , "number of copies must be 0" ); 
    292288
    293289    // get the process manager lock
Note: See TracChangeset for help on using the changeset viewer.