Lines Matching refs:cm
39 struct cpumem *cm; in cpumem_get() local
42 cm = pool_get(&cpumem_pl, PR_WAITOK); in cpumem_get()
45 cm[cpu].mem = pool_get(pp, PR_WAITOK | PR_ZERO); in cpumem_get()
47 return (cm); in cpumem_get()
51 cpumem_put(struct pool *pp, struct cpumem *cm) in cpumem_put() argument
56 pool_put(pp, cm[cpu].mem); in cpumem_put()
58 pool_put(&cpumem_pl, cm); in cpumem_put()
64 struct cpumem *cm; in cpumem_malloc() local
69 cm = pool_get(&cpumem_pl, PR_WAITOK); in cpumem_malloc()
72 cm[cpu].mem = malloc(sz, type, M_WAITOK | M_ZERO); in cpumem_malloc()
74 return (cm); in cpumem_malloc()
80 struct cpumem *cm; in cpumem_malloc_ncpus() local
85 cm = pool_get(&cpumem_pl, PR_WAITOK); in cpumem_malloc_ncpus()
87 cm[0].mem = bootcm[0].mem; in cpumem_malloc_ncpus()
89 cm[cpu].mem = malloc(sz, type, M_WAITOK | M_ZERO); in cpumem_malloc_ncpus()
91 return (cm); in cpumem_malloc_ncpus()
95 cpumem_free(struct cpumem *cm, int type, size_t sz) in cpumem_free() argument
102 free(cm[cpu].mem, type, sz); in cpumem_free()
104 pool_put(&cpumem_pl, cm); in cpumem_free()
108 cpumem_first(struct cpumem_iter *i, struct cpumem *cm) in cpumem_first() argument
112 return (cm[0].mem); in cpumem_first()
116 cpumem_next(struct cpumem_iter *i, struct cpumem *cm) in cpumem_next() argument
123 return (cm[cpu].mem); in cpumem_next()
129 struct cpumem *cm; in counters_alloc() local
137 cm = cpumem_malloc(n * sizeof(uint64_t), M_COUNTERS); in counters_alloc()
139 CPUMEM_FOREACH(counters, &cmi, cm) { in counters_alloc()
144 return (cm); in counters_alloc()
148 counters_alloc_ncpus(struct cpumem *cm, unsigned int n) in counters_alloc_ncpus() argument
151 return (cpumem_malloc_ncpus(cm, n * sizeof(uint64_t), M_COUNTERS)); in counters_alloc_ncpus()
155 counters_free(struct cpumem *cm, unsigned int n) in counters_free() argument
158 cpumem_free(cm, M_COUNTERS, n * sizeof(uint64_t)); in counters_free()
162 counters_read(struct cpumem *cm, uint64_t *output, unsigned int n, in counters_read() argument
176 gen = cpumem_first(&cmi, cm); in counters_read()
204 gen = cpumem_next(&cmi, cm); in counters_read()
212 counters_zero(struct cpumem *cm, unsigned int n) in counters_zero() argument
218 counters = cpumem_first(&cmi, cm); in counters_zero()
227 counters = cpumem_next(&cmi, cm); in counters_zero()
254 cpumem_put(struct pool *pp, struct cpumem *cm) in cpumem_put() argument
256 pool_put(pp, cm); in cpumem_put()
266 cpumem_malloc_ncpus(struct cpumem *cm, size_t sz, int type) in cpumem_malloc_ncpus() argument
268 return (cm); in cpumem_malloc_ncpus()
272 cpumem_free(struct cpumem *cm, int type, size_t sz) in cpumem_free() argument
274 free(cm, type, sz); in cpumem_free()
278 cpumem_first(struct cpumem_iter *i, struct cpumem *cm) in cpumem_first() argument
280 return (cm); in cpumem_first()
284 cpumem_next(struct cpumem_iter *i, struct cpumem *cm) in cpumem_next() argument
298 counters_alloc_ncpus(struct cpumem *cm, unsigned int n) in counters_alloc_ncpus() argument
301 return (cpumem_malloc_ncpus(cm, n * sizeof(uint64_t), M_COUNTERS)); in counters_alloc_ncpus()
305 counters_free(struct cpumem *cm, unsigned int n) in counters_free() argument
307 cpumem_free(cm, M_COUNTERS, n * sizeof(uint64_t)); in counters_free()
311 counters_read(struct cpumem *cm, uint64_t *output, unsigned int n, in counters_read() argument
318 counters = (uint64_t *)cm; in counters_read()
327 counters_zero(struct cpumem *cm, unsigned int n) in counters_zero() argument
333 counters = (uint64_t *)cm; in counters_zero()