You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
572 B
29 lines
572 B
18 years ago
|
/*
|
||
|
* Copyright 2006 Andi Kleen, SUSE Labs.
|
||
|
* Subject to the GNU Public License, v.2
|
||
|
*
|
||
|
* Fast user context implementation of getcpu()
|
||
|
*/
|
||
|
|
||
|
#include <linux/kernel.h>
|
||
|
#include <linux/getcpu.h>
|
||
|
#include <linux/time.h>
|
||
|
#include <asm/vgtod.h>
|
||
|
|
||
17 years ago
|
notrace long
|
||
|
__vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
|
||
18 years ago
|
{
|
||
17 years ago
|
unsigned int p;
|
||
18 years ago
|
|
||
12 years ago
|
p = __getcpu();
|
||
|
|
||
18 years ago
|
if (cpu)
|
||
12 years ago
|
*cpu = p & VGETCPU_CPU_MASK;
|
||
18 years ago
|
if (node)
|
||
|
*node = p >> 12;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
long getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *tcache)
|
||
|
__attribute__((weak, alias("__vdso_getcpu")));
|