fix bug in the calculation of esp0

This commit is contained in:
Stefan Lankes 2012-07-14 11:16:29 +02:00
parent 6259892c00
commit 3c1b270160

View file

@ -799,8 +799,14 @@ common_switch:
xor eax, eax
%endif
add eax, task_state_segments
; set esp0 in TSS
mov [eax+4], esp
; determine and set esp0 in TSS
mov ebx, esp
mov ecx, KERNEL_STACK_SIZE-1
not ecx
and ebx, ecx
add ebx, KERNEL_STACK_SIZE-16
mov [eax+4], ebx
; call cleanup code
call finish_task_switch