normalDataOperation.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright (C) 2012 ARM Ltd.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef __ASM_PGTABLE_H
  17. #define __ASM_PGTABLE_H
  18. #include <asm/proc-fns.h>
  19. #include <asm/memory.h>
  20. #include <asm/pgtable-hwdef.h>
  21. /*
  22. * Software defined PTE bits definition.
  23. */
  24. #define PTE_VALID (_AT(pteval_t, 1) << 0)
  25. #define PTE_PROT_NONE (_AT(pteval_t, 1) << 1) /* only when !PTE_VALID */
  26. #define PTE_FILE (_AT(pteval_t, 1) << 2) /* only when !pte_present() */
  27. #define PTE_DIRTY (_AT(pteval_t, 1) << 55)
  28. #define PTE_SPECIAL (_AT(pteval_t, 1) << 56)
  29. /*
  30. * VMALLOC and SPARSEMEM_VMEMMAP ranges.
  31. */
  32. #define VMALLOC_START UL(0xffffff8000000000)
  33. #define VMALLOC_END (PAGE_OFFSET - UL(0x400000000) - SZ_64K)
  34. #define vmemmap ((struct page *)(VMALLOC_END + SZ_64K))
  35. #define FIRST_USER_ADDRESS 0
  36. #ifndef __ASSEMBLY__
  37. extern void __pte_error(const char *file, int line, unsigned long val);
  38. extern void __pmd_error(const char *file, int line, unsigned long val);
  39. extern void __pgd_error(const char *file, int line, unsigned long val);
  40. #define pte_ERROR(pte) __pte_error(__FILE__, __LINE__, pte_val(pte))
  41. #ifndef CONFIG_ARM64_64K_PAGES
  42. #define pmd_ERROR(pmd) __pmd_error(__FILE__, __LINE__, pmd_val(pmd))
  43. #endif
  44. #define pgd_ERROR(pgd) __pgd_error(__FILE__, __LINE__, pgd_val(pgd))
  45. /*
  46. * The pgprot_* and protection_map entries will be fixed up at runtime to
  47. * include the cachable and bufferable bits based on memory policy, as well as
  48. * any architecture dependent bits like global/ASID and SMP shared mapping