Re: [hatari-devel] Cycle exact setting affects nf_scsidrv |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Cycle exact setting affects nf_scsidrv
- From: Uwe Seimet <Uwe.Seimet@xxxxxxxxx>
- Date: Thu, 11 Oct 2018 23:25:01 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1539293101; s=strato-dkim-0002; d=seimet.de; h=In-Reply-To:References:Message-ID:Subject:To:From:Date: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=qiWBYmeXe5sBC/SNJrR6tJwuH95jcgAGU7wTAokF5F8=; b=ZLRVP74RkFouB2N/fJ3i+L+RMCux1D1yJN0dDC6zqf6JQ9uEHOhWYJnIcfCm4KEF4H U61IMWiZ3LqoRGBQHiQRKwA3XRRwinEOjL2RFKENAKobcuzQ6YQoXn9Z1PB8JjjpSOGD ZemDcDrZru24UHm/4sLeNU+itthBXMOM3cDgZWLRIjLSJGRu57Osd/Oafzjr2VJdO15U qe/2L+12Gt56+bIVvZf5gnLQtcOQXI0XzDZtNhlhf/NXS+IW0VLR7I8w2+aB+OwHmdk0 AlqoL/YByuWt7Fpsqpvpghm7xkPRNJ6iL4+UWd8GhNJnz+D3pEhBeY6Q1bf+RhOK72nN JU1Q==
Hi,
> Is st_buffer data something that could be program code read from
> the SCSI disk? If yes, all caches would need to be flushed for that.
Yes, you are probably right. Just checked that I'm also flushing both in
HDDRIVER. One more updated patch attached. The sense data buffer and
the buffer for the bus name do not need flushing the instruction cache
because you cannot transfer program code this way.
Best regards
Uwe
diff -r e87617b4fe45 src/nf_scsidrv.c
--- a/src/nf_scsidrv.c Thu Oct 11 18:30:37 2018 +0200
+++ b/src/nf_scsidrv.c Thu Oct 11 23:23:59 2018 +0200
@@ -28,6 +28,7 @@
#include "stMemory.h"
#include "log.h"
#include "gemdos_defines.h"
+#include "m68000.h"
#include "nf_scsidrv.h"
// The driver interface version, 1.02
@@ -173,11 +174,13 @@
static int scsidrv_interface_features(Uint32 stack)
{
+ Uint32 st_bus_name = STMemory_ReadLong(stack);
char *busName = read_stack_pointer(&stack);
Uint32 features = read_stack_long(&stack);
Uint32 transferLen = read_stack_long(&stack);
strncpy(busName, BUS_NAME, 20);
+ M68000_Flush_Data_Cache(st_bus_name, 20);
write_word(features, BUS_FEATURES);
write_long(transferLen, BUS_TRANSFER_LEN);
@@ -288,8 +291,10 @@
Uint32 dir = read_stack_long(&stack);
unsigned char *cmd = read_stack_pointer(&stack);
Uint32 cmd_len = read_stack_long(&stack);
+ Uint32 st_buffer = STMemory_ReadLong(stack);
unsigned char *buffer = read_stack_pointer(&stack);
Uint32 transfer_len = read_stack_long(&stack);
+ Uint32 st_sense_buffer = STMemory_ReadLong(stack);
unsigned char *sense_buffer = read_stack_pointer(&stack);
Uint32 timeout;
int status;
@@ -331,6 +336,7 @@
// Sense Key and ASC
sense_buffer[2] = 0x05;
sense_buffer[12] = 0x25;
+ M68000_Flush_Data_Cache(st_sense_buffer, 18);
LOG_TRACE(TRACE_SCSIDRV,
"\n Sense Key=$%02X, ASC=$%02X, ASCQ=$00",
@@ -415,7 +421,13 @@
}
}
- return status;
+ M68000_Flush_Data_Cache(st_sense_buffer, 18);
+ if (!dir)
+ {
+ M68000_Flush_All_Caches(st_buffer, transfer_len);
+ }
+
+ return status;
}
// SCSI Driver: Error()