1
2
3
4
5
6
7
8
9
10
11#include <asm/sgidefs.h>
12
13#if _MIPS_SIM != _MIPS_SIM_ABI64 && defined(CONFIG_64BIT)
14
15
16#define BUILD_VDSO32_64
17#undef CONFIG_64BIT
18#define CONFIG_32BIT 1
19#ifndef __ASSEMBLY__
20#include <asm-generic/atomic64.h>
21#endif
22#endif
23
24#ifndef __ASSEMBLY__
25
26#include <asm/asm.h>
27#include <asm/page.h>
28#include <asm/vdso.h>
29
30static inline unsigned long get_vdso_base(void)
31{
32 unsigned long addr;
33
34
35
36
37
38#ifdef CONFIG_CPU_MIPSR6
39
40
41
42
43
44
45 __asm__("lapc %0, _start \n"
46 : "=r" (addr) : :);
47#else
48
49
50
51
52
53
54
55
56
57
58
59 __asm__(
60 " .set push \n"
61 " .set noreorder \n"
62 " bal 1f \n"
63 " nop \n"
64 " .word _start - . \n"
65 "1: lw %0, 0($31) \n"
66 " " STR(PTR_ADDU) " %0, $31, %0 \n"
67 " .set pop \n"
68 : "=r" (addr)
69 :
70 : "$31");
71#endif
72
73 return addr;
74}
75
76static inline const union mips_vdso_data *get_vdso_data(void)
77{
78 return (const union mips_vdso_data *)(get_vdso_base() - PAGE_SIZE);
79}
80
81#ifdef CONFIG_CLKSRC_MIPS_GIC
82
83static inline void __iomem *get_gic(const union mips_vdso_data *data)
84{
85 return (void __iomem *)data - PAGE_SIZE;
86}
87
88#endif
89
90#endif
91