mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-21 10:25:08 -04:00
kern: implement much of KScheduler, KHardwareTimer
This commit is contained in:
parent
5e4307046a
commit
62de3322ff
19 changed files with 972 additions and 72 deletions
|
@ -24,8 +24,8 @@ namespace ams::kern {
|
|||
class KInterruptTaskManager;
|
||||
|
||||
struct KCurrentContext {
|
||||
KThread *current_thread;
|
||||
KProcess *current_process;
|
||||
std::atomic<KThread *> current_thread;
|
||||
std::atomic<KProcess *> current_process;
|
||||
KScheduler *scheduler;
|
||||
KInterruptTaskManager *interrupt_task_manager;
|
||||
s32 core_id;
|
||||
|
@ -43,7 +43,7 @@ namespace ams::kern {
|
|||
}
|
||||
|
||||
ALWAYS_INLINE KThread *GetCurrentThreadPointer() {
|
||||
return impl::GetCurrentContext().current_thread;
|
||||
return impl::GetCurrentContext().current_thread.load(std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE KThread &GetCurrentThread() {
|
||||
|
@ -51,7 +51,7 @@ namespace ams::kern {
|
|||
}
|
||||
|
||||
ALWAYS_INLINE KProcess *GetCurrentProcessPointer() {
|
||||
return impl::GetCurrentContext().current_process;
|
||||
return impl::GetCurrentContext().current_process.load(std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
ALWAYS_INLINE KProcess &GetCurrentProcess() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue