mmu.h 947 B

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