Subject: Re: user mapping pci memory
To: Matthias Drochner <drochner@zelux6.zel.kfa-juelich.de>
From: Chris G. Demetriou <cgd@cs.cmu.edu>
List: tech-kern
Date: 03/12/1997 11:28:59
> The driver mmap usually uses <arch>_btop() to calculate
> the return value - how to do this mi?
You can't (yet). There's no good way to do that currently.
Note that, as you say, drivers _usually_ use <arch>_btop(), but do not
always. In general, what they use is an architecture-specific
decision, and requires cooperation between the drivers and the pmap
module.
Right now, you _have_ to use #ifdef.
> Seems that things would be simpler if mmap returned
> phys addresses.
Perhaps. However:
(1) Plain physical addresses mean that here's some possibility for the
device mmap routine trying to return non-page-aligned values, which is
broken, and
(2) There aren't enough bits in a physical address to express the
return value of the device mmap properly, in all cases, from what I
understand, and a plain physical address isn't necessarily all that
you want to return. E.g. on various sun boxes, don't you need a few
bits of 'space' information in addition to the physical address?
chris