This is the mail archive of the ecos-discuss@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: Calling exit in a Redboot standalone Arm program


>>>>> Mark Salter writes:

>>>>> 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.

I'm having some doubts about this. I wonder if it is really portable
to do things this way. The HAL_THREAD_* macros are designed to work
from a task context. I think there could be problems with using them
in an exception/interrupt context on some architectures. Specifically,
those architectures that have special "return from exception" insns
which have side effects that the HAL_THREAD_* macros don't duplicate.

--Mark




-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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