1 /* SPDX-License-Identifier: MIT */
2 /* SPDX-FileCopyrightText: 2024 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> */
4 #ifndef _RSEQ_PERCPU_ALLOC_H
5 #define _RSEQ_PERCPU_ALLOC_H
20 * Tag pointers returned by:
21 * - rseq_percpu_malloc(),
22 * - rseq_percpu_zmalloc(),
23 * - rseq_percpu_pool_set_malloc(),
24 * - rseq_percpu_pool_set_zmalloc().
26 * with __rseq_percpu for use by static analyzers.
30 struct rseq_percpu_pool
;
32 struct rseq_percpu_pool
*rseq_percpu_pool_create(size_t item_len
,
33 size_t percpu_len
, int max_nr_cpus
,
34 int mmap_prot
, int mmap_flags
, int mmap_fd
, off_t mmap_offset
,
36 int rseq_percpu_pool_destroy(struct rseq_percpu_pool
*pool
);
38 void __rseq_percpu
*rseq_percpu_malloc(struct rseq_percpu_pool
*pool
);
39 void __rseq_percpu
*rseq_percpu_zmalloc(struct rseq_percpu_pool
*pool
);
40 void rseq_percpu_free(void __rseq_percpu
*ptr
);
42 void *__rseq_percpu_ptr(void __rseq_percpu
*ptr
, int cpu
);
44 #define rseq_percpu_ptr(ptr, cpu) ((__typeof__(ptr)) __rseq_percpu_ptr(ptr, cpu))
46 struct rseq_percpu_pool_set
*rseq_percpu_pool_set_create(void);
47 int rseq_percpu_pool_set_destroy(struct rseq_percpu_pool_set
*pool_set
);
48 int rseq_percpu_pool_set_add_pool(struct rseq_percpu_pool_set
*pool_set
,
49 struct rseq_percpu_pool
*pool
);
51 void __rseq_percpu
*rseq_percpu_pool_set_malloc(struct rseq_percpu_pool_set
*pool_set
, size_t len
);
52 void __rseq_percpu
*rseq_percpu_pool_set_zmalloc(struct rseq_percpu_pool_set
*pool_set
, size_t len
);
58 #endif /* _RSEQ_PERCPU_ALLOC_H */
This page took 0.031 seconds and 5 git commands to generate.