From c71b65973b59d4eb4bf9b79c5fa59bb511c464ce Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Mon, 23 Feb 2009 03:20:54 +0000 Subject: Update Unix platform to use dynamic HII pcd to save console output mode. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7580 6f19259b-4bc3-4df7-8a09-765794883524 --- UnixPkg/Library/UnixBdsLib/BdsPlatform.c | 40 +++++++++++++++++++++++++++++- UnixPkg/Library/UnixBdsLib/BdsPlatform.h | 2 ++ UnixPkg/Library/UnixBdsLib/PlatformBds.inf | 13 +++++++--- 3 files changed, 51 insertions(+), 4 deletions(-) (limited to 'UnixPkg/Library') diff --git a/UnixPkg/Library/UnixBdsLib/BdsPlatform.c b/UnixPkg/Library/UnixBdsLib/BdsPlatform.c index 42882ca1f3..f4d32f1a57 100644 --- a/UnixPkg/Library/UnixBdsLib/BdsPlatform.c +++ b/UnixPkg/Library/UnixBdsLib/BdsPlatform.c @@ -23,6 +23,44 @@ Abstract: #include "BdsPlatform.h" CHAR16 mFirmwareVendor[] = L"TianoCore.org"; +UNIX_SYSTEM_CONFIGURATION mSystemConfigData; + +VOID +SetupVariableInit ( + VOID + ) +{ + EFI_STATUS Status; + UINTN Size; + + Size = sizeof (mSystemConfigData); + Status = gRT->GetVariable ( + L"Setup", + &gEfiUnixSystemConfigGuid, + NULL, + &Size, + (VOID *) &mSystemConfigData + ); + + if (EFI_ERROR (Status)) { + // + // SetupVariable is corrupt + // + mSystemConfigData.ConOutRow = PcdGet32 (PcdConOutColumn); + mSystemConfigData.ConOutColumn = PcdGet32 (PcdConOutRow); + + Status = gRT->SetVariable ( + L"Setup", + &gEfiUnixSystemConfigGuid, + 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: diff --git a/UnixPkg/Library/UnixBdsLib/BdsPlatform.h b/UnixPkg/Library/UnixBdsLib/BdsPlatform.h index 6d5df84de5..f7b15556bf 100644 --- a/UnixPkg/Library/UnixBdsLib/BdsPlatform.h +++ b/UnixPkg/Library/UnixBdsLib/BdsPlatform.h @@ -27,6 +27,7 @@ Abstract: #include #include #include +#include #include #include #include @@ -37,6 +38,7 @@ Abstract: #include #include #include +#include extern BDS_CONSOLE_CONNECT_ENTRY gPlatformConsole[]; extern EFI_DEVICE_PATH_PROTOCOL *gPlatformConnectSequence[]; diff --git a/UnixPkg/Library/UnixBdsLib/PlatformBds.inf b/UnixPkg/Library/UnixBdsLib/PlatformBds.inf index ffdec8a2ee..c296fe8c61 100644 --- a/UnixPkg/Library/UnixBdsLib/PlatformBds.inf +++ b/UnixPkg/Library/UnixBdsLib/PlatformBds.inf @@ -24,7 +24,6 @@ EDK_RELEASE_VERSION = 0x00020000 EFI_SPECIFICATION_VERSION = 0x00020000 - ENTRY_POINT = BdsInitialize # # The following information is for reference only and not required by the build tools. @@ -34,9 +33,8 @@ [Sources.common] BdsPlatform.c - BdsPlatform.h PlatformData.c - + BdsPlatform.h [Packages] MdePkg/MdePkg.dec @@ -69,6 +67,7 @@ BaseLib MemoryAllocationLib UefiBootServicesTableLib + UefiRuntimeServicesTableLib BaseMemoryLib DebugLib PcdLib @@ -78,3 +77,11 @@ [Guids] gEfiDefaultBmpLogoGuid # ALWAYS_CONSUMED + gEfiUnixSystemConfigGuid + +[Pcd.common] + gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow + gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn + +[Depex] + gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid -- cgit v1.2.3