Fix an issue where write faults sometimes return the *physical* address
This commit is contained in:
parent
d30dad4797
commit
8259e5787e
|
@ -231,11 +231,12 @@ impl Memory {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn write_8(&mut self, mut address: u32, byte: u8) {
|
pub fn write_8(&mut self, mut address: u32, byte: u8) {
|
||||||
|
let original_address = address;
|
||||||
let mut writable = true;
|
let mut writable = true;
|
||||||
let mut ok = true;
|
let mut ok = true;
|
||||||
if *self.mmu_enabled() {
|
if *self.mmu_enabled() {
|
||||||
(address, writable) = self.virtual_to_physical(address as u32).unwrap_or_else(|| {
|
(address, writable) = self.virtual_to_physical(address as u32).unwrap_or_else(|| {
|
||||||
self.exception_sender().send(Exception::PageFaultWrite(address)).unwrap();
|
self.exception_sender().send(Exception::PageFaultWrite(original_address)).unwrap();
|
||||||
ok = false;
|
ok = false;
|
||||||
(0, false)
|
(0, false)
|
||||||
});
|
});
|
||||||
|
@ -254,11 +255,11 @@ impl Memory {
|
||||||
*value = byte;
|
*value = byte;
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
self.exception_sender().send(Exception::PageFaultWrite(address as u32)).unwrap();
|
self.exception_sender().send(Exception::PageFaultWrite(original_address)).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
self.exception_sender().send(Exception::PageFaultWrite(address)).unwrap();
|
self.exception_sender().send(Exception::PageFaultWrite(original_address)).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user