]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update Nt32 platform to use dynamic HII pcd to save console output mode.
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 23 Feb 2009 03:20:29 +0000 (03:20 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 23 Feb 2009 03:20:29 +0000 (03:20 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7579 6f19259b-4bc3-4df7-8a09-765794883524

Nt32Pkg/Include/Guid/WinNtSystemConfig.h [new file with mode: 0644]
Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c
Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.h
Nt32Pkg/Library/Nt32BdsLib/Nt32BdsLib.inf
Nt32Pkg/Nt32Pkg.dec
Nt32Pkg/Nt32Pkg.dsc
Nt32Pkg/Nt32Pkg.fdf

diff --git a/Nt32Pkg/Include/Guid/WinNtSystemConfig.h b/Nt32Pkg/Include/Guid/WinNtSystemConfig.h
new file mode 100644 (file)
index 0000000..08225fb
--- /dev/null
@@ -0,0 +1,35 @@
+/**@file\r
+  Setup Variable data structure for NT32 platform.\r
+\r
+Copyright (c) 2009, Intel Corporation                                                         \r
+All rights reserved. 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
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+\r
+**/\r
+\r
+#ifndef __WIN_NT_SYSTEM_CONFIGUE_H__\r
+#define __WIN_NT_SYSTEM_CONFIGUE_H__\r
+\r
+#define EFI_WIN_NT_SYSTEM_CONFIG_GUID  \\r
+  { 0xb347f047, 0xaf8c, 0x490e, { 0xac, 0x07, 0x0a, 0xa9, 0xb7, 0xe5, 0x38, 0x58 }}\r
+\r
+#pragma pack(1)\r
+typedef struct {\r
+  //\r
+  // Console output mode\r
+  //\r
+  UINT32        ConOutColumn;\r
+  UINT32        ConOutRow;\r
+} WIN_NT_SYSTEM_CONFIGURATION;\r
+#pragma pack()\r
+\r
+\r
+extern EFI_GUID   gEfiWinNtSystemConfigGuid;\r
+\r
+#endif\r
index 6970ceb0080f4ea8b37fcb6090a11471404c2066..3c981fb21a52ce35ef685e2ae5e0756f51cdae83 100644 (file)
@@ -23,6 +23,44 @@ Abstract:
 #include "BdsPlatform.h"\r
 \r
 CHAR16  mFirmwareVendor[] = L"TianoCore.org";\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
 //\r
 // BDS Platform Functions\r
@@ -35,7 +73,7 @@ PlatformBdsInit (
 \r
 Routine Description:\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
   and so crc check.\r
 \r
 Arguments:\r
@@ -64,6 +102,7 @@ Returns:
   //\r
   gBS->CalculateCrc32 ((VOID *) gST, sizeof (EFI_SYSTEM_TABLE), &gST->Hdr.CRC32);\r
 \r
   //\r
   gBS->CalculateCrc32 ((VOID *) gST, sizeof (EFI_SYSTEM_TABLE), &gST->Hdr.CRC32);\r
 \r
+  SetupVariableInit ();\r
 }\r
 \r
 EFI_STATUS\r
 }\r
 \r
 EFI_STATUS\r
index 5188ba51c9726dee9096262ad1fc2b458c71c56c..99a2a4ccf99fdebebccc38406a714e30f2754c6a 100644 (file)
@@ -27,6 +27,7 @@ Abstract:
 #include <Library/DebugLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/PcdLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/PcdLib.h>\r
@@ -37,6 +38,7 @@ Abstract:
 #include <Protocol/WinNtThunk.h>\r
 #include <Protocol/WinNtIo.h>\r
 #include <Guid/Bmp.h>\r
 #include <Protocol/WinNtThunk.h>\r
 #include <Protocol/WinNtIo.h>\r
 #include <Guid/Bmp.h>\r
+#include <Guid/UnixSystemConfig.h>\r
 \r
 extern BDS_CONSOLE_CONNECT_ENTRY  gPlatformConsole[];\r
 extern EFI_DEVICE_PATH_PROTOCOL   *gPlatformConnectSequence[];\r
 \r
 extern BDS_CONSOLE_CONNECT_ENTRY  gPlatformConsole[];\r
 extern EFI_DEVICE_PATH_PROTOCOL   *gPlatformConnectSequence[];\r
index 53efebdeddb789506e8d6e04de19abfbfc02e1d6..1154110a97aba24681a285ae8cf9b6c29c21e6a7 100644 (file)
@@ -46,6 +46,7 @@
   BaseLib\r
   MemoryAllocationLib\r
   UefiBootServicesTableLib\r
   BaseLib\r
   MemoryAllocationLib\r
   UefiBootServicesTableLib\r
+  UefiRuntimeServicesTableLib\r
   BaseMemoryLib\r
   DebugLib\r
   PcdLib\r
   BaseMemoryLib\r
   DebugLib\r
   PcdLib\r
 \r
 [Guids]\r
   gEfiDefaultBmpLogoGuid\r
 \r
 [Guids]\r
   gEfiDefaultBmpLogoGuid\r
+  gEfiWinNtSystemConfigGuid\r
+\r
+[Pcd.common]\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn\r
+\r
+[Depex]\r
+  gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid\r
index 3db1c9fdc42867d7d843b19fd740b47fcbd99003..8ead639695cd0d34e3b88e1917110b8daf0e5cf6 100644 (file)
@@ -61,7 +61,7 @@
   gEfiWinNtPhysicalDisksGuid     = { 0x0C95A92F, 0xA006, 0x11D4, { 0xBC, 0xFA, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}\r
   gEfiWinNtVirtualDisksGuid      = { 0x0C95A928, 0xA006, 0x11D4, { 0xBC, 0xFA, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}\r
   gEfiNt32PkgTokenSpaceGuid      = { 0x0D79A645, 0x1D91, 0x40a6, { 0xA8, 0x1F, 0x61, 0xE6, 0x98, 0x2B, 0x32, 0xB4 }}\r
   gEfiWinNtPhysicalDisksGuid     = { 0x0C95A92F, 0xA006, 0x11D4, { 0xBC, 0xFA, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}\r
   gEfiWinNtVirtualDisksGuid      = { 0x0C95A928, 0xA006, 0x11D4, { 0xBC, 0xFA, 0x00, 0x80, 0xC7, 0x3C, 0x88, 0x81 }}\r
   gEfiNt32PkgTokenSpaceGuid      = { 0x0D79A645, 0x1D91, 0x40a6, { 0xA8, 0x1F, 0x61, 0xE6, 0x98, 0x2B, 0x32, 0xB4 }}\r
-  \r
+  gEfiWinNtSystemConfigGuid      = { 0xb347f047, 0xaf8c, 0x490e, { 0xac, 0x07, 0x0a, 0xa9, 0xb7, 0xe5, 0x38, 0x58 }}\r
 \r
 ##\r
 # Protocols provided by Nt32Pkg for all architecture.\r
 \r
 ##\r
 # Protocols provided by Nt32Pkg for all architecture.\r
index b892a4e59420f1d7ae1aef59087f9053da3d7a53..ddd29b43cb76f6630e41ae878a39a9a91f21400a 100644 (file)
   WinNtLib|Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.inf\r
   OemHookStatusCodeLib|Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.inf\r
   DebugLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf\r
   WinNtLib|Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.inf\r
   OemHookStatusCodeLib|Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.inf\r
   DebugLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf\r
-  PrintLib|MdeModulePkg/Library/EdkDxePrintLib/EdkDxePrintLib.inf\r
+  PrintLib|MdeModulePkg/Library/DxePrintLibPrint2Protocol/DxePrintLibPrint2Protocol.inf\r
 \r
 \r
 ################################################################################\r
 \r
 \r
 ################################################################################\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPlatformBootTimeOutDefault|10\r
 \r
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdPlatformBootTimeOutDefault|10\r
 \r
+[PcdsDynamicHii.common.DEFAULT]\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn|0x0053 0x0065 0x0074 0x0075 0x0070|gEfiWinNtSystemConfigGuid|0x0|80 # Variable: L"Setup"\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|0x0053 0x0065 0x0074 0x0075 0x0070|gEfiWinNtSystemConfigGuid|0x4|25 # Variable: L"Setup"\r
 \r
 ###################################################################################################\r
 #\r
 \r
 ###################################################################################################\r
 #\r
   MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf\r
   MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
   MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf\r
   MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf\r
   MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
   MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf\r
-  MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf\r
+  MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf {\r
+    <LibraryClasses>\r
+      PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+  }\r
   MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf\r
   MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
   MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf\r
   MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf\r
   MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
   MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf\r
   IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf \r
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
   MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf\r
   IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf \r
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
   MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf\r
+  MdeModulePkg/Universal/PrintDxe/PrintDxe.inf\r
   MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf {\r
     <LibraryClasses>\r
       PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
   MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf {\r
     <LibraryClasses>\r
       PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
   #\r
   # Libraries common to PEI and DXE\r
   #\r
   #\r
   # Libraries common to PEI and DXE\r
   #\r
-  #  EdkCompatibilityPkg\Foundation\Efi\Guid\EfiGuidLib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Framework\Guid\EdkFrameworkGuidLib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Guid\EdkGuidLib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Library\EfiCommonLib\EfiCommonLib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Cpu\Pentium\CpuIA32Lib\CpuIA32Lib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Cpu\Itanium\CpuIA64Lib\CpuIA64Lib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Library\CustomizedDecompress\CustomizedDecompress.inf\r
-  #  EdkCompatibilityPkg\Foundation\Library\CompilerStub\CompilerStubLib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Library\Dxe\Hob\HobLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Efi/Guid/EfiGuidLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Framework/Guid/EdkFrameworkGuidLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Guid/EdkGuidLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/CpuIA32Lib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Cpu/Itanium/CpuIa64Lib/CpuIA64Lib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Library/CustomizedDecompress/CustomizedDecompress.inf\r
+  #  EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Library/Dxe/Hob/HobLib.inf\r
 \r
   #\r
   # PEI libraries\r
   #\r
 \r
   #\r
   # PEI libraries\r
   #\r
-  #  EdkCompatibilityPkg\Foundation\Framework\Ppi\EdkFrameworkPpiLib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Ppi\EdkPpiLib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Library\Pei\PeiLib\PeiLib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Library\Pei\Hob\PeiHobLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Framework/Ppi/EdkFrameworkPpiLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Ppi/EdkPpiLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Library/Pei/Hob/PeiHobLib.inf\r
 \r
   #\r
   # DXE libraries\r
   #\r
 \r
   #\r
   # DXE libraries\r
   #\r
-  #  EdkCompatibilityPkg\Foundation\Core\Dxe\ArchProtocol\ArchProtocolLib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Efi\Protocol\EfiProtocolLib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Framework\Protocol\EdkFrameworkProtocolLib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Protocol\EdkProtocolLib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Library\Dxe\EfiDriverLib\EfiDriverLib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Library\RuntimeDxe\EfiRuntimeLib\EfiRuntimeLib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Library\Dxe\Graphics\Graphics.inf\r
-  #  EdkCompatibilityPkg\Foundation\Library\Dxe\EfiIfrSupportLib\EfiIfrSupportLib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Library\Dxe\Print\PrintLib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Library\Dxe\EfiScriptLib\EfiScriptLib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Library\Dxe\EfiUiLib\EfiUiLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Core/Dxe/ArchProtocol/ArchProtocolLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Efi/Protocol/EfiProtocolLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Framework/Protocol/EdkFrameworkProtocolLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Protocol/EdkProtocolLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/EfiRuntimeLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Graphics.inf\r
+  #  EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/EfiIfrSupportLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Library/Dxe/Print/PrintLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Library/Dxe/EfiUiLib/EfiUiLib.inf\r
 \r
   #\r
   # Print/Graphics Library consume SetupBrowser Print Protocol\r
   #\r
 \r
   #\r
   # Print/Graphics Library consume SetupBrowser Print Protocol\r
   #\r
-  #  EdkCompatibilityPkg\Foundation\Library\Dxe\PrintLite\PrintLib.inf\r
-  #  EdkCompatibilityPkg\Foundation\Library\Dxe\GraphicsLite\Graphics.inf\r
+  #  EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/PrintLib.inf\r
+  #  EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Graphics.inf\r
+\r
 \r
 \r
index db0244487a67e9ea165b7cc045ccd6fae2b2a3a6..ef201f60d98e05ad2828aa706bc7b35a332217ba 100644 (file)
@@ -202,6 +202,7 @@ INF  MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
 INF  MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf\r
 INF  MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
 INF  MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf\r
 INF  MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf\r
 INF  MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
 INF  MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf\r
+INF  MdeModulePkg/Universal/PrintDxe/PrintDxe.inf\r
 INF  MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
 INF  IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf\r
 INF  MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf     ##This driver follows UEFI specification definition\r
 INF  MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
 INF  IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf\r
 INF  MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf     ##This driver follows UEFI specification definition\r