mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-18 10:35:55 +00:00
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.
This commit is contained in:
parent
f896ce74e6
commit
dfad92447b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=243576
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user