]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/IOKit/IOSharedDataQueue.h
xnu-7195.50.7.100.1.tar.gz
[apple/xnu.git] / iokit / IOKit / IOSharedDataQueue.h
index f0347c8c67f16db245552b22789fd51746da07f9..e634da8f82e3d281dc94202d13894a19482c645f 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@
  *
 #ifndef _IOKIT_IOSHAREDDATAQUEUE_H
 #define _IOKIT_IOSHAREDDATAQUEUE_H
 
-#ifdef dequeue
-#undef dequeue
-#endif
-#ifdef enqueue
-#undef enqueue
-#endif
-
 #define DISABLE_DATAQUEUE_WARNING /* IODataQueue is deprecated, please use IOSharedDataQueue instead */
 
 #include <IOKit/IODataQueue.h>
+#include <libkern/c++/OSPtr.h>
 
 #undef DISABLE_DATAQUEUE_WARNING
 
@@ -57,7 +51,7 @@ typedef struct _IODataQueueEntry IODataQueueEntry;
  */
 class IOSharedDataQueue : public IODataQueue
 {
-       OSDeclareDefaultStructors(IOSharedDataQueue)
+       OSDeclareDefaultStructors(IOSharedDataQueue);
 
        struct ExpansionData {
                UInt32 queueSize;
@@ -94,7 +88,7 @@ public:
  * @param size The size of the data queue memory region.
  * @result Returns the newly allocated IOSharedDataQueue instance.  Zero is returned on failure.
  */
-       static IOSharedDataQueue *withCapacity(UInt32 size);
+       static OSPtr<IOSharedDataQueue> withCapacity(UInt32 size);
 
 /*!
  * @function withEntries
@@ -104,7 +98,7 @@ public:
  * @param entrySize Size of each entry.
  * @result Reeturns the newly allocated IOSharedDataQueue instance.  Zero is returned on failure.
  */
-       static IOSharedDataQueue *withEntries(UInt32 numEntries, UInt32 entrySize);
+       static OSPtr<IOSharedDataQueue> withEntries(UInt32 numEntries, UInt32 entrySize);
 
 /*!
  * @function initWithCapacity
@@ -121,7 +115,7 @@ public:
  * @discussion The IOMemoryDescriptor instance returned by this method is intended to be mapped into a user process.  This is the memory region that the IODataQueueClient code operates on.
  * @result Returns a newly allocated IOMemoryDescriptor for the IODataQueueMemory region.  Returns zero on failure.
  */
-       virtual IOMemoryDescriptor *getMemoryDescriptor() APPLE_KEXT_OVERRIDE;
+       virtual OSPtr<IOMemoryDescriptor> getMemoryDescriptor() APPLE_KEXT_OVERRIDE;
 
 /*!
  * @function peek