summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c
AgeCommit message (Collapse)AuthorFilesLines
2026-08-04ShellPkg/UefiShellDebug1: Lower indentation level in MainCmdXXX() (4/4)Pierre Gondois1-95/+87
This patch aims to help breaking down the long functions present in the ShellPkg and reduce complexity/nested code and conditions. Lower the indentation level in the newly created MainCmdXXX() functions. To avoid having one large commit updating all the UefiShellDebug1 commands, only update these files: - SerMode.c - SetSize.c - SetVar.c - SmbiosView/SmbiosView.c No functional change should be induced by this patch. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04ShellPkg/UefiShellDebug1: Extract MainCmdXXX() function (4/4)Pierre Gondois1-25/+46
This patch aims to help breaking down the long functions present in the ShellPkg and reduce complexity/nested code and conditions. Extract a MainCmdXXX() function for each shell command. This command contains the possible operations the command aims to operate. The ShellCommandRunXXX() function from which it is extracted is only responsible of: - initializing the shell/command environment - parsing the command parameter and creating a Package - freeing the Package For the MemMap and SetVar commands, ShellCommandLineFreeVarList() calls are removed as the Package is now freed in the caller function: ShellCommandRunXXX(). To avoid having one large commit updating all the UefiShellDebug1 commands, only update these files: - SerMode.c - SetSize.c - SetVar.c - SmbiosView/SmbiosView.c No functional change should be induced by this patch. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04ShellPkg/ShellDebug1: Rationalize Package init/freePierre Gondois1-4/+1
Package is sometimes initialized to NULL and only freed if not NULL. Remove these as: - Package is initialized in ShellCommandLineParse(). - If ShellCommandLineFreeVarList() is reached, Package cannot be NULL. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04ShellPkg/UefiShellDebug1: Return if ShellCommandLineParse() failed (4/4)Pierre Gondois1-95/+97
This patch aims to help breaking down the long functions present in the ShellPkg and reduce complexity/nested code and conditions. Return directly if ShellCommandLineParse() returned an error Status. In such case, the "Package" that should be allocated by ShellCommandLineParse() is already freed in: ShellCommandLineParse() \-ShellCommandLineParseEx() \-InternalCommandLineParse() so there is no need to free it with ShellCommandLineFreeVarList(). To avoid having one large commit updating all the UefiShellDebug1 commands, only update these files: - SerMode.c - SetSize.c - SetVar.c - SmbiosView/SmbiosView.c No functional change should be induced by this patch. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-04-24ShellPkg/SerMode: Add ValidDataBits() functionPierre Gondois1-9/+20
Add a ValidDataBits() utility function to check the Data Bits are valid. No functional change. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-04-24ShellPkg/SerMode: Add GetStopBits() functionPierre Gondois1-24/+51
Add a GetStopBits() utility function to convert the StopBits to the EFI_STOP_BITS_TYPE type. No functional change. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-04-24ShellPkg/SerMode: Lower indentation level in DisplaySettings()Pierre Gondois1-28/+24
Invert error handling to lower the indentation level in DisplaySettings(). No functional change. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-04-24ShellPkg/SerMode: Add GetParityType() functionPierre Gondois1-29/+62
Add a GetParityType() utility function to convert the Parity to the EFI_PARITY_TYPE type. No functional change. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-04-24ShellPkg/SerMode: Add name conversion arrays for parity/stop bitsPierre Gondois1-61/+36
Add name conversion arrays: - ParityBitName - StopBitsName to seamlessly convert parity/stop bits to a matching name. No functional change. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01ShellPkg: Use the newly introduced ShellPrintHiiDefaultEx() aliasPierre Gondois1-21/+18
Make use the newly introduced ShellPrintHiiDefaultEx() alias and replace wherever it is possible: - "ShellPrintHiiEx (-1, -1, NULL," with: - "ShellPrintHiiDefaultEx (" No functional change is introduced. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2024-10-29ShellPkg: UefiShellDebug1CommandsLib: CodeQL FixesOliver Smith-Denny1-1/+7
Includes changes across the module for the following CodeQL rules: - cpp/comparison-with-wider-type - cpp/overflow-buffer - cpp/redundant-null-check-param - cpp/uselesstest Co-authored-by: Taylor Beebe <taylor.d.beebe@gmail.com> Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2021-12-07ShellPkg: Apply uncrustify changesMichael Kubacki1-139/+149
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the ShellPkg 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: Ray Ni <ray.ni@intel.com>
2019-04-09ShellPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney1-7/+1
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: Ray Ni <ray.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2018-06-28ShellPkg: Clean up source filesLiming Gao1-16/+16
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: Ruiyu Ni <ruiyu.ni@intel.com>
2016-10-09ShellPkg/UefiShellDebug1CommandsLib: Remove unnecessary EFIAPIChen A Chen1-1/+0
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen A Chen <chen.a.chen@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
2015-07-14ShellPkg: decode serial console attribute set failure status when used thru ↵Tapan Shah1-2/+10
sermode command Serial console driver may not support all databits / stopbits attribute values. But ‘sermode’ command only displays a general error indicating operation failure. Instead it should decode error status and report more accurate error message. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hp.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17978 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-05ShellPkg: Standardized HP Copyright Message StringTapan Shah1-1/+1
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hp.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16759 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-04ShellPkg: Update Debug1 profile commands response outputTapan Shah1-13/+14
Updates to Debug1 profile commands response output. Updating Debug1 profile commands source code to include command name as a prefix in error message. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hp.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16729 6f19259b-4bc3-4df7-8a09-765794883524
2011-03-26comp - add comments and add input verification jcarsey1-11/+30
bcfg - updated for bugs. compress - rename for coding standards. add comments. dblk - add comments, input verification, and a header line dmem - add comments, add input verification, add system table info dmpstore - add comments eficompress - add comments and add input verification efidecompress - add comments and add input verification loadpcirom - add comments and more output messages memmap - add more output to exceed the spec. mm - move functions, add comments, add input verification. mode - add comment pci - add input verification. SerMode - add comments and add input verification setsize - add comments and add input verification setvar - add comments and add input verification smbiosview - add input verification. clarify error messages. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11438 6f19259b-4bc3-4df7-8a09-765794883524
2010-12-10update copyright formathhtian1-1/+1
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11153 6f19259b-4bc3-4df7-8a09-765794883524
2010-11-17Add "Debug1" profile (all but Edit and HexEdit commands)jcarsey1-0/+344
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11068 6f19259b-4bc3-4df7-8a09-765794883524