summaryrefslogtreecommitdiffstats
path: root/arch/x86_64/umode_enter.c
blob: 3c7fa186573aac5666117541df1c187be00d48da (plain) (blame)
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(;;);
}