From 6afe5426242576e5af531365cafef0098b149b6d Mon Sep 17 00:00:00 2001 From: Ola Borgelin Date: Thu, 9 Jun 2011 11:36:08 +0200 Subject: Riff stabilty fixes Add support for files larger than 4 GB and improve stability. --- riff/ProcessRawImage.cpp | 13 ++++++++----- riff/ProcessRawImage.h | 2 +- riff/main.cpp | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'riff') diff --git a/riff/ProcessRawImage.cpp b/riff/ProcessRawImage.cpp index a46337b..77f9715 100755 --- a/riff/ProcessRawImage.cpp +++ b/riff/ProcessRawImage.cpp @@ -22,6 +22,7 @@ #include #include #include "LCDriver.h" + using namespace flash; ProcessRawImage::ProcessRawImage(const char* path, uint64 start, int useBulk, int deleteBuffers): @@ -36,8 +37,9 @@ ProcessRawImage::ProcessRawImage(const char* path, uint64 start, int useBulk, in int ProcessRawImage::run(DUT* dut) { - logger_.log(Logger::PROGRESS, "Flashing raw image..."); + logger_.log(Logger::PROGRESS, "Flashing raw image..."); uint64 length = filesize(pchPath); + logger_.log(Logger::PROGRESS, "Filesize: %lld", length); int error = 0; if (length != 0) { @@ -60,13 +62,14 @@ int ProcessRawImage::run(DUT* dut) return error; } -size_t ProcessRawImage::filesize(const char* filename) +uint64 ProcessRawImage::filesize(const char* filename) { - struct stat st; + struct stat64 st; - if (stat(filename, &st) == 0) + if (stat64(filename, &st) == 0) + { return st.st_size; - + } return 0; } diff --git a/riff/ProcessRawImage.h b/riff/ProcessRawImage.h index b429b88..7042e17 100755 --- a/riff/ProcessRawImage.h +++ b/riff/ProcessRawImage.h @@ -49,7 +49,7 @@ public: private: Logger logger_; - size_t filesize(const char* filename); + uint64 filesize(const char* filename); const char* pchPath; uint64 uiStart; uint32 uiDevice; diff --git a/riff/main.cpp b/riff/main.cpp index 076a65f..5ce8e65 100755 --- a/riff/main.cpp +++ b/riff/main.cpp @@ -26,11 +26,11 @@ #include using namespace std; -bool isDone = false; +volatile bool isDone = false; const string info = \ "\n \ ----------------------- riff - Raw Image File Flasher -------------------------\n \ -Version: 0.4.1\n \ +Version: 0.4.2\n \ " "Flash a device. Try `riff --help' for more information. \n \ " -- cgit v1.2.3