[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gen68360 BSP changes.



Jake Janovetz wrote:
> 
> Hi again...
> 
>    I noted the following changes in the gen68360 BSP.  Can someone
> explain what changes in RTEMS caused them:
> 
> 1. start360 directory and start360.S have been renamed.  Didn't seem
>    like a big deal until I found I had to do the same with my BSP.

I think Joel is trying to make the development environment similar
across architectures.

> 
> 2. The following code in start.S has changed.  There was no previous
>    'env' and 'arg' was pushed using "movel d0,a7@-" just as argc is.
> 
>         movel   #stack_init,a7          | set master stack pointer
>         pea     env                     | envp
>         pea     arg                     | argv
>         movel   d0,a7@-                 | argc
>         jsr     SYM(boot_card)          | Call C main

This is so that the argv and envp arguments to main are pointers to
NULL, instead of NULL pointers :-)  
This makes argv[argc] a valid value and avoids dereferencing a NULL
pointer.

-- 
Eric Norum                                 eric@cls.usask.ca
Canadian Light Source                      Phone: (306) 966-6308
University of Saskatchewan                 FAX:   (306) 966-6058
Saskatoon, Canada.