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

Linux/Unix编程

开发平台:

Unix_Linux

  1. /* $Id: pgalloc.h,v 1.15 2001/10/18 09:06:37 davem Exp $ */
  2. #ifndef _SPARC_PGALLOC_H
  3. #define _SPARC_PGALLOC_H
  4. #include <linux/config.h>
  5. #include <linux/kernel.h>
  6. #include <linux/sched.h>
  7. #include <asm/page.h>
  8. #include <asm/btfixup.h>
  9. /* Fine grained cache/tlb flushing. */
  10. #ifdef CONFIG_SMP
  11. BTFIXUPDEF_CALL(void, local_flush_cache_all, void)
  12. BTFIXUPDEF_CALL(void, local_flush_cache_mm, struct mm_struct *)
  13. BTFIXUPDEF_CALL(void, local_flush_cache_range, struct mm_struct *, unsigned long, unsigned long)
  14. BTFIXUPDEF_CALL(void, local_flush_cache_page, struct vm_area_struct *, unsigned long)
  15. #define local_flush_cache_all() BTFIXUP_CALL(local_flush_cache_all)()
  16. #define local_flush_cache_mm(mm) BTFIXUP_CALL(local_flush_cache_mm)(mm)
  17. #define local_flush_cache_range(mm,start,end) BTFIXUP_CALL(local_flush_cache_range)(mm,start,end)
  18. #define local_flush_cache_page(vma,addr) BTFIXUP_CALL(local_flush_cache_page)(vma,addr)
  19. BTFIXUPDEF_CALL(void, local_flush_tlb_all, void)
  20. BTFIXUPDEF_CALL(void, local_flush_tlb_mm, struct mm_struct *)
  21. BTFIXUPDEF_CALL(void, local_flush_tlb_range, struct mm_struct *, unsigned long, unsigned long)
  22. BTFIXUPDEF_CALL(void, local_flush_tlb_page, struct vm_area_struct *, unsigned long)
  23. #define local_flush_tlb_all() BTFIXUP_CALL(local_flush_tlb_all)()
  24. #define local_flush_tlb_mm(mm) BTFIXUP_CALL(local_flush_tlb_mm)(mm)
  25. #define local_flush_tlb_range(mm,start,end) BTFIXUP_CALL(local_flush_tlb_range)(mm,start,end)
  26. #define local_flush_tlb_page(vma,addr) BTFIXUP_CALL(local_flush_tlb_page)(vma,addr)
  27. BTFIXUPDEF_CALL(void, local_flush_page_to_ram, unsigned long)
  28. BTFIXUPDEF_CALL(void, local_flush_sig_insns, struct mm_struct *, unsigned long)
  29. #define local_flush_page_to_ram(addr) BTFIXUP_CALL(local_flush_page_to_ram)(addr)
  30. #define local_flush_sig_insns(mm,insn_addr) BTFIXUP_CALL(local_flush_sig_insns)(mm,insn_addr)
  31. extern void smp_flush_cache_all(void);
  32. extern void smp_flush_cache_mm(struct mm_struct *mm);
  33. extern void smp_flush_cache_range(struct mm_struct *mm,
  34.   unsigned long start,
  35.   unsigned long end);
  36. extern void smp_flush_cache_page(struct vm_area_struct *vma, unsigned long page);
  37. extern void smp_flush_tlb_all(void);
  38. extern void smp_flush_tlb_mm(struct mm_struct *mm);
  39. extern void smp_flush_tlb_range(struct mm_struct *mm,
  40.   unsigned long start,
  41.   unsigned long end);
  42. extern void smp_flush_tlb_page(struct vm_area_struct *mm, unsigned long page);
  43. extern void smp_flush_page_to_ram(unsigned long page);
  44. extern void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr);
  45. #endif
  46. BTFIXUPDEF_CALL(void, flush_cache_all, void)
  47. BTFIXUPDEF_CALL(void, flush_cache_mm, struct mm_struct *)
  48. BTFIXUPDEF_CALL(void, flush_cache_range, struct mm_struct *, unsigned long, unsigned long)
  49. BTFIXUPDEF_CALL(void, flush_cache_page, struct vm_area_struct *, unsigned long)
  50. #define flush_cache_all() BTFIXUP_CALL(flush_cache_all)()
  51. #define flush_cache_mm(mm) BTFIXUP_CALL(flush_cache_mm)(mm)
  52. #define flush_cache_range(mm,start,end) BTFIXUP_CALL(flush_cache_range)(mm,start,end)
  53. #define flush_cache_page(vma,addr) BTFIXUP_CALL(flush_cache_page)(vma,addr)
  54. #define flush_icache_range(start, end) do { } while (0)
  55. BTFIXUPDEF_CALL(void, flush_tlb_all, void)
  56. BTFIXUPDEF_CALL(void, flush_tlb_mm, struct mm_struct *)
  57. BTFIXUPDEF_CALL(void, flush_tlb_range, struct mm_struct *, unsigned long, unsigned long)
  58. BTFIXUPDEF_CALL(void, flush_tlb_page, struct vm_area_struct *, unsigned long)
  59. extern __inline__ void flush_tlb_pgtables(struct mm_struct *mm, unsigned long start, unsigned long end)
  60. {
  61. }
  62. #define flush_tlb_all() BTFIXUP_CALL(flush_tlb_all)()
  63. #define flush_tlb_mm(mm) BTFIXUP_CALL(flush_tlb_mm)(mm)
  64. #define flush_tlb_range(mm,start,end) BTFIXUP_CALL(flush_tlb_range)(mm,start,end)
  65. #define flush_tlb_page(vma,addr) BTFIXUP_CALL(flush_tlb_page)(vma,addr)
  66. BTFIXUPDEF_CALL(void, __flush_page_to_ram, unsigned long)
  67. BTFIXUPDEF_CALL(void, flush_sig_insns, struct mm_struct *, unsigned long)
  68. #define __flush_page_to_ram(addr) BTFIXUP_CALL(__flush_page_to_ram)(addr)
  69. #define flush_sig_insns(mm,insn_addr) BTFIXUP_CALL(flush_sig_insns)(mm,insn_addr)
  70. extern void flush_page_to_ram(struct page *page);
  71. #define flush_dcache_page(page) do { } while (0)
  72. extern struct pgtable_cache_struct {
  73. unsigned long *pgd_cache;
  74. unsigned long *pte_cache;
  75. unsigned long pgtable_cache_sz;
  76. unsigned long pgd_cache_sz;
  77. } pgt_quicklists;
  78. #define pgd_quicklist           (pgt_quicklists.pgd_cache)
  79. #define pmd_quicklist           ((unsigned long *)0)
  80. #define pte_quicklist           (pgt_quicklists.pte_cache)
  81. #define pgtable_cache_size      (pgt_quicklists.pgtable_cache_sz)
  82. #define pgd_cache_size (pgt_quicklists.pgd_cache_sz)
  83. BTFIXUPDEF_CALL(int,  do_check_pgt_cache, int, int)
  84. #define do_check_pgt_cache(low,high) BTFIXUP_CALL(do_check_pgt_cache)(low,high)
  85. BTFIXUPDEF_CALL(pgd_t *, get_pgd_fast, void)
  86. #define get_pgd_fast() BTFIXUP_CALL(get_pgd_fast)()
  87. BTFIXUPDEF_CALL(void, free_pgd_fast, pgd_t *)
  88. #define free_pgd_fast(pgd) BTFIXUP_CALL(free_pgd_fast)(pgd)
  89. #define pgd_free(pgd) free_pgd_fast(pgd)
  90. #define pgd_alloc(mm) get_pgd_fast()
  91. #define pgd_populate(MM, PGD, PMD)      pgd_set(PGD, PMD)
  92. static __inline__ pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
  93. {
  94. return 0;
  95. }
  96. BTFIXUPDEF_CALL(pmd_t *, pmd_alloc_one_fast, struct mm_struct *, unsigned long)
  97. #define pmd_alloc_one_fast(mm, address) BTFIXUP_CALL(pmd_alloc_one_fast)(mm, address)
  98. BTFIXUPDEF_CALL(void, free_pmd_fast, pmd_t *)
  99. #define free_pmd_fast(pmd) BTFIXUP_CALL(free_pmd_fast)(pmd)
  100. #define pmd_free(pmd)           free_pmd_fast(pmd)
  101. #define pmd_populate(MM, PMD, PTE)      pmd_set(PMD, PTE)
  102. BTFIXUPDEF_CALL(pte_t *, pte_alloc_one, struct mm_struct *, unsigned long)
  103. #define pte_alloc_one(mm, address) BTFIXUP_CALL(pte_alloc_one)(mm, address)
  104. BTFIXUPDEF_CALL(pte_t *, pte_alloc_one_fast, struct mm_struct *, unsigned long)
  105. #define pte_alloc_one_fast(mm, address) BTFIXUP_CALL(pte_alloc_one_fast)(mm, address)
  106. BTFIXUPDEF_CALL(void, free_pte_fast, pte_t *)
  107. #define free_pte_fast(pte) BTFIXUP_CALL(free_pte_fast)(pte)
  108. #define pte_free(pte) free_pte_fast(pte)
  109. #endif /* _SPARC_PGALLOC_H */