lib/raid/xor/alpha/xor.c
Source file repositories/reference/linux-study-clean/lib/raid/xor/alpha/xor.c
File Facts
- System
- Linux kernel
- Corpus path
lib/raid/xor/alpha/xor.c- Extension
.c- Size
- 21973 bytes
- Lines
- 849
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
xor_impl.hxor_arch.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Optimized XOR parity functions for alpha EV5 and EV6
*/
#include "xor_impl.h"
#include "xor_arch.h"
extern void
xor_alpha_2(unsigned long bytes, unsigned long * __restrict p1,
const unsigned long * __restrict p2);
extern void
xor_alpha_3(unsigned long bytes, unsigned long * __restrict p1,
const unsigned long * __restrict p2,
const unsigned long * __restrict p3);
extern void
xor_alpha_4(unsigned long bytes, unsigned long * __restrict p1,
const unsigned long * __restrict p2,
const unsigned long * __restrict p3,
const unsigned long * __restrict p4);
extern void
xor_alpha_5(unsigned long bytes, unsigned long * __restrict p1,
const unsigned long * __restrict p2,
const unsigned long * __restrict p3,
const unsigned long * __restrict p4,
const unsigned long * __restrict p5);
extern void
xor_alpha_prefetch_2(unsigned long bytes, unsigned long * __restrict p1,
const unsigned long * __restrict p2);
extern void
xor_alpha_prefetch_3(unsigned long bytes, unsigned long * __restrict p1,
const unsigned long * __restrict p2,
const unsigned long * __restrict p3);
extern void
xor_alpha_prefetch_4(unsigned long bytes, unsigned long * __restrict p1,
const unsigned long * __restrict p2,
const unsigned long * __restrict p3,
const unsigned long * __restrict p4);
extern void
xor_alpha_prefetch_5(unsigned long bytes, unsigned long * __restrict p1,
const unsigned long * __restrict p2,
const unsigned long * __restrict p3,
const unsigned long * __restrict p4,
const unsigned long * __restrict p5);
asm(" \n\
.text \n\
.align 3 \n\
.ent xor_alpha_2 \n\
xor_alpha_2: \n\
.prologue 0 \n\
srl $16, 6, $16 \n\
.align 4 \n\
2: \n\
ldq $0,0($17) \n\
ldq $1,0($18) \n\
ldq $2,8($17) \n\
ldq $3,8($18) \n\
\n\
ldq $4,16($17) \n\
ldq $5,16($18) \n\
ldq $6,24($17) \n\
ldq $7,24($18) \n\
\n\
ldq $19,32($17) \n\
ldq $20,32($18) \n\
ldq $21,40($17) \n\
ldq $22,40($18) \n\
\n\
ldq $23,48($17) \n\
ldq $24,48($18) \n\
ldq $25,56($17) \n\
xor $0,$1,$0 # 7 cycles from $1 load \n\
\n\
ldq $27,56($18) \n\
xor $2,$3,$2 \n\
stq $0,0($17) \n\
xor $4,$5,$4 \n\
\n\
stq $2,8($17) \n\
xor $6,$7,$6 \n\
stq $4,16($17) \n\
xor $19,$20,$19 \n\
\n\
stq $6,24($17) \n\
xor $21,$22,$21 \n\
stq $19,32($17) \n\
xor $23,$24,$23 \n\
\n\
stq $21,40($17) \n\
Annotation
- Immediate include surface: `xor_impl.h`, `xor_arch.h`.
- 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.