aboutsummaryrefslogtreecommitdiffstats
path: root/udelay.c
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-06-20 10:09:56 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-06-20 10:09:56 +0000
commit7ac3e2a7d2c23ea71adeb56d8afbe1b1cbeee4df (patch)
treec9fe5fa4426d7334d8486a3a7e59c64a43d2ef9e /udelay.c
parente4626159694ea6774386faa2f0d2fb517de1eb8b (diff)
downloadlcd4linux-7ac3e2a7d2c23ea71adeb56d8afbe1b1cbeee4df.tar.gz
[lcd4linux @ 2004-06-20 10:09:52 by reinelt]
'const'ified the whole source git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@476 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'udelay.c')
-rw-r--r--udelay.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/udelay.c b/udelay.c
index f332bb0..bfbdf00 100644
--- a/udelay.c
+++ b/udelay.c
@@ -1,4 +1,4 @@
-/* $Id: udelay.c,v 1.16 2004/04/12 05:14:42 reinelt Exp $
+/* $Id: udelay.c,v 1.17 2004/06/20 10:09:56 reinelt Exp $
*
* short delays
*
@@ -22,6 +22,10 @@
*
*
* $Log: udelay.c,v $
+ * Revision 1.17 2004/06/20 10:09:56 reinelt
+ *
+ * 'const'ified the whole source
+ *
* Revision 1.16 2004/04/12 05:14:42 reinelt
* another BIG FAT WARNING on the use of raw ports instead of ppdev
*
@@ -146,7 +150,7 @@
unsigned long loops_per_usec;
-void ndelay (unsigned long nsec)
+void ndelay (const unsigned long nsec)
{
unsigned long loop=(nsec*loops_per_usec+999)/1000;
@@ -265,7 +269,7 @@ void udelay_init (void)
}
-void ndelay (unsigned long nsec)
+void ndelay (const unsigned long nsec)
{
#ifdef HAVE_ASM_MSR_H
@@ -273,14 +277,15 @@ void ndelay (unsigned long nsec)
if (ticks_per_usec) {
unsigned int t1, t2;
-
- nsec=(nsec*ticks_per_usec+999)/1000;
+ unsigned long tsc;
+
+ tsc=(nsec*ticks_per_usec+999)/1000;
rdtscl(t1);
do {
rep_nop();
rdtscl(t2);
- } while ((t2-t1)<nsec);
+ } while ((t2-t1)<tsc);
} else