Page sanity checks are now done in mem_invalidate_range(), should fix a few NCR 810-related segmentation faults;

Machines with 808x CPU's now have the pages array assigned for a 2 MB memory space, needed for the Toshiba T1200 which can take up to 2 MB of RAM.
This commit is contained in:
OBattler
2018-10-15 22:58:15 +02:00
parent 7134ced4b6
commit 2621d21b00

View File

@@ -12,7 +12,7 @@
* the DYNAMIC_TABLES=1 enables this. Will eventually go
* away, either way...
*
* Version: @(#)mem.c 1.0.15 2018/10/06
* Version: @(#)mem.c 1.0.16 2018/10/15
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -1305,13 +1305,18 @@ mem_write_nulll(uint32_t addr, uint32_t val, void *p)
void
mem_invalidate_range(uint32_t start_addr, uint32_t end_addr)
{
uint32_t cur_addr;
start_addr &= ~PAGE_MASK_MASK;
end_addr = (end_addr + PAGE_MASK_MASK) & ~PAGE_MASK_MASK;
for (; start_addr <= end_addr; start_addr += (1 << PAGE_MASK_SHIFT)) {
uint64_t mask = (uint64_t)1 << ((start_addr >> PAGE_MASK_SHIFT) & PAGE_MASK_MASK);
/* Do nothing if the pages array is empty or DMA reads/writes to/from PCI device memory addresses
may crash the emulator. */
cur_addr = (start_addr >> 12);
if (cur_addr < pages_sz)
pages[cur_addr].dirty_mask[(start_addr >> PAGE_MASK_INDEX_SHIFT) & PAGE_MASK_INDEX_MASK] |= mask;
}
}
@@ -1718,7 +1723,8 @@ mem_reset(void)
m = 4096;
}
} else {
/* 8088/86; maximum address space is 1MB. */
/* 8088/86; maximum address space is 1MB. */
/* m = 256; */
m = 512; /* This is to accomodate the T1200 which can take up to 2 MB of RAM. */
}