]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add missing status code in several modules.
authorli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 30 Oct 2012 04:19:03 +0000 (04:19 +0000)
committerli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 30 Oct 2012 04:19:03 +0000 (04:19 +0000)
Signed-off-by: Li Elvin <elvin.li@intel.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
Reviewed-by: Ni Ruiyu <ruiyu.ni@intel.com>
Reviewed-by: Gao Liming <liming.gao@intel.com>
Reviewed-by: Tian Feng <feng.tian@intel.com>
Reviewed-by: Fan Jeff <jeff.fan@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13889 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c
IntelFrameworkModulePkg/Bus/Isa/Ps2MouseAbsolutePointerDxe/Ps2MouseAbsolutePointer.c
IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.c
IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBootSupport.c
IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyPci.c
IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c

index 4f8799087684332445329ea18c19af28e516580f..c020202349c6cbddb5754a0410bf36cc6cfd6a4f 100644 (file)
@@ -3,7 +3,7 @@
   PS/2 Keyboard driver. Routines that interacts with callers,\r
   conforming to EFI driver model\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -348,6 +348,12 @@ KbdControllerDriverStart (
     goto ErrorExit;\r
   }\r
 \r
+  REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
+    EFI_PROGRESS_CODE,\r
+    EFI_PERIPHERAL_KEYBOARD | EFI_P_PC_DETECTED,\r
+    ParentDevicePath\r
+    );\r
+\r
   ConsoleIn->ControllerNameTable = NULL;\r
   AddUnicodeString2 (\r
     "eng",\r
index 664d7409b190a6d32003c467d06f2b3a20c764c0..7af35bcd11148552c9da45e9b0a4b3dbba0a2962 100644 (file)
@@ -2,7 +2,7 @@
   A faked PS/2 Absolute Pointer driver. Routines that interacts with callers,\r
   conforming to EFI driver model\r
   \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -268,6 +268,13 @@ PS2MouseAbsolutePointerDriverStart (
     StatusCode  = EFI_PERIPHERAL_MOUSE | EFI_P_EC_NOT_DETECTED;\r
     goto ErrorExit;\r
   }\r
+\r
+  REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
+    EFI_PROGRESS_CODE,\r
+    EFI_PERIPHERAL_MOUSE | EFI_P_PC_DETECTED,\r
+    ParentDevicePath\r
+    );\r
+\r
   //\r
   // Setup the WaitForKey event\r
   //\r
index 273bbd629342ac2ea19a9ddea08ad04cca6e39fd..16232018762bb429473e5519ac7a4c896cef6531 100644 (file)
@@ -2,7 +2,7 @@
   PS/2 Mouse driver. Routines that interacts with callers,\r
   conforming to EFI driver model.\r
   \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -278,6 +278,13 @@ PS2MouseDriverStart (
     StatusCode  = EFI_PERIPHERAL_MOUSE | EFI_P_EC_NOT_DETECTED;\r
     goto ErrorExit;\r
   }\r
+\r
+  REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
+    EFI_PROGRESS_CODE,\r
+    EFI_PERIPHERAL_MOUSE | EFI_P_PC_DETECTED,\r
+    ParentDevicePath\r
+    );\r
+\r
   //\r
   // Setup the WaitForKey event\r
   //\r
