blob: b2403aa743b21cc2f6a6b7a29ff734293892e933 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Matthew Wilcox7ad3d4d2016-12-16 11:55:56 -05002#define DECLARE_PER_CPU(type, val) extern type val
Matthew Wilcox1366c372016-03-17 14:21:45 -07003#define DEFINE_PER_CPU(type, val) type val
4
5#define __get_cpu_var(var) var
6#define this_cpu_ptr(var) var
Matthew Wilcox7ad3d4d2016-12-16 11:55:56 -05007#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 Wilcox1366c372016-03-17 14:21:45 -070010#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); })
11#define per_cpu(var, cpu) (*per_cpu_ptr(&(var), cpu))