arch/mips/kernel/linux32.c
Source file repositories/reference/linux-study-clean/arch/mips/kernel/linux32.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/kernel/linux32.c- Extension
.c- Size
- 3669 bytes
- Lines
- 135
- Domain
- Architecture Layer
- Bucket
- arch/mips
- Inferred role
- Architecture Layer: syscall or user/kernel boundary
- Status
- core 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.
- Defines or participates in a user/kernel boundary; inspect argument validation, copy_from_user/copy_to_user, credentials, and dispatch target.
Dependency Surface
linux/compiler.hlinux/mm.hlinux/errno.hlinux/file.hlinux/highuid.hlinux/resource.hlinux/highmem.hlinux/time.hlinux/times.hlinux/poll.hlinux/skbuff.hlinux/filter.hlinux/shm.hlinux/sem.hlinux/msg.hlinux/icmpv6.hlinux/syscalls.hlinux/sysctl.hlinux/utime.hlinux/utsname.hlinux/personality.hlinux/dnotify.hlinux/binfmts.hlinux/security.hlinux/compat.hlinux/vfs.hlinux/ipc.hlinux/slab.hnet/sock.hnet/scm.hasm/compat-signal.hasm/sim.h
Detected Declarations
function Copyrightfunction sys32_readaheadfunction sys32_sync_file_rangefunction sys32_fadvise64_64function sys32_fallocate
Annotated Snippet
SYSCALL_DEFINE4(32_truncate64, const char __user *, path,
unsigned long, __dummy, unsigned long, a2, unsigned long, a3)
{
return ksys_truncate(path, merge_64(a2, a3));
}
SYSCALL_DEFINE4(32_ftruncate64, unsigned long, fd, unsigned long, __dummy,
unsigned long, a2, unsigned long, a3)
{
return ksys_ftruncate(fd, merge_64(a2, a3), FTRUNCATE_LFS);
}
SYSCALL_DEFINE5(32_llseek, unsigned int, fd, unsigned int, offset_high,
unsigned int, offset_low, loff_t __user *, result,
unsigned int, origin)
{
return sys_llseek(fd, offset_high, offset_low, result, origin);
}
/* From the Single Unix Spec: pread & pwrite act like lseek to pos + op +
lseek back to original location. They fail just like lseek does on
non-seekable files. */
SYSCALL_DEFINE6(32_pread, unsigned long, fd, char __user *, buf, size_t, count,
unsigned long, unused, unsigned long, a4, unsigned long, a5)
{
return ksys_pread64(fd, buf, count, merge_64(a4, a5));
}
SYSCALL_DEFINE6(32_pwrite, unsigned int, fd, const char __user *, buf,
size_t, count, u32, unused, u64, a4, u64, a5)
{
return ksys_pwrite64(fd, buf, count, merge_64(a4, a5));
}
SYSCALL_DEFINE1(32_personality, unsigned long, personality)
{
unsigned int p = personality & 0xffffffff;
int ret;
if (personality(current->personality) == PER_LINUX32 &&
personality(p) == PER_LINUX)
p = (p & ~PER_MASK) | PER_LINUX32;
ret = sys_personality(p);
if (ret != -1 && personality(ret) == PER_LINUX32)
ret = (ret & ~PER_MASK) | PER_LINUX;
return ret;
}
asmlinkage ssize_t sys32_readahead(int fd, u32 pad0, u64 a2, u64 a3,
size_t count)
{
return ksys_readahead(fd, merge_64(a2, a3), count);
}
asmlinkage long sys32_sync_file_range(int fd, int __pad,
unsigned long a2, unsigned long a3,
unsigned long a4, unsigned long a5,
int flags)
{
return ksys_sync_file_range(fd,
merge_64(a2, a3), merge_64(a4, a5),
flags);
}
asmlinkage long sys32_fadvise64_64(int fd, int __pad,
unsigned long a2, unsigned long a3,
unsigned long a4, unsigned long a5,
int flags)
{
return ksys_fadvise64_64(fd,
merge_64(a2, a3), merge_64(a4, a5),
flags);
}
asmlinkage long sys32_fallocate(int fd, int mode, unsigned offset_a2,
unsigned offset_a3, unsigned len_a4, unsigned len_a5)
{
return ksys_fallocate(fd, mode, merge_64(offset_a2, offset_a3),
merge_64(len_a4, len_a5));
}
Annotation
- Immediate include surface: `linux/compiler.h`, `linux/mm.h`, `linux/errno.h`, `linux/file.h`, `linux/highuid.h`, `linux/resource.h`, `linux/highmem.h`, `linux/time.h`.
- Detected declarations: `function Copyright`, `function sys32_readahead`, `function sys32_sync_file_range`, `function sys32_fadvise64_64`, `function sys32_fallocate`.
- Atlas domain: Architecture Layer / arch/mips.
- Implementation status: core implementation candidate.
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.