From: jamie@shareable.org (Jamie Lokier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: Add SWP/SWPB emulation for ARMv7 processors (v2)
Date: Fri, 18 Dec 2009 19:48:14 +0000 [thread overview]
Message-ID: <20091218194814.GB1205@shareable.org> (raw)
In-Reply-To: <20091218182007.GF5527@n2100.arm.linux.org.uk>
Russell King - ARM Linux wrote:
> On Fri, Dec 18, 2009 at 06:04:06PM +0000, Leif Lindholm wrote:
> > +static int swp_handler(struct pt_regs *regs, unsigned int instr)
> > +{
> > + unsigned int address, destreg, data;
> > + unsigned int res = 0;
> > + long current_pid = sys_getpid();
>
> Kernel functions calling system calls like this is frowned upon. We
> know what the current PID is - it's available from current->pid. No
> function call required.
Quick nitpick in case Leif follows that advice :-)
sys_getpid returns task_tgid_vnr(current).
It is neither ->pid (gettid returns that), nor directly dereferenced
because of the vnr part. You'll have to decide whether current->tgid
or task_tgid_vnr(current), or current->pid after all are the
appropriate value in this situation.
-- Jamie
next prev parent reply other threads:[~2009-12-18 19:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-18 18:04 [PATCH] ARM: Add SWP/SWPB emulation for ARMv7 processors (v2) Leif Lindholm
2009-12-18 18:20 ` Russell King - ARM Linux
2009-12-18 19:48 ` Jamie Lokier [this message]
2009-12-18 20:01 ` Russell King - ARM Linux
2009-12-18 19:54 ` Jamie Lokier
2009-12-18 20:03 ` Russell King - ARM Linux
2009-12-19 17:18 ` Catalin Marinas
2009-12-19 17:28 ` Russell King - ARM Linux
2010-01-04 18:18 ` Leif Lindholm
2010-01-04 19:34 ` Jamie Lokier
2010-01-05 18:09 ` Leif Lindholm
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=20091218194814.GB1205@shareable.org \
--to=jamie@shareable.org \
--cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.