xref: /openbmc/linux/arch/nios2/include/asm/pgtable-bits.h (revision 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e)
1cbd15b3fSLey Foon Tan /*
2cbd15b3fSLey Foon Tan  * Copyright (C) 2011 Tobias Klauser <tklauser@distanz.ch>
3cbd15b3fSLey Foon Tan  * Copyright (C) 2009 Wind River Systems Inc
4cbd15b3fSLey Foon Tan  *
5cbd15b3fSLey Foon Tan  * This file is subject to the terms and conditions of the GNU General Public
6cbd15b3fSLey Foon Tan  * License.  See the file "COPYING" in the main directory of this archive
7cbd15b3fSLey Foon Tan  * for more details.
8cbd15b3fSLey Foon Tan  */
9cbd15b3fSLey Foon Tan 
10cbd15b3fSLey Foon Tan #ifndef _ASM_NIOS2_PGTABLE_BITS_H
11cbd15b3fSLey Foon Tan #define _ASM_NIOS2_PGTABLE_BITS_H
12cbd15b3fSLey Foon Tan 
13cbd15b3fSLey Foon Tan /*
14cbd15b3fSLey Foon Tan  * These are actual hardware defined protection bits in the tlbacc register
15cbd15b3fSLey Foon Tan  * which looks like this:
16cbd15b3fSLey Foon Tan  *
17cbd15b3fSLey Foon Tan  * 31 30 ... 26 25 24 23 22 21 20 19 18 ...  1  0
18cbd15b3fSLey Foon Tan  * ignored........  C  R  W  X  G PFN............
19cbd15b3fSLey Foon Tan  */
20cbd15b3fSLey Foon Tan #define _PAGE_GLOBAL	(1<<20)
21cbd15b3fSLey Foon Tan #define _PAGE_EXEC	(1<<21)
22cbd15b3fSLey Foon Tan #define _PAGE_WRITE	(1<<22)
23cbd15b3fSLey Foon Tan #define _PAGE_READ	(1<<23)
24cbd15b3fSLey Foon Tan #define _PAGE_CACHED	(1<<24)	/* C: data access cacheable */
25cbd15b3fSLey Foon Tan 
26cbd15b3fSLey Foon Tan /*
27cbd15b3fSLey Foon Tan  * Software defined bits. They are ignored by the hardware and always read back
28cbd15b3fSLey Foon Tan  * as zero, but can be written as non-zero.
29cbd15b3fSLey Foon Tan  */
30cbd15b3fSLey Foon Tan #define _PAGE_PRESENT	(1<<25)	/* PTE contains a translation */
31cbd15b3fSLey Foon Tan #define _PAGE_ACCESSED	(1<<26)	/* page referenced */
32cbd15b3fSLey Foon Tan #define _PAGE_DIRTY	(1<<27)	/* dirty page */
33cbd15b3fSLey Foon Tan 
34*4d1d955fSDavid Hildenbrand /* We borrow bit 31 to store the exclusive marker in swap PTEs. */
35*4d1d955fSDavid Hildenbrand #define _PAGE_SWP_EXCLUSIVE	(1<<31)
36*4d1d955fSDavid Hildenbrand 
37cbd15b3fSLey Foon Tan #endif /* _ASM_NIOS2_PGTABLE_BITS_H */
38