10 typedef struct sMessage
12 struct sMessage *Next;
16 } tMsg; // sizeof = 12+
18 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
26 Uint TID; //!< Thread ID
27 Uint TGID; //!< Thread Group (Process)
28 Uint PTID; //!< Parent Thread ID
29 Uint UID, GID; //!< User and Group
30 char *ThreadName; //!< Name of thread
32 // --- arch/proc.c's responsibility
36 //! Memory Manager State
37 tMemoryState MemState;
39 //! State on task switch
40 tTaskState SavedState;
43 int CurFaultNum; //!< Current fault number, 0: none
44 tVAddr FaultHandler; //!< Fault 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
77 #define GETMSG_IGNORE ((void*)-1)
80 extern tThread *Proc_GetCurThread(void);
81 extern tThread *Threads_GetThread(Uint TID);
82 extern void Threads_SetTickets(tThread *Thread, int Num);
83 extern int Threads_Wake(tThread *Thread);
84 extern void Threads_AddActive(tThread *Thread);
85 extern tThread *Threads_GetNextToRun(int CPU, tThread *Last);