2 * linux/arch/arm/kernel/debug.S
4 * Copyright (C) 1994-1999 Russell King
6 * SPDX-License-Identifier: GPL-2.0+
8 * 32-bit debugging code
10 #include <linux/linkage.h>
11 #include <asm/assembler.h>
16 * Some debugging routines (useful if you've got MM problems and
17 * printk isn't working). For DEBUGGING ONLY!!! Do not leave
18 * references to these in a production kernel!
21 #if !defined(CONFIG_DEBUG_SEMIHOSTING)
22 #include CONFIG_DEBUG_LL_INCLUDE
26 .macro addruart_current, rx, tmp1, tmp2
27 addruart \tmp1, \tmp2, \rx
28 mrc p15, 0, \rx, c1, c0
34 #else /* !CONFIG_MMU */
35 .macro addruart_current, rx, tmp1, tmp2
36 addruart \rx, \tmp1, \tmp2
39 #endif /* CONFIG_MMU */
42 * Useful debugging routines
56 printhex: adr r2, hexbuf
64 addge r1, r1, #'a' - 10
76 #ifndef CONFIG_DEBUG_SEMIHOSTING
79 addruart_current r3, r1, r2
95 addruart_current r3, r1, r2
107 ENDPROC(debug_ll_addr)
114 mov r0, #0x04 @ SYS_WRITE0
123 mov r0, #0x03 @ SYS_WRITEC
134 ENDPROC(debug_ll_addr)