From patchwork Thu Sep 4 13:04:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 219 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=1756991133; bh=1kuPFaEIezKErg4oWpukLFv26JO2YlQ7bBIev64RHRE=; 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=kLk/x/gTYgWhne+KxN3JLblnUHNAeb9qb6DH7GUx3qwCyBRp/1PKVwGPI2bhOQECF KH1evr2S7aZG0W+D2xkEYdckH1Rkp0hhT11MbNEHdAf6Cl9dLwNxgPyiZ6WBNl46xu 03EvMmlIxRbpjxTy61tE4yf5AinnjX9cLIi9dPpSFGUM4VPnhCSwLErrGBIZIIxRBS /DOiXHorGycXqSlsXR/uBXTAkFh9YFzeT5eINvMDQi5d+QXka2zYk/aeUeDDoW8B7P fKFswMlsCwMJllSTrDsU90k3i8pPQ4oRkny/4vTsaBx++kgCUCok5vKaRYi9zhmbh/ 0ObwAniWCmA8g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 628536795D for ; Thu, 4 Sep 2025 07:05:33 -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 m8od9hZ9cNEy for ; Thu, 4 Sep 2025 07:05:33 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756991133; bh=1kuPFaEIezKErg4oWpukLFv26JO2YlQ7bBIev64RHRE=; 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=kLk/x/gTYgWhne+KxN3JLblnUHNAeb9qb6DH7GUx3qwCyBRp/1PKVwGPI2bhOQECF KH1evr2S7aZG0W+D2xkEYdckH1Rkp0hhT11MbNEHdAf6Cl9dLwNxgPyiZ6WBNl46xu 03EvMmlIxRbpjxTy61tE4yf5AinnjX9cLIi9dPpSFGUM4VPnhCSwLErrGBIZIIxRBS /DOiXHorGycXqSlsXR/uBXTAkFh9YFzeT5eINvMDQi5d+QXka2zYk/aeUeDDoW8B7P fKFswMlsCwMJllSTrDsU90k3i8pPQ4oRkny/4vTsaBx++kgCUCok5vKaRYi9zhmbh/ 0ObwAniWCmA8g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 52C6D6795C for ; Thu, 4 Sep 2025 07:05:33 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756991132; bh=UarvyzwTJAC9aKNHGePaQaJtrBuriy2bqYeRt+/F6n0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UZRpI+8qYIohRCoLzbhnEokWAXC8x7yfe6YIqnTJ/Hox2YWzmAjJdfvoTXYBnXkD/ hz78QIoA7VZH6PrwaaV+7YELdFDgfUgDNLLdVIdWiFeoSrJyFwMPeh6HZJT9z1tFlj 9ZBj3Grw2UNJ5CpEUzDQ2AlG9vRj4KBk9ni03aRMXvtHZchOKDmTNbVLQMx26gjR3L YbkOKWH+4rM+6su/wYBYeIzm3hqGe5rZbHoA2bjPeh46boLl72PCg0NBF57N3saLQX VJ7amNnCCDhwP4TsegC3lIXMWoU6Nq2CSqp7vdNJjqzw0OtOAtxVykRpq693UbaNWv igI9XZd8DV8nw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1394D6795C; Thu, 4 Sep 2025 07:05:32 -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 FmCZ7sDhZTAj; Thu, 4 Sep 2025 07:05:32 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756991127; bh=KjG+K8Su8X4HLgjJmly9u1igTFDJNZQT7FZZEhXWIkM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MGVU9l5fqDnfZdTmTTAIFxBd3wMzlF8aUqcLyBlru9SWs47yyqiYCwABW+35yFfp1 rXCc0OXeNEmFlU4Avf0FXFPmXQQToKJj3rRPuKLQSps9zwY+Cb8YZ442RsO3/ltPJV tGzMpPDgmAZWiDhYjDpjwXGGyWlUsCGAdTXUZrZo0Q+Jg8aBW2a6zPLclr9VyZpBFQ n+4uEr1Tuo9NqI32ZRhAKSpCR5BUMtR28Rc3LnJrAbKgCQ6qglpM719DeDvVyTrDxa S5OD8A9I0fNPa3O9Mvgz06gK9F2p+xlnqQ1tgy1yu0bRXAP5/b5uu7EfIa5dJNiyrD L0YfGRibpPhaQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id AA54D67886; Thu, 4 Sep 2025 07:05:27 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 4 Sep 2025 07:04:38 -0600 Message-ID: <20250904130459.848794-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250904130459.848794-1-sjg@u-boot.org> References: <20250904130459.848794-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: FWGEJF3FF3A6TWZ73TL22WNXZMCIUAB3 X-Message-ID-Hash: FWGEJF3FF3A6TWZ73TL22WNXZMCIUAB3 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 05/18] sandbox: Move main.h contents into u-boot-sandbox header 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 It isn't really necessary to have a header file for just one function. This makes it harder to see the full interface provided by sandbox. Move the sandbox_main() declaration into u-boot-sandbox.h Signed-off-by: Simon Glass --- arch/sandbox/cpu/os.c | 2 +- arch/sandbox/include/asm/main.h | 18 ------------------ arch/sandbox/include/asm/u-boot-sandbox.h | 12 ++++++++++++ 3 files changed, 13 insertions(+), 19 deletions(-) delete mode 100644 arch/sandbox/include/asm/main.h diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index 101d695a556..d1632e6af69 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c @@ -30,9 +30,9 @@ #include #include -#include #include #include +#include #include #include diff --git a/arch/sandbox/include/asm/main.h b/arch/sandbox/include/asm/main.h deleted file mode 100644 index 7a2f0d3a8d5..00000000000 --- a/arch/sandbox/include/asm/main.h +++ /dev/null @@ -1,18 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Copyright (c) 2022 Google, Inc. - * Written by Andrew Scull - */ - -#ifndef __ASM_SANDBOX_MAIN_H -#define __ASM_SANDBOX_MAIN_H - -/** - * sandbox_main() - main entrypoint for sandbox - * - * @argc: the number of arguments passed to the program - * @argv: array of argc+1 pointers, of which the last one is null - */ -int sandbox_main(int argc, char *argv[]); - -#endif /* __ASM_SANDBOX_MAIN_H */ diff --git a/arch/sandbox/include/asm/u-boot-sandbox.h b/arch/sandbox/include/asm/u-boot-sandbox.h index 3c4347117d4..54f0d9832b1 100644 --- a/arch/sandbox/include/asm/u-boot-sandbox.h +++ b/arch/sandbox/include/asm/u-boot-sandbox.h @@ -41,4 +41,16 @@ void sandbox_reset(void); /* Exit sandbox (quit U-Boot) */ void __noreturn sandbox_exit(void); +/** + * sandbox_main() - main entrypoint for sandbox + * + * @argc: the number of arguments passed to the program + * @argv: array of argc+1 pointers, of which the last one is null + + * This starts sandbox. It does not return unless something goes wrong. + * + * Return: 1 on error + */ +int sandbox_main(int argc, char *argv[]); + #endif /* _U_BOOT_SANDBOX_H_ */