arch/microblaze/lib/fastcopy.S
Source file repositories/reference/linux-study-clean/arch/microblaze/lib/fastcopy.S
File Facts
- System
- Linux kernel
- Corpus path
arch/microblaze/lib/fastcopy.S- Extension
.S- Size
- 20680 bytes
- Lines
- 667
- Domain
- Architecture Layer
- Bucket
- arch/microblaze
- Inferred role
- Architecture Layer: arch/microblaze
- Status
- atlas-only
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.
Dependency Surface
linux/linkage.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#include <linux/linkage.h>
.text
.globl memcpy
.type memcpy, @function
.ent memcpy
memcpy:
fast_memcpy_ascending:
/* move d to return register as value of function */
addi r3, r5, 0
addi r4, r0, 4 /* n = 4 */
cmpu r4, r4, r7 /* n = c - n (unsigned) */
blti r4, a_xfer_end /* if n < 0, less than one word to transfer */
/* transfer first 0~3 bytes to get aligned dest address */
andi r4, r5, 3 /* n = d & 3 */
/* if zero, destination already aligned */
beqi r4, a_dalign_done
/* n = 4 - n (yields 3, 2, 1 transfers for 1, 2, 3 addr offset) */
rsubi r4, r4, 4
rsub r7, r4, r7 /* c = c - n adjust c */
a_xfer_first_loop:
/* if no bytes left to transfer, transfer the bulk */
beqi r4, a_dalign_done
lbui r11, r6, 0 /* h = *s */
sbi r11, r5, 0 /* *d = h */
addi r6, r6, 1 /* s++ */
addi r5, r5, 1 /* d++ */
brid a_xfer_first_loop /* loop */
addi r4, r4, -1 /* n-- (IN DELAY SLOT) */
a_dalign_done:
addi r4, r0, 32 /* n = 32 */
cmpu r4, r4, r7 /* n = c - n (unsigned) */
/* if n < 0, less than one block to transfer */
blti r4, a_block_done
a_block_xfer:
andi r4, r7, 0xffffffe0 /* n = c & ~31 */
rsub r7, r4, r7 /* c = c - n */
andi r9, r6, 3 /* t1 = s & 3 */
/* if temp != 0, unaligned transfers needed */
bnei r9, a_block_unaligned
a_block_aligned:
lwi r9, r6, 0 /* t1 = *(s + 0) */
lwi r10, r6, 4 /* t2 = *(s + 4) */
lwi r11, r6, 8 /* t3 = *(s + 8) */
lwi r12, r6, 12 /* t4 = *(s + 12) */
swi r9, r5, 0 /* *(d + 0) = t1 */
swi r10, r5, 4 /* *(d + 4) = t2 */
swi r11, r5, 8 /* *(d + 8) = t3 */
swi r12, r5, 12 /* *(d + 12) = t4 */
lwi r9, r6, 16 /* t1 = *(s + 16) */
lwi r10, r6, 20 /* t2 = *(s + 20) */
lwi r11, r6, 24 /* t3 = *(s + 24) */
lwi r12, r6, 28 /* t4 = *(s + 28) */
swi r9, r5, 16 /* *(d + 16) = t1 */
swi r10, r5, 20 /* *(d + 20) = t2 */
swi r11, r5, 24 /* *(d + 24) = t3 */
swi r12, r5, 28 /* *(d + 28) = t4 */
addi r6, r6, 32 /* s = s + 32 */
addi r4, r4, -32 /* n = n - 32 */
bneid r4, a_block_aligned /* while (n) loop */
addi r5, r5, 32 /* d = d + 32 (IN DELAY SLOT) */
bri a_block_done
Annotation
- Immediate include surface: `linux/linkage.h`.
- Atlas domain: Architecture Layer / arch/microblaze.
- Implementation status: atlas-only.
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.