Carsey, Jaben [mailto:jaben.car...@intel.com]  wrote:

 

Reviewed-by: Jaben Carsey <jaben.car...@intel.com 
<mailto:jaben.car...@intel.com> >

 

My thoughts:

*        It is good enough as it is.  I would clean the following small items. 
(no need to re-review to me)

o   Remove line 243 – no need to add in a commented out line of code.

o   When you do if (Status == EFI_SUCCESS), why not use the macro 
if(EFI_SUCCESS(Status))?  Just seems like more standard among other code.

 

[you probably mean !EFI_ERROR(Status)] No doubt these two are interchangeable 
in the vast majority of cases. But it is worth remembering that 
!EFI_ERROR(Status) is true for (Status == EFI_WARN_*). I never did like the 
EFI_ERROR() macro for that reason. The two are not exactly the same.

 

Thanks,

Scott

 

 

From: Mcdaniel, Daryl 
Sent: Friday, October 24, 2014 3:50 PM
To: edk2-devel@lists.sourceforge.net <mailto:edk2-devel@lists.sourceforge.net> 
; Carsey, Jaben; Bjorge, Erik C
Cc: Bruce Maynard (bruce.mayn...@emulex.com <mailto:bruce.mayn...@emulex.com> )
Subject: [PATCH] StdLib Console Input fix to eliminate NUL characters from the 
stdin stream.

 

Please review the attached patches.  The attached patch file covers all 
modified files.  I also included the full source file for daConsole.c since it 
has structural as well as code changes.

 

StdLib:  Some deployed versions of the Simple Text Input Protocol randomly 
return either NUL characters or Scan Codes when just typing normal text.  These 
changes filter out NUL characters and make Scan Code and error handling more 
robust.

 

StdLibPrivateInternalFiles/Include/Device/Console.h: Change UnGetKey, in the 
ConInstance structure, from an EFI_INPUT_KEY structure to a CHAR16 variable.

 

StdLib/Include/sys/termios.h: Add CHAR_SUB and CHAR_ESC for translation of '^Z' 
and the Escape Scan Code into the EOF and ESC characters, respectively.

 

StdLib/LibC/Uefi/Devices/Console/daConsole.c:  Add da_ConRawRead() function to 
simplify the read logic. Discard NUL characters from the input stream.  In 
Blocking mode, retry until a non-NUL character is received.  In NonBlocking 
mode, a NUL causes an EAGAIN error to be returned.  Translate the Escape Scan 
Code into an ESC character.  If Scan Codes are ignored, retry if in Blocking 
mode else return an EAGAIN error.  UnGetKey becomes a single wide character 
instead of a structure.

    Change da_Poll() to use da_ConRawRead().

 

IIOutilities.c:  BUG fix.  Return the processed input character instead of the 
raw character.  Allows EOF propagation.

 

CanonRead.c:  Enable EOF propagation.

 

IIOechoCtrl.h:  Use symbols defined in termios.h instead of hard-coded constant 
numbers.

 

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by:  Daryl McDaniel  <daryl.mcdan...@intel.com 
<mailto:daryl.mcdan...@intel.com> >

Reviewed-by:  

 

 

Daryl McDaniel

 

------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to