Ignore:
Timestamp:
Mar 7, 2018, 9:02:03 AM (6 years ago)
Author:
alain
Message:

1) improve the threads and process destruction mechanism.
2) introduce FIFOs in the soclib_tty driver.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/remote_spinlock.c

    r433 r436  
    22 * remote_spinlock.c - kernel remote spinlock implementation.
    33 *
    4  * Authors  Mohamed Karaoui (2015)
    5  *          Alain   Greiner (2016)
     4 * Authors   Alain   Greiner (2016,2017,2018)
    65 *
    76 * Copyright (c) UPMC Sorbonne Universites
     
    3938        hal_remote_sw ( XPTR( cxy , &ptr->taken ) , 0 );
    4039
    41 #if CONFIG_DEBUG_LOCKS
    42         hal_remote_swd( XPTR( cxy , &ptr->owner ) , XPTR_NULL );
    43         xlist_entry_init( XPTR( cxy , &ptr->list ) );
     40#if CONFIG_DEBUG_REMOTE_SPINLOCKS
     41hal_remote_swd( XPTR( cxy , &ptr->owner ) , XPTR_NULL );
     42xlist_entry_init( XPTR( cxy , &ptr->list ) );
    4443#endif
    4544
     
    7675                thread_ptr->remote_locks++;
    7776
    78 #if CONFIG_DEBUG_LOCKS
    79                 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) ,
    80                                 XPTR( local_cxy , thread_ptr) );
    81                 xlist_add_first( XPTR( local_cxy , &thread_ptr->xlocks_root ) ,
    82                                  XPTR( lock_cxy , &lock_ptr->list ) );
     77#if CONFIG_DEBUG_REMOTE_SPINLOCKS
     78hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) ,
     79                XPTR( local_cxy , thread_ptr) );
     80xlist_add_first( XPTR( local_cxy , &thread_ptr->xlocks_root ) ,
     81                         XPTR( lock_cxy , &lock_ptr->list ) );
    8382#endif
    8483
     
    121120        thread_ptr->remote_locks++;
    122121
    123 #if CONFIG_DEBUG_LOCKS
    124         hal_remote_swd( XPTR( lock_cxy  , &lock_ptr->owner ) ,
    125                         XPTR( local_cxy , thread_ptr) );
    126         xlist_add_first( XPTR( local_cxy , &thread_ptr->xlocks_root ) ,
    127                          XPTR( lock_cxy  , &lock_ptr->list ) );
     122#if CONFIG_DEBUG_REMOTE_SPINLOCKS
     123hal_remote_swd( XPTR( lock_cxy  , &lock_ptr->owner ) ,
     124                XPTR( local_cxy , thread_ptr) );
     125xlist_add_first( XPTR( local_cxy , &thread_ptr->xlocks_root ) ,
     126                 XPTR( lock_cxy  , &lock_ptr->list ) );
    128127#endif
    129128
     
    144143        thread_t          * thread_ptr = CURRENT_THREAD;
    145144
    146 #if CONFIG_DEBUG_LOCKS
    147         hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , XPTR_NULL );
    148         xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) );
     145#if CONFIG_DEBUG_REMOTE_SPINLOCKS
     146hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , XPTR_NULL );
     147xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) );
    149148#endif
    150149
     
    197196        thread_ptr->remote_locks++;
    198197
    199 #if CONFIG_DEBUG_LOCKS
    200         hal_remote_swd( XPTR( lock_cxy  , &lock_ptr->owner ) ,
    201                         XPTR( local_cxy , thread_ptr) );
    202         xlist_add_first( XPTR( local_cxy , &thread_ptr->xlocks_root ) ,
    203                          XPTR( lock_cxy  , &lock_ptr->list ) );
     198#if CONFIG_DEBUG_REMOTE_SPINLOCKS
     199hal_remote_swd( XPTR( lock_cxy  , &lock_ptr->owner ),
     200                XPTR( local_cxy , thread_ptr) );
     201xlist_add_first( XPTR( local_cxy , &thread_ptr->xlocks_root ),
     202                 XPTR( lock_cxy  , &lock_ptr->list ) );
     203
     204// if( (uint32_t)lock_ptr == 0x66788 )
     205// printk("\n@@@ %s : thread %x takes remote_spinlock %x\n",
     206//__FUNCTION__, thread_ptr, lock_ptr );
     207
    204208#endif
    205209
     
    218222        thread_t          * thread_ptr = CURRENT_THREAD;
    219223
    220 #if CONFIG_DEBUG_LOCKS
    221         hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , XPTR_NULL );
    222         xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) );
     224#if CONFIG_DEBUG_REMOTE_SPINLOCKS
     225hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , XPTR_NULL );
     226xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) );
     227
     228// if( (uint32_t)lock_ptr == 0x66788 )
     229// printk("\n@@@ %s : thread %x releases remote_spinlock %x\n",
     230// __FUNCTION__, thread_ptr, lock_ptr );
     231
    223232#endif
    224233
Note: See TracChangeset for help on using the changeset viewer.