Re: [U-Boot] [PATCH v3] Fix board init code to use a valid C runtime environment

2015-11-15 Thread Albert ARIBAUD
Hello Simon, On Sat, 14 Nov 2015 08:41:01 -0700, Simon Glass wrote: > Reading between the lines, there isn't actually a problem with this in > practice, but it is doing things that C should not really be doing. Is > that right? You did not even need to read between the lines

Re: [U-Boot] [PATCH v3] Fix board init code to use a valid C runtime environment

2015-11-14 Thread Thomas Chou
Hi Albert, On 2015年11月14日 23:06, Albert ARIBAUD wrote: Hello Thomas, On Sat, 14 Nov 2015 14:23:31 +0800, Thomas Chou wrote: Hi Albert, On 2015年11月13日 22:43, Albert ARIBAUD wrote: +/* + * Initialize reserved space (which has been safely allocated on the C + * stack

Re: [U-Boot] [PATCH v3] Fix board init code to use a valid C runtime environment

2015-11-14 Thread Albert ARIBAUD
Hello Simon, On Fri, 13 Nov 2015 19:29:21 -0700, Simon Glass wrote: > Hi Albert, > > On 13 November 2015 at 07:43, Albert ARIBAUD > wrote: > > board_init_f_mem() alters the C runtime environment's > > stack it ls actually already using. This is

Re: [U-Boot] [PATCH v3] Fix board init code to use a valid C runtime environment

2015-11-14 Thread Albert ARIBAUD
Hello Thomas, On Sat, 14 Nov 2015 14:23:31 +0800, Thomas Chou wrote: > Hi Albert, > > On 2015年11月13日 22:43, Albert ARIBAUD wrote: > > +/* > > + * Initialize reserved space (which has been safely allocated on the C > > + * stack from the C runtime environment handling

Re: [U-Boot] [PATCH v3] Fix board init code to use a valid C runtime environment

2015-11-14 Thread Simon Glass
Hi Albert, On 14 November 2015 at 07:36, Albert ARIBAUD wrote: > Hello Simon, > > On Fri, 13 Nov 2015 19:29:21 -0700, Simon Glass > wrote: >> Hi Albert, >> >> On 13 November 2015 at 07:43, Albert ARIBAUD >> wrote: >> >

Re: [U-Boot] [PATCH v3] Fix board init code to use a valid C runtime environment

2015-11-13 Thread Simon Glass
Hi Albert, On 13 November 2015 at 07:43, Albert ARIBAUD wrote: > board_init_f_mem() alters the C runtime environment's > stack it ls actually already using. This is not a valid > C runtime environment. I think it is doing something like alloca() and reserving space on

Re: [U-Boot] [PATCH v3] Fix board init code to use a valid C runtime environment

2015-11-13 Thread Thomas Chou
Hi Albert, On 2015年11月13日 22:43, Albert ARIBAUD wrote: +/* + * Initialize reserved space (which has been safely allocated on the C + * stack from the C runtime environment handling code). + * + * Do not use 'gd->' until arch_setup_gd() has been called! + */ + +void

[U-Boot] [PATCH v3] Fix board init code to use a valid C runtime environment

2015-11-13 Thread Albert ARIBAUD
board_init_f_mem() alters the C runtime environment's stack it ls actually already using. This is not a valid C runtime environment. Split board_init_f_mem into C functions which do not alter their own stack and therefore run in a valid C runtime environment. Signed-off-by: Albert ARIBAUD