storDriver->RequestExtSize = sizeof(STORVSC_REQUEST_EXTENSION);
// Divide the ring buffer data size (which is 1 page less than the ring buffer size since that page is reserved for the ring buffer indices)
- // by the max request size (which is VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER + VSTOR_PACKET + UINT64)
+ // by the max request size (which is VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER + VSTOR_PACKET + u64)
storDriver->MaxOutstandingRequestsPerChannel =
- ((storDriver->RingBufferSize - PAGE_SIZE) / ALIGN_UP(MAX_MULTIPAGE_BUFFER_PACKET + sizeof(VSTOR_PACKET) + sizeof(UINT64),sizeof(UINT64)));
+ ((storDriver->RingBufferSize - PAGE_SIZE) / ALIGN_UP(MAX_MULTIPAGE_BUFFER_PACKET + sizeof(VSTOR_PACKET) + sizeof(u64),sizeof(u64)));
DPRINT_INFO(BLKVSC, "max io outstd %u", storDriver->MaxOutstandingRequestsPerChannel);
int i=0;
int pfnCount=0;
- pfnCount = (Len - sizeof(VMBUS_CHANNEL_GPADL_BODY))/ sizeof(UINT64);
+ pfnCount = (Len - sizeof(VMBUS_CHANNEL_GPADL_BODY))/ sizeof(u64);
DPRINT_DBG(VMBUS, "gpadl body - len %d pfn count %d", Len, pfnCount);
for (i=0; i< pfnCount; i++)
// do we need a gpadl body msg
pfnSize = MAX_SIZE_CHANNEL_MESSAGE - sizeof(VMBUS_CHANNEL_GPADL_HEADER) - sizeof(GPA_RANGE);
- pfnCount = pfnSize / sizeof(UINT64);
+ pfnCount = pfnSize / sizeof(u64);
if (pageCount > pfnCount) // we need a gpadl body
{
// fill in the header
- msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_HEADER) + sizeof(GPA_RANGE) + pfnCount*sizeof(UINT64);
+ msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_HEADER) + sizeof(GPA_RANGE) + pfnCount*sizeof(u64);
msgHeader = MemAllocZeroed(msgSize);
INITIALIZE_LIST_HEAD(&msgHeader->SubMsgList);
gpaHeader = (VMBUS_CHANNEL_GPADL_HEADER*)msgHeader->Msg;
gpaHeader->RangeCount = 1;
- gpaHeader->RangeBufLen = sizeof(GPA_RANGE) + pageCount*sizeof(UINT64);
+ gpaHeader->RangeBufLen = sizeof(GPA_RANGE) + pageCount*sizeof(u64);
gpaHeader->Range[0].ByteOffset = 0;
gpaHeader->Range[0].ByteCount = Size;
for (i=0; i<pfnCount; i++)
// how many pfns can we fit
pfnSize = MAX_SIZE_CHANNEL_MESSAGE - sizeof(VMBUS_CHANNEL_GPADL_BODY);
- pfnCount = pfnSize / sizeof(UINT64);
+ pfnCount = pfnSize / sizeof(u64);
// fill in the body
while (pfnLeft)
pfnCurr = pfnLeft;
}
- msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_BODY) + pfnCurr*sizeof(UINT64);
+ msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_BODY) + pfnCurr*sizeof(u64);
msgBody = MemAllocZeroed(msgSize);
ASSERT(msgBody);
msgBody->MessageSize = msgSize;
else
{
// everything fits in a header
- msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_HEADER) + sizeof(GPA_RANGE) + pageCount*sizeof(UINT64);
+ msgSize = sizeof(VMBUS_CHANNEL_MSGINFO) + sizeof(VMBUS_CHANNEL_GPADL_HEADER) + sizeof(GPA_RANGE) + pageCount*sizeof(u64);
msgHeader = MemAllocZeroed(msgSize);
msgHeader->MessageSize=msgSize;
gpaHeader = (VMBUS_CHANNEL_GPADL_HEADER*)msgHeader->Msg;
gpaHeader->RangeCount = 1;
- gpaHeader->RangeBufLen = sizeof(GPA_RANGE) + pageCount*sizeof(UINT64);
+ gpaHeader->RangeBufLen = sizeof(GPA_RANGE) + pageCount*sizeof(u64);
gpaHeader->Range[0].ByteOffset = 0;
gpaHeader->Range[0].ByteCount = Size;
for (i=0; i<pageCount; i++)
VMBUS_CHANNEL *Channel,
const void * Buffer,
u32 BufferLen,
- UINT64 RequestId,
+ u64 RequestId,
VMBUS_PACKET_TYPE Type,
u32 Flags
)
int ret=0;
VMPACKET_DESCRIPTOR desc;
u32 packetLen = sizeof(VMPACKET_DESCRIPTOR) + BufferLen;
- u32 packetLenAligned = ALIGN_UP(packetLen, sizeof(UINT64));
+ u32 packetLenAligned = ALIGN_UP(packetLen, sizeof(u64));
SG_BUFFER_LIST bufferList[3];
- UINT64 alignedData=0;
+ u64 alignedData=0;
DPRINT_ENTER(VMBUS);
DPRINT_DBG(VMBUS, "channel %p buffer %p len %d", Channel, Buffer, BufferLen);
DumpVmbusChannel(Channel);
- ASSERT((packetLenAligned - packetLen) < sizeof(UINT64));
+ ASSERT((packetLenAligned - packetLen) < sizeof(u64));
// Setup the descriptor
desc.Type = Type;//VmbusPacketTypeDataInBand;
u32 PageCount,
void * Buffer,
u32 BufferLen,
- UINT64 RequestId
+ u64 RequestId
)
{
int ret=0;
u32 packetLen;
u32 packetLenAligned;
SG_BUFFER_LIST bufferList[3];
- UINT64 alignedData=0;
+ u64 alignedData=0;
DPRINT_ENTER(VMBUS);
// Adjust the size down since VMBUS_CHANNEL_PACKET_PAGE_BUFFER is the largest size we support
descSize = sizeof(VMBUS_CHANNEL_PACKET_PAGE_BUFFER) - ((MAX_PAGE_BUFFER_COUNT - PageCount)*sizeof(PAGE_BUFFER));
packetLen = descSize + BufferLen;
- packetLenAligned = ALIGN_UP(packetLen, sizeof(UINT64));
+ packetLenAligned = ALIGN_UP(packetLen, sizeof(u64));
- ASSERT((packetLenAligned - packetLen) < sizeof(UINT64));
+ ASSERT((packetLenAligned - packetLen) < sizeof(u64));
// Setup the descriptor
desc.Type = VmbusPacketTypeDataUsingGpaDirect;
MULTIPAGE_BUFFER *MultiPageBuffer,
void * Buffer,
u32 BufferLen,
- UINT64 RequestId
+ u64 RequestId
)
{
int ret=0;
u32 packetLen;
u32 packetLenAligned;
SG_BUFFER_LIST bufferList[3];
- UINT64 alignedData=0;
+ u64 alignedData=0;
u32 PfnCount = NUM_PAGES_SPANNED(MultiPageBuffer->Offset, MultiPageBuffer->Length);
DPRINT_ENTER(VMBUS);
ASSERT(PfnCount <= MAX_MULTIPAGE_BUFFER_COUNT);
// Adjust the size down since VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER is the largest size we support
- descSize = sizeof(VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER) - ((MAX_MULTIPAGE_BUFFER_COUNT - PfnCount)*sizeof(UINT64));
+ descSize = sizeof(VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER) - ((MAX_MULTIPAGE_BUFFER_COUNT - PfnCount)*sizeof(u64));
packetLen = descSize + BufferLen;
- packetLenAligned = ALIGN_UP(packetLen, sizeof(UINT64));
+ packetLenAligned = ALIGN_UP(packetLen, sizeof(u64));
- ASSERT((packetLenAligned - packetLen) < sizeof(UINT64));
+ ASSERT((packetLenAligned - packetLen) < sizeof(u64));
// Setup the descriptor
desc.Type = VmbusPacketTypeDataUsingGpaDirect;
desc.Range.Length = MultiPageBuffer->Length;
desc.Range.Offset = MultiPageBuffer->Offset;
- memcpy(desc.Range.PfnArray, MultiPageBuffer->PfnArray, PfnCount*sizeof(UINT64));
+ memcpy(desc.Range.PfnArray, MultiPageBuffer->PfnArray, PfnCount*sizeof(u64));
bufferList[0].Data = &desc;
bufferList[0].Length = descSize;
void * Buffer,
u32 BufferLen,
u32* BufferActualLen,
- UINT64* RequestId
+ u64* RequestId
)
{
VMPACKET_DESCRIPTOR desc;
void * Buffer,
u32 BufferLen,
u32* BufferActualLen,
- UINT64* RequestId
+ u64* RequestId
)
{
VMPACKET_DESCRIPTOR desc;
u16 DataOffset8;
u16 Length8;
u16 Flags;
- UINT64 TransactionId;
+ u64 TransactionId;
u32 Reserved;
u32 RangeCount;
PAGE_BUFFER Range[MAX_PAGE_BUFFER_COUNT];
u16 DataOffset8;
u16 Length8;
u16 Flags;
- UINT64 TransactionId;
+ u64 TransactionId;
u32 Reserved;
u32 RangeCount; // Always 1 in this case
MULTIPAGE_BUFFER Range;
VMBUS_CHANNEL *Channel,
const void * Buffer,
u32 BufferLen,
- UINT64 RequestId,
+ u64 RequestId,
VMBUS_PACKET_TYPE Type,
u32 Flags
);
u32 PageCount,
void * Buffer,
u32 BufferLen,
- UINT64 RequestId
+ u64 RequestId
);
static int
MULTIPAGE_BUFFER *MultiPageBuffer,
void * Buffer,
u32 BufferLen,
- UINT64 RequestId
+ u64 RequestId
);
static int
void * Buffer,
u32 BufferLen,
u32* BufferActualLen,
- UINT64* RequestId
+ u64* RequestId
);
static int
void * Buffer,
u32 BufferLen,
u32* BufferActualLen,
- UINT64* RequestId
+ u64* RequestId
);
static void
PDEVICE_OBJECT Device,
const void * Buffer,
u32 BufferLen,
- UINT64 RequestId,
+ u64 RequestId,
u32 Type,
u32 Flags
)
u32 PageCount,
void * Buffer,
u32 BufferLen,
- UINT64 RequestId
+ u64 RequestId
)
{
return VmbusChannelSendPacketPageBuffer((VMBUS_CHANNEL*)Device->context,
MULTIPAGE_BUFFER *MultiPageBuffer,
void * Buffer,
u32 BufferLen,
- UINT64 RequestId
+ u64 RequestId
)
{
return VmbusChannelSendPacketMultiPageBuffer((VMBUS_CHANNEL*)Device->context,
void * Buffer,
u32 BufferLen,
u32* BufferActualLen,
- UINT64* RequestId
+ u64* RequestId
)
{
return VmbusChannelRecvPacket((VMBUS_CHANNEL*)Device->context,
void * Buffer,
u32 BufferLen,
u32* BufferActualLen,
- UINT64* RequestId
+ u64* RequestId
)
{
return VmbusChannelRecvPacketRaw((VMBUS_CHANNEL*)Device->context,
Invoke the specified hypercall
--*/
-static UINT64
+static u64
HvDoHypercall (
- UINT64 Control,
+ u64 Control,
void* Input,
void* Output
)
{
#ifdef CONFIG_X86_64
- UINT64 hvStatus=0;
- UINT64 inputAddress = (Input)? GetPhysicalAddress(Input) : 0;
- UINT64 outputAddress = (Output)? GetPhysicalAddress(Output) : 0;
+ u64 hvStatus=0;
+ u64 inputAddress = (Input)? GetPhysicalAddress(Input) : 0;
+ u64 outputAddress = (Output)? GetPhysicalAddress(Output) : 0;
volatile void* hypercallPage = gHvContext.HypercallPage;
DPRINT_DBG(VMBUS, "Hypercall <control %llx input phys %llx virt %p output phys %llx virt %p hypercall %p>",
u32 controlLo = Control & 0xFFFFFFFF;
u32 hvStatusHi = 1;
u32 hvStatusLo = 1;
- UINT64 inputAddress = (Input) ? GetPhysicalAddress(Input) : 0;
+ u64 inputAddress = (Input) ? GetPhysicalAddress(Input) : 0;
u32 inputAddressHi = inputAddress >> 32;
u32 inputAddressLo = inputAddress & 0xFFFFFFFF;
- UINT64 outputAddress = (Output) ?GetPhysicalAddress(Output) : 0;
+ u64 outputAddress = (Output) ?GetPhysicalAddress(Output) : 0;
u32 outputAddressHi = outputAddress >> 32;
u32 outputAddressLo = outputAddress & 0xFFFFFFFF;
volatile void* hypercallPage = gHvContext.HypercallPage;
__asm__ __volatile__ ("call *%8" : "=d"(hvStatusHi), "=a"(hvStatusLo) : "d" (controlHi), "a" (controlLo), "b" (inputAddressHi), "c" (inputAddressLo), "D"(outputAddressHi), "S"(outputAddressLo), "m" (hypercallPage));
- DPRINT_DBG(VMBUS, "Hypercall <return %llx>", hvStatusLo | ((UINT64)hvStatusHi << 32));
+ DPRINT_DBG(VMBUS, "Hypercall <return %llx>", hvStatusLo | ((u64)hvStatusHi << 32));
- return (hvStatusLo | ((UINT64)hvStatusHi << 32));
+ return (hvStatusLo | ((u64)hvStatusHi << 32));
#endif // x86_64
}
)
{
struct alignedInput {
- UINT64 alignment8;
+ u64 alignment8;
HV_INPUT_POST_MESSAGE msg;
};
u32 irqVector
)
{
- UINT64 version;
+ u64 version;
HV_SYNIC_SIMP simp;
HV_SYNIC_SIEFP siefp;
HV_SYNIC_SINT sharedSint;
HV_SYNIC_SCONTROL sctrl;
- UINT64 guestID;
+ u64 guestID;
int ret=0;
DPRINT_ENTER(VMBUS);
#define HV_XENLINUX_GUEST_ID_LO 0x00000000
#define HV_XENLINUX_GUEST_ID_HI 0x0B00B135
-#define HV_XENLINUX_GUEST_ID (((UINT64)HV_XENLINUX_GUEST_ID_HI << 32) | HV_XENLINUX_GUEST_ID_LO)
+#define HV_XENLINUX_GUEST_ID (((u64)HV_XENLINUX_GUEST_ID_HI << 32) | HV_XENLINUX_GUEST_ID_LO)
#define HV_LINUX_GUEST_ID_LO 0x00000000
#define HV_LINUX_GUEST_ID_HI 0xB16B00B5
-#define HV_LINUX_GUEST_ID (((UINT64)HV_LINUX_GUEST_ID_HI << 32) | HV_LINUX_GUEST_ID_LO)
+#define HV_LINUX_GUEST_ID (((u64)HV_LINUX_GUEST_ID_HI << 32) | HV_LINUX_GUEST_ID_LO)
#define HV_CPU_POWER_MANAGEMENT (1 << 0)
#define HV_RECOMMENDATIONS_MAX 4
#define HV_CAPS_MAX 8
-#define HV_HYPERCALL_PARAM_ALIGN sizeof(UINT64)
+#define HV_HYPERCALL_PARAM_ALIGN sizeof(u64)
//
// Service definitions
typedef struct {
- UINT64 Align8;
+ u64 Align8;
HV_INPUT_SIGNAL_EVENT Event;
} HV_INPUT_SIGNAL_EVENT_BUFFER;
typedef struct {
- UINT64 GuestId; // XenLinux or native Linux. If XenLinux, the hypercall and synic pages has already been initialized
+ u64 GuestId; // XenLinux or native Linux. If XenLinux, the hypercall and synic pages has already been initialized
void* HypercallPage;
BOOL SynICInitialized;
return val;
}
-static inline void WriteMsr(int msr, UINT64 val)
+static inline void WriteMsr(int msr, u64 val)
{
WRMSR(msr, val);
static void
NetVscSendReceiveCompletion(
DEVICE_OBJECT *Device,
- UINT64 TransactionId
+ u64 TransactionId
);
static inline NETVSC_DEVICE* AllocNetDevice(DEVICE_OBJECT *Device)
static void
NetVscSendReceiveCompletion(
DEVICE_OBJECT *Device,
- UINT64 TransactionId
+ u64 TransactionId
)
{
NVSP_MESSAGE recvcompMessage;
NETVSC_PACKET *packet = (NETVSC_PACKET*)Context;
DEVICE_OBJECT *device = (DEVICE_OBJECT*)packet->Device;
NETVSC_DEVICE* netDevice;
- UINT64 transactionId=0;
+ u64 transactionId=0;
BOOL fSendReceiveComp = FALSE;
DPRINT_ENTER(NETVSC);
NETVSC_DEVICE *netDevice;
u32 bytesRecvd;
- UINT64 requestId;
- UCHAR packet[netPacketSize];
+ u64 requestId;
+ unsigned char packet[netPacketSize];
VMPACKET_DESCRIPTOR *desc;
- UCHAR *buffer=packet;
+ unsigned char *buffer=packet;
int bufferlen=netPacketSize;
NVSP_MESSAGE ChannelInitPacket;
NVSP_MESSAGE RevokePacket;
- //UCHAR HwMacAddr[HW_MACADDR_LEN];
+ //unsigned char HwMacAddr[HW_MACADDR_LEN];
// Holds rndis device info
void *Extension;
GetRingBufferIndices()
Description:
- Get the read and write indices as UINT64 of the specified ring buffer
+ Get the read and write indices as u64 of the specified ring buffer
--*/
-static inline UINT64
+static inline u64
GetRingBufferIndices(RING_BUFFER_INFO* RingInfo)
{
- return ((UINT64)RingInfo->RingBuffer->WriteIndex << 32) || RingInfo->RingBuffer->ReadIndex;
+ return ((u64)RingInfo->RingBuffer->WriteIndex << 32) || RingInfo->RingBuffer->ReadIndex;
}
u32 totalBytesToWrite=0;
volatile u32 nextWriteLocation;
- UINT64 prevIndices=0;
+ u64 prevIndices=0;
DPRINT_ENTER(VMBUS);
totalBytesToWrite += SgBuffers[i].Length;
}
- totalBytesToWrite += sizeof(UINT64);
+ totalBytesToWrite += sizeof(u64);
SpinlockAcquire(OutRingInfo->RingLock);
nextWriteLocation = CopyToRingBuffer(OutRingInfo,
nextWriteLocation,
&prevIndices,
- sizeof(UINT64));
+ sizeof(u64));
// Make sure we flush all writes before updating the writeIndex
MemoryFence();
u32 bytesAvailToWrite;
u32 bytesAvailToRead;
u32 nextReadLocation=0;
- UINT64 prevIndices=0;
+ u64 prevIndices=0;
ASSERT(BufferLen > 0);
nextReadLocation = CopyFromRingBuffer(InRingInfo,
&prevIndices,
- sizeof(UINT64),
+ sizeof(u64),
nextReadLocation);
// Make sure all reads are done before we update the read index since
HANDLE RequestLock;
LIST_ENTRY RequestList;
- UCHAR HwMacAddr[HW_MACADDR_LEN];
+ unsigned char HwMacAddr[HW_MACADDR_LEN];
} RNDIS_DEVICE;
// Each unique Port/Path/Target represents 1 channel ie scsi controller. In reality, the pathid, targetid is always 0
// and the port is set by us
ULONG PortNumber;
- UCHAR PathId;
- UCHAR TargetId;
+ unsigned char PathId;
+ unsigned char TargetId;
//LIST_ENTRY OutstandingRequestList;
//HANDLE OutstandingRequestLock;
storDriver->RequestExtSize = sizeof(STORVSC_REQUEST_EXTENSION);
// Divide the ring buffer data size (which is 1 page less than the ring buffer size since that page is reserved for the ring buffer indices)
- // by the max request size (which is VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER + VSTOR_PACKET + UINT64)
+ // by the max request size (which is VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER + VSTOR_PACKET + u64)
storDriver->MaxOutstandingRequestsPerChannel =
- ((storDriver->RingBufferSize - PAGE_SIZE) / ALIGN_UP(MAX_MULTIPAGE_BUFFER_PACKET + sizeof(VSTOR_PACKET) + sizeof(UINT64),sizeof(UINT64)));
+ ((storDriver->RingBufferSize - PAGE_SIZE) / ALIGN_UP(MAX_MULTIPAGE_BUFFER_PACKET + sizeof(VSTOR_PACKET) + sizeof(u64),sizeof(u64)));
DPRINT_INFO(STORVSC, "max io %u, currently %u\n", storDriver->MaxOutstandingRequestsPerChannel, STORVSC_MAX_IO_REQUESTS);
DEVICE_OBJECT *device = (DEVICE_OBJECT*)Context;
STORVSC_DEVICE *storDevice;
u32 bytesRecvd;
- UINT64 requestId;
- UCHAR packet[ALIGN_UP(sizeof(VSTOR_PACKET),8)];
+ u64 requestId;
+ unsigned char packet[ALIGN_UP(sizeof(VSTOR_PACKET),8)];
STORVSC_REQUEST_EXTENSION *request;
DPRINT_ENTER(STORVSC);
//
// User-specific data to be passed along to the server endpoint.
//
- UCHAR UserData[MAX_USER_DEFINED_BYTES];
+ unsigned char UserData[MAX_USER_DEFINED_BYTES];
} VMBUS_CHANNEL_OPEN_CHANNEL, *PVMBUS_CHANNEL_OPEN_CHANNEL;
VMBUS_CHANNEL_MESSAGE_HEADER Header;
u32 MessageNumber;
u32 Gpadl;
- UINT64 Pfn[0];
+ u64 Pfn[0];
} VMBUS_CHANNEL_GPADL_BODY, *PVMBUS_CHANNEL_GPADL_BODY;
{
VMBUS_CHANNEL_MESSAGE_HEADER Header;
PHYSICAL_ADDRESS ViewRangeBase;
- UINT64 ViewRangeLength;
+ u64 ViewRangeLength;
u32 ChildRelId;
} VMBUS_CHANNEL_VIEW_RANGE_ADD, *PVMBUS_CHANNEL_VIEW_RANGE_ADD;
VMBUS_CHANNEL_MESSAGE_HEADER Header;
u32 VMBusVersionRequested;
u32 Padding2;
- UINT64 InterruptPage;
- UINT64 MonitorPage1;
- UINT64 MonitorPage2;
+ u64 InterruptPage;
+ u64 MonitorPage1;
+ u64 MonitorPage2;
} VMBUS_CHANNEL_INITIATE_CONTACT, *PVMBUS_CHANNEL_INITIATE_CONTACT;
typedef struct _VMBUS_CHANNEL_VERSION_RESPONSE
//
// Time in the hypervisor is measured in 100 nanosecond units
//
-typedef UINT64 HV_NANO100_TIME, *PHV_NANO100_TIME;
-typedef UINT64 HV_NANO100_DURATION, *PHV_NANO100_DURATION;
+typedef u64 HV_NANO100_TIME, *PHV_NANO100_TIME;
+typedef u64 HV_NANO100_DURATION, *PHV_NANO100_DURATION;
u32 Reserved;
HV_MESSAGE_TYPE MessageType;
u32 PayloadSize;
- UINT64 Payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT];
+ u64 Payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT];
} HV_INPUT_POST_MESSAGE, *PHV_INPUT_POST_MESSAGE;
typedef union _HV_X64_MSR_GUEST_OS_ID_CONTENTS
{
- UINT64 AsUINT64;
+ u64 AsUINT64;
struct
{
- UINT64 BuildNumber : 16;
- UINT64 ServiceVersion : 8; // Service Pack, etc.
- UINT64 MinorVersion : 8;
- UINT64 MajorVersion : 8;
- UINT64 OsId : 8; // HV_GUEST_OS_MICROSOFT_IDS (If Vendor=MS)
- UINT64 VendorId : 16; // HV_GUEST_OS_VENDOR
+ u64 BuildNumber : 16;
+ u64 ServiceVersion : 8; // Service Pack, etc.
+ u64 MinorVersion : 8;
+ u64 MajorVersion : 8;
+ u64 OsId : 8; // HV_GUEST_OS_MICROSOFT_IDS (If Vendor=MS)
+ u64 VendorId : 16; // HV_GUEST_OS_VENDOR
};
} HV_X64_MSR_GUEST_OS_ID_CONTENTS, *PHV_X64_MSR_GUEST_OS_ID_CONTENTS;
typedef union _HV_X64_MSR_HYPERCALL_CONTENTS
{
- UINT64 AsUINT64;
+ u64 AsUINT64;
struct
{
- UINT64 Enable : 1;
- UINT64 Reserved : 11;
- UINT64 GuestPhysicalAddress : 52;
+ u64 Enable : 1;
+ u64 Reserved : 11;
+ u64 GuestPhysicalAddress : 52;
};
} HV_X64_MSR_HYPERCALL_CONTENTS, *PHV_X64_MSR_HYPERCALL_CONTENTS;
// Define partition identifier type.
//
-typedef UINT64 HV_PARTITION_ID, *PHV_PARTITION_ID;
+typedef u64 HV_PARTITION_ID, *PHV_PARTITION_ID;
//
// Define invalid partition identifier.
{
HV_SYNIC_SINT_INDEX TargetSint;
HV_VP_INDEX TargetVp;
- UINT64 RsvdZ;
+ u64 RsvdZ;
} MessagePortInfo;
struct
struct
{
HV_GPA MonitorAddress;
- UINT64 RsvdZ;
+ u64 RsvdZ;
} MonitorPortInfo;
};
} HV_PORT_INFO, *PHV_PORT_INFO;
{
struct
{
- UINT64 RsvdZ;
+ u64 RsvdZ;
} MessageConnectionInfo;
struct
{
- UINT64 RsvdZ;
+ u64 RsvdZ;
} EventConnectionInfo;
struct
HV_MESSAGE_HEADER Header;
union
{
- UINT64 Payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT];
+ u64 Payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT];
} u ;
} HV_MESSAGE, *PHV_MESSAGE;
//
typedef union _HV_SYNIC_SCONTROL
{
- UINT64 AsUINT64;
+ u64 AsUINT64;
struct
{
- UINT64 Enable:1;
- UINT64 Reserved:63;
+ u64 Enable:1;
+ u64 Reserved:63;
};
} HV_SYNIC_SCONTROL, *PHV_SYNIC_SCONTROL;
typedef union _HV_SYNIC_SINT
{
- UINT64 AsUINT64;
+ u64 AsUINT64;
struct
{
- UINT64 Vector :8;
- UINT64 Reserved1 :8;
- UINT64 Masked :1;
- UINT64 AutoEoi :1;
- UINT64 Reserved2 :46;
+ u64 Vector :8;
+ u64 Reserved1 :8;
+ u64 Masked :1;
+ u64 AutoEoi :1;
+ u64 Reserved2 :46;
};
} HV_SYNIC_SINT, *PHV_SYNIC_SINT;
typedef union _HV_SYNIC_SIMP
{
- UINT64 AsUINT64;
+ u64 AsUINT64;
struct
{
- UINT64 SimpEnabled : 1;
- UINT64 Preserved : 11;
- UINT64 BaseSimpGpa : 52;
+ u64 SimpEnabled : 1;
+ u64 Preserved : 11;
+ u64 BaseSimpGpa : 52;
};
} HV_SYNIC_SIMP, *PHV_SYNIC_SIMP;
typedef union _HV_SYNIC_SIEFP
{
- UINT64 AsUINT64;
+ u64 AsUINT64;
struct
{
- UINT64 SiefpEnabled : 1;
- UINT64 Preserved : 11;
- UINT64 BaseSiefpGpa : 52;
+ u64 SiefpEnabled : 1;
+ u64 Preserved : 11;
+ u64 BaseSiefpGpa : 52;
};
} HV_SYNIC_SIEFP, *PHV_SYNIC_SIEFP;
typedef union _HV_MONITOR_TRIGGER_GROUP
{
- UINT64 AsUINT64;
+ u64 AsUINT64;
struct
{
u32 RsvdZ1;
HV_MONITOR_TRIGGER_GROUP TriggerGroup[4];
- UINT64 RsvdZ2[3];
+ u64 RsvdZ2[3];
s32 NextCheckTime[4][32];
u16 Latency[4][32];
- UINT64 RsvdZ3[32];
+ u64 RsvdZ3[32];
HV_MONITOR_PARAMETER Parameter[4][32];
#pragma once
-typedef UINT64 HV_GPA, *PHV_GPA;
+typedef u64 HV_GPA, *PHV_GPA;
#define HV_X64_PAGE_SIZE (4096)
#define HV_PAGE_SIZE HV_X64_PAGE_SIZE
#ifndef CONTAINING_RECORD
#define CONTAINING_RECORD(address, type, field) ((type *)( \
- (PCHAR)(address) - \
- (PCHAR)(&((type *)0)->field)))
+ (char *)(address) - \
+ (char *)(&((type *)0)->field)))
#endif /* CONTAINING_RECORD */
#endif /* _LIST_H_ */
union {
struct{
- UINT64 ReceiveCompletionTid;
+ u64 ReceiveCompletionTid;
void * ReceiveCompletionContext;
PFN_ON_SENDRECVCOMPLETION OnReceiveCompletion;
} Recv;
struct{
- UINT64 SendCompletionTid;
+ u64 SendCompletionTid;
void * SendCompletionContext;
PFN_ON_SENDRECVCOMPLETION OnSendCompletion;
} Send;
typedef struct _NETVSC_DEVICE_INFO {
- UCHAR MacAddr[6];
+ unsigned char MacAddr[6];
BOOL LinkState; // 0 - link up, 1 - link down
} NETVSC_DEVICE_INFO;
u32 Status;
u32 BytesXfer;
- UCHAR* SenseBuffer;
+ unsigned char* SenseBuffer;
u32 SenseBufferSize;
void * Context;
typedef struct _STORVSC_DEVICE_INFO {
ULONG PortNumber;
- UCHAR PathId;
- UCHAR TargetId;
+ unsigned char PathId;
+ unsigned char TargetId;
} STORVSC_DEVICE_INFO;
//
typedef struct _PAGE_BUFFER {
u32 Length;
u32 Offset;
- UINT64 Pfn;
+ u64 Pfn;
} PAGE_BUFFER;
// Multiple-page buffer
// Length and Offset determines the # of pfns in the array
u32 Length;
u32 Offset;
- UINT64 PfnArray[MAX_MULTIPAGE_BUFFER_COUNT];
+ u64 PfnArray[MAX_MULTIPAGE_BUFFER_COUNT];
}MULTIPAGE_BUFFER;
//0x18 includes the proprietary packet header
PDEVICE_OBJECT Device,
const void * Buffer,
u32 BufferLen,
- UINT64 RequestId,
+ u64 RequestId,
u32 Type,
u32 Flags
);
u32 PageCount,
void * Buffer,
u32 BufferLen,
- UINT64 RequestId
+ u64 RequestId
);
typedef int (*VMBUS_CHANNEL_SEND_PACKET_MULTIPAGEBUFFER)(
MULTIPAGE_BUFFER *MultiPageBuffer,
void * Buffer,
u32 BufferLen,
- UINT64 RequestId
+ u64 RequestId
);
typedef int (*VMBUS_CHANNEL_RECV_PACKET)(
void * Buffer,
u32 BufferLen,
u32* BufferActualLen,
- UINT64* RequestId
+ u64* RequestId
);
typedef int (*VMBUS_CHANNEL_RECV_PACKET_PAW)(
void * Buffer,
u32 BufferLen,
u32* BufferActualLen,
- UINT64* RequestId
+ u64* RequestId
);
typedef int (*VMBUS_CHANNEL_ESTABLISH_GPADL)(
GUID InterfaceType;
GUID InterfaceInstance;
- UINT64 InterruptLatencyIn100nsUnits;
+ u64 InterruptLatencyIn100nsUnits;
u32 InterfaceRevision;
u32 ServerContextAreaSize; // in bytes
u16 ChannelFlags;
//
struct
{
- UCHAR UserDefined[MAX_USER_DEFINED_BYTES];
+ unsigned char UserDefined[MAX_USER_DEFINED_BYTES];
} Standard;
//
struct
{
u32 PipeMode;
- UCHAR UserDefined[MAX_PIPE_USER_DEFINED_BYTES];
+ unsigned char UserDefined[MAX_PIPE_USER_DEFINED_BYTES];
} Pipe;
} u;
u32 Padding;
u16 DataOffset8;
u16 Length8;
u16 Flags;
- UINT64 TransactionId;
+ u64 TransactionId;
} VMPACKET_DESCRIPTOR, *PVMPACKET_DESCRIPTOR;
typedef u32 PREVIOUS_PACKET_OFFSET, *PPREVIOUS_PACKET_OFFSET;
u32 ByteCount;
u32 ByteOffset;
- UINT64 PfnArray[0];
+ u64 PfnArray[0];
} GPA_RANGE, *PGPA_RANGE;
#endif
- UINT64 TotalBytes;
+ u64 TotalBytes;
u32 ByteOffset;
u32 ByteCount;
- UCHAR Data[1];
+ unsigned char Data[1];
} VMADDITIONAL_DATA, *PVMADDITIONAL_DATA;
} VMPACKET_LARGEST_POSSIBLE_HEADER, *PVMPACKET_LARGEST_POSSIBLE_HEADER;
#define VMPACKET_DATA_START_ADDRESS(__packet) \
- (void *)(((PUCHAR)__packet) + ((PVMPACKET_DESCRIPTOR)__packet)->DataOffset8 * 8)
+ (void *)(((unsigned char *)__packet) + ((PVMPACKET_DESCRIPTOR)__packet)->DataOffset8 * 8)
#define VMPACKET_DATA_LENGTH(__packet) \
((((PVMPACKET_DESCRIPTOR)__packet)->Length8 - ((PVMPACKET_DESCRIPTOR)__packet)->DataOffset8) * 8)
//
// unsigned types
//
-#ifdef __x86_64__
-typedef unsigned long UINT64;
-#else
-typedef unsigned long long UINT64;
-#endif
typedef unsigned long long ULONGLONG;
typedef unsigned int ULONG;
typedef unsigned short USHORT;
-typedef unsigned char UCHAR;
//
// signed types
//
-#ifdef __x86_64__
-typedef long INT64;
-#else
-typedef long long INT64;
-#endif
-
typedef int LONG;
-typedef char CHAR;
typedef long long LONGLONG;
//
typedef unsigned char BOOLEAN;
typedef void* HANDLE;
typedef u32 DWORD;
-typedef char* PCHAR;
typedef unsigned char BYTE;
typedef unsigned long ULONG_PTR;
__asm__ __volatile__("rdmsr" \
: "=a" (l), "=d" (h) \
: "c" (reg)); \
- v = (((UINT64)h) << 32) | l; \
+ v = (((u64)h) << 32) | l; \
}
#define WRMSR(reg, v) { \
u32 h, l; \
- l = (u32)(((UINT64)(v)) & 0xFFFFFFFF); \
- h = (u32)((((UINT64)(v)) >> 32) & 0xFFFFFFFF); \
+ l = (u32)(((u64)(v)) & 0xFFFFFFFF); \
+ h = (u32)((((u64)(v)) >> 32) & 0xFFFFFFFF); \
__asm__ __volatile__("wrmsr" \
: /* no outputs */ \
: "c" (reg), "a" (l), "d" (h)); \
#define WRMSR(reg, v) \
__asm__ __volatile__("wrmsr" \
: /* no outputs */ \
- : "c" (reg), "A" ((UINT64)v))
+ : "c" (reg), "A" ((u64)v))
#endif
// get pointer to info buffer with message pointer
#define MESSAGE_TO_INFO_BUFFER(Message) \
- (((PUCHAR)(Message)) + Message->InformationBufferOffset)
+ (((unsigned char *)(Message)) + Message->InformationBufferOffset)
// get pointer to status buffer with message pointer
#define MESSAGE_TO_STATUS_BUFFER(Message) \
- (((PUCHAR)(Message)) + Message->StatusBufferOffset)
+ (((unsigned char *)(Message)) + Message->StatusBufferOffset)
// get pointer to OOBD buffer with message pointer
#define MESSAGE_TO_OOBD_BUFFER(Message) \
- (((PUCHAR)(Message)) + Message->OOBDataOffset)
+ (((unsigned char *)(Message)) + Message->OOBDataOffset)
// get pointer to data buffer with message pointer
#define MESSAGE_TO_DATA_BUFFER(Message) \
- (((PUCHAR)(Message)) + Message->PerPacketInfoOffset)
+ (((unsigned char *)(Message)) + Message->PerPacketInfoOffset)
// get pointer to contained message from NDIS_MESSAGE pointer
#define RNDIS_MESSAGE_PTR_TO_MESSAGE_PTR(RndisMessage) \
#define MAX_TRANSFER_LENGTH 0x40000
#define DEFAULT_PACKET_SIZE (sizeof(VMDATA_GPA_DIRECT) + \
sizeof(VSTOR_PACKET) + \
- (sizeof(UINT64) * (MAX_TRANSFER_LENGTH / PAGE_SIZE)))
+ (sizeof(u64) * (MAX_TRANSFER_LENGTH / PAGE_SIZE)))
typedef struct
{
USHORT Length;
- UCHAR SrbStatus;
- UCHAR ScsiStatus;
+ unsigned char SrbStatus;
+ unsigned char ScsiStatus;
- UCHAR PortNumber;
- UCHAR PathId;
- UCHAR TargetId;
- UCHAR Lun;
+ unsigned char PortNumber;
+ unsigned char PathId;
+ unsigned char TargetId;
+ unsigned char Lun;
- UCHAR CdbLength;
- UCHAR SenseInfoLength;
- UCHAR DataIn;
- UCHAR Reserved;
+ unsigned char CdbLength;
+ unsigned char SenseInfoLength;
+ unsigned char DataIn;
+ unsigned char Reserved;
ULONG DataTransferLength;
union
{
- UCHAR Cdb[CDB16GENERIC_LENGTH];
+ unsigned char Cdb[CDB16GENERIC_LENGTH];
- UCHAR SenseData[SENSE_BUFFER_SIZE];
+ unsigned char SenseData[SENSE_BUFFER_SIZE];
- UCHAR ReservedArray[MAX_DATA_BUFFER_LENGTH_WITH_PADDING];
+ unsigned char ReservedArray[MAX_DATA_BUFFER_LENGTH_WITH_PADDING];
};
} VMSCSI_REQUEST, *PVMSCSI_REQUEST;
typedef struct
{
USHORT ProtocolVersion;
- UCHAR PathId;
- UCHAR TargetId;
+ unsigned char PathId;
+ unsigned char TargetId;
//
// Note: port number is only really known on the client side