From patchwork Mon Nov 1 01:17:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1548922 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=JGm1wMHi; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HjFdr2pQbz9sXN for ; Mon, 1 Nov 2021 12:22:56 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EFC1E8362F; Mon, 1 Nov 2021 02:21:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="JGm1wMHi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 23B9F835D8; Mon, 1 Nov 2021 02:20:29 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1154383620 for ; Mon, 1 Nov 2021 02:19:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd31.google.com with SMTP id p204so8083804iod.8 for ; Sun, 31 Oct 2021 18:19:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NeHQ2R7QzS3jqB40cQgwFQWsPeE/SVhu68WhMltiFnM=; b=JGm1wMHiJvqm8Kn8D7ttoYkBZNWFFySy5eEzytfH42ZmK9Hkh9Xz9qm4MVCtcnYYi8 7tP++BGSVDgisyg8umurKDKf9rYFxMQpm6ueFo1aYPZgKDrDCjI+2TxhrlCRgmYtpyvl BC9APb2pdo7GG83lHN0ng4kfrvW4LYXpSKqb0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NeHQ2R7QzS3jqB40cQgwFQWsPeE/SVhu68WhMltiFnM=; b=rI6ybMrEB4gC4BO041PV0d20x17L15gj84jJYFqRtIBeibQdh6N6X/QhhpUtl9U1Oz I4kMIp4bBoRS+OBqrxeSBl1vSIsLFaJzhwHDMyd+nDVvD45Gjc1kUvT857rUpfvKULo7 DEHifRkcoz2YOX5maH4MNaiUydfwsmUozLQCigoWFMn7ihqZKygw5+3D0yuLiFSOBL+y rkYCLzvgHJXwfy7WHVlLf5FqJqfrLNULB6bOl228SoekTfSCV80qALon4FZtha8H0wwy dydpu1oxaqnyerOSEaP2OF1BBeFTGMveE5vFVMIDpgM9XijtjHB/MSx8frl1rbOL/Bdk 8hhQ== X-Gm-Message-State: AOAM530fwKFkbsjWnNulLpO83EAMznMaybx45z4/Kk1d6nWnwfx87poR xT03A2P1VZOlQeS5Wob+H2iOmNnumxgGrw== X-Google-Smtp-Source: ABdhPJw127gNskNO6D6uVsSf3kGfjI2OH88nAsVPteg2SRdmgol/SgoUjjIeT9X3k7PHmH+moNIRHA== X-Received: by 2002:a02:7105:: with SMTP id n5mr19343505jac.64.1635729574520; Sun, 31 Oct 2021 18:19:34 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id f11sm4351109ilu.82.2021.10.31.18.19.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Oct 2021 18:19:34 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Bin Meng , Ilias Apalodimas , Bill Mills , Heinrich Schuchardt , =?utf-8?q?Fran=C3=A7ois_Ozog?= , Simon Glass Subject: [PATCH 26/31] sandbox: Add a way of checking structs for standard passage Date: Sun, 31 Oct 2021 19:17:28 -0600 Message-Id: <20211101011734.1614781-27-sjg@chromium.org> X-Mailer: git-send-email 2.33.1.1089.g2158813163f-goog In-Reply-To: <20211101011734.1614781-1-sjg@chromium.org> References: <20211101011734.1614781-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean Add a file which can be used to check that structs used in standard passage do compile. No other validation is done at present, but could be considered later. Signed-off-by: Simon Glass --- board/sandbox/Makefile | 3 ++- board/sandbox/stdpass_check.c | 36 +++++++++++++++++++++++++++++++++++ include/stdpass/README | 4 ++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 board/sandbox/stdpass_check.c create mode 100644 include/stdpass/README diff --git a/board/sandbox/Makefile b/board/sandbox/Makefile index 411b53c2b8d..d9b56adbbb8 100644 --- a/board/sandbox/Makefile +++ b/board/sandbox/Makefile @@ -2,4 +2,5 @@ # # Copyright (c) 2011 The Chromium OS Authors. -obj-y := sandbox.o +obj-y += sandbox.o +obj-y += stdpass_check.o diff --git a/board/sandbox/stdpass_check.c b/board/sandbox/stdpass_check.c new file mode 100644 index 00000000000..565124e1564 --- /dev/null +++ b/board/sandbox/stdpass_check.c @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * This file compiles all the struct definitions for standard passage, to ensure + * there are no errors + * + * Copyright 2021 Google LLC + */ + +#include + +/* BLOBLISTT_U_BOOT_SPL_HANDOFF */ +#include +void check_spl_handoff(void) +{ + __maybe_unused struct spl_handoff check; +}; + +/* + * See also doc/develop/std_passage.rst + * + * Instructions: + * + * 1. Add your header file to U-Boot, or to include/stdpass if it is not used in + * U-Boot + * + * 2. Add a function below to include the header and use the struct + * + * Template follows, see above for example + */ + +/* BLOBLISTT_tag here */ +/* #include if not used in U-Boot*/ +void check_struct_name(void) +{ + /* __maybe_unused struct struct_name check; */ +} diff --git a/include/stdpass/README b/include/stdpass/README new file mode 100644 index 00000000000..a972121f40c --- /dev/null +++ b/include/stdpass/README @@ -0,0 +1,4 @@ +This directory contains standard passage structures + +See doc/develop/std_passage.rst for instructions +