summaryrefslogtreecommitdiff
path: root/libcpu/risc-v/common64/cpuport_gcc.S
blob: 5361646753f856ac294952be2410fd3ee39c0386 (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 "cpuport.h"
#include "stackframe.h"
#include "asm-generic.h"

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