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