Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
torvalds
GitHub Repository: torvalds/linux
Path: blob/master/arch/x86/entry/vdso/common/vgetcpu.c
121848 views
1
// SPDX-License-Identifier: GPL-2.0-only
2
/*
3
* Copyright 2006 Andi Kleen, SUSE Labs.
4
*
5
* Fast user context implementation of getcpu()
6
*/
7
8
#include <linux/kernel.h>
9
#include <asm/segment.h>
10
#include <vdso/processor.h>
11
12
notrace long
13
__vdso_getcpu(unsigned *cpu, unsigned *node, void *unused)
14
{
15
vdso_read_cpunode(cpu, node);
16
17
return 0;
18
}
19
20
long getcpu(unsigned *cpu, unsigned *node, void *tcache)
21
__attribute__((weak, alias("__vdso_getcpu")));
22
23