blob: ed2319663a1ecc6f04e860bac4069bf0370da5fb [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _ASM_ARM_MODULE_H
2#define _ASM_ARM_MODULE_H
3
David Howells786d35d2012-09-28 14:31:03 +09304#include <asm-generic/module.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005
Catalin Marinas2e1926e2009-02-11 13:09:54 +01006struct unwind_table;
7
Catalin Marinas2e1926e2009-02-11 13:09:54 +01008#ifdef CONFIG_ARM_UNWIND
Phil Carmodye5f77722010-08-19 15:16:37 +01009enum {
10 ARM_SEC_INIT,
11 ARM_SEC_DEVINIT,
12 ARM_SEC_CORE,
Phil Carmody09e56a22010-08-19 15:19:04 +010013 ARM_SEC_EXIT,
14 ARM_SEC_DEVEXIT,
Douglas Anderson849b8822013-08-29 00:08:01 +010015 ARM_SEC_HOT,
16 ARM_SEC_UNLIKELY,
Phil Carmodye5f77722010-08-19 15:16:37 +010017 ARM_SEC_MAX,
18};
Ard Biesheuvel7d485f62014-11-24 16:54:35 +010019#endif
Catalin Marinas2e1926e2009-02-11 13:09:54 +010020
Ard Biesheuvelb7ede5a12017-02-22 19:40:12 +010021struct mod_plt_sec {
22 struct elf32_shdr *plt;
23 int plt_count;
24};
25
Russell King89313602010-11-12 13:02:46 +000026struct mod_arch_specific {
Ard Biesheuvel7d485f62014-11-24 16:54:35 +010027#ifdef CONFIG_ARM_UNWIND
Russell King89313602010-11-12 13:02:46 +000028 struct unwind_table *unwind[ARM_SEC_MAX];
David Howells786d35d2012-09-28 14:31:03 +093029#endif
Ard Biesheuvel7d485f62014-11-24 16:54:35 +010030#ifdef CONFIG_ARM_MODULE_PLTS
Ard Biesheuvelb7ede5a12017-02-22 19:40:12 +010031 struct mod_plt_sec core;
32 struct mod_plt_sec init;
Ard Biesheuvel7d485f62014-11-24 16:54:35 +010033#endif
34};
35
36u32 get_module_plt(struct module *mod, unsigned long loc, Elf32_Addr val);
Russell King89313602010-11-12 13:02:46 +000037
Linus Torvalds1da177e2005-04-16 15:20:36 -070038/*
Russell Kingdc21af92011-01-04 19:09:43 +000039 * Add the ARM architecture version to the version magic string
Linus Torvalds1da177e2005-04-16 15:20:36 -070040 */
Russell Kingdc21af92011-01-04 19:09:43 +000041#define MODULE_ARCH_VERMAGIC_ARMVSN "ARMv" __stringify(__LINUX_ARM_ARCH__) " "
42
43/* Add __virt_to_phys patching state as well */
44#ifdef CONFIG_ARM_PATCH_PHYS_VIRT
45#define MODULE_ARCH_VERMAGIC_P2V "p2v8 "
46#else
47#define MODULE_ARCH_VERMAGIC_P2V ""
48#endif
49
Dave Martin80f0aad2011-02-25 17:54:52 +010050/* Add instruction set architecture tag to distinguish ARM/Thumb kernels */
51#ifdef CONFIG_THUMB2_KERNEL
52#define MODULE_ARCH_VERMAGIC_ARMTHUMB "thumb2 "
53#else
54#define MODULE_ARCH_VERMAGIC_ARMTHUMB ""
55#endif
56
Russell Kingdc21af92011-01-04 19:09:43 +000057#define MODULE_ARCH_VERMAGIC \
58 MODULE_ARCH_VERMAGIC_ARMVSN \
Dave Martin80f0aad2011-02-25 17:54:52 +010059 MODULE_ARCH_VERMAGIC_ARMTHUMB \
Russell Kingdc21af92011-01-04 19:09:43 +000060 MODULE_ARCH_VERMAGIC_P2V
Linus Torvalds1da177e2005-04-16 15:20:36 -070061
62#endif /* _ASM_ARM_MODULE_H */