diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-07-10 09:24:14 (GMT) |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-07-10 09:24:47 (GMT) |
commit | 8a88367088a6b9964d99694b30d80720f019bea2 (patch) | |
tree | 6fe082e731cdf56983934e11ebfcfc1d10664e5b /include/asm-s390/sfp-util.h | |
parent | 285f67227b63309d699f5bda25ba34962503398f (diff) | |
download | linux-fsl-qoriq-8a88367088a6b9964d99694b30d80720f019bea2.tar.xz |
[S390] Bogomips calculation for 64 bit.
The bogomips calculation triggered via reading from /proc/cpuinfo
can return incorrect values if the qrnnd assembly is called with a
pointer in %r2 with any of the upper 32 bits set.
Fix this by using 64 bit division / remainder operation provided by
gcc instead of calling the assembly.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'include/asm-s390/sfp-util.h')
-rw-r--r-- | include/asm-s390/sfp-util.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/asm-s390/sfp-util.h b/include/asm-s390/sfp-util.h index 8cabcd2..0addc64 100644 --- a/include/asm-s390/sfp-util.h +++ b/include/asm-s390/sfp-util.h @@ -51,6 +51,16 @@ wl = __wl; \ }) +#ifdef __s390x__ +#define udiv_qrnnd(q, r, n1, n0, d) \ + do { unsigned long __n; \ + unsigned int __r, __d; \ + __n = ((unsigned long)(n1) << 32) + n0; \ + __d = (d); \ + (q) = __n / __d; \ + (r) = __n % __d; \ + } while (0) +#else #define udiv_qrnnd(q, r, n1, n0, d) \ do { unsigned int __r; \ (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \ @@ -58,6 +68,7 @@ } while (0) extern unsigned long __udiv_qrnnd (unsigned int *, unsigned int, unsigned int , unsigned int); +#endif #define UDIV_NEEDS_NORMALIZATION 0 |