[U-Boot] [RFC][PATCH] Generate CRC of structure of Global Data for standalone apps
Albert ARIBAUD
albert.u.boot at aribaud.net
Sun Sep 4 08:30:15 CEST 2011
Le 04/09/2011 01:50, Graeme Russ a écrit :
> On 04/09/11 05:44, Wolfgang Denk wrote:
>> Dear Graeme Russ,
>>
>> In message<4E621E4E.8010703 at 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)
Seems like the export function is what we should be aiming for, except
that IMO the list of these functions should match a list of functional
properties that U-Boot standalone applications need regardless to how
these properties are computed, not a list of members that happen to
exist in a structure at a given moment.
> Regards,
>
> Graeme
Amicalement,
--
Albert.
More information about the U-Boot
mailing list