]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Core/RuntimeDxe/Crc32.c
MdeModulePkg: Update modules to consume CalculateCrc32()
[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
cd5ebaa0 11This program and the accompanying materials\r
fb0b259e 12are licensed and made available under the terms and conditions of the BSD License\r
13which accompanies this distribution. The full text of the license may be found at\r
14http://opensource.org/licenses/bsd-license.php\r
f2abdc91 15\r
fb0b259e 16THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
17WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
f2abdc91 18\r
fb0b259e 19**/\r
f2abdc91 20\r
ed7748fe 21\r
60c93673 22#include <Uefi.h>\r
05542f49 23#include <Library/BaseLib.h>\r
f2abdc91 24\r
fb0b259e 25/**\r
26 Calculate CRC32 for target data.\r
27\r
9fc78752 28 @param Data The target data.\r
fb0b259e 29 @param DataSize The target data size.\r
30 @param CrcOut The CRC32 for target data.\r
31\r
32 @retval EFI_SUCCESS The CRC32 for target data is calculated successfully.\r
33 @retval EFI_INVALID_PARAMETER Some parameter is not valid, so the CRC32 is not\r
34 calculated.\r
35\r
36**/\r
f2abdc91 37EFI_STATUS\r
38EFIAPI\r
39RuntimeDriverCalculateCrc32 (\r
40 IN VOID *Data,\r
41 IN UINTN DataSize,\r
42 OUT UINT32 *CrcOut\r
43 )\r
f2abdc91 44{\r
05542f49 45 *CrcOut = CalculateCrc32 (Data, DataSize);\r
f2abdc91 46 return EFI_SUCCESS;\r
47}\r