blob: b88a82bbc35931708b4e47e1ba8aca55aec2d1dc [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001// SPDX-License-Identifier: GPL-2.0-only
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
3 * Copyright 2006 Andi Kleen, SUSE Labs.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00004 *
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
13notrace long
14__vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
15{
David Brazdil0f672f62019-12-10 10:32:29 +000016 vdso_read_cpunode(cpu, node);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000017
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000018 return 0;
19}
20
21long getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *tcache)
22 __attribute__((weak, alias("__vdso_getcpu")));