diff options
author | jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-10-08 07:33:25 +0000 |
---|---|---|
committer | jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-10-08 07:33:25 +0000 |
commit | ec01afdbbf13c5f40a64f995a95e5ce26e0c1bc2 (patch) | |
tree | 800876cf0f35eb9e20acbd62d01f6ee0da611305 | |
parent | cdde6ddf5374c64f53f889df4c4c287007540cc4 (diff) | |
download | edk2-platforms-ec01afdbbf13c5f40a64f995a95e5ce26e0c1bc2.tar.xz |
OvmfPkg: QemuBootOrder: lower the required number of OFW nodes to 2
2 nodes in an OpenFirmware device path are sufficient for the generic
check at the beginning of TranslateOfwNodes(). The driver specific
branches check for the necessary nodes individually.
The number of nodes saved for examination is unchanged.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13800 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c b/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c index 8b462ec3dd..4a33396512 100644 --- a/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c +++ b/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c @@ -31,9 +31,10 @@ /**
- Number of nodes in OpenFirmware device paths that is required and examined.
+ Numbers of nodes in OpenFirmware device paths that are required and examined.
**/
-#define FIXED_OFW_NODES 4
+#define REQUIRED_OFW_NODES 2
+#define EXAMINED_OFW_NODES 4
/**
@@ -497,7 +498,7 @@ TranslateOfwNodes ( //
// Get PCI device and optional PCI function. Assume a single PCI root.
//
- if (NumNodes < FIXED_OFW_NODES ||
+ if (NumNodes < REQUIRED_OFW_NODES ||
!SubstringEq (OfwNode[0].DriverName, "pci")
) {
return RETURN_UNSUPPORTED;
@@ -513,7 +514,8 @@ TranslateOfwNodes ( return RETURN_UNSUPPORTED;
}
- if (SubstringEq (OfwNode[1].DriverName, "ide") &&
+ if (NumNodes >= 4 &&
+ SubstringEq (OfwNode[1].DriverName, "ide") &&
SubstringEq (OfwNode[2].DriverName, "drive") &&
SubstringEq (OfwNode[3].DriverName, "disk")
) {
@@ -562,7 +564,8 @@ TranslateOfwNodes ( Secondary ? "Secondary" : "Primary",
Slave ? "Slave" : "Master"
);
- } else if (SubstringEq (OfwNode[1].DriverName, "isa") &&
+ } else if (NumNodes >= 4 &&
+ SubstringEq (OfwNode[1].DriverName, "isa") &&
SubstringEq (OfwNode[2].DriverName, "fdc") &&
SubstringEq (OfwNode[3].DriverName, "floppy")
) {
@@ -676,7 +679,7 @@ TranslateOfwPath ( {
UINTN NumNodes;
RETURN_STATUS Status;
- OFW_NODE Node[FIXED_OFW_NODES];
+ OFW_NODE Node[EXAMINED_OFW_NODES];
BOOLEAN IsFinal;
OFW_NODE Skip;
@@ -692,7 +695,7 @@ TranslateOfwPath ( ++NumNodes;
Status = ParseOfwNode (
Ptr,
- (NumNodes < FIXED_OFW_NODES) ? &Node[NumNodes] : &Skip,
+ (NumNodes < EXAMINED_OFW_NODES) ? &Node[NumNodes] : &Skip,
&IsFinal
);
}
@@ -712,7 +715,7 @@ TranslateOfwPath ( Status = TranslateOfwNodes (
Node,
- NumNodes < FIXED_OFW_NODES ? NumNodes : FIXED_OFW_NODES,
+ NumNodes < EXAMINED_OFW_NODES ? NumNodes : EXAMINED_OFW_NODES,
Translated,
TranslatedSize);
switch (Status) {
|