Changeset 423 for trunk/kernel/libk


Ignore:
Timestamp:
Jan 29, 2018, 5:49:38 PM (4 years ago)
Author:
alain
Message:

cosmetic

Location:
trunk/kernel/libk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/barrier.h

    r16 r423  
    1010 * ALMOS-MKH is free software; you can redistribute it and/or modify it
    1111 * under the terms of the GNU General Public License as published by
    12 err* the Free Software Foundation; version 2.0 of the License.
     12 * the Free Software Foundation; version 2.0 of the License.
    1313 *
    1414 * ALMOS-MKH is distributed in the hope that it will be useful, but
     
    3838typedef struct barrier_s
    3939{
    40     uint32_t   current;            // number of arrived threads
    41     uint32_t   sense;              // barrier state (toggle)
    42     uint32_t   pad[(CONFIG_CACHE_LINE_SIZE>>2)-2];
     40    uint32_t            current;            // number of arrived threads
     41    volatile uint32_t   sense;              // barrier state (toggle)
     42    uint32_t            pad[(CONFIG_CACHE_LINE_SIZE>>2)-2];
    4343}
    4444barrier_t;
  • trunk/kernel/libk/grdxt.c

    r406 r423  
    165165    if( (key >> (w1 + w2 + w3)) != 0 )
    166166    {
    167         panic("key value %x exceed (%d + %d + %d) bits", key , w1 , w2 , w3 );
     167        assert( false , __FUNCTION__ ,
     168        "key value %x exceed (%d + %d + %d) bits", key , w1 , w2 , w3 );
    168169    }
    169170
     
    236237    if( (key >> (w1 + w2 + w3)) != 0 )
    237238    {
    238         panic("key value %x exceed (%d + %d + %d) bits", key , w1 , w2 , w3 );
     239        assert( false , __FUNCTION__ ,
     240        "key value %x exceed (%d + %d + %d) bits", key , w1 , w2 , w3 );
    239241    }
    240242
     
    277279    if( (key >> (w1 + w2 + w3)) != 0 )
    278280    {
    279         panic("key value %x exceed (%d + %d + %d) bits", key , w1 , w2 , w3 );
     281        assert( false , __FUNCTION__ ,
     282        "key value %x exceed (%d + %d + %d) bits", key , w1 , w2 , w3 );
    280283    }
    281284
     
    319322    if( (start_key >> (w1 + w2 + w3)) != 0 )
    320323    {
    321         panic("start_key value %x exceed (%d + %d + %d) bits", start_key , w1 ,
    322               w2 , w3 );
     324        assert( false , __FUNCTION__ ,
     325        "start_key value %x exceed (%d + %d + %d) bits", start_key , w1 , w2 , w3 );
    323326    }
    324327
  • trunk/kernel/libk/htab.c

    r396 r423  
    9999    else
    100100    {
    101         panic("undefined item type");
     101        assert( false , __FUNCTION__ , "undefined item type\n" );
    102102    }
    103103
  • trunk/kernel/libk/remote_rwlock.c

    r409 r423  
    3434void remote_rwlock_init( xptr_t lock_xp )
    3535{
    36     remote_rwlock_t * lock_ptr = (remote_rwlock_t *)GET_PTR( lock_xp );
     36    remote_rwlock_t * lock_ptr = GET_PTR( lock_xp );
    3737    cxy_t             lock_cxy = GET_CXY( lock_xp );
    3838
     
    5555
    5656    // get cluster and local pointer on remote_rwlock
    57     remote_rwlock_t * lock_ptr = (remote_rwlock_t *)GET_PTR( lock_xp );
     57    remote_rwlock_t * lock_ptr = GET_PTR( lock_xp );
    5858    cxy_t             lock_cxy = GET_CXY( lock_xp );
    5959
     
    108108
    109109    // get cluster and local pointer on remote_rwlock
    110     remote_rwlock_t * lock_ptr = (remote_rwlock_t *)GET_PTR( lock_xp );
     110    remote_rwlock_t * lock_ptr = GET_PTR( lock_xp );
    111111    cxy_t             lock_cxy = GET_CXY( lock_xp );
    112112
     
    127127
    128128#if CONFIG_LOCKS_DEBUG
    129     xlist_unlink( XPTR( lock_cxy , &lock->ptr->list ) );
     129    xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) );
    130130#endif
    131131
     
    145145
    146146    // get cluster and local pointer on remote_rwlock
    147     remote_rwlock_t * lock_ptr = (remote_rwlock_t *)GET_PTR( lock_xp );
     147    remote_rwlock_t * lock_ptr = GET_PTR( lock_xp );
    148148    cxy_t             lock_cxy = GET_CXY( lock_xp );
    149149
     
    197197
    198198    // get cluster and local pointer on remote_rwlock
    199     remote_rwlock_t * lock_ptr = (remote_rwlock_t *)GET_PTR( lock_xp );
     199    remote_rwlock_t * lock_ptr = GET_PTR( lock_xp );
    200200    cxy_t             lock_cxy = GET_CXY( lock_xp );
    201201
     
    237237
    238238    // get cluster and local pointer on remote_rwlock
    239     remote_rwlock_t * lock_ptr = (remote_rwlock_t *)GET_PTR( lock_xp );
     239    remote_rwlock_t * lock_ptr = GET_PTR( lock_xp );
    240240    cxy_t             lock_cxy = GET_CXY( lock_xp );
    241241
  • trunk/kernel/libk/remote_spinlock.c

    r409 r423  
    3434void remote_spinlock_init( xptr_t lock_xp )
    3535{
    36         remote_spinlock_t * ptr = (remote_spinlock_t *)GET_PTR( lock_xp );
     36        remote_spinlock_t * ptr = GET_PTR( lock_xp );
    3737        cxy_t               cxy = GET_CXY( lock_xp );
    3838
    3939        hal_remote_sw ( XPTR( cxy , &ptr->taken ) , 0 );
    4040
    41 #if CONFIG_LOCKS_CONFIG
     41#if CONFIG_LOCKS_DEBUG
    4242        hal_remote_swd( XPTR( cxy , &ptr->owner ) , XPTR_NULL );
    4343        xlist_entry_init( XPTR( cxy , &ptr->list ) );
     
    5353
    5454        // get cluster and local pointer on remote_spinlock
    55         remote_spinlock_t * lock_ptr = (remote_spinlock_t *)GET_PTR( lock_xp );
     55        remote_spinlock_t * lock_ptr = GET_PTR( lock_xp );
    5656        cxy_t               lock_cxy = GET_CXY( lock_xp );
    5757
     
    7272                return 1;
    7373        }
    74         else                      // success : register lock in thread
     74        else                      // success : register lock in local thread
    7575        {
    7676                thread_ptr->remote_locks++;
     
    7878#if CONFIG_LOCKS_DEBUG
    7979                hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) ,
    80                                 XPTR( thread_cxy , thread_ptr) );
     80                                XPTR( local_cxy , thread_ptr) );
    8181                xlist_add_first( XPTR( local_cxy , &thread_ptr->xlocks_root ) ,
    8282                                 XPTR( lock_cxy , &lock_ptr->list ) );
     
    9797
    9898        // get cluster and local pointer on remote_spinlock
    99         remote_spinlock_t * lock_ptr = (remote_spinlock_t *)GET_PTR( lock_xp );
     99        remote_spinlock_t * lock_ptr = GET_PTR( lock_xp );
    100100        cxy_t               lock_cxy = GET_CXY( lock_xp );
    101101
     
    138138{
    139139        // get cluster and local pointer on remote_spinlock
    140         remote_spinlock_t * lock_ptr = (remote_spinlock_t *)GET_PTR( lock_xp );
     140        remote_spinlock_t * lock_ptr = GET_PTR( lock_xp );
    141141        cxy_t               lock_cxy = GET_CXY( lock_xp );
    142142
     
    167167
    168168        // get cluster and local pointer on remote_spinlock
    169         remote_spinlock_t * lock_ptr = (remote_spinlock_t *)GET_PTR( lock_xp );
     169        remote_spinlock_t * lock_ptr = GET_PTR( lock_xp );
    170170        cxy_t               lock_cxy = GET_CXY( lock_xp );
    171171
     
    212212{
    213213        // get cluster and local pointer on remote_spinlock
    214         remote_spinlock_t * lock_ptr = (remote_spinlock_t *)GET_PTR( lock_xp );
     214        remote_spinlock_t * lock_ptr = GET_PTR( lock_xp );
    215215        cxy_t               lock_cxy = GET_CXY( lock_xp );
    216216
  • trunk/kernel/libk/rwlock.h

    r409 r423  
    2727#include <kernel_config.h>
    2828#include <hal_types.h>
     29#include <list.h>
    2930
    3031/*******************************************************************************************
  • trunk/kernel/libk/xhtab.c

    r396 r423  
    139139    else
    140140    {
    141         panic("illegal item type");
     141        assert( false , __FUNCTION__ , "illegal item type\n" );
    142142    }
    143143
Note: See TracChangeset for help on using the changeset viewer.