arch/hexagon/mm/copy_from_user.S
Source file repositories/reference/linux-study-clean/arch/hexagon/mm/copy_from_user.S
File Facts
- System
- Linux kernel
- Corpus path
arch/hexagon/mm/copy_from_user.S- Extension
.S- Size
- 1687 bytes
- Lines
- 102
- 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_from_user
#include "copy_user_template.S"
/* LOAD FAULTS from COPY_FROM_USER */
/* Alignment loop. r2 has been updated. Return it. */
.falign
1009:
2009:
4009:
{
r0 = r2
jumpr r31
}
/* Normal copy loops. Do epilog. Use src-src_sav to compute distance */
/* X - (A - B) == X + B - A */
.falign
8089:
{
memd(dst) = d_dbuf
r2 += sub(src_sav,src)
}
{
r0 = r2
jumpr r31
}
.falign
4089:
{
memw(dst) = w_dbuf
r2 += sub(src_sav,src)
}
{
r0 = r2
jumpr r31
}
.falign
2089:
{
memh(dst) = w_dbuf
r2 += sub(src_sav,src)
}
{
r0 = r2
jumpr r31
}
.falign
1089:
{
memb(dst) = w_dbuf
r2 += sub(src_sav,src)
}
{
r0 = r2
jumpr r31
}
/* COPY FROM USER: only loads can fail */
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.