Home
last modified time | relevance | path

Searched full:crc (Results 1 – 25 of 2473) sorted by relevance

12345678910>>...99

/kernel/linux/linux-4.19/lib/
Dcrc32.c58 crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 (*tab)[256]) argument
61 # define DO_CRC(x) crc = t0[(crc ^ (x)) & 255] ^ (crc >> 8)
67 # define DO_CRC(x) crc = t0[((crc >> 24) ^ (x)) & 255] ^ (crc << 8)
106 q = crc ^ *++b; /* use pre increment for speed */
108 crc = DO_CRC4;
110 crc = DO_CRC8;
112 crc ^= DO_CRC4;
128 return crc;
139 * @crc: seed value for computation. ~0 for Ethernet, sometimes 0 for other
146 static inline u32 __pure crc32_le_generic(u32 crc, unsigned char const *p, argument
[all …]
Dgen_crc32table.c33 * crc is the crc of the byte i; other entries are filled in based on the
41 uint32_t crc = 1; in crc32init_le_generic() local
46 crc = (crc >> 1) ^ ((crc & 1) ? polynomial : 0); in crc32init_le_generic()
48 tab[0][i + j] = crc ^ tab[0][j]; in crc32init_le_generic()
51 crc = tab[0][i]; in crc32init_le_generic()
53 crc = tab[0][crc & 0xff] ^ (crc >> 8); in crc32init_le_generic()
54 tab[j][i] = crc; in crc32init_le_generic()
75 uint32_t crc = 0x80000000; in crc32init_be() local
80 crc = (crc << 1) ^ ((crc & 0x80000000) ? CRC32_POLY_BE : 0); in crc32init_be()
82 crc32table_be[0][i + j] = crc ^ crc32table_be[0][j]; in crc32init_be()
[all …]
/kernel/linux/linux-5.10/lib/
Dcrc32.c58 crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 (*tab)[256]) argument
61 # define DO_CRC(x) crc = t0[(crc ^ (x)) & 255] ^ (crc >> 8)
67 # define DO_CRC(x) crc = t0[((crc >> 24) ^ (x)) & 255] ^ (crc << 8)
106 q = crc ^ *++b; /* use pre increment for speed */
108 crc = DO_CRC4;
110 crc = DO_CRC8;
112 crc ^= DO_CRC4;
128 return crc;
139 * @crc: seed value for computation. ~0 for Ethernet, sometimes 0 for other
146 static inline u32 __pure crc32_le_generic(u32 crc, unsigned char const *p, argument
[all …]
Dgen_crc32table.c33 * crc is the crc of the byte i; other entries are filled in based on the
41 uint32_t crc = 1; in crc32init_le_generic() local
46 crc = (crc >> 1) ^ ((crc & 1) ? polynomial : 0); in crc32init_le_generic()
48 tab[0][i + j] = crc ^ tab[0][j]; in crc32init_le_generic()
51 crc = tab[0][i]; in crc32init_le_generic()
53 crc = tab[0][crc & 0xff] ^ (crc >> 8); in crc32init_le_generic()
54 tab[j][i] = crc; in crc32init_le_generic()
75 uint32_t crc = 0x80000000; in crc32init_be() local
80 crc = (crc << 1) ^ ((crc & 0x80000000) ? CRC32_POLY_BE : 0); in crc32init_be()
82 crc32table_be[0][i + j] = crc ^ crc32table_be[0][j]; in crc32init_be()
[all …]
/kernel/linux/linux-4.19/drivers/gpu/drm/
Ddrm_debugfs_crc.c36 * DOC: CRC ABI
38 * DRM device drivers can provide to userspace CRC information of each frame as
39 * it reached a given hardware component (a CRC sampling "source").
42 * file dri/0/crtc-N/crc/control in debugfs, with N being the index of the CRTC.
47 * Once frame CRC generation is enabled, userspace can capture them by reading
48 * the dri/0/crtc-N/crc/data file. Each line in that file contains the frame
50 * containing the CRC data. Fields are separated by a single space and the number
51 * of CRC fields is source-specific.
53 * Note that though in some cases the CRC is computed in a specified way and on
54 * the frame contents as supplied by userspace (eDP 1.3), in general the CRC
[all …]
/kernel/linux/linux-5.10/drivers/gpu/drm/
Ddrm_debugfs_crc.c43 * DOC: CRC ABI
45 * DRM device drivers can provide to userspace CRC information of each frame as
46 * it reached a given hardware component (a CRC sampling "source").
49 * file dri/0/crtc-N/crc/control in debugfs, with N being the index of the CRTC.
54 * Once frame CRC generation is enabled, userspace can capture them by reading
55 * the dri/0/crtc-N/crc/data file. Each line in that file contains the frame
57 * containing the CRC data. Fields are separated by a single space and the number
58 * of CRC fields is source-specific.
60 * Note that though in some cases the CRC is computed in a specified way and on
61 * the frame contents as supplied by userspace (eDP 1.3), in general the CRC
[all …]
/kernel/linux/linux-5.10/drivers/gpu/drm/nouveau/dispnv50/
Dcrc.c19 #include "crc.h"
77 core->func->crc->set_ctx(head, ctx); in nv50_crc_program_ctx()
84 struct nv50_crc *crc = container_of(work, struct nv50_crc, flip_work); in nv50_crc_ctx_flip_work() local
85 struct nv50_head *head = container_of(crc, struct nv50_head, crc); in nv50_crc_ctx_flip_work()
88 u8 new_idx = crc->ctx_idx ^ 1; in nv50_crc_ctx_flip_work()
96 "Lock contended, delaying CRC ctx flip for head-%d\n", in nv50_crc_ctx_flip_work()
106 drm_crtc_index(crtc), crc->ctx_idx, new_idx); in nv50_crc_ctx_flip_work()
109 nv50_crc_program_ctx(head, &crc->ctx[new_idx]); in nv50_crc_ctx_flip_work()
112 spin_lock_irq(&crc->lock); in nv50_crc_ctx_flip_work()
113 crc->ctx_changed = true; in nv50_crc_ctx_flip_work()
[all …]
/kernel/linux/linux-4.19/drivers/crypto/stm32/
Dstm32_crc32.c98 struct stm32_crc *crc; in stm32_crc_get_next_crc() local
101 crc = list_first_entry(&crc_list.dev_list, struct stm32_crc, list); in stm32_crc_get_next_crc()
102 if (crc) in stm32_crc_get_next_crc()
103 list_move_tail(&crc->list, &crc_list.dev_list); in stm32_crc_get_next_crc()
106 return crc; in stm32_crc_get_next_crc()
113 struct stm32_crc *crc; in stm32_crc_init() local
115 crc = stm32_crc_get_next_crc(); in stm32_crc_init()
116 if (!crc) in stm32_crc_init()
119 pm_runtime_get_sync(crc->dev); in stm32_crc_init()
122 writel_relaxed(bitrev32(mctx->key), crc->regs + CRC_INIT); in stm32_crc_init()
[all …]
/kernel/linux/linux-5.10/drivers/crypto/stm32/
Dstm32-crc32.c104 struct stm32_crc *crc; in stm32_crc_get_next_crc() local
107 crc = list_first_entry(&crc_list.dev_list, struct stm32_crc, list); in stm32_crc_get_next_crc()
108 if (crc) in stm32_crc_get_next_crc()
109 list_move_tail(&crc->list, &crc_list.dev_list); in stm32_crc_get_next_crc()
112 return crc; in stm32_crc_get_next_crc()
119 struct stm32_crc *crc; in stm32_crc_init() local
122 crc = stm32_crc_get_next_crc(); in stm32_crc_init()
123 if (!crc) in stm32_crc_init()
126 pm_runtime_get_sync(crc->dev); in stm32_crc_init()
128 spin_lock_irqsave(&crc->lock, flags); in stm32_crc_init()
[all …]
/kernel/linux/linux-5.10/fs/xfs/libxfs/
Dxfs_cksum.h8 * Calculate the intermediate checksum for a buffer that has the CRC field
9 * inside it. The offset of the 32bit crc fields is passed as the
11 * hence we have to split the CRC calculation across the cksum_offset.
17 uint32_t crc; in xfs_start_cksum_safe() local
19 /* Calculate CRC up to the checksum. */ in xfs_start_cksum_safe()
20 crc = crc32c(XFS_CRC_SEED, buffer, cksum_offset); in xfs_start_cksum_safe()
23 crc = crc32c(crc, &zero, sizeof(__u32)); in xfs_start_cksum_safe()
25 /* Calculate the rest of the CRC. */ in xfs_start_cksum_safe()
26 return crc32c(crc, &buffer[cksum_offset + sizeof(__be32)], in xfs_start_cksum_safe()
31 * Fast CRC method where the buffer is modified. Callers must have exclusive
[all …]
/kernel/linux/linux-4.19/fs/xfs/libxfs/
Dxfs_cksum.h8 * Calculate the intermediate checksum for a buffer that has the CRC field
9 * inside it. The offset of the 32bit crc fields is passed as the
11 * hence we have to split the CRC calculation across the cksum_offset.
17 uint32_t crc; in xfs_start_cksum_safe() local
19 /* Calculate CRC up to the checksum. */ in xfs_start_cksum_safe()
20 crc = crc32c(XFS_CRC_SEED, buffer, cksum_offset); in xfs_start_cksum_safe()
23 crc = crc32c(crc, &zero, sizeof(__u32)); in xfs_start_cksum_safe()
25 /* Calculate the rest of the CRC. */ in xfs_start_cksum_safe()
26 return crc32c(crc, &buffer[cksum_offset + sizeof(__be32)], in xfs_start_cksum_safe()
31 * Fast CRC method where the buffer is modified. Callers must have exclusive
[all …]
/kernel/linux/linux-5.10/arch/powerpc/crypto/
Dcrct10dif-vpmsum_glue.c3 * Calculate a CRC T10-DIF with vpmsum acceleration
9 #include <linux/crc-t10dif.h>
25 u32 __crct10dif_vpmsum(u32 crc, unsigned char const *p, size_t len);
31 u32 crc = crci; in crct10dif_vpmsum() local
34 return crc_t10dif_generic(crc, p, len); in crct10dif_vpmsum()
38 crc = crc_t10dif_generic(crc, p, prealign); in crct10dif_vpmsum()
44 crc <<= 16; in crct10dif_vpmsum()
48 crc = __crct10dif_vpmsum(crc, p, len & ~VMX_ALIGN_MASK); in crct10dif_vpmsum()
52 crc >>= 16; in crct10dif_vpmsum()
58 crc = crc_t10dif_generic(crc, p, tail); in crct10dif_vpmsum()
[all …]
/kernel/linux/linux-5.10/arch/arm/crypto/
Dcrc32-ce-glue.c3 * Accelerated CRC32(C) using ARM CRC, NEON and Crypto Extensions instructions
66 u32 *crc = shash_desc_ctx(desc); in crc32_init() local
68 *crc = *mctx; in crc32_init()
75 u32 *crc = shash_desc_ctx(desc); in crc32_update() local
77 *crc = crc32_armv8_le(*crc, data, length); in crc32_update()
84 u32 *crc = shash_desc_ctx(desc); in crc32c_update() local
86 *crc = crc32c_armv8_le(*crc, data, length); in crc32c_update()
92 u32 *crc = shash_desc_ctx(desc); in crc32_final() local
94 put_unaligned_le32(*crc, out); in crc32_final()
100 u32 *crc = shash_desc_ctx(desc); in crc32c_final() local
[all …]
/kernel/linux/linux-4.19/arch/arm/crypto/
Dcrc32-ce-glue.c2 * Accelerated CRC32(C) using ARM CRC, NEON and Crypto Extensions instructions
70 u32 *crc = shash_desc_ctx(desc); in crc32_init() local
72 *crc = *mctx; in crc32_init()
79 u32 *crc = shash_desc_ctx(desc); in crc32_update() local
81 *crc = crc32_armv8_le(*crc, data, length); in crc32_update()
88 u32 *crc = shash_desc_ctx(desc); in crc32c_update() local
90 *crc = crc32c_armv8_le(*crc, data, length); in crc32c_update()
96 u32 *crc = shash_desc_ctx(desc); in crc32_final() local
98 put_unaligned_le32(*crc, out); in crc32_final()
104 u32 *crc = shash_desc_ctx(desc); in crc32c_final() local
[all …]
/kernel/linux/linux-4.19/arch/powerpc/crypto/
Dcrct10dif-vpmsum_glue.c2 * Calculate a CRC T10-DIF with vpmsum acceleration
13 #include <linux/crc-t10dif.h>
27 u32 __crct10dif_vpmsum(u32 crc, unsigned char const *p, size_t len);
33 u32 crc = crci; in crct10dif_vpmsum() local
36 return crc_t10dif_generic(crc, p, len); in crct10dif_vpmsum()
40 crc = crc_t10dif_generic(crc, p, prealign); in crct10dif_vpmsum()
46 crc <<= 16; in crct10dif_vpmsum()
50 crc = __crct10dif_vpmsum(crc, p, len & ~VMX_ALIGN_MASK); in crct10dif_vpmsum()
54 crc >>= 16; in crct10dif_vpmsum()
60 crc = crc_t10dif_generic(crc, p, tail); in crct10dif_vpmsum()
[all …]
/kernel/linux/linux-4.19/tools/power/acpi/tools/acpidbg/
Dacpidbg.c126 static int acpi_aml_read(int fd, struct circ_buf *crc) in acpi_aml_read() argument
131 p = &crc->buf[crc->head]; in acpi_aml_read()
132 len = circ_space_to_end(crc); in acpi_aml_read()
137 crc->head = (crc->head + len) & (ACPI_AML_BUF_SIZE - 1); in acpi_aml_read()
141 static int acpi_aml_read_batch_cmd(int unused, struct circ_buf *crc) in acpi_aml_read_batch_cmd() argument
147 p = &crc->buf[crc->head]; in acpi_aml_read_batch_cmd()
148 len = circ_space_to_end(crc); in acpi_aml_read_batch_cmd()
158 crc->head = (crc->head + len) & (ACPI_AML_BUF_SIZE - 1); in acpi_aml_read_batch_cmd()
162 static int acpi_aml_read_batch_log(int fd, struct circ_buf *crc) in acpi_aml_read_batch_log() argument
168 p = &crc->buf[crc->head]; in acpi_aml_read_batch_log()
[all …]
/kernel/linux/linux-5.10/tools/power/acpi/tools/acpidbg/
Dacpidbg.c123 static int acpi_aml_read(int fd, struct circ_buf *crc) in acpi_aml_read() argument
128 p = &crc->buf[crc->head]; in acpi_aml_read()
129 len = circ_space_to_end(crc); in acpi_aml_read()
134 crc->head = (crc->head + len) & (ACPI_AML_BUF_SIZE - 1); in acpi_aml_read()
138 static int acpi_aml_read_batch_cmd(int unused, struct circ_buf *crc) in acpi_aml_read_batch_cmd() argument
144 p = &crc->buf[crc->head]; in acpi_aml_read_batch_cmd()
145 len = circ_space_to_end(crc); in acpi_aml_read_batch_cmd()
155 crc->head = (crc->head + len) & (ACPI_AML_BUF_SIZE - 1); in acpi_aml_read_batch_cmd()
159 static int acpi_aml_read_batch_log(int fd, struct circ_buf *crc) in acpi_aml_read_batch_log() argument
165 p = &crc->buf[crc->head]; in acpi_aml_read_batch_log()
[all …]
/kernel/linux/linux-4.19/arch/s390/crypto/
Dcrc32-vx.c3 * Crypto-API module for CRC-32 algorithms implemented with the
31 u32 crc; member
35 u32 crc32_le_vgfm_16(u32 crc, unsigned char const *buf, size_t size);
36 u32 crc32_be_vgfm_16(u32 crc, unsigned char const *buf, size_t size);
37 u32 crc32c_le_vgfm_16(u32 crc, unsigned char const *buf, size_t size);
40 * DEFINE_CRC32_VX() - Define a CRC-32 function using the vector extension
42 * Creates a function to perform a particular CRC-32 computation. Depending
49 static u32 __pure ___fname(u32 crc, \
56 return ___crc32_sw(crc, data, datalen); \
62 crc = ___crc32_sw(crc, data, prealign); \
[all …]
/kernel/linux/linux-5.10/arch/s390/crypto/
Dcrc32-vx.c3 * Crypto-API module for CRC-32 algorithms implemented with the
31 u32 crc; member
35 u32 crc32_le_vgfm_16(u32 crc, unsigned char const *buf, size_t size);
36 u32 crc32_be_vgfm_16(u32 crc, unsigned char const *buf, size_t size);
37 u32 crc32c_le_vgfm_16(u32 crc, unsigned char const *buf, size_t size);
40 * DEFINE_CRC32_VX() - Define a CRC-32 function using the vector extension
42 * Creates a function to perform a particular CRC-32 computation. Depending
49 static u32 __pure ___fname(u32 crc, \
56 return ___crc32_sw(crc, data, datalen); \
62 crc = ___crc32_sw(crc, data, prealign); \
[all …]
/kernel/linux/linux-4.19/arch/arm64/crypto/
Dcrc32-ce-glue.c70 u32 *crc = shash_desc_ctx(desc); in crc32_pmull_init() local
72 *crc = *mctx; in crc32_pmull_init()
79 u32 *crc = shash_desc_ctx(desc); in crc32_update() local
81 *crc = crc32_armv8_le(*crc, data, length); in crc32_update()
88 u32 *crc = shash_desc_ctx(desc); in crc32c_update() local
90 *crc = crc32c_armv8_le(*crc, data, length); in crc32c_update()
97 u32 *crc = shash_desc_ctx(desc); in crc32_pmull_update() local
103 *crc = fallback_crc32(*crc, data, l); in crc32_pmull_update()
113 *crc = crc32_pmull_le(data, l, *crc); in crc32_pmull_update()
121 *crc = fallback_crc32(*crc, data, length); in crc32_pmull_update()
[all …]
/kernel/linux/linux-5.10/arch/mips/crypto/
Dcrc32-mips.c53 #define _CRC32(crc, value, size, type) \ argument
60 : "+r" (crc) \
64 #define CRC32(crc, value, size) \ argument
65 _CRC32(crc, value, size, crc32)
67 #define CRC32C(crc, value, size) \ argument
68 _CRC32(crc, value, size, crc32c)
72 u32 crc = crc_; local
78 CRC32(crc, value, d);
89 CRC32(crc, value, w);
97 CRC32(crc, value, h);
[all …]
/kernel/linux/linux-4.19/arch/mips/crypto/
Dcrc32-mips.c53 #define _CRC32(crc, value, size, type) \ argument
60 : "+r" (crc) \
64 #define CRC32(crc, value, size) \ argument
65 _CRC32(crc, value, size, crc32)
67 #define CRC32C(crc, value, size) \ argument
68 _CRC32(crc, value, size, crc32c)
72 u32 crc = crc_; local
78 CRC32(crc, value, d);
89 CRC32(crc, value, w);
97 CRC32(crc, value, h);
[all …]
/kernel/linux/linux-5.10/Documentation/staging/
Dcrc32.rst2 brief tutorial on CRC computation
5 A CRC is a long-division remainder. You add the CRC to the message,
6 and the whole thing (message+CRC) is a multiple of the given
7 CRC polynomial. To check the CRC, you can either check that the
8 CRC matches the recomputed value, *or* you can check that the
9 remainder computed on the message+CRC is 0. This latter approach
11 protocols put the end-of-frame flag after the CRC.
21 To produce a 32-bit CRC, the divisor is actually a 33-bit CRC polynomial.
23 CRC is written in hex with the most significant bit omitted. (If you're
26 Note that a CRC is computed over a string of *bits*, so you have
[all …]
/kernel/linux/linux-4.19/Documentation/
Dcrc32.txt2 brief tutorial on CRC computation
5 A CRC is a long-division remainder. You add the CRC to the message,
6 and the whole thing (message+CRC) is a multiple of the given
7 CRC polynomial. To check the CRC, you can either check that the
8 CRC matches the recomputed value, *or* you can check that the
9 remainder computed on the message+CRC is 0. This latter approach
11 protocols put the end-of-frame flag after the CRC.
21 To produce a 32-bit CRC, the divisor is actually a 33-bit CRC polynomial.
23 CRC is written in hex with the most significant bit omitted. (If you're
26 Note that a CRC is computed over a string of *bits*, so you have
[all …]
/kernel/liteos_m/targets/riscv_nuclei_gd32vf103_soc_gcc/SoC/gd32vf103/Common/Include/
Dgd32vf103_crc.h3 \brief definitions for the CRC
43 /* CRC definitions */
44 #define CRC CRC_BASE macro
47 #define CRC_DATA REG32(CRC + 0x00U) /*!< CRC data register */
48 #define CRC_FDATA REG32(CRC + 0x04U) /*!< CRC free data register …
49 #define CRC_CTL REG32(CRC + 0x08U) /*!< CRC control register */
53 #define CRC_DATA_DATA BITS(0, 31) /*!< CRC calculation result …
56 #define CRC_FDATA_FDATA BITS(0, 7) /*!< CRC free data bits */
59 #define CRC_CTL_RST BIT(0) /*!< CRC reset CRC_DATA regi…
62 /* deinit CRC calculation unit */
[all …]

12345678910>>...99