mirror of https://github.com/acidanthera/audk.git
Code scrub for Universal\Console\TerminalDxe.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7066 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
6c94a00d0e
commit
11baadb671
|
@ -16,7 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#include "Terminal.h"
|
#include "Terminal.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Translate all raw data in the Raw FIFI into unicode, and insert
|
Translate all raw data in the Raw FIFO into unicode, and insert
|
||||||
them into Unicode FIFO.
|
them into Unicode FIFO.
|
||||||
|
|
||||||
@param TerminalDevice The terminal device.
|
@param TerminalDevice The terminal device.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/** @file
|
/** @file
|
||||||
Produces Simple Text Input Protocl, Simple Text Input Extended Protocol and
|
Produces Simple Text Input Protocol, Simple Text Input Extended Protocol and
|
||||||
Simple Text Output Protocol upon Serial IO Protocol.
|
Simple Text Output Protocol upon Serial IO Protocol.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
|
@ -62,30 +62,30 @@ TERMINAL_DEV mTerminalDevTemplate = {
|
||||||
},
|
},
|
||||||
{ // SimpleTextOutputMode
|
{ // SimpleTextOutputMode
|
||||||
1, // MaxMode
|
1, // MaxMode
|
||||||
0, // Mode?
|
0, // Mode
|
||||||
EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK), // Attribute
|
EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK), // Attribute
|
||||||
0, // CursorColumn
|
0, // CursorColumn
|
||||||
0, // CursorRow
|
0, // CursorRow
|
||||||
TRUE // CursorVisible
|
TRUE // CursorVisible
|
||||||
},
|
},
|
||||||
0,
|
0, // SerialInTimeOut
|
||||||
{
|
{ // RawFiFo
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
{ 0 }
|
{ 0 }
|
||||||
},
|
},
|
||||||
{
|
{ // UnicodeFiFo
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
{ 0 }
|
{ 0 }
|
||||||
},
|
},
|
||||||
{
|
{ // EfiKeyFiFo
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
{ {0} }
|
{ {0} }
|
||||||
},
|
},
|
||||||
NULL, // ControllerNameTable
|
NULL, // ControllerNameTable
|
||||||
NULL,
|
NULL, // TwoSecondTimeOut
|
||||||
INPUT_STATE_DEFAULT,
|
INPUT_STATE_DEFAULT,
|
||||||
RESET_STATE_DEFAULT,
|
RESET_STATE_DEFAULT,
|
||||||
FALSE,
|
FALSE,
|
||||||
|
@ -97,27 +97,12 @@ TERMINAL_DEV mTerminalDevTemplate = {
|
||||||
TerminalConInRegisterKeyNotify,
|
TerminalConInRegisterKeyNotify,
|
||||||
TerminalConInUnregisterKeyNotify,
|
TerminalConInUnregisterKeyNotify,
|
||||||
},
|
},
|
||||||
{
|
{ // NotifyList
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Free notify functions list.
|
|
||||||
|
|
||||||
@param ListHead The list head
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS Free the notify list successfully.
|
|
||||||
@retval EFI_INVALID_PARAMETER ListHead is NULL.
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
TerminalFreeNotifyList (
|
|
||||||
IN OUT LIST_ENTRY *ListHead
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Test to see if this driver supports Controller.
|
Test to see if this driver supports Controller.
|
||||||
|
|
||||||
|
@ -266,6 +251,7 @@ TerminalDriverBindingStart (
|
||||||
UINTN EntryCount;
|
UINTN EntryCount;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||||
|
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOutput;
|
||||||
|
|
||||||
TerminalDevice = NULL;
|
TerminalDevice = NULL;
|
||||||
DefaultNode = NULL;
|
DefaultNode = NULL;
|
||||||
|
@ -504,23 +490,25 @@ TerminalDriverBindingStart (
|
||||||
//
|
//
|
||||||
// Simple Text Output Protocol
|
// Simple Text Output Protocol
|
||||||
//
|
//
|
||||||
TerminalDevice->SimpleTextOutput.Reset = TerminalConOutReset;
|
SimpleTextOutput = TerminalDevice->SimpleTextOutput;
|
||||||
TerminalDevice->SimpleTextOutput.OutputString = TerminalConOutOutputString;
|
|
||||||
TerminalDevice->SimpleTextOutput.TestString = TerminalConOutTestString;
|
SimpleTextOutput.Reset = TerminalConOutReset;
|
||||||
TerminalDevice->SimpleTextOutput.QueryMode = TerminalConOutQueryMode;
|
SimpleTextOutput.OutputString = TerminalConOutOutputString;
|
||||||
TerminalDevice->SimpleTextOutput.SetMode = TerminalConOutSetMode;
|
SimpleTextOutput.TestString = TerminalConOutTestString;
|
||||||
TerminalDevice->SimpleTextOutput.SetAttribute = TerminalConOutSetAttribute;
|
SimpleTextOutput.QueryMode = TerminalConOutQueryMode;
|
||||||
TerminalDevice->SimpleTextOutput.ClearScreen = TerminalConOutClearScreen;
|
SimpleTextOutput.SetMode = TerminalConOutSetMode;
|
||||||
TerminalDevice->SimpleTextOutput.SetCursorPosition = TerminalConOutSetCursorPosition;
|
SimpleTextOutput.SetAttribute = TerminalConOutSetAttribute;
|
||||||
TerminalDevice->SimpleTextOutput.EnableCursor = TerminalConOutEnableCursor;
|
SimpleTextOutput.ClearScreen = TerminalConOutClearScreen;
|
||||||
TerminalDevice->SimpleTextOutput.Mode = &TerminalDevice->SimpleTextOutputMode;
|
SimpleTextOutput.SetCursorPosition = TerminalConOutSetCursorPosition;
|
||||||
|
SimpleTextOutput.EnableCursor = TerminalConOutEnableCursor;
|
||||||
|
SimpleTextOutput.Mode = &TerminalDevice->SimpleTextOutputMode;
|
||||||
|
|
||||||
TerminalDevice->SimpleTextOutputMode.MaxMode = 3;
|
TerminalDevice->SimpleTextOutputMode.MaxMode = 3;
|
||||||
//
|
//
|
||||||
// For terminal devices, cursor is always visible
|
// For terminal devices, cursor is always visible
|
||||||
//
|
//
|
||||||
TerminalDevice->SimpleTextOutputMode.CursorVisible = TRUE;
|
TerminalDevice->SimpleTextOutputMode.CursorVisible = TRUE;
|
||||||
Status = TerminalDevice->SimpleTextOutput.SetAttribute (
|
Status = SimpleTextOutput.SetAttribute (
|
||||||
&TerminalDevice->SimpleTextOutput,
|
&TerminalDevice->SimpleTextOutput,
|
||||||
EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK)
|
EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK)
|
||||||
);
|
);
|
||||||
|
@ -528,7 +516,7 @@ TerminalDriverBindingStart (
|
||||||
goto ReportError;
|
goto ReportError;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = TerminalDevice->SimpleTextOutput.Reset (
|
Status = SimpleTextOutput.Reset (
|
||||||
&TerminalDevice->SimpleTextOutput,
|
&TerminalDevice->SimpleTextOutput,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
@ -536,7 +524,7 @@ TerminalDriverBindingStart (
|
||||||
goto ReportError;
|
goto ReportError;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = TerminalDevice->SimpleTextOutput.SetMode (
|
Status = SimpleTextOutput.SetMode (
|
||||||
&TerminalDevice->SimpleTextOutput,
|
&TerminalDevice->SimpleTextOutput,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
@ -544,7 +532,7 @@ TerminalDriverBindingStart (
|
||||||
goto ReportError;
|
goto ReportError;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = TerminalDevice->SimpleTextOutput.EnableCursor (
|
Status = SimpleTextOutput.EnableCursor (
|
||||||
&TerminalDevice->SimpleTextOutput,
|
&TerminalDevice->SimpleTextOutput,
|
||||||
TRUE
|
TRUE
|
||||||
);
|
);
|
||||||
|
@ -983,7 +971,7 @@ TerminalFreeNotifyList (
|
||||||
Update terminal device path in Console Device Environment Variables.
|
Update terminal device path in Console Device Environment Variables.
|
||||||
|
|
||||||
@param VariableName The Console Device Environment Variable.
|
@param VariableName The Console Device Environment Variable.
|
||||||
@param ParentDevicePath The terminal devcie path to be updated.
|
@param ParentDevicePath The terminal device path to be updated.
|
||||||
|
|
||||||
@return None.
|
@return None.
|
||||||
|
|
||||||
|
@ -1048,7 +1036,7 @@ TerminalUpdateConsoleDevVariable (
|
||||||
Remove terminal device path from Console Device Environment Variables.
|
Remove terminal device path from Console Device Environment Variables.
|
||||||
|
|
||||||
@param VariableName Console Device Environment Variables.
|
@param VariableName Console Device Environment Variables.
|
||||||
@param ParentDevicePath The terminal devcie path to be updated.
|
@param ParentDevicePath The terminal device path to be updated.
|
||||||
|
|
||||||
@return None.
|
@return None.
|
||||||
|
|
||||||
|
@ -1112,7 +1100,7 @@ TerminalRemoveConsoleDevVariable (
|
||||||
SetTerminalDevicePath (TerminalType, ParentDevicePath, &TempDevicePath);
|
SetTerminalDevicePath (TerminalType, ParentDevicePath, &TempDevicePath);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Compare the genterated device path to the current device path instance
|
// Compare the generated device path to the current device path instance
|
||||||
//
|
//
|
||||||
if (TempDevicePath != NULL) {
|
if (TempDevicePath != NULL) {
|
||||||
if (CompareMem (Instance, TempDevicePath, InstanceSize) == 0) {
|
if (CompareMem (Instance, TempDevicePath, InstanceSize) == 0) {
|
||||||
|
@ -1172,8 +1160,8 @@ TerminalRemoveConsoleDevVariable (
|
||||||
@param VariableSize Returns the size of the EFI variable that was read
|
@param VariableSize Returns the size of the EFI variable that was read
|
||||||
|
|
||||||
@return Dynamically allocated memory that contains a copy of the EFI variable.
|
@return Dynamically allocated memory that contains a copy of the EFI variable.
|
||||||
Caller is repsoncible freeing the buffer. If variable was not read,
|
Caller is responsible freeing the buffer. If variable was not read,
|
||||||
NULL regturned.
|
NULL returned.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID *
|
VOID *
|
||||||
|
@ -1238,10 +1226,10 @@ TerminalGetVariableAndSize (
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Build termial device path according to terminal type.
|
Build terminal device path according to terminal type.
|
||||||
|
|
||||||
@param TerminalType The terminal type is PC ANSI, VT100, VT100+ or VT-UTF8.
|
@param TerminalType The terminal type is PC ANSI, VT100, VT100+ or VT-UTF8.
|
||||||
@param ParentDevicePath Parent devcie path.
|
@param ParentDevicePath Parent device path.
|
||||||
@param TerminalDevicePath Returned terminal device path, if building successfully.
|
@param TerminalDevicePath Returned terminal device path, if building successfully.
|
||||||
|
|
||||||
@retval EFI_UNSUPPORTED Terminal does not belong to the supported type.
|
@retval EFI_UNSUPPORTED Terminal does not belong to the supported type.
|
||||||
|
@ -1324,7 +1312,7 @@ InitializeRawFiFo (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Make the raw fifo empty.
|
// Make the raw FIFO empty.
|
||||||
//
|
//
|
||||||
TerminalDevice->RawFiFo.Head = TerminalDevice->RawFiFo.Tail;
|
TerminalDevice->RawFiFo.Head = TerminalDevice->RawFiFo.Tail;
|
||||||
}
|
}
|
||||||
|
@ -1343,7 +1331,7 @@ InitializeUnicodeFiFo (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Make the unicode fifo empty
|
// Make the unicode FIFO empty
|
||||||
//
|
//
|
||||||
TerminalDevice->UnicodeFiFo.Head = TerminalDevice->UnicodeFiFo.Tail;
|
TerminalDevice->UnicodeFiFo.Head = TerminalDevice->UnicodeFiFo.Tail;
|
||||||
}
|
}
|
||||||
|
@ -1362,7 +1350,7 @@ InitializeEfiKeyFiFo (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Make the efi key fifo empty
|
// Make the efi key FIFO empty
|
||||||
//
|
//
|
||||||
TerminalDevice->EfiKeyFiFo.Head = TerminalDevice->EfiKeyFiFo.Tail;
|
TerminalDevice->EfiKeyFiFo.Head = TerminalDevice->EfiKeyFiFo.Tail;
|
||||||
}
|
}
|
||||||
|
@ -1400,6 +1388,5 @@ InitializeTerminal(
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -265,7 +265,7 @@ TerminalConInWaitForKeyEx (
|
||||||
//
|
//
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reset the input device and optionaly run diagnostics
|
Reset the input device and optionally run diagnostics
|
||||||
|
|
||||||
@param This Protocol instance pointer.
|
@param This Protocol instance pointer.
|
||||||
@param ExtendedVerification Driver may perform diagnostics on reset.
|
@param ExtendedVerification Driver may perform diagnostics on reset.
|
||||||
|
@ -284,7 +284,7 @@ TerminalConInResetEx (
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reads the next keystroke from the input device. The WaitForKey Event can
|
Reads the next keystroke from the input device. The WaitForKey Event can
|
||||||
be used to test for existance of a keystroke via WaitForEvent () call.
|
be used to test for existence of a keystroke via WaitForEvent () call.
|
||||||
|
|
||||||
@param This Protocol instance pointer.
|
@param This Protocol instance pointer.
|
||||||
@param KeyData A pointer to a buffer that is filled in with the
|
@param KeyData A pointer to a buffer that is filled in with the
|
||||||
|
@ -292,7 +292,7 @@ TerminalConInResetEx (
|
||||||
pressed.
|
pressed.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The keystroke information was returned.
|
@retval EFI_SUCCESS The keystroke information was returned.
|
||||||
@retval EFI_NOT_READY There was no keystroke data availiable.
|
@retval EFI_NOT_READY There was no keystroke data available.
|
||||||
@retval EFI_DEVICE_ERROR The keystroke information was not returned due
|
@retval EFI_DEVICE_ERROR The keystroke information was not returned due
|
||||||
to hardware errors.
|
to hardware errors.
|
||||||
@retval EFI_INVALID_PARAMETER KeyData is NULL.
|
@retval EFI_INVALID_PARAMETER KeyData is NULL.
|
||||||
|
@ -652,6 +652,20 @@ TerminalDriverBindingStop (
|
||||||
IN EFI_HANDLE *ChildHandleBuffer
|
IN EFI_HANDLE *ChildHandleBuffer
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Free notify functions list.
|
||||||
|
|
||||||
|
@param ListHead The list head
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS Free the notify list successfully.
|
||||||
|
@retval EFI_INVALID_PARAMETER ListHead is NULL.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
TerminalFreeNotifyList (
|
||||||
|
IN OUT LIST_ENTRY *ListHead
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Retrieves a Unicode string that is the user readable name of the driver.
|
Retrieves a Unicode string that is the user readable name of the driver.
|
||||||
|
|
||||||
|
@ -790,7 +804,7 @@ TerminalComponentNameGetControllerName (
|
||||||
|
|
||||||
@retval EFI_SUCCESS There is key pending.
|
@retval EFI_SUCCESS There is key pending.
|
||||||
@retval EFI_NOT_READY There is no key pending.
|
@retval EFI_NOT_READY There is no key pending.
|
||||||
@retval EFI_DEVICE_ERROR If Serial IO is not attched to serial device.
|
@retval EFI_DEVICE_ERROR If Serial IO is not attached to serial device.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
@ -802,7 +816,7 @@ TerminalConInCheckForKey (
|
||||||
Update terminal device path in Console Device Environment Variables.
|
Update terminal device path in Console Device Environment Variables.
|
||||||
|
|
||||||
@param VariableName The Console Device Environment Variable.
|
@param VariableName The Console Device Environment Variable.
|
||||||
@param ParentDevicePath The terminal devcie path to be updated.
|
@param ParentDevicePath The terminal device path to be updated.
|
||||||
|
|
||||||
@return None.
|
@return None.
|
||||||
|
|
||||||
|
@ -852,7 +866,7 @@ TerminalGetVariableAndSize (
|
||||||
Build termial device path according to terminal type.
|
Build termial device path according to terminal type.
|
||||||
|
|
||||||
@param TerminalType The terminal type is PC ANSI, VT100, VT100+ or VT-UTF8.
|
@param TerminalType The terminal type is PC ANSI, VT100, VT100+ or VT-UTF8.
|
||||||
@param ParentDevicePath Parent devcie path.
|
@param ParentDevicePath Parent device path.
|
||||||
@param TerminalDevicePath Returned terminal device path, if building successfully.
|
@param TerminalDevicePath Returned terminal device path, if building successfully.
|
||||||
|
|
||||||
@retval EFI_UNSUPPORTED Terminal does not belong to the supported type.
|
@retval EFI_UNSUPPORTED Terminal does not belong to the supported type.
|
||||||
|
|
|
@ -17,7 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reads the next keystroke from the input device. The WaitForKey Event can
|
Reads the next keystroke from the input device. The WaitForKey Event can
|
||||||
be used to test for existance of a keystroke via WaitForEvent () call.
|
be used to test for existence of a keystroke via WaitForEvent () call.
|
||||||
|
|
||||||
@param TerminalDevice Terminal driver private structure
|
@param TerminalDevice Terminal driver private structure
|
||||||
@param KeyData A pointer to a buffer that is filled in with the
|
@param KeyData A pointer to a buffer that is filled in with the
|
||||||
|
@ -25,7 +25,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
pressed.
|
pressed.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The keystroke information was returned.
|
@retval EFI_SUCCESS The keystroke information was returned.
|
||||||
@retval EFI_NOT_READY There was no keystroke data availiable.
|
@retval EFI_NOT_READY There was no keystroke data available.
|
||||||
@retval EFI_DEVICE_ERROR The keystroke information was not returned due
|
@retval EFI_DEVICE_ERROR The keystroke information was not returned due
|
||||||
to hardware errors.
|
to hardware errors.
|
||||||
@retval EFI_INVALID_PARAMETER KeyData is NULL.
|
@retval EFI_INVALID_PARAMETER KeyData is NULL.
|
||||||
|
@ -39,6 +39,7 @@ ReadKeyStrokeWorker (
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
LIST_ENTRY *Link;
|
LIST_ENTRY *Link;
|
||||||
|
LIST_ENTRY *NotifyList;
|
||||||
TERMINAL_CONSOLE_IN_EX_NOTIFY *CurrentNotify;
|
TERMINAL_CONSOLE_IN_EX_NOTIFY *CurrentNotify;
|
||||||
|
|
||||||
if (KeyData == NULL) {
|
if (KeyData == NULL) {
|
||||||
|
@ -66,7 +67,8 @@ ReadKeyStrokeWorker (
|
||||||
//
|
//
|
||||||
// Invoke notification functions if exist
|
// Invoke notification functions if exist
|
||||||
//
|
//
|
||||||
for (Link = TerminalDevice->NotifyList.ForwardLink; Link != &TerminalDevice->NotifyList; Link = Link->ForwardLink) {
|
NotifyList = &TerminalDevice->NotifyList;
|
||||||
|
for (Link = GetFirstNode (NotifyList); !IsNull (NotifyList,Link); Link = GetNextNode (NotifyList,Link)) {
|
||||||
CurrentNotify = CR (
|
CurrentNotify = CR (
|
||||||
Link,
|
Link,
|
||||||
TERMINAL_CONSOLE_IN_EX_NOTIFY,
|
TERMINAL_CONSOLE_IN_EX_NOTIFY,
|
||||||
|
@ -178,6 +180,8 @@ TerminalConInReadKeyStroke (
|
||||||
/**
|
/**
|
||||||
Check if the key already has been registered.
|
Check if the key already has been registered.
|
||||||
|
|
||||||
|
If both RegsiteredData and InputData is NULL, then ASSERT().
|
||||||
|
|
||||||
@param RegsiteredData A pointer to a buffer that is filled in with the
|
@param RegsiteredData A pointer to a buffer that is filled in with the
|
||||||
keystroke state data for the key that was
|
keystroke state data for the key that was
|
||||||
registered.
|
registered.
|
||||||
|
@ -237,7 +241,7 @@ TerminalConInWaitForKeyEx (
|
||||||
//
|
//
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reset the input device and optionaly run diagnostics
|
Reset the input device and optionally run diagnostics
|
||||||
|
|
||||||
@param This Protocol instance pointer.
|
@param This Protocol instance pointer.
|
||||||
@param ExtendedVerification Driver may perform diagnostics on reset.
|
@param ExtendedVerification Driver may perform diagnostics on reset.
|
||||||
|
@ -271,7 +275,7 @@ TerminalConInResetEx (
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reads the next keystroke from the input device. The WaitForKey Event can
|
Reads the next keystroke from the input device. The WaitForKey Event can
|
||||||
be used to test for existance of a keystroke via WaitForEvent () call.
|
be used to test for existence of a keystroke via WaitForEvent () call.
|
||||||
|
|
||||||
@param This Protocol instance pointer.
|
@param This Protocol instance pointer.
|
||||||
@param KeyData A pointer to a buffer that is filled in with the
|
@param KeyData A pointer to a buffer that is filled in with the
|
||||||
|
@ -279,7 +283,7 @@ TerminalConInResetEx (
|
||||||
pressed.
|
pressed.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The keystroke information was returned.
|
@retval EFI_SUCCESS The keystroke information was returned.
|
||||||
@retval EFI_NOT_READY There was no keystroke data availiable.
|
@retval EFI_NOT_READY There was no keystroke data available.
|
||||||
@retval EFI_DEVICE_ERROR The keystroke information was not returned due
|
@retval EFI_DEVICE_ERROR The keystroke information was not returned due
|
||||||
to hardware errors.
|
to hardware errors.
|
||||||
@retval EFI_INVALID_PARAMETER KeyData is NULL.
|
@retval EFI_INVALID_PARAMETER KeyData is NULL.
|
||||||
|
@ -349,7 +353,7 @@ TerminalConInSetState (
|
||||||
|
|
||||||
@retval EFI_SUCCESS The notification function was registered
|
@retval EFI_SUCCESS The notification function was registered
|
||||||
successfully.
|
successfully.
|
||||||
@retval EFI_OUT_OF_RESOURCES Unable to allocate resources for necesssary data
|
@retval EFI_OUT_OF_RESOURCES Unable to allocate resources for necessary data
|
||||||
structures.
|
structures.
|
||||||
@retval EFI_INVALID_PARAMETER KeyData or NotifyHandle is NULL.
|
@retval EFI_INVALID_PARAMETER KeyData or NotifyHandle is NULL.
|
||||||
|
|
||||||
|
@ -367,6 +371,7 @@ TerminalConInRegisterKeyNotify (
|
||||||
TERMINAL_DEV *TerminalDevice;
|
TERMINAL_DEV *TerminalDevice;
|
||||||
TERMINAL_CONSOLE_IN_EX_NOTIFY *NewNotify;
|
TERMINAL_CONSOLE_IN_EX_NOTIFY *NewNotify;
|
||||||
LIST_ENTRY *Link;
|
LIST_ENTRY *Link;
|
||||||
|
LIST_ENTRY *NotifyList;
|
||||||
TERMINAL_CONSOLE_IN_EX_NOTIFY *CurrentNotify;
|
TERMINAL_CONSOLE_IN_EX_NOTIFY *CurrentNotify;
|
||||||
|
|
||||||
if (KeyData == NULL || NotifyHandle == NULL || KeyNotificationFunction == NULL) {
|
if (KeyData == NULL || NotifyHandle == NULL || KeyNotificationFunction == NULL) {
|
||||||
|
@ -378,7 +383,8 @@ TerminalConInRegisterKeyNotify (
|
||||||
//
|
//
|
||||||
// Return EFI_SUCCESS if the (KeyData, NotificationFunction) is already registered.
|
// Return EFI_SUCCESS if the (KeyData, NotificationFunction) is already registered.
|
||||||
//
|
//
|
||||||
for (Link = TerminalDevice->NotifyList.ForwardLink; Link != &TerminalDevice->NotifyList; Link = Link->ForwardLink) {
|
NotifyList = &TerminalDevice->NotifyList;
|
||||||
|
for (Link = GetFirstNode (NotifyList); !IsNull (NotifyList,Link); Link = GetNextNode (NotifyList,Link)) {
|
||||||
CurrentNotify = CR (
|
CurrentNotify = CR (
|
||||||
Link,
|
Link,
|
||||||
TERMINAL_CONSOLE_IN_EX_NOTIFY,
|
TERMINAL_CONSOLE_IN_EX_NOTIFY,
|
||||||
|
@ -445,6 +451,7 @@ TerminalConInUnregisterKeyNotify (
|
||||||
TERMINAL_DEV *TerminalDevice;
|
TERMINAL_DEV *TerminalDevice;
|
||||||
LIST_ENTRY *Link;
|
LIST_ENTRY *Link;
|
||||||
TERMINAL_CONSOLE_IN_EX_NOTIFY *CurrentNotify;
|
TERMINAL_CONSOLE_IN_EX_NOTIFY *CurrentNotify;
|
||||||
|
LIST_ENTRY *NotifyList;
|
||||||
|
|
||||||
if (NotificationHandle == NULL) {
|
if (NotificationHandle == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
|
@ -464,7 +471,8 @@ TerminalConInUnregisterKeyNotify (
|
||||||
|
|
||||||
TerminalDevice = TERMINAL_CON_IN_EX_DEV_FROM_THIS (This);
|
TerminalDevice = TERMINAL_CON_IN_EX_DEV_FROM_THIS (This);
|
||||||
|
|
||||||
for (Link = TerminalDevice->NotifyList.ForwardLink; Link != &TerminalDevice->NotifyList; Link = Link->ForwardLink) {
|
NotifyList = &TerminalDevice->NotifyList;
|
||||||
|
for (Link = GetFirstNode (NotifyList); !IsNull (NotifyList,Link); Link = GetNextNode (NotifyList,Link)) {
|
||||||
CurrentNotify = CR (
|
CurrentNotify = CR (
|
||||||
Link,
|
Link,
|
||||||
TERMINAL_CONSOLE_IN_EX_NOTIFY,
|
TERMINAL_CONSOLE_IN_EX_NOTIFY,
|
||||||
|
@ -568,7 +576,7 @@ TerminalConInWaitForKey (
|
||||||
|
|
||||||
@retval EFI_SUCCESS There is key pending.
|
@retval EFI_SUCCESS There is key pending.
|
||||||
@retval EFI_NOT_READY There is no key pending.
|
@retval EFI_NOT_READY There is no key pending.
|
||||||
@retval EFI_DEVICE_ERROR If Serial IO is not attched to serial device.
|
@retval EFI_DEVICE_ERROR If Serial IO is not attached to serial device.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
@ -682,7 +690,7 @@ TerminalConInCheckForKey (
|
||||||
/**
|
/**
|
||||||
Get one key out of serial buffer.
|
Get one key out of serial buffer.
|
||||||
|
|
||||||
@param SerialIo Serial I/O protocl attached to the serial device.
|
@param SerialIo Serial I/O protocol attached to the serial device.
|
||||||
@param Output The fetched key.
|
@param Output The fetched key.
|
||||||
|
|
||||||
@return EFI_NOT_READY If serial buffer is empty.
|
@return EFI_NOT_READY If serial buffer is empty.
|
||||||
|
@ -1123,32 +1131,35 @@ UnicodeToEfiKeyFlushState (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_INPUT_KEY Key;
|
EFI_INPUT_KEY Key;
|
||||||
|
UINT32 InputState;
|
||||||
|
|
||||||
if ((TerminalDevice->InputState & INPUT_STATE_ESC) != 0) {
|
InputState = TerminalDevice->InputState;
|
||||||
|
|
||||||
|
if ((InputState & INPUT_STATE_ESC) != 0) {
|
||||||
Key.ScanCode = SCAN_ESC;
|
Key.ScanCode = SCAN_ESC;
|
||||||
Key.UnicodeChar = 0;
|
Key.UnicodeChar = 0;
|
||||||
EfiKeyFiFoInsertOneKey (TerminalDevice, Key);
|
EfiKeyFiFoInsertOneKey (TerminalDevice, Key);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((TerminalDevice->InputState & INPUT_STATE_CSI) != 0) {
|
if ((InputState & INPUT_STATE_CSI) != 0) {
|
||||||
Key.ScanCode = SCAN_NULL;
|
Key.ScanCode = SCAN_NULL;
|
||||||
Key.UnicodeChar = CSI;
|
Key.UnicodeChar = CSI;
|
||||||
EfiKeyFiFoInsertOneKey (TerminalDevice, Key);
|
EfiKeyFiFoInsertOneKey (TerminalDevice, Key);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((TerminalDevice->InputState & INPUT_STATE_LEFTOPENBRACKET) != 0) {
|
if ((InputState & INPUT_STATE_LEFTOPENBRACKET) != 0) {
|
||||||
Key.ScanCode = SCAN_NULL;
|
Key.ScanCode = SCAN_NULL;
|
||||||
Key.UnicodeChar = LEFTOPENBRACKET;
|
Key.UnicodeChar = LEFTOPENBRACKET;
|
||||||
EfiKeyFiFoInsertOneKey (TerminalDevice, Key);
|
EfiKeyFiFoInsertOneKey (TerminalDevice, Key);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((TerminalDevice->InputState & INPUT_STATE_O) != 0) {
|
if ((InputState & INPUT_STATE_O) != 0) {
|
||||||
Key.ScanCode = SCAN_NULL;
|
Key.ScanCode = SCAN_NULL;
|
||||||
Key.UnicodeChar = 'O';
|
Key.UnicodeChar = 'O';
|
||||||
EfiKeyFiFoInsertOneKey (TerminalDevice, Key);
|
EfiKeyFiFoInsertOneKey (TerminalDevice, Key);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((TerminalDevice->InputState & INPUT_STATE_2) != 0) {
|
if ((InputState & INPUT_STATE_2) != 0) {
|
||||||
Key.ScanCode = SCAN_NULL;
|
Key.ScanCode = SCAN_NULL;
|
||||||
Key.UnicodeChar = '2';
|
Key.UnicodeChar = '2';
|
||||||
EfiKeyFiFoInsertOneKey (TerminalDevice, Key);
|
EfiKeyFiFoInsertOneKey (TerminalDevice, Key);
|
||||||
|
@ -1173,7 +1184,7 @@ UnicodeToEfiKeyFlushState (
|
||||||
|
|
||||||
The table below shows the keyboard input mappings that this function supports.
|
The table below shows the keyboard input mappings that this function supports.
|
||||||
If the ESC sequence listed in one of the columns is presented, then it is translated
|
If the ESC sequence listed in one of the columns is presented, then it is translated
|
||||||
into the coorespoding EFI Scan Code. If a matching sequence is not found, then the raw
|
into the corresponding EFI Scan Code. If a matching sequence is not found, then the raw
|
||||||
key strokes are converted into EFI Keys.
|
key strokes are converted into EFI Keys.
|
||||||
|
|
||||||
2 seconds are allowed for an ESC sequence to be completed. If the ESC sequence is not
|
2 seconds are allowed for an ESC sequence to be completed. If the ESC sequence is not
|
||||||
|
|
|
@ -540,7 +540,7 @@ TerminalConOutSetAttribute (
|
||||||
|
|
||||||
//
|
//
|
||||||
// Skip outputting the command string for the same attribute
|
// Skip outputting the command string for the same attribute
|
||||||
// It improves the terminal performance siginificantly
|
// It improves the terminal performance significantly
|
||||||
//
|
//
|
||||||
if (This->Mode->Attribute == (INT32) Attribute) {
|
if (This->Mode->Attribute == (INT32) Attribute) {
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
#/** @file
|
#/** @file
|
||||||
|
#
|
||||||
# Component description file for Terminal module.
|
# Component description file for Terminal module.
|
||||||
#
|
#
|
||||||
# This driver installs Simple Text In/Out protocol for terminal devices (serial devices or hotplug devices).
|
# This driver installs Simple Text In/Out protocol for terminal devices (serial devices or hotplug devices).
|
||||||
# Copyright (c) 2006 - 2008, Intel Corporation
|
|
||||||
#
|
#
|
||||||
|
# Copyright (c) 2006 - 2008, Intel Corporation
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
# which accompanies this distribution. The full text of the license may be found at
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
|
|
Loading…
Reference in New Issue