1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
5 #ifndef _RTE_PER_LCORE_H_
6 #define _RTE_PER_LCORE_H_
11 * Per-lcore variables in RTE
13 * This file defines an API for instantiating per-lcore "global
14 * variables" that are environment-specific. Note that in all
15 * environments, a "shared variable" is the default when you use a
18 * Parts of this are execution environment specific.
28 * Macro to define a per lcore variable "var" of type "type", don't
29 * use keywords like "static" or "volatile" in type, just prefix the
32 #define RTE_DEFINE_PER_LCORE(type, name) \
33 __thread __typeof__(type) per_lcore_##name
36 * Macro to declare an extern per lcore variable "var" of type "type"
38 #define RTE_DECLARE_PER_LCORE(type, name) \
39 extern __thread __typeof__(type) per_lcore_##name
42 * Read/write the per-lcore variable value
44 #define RTE_PER_LCORE(name) (per_lcore_##name)
50 #endif /* _RTE_PER_LCORE_H_ */