summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/mips/rmi/intr_machdep.c12
-rw-r--r--sys/mips/rmi/pic.h32
2 files changed, 23 insertions, 21 deletions
diff --git a/sys/mips/rmi/intr_machdep.c b/sys/mips/rmi/intr_machdep.c
index dc34fda..8788955 100644
--- a/sys/mips/rmi/intr_machdep.c
+++ b/sys/mips/rmi/intr_machdep.c
@@ -147,17 +147,17 @@ cpu_intr(struct trapframe *tf)
if ((i == IPI_AST) || (i == IPI_RENDEZVOUS) || (i == IPI_STOP)
|| (i == IPI_SMP_CALL_FUNCTION)) {
write_c0_eirr64(1ULL << i);
- pic_ack(i);
+ pic_ack(i,0);
smp_handle_ipi(tf, i);
- pic_delayed_ack(i);
+ pic_delayed_ack(i,0);
continue;
}
#ifdef XLR_PERFMON
if (i == IPI_PERFMON) {
write_c0_eirr64(1ULL << i);
- pic_ack(i);
+ pic_ack(i,0);
xlr_perfmon_sampler(NULL);
- pic_delayed_ack(i);
+ pic_delayed_ack(i,0);
continue;
}
#endif
@@ -167,7 +167,7 @@ cpu_intr(struct trapframe *tf)
ie = mih->mih_event;
write_c0_eirr64(1ULL << i);
- pic_ack(i);
+ pic_ack(i, 0);
if (!ie || TAILQ_EMPTY(&ie->ie_handlers)) {
printf("stray interrupt %d\n", i);
continue;
@@ -175,7 +175,7 @@ cpu_intr(struct trapframe *tf)
if (intr_event_handle(ie, tf) != 0) {
printf("stray interrupt %d\n", i);
}
- pic_delayed_ack(i);
+ pic_delayed_ack(i, 0);
}
critical_exit();
}
diff --git a/sys/mips/rmi/pic.h b/sys/mips/rmi/pic.h
index 1a17724..db65e7f 100644
--- a/sys/mips/rmi/pic.h
+++ b/sys/mips/rmi/pic.h
@@ -29,6 +29,8 @@
* RMI_BSD */
#ifndef _RMI_PIC_H_
#define _RMI_PIC_H_
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
extern int rmi_spin_mutex_safe;
@@ -202,44 +204,44 @@ extern struct mtx xlr_pic_lock;
static __inline__ __uint32_t
-pic_read_control(void)
+pic_read_control(int haslock)
{
xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET);
__uint32_t reg;
- if (rmi_spin_mutex_safe)
+ if ((rmi_spin_mutex_safe) && (haslock == 0))
mtx_lock_spin(&xlr_pic_lock);
xlr_read_reg(mmio, PIC_CTRL);
- if (rmi_spin_mutex_safe)
+ if ((rmi_spin_mutex_safe) && (haslock == 0))
mtx_unlock_spin(&xlr_pic_lock);
return reg;
}
static __inline__ void
-pic_write_control(__uint32_t control)
+pic_write_control(__uint32_t control, int haslock)
{
xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET);
- if (rmi_spin_mutex_safe)
+ if ((rmi_spin_mutex_safe) && (haslock == 0))
mtx_lock_spin(&xlr_pic_lock);
xlr_write_reg(mmio, PIC_CTRL, control);
- if (rmi_spin_mutex_safe)
+ if ((rmi_spin_mutex_safe) && (haslock == 0))
mtx_unlock_spin(&xlr_pic_lock);
}
static __inline__ void
-pic_update_control(__uint32_t control)
+pic_update_control(__uint32_t control, int haslock)
{
xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET);
- if (rmi_spin_mutex_safe)
+ if ((rmi_spin_mutex_safe) && (haslock == 0))
mtx_lock_spin(&xlr_pic_lock);
xlr_write_reg(mmio, PIC_CTRL, (control | xlr_read_reg(mmio, PIC_CTRL)));
- if (rmi_spin_mutex_safe)
+ if ((rmi_spin_mutex_safe) && (haslock == 0))
mtx_unlock_spin(&xlr_pic_lock);
}
static __inline__ void
-pic_ack(int irq)
+pic_ack(int irq, int haslock)
{
xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET);
@@ -248,10 +250,10 @@ pic_ack(int irq)
return;
if (PIC_IRQ_IS_EDGE_TRIGGERED(irq)) {
- if (rmi_spin_mutex_safe)
+ if ((rmi_spin_mutex_safe) && (haslock == 0))
mtx_lock_spin(&xlr_pic_lock);
xlr_write_reg(mmio, PIC_INT_ACK, (1 << (irq - PIC_IRQ_BASE)));
- if (rmi_spin_mutex_safe)
+ if ((rmi_spin_mutex_safe) && (haslock == 0))
mtx_unlock_spin(&xlr_pic_lock);
return;
}
@@ -259,7 +261,7 @@ pic_ack(int irq)
}
static inline void
-pic_delayed_ack(int irq)
+pic_delayed_ack(int irq, int haslock)
{
xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_PIC_OFFSET);
@@ -267,10 +269,10 @@ pic_delayed_ack(int irq)
return;
if (!PIC_IRQ_IS_EDGE_TRIGGERED(irq)) {
- if (rmi_spin_mutex_safe)
+ if ((rmi_spin_mutex_safe)&& (haslock == 0))
mtx_lock_spin(&xlr_pic_lock);
xlr_write_reg(mmio, PIC_INT_ACK, (1 << (irq - PIC_IRQ_BASE)));
- if (rmi_spin_mutex_safe)
+ if ((rmi_spin_mutex_safe) && (haslock == 0))
mtx_unlock_spin(&xlr_pic_lock);
return;
}
OpenPOWER on IntegriCloud