Ver Fonte

Invalidate prefetch buffer on writes

Petteri Aimonen há 3 anos atrás
pai
commit
e5a7160a81
1 ficheiros alterados com 6 adições e 0 exclusões
  1. 6 0
      src/AzulSCSI_disk.cpp

+ 6 - 0
src/AzulSCSI_disk.cpp

@@ -484,6 +484,12 @@ static void doWrite(uint32_t lba, uint32_t blocks)
         scsiDev.dataLen = 0;
         scsiDev.dataPtr = 0;
 
+#ifdef PREFETCH_BUFFER_SIZE
+        // Invalidate prefetch buffer
+        g_scsi_prefetch.bytes = 0;
+        g_scsi_prefetch.sector = 0;
+#endif
+
         image_config_t &img = *(image_config_t*)scsiDev.target->cfg;
         if (!img.file.seek(transfer.lba * bytesPerSector))
         {