arch/s390/kernel/entry.S

Source file repositories/reference/linux-study-clean/arch/s390/kernel/entry.S

File Facts

System
Linux kernel
Corpus path
arch/s390/kernel/entry.S
Extension
.S
Size
18658 bytes
Lines
639
Domain
Architecture Layer
Bucket
arch/s390
Inferred role
Architecture Layer: exported/initcall integration point
Status
integration 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

#include <linux/export.h>
#include <linux/init.h>
#include <linux/linkage.h>
#include <asm/asm-extable.h>
#include <asm/alternative.h>
#include <asm/processor.h>
#include <asm/cache.h>
#include <asm/dwarf.h>
#include <asm/errno.h>
#include <asm/ptrace.h>
#include <asm/thread_info.h>
#include <asm/asm-offsets.h>
#include <asm/unistd.h>
#include <asm/page.h>
#include <asm/sigp.h>
#include <asm/bug.h>
#include <asm/irq.h>
#include <asm/fpu-insn.h>
#include <asm/setup.h>
#include <asm/nmi.h>
#include <asm/nospec-insn.h>
#include <asm/lowcore.h>
#include <asm/machine.h>

_LPP_OFFSET	= __LC_LPP

	.macro STBEAR address
	ALTERNATIVE "nop", ".insn s,0xb2010000,\address", ALT_FACILITY(193)
	.endm

	.macro LBEAR address
	ALTERNATIVE "nop", ".insn s,0xb2000000,\address", ALT_FACILITY(193)
	.endm

	.macro LPSWEY address, lpswe
	ALTERNATIVE_2 "b \lpswe;nopr", \
		".insn siy,0xeb0000000071,\address,0", ALT_FACILITY(193),		\
		__stringify(.insn siy,0xeb0000000071,LOWCORE_ALT_ADDRESS+\address,0),	\
		ALT_FEATURE(MFEATURE_LOWCORE)
	.endm

	.macro MBEAR reg, lowcore
	ALTERNATIVE "brcl 0,0", __stringify(mvc __PT_LAST_BREAK(8,\reg),__LC_LAST_BREAK(\lowcore)),\
		ALT_FACILITY(193)
	.endm

	.macro	CHECK_VMAP_STACK savearea, lowcore, oklabel
	lgr	%r14,%r15
	nill	%r14,0x10000 - THREAD_SIZE
	oill	%r14,STACK_INIT_OFFSET
	clg	%r14,__LC_KERNEL_STACK(\lowcore)
	je	\oklabel
	clg	%r14,__LC_ASYNC_STACK(\lowcore)
	je	\oklabel
	clg	%r14,__LC_MCCK_STACK(\lowcore)
	je	\oklabel
	clg	%r14,__LC_NODAT_STACK(\lowcore)
	je	\oklabel
	clg	%r14,__LC_RESTART_STACK(\lowcore)
	je	\oklabel
	la	%r14,\savearea(\lowcore)
	j	stack_invalid
	.endm

	/*
	 * The TSTMSK macro generates a test-under-mask instruction by
	 * calculating the memory offset for the specified mask value.
	 * Mask value can be any constant.  The macro shifts the mask
	 * value to calculate the memory offset for the test-under-mask
	 * instruction.

Annotation

Implementation Notes