]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Core/RuntimeDxe/Crc32.c
MdeModulePkg: Apply uncrustify changes
[mirror_edk2.git] / MdeModulePkg / Core / RuntimeDxe / Crc32.c
CommitLineData
fb0b259e 1/** @file\r
48557c65 2 This file implements CalculateCrc32 Boot Services as defined in\r
3 Platform Initialization specification 1.0 VOLUME 2 DXE Core Interface.\r
fb0b259e 4\r
9920ae74 5 This Boot Services is in the Runtime Driver because this service is\r
6 also required by SetVirtualAddressMap() when the EFI System Table and\r
7 EFI Runtime Services Table are converted from physical address to\r
48557c65 8 virtual addresses. This requires that the 32-bit CRC be recomputed.\r
9920ae74 9\r
05542f49 10Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
9d510e61 11SPDX-License-Identifier: BSD-2-Clause-Patent\r
f2abdc91 12\r
fb0b259e 13**/\r
f2abdc91 14\r
60c93673 15#include <Uefi.h>\r
05542f49 16#include <Library/BaseLib.h>\r
f2abdc91 17\r
fb0b259e 18/**\r
19 Calculate CRC32 for target data.\r
20\r
9fc78752 21 @param Data The target data.\r
fb0b259e 22 @param DataSize The target data size.\r
23 @param CrcOut The CRC32 for target data.\r
24\r
25 @retval EFI_SUCCESS The CRC32 for target data is calculated successfully.\r
26 @retval EFI_INVALID_PARAMETER Some parameter is not valid, so the CRC32 is not\r
27 calculated.\r
28\r
29**/\r
f2abdc91 30EFI_STATUS\r
31EFIAPI\r
32RuntimeDriverCalculateCrc32 (\r
33 IN VOID *Data,\r
34 IN UINTN DataSize,\r
35 OUT UINT32 *CrcOut\r
36 )\r
f2abdc91 37{\r
1436aea4 38 if ((Data == NULL) || (DataSize == 0) || (CrcOut == NULL)) {\r
3372ab3c
LG
39 return EFI_INVALID_PARAMETER;\r
40 }\r
41\r
05542f49 42 *CrcOut = CalculateCrc32 (Data, DataSize);\r
f2abdc91 43 return EFI_SUCCESS;\r
44}\r