vdso.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (C) 2012 ARM Limited
  3. * Copyright (C) 2014 Regents of the University of California
  4. * Copyright (C) 2017 SiFive
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef _ASM_RISCV_VDSO_H
  19. #define _ASM_RISCV_VDSO_H
  20. #include <linux/types.h>
  21. struct vdso_data {
  22. };
  23. /*
  24. * The VDSO symbols are mapped into Linux so we can just use regular symbol
  25. * addressing to get their offsets in userspace. The symbols are mapped at an
  26. * offset of 0, but since the linker must support setting weak undefined
  27. * symbols to the absolute address 0 it also happens to support other low
  28. * addresses even when the code model suggests those low addresses would not
  29. * otherwise be availiable.
  30. */
  31. #define VDSO_SYMBOL(base, name) \
  32. ({ \
  33. extern const char __vdso_##name[]; \
  34. (void __user *)((unsigned long)(base) + __vdso_##name); \
  35. })
  36. asmlinkage long sys_riscv_flush_icache(uintptr_t, uintptr_t, uintptr_t);
  37. #endif /* _ASM_RISCV_VDSO_H */