Lines Matching +full:32 +full:- +full:bit

1 /* SPDX-License-Identifier: GPL-2.0 */
6 * Protect against 64-bit values tearing on 32-bit architectures. This is
11 * - Use a seqcount on 32-bit SMP, only disable preemption for 32-bit UP.
12 * - The whole thing is a no-op on 64-bit architectures.
27 * used for 64bit architectures).
34 * seqcounts are not used for UP kernels). 32-bit UP stat readers could read
35 * corrupted 64-bit values otherwise.
45 * u64_stats_update_begin(&stats->syncp);
46 * u64_stats_add(&stats->bytes64, len); // non atomic operation
47 * u64_stats_inc(&stats->packets64); // non atomic operation
48 * u64_stats_update_end(&stats->syncp);
57 * start = u64_stats_fetch_begin(&stats->syncp);
58 * tbytes = u64_stats_read(&stats->bytes64); // non atomic operation
59 * tpackets = u64_stats_read(&stats->packets64); // non atomic operation
60 * } while (u64_stats_fetch_retry(&stats->syncp, start));
69 #if BITS_PER_LONG==32 && defined(CONFIG_SMP)
83 return local64_read(&p->v); in u64_stats_read()
88 local64_add(val, &p->v); in u64_stats_add()
93 local64_inc(&p->v); in u64_stats_inc()
104 return p->v; in u64_stats_read()
109 p->v += val; in u64_stats_add()
114 p->v++; in u64_stats_inc()
120 #if BITS_PER_LONG == 32 && defined(CONFIG_SMP) in u64_stats_init()
121 seqcount_init(&syncp->seq); in u64_stats_init()
127 #if BITS_PER_LONG==32 && defined(CONFIG_SMP) in u64_stats_update_begin()
128 write_seqcount_begin(&syncp->seq); in u64_stats_update_begin()
134 #if BITS_PER_LONG==32 && defined(CONFIG_SMP) in u64_stats_update_end()
135 write_seqcount_end(&syncp->seq); in u64_stats_update_end()
144 #if BITS_PER_LONG==32 && defined(CONFIG_SMP) in u64_stats_update_begin_irqsave()
146 write_seqcount_begin(&syncp->seq); in u64_stats_update_begin_irqsave()
155 #if BITS_PER_LONG==32 && defined(CONFIG_SMP) in u64_stats_update_end_irqrestore()
156 write_seqcount_end(&syncp->seq); in u64_stats_update_end_irqrestore()
163 #if BITS_PER_LONG==32 && defined(CONFIG_SMP) in __u64_stats_fetch_begin()
164 return read_seqcount_begin(&syncp->seq); in __u64_stats_fetch_begin()
172 #if BITS_PER_LONG==32 && !defined(CONFIG_SMP) in u64_stats_fetch_begin()
181 #if BITS_PER_LONG==32 && defined(CONFIG_SMP) in __u64_stats_fetch_retry()
182 return read_seqcount_retry(&syncp->seq, start); in __u64_stats_fetch_retry()
191 #if BITS_PER_LONG==32 && !defined(CONFIG_SMP) in u64_stats_fetch_retry()
199 * - SMP 32bit arches use seqcount protection, irq safe.
200 * - UP 32bit must disable irqs.
201 * - 64bit have no problem atomically reading u64 values, irq safe.
205 #if BITS_PER_LONG==32 && !defined(CONFIG_SMP) in u64_stats_fetch_begin_irq()
214 #if BITS_PER_LONG==32 && !defined(CONFIG_SMP) in u64_stats_fetch_retry_irq()