Date: Wed, 10 Jan 2001 15:23:38 -0800 From: Peter Wemm <peter@netplex.com.au> To: Jonathan Lemon <jlemon@flugsvamp.com> Cc: Peter Jeremy <peter.jeremy@alcatel.com.au>, Sergey Babkin <babkin@FreeBSD.ORG>, freebsd-arch@FreeBSD.ORG Subject: Re: cvs commit: src/sys/gnu/i386/isa dgb.c dgm.c dgmreg.h dgreg.h Message-ID: <200101102323.f0ANNcQ63145@mobile.wemm.org> In-Reply-To: <20010110135101.S29115@prism.flugsvamp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Jonathan Lemon wrote:
> On Thu, Jan 11, 2001 at 06:41:26AM +1100, Peter Jeremy wrote:
> > 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))
>
> This should be taken care of by the bus_space() macros; which is
> already done by most drivers in the tree. (Many drivers can run
> in either PIO or memory mapped mode)
But the bus_space_() stuff doesn't handle changing register windows etc.
eg: if you have a 64K memory space and can read/write it directly when
memory mapped, but when on ISA it is all crammed into 16 lots of 4K windows
then bus_space_() cannot save you from this.
ie:
if (IS_PCI(board_type)) {
value = *mem[reg];
} else {
if (board->window != window(reg))
board->window = window(reg);
value = inb(base + (reg % winsize));
}
Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"All of this is for nothing if we don't go to the stars" - JMS/B5
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200101102323.f0ANNcQ63145>
