Browse Source

update MIPS branch.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1045 bbd45198-f89e-11dd-88c7-29a3b14d5316
bernard.xiong@gmail.com 14 years ago
parent
commit
45461f8afe
2 changed files with 13 additions and 3 deletions
  1. 2 3
      libcpu/mips/jz47xx/stack.c
  2. 11 0
      libcpu/mips/loongson/start_gcc.S

+ 2 - 3
libcpu/mips/jz47xx/stack.c

@@ -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 &= 0xfffffffe;
-    	g_sr |= 0x8403;
+    	g_sr |= 0x0403;
     }
 
     /** 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) cp0_get_lo();	/* lo */
 	*(--stk) = (rt_uint32_t) cp0_get_hi();	/* hi */
-	// *(--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) g_sr; 			/* C0_SR: HW2 = En, IE = En */
 	*(--stk) = (rt_uint32_t) texit;	        /* ra */
 	*(--stk) = (rt_uint32_t) 0x0000001e;	/* s8 */
 	*(--stk) = (rt_uint32_t) stack_addr;	/* sp */

+ 11 - 0
libcpu/mips/loongson/start_gcc.S

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