public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic
@ 2011-02-22 13:48 Dave Martin
  2011-02-22 20:03 ` Nicolas Pitre
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Martin @ 2011-02-22 13:48 UTC (permalink / raw)
  To: linux-arm-kernel

Loading Thumb-2 modules into an ARM kernel or vice-versa isn't
guaranteed to work safely, since the kernel is not interworking-
aware everywhere.

This patch adds "thumb2" to the module vermagic when
CONFIG_THUMB2_KERNEL is enabled, to help avoid accidental loading
of modules into the wrong kernel.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
---
 arch/arm/include/asm/module.h |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
index 12c8e68..09fcaa0 100644
--- a/arch/arm/include/asm/module.h
+++ b/arch/arm/include/asm/module.h
@@ -25,8 +25,15 @@ struct mod_arch_specific {
 };
 
 /*
- * Include the ARM architecture version.
+ * Include the ARM architecture version and instruction set architecture.
  */
-#define MODULE_ARCH_VERMAGIC	"ARMv" __stringify(__LINUX_ARM_ARCH__) " "
+#ifdef CONFIG_THUMB2_KERNEL
+#define ARM_ARCH_VERMAGIC_ISAFAMILY " thumb2"
+#else
+#define ARM_ARCH_VERMAGIC_ISAFAMILY ""
+#endif
+
+#define MODULE_ARCH_VERMAGIC	"ARMv" __stringify(__LINUX_ARM_ARCH__) \
+	ARM_ARCH_VERMAGIC_ISAFAMILY " "
 
 #endif /* _ASM_ARM_MODULE_H */
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-22 20:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-22 13:48 [PATCH] ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic Dave Martin
2011-02-22 20:03 ` Nicolas Pitre
2011-02-22 20:25   ` Russell King - ARM Linux
2011-02-22 20:35     ` Nicolas Pitre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox