Ignore:
Timestamp:
May 10, 2017, 5:04:01 PM (7 years ago)
Author:
alain
Message:

mprove the HAL for interrupt, exception, syscall handling.

File:
1 edited

Legend:

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

    r14 r16  
    128128        uint32_t              tm_born;       /*! date of the thread loading               */
    129129        uint32_t              tm_dead;       /*! date of the death                        */
    130         clock_t               tm_sleep;      /*! TODO ???  [AG]                           */
    131         clock_t               tm_wait;       /*! TODO ???  [AG]                           */
    132         clock_t               tm_usr;        /*! user execution duration                  */
    133         clock_t               tm_sys;        /*! system execution duration                */
     130        cycle_t               tm_sleep;      /*! TODO ???  [AG]                           */
     131        cycle_t               tm_wait;       /*! TODO ???  [AG]                           */
     132        cycle_t               tm_usr;        /*! user execution duration                  */
     133        cycle_t               tm_sys;        /*! system execution duration                */
    134134}
    135135thread_info_t;
     
    151151typedef struct thread_s
    152152{
     153    void              * cpu_uzone;       /*! used for exception/interrupt/syscall     */
     154        void              * cpu_context;     /*! used for context switch                  */
     155        void              * fpu_context;     /*! used for dynamic FPU allocation          */
     156
    153157        uint32_t            trdid;           /*! thread index (in THTBL)                  */
    154158        thread_type_t       type;            /*! thread type                              */
     
    177181    uint32_t            signals;         /*! bit vector of signals                    */
    178182
    179         error_t             errno;           /*! errno value of last system call          */
     183        error_t             errno;           /*! errno value set by last system call      */
    180184
    181185    bool_t              fork_user;       /*! user defined placement for next fork()   */
     
    205209    xlist_entry_t       wait_list;       /*! member of threads blocked on same cond   */
    206210
    207         void              * fpu_context;     /*! pointer on FPU context                   */
    208         void              * cpu_context;     /*! pointer on CPU context                   */
    209 
    210211        thread_info_t       info;            /*! embedded thread_info_t                   */
    211212
     
    219220
    220221#define CURRENT_THREAD  (hal_get_current_thread())
     222
     223/***************************************************************************************
     224 * This function returns a printable string for a thread type.
     225 ***************************************************************************************
     226 * @ type    : thread type.
     227 * returns pointer on string.
     228 **************************************************************************************/
     229char * thread_type_str( uint32_t type );
    221230
    222231/***************************************************************************************
     
    438447void thread_kill( thread_t * thread );
    439448
     449/***************************************************************************************
     450 * This function updates the calling thread user_time counter, and reset the thread
     451 * cycles counter.
     452 * TODO This function is not implemented.
     453 ***************************************************************************************
     454 * @ thread   : local pointer on target thread.
     455 **************************************************************************************/
     456void thread_user_time_update( thread_t * thread );
     457
     458/**************************************************************************************n
     459 * This function updates the calling thread kernel_time counter, and reset the thread
     460 * cycles counter.
     461 * TODO This function is not implemented.
     462 ***************************************************************************************
     463 * @ thread   : local pointer on target thread.
     464 **************************************************************************************/
     465void thread_kernel_time_update( thread_t * thread );
     466
     467/***************************************************************************************
     468 * This function handle all pending signals for the thread identified by the <thread>
     469 * argument. It is called each time the core exit the kernel, after handling an
     470 * interrupt, exception or syscall.
     471 * TODO This function is not implemented.
     472 ***************************************************************************************
     473 * @ thread   : local pointer on target thread.
     474 **************************************************************************************/
     475void thread_signals_handle( thread_t * thread );
     476
     477
     478
    440479#endif  /* _THREAD_H_ */
Note: See TracChangeset for help on using the changeset viewer.