mm.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * linux/arch/unicore32/mm/mm.h
  3. *
  4. * Code specific to PKUnity SoC and UniCore ISA
  5. *
  6. * Copyright (C) 2001-2010 GUAN Xue-tao
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #include <asm/hwdef-copro.h>
  13. /* the upper-most page table pointer */
  14. extern pmd_t *top_pmd;
  15. extern int sysctl_overcommit_memory;
  16. #define TOP_PTE(x) pte_offset_kernel(top_pmd, x)
  17. static inline pmd_t *pmd_off(pgd_t *pgd, unsigned long virt)
  18. {
  19. return pmd_offset((pud_t *)pgd, virt);
  20. }
  21. static inline pmd_t *pmd_off_k(unsigned long virt)
  22. {
  23. return pmd_off(pgd_offset_k(virt), virt);
  24. }
  25. struct mem_type {
  26. unsigned int prot_pte;
  27. unsigned int prot_l1;
  28. unsigned int prot_sect;
  29. };
  30. const struct mem_type *get_mem_type(unsigned int type);
  31. extern void __flush_dcache_page(struct address_space *, struct page *);
  32. extern void hook_fault_code(int nr, int (*fn)
  33. (unsigned long, unsigned int, struct pt_regs *),
  34. int sig, int code, const char *name);
  35. void __init bootmem_init(void);
  36. void uc32_mm_memblock_reserve(void);