OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [before_ORP/] [uclinux/] [uClinux-2.0.x/] [include/] [asm-i960/] [delay.h] - Blame information for rev 199

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
#ifndef _I960_DELAY_H
2
#define _I960_DELAY_H
3
 
4
extern unsigned long loops_per_sec;
5
#include <linux/kernel.h>
6
#include <linux/config.h>
7
 
8
/*
9
 * Copyright (C) 1995 Erik Walthinsen (omega@cse.ogi.edu)
10
 *
11
 * Delay routines, using a pre-computed "loops_per_second" value.
12
 */
13
 
14
extern __inline__ void __delay(unsigned long loops)
15
{
16
        while (loops--);
17
}
18
 
19
/*
20
 * Use only for very small delays ( < 1 msec).  Should probably use a
21
 * lookup table, really, as the multiplications take much too long with
22
 * short delays.  This is a "reasonable" implementation, though (and the
23
 * first constant multiplications gets optimized away if the delay is
24
 * a constant)
25
 */
26
extern __inline__ void udelay(unsigned long usecs)
27
{
28
        usecs *= loops_per_sec;
29
        usecs /= 1000000;
30
        __delay(usecs);
31
}
32
 
33
#define muldiv(a, b, c)    (((a)*(b))/(c))
34
 
35
#endif /* defined(_I960_DELAY_H) */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.