X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/f8bd95b7a13dfe54d800e2d7ecdb0329f0798289..986ce23ace2f7875a1a561bd947f435a7594146c:/lunaix-os/includes/arch/x86/i386_abi.h diff --git a/lunaix-os/includes/arch/x86/i386_abi.h b/lunaix-os/includes/arch/x86/i386_abi.h new file mode 100644 index 0000000..22481c9 --- /dev/null +++ b/lunaix-os/includes/arch/x86/i386_abi.h @@ -0,0 +1,24 @@ +#ifndef __LUNAIX_I386ABI_H +#define __LUNAIX_I386ABI_H + +#define store_retval(retval) __current->intr_ctx.registers.eax = (retval) + +#define store_retval_to(proc, retval) (proc)->intr_ctx.registers.eax = (retval) + +#define j_usr(sp, pc) \ + asm volatile("movw %0, %%ax\n" \ + "movw %%ax, %%es\n" \ + "movw %%ax, %%ds\n" \ + "movw %%ax, %%fs\n" \ + "movw %%ax, %%gs\n" \ + "pushl %0\n" \ + "pushl %1\n" \ + "pushl %2\n" \ + "pushl %3\n" \ + "retf" ::"i"(UDATA_SEG), \ + "r"(sp), \ + "i"(UCODE_SEG), \ + "r"(pc) \ + : "eax", "memory"); + +#endif /* __LUNAIX_ABI_H */