Subject: mapping PCI memory
To: None <>
From: Emmanuel Dreyfus <>
List: tech-kern
Date: 12/26/2003 22:58:37

For COMPAT_DARWIN, I need to map all the memory from the video board to
the display server. 

As far as I understand the problem, I need to use bus_space_mmap for all
the pages of memory that should be mapped. This leaves me with several

1) I need a tag for a given display. On macppc, wsdisplay is child of
ofb, and ofb_softc has two tags:
        pci_chipset_tag_t sc_pc;
        pcitag_t sc_pcitag;

What is the revelant tag here? I'd say pcitag_t, is that right?

2) Is there a way of finding the tag from wsdisplay without the
assumption that it's a child of ofb (on i386, it's a child of vga, for

3) Do I have a way of discovering the amount of memory in the video
board? It seems acheivable only if I assume it's a PCI board, do we have
more general mecanisms?

4) bus_space_mmap will want a base addresse, where can I find this?

5) Once I have everything, I shall call bus_space_mmap for each page. Do
we have another function that would do the job for the whole space?

Sorry if that's dumb questions, I'm not used at all to bus_space_*

Emmanuel Dreyfus
Il y a 10 sortes de personnes dans le monde: ceux qui comprennent 
le binaire et ceux qui ne le comprennent pas.