-// Switch to the extra stack in ebda and call a function.
-inline u32
-stack_hop(u32 eax, u32 edx, u32 ecx, void *func)
-{
- ASSERT16();
- u16 ebda_seg = get_ebda_seg(), bkup_ss;
- u32 bkup_esp;
- asm volatile(
- // Backup current %ss/%esp values.
- "movw %%ss, %w3\n"
- "movl %%esp, %4\n"
- // Copy ebda seg to %ds/%ss and set %esp
- "movw %w6, %%ds\n"
- "movw %w6, %%ss\n"
- "movl %5, %%esp\n"
- // Call func
- "calll %7\n"
- // Restore segments and stack
- "movw %w3, %%ds\n"
- "movw %w3, %%ss\n"
- "movl %4, %%esp"
- : "+a" (eax), "+d" (edx), "+c" (ecx), "=&r" (bkup_ss), "=&r" (bkup_esp)
- : "i" (EBDA_OFFSET_TOP_STACK), "r" (ebda_seg), "m" (*(u8*)func)
- : "cc", "memory");
- return eax;
-}
+
+/****************************************************************
+ * String ops
+ ****************************************************************/