Browse Source

add vector copy routine.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1059 bbd45198-f89e-11dd-88c7-29a3b14d5316
bernard.xiong@gmail.com 14 năm trước cách đây
mục cha
commit
643fea758b
1 tập tin đã thay đổi với 9 bổ sung6 xóa
  1. 9 6
      bsp/dev3210/startup.c

+ 9 - 6
bsp/dev3210/startup.c

@@ -17,6 +17,7 @@
 #include <cache.h>
 
 #include "board.h"
+#define A_K0BASE		0x80000000
 
 /**
  * @addtogroup Loongson SoC3210
@@ -42,6 +43,10 @@ void dump_mem(const unsigned char* addr)
 	rt_kprintf("\n");
 }
 
+extern void tlb_refill_exception(void);
+extern void general_exception(void);
+extern void irq_exception(void);
+
 /**
  * This function will startup RT-Thread RTOS.
  */
@@ -52,12 +57,10 @@ void rtthread_startup(void)
 	/* init hardware interrupt */
 	rt_hw_interrupt_init();
 
-	/*
-	dump_mem((rt_uint8_t*)0x80000000);
-	dump_mem((rt_uint8_t*)0x80000100);
-	dump_mem((rt_uint8_t*)0x80000180);
-	dump_mem((rt_uint8_t*)0x80000200);
-	*/
+	/* copy vector */
+	memcpy((void *)A_K0BASE, tlb_refill_exception, 0x20);
+	memcpy((void *)(A_K0BASE + 0x180), general_exception, 0x20);
+	memcpy((void *)(A_K0BASE + 0x200), irq_exception, 0x20);
 
 	/* init board */
 	rt_hw_board_init();