mmu.h 949 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ARM_MMU_H
  3. #define __ARM_MMU_H
  4. #ifdef CONFIG_MMU
  5. typedef struct {
  6. #ifdef CONFIG_CPU_HAS_ASID
  7. atomic64_t id;
  8. #else
  9. int switch_pending;
  10. #endif
  11. atomic_t vmalloc_seq;
  12. unsigned long sigpage;
  13. #ifdef CONFIG_VDSO
  14. unsigned long vdso;
  15. #endif
  16. #ifdef CONFIG_BINFMT_ELF_FDPIC
  17. unsigned long exec_fdpic_loadmap;
  18. unsigned long interp_fdpic_loadmap;
  19. #endif
  20. } mm_context_t;
  21. #ifdef CONFIG_CPU_HAS_ASID
  22. #define ASID_BITS 8
  23. #define ASID_MASK ((~0ULL) << ASID_BITS)
  24. #define ASID(mm) ((unsigned int)((mm)->context.id.counter & ~ASID_MASK))
  25. #else
  26. #define ASID(mm) (0)
  27. #endif
  28. #else
  29. /*
  30. * From nommu.h:
  31. * Copyright (C) 2002, David McCullough <[email protected]>
  32. * modified for 2.6 by Hyok S. Choi <[email protected]>
  33. */
  34. typedef struct {
  35. unsigned long end_brk;
  36. #ifdef CONFIG_BINFMT_ELF_FDPIC
  37. unsigned long exec_fdpic_loadmap;
  38. unsigned long interp_fdpic_loadmap;
  39. #endif
  40. } mm_context_t;
  41. #endif
  42. #endif