diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-07-27 08:50:08 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-07-27 08:50:08 +0000 |
commit | ffac4bcb25805baa981cf05d581b2e03d073e5a1 (patch) | |
tree | 05dbe0773493e93ead2f9d81f14add18aeb2c29a /EdkModulePkg/Bus/Pci/Ehci | |
parent | 778cedfb9fa24da690335a50307171afbd1607c6 (diff) | |
download | edk2-ffac4bcb25805baa981cf05d581b2e03d073e5a1.zip edk2-ffac4bcb25805baa981cf05d581b2e03d073e5a1.tar.gz edk2-ffac4bcb25805baa981cf05d581b2e03d073e5a1.tar.bz2 |
Check in patch to refine DevicePath Module and USB2HostController Module.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1117 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Bus/Pci/Ehci')
-rw-r--r-- | EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c | 4 | ||||
-rw-r--r-- | EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.h | 24 | ||||
-rw-r--r-- | EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciMem.c | 4 | ||||
-rw-r--r-- | EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c | 36 |
4 files changed, 31 insertions, 37 deletions
diff --git a/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c b/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c index 8667553..4975c8c 100644 --- a/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c +++ b/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c @@ -479,7 +479,7 @@ EhciDriverBindingStart ( //
// Create AsyncRequest Polling Timer
//
- Status = CreatePollingTimer (HcDev, AsyncRequestMoniter);
+ Status = CreatePollingTimer (HcDev, (EFI_EVENT_NOTIFY) AsyncRequestMoniter);
if (EFI_ERROR (Status)) {
Status = EFI_OUT_OF_RESOURCES;
goto deinit_memory_management;
@@ -886,7 +886,7 @@ EhciReset ( //
Status = SetFrameListBaseAddr (
HcDev,
- (UINT32) GET_0B_TO_31B (HcDev->PeriodicFrameListBuffer)
+ GET_0B_TO_31B (HcDev->PeriodicFrameListBuffer)
);
if (EFI_ERROR (Status)) {
Status = EFI_DEVICE_ERROR;
diff --git a/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.h b/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.h index bb7060b..f22ce1a 100644 --- a/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.h +++ b/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.h @@ -192,11 +192,10 @@ extern EFI_COMPONENT_NAME_PROTOCOL gEhciComponentName; #define OUTPUT_PACKET_ID 0xE1
#define ERROR_PACKET_ID 0x55
-#define bit(a) 1 << (a)
-
-#define GET_0B_TO_31B(Addr) (((UINTN) Addr) & (0xffffffff))
-#define GET_32B_TO_63B(Addr) ((((UINTN) Addr) >> 32) & (0xffffffff))
+#define bit(a) 1 << (a)
+#define GET_0B_TO_31B(Addr) (UINT32) (UINTN) (Addr)
+#define GET_32B_TO_63B(Addr) (UINT32) (RShiftU64(((UINT64) (UINTN) (Addr)), 32) & 0xffffffff)
//
// Ehci Data and Ctrl Structures
@@ -326,7 +325,7 @@ typedef struct _EHCI_QTD_ENTITY EHCI_QTD_ENTITY; typedef struct _EHCI_QH_ENTITY EHCI_QH_ENTITY;
typedef struct _EHCI_ASYNC_REQUEST EHCI_ASYNC_REQUEST;
-typedef struct _EHCI_QTD_ENTITY {
+struct _EHCI_QTD_ENTITY {
EHCI_QTD_HW Qtd;
UINT32 TotalBytes;
UINT32 StaticTotalBytes;
@@ -335,9 +334,9 @@ typedef struct _EHCI_QTD_ENTITY { EHCI_QTD_ENTITY *Next;
EHCI_QTD_ENTITY *AltNext;
EHCI_QH_ENTITY *SelfQh;
-} EHCI_QTD_ENTITY;
+};
-typedef struct _EHCI_QH_ENTITY {
+struct _EHCI_QH_ENTITY {
EHCI_QH_HW Qh;
EHCI_QH_ENTITY *Next;
EHCI_QH_ENTITY *Prev;
@@ -346,7 +345,7 @@ typedef struct _EHCI_QH_ENTITY { EHCI_QTD_ENTITY *AltQtdPtr;
UINTN Interval;
UINT8 TransferType;
-} EHCI_QH_ENTITY;
+};
#define GET_QH_ENTITY_ADDR(a) ((EHCI_QH_ENTITY *) a)
#define GET_QTD_ENTITY_ADDR(a) ((EHCI_QTD_ENTITY *) a)
@@ -359,19 +358,14 @@ typedef struct _EHCI_QH_ENTITY { #define USB2_HC_DEV_SIGNATURE EFI_SIGNATURE_32 ('e', 'h', 'c', 'i')
-typedef struct _LIST_HEAD {
- struct _LIST_HEAD *pre;
- struct _LIST_HEAD *next;
-} LIST_HEAD;
-
-typedef struct _EHCI_ASYNC_REQUEST {
+struct _EHCI_ASYNC_REQUEST {
UINT8 TransferType;
EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunc;
VOID *Context;
EHCI_ASYNC_REQUEST *Prev;
EHCI_ASYNC_REQUEST *Next;
EHCI_QH_ENTITY *QhPtr;
-} EHCI_ASYNC_REQUEST;
+};
typedef struct _MEMORY_MANAGE_HEADER {
UINT8 *BitArrayPtr;
diff --git a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciMem.c b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciMem.c index 2f35f77..0a992fe 100644 --- a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciMem.c +++ b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciMem.c @@ -261,7 +261,7 @@ Returns: Status = AllocMemInMemoryBlock (
TempHeaderPtr,
- Pool,
+ (VOID **) Pool,
RealAllocSize / 32
);
if (!EFI_ERROR (Status)) {
@@ -302,7 +302,7 @@ Returns: Status = AllocMemInMemoryBlock (
NewMemoryHeader,
- Pool,
+ (VOID **) Pool,
RealAllocSize / 32
);
if (!EFI_ERROR (Status)) {
diff --git a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c index 3dc1ff7..b6864ad 100644 --- a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c +++ b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c @@ -1386,7 +1386,7 @@ Returns: Value = NULL;
if (!HwQtdPtr->AltNextQtdTerminate) {
- Value = (EHCI_QTD_HW *) GET_0B_TO_31B (HwQtdPtr->AltNextQtdPointer << 5);
+ Value = (EHCI_QTD_HW *) (UINTN) GET_0B_TO_31B (HwQtdPtr->AltNextQtdPointer << 5);
}
return Value;
@@ -1417,7 +1417,7 @@ Returns: Value = NULL;
if (!HwQtdPtr->NextQtdTerminate) {
- Value = (EHCI_QTD_HW *) GET_0B_TO_31B (HwQtdPtr->NextQtdPointer << 5);
+ Value = (EHCI_QTD_HW *) (UINTN) GET_0B_TO_31B (HwQtdPtr->NextQtdPointer << 5);
}
return Value;
@@ -1727,7 +1727,7 @@ Returns: //
// Not Null FrameList
//
- FindQhHwPtr = (EHCI_QH_HW *) GET_0B_TO_31B (FrameEntryPtr->LinkPointer << 5);
+ FindQhHwPtr = (EHCI_QH_HW *) (UINTN) GET_0B_TO_31B (FrameEntryPtr->LinkPointer << 5);
FindQhPtr = (EHCI_QH_ENTITY *) GET_QH_ENTITY_ADDR (FindQhHwPtr);
//
// FindQh is Left/Right to Qh
@@ -1742,12 +1742,12 @@ Returns: //
if (NULL != FindQhPtr->Next) {
FindQhPtr->Next->Prev = QhPtr;
- QhPtr->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (&(FindQhPtr->Next->Qh) >> 5);
+ QhPtr->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (((UINTN) &(FindQhPtr->Next->Qh)) >> 5);
QhPtr->Qh.SelectType = QH_SELECT_TYPE;
QhPtr->Qh.QhTerminate = FALSE;
}
- FindQhPtr->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Qh) >> 5);
+ FindQhPtr->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (((UINTN)&(QhPtr->Qh)) >> 5);
FindQhPtr->Qh.SelectType = QH_SELECT_TYPE;
FindQhPtr->Qh.QhTerminate = FALSE;
@@ -1762,7 +1762,7 @@ Returns: //
// Qh is the First one in Frame[0] List
//
- FrameEntryPtr->LinkPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Qh) >> 5);
+ FrameEntryPtr->LinkPointer = (UINT32) GET_0B_TO_31B (((UINTN) &(QhPtr->Qh)) >> 5);
FrameEntryPtr->SelectType = QH_SELECT_TYPE;
FrameEntryPtr->LinkTerminate = FALSE;
} else {
@@ -1770,12 +1770,12 @@ Returns: // Qh is not the First one in Frame[0] List
//
FindQhPtr->Prev->Next = QhPtr;
- FindQhPtr->Prev->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Qh) >> 5);
+ FindQhPtr->Prev->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (((UINTN) &(QhPtr->Qh)) >> 5);
FindQhPtr->Prev->Qh.SelectType = QH_SELECT_TYPE;
FindQhPtr->Prev->Qh.QhTerminate = FALSE;
}
- QhPtr->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (&(FindQhPtr->Qh) >> 5);
+ QhPtr->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (((UINTN) &(FindQhPtr->Qh)) >> 5);
QhPtr->Qh.SelectType = QH_SELECT_TYPE;
QhPtr->Qh.QhTerminate = FALSE;
@@ -1786,7 +1786,7 @@ Returns: //
// Link Qh after FindQh, Qh is the Last one
//
- FindQhPtr->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Qh) >> 5);
+ FindQhPtr->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (((UINTN) &(QhPtr->Qh)) >> 5);
FindQhPtr->Prev->Qh.SelectType = QH_SELECT_TYPE;
FindQhPtr->Qh.QhTerminate = FALSE;
@@ -1798,7 +1798,7 @@ Returns: //
// Null FrameList
//
- FrameEntryPtr->LinkPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Qh) >> 5);
+ FrameEntryPtr->LinkPointer = (UINT32) GET_0B_TO_31B (((UINTN) &(QhPtr->Qh)) >> 5);
FrameEntryPtr->SelectType = QH_SELECT_TYPE;
FrameEntryPtr->LinkTerminate = FALSE;
}
@@ -1812,7 +1812,7 @@ Returns: FrameIndex += QhPtr->Interval;
while (FrameIndex < HcDev->PeriodicFrameListLength) {
FrameEntryPtr = (FRAME_LIST_ENTRY *) (FrameEntryPtr + QhPtr->Interval);
- FrameEntryPtr->LinkPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Qh) >> 5);
+ FrameEntryPtr->LinkPointer = (UINT32) GET_0B_TO_31B (((UINTN) &(QhPtr->Qh)) >> 5);
FrameEntryPtr->SelectType = QH_SELECT_TYPE;
FrameEntryPtr->LinkTerminate = FALSE;
FrameIndex += QhPtr->Interval;
@@ -1825,7 +1825,7 @@ Returns: while (FrameIndex < HcDev->PeriodicFrameListLength) {
FrameEntryPtr = (FRAME_LIST_ENTRY *) (FrameEntryPtr + QhPtr->Interval);
if ((FrameIndex % QhPtr->Prev->Interval) != 0) {
- FrameEntryPtr->LinkPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Qh) >> 5);
+ FrameEntryPtr->LinkPointer = (UINT32) GET_0B_TO_31B (((UINTN) &(QhPtr->Qh)) >> 5);
FrameEntryPtr->SelectType = QH_SELECT_TYPE;
FrameEntryPtr->LinkTerminate = FALSE;
}
@@ -1843,7 +1843,7 @@ Returns: //
// Not Null FrameList
//
- FindQhHwPtr = (EHCI_QH_HW *) GET_0B_TO_31B (FrameEntryPtr->LinkPointer << 5);
+ FindQhHwPtr = (EHCI_QH_HW *) (UINTN) GET_0B_TO_31B (FrameEntryPtr->LinkPointer << 5);
FindQhPtr = (EHCI_QH_ENTITY *) GET_QH_ENTITY_ADDR (FindQhHwPtr);
//
// FindQh is Last Qh in the Asynchronous List, Link Qh after FindQh
@@ -1852,7 +1852,7 @@ Returns: FindQhPtr = FindQhPtr->Next;
}
- FindQhPtr->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Qh) >> 5);
+ FindQhPtr->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (((UINTN) &(QhPtr->Qh)) >> 5);
FindQhPtr->Qh.SelectType = QH_SELECT_TYPE;
FindQhPtr->Qh.QhTerminate = FALSE;
@@ -1862,7 +1862,7 @@ Returns: //
// Null FrameList
//
- FrameEntryPtr->LinkPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Qh) >> 5);
+ FrameEntryPtr->LinkPointer = (UINT32) GET_0B_TO_31B (((UINTN) &(QhPtr->Qh)) >> 5);
FrameEntryPtr->SelectType = QH_SELECT_TYPE;
FrameEntryPtr->LinkTerminate = FALSE;
}
@@ -1929,7 +1929,7 @@ Returns: }
} else {
while (FrameIndex < HcDev->PeriodicFrameListLength) {
- FrameEntryPtr->LinkPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Next->Qh) >> 5);
+ FrameEntryPtr->LinkPointer = (UINT32) GET_0B_TO_31B (((UINTN) &(QhPtr->Next->Qh)) >> 5);
FrameEntryPtr->SelectType = QH_SELECT_TYPE;
FrameEntryPtr->LinkTerminate = FALSE;
FrameEntryPtr += Interval;
@@ -1949,7 +1949,7 @@ Returns: QhPtr->Prev->Qh.SelectType = 0;
QhPtr->Prev->Qh.QhTerminate = TRUE;
} else {
- QhPtr->Prev->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Next->Qh) >> 5);
+ QhPtr->Prev->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (((UINTN) &(QhPtr->Next->Qh)) >> 5);
QhPtr->Prev->Qh.SelectType = QH_SELECT_TYPE;
QhPtr->Prev->Qh.QhTerminate = FALSE;
}
@@ -3026,7 +3026,7 @@ Returns: }
QtdHwPtr = &(AsyncRequestPtr->QhPtr->FirstQtdPtr->Qtd);
- ReceiveBuffer = (UINT8 *) GET_0B_TO_31B ((QtdHwPtr->BufferPointer0 << 12) | AsyncRequestPtr->QhPtr->FirstQtdPtr->StaticCurrentOffset);
+ ReceiveBuffer = (UINT8 *) (UINTN) GET_0B_TO_31B ((QtdHwPtr->BufferPointer0 << 12) | AsyncRequestPtr->QhPtr->FirstQtdPtr->StaticCurrentOffset);
CopyMem (
ProcessBuffer,
ReceiveBuffer,
|