lib/raid/xor/sparc/xor-sparc32.c
Source file repositories/reference/linux-study-clean/lib/raid/xor/sparc/xor-sparc32.c
File Facts
- System
- Linux kernel
- Corpus path
lib/raid/xor/sparc/xor-sparc32.c- Extension
.c- Size
- 7015 bytes
- Lines
- 253
- 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
function Copyrightfunction sparc_3function sparc_4function sparc_5
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* High speed xor_block operation for RAID4/5 utilizing the
* ldd/std SPARC instructions.
*
* Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz)
*/
#include "xor_impl.h"
#include "xor_arch.h"
static void
sparc_2(unsigned long bytes, unsigned long * __restrict p1,
const unsigned long * __restrict p2)
{
int lines = bytes / (sizeof (long)) / 8;
do {
__asm__ __volatile__(
"ldd [%0 + 0x00], %%g2\n\t"
"ldd [%0 + 0x08], %%g4\n\t"
"ldd [%0 + 0x10], %%o0\n\t"
"ldd [%0 + 0x18], %%o2\n\t"
"ldd [%1 + 0x00], %%o4\n\t"
"ldd [%1 + 0x08], %%l0\n\t"
"ldd [%1 + 0x10], %%l2\n\t"
"ldd [%1 + 0x18], %%l4\n\t"
"xor %%g2, %%o4, %%g2\n\t"
"xor %%g3, %%o5, %%g3\n\t"
"xor %%g4, %%l0, %%g4\n\t"
"xor %%g5, %%l1, %%g5\n\t"
"xor %%o0, %%l2, %%o0\n\t"
"xor %%o1, %%l3, %%o1\n\t"
"xor %%o2, %%l4, %%o2\n\t"
"xor %%o3, %%l5, %%o3\n\t"
"std %%g2, [%0 + 0x00]\n\t"
"std %%g4, [%0 + 0x08]\n\t"
"std %%o0, [%0 + 0x10]\n\t"
"std %%o2, [%0 + 0x18]\n"
:
: "r" (p1), "r" (p2)
: "g2", "g3", "g4", "g5",
"o0", "o1", "o2", "o3", "o4", "o5",
"l0", "l1", "l2", "l3", "l4", "l5");
p1 += 8;
p2 += 8;
} while (--lines > 0);
}
static void
sparc_3(unsigned long bytes, unsigned long * __restrict p1,
const unsigned long * __restrict p2,
const unsigned long * __restrict p3)
{
int lines = bytes / (sizeof (long)) / 8;
do {
__asm__ __volatile__(
"ldd [%0 + 0x00], %%g2\n\t"
"ldd [%0 + 0x08], %%g4\n\t"
"ldd [%0 + 0x10], %%o0\n\t"
"ldd [%0 + 0x18], %%o2\n\t"
"ldd [%1 + 0x00], %%o4\n\t"
"ldd [%1 + 0x08], %%l0\n\t"
"ldd [%1 + 0x10], %%l2\n\t"
"ldd [%1 + 0x18], %%l4\n\t"
"xor %%g2, %%o4, %%g2\n\t"
"xor %%g3, %%o5, %%g3\n\t"
"ldd [%2 + 0x00], %%o4\n\t"
"xor %%g4, %%l0, %%g4\n\t"
"xor %%g5, %%l1, %%g5\n\t"
"ldd [%2 + 0x08], %%l0\n\t"
"xor %%o0, %%l2, %%o0\n\t"
"xor %%o1, %%l3, %%o1\n\t"
"ldd [%2 + 0x10], %%l2\n\t"
"xor %%o2, %%l4, %%o2\n\t"
"xor %%o3, %%l5, %%o3\n\t"
"ldd [%2 + 0x18], %%l4\n\t"
"xor %%g2, %%o4, %%g2\n\t"
"xor %%g3, %%o5, %%g3\n\t"
"xor %%g4, %%l0, %%g4\n\t"
"xor %%g5, %%l1, %%g5\n\t"
"xor %%o0, %%l2, %%o0\n\t"
"xor %%o1, %%l3, %%o1\n\t"
"xor %%o2, %%l4, %%o2\n\t"
"xor %%o3, %%l5, %%o3\n\t"
"std %%g2, [%0 + 0x00]\n\t"
"std %%g4, [%0 + 0x08]\n\t"
"std %%o0, [%0 + 0x10]\n\t"
"std %%o2, [%0 + 0x18]\n"
:
Annotation
- Immediate include surface: `xor_impl.h`, `xor_arch.h`.
- Detected declarations: `function Copyright`, `function sparc_3`, `function sparc_4`, `function sparc_5`.
- 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.