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