aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/arch/x86_64/load_desc.asm
blob: df65c720868b93bc2f60ca0046ac73748803b0a5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
; GDT and IDT loading routines

section .text
global load_gdt:function
load_gdt:
    lgdt [rdi]
    ret

global reload_segments:function
reload_segments:
    ; reload cs register
    push 0x08
    lea rax, [rel .reload_cs]
    push rax
    retfq

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

global load_idt:function
load_idt:
    lidt [rdi]
    ret