MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_hw_fpu_init

Function rt_hw_fpu_init

libcpu/mips/common/mips_fpu.h:21–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19 */
20#ifdef RT_USING_FPU
21rt_inline void rt_hw_fpu_init(void)
22{
23 rt_uint32_t c0_status = 0;
24 rt_uint32_t c1_status = 0;
25
26 /* Enable CU1 */
27 c0_status = read_c0_status();
28 c0_status |= (ST0_CU1 | ST0_FR);
29 write_c0_status(c0_status);
30
31 /* FCSR Configs */
32 c1_status = read_c1_status();
33 c1_status |= (FPU_CSR_FS | FPU_CSR_FO | FPU_CSR_FN); /* Set FS, FO, FN */
34 c1_status &= ~(FPU_CSR_ALL_E); /* Disable exception */
35 c1_status = (c1_status & (~FPU_CSR_RM)) | FPU_CSR_RN; /* Set RN */
36 write_c1_status(c1_status);
37
38 return ;
39}
40#else
41 rt_inline void rt_hw_fpu_init(void){} /* Do nothing */
42#endif

Callers 4

rt_hw_board_initFunction · 0.85
rt_hw_board_initFunction · 0.85
rt_hw_board_initFunction · 0.85
rt_hw_board_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected