Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1062 → Rev 1060

/kernel/trunk/generic/src/proc/task.c
62,12 → 62,11
* Create new task with no threads.
*
* @param as Task's address space.
* @param name Symbolic name.
*
* @return New task's structure
*
*/
task_t *task_create(as_t *as, char *name)
task_t *task_create(as_t *as)
{
ipl_t ipl;
task_t *ta;
79,7 → 78,6
list_initialize(&ta->th_head);
list_initialize(&ta->tasks_link);
ta->as = as;
ta->name = name;
 
ipc_answerbox_init(&ta->answerbox);
103,12 → 101,9
 
/** Create new task with 1 thread and run it
*
* @param programe_addr Address of program executable image.
* @param name Program name.
*
* @return Task of the running program or NULL on error
*/
task_t * task_run_program(void *program_addr, char *name)
task_t * task_run_program(void *program_addr)
{
as_t *as;
as_area_t *a;
124,9 → 119,9
return NULL;
}
task = task_create(as, name);
task = task_create(as);
t = thread_create(uinit, (void *)((elf_header_t *)program_addr)->e_entry,
task, 0, "uinit");
task, THREAD_USER_STACK);
/*
* Create the data as_area.
153,8 → 148,8
for (cur=tasks_head.next; cur!=&tasks_head; cur=cur->next) {
t = list_get_instance(cur, task_t, tasks_link);
spinlock_lock(&t->lock);
printf("%s: address=%P, taskid=%Q, as=%P, ActiveCalls: %d",
t->name, t, t->taskid, t->as, atomic_get(&t->active_calls));
printf("Task: %Q ActiveCalls: %d", t->taskid,
atomic_get(&t->active_calls));
for (i=0; i < IPC_MAX_PHONES; i++) {
if (t->phones[i].callee)
printf(" Ph(%d): %P ", i,t->phones[i].callee);
/kernel/trunk/generic/src/proc/thread.c
248,12 → 248,11
* @param arg Thread's implementing function argument.
* @param task Task to which the thread belongs.
* @param flags Thread flags.
* @param name Symbolic name.
*
* @return New thread's structure on success, NULL on failure.
*
*/
thread_t *thread_create(void (* func)(void *), void *arg, task_t *task, int flags, char *name)
thread_t *thread_create(void (* func)(void *), void *arg, task_t *task, int flags)
{
thread_t *t;
ipl_t ipl;
280,7 → 279,6
t->saved_context.ipl = interrupts_read();
interrupts_restore(ipl);
t->name = name;
t->thread_code = func;
t->thread_arg = arg;
t->ticks = -1;
411,12 → 409,9
 
for (cur=threads_head.next; cur!=&threads_head; cur=cur->next) {
t = list_get_instance(cur, thread_t, threads_link);
printf("%s: address=%P, tid=%d, state=%s, task=%P, code=%P, stack=%P, cpu=",
t->name, t, t->tid, thread_states[t->state], t->task, t->thread_code, t->kstack);
printf("Thr: %d(%s) ", t->tid, thread_states[t->state]);
if (t->cpu)
printf("cpu%d ", t->cpu->id);
else
printf("none");
printf("\n");
}
 
/kernel/trunk/generic/src/proc/scheduler.c
617,6 → 617,7
/* We are going to mess with scheduler structures,
* let's not be interrupted */
ipl = interrupts_disable();
printf("Scheduler dump:\n");
for (cpu=0;cpu < config.cpu_count; cpu++) {
 
if (!cpus[cpu].active)
623,8 → 624,8
continue;
 
spinlock_lock(&cpus[cpu].lock);
printf("cpu%d: address=%P, nrdy=%d, needs_relink=%d\n",
cpus[cpu].id, &cpus[cpu], atomic_get(&cpus[cpu].nrdy), cpus[cpu].needs_relink);
printf("cpu%d: nrdy: %d, needs_relink: %d\n",
cpus[cpu].id, atomic_get(&cpus[cpu].nrdy), cpus[cpu].needs_relink);
for (i=0; i<RQ_COUNT; i++) {
r = &cpus[cpu].rq[i];