diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2012-03-25 13:52:53 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2012-03-25 13:52:53 +0000 |
commit | 5c4f5d2da5b052b21db5e6c68194f2e2a7f86090 (patch) | |
tree | 53ce607240fcf92f6eeaa2b65bc3dff9e9a526b8 /sys/arch/loongson | |
parent | 39d954f78803650f7d251609c0d107507c223da6 (diff) |
Move cache handling routines related definitions to a dedicated header file,
rather than abusing <machine/cpu.h>.
Diffstat (limited to 'sys/arch/loongson')
-rw-r--r-- | sys/arch/loongson/loongson/bus_dma.c | 14 | ||||
-rw-r--r-- | sys/arch/loongson/loongson/machdep.c | 3 |
2 files changed, 8 insertions, 9 deletions
diff --git a/sys/arch/loongson/loongson/bus_dma.c b/sys/arch/loongson/loongson/bus_dma.c index 912acb0b585..53f6f5cfe38 100644 --- a/sys/arch/loongson/loongson/bus_dma.c +++ b/sys/arch/loongson/loongson/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.8 2012/03/15 18:57:20 miod Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.9 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_extern.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, WT unaffected */ -#define SYNC_X 2 /* WB writeback + invalidate, WT invalidate */ int nsegs; int curseg; int cacheop; @@ -354,14 +352,14 @@ _dmamap_sync(bus_dma_tag_t t, bus_dmamap_t map, bus_addr_t addr, */ if (op & BUS_DMASYNC_PREWRITE) { if (op & BUS_DMASYNC_PREREAD) - cacheop = SYNC_X; + cacheop = CACHE_SYNC_X; else - cacheop = SYNC_W; + cacheop = CACHE_SYNC_W; } else { if (op & BUS_DMASYNC_PREREAD) - cacheop = SYNC_R; + cacheop = CACHE_SYNC_R; else if (op & BUS_DMASYNC_POSTREAD) - cacheop = SYNC_R; + cacheop = CACHE_SYNC_R; else cacheop = -1; } diff --git a/sys/arch/loongson/loongson/machdep.c b/sys/arch/loongson/loongson/machdep.c index 6b822bf40f2..d0394d8985f 100644 --- a/sys/arch/loongson/loongson/machdep.c +++ b/sys/arch/loongson/loongson/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.34 2012/03/15 18:57:20 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.35 2012/03/25 13:52:52 miod Exp $ */ /* * Copyright (c) 2009, 2010 Miodrag Vallat. @@ -70,6 +70,7 @@ #include <ddb/db_interface.h> #include <machine/autoconf.h> +#include <mips64/cache.h> #include <machine/cpu.h> #include <machine/memconf.h> #include <machine/pmon.h> |