Message ID | 20210207211727.v3.3.If4b6aad281b0987643878ab428b5120dbdbbecfb@changeid |
---|---|
State | Superseded |
Delegated to: | Simon Glass |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=<UNKNOWN>) Authentication-Results: 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=epSqwkbo; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4DYt7k0kJDz9sVJ for <incoming@patchwork.ozlabs.org>; Mon, 8 Feb 2021 15:18:57 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 34E5082867; Mon, 8 Feb 2021 05:18:28 +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="epSqwkbo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BD83C8284D; Mon, 8 Feb 2021 05:18:22 +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.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) (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 1FF7F82810 for <u-boot@lists.denx.de>; Mon, 8 Feb 2021 05:18:17 +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-il1-x131.google.com with SMTP id d6so11544020ilo.6 for <u-boot@lists.denx.de>; Sun, 07 Feb 2021 20:18:17 -0800 (PST) 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=hBh4oW80ljbAXQXsIgCIKW8wLoJA3/Esi3WEctHbREk=; b=epSqwkboEgf7L851oIwOCnw9ShOn8dhQ2utewBrVe1K7uPzAK7fOQCGb8369YJ/WGP hGqYI7lldITIyYBXhkzZFV4PNFIplrZA6gieMwwEJJnF5UP02zhcrKsw1aYtGxUe3wqC JRmvGjiwzzfr9K75PwHKFkJsT7oE8IpWtIkUw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hBh4oW80ljbAXQXsIgCIKW8wLoJA3/Esi3WEctHbREk=; b=HesSOrGnNORwS6hb8eJzOImNiK6Bj/5JJ3Rf4HGWR9FOF6qFtYBIkwJcH6I7SZ1nwv xnEtaKIdDQjLSrIrIWEb9I+hJVymbUsWZc+rX8Ckf5jBVH14rv8orlnctouPu4EU1oJl Wn7o81DyC+YZCom8JdO6AH7sNiy7GyLs+BEYREQeawXOxK+BdRtH6tJkwtr6zmP/w2Zt 3zXxQYQsnlkLsw1mHz5g0ZXMCAlA6xhcn+KDIcKf9Oj/oQyqQ+rp4ZIhOUdzsicXqnub WNz08RnHR0nhFO50XflRqTyYSN0XbY/P9EXdMX1em87xQYGkx2ERO24LQNk859m7th/M gPjw== X-Gm-Message-State: AOAM531XvY983i9Gq8RMvC+UPMChpEF3wYlrN6w7gZaOuWkLlzrjOR9/ sxWeXJfhJGWNnhWcPGQutVdhdVVExFfdKfbg X-Google-Smtp-Source: ABdhPJz9vREtcII4AJ7rI8Coo7ieZuFG9l2cYxsdOdKPJYysVnDOhlqU1kRtRZHbPn7SWljbjvTbmg== X-Received: by 2002:a05:6e02:1390:: with SMTP id d16mr14478716ilo.269.1612757895775; Sun, 07 Feb 2021 20:18:15 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id h10sm8214994ils.10.2021.02.07.20.18.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Feb 2021 20:18:15 -0800 (PST) From: Simon Glass <sjg@chromium.org> To: U-Boot Mailing List <u-boot@lists.denx.de> Cc: Tom Rini <trini@konsulko.com>, Heinrich Schuchardt <xypron.glpk@gmx.de>, Marek Vasut <marex@denx.de>, Walter Lozano <walter.lozano@collabora.com>, Bin Meng <bmeng.cn@gmail.com>, Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>, Simon Glass <sjg@chromium.org> Subject: [PATCH v3 03/42] linker_lists: Allow use in data structures Date: Sun, 7 Feb 2021 21:17:28 -0700 Message-Id: <20210207211727.v3.3.If4b6aad281b0987643878ab428b5120dbdbbecfb@changeid> X-Mailer: git-send-email 2.30.0.478.g8a0d178c01-goog In-Reply-To: <20210208041807.4079084-1-sjg@chromium.org> References: <20210208041807.4079084-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean |
Series |
dm: Implement OF_PLATDATA_INST in driver model (part E)
|
expand
|
diff --git a/include/linker_lists.h b/include/linker_lists.h index fd98ecd297c..0ca30da4172 100644 --- a/include/linker_lists.h +++ b/include/linker_lists.h @@ -211,6 +211,18 @@ _ll_result; \ }) +/** + * ll_entry_ref() - Get a reference to a linker-generated array entry + * + * Once ll_entry_decl() has been used to declare the reference, this macro + * allows the entry to be accessed. + * + * This is like ll_entry_get(), but without the extra code, so it is suitable + * for putting into data structures. + */ +#define ll_entry_ref(_type, _name, _list) \ + ((_type *)&_u_boot_list_2_##_list##_2_##_name) + /** * ll_start() - Point to first entry of first linker-generated array * @_type: Data type of the entry
At present linker lists are designed for use in code. They make use of statements within expressions ({...}), for example. It is possible to generate a reference to a linker_list entry that can be used in data structures, where such features are not permitted. It requires that the reference first be declared as extern. In other words the existing macro needs to be split into two parts. Add new macros to support this. Signed-off-by: Simon Glass <sjg@chromium.org> --- Changes in v3: - Drop the decl() variant since it is just as easy to use extern include/linker_lists.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)