summaryrefslogtreecommitdiffstats
path: root/arch/x86_64/lgdt.s
blob: ccafe420cb7970fc51b76b68aad41ed68a3a4be6 (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
.global gdt_load
.type gdt_load @function
gdt_load:
    lgdt (%rdi)
.reload_segments:
    pushq $0x8
    leaq .reload_cs(%rip), %rax
    pushq %rax
    retfq
.reload_cs:
    movw $0x10, %ax
    movw %ax, %ds
    movw %ax, %es
    movw %ax, %fs
    movw %ax, %gs
    movw %ax, %ss
    retq
.size gdt_load, . - gdt_load

.global tss_flush
.type tss_flush @function
tss_flush:
    ltr %di
    retq
.size tss_flush, . - tss_flush