arch/parisc/kernel/sys_parisc.c
Source file repositories/reference/linux-study-clean/arch/parisc/kernel/sys_parisc.c
File Facts
- System
- Linux kernel
- Corpus path
arch/parisc/kernel/sys_parisc.c- Extension
.c- Size
- 11187 bytes
- Lines
- 410
- Domain
- Architecture Layer
- Bucket
- arch/parisc
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/uaccess.hasm/elf.hlinux/file.hlinux/fs.hlinux/linkage.hlinux/mm.hlinux/mman.hlinux/sched/signal.hlinux/sched/mm.hlinux/shm.hlinux/syscalls.hlinux/utsname.hlinux/personality.hlinux/random.hlinux/compat.hlinux/elf-randomize.h
Detected Declarations
enum mmap_allocation_directionfunction Copyrightfunction COLOR_ALIGNfunction calc_max_stack_sizefunction areafunction arch_get_unmapped_area_commonfunction arch_get_unmapped_areafunction arch_get_unmapped_area_topdownfunction sys_mmap2function sys_mmapfunction parisc_truncate64function parisc_ftruncate64function sys_truncate64function sys_ftruncate64function sys_fcntl64function parisc_truncate64function parisc_ftruncate64function parisc_pread64function parisc_pwrite64function parisc_readaheadfunction parisc_fadvise64_64function parisc_sync_file_rangefunction parisc_fallocatefunction parisc_personalityfunction FIX_O_NONBLOCKfunction parisc_timerfd_createfunction parisc_signalfd4function parisc_compat_signalfd4function parisc_eventfd2function parisc_userfaultfdfunction parisc_pipe2function parisc_inotify_init1function madvise
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* PARISC specific syscalls
*
* Copyright (C) 1999-2003 Matthew Wilcox <willy at parisc-linux.org>
* Copyright (C) 2000-2003 Paul Bame <bame at parisc-linux.org>
* Copyright (C) 2001 Thomas Bogendoerfer <tsbogend at parisc-linux.org>
* Copyright (C) 1999-2020 Helge Deller <deller@gmx.de>
*/
#include <linux/uaccess.h>
#include <asm/elf.h>
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/linkage.h>
#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/sched/signal.h>
#include <linux/sched/mm.h>
#include <linux/shm.h>
#include <linux/syscalls.h>
#include <linux/utsname.h>
#include <linux/personality.h>
#include <linux/random.h>
#include <linux/compat.h>
#include <linux/elf-randomize.h>
/*
* Construct an artificial page offset for the mapping based on the physical
* address of the kernel file mapping variable.
*/
#define GET_FILP_PGOFF(filp) \
(filp ? (((unsigned long) filp->f_mapping) >> 8) \
& ((SHM_COLOUR-1) >> PAGE_SHIFT) : 0UL)
static unsigned long shared_align_offset(unsigned long filp_pgoff,
unsigned long pgoff)
{
return (filp_pgoff + pgoff) << PAGE_SHIFT;
}
static inline unsigned long COLOR_ALIGN(unsigned long addr,
unsigned long filp_pgoff, unsigned long pgoff)
{
unsigned long base = (addr+SHM_COLOUR-1) & ~(SHM_COLOUR-1);
unsigned long off = (SHM_COLOUR-1) &
shared_align_offset(filp_pgoff, pgoff);
return base + off;
}
#ifdef CONFIG_COMPAT
#define STACK_SIZE_DEFAULT (USER_WIDE_MODE \
? (1 << 30) /* 1 GB */ \
: (CONFIG_STACK_MAX_DEFAULT_SIZE_MB*1024*1024))
#else
#define STACK_SIZE_DEFAULT (1 << 30)
#endif
unsigned long calc_max_stack_size(unsigned long stack_max)
{
#ifdef CONFIG_COMPAT
if (!USER_WIDE_MODE && (stack_max == COMPAT_RLIM_INFINITY))
stack_max = STACK_SIZE_DEFAULT;
else
#endif
if (stack_max == RLIM_INFINITY)
stack_max = STACK_SIZE_DEFAULT;
return stack_max;
}
/*
* Top of mmap area (just below the process stack).
*/
/*
* When called from arch_get_unmapped_area(), rlim_stack will be NULL,
* indicating that "current" should be used instead of a passed-in
* value from the exec bprm as done with arch_pick_mmap_layout().
*/
unsigned long mmap_upper_limit(const struct rlimit *rlim_stack)
{
unsigned long stack_base;
/* Limit stack size - see setup_arg_pages() in fs/exec.c */
stack_base = rlim_stack ? rlim_stack->rlim_max
: rlimit_max(RLIMIT_STACK);
Annotation
- Immediate include surface: `linux/uaccess.h`, `asm/elf.h`, `linux/file.h`, `linux/fs.h`, `linux/linkage.h`, `linux/mm.h`, `linux/mman.h`, `linux/sched/signal.h`.
- Detected declarations: `enum mmap_allocation_direction`, `function Copyright`, `function COLOR_ALIGN`, `function calc_max_stack_size`, `function area`, `function arch_get_unmapped_area_common`, `function arch_get_unmapped_area`, `function arch_get_unmapped_area_topdown`, `function sys_mmap2`, `function sys_mmap`.
- Atlas domain: Architecture Layer / arch/parisc.
- Implementation status: source 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.