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_context.c

    r457 r459  
    186186    // get remote child thread cluster and local pointer
    187187    cxy_t      child_cxy = GET_CXY( child_xp );
    188     thread_t * child_ptr = (thread_t *)GET_PTR( child_xp );
     188    thread_t * child_ptr = GET_PTR( child_xp );
    189189
    190190    // get remote child cpu_context local pointer
     
    257257    // get thread cluster and local pointer
    258258    cxy_t      cxy = GET_CXY( thread_xp );
    259     thread_t * ptr = (thread_t *)GET_PTR( thread_xp );
     259    thread_t * ptr = GET_PTR( thread_xp );
    260260
    261261    // get context pointer
     
    358358{
    359359    // allocate a local FPU context in kernel stack
    360     hal_fpu_context_t  context;
     360    hal_fpu_context_t  src_context;
    361361
    362362    // get remote child cluster and local pointer
    363363    cxy_t      thread_cxy = GET_CXY( thread_xp );
    364     thread_t * thread_ptr = (thread_t *)GET_PTR( thread_xp );
     364    thread_t * thread_ptr = GET_PTR( thread_xp );
    365365
    366366    asm volatile(
     
    399399    "swc1    $f31,  31*4(%0)  \n"   
    400400    ".set reorder             \n"
    401     : : "r"(&context) );
     401    : : "r"(&src_context) );
     402
     403    // get local pointer on target thread FPU context
     404    void * dst_context = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->fpu_context ) );
    402405
    403406    // copy local context to remote child context)
    404     hal_remote_memcpy( XPTR( thread_cxy , &thread_ptr->fpu_context ),
    405                        XPTR( local_cxy  , &context ) ,
     407    hal_remote_memcpy( XPTR( thread_cxy , dst_context ),
     408                       XPTR( local_cxy  , &src_context ),
    406409                       sizeof( hal_fpu_context_t ) );
    407410
     
    411414void hal_fpu_context_restore( thread_t * thread )
    412415{
     416    // get pointer on FPU context and cast to uint32_t
    413417    uint32_t ctx = (uint32_t)thread->fpu_context;
    414418
Note: See TracChangeset for help on using the changeset viewer.