diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-12-17 12:07:02 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-12-17 12:07:02 +0000 |
commit | c4f9201e2ea87f0dc56750c9366271ed8819c73a (patch) | |
tree | e9bd2aaf53afc0fe35d0024ddd96a3005757ab0b /MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c | |
parent | 4e16d2cd28f3b3cc9d35f7c3576c410c9bf30ccd (diff) | |
download | edk2-c4f9201e2ea87f0dc56750c9366271ed8819c73a.zip edk2-c4f9201e2ea87f0dc56750c9366271ed8819c73a.tar.gz edk2-c4f9201e2ea87f0dc56750c9366271ed8819c73a.tar.bz2 |
Refine code to remove structure assignment
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7070 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c')
-rw-r--r-- | MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c | 47 |
1 files changed, 16 insertions, 31 deletions
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c index ac1e388..6fd19de 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
- //
- 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;
+ // Set Simple Text Output Protocol from template.
+ //
+ 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;
}
|