All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Olof Johansson <olof@lixom.net>, ppcdev <linuxppc-dev@ozlabs.org>,
	Milton Miller <miltonm@bga.com>
Subject: Re: [PATCH 5/6] Support for the Ebony 440GP reference board in arch/powerpc
Date: Sun, 6 May 2007 10:43:19 +1000	[thread overview]
Message-ID: <20070506004319.GH11303@localhost.localdomain> (raw)
In-Reply-To: <1a1a143ae0292ea0a6006a26fb95a446@kernel.crashing.org>

On Sat, May 05, 2007 at 10:37:37PM +0200, Segher Boessenkool wrote:
> >>> +static void ebony_exit(void)
> >>> +{
> >>> +     unsigned long tmp;
> >>> +
> >>> +     asm volatile (
> >>> +             "mfspr  %0,%1\n"
> >>> +             "oris   %0,%0,%2@h\n"
> >>> +             "mtspr  %1,%0"
> >>> +             : "=&r"(tmp) : "i"(SPRN_DBCR0), "i"(DBCR0_RST_SYSTEM)
> >>
> >> You don't have to pass in the constants here, you can specify them in
> >> the asm. Makes it a little more readable.
> >
> > How?   CPP doesn't apply inside the strings.
> 
> So put it outside the strings:
> 
> +     asm volatile (
> +             "mfspr  %0," #SPRN_DBCR0 "\n\t"
> +             "oris   %0,%0," #DBCR0_RST_SYSTEM "@h\n\t"
> +             "mtspr  " #SPRN_DBCR0 ",%0"
> +             : "=&r"(tmp));

Um, I think stringify(SPRN_DBCR0) is needed there, not just a bare #.
At which point it's not entirely clear to be that just using the "i"
constraint isn't the simplest option after all.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

  reply	other threads:[~2007-05-06  0:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-04  5:54 [0/6] Ebony support David Gibson
2007-05-04  5:57 ` [PATCH 2/6] Use resource_size_t for serial port IO addresses David Gibson
2007-05-04  5:57 ` [PATCH 5/6] Support for the Ebony 440GP reference board in arch/powerpc David Gibson
2007-05-04 14:36   ` Olof Johansson
2007-05-05 18:43     ` Milton Miller
2007-05-05 19:02       ` Olof Johansson
2007-05-05 20:37       ` Segher Boessenkool
2007-05-06  0:43         ` David Gibson [this message]
2007-05-06  1:58           ` Segher Boessenkool
2007-05-07  3:22     ` David Gibson
2007-05-07  3:45       ` Olof Johansson
2007-05-07  4:02         ` David Gibson
2007-05-07 10:41   ` Josh Boyer
2007-05-04  5:57 ` [PATCH 6/6] Early serial debug support for PPC44x David Gibson
2007-05-04  5:57 ` [PATCH 1/6] Only legacy ports should allow addr/irq changes via setserial David Gibson
2007-05-04  5:57 ` [PATCH 3/6] Add device tree for Ebony David Gibson
2007-05-07  0:30 ` [PATCH 4/6] Device tree aware EMAC driver David Gibson
2007-05-07  0:57   ` Olof Johansson
2007-05-07  1:40     ` David Gibson
2007-05-07  3:56       ` Olof Johansson
2007-05-07  4:10         ` David Gibson

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=20070506004319.GH11303@localhost.localdomain \
    --to=david@gibson.dropbear.id.au \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=miltonm@bga.com \
    --cc=olof@lixom.net \
    --cc=segher@kernel.crashing.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.