![]() |
|
|||
0001 /* SPDX-License-Identifier: GPL-2.0-only */ 0002 /* 0003 * vvar.h: Shared vDSO/kernel variable declarations 0004 * Copyright (c) 2011 Andy Lutomirski 0005 * 0006 * A handful of variables are accessible (read-only) from userspace 0007 * code in the vsyscall page and the vdso. They are declared here. 0008 * Some other file must define them with DEFINE_VVAR. 0009 * 0010 * In normal kernel code, they are used like any other variable. 0011 * In user code, they are accessed through the VVAR macro. 0012 * 0013 * These variables live in a page of kernel data that has an extra RO 0014 * mapping for userspace. Each variable needs a unique offset within 0015 * that page; specify that offset with the DECLARE_VVAR macro. (If 0016 * you mess up, the linker will catch it.) 0017 */ 0018 0019 #ifndef _ASM_X86_VVAR_H 0020 #define _ASM_X86_VVAR_H 0021 0022 #ifdef EMIT_VVAR 0023 /* 0024 * EMIT_VVAR() is used by the kernel linker script to put vvars in the 0025 * right place. Also, it's used by kernel code to import offsets values. 0026 */ 0027 #define DECLARE_VVAR(offset, type, name) \ 0028 EMIT_VVAR(name, offset) 0029 0030 #else 0031 0032 extern char __vvar_page; 0033 0034 #define DECLARE_VVAR(offset, type, name) \ 0035 extern type vvar_ ## name[CS_BASES] \ 0036 __attribute__((visibility("hidden"))); \ 0037 extern type timens_ ## name[CS_BASES] \ 0038 __attribute__((visibility("hidden"))); \ 0039 0040 #define VVAR(name) (vvar_ ## name) 0041 #define TIMENS(name) (timens_ ## name) 0042 0043 #define DEFINE_VVAR(type, name) \ 0044 type name[CS_BASES] \ 0045 __attribute__((section(".vvar_" #name), aligned(16))) __visible 0046 0047 #endif 0048 0049 /* DECLARE_VVAR(offset, type, name) */ 0050 0051 DECLARE_VVAR(128, struct vdso_data, _vdso_data) 0052 0053 #undef DECLARE_VVAR 0054 0055 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.1.0 LXR engine. The LXR team |
![]() ![]() |