[U-Boot] [PATCH] make hang() a weak function

Wolfgang Denk wd at denx.de
Tue Apr 16 15:05:14 CEST 2013


Dear Andreas,

In message <516D4B00.9030102 at gmail.com> you wrote:
>
> > So it is dead code in mainline, and we will not add it.
> 
> Well, I don't think it is dead code cause the hang() is called in some ways.
> This patch opens just the possibility to specialize the hang() by for
> example a specific board. Maybe this could also be used for specific
> hang() for different arches when we get closer to the common board files.

I think it is dead code, and not needed nor useful in mainline.  I
cannot even see how it would be useful for you.  hang() is defined to
"hang" the CPU, i. e. to make sure the system will remain in the
current state.  To me this naturally translates into an infinite loop,
the implementation of which is completely hardware and architecture
independent.

Note that hang() is not supposed to do anything else, it just hangs
the system.  If you have a debugger attached, you will be able to do a
simple stack backtrace and see exactly where you are hanging, and why.

If you think you need to have specialized code, you are doing
something wrong.

> It is correct that we do not need this patch now and I can handle it
> here in my own tree.

Good.

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
God made machine language; all the rest is the work of man.


More information about the U-Boot mailing list