Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/include/counter.h
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | counter_u64_zero_one_cpu(void *arg) | ||||
*((uint64_t *)((char *)arg + sizeof(struct pcpu) * | *((uint64_t *)((char *)arg + sizeof(struct pcpu) * | ||||
PCPU_GET(cpuid))) = 0; | PCPU_GET(cpuid))) = 0; | ||||
} | } | ||||
static inline void | static inline void | ||||
counter_u64_zero_inline(counter_u64_t c) | counter_u64_zero_inline(counter_u64_t c) | ||||
{ | { | ||||
smp_rendezvous(smp_no_rendevous_barrier, counter_u64_zero_one_cpu, | smp_rendezvous(smp_no_rendezvous_barrier, counter_u64_zero_one_cpu, | ||||
smp_no_rendevous_barrier, c); | smp_no_rendezvous_barrier, c); | ||||
} | } | ||||
#endif | #endif | ||||
#define counter_u64_add_protected(c, inc) counter_u64_add(c, inc) | #define counter_u64_add_protected(c, inc) counter_u64_add(c, inc) | ||||
static inline void | static inline void | ||||
counter_u64_add(counter_u64_t c, int64_t inc) | counter_u64_add(counter_u64_t c, int64_t inc) | ||||
{ | { | ||||
atomic_add_64((uint64_t *)zpcpu_get(c), inc); | atomic_add_64((uint64_t *)zpcpu_get(c), inc); | ||||
} | } | ||||
#endif /* ! _MACHINE_COUNTER_H_ */ | #endif /* ! _MACHINE_COUNTER_H_ */ |