blob: f86ab0ae1777f6a720cbb7fd9b69885f3957f767 [file] [log] [blame]
Andi Kleen2aae9502007-07-21 17:10:01 +02001/*
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 Kleen2aae9502007-07-21 17:10:01 +020010#include <linux/time.h>
Andi Kleen2aae9502007-07-21 17:10:01 +020011#include <asm/vgtod.h>
Andi Kleen2aae9502007-07-21 17:10:01 +020012
Steven Rostedt23adec52008-05-12 21:20:41 +020013notrace long
14__vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
Andi Kleen2aae9502007-07-21 17:10:01 +020015{
Ingo Molnar22245bd2018-10-08 10:41:59 +020016 vdso_read_cpunode(cpu, node);
Ingo Molnarec3a9412018-10-08 10:41:59 +020017
Andi Kleen2aae9502007-07-21 17:10:01 +020018 return 0;
19}
20
21long getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *tcache)
22 __attribute__((weak, alias("__vdso_getcpu")));