summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1f6718d)
raw | patch | inline | side by side (parent: 1f6718d)
author | unknown <a0216664@.dhcp.itg.ti.com> | |
Fri, 1 Oct 2010 12:15:25 +0000 (08:15 -0400) | ||
committer | unknown <a0216664@.dhcp.itg.ti.com> | |
Fri, 1 Oct 2010 12:15:25 +0000 (08:15 -0400) |
On fseek to an earlier file location, the tftp client will complete
reading of the current file, and then re-request the file from the server.
This allows loading of elf files created by TI tools which put the
program header table after the segment information.
reading of the current file, and then re-request the file from the server.
This allows loading of elf files created by TI tools which put the
program header table after the segment information.
src/driver/eth/net.c | patch | blob | history | |
src/main/iblmain.c | patch | blob | history | |
src/make/ibl_c6472/ibl.cmd | patch | blob | history |
diff --git a/src/driver/eth/net.c b/src/driver/eth/net.c
index 858713b1249586cc75a1cee7233b5070a92a3282..9215bac52afe56d6e6649109dadf8781f4c1142c 100644 (file)
--- a/src/driver/eth/net.c
+++ b/src/driver/eth/net.c
return (net_read_peek (ptr_buf, num_bytes, NET_PEEK));
}
+
+/**
+ * @b Description
+ * Read data until the transfer is done
+ */
+#define MIN(a,b) ((a) < (b)) ? (a) : (b)
+void net_complete_transfer (void)
+{
+ Int32 dataSize;
+ Int32 n;
+ uint8 buf[16];
+
+ do {
+
+ dataSize = stream_level();
+
+ if (dataSize > 0) {
+
+ while (dataSize > 0) {
+
+ n = MIN(dataSize, sizeof(buf));
+ net_read (buf, n);
+ dataSize = dataSize - n;
+ }
+
+ } else if (dataSize == 0) {
+
+ net_peek (buf, 1);
+
+ }
+
+ } while (dataSize >= 0);
+
+}
+
+
+
+
/**
* @b Description
* @n
if (desiredPos == netmcb.fileOffset)
return (0);
- /* Check for an invalid position */
- if (desiredPos < netmcb.fileOffset)
- return (-1);
+ /* To seek backwords the current tftp transfer is completed,
+ * and then restarted */
+ if (desiredPos < netmcb.fileOffset) {
+
+ /* Complete the transfer */
+ net_complete_transfer ();
+
+ /* Reset the current file offset */
+ netmcb.fileOffset = 0;
+
+ /* Re-request the data file */
+ tftp_get_file (netmcb.net_device.server_ip, netmcb.net_device.file_name);
+
+ }
+
/* Read data from the file until the file position matches the desired one */
num_bytes = desiredPos - netmcb.fileOffset;
diff --git a/src/main/iblmain.c b/src/main/iblmain.c
index c271ef15eef3c8137289ca40a03d8db67515d7d1..c0fb4ce3c08230ca8bc3f400a5c7c28f27f73934 100644 (file)
--- a/src/main/iblmain.c
+++ b/src/main/iblmain.c
@@ -248,11 +248,9 @@ Uint32 iblBoot (BOOT_MODULE_FXN_TABLE *bootFxn, Int32 dataFormat, void *formatPa
iblBootBlob (bootFxn, &entry, formatParams);
break;
-#if 0
case ibl_BOOT_FORMAT_ELF:
iblBootElf (bootFxn, &entry);
break;
-#endif
default:
iblStatus.invalidDataFormatSpec += 1;
index 9458c4eafde07d1202d495b5509d1fb2d0eaa858..d94b8de7617cc3f7b3ba6c8dadb2dd39b07a3b4d 100644 (file)
../interp/c64x/make/gem.oc
../interp/c64x/make/blob.oc
-/*
../interp/c64x/make/dload.oc
../interp/c64x/make/elfwrap.oc
../interp/c64x/make/dlw_client.oc
../interp/c64x/make/dload_endian.oc
../interp/c64x/make/ArrayList.oc
-*/
../ecc/c64x/make/3byte_ecc.oc