mmu.h 852 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. /* The mmu context has extended page tables. */
  14. unsigned int has_pgste:1;
  15. } mm_context_t;
  16. #define INIT_MM_CONTEXT(name) \
  17. .context.list_lock = __SPIN_LOCK_UNLOCKED(name.context.list_lock), \
  18. .context.pgtable_list = LIST_HEAD_INIT(name.context.pgtable_list), \
  19. .context.gmap_list = LIST_HEAD_INIT(name.context.gmap_list),
  20. static inline int tprot(unsigned long addr)
  21. {
  22. int rc = -EFAULT;
  23. asm volatile(
  24. " tprot 0(%1),0\n"
  25. "0: ipm %0\n"
  26. " srl %0,28\n"
  27. "1:\n"
  28. EX_TABLE(0b,1b)
  29. : "+d" (rc) : "a" (addr) : "cc");
  30. return rc;
  31. }
  32. #endif