From owner-freebsd-arch Thu Jan 11 7:20:21 2001 Delivered-To: freebsd-arch@freebsd.org Received: from smtp02.primenet.com (smtp02.primenet.com [206.165.6.132]) by hub.freebsd.org (Postfix) with ESMTP id C12A537B400; Thu, 11 Jan 2001 07:20:03 -0800 (PST) Received: (from daemon@localhost) by smtp02.primenet.com (8.9.3/8.9.3) id IAA04739; Thu, 11 Jan 2001 08:14:34 -0700 (MST) Received: from usr08.primenet.com(206.165.6.208) via SMTP by smtp02.primenet.com, id smtpdAAAfkaWti; Thu Jan 11 08:13:27 2001 Received: (from tlambert@localhost) by usr08.primenet.com (8.8.5/8.8.5) id IAA15411; Thu, 11 Jan 2001 08:18:32 -0700 (MST) From: Terry Lambert Message-Id: <200101111518.IAA15411@usr08.primenet.com> Subject: Re: cvs commit: src/sys/gnu/i386/isa dgb.c dgm.c dgmreg.h dgreg.h To: peter@netplex.com.au (Peter Wemm) Date: Thu, 11 Jan 2001 15:18:32 +0000 (GMT) Cc: msmith@FreeBSD.ORG (Mike Smith), jlemon@flugsvamp.com (Jonathan Lemon), peter.jeremy@alcatel.com.au (Peter Jeremy), babkin@FreeBSD.ORG (Sergey Babkin), freebsd-arch@FreeBSD.ORG In-Reply-To: <200101110323.f0B3N4Q64114@mobile.wemm.org> from "Peter Wemm" at Jan 10, 2001 07:23:04 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > > ie: > > > if (IS_PCI(board_type)) { > > > value = *mem[reg]; > > > } else { > > > if (board->window != window(reg)) > > > board->window = window(reg); > > > value = inb(base + (reg % winsize)); > > > } > > > > Typically, if you have half a clue, you will separate the ISA-aware parts > > of the driver from the PCI-aware parts and use a set of function vectors. > > Makes for much cleaner code. 8) > > Yes, that is what Peter Jeremy said in the original email.. It can be > done but doesn't come for free. I was merely responding to the suggestion > to use the bus_space_ macros with a reason why they cannot be used in this > scenario to hide the different access methods. Yes, bus_space can be used > in the backend functions, but not at the top level driver. Surely, this is a problem which has to be solved similarly for multiple cards with similar function. Rather than being a one-off, the abstraction should at _least_ have a recommended form, if not a documented DKI mechanism. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message