kernel: Improvements to process cleanup. (#6680)
* kernel: Properly clean up process threads on exit. * kernel: Track process-owned memory and free on destruction. * apt: Implement DoApplicationJump via home menu when available. * kernel: Move TLS allocation management to owning process.
This commit is contained in:
@ -217,6 +217,8 @@ public:
|
||||
u32 memory_used = 0;
|
||||
|
||||
std::shared_ptr<MemoryRegionInfo> memory_region = nullptr;
|
||||
MemoryRegionInfo::IntervalSet holding_memory;
|
||||
MemoryRegionInfo::IntervalSet holding_tls_memory;
|
||||
|
||||
/// The Thread Local Storage area is allocated as processes create threads,
|
||||
/// each TLS area is 0x200 bytes, so one page (0x1000) is split up in 8 parts, and each part
|
||||
@ -237,12 +239,16 @@ public:
|
||||
ResultVal<VAddr> LinearAllocate(VAddr target, u32 size, VMAPermission perms);
|
||||
ResultCode LinearFree(VAddr target, u32 size);
|
||||
|
||||
ResultVal<VAddr> AllocateThreadLocalStorage();
|
||||
|
||||
ResultCode Map(VAddr target, VAddr source, u32 size, VMAPermission perms,
|
||||
bool privileged = false);
|
||||
ResultCode Unmap(VAddr target, VAddr source, u32 size, VMAPermission perms,
|
||||
bool privileged = false);
|
||||
|
||||
private:
|
||||
void FreeAllMemory();
|
||||
|
||||
KernelSystem& kernel;
|
||||
|
||||
friend class boost::serialization::access;
|
||||
|
Reference in New Issue
Block a user