public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Graeme Russ <graeme.russ@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC][PATCH] Generate CRC of structure of Global Data for standalone apps
Date: Sun, 04 Sep 2011 09:50:12 +1000	[thread overview]
Message-ID: <4E62BD34.8060303@gmail.com> (raw)
In-Reply-To: <20110903194427.C4915140ABD6@gemini.denx.de>

On 04/09/11 05:44, Wolfgang Denk wrote:
> Dear Graeme Russ,
> 
> In message <4E621E4E.8010703@gmail.com> you wrote:
>>
>> Back the original question that spawned this - asked several times and
>> never answered - Does a modification to the Global Data structure trigger
>> an increment of XF_VERSION?
> 
> I don't think so.  But I have to admit that I never thoroughly
> verifyed this either.  The standalone code itself is not suposed to
> reference GD in any way; and the U-Boot routines that the standalone
> call can call are runnign in the context of the current U-Boot, where
> everything fits together.  So unless somebody misuses something, it
> should all work out well.  At least, that's my theory.

So perhaps this should be removed from exports.h:

#if defined(CONFIG_X86)
extern gd_t *global_data;
#endif

And document that standalone applications must not directly access the
global data structure.

The whole point of the patch was that it is critical that when a standalone
application accesses global data, the version of the structure that it is
accessing is exactly the same as the version being accessed by U-Boot.
There are two ways of handling this:

1) Add an export function to access global data members by name (reporting
an error if the member does not exist)
2) 'Sign' the structure of the global data (this patch)

Regards,

Graeme

  reply	other threads:[~2011-09-03 23:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-03 11:21 [U-Boot] [RFC][PATCH] Generate CRC of structure of Global Data for standalone apps Graeme Russ
2011-09-03 12:13 ` Wolfgang Denk
2011-09-03 12:32   ` Graeme Russ
2011-09-03 19:44     ` Wolfgang Denk
2011-09-03 23:50       ` Graeme Russ [this message]
2011-09-04  6:30         ` Albert ARIBAUD
2011-09-04  5:56   ` Graeme Russ

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=4E62BD34.8060303@gmail.com \
    --to=graeme.russ@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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