]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/Kernel/IOSubMemoryDescriptor.cpp
xnu-7195.101.1.tar.gz
[apple/xnu.git] / iokit / Kernel / IOSubMemoryDescriptor.cpp
index 8d0a472b12a6568c37322e9129f50296359f5a9c..07ef3782b97c31a942f5abdb92d21e5bae0f3e17 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 #include <IOKit/IOSubMemoryDescriptor.h>
+#include <IOKit/IOLib.h>
 
 #include "IOKitKernelInternal.h"
 
@@ -53,7 +54,7 @@ IOSubMemoryDescriptor::withSubRange(IOMemoryDescriptor *        of,
 
        if (self && !self->initSubRange(of, offset, length, (IODirection) options)) {
                self->release();
-               self = 0;
+               self = NULL;
        }
        return self;
 }
@@ -151,6 +152,22 @@ IOSubMemoryDescriptor::setPurgeable( IOOptionBits newState,
        return err;
 }
 
+IOReturn
+IOSubMemoryDescriptor::setOwnership( task_t newOwner,
+    int newLedgerTag,
+    IOOptionBits newLedgerOptions )
+{
+       IOReturn err;
+
+       if (iokit_iomd_setownership_enabled == FALSE) {
+               return kIOReturnUnsupported;
+       }
+
+       err = _parent->setOwnership( newOwner, newLedgerTag, newLedgerOptions );
+
+       return err;
+}
+
 IOReturn
 IOSubMemoryDescriptor::prepare(
        IODirection forDirection)
@@ -182,7 +199,7 @@ IOSubMemoryDescriptor::makeMapping(
        IOByteCount             offset,
        IOByteCount             length )
 {
-       IOMemoryMap * mapping = 0;
+       IOMemoryMap * mapping = NULL;
 
 #ifndef __LP64__
        if (!(kIOMap64Bit & options)) {