//trunk/kernel/generic/include/proc/scheduler.h |
---|
26,7 → 26,7 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup genericproc |
/** @addtogroup genericproc |
* @{ |
*/ |
/** @file |
69,6 → 69,5 |
#endif |
/** @} |
/** @} |
*/ |
//trunk/kernel/generic/include/proc/uarg.h |
---|
26,7 → 26,7 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup genericproc |
/** @addtogroup genericproc |
* @{ |
*/ |
/** @file |
48,6 → 48,5 |
#endif |
/** @} |
/** @} |
*/ |
//trunk/kernel/generic/include/proc/task.h |
---|
26,7 → 26,7 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup genericproc |
/** @addtogroup genericproc |
* @{ |
*/ |
/** @file |
58,6 → 58,7 |
link_t th_head; /**< List of threads contained in this task. */ |
as_t *as; /**< Address space. */ |
task_id_t taskid; /**< Unique identity of task */ |
context_id_t context; /**< Task security context */ |
/** If this is true, new threads can become part of the task. */ |
bool accept_new_threads; |
//trunk/kernel/generic/include/proc/thread.h |
---|
26,7 → 26,7 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
/** @addtogroup genericproc |
/** @addtogroup genericproc |
* @{ |
*/ |
/** @file |
146,6 → 146,7 |
int priority; /**< Thread's priority. Implemented as index to CPU->rq */ |
uint32_t tid; /**< Thread ID. */ |
context_id_t context; /**< Thread security context */ |
thread_arch_t arch; /**< Architecture-specific data. */ |
192,6 → 193,5 |
#endif |
/** @} |
/** @} |
*/ |
//trunk/kernel/generic/include/arch.h |
---|
60,6 → 60,7 |
task_t *task; /**< Current task. */ |
cpu_t *cpu; /**< Executing cpu. */ |
as_t *as; /**< Current address space. */ |
context_id_t context; /**< Current security context. */ |
}; |
#define THE ((the_t *)(get_stack_base())) |
//trunk/kernel/generic/include/typedefs.h |
---|
45,6 → 45,7 |
typedef unsigned long index_t; |
typedef unsigned long long task_id_t; |
typedef unsigned long context_id_t; |
typedef struct cpu_info cpu_info_t; |
//trunk/kernel/generic/src/proc/the.c |
---|
58,6 → 58,7 |
the->thread = NULL; |
the->task = NULL; |
the->as = NULL; |
the->context = 0; |
} |
/** Copy THE structure |
//trunk/kernel/generic/src/proc/task.c |
---|
115,6 → 115,7 |
ta->name = name; |
ta->main_thread = NULL; |
ta->refcount = 0; |
ta->context = THE->context; |
ta->capabilities = 0; |
ta->accept_new_threads = true; |
355,8 → 356,8 |
t = (task_t *) node->value[i]; |
spinlock_lock(&t->lock); |
printf("%s(%lld): address=%#zx, as=%#zx, ActiveCalls: %zd", |
t->name, t->taskid, t, t->as, atomic_get(&t->active_calls)); |
printf("%s(%lld): context=%ld, address=%#zx, as=%#zx, ActiveCalls: %zd", |
t->name, t->taskid, t->context, t, t->as, atomic_get(&t->active_calls)); |
for (j=0; j < IPC_MAX_PHONES; j++) { |
if (t->phones[j].callee) |
printf(" Ph(%zd): %#zx ", j, t->phones[j].callee); |
//trunk/kernel/generic/src/proc/thread.c |
---|
123,7 → 123,7 |
/** Initialization and allocation for thread_t structure */ |
static int thr_constructor(void *obj, int kmflags) |
{ |
thread_t *t = (thread_t *)obj; |
thread_t *t = (thread_t *) obj; |
spinlock_initialize(&t->lock, "thread_t_lock"); |
link_initialize(&t->rq_link); |
155,7 → 155,7 |
/** Destruction of thread_t object */ |
static int thr_destructor(void *obj) |
{ |
thread_t *t = (thread_t *)obj; |
thread_t *t = (thread_t *) obj; |
frame_free(KA2PA(t->kstack)); |
#ifdef ARCH_HAS_FPU |
299,7 → 299,7 |
thread_create_arch(t); |
/* Not needed, but good for debugging */ |
memsetb((uintptr_t)t->kstack, THREAD_STACK_SIZE * 1<<STACK_FRAMES, 0); |
memsetb((uintptr_t) t->kstack, THREAD_STACK_SIZE * 1 << STACK_FRAMES, 0); |
ipl = interrupts_disable(); |
spinlock_lock(&tidlock); |
318,6 → 318,7 |
memcpy(t->name, name, THREAD_NAME_BUFLEN); |
t->context = THE->context; |
t->thread_code = func; |
t->thread_arg = arg; |
t->ticks = -1; |
533,8 → 534,8 |
thread_t *t; |
t = (thread_t *) node->value[i]; |
printf("%s: address=%#zx, tid=%zd, state=%s, task=%#zx, code=%#zx, stack=%#zx, cpu=", |
t->name, t, t->tid, thread_states[t->state], t->task, t->thread_code, t->kstack); |
printf("%s: address=%#zx, tid=%zd, context=%ld, state=%s, task=%#zx, code=%#zx, stack=%#zx, cpu=", |
t->name, t, t->tid, t->context, thread_states[t->state], t->task, t->thread_code, t->kstack); |
if (t->cpu) |
printf("cpu%zd", t->cpu->id); |
else |