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 
6 #ifndef _UCLIBC_PAGE_H
7 #define _UCLIBC_PAGE_H
8 
9 /*
10  * Linux/NDS32 supports 4k and 8k pages (build time).
11  *
12  * Although uClibc determines page size dynamically from kernel's auxv
13  * still the generic code needs a fall back
14  *  _dl_pagesize = auxvt[AT_PAGESZ].a_un.a_val ? : PAGE_SIZE
15  */
16 
17 #include <features.h>
18 
19 #if defined(__CONFIG_NDS32_PAGE_SIZE_8K__)
20 #define PAGE_SHIFT		13
21 #else
22 #define PAGE_SHIFT		12
23 #endif
24 
25 #define PAGE_SIZE	(1UL << PAGE_SHIFT)
26 #define PAGE_MASK	(~(PAGE_SIZE-1))
27 
28 /* TBD: fix this with runtime value for a PAGE_SIZE agnostic uClibc */
29 #define MMAP2_PAGE_SHIFT PAGE_SHIFT
30 
31 #endif /* _UCLIBC_PAGE_H */
32