1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

Kernel: Add debug register handling

This patch adds functions to read/write from the debug registers,
and implements storing/loading them across context switches.
This commit is contained in:
FalseHonesty 2021-04-15 12:29:00 -04:00 committed by Andreas Kling
parent c84107a1ab
commit 97a4c627cb
3 changed files with 97 additions and 11 deletions

View file

@ -763,6 +763,9 @@ public:
RegisterState& get_register_dump_from_stack();
const RegisterState& get_register_dump_from_stack() const { return const_cast<Thread*>(this)->get_register_dump_from_stack(); }
DebugRegisterState& debug_register_state() { return m_debug_register_state; }
const DebugRegisterState& debug_register_state() const { return m_debug_register_state; }
TSS& tss() { return m_tss; }
const TSS& tss() const { return m_tss; }
State state() const { return m_state; }
@ -1200,6 +1203,7 @@ private:
NonnullRefPtr<Process> m_process;
ThreadID m_tid { -1 };
TSS m_tss {};
DebugRegisterState m_debug_register_state {};
TrapFrame* m_current_trap { nullptr };
u32 m_saved_critical { 1 };
IntrusiveListNode<Thread> m_ready_queue_node;