#include <debug.h>
#include <process.h>
#include <signal.h>
+#include <string.h>
#include "cpu.h"
#include "defs.h"
extern int sys_cxipc(long, long, long);
#if FEATURE(POSIX)
extern int sys_posixcall(stack_frame_t*);
+/* extern void _sig_hwint_deliver(const int); */
+#define _sig_hwint_deliver(foo)
#endif /* FEATURE(POSIX) */
static const char *_exc_name[] = {
extern void _i8259_eoi(u32_t);
#endif /* CONFIG_APIC */
-void task_signal_deliver(task_t *task, stack_frame_t *stk, int signum)
+void task_signal_deliver(task_t *task, stack_frame_t *stk, int signum, siginfo_t *info)
{
struct {
void *eip;
siginfo_t si;
} __attribute__((packed)) stkfrm;
- stkfrm.data = NULL;
- stkfrm.signal = signum;
stkfrm.eip = (void*)stk->eip;
stkfrm.handler = process_get_sighandler((process_t*)task->t_proc, signum);
+ stkfrm.signal = signum;
+ stkfrm.data = NULL;
+
+ if(info) {
+ memcpy(&(stkfrm.si), info, sizeof(stkfrm.si));
+ } else {
+ memset(&(stkfrm.si), 0, sizeof(stkfrm.si));
+ }
+
stk->eip = (u32_t)_task_sig_stub;
stk->prevesp -= sizeof(stkfrm);
if(ctx.intn == INT_TIMER) {
sched_tick();
} else {
- /* FIXME: handle interrupt */
+#if FEATURE(POSIX)
+ _sig_hwint_deliver(ctx.intn);
+#else /* ! FEATURE(POSIX) */
+ /* FIXME: Do something with the interrupt */
+#endif /* ! FEATURE(POSIX) */
}
return;
/*
* Deliver the signal to the currently executing task
*/
- task_signal_deliver(ctask, &ctx, sig);
+ task_signal_deliver(ctask, &ctx, sig, NULL);
}
return;
#include <corax/types.h>
#include <spinlock.h>
+#include <signal.h>
typedef struct stack_frame stack_frame_t;
u8_t io_inb(const u16_t);
void io_outb(const u16_t, const u8_t);
-void task_signal_deliver(task_t*, stack_frame_t*, int);
+void task_signal_deliver(task_t*, stack_frame_t*, int, siginfo_t*);
#endif /* !__ASSEMBLY_SOURCE */