[PATCH 5/6] Support for the Ebony 440GP reference board in arch/powerpc

Segher Boessenkool segher at kernel.crashing.org
Sun May 6 06:37:37 EST 2007


>>> +static void ebony_exit(void)
>>> +{
>>> +     unsigned long tmp;
>>> +
>>> +     asm volatile (
>>> +             "mfspr  %0,%1\n"
>>> +             "oris   %0,%0,%2 at 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));


Segher




More information about the Linuxppc-dev mailing list