From c4f9201e2ea87f0dc56750c9366271ed8819c73a Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Wed, 17 Dec 2008 12:07:02 +0000 Subject: [PATCH] Refine code to remove structure assignment git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7070 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/Console/TerminalDxe/Terminal.c | 45 +++++++------------ 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c index ac1e38838d..6fd19de664 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c @@ -251,7 +251,7 @@ TerminalDriverBindingStart ( UINTN EntryCount; UINTN Index; EFI_DEVICE_PATH_PROTOCOL *DevicePath; - EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOutput; + EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *SimpleTextOutput; TerminalDevice = NULL; DefaultNode = NULL; @@ -488,54 +488,39 @@ TerminalDriverBindingStart ( goto ReportError; } // - // Simple Text Output Protocol + // Set Simple Text Output Protocol from template. // - SimpleTextOutput = TerminalDevice->SimpleTextOutput; - - SimpleTextOutput.Reset = TerminalConOutReset; - SimpleTextOutput.OutputString = TerminalConOutOutputString; - SimpleTextOutput.TestString = TerminalConOutTestString; - SimpleTextOutput.QueryMode = TerminalConOutQueryMode; - SimpleTextOutput.SetMode = TerminalConOutSetMode; - SimpleTextOutput.SetAttribute = TerminalConOutSetAttribute; - SimpleTextOutput.ClearScreen = TerminalConOutClearScreen; - SimpleTextOutput.SetCursorPosition = TerminalConOutSetCursorPosition; - SimpleTextOutput.EnableCursor = TerminalConOutEnableCursor; - SimpleTextOutput.Mode = &TerminalDevice->SimpleTextOutputMode; + SimpleTextOutput = CopyMem ( + &TerminalDevice->SimpleTextOutput, + &mTerminalDevTemplate.SimpleTextOutput, + sizeof (mTerminalDevTemplate.SimpleTextOutput) + ); + SimpleTextOutput->Mode = &TerminalDevice->SimpleTextOutputMode; TerminalDevice->SimpleTextOutputMode.MaxMode = 3; // // For terminal devices, cursor is always visible // TerminalDevice->SimpleTextOutputMode.CursorVisible = TRUE; - Status = SimpleTextOutput.SetAttribute ( - &TerminalDevice->SimpleTextOutput, - EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK) - ); + Status = TerminalConOutSetAttribute ( + SimpleTextOutput, + EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK) + ); if (EFI_ERROR (Status)) { goto ReportError; } - Status = SimpleTextOutput.Reset ( - &TerminalDevice->SimpleTextOutput, - FALSE - ); + Status = TerminalConOutReset (SimpleTextOutput, FALSE); if (EFI_ERROR (Status)) { goto ReportError; } - Status = SimpleTextOutput.SetMode ( - &TerminalDevice->SimpleTextOutput, - 0 - ); + Status = TerminalConOutSetMode (SimpleTextOutput, 0); if (EFI_ERROR (Status)) { goto ReportError; } - Status = SimpleTextOutput.EnableCursor ( - &TerminalDevice->SimpleTextOutput, - TRUE - ); + Status = TerminalConOutEnableCursor (SimpleTextOutput, TRUE); if (EFI_ERROR (Status)) { goto ReportError; }