page.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Based on arch/arm/include/asm/page.h
  3. *
  4. * Copyright (C) 1995-2003 Russell King
  5. * Copyright (C) 2012 ARM Ltd.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef __ASM_PAGE_H
  20. #define __ASM_PAGE_H
  21. /* PAGE_SHIFT determines the page size */
  22. #ifdef CONFIG_ARM64_64K_PAGES
  23. #define PAGE_SHIFT 16
  24. #else
  25. #define PAGE_SHIFT 12
  26. #endif
  27. #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
  28. #define PAGE_MASK (~(PAGE_SIZE-1))
  29. /* We do define AT_SYSINFO_EHDR but don't use the gate mechanism */
  30. #define __HAVE_ARCH_GATE_AREA 1
  31. #ifndef __ASSEMBLY__
  32. #ifdef CONFIG_ARM64_64K_PAGES
  33. #include <asm/pgtable-2level-types.h>
  34. #else
  35. #include <asm/pgtable-3level-types.h>
  36. #endif
  37. extern void __cpu_clear_user_page(void *p, unsigned long user);
  38. extern void __cpu_copy_user_page(void *to, const void *from,
  39. unsigned long user);
  40. extern void copy_page(void *to, const void *from);
  41. extern void clear_page(void *to);
  42. #define clear_user_page(addr,vaddr,pg) __cpu_clear_user_page(addr, vaddr)
  43. #define copy_user_page(to,from,vaddr,pg) __cpu_copy_user_page(to, from, vaddr)
  44. typedef struct page *pgtable_t;
  45. #ifdef CONFIG_HAVE_ARCH_PFN_VALID
  46. extern int pfn_valid(unsigned long);
  47. #endif
  48. #include <asm/memory.h>
  49. #endif /* !__ASSEMBLY__ */
  50. #define VM_DATA_DEFAULT_FLAGS \
  51. (((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) | \
  52. VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
  53. #include <asm-generic/getorder.h>
  54. #endif