Commit 3dae285a authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Russell King

[ARM PATCH] 1825/1: abort on bad code generation with div64 in some cases

Patch from Nicolas Pitre

One case was found when the kernel is compiled with -O2 (instead of the 
default -Os).  However, all gcc-3.* versions seem to have a problem with 
this.  Instead of blacklisting them all unconditionally, better just abort
when a bad case occurs especially since this bad case doesn't seem to
appear with current default compiler flags.  Depends on patch #1824.
parent 74708ced
#ifndef __ASM_ARM_DIV64 #ifndef __ASM_ARM_DIV64
#define __ASM_ARM_DIV64 #define __ASM_ARM_DIV64
#include <asm/system.h>
/* /*
* The semantics of do_div() are: * The semantics of do_div() are:
* *
...@@ -31,7 +33,11 @@ ...@@ -31,7 +33,11 @@
register unsigned long long __n asm("r0") = n; \ register unsigned long long __n asm("r0") = n; \
register unsigned long long __res asm("r2"); \ register unsigned long long __res asm("r2"); \
register unsigned int __rem asm(__xh); \ register unsigned int __rem asm(__xh); \
asm("bl __do_div64" \ asm( __asmeq("%0", __xh) \
__asmeq("%1", "r2") \
__asmeq("%2", "r0") \
__asmeq("%3", "r4") \
"bl __do_div64" \
: "=r" (__rem), "=r" (__res) \ : "=r" (__rem), "=r" (__res) \
: "r" (__n), "r" (__base) \ : "r" (__n), "r" (__base) \
: "ip", "lr", "cc"); \ : "ip", "lr", "cc"); \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment