mmu_context.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* mmu_context.h: MMU context management routines
  2. *
  3. * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #ifndef _ASM_MMU_CONTEXT_H
  12. #define _ASM_MMU_CONTEXT_H
  13. #include <asm/setup.h>
  14. #include <asm/page.h>
  15. #include <asm/pgalloc.h>
  16. static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
  17. {
  18. }
  19. #ifdef CONFIG_MMU
  20. extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
  21. extern void change_mm_context(mm_context_t *old, mm_context_t *ctx, pgd_t *_pgd);
  22. extern void destroy_context(struct mm_struct *mm);
  23. #else
  24. #define init_new_context(tsk, mm) ({ 0; })
  25. #define change_mm_context(old, ctx, _pml4) do {} while(0)
  26. #define destroy_context(mm) do {} while(0)
  27. #endif
  28. #define switch_mm(prev, next, tsk) \
  29. do { \
  30. if (prev != next) \
  31. change_mm_context(&prev->context, &next->context, next->pgd); \
  32. } while(0)
  33. #define activate_mm(prev, next) \
  34. do { \
  35. change_mm_context(&prev->context, &next->context, next->pgd); \
  36. } while(0)
  37. #define deactivate_mm(tsk, mm) \
  38. do { \
  39. } while(0)
  40. #endif