David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2006 Andi Kleen, SUSE Labs. |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 4 | * |
| 5 | * Fast user context implementation of getcpu() |
| 6 | */ |
| 7 | |
| 8 | #include <linux/kernel.h> |
| 9 | #include <linux/getcpu.h> |
| 10 | #include <linux/time.h> |
| 11 | #include <asm/vgtod.h> |
| 12 | |
| 13 | notrace long |
| 14 | __vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused) |
| 15 | { |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 16 | vdso_read_cpunode(cpu, node); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 17 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 18 | return 0; |
| 19 | } |
| 20 | |
| 21 | long getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *tcache) |
| 22 | __attribute__((weak, alias("__vdso_getcpu"))); |