[new uImage] Add memmove_wd() common routine
Move common, watchdog sensible memmove code to a helper memmmove_wd() routine.
Signed-off-by: Marian Balakowicz <m8@semihalf.com>
diff --git a/lib_ppc/ppc_linux.c b/lib_ppc/ppc_linux.c
index 671673f..6e2afed 100644
--- a/lib_ppc/ppc_linux.c
+++ b/lib_ppc/ppc_linux.c
@@ -426,24 +426,10 @@
initrd_end = initrd_start + len;
printf (" Loading Ramdisk to %08lx, end %08lx ... ",
initrd_start, initrd_end);
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
- {
- size_t l = len;
- void *to = (void *)initrd_start;
- void *from = (void *)data;
+
+ memmove_wd((void *)initrd_start,
+ (void *)data, len, CHUNKSZ);
- while (l > 0) {
- size_t tail = (l > CHUNKSZ) ? CHUNKSZ : l;
- WATCHDOG_RESET();
- memmove (to, from, tail);
- to += tail;
- from += tail;
- l -= tail;
- }
- }
-#else /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */
- memmove ((void *)initrd_start, (void *)data, len);
-#endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
puts ("OK\n");
}
} else {