mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 1/4] handoff-data: put handoff data into data section
Date: Tue, 21 May 2024 12:49:10 +0200	[thread overview]
Message-ID: <20240521104913.1983970-2-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20240521104913.1983970-1-s.hauer@pengutronix.de>

The intention was to put the handoff data into the data section and not
into the bss section so that it won't be cleared by another call to
setup_c(). This was not fully done, add a __section(.data) to the
missing places.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 include/pbl/handoff-data.h | 18 +++++++++---------
 pbl/handoff-data.c         |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/pbl/handoff-data.h b/include/pbl/handoff-data.h
index 7f883421df..18ea9e508b 100644
--- a/include/pbl/handoff-data.h
+++ b/include/pbl/handoff-data.h
@@ -24,15 +24,15 @@ struct handoff_data_entry {
 	unsigned int flags;
 };
 
-#define handoff_data_add_flags(_cookie, _data, _size, _flags)	\
-	do {							\
-		static struct handoff_data_entry hde;		\
-		hde.cookie = _cookie;				\
-		hde.data = _data;				\
-		hde.size = _size;				\
-		hde.flags = _flags;				\
-								\
-		handoff_data_add_entry(&hde);			\
+#define handoff_data_add_flags(_cookie, _data, _size, _flags)		\
+	do {								\
+		static struct handoff_data_entry hde __section(.data);	\
+		hde.cookie = _cookie;					\
+		hde.data = _data;					\
+		hde.size = _size;					\
+		hde.flags = _flags;					\
+									\
+		handoff_data_add_entry(&hde);				\
 	} while (0);
 
 #define handoff_data_add(_cookie, _data, _size)			\
diff --git a/pbl/handoff-data.c b/pbl/handoff-data.c
index e6745797c0..85c3985995 100644
--- a/pbl/handoff-data.c
+++ b/pbl/handoff-data.c
@@ -9,7 +9,7 @@ static struct handoff_data *handoff_data = (void *)-1;
 
 static struct handoff_data *handoff_data_get(void)
 {
-	static struct handoff_data __handoff_data;
+	static struct handoff_data __handoff_data __section(.data);
 
 	/*
 	 * Sometimes the PBL copies itself to some other location and is
-- 
2.39.2




  reply	other threads:[~2024-05-21 10:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-21 10:49 [PATCH 0/4] make more use of handoff data Sascha Hauer
2024-05-21 10:49 ` Sascha Hauer [this message]
2024-05-21 10:49 ` [PATCH 2/4] efi-payload: use handoff data to pass data to barebox proper Sascha Hauer
2024-05-21 12:39   ` Ahmad Fatoum
2024-05-21 10:49 ` [PATCH 3/4] ARM: beagle: setup C environment early Sascha Hauer
2024-05-21 10:49 ` [PATCH 4/4] ARM: replace boarddata with handoff data Sascha Hauer
2024-05-22  5:42 ` [PATCH 0/4] make more use of " Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240521104913.1983970-2-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox