arch/powerpc/include/asm/syscall.h
Source file repositories/reference/linux-study-clean/arch/powerpc/include/asm/syscall.h
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/include/asm/syscall.h- Extension
.h- Size
- 3699 bytes
- Lines
- 148
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
uapi/linux/audit.hlinux/sched.hlinux/thread_info.h
Detected Declarations
function syscall_get_nrfunction syscall_set_nrfunction syscall_rollbackfunction syscall_get_errorfunction syscall_get_return_valuefunction syscall_set_return_valuefunction syscall_get_argumentsfunction syscall_set_argumentsfunction syscall_get_archfunction arch_syscall_is_vdso_sigreturn
Annotated Snippet
if (error) {
regs->ccr |= 0x10000000L;
regs->gpr[3] = error;
} else {
regs->ccr &= ~0x10000000L;
regs->gpr[3] = val;
}
}
}
static inline void syscall_get_arguments(struct task_struct *task,
struct pt_regs *regs,
unsigned long *args)
{
unsigned long val, mask = -1UL;
unsigned int n = 6;
if (is_tsk_32bit_task(task))
mask = 0xffffffff;
while (n--) {
if (n == 0)
val = regs->orig_gpr3;
else
val = regs->gpr[3 + n];
args[n] = val & mask;
}
}
static inline void syscall_set_arguments(struct task_struct *task,
struct pt_regs *regs,
const unsigned long *args)
{
memcpy(®s->gpr[3], args, 6 * sizeof(args[0]));
/* Also copy the first argument into orig_gpr3 */
regs->orig_gpr3 = args[0];
}
static inline int syscall_get_arch(struct task_struct *task)
{
if (is_tsk_32bit_task(task))
return AUDIT_ARCH_PPC;
else if (IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN))
return AUDIT_ARCH_PPC64LE;
else
return AUDIT_ARCH_PPC64;
}
static inline bool arch_syscall_is_vdso_sigreturn(struct pt_regs *regs)
{
return false;
}
#endif /* _ASM_SYSCALL_H */
Annotation
- Immediate include surface: `uapi/linux/audit.h`, `linux/sched.h`, `linux/thread_info.h`.
- Detected declarations: `function syscall_get_nr`, `function syscall_set_nr`, `function syscall_rollback`, `function syscall_get_error`, `function syscall_get_return_value`, `function syscall_set_return_value`, `function syscall_get_arguments`, `function syscall_set_arguments`, `function syscall_get_arch`, `function arch_syscall_is_vdso_sigreturn`.
- Atlas domain: Architecture Layer / arch/powerpc.
- 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.