pgalloc.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* $Id: pgalloc.h,v 1.16 2001/12/21 04:56:17 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. struct page;
  10. extern struct pgtable_cache_struct {
  11. unsigned long *pgd_cache;
  12. unsigned long *pte_cache;
  13. unsigned long pgtable_cache_sz;
  14. unsigned long pgd_cache_sz;
  15. } pgt_quicklists;
  16. #define pgd_quicklist (pgt_quicklists.pgd_cache)
  17. #define pmd_quicklist ((unsigned long *)0)
  18. #define pte_quicklist (pgt_quicklists.pte_cache)
  19. #define pgtable_cache_size (pgt_quicklists.pgtable_cache_sz)
  20. #define pgd_cache_size (pgt_quicklists.pgd_cache_sz)
  21. extern void check_pgt_cache(void);
  22. BTFIXUPDEF_CALL(void, do_check_pgt_cache, int, int)
  23. #define do_check_pgt_cache(low,high) BTFIXUP_CALL(do_check_pgt_cache)(low,high)
  24. BTFIXUPDEF_CALL(pgd_t *, get_pgd_fast, void)
  25. #define get_pgd_fast() BTFIXUP_CALL(get_pgd_fast)()
  26. BTFIXUPDEF_CALL(void, free_pgd_fast, pgd_t *)
  27. #define free_pgd_fast(pgd) BTFIXUP_CALL(free_pgd_fast)(pgd)
  28. #define pgd_free(pgd) free_pgd_fast(pgd)
  29. #define pgd_alloc(mm) get_pgd_fast()
  30. BTFIXUPDEF_CALL(void, pgd_set, pgd_t *, pmd_t *)
  31. #define pgd_set(pgdp,pmdp) BTFIXUP_CALL(pgd_set)(pgdp,pmdp)
  32. #define pgd_populate(MM, PGD, PMD) pgd_set(PGD, PMD)
  33. BTFIXUPDEF_CALL(pmd_t *, pmd_alloc_one, struct mm_struct *, unsigned long)
  34. #define pmd_alloc_one(mm, address) BTFIXUP_CALL(pmd_alloc_one)(mm, address)
  35. BTFIXUPDEF_CALL(void, free_pmd_fast, pmd_t *)
  36. #define free_pmd_fast(pmd) BTFIXUP_CALL(free_pmd_fast)(pmd)
  37. #define pmd_free(pmd) free_pmd_fast(pmd)
  38. #define __pmd_free_tlb(tlb, pmd) pmd_free(pmd)
  39. BTFIXUPDEF_CALL(void, pmd_populate, pmd_t *, struct page *)
  40. #define pmd_populate(MM, PMD, PTE) BTFIXUP_CALL(pmd_populate)(PMD, PTE)
  41. BTFIXUPDEF_CALL(void, pmd_set, pmd_t *, pte_t *)
  42. #define pmd_populate_kernel(MM, PMD, PTE) BTFIXUP_CALL(pmd_set)(PMD, PTE)
  43. BTFIXUPDEF_CALL(struct page *, pte_alloc_one, struct mm_struct *, unsigned long)
  44. #define pte_alloc_one(mm, address) BTFIXUP_CALL(pte_alloc_one)(mm, address)
  45. BTFIXUPDEF_CALL(pte_t *, pte_alloc_one_kernel, struct mm_struct *, unsigned long)
  46. #define pte_alloc_one_kernel(mm, addr) BTFIXUP_CALL(pte_alloc_one_kernel)(mm, addr)
  47. BTFIXUPDEF_CALL(void, free_pte_fast, pte_t *)
  48. #define pte_free_kernel(pte) BTFIXUP_CALL(free_pte_fast)(pte)
  49. BTFIXUPDEF_CALL(void, pte_free, struct page *)
  50. #define pte_free(pte) BTFIXUP_CALL(pte_free)(pte)
  51. #define __pte_free_tlb(tlb, pte) pte_free(pte)
  52. #endif /* _SPARC_PGALLOC_H */