arch/sparc/kernel/syscalls.S

Source file repositories/reference/linux-study-clean/arch/sparc/kernel/syscalls.S

File Facts

System
Linux kernel
Corpus path
arch/sparc/kernel/syscalls.S
Extension
.S
Size
7793 bytes
Lines
310
Domain
Architecture Layer
Bucket
arch/sparc
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.

Dependency Surface

Detected Declarations

Annotated Snippet

sys64_execve:
	set	sys_execve, %g1
	jmpl	%g1, %g0
	 flushw

sys64_execveat:
	set	sys_execveat, %g1
	jmpl	%g1, %g0
	 flushw

#ifdef CONFIG_COMPAT
sunos_execv:
	mov	%g0, %o2
sys32_execve:
	set	compat_sys_execve, %g1
	jmpl	%g1, %g0
	 flushw

sys32_execveat:
	set	compat_sys_execveat, %g1
	jmpl	%g1, %g0
	 flushw
#endif

	.align	32
#ifdef CONFIG_COMPAT
sys32_sigstack:
	ba,pt	%xcc, do_sys32_sigstack
	 mov	%i6, %o2
#endif
	.align	32
#ifdef CONFIG_COMPAT
sys32_sigreturn:
	add	%sp, PTREGS_OFF, %o0
	call	do_sigreturn32
	 add	%o7, 1f-.-4, %o7
	nop
#endif
sys_rt_sigreturn:
	add	%sp, PTREGS_OFF, %o0
	call	do_rt_sigreturn
	 add	%o7, 1f-.-4, %o7
	nop
#ifdef CONFIG_COMPAT
sys32_rt_sigreturn:
	add	%sp, PTREGS_OFF, %o0
	call	do_rt_sigreturn32
	 add	%o7, 1f-.-4, %o7
	nop
#endif
	.align	32
1:	ldx	[%g6 + TI_FLAGS], %l5
	andcc	%l5, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT|_TIF_NOHZ), %g0
	be,pt	%icc, rtrap
	 nop
	call	syscall_trace_leave
	 add	%sp, PTREGS_OFF, %o0
	ba,pt	%xcc, rtrap
	 nop

	/* This is how fork() was meant to be done, 8 instruction entry.
	 *
	 * I questioned the following code briefly, let me clear things
	 * up so you must not reason on it like I did.
	 *
	 * Know the fork_kpsr etc. we use in the sparc32 port?  We don't
	 * need it here because the only piece of window state we copy to
	 * the child is the CWP register.  Even if the parent sleeps,
	 * we are safe because we stuck it into pt_regs of the parent
	 * so it will not change.

Annotation

Implementation Notes