-/* $OpenBSD: openpic.c,v 1.46 2008/08/24 23:44:44 todd Exp $ */
+/* $OpenBSD: openpic.c,v 1.47 2008/08/25 03:16:22 todd Exp $ */
/*-
* Copyright (c) 1995 Per Fogelstrom
#define HWIRQ_MASK 0x0fffffff
/* IRQ vector used for inter-processor interrupts. */
-#define IPI_VECTOR_DDB 64
-#define IPI_VECTOR_NOP 65
-#ifdef MULTIPROCESSOR
-static struct evcount ipi_ddb[2];
-static struct evcount ipi_nop[2];
-static int ipi_nopirq = IPI_VECTOR_NOP;
-static int ipi_ddbirq = IPI_VECTOR_DDB;
-#endif
+#define IPI_VECTOR 64
static __inline u_int openpic_read(int);
static __inline void openpic_write(int, u_int);
void openpic_set_priority(int, int);
static __inline int openpic_read_irq(int);
static __inline void openpic_eoi(int);
-void openpic_ipi_ddb(void);
struct openpic_softc {
struct device sc_dev;
#endif
-
-/* XXX */ extern long hostid;
-
void
ext_intr_openpic()
{
while (realirq != 255) {
#ifdef MULTIPROCESSOR
- if (realirq == IPI_VECTOR_NOP) {
- ipi_nop[ci->ci_cpuid].ec_count++;
- openpic_eoi(ci->ci_cpuid);
- realirq = openpic_read_irq(ci->ci_cpuid);
- continue;
- }
- if (realirq == IPI_VECTOR_DDB) {
- ipi_ddb[ci->ci_cpuid].ec_count++;
+ if (realirq == IPI_VECTOR) {
openpic_eoi(ci->ci_cpuid);
- openpic_ipi_ddb();
realirq = openpic_read_irq(ci->ci_cpuid);
continue;
}
openpic_eoi(ci->ci_cpuid);
} else {
openpic_enable_irq_mask(~imask[o_intrmaxlvl[realirq]]);
- ocpl = splraise(imask[o_intrmaxlvl[realirq]]);
openpic_eoi(ci->ci_cpuid);
+ ocpl = splraise(imask[o_intrmaxlvl[realirq]]);
ih = o_intrhand[irq];
while (ih) {
/* Set up inter-processor interrupts. */
x = openpic_read(OPENPIC_IPI_VECTOR(0));
x &= ~(OPENPIC_IMASK | OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK);
- x |= (15 << OPENPIC_PRIORITY_SHIFT) | IPI_VECTOR_NOP;
+ x |= (15 << OPENPIC_PRIORITY_SHIFT) | IPI_VECTOR;
openpic_write(OPENPIC_IPI_VECTOR(0), x);
-
- evcount_attach(&ipi_nop[0], "ipi_nop0", (void *)&ipi_nopirq,
- &evcount_intr);
- evcount_attach(&ipi_nop[1], "ipi_nop1", (void *)&ipi_nopirq,
- &evcount_intr);
-
- x = openpic_read(OPENPIC_IPI_VECTOR(1));
- x &= ~(OPENPIC_IMASK | OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK);
- x |= (15 << OPENPIC_PRIORITY_SHIFT) | IPI_VECTOR_DDB;
- openpic_write(OPENPIC_IPI_VECTOR(1), x);
- evcount_attach(&ipi_ddb[0], "ipi_ddb0", (void *)&ipi_ddbirq,
- &evcount_intr);
- evcount_attach(&ipi_ddb[1], "ipi_ddb1", (void *)&ipi_ddbirq,
- &evcount_intr);
#endif
/* XXX set spurious intr vector */
#endif
return 1;
}
-
-void
-openpic_ipi_ddb()
-{
- printf("ipi_ddb() called\n");
- Debugger();
-}
-
-void
-ppc_send_ipi(struct cpu_info *ci, int id)
-{
- printf("sending IPI %d to %d\n", id, ci->ci_cpuid);
- switch (id) {
- case PPC_IPI_NOP:
- id = 0;
- break;
- case PPC_IPI_DDB:
- id = 1;
- break;
- default:
- printf("invalid ipi send to cpu %d %d\n", ci->ci_cpuid, id);
- return;
- }
-
- openpic_write(OPENPIC_IPI(curcpu()->ci_cpuid, id), 1 << ci->ci_cpuid);
-}
-/* $OpenBSD: snapper.c,v 1.30 2008/08/24 23:44:44 todd Exp $ */
+/* $OpenBSD: snapper.c,v 1.31 2008/08/25 03:16:22 todd Exp $ */
/* $NetBSD: snapper.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */
/*-
int high, mid, low;
} snapper_volumetab[] = {
{ 0x07, 0xF1, 0x7B }, /* 18.0 */
- { 0x07, 0x7F, 0xBB }, 0x/* 17.5 */
+ { 0x07, 0x7F, 0xBB }, /* 17.5 */
{ 0x07, 0x14, 0x57 }, /* 17.0 */
{ 0x06, 0xAE, 0xF6 }, /* 16.5 */
{ 0x06, 0x4F, 0x40 }, /* 16.0 */