Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset b03a666 in mainline


Ignore:
Timestamp:
2010-02-20T20:35:45Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
7af8c0e, c2efbb4
Parents:
228666c
Message:

define atomic_count_t even for abs32le

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/abs32le/include/atomic.h

    r228666c rb03a666  
    5454}
    5555
    56 static inline long atomic_postinc(atomic_t *val)
     56static inline atomic_count_t atomic_postinc(atomic_t *val)
    5757{
    5858        /* On real hardware both the storing of the previous
     
    6060           atomic action. */
    6161       
    62         long prev = val->count;
     62        atomic_count_t prev = val->count;
    6363       
    6464        val->count++;
     
    6666}
    6767
    68 static inline long atomic_postdec(atomic_t *val)
     68static inline atomic_count_t atomic_postdec(atomic_t *val)
    6969{
    7070        /* On real hardware both the storing of the previous
     
    7272           atomic action. */
    7373       
    74         long prev = val->count;
     74        atomic_count_t prev = val->count;
    7575       
    7676        val->count--;
     
    8181#define atomic_predec(val)  (atomic_postdec(val) - 1)
    8282
    83 static inline uint32_t test_and_set(atomic_t *val)
     83static inline atomic_count_t test_and_set(atomic_t *val)
    8484{
    85         uint32_t prev = val->count;
     85        atomic_count_t prev = val->count;
    8686        val->count = 1;
    8787        return prev;
  • kernel/arch/abs32le/include/types.h

    r228666c rb03a666  
    5555typedef uint32_t unative_t;
    5656typedef int32_t native_t;
     57typedef uint32_t atomic_count_t;
    5758
    5859typedef struct {
  • uspace/lib/libc/arch/abs32le/include/atomic.h

    r228666c rb03a666  
    4343#include <atomicdflt.h>
    4444
    45 static inline bool cas(atomic_t *val, long ov, long nv)
     45static inline bool cas(atomic_t *val, atomic_count_t ov, atomic_count_t nv)
    4646{
    4747        if (val->count == ov) {
     
    6767}
    6868
    69 static inline long atomic_postinc(atomic_t *val)
     69static inline atomic_count_t atomic_postinc(atomic_t *val)
    7070{
    7171        /* On real hardware both the storing of the previous
     
    7373           atomic action. */
    7474       
    75         long prev = val->count;
     75        atomic_count_t prev = val->count;
    7676       
    7777        val->count++;
     
    7979}
    8080
    81 static inline long atomic_postdec(atomic_t *val)
     81static inline atomic_count_t atomic_postdec(atomic_t *val)
    8282{
    8383        /* On real hardware both the storing of the previous
     
    8585           atomic action. */
    8686       
    87         long prev = val->count;
     87        atomic_count_t prev = val->count;
    8888       
    8989        val->count--;
  • uspace/lib/libc/arch/abs32le/include/types.h

    r228666c rb03a666  
    5454
    5555typedef uint32_t uintptr_t;
     56typedef uint32_t atomic_count_t;
     57typedef int32_t atomic_signed_t;
    5658
    5759#endif
Note: See TracChangeset for help on using the changeset viewer.