[OpenBIOS] [PATCH] ppc: Use mtmsrd on ppc64

Andreas Färber andreas.faerber at web.de
Tue Nov 16 00:30:30 CET 2010


Am 16.11.2010 um 00:27 schrieb Alexander Graf:

> On 16.11.2010, at 00:25, Andreas Färber wrote:
>
>> Cc: Alexander Graf <agraf at suse.de>
>> Signed-off-by: Andreas Färber <andreas.faerber at web.de>
>> ---
>> arch/ppc/qemu/ofmem.c |    8 +++++++-
>> 1 files changed, 7 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/ppc/qemu/ofmem.c b/arch/ppc/qemu/ofmem.c
>> index 9c60841..e8b0b24 100644
>> --- a/arch/ppc/qemu/ofmem.c
>> +++ b/arch/ppc/qemu/ofmem.c
>> @@ -25,6 +25,12 @@
>>
>> #define BIT(n)		(1U<<(31-(n)))
>>
>> +#ifdef __powerpc64__
>> +#define MTMSR "mtmsrd"
>> +#else
>> +#define MTMSR "mtmsr"
>> +#endif
>> +
>> /* called from assembly */
>> extern void dsi_exception( void );
>> extern void isi_exception( void );
>> @@ -417,7 +423,7 @@ setup_mmu( unsigned long ramsize )
>>
>> 	asm volatile("mfmsr %0" : "=r" (msr) : );
>> 	msr |= MSR_IR | MSR_DR;
>> -	asm volatile("mtmsr %0" :: "r" (msr) );
>> +	asm volatile(MTMSR " %0" :: "r" (msr) );
>
> Is that the only occurence of mtmsr in all the code? Better replace  
> all at once or you'll be chasing bugs later on :).

The only one in inline assembler. The question would be how to go  
about turning this into a header-capable macro. For simplicity I  
defined it as a string literal here, doesn't work for real assembler  
obviously.

Andreas


More information about the OpenBIOS mailing list