Re: [U-Boot] [PATCH 5/5] New implementation for internal handling of environment variables.

20 Jul
2010
20 Jul
'10
10:35 p.m.
Dear Peter,
In message 1279658019.5685.125.camel@thunk you wrote:
I think the problem is that before relocation we have to use getenv_r(), which is done for example to read the baudrate, see arch/powerpc/lib/board.c: init_baudrate()
How hard is it to detect this case and generate a stackdump if someone calls getenv() before relocation is complete? That would help to spot places where people are breaking the rules...
It's trivial to check - all we need to addd to getenv() is something like
if (!(gd->flags & GD_FLG_RELOC)) bail_out();
But then, we could as well try to be friendly and eliminate getenv_r(). We would just need a static buffer for the result.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Reader, suppose you were an idiot. And suppose you were a member of
Congress. But I repeat myself. - Mark Twain
5411
Age (days ago)
5411
Last active (days ago)
0 comments
1 participants
participants (1)
-
Wolfgang Denk