Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 1833 → Rev 1839

/trunk/kernel/generic/src/ddi/ddi.c
129,9 → 129,11
t = task_find_by_id(id);
if (!t) {
if ((!t) || (!context_check(CONTEXT, t->context))) {
/*
* There is no task with the specified ID.
* There is no task with the specified ID
* or the task belongs to a different security
* context.
*/
spinlock_unlock(&tasks_lock);
interrupts_restore(ipl);
/trunk/kernel/generic/src/proc/the.c
58,7 → 58,6
the->thread = NULL;
the->task = NULL;
the->as = NULL;
the->context = 0;
}
 
/** Copy THE structure
/trunk/kernel/generic/src/proc/task.c
115,15 → 115,15
ta->name = name;
ta->main_thread = NULL;
ta->refcount = 0;
ta->context = THE->context;
ta->context = CONTEXT;
 
ta->capabilities = 0;
ta->accept_new_threads = true;
ipc_answerbox_init(&ta->answerbox);
for (i=0; i < IPC_MAX_PHONES;i++)
for (i = 0; i < IPC_MAX_PHONES; i++)
ipc_phone_init(&ta->phones[i]);
if (ipc_phone_0)
if ((ipc_phone_0) && (context_check(ipc_phone_0->task->context, ta->context)))
ipc_phone_connect(&ta->phones[0], ipc_phone_0);
atomic_set(&ta->active_calls, 0);
 
/trunk/kernel/generic/src/proc/thread.c
318,7 → 318,6
memcpy(t->name, name, THREAD_NAME_BUFLEN);
t->context = THE->context;
t->thread_code = func;
t->thread_arg = arg;
t->ticks = -1;
534,8 → 533,8
thread_t *t;
t = (thread_t *) node->value[i];
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);
printf("%s: address=%#zx, tid=%zd, state=%s, task=%#zx, context=%ld, code=%#zx, stack=%#zx, cpu=",
t->name, t, t->tid, thread_states[t->state], t->task, t->task->context, t->thread_code, t->kstack);
if (t->cpu)
printf("cpu%zd", t->cpu->id);
else
/trunk/kernel/generic/src/security/cap.c
111,7 → 111,7
ipl = interrupts_disable();
spinlock_lock(&tasks_lock);
t = task_find_by_id((task_id_t) taskid_arg.value);
if (!t) {
if ((!t) || (!context_check(CONTEXT, t->context))) {
spinlock_unlock(&tasks_lock);
interrupts_restore(ipl);
return (unative_t) ENOENT;
122,9 → 122,6
spinlock_unlock(&t->lock);
spinlock_unlock(&tasks_lock);
 
interrupts_restore(ipl);
return 0;
}
153,7 → 150,7
ipl = interrupts_disable();
spinlock_lock(&tasks_lock);
t = task_find_by_id((task_id_t) taskid_arg.value);
if (!t) {
if ((!t) || (!context_check(CONTEXT, t->context))) {
spinlock_unlock(&tasks_lock);
interrupts_restore(ipl);
return (unative_t) ENOENT;