From patchwork Thu Oct 23 09:42:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 634 Return-Path: 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=1761212622; bh=AjQi+OdP6HEEXVefrpket3GdXLRgcsOZOURyQYk3JhU=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=sTBxMENioGoc//f5XMyvA0FZCh7i9AitHk5ZFpdsopMFl0aQW7L/Owb91s4I/qrXB S4y7G7R/hnygjTpvEAtwj92gIrpqz6FFlg2tIyy/FSl0fmde4xAXCZr2vleAZEHGrt hzfLXLdGbmvxyBNP5zNUGsBC8hLrfEat89O5mJ3Iig2+wDkyNcOBdKEMFi+6bW9S+w 0mC9CvkZ0wox+a335o2p02KFBnYo84CIvO4BaOyGirURFrUPHsx44yMtur+4tMMEfJ I1AB9kXlfod/KSb0u/ew2c6hcw4gaLS6/PRFYMOvA4xDxqJuqLVq3hfQfomRnEmnL8 IeX2M6p1zDG5Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3342F682A5 for ; Thu, 23 Oct 2025 03:43:42 -0600 (MDT) 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 Oby-nAXGe8od for ; Thu, 23 Oct 2025 03:43:42 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1761212621; bh=AjQi+OdP6HEEXVefrpket3GdXLRgcsOZOURyQYk3JhU=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Z9og4PNIjkqUFAOKjh1NXTRkZ82sm61EY4iDhYdyEoEGJbv+zBfoDC63TM2yEb57P 1h4Fw+tfTp5TkqV2Lo43jWuiYZk1oNm0/NeD8iMsoJvXK11fEhufRB5FqAx1kuS215 kUaSz1dV5FPb9ITUtL5sdl8gBNqsbu/Ahz+E+F40VVAOOy5wmBKeuS8uYUUtCo3VSZ qrOjbNWrj7wIdl4CswR3NRf5srrb7ApKC+9TJ4FaJs0keUTPFM06Mtg/NP4cxQZDee yZpfbICkN6mIPNVADgg96gK/NssHBbRTaI5GpOuYvzm+aXnAQdvOv/UidZjwfDnah4 PsSd8PukEdcOg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 40E30682A8 for ; Thu, 23 Oct 2025 03:43:41 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1761212618; bh=P625vaKKmB/9oivVVxuYjy5HUrv2jc0qYcVejwKxjc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bh1GQKpfWvBkfDx2lqrbjICSJkUZJG6eTlnfT1n7M1H2BliWcP2SAFutlfDM0jXL4 w1PfHISdQKo8n4YV85+ho89GsOp5GN8zZ+ODLDwrw0LAoV7K2L2YLQS/9CGdb7XfXa Hq2DhTMKpRoghFo1z4jHKr+eeIa5tpW7RJnF59nDtOvqvfVQw5LpFRijui3YK42FlB V93WAwvA78Ma9QFNH2p88TLIlUShAH/TBv62qX3kr+Fz9tK7S3SMruvOH7eWK1oKjQ ZpBxY2o349DSWC5HoGzFGZUGH0LXIpLRSI4PFMI1eqCQ54l6MCTtxrEAIQAmiX7UvS YsIox5gHjHBRg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5AC9A68195; Thu, 23 Oct 2025 03:43:38 -0600 (MDT) 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 GNCgNeIsqLnr; Thu, 23 Oct 2025 03:43:38 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1761212618; bh=zajFjaUC3qRolKqOfEN00KDaaAzvKAjve7WHAnaOA3Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GyTHj+Cmzyr+XdpAnHr+r8mncJWd8etTwFKvTAHjkepbFh0gi++dvojkymCaHZo7y iNTm+9aFyeWu+6viyS23CAK9zNeCEaiyT6sMwRQbmaX4qFy1FFvyKM42zZTopVzpxo c86M6m8OpplMphMjfMiX8z3hr+aZfEmSkBDRCDQHMpRS8+kZrPuDuerbjf3+CfFDhY s814FwQ8Sb2RKw/Jp2pZFpA85t5eJlVV3eQ/RMyk9v4EcNn08nFIvFZryeNDeVcImW dn0QYmDNY5Jfwvhv4x2jkhwuTK/zLRZNuP7xubUDLm+GM9h22Is7bI7XgUTubOPzM1 LD/blaAvn+0tA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C88DF6819C; Thu, 23 Oct 2025 03:43:37 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 23 Oct 2025 03:42:51 -0600 Message-ID: <20251023094308.3406453-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251023094308.3406453-1-sjg@u-boot.org> References: <20251023094308.3406453-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 7KZPP76SIZCDMVCPUFPMOAMLVQZOOQIB X-Message-ID-Hash: 7KZPP76SIZCDMVCPUFPMOAMLVQZOOQIB 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: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 02/11] bootstage: Move the bootstage record to the header file List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Move struct bootstage_record to the header file so it can be used from tests. Add some more comments for the struct, while we are here. Signed-off-by: Simon Glass --- common/bootstage.c | 8 -------- include/bootstage.h | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/common/bootstage.c b/common/bootstage.c index 4532100acea..1fee2edeef3 100644 --- a/common/bootstage.c +++ b/common/bootstage.c @@ -26,14 +26,6 @@ enum { RECORD_COUNT = CONFIG_VAL(BOOTSTAGE_RECORD_COUNT), }; -struct bootstage_record { - ulong time_us; - uint32_t start_us; - const char *name; - int flags; /* see enum bootstage_flags */ - enum bootstage_id id; -}; - struct bootstage_data { uint rec_count; uint next_id; diff --git a/include/bootstage.h b/include/bootstage.h index ad98bffedc3..98bd9024da8 100644 --- a/include/bootstage.h +++ b/include/bootstage.h @@ -220,6 +220,24 @@ enum bootstage_id { BOOTSTAGE_ID_ALLOC, }; +/** + * struct bootstage_record - information about a bootstage timing + * + * @time_us: time in microseconds, either the timestamp or the total accumulated + * time for this ID + * @start_us: timestamp of the current starting point for this ID + * @name: name of the timestamp + * @flags: Flags (enum bootstage_flags) + * @id: Bootstage ID + */ +struct bootstage_record { + ulong time_us; + u32 start_us; + const char *name; + int flags; + enum bootstage_id id; +}; + /* * Return the time since boot in microseconds, This is needed for bootstage * and should be defined in CPU- or board-specific code. If undefined then