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 | |
parent | 778cedfb9fa24da690335a50307171afbd1607c6 (diff) | |
download | edk2-platforms-ffac4bcb25805baa981cf05d581b2e03d073e5a1.tar.xz |
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')
-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 | ||||
-rw-r--r-- | EdkModulePkg/EdkModulePkg.fpd | 160 | ||||
-rw-r--r-- | EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.c | 39 | ||||
-rw-r--r-- | EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.h | 16 | ||||
-rw-r--r-- | EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.msa | 3 | ||||
-rw-r--r-- | EdkModulePkg/Universal/DevicePath/Dxe/DevicePathFromText.c | 197 | ||||
-rw-r--r-- | EdkModulePkg/Universal/DevicePath/Dxe/DevicePathToText.c | 133 | ||||
-rw-r--r-- | EdkModulePkg/Universal/DevicePath/Dxe/DevicePathUtilities.c | 242 |
11 files changed, 330 insertions, 528 deletions
diff --git a/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c b/EdkModulePkg/Bus/Pci/Ehci/Dxe/Ehci.c index 86675534ab..4975c8c187 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 bb7060bba7..f22ce1a3e6 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 2f35f77848..0a992fe8ad 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 3dc1ff74af..b6864ad058 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,
diff --git a/EdkModulePkg/EdkModulePkg.fpd b/EdkModulePkg/EdkModulePkg.fpd index b1738f4fd8..2d3f2fcd0c 100644 --- a/EdkModulePkg/EdkModulePkg.fpd +++ b/EdkModulePkg/EdkModulePkg.fpd @@ -2374,6 +2374,74 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. <FfsFormatKey>BS_DRIVER</FfsFormatKey> </ModuleSaBuildOptions> </ModuleSA> + <ModuleSA SupArchList="IA32 X64 IPF" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674" ModuleGuid="9B680FCE-AD6B-4F3A-B60B-F59899003443"> + <Libraries> + <Instance ModuleGuid="ff5c7a2c-ab7a-4366-8616-11c6e53247b6" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="3a004ba5-efe0-4a61-9f1a-267a46ae5ba9" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="fd44e603-002a-4b29-9f5f-529e815b6165" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="331deb15-454b-48d8-9b74-70d01f3f3556" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="3ddc3b12-99ea-4364-b315-6310a2050be5" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="bda39d3a-451b-4350-8266-81ab10fa0523" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="27d67720-ea68-48ae-93da-a3a074c90e30" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="4674739d-3195-4fb2-8094-ac1d22d00194" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="a86fbfca-0183-4eeb-aa8a-762e3b7da1f3" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="91c1677a-e57f-4191-8b8e-eb7711a716e0" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + </Libraries> + <PcdBuildDefinition> + <PcdData ItemType="FIXED_AT_BUILD"> + <C_Name>PcdMaximumUnicodeStringLength</C_Name> + <Token>0x00000001</Token> + <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT32</DatumType> + <MaxDatumSize>4</MaxDatumSize> + <Value>1000000</Value> + </PcdData> + <PcdData ItemType="FIXED_AT_BUILD"> + <C_Name>PcdMaximumAsciiStringLength</C_Name> + <Token>0x00000002</Token> + <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT32</DatumType> + <MaxDatumSize>4</MaxDatumSize> + <Value>1000000</Value> + </PcdData> + <PcdData ItemType="FIXED_AT_BUILD"> + <C_Name>PcdDebugPropertyMask</C_Name> + <Token>0x00000005</Token> + <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT8</DatumType> + <MaxDatumSize>1</MaxDatumSize> + <Value>0x0f</Value> + </PcdData> + <PcdData ItemType="PATCHABLE_IN_MODULE"> + <C_Name>PcdDebugPrintErrorLevel</C_Name> + <Token>0x00000006</Token> + <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT32</DatumType> + <MaxDatumSize>4</MaxDatumSize> + <Value>0x80000000</Value> + </PcdData> + <PcdData ItemType="FIXED_AT_BUILD"> + <C_Name>PcdReportStatusCodePropertyMask</C_Name> + <Token>0x00000007</Token> + <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT8</DatumType> + <MaxDatumSize>1</MaxDatumSize> + <Value>0x07</Value> + </PcdData> + <PcdData ItemType="FIXED_AT_BUILD"> + <C_Name>PcdDebugClearMemoryValue</C_Name> + <Token>0x00000008</Token> + <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT8</DatumType> + <MaxDatumSize>1</MaxDatumSize> + <Value>0xAF</Value> + </PcdData> + </PcdBuildDefinition> + <ModuleSaBuildOptions> + <FvBinding>FV_RECOVERY</FvBinding> + <FfsFormatKey>BS_DRIVER</FfsFormatKey> + </ModuleSaBuildOptions> + </ModuleSA> <ModuleSA SupArchList="IA32" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674" ModuleGuid="96B5C032-DF4C-4b6e-8232-438DCF448D0E"> <Libraries> <Instance ModuleGuid="ff5c7a2c-ab7a-4366-8616-11c6e53247b6" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> @@ -3561,6 +3629,98 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. <FfsFormatKey>BS_DRIVER</FfsFormatKey> </ModuleSaBuildOptions> </ModuleSA> + <ModuleSA SupArchList="IA32 X64 IPF" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674" ModuleGuid="BDFE430E-8F2A-4db0-9991-6F856594777E"> + <Libraries> + <Instance ModuleGuid="ff5c7a2c-ab7a-4366-8616-11c6e53247b6" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="f1bbe03d-2f28-4dee-bec7-d98d7a30c36a" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="3a004ba5-efe0-4a61-9f1a-267a46ae5ba9" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="331deb15-454b-48d8-9b74-70d01f3f3556" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="52af22ae-9901-4484-8cdc-622dd5838b09" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="3ddc3b12-99ea-4364-b315-6310a2050be5" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="bda39d3a-451b-4350-8266-81ab10fa0523" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="50bcb105-6634-441d-b403-659110a03ad2" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/> + <Instance ModuleGuid="27d67720-ea68-48ae-93da-a3a074c90e30" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + <Instance ModuleGuid="4674739d-3195-4fb2-8094-ac1d22d00194" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> + </Libraries> + <PcdBuildDefinition> + <PcdData ItemType="FIXED_AT_BUILD"> + <C_Name>PcdMaximumUnicodeStringLength</C_Name> + <Token>0x00000001</Token> + <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT32</DatumType> + <MaxDatumSize>4</MaxDatumSize> + <Value>1000000</Value> + </PcdData> + <PcdData ItemType="FIXED_AT_BUILD"> + <C_Name>PcdMaximumAsciiStringLength</C_Name> + <Token>0x00000002</Token> + <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT32</DatumType> + <MaxDatumSize>4</MaxDatumSize> + <Value>1000000</Value> + </PcdData> + <PcdData ItemType="FIXED_AT_BUILD"> + <C_Name>PcdSpinLockTimeout</C_Name> + <Token>0x00000004</Token> + <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT32</DatumType> + <MaxDatumSize>4</MaxDatumSize> + <Value>10000000</Value> + </PcdData> + <PcdData ItemType="FIXED_AT_BUILD"> + <C_Name>PcdMaximumLinkedListLength</C_Name> + <Token>0x00000003</Token> + <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT32</DatumType> + <MaxDatumSize>4</MaxDatumSize> + <Value>1000000</Value> + </PcdData> + <PcdData ItemType="FIXED_AT_BUILD"> + <C_Name>PcdReportStatusCodePropertyMask</C_Name> + <Token>0x00000007</Token> + <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT8</DatumType> + <MaxDatumSize>1</MaxDatumSize> + <Value>0x07</Value> + </PcdData> + <PcdData ItemType="FIXED_AT_BUILD"> + <C_Name>PcdDebugPropertyMask</C_Name> + <Token>0x00000005</Token> + <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT8</DatumType> + <MaxDatumSize>1</MaxDatumSize> + <Value>0x0f</Value> + </PcdData> + <PcdData ItemType="PATCHABLE_IN_MODULE"> + <C_Name>PcdDebugPrintErrorLevel</C_Name> + <Token>0x00000006</Token> + <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT32</DatumType> + <MaxDatumSize>4</MaxDatumSize> + <Value>0x80000000</Value> + </PcdData> + <PcdData ItemType="FIXED_AT_BUILD"> + <C_Name>PcdDebugClearMemoryValue</C_Name> + <Token>0x00000008</Token> + <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT8</DatumType> + <MaxDatumSize>1</MaxDatumSize> + <Value>0xAF</Value> + </PcdData> + <PcdData ItemType="FIXED_AT_BUILD"> + <C_Name>PcdPerformanceLibraryPropertyMask</C_Name> + <Token>0x00000009</Token> + <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName> + <DatumType>UINT8</DatumType> + <MaxDatumSize>1</MaxDatumSize> + <Value>0</Value> + </PcdData> + </PcdBuildDefinition> + <ModuleSaBuildOptions> + <FvBinding>FV_MAIN</FvBinding> + <FfsFormatKey>BS_DRIVER</FfsFormatKey> + </ModuleSaBuildOptions> + </ModuleSA> <ModuleSA SupArchList="IA32" PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674" ModuleGuid="0167CCC4-D0F7-4f21-A3EF-9E64B7CDCE8B"> <Libraries> <Instance ModuleGuid="ff5c7a2c-ab7a-4366-8616-11c6e53247b6" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> diff --git a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.c b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.c index 79741a4615..78c5defe3a 100644 --- a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.c +++ b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.c @@ -20,8 +20,6 @@ Abstract: --*/ -#include <Uefi/UefiSpec.h> -#include <Protocol/DevicePath.h> #include "DevicePath.h" DEVICE_PATH_DRIVER_PRIVATE_DATA mPrivateData; @@ -29,27 +27,6 @@ DEVICE_PATH_DRIVER_PRIVATE_DATA mPrivateData; EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid = DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL; EFI_GUID mEfiDevicePathMessagingSASGuid = DEVICE_PATH_MESSAGING_SAS; -STATIC EFI_DEVICE_PATH_UTILITIES_PROTOCOL mDevicePathUtilitiesProtocol = { - GetDevicePathSize, - DuplicateDevicePath, - AppendDevicePath, - AppendDeviceNode, - AppendDevicePathInstance, - GetNextDevicePathInstance, - IsDevicePathMultiInstance, - CreateDeviceNode -}; - -STATIC EFI_DEVICE_PATH_TO_TEXT_PROTOCOL mDevicePathToTextProtocol = { - ConvertDeviceNodeToText, - ConvertDevicePathToText -}; - -STATIC EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL mDevicePathFromTextProtocol = { - ConvertTextToDeviceNode, - ConvertTextToDevicePath -}; - EFI_STATUS EFIAPI DevicePathEntryPoint ( @@ -75,14 +52,14 @@ DevicePathEntryPoint ( mPrivateData.Signature = DEVICE_PATH_DRIVER_SIGNATURE; - mPrivateData.DevicePathUtilities.GetDevicePathSize = GetDevicePathSize; - mPrivateData.DevicePathUtilities.DuplicateDevicePath = DuplicateDevicePath; - mPrivateData.DevicePathUtilities.AppendDevicePath = AppendDevicePath; - mPrivateData.DevicePathUtilities.AppendDeviceNode = AppendDeviceNode; - mPrivateData.DevicePathUtilities.AppendDevicePathInstance = AppendDevicePathInstance; - mPrivateData.DevicePathUtilities.GetNextDevicePathInstance = GetNextDevicePathInstance; - mPrivateData.DevicePathUtilities.IsDevicePathMultiInstance = IsDevicePathMultiInstance; - mPrivateData.DevicePathUtilities.CreateDeviceNode = CreateDeviceNode; + mPrivateData.DevicePathUtilities.GetDevicePathSize = GetDevicePathSizeProtocolInterface; + mPrivateData.DevicePathUtilities.DuplicateDevicePath = DuplicateDevicePathProtocolInterface; + mPrivateData.DevicePathUtilities.AppendDevicePath = AppendDevicePathProtocolInterface; + mPrivateData.DevicePathUtilities.AppendDeviceNode = AppendDeviceNodeProtocolInterface; + mPrivateData.DevicePathUtilities.AppendDevicePathInstance = AppendDevicePathInstanceProtocolInterface; + mPrivateData.DevicePathUtilities.GetNextDevicePathInstance = GetNextDevicePathInstanceProtocolInterface; + mPrivateData.DevicePathUtilities.IsDevicePathMultiInstance = IsDevicePathMultiInstanceProtocolInterface; + mPrivateData.DevicePathUtilities.CreateDeviceNode = CreateDeviceNodeProtocolInterface; mPrivateData.DevicePathToText.ConvertDeviceNodeToText = ConvertDeviceNodeToText; mPrivateData.DevicePathToText.ConvertDevicePathToText = ConvertDevicePathToText; diff --git a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.h b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.h index aa333453ea..8e9072417e 100644 --- a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.h +++ b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.h @@ -247,7 +247,7 @@ ConvertTextToDevicePath ( ;
UINTN
-GetDevicePathSize (
+GetDevicePathSizeProtocolInterface (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
/*++
@@ -265,7 +265,7 @@ GetDevicePathSize ( ;
EFI_DEVICE_PATH_PROTOCOL *
-DuplicateDevicePath (
+DuplicateDevicePathProtocolInterface (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
/*++
@@ -284,7 +284,7 @@ DuplicateDevicePath ( ;
EFI_DEVICE_PATH_PROTOCOL *
-AppendDevicePath (
+AppendDevicePathProtocolInterface (
IN CONST EFI_DEVICE_PATH_PROTOCOL *Src1,
IN CONST EFI_DEVICE_PATH_PROTOCOL *Src2
)
@@ -306,7 +306,7 @@ AppendDevicePath ( ;
EFI_DEVICE_PATH_PROTOCOL *
-AppendDeviceNode (
+AppendDeviceNodeProtocolInterface (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode
)
@@ -328,7 +328,7 @@ AppendDeviceNode ( ;
EFI_DEVICE_PATH_PROTOCOL *
-AppendDevicePathInstance (
+AppendDevicePathInstanceProtocolInterface (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance
)
@@ -349,7 +349,7 @@ AppendDevicePathInstance ( ;
EFI_DEVICE_PATH_PROTOCOL *
-GetNextDevicePathInstance (
+GetNextDevicePathInstanceProtocolInterface (
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathInstance,
OUT UINTN *DevicePathInstanceSize
)
@@ -374,7 +374,7 @@ GetNextDevicePathInstance ( ;
BOOLEAN
-IsDevicePathMultiInstance (
+IsDevicePathMultiInstanceProtocolInterface (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
/*++
@@ -393,7 +393,7 @@ IsDevicePathMultiInstance ( ;
EFI_DEVICE_PATH_PROTOCOL *
-CreateDeviceNode (
+CreateDeviceNodeProtocolInterface (
IN UINT8 NodeType,
IN UINT8 NodeSubType,
IN UINT16 NodeLength
diff --git a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.msa b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.msa index 20dd59848f..c5440ef530 100644 --- a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.msa +++ b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.msa @@ -56,6 +56,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.--> <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiBootServicesTableLib</Keyword>
</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>DevicePathLib</Keyword>
+ </LibraryClass>
</LibraryClassDefinitions>
<SourceFiles>
<Filename>DevicePath.c</Filename>
diff --git a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathFromText.c b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathFromText.c index e0864da6f0..d611b39f61 100644 --- a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathFromText.c +++ b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathFromText.c @@ -19,7 +19,6 @@ Abstract: --*/ -#include <protocol/DevicePathFromText.h> #include "DevicePath.h" CHAR16 * @@ -574,6 +573,7 @@ Returns: { UINTN Length; + *Data = 0; Length = sizeof (UINT64); HexStringToBuf ((UINT8 *) Data, &Length, TrimHexStr (Str), NULL); } @@ -618,7 +618,7 @@ Returns: Char = *(str++); while (Char) { if (Char >= '0' && Char <= '9') { - if (Rvalue > High || Rvalue == High && Char - '0' > (INTN) Low) { + if ((Rvalue > High || Rvalue == High) && (Char - '0' > (INTN) Low)) { return (UINTN) -1; } @@ -1298,7 +1298,7 @@ DevPathFromTextVenPcAnsi ( MESSAGING_DEVICE_PATH, MSG_VENDOR_DP, sizeof (VENDOR_DEVICE_PATH)); - Vendor->Guid = gEfiPcAnsiGuid; + CopyGuid (&Vendor->Guid, &gEfiPcAnsiGuid); return (EFI_DEVICE_PATH_PROTOCOL *) Vendor; } @@ -1314,7 +1314,7 @@ DevPathFromTextVenVt100 ( MESSAGING_DEVICE_PATH, MSG_VENDOR_DP, sizeof (VENDOR_DEVICE_PATH)); - Vendor->Guid = gEfiVT100Guid; + CopyGuid (&Vendor->Guid, &gEfiVT100Guid); return (EFI_DEVICE_PATH_PROTOCOL *) Vendor; } @@ -1330,7 +1330,7 @@ DevPathFromTextVenVt100Plus ( MESSAGING_DEVICE_PATH, MSG_VENDOR_DP, sizeof (VENDOR_DEVICE_PATH)); - Vendor->Guid = gEfiVT100PlusGuid; + CopyGuid (&Vendor->Guid, &gEfiVT100PlusGuid); return (EFI_DEVICE_PATH_PROTOCOL *) Vendor; } @@ -1346,7 +1346,7 @@ DevPathFromTextVenUtf8 ( MESSAGING_DEVICE_PATH, MSG_VENDOR_DP, sizeof (VENDOR_DEVICE_PATH)); - Vendor->Guid = gEfiVTUTF8Guid; + CopyGuid (&Vendor->Guid, &gEfiVTUTF8Guid); return (EFI_DEVICE_PATH_PROTOCOL *) Vendor; } @@ -1366,7 +1366,7 @@ DevPathFromTextUartFlowCtrl ( sizeof (UART_FLOW_CONTROL_DEVICE_PATH) ); - UartFlowControl->Guid = mEfiDevicePathMessagingUartFlowControlGuid; + CopyGuid (&UartFlowControl->Guid, &mEfiDevicePathMessagingUartFlowControlGuid); if (StrCmp (ValueStr, L"XonXoff") == 0) { UartFlowControl->FlowControlMap = 2; } else if (StrCmp (ValueStr, L"Hardware") == 0) { @@ -1409,7 +1409,7 @@ DevPathFromTextSAS ( sizeof (SAS_DEVICE_PATH) ); - Sas->Guid = mEfiDevicePathMessagingSASGuid; + CopyGuid (&Sas->Guid, &mEfiDevicePathMessagingSASGuid); Xtoi64 (AddressStr, &Sas->SasAddress); Xtoi64 (LunStr, &Sas->Lun); Sas->RelativeTargetPort = (UINT16) Xtoi (RTPStr); @@ -1455,7 +1455,7 @@ DevPathFromTextDebugPort ( sizeof (VENDOR_DEFINED_MESSAGING_DEVICE_PATH) ); - Vend->Guid = gEfiDebugPortProtocolGuid; + CopyGuid (&Vend->Guid, &gEfiDebugPortProtocolGuid); return (EFI_DEVICE_PATH_PROTOCOL *) Vend; } @@ -2166,8 +2166,8 @@ DevPathFromTextBBS ( Bbs->DeviceType = BBS_TYPE_UNKNOWN; } - AsciiStr = Bbs->String; - StrToAscii (IdStr, &AsciiStr); + AsciiStr = (UINT8 *) Bbs->String; + StrToAscii (IdStr, (CHAR8 **) &AsciiStr); Bbs->StatusFlag = (UINT16) Xtoi (FlagsStr); @@ -2175,120 +2175,63 @@ DevPathFromTextBBS ( } DEVICE_PATH_FROM_TEXT_TABLE DevPathFromTextTable[] = { - L"Pci", - DevPathFromTextPci, - L"PcCard", - DevPathFromTextPcCard, - L"MemoryMapped", - DevPathFromTextMemoryMapped, - L"VenHw", - DevPathFromTextVenHw, - L"Ctrl", - DevPathFromTextCtrl, - L"Acpi", - DevPathFromTextAcpi, - L"PciRoot", - DevPathFromTextPciRoot, - L"Floppy", - DevPathFromTextFloppy, - L"Keyboard", - DevPathFromTextKeyboard, - L"Serial", - DevPathFromTextSerial, - L"ParallelPort", - DevPathFromTextParallelPort, - L"AcpiEx", - DevPathFromTextAcpiEx, - L"AcpiExp", - DevPathFromTextAcpiExp, - L"Ata", - DevPathFromTextAta, - L"Scsi", - DevPathFromTextScsi, - L"Fibre", - DevPathFromTextFibre, - L"I1394", - DevPathFromText1394, - L"USB", - DevPathFromTextUsb, - L"I2O", - DevPathFromTextI2O, - L"Infiniband", - DevPathFromTextInfiniband, - L"VenMsg", - DevPathFromTextVenMsg, - L"VenPcAnsi", - DevPathFromTextVenPcAnsi, - L"VenVt100", - DevPathFromTextVenVt100, - L"VenVt100Plus", - DevPathFromTextVenVt100Plus, - L"VenUtf8", - DevPathFromTextVenUtf8, - L"UartFlowCtrl", - DevPathFromTextUartFlowCtrl, - L"SAS", - DevPathFromTextSAS, - L"DebugPort", - DevPathFromTextDebugPort, - L"MAC", - DevPathFromTextMAC, - L"IPv4", - DevPathFromTextIPv4, - L"IPv6", - DevPathFromTextIPv6, - L"Uart", - DevPathFromTextUart, - L"UsbClass", - DevPathFromTextUsbClass, - L"UsbAudio", - DevPathFromTextUsbAudio, - L"UsbCDCControl", - DevPathFromTextUsbCDCControl, - L"UsbHID", - DevPathFromTextUsbHID, - L"UsbImage", - DevPathFromTextUsbImage, - L"UsbPrinter", - DevPathFromTextUsbPrinter, - L"UsbMassStorage", - DevPathFromTextUsbMassStorage, - L"UsbHub", - DevPathFromTextUsbHub, - L"UsbCDCData", - DevPathFromTextUsbCDCData, - L"UsbSmartCard", - DevPathFromTextUsbSmartCard, - L"UsbVideo", - DevPathFromTextUsbVideo, - L"UsbDiagnostic", - DevPathFromTextUsbDiagnostic, - L"UsbWireless", - DevPathFromTextUsbWireless, - L"UsbDeviceFirmwareUpdate", - DevPathFromTextUsbDeviceFirmwareUpdate, - L"UsbIrdaBridge", - DevPathFromTextUsbIrdaBridge, - L"UsbTestAndMeasurement", - DevPathFromTextUsbTestAndMeasurement, - L"UsbWwid", - DevPathFromTextUsbWwid, - L"Unit", - DevPathFromTextUnit, - L"iSCSI", - DevPathFromTextiSCSI, - L"HD", - DevPathFromTextHD, - L"CDROM", - DevPathFromTextCDROM, - L"VenMEDIA", - DevPathFromTextVenMEDIA, - L"Media", - DevPathFromTextMedia, - L"BBS", - DevPathFromTextBBS, - NULL, - NULL + {L"Pci", DevPathFromTextPci}, + {L"PcCard", DevPathFromTextPcCard}, + {L"MemoryMapped", DevPathFromTextMemoryMapped}, + {L"VenHw", DevPathFromTextVenHw}, + {L"Ctrl", DevPathFromTextCtrl}, + {L"Acpi", DevPathFromTextAcpi}, + {L"PciRoot", DevPathFromTextPciRoot}, + {L"Floppy", DevPathFromTextFloppy}, + {L"Keyboard", DevPathFromTextKeyboard}, + {L"Serial", DevPathFromTextSerial}, + {L"ParallelPort", DevPathFromTextParallelPort}, + {L"AcpiEx", DevPathFromTextAcpiEx}, + {L"AcpiExp", DevPathFromTextAcpiExp}, + {L"Ata", DevPathFromTextAta}, + {L"Scsi", DevPathFromTextScsi}, + {L"Fibre", DevPathFromTextFibre}, + {L"I1394", DevPathFromText1394}, + {L"USB", DevPathFromTextUsb}, + {L"I2O", DevPathFromTextI2O}, + {L"Infiniband", DevPathFromTextInfiniband}, + {L"VenMsg", DevPathFromTextVenMsg}, + {L"VenPcAnsi", DevPathFromTextVenPcAnsi}, + {L"VenVt100", DevPathFromTextVenVt100}, + {L"VenVt100Plus", DevPathFromTextVenVt100Plus}, + {L"VenUtf8", DevPathFromTextVenUtf8}, + {L"UartFlowCtrl", DevPathFromTextUartFlowCtrl}, + {L"SAS", DevPathFromTextSAS}, + {L"DebugPort", DevPathFromTextDebugPort}, + {L"MAC", DevPathFromTextMAC}, + {L"IPv4", DevPathFromTextIPv4}, + {L"IPv6", DevPathFromTextIPv6}, + {L"Uart", DevPathFromTextUart}, + {L"UsbClass", DevPathFromTextUsbClass}, + {L"UsbAudio", DevPathFromTextUsbAudio}, + {L"UsbCDCControl", DevPathFromTextUsbCDCControl}, + {L"UsbHID", DevPathFromTextUsbHID}, + {L"UsbImage", DevPathFromTextUsbImage}, + {L"UsbPrinter", DevPathFromTextUsbPrinter}, + {L"UsbMassStorage", DevPathFromTextUsbMassStorage}, + {L"UsbHub", DevPathFromTextUsbHub}, + {L"UsbCDCData", DevPathFromTextUsbCDCData}, + {L"UsbSmartCard", DevPathFromTextUsbSmartCard}, + {L"UsbVideo", DevPathFromTextUsbVideo}, + {L"UsbDiagnostic", DevPathFromTextUsbDiagnostic}, + {L"UsbWireless", DevPathFromTextUsbWireless}, + {L"UsbDeviceFirmwareUpdate", DevPathFromTextUsbDeviceFirmwareUpdate}, + {L"UsbIrdaBridge", DevPathFromTextUsbIrdaBridge}, + {L"UsbTestAndMeasurement", DevPathFromTextUsbTestAndMeasurement}, + {L"UsbWwid", DevPathFromTextUsbWwid}, + {L"Unit", DevPathFromTextUnit}, + {L"iSCSI", DevPathFromTextiSCSI}, + {L"HD", DevPathFromTextHD}, + {L"CDROM", DevPathFromTextCDROM}, + {L"VenMEDIA", DevPathFromTextVenMEDIA}, + {L"Media", DevPathFromTextMedia}, + {L"BBS", DevPathFromTextBBS}, + {NULL, NULL} }; EFI_DEVICE_PATH_PROTOCOL * @@ -2413,7 +2356,7 @@ ConvertTextToDevicePath ( gBS->FreePool (ParamStr); } - NewDevicePath = AppendDeviceNode (DevicePath, DeviceNode); + NewDevicePath = AppendDeviceNodeProtocolInterface (DevicePath, DeviceNode); gBS->FreePool (DevicePath); gBS->FreePool (DeviceNode); DevicePath = NewDevicePath; @@ -2422,7 +2365,7 @@ ConvertTextToDevicePath ( DeviceNode = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (END_DEVICE_PATH_LENGTH); SetDevicePathInstanceEndNode (DeviceNode); - NewDevicePath = AppendDeviceNode (DevicePath, DeviceNode); + NewDevicePath = AppendDeviceNodeProtocolInterface (DevicePath, DeviceNode); gBS->FreePool (DevicePath); gBS->FreePool (DeviceNode); DevicePath = NewDevicePath; diff --git a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathToText.c b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathToText.c index 64fd5658fd..f38f2ea110 100644 --- a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathToText.c +++ b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathToText.c @@ -19,7 +19,6 @@ Abstract: --*/
-#include <protocol/DevicePathToText.h>
#include "DevicePath.h"
EFI_DEVICE_PATH_PROTOCOL *
@@ -372,7 +371,7 @@ DevPathToTextController ( CatPrint (
Str,
L"Ctrl(%x)",
- (UINT16 *)Controller->ControllerNumber
+ Controller->ControllerNumber
);
}
@@ -423,7 +422,7 @@ DevPathToTextAcpi ( }
}
-#define NextStrA(a) ((UINT8 *) (((UINT8 *) (a)) + AsciiStrLen (a) + 1))
+#define NextStrA(a) ((UINT8 *) (((UINT8 *) (a)) + AsciiStrLen ((CHAR8 *) (a)) + 1))
VOID
DevPathToTextExtAcpi (
@@ -1257,102 +1256,38 @@ DevPathToTextNodeUnknown ( }
DEVICE_PATH_TO_TEXT_TABLE DevPathToTextTable[] = {
- HARDWARE_DEVICE_PATH,
- HW_PCI_DP,
- DevPathToTextPci,
- HARDWARE_DEVICE_PATH,
- HW_PCCARD_DP,
- DevPathToTextPccard,
- HARDWARE_DEVICE_PATH,
- HW_MEMMAP_DP,
- DevPathToTextMemMap,
- HARDWARE_DEVICE_PATH,
- HW_VENDOR_DP,
- DevPathToTextVendor,
- HARDWARE_DEVICE_PATH,
- HW_CONTROLLER_DP,
- DevPathToTextController,
- ACPI_DEVICE_PATH,
- ACPI_DP,
- DevPathToTextAcpi,
- ACPI_DEVICE_PATH,
- ACPI_EXTENDED_DP,
- DevPathToTextExtAcpi,
- MESSAGING_DEVICE_PATH,
- MSG_ATAPI_DP,
- DevPathToTextAtapi,
- MESSAGING_DEVICE_PATH,
- MSG_SCSI_DP,
- DevPathToTextScsi,
- MESSAGING_DEVICE_PATH,
- MSG_FIBRECHANNEL_DP,
- DevPathToTextFibre,
- MESSAGING_DEVICE_PATH,
- MSG_1394_DP,
- DevPathToText1394,
- MESSAGING_DEVICE_PATH,
- MSG_USB_DP,
- DevPathToTextUsb,
- MESSAGING_DEVICE_PATH,
- MSG_USB_WWID_DP,
- DevPathToTextUsbWWID,
- MESSAGING_DEVICE_PATH,
- MSG_DEVICE_LOGICAL_UNIT_DP,
- DevPathToTextLogicalUnit,
- MESSAGING_DEVICE_PATH,
- MSG_USB_CLASS_DP,
- DevPathToTextUsbClass,
- MESSAGING_DEVICE_PATH,
- MSG_I2O_DP,
- DevPathToTextI2O,
- MESSAGING_DEVICE_PATH,
- MSG_MAC_ADDR_DP,
- DevPathToTextMacAddr,
- MESSAGING_DEVICE_PATH,
- MSG_IPv4_DP,
- DevPathToTextIPv4,
- MESSAGING_DEVICE_PATH,
- MSG_IPv6_DP,
- DevPathToTextIPv6,
- MESSAGING_DEVICE_PATH,
- MSG_INFINIBAND_DP,
- DevPathToTextInfiniBand,
- MESSAGING_DEVICE_PATH,
- MSG_UART_DP,
- DevPathToTextUart,
- MESSAGING_DEVICE_PATH,
- MSG_VENDOR_DP,
- DevPathToTextVendor,
- MESSAGING_DEVICE_PATH,
- MSG_ISCSI_DP,
- DevPathToTextiSCSI,
- MEDIA_DEVICE_PATH,
- MEDIA_HARDDRIVE_DP,
- DevPathToTextHardDrive,
- MEDIA_DEVICE_PATH,
- MEDIA_CDROM_DP,
- DevPathToTextCDROM,
- MEDIA_DEVICE_PATH,
- MEDIA_VENDOR_DP,
- DevPathToTextVendor,
- MEDIA_DEVICE_PATH,
- MEDIA_FILEPATH_DP,
- DevPathToTextFilePath,
- MEDIA_DEVICE_PATH,
- MEDIA_PROTOCOL_DP,
- DevPathToTextMediaProtocol,
- MEDIA_DEVICE_PATH,
- MEDIA_FILEPATH_DP,
- DevPathToTextFilePath,
- BBS_DEVICE_PATH,
- BBS_BBS_DP,
- DevPathToTextBBS,
- END_DEVICE_PATH_TYPE,
- END_INSTANCE_DEVICE_PATH_SUBTYPE,
- DevPathToTextEndInstance,
- 0,
- 0,
- NULL
+ {HARDWARE_DEVICE_PATH, HW_PCI_DP, DevPathToTextPci},
+ {HARDWARE_DEVICE_PATH, HW_PCCARD_DP, DevPathToTextPccard},
+ {HARDWARE_DEVICE_PATH, HW_MEMMAP_DP, DevPathToTextMemMap},
+ {HARDWARE_DEVICE_PATH, HW_VENDOR_DP, DevPathToTextVendor},
+ {HARDWARE_DEVICE_PATH, HW_CONTROLLER_DP, DevPathToTextController},
+ {ACPI_DEVICE_PATH, ACPI_DP, DevPathToTextAcpi},
+ {ACPI_DEVICE_PATH, ACPI_EXTENDED_DP, DevPathToTextExtAcpi},
+ {MESSAGING_DEVICE_PATH, MSG_ATAPI_DP, DevPathToTextAtapi},
+ {MESSAGING_DEVICE_PATH, MSG_SCSI_DP, DevPathToTextScsi},
+ {MESSAGING_DEVICE_PATH, MSG_FIBRECHANNEL_DP, DevPathToTextFibre},
+ {MESSAGING_DEVICE_PATH, MSG_1394_DP, DevPathToText1394},
+ {MESSAGING_DEVICE_PATH, MSG_USB_DP, DevPathToTextUsb},
+ {MESSAGING_DEVICE_PATH, MSG_USB_WWID_DP, DevPathToTextUsbWWID},
+ {MESSAGING_DEVICE_PATH, MSG_DEVICE_LOGICAL_UNIT_DP, DevPathToTextLogicalUnit},
+ {MESSAGING_DEVICE_PATH, MSG_USB_CLASS_DP, DevPathToTextUsbClass},
+ {MESSAGING_DEVICE_PATH, MSG_I2O_DP, DevPathToTextI2O},
+ {MESSAGING_DEVICE_PATH, MSG_MAC_ADDR_DP, DevPathToTextMacAddr},
+ {MESSAGING_DEVICE_PATH, MSG_IPv4_DP, DevPathToTextIPv4},
+ {MESSAGING_DEVICE_PATH, MSG_IPv6_DP, DevPathToTextIPv6},
+ {MESSAGING_DEVICE_PATH, MSG_INFINIBAND_DP, DevPathToTextInfiniBand},
+ {MESSAGING_DEVICE_PATH, MSG_UART_DP, DevPathToTextUart},
+ {MESSAGING_DEVICE_PATH, MSG_VENDOR_DP, DevPathToTextVendor},
+ {MESSAGING_DEVICE_PATH, MSG_ISCSI_DP, DevPathToTextiSCSI},
+ {MEDIA_DEVICE_PATH, MEDIA_HARDDRIVE_DP, DevPathToTextHardDrive},
+ {MEDIA_DEVICE_PATH, MEDIA_CDROM_DP, DevPathToTextCDROM},
+ {MEDIA_DEVICE_PATH, MEDIA_VENDOR_DP, DevPathToTextVendor},
+ {MEDIA_DEVICE_PATH, MEDIA_FILEPATH_DP, DevPathToTextFilePath},
+ {MEDIA_DEVICE_PATH, MEDIA_PROTOCOL_DP, DevPathToTextMediaProtocol},
+ {MEDIA_DEVICE_PATH, MEDIA_FILEPATH_DP, DevPathToTextFilePath},
+ {BBS_DEVICE_PATH, BBS_BBS_DP, DevPathToTextBBS},
+ {END_DEVICE_PATH_TYPE, END_INSTANCE_DEVICE_PATH_SUBTYPE, DevPathToTextEndInstance},
+ {0, 0, NULL}
};
CHAR16 *
diff --git a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathUtilities.c b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathUtilities.c index 2b54c76832..a702595225 100644 --- a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathUtilities.c +++ b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathUtilities.c @@ -19,12 +19,10 @@ Abstract: --*/ -#include <protocol/DevicePathUtilities.h> -#include <protocol/DevicePath.h> #include "DevicePath.h" UINTN -GetDevicePathSize ( +GetDevicePathSizeProtocolInterface ( IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath ) /*++ @@ -40,28 +38,11 @@ GetDevicePathSize ( --*/ { - CONST EFI_DEVICE_PATH_PROTOCOL *Start; - - if (DevicePath == NULL) { - return 0; - } - - // - // Search for the end of the device path structure - // - Start = (EFI_DEVICE_PATH_PROTOCOL *) DevicePath; - while (!IsDevicePathEnd (DevicePath)) { - DevicePath = NextDevicePathNode (DevicePath); - } - - // - // Compute the size and add back in the size of the end device path structure - // - return ((UINTN) DevicePath - (UINTN) Start) + sizeof (EFI_DEVICE_PATH_PROTOCOL); + return GetDevicePathSize (DevicePath); } EFI_DEVICE_PATH_PROTOCOL * -DuplicateDevicePath ( +DuplicateDevicePathProtocolInterface ( IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath ) /*++ @@ -78,31 +59,11 @@ DuplicateDevicePath ( --*/ { - EFI_DEVICE_PATH_PROTOCOL *NewDevicePath; - UINTN Size; - - if (DevicePath == NULL) { - return NULL; - } - - // - // Compute the size - // - Size = GetDevicePathSize (DevicePath); - if (Size == 0) { - return NULL; - } - - // - // Allocate space for duplicate device path - // - NewDevicePath = AllocateCopyPool (Size, (VOID *) DevicePath); - - return NewDevicePath; + return DuplicateDevicePath (DevicePath); } EFI_DEVICE_PATH_PROTOCOL * -AppendDevicePath ( +AppendDevicePathProtocolInterface ( IN CONST EFI_DEVICE_PATH_PROTOCOL *Src1, IN CONST EFI_DEVICE_PATH_PROTOCOL *Src2 ) @@ -122,48 +83,11 @@ AppendDevicePath ( --*/ { - UINTN Size; - UINTN Size1; - UINTN Size2; - EFI_DEVICE_PATH_PROTOCOL *NewDevicePath; - EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath; - - // - // If there's only 1 path, just duplicate it - // - if (Src1 == NULL) { - ASSERT (!IsDevicePathUnpacked (Src2)); - return DuplicateDevicePath (Src2); - } - - if (Src2 == NULL) { - ASSERT (!IsDevicePathUnpacked (Src1)); - return DuplicateDevicePath (Src1); - } - - // - // Allocate space for the combined device path. It only has one end node of - // length EFI_DEVICE_PATH_PROTOCOL - // - Size1 = GetDevicePathSize (Src1); - Size2 = GetDevicePathSize (Src2); - Size = Size1 + Size2 - sizeof (EFI_DEVICE_PATH_PROTOCOL); - - NewDevicePath = AllocateCopyPool (Size, (VOID *) Src1); - - if (NewDevicePath != NULL) { - // - // Over write Src1 EndNode and do the copy - // - SecondDevicePath = (EFI_DEVICE_PATH_PROTOCOL *) ((CHAR8 *) NewDevicePath + (Size1 - sizeof (EFI_DEVICE_PATH_PROTOCOL))); - CopyMem (SecondDevicePath, (VOID *) Src2, Size2); - } - - return NewDevicePath; + return AppendDevicePath (Src1, Src2); } EFI_DEVICE_PATH_PROTOCOL * -AppendDeviceNode ( +AppendDeviceNodeProtocolInterface ( IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode ) @@ -183,41 +107,11 @@ AppendDeviceNode ( --*/ { - EFI_DEVICE_PATH_PROTOCOL *Temp; - EFI_DEVICE_PATH_PROTOCOL *NextNode; - EFI_DEVICE_PATH_PROTOCOL *NewDevicePath; - UINTN NodeLength; - - if ((DevicePath == NULL) || (DeviceNode == NULL)) { - return NULL; - } - - // - // Build a Node that has a terminator on it - // - NodeLength = DevicePathNodeLength (DeviceNode); - - Temp = AllocateCopyPool (NodeLength + sizeof (EFI_DEVICE_PATH_PROTOCOL), (VOID *) DeviceNode); - if (Temp == NULL) { - return NULL; - } - - // - // Add and end device path node to convert Node to device path - // - NextNode = NextDevicePathNode (Temp); - SetDevicePathEndNode (NextNode); - - // - // Append device paths - // - NewDevicePath = AppendDevicePath (DevicePath, Temp); - gBS->FreePool (Temp); - return NewDevicePath; + return AppendDevicePathNode (DevicePath, DeviceNode); } EFI_DEVICE_PATH_PROTOCOL * -AppendDevicePathInstance ( +AppendDevicePathInstanceProtocolInterface ( IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance ) @@ -236,42 +130,11 @@ AppendDevicePathInstance ( --*/ { - UINT8 *Ptr; - EFI_DEVICE_PATH_PROTOCOL *DevPath; - UINTN SrcSize; - UINTN InstanceSize; - - if (DevicePathInstance == NULL) { - return NULL; - } - - if (DevicePath == NULL) { - return DuplicateDevicePath (DevicePathInstance); - } - - SrcSize = GetDevicePathSize (DevicePath); - InstanceSize = GetDevicePathSize (DevicePathInstance); - - Ptr = AllocateCopyPool (SrcSize + InstanceSize, (VOID *) DevicePath); - if (Ptr != NULL) { - - DevPath = (EFI_DEVICE_PATH_PROTOCOL *) (Ptr + (SrcSize - sizeof (EFI_DEVICE_PATH_PROTOCOL))); - // - // Convert the End to an End Instance, since we are - // appending another instacne after this one its a good - // idea. - // - DevPath->SubType = END_INSTANCE_DEVICE_PATH_SUBTYPE; - - DevPath = NextDevicePathNode (DevPath); - CopyMem (DevPath, (VOID *) DevicePathInstance, InstanceSize); - } - - return (EFI_DEVICE_PATH_PROTOCOL *) Ptr; + return AppendDevicePathInstance (DevicePath, DevicePathInstance); } EFI_DEVICE_PATH_PROTOCOL * -GetNextDevicePathInstance ( +GetNextDevicePathInstanceProtocolInterface ( IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathInstance, OUT UINTN *DevicePathInstanceSize ) @@ -294,56 +157,11 @@ GetNextDevicePathInstance ( --*/ { - EFI_DEVICE_PATH_PROTOCOL *DevPath; - EFI_DEVICE_PATH_PROTOCOL *ReturnValue; - UINT8 Temp; - - if (*DevicePathInstance == NULL) { - if (DevicePathInstanceSize != NULL) { - *DevicePathInstanceSize = 0; - } - - return NULL; - } - - // - // Find the end of the device path instance - // - DevPath = *DevicePathInstance; - while (!IsDevicePathEndType (DevPath)) { - DevPath = NextDevicePathNode (DevPath); - } - - // - // Compute the size of the device path instance - // - if (DevicePathInstanceSize != NULL) { - *DevicePathInstanceSize = ((UINTN) DevPath - (UINTN) (*DevicePathInstance)) + sizeof (EFI_DEVICE_PATH_PROTOCOL); - } - - // - // Make a copy and return the device path instance - // - Temp = DevPath->SubType; - DevPath->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE; - ReturnValue = DuplicateDevicePath (*DevicePathInstance); - DevPath->SubType = Temp; - - // - // If DevPath is the end of an entire device path, then another instance - // does not follow, so *DevicePath is set to NULL. - // - if (DevicePathSubType (DevPath) == END_ENTIRE_DEVICE_PATH_SUBTYPE) { - *DevicePathInstance = NULL; - } else { - *DevicePathInstance = NextDevicePathNode (DevPath); - } - - return ReturnValue; + return GetNextDevicePathInstance (DevicePathInstance, DevicePathInstanceSize); } BOOLEAN -IsDevicePathMultiInstance ( +IsDevicePathMultiInstanceProtocolInterface ( IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath ) /*++ @@ -360,26 +178,11 @@ IsDevicePathMultiInstance ( --*/ { - CONST EFI_DEVICE_PATH_PROTOCOL *Node; - - if (DevicePath == NULL) { - return FALSE; - } - - Node = DevicePath; - while (!IsDevicePathEnd (Node)) { - if (EfiIsDevicePathEndInstance (Node)) { - return TRUE; - } - - Node = NextDevicePathNode (Node); - } - - return FALSE; + return IsDevicePathMultiInstance (DevicePath); } EFI_DEVICE_PATH_PROTOCOL * -CreateDeviceNode ( +CreateDeviceNodeProtocolInterface ( IN UINT8 NodeType, IN UINT8 NodeSubType, IN UINT16 NodeLength @@ -404,18 +207,5 @@ CreateDeviceNode ( --*/ { - EFI_DEVICE_PATH_PROTOCOL *Node; - - if (NodeLength < sizeof (EFI_DEVICE_PATH_PROTOCOL)) { - return NULL; - } - - Node = (EFI_DEVICE_PATH_PROTOCOL *) AllocateZeroPool ((UINTN) NodeLength); - if (Node != NULL) { - Node->Type = NodeType; - Node->SubType = NodeSubType; - SetDevicePathNodeLength (Node, NodeLength); - } - - return Node; + return CreateDeviceNode (NodeType, NodeSubType, NodeLength); } |