summaryrefslogtreecommitdiff
path: root/libcpu/risc-v/common/stack_gcc.S
blob: c6eaaba754915193a17fe3ac92b9470bd4bc5e8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * Copyright (c) 2006-2022, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2022-10-19     RT-Thread    the first version
 */

#include "asm-generic.h"

    .section ".text","ax"

START_POINT(_thread_start)
    REG_L   ra, SZREG(sp)       /* thread exit */
    addi    sp, sp, 2 * SZREG
    REG_L   a0, (sp)            /* parameter */
    REG_L   t0, SZREG(sp)       /* tentry */
    addi    sp, sp, 2 * SZREG
    mv      s1, ra
    jalr    t0
    jalr    s1
    j       .                   /* never here */
START_POINT_END(_thread_start)