Changeset 441 for trunk/user


Ignore:
Timestamp:
May 9, 2018, 3:13:56 PM (6 years ago)
Author:
alain
Message:

Fix a bug in rpc_vmm_get_pte_client() function (bad RPC index).

Location:
trunk/user
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/user/init/init.c

    r440 r441  
    1818#include <pthread.h>
    1919
    20 #define DEBUG_INIT 1
     20#define DEBUG_INIT_PROCESS 1
    2121
    2222// TODO make the cxy computation portable [AG]
     
    7676    }
    7777 
    78 #if DEBUG_INIT
     78#if DEBUG_INIT_PROCESS
    7979
    8080    unsigned int  x_size;        // number of clusters in a row
     
    160160        } // end KSH kill handling
    161161
    162 #if( DEBUG_INIT )
     162#if DEBUG_INIT_PROCESS
    163163
    164164        // INIT displays processes and threads in all clusters
  • trunk/user/ksh/ksh.c

    r440 r441  
    395395        int                  ret_exec;           // return value from exec
    396396    unsigned int         ksh_pid;            // KSH process PID
    397     unsigned int         new_pid;            // new process PID
    398     unsigned int         rcv_pid;            // terminating process PID
    399397        char               * pathname;           // path to .elf file
    400398    unsigned int         background;         // background execution if non zero
     
    425423    else if (ret_fork == 0)      // it is the CHILD process
    426424    {
    427         // give back to KSH terminal ownership if required
    428         if( background ) fg( ksh_pid );
    429 
    430425        // CHILD process exec NEW process
    431426        ret_exec = exec( pathname , NULL , NULL );
    432427
     428        // this is only executed in case of exec failure
    433429        if( ret_exec )
    434430        {
    435             printf("  error: new process unable to exec <%s>\n", pathname );
    436             return;
     431            printf("  error: child process unable to exec <%s>\n", pathname );
     432            exit( 0 );
    437433        }   
    438434        }
    439435    else                        // it is the parent KSH : ret_fork is the new process PID
    440436    {
    441         new_pid = ret_fork;
    442 
    443         // wait new process completion
    444         rcv_pid = wait( &status );
    445 
    446         if( rcv_pid == new_pid )
    447         {
    448             printf("\n\n   %s normal termination / status = %x\n\n",
    449             pathname , (status &0xFF) );
    450             return;
    451         }
    452         else
    453         {
    454             printf("\n\n   %s abnormal termination / status = %x\n\n",
    455             pathname , (status &0xFF) );
    456             return;
    457         }
     437        // give back terminal ownership to KSH if new process created in background /
     438        // wait new process completion before returning to command interpreter otherwise
     439        if( background )   fg( ksh_pid );
     440        else               wait( &status );
     441
     442        // return to command interpreter
     443        return;
    458444    }
    459445}   // end cmd_load
     
    758744                                                printf("# ");
    759745                                        }
     746                    else
     747                    {
     748                        printf("\n# ");
     749                    }
    760750                                }
    761751                                else if (c == '\t')     // tabulation => do nothing
  • trunk/user/sort/sort.c

    r440 r441  
    156156    unsigned int  main_uid   = ptr->main_uid;
    157157
    158 printf("\n### core[%x,%d] enter sort : threads %d / thread_uid %x / main_uid %x / cycle %d\n",
    159 cxy, lid, threads, thread_uid, main_uid, (int)cycle );
    160 
    161     while( 1 ) { asm volatile("nop"); }
    162 
    163158    unsigned int  items      = ARRAY_LENGTH / threads;
    164159    unsigned int  stages     = __builtin_ctz( threads ) + 1;
     
    316311                if( thread_uid != main_uid )
    317312                {
    318 
    319 get_cycle( &cycle );
    320 printf("\n### main creates thread_uid %d / &sort_arg %x / cycle %d\n",
    321 thread_uid, &arg[thread_uid], (unsigned int)cycle );
    322 
    323313                    if ( pthread_create( &trdid,              // not used because no join
    324314                                         &attr[thread_uid],   // thread attributes
     
    344334    sort( &arg[main_uid] );
    345335
     336while( 1 ) asm volatile( "nop" );
     337   
    346338    // Check result
    347339    int    success = 1;
     
    352344                         (threads==512) ) ? array1 : array0;
    353345   
    354     for( n=0 ; n<(ARRAY_LENGTH-1) ; n++ )
     346    for( n=0 ; n<(ARRAY_LENGTH-2) ; n++ )
    355347    {
    356348        if ( res_array[n] > res_array[n+1] )
Note: See TracChangeset for help on using the changeset viewer.