Ignore:
Timestamp:
Oct 10, 2018, 3:11:53 PM (6 years ago)
Author:
alain
Message:

1) Improve the busylock debug infrastructure.
2) introduce a non-distributed, but portable implementation for the pthread_barrier.

File:
1 edited

Legend:

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

    r580 r581  
    112112    cxy_t       chdev_cxy;
    113113    pid_t       parent_pid;
    114     lpid_t      process_lpid;
    115     lpid_t      parent_lpid;
    116114
    117115    // get parent process cluster and local pointer
     
    121119    // get parent_pid
    122120    parent_pid = hal_remote_l32( XPTR( parent_cxy , &parent_ptr->pid ) );
    123 
    124     // get process and parent lpid
    125     process_lpid = LPID_FROM_PID( pid );
    126     parent_lpid  = LPID_FROM_PID( parent_pid );
    127121
    128122#if DEBUG_PROCESS_REFERENCE_INIT
     
    156150
    157151    // define the stdin/stdout/stderr pseudo files <=> select a TXT terminal.
    158     if( (process_lpid == 1) ||     // INIT process
    159         (parent_lpid  == 1) )      // KSH  process
    160     {
    161         // allocate a TXT channel
    162         if( process_lpid == 1 )  txt_id = 0;                     // INIT
    163         else                     txt_id = process_txt_alloc();   // KSH
     152    if( (pid == 1) || (parent_pid  == 1) )      // INIT or KSH  process
     153    {
     154        // select a TXT channel
     155        if( pid == 1 )  txt_id = 0;                     // INIT
     156        else            txt_id = process_txt_alloc();   // KSH
    164157
    165158        // attach process to TXT
     
    17911784    if( txt_owner_xp == process_xp )
    17921785    {
    1793         nolock_printk("PID %X | PPID %X | TS %X | %s (FG) | %X | %d | %s\n",
    1794         pid, ppid, state, txt_name, process_ptr, th_nr, elf_name );
     1786        nolock_printk("PID %X | %s (FG) | %X | PPID %X | TS %X | %d | %s\n",
     1787        pid, txt_name, process_ptr, ppid, state, th_nr, elf_name );
    17951788    }
    17961789    else
    17971790    {
    1798         nolock_printk("PID %X | PPID %X | TS %X | %s (BG) | %X | %d | %s\n",
    1799         pid, ppid, state, txt_name, process_ptr, th_nr, elf_name );
     1791        nolock_printk("PID %X | %s (BG) | %X | PPID %X | TS %X | %d | %s\n",
     1792        pid, txt_name, process_ptr, ppid, state, th_nr, elf_name );
    18001793    }
    18011794}  // end process_display()
     
    18061799////////////////////////////////////////////////////////////////////////////////////////
    18071800
    1808 ////////////////////////////
     1801//////////////////////////////////
    18091802uint32_t process_txt_alloc( void )
    18101803{
Note: See TracChangeset for help on using the changeset viewer.