Make compile.

This commit is contained in:
ad 2008-01-05 12:40:34 +00:00
parent 212c50dd1b
commit fbed3be26c
3 changed files with 32 additions and 72 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: plcom.c,v 1.24 2007/11/19 18:51:39 ad Exp $ */
/* $NetBSD: plcom.c,v 1.25 2008/01/05 12:40:34 ad Exp $ */
/*-
* Copyright (c) 2001 ARM Ltd
@ -101,7 +101,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.24 2007/11/19 18:51:39 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.25 2008/01/05 12:40:34 ad Exp $");
#include "opt_plcom.h"
#include "opt_ddb.h"
@ -144,9 +144,8 @@ __KERNEL_RCSID(0, "$NetBSD: plcom.c,v 1.24 2007/11/19 18:51:39 ad Exp $");
#include <sys/timepps.h>
#include <sys/vnode.h>
#include <sys/kauth.h>
#include <machine/intr.h>
#include <machine/bus.h>
#include <sys/intr.h>
#include <sys/bus.h>
#include <evbarm/dev/plcomreg.h>
#include <evbarm/dev/plcomvar.h>
@ -443,7 +442,7 @@ plcom_attach_subr(struct plcom_softc *sc)
}
#endif
sc->sc_si = softintr_establish(IPL_SOFTSERIAL, plcomsoft, sc);
sc->sc_si = softint_establish(SOFTINT_SERIAL, plcomsoft, sc);
#if NRND > 0 && defined(RND_COM)
rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname,
@ -500,7 +499,7 @@ plcom_detach(self, flags)
ttyfree(sc->sc_tty);
/* Unhook the soft interrupt handler. */
softintr_disestablish(sc->sc_si);
softint_disestablish(sc->sc_si);
#if NRND > 0 && defined(RND_COM)
/* Unhook the entropy source. */
@ -1001,7 +1000,7 @@ plcom_schedrx(struct plcom_softc *sc)
sc->sc_rx_ready = 1;
/* Wake up the poller. */
softintr_schedule(sc->sc_si);
softint_schedule(sc->sc_si);
}
void
@ -1927,7 +1926,7 @@ plcomintr(void *arg)
PLCOM_UNLOCK(sc);
/* Wake up the poller. */
softintr_schedule(sc->sc_si);
softint_schedule(sc->sc_si);
#if NRND > 0 && defined(RND_COM)
rnd_add_uint32(&sc->rnd_source, iir | rsr);

View File

