Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Aug 1998 21:34:14 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, lile@stdio.com
Cc:        current@FreeBSD.ORG
Subject:   Re: Kernel compile problem
Message-ID:  <199808081134.VAA17235@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>Speaking of this, what is the new magic with *intr routines.  I am still

The magic went away :-).

>working on my token ring driver and have cvsup'd to the latest level only
>to find out that my driver now panics when calling routines outside my
>tokintr like tok_tx_intr.

That would happen if you leave the interrupt specification out of the
config file (so that ioconf.c compiles) without making any other changes.
This gives a NULL interrupt handler.  Unfortunately, config_isadev_c()
registers interrupt handlers if (isdp->id_irq != 0) without looking at
isdp->id_intr.

>Is it now neccesary to make these static? or
>inline?  And is there some better fix for declaring your *intr routine
>or must you specify it in isa_device.h?

isa_device.h should not be changed for new drivers.  Just initialize the
isa_device struct member for the interrupt handler explicitly.  Here is a
suitable (slightly kludgy) initialization for sio:

---
diff -c2 sio.c~ sio.c
*** sio.c~	Wed Jul 15 22:18:14 1998
--- sio.c	Sat Aug  8 20:36:47 1998
***************
*** 891,894 ****
--- 891,895 ----
  	int		unit;
  
+ 	isdp->id_intr = siointr;
  	isdp->id_ri_flags |= RI_FAST;
  	iobase = isdp->id_iobase;
---

The compiler will warn about a type mismatch here.  Avoiding this
takes more code and isn't worth doing yet.  The interrupt handler
shuld take a `void *' arg.  The declarations in isa_device.h prevent
this for old drivers (until the declarations go away), but there is no
problem for new drivers.  However, if the driver takes a `void *' arg,
then it isn't possible to correctly specify that arg in isdp->id_unit
where config_isadev_c() expects it to be, so there is no correct way for
drivers to depend on existing interrupt initialization (the current way
is incorrect but the kludges are localised).

Bruce

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



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