/kernel/trunk/generic/src/interrupt/interrupt.c |
---|
85,6 → 85,9 |
ASSERT(n < IVT_ITEMS); |
exc_table[n].f(n + IVT_FIRST, istate); |
/* This is a safe place to exit exiting thread */ |
if (THREAD && THREAD->interrupted && istate_from_uspace(istate)) |
thread_exit(); |
} |
/** Default 'null' exception handler */ |
/kernel/trunk/generic/src/proc/task.c |
---|
49,6 → 49,7 |
#include <elf.h> |
#include <errno.h> |
#include <syscall/copy.h> |
#include <console/klog.h> |
#ifndef LOADED_PROG_STACK_PAGES_NO |
#define LOADED_PROG_STACK_PAGES_NO 1 |
401,6 → 402,7 |
ipc_cleanup(); |
futex_cleanup(); |
klog_printf("Cleanup of task %lld completed.", TASK->taskid); |
} |
/** Kernel task used to kill a userspace task when its main thread exits. |
/kernel/trunk/generic/src/syscall/syscall.c |
---|
47,6 → 47,7 |
#include <syscall/copy.h> |
#include <sysinfo/sysinfo.h> |
#include <console/console.h> |
#include <console/klog.h> |
/** Print using kernel facility |
* |
91,22 → 92,16 |
__native a4, __native id) |
{ |
__native rc; |
ipl_t ipl; |
bool exit = false; |
if (id < SYSCALL_END) |
rc = syscall_table[id](a1,a2,a3,a4); |
else |
panic("Undefined syscall %d", id); |
else { |
klog_printf("TASK %lld: Unknown syscall id %d",TASK->taskid,id); |
task_kill(TASK->taskid); |
thread_exit(); |
} |
ipl = interrupts_disable(); |
spinlock_lock(&THREAD->lock); |
if (THREAD->interrupted) |
exit = true; |
spinlock_unlock(&THREAD->lock); |
interrupts_restore(ipl); |
if (exit) |
thread_exit(); |
return rc; |