2005-04-16 18:20:36 -04:00
|
|
|
/*
|
|
|
|
* Copyright 2003 PathScale, Inc.
|
|
|
|
* Copied from arch/x86_64
|
|
|
|
*
|
|
|
|
* Licensed under the GPL
|
|
|
|
*/
|
|
|
|
|
2005-05-20 16:59:08 -04:00
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/delay.h>
|
|
|
|
#include <asm/processor.h>
|
|
|
|
#include <asm/param.h>
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
void __delay(unsigned long loops)
|
|
|
|
{
|
|
|
|
unsigned long i;
|
|
|
|
|
2005-05-20 16:59:08 -04:00
|
|
|
for(i = 0; i < loops; i++)
|
|
|
|
cpu_relax();
|
2005-04-16 18:20:36 -04:00
|
|
|
}
|
|
|
|
|
2005-05-05 19:15:37 -04:00
|
|
|
void __udelay(unsigned long usecs)
|
|
|
|
{
|
2005-05-20 16:59:08 -04:00
|
|
|
unsigned long i, n;
|
2005-05-05 19:15:37 -04:00
|
|
|
|
|
|
|
n = (loops_per_jiffy * HZ * usecs) / MILLION;
|
2005-05-20 16:59:08 -04:00
|
|
|
for(i=0;i<n;i++)
|
|
|
|
cpu_relax();
|
2005-05-05 19:15:37 -04:00
|
|
|
}
|
|
|
|
|
2005-05-20 16:59:08 -04:00
|
|
|
EXPORT_SYMBOL(__udelay);
|
|
|
|
|
2005-05-05 19:15:37 -04:00
|
|
|
void __const_udelay(unsigned long usecs)
|
|
|
|
{
|
2005-05-20 16:59:08 -04:00
|
|
|
unsigned long i, n;
|
2005-05-05 19:15:37 -04:00
|
|
|
|
|
|
|
n = (loops_per_jiffy * HZ * usecs) / MILLION;
|
2005-05-20 16:59:08 -04:00
|
|
|
for(i=0;i<n;i++)
|
|
|
|
cpu_relax();
|
2005-05-05 19:15:37 -04:00
|
|
|
}
|
|
|
|
|
2005-05-20 16:59:08 -04:00
|
|
|
EXPORT_SYMBOL(__const_udelay);
|