~n-muench/ubuntu/oneiric/open-vm-tools/open-vm-tools.fix-836277

« back to all changes in this revision

Viewing changes to modules/linux/shared/vmci_infrastructure.h

  • Committer: Evan Broder
  • Date: 2010-03-21 23:26:53 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: broder@mit.edu-20100321232653-5a57r7v7ch4o6byv
Merging shared upstream rev into target branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#define _VMCI_INFRASTRUCTURE_H_
27
27
 
28
28
#define INCLUDE_ALLOW_USERLEVEL
29
 
#define INCLUDE_ALLOW_VMMEXT
 
29
 
30
30
#define INCLUDE_ALLOW_MODULE
31
31
#define INCLUDE_ALLOW_VMMON
32
32
#define INCLUDE_ALLOW_VMCORE
51
51
 
52
52
/* Used to determine what checkpoint state to get and set. */
53
53
#define VMCI_NOTIFICATION_CPT_STATE 0x1
54
 
#define VMCI_WELLKNOWN_CPT_STATE 0x2
 
54
#define VMCI_WELLKNOWN_CPT_STATE    0x2
 
55
#define VMCI_DG_OUT_STATE           0x3
 
56
#define VMCI_DG_IN_STATE            0x4
 
57
#define VMCI_DG_IN_SIZE_STATE       0x5
55
58
 
56
59
/* Used to control the VMCI device in the vmkernel */
57
60
#define VMCI_DEV_RESET            0x01
59
62
#define VMCI_DEV_QUIESCE          0x03
60
63
#define VMCI_DEV_UNQUIESCE        0x04
61
64
#define VMCI_DEV_QP_BREAK_SHARING 0x05  // DEPRECATED
 
65
#define VMCI_DEV_RESTORE_SYNC     0x06
62
66
 
63
67
 
64
68
/*
92
96
   return hash & (size - 1);
93
97
}
94
98
 
 
99
 
 
100
/*
 
101
 *-------------------------------------------------------------------------
 
102
 *
 
103
 *  VMCI_HashId --
 
104
 *
 
105
 *     Hash function used by the Simple Datagram API. Hashes only a VMCI id
 
106
 *     (not the full VMCI handle) Based on the djb2
 
107
 *     hash function by Dan Bernstein.
 
108
 *
 
109
 *  Result:
 
110
 *     Returns guest call size.
 
111
 *
 
112
 *  Side effects:
 
113
 *     None.
 
114
 *
 
115
 *-------------------------------------------------------------------------
 
116
 */
 
117
 
 
118
static INLINE int
 
119
VMCI_HashId(VMCIId id,      // IN
 
120
            unsigned size)  // IN
 
121
{
 
122
   unsigned     i;
 
123
   int          hash        = 5381;
 
124
 
 
125
   for (i = 0; i < sizeof id; i++) {
 
126
      hash = ((hash << 5) + hash) + (uint8)(id >> (i * 8));
 
127
   }
 
128
   return hash & (size - 1);
 
129
}
 
130
 
95
131
#endif // _VMCI_INFRASTRUCTURE_H_