git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixing commenting (always nice)
[tpg/acess2.git]
/
Kernel
/
include
/
threads.h
diff --git
a/Kernel/include/threads.h
b/Kernel/include/threads.h
index
644d033
..
6c29230
100644
(file)
--- a/
Kernel/include/threads.h
+++ b/
Kernel/include/threads.h
@@
-5,6
+5,7
@@
#include <arch.h>
#include <signal.h>
#include <arch.h>
#include <signal.h>
+#include <proc.h>
typedef struct sMessage
{
typedef struct sMessage
{
@@
-16,9
+17,10
@@
typedef struct sMessage
typedef struct sThread
{
typedef struct sThread
{
+ // --- threads.c's
struct sThread *Next; //!< Next thread in list
struct sThread *Next; //!< Next thread in list
-
int
IsLocked; //!< Thread's spinlock
- int Status; //!< Thread Status
+
tShortSpinlock
IsLocked; //!< Thread's spinlock
+
volatile
int Status; //!< Thread Status
int RetStatus; //!< Return Status
Uint TID; //!< Thread ID
int RetStatus; //!< Return Status
Uint TID; //!< Thread ID
@@
-27,7
+29,9
@@
typedef struct sThread
Uint UID, GID; //!< User and Group
char *ThreadName; //!< Name of thread
Uint UID, GID; //!< User and Group
char *ThreadName; //!< Name of thread
- tVAddr KernelStack; //!< Kernel Stack Base
+ // --- arch/proc.c's responsibility
+ //! Kernel Stack Base
+ tVAddr KernelStack;
//! Memory Manager State
tMemoryState MemState;
//! Memory Manager State
tMemoryState MemState;
@@
-35,17
+39,19
@@
typedef struct sThread
//! State on task switch
tTaskState SavedState;
//! State on task switch
tTaskState SavedState;
- int CurSignal; //!< Signal currently being handled (0 for none)
- tVAddr SignalHandlers[NSIG]; //!< Signal Handler List
- t
TaskState SignalState; //!< Saved state for signal h
andler
+ // --- threads.c's
+ int CurFaultNum; //!< Current fault number, 0: none
+ t
VAddr FaultHandler; //!< Fault H
andler
- tMsg
*Messages;
//!< Message Queue
+ tMsg
* volatile Messages;
//!< Message Queue
tMsg *LastMessage; //!< Last Message (speeds up insertion)
int Quantum, Remaining; //!< Quantum Size and remaining timesteps
int NumTickets; //!< Priority - Chance of gaining CPU
Uint Config[NUM_CFG_ENTRIES]; //!< Per-process configuration
tMsg *LastMessage; //!< Last Message (speeds up insertion)
int Quantum, Remaining; //!< Quantum Size and remaining timesteps
int NumTickets; //!< Priority - Chance of gaining CPU
Uint Config[NUM_CFG_ENTRIES]; //!< Per-process configuration
+
+ volatile int CurCPU;
} tThread;
} tThread;
@@
-58,9
+64,24
@@
enum {
THREAD_STAT_DEAD
};
THREAD_STAT_DEAD
};
+enum eFaultNumbers
+{
+ FAULT_MISC,
+ FAULT_PAGE,
+ FAULT_ACCESS,
+ FAULT_DIV0,
+ FAULT_OPCODE,
+ FAULT_FLOAT
+};
+
+#define GETMSG_IGNORE ((void*)-1)
+
// === FUNCTIONS ===
// === FUNCTIONS ===
-extern tThread *Proc_GetCurThread();
+extern tThread *Proc_GetCurThread(
void
);
extern tThread *Threads_GetThread(Uint TID);
extern tThread *Threads_GetThread(Uint TID);
-extern void Threads_Wake(tThread *Thread);
+extern void Threads_SetTickets(tThread *Thread, int Num);
+extern int Threads_Wake(tThread *Thread);
+extern void Threads_AddActive(tThread *Thread);
+extern tThread *Threads_GetNextToRun(int CPU, tThread *Last);
#endif
#endif
UCC
git Repository :: git.ucc.asn.au