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