mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
[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>
This commit is contained in:
committed by
Wolfgang Denk
parent
958fc48abd
commit
af13cdbc01
@@ -57,6 +57,7 @@ int image_check_dcrc (image_header_t *hdr)
|
||||
return (dcrc == image_get_dcrc (hdr));
|
||||
}
|
||||
|
||||
#ifndef USE_HOSTCC
|
||||
int image_check_dcrc_wd (image_header_t *hdr, ulong chunksz)
|
||||
{
|
||||
ulong dcrc = 0;
|
||||
@@ -89,3 +90,20 @@ int getenv_verify (void)
|
||||
char *s = getenv ("verify");
|
||||
return (s && (*s == 'n')) ? 0 : 1;
|
||||
}
|
||||
|
||||
void memmove_wd (void *to, void *from, size_t len, ulong chunksz)
|
||||
{
|
||||
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
|
||||
while (len > 0) {
|
||||
size_t tail = (len > chunksz) ? chunksz : len;
|
||||
WATCHDOG_RESET ();
|
||||
memmove (to, from, tail);
|
||||
to += tail;
|
||||
from += tail;
|
||||
len -= tail;
|
||||
}
|
||||
#else /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */
|
||||
memmove (to, from, len);
|
||||
#endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
|
||||
}
|
||||
#endif /* USE_HOSTCC */
|
||||
|
Reference in New Issue
Block a user