mmu_context.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:1k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. #ifndef __SPARC_MMU_CONTEXT_H
  2. #define __SPARC_MMU_CONTEXT_H
  3. #include <asm/btfixup.h>
  4. #ifndef __ASSEMBLY__
  5. static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu)
  6. {
  7. }
  8. /*
  9.  * Initialize a new mmu context.  This is invoked when a new
  10.  * address space instance (unique or shared) is instantiated.
  11.  */
  12. #define init_new_context(tsk, mm) (((mm)->context = NO_CONTEXT), 0)
  13. /*
  14.  * Destroy a dead context.  This occurs when mmput drops the
  15.  * mm_users count to zero, the mmaps have been released, and
  16.  * all the page tables have been flushed.  Our job is to destroy
  17.  * any remaining processor-specific state.
  18.  */
  19. BTFIXUPDEF_CALL(void, destroy_context, struct mm_struct *)
  20. #define destroy_context(mm) BTFIXUP_CALL(destroy_context)(mm)
  21. /* Switch the current MM context. */
  22. BTFIXUPDEF_CALL(void, switch_mm, struct mm_struct *, struct mm_struct *, struct task_struct *, int)
  23. #define switch_mm(old_mm, mm, tsk, cpu) BTFIXUP_CALL(switch_mm)(old_mm, mm, tsk, cpu)
  24. /* Activate a new MM instance for the current task. */
  25. #define activate_mm(active_mm, mm) switch_mm((active_mm), (mm), NULL, smp_processor_id())
  26. #endif /* !(__ASSEMBLY__) */
  27. #endif /* !(__SPARC_MMU_CONTEXT_H) */