2019-02-11 09:47:28 -06:00
|
|
|
#ifndef TASKING_H
|
|
|
|
#define TASKING_H
|
|
|
|
|
2019-02-25 15:42:23 -06:00
|
|
|
#include <stdint.h>
|
2020-07-12 14:28:58 -05:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#ifndef INT_TASKING_H
|
|
|
|
typedef enum TaskState {
|
|
|
|
TASK_RUNNING,
|
|
|
|
TASK_READY,
|
|
|
|
TASK_EXITED,
|
|
|
|
TASK_BLOCKED
|
|
|
|
} TaskState;
|
|
|
|
|
|
|
|
#endif
|
2019-02-25 15:42:23 -06:00
|
|
|
|
2019-02-11 09:47:28 -06:00
|
|
|
void yield();
|
2019-08-04 13:14:35 -05:00
|
|
|
void yieldToPID(uint32_t pid);
|
2019-05-05 13:30:01 -05:00
|
|
|
void createTaskCr3(void* task,void* cr3);
|
2019-05-23 20:41:33 -05:00
|
|
|
void createTaskCr3Param(void* task,void* cr3,uint32_t param1,uint32_t param2);
|
2019-02-25 15:42:23 -06:00
|
|
|
char isPrivleged(uint32_t pid);
|
2020-07-12 14:28:58 -05:00
|
|
|
void blockTask(TaskState state);
|
|
|
|
void unblockTask(pid_t pid);
|
|
|
|
|
2019-02-11 09:47:28 -06:00
|
|
|
|
|
|
|
#endif
|