]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/IOKit/IOMemoryCursor.h
xnu-7195.101.1.tar.gz
[apple/xnu.git] / iokit / IOKit / IOMemoryCursor.h
index 99f9dc8140146bfec28e3187403fbd9e4b1523eb..22eea326e19bb9e62eacedd9502df1cc20183f84 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 1998-2019 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  *
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  *
@@ -29,6 +29,7 @@
 #define _IOMEMORYCURSOR_H
 
 #include <libkern/c++/OSObject.h>
 #define _IOMEMORYCURSOR_H
 
 #include <libkern/c++/OSObject.h>
+#include <libkern/c++/OSPtr.h>
 #include <IOKit/IOTypes.h>
 
 class IOMemoryDescriptor;
 #include <IOKit/IOTypes.h>
 
 class IOMemoryDescriptor;
@@ -54,7 +55,7 @@ class IOMemoryDescriptor;
  */
 class IOMemoryCursor : public OSObject
 {
  */
 class IOMemoryCursor : public OSObject
 {
-       OSDeclareDefaultStructors(IOMemoryCursor)
+       OSDeclareDefaultStructors(IOMemoryCursor);
 
 public:
 /*!
 
 public:
 /*!
@@ -111,7 +112,7 @@ public:
  *   @param alignment Alignment restrictions on output physical addresses.  Not currently implemented.  Defaults to single byte alignment.
  *   @result Returns a new memory cursor if successfully created and initialized, 0 otherwise.
  */
  *   @param alignment Alignment restrictions on output physical addresses.  Not currently implemented.  Defaults to single byte alignment.
  *   @result Returns a new memory cursor if successfully created and initialized, 0 otherwise.
  */
-       static IOMemoryCursor *
+       static OSPtr<IOMemoryCursor>
        withSpecification(SegmentFunction  outSegFunc,
            IOPhysicalLength maxSegmentSize = 0,
            IOPhysicalLength maxTransferSize = 0,
        withSpecification(SegmentFunction  outSegFunc,
            IOPhysicalLength maxSegmentSize = 0,
            IOPhysicalLength maxTransferSize = 0,
@@ -148,7 +149,7 @@ public:
                void *              segments,
                UInt32              maxSegments,
                UInt32              maxTransferSize = 0,
                void *              segments,
                UInt32              maxSegments,
                UInt32              maxTransferSize = 0,
-               IOByteCount        *transferSize = 0);
+               IOByteCount        *transferSize = NULL);
 };
 
 /************************ class IONaturalMemoryCursor ************************/
 };
 
 /************************ class IONaturalMemoryCursor ************************/
