]> git.proxmox.com Git - mirror_edk2.git/commitdiff
The PCI host bridge can signal failures in its initialization to
authorOlivier Martin <olivier.martin@arm.com>
Thu, 18 Jul 2013 07:21:35 +0000 (07:21 +0000)
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 18 Jul 2013 07:21:35 +0000 (07:21 +0000)
the PCI Bus driver through the function call NotifyPhase().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14483 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c
MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c

index bd1e6804661c9387994a3a406c9c16d349daa8da..ee6656de70ca243c0234bd77ffd97ade3bb62907 100644 (file)
@@ -82,7 +82,11 @@ PciEnumerator (
   //\r
   // Notify the pci bus enumeration is about to begin\r
   //\r
-  NotifyPhase (PciResAlloc, EfiPciHostBridgeBeginEnumeration);\r
+  Status = NotifyPhase (PciResAlloc, EfiPciHostBridgeBeginEnumeration);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
 \r
   //\r
   // Start the bus allocation phase\r
@@ -105,7 +109,11 @@ PciEnumerator (
   //\r
   // Notify the pci bus enumeration is about to complete\r
   //\r
-  NotifyPhase (PciResAlloc, EfiPciHostBridgeEndEnumeration);\r
+  Status = NotifyPhase (PciResAlloc, EfiPciHostBridgeEndEnumeration);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
 \r
   //\r
   // Process P2C\r
index 9e1184e00a28a2133f9e929d9203466c12abfc74..a5cea9e52a0d2b590569c7dc63cfd275f505c0c4 100644 (file)
@@ -759,7 +759,11 @@ PciHostBridgeResourceAllocator (
   //\r
   // Notify pci bus driver starts to program the resource\r
   //\r
-  NotifyPhase (PciResAlloc, EfiPciHostBridgeSetResources);\r
+  Status = NotifyPhase (PciResAlloc, EfiPciHostBridgeSetResources);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
 \r
   RootBridgeDev     = NULL;\r
 \r
@@ -898,9 +902,9 @@ PciHostBridgeResourceAllocator (
   //\r
   // Notify the resource allocation phase is to end\r
   //\r
-  NotifyPhase (PciResAlloc, EfiPciHostBridgeEndResourceAllocation);\r
+  Status = NotifyPhase (PciResAlloc, EfiPciHostBridgeEndResourceAllocation);\r
 \r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
 /**\r
@@ -1443,7 +1447,11 @@ PciHostBridgeEnumerator (
   //\r
   // Notify the bus allocation phase is about to start\r
   //\r
-  NotifyPhase (PciResAlloc, EfiPciHostBridgeBeginBusAllocation);\r
+  Status = NotifyPhase (PciResAlloc, EfiPciHostBridgeBeginBusAllocation);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
 \r
   DEBUG((EFI_D_INFO, "PCI Bus First Scanning\n"));\r
   RootBridgeHandle = NULL;\r
@@ -1531,7 +1539,11 @@ PciHostBridgeEnumerator (
     //\r
     // Notify the bus allocation phase is about to start for the 2nd time\r
     //\r
-    NotifyPhase (PciResAlloc, EfiPciHostBridgeBeginBusAllocation);\r
+    Status = NotifyPhase (PciResAlloc, EfiPciHostBridgeBeginBusAllocation);\r
+\r
+    if (EFI_ERROR (Status)) {\r
+      return Status;\r
+    }\r
 \r
     DEBUG((EFI_D_INFO, "PCI Bus Second Scanning\n"));\r
     RootBridgeHandle = NULL;\r
@@ -1569,7 +1581,11 @@ PciHostBridgeEnumerator (
   //\r
   // Notify the resource allocation phase is to start\r
   //\r
-  NotifyPhase (PciResAlloc, EfiPciHostBridgeBeginResourceAllocation);\r
+  Status = NotifyPhase (PciResAlloc, EfiPciHostBridgeBeginResourceAllocation);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
 \r
   RootBridgeHandle = NULL;\r
   while (PciResAlloc->GetNextRootBridge (PciResAlloc, &RootBridgeHandle) == EFI_SUCCESS) {\r