10 typedef struct sMessage
12 struct sMessage *Next;
16 } tMsg; // sizeof = 12+
18 typedef struct sThread
22 struct sThread *Next; //!< Next thread in list
23 tSpinlock IsLocked; //!< Thread's spinlock
24 volatile int Status; //!< Thread Status
25 int RetStatus; //!< Return Status
28 Uint TID; //!< Thread ID
29 Uint TGID; //!< Thread Group (Process)
30 Uint PTID; //!< Parent Thread ID
31 Uint UID, GID; //!< User and Group
32 char *ThreadName; //!< Name of thread
34 // --- arch/proc.c's responsibility
40 //! Memory Manager State
41 tMemoryState MemState;
44 //! State on task switch
45 tTaskState SavedState;
49 int CurFaultNum; //!< Current fault number, 0: none
50 tVAddr FaultHandler; //!< Fault Handler
52 tMsg * volatile Messages; //!< Message Queue
53 tMsg *LastMessage; //!< Last Message (speeds up insertion)
55 int Quantum, Remaining; //!< Quantum Size and remaining timesteps
56 int NumTickets; //!< Priority - Chance of gaining CPU
58 Uint Config[NUM_CFG_ENTRIES]; //!< Per-process configuration
81 #define GETMSG_IGNORE ((void*)-1)
84 extern tThread *Proc_GetCurThread(void);
85 extern tThread *Threads_GetThread(Uint TID);
86 extern void Threads_Wake(tThread *Thread);
87 extern void Threads_AddActive(tThread *Thread);