Changeset 9cefba4 in mainline
- Timestamp:
- 2005-10-16T19:18:19Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ba1b2194
- Parents:
- 0bed5d0
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/arch/mips32
r0bed5d0 r9cefba4 19 19 20 20 EMULATORS AND VIRTUALIZERS 21 o msim 1.2.7 22 o msim 1.2.6 with lwl/lwr/swl/swr patch 21 o msim 1.2.8 23 22 o gxemul - both big and little endian 24 23 o simics 2.2.19 -
include/proc/scheduler.h
r0bed5d0 r9cefba4 40 40 struct runq { 41 41 spinlock_t lock; 42 link_t rq_head; 43 int n; 42 link_t rq_head; /**< List of ready threads. */ 43 int n; /**< Number of threads in rq_ready. */ 44 44 }; 45 45 -
include/proc/task.h
r0bed5d0 r9cefba4 36 36 struct task { 37 37 spinlock_t lock; 38 link_t th_head; /* list of threads contained in this task*/39 link_t tasks_link; /* link to other tasks within the system*/38 link_t th_head; /**< List of threads contained in this task. */ 39 link_t tasks_link; /**< Link to other tasks within the system. */ 40 40 vm_t *vm; 41 41 }; -
include/proc/thread.h
r0bed5d0 r9cefba4 46 46 47 47 enum state { 48 Invalid, 49 Running, 50 Sleeping, 51 Ready, 52 Entering, 53 Exiting 48 Invalid, /**< It is an error, if thread is found in this state. */ 49 Running, /**< State of a thread that is currently executing on some CPU. */ 50 Sleeping, /**< Thread in this state is waiting for an event. */ 51 Ready, /**< State of threads in a run queue. */ 52 Entering, /**< Threads are in this state before they are first readied. */ 53 Exiting /**< After a thread calls thread_exit(), it is put into Exiting state. */ 54 54 }; 55 55 … … 60 60 61 61 struct thread { 62 link_t rq_link; /* run queue link*/63 link_t wq_link; /* wait queue link*/64 link_t th_link; /* links to threads within the parent task*/65 link_t threads_link; 62 link_t rq_link; /**< Run queue link. */ 63 link_t wq_link; /**< Wait queue link. */ 64 link_t th_link; /**< Links to threads within containing task. */ 65 link_t threads_link; /**< Link to the list of all threads. */ 66 66 67 67 /* items below are protected by lock */ 68 68 spinlock_t lock; 69 69 70 void (* thread_code)(void *); 71 void *thread_arg; 70 void (* thread_code)(void *); /**< Function implementing the thread. */ 71 void *thread_arg; /**< Argument passed to thread_code() function. */ 72 72 73 context_t saved_context; 74 context_t sleep_timeout_context; 73 context_t saved_context; /**< From here, the stored context is restored when the thread is scheduled. */ 74 context_t sleep_timeout_context; /**< From here, the stored failover context is restored when sleep times out. */ 75 76 waitq_t *sleep_queue; /**< Wait queue in which this thread sleeps. */ 77 timeout_t sleep_timeout; /**< Timeout used for timeoutable sleeping. */ 78 volatile int timeout_pending; /**< Flag signalling sleep timeout in progress. */ 79 75 80 fpu_context_t saved_fpu_context; 76 81 int fpu_context_exists; … … 83 88 int fpu_context_engaged; 84 89 85 waitq_t *sleep_queue; 86 timeout_t sleep_timeout; 87 volatile int timeout_pending; 90 rwlock_type_t rwlock_holder_type; 88 91 89 rwlock_type_t rwlock_holder_type; 90 void (* call_me)(void *); 91 void *call_me_with; 92 void (* call_me)(void *); /**< Funtion to be called in scheduler before the thread is put asleep. */ 93 void *call_me_with; /**< Argument passed to call_me(). */ 92 94 93 int state;94 int flags; 95 state_t state; /**< Thread's state. */ 96 int flags; /**< Thread's flags. */ 95 97 96 cpu_t *cpu; 97 task_t *task; 98 cpu_t *cpu; /**< Thread's CPU. */ 99 task_t *task; /**< Containing task. */ 98 100 99 __u64 ticks; 101 __u64 ticks; /**< Ticks before preemption. */ 100 102 101 __u32 tid; 103 int pri; /**< Thread's priority. Implemented as index of run queue. */ 104 __u32 tid; /**< Thread ID. */ 102 105 103 int pri; 104 105 ARCH_THREAD_DATA; 106 ARCH_THREAD_DATA; /**< Architecture-specific data. */ 106 107 107 __u8 *kstack; 108 __u8 *ustack; 108 __u8 *kstack; /**< Thread's kernel stack. */ 109 __u8 *ustack; /**< Thread's user stack. */ 109 110 }; 110 111 111 extern spinlock_t threads_lock; 112 extern link_t threads_head; 112 extern spinlock_t threads_lock; /**< Lock protecting threads_head list. */ 113 extern link_t threads_head; /**< List of all threads in the system. */ 113 114 114 115 static void cushion(void); -
include/synch/rwlock.h
r0bed5d0 r9cefba4 43 43 struct rwlock { 44 44 spinlock_t lock; 45 mutex_t exclusive; 46 int readers_in; 45 mutex_t exclusive; /**< Mutex for writers, readers can bypass it if readers_in is positive. */ 46 int readers_in; /**< Number of readers in critical section. */ 47 47 }; 48 48 -
include/synch/synch.h
r0bed5d0 r9cefba4 30 30 #define __SYNCH_H__ 31 31 32 #define SYNCH_NO_TIMEOUT 0 33 #define SYNCH_BLOCKING 0 34 #define SYNCH_NON_BLOCKING 1 32 #define SYNCH_NO_TIMEOUT 0 /**< No timeout is request. */ 33 #define SYNCH_BLOCKING 0 /**< Blocking operation request. */ 34 #define SYNCH_NON_BLOCKING 1 /**< Non-blocking operation request. */ 35 35 36 #define ESYNCH_WOULD_BLOCK 1 37 #define ESYNCH_TIMEOUT 2 38 #define ESYNCH_OK_ATOMIC 4 39 #define ESYNCH_OK_BLOCKED 8 36 #define ESYNCH_WOULD_BLOCK 1 /**< Could not satisfy the request without going to sleep. */ 37 #define ESYNCH_TIMEOUT 2 /**< Timeout occurred. */ 38 #define ESYNCH_OK_ATOMIC 4 /**< Operation succeeded without sleeping. */ 39 #define ESYNCH_OK_BLOCKED 8 /**< Operation succeeded and did sleep. */ 40 40 41 41 #define SYNCH_FAILED(rc) ((rc) & (ESYNCH_WOULD_BLOCK | ESYNCH_TIMEOUT)) -
include/synch/waitq.h
r0bed5d0 r9cefba4 41 41 struct waitq { 42 42 spinlock_t lock; 43 int missed_wakeups; 44 link_t head; 43 int missed_wakeups; /**< Number of waitq_wakeup() calls that didn't find a thread to wake up. */ 44 link_t head; /**< List of sleeping threads for wich there was no missed_wakeup. */ 45 45 }; 46 46 -
include/typedefs.h
r0bed5d0 r9cefba4 46 46 typedef struct cpu_arch cpu_arch_t; 47 47 typedef struct task task_t; 48 typedef enum state state_t; 48 49 typedef struct thread thread_t; 49 50 typedef struct context context_t;
Note:
See TracChangeset
for help on using the changeset viewer.