[BOOT] Huge refactor
This commit is contained in:
41
BOOT/ENVIRON/LIB/X86/ctx.S
Normal file
41
BOOT/ENVIRON/LIB/X86/ctx.S
Normal file
@@ -0,0 +1,41 @@
|
||||
.text
|
||||
|
||||
SetSegmentRegisters:
|
||||
mov 0x18(%rcx), %ds
|
||||
mov 0x1a(%rcx), %es
|
||||
mov 0x1c(%rcx), %fs
|
||||
mov 0x1e(%rcx), %gs
|
||||
mov 0x20(%rcx), %ss
|
||||
ret
|
||||
|
||||
.globl Archpx64EnableInterruptsAsm
|
||||
Archpx64EnableInterruptsAsm:
|
||||
sti
|
||||
ret
|
||||
|
||||
.globl Archpx64DisableInterruptsAsm
|
||||
Archpx64DisableInterruptsAsm:
|
||||
cli
|
||||
ret
|
||||
|
||||
.globl BlpArchGetDescriptorTableContext
|
||||
BlpArchGetDescriptorTableContext:
|
||||
sgdt 0x00(%rcx)
|
||||
sidt 0x0a(%rcx)
|
||||
sldt 0x14(%rcx)
|
||||
mov %cs, 0x16(%rcx)
|
||||
mov %ds, 0x18(%rcx)
|
||||
mov %es, 0x1a(%rcx)
|
||||
mov %fs, 0x1c(%rcx)
|
||||
mov %gs, 0x1e(%rcx)
|
||||
mov %ss, 0x20(%rcx)
|
||||
ret
|
||||
|
||||
.globl ArchSetDescriptorTableContext
|
||||
ArchSetDescriptorTableContext:
|
||||
sgdt 0x00(%rcx)
|
||||
sidt 0x0a(%rcx)
|
||||
sldt 0x14(%rcx)
|
||||
push 0x16(%rcx)
|
||||
push $SetSegmentRegisters
|
||||
lretq
|
Reference in New Issue
Block a user