mirror of
https://github.com/torvalds/linux.git
synced 2026-11-28 01:13:11 +00:00
The cache parameter of getcpu() is useless nowadays for various reasons. * It is never passed by userspace for either the vDSO or syscalls. * It is never used by the kernel. * It could not be made to work on the current vDSO architecture. * The structure definition is not part of the UAPI headers. * vdso_getcpu() is superseded by restartable sequences in any case. Remove the struct and its header. As a side-effect this gets rid of an unwanted inclusion of the linux/ header namespace from vDSO code. [ tglx: Adapt to s390 upstream changes */ Signed-off-by: Thomas Weißschuh <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Acked-by: Heiko Carstens <[email protected]> # s390 Link: https://patch.msgid.link/[email protected]
21 lines
426 B
C
21 lines
426 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/* Copyright IBM Corp. 2020 */
|
|
|
|
#include <linux/compiler.h>
|
|
#include <asm/timex.h>
|
|
#include "vdso.h"
|
|
|
|
int __s390_vdso_getcpu(unsigned *cpu, unsigned *node, void *unused)
|
|
{
|
|
union tod_clock clk;
|
|
|
|
/* CPU number is stored in the programmable field of the TOD clock */
|
|
store_tod_clock_ext(&clk);
|
|
if (cpu)
|
|
*cpu = clk.pf;
|
|
/* NUMA node is always zero */
|
|
if (node)
|
|
*node = 0;
|
|
return 0;
|
|
}
|