1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include "tasking.h" __attribute__((noreturn)) void umode_enter(void *ip, void *sp) { __asm__ volatile("mov %0, %%rsp; \ push %%rcx; \ mov %1, %%rcx; \ mov $0x202, %%r11; \ cli; \ swapgs; \ sysretq":: "r"(sp), "r"(ip): "memory"); for(;;); }