diff options
author | marcel <marcel@FreeBSD.org> | 2012-11-27 00:41:39 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2012-11-27 00:41:39 +0000 |
commit | 2749496c99359766a67ce2f3e2f9afc50ea772af (patch) | |
tree | 3f07f9df0fe6bc486a970ef21120f6e5c137f590 /sys | |
parent | 54f8a4b147c7b1c93e9ee783ee80ebadd24e5927 (diff) | |
download | FreeBSD-src-2749496c99359766a67ce2f3e2f9afc50ea772af.zip FreeBSD-src-2749496c99359766a67ce2f3e2f9afc50ea772af.tar.gz |
Don't define intr_disable and intr_restore as macros. The macros
interfere with structure fields of the same name in drivers, like
the intr_disable function pointer in struct cphy_ops in cxgb(4).
Instead define intr_disable and intr_restore as inline functions.
With intr_disable() an inline function, the I32_bit and F32_bit
macros now need to be visible in MI code and given the rather
poor names, this is not at all good. Define ARM_CPSR_F32 and
ARM_CPSR_I32 and use that instead of F32_bit and I32_bit (resp)
for now.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arm/include/cpufunc.h | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/sys/arm/include/cpufunc.h b/sys/arm/include/cpufunc.h index cb809d5..94b0ff6 100644 --- a/sys/arm/include/cpufunc.h +++ b/sys/arm/include/cpufunc.h @@ -681,20 +681,36 @@ __set_cpsr_c(u_int bic, u_int eor) return ret; } +#define ARM_CPSR_F32 (1 << 6) /* FIQ disable */ +#define ARM_CPSR_I32 (1 << 7) /* IRQ disable */ + #define disable_interrupts(mask) \ - (__set_cpsr_c((mask) & (I32_bit | F32_bit), \ - (mask) & (I32_bit | F32_bit))) + (__set_cpsr_c((mask) & (ARM_CPSR_I32 | ARM_CPSR_F32), \ + (mask) & (ARM_CPSR_I32 | ARM_CPSR_F32))) #define enable_interrupts(mask) \ - (__set_cpsr_c((mask) & (I32_bit | F32_bit), 0)) + (__set_cpsr_c((mask) & (ARM_CPSR_I32 | ARM_CPSR_F32), 0)) #define restore_interrupts(old_cpsr) \ - (__set_cpsr_c((I32_bit | F32_bit), (old_cpsr) & (I32_bit | F32_bit))) + (__set_cpsr_c((ARM_CPSR_I32 | ARM_CPSR_F32), \ + (old_cpsr) & (ARM_CPSR_I32 | ARM_CPSR_F32))) + +static __inline register_t +intr_disable(void) +{ + register_t s; + + s = disable_interrupts(ARM_CPSR_I32 | ARM_CPSR_F32); + return (s); +} + +static __inline void +intr_restore(register_t s) +{ + + restore_interrupts(s); +} -#define intr_disable() \ - disable_interrupts(I32_bit | F32_bit) -#define intr_restore(s) \ - restore_interrupts(s) /* Functions to manipulate the CPSR. */ u_int SetCPSR(u_int bic, u_int eor); u_int GetCPSR(void); |