Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Apr 1995 14:53:39 -0400 (EDT)
From:      Peter Dufault <dufault@hda.com>
To:        freebsd-hackers@freefall.cdrom.com
Subject:   spl() and LKM
Message-ID:  <199504051853.OAA01204@hda.com>

next in thread | raw e-mail | index | archive | help
I realize now that the driver I've been testing using an LKM doesn't
have the interrupt mask set up properly, and I assume that the
"reconfigurable" devices if_ze and if_zp don't work properly (when
they aren't on at initial boot) either.

I've tried to install a driver at tty_mask but spltty() isn't
masking off the interrupt.

Here is what I'm doing right now.  I originally had something
neater, but I wanted to see if by brute force copying what
isa_configure does at the end of its configuration pass I couldn't
get it to work properly:

> void
> isa_device_install(isdp, mp)
> 	struct isa_device *isdp;
> 	u_int *mp;
> {
> 	struct isa_device *dvp;
> 
> 	int s = splhigh();
> 
> 	config_isadev_c(isdp, mp, 0);
> 
> 	for (dvp = isa_devtab_tty; dvp->id_driver; dvp++)
> 		register_imask(dvp, tty_imask);
> 	register_imask(isdp, tty_imask);
> 	for (dvp = isa_devtab_bio; dvp->id_driver; dvp++)
> 		register_imask(dvp, bio_imask);
> 	register_imask(isdp, bio_imask);
> 	for (dvp = isa_devtab_net; dvp->id_driver; dvp++)
> 		register_imask(dvp, net_imask);
> 	register_imask(isdp, net_imask);
> 	for (dvp = isa_devtab_null; dvp->id_driver; dvp++)
> 		register_imask(dvp, SWI_CLOCK_MASK);
> 	register_imask(isdp, SWI_CLOCK_MASK);
> 
> 	splx(s);
> }

I'm calling this like:

>	isa_device_install(&isa_labpc, &tty_imask);

The "register_intr" in config_isadev_c is working fine since my
interrupt is called just fine.  The problem is that spltty()
doesn't mask it off.

I expected this brute force recalculation of intr_mask[] and intr_mptr[]
would get me a basis to work from, but no go.  Can anyone suggest the 
right way to get this to work?

-- 
Peter Dufault               Real Time Machine Control and Simulation
HD Associates, Inc.         Voice: 508 433 6936
dufault@hda.com             Fax:   508 433 5267



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199504051853.OAA01204>