From: "Tameen Khan" <tameen@cisco.com>
To: "'linuxppc-dev list'" <linuxppc-dev@lists.linuxppc.org>
Subject: stack frame for interrupts/exceptions in PPC
Date: Tue, 27 Apr 2004 18:11:09 -0700 [thread overview]
Message-ID: <006001c42cbd$b07e12f0$273147ab@amer.cisco.com> (raw)
I am tryting to implement kernel backtracing for PPC.
I need to understand how the process kernel stack/interrupt stack is managed
for PPC in the event of interrupts and exceptions.
ANY pointer to docs/code etc explaining above topic will be appreciated.
What is STACK_FRAME_OVERHEAD_PPC used for??? Its defined to be 16 for PPC
and 112 for PPC64.
I'm have the following issues right now.
1) How to identify stack frames which need special handling. For PPC64 if
the function name is .ret_from_syscall_1 or .ret_from_except, it is deemed
to be an interrupt_frame and handled seperately. There is also special
handling for frame __switch_to.
2) How to get the newpc, newlr and newsp values for these special frames.
Code used for PPC64 is given below.
nip_offset = byte offset of nip in struct pt_regs
r1_offset = byte offset of r1 in struct pt_regs
lr_offset = byte offset of lr in struct pt_regs
if (interrupt_frame) {
newpc = KL_VREAD_PTR(sp +
KL_STACK_FRAME_OVERHEAD_PPC +
nip_offset);
newsp = KL_VREAD_PTR(sp +
KL_STACK_FRAME_OVERHEAD_PPC +
r1_offset);
newlr = KL_VREAD_PTR(sp +
KL_STACK_FRAME_OVERHEAD_PPC +
lr_offset);
frm_size = get_frame_size(sp, newsp, saddr);
}
Thanks
Tameen
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next reply other threads:[~2004-04-28 1:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-28 1:11 Tameen Khan [this message]
2004-04-28 2:07 ` stack frame for interrupts/exceptions in PPC Benjamin Herrenschmidt
2004-04-28 17:41 ` Tameen Khan
2004-04-29 16:31 ` linas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='006001c42cbd$b07e12f0$273147ab@amer.cisco.com' \
--to=tameen@cisco.com \
--cc=linuxppc-dev@lists.linuxppc.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).