{
int ret_val;
- dbg_printf("pg_dir_memcpy(%p, %p, NULL, %p, 0x%08x)\n", proc, dst, src, bytes);
ret_val = pg_dir_memcpy(proc->p_pgdir, dst, NULL, src, bytes);
return(ret_val);
}
}
} else {
+ dbg_printf("Signal to current task\n");
/* handle the signal in the current task */
task = task_get_current();
}
* we can use it without having to perform any translations. The usermode
* stack will have to be translated though.
*/
- vesp3 = (u32_t*)kstk->prevesp;
- ret_val = _pg_dir_vpxlate((struct pagedir*)task->t_pgdir,
- (u32_t)vesp3, (u32_t*)&pesp3);
- if(!ret_val) {
- u32_t *parg0;
- u32_t *peip;
+// vesp3 = (u32_t*)kstk->prevesp;
+// ret_val = _pg_dir_vpxlate((struct pagedir*)task->t_pgdir,
+// (u32_t)vesp3, (u32_t*)&pesp3);
- /* push the signal number and the return address on the userspace stack */
+ if(!ret_val) {
+ /*
+ * The stack frame for the signal handler should look something like this:
+ *
+ * | ... |
+ * |-----|
+ * | EIP |
+ * | EBP |
+ *
+ *
+ * We need space for two registers and the stack frame of the signal
+ * handler. We will make use of process_memcpy_ktop() for simplicity's
+ * sake.
+ */
+ /* ...and just return from the interrupt. Done. */
+#if 0
/*
* pesp3, pesp3 - 1, and pesp3 - 2 may not be on the same page, which would
* be an atrociously hard-to-find bug.
*/
kstk->eip = (u32_t)proc->p_sighandler[signal];
kstk->prevesp -= (sizeof(kstk->prevesp) * 2);
+#endif /* 0 */
}
/* let the process continue execution */
*/
static void _sig_term(int sig)
{
+ debug(__func__, strlen(__func__));
+
_exit(sig);
return;
}
static void _sig_ign(int sig)
{
+ debug(__func__, strlen(__func__));
+
/* do nothing */
return;
}
static void _sig_core(int sig)
{
+ debug(__func__, strlen(__func__));
+
_exit(sig);
return;
}
static void _sig_stop(int sig)
{
+ debug(__func__, strlen(__func__));
+
/*
* FIXME: Stop the process
* - Change the process state
static void _sig_cont(int sig)
{
+ debug(__func__, strlen(__func__));
+
/*
* FIXME: Continue the process
* - Change its state back to a runnable state
return(ret_val);
}
+
+void* process_get_sighandler(process_t *proc, int signal)
+{
+ if(signal < 0 || signal > SIGMAX) {
+ return(NULL);
+ }
+
+ return((void*)proc->p_sighandler[signal]);
+}