diff options
author | Simon Glass | 2021-09-25 07:03:17 -0600 |
---|---|---|
committer | Tom Rini | 2021-10-08 15:53:26 -0400 |
commit | 5d3248a688c2368be54aaa9407be30adfa994abc (patch) | |
tree | 5f91893da368e86ff51ec69efdf42f849e2b01eb /common/image.c | |
parent | 3d2a47f11c1e77e79aa4f04dc787b25054822267 (diff) |
image: Split host code out into its own file
To avoid having #ifdefs in a few functions which are completely different
in the board and host code, create a new image-host.c file.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/image.c')
-rw-r--r-- | common/image.c | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/common/image.c b/common/image.c index ed7f188b591..3eb6a7fca1d 100644 --- a/common/image.c +++ b/common/image.c @@ -18,8 +18,6 @@ #include <status_led.h> #endif -#include <rtc.h> - #if IMAGE_ENABLE_FIT || IMAGE_ENABLE_OF_LIBFDT #include <linux/libfdt.h> #include <fdt_support.h> @@ -60,6 +58,7 @@ DECLARE_GLOBAL_DATA_PTR; #include <abuf.h> #include <bzlib.h> +#include <display_options.h> #include <gzip.h> #include <image.h> #include <lz4.h> @@ -528,41 +527,6 @@ int image_decomp(int comp, ulong load, ulong image_start, int type, return 0; } -#ifdef USE_HOSTCC -void memmove_wd(void *to, void *from, size_t len, ulong chunksz) -{ - memmove(to, from, len); -} -#endif /* !USE_HOSTCC */ - -void genimg_print_size(uint32_t size) -{ -#ifndef USE_HOSTCC - printf("%d Bytes = ", size); - print_size(size, "\n"); -#else - printf("%d Bytes = %.2f KiB = %.2f MiB\n", - size, (double)size / 1.024e3, - (double)size / 1.048576e6); -#endif -} - -#if IMAGE_ENABLE_TIMESTAMP -void genimg_print_time(time_t timestamp) -{ -#ifndef USE_HOSTCC - struct rtc_time tm; - - rtc_to_tm(timestamp, &tm); - printf("%4d-%02d-%02d %2d:%02d:%02d UTC\n", - tm.tm_year, tm.tm_mon, tm.tm_mday, - tm.tm_hour, tm.tm_min, tm.tm_sec); -#else - printf("%s", ctime(×tamp)); -#endif -} -#endif - const table_entry_t *get_table_entry(const table_entry_t *table, int id) { for (; table->id >= 0; ++table) { |