1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * linux/arch/arm/kernel/debug.S
5 * Copyright (C) 1994-1999 Russell King
7 * 32-bit debugging code
9 #include <linux/linkage.h>
10 #include <asm/assembler.h>
15 * Some debugging routines (useful if you've got MM problems and
16 * printk isn't working). For DEBUGGING ONLY!!! Do not leave
17 * references to these in a production kernel!
20 #if !defined(CONFIG_DEBUG_SEMIHOSTING)
21 #include CONFIG_DEBUG_LL_INCLUDE
25 .macro addruart_current, rx, tmp1, tmp2
26 addruart \tmp1, \tmp2, \rx
27 mrc p15, 0, \rx, c1, c0
33 #else /* !CONFIG_MMU */
34 .macro addruart_current, rx, tmp1, tmp2
35 addruart \rx, \tmp1, \tmp2
38 #endif /* CONFIG_MMU */
41 * Useful debugging routines
55 printhex: adr r2, hexbuf_rel
65 addge r1, r1, #'a' - 10
74 hexbuf_addr: .space 16
77 hexbuf_rel: .long hexbuf_addr - .
81 #ifndef CONFIG_DEBUG_SEMIHOSTING
84 addruart_current r3, r1, r2
103 addruart_current r3, r1, r2
115 ENDPROC(debug_ll_addr)
122 mov r0, #0x04 @ SYS_WRITE0
124 #ifdef CONFIG_CPU_V7M
137 mov r0, #0x03 @ SYS_WRITEC
139 #ifdef CONFIG_CPU_V7M
152 ENDPROC(debug_ll_addr)