2020-01-05 10:35:44 +01:00
|
|
|
/*#include <kernel/process.h>
|
2019-12-29 16:39:30 +01:00
|
|
|
|
|
|
|
//FIXME: atomic operation !!
|
|
|
|
int process_switch(pid_t pid)
|
|
|
|
{
|
|
|
|
extern process_t *process_current;
|
|
|
|
common_context_t *context_current;
|
|
|
|
common_context_t *context_next;
|
|
|
|
process_t *process;
|
|
|
|
|
|
|
|
// Get current context
|
|
|
|
context_current =
|
|
|
|
(process_current != NULL)
|
|
|
|
? &process_current->context
|
|
|
|
: NULL;
|
|
|
|
|
|
|
|
// Get next context.
|
|
|
|
process = process_get(pid);
|
|
|
|
if (process == NULL)
|
|
|
|
return (-1);
|
|
|
|
context_next = &process->context;
|
|
|
|
|
|
|
|
// Context switch
|
|
|
|
// TODO: SYSCALL !!!!!
|
|
|
|
//context_switch(context_current, context_next);
|
|
|
|
return (0);
|
2020-01-05 10:35:44 +01:00
|
|
|
}*/
|