]> xenbits.xensource.com Git - seabios.git/commitdiff
Add need_hop_back() call that determines if stack_hop_back is needed
authorKevin O'Connor <kevin@koconnor.net>
Mon, 29 Sep 2014 23:18:25 +0000 (19:18 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 30 Sep 2014 13:42:55 +0000 (09:42 -0400)
Also, use need_hop_back() instead of on_extra_stack() in code that
determines whether or not to call stack_hop_back().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/stacks.c
src/stacks.h

index dd955fb85b24abd0a705a80f644ec89442131c4c..4fd70a7c23af7c39c8029e1eb520c60b90c1129e 100644 (file)
@@ -115,7 +115,7 @@ u8 ExtraStack[BUILD_EXTRA_STACK_SIZE+1] VARLOW __aligned(8);
 u8 *StackPos VARLOW;
 
 // Test if currently on the extra stack
-static inline int
+int
 on_extra_stack(void)
 {
     return MODE16 && GET_SEG(SS) == SEG_LOW && getesp() > (u32)ExtraStack;
@@ -197,7 +197,7 @@ void VISIBLE16
 _farcall16(struct bregs *callregs, u16 callregseg)
 {
     ASSERT16();
-    if (on_extra_stack()) {
+    if (need_hop_back()) {
         stack_hop_back((u32)callregs, callregseg, _farcall16);
         return;
     }
@@ -384,7 +384,7 @@ fail:
 void VISIBLE16
 check_irqs(void)
 {
-    if (on_extra_stack()) {
+    if (need_hop_back()) {
         stack_hop_back(0, 0, check_irqs);
         return;
     }
@@ -416,7 +416,7 @@ yield(void)
 void VISIBLE16
 wait_irq(void)
 {
-    if (on_extra_stack()) {
+    if (need_hop_back()) {
         stack_hop_back(0, 0, wait_irq);
         return;
     }
index 9d3422f09c3a633a0a0c764d405ea651edfecb5e..265b40479fb2a3745b76453d532964f04eb98f12 100644 (file)
@@ -9,6 +9,7 @@ u32 call32(void *func, u32 eax, u32 errret);
 extern u8 ExtraStack[], *StackPos;
 u32 stack_hop(u32 eax, u32 edx, void *func);
 u32 stack_hop_back(u32 eax, u32 edx, void *func);
+int on_extra_stack(void);
 struct bregs;
 inline void farcall16(struct bregs *callregs);
 inline void farcall16big(struct bregs *callregs);
@@ -35,4 +36,13 @@ int wait_preempt(void);
 void check_preempt(void);
 u32 call32_params(void *func, u32 eax, u32 edx, u32 ecx, u32 errret);
 
+// Inline functions
+
+// Check if a call to stack_hop_back is needed.
+static inline int
+need_hop_back(void)
+{
+    return on_extra_stack();
+}
+
 #endif // stacks.h