mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-21 02:15:07 -04:00
kern: SvcUnmapPhysicalMemory, cleanup thread pinning
This commit is contained in:
parent
cbecda2a27
commit
1b9acc4a6a
10 changed files with 248 additions and 24 deletions
|
@ -30,6 +30,7 @@ namespace ams::kern {
|
|||
KInterruptTaskManager *interrupt_task_manager;
|
||||
s32 core_id;
|
||||
void *exception_stack_top;
|
||||
ams::svc::ThreadLocalRegion *tlr;
|
||||
};
|
||||
static_assert(std::is_standard_layout<KCurrentContext>::value && std::is_trivially_destructible<KCurrentContext>::value);
|
||||
static_assert(sizeof(KCurrentContext) <= cpu::DataCacheLineSize);
|
||||
|
@ -80,6 +81,10 @@ namespace ams::kern {
|
|||
return impl::GetCurrentContext().core_id;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE ams::svc::ThreadLocalRegion *GetCurrentThreadLocalRegion() {
|
||||
return impl::GetCurrentContext().tlr;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void SetCurrentThread(KThread *new_thread) {
|
||||
impl::GetCurrentContext().current_thread = new_thread;
|
||||
}
|
||||
|
@ -88,4 +93,8 @@ namespace ams::kern {
|
|||
impl::GetCurrentContext().current_process = new_process;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void SetCurrentThreadLocalRegion(void *address) {
|
||||
impl::GetCurrentContext().tlr = static_cast<ams::svc::ThreadLocalRegion *>(address);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue