* [patch 1/2] ShellPkg/Dp: Add null pointer check @ 2018-02-09 3:10 Dandan Bi 2018-02-09 3:10 ` [patch 2/2] ShellPkg/DP: Update the error message info Dandan Bi 2018-02-09 6:57 ` [patch 1/2] ShellPkg/Dp: Add null pointer check Gao, Liming 0 siblings, 2 replies; 4+ messages in thread From: Dandan Bi @ 2018-02-09 3:10 UTC (permalink / raw) To: edk2-devel; +Cc: Liming Gao, Hao Wu Cc: Liming Gao <liming.gao@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> --- ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c index fafc64f..4dd7dd9 100644 --- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c @@ -255,11 +255,11 @@ GetBootPerformanceTable ( Status = EfiGetSystemConfigurationTable ( &gEfiAcpi10TableGuid, &AcpiTable ); } - if (EFI_ERROR(Status)) { + if (EFI_ERROR(Status) || AcpiTable == NULL) { return Status; } FirmwarePerformanceTable = FindAcpiPtr ( (EFI_ACPI_5_0_ROOT_SYSTEM_DESCRIPTION_POINTER *)AcpiTable, -- 1.9.5.msysgit.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [patch 2/2] ShellPkg/DP: Update the error message info 2018-02-09 3:10 [patch 1/2] ShellPkg/Dp: Add null pointer check Dandan Bi @ 2018-02-09 3:10 ` Dandan Bi 2018-02-09 6:57 ` Gao, Liming 2018-02-09 6:57 ` [patch 1/2] ShellPkg/Dp: Add null pointer check Gao, Liming 1 sibling, 1 reply; 4+ messages in thread From: Dandan Bi @ 2018-02-09 3:10 UTC (permalink / raw) To: edk2-devel; +Cc: Liming Gao, Jiewen Yao Make the error message clearer if fail to get ACPI/FPDT table. Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> --- ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c | 3 ++- ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c index 4dd7dd9..aa9c2cd 100644 --- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c @@ -256,18 +256,20 @@ GetBootPerformanceTable ( &gEfiAcpi10TableGuid, &AcpiTable ); } if (EFI_ERROR(Status) || AcpiTable == NULL) { + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DP_GET_ACPI_TABLE_FAIL), mDpHiiHandle); return Status; } FirmwarePerformanceTable = FindAcpiPtr ( (EFI_ACPI_5_0_ROOT_SYSTEM_DESCRIPTION_POINTER *)AcpiTable, EFI_ACPI_5_0_FIRMWARE_PERFORMANCE_DATA_TABLE_SIGNATURE ); if (FirmwarePerformanceTable == NULL) { + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DP_GET_ACPI_FPDT_FAIL), mDpHiiHandle); return EFI_NOT_FOUND; } mBootPerformanceTable = (UINT8*) (UINTN)FirmwarePerformanceTable->BootPointerRecord.BootPerformanceTablePointer; mBootPerformanceTableSize = ((BOOT_PERFORMANCE_TABLE *) mBootPerformanceTable)->Header.Length; @@ -737,11 +739,10 @@ RunDp ( // //1. Get FPDT from ACPI table. // Status = GetBootPerformanceTable (); if (EFI_ERROR(Status)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DP_GET_BOOT_PERFORMANCE_TABLE_FAIL), mDpHiiHandle); return Status; } // //2. Cache the ModuleGuid and hanlde mapping table. diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni index b6069ae..c7eb0fb 100644 --- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni @@ -88,11 +88,12 @@ #string STR_DP_RAW_VARS2 #language en-US "%5d: %16LX %16LX %16LX %31a %31a %5d\n" #string STR_DP_RAW_HEADR2 #language en-US "\nIndex Handle Start Count End Count Token Module ID\n" #string STR_DP_INCOMPLETE #language en-US " I " #string STR_DP_COMPLETE #language en-US " " #string STR_ALIT_UNKNOWN #language en-US "Unknown" -#string STR_DP_GET_BOOT_PERFORMANCE_TABLE_FAIL #language en-US "Fail to get boot performance table\n" +#string STR_DP_GET_ACPI_TABLE_FAIL #language en-US "Fail to get ACPI Table\n" +#string STR_DP_GET_ACPI_FPDT_FAIL #language en-US "Fail to get Firmware Performance Data Table (FPDT) in ACPI Table\n" #string STR_GET_HELP_DP #language en-US "" ".TH dp 0 "Display performance metrics"\r\n" ".SH NAME\r\n" "Displays performance metrics that are stored in memory.\r\n" -- 1.9.5.msysgit.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [patch 2/2] ShellPkg/DP: Update the error message info 2018-02-09 3:10 ` [patch 2/2] ShellPkg/DP: Update the error message info Dandan Bi @ 2018-02-09 6:57 ` Gao, Liming 0 siblings, 0 replies; 4+ messages in thread From: Gao, Liming @ 2018-02-09 6:57 UTC (permalink / raw) To: Bi, Dandan, edk2-devel@lists.01.org; +Cc: Yao, Jiewen Reviewed-by: Liming Gao <liming.gao@intel.com> >-----Original Message----- >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of >Dandan Bi >Sent: Friday, February 09, 2018 11:10 AM >To: edk2-devel@lists.01.org >Cc: Yao, Jiewen <jiewen.yao@intel.com>; Gao, Liming <liming.gao@intel.com> >Subject: [edk2] [patch 2/2] ShellPkg/DP: Update the error message info > >Make the error message clearer if fail to get ACPI/FPDT table. > >Cc: Liming Gao <liming.gao@intel.com> >Cc: Jiewen Yao <jiewen.yao@intel.com> >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Dandan Bi <dandan.bi@intel.com> >--- > ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c | 3 ++- > ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > >diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c >b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c >index 4dd7dd9..aa9c2cd 100644 >--- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c >+++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c >@@ -256,18 +256,20 @@ GetBootPerformanceTable ( > &gEfiAcpi10TableGuid, > &AcpiTable > ); > } > if (EFI_ERROR(Status) || AcpiTable == NULL) { >+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN >(STR_DP_GET_ACPI_TABLE_FAIL), mDpHiiHandle); > return Status; > } > > FirmwarePerformanceTable = FindAcpiPtr ( > (EFI_ACPI_5_0_ROOT_SYSTEM_DESCRIPTION_POINTER >*)AcpiTable, > >EFI_ACPI_5_0_FIRMWARE_PERFORMANCE_DATA_TABLE_SIGNATURE > ); > if (FirmwarePerformanceTable == NULL) { >+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN >(STR_DP_GET_ACPI_FPDT_FAIL), mDpHiiHandle); > return EFI_NOT_FOUND; > } > > mBootPerformanceTable = (UINT8*) (UINTN)FirmwarePerformanceTable- >>BootPointerRecord.BootPerformanceTablePointer; > mBootPerformanceTableSize = ((BOOT_PERFORMANCE_TABLE *) >mBootPerformanceTable)->Header.Length; >@@ -737,11 +739,10 @@ RunDp ( > // > //1. Get FPDT from ACPI table. > // > Status = GetBootPerformanceTable (); > if (EFI_ERROR(Status)) { >- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN >(STR_DP_GET_BOOT_PERFORMANCE_TABLE_FAIL), mDpHiiHandle); > return Status; > } > > // > //2. Cache the ModuleGuid and hanlde mapping table. >diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni >b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni >index b6069ae..c7eb0fb 100644 >--- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni >+++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.uni >@@ -88,11 +88,12 @@ > #string STR_DP_RAW_VARS2 #language en-US >"%5d: %16LX %16LX %16LX %31a %31a %5d\n" > #string STR_DP_RAW_HEADR2 #language en-US "\nIndex Handle >Start Count End Count Token Module ID\n" > #string STR_DP_INCOMPLETE #language en-US " I " > #string STR_DP_COMPLETE #language en-US " " > #string STR_ALIT_UNKNOWN #language en-US "Unknown" >-#string STR_DP_GET_BOOT_PERFORMANCE_TABLE_FAIL #language en- >US "Fail to get boot performance table\n" >+#string STR_DP_GET_ACPI_TABLE_FAIL #language en-US "Fail to get ACPI >Table\n" >+#string STR_DP_GET_ACPI_FPDT_FAIL #language en-US "Fail to get >Firmware Performance Data Table (FPDT) in ACPI Table\n" > > #string STR_GET_HELP_DP #language en-US "" > ".TH dp 0 "Display performance metrics"\r\n" > ".SH NAME\r\n" > "Displays performance metrics that are stored in memory.\r\n" >-- >1.9.5.msysgit.1 > >_______________________________________________ >edk2-devel mailing list >edk2-devel@lists.01.org >https://lists.01.org/mailman/listinfo/edk2-devel ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 1/2] ShellPkg/Dp: Add null pointer check 2018-02-09 3:10 [patch 1/2] ShellPkg/Dp: Add null pointer check Dandan Bi 2018-02-09 3:10 ` [patch 2/2] ShellPkg/DP: Update the error message info Dandan Bi @ 2018-02-09 6:57 ` Gao, Liming 1 sibling, 0 replies; 4+ messages in thread From: Gao, Liming @ 2018-02-09 6:57 UTC (permalink / raw) To: Bi, Dandan, edk2-devel@lists.01.org; +Cc: Wu, Hao A Reviewed-by: Liming Gao <liming.gao@intel.com> >-----Original Message----- >From: Bi, Dandan >Sent: Friday, February 09, 2018 11:10 AM >To: edk2-devel@lists.01.org >Cc: Gao, Liming <liming.gao@intel.com>; Wu, Hao A <hao.a.wu@intel.com> >Subject: [patch 1/2] ShellPkg/Dp: Add null pointer check > >Cc: Liming Gao <liming.gao@intel.com> >Cc: Hao Wu <hao.a.wu@intel.com> >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Dandan Bi <dandan.bi@intel.com> >--- > ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c >b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c >index fafc64f..4dd7dd9 100644 >--- a/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c >+++ b/ShellPkg/DynamicCommand/DpDynamicCommand/Dp.c >@@ -255,11 +255,11 @@ GetBootPerformanceTable ( > Status = EfiGetSystemConfigurationTable ( > &gEfiAcpi10TableGuid, > &AcpiTable > ); > } >- if (EFI_ERROR(Status)) { >+ if (EFI_ERROR(Status) || AcpiTable == NULL) { > return Status; > } > > FirmwarePerformanceTable = FindAcpiPtr ( > (EFI_ACPI_5_0_ROOT_SYSTEM_DESCRIPTION_POINTER >*)AcpiTable, >-- >1.9.5.msysgit.1 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-02-09 6:51 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-02-09 3:10 [patch 1/2] ShellPkg/Dp: Add null pointer check Dandan Bi 2018-02-09 3:10 ` [patch 2/2] ShellPkg/DP: Update the error message info Dandan Bi 2018-02-09 6:57 ` Gao, Liming 2018-02-09 6:57 ` [patch 1/2] ShellPkg/Dp: Add null pointer check Gao, Liming
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox