Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp730933rwb; Thu, 8 Dec 2022 02:07:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf5YFxkSBhp3KqpuAQid2e8nWMDgp1HsUIM30tw/WKZNVDDYzduo46PftV+qw3LfQCQs2AAe X-Received: by 2002:a17:906:694a:b0:7c0:9d50:5144 with SMTP id c10-20020a170906694a00b007c09d505144mr29436631ejs.590.1670494062410; Thu, 08 Dec 2022 02:07:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670494062; cv=none; d=google.com; s=arc-20160816; b=IPwstSAs5rPPW4ZEdAUbBot48jM6muz0Gaynj1fl+eXq6tvZmeA4WnfDaiqKONXHzW IhMVOqkSRFBrfJSvF7hEj+KvcvBRVbkA7iAIkgBovtnSmv3yIQLnhGitgxoTn9yC7aK2 6UK/fXmflvPzRbSso4U9DaDsuLUECrVjH9dV4mj5q/yEznyl7zizhLir5sPweXMxBbk1 mrTQSXEj+5TgW8KAMr8jUk0a3jM2gr5tt0aUctYvDq+eF6KQInwY6ypzkYZABK2uoxNN LIBgV4F2Puryl+yFavL5NL6034OqRTDNpLJ22fzCI6dH8evjVGLVhJZxvikGm4fG0avv MnvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:user-agent:reply-to:references:in-reply-to:message-id :date:cc:subject:to:from; bh=7ClOxxQHBOzuQBjSNnCv+KkMODwSwZmYrrhu1FrJ3V0=; b=dgr2X7kMsCK//OASO8UgyY08wKJG4tmkuroXHRfIlxmng6BqebARE5Vvye2sDwP/fo zCjL7Tt+/Syyf3pUY5ti6VDPWF1yVsZjwtj7o7rFIrkSkJzuOWxBmxkD4e0kG3Oz+bOR gxPGAgWiXvD5pgs6SHG0TkE35P6FUu7YdayGcMYq4fD1c9ZkJrRzK1SuLpjXk/I4693s ZTdiMgrT9/I/MHXX4P1axm0K426kWW3Z3YqGJWhoPUzCzbUUcfq82TKA9nSsKme0sdVN 8B4k0HVQEhnu01wn60aotwiN2/POV3ZSLG6uCiihyew+NKb/qCaFClPgnzaxmdWqvfgk KFOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq40-20020a1709073f2800b0078dfe6dc4d2si12681555ejc.33.2022.12.08.02.07.23; Thu, 08 Dec 2022 02:07:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229717AbiLHJdZ convert rfc822-to-8bit (ORCPT + 72 others); Thu, 8 Dec 2022 04:33:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229770AbiLHJdX (ORCPT ); Thu, 8 Dec 2022 04:33:23 -0500 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.221.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EA1759FDE; Thu, 8 Dec 2022 01:33:16 -0800 (PST) X-QQ-mid: bizesmtp80t1670491970tmadzmjb Received: from [192.168.3.2] ( [111.196.135.79]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 08 Dec 2022 17:32:48 +0800 (CST) X-QQ-SSF: 01200000000000B0B000000A0000000 X-QQ-FEAT: zX46NWeZQGEPkwa09vvX1e9B/NktWgMjOM4wpw+/LIo80yqhwau4SCVAglcsW 9vsBVIHhCU9XlW9C/ACb/6mMlDXDUOlYQ36EXhCDA5boUGbllxcBEHLmNSXc2s3hXMCbtf0 RTJXfEdQWQnUzHr/ri13d1YrvY8+oCMmAwqK7DoYT8tcO0NqZQXJnA4B70etX7aItOsQjwY M1wXkiYNJ0lqlMmHeQU388p4klUI6z3WLOtdfra37UihjKn0gZIuNhijHRPBp4wCt/SnebH A652eiO6RR81OjgRhHYJSzeQ4MVQ9ACl5U2OHqBJTiMJLIc6q80/PBAtBa059m2JzfICZ2j jwbaEhlvS3fBLJJ0QY= X-QQ-GoodBg: 0 From: "Bin Meng" To: "Jiri Slaby" , linux-kernel , linux-riscv , linux-serial Subject: Re: [PATCH v2 1/3] serial: earlycon-arm-semihost: Move smh_putc() variants in respective arch's semihost.h Cc: "catalin.marinas" , gregkh , linux , will , linux-arm-kernel Date: Thu, 08 Dec 2022 09:32:48 +0000 Message-Id: In-Reply-To: <0443d5e9-b2ce-7e6b-c69b-708d67a5bf97@kernel.org> References: <20221207135352.592556-1-bmeng@tinylab.org> <0443d5e9-b2ce-7e6b-c69b-708d67a5bf97@kernel.org> Reply-To: "Bin Meng" User-Agent: eM_Client/9.2.1222.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvr:qybglogicsvr3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/12/8 14:08:33, "Jiri Slaby" wrote: >On 07. 12. 22, 14:53, Bin Meng wrote: >>Move smh_putc() variants in respective arch/*/include/asm/semihost.h, >>in preparation to add RISC-V support. >> >>Signed-off-by: Bin Meng >... >>--- /dev/null >>+++ b/arch/arm/include/asm/semihost.h >>@@ -0,0 +1,23 @@ >>+/* SPDX-License-Identifier: GPL-2.0 */ >>+/* >>+ * Copyright (C) 2012 ARM Ltd. >>+ * Author: Marc Zyngier >>+ * >>+ * Adapted for ARM and earlycon: >>+ * Copyright (C) 2014 Linaro Ltd. >>+ * Author: Rob Herring >>+ */ > >Much better. There are three minor issues: >1) protection against multiple #include-s is missing here. Oops, will add in v3. > > >>+#ifdef CONFIG_THUMB2_KERNEL >>+#define SEMIHOST_SWI "0xab" >>+#else >>+#define SEMIHOST_SWI "0x123456" >>+#endif >>+ >>+static inline void smh_putc(struct uart_port *port, unsigned char c) > >2) port is unused in all implementations. So it should be dropped. >3) can you make "c" an explicit u8? The smh_putc function signature is defined by the uart_console_write helper. I don't think we can change it. > >>+{ >>+ asm volatile("mov r1, %0\n" >>+ "mov r0, #3\n" >>+ "svc " SEMIHOST_SWI "\n" >>+ : : "r" (&c) : "r0", "r1", "memory"); >>+} Regards, Bin