PageRenderTime 15ms CodeModel.GetById 12ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/arch/um/sys-i386/delay.c

https://gitlab.com/tiler/tiler-omap4
C | 29 lines | 24 code | 4 blank | 1 comment | 1 complexity | fb41c7edc2bd9ba8400d9e68577b4b70 MD5 | raw file
 1#include <linux/module.h>
 2#include <linux/kernel.h>
 3#include <linux/delay.h>
 4#include <asm/param.h>
 5
 6void __delay(unsigned long time)
 7{
 8	/* Stolen from the i386 __loop_delay */
 9	int d0;
10	__asm__ __volatile__(
11		"\tjmp 1f\n"
12		".align 16\n"
13		"1:\tjmp 2f\n"
14		".align 16\n"
15		"2:\tdecl %0\n\tjns 2b"
16		:"=&a" (d0)
17		:"0" (time));
18}
19
20void __udelay(unsigned long usecs)
21{
22	int i, n;
23
24	n = (loops_per_jiffy * HZ * usecs) / MILLION;
25        for(i=0;i<n;i++)
26                cpu_relax();
27}
28
29EXPORT_SYMBOL(__udelay);