Commit 59471438 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: hv: remove UINT64 and INT64 and UCHAR typedefs

The UINT64 and INT64 and UCHAR typedefs are now removed from the Hyper-V
driver code.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4d643114
......@@ -56,9 +56,9 @@ BlkVscInitialize(
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);
......
......@@ -335,7 +335,7 @@ static void DumpGpadlBody(
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++)
......@@ -416,12 +416,12 @@ VmbusChannelCreateGpadlHeader(
// 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);
......@@ -429,7 +429,7 @@ VmbusChannelCreateGpadlHeader(
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++)
......@@ -444,7 +444,7 @@ VmbusChannelCreateGpadlHeader(
// 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)
......@@ -458,7 +458,7 @@ VmbusChannelCreateGpadlHeader(
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;
......@@ -481,13 +481,13 @@ VmbusChannelCreateGpadlHeader(
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++)
......@@ -754,7 +754,7 @@ VmbusChannelSendPacket(
VMBUS_CHANNEL *Channel,
const void * Buffer,
u32 BufferLen,
UINT64 RequestId,
u64 RequestId,
VMBUS_PACKET_TYPE Type,
u32 Flags
)
......@@ -762,16 +762,16 @@ VmbusChannelSendPacket(
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;
......@@ -822,7 +822,7 @@ VmbusChannelSendPacketPageBuffer(
u32 PageCount,
void * Buffer,
u32 BufferLen,
UINT64 RequestId
u64 RequestId
)
{
int ret=0;
......@@ -832,7 +832,7 @@ VmbusChannelSendPacketPageBuffer(
u32 packetLen;
u32 packetLenAligned;
SG_BUFFER_LIST bufferList[3];
UINT64 alignedData=0;
u64 alignedData=0;
DPRINT_ENTER(VMBUS);
......@@ -843,9 +843,9 @@ VmbusChannelSendPacketPageBuffer(
// 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;
......@@ -904,7 +904,7 @@ VmbusChannelSendPacketMultiPageBuffer(
MULTIPAGE_BUFFER *MultiPageBuffer,
void * Buffer,
u32 BufferLen,
UINT64 RequestId
u64 RequestId
)
{
int ret=0;
......@@ -913,7 +913,7 @@ VmbusChannelSendPacketMultiPageBuffer(
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);
......@@ -926,11 +926,11 @@ VmbusChannelSendPacketMultiPageBuffer(
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;
......@@ -943,7 +943,7 @@ VmbusChannelSendPacketMultiPageBuffer(
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;
......@@ -987,7 +987,7 @@ VmbusChannelRecvPacket(
void * Buffer,
u32 BufferLen,
u32* BufferActualLen,
UINT64* RequestId
u64* RequestId
)
{
VMPACKET_DESCRIPTOR desc;
......@@ -1064,7 +1064,7 @@ VmbusChannelRecvPacketRaw(
void * Buffer,
u32 BufferLen,
u32* BufferActualLen,
UINT64* RequestId
u64* RequestId
)
{
VMPACKET_DESCRIPTOR desc;
......
......@@ -37,7 +37,7 @@ typedef struct _VMBUS_CHANNEL_PACKET_PAGE_BUFFER {
u16 DataOffset8;
u16 Length8;
u16 Flags;
UINT64 TransactionId;
u64 TransactionId;
u32 Reserved;
u32 RangeCount;
PAGE_BUFFER Range[MAX_PAGE_BUFFER_COUNT];
......@@ -50,7 +50,7 @@ typedef struct _VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER {
u16 DataOffset8;
u16 Length8;
u16 Flags;
UINT64 TransactionId;
u64 TransactionId;
u32 Reserved;
u32 RangeCount; // Always 1 in this case
MULTIPAGE_BUFFER Range;
......@@ -83,7 +83,7 @@ VmbusChannelSendPacket(
VMBUS_CHANNEL *Channel,
const void * Buffer,
u32 BufferLen,
UINT64 RequestId,
u64 RequestId,
VMBUS_PACKET_TYPE Type,
u32 Flags
);
......@@ -95,7 +95,7 @@ VmbusChannelSendPacketPageBuffer(
u32 PageCount,
void * Buffer,
u32 BufferLen,
UINT64 RequestId
u64 RequestId
);
static int
......@@ -104,7 +104,7 @@ VmbusChannelSendPacketMultiPageBuffer(
MULTIPAGE_BUFFER *MultiPageBuffer,
void * Buffer,
u32 BufferLen,
UINT64 RequestId
u64 RequestId
);
static int
......@@ -127,7 +127,7 @@ VmbusChannelRecvPacket(
void * Buffer,
u32 BufferLen,
u32* BufferActualLen,
UINT64* RequestId
u64* RequestId
);
static int
......@@ -136,7 +136,7 @@ VmbusChannelRecvPacketRaw(
void * Buffer,
u32 BufferLen,
u32* BufferActualLen,
UINT64* RequestId
u64* RequestId
);
static void
......
......@@ -58,7 +58,7 @@ IVmbusChannelSendPacket(
PDEVICE_OBJECT Device,
const void * Buffer,
u32 BufferLen,
UINT64 RequestId,
u64 RequestId,
u32 Type,
u32 Flags
)
......@@ -78,7 +78,7 @@ IVmbusChannelSendPacketPageBuffer(
u32 PageCount,
void * Buffer,
u32 BufferLen,
UINT64 RequestId
u64 RequestId
)
{
return VmbusChannelSendPacketPageBuffer((VMBUS_CHANNEL*)Device->context,
......@@ -95,7 +95,7 @@ IVmbusChannelSendPacketMultiPageBuffer(
MULTIPAGE_BUFFER *MultiPageBuffer,
void * Buffer,
u32 BufferLen,
UINT64 RequestId
u64 RequestId
)
{
return VmbusChannelSendPacketMultiPageBuffer((VMBUS_CHANNEL*)Device->context,
......@@ -111,7 +111,7 @@ IVmbusChannelRecvPacket (
void * Buffer,
u32 BufferLen,
u32* BufferActualLen,
UINT64* RequestId
u64* RequestId
)
{
return VmbusChannelRecvPacket((VMBUS_CHANNEL*)Device->context,
......@@ -127,7 +127,7 @@ IVmbusChannelRecvPacketRaw(
void * Buffer,
u32 BufferLen,
u32* BufferActualLen,
UINT64* RequestId
u64* RequestId
)
{
return VmbusChannelRecvPacketRaw((VMBUS_CHANNEL*)Device->context,
......
......@@ -158,17 +158,17 @@ HvQueryHypervisorInfo (
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>",
......@@ -192,10 +192,10 @@ HvDoHypercall (
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;
......@@ -208,9 +208,9 @@ HvDoHypercall (
__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
}
......@@ -401,7 +401,7 @@ HvPostMessage(
)
{
struct alignedInput {
UINT64 alignment8;
u64 alignment8;
HV_INPUT_POST_MESSAGE msg;
};
......@@ -474,12 +474,12 @@ HvSynicInit (
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);
......
......@@ -60,11 +60,11 @@ enum
#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
......@@ -73,7 +73,7 @@ enum
#define HV_CAPS_MAX 8
#define HV_HYPERCALL_PARAM_ALIGN sizeof(UINT64)
#define HV_HYPERCALL_PARAM_ALIGN sizeof(u64)
//
// Service definitions
......@@ -105,12 +105,12 @@ static const GUID VMBUS_SERVICE_ID = {.Data = {0xb8, 0x80, 0x81, 0x62, 0x8d, 0x3
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;
......@@ -138,7 +138,7 @@ static inline unsigned long long ReadMsr(int msr)
return val;
}
static inline void WriteMsr(int msr, UINT64 val)
static inline void WriteMsr(int msr, u64 val)
{
WRMSR(msr, val);
......
......@@ -114,7 +114,7 @@ NetVscOnReceiveCompletion(
static void
NetVscSendReceiveCompletion(
DEVICE_OBJECT *Device,
UINT64 TransactionId
u64 TransactionId
);
static inline NETVSC_DEVICE* AllocNetDevice(DEVICE_OBJECT *Device)
......@@ -1286,7 +1286,7 @@ NetVscOnReceive(
static void
NetVscSendReceiveCompletion(
DEVICE_OBJECT *Device,
UINT64 TransactionId
u64 TransactionId
)
{
NVSP_MESSAGE recvcompMessage;
......@@ -1343,7 +1343,7 @@ NetVscOnReceiveCompletion(
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);
......@@ -1403,10 +1403,10 @@ NetVscOnChannelCallback(
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;
......
......@@ -82,7 +82,7 @@ typedef struct _NETVSC_DEVICE {
NVSP_MESSAGE ChannelInitPacket;
NVSP_MESSAGE RevokePacket;
//UCHAR HwMacAddr[HW_MACADDR_LEN];
//unsigned char HwMacAddr[HW_MACADDR_LEN];
// Holds rndis device info
void *Extension;
......
......@@ -184,13 +184,13 @@ GetRingBufferSize(RING_BUFFER_INFO* RingInfo)
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;
}
......@@ -359,7 +359,7 @@ RingBufferWrite(
u32 totalBytesToWrite=0;
volatile u32 nextWriteLocation;
UINT64 prevIndices=0;
u64 prevIndices=0;
DPRINT_ENTER(VMBUS);
......@@ -368,7 +368,7 @@ RingBufferWrite(
totalBytesToWrite += SgBuffers[i].Length;
}
totalBytesToWrite += sizeof(UINT64);
totalBytesToWrite += sizeof(u64);
SpinlockAcquire(OutRingInfo->RingLock);
......@@ -408,7 +408,7 @@ RingBufferWrite(
nextWriteLocation = CopyToRingBuffer(OutRingInfo,
nextWriteLocation,
&prevIndices,
sizeof(UINT64));
sizeof(u64));
// Make sure we flush all writes before updating the writeIndex
MemoryFence();
......@@ -494,7 +494,7 @@ RingBufferRead(
u32 bytesAvailToWrite;
u32 bytesAvailToRead;
u32 nextReadLocation=0;
UINT64 prevIndices=0;
u64 prevIndices=0;
ASSERT(BufferLen > 0);
......@@ -525,7 +525,7 @@ RingBufferRead(
nextReadLocation = CopyFromRingBuffer(InRingInfo,
&prevIndices,
sizeof(UINT64),
sizeof(u64),
nextReadLocation);
// Make sure all reads are done before we update the read index since
......
......@@ -56,7 +56,7 @@ typedef struct _RNDIS_DEVICE {
HANDLE RequestLock;
LIST_ENTRY RequestList;
UCHAR HwMacAddr[HW_MACADDR_LEN];
unsigned char HwMacAddr[HW_MACADDR_LEN];
} RNDIS_DEVICE;
......
......@@ -63,8 +63,8 @@ typedef struct _STORVSC_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;
......@@ -279,9 +279,9 @@ StorVscInitialize(
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);
......@@ -909,8 +909,8 @@ StorVscOnChannelCallback(
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);
......
......@@ -148,7 +148,7 @@ typedef struct _VMBUS_CHANNEL_OPEN_CHANNEL
//
// 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;
......@@ -203,7 +203,7 @@ typedef struct _VMBUS_CHANNEL_GPADL_BODY
VMBUS_CHANNEL_MESSAGE_HEADER Header;
u32 MessageNumber;
u32 Gpadl;
UINT64 Pfn[0];
u64 Pfn[0];
} VMBUS_CHANNEL_GPADL_BODY, *PVMBUS_CHANNEL_GPADL_BODY;
......@@ -233,7 +233,7 @@ typedef struct _VMBUS_CHANNEL_VIEW_RANGE_ADD
{
VMBUS_CHANNEL_MESSAGE_HEADER Header;
PHYSICAL_ADDRESS ViewRangeBase;
UINT64 ViewRangeLength;
u64 ViewRangeLength;
u32 ChildRelId;
} VMBUS_CHANNEL_VIEW_RANGE_ADD, *PVMBUS_CHANNEL_VIEW_RANGE_ADD;
......@@ -256,9 +256,9 @@ typedef struct _VMBUS_CHANNEL_INITIATE_CONTACT
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
......
......@@ -28,5 +28,5 @@
//
// 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;
......@@ -44,7 +44,7 @@ typedef struct _HV_INPUT_POST_MESSAGE
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;
......
......@@ -57,15 +57,15 @@ typedef enum _HV_GUEST_OS_MICROSOFT_IDS
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;
......@@ -76,11 +76,11 @@ typedef union _HV_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;
......@@ -145,7 +145,7 @@ typedef u32 HV_SYNIC_SINT_INDEX, *PHV_SYNIC_SINT_INDEX;
// Define partition identifier type.
//
typedef UINT64 HV_PARTITION_ID, *PHV_PARTITION_ID;
typedef u64 HV_PARTITION_ID, *PHV_PARTITION_ID;
//
// Define invalid partition identifier.
......@@ -210,7 +210,7 @@ typedef struct _HV_PORT_INFO
{
HV_SYNIC_SINT_INDEX TargetSint;
HV_VP_INDEX TargetVp;
UINT64 RsvdZ;
u64 RsvdZ;
} MessagePortInfo;
struct
......@@ -225,7 +225,7 @@ typedef struct _HV_PORT_INFO
struct
{
HV_GPA MonitorAddress;
UINT64 RsvdZ;
u64 RsvdZ;
} MonitorPortInfo;
};
} HV_PORT_INFO, *PHV_PORT_INFO;
......@@ -241,12 +241,12 @@ typedef struct _HV_CONNECTION_INFO
{
struct
{
UINT64 RsvdZ;
u64 RsvdZ;
} MessageConnectionInfo;
struct
{
UINT64 RsvdZ;
u64 RsvdZ;
} EventConnectionInfo;
struct
......@@ -311,7 +311,7 @@ typedef struct _HV_MESSAGE
HV_MESSAGE_HEADER Header;
union
{
UINT64 Payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT];
u64 Payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT];
} u ;
} HV_MESSAGE, *PHV_MESSAGE;
......@@ -357,11 +357,11 @@ typedef struct _HV_SYNIC_EVENT_FLAGS_PAGE
//
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;
......@@ -371,14 +371,14 @@ typedef union _HV_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;
......@@ -388,12 +388,12 @@ typedef union _HV_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;
......@@ -403,12 +403,12 @@ typedef union _HV_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;
......@@ -418,7 +418,7 @@ typedef union _HV_SYNIC_SIEFP
typedef union _HV_MONITOR_TRIGGER_GROUP
{
UINT64 AsUINT64;
u64 AsUINT64;
struct
{
......@@ -474,12 +474,12 @@ typedef struct _HV_MONITOR_PAGE
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];
......
......@@ -24,7 +24,7 @@
#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
......
......@@ -260,8 +260,8 @@ typedef DLIST_ENTRY *PLIST_ENTRY;
#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_ */
......
......@@ -79,12 +79,12 @@ typedef struct _NETVSC_PACKET {
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;
......@@ -130,7 +130,7 @@ typedef struct _NETVSC_DRIVER_OBJECT {
typedef struct _NETVSC_DEVICE_INFO {
UCHAR MacAddr[6];
unsigned char MacAddr[6];
BOOL LinkState; // 0 - link up, 1 - link down
} NETVSC_DEVICE_INFO;
......
......@@ -80,7 +80,7 @@ typedef struct _STORVSC_REQUEST {
u32 Status;
u32 BytesXfer;
UCHAR* SenseBuffer;
unsigned char* SenseBuffer;
u32 SenseBufferSize;
void * Context;
......@@ -118,8 +118,8 @@ typedef struct _STORVSC_DRIVER_OBJECT {
typedef struct _STORVSC_DEVICE_INFO {
ULONG PortNumber;
UCHAR PathId;
UCHAR TargetId;
unsigned char PathId;
unsigned char TargetId;
} STORVSC_DEVICE_INFO;
//
......
......@@ -51,7 +51,7 @@ typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT;
typedef struct _PAGE_BUFFER {
u32 Length;
u32 Offset;
UINT64 Pfn;
u64 Pfn;
} PAGE_BUFFER;
// Multiple-page buffer
......@@ -59,7 +59,7 @@ typedef struct _MULTIPAGE_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
......@@ -108,7 +108,7 @@ typedef int (*VMBUS_CHANNEL_SEND_PACKET)(
PDEVICE_OBJECT Device,
const void * Buffer,
u32 BufferLen,
UINT64 RequestId,
u64 RequestId,
u32 Type,
u32 Flags
);
......@@ -119,7 +119,7 @@ typedef int (*VMBUS_CHANNEL_SEND_PACKET_PAGEBUFFER)(
u32 PageCount,
void * Buffer,
u32 BufferLen,
UINT64 RequestId
u64 RequestId
);
typedef int (*VMBUS_CHANNEL_SEND_PACKET_MULTIPAGEBUFFER)(
......@@ -127,7 +127,7 @@ typedef int (*VMBUS_CHANNEL_SEND_PACKET_MULTIPAGEBUFFER)(
MULTIPAGE_BUFFER *MultiPageBuffer,
void * Buffer,
u32 BufferLen,
UINT64 RequestId
u64 RequestId
);
typedef int (*VMBUS_CHANNEL_RECV_PACKET)(
......@@ -135,7 +135,7 @@ typedef int (*VMBUS_CHANNEL_RECV_PACKET)(
void * Buffer,
u32 BufferLen,
u32* BufferActualLen,
UINT64* RequestId
u64* RequestId
);
typedef int (*VMBUS_CHANNEL_RECV_PACKET_PAW)(
......@@ -143,7 +143,7 @@ typedef int (*VMBUS_CHANNEL_RECV_PACKET_PAW)(
void * Buffer,
u32 BufferLen,
u32* BufferActualLen,
UINT64* RequestId
u64* RequestId
);
typedef int (*VMBUS_CHANNEL_ESTABLISH_GPADL)(
......
......@@ -66,7 +66,7 @@ typedef struct
GUID InterfaceType;
GUID InterfaceInstance;
UINT64 InterruptLatencyIn100nsUnits;
u64 InterruptLatencyIn100nsUnits;
u32 InterfaceRevision;
u32 ServerContextAreaSize; // in bytes
u16 ChannelFlags;
......@@ -79,7 +79,7 @@ typedef struct
//
struct
{
UCHAR UserDefined[MAX_USER_DEFINED_BYTES];
unsigned char UserDefined[MAX_USER_DEFINED_BYTES];
} Standard;
//
......@@ -90,7 +90,7 @@ typedef struct
struct
{
u32 PipeMode;
UCHAR UserDefined[MAX_PIPE_USER_DEFINED_BYTES];
unsigned char UserDefined[MAX_PIPE_USER_DEFINED_BYTES];
} Pipe;
} u;
u32 Padding;
......
......@@ -83,7 +83,7 @@ typedef struct
u16 DataOffset8;
u16 Length8;
u16 Flags;
UINT64 TransactionId;
u64 TransactionId;
} VMPACKET_DESCRIPTOR, *PVMPACKET_DESCRIPTOR;
typedef u32 PREVIOUS_PACKET_OFFSET, *PPREVIOUS_PACKET_OFFSET;
......@@ -168,7 +168,7 @@ typedef struct _GPA_RANGE {
u32 ByteCount;
u32 ByteOffset;
UINT64 PfnArray[0];
u64 PfnArray[0];
} GPA_RANGE, *PGPA_RANGE;
......@@ -266,10 +266,10 @@ typedef struct _VMADDITIONAL_DATA {
#endif
UINT64 TotalBytes;
u64 TotalBytes;
u32 ByteOffset;
u32 ByteCount;
UCHAR Data[1];
unsigned char Data[1];
} VMADDITIONAL_DATA, *PVMADDITIONAL_DATA;
......@@ -287,7 +287,7 @@ typedef union {
} 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)
......
......@@ -97,28 +97,15 @@ typedef struct _DLIST_ENTRY {
//
// 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;
//
......@@ -130,7 +117,6 @@ typedef unsigned char BOOL;
typedef unsigned char BOOLEAN;
typedef void* HANDLE;
typedef u32 DWORD;
typedef char* PCHAR;
typedef unsigned char BYTE;
typedef unsigned long ULONG_PTR;
......@@ -150,13 +136,13 @@ typedef void (*PFN_TIMER_CALLBACK)(void* context);
__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)); \
......@@ -172,7 +158,7 @@ typedef void (*PFN_TIMER_CALLBACK)(void* context);
#define WRMSR(reg, v) \
__asm__ __volatile__("wrmsr" \
: /* no outputs */ \
: "c" (reg), "A" ((UINT64)v))
: "c" (reg), "A" ((u64)v))
#endif
......
......@@ -811,19 +811,19 @@ typedef __struct_bcount(MessageLength) struct _RNDIS_MESSAGE
// 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) \
......
......@@ -94,7 +94,7 @@
#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)))
......@@ -142,28 +142,28 @@ C_ASSERT(SENSE_BUFFER_SIZE == 0x12);
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;
......@@ -179,8 +179,8 @@ C_ASSERT((sizeof(VMSCSI_REQUEST) % 4) == 0);
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment