Replacing vfs memory mapping with base memory mapping.
Progress on #294.
This commit is contained in:
@@ -180,13 +180,15 @@ void KernelState::SetExecutableModule(object_ref<XUserModule> module) {
|
||||
}
|
||||
executable_module_ = std::move(module);
|
||||
|
||||
auto header = executable_module_->xex_header();
|
||||
if (header) {
|
||||
auto pib = memory_->TranslateVirtual<ProcessInfoBlock*>(
|
||||
process_info_block_address_);
|
||||
pib->tls_data_size = header->tls_info.data_size;
|
||||
pib->tls_raw_data_size = header->tls_info.raw_data_size;
|
||||
pib->tls_slot_size = header->tls_info.slot_count * 4;
|
||||
if (executable_module_) {
|
||||
auto header = executable_module_->xex_header();
|
||||
if (header) {
|
||||
auto pib = memory_->TranslateVirtual<ProcessInfoBlock*>(
|
||||
process_info_block_address_);
|
||||
pib->tls_data_size = header->tls_info.data_size;
|
||||
pib->tls_raw_data_size = header->tls_info.raw_data_size;
|
||||
pib->tls_slot_size = header->tls_info.slot_count * 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,13 +51,13 @@ X_STATUS XUserModule::LoadFromFile(std::string path) {
|
||||
// If the FS supports mapping, map the file in and load from that.
|
||||
if (fs_entry->can_map()) {
|
||||
// Map.
|
||||
auto mmap = fs_entry->CreateMemoryMapping(vfs::Mode::READ, 0, 0);
|
||||
auto mmap = fs_entry->OpenMapped(MappedMemory::Mode::kRead);
|
||||
if (!mmap) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// Load the module.
|
||||
result = LoadFromMemory(mmap->address(), mmap->length());
|
||||
result = LoadFromMemory(mmap->data(), mmap->size());
|
||||
} else {
|
||||
X_FILE_NETWORK_OPEN_INFORMATION file_info = {0};
|
||||
result = fs_entry->QueryInfo(&file_info);
|
||||
|
||||
@@ -976,7 +976,7 @@ int xe_xex2_find_import_infos(xe_xex2_ref xex,
|
||||
info->thunk_address = record;
|
||||
} break;
|
||||
default:
|
||||
// assert_always();
|
||||
assert_always();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user