Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Matthew Wilcox | 7ad3d4d | 2016-12-16 11:55:56 -0500 | [diff] [blame] | 2 | #define DECLARE_PER_CPU(type, val) extern type val |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 3 | #define DEFINE_PER_CPU(type, val) type val |
| 4 | |
| 5 | #define __get_cpu_var(var) var |
| 6 | #define this_cpu_ptr(var) var |
Matthew Wilcox | 7ad3d4d | 2016-12-16 11:55:56 -0500 | [diff] [blame] | 7 | #define this_cpu_read(var) var |
| 8 | #define this_cpu_xchg(var, val) uatomic_xchg(&var, val) |
| 9 | #define this_cpu_cmpxchg(var, old, new) uatomic_cmpxchg(&var, old, new) |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 10 | #define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) |
| 11 | #define per_cpu(var, cpu) (*per_cpu_ptr(&(var), cpu)) |