arch/sparc/lib/blockops.S
Source file repositories/reference/linux-study-clean/arch/sparc/lib/blockops.S
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/lib/blockops.S- Extension
.S- Size
- 2730 bytes
- Lines
- 94
- Domain
- Architecture Layer
- Bucket
- arch/sparc
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
Dependency Surface
linux/export.hlinux/linkage.hasm/page.h
Detected Declarations
export bzero_1pageexport __copy_1page
Annotated Snippet
#include <linux/export.h>
#include <linux/linkage.h>
#include <asm/page.h>
/* Zero out 64 bytes of memory at (buf + offset).
* Assumes %g1 contains zero.
*/
#define BLAST_BLOCK(buf, offset) \
std %g0, [buf + offset + 0x38]; \
std %g0, [buf + offset + 0x30]; \
std %g0, [buf + offset + 0x28]; \
std %g0, [buf + offset + 0x20]; \
std %g0, [buf + offset + 0x18]; \
std %g0, [buf + offset + 0x10]; \
std %g0, [buf + offset + 0x08]; \
std %g0, [buf + offset + 0x00];
/* Copy 32 bytes of memory at (src + offset) to
* (dst + offset).
*/
#define MIRROR_BLOCK(dst, src, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
ldd [src + offset + 0x18], t0; \
ldd [src + offset + 0x10], t2; \
ldd [src + offset + 0x08], t4; \
ldd [src + offset + 0x00], t6; \
std t0, [dst + offset + 0x18]; \
std t2, [dst + offset + 0x10]; \
std t4, [dst + offset + 0x08]; \
std t6, [dst + offset + 0x00];
/* Profiling evidence indicates that memset() is
* commonly called for blocks of size PAGE_SIZE,
* and (2 * PAGE_SIZE) (for kernel stacks)
* and with a second arg of zero. We assume in
* all of these cases that the buffer is aligned
* on at least an 8 byte boundary.
*
* Therefore we special case them to make them
* as fast as possible.
*/
.text
ENTRY(bzero_1page)
/* NOTE: If you change the number of insns of this routine, please check
* arch/sparc/mm/hypersparc.S */
/* %o0 = buf */
or %g0, %g0, %g1
or %o0, %g0, %o1
or %g0, (PAGE_SIZE >> 8), %g2
1:
BLAST_BLOCK(%o0, 0x00)
BLAST_BLOCK(%o0, 0x40)
BLAST_BLOCK(%o0, 0x80)
BLAST_BLOCK(%o0, 0xc0)
subcc %g2, 1, %g2
bne 1b
add %o0, 0x100, %o0
retl
nop
ENDPROC(bzero_1page)
EXPORT_SYMBOL(bzero_1page)
ENTRY(__copy_1page)
/* NOTE: If you change the number of insns of this routine, please check
* arch/sparc/mm/hypersparc.S */
/* %o0 = dst, %o1 = src */
or %g0, (PAGE_SIZE >> 8), %g1
1:
MIRROR_BLOCK(%o0, %o1, 0x00, %o2, %o3, %o4, %o5, %g2, %g3, %g4, %g5)
Annotation
- Immediate include surface: `linux/export.h`, `linux/linkage.h`, `asm/page.h`.
- Detected declarations: `export bzero_1page`, `export __copy_1page`.
- Atlas domain: Architecture Layer / arch/sparc.
- Implementation status: integration 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.