Merge from amd64-branch:

34803 (sserapion)
Fix more warnings.
Convert pciidex to use spec file.

34864 (tkreuzer) // checkme vielleicht schon gemerged?
[NDIS]
fix some ULONG to pointer casts

34870 (tkreuzer)
[TCPIP]
- fix some pointer to ULONG casts

34874 (tkreuzer)
class2: fix ULONG to pointer cast

34877 (tkreuzer)
- fix LARGE_INTEGER to pointer cast

35781 (tkreuzer)
[NDIS]
define some fastcall functions to the normal functions on amd64

36011 (tkreuzer)
[NDIS]
Fix a ULONG to pointer cast.

36012 (tkreuzer)
[SCSIPORT]
more ulong <-> pointer fixes

svn path=/trunk/; revision=46422
This commit is contained in:
Timo Kreuzer 2010-03-25 03:24:44 +00:00
parent 7be6452a51
commit 2a334428fc
9 changed files with 39 additions and 28 deletions

View file

@ -200,7 +200,7 @@ i8042PowerWorkItem(
/* Register GUID_DEVICE_SYS_BUTTON interface and report capability */ /* Register GUID_DEVICE_SYS_BUTTON interface and report capability */
if (DeviceExtension->NewCaps != DeviceExtension->ReportedCaps) if (DeviceExtension->NewCaps != DeviceExtension->ReportedCaps)
{ {
WaitingIrp = InterlockedExchangePointer(&DeviceExtension->PowerIrp, NULL); WaitingIrp = InterlockedExchangePointer((PVOID)&DeviceExtension->PowerIrp, NULL);
if (WaitingIrp) if (WaitingIrp)
{ {
/* Cancel the current power irp, as capability changed */ /* Cancel the current power irp, as capability changed */
@ -255,7 +255,7 @@ i8042PowerWorkItem(
} }
/* Directly complete the IOCTL_GET_SYS_BUTTON_EVENT Irp (if any) */ /* Directly complete the IOCTL_GET_SYS_BUTTON_EVENT Irp (if any) */
WaitingIrp = InterlockedExchangePointer(&DeviceExtension->PowerIrp, NULL); WaitingIrp = InterlockedExchangePointer((PVOID)&DeviceExtension->PowerIrp, NULL);
if (WaitingIrp) if (WaitingIrp)
{ {
PULONG pEvent = (PULONG)WaitingIrp->AssociatedIrp.SystemBuffer; PULONG pEvent = (PULONG)WaitingIrp->AssociatedIrp.SystemBuffer;
@ -413,7 +413,7 @@ i8042KbdDeviceControl(
else else
{ {
WaitingIrp = InterlockedCompareExchangePointer( WaitingIrp = InterlockedCompareExchangePointer(
&DeviceExtension->PowerIrp, (PVOID)&DeviceExtension->PowerIrp,
Irp, Irp,
NULL); NULL);
/* Check if an Irp is already pending */ /* Check if an Irp is already pending */
@ -431,7 +431,7 @@ i8042KbdDeviceControl(
PowerKey = InterlockedExchange((PLONG)&DeviceExtension->LastPowerKey, 0); PowerKey = InterlockedExchange((PLONG)&DeviceExtension->LastPowerKey, 0);
if (PowerKey != 0) if (PowerKey != 0)
{ {
(VOID)InterlockedCompareExchangePointer(&DeviceExtension->PowerIrp, NULL, Irp); (VOID)InterlockedCompareExchangePointer((PVOID)&DeviceExtension->PowerIrp, NULL, Irp);
*(PULONG)Irp->AssociatedIrp.SystemBuffer = PowerKey; *(PULONG)Irp->AssociatedIrp.SystemBuffer = PowerKey;
Status = STATUS_SUCCESS; Status = STATUS_SUCCESS;
Irp->IoStatus.Status = Status; Irp->IoStatus.Status = Status;

View file

@ -59,6 +59,13 @@ NTAPI
ExGetCurrentProcessorCpuUsage( ExGetCurrentProcessorCpuUsage(
PULONG CpuUsage); PULONG CpuUsage);
/* portability fixes */
#ifdef _M_AMD64
#define KfReleaseSpinLock KeReleaseSpinLock
#define KefAcquireSpinLockAtDpcLevel KeAcquireSpinLockAtDpcLevel
#define KefReleaseSpinLockFromDpcLevel KeReleaseSpinLockFromDpcLevel
#endif
#endif /* __NDISSYS_H */ #endif /* __NDISSYS_H */
/* EOF */ /* EOF */

View file

@ -106,7 +106,7 @@ NdisImmediateReadPortUchar(
OUT PUCHAR Data) OUT PUCHAR Data)
{ {
NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
*Data = READ_PORT_UCHAR((PUCHAR)Port); // FIXME: What to do with WrapperConfigurationContext? *Data = READ_PORT_UCHAR(UlongToPtr(Port)); // FIXME: What to do with WrapperConfigurationContext?
} }
@ -121,7 +121,7 @@ NdisImmediateReadPortUlong(
OUT PULONG Data) OUT PULONG Data)
{ {
NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
*Data = READ_PORT_ULONG((PULONG)Port); // FIXME: What to do with WrapperConfigurationContext? *Data = READ_PORT_ULONG(UlongToPtr(Port)); // FIXME: What to do with WrapperConfigurationContext?
} }
@ -136,7 +136,7 @@ NdisImmediateReadPortUshort(
OUT PUSHORT Data) OUT PUSHORT Data)
{ {
NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
*Data = READ_PORT_USHORT((PUSHORT)Port); // FIXME: What to do with WrapperConfigurationContext? *Data = READ_PORT_USHORT(UlongToPtr(Port)); // FIXME: What to do with WrapperConfigurationContext?
} }
@ -151,7 +151,7 @@ NdisImmediateWritePortUchar(
IN UCHAR Data) IN UCHAR Data)
{ {
NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
WRITE_PORT_UCHAR((PUCHAR)Port, Data); // FIXME: What to do with WrapperConfigurationContext? WRITE_PORT_UCHAR(UlongToPtr(Port), Data); // FIXME: What to do with WrapperConfigurationContext?
} }
@ -166,7 +166,7 @@ NdisImmediateWritePortUlong(
IN ULONG Data) IN ULONG Data)
{ {
NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
WRITE_PORT_ULONG((PULONG)Port, Data); // FIXME: What to do with WrapperConfigurationContext? WRITE_PORT_ULONG(UlongToPtr(Port), Data); // FIXME: What to do with WrapperConfigurationContext?
} }
@ -181,7 +181,7 @@ NdisImmediateWritePortUshort(
IN USHORT Data) IN USHORT Data)
{ {
NDIS_DbgPrint(MAX_TRACE, ("Called.\n")); NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
WRITE_PORT_USHORT((PUSHORT)Port, Data); // FIXME: What to do with WrapperConfigurationContext? WRITE_PORT_USHORT(UlongToPtr(Port), Data); // FIXME: What to do with WrapperConfigurationContext?
} }
@ -880,7 +880,7 @@ NdisMRegisterIoPortRange(
if(AddressSpace) if(AddressSpace)
{ {
ASSERT(TranslatedAddress.u.HighPart == 0); ASSERT(TranslatedAddress.u.HighPart == 0);
*PortOffset = (PVOID) TranslatedAddress.u.LowPart; *PortOffset = (PVOID)(ULONG_PTR)TranslatedAddress.QuadPart;
NDIS_DbgPrint(MAX_TRACE, ("Returning 0x%x\n", *PortOffset)); NDIS_DbgPrint(MAX_TRACE, ("Returning 0x%x\n", *PortOffset));
return NDIS_STATUS_SUCCESS; return NDIS_STATUS_SUCCESS;
} }

View file

@ -688,7 +688,7 @@ NTSTATUS DispTdiQueryInformation(
AddressInfo = (PTDI_ADDRESS_INFO)MmGetSystemAddressForMdl(Irp->MdlAddress); AddressInfo = (PTDI_ADDRESS_INFO)MmGetSystemAddressForMdl(Irp->MdlAddress);
Address = (PTA_IP_ADDRESS)&AddressInfo->Address; Address = (PTA_IP_ADDRESS)&AddressInfo->Address;
switch ((ULONG)IrpSp->FileObject->FsContext2) { switch ((ULONG_PTR)IrpSp->FileObject->FsContext2) {
case TDI_TRANSPORT_ADDRESS_FILE: case TDI_TRANSPORT_ADDRESS_FILE:
AddrFile = (PADDRESS_FILE)TranContext->Handle.AddressHandle; AddrFile = (PADDRESS_FILE)TranContext->Handle.AddressHandle;
@ -732,7 +732,7 @@ NTSTATUS DispTdiQueryInformation(
AddressInfo = (PTDI_CONNECTION_INFORMATION) AddressInfo = (PTDI_CONNECTION_INFORMATION)
MmGetSystemAddressForMdl(Irp->MdlAddress); MmGetSystemAddressForMdl(Irp->MdlAddress);
switch ((ULONG)IrpSp->FileObject->FsContext2) { switch ((ULONG_PTR)IrpSp->FileObject->FsContext2) {
case TDI_TRANSPORT_ADDRESS_FILE: case TDI_TRANSPORT_ADDRESS_FILE:
AddrFile = (PADDRESS_FILE)TranContext->Handle.AddressHandle; AddrFile = (PADDRESS_FILE)TranContext->Handle.AddressHandle;
Endpoint = AddrFile ? AddrFile->Connection : NULL; Endpoint = AddrFile ? AddrFile->Connection : NULL;
@ -1039,12 +1039,16 @@ NTSTATUS DispTdiSendDatagram(
(*((PADDRESS_FILE)Request.Handle.AddressHandle)->Send))); (*((PADDRESS_FILE)Request.Handle.AddressHandle)->Send)));
if( (*((PADDRESS_FILE)Request.Handle.AddressHandle)->Send != NULL) ) if( (*((PADDRESS_FILE)Request.Handle.AddressHandle)->Send != NULL) )
{
ULONG DataUsed = 0;
Status = (*((PADDRESS_FILE)Request.Handle.AddressHandle)->Send)( Status = (*((PADDRESS_FILE)Request.Handle.AddressHandle)->Send)(
Request.Handle.AddressHandle, Request.Handle.AddressHandle,
DgramInfo->SendDatagramInformation, DgramInfo->SendDatagramInformation,
DataBuffer, DataBuffer,
BufferSize, BufferSize,
&Irp->IoStatus.Information); &DataUsed);
Irp->IoStatus.Information = DataUsed;
}
else { else {
Status = STATUS_UNSUCCESSFUL; Status = STATUS_UNSUCCESSFUL;
ASSERT(FALSE); ASSERT(FALSE);
@ -1310,7 +1314,7 @@ NTSTATUS DispTdiQueryInformationEx(
TranContext = (PTRANSPORT_CONTEXT)IrpSp->FileObject->FsContext; TranContext = (PTRANSPORT_CONTEXT)IrpSp->FileObject->FsContext;
switch ((ULONG)IrpSp->FileObject->FsContext2) { switch ((ULONG_PTR)IrpSp->FileObject->FsContext2) {
case TDI_TRANSPORT_ADDRESS_FILE: case TDI_TRANSPORT_ADDRESS_FILE:
Request.Handle.AddressHandle = TranContext->Handle.AddressHandle; Request.Handle.AddressHandle = TranContext->Handle.AddressHandle;
break; break;
@ -1485,7 +1489,7 @@ NTSTATUS DispTdiSetInformationEx(
TranContext = (PTRANSPORT_CONTEXT)IrpSp->FileObject->FsContext; TranContext = (PTRANSPORT_CONTEXT)IrpSp->FileObject->FsContext;
Info = (PTCP_REQUEST_SET_INFORMATION_EX)Irp->AssociatedIrp.SystemBuffer; Info = (PTCP_REQUEST_SET_INFORMATION_EX)Irp->AssociatedIrp.SystemBuffer;
switch ((ULONG)IrpSp->FileObject->FsContext2) { switch ((ULONG_PTR)IrpSp->FileObject->FsContext2) {
case TDI_TRANSPORT_ADDRESS_FILE: case TDI_TRANSPORT_ADDRESS_FILE:
Request.Handle.AddressHandle = TranContext->Handle.AddressHandle; Request.Handle.AddressHandle = TranContext->Handle.AddressHandle;
break; break;

View file

@ -532,7 +532,7 @@ SerenumDetectLegacyDevice(
/* Fill the read buffer */ /* Fill the read buffer */
TRACE_(SERENUM, "Fill the read buffer\n"); TRACE_(SERENUM, "Fill the read buffer\n");
Status = ReadBytes(LowerDevice, Buffer, sizeof(Buffer)/sizeof(Buffer[0]), &Count); Status = ReadBytes(LowerDevice, Buffer, sizeof(Buffer)/sizeof(Buffer[0]), (PVOID)&Count);
if (!NT_SUCCESS(Status)) goto ByeBye; if (!NT_SUCCESS(Status)) goto ByeBye;
RtlInitUnicodeString(&DeviceId, L"Serenum\\Mouse"); RtlInitUnicodeString(&DeviceId, L"Serenum\\Mouse");

View file

@ -1314,7 +1314,7 @@ Return Value:
// of original IRP. // of original IRP.
// //
nextIrpStack->Parameters.Others.Argument1 = (PVOID) irpCount; nextIrpStack->Parameters.Others.Argument1 = (PVOID)(ULONG_PTR) irpCount;
for (i = 0; i < irpCount; i++) { for (i = 0; i < irpCount; i++) {
@ -1502,7 +1502,7 @@ Return Value:
srb, srb,
irpStack->MajorFunction, irpStack->MajorFunction,
irpStack->MajorFunction == IRP_MJ_DEVICE_CONTROL ? irpStack->Parameters.DeviceIoControl.IoControlCode : 0, irpStack->MajorFunction == IRP_MJ_DEVICE_CONTROL ? irpStack->Parameters.DeviceIoControl.IoControlCode : 0,
MAXIMUM_RETRIES - ((ULONG)irpStack->Parameters.Others.Argument4), MAXIMUM_RETRIES - ((ULONG_PTR)irpStack->Parameters.Others.Argument4),
&status); &status);
// //
@ -1517,7 +1517,7 @@ Return Value:
retry = TRUE; retry = TRUE;
} }
if (retry && (irpStack->Parameters.Others.Argument4 = (PVOID)((ULONG)irpStack->Parameters.Others.Argument4-1))) { if (retry && (irpStack->Parameters.Others.Argument4 = (PVOID)((ULONG_PTR)irpStack->Parameters.Others.Argument4-1))) {
// //
// Retry request. // Retry request.
@ -1654,7 +1654,7 @@ Return Value:
srb, srb,
irpStack->MajorFunction, irpStack->MajorFunction,
irpStack->MajorFunction == IRP_MJ_DEVICE_CONTROL ? irpStack->Parameters.DeviceIoControl.IoControlCode : 0, irpStack->MajorFunction == IRP_MJ_DEVICE_CONTROL ? irpStack->Parameters.DeviceIoControl.IoControlCode : 0,
MAXIMUM_RETRIES - ((ULONG)irpStack->Parameters.Others.Argument4), MAXIMUM_RETRIES - ((ULONG_PTR)irpStack->Parameters.Others.Argument4),
&status); &status);
// //
@ -1669,7 +1669,7 @@ Return Value:
retry = TRUE; retry = TRUE;
} }
if (retry && (irpStack->Parameters.Others.Argument4 = (PVOID)((ULONG)irpStack->Parameters.Others.Argument4-1))) { if (retry && (irpStack->Parameters.Others.Argument4 = (PVOID)((ULONG_PTR)irpStack->Parameters.Others.Argument4-1))) {
// //
// Retry request. If the class driver has supplied a StartIo, // Retry request. If the class driver has supplied a StartIo,

View file

@ -520,7 +520,7 @@ static NTSTATUS NTAPI ConfigCallback(PVOID Context,
if(AddressSpace == 0) if(AddressSpace == 0)
gControllerInfo[gNumberOfControllers].BaseAddress = MmMapIoSpace(TranslatedAddress, FDC_PORT_BYTES, MmNonCached); gControllerInfo[gNumberOfControllers].BaseAddress = MmMapIoSpace(TranslatedAddress, FDC_PORT_BYTES, MmNonCached);
else else
gControllerInfo[gNumberOfControllers].BaseAddress = (PUCHAR)TranslatedAddress.u.LowPart; gControllerInfo[gNumberOfControllers].BaseAddress = (PUCHAR)(ULONG_PTR)TranslatedAddress.QuadPart;
} }
else if(PartialDescriptor->Type == CmResourceTypeDma) else if(PartialDescriptor->Type == CmResourceTypeDma)

View file

@ -2744,7 +2744,7 @@ Return Value:
{ {
PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension; PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension;
ULONG nativeModeAdapterTableIndex = (ULONG)Context; ULONG nativeModeAdapterTableIndex = (ULONG_PTR)Context;
ULONG channel; ULONG channel;
PUCHAR ioSpace; PUCHAR ioSpace;
BOOLEAN atapiOnly, BOOLEAN atapiOnly,
@ -6260,7 +6260,7 @@ Return Value:
newStatus = ScsiPortInitialize(DriverObject, newStatus = ScsiPortInitialize(DriverObject,
Argument2, Argument2,
&hwInitializationData, &hwInitializationData,
(PVOID) i); (PVOID)(ULONG_PTR)i);
if (newStatus < statusToReturn) if (newStatus < statusToReturn)
statusToReturn = newStatus; statusToReturn = newStatus;
} }

View file

@ -552,7 +552,7 @@ ScsiPortGetDeviceBase(IN PVOID HwDeviceExtension,
/* i/o space */ /* i/o space */
if (AddressSpace != 0) if (AddressSpace != 0)
return((PVOID)TranslatedAddress.u.LowPart); return((PVOID)(ULONG_PTR)TranslatedAddress.QuadPart);
MappedAddress = MmMapIoSpace(TranslatedAddress, MappedAddress = MmMapIoSpace(TranslatedAddress,
NumberOfBytes, NumberOfBytes,
@ -1223,8 +1223,8 @@ CreatePortConfig:
PortConfig->AccessRanges = (PVOID)(PortConfig+1); PortConfig->AccessRanges = (PVOID)(PortConfig+1);
/* Align to LONGLONG */ /* Align to LONGLONG */
PortConfig->AccessRanges = (PVOID)((ULONG)(PortConfig->AccessRanges) + 7); PortConfig->AccessRanges = (PVOID)((ULONG_PTR)(PortConfig->AccessRanges) + 7);
PortConfig->AccessRanges = (PVOID)((ULONG)(PortConfig->AccessRanges) & ~7); PortConfig->AccessRanges = (PVOID)((ULONG_PTR)(PortConfig->AccessRanges) & ~7);
/* Copy the data */ /* Copy the data */
RtlCopyMemory(PortConfig->AccessRanges, RtlCopyMemory(PortConfig->AccessRanges,