[USBPORT][USBOHCI_NEW] Avoid using pointers for physical addresses.

This commit is contained in:
Vadim Galyant 2018-05-11 15:34:49 +02:00 committed by Thomas Faber
parent 837411e292
commit c89a190ea6
No known key found for this signature in database
GPG key ID: 076E7C3D44720826
6 changed files with 17 additions and 17 deletions

View file

@ -672,8 +672,8 @@ OHCI_StartController(IN PVOID ohciExtension,
return MPStatus;
}
OhciExtension->HcResourcesVA = Resources->StartVA;
OhciExtension->HcResourcesPA = Resources->StartPA;
OhciExtension->HcResourcesVA = (POHCI_HC_RESOURCES)Resources->StartVA;
OhciExtension->HcResourcesPA = (POHCI_HC_RESOURCES)Resources->StartPA;
DPRINT_OHCI("OHCI_StartController: HcResourcesVA - %p, HcResourcesPA - %p\n",
OhciExtension->HcResourcesVA,
@ -1731,9 +1731,9 @@ OHCI_AbortTransfer(IN PVOID ohciExtension,
ED = OhciEndpoint->HcdED;
NextTdPA = ED->HwED.HeadPointer & OHCI_ED_HEAD_POINTER_MASK;
NextTD = RegPacket.UsbPortGetMappedVirtualAddress((PVOID)NextTdPA,
OhciExtension,
OhciEndpoint);
NextTD = RegPacket.UsbPortGetMappedVirtualAddress(NextTdPA,
OhciExtension,
OhciEndpoint);
if (NextTD->OhciTransfer == (ULONG)OhciTransfer)
{
@ -1978,7 +1978,7 @@ OHCI_PollAsyncEndpoint(IN POHCI_EXTENSION OhciExtension,
DbgBreakPoint();
}
NextTD = RegPacket.UsbPortGetMappedVirtualAddress((PVOID)NextTdPA,
NextTD = RegPacket.UsbPortGetMappedVirtualAddress(NextTdPA,
OhciExtension,
OhciEndpoint);
DPRINT_OHCI("NextTD - %p\n", NextTD);

View file

@ -824,8 +824,8 @@ USBPORT_StartDevice(IN PDEVICE_OBJECT FdoDevice,
goto ExitWithError;
}
UsbPortResources->StartVA = (PVOID)HeaderBuffer->VirtualAddress;
UsbPortResources->StartPA = (PVOID)HeaderBuffer->PhysicalAddress;
UsbPortResources->StartVA = HeaderBuffer->VirtualAddress;
UsbPortResources->StartPA = HeaderBuffer->PhysicalAddress;
FdoExtension->MiniPortCommonBuffer = HeaderBuffer;
}

View file

@ -197,7 +197,7 @@ USBPORT_ResumeController(IN PDEVICE_OBJECT FdoDevice)
RtlZeroMemory(FdoExtension->MiniPortExt, Packet->MiniPortExtensionSize);
RtlZeroMemory(FdoExtension->UsbPortResources.StartVA,
RtlZeroMemory((PVOID)FdoExtension->UsbPortResources.StartVA,
Packet->MiniPortResourcesSize);
FdoExtension->UsbPortResources.IsChirpHandled = TRUE;

View file

@ -1696,7 +1696,7 @@ USBPORT_AllocateCommonBuffer(IN PDEVICE_OBJECT FdoDevice,
PHYSICAL_ADDRESS LogicalAddress;
ULONG_PTR BaseVA;
ULONG_PTR StartBufferVA;
ULONG_PTR StartBufferPA;
ULONG StartBufferPA;
DPRINT("USBPORT_AllocateCommonBuffer: FdoDevice - %p, BufferLength - %p\n",
FdoDevice,
@ -2108,7 +2108,7 @@ USBPORT_RequestAsyncCallback(IN PVOID MiniPortExtension,
PVOID
NTAPI
USBPORT_GetMappedVirtualAddress(IN PVOID PhysicalAddress,
USBPORT_GetMappedVirtualAddress(IN ULONG PhysicalAddress,
IN PVOID MiniPortExtension,
IN PVOID MiniPortEndpoint)
{
@ -2129,7 +2129,7 @@ USBPORT_GetMappedVirtualAddress(IN PVOID PhysicalAddress,
HeaderBuffer = Endpoint->HeaderBuffer;
Offset = (ULONG_PTR)PhysicalAddress - HeaderBuffer->PhysicalAddress;
Offset = PhysicalAddress - HeaderBuffer->PhysicalAddress;
VirtualAddress = HeaderBuffer->VirtualAddress + Offset;
return (PVOID)VirtualAddress;

View file

@ -148,7 +148,7 @@ typedef struct _USBPORT_COMMON_BUFFER_HEADER {
PHYSICAL_ADDRESS LogicalAddress;
SIZE_T BufferLength;
ULONG_PTR VirtualAddress;
ULONG_PTR PhysicalAddress;
ULONG PhysicalAddress;
} USBPORT_COMMON_BUFFER_HEADER, *PUSBPORT_COMMON_BUFFER_HEADER;
typedef struct _USBPORT_ENDPOINT *PUSBPORT_ENDPOINT;

View file

@ -54,8 +54,8 @@ typedef struct _USBPORT_RESOURCES {
ULONG Reserved;
PVOID ResourceBase;
SIZE_T IoSpaceLength;
PVOID StartVA;
PVOID StartPA;
ULONG_PTR StartVA;
ULONG StartPA;
UCHAR LegacySupport;
BOOLEAN IsChirpHandled;
UCHAR Reserved2;
@ -76,7 +76,7 @@ typedef struct _USBPORT_ENDPOINT_PROPERTIES {
ULONG TransferType;
ULONG Direction;
ULONG_PTR BufferVA;
ULONG_PTR BufferPA;
ULONG BufferPA;
ULONG BufferLength;
ULONG Reserved3;
ULONG MaxTransferSize;
@ -454,7 +454,7 @@ typedef ULONG
typedef PVOID
(NTAPI *PUSBPORT_GET_MAPPED_VIRTUAL_ADDRESS)(
PVOID,
ULONG,
PVOID,
PVOID);