arch/hexagon/mm/copy_to_user.S
Source file repositories/reference/linux-study-clean/arch/hexagon/mm/copy_to_user.S
File Facts
- System
- Linux kernel
- Corpus path
arch/hexagon/mm/copy_to_user.S- Extension
.S- Size
- 1551 bytes
- Lines
- 80
- Domain
- Architecture Layer
- Bucket
- arch/hexagon
- Inferred role
- Architecture Layer: arch/hexagon
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
Dependency Surface
copy_user_template.S
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#define src_sav r13
#define dst_sav r12
#define src_dst_sav r13:12
#define d_dbuf r15:14
#define w_dbuf r15
#define dst r0
#define src r1
#define bytes r2
#define loopcount r5
#define FUNCNAME raw_copy_to_user
#include "copy_user_template.S"
/* STORE FAULTS from COPY_TO_USER */
.falign
1109:
2109:
4109:
/* Alignment loop. r2 has been updated. Return it. */
{
r0 = r2
jumpr r31
}
/* Normal copy loops. Use dst-dst_sav to compute distance */
/* dst holds best write, no need to unwind any loops */
/* X - (A - B) == X + B - A */
.falign
8189:
8199:
4189:
4199:
2189:
2199:
1189:
1199:
{
r2 += sub(dst_sav,dst)
}
{
r0 = r2
jumpr r31
}
/* COPY TO USER: only stores can fail */
.section __ex_table,"a"
.long 1100b,1109b
.long 2100b,2109b
.long 4100b,4109b
.long 8180b,8189b
.long 8190b,8199b
.long 4180b,4189b
.long 4190b,4199b
.long 2180b,2189b
.long 2190b,2199b
.long 1180b,1189b
.long 1190b,1199b
.previous
Annotation
- Immediate include surface: `copy_user_template.S`.
- Atlas domain: Architecture Layer / arch/hexagon.
- Implementation status: atlas-only.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
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.