aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@linux-m68k.org>2016-07-21 02:28:48 -0400
committerGreg Ungerer <gerg@linux-m68k.org>2016-07-25 00:40:28 -0400
commit89e6ffd9f03936d9f6f0332426e4a3cf379b90bd (patch)
tree0a889cd15af53bece41ba4997111809fa3f4be73 /arch/m68k
parent47ef4ad2684d380dd6d596140fb79395115c3950 (diff)
m68k: fix bFLT executable running on MMU enabled systems
Even after recent changes to support running flat format executables on MMU enabled systems (by nicolas.pitre@linaro.org) they still failed to run on m68k/ColdFire MMU enabled systems. On trying to run a flat format binary the application would immediately crash with a SIGSEGV. Code to setup the D5 register with the base of the application data region was only in the non-MMU code path, so it was not being set for the MMU enabled case. Flat binaries on m68k/ColdFire use this to support GOT/PIC flat built application code. Fix this so that D5 is always setup when loading/running a bFLT executable on m68k systems. Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/include/asm/flat.h6
-rw-r--r--arch/m68k/include/asm/processor.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/arch/m68k/include/asm/flat.h b/arch/m68k/include/asm/flat.h
index f9454b89a51b..f46c2f044f8c 100644
--- a/arch/m68k/include/asm/flat.h
+++ b/arch/m68k/include/asm/flat.h
@@ -18,4 +18,10 @@ static inline int flat_set_persistent(unsigned long relval,
18 return 0; 18 return 0;
19} 19}
20 20
21#define FLAT_PLAT_INIT(regs) \
22 do { \
23 if (current->mm) \
24 (regs)->d5 = current->mm->start_data; \
25 } while (0)
26
21#endif /* __M68KNOMMU_FLAT_H__ */ 27#endif /* __M68KNOMMU_FLAT_H__ */
diff --git a/arch/m68k/include/asm/processor.h b/arch/m68k/include/asm/processor.h
index a6ce2ec8d693..46672d1f4d62 100644
--- a/arch/m68k/include/asm/processor.h
+++ b/arch/m68k/include/asm/processor.h
@@ -131,8 +131,6 @@ extern int handle_kernel_fault(struct pt_regs *regs);
131do { \ 131do { \
132 (_regs)->pc = (_pc); \ 132 (_regs)->pc = (_pc); \
133 setframeformat(_regs); \ 133 setframeformat(_regs); \
134 if (current->mm) \
135 (_regs)->d5 = current->mm->start_data; \
136 (_regs)->sr &= ~0x2000; \ 134 (_regs)->sr &= ~0x2000; \
137 wrusp(_usp); \ 135 wrusp(_usp); \
138} while(0) 136} while(0)