Andi Kleen | 2aae950 | 2007-07-21 17:10:01 +0200 | [diff] [blame] | 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> |
Andi Kleen | 2aae950 | 2007-07-21 17:10:01 +0200 | [diff] [blame] | 10 | #include <linux/time.h> |
Andi Kleen | 2aae950 | 2007-07-21 17:10:01 +0200 | [diff] [blame] | 11 | #include <asm/vgtod.h> |
Andi Kleen | 2aae950 | 2007-07-21 17:10:01 +0200 | [diff] [blame] | 12 | |
Steven Rostedt | 23adec5 | 2008-05-12 21:20:41 +0200 | [diff] [blame] | 13 | notrace long |
| 14 | __vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused) |
Andi Kleen | 2aae950 | 2007-07-21 17:10:01 +0200 | [diff] [blame] | 15 | { |
Ingo Molnar | 22245bd | 2018-10-08 10:41:59 +0200 | [diff] [blame] | 16 | vdso_read_cpunode(cpu, node); |
Ingo Molnar | ec3a941 | 2018-10-08 10:41:59 +0200 | [diff] [blame] | 17 | |
Andi Kleen | 2aae950 | 2007-07-21 17:10:01 +0200 | [diff] [blame] | 18 | return 0; |
| 19 | } |
| 20 | |
| 21 | long getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *tcache) |
| 22 | __attribute__((weak, alias("__vdso_getcpu"))); |