- if (!super::initWithOptions(&_singleRange.v, 1, 0,
- inTask, iomdOptions, /* System mapper */ 0))
+ if( options & kIOMemoryPageable) {
+#if IOALLOCDEBUG
+ debug_iomallocpageable_size += size;
+#endif
+ mapTask = inTask;
+ if (NULL == inTask)
+ inTask = kernel_task;
+ }
+ else if (options & kIOMapCacheMask)
+ {
+ // Prefetch each page to put entries into the pmap
+ volatile UInt8 * startAddr = (UInt8 *)_buffer;
+ volatile UInt8 * endAddr = (UInt8 *)_buffer + capacity;
+
+ while (startAddr < endAddr)
+ {
+ *startAddr;
+ startAddr += page_size;
+ }
+ }
+ }
+
+ range.address = (mach_vm_address_t) _buffer;
+ range.length = capacity;
+
+ if (!super::initWithOptions(&range, 1, 0,
+ inTask, iomdOptions, /* System mapper */ 0))