counter.h (af3dc4a7ca7fdfbe1790f34b83024557a35d11f2) counter.h (ab3059a8e7f382cff93dbe4d1b082adf62f4d849)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2012 Konstantin Belousov <kib@FreeBSD.org>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 33 unchanged lines hidden (view full) ---

42#define counter_exit() do {} while (0)
43
44#ifdef IN_SUBR_COUNTER_C
45
46static inline uint64_t
47counter_u64_read_one(uint64_t *p, int cpu)
48{
49
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2012 Konstantin Belousov <kib@FreeBSD.org>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 33 unchanged lines hidden (view full) ---

42#define counter_exit() do {} while (0)
43
44#ifdef IN_SUBR_COUNTER_C
45
46static inline uint64_t
47counter_u64_read_one(uint64_t *p, int cpu)
48{
49
50 return (atomic_load_64((uint64_t *)((char *)p + sizeof(struct pcpu) *
50 return (atomic_load_64((uint64_t *)((char *)p + UMA_PCPU_ALLOC_SIZE *
51 cpu)));
52}
53
54static inline uint64_t
55counter_u64_fetch_inline(uint64_t *p)
56{
57 uint64_t r;
58 int i;

--- 4 unchanged lines hidden (view full) ---

63
64 return (r);
65}
66
67static void
68counter_u64_zero_one_cpu(void *arg)
69{
70
51 cpu)));
52}
53
54static inline uint64_t
55counter_u64_fetch_inline(uint64_t *p)
56{
57 uint64_t r;
58 int i;

--- 4 unchanged lines hidden (view full) ---

63
64 return (r);
65}
66
67static void
68counter_u64_zero_one_cpu(void *arg)
69{
70
71 atomic_store_64((uint64_t *)((char *)arg + sizeof(struct pcpu) *
71 atomic_store_64((uint64_t *)((char *)arg + UMA_PCPU_ALLOC_SIZE *
72 PCPU_GET(cpuid)), 0);
73}
74
75static inline void
76counter_u64_zero_inline(counter_u64_t c)
77{
78
79 smp_rendezvous(smp_no_rendezvous_barrier, counter_u64_zero_one_cpu,

--- 14 unchanged lines hidden ---
72 PCPU_GET(cpuid)), 0);
73}
74
75static inline void
76counter_u64_zero_inline(counter_u64_t c)
77{
78
79 smp_rendezvous(smp_no_rendezvous_barrier, counter_u64_zero_one_cpu,

--- 14 unchanged lines hidden ---