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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [include/] [asm/] [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 _OR1K_DELAY_H
2
#define _OR1K_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) 1994 Hamish Macdonald
10
 *
11
 * Delay routines, using a pre-computed "loops_per_second" value.
12
 */
13
 
14
 
15
extern __inline__ void __delay(unsigned long loops)
16
{
17
        __asm__ __volatile__ ("1: l.sfeqi %0,0; \
18
                                l.bnf   1b; \
19
                                l.addi %0,%0,-1;"
20
                                : "=r" (loops) : "0" (loops));
21
}
22
 
23
extern __inline__ void udelay(unsigned long usecs)
24
{
25
        /* Sigh */
26
        __delay(usecs);
27
}
28
 
29
#define muldiv(a, b, c)    (((a)*(b))/(c))
30
 
31
/*
32
extern __inline__ unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
33
{
34
        unsigned long tmp;
35
 
36
        __asm__ ("mulul %2,%0:%1; divul %3,%0:%1"
37
                : "=d" (tmp), "=d" (a)
38
                : "d" (b), "d" (c), "1" (a));
39
        return a;
40
}
41
*/
42
 
43
#endif /* defined(_OR1K_DELAY_H) */

powered by: WebSVN 2.1.0

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