1

fix bug where ebx was saved incorrectly on preempt

This commit is contained in:
2022-07-11 14:35:45 +02:00
parent bb0ff5104c
commit c63b960e6a

View File

@ -96,10 +96,6 @@ Thread_switch:
push eax ; backup eax before using it as index
mov eax, [esp + 0x8]
pushf ; store eflags
pop ebx
mov [eax + efl_offset], ebx
add esp, 0x4 ; store the original esp
mov [eax + esp_offset], esp
sub esp, 0x4
@ -111,6 +107,10 @@ Thread_switch:
mov [eax + ecx_offset], ecx
mov [eax + edx_offset], edx
pushf ; store eflags
pop ebx
mov [eax + efl_offset], ebx
pop ebx ; store eax
mov [eax + eax_offset], ebx
@ -128,7 +128,6 @@ Thread_switch:
mov esp, [eax + esp_offset]
mov ecx, [eax + ecx_offset]
mov edx, [eax + edx_offset]
mov eax, [eax + eax_offset] ; restore eax
;; Enable interrupts again