Changeset c739102 in mainline for kernel/generic/include/macros.h
- Timestamp:
- 2012-11-21T23:26:22Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0f2c80a
- Parents:
- bebf97d (diff), 1f7753a (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/macros.h
rbebf97d rc739102 52 52 uint64_t sz2) 53 53 { 54 uint64_t e1 = s1 + sz1; 55 uint64_t e2 = s2 + sz2; 56 57 return ((s1 < e2) && (s2 < e1)); 54 uint64_t e1 = s1 + sz1 - 1; 55 uint64_t e2 = s2 + sz2 - 1; 56 57 /* both sizes are non-zero */ 58 if (sz1 && sz2) 59 return ((s1 <= e2) && (s2 <= e1)); 60 61 /* one size is non-zero */ 62 if (sz2) 63 return ((s1 >= s2) && (s1 <= e2)); 64 if (sz1) 65 return ((s2 >= s1) && (s2 <= e1)); 66 67 /* both are zero */ 68 return (s1 == s2); 58 69 } 59 70 … … 119 130 | ((((uint64_t) (up)) & UINT32_C(0xffffffff)) << 32)) 120 131 132 /* Test for sum overflow. */ 133 #define overflows(a, b) \ 134 ((a) + (b) < (a)) 135 136 /* Test for sum overflow into positive numbers. */ 137 #define overflows_into_positive(a, b) \ 138 (overflows((a), (b)) && ((a) + (b) > 0)) 139 121 140 /** Pseudorandom generator 122 141 *
Note:
See TracChangeset
for help on using the changeset viewer.