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