summaryrefslogtreecommitdiff
path: root/arch/arm/boot/compressed/debug.S
blob: 97f4e74692e897cdc0a90544efe6a7bf526e7bc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/linkage.h>
#include <asm/assembler.h>

#ifndef CONFIG_DEBUG_SEMIHOSTING

#include CONFIG_DEBUG_LL_INCLUDE

ENTRY(putc)
	addruart r1, r2, r3
	waituartcts r3, r1
	waituarttxrdy r3, r1
	senduart r0, r1
	busyuart r3, r1
	mov	 pc, lr
ENDPROC(putc)

#else

ENTRY(putc)
	adr	r1, 1f
	ldmia	r1, {r2, r3}
	add	r2, r2, r1
	ldr	r1, [r2, r3]
	strb	r0, [r1]
	mov	r0, #0x03		@ SYS_WRITEC
   ARM(	svc	#0x123456	)
#ifdef CONFIG_CPU_V7M
 THUMB(	bkpt	#0xab		)
#else
 THUMB(	svc	#0xab		)
#endif
	mov	pc, lr
	.align	2
1:	.word	_GLOBAL_OFFSET_TABLE_ - .
	.word	semi_writec_buf(GOT)
ENDPROC(putc)

	.bss
	.global	semi_writec_buf
	.type   semi_writec_buf, %object
semi_writec_buf:
	.space	4
	.size	semi_writec_buf, 4

#endif