I'd like to differentiate thumb2 D6 and D7 modules, to prevent D6 modules from crashing D7 cameras. My proposal would be this:
Index: arm_rules.inc
===================================================================
--- arm_rules.inc (revision 5467)
+++ arm_rules.inc (working copy)
@@ -162,10 +162,18 @@
CFLAGS+=-DOPT_ARCHITECTURE=GCC_ELF_THUMB
endif
else
- ifdef OPT_USE_GCC_EABI
- CFLAGS+=-DOPT_ARCHITECTURE=GCC_EABI_THUMB2
+ ifdef DIGIC7
+ ifdef OPT_USE_GCC_EABI
+ CFLAGS+=-DOPT_ARCHITECTURE=GCC_EABI_THUMB2A
+ else
+ CFLAGS+=-DOPT_ARCHITECTURE=GCC_ELF_THUMB2A
+ endif
else
- CFLAGS+=-DOPT_ARCHITECTURE=GCC_ELF_THUMB2
+ ifdef OPT_USE_GCC_EABI
+ CFLAGS+=-DOPT_ARCHITECTURE=GCC_EABI_THUMB2
+ else
+ CFLAGS+=-DOPT_ARCHITECTURE=GCC_ELF_THUMB2
+ endif
endif
endif
Index: modules/flt.h
===================================================================
--- modules/flt.h (revision 5467)
+++ modules/flt.h (working copy)
@@ -23,8 +23,10 @@
// Architecture of build (GCC ABI, thumb/thumb2, etc)
#define GCC_ELF_THUMB 1
#define GCC_EABI_THUMB 2
-#define GCC_ELF_THUMB2 0x11 // unlikely variant
-#define GCC_EABI_THUMB2 0x12
+#define GCC_ELF_THUMB2 0x11 // Cortex R, unlikely variant
+#define GCC_EABI_THUMB2 0x12 // Cortex R
+#define GCC_ELF_THUMB2A 0x21 // Cortex A, unlikely variant
+#define GCC_EABI_THUMB2A 0x22 // Cortex A
// Base module interface - once loaded into memory and any relocations done these
// functions provide the minimum interface to run the module code.