File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Userland/DevTools/UserspaceEmulator Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1432,9 +1432,10 @@ int Emulator::virt$readlink(FlatPtr params_addr)
1432
1432
1433
1433
u32 Emulator::virt$allocate_tls(FlatPtr initial_data, size_t size)
1434
1434
{
1435
- // TODO: Why is this needed? without this, the loader overflows the bounds of the TLS region.
1436
- constexpr size_t TLS_SIZE_HACK = 8 ;
1437
- auto tcb_region = make<SimpleRegion>(0x20000000 , size + TLS_SIZE_HACK);
1435
+ // TODO: This matches what Thread::make_thread_specific_region does. The kernel
1436
+ // ends up allocating one more page. Figure out if this is intentional.
1437
+ auto region_size = align_up_to (size, PAGE_SIZE) + PAGE_SIZE;
1438
+ auto tcb_region = make<SimpleRegion>(0x20000000 , region_size);
1438
1439
1439
1440
size_t offset = 0 ;
1440
1441
while (size - offset > 0 ) {
You can’t perform that action at this time.
0 commit comments