index 4e16880bd6360e8e67e2311ffce410d3b7495b7b..dfdac356cfb89039e77108d261e04bdc831a84d4 100644 (file)
@@ -1199,6 +1199,14 @@ GenericLegacyBoot (
   //\r
   EnableAllControllers (Private);\r
   if ((mBootMode == BOOT_LEGACY_OS) || (mBootMode == BOOT_UNCONVENTIONAL_DEVICE)) {\r
+    //\r
+    // Report Status Code to indicate legacy boot event will be signalled\r
+    //\r
+    REPORT_STATUS_CODE (\r
+      EFI_PROGRESS_CODE,\r
+      (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_LEGACY_BOOT_EVENT)\r
+      );\r
+\r
     //\r
     // Signal all the events that are waiting on EVT_SIGNAL_LEGACY_BOOT\r
     //\r
index 5e155f07050138a469bd3c99805ae5eb5da66982..e32ebacd9404ea4fb55cc28b732f549286e75fe1 100644 (file)
@@ -2304,6 +2304,13 @@ LegacyBiosInstallRom (
         \r
     if (EFI_ERROR (Status)) {\r
       DEBUG ((EFI_D_ERROR, "return LegacyBiosInstallRom(%d): EFI_OUT_OF_RESOURCES (no more space for OpROM)\n", __LINE__));\r
+      //\r
+      // Report Status Code to indicate that there is no enough space for OpROM\r
+      //\r
+      REPORT_STATUS_CODE (\r
+        EFI_ERROR_CODE | EFI_ERROR_MINOR,\r
+        (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_EC_LEGACY_OPROM_NO_SPACE)\r
+        );\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
     InitAddress = (UINTN) PhysicalAddress;\r
@@ -2314,6 +2321,13 @@ LegacyBiosInstallRom (
     if (RuntimeAddress + *RuntimeImageLength > PcdGet32 (PcdEndOpromShadowAddress)) {\r
       DEBUG ((EFI_D_ERROR, "return LegacyBiosInstallRom(%d): EFI_OUT_OF_RESOURCES (no more space for OpROM)\n", __LINE__));\r
       gBS->FreePages (PhysicalAddress, EFI_SIZE_TO_PAGES (ImageSize));\r
+      //\r
+      // Report Status Code to indicate that there is no enough space for OpROM\r
+      //\r
+      REPORT_STATUS_CODE (\r
+        EFI_ERROR_CODE | EFI_ERROR_MINOR,\r
+        (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_EC_LEGACY_OPROM_NO_SPACE)\r
+        );\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
   } else {\r
@@ -2324,6 +2338,13 @@ LegacyBiosInstallRom (
     InitAddress    = PCI_START_ADDRESS (Private->OptionRom);\r
     if (InitAddress + ImageSize > PcdGet32 (PcdEndOpromShadowAddress)) {\r
       DEBUG ((EFI_D_ERROR, "return LegacyBiosInstallRom(%d): EFI_OUT_OF_RESOURCES (no more space for OpROM)\n", __LINE__));\r
+      //\r
+      // Report Status Code to indicate that there is no enough space for OpROM\r
+      //\r
+      REPORT_STATUS_CODE (\r
+        EFI_ERROR_CODE | EFI_ERROR_MINOR,\r
+        (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_EC_LEGACY_OPROM_NO_SPACE)\r
+        );\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
 \r
index 4b4333bd88bd14574cc97d9c99700da26fcefeef..c04c586f50d7ad2bc8e16e832754b3f6642373ba 100644 (file)
@@ -2278,6 +2278,11 @@ BdsLibBootViaBootOption (
           );\r
   }\r
 \r
+  //\r
+  // Report Status Code to indicate ReadyToBoot event will be signalled\r
+  //\r
+  REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT));\r
+\r
   //\r
   // Signal the EVT_SIGNAL_READY_TO_BOOT event\r
   //\r
@@ -2368,47 +2373,40 @@ BdsLibBootViaBootOption (
       // and get the bootable media handle\r
       //\r
       Handle = BdsLibGetBootableHandle(DevicePath);\r
-      if (Handle == NULL) {\r
-        goto Done;\r
-      }\r
-      //\r
-      // Load the default boot file \EFI\BOOT\boot{machinename}.EFI from removable Media\r
-      //  machinename is ia32, ia64, x64, ...\r
-      //\r
-      FilePath = FileDevicePath (Handle, EFI_REMOVABLE_MEDIA_FILE_NAME);\r
-      if (FilePath != NULL) {\r
-        REPORT_STATUS_CODE (EFI_PROGRESS_CODE, PcdGet32 (PcdProgressCodeOsLoaderLoad));\r
-        Status = gBS->LoadImage (\r
-                        TRUE,\r
-                        gImageHandle,\r
-                        FilePath,\r
-                        NULL,\r
-                        0,\r
-                        &ImageHandle\r
-                        );\r
-       if (EFI_ERROR (Status)) {\r
-          //\r
-          // The DevicePath failed, and it's not a valid\r
-          // removable media device.\r
-          //\r
-          goto Done;\r
+      if (Handle != NULL) {\r
+        //\r
+        // Load the default boot file \EFI\BOOT\boot{machinename}.EFI from removable Media\r
+        //  machinename is ia32, ia64, x64, ...\r
+        //\r
+        FilePath = FileDevicePath (Handle, EFI_REMOVABLE_MEDIA_FILE_NAME);\r
+        if (FilePath != NULL) {\r
+          REPORT_STATUS_CODE (EFI_PROGRESS_CODE, PcdGet32 (PcdProgressCodeOsLoaderLoad));\r
+          Status = gBS->LoadImage (\r
+                          TRUE,\r
+                          gImageHandle,\r
+                          FilePath,\r
+                          NULL,\r
+                          0,\r
+                          &ImageHandle\r
+                          );\r
         }\r
       }\r
     }\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      //\r
-      // It there is any error from the Boot attempt exit now.\r
-      //\r
-      goto Done;\r
-    }\r
   }\r
   //\r
   // Provide the image with it's load options\r
   //\r
-  if (ImageHandle == NULL) {\r
+  if ((ImageHandle == NULL) || (EFI_ERROR(Status))) {\r
+    //\r
+    // Report Status Code to indicate that the failure to load boot option\r
+    //\r
+    REPORT_STATUS_CODE (\r
+      EFI_ERROR_CODE | EFI_ERROR_MINOR,\r
+      (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR)\r
+      );    \r
     goto Done;\r
   }\r
+\r
   Status = gBS->HandleProtocol (ImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **) &ImageInfo);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
@@ -2442,6 +2440,15 @@ BdsLibBootViaBootOption (
 \r
   Status = gBS->StartImage (ImageHandle, ExitDataSize, ExitData);\r
   DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Image Return Status = %r\n", Status));\r
+  if (EFI_ERROR (Status)) {\r
+    //\r
+    // Report Status Code to indicate that boot failure\r
+    //\r
+    REPORT_STATUS_CODE (\r
+      EFI_ERROR_CODE | EFI_ERROR_MINOR,\r
+      (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED)\r
+      );\r
+  }\r
 \r
   //\r
   // Clear the Watchdog Timer after the image returns\r
index a91962537935a4470fc83b019535ff7d142140cc..5486a5c5301d58e41682f1b8968c5d76fce345fa 100644 (file)
@@ -493,6 +493,14 @@ BdsEntry (
   //\r
   BdsFormalizeEfiGlobalVariable();\r
 \r
+  //\r
+  // Report Status Code to indicate connecting drivers will happen\r
+  //\r
+  REPORT_STATUS_CODE (\r
+    EFI_PROGRESS_CODE,\r
+    (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_BEGIN_CONNECTING_DRIVERS)\r
+    );\r
+\r
   //\r
   // Do the platform init, can be customized by OEM/IBV\r
   //\r