diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2007-11-24 17:27:39 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2007-11-24 17:27:39 +0000 |
commit | 9102b876462357d73c2b83c97f3a0cf880e85c81 (patch) | |
tree | 0dbc1de95e5b6fc5022ac55b176e78ed82b9ab98 /sys/arch/mvme88k | |
parent | e5d088836945cef7d6e3fa2cc5c6209226cee37c (diff) |
Fix a stupid underscore bug in memory area computations in the cache functions,
it's amazing things didn't break.
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r-- | sys/arch/mvme88k/mvme88k/m88110.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/sys/arch/mvme88k/mvme88k/m88110.c b/sys/arch/mvme88k/mvme88k/m88110.c index e3c041a03c1..e682a85093c 100644 --- a/sys/arch/mvme88k/mvme88k/m88110.c +++ b/sys/arch/mvme88k/mvme88k/m88110.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m88110.c,v 1.44 2007/11/22 23:33:42 miod Exp $ */ +/* $OpenBSD: m88110.c,v 1.45 2007/11/24 17:27:38 miod Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * All rights reserved. @@ -517,7 +517,7 @@ m88110_dma_cachectl(pmap_t pmap, vaddr_t _va, vsize_t _size, int op) void (*flusher)(paddr_t, psize_t); va = trunc_cache_line(_va); - size = round_cache_line(_va + size) - va; + size = round_cache_line(_va + _size) - va; switch (op) { case DMA_CACHE_SYNC: @@ -541,7 +541,8 @@ m88110_dma_cachectl(pmap_t pmap, vaddr_t _va, vsize_t _size, int op) if (!ISSET(get_dctl(), CMMU_DCTL_CEN)) size = 0; - mc88110_inval_inst(); + if (op != DMA_CACHE_SYNC) + mc88110_inval_inst(); while (size != 0) { count = (va & PAGE_MASK) == 0 && size >= PAGE_SIZE ? PAGE_SIZE : MC88110_CACHE_LINE; @@ -568,7 +569,7 @@ m88410_dma_cachectl(pmap_t pmap, vaddr_t _va, vsize_t _size, int op) void (*ext_flusher)(void); va = trunc_cache_line(_va); - size = round_cache_line(_va + size) - va; + size = round_cache_line(_va + _size) - va; switch (op) { case DMA_CACHE_SYNC: @@ -597,7 +598,8 @@ m88410_dma_cachectl(pmap_t pmap, vaddr_t _va, vsize_t _size, int op) if (!ISSET(get_dctl(), CMMU_DCTL_CEN)) size = 0; - mc88110_inval_inst(); + if (op != DMA_CACHE_SYNC) + mc88110_inval_inst(); while (size != 0) { count = (va & PAGE_MASK) == 0 && size >= PAGE_SIZE ? PAGE_SIZE : MC88110_CACHE_LINE; @@ -624,7 +626,7 @@ m88110_dma_cachectl_pa(paddr_t _pa, psize_t _size, int op) void (*flusher)(paddr_t, psize_t); pa = trunc_cache_line(_pa); - size = round_cache_line(_pa + size) - pa; + size = round_cache_line(_pa + _size) - pa; switch (op) { case DMA_CACHE_SYNC: @@ -648,7 +650,8 @@ m88110_dma_cachectl_pa(paddr_t _pa, psize_t _size, int op) if (!ISSET(get_dctl(), CMMU_DCTL_CEN)) size = 0; - mc88110_inval_inst(); + if (op != DMA_CACHE_SYNC) + mc88110_inval_inst(); while (size != 0) { count = (pa & PAGE_MASK) == 0 && size >= PAGE_SIZE ? PAGE_SIZE : MC88110_CACHE_LINE; @@ -672,7 +675,7 @@ m88410_dma_cachectl_pa(paddr_t _pa, psize_t _size, int op) void (*ext_flusher)(void); pa = trunc_cache_line(_pa); - size = round_cache_line(_pa + size) - pa; + size = round_cache_line(_pa + _size) - pa; switch (op) { case DMA_CACHE_SYNC: @@ -701,7 +704,8 @@ m88410_dma_cachectl_pa(paddr_t _pa, psize_t _size, int op) if (!ISSET(get_dctl(), CMMU_DCTL_CEN)) size = 0; - mc88110_inval_inst(); + if (op != DMA_CACHE_SYNC) + mc88110_inval_inst(); while (size != 0) { count = (pa & PAGE_MASK) == 0 && size >= PAGE_SIZE ? PAGE_SIZE : MC88110_CACHE_LINE; |