9 typedef struct sMessage
11 struct sMessage *Next;
15 } tMsg; // sizeof = 12+
17 typedef struct sThread
21 struct sThread *Next; //!< Next thread in list
22 tSpinlock IsLocked; //!< Thread's spinlock
23 volatile int Status; //!< Thread Status
24 int RetStatus; //!< Return Status
27 Uint TID; //!< Thread ID
28 Uint TGID; //!< Thread Group (Process)
29 Uint PTID; //!< Parent Thread ID
30 Uint UID, GID; //!< User and Group
31 char *ThreadName; //!< Name of thread
33 // --- arch/proc.c's responsibility
39 //! Memory Manager State
40 tMemoryState MemState;
43 //! State on task switch
44 tTaskState SavedState;
48 int CurFaultNum; //!< Current fault number, 0: none
49 tVAddr FaultHandler; //!< Fault Handler
51 tMsg * volatile Messages; //!< Message Queue
52 tMsg *LastMessage; //!< Last Message (speeds up insertion)
54 int Quantum, Remaining; //!< Quantum Size and remaining timesteps
55 int NumTickets; //!< Priority - Chance of gaining CPU
57 Uint Config[NUM_CFG_ENTRIES]; //!< Per-process configuration
71 extern tThread *Proc_GetCurThread();
72 extern tThread *Threads_GetThread(Uint TID);
73 extern void Threads_Wake(tThread *Thread);
74 extern void Threads_AddActive(tThread *Thread);