From 1100fab3264844387fa2f3074c957242a0fe63fb Mon Sep 17 00:00:00 2001 From: Jun Nie Date: Tue, 7 Aug 2018 15:55:58 +0800 Subject: Aarch32: workaround missing udiv instruction workaround missing udiv instruction because it is optional instruction. Signed-off-by: Jun Nie --- framework/aarch32/asm_debug.S | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/framework/aarch32/asm_debug.S b/framework/aarch32/asm_debug.S index ca9f9cb..4a373c5 100644 --- a/framework/aarch32/asm_debug.S +++ b/framework/aarch32/asm_debug.S @@ -89,6 +89,8 @@ func asm_assert /* Print line number in decimal */ mov r6, #10 /* Divide by 10 after every loop iteration */ ldr r5, =MAX_DEC_DIVISOR + /* TODO: test whether udiv is supported, instead of using ARCH_MAJOR */ +#if ARM_ARCH_MAJOR == 8 dec_print_loop: udiv r0, r4, r5 /* Quotient */ mls r4, r0, r5, r4 /* Remainder */ @@ -97,6 +99,14 @@ dec_print_loop: udiv r5, r5, r6 /* Reduce divisor */ cmp r5, #0 bne dec_print_loop +#else + mov r0, #'0' + bl plat_crash_console_putc + mov r0, #'x' + bl plat_crash_console_putc + mov r4, r5 + bl asm_print_hex +#endif bl plat_crash_console_flush -- cgit v1.2.3