Subversion Repositories HelenOS-historic

Rev

Rev 1702 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1702 Rev 1780
Line 81... Line 81...
81
}
81
}
82
 
82
 
83
#define atomic_preinc(val) (atomic_postinc(val)+1)
83
#define atomic_preinc(val) (atomic_postinc(val)+1)
84
#define atomic_predec(val) (atomic_postdec(val)-1)
84
#define atomic_predec(val) (atomic_postdec(val)-1)
85
 
85
 
86
static inline __u32 test_and_set(atomic_t *val) {
86
static inline uint32_t test_and_set(atomic_t *val) {
87
    __u32 v;
87
    uint32_t v;
88
   
88
   
89
    __asm__ volatile (
89
    __asm__ volatile (
90
        "movl $1, %0\n"
90
        "movl $1, %0\n"
91
        "xchgl %0, %1\n"
91
        "xchgl %0, %1\n"
92
        : "=r" (v),"=m" (val->count)
92
        : "=r" (v),"=m" (val->count)
Line 96... Line 96...
96
}
96
}
97
 
97
 
98
/** ia32 specific fast spinlock */
98
/** ia32 specific fast spinlock */
99
static inline void atomic_lock_arch(atomic_t *val)
99
static inline void atomic_lock_arch(atomic_t *val)
100
{
100
{
101
    __u32 tmp;
101
    uint32_t tmp;
102
 
102
 
103
    preemption_disable();
103
    preemption_disable();
104
    __asm__ volatile (
104
    __asm__ volatile (
105
        "0:;"
105
        "0:;"
106
#ifdef CONFIG_HT
106
#ifdef CONFIG_HT