This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH -tip -v10 5/7] x86: add pt_regs register and stack access APIs
- From: Andi Kleen <andi at firstfloor dot org>
- To: Masami Hiramatsu <mhiramat at redhat dot com>
- Cc: Andi Kleen <andi at firstfloor dot org>, Ingo Molnar <mingo at elte dot hu>, Steven Rostedt <rostedt at goodmis dot org>, lkml <linux-kernel at vger dot kernel dot org>, systemtap <systemtap at sources dot redhat dot com>, kvm <kvm at vger dot kernel dot org>, DLE <dle-develop at lists dot sourceforge dot net>, Christoph Hellwig <hch at infradead dot org>, Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>, Frederic Weisbecker <fweisbec at gmail dot com>, Roland McGrath <roland at redhat dot com>, Srikar Dronamraju <srikar at linux dot vnet dot ibm dot com>, linux-arch at vger dot kernel dot org
- Date: Mon, 6 Jul 2009 22:06:34 +0200
- Subject: Re: [PATCH -tip -v10 5/7] x86: add pt_regs register and stack access APIs
- References: <20090701010838.32547.62843.stgit@localhost.localdomain> <20090701010911.32547.1313.stgit@localhost.localdomain> <871votop6a.fsf@basil.nowhere.org> <4A525042.5030702@redhat.com>
On Mon, Jul 06, 2009 at 03:28:02PM -0400, Masami Hiramatsu wrote:
> I'm not so sure about your idea.
> Would you mean below code?
>
> int offs_table[NR_REGPARMS] = {
not REGPARMS of course
> [0] = offsetof(struct pt_regs, di),
> ...
> };
> if (n < NR_REGPARMS)
> return *((unsigned long *)regs + offs_table[n]);
Yes.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.