public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] return() from a u-boot application
@ 2005-06-09  2:30 Andrew Wozniak
  2005-06-09  6:49 ` Wolfgang Denk
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Wozniak @ 2005-06-09  2:30 UTC (permalink / raw)
  To: u-boot

Hi,

We have a u-boot "application" (based on hello_world example) which 
implements system specific boot control functions. Normally, a return() 
call from main() will return control back to the u-boot command line. We 
have several error handling subroutines which report and log errors 
through a proprietary PCI based interface.

Would anyone know how to directly return back to the u-boot command line 
from within a subroutine which was called from main()?  Maybe something 
like an exit() call. I want to avoid having to return error codes from 
multiple level of function calls back to main - even though it might not 
be good coding style.

I did try an exit() call but it was undefined. If I export it from 
U-Boot, will it work? i.e return control back to u-boot.

Thanks for any suggestions.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot-Users] return() from a u-boot application
  2005-06-09  2:30 [U-Boot-Users] return() from a u-boot application Andrew Wozniak
@ 2005-06-09  6:49 ` Wolfgang Denk
  2005-06-09 12:51   ` Andrew Wozniak
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Denk @ 2005-06-09  6:49 UTC (permalink / raw)
  To: u-boot

In message <42A7A9C8.2040106@mc.com> you wrote:
> 
> Would anyone know how to directly return back to the u-boot command line 
> from within a subroutine which was called from main()?  Maybe something 

There is no way to do this rigth now.

> I did try an exit() call but it was undefined. If I export it from 
> U-Boot, will it work? i.e return control back to u-boot.

No, it will not work.

You probably want to implement something like setjmp() and longjmp().

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
God grant me the senility to accept the things I cannot  change,  The
frustration  to  try to change things I cannot affect, and the wisdom
to tell the difference.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot-Users] return() from a u-boot application
  2005-06-09  6:49 ` Wolfgang Denk
@ 2005-06-09 12:51   ` Andrew Wozniak
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Wozniak @ 2005-06-09 12:51 UTC (permalink / raw)
  To: u-boot

Thank you for the setjmp/longjmp suggestion. That should do the job.

-andrew

Wolfgang Denk wrote:
> In message <42A7A9C8.2040106@mc.com> you wrote:
> 
>>Would anyone know how to directly return back to the u-boot command line 
>>from within a subroutine which was called from main()?  Maybe something 
> 
> 
> There is no way to do this rigth now.
> 
> 
>>I did try an exit() call but it was undefined. If I export it from 
>>U-Boot, will it work? i.e return control back to u-boot.
> 
> 
> No, it will not work.
> 
> You probably want to implement something like setjmp() and longjmp().
> 
> Best regards,
> 
> Wolfgang Denk
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-06-09 12:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-09  2:30 [U-Boot-Users] return() from a u-boot application Andrew Wozniak
2005-06-09  6:49 ` Wolfgang Denk
2005-06-09 12:51   ` Andrew Wozniak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox