9 typedef struct sMessage
11 struct sMessage *Next;
15 } tMsg; // sizeof = 12+
17 typedef struct sThread
19 struct sThread *Next; //!< Next thread in list
20 int IsLocked; //!< Thread's spinlock
21 int Status; //!< Thread Status
22 int RetStatus; //!< Return Status
24 Uint TID; //!< Thread ID
25 Uint TGID; //!< Thread Group (Process)
26 Uint PTID; //!< Parent Thread ID
27 Uint UID, GID; //!< User and Group
28 char *ThreadName; //!< Name of thread
30 tVAddr KernelStack; //!< Kernel Stack Base
32 //! Memory Manager State
33 tMemoryState MemState;
35 //! State on task switch
36 tTaskState SavedState;
38 int CurSignal; //!< Signal currently being handled (0 for none)
39 tVAddr SignalHandlers[NSIG]; //!< Signal Handler List
40 tTaskState SignalState; //!< Saved state for signal handler
42 tMsg *Messages; //!< Message Queue
43 tMsg *LastMessage; //!< Last Message (speeds up insertion)
45 int Quantum, Remaining; //!< Quantum Size and remaining timesteps
46 int NumTickets; //!< Priority - Chance of gaining CPU
48 Uint Config[NUM_CFG_ENTRIES]; //!< Per-process configuration
62 extern tThread *Proc_GetCurThread();
63 extern tThread *Threads_GetThread(Uint TID);
64 extern void Threads_Wake(tThread *Thread);
65 extern void Threads_AddActive(tThread *Thread);