tmp_suning_uos_patched/arch/arm/include/asm
Russell King 112f38a4a3 ARM: sched_clock: provide common infrastructure for sched_clock()
Provide common sched_clock() infrastructure for platforms to use to
create a 64-bit ns based sched_clock() implementation from a counter
running at a non-variable clock rate.

This implementation is based upon maintaining an epoch for the counter
and an epoch for the nanosecond time.  When we desire a sched_clock()
time, we calculate the number of counter ticks since the last epoch
update, convert this to nanoseconds and add to the epoch nanoseconds.

We regularly refresh these epochs within the counter wrap interval.
We perform a similar calculation as above, and store the new epochs.

We read and write the epochs in such a way that sched_clock() can easily
(and locklessly) detect when an update is in progress, and repeat the
loading of these constants when they're known not to be stable.  The
one caveat is that sched_clock() is not called in the middle of an
update.  We achieve that by disabling IRQs.

Finally, if the clock rate is known at compile time, the counter to ns
conversion factors can be specified, allowing sched_clock() to be tightly
optimized.  We ensure that these factors are correct by providing an
initialization function which performs a run-time check.

Acked-by: Peter Zijlstra <peterz@infradead.org>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Will Deacon <will.deacon@arm.com>
Tested-by: Mikael Pettersson <mikpe@it.uu.se>
Tested-by: Eric Miao <eric.y.miao@gmail.com>
Tested-by: Olof Johansson <olof@lixom.net>
Tested-by: Jamie Iles <jamie@jamieiles.com>
Reviewed-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-12-22 22:44:43 +00:00
..
hardware ARM: pxa: fix the missing definition of IRQ_BOARD_END 2010-11-03 23:11:17 +08:00
mach arm: remove machine_desc.io_pg_offst and .phys_io 2010-10-20 00:27:46 -04:00
a.out-core.h
a.out.h
asm-offsets.h
assembler.h ARM: 6489/1: thumb2: fix incorrect optimisation in usracc 2010-11-21 22:05:58 +00:00
atomic.h
auxvec.h
bitops.h
bitsperlong.h
bug.h
bugs.h
byteorder.h
cache.h dma-mapping: rename ARCH_KMALLOC_MINALIGN to ARCH_DMA_MINALIGN 2010-08-11 08:59:21 -07:00
cacheflush.h Merge branches 'at91', 'dcache', 'ftrace', 'hwbpt', 'misc', 'mmci', 's3c', 'st-ux' and 'unwind' into devel 2010-10-18 22:34:25 +01:00
cachetype.h ARM: 6385/1: setup: detect aliasing I-cache when D-cache is non-aliasing 2010-10-04 20:57:09 +01:00
checksum.h
clkdev.h
cpu-multi32.h
cpu-single.h
cpu.h
cputime.h
cputype.h
current.h
delay.h
device.h
div64.h
dma-mapping.h Revert "[ARM] pxa: remove now unnecessary dma_needs_bounce()" 2010-09-08 12:28:39 +01:00
dma.h
domain.h
ecard.h
elf.h ARM: add a vma entry for the user accessible vector page 2010-10-01 22:35:19 -04:00
emergency-restart.h
entry-macro-vic2.S
errno.h
fb.h
fcntl.h
fiq.h
fixmap.h
flat.h
floppy.h
fpstate.h
ftrace.h ARM: 6319/1: ftrace: add Thumb-2 support to dynamic ftrace 2010-09-02 15:28:43 +01:00
futex.h
glue.h
gpio.h
hardirq.h
highmem.h mm: stack based kmap_atomic() 2010-10-26 16:52:08 -07:00
hw_breakpoint.h ARM: 6357/1: hw-breakpoint: add new ptrace requests for hw-breakpoint interaction 2010-09-08 10:05:00 +01:00
hw_irq.h arm: Use ARCH_IRQ_INIT_FLAGS 2010-10-16 22:57:38 +02:00
hwcap.h
ide.h
io.h ARM: implement CONFIG_STRICT_DEVMEM by disabling access to RAM via /dev/mem 2010-10-01 22:31:34 -04:00
ioctl.h
ioctls.h ioctl: Use asm-generic/ioctls.h on arm (enables termiox) 2010-10-22 10:19:59 -07:00
ipcbuf.h
irq_regs.h
irq.h
irqflags.h Fix IRQ flag handling naming 2010-10-07 14:08:55 +01:00
Kbuild archs: replace unifdef-y with header-y 2010-08-14 22:26:51 +02:00
kdebug.h
kexec.h
kgdb.h kgdb,arm: fix register dump 2010-10-29 13:14:40 -05:00
kmap_types.h
kprobes.h
leds.h
limits.h
linkage.h
local64.h
local.h
localtimer.h
locks.h
mach-types.h
mc146818rtc.h
memblock.h ARM: fix memblock breakage 2010-10-27 21:41:39 +01:00
memory.h
mman.h
mmu_context.h ARM: add a vma entry for the user accessible vector page 2010-10-01 22:35:19 -04:00
mmu.h ARM: 6490/1: MM: bugfix: initialize spinlock for init_mm.context 2010-11-23 22:46:12 +00:00
module.h ARM: 6340/1: module - additional unwind tables for exit/devexit sections 2010-09-02 15:31:35 +01:00
msgbuf.h
mtd-xip.h
mutex.h
nwflash.h
outercache.h arm: Disable outer (L2) cache in kexec 2010-10-26 11:39:56 +05:30
page-nommu.h
page.h
param.h
parport.h
pci.h
percpu.h
perf_event.h irq_work: Add generic hardirq context callbacks 2010-10-18 19:58:50 +02:00
pgalloc.h
pgtable-hwdef.h
pgtable-nommu.h
pgtable.h ARM: improve compiler's ability to optimize page tables 2010-11-21 14:42:47 +00:00
pmu.h
poll.h
posix_types.h
proc-fns.h
processor.h ARM: 6357/1: hw-breakpoint: add new ptrace requests for hw-breakpoint interaction 2010-09-08 10:05:00 +01:00
procinfo.h
ptrace.h ARM: 6357/1: hw-breakpoint: add new ptrace requests for hw-breakpoint interaction 2010-09-08 10:05:00 +01:00
resource.h
scatterlist.h
sched_clock.h ARM: sched_clock: provide common infrastructure for sched_clock() 2010-12-22 22:44:43 +00:00
seccomp.h ARM: SECCOMP support 2010-10-01 22:32:18 -04:00
sections.h
segment.h
sembuf.h
serial.h
setup.h
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
sizes.h
smp_mpidr.h ARM: Allow SMP kernels to boot on UP systems 2010-10-04 20:23:36 +01:00
smp_plat.h Merge branches 'at91', 'dcache', 'ftrace', 'hwbpt', 'misc', 'mmci', 's3c', 'st-ux' and 'unwind' into devel 2010-10-18 22:34:25 +01:00
smp_scu.h
smp_twd.h
smp.h
socket.h
sockios.h
sparsemem.h
spinlock_types.h
spinlock.h
stackprotector.h
stacktrace.h
stat.h
statfs.h
string.h
swab.h
system.h ARM: place C irq handlers in IRQ_ENTRY for ftrace 2010-11-19 21:43:26 +05:30
tcm.h
termbits.h tty: Add EXTPROC support for LINEMODE 2010-08-10 13:47:39 -07:00
termios.h
therm.h
thread_info.h ARM: SECCOMP support 2010-10-01 22:32:18 -04:00
thread_notify.h
timex.h
tlb.h
tlbflush.h Merge branches 'at91', 'dcache', 'ftrace', 'hwbpt', 'misc', 'mmci', 's3c', 'st-ux' and 'unwind' into devel 2010-10-18 22:34:25 +01:00
tls.h
topology.h
traps.h ARM: place C irq handlers in IRQ_ENTRY for ftrace 2010-11-19 21:43:26 +05:30
types.h
uaccess.h
ucontext.h
unaligned.h
unified.h
unistd.h ARM: 6343/1: wire up fanotify and prlimit64 syscalls on ARM 2010-09-01 10:06:08 +01:00
unwind.h
user.h
vfp.h
vfpmacros.h
vga.h
xor.h