LOGLEVEL_VAR(syncWaitQ), \
LOGLEVEL_VAR(sg), /* lib/sg */ \
LOGLEVEL_VAR(wrapLib), \
+ LOGLEVEL_VAR(digestlib) \
LOGLEVEL_EXTENSION_DECLARE(LOGLEVEL_USER);
uint32
Random_Quick(void *context);
+int
+FastRand(int seed);
+
#endif /* __RANDOM_H__ */
* and MAXSHORT with winnt.h
* 04/03/2007 shelleygong - use int instead of short for data
* inside the region
- * 02/12/2010 michael - Since coordinates are kept as ints, coordinate values
- * shouldn't be clamped to the range of short. I removed R_{MIN,MAX}SHORT
- * and changed clamping to be in the range R_MININT..R_MAXINT instead.
- * Since some code does "n < R_MININT" and "n > R_MAXINT", R_MININT must be
- * greater than INT_MIN and R_MAXINT must be less than INT_MAX.
+ * 02/12/2010 michael - Since coordinates are kept as ints, coordinate values
+ * shouldn't be clamped to the range of short. I removed R_{MIN,MAX}SHORT
+ * and changed clamping to be in the range R_MININT..R_MAXINT instead.
+ * Since some code does "n < R_MININT" and "n > R_MAXINT", R_MININT must be
+ * greater than INT_MIN and R_MAXINT must be less than INT_MAX.
+ * 03/08/2010 amarp - Move xalloc macro outside the header because of
+ * boost conflict with macro
*/
#ifndef __REGION_H__
#define CT_YXBANDED 18
-#define xalloc(n) malloc(n)
#define xrealloc(ptr, n) realloc((ptr), (n))
#define xfree(ptr) free(ptr)
return y;
}
+
+/**
+ *----------------------------------------------------------------------
+ *
+ * FastRand --
+ *
+ * Lifted from Util_FastRand() in
+ * /vmkernel-main/bora/vmcore/vmm/main/util_monitor.c The header
+ * comment of Util_FastRand(): Generates the next random number in the
+ * pseudo-random sequence defined by the multiplicative linear
+ * congruential generator S' = 16807 * S mod (2^31 - 1). This is the
+ * ACM "minimal standard random number generator". Based on method
+ * described by D.G. Carta in CACM, January 1990. Usage: provide
+ * previous random number as the seed for next one.
+ *
+ * Results:
+ * A random integrer number is returned.
+ *
+ * Side Effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+FastRand(int seed)
+{
+ uint64 product = 33614 * (uint64)seed;
+ uint32 product_lo = (uint32)(product & 0xffffffff) >> 1;
+ uint32 product_hi = product >> 32;
+ int32 test = product_lo + product_hi;
+ return test > 0 ? test : (test & 0x7fffffff) + 1;
+}
* and MAXSHORT with winnt.h
* 04/03/2007 shelleygong - use int instead of short for data
* inside the region *
- * 02/12/2010 michael - Since coordinates are kept as ints, coordinate values
- * shouldn't be clamped to the range of short. I removed R_{MIN,MAX}SHORT
- * and changed clamping to be in the range R_MININT..R_MAXINT instead.
- * Since some code does "n < R_MININT" and "n > R_MAXINT", R_MININT must be
- * greater than INT_MIN and R_MAXINT must be less than INT_MAX.
+ * 02/12/2010 michael - Since coordinates are kept as ints, coordinate
+ * values shouldn't be clamped to the range of short. I removed R_{MIN,MAX}SHORT
+ * and changed clamping to be in the range R_MININT..R_MAXINT instead.
+ * Since some code does "n < R_MININT" and "n > R_MAXINT", R_MININT must be
+ * greater than INT_MIN and R_MAXINT must be less than INT_MAX.
+ *
+ * 03/08/2010 amarp - xalloc conflicts with boost macros. Move it
+ * out of the header into the implementation
*/
#include <stdlib.h>
int miFindMaxBand(RegionPtr prgn);
#define good(reg) ASSERT(miValidRegion(reg))
+#define xalloc(n) malloc(n)
/*
* The functions in this file implement the Region abstraction used extensively
#define SCSI_ASC_LU_NOT_READY_ASCQ_MANUAL_INTERVENTION_REQUIRED 0x03
#define SCSI_ASC_LU_NOT_READY_ASCQ_TARGET_PORT_IN_TRANSITION 0x0a // an ascq
#define SCSI_ASC_LU_NOT_READY_ASCQ_TARGET_PORT_IN_STANDBY_MODE 0x0b // an ascq
+#define SCSI_ASC_COPY_FAILED 0x0d
+#define SCSI_ASC_COPY_FAILED_ASCQ_UNREACHABLE 0x02
#define SCSI_ASC_LU_NOT_READY_ASCQ_SPACE_ALLOCATION_IN_PROGRESS 0x14 // an ascq
#define SCSI_ASC_LU_NO_RESPONSE_TO_SELECTION 0x05 // logical unit doesn't respond to selection
#define SCSI_ASC_NO_REFERENCE_POSITION_FOUND 0x06
#define SCSI_INQ_PAGE_0x00 0x00
#define SCSI_INQ_PAGE_0x80 0x80
#define SCSI_INQ_PAGE_0x83 0x83
+#define SCSI_INQ_PAGE_0xB1 0xb1
/*
* The following structures define the Page format supported by the
#include "vmware_pack_end.h"
SCSI2InqPage83ResponseDescriptor;
+#define SCSI_INQ_PAGE_B1_LEN 64
+
+// Inquiry page 0xB1: Medium Rotation Rate
+#define SCSI_ROTATION_RATE_NOT_REPORTED 0x0
+#define SCSI_ROTATION_RATE_NON_ROTATING_MEDIUM 0x1
+
+// Inquiry page 0xB1: Form Factor
+#define SCSI_FORM_FACTOR_NOT_REPORTED 0x0
+
+/*
+ * Format of INQUIRY EVPD Page B1 response
+ * SBC3-r18, Section 6.5.3 table 138 Page 178
+ */
+typedef
+#include "vmware_pack_begin.h"
+struct SCSIInqPageB1ResponseHeader {
+ uint8 devClass :5,
+ pQual :3;
+ uint8 pageCode;
+ uint8 reserved1;
+ uint8 pageLength;
+ uint16 mediumRotationRate;
+ uint8 reserved2;
+ uint8 formFactor:4,
+ reserved3:4;
+ uint8 reserved4[56];
+}
+#include "vmware_pack_end.h"
+SCSIInqPageB1ResponseHeader;
+
typedef
#include "vmware_pack_begin.h"
struct SCSIInquiryVPDResponseHeader {
void VMCIHost_SetActiveHnd(VMCIHost *hostContext, uintptr_t eventHnd);
Bool VMCIHost_RemoveHnd(VMCIHost *hostContext, uintptr_t eventHnd);
Bool VMCIHost_IsActiveHnd(VMCIHost *hostContext, uintptr_t eventHnd);
+void VMCIHost_SetInactiveHnd(VMCIHost *hostContext, uintptr_t eventHnd);
uint32 VMCIHost_NumHnds(VMCIHost *hostContext);
+uintptr_t VMCIHost_GetActiveHnd(VMCIHost *hostContext);
#endif
void *VMCI_AllocKernelMem(size_t size, int flags);
uintptr_t eventHnd,
Bool isLocked);
VMCIContext *VMCIContext_FindAndUpdateSrcFSR(VMCIId migrateCid,
- uintptr_t eventHnd);
+ uintptr_t eventHnd,
+ uintptr_t *srcEventHnd);
Bool VMCIContext_IsActiveHnd(VMCIContext *context,
uintptr_t eventHnd);
+void VMCIContext_SetInactiveHnd(VMCIContext *context,
+ uintptr_t eventHnd);
Bool VMCIContext_RemoveHnd(VMCIContext *context,
uintptr_t eventHnd,
uint32 *numOld,