aboutsummaryrefslogtreecommitdiffstats
path: root/src/stacks.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2013-09-14 19:28:55 -0400
committerKevin O'Connor <kevin@koconnor.net>2013-09-18 20:48:34 -0400
commit3df600bbdf4672a0a856e33a24d8c8a63215ca96 (patch)
treeca73af7be09dbfa8565ad45b26e2e7e023b4d698 /src/stacks.h
parentcdb98203f41671327936152d40d9041a82b0b9ce (diff)
downloadseabios-3df600bbdf4672a0a856e33a24d8c8a63215ca96.tar.gz
Move stacks.c definitions from util.h to new file stacks.h.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stacks.h')
-rw-r--r--src/stacks.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/stacks.h b/src/stacks.h
new file mode 100644
index 00000000..5ee4adc3
--- /dev/null
+++ b/src/stacks.h
@@ -0,0 +1,34 @@
+// Misc function and variable declarations.
+#ifndef __STACKS_H
+#define __STACKS_H
+
+#include "types.h" // u32
+
+// stacks.c
+extern u8 ExtraStack[], *StackPos;
+u32 stack_hop(u32 eax, u32 edx, void *func);
+u32 stack_hop_back(u32 eax, u32 edx, void *func);
+u32 call32(void *func, u32 eax, u32 errret);
+struct bregs;
+inline void farcall16(struct bregs *callregs);
+inline void farcall16big(struct bregs *callregs);
+inline void __call16_int(struct bregs *callregs, u16 offset);
+#define call16_int(nr, callregs) do { \
+ extern void irq_trampoline_ ##nr (); \
+ __call16_int((callregs), (u32)&irq_trampoline_ ##nr ); \
+ } while (0)
+extern struct thread_info MainThread;
+struct thread_info *getCurThread(void);
+void yield(void);
+void yield_toirq(void);
+void run_thread(void (*func)(void*), void *data);
+void wait_threads(void);
+struct mutex_s { u32 isLocked; };
+void mutex_lock(struct mutex_s *mutex);
+void mutex_unlock(struct mutex_s *mutex);
+void start_preempt(void);
+void finish_preempt(void);
+int wait_preempt(void);
+void check_preempt(void);
+
+#endif // stacks.h