aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-03-16 12:46:30 -0700
committerChristian Cunningham <cc@localhost>2022-03-16 12:46:30 -0700
commitb7590870cfd909baca7b5dc1d954e233ec92092e (patch)
tree05f9747dc08d65c3910a5f2d7f1385eb0bb3ceb6 /include
parent4cf9e1ac0f0f6133baf4e8136e600ea51aaab65d (diff)
List Schedule
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 {