This commit is contained in:
刘可亮
2024-09-03 11:16:08 +08:00
parent cf270df8d6
commit 803cac77d5
2931 changed files with 614364 additions and 31222 deletions

View File

@@ -15,6 +15,8 @@
#include "cpuport.h"
#define RISCV_RT_STACK_ALIGN16 (16)
#ifndef RT_USING_SMP
volatile rt_ubase_t rt_interrupt_from_thread = 0;
volatile rt_ubase_t rt_interrupt_to_thread = 0;
@@ -114,7 +116,10 @@ rt_uint8_t *rt_hw_stack_init(void *tentry,
int i;
stk = stack_addr + sizeof(rt_ubase_t);
stk = (rt_uint8_t *)RT_ALIGN_DOWN((rt_ubase_t)stk, REGBYTES);
/*In the standard RISCV-V calling convention, the stack grows downward and
the stack pointer is always keep 16-byte aligned*/
stk = (rt_uint8_t *)RT_ALIGN_DOWN((rt_ubase_t)stk, RISCV_RT_STACK_ALIGN16);
stk -= sizeof(struct rt_hw_stack_frame);
frame = (struct rt_hw_stack_frame *)stk;