Changeset 418 for trunk/kernel/kern


Ignore:
Timestamp:
Jan 8, 2018, 2:25:39 PM (7 years ago)
Author:
alain
Message:

Fix a bug in hal_kentry.S : the "uzone" pointer in the thread descriptor
must not be modified in case of interrupt.

Location:
trunk/kernel/kern
Files:
3 edited

Legend:

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

    r408 r418  
    123123    uint32_t   save_sr;       // for critical section
    124124
     125#if CONFIG_READ_DEBUG
     126enter_chdev_cmd = hal_time_stamp();
     127#endif
     128
    125129    thread_t * this = CURRENT_THREAD;
    126130
     
    187191    hal_restore_irq( save_sr );
    188192
     193#if CONFIG_READ_DEBUG
     194exit_chdev_cmd = hal_time_stamp();
     195#endif
     196
    189197}  // end chdev_register_command()
    190198
     
    253261            xlist_unlink( XPTR( client_cxy , &client_ptr->wait_list ) );
    254262            remote_spinlock_unlock( lock_xp );
     263
     264            // unblock client thread
     265            thread_unblock( client_xp , THREAD_BLOCKED_IO );
    255266
    256267chdev_dmsg("\n[DBG] %s : thread %x complete operation for client %x / cycle %d\n",
  • trunk/kernel/kern/thread.c

    r416 r418  
    868868
    869869        }
    870         else                                // yield each ~ 100000 cycles
    871 
     870        else                                // search a runable thread
    872871        {
    873              hal_fixed_delay( 500000 );
     872            sched_yield( "IDLE" );
    874873        }
    875 
    876         // force scheduling at each iteration
    877         sched_yield( "idle" );
    878    }
     874    }
    879875}  // end thread_idle()
    880876
  • trunk/kernel/kern/thread.h

    r416 r418  
    133133        void              * cpu_context;     /*! pointer on CPU context switch            */
    134134        void              * fpu_context;     /*! pointer on FPU context switch            */
    135     void              * uzone;           /*! pointer on uzone for hal_kentry          */
     135    void              * uzone;           /*! used by hal_do_syscakl & hal_do_except   */
    136136
    137137        intptr_t            k_stack_base;    /*! kernel stack base address                */
Note: See TracChangeset for help on using the changeset viewer.