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;
_farcall16(struct bregs *callregs, u16 callregseg)
{
ASSERT16();
- if (on_extra_stack()) {
+ if (need_hop_back()) {
stack_hop_back((u32)callregs, callregseg, _farcall16);
return;
}
void VISIBLE16
check_irqs(void)
{
- if (on_extra_stack()) {
+ if (need_hop_back()) {
stack_hop_back(0, 0, check_irqs);
return;
}
void VISIBLE16
wait_irq(void)
{
- if (on_extra_stack()) {
+ if (need_hop_back()) {
stack_hop_back(0, 0, wait_irq);
return;
}
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);
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