]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ProcessCapsule() and BdsMemoryTest() are implemented in the BdsDxe module, which...
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 13 Jul 2009 12:04:24 +0000 (12:04 +0000)
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 13 Jul 2009 12:04:24 +0000 (12:04 +0000)
It is not proper for a library implementation to assume the names of function in a parent module.
Instead, they must be designed as the pointers to these two BdsDxe functions and passed in.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8929 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Include/Library/PlatformBdsLib.h
IntelFrameworkModulePkg/Library/PlatformBdsLibNull/BdsPlatform.c
IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
IntelFrameworkModulePkg/Universal/BdsDxe/MemoryTest.c

index 9a5f6941b7ed998893bbd283bac5822b75547ef9..96cd87d1cf95ee41e829aa51ca8a3d53fd5c064c 100644 (file)
@@ -19,6 +19,47 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/GenericMemoryTest.h>\r
 #include <Library/GenericBdsLib.h>\r
 \r
+/**\r
+  Perform the memory test base on the memory test intensive level,\r
+  and update the memory resource.\r
+\r
+  @param  Level         The memory test intensive level.\r
+\r
+  @retval EFI_STATUS    Success test all the system memory and update\r
+                        the memory resource\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *BASEM_MEMORY_TEST)(\r
+  IN EXTENDMEM_COVERAGE_LEVEL Level\r
+  );\r
+\r
+/**\r
+  This routine is called to see if there are any capsules we need to process.\r
+  If the boot mode is not UPDATE, then we do nothing. Otherwise find the\r
+  capsule HOBS and produce firmware volumes for them via the DXE service.\r
+  Then call the dispatcher to dispatch drivers from them. Finally, check\r
+  the status of the updates.\r
+\r
+  This function should be called by BDS in case we need to do some\r
+  sort of processing even if there is no capsule to process. We\r
+  need to do this if an earlier update went away and we need to\r
+  clear the capsule variable so on the next reset PEI does not see it and\r
+  think there is a capsule available.\r
+\r
+  @param BootMode                 the current boot mode\r
+\r
+  @retval EFI_INVALID_PARAMETER   boot mode is not correct for an update\r
+  @retval EFI_SUCCESS             There is no error when processing capsule\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *PROCESS_CAPSULES)(\r
+  IN EFI_BOOT_MODE BootMode\r
+  );\r
+\r
 /**\r
   Platform Bds initialization. Includes the platform firmware vendor, revision\r
   and so crc check.\r
@@ -37,13 +78,17 @@ PlatformBdsInit (
 \r
   @param  DriverOptionList        The header of the driver option link list\r
   @param  BootOptionList          The header of the boot option link list\r
+  @param  ProcessCapsules         A pointer to ProcessCapsules()\r
+  @param  BaseMemoryTest          A pointer to BaseMemoryTest()\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 PlatformBdsPolicyBehavior (\r
   IN LIST_ENTRY                      *DriverOptionList,\r
-  IN LIST_ENTRY                      *BootOptionList\r
+  IN LIST_ENTRY                      *BootOptionList,\r
+  IN PROCESS_CAPSULES                ProcessCapsules,\r
+  IN BASEM_MEMORY_TEST               BaseMemoryTest\r
   );\r
 \r
 /**\r
index 3571f4c58b7c12ba3552f324eca09f28f4973d63..e7bad074fd8ed28de145a8034b37bae7205a207d 100644 (file)
@@ -81,12 +81,14 @@ PlatformBdsGetDriverOption (
 \r
   @param MemoryTestLevel  The memory test intensive level\r
   @param QuietBoot        Indicate if need to enable the quiet boot\r
+  @param BaseMemoryTest   A pointer to BdsMemoryTest()\r
 \r
 **/\r
 VOID\r
 PlatformBdsDiagnostics (\r
   IN EXTENDMEM_COVERAGE_LEVEL    MemoryTestLevel,\r
-  IN BOOLEAN                     QuietBoot\r
+  IN BOOLEAN                     QuietBoot,\r
+  IN BASEM_MEMORY_TEST           BaseMemoryTest\r
   )\r
 {\r
 }\r
@@ -98,13 +100,17 @@ PlatformBdsDiagnostics (
 \r
   @param  DriverOptionList        The header of the driver option link list\r
   @param  BootOptionList          The header of the boot option link list\r
+  @param  ProcessCapsules         A pointer to ProcessCapsules()\r
+  @param  BaseMemoryTest          A pointer to BaseMemoryTest()\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 PlatformBdsPolicyBehavior (\r
   IN LIST_ENTRY                      *DriverOptionList,\r
-  IN LIST_ENTRY                      *BootOptionList\r
+  IN LIST_ENTRY                      *BootOptionList,\r
+  IN PROCESS_CAPSULES                ProcessCapsules,\r
+  IN BASEM_MEMORY_TEST               BaseMemoryTest\r
   )\r
 {\r
 }\r
index 055a52df1b887a254c5c69253276d1d298bef8dc..25b5c63474c689bbf4b8ab2e5abcb46e0f6a449e 100644 (file)
@@ -40,6 +40,9 @@ UINT16                          *mBootNext = NULL;
 \r
 EFI_HANDLE                      mBdsImageHandle;\r
 \r
+extern EFI_STATUS BdsMemoryTest (EXTENDMEM_COVERAGE_LEVEL Level);\r
+extern EFI_STATUS ProcessCapsules (EFI_BOOT_MODE BootMode);\r
+\r
 /**\r
 \r
   Install Boot Device Selection Protocol\r
@@ -347,7 +350,7 @@ BdsEntry (
   //\r
   // Setup some platform policy here\r
   //\r
-  PlatformBdsPolicyBehavior (&DriverOptionList, &BootOptionList);\r
+  PlatformBdsPolicyBehavior (&DriverOptionList, &BootOptionList, ProcessCapsules, BdsMemoryTest);\r
   PERF_END (0, "PlatformBds", "BDS", 0);\r
 \r
   //\r
index 59759509e24e3dd2935b848660705cb72a4fa9a0..19a505e2b7d8e21fe8d5f955a91b803ac9e16029 100644 (file)
@@ -193,15 +193,13 @@ PlatformBdsShowProgress (
 }\r
 \r
 /**\r
-\r
   Perform the memory test base on the memory test intensive level,\r
   and update the memory resource.\r
 \r
+  @param  Level         The memory test intensive level.\r
 \r
-  @param Level           The memory test intensive level.\r
-\r
-  @retval  EFI_STATUS       Success test all the system memory and update\r
-                            the memory resource\r
+  @retval EFI_STATUS    Success test all the system memory and update\r
+                        the memory resource\r
 \r
 **/\r
 EFI_STATUS\r