2 Copyright © 2014, The AROS Development Team. All rights reserved.
5 Desc: The purpose of the system control coprocessor, CP15, is to control and provide status information for the functions implemented in the processor.
10 #define ASM_ARM_CP15_H
12 #include <exec/types.h>
15 #ifdef __ARM_ARCH_7A__
16 /* C1, (C)ontrol (R)egister */
28 #define C1CRF_M (1UL<<C1CRB_M)
29 #define C1CRF_A (1UL<<C1CRB_A)
30 #define C1CRF_C (1UL<<C1CRB_C)
31 #define C1CRF_Z (1UL<<C1CRB_Z)
32 #define C1CRF_I (1UL<<C1CRB_I)
33 #define C1CRF_V (1UL<<C1CRB_V)
34 #define C1CRF_EE (1UL<<C1CRB_EE)
35 #define C1CRF_NMFI (1UL<<C1CRB_NMFI)
36 #define C1CRF_TRE (1UL<<C1CRB_TRE)
37 #define C1CRF_AFE (1UL<<C1CRB_AFE)
38 #define C1CRF_TE (1UL<<C1CRB_TE)
39 /* C1 (C)oprocessor (A)ccess (C)ontrol (R)egister */
40 #define C1CACRF_CPAP 0b00000011111111111111111111111111
41 #define C1CACRV_CPAP(cp) (((0b11)<<(cp*2)) & C1CACRF_CPAP)
42 #endif /* __ARM_ARCH_7A__ */
44 /* C1 (C)ontrol (R)egister SET */
45 static inline void CP15_C1CR_Set(uint32_t val
) {
47 asm volatile ("mrc p15, 0, %0, c1, c0, 0":"=r"(__v
));
49 asm volatile ("mcr p15, 0, %0, c1, c0, 0"::"r"(__v
));
52 /* C1 (C)ontrol (R)egister CLEAR */
53 static inline void CP15_C1CR_Clear(uint32_t val
) {
55 asm volatile ("mrc p15, 0, %0, c1, c0, 0":"=r"(__v
));
57 asm volatile ("mcr p15, 0, %0, c1, c0, 0"::"r"(__v
));
60 /* C1 (C)oprocessor (A)ccess (C)ontrol (R)egister SET ALL */
61 static inline void CP15_C1CACR_All(uint32_t val
) {
63 asm volatile ("mrc p15, 0, %0, c1, c0, 2":"=r"(__v
));
65 asm volatile ("mcr p15, 0, %0, c1, c0, 2"::"r"(__v
));
69 /* C1 (C)oprocessor (A)ccess (C)ontrol (R)egister SET NONE */
70 static inline void CP15_C1CACR_None(uint32_t val
) {
72 asm volatile ("mrc p15, 0, %0, c1, c0, 2":"=r"(__v
));
74 asm volatile ("mcr p15, 0, %0, c1, c0, 2"::"r"(__v
));
78 #endif /* ASM_ARM_CP15_H */