Ignore:
Timestamp:
Dec 22, 2017, 1:16:59 PM (6 years ago)
Author:
alain
Message:

Few bugs.

File:
1 edited

Legend:

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

    r409 r415  
    125125    uint32_t    stdout_id;
    126126    uint32_t    stderr_id;
     127    error_t     error;
    127128
    128129process_dmsg("\n[DBG] %s : core[%x,%d] enters for process %x / ppid = %x\n",
     
    139140
    140141    // initialize vmm as empty
    141     vmm_init( process );
     142    error = vmm_init( process );
     143    assert( (error == 0) , __FUNCTION__ , "cannot initialize VMM\n" );
     144 
    142145
    143146process_dmsg("\n[DBG] %s : core[%x,%d] / vmm empty for process %x\n",
     
    259262                           xptr_t      reference_process_xp )
    260263{
     264    error_t error;
     265
    261266    // get reference process cluster and local pointer
    262267    cxy_t       ref_cxy = GET_CXY( reference_process_xp );
     
    272277
    273278    // reset local process vmm
    274     vmm_init( local_process );
     279    error = vmm_init( local_process );
     280    assert( (error == 0) , __FUNCTION__ , "cannot initialize VMM\n");
    275281
    276282    // reset process file descriptors array
     
    309315    // register new process descriptor in owner cluster manager copies_list
    310316    cluster_process_copies_link( local_process );
    311 
    312     // initialize signal manager TODO [AG]
    313317
    314318        hal_fence();
     
    397401    process_t        * process_ptr;       // local pointer on process copy
    398402
    399 signal_dmsg("\n[DBG] %s : enter for signal %s to process %x in cluster %x\n",
     403sigaction_dmsg("\n[DBG] %s : enter for signal %s to process %x in cluster %x\n",
    400404__FUNCTION__ , process_action_str( action_type ) , process , local_cxy );
    401405
     
    432436        process_ptr = (process_t *)GET_PTR( process_xp );
    433437
    434 printk("\n    @@@ %s : process = %x / pid = %x / ppid = %x\n",
     438sigaction_dmsg("\n[DBG] %s : process = %x / pid = %x / ppid = %x\n",
    435439__FUNCTION__ , process_ptr , process_ptr->pid , process_ptr->ppid );
    436440
     
    449453    sched_yield("BLOCKED on RPC");
    450454
    451 signal_dmsg("\n[DBG] %s : exit for signal %s to process %x in cluster %x\n",
     455sigaction_dmsg("\n[DBG] %s : exit for signal %s to process %x in cluster %x\n",
    452456__FUNCTION__ , process_action_str( action_type ) , process , local_cxy );
    453457
     
    471475    killer = CURRENT_THREAD;
    472476
    473 signal_dmsg("\n[DBG] %s : enter for process %x in cluster %x\n",
     477sigaction_dmsg("\n[DBG] %s : enter for process %x in cluster %x\n",
    474478__FUNCTION__ , process->pid , local_cxy );
    475479
     
    532536    }
    533537
    534 signal_dmsg("\n[DBG] %s : exit for process %x in cluster %x / %d threads blocked\n",
     538sigaction_dmsg("\n[DBG] %s : exit for process %x in cluster %x / %d threads blocked\n",
    535539__FUNCTION__ , process->pid , local_cxy , count );
    536540
     
    553557    killer = CURRENT_THREAD;
    554558
    555 signal_dmsg("\n[DBG] %s : enter for process %x in cluster %x\n",
     559sigaction_dmsg("\n[DBG] %s : enter for process %x in cluster %x\n",
    556560__FUNCTION__ , process->pid , local_cxy );
    557561
     
    586590    }
    587591
    588 signal_dmsg("\n[DBG] %s : exit for process %x in cluster %x / %d threads blocked\n",
     592sigaction_dmsg("\n[DBG] %s : exit for process %x in cluster %x / %d threads blocked\n",
    589593__FUNCTION__ , process->pid , local_cxy , req_count );
    590594
     
    607611    pid = process->pid;
    608612
    609 signal_dmsg("\n[DBG] %s : enter for process %x in cluster %x at cycle %d\n",
     613sigaction_dmsg("\n[DBG] %s : enter for process %x in cluster %x at cycle %d\n",
    610614__FUNCTION__ , pid , local_cxy , (uint32_t)hal_get_cycles() );
    611615
     
    648652    }
    649653
    650 signal_dmsg("\n[DBG] %s : exit for process %x in cluster %x at cycle %d\n",
     654sigaction_dmsg("\n[DBG] %s : exit for process %x in cluster %x at cycle %d\n",
    651655__FUNCTION__ , pid , local_cxy , (uint32_t)hal_get_cycles() );
    652656
     
    11811185__FUNCTION__, local_cxy, CURRENT_THREAD->core->lid );
    11821186
    1183     // re-initialize VMM
    1184     vmm_init( process );
     1187    // initialize VMM
     1188    error = vmm_init( process );
     1189        {
     1190                printk("\n[ERROR] in %s : cannot initialize VMM for process %x / path = %s\n",
     1191                __FUNCTION__, pid , path );
     1192        process_destroy( process );
     1193        return -1;
     1194        }
     1195
     1196    if( error )
    11851197
    11861198    // register "code" and "data" vsegs as well as entry-point and vfs_bin_xp
    11871199    // in VMM, using information contained in the elf file.
    1188         if( elf_load_process( path , process ) )
     1200        error = elf_load_process( path , process );
     1201
     1202    if( error )
    11891203        {
    11901204                printk("\n[ERROR] in %s : failed to access .elf file for process %x / path = %s\n",
Note: See TracChangeset for help on using the changeset viewer.