by redalert »
Our aim is to send large data blocks such as 64GB to FPGA through Xillybus . According to our requirements, sent stream should have continuity without gaps. Our system use 64 bit Windows 7 OS. So you can consider our questions according to Windows OS. Our windows compiler settings and malloc usages are arranged according to 64 bit.
But we need to solve some problems to realize our requirement.
1) _write call cannot get buffer size over 2GB. At most, it is value can be assigned to 0x7FFFFFFF. If we set the sent write buffer size to 2GB ( 0x80000000), then write call immediately returns with -1. It seems that there is a restriction for the write call buffer size limit for 2GB. It is understandable since Windows Kernel separates 1GB at most. Can you confirm that restriction ?
2) Because of the condition about 2GB, we cannot set the "len argument" of write call buffer as 64 GB. Since len-sent will be over 2GB and write call return -1 immidiately, and send operation cannot be realized.
void allwrite(int fd, unsigned char *buf, int len) {
int sent = 0;
int rc;
while (sent < len) {
rc = _write(fd, buf + sent, len - sent);
if ((rc < 0) && (errno == EINTR))
continue;
if (rc < 0) {
perror("allwrite() failed to write");
exit(1);
}
if (rc == 0) {
fprintf(stderr, "Reached write EOF (?!)\n");
exit(1);
}
sent += rc;
}
}
(Note: we have adapted len , sent and rc arguments for 64 bit by changing types from int to size_t)
Instead of directly giving (len-sent) , we modified code to sent buffers consecutively having maximum size 0x7FFFFFFF.
But in spite of we intended to realize consecutive write calls, each write call was blocked by transmission.
During transmission, write call cannot return and we cannot feed consecutive buffer.
Hence we experienced that write calls are blocked during the time interval till completion of transmission.
That problem cause to gaps in out transmission time. We need circular buffer like driver api that provide buffer feeds during transmission time.
And consecutively sending queued buffers without any gaps.
We reviewed windows developer manual and demo apps codes. But we cannot point to the solution.
Can you inform us about this conflict. Is it possible to realize our scenario with your api.
thanks for your support.
Best Regards.