[U-Boot] [PATCH] make hang() a weak function
Wolfgang Denk
wd at denx.de
Tue Apr 16 16:23:58 CEST 2013
Dear Andreas,
In message <516D5D0A.20403 at gmail.com> you wrote:
>
> In my opinion it makes sense to panic(). In my special case I also need
> to hang() when panic(). The next question is then how to visualize the
> (end-)user of that device that we hang().
The intention behind hang() is to stop doing anything, i. e. to idle
the board. Nothing else.
We can argue if this is always a good thing to do. For example, in
some situations it may be possible to switch off the board instead.
Or, as in your case, to run some code to visualize the state.
I fully agree that these are perfectly reasonable use cases for fatal
error handling in U-Boot. But then, these are not functions to be
implemented in the context of hang(). Hang is a synonym for "place
the CPU into an infinite loop and stop doing anything else".
If you call hang() you agree to hang the system.
If you want to do something else, then please do not call hang(), but
some other function.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Overdrawn? But I still have checks left!
More information about the U-Boot
mailing list