Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit c637b911 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Palmer Dabbelt
Browse files

riscv: simplify the stack pointer setup in head.S



We don't need THREAD_SIZE in asm-offsets.c as we can just calculate
the value of init_thread_union + THREAD_SIZE using cpp, just like
we do a few lines above.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarAtish Patra <atish.patra@wdc.com>
Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
parent df16c40c
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -312,9 +312,6 @@ void asm_offsets(void)
		- offsetof(struct task_struct, thread.fstate.f[0])
	);

	/* The assembler needs access to THREAD_SIZE as well. */
	DEFINE(ASM_THREAD_SIZE, THREAD_SIZE);

	/*
	 * We allocate a pt_regs on the stack when entering the kernel.  This
	 * ensures the alignment is sane.
+1 −4
Original line number Diff line number Diff line
@@ -69,10 +69,7 @@ clear_bss_done:
	/* Restore C environment */
	la tp, init_task
	sw zero, TASK_TI_CPU(tp)

	la sp, init_thread_union
	li a0, ASM_THREAD_SIZE
	add sp, sp, a0
	la sp, init_thread_union + THREAD_SIZE

	/* Start the kernel */
	mv a0, s0