Commit 7e0b2be9 authored by Helge Deller's avatar Helge Deller

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: default avatarHelge Deller <deller@gmx.de>
parent ed979481
...@@ -30,11 +30,15 @@ ...@@ -30,11 +30,15 @@
pa; \ 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) ({ \ #define mfctl(reg) ({ \
unsigned long cr; \ unsigned long cr; \
__asm__ __volatile__( \ __asm__ __volatile__( \
"mfctl " #reg ",%0" : \ "mfctl %1,%0" : \
"=r" (cr) \ "=r" (cr) : "i" (reg) \
); \ ); \
cr; \ cr; \
}) })
...@@ -44,13 +48,8 @@ ...@@ -44,13 +48,8 @@
: /* no outputs */ \ : /* no outputs */ \
: "r" (gr), "i" (cr) : "memory") : "r" (gr), "i" (cr) : "memory")
/* these are here to de-mystefy the calling code, and to provide hooks */ #define get_eiem() mfctl(CR_EIEM)
/* which I needed for debugging EIEM problems -PB */ #define set_eiem(val) mtctl(val, CR_EIEM)
#define get_eiem() mfctl(15)
static inline void set_eiem(unsigned long val)
{
mtctl(val, 15);
}
#define mfsp(reg) ({ \ #define mfsp(reg) ({ \
unsigned long cr; \ unsigned long cr; \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment