Changeset 73a4bab in mainline
- Timestamp:
- 2005-11-11T14:06:55Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8a0b3730
- Parents:
- 0172eba
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.config
r0172eba r73a4bab 37 37 38 38 CONFIG_USERSPACE = n 39 CONFIG_TEST =39 #CONFIG_TEST = 40 40 #CONFIG_TEST = synch/rwlock1 41 41 #CONFIG_TEST = synch/rwlock2 42 42 #CONFIG_TEST = synch/rwlock3 43 #CONFIG_TEST = synch/rwlock443 CONFIG_TEST = synch/rwlock4 44 44 #CONFIG_TEST = synch/rwlock5 45 45 #CONFIG_TEST = synch/semaphore1 -
arch/ia32/include/atomic.h
r0172eba r73a4bab 36 36 static inline void atomic_inc(atomic_t *val) { 37 37 #ifdef CONFIG_SMP 38 __asm__ volatile ("lock incl %0\n" : " =m" (*val));38 __asm__ volatile ("lock incl %0\n" : "+m" (*val)); 39 39 #else 40 __asm__ volatile ("incl %0\n" : " =m" (*val));40 __asm__ volatile ("incl %0\n" : "+m" (*val)); 41 41 #endif /* CONFIG_SMP */ 42 42 } … … 44 44 static inline void atomic_dec(atomic_t *val) { 45 45 #ifdef CONFIG_SMP 46 __asm__ volatile ("lock decl %0\n" : " =m" (*val));46 __asm__ volatile ("lock decl %0\n" : "+m" (*val)); 47 47 #else 48 __asm__ volatile ("decl %0\n" : " =m" (*val));48 __asm__ volatile ("decl %0\n" : "+m" (*val)); 49 49 #endif /* CONFIG_SMP */ 50 50 } 51 52 static inline atomic_t atomic_inc_pre(atomic_t *val) 53 { 54 atomic_t r; 55 __asm__ volatile ( 56 "movl $1,%0;" 57 "lock xaddl %0,%1;" 58 : "=r"(r), "+m" (*val) 59 ); 60 return r; 61 } 62 63 64 65 static inline atomic_t atomic_dec_pre(atomic_t *val) 66 { 67 atomic_t r; 68 __asm__ volatile ( 69 "movl $-1,%0;" 70 "lock xaddl %0,%1;" 71 : "=r"(r), "+m" (*val) 72 ); 73 return r; 74 } 75 76 #define atomic_inc_post(val) (atomic_inc_pre(val)+1) 77 #define atomic_dec_post(val) (atomic_dec_pre(val)-1) 78 79 51 80 52 81 static inline int test_and_set(volatile int *val) { … … 56 85 "movl $1, %0\n" 57 86 "xchgl %0, %1\n" 58 : "=r" (v)," =m" (*val)87 : "=r" (v),"+m" (*val) 59 88 ); 60 89 -
arch/ia64/include/atomic.h
r0172eba r73a4bab 38 38 atomic_t v; 39 39 40 /*41 * __asm__ volatile ("fetchadd8.rel %0 = %1, %2\n" : "=r" (v), "=m" (val) : "i" (imm));42 */40 41 __asm__ volatile ("fetchadd8.rel %0 = %1, %2\n" : "=r" (v), "+m" (*val) : "i" (imm)); 42 43 43 *val += imm; 44 44 … … 46 46 } 47 47 48 static inline atomic_t atomic_inc(atomic_t *val) { return atomic_add(val, 1); } 49 static inline atomic_t atomic_dec(atomic_t *val) { return atomic_add(val, -1); } 48 static inline void atomic_inc(atomic_t *val) { atomic_add(val, 1); } 49 static inline void atomic_dec(atomic_t *val) { atomic_add(val, -1); } 50 51 52 static inline atomic_t atomic_inc_pre(atomic_t *val) { return atomic_add(val, 1); } 53 static inline atomic_t atomic_dec_pre(atomic_t *val) { return atomic_add(val, -1); } 54 55 56 static inline atomic_t atomic_inc_post(atomic_t *val) { return atomic_add(val, 1)+1; } 57 static inline atomic_t atomic_dec_post(atomic_t *val) { return atomic_add(val, -1)-1; } 58 59 60 50 61 51 62 #endif -
arch/ia64/src/ivt.S
r0172eba r73a4bab 1 1 # 2 2 # Copyright (C) 2005 Jakub Vana 3 # Copyright (C) 2005 Jakub Jermar4 3 # All rights reserved. 5 4 # … … 29 28 30 29 #include <arch/stack.h> 31 #include <arch/register.h>32 30 33 31 #define STACK_ITEMS 12 … … 107 105 108 106 /* assume kernel backing store */ 109 /* mov ar.bspstore = r28 ;; */107 mov ar.bspstore = r28 ;; 110 108 111 109 mov r29 = ar.bsp … … 147 145 ld8 r24 = [r31], +8 ;; /* load ar.rsc */ 148 146 149 /* mov ar.bspstore = r28 ;; *//* (step 4) */150 /* mov ar.rnat = r27 *//* (step 5) */147 mov ar.bspstore = r28 ;; /* (step 4) */ 148 mov ar.rnat = r27 /* (step 5) */ 151 149 152 150 mov ar.pfs = r25 /* (step 6) */ … … 192 190 193 191 /* 6. switch to bank 1 and reenable PSR.ic */ 194 ssm PSR_IC_MASK192 ssm 0x2000 195 193 bsw.1 ;; 196 194 srlz.d … … 248 246 249 247 /* 9. skipped (will not enable interrupts) */ 250 /*251 * ssm PSR_I_MASK252 * ;;253 * srlz.d254 */255 248 256 249 /* 10. call handler */ … … 262 255 263 256 /* 12. skipped (will not disable interrupts) */ 264 /*265 * rsm PSR_I_MASK266 * ;;267 * srlz.d268 */269 257 270 258 /* 13. restore general and floating-point registers */ … … 320 308 321 309 /* 15. disable PSR.ic and switch to bank 0 */ 322 rsm PSR_IC_MASK310 rsm 0x2000 323 311 bsw.0 ;; 324 312 srlz.d -
arch/mips32/include/atomic.h
r0172eba r73a4bab 35 35 #define atomic_dec(x) (a_sub(x,1)) 36 36 37 #define atomic_inc_pre(x) (a_add(x,1)-1) 38 #define atomic_dec_pre(x) (a_sub(x,1)+1) 39 40 #define atomic_inc_post(x) (a_add(x,1)) 41 #define atomic_dec_post(x) (a_sub(x,1)) 42 43 37 44 typedef volatile __u32 atomic_t; 38 45 … … 45 52 * of the variable to a special register and if another process writes to 46 53 * the same location, the SC (store-conditional) instruction fails. 54 55 Returns (*val)+i 56 47 57 */ 48 58 static inline atomic_t a_add(atomic_t *val, int i) … … 73 83 * 74 84 * Implemented in the same manner as a_add, except we substract the value. 85 86 Returns (*val)-i 87 75 88 */ 76 89 static inline atomic_t a_sub(atomic_t *val, int i)
Note:
See TracChangeset
for help on using the changeset viewer.