From 574e22bdbd1a2d907016c953b230782215190a1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8B=A4=E4=B8=BA=E6=9C=AC?= <1207280597@qq.com> Date: Wed, 13 Sep 2017 15:21:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=9C=A8=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E2=80=9Crtconfig.h=E2=80=9D=E4=B8=AD=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=A1=AC=E6=B5=AE=E7=82=B9FPU=E7=9A=84=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A1=B9=EF=BC=8C=20=E6=B5=AE=E7=82=B9=E7=BB=8F?= =?UTF-8?q?=E5=B8=B8=E4=BC=9A=E7=94=A8=E5=88=B0=EF=BC=8C=E6=89=80=E4=BB=A5?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=BD=BF=E7=94=A8=E7=A1=AC=E6=B5=AE=E7=82=B9?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/ls1cdev/drivers/board.c | 2 ++ bsp/ls1cdev/rtconfig.h | 2 ++ libcpu/mips/loongson_1c/stackframe_fpu.h | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/bsp/ls1cdev/drivers/board.c b/bsp/ls1cdev/drivers/board.c index 29d7fa7142..cb5fbdae09 100644 --- a/bsp/ls1cdev/drivers/board.c +++ b/bsp/ls1cdev/drivers/board.c @@ -94,8 +94,10 @@ void rt_hw_board_init(void) /* init operating system timer */ rt_hw_timer_init(); +#ifdef RT_USING_FPU /* init hardware fpu */ rt_hw_fpu_init(); +#endif rt_kprintf("current sr: 0x%08x\n", read_c0_status()); } diff --git a/bsp/ls1cdev/rtconfig.h b/bsp/ls1cdev/rtconfig.h index 99bb973b90..8f87497875 100644 --- a/bsp/ls1cdev/rtconfig.h +++ b/bsp/ls1cdev/rtconfig.h @@ -75,6 +75,8 @@ #define RT_UART_RX_BUFFER_SIZE 64 // +#define RT_USING_FPU + //
#define RT_USING_CONSOLE // diff --git a/libcpu/mips/loongson_1c/stackframe_fpu.h b/libcpu/mips/loongson_1c/stackframe_fpu.h index 58e9271833..93b8ef10c3 100644 --- a/libcpu/mips/loongson_1c/stackframe_fpu.h +++ b/libcpu/mips/loongson_1c/stackframe_fpu.h @@ -37,6 +37,7 @@ .macro SAVE_FPU .set push .set noreorder +#ifdef RT_USING_FPU move k1, sp /* 保存现场 */ and k0, k1, 0xFFFFFFF8 /* 8字节对齐 */ PTR_SUBU sp, k0, PT_FPU_SIZE /* 计算栈底 */ @@ -57,6 +58,7 @@ s.d $f28, PT_FPU_R28(sp) s.d $f30, PT_FPU_R30(sp) move sp, k1 /* 恢复现场 */ +#endif .set reorder .set pop .endm @@ -65,6 +67,7 @@ .macro RESTORE_FPU .set push .set noreorder +#ifdef RT_USING_FPU move k1, sp /* 保存现场 */ and k0, k1, 0xFFFFFFF8 /* 8字节对齐 */ PTR_SUBU sp, k0, PT_FPU_SIZE /* 计算栈底*/ @@ -85,6 +88,7 @@ l.d $f28, PT_FPU_R28(sp) l.d $f30, PT_FPU_R30(sp) move sp, k1 /* 恢复现场 */ +#endif .set reorder .set pop .endm From 96f3600bdecf127033a6f95b9f6fd6510cfb88ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8B=A4=E4=B8=BA=E6=9C=AC?= <1207280597@qq.com> Date: Thu, 14 Sep 2017 12:14:55 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=B0=86=E5=BC=82=E5=B8=B8=E5=90=91?= =?UTF-8?q?=E9=87=8F=E9=97=B4=E9=9A=94=E4=BB=8E0x20=E6=94=B9=E4=B8=BA0x80?= =?UTF-8?q?=EF=BC=8Cmips=E7=B3=BB=E5=88=97cpu=E7=9A=84=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=90=91=E9=87=8F=E7=9A=84=E9=97=B4=E9=9A=94=E4=B8=BA0x80?= =?UTF-8?q?=EF=BC=88=E5=8D=81=E8=BF=9B=E5=88=B6=E7=9A=84128=EF=BC=89?= =?UTF-8?q?=E5=AD=97=E8=8A=82=20=E8=AF=A6=E7=BB=86=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E8=AF=B7=E5=8F=82=E8=A7=81=E3=80=8Asee=20mips=20run=E3=80=8B?= =?UTF-8?q?=E4=B8=AD=E7=9A=845.3=E8=8A=82=E2=80=94=E2=80=94=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E5=90=91=E9=87=8F=EF=BC=9A=E5=BC=82=E5=B8=B8=E5=A4=84?= =?UTF-8?q?=E7=90=86=E5=BC=80=E5=A7=8B=E7=9A=84=E5=9C=B0=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bsp/ls1cdev/applications/startup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bsp/ls1cdev/applications/startup.c b/bsp/ls1cdev/applications/startup.c index ed2854e97e..cb1025dec6 100644 --- a/bsp/ls1cdev/applications/startup.c +++ b/bsp/ls1cdev/applications/startup.c @@ -51,9 +51,9 @@ void rtthread_startup(void) rt_hw_interrupt_init(); /* copy vector */ - rt_memcpy((void *)A_K0BASE, tlb_refill_exception, 0x20); - rt_memcpy((void *)(A_K0BASE + 0x180), general_exception, 0x20); - rt_memcpy((void *)(A_K0BASE + 0x200), irq_exception, 0x20); + rt_memcpy((void *)A_K0BASE, tlb_refill_exception, 0x80); + rt_memcpy((void *)(A_K0BASE + 0x180), general_exception, 0x80); + rt_memcpy((void *)(A_K0BASE + 0x200), irq_exception, 0x80); invalidate_writeback_dcache_all(); invalidate_icache_all();