This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: support return to redboot from go


>>>>> Brian Murphy writes:

> Not really sure what all of the patch does but it at least needs this 
> change to compile on mips:

Interesting. What was the compiler error message?


> diff -u -r1.38 main.c
> --- packages/redboot//current/src/main.c        31 Jan 2003 16:46:01 
> -0000      1.38
> +++ packages/redboot//current/src/main.c        4 Feb 2003 21:15:33 -0000
> @@ -411,6 +411,7 @@
>      go_return_status = status;
>      HAL_THREAD_LOAD_CONTEXT(&go_saved_context);
>      // never returns
> +    CYGARC_HAL_RESTORE_GP();
>  }

I'll add it in for completeness although it never gets executed.

>  void

> Although if the comment is correct why the CYGARC_HAL_SAVE_GP ?

The caller of this function may be another program with its own $gp.
On mips, SAVE_GP saves the caller $gp register and sets up $gp to the
value RedBoot expects. The RESTORE_GP reverses this on function exit.
SAVE_GP needs to be there because go_return_status or go_saved_context
could be referenced relative to $gp.

Thanks for reporting this.

--Mark




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]