mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-17 19:21:30 +12:00
Move TLS to system memory for now
This commit is contained in:
parent
fe70616535
commit
7a21d93fec
1 changed files with 3 additions and 10 deletions
|
@ -34,17 +34,10 @@ void Memory::reset() {
|
||||||
writeTable[i] = 0;
|
writeTable[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Map (32 * 4) KB of FCRAM before the stack for the TLS of each thread
|
|
||||||
std::optional<u32> tlsBaseOpt = findPaddr(32 * 4_KB);
|
|
||||||
if (!tlsBaseOpt.has_value()) { // Should be unreachable but still good to have
|
|
||||||
Helpers::panic("Failed to allocate memory for thread-local storage");
|
|
||||||
}
|
|
||||||
|
|
||||||
u32 basePaddrForTLS = tlsBaseOpt.value();
|
|
||||||
for (u32 i = 0; i < appResourceLimits.maxThreads; i++) {
|
for (u32 i = 0; i < appResourceLimits.maxThreads; i++) {
|
||||||
|
u32 index = allocateSysMemory(4_KB);
|
||||||
u32 vaddr = VirtualAddrs::TLSBase + i * VirtualAddrs::TLSSize;
|
u32 vaddr = VirtualAddrs::TLSBase + i * VirtualAddrs::TLSSize;
|
||||||
allocateMemory(vaddr, basePaddrForTLS, VirtualAddrs::TLSSize, true);
|
allocateMemory(vaddr, index, VirtualAddrs::TLSSize, true, true, true, false, false, true);
|
||||||
basePaddrForTLS += VirtualAddrs::TLSSize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize shared memory blocks and reserve memory for them
|
// Initialize shared memory blocks and reserve memory for them
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue