From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 0641F941DD0 for ; Mon, 8 Jul 2024 21:39:20 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=RKxvJEC8ysF+GLI7v2tWOwqUAucsOD3fnbzj32u68qI=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1720474760; v=1; b=vCXYJHkddM9CnlsbmZSNlV8efaQ0KLsqHJ6UNYxqjF+5v2+UDDIVOg/xjzM7Gb4J4W0docn2 GtzdGEiNNIzMlSDEgtO51L95mH6s8geZxcKjvqfsfO6GPbLBRoeqyvFcJD0Mew1gLuKfeQVRLzj o6jDjK2CdMTXHejWVDIQDTTtfP3iVqtLCrHTfYcgcgxvFQzWH/0H7l0qzvMJ8wQy+0hJ/hXdJeU PjPl2kOYZllql8b+XNe/3E9EysKlv0JwAvHRu4rDhIdMm0VAjOL7Rhprvzka4YnGKcdK41b0fpk o3bPy8wF+HFvCm6G4JsaVamhXINVcRyaXLNzFRFrpXGXQ== X-Received: by 127.0.0.2 with SMTP id NtlxYY7687511xcNJlHMMSg1; Mon, 08 Jul 2024 14:39:19 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.5742.1720474753820107001 for ; Mon, 08 Jul 2024 14:39:14 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 60F95139F; Mon, 8 Jul 2024 14:39:38 -0700 (PDT) X-Received: from usa.arm.com (iss-desktop03.cambridge.arm.com [10.1.196.33]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1F75C3F641; Mon, 8 Jul 2024 14:39:12 -0700 (PDT) From: "Rohit Mathew" To: devel@edk2.groups.io Cc: James Morse , Sami Mujawar , Thomas Abraham , Zhichao Gao Subject: [edk2-devel] [PATCH V6 2/6] ShellPkg/AcpiView: Update field-validator prototype Date: Mon, 8 Jul 2024 22:39:08 +0100 Message-Id: <20240708213908.41464-1-rohit.mathew@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Mon, 08 Jul 2024 14:39:14 -0700 Resent-From: rohit.mathew@arm.com Reply-To: devel@edk2.groups.io,rohit.mathew@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: Dy3JaXVe42MjtvNcDTVjadyix7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=vCXYJHkd; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io From: Rohit Mathew As of now, the field-validator implemented by FNPTR_FIELD_VALIDATOR function pointer takes two parameters, the pointer to the field and a context pointer. For cases where the validator has to have access to the length of the field, there is no clean way to currently do it. In order to resolve this, this commit updates the field-validator's prototype to take the length of the field as an additional parameter. This enhancement allows field validators to perform more comprehensive validation, especially when the length of the field is critical to the validation logic. This change should improve the overall robustness and flexibility of AcpiView. Signed-off-by: Rohit Mathew Cc: James Morse Cc: Sami Mujawar Cc: Thomas Abraham Cc: Zhichao Gao Reviewed-by: Sami Mujawar --- ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c |= 14 +++-- ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h |= 9 +++- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Aest/AestParser.c |= 32 +++++++---- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c |= 8 +-- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Erst/ErstParser.c |= 20 ++++--- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c |= 20 ++++--- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c |= 14 +++-- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Hmat/HmatParser.c |= 8 +-- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Hpet/HpetParser.c |= 7 ++- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c |= 32 +++++++---- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c |= 20 ++++--- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParser.c |= 56 +++++++++++++------- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c |= 38 ++++++++----- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c |= 14 +++-- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrParser.c |= 14 +++-- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c |= 14 +++-- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Wsmt/WsmtParser.c |= 17 +++--- 17 files changed, 222 insertions(+), 115 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c b/= ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c index eac9286176..2e3afbac9d 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c @@ -1,7 +1,7 @@ /** @file ACPI parser =20 - Copyright (c) 2016 - 2021, Arm Limited. All rights reserved. + Copyright (c) 2016 - 2024, Arm Limited. All rights reserved. Copyright (c) 2022, AMD Incorporated. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -616,7 +616,11 @@ ParseAcpi ( if (GetConsistencyChecking () && (Parser[Index].FieldValidator !=3D NULL)) { - Parser[Index].FieldValidator (Ptr, Parser[Index].Context); + Parser[Index].FieldValidator ( + Ptr, + Parser[Index].Length, + Parser[Index].Context + ); } =20 Print (L"\n"); @@ -927,7 +931,11 @@ ParseAcpiBitFields ( if (GetConsistencyChecking () && (Parser[Index].FieldValidator !=3D NULL)) { - Parser[Index].FieldValidator ((UINT8 *)&Data, Parser[Index].Cont= ext); + Parser[Index].FieldValidator ( + (UINT8 *)&Data, + Parser[Index].Length, + Parser[Index].Context + ); } =20 Print (L"\n"); diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h b/= ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h index 6468fe5d8c..188d3556ee 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h @@ -2,7 +2,7 @@ Header file for ACPI parser =20 Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. - Copyright (c) 2016 - 2020, Arm Limited. All rights reserved. + Copyright (c) 2016 - 2024, Arm Limited. All rights reserved. Copyright (c) 2022, AMD Incorporated. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -234,11 +234,16 @@ typedef VOID (EFIAPI *FNPTR_PRINT_FORMATTER)(CONST = CHAR16 *Format, UINT8 *Ptr); This function pointer is the template for validating an ACPI table fie= ld. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information as specifi= ed by the 'Context' member of the ACPI_PARSER. e.g. this could be a pointer to the ACPI table hea= der. **/ -typedef VOID (EFIAPI *FNPTR_FIELD_VALIDATOR)(UINT8 *Ptr, VOID *Context); +typedef VOID (EFIAPI *FNPTR_FIELD_VALIDATOR)( + UINT8 *Ptr, + UINT32 Length, + VOID *Context + ); =20 /** The ACPI_PARSER structure describes the fields of an ACPI table and diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Aest/Ae= stParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Aest/Ae= stParser.c index 48f71484fb..83f9b292b0 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Aest/AestParse= r.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Aest/AestParse= r.c @@ -1,7 +1,7 @@ /** @file AEST table parser =20 - Copyright (c) 2020, Arm Limited. + Copyright (c) 2020 - 2024, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -33,6 +33,7 @@ STATIC UINT8 *ProcessorResource= Type; Validate Processor Flags. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. thi= s could be a pointer to the ACPI table header. **/ @@ -40,8 +41,9 @@ STATIC VOID EFIAPI ValidateProcessorFlags ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { // If the global or shared node flag is set then the ACPI Processor ID @@ -59,6 +61,7 @@ ValidateProcessorFlags ( Validate GIC Interface Type. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. thi= s could be a pointer to the ACPI table header. **/ @@ -66,8 +69,9 @@ STATIC VOID EFIAPI ValidateGicInterfaceType ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { UINT32 GicInterfaceType; @@ -83,6 +87,7 @@ ValidateGicInterfaceType ( Validate Interface Type. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. thi= s could be a pointer to the ACPI table header. **/ @@ -90,8 +95,9 @@ STATIC VOID EFIAPI ValidateInterfaceType ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { if (*Ptr > 1) { @@ -104,6 +110,7 @@ ValidateInterfaceType ( Validate Interrupt Type. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. thi= s could be a pointer to the ACPI table header. **/ @@ -111,8 +118,9 @@ STATIC VOID EFIAPI ValidateInterruptType ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { if (*Ptr > 1) { @@ -125,6 +133,7 @@ ValidateInterruptType ( Validate interrupt flags. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. thi= s could be a pointer to the ACPI table header. **/ @@ -132,8 +141,9 @@ STATIC VOID EFIAPI ValidateInterruptFlags ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { if ((*Ptr & 0xfe) !=3D 0) { diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Db= g2Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Db= g2Parser.c index d25d4d84f8..3d43d5cb8c 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parse= r.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parse= r.c @@ -1,7 +1,7 @@ /** @file DBG2 table parser =20 - Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2024, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -30,6 +30,7 @@ STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; This function validates the NameSpace string length. =20 @param [in] Ptr Pointer to the start of the buffer. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -37,8 +38,9 @@ STATIC VOID EFIAPI ValidateNameSpaceStrLen ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { UINT16 NameSpaceStrLen; diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Erst/Er= stParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Erst/Er= stParser.c index f3ae09309c..2b19e3e1c0 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Erst/ErstParse= r.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Erst/ErstParse= r.c @@ -2,7 +2,7 @@ ERST table parser =20 Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. - Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2024, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -70,6 +70,7 @@ STATIC CONST CHAR16 *ErstInstructionTable[] =3D { Validate Erst action. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. thi= s could be a pointer to the ACPI table header. **/ @@ -77,8 +78,9 @@ STATIC VOID EFIAPI ValidateErstAction ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { if (*Ptr > EFI_ACPI_6_4_ERST_GET_EXECUTE_OPERATION_TIMINGS) { @@ -91,6 +93,7 @@ ValidateErstAction ( Validate Erst instruction. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. thi= s could be a pointer to the ACPI table header. **/ @@ -98,8 +101,9 @@ STATIC VOID EFIAPI ValidateErstInstruction ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { if (*Ptr > EFI_ACPI_6_4_ERST_MOVE_DATA) { @@ -112,6 +116,7 @@ ValidateErstInstruction ( Validate Erst flags. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. thi= s could be a pointer to the ACPI table header. **/ @@ -119,8 +124,9 @@ STATIC VOID EFIAPI ValidateErstFlags ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { if ((*Ptr & 0xfe) !=3D 0) { diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/Fa= dtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/Fa= dtParser.c index abc58d6552..c9eac9c18e 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParse= r.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParse= r.c @@ -1,7 +1,7 @@ /** @file FADT table parser =20 - Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2024, Arm Limited. All rights reserved. Copyright (c) 2022, AMD Incorporated. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -57,6 +57,7 @@ GetAcpiXsdtHeaderInfo ( This function validates the Firmware Control Field. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -64,8 +65,9 @@ STATIC VOID EFIAPI ValidateFirmwareCtrl ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) @@ -83,6 +85,7 @@ ValidateFirmwareCtrl ( This function validates the X_Firmware Control Field. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -90,8 +93,9 @@ STATIC VOID EFIAPI ValidateXFirmwareCtrl ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) @@ -109,6 +113,7 @@ ValidateXFirmwareCtrl ( This function validates the flags. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -116,8 +121,9 @@ STATIC VOID EFIAPI ValidateFlags ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/Gt= dtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/Gt= dtParser.c index e62927098a..c8681e8424 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParse= r.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParse= r.c @@ -1,7 +1,7 @@ /** @file GTDT table parser =20 - Copyright (c) 2016 - 2021, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2024, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -30,6 +30,7 @@ STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; This function validates the GT Block timer count. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -37,8 +38,9 @@ STATIC VOID EFIAPI ValidateGtBlockTimerCount ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { UINT32 BlockTimerCount; @@ -59,6 +61,7 @@ ValidateGtBlockTimerCount ( This function validates the GT Frame Number. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -66,8 +69,9 @@ STATIC VOID EFIAPI ValidateGtFrameNumber ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { UINT8 FrameNumber; diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Hmat/Hm= atParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Hmat/Hm= atParser.c index 2a1357c853..ce69a600e7 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Hmat/HmatParse= r.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Hmat/HmatParse= r.c @@ -1,7 +1,7 @@ /** @file HMAT table parser =20 - Copyright (c) 2020, Arm Limited. + Copyright (c) 2020 - 2024, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -54,6 +54,7 @@ STATIC CONST CHAR16 *SllbiNames[] =3D { This function validates the Cache Attributes field. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -61,8 +62,9 @@ STATIC VOID EFIAPI ValidateCacheAttributes ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { EFI_ACPI_6_4_HMAT_STRUCTURE_MEMORY_SIDE_CACHE_INFO_CACHE_ATTRIBUTES * diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Hpet/Hp= etParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Hpet/Hp= etParser.c index 1b4c38f2af..9975af53fd 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Hpet/HpetParse= r.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Hpet/HpetParse= r.c @@ -1,6 +1,7 @@ /** @file HPET table parser =20 + Copyright (c) 2024, Arm Limited. All rights reserved. Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -121,6 +122,7 @@ DumpCounterSize ( This function validates the flags. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -128,8 +130,9 @@ STATIC VOID EFIAPI ValidateHpetRevId ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { if ((*(UINT8 *)Ptr) =3D=3D 0) { diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/Io= rtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/Io= rtParser.c index 599cf0ee8f..299ea4fd45 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParse= r.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParse= r.c @@ -1,7 +1,7 @@ /** @file IORT table parser =20 - Copyright (c) 2016 - 2022, Arm Limited. All rights reserved. + Copyright (c) 2016 - 2024, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -46,6 +46,7 @@ STATIC CONST UINT32 *RmrMemDescOffset; This function validates the ID Mapping array count for the ITS node. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -53,8 +54,9 @@ STATIC VOID EFIAPI ValidateItsIdMappingCount ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { if (*(UINT32 *)Ptr !=3D 0) { @@ -68,6 +70,7 @@ ValidateItsIdMappingCount ( Monitoring Counter Group (PMCG) node. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -75,8 +78,9 @@ STATIC VOID EFIAPI ValidatePmcgIdMappingCount ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { if (*(UINT32 *)Ptr > 1) { @@ -89,6 +93,7 @@ ValidatePmcgIdMappingCount ( This function validates the ID Mapping array offset for the ITS node. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -96,8 +101,9 @@ STATIC VOID EFIAPI ValidateItsIdArrayReference ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { if (*(UINT32 *)Ptr !=3D 0) { @@ -111,6 +117,7 @@ ValidateItsIdArrayReference ( and is 64K aligned. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -118,8 +125,9 @@ STATIC VOID EFIAPI ValidatePhysicalRange ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { UINT64 Value; @@ -135,6 +143,7 @@ ValidatePhysicalRange ( This function validates that the RMR memory range descriptor count. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -142,8 +151,9 @@ STATIC VOID EFIAPI ValidateRmrMemDescCount ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { if (*(UINT32 *)Ptr =3D=3D 0) { diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/Ma= dtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/Ma= dtParser.c index 3a4f246347..10afe8ce60 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParse= r.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParse= r.c @@ -1,7 +1,7 @@ /** @file MADT table parser =20 - Copyright (c) 2016 - 2023, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2024, Arm Limited. All rights reserved. Copyright (c) 2022, AMD Incorporated. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -28,6 +28,7 @@ STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; This function validates the System Vector Base in the GICD. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -35,8 +36,9 @@ STATIC VOID EFIAPI ValidateGICDSystemVectorBase ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { if (*(UINT32 *)Ptr !=3D 0) { @@ -51,6 +53,7 @@ ValidateGICDSystemVectorBase ( This function validates the SPE Overflow Interrupt in the GICC. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -58,8 +61,9 @@ STATIC VOID EFIAPI ValidateSpeOverflowInterrupt ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { UINT16 SpeOverflowInterrupt; @@ -101,6 +105,7 @@ ValidateSpeOverflowInterrupt ( This function validates the TRBE Interrupt in the GICC. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -108,8 +113,9 @@ STATIC VOID EFIAPI ValidateTrbeInterrupt ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { UINT16 TrbeInterrupt; diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/Pc= ctParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/Pc= ctParser.c index 8ad39090af..43c6a9fb6f 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParse= r.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pcct/PcctParse= r.c @@ -1,7 +1,7 @@ /** @file PCCT table parser =20 - Copyright (c) 2021, Arm Limited. + Copyright (c) 2021 - 2024, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -28,6 +28,7 @@ STATIC UINT8 *ExtendedPccSubspaceInterruptFlags; This function validates the length coded on 4 bytes of a shared memory= range =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -35,8 +36,9 @@ STATIC VOID EFIAPI ValidateRangeLength4 ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { if (*(UINT32 *)Ptr < MIN_EXT_PCC_SUBSPACE_MEM_RANGE_LEN) { @@ -54,6 +56,7 @@ ValidateRangeLength4 ( This function validates the length coded on 8 bytes of a shared memory= range =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -61,8 +64,9 @@ STATIC VOID EFIAPI ValidateRangeLength8 ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { if (*(UINT64 *)Ptr <=3D MIN_MEMORY_RANGE_LENGTH) { @@ -80,6 +84,7 @@ ValidateRangeLength8 ( This function validates address space for Memory/IO GAS. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -87,8 +92,9 @@ STATIC VOID EFIAPI ValidatePccMemoryIoGas ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { switch (*(UINT8 *)Ptr) { @@ -107,6 +113,7 @@ ValidatePccMemoryIoGas ( This function validates address space for structures of types other th= an 0. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -114,8 +121,9 @@ STATIC VOID EFIAPI ValidatePccGas ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { switch (*(UINT8 *)Ptr) { @@ -135,6 +143,7 @@ ValidatePccGas ( This function validates doorbell address space for type 4 structure. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -142,8 +151,9 @@ STATIC VOID EFIAPI ValidatePccDoorbellGas ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { // For responder subspaces this field is optional, if not present the = field @@ -158,7 +168,7 @@ ValidatePccDoorbellGas ( } } =20 - ValidatePccGas (Ptr, Context); + ValidatePccGas (Ptr, Length, Context); } =20 /** @@ -166,6 +176,7 @@ ValidatePccDoorbellGas ( type 4 structure. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -173,8 +184,9 @@ STATIC VOID EFIAPI ValidatePccIntAckGas ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { // If the subspace does not support interrupts or the interrupt is @@ -196,13 +208,14 @@ ValidatePccIntAckGas ( } } =20 - ValidatePccGas (Ptr, Context); + ValidatePccGas (Ptr, Length, Context); } =20 /** This function validates error status address space for type 4 structur= e. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -210,8 +223,9 @@ STATIC VOID EFIAPI ValidatePccErrStatusGas ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { // This field is ignored by the OSPM on responder channels. @@ -219,13 +233,14 @@ ValidatePccErrStatusGas ( return; } =20 - ValidatePccGas (Ptr, Context); + ValidatePccGas (Ptr, Length, Context); } =20 /** This function validates platform interrupt flags for type 4 structure. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -233,8 +248,9 @@ STATIC VOID EFIAPI ValidatePlatInterrupt ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { // If a responder subspace is present in the PCCT, then the global Pla= tform diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/Pp= ttParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/Pp= ttParser.c index 5377764458..fabe057d05 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParse= r.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParse= r.c @@ -1,7 +1,7 @@ /** @file PPTT table parser =20 - Copyright (c) 2019 - 2021, ARM Limited. All rights reserved. + Copyright (c) 2019 - 2024, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -52,6 +52,7 @@ LogCacheFlagError ( This function validates the Cache Type Structure (Type 1) Cache Flags = field. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -59,8 +60,9 @@ STATIC VOID EFIAPI ValidateCacheFlags ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) @@ -115,6 +117,7 @@ ValidateCacheFlags ( field. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. thi= s could be a pointer to the ACPI table header. **/ @@ -122,8 +125,9 @@ STATIC VOID EFIAPI ValidateCacheNumberOfSets ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { UINT32 NumberOfSets; @@ -166,6 +170,7 @@ ValidateCacheNumberOfSets ( field. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. thi= s could be a pointer to the ACPI table header. **/ @@ -173,8 +178,9 @@ STATIC VOID EFIAPI ValidateCacheAssociativity ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { UINT8 Associativity; @@ -192,6 +198,7 @@ ValidateCacheAssociativity ( This function validates the Cache Type Structure (Type 1) Line size fi= eld. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -199,8 +206,9 @@ STATIC VOID EFIAPI ValidateCacheLineSize ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) @@ -237,6 +245,7 @@ ValidateCacheLineSize ( This function validates the Cache Type Structure (Type 1) Cache ID fie= ld. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -244,8 +253,9 @@ STATIC VOID EFIAPI ValidateCacheId ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { UINT32 CacheId; @@ -276,6 +286,7 @@ ValidateCacheId ( This function validates the Cache Type Structure (Type 1) Attributes f= ield. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -283,8 +294,9 @@ STATIC VOID EFIAPI ValidateCacheAttributes ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { // Reference: Advanced Configuration and Power Interface (ACPI) Specif= ication diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/Rs= dpParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/Rs= dpParser.c index bddf276356..895258bc1d 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParse= r.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParse= r.c @@ -1,7 +1,7 @@ /** @file RSDP table parser =20 - Copyright (c) 2016 - 2019, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2024, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -19,6 +19,7 @@ STATIC CONST UINT64 *XsdtAddress; This function validates the RSDT Address. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -26,8 +27,9 @@ STATIC VOID EFIAPI ValidateRsdtAddress ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) @@ -55,6 +57,7 @@ ValidateRsdtAddress ( This function validates the XSDT Address. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -62,8 +65,9 @@ STATIC VOID EFIAPI ValidateXsdtAddress ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/Sp= crParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/Sp= crParser.c index e5267b1d04..d172a555da 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrParse= r.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrParse= r.c @@ -1,7 +1,7 @@ /** @file SPCR table parser =20 - Copyright (c) 2016 - 2019, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2024, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -22,6 +22,7 @@ STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; This function validates the Interrupt Type. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -29,8 +30,9 @@ STATIC VOID EFIAPI ValidateInterruptType ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) @@ -55,6 +57,7 @@ ValidateInterruptType ( This function validates the Irq. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -62,8 +65,9 @@ STATIC VOID EFIAPI ValidateIrq ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/Sr= atParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/Sr= atParser.c index 2980704479..d9831023ce 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParse= r.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParse= r.c @@ -1,7 +1,7 @@ /** @file SRAT table parser =20 - Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2024, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -25,6 +25,7 @@ STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; This function validates the Reserved field in the SRAT table header. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -32,8 +33,9 @@ STATIC VOID EFIAPI ValidateSratReserved ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { if (*(UINT32 *)Ptr !=3D 1) { @@ -47,6 +49,7 @@ ValidateSratReserved ( Affinity Structure. =20 @param [in] Ptr Pointer to the start of the field data. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -54,8 +57,9 @@ STATIC VOID EFIAPI ValidateSratDeviceHandleType ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { UINT8 DeviceHandleType; diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Wsmt/Ws= mtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Wsmt/Ws= mtParser.c index 3c7252b0bf..96c2706c73 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Wsmt/WsmtParse= r.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Wsmt/WsmtParse= r.c @@ -1,6 +1,7 @@ /** @file WSMT table parser =20 + Copyright (c) 2024, Arm Limited. All rights reserved. Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -17,7 +18,8 @@ STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; /** This function validates the WSMT Protection flag. =20 - @param [in] Ptr Pointer to the start of the buffer. + @param [in] Ptr Pointer to the start of the buffer. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. =20 @@ -26,8 +28,9 @@ STATIC VOID EFIAPI ValidateWsmtProtectionFlag ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { UINT32 ProtectionFlag; @@ -49,7 +52,8 @@ ValidateWsmtProtectionFlag ( /** This function validates the reserved bits in the WSMT Protection flag. =20 - @param [in] Ptr Pointer to the start of the buffer. + @param [in] Ptr Pointer to the start of the buffer. + @param [in] Length Length of the field. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. **/ @@ -57,8 +61,9 @@ STATIC VOID EFIAPI ValidateReserved ( - IN UINT8 *Ptr, - IN VOID *Context + IN UINT8 *Ptr, + IN UINT32 Length, + IN VOID *Context ) { UINT32 ProtectionFlag; --=20 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119818): https://edk2.groups.io/g/devel/message/119818 Mute This Topic: https://groups.io/mt/107112181/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-