]>
Commit | Line | Data |
---|---|---|
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 | 10 | Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r |
cd5ebaa0 | 11 | This program and the accompanying materials\r |
fb0b259e | 12 | are licensed and made available under the terms and conditions of the BSD License\r |
13 | which accompanies this distribution. The full text of the license may be found at\r | |
14 | http://opensource.org/licenses/bsd-license.php\r | |
f2abdc91 | 15 | \r |
fb0b259e | 16 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
17 | WITHOUT 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 | 37 | EFI_STATUS\r |
38 | EFIAPI\r | |
39 | RuntimeDriverCalculateCrc32 (\r | |
40 | IN VOID *Data,\r | |
41 | IN UINTN DataSize,\r | |
42 | OUT UINT32 *CrcOut\r | |
43 | )\r | |
f2abdc91 | 44 | {\r |
3372ab3c LG |
45 | if (Data == NULL || DataSize == 0 || CrcOut == NULL) {\r |
46 | return EFI_INVALID_PARAMETER;\r | |
47 | }\r | |
48 | \r | |
05542f49 | 49 | *CrcOut = CalculateCrc32 (Data, DataSize);\r |
f2abdc91 | 50 | return EFI_SUCCESS;\r |
51 | }\r |