arch/parisc/lib/memcpy.c
Source file repositories/reference/linux-study-clean/arch/parisc/lib/memcpy.c
File Facts
- System
- Linux kernel
- Corpus path
arch/parisc/lib/memcpy.c- Extension
.c- Size
- 2017 bytes
- Lines
- 74
- Domain
- Architecture Layer
- Bucket
- arch/parisc
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
Dependency Surface
linux/module.hlinux/compiler.hlinux/uaccess.hlinux/mm.h
Detected Declarations
function raw_copy_to_userfunction raw_copy_from_userfunction memcpyfunction copy_from_kernel_nofault_allowedexport raw_copy_to_userexport raw_copy_from_userexport memcpy
Annotated Snippet
if (!prober_user(SR_TEMP1, start)) {
newlen = (start - (unsigned long) src);
break;
}
start += PAGE_SIZE;
/* align to page boundry which may have different permission */
start = PAGE_ALIGN_DOWN(start);
}
return len - newlen + pa_memcpy(dst, (void __force *)src, newlen);
}
EXPORT_SYMBOL(raw_copy_from_user);
void * memcpy(void * dst,const void *src, size_t count)
{
mtsp(get_kernel_space(), SR_TEMP1);
mtsp(get_kernel_space(), SR_TEMP2);
pa_memcpy(dst, src, count);
return dst;
}
EXPORT_SYMBOL(memcpy);
bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size)
{
if ((unsigned long)unsafe_src < PAGE_SIZE)
return false;
/* check for I/O space F_EXTEND(0xfff00000) access as well? */
return true;
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/compiler.h`, `linux/uaccess.h`, `linux/mm.h`.
- Detected declarations: `function raw_copy_to_user`, `function raw_copy_from_user`, `function memcpy`, `function copy_from_kernel_nofault_allowed`, `export raw_copy_to_user`, `export raw_copy_from_user`, `export memcpy`.
- Atlas domain: Architecture Layer / arch/parisc.
- Implementation status: integration implementation candidate.
- 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.