mmu.h 920 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef __ARM_MMU_H
  2. #define __ARM_MMU_H
  3. #ifdef CONFIG_MMU
  4. typedef struct {
  5. #ifdef CONFIG_CPU_HAS_ASID
  6. unsigned int id;
  7. raw_spinlock_t id_lock;
  8. #endif
  9. unsigned int kvm_seq;
  10. } mm_context_t;
  11. #ifdef CONFIG_CPU_HAS_ASID
  12. #define ASID(mm) ((mm)->context.id & 255)
  13. /* init_mm.context.id_lock should be initialized. */
  14. #define INIT_MM_CONTEXT(name) \
  15. .context.id_lock = __RAW_SPIN_LOCK_UNLOCKED(name.context.id_lock),
  16. #else
  17. #define ASID(mm) (0)
  18. #endif
  19. #else
  20. /*
  21. * From nommu.h:
  22. * Copyright (C) 2002, David McCullough <davidm@snapgear.com>
  23. * modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com>
  24. */
  25. typedef struct {
  26. unsigned long end_brk;
  27. } mm_context_t;
  28. #endif
  29. /*
  30. * switch_mm() may do a full cache flush over the context switch,
  31. * so enable interrupts over the context switch to avoid high
  32. * latency.
  33. */
  34. #define __ARCH_WANT_INTERRUPTS_ON_CTXSW
  35. #endif