/* External pager interface. Copyright 1999-2002 Johan Rydberg, jrydberg@rtmk.org. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "tm.h" #include "vm-pager.h" #include "vm-page.h" #include "vm-object.h" #include "ipc-port.h" #include "vm-slab.h" /* Request data from PAGER, which controls OBJECT. OFFSET is the data offset into OBJECT. SIZE should be VM_PAGE_SIZE. */ kern_return_t vm_pager_data_request (struct ipc_port *pager, struct vm_object *object, vm_offset_t offset, vm_size_t size, vm_prot_t desired_access, struct vm_page **pagep) { struct vm_pager *vm_pager; assert (size == VM_PAGE_SIZE); /* Get pointer to VM pager object from the kernel object PAGER. */ assert (pager->kobject.type == IPC_KOBJECT_TYPE_MEMORY_OBJECT); vm_pager = (struct vm_pager *) pager->kobject.port; /* Leave control to the real pager function that does all the work for us. We just return whatever it returns. */ return (*vm_pager->page_request) (vm_pager, vm_pager->cookie, offset, desired_access, pagep); }