On Monday 23 January 2012 01:48:50 Simon Glass wrote:
> --- a/arch/sandbox/cpu/start.c
> +++ b/arch/sandbox/cpu/start.c
> 
>  int main(int argc, char *argv[])
>  {
> +     struct sandbox_state *state = NULL;
> +     int err;
> +
> +     err = state_init();
> +     if (!err) {
> +             state = state_get_current();
> +             assert(state);
> +     }

i guess a lot of this checking/plumbing only makes sense in the context of 
future work where the state represents a lot more stuff

> --- /dev/null
> +++ b/arch/sandbox/cpu/state.c
>
> +struct sandbox_state main_state;
> +struct sandbox_state *state; /* Pointer to current state record */

static

> +int state_is_processor_reset(void)
> +{
> +     return 1;
> +}

if the cpu is in reset, then u-boot is dead ...

> +struct sandbox_state *state_get_current(void)
> +{
> +     assert(state);
> +     return state;
> +}

you assert() here and in main() ... i think we can get rid of the one in the 
main() func

> --- /dev/null
> +++ b/arch/sandbox/include/asm/arch-sandbox/state.h

needs ifdef protection against multiple inclusion

> +/* The complete state of the test system */
> +struct sandbox_state {
> +     const char *cmd;                /* Command to execute */
> +     enum exit_type_id exit_type;    /* How we exited U-Boot */
> +};

the argc/argv given to main() should be in here
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to