Changeset bf677f6 in mainline
- Timestamp:
- 2013-11-11T21:17:25Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9426f7c4
- Parents:
- 679dc0c
- Location:
- uspace/lib/c/arch/sparc32
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/sparc32/include/libarch/atomic.h
r679dc0c rbf677f6 38 38 #define LIBC_ARCH_ATOMIC_H_ 39 39 40 #define CAS 41 40 42 #include <atomicdflt.h> 41 43 #include <sys/types.h> 42 44 45 static inline bool cas(atomic_t *val, atomic_count_t ov, atomic_count_t nv) 46 { 47 if (val->count == ov) { 48 val->count = nv; 49 return true; 50 } 51 52 return false; 53 } 54 55 static inline void atomic_inc(atomic_t *val) { 56 /* On real hardware the increment has to be done 57 as an atomic action. */ 58 59 val->count++; 60 } 61 62 static inline void atomic_dec(atomic_t *val) { 63 /* On real hardware the decrement has to be done 64 as an atomic action. */ 65 66 val->count++; 67 } 68 69 static inline atomic_count_t atomic_postinc(atomic_t *val) 70 { 71 /* On real hardware both the storing of the previous 72 value and the increment have to be done as a single 73 atomic action. */ 74 75 atomic_count_t prev = val->count; 76 77 val->count++; 78 return prev; 79 } 80 81 static inline atomic_count_t atomic_postdec(atomic_t *val) 82 { 83 /* On real hardware both the storing of the previous 84 value and the decrement have to be done as a single 85 atomic action. */ 86 87 atomic_count_t prev = val->count; 88 89 val->count--; 90 return prev; 91 } 92 93 #define atomic_preinc(val) (atomic_postinc(val) + 1) 94 #define atomic_predec(val) (atomic_postdec(val) - 1) 95 96 #if 0 43 97 /** Atomic add operation. 44 98 * … … 102 156 (void) atomic_add(val, -1); 103 157 } 158 #endif 104 159 105 160 #endif -
uspace/lib/c/arch/sparc32/include/libarch/syscall.h
r679dc0c rbf677f6 27 27 */ 28 28 29 /** @addtogroup libcsparc 6429 /** @addtogroup libcsparc32 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef LIBC_sparc 64_SYSCALL_H_36 #define LIBC_sparc 64_SYSCALL_H_35 #ifndef LIBC_sparc32_SYSCALL_H_ 36 #define LIBC_sparc32_SYSCALL_H_ 37 37 38 38 #include <sys/types.h> -
uspace/lib/c/arch/sparc32/src/fibril.S
r679dc0c rbf677f6 39 39 # should a thread switch occur. 40 40 # 41 # XXXCONTEXT_SAVE_ARCH_CORE %o041 CONTEXT_SAVE_ARCH_CORE %o0 42 42 retl 43 43 mov 1, %o0 ! context_save_arch returns 1 … … 53 53 # flushw 54 54 55 # XXXCONTEXT_RESTORE_ARCH_CORE %o055 CONTEXT_RESTORE_ARCH_CORE %o0 56 56 retl 57 57 xor %o0, %o0, %o0 ! context_restore_arch returns 0
Note:
See TracChangeset
for help on using the changeset viewer.