2 * AcessOS Microkernel Version
9 #define GETMSG_IGNORE ((void*)-1)
12 typedef struct sMessage {
13 struct sMessage *Next;
17 } tMsg; // sizeof = 12+
19 typedef struct sThread {
22 int Status; //!< Thread Status
24 Uint TID; //!< Thread ID
25 Uint TGID; //!< Thread Group (Process)
26 Uint UID, GID; //!< User and Group
27 char *ThreadName; //!< Name of thread
29 Uint ESP, EBP, EIP; //!< State on switch
31 Uint64 PML4[3]; //!< Address Space
33 Uint CR3; //!< Memory Space
36 Uint KernelStack; //!< Thread's Kernel Stack
38 tMsg *Messages; //!< Message Queue
39 tMsg *LastMessage; //!< Last Message (speeds up insertion)
41 int Quantum, Remaining; //!< Quantum Size and remaining timesteps
42 int NumTickets; //!< Priority - Chance of gaining CPU
44 Uint Config[NUM_CFG_ENTRIES]; //!< Per-process configuration
45 } tThread; // sizeof = 68
63 Uint32 EAX, ECX, EDX, EBX;
64 Uint32 ESP, EBP, ESI, EDI;
65 Uint32 ES, CS, DS, SS, FS, GS;
67 Uint16 Resvd, IOPB; // IO Permissions Bitmap
71 extern tThread *gCurrentThread;
74 extern void Proc_Start();
75 extern int Proc_Clone(Uint *Err, Uint Flags);
76 extern void Proc_Exit();
77 extern void Proc_Yield();
78 extern void Proc_Sleep();
79 extern void Proc_SetTickets(int Num);
80 extern tThread *Proc_GetThread(Uint TID);
81 extern void Thread_Wake(tThread *Thread);