*
* @APPLE_LICENSE_HEADER_START@
*
- * The contents of this file constitute Original Code as defined in and
- * are subject to the Apple Public Source License Version 1.1 (the
- * "License"). You may not use this file except in compliance with the
- * License. Please obtain a copy of the License at
- * http://www.apple.com/publicsource and read it before using this file.
+ * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
*
- * This Original Code and all software distributed under the License are
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
- * License for the specific language governing rights and limitations
- * under the License.
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
register vm_page_t m;
vm_map_t pmap_map;
vm_map_t original_map = map;
+ thread_t cur_thread;
+ boolean_t funnel_set;
+ funnel_t *curflock;
+
+ cur_thread = current_thread();
+
+ if ((cur_thread->funnel_state & TH_FN_OWNED) == TH_FN_OWNED) {
+ funnel_set = TRUE;
+ curflock = cur_thread->funnel_lock;
+ thread_funnel_set( curflock , FALSE);
+ } else {
+ funnel_set = FALSE;
+ }
RetryFault:
vm_map_unlock_read(map);
if (result != KERN_SUCCESS) {
- return (result);
+ if (funnel_set)
+ thread_funnel_set( curflock, TRUE);
+ return (result);
}
if(pmap_map != map) {
case VM_FAULT_RETRY:
goto RetryFault;
case VM_FAULT_INTERRUPTED:
+ if (funnel_set)
+ thread_funnel_set( curflock, TRUE);
return (KERN_SUCCESS);
case VM_FAULT_MEMORY_SHORTAGE:
VM_PAGE_WAIT();
vm_object_lock(m->object);
RELEASE_PAGE(m);
UNLOCK_AND_DEALLOCATE;
+ if (funnel_set)
+ thread_funnel_set( curflock, TRUE);
return (result);
}
* Put the page in the physical map.
*/
- PMAP_ENTER(pmap_map->pmap, vaddr, m, VM_PROT_READ, wired);
+ PMAP_ENTER(pmap_map->pmap, vaddr, m, VM_PROT_READ, PMAP_DEFAULT_CACHE, wired);
if(pmap_map != map) {
vm_map_unlock_read(pmap_map);
#undef UNLOCK_AND_DEALLOCATE
#undef RELEASE_PAGE
+ if (funnel_set)
+ thread_funnel_set( curflock, TRUE);
return (KERN_SUCCESS);
}