arch/csky/include/asm/syscall.h
Source file repositories/reference/linux-study-clean/arch/csky/include/asm/syscall.h
File Facts
- System
- Linux kernel
- Corpus path
arch/csky/include/asm/syscall.h- Extension
.h- Size
- 1697 bytes
- Lines
- 82
- Domain
- Architecture Layer
- Bucket
- arch/csky
- 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
linux/sched.hlinux/err.habi/regdef.huapi/linux/audit.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_arch
Annotated Snippet
#ifndef __ASM_SYSCALL_H
#define __ASM_SYSCALL_H
#include <linux/sched.h>
#include <linux/err.h>
#include <abi/regdef.h>
#include <uapi/linux/audit.h>
extern void *sys_call_table[];
static inline int
syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
{
return regs_syscallid(regs);
}
static inline void
syscall_set_nr(struct task_struct *task, struct pt_regs *regs,
int sysno)
{
regs_syscallid(regs) = sysno;
}
static inline void
syscall_rollback(struct task_struct *task, struct pt_regs *regs)
{
regs->a0 = regs->orig_a0;
}
static inline long
syscall_get_error(struct task_struct *task, struct pt_regs *regs)
{
unsigned long error = regs->a0;
return IS_ERR_VALUE(error) ? error : 0;
}
static inline long
syscall_get_return_value(struct task_struct *task, struct pt_regs *regs)
{
return regs->a0;
}
static inline void
syscall_set_return_value(struct task_struct *task, struct pt_regs *regs,
int error, long val)
{
regs->a0 = (long) error ?: val;
}
static inline void
syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
unsigned long *args)
{
args[0] = regs->orig_a0;
args++;
memcpy(args, ®s->a1, 5 * sizeof(args[0]));
}
static inline void
syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
const unsigned long *args)
{
memcpy(®s->a0, args, 6 * sizeof(regs->a0));
/*
* Also copy the first argument into orig_a0
* so that syscall_get_arguments() would return it
* instead of the previous value.
*/
regs->orig_a0 = regs->a0;
}
static inline int
syscall_get_arch(struct task_struct *task)
{
return AUDIT_ARCH_CSKY;
}
#endif /* __ASM_SYSCALL_H */
Annotation
- Immediate include surface: `linux/sched.h`, `linux/err.h`, `abi/regdef.h`, `uapi/linux/audit.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`.
- Atlas domain: Architecture Layer / arch/csky.
- 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.