]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/IOKit/IOSharedDataQueue.h
xnu-4570.71.2.tar.gz
[apple/xnu.git] / iokit / IOKit / IOSharedDataQueue.h
index a31cfc965bbace9680f1e5b06ee3a4c911d5290b..16e7cdde27a529b5b6d6f78ef20bf6319d2938b1 100644 (file)
 #undef dequeue
 #endif
 
+#define DISABLE_DATAQUEUE_WARNING /* IODataQueue is deprecated, please use IOSharedDataQueue instead */
+
 #include <IOKit/IODataQueue.h>
 
+#undef DISABLE_DATAQUEUE_WARNING
+
 typedef struct _IODataQueueEntry IODataQueueEntry;
 
 /*!
@@ -60,9 +64,23 @@ class IOSharedDataQueue : public IODataQueue
     ExpansionData * _reserved;
 
 protected:
-    virtual void free();
+    virtual void free() APPLE_KEXT_OVERRIDE;
 
+    /*!
+     * @function getQueueSize
+     * @abstract Returns the size of the data queue.
+     * @discussion Use this method to access the size of the data queue. Do not access the value of size directly, as it can get modified from userspace and is not reliable. 
+     * @result Returns the size of the data queue, or zero in case of failure.
+     */
     UInt32 getQueueSize();
+
+    /*!
+     * @function setQueueSize
+     * @abstract Stores the value of the size of the data queue.
+     * @discussion Use this method to store the value of the size of the data queue. Do not access the value of size directly, as it can get modified from userspace and is not reliable.
+     * @param size The size of the data queue.  
+     * @result Returns true in case of success, false otherwise.
+     */
     Boolean setQueueSize(UInt32 size);
 
 public:
@@ -92,7 +110,7 @@ public:
      * @param size The size of the data queue memory region.
      * @result Returns true on success and false on failure.
      */
-    virtual Boolean initWithCapacity(UInt32 size);
+    virtual Boolean initWithCapacity(UInt32 size) APPLE_KEXT_OVERRIDE;
 
     /*!
      * @function getMemoryDescriptor
@@ -100,7 +118,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();
+    virtual IOMemoryDescriptor *getMemoryDescriptor() APPLE_KEXT_OVERRIDE;
 
     /*!
      * @function peek
@@ -128,7 +146,7 @@ public:
      * @param dataSize Size of the data pointed to by data.
      * @result Returns true on success and false on failure.  Typically failure means that the queue is full.
      */
-    virtual Boolean enqueue(void *data, UInt32 dataSize);
+    virtual Boolean enqueue(void *data, UInt32 dataSize) APPLE_KEXT_OVERRIDE;
 
     OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 0);
     OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 1);