path: root/z80irq.h
diff options
authorH. Peter Anvin <hpa@zytor.com>2018-10-29 23:34:26 -0700
committerH. Peter Anvin <hpa@zytor.com>2018-10-29 23:34:26 -0700
commit64e32a88a18c3ff6790578a62249b40411c829d9 (patch)
treed1cb6f6f70650ad39d2f454ef4912d7433cb8067 /z80irq.h
parent667f4f71e8a875e199ab61ed15d4da45d8402249 (diff)
irq: change the IRQ interface to use struct z80_irq consistently
It is better than to futz with numeric priority levels, even though it otherwise would be theoretically possible to use a shared z80_irq structure for more than one interrupt: it is simply not worth it. Using struct z80_irq * consistently makes for a more flexible API in the future.
Diffstat (limited to 'z80irq.h')
1 files changed, 4 insertions, 4 deletions
diff --git a/z80irq.h b/z80irq.h
index 9e2c1dc..f4f8c1e 100644
--- a/z80irq.h
+++ b/z80irq.h
@@ -4,14 +4,14 @@
#include "compiler.h"
#include "z80.h"
-typedef int (*irq_func)(unsigned int prio, struct z80_irq *irq);
+typedef int (*irq_func)(struct z80_irq *irq);
struct z80_irq {
irq_func intack;
irq_func eoi;
void *pvt; /* Available for user */
int vector; /* Available for user if intack defined */
- unsigned int prio; /* Available for user after register_irq */
+ unsigned int prio; /* Priority level */
#define MAX_IRQ 32
@@ -25,7 +25,7 @@ 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(unsigned int prio);
-bool z80_clear_interrupt(unsigned int prio);
+bool z80_interrupt(struct z80_irq *irq);
+bool z80_clear_interrupt(struct z80_irq *irq);
#endif /* Z80IRQ_H */