<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>

<META content="MSHTML 6.00.2800.1170" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN 
class=707132821-23062003>Hello,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=707132821-23062003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=707132821-23062003>I'm just fixing a 
bug which I see exists in all the ARM ports.&nbsp; I just wrote a bit of code 
for my arm925 which caused an exception, given the way the code is written one 
would expect that it would print an error frame then possibly reset....instead 
it just locked up.&nbsp; Tracing the code I see that the exception code in 
start.S for all ARM ports uses r8 as a frame pointer.&nbsp; This is NOT allowed 
as r8 is reserved as the global data pointer....given the way the ARM code 
currently operates I don't see why this has to be, but it might be handy if 
someone was trying to use C before the memory controller was up (this is not the 
case for the ARM code today).</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=707132821-23062003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=707132821-23062003>Anyway, what you 
will see is :&nbsp; </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=707132821-23062003>&nbsp;&nbsp;&nbsp; 
A-- Program does something bad</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=707132821-23062003>&nbsp;&nbsp;&nbsp; 
-- takes the exception</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=707132821-23062003>&nbsp;&nbsp;&nbsp; 
-- the exception trashes r8</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=707132821-23062003>&nbsp;&nbsp;&nbsp; 
-- the code attempts to print the error, unfortunately the print code tries to 
use r8&nbsp;to find some info...</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=707132821-23062003>&nbsp;&nbsp;&nbsp; 
-- The dereference of the bad global data pointer messes up proper operation, 
resulting in another data abort</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=707132821-23062003>&nbsp;&nbsp;&nbsp; 
-- Goto A:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=707132821-23062003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=707132821-23062003>For myself, I'll may 
just remove the setting of the frame pointer into r8, it really gains you 
nothing in this code.&nbsp; If exceptions were to be handled perhaps it might be 
useful, but it still shouldn't be necessary as you should be able to unwind the 
stack with out doing this. I'll have to do a little thinking to see what is 
correct.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=707132821-23062003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=707132821-23062003>I'd submit patches 
but I don't have other&nbsp;ARMs to test on so I'll just fix my 925 tree.&nbsp; 
Having&nbsp;boot code which can get into an infinite loop is not a good thing 
and forces power cycles for recovery.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=707132821-23062003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=707132821-23062003>Re-looking I see the 
cpu/920 recently removed its r8 call for abort recovery, it did not however 
remove it for its irq sources. So it could have some problems when the irq 
function derefereced the pointer.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=707132821-23062003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=707132821-23062003>Regards,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=707132821-23062003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=707132821-23062003>Richard 
Woodruff.&nbsp;</SPAN></FONT></DIV></BODY></HTML>