* [PATCH V3 2/3] ShellPkg: acpiview: Add routine to print 16 chars
@ 2023-05-22 14:44 Rohit Mathew
2023-07-20 15:25 ` [edk2-devel] " PierreGondois
0 siblings, 1 reply; 3+ messages in thread
From: Rohit Mathew @ 2023-05-22 14:44 UTC (permalink / raw)
To: devel; +Cc: Thomas Abraham, Sami Mujawar, James Morse, Ray Ni, Zhichao Gao
Certain ACPI tables like MPAM has fields which are 16 bytes long.
Routines similar to Dump12Chars but for 16 characters are required to
print such fields. Add Dump16Chars routine to satisfy this requirement.
Signed-off-by: Rohit Mathew <Rohit.Mathew@arm.com>
---
ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c | 39 +++++++++++++++++++-
ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h | 18 ++++++++-
2 files changed, 55 insertions(+), 2 deletions(-)
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
index eac9286176..87f55098b8 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
@@ -1,7 +1,7 @@
/** @file
ACPI parser
- Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.
+ Copyright (c) 2016 - 2023, Arm Limited. All rights reserved.
Copyright (c) 2022, AMD Incorporated. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -449,6 +449,43 @@ Dump12Chars (
);
}
+/**
+ This function traces 16 characters which can be optionally
+ formated using the format string if specified.
+
+ If no format string is specified the Format must be NULL.
+
+ @param [in] Format Optional format string for tracing the data.
+ @param [in] Ptr Pointer to the start of the buffer.
+**/
+VOID
+EFIAPI
+Dump16Chars (
+ IN CONST CHAR16 *Format OPTIONAL,
+ IN UINT8 *Ptr
+ )
+{
+ Print (
+ (Format != NULL) ? Format : L"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",
+ Ptr[0],
+ Ptr[1],
+ Ptr[2],
+ Ptr[3],
+ Ptr[4],
+ Ptr[5],
+ Ptr[6],
+ Ptr[7],
+ Ptr[8],
+ Ptr[9],
+ Ptr[10],
+ Ptr[11],
+ Ptr[12],
+ Ptr[13],
+ Ptr[14],
+ Ptr[15]
+ );
+}
+
/**
This function indents and prints the ACPI table Field Name.
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
index 4b4397961b..c9f41650d9 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
@@ -2,7 +2,7 @@
Header file for ACPI parser
Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
- Copyright (c) 2016 - 2020, Arm Limited. All rights reserved.
+ Copyright (c) 2016 - 2023, Arm Limited. All rights reserved.
Copyright (c) 2022, AMD Incorporated. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -202,6 +202,22 @@ Dump12Chars (
IN UINT8 *Ptr
);
+/**
+ This function traces 16 characters which can be optionally
+ formated using the format string if specified.
+
+ If no format string is specified the Format must be NULL.
+
+ @param [in] Format Optional format string for tracing the data.
+ @param [in] Ptr Pointer to the start of the buffer.
+**/
+VOID
+EFIAPI
+Dump16Chars (
+ IN CONST CHAR16 *Format OPTIONAL,
+ IN UINT8 *Ptr
+ );
+
/**
This function indents and prints the ACPI table Field Name.
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [edk2-devel] [PATCH V3 2/3] ShellPkg: acpiview: Add routine to print 16 chars
2023-05-22 14:44 [PATCH V3 2/3] ShellPkg: acpiview: Add routine to print 16 chars Rohit Mathew
@ 2023-07-20 15:25 ` PierreGondois
2023-07-27 2:56 ` Gao, Zhichao
0 siblings, 1 reply; 3+ messages in thread
From: PierreGondois @ 2023-07-20 15:25 UTC (permalink / raw)
To: devel, rohit.mathew
Cc: Thomas Abraham, Sami Mujawar, James Morse, Ray Ni, Zhichao Gao
Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
On 5/22/23 16:44, Rohit Mathew via groups.io wrote:
> Certain ACPI tables like MPAM has fields which are 16 bytes long.
> Routines similar to Dump12Chars but for 16 characters are required to
> print such fields. Add Dump16Chars routine to satisfy this requirement.
>
> Signed-off-by: Rohit Mathew <Rohit.Mathew@arm.com>
> ---
> ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c | 39 +++++++++++++++++++-
> ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h | 18 ++++++++-
> 2 files changed, 55 insertions(+), 2 deletions(-)
>
> diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
> index eac9286176..87f55098b8 100644
> --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
> +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
> @@ -1,7 +1,7 @@
> /** @file
> ACPI parser
>
> - Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.
> + Copyright (c) 2016 - 2023, Arm Limited. All rights reserved.
> Copyright (c) 2022, AMD Incorporated. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent
> **/
> @@ -449,6 +449,43 @@ Dump12Chars (
> );
> }
>
> +/**
> + This function traces 16 characters which can be optionally
> + formated using the format string if specified.
> +
> + If no format string is specified the Format must be NULL.
> +
> + @param [in] Format Optional format string for tracing the data.
> + @param [in] Ptr Pointer to the start of the buffer.
> +**/
> +VOID
> +EFIAPI
> +Dump16Chars (
> + IN CONST CHAR16 *Format OPTIONAL,
> + IN UINT8 *Ptr
> + )
> +{
> + Print (
> + (Format != NULL) ? Format : L"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",
> + Ptr[0],
> + Ptr[1],
> + Ptr[2],
> + Ptr[3],
> + Ptr[4],
> + Ptr[5],
> + Ptr[6],
> + Ptr[7],
> + Ptr[8],
> + Ptr[9],
> + Ptr[10],
> + Ptr[11],
> + Ptr[12],
> + Ptr[13],
> + Ptr[14],
> + Ptr[15]
> + );
> +}
> +
> /**
> This function indents and prints the ACPI table Field Name.
>
> diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> index 4b4397961b..c9f41650d9 100644
> --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> @@ -2,7 +2,7 @@
> Header file for ACPI parser
>
> Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
> - Copyright (c) 2016 - 2020, Arm Limited. All rights reserved.
> + Copyright (c) 2016 - 2023, Arm Limited. All rights reserved.
> Copyright (c) 2022, AMD Incorporated. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent
> **/
> @@ -202,6 +202,22 @@ Dump12Chars (
> IN UINT8 *Ptr
> );
>
> +/**
> + This function traces 16 characters which can be optionally
> + formated using the format string if specified.
> +
> + If no format string is specified the Format must be NULL.
> +
> + @param [in] Format Optional format string for tracing the data.
> + @param [in] Ptr Pointer to the start of the buffer.
> +**/
> +VOID
> +EFIAPI
> +Dump16Chars (
> + IN CONST CHAR16 *Format OPTIONAL,
> + IN UINT8 *Ptr
> + );
> +
> /**
> This function indents and prints the ACPI table Field Name.
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107103): https://edk2.groups.io/g/devel/message/107103
Mute This Topic: https://groups.io/mt/99066184/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [edk2-devel] [PATCH V3 2/3] ShellPkg: acpiview: Add routine to print 16 chars
2023-07-20 15:25 ` [edk2-devel] " PierreGondois
@ 2023-07-27 2:56 ` Gao, Zhichao
0 siblings, 0 replies; 3+ messages in thread
From: Gao, Zhichao @ 2023-07-27 2:56 UTC (permalink / raw)
To: Pierre Gondois, devel@edk2.groups.io, rohit.mathew@arm.com
Cc: Thomas Abraham, Sami Mujawar, James Morse, Ni, Ray
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Thanks,
Zhichao
> -----Original Message-----
> From: Pierre Gondois <pierre.gondois@arm.com>
> Sent: Thursday, July 20, 2023 11:25 PM
> To: devel@edk2.groups.io; rohit.mathew@arm.com
> Cc: Thomas Abraham <thomas.abraham@arm.com>; Sami Mujawar
> <sami.mujawar@arm.com>; James Morse <james.morse@arm.com>; Ni,
> Ray <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
> Subject: Re: [edk2-devel] [PATCH V3 2/3] ShellPkg: acpiview: Add routine to
> print 16 chars
>
> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>
>
> On 5/22/23 16:44, Rohit Mathew via groups.io wrote:
> > Certain ACPI tables like MPAM has fields which are 16 bytes long.
> > Routines similar to Dump12Chars but for 16 characters are required to
> > print such fields. Add Dump16Chars routine to satisfy this requirement.
> >
> > Signed-off-by: Rohit Mathew <Rohit.Mathew@arm.com>
> > ---
> > ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c | 39
> +++++++++++++++++++-
> > ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h | 18
> ++++++++-
> > 2 files changed, 55 insertions(+), 2 deletions(-)
> >
> > diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
> > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
> > index eac9286176..87f55098b8 100644
> > --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
> > +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
> > @@ -1,7 +1,7 @@
> > /** @file
> > ACPI parser
> >
> > - Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.
> > + Copyright (c) 2016 - 2023, Arm Limited. All rights reserved.
> > Copyright (c) 2022, AMD Incorporated. All rights reserved.
> > SPDX-License-Identifier: BSD-2-Clause-Patent
> > **/
> > @@ -449,6 +449,43 @@ Dump12Chars (
> > );
> > }
> >
> > +/**
> > + This function traces 16 characters which can be optionally
> > + formated using the format string if specified.
> > +
> > + If no format string is specified the Format must be NULL.
> > +
> > + @param [in] Format Optional format string for tracing the data.
> > + @param [in] Ptr Pointer to the start of the buffer.
> > +**/
> > +VOID
> > +EFIAPI
> > +Dump16Chars (
> > + IN CONST CHAR16 *Format OPTIONAL,
> > + IN UINT8 *Ptr
> > + )
> > +{
> > + Print (
> > + (Format != NULL) ? Format :
> L"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",
> > + Ptr[0],
> > + Ptr[1],
> > + Ptr[2],
> > + Ptr[3],
> > + Ptr[4],
> > + Ptr[5],
> > + Ptr[6],
> > + Ptr[7],
> > + Ptr[8],
> > + Ptr[9],
> > + Ptr[10],
> > + Ptr[11],
> > + Ptr[12],
> > + Ptr[13],
> > + Ptr[14],
> > + Ptr[15]
> > + );
> > +}
> > +
> > /**
> > This function indents and prints the ACPI table Field Name.
> >
> > diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> > index 4b4397961b..c9f41650d9 100644
> > --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> > +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> > @@ -2,7 +2,7 @@
> > Header file for ACPI parser
> >
> > Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
> > - Copyright (c) 2016 - 2020, Arm Limited. All rights reserved.
> > + Copyright (c) 2016 - 2023, Arm Limited. All rights reserved.
> > Copyright (c) 2022, AMD Incorporated. All rights reserved.
> > SPDX-License-Identifier: BSD-2-Clause-Patent
> > **/
> > @@ -202,6 +202,22 @@ Dump12Chars (
> > IN UINT8 *Ptr
> > );
> >
> > +/**
> > + This function traces 16 characters which can be optionally
> > + formated using the format string if specified.
> > +
> > + If no format string is specified the Format must be NULL.
> > +
> > + @param [in] Format Optional format string for tracing the data.
> > + @param [in] Ptr Pointer to the start of the buffer.
> > +**/
> > +VOID
> > +EFIAPI
> > +Dump16Chars (
> > + IN CONST CHAR16 *Format OPTIONAL,
> > + IN UINT8 *Ptr
> > + );
> > +
> > /**
> > This function indents and prints the ACPI table Field Name.
> >
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107290): https://edk2.groups.io/g/devel/message/107290
Mute This Topic: https://groups.io/mt/99066184/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-07-27 2:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-22 14:44 [PATCH V3 2/3] ShellPkg: acpiview: Add routine to print 16 chars Rohit Mathew
2023-07-20 15:25 ` [edk2-devel] " PierreGondois
2023-07-27 2:56 ` Gao, Zhichao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox