summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2013-03-27 00:06:09 +0000
committerpatrick <patrick@openbsd.org>2013-03-27 00:06:09 +0000
commit4f4b8f539170b019a0242cf89d50f363a193e400 (patch)
tree98494ef1d8d9662d22b5f7c05c7fd972e83bcb9e
parenti broke it. tailq is now simpleq in pool. (diff)
downloadwireguard-openbsd-4f4b8f539170b019a0242cf89d50f363a193e400.tar.xz
wireguard-openbsd-4f4b8f539170b019a0242cf89d50f363a193e400.zip
Add prototypes for secondary cache operations.
ok miod@
-rw-r--r--sys/arch/arm/arm/cpufunc.c47
-rw-r--r--sys/arch/arm/include/cpufunc.h13
2 files changed, 58 insertions, 2 deletions
diff --git a/sys/arch/arm/arm/cpufunc.c b/sys/arch/arm/arm/cpufunc.c
index e8922a7bae1..56ec86fd073 100644
--- a/sys/arch/arm/arm/cpufunc.c
+++ b/sys/arch/arm/arm/cpufunc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpufunc.c,v 1.19 2013/03/22 21:24:11 patrick Exp $ */
+/* $OpenBSD: cpufunc.c,v 1.20 2013/03/27 00:06:09 patrick Exp $ */
/* $NetBSD: cpufunc.c,v 1.65 2003/11/05 12:53:15 scw Exp $ */
/*
@@ -135,6 +135,11 @@ struct cpu_functions arm8_cpufuncs = {
arm8_cache_purgeID, /* idcache_wbinv_all */
(void *)arm8_cache_purgeID, /* idcache_wbinv_range */
+ cpufunc_nullop, /* sdcache_wbinv_all */
+ (void *)cpufunc_nullop, /* sdcache_wbinv_range */
+ (void *)cpufunc_nullop, /* sdcache_inv_range */
+ (void *)cpufunc_nullop, /* sdcache_wb_range */
+
/* Other functions */
cpufunc_nullop, /* flush_prefetchbuf */
@@ -188,6 +193,11 @@ struct cpu_functions arm9_cpufuncs = {
arm9_idcache_wbinv_all, /* idcache_wbinv_all */
arm9_idcache_wbinv_range, /* idcache_wbinv_range */
+ cpufunc_nullop, /* sdcache_wbinv_all */
+ (void *)cpufunc_nullop, /* sdcache_wbinv_range */
+ (void *)cpufunc_nullop, /* sdcache_inv_range */
+ (void *)cpufunc_nullop, /* sdcache_wb_range */
+
/* Other functions */
cpufunc_nullop, /* flush_prefetchbuf */
@@ -241,6 +251,11 @@ struct cpu_functions armv5_ec_cpufuncs = {
armv5_ec_idcache_wbinv_all, /* idcache_wbinv_all */
armv5_ec_idcache_wbinv_range, /* idcache_wbinv_range */
+ cpufunc_nullop, /* sdcache_wbinv_all */
+ (void *)cpufunc_nullop, /* sdcache_wbinv_range */
+ (void *)cpufunc_nullop, /* sdcache_inv_range */
+ (void *)cpufunc_nullop, /* sdcache_wb_range */
+
/* Other functions */
cpufunc_nullop, /* flush_prefetchbuf */
@@ -294,6 +309,11 @@ struct cpu_functions arm10_cpufuncs = {
armv5_idcache_wbinv_all, /* idcache_wbinv_all */
armv5_idcache_wbinv_range, /* idcache_wbinv_range */
+ cpufunc_nullop, /* sdcache_wbinv_all */
+ (void *)cpufunc_nullop, /* sdcache_wbinv_range */
+ (void *)cpufunc_nullop, /* sdcache_inv_range */
+ (void *)cpufunc_nullop, /* sdcache_wb_range */
+
/* Other functions */
cpufunc_nullop, /* flush_prefetchbuf */
@@ -346,6 +366,11 @@ struct cpu_functions arm11_cpufuncs = {
armv5_idcache_wbinv_all, /* idcache_wbinv_all */
armv5_idcache_wbinv_range, /* idcache_wbinv_range */
+ cpufunc_nullop, /* sdcache_wbinv_all */
+ (void *)cpufunc_nullop, /* sdcache_wbinv_range */
+ (void *)cpufunc_nullop, /* sdcache_inv_range */
+ (void *)cpufunc_nullop, /* sdcache_wb_range */
+
/* Other functions */
cpufunc_nullop, /* flush_prefetchbuf */
@@ -398,6 +423,11 @@ struct cpu_functions armv7_cpufuncs = {
armv7_idcache_wbinv_all, /* idcache_wbinv_all */
armv7_idcache_wbinv_range, /* idcache_wbinv_range */
+ cpufunc_nullop, /* sdcache_wbinv_all */
+ (void *)cpufunc_nullop, /* sdcache_wbinv_range */
+ (void *)cpufunc_nullop, /* sdcache_inv_range */
+ (void *)cpufunc_nullop, /* sdcache_wb_range */
+
/* Other functions */
cpufunc_nullop, /* flush_prefetchbuf */
@@ -451,6 +481,11 @@ struct cpu_functions sa11x0_cpufuncs = {
sa1_cache_purgeID, /* idcache_wbinv_all */
sa1_cache_purgeID_rng, /* idcache_wbinv_range */
+ cpufunc_nullop, /* sdcache_wbinv_all */
+ (void *)cpufunc_nullop, /* sdcache_wbinv_range */
+ (void *)cpufunc_nullop, /* sdcache_inv_range */
+ (void *)cpufunc_nullop, /* sdcache_wb_range */
+
/* Other functions */
sa11x0_drain_readbuf, /* flush_prefetchbuf */
@@ -503,6 +538,11 @@ struct cpu_functions ixp12x0_cpufuncs = {
sa1_cache_purgeID, /* idcache_wbinv_all */
sa1_cache_purgeID_rng, /* idcache_wbinv_range */
+ cpufunc_nullop, /* sdcache_wbinv_all */
+ (void *)cpufunc_nullop, /* sdcache_wbinv_range */
+ (void *)cpufunc_nullop, /* sdcache_inv_range */
+ (void *)cpufunc_nullop, /* sdcache_wb_range */
+
/* Other functions */
ixp12x0_drain_readbuf, /* flush_prefetchbuf */
@@ -556,6 +596,11 @@ struct cpu_functions xscale_cpufuncs = {
xscale_cache_purgeID, /* idcache_wbinv_all */
xscale_cache_purgeID_rng, /* idcache_wbinv_range */
+ cpufunc_nullop, /* sdcache_wbinv_all */
+ (void *)cpufunc_nullop, /* sdcache_wbinv_range */
+ (void *)cpufunc_nullop, /* sdcache_inv_range */
+ (void *)cpufunc_nullop, /* sdcache_wb_range */
+
/* Other functions */
cpufunc_nullop, /* flush_prefetchbuf */
diff --git a/sys/arch/arm/include/cpufunc.h b/sys/arch/arm/include/cpufunc.h
index 4f30f92b371..6729aa8916c 100644
--- a/sys/arch/arm/include/cpufunc.h
+++ b/sys/arch/arm/include/cpufunc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpufunc.h,v 1.11 2013/03/22 21:24:11 patrick Exp $ */
+/* $OpenBSD: cpufunc.h,v 1.12 2013/03/27 00:06:09 patrick Exp $ */
/* $NetBSD: cpufunc.h,v 1.29 2003/09/06 09:08:35 rearnsha Exp $ */
/*
@@ -135,6 +135,11 @@ struct cpu_functions {
void (*cf_idcache_wbinv_all) (void);
void (*cf_idcache_wbinv_range) (vaddr_t, vsize_t);
+ void (*cf_sdcache_wbinv_all) (void);
+ void (*cf_sdcache_wbinv_range) (vaddr_t, paddr_t, vsize_t);
+ void (*cf_sdcache_inv_range) (vaddr_t, paddr_t, vsize_t);
+ void (*cf_sdcache_wb_range) (vaddr_t, paddr_t, vsize_t);
+
/* Other functions */
void (*cf_flush_prefetchbuf) (void);
@@ -179,6 +184,12 @@ extern u_int cputype;
#define cpu_idcache_wbinv_all() cpufuncs.cf_idcache_wbinv_all()
#define cpu_idcache_wbinv_range(a, s) cpufuncs.cf_idcache_wbinv_range((a), (s))
+#define cpu_sdcache_enabled() (cpufuncs.cf_sdcache_wbinv_all != cpufunc_nullop)
+#define cpu_sdcache_wbinv_all() cpufuncs.cf_sdcache_wbinv_all()
+#define cpu_sdcache_wbinv_range(va, pa, s) cpufuncs.cf_sdcache_wbinv_range((va), (pa), (s))
+#define cpu_sdcache_inv_range(va, pa, s) cpufuncs.cf_sdcache_inv_range((va), (pa), (s))
+#define cpu_sdcache_wb_range(va, pa, s) cpufuncs.cf_sdcache_wb_range((va), (pa), (s))
+
#define cpu_flush_prefetchbuf() cpufuncs.cf_flush_prefetchbuf()
#define cpu_drain_writebuf() cpufuncs.cf_drain_writebuf()