blob: dc236577b92f0959a76a797cc3421be99925b391 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Masahiro Yamada62d0fd52020-04-22 01:13:55 +09002#ifndef _LINUX_VERMAGIC_H
3#define _LINUX_VERMAGIC_H
4
Sam Ravnborg273b2812009-10-18 00:52:28 +02005#include <generated/utsrelease.h>
Masahiro Yamada62d0fd52020-04-22 01:13:55 +09006#include <asm/vermagic.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07007
8/* Simply sanity version stamp for modules. */
9#ifdef CONFIG_SMP
10#define MODULE_VERMAGIC_SMP "SMP "
11#else
12#define MODULE_VERMAGIC_SMP ""
13#endif
14#ifdef CONFIG_PREEMPT
15#define MODULE_VERMAGIC_PREEMPT "preempt "
Thomas Gleixner4b950bb2019-07-28 20:27:41 +020016#elif defined(CONFIG_PREEMPT_RT)
17#define MODULE_VERMAGIC_PREEMPT "preempt_rt "
Linus Torvalds1da177e2005-04-16 15:20:36 -070018#else
19#define MODULE_VERMAGIC_PREEMPT ""
20#endif
Paolo 'Blaisorblade' Giarrusso5ac90c92006-04-10 22:54:28 -070021#ifdef CONFIG_MODULE_UNLOAD
22#define MODULE_VERMAGIC_MODULE_UNLOAD "mod_unload "
23#else
24#define MODULE_VERMAGIC_MODULE_UNLOAD ""
25#endif
Rusty Russell6c2545e2008-05-09 16:23:17 +100026#ifdef CONFIG_MODVERSIONS
27#define MODULE_VERMAGIC_MODVERSIONS "modversions "
28#else
29#define MODULE_VERMAGIC_MODVERSIONS ""
30#endif
Kees Cook313dd1b62017-05-05 23:37:45 -070031#ifdef RANDSTRUCT_PLUGIN
32#include <generated/randomize_layout_hash.h>
33#define MODULE_RANDSTRUCT_PLUGIN "RANDSTRUCT_PLUGIN_" RANDSTRUCT_HASHED_SEED
34#else
35#define MODULE_RANDSTRUCT_PLUGIN
36#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
38#define VERMAGIC_STRING \
39 UTS_RELEASE " " \
40 MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \
Rusty Russell6c2545e2008-05-09 16:23:17 +100041 MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS \
Kees Cook313dd1b62017-05-05 23:37:45 -070042 MODULE_ARCH_VERMAGIC \
Greg Kroah-Hartman5132ede2018-01-24 15:28:17 +010043 MODULE_RANDSTRUCT_PLUGIN
Andi Kleen1bb49962006-09-26 10:52:37 +020044
Masahiro Yamada62d0fd52020-04-22 01:13:55 +090045#endif /* _LINUX_VERMAGIC_H */