This commit is contained in:
2025-12-24 17:21:08 +09:00
parent a96323de19
commit 96dc62d8dc
2302 changed files with 455822 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* (C) Copyright 2009
* Marvell Semiconductor <www.marvell.com>
* Written-by: Prafulla Wadaskar <prafulla@marvell.com>
*/
#ifndef _UBOOT_CRC_H
#define _UBOOT_CRC_H
// #include <compiler.h> /* 'uint*' definitions */
typedef unsigned int uint;
/**
* crc32 - Calculate the CRC32 for a block of data
*
* @crc: Input crc to chain from a previous calculution (use 0 to start a new
* calculation)
* @buf: Bytes to checksum
* @len: Number of bytes to checksum
* @return checksum value
*/
uint32_t crc32(uint32_t crc, const unsigned char *buf, uint len);
/**
* crc32_no_comp - Calculate the CRC32 for a block of data (no one's compliment)
*
* This version uses a different algorithm which doesn't use one's compliment.
* JFFS2 (and other things?) use this.
*
* @crc: Input crc to chain from a previous calculution (use 0 to start a new
* calculation)
* @buf: Bytes to checksum
* @len: Number of bytes to checksum
* @return checksum value
*/
uint32_t crc32_no_comp(uint32_t crc, const unsigned char *buf, uint len);
#endif /* _UBOOT_CRC_H */