arch/m68k/coldfire/entry.S

Source file repositories/reference/linux-study-clean/arch/m68k/coldfire/entry.S

File Facts

System
Linux kernel
Corpus path
arch/m68k/coldfire/entry.S
Extension
.S
Size
5193 bytes
Lines
199
Domain
Architecture Layer
Bucket
arch/m68k
Inferred role
Architecture Layer: arch/m68k
Status
atlas-only

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

#include <linux/linkage.h>
#include <asm/unistd.h>
#include <asm/thread_info.h>
#include <asm/errno.h>
#include <asm/setup.h>
#include <asm/asm-offsets.h>
#include <asm/entry.h>

#ifdef CONFIG_COLDFIRE_SW_A7
/*
 *	Define software copies of the supervisor and user stack pointers.
 */
.bss
sw_ksp:
.long	0
sw_usp:
.long	0
#endif /* CONFIG_COLDFIRE_SW_A7 */

.text

.globl system_call
.globl resume
.globl ret_from_exception
.globl sys_call_table
.globl inthandler

enosys:
	mov.l	#sys_ni_syscall,%d3
	bra	1f

ENTRY(system_call)
	SAVE_ALL_SYS
	move	#0x2000,%sr		/* enable intrs again */
	GET_CURRENT(%d2)

	cmpl	#NR_syscalls,%d0
	jcc	enosys
	lea	sys_call_table,%a0
	lsll	#2,%d0			/* movel %a0@(%d0:l:4),%d3 */
	movel	%a0@(%d0),%d3
	jeq	enosys

1:
	movel	%sp,%d2			/* get thread_info pointer */
	andl	#-THREAD_SIZE,%d2	/* at start of kernel stack */
	movel	%d2,%a0
	movel	%a0@,%a1		/* save top of frame */
	movel	%sp,%a1@(TASK_THREAD+THREAD_ESP0)
	btst	#(TIF_SYSCALL_TRACE%8),%a0@(TINFO_FLAGS+(31-TIF_SYSCALL_TRACE)/8)
	bnes	1f

	movel	%d3,%a0
	jbsr	%a0@
	movel	%d0,%sp@(PT_OFF_D0)	/* save the return value */
	jra	ret_from_exception
1:
	movel	#-ENOSYS,%d2		/* strace needs -ENOSYS in PT_OFF_D0 */
	movel	%d2,PT_OFF_D0(%sp)	/* on syscall entry */
	subql	#4,%sp
	SAVE_SWITCH_STACK
	jbsr	syscall_trace_enter
	RESTORE_SWITCH_STACK
	addql	#4,%sp
	addql	#1,%d0
	jeq	ret_from_exception
	movel	%d3,%a0
	jbsr	%a0@
	movel	%d0,%sp@(PT_OFF_D0)		/* save the return value */
	subql	#4,%sp			/* dummy return address */

Annotation

Implementation Notes