瀏覽代碼

Invalidate prefetch buffer on writes

Petteri Aimonen 3 年之前
父節點
當前提交
e5a7160a81
共有 1 個文件被更改,包括 6 次插入0 次删除
  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))
         {