diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2007-05-27 15:46:03 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2007-05-27 15:46:03 +0000 |
commit | cf1cd27fe5706a55f9f3a6e9a6adc96706990372 (patch) | |
tree | b7ae4e6650354468e1d27809e33f62c6312b063f /sys/arch/macppc | |
parent | b650e4ca7dad913dcad26f227c0dfb90c78a4eb5 (diff) |
Move powerpc to vm_page_md, 'throw it in' kettenis@
Diffstat (limited to 'sys/arch/macppc')
-rw-r--r-- | sys/arch/macppc/include/vmparam.h | 20 | ||||
-rw-r--r-- | sys/arch/macppc/macppc/dma.c | 32 |
2 files changed, 42 insertions, 10 deletions
diff --git a/sys/arch/macppc/include/vmparam.h b/sys/arch/macppc/include/vmparam.h index 485b6877706..9ace5e9b546 100644 --- a/sys/arch/macppc/include/vmparam.h +++ b/sys/arch/macppc/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.17 2006/09/18 16:57:23 marco Exp $ */ +/* $OpenBSD: vmparam.h,v 1.18 2007/05/27 15:46:02 drahn Exp $ */ /* $NetBSD: vmparam.h,v 1.1 1996/09/30 16:34:38 ws Exp $ */ /*- @@ -89,13 +89,6 @@ extern vaddr_t ppc_kvm_stolen; #define VM_PHYS_SIZE (USRIOSIZE * PAGE_SIZE) -#define __HAVE_PMAP_PHYSSEG -struct pmap_physseg { - struct pted_pv_head *pvent; - char *attrs; - /* NULL ??? */ -}; - #define VM_PHYSSEG_MAX 32 /* actually we could have this many segments */ #define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH #define VM_PHYSSEG_NOADD /* can't add RAM after vm_mem_init */ @@ -103,4 +96,15 @@ struct pmap_physseg { #define VM_NFREELIST 1 #define VM_FREELIST_DEFAULT 0 +#define __HAVE_VM_PAGE_MD +struct pv_entry; +struct vm_page_md { + LIST_HEAD(,pte_desc) pv_list; +}; + +#define VM_MDPAGE_INIT(pg) do { \ + LIST_INIT(&((pg)->mdpage.pv_list)); \ +} while (0) + + #endif diff --git a/sys/arch/macppc/macppc/dma.c b/sys/arch/macppc/macppc/dma.c index 7803b0804dd..c66dee85b48 100644 --- a/sys/arch/macppc/macppc/dma.c +++ b/sys/arch/macppc/macppc/dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dma.c,v 1.24 2005/12/17 07:31:26 miod Exp $ */ +/* $OpenBSD: dma.c,v 1.25 2007/05/27 15:46:02 drahn Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -387,8 +387,36 @@ void _dmamap_sync(bus_dma_tag_t t, bus_dmamap_t map, bus_addr_t offset, bus_size_t len, int op) { + int i; + bus_size_t minlen, wlen; + bus_addr_t pa, addr; + struct vm_page *pg; + + for (i = 0; i < map->dm_nsegs && len != 0; i++) { + /* Find the beginning segment. */ + if (offset >= map->dm_segs[i].ds_len) { + offset -= map->dm_segs[i].ds_len; + continue; + } + + minlen = len < map->dm_segs[i].ds_len - offset ? + len : map->dm_segs[i].ds_len - offset; - /* Nothing to do here. */ + addr = map->dm_segs[i].ds_addr + offset; + + switch (op) { + case BUS_DMASYNC_POSTWRITE: + for (pa = trunc_page(addr), wlen = 0; + pa < round_page(addr + minlen); + pa += PAGE_SIZE) { + pg = PHYS_TO_VM_PAGE(pa); + if (pg != NULL) + atomic_clearbits_int(&pg->pg_flags, + PG_PMAP_EXE); + } + } + + } } /* |