summaryrefslogtreecommitdiff
path: root/sys/arch/arm/include
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2013-05-09 20:07:27 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2013-05-09 20:07:27 +0000
commit89307efdeee699ce5deeb8e6f7c527e1328869e3 (patch)
tree6fdf0a0b12d828515fd3a60f053bf6d74f1d425a /sys/arch/arm/include
parentbb458b14b6c2852decfe62ec88b95480c931e8bb (diff)
On ARMv7 we can't use the cache mask to check for coherency.
Therefore we add new macros to be able to check for it properly. ok miod@
Diffstat (limited to 'sys/arch/arm/include')
-rw-r--r--sys/arch/arm/include/pmap.h34
-rw-r--r--sys/arch/arm/include/pmap7.h34
2 files changed, 66 insertions, 2 deletions
diff --git a/sys/arch/arm/include/pmap.h b/sys/arch/arm/include/pmap.h
index b304b784a3b..91fd2aa887c 100644
--- a/sys/arch/arm/include/pmap.h
+++ b/sys/arch/arm/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.22 2013/04/26 11:51:22 patrick Exp $ */
+/* $OpenBSD: pmap.h,v 1.23 2013/05/09 20:07:26 patrick Exp $ */
/* $NetBSD: pmap.h,v 1.76 2003/09/06 09:10:46 rearnsha Exp $ */
/*
@@ -423,6 +423,10 @@ extern pt_entry_t pte_l1_s_cache_mode_pt;
extern pt_entry_t pte_l2_l_cache_mode_pt;
extern pt_entry_t pte_l2_s_cache_mode_pt;
+extern pt_entry_t pte_l1_s_coherent;
+extern pt_entry_t pte_l2_l_coherent;
+extern pt_entry_t pte_l2_s_coherent;
+
extern pt_entry_t pte_l2_s_prot_u;
extern pt_entry_t pte_l2_s_prot_w;
extern pt_entry_t pte_l2_s_prot_mask;
@@ -459,6 +463,10 @@ extern void (*pmap_zero_page_func)(struct vm_page *);
#define L1_S_CACHE_MASK_xscale (L1_S_B|L1_S_C|L1_S_XSCALE_TEX(TEX_XSCALE_X))
#define L1_S_CACHE_MASK_v7 (L1_S_B|L1_S_C|L1_S_V7_TEX(TEX_V7_X))
+#define L1_S_COHERENT_generic (L1_S_B|L1_S_C)
+#define L1_S_COHERENT_xscale (L1_S_B|L1_S_C|L1_S_XSCALE_TEX(TEX_XSCALE_X))
+#define L1_S_COHERENT_v7 (L1_S_C|L1_S_V7_TEX(TEX_V7_X))
+
#define L2_L_PROT_U (L2_AP(AP_U))
#define L2_L_PROT_W (L2_AP(AP_W))
#define L2_L_PROT_MASK (L2_L_PROT_U|L2_L_PROT_W)
@@ -467,6 +475,10 @@ extern void (*pmap_zero_page_func)(struct vm_page *);
#define L2_L_CACHE_MASK_xscale (L2_B|L2_C|L2_XSCALE_L_TEX(TEX_XSCALE_X))
#define L2_L_CACHE_MASK_v7 (L2_B|L2_C|L2_V7_L_TEX(TEX_V7_X))
+#define L2_L_COHERENT_generic (L2_B|L2_C)
+#define L2_L_COHERENT_xscale (L2_B|L2_C|L2_XSCALE_L_TEX(TEX_XSCALE_X))
+#define L2_L_COHERENT_v7 (L2_C|L2_V7_L_TEX(TEX_V7_X))
+
#define L2_S_PROT_U_generic (L2_AP(AP_U))
#define L2_S_PROT_W_generic (L2_AP(AP_W))
#define L2_S_PROT_MASK_generic (L2_S_PROT_U|L2_S_PROT_W)
@@ -483,6 +495,10 @@ extern void (*pmap_zero_page_func)(struct vm_page *);
#define L2_S_CACHE_MASK_xscale (L2_B|L2_C|L2_XSCALE_T_TEX(TEX_XSCALE_X))
#define L2_S_CACHE_MASK_v7 (L2_B|L2_C)
+#define L2_S_COHERENT_generic (L2_B|L2_C)
+#define L2_S_COHERENT_xscale (L2_B|L2_C|L2_XSCALE_T_TEX(TEX_XSCALE_X))
+#define L2_S_COHERENT_v7 (L2_C)
+
#define L1_S_PROTO_generic (L1_TYPE_S | L1_S_IMP)
#define L1_S_PROTO_xscale (L1_TYPE_S)
#define L1_S_PROTO_v7 (L1_TYPE_S)
@@ -511,6 +527,10 @@ extern void (*pmap_zero_page_func)(struct vm_page *);
#define L2_L_CACHE_MASK pte_l2_l_cache_mask
#define L2_S_CACHE_MASK pte_l2_s_cache_mask
+#define L1_S_COHERENT pte_l1_s_coherent
+#define L2_L_COHERENT pte_l2_l_coherent
+#define L2_S_COHERENT pte_l2_s_coherent
+
#define L1_S_PROTO pte_l1_s_proto
#define L1_C_PROTO pte_l1_c_proto
#define L2_S_PROTO pte_l2_s_proto
@@ -526,6 +546,10 @@ extern void (*pmap_zero_page_func)(struct vm_page *);
#define L2_L_CACHE_MASK L2_L_CACHE_MASK_generic
#define L2_S_CACHE_MASK L2_S_CACHE_MASK_generic
+#define L1_S_COHERENT L1_S_COHERENT_generic
+#define L2_L_COHERENT L2_L_COHERENT_generic
+#define L2_S_COHERENT L2_S_COHERENT_generic
+
#define L1_S_PROTO L1_S_PROTO_generic
#define L1_C_PROTO L1_C_PROTO_generic
#define L2_S_PROTO L2_S_PROTO_generic
@@ -541,6 +565,10 @@ extern void (*pmap_zero_page_func)(struct vm_page *);
#define L2_L_CACHE_MASK L2_L_CACHE_MASK_xscale
#define L2_S_CACHE_MASK L2_S_CACHE_MASK_xscale
+#define L1_S_COHERENT L1_S_COHERENT_xscale
+#define L2_L_COHERENT L2_L_COHERENT_xscale
+#define L2_S_COHERENT L2_S_COHERENT_xscale
+
#define L1_S_PROTO L1_S_PROTO_xscale
#define L1_C_PROTO L1_C_PROTO_xscale
#define L2_S_PROTO L2_S_PROTO_xscale
@@ -556,6 +584,10 @@ extern void (*pmap_zero_page_func)(struct vm_page *);
#define L2_L_CACHE_MASK L2_L_CACHE_MASK_v7
#define L2_S_CACHE_MASK L2_S_CACHE_MASK_v7
+#define L1_S_COHERENT L1_S_COHERENT_v7
+#define L2_L_COHERENT L2_L_COHERENT_v7
+#define L2_S_COHERENT L2_S_COHERENT_v7
+
#define L1_S_PROTO L1_S_PROTO_v7
#define L1_C_PROTO L1_C_PROTO_v7
#define L2_S_PROTO L2_S_PROTO_v7
diff --git a/sys/arch/arm/include/pmap7.h b/sys/arch/arm/include/pmap7.h
index 679a7865d36..1baab1daf6c 100644
--- a/sys/arch/arm/include/pmap7.h
+++ b/sys/arch/arm/include/pmap7.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap7.h,v 1.1 2013/04/30 13:00:21 patrick Exp $ */
+/* $OpenBSD: pmap7.h,v 1.2 2013/05/09 20:07:26 patrick Exp $ */
/* $NetBSD: pmap.h,v 1.76 2003/09/06 09:10:46 rearnsha Exp $ */
/*
@@ -434,6 +434,10 @@ extern pt_entry_t pte_l1_s_cache_mode_pt;
extern pt_entry_t pte_l2_l_cache_mode_pt;
extern pt_entry_t pte_l2_s_cache_mode_pt;
+extern pt_entry_t pte_l1_s_coherent;
+extern pt_entry_t pte_l2_l_coherent;
+extern pt_entry_t pte_l2_s_coherent;
+
extern pt_entry_t pte_l2_s_prot_ur;
extern pt_entry_t pte_l2_s_prot_uw;
extern pt_entry_t pte_l2_s_prot_kr;
@@ -472,6 +476,10 @@ extern void (*pmap_zero_page_func)(struct vm_page *);
#define L1_S_CACHE_MASK_xscale (L1_S_B|L1_S_C|L1_S_XSCALE_TEX(TEX_XSCALE_X))
#define L1_S_CACHE_MASK_v7 (L1_S_B|L1_S_C|L1_S_V7_TEX_MASK)
+#define L1_S_COHERENT_generic (L1_S_B|L1_S_C)
+#define L1_S_COHERENT_xscale (L1_S_B|L1_S_C|L1_S_XSCALE_TEX(TEX_XSCALE_X))
+#define L1_S_COHERENT_v7 (L1_S_C|L1_S_V7_TEX_MASK)
+
#define L2_L_PROT_KR (L2_AP(0))
#define L2_L_PROT_UR (L2_AP(AP_U))
#define L2_L_PROT_KW (L2_AP(AP_W))
@@ -482,6 +490,10 @@ extern void (*pmap_zero_page_func)(struct vm_page *);
#define L2_L_CACHE_MASK_xscale (L2_B|L2_C|L2_XSCALE_L_TEX(TEX_XSCALE_X))
#define L2_L_CACHE_MASK_v7 (L2_B|L2_C|L2_V7_L_TEX_MASK)
+#define L2_L_COHERENT_generic (L2_B|L2_C)
+#define L2_L_COHERENT_xscale (L2_B|L2_C|L2_XSCALE_L_TEX(TEX_XSCALE_X))
+#define L2_L_COHERENT_v7 (L2_C|L2_V7_L_TEX_MASK)
+
#define L2_S_PROT_UR_generic (L2_AP(AP_U))
#define L2_S_PROT_UW_generic (L2_AP(AP_U|AP_W))
#define L2_S_PROT_KR_generic (L2_AP(0))
@@ -504,6 +516,10 @@ extern void (*pmap_zero_page_func)(struct vm_page *);
#define L2_S_CACHE_MASK_xscale (L2_B|L2_C|L2_XSCALE_T_TEX(TEX_XSCALE_X))
#define L2_S_CACHE_MASK_v7 (L2_B|L2_C|L2_V7_S_TEX_MASK)
+#define L2_S_COHERENT_generic (L2_B|L2_C)
+#define L2_S_COHERENT_xscale (L2_B|L2_C|L2_XSCALE_T_TEX(TEX_XSCALE_X))
+#define L2_S_COHERENT_v7 (L2_C|L2_V7_S_TEX_MASK)
+
#define L1_S_PROTO_generic (L1_TYPE_S | L1_S_IMP)
#define L1_S_PROTO_xscale (L1_TYPE_S)
#define L1_S_PROTO_v7 (L1_TYPE_S)
@@ -534,6 +550,10 @@ extern void (*pmap_zero_page_func)(struct vm_page *);
#define L2_L_CACHE_MASK pte_l2_l_cache_mask
#define L2_S_CACHE_MASK pte_l2_s_cache_mask
+#define L1_S_COHERENT pte_l1_s_coherent
+#define L2_L_COHERENT pte_l2_l_coherent
+#define L2_S_COHERENT pte_l2_s_coherent
+
#define L1_S_PROTO pte_l1_s_proto
#define L1_C_PROTO pte_l1_c_proto
#define L2_S_PROTO pte_l2_s_proto
@@ -551,6 +571,10 @@ extern void (*pmap_zero_page_func)(struct vm_page *);
#define L2_L_CACHE_MASK L2_L_CACHE_MASK_generic
#define L2_S_CACHE_MASK L2_S_CACHE_MASK_generic
+#define L1_S_COHERENT L1_S_COHERENT_generic
+#define L2_L_COHERENT L2_L_COHERENT_generic
+#define L2_S_COHERENT L2_S_COHERENT_generic
+
#define L1_S_PROTO L1_S_PROTO_generic
#define L1_C_PROTO L1_C_PROTO_generic
#define L2_S_PROTO L2_S_PROTO_generic
@@ -568,6 +592,10 @@ extern void (*pmap_zero_page_func)(struct vm_page *);
#define L2_L_CACHE_MASK L2_L_CACHE_MASK_xscale
#define L2_S_CACHE_MASK L2_S_CACHE_MASK_xscale
+#define L1_S_COHERENT L1_S_COHERENT_xscale
+#define L2_L_COHERENT L2_L_COHERENT_xscale
+#define L2_S_COHERENT L2_S_COHERENT_xscale
+
#define L1_S_PROTO L1_S_PROTO_xscale
#define L1_C_PROTO L1_C_PROTO_xscale
#define L2_S_PROTO L2_S_PROTO_xscale
@@ -585,6 +613,10 @@ extern void (*pmap_zero_page_func)(struct vm_page *);
#define L2_L_CACHE_MASK L2_L_CACHE_MASK_v7
#define L2_S_CACHE_MASK L2_S_CACHE_MASK_v7
+#define L1_S_COHERENT L1_S_COHERENT_v7
+#define L2_L_COHERENT L2_L_COHERENT_v7
+#define L2_S_COHERENT L2_S_COHERENT_v7
+
#define L1_S_PROTO L1_S_PROTO_v7
#define L1_C_PROTO L1_C_PROTO_v7
#define L2_S_PROTO L2_S_PROTO_v7