aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/globals.h1
-rw-r--r--include/sys/schedule.h17
2 files changed, 10 insertions, 8 deletions
diff --git a/include/globals.h b/include/globals.h
index 249ffe7..ce98c97 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -17,6 +17,7 @@ extern struct Thread usrloopthread;
extern unsigned int gwidth, gheight, gpitch, gisrgb;
extern unsigned char thread_table[MAX_THREADS];
extern struct Thread threads[MAX_THREADS];
+extern struct ThreadEntry thread_entries[MAX_THREADS];
extern unsigned long mutex_table[MAX_MUTEXS];
extern struct Mutex mutexs[MAX_MUTEXS];
#endif
diff --git a/include/sys/schedule.h b/include/sys/schedule.h
index 3015e98..a6e03a9 100644
--- a/include/sys/schedule.h
+++ b/include/sys/schedule.h
@@ -13,6 +13,12 @@ enum ThreadStatus {
THREAD_SWAIT = 2,
};
+enum EntryTypes {
+ THREAD_ENTRY = 0,
+ START_ENTRY = 1,
+ END_ENTRY = 2,
+};
+
struct Thread {
void* pc;
void* sp; // Store r0-r12,lr on stack
@@ -31,18 +37,13 @@ struct Thread {
struct ThreadEntry {
struct Thread* thread;
- struct ThreadEntry* prev;
struct ThreadEntry* next;
-};
-
-struct ThreadEntryIterator {
- struct ThreadEntry* entry;
+ unsigned long entry_type;
};
struct ThreadQueue {
- struct ThreadEntry entry[TQUEUE_MAX];
- struct ThreadEntryIterator read;
- struct ThreadEntryIterator write;
+ struct ThreadEntry start;
+ struct ThreadEntry end;
};
struct Scheduler {