Subject: Finding Kernel VA that maps given physical address?
To: None <tech-kern@NetBSD.ORG>
From: Paul Goyette <paul@whooppee.com>
List: tech-kern
Date: 07/20/1997 15:29:09
OK, here's my first post to this list so please be gentle...

I'm in the process of integrating the MacOS's ROM-based NuBus Slot Manager
code with NetBSD - on the premise that it's easier to reverse-engineer one
interface vs. reverse-engineering each possible card.

The Mac code sort of relies on the fact that certain physical addresses
(ie, the card's "slot space") are mapped to identical addresses within the
OS.  In other words, Kernel virtual address 0xFC000000 maps to physical
address 0xFC000000.  My integration code needs to replace the routines
that have this dependence.

I've figured out how to find the physical address given a kernel VA using
pmap_extract().  But I haven't found the equivalent mechanism to do the
reverse translation.  I realize that, in a general case, there might be
_several_ (or even _many_) kernel VAs that map to the same physical
address, but I'm pretty sure that that won;t happen in the specific case I
need to handle.  So it would be just peachy if there were a way to find
_any_ kernel virtual address that maps to a given physical address.

Any ideas?

TIA

-----------------------------------------------------------------------------
| Paul Goyette       | PGP Public Key fingerprint:  | E-mail addresses:     |
| Network Consultant |     0E 40 D2 FC 2A 13 74 A0  |  paul@whooppee.com    |
| and kernel hacker  |     E4 69 D5 BE 65 E4 56 C6  |  paul_goyette@ins.com |
-----------------------------------------------------------------------------