diff mbox series

[1/2] parisc: Add constant for control registers and clean up mfctl()

Message ID 20220325164040.502188-1-deller@gmx.de (mailing list archive)
State Superseded
Headers show
Series [1/2] parisc: Add constant for control registers and clean up mfctl() | expand

Commit Message

Helge Deller March 25, 2022, 4:40 p.m. UTC
Clean up the code and add often used constants.

Signed-off-by: Helge Deller <deller@gmx.de>
---
 arch/parisc/include/asm/special_insns.h | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

--
2.35.1
diff mbox series

Patch

diff --git a/arch/parisc/include/asm/special_insns.h b/arch/parisc/include/asm/special_insns.h
index 41b3ddbd344c..c822bd0c0e3c 100644
--- a/arch/parisc/include/asm/special_insns.h
+++ b/arch/parisc/include/asm/special_insns.h
@@ -30,11 +30,15 @@ 
 	pa;						\
 })

+#define CR_EIEM 15	/* External Interrupt Enable Mask */
+#define CR_CR16 16	/* CR16 Interval Timer */
+#define CR_EIRR 23	/* External Interrupt Request Register */
+
 #define mfctl(reg)	({		\
 	unsigned long cr;		\
 	__asm__ __volatile__(		\
-		"mfctl " #reg ",%0" :	\
-		 "=r" (cr)		\
+		"mfctl %1,%0" :		\
+		 "=r" (cr) : "i" (reg)	\
 	);				\
 	cr;				\
 })
@@ -44,13 +48,8 @@ 
 		: /* no outputs */ \
 		: "r" (gr), "i" (cr) : "memory")

-/* these are here to de-mystefy the calling code, and to provide hooks */
-/* which I needed for debugging EIEM problems -PB */
-#define get_eiem() mfctl(15)
-static inline void set_eiem(unsigned long val)
-{
-	mtctl(val, 15);
-}
+#define get_eiem()	mfctl(CR_EIEM)
+#define set_eiem(val)	mtctl(val, CR_EIEM)

 #define mfsp(reg)	({		\
 	unsigned long cr;		\