DMA now causes page dirty mask to be updated.
This commit is contained in:
parent
68df72958c
commit
d6c177a3c0
4 changed files with 21 additions and 0 deletions
|
|
@ -246,6 +246,7 @@ uint8_t _dma_read(uint32_t addr)
|
|||
void _dma_write(uint32_t addr, uint8_t val)
|
||||
{
|
||||
mem_writeb_phys(addr, val);
|
||||
mem_invalidate_range(addr, addr);
|
||||
}
|
||||
|
||||
int dma_channel_read(int channel)
|
||||
|
|
|
|||
15
src/mem.c
15
src/mem.c
|
|
@ -1300,6 +1300,21 @@ void mem_updatecache()
|
|||
}
|
||||
}
|
||||
|
||||
void mem_invalidate_range(uint32_t start_addr, uint32_t end_addr)
|
||||
{
|
||||
#ifdef DYNAREC
|
||||
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);
|
||||
|
||||
pages[start_addr >> 12].dirty_mask |= mask;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline int mem_mapping_read_allowed(uint32_t flags, int state)
|
||||
{
|
||||
// pclog("mem_mapping_read_allowed: flags=%x state=%x\n", flags, state);
|
||||
|
|
|
|||
|
|
@ -134,3 +134,5 @@ static inline get_phys_noabrt(uint32_t addr)
|
|||
|
||||
return mmutranslate_noabrt(addr, 0) & rammask;
|
||||
}
|
||||
|
||||
void mem_invalidate_range(uint32_t start_addr, uint32_t end_addr);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include "ibm.h"
|
||||
#include "ide.h"
|
||||
#include "io.h"
|
||||
#include "mem.h"
|
||||
#include "pci.h"
|
||||
|
||||
#include "piix.h"
|
||||
|
|
@ -193,6 +194,8 @@ int piix_bus_master_sector_read(int channel, uint8_t *data)
|
|||
{
|
||||
if (piix_busmaster[channel].count < (512 - transferred) && piix_busmaster[channel].eot)
|
||||
fatal("DMA on channel %i - Read count less than 512! Addr %08X Count %04X EOT %i\n", channel, piix_busmaster[channel].addr, piix_busmaster[channel].count, piix_busmaster[channel].eot);
|
||||
|
||||
mem_invalidate_range(piix_busmaster[channel].addr, piix_busmaster[channel].addr+511);
|
||||
|
||||
if (piix_busmaster[channel].count < (512 - transferred))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue