From 9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00 Mon Sep 17 00:00:00 2001 From: Yunhong Jiang Date: Tue, 4 Aug 2015 12:17:53 -0700 Subject: Add the rt linux 4.1.3-rt3 as base Import the rt linux 4.1.3-rt3 as OPNFV kvm base. It's from git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-4.1.y-rt and the base is: commit 0917f823c59692d751951bf5ea699a2d1e2f26a2 Author: Sebastian Andrzej Siewior Date: Sat Jul 25 12:13:34 2015 +0200 Prepare v4.1.3-rt3 Signed-off-by: Sebastian Andrzej Siewior We lose all the git history this way and it's not good. We should apply another opnfv project repo in future. Change-Id: I87543d81c9df70d99c5001fbdf646b202c19f423 Signed-off-by: Yunhong Jiang --- kernel/arch/blackfin/include/asm/delay.h | 51 ++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 kernel/arch/blackfin/include/asm/delay.h (limited to 'kernel/arch/blackfin/include/asm/delay.h') diff --git a/kernel/arch/blackfin/include/asm/delay.h b/kernel/arch/blackfin/include/asm/delay.h new file mode 100644 index 000000000..171d8deb0 --- /dev/null +++ b/kernel/arch/blackfin/include/asm/delay.h @@ -0,0 +1,51 @@ +/* + * delay.h - delay functions + * + * Copyright (c) 2004-2007 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ + +#ifndef __ASM_DELAY_H__ +#define __ASM_DELAY_H__ + +#include + +static inline void __delay(unsigned long loops) +{ +__asm__ __volatile__ ( + "LSETUP(1f, 1f) LC0 = %0;" + "1: NOP;" + : + : "a" (loops) + : "LT0", "LB0", "LC0" + ); +} + +#include /* needed for HZ */ + +/* + * close approximation borrowed from m68knommu to avoid 64-bit math + */ + +#define HZSCALE (268435456 / (1000000/HZ)) + +static inline unsigned long __to_delay(unsigned long scale) +{ + extern unsigned long loops_per_jiffy; + return (((scale * HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6; +} + +static inline void udelay(unsigned long usecs) +{ + __delay(__to_delay(usecs)); +} + +static inline void ndelay(unsigned long nsecs) +{ + __delay(__to_delay(1) * nsecs / 1000); +} + +#define ndelay ndelay + +#endif -- cgit 1.2.3-korg