[parisc-linux] Oopser
Grant Grundler
grundler@cup.hp.com
Sat, 13 Jan 2001 09:08:38 -0800
Matthew Wilcox wrote:
>
> I'm interested in having a useful debugging tool written by someone who
> knows the processor really well. What I basically want to be able to
> do is call oopser(10 * HZ) and have the machine reliably crash in 10
> seconds time (and do a register dump). that would at least tell me
> where the kernel's got to.
static inline void oopser(unsigned long t)
{
unsigned long flags;
unsigned long addr=(unsigned long) -8L;
mdelay((t * 1000)/HZ);
/* Oopsy doopsy willy fall down and go boom :^) */
asm volatile(
" rsm 2,%0
ldwx 0(%2),%1"
: "=&r" (flags), "=r" (t) : "r" (addr) );
}
mdelay watches CR16 and doesn't need (or even want) interrupts
enabled. If you want a register dump to console, call panic
or steal^H^H^H^H^Hborrow code from panic.
Otherwise it'll be in the HPMC portion of the PIM dump.
If it's truly inlined, GR2 and PC will be preserved.
I'm pretty sure -8L (reset vector?) won't work - but anything in
0xF-space (I/O space) which isn't ever used by platform devices
should work. Offhand I can't pick an address for all platforms.
grant
> it'd be most useful if it worked with interrupts disabled, but even
> something which required interrupts to be enabled would be of some use.
>
> --
> Revolutions do not require corporate support.
>
> ---------------------------------------------------------------------------
> To unsubscribe: send e-mail to parisc-linux-request@thepuffingroup.com with
> `unsubscribe' as the subject.
>
Grant Grundler
Unix Systems Enablement Lab
+1.408.447.7253