diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2001-02-20 04:20:36 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2001-02-20 04:20:36 +0000 |
commit | fc61358e90ca7a0f612ce404e5222bd98617af9f (patch) | |
tree | bf88d642a250e52d482d8b7c768362477a2f66b4 /sys/arch/powerpc/mac | |
parent | 2f4e656a4107f51f881a252f0fa77f091918b875 (diff) |
Add edge/level sense detection capability to the interrupt controller,
changes from NetBSD, been in my tree for a while.
Diffstat (limited to 'sys/arch/powerpc/mac')
-rw-r--r-- | sys/arch/powerpc/mac/openpic.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/arch/powerpc/mac/openpic.c b/sys/arch/powerpc/mac/openpic.c index 0c609e3473a..e7004707b72 100644 --- a/sys/arch/powerpc/mac/openpic.c +++ b/sys/arch/powerpc/mac/openpic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: openpic.c,v 1.8 2000/09/07 18:03:28 deraadt Exp $ */ +/* $OpenBSD: openpic.c,v 1.9 2001/02/20 04:20:35 drahn Exp $ */ /*- * Copyright (c) 1995 Per Fogelstrom @@ -85,7 +85,7 @@ extern u_int32_t *heathrow_FCR; static __inline u_int openpic_read __P((int)); static __inline void openpic_write __P((int, u_int)); -void openpic_enable_irq __P((int)); +void openpic_enable_irq __P((int, int)); void openpic_disable_irq __P((int)); void openpic_init(); void openpic_set_priority __P((int, int)); @@ -425,7 +425,7 @@ intr_calculatemasks() for (irq = 0; irq < ICU_LEN; irq++) { if (intrhand[irq]) { irqs |= 1 << irq; - openpic_enable_irq(hwirq[irq]); + openpic_enable_irq(hwirq[irq], intrtype[irq]); } else { openpic_disable_irq(hwirq[irq]); } @@ -555,20 +555,26 @@ int irq_mask; int irq; for ( irq = 0; irq <= virq_max; irq++) { if (irq_mask & (1 << irq)) { - openpic_enable_irq(hwirq[irq]); + openpic_enable_irq(hwirq[irq], intrtype[irq]); } else { openpic_disable_irq(hwirq[irq]); } } } void -openpic_enable_irq(irq) +openpic_enable_irq(irq, type) int irq; + int type; { u_int x; x = openpic_read(OPENPIC_SRC_VECTOR(irq)); - x &= ~OPENPIC_IMASK; + x &= ~(OPENPIC_IMASK|OPENPIC_SENSE_LEVEL|OPENPIC_SENSE_EDGE); + if (type == IST_LEVEL) { + x |= OPENPIC_SENSE_LEVEL; + } else { + x |= OPENPIC_SENSE_EDGE; + } openpic_write(OPENPIC_SRC_VECTOR(irq), x); } |