Potentially fix a double page fault issue under certain conditions
This commit is contained in:
parent
02f3d04f4f
commit
d30dad4797
|
@ -232,13 +232,16 @@ 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 mut writable = true;
|
let mut writable = 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(address)).unwrap();
|
||||||
|
ok = false;
|
||||||
(0, false)
|
(0, false)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ok {
|
||||||
if writable {
|
if writable {
|
||||||
let address = address as usize;
|
let address = address as usize;
|
||||||
|
|
||||||
|
@ -258,6 +261,7 @@ impl Memory {
|
||||||
self.exception_sender().send(Exception::PageFaultWrite(address)).unwrap();
|
self.exception_sender().send(Exception::PageFaultWrite(address)).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
pub fn write_16(&mut self, address: u32, half: u16) {
|
pub fn write_16(&mut self, address: u32, half: u16) {
|
||||||
self.write_8(address, (half & 0x00FF) as u8);
|
self.write_8(address, (half & 0x00FF) as u8);
|
||||||
self.write_8(address + 1, (half >> 8) as u8);
|
self.write_8(address + 1, (half >> 8) as u8);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user