From owner-freebsd-arch Wed Jan 10 11:41:59 2001 Delivered-To: freebsd-arch@freebsd.org Received: from netau1.alcanet.com.au (ntp.alcanet.com.au [203.62.196.27]) by hub.freebsd.org (Postfix) with ESMTP id 9C5CE37B404; Wed, 10 Jan 2001 11:41:38 -0800 (PST) Received: from mfg1.cim.alcatel.com.au (mfg1.cim.alcatel.com.au [139.188.23.1]) by netau1.alcanet.com.au (8.9.3 (PHNE_22672)/8.9.3) with ESMTP id GAA04093; Thu, 11 Jan 2001 06:41:19 +1100 (EDT) Received: from pc0640.alcatel.com.au ([139.188.24.25]) by cim.alcatel.com.au (PMDF V5.2-32 #37640) with ESMTP id <01JYRSHEIVN490HQH5@cim.alcatel.com.au>; Thu, 11 Jan 2001 06:41:18 +1100 Received: (from jeremyp@localhost) by pc0640.alcatel.com.au (8.8.7/8.8.7) id GAA10217; Thu, 11 Jan 2001 06:41:31 +1100 (EST envelope-from jeremyp) Date: Thu, 11 Jan 2001 06:41:26 +1100 From: Peter Jeremy Subject: Re: cvs commit: src/sys/gnu/i386/isa dgb.c dgm.c dgmreg.h dgreg.h In-reply-to: <200101052146.f05LkDi49430@hak.lan.Awfulhak.org>; from brian@Awfulhak.org on Fri, Jan 05, 2001 at 09:46:13PM +0000 To: Brian Somers Cc: Sergey Babkin , freebsd-arch@FreeBSD.ORG Message-id: <20010111064126.A10214@pc0640.alcatel.com.au> MIME-version: 1.0 X-Mailer: Mutt 1.0i Content-type: text/plain; charset=us-ascii References: <200101052146.f05LkDi49430@hak.lan.Awfulhak.org> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Jan 05, 2001 at 09:46:13PM +0000, Brian Somers wrote: >I have the a driver that will replace dgb and dgm and support a bunch >of other digiboards. Now all I need is the time to add back the >{E,}ISA probe routines. There are come significant differences between the [E]ISA aand PCI DigiBoards: - The [E]ISA cards use I/O ports whilst the PCI boards use memory-mapped registers. - The PCI cards have a flat 4MB window. The [E]ISA cards access on-board memory via a 8KB or 32KB window. This means that the code does a lot of checking to see if the card is PCI or not, resulting in expressions like: ((IS_PCI(board_type)) ? *mem[reg] : inb(base + reg)) The Linux driver (maintained by Digi) uses (the equivalent of) virtual functions for all card accesses. Both these approaches add run-time overheads and can adversely affect code legibility. I believe that having separate [E]ISA and PCI drivers would make the code smaller and more understandable as well as reducing overheads (though I can't quantify the latter). There may (and probably are) other drivers that could similarly benefit from having different drivers for different buses. The disadvantages are: - Two drivers sharing common code increases the maintenance load (and the probability that a bug in the common code won't be fixed in both places). - A system with multiple cards on different buses would need several copies of similar drivers. I believe the latter situation is fairly unlikely and can be ignored as a disadvantage. The former is a real problem, but can be (at least partially) offset by sharing source code files between the different drivers. Would it be reasonable to have different drivers for different bus versions of the same card? Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message