diff options
author | Michael Gernoth <michael@gernoth.net> | 2015-12-07 02:06:07 +0100 |
---|---|---|
committer | Ziyan <jaraidaniel@gmail.com> | 2016-03-11 01:03:49 +0100 |
commit | f48f1a449b32745b3b1febc45c59ed787aedc965 (patch) | |
tree | 1e033aa49934a4dc3b222b0134278703da121583 /arch | |
parent | 50fa2146236aed4fd88b2f1d84526e3496dac536 (diff) | |
download | kernel_samsung_tuna-f48f1a449b32745b3b1febc45c59ed787aedc965.zip kernel_samsung_tuna-f48f1a449b32745b3b1febc45c59ed787aedc965.tar.gz kernel_samsung_tuna-f48f1a449b32745b3b1febc45c59ed787aedc965.tar.bz2 |
arm/traps: get full DIV instruction in thumb mode
Change-Id: Ie60d2124d7835e85f03008d3dfe259b70490b4f2
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/kernel/traps.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 56b2715..599ea93 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -365,6 +365,19 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs) if (call_undef_hook(regs, instr) == 0) return; + /* STARGO: hack for DIV emulation */ + if ((processor_mode(regs) != SVC_MODE) && thumb_mode(regs)) { + if ((instr & 0x0310) == 0x0310) { /* Retry for division */ + unsigned int instr2; + get_user(instr2, (u16 __user *)pc + 1); + instr <<= 16; + instr |= instr2; + if (call_undef_hook(regs, instr) == 0) + return; + } + } + /* END: STARGO: hack for DIV emulation */ + #ifdef CONFIG_DEBUG_USER if (user_debug & UDBG_UNDEFINED) { printk(KERN_INFO "%s (%d): undefined instruction: pc=%p\n", |