Reviewed-by: Samer El-Haj-Mahmoud <samer.el-haj-mahm...@arm.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Heinrich
> Schuchardt via groups.io
> Sent: Friday, April 30, 2021 3:40 PM
> To: EDK II Development <devel@edk2.groups.io>
> Cc: Eric Jin <eric....@intel.com>; G Edhaya Chandran
> <edhaya.chand...@arm.com>; Barton Gao <gao...@byosoft.com.cn>; Arvin
> Chen <arvinx.c...@intel.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-
> mahm...@arm.com>; Heinrich Schuchardt <xypron.g...@gmx.de>
> Subject: [edk2-devel] [PATCH edk2-test 1/1] uefi-sct/SctPkg: correct print 
> code
> for EFI_MEMORY_TYPE
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2284
>
> EFI_MEMORY_TYPE is an enum. SctPrint expects an UINTN when printing with
> %d. Add missing conversions in MemoryAllocationServicesBBTestFunction.
>
> Signed-off-by: Heinrich Schuchardt <xypron.g...@gmx.de>
> ---
>  .../MemoryAllocationServicesBBTestFunction.c  | 98 +++++++++----------
>  1 file changed, 49 insertions(+), 49 deletions(-)
>
> diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/MemoryAllocationServices/BlackB
> oxTest/MemoryAllocationServicesBBTestFunction.c b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/MemoryAllocationServices/BlackB
> oxTest/MemoryAllocationServicesBBTestFunction.c
> index bf8cd3b3afa4..e545b3cfc5b8 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/MemoryAllocationServices/BlackB
> oxTest/MemoryAllocationServicesBBTestFunction.c
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/BootServices/MemoryAllocationServices/BlackB
> oxTest/MemoryAllocationServicesBBTestFunction.c
> @@ -417,7 +417,7 @@ BBTestAllocatePagesInterfaceTest (
>                       (UINTN)__LINE__,
>                       Status,
>                       TplArray[Index],
> -                     AllocatePagesMemoryType[TypeIndex]
> +                     (UINTN)AllocatePagesMemoryType[TypeIndex]
>                       );
>        if (!(Memory & EFI_PAGE_MASK)) {
>          AssertionType = EFI_TEST_ASSERTION_PASSED;
> @@ -437,7 +437,7 @@ BBTestAllocatePagesInterfaceTest (
>                       __FILE__,
>                       (UINTN)__LINE__,
>                       TplArray[Index],
> -                     AllocatePagesMemoryType[TypeIndex]
> +                     (UINTN)AllocatePagesMemoryType[TypeIndex]
>                       );
>        if (Memory != 0) {
>          Status = gtBS->FreePages (
> @@ -455,7 +455,7 @@ BBTestAllocatePagesInterfaceTest (
>                           (UINTN)__LINE__,
>                           Status,
>                           TplArray[Index],
> -                         AllocatePagesMemoryType[TypeIndex]
> +                         (UINTN)AllocatePagesMemoryType[TypeIndex]
>                           );
>          }
>        }
> @@ -478,7 +478,7 @@ BBTestAllocatePagesInterfaceTest (
>                         (UINTN)__LINE__,
>                         Status,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>        } else {
>          PageNum = (UINTN)Descriptor.NumberOfPages;
> @@ -512,7 +512,7 @@ BBTestAllocatePagesInterfaceTest (
>                         (UINTN)__LINE__,
>                         Status,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (!(Memory & EFI_PAGE_MASK)) {
>            AssertionType = EFI_TEST_ASSERTION_PASSED;
> @@ -532,7 +532,7 @@ BBTestAllocatePagesInterfaceTest (
>                         __FILE__,
>                         (UINTN)__LINE__,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (Memory <= Descriptor.PhysicalStart +
>               SctLShiftU64 (Descriptor.NumberOfPages, EFI_PAGE_SHIFT) -
> @@ -554,7 +554,7 @@ BBTestAllocatePagesInterfaceTest (
>                         __FILE__,
>                         (UINTN)__LINE__,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex],
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex],
>                         Descriptor.PhysicalStart,
>                         Descriptor.NumberOfPages,
>                         Memory
> @@ -589,7 +589,7 @@ BBTestAllocatePagesInterfaceTest (
>                         (UINTN)__LINE__,
>                         Status,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (!(Memory2 & EFI_PAGE_MASK)) {
>            AssertionType = EFI_TEST_ASSERTION_PASSED;
> @@ -609,7 +609,7 @@ BBTestAllocatePagesInterfaceTest (
>                         __FILE__,
>                         (UINTN)__LINE__,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if ( Memory2 <= Descriptor.PhysicalStart +
>               SctLShiftU64 (Descriptor.NumberOfPages, EFI_PAGE_SHIFT) -
> @@ -631,7 +631,7 @@ BBTestAllocatePagesInterfaceTest (
>                         __FILE__,
>                         (UINTN)__LINE__,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex],
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex],
>                         Memory2
>                         );
>          if (Memory != 0) {
> @@ -650,7 +650,7 @@ BBTestAllocatePagesInterfaceTest (
>                             (UINTN)__LINE__,
>                             Status,
>                             TplArray[Index],
> -                           AllocatePagesMemoryType[TypeIndex]
> +                           (UINTN)AllocatePagesMemoryType[TypeIndex]
>                             );
>            }
>          }
> @@ -670,7 +670,7 @@ BBTestAllocatePagesInterfaceTest (
>                             (UINTN)__LINE__,
>                             Status,
>                             TplArray[Index],
> -                           AllocatePagesMemoryType[TypeIndex]
> +                           (UINTN)AllocatePagesMemoryType[TypeIndex]
>                             );
>            }
>          }
> @@ -694,7 +694,7 @@ BBTestAllocatePagesInterfaceTest (
>                         (UINTN)__LINE__,
>                         Status,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>        } else {
>          PageNum = (UINTN)Descriptor.NumberOfPages;
> @@ -739,7 +739,7 @@ BBTestAllocatePagesInterfaceTest (
>                         (UINTN)__LINE__,
>                         Status,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (!(Memory & EFI_PAGE_MASK)) {
>            AssertionType = EFI_TEST_ASSERTION_PASSED;
> @@ -759,7 +759,7 @@ BBTestAllocatePagesInterfaceTest (
>                         __FILE__,
>                         (UINTN)__LINE__,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (Memory == Start) {
>            AssertionType = EFI_TEST_ASSERTION_PASSED;
> @@ -779,7 +779,7 @@ BBTestAllocatePagesInterfaceTest (
>                         __FILE__,
>                         (UINTN)__LINE__,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (Memory != 0) {
>            Status = gtBS->FreePages (
> @@ -797,7 +797,7 @@ BBTestAllocatePagesInterfaceTest (
>                             (UINTN)__LINE__,
>                             Status,
>                             TplArray[Index],
> -                           AllocatePagesMemoryType[TypeIndex]
> +                           (UINTN)AllocatePagesMemoryType[TypeIndex]
>                             );
>            }
>          }
> @@ -824,7 +824,7 @@ BBTestAllocatePagesInterfaceTest (
>                         (UINTN)__LINE__,
>                         Status,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>        } else {
>          PageNum = (UINTN)Descriptor.NumberOfPages;
> @@ -869,7 +869,7 @@ BBTestAllocatePagesInterfaceTest (
>                         (UINTN)__LINE__,
>                         Status,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (!(Memory & EFI_PAGE_MASK)) {
>            AssertionType = EFI_TEST_ASSERTION_PASSED;
> @@ -889,7 +889,7 @@ BBTestAllocatePagesInterfaceTest (
>                         __FILE__,
>                         (UINTN)__LINE__,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (Memory == Start) {
>            AssertionType = EFI_TEST_ASSERTION_PASSED;
> @@ -909,7 +909,7 @@ BBTestAllocatePagesInterfaceTest (
>                         __FILE__,
>                         (UINTN)__LINE__,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (Memory != 0) {
>            Status = gtBS->FreePages (
> @@ -927,7 +927,7 @@ BBTestAllocatePagesInterfaceTest (
>                             (UINTN)__LINE__,
>                             Status,
>                             TplArray[Index],
> -                           AllocatePagesMemoryType[TypeIndex]
> +                           (UINTN)AllocatePagesMemoryType[TypeIndex]
>                             );
>            }
>          }
> @@ -947,7 +947,7 @@ BBTestAllocatePagesInterfaceTest (
>                         (UINTN)__LINE__,
>                         Status,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>        } else {
>          PageNum = (UINTN)Descriptor.NumberOfPages;
> @@ -992,7 +992,7 @@ BBTestAllocatePagesInterfaceTest (
>                         (UINTN)__LINE__,
>                         Status,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (!(Memory & EFI_PAGE_MASK)) {
>            AssertionType = EFI_TEST_ASSERTION_PASSED;
> @@ -1012,7 +1012,7 @@ BBTestAllocatePagesInterfaceTest (
>                         __FILE__,
>                         (UINTN)__LINE__,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (Memory == Start + (SctLShiftU64 (PageNum/3, EFI_PAGE_SHIFT) &
> 0xFFFFFFFFFFFF0000)) {
>            AssertionType = EFI_TEST_ASSERTION_PASSED;
> @@ -1032,7 +1032,7 @@ BBTestAllocatePagesInterfaceTest (
>                         __FILE__,
>                         (UINTN)__LINE__,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (Memory != 0) {
>            Status = gtBS->FreePages (
> @@ -1050,7 +1050,7 @@ BBTestAllocatePagesInterfaceTest (
>                             (UINTN)__LINE__,
>                             Status,
>                             TplArray[Index],
> -                           AllocatePagesMemoryType[TypeIndex]
> +                           (UINTN)AllocatePagesMemoryType[TypeIndex]
>                             );
>            }
>          }
> @@ -1070,7 +1070,7 @@ BBTestAllocatePagesInterfaceTest (
>                         (UINTN)__LINE__,
>                         Status,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>        } else {
>          PageNum = (UINTN)Descriptor.NumberOfPages;
> @@ -1115,7 +1115,7 @@ BBTestAllocatePagesInterfaceTest (
>                         (UINTN)__LINE__,
>                         Status,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (!(Memory & EFI_PAGE_MASK)) {
>            AssertionType = EFI_TEST_ASSERTION_PASSED;
> @@ -1135,7 +1135,7 @@ BBTestAllocatePagesInterfaceTest (
>                         __FILE__,
>                         (UINTN)__LINE__,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (Memory == Start + (SctLShiftU64 (PageNum * 2 / 3, 
> EFI_PAGE_SHIFT) &
> 0xFFFFFFFFFFFF0000)) {
>            AssertionType = EFI_TEST_ASSERTION_PASSED;
> @@ -1155,7 +1155,7 @@ BBTestAllocatePagesInterfaceTest (
>                         __FILE__,
>                         (UINTN)__LINE__,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (Memory != 0) {
>            Status = gtBS->FreePages (
> @@ -1173,7 +1173,7 @@ BBTestAllocatePagesInterfaceTest (
>                             (UINTN)__LINE__,
>                             Status,
>                             TplArray[Index],
> -                           AllocatePagesMemoryType[TypeIndex]
> +                           (UINTN)AllocatePagesMemoryType[TypeIndex]
>                             );
>            }
>          }
> @@ -1200,7 +1200,7 @@ BBTestAllocatePagesInterfaceTest (
>                         (UINTN)__LINE__,
>                         Status,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>        } else {
>          PageNum = (UINTN)Descriptor.NumberOfPages;
> @@ -1245,7 +1245,7 @@ BBTestAllocatePagesInterfaceTest (
>                         (UINTN)__LINE__,
>                         Status,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (!(Memory & EFI_PAGE_MASK)) {
>            AssertionType = EFI_TEST_ASSERTION_PASSED;
> @@ -1265,7 +1265,7 @@ BBTestAllocatePagesInterfaceTest (
>                         __FILE__,
>                         (UINTN)__LINE__,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (Memory == Start) {
>            AssertionType = EFI_TEST_ASSERTION_PASSED;
> @@ -1285,7 +1285,7 @@ BBTestAllocatePagesInterfaceTest (
>                         __FILE__,
>                         (UINTN)__LINE__,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (Memory != 0) {
>            Status = gtBS->FreePages (
> @@ -1303,7 +1303,7 @@ BBTestAllocatePagesInterfaceTest (
>                             (UINTN)__LINE__,
>                             Status,
>                             TplArray[Index],
> -                           AllocatePagesMemoryType[TypeIndex]
> +                           (UINTN)AllocatePagesMemoryType[TypeIndex]
>                             );
>            }
>          }
> @@ -1323,7 +1323,7 @@ BBTestAllocatePagesInterfaceTest (
>                         (UINTN)__LINE__,
>                         Status,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>        } else {
>          PageNum = (UINTN)Descriptor.NumberOfPages;
> @@ -1377,7 +1377,7 @@ BBTestAllocatePagesInterfaceTest (
>                         (UINTN)__LINE__,
>                         Status,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (!(Memory & EFI_PAGE_MASK)) {
>            AssertionType = EFI_TEST_ASSERTION_PASSED;
> @@ -1397,7 +1397,7 @@ BBTestAllocatePagesInterfaceTest (
>                         __FILE__,
>                         (UINTN)__LINE__,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (Memory == Start) {
>            AssertionType = EFI_TEST_ASSERTION_PASSED;
> @@ -1417,7 +1417,7 @@ BBTestAllocatePagesInterfaceTest (
>                         __FILE__,
>                         (UINTN)__LINE__,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (Memory != 0) {
>            if (PageNum != 1) {
> @@ -1442,7 +1442,7 @@ BBTestAllocatePagesInterfaceTest (
>                             (UINTN)__LINE__,
>                             Status,
>                             TplArray[Index],
> -                           AllocatePagesMemoryType[TypeIndex]
> +                           (UINTN)AllocatePagesMemoryType[TypeIndex]
>                             );
>            }
>          }
> @@ -1462,7 +1462,7 @@ BBTestAllocatePagesInterfaceTest (
>                         (UINTN)__LINE__,
>                         Status,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>        } else {
>          PageNum = (UINTN)Descriptor.NumberOfPages;
> @@ -1507,7 +1507,7 @@ BBTestAllocatePagesInterfaceTest (
>                         (UINTN)__LINE__,
>                         Status,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (!(Memory & EFI_PAGE_MASK)) {
>            AssertionType = EFI_TEST_ASSERTION_PASSED;
> @@ -1527,7 +1527,7 @@ BBTestAllocatePagesInterfaceTest (
>                         __FILE__,
>                         (UINTN)__LINE__,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (Memory == Start) {
>            AssertionType = EFI_TEST_ASSERTION_PASSED;
> @@ -1547,7 +1547,7 @@ BBTestAllocatePagesInterfaceTest (
>                         __FILE__,
>                         (UINTN)__LINE__,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          if (Memory != 0) {
>            Status = gtBS->FreePages (
> @@ -1565,7 +1565,7 @@ BBTestAllocatePagesInterfaceTest (
>                             (UINTN)__LINE__,
>                             Status,
>                             TplArray[Index],
> -                           AllocatePagesMemoryType[TypeIndex]
> +                           (UINTN)AllocatePagesMemoryType[TypeIndex]
>                             );
>            }
>          }
> @@ -1656,7 +1656,7 @@ BBTestFreePagesInterfaceTest (
>                         (UINTN)__LINE__,
>                         Status,
>                         TplArray[Index],
> -                       AllocatePagesMemoryType[TypeIndex]
> +                       (UINTN)AllocatePagesMemoryType[TypeIndex]
>                         );
>          continue;
>        }
> @@ -1685,7 +1685,7 @@ BBTestFreePagesInterfaceTest (
>                       (UINTN)__LINE__,
>                       Status,
>                       TplArray[Index],
> -                     AllocatePagesMemoryType[TypeIndex]
> +                     (UINTN)AllocatePagesMemoryType[TypeIndex]
>                       );
>      }
>
> --
> 2.30.2
>
>
>
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#74678): https://edk2.groups.io/g/devel/message/74678
> Mute This Topic: https://groups.io/mt/82490304/1945644
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [samer.el-haj-
> mahm...@arm.com]
> -=-=-=-=-=-=
>

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78612): https://edk2.groups.io/g/devel/message/78612
Mute This Topic: https://groups.io/mt/82490304/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to