update MIPS branch.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1045 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong@gmail.com 2010-11-15 00:16:15 +00:00
parent 25f50375ef
commit 45461f8afe
2 changed files with 13 additions and 3 deletions

View File

@ -43,7 +43,7 @@ rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter, rt_uint8_t *stack_ad
{ {
g_sr = cp0_get_status(); g_sr = cp0_get_status();
g_sr &= 0xfffffffe; g_sr &= 0xfffffffe;
g_sr |= 0x8403; g_sr |= 0x0403;
} }
/** Start at stack top */ /** Start at stack top */
@ -53,8 +53,7 @@ rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter, rt_uint8_t *stack_ad
*(--stk) = (rt_uint32_t) 0xffff; /* c0_badvaddr */ *(--stk) = (rt_uint32_t) 0xffff; /* c0_badvaddr */
*(--stk) = (rt_uint32_t) cp0_get_lo(); /* lo */ *(--stk) = (rt_uint32_t) cp0_get_lo(); /* lo */
*(--stk) = (rt_uint32_t) cp0_get_hi(); /* hi */ *(--stk) = (rt_uint32_t) cp0_get_hi(); /* hi */
// *(--stk) = (rt_uint32_t) g_sr; /* C0_SR: HW2 = En, IE = En */ *(--stk) = (rt_uint32_t) g_sr; /* C0_SR: HW2 = En, IE = En */
*(--stk) = (rt_uint32_t) 0xFC01; /* C0_SR: HW2 = En, IE = En */
*(--stk) = (rt_uint32_t) texit; /* ra */ *(--stk) = (rt_uint32_t) texit; /* ra */
*(--stk) = (rt_uint32_t) 0x0000001e; /* s8 */ *(--stk) = (rt_uint32_t) 0x0000001e; /* s8 */
*(--stk) = (rt_uint32_t) stack_addr; /* sp */ *(--stk) = (rt_uint32_t) stack_addr; /* sp */

View File

@ -36,6 +36,7 @@ _start:
li sp, SYSTEM_STACK li sp, SYSTEM_STACK
la gp, _gp la gp, _gp
#if 0
/* copy IRAM section */ /* copy IRAM section */
la t0, _iramcopy la t0, _iramcopy
la t1, _iramstart la t1, _iramstart
@ -46,6 +47,7 @@ _iram_loop:
addiu t1, 4 addiu t1, 4
bne t1, t2, _iram_loop bne t1, t2, _iram_loop
addiu t0, 4 addiu t0, 4
#endif
/* clear bss */ /* clear bss */
la t0, __bss_start la t0, __bss_start
@ -94,6 +96,9 @@ cp0_get_lo:
/* Exception Handler */ /* Exception Handler */
/* 0x0 - TLB refill handler */ /* 0x0 - TLB refill handler */
.section .vectors.1, "ax", %progbits .section .vectors.1, "ax", %progbits
.global tlb_refill_exception
.type tlb_refill_exception,@function
tlb_refill_exception:
j tlb_refill_handler j tlb_refill_handler
nop nop
@ -104,11 +109,17 @@ cp0_get_lo:
/* 0x180 - Exception/Interrupt handler */ /* 0x180 - Exception/Interrupt handler */
.section .vectors.3, "ax", %progbits .section .vectors.3, "ax", %progbits
.global general_exception
.type general_exception,@function
general_exception:
j _general_exception_handler j _general_exception_handler
nop nop
/* 0x200 - Special Exception Interrupt handler (when IV is set in CP0_CAUSE) */ /* 0x200 - Special Exception Interrupt handler (when IV is set in CP0_CAUSE) */
.section .vectors.4, "ax", %progbits .section .vectors.4, "ax", %progbits
.global irq_exception
.type irq_exception,@function
irq_exception:
j _irq_handler j _irq_handler
nop nop