Changeset a1ef4c0 in mainline
- Timestamp:
- 2012-11-22T23:35:33Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 02ee69da
- Parents:
- 94b39ba
- Location:
- kernel/arch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/include/atomic.h
r94b39ba ra1ef4c0 216 216 #define local_atomic_cas(pptr, exp_val, new_val) \ 217 217 ({ \ 218 typeof(*(pptr)) old_val; \ 219 _atomic_cas_impl(pptr, exp_val, new_val, old_val, ""); \ 218 /* Use proper types and avoid name clashes */ \ 219 typeof(*(pptr)) _old_val_cas; \ 220 typeof(*(pptr)) _exp_val_cas = exp_val; \ 221 typeof(*(pptr)) _new_val_cas = new_val; \ 222 _atomic_cas_impl(pptr, _exp_val_cas, _new_val_cas, _old_val_cas, ""); \ 220 223 \ 221 old_val; \224 _old_val_cas; \ 222 225 }) 223 226 … … 236 239 #define local_atomic_exchange(pptr, new_val) \ 237 240 ({ \ 238 typeof(*(pptr)) exp_val; \ 239 typeof(*(pptr)) old_val; \ 241 /* Use proper types and avoid name clashes */ \ 242 typeof(*(pptr)) _exp_val_x; \ 243 typeof(*(pptr)) _old_val_x; \ 244 typeof(*(pptr)) _new_val_x = new_val; \ 240 245 \ 241 246 do { \ 242 exp_val= *pptr; \243 old_val = local_atomic_cas(pptr, exp_val, new_val); \244 } while ( old_val != exp_val); \247 _exp_val_x = *pptr; \ 248 _old_val_x = local_atomic_cas(pptr, _exp_val_x, _new_val_x); \ 249 } while (_old_val_x != _exp_val_x); \ 245 250 \ 246 old_val; \251 _old_val_x; \ 247 252 }) 248 253 -
kernel/arch/ia32/include/atomic.h
r94b39ba ra1ef4c0 203 203 #define local_atomic_cas(pptr, exp_val, new_val) \ 204 204 ({ \ 205 typeof(*(pptr)) old_val; \ 206 _atomic_cas_impl(pptr, exp_val, new_val, old_val, ""); \ 205 /* Use proper types and avoid name clashes */ \ 206 typeof(*(pptr)) _old_val_cas; \ 207 typeof(*(pptr)) _exp_val_cas = exp_val; \ 208 typeof(*(pptr)) _new_val_cas = new_val; \ 209 _atomic_cas_impl(pptr, _exp_val_cas, _new_val_cas, _old_val_cas, ""); \ 207 210 \ 208 old_val; \211 _old_val_cas; \ 209 212 }) 210 213 … … 223 226 #define local_atomic_exchange(pptr, new_val) \ 224 227 ({ \ 225 typeof(*(pptr)) exp_val; \ 226 typeof(*(pptr)) old_val; \ 228 /* Use proper types and avoid name clashes */ \ 229 typeof(*(pptr)) _exp_val_x; \ 230 typeof(*(pptr)) _old_val_x; \ 231 typeof(*(pptr)) _new_val_x = new_val; \ 227 232 \ 228 233 do { \ 229 exp_val= *pptr; \230 old_val = local_atomic_cas(pptr, exp_val, new_val); \231 } while ( old_val != exp_val); \234 _exp_val_x = *pptr; \ 235 _old_val_x = local_atomic_cas(pptr, _exp_val_x, _new_val_x); \ 236 } while (_old_val_x != _exp_val_x); \ 232 237 \ 233 old_val; \238 _old_val_x; \ 234 239 }) 235 240
Note:
See TracChangeset
for help on using the changeset viewer.