arch/parisc/kernel/relocate_kernel.S

Source file repositories/reference/linux-study-clean/arch/parisc/kernel/relocate_kernel.S

File Facts

System
Linux kernel
Corpus path
arch/parisc/kernel/relocate_kernel.S
Extension
.S
Size
2874 bytes
Lines
150
Domain
Architecture Layer
Bucket
arch/parisc
Inferred role
Architecture Layer: arch/parisc
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 <linux/kexec.h>

#include <asm/assembly.h>
#include <asm/asm-offsets.h>
#include <asm/page.h>
#include <asm/setup.h>
#include <asm/psw.h>

.level PA_ASM_LEVEL

.macro	kexec_param name
.align 8
ENTRY(kexec\()_\name)
#ifdef CONFIG_64BIT
	.dword 0
#else
	.word 0
#endif

ENTRY(kexec\()_\name\()_offset)
	.word kexec\()_\name - relocate_new_kernel
.endm

.text

/* args:
 * r26 - kimage->head
 * r25 - start address of kernel
 * r24 - physical address of relocate code
 */

ENTRY_CFI(relocate_new_kernel)
0:	copy	%arg1, %rp
	/* disable I and Q bit, so we are allowed to execute RFI */
	rsm PSW_SM_I, %r0
	nop
	nop
	nop
	nop
	nop
	nop
	nop

	rsm PSW_SM_Q, %r0
	nop
	nop
	nop
	nop
	nop
	nop
	nop

	/*
	 * After return-from-interrupt, we want to run without Code/Data
	 * translation enabled just like on a normal boot.
	 */

	/* calculate new physical execution address */
	ldo	1f-0b(%arg2), %r1
	mtctl	%r0, %cr17 /* IIASQ */
	mtctl	%r0, %cr17 /* IIASQ */
	mtctl	%r1, %cr18 /* IIAOQ */
	ldo	4(%r1),%r1
	mtctl	%r1, %cr18 /* IIAOQ */
#ifdef CONFIG_64BIT
	depdi,z	1, PSW_W_BIT, 1, %r1
	mtctl	%r1, %cr22 /* IPSW */
#else
	mtctl	%r0, %cr22 /* IPSW */

Annotation

Implementation Notes