arch/xtensa/boot/boot-redboot/bootstrap.S

Source file repositories/reference/linux-study-clean/arch/xtensa/boot/boot-redboot/bootstrap.S

File Facts

System
Linux kernel
Corpus path
arch/xtensa/boot/boot-redboot/bootstrap.S
Extension
.S
Size
5049 bytes
Lines
256
Domain
Architecture Layer
Bucket
arch/xtensa
Inferred role
Architecture Layer: arch/xtensa
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 <asm/core.h>
#include <asm/regs.h>
#include <asm/asmmacro.h>
#include <asm/cacheasm.h>
#include <asm/processor.h>
	/*
	 * RB-Data: RedBoot data/bss
	 * P:	    Boot-Parameters
	 * L:	    Kernel-Loader
	 *
	 * The Linux-Kernel image including the loader must be loaded
	 * to a position so that the kernel and the boot parameters
	 * can fit in the space before the load address.
	 *  ______________________________________________________
	 * |_RB-Data_|_P_|__________|_L_|___Linux-Kernel___|______|
	 *                          ^
	 *                          ^ Load address
	 *  ______________________________________________________
	 * |___Linux-Kernel___|_P_|_L_|___________________________|
	 *
	 * The loader copies the parameter to the position that will
	 * be the end of the kernel and itself to the end of the
	 * parameter list.
	 */

/* Make sure we have enough space for the 'uncompressor' */

#define STACK_SIZE 32768
#define HEAP_SIZE (131072*4)

	# a2: Parameter list
	# a3: Size of parameter list

	.section .start, "ax"

	.globl __start
	/* this must be the first byte of the loader! */
__start:
	abi_entry(32)		# we do not intend to return
	_call0	_start
__start_a0:
	.align 4

	.section .text, "ax"
	.literal_position
	.begin literal_prefix .text

	/* put literals in here! */

	.globl _start
_start:

	/* 'reset' window registers */

	movi	a4, 1
	wsr	a4, ps
	rsync
#if XCHAL_HAVE_WINDOWED
	rsr	a5, windowbase
	ssl	a5
	sll	a4, a4
	wsr	a4, windowstart
	rsync
#endif
	movi	a4, KERNEL_PS_WOE_MASK
	wsr	a4, ps
	rsync

KABI_C0	mov	abi_saved0, abi_arg0

Annotation

Implementation Notes