Hi all, I am writing a driver for a memory mapped PCI device, in which I implemented a segmap(9E) and a devmap(9E) to mmap a device memory into the userland.
myDevice = (unsigned int *) mmap (NULL, LENGTH, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); //myDevice stores the start virtual address of the mmaped memory region. Two questions: (1) I want to know which one of the PCI spaces(ConfigSpace, MemorySpace, and I/OSpace) is actually mapped by the the mmap() ? Someone told me that the ConfigSpace is mapped region of the mmap() by defualt, but I comparied the contents of the mapped region with the ConfigSpace (Vendor ID and Device ID...according to the PCI specification) and find they are inconsistent. (2) Is there any function to get the physical address of a certain virtual address? as the same function of the virt_to_phys(myDevice) I want to check the start *physical address* of the mmaped memory region, since I've known that the PCI ConfigSpace is physically mapped at the 0x0000040262000000. -- Regards Ning Deng School Of Computer Science and Technology Beijng Institute of Technology, China, 100081 [email protected]
_______________________________________________ driver-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/driver-discuss
