mmu.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef __MMU_H
  2. #define __MMU_H
  3. #include <linux/cpumask.h>
  4. #include <linux/errno.h>
  5. typedef struct {
  6. cpumask_t cpu_attach_mask;
  7. atomic_t attach_count;
  8. unsigned int flush_mm;
  9. spinlock_t list_lock;
  10. struct list_head pgtable_list;
  11. struct list_head gmap_list;
  12. unsigned long asce_bits;
  13. unsigned long asce_limit;
  14. unsigned long vdso_base;
  15. /* The mmu context allocates 4K page tables. */
  16. unsigned int alloc_pgste:1;
  17. /* The mmu context uses extended page tables. */
  18. unsigned int has_pgste:1;
  19. /* The mmu context uses storage keys. */
  20. unsigned int use_skey:1;
  21. } mm_context_t;
  22. #define INIT_MM_CONTEXT(name) \
  23. .context.list_lock = __SPIN_LOCK_UNLOCKED(name.context.list_lock), \
  24. .context.pgtable_list = LIST_HEAD_INIT(name.context.pgtable_list), \
  25. .context.gmap_list = LIST_HEAD_INIT(name.context.gmap_list),
  26. static inline int tprot(unsigned long addr)
  27. {
  28. int rc = -EFAULT;
  29. asm volatile(
  30. " tprot 0(%1),0\n"
  31. "0: ipm %0\n"
  32. " srl %0,28\n"
  33. "1:\n"
  34. EX_TABLE(0b,1b)
  35. : "+d" (rc) : "a" (addr) : "cc");
  36. return rc;
  37. }
  38. #endif