vgetcpu.c 496 B

12345678910111213141516171819202122
  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. #include <linux/kernel.h>
  8. #include <linux/getcpu.h>
  9. #include <linux/time.h>
  10. #include <asm/vgtod.h>
  11. notrace long
  12. __vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
  13. {
  14. vdso_read_cpunode(cpu, node);
  15. return 0;
  16. }
  17. long getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *tcache)
  18. __attribute__((weak, alias("__vdso_getcpu")));