Dumping all the DDR takes significant time and there's currently no
user-visible feedback provided to indicate that even the process has
started.
Solve this by wiring up the ux module and provide a progress bar while
dumping segments, as well as information as the segments are skipped or
dumped.
Add missing ux_init() to the ramdump setup, and make sure to clamp value
to max in the progress calculation, to avoid funky issues when progress
is made beyond the size of the chunk.
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
CHECK: Macro argument reuse 'x' - possible side-effects?
+#define MIN(x, y) ((x) < (y) ? (x) : (y))
CHECK: Macro argument reuse 'y' - possible side-effects?
+#define MIN(x, y) ((x) < (y) ? (x) : (y))
CHECK: line length of 167 exceeds 120 columns
+static const char * const progress_hashes = "########################################################################################################################";
CHECK: line length of 167 exceeds 120 columns
+static const char * const progress_dashes = "------------------------------------------------------------------------------------------------------------------------";
WARNING: please, no spaces at the start of a line
+ CONSOLE_SCREEN_BUFFER_INFO csbi;$
WARNING: please, no spaces at the start of a line
+ HANDLE stdoutHandle = GetStdHandle(STD_OUTPUT_HANDLE);$
WARNING: please, no spaces at the start of a line
+ if (GetConsoleScreenBufferInfo(stdoutHandle, &csbi)) {$
WARNING: suspect code indent for conditional statements (4, 16)
+ if (GetConsoleScreenBufferInfo(stdoutHandle, &csbi)) {
+ columns = csbi.srWindow.Right - csbi.srWindow.Left + 1;
WARNING: please, no spaces at the start of a line
+ }$
Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
Address all obvious coding style issues caught by checkpatch.pl tool.
sha2.c and sha2.h were kept as there are.
Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
Make build compatible with Windows using MSYS2 MINGW64 compiler. Add a small compatibility file for functions that don't exist in MINGW64.
Signed-off-by: Julien Vanier <jvanier@gmail.com>
Not providing any user feedback during flashing is not very user
friendly, in particular when, in some situations, it can take minutes to
flash very large files.
Introduce a progress bar for the flashing and patching steps to provide
such feedback to the user, when stdout is determined to be a terminal of
sufficient size (i.e. tools programmatically invoking qdl should see no
difference).
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Rather than sprinkling the user experience decisions across the
implementation with prints to stdout, stderr, conditional checks for
qdl_debug etc, consolidate these into a single set of ux wrappers.
Transition all callers of printf() and fprintf() to these new wrappers,
without changing the level of content of the printouts.
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>