diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-02-23 03:20:54 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-02-23 03:20:54 +0000 |
commit | c71b65973b59d4eb4bf9b79c5fa59bb511c464ce (patch) | |
tree | 87ceda282b798a9f25d41a349e9549d3676ab8b8 /UnixPkg/Library | |
parent | fcf24bad4a7b0e7acb540caaa618f53547033d85 (diff) | |
download | edk2-c71b65973b59d4eb4bf9b79c5fa59bb511c464ce.zip edk2-c71b65973b59d4eb4bf9b79c5fa59bb511c464ce.tar.gz edk2-c71b65973b59d4eb4bf9b79c5fa59bb511c464ce.tar.bz2 |
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
Diffstat (limited to 'UnixPkg/Library')
-rw-r--r-- | UnixPkg/Library/UnixBdsLib/BdsPlatform.c | 40 | ||||
-rw-r--r-- | UnixPkg/Library/UnixBdsLib/BdsPlatform.h | 2 | ||||
-rw-r--r-- | UnixPkg/Library/UnixBdsLib/PlatformBds.inf | 13 |
3 files changed, 51 insertions, 4 deletions
diff --git a/UnixPkg/Library/UnixBdsLib/BdsPlatform.c b/UnixPkg/Library/UnixBdsLib/BdsPlatform.c index 42882ca..f4d32f1 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 6d5df84..f7b1555 100644 --- a/UnixPkg/Library/UnixBdsLib/BdsPlatform.h +++ b/UnixPkg/Library/UnixBdsLib/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/UnixThunk.h>
#include <Protocol/UnixIo.h>
#include <Guid/Bmp.h>
+#include <Guid/WinNtSystemConfig.h>
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 ffdec8a..c296fe8 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
|