Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Masahiro Yamada | 62d0fd5 | 2020-04-22 01:13:55 +0900 | [diff] [blame] | 2 | #ifndef _LINUX_VERMAGIC_H |
| 3 | #define _LINUX_VERMAGIC_H |
| 4 | |
Sam Ravnborg | 273b281 | 2009-10-18 00:52:28 +0200 | [diff] [blame] | 5 | #include <generated/utsrelease.h> |
Masahiro Yamada | 62d0fd5 | 2020-04-22 01:13:55 +0900 | [diff] [blame] | 6 | #include <asm/vermagic.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | |
| 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 Gleixner | 4b950bb | 2019-07-28 20:27:41 +0200 | [diff] [blame] | 16 | #elif defined(CONFIG_PREEMPT_RT) |
| 17 | #define MODULE_VERMAGIC_PREEMPT "preempt_rt " |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | #else |
| 19 | #define MODULE_VERMAGIC_PREEMPT "" |
| 20 | #endif |
Paolo 'Blaisorblade' Giarrusso | 5ac90c9 | 2006-04-10 22:54:28 -0700 | [diff] [blame] | 21 | #ifdef CONFIG_MODULE_UNLOAD |
| 22 | #define MODULE_VERMAGIC_MODULE_UNLOAD "mod_unload " |
| 23 | #else |
| 24 | #define MODULE_VERMAGIC_MODULE_UNLOAD "" |
| 25 | #endif |
Rusty Russell | 6c2545e | 2008-05-09 16:23:17 +1000 | [diff] [blame] | 26 | #ifdef CONFIG_MODVERSIONS |
| 27 | #define MODULE_VERMAGIC_MODVERSIONS "modversions " |
| 28 | #else |
| 29 | #define MODULE_VERMAGIC_MODVERSIONS "" |
| 30 | #endif |
Kees Cook | 313dd1b6 | 2017-05-05 23:37:45 -0700 | [diff] [blame] | 31 | #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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | |
| 38 | #define VERMAGIC_STRING \ |
| 39 | UTS_RELEASE " " \ |
| 40 | MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \ |
Rusty Russell | 6c2545e | 2008-05-09 16:23:17 +1000 | [diff] [blame] | 41 | MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS \ |
Kees Cook | 313dd1b6 | 2017-05-05 23:37:45 -0700 | [diff] [blame] | 42 | MODULE_ARCH_VERMAGIC \ |
Greg Kroah-Hartman | 5132ede | 2018-01-24 15:28:17 +0100 | [diff] [blame] | 43 | MODULE_RANDSTRUCT_PLUGIN |
Andi Kleen | 1bb4996 | 2006-09-26 10:52:37 +0200 | [diff] [blame] | 44 | |
Masahiro Yamada | 62d0fd5 | 2020-04-22 01:13:55 +0900 | [diff] [blame] | 45 | #endif /* _LINUX_VERMAGIC_H */ |