port esp0-patch to x86_64

This commit is contained in:
Stefan Lankes 2012-07-14 12:15:01 +02:00
parent 3c1b270160
commit 1c4c51ae50

View file

@ -1146,8 +1146,14 @@ common_switch:
xor rax, rax
%endif
add rax, task_state_segments
; set rsp0 in TSS
mov [rax+4], rsp
; determine and set esp0 in TSS
mov rbx, rsp
mov rcx, KERNEL_STACK_SIZE-1
not rcx
and rbx, rcx
add rbx, KERNEL_STACK_SIZE-16
mov [rax+4], rbx
; call cleanup code
call finish_task_switch