xref: /linux/arch/powerpc/include/asm/vdso_datapage.h (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 #ifndef _VDSO_DATAPAGE_H
3 #define _VDSO_DATAPAGE_H
4 #ifdef __KERNEL__
5 
6 /*
7  * Copyright (C) 2002 Peter Bergner <bergner@vnet.ibm.com>, IBM
8  * Copyright (C) 2005 Benjamin Herrenschmidy <benh@kernel.crashing.org>,
9  * 		      IBM Corp.
10  */
11 
12 #ifndef __ASSEMBLY__
13 
14 #include <linux/unistd.h>
15 #include <linux/time.h>
16 #include <vdso/datapage.h>
17 
18 #define SYSCALL_MAP_SIZE      ((NR_syscalls + 31) / 32)
19 
20 #ifdef CONFIG_PPC64
21 
22 struct vdso_arch_data {
23 	__u64 tb_ticks_per_sec;			/* Timebase tics / sec */
24 	__u32 dcache_block_size;		/* L1 d-cache block size     */
25 	__u32 icache_block_size;		/* L1 i-cache block size     */
26 	__u32 dcache_log_block_size;		/* L1 d-cache log block size */
27 	__u32 icache_log_block_size;		/* L1 i-cache log block size */
28 	__u32 syscall_map[SYSCALL_MAP_SIZE];	/* Map of syscalls  */
29 	__u32 compat_syscall_map[SYSCALL_MAP_SIZE];	/* Map of compat syscalls */
30 
31 	struct vdso_rng_data rng_data;
32 
33 	struct vdso_data data[CS_BASES] __aligned(1 << CONFIG_PAGE_SHIFT);
34 };
35 
36 #else /* CONFIG_PPC64 */
37 
38 struct vdso_arch_data {
39 	__u64 tb_ticks_per_sec;		/* Timebase tics / sec */
40 	__u32 syscall_map[SYSCALL_MAP_SIZE]; /* Map of syscalls */
41 	__u32 compat_syscall_map[0];	/* No compat syscalls on PPC32 */
42 	struct vdso_rng_data rng_data;
43 
44 	struct vdso_data data[CS_BASES] __aligned(1 << CONFIG_PAGE_SHIFT);
45 };
46 
47 #endif /* CONFIG_PPC64 */
48 
49 extern struct vdso_arch_data *vdso_data;
50 
51 #else /* __ASSEMBLY__ */
52 
53 .macro get_datapage ptr offset=0
54 	bcl	20, 31, .+4
55 999:
56 	mflr	\ptr
57 	addis	\ptr, \ptr, (_vdso_datapage - 999b + \offset)@ha
58 	addi	\ptr, \ptr, (_vdso_datapage - 999b + \offset)@l
59 .endm
60 
61 #include <asm/asm-offsets.h>
62 #include <asm/page.h>
63 
64 #endif /* __ASSEMBLY__ */
65 
66 #endif /* __KERNEL__ */
67 #endif /* _SYSTEMCFG_H */
68