1*88907175SBin Meng /* SPDX-License-Identifier: GPL-2.0 */ 2*88907175SBin Meng /* 3*88907175SBin Meng * Copyright (C) 2012 ARM Ltd. 4*88907175SBin Meng * Author: Marc Zyngier <marc.zyngier@arm.com> 5*88907175SBin Meng * 6*88907175SBin Meng * Adapted for ARM and earlycon: 7*88907175SBin Meng * Copyright (C) 2014 Linaro Ltd. 8*88907175SBin Meng * Author: Rob Herring <robh@kernel.org> 9*88907175SBin Meng */ 10*88907175SBin Meng 11*88907175SBin Meng #ifndef _ARM64_SEMIHOST_H_ 12*88907175SBin Meng #define _ARM64_SEMIHOST_H_ 13*88907175SBin Meng 14*88907175SBin Meng struct uart_port; 15*88907175SBin Meng smh_putc(struct uart_port * port,unsigned char c)16*88907175SBin Mengstatic inline void smh_putc(struct uart_port *port, unsigned char c) 17*88907175SBin Meng { 18*88907175SBin Meng asm volatile("mov x1, %0\n" 19*88907175SBin Meng "mov x0, #3\n" 20*88907175SBin Meng "hlt 0xf000\n" 21*88907175SBin Meng : : "r" (&c) : "x0", "x1", "memory"); 22*88907175SBin Meng } 23*88907175SBin Meng 24*88907175SBin Meng #endif /* _ARM64_SEMIHOST_H_ */ 25