]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c
Retire Logo and Shell guid header file, which are replaced by gEfiIntelFrameworkModul...
[mirror_edk2.git] / Nt32Pkg / Library / Nt32BdsLib / BdsPlatform.c
index d6ee95578f9307de416dcc237951883c6bf5661f..34fd46ee59a034ff6b4f68841727fd2485620bfd 100644 (file)
@@ -1,4 +1,4 @@
-/*++\r
+/**@file\r
 \r
 Copyright (c) 2004 - 2006, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials                          \r
@@ -18,30 +18,67 @@ Abstract:
   This file include all platform action which can be customized\r
   by IBV/OEM.\r
 \r
---*/\r
+**/\r
 \r
 #include "BdsPlatform.h"\r
 \r
 CHAR16  mFirmwareVendor[] = L"TianoCore.org";\r
+WIN_NT_SYSTEM_CONFIGURATION mSystemConfigData;\r
+\r
+VOID\r
+SetupVariableInit (\r
+  VOID\r
+  )\r
+{\r
+  EFI_STATUS                      Status;\r
+  UINTN                           Size;\r
+\r
+  Size = sizeof (mSystemConfigData);\r
+  Status = gRT->GetVariable (\r
+                  L"Setup",\r
+                  &gEfiWinNtSystemConfigGuid,\r
+                  NULL,\r
+                  &Size,\r
+                  (VOID *) &mSystemConfigData\r
+                  );\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    //\r
+    // SetupVariable is corrupt\r
+    //\r
+    mSystemConfigData.ConOutRow = PcdGet32 (PcdConOutColumn);\r
+    mSystemConfigData.ConOutColumn = PcdGet32 (PcdConOutRow);\r
+\r
+    Status = gRT->SetVariable (\r
+                    L"Setup",\r
+                    &gEfiWinNtSystemConfigGuid,\r
+                    EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
+                    sizeof (mSystemConfigData),\r
+                    (VOID *) &mSystemConfigData\r
+                    );\r
+    if (EFI_ERROR (Status)) {\r
+      DEBUG ((EFI_D_ERROR, "Failed to save Setup Variable to non-volatile storage, Status = %r\n", Status));\r
+    }\r
+  }\r
+}\r
 \r
 //\r
 // BDS Platform Functions\r
 //\r
 VOID\r
+EFIAPI\r
 PlatformBdsInit (\r
-  IN EFI_BDS_ARCH_PROTOCOL_INSTANCE  *PrivateData\r
+  VOID\r
   )\r
 /*++\r
 \r
 Routine Description:\r
 \r
-  Platform Bds init. Incude the platform firmware vendor, revision\r
+  Platform Bds init. Include the platform firmware vendor, revision\r
   and so crc check.\r
 \r
 Arguments:\r
 \r
-  PrivateData  - The EFI_BDS_ARCH_PROTOCOL_INSTANCE instance\r
-\r
 Returns:\r
 \r
   None.\r
@@ -64,6 +101,7 @@ Returns:
   //\r
   gBS->CalculateCrc32 ((VOID *) gST, sizeof (EFI_SYSTEM_TABLE), &gST->Hdr.CRC32);\r
 \r
+  SetupVariableInit ();\r
 }\r
 \r
 EFI_STATUS\r
@@ -244,7 +282,7 @@ Returns:
   // from the graphic lib\r
   //\r
   if (QuietBoot) {\r
-    EnableQuietBootEx (&gEfiDefaultBmpLogoGuid, mBdsImageHandle);\r
+    EnableQuietBoot (PcdGetPtr(PcdLogoFile));\r
     //\r
     // Perform system diagnostic\r
     //\r
@@ -262,8 +300,8 @@ Returns:
 }\r
 \r
 VOID\r
+EFIAPI\r
 PlatformBdsPolicyBehavior (\r
-  IN EFI_BDS_ARCH_PROTOCOL_INSTANCE  *PrivateData,\r
   IN OUT LIST_ENTRY                  *DriverOptionList,\r
   IN OUT LIST_ENTRY                  *BootOptionList\r
   )\r
@@ -277,8 +315,6 @@ Routine Description:
   \r
 Arguments:\r
 \r
-  PrivateData      - The EFI_BDS_ARCH_PROTOCOL_INSTANCE instance\r
-  \r
   DriverOptionList - The header of the driver option link list\r
   \r
   BootOptionList   - The header of the boot option link list\r
@@ -289,13 +325,14 @@ Returns:
   \r
 --*/\r
 {\r
-  EFI_STATUS  Status;\r
-  UINT16      Timeout;\r
+  EFI_STATUS     Status;\r
+  UINT16         Timeout;\r
+  EFI_BOOT_MODE  BootMode;\r
 \r
   //\r
   // Init the time out value\r
   //\r
-  Timeout = BdsLibGetTimeout ();\r
+  Timeout = PcdGet16 (PcdPlatformBootTimeOut);\r
 \r
   //\r
   // Load the driver option as the driver option list\r
@@ -305,13 +342,13 @@ Returns:
   //\r
   // Get current Boot Mode\r
   //\r
-  Status = BdsLibGetBootMode (&PrivateData->BootMode);\r
+  Status = BdsLibGetBootMode (&BootMode);\r
 \r
   //\r
   // Go the different platform policy with different boot mode\r
   // Notes: this part code can be change with the table policy\r
   //\r
-  switch (PrivateData->BootMode) {\r
+  switch (BootMode) {\r
 \r
   case BOOT_ASSUMING_NO_CONFIGURATION_CHANGES:\r
   case BOOT_WITH_MINIMAL_CONFIGURATION:\r
@@ -320,7 +357,7 @@ Returns:
     // console directly.\r
     //\r
     BdsLibConnectAllDefaultConsoles ();\r
-    PlatformBdsDiagnostics (IGNORE, TRUE);\r
+    PlatformBdsDiagnostics ((EXTENDMEM_COVERAGE_LEVEL)IGNORE, TRUE);\r
 \r
     //\r
     // Perform some platform specific connect sequence\r
@@ -379,7 +416,7 @@ Returns:
       PlatformBdsNoConsoleAction ();\r
     }\r
 \r
-    PlatformBdsDiagnostics (IGNORE, TRUE);\r
+    PlatformBdsDiagnostics ((EXTENDMEM_COVERAGE_LEVEL)IGNORE, TRUE);\r
 \r
     //\r
     // Perform some platform specific connect sequence\r
@@ -404,6 +441,7 @@ Returns:
 }\r
 \r
 VOID\r
+EFIAPI\r
 PlatformBdsBootSuccess (\r
   IN  BDS_COMMON_OPTION   *Option\r
   )\r
@@ -440,6 +478,7 @@ Returns:
 }\r
 \r
 VOID\r
+EFIAPI\r
 PlatformBdsBootFail (\r
   IN  BDS_COMMON_OPTION  *Option,\r
   IN  EFI_STATUS         Status,\r