vdso.h 872 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2012 ARM Limited
  4. * Copyright (C) 2014 Regents of the University of California
  5. * Copyright (C) 2017 SiFive
  6. */
  7. #ifndef _ASM_RISCV_VDSO_H
  8. #define _ASM_RISCV_VDSO_H
  9. /*
  10. * All systems with an MMU have a VDSO, but systems without an MMU don't
  11. * support shared libraries and therefor don't have one.
  12. */
  13. #ifdef CONFIG_MMU
  14. #define __VVAR_PAGES 2
  15. #ifndef __ASSEMBLY__
  16. #include <generated/vdso-offsets.h>
  17. #define VDSO_SYMBOL(base, name) \
  18. (void __user *)((unsigned long)(base) + __vdso_##name##_offset)
  19. #ifdef CONFIG_COMPAT
  20. #include <generated/compat_vdso-offsets.h>
  21. #define COMPAT_VDSO_SYMBOL(base, name) \
  22. (void __user *)((unsigned long)(base) + compat__vdso_##name##_offset)
  23. #endif /* CONFIG_COMPAT */
  24. #endif /* !__ASSEMBLY__ */
  25. #endif /* CONFIG_MMU */
  26. #endif /* _ASM_RISCV_VDSO_H */