arch/sparc/kernel/sys_sparc32.c
Source file repositories/reference/linux-study-clean/arch/sparc/kernel/sys_sparc32.c
File Facts
- System
- Linux kernel
- Corpus path
arch/sparc/kernel/sys_sparc32.c- Extension
.c- Size
- 7025 bytes
- Lines
- 238
- Domain
- Architecture Layer
- Bucket
- arch/sparc
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/sched.hlinux/capability.hlinux/fs.hlinux/mm.hlinux/file.hlinux/signal.hlinux/resource.hlinux/times.hlinux/smp.hlinux/sem.hlinux/msg.hlinux/shm.hlinux/uio.hlinux/quota.hlinux/poll.hlinux/personality.hlinux/stat.hlinux/filter.hlinux/highmem.hlinux/highuid.hlinux/mman.hlinux/ipv6.hlinux/in.hlinux/icmpv6.hlinux/syscalls.hlinux/sysctl.hlinux/binfmts.hlinux/dnotify.hlinux/security.hlinux/compat.hlinux/vfs.h
Detected Declarations
function Copyrightfunction cp_compat_stat64
Annotated Snippet
if (act) {
u32 u_handler, u_restorer;
new_ka.ka_restorer = restorer;
ret = get_user(u_handler, &act->sa_handler);
new_ka.sa.sa_handler = compat_ptr(u_handler);
ret |= get_compat_sigset(&new_ka.sa.sa_mask, &act->sa_mask);
ret |= get_user(new_ka.sa.sa_flags, &act->sa_flags);
ret |= get_user(u_restorer, &act->sa_restorer);
new_ka.sa.sa_restorer = compat_ptr(u_restorer);
if (ret)
return -EFAULT;
}
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
if (!ret && oact) {
ret = put_user(ptr_to_compat(old_ka.sa.sa_handler), &oact->sa_handler);
ret |= put_compat_sigset(&oact->sa_mask, &old_ka.sa.sa_mask,
sizeof(oact->sa_mask));
ret |= put_user(old_ka.sa.sa_flags, &oact->sa_flags);
ret |= put_user(ptr_to_compat(old_ka.sa.sa_restorer), &oact->sa_restorer);
if (ret)
ret = -EFAULT;
}
return ret;
}
COMPAT_SYSCALL_DEFINE5(pread64, unsigned int, fd, char __user *, ubuf,
compat_size_t, count, u32, poshi, u32, poslo)
{
return ksys_pread64(fd, ubuf, count, ((u64)poshi << 32) | poslo);
}
COMPAT_SYSCALL_DEFINE5(pwrite64, unsigned int, fd, char __user *, ubuf,
compat_size_t, count, u32, poshi, u32, poslo)
{
return ksys_pwrite64(fd, ubuf, count, ((u64)poshi << 32) | poslo);
}
COMPAT_SYSCALL_DEFINE4(readahead, int, fd, u32, offhi, u32, offlo,
compat_size_t, count)
{
return ksys_readahead(fd, ((u64)offhi << 32) | offlo, count);
}
COMPAT_SYSCALL_DEFINE5(fadvise64, int, fd, u32, offhi, u32, offlo,
compat_size_t, len, int, advice)
{
return ksys_fadvise64_64(fd, ((u64)offhi << 32) | offlo, len, advice);
}
COMPAT_SYSCALL_DEFINE6(fadvise64_64, int, fd, u32, offhi, u32, offlo,
u32, lenhi, u32, lenlo, int, advice)
{
return ksys_fadvise64_64(fd,
((u64)offhi << 32) | offlo,
((u64)lenhi << 32) | lenlo,
advice);
}
COMPAT_SYSCALL_DEFINE6(sync_file_range, unsigned int, fd, u32, off_high, u32, off_low,
u32, nb_high, u32, nb_low, unsigned int, flags)
{
return ksys_sync_file_range(fd,
((u64)off_high << 32) | off_low,
((u64)nb_high << 32) | nb_low,
flags);
}
COMPAT_SYSCALL_DEFINE6(fallocate, int, fd, int, mode, u32, offhi, u32, offlo,
u32, lenhi, u32, lenlo)
{
return ksys_fallocate(fd, mode, ((loff_t)offhi << 32) | offlo,
((loff_t)lenhi << 32) | lenlo);
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/sched.h`, `linux/capability.h`, `linux/fs.h`, `linux/mm.h`, `linux/file.h`, `linux/signal.h`, `linux/resource.h`.
- Detected declarations: `function Copyright`, `function cp_compat_stat64`.
- Atlas domain: Architecture Layer / arch/sparc.
- Implementation status: source 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.