#include <string.h>
#include <spinlock.h>
#include <unistd.h>
+#include <debug.h>
+#include <crxstd.h>
#include "fd.h"
#include "sched.h"
#include "mailbox.h"
siginfo_t p_siginfo;
int p_sigflags[32];
- sighandler_t p_sighandler[32];
+ void* p_sighandler[32];
};
struct proc_list {
proc->p_state = PROC_STATE_READY;
- if(sched_enqueue(proc->p_tasks[0]) != 0) {
+ if(sched_schedule(proc->p_tasks[0]) != 0) {
PANIC("sched_enqueue() failed for a new task\n");
}
}
return(ret_val);
}
+#if 0
int process_wait(pid_t pid)
{
process_t *cproc;
cproc = process_get_current();
if(cproc) {
- sched_wait(pid);
+ sched_sleep(pid);
}
return(ret_val);
dbg_printf("[%u] signalling pid %u\n", process_get_id(cproc), pid);
+ /* FIXME: How do we fix this? */
sched_signal(pid);
ret_val = 0;
}
return(ret_val);
}
+#endif /* ! 0 */
void* process_get_tasks(process_t *proc)
{
* tasks are neither on the ready queue nor on the wait queue),
* so we have to stop the task.
*/
- if(sched_dequeue(t) < 0) {
+ if(sched_drop(t) < 0) {
/*
* However, don't terminate the current task, since we still
* need it - we're not done here, after all.
if(proc && signal >= 0 && signal <= SIGUNUSED) {
process_t *cproc;
+#if 0
stack_frame_t *kstk;
- u32_t *vesp3;
- u32_t *pesp3;
+#endif
task_t *task;
int i;
}
dbg_printf("Should be delivering the irq here\n");
-
+#if 0
kstk = (stack_frame_t*)task->t_sp;
-
+#endif
/*
* Get usable pointers to the task's stacks. The t_sp member holds the
* address of the kernel-mode stack that is valid inside of the kernel, so
process_lock(proc);
for(i = 0; i < CONFIG_PROC_MAXTASKS; i++) {
- ret_val = sched_task_suspend(proc->p_tasks[i]);
+ ret_val = sched_sleep(proc->p_tasks[i]);
}
process_unlock(proc);
if(proc && signal >= 0 && signal <= SIGMAX) {
proc->p_sigflags[signal] = sa->sa_flags;
proc->p_sighandler[signal] = sa->sa_flags & SA_SIGINFO ?
- sa->sa_sigaction : sa->sa_handler;
+ (void*)sa->sa_sigaction : (void*)sa->sa_handler;
dbg_printf("process_set_sighandler: %p[%u] -> %p\n", proc, signal, sa->sa_handler);
ret_val = -EINVAL;
if(proc && signal >= 0 && signal <= SIGMAX) {
- pid_t pid;
-
ret_val = -EALREADY;
process_lock(proc);
memcpy(&(proc->p_siginfo), si, sizeof(proc->p_siginfo));
}
- pid = proc->p_id;
ret_val = 0;
}
if(!ret_val) {
/* process needs to be woken up if it was sleeping */
- sched_raise(pid);
+
+ /* FIXME: Which task do we wake up? */
+ /* sched_wakeup(task, 1); */
}
}