]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c
Enable UID support in NT32 platform
[mirror_edk2.git] / Nt32Pkg / Library / Nt32BdsLib / BdsPlatform.c
index 34fd46ee59a034ff6b4f68841727fd2485620bfd..0e5b9f5953d270994b601bcdbc85f2dbba942cce 100644 (file)
@@ -22,7 +22,6 @@ Abstract:
 \r
 #include "BdsPlatform.h"\r
 \r
-CHAR16  mFirmwareVendor[] = L"TianoCore.org";\r
 WIN_NT_SYSTEM_CONFIGURATION mSystemConfigData;\r
 \r
 VOID\r
@@ -85,22 +84,6 @@ Returns:
 \r
 --*/\r
 {\r
-  //\r
-  // set firmwarevendor, here can be IBV/OEM customize\r
-  //\r
-  gST->FirmwareVendor = AllocateRuntimeCopyPool (\r
-                          sizeof (mFirmwareVendor),\r
-                          &mFirmwareVendor\r
-                          );\r
-  ASSERT (gST->FirmwareVendor != NULL);\r
-\r
-  gST->FirmwareRevision = 0;\r
-\r
-  //\r
-  // Fixup Tasble CRC after we updated Firmware Vendor and Revision\r
-  //\r
-  gBS->CalculateCrc32 ((VOID *) gST, sizeof (EFI_SYSTEM_TABLE), &gST->Hdr.CRC32);\r
-\r
   SetupVariableInit ();\r
 }\r
 \r
@@ -252,7 +235,8 @@ Returns:
 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
@@ -266,7 +250,9 @@ Arguments:
   MemoryTestLevel  - The memory test intensive level\r
   \r
   QuietBoot        - Indicate if need to enable the quiet boot\r
\r
+\r
+  BaseMemoryTest   - A pointer to BdsMemoryTest() \r
+\r
 Returns:\r
 \r
   None.\r
@@ -286,7 +272,7 @@ Returns:
     //\r
     // Perform system diagnostic\r
     //\r
-    Status = BdsMemoryTest (MemoryTestLevel);\r
+    Status = BaseMemoryTest (MemoryTestLevel);\r
     if (EFI_ERROR (Status)) {\r
       DisableQuietBoot ();\r
     }\r
@@ -296,34 +282,28 @@ Returns:
   //\r
   // Perform system diagnostic\r
   //\r
-  Status = BdsMemoryTest (MemoryTestLevel);\r
+  Status = BaseMemoryTest (MemoryTestLevel);\r
 }\r
 \r
