9 typedef struct sMessage
11 struct sMessage *Next;
15 } tMsg; // sizeof = 12+
17 typedef struct sThread
20 struct sThread *Next; //!< Next thread in list
21 tSpinlock IsLocked; //!< Thread's spinlock
22 int Status; //!< Thread Status
23 int RetStatus; //!< Return Status
25 Uint TID; //!< Thread ID
26 Uint TGID; //!< Thread Group (Process)
27 Uint PTID; //!< Parent Thread ID
28 Uint UID, GID; //!< User and Group
29 char *ThreadName; //!< Name of thread
31 // --- arch/proc.c's responsibility
35 //! Memory Manager State
36 tMemoryState MemState;
38 //! State on task switch
39 tTaskState SavedState;
42 int CurSignal; //!< Signal currently being handled (0 for none)
43 tVAddr SignalHandlers[NSIG]; //!< Signal Handler List
44 tTaskState SignalState; //!< Saved state for signal handler
46 tMsg * volatile Messages; //!< Message Queue
47 tMsg *LastMessage; //!< Last Message (speeds up insertion)
49 int Quantum, Remaining; //!< Quantum Size and remaining timesteps
50 int NumTickets; //!< Priority - Chance of gaining CPU
52 Uint Config[NUM_CFG_ENTRIES]; //!< Per-process configuration
66 extern tThread *Proc_GetCurThread();
67 extern tThread *Threads_GetThread(Uint TID);
68 extern void Threads_Wake(tThread *Thread);
69 extern void Threads_AddActive(tThread *Thread);