[ECOS] Calling exit in a Redboot standalone Arm program

Jonathan Larmour jifl@eCosCentric.com
Thu Apr 24 02:30:00 GMT 2003


Just to avoid any doubt, Pierre, are you going to look at this? You're the 
one with the incentive to do it :-). Look at the various places that 
go_saved_context is used in redboot's src/main.c.

I think the attached patch might do it, but it's purely off the top of my 
head. If it does then all you need to do to finish it off is just rename 
go_saved_context to redboot_return_context or something like that, and 
something similar for go_trampoline; and then most importantly test it 
with the below exit status change as well to verify it all builds and 
works. Oh, and add ChangeLog entries :).

Jifl

Mark Salter wrote:
>>>>>>Jonathan Larmour writes:
> 
> 
>>Pierre Habraken wrote:
>>
>>>Mark Salter wrote:
>>>
>>>
>>>>[...]
>>>>Something to watch out for is that any patch not break the ability to
>>>>quit GDB and return to the RedBoot prompt.
> 
> 
>>Haven't tried it so I'm probably way off base, but could this maybe simply 
>>be done by making the code in question just be:
> 
> 
>>        __send_exit_status((int)arg1);
>>        CYGACC_CALL_IF_MONITOR_RETURN(arg1);
> 
> 
> This isn't way off base, but it won't work right now. The context used by
> CYGACC_CALL_IF_MONITOR_RETURN is only setup through the 'go' command right
> now. The return back to stub is handled by saving a context on the first
> entry to the stub and then restoring that context when a 'k' packet is
> received from GDB. We could get rid of that mechanism (good riddance) and
> setup a context for CYGACC_CALL_IF_MONITOR_RETURN before entering the stub.
> 
> --Mark
> 


-- 
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
--[ "You can complain because roses have thorns, or you ]--
--[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: redboot.contextswap.pat
URL: <http://sourceware.org/pipermail/ecos-discuss/attachments/20030424/9c5c4b79/attachment.ksh>
-------------- next part --------------
-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


More information about the Ecos-discuss mailing list