~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201207201942

« back to all changes in this revision

Viewing changes to modules/linux/vmci/vmciUtil.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-03-20 10:19:00 UTC
  • mfrom: (1.1.4 upstream) (2.4.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090320101900-1o604camiubq2de8
Tags: 2009.03.18-154848-2
Correcting patch system depends (Closes: #520493).

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
#  include <sys/ddi.h>
44
44
#  include <sys/sunddi.h>
45
45
#  include <sys/disp.h>
 
46
#elif defined(__APPLE__)
 
47
#  include <IOKit/IOLib.h>
46
48
#else 
47
49
#error "platform not supported."
48
50
#endif //linux
336
338
   return in_interrupt();
337
339
#elif defined(SOLARIS)
338
340
   return servicing_interrupt();   /* servicing_interrupt is not part of DDI. */
 
341
#elif defined(__APPLE__)
 
342
   /*
 
343
    * All interrupt servicing is handled by IOKit functions, by the time the IOService
 
344
    * interrupt handler is called we're no longer in an interrupt dispatch level.
 
345
    */
 
346
   return false;
339
347
#endif //
340
348
}
341
349
 
435
443
   dg = (VMCIDatagram *)dgInBuffer; 
436
444
   remainingBytes = currentDgInBufferSize;
437
445
   
438
 
   while (dg->dst.resource != VMCI_ERROR_INVALID_RESOURCE || remainingBytes > PAGE_SIZE) {
 
446
   while (dg->dst.resource != VMCI_INVALID_ID || remainingBytes > PAGE_SIZE) {
439
447
      unsigned dgInSize;
440
448
      
441
449
      /*
443
451
       * start on any page boundary in the buffer. 
444
452
       */
445
453
 
446
 
      if (dg->dst.resource == VMCI_ERROR_INVALID_RESOURCE) {
 
454
      if (dg->dst.resource == VMCI_INVALID_ID) {
447
455
         ASSERT(remainingBytes > PAGE_SIZE);
448
456
         dg = (VMCIDatagram *)ROUNDUP((uintptr_t)dg + 1, PAGE_SIZE);
449
457
         ASSERT((uint8 *)dg < dgInBuffer + currentDgInBufferSize);