]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdeModulePkg/Core/RuntimeDxe/Crc32.c
MdeModulePkg/S3SmmInitDone.h: Fix copyright coding style error.
[mirror_edk2.git] / MdeModulePkg / Core / RuntimeDxe / Crc32.c
... / ...
CommitLineData
1/** @file\r
2 This file implements CalculateCrc32 Boot Services as defined in\r
3 Platform Initialization specification 1.0 VOLUME 2 DXE Core Interface.\r
4\r
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
8 virtual addresses. This requires that the 32-bit CRC be recomputed.\r
9\r
10Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
11This program and the accompanying materials\r
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
15\r
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
18\r
19**/\r
20\r
21\r
22#include <Uefi.h>\r
23#include <Library/BaseLib.h>\r
24\r
25/**\r
26 Calculate CRC32 for target data.\r
27\r
28 @param Data The target data.\r
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
37EFI_STATUS\r
38EFIAPI\r
39RuntimeDriverCalculateCrc32 (\r
40 IN VOID *Data,\r
41 IN UINTN DataSize,\r
42 OUT UINT32 *CrcOut\r
43 )\r
44{\r
45 if (Data == NULL || DataSize == 0 || CrcOut == NULL) {\r
46 return EFI_INVALID_PARAMETER;\r
47 }\r
48\r
49 *CrcOut = CalculateCrc32 (Data, DataSize);\r
50 return EFI_SUCCESS;\r
51}\r