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. --- CDAL/CDAL.cpp | 2 +- LICENSE | 0 README | 5 +++-- packages/control | 6 +++--- riff/ProcessRawImage.cpp | 13 ++++++++----- riff/ProcessRawImage.h | 2 +- riff/main.cpp | 4 ++-- 7 files changed, 18 insertions(+), 14 deletions(-) mode change 100644 => 100755 LICENSE diff --git a/CDAL/CDAL.cpp b/CDAL/CDAL.cpp index 24ded12..99cadf7 100755 --- a/CDAL/CDAL.cpp +++ b/CDAL/CDAL.cpp @@ -29,7 +29,7 @@ static int DUT_PRODUCT_ID = 0x8500; static libusb_context* context; static Thread* workerThread; static void* LibusbWorker(void* arg); -bool shutdown = false; +volatile bool shutdown = false; int error = 0; static EventCallback_t OnDeviceCallback = NULL; diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README b/README index 3963a4d..0a8bece 100755 --- a/README +++ b/README @@ -1,4 +1,4 @@ -riff - Raw Image File Flasher version 0.4.0 +riff - Raw Image File Flasher version 0.4.2 ================================================================================= Description: @@ -102,7 +102,8 @@ Version history and changelog: ================================================================================= 0.3.0 Initial version. 0.4.0 Dump functionality added. -0.4.1 Packaging and README updated +0.4.1 Packaging and README updated. +0.4.2 Larger image file support. ================================================================================= Contact and support diff --git a/packages/control b/packages/control index 07c35bb..8e933d5 100755 --- a/packages/control +++ b/packages/control @@ -1,9 +1,9 @@ Package: riff -Version: 0.4.0 +Version: 0.4.2 Priority: optional Architecture: all -Depends: libusb-1.0-0, riff-configpack (>= 0.4.0), riff-loadercomm (>= 0.4.0) +Depends: libusb-1.0-0, riff-configpack (>= 0.4.2), riff-loadercomm (>= 0.4.2) Installed-Size: -Maintainer: igloocommunity +Maintainer: packages@igloocommunity.org Section: devel Description: A flashing tool initially developed for igloocommunity.org and snowball devices. 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