riscv: simplify the stack pointer setup in head.S
authorChristoph Hellwig <hch@lst.de>
Mon, 15 Apr 2019 09:14:37 +0000 (11:14 +0200)
committerPalmer Dabbelt <palmer@sifive.com>
Thu, 25 Apr 2019 21:51:10 +0000 (14:51 -0700)
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: Christoph Hellwig <hch@lst.de>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
arch/riscv/kernel/asm-offsets.c
arch/riscv/kernel/head.S

index dac98348c6a34a362ffa92fa34829d37d7ea26c9..578bb5efc085cbeddce97d6257f78f59f6c517da 100644 (file)
@@ -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.
index 9e3840d84d3e49a1ce723864ad20fe731ea6f1fe..62d2c9c85433c2041cf40351cd6b4ab923e2cde6 100644 (file)
@@ -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