Move to kernel style SPDX license identifiers
[lttng-ust.git] / libringbuffer / smp.h
CommitLineData
a6352fd4 1/*
c0c0989a 2 * SPDX-License-Identifier: LGPL-2.1-only
a6352fd4 3 *
e92f3e28 4 * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
a6352fd4
MD
5 */
6
c0c0989a
MJ
7#ifndef _LIBRINGBUFFER_SMP_H
8#define _LIBRINGBUFFER_SMP_H
9
2b2d6ff7 10#include "getcpu.h"
a6352fd4
MD
11
12/*
13 * 4kB of per-cpu data available. Enough to hold the control structures,
14 * but not ring buffers.
15 */
16#define PER_CPU_MEM_SIZE 4096
17
18extern int __num_possible_cpus;
19extern void _get_num_possible_cpus(void);
20
21static inline
22int num_possible_cpus(void)
23{
24 if (!__num_possible_cpus)
25 _get_num_possible_cpus();
26 return __num_possible_cpus;
27}
28
a6352fd4
MD
29#define for_each_possible_cpu(cpu) \
30 for ((cpu) = 0; (cpu) < num_possible_cpus(); (cpu)++)
31
32#endif /* _LIBRINGBUFFER_SMP_H */
This page took 0.029767 seconds and 4 git commands to generate.