summaryrefslogtreecommitdiffstats
path: root/bsps/powerpc/include/libcpu/spr.h
diff options
context:
space:
mode:
Diffstat (limited to 'bsps/powerpc/include/libcpu/spr.h')
-rw-r--r--bsps/powerpc/include/libcpu/spr.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/bsps/powerpc/include/libcpu/spr.h b/bsps/powerpc/include/libcpu/spr.h
index 6c81d0ee91..4655f24def 100644
--- a/bsps/powerpc/include/libcpu/spr.h
+++ b/bsps/powerpc/include/libcpu/spr.h
@@ -51,26 +51,40 @@ static inline unsigned long _read_##reg(void) \
static inline unsigned long _read_MSR(void)
{
unsigned long val;
- asm volatile("mfmsr %0" : "=r" (val));
+ __asm__ volatile("mfmsr %0" : "=r" (val));
return val;
}
static inline void _write_MSR(unsigned long val)
{
- asm volatile("mtmsr %0" : : "r" (val));
+ __asm__ volatile("mtmsr %0" : : "r" (val));
return;
}
static inline unsigned long _read_SR(void * va)
{
unsigned long val;
- asm volatile("mfsrin %0,%1" : "=r" (val): "r" (va));
+ __asm__ volatile (
+ ".machine \"push\"\n"
+ ".machine \"any\"\n"
+ "mfsrin %0,%1\n"
+ ".machine \"pop\"" :
+ "=r" (val) :
+ "r" (va)
+ );
return val;
}
static inline void _write_SR(unsigned long val, void * va)
{
- asm volatile("mtsrin %0,%1" : : "r"(val), "r" (va): "memory");
+ __asm__ volatile (
+ ".machine \"push\"\n"
+ ".machine \"any\"\n"
+ "mtsrin %0,%1\n"
+ ".machine \"pop\"" : :
+ "r" (val) , "r" (va) :
+ "memory"
+ );
return;
}