1
2
3
4
5
6
7
8
9
10#include <linux/linkage.h>
11#include <asm/assembler.h>
12
13 .text
14
15
16
17
18
19
20
21
22
23#endif
24
25#ifdef CONFIG_MMU
26 .macro addruart_current, rx, tmp1, tmp2
27 addruart \tmp1, \tmp2, \rx
28 mrc p15, 0, \rx, c1, c0
29 tst \rx,
30 moveq \rx, \tmp1
31 movne \rx, \tmp2
32 .endm
33
34#else
35 .macro addruart_current, rx, tmp1, tmp2
36 addruart \rx, \tmp1, \tmp2
37 .endm
38
39#endif
40
41
42
43
44ENTRY(printhex8)
45 mov r1,
46 b printhex
47ENDPROC(printhex8)
48
49ENTRY(printhex4)
50 mov r1,
51 b printhex
52ENDPROC(printhex4)
53
54ENTRY(printhex2)
55 mov r1,
56printhex: adr r2, hexbuf
57 add r3, r2, r1
58 mov r1,
59 strb r1, [r3]
601: and r1, r0,
61 mov r0, r0, lsr
62 cmp r1,
63 addlt r1, r1,
64 addge r1, r1,
65 strb r1, [r3,
66 teq r3, r2
67 bne 1b
68 mov r0, r2
69 b printascii
70ENDPROC(printhex2)
71
72hexbuf: .space 16
73
74 .ltorg
75
76#ifndef CONFIG_DEBUG_SEMIHOSTING
77
78ENTRY(printascii)
79 addruart_current r3, r1, r2
80 b 2f
811: waituart r2, r3
82 senduart r1, r3
83 busyuart r2, r3
84 teq r1,
85 moveq r1,
86 beq 1b
872: teq r0,
88 ldrneb r1, [r0],
89 teqne r1,
90 bne 1b
91 mov pc, lr
92ENDPROC(printascii)
93
94ENTRY(printch)
95 addruart_current r3, r1, r2
96 mov r1, r0
97 mov r0,
98 b 1b
99ENDPROC(printch)
100
101#ifdef CONFIG_MMU
102ENTRY(debug_ll_addr)
103 addruart r2, r3, ip
104 str r2, [r0]
105 str r3, [r1]
106 mov pc, lr
107ENDPROC(debug_ll_addr)
108#endif
109
110#else
111
112ENTRY(printascii)
113 mov r1, r0
114 mov r0,
115 ARM( svc
116 THUMB( svc
117 mov pc, lr
118ENDPROC(printascii)
119
120ENTRY(printch)
121 adr r1, hexbuf
122 strb r0, [r1]
123 mov r0,
124 ARM( svc
125 THUMB( svc
126 mov pc, lr
127ENDPROC(printch)
128
129ENTRY(debug_ll_addr)
130 mov r2,
131 str r2, [r0]
132 str r2, [r1]
133 mov pc, lr
134ENDPROC(debug_ll_addr)
135
136#endif
137