Changeset 2e4e706 in mainline
- Timestamp:
- 2010-05-13T08:51:36Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c964521
- Parents:
- 9929742
- Location:
- kernel/generic
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/arch.h
r9929742 r2e4e706 27 27 */ 28 28 29 /** @addtogroup generic 29 /** @addtogroup generic 30 30 * @{ 31 31 */ … … 41 41 #include <mm/as.h> 42 42 43 #define DEFAULT_CONTEXT 43 #define DEFAULT_CONTEXT 0 44 44 45 #define CPU 46 #define THREAD 47 #define TASK 48 #define AS 49 #define CONTEXT 50 #define PREEMPTION_DISABLED 45 #define CPU THE->cpu 46 #define THREAD THE->thread 47 #define TASK THE->task 48 #define AS THE->as 49 #define CONTEXT (THE->task ? THE->task->context : DEFAULT_CONTEXT) 50 #define PREEMPTION_DISABLED THE->preemption_disabled 51 51 52 #define context_check(ctx1, ctx2) 52 #define context_check(ctx1, ctx2) ((ctx1) == (ctx2)) 53 53 54 54 /** … … 58 58 */ 59 59 typedef struct { 60 size_t preemption_disabled; 61 thread_t *thread; 62 task_t *task; 63 cpu_t *cpu; 64 as_t *as; 60 size_t preemption_disabled; /**< Preemption disabled counter. */ 61 thread_t *thread; /**< Current thread. */ 62 task_t *task; /**< Current task. */ 63 cpu_t *cpu; /**< Executing cpu. */ 64 as_t *as; /**< Current address space. */ 65 65 } the_t; 66 66 67 67 #define THE ((the_t * )(get_stack_base())) 68 68 69 extern void the_initialize(the_t * the);70 extern void the_copy(the_t * src, the_t *dst);69 extern void the_initialize(the_t *); 70 extern void the_copy(the_t *, the_t *); 71 71 72 72 extern void arch_pre_mm_init(void); … … 80 80 extern void reboot(void); 81 81 extern void arch_reboot(void); 82 extern void *arch_construct_function(fncptr_t * fptr, void *addr, void *caller);82 extern void *arch_construct_function(fncptr_t *, void *, void *); 83 83 84 84 #endif -
kernel/generic/include/preemption.h
r9929742 r2e4e706 27 27 */ 28 28 29 /** @addtogroup generic 29 /** @addtogroup generic 30 30 * @{ 31 31 */ -
kernel/generic/src/preempt/preemption.c
r9929742 r2e4e706 27 27 */ 28 28 29 /** @addtogroup generic 29 /** @addtogroup generic 30 30 * @{ 31 31 */ 32 32 33 33 /** 34 * @file 35 * @brief 34 * @file preemption.c 35 * @brief Preemption control. 36 36 */ 37 37 38 38 #include <preemption.h> 39 39 #include <arch.h> … … 52 52 void preemption_enable(void) 53 53 { 54 ASSERT( THE->preemption_disabled);54 ASSERT(PREEMPTION_DISABLED); 55 55 memory_barrier(); 56 56 THE->preemption_disabled--; -
kernel/generic/src/synch/mutex.c
r9929742 r2e4e706 33 33 /** 34 34 * @file 35 * @brief 35 * @brief Mutexes. 36 36 */ 37 37 38 38 #include <synch/mutex.h> 39 39 #include <synch/semaphore.h> … … 44 44 /** Initialize mutex. 45 45 * 46 * @param mtx 47 * @param type 46 * @param mtx Mutex. 47 * @param type Type of the mutex. 48 48 */ 49 49 void mutex_initialize(mutex_t *mtx, mutex_type_t type) … … 57 57 * Timeout mode and non-blocking mode can be requested. 58 58 * 59 * @param mtx 60 * @param usec 61 * @param flags 59 * @param mtx Mutex. 60 * @param usec Timeout in microseconds. 61 * @param flags Specify mode of operation. 62 62 * 63 63 * For exact description of possible combinations of 64 64 * usec and flags, see comment for waitq_sleep_timeout(). 65 65 * 66 * @return See comment for waitq_sleep_timeout(). 66 * @return See comment for waitq_sleep_timeout(). 67 * 67 68 */ 68 69 int _mutex_lock_timeout(mutex_t *mtx, uint32_t usec, int flags) … … 70 71 int rc; 71 72 72 if ( mtx->type == MUTEX_PASSIVE && THREAD) {73 if ((mtx->type == MUTEX_PASSIVE) && (THREAD)) { 73 74 rc = _semaphore_down_timeout(&mtx->sem, usec, flags); 74 75 } else { 75 ASSERT( mtx->type == MUTEX_ACTIVE || !THREAD);76 ASSERT((mtx->type == MUTEX_ACTIVE) || (!THREAD)); 76 77 ASSERT(usec == SYNCH_NO_TIMEOUT); 77 78 ASSERT(!(flags & SYNCH_FLAGS_INTERRUPTIBLE)); 79 78 80 do { 79 81 rc = semaphore_trydown(&mtx->sem); … … 87 89 /** Release mutex. 88 90 * 89 * @param mtx 91 * @param mtx Mutex. 90 92 */ 91 93 void mutex_unlock(mutex_t *mtx) -
kernel/generic/src/synch/waitq.c
r9929742 r2e4e706 261 261 int rc; 262 262 263 ASSERT( !PREEMPTION_DISABLED || PARAM_NON_BLOCKING(flags, usec));263 ASSERT((!PREEMPTION_DISABLED) || (PARAM_NON_BLOCKING(flags, usec))); 264 264 265 265 ipl = waitq_sleep_prepare(wq); -
kernel/generic/src/time/clock.c
r9929742 r2e4e706 195 195 spinlock_unlock(&THREAD->lock); 196 196 197 if ( !ticks && !PREEMPTION_DISABLED) {197 if ((!ticks) && (!PREEMPTION_DISABLED)) { 198 198 #ifdef CONFIG_UDEBUG 199 199 istate_t *istate;
Note:
See TracChangeset
for help on using the changeset viewer.