[SeaBIOS] [PATCH 05/23] Move stacks.c definitions from util.h to new file stacks.h.

Kevin O'Connor kevin at koconnor.net
Sun Sep 15 07:08:51 CEST 2013


Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 src/stacks.h | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 src/stacks.h

diff --git a/src/stacks.h b/src/stacks.h
new file mode 100644
index 0000000..5ee4adc
--- /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
-- 
1.8.3.1




More information about the SeaBIOS mailing list