chore: fix almost *ALL* warnings.
[lunaix-os.git] / lunaix-os / includes / arch / x86 / i386_abi.h
1 #ifndef __LUNAIX_I386ABI_H
2 #define __LUNAIX_I386ABI_H
3
4 #define store_retval(retval) __current->intr_ctx.registers.eax = (retval)
5
6 #define store_retval_to(proc, retval) (proc)->intr_ctx.registers.eax = (retval)
7
8 #define j_usr(sp, pc)                                                          \
9     asm volatile("movw %0, %%ax\n"                                             \
10                  "movw %%ax, %%es\n"                                           \
11                  "movw %%ax, %%ds\n"                                           \
12                  "movw %%ax, %%fs\n"                                           \
13                  "movw %%ax, %%gs\n"                                           \
14                  "pushl %0\n"                                                  \
15                  "pushl %1\n"                                                  \
16                  "pushl %2\n"                                                  \
17                  "pushl %3\n"                                                  \
18                  "retf" ::"i"(UDATA_SEG),                                      \
19                  "r"(sp),                                                      \
20                  "i"(UCODE_SEG),                                               \
21                  "r"(pc)                                                       \
22                  : "eax", "memory");
23
24 #endif /* __LUNAIX_ABI_H */