aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips/delay.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-mips/delay.h')
-rw-r--r--include/asm-mips/delay.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/asm-mips/delay.h b/include/asm-mips/delay.h
index fab32131e9b4..de5105d05f1e 100644
--- a/include/asm-mips/delay.h
+++ b/include/asm-mips/delay.h
@@ -6,13 +6,16 @@
6 * Copyright (C) 1994 by Waldorf Electronics 6 * Copyright (C) 1994 by Waldorf Electronics
7 * Copyright (C) 1995 - 2000, 01, 03 by Ralf Baechle 7 * Copyright (C) 1995 - 2000, 01, 03 by Ralf Baechle
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc. 8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 * Copyright (C) 2007 Maciej W. Rozycki
9 */ 10 */
10#ifndef _ASM_DELAY_H 11#ifndef _ASM_DELAY_H
11#define _ASM_DELAY_H 12#define _ASM_DELAY_H
12 13
13#include <linux/param.h> 14#include <linux/param.h>
14#include <linux/smp.h> 15#include <linux/smp.h>
16
15#include <asm/compiler.h> 17#include <asm/compiler.h>
18#include <asm/war.h>
16 19
17static inline void __delay(unsigned long loops) 20static inline void __delay(unsigned long loops)
18{ 21{
@@ -50,7 +53,7 @@ static inline void __delay(unsigned long loops)
50 53
51static inline void __udelay(unsigned long usecs, unsigned long lpj) 54static inline void __udelay(unsigned long usecs, unsigned long lpj)
52{ 55{
53 unsigned long lo; 56 unsigned long hi, lo;
54 57
55 /* 58 /*
56 * The rates of 128 is rounded wrongly by the catchall case 59 * The rates of 128 is rounded wrongly by the catchall case
@@ -70,11 +73,16 @@ static inline void __udelay(unsigned long usecs, unsigned long lpj)
70 : "=h" (usecs), "=l" (lo) 73 : "=h" (usecs), "=l" (lo)
71 : "r" (usecs), "r" (lpj) 74 : "r" (usecs), "r" (lpj)
72 : GCC_REG_ACCUM); 75 : GCC_REG_ACCUM);
73 else if (sizeof(long) == 8) 76 else if (sizeof(long) == 8 && !R4000_WAR)
74 __asm__("dmultu\t%2, %3" 77 __asm__("dmultu\t%2, %3"
75 : "=h" (usecs), "=l" (lo) 78 : "=h" (usecs), "=l" (lo)
76 : "r" (usecs), "r" (lpj) 79 : "r" (usecs), "r" (lpj)
77 : GCC_REG_ACCUM); 80 : GCC_REG_ACCUM);
81 else if (sizeof(long) == 8 && R4000_WAR)
82 __asm__("dmultu\t%3, %4\n\tmfhi\t%0"
83 : "=r" (usecs), "=h" (hi), "=l" (lo)
84 : "r" (usecs), "r" (lpj)
85 : GCC_REG_ACCUM);
78 86
79 __delay(usecs); 87 __delay(usecs);
80} 88}