Skip to content

Commit

Permalink
Force Simple Mapping
Browse files Browse the repository at this point in the history
Extended mapping sets the status bit indicating that it is extended on
the 63rd bit. For systems that can only access 32-bit, this won't work.
Use MappingTypeHints to use Simple for everything.
  • Loading branch information
mbrooksx committed Apr 12, 2021
1 parent 5109305 commit 5f80e02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion driver/device_buffer_mapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ util::StatusOr<DeviceBuffer> DeviceBufferMapper::Map(const Buffer& buffer,
DmaDirection direction) {
TRACE_SCOPE("DeviceBufferMapper::Map");
if (buffer.IsValid()) {
return address_space_->MapMemory(buffer, direction, MappingTypeHint::kAny);
return address_space_->MapMemory(buffer, direction, MappingTypeHint::kSimple);
}
return DeviceBuffer(); // Invalid buffer.
}
Expand Down
2 changes: 1 addition & 1 deletion driver/mmio_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ util::StatusOr<MappedDeviceBuffer> MmioDriver::DoMapBuffer(
if (buffer.IsValid()) {
ASSIGN_OR_RETURN(auto device_buffer,
address_space_->MapMemory(buffer, direction,
MappingTypeHint::kExtended));
MappingTypeHint::kSimple));
// TODO : this is dangerous: the std::bind captures a raw pointer to
// the address space. This will break if executable registry outlives
// address space in the driver. A better way is to at least use share_ptr
Expand Down

0 comments on commit 5f80e02

Please sign in to comment.