.intel_syntax noprefix
.global x86_64_GDT_Load
.extern gdt_pointer

.global gdt_reload
gdt_reload:
    lgdt [rip + gdt_pointer]

    push 8
    lea rax, [rip + .flush]
    push rax
    lretq

.flush:
    mov eax, 0x10
    mov ds, ax
    mov es, ax
    mov fs, ax
    mov gs, ax
    mov ss, ax
    ret

.global tss_reload
tss_reload:
    mov ax, 0x2B
    ltr ax
    ret