summaryrefslogtreecommitdiff
path: root/sys/arch/sgi
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2012-03-25 13:52:53 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2012-03-25 13:52:53 +0000
commit5c4f5d2da5b052b21db5e6c68194f2e2a7f86090 (patch)
tree53ce607240fcf92f6eeaa2b65bc3dff9e9a526b8 /sys/arch/sgi
parent39d954f78803650f7d251609c0d107507c223da6 (diff)
Move cache handling routines related definitions to a dedicated header file,
rather than abusing <machine/cpu.h>.
Diffstat (limited to 'sys/arch/sgi')
-rw-r--r--sys/arch/sgi/include/autoconf.h12
-rw-r--r--sys/arch/sgi/sgi/bus_dma.c14
-rw-r--r--sys/arch/sgi/sgi/ip30_machdep.c3
-rw-r--r--sys/arch/sgi/sgi/machdep.c3
4 files changed, 16 insertions, 16 deletions
diff --git a/sys/arch/sgi/include/autoconf.h b/sys/arch/sgi/include/autoconf.h
index e9205f8a9c4..b71366edba6 100644
--- a/sys/arch/sgi/include/autoconf.h
+++ b/sys/arch/sgi/include/autoconf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.h,v 1.31 2010/04/06 19:15:26 miod Exp $ */
+/* $OpenBSD: autoconf.h,v 1.32 2012/03/25 13:52:52 miod Exp $ */
/*
* Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -46,11 +46,11 @@ struct sys_rec {
/* Published cache operations. */
void (*_SyncCache)(struct cpu_info *);
- void (*_InvalidateICache)(struct cpu_info *, vaddr_t, size_t);
- void (*_SyncDCachePage)(struct cpu_info *, vaddr_t);
- void (*_HitSyncDCache)(struct cpu_info *, vaddr_t, size_t);
- void (*_IOSyncDCache)(struct cpu_info *, vaddr_t, size_t, int);
- void (*_HitInvalidateDCache)(struct cpu_info *, vaddr_t, size_t);
+ void (*_InvalidateICache)(struct cpu_info *, uint64_t, size_t);
+ void (*_SyncDCachePage)(struct cpu_info *, uint64_t);
+ void (*_HitSyncDCache)(struct cpu_info *, uint64_t, size_t);
+ void (*_IOSyncDCache)(struct cpu_info *, uint64_t, size_t, int);
+ void (*_HitInvalidateDCache)(struct cpu_info *, uint64_t, size_t);
/* Serial console configuration. */
struct mips_bus_space console_io;
diff --git a/sys/arch/sgi/sgi/bus_dma.c b/sys/arch/sgi/sgi/bus_dma.c
index 520b9a3139f..ff704442e39 100644
--- a/sys/arch/sgi/sgi/bus_dma.c
+++ b/sys/arch/sgi/sgi/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.23 2012/03/15 18:57:22 miod Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.24 2012/03/25 13:52:52 miod Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -64,6 +64,7 @@
#include <uvm/uvm.h>
#include <mips64/archtype.h>
+#include <mips64/cache.h>
#include <machine/cpu.h>
#include <machine/autoconf.h>
@@ -306,9 +307,6 @@ void
_dmamap_sync(bus_dma_tag_t t, bus_dmamap_t map, bus_addr_t addr,
bus_size_t size, int op)
{
-#define SYNC_R 0 /* WB invalidate, WT invalidate */
-#define SYNC_W 1 /* WB writeback + invalidate, WT unaffected */
-#define SYNC_X 2 /* WB writeback + invalidate, WT invalidate */
int nsegs;
int curseg;
struct cpu_info *ci = curcpu();
@@ -354,21 +352,21 @@ _dmamap_sync(bus_dma_tag_t t, bus_dmamap_t map, bus_addr_t addr,
if (op & BUS_DMASYNC_PREWRITE) {
#ifdef TGT_COHERENT
Mips_IOSyncDCache(ci, vaddr, paddr,
- ssize, SYNC_W);
+ ssize, CACHE_SYNC_W);
#else
if (op & BUS_DMASYNC_PREREAD)
Mips_IOSyncDCache(ci, vaddr, paddr,
- ssize, SYNC_X);
+ ssize, CACHE_SYNC_X);
else
Mips_IOSyncDCache(ci, vaddr, paddr,
- ssize, SYNC_W);
+ ssize, CACHE_SYNC_W);
#endif
} else
if (op & (BUS_DMASYNC_PREREAD | BUS_DMASYNC_POSTREAD)) {
#ifdef TGT_COHERENT
#else
Mips_IOSyncDCache(ci, vaddr, paddr,
- ssize, SYNC_R);
+ ssize, CACHE_SYNC_R);
#endif
}
size -= ssize;
diff --git a/sys/arch/sgi/sgi/ip30_machdep.c b/sys/arch/sgi/sgi/ip30_machdep.c
index 25b2e42948e..4a2d5dc02e2 100644
--- a/sys/arch/sgi/sgi/ip30_machdep.c
+++ b/sys/arch/sgi/sgi/ip30_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip30_machdep.c,v 1.49 2012/03/16 15:25:05 deraadt Exp $ */
+/* $OpenBSD: ip30_machdep.c,v 1.50 2012/03/25 13:52:52 miod Exp $ */
/*
* Copyright (c) 2008, 2009 Miodrag Vallat.
@@ -28,6 +28,7 @@
#include <sys/tty.h>
#include <mips64/arcbios.h>
+#include <mips64/cache.h>
#include <machine/autoconf.h>
#include <machine/bus.h>
diff --git a/sys/arch/sgi/sgi/machdep.c b/sys/arch/sgi/sgi/machdep.c
index 4b511712f04..0d4f8811c2a 100644
--- a/sys/arch/sgi/sgi/machdep.c
+++ b/sys/arch/sgi/sgi/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.113 2012/03/15 18:57:22 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.114 2012/03/25 13:52:52 miod Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -53,6 +53,7 @@
#include <machine/db_machdep.h>
#include <ddb/db_interface.h>
+#include <mips64/cache.h>
#include <machine/cpu.h>
#include <machine/frame.h>
#include <machine/autoconf.h>