diff --git a/src/xenia/kernel/objects/xthread.cc b/src/xenia/kernel/objects/xthread.cc index 6192a3456..702e3a36a 100644 --- a/src/xenia/kernel/objects/xthread.cc +++ b/src/xenia/kernel/objects/xthread.cc @@ -191,7 +191,10 @@ X_STATUS XThread::Create() { } // Allocate both the slots and the extended data. - uint32_t tls_slot_size = tls_slots * 4; + // HACK: we're currently not using the extra memory allocated for TLS slots + // and instead relying on native TLS slots, so don't allocate anything for + // the slots. + uint32_t tls_slot_size = 0; // tls_slots * 4; uint32_t tls_total_size = tls_slot_size + tls_extended_size; tls_address_ = memory()->SystemHeapAlloc(tls_total_size); if (!tls_address_) { @@ -205,8 +208,7 @@ X_STATUS XThread::Create() { // If game has extended data, copy in the default values. const xe_xex2_header_t* header = module->xex_header(); assert_not_zero(header->tls_info.raw_data_address); - // TODO(benvanik): verify location relative to slots. - memory()->Copy(tls_address_ + tls_slot_size, + memory()->Copy(tls_address_, header->tls_info.raw_data_address, header->tls_info.raw_data_size); }