summaryrefslogtreecommitdiff
path: root/Nt32Pkg/Library
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-02-23 03:20:29 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-02-23 03:20:29 +0000
commitfcf24bad4a7b0e7acb540caaa618f53547033d85 (patch)
treee29a168a163f17bc13ce42c064c29f1880048848 /Nt32Pkg/Library
parentbdb869f653607684d3c98449b467920dc19c83d2 (diff)
Update Nt32 platform to use dynamic HII pcd to save console output mode.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7579 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Nt32Pkg/Library')
-rw-r--r--Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c41
-rw-r--r--Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.h2
-rw-r--r--Nt32Pkg/Library/Nt32BdsLib/Nt32BdsLib.inf9
3 files changed, 51 insertions, 1 deletions
diff --git a/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c b/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c
index 6970ceb00..3c981fb21 100644
--- a/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c
+++ b/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.c
@@ -23,6 +23,44 @@ Abstract:
#include "BdsPlatform.h"
CHAR16 mFirmwareVendor[] = L"TianoCore.org";
+WIN_NT_SYSTEM_CONFIGURATION mSystemConfigData;
+
+VOID
+SetupVariableInit (
+ VOID
+ )
+{
+ EFI_STATUS Status;
+ UINTN Size;
+
+ Size = sizeof (mSystemConfigData);
+ Status = gRT->GetVariable (
+ L"Setup",
+ &gEfiWinNtSystemConfigGuid,
+ NULL,
+ &Size,
+ (VOID *) &mSystemConfigData
+ );
+
+ if (EFI_ERROR (Status)) {
+ //
+ // SetupVariable is corrupt
+ //
+ mSystemConfigData.ConOutRow = PcdGet32 (PcdConOutColumn);
+ mSystemConfigData.ConOutColumn = PcdGet32 (PcdConOutRow);
+
+ Status = gRT->SetVariable (
+ L"Setup",
+ &gEfiWinNtSystemConfigGuid,
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+ sizeof (mSystemConfigData),
+ (VOID *) &mSystemConfigData
+ );
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "Failed to save Setup Variable to non-volatile storage, Status = %r\n", Status));
+ }
+ }
+}
//
// BDS Platform Functions
@@ -35,7 +73,7 @@ PlatformBdsInit (
Routine Description:
- Platform Bds init. Incude the platform firmware vendor, revision
+ Platform Bds init. Include the platform firmware vendor, revision
and so crc check.
Arguments:
@@ -64,6 +102,7 @@ Returns:
//
gBS->CalculateCrc32 ((VOID *) gST, sizeof (EFI_SYSTEM_TABLE), &gST->Hdr.CRC32);
+ SetupVariableInit ();
}
EFI_STATUS
diff --git a/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.h b/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.h
index 5188ba51c..99a2a4ccf 100644
--- a/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.h
+++ b/Nt32Pkg/Library/Nt32BdsLib/BdsPlatform.h
@@ -27,6 +27,7 @@ Abstract:
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/BaseLib.h>
#include <Library/PcdLib.h>
@@ -37,6 +38,7 @@ Abstract:
#include <Protocol/WinNtThunk.h>
#include <Protocol/WinNtIo.h>
#include <Guid/Bmp.h>
+#include <Guid/UnixSystemConfig.h>
extern BDS_CONSOLE_CONNECT_ENTRY gPlatformConsole[];
extern EFI_DEVICE_PATH_PROTOCOL *gPlatformConnectSequence[];
diff --git a/Nt32Pkg/Library/Nt32BdsLib/Nt32BdsLib.inf b/Nt32Pkg/Library/Nt32BdsLib/Nt32BdsLib.inf
index 53efebded..1154110a9 100644
--- a/Nt32Pkg/Library/Nt32BdsLib/Nt32BdsLib.inf
+++ b/Nt32Pkg/Library/Nt32BdsLib/Nt32BdsLib.inf
@@ -46,6 +46,7 @@
BaseLib
MemoryAllocationLib
UefiBootServicesTableLib
+ UefiRuntimeServicesTableLib
BaseMemoryLib
DebugLib
PcdLib
@@ -53,3 +54,11 @@
[Guids]
gEfiDefaultBmpLogoGuid
+ gEfiWinNtSystemConfigGuid
+
+[Pcd.common]
+ gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow
+ gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn
+
+[Depex]
+ gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid