From: Simon Glass Date: Mon, 8 Apr 2019 19:20:49 +0000 (-0600) Subject: div64: Don't instrument the division function X-Git-Tag: baikal/mips/sdk5.9~1010^2~8 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=799e5be4a7379d29b54533db52b3a38c1308b886;p=uboot.git div64: Don't instrument the division function This function may be called from tracing code, since that code needs to read the timer and this often requires calling do_div(), which calls __div64_32(). If this function is instrumented it causes an infinite loop, since emitting a trace record requests the time, which in turn emits a trace record, etc. Update the prototype to prevent instrumentation code being added. Signed-off-by: Simon Glass --- diff --git a/lib/div64.c b/lib/div64.c index 7abc68c333..62933c92c4 100644 --- a/lib/div64.c +++ b/lib/div64.c @@ -25,7 +25,13 @@ #if BITS_PER_LONG == 32 #ifndef __div64_32 -u32 __attribute__((weak)) __div64_32(u64 *n, u32 base) +/* + * Don't instrument this function as it may be called from tracing code, since + * it needs to read the timer and this often requires calling do_div(), which + * calls this function. + */ +uint32_t __attribute__((weak, no_instrument_function)) __div64_32(u64 *n, + u32 base) { u64 rem = *n; u64 b = base;