blob: 89ad0596033abab691d76ca426f81b4136932f86 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef _ASM_ARM_MODULE_H
3#define _ASM_ARM_MODULE_H
4
David Howells786d35d2012-09-28 14:31:03 +09305#include <asm-generic/module.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
Catalin Marinas2e1926e2009-02-11 13:09:54 +01007struct unwind_table;
8
Catalin Marinas2e1926e2009-02-11 13:09:54 +01009#ifdef CONFIG_ARM_UNWIND
Phil Carmodye5f77722010-08-19 15:16:37 +010010enum {
11 ARM_SEC_INIT,
12 ARM_SEC_DEVINIT,
13 ARM_SEC_CORE,
Phil Carmody09e56a22010-08-19 15:19:04 +010014 ARM_SEC_EXIT,
15 ARM_SEC_DEVEXIT,
Douglas Anderson849b8822013-08-29 00:08:01 +010016 ARM_SEC_HOT,
17 ARM_SEC_UNLIKELY,
Phil Carmodye5f77722010-08-19 15:16:37 +010018 ARM_SEC_MAX,
19};
Ard Biesheuvel7d485f62014-11-24 16:54:35 +010020#endif
Catalin Marinas2e1926e2009-02-11 13:09:54 +010021
Ard Biesheuvelb7ede5a12017-02-22 19:40:12 +010022struct mod_plt_sec {
23 struct elf32_shdr *plt;
24 int plt_count;
25};
26
Russell King89313602010-11-12 13:02:46 +000027struct mod_arch_specific {
Ard Biesheuvel7d485f62014-11-24 16:54:35 +010028#ifdef CONFIG_ARM_UNWIND
Russell King89313602010-11-12 13:02:46 +000029 struct unwind_table *unwind[ARM_SEC_MAX];
David Howells786d35d2012-09-28 14:31:03 +093030#endif
Ard Biesheuvel7d485f62014-11-24 16:54:35 +010031#ifdef CONFIG_ARM_MODULE_PLTS
Ard Biesheuvelb7ede5a12017-02-22 19:40:12 +010032 struct mod_plt_sec core;
33 struct mod_plt_sec init;
Ard Biesheuvel7d485f62014-11-24 16:54:35 +010034#endif
35};
36
37u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val);
Russell King89313602010-11-12 13:02:46 +000038
Linus Torvalds1da177e2005-04-16 15:20:36 -070039/*
Russell Kingdc21af92011-01-04 19:09:43 +000040 * Add the ARM architecture version to the version magic string
Linus Torvalds1da177e2005-04-16 15:20:36 -070041 */
Russell Kingdc21af92011-01-04 19:09:43 +000042#define MODULE_ARCH_VERMAGIC_ARMVSN "ARMv" __stringify(__LINUX_ARM_ARCH__) " "
43
44/* Add __virt_to_phys patching state as well */
45#ifdef CONFIG_ARM_PATCH_PHYS_VIRT
46#define MODULE_ARCH_VERMAGIC_P2V "p2v8 "
47#else
48#define MODULE_ARCH_VERMAGIC_P2V ""
49#endif
50
Dave Martin80f0aad2011-02-25 17:54:52 +010051/* Add instruction set architecture tag to distinguish ARM/Thumb kernels */
52#ifdef CONFIG_THUMB2_KERNEL
53#define MODULE_ARCH_VERMAGIC_ARMTHUMB "thumb2 "
54#else
55#define MODULE_ARCH_VERMAGIC_ARMTHUMB ""
56#endif
57
Russell Kingdc21af92011-01-04 19:09:43 +000058#define MODULE_ARCH_VERMAGIC \
59 MODULE_ARCH_VERMAGIC_ARMVSN \
Dave Martin80f0aad2011-02-25 17:54:52 +010060 MODULE_ARCH_VERMAGIC_ARMTHUMB \
Russell Kingdc21af92011-01-04 19:09:43 +000061 MODULE_ARCH_VERMAGIC_P2V
Linus Torvalds1da177e2005-04-16 15:20:36 -070062
63#endif /* _ASM_ARM_MODULE_H */