|
Revision 1668, 2.3 KB
(checked in by mwhitworth, 3 years ago)
|
|
Merge in changes from keobject.
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | #ifndef SCHED_H |
|---|
| 20 | #define SCHED_H |
|---|
| 21 | |
|---|
| 22 | #include <i386/pit.h> |
|---|
| 23 | #include <llist.h> |
|---|
| 24 | #include <typedefs.h> |
|---|
| 25 | #include <string.h> |
|---|
| 26 | |
|---|
| 27 | extern int tasking; |
|---|
| 28 | extern volatile int thrNeedSchedule; |
|---|
| 29 | |
|---|
| 30 | struct Process; |
|---|
| 31 | struct Thread; |
|---|
| 32 | struct KeObject; |
|---|
| 33 | |
|---|
| 34 | extern struct Process* current; |
|---|
| 35 | extern struct Thread* currThread,*prevThread; |
|---|
| 36 | extern struct Thread* lastMathThread; |
|---|
| 37 | |
|---|
| 38 | int ThrInit(); |
|---|
| 39 | void ThrSchedule(); |
|---|
| 40 | struct Process* ThrCreateProcess(char* name); |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | #define ThrCreateKernelThread(address) (ThrCreateThread(NULL,(DWORD)(address),false,0, NULL)) |
|---|
| 44 | #define ThrCreateKernelThreadArg(address, arg) (ThrCreateThread(NULL, (DWORD)(address), false, 0, (arg))) |
|---|
| 45 | |
|---|
| 46 | struct Thread* ThrCreateThread(struct Process* parent,DWORD entry,int user,DWORD stackP, void* argument); |
|---|
| 47 | void ThrStartThread(struct Thread* thread); |
|---|
| 48 | void ThrProcessExit(int returnCode); |
|---|
| 49 | void ThrSetPriority(struct Thread* thread, int priority); |
|---|
| 50 | void ThrSuspendThread(struct Thread* thread); |
|---|
| 51 | void ThrResumeThread(struct Thread* thread); |
|---|
| 52 | char* ThrGetProcName(DWORD pid); |
|---|
| 53 | void ThrFreeThread(struct Thread* thread); |
|---|
| 54 | void ThrFreeProcess(struct KeObject* object); |
|---|
| 55 | void ThrIdleFunc(); |
|---|
| 56 | int ThrDoExitThread(); |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | |
|---|
| 64 | |
|---|
| 65 | |
|---|
| 66 | #define PRIORITY_NONE 0 |
|---|
| 67 | #define PRIORITY_DEFAULT 16 |
|---|
| 68 | #define PRIORITY_TOP 32 |
|---|
| 69 | |
|---|
| 70 | #endif |
|---|