@ -1,4 +1,4 @@
/* $NetBSD: plcomvar.h,v 1.5 2007/10/17 19:54:11 garbled Exp $ */
/* $NetBSD: plcomvar.h,v 1.6 2008/01/05 12:40:34 ad Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@ -42,7 +42,7 @@
#include <sys/callout.h>
#include <sys/timepps.h>
#include <sys/lock.h>
#include <sys/simplelock.h>
int plcomcnattach (bus_space_tag_t, bus_addr_t, int, int, tcflag_t, int);
void plcomcndetach (void);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ifpga_intr.c,v 1.5 2006/11/24 21:20:05 wiz Exp $ */
/* $NetBSD: ifpga_intr.c,v 1.6 2008/01/05 12:40:34 ad Exp $ */
/*
* Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@ -46,12 +46,11 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/bus.h>
#include <sys/intr.h>
#include <uvm/uvm_extern.h>
#include <machine/bus.h>
#include <machine/intr.h>
#include <arm/cpufunc.h>
#include <evbarm/ifpga/ifpgareg.h>
@ -81,8 +80,8 @@ uint32_t intr_steer;
* ever used in future steppings).
*/
static const uint32_t si_to_irqbit[SI_NQUEUES] = {
IFPGA_INTR_bit31, /* SI_SOFT */
IFPGA_INTR_bit30, /* SI_SOFTCLOCK */
IFPGA_INTR_bit31, /* SI_SOFTCLOCK */
IFPGA_INTR_bit30, /* SI_SOFTBIO */
IFPGA_INTR_bit29, /* SI_SOFTNET */
IFPGA_INTR_bit28, /* SI_SOFTSERIAL */
};
@ -93,8 +92,8 @@ static const uint32_t si_to_irqbit[SI_NQUEUES] = {
* Map a software interrupt queue to an interrupt priority level.
*/
static const int si_to_ipl[SI_NQUEUES] = {
IPL_SOFT, /* SI_SOFT */
IPL_SOFTCLOCK, /* SI_SOFTCLOCK */
IPL_SOFTBIO, /* SI_SOFTBIO */
IPL_SOFTNET, /* SI_SOFTNET */
IPL_SOFTSERIAL, /* SI_SOFTSERIAL */
};
@ -200,68 +199,22 @@ ifpga_intr_calculate_masks(void)
/*
* Initialize the soft interrupt masks to block themselves.
*/
ifpga_imask[IPL_SOFT] = SI_TO_IRQBIT(SI_SOFT);
ifpga_imask[IPL_SOFTCLOCK] = SI_TO_IRQBIT(SI_SOFTCLOCK);
ifpga_imask[IPL_SOFTBIO] = SI_TO_IRQBIT(SI_SOFTBIO);
ifpga_imask[IPL_SOFTNET] = SI_TO_IRQBIT(SI_SOFTNET);
ifpga_imask[IPL_SOFTSERIAL] = SI_TO_IRQBIT(SI_SOFTSERIAL);
/*
* splsoftclock() is the only interface that users of the
* generic software interrupt facility have to block their
* soft intrs, so splsoftclock() must also block IPL_SOFT.
*/
ifpga_imask[IPL_SOFTCLOCK] |= ifpga_imask[IPL_SOFT];
/*
* splsoftnet() must also block splsoftclock(), since we don't
* want timer-driven network events to occur while we're
* processing incoming packets.
*/
ifpga_imask[IPL_SOFTNET] |= ifpga_imask[IPL_SOFTCLOCK];
/*
* Enforce a hierarchy that gives "slow" device (or devices with
* limited input buffer space/"real-time" requirements) a better
* chance at not dropping data.
*/
ifpga_imask[IPL_BIO] |= ifpga_imask[IPL_SOFTNET];
ifpga_imask[IPL_NET] |= ifpga_imask[IPL_BIO];
ifpga_imask[IPL_SOFTSERIAL] |= ifpga_imask[IPL_NET];
ifpga_imask[IPL_TTY] |= ifpga_imask[IPL_SOFTSERIAL];
/*
* splvm() blocks all interrupts that use the kernel memory
* allocation facilities.
*/
ifpga_imask[IPL_VM] |= ifpga_imask[IPL_TTY];
/*
* Audio devices are not allowed to perform memory allocation
* in their interrupt routines, and they have fairly "real-time"
* requirements, so give them a high interrupt priority.
*/
ifpga_imask[IPL_AUDIO] |= ifpga_imask[IPL_VM];
/*
* splclock() must block anything that uses the scheduler.
*/
ifpga_imask[IPL_CLOCK] |= ifpga_imask[IPL_AUDIO];
/*
* splstatclock() must also block the clock.
*/
ifpga_imask[IPL_STATCLOCK] |= ifpga_imask[IPL_CLOCK];
/*
* splhigh() must block "everything".
*/
ifpga_imask[IPL_HIGH] |= ifpga_imask[IPL_STATCLOCK];
/*
* XXX We need serial drivers to run at the absolute highest priority
* in order to avoid overruns, so serial > high.
*/
ifpga_imask[IPL_SERIAL] |= ifpga_imask[IPL_HIGH];
ifpga_imask[IPL_SOFTBIO] |= ifpga_imask[IPL_SOFTCLOCK];
ifpga_imask[IPL_SOFTNET] |= ifpga_imask[IPL_SOFTBIO];
ifpga_imask[IPL_SOFTSERIAL] |= ifpga_imask[IPL_SOFTNET];
ifpga_imask[IPL_VM] |= ifpga_imask[IPL_SOFTSERIAL];
ifpga_imask[IPL_SCHED] |= ifpga_imask[IPL_VM];
ifpga_imask[IPL_HIGH] |= ifpga_imask[IPL_SCHED];
/*
* Now compute which IRQs must be blocked when servicing any
@ -282,6 +235,7 @@ ifpga_intr_calculate_masks(void)
void
ifpga_do_pending(void)
{
#ifdef __HAVE_FAST_SOFTINTS
static __cpu_simple_lock_t processing = __SIMPLELOCK_UNLOCKED;
int new, oldirqstate;
@ -304,12 +258,13 @@ ifpga_do_pending(void)
DO_SOFTINT(SI_SOFTSERIAL);
DO_SOFTINT(SI_SOFTNET);
DO_SOFTINT(SI_SOFTBIO);
DO_SOFTINT(SI_SOFTCLOCK);
DO_SOFTINT(SI_SOFT);
__cpu_simple_unlock(&processing);
restore_interrupts(oldirqstate);
#endif
}
void
@ -436,6 +391,10 @@ ifpga_intr_dispatch(struct clockframe *frame)
struct intrq *iq;
struct intrhand *ih;
int oldirqstate, pcpl, irq, ibit, hwpend;
struct cpu_info *ci;
ci = curcpu();
ci->ci_idepth++;
pcpl = current_spl_level;
@ -488,6 +447,8 @@ ifpga_intr_dispatch(struct clockframe *frame)
ifpga_set_intrmask();
}
ci->ci_idepth--;
/* Check for pendings soft intrs. */
if ((ifpga_ipending & INT_SWMASK) & ~current_spl_level) {
oldirqstate = enable_interrupts(I32_bit);