Merge branch 'for-3.17/core' of git://git.kernel.dk/linux-block
[deliverable/linux.git] / arch / x86 / vdso / vgetcpu.c
CommitLineData
2aae950b
AK
1/*
2 * Copyright 2006 Andi Kleen, SUSE Labs.
3 * Subject to the GNU Public License, v.2
4 *
5 * Fast user context implementation of getcpu()
6 */
7
8#include <linux/kernel.h>
9#include <linux/getcpu.h>
10#include <linux/jiffies.h>
11#include <linux/time.h>
12#include <asm/vsyscall.h>
13#include <asm/vgtod.h>
2aae950b 14
23adec55
SR
15notrace long
16__vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
2aae950b 17{
8f12dea6 18 unsigned int p;
2aae950b 19
51c19b4f
MT
20 p = __getcpu();
21
2aae950b 22 if (cpu)
51c19b4f 23 *cpu = p & VGETCPU_CPU_MASK;
2aae950b
AK
24 if (node)
25 *node = p >> 12;
26 return 0;
27}
28
29long getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *tcache)
30 __attribute__((weak, alias("__vdso_getcpu")));
This page took 0.483727 seconds and 5 git commands to generate.