aboutsummaryrefslogtreecommitdiffstats
path: root/z80irq.h
diff options
context:
space:
mode:
Diffstat (limited to 'z80irq.h')
-rw-r--r--z80irq.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/z80irq.h b/z80irq.h
index 3a04a5b..f43f278 100644
--- a/z80irq.h
+++ b/z80irq.h
@@ -20,7 +20,7 @@ struct z80_irq {
#define MAX_IRQ 32
-extern volatile unsigned int irq_pending;
+extern atomic_uint irq_pending;
extern unsigned int irq_mask; /* 0 = inside handler (irq->handled == true) */
static inline bool poll_irq(void)
@@ -33,12 +33,12 @@ int z80_intack(void);
void z80_eoi(void);
static inline void z80_interrupt(struct z80_irq *irq)
{
- atomic_set_bit(&irq_pending, irq->prio);
+ atomic_fetch_or(&irq_pending, 1U << irq->prio);
}
static inline void z80_clear_interrupt(struct z80_irq *irq)
{
- atomic_clear_bit(&irq_pending, irq->prio);
+ atomic_fetch_and(&irq_pending, ~(1U << irq->prio));
}
#endif /* Z80IRQ_H */