]> git.ipfire.org Git - people/ms/u-boot.git/blame - include/crc.h
arc: cache - build invalidate_icache_all() and invalidate_dcache_all()
[people/ms/u-boot.git] / include / crc.h
CommitLineData
cf48eb9a
WD
1/*
2 *==========================================================================
3 *
4 * crc.h
5 *
6 * Interface for the CRC algorithms.
7 *
8 *==========================================================================
e85427fd 9 * SPDX-License-Identifier: eCos-2.0
cf48eb9a
WD
10 *==========================================================================
11 *#####DESCRIPTIONBEGIN####
12 *
13 * Author(s): Andrew Lunn
14 * Contributors: Andrew Lunn
15 * Date: 2002-08-06
16 * Purpose:
17 * Description:
18 *
19 * This code is part of eCos (tm).
20 *
21 *####DESCRIPTIONEND####
22 *
23 *==========================================================================
24 */
f2841d37
MK
25
26#ifndef _SERVICES_CRC_CRC_H_
27#define _SERVICES_CRC_CRC_H_
28
29#include <linux/types.h>
30
31#ifndef __externC
32# ifdef __cplusplus
33# define __externC extern "C"
34# else
35# define __externC extern
36# endif
37#endif
38
cf48eb9a
WD
39/* Compute a CRC, using the POSIX 1003 definition */
40extern uint32_t
f2841d37
MK
41cyg_posix_crc32(unsigned char *s, int len);
42
cf48eb9a 43/* Gary S. Brown's 32 bit CRC */
f2841d37 44
cf48eb9a 45extern uint32_t
f2841d37
MK
46cyg_crc32(unsigned char *s, int len);
47
cf48eb9a
WD
48/* Gary S. Brown's 32 bit CRC, but accumulate the result from a */
49/* previous CRC calculation */
f2841d37 50
cf48eb9a 51extern uint32_t
f2841d37
MK
52cyg_crc32_accumulate(uint32_t crc, unsigned char *s, int len);
53
cf48eb9a 54/* Ethernet FCS Algorithm */
f2841d37 55
cf48eb9a 56extern uint32_t
f2841d37
MK
57cyg_ether_crc32(unsigned char *s, int len);
58
cf48eb9a
WD
59/* Ethernet FCS algorithm, but accumulate the result from a previous */
60/* CRC calculation. */
f2841d37 61
cf48eb9a 62extern uint32_t
f2841d37
MK
63cyg_ether_crc32_accumulate(uint32_t crc, unsigned char *s, int len);
64
cf48eb9a 65/* 16 bit CRC with polynomial x^16+x^12+x^5+1 */
f2841d37
MK
66
67extern uint16_t cyg_crc16(unsigned char *s, int len);
68
cf48eb9a 69#endif /* _SERVICES_CRC_CRC_H_ */