lib/crc/arm64/crc32.h
Source file repositories/reference/linux-study-clean/lib/crc/arm64/crc32.h
File Facts
- System
- Linux kernel
- Corpus path
lib/crc/arm64/crc32.h- Extension
.h- Size
- 2168 bytes
- Lines
- 86
- Domain
- Kernel Services
- Bucket
- lib
- Inferred role
- Kernel Services: implementation source
- Status
- source implementation candidate
Why This File Exists
Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
Dependency Surface
asm/alternative.hasm/cpufeature.hasm/simd.h
Detected Declarations
function crc32_le_archfunction crc32c_archfunction crc32_be_archfunction crc32_optimizations_arch
Annotated Snippet
likely(may_use_simd())) {
scoped_ksimd()
crc = crc32_le_arm64_4way(crc, p, len);
p += round_down(len, 64);
len %= 64;
if (!len)
return crc;
}
return crc32_le_arm64(crc, p, len);
}
static inline u32 crc32c_arch(u32 crc, const u8 *p, size_t len)
{
if (!alternative_has_cap_likely(ARM64_HAS_CRC32))
return crc32c_base(crc, p, len);
if (len >= min_len && cpu_have_named_feature(PMULL) &&
likely(may_use_simd())) {
scoped_ksimd()
crc = crc32c_le_arm64_4way(crc, p, len);
p += round_down(len, 64);
len %= 64;
if (!len)
return crc;
}
return crc32c_le_arm64(crc, p, len);
}
static inline u32 crc32_be_arch(u32 crc, const u8 *p, size_t len)
{
if (!alternative_has_cap_likely(ARM64_HAS_CRC32))
return crc32_be_base(crc, p, len);
if (len >= min_len && cpu_have_named_feature(PMULL) &&
likely(may_use_simd())) {
scoped_ksimd()
crc = crc32_be_arm64_4way(crc, p, len);
p += round_down(len, 64);
len %= 64;
if (!len)
return crc;
}
return crc32_be_arm64(crc, p, len);
}
static inline u32 crc32_optimizations_arch(void)
{
if (alternative_has_cap_likely(ARM64_HAS_CRC32))
return CRC32_LE_OPTIMIZATION |
CRC32_BE_OPTIMIZATION |
CRC32C_OPTIMIZATION;
return 0;
}
Annotation
- Immediate include surface: `asm/alternative.h`, `asm/cpufeature.h`, `asm/simd.h`.
- Detected declarations: `function crc32_le_arch`, `function crc32c_arch`, `function crc32_be_arch`, `function crc32_optimizations_arch`.
- Atlas domain: Kernel Services / lib.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.