counter.h (554491ffbdcfe51993d5b436a9bbca7aba388dd3) counter.h (ab3059a8e7f382cff93dbe4d1b082adf62f4d849)
1/*-
2 * Copyright (c) 2012 Konstantin Belousov <kib@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

41#define counter_enter() critical_enter()
42#define counter_exit() critical_exit()
43
44#ifdef IN_SUBR_COUNTER_C
45static inline uint64_t
46counter_u64_read_one(uint64_t *p, int cpu)
47{
48
1/*-
2 * Copyright (c) 2012 Konstantin Belousov <kib@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

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

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

62 return (r);
63}
64
65/* XXXKIB might interrupt increment */
66static void
67counter_u64_zero_one_cpu(void *arg)
68{
69
50}
51
52static inline uint64_t
53counter_u64_fetch_inline(uint64_t *p)
54{
55 uint64_t r;
56 int i;
57

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

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

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

--- 19 unchanged lines hidden ---