Lines Matching +full:low +full:- +full:g
2 * Atomic operations on 64-bit quantities.
9 * See the COPYING file in the top-level directory.
17 /* This provides atomic operations on 64-bit type, using a reader-writer
18 * spinlock on architectures that do not have 64-bit accesses. Even on
26 uint32_t low, high;
40 return qatomic_read__nocheck(&s->value); in stat64_get()
45 qatomic_set__nocheck(&s->value, value); in stat64_set()
50 qatomic_add(&s->value, value); in stat64_add()
55 uint64_t orig = qatomic_read__nocheck(&s->value); in stat64_min()
57 orig = qatomic_cmpxchg__nocheck(&s->value, orig, value); in stat64_min()
63 uint64_t orig = qatomic_read__nocheck(&s->value); in stat64_max()
65 orig = qatomic_cmpxchg__nocheck(&s->value, orig, value); in stat64_max()
73 bool stat64_add32_carry(Stat64 *s, uint32_t low, uint32_t high);
78 *s = (Stat64) { .low = value, .high = value >> 32, .lock = 0 }; in stat64_init()
83 uint32_t low, high; in stat64_add() local
85 low = (uint32_t) value; in stat64_add()
86 if (!low) { in stat64_add()
88 qatomic_add(&s->high, high); in stat64_add()
94 uint32_t orig = s->low; in stat64_add()
95 uint32_t result = orig + low; in stat64_add()
98 if (result < low || high) { in stat64_add()
100 if (stat64_add32_carry(s, low, high)) { in stat64_add()
106 /* No carry, try with a 32-bit cmpxchg. The result is independent of in stat64_add()
110 old = qatomic_cmpxchg(&s->low, orig, result); in stat64_add()
119 uint32_t low, high; in stat64_min() local
123 low = (uint32_t) value; in stat64_min()
125 orig_high = qatomic_read(&s->high); in stat64_min()
131 /* High 32 bits are equal. Read low after high, otherwise we in stat64_min()
132 * can get a false positive (e.g. 0x1235,0x0000 changes to in stat64_min()
137 orig_low = qatomic_read(&s->low); in stat64_min()
138 if (orig_low <= low) { in stat64_min()
147 orig_high = qatomic_read(&s->high); in stat64_min()
159 uint32_t low, high; in stat64_max() local
163 low = (uint32_t) value; in stat64_max()
165 orig_high = qatomic_read(&s->high); in stat64_max()
171 /* High 32 bits are equal. Read low after high, otherwise we in stat64_max()
172 * can get a false positive (e.g. 0x1234,0x8000 changes to in stat64_max()
177 orig_low = qatomic_read(&s->low); in stat64_max()
178 if (orig_low >= low) { in stat64_max()
187 orig_high = qatomic_read(&s->high); in stat64_max()