Messages in this thread | | | Date | Sat, 13 Apr 1996 22:39:31 -0700 | From | (Chuck Goodhart) | Subject | RAW I/O |
| |
I am developing a driver for a PCI bus mastering device. In order to allow this device direct access to user memory, the following procedure occurs to me:
1) set "current->swappable" to 0
2) ensure that the desired pages are in physical memory with a per-page call to "(void)get_user(vadr)"
3) perform a quick, no error checking, virtual-to-physical translation:
padr = pte_page( *pte_offset( pmd_offset( pgd_offset(current->mm, vadr), vadr), vadr));
4) provide the physical address(es) to the device
5) upon completion of the I/O, set "current->swappable" to 1
While this should work (comments?), preventing the swapping of ALL of the current process pages seems overkill, when only a few are required.
Thus, my question: Is there a way to prevent swapping on a page-by-page basis?
-- Chuck Goodhart <Charles.E.Goodhart@jpl.nasa.gov>
| |