/*
- * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 1998-2019 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#define _IOMEMORYCURSOR_H
#include <libkern/c++/OSObject.h>
+#include <libkern/c++/OSPtr.h>
#include <IOKit/IOTypes.h>
class IOMemoryDescriptor;
*/
class IOMemoryCursor : public OSObject
{
- OSDeclareDefaultStructors(IOMemoryCursor)
+ OSDeclareDefaultStructors(IOMemoryCursor);
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.
*/
- static IOMemoryCursor *
+ static OSPtr<IOMemoryCursor>
withSpecification(SegmentFunction outSegFunc,
IOPhysicalLength maxSegmentSize = 0,
IOPhysicalLength maxTransferSize = 0,
void * segments,
UInt32 maxSegments,
UInt32 maxTransferSize = 0,
- IOByteCount *transferSize = 0);
+ IOByteCount *transferSize = NULL);
};
/************************ class IONaturalMemoryCursor ************************/
*/
class IONaturalMemoryCursor : public IOMemoryCursor
{
- OSDeclareDefaultStructors(IONaturalMemoryCursor)
+ OSDeclareDefaultStructors(IONaturalMemoryCursor);
public:
/*! @function outputSegment
* @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);
PhysicalSegment *segments,
UInt32 maxSegments,
UInt32 inMaxTransferSize = 0,
- IOByteCount *transferSize = 0)
+ IOByteCount *transferSize = NULL)
{
return genPhysicalSegments(descriptor, fromPosition, segments,
maxSegments, inMaxTransferSize, transferSize);
*/
class IOBigMemoryCursor : public IOMemoryCursor
{
- OSDeclareDefaultStructors(IOBigMemoryCursor)
+ OSDeclareDefaultStructors(IOBigMemoryCursor);
public:
/*! @function outputSegment
* @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);
PhysicalSegment * segments,
UInt32 maxSegments,
UInt32 inMaxTransferSize = 0,
- IOByteCount * transferSize = 0)
+ IOByteCount * transferSize = NULL)
{
return genPhysicalSegments(descriptor, fromPosition, segments,
maxSegments, inMaxTransferSize, transferSize);
*/
class IOLittleMemoryCursor : public IOMemoryCursor
{
- OSDeclareDefaultStructors(IOLittleMemoryCursor)
+ OSDeclareDefaultStructors(IOLittleMemoryCursor);
public:
/*! @function outputSegment
* @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);
PhysicalSegment * segments,
UInt32 maxSegments,
UInt32 inMaxTransferSize = 0,
- IOByteCount * transferSize = 0)
+ IOByteCount * transferSize = NULL)
{
return genPhysicalSegments(descriptor, fromPosition, segments,
maxSegments, inMaxTransferSize, transferSize);