Changeset 888207c9 in mainline for uspace/lib/c
- Timestamp:
- 2011-09-07T22:19:24Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2aeec8ef
- Parents:
- 038b289 (diff), 5081276 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- uspace/lib/c/arch
- Files:
-
- 11 edited
-
abs32le/include/types.h (modified) (1 diff)
-
amd64/include/atomic.h (modified) (5 diffs)
-
amd64/include/types.h (modified) (1 diff)
-
arm32/include/types.h (modified) (1 diff)
-
ia32/include/atomic.h (modified) (5 diffs)
-
ia32/include/types.h (modified) (1 diff)
-
ia64/include/types.h (modified) (1 diff)
-
mips32/include/types.h (modified) (1 diff)
-
mips64/include/types.h (modified) (1 diff)
-
ppc32/include/types.h (modified) (1 diff)
-
sparc64/include/types.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/abs32le/include/types.h
r038b289 r888207c9 52 52 53 53 typedef uint32_t uintptr_t; 54 typedef int32_t intptr_t; 54 55 typedef uint32_t atomic_count_t; 55 56 typedef int32_t atomic_signed_t; -
uspace/lib/c/arch/amd64/include/atomic.h
r038b289 r888207c9 44 44 static inline void atomic_inc(atomic_t *val) 45 45 { 46 #ifdef __PCC__ 47 asm volatile ( 48 "lock incq %0\n" 49 : "+m" (val->count) 50 ); 51 #else 46 52 asm volatile ( 47 53 "lock incq %[count]\n" 48 54 : [count] "+m" (val->count) 49 55 ); 56 #endif 50 57 } 51 58 52 59 static inline void atomic_dec(atomic_t *val) 53 60 { 61 #ifdef __PCC__ 62 asm volatile ( 63 "lock decq %0\n" 64 : "+m" (val->count) 65 ); 66 #else 54 67 asm volatile ( 55 68 "lock decq %[count]\n" 56 69 : [count] "+m" (val->count) 57 70 ); 71 #endif 58 72 } 59 73 … … 62 76 atomic_count_t r = 1; 63 77 78 #ifdef __PCC__ 79 asm volatile ( 80 "lock xaddq %1, %0\n" 81 : "+m" (val->count), 82 "+r" (r) 83 ); 84 #else 64 85 asm volatile ( 65 86 "lock xaddq %[r], %[count]\n" … … 67 88 [r] "+r" (r) 68 89 ); 90 #endif 69 91 70 92 return r; … … 75 97 atomic_count_t r = -1; 76 98 99 #ifdef __PCC__ 100 asm volatile ( 101 "lock xaddq %1, %0\n" 102 : "+m" (val->count), 103 "+r" (r) 104 ); 105 #else 77 106 asm volatile ( 78 107 "lock xaddq %[r], %[count]\n" … … 80 109 [r] "+r" (r) 81 110 ); 111 #endif 82 112 83 113 return r; -
uspace/lib/c/arch/amd64/include/types.h
r038b289 r888207c9 52 52 53 53 typedef uint64_t uintptr_t; 54 typedef int64_t intptr_t; 54 55 typedef uint64_t atomic_count_t; 55 56 typedef int64_t atomic_signed_t; -
uspace/lib/c/arch/arm32/include/types.h
r038b289 r888207c9 53 53 54 54 typedef uint32_t uintptr_t; 55 typedef int32_t intptr_t; 55 56 typedef uint32_t atomic_count_t; 56 57 typedef int32_t atomic_signed_t; -
uspace/lib/c/arch/ia32/include/atomic.h
r038b289 r888207c9 42 42 static inline void atomic_inc(atomic_t *val) 43 43 { 44 #ifdef __PCC__ 45 asm volatile ( 46 "lock incl %0\n" 47 : "+m" (val->count) 48 ); 49 #else 44 50 asm volatile ( 45 51 "lock incl %[count]\n" 46 52 : [count] "+m" (val->count) 47 53 ); 54 #endif 48 55 } 49 56 50 57 static inline void atomic_dec(atomic_t *val) 51 58 { 59 #ifdef __PCC__ 60 asm volatile ( 61 "lock decl %0\n" 62 : "+m" (val->count) 63 ); 64 #else 52 65 asm volatile ( 53 66 "lock decl %[count]\n" 54 67 : [count] "+m" (val->count) 55 68 ); 69 #endif 56 70 } 57 71 … … 60 74 atomic_count_t r = 1; 61 75 76 #ifdef __PCC__ 77 asm volatile ( 78 "lock xaddl %1, %0\n" 79 : "+m" (val->count), 80 "+r" (r) 81 ); 82 #else 62 83 asm volatile ( 63 84 "lock xaddl %[r], %[count]\n" … … 65 86 [r] "+r" (r) 66 87 ); 88 #endif 67 89 68 90 return r; … … 73 95 atomic_count_t r = -1; 74 96 97 #ifdef __PCC__ 98 asm volatile ( 99 "lock xaddl %1, %0\n" 100 : "+m" (val->count), 101 "+r" (r) 102 ); 103 #else 75 104 asm volatile ( 76 105 "lock xaddl %[r], %[count]\n" … … 78 107 [r] "+r" (r) 79 108 ); 109 #endif 80 110 81 111 return r; -
uspace/lib/c/arch/ia32/include/types.h
r038b289 r888207c9 52 52 53 53 typedef uint32_t uintptr_t; 54 typedef int32_t intptr_t; 54 55 typedef uint32_t atomic_count_t; 55 56 typedef int32_t atomic_signed_t; -
uspace/lib/c/arch/ia64/include/types.h
r038b289 r888207c9 62 62 63 63 typedef uint64_t uintptr_t; 64 typedef int64_t intptr_t; 64 65 typedef uint64_t atomic_count_t; 65 66 typedef int64_t atomic_signed_t; -
uspace/lib/c/arch/mips32/include/types.h
r038b289 r888207c9 53 53 54 54 typedef uint32_t uintptr_t; 55 typedef int32_t intptr_t; 55 56 typedef uint32_t atomic_count_t; 56 57 typedef int32_t atomic_signed_t; -
uspace/lib/c/arch/mips64/include/types.h
r038b289 r888207c9 53 53 54 54 typedef uint64_t uintptr_t; 55 typedef int64_t intptr_t; 55 56 typedef uint64_t atomic_count_t; 56 57 typedef int64_t atomic_signed_t; -
uspace/lib/c/arch/ppc32/include/types.h
r038b289 r888207c9 52 52 53 53 typedef uint32_t uintptr_t; 54 typedef int32_t intptr_t; 54 55 typedef uint32_t atomic_count_t; 55 56 typedef int32_t atomic_signed_t; -
uspace/lib/c/arch/sparc64/include/types.h
r038b289 r888207c9 52 52 53 53 typedef uint64_t uintptr_t; 54 typedef int64_t intptr_t; 54 55 typedef uint64_t atomic_count_t; 55 56 typedef int64_t atomic_signed_t;
Note:
See TracChangeset
for help on using the changeset viewer.
