From: Matthew Wilcox <matthew@wil.cx>
To: Joel Soete <soete.joel@scarlet.be>
Cc: grundler <grundler@parisc-linux.org>,
linux-parisc <linux-parisc@vger.kernel.org>,
deller <deller@gmx.de>, kyle <kyle@mcmartin.ca>
Subject: Re: Yet another inline asm worry: mtsp() macro (and may be other)?
Date: Fri, 20 Jun 2008 11:11:51 -0600 [thread overview]
Message-ID: <20080620171151.GU4392@parisc-linux.org> (raw)
In-Reply-To: <K2RLMV$5D6B8CC1910705073A720C99B9A05EBA@scarlet.be>
On Fri, Jun 20, 2008 at 03:01:43PM +0100, Joel Soete wrote:
> Well I tried something:
> @@ -103,10 +108,23 @@
> cr; \
> })
>
> -#define mtsp(gr, cr) \
> - __asm__ __volatile__("mtsp %0,%1" \
> - : /* no outputs */ \
> - : "r" (gr), "i" (cr) : "memory")
> +#define mtsp(lval, i_sr) \
> +{ \
> + if (lval) { \
> + unsigned long reg = (unsigned long)(lval); \
> + __asm__ __volatile__( \
> + "mtsp %0, %%sr%1" \
> + : /* no outputs */ \
> + : "r" (reg), "i" (i_sr) \
> + : "memory"); \
> + } else { \
> + __asm__ __volatile__( \
> + "mtsp %%r0, %%sr%0" \
> + : /* no outputs */ \
> + : "i" (i_sr) \
> + : "memory"); \
> + }; \
> +}
>
> that does well the drill for ccio-dma driver but else where (memcpy or cache)
> it looks worse then the original, so get rid of this idea.
Try this instead:
#define mtsp(space, cr) { \
if (__builtin_constant_p(space) && (space == 0)) { \
__asm__ __volatile__("mtsp %%r0, %0" : \
/* no outputs */ : "i" (cr) : "memory"); \
} else { \
__asm__ __volatile__("mtsp %0, %1" : \
/* no outputs */ : "r" (space), "i" (cr) : \
"memory"); \
} \
}
--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
next prev parent reply other threads:[~2008-06-20 17:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-20 14:01 Yet another inline asm worry: mtsp() macro (and may be other)? Joel Soete
2008-06-20 17:11 ` Matthew Wilcox [this message]
2008-06-21 19:17 ` rubisher
-- strict thread matches above, loose matches on Subject: below --
2008-06-19 11:40 Joel Soete
2008-06-19 16:11 ` Grant Grundler
2008-06-19 20:01 ` Joel Soete
2008-06-22 17:15 ` Grant Grundler
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=20080620171151.GU4392@parisc-linux.org \
--to=matthew@wil.cx \
--cc=deller@gmx.de \
--cc=grundler@parisc-linux.org \
--cc=kyle@mcmartin.ca \
--cc=linux-parisc@vger.kernel.org \
--cc=soete.joel@scarlet.be \
/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