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 AF983C19F2A for ; Thu, 11 Aug 2022 12:40:00 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BD3DA8492C; Thu, 11 Aug 2022 14:39:57 +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="FnkqAPqr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 315A78492C; Thu, 11 Aug 2022 14:39:55 +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 52236848B9 for ; Thu, 11 Aug 2022 14:39:52 +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 DE7B061456; Thu, 11 Aug 2022 12:39:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29C26C433C1; Thu, 11 Aug 2022 12:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660221590; bh=p9WVHtOFETOsCanD995sgo/+AD+bbfbmB/ZiDIn4yjk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FnkqAPqr0WUmYzXQbYKzEtq7VexGnoOau3ATLVZ8X0nNkNLHdLQ0KBB8aik1rvUDr u++dUvQMUh9avU3X/qbc07VMhs9jGD16r+fHNiNcSXICDqFgTO0DbfwTzWbnMly9NT YNZ1FgEbaFy0YuMQ0q9M3tAJS11uWnYOeqK2zF9WgroAegxVcxlxjd8XR7eEH03oSO NYzGlyvHkSwJkdqU+OLg+Y317OoW3NJwzp5xHSs7qFLsCf5B4V7wcw6cKG1IJvA2ju 4k9wTXOi7PYsbXuOdMMxoudVHMu02IM572Af0REscV+FiGw+uoNLjkE6zqam1q+pVc 1QIv1x+TJq+jw== Received: by pali.im (Postfix) id 5EFAE2763; Thu, 11 Aug 2022 14:39:47 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Simon Glass Cc: u-boot@lists.denx.de Subject: [PATCH v2 1/6] sandbox: Add function os_flush() Date: Thu, 11 Aug 2022 14:39:20 +0200 Message-Id: <20220811123925.23981-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220811123925.23981-1-pali@kernel.org> References: <20220811123925.23981-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