aboutsummaryrefslogtreecommitdiffstats
path: root/z80irq.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2018-10-30 12:25:52 -0700
committerH. Peter Anvin <hpa@zytor.com>2018-10-30 12:31:33 -0700
commit62f3d3636d01521207dd14e6ff984668eb643caf (patch)
treee09d0457162eb2e1216f0e9bd71d295de822d1de /z80irq.h
parent073ef33cce472e95b705c879f8b30ef9f1437562 (diff)
downloadabc80sim-62f3d3636d01521207dd14e6ff984668eb643caf.tar.gz
abc80sim-62f3d3636d01521207dd14e6ff984668eb643caf.tar.xz
abc80sim-62f3d3636d01521207dd14e6ff984668eb643caf.zip
Avoid cmpxchg() for bit set/bit clear on non-x86
We can use an atomic and/or instead. As a result, inline z80_[clear_]interrupt().
Diffstat (limited to 'z80irq.h')
-rw-r--r--z80irq.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/z80irq.h b/z80irq.h
index 74386b2..9555ef9 100644
--- a/z80irq.h
+++ b/z80irq.h
@@ -31,7 +31,13 @@ static inline bool poll_irq(void)
void z80_register_irq(struct z80_irq *irq);
int z80_intack(void);
void z80_eoi(void);
-bool z80_interrupt(struct z80_irq *irq);
-bool z80_clear_interrupt(struct z80_irq *irq);
+static inline void z80_interrupt(struct z80_irq *irq)
+{
+ atomic_set_bit(&irq_pending, irq->prio);
+}
+static inline void z80_clear_interrupt(struct z80_irq *irq)
+{
+ atomic_clear_bit(&irq_pending, irq->prio);
+}
#endif /* Z80IRQ_H */