summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Console/TerminalDxe
AgeCommit message (Collapse)AuthorFilesLines
2024-04-03MdeModulePkg: Update the comments of ReadKeyStroke and ReadKeyStrokeExQingyu2-0/+8
Refer to Uefi spec 2.10 section 12.3.3, Add a new retval EFI_UNSUPPORTED to EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.ReadKeyStrokeEx and EFI_SIMPLE_TEXT_INPUT_PROTOCOL.ReadKeyStroke(). Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Qingyu <qingyu.shang@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-12-07MdeModulePkg: Apply uncrustify changesMichael Kubacki7-1558/+1580
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdeModulePkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-12-07MdeModulePkg: Change complex DEBUG_CODE() to DEBUG_CODE_BEGIN/END()Michael D Kinney1-3/+2
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3767 Update use of DEBUG_CODE(Expression) if Expression is a complex code block with if/while/for/case statements that use {}. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-12-07MdeModulePkg: Change OPTIONAL keyword usage styleMichael D Kinney2-2/+2
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3760 Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-12-07MdeModulePkg: Change use of EFI_D_* to DEBUG_*Michael D Kinney1-1/+1
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3739 Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2021-02-03MdeModulePkg/TerminalDxe: Terminal fifo buffer overflow.gechao1-1/+1
Fix the bug of terminal fifo buffer overflow with UINT8 type. typedef struct { UINT8 Head; UINT8 Tail; UINT8 Data[RAW_FIFO_MAX_NUMBER + 1]; } RAW_DATA_FIFO; RAW_FIFO_MAX_NUMBER is 256. the data buffer size is 257 (Index from 0 to 256), but the max value of the index, Head or Tail (UINT8), is 255. That means the last data of the data buffer would be always empty if we use Head/Tail to output/input the data correctly. And because of the incorrect buffer size the FIFO full check "((Tail + 1) % (RAW_FIFO_MAX_NUMBER + 1)) == Head" would never meet. Signed-off-by: gechao <gechao@greatwall.com.cn> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
2019-09-27MdeModulePkg/TerminalDxe: Enhance the arrow keys supportGao, Zhichao1-2/+6
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2219 First previous patch remove the VT100Plus's arrow keys' support. Add it back. The arrow keys would send ESC [A through to ESC [D. Add this support for the new introduced terminal type. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2019-09-24MdeModulePkg/TerminalDxe: Extend the terminal console support typesZhichao Gao5-26/+320
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2186 Extend the support types of terminal console driver. New added types are Linux, XtermR6, VT400 and SCO. Refer to https://www.ssh.com/ssh/putty/putty-manuals/0.68/Chapter4.html#config-funkeys Add the missing VT100+ function keys map. Add F1-F12 function keys map for Linux, XtermR6, VT400 and SCO. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2019-04-09MdeModulePkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney10-67/+10
https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2018-09-14MdeModulePkg: Avoid key notification called more than onceDandan Bi1-0/+1
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=996 Issue: In current code logic, when a key is pressed, it will search the whole NotifyList to find whether a notification has been registered with the keystroke. if yes, it will en-queue the key for notification execution later. And now if different notification functions have been registered with the same key, then the key will be en-queued more than once. Then it will cause the notification executed more than once. This patch is to enhance the code logic to fix this issue. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-09-06MdeModulePkg: Removing ipf which is no longer supported from edk2.Chen A Chen1-2/+2
Removing rules for Ipf sources file: * Remove the source file which path with "ipf" and also listed in [Sources.IPF] section of INF file. * Remove the source file which listed in [Components.IPF] section of DSC file and not listed in any other [Components] section. * Remove the embedded Ipf code for MDE_CPU_IPF. Removing rules for Inf file: * Remove IPF from VALID_ARCHITECTURES comments. * Remove DXE_SAL_DRIVER from LIBRARY_CLASS in [Defines] section. * Remove the INF which only listed in [Components.IPF] section in DSC. * Remove statements from [BuildOptions] that provide IPF specific flags. * Remove any IPF sepcific sections. Removing rules for Dec file: * Remove [Includes.IPF] section from Dec. Removing rules for Dsc file: * Remove IPF from SUPPORTED_ARCHITECTURES in [Defines] section of DSC. * Remove any IPF specific sections. * Remove statements from [BuildOptions] that provide IPF specific flags. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chen A Chen <chen.a.chen@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-08-21MdeModulePkg TerminalDxe: Remove a redundant functionshenglei2-37/+0
The function UnicodeFiFoGetKeyCount that is never called has been removed. https://bugzilla.tianocore.org/show_bug.cgi?id=1062 Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: shenglei <shenglei.zhang@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2018-06-28MdeModulePkg: Clean up source filesLiming Gao6-34/+34
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-05-03MdeModulePkg/Terminal: Check status of OpenProtocol in BindingStartRuiyu Ni1-1/+7
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=917 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Steven Shi <steven.shi@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-03-06MdeModulePkg/Terminal: ReadKeyStrokeEx always return key stateRuiyu Ni1-5/+4
Because terminal doesn't support shift and toggle key state, ReadKeyStrokeEx just sets the two states to 0. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-11-13MdeModulePkg/TerminalDxe: Fix PCANSI mapping for TRIANGLE and ARROWMichael D Kinney1-9/+9
https://bugzilla.tianocore.org/show_bug.cgi?id=761 When a TerminalType is set to PCANSI, characters in the range 0x00 to 0x1F are control characters. The mapping table for PCANSI maps TRIANGLE glyphs, ARROW_UP glyph, and ARROW_DOWN glyph into this control character range and that causes no characters to be displayed by PCANSI compatible terminal emulators. The mappings are updated so these glyphs are mapped to ANSI characters in the range 0x20 to 0x7E. GEOMETRICSHAPE_UP_TRIANGLE '^' GEOMETRICSHAPE_RIGHT_TRIANGLE '>' GEOMETRICSHAPE_DOWN_TRIANGLE 'v' GEOMETRICSHAPE_LEFT_TRIANGLE '<' ARROW_UP '^' ARROW_DOWN 'v' Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
2017-06-20MdeModulePkg: Update comments in SimpleTextInEx according to UEFI 2.7Dandan Bi2-6/+12
v2: Add some missing changes Ps2KeyboardDxe. Cc: Star Zeng <star.zeng@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2017-04-20MdeModulePkg/TerminalDxe: Avoid always append device path to *DevRuiyu Ni1-8/+59
When TerminalDxe Start() is called multiple times, the old logic unconditionally appended the terminal device path candidates to *Dev (ConInDev/ConOutDev/ErrOutDev), resulting the volatile storage is full. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-01-16MdeModulePkg/TerminalDxe: Refine SetTerminalDevicePathHao Wu1-1/+1
Pass '&Node.Header' instead of '&Node' as the 1st parameter to function SetDevicePathNodeLength(). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2017-01-13MdeModulePkg/TerminalDxe: Remove out-of-dated commentsRuiyu Ni1-5/+0
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
2017-01-11MdeModulePkg/TerminalDxe: Fix driver model bugRuiyu Ni1-663/+281
TerminalDxe driver contains bugs in its DriverBindingStart(): 1. It cannot be started AGAIN using a different terminal type; 2. It doesn't install SimpleTextInput/SimpleTextOut when ConIn/ConOut doesn't contain its device path. The check is duplicated of the same logic in ConPlatform driver and can be removed. The patch optimized the code to remove the unnecessary gEfiCallerIdGuid protocol installation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-01-11MdeModulePkg/TerminalDxe: Remove unnecessary NULL pointer checkRuiyu Ni1-7/+2
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-01-11MdeModulePkg/TerminalDxe: Separate state machine start/stop logicRuiyu Ni1-26/+59
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-01-11MdeModulePkg/TerminalDxe: Refine SetTerminalDevicePathRuiyu Ni1-38/+3
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-01-11MdeModulePkg/TerminalDxe: Refine InitializeTerminalConsoleTextModeRuiyu Ni1-82/+26
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-01-11MdeModulePkg/TerminalDxe: Separate controller name init logicRuiyu Ni1-91/+56
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-01-11MdeModulePkg/TerminalDxe: Add TerminalTypeFromGuid internal functionRuiyu Ni1-26/+29
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-01-11MdeModulePkg/TerminalDxe: Replace macro with enum for terminal typesRuiyu Ni4-97/+100
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-12-26MdeModulePkg TerminalDxe: Execute key notify func at TPL_CALLBACKStar Zeng3-7/+284
Current implementation executes key notify function in TimerHandler at TPL_NOTIFY. The code change is to make key notify function executed at TPL_CALLBACK to reduce the time occupied at TPL_NOTIFY. The code will signal KeyNotify process event if the key pressed matches any key registered and insert the KeyData to the EFI Key queue for notify, then the KeyNotify process handler will invoke key notify functions at TPL_CALLBACK. Cc: Ruiyu Ni <Ruiyu.ni@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
2016-12-20MdeModulePkg/TerminalDxe: Initialize variable after declarationDandan Bi1-1/+3
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-10-27MdeModulePkg/TerminalDxe: Fix IA32 VS2015x86 build breakMichael Kinney1-3/+3
https://bugzilla.tianocore.org/show_bug.cgi?id=190 The issue is with signed/unsigned comparisons between Mode->CursorRow and Row and Mode->CursorColumn and Column. The fix is to add typecast to UINTN for comparisons. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Brian Johnson <bjohnson@sgi.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Brian Johnson <bjohnson@sgi.com>
2016-10-27MdeModulePkg/Universal: Fix typos in commentsGary Lin1-1/+1
- stardard -> standard - doule -> double - defalut -> default - Pacakge -> Package - globa -> global - responsiblity -> responsibility - outputed -> outputted - specifiecd -> specified - Resuts -> Results - the a -> a - suported -> supported - assocated -> associated - TURE -> TRUE - successfull -> successfully - excute -> execute - reseting -> resetting - Retrive -> Retrieve - funciton -> function - paramter -> parameter - dependecy -> dependency - boundry -> boundary - permenantly -> permanently Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-10-27MdeModulePkg/TerminalDxe: Handle more keys with TtyTermBrian J. Johnson1-3/+21
The TtyTerm terminal driver is missing support for sequences produced by the page up, page down, insert, home, and end keys in some terimnal emulators. Add them. Tested under Ubuntu 16.04 using xterm 322-1ubuntu1, GNOME terminal 3.18.3-1ubuntu1, and XFCE terminal 0.6.3-2ubuntu1. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Kyle Roberts <kyroberts@sgi.com> Signed-off-by: Brian Johnson <bjohnson@sgi.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Roy Franz <roy.franz@hpe.com> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-10-27MdeModulePkg/TerminalDxe: Optimize TtyTerm cursor motionBrian J. Johnson2-5/+33
For TtyTerm terminals, output a shorter escape sequence when possible to move the cursor within the current line, and don't print any escape sequence if the cursor is already at the correct position. This removes extra cursor motion activity at the EFI shell prompt, improving performance. It also makes it possible in many cases to successfully use a terminal window which is taller than the driver's mode setting (eg. 80x25.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brian Johnson <bjohnson@sgi.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-10-27MdeModulePkg/TerminalDxe: Improve TtyTerm cursor position trackingBrian J. Johnson1-0/+25
When we print the last character on a line, the terminal driver wraps CursorRow/CursorColumn to the beginning of the next line. But the terminal itself doesn't wrap its cursor until the next character is printed. That throws off the driver's cursor position tracking. So when we have printed the last character on a line, and are not in the middle of outputing an escape sequence, synchronize the terminal with the driver by outputing CR+LF. This matches the expected behavior, and the behavior of the VGA console driver. Only change the behavior of TtyTerm, not the other terminal types. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brian Johnson <bjohnson@sgi.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-04-01Revert "TerminalDxe: select the UART's default receive FIFO depth"Ruiyu Ni2-2/+2
This reverts commit 31ae446b1a039a55d0336f2201d77d1032533413. Changing the receive FIFO depth in Terminal driver Start() is not recommended. A new PCD PcdUartDefaultReceiveFifoDepth was added and MdeModulePkg/SerialDxe driver uses the PCD as the default receive FIFO depth. Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
2016-01-21MdeModulePkg: TerminalDxe: select the UART's default receive FIFO depthLaszlo Ersek2-2/+2
The Serial IO protocol instances provided by SerialDxe and consumed by TerminalDxe come with a Mode.ReceiveFifoDepth=1 default setting, as required by UEFI 2.5. Although TerminalDxe calls EFI_SERIAL_IO_PROTOCOL.SetAttributes() in the TerminalDriverBindingStart() and TerminalConInTimerHandler() functions, it only does so to change the Mode.Timeout member. Other members of Mode, including Mode.ReceiveFifoDepth, are preserved. On some platforms this causes the UART that underlies TerminalDxe not to have enough room for bursts of scan codes, which translates to broken parsing of escape sequences, e.g. cursor movement keys. According to the UEFI spec, passing ReceiveFifoDepth=0 to EFI_SERIAL_IO_PROTOCOL.SetAttributes() "will use the device's default FIFO depth". While TerminalDxe could try to configure a receive FIFO depth that matches the longest escape sequence it wishes to parse, in practice the device-specific default FIFO depth -- which may well differ from the spec-mandated SerialIo->Mode.ReceiveFifoDepth=1 default -- seems to work. Hence let's just set that. This issue was exposed by SVN r18971 / git commit 921e987b2b ("ArmPlatformPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkg"). In that conversion, MdeModulePkg's SerialDxe started to initialize Mode.ReceiveFifoDepth to 1 (in conformance with the spec), unlike the prior, non-conformant initialization to 0 in EmbeddedPkg's SerialDxe. Since TerminalDxe would never change ReceiveFifoDepth from the new default value 1, and the ArmPlatformPkg/Drivers/PL011Uart library instance, underlying SerialDxe through SerialPortLib, would obey it too, they would collectively effect a receive queue depth of 1, rather than the default 16 or 32. This broke cursor keys on the ARM FVP and Juno platforms. It is the client of EFI_SERIAL_IO_PROTOCOL that is responsible for modifying the attributes, if the defaults are not appropriate, hence this patch modifies TerminalDxe. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ryan Harkin <ryan.harkin@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Star Zeng <star.zeng@intel.com> Reported-by: Ryan Harkin <ryan.harkin@linaro.org> Reference: http://thread.gmane.org/gmane.comp.bios.edk2.devel/4779/focus=6553 Reference: http://thread.gmane.org/gmane.comp.bios.edk2.devel/6594 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19701 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-15MdeModulePkg: Convert all .uni files to utf-8Jordan Justen2-0/+0
To convert these files I ran: $ python3 BaseTools/Scripts/ConvertUni.py MdeModulePkg Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19257 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-26MdeModulePkg: TerminalDxe: avoid checking uninitialized variableStar Zeng1-3/+4
The SerialIo->GetControl() function is not required to set the Control output parameter on error. Make sure we apply the EFI_SERIAL_INPUT_BUFFER_EMPTY optimization in TerminalConInTimerHandler() only if the SerialIo->GetControl() function call set that bit in the Control variable. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Suggested-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18962 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-16MdeModulePkg/TerminalDxe: Some improvementsHeyi Guo1-23/+4
1. Get default terminal type from PCD rather than using PCANSI directly in BuildTeminalDevpath; 2. Only terminal type is needed to create an TerminalDev instance, so remove the useless code of creating and freeing DefaultNode. 3. Some white space refining. Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Heyi Guo <heyi.guo@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18027 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-16MdeModulePkg/TerminalDxe: Set NullRemaining to FALSE by defaultHeyi Guo1-1/+1
This is bug fix for TerminalDxe: NullRemaining should be set to FALSE by fault and then be set to TRUE conditionally. Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Heyi Guo <heyi.guo@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18026 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-10MdeModulePkg: Fix TerminalDxe VS2013 build failureRoy Franz1-2/+2
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Roy Franz <roy.franz@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17910 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-09Accept VT220 DEL and function keys for TTY terminal typeRoy Franz3-1/+101
Accept the VT220 escape code [3~ as backspace for TtyTerm terminals. This is sent by many Linux terminals by default. Also accept VT220 function keys F1-F12, and VT100 F1-F4 keys as these are commonly sent by Linux terminals. The VT220 escape codes are longer, and variable length so a new state is added to the state machine along with a variable to construct the multibyte escape sequence. There are currently no ambiguous escape sequence prefixes accepted, so the TTY terminal accepts escape sequences for a variety of terminals. The goal is to 'just work' with as many terminals as possible, rather than properly emulating any specific terminal. Backspace, Del, and F10 have been tested on xterm, rxvt, tmux, and screen. Note: The existing vt100 function key handling does not match the vt100 documentation that I found, so I added the TTY terminal handling of VT100 F1-F4 (really PF1-PF4 on vt100) separately. The vt100 has no F5-F10 keys, so I don't know what the current vt100 code is based on. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Roy Franz <roy.franz@linaro.org> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17897 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-09Treat ASCII 0x7F as backspace for TtyTerm terminalsRoy Franz1-2/+8
Treat ASCII 0x7F as backspace, rather than delete, for TTY terminals. This better matches the default Linux terminal settings that are used when connecting to a simulated platform using xterm or a similar terminal program. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Roy Franz <roy.franz@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17896 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-09Add "TtyTerm" terminal type to TerminalDxeRoy Franz5-8/+45
This patch a adds new terminal type, TtyTerm, to TerminalDxe. This terminal type provides a place to add support for various *nix terminals that don't behave like standard VT terminals. The goal is to 'just work' with as many terminals as possible, rather than properly emulating any one specific terminal. Signed-off-by: Roy Franz <roy.franz@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17895 6f19259b-4bc3-4df7-8a09-765794883524
2014-12-04MdeModulePkg: Source fixes and cleanup for ARMGCC compilesRandy Pawell1-1/+2
- Fix EFI_IPv4_ADDRESS usages to use a macro to copy the structure instead of direct assignment, to avoid runtime alignment errors. - Fix a EFI_INPUT_KEY usage in TerminalDxe to use CopyMem() to copy the structure instead of direct assignment, to avoid runtime alignment error. - Delete excess local variables that are initialized but otherwise unused. - CompilerIntrinsicsLib library now imported for AARCH64, as well as ARM. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Randy Pawell <randy_pawell@hp.com> Reviewed-by: Olivier Martin <Olivier.Martin@arm.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16471 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-03MdeModulePkg: Convert non DOS format files to DOS format and remove unused ↵Gao, Liming1-0/+0
module UNI files. 1. Module UNI and Package UNI files are not DOS format. Convert them to DOS format. 2. Remove unused SectionExtractionDxeModStrs.uni and SectionExtractionPeiModStrs.uni Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gao, Liming <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16044 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-28MdeModulePkg: INF/DEC file updates to EDK II packagesZeng, Star2-0/+0
2. Add MODULE_UNI_FILE file that contains the localized Abstract and Description of a module. a. Addresses an information gap between INF files and the UEFI Distribution Packaging Specification XML schema b. There will be an associated update to UPT in BaseTools to consume MODULE_UNI_FILE and associated UNI file during UDP creation that performs the INF -> XML conversion. c. There will be an associated update to UPT in BaseTools to produce MODULE_UNI_FILE and associated UNI file during UDP installation that performs the XML -> INF conversion. 3. Add Module Extra UNI file that provides the localized Name of a module. a. [UserExtensions.TianoCore."ExtraFiles"] provides an easy method for a module to specify extra files not listed in [Sources] or [Binaries] sections to be added to a UDP without having to list the files in the UPT package information data file. b. There will be an associated update to UPT in BaseTools to package up files listed in [UserExtensions.TianoCore."ExtraFiles"] during UDP creation. c. UNI file contains localized name of a module to go along with the localized Abstract and Description from the MODULE_UNI_FILE. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zeng, Star <star.zeng@intel.com> Reviewed-by: Gao, Liming <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15963 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-28MdeModulePkg: INF/DEC file updates to EDK II packagesZeng, Star1-17/+27
1. Usage information in INF file comment blocks are either incomplete or incorrect. This includes usage information for Protocols/PPIs/GUIDs/PCDs/HOBs/Events/BootModes. The syntax for usage information in comment blocks is defined in the EDK II Module Information (INF) Specification Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zeng, Star <star.zeng@intel.com> Reviewed-by: Gao, Liming <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15962 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-28Add ASSERT to check if NewVariable is NULL.Elvin Li1-0/+1
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Elvin Li <elvin.li@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15407 6f19259b-4bc3-4df7-8a09-765794883524