-VOID\r
-EFIAPI\r
-PlatformBdsPolicyBehavior (\r
-  IN OUT LIST_ENTRY                  *DriverOptionList,\r
-  IN OUT LIST_ENTRY                  *BootOptionList\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   The function will excute with as the platform policy, current policy\r
   is driven by boot mode. IBV/OEM can customize this code for their specific\r
   policy action.\r
-  \r
-Arguments:\r
 \r
-  DriverOptionList - The header of the driver option link list\r
-  \r
-  BootOptionList   - The header of the boot option link list\r
\r
-Returns:\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
-  None.\r
-  \r
---*/\r
+**/\r
+VOID\r
+EFIAPI\r
+PlatformBdsPolicyBehavior (\r
+  IN OUT LIST_ENTRY                  *DriverOptionList,\r
+  IN OUT LIST_ENTRY                  *BootOptionList,\r
+  IN PROCESS_CAPSULES                ProcessCapsules,\r
+  IN BASEM_MEMORY_TEST               BaseMemoryTest\r
+  )\r
 {\r
   EFI_STATUS     Status;\r
   UINT16         Timeout;\r
@@ -357,13 +337,18 @@ Returns:
     // console directly.\r
     //\r
     BdsLibConnectAllDefaultConsoles ();\r
-    PlatformBdsDiagnostics ((EXTENDMEM_COVERAGE_LEVEL)IGNORE, TRUE);\r
+    PlatformBdsDiagnostics ((EXTENDMEM_COVERAGE_LEVEL)IGNORE, TRUE, BaseMemoryTest);\r
 \r
     //\r
     // Perform some platform specific connect sequence\r
     //\r
     PlatformBdsConnectSequence ();\r
 \r
+    //\r
+    // Perform user identification process\r
+    //\r
+    PlatformBdsUserIdentify ();\r
+    \r
     //\r
     // Notes: current time out = 0 can not enter the\r
     // front page\r
@@ -381,8 +366,12 @@ Returns:
     // Boot with the specific configuration\r
     //\r
     PlatformBdsConnectConsole (gPlatformConsole);\r
-    PlatformBdsDiagnostics (EXTENSIVE, FALSE);\r
+    PlatformBdsDiagnostics (EXTENSIVE, FALSE, BaseMemoryTest);\r
     BdsLibConnectAll ();\r
+    //\r
+    // Perform user identification process\r
+    //\r
+    PlatformBdsUserIdentify ();\r
     ProcessCapsules (BOOT_ON_FLASH_UPDATE);\r
     break;\r
 \r
@@ -392,8 +381,13 @@ Returns:
     // and show up the front page\r
     //\r
     PlatformBdsConnectConsole (gPlatformConsole);\r
-    PlatformBdsDiagnostics (EXTENSIVE, FALSE);\r
+    PlatformBdsDiagnostics (EXTENSIVE, FALSE, BaseMemoryTest);\r
 \r
+    //\r
+    // Perform user identification process\r
+    //\r
+    PlatformBdsUserIdentify ();\r
+    \r
     //\r
     // In recovery boot mode, we still enter to the\r
     // frong page now\r
@@ -416,13 +410,18 @@ Returns:
       PlatformBdsNoConsoleAction ();\r
     }\r
 \r
-    PlatformBdsDiagnostics ((EXTENDMEM_COVERAGE_LEVEL)IGNORE, TRUE);\r
+    PlatformBdsDiagnostics ((EXTENDMEM_COVERAGE_LEVEL)IGNORE, TRUE, BaseMemoryTest);\r
 \r
     //\r
     // Perform some platform specific connect sequence\r
     //\r
     PlatformBdsConnectSequence ();\r
 \r
+    //\r
+    // Perform user identification process\r
+    //\r
+    PlatformBdsUserIdentify ();\r
+    \r
     //\r
     // Give one chance to enter the setup if we\r
     // have the time out\r
@@ -545,11 +544,82 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_STATUS\r
+/**\r
+  This function locks platform flash that is not allowed to be updated during normal boot path.\r
+  The flash layout is platform specific.\r
+\r
+  **/\r
+VOID\r
 EFIAPI\r
 PlatformBdsLockNonUpdatableFlash (\r
   VOID\r
   )\r
 {\r
-  return EFI_SUCCESS;\r
+  return;\r
+}\r
+\r
+/**\r
+  Lock the ConsoleIn device in system table. All key\r
+  presses will be ignored until the Password is typed in. The only way to\r
+  disable the password is to type it in to a ConIn device.\r
+\r
+  @param  Password        Password used to lock ConIn device.\r
+\r
+  @retval EFI_SUCCESS     lock the Console In Spliter virtual handle successfully.\r
+  @retval EFI_UNSUPPORTED Password not found\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+LockKeyboards (\r
+  IN  CHAR16    *Password\r
+  )\r
+{\r
+    return EFI_UNSUPPORTED;\r
+}\r
+\r
+\r
+EFI_STATUS\r
+PlatformBdsUserIdentify (\r
+  VOID\r
+  )\r
+/*++\r
+\r
+  Routine Description:\r
+\r
+  This function is to identify a valid user, if successed, handle the deferred images.\r
+\r
+  Arguments:\r
+\r
+  None.\r
+\r
+  Returns:\r
+\r
+  EFI_SUCCESS      - User successfully identified.\r
+\r
+--*/\r
+{\r
+  EFI_STATUS                          Status;\r
+  EFI_USER_MANAGER_PROTOCOL           *Manager;\r
+  EFI_USER_PROFILE_HANDLE             User;\r
+\r
+  //\r
+  // Locate user manager driver\r
+  //\r
+  Status = gBS->LocateProtocol (\r
+                  &gEfiUserManagerProtocolGuid,\r
+                  NULL,\r
+                  &Manager\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+  \r
+  //\r
+  // Identity user\r
+  //\r
+  Status = Manager->Identify (Manager, &User);\r
+  return Status;\r
 }\r
+\r
+\r