Skip to content
Snippets Groups Projects
syscall-handler.c 888 B
Newer Older
#include "task-descriptor.h"
#include "kernel.h"
#include "syscall-handler.h"


antnh6@gmail.com's avatar
antnh6@gmail.com committed
int handlerCreate(KernelStruct* Colonel, TD* Active, int priority, void (*code)()) {

    TD* NewTask = NewTask(priority,Active->TaskID),code);
    return pushToScheduler(Colonel, NewTask);
}

void Handle(KernelStruct* Colonel, int n) {
    switch(n) {
            return handlerCreate(Colonel); 
            (Colonel->Active)->RetVal = (Colonel->Active)->TaskID;
            pushToScheduler(Colonel);
            break;
            (Colonel->Active)->RetVal = (Colonel->Active)->ParentID;
            pushToScheduler(Colonel);
            break;
            pushToScheduler(Colonel);
            break;
            (Colonel->Active)->TaskState = Zombie;
            break;