Ignore:
Timestamp:
2010-05-24T18:57:31Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0095368
Parents:
666f492
Message:

major code revision

  • replace spinlocks taken with interrupts disabled with irq_spinlocks
  • change spacing (not indendation) to be tab-size independent
  • use unsigned integer types where appropriate (especially bit flags)
  • visual separation
  • remove argument names in function prototypes
  • string changes
  • correct some formating directives
  • replace various cryptic single-character variables (t, a, m, c, b, etc.) with proper identifiers (thread, task, timeout, as, itm, itc, etc.)
  • unify some assembler constructs
  • unused page table levels are now optimized out in compile time
  • replace several ints (with boolean semantics) with bools
  • use specifically sized types instead of generic types where appropriate (size_t, uint32_t, btree_key_t)
  • improve comments
  • split asserts with conjuction into multiple independent asserts
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/synch/rwlock.h

    r666f492 rda1bafb  
    4848
    4949typedef struct {
    50         SPINLOCK_DECLARE(lock);
     50        IRQ_SPINLOCK_DECLARE(lock);
     51       
    5152        /**
    5253         * Mutex for writers, readers can bypass it if readers_in is positive.
     54         *
    5355         */
    5456        mutex_t exclusive;
     57       
    5558        /** Number of readers in critical section. */
    5659        size_t readers_in;
     
    5962#define rwlock_write_lock(rwl) \
    6063        _rwlock_write_lock_timeout((rwl), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE)
     64
    6165#define rwlock_read_lock(rwl) \
    6266        _rwlock_read_lock_timeout((rwl), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE)
     67
    6368#define rwlock_write_trylock(rwl) \
    6469        _rwlock_write_lock_timeout((rwl), SYNCH_NO_TIMEOUT, \
    6570            SYNCH_FLAGS_NON_BLOCKING)
     71
    6672#define rwlock_read_trylock(rwl) \
    6773        _rwlock_read_lock_timeout((rwl), SYNCH_NO_TIMEOUT, \
    6874            SYNCH_FLAGS_NON_BLOCKING)
     75
    6976#define rwlock_write_lock_timeout(rwl, usec) \
    7077        _rwlock_write_lock_timeout((rwl), (usec), SYNCH_FLAGS_NONE)
     78
    7179#define rwlock_read_lock_timeout(rwl, usec) \
    7280        _rwlock_read_lock_timeout((rwl), (usec), SYNCH_FLAGS_NONE)
    7381
    74 extern void rwlock_initialize(rwlock_t *rwl);
    75 extern void rwlock_read_unlock(rwlock_t *rwl);
    76 extern void rwlock_write_unlock(rwlock_t *rwl);
    77 extern int _rwlock_read_lock_timeout(rwlock_t *rwl, uint32_t usec, int flags);
    78 extern int _rwlock_write_lock_timeout(rwlock_t *rwl, uint32_t usec, int flags);
     82extern void rwlock_initialize(rwlock_t *);
     83extern void rwlock_read_unlock(rwlock_t *);
     84extern void rwlock_write_unlock(rwlock_t *);
     85extern int _rwlock_read_lock_timeout(rwlock_t *, uint32_t, unsigned int);
     86extern int _rwlock_write_lock_timeout(rwlock_t *, uint32_t, unsigned int);
    7987
    8088#endif
Note: See TracChangeset for help on using the changeset viewer.