Subject: bus_space_mmap() question
To: None <tech-kern@netbsd.org>
From: Emmanuel Dreyfus <manu@netbsd.org>
List: tech-kern
Date: 05/19/2003 23:46:35
I have trouble getting somewhere with bus_space_mmap. Anyone have some
hints?

I want to map the OpenFirmware framebuffer. Once I have found the struct
ofb_softc, I have the hardware address of the buffer, and I can find its
length. I also have a pci_chipset_tag_t and a pci_tag_t.

Three questions: 

- As I understood, bus_space_mmap should be used to map the buffer in
userspace. I'm a bit surprised there is no struc proc in
bus_space_mmap()'s arguments. Does it only operate on curproc?

- What tag should I use in the tag argument? pci_chipset_tag_t or
pci_tag_t? What is the difference, exactly? 

- There is no size argument, instead there is an offset argument. How do
I specify the size of the mapping? And how can I know what is the base
address and the offset for the device? struct ofb_softc only give me a
physical address for the framebuffer. Should I use it as the offset and
use 0 for the base address?  

-- 
Emmanuel Dreyfus
manu@netbsd.org