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>
|
|
|
|
|
2020-07-22 19:26:55 -05:00
|
|
|
#ifndef KERN_TASKING_H
|
2020-07-20 10:07:46 -05:00
|
|
|
typedef enum ThreadState {
|
|
|
|
THREAD_RUNNING,
|
|
|
|
THREAD_READY,
|
|
|
|
THREAD_EXITED,
|
|
|
|
THREAD_BLOCKED
|
|
|
|
} ThreadState;
|
2020-07-12 14:28:58 -05:00
|
|
|
|
|
|
|
#endif
|
2019-02-25 15:42:23 -06:00
|
|
|
|
2019-02-11 09:47:28 -06:00
|
|
|
void yield();
|
2020-07-23 11:50:23 -05:00
|
|
|
void yieldToPID(pid_t pid);
|
2020-07-20 10:07:46 -05:00
|
|
|
void createProcCr3(void* start,void* cr3);
|
2020-07-23 11:50:23 -05:00
|
|
|
void createProcCr3Param(void* start,void* cr3,void* param1,void* param2);
|
|
|
|
char isPrivleged(pid_t pid);
|
2020-07-20 10:07:46 -05:00
|
|
|
void blockThread(ThreadState state);
|
2020-07-23 11:50:23 -05:00
|
|
|
void unblockThread(pid_t pid,pid_t tid);
|
2020-07-12 14:28:58 -05:00
|
|
|
|
2019-02-11 09:47:28 -06:00
|
|
|
|
|
|
|
#endif
|