diff --git a/MdeModulePkg/Core/Dxe/SysCall/BootServices.c b/MdeModulePkg/Core/Dxe/SysCall/BootServices.c index 323cbb4ce3..c0b89ae0e6 100644 --- a/MdeModulePkg/Core/Dxe/SysCall/BootServices.c +++ b/MdeModulePkg/Core/Dxe/SysCall/BootServices.c @@ -643,7 +643,7 @@ CallBootService ( gCpu->GetMemoryAttributes (gCpu, (EFI_PHYSICAL_ADDRESS)(UserRsp->Arguments[5] + sizeof (EFI_HANDLE *) - 1), &Attributes); ASSERT ((Attributes & EFI_MEMORY_USER) != 0); - PagesNumber = EFI_SIZE_TO_PAGES (Argument4 * sizeof (EFI_HANDLE *)); + PagesNumber = (UINT32)EFI_SIZE_TO_PAGES (Argument4 * sizeof (EFI_HANDLE *)); Status = CoreAllocatePages ( AllocateAnyPages, diff --git a/MdeModulePkg/Core/Dxe/SysCall/SupportedProtocols.c b/MdeModulePkg/Core/Dxe/SysCall/SupportedProtocols.c index 38f7d977cc..4ee53708bb 100644 --- a/MdeModulePkg/Core/Dxe/SysCall/SupportedProtocols.c +++ b/MdeModulePkg/Core/Dxe/SysCall/SupportedProtocols.c @@ -78,8 +78,8 @@ GoToRing3 ( } STATIC -EFIAPI VOID * +EFIAPI Ring3Copy ( IN VOID *Core, IN UINT32 Size @@ -248,7 +248,7 @@ CoreFileRead ( Ring3Buffer = NULL; Ring3Pages = NULL; - PagesNumber = EFI_SIZE_TO_PAGES (sizeof (UINTN *) + *BufferSize); + PagesNumber = (UINT32)EFI_SIZE_TO_PAGES (sizeof (UINTN *) + *BufferSize); Status = CoreAllocatePages ( AllocateAnyPages, @@ -399,7 +399,7 @@ CoreFileGetInfo ( Ring3InformationType = NULL; Ring3Pages = NULL; - PagesNumber = EFI_SIZE_TO_PAGES (sizeof (UINTN *) + *BufferSize + sizeof (EFI_GUID)); + PagesNumber = (UINT32)EFI_SIZE_TO_PAGES (sizeof (UINTN *) + *BufferSize + sizeof (EFI_GUID)); Status = CoreAllocatePages ( AllocateAnyPages, @@ -550,7 +550,7 @@ CoreFileOpen ( Ring3FileName = NULL; Ring3Pages = NULL; - PagesNumber = EFI_SIZE_TO_PAGES (sizeof (EFI_FILE_PROTOCOL *) + StrSize (FileName)); + PagesNumber = (UINT32)EFI_SIZE_TO_PAGES (sizeof (EFI_FILE_PROTOCOL *) + StrSize (FileName)); Status = CoreAllocatePages ( AllocateAnyPages,