diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2013-06-29 13:00:06 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2013-06-29 13:00:06 +0000 |
commit | 4818d2af9d2aca4c257be9a3e15738a85bff36eb (patch) | |
tree | 007c0f8c0d6d675e6bd3b9c5495240fadf2958b4 /sys/arch | |
parent | 1380954e125bd7b4b6d785f242170844d83fd843 (diff) |
Turn mfpr() and mtpr() into inline functions.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/vax/include/mtpr.h | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/sys/arch/vax/include/mtpr.h b/sys/arch/vax/include/mtpr.h index 1cd7df195e8..df6275b535d 100644 --- a/sys/arch/vax/include/mtpr.h +++ b/sys/arch/vax/include/mtpr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mtpr.h,v 1.7 2011/09/16 17:20:07 miod Exp $ */ +/* $OpenBSD: mtpr.h,v 1.8 2013/06/29 13:00:05 miod Exp $ */ /* $NetBSD: mtpr.h,v 1.12 1999/06/06 19:06:29 ragge Exp $ */ /* @@ -156,23 +156,26 @@ #define AST_NO 4 #define AST_OK 3 -#ifndef _LOCORE +#ifndef _LOCORE -#define mtpr(val,reg) \ -{ \ - __asm__ __volatile ("mtpr %0,%1" \ - : /* No output */ \ - : "g" (val), "g" (reg)); \ +static inline void +mtpr(register_t val, int reg) +{ + __asm__ __volatile ("mtpr %0,%1" + : /* No output */ + : "g" (val), "g" (reg) + : "memory"); } -#define mfpr(reg) \ -({ \ - register int val; \ - __asm__ __volatile ("mfpr %1,%0" \ - : "=g" (val) \ - : "g" (reg)); \ - val; \ -}) +static inline register_t +mfpr(int reg) +{ + register_t __val; + __asm__ __volatile ("mfpr %1,%0" + : "=g" (__val) + : "g" (reg)); + return __val; +} #endif /* _LOCORE */ #endif /* _MACHINE_MTPR_H_ */ |