}
pmap = thread->map->pmap;
-#if CONFIG_DTRACE
- thread->machine.specFlags |= CopyIOActive;
-#endif /* CONFIG_DTRACE */
-
if (pmap == kernel_pmap || use_kernel_map) {
kern_vaddr = (vm_offset_t)user_addr;
KERNEL_DEBUG(debug_type | DBG_FUNC_END, (unsigned)kern_vaddr,
(unsigned)kernel_addr, (unsigned)nbytes,
error | 0x80000000, 0);
+ return (error);
+ }
#if CONFIG_DTRACE
- thread->machine.specFlags &= ~CopyIOActive;
+ thread->machine.specFlags |= CopyIOActive;
#endif /* CONFIG_DTRACE */
- return (error);
+ if ((nbytes && (user_addr + nbytes <= user_addr)) || ((user_addr + nbytes) > vm_map_max(thread->map))) {
+ error = EFAULT;
+ goto done;
}
+
user_base = user_addr & ~((user_addr_t)(NBPDE - 1));
user_offset = (vm_offset_t)(user_addr & (NBPDE - 1));
}
window_offset = (char *)((uint32_t)paddr & (PAGE_SIZE - 1));
+ assert(!((current_thread()->machine.specFlags & CopyIOActive) && ((which & cppvKmap) == 0)));
+
if (current_thread()->machine.physwindow_busy) {
pt_entry_t old_pentry;