| Message ID | 20260204001002.2638622-1-sjg@u-boot.org |
|---|---|
| Headers |
Return-Path: <concept-bounces+u-boot-concept=u-boot.org@u-boot.org> X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770163817; bh=y26M3G1vrRzdKtWwTKQ+CLn0uCUpbiRPDL1gvFDsJJU=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=Z3GJBDgpGDDIzZTefnvmf/o4EjhxqK7x6In10KlXyHO25bElUXPoGIgbAnaAjx2w6 r79tAySS4qPMoDlIbwQhJPaEZnbh8eELCigLpeWMq0gazwyfCmatQ2NmRxv2T6KIcV zeDalp0gd/AizIOEWsHUplJdkQfFHLsrP7lK0NJjejU/Xjpe/t/oC2brxdnGHoe6gy eXA1yrY7XZpS8W1RiKPsVY9FPoq62oFXNucxr+ds85/6X/mNqb7Ibu8zs2ZcVeRW/3 JsyIJerTJuV/R/zigSL0J7YhOnfHa+ZctKTnztH9ptWRXnOLRLGuo4pNuaXFbzjOJx FbeD3spl9GgxQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 114BE69914 for <u-boot-concept@u-boot.org>; Tue, 3 Feb 2026 17:10:17 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id FDO-v1uPnKpP for <u-boot-concept@u-boot.org>; Tue, 3 Feb 2026 17:10:17 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770163816; bh=y26M3G1vrRzdKtWwTKQ+CLn0uCUpbiRPDL1gvFDsJJU=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=MlCpMjKL/DcqyJEIpDUMOhnwRSuTtRkzv8J3sAsxLsygss5fxzP51ELnreXYrcYGk GdEKMAD3Ad5+thmMaCVzG5YXr9W9jS73nPN6KVZTCb9A9zZoWL8LiqxncOmaOMhSFg Mpz1quxLjx9dqm73/vf7WAbj/21e+PhmOhbRLaqvogt52cnPtYxo/lR7qFcNRhbivj GeAIqvmJC23VHyLgPwwdBW4s6C9KEEbqQpG33HQ25gJMVTY0W1T1zht1lF1f9XFI7s S3QPy1lQjnLtCRsOM0PBpyRJyXqXAomnqInAesQNvXKEZw10LXDgZJBEJUsvSzm9c1 aMeASNr36Y3uA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F2AAA69911 for <u-boot-concept@u-boot.org>; Tue, 3 Feb 2026 17:10:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770163814; bh=1AGU/Owba6w17M0L3xiw4jk2GX6k9NaBcP8YOQkpM30=; h=From:To:Cc:Subject:Date:From; b=Ho7ToDrCLpjMguA5tZICvNGo69/I4DwG4PM3dC04QIAJFJYzD/RlM0j/OCBwD2PCh a4xoG5+9UzZ7ALcv45fZEonK8SOCpkvcuzVM5AYtXBlismSB5EF1AiUQHt85ee9qxz 09s1hktJOcfHXTrNEmLpz70gwiurD1c13RUSEqpU/nNUBMbO2A9jwglS6xJRqlKcBH AzDFK+UKe+b6XWShlMow+hrjWDwz3pmQxOH5Wab9xif9tZ4fj95CLoN5ifTgYQ1XrF rumuZNXKKRptUdf+DwM9DUZ690h+++bHQFVNzjCeL6MdpN9Jds2K31pqZakMLQJ42q ZNAfeNNaBJy0A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E78006990A; Tue, 3 Feb 2026 17:10:14 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id KthDIluAt8ou; Tue, 3 Feb 2026 17:10:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770163810; bh=W65Co0EFlxY052ERhBsqrrVXwtaSiIuttNP4kwji92Y=; h=From:To:Cc:Subject:Date:From; b=RHrf87JIWhPnBZmZtgzY1M4502PFQWI/g7TdXChOclt7trCBOZIB0Ekf5Wtr6WSNV wsLgzks43EhzkkNmVoUGgb4UZ8dO8EzsQyqRS3Twc2iMOG58j5GUWEtn94s/Z1knit zji2gZ4LHu/NDhUebT/8xaJ/2LlppOwLgxyTlcTufDcPR6oZk4TIQcIYPMMA1Ll9OE wpSyK7jphyDaODltYFEv3jmOtVtljYih9o7Jd/pVuPh2rBDLJ/efFfP3IsLdbP1PnM 7mbs7hFES6HV21iFAFbL34hj/Ae8YDtQlzjHoo+nnxi0jg/p0Zq/penx6XDux/RUKw 7FAAM0Tt2+eLg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 949C169909; Tue, 3 Feb 2026 17:10:10 -0700 (MST) From: Simon Glass <sjg@u-boot.org> To: U-Boot Concept <concept@u-boot.org> Date: Tue, 3 Feb 2026 17:09:44 -0700 Message-ID: <20260204001002.2638622-1-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Message-ID-Hash: 2MT6UDPRNYIJCZYKFY4OAXQWZZLBVAJJ X-Message-ID-Hash: 2MT6UDPRNYIJCZYKFY4OAXQWZZLBVAJJ X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass <simon.glass@canonical.com> X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 00/13] Add putsn() for length-based console output List-Id: Discussion and patches related to U-Boot Concept <concept.u-boot.org> Archived-At: <https://lists.u-boot.org/archives/list/concept@u-boot.org/message/2MT6UDPRNYIJCZYKFY4OAXQWZZLBVAJJ/> List-Archive: <https://lists.u-boot.org/archives/list/concept@u-boot.org/> List-Help: <mailto:concept-request@u-boot.org?subject=help> List-Owner: <mailto:concept-owner@u-boot.org> List-Post: <mailto:concept@u-boot.org> List-Subscribe: <mailto:concept-join@u-boot.org> List-Unsubscribe: <mailto:concept-leave@u-boot.org> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit |
| Series |
Add putsn() for length-based console output
|
|
Message
Simon Glass
Feb. 4, 2026, 12:09 a.m. UTC
From: Simon Glass <simon.glass@canonical.com>
This series adds putsn() which outputs exactly a specified number of
characters from a buffer, regardless of any nul characters that may be
present. This is useful for printing substrings or binary data without
allocating temporary buffers.
The infrastructure for length-based output already exists at the driver
level (membuf_put(), __serial_puts()), so this series mainly adds the
public API and necessary wrapper functions at the console layer.
The feature is controlled by CONFIG_CONSOLE_PUTSN and is enabled by
default for sandbox.
Simon Glass (13):
console: Add a Kconfig option for putsn() support
serial: Support length-based serial output
console: Add length-based console-recording support
console: Add length-based pre-console support
console: Add length-based debug UART support
sandbox: Add support for length-based console output
console: Add putsn() support to struct stdio_dev
console: Add vidconsole support for length-based output
console: Add the putsn() API for length-based string output
console: Shorten the console-error-output function names
console: Add err_putsn() for length-based error output
console: Add putsn() to ulib
CI: Add artifacts for the 'make check' CI jobs
.gitlab-ci.yml | 9 ++
arch/sandbox/cpu/os.c | 8 +-
common/Kconfig | 9 ++
common/console.c | 177 +++++++++++++++++++++++++++---
drivers/serial/serial-uclass.c | 34 ++++++
drivers/video/console_truetype.c | 6 +-
drivers/video/vidconsole-uclass.c | 33 +++---
include/console.h | 23 +++-
include/debug_uart.h | 17 +++
include/os.h | 13 +++
include/serial.h | 12 ++
include/stdio.h | 12 ++
include/stdio_dev.h | 12 ++
include/u-boot-lib.h | 15 +++
lib/ulib/ulib.c | 10 ++
test/common/console.c | 48 ++++++++
test/dm/serial.c | 20 ++++
17 files changed, 416 insertions(+), 42 deletions(-)