int process_kill(process_t pid, int signal)
{
+ int ret_val;
+
+ /* FIXME: Implement sending of signals to processes */
+ ret_val = -ENOSYS;
+ return(ret_val);
}
int process_signal_deliver(process_t *proc, int signal)
task_t *task;
/* FIXME: Need to suspend the process in order to deliver the signal safely */
+ process_suspend(proc);
/*
* Elect a task to handle the signal - right now, this is simple since the
* pesp3, pesp3 - 1, and pesp3 - 2 may not be on the same page, which would
* be an atrociously hard-to-find bug.
*/
+
+ /*
+ * TODO: Take mixed page sizes into account
+ *
+ * It's no harm to do the lookup, but it might be more efficient if we
+ * take into account that page sizes might be larger than PAGE_SIZE. For
+ * example, the kernel is almost certainly using 4M pages, so this will
+ * result in more expensive lookups than is necessary.
+ */
#define PAGE_BASE(__addr) ((u32_t)__addr & ~(PAGE_SIZE - 1))
#define SAME_PAGE(__x,__y) (PAGE_BASE(__x) == PAGE_BASE(__y))
*/
return;
}
+
+int process_suspend(process_t *proc)
+{
+ int ret_val;
+
+ ret_val = -ENOSYS;
+
+ /* FIXME: Send IPIs to all processors executing tasks from proc */
+
+ return(ret_val);
+}