- Timestamp:
- 2010-06-25T13:38:30Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fc81981
- Parents:
- 09a0bd4a
- Location:
- kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/abs32le/include/atomic.h
r09a0bd4a r33c4f72 42 42 43 43 ATOMIC static inline void atomic_inc(atomic_t *val) 44 WRITES(&val->count) 45 REQUIRES_EXTENT_MUTABLE(val) 44 46 REQUIRES(val->count < ATOMIC_COUNT_MAX) 45 47 { … … 51 53 52 54 ATOMIC static inline void atomic_dec(atomic_t *val) 55 WRITES(&val->count) 56 REQUIRES_EXTENT_MUTABLE(val) 53 57 REQUIRES(val->count > ATOMIC_COUNT_MIN) 54 58 { … … 60 64 61 65 ATOMIC static inline atomic_count_t atomic_postinc(atomic_t *val) 66 WRITES(&val->count) 67 REQUIRES_EXTENT_MUTABLE(val) 62 68 REQUIRES(val->count < ATOMIC_COUNT_MAX) 63 69 { … … 73 79 74 80 ATOMIC static inline atomic_count_t atomic_postdec(atomic_t *val) 81 WRITES(&val->count) 82 REQUIRES_EXTENT_MUTABLE(val) 75 83 REQUIRES(val->count > ATOMIC_COUNT_MIN) 76 84 { … … 89 97 90 98 ATOMIC static inline atomic_count_t test_and_set(atomic_t *val) 99 WRITES(&val->count) 100 REQUIRES_EXTENT_MUTABLE(val) 91 101 { 92 102 /* On real hardware the retrieving of the original … … 99 109 } 100 110 101 ATOMIC static inline atomic_count_t arch_atomic_get(atomic_t *val)102 {103 /* This function is not needed on real hardware, it just104 duplicates the functionality of atomic_get(). It is105 defined here because atomic_get() is an inline function106 declared in a header file which we are included in. */107 108 return val->count;109 }110 111 111 static inline void atomic_lock_arch(atomic_t *val) 112 WRITES(&val->count) 113 REQUIRES_EXTENT_MUTABLE(val) 112 114 { 113 115 do { 114 while ( arch_atomic_get(val));116 while (val->count); 115 117 } while (test_and_set(val)); 116 118 } -
kernel/generic/include/atomic.h
r09a0bd4a r33c4f72 41 41 42 42 ATOMIC static inline void atomic_set(atomic_t *val, atomic_count_t i) 43 WRITES(&val->count) 44 REQUIRES_EXTENT_MUTABLE(val) 43 45 { 44 46 val->count = i; … … 46 48 47 49 ATOMIC static inline atomic_count_t atomic_get(atomic_t *val) 50 REQUIRES_EXTENT_MUTABLE(val) 48 51 { 49 52 return val->count; -
kernel/generic/include/verify.h
r09a0bd4a r33c4f72 39 39 #ifdef CONFIG_VERIFY_VCC 40 40 41 #define ATOMIC __spec_attr("atomic_inline", "") 42 #define REQUIRES(...) __requires(__VA_ARGS__) 41 #define ATOMIC __specification_attr("atomic_inline", "") 42 #define READS(...) __specification(reads(__VA_ARGS__)) 43 #define WRITES(...) __specification(writes(__VA_ARGS__)) 44 #define REQUIRES(...) __specification(requires __VA_ARGS__) 45 46 #define REQUIRES_EXTENT_MUTABLE(...) \ 47 REQUIRES(\extent_mutable(__VA_ARGS__)) 43 48 44 49 #else /* CONFIG_VERIFY_VCC */ 45 50 46 51 #define ATOMIC 52 #define READS(...) 53 #define WRITES(...) 47 54 #define REQUIRES(...) 55 56 #define REQUIRES_EXTENT_MUTABLE(...) 48 57 49 58 #endif /* CONFIG_VERIFY_VCC */
Note:
See TracChangeset
for help on using the changeset viewer.