diff options
author | Jun Nie <jun.nie@linaro.org> | 2018-08-07 15:55:58 +0800 |
---|---|---|
committer | Jun Nie <jun.nie@linaro.org> | 2018-08-07 15:56:48 +0800 |
commit | 1100fab3264844387fa2f3074c957242a0fe63fb (patch) | |
tree | 9fbec7d9838c52ce9967bf7d316ee73176219fdf | |
parent | f2eaab14c227870cd42dbc6b574d298b72307cc0 (diff) |
Aarch32: workaround missing udiv instruction
workaround missing udiv instruction because it is optional instruction.
Signed-off-by: Jun Nie <jun.nie@linaro.org>
-rw-r--r-- | framework/aarch32/asm_debug.S | 10 |
1 files changed, 10 insertions, 0 deletions
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 |