1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
13:
14: 15: 16: 17: 18: 19:
20:
21: #ifndef __SYS_SYSDEF_DEPEND_CORE_H__
22: #define __SYS_SYSDEF_DEPEND_CORE_H__
23:
24:
25: 26: 27:
28: #define PSR_N 0x80000000
29: #define PSR_Z 0x40000000
30: #define PSR_C 0x20000000
31: #define PSR_V 0x10000000
32: #define PSR_Q 0x08000000
33: #define PSR_GE 0x000f0000
34:
35: #define PSR_J 0x01000000
36: #define PSR_IT 0x0600fc00
37: #define PSR_E 0x00000200
38: #define PSR_A 0x00000100
39: #define PSR_I 0x00000080
40: #define PSR_F 0x00000040
41: #define PSR_T 0x00000020
42:
43: #define PSR_M(n) ( n )
44: #define PSR_USR PSR_M(16)
45: #define PSR_FIQ PSR_M(17)
46: #define PSR_IRQ PSR_M(18)
47: #define PSR_SVC PSR_M(19)
48: #define PSR_ABT PSR_M(23)
49: #define PSR_UND PSR_M(27)
50: #define PSR_SYS PSR_M(31)
51:
52: #define PSR_DI ( PSR_I|PSR_A )
53:
54: 55: 56:
57: #define CP15_SCTLR_I 0x00001000
58: #define CP15_SCTLR_Z 0x00000800
59: #define CP15_SCTLR_C 0x00000004
60: #define CP15_SCTLR_A 0x00000002
61: #define CP15_SCTLR_M 0x00000001
62: #define CP15_SCTLR_V 0x00002000
63:
64: 65: 66:
67: #define CP15_ACTLR_DPF 0x00000004
68:
69:
70:
71: 72: 73:
74: #define SVC_SYSCALL 6
75: #define SVC_FORCE_DISPATCH 7
76: #define SVC_DISPATCH 8
77: #define SVC_DEBUG_SUPPORT 9
78: #define SVC_EXTENDED_SVC 10
79:
80:
81: 82: 83:
84: #define N_SVCHDR (11)
85:
86:
87:
88: 89: 90: 91:
92:
93:
94: #define GICD_CTLR (GICD_BASE + 0x0000)
95: #define GICD_TYPER (GICD_BASE + 0x0004)
96: #define GICD_IIDR (GICD_BASE + 0x0008)
97:
98: #define GICD_IGROUPR(n) (GICD_BASE + 0x0080 + (0x04*(n)))
99: #define GICD_ISENABLER(n) (GICD_BASE + 0x0100 + (0x04*(n)))
100: #define GICD_ICENABLER(n) (GICD_BASE + 0x0180 + (0x04*(n)))
101: #define GICD_ISPENDR(n) (GICD_BASE + 0x0200 + (0x04*(n)))
102: #define GICD_ICPENDR(n) (GICD_BASE + 0x0280 + (0x04*(n)))
103: #define GICD_ISACTIVER(n) (GICD_BASE + 0x0300 + (0x04*(n)))
104: #define GICD_ICACTIVER(n) (GICD_BASE + 0x0380 + (0x04*(n)))
105: #define GICD_IPRIORITYR(n) (GICD_BASE + 0x0400 + (0x04*(n)))
106: #define GICD_ITARGETR(n) (GICD_BASE + 0x0800 + (0x04*(n)))
107: #define GICD_ICFGR(n) (GICD_BASE + 0x0C00 + (0x04*(n)))
108: #define GICD_PPISR (GICD_BASE + 0x0D00)
109: #define GICD_SPISR(n) (GICD_BASE + 0x0D04 + (0x04*(n)))
110: #define GICD_SGIR (GICD_BASE + 0x0F00)
111: #define GICD_CPENDSGIR(n) (GICD_BASE + 0x0F10 + (0x04*(n)))
112: #define GICD_SPENDSGIR(n) (GICD_BASE + 0x0F20 + (0x04*(n)))
113:
114: #define GICD_PIDR4 (GICD_BASE + 0x0FD0)
115: #define GICD_PIDR5 (GICD_BASE + 0x0FD4)
116: #define GICD_PIDR6 (GICD_BASE + 0x0FD8)
117: #define GICD_PIDR7 (GICD_BASE + 0x0FDC)
118: #define GICD_PIDR0 (GICD_BASE + 0x0FE0)
119: #define GICD_PIDR1 (GICD_BASE + 0x0FE4)
120: #define GICD_PIDR2 (GICD_BASE + 0x0FE8)
121: #define GICD_PIDR3 (GICD_BASE + 0x0FEC)
122:
123: #define GICD_CIDR0 (GICD_BASE + 0x0FF0)
124: #define GICD_CIDR1 (GICD_BASE + 0x0FF4)
125: #define GICD_CIDR2 (GICD_BASE + 0x0FF8)
126: #define GICD_CIDR3 (GICD_BASE + 0x0FFC)
127:
128:
129: #define GICD_IGROUPR_N 16
130: #define GICD_ICFGR_N 32
131: #define GICD_IPRIORITYR_N 128
132: #define GICD_ITARGETR_N 128
133: #define GICD_ISENABLER_N 16
134: #define GICD_ICENABLER_N 16
135:
136:
137: #define GICC_CTLR (GICC_BASE + 0x0000)
138: #define GICC_PMR (GICC_BASE + 0x0004)
139: #define GICC_BPR (GICC_BASE + 0x0008)
140: #define GICC_IAR (GICC_BASE + 0x000C)
141: #define GICC_EOIR (GICC_BASE + 0x0010)
142: #define GICC_RPR (GICC_BASE + 0x0014)
143: #define GICC_HPPIR (GICC_BASE + 0x0018)
144: #define GICC_ABPR (GICC_BASE + 0x001C)
145: #define GICC_AIAR (GICC_BASE + 0x0020)
146: #define GICC_AEOIR (GICC_BASE + 0x0024)
147: #define GICC_AHPPIR (GICC_BASE + 0x0028)
148: #define GICC_APR0 (GICC_BASE + 0x00D0)
149: #define GICC_NSAPR0 (GICC_BASE + 0x00E0)
150: #define GICC_IIDR (GICC_BASE + 0x00FC)
151: #define GICC_DIR (GICC_BASE + 0x1000)
152:
153:
154: 155: 156:
157: #define FPSCR_N 0x80000000
158: #define FPSCR_Z 0x40000000
159: #define FPSCR_C 0x20000000
160: #define FPSCR_V 0x10000000
161: #define FPSCR_AHP 0x04000000
162: #define FPSCR_DN 0x02000000
163: #define FPSCR_FZ 0x01000000
164: #define FPSCR_RMODE(n) ( (n) << 22 )
165: #define FPSCR_STRIDE(n) ( (n) << 20 )
166: #define FPSCR_LEN(n) ( (n) << 16 )
167: #define FPSCR_IDE 0x00008000
168: #define FPSCR_IXE 0x00001000
169: #define FPSCR_UFE 0x00000800
170: #define FPSCR_OFE 0x00000400
171: #define FPSCR_DZE 0x00000200
172: #define FPSCR_IOE 0x00000100
173: #define FPSCR_IDC 0x00000080
174: #define FPSCR_IXC 0x00000010
175: #define FPSCR_UFC 0x00000008
176: #define FPSCR_OFC 0x00000004
177: #define FPSCR_DZC 0x00000002
178: #define FPSCR_IOC 0x00000001
179:
180: #define FPSCR_INIT 0x00000000
181:
182:
183:
184: 185: 186: 187: 188: 189:
190: #define ISB() Asm("isb")
191: #define DSB() Asm("dsb")
192: #define DMB() Asm("dmb")
193:
194:
195: 196: 197: 198: 199: 200:
201: #if USE_FPU
202: #define MIN_SYS_STACK_SIZE (sizeof(SStackFrame)+sizeof(FPUContext)+128)
203: #else
204: #define MIN_SYS_STACK_SIZE (sizeof(SStackFrame)+128)
205: #endif
206: 207: 208:
209:
210: #define DEFAULT_SYS_STKSZ (MIN_SYS_STACK_SIZE)
211:
212:
213: 214: 215:
216: #define FIQ_STACK_SIZE (256)
217: #define UND_STACK_SIZE (256)
218: #define ABT_STACK_SIZE (256)
219:
220:
221: 222: 223: 224:
225: #define INTHDR_DIS_FPU 1
226:
227: #endif