FreeNOS
ARMConstant.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Niek Linnenbank
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __LIBARCH_ARM_CONSTANT_H
19 #define __LIBARCH_ARM_CONSTANT_H
20 
46 #define USR_MODE 16
47 #define IRQ_MODE 18
48 #define FIQ_MODE 17
49 #define SVC_MODE 19
50 #define ABT_MODE 23
51 #define UND_MODE 27
52 #define SYS_MODE 31
53 #define HYP_MODE 0x1a
54 #define MODE_MASK 0x1f
55 #define IRQ_BIT (1 << 7)
56 #define FIQ_BIT (1 << 6)
57 #define ASYNC_ABORT_BIT (1 << 8)
58 
69 #define ELR .long 0xe12ef30e
70 
72 #define ERET .long 0xe160006e
73 
84 #define PAGESHIFT 12
85 
94 #define DIRSHIFT 20
95 
97 #define PAGESIZE 4096
98 
105 #define PAGEDIR_MAX 4096
106 #define PAGEDIR_SIZE (PAGEDIR_MAX * sizeof(u32))
107 
116 #define PAGETAB_MAX 256
117 #define PAGETAB_SIZE (PAGETAB_MAX * sizeof(u32))
118 #define PAGETAB_SPAN (PAGETAB_MAX*PAGESIZE)
119 
121 #define PAGEMASK 0xfffff000
122 
124 #define SECTIONMASK 0xfff00000
125 
127 #define MEMALIGN 4
128 
136 #endif /* __LIBARCH_ARM_CONSTANT_H */