From owner-freebsd-current Sun Jul 25 10:29:50 1999 Delivered-To: freebsd-current@freebsd.org Received: from reliam.teaser.fr (reliam.teaser.fr [194.51.80.12]) by hub.freebsd.org (Postfix) with ESMTP id 55023151F7 for ; Sun, 25 Jul 1999 10:29:45 -0700 (PDT) (envelope-from nsouch@teaser.fr) Received: from teaser.fr (ppp1087-ft.teaser.fr [194.206.156.40]) by reliam.teaser.fr (8.9.3/8.9.3) with ESMTP id TAA23257; Sun, 25 Jul 1999 19:29:31 +0200 (MET DST) Received: (from nsouch@localhost) by teaser.fr (8.9.3/8.9.1) id TAA04222; Sun, 25 Jul 1999 19:32:46 +0200 (CEST) (envelope-from nsouch) Message-ID: <19990725193241.48737@breizh.teaser.fr> Date: Sun, 25 Jul 1999 19:32:41 +0200 From: Nicolas Souchu To: Bruce Evans Cc: current@FreeBSD.ORG, des@flood.ping.uio.no, obrien@NUXI.com, sobomax@altavista.net Subject: Re: PLIP is still broken :( References: <199907242335.JAA10442@godzilla.zeta.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.81e In-Reply-To: <199907242335.JAA10442@godzilla.zeta.org.au>; from Bruce Evans on Sun, Jul 25, 1999 at 09:35:36AM +1000 X-Operating-System: FreeBSD breizh 4.0-CURRENT FreeBSD 4.0-CURRENT Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, Jul 25, 1999 at 09:35:36AM +1000, Bruce Evans wrote: > >>>Possible quick fix (hack): change all the spltty()'s in lpt.c to >>>splnet()'s. lpt isn't a tty driver; it just abuses spltty(). Abusing >>>splnet() instead should work OK for lpt and fix if_plip. >> >>This seems good until the intr stuff handle dynamic update of a interrupt spl. >>Is there some work in progress on that? > >Not much. ppc needs to do most of the work by registering its interrupt >with the correct interrupt maskptr for the currently attached device. >This may involve unregistering the interrupt when the device changes. >The generic code could help here by supporting atomic changing of >interrupt maskptrs without unregistering the interrupt. Otherwise, >the generic code is missing mainly update of the interrupt masks when >an interrupt is unregistered. For the low level side, we could consider something like the following code. But this shall be called by the nexus layer and then needs generic newbus support (as you said above, didn't you?). /* * Switch an irq from a maskptr to another without unregistering the irq * handler. * This function is supposed to work with only one handler per irq. */ void switch_masks(intrmask_t *oldmaskptr, intrmask_t *newmaskptr, int irq) { int s; intrec *idesc; intrmask_t mask = 1 << irq; if ((oldmaskptr == NULL) || (newmaskptr == NULL)) return; if (((idesc = find_idesc(oldmaskptr, irq)) == NULL) || (find_idesc(newmaskptr, irq) != NULL)) return; /* block all interrupts */ s = splhigh(); /* update the irq mask ptr */ idesc->maskptr = newmaskptr; /* remove the irq from the old mask and add it to the new one */ INTRUNMASK(*oldmaskptr, mask); INTRMASK(*newmaskptr, mask); /* we need to update all values in the intr_mask[irq] array */ update_intr_masks(); /* update mask in chains of the interrupt multiplex handler as well */ update_mux_masks(); /* restore interrupts */ splx(s); return; } Your opinion? Nicholas. -- nsouch@teaser.fr / nsouch@freebsd.org FreeBSD - Turning PCs into workstations - http://www.FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message