hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/arch/x86/include/asm/vvar.h
....@@ -1,7 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * vvar.h: Shared vDSO/kernel variable declarations
34 * Copyright (c) 2011 Andy Lutomirski
4
- * Subject to the GNU General Public License, version 2
55 *
66 * A handful of variables are accessible (read-only) from userspace
77 * code in the vsyscall page and the vdso. They are declared here.
....@@ -19,10 +19,10 @@
1919 #ifndef _ASM_X86_VVAR_H
2020 #define _ASM_X86_VVAR_H
2121
22
-#if defined(__VVAR_KERNEL_LDS)
23
-
24
-/* The kernel linker script defines its own magic to put vvars in the
25
- * right place.
22
+#ifdef EMIT_VVAR
23
+/*
24
+ * EMIT_VVAR() is used by the kernel linker script to put vvars in the
25
+ * right place. Also, it's used by kernel code to import offsets values.
2626 */
2727 #define DECLARE_VVAR(offset, type, name) \
2828 EMIT_VVAR(name, offset)
....@@ -33,9 +33,12 @@
3333
3434 #define DECLARE_VVAR(offset, type, name) \
3535 extern type vvar_ ## name[CS_BASES] \
36
- __attribute__((visibility("hidden")));
36
+ __attribute__((visibility("hidden"))); \
37
+ extern type timens_ ## name[CS_BASES] \
38
+ __attribute__((visibility("hidden"))); \
3739
3840 #define VVAR(name) (vvar_ ## name)
41
+#define TIMENS(name) (timens_ ## name)
3942
4043 #define DEFINE_VVAR(type, name) \
4144 type name[CS_BASES] \