@@ -161,7 +162,7 @@ public:
  */
 class IONaturalMemoryCursor : public IOMemoryCursor
 {
  */
 class IONaturalMemoryCursor : public IOMemoryCursor
 {
-       OSDeclareDefaultStructors(IONaturalMemoryCursor)
+       OSDeclareDefaultStructors(IONaturalMemoryCursor);
 
 public:
 /*! @function outputSegment
 
 public:
 /*! @function outputSegment
@@ -187,7 +188,7 @@ public:
  *   @param alignment Alignment restrictions on output physical addresses.  Not currently implemented.  Defaults to single byte alignment.
  *   @result Returns a new memory cursor if successfully created and initialized, 0 otherwise.
  */
  *   @param alignment Alignment restrictions on output physical addresses.  Not currently implemented.  Defaults to single byte alignment.
  *   @result Returns a new memory cursor if successfully created and initialized, 0 otherwise.
  */
-       static IONaturalMemoryCursor *
+       static OSPtr<IONaturalMemoryCursor>
        withSpecification(IOPhysicalLength maxSegmentSize,
            IOPhysicalLength maxTransferSize,
            IOPhysicalLength alignment = 1);
        withSpecification(IOPhysicalLength maxSegmentSize,
            IOPhysicalLength maxTransferSize,
            IOPhysicalLength alignment = 1);
@@ -221,7 +222,7 @@ public:
            PhysicalSegment    *segments,
            UInt32              maxSegments,
            UInt32              inMaxTransferSize = 0,
            PhysicalSegment    *segments,
            UInt32              maxSegments,
            UInt32              inMaxTransferSize = 0,
-           IOByteCount        *transferSize = 0)
+           IOByteCount        *transferSize = NULL)
        {
                return genPhysicalSegments(descriptor, fromPosition, segments,
                           maxSegments, inMaxTransferSize, transferSize);
        {
                return genPhysicalSegments(descriptor, fromPosition, segments,
                           maxSegments, inMaxTransferSize, transferSize);
@@ -237,7 +238,7 @@ public:
  */
 class IOBigMemoryCursor : public IOMemoryCursor
 {
  */
 class IOBigMemoryCursor : public IOMemoryCursor
 {
-       OSDeclareDefaultStructors(IOBigMemoryCursor)
+       OSDeclareDefaultStructors(IOBigMemoryCursor);
 
 public:
 /*! @function outputSegment
 
 public:
 /*! @function outputSegment
@@ -263,7 +264,7 @@ public:
  *   @param alignment Alignment restrictions on output physical addresses.  Not currently implemented.  Defaults to single byte alignment.
  *   @result Returns a new memory cursor if successfully created and initialized, 0 otherwise.
  */
  *   @param alignment Alignment restrictions on output physical addresses.  Not currently implemented.  Defaults to single byte alignment.
  *   @result Returns a new memory cursor if successfully created and initialized, 0 otherwise.
  */
-       static IOBigMemoryCursor *
+       static OSPtr<IOBigMemoryCursor>
        withSpecification(IOPhysicalLength maxSegmentSize,
            IOPhysicalLength maxTransferSize,
            IOPhysicalLength alignment = 1);
        withSpecification(IOPhysicalLength maxSegmentSize,
            IOPhysicalLength maxTransferSize,
            IOPhysicalLength alignment = 1);
@@ -298,7 +299,7 @@ public:
            PhysicalSegment *    segments,
            UInt32               maxSegments,
            UInt32               inMaxTransferSize = 0,
            PhysicalSegment *    segments,
            UInt32               maxSegments,
            UInt32               inMaxTransferSize = 0,
-           IOByteCount       *  transferSize = 0)
+           IOByteCount       *  transferSize = NULL)
        {
                return genPhysicalSegments(descriptor, fromPosition, segments,
                           maxSegments, inMaxTransferSize, transferSize);
        {
                return genPhysicalSegments(descriptor, fromPosition, segments,
                           maxSegments, inMaxTransferSize, transferSize);
@@ -314,7 +315,7 @@ public:
  */
 class IOLittleMemoryCursor : public IOMemoryCursor
 {
  */
 class IOLittleMemoryCursor : public IOMemoryCursor
 {
-       OSDeclareDefaultStructors(IOLittleMemoryCursor)
+       OSDeclareDefaultStructors(IOLittleMemoryCursor);
 
 public:
 /*! @function outputSegment
 
 public:
 /*! @function outputSegment
@@ -339,7 +340,7 @@ public:
  *   @param alignment Alignment restrictions on output physical addresses.  Not currently implemented.  Defaults to single byte alignment.
  *   @result Returns a new memory cursor if successfully created and initialized, 0 otherwise.
  */
  *   @param alignment Alignment restrictions on output physical addresses.  Not currently implemented.  Defaults to single byte alignment.
  *   @result Returns a new memory cursor if successfully created and initialized, 0 otherwise.
  */
-       static IOLittleMemoryCursor *
+       static OSPtr<IOLittleMemoryCursor>
        withSpecification(IOPhysicalLength maxSegmentSize,
            IOPhysicalLength maxTransferSize,
            IOPhysicalLength alignment = 1);
        withSpecification(IOPhysicalLength maxSegmentSize,
            IOPhysicalLength maxTransferSize,
            IOPhysicalLength alignment = 1);
@@ -373,7 +374,7 @@ public:
            PhysicalSegment *    segments,
            UInt32               maxSegments,
            UInt32               inMaxTransferSize = 0,
            PhysicalSegment *    segments,
            UInt32               maxSegments,
            UInt32               inMaxTransferSize = 0,
-           IOByteCount       *  transferSize = 0)
+           IOByteCount       *  transferSize = NULL)
        {
                return genPhysicalSegments(descriptor, fromPosition, segments,
                           maxSegments, inMaxTransferSize, transferSize);
        {
                return genPhysicalSegments(descriptor, fromPosition, segments,
                           maxSegments, inMaxTransferSize, transferSize);