diff options
author | erictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-28 13:00:58 +0000 |
---|---|---|
committer | erictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-28 13:00:58 +0000 |
commit | 592b87a46de52d69471379cc619b264360f8613b (patch) | |
tree | 05eba856721790aa3af8834a7d555eb222222be4 /MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c | |
parent | 1ae301da81823ea3ab401e6b6da5ede8cb43100c (diff) | |
download | edk2-platforms-592b87a46de52d69471379cc619b264360f8613b.tar.xz |
update Ehci driver to distinct pci memory address and host address
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10121 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c')
-rw-r--r-- | MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c b/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c index 069ee5f575..5194d540a7 100644 --- a/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c +++ b/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c @@ -218,15 +218,15 @@ UsbHcAllocMemFromBlock ( NEXT_BIT (Byte, Bit);
}
- return Block->Buf + (StartByte * 8 + StartBit) * USBHC_MEM_UNIT;
+ return Block->BufHost + (StartByte * 8 + StartBit) * USBHC_MEM_UNIT;
}
/**
- Get the pci memory address according to the allocated host memory address.
+ Calculate the corresponding pci bus address according to the Mem parameter.
@param Pool The memory pool of the host controller.
- @param Mem The memory to free.
- @param Size The size of the memory to free.
+ @param Mem The pointer to host memory.
+ @param Size The size of the memory region.
@return the pci memory address
**/
@@ -251,7 +251,7 @@ UsbHcGetPciAddressForHostMem ( // scan the memory block list for the memory block that
// completely contains the allocated memory.
//
- if ((Block->Buf <= (UINT8 *) Mem) && (((UINT8 *) Mem + AllocSize) <= (Block->Buf + Block->BufLen))) {
+ if ((Block->BufHost <= (UINT8 *) Mem) && (((UINT8 *) Mem + AllocSize) <= (Block->BufHost + Block->BufLen))) {
break;
}
}
@@ -522,12 +522,12 @@ UsbHcFreeMem ( // scan the memory block list for the memory block that
// completely contains the memory to free.
//
- if ((Block->Buf <= ToFree) && ((ToFree + AllocSize) <= (Block->Buf + Block->BufLen))) {
+ if ((Block->BufHost <= ToFree) && ((ToFree + AllocSize) <= (Block->BufHost + Block->BufLen))) {
//
// compute the start byte and bit in the bit array
//
- Byte = ((ToFree - Block->Buf) / USBHC_MEM_UNIT) / 8;
- Bit = ((ToFree - Block->Buf) / USBHC_MEM_UNIT) % 8;
+ Byte = ((ToFree - Block->BufHost) / USBHC_MEM_UNIT) / 8;
+ Bit = ((ToFree - Block->BufHost) / USBHC_MEM_UNIT) % 8;
//
// reset associated bits in bit arry
|