From 18993c101a94cbe5e8159c56caca971ec8bcf0a3 Mon Sep 17 00:00:00 2001 From: Andy Lin Date: Tue, 16 Dec 2025 03:33:02 +0800 Subject: [PATCH] Fix uninitialized r2 in divmod_x32x32_unsafe. For undefined PICO_DIVIDER_DISABLE_INTERRUPTS, ``ldr r2, =SIO_BASE`` is missing from divmod_s32s32_unsafe and divmod_u32u32_unsafe. Signed-off-by: Andy Lin --- src/rp2_common/pico_divider/divider_hardware.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rp2_common/pico_divider/divider_hardware.S b/src/rp2_common/pico_divider/divider_hardware.S index 049c6f755..aed79e5b7 100644 --- a/src/rp2_common/pico_divider/divider_hardware.S +++ b/src/rp2_common/pico_divider/divider_hardware.S @@ -111,6 +111,7 @@ regular_func divmod_s32s32 lsrs r3, #SIO_DIV_CSR_DIRTY_SHIFT_FOR_CARRY bcs divmod_s32s32_savestate regular_func divmod_s32s32_unsafe + ldr r2, =SIO_BASE #else // to avoid too much source code spaghetti with restoring interrupts, we make this the same as the other funcs // in the PICO_DIVIDER_DISABLE_INTERRUPTS case; i.e. it is not a faster function; this seems reasonable as there @@ -173,6 +174,7 @@ wrapper_func __aeabi_uidivmod lsrs r3, #SIO_DIV_CSR_DIRTY_SHIFT_FOR_CARRY bcs divmod_u32u32_savestate regular_func divmod_u32u32_unsafe + ldr r2, =SIO_BASE #else // to avoid too much source code spaghetti with restoring interrupts, we make this the same as the other funcs // in the PICO_DIVIDER_DISABLE_INTERRUPTS case; i.e. it is not a faster function; this seems reasonable as there