mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-22 03:09:16 +08:00
fix mips64 some bug
This commit is contained in:
+11
-10
@@ -16,8 +16,8 @@ register rt_uint32_t $GP __asm__ ("$28");
|
||||
|
||||
rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter, rt_uint8_t *stack_addr, void *texit)
|
||||
{
|
||||
static rt_uint32_t wSR=0;
|
||||
static rt_uint32_t wGP;
|
||||
static rt_ubase_t wSR=0;
|
||||
static rt_ubase_t wGP;
|
||||
rt_uint8_t *stk;
|
||||
|
||||
struct pt_regs *pt;
|
||||
@@ -25,26 +25,27 @@ rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter, rt_uint8_t *stack_ad
|
||||
rt_uint32_t i;
|
||||
|
||||
/* Get stack aligned */
|
||||
stk = (rt_uint8_t *)RT_ALIGN_DOWN((rt_uint32_t)stack_addr, 8);
|
||||
stk = (rt_uint8_t *)RT_ALIGN_DOWN((rt_ubase_t)stack_addr, 8);
|
||||
stk -= sizeof(struct pt_regs);
|
||||
pt = (struct pt_regs*)stk;
|
||||
|
||||
#ifndef ARCH_MIPS64
|
||||
for (i = 0; i < 8; ++i)
|
||||
{
|
||||
pt->pad0[i] = 0xdeadbeef;
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Fill Stack register numbers */
|
||||
for (i = 0; i < 32; ++i)
|
||||
{
|
||||
pt->regs[i] = 0xdeadbeef;
|
||||
}
|
||||
|
||||
pt->regs[REG_SP] = (rt_uint32_t)stk;
|
||||
pt->regs[REG_A0] = (rt_uint32_t)parameter;
|
||||
pt->regs[REG_GP] = (rt_uint32_t)$GP;
|
||||
pt->regs[REG_FP] = (rt_uint32_t)0x0;
|
||||
pt->regs[REG_RA] = (rt_uint32_t)texit;
|
||||
pt->regs[REG_SP] = (rt_ubase_t)stk;
|
||||
pt->regs[REG_A0] = (rt_ubase_t)parameter;
|
||||
pt->regs[REG_GP] = (rt_ubase_t)$GP;
|
||||
pt->regs[REG_FP] = (rt_ubase_t)0x0;
|
||||
pt->regs[REG_RA] = (rt_ubase_t)texit;
|
||||
|
||||
pt->hi = 0x0;
|
||||
pt->lo = 0x0;
|
||||
@@ -53,7 +54,7 @@ rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter, rt_uint8_t *stack_ad
|
||||
pt->cp0_status |= (ST0_CU1 | ST0_FR);
|
||||
#endif
|
||||
pt->cp0_cause = read_c0_cause();
|
||||
pt->cp0_epc = (rt_uint32_t)tentry;
|
||||
pt->cp0_epc = (rt_ubase_t)tentry;
|
||||
pt->cp0_badvaddr = 0x0;
|
||||
|
||||
return stk;
|
||||
|
||||
Reference in New Issue
Block a user