1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00

Kernel/LibCore: Expose processor id where a thread last ran

This commit is contained in:
Tom 2020-06-27 22:36:15 -06:00 committed by Andreas Kling
parent d98edb3171
commit d99901660d
Notes: sideshowbarker 2024-07-19 05:18:06 +09:00
5 changed files with 11 additions and 1 deletions

View file

@ -273,6 +273,9 @@ public:
bool in_kernel() const { return (m_tss.cs & 0x03) == 0; }
u32 cpu() const { return m_cpu.load(AK::MemoryOrder::memory_order_consume); }
void set_cpu(u32 cpu) { m_cpu.store(cpu, AK::MemoryOrder::memory_order_release); }
u32 frame_ptr() const { return m_tss.ebp; }
u32 stack_ptr() const { return m_tss.esp; }
@ -466,6 +469,7 @@ private:
int m_tid { -1 };
TSS32 m_tss;
FarPtr m_far_ptr;
Atomic<u32> m_cpu { 0 };
u32 m_ticks { 0 };
u32 m_ticks_left { 0 };
u32 m_times_scheduled { 0 };