Kernel: store/load sse/mmx/fpu state on isr/irq/syscall

I haven't tested this yet but should be fine. This will be optimized
to only save state from threads that are using it
This commit is contained in:
Bananymous
2023-07-31 22:28:57 +03:00
parent c4f6c859c1
commit b245a55ea0
3 changed files with 17 additions and 0 deletions

View File

@@ -82,6 +82,9 @@ namespace Kernel
bool is_userspace() const { return m_is_userspace; }
void save_sse() { asm volatile("fxsave %0" :: "m"(m_sse_storage)); }
void load_sse() { asm volatile("fxrstor %0" :: "m"(m_sse_storage)); }
private:
Thread(pid_t tid, Process*);
void on_exit();
@@ -111,6 +114,8 @@ namespace Kernel
uint64_t m_terminate_blockers { 0 };
alignas(16) uint8_t m_sse_storage[512];
friend class TerminateBlocker;
friend class Scheduler;
};