uClibc_page.h 874 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com)
  3. *
  4. * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
  5. */
  6. #ifndef _UCLIBC_PAGE_H
  7. #define _UCLIBC_PAGE_H
  8. /*
  9. * ARC700/linux supports 4k, 8k, 16k pages (build time).
  10. *
  11. * Although uClibc determines page size dynamically, from kernel's auxv which
  12. * ARC Linux does pass, still the generic code needs a fall back
  13. * _dl_pagesize = auxvt[AT_PAGESZ].a_un.a_val ? : PAGE_SIZE
  14. *
  15. */
  16. #include <features.h>
  17. #if defined(__CONFIG_ARC_PAGE_SIZE_16K__)
  18. #define PAGE_SHIFT 14
  19. #elif defined(__CONFIG_ARC_PAGE_SIZE_4K__)
  20. #define PAGE_SHIFT 12
  21. #else
  22. #define PAGE_SHIFT 13
  23. #endif
  24. #define PAGE_SIZE (1UL << PAGE_SHIFT)
  25. #define PAGE_MASK (~(PAGE_SIZE-1))
  26. /* TBD: fix this with runtime value for a PAGE_SIZE agnostic uClibc */
  27. #define MMAP2_PAGE_SHIFT PAGE_SHIFT
  28. #endif /* _UCLIBC_PAGE_H */