Ignore:
Timestamp:
Aug 13, 2018, 1:43:20 PM (6 years ago)
Author:
alain
Message:

Introduce the math library, to support the floating point
data used by the multi-thread fft application.
Fix several bugs regarding the FPU context save/restore.
Introduce support for the %f format in printf.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/tsar_mips32/core/hal_special.c

    r457 r459  
    113113void hal_fpu_enable()
    114114{
     115    // set CU1 bit (FPU enable) in c0_sr
    115116        asm volatile
    116117        ( ".set noat                         \n"
     
    120121      "mtc0   $27,    $12                \n"
    121122      ".set at                           \n" );
     123
     124    // set CU1 bit in calling thread UZONE
     125    uint32_t * uzone = CURRENT_THREAD->uzone_current;
     126    uzone[34] |= 0x20000000;
    122127}
    123128
     
    125130void hal_fpu_disable()
    126131{
     132    // reset CU1 bit (FPU enable) in c0_sr
    127133        asm volatile
    128134        ( ".set noat                         \n"
     
    133139      "mtc0   $27,    $12                \n"
    134140          ".set at                           \n");
     141
     142    // reset CU1 bit in calling thread UZONE
     143    uint32_t * uzone = CURRENT_THREAD->uzone_current;
     144    uzone[34] &= 0xDFFFFFFF;
    135145}
    136146
Note: See TracChangeset for help on using the changeset viewer.