Skip to content

Commit 7e0b2be

Browse files
committed
parisc: Add constants for control registers and clean up mfctl()
Clean up the code for the mfctl() and mtctl() functions and add often used constants. Signed-off-by: Helge Deller <deller@gmx.de>
1 parent ed97948 commit 7e0b2be

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

arch/parisc/include/asm/special_insns.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@
3030
pa; \
3131
})
3232

33+
#define CR_EIEM 15 /* External Interrupt Enable Mask */
34+
#define CR_CR16 16 /* CR16 Interval Timer */
35+
#define CR_EIRR 23 /* External Interrupt Request Register */
36+
3337
#define mfctl(reg) ({ \
3438
unsigned long cr; \
3539
__asm__ __volatile__( \
36-
"mfctl " #reg ",%0" : \
37-
"=r" (cr) \
40+
"mfctl %1,%0" : \
41+
"=r" (cr) : "i" (reg) \
3842
); \
3943
cr; \
4044
})
@@ -44,13 +48,8 @@
4448
: /* no outputs */ \
4549
: "r" (gr), "i" (cr) : "memory")
4650

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

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

0 commit comments

Comments
 (0)