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