X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Finclude%2Fthreads_int.h;h=66bb8c16379dd055646f96ef62850eef3eda0470;hb=7536e8afcc3018c4ca2a4aa8f8422cf86a6c188c;hp=0bc941df04a2b08daa086cad64f06748a63b1651;hpb=a42596b1f729fb8b4c2bbf7a44bb6f8af511f5ae;p=tpg%2Facess2.git diff --git a/Kernel/include/threads_int.h b/Kernel/include/threads_int.h index 0bc941df..66bb8c16 100644 --- a/Kernel/include/threads_int.h +++ b/Kernel/include/threads_int.h @@ -8,6 +8,9 @@ #include #include + +typedef struct sProcess tProcess; + /** * \brief IPC Message */ @@ -19,11 +22,28 @@ typedef struct sMessage Uint8 Data[]; //!< Message data } tMsg; +/** + * \brief Process state + */ +struct sProcess +{ + tPID PID; + int nThreads; + + tUID UID; //!< User ID + tGID GID; //!< User and Group + tMemoryState MemState; + + int MaxFD; + char *CurrentWorkingDir; + char *RootDir; +}; + /** * \brief Core threading structure * */ -typedef struct sThread +struct sThread { // --- threads.c's /** @@ -38,19 +58,15 @@ typedef struct sThread void *WaitPointer; //!< What (Mutex/Thread/other) is the thread waiting on int RetStatus; //!< Return Status - Uint TID; //!< Thread ID - Uint TGID; //!< Thread Group (Process) + tTID TID; //!< Thread ID + struct sProcess *Process; //!< Thread Group / Process struct sThread *Parent; //!< Parent Thread - Uint UID, GID; //!< User and Group char *ThreadName; //!< Name of thread // --- arch/proc.c's responsibility //! Kernel Stack Base tVAddr KernelStack; - //! Memory Manager State - tMemoryState MemState; - //! State on task switch tTaskState SavedState; @@ -64,15 +80,15 @@ typedef struct sThread int Quantum, Remaining; //!< Quantum Size and remaining timesteps int Priority; //!< Priority - 0: Realtime, higher means less time - Uint Config[NUM_CFG_ENTRIES]; //!< Per-process configuration + int _errno; volatile int CurCPU; - int bInstrTrace; + bool bInstrTrace; // --- event.c Uint32 EventState; -} tThread; +}; enum {