make writes to readonly pages cause a page fault correctly
This commit is contained in:
parent
7d383cff3c
commit
072cb452e1
|
@ -453,6 +453,10 @@ static uint8_t *vm_findmemory(vm_t *vm, uint32_t address, uint32_t size, bool wr
|
||||||
vm_panic(vm, FOX32_ERR_FAULT_WR);
|
vm_panic(vm, FOX32_ERR_FAULT_WR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!virtual_page->rw && write) {
|
||||||
|
vm->exception_operand = address;
|
||||||
|
vm_panic(vm, FOX32_ERR_FAULT_WR);
|
||||||
|
}
|
||||||
uint32_t offset = address & 0x00000FFF;
|
uint32_t offset = address & 0x00000FFF;
|
||||||
uint32_t physical_address = virtual_page->physical_address | offset;
|
uint32_t physical_address = virtual_page->physical_address | offset;
|
||||||
address_end = physical_address + size;
|
address_end = physical_address + size;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
|
|
||||||
#define FOX32_CPU_HZ 10000000
|
#define FOX32_CPU_HZ 33000000
|
||||||
|
|
||||||
#define FOX32_MEMORY_RAM 0x04000000 // 64 MiB
|
#define FOX32_MEMORY_RAM 0x04000000 // 64 MiB
|
||||||
#define FOX32_MEMORY_ROM 0x00080000 // 512 KiB
|
#define FOX32_MEMORY_ROM 0x00080000 // 512 KiB
|
||||||
|
|
Loading…
Reference in New Issue
Block a user