1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Author: Huacai Chen <chenhuacai@loongson.cn>
4 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
13 struct vdso_pcpu_data {
15 } ____cacheline_aligned_in_smp;
17 struct loongarch_vdso_data {
18 struct vdso_pcpu_data pdata[NR_CPUS];
19 struct vdso_data data[CS_BASES]; /* Arch-independent data */
22 #define VDSO_DATA_SIZE PAGE_ALIGN(sizeof(struct loongarch_vdso_data))
24 static inline unsigned long get_vdso_base(void)
29 " la.pcrel %0, _start\n"
37 static inline const struct vdso_data *get_vdso_data(void)
39 return (const struct vdso_data *)(get_vdso_base()
40 - VDSO_DATA_SIZE + SMP_CACHE_BYTES * NR_CPUS);
43 #endif /* __ASSEMBLY__ */