0001
0002
0003
0004
0005
0006
0007 #include <asm/sgidefs.h>
0008
0009 #ifndef __ASSEMBLY__
0010
0011 #include <asm/asm.h>
0012 #include <asm/page.h>
0013 #include <asm/vdso.h>
0014
0015 static inline unsigned long get_vdso_base(void)
0016 {
0017 unsigned long addr;
0018
0019
0020
0021
0022
0023 #ifdef CONFIG_CPU_MIPSR6
0024
0025
0026
0027
0028
0029
0030 __asm__("lapc %0, _start \n"
0031 : "=r" (addr) : :);
0032 #else
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044 __asm__(
0045 " .set push \n"
0046 " .set noreorder \n"
0047 " bal 1f \n"
0048 " nop \n"
0049 " .word _start - . \n"
0050 "1: lw %0, 0($31) \n"
0051 " " STR(PTR_ADDU) " %0, $31, %0 \n"
0052 " .set pop \n"
0053 : "=r" (addr)
0054 :
0055 : "$31");
0056 #endif
0057
0058 return addr;
0059 }
0060
0061 static inline const struct vdso_data *get_vdso_data(void)
0062 {
0063 return (const struct vdso_data *)(get_vdso_base() - PAGE_SIZE);
0064 }
0065
0066 #ifdef CONFIG_CLKSRC_MIPS_GIC
0067
0068 static inline void __iomem *get_gic(const struct vdso_data *data)
0069 {
0070 return (void __iomem *)((unsigned long)data & PAGE_MASK) - PAGE_SIZE;
0071 }
0072
0073 #endif
0074
0075 #endif