diff options
| author | Bernard Xiong <[email protected]> | 2017-09-14 17:06:11 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-09-14 17:06:11 +0800 |
| commit | 0d193254f8600a36b5df604974beccf7491572e2 (patch) | |
| tree | 944e37e154f14fc888b3594d22911d5ec8e55388 | |
| parent | 6d07c084c7232e09d13c918b6ca918f39cbe15f9 (diff) | |
| parent | 96f3600bdecf127033a6f95b9f6fd6510cfb88ba (diff) | |
Merge pull request #845 from caogos/master
[BSP] Add FPU option for loongson1c.
| -rw-r--r-- | bsp/ls1cdev/applications/startup.c | 6 | ||||
| -rw-r--r-- | bsp/ls1cdev/drivers/board.c | 2 | ||||
| -rw-r--r-- | bsp/ls1cdev/rtconfig.h | 2 | ||||
| -rw-r--r-- | libcpu/mips/loongson_1c/stackframe_fpu.h | 4 |
4 files changed, 11 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(); 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 // </section> +#define RT_USING_FPU + // <section name="RT_USING_CONSOLE" description="Using console" default="true" > #define RT_USING_CONSOLE // <integer name="RT_CONSOLEBUF_SIZE" description="The buffer size for console output" default="128" /> 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 |
