From a29bdb9dd0b9e5866865f8ba13c87fe96fa9112b Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Sun, 3 Mar 2024 22:15:23 +0200 Subject: [PATCH] Add AC flag initialization to thread context --- tasking/thread.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasking/thread.cpp b/tasking/thread.cpp index aa46f7f..2a3a468 100644 --- a/tasking/thread.cpp +++ b/tasking/thread.cpp @@ -472,6 +472,7 @@ namespace Tasking this->Registers.rflags.AlwaysOne = 1; this->Registers.rflags.IF = 1; this->Registers.rflags.ID = 1; + this->Registers.rflags.AC = 0; this->Registers.rsp = ((uintptr_t)this->Stack->GetStackTop()); POKE(uintptr_t, this->Registers.rsp) = (uintptr_t)ThreadDoExit; #elif defined(a32) @@ -480,6 +481,7 @@ namespace Tasking this->Registers.eflags.AlwaysOne = 1; this->Registers.eflags.IF = 1; this->Registers.eflags.ID = 1; + this->Registers.eflags.AC = 0; this->Registers.esp = ((uintptr_t)this->Stack->GetStackTop()); POKE(uintptr_t, this->Registers.esp) = (uintptr_t)ThreadDoExit; #elif defined(aa64) @@ -512,6 +514,7 @@ namespace Tasking this->Registers.rflags.AlwaysOne = 1; this->Registers.rflags.IF = 1; this->Registers.rflags.ID = 1; + this->Registers.rflags.AC = 0; /* We need to leave the libc's crt to make a syscall when the Thread is exited or we are going to get @@ -524,6 +527,7 @@ namespace Tasking this->Registers.eflags.AlwaysOne = 1; this->Registers.eflags.IF = 1; this->Registers.eflags.ID = 1; + this->Registers.eflags.AC = 0; /* We need to leave the libc's crt to make a syscall when the Thread is exited or we are going to get