sched: implement user-configurable fs and gs segment base addresses
This commit is contained in:
@@ -13,6 +13,22 @@ ml_thread_switch:
|
||||
push %rax
|
||||
push %rcx
|
||||
push %rdx
|
||||
|
||||
// set fs-base
|
||||
mov $0xC0000100, %rcx
|
||||
movq THREAD_fsbase(%rsi), %rax
|
||||
movq THREAD_fsbase(%rsi), %rdx
|
||||
shr $32, %rdx
|
||||
wrmsr
|
||||
|
||||
// set (kernel) gs-base (it will be swapped back into user-gs-base at
|
||||
// the end of this function)
|
||||
mov $0xC0000102, %rcx
|
||||
movq THREAD_gsbase(%rsi), %rax
|
||||
movq THREAD_gsbase(%rsi), %rdx
|
||||
shr $32, %rdx
|
||||
wrmsr
|
||||
|
||||
push %rbx
|
||||
pushq $0
|
||||
push %rbp
|
||||
|
||||
Reference in New Issue
Block a user