Ignore:
Timestamp:
Jul 31, 2017, 1:59:52 PM (4 years ago)
Author:
alain
Message:

Several modifs in the generic scheduler and in the hal_context to
fix the context switch mechanism.

File:
1 edited

Legend:

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

    r286 r296  
    5454char * thread_type_str( uint32_t type )
    5555{
    56     if     ( type == THREAD_USER   ) return "USER";
     56    if     ( type == THREAD_USER   ) return "USR";
    5757    else if( type == THREAD_RPC    ) return "RPC";
    5858    else if( type == THREAD_DEV    ) return "DEV";
    59     else if( type == THREAD_KERNEL ) return "KERNEL";
    60     else if( type == THREAD_IDLE   ) return "IDLE";
     59    else if( type == THREAD_KERNEL ) return "KER";
     60    else if( type == THREAD_IDLE   ) return "IDL";
    6161    else                             return "undefined";
    6262}
     
    199199
    200200        return 0;
    201 }
     201
     202} // end thread_init()
    202203
    203204/////////////////////////////////////////////////////////
     
    309310    *new_thread = thread;
    310311        return 0;
    311 }
     312
     313}  // end thread_user_create()
    312314
    313315//////////////////////////////////////////////
     
    395397    *new_thread = thread;
    396398        return 0;
    397 }
     399
     400}  // end thread_user_fork()
    398401
    399402/////////////////////////////////////////////////////////
     
    407410        thread_t     * thread;       // pointer on new thread descriptor
    408411
    409     thread_dmsg("\n[INFO] %s : enters for type %s in cluster %x\n",
    410                 __FUNCTION__ , thread_type_str( type ) , local_cxy );
     412    thread_dmsg("\n[INFO] %s : enter / for type %s on core[%x,%d] / cycle %d\n",
     413    __FUNCTION__ , thread_type_str( type ) , local_cxy , core_lid , hal_time_stamp() );
    411414
    412415    assert( ( (type == THREAD_KERNEL) || (type == THREAD_RPC) ||
     
    440443        hal_cpu_context_create( thread );
    441444
    442     thread_dmsg("\n[INFO] %s : exit in cluster %x / trdid = %x / core_lid = %d\n",
    443                  __FUNCTION__ , local_cxy , thread->trdid , core_lid );
     445    thread_dmsg("\n[INFO] %s : exit / trdid = %x / type = %s / core = [%x,%d] / cycle %d\n",
     446    __FUNCTION__ , thread->trdid , thread_type_str(type) ,
     447    local_cxy , core_lid , hal_time_stamp() );
    444448
    445449    *new_thread = thread;
    446450        return 0;
    447 }
     451
     452} // end thread_kernel_create()
    448453
    449454///////////////////////////////////////////////////
     
    685690
    686691    // deschedule
    687     sched_yield();
     692    sched_yield( NULL );
    688693    return 0;
    689694}
     
    741746
    742747        // force scheduling
    743         sched_yield();
     748        sched_yield( NULL );
    744749   }
    745750}
Note: See TracChangeset for help on using the changeset viewer.