aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2022-09-02 14:10:46 +0200
committerStefan Roese <sr@denx.de>2022-09-18 10:26:33 +0200
commit29caf9305b6fafe8f6d6b18fa1f825dff8686e61 (patch)
tree6530f6a2373b7af6fb4fdceca823b21f7c79ed7f /lib
parent881d4108257a45ac890ef27c523783dbe401e462 (diff)
downloadu-boot-29caf9305b6fafe8f6d6b18fa1f825dff8686e61.zip
u-boot-29caf9305b6fafe8f6d6b18fa1f825dff8686e61.tar.gz
u-boot-29caf9305b6fafe8f6d6b18fa1f825dff8686e61.tar.bz2
cyclic: Use schedule() instead of WATCHDOG_RESET()
Globally replace all occurances of WATCHDOG_RESET() with schedule(), which handles the HW_WATCHDOG functionality and the cyclic infrastructure. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Tom Rini <trini@konsulko.com> [am335x_evm, mx6cuboxi, rpi_3,dra7xx_evm, pine64_plus, am65x_evm, j721e_evm]
Diffstat (limited to 'lib')
-rw-r--r--lib/bzip2/bzlib.c2
-rw-r--r--lib/bzip2/bzlib_decompress.c8
-rw-r--r--lib/crc32.c2
-rw-r--r--lib/efi_loader/efi_boottime.c4
-rw-r--r--lib/gunzip.c2
-rw-r--r--lib/lzma/LzmaDec.c16
-rw-r--r--lib/lzma/LzmaTools.c2
-rw-r--r--lib/md5.c2
-rw-r--r--lib/sha1.c2
-rw-r--r--lib/sha256.c2
-rw-r--r--lib/sha512.c4
-rw-r--r--lib/time.c2
-rw-r--r--lib/zlib/inflate.c8
13 files changed, 28 insertions, 28 deletions
diff --git a/lib/bzip2/bzlib.c b/lib/bzip2/bzlib.c
index 377b269..bd589aa 100644
--- a/lib/bzip2/bzlib.c
+++ b/lib/bzip2/bzlib.c
@@ -844,7 +844,7 @@ int BZ_API(BZ2_bzDecompress) ( bz_stream *strm )
while (True) {
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
- WATCHDOG_RESET();
+ schedule();
#endif
if (s->state == BZ_X_IDLE) return BZ_SEQUENCE_ERROR;
if (s->state == BZ_X_OUTPUT) {
diff --git a/lib/bzip2/bzlib_decompress.c b/lib/bzip2/bzlib_decompress.c
index 4412b8a..3b417d5 100644
--- a/lib/bzip2/bzlib_decompress.c
+++ b/lib/bzip2/bzlib_decompress.c
@@ -418,7 +418,7 @@ Int32 BZ2_decompress ( DState* s )
while (True) {
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
- WATCHDOG_RESET();
+ schedule();
#endif
if (nextSym == EOB) break;
@@ -503,7 +503,7 @@ Int32 BZ2_decompress ( DState* s )
kk = MTFA_SIZE-1;
for (ii = 256 / MTFL_SIZE-1; ii >= 0; ii--) {
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
- WATCHDOG_RESET();
+ schedule();
#endif
for (jj = MTFL_SIZE-1; jj >= 0; jj--) {
s->mtfa[kk] = s->mtfa[s->mtfbase[ii] + jj];
@@ -568,7 +568,7 @@ Int32 BZ2_decompress ( DState* s )
while (i != s->origPtr);
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
- WATCHDOG_RESET();
+ schedule();
#endif
s->tPos = s->origPtr;
s->nblock_used = 0;
@@ -583,7 +583,7 @@ Int32 BZ2_decompress ( DState* s )
} else {
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
- WATCHDOG_RESET();
+ schedule();
#endif
/*-- compute the T^(-1) vector --*/
for (i = 0; i < nblock; i++) {
diff --git a/lib/crc32.c b/lib/crc32.c
index 5a3127e..aa94d70 100644
--- a/lib/crc32.c
+++ b/lib/crc32.c
@@ -255,7 +255,7 @@ uint32_t crc32_wd(uint32_t crc, const unsigned char *buf, uInt len,
chunk = chunk_sz;
crc = crc32(crc, curr, chunk);
curr += chunk;
- WATCHDOG_RESET ();
+ schedule();
}
#else
crc = crc32(crc, buf, len);
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 1233418..8da3bb2 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -828,7 +828,7 @@ void efi_timer_check(void)
efi_signal_event(evt);
}
efi_process_event_queue();
- WATCHDOG_RESET();
+ schedule();
}
/**
@@ -2193,7 +2193,7 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
/* Give the payload some time to boot */
efi_set_watchdog(0);
- WATCHDOG_RESET();
+ schedule();
out:
if (IS_ENABLED(CONFIG_EFI_TCG2_PROTOCOL)) {
if (ret != EFI_SUCCESS)
diff --git a/lib/gunzip.c b/lib/gunzip.c
index a8e498d..932e3e8 100644
--- a/lib/gunzip.c
+++ b/lib/gunzip.c
@@ -251,7 +251,7 @@ int gzwrite(unsigned char *src, int len,
puts("abort\n");
goto out;
}
- WATCHDOG_RESET();
+ schedule();
} while (s.avail_out == 0);
/* done when inflate() says it's done */
} while (r != Z_STREAM_END);
diff --git a/lib/lzma/LzmaDec.c b/lib/lzma/LzmaDec.c
index 4f45f80..341149f 100644
--- a/lib/lzma/LzmaDec.c
+++ b/lib/lzma/LzmaDec.c
@@ -153,7 +153,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
UInt32 range = p->range;
UInt32 code = p->code;
- WATCHDOG_RESET();
+ schedule();
do
{
@@ -177,7 +177,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
state -= (state < 4) ? state : 3;
symbol = 1;
- WATCHDOG_RESET();
+ schedule();
do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100);
}
@@ -188,7 +188,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
state -= (state < 10) ? 3 : 6;
symbol = 1;
- WATCHDOG_RESET();
+ schedule();
do
{
@@ -321,7 +321,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
UInt32 mask = 1;
unsigned i = 1;
- WATCHDOG_RESET();
+ schedule();
do
{
@@ -335,7 +335,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
{
numDirectBits -= kNumAlignBits;
- WATCHDOG_RESET();
+ schedule();
do
{
@@ -409,7 +409,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
const Byte *lim = dest + curLen;
dicPos += curLen;
- WATCHDOG_RESET();
+ schedule();
do
*(dest) = (Byte)*(dest + src);
@@ -418,7 +418,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
else
{
- WATCHDOG_RESET();
+ schedule();
do
{
@@ -433,7 +433,7 @@ static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte
}
while (dicPos < limit && buf < bufLimit);
- WATCHDOG_RESET();
+ schedule();
NORMALIZE;
p->buf = buf;
diff --git a/lib/lzma/LzmaTools.c b/lib/lzma/LzmaTools.c
index af88900..55f64cd 100644
--- a/lib/lzma/LzmaTools.c
+++ b/lib/lzma/LzmaTools.c
@@ -104,7 +104,7 @@ int lzmaBuffToBuffDecompress(unsigned char *outStream, SizeT *uncompressedSize,
/* Decompress */
outProcessed = min(outSizeFull, *uncompressedSize);
- WATCHDOG_RESET();
+ schedule();
res = LzmaDecode(
outStream, &outProcessed,
diff --git a/lib/md5.c b/lib/md5.c
index 9d34465..1636ab9 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -304,7 +304,7 @@ md5_wd(const unsigned char *input, unsigned int len, unsigned char output[16],
chunk = chunk_sz;
MD5Update(&context, curr, chunk);
curr += chunk;
- WATCHDOG_RESET ();
+ schedule();
}
#else
MD5Update(&context, input, len);
diff --git a/lib/sha1.c b/lib/sha1.c
index e5e42bc..8d07407 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -344,7 +344,7 @@ void sha1_csum_wd(const unsigned char *input, unsigned int ilen,
chunk = chunk_sz;
sha1_update (&ctx, curr, chunk);
curr += chunk;
- WATCHDOG_RESET ();
+ schedule();
}
#else
sha1_update (&ctx, input, ilen);
diff --git a/lib/sha256.c b/lib/sha256.c
index 50b0b51..4d26aea 100644
--- a/lib/sha256.c
+++ b/lib/sha256.c
@@ -293,7 +293,7 @@ void sha256_csum_wd(const unsigned char *input, unsigned int ilen,
chunk = chunk_sz;
sha256_update(&ctx, curr, chunk);
curr += chunk;
- WATCHDOG_RESET();
+ schedule();
}
#else
sha256_update(&ctx, input, ilen);
diff --git a/lib/sha512.c b/lib/sha512.c
index a421f24..fbe8d5f 100644
--- a/lib/sha512.c
+++ b/lib/sha512.c
@@ -309,7 +309,7 @@ void sha384_csum_wd(const unsigned char *input, unsigned int ilen,
chunk = chunk_sz;
sha384_update(&ctx, curr, chunk);
curr += chunk;
- WATCHDOG_RESET();
+ schedule();
}
#else
sha384_update(&ctx, input, ilen);
@@ -372,7 +372,7 @@ void sha512_csum_wd(const unsigned char *input, unsigned int ilen,
chunk = chunk_sz;
sha512_update(&ctx, curr, chunk);
curr += chunk;
- WATCHDOG_RESET();
+ schedule();
}
#else
sha512_update(&ctx, input, ilen);
diff --git a/lib/time.c b/lib/time.c
index bbf191f..f3aaf47 100644
--- a/lib/time.c
+++ b/lib/time.c
@@ -198,7 +198,7 @@ void udelay(unsigned long usec)
ulong kv;
do {
- WATCHDOG_RESET();
+ schedule();
kv = usec > CONFIG_WD_PERIOD ? CONFIG_WD_PERIOD : usec;
__udelay(kv);
usec -= kv;
diff --git a/lib/zlib/inflate.c b/lib/zlib/inflate.c
index 6411c47..30dfe15 100644
--- a/lib/zlib/inflate.c
+++ b/lib/zlib/inflate.c
@@ -25,7 +25,7 @@ int ZEXPORT inflateReset(z_streamp strm)
state->hold = 0;
state->bits = 0;
state->lencode = state->distcode = state->next = state->codes;
- WATCHDOG_RESET();
+ schedule();
Tracev((stderr, "inflate: reset\n"));
return Z_OK;
}
@@ -543,7 +543,7 @@ int ZEXPORT inflate(z_streamp strm, int flush)
strm->adler = state->check = adler32(0L, Z_NULL, 0);
state->mode = TYPE;
case TYPE:
- WATCHDOG_RESET();
+ schedule();
if (flush == Z_BLOCK) goto inf_leave;
case TYPEDO:
if (state->last) {
@@ -721,7 +721,7 @@ int ZEXPORT inflate(z_streamp strm, int flush)
Tracev((stderr, "inflate: codes ok\n"));
state->mode = LEN;
case LEN:
- WATCHDOG_RESET();
+ schedule();
if (have >= 6 && left >= 258) {
RESTORE();
inflate_fast(strm, out);
@@ -933,7 +933,7 @@ int ZEXPORT inflateEnd(z_streamp strm)
return Z_STREAM_ERROR;
state = (struct inflate_state FAR *)strm->state;
if (state->window != Z_NULL) {
- WATCHDOG_RESET();
+ schedule();
ZFREE(strm, state->window);
}
ZFREE(strm, strm->state);