1b2441318SGreg Kroah-Hartman/* SPDX-License-Identifier: GPL-2.0 */ 23b4af9bcSShawn Guo#include <linux/linkage.h> 33b4af9bcSShawn Guo#include <asm/assembler.h> 43b4af9bcSShawn Guo 527523679SNicolas Pitre#ifndef CONFIG_DEBUG_SEMIHOSTING 627523679SNicolas Pitre 73b4af9bcSShawn Guo#include CONFIG_DEBUG_LL_INCLUDE 83b4af9bcSShawn Guo 93b4af9bcSShawn GuoENTRY(putc) 103b4af9bcSShawn Guo addruart r1, r2, r3 113b4af9bcSShawn Guo waituart r3, r1 123b4af9bcSShawn Guo senduart r0, r1 133b4af9bcSShawn Guo busyuart r3, r1 143b4af9bcSShawn Guo mov pc, lr 153b4af9bcSShawn GuoENDPROC(putc) 1627523679SNicolas Pitre 1727523679SNicolas Pitre#else 1827523679SNicolas Pitre 1927523679SNicolas PitreENTRY(putc) 2027523679SNicolas Pitre adr r1, 1f 2127523679SNicolas Pitre ldmia r1, {r2, r3} 2227523679SNicolas Pitre add r2, r2, r1 2327523679SNicolas Pitre ldr r1, [r2, r3] 2427523679SNicolas Pitre strb r0, [r1] 2527523679SNicolas Pitre mov r0, #0x03 @ SYS_WRITEC 2627523679SNicolas Pitre ARM( svc #0x123456 ) 27ee3eaee6SNicolas Pitre#ifdef CONFIG_CPU_V7M 28ee3eaee6SNicolas Pitre THUMB( bkpt #0xab ) 29ee3eaee6SNicolas Pitre#else 3027523679SNicolas Pitre THUMB( svc #0xab ) 31ee3eaee6SNicolas Pitre#endif 3227523679SNicolas Pitre mov pc, lr 3327523679SNicolas Pitre .align 2 3427523679SNicolas Pitre1: .word _GLOBAL_OFFSET_TABLE_ - . 3527523679SNicolas Pitre .word semi_writec_buf(GOT) 3627523679SNicolas PitreENDPROC(putc) 3727523679SNicolas Pitre 3827523679SNicolas Pitre .bss 3927523679SNicolas Pitre .global semi_writec_buf 4027523679SNicolas Pitre .type semi_writec_buf, %object 4127523679SNicolas Pitresemi_writec_buf: 4227523679SNicolas Pitre .space 4 4327523679SNicolas Pitre .size semi_writec_buf, 4 4427523679SNicolas Pitre 4527523679SNicolas Pitre#endif 46