return() from a u-boot application
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.
Quoted 3 lines · In message <[email protected]> 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.
Quoted 2 lines
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
Signature · 5 lines
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.
Thank you for the setjmp/longjmp suggestion. That should do the job.
-andrew
Quoted 21 lines · Wolfgang Denk
Quoted 2 lines · In message <[email protected]> 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 somethingThere is no way to do this rigth now.
Quoted 2 lines
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()andlongjmp().Best regards,
Wolfgang Denk