]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/Kernel/IODataQueue.cpp
xnu-1699.24.23.tar.gz
[apple/xnu.git] / iokit / Kernel / IODataQueue.cpp
index 263de30dc5132dfbab4ec242ca58e80f9f71ee88..1001ebeff0a88353eeace68baecf001f5ba84aa4 100644 (file)
@@ -77,14 +77,14 @@ Boolean IODataQueue::initWithCapacity(UInt32 size)
         return false;
     }
 
         return false;
     }
 
-    dataQueue = (IODataQueueMemory *)IOMallocAligned(round_page_32(size + DATA_QUEUE_MEMORY_HEADER_SIZE), PAGE_SIZE);
+    dataQueue = (IODataQueueMemory *)IOMallocAligned(round_page(size + DATA_QUEUE_MEMORY_HEADER_SIZE), PAGE_SIZE);
     if (dataQueue == 0) {
         return false;
     }
 
     if (dataQueue == 0) {
         return false;
     }
 
-    dataQueue->queueSize = size;
-    dataQueue->head = 0;
-    dataQueue->tail = 0;
+    dataQueue->queueSize    = size;
+    dataQueue->head         = 0;
+    dataQueue->tail         = 0;
 
     return true;
 }
 
     return true;
 }
@@ -97,7 +97,7 @@ Boolean IODataQueue::initWithEntries(UInt32 numEntries, UInt32 entrySize)
 void IODataQueue::free()
 {
     if (dataQueue) {
 void IODataQueue::free()
 {
     if (dataQueue) {
-        IOFreeAligned(dataQueue, round_page_32(dataQueue->queueSize + DATA_QUEUE_MEMORY_HEADER_SIZE));
+        IOFreeAligned(dataQueue, round_page(dataQueue->queueSize + DATA_QUEUE_MEMORY_HEADER_SIZE));
     }
 
     super::free();
     }
 
     super::free();
@@ -208,8 +208,8 @@ void IODataQueue::sendDataAvailableNotification()
     mach_msg_header_t *        msgh;
 
     msgh = (mach_msg_header_t *)notifyMsg;
     mach_msg_header_t *        msgh;
 
     msgh = (mach_msg_header_t *)notifyMsg;
-    if (msgh) {
-        kr = mach_msg_send_from_kernel(msgh, msgh->msgh_size);
+    if (msgh && msgh->msgh_remote_port) {
+        kr = mach_msg_send_from_kernel_proper(msgh, msgh->msgh_size);
         switch(kr) {
             case MACH_SEND_TIMED_OUT:  // Notification already sent
             case MACH_MSG_SUCCESS:
         switch(kr) {
             case MACH_SEND_TIMED_OUT:  // Notification already sent
             case MACH_MSG_SUCCESS: