Skip to content

Commit 9245b4c

Browse files
committed
Move __delay function into assembly to get accurate BogoMips
1 parent c14ddd0 commit 9245b4c

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

arch/arm/mach-bcm2708/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Makefile for the linux kernel.
33
#
44

5-
obj-$(CONFIG_MACH_BCM2708) += clock.o bcm2708.o armctrl.o vcio.o power.o dma.o
5+
obj-$(CONFIG_MACH_BCM2708) += clock.o bcm2708.o armctrl.o vcio.o power.o dma.o delay.o
66
obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o
77
obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o
88

arch/arm/mach-bcm2708/bcm2708.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -883,12 +883,6 @@ void __const_udelay(unsigned long scaled_usecs)
883883
} while ((long)(now - start) <= usecs);
884884
}
885885

886-
void __delay(int loops)
887-
{
888-
while (--loops > 0)
889-
nop();
890-
}
891-
892886
MACHINE_START(BCM2708, "BCM2708")
893887
/* Maintainer: Broadcom Europe Ltd. */
894888
.map_io = bcm2708_map_io,.init_irq = bcm2708_init_irq,.timer =

arch/arm/mach-bcm2708/delay.S

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* linux/arch/arm/lib/delay.S
3+
*
4+
* Copyright (C) 1995, 1996 Russell King
5+
*
6+
* This program is free software; you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License version 2 as
8+
* published by the Free Software Foundation.
9+
*/
10+
#include <linux/linkage.h>
11+
#include <asm/assembler.h>
12+
#include <asm/param.h>
13+
14+
.text
15+
@ Delay routine
16+
ENTRY(__delay)
17+
subs r0, r0, #1
18+
bhi __delay
19+
mov pc, lr
20+
ENDPROC(__delay)

0 commit comments

Comments
 (0)