Changeset 831a04d0 in mainline


Ignore:
Timestamp:
2007-01-29T20:01:12Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b612ded6
Parents:
1004b37
Message:

move timeout_t to timeout.h
move other helper types to thread.h

Location:
kernel/generic/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/proc/task.h

    r1004b37 r831a04d0  
    134134} task_t;
    135135
    136 typedef void (* timeout_handler_t)(void *arg);
    137 
    138 typedef struct {
    139         SPINLOCK_DECLARE(lock);
    140 
    141         link_t link;                    /**< Link to the list of active timeouts on THE->cpu */
    142        
    143         uint64_t ticks;                 /**< Timeout will be activated in this amount of clock() ticks. */
    144 
    145         timeout_handler_t handler;      /**< Function that will be called on timeout activation. */
    146         void *arg;                      /**< Argument to be passed to handler() function. */
    147        
    148         cpu_t *cpu;                     /**< On which processor is this timeout registered. */
    149 } timeout_t;
    150 
    151 /** Thread states. */
    152 typedef enum {
    153         Invalid,        /**< It is an error, if thread is found in this state. */
    154         Running,        /**< State of a thread that is currently executing on some CPU. */
    155         Sleeping,       /**< Thread in this state is waiting for an event. */
    156         Ready,          /**< State of threads in a run queue. */
    157         Entering,       /**< Threads are in this state before they are first readied. */
    158         Exiting,        /**< After a thread calls thread_exit(), it is put into Exiting state. */
    159         Undead          /**< Threads that were not detached but exited are in the Undead state. */
    160 } state_t;
    161 
    162 /** Join types. */
    163 typedef enum {
    164         None,
    165         TaskClnp,       /**< The thread will be joined by ktaskclnp thread. */
    166         TaskGC          /**< The thread will be joined by ktaskgc thread. */
    167 } thread_join_type_t;
    168 
    169136SPINLOCK_EXTERN(tasks_lock);
    170137extern btree_t tasks_btree;
  • kernel/generic/include/proc/thread.h

    r1004b37 r831a04d0  
    3838#include <synch/waitq.h>
    3939#include <proc/task.h>
     40#include <time/timeout.h>
    4041#include <cpu.h>
    4142#include <synch/rwlock.h>
     
    5657#define THREAD_FLAG_USPACE      (1 << 2)        /**< Thread executes in userspace. */
    5758
     59/** Thread states. */
     60typedef enum {
     61        Invalid,        /**< It is an error, if thread is found in this state. */
     62        Running,        /**< State of a thread that is currently executing on some CPU. */
     63        Sleeping,       /**< Thread in this state is waiting for an event. */
     64        Ready,          /**< State of threads in a run queue. */
     65        Entering,       /**< Threads are in this state before they are first readied. */
     66        Exiting,        /**< After a thread calls thread_exit(), it is put into Exiting state. */
     67        Undead          /**< Threads that were not detached but exited are in the Undead state. */
     68} state_t;
     69
     70/** Join types. */
     71typedef enum {
     72        None,
     73        TaskClnp,       /**< The thread will be joined by ktaskclnp thread. */
     74        TaskGC          /**< The thread will be joined by ktaskgc thread. */
     75} thread_join_type_t;
     76
    5877/** Thread structure. There is one per thread. */
    5978typedef struct thread {
  • kernel/generic/include/time/timeout.h

    r1004b37 r831a04d0  
    3737
    3838#include <arch/types.h>
    39 #include <proc/task.h>
     39#include <adt/list.h>
     40#include <cpu.h>
     41
     42typedef void (* timeout_handler_t)(void *arg);
     43
     44typedef struct {
     45        SPINLOCK_DECLARE(lock);
     46
     47        link_t link;                    /**< Link to the list of active timeouts on THE->cpu */
     48       
     49        uint64_t ticks;                 /**< Timeout will be activated in this amount of clock() ticks. */
     50
     51        timeout_handler_t handler;      /**< Function that will be called on timeout activation. */
     52        void *arg;                      /**< Argument to be passed to handler() function. */
     53       
     54        cpu_t *cpu;                     /**< On which processor is this timeout registered. */
     55} timeout_t;
    4056
    4157#define us2ticks(us)    ((uint64_t) (((uint32_t) (us) / (1000000 / HZ))))
Note: See TracChangeset for help on using the changeset viewer.