diff options
| author | Bernard Xiong <[email protected]> | 2020-04-07 21:23:05 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-04-07 21:23:05 +0800 |
| commit | baa3145bfe61b3330b6a160523cc5470fa5db3a7 (patch) | |
| tree | 3d2c48aae7203b14038ba7b98b500b5343ed7f2a /libcpu/mips/common/stack.c | |
| parent | e382ae08da2c5f1ba718d086fcec0bd2adaae06b (diff) | |
| parent | c27f13c6c9f2df5ce2fd74652d3388c3f3c5a843 (diff) | |
Merge pull request #3504 from bigmagic123/add_ls2k_bsp
Add ls2k bsp
Diffstat (limited to 'libcpu/mips/common/stack.c')
| -rw-r--r-- | libcpu/mips/common/stack.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/libcpu/mips/common/stack.c b/libcpu/mips/common/stack.c index b0e613c7a7..b933b184e7 100644 --- a/libcpu/mips/common/stack.c +++ b/libcpu/mips/common/stack.c @@ -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; |
