Linux Audio

Check our new training course

Loading...
v4.6
 
 1#include <linux/linkage.h>
 2#include <asm/assembler.h>
 3
 4#ifndef CONFIG_DEBUG_SEMIHOSTING
 5
 6#include CONFIG_DEBUG_LL_INCLUDE
 7
 8ENTRY(putc)
 9	addruart r1, r2, r3
10	waituart r3, r1
11	senduart r0, r1
12	busyuart r3, r1
13	mov	 pc, lr
14ENDPROC(putc)
15
16#else
17
18ENTRY(putc)
19	adr	r1, 1f
20	ldmia	r1, {r2, r3}
21	add	r2, r2, r1
22	ldr	r1, [r2, r3]
23	strb	r0, [r1]
24	mov	r0, #0x03		@ SYS_WRITEC
25   ARM(	svc	#0x123456	)
 
 
 
26 THUMB(	svc	#0xab		)
 
27	mov	pc, lr
28	.align	2
291:	.word	_GLOBAL_OFFSET_TABLE_ - .
30	.word	semi_writec_buf(GOT)
31ENDPROC(putc)
32
33	.bss
34	.global	semi_writec_buf
35	.type   semi_writec_buf, %object
36semi_writec_buf:
37	.space	4
38	.size	semi_writec_buf, 4
39
40#endif
v5.9
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#include <linux/linkage.h>
 3#include <asm/assembler.h>
 4
 5#ifndef CONFIG_DEBUG_SEMIHOSTING
 6
 7#include CONFIG_DEBUG_LL_INCLUDE
 8
 9ENTRY(putc)
10	addruart r1, r2, r3
11	waituart r3, r1
12	senduart r0, r1
13	busyuart r3, r1
14	mov	 pc, lr
15ENDPROC(putc)
16
17#else
18
19ENTRY(putc)
20	adr	r1, 1f
21	ldmia	r1, {r2, r3}
22	add	r2, r2, r1
23	ldr	r1, [r2, r3]
24	strb	r0, [r1]
25	mov	r0, #0x03		@ SYS_WRITEC
26   ARM(	svc	#0x123456	)
27#ifdef CONFIG_CPU_V7M
28 THUMB(	bkpt	#0xab		)
29#else
30 THUMB(	svc	#0xab		)
31#endif
32	mov	pc, lr
33	.align	2
341:	.word	_GLOBAL_OFFSET_TABLE_ - .
35	.word	semi_writec_buf(GOT)
36ENDPROC(putc)
37
38	.bss
39	.global	semi_writec_buf
40	.type   semi_writec_buf, %object
41semi_writec_buf:
42	.space	4
43	.size	semi_writec_buf, 4
44
45#endif