From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A5566ECAAD5 for ; Mon, 5 Sep 2022 09:32:00 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EB5818485D; Mon, 5 Sep 2022 11:31:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="OLSRvKRF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6BD0080F60; Mon, 5 Sep 2022 11:31:45 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7890980F60 for ; Mon, 5 Sep 2022 11:31:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3E93060FB5; Mon, 5 Sep 2022 09:31:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83F57C433D7; Mon, 5 Sep 2022 09:31:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662370300; bh=p9WVHtOFETOsCanD995sgo/+AD+bbfbmB/ZiDIn4yjk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OLSRvKRFBPEDUj2P/ClRuKXrUPsBKHOYzJY60UgfMVNC8UExiBtm2UmwggNYLPF4Q b328p9PGQBKQTuCUHGZRggDdhG/Zqnu2r+VyMg1DwfE/AY29in9/KhuJc1gkWvkLOx JXuBQ8D43+gi84AIeU44MABhvEeejCiXVkojtY6V1L60lMEcoC4NcGRvzozMUD7nif oYcE5JRuR4y50N6l1AjZlH9dGl4ZOOPLxxpdWIvTFArnlSYKpYx6dRe4VuqbDHjecd V1XCyICVkRTc/MFWZTqUEoGVeatMg0RFmYWO66dUIIjHyoj0/bRqs9jH1Kuguz4whq BHyYotNK+/IJw== Received: by pali.im (Postfix) id DD4E620B1; Mon, 5 Sep 2022 11:31:37 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Simon Glass Cc: u-boot@lists.denx.de Subject: [PATCH v3 1/6] sandbox: Add function os_flush() Date: Mon, 5 Sep 2022 11:31:16 +0200 Message-Id: <20220905093121.11630-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220905093121.11630-1-pali@kernel.org> References: <20220905093121.11630-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean It flushes stdout. Signed-off-by: Pali Rohár --- arch/sandbox/cpu/os.c | 5 +++++ include/os.h | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index f937991139c9..01845e388d35 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c @@ -669,6 +669,11 @@ void os_puts(const char *str) os_putc(*str++); } +void os_flush(void) +{ + fflush(stdout); +} + int os_write_ram_buf(const char *fname) { struct sandbox_state *state = state_get_current(); diff --git a/include/os.h b/include/os.h index 148178787bc2..5b353ae9d94b 100644 --- a/include/os.h +++ b/include/os.h @@ -295,6 +295,14 @@ void os_putc(int ch); */ void os_puts(const char *str); +/** + * os_flush() - flush controlling OS terminal + * + * This bypasses the U-Boot console support and flushes directly the OS + * stdout file descriptor. + */ +void os_flush(void); + /** * os_write_ram_buf() - write the sandbox RAM buffer to a existing file * -- 2.20.1