* RE: accessing Alpha CPU registers from panic()
[not found] <15AD5D7936F8D21198240000F831776E3E7FF3@dboexc1.dbo.cpqcorp.net>
@ 1999-12-15 5:00 ` Brian Hall
1999-12-15 5:00 ` Chris
0 siblings, 1 reply; 6+ messages in thread
From: Brian Hall @ 1999-12-15 5:00 UTC (permalink / raw)
Unfortunately, all the code in the dik_* functions depends on the registers
being passed in, as far as I can tell. When panic() is called, the registers are
not included in the arguments. I think somehow I need to get the PC and RA (r26)
from the previous stack frame or something.
I was hoping to get the registers from PALcode, but I don't see any way of doing
that, other than halting the processor, which would give me the info I need in
the HWRPB. The last thing done in panic() is a halt, is there a way to do that
and then have the PALcode jump to my routine? Of course, even if this worked,
the PC and RA in the HWRPB would just be from the panic() routine; I need those
addresses from the function that *called* panic() !
On 15-Dec-1999 Jakma, Paul wrote:
> hi brian,
>
> Richard Henderson has already written some stuff to do this. Do a grep for
> dik_* functions in arch/alpha.
>
>>
>> I am working on porting the SGI crash tools to Alpha. Since
>> the CPU registers
>> aren't available from within the panic() call, I need to grab
>> them directly.
>> How do I do this? The equivalent i386 code is:
>>
>> /* save the dump specific esp/eip */
>> /* For Alpha, save PC (Program Counter) and RA */
>> __asm__ __volatile__("
>> pushl %%eax\n
>> movl %%esp, %%eax\n
>> movl %%eax, %0\n
>> popl %%eax\n"
>> : "=g" (dump_header.dh_esp)
>> );
>> __asm__ __volatile__("pushl %eax\n");
>> __dump_save_panic_regs();
>> __asm__ __volatile__("popl %eax\n");
>>
>> Pointers to online resources are greatly welcomed also.
--
Brian Hall <brianw.hall@compaq.com>
Linux Consultant
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: accessing Alpha CPU registers from panic()
1999-12-15 5:00 ` accessing Alpha CPU registers from panic() Brian Hall
@ 1999-12-15 5:00 ` Chris
1999-12-16 5:00 ` brianw.hall
0 siblings, 1 reply; 6+ messages in thread
From: Chris @ 1999-12-15 5:00 UTC (permalink / raw)
Brian Hall wrote:
>
> Unfortunately, all the code in the dik_* functions depends on the registers
> being passed in, as far as I can tell. When panic() is called, the registers are
> not included in the arguments. I think somehow I need to get the PC and RA (r26)
> from the previous stack frame or something.
>
Hi,
What you could do is rename panic() to panic_1() or somesuch, then write
a little slip function called panic() that save saves / prints the
registers, then calls panic_1() with registers intact.
It's the sort of thing done all the time in embedded work, you can say
if that sounds stupid in Linux...
Rgrds, Chris
> I was hoping to get the registers from PALcode, but I don't see any way of doing
> that, other than halting the processor, which would give me the info I need in
> the HWRPB. The last thing done in panic() is a halt, is there a way to do that
> and then have the PALcode jump to my routine? Of course, even if this worked,
> the PC and RA in the HWRPB would just be from the panic() routine; I need those
> addresses from the function that *called* panic() !
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: accessing Alpha CPU registers from panic()
1999-12-15 5:00 ` Chris
@ 1999-12-16 5:00 ` brianw.hall
1999-12-16 5:00 ` Chris
0 siblings, 1 reply; 6+ messages in thread
From: brianw.hall @ 1999-12-16 5:00 UTC (permalink / raw)
Problem is, the call to panic() doesn't include the registers to start
with, so where do I get them from? Trying to figure out how to get the
information off the kernel stack...
In article <3857D503.38CFE9EB@dtn.ntl.com>,
Chris <quattro_net@dtn.ntl.com> wrote:
> Brian Hall wrote:
> >
> > Unfortunately, all the code in the dik_* functions depends on the
registers
> > being passed in, as far as I can tell. When panic() is called, the
registers are
> > not included in the arguments. I think somehow I need to get the PC
and RA (r26)
> > from the previous stack frame or something.
> >
> Hi,
>
> What you could do is rename panic() to panic_1() or somesuch, then
write
> a little slip function called panic() that save saves / prints the
> registers, then calls panic_1() with registers intact.
>
> It's the sort of thing done all the time in embedded work, you can say
> if that sounds stupid in Linux...
>
> Rgrds, Chris
>
> > I was hoping to get the registers from PALcode, but I don't see any
way of doing
> > that, other than halting the processor, which would give me the info
I need in
> > the HWRPB. The last thing done in panic() is a halt, is there a way
to do that
> > and then have the PALcode jump to my routine? Of course, even if
this worked,
> > the PC and RA in the HWRPB would just be from the panic() routine; I
need those
> > addresses from the function that *called* panic() !
> >
>
Sent via Deja.com http://www.deja.com/
Before you buy.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: accessing Alpha CPU registers from panic()
1999-12-16 5:00 ` brianw.hall
@ 1999-12-16 5:00 ` Chris
1999-12-17 5:00 ` Scott Wood
0 siblings, 1 reply; 6+ messages in thread
From: Chris @ 1999-12-16 5:00 UTC (permalink / raw)
brianw.hall@compaq.com wrote:
Yes, but what registers are changed between the function calling panic()
and entry to panic() ?. I'm no Alpha cpu or Linux guru, but no register
contents should be changed during the call. If the call to panic() is a
result of a context switch, then the register values of the calling
process should be in the process control block.
Normally, the program counter and stack pointer would be saved at a
minimum, but the remaining registers should be in the state they were in
when panic() was called.
Rgrds, Chris
>
> Problem is, the call to panic() doesn't include the registers to start
> with, so where do I get them from? Trying to figure out how to get the
> information off the kernel stack...
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: accessing Alpha CPU registers from panic()
1999-12-16 5:00 ` Chris
@ 1999-12-17 5:00 ` Scott Wood
0 siblings, 0 replies; 6+ messages in thread
From: Scott Wood @ 1999-12-17 5:00 UTC (permalink / raw)
On Thu, 16 Dec 1999 20:06:50 +0000, Chris <quattro_net@dtn.ntl.com> wrote:
>brianw.hall@compaq.com wrote:
>Yes, but what registers are changed between the function calling panic()
>and entry to panic() ?. I'm no Alpha cpu or Linux guru, but no register
>contents should be changed during the call. If the call to panic() is a
>result of a context switch, then the register values of the calling
>process should be in the process control block.
>
>Normally, the program counter and stack pointer would be saved at a
>minimum, but the remaining registers should be in the state they were in
>when panic() was called.
There's also the argument registers (a0 at the least, plus one per
extra argument). The original ra is stored on the stack and
replaced by the calling address, and the stack frame size for panic is
subtracted from sp.
Everything else should be the same, though.
-Scott
^ permalink raw reply [flat|nested] 6+ messages in thread
* accessing Alpha CPU registers from panic()
@ 1999-12-13 5:00 Brian Hall
0 siblings, 0 replies; 6+ messages in thread
From: Brian Hall @ 1999-12-13 5:00 UTC (permalink / raw)
I am working on porting the SGI crash tools to Alpha. Since the CPU registers
aren't available from within the panic() call, I need to grab them directly.
How do I do this? The equivalent i386 code is:
/* save the dump specific esp/eip */
/* For Alpha, save PC (Program Counter) and RA */
__asm__ __volatile__("
pushl %%eax\n
movl %%esp, %%eax\n
movl %%eax, %0\n
popl %%eax\n"
: "=g" (dump_header.dh_esp)
);
__asm__ __volatile__("pushl %eax\n");
__dump_save_panic_regs();
__asm__ __volatile__("popl %eax\n");
Pointers to online resources are greatly welcomed also.
--
Brian Hall <brianw.hall@compaq.com>
Linux Consultant
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~1999-12-17 5:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <15AD5D7936F8D21198240000F831776E3E7FF3@dboexc1.dbo.cpqcorp.net>
1999-12-15 5:00 ` accessing Alpha CPU registers from panic() Brian Hall
1999-12-15 5:00 ` Chris
1999-12-16 5:00 ` brianw.hall
1999-12-16 5:00 ` Chris
1999-12-17 5:00 ` Scott Wood
1999-12-13 5:00 Brian Hall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox