uClibc_page.h 752 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (C) 2016 Andes Technology, Inc.
  3. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  4. */
  5. #ifndef _UCLIBC_PAGE_H
  6. #define _UCLIBC_PAGE_H
  7. /*
  8. * Linux/NDS32 supports 4k and 8k pages (build time).
  9. *
  10. * Although uClibc determines page size dynamically from kernel's auxv
  11. * still the generic code needs a fall back
  12. * _dl_pagesize = auxvt[AT_PAGESZ].a_un.a_val ? : PAGE_SIZE
  13. */
  14. #include <features.h>
  15. #if defined(__CONFIG_NDS32_PAGE_SIZE_8K__)
  16. #define PAGE_SHIFT 13
  17. #else
  18. #define PAGE_SHIFT 12
  19. #endif
  20. #define PAGE_SIZE (1UL << PAGE_SHIFT)
  21. #define PAGE_MASK (~(PAGE_SIZE-1))
  22. /* TBD: fix this with runtime value for a PAGE_SIZE agnostic uClibc */
  23. #define MMAP2_PAGE_SHIFT PAGE_SHIFT
  24. #endif /* _UCLIBC_PAGE_H */