aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/globals.h7
-rw-r--r--include/lib/kmem.h4
-rw-r--r--include/sys/schedule.h13
-rw-r--r--include/util/lock.h1
-rw-r--r--include/util/mutex.h2
5 files changed, 6 insertions, 21 deletions
diff --git a/include/globals.h b/include/globals.h
index 156968a..7bda83c 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -8,17 +8,14 @@ extern unsigned long cntfrq;
extern char* os_name;
extern char* os_info_v;
-extern unsigned char kmem_begin[0x2000000];
-extern unsigned char kmem_lookup[0xD000];
extern unsigned long nextpid;
-extern unsigned long sched_stack_count;
extern unsigned long stimel;
extern unsigned long stimeh;
-extern struct Drawer g_Drawer;
extern struct Scheduler scheduler;
extern struct Thread usrloopthread;
extern unsigned int gwidth, gheight, gpitch, gisrgb;
-extern unsigned char stacks_table[MAX_THREADS];
+extern unsigned char thread_table[MAX_THREADS];
+extern struct Thread threads[MAX_THREADS];
#endif
#endif
diff --git a/include/lib/kmem.h b/include/lib/kmem.h
index 67751cd..e942c0d 100644
--- a/include/lib/kmem.h
+++ b/include/lib/kmem.h
@@ -1,10 +1,6 @@
#ifndef LIB_KMEM_H
#define LIB_KMEM_H
-void* kmalloc(unsigned int size);
-void* kcalloc(unsigned int size);
-void kfree(void* ptr);
-
void kmemshow32(void* data, unsigned long length);
void kmemshow(void* data, unsigned long length);
diff --git a/include/sys/schedule.h b/include/sys/schedule.h
index 67f2f9c..397ab2e 100644
--- a/include/sys/schedule.h
+++ b/include/sys/schedule.h
@@ -4,7 +4,7 @@
// If TQUEUE_MAX is changed, ensure sys/schedule.S's value gets changed
#define TQUEUE_MAX 0x100
#define STACK_SIZE 0x4000
-#define TQUEUE_CNT 4
+#define TQUEUE_CNT 3
#define PRIORITIES 8
#define MAX_THREADS TQUEUE_MAX*PRIORITIES*TQUEUE_CNT
@@ -12,13 +12,6 @@ enum ThreadStatus {
THREAD_READY = 0,
THREAD_MWAIT = 1,
THREAD_SWAIT = 2,
- THREAD_SERROR = 3, // Stack Error
- THREAD_FINISH = 4, // Need to clean up
-};
-
-struct RStack {
- void* sp;
- unsigned long idx;
};
struct Thread {
@@ -31,7 +24,10 @@ struct Thread {
unsigned char preempt;
unsigned short status;
void* mptr;
+ unsigned long offset;
unsigned char old_priority;
+ unsigned char c_reserved;
+ unsigned short s_reserved;
};
struct ThreadRotBuffer {
@@ -44,7 +40,6 @@ struct ThreadQueues {
struct ThreadRotBuffer ready;
struct ThreadRotBuffer mwait;
struct ThreadRotBuffer swait;
- struct ThreadRotBuffer serror;
};
struct Scheduler {
diff --git a/include/util/lock.h b/include/util/lock.h
index f6f8f53..c5b2f7e 100644
--- a/include/util/lock.h
+++ b/include/util/lock.h
@@ -9,6 +9,5 @@ struct Lock {
void lock(struct Lock* l);
void unlock(struct Lock* l);
-struct Lock* create_lock(void);
#endif
diff --git a/include/util/mutex.h b/include/util/mutex.h
index 61237b8..ab318b4 100644
--- a/include/util/mutex.h
+++ b/include/util/mutex.h
@@ -15,6 +15,4 @@ struct Mutex {
void* addr;
} __attribute__((packed, aligned(4)));
-struct Mutex* create_mutex(void* addr);
-
#endif