linux-mips-fnet
[Top] [All Lists]

Re: Q: R3000, how to manipulate CP0_EPC?

To: linux-mips@fnet.fr
Subject: Re: Q: R3000, how to manipulate CP0_EPC?
From: ralf@uni-koblenz.de
Date: Wed, 28 Jan 1998 09:32:54 +0100
In-reply-to: <199801280711.AA11751@mailfw2.ford.com>; from Harald Koerfgen on Wed, Jan 28, 1998 at 08:10:59AM +0100
References: <XFMail.980127183209.harald.koerfgen@netcologne.de> <19980128015827.34915@uni-koblenz.de> <199801280711.AA11751@mailfw2.ford.com>
On Wed, Jan 28, 1998 at 08:10:59AM +0100, Harald Koerfgen wrote:

> > On the R3000 c0_epc is a readonly register - as documented.  That's ok
> > because the R3000 uses a different way of handling exceptions.  What you'll
> > have to do to return from an exception is about as follows:
> > 
> >    restore c0_status
> >    move k1, sp                          ; needed later
> >    restore all gp registers
> >    restore hi/lo registers
> >    lw   k0, PT_EPC(sp)
> >    jr   k0
> >    rfe                                  ; in the delay slot of the jr
> > 
> >   Ralf
> 
> Thanks for the info, Ralf. Either this is not mentioned in the IDT
> manual or I have simply overlooked this. The Kane book would have saved
> me a lot of headache, I assume.

Yes, the Kane book documents c0_epc as r/o register.  Dunno about the IDT
docs but the R3081 docs from them look quite good otherwise.

>                                  But then again, as a side effect,
> debugging output via serial port is working now on my DS5000/133 :-).

In that case you can try to use the remote debugging support in the kernel.
Ok, it will need some R3k polishing also ...

  Ralf

<Prev in Thread] Current Thread [Next in Thread>